v0.8.8
[0.8.8] - 2026-05-08
Added
bundleWorkspace()(src/workspace/bundle.ts) — single-call workspace bundle that fans out acrossdescribeWorkspace,analyzeWorkspace,inspectWorkspaceDocumentSet,previewCodebaseSize,buildCodebaseIndexIsolated, andchunkDocument, returning a versionedWorkspaceBundle(schemaVersion: 1) withdescription,analysis,documents,codePreview,codeIndex(slim by default),documentChunks, a hierarchicaloutline(root → projects → top modules → documents → sections), per-symbolcodeDocumentReferences(regex symbol matches in markdown content), and a unifiederrorsarray. Configurable viaincludeDescription/includeAnalysis/includeDocuments/includeCode/includeDocumentChunks/includeCodeDocumentReferences/maxDocumentFiles/maxReferenceFiles/maxCodeFiles/maxCodeBytes/maxDocumentChunks/maxCodeDocumentReferences/slimCodeIndex/contentModeand the existing ignore/overlay knobs. Exposed ascreateOcc().workspace.bundleand on the@cesarandreslopez/occ/workspace/bundlesubpathchunkDocument()(src/doc/chunk.ts) — heading-aware, token-budgeted document chunker. Converts DOCX/PDF/PPTX/XLSX/ODT/ODS/ODP/MD/MDX/TXT/RST/AsciiDoc to markdown, splits along the heading tree fromextractFromMarkdown, and packs each section into chunks undermaxTokens(default 800) with configurableoverlapTokens(default 80) and an injectablecountTokens. EachDocumentChunkcarrieschunkId, anchor slug,headingPath,startLine/endLine,tokenEstimate, andwordCount. Exposed ascreateOcc().doc.chunkand on the@cesarandreslopez/occ/doc/chunksubpathsummarizeModule()andtoMermaid()(src/code/query.ts) —summarizeModule(index, modulePath, { maxClasses, maxFunctions, maxEdges })returns aModuleSummary(coupling + key classes + key functions ranked by call activity + import edges + exported API).toMermaid(index, kind, target, { maxNodes, maxEdges })renders Mermaid diagrams for'import-graph','class-hierarchy', and'call-graph'. Both methods are also exposed onCodeQuerySessionand re-exported from@cesarandreslopez/occ.analyzeModuleCouplingnow treats'.'/''as "the whole repository" and additionally matches byrelativePathexact equality andmoduleName, fixing single-file modules and root-module queriestsconfig.json/jsconfig.jsoncompilerOptions.pathsresolution for TS/JS/Vue imports (src/code/languages.ts:resolveTsconfigImport) — wildcard and exact patterns,baseUrlhonored, results cached per repo. Imports with?/#query/fragment suffixes are stripped before resolution (Vite-style?raw,?url,?worker). Asset specifiers (.css,.scss,.svg,.png,.wasm, ...) are now classified asexternalrather thanunresolved, removing a long tail of falseunresolvedimport edges from frontend repos- Symbol position metadata on parsed symbols and graph nodes —
ParsedSymbol/CodeNodenow carry optionalendLine,startColumn,endColumn(TS compiler API powered for TS/JS/Vue). Useful for IDE-style navigation and slicing source ranges out ofcontent: 'full'indexes NormalizedSymbolKindunion ('file' | 'module' | 'function' | 'method' | 'class' | 'interface' | 'type' | 'enum' | 'variable' | 'parameter' | 'other') andtoNormalizedSymbolKind(type, containerName)helper — foldsfunctionwith a container intomethod,type-aliasintotype, etc., for downstream consumers that want LSP-style symbol kinds without re-implementing the mapping. Exported from the facade- Builtin call-noise filter (
src/code/build.ts:isBuiltinNoiseCall) — drops false-positivecallsedges to standard-library globals (Array,JSON,Promise,console,setTimeout,fetch, ...) and ubiquitous member methods (map,filter,then,push,forEach, ...) when no local symbol shadows them. Calls qualified bythis/self/cls/superare preserved. Significantly reduces graph noise in TS/JS repos health()(src/health.ts) — lightweight liveness probe returning{ available, version, capabilities }. Exposed ascreateOcc().healthand on the@cesarandreslopez/occ/healthsubpathOccAbortError/OCC_ABORTED/isOccAbortError(src/errors.ts) — typed abort error replacing the previousDOMException('...', 'AbortError')usage inabortIfNeeded,buildCodebaseIndexIsolated, andprepareWorkspaceContext. The new error keepsname: 'AbortError'for duck-typed compatibility, but addserror.code === 'OCC_ABORTED'and survivesinstanceofacross forked subprocesses (whereDOMExceptiondoes not). Exposed on the@cesarandreslopez/occ/errorssubpath- Document discovery now includes prose formats by default —
discoverDocumentSet()/discoverDocuments()acceptmd,markdown,mdx,txt,rst,adoc,asciidocalongside the seven office formats, and the newincludeDataFiles: trueflag also pulls inyaml,yml,json,jsonc,toml.documentToMarkdown()reads these raw text formats directly.inspectWorkspaceDocumentSetandbundleWorkspaceforward the flag, so workspaces with markdown-only docs are no longer empty - New
discoverDocumentSet()API alongsidediscoverDocuments()— same signature, but returns{ documents, skipped }whereskippedcarries{ path, reason, size }entries for over-size files (including the actual byte count) andEACCES/other I/O failures (previously silently dropped) tryParseSlimIndex(value)— non-throwing variant ofparseSlimIndexreturningCodebaseIndexSlim | undefined, for IPC and persistence boundaries where validation is best-effort. Exported from the facade and@cesarandreslopez/occ/code/slimCodeIndexStore.update(changedFiles?, options?)— explicit refresh hook (currently equivalent torefresh(), takes achangedFilesargument for forward compatibility). Letting consumers signal incremental change without re-deriving freshness from manifestsProgressPhasegains'bundle','description','stats','code-preview','document-chunk', and'outline'for the new workspace bundle pipeline.ProgressEventgains optionalscope,currentPath,bytesProcessed,totalBytes,startedAt, andelapsedMsfields so progress consumers can render rich UIs without needing a sidecar event stream.inspectWorkspaceDocumentSetand the workspace pipeline now emitcurrentPathon every eventsanitizeForkExecArgv()(src/utils.ts) and integration inbuildCodebaseIndexIsolatedandprepareWorkspaceContext— strips--input-typefromprocess.execArgvbefore forking the JS runners, so OCC works under loaders liketsx/node --import tsxthat set--input-type=moduleon the parent (which previously crashed the child runner withModule did not self-register)- Programmatic subpath exports (with matching
typesVersions):@cesarandreslopez/occ/doc/chunk,@cesarandreslopez/occ/workspace/bundle,@cesarandreslopez/occ/table/types,@cesarandreslopez/occ/health,@cesarandreslopez/occ/errors
Changed
src/errors.tsis a new Layer 0 module andsrc/health.tsis a new top-level module; both registered in the import-DAG checker (scripts/check-imports.mjs) so the architecture invariant continues to hold (Checked 86 files, 0 violations)analyzeModuleCouplingwidens "module belongs to this path" matching beyonddirPrefix— exactrelativePathequality andmoduleNameequality are now also accepted, fixing coupling reports for top-level single-file modulesinspectWorkspaceDocumentSetswitched offfindFilesand now consumesdiscoverDocumentSetdirectly, picking up the new prose/data formats, theskippedreporting, and the per-eventcurrentPathenrichment without behavior change for existing callers (default still 50 docs, includeMarkdown still defaults tofalse)
Migration notes
- Existing callers see no behavior change:
discoverDocuments()keeps its array shape, all new options are opt-in, and the import-DAG plus type-check plus 208-test suite pass. To opt into the new bundle/chunk/health/errors paths, use the named exports from the facade (createOcc().workspace.bundle,createOcc().doc.chunk,createOcc().health) or the new subpath exports - Code reading
error instanceof DOMExceptionto detect aborts should switch toisOccAbortError(error)orerror.name === 'AbortError'/error.code === 'OCC_ABORTED'. The previousDOMExceptioninstances would have failedinstanceofacross subprocess boundaries anyway
Install
Global install (requires Node.js 18+):
npm i -g @cesarandreslopez/occ
No-install usage:
npx @cesarandreslopez/occ [directories...]