omnius 1.0.564 → 1.0.566
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/index.js +542 -150
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55754,10 +55754,10 @@ var init_parser = __esm({
|
|
|
55754
55754
|
* the separator character will only be read on index > 0 (see
|
|
55755
55755
|
* readIPv4Addr for an example)
|
|
55756
55756
|
*/
|
|
55757
|
-
readSeparator(
|
|
55757
|
+
readSeparator(sep11, index, inner) {
|
|
55758
55758
|
return this.readAtomically(() => {
|
|
55759
55759
|
if (index > 0) {
|
|
55760
|
-
if (this.readGivenChar(
|
|
55760
|
+
if (this.readGivenChar(sep11) === void 0) {
|
|
55761
55761
|
return void 0;
|
|
55762
55762
|
}
|
|
55763
55763
|
}
|
|
@@ -115474,8 +115474,8 @@ var require_follow_redirects = __commonJS({
|
|
|
115474
115474
|
}
|
|
115475
115475
|
return parsed;
|
|
115476
115476
|
}
|
|
115477
|
-
function resolveUrl(
|
|
115478
|
-
return useNativeURL ? new URL3(
|
|
115477
|
+
function resolveUrl(relative24, base3) {
|
|
115478
|
+
return useNativeURL ? new URL3(relative24, base3) : parseUrl(url.resolve(base3, relative24));
|
|
115479
115479
|
}
|
|
115480
115480
|
function validateUrl(input) {
|
|
115481
115481
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -274249,15 +274249,15 @@ var require_pattern = __commonJS({
|
|
|
274249
274249
|
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
274250
274250
|
function partitionAbsoluteAndRelative(patterns) {
|
|
274251
274251
|
const absolute = [];
|
|
274252
|
-
const
|
|
274252
|
+
const relative24 = [];
|
|
274253
274253
|
for (const pattern of patterns) {
|
|
274254
274254
|
if (isAbsolute18(pattern)) {
|
|
274255
274255
|
absolute.push(pattern);
|
|
274256
274256
|
} else {
|
|
274257
|
-
|
|
274257
|
+
relative24.push(pattern);
|
|
274258
274258
|
}
|
|
274259
274259
|
}
|
|
274260
|
-
return [absolute,
|
|
274260
|
+
return [absolute, relative24];
|
|
274261
274261
|
}
|
|
274262
274262
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
274263
274263
|
function isAbsolute18(pattern) {
|
|
@@ -295165,8 +295165,8 @@ function formatLocalDateTime(date) {
|
|
|
295165
295165
|
timeZoneName: "short"
|
|
295166
295166
|
}).format(date);
|
|
295167
295167
|
}
|
|
295168
|
-
function withAbsoluteDue(
|
|
295169
|
-
return `${
|
|
295168
|
+
function withAbsoluteDue(relative24, target) {
|
|
295169
|
+
return `${relative24} (${formatLocalDateTime(target)})`;
|
|
295170
295170
|
}
|
|
295171
295171
|
function parseRelativeDueTime(input, now2) {
|
|
295172
295172
|
const lower = input.toLowerCase().trim().replace(/[.!?]+$/g, "").replace(/\s+/g, " ");
|
|
@@ -295191,11 +295191,11 @@ function parseRelativeDueTime(input, now2) {
|
|
|
295191
295191
|
function parseDueTime(due) {
|
|
295192
295192
|
const lower = due.toLowerCase().trim();
|
|
295193
295193
|
const now2 = /* @__PURE__ */ new Date();
|
|
295194
|
-
const
|
|
295195
|
-
if (
|
|
295194
|
+
const relative24 = parseRelativeDueTime(lower, now2);
|
|
295195
|
+
if (relative24) {
|
|
295196
295196
|
return {
|
|
295197
|
-
isoDate:
|
|
295198
|
-
description: withAbsoluteDue(
|
|
295197
|
+
isoDate: relative24.target.toISOString(),
|
|
295198
|
+
description: withAbsoluteDue(relative24.description, relative24.target)
|
|
295199
295199
|
};
|
|
295200
295200
|
}
|
|
295201
295201
|
if (lower === "tomorrow") {
|
|
@@ -300559,6 +300559,103 @@ function coerceStringList(value2) {
|
|
|
300559
300559
|
const out = value2.filter((item) => typeof item === "string" && item.trim().length > 0).map((item) => item.trim());
|
|
300560
300560
|
return out.length > 0 ? Array.from(new Set(out)) : void 0;
|
|
300561
300561
|
}
|
|
300562
|
+
function normalizeDeclaredVerifyCommand(value2) {
|
|
300563
|
+
if (typeof value2 !== "string")
|
|
300564
|
+
return {};
|
|
300565
|
+
if (!value2.trim())
|
|
300566
|
+
return { command: "" };
|
|
300567
|
+
if (/[\r\n]/.test(value2)) {
|
|
300568
|
+
return { error: "must be one shell command, without line breaks" };
|
|
300569
|
+
}
|
|
300570
|
+
let command = value2.trim();
|
|
300571
|
+
let repairNote;
|
|
300572
|
+
const inlineCode = /^`([^`]+)`$/.exec(command);
|
|
300573
|
+
if (inlineCode) {
|
|
300574
|
+
command = inlineCode[1].trim();
|
|
300575
|
+
repairNote = "removed Markdown backticks around verifyCommand";
|
|
300576
|
+
}
|
|
300577
|
+
if (looksLikeVerifierResultProse(command)) {
|
|
300578
|
+
return {
|
|
300579
|
+
error: "must be the executable command only, not a claimed result (for example use `pio run -e esp32`, not `pio run -e esp32 -> SUCCESS`)"
|
|
300580
|
+
};
|
|
300581
|
+
}
|
|
300582
|
+
const fallback = stripTopLevelFallback(command);
|
|
300583
|
+
if (fallback.removed) {
|
|
300584
|
+
command = fallback.command;
|
|
300585
|
+
repairNote = "removed a `||` fallback from verifyCommand so its exit status remains meaningful";
|
|
300586
|
+
}
|
|
300587
|
+
if (!command) {
|
|
300588
|
+
return { error: "must include an executable command before any fallback" };
|
|
300589
|
+
}
|
|
300590
|
+
const unsafeSyntax = unsupportedVerifierShellSyntax(command);
|
|
300591
|
+
if (unsafeSyntax) {
|
|
300592
|
+
return { error: unsafeSyntax };
|
|
300593
|
+
}
|
|
300594
|
+
return { command, repairNote };
|
|
300595
|
+
}
|
|
300596
|
+
function looksLikeVerifierResultProse(command) {
|
|
300597
|
+
const result = "(?:success(?:ful(?:ly)?)?|succeed(?:ed|s)?|pass(?:ed)?|ok|done|fail(?:ed|ure)?|error)";
|
|
300598
|
+
const trailingResult = new RegExp(String.raw`(?:\s*(?:->|=>|→|⇒|—)\s*|\s*:\s*|\s+\(|\s+\[)${result}(?:\)|\])?\s*$`, "i");
|
|
300599
|
+
if (trailingResult.test(command))
|
|
300600
|
+
return true;
|
|
300601
|
+
const inlineResult = new RegExp(String.raw`(?:->|=>|→|⇒|—)\s*${result}\b|\b${result}\b\s+(?:on|for|in|with)\b`, "i");
|
|
300602
|
+
if (inlineResult.test(command))
|
|
300603
|
+
return true;
|
|
300604
|
+
if (/\s+\((?:compiles?|compiled|builds?|built|passes?|passed|works?|working|succeeds?|succeeded|success(?:fully)?)\b[^)]*\)\s*$/i.test(command)) {
|
|
300605
|
+
return true;
|
|
300606
|
+
}
|
|
300607
|
+
if (/^(?:verify(?:\s+command)?|verification|command|result|status)\s*[:=-]/i.test(command)) {
|
|
300608
|
+
return true;
|
|
300609
|
+
}
|
|
300610
|
+
return /^(?:the\s+)?(?:build|tests?|verification)\s+(?:has\s+)?(?:passed|succeeded|failed|is\s+successful)\b/i.test(command);
|
|
300611
|
+
}
|
|
300612
|
+
function stripTopLevelFallback(command) {
|
|
300613
|
+
let quote2 = null;
|
|
300614
|
+
for (let index = 0; index < command.length - 1; index++) {
|
|
300615
|
+
const ch = command[index];
|
|
300616
|
+
if (quote2) {
|
|
300617
|
+
if (ch === quote2 && command[index - 1] !== "\\")
|
|
300618
|
+
quote2 = null;
|
|
300619
|
+
continue;
|
|
300620
|
+
}
|
|
300621
|
+
if (ch === "'" || ch === '"') {
|
|
300622
|
+
quote2 = ch;
|
|
300623
|
+
continue;
|
|
300624
|
+
}
|
|
300625
|
+
if (ch === "|" && command[index + 1] === "|") {
|
|
300626
|
+
return { command: command.slice(0, index).trim(), removed: true };
|
|
300627
|
+
}
|
|
300628
|
+
}
|
|
300629
|
+
return { command, removed: false };
|
|
300630
|
+
}
|
|
300631
|
+
function unsupportedVerifierShellSyntax(command) {
|
|
300632
|
+
let quote2 = null;
|
|
300633
|
+
for (let index = 0; index < command.length; index++) {
|
|
300634
|
+
const ch = command[index];
|
|
300635
|
+
if (quote2) {
|
|
300636
|
+
if (ch === quote2 && command[index - 1] !== "\\")
|
|
300637
|
+
quote2 = null;
|
|
300638
|
+
continue;
|
|
300639
|
+
}
|
|
300640
|
+
if (ch === "'" || ch === '"') {
|
|
300641
|
+
quote2 = ch;
|
|
300642
|
+
continue;
|
|
300643
|
+
}
|
|
300644
|
+
if (ch === "|") {
|
|
300645
|
+
return "must not use a pipeline; its final status may hide a failed verifier";
|
|
300646
|
+
}
|
|
300647
|
+
if (ch === ";") {
|
|
300648
|
+
return "must not chain commands with `;`; use a single command or a failure-preserving `&&` suffix";
|
|
300649
|
+
}
|
|
300650
|
+
if (ch === "&" && command[index + 1] !== "&" && command[index - 1] !== "&" && !isFileDescriptorRedirectionAmpersand(command, index)) {
|
|
300651
|
+
return "must not background the verifier";
|
|
300652
|
+
}
|
|
300653
|
+
}
|
|
300654
|
+
return null;
|
|
300655
|
+
}
|
|
300656
|
+
function isFileDescriptorRedirectionAmpersand(command, index) {
|
|
300657
|
+
return command[index - 1] === ">" && /[0-9-]/.test(command[index + 1] ?? "");
|
|
300658
|
+
}
|
|
300562
300659
|
function todoChildrenByParent(todos) {
|
|
300563
300660
|
const ids = new Set(todos.map((todo) => todo.id).filter((id2) => typeof id2 === "string" && id2.trim().length > 0));
|
|
300564
300661
|
const byParent = /* @__PURE__ */ new Map();
|
|
@@ -300889,7 +300986,7 @@ Mark tasks complete IMMEDIATELY after finishing — don't batch. Never mark comp
|
|
|
300889
300986
|
},
|
|
300890
300987
|
verifyCommand: {
|
|
300891
300988
|
type: "string",
|
|
300892
|
-
description: "REG-37: optional shell command that PROVES this todo is complete. When you mark this todo 'completed', the orchestrator checks recent shell history; if
|
|
300989
|
+
description: "REG-37: optional executable shell command that PROVES this todo is complete. Enter only the command (e.g. 'tsc --noEmit', 'test -d dist', 'pytest tests/x.py') — never result prose such as 'pio run -> SUCCESS'. When you mark this todo 'completed', the orchestrator checks recent shell history; if this command has not run successfully recently, you'll be prompted to run it before completion is accepted. Pipelines and success-masking fallbacks are not valid verifier evidence."
|
|
300893
300990
|
},
|
|
300894
300991
|
declaredArtifacts: {
|
|
300895
300992
|
type: "array",
|
|
@@ -300971,6 +301068,18 @@ Mark tasks complete IMMEDIATELY after finishing — don't batch. Never mark comp
|
|
|
300971
301068
|
durationMs: performance.now() - start2
|
|
300972
301069
|
};
|
|
300973
301070
|
}
|
|
301071
|
+
const declaredVerifier = normalizeDeclaredVerifyCommand(entry["verifyCommand"]);
|
|
301072
|
+
if (declaredVerifier.error) {
|
|
301073
|
+
return {
|
|
301074
|
+
success: false,
|
|
301075
|
+
output: "",
|
|
301076
|
+
error: `invalid verifyCommand for todo "${content.slice(0, 80)}": ` + declaredVerifier.error,
|
|
301077
|
+
durationMs: performance.now() - start2
|
|
301078
|
+
};
|
|
301079
|
+
}
|
|
301080
|
+
if (declaredVerifier.repairNote) {
|
|
301081
|
+
repairNotes.push(declaredVerifier.repairNote);
|
|
301082
|
+
}
|
|
300974
301083
|
incoming.push({
|
|
300975
301084
|
id: typeof entry["id"] === "string" ? entry["id"] : void 0,
|
|
300976
301085
|
content,
|
|
@@ -300982,7 +301091,7 @@ Mark tasks complete IMMEDIATELY after finishing — don't batch. Never mark comp
|
|
|
300982
301091
|
blocks: coerceStringList(entry["blocks"]),
|
|
300983
301092
|
blockedBy: coerceStringList(entry["blockedBy"] ?? entry["dependsOn"]),
|
|
300984
301093
|
// REG-37: verification-aware planning
|
|
300985
|
-
verifyCommand:
|
|
301094
|
+
verifyCommand: declaredVerifier.command,
|
|
300986
301095
|
// REG-38: declared artifact list for supervisor inspection
|
|
300987
301096
|
declaredArtifacts: Array.isArray(entry["declaredArtifacts"]) ? entry["declaredArtifacts"].filter((x) => typeof x === "string") : void 0
|
|
300988
301097
|
});
|
|
@@ -301014,11 +301123,13 @@ Mark tasks complete IMMEDIATELY after finishing — don't batch. Never mark comp
|
|
|
301014
301123
|
const oldKey = canonicalize2(oldTodos);
|
|
301015
301124
|
const newKey = canonicalize2(incoming);
|
|
301016
301125
|
if (oldKey === newKey && oldTodos.length > 0) {
|
|
301126
|
+
const active = oldTodos.find((todo) => todo.status === "in_progress");
|
|
301017
301127
|
return {
|
|
301018
301128
|
success: true,
|
|
301019
301129
|
output: JSON.stringify({
|
|
301020
301130
|
reminder: "[NO-OP] You called todo_write with the same plan you already have. The list is unchanged. Use todo_write ONLY to add new tasks, mark a task in_progress / completed, or record a blocker — not as a way to re-read your plan (use todo_read for that, but the current plan is also surfaced automatically in your context). Proceed with the current in_progress task.",
|
|
301021
|
-
|
|
301131
|
+
todoCount: oldTodos.length,
|
|
301132
|
+
activeTodoId: active?.id ?? null,
|
|
301022
301133
|
noop: true,
|
|
301023
301134
|
noProgress: true
|
|
301024
301135
|
}),
|
|
@@ -301037,11 +301148,23 @@ Mark tasks complete IMMEDIATELY after finishing — don't batch. Never mark comp
|
|
|
301037
301148
|
});
|
|
301038
301149
|
const verificationNudgeNeeded = justClosed >= 3 && !hasStructuredEvidence;
|
|
301039
301150
|
const reminder = "Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Mark the current task in_progress and the next task pending. Proceed with the current task.";
|
|
301151
|
+
const oldById = new Map(result.oldTodos.map((todo) => [todo.id, todo]));
|
|
301152
|
+
const changedTodoIds = result.newTodos.filter((todo) => {
|
|
301153
|
+
const previous = oldById.get(todo.id);
|
|
301154
|
+
return !previous || previous.status !== todo.status || previous.blocker !== todo.blocker || previous.parentId !== todo.parentId || previous.verifyCommand !== todo.verifyCommand || JSON.stringify(previous.declaredArtifacts ?? []) !== JSON.stringify(todo.declaredArtifacts ?? []);
|
|
301155
|
+
}).map((todo) => todo.id).slice(0, 20);
|
|
301156
|
+
const statusCounts = result.newTodos.reduce((counts, todo) => {
|
|
301157
|
+
counts[todo.status]++;
|
|
301158
|
+
return counts;
|
|
301159
|
+
}, { pending: 0, in_progress: 0, completed: 0, blocked: 0 });
|
|
301160
|
+
const activeTodo = result.newTodos.find((todo) => todo.status === "in_progress");
|
|
301040
301161
|
const payload = {
|
|
301041
301162
|
reminder,
|
|
301042
301163
|
decompositionContract: "Use parentId for sub-todos. Split the active objective into concrete child leaf todos whenever it contains multiple remaining actions. Keep the active in_progress status on one concrete leaf; parent status is derived from children in the UI/context. Use activeForm for the currently-doing wording, owner for assigned agent/sub-agent, and blocks/blockedBy for cross-todo dependencies. When tool evidence invalidates a child, rewrite that child as blocked or split it into new children instead of overclaiming completion.",
|
|
301043
|
-
|
|
301044
|
-
|
|
301164
|
+
todoCount: result.newTodos.length,
|
|
301165
|
+
statusCounts,
|
|
301166
|
+
activeTodoId: activeTodo?.id ?? null,
|
|
301167
|
+
changedTodoIds,
|
|
301045
301168
|
storageMode: "file-per-task+legacy-mirror",
|
|
301046
301169
|
verificationNudgeNeeded
|
|
301047
301170
|
};
|
|
@@ -301980,7 +302103,7 @@ var require_util9 = __commonJS({
|
|
|
301980
302103
|
exports.isAbsolute = function(aPath) {
|
|
301981
302104
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
301982
302105
|
};
|
|
301983
|
-
function
|
|
302106
|
+
function relative24(aRoot, aPath) {
|
|
301984
302107
|
if (aRoot === "") {
|
|
301985
302108
|
aRoot = ".";
|
|
301986
302109
|
}
|
|
@@ -301999,7 +302122,7 @@ var require_util9 = __commonJS({
|
|
|
301999
302122
|
}
|
|
302000
302123
|
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
302001
302124
|
}
|
|
302002
|
-
exports.relative =
|
|
302125
|
+
exports.relative = relative24;
|
|
302003
302126
|
var supportsNullProto = (function() {
|
|
302004
302127
|
var obj = /* @__PURE__ */ Object.create(null);
|
|
302005
302128
|
return !("__proto__" in obj);
|
|
@@ -313430,11 +313553,11 @@ ${lanes.join("\n")}
|
|
|
313430
313553
|
return toComponents2;
|
|
313431
313554
|
}
|
|
313432
313555
|
const components = toComponents2.slice(start2);
|
|
313433
|
-
const
|
|
313556
|
+
const relative24 = [];
|
|
313434
313557
|
for (; start2 < fromComponents.length; start2++) {
|
|
313435
|
-
|
|
313558
|
+
relative24.push("..");
|
|
313436
313559
|
}
|
|
313437
|
-
return ["", ...
|
|
313560
|
+
return ["", ...relative24, ...components];
|
|
313438
313561
|
}
|
|
313439
313562
|
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
|
|
313440
313563
|
Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
|
|
@@ -352130,11 +352253,11 @@ ${lanes.join("\n")}
|
|
|
352130
352253
|
if (i2 < rootLength) {
|
|
352131
352254
|
return void 0;
|
|
352132
352255
|
}
|
|
352133
|
-
const
|
|
352134
|
-
if (
|
|
352256
|
+
const sep11 = directory.lastIndexOf(directorySeparator, i2 - 1);
|
|
352257
|
+
if (sep11 === -1) {
|
|
352135
352258
|
return void 0;
|
|
352136
352259
|
}
|
|
352137
|
-
return directory.substr(0, Math.max(
|
|
352260
|
+
return directory.substr(0, Math.max(sep11, rootLength));
|
|
352138
352261
|
}
|
|
352139
352262
|
}
|
|
352140
352263
|
}
|
|
@@ -357977,9 +358100,9 @@ ${lanes.join("\n")}
|
|
|
357977
358100
|
if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
|
|
357978
358101
|
return;
|
|
357979
358102
|
}
|
|
357980
|
-
const
|
|
358103
|
+
const relative24 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
|
|
357981
358104
|
for (const symlinkDirectory of symlinkDirectories) {
|
|
357982
|
-
const option = resolvePath5(symlinkDirectory,
|
|
358105
|
+
const option = resolvePath5(symlinkDirectory, relative24);
|
|
357983
358106
|
const result2 = cb(option, target === referenceRedirect);
|
|
357984
358107
|
shouldFilterIgnoredPaths = true;
|
|
357985
358108
|
if (result2) return result2;
|
|
@@ -517502,7 +517625,7 @@ var require_path_browserify = __commonJS({
|
|
|
517502
517625
|
}
|
|
517503
517626
|
return res;
|
|
517504
517627
|
}
|
|
517505
|
-
function _format(
|
|
517628
|
+
function _format(sep11, pathObject) {
|
|
517506
517629
|
var dir = pathObject.dir || pathObject.root;
|
|
517507
517630
|
var base3 = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
|
|
517508
517631
|
if (!dir) {
|
|
@@ -517511,7 +517634,7 @@ var require_path_browserify = __commonJS({
|
|
|
517511
517634
|
if (dir === pathObject.root) {
|
|
517512
517635
|
return dir + base3;
|
|
517513
517636
|
}
|
|
517514
|
-
return dir +
|
|
517637
|
+
return dir + sep11 + base3;
|
|
517515
517638
|
}
|
|
517516
517639
|
var posix = {
|
|
517517
517640
|
// path.resolve([from ...], to)
|
|
@@ -517580,7 +517703,7 @@ var require_path_browserify = __commonJS({
|
|
|
517580
517703
|
return ".";
|
|
517581
517704
|
return posix.normalize(joined);
|
|
517582
517705
|
},
|
|
517583
|
-
relative: function
|
|
517706
|
+
relative: function relative24(from3, to) {
|
|
517584
517707
|
assertPath(from3);
|
|
517585
517708
|
assertPath(to);
|
|
517586
517709
|
if (from3 === to) return "";
|
|
@@ -520410,12 +520533,12 @@ var require_dist3 = __commonJS({
|
|
|
520410
520533
|
return patterns.length > 0 ? buildCrawler(options2, patterns) : [];
|
|
520411
520534
|
}
|
|
520412
520535
|
async function glob3(globInput, options2) {
|
|
520413
|
-
const [crawler,
|
|
520414
|
-
return crawler ? formatPaths(await crawler.withPromise(),
|
|
520536
|
+
const [crawler, relative24] = getCrawler(globInput, options2);
|
|
520537
|
+
return crawler ? formatPaths(await crawler.withPromise(), relative24) : [];
|
|
520415
520538
|
}
|
|
520416
520539
|
function globSync(globInput, options2) {
|
|
520417
|
-
const [crawler,
|
|
520418
|
-
return crawler ? formatPaths(crawler.sync(),
|
|
520540
|
+
const [crawler, relative24] = getCrawler(globInput, options2);
|
|
520541
|
+
return crawler ? formatPaths(crawler.sync(), relative24) : [];
|
|
520419
520542
|
}
|
|
520420
520543
|
exports.convertPathToPattern = convertPathToPattern;
|
|
520421
520544
|
exports.escapePath = escapePath;
|
|
@@ -556471,10 +556594,10 @@ var init_transport5 = __esm({
|
|
|
556471
556594
|
if (done)
|
|
556472
556595
|
break;
|
|
556473
556596
|
buf += decoder.decode(value2, { stream: true });
|
|
556474
|
-
let
|
|
556475
|
-
while ((
|
|
556476
|
-
const event = buf.slice(0,
|
|
556477
|
-
buf = buf.slice(
|
|
556597
|
+
let sep11;
|
|
556598
|
+
while ((sep11 = buf.indexOf("\n\n")) !== -1) {
|
|
556599
|
+
const event = buf.slice(0, sep11);
|
|
556600
|
+
buf = buf.slice(sep11 + 2);
|
|
556478
556601
|
const dataLines = [];
|
|
556479
556602
|
for (const line of event.split("\n")) {
|
|
556480
556603
|
if (line.startsWith("data:"))
|
|
@@ -568608,6 +568731,96 @@ function normalizeShellCommand(command) {
|
|
|
568608
568731
|
function splitConjunctiveVerifyCommand(command) {
|
|
568609
568732
|
return normalizeShellCommand(command).split(/\s+&&\s+/).map((part) => part.trim()).filter(Boolean);
|
|
568610
568733
|
}
|
|
568734
|
+
function splitTopLevelAnd(command) {
|
|
568735
|
+
const parts = [];
|
|
568736
|
+
let current = "";
|
|
568737
|
+
let quote2 = null;
|
|
568738
|
+
for (let i2 = 0; i2 < command.length; i2++) {
|
|
568739
|
+
const ch = command[i2];
|
|
568740
|
+
if (quote2) {
|
|
568741
|
+
current += ch;
|
|
568742
|
+
if (ch === quote2 && command[i2 - 1] !== "\\")
|
|
568743
|
+
quote2 = null;
|
|
568744
|
+
continue;
|
|
568745
|
+
}
|
|
568746
|
+
if (ch === "'" || ch === '"') {
|
|
568747
|
+
quote2 = ch;
|
|
568748
|
+
current += ch;
|
|
568749
|
+
continue;
|
|
568750
|
+
}
|
|
568751
|
+
if (ch === "&" && command[i2 + 1] === "&") {
|
|
568752
|
+
parts.push(current.trim());
|
|
568753
|
+
current = "";
|
|
568754
|
+
i2++;
|
|
568755
|
+
continue;
|
|
568756
|
+
}
|
|
568757
|
+
current += ch;
|
|
568758
|
+
}
|
|
568759
|
+
parts.push(current.trim());
|
|
568760
|
+
return parts.filter(Boolean);
|
|
568761
|
+
}
|
|
568762
|
+
function hasUnsafeVerifierShellSyntax(command) {
|
|
568763
|
+
let quote2 = null;
|
|
568764
|
+
for (let i2 = 0; i2 < command.length; i2++) {
|
|
568765
|
+
const ch = command[i2];
|
|
568766
|
+
if (quote2) {
|
|
568767
|
+
if (ch === quote2 && command[i2 - 1] !== "\\")
|
|
568768
|
+
quote2 = null;
|
|
568769
|
+
continue;
|
|
568770
|
+
}
|
|
568771
|
+
if (ch === "'" || ch === '"') {
|
|
568772
|
+
quote2 = ch;
|
|
568773
|
+
continue;
|
|
568774
|
+
}
|
|
568775
|
+
if (ch === "`" || ch === "$" && command[i2 + 1] === "(") {
|
|
568776
|
+
return true;
|
|
568777
|
+
}
|
|
568778
|
+
if (ch === "|" || ch === ";" || ch === "\n" || ch === "\r") {
|
|
568779
|
+
return true;
|
|
568780
|
+
}
|
|
568781
|
+
if (ch === "&" && command[i2 + 1] !== "&" && command[i2 - 1] !== "&" && !isFileDescriptorRedirectionAmpersand2(command, i2)) {
|
|
568782
|
+
return true;
|
|
568783
|
+
}
|
|
568784
|
+
}
|
|
568785
|
+
return false;
|
|
568786
|
+
}
|
|
568787
|
+
function isFileDescriptorRedirectionAmpersand2(command, index) {
|
|
568788
|
+
return command[index - 1] === ">" && /[0-9-]/.test(command[index + 1] ?? "");
|
|
568789
|
+
}
|
|
568790
|
+
function isExecutableVerifyCommand(command) {
|
|
568791
|
+
const source = stripVerifierFallbackSuffix(command);
|
|
568792
|
+
const normalized = normalizeShellCommand(source);
|
|
568793
|
+
if (!normalized || hasUnsafeVerifierShellSyntax(normalized))
|
|
568794
|
+
return false;
|
|
568795
|
+
return !looksLikeVerifierResultProse2(normalized);
|
|
568796
|
+
}
|
|
568797
|
+
function looksLikeVerifierResultProse2(command) {
|
|
568798
|
+
const result = "(?:success(?:ful(?:ly)?)?|succeed(?:ed|s)?|pass(?:ed)?|ok|done|fail(?:ed|ure)?|error)";
|
|
568799
|
+
const trailingResult = new RegExp(String.raw`(?:\s*(?:->|=>|→|⇒|—)\s*|\s*:\s*|\s+\(|\s+\[)${result}(?:\)|\])?\s*$`, "i");
|
|
568800
|
+
if (trailingResult.test(command))
|
|
568801
|
+
return true;
|
|
568802
|
+
const inlineResult = new RegExp(String.raw`(?:->|=>|→|⇒|—)\s*${result}\b|\b${result}\b\s+(?:on|for|in|with)\b`, "i");
|
|
568803
|
+
if (inlineResult.test(command))
|
|
568804
|
+
return true;
|
|
568805
|
+
if (/\s+\((?:compiles?|compiled|builds?|built|passes?|passed|works?|working|succeeds?|succeeded|success(?:fully)?)\b[^)]*\)\s*$/i.test(command)) {
|
|
568806
|
+
return true;
|
|
568807
|
+
}
|
|
568808
|
+
if (/^(?:file_(?:edit|write)|todo_write|task_complete)\b/i.test(command)) {
|
|
568809
|
+
return true;
|
|
568810
|
+
}
|
|
568811
|
+
return /^(?:the\s+)?(?:build|tests?|verification)\s+(?:has\s+)?(?:passed|succeeded|failed|is\s+successful)\b/i.test(command);
|
|
568812
|
+
}
|
|
568813
|
+
function isDirectoryChangeCommand(command) {
|
|
568814
|
+
return /^cd(?:\s+--)?\s+(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^\s;&|]+)\s*$/.test(command);
|
|
568815
|
+
}
|
|
568816
|
+
function stripSafeLeadingDirectoryChanges(command) {
|
|
568817
|
+
const parts = splitTopLevelAnd(command);
|
|
568818
|
+
let firstVerifierPart = 0;
|
|
568819
|
+
while (firstVerifierPart < parts.length - 1 && isDirectoryChangeCommand(parts[firstVerifierPart])) {
|
|
568820
|
+
firstVerifierPart++;
|
|
568821
|
+
}
|
|
568822
|
+
return firstVerifierPart === 0 ? command : parts.slice(firstVerifierPart).join(" && ");
|
|
568823
|
+
}
|
|
568611
568824
|
function stripVerifierFallbackSuffix(command) {
|
|
568612
568825
|
let quote2 = null;
|
|
568613
568826
|
for (let i2 = 0; i2 < command.length - 1; i2++) {
|
|
@@ -568701,13 +568914,24 @@ function commandIsPureReadOnlyPipeline(command) {
|
|
|
568701
568914
|
});
|
|
568702
568915
|
}
|
|
568703
568916
|
function commandReliablySatisfiesVerifyCommand(observedCommand, verifyCommand) {
|
|
568917
|
+
if (/[\r\n]/.test(observedCommand))
|
|
568918
|
+
return false;
|
|
568704
568919
|
const observed = normalizeShellCommand(observedCommand);
|
|
568705
|
-
|
|
568920
|
+
if (hasUnsafeVerifierShellSyntax(observed))
|
|
568921
|
+
return false;
|
|
568922
|
+
const expectedSource = stripVerifierFallbackSuffix(verifyCommand);
|
|
568923
|
+
const expected = normalizeShellCommand(expectedSource);
|
|
568924
|
+
if (/[\r\n]/.test(expectedSource) || !isExecutableVerifyCommand(expectedSource)) {
|
|
568925
|
+
return false;
|
|
568926
|
+
}
|
|
568706
568927
|
if (!observed || !expected)
|
|
568707
568928
|
return false;
|
|
568708
568929
|
if (observed === expected)
|
|
568709
568930
|
return true;
|
|
568710
|
-
|
|
568931
|
+
const withoutLeadingCd = stripSafeLeadingDirectoryChanges(observed);
|
|
568932
|
+
if (withoutLeadingCd === expected)
|
|
568933
|
+
return true;
|
|
568934
|
+
if (withoutLeadingCd.startsWith(`${expected} && `)) {
|
|
568711
568935
|
return true;
|
|
568712
568936
|
}
|
|
568713
568937
|
return false;
|
|
@@ -571543,7 +571767,8 @@ var init_mast_tagger = __esm({
|
|
|
571543
571767
|
|
|
571544
571768
|
// packages/orchestrator/dist/artifact-inspector.js
|
|
571545
571769
|
import { existsSync as existsSync90, statSync as statSync33 } from "node:fs";
|
|
571546
|
-
import { isAbsolute as isAbsolute11, resolve as resolve53 } from "node:path";
|
|
571770
|
+
import { isAbsolute as isAbsolute11, relative as relative10, resolve as resolve53, sep as sep5 } from "node:path";
|
|
571771
|
+
import { tmpdir as tmpdir21 } from "node:os";
|
|
571547
571772
|
function extractCandidatePaths(content) {
|
|
571548
571773
|
const out = /* @__PURE__ */ new Set();
|
|
571549
571774
|
for (const m2 of content.matchAll(/(?<![\w/])((?:\/|\.\/|\.\.\/|src\/|tests?\/|lib\/|app\/|public\/|prisma\/|docs?\/|build\/|dist\/|out\/|target\/|bin\/)[\w./-]+\.[a-z0-9]{1,8})\b/gi)) {
|
|
@@ -571560,9 +571785,20 @@ function extractCandidatePaths(content) {
|
|
|
571560
571785
|
function resolveAgainstWorkingDir(workingDir, p2) {
|
|
571561
571786
|
return isAbsolute11(p2) ? p2 : resolve53(workingDir, p2);
|
|
571562
571787
|
}
|
|
571788
|
+
function isPathInside(path16, parent) {
|
|
571789
|
+
const rel = relative10(parent, path16);
|
|
571790
|
+
return rel === "" || !rel.startsWith(`..${sep5}`) && rel !== ".." && !isAbsolute11(rel);
|
|
571791
|
+
}
|
|
571792
|
+
function isExternalSystemTempArtifact(workingDir, candidate) {
|
|
571793
|
+
const resolved = resolveAgainstWorkingDir(workingDir, candidate);
|
|
571794
|
+
const workspace = resolve53(workingDir);
|
|
571795
|
+
if (isPathInside(resolved, workspace))
|
|
571796
|
+
return false;
|
|
571797
|
+
return [resolve53(tmpdir21()), resolve53("/var/tmp")].some((tempRoot) => isPathInside(resolved, tempRoot));
|
|
571798
|
+
}
|
|
571563
571799
|
function inspectClaimedArtifacts(input) {
|
|
571564
571800
|
const staleTurnsMax = input.staleTurnsMax ?? 30;
|
|
571565
|
-
const candidates = input.declaredArtifacts && input.declaredArtifacts.length > 0 ? [...input.declaredArtifacts] : extractCandidatePaths(input.todoContent);
|
|
571801
|
+
const candidates = (input.declaredArtifacts && input.declaredArtifacts.length > 0 ? [...input.declaredArtifacts] : extractCandidatePaths(input.todoContent)).filter((candidate) => !isExternalSystemTempArtifact(input.workingDir, candidate));
|
|
571566
571802
|
const missing = [];
|
|
571567
571803
|
const empty2 = [];
|
|
571568
571804
|
const stale = [];
|
|
@@ -571588,7 +571824,7 @@ function inspectClaimedArtifacts(input) {
|
|
|
571588
571824
|
stale.push(p2);
|
|
571589
571825
|
}
|
|
571590
571826
|
}
|
|
571591
|
-
const ok3 = missing.length === 0 && empty2.length === 0
|
|
571827
|
+
const ok3 = missing.length === 0 && empty2.length === 0;
|
|
571592
571828
|
const lines = [];
|
|
571593
571829
|
if (!ok3) {
|
|
571594
571830
|
lines.push(`[ARTIFACT INSPECTION FAILED — REG-38]`);
|
|
@@ -571609,7 +571845,7 @@ function inspectClaimedArtifacts(input) {
|
|
|
571609
571845
|
lines.push(` ... +${empty2.length - 5} more`);
|
|
571610
571846
|
}
|
|
571611
571847
|
if (stale.length > 0) {
|
|
571612
|
-
lines.push(` • Stale: ${stale.length} path(s)
|
|
571848
|
+
lines.push(` • Stale (advisory only): ${stale.length} path(s) were last written ${staleTurnsMax}+ turns ago`);
|
|
571613
571849
|
for (const m2 of stale.slice(0, 5))
|
|
571614
571850
|
lines.push(` - ${m2}`);
|
|
571615
571851
|
if (stale.length > 5)
|
|
@@ -571856,7 +572092,7 @@ var init_intervention_replay = __esm({
|
|
|
571856
572092
|
|
|
571857
572093
|
// packages/orchestrator/dist/world-state-disk-scan.js
|
|
571858
572094
|
import { existsSync as existsSync93, readFileSync as readFileSync71, readdirSync as readdirSync30, statSync as statSync34 } from "node:fs";
|
|
571859
|
-
import { join as join103, relative as
|
|
572095
|
+
import { join as join103, relative as relative11, basename as basename23 } from "node:path";
|
|
571860
572096
|
function loadIgnoreFile(path16) {
|
|
571861
572097
|
if (!existsSync93(path16))
|
|
571862
572098
|
return [];
|
|
@@ -571947,7 +572183,7 @@ function scanWorkspace(opts) {
|
|
|
571947
572183
|
const st = statSync34(dir);
|
|
571948
572184
|
dirs.push({
|
|
571949
572185
|
abs: dir,
|
|
571950
|
-
rel:
|
|
572186
|
+
rel: relative11(root, dir) || ".",
|
|
571951
572187
|
mtimeMs: st.mtimeMs
|
|
571952
572188
|
});
|
|
571953
572189
|
} catch {
|
|
@@ -571963,7 +572199,7 @@ function scanWorkspace(opts) {
|
|
|
571963
572199
|
const dirsToVisit = [];
|
|
571964
572200
|
for (const entry of entries) {
|
|
571965
572201
|
const abs = join103(dir, entry);
|
|
571966
|
-
const rel =
|
|
572202
|
+
const rel = relative11(root, abs);
|
|
571967
572203
|
const base3 = basename23(abs);
|
|
571968
572204
|
if (shouldIgnore(rel, base3, abs, patterns))
|
|
571969
572205
|
continue;
|
|
@@ -573345,7 +573581,7 @@ var init_process_async2 = __esm({
|
|
|
573345
573581
|
|
|
573346
573582
|
// packages/orchestrator/dist/backward-pass-runner.js
|
|
573347
573583
|
import { existsSync as existsSync96, readFileSync as readFileSync73, statSync as statSync37 } from "node:fs";
|
|
573348
|
-
import { isAbsolute as isAbsolute14, join as join106, relative as
|
|
573584
|
+
import { isAbsolute as isAbsolute14, join as join106, relative as relative12 } from "node:path";
|
|
573349
573585
|
function collectDiff(opts) {
|
|
573350
573586
|
const cap = Math.max(1, opts.maxFiles);
|
|
573351
573587
|
if (opts.explicitFiles && opts.explicitFiles.length > 0) {
|
|
@@ -573359,7 +573595,7 @@ function collectDiff(opts) {
|
|
|
573359
573595
|
bytes = statSync37(abs).size;
|
|
573360
573596
|
} catch {
|
|
573361
573597
|
}
|
|
573362
|
-
files.push({ path:
|
|
573598
|
+
files.push({ path: relative12(opts.workingDir, abs), bytes, status: "modified" });
|
|
573363
573599
|
}
|
|
573364
573600
|
return { files, strategy: "explicit" };
|
|
573365
573601
|
}
|
|
@@ -578824,6 +579060,9 @@ function computeNoProgressCompletionGate(input) {
|
|
|
578824
579060
|
const successfulDiscovery = input.toolCallLog.filter((call) => call.success === true && DISCOVERY_TOOLS.has(call.name));
|
|
578825
579061
|
if (successfulDiscovery.length < 3)
|
|
578826
579062
|
return { shouldInject: false };
|
|
579063
|
+
const hasReadEvidence = successfulDiscovery.some((call) => typeof call.outputPreview === "string" && call.outputPreview.trim().length > 0);
|
|
579064
|
+
if (hasReadEvidence)
|
|
579065
|
+
return { shouldInject: false };
|
|
578827
579066
|
const summary = (input.summary ?? "").trim();
|
|
578828
579067
|
if (summary.startsWith("BLOCKED:") || summary.startsWith("NO FILE CHANGES REQUIRED:")) {
|
|
578829
579068
|
return { shouldInject: false };
|
|
@@ -579624,6 +579863,13 @@ function retireHistoricalRunEvidence(messages2) {
|
|
|
579624
579863
|
if (message2.role !== "system" || typeof message2.content !== "string" || !message2.content.includes("[RUN EVIDENCE]")) {
|
|
579625
579864
|
continue;
|
|
579626
579865
|
}
|
|
579866
|
+
if (/\btool=todo_write\b/i.test(message2.content) && /"(?:oldTodos|newTodos)"\s*:/i.test(message2.content)) {
|
|
579867
|
+
out[index] = {
|
|
579868
|
+
...message2,
|
|
579869
|
+
content: "[RUN EVIDENCE] tool=todo_write status=ok; historical todo payload retired. Use the current todo plan for active state."
|
|
579870
|
+
};
|
|
579871
|
+
continue;
|
|
579872
|
+
}
|
|
579627
579873
|
const text2 = message2.content.toLowerCase();
|
|
579628
579874
|
const bucket2 = /\b(?:file_edit|file_write|patch|apply_patch)\b/.test(text2) ? "mutation" : /\b(?:shell|verifier|compile|build|test)\b/.test(text2) ? "verification" : "discovery";
|
|
579629
579875
|
const retained = retainedByBucket.get(bucket2) ?? 0;
|
|
@@ -579944,8 +580190,8 @@ var init_context_compiler = __esm({
|
|
|
579944
580190
|
MODEL_FACING_ACTION_GROUND_TRUTH_CHAR_CAP = 5500;
|
|
579945
580191
|
CONTROLLER_STATE_MARKER = "[CONTROLLER STATE v1]";
|
|
579946
580192
|
ACTION_GROUND_TRUTH_MARKER = "[RECENT ACTION GROUND TRUTH]";
|
|
579947
|
-
LEGACY_RUNTIME_CONTROL_FRAGMENT_RE = /(?:\bREG-\d+\b|\bfocus supervisor\b|\bworld[ -]state\b|\brecent tool failures\b|\bstop\s*[—-]\s*retry loop\b|\bstagnation replan\b|\bfirst-edit nudge\b|\bintra-run lesson\b|\blocal error-informed nudge\b|\b(?:failure|failing)\s+(?:recovery|replan|loop|recap)\b|\b(?:controller|admin)\s+(?:summary|recap|reflection)\b|\bdoom-loop\b|\b(?:prior\s+)?failure reflection\b|\breflexion\b|\b(?:cross-session|prior)\s+lessons?\b|\bprogress gate\b|\bforecast\b)/i;
|
|
579948
|
-
LEGACY_RUNTIME_CONTROL_BLOCK_START_RE = /(?:\[(?:REG-\d+|FOCUS SUPERVISOR[^\]]*|WORLD[ -]STATE[^\]]*|RECENT TOOL FAILURES|STOP\s*[—-]\s*RETRY LOOP|STAGNATION REPLAN[^\]]*|FIRST-EDIT NUDGE[^\]]*|INTRA-RUN LESSON[^\]]*|LOCAL ERROR-INFORMED NUDGE[^\]]*|FORECAST[^\]]*|PROGRESS GATE[^\]]*|FAIL(?:URE|ING)[^\]]*(?:RECOVERY|REPLAN|LOOP)[^\]]*|DOOM-LOOP[^\]]*)\]|<(?:world-state|focus-supervisor|failure-recovery|reflection|lessons?)[^>]*>)/i;
|
|
580193
|
+
LEGACY_RUNTIME_CONTROL_FRAGMENT_RE = /(?:\bREG-\d+\b|\bfocus supervisor\b|\bworld[ -]state\b|\brecent tool failures\b|\bstop\s*[—-]\s*retry loop\b|\bstagnation replan\b|\bfirst-edit nudge\b|\bintra-run lesson\b|\blocal error-informed nudge\b|\b(?:failure|failing)\s+(?:recovery|replan|loop|recap)\b|\b(?:controller|admin)\s+(?:summary|recap|reflection)\b|\bdoom-loop\b|\b(?:prior\s+)?failure reflection\b|\breflexion\b|\b(?:cross-session|prior)\s+lessons?\b|\bprogress (?:gate|check)\b|\brestored todo verification\b|\bforecast\b)/i;
|
|
580194
|
+
LEGACY_RUNTIME_CONTROL_BLOCK_START_RE = /(?:\[(?:REG-\d+|FOCUS SUPERVISOR[^\]]*|WORLD[ -]STATE[^\]]*|RECENT TOOL FAILURES|STOP\s*[—-]\s*RETRY LOOP|STAGNATION REPLAN[^\]]*|FIRST-EDIT NUDGE[^\]]*|INTRA-RUN LESSON[^\]]*|LOCAL ERROR-INFORMED NUDGE[^\]]*|FORECAST[^\]]*|PROGRESS (?:GATE|CHECK)[^\]]*|RESTORED TODO VERIFICATION[^\]]*|FAIL(?:URE|ING)[^\]]*(?:RECOVERY|REPLAN|LOOP)[^\]]*|DOOM-LOOP[^\]]*)\]|<(?:world-state|focus-supervisor|failure-recovery|reflection|lessons?)[^>]*>)/i;
|
|
579949
580195
|
ASSISTANT_READ_INTENT_RETIRED_MARKER = "[assistant read intent retired: the linked tool result is already available; decide from that evidence instead of restating a read plan]";
|
|
579950
580196
|
RESTORE_NOISE_LINE_RE = /^\s*(?:🔊|E Task timeout reached|E Incomplete:|⚠ Task incomplete|Tokens:\s*[\d,]+|▹\s*continue\b|·\s*(?:Starting fresh|Context (?:auto-)?restored|Nexus P2P network connected|REST API:|Voice feedback enabled|Memory maintenance:)|.*\bSHELL TRANSCRIPT\b.*|.*speaker emoji.*).*$/i;
|
|
579951
580197
|
RUNTIME_GUIDANCE_RE = /\[RUNTIME_GUIDANCE_INTAKE v\d+\][\s\S]*?<<<RUNTIME_GUIDANCE>>>\s*([\s\S]*?)\s*<<<END_RUNTIME_GUIDANCE>>>[\s\S]*?\[\/RUNTIME_GUIDANCE_INTAKE\]/g;
|
|
@@ -580389,7 +580635,7 @@ ${body}
|
|
|
580389
580635
|
// packages/orchestrator/dist/contentAddressedArtifactStore.js
|
|
580390
580636
|
import { createHash as createHash32 } from "node:crypto";
|
|
580391
580637
|
import { existsSync as existsSync102, mkdirSync as mkdirSync58, readFileSync as readFileSync78, readdirSync as readdirSync32, renameSync as renameSync10, statSync as statSync39, unlinkSync as unlinkSync17, writeFileSync as writeFileSync48 } from "node:fs";
|
|
580392
|
-
import { join as join111, resolve as resolve55, sep as
|
|
580638
|
+
import { join as join111, resolve as resolve55, sep as sep6 } from "node:path";
|
|
580393
580639
|
function contentAddressedArtifactStoreRoot(cwd4 = process.cwd(), stateDir) {
|
|
580394
580640
|
const stateRoot = stateDir?.trim() ? resolve55(stateDir) : join111(resolve55(cwd4), ".omnius");
|
|
580395
580641
|
return join111(stateRoot, "artifact-store");
|
|
@@ -580520,7 +580766,7 @@ function sliceExactLines(content, requested, totalLines) {
|
|
|
580520
580766
|
return content.slice(startOffset, endOffset);
|
|
580521
580767
|
}
|
|
580522
580768
|
function isWithinRoot(root, target) {
|
|
580523
|
-
return target === root || target.startsWith(`${root}${
|
|
580769
|
+
return target === root || target.startsWith(`${root}${sep6}`);
|
|
580524
580770
|
}
|
|
580525
580771
|
function safeJoin(root, ...segments) {
|
|
580526
580772
|
const target = resolve55(root, ...segments);
|
|
@@ -582389,7 +582635,7 @@ var init_memory_compiler = __esm({
|
|
|
582389
582635
|
// packages/orchestrator/dist/debugArtifactLibrary.js
|
|
582390
582636
|
import { appendFileSync as appendFileSync10, existsSync as existsSync104, mkdirSync as mkdirSync60, readFileSync as readFileSync80, statSync as statSync41, writeFileSync as writeFileSync50 } from "node:fs";
|
|
582391
582637
|
import { createHash as createHash35 } from "node:crypto";
|
|
582392
|
-
import { basename as basename24, join as join113, relative as
|
|
582638
|
+
import { basename as basename24, join as join113, relative as relative13, resolve as resolve57 } from "node:path";
|
|
582393
582639
|
function debugArtifactRoot(cwd4 = process.cwd(), stateDir) {
|
|
582394
582640
|
const envDir = process.env["OMNIUS_DEBUG_ARTIFACT_DIR"]?.trim();
|
|
582395
582641
|
if (envDir)
|
|
@@ -582831,7 +583077,7 @@ function buildAnchors(cwd4, runId, paths, extra = []) {
|
|
|
582831
583077
|
return {
|
|
582832
583078
|
...item,
|
|
582833
583079
|
path: absolute,
|
|
582834
|
-
relativePath:
|
|
583080
|
+
relativePath: relative13(cwd4, absolute) || basename24(absolute),
|
|
582835
583081
|
exists: item.kind === "event" && item.label === "event_json" ? true : pathExists(absolute)
|
|
582836
583082
|
};
|
|
582837
583083
|
});
|
|
@@ -583162,7 +583408,7 @@ function writeGlobalReadme(paths, latestRun) {
|
|
|
583162
583408
|
"This directory indexes run-level debugging artifacts and links back to raw Omnius state.",
|
|
583163
583409
|
"",
|
|
583164
583410
|
`Latest run: ${latestRun.runId}`,
|
|
583165
|
-
`Contract: ${
|
|
583411
|
+
`Contract: ${relative13(paths.root, paths.contractPath)}`,
|
|
583166
583412
|
"",
|
|
583167
583413
|
"## Recent Runs",
|
|
583168
583414
|
"",
|
|
@@ -587861,7 +588107,7 @@ var init_prompt_cache = __esm({
|
|
|
587861
588107
|
// packages/orchestrator/dist/git-progress.js
|
|
587862
588108
|
import { existsSync as existsSync105, readFileSync as readFileSync81, statSync as statSync42 } from "node:fs";
|
|
587863
588109
|
import { createHash as createHash38 } from "node:crypto";
|
|
587864
|
-
import { relative as
|
|
588110
|
+
import { relative as relative14, resolve as resolve58, sep as sep7 } from "node:path";
|
|
587865
588111
|
function isRunnerOwnedGitPath(path16) {
|
|
587866
588112
|
const normalized = normalizeGitPath(path16);
|
|
587867
588113
|
return RUNNER_OWNED_PREFIXES.some((prefix) => normalized.startsWith(prefix));
|
|
@@ -587966,8 +588212,8 @@ function normalizeMutatedPath(repoRoot, path16) {
|
|
|
587966
588212
|
if (!normalized)
|
|
587967
588213
|
return "";
|
|
587968
588214
|
const absolute = resolve58(repoRoot, normalized);
|
|
587969
|
-
let rel =
|
|
587970
|
-
if (!rel || rel.startsWith("..") || rel === "." || rel.includes(`..${
|
|
588215
|
+
let rel = relative14(repoRoot, absolute);
|
|
588216
|
+
if (!rel || rel.startsWith("..") || rel === "." || rel.includes(`..${sep7}`)) {
|
|
587971
588217
|
rel = normalized;
|
|
587972
588218
|
}
|
|
587973
588219
|
return normalizeGitPath(rel);
|
|
@@ -589899,6 +590145,43 @@ function isCompilerLikeVerifierCommand(command) {
|
|
|
589899
590145
|
const normalized = command.toLowerCase();
|
|
589900
590146
|
return /\b(?:pio|platformio|tsc|gcc|g\+\+|clang\+\+?|clang|cargo\s+(?:build|check)|go\s+(?:build|test)|javac|gradle|mvn|msbuild|dotnet\s+build|python(?:3)?\s+-m\s+(?:py_compile|compileall)|mypy|pyright)\b/.test(normalized);
|
|
589901
590147
|
}
|
|
590148
|
+
function compilerVerifierFamily(command) {
|
|
590149
|
+
const normalized = stripShellQuotedSegments(command).toLowerCase();
|
|
590150
|
+
if (/\b(?:pio|platformio)\b/.test(normalized))
|
|
590151
|
+
return "platformio";
|
|
590152
|
+
if (/\btsc\b/.test(normalized))
|
|
590153
|
+
return "tsc";
|
|
590154
|
+
if (/\bg\+\+(?=\s|$)/.test(normalized))
|
|
590155
|
+
return "g++";
|
|
590156
|
+
if (/\bgcc\b/.test(normalized))
|
|
590157
|
+
return "gcc";
|
|
590158
|
+
if (/\bclang\+\+(?=\s|$)/.test(normalized))
|
|
590159
|
+
return "clang++";
|
|
590160
|
+
if (/\bclang\b/.test(normalized))
|
|
590161
|
+
return "clang";
|
|
590162
|
+
if (/\bcargo\s+(?:build|check)\b/.test(normalized))
|
|
590163
|
+
return "cargo";
|
|
590164
|
+
if (/\bgo\s+(?:build|test)\b/.test(normalized))
|
|
590165
|
+
return "go";
|
|
590166
|
+
if (/\bjavac\b/.test(normalized))
|
|
590167
|
+
return "javac";
|
|
590168
|
+
if (/\bgradle\b/.test(normalized))
|
|
590169
|
+
return "gradle";
|
|
590170
|
+
if (/\bmvn\b/.test(normalized))
|
|
590171
|
+
return "maven";
|
|
590172
|
+
if (/\bmsbuild\b/.test(normalized))
|
|
590173
|
+
return "msbuild";
|
|
590174
|
+
if (/\bdotnet\s+build\b/.test(normalized))
|
|
590175
|
+
return "dotnet";
|
|
590176
|
+
if (/\bpython(?:3)?\s+-m\s+(?:py_compile|compileall)\b/.test(normalized)) {
|
|
590177
|
+
return "python-compile";
|
|
590178
|
+
}
|
|
590179
|
+
if (/\bmypy\b/.test(normalized))
|
|
590180
|
+
return "mypy";
|
|
590181
|
+
if (/\bpyright\b/.test(normalized))
|
|
590182
|
+
return "pyright";
|
|
590183
|
+
return null;
|
|
590184
|
+
}
|
|
589902
590185
|
function isRecoveryCriticalRuntimeOutcome(content) {
|
|
589903
590186
|
return /\[(?:COMPILE ERROR FIX LOOP BLOCKED|EXPLORATION ADMISSION BLOCK|PARENT(?:\s+[^\]]*)?\s+BLOCK(?:ED)?|FOCUS SUPERVISOR BLOCK|STEERING RECONCILIATION REQUIRED|STALE EDIT LOOP BLOCKED|FULL FILE WRITE LOOP BLOCKED)\b/i.test(content);
|
|
589904
590187
|
}
|
|
@@ -594983,6 +595266,8 @@ Pick the SMALLEST concrete deliverable from the spec — typically the project e
|
|
|
594983
595266
|
const verifyCommand = typeof todo.verifyCommand === "string" ? todo.verifyCommand.trim() : "";
|
|
594984
595267
|
if (!verifyCommand)
|
|
594985
595268
|
continue;
|
|
595269
|
+
if (!isExecutableVerifyCommand(verifyCommand))
|
|
595270
|
+
continue;
|
|
594986
595271
|
const declaredArtifacts = Array.isArray(todo.declaredArtifacts) ? todo.declaredArtifacts.filter((p2) => typeof p2 === "string" && p2.trim().length > 0).map((p2) => this._normalizeEvidencePath(p2)) : [];
|
|
594987
595272
|
let lastMutationTurn = -1;
|
|
594988
595273
|
let lastMutationIndex = -1;
|
|
@@ -595029,7 +595314,7 @@ Pick the SMALLEST concrete deliverable from the spec — typically the project e
|
|
|
595029
595314
|
`Run the listed verifier command(s) now. If one fails, keep the todo in_progress or blocked and make one targeted fix before retrying.`
|
|
595030
595315
|
].join("\n");
|
|
595031
595316
|
}
|
|
595032
|
-
_declaredVerifierCommandForShell(command, output = "") {
|
|
595317
|
+
_declaredVerifierCommandForShell(command, output = "", success = false) {
|
|
595033
595318
|
const trimmed = command.trim();
|
|
595034
595319
|
if (!trimmed)
|
|
595035
595320
|
return null;
|
|
@@ -595047,6 +595332,11 @@ Pick the SMALLEST concrete deliverable from the spec — typically the project e
|
|
|
595047
595332
|
if (this._declaredVerifierCommand && commandReliablySatisfiesVerifyCommand(trimmed, this._declaredVerifierCommand)) {
|
|
595048
595333
|
return this._declaredVerifierCommand;
|
|
595049
595334
|
}
|
|
595335
|
+
const activeCompileVerifier = this._compileFixLoop;
|
|
595336
|
+
if (success && this._isFreshCompatibleCompileVerifier(trimmed, activeCompileVerifier)) {
|
|
595337
|
+
const latched = stripVerifierFallbackSuffix(trimmed);
|
|
595338
|
+
return latched || trimmed;
|
|
595339
|
+
}
|
|
595050
595340
|
const diagnostics = parseCompilerDiagnostics(output);
|
|
595051
595341
|
if (diagnostics.length > 0 && isCompilerLikeVerifierCommand(trimmed) && !commandIsPureReadOnlyPipeline(trimmed)) {
|
|
595052
595342
|
const latched = stripVerifierFallbackSuffix(trimmed);
|
|
@@ -595058,7 +595348,28 @@ Pick the SMALLEST concrete deliverable from the spec — typically the project e
|
|
|
595058
595348
|
const state = this._compileFixLoop;
|
|
595059
595349
|
if (!state?.active || state.verifierDirtySinceTurn === null)
|
|
595060
595350
|
return false;
|
|
595061
|
-
|
|
595351
|
+
const trimmed = command.trim();
|
|
595352
|
+
return commandReliablySatisfiesVerifyCommand(trimmed, state.verifierCommand) || this._isFreshCompatibleCompileVerifier(trimmed, state);
|
|
595353
|
+
}
|
|
595354
|
+
/**
|
|
595355
|
+
* A fresh successful rerun may be a simpler spelling of the build command
|
|
595356
|
+
* that originally failed (for example `cd firmware && pio run | tee log` →
|
|
595357
|
+
* `pio run -e esp32`). Permit that recovery only after a mutation and only
|
|
595358
|
+
* for the same compiler family; arbitrary successful tests remain unable to
|
|
595359
|
+
* discharge a compile-error card.
|
|
595360
|
+
*/
|
|
595361
|
+
_isFreshCompatibleCompileVerifier(command, state = this._compileFixLoop) {
|
|
595362
|
+
if (!state?.active || state.verifierDirtySinceTurn === null)
|
|
595363
|
+
return false;
|
|
595364
|
+
if (commandIsPureReadOnlyPipeline(command))
|
|
595365
|
+
return false;
|
|
595366
|
+
if (!commandReliablySatisfiesVerifyCommand(command, command))
|
|
595367
|
+
return false;
|
|
595368
|
+
if (stripVerifierFallbackSuffix(command) !== command.trim())
|
|
595369
|
+
return false;
|
|
595370
|
+
const observedFamily = compilerVerifierFamily(command);
|
|
595371
|
+
const latchedFamily = compilerVerifierFamily(state.verifierCommand);
|
|
595372
|
+
return observedFamily !== null && observedFamily === latchedFamily;
|
|
595062
595373
|
}
|
|
595063
595374
|
/**
|
|
595064
595375
|
* When a tool result was triaged for size (full payload saved to
|
|
@@ -595493,7 +595804,7 @@ ${extras.join("\n")}`;
|
|
|
595493
595804
|
};
|
|
595494
595805
|
if (toolName === "shell") {
|
|
595495
595806
|
const command = String(args["command"] ?? args["cmd"] ?? "").trim();
|
|
595496
|
-
if (commandReliablySatisfiesVerifyCommand(command, state.verifierCommand)) {
|
|
595807
|
+
if (commandReliablySatisfiesVerifyCommand(command, state.verifierCommand) || this._isFreshCompatibleCompileVerifier(command, state)) {
|
|
595497
595808
|
if (state.verifierStasisBlocked) {
|
|
595498
595809
|
return blocked("The same verifier action/result is in stasis. Change the owned source or obtain fresh prerequisite evidence before rerunning this unchanged verifier.");
|
|
595499
595810
|
}
|
|
@@ -596461,16 +596772,25 @@ ${context2 ?? ""}`;
|
|
|
596461
596772
|
if (/^\s*(BLOCKED|INCOMPLETE|NEEDS_INPUT)\b\s*:?/i.test(proposedSummary)) {
|
|
596462
596773
|
return { proceed: true };
|
|
596463
596774
|
}
|
|
596464
|
-
const actionable = toolCallLog.some((e2) => e2.mutated || e2.name === "shell" || e2.name === "file_write" || e2.name === "file_edit");
|
|
596775
|
+
const actionable = toolCallLog.some((e2) => e2.success === true && (e2.mutated || e2.name === "shell" || e2.name === "file_write" || e2.name === "file_edit"));
|
|
596465
596776
|
if (!actionable)
|
|
596466
596777
|
return { proceed: true };
|
|
596467
596778
|
const filesChanged = [...this._taskState.modifiedFiles.entries()].map(([p2, action]) => ` - ${action} ${p2}`).slice(0, 40);
|
|
596468
596779
|
const shellLines = toolCallLog.filter((e2) => e2.name === "shell").slice(-12).map((e2) => ` - shell: ${e2.success ? "ok" : "FAIL"} — ${(e2.outputPreview || "").slice(0, 120)}`);
|
|
596780
|
+
const readOnlyEvidence = /* @__PURE__ */ new Map();
|
|
596781
|
+
for (const entry of toolCallLog) {
|
|
596782
|
+
if (entry.success === true && !entry.mutated && entry.name !== "shell" && entry.name !== "file_write" && entry.name !== "file_edit" && entry.name !== "task_complete" && entry.name !== "todo_write") {
|
|
596783
|
+
readOnlyEvidence.set(entry.name, (readOnlyEvidence.get(entry.name) ?? 0) + 1);
|
|
596784
|
+
}
|
|
596785
|
+
}
|
|
596786
|
+
const readOnlyLines = [...readOnlyEvidence.entries()].slice(0, 12).map(([name10, count]) => ` - ${name10}: ${count} successful result${count === 1 ? "" : "s"}`);
|
|
596469
596787
|
const actionsDigest = [
|
|
596470
596788
|
filesChanged.length ? `Files changed (${filesChanged.length}):
|
|
596471
596789
|
${filesChanged.join("\n")}` : "Files changed: none",
|
|
596472
596790
|
shellLines.length ? `Recent commands:
|
|
596473
|
-
${shellLines.join("\n")}` : "Commands run: none"
|
|
596791
|
+
${shellLines.join("\n")}` : "Commands run: none",
|
|
596792
|
+
readOnlyLines.length ? `Successful read-only evidence:
|
|
596793
|
+
${readOnlyLines.join("\n")}` : "Successful read-only evidence: none"
|
|
596474
596794
|
].join("\n");
|
|
596475
596795
|
const wf = this._worldFacts;
|
|
596476
596796
|
const evidenceParts = [];
|
|
@@ -600658,6 +600978,65 @@ ${notice}`;
|
|
|
600658
600978
|
this._supersededTodoIds.add(todo.id);
|
|
600659
600979
|
this._workboard = null;
|
|
600660
600980
|
}
|
|
600981
|
+
/**
|
|
600982
|
+
* A new run may share a TUI/session identifier with its predecessor, but it
|
|
600983
|
+
* does not thereby inherit that predecessor's checklist. Keep the old tree
|
|
600984
|
+
* auditable on disk and hide it from every active guard/context surface.
|
|
600985
|
+
*
|
|
600986
|
+
* Explicit continuation is the sole exception. This prevents an old
|
|
600987
|
+
* implementation checklist from being reinterpreted as a blocker for a new
|
|
600988
|
+
* dashboard, catalog, or unrelated request in the same workspace.
|
|
600989
|
+
*/
|
|
600990
|
+
_hidePriorSessionTodosForFreshTask(goal) {
|
|
600991
|
+
const todos = this.readSessionTodos() ?? [];
|
|
600992
|
+
if (todos.length === 0)
|
|
600993
|
+
return;
|
|
600994
|
+
const archivedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
600995
|
+
try {
|
|
600996
|
+
const dir = _pathJoin(this.omniusStateDir(), "task-epoch-archives");
|
|
600997
|
+
_fsMkdirSync(dir, { recursive: true });
|
|
600998
|
+
_fsWriteFileSync(_pathJoin(dir, `${this._activeRunId || this._sessionId}-prior-todos.json`), JSON.stringify({
|
|
600999
|
+
runId: this._activeRunId || this._sessionId,
|
|
601000
|
+
sessionId: this._sessionId,
|
|
601001
|
+
taskEpoch: this._taskEpoch,
|
|
601002
|
+
archivedAt,
|
|
601003
|
+
reason: "fresh_task_boundary",
|
|
601004
|
+
newGoal: goal.slice(0, 800),
|
|
601005
|
+
todos
|
|
601006
|
+
}, null, 2), "utf8");
|
|
601007
|
+
} catch {
|
|
601008
|
+
}
|
|
601009
|
+
for (const todo of todos)
|
|
601010
|
+
this._supersededTodoIds.add(todo.id);
|
|
601011
|
+
this._workboard = null;
|
|
601012
|
+
this.emit({
|
|
601013
|
+
type: "status",
|
|
601014
|
+
content: `Fresh task boundary archived ${todos.length} prior todo(s); their blockers and verifier requirements are historical, not active state.`,
|
|
601015
|
+
timestamp: archivedAt
|
|
601016
|
+
});
|
|
601017
|
+
}
|
|
601018
|
+
/** Clear verifier and recovery state that is meaningful only for one task epoch. */
|
|
601019
|
+
_resetTaskScopedVerifierState() {
|
|
601020
|
+
this._compileFixLoop = null;
|
|
601021
|
+
this._pendingCompileDelegationCardId = null;
|
|
601022
|
+
this._declaredVerifierCommand = null;
|
|
601023
|
+
this._lastDeclaredVerifierOutput = null;
|
|
601024
|
+
this._lastDeclaredVerifierDiagnostics = [];
|
|
601025
|
+
this._lastBuildOutput = null;
|
|
601026
|
+
this._preFoldErrorCount = null;
|
|
601027
|
+
this._preFoldFixerDescription = null;
|
|
601028
|
+
this._recentFailures = [];
|
|
601029
|
+
this._failureReflections.clear();
|
|
601030
|
+
this._verifyFailures.clear();
|
|
601031
|
+
this._verifyCommandFailures.clear();
|
|
601032
|
+
this._artifactInspectionFailures.clear();
|
|
601033
|
+
this._artifactInspectionDoneThisTurn.clear();
|
|
601034
|
+
this._verifyFailuresBaseline.clear();
|
|
601035
|
+
this._lastBuildSuccessTurn = -1;
|
|
601036
|
+
this._lastBuildSuccessCommand = "";
|
|
601037
|
+
this._worldFacts.lastTest = {};
|
|
601038
|
+
delete this._lastVerifierResult;
|
|
601039
|
+
}
|
|
600661
601040
|
_activateSteering(record, turn) {
|
|
600662
601041
|
const requiresReconciliation = steeringRequiresReconciliation(record.intent);
|
|
600663
601042
|
const gatesOldPlan = steeringGatesOldPlan(record.intent);
|
|
@@ -600771,6 +601150,7 @@ ${notice}`;
|
|
|
600771
601150
|
}
|
|
600772
601151
|
const previousEpoch = this._taskEpoch;
|
|
600773
601152
|
this._archiveSupersededTaskState(previousEpoch, record);
|
|
601153
|
+
this._resetTaskScopedVerifierState();
|
|
600774
601154
|
this._allowImplicitContinuation = false;
|
|
600775
601155
|
this._taskEpoch += 1;
|
|
600776
601156
|
this._contextMemoryTaskRecordId = null;
|
|
@@ -602257,11 +602637,7 @@ Respond with the assessment and take the selected evidence-backed action.`;
|
|
|
602257
602637
|
this._completionCaveat = null;
|
|
602258
602638
|
this._completionLedger = null;
|
|
602259
602639
|
this._focusTerminalLedgerRecorded = false;
|
|
602260
|
-
this.
|
|
602261
|
-
this._pendingCompileDelegationCardId = null;
|
|
602262
|
-
this._declaredVerifierCommand = null;
|
|
602263
|
-
this._lastDeclaredVerifierOutput = null;
|
|
602264
|
-
this._lastDeclaredVerifierDiagnostics = [];
|
|
602640
|
+
this._resetTaskScopedVerifierState();
|
|
602265
602641
|
this._staleEditFamilies.clear();
|
|
602266
602642
|
this._blockedFullWriteAttempts.clear();
|
|
602267
602643
|
this._lastReadTurnByPathKey.clear();
|
|
@@ -602269,7 +602645,7 @@ Respond with the assessment and take the selected evidence-backed action.`;
|
|
|
602269
602645
|
this._lastWorldStateTurn = -1;
|
|
602270
602646
|
this._fileWritesSinceLastWorldState = 0;
|
|
602271
602647
|
this._resetVisualEvidenceState();
|
|
602272
|
-
this._verifyFailuresBaseline = new Set(
|
|
602648
|
+
this._verifyFailuresBaseline = /* @__PURE__ */ new Set();
|
|
602273
602649
|
if (typeof this.backend.setAbortSignal === "function") {
|
|
602274
602650
|
this.backend.setAbortSignal(this._turnAbortController.signal);
|
|
602275
602651
|
}
|
|
@@ -602498,6 +602874,10 @@ Respond with the assessment and take the selected evidence-backed action.`;
|
|
|
602498
602874
|
this._memexArchive.clear();
|
|
602499
602875
|
this._todoOutputLedger.clear();
|
|
602500
602876
|
this._sessionId = this.options.sessionId && String(this.options.sessionId) || process.env["OMNIUS_SESSION_ID"] && String(process.env["OMNIUS_SESSION_ID"]) || `session-${Date.now()}`;
|
|
602877
|
+
const continuesPriorTask = this._allowImplicitContinuation || this._isContinuationResumeGoal(persistentTaskGoal);
|
|
602878
|
+
if (!continuesPriorTask) {
|
|
602879
|
+
this._hidePriorSessionTodosForFreshTask(persistentTaskGoal);
|
|
602880
|
+
}
|
|
602501
602881
|
this._appState = createAppState({
|
|
602502
602882
|
sessionId: this._sessionId,
|
|
602503
602883
|
model: this.backend.model ?? "",
|
|
@@ -603179,7 +603559,10 @@ ${dynamicProjectContext}`
|
|
|
603179
603559
|
const newFailures = [
|
|
603180
603560
|
.../* @__PURE__ */ new Set([
|
|
603181
603561
|
...[...this._verifyFailures].filter((f2) => !this._verifyFailuresBaseline.has(f2)),
|
|
603182
|
-
|
|
603562
|
+
// Keep the same task-start baseline rule for recomputed gaps. The
|
|
603563
|
+
// old form re-added every gap unconditionally, which let a restored
|
|
603564
|
+
// completed todo bypass the very stale-state exclusion above.
|
|
603565
|
+
...freshGapFailures.filter((f2) => !this._verifyFailuresBaseline.has(f2))
|
|
603183
603566
|
])
|
|
603184
603567
|
];
|
|
603185
603568
|
if (newFailures.length === 0)
|
|
@@ -607379,7 +607762,7 @@ ${cachedResult}`,
|
|
|
607379
607762
|
if (_t.status !== "completed")
|
|
607380
607763
|
continue;
|
|
607381
607764
|
const _vc = _t.verifyCommand;
|
|
607382
|
-
if (_vc && typeof _vc === "string" && !this._verifyHintInjectedThisTurn.has(_t.content)) {
|
|
607765
|
+
if (_vc && typeof _vc === "string" && isExecutableVerifyCommand(_vc) && !this._verifyHintInjectedThisTurn.has(_t.content)) {
|
|
607383
607766
|
const _history = toolCallLog.slice(-15).filter((c9) => c9.name === "shell").map((c9) => ({
|
|
607384
607767
|
command: this._shellCommandFromArgsKey(c9.argsKey),
|
|
607385
607768
|
success: c9.success === true
|
|
@@ -607998,7 +608381,7 @@ ${structuralGuardGuidance}` : structuralGuardGuidance;
|
|
|
607998
608381
|
if (tc.name === "shell" && result.runtimeAuthored !== true) {
|
|
607999
608382
|
const shellCommand = String(tc.arguments?.["command"] ?? tc.arguments?.["cmd"] ?? "");
|
|
608000
608383
|
const compileOutput = this._expandTriagedPayloadForDiagnostics([result.output, result.llmContent, result.error].filter((part) => typeof part === "string" && part.length > 0).join("\n"));
|
|
608001
|
-
const verifierCommand = this._declaredVerifierCommandForShell(shellCommand, compileOutput);
|
|
608384
|
+
const verifierCommand = this._declaredVerifierCommandForShell(shellCommand, compileOutput, result.success === true);
|
|
608002
608385
|
if (verifierCommand) {
|
|
608003
608386
|
const compileGuidance = this._observeCompileVerifierResult({
|
|
608004
608387
|
verifierCommand,
|
|
@@ -613613,7 +613996,7 @@ ${trimmedNew}`;
|
|
|
613613
613996
|
_isLegacyControlMessage(message2) {
|
|
613614
613997
|
if (message2.role !== "system" || typeof message2.content !== "string")
|
|
613615
613998
|
return false;
|
|
613616
|
-
return /^(?:\[(?:FIRST-EDIT NUDGE|STAGNATION(?: REPLAN| RECIPE)|STUCK DETECTOR HALT|STUCK-STATE META-ANALYZER|WRITE-THRASH HALT|EDIT-FAIL-THRASH HALT|PROBLEM-FRAME VALIDATION|STICKY ESCALATION|INTRA-RUN LESSON|LEARNED FROM EXPERIENCE|FOCUS SUPERVISOR|REG-\d+ directive active|OPAQUE LOCAL ERROR|LOCAL ERROR-INFORMED NUDGE|PRIOR LESSONS|FAILURE-MODE INTAKE|REFLECTION|Associative Memory)|LOOP CIRCUIT BREAKER)/.test(message2.content);
|
|
613999
|
+
return /^(?:\[(?:FIRST-EDIT NUDGE|STAGNATION(?: REPLAN| RECIPE)|STUCK DETECTOR HALT|STUCK-STATE META-ANALYZER|WRITE-THRASH HALT|EDIT-FAIL-THRASH HALT|PROBLEM-FRAME VALIDATION|STICKY ESCALATION|INTRA-RUN LESSON|LEARNED FROM EXPERIENCE|FOCUS SUPERVISOR|REG-\d+ directive active|OPAQUE LOCAL ERROR|LOCAL ERROR-INFORMED NUDGE|PRIOR LESSONS|FAILURE-MODE INTAKE|REFLECTION|Associative Memory|PROGRESS CHECK|RESTORED TODO VERIFICATION)|LOOP CIRCUIT BREAKER)/.test(message2.content);
|
|
613617
614000
|
}
|
|
613618
614001
|
_stripLegacyControlMessages(messages2) {
|
|
613619
614002
|
for (let index = messages2.length - 1; index >= 0; index--) {
|
|
@@ -615344,9 +615727,9 @@ ${result}`
|
|
|
615344
615727
|
try {
|
|
615345
615728
|
const { writeFileSync: writeFileSync98, readFileSync: readFileSync145, unlinkSync: unlinkSync40 } = await import("node:fs");
|
|
615346
615729
|
const { join: join191 } = await import("node:path");
|
|
615347
|
-
const { tmpdir:
|
|
615348
|
-
const tmpIn = join191(
|
|
615349
|
-
const tmpOut = join191(
|
|
615730
|
+
const { tmpdir: tmpdir27 } = await import("node:os");
|
|
615731
|
+
const tmpIn = join191(tmpdir27(), `omnius_img_in_${Date.now()}.png`);
|
|
615732
|
+
const tmpOut = join191(tmpdir27(), `omnius_img_out_${Date.now()}.jpg`);
|
|
615350
615733
|
writeFileSync98(tmpIn, buffer2);
|
|
615351
615734
|
const pyBin = process.platform === "win32" ? "python" : "python3";
|
|
615352
615735
|
const resizeScript = [
|
|
@@ -617079,7 +617462,7 @@ var init_constraint_learner = __esm({
|
|
|
617079
617462
|
import { existsSync as existsSync108, statSync as statSync45, openSync, readSync, closeSync, unlinkSync as unlinkSync19, writeFileSync as writeFileSync51 } from "node:fs";
|
|
617080
617463
|
import { watch as fsWatch } from "node:fs";
|
|
617081
617464
|
import { join as join116 } from "node:path";
|
|
617082
|
-
import { tmpdir as
|
|
617465
|
+
import { tmpdir as tmpdir22 } from "node:os";
|
|
617083
617466
|
import { randomBytes as randomBytes21 } from "node:crypto";
|
|
617084
617467
|
var NexusAgenticBackend;
|
|
617085
617468
|
var init_nexusBackend = __esm({
|
|
@@ -617258,7 +617641,7 @@ var init_nexusBackend = __esm({
|
|
|
617258
617641
|
* Falls back to unary + word-split if streaming setup fails.
|
|
617259
617642
|
*/
|
|
617260
617643
|
async *chatCompletionStream(request) {
|
|
617261
|
-
const streamFile = join116(
|
|
617644
|
+
const streamFile = join116(tmpdir22(), `nexus-stream-${randomBytes21(6).toString("hex")}.jsonl`);
|
|
617262
617645
|
writeFileSync51(streamFile, "", "utf8");
|
|
617263
617646
|
const effectiveThink = this.effectiveThink(request);
|
|
617264
617647
|
const daemonArgs = {
|
|
@@ -622379,7 +622762,7 @@ var init_missionSystem = __esm({
|
|
|
622379
622762
|
// packages/orchestrator/dist/context-references.js
|
|
622380
622763
|
import { readFileSync as readFileSync90, readdirSync as readdirSync36, statSync as statSync46 } from "node:fs";
|
|
622381
622764
|
import { homedir as homedir38 } from "node:os";
|
|
622382
|
-
import { join as join124, resolve as resolve59, relative as
|
|
622765
|
+
import { join as join124, resolve as resolve59, relative as relative15, sep as sep8, extname as extname13 } from "node:path";
|
|
622383
622766
|
function estimateTokens8(text2) {
|
|
622384
622767
|
return Math.ceil(text2.length / CHARS_PER_TOKEN);
|
|
622385
622768
|
}
|
|
@@ -622417,7 +622800,7 @@ function resolvePath4(cwd4, target, allowedRoot) {
|
|
|
622417
622800
|
const resolved = resolve59(expanded);
|
|
622418
622801
|
if (allowedRoot) {
|
|
622419
622802
|
const allowed = resolve59(allowedRoot);
|
|
622420
|
-
if (!resolved.startsWith(allowed +
|
|
622803
|
+
if (!resolved.startsWith(allowed + sep8) && resolved !== allowed) {
|
|
622421
622804
|
throw new Error("path is outside the allowed workspace");
|
|
622422
622805
|
}
|
|
622423
622806
|
}
|
|
@@ -622433,7 +622816,7 @@ function ensureReferencePathAllowed(filePath) {
|
|
|
622433
622816
|
}
|
|
622434
622817
|
for (const dir of SENSITIVE_HOME_DIRS) {
|
|
622435
622818
|
const blockedDir = resolve59(join124(home, dir));
|
|
622436
|
-
if (filePath.startsWith(blockedDir +
|
|
622819
|
+
if (filePath.startsWith(blockedDir + sep8) || filePath === blockedDir) {
|
|
622437
622820
|
throw new Error("path is a sensitive credential or internal path and cannot be attached");
|
|
622438
622821
|
}
|
|
622439
622822
|
}
|
|
@@ -622505,7 +622888,7 @@ function codeFenceLanguage(filePath) {
|
|
|
622505
622888
|
}
|
|
622506
622889
|
function buildFolderListing(dirPath, cwd4, limit = 200) {
|
|
622507
622890
|
const lines = [];
|
|
622508
|
-
const cwdRel =
|
|
622891
|
+
const cwdRel = relative15(cwd4, dirPath) || ".";
|
|
622509
622892
|
lines.push(`${cwdRel}/`);
|
|
622510
622893
|
let count = 0;
|
|
622511
622894
|
const walkDir = (current, depth) => {
|
|
@@ -627959,7 +628342,7 @@ var init_live_resource_arbiter = __esm({
|
|
|
627959
628342
|
// packages/cli/src/tui/live-sensors.ts
|
|
627960
628343
|
import { existsSync as existsSync119, mkdirSync as mkdirSync72, readFileSync as readFileSync96, writeFileSync as writeFileSync60 } from "node:fs";
|
|
627961
628344
|
import { arch as arch3, freemem as freemem5 } from "node:os";
|
|
627962
|
-
import { basename as basename25, join as join130, relative as
|
|
628345
|
+
import { basename as basename25, join as join130, relative as relative16 } from "node:path";
|
|
627963
628346
|
function liveDir(repoRoot) {
|
|
627964
628347
|
return join130(repoRoot, ".omnius", "live");
|
|
627965
628348
|
}
|
|
@@ -630599,7 +630982,7 @@ var init_live_sensors = __esm({
|
|
|
630599
630982
|
const rotation = orientation?.rotation ?? 0;
|
|
630600
630983
|
const streamFrame = this.cameraStreamers?.latestFrame(source);
|
|
630601
630984
|
if (streamFrame && Date.now() - streamFrame.mtimeMs < 3e3) {
|
|
630602
|
-
const displayPath2 =
|
|
630985
|
+
const displayPath2 = relative16(this.repoRoot, streamFrame.path).startsWith("..") ? streamFrame.path : relative16(this.repoRoot, streamFrame.path);
|
|
630603
630986
|
const previewWidth2 = Math.max(42, Math.min(120, Math.floor(Number(options2.previewWidth ?? (process.stdout.columns || 100) - 14))));
|
|
630604
630987
|
const preview2 = await buildImageAsciiPreview(streamFrame.path, { width: previewWidth2 });
|
|
630605
630988
|
if (!this.isVideoWorkCurrent(generation)) return { ok: false, message: "Video context is disabled." };
|
|
@@ -630690,7 +631073,7 @@ var init_live_sensors = __esm({
|
|
|
630690
631073
|
}
|
|
630691
631074
|
const framePath = extractSavedImagePath(result.output, this.repoRoot);
|
|
630692
631075
|
if (!framePath) return { ok: false, message: "Camera capture succeeded but no saved image path was returned." };
|
|
630693
|
-
const displayPath =
|
|
631076
|
+
const displayPath = relative16(this.repoRoot, framePath).startsWith("..") ? framePath : relative16(this.repoRoot, framePath);
|
|
630694
631077
|
const previewWidth = Math.max(42, Math.min(120, Math.floor(Number(options2.previewWidth ?? (process.stdout.columns || 100) - 14))));
|
|
630695
631078
|
const preview = await buildImageAsciiPreview(framePath, { width: previewWidth });
|
|
630696
631079
|
if (!this.isVideoWorkCurrent(generation)) return { ok: false, message: "Video context is disabled." };
|
|
@@ -631307,7 +631690,7 @@ ${analysis}` : ""
|
|
|
631307
631690
|
this.lastStreamFrameMtime.set(source, frame.mtimeMs);
|
|
631308
631691
|
const observedAt = Date.now();
|
|
631309
631692
|
const orientation = this.getCameraOrientation(source);
|
|
631310
|
-
const displayPath =
|
|
631693
|
+
const displayPath = relative16(this.repoRoot, frame.path).startsWith("..") ? frame.path : relative16(this.repoRoot, frame.path);
|
|
631311
631694
|
const existing = this.snapshot.cameras?.[source] ?? { updatedAt: observedAt, source };
|
|
631312
631695
|
const camera = {
|
|
631313
631696
|
...existing,
|
|
@@ -632092,9 +632475,9 @@ var init_tool_adapter = __esm({
|
|
|
632092
632475
|
|
|
632093
632476
|
// packages/cli/src/tui/runtime-verification.ts
|
|
632094
632477
|
import { existsSync as existsSync120, readFileSync as readFileSync97, readdirSync as readdirSync38 } from "node:fs";
|
|
632095
|
-
import { dirname as dirname38, extname as extname14, join as join131, relative as
|
|
632478
|
+
import { dirname as dirname38, extname as extname14, join as join131, relative as relative17, resolve as resolve61 } from "node:path";
|
|
632096
632479
|
function safeRelative(root, file) {
|
|
632097
|
-
const rel =
|
|
632480
|
+
const rel = relative17(root, file);
|
|
632098
632481
|
return rel && !rel.startsWith("..") ? rel : file;
|
|
632099
632482
|
}
|
|
632100
632483
|
function collectHtmlFiles(root, maxFiles) {
|
|
@@ -632138,7 +632521,7 @@ function resolveScriptSource(root, htmlFile, src2) {
|
|
|
632138
632521
|
const clean5 = withoutHash.split("?", 1)[0] ?? "";
|
|
632139
632522
|
if (!clean5 || !SCRIPT_EXTS.has(extname14(clean5).toLowerCase())) return null;
|
|
632140
632523
|
const abs = clean5.startsWith("/") ? resolve61(root, `.${clean5}`) : resolve61(dirname38(htmlFile), clean5);
|
|
632141
|
-
const rel =
|
|
632524
|
+
const rel = relative17(root, abs);
|
|
632142
632525
|
if (rel.startsWith("..") || rel === "") return null;
|
|
632143
632526
|
return existsSync120(abs) ? abs : null;
|
|
632144
632527
|
}
|
|
@@ -637949,11 +638332,11 @@ function wrapToWidth(text2, width) {
|
|
|
637949
638332
|
}
|
|
637950
638333
|
function wrapListItems(items, width) {
|
|
637951
638334
|
if (items.length === 0) return [];
|
|
637952
|
-
const
|
|
638335
|
+
const sep11 = " · ";
|
|
637953
638336
|
const lines = [];
|
|
637954
638337
|
let current = "";
|
|
637955
638338
|
for (const item of items) {
|
|
637956
|
-
const candidate = current === "" ? item : current +
|
|
638339
|
+
const candidate = current === "" ? item : current + sep11 + item;
|
|
637957
638340
|
if (visibleLength(candidate) <= width) {
|
|
637958
638341
|
current = candidate;
|
|
637959
638342
|
} else {
|
|
@@ -640306,13 +640689,13 @@ function stripTrustTierWrapperForTui(text2, maxWrapperChars = 400) {
|
|
|
640306
640689
|
).replace(/^---[ \t]*(?:\n)?/, "").replace(/(?:\n)?---[ \t]*$/, "");
|
|
640307
640690
|
}
|
|
640308
640691
|
function wrapFooterItems(items, width) {
|
|
640309
|
-
const
|
|
640692
|
+
const sep11 = " · ";
|
|
640310
640693
|
const lines = [];
|
|
640311
640694
|
let current = "";
|
|
640312
640695
|
for (const item of items) {
|
|
640313
640696
|
const clean5 = item.replace(/\s+/g, " ").trim();
|
|
640314
640697
|
if (!clean5) continue;
|
|
640315
|
-
const candidate = current ? `${current}${
|
|
640698
|
+
const candidate = current ? `${current}${sep11}${clean5}` : clean5;
|
|
640316
640699
|
if (visibleLen(candidate) <= width) {
|
|
640317
640700
|
current = candidate;
|
|
640318
640701
|
continue;
|
|
@@ -641409,14 +641792,14 @@ function renderRichHeader(opts) {
|
|
|
641409
641792
|
let lineLen = 14;
|
|
641410
641793
|
for (let i2 = 0; i2 < TOOL_NAMES.length; i2++) {
|
|
641411
641794
|
const name10 = TOOL_NAMES[i2];
|
|
641412
|
-
const
|
|
641795
|
+
const sep11 = i2 < TOOL_NAMES.length - 1 ? " " : "";
|
|
641413
641796
|
if (lineLen + name10.length + 1 > w - 4) {
|
|
641414
641797
|
process.stdout.write(`
|
|
641415
641798
|
${" ".repeat(14)}`);
|
|
641416
641799
|
lineLen = 14;
|
|
641417
641800
|
lines++;
|
|
641418
641801
|
}
|
|
641419
|
-
process.stdout.write(`${c3.cyan(name10)}${
|
|
641802
|
+
process.stdout.write(`${c3.cyan(name10)}${sep11}`);
|
|
641420
641803
|
lineLen += name10.length + 1;
|
|
641421
641804
|
}
|
|
641422
641805
|
process.stdout.write("\n");
|
|
@@ -647786,7 +648169,7 @@ __export(omnius_directory_exports, {
|
|
|
647786
648169
|
writeTaskHandoff: () => writeTaskHandoff2
|
|
647787
648170
|
});
|
|
647788
648171
|
import { appendFileSync as appendFileSync14, cpSync as cpSync2, existsSync as existsSync126, mkdirSync as mkdirSync77, readFileSync as readFileSync103, writeFileSync as writeFileSync65, readdirSync as readdirSync42, statSync as statSync52, unlinkSync as unlinkSync24, openSync as openSync4, closeSync as closeSync4, renameSync as renameSync12, watch as fsWatch3 } from "node:fs";
|
|
647789
|
-
import { join as join137, relative as
|
|
648172
|
+
import { join as join137, relative as relative18, basename as basename27, dirname as dirname40, resolve as resolve64 } from "node:path";
|
|
647790
648173
|
import { homedir as homedir43 } from "node:os";
|
|
647791
648174
|
import { createHash as createHash50 } from "node:crypto";
|
|
647792
648175
|
function isGitRoot(dir) {
|
|
@@ -647852,7 +648235,7 @@ function ensureOmniusIgnored(repoRoot) {
|
|
|
647852
648235
|
const gitignorePath = findNearestExistingGitignore(repoRoot, gitRoot);
|
|
647853
648236
|
if (!gitignorePath) return;
|
|
647854
648237
|
const gitignoreDir = dirname40(gitignorePath);
|
|
647855
|
-
const relDir =
|
|
648238
|
+
const relDir = relative18(gitignoreDir || ".", repoRoot).replace(/\\/g, "/");
|
|
647856
648239
|
const ignorePattern = relDir && relDir !== "." ? `${relDir}/.omnius/` : ".omnius/";
|
|
647857
648240
|
const content = readFileSync103(gitignorePath, "utf-8");
|
|
647858
648241
|
const normalizedTarget = normalizeIgnoreRule(ignorePattern);
|
|
@@ -648031,7 +648414,7 @@ function discoverContextFiles(repoRoot, maxContentLen = 8e3) {
|
|
|
648031
648414
|
}
|
|
648032
648415
|
const type = normalizedName.includes("agents") ? "agents" : normalizedName === "omnius.md" || normalizedName === ".omnius.md" ? "omnius" : normalizedName.includes("claude") ? "claude" : normalizedName.includes("readme") ? "readme" : normalizedName.includes("architect") ? "architecture" : normalizedName.includes("contribut") ? "contributing" : "other";
|
|
648033
648416
|
found.push({
|
|
648034
|
-
path:
|
|
648417
|
+
path: relative18(repoRoot, filePath) || name10,
|
|
648035
648418
|
content,
|
|
648036
648419
|
type
|
|
648037
648420
|
});
|
|
@@ -664365,7 +664748,7 @@ var init_platforms = __esm({
|
|
|
664365
664748
|
|
|
664366
664749
|
// packages/cli/src/tui/workspace-explorer.ts
|
|
664367
664750
|
import { existsSync as existsSync135, readdirSync as readdirSync45, readFileSync as readFileSync111, statSync as statSync56 } from "node:fs";
|
|
664368
|
-
import { basename as basename31, extname as extname17, join as join145, relative as
|
|
664751
|
+
import { basename as basename31, extname as extname17, join as join145, relative as relative19, resolve as resolve67 } from "node:path";
|
|
664369
664752
|
function exploreWorkspace(root, options2 = {}) {
|
|
664370
664753
|
const query = (options2.query ?? "").trim().toLowerCase();
|
|
664371
664754
|
const maxResults = options2.maxResults ?? 80;
|
|
@@ -664398,7 +664781,7 @@ function exploreWorkspace(root, options2 = {}) {
|
|
|
664398
664781
|
}
|
|
664399
664782
|
if (!dirent.isFile()) continue;
|
|
664400
664783
|
totalScanned++;
|
|
664401
|
-
const rel =
|
|
664784
|
+
const rel = relative19(root, full).replace(/\\/g, "/");
|
|
664402
664785
|
if (query && !rel.toLowerCase().includes(query)) continue;
|
|
664403
664786
|
try {
|
|
664404
664787
|
const st = statSync56(full);
|
|
@@ -667626,7 +668009,7 @@ var init_audio_waveform = __esm({
|
|
|
667626
668009
|
|
|
667627
668010
|
// packages/cli/src/tui/neovim-mode.ts
|
|
667628
668011
|
import { existsSync as existsSync139, unlinkSync as unlinkSync26 } from "node:fs";
|
|
667629
|
-
import { tmpdir as
|
|
668012
|
+
import { tmpdir as tmpdir23 } from "node:os";
|
|
667630
668013
|
import { join as join148 } from "node:path";
|
|
667631
668014
|
function isNeovimActive() {
|
|
667632
668015
|
return _state2 !== null && !_state2.cleanedUp;
|
|
@@ -667672,7 +668055,7 @@ async function startNeovimMode(opts) {
|
|
|
667672
668055
|
);
|
|
667673
668056
|
} catch {
|
|
667674
668057
|
}
|
|
667675
|
-
const socketPath = join148(
|
|
668058
|
+
const socketPath = join148(tmpdir23(), `omnius-nvim-${process.pid}-${Date.now()}.sock`);
|
|
667676
668059
|
try {
|
|
667677
668060
|
if (existsSync139(socketPath)) unlinkSync26(socketPath);
|
|
667678
668061
|
} catch {
|
|
@@ -671764,7 +672147,7 @@ import {
|
|
|
671764
672147
|
rmSync as rmSync12
|
|
671765
672148
|
} from "node:fs";
|
|
671766
672149
|
import { join as join156, dirname as dirname48, resolve as resolve69 } from "node:path";
|
|
671767
|
-
import { homedir as homedir54, tmpdir as
|
|
672150
|
+
import { homedir as homedir54, tmpdir as tmpdir24, platform as platform7 } from "node:os";
|
|
671768
672151
|
import {
|
|
671769
672152
|
spawn as nodeSpawn
|
|
671770
672153
|
} from "node:child_process";
|
|
@@ -673878,7 +674261,7 @@ except Exception as exc:
|
|
|
673878
674261
|
}
|
|
673879
674262
|
this.onPCMOutput(Buffer.from(int16.buffer), sampleRate);
|
|
673880
674263
|
}
|
|
673881
|
-
const wavPath = join156(
|
|
674264
|
+
const wavPath = join156(tmpdir24(), `omnius-voice-${Date.now()}.wav`);
|
|
673882
674265
|
this.writeStereoWav(stereo.left, stereo.right, sampleRate, wavPath);
|
|
673883
674266
|
await this.playWav(wavPath);
|
|
673884
674267
|
try {
|
|
@@ -674449,7 +674832,7 @@ except Exception as exc:
|
|
|
674449
674832
|
const cleaned = injectExpressionTags ? applySupertonicExpressionTags(baseText, settings.expression, emotion) : baseText;
|
|
674450
674833
|
if (!cleaned) return null;
|
|
674451
674834
|
const wavPath = join156(
|
|
674452
|
-
|
|
674835
|
+
tmpdir24(),
|
|
674453
674836
|
`omnius-supertonic3-${Date.now()}-${Math.random().toString(36).slice(2, 6)}.wav`
|
|
674454
674837
|
);
|
|
674455
674838
|
try {
|
|
@@ -674520,7 +674903,7 @@ except Exception as exc:
|
|
|
674520
674903
|
return new Promise((resolve84, reject) => {
|
|
674521
674904
|
const proc = nodeSpawn("sh", ["-c", command], {
|
|
674522
674905
|
stdio: ["ignore", "pipe", "pipe"],
|
|
674523
|
-
cwd:
|
|
674906
|
+
cwd: tmpdir24(),
|
|
674524
674907
|
env: voicePythonEnv()
|
|
674525
674908
|
});
|
|
674526
674909
|
let stdout = "";
|
|
@@ -674607,7 +674990,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
|
|
|
674607
674990
|
const mlxModelId = model.mlxModelId ?? "mlx-community/Kokoro-82M-bf16";
|
|
674608
674991
|
const mlxVoice = model.mlxVoice ?? "af_heart";
|
|
674609
674992
|
const mlxLangCode = model.mlxLangCode ?? "a";
|
|
674610
|
-
const wavPath = join156(
|
|
674993
|
+
const wavPath = join156(tmpdir24(), `omnius-mlx-${Date.now()}.wav`);
|
|
674611
674994
|
const pyScript = [
|
|
674612
674995
|
"import sys, json",
|
|
674613
674996
|
"from mlx_audio.tts import generate as tts_gen",
|
|
@@ -674688,7 +675071,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
|
|
|
674688
675071
|
const mlxModelId = model.mlxModelId ?? "mlx-community/Kokoro-82M-bf16";
|
|
674689
675072
|
const mlxVoice = model.mlxVoice ?? "af_heart";
|
|
674690
675073
|
const mlxLangCode = model.mlxLangCode ?? "a";
|
|
674691
|
-
const wavPath = join156(
|
|
675074
|
+
const wavPath = join156(tmpdir24(), `omnius-mlx-buf-${Date.now()}.wav`);
|
|
674692
675075
|
const pyScript = [
|
|
674693
675076
|
"import sys, json",
|
|
674694
675077
|
"from mlx_audio.tts import generate as tts_gen",
|
|
@@ -675487,7 +675870,7 @@ if __name__ == '__main__':
|
|
|
675487
675870
|
const env2 = voicePythonEnv({ LUXTTS_REPO_PATH: luxttsRepoDir2() });
|
|
675488
675871
|
const daemon = nodeSpawn(venvPy, [luxttsInferScript2()], {
|
|
675489
675872
|
stdio: ["pipe", "pipe", "pipe"],
|
|
675490
|
-
cwd:
|
|
675873
|
+
cwd: tmpdir24(),
|
|
675491
675874
|
env: env2
|
|
675492
675875
|
});
|
|
675493
675876
|
this._luxttsDaemon = daemon;
|
|
@@ -675577,7 +675960,7 @@ if __name__ == '__main__':
|
|
|
675577
675960
|
const ready = await this.ensureLuxttsDaemon();
|
|
675578
675961
|
if (!ready) return null;
|
|
675579
675962
|
const wavPath = join156(
|
|
675580
|
-
|
|
675963
|
+
tmpdir24(),
|
|
675581
675964
|
`omnius-luxtts-${Date.now()}-${Math.random().toString(36).slice(2, 6)}.wav`
|
|
675582
675965
|
);
|
|
675583
675966
|
try {
|
|
@@ -675718,7 +676101,7 @@ if __name__ == '__main__':
|
|
|
675718
676101
|
if (!cleaned) return null;
|
|
675719
676102
|
const ready = await this.ensureLuxttsDaemon();
|
|
675720
676103
|
if (!ready) return null;
|
|
675721
|
-
const wavPath = join156(
|
|
676104
|
+
const wavPath = join156(tmpdir24(), `omnius-luxtts-buf-${Date.now()}.wav`);
|
|
675722
676105
|
try {
|
|
675723
676106
|
await this.luxttsRequest({
|
|
675724
676107
|
action: "synthesize",
|
|
@@ -675852,7 +676235,7 @@ if __name__ == "__main__":
|
|
|
675852
676235
|
});
|
|
675853
676236
|
const daemon = nodeSpawn(venvPy, [misottsInferScript2()], {
|
|
675854
676237
|
stdio: ["pipe", "pipe", "pipe"],
|
|
675855
|
-
cwd:
|
|
676238
|
+
cwd: tmpdir24(),
|
|
675856
676239
|
env: env2
|
|
675857
676240
|
});
|
|
675858
676241
|
this._misottsDaemon = daemon;
|
|
@@ -675936,7 +676319,7 @@ if __name__ == "__main__":
|
|
|
675936
676319
|
const ready = await this.ensureMisottsDaemon();
|
|
675937
676320
|
if (!ready) return null;
|
|
675938
676321
|
const wavPath = join156(
|
|
675939
|
-
|
|
676322
|
+
tmpdir24(),
|
|
675940
676323
|
`omnius-misotts-${Date.now()}-${Math.random().toString(36).slice(2, 6)}.wav`
|
|
675941
676324
|
);
|
|
675942
676325
|
try {
|
|
@@ -676086,7 +676469,7 @@ if __name__ == "__main__":
|
|
|
676086
676469
|
if (!cleaned) return null;
|
|
676087
676470
|
const ready = await this.ensureMisottsDaemon();
|
|
676088
676471
|
if (!ready) return null;
|
|
676089
|
-
const wavPath = join156(
|
|
676472
|
+
const wavPath = join156(tmpdir24(), `omnius-misotts-buf-${Date.now()}.wav`);
|
|
676090
676473
|
try {
|
|
676091
676474
|
const settings = this.getMisottsSettings();
|
|
676092
676475
|
const cloneName = this.misottsCloneRef.split("/").pop() ?? "";
|
|
@@ -676458,7 +676841,7 @@ import {
|
|
|
676458
676841
|
appendFileSync as appendFileSync16,
|
|
676459
676842
|
writeSync as writeSync3
|
|
676460
676843
|
} from "node:fs";
|
|
676461
|
-
import { basename as basename32, dirname as dirname49, relative as
|
|
676844
|
+
import { basename as basename32, dirname as dirname49, relative as relative20, join as join157 } from "node:path";
|
|
676462
676845
|
function omniusPinnedDependencyVersion(name10) {
|
|
676463
676846
|
const spec = OMNIUS_PINNED_DEPENDENCY_SPECS[name10];
|
|
676464
676847
|
if (!spec) return null;
|
|
@@ -676927,10 +677310,10 @@ async function ensureVoiceDeps(ctx3) {
|
|
|
676927
677310
|
if (existsSync178(venvPy)) {
|
|
676928
677311
|
process.env.TRANSCRIBE_PYTHON = venvPy;
|
|
676929
677312
|
const venvBin = dirname59(venvPy);
|
|
676930
|
-
const
|
|
677313
|
+
const sep11 = process.platform === "win32" ? ";" : ":";
|
|
676931
677314
|
const cur = process.env.PATH || "";
|
|
676932
|
-
if (!cur.split(
|
|
676933
|
-
process.env.PATH = `${venvBin}${
|
|
677315
|
+
if (!cur.split(sep11).includes(venvBin)) {
|
|
677316
|
+
process.env.PATH = `${venvBin}${sep11}${cur}`;
|
|
676934
677317
|
}
|
|
676935
677318
|
}
|
|
676936
677319
|
}
|
|
@@ -685506,7 +685889,7 @@ async function handleImageCommand(ctx3, arg, hasLocal) {
|
|
|
685506
685889
|
const imagePath = extractSavedImagePath2(result.output, ctx3.repoRoot);
|
|
685507
685890
|
if (imagePath) {
|
|
685508
685891
|
const preview = await buildImageAsciiPreview2(imagePath);
|
|
685509
|
-
const displayPath =
|
|
685892
|
+
const displayPath = relative20(ctx3.repoRoot, imagePath).startsWith("..") ? imagePath : relative20(ctx3.repoRoot, imagePath);
|
|
685510
685893
|
if (preview) {
|
|
685511
685894
|
renderImageAsciiPreview(
|
|
685512
685895
|
"Generated image",
|
|
@@ -703130,9 +703513,9 @@ import {
|
|
|
703130
703513
|
extname as extname20,
|
|
703131
703514
|
isAbsolute as isAbsolute16,
|
|
703132
703515
|
join as join168,
|
|
703133
|
-
relative as
|
|
703516
|
+
relative as relative21,
|
|
703134
703517
|
resolve as resolve74,
|
|
703135
|
-
sep as
|
|
703518
|
+
sep as sep9
|
|
703136
703519
|
} from "node:path";
|
|
703137
703520
|
function telegramCreativeWorkspaceRoot(repoRoot, chatId) {
|
|
703138
703521
|
const raw = chatId === void 0 ? "unknown" : String(chatId);
|
|
@@ -703424,7 +703807,7 @@ function guardPath(root, rawPath) {
|
|
|
703424
703807
|
error: `Path escapes the public creative workspace. Use a relative path under ${rootAbs}.`
|
|
703425
703808
|
};
|
|
703426
703809
|
}
|
|
703427
|
-
const rel =
|
|
703810
|
+
const rel = relative21(rootAbs, abs) || ".";
|
|
703428
703811
|
if (rel.startsWith("..") || isAbsolute16(rel)) {
|
|
703429
703812
|
return {
|
|
703430
703813
|
ok: false,
|
|
@@ -703442,7 +703825,7 @@ function guardPath(root, rawPath) {
|
|
|
703442
703825
|
function isInside(root, path16) {
|
|
703443
703826
|
const rootAbs = resolve74(root);
|
|
703444
703827
|
const pathAbs = resolve74(path16);
|
|
703445
|
-
return pathAbs === rootAbs || pathAbs.startsWith(rootAbs.endsWith(
|
|
703828
|
+
return pathAbs === rootAbs || pathAbs.startsWith(rootAbs.endsWith(sep9) ? rootAbs : rootAbs + sep9);
|
|
703446
703829
|
}
|
|
703447
703830
|
function looksLikeLocalPath(value2) {
|
|
703448
703831
|
return value2.startsWith("/") || value2.startsWith("./") || value2.startsWith("../");
|
|
@@ -707296,7 +707679,7 @@ import {
|
|
|
707296
707679
|
dirname as dirname53,
|
|
707297
707680
|
resolve as resolve75,
|
|
707298
707681
|
basename as basename42,
|
|
707299
|
-
relative as
|
|
707682
|
+
relative as relative22,
|
|
707300
707683
|
isAbsolute as isAbsolute17,
|
|
707301
707684
|
extname as extname21
|
|
707302
707685
|
} from "node:path";
|
|
@@ -709374,8 +709757,8 @@ function telegramCachedMediaIsVideo(entry) {
|
|
|
709374
709757
|
extname21(entry.localPath).toLowerCase()
|
|
709375
709758
|
);
|
|
709376
709759
|
}
|
|
709377
|
-
function
|
|
709378
|
-
const rel =
|
|
709760
|
+
function isPathInside2(root, path16) {
|
|
709761
|
+
const rel = relative22(resolve75(root), resolve75(path16));
|
|
709379
709762
|
return rel === "" || Boolean(rel) && !rel.startsWith("..") && !isAbsolute17(rel);
|
|
709380
709763
|
}
|
|
709381
709764
|
function extractTelegramMentionedUsernames(message2, text2) {
|
|
@@ -714777,7 +715160,7 @@ ${mediaContext}` : ""
|
|
|
714777
715160
|
});
|
|
714778
715161
|
if (matchingEntry) return { ok: true, path: matchingEntry.localPath };
|
|
714779
715162
|
const creativeCandidate = isAbsolute17(raw) ? resolve75(raw) : resolve75(creativeRoot, raw);
|
|
714780
|
-
if (
|
|
715163
|
+
if (isPathInside2(creativeRoot, creativeCandidate) && existsSync161(creativeCandidate)) {
|
|
714781
715164
|
return { ok: true, path: creativeCandidate };
|
|
714782
715165
|
}
|
|
714783
715166
|
return {
|
|
@@ -714887,7 +715270,7 @@ ${mediaContext}` : ""
|
|
|
714887
715270
|
const creativeRoot = telegramCreativeWorkspaceRoot(repoRoot, chatId);
|
|
714888
715271
|
const raw = String(rawValue || fallbackName).trim() || fallbackName;
|
|
714889
715272
|
const outputPath3 = isAbsolute17(raw) ? resolve75(raw) : resolve75(creativeRoot, raw);
|
|
714890
|
-
if (!
|
|
715273
|
+
if (!isPathInside2(creativeRoot, outputPath3)) {
|
|
714891
715274
|
return {
|
|
714892
715275
|
ok: false,
|
|
714893
715276
|
error: `Output path must stay inside this Telegram chat's creative workspace: ${raw}`
|
|
@@ -724785,7 +725168,7 @@ ${knownList}` : "Private-user telegram_send_file target must be this DM or a kno
|
|
|
724785
725168
|
const trimmed = rawPath.trim().replace(/^["']|["']$/g, "");
|
|
724786
725169
|
if (scopedRoot) {
|
|
724787
725170
|
const logicalPath = isAbsolute17(trimmed) ? resolve75(trimmed) : resolve75(base3, trimmed);
|
|
724788
|
-
if (!
|
|
725171
|
+
if (!isPathInside2(base3, logicalPath)) {
|
|
724789
725172
|
return {
|
|
724790
725173
|
ok: false,
|
|
724791
725174
|
error: `Path escapes the scoped Telegram creative workspace: ${trimmed}`
|
|
@@ -725619,7 +726002,7 @@ Content-Type: ${contentType}\r
|
|
|
725619
726002
|
);
|
|
725620
726003
|
for (const path16 of paths) {
|
|
725621
726004
|
const abs = resolve75(path16);
|
|
725622
|
-
if (!
|
|
726005
|
+
if (!isPathInside2(rootAbs, abs)) continue;
|
|
725623
726006
|
if (alreadyDelivered.has(abs)) continue;
|
|
725624
726007
|
if (!includeMentioned && alreadySentByText.has(abs)) continue;
|
|
725625
726008
|
const materialized = materializeTelegramCreativeArtifactForSend(
|
|
@@ -725936,15 +726319,15 @@ Content-Type: ${mimeForPath(pathOrFileId, field === "photo" ? "image" : "video")
|
|
|
725936
726319
|
let filename = "response.wav";
|
|
725937
726320
|
let mimeType = "audio/wav";
|
|
725938
726321
|
try {
|
|
725939
|
-
const { tmpdir:
|
|
726322
|
+
const { tmpdir: tmpdir27 } = await import("node:os");
|
|
725940
726323
|
const { join: joinPath } = await import("node:path");
|
|
725941
726324
|
const {
|
|
725942
726325
|
writeFileSync: writeFs,
|
|
725943
726326
|
readFileSync: readFs,
|
|
725944
726327
|
unlinkSync: unlinkFs
|
|
725945
726328
|
} = await import("node:fs");
|
|
725946
|
-
const tmpWav = joinPath(
|
|
725947
|
-
const tmpOgg = joinPath(
|
|
726329
|
+
const tmpWav = joinPath(tmpdir27(), `omnius-tg-voice-${Date.now()}.wav`);
|
|
726330
|
+
const tmpOgg = joinPath(tmpdir27(), `omnius-tg-voice-${Date.now()}.ogg`);
|
|
725948
726331
|
writeFs(tmpWav, wavBuffer);
|
|
725949
726332
|
await execFileText5(
|
|
725950
726333
|
"ffmpeg",
|
|
@@ -731203,7 +731586,7 @@ __export(graphical_sudo_exports, {
|
|
|
731203
731586
|
import { spawn as spawn36 } from "node:child_process";
|
|
731204
731587
|
import { existsSync as existsSync170, mkdirSync as mkdirSync106, writeFileSync as writeFileSync90, chmodSync as chmodSync6 } from "node:fs";
|
|
731205
731588
|
import { join as join179 } from "node:path";
|
|
731206
|
-
import { tmpdir as
|
|
731589
|
+
import { tmpdir as tmpdir25 } from "node:os";
|
|
731207
731590
|
function detectSudoHelper() {
|
|
731208
731591
|
if (process.platform === "win32") return null;
|
|
731209
731592
|
if (process.platform === "darwin") return "osascript";
|
|
@@ -731224,7 +731607,7 @@ function which2(cmd) {
|
|
|
731224
731607
|
return null;
|
|
731225
731608
|
}
|
|
731226
731609
|
function ensureAskpassShim(helper, description) {
|
|
731227
|
-
const shimDir = join179(
|
|
731610
|
+
const shimDir = join179(tmpdir25(), "omnius-askpass");
|
|
731228
731611
|
mkdirSync106(shimDir, { recursive: true });
|
|
731229
731612
|
const shim = join179(shimDir, `${helper}.sh`);
|
|
731230
731613
|
let body;
|
|
@@ -754316,11 +754699,11 @@ async function handleRequest(req3, res, ollamaUrl, verbose, runtimeDefaults = {}
|
|
|
754316
754699
|
});
|
|
754317
754700
|
return;
|
|
754318
754701
|
}
|
|
754319
|
-
const { tmpdir:
|
|
754702
|
+
const { tmpdir: tmpdir27 } = await import("node:os");
|
|
754320
754703
|
const { writeFileSync: writeFileSync98, unlinkSync: unlinkSync40 } = await import("node:fs");
|
|
754321
754704
|
const { join: pjoin } = await import("node:path");
|
|
754322
754705
|
const tmpPath = pjoin(
|
|
754323
|
-
|
|
754706
|
+
tmpdir27(),
|
|
754324
754707
|
`omnius-clone-upload-${Date.now()}-${safeName3}`
|
|
754325
754708
|
);
|
|
754326
754709
|
writeFileSync98(tmpPath, buf);
|
|
@@ -759072,7 +759455,7 @@ var init_clipboard_media = __esm({
|
|
|
759072
759455
|
|
|
759073
759456
|
// packages/cli/src/tui/interactive.ts
|
|
759074
759457
|
import { cwd } from "node:process";
|
|
759075
|
-
import { resolve as resolve80, join as join186, dirname as dirname57, extname as extname22, relative as
|
|
759458
|
+
import { resolve as resolve80, join as join186, dirname as dirname57, extname as extname22, relative as relative23, sep as sep10 } from "node:path";
|
|
759076
759459
|
import { createRequire as createRequire9 } from "node:module";
|
|
759077
759460
|
import { fileURLToPath as fileURLToPath24 } from "node:url";
|
|
759078
759461
|
import { createHash as createHash59 } from "node:crypto";
|
|
@@ -761353,7 +761736,7 @@ async function renderAsciiPreviewForToolResult(toolName, output, repoRoot, write
|
|
|
761353
761736
|
}
|
|
761354
761737
|
return;
|
|
761355
761738
|
}
|
|
761356
|
-
const displayPath =
|
|
761739
|
+
const displayPath = relative23(repoRoot, imagePath).startsWith("..") ? imagePath : relative23(repoRoot, imagePath);
|
|
761357
761740
|
const title = toolName === "generate_image" ? "Generated image" : toolName === "screenshot" ? "Screenshot" : toolName === "vision_action_loop" ? "Vision loop screenshot" : toolName === "camera_capture" ? "Camera frame" : "Image";
|
|
761358
761741
|
await renderAsciiPreviewForImage(imagePath, displayPath, title, writer);
|
|
761359
761742
|
} catch (err) {
|
|
@@ -761377,7 +761760,7 @@ async function playGeneratedAudioForToolResult(toolName, output, repoRoot, write
|
|
|
761377
761760
|
return;
|
|
761378
761761
|
const audioPath = extractGeneratedAudioPath(output, repoRoot);
|
|
761379
761762
|
if (!audioPath) return;
|
|
761380
|
-
const displayPath =
|
|
761763
|
+
const displayPath = relative23(repoRoot, audioPath).startsWith("..") ? audioPath : relative23(repoRoot, audioPath);
|
|
761381
761764
|
const waveform = renderAudioWaveform(audioPath, {
|
|
761382
761765
|
widthChars: Math.max(32, Math.min(96, termCols() - 4)),
|
|
761383
761766
|
heightChars: 8
|
|
@@ -761430,7 +761813,10 @@ async function runSelfImprovementCycle(repoRoot) {
|
|
|
761430
761813
|
} catch {
|
|
761431
761814
|
}
|
|
761432
761815
|
}
|
|
761433
|
-
function
|
|
761816
|
+
function isExplicitRestoredTaskContinuation(input) {
|
|
761817
|
+
return /^(?:continue|resume|pick\s+up|carry\s+on)\b/i.test(input.trim());
|
|
761818
|
+
}
|
|
761819
|
+
function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce, statusBar, sudoCallback, costTracker, onComplete, taskType, contextWindowSize, modelCaps, personality, deepContext, onCompaction, emotionEngine, flowEnabled, slashCommandHandler, thinkingEnabled, askUserCallback, selfModifyEnabled, sessionMetrics, realtimeEnabled, restoredRunSessionId, restoredOrientation, actualUserGoal) {
|
|
761434
761820
|
const voiceStyleMap = {
|
|
761435
761821
|
concise: 1,
|
|
761436
761822
|
balanced: 3,
|
|
@@ -763202,7 +763588,11 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
763202
763588
|
ownerId: `session:${sessionId}`
|
|
763203
763589
|
},
|
|
763204
763590
|
async () => {
|
|
763205
|
-
const result = await runner.run(
|
|
763591
|
+
const result = await runner.run(
|
|
763592
|
+
effectiveTask,
|
|
763593
|
+
systemContext,
|
|
763594
|
+
actualUserGoal ?? task
|
|
763595
|
+
);
|
|
763206
763596
|
_apiCallbacks?.onRunResult?.(result);
|
|
763207
763597
|
const tokens = {
|
|
763208
763598
|
total: result.totalTokens,
|
|
@@ -765163,7 +765553,7 @@ This is an independent background session started from /background.`
|
|
|
765163
765553
|
try {
|
|
765164
765554
|
const st = statSync70(full);
|
|
765165
765555
|
const suffix = st.isDirectory() ? "/" : "";
|
|
765166
|
-
const display = isAbsolute18 ? full : full.startsWith(repoRoot +
|
|
765556
|
+
const display = isAbsolute18 ? full : full.startsWith(repoRoot + sep10) ? full.slice(repoRoot.length + 1) : full;
|
|
765167
765557
|
completions.push(display + suffix);
|
|
765168
765558
|
} catch {
|
|
765169
765559
|
}
|
|
@@ -766334,7 +766724,7 @@ This is an independent background session started from /background.`
|
|
|
766334
766724
|
ok: false,
|
|
766335
766725
|
message: "Clipboard does not contain a supported image or no clipboard reader is available."
|
|
766336
766726
|
};
|
|
766337
|
-
const relPath =
|
|
766727
|
+
const relPath = relative23(repoRoot, pasted.path).startsWith("..") ? pasted.path : relative23(repoRoot, pasted.path);
|
|
766338
766728
|
const asciiContextPromise = renderAsciiPreviewForImage(
|
|
766339
766729
|
pasted.path,
|
|
766340
766730
|
relPath,
|
|
@@ -769459,7 +769849,8 @@ ${formatTaskCompletionMeta(previousMetaForIntake)}`
|
|
|
769459
769849
|
} catch {
|
|
769460
769850
|
}
|
|
769461
769851
|
let taskInput = fullInput;
|
|
769462
|
-
|
|
769852
|
+
const reuseRestoredTaskSession = Boolean(restoredTaskSessionId) && isExplicitRestoredTaskContinuation(fullInput);
|
|
769853
|
+
let taskSessionId = reuseRestoredTaskSession ? restoredTaskSessionId : null;
|
|
769463
769854
|
let restoredOrientation = null;
|
|
769464
769855
|
if (restoredSessionContext) {
|
|
769465
769856
|
restoredOrientation = sanitizeRestorePromptForModel(restoredSessionContext);
|
|
@@ -769516,7 +769907,8 @@ ${taskInput}`;
|
|
|
769516
769907
|
sessionMetrics,
|
|
769517
769908
|
realtimeEnabled,
|
|
769518
769909
|
taskSessionId,
|
|
769519
|
-
restoredOrientation
|
|
769910
|
+
restoredOrientation,
|
|
769911
|
+
fullInput
|
|
769520
769912
|
);
|
|
769521
769913
|
activeTask = task;
|
|
769522
769914
|
_recallText = null;
|
|
@@ -771262,7 +771654,7 @@ __export(eval_exports, {
|
|
|
771262
771654
|
evalCommand: () => evalCommand,
|
|
771263
771655
|
expectedStatusesForEvalTask: () => expectedStatusesForEvalTask
|
|
771264
771656
|
});
|
|
771265
|
-
import { tmpdir as
|
|
771657
|
+
import { tmpdir as tmpdir26 } from "node:os";
|
|
771266
771658
|
import { mkdirSync as mkdirSync114, writeFileSync as writeFileSync97 } from "node:fs";
|
|
771267
771659
|
import { join as join189 } from "node:path";
|
|
771268
771660
|
function expectedStatusesForEvalTask(task, live) {
|
|
@@ -771406,7 +771798,7 @@ async function evalCommand(opts, config) {
|
|
|
771406
771798
|
process.exit(failed > 0 ? 1 : 0);
|
|
771407
771799
|
}
|
|
771408
771800
|
function createTempEvalRepo() {
|
|
771409
|
-
const dir = join189(
|
|
771801
|
+
const dir = join189(tmpdir26(), `omnius-eval-${Date.now()}`);
|
|
771410
771802
|
mkdirSync114(dir, { recursive: true });
|
|
771411
771803
|
mkdirSync114(join189(dir, "src"), { recursive: true });
|
|
771412
771804
|
mkdirSync114(join189(dir, "tests"), { recursive: true });
|