@momentiq/dark-factory-cli 0.1.0-alpha.4
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/LICENSE +201 -0
- package/README.md +150 -0
- package/dist/adapters/_shared.d.ts +45 -0
- package/dist/adapters/_shared.d.ts.map +1 -0
- package/dist/adapters/_shared.js +200 -0
- package/dist/adapters/_shared.js.map +1 -0
- package/dist/adapters/codex-sdk.d.ts +279 -0
- package/dist/adapters/codex-sdk.d.ts.map +1 -0
- package/dist/adapters/codex-sdk.js +930 -0
- package/dist/adapters/codex-sdk.js.map +1 -0
- package/dist/adapters/critic-result-schema.d.ts +215 -0
- package/dist/adapters/critic-result-schema.d.ts.map +1 -0
- package/dist/adapters/critic-result-schema.js +153 -0
- package/dist/adapters/critic-result-schema.js.map +1 -0
- package/dist/adapters/critic.d.ts +62 -0
- package/dist/adapters/critic.d.ts.map +1 -0
- package/dist/adapters/critic.js +79 -0
- package/dist/adapters/critic.js.map +1 -0
- package/dist/adapters/cursor-sdk.d.ts +153 -0
- package/dist/adapters/cursor-sdk.d.ts.map +1 -0
- package/dist/adapters/cursor-sdk.js +818 -0
- package/dist/adapters/cursor-sdk.js.map +1 -0
- package/dist/adapters/gemini-sdk.d.ts +113 -0
- package/dist/adapters/gemini-sdk.d.ts.map +1 -0
- package/dist/adapters/gemini-sdk.js +532 -0
- package/dist/adapters/gemini-sdk.js.map +1 -0
- package/dist/adapters/grok-direct-sdk.d.ts +148 -0
- package/dist/adapters/grok-direct-sdk.d.ts.map +1 -0
- package/dist/adapters/grok-direct-sdk.js +694 -0
- package/dist/adapters/grok-direct-sdk.js.map +1 -0
- package/dist/branch-protection/audit_branch_protection.py +759 -0
- package/dist/branch-protection/index.d.ts +25 -0
- package/dist/branch-protection/index.d.ts.map +1 -0
- package/dist/branch-protection/index.js +70 -0
- package/dist/branch-protection/index.js.map +1 -0
- package/dist/branch-protection/spec-default.yaml +314 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +581 -0
- package/dist/cli.js.map +1 -0
- package/dist/cycle-doc-validator/index.d.ts +43 -0
- package/dist/cycle-doc-validator/index.d.ts.map +1 -0
- package/dist/cycle-doc-validator/index.js +69 -0
- package/dist/cycle-doc-validator/index.js.map +1 -0
- package/dist/cycle-doc-validator/validate_cycle_doc.py +1260 -0
- package/dist/cycle-tracker-sync/attribute_pr_cycle_ref.py +384 -0
- package/dist/cycle-tracker-sync/index.d.ts +20 -0
- package/dist/cycle-tracker-sync/index.d.ts.map +1 -0
- package/dist/cycle-tracker-sync/index.js +71 -0
- package/dist/cycle-tracker-sync/index.js.map +1 -0
- package/dist/cycle-tracker-sync/sync_cycle_trackers.py +1093 -0
- package/dist/evidence/audit-trail.d.ts +59 -0
- package/dist/evidence/audit-trail.d.ts.map +1 -0
- package/dist/evidence/audit-trail.js +283 -0
- package/dist/evidence/audit-trail.js.map +1 -0
- package/dist/evidence/index.d.ts +4 -0
- package/dist/evidence/index.d.ts.map +1 -0
- package/dist/evidence/index.js +29 -0
- package/dist/evidence/index.js.map +1 -0
- package/dist/evidence/per-sha.d.ts +13 -0
- package/dist/evidence/per-sha.d.ts.map +1 -0
- package/dist/evidence/per-sha.js +97 -0
- package/dist/evidence/per-sha.js.map +1 -0
- package/dist/evidence/quality-gates.d.ts +19 -0
- package/dist/evidence/quality-gates.d.ts.map +1 -0
- package/dist/evidence/quality-gates.js +212 -0
- package/dist/evidence/quality-gates.js.map +1 -0
- package/dist/git.d.ts +40 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +414 -0
- package/dist/git.js.map +1 -0
- package/dist/glob.d.ts +4 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +99 -0
- package/dist/glob.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/paths.d.ts +12 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +42 -0
- package/dist/paths.js.map +1 -0
- package/dist/policy/baseline.d.ts +15 -0
- package/dist/policy/baseline.d.ts.map +1 -0
- package/dist/policy/baseline.js +115 -0
- package/dist/policy/baseline.js.map +1 -0
- package/dist/policy/config.d.ts +64 -0
- package/dist/policy/config.d.ts.map +1 -0
- package/dist/policy/config.js +363 -0
- package/dist/policy/config.js.map +1 -0
- package/dist/policy/gate.d.ts +80 -0
- package/dist/policy/gate.d.ts.map +1 -0
- package/dist/policy/gate.js +1019 -0
- package/dist/policy/gate.js.map +1 -0
- package/dist/policy/index.d.ts +7 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +14 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/merge-queue.d.ts +183 -0
- package/dist/policy/merge-queue.d.ts.map +1 -0
- package/dist/policy/merge-queue.js +310 -0
- package/dist/policy/merge-queue.js.map +1 -0
- package/dist/policy/profile.d.ts +98 -0
- package/dist/policy/profile.d.ts.map +1 -0
- package/dist/policy/profile.js +156 -0
- package/dist/policy/profile.js.map +1 -0
- package/dist/policy/tdd-classifier.d.ts +18 -0
- package/dist/policy/tdd-classifier.d.ts.map +1 -0
- package/dist/policy/tdd-classifier.js +79 -0
- package/dist/policy/tdd-classifier.js.map +1 -0
- package/dist/prompt.d.ts +13 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +175 -0
- package/dist/prompt.js.map +1 -0
- package/dist/report.d.ts +88 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +376 -0
- package/dist/report.js.map +1 -0
- package/dist/runner.d.ts +30 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +456 -0
- package/dist/runner.js.map +1 -0
- package/dist/security.d.ts +2 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +19 -0
- package/dist/security.js.map +1 -0
- package/dist/trusted-surface/rebind.d.ts +10 -0
- package/dist/trusted-surface/rebind.d.ts.map +1 -0
- package/dist/trusted-surface/rebind.js +154 -0
- package/dist/trusted-surface/rebind.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
2
|
+
import { isAbsolute, relative, resolve } from "node:path";
|
|
3
|
+
import { changedFiles, commitDiff, commitMetadata, commitParent, commitStat, currentBranch, diffHash as diffHashFn, gitShowFile, resolveCommit, } from "../git.js";
|
|
4
|
+
import { readQualityGateEvidence } from "../evidence/index.js";
|
|
5
|
+
const DEFAULT_DIFF_BUDGET = 1_500_000;
|
|
6
|
+
export async function buildReviewPacket(loaded, options = {}) {
|
|
7
|
+
const { config, repoRoot } = loaded;
|
|
8
|
+
const cwd = options.cwd ?? repoRoot;
|
|
9
|
+
const ref = options.ref ?? "HEAD";
|
|
10
|
+
const sha = await resolveCommit(ref, cwd);
|
|
11
|
+
const parent = await safeParent(sha, cwd);
|
|
12
|
+
const branch = await currentBranch(cwd);
|
|
13
|
+
const metadata = await commitMetadata(sha, cwd);
|
|
14
|
+
const range = parent ? `${parent}..${sha}` : sha;
|
|
15
|
+
const stat = await commitStat(parent, sha, cwd);
|
|
16
|
+
const fullDiff = await commitDiff(parent, sha, cwd);
|
|
17
|
+
const diff = fullDiff.length > DEFAULT_DIFF_BUDGET
|
|
18
|
+
? `${fullDiff.slice(0, DEFAULT_DIFF_BUDGET)}\n... [diff truncated at ${DEFAULT_DIFF_BUDGET} bytes]\n`
|
|
19
|
+
: fullDiff;
|
|
20
|
+
const diffTruncated = fullDiff.length > DEFAULT_DIFF_BUDGET;
|
|
21
|
+
const hash = diffHashFn(fullDiff);
|
|
22
|
+
const files = await changedFiles(parent, sha, cwd, {
|
|
23
|
+
maxBytes: config.context.maxChangedFileBytes,
|
|
24
|
+
readContent: config.context.includeFullChangedFiles,
|
|
25
|
+
});
|
|
26
|
+
const guidanceFiles = options.trustedSurfaceRef !== undefined
|
|
27
|
+
? await readGuidanceFilesFromRef(options.trustedSurfaceRef, config.context.guidanceFiles, cwd)
|
|
28
|
+
: readGuidanceFiles(repoRoot, config.context.guidanceFiles);
|
|
29
|
+
const promptFragments = options.trustedSurfaceRef !== undefined
|
|
30
|
+
? await readGuidanceFilesFromRef(options.trustedSurfaceRef, config.context.promptFragments, cwd)
|
|
31
|
+
: readGuidanceFiles(repoRoot, config.context.promptFragments);
|
|
32
|
+
const validation = await readValidationEvidence(loaded, sha);
|
|
33
|
+
return {
|
|
34
|
+
repoRoot,
|
|
35
|
+
branch,
|
|
36
|
+
commit: metadata,
|
|
37
|
+
range,
|
|
38
|
+
diffHash: hash,
|
|
39
|
+
stat,
|
|
40
|
+
diff,
|
|
41
|
+
diffTruncated,
|
|
42
|
+
changedFiles: files,
|
|
43
|
+
guidanceFiles,
|
|
44
|
+
promptFragments,
|
|
45
|
+
validation,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
async function safeParent(sha, cwd) {
|
|
49
|
+
try {
|
|
50
|
+
return await commitParent(sha, cwd);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return "";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function readGuidanceFiles(repoRoot, paths) {
|
|
57
|
+
return readContainedFiles(repoRoot, paths);
|
|
58
|
+
}
|
|
59
|
+
// Shared by `context.ts` and `evals.ts` — both build packets that get sent to
|
|
60
|
+
// the Cursor critic prompt (an external API call). `loadAgentReviewConfig`
|
|
61
|
+
// reads `.agent-review/config.json` from HEAD, so untrusted commits can list
|
|
62
|
+
// `/etc/passwd`, `../../.ssh/id_rsa`, or a tracked symlink pointing outside
|
|
63
|
+
// the repo, and exfiltrate workstation files via the prompt. Every load path
|
|
64
|
+
// must go through this helper.
|
|
65
|
+
export function readContainedFiles(repoRoot, paths) {
|
|
66
|
+
const out = [];
|
|
67
|
+
for (const rel of paths) {
|
|
68
|
+
assertContainedPath(repoRoot, rel);
|
|
69
|
+
const absolute = resolve(repoRoot, rel);
|
|
70
|
+
if (!existsSync(absolute))
|
|
71
|
+
continue;
|
|
72
|
+
// realpath resolves symlinks; if the real target escapes the repo, refuse.
|
|
73
|
+
// Without this check, a tracked symlink `leak -> /Users/x/.ssh/id_rsa`
|
|
74
|
+
// would pass the lexical guard above and still leak the target.
|
|
75
|
+
const realAbsolute = realpathSync(absolute);
|
|
76
|
+
const realInside = relative(repoRoot, realAbsolute);
|
|
77
|
+
if (realInside.startsWith("..") || isAbsolute(realInside)) {
|
|
78
|
+
throw new Error(`agent-review config path resolves (via symlink) outside repo root: ${rel} → ${realAbsolute}`);
|
|
79
|
+
}
|
|
80
|
+
const content = readFileSync(realAbsolute, "utf8");
|
|
81
|
+
out.push({ path: rel, content });
|
|
82
|
+
}
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
// Read guidance files from a specific git ref. Used when the policy
|
|
86
|
+
// baseline (`policy-baseline.ts`) detected self-modification of trusted
|
|
87
|
+
// policy surface — the parent's contents must apply, not the working tree's
|
|
88
|
+
// (which may have been tampered with). Missing files at the ref are treated
|
|
89
|
+
// the same as missing files in the working tree (skipped, not fatal).
|
|
90
|
+
//
|
|
91
|
+
// Path containment is still checked lexically — absolute paths and `..`
|
|
92
|
+
// traversal are rejected even when reading from a ref, since the path comes
|
|
93
|
+
// from the (parent's) config file. Symlink resolution does not apply
|
|
94
|
+
// because git tracks symlinks as their target string, not the resolved
|
|
95
|
+
// path; `git show ref:path` returns the file's literal blob contents.
|
|
96
|
+
async function readGuidanceFilesFromRef(ref, paths, cwd) {
|
|
97
|
+
const out = [];
|
|
98
|
+
for (const rel of paths) {
|
|
99
|
+
if (isAbsolute(rel)) {
|
|
100
|
+
throw new Error(`agent-review config path must be repo-relative, got absolute: ${rel}`);
|
|
101
|
+
}
|
|
102
|
+
if (rel.split("/").some((segment) => segment === "..")) {
|
|
103
|
+
throw new Error(`agent-review config path escapes repo root: ${rel}`);
|
|
104
|
+
}
|
|
105
|
+
const content = await gitShowFile(ref, rel, cwd);
|
|
106
|
+
if (content === null)
|
|
107
|
+
continue;
|
|
108
|
+
out.push({ path: rel, content });
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
// Lexical containment check: rejects absolute paths and `..` traversal.
|
|
113
|
+
// Pair with the realpath check in `readContainedFiles` to also catch
|
|
114
|
+
// symlinks that resolve outside the repo.
|
|
115
|
+
function assertContainedPath(repoRoot, rel) {
|
|
116
|
+
if (isAbsolute(rel)) {
|
|
117
|
+
throw new Error(`agent-review config path must be repo-relative, got absolute: ${rel}`);
|
|
118
|
+
}
|
|
119
|
+
const resolved = resolve(repoRoot, rel);
|
|
120
|
+
const inside = relative(repoRoot, resolved);
|
|
121
|
+
if (inside.startsWith("..") || isAbsolute(inside)) {
|
|
122
|
+
throw new Error(`agent-review config path escapes repo root: ${rel} → ${resolved}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async function readValidationEvidence(loaded, sha) {
|
|
126
|
+
const required = [...loaded.config.validation.requiredQualityGates];
|
|
127
|
+
const optional = [...loaded.config.validation.optionalQualityGates];
|
|
128
|
+
const result = {
|
|
129
|
+
requiredQualityGates: required,
|
|
130
|
+
optionalQualityGates: optional,
|
|
131
|
+
evidence: [],
|
|
132
|
+
missing: [...required],
|
|
133
|
+
stale: false,
|
|
134
|
+
};
|
|
135
|
+
// Delegate to `readQualityGateEvidence` which implements the per-SHA-first
|
|
136
|
+
// read path with legacy `latest.json` fallback (cycle 318.2 canonical
|
|
137
|
+
// layout). Prior to issue #1370, this function only read the legacy
|
|
138
|
+
// `latest.json` directly — so any time that file pointed at a different
|
|
139
|
+
// commit (multi-commit gate runs, `agent-review-test` test-pollution, etc.)
|
|
140
|
+
// the packet would falsely report `qualityGateResults: []` and
|
|
141
|
+
// `qualityGatesMissing: [<all required gates>]` even when valid per-SHA
|
|
142
|
+
// evidence existed on disk.
|
|
143
|
+
const read = await readQualityGateEvidence(loaded, sha);
|
|
144
|
+
if (!read.evidence)
|
|
145
|
+
return result;
|
|
146
|
+
if (read.stale) {
|
|
147
|
+
result.stale = true;
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
result.evidence = read.evidence.results;
|
|
151
|
+
result.missing = required.filter((r) => !read.evidence.results.some((e) => e.command === r));
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=rebind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rebind.js","sourceRoot":"","sources":["../../src/trusted-surface/rebind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,QAAQ,IAAI,UAAU,EACtB,WAAW,EACX,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAmB/D,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAEtC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAoB,EACpB,UAA8B,EAAE;IAEhC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC;IAElC,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,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,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IACxC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC,MAAM,CAC9B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAC5D,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@momentiq/dark-factory-cli",
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
|
+
"description": "Dark Factory OSS CLI — multi-vendor adversarial critic orchestration (Cursor, Codex, Gemini, Grok) with min-complete-quorum aggregation and trusted-surface rebind",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./adapters": {
|
|
15
|
+
"types": "./dist/adapters/index.d.ts",
|
|
16
|
+
"import": "./dist/adapters/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./policy": {
|
|
19
|
+
"types": "./dist/policy/index.d.ts",
|
|
20
|
+
"import": "./dist/policy/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./trusted-surface": {
|
|
23
|
+
"types": "./dist/trusted-surface/index.d.ts",
|
|
24
|
+
"import": "./dist/trusted-surface/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./evidence": {
|
|
27
|
+
"types": "./dist/evidence/index.d.ts",
|
|
28
|
+
"import": "./dist/evidence/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./cycle-doc-validator": {
|
|
31
|
+
"types": "./dist/cycle-doc-validator/index.d.ts",
|
|
32
|
+
"import": "./dist/cycle-doc-validator/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./branch-protection": {
|
|
35
|
+
"types": "./dist/branch-protection/index.d.ts",
|
|
36
|
+
"import": "./dist/branch-protection/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./cycle-tracker-sync": {
|
|
39
|
+
"types": "./dist/cycle-tracker-sync/index.d.ts",
|
|
40
|
+
"import": "./dist/cycle-tracker-sync/index.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"bin": {
|
|
44
|
+
"df": "./dist/cli.js"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-assets.mjs",
|
|
53
|
+
"pretest": "npm run build",
|
|
54
|
+
"test": "vitest run",
|
|
55
|
+
"test:python": "python3 -m pytest tests/cycle-doc-validator tests/branch-protection tests/cycle-tracker-sync -q",
|
|
56
|
+
"test:all": "npm run test && npm run test:python",
|
|
57
|
+
"test:watch": "vitest",
|
|
58
|
+
"type-check": "tsc -p tsconfig.json --noEmit"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=20"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@cursor/sdk": "^1.0.12",
|
|
65
|
+
"@google/genai": "^2.2.0",
|
|
66
|
+
"@momentiq/dark-factory-schemas": "*",
|
|
67
|
+
"@openai/codex-sdk": "^0.130.0",
|
|
68
|
+
"openai": "^6.37.0",
|
|
69
|
+
"zod": "^3.23.0",
|
|
70
|
+
"zod-to-json-schema": "^3.25.2"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@types/node": "^20.11.0",
|
|
74
|
+
"@vitest/coverage-v8": "^2.1.9",
|
|
75
|
+
"typescript": "^5.5.0",
|
|
76
|
+
"vitest": "^2.1.0"
|
|
77
|
+
}
|
|
78
|
+
}
|