ferrycat 0.0.0-stage → 0.3.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.
- package/LICENSE +21 -0
- package/README.md +209 -2
- package/README_zh.md +212 -0
- package/bin/ferrycat-cli.js +36 -0
- package/bin/ferrycat.js +36 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1015 -0
- package/dist/cli.js.map +1 -0
- package/dist/engine.d.ts +107 -0
- package/dist/engine.js +849 -0
- package/dist/engine.js.map +1 -0
- package/dist/fingerprint.d.ts +31 -0
- package/dist/fingerprint.js +205 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +305 -0
- package/dist/index.js.map +1 -0
- package/dist/schema-validator.d.ts +5 -0
- package/dist/schema-validator.js +49 -0
- package/dist/schema-validator.js.map +1 -0
- package/dist/schemas.d.ts +274 -0
- package/dist/schemas.js +338 -0
- package/dist/schemas.js.map +1 -0
- package/dist/types.d.ts +203 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/glama.json +6 -0
- package/package.json +58 -4
- package/server.json +21 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import AjvModule from 'ajv';
|
|
2
|
+
// Handle ESM/CJS interop for Ajv across Node Next module resolution
|
|
3
|
+
const AjvCtor = (AjvModule.default ?? AjvModule);
|
|
4
|
+
const ajv = new AjvCtor({ allErrors: true, strict: false });
|
|
5
|
+
const compiledSchemaCache = new Map();
|
|
6
|
+
export function validateContractOutput(schema, data) {
|
|
7
|
+
if (data === undefined || data === null || typeof data !== 'object' || Array.isArray(data)) {
|
|
8
|
+
return {
|
|
9
|
+
valid: false,
|
|
10
|
+
errors: [
|
|
11
|
+
'/: structured_output is required and must be a non-array JSON object when contract_schema is specified',
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const cacheKey = JSON.stringify(schema);
|
|
17
|
+
let validate = compiledSchemaCache.get(cacheKey);
|
|
18
|
+
if (!validate) {
|
|
19
|
+
validate = ajv.compile(schema);
|
|
20
|
+
compiledSchemaCache.set(cacheKey, validate);
|
|
21
|
+
}
|
|
22
|
+
const valid = validate(data);
|
|
23
|
+
if (valid) {
|
|
24
|
+
return { valid: true, errors: [] };
|
|
25
|
+
}
|
|
26
|
+
const flattened = (validate.errors ?? [])
|
|
27
|
+
.slice(0, 10)
|
|
28
|
+
.map((err) => {
|
|
29
|
+
const pathStr = err.instancePath || '/';
|
|
30
|
+
const msg = err.message || 'validation failed';
|
|
31
|
+
if (err.keyword === 'required' && err.params && 'missingProperty' in err.params) {
|
|
32
|
+
return `${pathStr}: must have required property '${String(err.params.missingProperty)}'`;
|
|
33
|
+
}
|
|
34
|
+
return `${pathStr}: ${msg}`;
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
valid: false,
|
|
38
|
+
errors: flattened.length > 0 ? flattened : ['/: schema validation failed'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
43
|
+
return {
|
|
44
|
+
valid: false,
|
|
45
|
+
errors: [`/: invalid contract_schema definition (${message})`],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=schema-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-validator.js","sourceRoot":"","sources":["../src/schema-validator.ts"],"names":[],"mappings":"AAAA,OAAO,SAA+B,MAAM,KAAK,CAAC;AAWlD,oEAAoE;AACpE,MAAM,OAAO,GAAG,CACb,SAA8C,CAAC,OAAO,IAAI,SAAS,CACI,CAAC;AAE3E,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5D,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAsB,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C,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC;YAC3F,CAAC;YACD,OAAO,GAAG,OAAO,KAAK,GAAG,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEL,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,6BAA6B,CAAC;SAC3E,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC,0CAA0C,OAAO,GAAG,CAAC;SAC/D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MAX_JSON_PAYLOAD_BYTES: number;
|
|
3
|
+
export declare const MAX_JSON_DEPTH = 32;
|
|
4
|
+
export declare function measureJsonDepth(val: unknown, currentDepth?: number): number;
|
|
5
|
+
export declare function validateJsonPayload(val: unknown): {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const DispatchContractShape: {
|
|
10
|
+
requester_agent: z.ZodOptional<z.ZodString>;
|
|
11
|
+
target_agent: z.ZodString;
|
|
12
|
+
task_type: z.ZodEnum<["code_review", "architecture_audit", "implementation", "test_generation"]>;
|
|
13
|
+
title: z.ZodString;
|
|
14
|
+
context_summary: z.ZodString;
|
|
15
|
+
workspace_root: z.ZodString;
|
|
16
|
+
pointers: z.ZodArray<z.ZodObject<{
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
line_range: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
path: string;
|
|
21
|
+
line_range?: [number, number] | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
path: string;
|
|
24
|
+
line_range?: [number, number] | undefined;
|
|
25
|
+
}>, "many">;
|
|
26
|
+
contract_schema: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
27
|
+
queue_ttl_sec: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
exec_ttl_sec: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
};
|
|
30
|
+
export declare const PollNextTaskShape: {
|
|
31
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
32
|
+
};
|
|
33
|
+
export declare const FulfillContractShape: {
|
|
34
|
+
contract_id: z.ZodString;
|
|
35
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
36
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
37
|
+
result_summary: z.ZodString;
|
|
38
|
+
structured_output: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
39
|
+
artifacts_pointers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
path: z.ZodString;
|
|
41
|
+
description: z.ZodString;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
path: string;
|
|
44
|
+
description: string;
|
|
45
|
+
}, {
|
|
46
|
+
path: string;
|
|
47
|
+
description: string;
|
|
48
|
+
}>, "many">>;
|
|
49
|
+
};
|
|
50
|
+
export declare const VerifyContractShape: {
|
|
51
|
+
contract_id: z.ZodString;
|
|
52
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
53
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
54
|
+
};
|
|
55
|
+
export declare const ReleaseContractShape: {
|
|
56
|
+
contract_id: z.ZodString;
|
|
57
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
59
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
60
|
+
};
|
|
61
|
+
export declare const ExtendTtlShape: {
|
|
62
|
+
contract_id: z.ZodString;
|
|
63
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
64
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
65
|
+
};
|
|
66
|
+
export declare const FailContractShape: {
|
|
67
|
+
contract_id: z.ZodString;
|
|
68
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
69
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
70
|
+
reason: z.ZodString;
|
|
71
|
+
};
|
|
72
|
+
export declare const InspectMeshStateShape: {
|
|
73
|
+
contract_id: z.ZodOptional<z.ZodString>;
|
|
74
|
+
target_agent: z.ZodOptional<z.ZodString>;
|
|
75
|
+
status: z.ZodOptional<z.ZodEnum<["SUBMITTED", "CLAIMED", "COMPLETED", "POINTER_STALE", "VALIDATION_FAILED", "TIMED_OUT", "FAILED", "ACTIVE", "ALL"]>>;
|
|
76
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
};
|
|
78
|
+
export declare const DispatchContractSchema: z.ZodObject<{
|
|
79
|
+
requester_agent: z.ZodOptional<z.ZodString>;
|
|
80
|
+
target_agent: z.ZodString;
|
|
81
|
+
task_type: z.ZodEnum<["code_review", "architecture_audit", "implementation", "test_generation"]>;
|
|
82
|
+
title: z.ZodString;
|
|
83
|
+
context_summary: z.ZodString;
|
|
84
|
+
workspace_root: z.ZodString;
|
|
85
|
+
pointers: z.ZodArray<z.ZodObject<{
|
|
86
|
+
path: z.ZodString;
|
|
87
|
+
line_range: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
path: string;
|
|
90
|
+
line_range?: [number, number] | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
path: string;
|
|
93
|
+
line_range?: [number, number] | undefined;
|
|
94
|
+
}>, "many">;
|
|
95
|
+
contract_schema: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
96
|
+
queue_ttl_sec: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
exec_ttl_sec: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
target_agent: string;
|
|
100
|
+
task_type: "code_review" | "architecture_audit" | "implementation" | "test_generation";
|
|
101
|
+
title: string;
|
|
102
|
+
context_summary: string;
|
|
103
|
+
workspace_root: string;
|
|
104
|
+
pointers: {
|
|
105
|
+
path: string;
|
|
106
|
+
line_range?: [number, number] | undefined;
|
|
107
|
+
}[];
|
|
108
|
+
requester_agent?: string | undefined;
|
|
109
|
+
contract_schema?: Record<string, unknown> | undefined;
|
|
110
|
+
queue_ttl_sec?: number | undefined;
|
|
111
|
+
exec_ttl_sec?: number | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
target_agent: string;
|
|
114
|
+
task_type: "code_review" | "architecture_audit" | "implementation" | "test_generation";
|
|
115
|
+
title: string;
|
|
116
|
+
context_summary: string;
|
|
117
|
+
workspace_root: string;
|
|
118
|
+
pointers: {
|
|
119
|
+
path: string;
|
|
120
|
+
line_range?: [number, number] | undefined;
|
|
121
|
+
}[];
|
|
122
|
+
requester_agent?: string | undefined;
|
|
123
|
+
contract_schema?: Record<string, unknown> | undefined;
|
|
124
|
+
queue_ttl_sec?: number | undefined;
|
|
125
|
+
exec_ttl_sec?: number | undefined;
|
|
126
|
+
}>;
|
|
127
|
+
export declare const PollNextTaskSchema: z.ZodObject<{
|
|
128
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
agent_id?: string | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
agent_id?: string | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
export declare const FulfillContractSchema: z.ZodObject<{
|
|
135
|
+
contract_id: z.ZodString;
|
|
136
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
137
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
138
|
+
result_summary: z.ZodString;
|
|
139
|
+
structured_output: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
140
|
+
artifacts_pointers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
141
|
+
path: z.ZodString;
|
|
142
|
+
description: z.ZodString;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
path: string;
|
|
145
|
+
description: string;
|
|
146
|
+
}, {
|
|
147
|
+
path: string;
|
|
148
|
+
description: string;
|
|
149
|
+
}>, "many">>;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
contract_id: string;
|
|
152
|
+
result_summary: string;
|
|
153
|
+
agent_id?: string | undefined;
|
|
154
|
+
claim_token?: string | undefined;
|
|
155
|
+
structured_output?: Record<string, unknown> | undefined;
|
|
156
|
+
artifacts_pointers?: {
|
|
157
|
+
path: string;
|
|
158
|
+
description: string;
|
|
159
|
+
}[] | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
contract_id: string;
|
|
162
|
+
result_summary: string;
|
|
163
|
+
agent_id?: string | undefined;
|
|
164
|
+
claim_token?: string | undefined;
|
|
165
|
+
structured_output?: Record<string, unknown> | undefined;
|
|
166
|
+
artifacts_pointers?: {
|
|
167
|
+
path: string;
|
|
168
|
+
description: string;
|
|
169
|
+
}[] | undefined;
|
|
170
|
+
}>;
|
|
171
|
+
export declare const VerifyContractSchema: z.ZodObject<{
|
|
172
|
+
contract_id: z.ZodString;
|
|
173
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
174
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
contract_id: string;
|
|
177
|
+
agent_id?: string | undefined;
|
|
178
|
+
claim_token?: string | undefined;
|
|
179
|
+
}, {
|
|
180
|
+
contract_id: string;
|
|
181
|
+
agent_id?: string | undefined;
|
|
182
|
+
claim_token?: string | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
export declare const ReleaseContractSchema: z.ZodObject<{
|
|
185
|
+
contract_id: z.ZodString;
|
|
186
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
187
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
188
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
contract_id: string;
|
|
191
|
+
agent_id?: string | undefined;
|
|
192
|
+
claim_token?: string | undefined;
|
|
193
|
+
reason?: string | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
contract_id: string;
|
|
196
|
+
agent_id?: string | undefined;
|
|
197
|
+
claim_token?: string | undefined;
|
|
198
|
+
reason?: string | undefined;
|
|
199
|
+
}>;
|
|
200
|
+
export declare const ExtendTtlSchema: z.ZodObject<{
|
|
201
|
+
contract_id: z.ZodString;
|
|
202
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
203
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
contract_id: string;
|
|
206
|
+
agent_id?: string | undefined;
|
|
207
|
+
claim_token?: string | undefined;
|
|
208
|
+
}, {
|
|
209
|
+
contract_id: string;
|
|
210
|
+
agent_id?: string | undefined;
|
|
211
|
+
claim_token?: string | undefined;
|
|
212
|
+
}>;
|
|
213
|
+
export declare const FailContractSchema: z.ZodObject<{
|
|
214
|
+
contract_id: z.ZodString;
|
|
215
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
216
|
+
claim_token: z.ZodOptional<z.ZodString>;
|
|
217
|
+
reason: z.ZodString;
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
contract_id: string;
|
|
220
|
+
reason: string;
|
|
221
|
+
agent_id?: string | undefined;
|
|
222
|
+
claim_token?: string | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
contract_id: string;
|
|
225
|
+
reason: string;
|
|
226
|
+
agent_id?: string | undefined;
|
|
227
|
+
claim_token?: string | undefined;
|
|
228
|
+
}>;
|
|
229
|
+
export declare const InspectMeshStateSchema: z.ZodObject<{
|
|
230
|
+
contract_id: z.ZodOptional<z.ZodString>;
|
|
231
|
+
target_agent: z.ZodOptional<z.ZodString>;
|
|
232
|
+
status: z.ZodOptional<z.ZodEnum<["SUBMITTED", "CLAIMED", "COMPLETED", "POINTER_STALE", "VALIDATION_FAILED", "TIMED_OUT", "FAILED", "ACTIVE", "ALL"]>>;
|
|
233
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
status?: "SUBMITTED" | "CLAIMED" | "COMPLETED" | "POINTER_STALE" | "VALIDATION_FAILED" | "TIMED_OUT" | "FAILED" | "ACTIVE" | "ALL" | undefined;
|
|
236
|
+
target_agent?: string | undefined;
|
|
237
|
+
contract_id?: string | undefined;
|
|
238
|
+
limit?: number | undefined;
|
|
239
|
+
}, {
|
|
240
|
+
status?: "SUBMITTED" | "CLAIMED" | "COMPLETED" | "POINTER_STALE" | "VALIDATION_FAILED" | "TIMED_OUT" | "FAILED" | "ACTIVE" | "ALL" | undefined;
|
|
241
|
+
target_agent?: string | undefined;
|
|
242
|
+
contract_id?: string | undefined;
|
|
243
|
+
limit?: number | undefined;
|
|
244
|
+
}>;
|
|
245
|
+
export declare const WorkerCommandShape: {
|
|
246
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
247
|
+
mode: z.ZodOptional<z.ZodEnum<["watch", "claim", "exec"]>>;
|
|
248
|
+
once: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
interval_ms: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
exec: z.ZodOptional<z.ZodString>;
|
|
251
|
+
exec_file: z.ZodOptional<z.ZodString>;
|
|
252
|
+
};
|
|
253
|
+
export declare const WorkerCommandSchema: z.ZodObject<{
|
|
254
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
255
|
+
mode: z.ZodOptional<z.ZodEnum<["watch", "claim", "exec"]>>;
|
|
256
|
+
once: z.ZodOptional<z.ZodBoolean>;
|
|
257
|
+
interval_ms: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
exec: z.ZodOptional<z.ZodString>;
|
|
259
|
+
exec_file: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, "strict", z.ZodTypeAny, {
|
|
261
|
+
agent_id?: string | undefined;
|
|
262
|
+
exec?: string | undefined;
|
|
263
|
+
mode?: "watch" | "claim" | "exec" | undefined;
|
|
264
|
+
once?: boolean | undefined;
|
|
265
|
+
interval_ms?: number | undefined;
|
|
266
|
+
exec_file?: string | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
agent_id?: string | undefined;
|
|
269
|
+
exec?: string | undefined;
|
|
270
|
+
mode?: "watch" | "claim" | "exec" | undefined;
|
|
271
|
+
once?: boolean | undefined;
|
|
272
|
+
interval_ms?: number | undefined;
|
|
273
|
+
exec_file?: string | undefined;
|
|
274
|
+
}>;
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const MAX_JSON_PAYLOAD_BYTES = 1024 * 1024; // 1MB limit (FC-302)
|
|
3
|
+
export const MAX_JSON_DEPTH = 32; // Max nesting depth limit (FC-302)
|
|
4
|
+
export function measureJsonDepth(val, currentDepth = 0) {
|
|
5
|
+
if (currentDepth > MAX_JSON_DEPTH)
|
|
6
|
+
return currentDepth;
|
|
7
|
+
if (typeof val !== 'object' || val === null)
|
|
8
|
+
return currentDepth;
|
|
9
|
+
let max = currentDepth;
|
|
10
|
+
if (Array.isArray(val)) {
|
|
11
|
+
for (const item of val) {
|
|
12
|
+
const d = measureJsonDepth(item, currentDepth + 1);
|
|
13
|
+
if (d > max)
|
|
14
|
+
max = d;
|
|
15
|
+
if (max > MAX_JSON_DEPTH)
|
|
16
|
+
return max;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
for (const key of Object.keys(val)) {
|
|
21
|
+
const d = measureJsonDepth(val[key], currentDepth + 1);
|
|
22
|
+
if (d > max)
|
|
23
|
+
max = d;
|
|
24
|
+
if (max > MAX_JSON_DEPTH)
|
|
25
|
+
return max;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return max;
|
|
29
|
+
}
|
|
30
|
+
export function validateJsonPayload(val) {
|
|
31
|
+
if (val === undefined || val === null)
|
|
32
|
+
return { valid: true };
|
|
33
|
+
const depth = measureJsonDepth(val);
|
|
34
|
+
if (depth > MAX_JSON_DEPTH) {
|
|
35
|
+
return {
|
|
36
|
+
valid: false,
|
|
37
|
+
error: `JSON payload nesting depth (${depth}) exceeds maximum allowed depth of ${MAX_JSON_DEPTH} (FC-302).`,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const serialized = JSON.stringify(val);
|
|
42
|
+
const bytes = Buffer.byteLength(serialized, 'utf8');
|
|
43
|
+
if (bytes > MAX_JSON_PAYLOAD_BYTES) {
|
|
44
|
+
return {
|
|
45
|
+
valid: false,
|
|
46
|
+
error: `JSON payload size (${bytes} bytes) exceeds maximum allowed limit of ${MAX_JSON_PAYLOAD_BYTES} bytes (1MB) (FC-302).`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
return {
|
|
52
|
+
valid: false,
|
|
53
|
+
error: `JSON payload could not be serialized: ${err instanceof Error ? err.message : String(err)}`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return { valid: true };
|
|
57
|
+
}
|
|
58
|
+
export const DispatchContractShape = {
|
|
59
|
+
requester_agent: z
|
|
60
|
+
.string()
|
|
61
|
+
.min(1)
|
|
62
|
+
.max(64)
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Requester agent identifier. Defaults to AGENT_NAME env var (e.g., "antigravity", "workbuddy").'),
|
|
65
|
+
target_agent: z
|
|
66
|
+
.string()
|
|
67
|
+
.min(1)
|
|
68
|
+
.max(64)
|
|
69
|
+
.describe('Target worker agent identifier expected to claim and execute this contract (e.g., "workbuddy", "antigravity").'),
|
|
70
|
+
task_type: z
|
|
71
|
+
.enum(['code_review', 'architecture_audit', 'implementation', 'test_generation'])
|
|
72
|
+
.describe('Type of contract task. Tiered default execution TTL: 1800s for code_review/architecture_audit, 300s for implementation/test_generation.'),
|
|
73
|
+
title: z
|
|
74
|
+
.string()
|
|
75
|
+
.min(1)
|
|
76
|
+
.max(120)
|
|
77
|
+
.describe('Concise contract title (1-120 chars) summarizing the goal of the request.'),
|
|
78
|
+
context_summary: z
|
|
79
|
+
.string()
|
|
80
|
+
.min(1)
|
|
81
|
+
.max(20000)
|
|
82
|
+
.describe('Detailed task instructions, audit focus areas, architectural constraints, and background context for the worker agent (1-20000 chars).'),
|
|
83
|
+
workspace_root: z
|
|
84
|
+
.string()
|
|
85
|
+
.min(1)
|
|
86
|
+
.max(512)
|
|
87
|
+
.describe('Absolute canonical path to the shared local workspace directory accessible by both hosts (e.g. "F:/git/FerryCat"). Path escapes and sensitive files are blocked.'),
|
|
88
|
+
pointers: z
|
|
89
|
+
.array(z.object({
|
|
90
|
+
path: z
|
|
91
|
+
.string()
|
|
92
|
+
.min(1)
|
|
93
|
+
.max(512)
|
|
94
|
+
.describe('File path relative to workspace_root. Must exist on disk. Sensitive files (.env*, *.pem, *.key, id_rsa*, *credentials*, *secret*, .npmrc, .git/config) and path escapes are strictly rejected.'),
|
|
95
|
+
line_range: z
|
|
96
|
+
.tuple([z.number().int().positive(), z.number().int().positive()])
|
|
97
|
+
.optional()
|
|
98
|
+
.describe('Optional [startLine, endLine] 1-based inclusive line range focus for the task.'),
|
|
99
|
+
}))
|
|
100
|
+
.min(1)
|
|
101
|
+
.max(50)
|
|
102
|
+
.describe('Array of 1 to 50 target file pointers hashed with full-file SHA-256 and snapshot boundaries for tamper detection.'),
|
|
103
|
+
contract_schema: z
|
|
104
|
+
.record(z.unknown())
|
|
105
|
+
.optional()
|
|
106
|
+
.refine((val) => !val || validateJsonPayload(val).valid, {
|
|
107
|
+
message: 'contract_schema must not exceed 1MB serialized or 32 levels of nesting (FC-302)',
|
|
108
|
+
})
|
|
109
|
+
.describe('Optional Draft-07 JSON Schema that structured_output must validate against. Bounded to 1MB and max 32 depth (FC-302).'),
|
|
110
|
+
queue_ttl_sec: z
|
|
111
|
+
.number()
|
|
112
|
+
.int()
|
|
113
|
+
.positive()
|
|
114
|
+
.max(86400)
|
|
115
|
+
.optional()
|
|
116
|
+
.describe('Queue expiration TTL in seconds while status is SUBMITTED (default: 1800s / 30m). Transitions to TIMED_OUT if unclaimed before expiry.'),
|
|
117
|
+
exec_ttl_sec: z
|
|
118
|
+
.number()
|
|
119
|
+
.int()
|
|
120
|
+
.positive()
|
|
121
|
+
.max(7200)
|
|
122
|
+
.optional()
|
|
123
|
+
.describe('Execution TTL in seconds once CLAIMED (default: 1800s for review/audit, 300s for implementation/test). Worker must fulfill, extend, release, or fail within this window.'),
|
|
124
|
+
};
|
|
125
|
+
export const PollNextTaskShape = {
|
|
126
|
+
agent_id: z
|
|
127
|
+
.string()
|
|
128
|
+
.min(1)
|
|
129
|
+
.max(64)
|
|
130
|
+
.optional()
|
|
131
|
+
.describe('Worker agent identifier claiming tasks (defaults to AGENT_NAME env var, e.g., "workbuddy").'),
|
|
132
|
+
};
|
|
133
|
+
export const FulfillContractShape = {
|
|
134
|
+
contract_id: z
|
|
135
|
+
.string()
|
|
136
|
+
.min(1)
|
|
137
|
+
.max(128)
|
|
138
|
+
.describe('The contract ID returned by poll_next_task that is currently in CLAIMED status.'),
|
|
139
|
+
agent_id: z
|
|
140
|
+
.string()
|
|
141
|
+
.min(1)
|
|
142
|
+
.max(64)
|
|
143
|
+
.optional()
|
|
144
|
+
.describe('Worker agent identifier. Must match the contract target_agent (defaults to AGENT_NAME env var).'),
|
|
145
|
+
claim_token: z
|
|
146
|
+
.string()
|
|
147
|
+
.min(1)
|
|
148
|
+
.max(128)
|
|
149
|
+
.optional()
|
|
150
|
+
.describe('Exclusive lease token returned in contract.claim_token by poll_next_task (FC-301). Mutating operations must provide matching claim_token to prevent cross-worker interference.'),
|
|
151
|
+
result_summary: z
|
|
152
|
+
.string()
|
|
153
|
+
.min(1)
|
|
154
|
+
.max(20000)
|
|
155
|
+
.describe('Detailed markdown or plain text summary of review findings, implementation details, or test execution outcomes (1-20000 chars).'),
|
|
156
|
+
structured_output: z
|
|
157
|
+
.record(z.unknown())
|
|
158
|
+
.optional()
|
|
159
|
+
.refine((val) => !val || validateJsonPayload(val).valid, {
|
|
160
|
+
message: 'structured_output must not exceed 1MB serialized or 32 levels of nesting (FC-302)',
|
|
161
|
+
})
|
|
162
|
+
.describe('Structured JSON payload matching contract_schema. Bounded to 1MB and max 32 depth (FC-302). For code reviews, pass proposed patches in fixes: [{ path, patch, description }] rather than editing pointer files directly (ADR-0004).'),
|
|
163
|
+
artifacts_pointers: z
|
|
164
|
+
.array(z.object({
|
|
165
|
+
path: z.string().min(1).max(512).describe('File path of created or modified artifact relative to workspace_root'),
|
|
166
|
+
description: z.string().min(1).max(1000).describe('Description of the artifact and its role'),
|
|
167
|
+
}))
|
|
168
|
+
.max(50)
|
|
169
|
+
.optional()
|
|
170
|
+
.describe('Optional pointers to new or modified artifact files created during task execution (max 50 files).'),
|
|
171
|
+
};
|
|
172
|
+
export const VerifyContractShape = {
|
|
173
|
+
contract_id: z
|
|
174
|
+
.string()
|
|
175
|
+
.min(1)
|
|
176
|
+
.max(128)
|
|
177
|
+
.describe('The contract ID whose on-disk pointer files should be verified against the baseline SHA-256 snapshot without mutating contract state.'),
|
|
178
|
+
agent_id: z
|
|
179
|
+
.string()
|
|
180
|
+
.min(1)
|
|
181
|
+
.max(64)
|
|
182
|
+
.optional()
|
|
183
|
+
.describe('Optional caller agent identifier for audit logging. Does not restrict read-only verification.'),
|
|
184
|
+
claim_token: z
|
|
185
|
+
.string()
|
|
186
|
+
.min(1)
|
|
187
|
+
.max(128)
|
|
188
|
+
.optional()
|
|
189
|
+
.describe('Optional lease token for caller verification (FC-301).'),
|
|
190
|
+
};
|
|
191
|
+
export const ReleaseContractShape = {
|
|
192
|
+
contract_id: z
|
|
193
|
+
.string()
|
|
194
|
+
.min(1)
|
|
195
|
+
.max(128)
|
|
196
|
+
.describe('The CLAIMED contract ID to release back to the queue tail as SUBMITTED.'),
|
|
197
|
+
agent_id: z
|
|
198
|
+
.string()
|
|
199
|
+
.min(1)
|
|
200
|
+
.max(64)
|
|
201
|
+
.optional()
|
|
202
|
+
.describe('Current holder agent identifier. Must match target_agent of the claimed contract (defaults to AGENT_NAME env var).'),
|
|
203
|
+
claim_token: z
|
|
204
|
+
.string()
|
|
205
|
+
.min(1)
|
|
206
|
+
.max(128)
|
|
207
|
+
.optional()
|
|
208
|
+
.describe('Exclusive lease token returned in contract.claim_token by poll_next_task (FC-301).'),
|
|
209
|
+
reason: z
|
|
210
|
+
.string()
|
|
211
|
+
.min(1)
|
|
212
|
+
.max(2000)
|
|
213
|
+
.optional()
|
|
214
|
+
.describe('Optional reason for releasing (e.g., "wrong context", "missing tool", "switching git branch"). Appended to error_reason history.'),
|
|
215
|
+
};
|
|
216
|
+
export const ExtendTtlShape = {
|
|
217
|
+
contract_id: z
|
|
218
|
+
.string()
|
|
219
|
+
.min(1)
|
|
220
|
+
.max(128)
|
|
221
|
+
.describe('The CLAIMED contract ID whose active execution window should be renewed.'),
|
|
222
|
+
agent_id: z
|
|
223
|
+
.string()
|
|
224
|
+
.min(1)
|
|
225
|
+
.max(64)
|
|
226
|
+
.optional()
|
|
227
|
+
.describe('Current holder agent identifier. Must match target_agent of the claimed contract (defaults to AGENT_NAME env var).'),
|
|
228
|
+
claim_token: z
|
|
229
|
+
.string()
|
|
230
|
+
.min(1)
|
|
231
|
+
.max(128)
|
|
232
|
+
.optional()
|
|
233
|
+
.describe('Exclusive lease token returned in contract.claim_token by poll_next_task (FC-301).'),
|
|
234
|
+
};
|
|
235
|
+
export const FailContractShape = {
|
|
236
|
+
contract_id: z
|
|
237
|
+
.string()
|
|
238
|
+
.min(1)
|
|
239
|
+
.max(128)
|
|
240
|
+
.describe('The CLAIMED contract ID to mark as terminal FAILED.'),
|
|
241
|
+
agent_id: z
|
|
242
|
+
.string()
|
|
243
|
+
.min(1)
|
|
244
|
+
.max(64)
|
|
245
|
+
.optional()
|
|
246
|
+
.describe('Current holder agent identifier. Must match target_agent of the claimed contract (defaults to AGENT_NAME env var).'),
|
|
247
|
+
claim_token: z
|
|
248
|
+
.string()
|
|
249
|
+
.min(1)
|
|
250
|
+
.max(128)
|
|
251
|
+
.optional()
|
|
252
|
+
.describe('Exclusive lease token returned in contract.claim_token by poll_next_task (FC-301).'),
|
|
253
|
+
reason: z
|
|
254
|
+
.string()
|
|
255
|
+
.min(1)
|
|
256
|
+
.max(2000)
|
|
257
|
+
.describe('Mandatory explanation of why the task cannot be completed. Stored in error_reason for the requester.'),
|
|
258
|
+
};
|
|
259
|
+
export const InspectMeshStateShape = {
|
|
260
|
+
contract_id: z
|
|
261
|
+
.string()
|
|
262
|
+
.min(1)
|
|
263
|
+
.max(128)
|
|
264
|
+
.optional()
|
|
265
|
+
.describe('Optional specific contract_id to inspect single contract details, counters, errors, and output payloads.'),
|
|
266
|
+
target_agent: z
|
|
267
|
+
.string()
|
|
268
|
+
.min(1)
|
|
269
|
+
.max(64)
|
|
270
|
+
.optional()
|
|
271
|
+
.describe('Optional filter by target worker agent identifier (e.g., "workbuddy") to view pending or completed queue items.'),
|
|
272
|
+
status: z
|
|
273
|
+
.enum([
|
|
274
|
+
'SUBMITTED',
|
|
275
|
+
'CLAIMED',
|
|
276
|
+
'COMPLETED',
|
|
277
|
+
'POINTER_STALE',
|
|
278
|
+
'VALIDATION_FAILED',
|
|
279
|
+
'TIMED_OUT',
|
|
280
|
+
'FAILED',
|
|
281
|
+
'ACTIVE',
|
|
282
|
+
'ALL',
|
|
283
|
+
])
|
|
284
|
+
.optional()
|
|
285
|
+
.describe('Filter by status (default: ALL)'),
|
|
286
|
+
limit: z
|
|
287
|
+
.number()
|
|
288
|
+
.int()
|
|
289
|
+
.min(1)
|
|
290
|
+
.max(100)
|
|
291
|
+
.optional()
|
|
292
|
+
.describe('Maximum number of records to return (default: 10)'),
|
|
293
|
+
};
|
|
294
|
+
export const DispatchContractSchema = z.object(DispatchContractShape);
|
|
295
|
+
export const PollNextTaskSchema = z.object(PollNextTaskShape);
|
|
296
|
+
export const FulfillContractSchema = z.object(FulfillContractShape);
|
|
297
|
+
export const VerifyContractSchema = z.object(VerifyContractShape);
|
|
298
|
+
export const ReleaseContractSchema = z.object(ReleaseContractShape);
|
|
299
|
+
export const ExtendTtlSchema = z.object(ExtendTtlShape);
|
|
300
|
+
export const FailContractSchema = z.object(FailContractShape);
|
|
301
|
+
export const InspectMeshStateSchema = z.object(InspectMeshStateShape);
|
|
302
|
+
export const WorkerCommandShape = {
|
|
303
|
+
agent_id: z
|
|
304
|
+
.string()
|
|
305
|
+
.min(1)
|
|
306
|
+
.max(64)
|
|
307
|
+
.optional()
|
|
308
|
+
.describe('Worker agent identifier (defaults to AGENT_NAME env var)'),
|
|
309
|
+
mode: z
|
|
310
|
+
.enum(['watch', 'claim', 'exec'])
|
|
311
|
+
.optional()
|
|
312
|
+
.describe('Explicit worker behavior mode: "watch" (persistent non-claiming notifier), "claim" (single-shot claim and exit), or "exec" (auto-claim and run --exec / --exec-file)'),
|
|
313
|
+
once: z
|
|
314
|
+
.boolean()
|
|
315
|
+
.optional()
|
|
316
|
+
.describe('Run single poll attempt and exit immediately (Subprocess-per-Task mode)'),
|
|
317
|
+
interval_ms: z
|
|
318
|
+
.number()
|
|
319
|
+
.int()
|
|
320
|
+
.min(100)
|
|
321
|
+
.max(60000)
|
|
322
|
+
.optional()
|
|
323
|
+
.describe('Polling interval in milliseconds for persistent worker loop (default: 1000)'),
|
|
324
|
+
exec: z
|
|
325
|
+
.string()
|
|
326
|
+
.min(1)
|
|
327
|
+
.max(1024)
|
|
328
|
+
.optional()
|
|
329
|
+
.describe('Shell command string to execute upon task claim (UNSAFE: executes via system shell, contract JSON piped via stdin). Prefer --exec-file for scripts.'),
|
|
330
|
+
exec_file: z
|
|
331
|
+
.string()
|
|
332
|
+
.min(1)
|
|
333
|
+
.max(1024)
|
|
334
|
+
.optional()
|
|
335
|
+
.describe('Recommended script file (.js/.mjs/.cjs/.ts/.ps1/.sh) to execute directly via execFile without shell quote escaping or injection risks.'),
|
|
336
|
+
};
|
|
337
|
+
export const WorkerCommandSchema = z.object(WorkerCommandShape).strict();
|
|
338
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,qBAAqB;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC,CAAC,mCAAmC;AAErE,MAAM,UAAU,gBAAgB,CAAC,GAAY,EAAE,eAAuB,CAAC;IACrE,IAAI,YAAY,GAAG,cAAc;QAAE,OAAO,YAAY,CAAC;IACvD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC;IACjE,IAAI,GAAG,GAAG,YAAY,CAAC;IACvB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,gB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