@mrclrchtr/supi-tree-sitter 1.2.0 → 1.3.1
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.
- package/README.md +9 -2
- package/package.json +8 -3
- package/src/api.ts +16 -0
- package/src/extension.ts +1 -0
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -40,12 +40,19 @@ The agent gets a `tree_sitter` tool with these actions:
|
|
|
40
40
|
|
|
41
41
|
`outline`, `imports`, and `exports` are currently JavaScript/TypeScript only. `node_at`, `query`, and `callees` work across all 14 supported languages. Coordinates are 1-based, matching the `lsp` tool convention.
|
|
42
42
|
|
|
43
|
+
## Package surfaces
|
|
44
|
+
|
|
45
|
+
- `@mrclrchtr/supi-tree-sitter/api` — reusable parsing/session API
|
|
46
|
+
- `@mrclrchtr/supi-tree-sitter/extension` — pi extension entrypoint
|
|
47
|
+
|
|
48
|
+
`pi.extensions` still points at the real file path `./src/extension.ts` inside the package. The `/api` and `/extension` paths are consumer-facing package exports, not manifest aliases.
|
|
49
|
+
|
|
43
50
|
## For extension developers
|
|
44
51
|
|
|
45
52
|
This package exports a reusable session-scoped parsing service:
|
|
46
53
|
|
|
47
54
|
```ts
|
|
48
|
-
import { createTreeSitterSession } from "@mrclrchtr/supi-tree-sitter";
|
|
55
|
+
import { createTreeSitterSession } from "@mrclrchtr/supi-tree-sitter/api";
|
|
49
56
|
|
|
50
57
|
const session = createTreeSitterSession("/project");
|
|
51
58
|
|
|
@@ -62,4 +69,4 @@ const callees = await session.calleesAt("src/index.ts", 42, 10);
|
|
|
62
69
|
session.dispose();
|
|
63
70
|
```
|
|
64
71
|
|
|
65
|
-
|
|
72
|
+
Call `dispose()` when done.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-tree-sitter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "SuPi Tree-sitter extension — structural AST analysis for pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -43,10 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"pi": {
|
|
45
45
|
"extensions": [
|
|
46
|
-
"./src/
|
|
46
|
+
"./src/extension.ts"
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
|
-
"main": "src/
|
|
49
|
+
"main": "src/api.ts",
|
|
50
|
+
"exports": {
|
|
51
|
+
"./api": "./src/api.ts",
|
|
52
|
+
"./extension": "./src/extension.ts",
|
|
53
|
+
"./package.json": "./package.json"
|
|
54
|
+
},
|
|
50
55
|
"scripts": {
|
|
51
56
|
"vendor:wasm": "node scripts/vendor-wasm.mjs",
|
|
52
57
|
"check:wasm": "node scripts/vendor-wasm.mjs --check",
|
package/src/api.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Public tree-sitter session factory and shared types.
|
|
2
|
+
|
|
3
|
+
export { createTreeSitterSession } from "./session.ts";
|
|
4
|
+
export type {
|
|
5
|
+
CalleesAtResult,
|
|
6
|
+
ExportRecord,
|
|
7
|
+
GrammarId,
|
|
8
|
+
ImportRecord,
|
|
9
|
+
NodeAtResult,
|
|
10
|
+
OutlineItem,
|
|
11
|
+
QueryCapture,
|
|
12
|
+
SourceRange,
|
|
13
|
+
SupportedExtension,
|
|
14
|
+
TreeSitterResult,
|
|
15
|
+
TreeSitterSession,
|
|
16
|
+
} from "./types.ts";
|
package/src/extension.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./tree-sitter.ts";
|
package/src/types.ts
CHANGED