@useorgx/openclaw-plugin 0.7.11 → 0.7.15
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 +94 -122
- package/dashboard/dist/assets/0RUEVzJa.js +1 -0
- package/dashboard/dist/assets/0RUEVzJa.js.br +0 -0
- package/dashboard/dist/assets/0RUEVzJa.js.gz +0 -0
- package/dashboard/dist/assets/3TtV4moZ.js +1 -0
- package/dashboard/dist/assets/3TtV4moZ.js.br +0 -0
- package/dashboard/dist/assets/3TtV4moZ.js.gz +0 -0
- package/dashboard/dist/assets/3VwNyxUf.js +1 -0
- package/dashboard/dist/assets/3VwNyxUf.js.br +0 -0
- package/dashboard/dist/assets/3VwNyxUf.js.gz +0 -0
- package/dashboard/dist/assets/{beHYBbh6.js → 7DhYqBrM.js} +2 -2
- package/dashboard/dist/assets/7DhYqBrM.js.br +0 -0
- package/dashboard/dist/assets/7DhYqBrM.js.gz +0 -0
- package/dashboard/dist/assets/{tcEHYcbW.js → BCudUvwg.js} +1 -1
- package/dashboard/dist/assets/BCudUvwg.js.br +0 -0
- package/dashboard/dist/assets/BCudUvwg.js.gz +0 -0
- package/dashboard/dist/assets/BV0BcV1u.js +53 -0
- package/dashboard/dist/assets/BV0BcV1u.js.br +0 -0
- package/dashboard/dist/assets/BV0BcV1u.js.gz +0 -0
- package/dashboard/dist/assets/BVvffj0x.js +1 -0
- package/dashboard/dist/assets/BVvffj0x.js.br +0 -0
- package/dashboard/dist/assets/BVvffj0x.js.gz +0 -0
- package/dashboard/dist/assets/BiOgVMED.js +1 -0
- package/dashboard/dist/assets/BiOgVMED.js.br +0 -0
- package/dashboard/dist/assets/BiOgVMED.js.gz +0 -0
- package/dashboard/dist/assets/BjK42gtU.js +1 -0
- package/dashboard/dist/assets/BjK42gtU.js.br +0 -0
- package/dashboard/dist/assets/BjK42gtU.js.gz +0 -0
- package/dashboard/dist/assets/C-MOJWHs.js +1 -0
- package/dashboard/dist/assets/C-MOJWHs.js.br +0 -0
- package/dashboard/dist/assets/C-MOJWHs.js.gz +0 -0
- package/dashboard/dist/assets/{CD-q5mdP.js → C91KLKit.js} +1 -1
- package/dashboard/dist/assets/C91KLKit.js.br +0 -0
- package/dashboard/dist/assets/C91KLKit.js.gz +0 -0
- package/dashboard/dist/assets/{AqVoI3SF.js → C9fvfXmS.js} +1 -1
- package/dashboard/dist/assets/C9fvfXmS.js.br +0 -0
- package/dashboard/dist/assets/C9fvfXmS.js.gz +0 -0
- package/dashboard/dist/assets/CFZ4Swr5.js +1 -0
- package/dashboard/dist/assets/CFZ4Swr5.js.br +0 -0
- package/dashboard/dist/assets/CFZ4Swr5.js.gz +0 -0
- package/dashboard/dist/assets/{DCP-C7fn.js → CGj8kRhg.js} +1 -1
- package/dashboard/dist/assets/CGj8kRhg.js.br +0 -0
- package/dashboard/dist/assets/CGj8kRhg.js.gz +0 -0
- package/dashboard/dist/assets/CJjEAGFN.js +1 -0
- package/dashboard/dist/assets/CJjEAGFN.js.br +0 -0
- package/dashboard/dist/assets/CJjEAGFN.js.gz +0 -0
- package/dashboard/dist/assets/CKrH5fYO.js +1 -0
- package/dashboard/dist/assets/CKrH5fYO.js.br +0 -0
- package/dashboard/dist/assets/CKrH5fYO.js.gz +0 -0
- package/dashboard/dist/assets/CMTTPXch.js +1 -0
- package/dashboard/dist/assets/CMTTPXch.js.br +0 -0
- package/dashboard/dist/assets/CMTTPXch.js.gz +0 -0
- package/dashboard/dist/assets/CSlBSRyv.js +1 -0
- package/dashboard/dist/assets/CSlBSRyv.js.br +0 -0
- package/dashboard/dist/assets/CSlBSRyv.js.gz +0 -0
- package/dashboard/dist/assets/CnPC783_.js +1 -0
- package/dashboard/dist/assets/CnPC783_.js.br +0 -0
- package/dashboard/dist/assets/CnPC783_.js.gz +0 -0
- package/dashboard/dist/assets/Ctw95IkC.js +1 -0
- package/dashboard/dist/assets/Ctw95IkC.js.br +0 -0
- package/dashboard/dist/assets/Ctw95IkC.js.gz +0 -0
- package/dashboard/dist/assets/DHz-aQPw.js +1 -0
- package/dashboard/dist/assets/DHz-aQPw.js.br +0 -0
- package/dashboard/dist/assets/DHz-aQPw.js.gz +0 -0
- package/dashboard/dist/assets/DNX2foSJ.css +1 -0
- package/dashboard/dist/assets/DNX2foSJ.css.br +0 -0
- package/dashboard/dist/assets/DNX2foSJ.css.gz +0 -0
- package/dashboard/dist/assets/Dj2k1r16.js +8 -0
- package/dashboard/dist/assets/Dj2k1r16.js.br +0 -0
- package/dashboard/dist/assets/Dj2k1r16.js.gz +0 -0
- package/dashboard/dist/assets/DxUw4FMR.js +212 -0
- package/dashboard/dist/assets/DxUw4FMR.js.br +0 -0
- package/dashboard/dist/assets/DxUw4FMR.js.gz +0 -0
- package/dashboard/dist/assets/T2NFtzAv.js +1 -0
- package/dashboard/dist/assets/T2NFtzAv.js.br +0 -0
- package/dashboard/dist/assets/T2NFtzAv.js.gz +0 -0
- package/dashboard/dist/assets/cX2e-TLi.js +1 -0
- package/dashboard/dist/assets/cX2e-TLi.js.br +0 -0
- package/dashboard/dist/assets/cX2e-TLi.js.gz +0 -0
- package/dashboard/dist/assets/eeHXe_OQ.js +9 -0
- package/dashboard/dist/assets/eeHXe_OQ.js.br +0 -0
- package/dashboard/dist/assets/eeHXe_OQ.js.gz +0 -0
- package/dashboard/dist/assets/{Du1wfrXa.js → gZr_xKlA.js} +2 -2
- package/dashboard/dist/assets/gZr_xKlA.js.br +0 -0
- package/dashboard/dist/assets/gZr_xKlA.js.gz +0 -0
- package/dashboard/dist/brand/control-tower.png +0 -0
- package/dashboard/dist/brand/design-codex.png +0 -0
- package/dashboard/dist/brand/engineering-autopilot.png +0 -0
- package/dashboard/dist/brand/launch-captain.png +0 -0
- package/dashboard/dist/brand/orgx-logo.png +0 -0
- package/dashboard/dist/brand/pipeline-intelligence.png +0 -0
- package/dashboard/dist/brand/product-orchestrator.png +0 -0
- package/dashboard/dist/brand/xandy-orchestrator.png +0 -0
- package/dashboard/dist/index.html +8 -6
- package/dashboard/dist/index.html.br +0 -0
- package/dashboard/dist/index.html.gz +0 -0
- package/dist/hash-utils.d.ts +1 -0
- package/dist/hash-utils.js +4 -0
- package/dist/http/helpers/auto-continue-engine.js +124 -67
- package/dist/http/helpers/autopilot-slice-utils.js +112 -66
- package/dist/http/helpers/hash-utils.d.ts +1 -1
- package/dist/http/helpers/hash-utils.js +1 -1
- package/dist/http/helpers/mission-control.js +5 -2
- package/dist/http/helpers/queue-constants.d.ts +37 -0
- package/dist/http/helpers/queue-constants.js +34 -0
- package/dist/http/helpers/slice-experience-v2.js +2 -5
- package/dist/http/helpers/slice-run-projections.js +2 -5
- package/dist/http/helpers/workspace-scope.js +4 -3
- package/dist/http/index.js +101 -60
- package/dist/http/routes/chat.js +1 -21
- package/dist/http/routes/live-snapshot.js +4 -23
- package/dist/http/routes/mission-control-actions.js +2 -18
- package/dist/http/routes/mission-control-read.js +4 -107
- package/dist/lib/type-coercion.d.ts +10 -0
- package/dist/lib/type-coercion.js +82 -0
- package/dist/mcp-http-handler.js +14 -2
- package/dist/openclaw.plugin.json +1 -1
- package/dist/services/experiment-randomization.js +9 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -2
- package/dashboard/dist/assets/AqVoI3SF.js.br +0 -0
- package/dashboard/dist/assets/AqVoI3SF.js.gz +0 -0
- package/dashboard/dist/assets/BC4WvnHJ.js +0 -1
- package/dashboard/dist/assets/BC4WvnHJ.js.br +0 -0
- package/dashboard/dist/assets/BC4WvnHJ.js.gz +0 -0
- package/dashboard/dist/assets/BG5mwTkg.js +0 -1
- package/dashboard/dist/assets/BG5mwTkg.js.br +0 -0
- package/dashboard/dist/assets/BG5mwTkg.js.gz +0 -0
- package/dashboard/dist/assets/BJgZIVUQ.js +0 -53
- package/dashboard/dist/assets/BJgZIVUQ.js.br +0 -0
- package/dashboard/dist/assets/BJgZIVUQ.js.gz +0 -0
- package/dashboard/dist/assets/BNh-XYPV.js +0 -1
- package/dashboard/dist/assets/BNh-XYPV.js.br +0 -0
- package/dashboard/dist/assets/BNh-XYPV.js.gz +0 -0
- package/dashboard/dist/assets/BTAEErUY.js +0 -1
- package/dashboard/dist/assets/BTAEErUY.js.br +0 -0
- package/dashboard/dist/assets/BTAEErUY.js.gz +0 -0
- package/dashboard/dist/assets/BepW_590.js +0 -1
- package/dashboard/dist/assets/BepW_590.js.br +0 -0
- package/dashboard/dist/assets/BepW_590.js.gz +0 -0
- package/dashboard/dist/assets/BerAfzjq.js +0 -1
- package/dashboard/dist/assets/BerAfzjq.js.br +0 -0
- package/dashboard/dist/assets/BerAfzjq.js.gz +0 -0
- package/dashboard/dist/assets/Bp3N-QL5.js +0 -212
- package/dashboard/dist/assets/Bp3N-QL5.js.br +0 -0
- package/dashboard/dist/assets/Bp3N-QL5.js.gz +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js +0 -1
- package/dashboard/dist/assets/C-KIc3Wc.js.br +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js.gz +0 -0
- package/dashboard/dist/assets/C3dZRz9P.css +0 -1
- package/dashboard/dist/assets/C3dZRz9P.css.br +0 -0
- package/dashboard/dist/assets/C3dZRz9P.css.gz +0 -0
- package/dashboard/dist/assets/CD-q5mdP.js.br +0 -0
- package/dashboard/dist/assets/CD-q5mdP.js.gz +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js +0 -1
- package/dashboard/dist/assets/CL_wXqR7.js.br +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js.gz +0 -0
- package/dashboard/dist/assets/CdvjC9G9.js +0 -1
- package/dashboard/dist/assets/CdvjC9G9.js.br +0 -0
- package/dashboard/dist/assets/CdvjC9G9.js.gz +0 -0
- package/dashboard/dist/assets/Ck2agw-s.js +0 -1
- package/dashboard/dist/assets/Ck2agw-s.js.br +0 -0
- package/dashboard/dist/assets/Ck2agw-s.js.gz +0 -0
- package/dashboard/dist/assets/CxQ08qFN.js +0 -9
- package/dashboard/dist/assets/CxQ08qFN.js.br +0 -0
- package/dashboard/dist/assets/CxQ08qFN.js.gz +0 -0
- package/dashboard/dist/assets/D2CH1H6k.js +0 -1
- package/dashboard/dist/assets/D2CH1H6k.js.br +0 -0
- package/dashboard/dist/assets/D2CH1H6k.js.gz +0 -0
- package/dashboard/dist/assets/D9esz7jd.js +0 -1
- package/dashboard/dist/assets/D9esz7jd.js.br +0 -0
- package/dashboard/dist/assets/D9esz7jd.js.gz +0 -0
- package/dashboard/dist/assets/DCP-C7fn.js.br +0 -0
- package/dashboard/dist/assets/DCP-C7fn.js.gz +0 -0
- package/dashboard/dist/assets/DJASCd69.js +0 -1
- package/dashboard/dist/assets/DJASCd69.js.br +0 -0
- package/dashboard/dist/assets/DJASCd69.js.gz +0 -0
- package/dashboard/dist/assets/Dm9AybAp.js +0 -1
- package/dashboard/dist/assets/Dm9AybAp.js.br +0 -0
- package/dashboard/dist/assets/Dm9AybAp.js.gz +0 -0
- package/dashboard/dist/assets/Du1wfrXa.js.br +0 -0
- package/dashboard/dist/assets/Du1wfrXa.js.gz +0 -0
- package/dashboard/dist/assets/beHYBbh6.js.br +0 -0
- package/dashboard/dist/assets/beHYBbh6.js.gz +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js +0 -8
- package/dashboard/dist/assets/cNrhgGc1.js.br +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js.gz +0 -0
- package/dashboard/dist/assets/tcEHYcbW.js.br +0 -0
- package/dashboard/dist/assets/tcEHYcbW.js.gz +0 -0
|
@@ -159,7 +159,57 @@ export function ensureAutopilotSliceSchemaPath(schemaFilename) {
|
|
|
159
159
|
}
|
|
160
160
|
export function parseSliceResult(raw) {
|
|
161
161
|
const allowedStatuses = new Set(["completed", "blocked", "needs_decision", "error"]);
|
|
162
|
+
const normalizeStatusValue = (value) => {
|
|
163
|
+
if (typeof value !== "string")
|
|
164
|
+
return "";
|
|
165
|
+
const normalized = value.trim().toLowerCase();
|
|
166
|
+
return allowedStatuses.has(normalized) ? normalized : "";
|
|
167
|
+
};
|
|
162
168
|
const stripUtf8Bom = (text) => text.replace(/^\uFEFF/, "");
|
|
169
|
+
const extractTopLevelObjects = (text) => {
|
|
170
|
+
let inString = false;
|
|
171
|
+
let escaped = false;
|
|
172
|
+
let depth = 0;
|
|
173
|
+
let start = -1;
|
|
174
|
+
const objects = [];
|
|
175
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
176
|
+
const ch = text[i];
|
|
177
|
+
if (inString) {
|
|
178
|
+
if (escaped) {
|
|
179
|
+
escaped = false;
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
if (ch === "\\") {
|
|
183
|
+
escaped = true;
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
if (ch === "\"") {
|
|
187
|
+
inString = false;
|
|
188
|
+
}
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (ch === "\"") {
|
|
192
|
+
inString = true;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (ch === "{") {
|
|
196
|
+
if (depth === 0)
|
|
197
|
+
start = i;
|
|
198
|
+
depth += 1;
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
if (ch === "}") {
|
|
202
|
+
if (depth <= 0)
|
|
203
|
+
continue;
|
|
204
|
+
depth -= 1;
|
|
205
|
+
if (depth === 0 && start >= 0) {
|
|
206
|
+
objects.push(text.slice(start, i + 1));
|
|
207
|
+
start = -1;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return objects;
|
|
212
|
+
};
|
|
163
213
|
const extractMarkdownJsonFences = (text) => {
|
|
164
214
|
const matches = text.matchAll(/```(?:json)?\s*([\s\S]*?)\s*```/gi);
|
|
165
215
|
const fences = [];
|
|
@@ -192,13 +242,20 @@ export function parseSliceResult(raw) {
|
|
|
192
242
|
return normalizeSliceResult(parsedInner);
|
|
193
243
|
}
|
|
194
244
|
}
|
|
245
|
+
const objectCandidates = extractTopLevelObjects(normalized);
|
|
246
|
+
for (let i = objectCandidates.length - 1; i >= 0; i -= 1) {
|
|
247
|
+
const parsedObject = parseJsonSafe(stripUtf8Bom(objectCandidates[i]));
|
|
248
|
+
if (parsedObject && typeof parsedObject === "object" && isLikelySliceResult(parsedObject)) {
|
|
249
|
+
return normalizeSliceResult(parsedObject);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
195
252
|
return null;
|
|
196
253
|
};
|
|
197
254
|
const isLikelySliceResult = (value) => {
|
|
198
255
|
if (!value || typeof value !== "object")
|
|
199
256
|
return false;
|
|
200
257
|
const record = value;
|
|
201
|
-
const status =
|
|
258
|
+
const status = normalizeStatusValue(record.status);
|
|
202
259
|
const workstreamId = typeof record.workstream_id === "string" ? record.workstream_id : "";
|
|
203
260
|
const summary = typeof record.summary === "string" ? record.summary : "";
|
|
204
261
|
return (allowedStatuses.has(status) &&
|
|
@@ -207,10 +264,13 @@ export function parseSliceResult(raw) {
|
|
|
207
264
|
};
|
|
208
265
|
const normalizeSliceResult = (value) => {
|
|
209
266
|
const record = value;
|
|
210
|
-
const status =
|
|
267
|
+
const status = normalizeStatusValue(record.status);
|
|
211
268
|
const decisions = record.decisions_needed;
|
|
212
269
|
let changed = false;
|
|
213
|
-
let nextRecord = record;
|
|
270
|
+
let nextRecord = status ? { ...record, status } : record;
|
|
271
|
+
if (status && record.status !== status) {
|
|
272
|
+
changed = true;
|
|
273
|
+
}
|
|
214
274
|
if (Array.isArray(decisions)) {
|
|
215
275
|
const normalized = decisions.map((decision) => {
|
|
216
276
|
if (!decision || typeof decision !== "object")
|
|
@@ -275,7 +335,11 @@ export function parseSliceResult(raw) {
|
|
|
275
335
|
const record = value;
|
|
276
336
|
const parseEmbeddedText = (candidate) => {
|
|
277
337
|
if (typeof candidate === "string") {
|
|
278
|
-
|
|
338
|
+
const direct = parseSliceJsonText(candidate);
|
|
339
|
+
if (direct)
|
|
340
|
+
return direct;
|
|
341
|
+
// Some envelopes embed worker logs/prose with a trailing JSON object.
|
|
342
|
+
return parseSliceResult(candidate);
|
|
279
343
|
}
|
|
280
344
|
if (Array.isArray(candidate)) {
|
|
281
345
|
for (let i = candidate.length - 1; i >= 0; i -= 1) {
|
|
@@ -288,12 +352,6 @@ export function parseSliceResult(raw) {
|
|
|
288
352
|
if (!candidate || typeof candidate !== "object")
|
|
289
353
|
return null;
|
|
290
354
|
const candidateRecord = candidate;
|
|
291
|
-
if (typeof candidateRecord.value === "string") {
|
|
292
|
-
return parseSliceJsonText(candidateRecord.value);
|
|
293
|
-
}
|
|
294
|
-
if (typeof candidateRecord.text === "string") {
|
|
295
|
-
return parseSliceJsonText(candidateRecord.text);
|
|
296
|
-
}
|
|
297
355
|
const fromValue = parseEmbeddedText(candidateRecord.value);
|
|
298
356
|
if (fromValue)
|
|
299
357
|
return fromValue;
|
|
@@ -392,50 +450,6 @@ export function parseSliceResult(raw) {
|
|
|
392
450
|
if (directTextParsed && typeof directTextParsed === "object")
|
|
393
451
|
return directTextParsed;
|
|
394
452
|
// Tolerant parse: extract the last complete top-level JSON object from mixed logs.
|
|
395
|
-
const extractTopLevelObjects = (text) => {
|
|
396
|
-
let inString = false;
|
|
397
|
-
let escaped = false;
|
|
398
|
-
let depth = 0;
|
|
399
|
-
let start = -1;
|
|
400
|
-
const objects = [];
|
|
401
|
-
for (let i = 0; i < text.length; i += 1) {
|
|
402
|
-
const ch = text[i];
|
|
403
|
-
if (inString) {
|
|
404
|
-
if (escaped) {
|
|
405
|
-
escaped = false;
|
|
406
|
-
continue;
|
|
407
|
-
}
|
|
408
|
-
if (ch === "\\") {
|
|
409
|
-
escaped = true;
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
if (ch === "\"") {
|
|
413
|
-
inString = false;
|
|
414
|
-
}
|
|
415
|
-
continue;
|
|
416
|
-
}
|
|
417
|
-
if (ch === "\"") {
|
|
418
|
-
inString = true;
|
|
419
|
-
continue;
|
|
420
|
-
}
|
|
421
|
-
if (ch === "{") {
|
|
422
|
-
if (depth === 0)
|
|
423
|
-
start = i;
|
|
424
|
-
depth += 1;
|
|
425
|
-
continue;
|
|
426
|
-
}
|
|
427
|
-
if (ch === "}") {
|
|
428
|
-
if (depth <= 0)
|
|
429
|
-
continue;
|
|
430
|
-
depth -= 1;
|
|
431
|
-
if (depth === 0 && start >= 0) {
|
|
432
|
-
objects.push(text.slice(start, i + 1));
|
|
433
|
-
start = -1;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
return objects;
|
|
438
|
-
};
|
|
439
453
|
const candidates = extractTopLevelObjects(trimmed);
|
|
440
454
|
for (let i = candidates.length - 1; i >= 0; i -= 1) {
|
|
441
455
|
const candidate = candidates[i];
|
|
@@ -481,24 +495,56 @@ const UUID_RE = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;
|
|
|
481
495
|
export function extractSessionIdFromOutput(raw, _sourceClient) {
|
|
482
496
|
if (!raw || typeof raw !== "string")
|
|
483
497
|
return null;
|
|
498
|
+
const extractUuid = (value) => {
|
|
499
|
+
const match = value.trim().match(UUID_RE);
|
|
500
|
+
return match?.[0] ?? null;
|
|
501
|
+
};
|
|
502
|
+
const findSessionId = (candidate) => {
|
|
503
|
+
if (!candidate)
|
|
504
|
+
return null;
|
|
505
|
+
if (typeof candidate === "string") {
|
|
506
|
+
const parsedCandidate = parseJsonSafe(candidate.trim());
|
|
507
|
+
if (parsedCandidate)
|
|
508
|
+
return findSessionId(parsedCandidate);
|
|
509
|
+
return null;
|
|
510
|
+
}
|
|
511
|
+
if (Array.isArray(candidate)) {
|
|
512
|
+
for (const item of candidate) {
|
|
513
|
+
const found = findSessionId(item);
|
|
514
|
+
if (found)
|
|
515
|
+
return found;
|
|
516
|
+
}
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
if (typeof candidate !== "object")
|
|
520
|
+
return null;
|
|
521
|
+
const record = candidate;
|
|
522
|
+
for (const key of ["session_id", "sessionId", "conversation_id"]) {
|
|
523
|
+
const value = record[key];
|
|
524
|
+
if (typeof value === "string") {
|
|
525
|
+
const uuid = extractUuid(value);
|
|
526
|
+
if (uuid)
|
|
527
|
+
return uuid;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return (findSessionId(record.value) ??
|
|
531
|
+
findSessionId(record.text) ??
|
|
532
|
+
findSessionId(record.content) ??
|
|
533
|
+
findSessionId(record.output_text) ??
|
|
534
|
+
null);
|
|
535
|
+
};
|
|
484
536
|
const parsed = parseJsonSafe(raw.trim());
|
|
485
537
|
if (parsed && typeof parsed === "object") {
|
|
486
|
-
|
|
487
|
-
const candidates = [
|
|
538
|
+
const found = findSessionId([
|
|
488
539
|
parsed,
|
|
489
540
|
parsed.result,
|
|
490
541
|
parsed.structured_output,
|
|
491
542
|
parsed.final_output,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
for (const key of ["session_id", "sessionId", "conversation_id"]) {
|
|
498
|
-
const value = record[key];
|
|
499
|
-
if (typeof value === "string" && UUID_RE.test(value))
|
|
500
|
-
return value.trim();
|
|
501
|
-
}
|
|
543
|
+
parsed.output_text,
|
|
544
|
+
parsed.output,
|
|
545
|
+
]);
|
|
546
|
+
if (found) {
|
|
547
|
+
return found;
|
|
502
548
|
}
|
|
503
549
|
}
|
|
504
550
|
// Fallback: scan raw text for session_id: <uuid> pattern
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { idempotencyKey, stableHash } from "../../hash-utils.js";
|
|
1
|
+
export { deterministicActivityId, idempotencyKey, stableHash } from "../../hash-utils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { idempotencyKey, stableHash } from "../../hash-utils.js";
|
|
1
|
+
export { deterministicActivityId, idempotencyKey, stableHash } from "../../hash-utils.js";
|
|
@@ -79,6 +79,9 @@ export function safeErrorMessage(err) {
|
|
|
79
79
|
const sanitized = stripStructuredNoise(normalizedMessage);
|
|
80
80
|
const normalized = sanitized.toLowerCase();
|
|
81
81
|
if (normalized.length > 0) {
|
|
82
|
+
if (normalized.includes("relation does not exist")) {
|
|
83
|
+
return sanitized;
|
|
84
|
+
}
|
|
82
85
|
if (normalized.includes("internal_error") || normalized.includes("internal server error")) {
|
|
83
86
|
return "temporary server issue";
|
|
84
87
|
}
|
|
@@ -705,10 +708,10 @@ export async function listEntitiesSafe(client, type, filters) {
|
|
|
705
708
|
}
|
|
706
709
|
}
|
|
707
710
|
export async function buildMissionControlGraph(client, initiativeId, options) {
|
|
711
|
+
const degraded = [];
|
|
708
712
|
if (!UUID_RE.test(initiativeId)) {
|
|
709
|
-
|
|
713
|
+
degraded.push(`initiative id "${initiativeId}" is non-UUID; using compatibility graph lookup`);
|
|
710
714
|
}
|
|
711
|
-
const degraded = [];
|
|
712
715
|
const preloadedInitiative = options?.initiativeEntity ?? null;
|
|
713
716
|
const [initiativeResult, workstreamResult, milestoneResult, taskResult] = await Promise.all([
|
|
714
717
|
preloadedInitiative
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Queue state for next-up items (workstream-level). */
|
|
2
|
+
export declare const QueueState: {
|
|
3
|
+
readonly QUEUED: "queued";
|
|
4
|
+
readonly RUNNING: "running";
|
|
5
|
+
readonly BLOCKED: "blocked";
|
|
6
|
+
readonly IDLE: "idle";
|
|
7
|
+
/** Used only in the API normalization layer (mission-control-read.ts). */
|
|
8
|
+
readonly COMPLETED: "completed";
|
|
9
|
+
};
|
|
10
|
+
/** Core queue states used by the queue builder (excludes "completed"). */
|
|
11
|
+
export type CoreQueueState = "queued" | "running" | "blocked" | "idle";
|
|
12
|
+
/** Extended queue state including API-only values. */
|
|
13
|
+
export type QueueStateValue = (typeof QueueState)[keyof typeof QueueState];
|
|
14
|
+
/** Auto-continue lane state (per-workstream within a run). */
|
|
15
|
+
export declare const LaneState: {
|
|
16
|
+
readonly IDLE: "idle";
|
|
17
|
+
readonly RUNNING: "running";
|
|
18
|
+
readonly BLOCKED: "blocked";
|
|
19
|
+
readonly WAITING_DEPENDENCY: "waiting_dependency";
|
|
20
|
+
readonly RATE_LIMITED: "rate_limited";
|
|
21
|
+
readonly COMPLETED: "completed";
|
|
22
|
+
};
|
|
23
|
+
export type LaneStateValue = (typeof LaneState)[keyof typeof LaneState];
|
|
24
|
+
/** Auto-continue run status. */
|
|
25
|
+
export declare const RunStatus: {
|
|
26
|
+
readonly RUNNING: "running";
|
|
27
|
+
readonly STOPPING: "stopping";
|
|
28
|
+
readonly STOPPED: "stopped";
|
|
29
|
+
};
|
|
30
|
+
export type RunStatusValue = (typeof RunStatus)[keyof typeof RunStatus];
|
|
31
|
+
/** Runner source — how the agent was assigned. */
|
|
32
|
+
export declare const RunnerSource: {
|
|
33
|
+
readonly ASSIGNED: "assigned";
|
|
34
|
+
readonly INFERRED: "inferred";
|
|
35
|
+
readonly FALLBACK: "fallback";
|
|
36
|
+
};
|
|
37
|
+
export type RunnerSourceValue = (typeof RunnerSource)[keyof typeof RunnerSource];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Canonical state constants for queue, lane, and related enumerations.
|
|
3
|
+
// Use these instead of raw string literals throughout the codebase.
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
/** Queue state for next-up items (workstream-level). */
|
|
6
|
+
export const QueueState = {
|
|
7
|
+
QUEUED: "queued",
|
|
8
|
+
RUNNING: "running",
|
|
9
|
+
BLOCKED: "blocked",
|
|
10
|
+
IDLE: "idle",
|
|
11
|
+
/** Used only in the API normalization layer (mission-control-read.ts). */
|
|
12
|
+
COMPLETED: "completed",
|
|
13
|
+
};
|
|
14
|
+
/** Auto-continue lane state (per-workstream within a run). */
|
|
15
|
+
export const LaneState = {
|
|
16
|
+
IDLE: "idle",
|
|
17
|
+
RUNNING: "running",
|
|
18
|
+
BLOCKED: "blocked",
|
|
19
|
+
WAITING_DEPENDENCY: "waiting_dependency",
|
|
20
|
+
RATE_LIMITED: "rate_limited",
|
|
21
|
+
COMPLETED: "completed",
|
|
22
|
+
};
|
|
23
|
+
/** Auto-continue run status. */
|
|
24
|
+
export const RunStatus = {
|
|
25
|
+
RUNNING: "running",
|
|
26
|
+
STOPPING: "stopping",
|
|
27
|
+
STOPPED: "stopped",
|
|
28
|
+
};
|
|
29
|
+
/** Runner source — how the agent was assigned. */
|
|
30
|
+
export const RunnerSource = {
|
|
31
|
+
ASSIGNED: "assigned",
|
|
32
|
+
INFERRED: "inferred",
|
|
33
|
+
FALLBACK: "fallback",
|
|
34
|
+
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import { asRecord } from "../../lib/type-coercion.js";
|
|
1
2
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
2
3
|
const GENERIC_ACTOR_IDS = new Set(["main", "unknown", "system", "openclaw", "orgx"]);
|
|
3
|
-
|
|
4
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
5
|
-
return null;
|
|
6
|
-
return value;
|
|
7
|
-
}
|
|
4
|
+
// asRecord imported from ../../lib/type-coercion.js
|
|
8
5
|
function normalizeText(value) {
|
|
9
6
|
if (typeof value !== "string")
|
|
10
7
|
return null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { asRecord } from "../../lib/type-coercion.js";
|
|
1
2
|
const TERMINAL_STATES = new Set([
|
|
2
3
|
"completed",
|
|
3
4
|
"needs_review",
|
|
@@ -5,11 +6,7 @@ const TERMINAL_STATES = new Set([
|
|
|
5
6
|
"archived",
|
|
6
7
|
]);
|
|
7
8
|
const RUN_LIKE_STATUS = new Set(["dispatching", "running"]);
|
|
8
|
-
|
|
9
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
10
|
-
return null;
|
|
11
|
-
return value;
|
|
12
|
-
}
|
|
9
|
+
// asRecord imported from ../../lib/type-coercion.js
|
|
13
10
|
function normalizeText(value) {
|
|
14
11
|
if (typeof value !== "string")
|
|
15
12
|
return null;
|
|
@@ -70,20 +70,21 @@ export function workspaceScopeFromHeaders(headers) {
|
|
|
70
70
|
"x-orgx-command-center-id",
|
|
71
71
|
"x_orgx_command_center_id",
|
|
72
72
|
]);
|
|
73
|
+
const centerId = readScopeValue(headers, ["center"]);
|
|
73
74
|
if (workspaceId && commandCenterId && workspaceId !== commandCenterId) {
|
|
74
75
|
return {
|
|
75
76
|
workspace_id: workspaceId,
|
|
76
77
|
command_center_id: commandCenterId,
|
|
77
|
-
center: workspaceId,
|
|
78
|
+
center: centerId ?? workspaceId,
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
const canonical = workspaceId ?? commandCenterId;
|
|
81
|
+
const canonical = workspaceId ?? commandCenterId ?? centerId;
|
|
81
82
|
if (!canonical)
|
|
82
83
|
return null;
|
|
83
84
|
return {
|
|
84
85
|
workspace_id: canonical,
|
|
85
86
|
command_center_id: canonical,
|
|
86
|
-
center: canonical,
|
|
87
|
+
center: centerId ?? canonical,
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
90
|
function mergeCandidates(payloadCandidates, queryCandidates) {
|