@lesliechan721/agent-skill-eval 0.1.0-beta.6 → 0.1.0-beta.61
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/dist/bin.js +167 -39
- package/dist/bin.js.map +1 -1
- package/dist/codex-eval-app-server.d.ts +213 -0
- package/dist/codex-eval-app-server.js +1387 -0
- package/dist/codex-eval-app-server.js.map +1 -0
- package/dist/codex-eval-cases.d.ts +41 -0
- package/dist/codex-eval-cases.js +324 -0
- package/dist/codex-eval-cases.js.map +1 -0
- package/dist/codex-eval-isolation.d.ts +79 -0
- package/dist/codex-eval-isolation.js +420 -0
- package/dist/codex-eval-isolation.js.map +1 -0
- package/dist/codex-eval-process-tree.d.ts +42 -0
- package/dist/codex-eval-process-tree.js +860 -0
- package/dist/codex-eval-process-tree.js.map +1 -0
- package/dist/codex-eval-rollout.d.ts +8 -0
- package/dist/codex-eval-rollout.js +85 -0
- package/dist/codex-eval-rollout.js.map +1 -0
- package/dist/codex-eval-runtime-config.d.ts +43 -0
- package/dist/codex-eval-runtime-config.js +607 -0
- package/dist/codex-eval-runtime-config.js.map +1 -0
- package/dist/codex-trigger-eval.d.ts +86 -0
- package/dist/codex-trigger-eval.js +943 -0
- package/dist/codex-trigger-eval.js.map +1 -0
- package/dist/codex-workflow-evaluation.d.ts +91 -0
- package/dist/codex-workflow-evaluation.js +309 -0
- package/dist/codex-workflow-evaluation.js.map +1 -0
- package/dist/codex-workflow-fixtures.d.ts +37 -0
- package/dist/codex-workflow-fixtures.js +144 -0
- package/dist/codex-workflow-fixtures.js.map +1 -0
- package/dist/codex-workflow.d.ts +224 -0
- package/dist/codex-workflow.js +2143 -0
- package/dist/codex-workflow.js.map +1 -0
- package/dist/credentials.d.ts +5 -0
- package/dist/credentials.js +30 -0
- package/dist/credentials.js.map +1 -0
- package/dist/custom-process.d.ts +60 -0
- package/dist/custom-process.js +424 -0
- package/dist/custom-process.js.map +1 -0
- package/dist/eval-audit.d.ts +38 -0
- package/dist/eval-audit.js +71 -0
- package/dist/eval-audit.js.map +1 -0
- package/dist/eval-file.d.ts +9 -0
- package/dist/eval-file.js +15 -0
- package/dist/eval-file.js.map +1 -0
- package/dist/eval-process-management.d.ts +23 -0
- package/dist/eval-process-management.js +93 -0
- package/dist/eval-process-management.js.map +1 -0
- package/dist/eval-result.d.ts +79 -0
- package/dist/eval-result.js +144 -0
- package/dist/eval-result.js.map +1 -0
- package/dist/eval-run.d.ts +27 -0
- package/dist/eval-run.js +572 -0
- package/dist/eval-run.js.map +1 -0
- package/dist/eval-spec.d.ts +57 -0
- package/dist/eval-spec.js +120 -0
- package/dist/eval-spec.js.map +1 -0
- package/dist/eval-suite-binding.d.ts +4 -0
- package/dist/eval-suite-binding.js +19 -0
- package/dist/eval-suite-binding.js.map +1 -0
- package/dist/index.d.ts +46 -10
- package/dist/index.js +23 -6
- package/dist/index.js.map +1 -1
- package/dist/instruction-v2.d.ts +53 -0
- package/dist/instruction-v2.js +169 -0
- package/dist/instruction-v2.js.map +1 -0
- package/dist/json-schema.js +84 -5
- package/dist/json-schema.js.map +1 -1
- package/dist/output-path.js +2 -2
- package/dist/process-tree.d.ts +56 -1
- package/dist/process-tree.js +948 -179
- package/dist/process-tree.js.map +1 -1
- package/dist/process.d.ts +2 -2
- package/dist/process.js +104 -34
- package/dist/process.js.map +1 -1
- package/dist/provider-doctor.d.ts +46 -0
- package/dist/provider-doctor.js +123 -0
- package/dist/provider-doctor.js.map +1 -0
- package/dist/providers.d.ts +86 -0
- package/dist/providers.js +689 -0
- package/dist/providers.js.map +1 -0
- package/dist/run-paths.d.ts +8 -0
- package/dist/run-paths.js +71 -0
- package/dist/run-paths.js.map +1 -0
- package/dist/runtime-skill.d.ts +6 -0
- package/dist/runtime-skill.js +87 -3
- package/dist/runtime-skill.js.map +1 -1
- package/dist/schemas/digests.json +7 -3
- package/dist/schemas/eval-audit.schema.json +64 -0
- package/dist/schemas/eval-result.schema.json +232 -0
- package/dist/schemas/eval-spec.schema.json +109 -0
- package/dist/schemas/instruction-v2-receipt.schema.json +24 -0
- package/dist/schemas/instruction-v2-request.schema.json +51 -0
- package/dist/schemas/workflow-evaluation.schema.json +38 -0
- package/dist/schemas/workflow-fixture-action.schema.json +15 -0
- package/dist/schemas.d.ts +1 -3
- package/dist/schemas.js +22 -20
- package/dist/schemas.js.map +1 -1
- package/dist/selected-cases.d.ts +30 -0
- package/dist/selected-cases.js +386 -0
- package/dist/selected-cases.js.map +1 -0
- package/dist/types.d.ts +2 -34
- package/dist/windows-job.d.ts +26 -0
- package/dist/windows-job.js +80 -0
- package/dist/windows-job.js.map +1 -0
- package/dist/windows-native.d.ts +18 -0
- package/dist/windows-native.js +132 -0
- package/dist/windows-native.js.map +1 -0
- package/package.json +19 -3
- package/dist/bundle.d.ts +0 -93
- package/dist/bundle.js +0 -216
- package/dist/bundle.js.map +0 -1
- package/dist/capabilities.d.ts +0 -2
- package/dist/capabilities.js +0 -38
- package/dist/capabilities.js.map +0 -1
- package/dist/plan.d.ts +0 -79
- package/dist/plan.js +0 -285
- package/dist/plan.js.map +0 -1
- package/dist/run.d.ts +0 -2
- package/dist/run.js +0 -592
- package/dist/run.js.map +0 -1
- package/dist/schemas/aw-skill-eval-execution-plan.schema.json +0 -220
- package/dist/schemas/eval-run-bundle.schema.json +0 -408
- package/dist/schemas/eval-runtime-capabilities.schema.json +0 -85
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { lstat, readFile, realpath } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { isPathInside, pathsOverlap, sha256 } from './common.js';
|
|
4
|
+
import { readEvalContractFile } from './eval-file.js';
|
|
5
|
+
import { validateJsonSchema } from './json-schema.js';
|
|
6
|
+
import { assertSafeOutputPath } from './output-path.js';
|
|
7
|
+
import { computeEvalProviderDigest } from './eval-audit.js';
|
|
8
|
+
import { computeCanonicalDirectoryDigest, computeSkillDigest } from './runtime-skill.js';
|
|
9
|
+
import { getSchema } from './schemas.js';
|
|
10
|
+
function isRelativeContractPath(value) {
|
|
11
|
+
if (path.isAbsolute(value) || path.win32.isAbsolute(value))
|
|
12
|
+
return false;
|
|
13
|
+
const segments = value.split(/[\\/]/u);
|
|
14
|
+
return segments.length > 0 && segments.every((segment) => segment !== '' && segment !== '..');
|
|
15
|
+
}
|
|
16
|
+
async function resolveInput(base, relativePath, label, expected) {
|
|
17
|
+
if (!isRelativeContractPath(relativePath))
|
|
18
|
+
throw new Error(`${label} must be a safe relative path`);
|
|
19
|
+
const candidate = path.resolve(base, relativePath);
|
|
20
|
+
if (!isPathInside(base, candidate))
|
|
21
|
+
throw new Error(`${label} leaves the spec directory`);
|
|
22
|
+
let current = base;
|
|
23
|
+
for (const segment of path.relative(base, candidate).split(path.sep)) {
|
|
24
|
+
if (!segment)
|
|
25
|
+
continue;
|
|
26
|
+
current = path.join(current, segment);
|
|
27
|
+
if ((await lstat(current)).isSymbolicLink())
|
|
28
|
+
throw new Error(`${label} cannot contain a symlink path component`);
|
|
29
|
+
}
|
|
30
|
+
const actual = await realpath(candidate);
|
|
31
|
+
if (!isPathInside(base, actual))
|
|
32
|
+
throw new Error(`${label} leaves the spec directory`);
|
|
33
|
+
const info = await lstat(actual);
|
|
34
|
+
if (expected === 'file' && !info.isFile())
|
|
35
|
+
throw new Error(`${label} must be a regular file`);
|
|
36
|
+
if (expected === 'directory' && !info.isDirectory())
|
|
37
|
+
throw new Error(`${label} must be a directory`);
|
|
38
|
+
if (expected === 'file-or-directory' && !info.isFile() && !info.isDirectory())
|
|
39
|
+
throw new Error(`${label} must be a regular file or directory`);
|
|
40
|
+
return actual;
|
|
41
|
+
}
|
|
42
|
+
async function resolveOutput(base, relativePath) {
|
|
43
|
+
if (!isRelativeContractPath(relativePath))
|
|
44
|
+
throw new Error('outputDir must be a safe relative path');
|
|
45
|
+
const candidate = path.resolve(base, relativePath);
|
|
46
|
+
await assertSafeOutputPath(base, candidate);
|
|
47
|
+
return candidate;
|
|
48
|
+
}
|
|
49
|
+
export async function validateEvalSpec(value) {
|
|
50
|
+
const errors = validateJsonSchema(await getSchema('eval-spec'), value);
|
|
51
|
+
return { valid: errors.length === 0, errors, calculated: errors.length === 0 ? value : null };
|
|
52
|
+
}
|
|
53
|
+
export async function parseEvalSpec(value) {
|
|
54
|
+
const validation = await validateEvalSpec(value);
|
|
55
|
+
if (!validation.valid || !validation.calculated)
|
|
56
|
+
throw new Error(validation.errors.join('; '));
|
|
57
|
+
return validation.calculated;
|
|
58
|
+
}
|
|
59
|
+
export async function validateEvalSpecFile(specPath) {
|
|
60
|
+
try {
|
|
61
|
+
const file = await readEvalContractFile(specPath, 'EvalSpec');
|
|
62
|
+
const spec = await parseEvalSpec(file.value);
|
|
63
|
+
const base = await realpath(path.dirname(file.path));
|
|
64
|
+
const workspace = await resolveInput(base, spec.workspace.path, 'workspace', 'directory');
|
|
65
|
+
const target = await resolveInput(base, spec.target.path, 'target', 'file-or-directory');
|
|
66
|
+
const cases = await resolveInput(base, spec.cases.path, 'cases', 'file');
|
|
67
|
+
const workspaceDigest = await computeCanonicalDirectoryDigest(workspace);
|
|
68
|
+
const targetDigest = await computeSkillDigest(target);
|
|
69
|
+
const caseDigest = sha256(await readFile(cases));
|
|
70
|
+
const errors = [];
|
|
71
|
+
if (workspaceDigest !== spec.workspace.digest)
|
|
72
|
+
errors.push('workspace digest does not match workspace content');
|
|
73
|
+
if (targetDigest !== spec.target.digest)
|
|
74
|
+
errors.push('target digest does not match target content');
|
|
75
|
+
if (caseDigest !== spec.cases.digest)
|
|
76
|
+
errors.push('case digest does not match cases content');
|
|
77
|
+
let previousTarget = null;
|
|
78
|
+
let previousTargetDigest = null;
|
|
79
|
+
if (spec.baseline.type === 'previous-version') {
|
|
80
|
+
previousTarget = await resolveInput(base, spec.baseline.target.path, 'previous-version target', 'file-or-directory');
|
|
81
|
+
previousTargetDigest = await computeSkillDigest(previousTarget);
|
|
82
|
+
if (previousTargetDigest !== spec.baseline.target.digest)
|
|
83
|
+
errors.push('previous-version target digest does not match target content');
|
|
84
|
+
}
|
|
85
|
+
const outputDir = await resolveOutput(base, spec.outputDir);
|
|
86
|
+
for (const [label, input] of [
|
|
87
|
+
['workspace', workspace],
|
|
88
|
+
['target', target],
|
|
89
|
+
['cases', cases],
|
|
90
|
+
['previous-version target', previousTarget],
|
|
91
|
+
]) {
|
|
92
|
+
if (input && pathsOverlap(outputDir, input))
|
|
93
|
+
errors.push(`outputDir must not overlap ${label}`);
|
|
94
|
+
}
|
|
95
|
+
if (errors.length > 0)
|
|
96
|
+
return { valid: false, errors, calculated: null };
|
|
97
|
+
return {
|
|
98
|
+
valid: true,
|
|
99
|
+
errors: [],
|
|
100
|
+
calculated: {
|
|
101
|
+
spec,
|
|
102
|
+
specDigest: file.digest,
|
|
103
|
+
workspaceDigest,
|
|
104
|
+
providerDigest: computeEvalProviderDigest(spec.provider),
|
|
105
|
+
targetDigest,
|
|
106
|
+
caseDigest,
|
|
107
|
+
previousTargetDigest,
|
|
108
|
+
paths: { workspace, target, cases, previousTarget, outputDir },
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
return {
|
|
114
|
+
valid: false,
|
|
115
|
+
errors: [`EvalSpec is unavailable or invalid: ${error.message}`],
|
|
116
|
+
calculated: null,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=eval-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-spec.js","sourceRoot":"","sources":["../src/eval-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBA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I,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAC3D,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI;YAC3B,CAAC,WAAW,EAAE,SAAS,CAAC;YACxB,CAAC,QAAQ,EAAE,MAAM,CAAC;YAClB,CAAC,OAAO,EAAE,KAAK,CAAC;YAChB,CAAC,yBAAyB,EAAE,cAAc,CAAC;SACnC,EAAE,CAAC;YACX,IAAI,KAAK,IAAI,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC;gBACzC,MAAM,CAAC,IAAI,CAAC,8BAA8B,KAAK,EAAE,CAAC,CAAA;QACtD,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAA;QACxE,OAAO;YACL,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,EAAE;YACV,UAAU,EAAE;gBACV,IAAI;gBACJ,UAAU,EAAE,IAAI,CAAC,MAAM;gBACvB,eAAe;gBACf,cAAc,EAAE,yBAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACxD,YAAY;gBACZ,UAAU;gBACV,oBAAoB;gBACpB,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE;aAC/D;SACF,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC,uCAAwC,KAAe,CAAC,OAAO,EAAE,CAAC;YAC3E,UAAU,EAAE,IAAI;SACjB,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EvalProvider } from './eval-spec.js';
|
|
2
|
+
import type { SelectedCaseSuiteKind } from './selected-cases.js';
|
|
3
|
+
export declare function validateEvalProviderSuiteKind(provider: EvalProvider, suiteKind: SelectedCaseSuiteKind): string[];
|
|
4
|
+
export declare function assertEvalProviderSuiteKind(provider: EvalProvider, suiteKind: SelectedCaseSuiteKind): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function providerSuiteKind(provider) {
|
|
2
|
+
if (provider === 'codex-trigger')
|
|
3
|
+
return 'trigger';
|
|
4
|
+
if (provider === 'codex-conversation')
|
|
5
|
+
return 'conversation';
|
|
6
|
+
return provider.type;
|
|
7
|
+
}
|
|
8
|
+
export function validateEvalProviderSuiteKind(provider, suiteKind) {
|
|
9
|
+
const expected = providerSuiteKind(provider);
|
|
10
|
+
return expected === suiteKind
|
|
11
|
+
? []
|
|
12
|
+
: [`EvalSpec provider requires selected suite kind ${expected}; received ${suiteKind}.`];
|
|
13
|
+
}
|
|
14
|
+
export function assertEvalProviderSuiteKind(provider, suiteKind) {
|
|
15
|
+
const errors = validateEvalProviderSuiteKind(provider, suiteKind);
|
|
16
|
+
if (errors.length > 0)
|
|
17
|
+
throw new Error(errors.join('; '));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=eval-suite-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-suite-binding.js","sourceRoot":"","sources":["../src/eval-suite-binding.ts"],"names":[],"mappings":"AAGA,SAAS,iBAAiB,CAAC,QAAsB;IAC/C,IAAI,QAAQ,KAAK,eAAe;QAAE,OAAO,SAAS,CAAA;IAClD,IAAI,QAAQ,KAAK,oBAAoB;QAAE,OAAO,cAAc,CAAA;IAC5D,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,QAAsB,EACtB,SAAgC;IAEhC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IAC5C,OAAO,QAAQ,KAAK,SAAS;QAC3B,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,CAAC,kDAAkD,QAAQ,cAAc,SAAS,GAAG,CAAC,CAAA;AAC5F,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,QAAsB,EACtB,SAAgC;IAEhC,MAAM,MAAM,GAAG,6BAA6B,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IACjE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AAC3D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,52 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { computeEvalFileDigest } from './eval-file.js';
|
|
2
|
+
export { parseEvalSpec, validateEvalSpec, validateEvalSpecFile } from './eval-spec.js';
|
|
3
|
+
export { assertEvalProviderSuiteKind, validateEvalProviderSuiteKind, } from './eval-suite-binding.js';
|
|
4
|
+
export { computeEvalProviderDigest, parseEvalAudit, validateEvalAudit, validateEvalAuditFile, } from './eval-audit.js';
|
|
5
|
+
export { computeEvalResultSummary, createEvalResultBinding, evalResultVariantsForSpec, parseEvalResult, validateEvalResult, validateEvalResultFile, } from './eval-result.js';
|
|
2
6
|
export { canonicalJson, computeCaseCorpusDigest } from './corpus-digest.js';
|
|
3
|
-
export {
|
|
4
|
-
export { runExecutionPlan } from './run.js';
|
|
5
|
-
export { validateRunBundle } from './bundle.js';
|
|
6
|
-
export { computeSkillDigest, createRuntimeSkillSnapshot } from './runtime-skill.js';
|
|
7
|
+
export { computeCanonicalDirectoryDigest, computeSkillDigest, createRuntimeSkillSnapshot, } from './runtime-skill.js';
|
|
7
8
|
export type { RuntimeSkillDigestOptions } from './runtime-skill.js';
|
|
8
9
|
export { assertProviderProcessSupported, ProviderProcessCleanupError, runProviderProcess, } from './process.js';
|
|
9
10
|
export type { ProviderProcessDependencies } from './process.js';
|
|
10
11
|
export { assertProcessTreeInspectionAvailable, observeProcessTree, terminateProcessTree, } from './process-tree.js';
|
|
11
|
-
export { getSchema, getSchemaDigest,
|
|
12
|
+
export { getSchema, getSchemaDigest, } from './schemas.js';
|
|
12
13
|
export { validateJsonSchema } from './json-schema.js';
|
|
13
|
-
export type {
|
|
14
|
-
export type {
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
14
|
+
export type { EvalBaseline, EvalProvider, EvalSpec, EvalSpecCalculated, EvalSpecPathDigest, } from './eval-spec.js';
|
|
15
|
+
export type { EvalAudit, EvalAuditBinding, EvalAuditBlockedCase, EvalAuditFileCalculated, EvalAuditIssue, EvalAuditTarget, } from './eval-audit.js';
|
|
16
|
+
export type { EvalGrade, EvalResult, EvalResultBinding, EvalResultFileCalculated, EvalResultRun, EvalResultProcessManagement, EvalResultSummary, EvalRunError, } from './eval-result.js';
|
|
17
|
+
export type { Digest, ExternalContainmentConfirmation, ProcessLifecycleHooks, ProcessRequest, ProcessResult, ProcessTreeCleanupConfirmation, ProcessTerminationReason, ProviderProcessHandle, RuntimeSkillSnapshot, SchemaName, ValidationResult, } from './types.js';
|
|
18
|
+
export type { ProcessTreeDependencies, ProcessTreeDiagnostic, ProcessTreeObservation, ProcessTreeTerminationOptions, } from './process-tree.js';
|
|
19
|
+
export { buildWindowsCommandLine, createWindowsJobInvocation, encodeWindowsJobHelperConfig, quoteWindowsCommandLineArgument, prepareWindowsJobHelper, resolveWindowsJobHelperPath, WINDOWS_JOB_HELPER_CONFIG_SCHEMA_VERSION, } from './windows-job.js';
|
|
20
|
+
export type { WindowsJobHelperConfig, WindowsJobInvocation, PrepareWindowsJobHelperOptions, } from './windows-job.js';
|
|
21
|
+
export { readWindowsNativeProcessStart, readWindowsNativeProcessTable } from './windows-native.js';
|
|
22
|
+
export type { WindowsNativeOptions, WindowsNativeProcessRow } from './windows-native.js';
|
|
23
|
+
export { BUILTIN_EVAL_PROVIDER_IDS, createConversationGraderPrompt, EvalProviderExecutionError, getBuiltinEvalProvider, parseConversationGraderOutput, runBuiltinEvalProvider, } from './providers.js';
|
|
24
|
+
export type { BuiltinEvalProvider, BuiltinEvalProviderDependencies, BuiltinEvalProviderId, BuiltinEvalProviderRunInput, CodexConversationProviderCase, CodexConversationTransportInput, CodexConversationTransportResult, CodexEvalTransport, CodexGraderTransportInput, CodexGraderTransportResult, CodexTriggerProviderCase, CodexTriggerTransportInput, CodexTriggerTransportResult, } from './providers.js';
|
|
25
|
+
export { CODEX_PROVIDER_ENVIRONMENT_ALLOWLIST, executeCustomProcessProvider, parseCustomProcessOutput, parseEvalProviderGrade, } from './custom-process.js';
|
|
26
|
+
export { CODEX_WORKFLOW_ARTIFACTS, codexWorkflowAdapterEnvironment, codexWorkflowFrameIsForRoot, codexWorkflowFrameThreadId, executeCodexWorkflowProvider, normalizeCodexWorkflowRollouts, parseCodexWorkflowRequest, } from './codex-workflow.js';
|
|
27
|
+
export type { CodexWorkflowAdapterInput, CodexWorkflowArtifact, CodexWorkflowCall, CodexWorkflowEvidence, CodexWorkflowExecutionResult, CodexWorkflowExecutorOptions, CodexWorkflowProvider, CodexWorkflowRequest, CodexWorkflowRole, CodexWorkflowTransport, CodexWorkflowTransportInput, } from './codex-workflow.js';
|
|
28
|
+
export { parseInstructionV2ReasoningEffort, parseInstructionV2Receipt, parseInstructionV2Transport, } from './instruction-v2.js';
|
|
29
|
+
export type { InstructionV2ReasoningEffort, InstructionV2Receipt, InstructionV2Request, InstructionV2Transport, } from './instruction-v2.js';
|
|
30
|
+
export { parseWorkflowFixtureAction, validateWorkflowFixtureActions } from './codex-workflow-fixtures.js';
|
|
31
|
+
export type { WorkflowFixtureAction, WorkflowFixtureReceipt, WorkflowFixtureValue } from './codex-workflow-fixtures.js';
|
|
32
|
+
export type { WorkflowEvaluationRequest, WorkflowCheck, WorkflowInteraction } from './codex-workflow-evaluation.js';
|
|
33
|
+
export type { CustomProcessExecutorOptions, CustomProcessInput, CustomProcessOutput, EvalProviderGrade, EvalProviderRunInput, EvalProviderRunResult, EvalProviderUsage, EvalProviderVariant, } from './custom-process.js';
|
|
34
|
+
export { doctorEvalProviders } from './provider-doctor.js';
|
|
35
|
+
export type { EvalProviderDoctorOptions, EvalProviderDoctorResult, } from './provider-doctor.js';
|
|
36
|
+
export { runEvalSpec } from './eval-run.js';
|
|
37
|
+
export type { RunEvalSpecOptions, RunEvalSpecResult } from './eval-run.js';
|
|
38
|
+
export { codexPermissionProfileStatus, normalizedCodexPermissionProfile, resolveEvalProcessManagement, } from './eval-process-management.js';
|
|
39
|
+
export type { EvalProcessManagementDependencies } from './eval-process-management.js';
|
|
40
|
+
export { parseSelectedCases, validateSelectedCases, validateSelectedCasesFile, } from './selected-cases.js';
|
|
41
|
+
export type { SelectedCasesDocument, SelectedCaseSuite, SelectedCaseSuiteKind, SelectedEvalCase, } from './selected-cases.js';
|
|
42
|
+
export { inspectTriggerAppServerConfigWarning, inspectTriggerAppServerFrame, runCodexTriggerProviderCase, summarizeTriggerCase, } from './codex-trigger-eval.js';
|
|
43
|
+
export type { TriggerRunEvidence } from './codex-trigger-eval.js';
|
|
44
|
+
export type { AwSkillEvalIsolation, AwSkillEvalTriggerCase, AwSkillEvalTriggerSuite, AwSkillEvalTriggerSuiteCaseContract, } from './codex-eval-cases.js';
|
|
45
|
+
export { EvalAppServerSession, extractAppServerThreadId, inspectAppServerConfigWarning, normalizeConversationProviderCase, runCodexConversationProviderCase, runCodexEvalIsolationProbe, settleAppServerProcessCleanup, } from './codex-eval-app-server.js';
|
|
46
|
+
export type { AppServerRunEvidence, CodexEvalProcessManagementEvidence, ConversationEvalCase, } from './codex-eval-app-server.js';
|
|
47
|
+
export { applyCodexEvalProviderEnvironment, assertCodexEvalCanStartWork, cleanupActiveCodexEvalResources, cleanCodexEvalRuntimeConfig, codexEvalRuntimeEvidence, createCodexEvalTemporaryRoot, DEFAULT_CODEX_EVAL_MODEL, isCodexEvalRuntimeEvidence, materializeCodexEvalRuntimeHome, redactCodexEvalText, redactCodexEvalValue, registerCodexEvalSignalCleanup, registerCodexEvalTemporaryRoot, resetCodexEvalSignalShutdownForTests, resolveCodexEvalRuntimeConfig, } from './codex-eval-runtime-config.js';
|
|
48
|
+
export type { CodexEvalCredentialSource, CodexEvalRuntimeConfig, ResolveCodexEvalRuntimeOptions, } from './codex-eval-runtime-config.js';
|
|
49
|
+
export { applyCodexEvalGitIsolation, assertCodexEvalKeychainWrapperAbsent, codexEvalConfigOverrides, CODEX_EVAL_CREDENTIAL_CONFIG_LINES, CODEX_EVAL_STRICT_OVERRIDES, codexEvalIsolationEvidence, inspectCodexEvalHostIsolation, inspectCodexEvalKeychain, validateCodexEvalConfigIsolation, validateCodexEvalRpcIsolation, } from './codex-eval-isolation.js';
|
|
50
|
+
export type { CodexEvalHostIsolationEvidence, CodexEvalIsolationEvidence, CodexEvalRpcIsolationEvidence, InspectCodexEvalHostOptions, CodexEvalKeychainInspection, } from './codex-eval-isolation.js';
|
|
51
|
+
export { CODEX_EVAL_PROCESS_TREE_ID_ENV, createChildProcessTreeMonitor, createDirectChildProcessMonitor, createPosixProcessTreeMonitor, createWindowsChildProcessTreeMonitor, processTreeCleanupIsUnconfirmed, PROCESS_TREE_CLEANUP_UNCONFIRMED_PREFIX, releaseChildProcessHandles, scrubProcessTreeId, terminateChildProcessTree, terminatePosixProcessTree, terminateWindowsProcessTree, assertProcessTreeInspectionAvailable as assertCodexEvalProcessTreeInspectionAvailable, } from './codex-eval-process-tree.js';
|
|
52
|
+
export type { ChildProcessTreeMonitor } from './codex-eval-process-tree.js';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { computeEvalFileDigest } from './eval-file.js';
|
|
2
|
+
export { parseEvalSpec, validateEvalSpec, validateEvalSpecFile } from './eval-spec.js';
|
|
3
|
+
export { assertEvalProviderSuiteKind, validateEvalProviderSuiteKind, } from './eval-suite-binding.js';
|
|
4
|
+
export { computeEvalProviderDigest, parseEvalAudit, validateEvalAudit, validateEvalAuditFile, } from './eval-audit.js';
|
|
5
|
+
export { computeEvalResultSummary, createEvalResultBinding, evalResultVariantsForSpec, parseEvalResult, validateEvalResult, validateEvalResultFile, } from './eval-result.js';
|
|
2
6
|
export { canonicalJson, computeCaseCorpusDigest } from './corpus-digest.js';
|
|
3
|
-
export {
|
|
4
|
-
export { runExecutionPlan } from './run.js';
|
|
5
|
-
export { validateRunBundle } from './bundle.js';
|
|
6
|
-
export { computeSkillDigest, createRuntimeSkillSnapshot } from './runtime-skill.js';
|
|
7
|
+
export { computeCanonicalDirectoryDigest, computeSkillDigest, createRuntimeSkillSnapshot, } from './runtime-skill.js';
|
|
7
8
|
export { assertProviderProcessSupported, ProviderProcessCleanupError, runProviderProcess, } from './process.js';
|
|
8
9
|
export { assertProcessTreeInspectionAvailable, observeProcessTree, terminateProcessTree, } from './process-tree.js';
|
|
9
|
-
export { getSchema, getSchemaDigest,
|
|
10
|
+
export { getSchema, getSchemaDigest, } from './schemas.js';
|
|
10
11
|
export { validateJsonSchema } from './json-schema.js';
|
|
12
|
+
export { buildWindowsCommandLine, createWindowsJobInvocation, encodeWindowsJobHelperConfig, quoteWindowsCommandLineArgument, prepareWindowsJobHelper, resolveWindowsJobHelperPath, WINDOWS_JOB_HELPER_CONFIG_SCHEMA_VERSION, } from './windows-job.js';
|
|
13
|
+
export { readWindowsNativeProcessStart, readWindowsNativeProcessTable } from './windows-native.js';
|
|
14
|
+
export { BUILTIN_EVAL_PROVIDER_IDS, createConversationGraderPrompt, EvalProviderExecutionError, getBuiltinEvalProvider, parseConversationGraderOutput, runBuiltinEvalProvider, } from './providers.js';
|
|
15
|
+
export { CODEX_PROVIDER_ENVIRONMENT_ALLOWLIST, executeCustomProcessProvider, parseCustomProcessOutput, parseEvalProviderGrade, } from './custom-process.js';
|
|
16
|
+
export { CODEX_WORKFLOW_ARTIFACTS, codexWorkflowAdapterEnvironment, codexWorkflowFrameIsForRoot, codexWorkflowFrameThreadId, executeCodexWorkflowProvider, normalizeCodexWorkflowRollouts, parseCodexWorkflowRequest, } from './codex-workflow.js';
|
|
17
|
+
export { parseInstructionV2ReasoningEffort, parseInstructionV2Receipt, parseInstructionV2Transport, } from './instruction-v2.js';
|
|
18
|
+
export { parseWorkflowFixtureAction, validateWorkflowFixtureActions } from './codex-workflow-fixtures.js';
|
|
19
|
+
export { doctorEvalProviders } from './provider-doctor.js';
|
|
20
|
+
export { runEvalSpec } from './eval-run.js';
|
|
21
|
+
export { codexPermissionProfileStatus, normalizedCodexPermissionProfile, resolveEvalProcessManagement, } from './eval-process-management.js';
|
|
22
|
+
export { parseSelectedCases, validateSelectedCases, validateSelectedCasesFile, } from './selected-cases.js';
|
|
23
|
+
export { inspectTriggerAppServerConfigWarning, inspectTriggerAppServerFrame, runCodexTriggerProviderCase, summarizeTriggerCase, } from './codex-trigger-eval.js';
|
|
24
|
+
export { EvalAppServerSession, extractAppServerThreadId, inspectAppServerConfigWarning, normalizeConversationProviderCase, runCodexConversationProviderCase, runCodexEvalIsolationProbe, settleAppServerProcessCleanup, } from './codex-eval-app-server.js';
|
|
25
|
+
export { applyCodexEvalProviderEnvironment, assertCodexEvalCanStartWork, cleanupActiveCodexEvalResources, cleanCodexEvalRuntimeConfig, codexEvalRuntimeEvidence, createCodexEvalTemporaryRoot, DEFAULT_CODEX_EVAL_MODEL, isCodexEvalRuntimeEvidence, materializeCodexEvalRuntimeHome, redactCodexEvalText, redactCodexEvalValue, registerCodexEvalSignalCleanup, registerCodexEvalTemporaryRoot, resetCodexEvalSignalShutdownForTests, resolveCodexEvalRuntimeConfig, } from './codex-eval-runtime-config.js';
|
|
26
|
+
export { applyCodexEvalGitIsolation, assertCodexEvalKeychainWrapperAbsent, codexEvalConfigOverrides, CODEX_EVAL_CREDENTIAL_CONFIG_LINES, CODEX_EVAL_STRICT_OVERRIDES, codexEvalIsolationEvidence, inspectCodexEvalHostIsolation, inspectCodexEvalKeychain, validateCodexEvalConfigIsolation, validateCodexEvalRpcIsolation, } from './codex-eval-isolation.js';
|
|
27
|
+
export { CODEX_EVAL_PROCESS_TREE_ID_ENV, createChildProcessTreeMonitor, createDirectChildProcessMonitor, createPosixProcessTreeMonitor, createWindowsChildProcessTreeMonitor, processTreeCleanupIsUnconfirmed, PROCESS_TREE_CLEANUP_UNCONFIRMED_PREFIX, releaseChildProcessHandles, scrubProcessTreeId, terminateChildProcessTree, terminatePosixProcessTree, terminateWindowsProcessTree, assertProcessTreeInspectionAvailable as assertCodexEvalProcessTreeInspectionAvailable, } from './codex-eval-process-tree.js';
|
|
11
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACtF,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,oCAAoC,EACpC,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,SAAS,EACT,eAAe,GAChB,MAA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7B,iCAAiC,EACjC,gCAAgC,EAChC,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,EAC9B,8BAA8B,EAC9B,oCAAoC,EACpC,6BAA6B,GAC9B,MAAM,gCAAgC,CAAA;AAMvC,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,wBAAwB,EACxB,kCAAkC,EAClC,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,2BAA2B,CAAA;AAQlC,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,+BAA+B,EAC/B,6BAA6B,EAC7B,oCAAoC,EACpC,+BAA+B,EAC/B,uCAAuC,EACvC,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,oCAAoC,IAAI,6CAA6C,GACtF,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type InstructionV2ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
2
|
+
export interface InstructionV2Request {
|
|
3
|
+
protocolVersion: 2;
|
|
4
|
+
run: {
|
|
5
|
+
id: string;
|
|
6
|
+
mode: 'workspace' | 'bundle';
|
|
7
|
+
access: 'read-only' | 'workspace-write';
|
|
8
|
+
model?: string;
|
|
9
|
+
reasoningEffort?: InstructionV2ReasoningEffort;
|
|
10
|
+
configRevision: string;
|
|
11
|
+
requiredIsolation?: boolean;
|
|
12
|
+
workspace?: string;
|
|
13
|
+
};
|
|
14
|
+
instructions: {
|
|
15
|
+
workerKey: string;
|
|
16
|
+
revision: string;
|
|
17
|
+
text: string;
|
|
18
|
+
};
|
|
19
|
+
task: string;
|
|
20
|
+
materials: Array<{
|
|
21
|
+
source: string;
|
|
22
|
+
path: string;
|
|
23
|
+
sha256: string;
|
|
24
|
+
startLine: number;
|
|
25
|
+
endLine: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export interface InstructionV2Transport {
|
|
29
|
+
type: 'instruction-v2';
|
|
30
|
+
command: readonly [string] | readonly [string, string];
|
|
31
|
+
request: InstructionV2Request;
|
|
32
|
+
}
|
|
33
|
+
export interface InstructionV2Receipt {
|
|
34
|
+
protocolVersion: 2;
|
|
35
|
+
outcome: 'completed' | 'failed' | 'cancelled' | 'unknown';
|
|
36
|
+
instructionChannel: 'system' | 'developer' | 'equivalent-config' | 'user-prefix';
|
|
37
|
+
instructionsRevision: string;
|
|
38
|
+
providerSessionId?: string;
|
|
39
|
+
actualModel?: string;
|
|
40
|
+
providerTerminal?: string;
|
|
41
|
+
traceFile?: string;
|
|
42
|
+
adapter?: Record<string, unknown>;
|
|
43
|
+
usage?: unknown;
|
|
44
|
+
generationStarted?: boolean;
|
|
45
|
+
localExitCode?: number | null;
|
|
46
|
+
code?: string;
|
|
47
|
+
scopeViolation?: boolean;
|
|
48
|
+
remoteStopConfirmed?: false;
|
|
49
|
+
}
|
|
50
|
+
export declare function parseInstructionV2ReasoningEffort(value: unknown): InstructionV2ReasoningEffort;
|
|
51
|
+
/** A trusted prepare adapter supplies this envelope; task text cannot select a command or role. */
|
|
52
|
+
export declare function parseInstructionV2Transport(value: unknown, workspace: string): Promise<InstructionV2Transport>;
|
|
53
|
+
export declare function parseInstructionV2Receipt(value: unknown): InstructionV2Receipt;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
function object(value, label) {
|
|
5
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
6
|
+
throw new Error(`${label} must be an object.`);
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
function keys(value, required, optional, label) {
|
|
10
|
+
for (const name of required)
|
|
11
|
+
if (!Object.hasOwn(value, name))
|
|
12
|
+
throw new Error(`${label} is missing ${name}.`);
|
|
13
|
+
const allowed = new Set([...required, ...optional]);
|
|
14
|
+
for (const name of Object.keys(value))
|
|
15
|
+
if (!allowed.has(name))
|
|
16
|
+
throw new Error(`${label} has unknown field ${name}.`);
|
|
17
|
+
}
|
|
18
|
+
function text(value, label, maximum = 200_000) {
|
|
19
|
+
if (typeof value !== 'string' || !value.trim() || value.includes('\0') || Buffer.byteLength(value) > maximum) {
|
|
20
|
+
throw new Error(`${label} must be a bounded non-empty string.`);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
function digest(value, bytes, label) {
|
|
25
|
+
const expected = text(value, label, 71);
|
|
26
|
+
const actual = createHash('sha256').update(bytes).digest('hex');
|
|
27
|
+
if (expected !== actual && expected !== `sha256:${actual}`)
|
|
28
|
+
throw new Error(`${label} does not match actual content.`);
|
|
29
|
+
return expected;
|
|
30
|
+
}
|
|
31
|
+
export function parseInstructionV2ReasoningEffort(value) {
|
|
32
|
+
if (typeof value !== 'string' || !['minimal', 'low', 'medium', 'high', 'xhigh', 'max'].includes(value)) {
|
|
33
|
+
throw new Error('workflow reasoningEffort is not supported.');
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
/** A trusted prepare adapter supplies this envelope; task text cannot select a command or role. */
|
|
38
|
+
export async function parseInstructionV2Transport(value, workspace) {
|
|
39
|
+
const transport = object(value, 'workflow transport');
|
|
40
|
+
keys(transport, ['type', 'command', 'request'], [], 'workflow transport');
|
|
41
|
+
if (transport.type !== 'instruction-v2')
|
|
42
|
+
throw new Error('workflow transport.type must be instruction-v2.');
|
|
43
|
+
if (!Array.isArray(transport.command) || transport.command.length < 1 || transport.command.length > 2) {
|
|
44
|
+
throw new Error('workflow transport.command requires an executable and at most one entrypoint.');
|
|
45
|
+
}
|
|
46
|
+
const command = transport.command.map((part, index) => {
|
|
47
|
+
const result = text(part, `workflow transport.command[${index}]`, 4_096);
|
|
48
|
+
if (!path.isAbsolute(result))
|
|
49
|
+
throw new Error('workflow transport.command entries must be absolute paths.');
|
|
50
|
+
return result;
|
|
51
|
+
});
|
|
52
|
+
const request = object(transport.request, 'instruction-v2 request');
|
|
53
|
+
keys(request, ['protocolVersion', 'run', 'instructions', 'task', 'materials'], [], 'instruction-v2 request');
|
|
54
|
+
if (request.protocolVersion !== 2)
|
|
55
|
+
throw new Error('instruction-v2 protocolVersion must be 2.');
|
|
56
|
+
const run = object(request.run, 'instruction-v2 run');
|
|
57
|
+
keys(run, ['id', 'mode', 'access', 'configRevision'], ['model', 'reasoningEffort', 'requiredIsolation', 'workspace'], 'instruction-v2 run');
|
|
58
|
+
if (run.mode !== 'workspace' && run.mode !== 'bundle')
|
|
59
|
+
throw new Error('instruction-v2 mode is invalid.');
|
|
60
|
+
if (run.access !== 'read-only' && run.access !== 'workspace-write')
|
|
61
|
+
throw new Error('instruction-v2 access is invalid.');
|
|
62
|
+
if (run.mode === 'bundle' && run.access !== 'read-only')
|
|
63
|
+
throw new Error('instruction-v2 bundle requires read-only access.');
|
|
64
|
+
const instructions = object(request.instructions, 'instruction-v2 instructions');
|
|
65
|
+
keys(instructions, ['workerKey', 'revision', 'text'], [], 'instruction-v2 instructions');
|
|
66
|
+
const instructionsText = text(instructions.text, 'instruction-v2 instructions.text');
|
|
67
|
+
if (!Array.isArray(request.materials) || request.materials.length > 128)
|
|
68
|
+
throw new Error('instruction-v2 materials must have at most 128 entries.');
|
|
69
|
+
let materialBytes = 0;
|
|
70
|
+
const materials = await Promise.all(request.materials.map(async (item) => {
|
|
71
|
+
const material = object(item, 'instruction-v2 material');
|
|
72
|
+
keys(material, ['source', 'path', 'sha256', 'startLine', 'endLine'], [], 'instruction-v2 material');
|
|
73
|
+
const target = text(material.path, 'instruction-v2 material.path', 4_096);
|
|
74
|
+
const relative = path.relative(workspace, target);
|
|
75
|
+
if (!path.isAbsolute(target) || !relative || relative.startsWith(`..${path.sep}`) || relative === '..' || path.isAbsolute(relative)) {
|
|
76
|
+
throw new Error('instruction-v2 material.path must be inside the subject workspace.');
|
|
77
|
+
}
|
|
78
|
+
let current = workspace;
|
|
79
|
+
for (const segment of relative.split(path.sep)) {
|
|
80
|
+
current = path.join(current, segment);
|
|
81
|
+
if ((await fs.lstat(current)).isSymbolicLink())
|
|
82
|
+
throw new Error('instruction-v2 material.path must not contain symbolic links.');
|
|
83
|
+
}
|
|
84
|
+
const info = await fs.lstat(current);
|
|
85
|
+
if (!info.isFile() || info.size > 2 * 1024 * 1024)
|
|
86
|
+
throw new Error('instruction-v2 material must be a bounded regular file.');
|
|
87
|
+
const bytes = await fs.readFile(current);
|
|
88
|
+
materialBytes += bytes.length;
|
|
89
|
+
if (materialBytes > 8 * 1024 * 1024)
|
|
90
|
+
throw new Error('instruction-v2 material byte limit exceeded.');
|
|
91
|
+
if (!Number.isSafeInteger(material.startLine) || !Number.isSafeInteger(material.endLine)
|
|
92
|
+
|| material.startLine < 1 || material.endLine < material.startLine) {
|
|
93
|
+
throw new Error('instruction-v2 material line range is invalid.');
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
source: text(material.source, 'instruction-v2 material.source', 4_096), path: target,
|
|
97
|
+
sha256: digest(material.sha256, bytes, 'instruction-v2 material.sha256'),
|
|
98
|
+
startLine: material.startLine, endLine: material.endLine,
|
|
99
|
+
};
|
|
100
|
+
}));
|
|
101
|
+
if (run.workspace !== undefined && run.workspace !== workspace)
|
|
102
|
+
throw new Error('instruction-v2 workspace must equal the subject workspace.');
|
|
103
|
+
if (run.requiredIsolation !== undefined && typeof run.requiredIsolation !== 'boolean')
|
|
104
|
+
throw new Error('instruction-v2 requiredIsolation must be boolean.');
|
|
105
|
+
return {
|
|
106
|
+
type: 'instruction-v2', command,
|
|
107
|
+
request: {
|
|
108
|
+
protocolVersion: 2,
|
|
109
|
+
run: {
|
|
110
|
+
id: text(run.id, 'instruction-v2 run.id', 256), mode: run.mode, access: run.access,
|
|
111
|
+
configRevision: text(run.configRevision, 'instruction-v2 run.configRevision', 256),
|
|
112
|
+
...(run.model === undefined ? {} : { model: text(run.model, 'instruction-v2 run.model', 256) }),
|
|
113
|
+
...(run.reasoningEffort === undefined ? {} : { reasoningEffort: parseInstructionV2ReasoningEffort(run.reasoningEffort) }),
|
|
114
|
+
...(run.requiredIsolation === undefined ? {} : { requiredIsolation: run.requiredIsolation }),
|
|
115
|
+
...(run.workspace === undefined ? {} : { workspace }),
|
|
116
|
+
},
|
|
117
|
+
instructions: {
|
|
118
|
+
workerKey: text(instructions.workerKey, 'instruction-v2 instructions.workerKey', 256),
|
|
119
|
+
revision: digest(instructions.revision, instructionsText, 'instruction-v2 instructions.revision'), text: instructionsText,
|
|
120
|
+
},
|
|
121
|
+
task: text(request.task, 'instruction-v2 task'), materials,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export function parseInstructionV2Receipt(value) {
|
|
126
|
+
const receipt = object(value, 'instruction-v2 receipt');
|
|
127
|
+
keys(receipt, ['protocolVersion', 'outcome', 'instructionChannel', 'instructionsRevision'], ['providerSessionId', 'actualModel', 'providerTerminal', 'traceFile', 'adapter', 'usage', 'generationStarted', 'localExitCode', 'code', 'scopeViolation', 'remoteStopConfirmed'], 'instruction-v2 receipt');
|
|
128
|
+
if (receipt.protocolVersion !== 2 || typeof receipt.outcome !== 'string'
|
|
129
|
+
|| !['completed', 'failed', 'cancelled', 'unknown'].includes(receipt.outcome)
|
|
130
|
+
|| typeof receipt.instructionChannel !== 'string'
|
|
131
|
+
|| !['system', 'developer', 'equivalent-config', 'user-prefix'].includes(receipt.instructionChannel)) {
|
|
132
|
+
throw new Error('instruction-v2 receipt has invalid protocol, outcome, or instruction channel.');
|
|
133
|
+
}
|
|
134
|
+
const result = {
|
|
135
|
+
protocolVersion: 2, outcome: receipt.outcome,
|
|
136
|
+
instructionChannel: receipt.instructionChannel,
|
|
137
|
+
instructionsRevision: text(receipt.instructionsRevision, 'instruction-v2 receipt.instructionsRevision', 256),
|
|
138
|
+
};
|
|
139
|
+
for (const key of ['providerSessionId', 'actualModel', 'providerTerminal', 'traceFile']) {
|
|
140
|
+
if (receipt[key] !== undefined)
|
|
141
|
+
result[key] = text(receipt[key], `instruction-v2 receipt.${key}`, 4_096);
|
|
142
|
+
}
|
|
143
|
+
if (receipt.adapter !== undefined)
|
|
144
|
+
result.adapter = object(receipt.adapter, 'instruction-v2 receipt.adapter');
|
|
145
|
+
if (receipt.usage !== undefined)
|
|
146
|
+
result.usage = receipt.usage;
|
|
147
|
+
for (const key of ['generationStarted', 'scopeViolation']) {
|
|
148
|
+
if (receipt[key] !== undefined) {
|
|
149
|
+
if (typeof receipt[key] !== 'boolean')
|
|
150
|
+
throw new Error(`instruction-v2 receipt.${key} must be boolean.`);
|
|
151
|
+
result[key] = receipt[key];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (receipt.localExitCode !== undefined) {
|
|
155
|
+
if (receipt.localExitCode !== null && (!Number.isSafeInteger(receipt.localExitCode) || receipt.localExitCode < 0)) {
|
|
156
|
+
throw new Error('instruction-v2 receipt.localExitCode must be a nonnegative integer or null.');
|
|
157
|
+
}
|
|
158
|
+
result.localExitCode = receipt.localExitCode;
|
|
159
|
+
}
|
|
160
|
+
if (receipt.code !== undefined)
|
|
161
|
+
result.code = text(receipt.code, 'instruction-v2 receipt.code', 256);
|
|
162
|
+
if (receipt.remoteStopConfirmed !== undefined) {
|
|
163
|
+
if (receipt.remoteStopConfirmed !== false)
|
|
164
|
+
throw new Error('instruction-v2 receipt must not claim unqualified remote cancellation.');
|
|
165
|
+
result.remoteStopConfirmed = false;
|
|
166
|
+
}
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
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