@cr_docs_t/dts 0.25.0 → 0.27.0

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 (39) hide show
  1. package/dist/dts/Fugue/FNode.d.ts +1 -3
  2. package/dist/dts/Fugue/FNode.d.ts.map +1 -1
  3. package/dist/dts/Fugue/FNode.js +1 -1
  4. package/dist/dts/Fugue/FugueList.d.ts.map +1 -1
  5. package/dist/dts/Fugue/FugueList.js +7 -20
  6. package/dist/dts/FugueTree/FugueTree.d.ts +3 -3
  7. package/dist/dts/FugueTree/FugueTree.d.ts.map +1 -1
  8. package/dist/dts/FugueTree/FugueTree.js +3 -1
  9. package/dist/dts/Serailizers/FugueTree/Message.d.ts +4 -4
  10. package/dist/dts/Serailizers/FugueTree/Message.d.ts.map +1 -1
  11. package/dist/dts/Serailizers/FugueTree/Message.js +1 -1
  12. package/dist/tests/mocks.d.ts.map +1 -1
  13. package/dist/tests/mocks.js +1 -1
  14. package/dist/treesitter/index.d.ts +3 -0
  15. package/dist/treesitter/index.d.ts.map +1 -0
  16. package/dist/treesitter/index.js +2 -0
  17. package/dist/treesitter/parser.d.ts +6 -0
  18. package/dist/treesitter/parser.d.ts.map +1 -0
  19. package/dist/treesitter/parser.js +32 -0
  20. package/dist/treesitter/types/AST.d.ts +1048 -0
  21. package/dist/treesitter/types/AST.d.ts.map +1 -0
  22. package/dist/treesitter/types/AST.js +2262 -0
  23. package/dist/treesitter/types/index.d.ts +2 -0
  24. package/dist/treesitter/types/index.d.ts.map +1 -0
  25. package/dist/treesitter/types/index.js +1 -0
  26. package/dist/treesitter.d.ts +2 -0
  27. package/dist/treesitter.d.ts.map +1 -0
  28. package/dist/treesitter.js +1 -0
  29. package/dist/type-gen.d.ts +2 -0
  30. package/dist/type-gen.d.ts.map +1 -0
  31. package/dist/type-gen.js +184 -0
  32. package/dist/types/FugueTree/Message.d.ts +17 -19
  33. package/dist/types/FugueTree/Message.d.ts.map +1 -1
  34. package/dist/types/FugueTree/Message.js +22 -3
  35. package/dist/types/Models/Schema.d.ts +18 -0
  36. package/dist/types/Models/Schema.d.ts.map +1 -1
  37. package/dist/types/Models/Schema.js +7 -0
  38. package/dist/types/index.js +1 -1
  39. package/package.json +13 -2
