scriptonia 0.8.0 → 0.9.0-rc.2

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/LICENSE +21 -0
  2. package/README.md +43 -13
  3. package/assets/grammar-manifest.json +32 -0
  4. package/assets/grammars/tree-sitter-bash.wasm +0 -0
  5. package/assets/grammars/tree-sitter-c.wasm +0 -0
  6. package/assets/grammars/tree-sitter-cpp.wasm +0 -0
  7. package/assets/grammars/tree-sitter-dart.wasm +0 -0
  8. package/assets/grammars/tree-sitter-go.wasm +0 -0
  9. package/assets/grammars/tree-sitter-java.wasm +0 -0
  10. package/assets/grammars/tree-sitter-javascript.wasm +0 -0
  11. package/assets/grammars/tree-sitter-kotlin.wasm +0 -0
  12. package/assets/grammars/tree-sitter-objc.wasm +0 -0
  13. package/assets/grammars/tree-sitter-python.wasm +0 -0
  14. package/assets/grammars/tree-sitter-rust.wasm +0 -0
  15. package/assets/grammars/tree-sitter-swift.wasm +0 -0
  16. package/assets/grammars/tree-sitter-tsx.wasm +0 -0
  17. package/assets/grammars/tree-sitter-typescript.wasm +0 -0
  18. package/assets/licenses/tree-sitter-wasms-LICENSE +24 -0
  19. package/assets/licenses/web-tree-sitter-LICENSE +21 -0
  20. package/assets/queries/manifest.json +12 -0
  21. package/assets/queries/v1/dart.scm +7 -0
  22. package/assets/queries/v1/go.scm +5 -0
  23. package/assets/queries/v1/javascript.scm +15 -0
  24. package/assets/queries/v1/python.scm +5 -0
  25. package/assets/queries/v1/typescript.scm +17 -0
  26. package/assets/tree-sitter.wasm +0 -0
  27. package/bin/scriptonia.mjs +243 -76
  28. package/bin/verify.mjs +40 -6
  29. package/dist/brain-ast-worker.js +62 -0
  30. package/dist/brain-ast-worker.js.map +1 -0
  31. package/dist/chunk-6TLQP3LV.js +4048 -0
  32. package/dist/chunk-6TLQP3LV.js.map +1 -0
  33. package/dist/chunk-ZLKAW77A.js +16613 -0
  34. package/dist/chunk-ZLKAW77A.js.map +1 -0
  35. package/dist/index.js +2431 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/legacy-brain-bridge.js +156 -0
  38. package/dist/legacy-brain-bridge.js.map +1 -0
  39. package/package.json +78 -5
