@lesliechan721/agent-skill-eval 0.1.0-beta.6 → 0.1.0-beta.60
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
package/dist/json-schema.js
CHANGED
|
@@ -7,9 +7,77 @@ function matchesType(value, type) {
|
|
|
7
7
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
8
8
|
if (type === 'integer')
|
|
9
9
|
return Number.isInteger(value);
|
|
10
|
+
if (type === 'number')
|
|
11
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
10
12
|
return typeof value === type;
|
|
11
13
|
}
|
|
12
|
-
function
|
|
14
|
+
function isRfc3339DateTime(value) {
|
|
15
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:[Zz]|([+-])(\d{2}):(\d{2}))$/u.exec(value);
|
|
16
|
+
if (!match)
|
|
17
|
+
return false;
|
|
18
|
+
const [, yearText, monthText, dayText, hourText, minuteText, secondText, , offsetHourText, offsetMinuteText] = match;
|
|
19
|
+
const year = Number(yearText);
|
|
20
|
+
const month = Number(monthText);
|
|
21
|
+
const day = Number(dayText);
|
|
22
|
+
const hour = Number(hourText);
|
|
23
|
+
const minute = Number(minuteText);
|
|
24
|
+
const second = Number(secondText);
|
|
25
|
+
const offsetHour = offsetHourText === undefined ? 0 : Number(offsetHourText);
|
|
26
|
+
const offsetMinute = offsetMinuteText === undefined ? 0 : Number(offsetMinuteText);
|
|
27
|
+
if (month < 1 || month > 12 || hour > 23 || minute > 59 || second > 60)
|
|
28
|
+
return false;
|
|
29
|
+
if (offsetHour > 23 || offsetMinute > 59)
|
|
30
|
+
return false;
|
|
31
|
+
const leapYear = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
32
|
+
const daysInMonth = [31, leapYear ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
33
|
+
return day >= 1 && day <= daysInMonth[month - 1];
|
|
34
|
+
}
|
|
35
|
+
function resolveLocalReference(root, reference) {
|
|
36
|
+
if (!reference.startsWith('#/'))
|
|
37
|
+
return null;
|
|
38
|
+
let current = root;
|
|
39
|
+
for (const rawSegment of reference.slice(2).split('/')) {
|
|
40
|
+
const segment = rawSegment.replace(/~1/gu, '/').replace(/~0/gu, '~');
|
|
41
|
+
if (!current || typeof current !== 'object' || Array.isArray(current))
|
|
42
|
+
return null;
|
|
43
|
+
current = current[segment];
|
|
44
|
+
}
|
|
45
|
+
return current && typeof current === 'object' && !Array.isArray(current)
|
|
46
|
+
? current
|
|
47
|
+
: null;
|
|
48
|
+
}
|
|
49
|
+
function validateNode(schema, value, pointer, errors, root) {
|
|
50
|
+
if (typeof schema.$ref === 'string') {
|
|
51
|
+
const referenced = resolveLocalReference(root, schema.$ref);
|
|
52
|
+
if (!referenced)
|
|
53
|
+
errors.push(`${pointer}: unsupported schema reference ${schema.$ref}`);
|
|
54
|
+
else
|
|
55
|
+
validateNode(referenced, value, pointer, errors, root);
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(schema.oneOf)) {
|
|
58
|
+
const matches = schema.oneOf.filter((entry) => {
|
|
59
|
+
if (!entry || typeof entry !== 'object')
|
|
60
|
+
return false;
|
|
61
|
+
const branchErrors = [];
|
|
62
|
+
validateNode(entry, value, pointer, branchErrors, root);
|
|
63
|
+
return branchErrors.length === 0;
|
|
64
|
+
}).length;
|
|
65
|
+
if (matches !== 1)
|
|
66
|
+
errors.push(`${pointer}: must match exactly one allowed shape`);
|
|
67
|
+
}
|
|
68
|
+
if (Array.isArray(schema.allOf)) {
|
|
69
|
+
for (const entry of schema.allOf) {
|
|
70
|
+
if (entry && typeof entry === 'object')
|
|
71
|
+
validateNode(entry, value, pointer, errors, root);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (schema.if && typeof schema.if === 'object') {
|
|
75
|
+
const conditionalErrors = [];
|
|
76
|
+
validateNode(schema.if, value, pointer, conditionalErrors, root);
|
|
77
|
+
const branch = conditionalErrors.length === 0 ? schema.then : schema.else;
|
|
78
|
+
if (branch && typeof branch === 'object')
|
|
79
|
+
validateNode(branch, value, pointer, errors, root);
|
|
80
|
+
}
|
|
13
81
|
if (schema.const !== undefined && !Object.is(value, schema.const))
|
|
14
82
|
errors.push(`${pointer}: must equal ${JSON.stringify(schema.const)}`);
|
|
15
83
|
if (Array.isArray(schema.enum) && !schema.enum.some((entry) => Object.is(entry, value)))
|
|
@@ -24,10 +92,14 @@ function validateNode(schema, value, pointer, errors) {
|
|
|
24
92
|
return;
|
|
25
93
|
}
|
|
26
94
|
if (typeof value === 'string') {
|
|
95
|
+
if (typeof schema.maxLength === 'number' && value.length > schema.maxLength)
|
|
96
|
+
errors.push(`${pointer}: must have length <= ${schema.maxLength}`);
|
|
27
97
|
if (typeof schema.minLength === 'number' && value.length < schema.minLength)
|
|
28
98
|
errors.push(`${pointer}: must have length >= ${schema.minLength}`);
|
|
29
99
|
if (typeof schema.pattern === 'string' && !new RegExp(schema.pattern, 'u').test(value))
|
|
30
100
|
errors.push(`${pointer}: must match ${schema.pattern}`);
|
|
101
|
+
if (schema.format === 'date-time' && !isRfc3339DateTime(value))
|
|
102
|
+
errors.push(`${pointer}: must be an RFC 3339 date-time`);
|
|
31
103
|
}
|
|
32
104
|
if (typeof value === 'number') {
|
|
33
105
|
if (typeof schema.minimum === 'number' && value < schema.minimum)
|
|
@@ -39,12 +111,19 @@ function validateNode(schema, value, pointer, errors) {
|
|
|
39
111
|
errors.push(`${pointer}: must be a multiple of ${schema.multipleOf}`);
|
|
40
112
|
}
|
|
41
113
|
if (Array.isArray(value)) {
|
|
114
|
+
if (typeof schema.maxItems === 'number' && value.length > schema.maxItems)
|
|
115
|
+
errors.push(`${pointer}: must contain at most ${schema.maxItems} items`);
|
|
42
116
|
if (typeof schema.minItems === 'number' && value.length < schema.minItems)
|
|
43
117
|
errors.push(`${pointer}: must contain at least ${schema.minItems} items`);
|
|
44
118
|
if (schema.uniqueItems === true && new Set(value.map((entry) => JSON.stringify(entry))).size !== value.length)
|
|
45
119
|
errors.push(`${pointer}: must contain unique items`);
|
|
46
120
|
if (schema.items && typeof schema.items === 'object')
|
|
47
|
-
value.forEach((entry, index) => validateNode(schema.items, entry, `${pointer}/${index}`, errors));
|
|
121
|
+
value.forEach((entry, index) => validateNode(schema.items, entry, `${pointer}/${index}`, errors, root));
|
|
122
|
+
if (Array.isArray(schema.prefixItems))
|
|
123
|
+
schema.prefixItems.forEach((entry, index) => {
|
|
124
|
+
if (index < value.length && entry && typeof entry === 'object')
|
|
125
|
+
validateNode(entry, value[index], `${pointer}/${index}`, errors, root);
|
|
126
|
+
});
|
|
48
127
|
}
|
|
49
128
|
if (matchesType(value, 'object')) {
|
|
50
129
|
const object = value;
|
|
@@ -54,17 +133,17 @@ function validateNode(schema, value, pointer, errors) {
|
|
|
54
133
|
const properties = schema.properties;
|
|
55
134
|
for (const [key, entry] of Object.entries(object)) {
|
|
56
135
|
if (properties?.[key])
|
|
57
|
-
validateNode(properties[key], entry, `${pointer}/${key}`, errors);
|
|
136
|
+
validateNode(properties[key], entry, `${pointer}/${key}`, errors, root);
|
|
58
137
|
else if (schema.additionalProperties === false)
|
|
59
138
|
errors.push(`${pointer}: unknown property ${key}`);
|
|
60
139
|
else if (schema.additionalProperties && typeof schema.additionalProperties === 'object')
|
|
61
|
-
validateNode(schema.additionalProperties, entry, `${pointer}/${key}`, errors);
|
|
140
|
+
validateNode(schema.additionalProperties, entry, `${pointer}/${key}`, errors, root);
|
|
62
141
|
}
|
|
63
142
|
}
|
|
64
143
|
}
|
|
65
144
|
export function validateJsonSchema(schema, value) {
|
|
66
145
|
const errors = [];
|
|
67
|
-
validateNode(schema, value, '$', errors);
|
|
146
|
+
validateNode(schema, value, '$', errors, schema);
|
|
68
147
|
return errors;
|
|
69
148
|
}
|
|
70
149
|
//# sourceMappingURL=json-schema.js.map
|
package/dist/json-schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"AAEA,SAAS,WAAW,CAAC,KAAc,EAAE,IAAY;IAC/C,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,KAAK,KAAK,IAAI,CAAA;IAC1C,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACjD,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAClG,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACtD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UAAU,kBAAkB,CAAC,MAAkB,EAAE,KAAc;IACnE,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAChD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/output-path.js
CHANGED
|
@@ -8,7 +8,7 @@ export async function assertSafeOutputPath(base, target) {
|
|
|
8
8
|
const canonicalBase = await realpath(base);
|
|
9
9
|
const resolvedTarget = path.resolve(canonicalBase, target);
|
|
10
10
|
if (!isPathInside(canonicalBase, resolvedTarget) || resolvedTarget === canonicalBase)
|
|
11
|
-
throw new Error('output path must be a non-root child inside the
|
|
11
|
+
throw new Error('output path must be a non-root child inside the spec directory');
|
|
12
12
|
const relative = path.relative(canonicalBase, resolvedTarget);
|
|
13
13
|
let candidate = canonicalBase;
|
|
14
14
|
for (const segment of relative.split(path.sep)) {
|
|
@@ -28,7 +28,7 @@ export async function assertSafeOutputPath(base, target) {
|
|
|
28
28
|
throw new Error(`output path component must be a directory: ${candidate}`);
|
|
29
29
|
const actual = await realpath(candidate);
|
|
30
30
|
if (!isPathInside(canonicalBase, actual))
|
|
31
|
-
throw new Error('output path leaves the
|
|
31
|
+
throw new Error('output path leaves the spec directory');
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=output-path.js.map
|
package/dist/process-tree.d.ts
CHANGED
|
@@ -1,25 +1,80 @@
|
|
|
1
|
+
import { type WindowsNativeProcessRow } from './windows-native.js';
|
|
1
2
|
type KillSignal = 'SIGTERM' | 'SIGKILL';
|
|
2
3
|
type PosixSignal = KillSignal | 'SIGSTOP';
|
|
4
|
+
interface ProcessIdentity {
|
|
5
|
+
pid: number;
|
|
6
|
+
startTime: string;
|
|
7
|
+
creationTime?: bigint;
|
|
8
|
+
}
|
|
9
|
+
interface ProcessCommandFailure {
|
|
10
|
+
reason: 'callback-error' | 'deadline-exceeded' | 'synchronous-error';
|
|
11
|
+
code?: string | number;
|
|
12
|
+
signal?: string;
|
|
13
|
+
killed?: boolean;
|
|
14
|
+
}
|
|
3
15
|
export interface ProcessTreeDependencies {
|
|
4
16
|
platform?: NodeJS.Platform;
|
|
5
17
|
markerEnvironmentVariable?: string;
|
|
18
|
+
/** Continuously verify markers without requiring all descendants to share a process group. */
|
|
19
|
+
enforceProcessMarker?: boolean;
|
|
20
|
+
/** Enforce the custom provider contract, including continuous marker verification. */
|
|
21
|
+
enforceCooperativeProcessGroup?: boolean;
|
|
6
22
|
kill?: (pid: number, signal: PosixSignal) => void;
|
|
7
23
|
execFile?: (command: string, args: string[], options: {
|
|
8
24
|
timeout: number;
|
|
9
25
|
windowsHide: boolean;
|
|
10
26
|
maxBuffer: number;
|
|
11
27
|
}, callback: (error: Error | null, stdout: string) => void) => unknown;
|
|
28
|
+
windowsJobHelperPath?: string;
|
|
29
|
+
windowsProcessTable?: (requiredPids: readonly number[]) => Promise<WindowsNativeProcessRow[]>;
|
|
30
|
+
createSentinel?: (markerEnvironmentVariable: string, marker: string) => Promise<ProcessTreeSentinel>;
|
|
31
|
+
}
|
|
32
|
+
export interface ProcessTreeSentinel {
|
|
33
|
+
pid: number;
|
|
34
|
+
stop(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export interface ProcessTreeInspectionLease {
|
|
37
|
+
readonly marker: string;
|
|
38
|
+
readonly sentinel: ProcessIdentity;
|
|
39
|
+
release(): Promise<void>;
|
|
12
40
|
}
|
|
13
41
|
export interface ProcessTreeObservation {
|
|
14
42
|
readonly pid: number;
|
|
43
|
+
readonly diagnostics: ProcessTreeDiagnostic[];
|
|
44
|
+
onFailure(listener: (error: Error) => void): () => void;
|
|
15
45
|
dispose(): void;
|
|
16
46
|
}
|
|
47
|
+
/** Bounded process metadata only: never retain commands, environments, or marker values. */
|
|
48
|
+
export interface ProcessTreeDiagnostic {
|
|
49
|
+
capturedAt: string;
|
|
50
|
+
stage: string;
|
|
51
|
+
reason: string;
|
|
52
|
+
rootPid: number;
|
|
53
|
+
rootPgid?: number;
|
|
54
|
+
rootPgidMode?: 'owned' | 'shared' | 'missing';
|
|
55
|
+
affectedPids: number[];
|
|
56
|
+
markerLookupSucceeded: boolean | null;
|
|
57
|
+
lookupFailure?: ProcessCommandFailure;
|
|
58
|
+
processes: Array<{
|
|
59
|
+
pid: number;
|
|
60
|
+
present: boolean | null;
|
|
61
|
+
knownStartTime?: string;
|
|
62
|
+
ppid?: number;
|
|
63
|
+
pgid?: number;
|
|
64
|
+
startTime?: string;
|
|
65
|
+
state?: string;
|
|
66
|
+
markerMatches: boolean | null;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
17
69
|
export interface ProcessTreeTerminationOptions {
|
|
18
70
|
observation?: ProcessTreeObservation;
|
|
19
71
|
requireConfirmedCleanup?: boolean;
|
|
72
|
+
allowUnobservedWindowsProcessOnNormalCompletion?: boolean;
|
|
20
73
|
allowInspectionUnavailable?: boolean;
|
|
74
|
+
requireDescendantsExitedBeforeCompletion?: boolean;
|
|
21
75
|
}
|
|
22
|
-
export declare function
|
|
76
|
+
export declare function acquireProcessTreeInspectionLease(dependencies?: ProcessTreeDependencies): Promise<ProcessTreeInspectionLease>;
|
|
77
|
+
export declare function observeProcessTree(pid: number, marker: string | undefined, dependencies?: ProcessTreeDependencies, lease?: ProcessTreeInspectionLease): ProcessTreeObservation;
|
|
23
78
|
export declare function assertProcessTreeInspectionAvailable(dependencies?: ProcessTreeDependencies): Promise<void>;
|
|
24
79
|
export declare function terminateProcessTree(pid: number, killDirectChild: (signal: KillSignal) => void, dependencies?: ProcessTreeDependencies, options?: ProcessTreeTerminationOptions): Promise<void>;
|
|
25
80
|
export {};
|