@c4a/extract-ts 0.6.0-beta.8 → 0.6.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -28
  3. package/index.js +216 -1963
  4. package/package.json +8 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 context4ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,17 +2,15 @@
2
2
 
3
3
  TypeScript/TSX extraction plugin for Context. It implements the
4
4
  `ExtractionPlugin` protocol from `@c4a/extract` and is the default plugin used
5
- by the SDK `extractTs({ source, collection: "wikis" })` phase for npm-style
5
+ by the SDK `extractTs({ source, collection: "codegraph" })` phase for npm-style
6
6
  packages.
7
7
 
8
- ## Role in the Monorepo
8
+ ## Package Role
9
9
 
10
10
  `@c4a/extract-ts` handles TypeScript package entry detection and AST extraction. It does not write `.context` files directly; `@c4a/extract` runs the plugin and `@c4a/context-cli` persists the resulting raw code snapshot.
11
11
 
12
12
  **Depends on:** `@c4a/extract`, `web-tree-sitter`
13
13
 
14
- **Used by:** `@c4a/context-cli`, `@c4a/daemon`, E2E tests
15
-
16
14
  ## Current Extraction Coverage
17
15
 
18
16
  ### Entry Detection
@@ -90,7 +88,7 @@ The plugin returns `ExtractionResult` v2. The `@c4a/extract` runner turns that i
90
88
  - `edges.jsonl` receives relation rows with package/module/version/hash metadata.
91
89
  - `digests.jsonl` receives versioned module digest rows.
92
90
 
93
- The Context CLI consumes those rows during `context run extract:<source>:wikis`
91
+ The Context CLI consumes those rows during `context run extract:<source>:codegraph`
94
92
  to build review candidates for package/category/symbol knowledge Nodes. The
95
93
  important projection inputs are:
96
94
 
@@ -127,8 +125,8 @@ const componentLib = source("component-lib");
127
125
  export default defineProject({
128
126
  sources: [componentLib],
129
127
  phases: [
130
- extractTs({ source: componentLib, collection: "wikis" }),
131
- reviewValidity({ collection: "wikis" }),
128
+ extractTs({ source: componentLib, collection: "codegraph" }),
129
+ reviewValidity({ collection: "codegraph" }),
132
130
  ],
133
131
  packages: [],
134
132
  });
@@ -138,28 +136,9 @@ The source boundary is registered first, then the phase is previewed or run:
138
136
 
139
137
  ```bash
140
138
  context source add repo component-lib --local ../packages/component-lib
141
- context run extract:component-lib:wikis --dry-run
142
- context run extract:component-lib:wikis
139
+ context run extract:component-lib:codegraph --dry-run
140
+ context run extract:component-lib:codegraph
143
141
  ```
144
142
 
145
143
  Agents should not hand-build runner input or raw snapshots for normal Context
146
144
  workspace operation.
147
-
148
- ## Internal Modules
149
-
150
- | File | Purpose |
151
- |---|---|
152
- | `plugin.ts` | Plugin class; stores package info from `detectEntries()` for `extractSymbols()` |
153
- | `entryDetector.ts` | `package.json` parsing, entry target collection, workspace package detection |
154
- | `symbolExtractor.ts` | Tree-sitter AST extraction, symbol/member/relation collection |
155
- | `exportTracer.ts` | Re-export tracing and exported/internal split |
156
- | `pathUtils.ts` | Source-path and relative import resolution |
157
-
158
- ## Development
159
-
160
- ```bash
161
- bun run --filter @c4a/extract-ts build
162
- bun run --filter @c4a/extract-ts typecheck
163
- bun run --filter @c4a/extract-ts test
164
- bun run --filter @c4a/extract-ts lint
165
- ```