@@ -0,0 +1,156 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ BrainStore,
4
+ buildBrain,
5
+ buildContextPack,
6
+ buildWorkingTreeSnapshot,
7
+ createContextGraphExpansionAdapter,
8
+ planQualityV1Schema,
9
+ repositoryPathInventoryV1Schema
10
+ } from "./chunk-ZLKAW77A.js";
11
+ import {
12
+ hashObject,
13
+ walkRepo
14
+ } from "./chunk-6TLQP3LV.js";
15
+
16
+ // src/legacy-brain-bridge.ts
17
+ import fs from "fs";
18
+ import path from "path";
19
+ function storedWorkingTreeProof(store, buildId) {
20
+ const row = store.deep.getBuildStage(buildId, "git");
21
+ if (!row || !row.required || row.status !== "SUCCEEDED" || row.metrics === void 0) return void 0;
22
+ try {
23
+ const metrics = row.metrics;
24
+ if (metrics === null || typeof metrics !== "object" || Array.isArray(metrics)) return void 0;
25
+ const record = metrics;
26
+ if (typeof record.workingTreeSnapshotId !== "string" || !/^[0-9a-f]{64}$/i.test(record.workingTreeSnapshotId)) return void 0;
27
+ if (typeof record.workingTreeHeadSha !== "string" || !/^[0-9a-f]{40}$/i.test(record.workingTreeHeadSha)) return void 0;
28
+ if (typeof record.workingTreeDirty !== "boolean") return void 0;
29
+ if (typeof record.workingTreeEntries !== "number" || !Number.isSafeInteger(record.workingTreeEntries) || record.workingTreeEntries < 0) return void 0;
30
+ return {
31
+ snapshotId: record.workingTreeSnapshotId.toLowerCase(),
32
+ headSha: record.workingTreeHeadSha.toLowerCase(),
33
+ dirty: record.workingTreeDirty,
34
+ entries: record.workingTreeEntries
35
+ };
36
+ } catch {
37
+ return void 0;
38
+ }
39
+ }
40
+ function matchesStoredWorkingTree(proof, current) {
41
+ return proof.snapshotId === current.snapshotId && proof.headSha === current.headSha && proof.dirty === current.dirty && proof.entries === current.entries.length;
42
+ }
43
+ function inspectRepository(root, store, activeBuild) {
44
+ const proof = storedWorkingTreeProof(store, activeBuild.id);
45
+ if (proof) {
46
+ try {
47
+ const current2 = buildWorkingTreeSnapshot({ cwd: root });
48
+ if (matchesStoredWorkingTree(proof, current2)) {
49
+ return { snapshotHash: activeBuild.identity.repositorySnapshotId, changedPaths: [] };
50
+ }
51
+ } catch {
52
+ }
53
+ }
54
+ const census = walkRepo(root);
55
+ const snapshotHash = hashObject(census.files.map((file) => ({
56
+ path: file.path,
57
+ sha256: file.sha256,
58
+ class: file.class,
59
+ language: file.language,
60
+ analysisMode: file.analysisMode
61
+ })));
62
+ const current = new Map(census.files.map((file) => [file.path, file.sha256]));
63
+ const storedFiles = store.deep.listFiles(activeBuild.id);
64
+ const stored = new Map(storedFiles.map((file) => [file.path, file.contentHash]));
65
+ const changedPaths = [.../* @__PURE__ */ new Set([...current.keys(), ...stored.keys()])].filter((filename) => current.get(filename) !== stored.get(filename)).sort();
66
+ return { snapshotHash, changedPaths };
67
+ }
68
+ async function buildFastBrainAfterInit(repoRoot) {
69
+ const result = await buildBrain(repoRoot, { mode: "fast", offline: true });
70
+ if (!result.activated || !result.activeBuildId) {
71
+ const failed = result.stages.filter((stage) => stage.status === "FAILED").map((stage) => `${stage.name}${stage.error ? `: ${stage.error}` : ""}`);
72
+ const failedGates = result.coverage.checks.filter((check) => !check.passed).map((check) => check.id);
73
+ throw new Error([
74
+ "fast brain build did not activate a READY generation",
75
+ ...failed.length ? [`failed stage(s): ${failed.join(", ")}`] : [],
76
+ ...failedGates.length ? [`failed coverage gate(s): ${failedGates.join(", ")}`] : []
77
+ ].join("; "));
78
+ }
79
+ const store = new BrainStore(repoRoot);
80
+ try {
81
+ const generation = store.deep.getActiveGeneration();
82
+ if (!generation || generation.buildId !== result.activeBuildId) throw new Error("READY generation could not be confirmed");
83
+ return { buildId: result.activeBuildId, generation: generation.generation };
84
+ } finally {
85
+ store.close();
86
+ }
87
+ }
88
+ function buildFreshPlanEvidence(repoRootInput, issue) {
89
+ const repoRoot = fs.realpathSync(repoRootInput);
90
+ const filename = path.join(repoRoot, ".scriptonia", "brain.db");
91
+ if (!fs.existsSync(filename)) {
92
+ throw new Error("No local Deep Brain is ready. Run `npx scriptonia brain build --fast --offline`, then retry the plan.");
93
+ }
94
+ const store = new BrainStore(repoRoot);
95
+ try {
96
+ const activeBuild = store.deep.getActiveBuild();
97
+ const generation = store.deep.getActiveGeneration();
98
+ if (!activeBuild || activeBuild.status !== "READY" || !generation || generation.buildId !== activeBuild.id) {
99
+ throw new Error("No local READY Deep Brain generation is active. Run `npx scriptonia brain build --fast --offline`, then retry the plan.");
100
+ }
101
+ const state = inspectRepository(repoRoot, store, activeBuild);
102
+ if (state.snapshotHash !== activeBuild.identity.repositorySnapshotId) {
103
+ const detail = state.changedPaths.length ? ` Changed: ${state.changedPaths.slice(0, 8).join(", ")}${state.changedPaths.length > 8 ? ` (+${state.changedPaths.length - 8} more)` : ""}.` : " Repository classification or configuration metadata changed.";
104
+ throw new Error(`The local Deep Brain is stale and no plan was sent.${detail} Run \`npx scriptonia brain build --fast --offline\`, then retry.`);
105
+ }
106
+ const contextPack = buildContextPack(store.deep, issue, {
107
+ repositoryRoot: repoRoot,
108
+ currentSnapshotHash: state.snapshotHash,
109
+ changedPaths: [],
110
+ graph: createContextGraphExpansionAdapter(store.deep)
111
+ });
112
+ const repositoryInventory = repositoryPathInventoryV1Schema.parse({
113
+ schema_version: "1",
114
+ snapshot_hash: activeBuild.identity.repositorySnapshotId,
115
+ paths: store.deep.listFilePaths(activeBuild.id).sort()
116
+ });
117
+ return { contextPack, repositoryInventory };
118
+ } finally {
119
+ store.close();
120
+ }
121
+ }
122
+ function buildFreshContextPack(repoRootInput, issue) {
123
+ return buildFreshPlanEvidence(repoRootInput, issue).contextPack;
124
+ }
125
+ function recordPlanQualityEvidence(repoRootInput, input) {
126
+ const quality = planQualityV1Schema.parse(input.quality);
127
+ if (typeof input.slug !== "string" || !input.slug.trim()) throw new TypeError("plan-quality receipt has no plan slug");
128
+ if (typeof input.version !== "number" || !Number.isSafeInteger(input.version) || input.version < 1) {
129
+ throw new TypeError("plan-quality receipt has no valid plan version");
130
+ }
131
+ if (input.brainGeneration !== quality.generation_hash) {
132
+ throw new Error("plan-quality receipt generation does not match its validated quality record");
133
+ }
134
+ if (input.contextPackHash !== quality.pack_hash) {
135
+ throw new Error("plan-quality receipt context pack does not match its validated quality record");
136
+ }
137
+ const repoRoot = fs.realpathSync(repoRootInput);
138
+ const store = new BrainStore(repoRoot);
139
+ try {
140
+ return store.planQuality.record({
141
+ planSlug: input.slug,
142
+ planVersion: input.version,
143
+ flow: input.flow,
144
+ quality
145
+ });
146
+ } finally {
147
+ store.close();
148
+ }
149
+ }
150
+ export {
151
+ buildFastBrainAfterInit,
152
+ buildFreshContextPack,
153
+ buildFreshPlanEvidence,
154
+ recordPlanQualityEvidence
155
+ };
156
+ //# sourceMappingURL=legacy-brain-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/legacy-brain-bridge.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { buildBrain } from \"@scriptonia/brain-builder\";\nimport { walkRepo } from \"@scriptonia/brain-census\";\nimport { buildContextPack } from \"@scriptonia/brain-context\";\nimport { createContextGraphExpansionAdapter } from \"@scriptonia/brain-graph\";\nimport { hashObject } from \"@scriptonia/core\";\nimport { buildWorkingTreeSnapshot, type WorkingTreeSnapshot } from \"@scriptonia/git-snapshot\";\nimport { BrainStore, type DeepBuildRecord } from \"@scriptonia/storage-sqlite\";\nimport {\n planQualityV1Schema,\n repositoryPathInventoryV1Schema,\n type ContextPackV1,\n type RepositoryPathInventoryV1,\n} from \"@scriptonia/schemas\";\nimport type { PlanQualityEvidenceFlow, StoredPlanQualityEvidence } from \"@scriptonia/storage-sqlite\";\n\ntype RepositoryState = {\n snapshotHash: string;\n changedPaths: string[];\n};\n\ntype StoredWorkingTreeProof = {\n snapshotId: string;\n headSha: string;\n dirty: boolean;\n entries: number;\n};\n\nfunction storedWorkingTreeProof(store: BrainStore, buildId: string): StoredWorkingTreeProof | undefined {\n const row = store.deep.getBuildStage(buildId, \"git\");\n if (!row || !row.required || row.status !== \"SUCCEEDED\" || row.metrics === undefined) return undefined;\n try {\n const metrics = row.metrics;\n if (metrics === null || typeof metrics !== \"object\" || Array.isArray(metrics)) return undefined;\n const record = metrics as Record<string, unknown>;\n if (typeof record.workingTreeSnapshotId !== \"string\" || !/^[0-9a-f]{64}$/i.test(record.workingTreeSnapshotId)) return undefined;\n if (typeof record.workingTreeHeadSha !== \"string\" || !/^[0-9a-f]{40}$/i.test(record.workingTreeHeadSha)) return undefined;\n if (typeof record.workingTreeDirty !== \"boolean\") return undefined;\n if (typeof record.workingTreeEntries !== \"number\" || !Number.isSafeInteger(record.workingTreeEntries) || record.workingTreeEntries < 0) return undefined;\n return {\n snapshotId: record.workingTreeSnapshotId.toLowerCase(),\n headSha: record.workingTreeHeadSha.toLowerCase(),\n dirty: record.workingTreeDirty,\n entries: record.workingTreeEntries,\n };\n } catch {\n return undefined;\n }\n}\n\nfunction matchesStoredWorkingTree(proof: StoredWorkingTreeProof, current: WorkingTreeSnapshot): boolean {\n return proof.snapshotId === current.snapshotId &&\n proof.headSha === current.headSha &&\n proof.dirty === current.dirty &&\n proof.entries === current.entries.length;\n}\n\nfunction inspectRepository(root: string, store: BrainStore, activeBuild: DeepBuildRecord): RepositoryState {\n const proof = storedWorkingTreeProof(store, activeBuild.id);\n if (proof) {\n try {\n const current = buildWorkingTreeSnapshot({ cwd: root });\n if (matchesStoredWorkingTree(proof, current)) {\n return { snapshotHash: activeBuild.identity.repositorySnapshotId, changedPaths: [] };\n }\n } catch {\n // A failed Git proof is never freshness evidence. Preserve the exact\n // content census below so older/non-standard repositories remain safe.\n }\n }\n\n const census = walkRepo(root);\n const snapshotHash = hashObject(census.files.map((file) => ({\n path: file.path,\n sha256: file.sha256,\n class: file.class,\n language: file.language,\n analysisMode: file.analysisMode,\n })));\n const current = new Map(census.files.map((file) => [file.path, file.sha256]));\n const storedFiles = store.deep.listFiles(activeBuild.id);\n const stored = new Map(storedFiles.map((file) => [file.path, file.contentHash]));\n const changedPaths = [...new Set([...current.keys(), ...stored.keys()])]\n .filter((filename) => current.get(filename) !== stored.get(filename))\n .sort();\n return { snapshotHash, changedPaths };\n}\n\n/** Init's post-binding build is deterministic and cannot invalidate READY state on failure. */\nexport async function buildFastBrainAfterInit(repoRoot: string): Promise<{ buildId: string; generation: number }> {\n const result = await buildBrain(repoRoot, { mode: \"fast\", offline: true });\n if (!result.activated || !result.activeBuildId) {\n const failed = result.stages\n .filter((stage) => stage.status === \"FAILED\")\n .map((stage) => `${stage.name}${stage.error ? `: ${stage.error}` : \"\"}`);\n const failedGates = result.coverage.checks.filter((check) => !check.passed).map((check) => check.id);\n throw new Error([\n \"fast brain build did not activate a READY generation\",\n ...(failed.length ? [`failed stage(s): ${failed.join(\", \")}`] : []),\n ...(failedGates.length ? [`failed coverage gate(s): ${failedGates.join(\", \")}`] : []),\n ].join(\"; \"));\n }\n const store = new BrainStore(repoRoot);\n try {\n const generation = store.deep.getActiveGeneration();\n if (!generation || generation.buildId !== result.activeBuildId) throw new Error(\"READY generation could not be confirmed\");\n return { buildId: result.activeBuildId, generation: generation.generation };\n } finally {\n store.close();\n }\n}\n\nexport type FreshPlanEvidence = {\n contextPack: ContextPackV1;\n repositoryInventory: RepositoryPathInventoryV1;\n};\n\n/** Build only after an exact Git proof or full census; stale evidence never crosses the API boundary. */\nexport function buildFreshPlanEvidence(repoRootInput: string, issue: string): FreshPlanEvidence {\n const repoRoot = fs.realpathSync(repoRootInput);\n const filename = path.join(repoRoot, \".scriptonia\", \"brain.db\");\n if (!fs.existsSync(filename)) {\n throw new Error(\"No local Deep Brain is ready. Run `npx scriptonia brain build --fast --offline`, then retry the plan.\");\n }\n const store = new BrainStore(repoRoot);\n try {\n const activeBuild = store.deep.getActiveBuild();\n const generation = store.deep.getActiveGeneration();\n if (!activeBuild || activeBuild.status !== \"READY\" || !generation || generation.buildId !== activeBuild.id) {\n throw new Error(\"No local READY Deep Brain generation is active. Run `npx scriptonia brain build --fast --offline`, then retry the plan.\");\n }\n const state = inspectRepository(repoRoot, store, activeBuild);\n if (state.snapshotHash !== activeBuild.identity.repositorySnapshotId) {\n const detail = state.changedPaths.length\n ? ` Changed: ${state.changedPaths.slice(0, 8).join(\", \")}${state.changedPaths.length > 8 ? ` (+${state.changedPaths.length - 8} more)` : \"\"}.`\n : \" Repository classification or configuration metadata changed.\";\n throw new Error(`The local Deep Brain is stale and no plan was sent.${detail} Run \\`npx scriptonia brain build --fast --offline\\`, then retry.`);\n }\n const contextPack = buildContextPack(store.deep, issue, {\n repositoryRoot: repoRoot,\n currentSnapshotHash: state.snapshotHash,\n changedPaths: [],\n graph: createContextGraphExpansionAdapter(store.deep),\n });\n const repositoryInventory = repositoryPathInventoryV1Schema.parse({\n schema_version: \"1\",\n snapshot_hash: activeBuild.identity.repositorySnapshotId,\n paths: store.deep.listFilePaths(activeBuild.id).sort(),\n });\n return { contextPack, repositoryInventory };\n } finally {\n store.close();\n }\n}\n\n/** Compatibility helper for local consumers that need only the cited pack. */\nexport function buildFreshContextPack(repoRootInput: string, issue: string): ContextPackV1 {\n return buildFreshPlanEvidence(repoRootInput, issue).contextPack;\n}\n\nexport type LegacyPlanQualityEvidenceInput = {\n flow: PlanQualityEvidenceFlow;\n slug: unknown;\n version: unknown;\n quality: unknown;\n brainGeneration: unknown;\n contextPackHash: unknown;\n};\n\n/**\n * Validate the server receipt and bind it to the exact active local generation.\n * This function is deliberately synchronous so a successful PLAN.md write can\n * await durable local evidence before the CLI process exits.\n */\nexport function recordPlanQualityEvidence(\n repoRootInput: string,\n input: LegacyPlanQualityEvidenceInput,\n): StoredPlanQualityEvidence {\n const quality = planQualityV1Schema.parse(input.quality);\n if (typeof input.slug !== \"string\" || !input.slug.trim()) throw new TypeError(\"plan-quality receipt has no plan slug\");\n if (typeof input.version !== \"number\" || !Number.isSafeInteger(input.version) || input.version < 1) {\n throw new TypeError(\"plan-quality receipt has no valid plan version\");\n }\n if (input.brainGeneration !== quality.generation_hash) {\n throw new Error(\"plan-quality receipt generation does not match its validated quality record\");\n }\n if (input.contextPackHash !== quality.pack_hash) {\n throw new Error(\"plan-quality receipt context pack does not match its validated quality record\");\n }\n\n const repoRoot = fs.realpathSync(repoRootInput);\n const store = new BrainStore(repoRoot);\n try {\n return store.planQuality.record({\n planSlug: input.slug,\n planVersion: input.version,\n flow: input.flow,\n quality,\n });\n } finally {\n store.close();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AA4BjB,SAAS,uBAAuB,OAAmB,SAAqD;AACtG,QAAM,MAAM,MAAM,KAAK,cAAc,SAAS,KAAK;AACnD,MAAI,CAAC,OAAO,CAAC,IAAI,YAAY,IAAI,WAAW,eAAe,IAAI,YAAY,OAAW,QAAO;AAC7F,MAAI;AACF,UAAM,UAAU,IAAI;AACpB,QAAI,YAAY,QAAQ,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,EAAG,QAAO;AACtF,UAAM,SAAS;AACf,QAAI,OAAO,OAAO,0BAA0B,YAAY,CAAC,kBAAkB,KAAK,OAAO,qBAAqB,EAAG,QAAO;AACtH,QAAI,OAAO,OAAO,uBAAuB,YAAY,CAAC,kBAAkB,KAAK,OAAO,kBAAkB,EAAG,QAAO;AAChH,QAAI,OAAO,OAAO,qBAAqB,UAAW,QAAO;AACzD,QAAI,OAAO,OAAO,uBAAuB,YAAY,CAAC,OAAO,cAAc,OAAO,kBAAkB,KAAK,OAAO,qBAAqB,EAAG,QAAO;AAC/I,WAAO;AAAA,MACL,YAAY,OAAO,sBAAsB,YAAY;AAAA,MACrD,SAAS,OAAO,mBAAmB,YAAY;AAAA,MAC/C,OAAO,OAAO;AAAA,MACd,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,QAAQ;AACN,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,GAAG;AAClG,UAAM,IAAI,UAAU,gDAAgD;AAAA,EACtE;AACA,MAAI,MAAM,oBAAoB,QAAQ,iBAAiB;AACrD,UAAM,IAAI,MAAM,6EAA6E;AAAA,EAC/F;AACA,MAAI,MAAM,oBAAoB,QAAQ,WAAW;AAC/C,UAAM,IAAI,MAAM,+EAA+E;AAAA,EACjG;AAEA,QAAM,WAAW,GAAG,aAAa,aAAa;AAC9C,QAAM,QAAQ,IAAI,WAAW,QAAQ;AACrC,MAAI;AACF,WAAO,MAAM,YAAY,OAAO;AAAA,MAC9B,UAAU,MAAM;AAAA,MAChB,aAAa,MAAM;AAAA,MACnB,MAAM,MAAM;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH,UAAE;AACA,UAAM,MAAM;AAAA,EACd;AACF;","names":["current"]}
package/package.json CHANGED
@@ -1,24 +1,85 @@
1
1
  {
2
2
  "name": "scriptonia",
3
- "version": "0.8.0",
3
+ "version": "0.9.0-rc.2",
4
4
  "description": "Turn customer signal into plans and merge-blocking verification for AI-written PRs.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "scriptonia": "bin/scriptonia.mjs"
7
+ "scriptonia": "dist/index.js"
8
8
  },
