@useorgx/openclaw-plugin 0.7.0 → 0.7.3
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/README.md +42 -11
- package/dashboard/dist/assets/6mILZQ2a.js +1 -0
- package/dashboard/dist/assets/6mILZQ2a.js.br +0 -0
- package/dashboard/dist/assets/6mILZQ2a.js.gz +0 -0
- package/dashboard/dist/assets/{DG6y9wJI.js → 8dksYiq4.js} +1 -1
- package/dashboard/dist/assets/8dksYiq4.js.br +0 -0
- package/dashboard/dist/assets/8dksYiq4.js.gz +0 -0
- package/dashboard/dist/assets/{PAUiij_z.js → B5zYRHc3.js} +1 -1
- package/dashboard/dist/assets/B5zYRHc3.js.br +0 -0
- package/dashboard/dist/assets/B5zYRHc3.js.gz +0 -0
- package/dashboard/dist/assets/{CFGKRAzG.js → B6wPWJ35.js} +1 -1
- package/dashboard/dist/assets/B6wPWJ35.js.br +0 -0
- package/dashboard/dist/assets/B6wPWJ35.js.gz +0 -0
- package/dashboard/dist/assets/BWEwjt1W.js +1 -0
- package/dashboard/dist/assets/BWEwjt1W.js.br +0 -0
- package/dashboard/dist/assets/BWEwjt1W.js.gz +0 -0
- package/dashboard/dist/assets/BzRbDCAD.css +1 -0
- package/dashboard/dist/assets/BzRbDCAD.css.br +0 -0
- package/dashboard/dist/assets/BzRbDCAD.css.gz +0 -0
- package/dashboard/dist/assets/{DNxKz-GV.js → C8uM3AX8.js} +1 -1
- package/dashboard/dist/assets/C8uM3AX8.js.br +0 -0
- package/dashboard/dist/assets/C8uM3AX8.js.gz +0 -0
- package/dashboard/dist/assets/C9jy61eu.js +212 -0
- package/dashboard/dist/assets/C9jy61eu.js.br +0 -0
- package/dashboard/dist/assets/C9jy61eu.js.gz +0 -0
- package/dashboard/dist/assets/{CE38zU4U.js → CC63EwFD.js} +1 -1
- package/dashboard/dist/assets/CC63EwFD.js.br +0 -0
- package/dashboard/dist/assets/CC63EwFD.js.gz +0 -0
- package/dashboard/dist/assets/{nByHNHoW.js → CZaT3ob_.js} +1 -1
- package/dashboard/dist/assets/CZaT3ob_.js.br +0 -0
- package/dashboard/dist/assets/CZaT3ob_.js.gz +0 -0
- package/dashboard/dist/assets/{tS9mbYZi.js → CgaottFX.js} +1 -1
- package/dashboard/dist/assets/CgaottFX.js.br +0 -0
- package/dashboard/dist/assets/CgaottFX.js.gz +0 -0
- package/dashboard/dist/assets/CzCxAZlW.js +1 -0
- package/dashboard/dist/assets/CzCxAZlW.js.br +0 -0
- package/dashboard/dist/assets/CzCxAZlW.js.gz +0 -0
- package/dashboard/dist/assets/D3iMTYEj.js +1 -0
- package/dashboard/dist/assets/D3iMTYEj.js.br +0 -0
- package/dashboard/dist/assets/D3iMTYEj.js.gz +0 -0
- package/dashboard/dist/assets/{DjcdE6jC.js → D8JNX8kq.js} +1 -1
- package/dashboard/dist/assets/D8JNX8kq.js.br +0 -0
- package/dashboard/dist/assets/D8JNX8kq.js.gz +0 -0
- package/dashboard/dist/assets/DnA8dpj6.js +1 -0
- package/dashboard/dist/assets/DnA8dpj6.js.br +0 -0
- package/dashboard/dist/assets/DnA8dpj6.js.gz +0 -0
- package/dashboard/dist/assets/{DbNoijHm.js → IUexzymk.js} +1 -1
- package/dashboard/dist/assets/IUexzymk.js.br +0 -0
- package/dashboard/dist/assets/IUexzymk.js.gz +0 -0
- package/dashboard/dist/assets/{CZZTvkQZ.js → rttbDbEx.js} +1 -1
- package/dashboard/dist/assets/rttbDbEx.js.br +0 -0
- package/dashboard/dist/assets/rttbDbEx.js.gz +0 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/index.html.br +0 -0
- package/dashboard/dist/index.html.gz +0 -0
- package/dist/contracts/practice-exercise-schema.d.ts +216 -0
- package/dist/contracts/practice-exercise-schema.js +314 -0
- package/dist/contracts/shared-types.d.ts +2 -2
- package/dist/contracts/shared-types.js +22 -0
- package/dist/contracts/types.d.ts +20 -0
- package/dist/fs-utils.js +1 -13
- package/dist/http/helpers/auto-continue-engine.js +638 -24
- package/dist/http/helpers/autopilot-runtime.js +22 -7
- package/dist/http/helpers/autopilot-slice-utils.js +0 -2
- package/dist/http/helpers/kickoff-context.js +30 -0
- package/dist/http/helpers/slice-run-projections.js +19 -2
- package/dist/http/index.js +151 -93
- package/dist/http/routes/agent-suite.js +87 -0
- package/dist/http/routes/entities.js +1 -63
- package/dist/http/routes/live-snapshot.d.ts +1 -0
- package/dist/http/routes/live-snapshot.js +15 -4
- package/dist/http/routes/live-terminal.js +1 -108
- package/dist/http/routes/live-triage.js +1 -57
- package/dist/http/routes/mission-control-actions.js +0 -88
- package/dist/http/routes/mission-control-read.js +73 -8
- package/dist/mcp-http-handler.d.ts +3 -0
- package/dist/mcp-http-handler.js +2 -2
- package/dist/openclaw.plugin.json +1 -1
- package/dist/paths.js +14 -2
- package/dist/reporting/rollups.d.ts +0 -12
- package/dist/reporting/rollups.js +0 -35
- package/openclaw.plugin.json +1 -1
- package/package.json +7 -3
- package/dashboard/dist/assets/BXWDRGm-.js +0 -1
- package/dashboard/dist/assets/BXWDRGm-.js.br +0 -0
- package/dashboard/dist/assets/BXWDRGm-.js.gz +0 -0
- package/dashboard/dist/assets/CE38zU4U.js.br +0 -0
- package/dashboard/dist/assets/CE38zU4U.js.gz +0 -0
- package/dashboard/dist/assets/CFGKRAzG.js.br +0 -0
- package/dashboard/dist/assets/CFGKRAzG.js.gz +0 -0
- package/dashboard/dist/assets/CGGR2GZh.js +0 -1
- package/dashboard/dist/assets/CGGR2GZh.js.br +0 -0
- package/dashboard/dist/assets/CGGR2GZh.js.gz +0 -0
- package/dashboard/dist/assets/CPFiTmlw.js +0 -8
- package/dashboard/dist/assets/CPFiTmlw.js.br +0 -0
- package/dashboard/dist/assets/CPFiTmlw.js.gz +0 -0
- package/dashboard/dist/assets/CZZTvkQZ.js.br +0 -0
- package/dashboard/dist/assets/CZZTvkQZ.js.gz +0 -0
- package/dashboard/dist/assets/D-bf6hEI.js +0 -213
- package/dashboard/dist/assets/D-bf6hEI.js.br +0 -0
- package/dashboard/dist/assets/D-bf6hEI.js.gz +0 -0
- package/dashboard/dist/assets/DG6y9wJI.js.br +0 -0
- package/dashboard/dist/assets/DG6y9wJI.js.gz +0 -0
- package/dashboard/dist/assets/DNxKz-GV.js.br +0 -0
- package/dashboard/dist/assets/DNxKz-GV.js.gz +0 -0
- package/dashboard/dist/assets/DW_rKUic.js +0 -11
- package/dashboard/dist/assets/DW_rKUic.js.br +0 -0
- package/dashboard/dist/assets/DW_rKUic.js.gz +0 -0
- package/dashboard/dist/assets/DbNoijHm.js.br +0 -0
- package/dashboard/dist/assets/DbNoijHm.js.gz +0 -0
- package/dashboard/dist/assets/DjcdE6jC.js.br +0 -0
- package/dashboard/dist/assets/DjcdE6jC.js.gz +0 -0
- package/dashboard/dist/assets/FZYuCDnt.js +0 -1
- package/dashboard/dist/assets/FZYuCDnt.js.br +0 -0
- package/dashboard/dist/assets/FZYuCDnt.js.gz +0 -0
- package/dashboard/dist/assets/PAUiij_z.js.br +0 -0
- package/dashboard/dist/assets/PAUiij_z.js.gz +0 -0
- package/dashboard/dist/assets/h5biQs2I.css +0 -1
- package/dashboard/dist/assets/h5biQs2I.css.br +0 -0
- package/dashboard/dist/assets/h5biQs2I.css.gz +0 -0
- package/dashboard/dist/assets/nByHNHoW.js.br +0 -0
- package/dashboard/dist/assets/nByHNHoW.js.gz +0 -0
- package/dashboard/dist/assets/tS9mbYZi.js.br +0 -0
- package/dashboard/dist/assets/tS9mbYZi.js.gz +0 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
export const PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION = "practice-exercise-template.v1";
|
|
2
|
+
function isRecord(value) {
|
|
3
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
4
|
+
}
|
|
5
|
+
function readString(source, key, errors, opts = {}) {
|
|
6
|
+
const { required = true } = opts;
|
|
7
|
+
const value = source[key];
|
|
8
|
+
if (typeof value !== "string") {
|
|
9
|
+
if (required)
|
|
10
|
+
errors.push(`${key} must be a string`);
|
|
11
|
+
return "";
|
|
12
|
+
}
|
|
13
|
+
const normalized = value.trim();
|
|
14
|
+
if (!normalized && required) {
|
|
15
|
+
errors.push(`${key} must not be empty`);
|
|
16
|
+
}
|
|
17
|
+
return normalized;
|
|
18
|
+
}
|
|
19
|
+
function readStringArray(source, key, errors, opts = {}) {
|
|
20
|
+
const { required = true, minItems = 0 } = opts;
|
|
21
|
+
const value = source[key];
|
|
22
|
+
if (!Array.isArray(value)) {
|
|
23
|
+
if (required)
|
|
24
|
+
errors.push(`${key} must be an array`);
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const output = [];
|
|
28
|
+
value.forEach((entry, index) => {
|
|
29
|
+
if (typeof entry !== "string" || !entry.trim()) {
|
|
30
|
+
errors.push(`${key}[${index}] must be a non-empty string`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
output.push(entry.trim());
|
|
34
|
+
});
|
|
35
|
+
if (output.length < minItems) {
|
|
36
|
+
errors.push(`${key} must include at least ${minItems} item(s)`);
|
|
37
|
+
}
|
|
38
|
+
return output;
|
|
39
|
+
}
|
|
40
|
+
const TASK_TYPE_SET = new Set([
|
|
41
|
+
"analysis",
|
|
42
|
+
"implementation",
|
|
43
|
+
"review",
|
|
44
|
+
"debugging",
|
|
45
|
+
"planning",
|
|
46
|
+
]);
|
|
47
|
+
const CONSTRAINT_SEVERITY_SET = new Set(["hard", "soft"]);
|
|
48
|
+
const OUTPUT_FORMAT_SET = new Set(["json_object", "markdown", "text"]);
|
|
49
|
+
function parseScenario(raw, index, errors) {
|
|
50
|
+
if (!isRecord(raw)) {
|
|
51
|
+
errors.push(`scenarios[${index}] must be an object`);
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const id = readString(raw, "id", errors);
|
|
55
|
+
const title = readString(raw, "title", errors);
|
|
56
|
+
const input = raw.input;
|
|
57
|
+
if (!isRecord(input)) {
|
|
58
|
+
errors.push(`scenarios[${index}].input must be an object`);
|
|
59
|
+
}
|
|
60
|
+
const contextRaw = raw.context;
|
|
61
|
+
const context = typeof contextRaw === "string" && contextRaw.trim() ? contextRaw.trim() : undefined;
|
|
62
|
+
const successCriteria = readStringArray(raw, "success_criteria", errors, {
|
|
63
|
+
minItems: 1,
|
|
64
|
+
});
|
|
65
|
+
if (!isRecord(input))
|
|
66
|
+
return null;
|
|
67
|
+
return {
|
|
68
|
+
id,
|
|
69
|
+
title,
|
|
70
|
+
input,
|
|
71
|
+
context,
|
|
72
|
+
success_criteria: successCriteria,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function parseConstraint(raw, index, errors) {
|
|
76
|
+
if (!isRecord(raw)) {
|
|
77
|
+
errors.push(`constraints[${index}] must be an object`);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const id = readString(raw, "id", errors);
|
|
81
|
+
const title = readString(raw, "title", errors);
|
|
82
|
+
const description = readString(raw, "description", errors);
|
|
83
|
+
const severityRaw = readString(raw, "severity", errors);
|
|
84
|
+
if (!CONSTRAINT_SEVERITY_SET.has(severityRaw)) {
|
|
85
|
+
errors.push(`constraints[${index}].severity must be one of: hard, soft`);
|
|
86
|
+
}
|
|
87
|
+
const rationaleRaw = raw.rationale;
|
|
88
|
+
const rationale = typeof rationaleRaw === "string" && rationaleRaw.trim() ? rationaleRaw.trim() : undefined;
|
|
89
|
+
return {
|
|
90
|
+
id,
|
|
91
|
+
title,
|
|
92
|
+
description,
|
|
93
|
+
severity: severityRaw,
|
|
94
|
+
rationale,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function parseExpectedOutputShape(raw, errors) {
|
|
98
|
+
if (!isRecord(raw)) {
|
|
99
|
+
errors.push("expected_output_shape must be an object");
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
const format = readString(raw, "format", errors);
|
|
103
|
+
if (!OUTPUT_FORMAT_SET.has(format)) {
|
|
104
|
+
errors.push("expected_output_shape.format must be one of: json_object, markdown, text");
|
|
105
|
+
}
|
|
106
|
+
const fieldsRaw = raw.fields;
|
|
107
|
+
if (!Array.isArray(fieldsRaw)) {
|
|
108
|
+
errors.push("expected_output_shape.fields must be an array");
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const fields = [];
|
|
112
|
+
fieldsRaw.forEach((entry, index) => {
|
|
113
|
+
if (!isRecord(entry)) {
|
|
114
|
+
errors.push(`expected_output_shape.fields[${index}] must be an object`);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const path = readString(entry, "path", errors);
|
|
118
|
+
const type = readString(entry, "type", errors);
|
|
119
|
+
const required = entry.required;
|
|
120
|
+
if (typeof required !== "boolean") {
|
|
121
|
+
errors.push(`expected_output_shape.fields[${index}].required must be boolean`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const description = readString(entry, "description", errors);
|
|
125
|
+
fields.push({ path, type, required, description });
|
|
126
|
+
});
|
|
127
|
+
if (fields.length === 0) {
|
|
128
|
+
errors.push("expected_output_shape.fields must include at least 1 field");
|
|
129
|
+
}
|
|
130
|
+
const exampleRaw = raw.example;
|
|
131
|
+
const example = typeof exampleRaw === "string"
|
|
132
|
+
? exampleRaw
|
|
133
|
+
: isRecord(exampleRaw)
|
|
134
|
+
? exampleRaw
|
|
135
|
+
: undefined;
|
|
136
|
+
if (typeof exampleRaw !== "undefined" &&
|
|
137
|
+
typeof exampleRaw !== "string" &&
|
|
138
|
+
!isRecord(exampleRaw)) {
|
|
139
|
+
errors.push("expected_output_shape.example must be a string or object");
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
format: format,
|
|
143
|
+
fields,
|
|
144
|
+
example,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export function validatePracticeExerciseTemplate(input) {
|
|
148
|
+
if (!isRecord(input)) {
|
|
149
|
+
return {
|
|
150
|
+
ok: false,
|
|
151
|
+
errors: ["template must be an object"],
|
|
152
|
+
template: null,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const errors = [];
|
|
156
|
+
const schemaVersion = readString(input, "schema_version", errors);
|
|
157
|
+
if (schemaVersion !== PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION) {
|
|
158
|
+
errors.push(`schema_version must equal "${PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION}"`);
|
|
159
|
+
}
|
|
160
|
+
const id = readString(input, "id", errors);
|
|
161
|
+
const title = readString(input, "title", errors);
|
|
162
|
+
const summary = readString(input, "summary", errors);
|
|
163
|
+
const taskType = readString(input, "task_type", errors);
|
|
164
|
+
if (!TASK_TYPE_SET.has(taskType)) {
|
|
165
|
+
errors.push("task_type must be one of: analysis, implementation, review, debugging, planning");
|
|
166
|
+
}
|
|
167
|
+
const scenariosRaw = input.scenarios;
|
|
168
|
+
const scenarios = [];
|
|
169
|
+
if (!Array.isArray(scenariosRaw)) {
|
|
170
|
+
errors.push("scenarios must be an array");
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
scenariosRaw.forEach((entry, index) => {
|
|
174
|
+
const parsed = parseScenario(entry, index, errors);
|
|
175
|
+
if (parsed)
|
|
176
|
+
scenarios.push(parsed);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (scenarios.length === 0) {
|
|
180
|
+
errors.push("scenarios must include at least 1 scenario");
|
|
181
|
+
}
|
|
182
|
+
const constraintsRaw = input.constraints;
|
|
183
|
+
const constraints = [];
|
|
184
|
+
if (!Array.isArray(constraintsRaw)) {
|
|
185
|
+
errors.push("constraints must be an array");
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
constraintsRaw.forEach((entry, index) => {
|
|
189
|
+
const parsed = parseConstraint(entry, index, errors);
|
|
190
|
+
if (parsed)
|
|
191
|
+
constraints.push(parsed);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const expectedOutputShape = parseExpectedOutputShape(input.expected_output_shape, errors);
|
|
195
|
+
const tags = readStringArray(input, "tags", errors, { required: false });
|
|
196
|
+
const template = errors.length === 0 && expectedOutputShape
|
|
197
|
+
? {
|
|
198
|
+
schema_version: PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION,
|
|
199
|
+
id,
|
|
200
|
+
title,
|
|
201
|
+
summary,
|
|
202
|
+
task_type: taskType,
|
|
203
|
+
scenarios,
|
|
204
|
+
constraints,
|
|
205
|
+
expected_output_shape: expectedOutputShape,
|
|
206
|
+
tags: tags.length > 0 ? tags : undefined,
|
|
207
|
+
}
|
|
208
|
+
: null;
|
|
209
|
+
return { ok: errors.length === 0, errors, template };
|
|
210
|
+
}
|
|
211
|
+
export const PRACTICE_EXERCISE_TEMPLATE_JSON_SCHEMA = {
|
|
212
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
213
|
+
$id: "https://schemas.useorgx.com/practice-exercise-template/v1.json",
|
|
214
|
+
title: "OrgX Practice Exercise Template v1",
|
|
215
|
+
description: "Structured exercise template for practice loops with scenarios, constraints, and expected output shape.",
|
|
216
|
+
type: "object",
|
|
217
|
+
additionalProperties: false,
|
|
218
|
+
required: [
|
|
219
|
+
"schema_version",
|
|
220
|
+
"id",
|
|
221
|
+
"title",
|
|
222
|
+
"summary",
|
|
223
|
+
"task_type",
|
|
224
|
+
"scenarios",
|
|
225
|
+
"constraints",
|
|
226
|
+
"expected_output_shape",
|
|
227
|
+
],
|
|
228
|
+
properties: {
|
|
229
|
+
schema_version: {
|
|
230
|
+
type: "string",
|
|
231
|
+
const: PRACTICE_EXERCISE_TEMPLATE_SCHEMA_VERSION,
|
|
232
|
+
},
|
|
233
|
+
id: { type: "string", minLength: 1, maxLength: 120 },
|
|
234
|
+
title: { type: "string", minLength: 1, maxLength: 300 },
|
|
235
|
+
summary: { type: "string", minLength: 1, maxLength: 3000 },
|
|
236
|
+
task_type: {
|
|
237
|
+
type: "string",
|
|
238
|
+
enum: ["analysis", "implementation", "review", "debugging", "planning"],
|
|
239
|
+
},
|
|
240
|
+
scenarios: {
|
|
241
|
+
type: "array",
|
|
242
|
+
minItems: 1,
|
|
243
|
+
maxItems: 25,
|
|
244
|
+
items: {
|
|
245
|
+
type: "object",
|
|
246
|
+
additionalProperties: false,
|
|
247
|
+
required: ["id", "title", "input", "success_criteria"],
|
|
248
|
+
properties: {
|
|
249
|
+
id: { type: "string", minLength: 1, maxLength: 120 },
|
|
250
|
+
title: { type: "string", minLength: 1, maxLength: 300 },
|
|
251
|
+
input: { type: "object", additionalProperties: true },
|
|
252
|
+
context: { type: "string", minLength: 1, maxLength: 4000 },
|
|
253
|
+
success_criteria: {
|
|
254
|
+
type: "array",
|
|
255
|
+
minItems: 1,
|
|
256
|
+
maxItems: 20,
|
|
257
|
+
items: { type: "string", minLength: 1, maxLength: 1000 },
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
constraints: {
|
|
263
|
+
type: "array",
|
|
264
|
+
maxItems: 25,
|
|
265
|
+
items: {
|
|
266
|
+
type: "object",
|
|
267
|
+
additionalProperties: false,
|
|
268
|
+
required: ["id", "title", "description", "severity"],
|
|
269
|
+
properties: {
|
|
270
|
+
id: { type: "string", minLength: 1, maxLength: 120 },
|
|
271
|
+
title: { type: "string", minLength: 1, maxLength: 300 },
|
|
272
|
+
description: { type: "string", minLength: 1, maxLength: 2000 },
|
|
273
|
+
severity: { type: "string", enum: ["hard", "soft"] },
|
|
274
|
+
rationale: { type: "string", minLength: 1, maxLength: 2000 },
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
expected_output_shape: {
|
|
279
|
+
type: "object",
|
|
280
|
+
additionalProperties: false,
|
|
281
|
+
required: ["format", "fields"],
|
|
282
|
+
properties: {
|
|
283
|
+
format: { type: "string", enum: ["json_object", "markdown", "text"] },
|
|
284
|
+
fields: {
|
|
285
|
+
type: "array",
|
|
286
|
+
minItems: 1,
|
|
287
|
+
maxItems: 50,
|
|
288
|
+
items: {
|
|
289
|
+
type: "object",
|
|
290
|
+
additionalProperties: false,
|
|
291
|
+
required: ["path", "type", "required", "description"],
|
|
292
|
+
properties: {
|
|
293
|
+
path: { type: "string", minLength: 1, maxLength: 400 },
|
|
294
|
+
type: { type: "string", minLength: 1, maxLength: 120 },
|
|
295
|
+
required: { type: "boolean" },
|
|
296
|
+
description: { type: "string", minLength: 1, maxLength: 2000 },
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
example: {
|
|
301
|
+
oneOf: [
|
|
302
|
+
{ type: "string", minLength: 1, maxLength: 20000 },
|
|
303
|
+
{ type: "object", additionalProperties: true },
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
tags: {
|
|
309
|
+
type: "array",
|
|
310
|
+
maxItems: 30,
|
|
311
|
+
items: { type: "string", minLength: 1, maxLength: 80 },
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
};
|
|
@@ -47,7 +47,7 @@ export type LiveActivityType = 'run_started' | 'run_completed' | 'run_failed' |
|
|
|
47
47
|
* Keep in sync with emitters in auto-continue-engine.ts, autopilot-operations.ts,
|
|
48
48
|
* dispatch-lifecycle.ts, and http/index.ts.
|
|
49
49
|
*/
|
|
50
|
-
export type ActivityEventName = 'autopilot_slice_dispatched' | 'autopilot_slice_started' | 'autopilot_slice_heartbeat' | 'autopilot_slice_finished' | 'autopilot_slice_result' | 'autopilot_slice_handoff' | 'autopilot_slice_mcp_handshake_failed' | 'autopilot_slice_timeout' | 'autopilot_slice_log_stall' | 'autopilot_slice_artifact_buffered' | 'autopilot_slice_status_updates_buffered' | 'auto_continue_started' | 'auto_continue_stopped' | 'auto_continue_spawn_guard_blocked' | 'auto_continue_spawn_guard_rate_limited' | 'auto_continue_spawn_guard_rate_limit_overridden' | 'auto_continue_behavior_config_drift_detected' | 'auto_continue_behavior_config_approval_required' | 'auto_continue_behavior_automation_manual_blocked' | 'auto_continue_behavior_automation_supervised_one_shot' | 'autopilot_autofix_scheduled' | 'autopilot_autofix_executed' | 'autopilot_autofix_skipped' | 'orchestrator_dispatch' | 'autopilot_transition' | 'next_up_manual_dispatch_started' | 'scope_completed' | 'session_start' | 'session_stop' | 'heartbeat' | 'decision_buffered' | 'decision_resolved' | 'spawn_guard_degraded' | 'dashboard_run_mark_completed' | 'proof_gate_warning' | 'artifact_registered';
|
|
50
|
+
export type ActivityEventName = 'autopilot_slice_dispatched' | 'autopilot_slice_started' | 'autopilot_slice_heartbeat' | 'autopilot_slice_finished' | 'autopilot_slice_result' | 'autopilot_slice_handoff' | 'autopilot_slice_mcp_handshake_failed' | 'autopilot_slice_timeout' | 'autopilot_slice_log_stall' | 'autopilot_slice_artifact_buffered' | 'autopilot_slice_status_updates_buffered' | 'auto_continue_started' | 'auto_continue_stopped' | 'auto_continue_spawn_guard_blocked' | 'auto_continue_spawn_guard_rate_limited' | 'auto_continue_spawn_guard_rate_limit_overridden' | 'auto_continue_behavior_config_drift_detected' | 'auto_continue_behavior_config_approval_required' | 'auto_continue_behavior_automation_manual_blocked' | 'auto_continue_behavior_automation_supervised_one_shot' | 'autopilot_autofix_scheduled' | 'autopilot_autofix_executed' | 'autopilot_autofix_skipped' | 'orchestrator_dispatch' | 'autopilot_transition' | 'next_up_manual_dispatch_started' | 'scope_completed' | 'session_start' | 'session_stop' | 'heartbeat' | 'decision_buffered' | 'decision_resolved' | 'question_asked' | 'question_timeout_started' | 'question_auto_answered' | 'question_answer_applied' | 'question_answer_failed' | 'review_item_created' | 'review_item_resolved' | 'decision_auto_answer_scheduled' | 'decision_auto_answer_timeout' | 'decision_auto_answer_applied' | 'decision_auto_answer_skipped' | 'spawn_guard_degraded' | 'dashboard_run_mark_completed' | 'proof_gate_warning' | 'artifact_registered';
|
|
51
51
|
export interface LiveActivityItem {
|
|
52
52
|
id: string;
|
|
53
53
|
type: LiveActivityType;
|
|
@@ -75,7 +75,7 @@ export interface LiveActivityItem {
|
|
|
75
75
|
lastHeartbeatAt?: string | null;
|
|
76
76
|
metadata?: Record<string, unknown>;
|
|
77
77
|
}
|
|
78
|
-
export declare const KNOWN_ACTIVITY_ACTION_TYPES: readonly ["orchestrator_dispatch", "dispatch_slice", "spawn_worker", "run_heartbeat", "run_state_transition", "run_started", "run_completed", "run_failed", "slice_handoff", "decision_requested", "decision_resolved", "status_updates_applied", "status_updates_buffered", "artifact_registered", "spawn_guard_blocked", "spawn_guard_rate_limited", "behavior_config_review", "auto_fix", "auto_continue_started", "auto_continue_stopped", "milestone_completed", "workflow_error"];
|
|
78
|
+
export declare const KNOWN_ACTIVITY_ACTION_TYPES: readonly ["orchestrator_dispatch", "dispatch_slice", "spawn_worker", "run_heartbeat", "run_state_transition", "run_started", "run_completed", "run_failed", "slice_handoff", "question_asked", "question_timeout_started", "question_auto_answered", "question_answer_applied", "question_answer_failed", "decision_requested", "decision_resolved", "review_item_created", "review_item_resolved", "status_updates_applied", "status_updates_buffered", "artifact_registered", "spawn_guard_blocked", "spawn_guard_rate_limited", "behavior_config_review", "auto_fix", "auto_continue_started", "auto_continue_stopped", "autopilot_resumed", "autopilot_paused", "autopilot_blocked", "milestone_completed", "workflow_error"];
|
|
79
79
|
export type KnownActivityActionType = (typeof KNOWN_ACTIVITY_ACTION_TYPES)[number];
|
|
80
80
|
export type ActivityActionType = KnownActivityActionType | (string & {});
|
|
81
81
|
export declare const KNOWN_ACTIVITY_ACTION_PHASES: readonly ["intent", "dispatch", "execution", "handoff", "review", "completed", "blocked", "error"];
|
|
@@ -10,8 +10,15 @@ export const KNOWN_ACTIVITY_ACTION_TYPES = [
|
|
|
10
10
|
"run_completed",
|
|
11
11
|
"run_failed",
|
|
12
12
|
"slice_handoff",
|
|
13
|
+
"question_asked",
|
|
14
|
+
"question_timeout_started",
|
|
15
|
+
"question_auto_answered",
|
|
16
|
+
"question_answer_applied",
|
|
17
|
+
"question_answer_failed",
|
|
13
18
|
"decision_requested",
|
|
14
19
|
"decision_resolved",
|
|
20
|
+
"review_item_created",
|
|
21
|
+
"review_item_resolved",
|
|
15
22
|
"status_updates_applied",
|
|
16
23
|
"status_updates_buffered",
|
|
17
24
|
"artifact_registered",
|
|
@@ -21,6 +28,9 @@ export const KNOWN_ACTIVITY_ACTION_TYPES = [
|
|
|
21
28
|
"auto_fix",
|
|
22
29
|
"auto_continue_started",
|
|
23
30
|
"auto_continue_stopped",
|
|
31
|
+
"autopilot_resumed",
|
|
32
|
+
"autopilot_paused",
|
|
33
|
+
"autopilot_blocked",
|
|
24
34
|
"milestone_completed",
|
|
25
35
|
"workflow_error",
|
|
26
36
|
];
|
|
@@ -38,10 +48,22 @@ const ACTIVITY_ACTION_TYPE_ALIASES = {
|
|
|
38
48
|
orchestrator: "orchestrator_dispatch",
|
|
39
49
|
dispatch: "dispatch_slice",
|
|
40
50
|
dispatched: "dispatch_slice",
|
|
51
|
+
question: "question_asked",
|
|
52
|
+
question_timeout: "question_timeout_started",
|
|
53
|
+
question_auto_answer: "question_auto_answered",
|
|
54
|
+
decision_auto_answer: "question_auto_answered",
|
|
55
|
+
decision_auto_answer_applied: "question_answer_applied",
|
|
56
|
+
decision_auto_answer_failed: "question_answer_failed",
|
|
57
|
+
decision_auto_answer_skipped: "review_item_created",
|
|
41
58
|
start: "run_started",
|
|
42
59
|
started: "run_started",
|
|
43
60
|
stop: "auto_continue_stopped",
|
|
44
61
|
stopped: "auto_continue_stopped",
|
|
62
|
+
pause: "autopilot_paused",
|
|
63
|
+
paused: "autopilot_paused",
|
|
64
|
+
resume: "autopilot_resumed",
|
|
65
|
+
resumed: "autopilot_resumed",
|
|
66
|
+
blocked: "autopilot_blocked",
|
|
45
67
|
complete: "run_completed",
|
|
46
68
|
completed: "run_completed",
|
|
47
69
|
fail: "run_failed",
|
|
@@ -88,6 +88,19 @@ export interface KickoffContext {
|
|
|
88
88
|
decision_dedupe_enabled?: boolean;
|
|
89
89
|
decision_evidence_required_for_blocking?: boolean;
|
|
90
90
|
decision_auto_resolve_guarded_enabled?: boolean;
|
|
91
|
+
question_auto_answer_enabled?: boolean;
|
|
92
|
+
question_auto_answer_timeout_sec?: number;
|
|
93
|
+
question_auto_answer_policy?: "contextual" | "approve_non_blocking" | "defer_non_blocking";
|
|
94
|
+
question_blocking_behavior?: "require_human" | "guarded_auto_resolve_then_human";
|
|
95
|
+
question_policy_version?: number;
|
|
96
|
+
question_auto_answer_delay_seconds?: number;
|
|
97
|
+
question_auto_answer_action?: "approve" | "reject";
|
|
98
|
+
workspace_question_defaults?: {
|
|
99
|
+
question_auto_answer_enabled?: boolean;
|
|
100
|
+
question_auto_answer_timeout_sec?: number;
|
|
101
|
+
question_auto_answer_policy?: "contextual" | "approve_non_blocking" | "defer_non_blocking";
|
|
102
|
+
question_blocking_behavior?: "require_human" | "guarded_auto_resolve_then_human";
|
|
103
|
+
} | null;
|
|
91
104
|
custom_run_instructions?: string | null;
|
|
92
105
|
} | null;
|
|
93
106
|
/** Recent team activity for cross-agent awareness. */
|
|
@@ -154,6 +167,13 @@ export interface AgentRuntimeSettingsPayload {
|
|
|
154
167
|
decision_dedupe_enabled?: boolean;
|
|
155
168
|
decision_evidence_required_for_blocking?: boolean;
|
|
156
169
|
decision_auto_resolve_guarded_enabled?: boolean;
|
|
170
|
+
question_auto_answer_enabled?: boolean;
|
|
171
|
+
question_auto_answer_timeout_sec?: number;
|
|
172
|
+
question_auto_answer_policy?: "contextual" | "approve_non_blocking" | "defer_non_blocking";
|
|
173
|
+
question_blocking_behavior?: "require_human" | "guarded_auto_resolve_then_human";
|
|
174
|
+
question_policy_version?: number;
|
|
175
|
+
question_auto_answer_delay_seconds?: number;
|
|
176
|
+
question_auto_answer_action?: "approve" | "reject";
|
|
157
177
|
custom_run_instructions?: string | null;
|
|
158
178
|
}
|
|
159
179
|
export interface ClientRuntimeSettingsAgent {
|
package/dist/fs-utils.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { chmodSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
function isSafeFilePath(path) {
|
|
4
|
-
if (!path)
|
|
5
|
-
return false;
|
|
6
|
-
if (/[\u0000-\u001f\u007f]/.test(path))
|
|
7
|
-
return false;
|
|
8
|
-
if (/\\0|\\x00|\\u0000|%00/i.test(path))
|
|
9
|
-
return false;
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
3
|
function hardenPath(path, mode) {
|
|
13
4
|
try {
|
|
14
5
|
chmodSync(path, mode);
|
|
@@ -18,7 +9,7 @@ function hardenPath(path, mode) {
|
|
|
18
9
|
}
|
|
19
10
|
}
|
|
20
11
|
export function backupCorruptFileSync(targetPath) {
|
|
21
|
-
if (!
|
|
12
|
+
if (!targetPath || targetPath.includes("\0"))
|
|
22
13
|
return null;
|
|
23
14
|
const suffix = `${Date.now()}-${randomUUID().slice(0, 8)}`;
|
|
24
15
|
const backupPath = `${targetPath}.corrupt.${suffix}`;
|
|
@@ -32,9 +23,6 @@ export function backupCorruptFileSync(targetPath) {
|
|
|
32
23
|
}
|
|
33
24
|
}
|
|
34
25
|
export function writeFileAtomicSync(targetPath, content, options) {
|
|
35
|
-
if (!isSafeFilePath(targetPath)) {
|
|
36
|
-
throw new TypeError("targetPath must be a safe, non-empty file path");
|
|
37
|
-
}
|
|
38
26
|
const mode = options?.mode ?? 0o600;
|
|
39
27
|
const encoding = options?.encoding ?? "utf8";
|
|
40
28
|
const tmpPath = `${targetPath}.tmp.${process.pid}.${randomUUID().slice(0, 8)}`;
|