@@ -0,0 +1,2 @@
1
+ export * from "./AST.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/treesitter/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./AST.js";
@@ -0,0 +1,2 @@
1
+ export * from "./treesitter/index.js";
2
+ //# sourceMappingURL=treesitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treesitter.d.ts","sourceRoot":"","sources":["../src/treesitter.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./treesitter/index.js";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type-gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-gen.d.ts","sourceRoot":"","sources":["../src/type-gen.ts"],"names":[],"mappings":""}
@@ -0,0 +1,184 @@
1
+ // Inspired by https://github.com/github/semantic/tree/main/semantic-ast
2
+ import { writeFileSync, readFileSync } from "fs";
3
+ import { dirname, join } from "path";
4
+ import { fileURLToPath } from "url";
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const dir = dirname(__filename);
7
+ const INPUT_PATH = join(dir, "node-types.json"); // Adjust as needed
8
+ const OUTPUT_PATH = join(dir, "treesitter", "types", "AST.ts");
9
+ const toPascalCase = (str) => {
10
+ return (str
11
+ .match(/[a-z_]+/gi)
12
+ ?.map((word) => word
13
+ .split("_")
14
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
15
+ .join(""))
16
+ .join("") || str);
17
+ };
18
+ function generate() {
19
+ const rawData = readFileSync(INPUT_PATH, "utf8");
20
+ const nodes = JSON.parse(rawData);
21
+ let output = `// Auto-generated from node-types.json\n\n`;
22
+ output += `import { Node } from 'web-tree-sitter';
23
+ import { v4 } from 'uuid'
24
+
25
+ export type NodeId = string;
26
+
27
+ export interface ParserContext {
28
+ nodes: Map<NodeId, AstNode>;
29
+ }
30
+
31
+ `;
32
+ let interfacesOut = `// Interfaces
33
+
34
+ `;
35
+ let unmarshalersOut = `// Unmarshalers
36
+
37
+ `;
38
+ let switches = "";
39
+ const allNamedNodes = [];
40
+ for (const node of nodes) {
41
+ if (!node.named)
42
+ continue;
43
+ // Generate interfaces
44
+ const interfaceName = toPascalCase(node.type) + "Node";
45
+ // Handle Supertypes
46
+ if (node.subtypes && node.subtypes.length > 0) {
47
+ const subtypeNames = node.subtypes.filter((st) => st.named).map((st) => toPascalCase(st.type) + "Node");
48
+ if (subtypeNames.length > 0) {
49
+ interfacesOut += `export type ${interfaceName} = ${subtypeNames.join(" | ")};\n\n`;
50
+ }
51
+ continue;
52
+ }
53
+ allNamedNodes.push(interfaceName);
54
+ // Handle Standard Concrete Nodes
55
+ interfacesOut += `export interface ${interfaceName} {\n`;
56
+ // Use a Map to track properties so we can merge collisions
57
+ const props = new Map();
58
+ // Set default properties
59
+ props.set("id", { type: "NodeId", optional: false });
60
+ props.set("parentId", { type: "NodeId | null", optional: false });
61
+ props.set("type", { type: `'${node.type}'`, optional: false });
62
+ props.set("text", { type: "string", optional: false });
63
+ // Map Fields
64
+ if (node.fields) {
65
+ for (const [fieldName, fieldData] of Object.entries(node.fields)) {
66
+ let typeString = fieldData.multiple ? "NodeId[]" : "NodeId";
67
+ const isOptional = !fieldData.required;
68
+ if (props.has(fieldName)) {
69
+ // Merge types on collision
70
+ const existing = props.get(fieldName);
71
+ existing.type = `${existing.type} | ${typeString}`;
72
+ existing.optional = existing.optional && isOptional;
73
+ }
74
+ else {
75
+ props.set(fieldName, { type: typeString, optional: isOptional });
76
+ }
77
+ }
78
+ }
79
+ props.set("childrenIds", { type: "NodeId[]", optional: false });
80
+ // Write all properties to the interface
81
+ for (const [propName, propData] of props.entries()) {
82
+ const optMod = propData.optional ? "?" : "";
83
+ interfacesOut += ` ${propName}${optMod}: ${propData.type};\n`;
84
+ }
85
+ interfacesOut += `}\n\n`;
86
+ // Generate Unmarshalers
87
+ const funcName = `unmarshaler${interfaceName}`;
88
+ switches += `case '${node.type}': return ${funcName}(node, ctx, parentId);\n`;
89
+ unmarshalersOut += `function ${funcName}(node: Node, ctx: ParserContext, parentId: NodeId | null): NodeId {
90
+ const id = v4();
91
+ const n: Partial<${interfaceName}> = {
92
+ id,
93
+ parentId,
94
+ type: '${node.type}',
95
+ text: node.text,
96
+ };
97
+ ctx.nodes.set(id, n as AstNode);
98
+
99
+ `;
100
+ let fieldExtractionNodes = "";
101
+ if (node.fields) {
102
+ for (const [fieldName, fieldData] of Object.entries(node.fields)) {
103
+ if (fieldData.multiple) {
104
+ unmarshalersOut += `n.${fieldName} = node.childrenForFieldName('${fieldName}').map(n => unmarshalNode(n, ctx, id));\n`;
105
+ fieldExtractionNodes += `...node.childrenForFieldName('${fieldName}').map(n => n.id), `;
106
+ }
107
+ else {
108
+ if (fieldData.required) {
109
+ unmarshalersOut += `n.${fieldName} = unmarshalNode(node.childForFieldName('${fieldName}')!, ctx, id);\n`;
110
+ fieldExtractionNodes += `node.childForFieldName('${fieldName}')!.id, `;
111
+ }
112
+ else {
113
+ unmarshalersOut += `const ${fieldName}Node = node.childForFieldName('${fieldName}');
114
+ n.${fieldName} = ${fieldName}Node ? unmarshalNode(${fieldName}Node, ctx, id) : undefined;
115
+ `;
116
+ fieldExtractionNodes += `${fieldName}Node ? ${fieldName}Node.id : undefined, `;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ if (fieldExtractionNodes.length > 0) {
122
+ unmarshalersOut += `
123
+ const fieldNodes = new Set([${fieldExtractionNodes}].filter(id => id !== undefined));
124
+ n.childrenIds = node.namedChildren.filter(n => !fieldNodes.has(n.id)).map(n => unmarshalNode(n, ctx, id));
125
+ `;
126
+ }
127
+ else {
128
+ unmarshalersOut += `n.childrenIds = node.namedChildren.map(n => unmarshalNode(n, ctx, id));\n`;
129
+ }
130
+ unmarshalersOut += `return id;
131
+ }
132
+
133
+ `;
134
+ }
135
+ const core = `// Parser core
136
+
137
+ export const unmarshalNode = (node: Node, ctx: ParserContext, parentId: NodeId | null): NodeId => {
138
+ switch(node.type) {
139
+ ${switches}
140
+ default: {
141
+ const id = v4();
142
+ const n = {
143
+ id,
144
+ parentId,
145
+ type: node.type as any,
146
+ text: node.text,
147
+ childrenIds: [] as NodeId[],
148
+ };
149
+ ctx.nodes.set(id, n as AstNode);
150
+ n.childrenIds = node.namedChildren.map(n => unmarshalNode(n, ctx, id));
151
+ return id;
152
+ }
153
+ }
154
+ }
155
+
156
+ export type BragiAST = {rootId: NodeId, nodes: Map<NodeId, AstNode> };
157
+
158
+ // Parses a treesitter CST into a Bragi AST node map
159
+ export const parseCST = (root: Node | null) : BragiAST => {
160
+ if (!root) throw new Error ("No root node provided");
161
+ const ctx: ParserContext = { nodes: new Map() };
162
+ const rootId = unmarshalNode(root, ctx, null);
163
+ return {rootId, nodes: ctx.nodes};
164
+ }
165
+ `;
166
+ // Create a generic ASTNode type
167
+ const concreteNodes = nodes
168
+ .filter((n) => n.named && (!n.subtypes || n.subtypes.length === 0))
169
+ .map((n) => toPascalCase(n.type) + "Node");
170
+ const genericType = `export type AstNode = ${concreteNodes.join(" | ")};\n`;
171
+ // Consolidate output
172
+ output += `
173
+ ${interfacesOut}
174
+
175
+ ${genericType}
176
+
177
+ ${unmarshalersOut}
178
+
179
+ ${core}
180
+ `;
181
+ writeFileSync(OUTPUT_PATH, output);
182
+ console.log(`Successfully generated AST types at ${OUTPUT_PATH}`);
183
+ }
184
+ generate();
@@ -2,42 +2,40 @@ import { ID, NodeSide } from "../../dts/FugueTree/FTree";
2
2
  export declare enum Operation {
3
3
  INSERT = 0,
4
4
  DELETE = 1,
5
- JOIN = 2,
6
- REJECT = 3,
7
- LEAVE = 4
5
+ INITIAL_SYNC = 2,
6
+ USER_JOIN = 3,
7
+ REJECT = 4,
8
+ LEAVE = 5
8
9
  }
10
+ export declare function operationToString(op: Operation): string;
9
11
  export type Data = string;
10
- export interface FugueMessage {
11
- operation: Operation.INSERT | Operation.DELETE;
12
+ export interface BaseFugueMessage<T extends Operation = Operation> {
13
+ operation: T;
12
14
  documentID: string;
13
15
  replicaId: string;
16
+ userIdentity: string;
17
+ }
18
+ export interface FugueMessage extends BaseFugueMessage<Operation.INSERT | Operation.DELETE> {
14
19
  id: ID;
15
20
  data: Data | null;
16
21
  side: NodeSide;
17
22
  parent?: ID;
18
23
  rightOrigin?: ID;
19
- userIdentity?: string;
20
24
  }
21
- export interface FugueJoinMessage {
22
- operation: Operation.JOIN;
23
- documentID: string;
24
- userIdentity?: string;
25
- collaborators?: string[];
25
+ export interface FugueJoinMessage extends BaseFugueMessage<Operation.INITIAL_SYNC> {
26
26
  state: Uint8Array<ArrayBufferLike> | null;
27
27
  bufferedOperations?: Buffer<ArrayBuffer>[];
28
- replicaId?: string;
29
28
  }
30
- export interface FugueRejectMessage {
31
- operation: Operation.REJECT;
29
+ export interface FugueRejectMessage extends BaseFugueMessage<Operation.REJECT> {
30
+ documentID: string;
32
31
  reason: string;
33
32
  }
34
- export interface FugueLeaveMessage {
35
- operation: Operation.LEAVE;
33
+ export interface FugueLeaveMessage extends BaseFugueMessage<Operation.LEAVE> {
36
34
  userIdentity: string;
35
+ collaborators: string[];
37
36
  }
38
- export interface FugueUserJoinMessage {
39
- operation: Operation.JOIN;
40
- userIdentity: string;
37
+ export interface FugueUserJoinMessage extends BaseFugueMessage<Operation.USER_JOIN> {
38
+ collaborators: string[];
41
39
  }
42
40
  export type FugueMessageType = FugueMessage | FugueJoinMessage | FugueRejectMessage | FugueLeaveMessage | FugueUserJoinMessage;
43
41
  export type FugueMutationMessageTypes = Extract<FugueMessageType, FugueMessage | FugueJoinMessage>;
@@ -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AU,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;IAE1C,kBAAkB,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;CAE9C;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB,CAAC,SAAS,CAAC,SAAS,CAAC;IAC/E,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GACtB,YAAY,GACZ,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,CAAC;AAE3B,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,gBAAgB,EAAE,YAAY,GAAG,gBAAgB,CAAC,CAAC"}
@@ -2,7 +2,26 @@ export var Operation;
2
2
  (function (Operation) {
3
3
  Operation[Operation["INSERT"] = 0] = "INSERT";
4
4
  Operation[Operation["DELETE"] = 1] = "DELETE";
5
- Operation[Operation["JOIN"] = 2] = "JOIN";
6
- Operation[Operation["REJECT"] = 3] = "REJECT";
7
- Operation[Operation["LEAVE"] = 4] = "LEAVE";
5
+ Operation[Operation["INITIAL_SYNC"] = 2] = "INITIAL_SYNC";
6
+ Operation[Operation["USER_JOIN"] = 3] = "USER_JOIN";
7
+ Operation[Operation["REJECT"] = 4] = "REJECT";
8
+ Operation[Operation["LEAVE"] = 5] = "LEAVE";
8
9
  })(Operation || (Operation = {}));
10
+ export function operationToString(op) {
11
+ switch (op) {
12
+ case Operation.INSERT:
13
+ return "INSERT";
14
+ case Operation.DELETE:
15
+ return "DELETE";
16
+ case Operation.INITIAL_SYNC:
17
+ return "INITIAL_SYNC";
18
+ case Operation.USER_JOIN:
19
+ return "USER_JOIN";
20
+ case Operation.REJECT:
21
+ return "REJECT";
22
+ case Operation.LEAVE:
23
+ return "LEAVE";
24
+ default:
25
+ return "UNKNOWN_OPERATION";
26
+ }
27
+ }
@@ -20,8 +20,26 @@ export declare const DocumentSchema: z.ZodObject<{
20
20
  contributorType: z.ZodEnum<typeof ContributorType>;
21
21
  email: z.ZodEmail;
22
22
  }, z.core.$strip>>>;
23
+ projectId: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>;
25
+ export declare const ProjectSchema: z.ZodObject<{
26
+ _id: z.ZodOptional<z.ZodString>;
27
+ createdAt: z.ZodOptional<z.ZodISODateTime>;
28
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
29
+ name: z.ZodString;
30
+ ownerId: z.ZodOptional<z.ZodString>;
31
+ documentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
32
+ contributors: z.ZodDefault<z.ZodArray<z.ZodObject<{
33
+ contributorType: z.ZodEnum<typeof ContributorType>;
34
+ email: z.ZodEmail;
35
+ }, z.core.$strip>>>;
23
36
  }, z.core.$strip>;
24
37
  export type Identified = z.infer<typeof IdentifiedSchema>;
25
38
  export type Contributor = z.infer<typeof ContributorSchema>;
26
39
  export type Document = z.infer<typeof DocumentSchema>;
40
+ export type Project = z.infer<typeof ProjectSchema>;
41
+ export type ProjectWithDocuments = {
42
+ project: Project;
43
+ documents: Document[];
44
+ };
27
45
  //# sourceMappingURL=Schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/types/Models/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;iBAKzB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../../src/types/Models/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;iBAMzB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;iBAKxB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,oBAAoB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACzB,CAAC"}
@@ -14,4 +14,11 @@ export const DocumentSchema = IdentifiedSchema.extend({
14
14
  serializedCRDTState: z.string(),
15
15
  ownerId: z.string().optional(),
16
16
  contributors: z.array(ContributorSchema).default([]),
17
+ projectId: z.string().optional(),
18
+ });
19
+ export const ProjectSchema = IdentifiedSchema.extend({
20
+ name: z.string().min(1, "Name is required"),
21
+ ownerId: z.string().optional(),
22
+ documentIds: z.array(z.string()).default([]),
23
+ contributors: z.array(ContributorSchema).default([]),
17
24
  });
@@ -1,4 +1,4 @@
1
- // export * from "./Fugue/index.js";
1
+ // dxport * from "./Fugue/index.js";
2
2
  export * from "./FugueTree/index.js";
3
3
  export * from "./Enums.js";
4
4
  export * from "./Models/index.js";
package/package.json CHANGED
@@ -1,22 +1,29 @@
1
1
  {
2
2
  "name": "@cr_docs_t/dts",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
9
9
  "build": "tsc",
10
+ "prebuild": "npm run gen-types",
10
11
  "prepublishOnly": "npm run build",
11
12
  "ci": "npm install && npm run build",
12
13
  "pretest": "npm run build",
13
- "sest": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
14
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
15
+ "gen-types": "tsx ./src/type-gen.ts && biome format --write ./src/treesitter/types/AST.ts"
14
16
  },
15
17
  "exports": {
16
18
  ".": {
17
19
  "import": "./dist/index.js",
18
20
  "require": "./dist/index.js",
19
21
  "types": "./dist/index.d.ts"
22
+ },
23
+ "./treesitter": {
24
+ "import": "./dist/treesitter.js",
25
+ "require": "./dist/treesitter.js",
26
+ "types": "./dist/treesitter.d.ts"
20
27
  }
21
28
  },
22
29
  "publishConfig": {
@@ -56,6 +63,7 @@
56
63
  "license": "ISC",
57
64
  "packageManager": "pnpm@10.20.0",
58
65
  "devDependencies": {
66
+ "@biomejs/biome": "2.4.4",
59
67
  "@semantic-release/changelog": "^6.0.3",
60
68
  "@semantic-release/git": "^10.0.1",
61
69
  "@types/jest": "^30.0.0",
@@ -64,6 +72,7 @@
64
72
  "jest": "^30.2.0",
65
73
  "semantic-release": "^25.0.2",
66
74
  "ts-jest": "^29.4.6",
75
+ "tsx": "^4.21.0",
67
76
  "typescript": "^5.9.3"
68
77
  },
69
78
  "files": [
@@ -72,6 +81,8 @@
72
81
  "dependencies": {
73
82
  "@msgpack/msgpack": "^3.1.3",
74
83
  "lz4js": "^0.2.0",
84
+ "uuid": "^13.0.0",
85
+ "web-tree-sitter": "^0.26.5",
75
86
  "zod": "^4.3.6"
76
87
  }
77
88
  }