Skip to content

v0.8.7

Choose a tag to compare

@cesarandreslopez cesarandreslopez released this 08 May 15:23
· 9 commits to main since this release

[0.8.7] - 2026-05-08

Added

  • Vue Single-File Component support — new vue parser type registered alongside typescript/python/go/rust/generic. parseCodeFile now extracts <script>/<script setup> blocks via @vue/compiler-sfc, parses them as TypeScript with original line offsets preserved, and surfaces the SFC as an exported component class (named from defineOptions({ name }), the name: option, or filename PascalCase). Local-import resolution learned .vue and index.vue candidates
  • previewCodebaseSize() (src/code/preview.ts) — discovers and stats files without parsing to estimate codebase size by language and report exceedsBudget against maxFiles/maxBytes thresholds. Exposed on the facade as code.previewSize and re-exported from @cesarandreslopez/occ and @cesarandreslopez/occ/code/preview
  • buildCodebaseIndexIsolated() (src/code/isolated.ts + src/code/isolated-runner.ts) — runs buildCodebaseIndex in a forked subprocess, streams progress over IPC, and returns the result via a sectioned NDJSON tmp file (avoiding structured-clone of large indexes). Forwards AbortSignal through to the child. Exposed as code.buildIndexIsolated on the facade
  • Slim index variant (src/code/slim.ts) — slimifyIndex(index) produces a CodebaseIndexSlim with contentMode: 'none' (drops content/lines/excerpt from every parsed file and rewrites capabilities[*].content to false). Pair with parseSlimIndex(value) / validateSlimIndex(value) to round-trip across boundaries. buildCodebaseIndexIsolated({ slim: true }) returns a slim index directly. Exposed under @cesarandreslopez/occ/code/slim
  • Code-index budget controls on BuildCodebaseOptions and CodeIndexStoreOptionsmaxFiles, maxBytes, and onBudgetExceeded: 'throw' | 'truncate'. 'throw' (default) raises the new CodeIndexBudgetExceededError (code OCC_CODE_INDEX_BUDGET_EXCEEDED) carrying a structured budget field; 'truncate' keeps as many files as fit and reports the result via the new optional index.truncated: IndexTruncation field (reason, keptFiles, droppedFiles, totalFiles, totalBytes). The fingerprint hash now includes these fields so cached indexes invalidate on budget changes
  • Token-based chunking on chunkCodebase() and chunkFromIndex()CodeChunkOptions now accepts maxTokens, overlapTokens, and countTokens alongside the existing word-based knobs. Default token estimator is Math.ceil(length / 4); pass countTokens for a tokenizer-accurate count
  • openChunkCodeIndexStore(options) (alias openChunkStore) — convenience factory that opens a CodeIndexStore pinned to contentMode: 'full' so chunkFromIndex() works without re-specifying the mode. Exposed as code.openChunkStore on the facade
  • fusedSearch excerpt expansion — node excerpts now include up to 21 surrounding lines (~600 chars) instead of a single 140-char line, with blank lines collapsed and a fallback to file excerpt or signature
  • workspace describe enrichments — WorkspaceDescriptionProject now reports entryPoints, scripts, buildSystem (vite/webpack/turbo/nx/tsup/rollup/esbuild/tsc), testFramework (vitest/jest/mocha/ava/tap/playwright/cypress), and platforms (electron/tauri/mobile/capacitor). signals gained hasCode/hasDocuments/hasOfficeDocuments/hasTables/hasNotebooks presence flags. WorkspaceDescription.recommendedCalls (typed by the new WorkspaceRecommendedCall schema) suggests programmatic facade calls keyed to the detected primary type — e.g., code.previewSize + code.buildIndexIsolated for coding projects
  • Strongly typed ProgressPhase union in src/progress-event.tsProgressEvent.phase is now a ProgressPhase (no longer string), enumerating every phase emitted across the build, chunk, store, workspace, and inspect pipelines. Exported from the facade
  • @cesarandreslopez/occ/code/preview, @cesarandreslopez/occ/code/isolated, and @cesarandreslopez/occ/code/slim programmatic subpath exports in package.json (with matching typesVersions paths) for downstream consumers that want narrow imports
  • test/contextful-integration.test.ts — integration tests covering previewCodebaseSize, buildCodebaseIndexIsolated (full + slim), CodeIndexBudgetExceededError, truncation behavior, slim round-trip via parseSlimIndex, openChunkCodeIndexStore, fused-search excerpt expansion, and describeWorkspace recommended-call output

Changed

  • chunkFromIndex() error message now points to the new openChunkStore(...) factory when the index was built with a non-full content mode
  • @vue/compiler-sfc@^3.5.34 is a new runtime dependency required by the Vue SFC parser

Migration notes

  • Existing callers see no behavior change: budget controls default to no limit, chunking still defaults to word-based sizing, and code indexes built without maxFiles/maxBytes keep the same fingerprint as before. To opt into the new isolation/slim/preview paths, use the named exports from the facade (createOcc().code.{previewSize,buildIndexIsolated,openChunkStore,slimifyIndex}) or the new subpath exports

Install

Global install (requires Node.js 18+):

npm i -g @cesarandreslopez/occ

No-install usage:

npx @cesarandreslopez/occ [directories...]