omnius 1.0.498 → 1.0.499
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 +123 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -576445,6 +576445,13 @@ var init_debugArtifactLibrary = __esm({
|
|
|
576445
576445
|
});
|
|
576446
576446
|
|
|
576447
576447
|
// packages/orchestrator/dist/focusSupervisor.js
|
|
576448
|
+
function resolveFocusSupervisorSilent(envValue = process.env["OMNIUS_FOCUS_SUPERVISOR_SILENT"]) {
|
|
576449
|
+
const normalized = String(envValue ?? "").trim().toLowerCase();
|
|
576450
|
+
if (normalized === "0" || normalized === "false" || normalized === "off") {
|
|
576451
|
+
return false;
|
|
576452
|
+
}
|
|
576453
|
+
return true;
|
|
576454
|
+
}
|
|
576448
576455
|
function resolveFocusSupervisorMode(configured, envValue = process.env["OMNIUS_FOCUS_SUPERVISOR"]) {
|
|
576449
576456
|
if (configured)
|
|
576450
576457
|
return configured;
|
|
@@ -576813,9 +576820,12 @@ var init_focusSupervisor = __esm({
|
|
|
576813
576820
|
lastIgnoredDirectiveTurn = null;
|
|
576814
576821
|
repeatedViolationCounts = /* @__PURE__ */ new Map();
|
|
576815
576822
|
availableTools = null;
|
|
576823
|
+
/** SILENCE: when true, block() downgrades to pass() (never stops a call). */
|
|
576824
|
+
silent;
|
|
576816
576825
|
constructor(options2 = {}) {
|
|
576817
576826
|
this.mode = options2.mode ?? "auto";
|
|
576818
576827
|
this.modelTier = options2.modelTier ?? "large";
|
|
576828
|
+
this.silent = options2.silent ?? false;
|
|
576819
576829
|
this.repeatGateMax = Math.max(0, Math.floor(options2.repeatGateMax ?? 3));
|
|
576820
576830
|
this.availableTools = options2.availableTools ? new Set(Array.from(options2.availableTools)) : null;
|
|
576821
576831
|
this.convergenceBreaker = options2.convergenceBreaker ?? null;
|
|
@@ -577291,6 +577301,11 @@ var init_focusSupervisor = __esm({
|
|
|
577291
577301
|
};
|
|
577292
577302
|
}
|
|
577293
577303
|
block(directive, message2, success) {
|
|
577304
|
+
if (this.silent) {
|
|
577305
|
+
this.lastDecision = "block_silenced_pass";
|
|
577306
|
+
this.lastReason = directive.reason;
|
|
577307
|
+
return this.pass();
|
|
577308
|
+
}
|
|
577294
577309
|
this.lastDecision = "block_tool_call";
|
|
577295
577310
|
this.lastReason = directive.reason;
|
|
577296
577311
|
return {
|
|
@@ -582162,6 +582177,16 @@ var init_agenticRunner = __esm({
|
|
|
582162
582177
|
_todoInProgressTurn = /* @__PURE__ */ new Map();
|
|
582163
582178
|
/** Set of todo IDs that have already been chunked */
|
|
582164
582179
|
_todoChunked = /* @__PURE__ */ new Set();
|
|
582180
|
+
/**
|
|
582181
|
+
* Explicit tool-output → todo binding. As each FULL tool output is
|
|
582182
|
+
* externalized to .omnius/tool-results/ (the point where it would otherwise
|
|
582183
|
+
* bloat the context chain), we bind it to the todo that was in_progress at
|
|
582184
|
+
* that moment. On completion, that todo's ledger of full outputs is written
|
|
582185
|
+
* to disk (.omnius/todo-chunks/{id}.ledger.json) alongside the summary stub,
|
|
582186
|
+
* so the bulk stays retrievable but out of the live window. Keyed by todo id;
|
|
582187
|
+
* "_unassigned" holds outputs produced while no leaf was in_progress.
|
|
582188
|
+
*/
|
|
582189
|
+
_todoOutputLedger = /* @__PURE__ */ new Map();
|
|
582165
582190
|
// -- ENOENT tracker (prevents path-guessing spirals) --
|
|
582166
582191
|
// Tracks both consecutive AND sliding-window ENOENT counts. The sliding
|
|
582167
582192
|
// window catches oscillation patterns (success → ENOENT → success → ENOENT)
|
|
@@ -589417,6 +589442,12 @@ Respond with your assessment, then take action.`;
|
|
|
589417
589442
|
this._focusSupervisor = this.options.focusSupervisor === "off" ? null : new FocusSupervisor({
|
|
589418
589443
|
mode: this.options.focusSupervisor,
|
|
589419
589444
|
modelTier: this.options.modelTier,
|
|
589445
|
+
// SILENCE (operator directive): the supervisor must not stop agents
|
|
589446
|
+
// or re-serve cached responses from earlier commands. It observes,
|
|
589447
|
+
// sets directives, and advises, but every hard block downgrades to a
|
|
589448
|
+
// pass so the model is free to act — including re-reading to confirm
|
|
589449
|
+
// a change landed. Restore blocking with OMNIUS_FOCUS_SUPERVISOR_SILENT=0.
|
|
589450
|
+
silent: resolveFocusSupervisorSilent(),
|
|
589420
589451
|
repeatGateMax: this._resolveRepeatGateMax(),
|
|
589421
589452
|
availableTools: this.tools.keys(),
|
|
589422
589453
|
// WO-3: convergence circuit-breaker escalates a non-converging
|
|
@@ -589533,6 +589564,7 @@ Respond with your assessment, then take action.`;
|
|
|
589533
589564
|
}
|
|
589534
589565
|
this._fileRegistry.clear();
|
|
589535
589566
|
this._memexArchive.clear();
|
|
589567
|
+
this._todoOutputLedger.clear();
|
|
589536
589568
|
this._sessionId = this.options.sessionId && String(this.options.sessionId) || process.env["OMNIUS_SESSION_ID"] && String(process.env["OMNIUS_SESSION_ID"]) || `session-${Date.now()}`;
|
|
589537
589569
|
this._appState = createAppState({
|
|
589538
589570
|
sessionId: this._sessionId,
|
|
@@ -598019,6 +598051,17 @@ ${result.output}`, "utf-8");
|
|
|
598019
598051
|
} catch {
|
|
598020
598052
|
}
|
|
598021
598053
|
const savedPath = _pathJoin(this.omniusStateDir(), "tool-results", `${handleId}.txt`);
|
|
598054
|
+
this._recordTodoOutputLedgerEntry({
|
|
598055
|
+
memexId: handleId,
|
|
598056
|
+
toolName,
|
|
598057
|
+
target: this.extractPrimaryToolPath(args) || "",
|
|
598058
|
+
diskPath: savedPath,
|
|
598059
|
+
chars: result.output.length,
|
|
598060
|
+
lineCount,
|
|
598061
|
+
turn,
|
|
598062
|
+
preview: preview.slice(0, 200),
|
|
598063
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
598064
|
+
});
|
|
598022
598065
|
const folded = this.foldOutput(modelContent, maxLen);
|
|
598023
598066
|
return this.wrapToolOutputForModel(toolName, `[Tool output truncated — ${result.output.length} chars, ${lineCount} lines]
|
|
598024
598067
|
Full output saved to: ${savedPath}
|
|
@@ -598238,6 +598281,76 @@ Actions: (1) list_directory on the parent directory to see what's there, (2) Che
|
|
|
598238
598281
|
return content;
|
|
598239
598282
|
}
|
|
598240
598283
|
// ---------------------------------------------------------------------------
|
|
598284
|
+
// Part 3 — per-todo full-tool-output ledger
|
|
598285
|
+
// ---------------------------------------------------------------------------
|
|
598286
|
+
/**
|
|
598287
|
+
* The id of the todo currently in_progress (the deepest in_progress leaf), or
|
|
598288
|
+
* "_unassigned" when nothing is active. Full outputs externalized while this
|
|
598289
|
+
* is active are bound to it so completion can flush a consolidated ledger.
|
|
598290
|
+
*/
|
|
598291
|
+
_activeTodoId() {
|
|
598292
|
+
try {
|
|
598293
|
+
const todos = this.readSessionTodos() || [];
|
|
598294
|
+
const inProgress = todos.filter((t2) => t2.status === "in_progress");
|
|
598295
|
+
if (inProgress.length === 0)
|
|
598296
|
+
return "_unassigned";
|
|
598297
|
+
const childless = inProgress.filter((t2) => !todos.some((c9) => c9.parentId === t2.id));
|
|
598298
|
+
const chosen = childless[childless.length - 1] ?? inProgress[inProgress.length - 1];
|
|
598299
|
+
return chosen.id || "_unassigned";
|
|
598300
|
+
} catch {
|
|
598301
|
+
return "_unassigned";
|
|
598302
|
+
}
|
|
598303
|
+
}
|
|
598304
|
+
/** Bind one externalized full output to the active todo's ledger. */
|
|
598305
|
+
_recordTodoOutputLedgerEntry(entry) {
|
|
598306
|
+
try {
|
|
598307
|
+
const key = this._activeTodoId();
|
|
598308
|
+
let bucket = this._todoOutputLedger.get(key);
|
|
598309
|
+
if (!bucket) {
|
|
598310
|
+
bucket = [];
|
|
598311
|
+
this._todoOutputLedger.set(key, bucket);
|
|
598312
|
+
}
|
|
598313
|
+
bucket.push(entry);
|
|
598314
|
+
const cap = 500;
|
|
598315
|
+
if (bucket.length > cap)
|
|
598316
|
+
bucket.splice(0, bucket.length - cap);
|
|
598317
|
+
} catch {
|
|
598318
|
+
}
|
|
598319
|
+
}
|
|
598320
|
+
/**
|
|
598321
|
+
* Flush a completed todo's full-output ledger to disk as a single compressed
|
|
598322
|
+
* index alongside its summary chunk, then drop it from memory. The full
|
|
598323
|
+
* bodies stay in .omnius/tool-results/; this file is the high-signal,
|
|
598324
|
+
* low-noise stub that lists what was produced and where to retrieve it.
|
|
598325
|
+
* Returns the ledger path when written, else null.
|
|
598326
|
+
*/
|
|
598327
|
+
_flushTodoOutputLedger(todoId, todoContent, workingDir) {
|
|
598328
|
+
try {
|
|
598329
|
+
const bucket = this._todoOutputLedger.get(todoId);
|
|
598330
|
+
if (!bucket || bucket.length === 0)
|
|
598331
|
+
return null;
|
|
598332
|
+
const totalChars = bucket.reduce((n2, e2) => n2 + (e2.chars || 0), 0);
|
|
598333
|
+
const dir = _pathJoin(workingDir, ".omnius", "todo-chunks");
|
|
598334
|
+
_fsMkdirSync(dir, { recursive: true });
|
|
598335
|
+
const safeId3 = todoId.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64);
|
|
598336
|
+
const ledgerPath = _pathJoin(dir, `${safeId3}.ledger.json`);
|
|
598337
|
+
_fsWriteFileSync(ledgerPath, JSON.stringify({
|
|
598338
|
+
todoId,
|
|
598339
|
+
todoContent: todoContent.slice(0, 300),
|
|
598340
|
+
entryCount: bucket.length,
|
|
598341
|
+
totalChars,
|
|
598342
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
598343
|
+
// High-signal, low-noise stubs. Each points at its full body on disk
|
|
598344
|
+
// and via memex_retrieve(memexId) for on-demand re-materialisation.
|
|
598345
|
+
outputs: bucket
|
|
598346
|
+
}, null, 2), "utf-8");
|
|
598347
|
+
this._todoOutputLedger.delete(todoId);
|
|
598348
|
+
return { path: ledgerPath, entryCount: bucket.length, totalChars };
|
|
598349
|
+
} catch {
|
|
598350
|
+
return null;
|
|
598351
|
+
}
|
|
598352
|
+
}
|
|
598353
|
+
// ---------------------------------------------------------------------------
|
|
598241
598354
|
// Todo context chunker: fire-and-forget summarization of completed todo work
|
|
598242
598355
|
// ---------------------------------------------------------------------------
|
|
598243
598356
|
/**
|
|
@@ -598260,6 +598373,15 @@ Actions: (1) list_directory on the parent directory to see what's there, (2) Che
|
|
|
598260
598373
|
sessionId: this._sessionId
|
|
598261
598374
|
};
|
|
598262
598375
|
this._evictCompletedTodoMessages(startTurn, currentTurn, todoId, todo.content, messages2);
|
|
598376
|
+
const _ledger = this._flushTodoOutputLedger(todoId, todo.content, workingDir);
|
|
598377
|
+
if (_ledger) {
|
|
598378
|
+
this.emit({
|
|
598379
|
+
type: "status",
|
|
598380
|
+
content: `[todo-ledger] "${todo.content.slice(0, 60)}": ${_ledger.entryCount} full output(s) (~${Math.round(_ledger.totalChars / 4)} tok) consolidated to ${_ledger.path} — retrievable via memex_retrieve or the tool-results files`,
|
|
598381
|
+
turn: currentTurn,
|
|
598382
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
598383
|
+
});
|
|
598384
|
+
}
|
|
598263
598385
|
runTodoChunker({
|
|
598264
598386
|
inputs,
|
|
598265
598387
|
callable: async (prompt) => {
|
|
@@ -608949,7 +609071,7 @@ function canonicalize(value2) {
|
|
|
608949
609071
|
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalize(obj[k])}`).join(",")}}`;
|
|
608950
609072
|
}
|
|
608951
609073
|
function shouldBlockCall(fingerprint, history, opts = {}) {
|
|
608952
|
-
const blockOnPriorSuccess = opts.blockOnPriorSuccess ??
|
|
609074
|
+
const blockOnPriorSuccess = opts.blockOnPriorSuccess ?? false;
|
|
608953
609075
|
const maxIdenticalErrors = opts.maxIdenticalErrors ?? 2;
|
|
608954
609076
|
const same = history.filter((h) => h.fingerprint === fingerprint);
|
|
608955
609077
|
if (same.length === 0)
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.499",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.499",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED