v0.8.7
[0.8.7] - 2026-05-08
Added
- Vue Single-File Component support — new
vueparser type registered alongsidetypescript/python/go/rust/generic.parseCodeFilenow 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 fromdefineOptions({ name }), thename:option, or filename PascalCase). Local-import resolution learned.vueandindex.vuecandidates previewCodebaseSize()(src/code/preview.ts) — discovers and stats files without parsing to estimate codebase size by language and reportexceedsBudgetagainstmaxFiles/maxBytesthresholds. Exposed on the facade ascode.previewSizeand re-exported from@cesarandreslopez/occand@cesarandreslopez/occ/code/previewbuildCodebaseIndexIsolated()(src/code/isolated.ts+src/code/isolated-runner.ts) — runsbuildCodebaseIndexin a forked subprocess, streams progress over IPC, and returns the result via a sectioned NDJSON tmp file (avoiding structured-clone of large indexes). ForwardsAbortSignalthrough to the child. Exposed ascode.buildIndexIsolatedon the facade- Slim index variant (
src/code/slim.ts) —slimifyIndex(index)produces aCodebaseIndexSlimwithcontentMode: 'none'(dropscontent/lines/excerptfrom every parsed file and rewritescapabilities[*].contenttofalse). Pair withparseSlimIndex(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
BuildCodebaseOptionsandCodeIndexStoreOptions—maxFiles,maxBytes, andonBudgetExceeded: 'throw' | 'truncate'.'throw'(default) raises the newCodeIndexBudgetExceededError(codeOCC_CODE_INDEX_BUDGET_EXCEEDED) carrying a structuredbudgetfield;'truncate'keeps as many files as fit and reports the result via the new optionalindex.truncated: IndexTruncationfield (reason,keptFiles,droppedFiles,totalFiles,totalBytes). The fingerprint hash now includes these fields so cached indexes invalidate on budget changes - Token-based chunking on
chunkCodebase()andchunkFromIndex()—CodeChunkOptionsnow acceptsmaxTokens,overlapTokens, andcountTokensalongside the existing word-based knobs. Default token estimator isMath.ceil(length / 4); passcountTokensfor a tokenizer-accurate count openChunkCodeIndexStore(options)(aliasopenChunkStore) — convenience factory that opens aCodeIndexStorepinned tocontentMode: 'full'sochunkFromIndex()works without re-specifying the mode. Exposed ascode.openChunkStoreon the facadefusedSearchexcerpt 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 signatureworkspace describeenrichments —WorkspaceDescriptionProjectnow reportsentryPoints,scripts,buildSystem(vite/webpack/turbo/nx/tsup/rollup/esbuild/tsc),testFramework(vitest/jest/mocha/ava/tap/playwright/cypress), andplatforms(electron/tauri/mobile/capacitor).signalsgainedhasCode/hasDocuments/hasOfficeDocuments/hasTables/hasNotebookspresence flags.WorkspaceDescription.recommendedCalls(typed by the newWorkspaceRecommendedCallschema) suggests programmatic facade calls keyed to the detected primary type — e.g.,code.previewSize+code.buildIndexIsolatedfor coding projects- Strongly typed
ProgressPhaseunion insrc/progress-event.ts—ProgressEvent.phaseis now aProgressPhase(no longerstring), 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/slimprogrammatic subpath exports inpackage.json(with matchingtypesVersionspaths) for downstream consumers that want narrow importstest/contextful-integration.test.ts— integration tests coveringpreviewCodebaseSize,buildCodebaseIndexIsolated(full + slim),CodeIndexBudgetExceededError, truncation behavior, slim round-trip viaparseSlimIndex,openChunkCodeIndexStore, fused-search excerpt expansion, anddescribeWorkspacerecommended-call output
Changed
chunkFromIndex()error message now points to the newopenChunkStore(...)factory when the index was built with a non-fullcontent mode@vue/compiler-sfc@^3.5.34is 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/maxByteskeep 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...]