9
9
  "scripts": {
10
- "test": "node --test"
10
+ "build": "tsup",
11
+ "test": "node --test test/*.test.mjs",
12
+ "typecheck": "tsc --noEmit -p ../tsconfig.json",
13
+ "check:version-available": "node src/check-version-available.mjs",
14
+ "verify:release-evidence": "node --import tsx ../packages/test-fixtures/scripts/verify-release-evidence.ts",
15
+ "release": "node src/publish-release.mjs",
16
+ "prepublishOnly": "npm run check:version-available && npm run build && npm run typecheck && npm test && npm run verify:release-evidence"
11
17
  },
12
18
  "files": [
19
+ "assets/grammar-manifest.json",
20
+ "assets/queries",
21
+ "assets/grammars/tree-sitter-bash.wasm",
22
+ "assets/grammars/tree-sitter-c.wasm",
23
+ "assets/grammars/tree-sitter-cpp.wasm",
24
+ "assets/grammars/tree-sitter-dart.wasm",
25
+ "assets/grammars/tree-sitter-go.wasm",
26
+ "assets/grammars/tree-sitter-java.wasm",
27
+ "assets/grammars/tree-sitter-javascript.wasm",
28
+ "assets/grammars/tree-sitter-kotlin.wasm",
29
+ "assets/grammars/tree-sitter-objc.wasm",
30
+ "assets/grammars/tree-sitter-python.wasm",
31
+ "assets/grammars/tree-sitter-rust.wasm",
32
+ "assets/grammars/tree-sitter-swift.wasm",
33
+ "assets/grammars/tree-sitter-tsx.wasm",
34
+ "assets/grammars/tree-sitter-typescript.wasm",
35
+ "assets/licenses",
36
+ "assets/tree-sitter.wasm",
13
37
  "bin",
38
+ "dist",
14
39
  "README.md"
15
40
  ],
16
41
  "engines": {
17
- "node": ">=18"
42
+ "node": ">=22 <26"
18
43
  },
19
44
  "dependencies": {
20
45
  "@modelcontextprotocol/sdk": "^1.29.0",
21
- "zod": "^3.25.76"
46
+ "@opentelemetry/api": "^1.9.0",
47
+ "better-sqlite3": "^12.4.1",
48
+ "commander": "^14.0.2",
49
+ "fast-glob": "^3.3.3",
50
+ "fast-xml-parser": "^5.3.2",
51
+ "ignore": "^7.0.6",
52
+ "picocolors": "^1.1.1",
53
+ "picomatch": "^4.0.3",
54
+ "web-tree-sitter": "^0.25.10",
55
+ "yaml": "^2.8.1",
56
+ "zod": "^4.1.12"
57
+ },
58
+ "optionalDependencies": {
59
+ "@opentelemetry/exporter-trace-otlp-http": "^0.220.0",
60
+ "@opentelemetry/sdk-node": "^0.220.0"
61
+ },
62
+ "devDependencies": {
63
+ "@scriptonia/brain-ast": "workspace:*",
64
+ "@scriptonia/brain-builder": "workspace:*",
65
+ "@scriptonia/brain-census": "workspace:*",
66
+ "@scriptonia/brain-context": "workspace:*",
67
+ "@scriptonia/brain-graph": "workspace:*",
68
+ "@scriptonia/brain-knowledge": "workspace:*",
69
+ "@scriptonia/core": "workspace:*",
70
+ "@scriptonia/eval-engine": "workspace:*",
71
+ "@scriptonia/git-snapshot": "workspace:*",
72
+ "@scriptonia/github": "workspace:*",
73
+ "@scriptonia/observability": "workspace:*",
74
+ "@scriptonia/policy-engine": "workspace:*",
75
+ "@scriptonia/run-capture": "workspace:*",
76
+ "@scriptonia/schemas": "workspace:*",
77
+ "@scriptonia/scope-engine": "workspace:*",
78
+ "@scriptonia/storage-sqlite": "workspace:*",
79
+ "tsup": "^8.5.1",
80
+ "tsx": "^4.20.6",
81
+ "typescript": "^5.8.3",
82
+ "vitest": "^4.1.9"
22
83
  },
23
84
  "keywords": [
24
85
  "scriptonia",
@@ -30,5 +91,17 @@
30
91
  "cli"
31
92
  ],
32
93
  "homepage": "https://scriptonia.dev",
94
+ "repository": {
95
+ "type": "git",
96
+ "url": "git+https://github.com/paranormal07/scriptonia_context.git",
97
+ "directory": "scriptonia-cli"
98
+ },
99
+ "bugs": {
100
+ "url": "https://github.com/paranormal07/scriptonia_context/issues"
101
+ },
102
+ "publishConfig": {
103
+ "access": "public",
104
+ "tag": "next"
105
+ },
33
106
  "license": "MIT"
34
107
  }