omnius 1.0.890 → 1.0.891
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 +2 -2
- package/dist/library.js +174 -23
- package/dist/tui/native/worker.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/index.js
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 38569995 bytes
|
|
4
|
+
sha256: fbcac5a251ce2d03c36a693fd201e9a05f77be2d924498c008607626275592db
|
package/dist/library.js
CHANGED
|
@@ -352353,9 +352353,9 @@ function sourceSpan(content, observation) {
|
|
|
352353
352353
|
}
|
|
352354
352354
|
function projectQualifiedSourceBodies(input) {
|
|
352355
352355
|
const observations = new Map(input.observations.filter((observation) => issued5.has(observation) && observation.scope === input.scope).map((observation) => [observation.callId, observation]));
|
|
352356
|
-
const calls = new
|
|
352356
|
+
const calls = new Map(input.messages.flatMap((message) => {
|
|
352357
352357
|
const value = message;
|
|
352358
|
-
return value["role"] === "assistant" && Array.isArray(value["tool_calls"]) ? value["tool_calls"].flatMap((call2) => call2 && typeof call2 === "object" && call2.function?.name
|
|
352358
|
+
return value["role"] === "assistant" && Array.isArray(value["tool_calls"]) ? value["tool_calls"].flatMap((call2) => call2 && typeof call2 === "object" && ["file_read", "web_fetch"].includes(call2.function?.name) && typeof call2.id === "string" ? [[call2.id, call2.function.name]] : []) : [];
|
|
352359
352359
|
}));
|
|
352360
352360
|
const carriers = [];
|
|
352361
352361
|
input.messages.forEach((message, index) => {
|
|
@@ -352364,7 +352364,7 @@ function projectQualifiedSourceBodies(input) {
|
|
|
352364
352364
|
if (value["role"] !== "tool" || typeof value["content"] !== "string" || typeof callId !== "string" || !calls.has(callId))
|
|
352365
352365
|
return;
|
|
352366
352366
|
const observation = observations.get(callId);
|
|
352367
|
-
if (!observation)
|
|
352367
|
+
if (!observation || calls.get(callId) !== (observation.toolName ?? "file_read"))
|
|
352368
352368
|
return;
|
|
352369
352369
|
const span = sourceSpan(value["content"], observation);
|
|
352370
352370
|
if (!span)
|
|
@@ -352383,7 +352383,7 @@ function projectQualifiedSourceBodies(input) {
|
|
|
352383
352383
|
if (carrier.protected)
|
|
352384
352384
|
continue;
|
|
352385
352385
|
const own = carrier.observation;
|
|
352386
|
-
const covering = carriers.filter((candidate) => candidate.observation.path === own.path && candidate.observation.sourceHash === own.sourceHash && candidate.observation.startLine <= own.startLine && candidate.observation.endLine >= own.endLine).sort((a, b) => b.observation.endLine - b.observation.startLine - (a.observation.endLine - a.observation.startLine) || Number(b.protected) - Number(a.protected) || b.index - a.index);
|
|
352386
|
+
const covering = carriers.filter((candidate) => (candidate.observation.toolName ?? "file_read") === (own.toolName ?? "file_read") && candidate.observation.path === own.path && candidate.observation.sourceHash === own.sourceHash && candidate.observation.startLine <= own.startLine && candidate.observation.endLine >= own.endLine).sort((a, b) => b.observation.endLine - b.observation.startLine - (a.observation.endLine - a.observation.startLine) || Number(b.protected) - Number(a.protected) || b.index - a.index);
|
|
352387
352387
|
const keeper = covering[0];
|
|
352388
352388
|
if (!keeper || keeper === carrier)
|
|
352389
352389
|
continue;
|
|
@@ -374365,7 +374365,11 @@ function normalizeCanonicalHistory(history, options = {}) {
|
|
|
374365
374365
|
for (const group of transactions2.values()) {
|
|
374366
374366
|
const raw = group.filter((entry) => entry.kind === "tool_transaction_raw");
|
|
374367
374367
|
const receipts = group.filter((entry) => entry.kind === "evidence_receipt");
|
|
374368
|
-
const
|
|
374368
|
+
const largeHistoricalResult = options.historicalToolInlineBytes !== void 0 && raw.some((entry) => {
|
|
374369
|
+
const message = entry.message;
|
|
374370
|
+
return message && message["role"] === "tool" && typeof message["content"] === "string" && Buffer.byteLength(message["content"], "utf8") > options.historicalToolInlineBytes;
|
|
374371
|
+
});
|
|
374372
|
+
const keepRaw = raw.some((entry) => entry.transactionRelevance === "active" || (entry.protection?.length ?? 0) > 0) || receipts.length === 0 || options.historicalTransactionPolicy === "retain_raw" && !largeHistoricalResult && completeRawToolTransaction(raw);
|
|
374369
374373
|
const receiptWinner = receipts.length > 0 ? [...receipts].sort(compareHistoryNewest)[0] : void 0;
|
|
374370
374374
|
const rejected = keepRaw ? receipts : [...raw, ...receipts.filter((entry) => entry !== receiptWinner)];
|
|
374371
374375
|
for (const entry of rejected) {
|
|
@@ -374614,7 +374618,8 @@ function buildCanonicalModelRequest(input) {
|
|
|
374614
374618
|
if (input.maxRequestBytes !== void 0)
|
|
374615
374619
|
assertPositiveBudget(input.maxRequestBytes, "maxRequestBytes");
|
|
374616
374620
|
const historyProjection = normalizeCanonicalHistory(input.history, {
|
|
374617
|
-
historicalTransactionPolicy: input.historicalTransactionPolicy
|
|
374621
|
+
historicalTransactionPolicy: input.historicalTransactionPolicy,
|
|
374622
|
+
historicalToolInlineBytes: input.historicalToolInlineBytes
|
|
374618
374623
|
});
|
|
374619
374624
|
const frame = projectCanonicalTaskFrame({
|
|
374620
374625
|
signals: input.signals,
|
|
@@ -389305,6 +389310,18 @@ var AgenticRunner = class _AgenticRunner {
|
|
|
389305
389310
|
const freshHash = typeof result.beforeHash === "string" && /^[a-f0-9]{64}$/i.test(result.beforeHash) ? result.beforeHash : null;
|
|
389306
389311
|
if (!path7 || !freshHash)
|
|
389307
389312
|
return null;
|
|
389313
|
+
if (toolName !== "file_edit" || typeof args["old_string"] !== "string" || !args["old_string"].length) {
|
|
389314
|
+
return [
|
|
389315
|
+
"[STALE_HASH_RETRY]",
|
|
389316
|
+
"The file revision differs from the edit precondition. Read the current file and reconcile the intended change before retrying.",
|
|
389317
|
+
"Prefer a focused file_edit/file_patch built from the current text. Never reuse an old full-file replacement with only a refreshed hash.",
|
|
389318
|
+
JSON.stringify({
|
|
389319
|
+
failure_family: "stale_hash",
|
|
389320
|
+
guardrail: "reread_and_rebase",
|
|
389321
|
+
next_read: { tool: "file_read", args: { path: path7 } }
|
|
389322
|
+
})
|
|
389323
|
+
].join("\n");
|
|
389324
|
+
}
|
|
389308
389325
|
const retry = {
|
|
389309
389326
|
failure_family: "stale_hash",
|
|
389310
389327
|
guardrail: "one_assisted_refresh_only",
|
|
@@ -391712,6 +391729,7 @@ runtime_module_sha256=${record9.runtimeProvenance.module.sha256 ?? "unknown"}`
|
|
|
391712
391729
|
},
|
|
391713
391730
|
canonicalToolExposureContracts: options?.canonicalToolExposureContracts ?? [],
|
|
391714
391731
|
canonicalMaxInputTokens: options?.canonicalMaxInputTokens === void 0 ? void 0 : Math.max(1, Math.floor(options.canonicalMaxInputTokens)),
|
|
391732
|
+
historicalToolInlineBytes: options?.historicalToolInlineBytes === void 0 ? 16 * 1024 : Number.isNaN(options.historicalToolInlineBytes) ? 16 * 1024 : Math.max(0, options.historicalToolInlineBytes),
|
|
391715
391733
|
// A fixed 8k aggregate ceiling could reject a valid set of action tools
|
|
391716
391734
|
// before inference (for example 9,479 chars of schemas for an 8k cap).
|
|
391717
391735
|
// Progressive exposure still controls relevance, but selected schemas
|
|
@@ -393419,6 +393437,49 @@ ${read.content}`;
|
|
|
393419
393437
|
atomicGroup: transactionId2
|
|
393420
393438
|
});
|
|
393421
393439
|
}
|
|
393440
|
+
for (let index = 0; index < messages2.length; index++) {
|
|
393441
|
+
const message = messages2[index];
|
|
393442
|
+
const calls = message.role === "assistant" ? message.tool_calls : void 0;
|
|
393443
|
+
const transactionId2 = transactionByIndex.get(index);
|
|
393444
|
+
if (!calls || calls.length < 2 || !transactionId2 || transactionId2 === activeTransactionId || new Set(calls.map((call2) => call2.id)).size !== calls.length)
|
|
393445
|
+
continue;
|
|
393446
|
+
const members = calls.map((call2) => {
|
|
393447
|
+
const receipt = this._canonicalAcceptedReceipts.get(call2.id);
|
|
393448
|
+
const results = messages2.filter((candidate) => candidate.role === "tool" && candidate.tool_call_id === call2.id);
|
|
393449
|
+
return receipt && results.length === 1 ? { transactionId: call2.id, ...receipt } : void 0;
|
|
393450
|
+
});
|
|
393451
|
+
if (members.some((member) => !member))
|
|
393452
|
+
continue;
|
|
393453
|
+
try {
|
|
393454
|
+
const content = JSON.stringify({ schema: "omnius.tool-batch-artifacts.v1", members });
|
|
393455
|
+
const stored = this._artifactStore().put({
|
|
393456
|
+
path: `tool-batch/${this.currentArtifactRunId()}/${transactionId2}`,
|
|
393457
|
+
revision: _createHash("sha256").update(content).digest("hex"),
|
|
393458
|
+
content,
|
|
393459
|
+
fidelity: "full"
|
|
393460
|
+
});
|
|
393461
|
+
this._artifactStore().flush(stored.reference);
|
|
393462
|
+
entries.push({
|
|
393463
|
+
id: `accepted-receipt:${transactionId2}`,
|
|
393464
|
+
kind: "evidence_receipt",
|
|
393465
|
+
ordinal: (transactionSpans.get(transactionId2)?.end ?? index) + 0.25,
|
|
393466
|
+
turn,
|
|
393467
|
+
revision: turn,
|
|
393468
|
+
priority: 700,
|
|
393469
|
+
transactionId: transactionId2,
|
|
393470
|
+
artifactLocator: stored.reference,
|
|
393471
|
+
atomicGroup: transactionId2,
|
|
393472
|
+
message: { role: "system", content: renderCanonicalEvidenceReceipt({
|
|
393473
|
+
transactionId: transactionId2,
|
|
393474
|
+
toolName: "tool_batch",
|
|
393475
|
+
artifactLocator: stored.reference,
|
|
393476
|
+
success: true,
|
|
393477
|
+
summary: `All ${members.length} results retained; artifact is a manifest of individual source artifacts. ` + members.map((member) => member.summary).join(" ")
|
|
393478
|
+
}) }
|
|
393479
|
+
});
|
|
393480
|
+
} catch {
|
|
393481
|
+
}
|
|
393482
|
+
}
|
|
393422
393483
|
return entries;
|
|
393423
393484
|
}
|
|
393424
393485
|
/**
|
|
@@ -393540,6 +393601,7 @@ ${read.content}`;
|
|
|
393540
393601
|
measureInputTokens: (candidate) => this._outboundRequestBudget(candidate).totalInputTokens,
|
|
393541
393602
|
excludeMutableProjections,
|
|
393542
393603
|
historicalTransactionPolicy,
|
|
393604
|
+
historicalToolInlineBytes: this.options.historicalToolInlineBytes,
|
|
393543
393605
|
toolProjection
|
|
393544
393606
|
});
|
|
393545
393607
|
const original = build(signals);
|
|
@@ -393608,6 +393670,9 @@ ${read.content}`;
|
|
|
393608
393670
|
if (hasPhysicalContextLimit && retainedBudget.compactionEligible || canonicalInputCeiling !== void 0 && retainedBudget.totalInputTokens > canonicalInputCeiling) {
|
|
393609
393671
|
projection = materializeOwnedSourceProjections(buildProjection("receipt", canonicalInputCeiling));
|
|
393610
393672
|
}
|
|
393673
|
+
if (canonicalInputCeiling !== void 0 && projection.trace.maxInputTokens === void 0) {
|
|
393674
|
+
projection = { ...projection, trace: { ...projection.trace, maxInputTokens: canonicalInputCeiling } };
|
|
393675
|
+
}
|
|
393611
393676
|
if (schemaBytes > this.options.canonicalMaxToolSchemaChars || toolProjection.status !== "ok") {
|
|
393612
393677
|
throw new Error(toolProjection.missingRequiredToolNames.length > 0 ? `canonical_tool_required_schema_missing:${toolProjection.missingRequiredToolNames.join(",")}` : `canonical_tool_schema_budget_overflow:${schemaBytes}/${this.options.canonicalMaxToolSchemaChars}`);
|
|
393613
393678
|
}
|
|
@@ -393873,13 +393938,55 @@ ${read.content}`;
|
|
|
393873
393938
|
});
|
|
393874
393939
|
}
|
|
393875
393940
|
} : outbound;
|
|
393876
|
-
const
|
|
393877
|
-
|
|
393878
|
-
|
|
393879
|
-
|
|
393880
|
-
...dispatchRequest
|
|
393881
|
-
|
|
393882
|
-
|
|
393941
|
+
const selectedBackend = this.backend;
|
|
393942
|
+
const selectedScope = selectedBackend.transportContextScope?.() ?? selectedBackend;
|
|
393943
|
+
const taskBinding = this._sourceReadTaskBinding();
|
|
393944
|
+
const ownedRequest = withManagedLocalAdmissionBudget(this.backend, {
|
|
393945
|
+
...dispatchRequest,
|
|
393946
|
+
logicalRequestId: dispatchRequest.logicalRequestId ?? crypto.randomUUID(),
|
|
393947
|
+
signal: AbortSignal.any([
|
|
393948
|
+
inputWaitController.signal,
|
|
393949
|
+
this._abortController.signal,
|
|
393950
|
+
this._turnAbortController.signal,
|
|
393951
|
+
...dispatchRequest.signal ? [dispatchRequest.signal] : []
|
|
393952
|
+
])
|
|
393953
|
+
}, this.options.requestTimeoutMs);
|
|
393954
|
+
let response;
|
|
393955
|
+
let readinessWaits = 0;
|
|
393956
|
+
for (; ; ) {
|
|
393957
|
+
assertCurrent();
|
|
393958
|
+
ownedRequest.signal.throwIfAborted();
|
|
393959
|
+
if (readinessWaits > 0 && (selectedBackend !== this.backend || selectedScope !== (this.backend.transportContextScope?.() ?? this.backend) || taskBinding !== this._sourceReadTaskBinding()))
|
|
393960
|
+
throw new Error("interruption_stale_model_dispatch");
|
|
393961
|
+
try {
|
|
393962
|
+
response = await withInputWaitCancellation(ownedRequest.signal, () => backend.chatCompletion(ownedRequest));
|
|
393963
|
+
break;
|
|
393964
|
+
} catch (error) {
|
|
393965
|
+
if (!(error instanceof LocalInferenceNotReadyError) || !operation.requiredForRun || (ownedRequest.workloadClass ?? this.options.workloadClass) !== "foreground")
|
|
393966
|
+
throw error;
|
|
393967
|
+
assertCurrent();
|
|
393968
|
+
ownedRequest.signal.throwIfAborted();
|
|
393969
|
+
if (readinessWaits++ === 0)
|
|
393970
|
+
this.emit({
|
|
393971
|
+
type: "status",
|
|
393972
|
+
inferenceWaiting: true,
|
|
393973
|
+
content: "Waiting for the selected local model.",
|
|
393974
|
+
visibility: "telemetry",
|
|
393975
|
+
turn: operation.turn,
|
|
393976
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
393977
|
+
});
|
|
393978
|
+
await this.waitForTransientRetry(Math.min(15e3, 1e3 * 2 ** Math.min(4, readinessWaits - 1)), ownedRequest.signal);
|
|
393979
|
+
}
|
|
393980
|
+
}
|
|
393981
|
+
if (readinessWaits > 0)
|
|
393982
|
+
this.emit({
|
|
393983
|
+
type: "status",
|
|
393984
|
+
inferenceWaiting: false,
|
|
393985
|
+
content: "Selected local model ready; resuming task.",
|
|
393986
|
+
visibility: "telemetry",
|
|
393987
|
+
turn: operation.turn,
|
|
393988
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
393989
|
+
});
|
|
393883
393990
|
inputWaitController.signal.throwIfAborted();
|
|
393884
393991
|
if (ticket && !this._interruptionLifecycle?.canCommit(ticket)) {
|
|
393885
393992
|
throw new Error("interruption_stale_model_result");
|
|
@@ -395755,8 +395862,12 @@ ${workflowStatus}` } : {}
|
|
|
395755
395862
|
});
|
|
395756
395863
|
const tool = this.tools.get(input.toolName);
|
|
395757
395864
|
const sourceEvidence = input.toolName === "file_read" ? qualifySourceReadEvidence({ cwd: this._workingDirectory || process.cwd(), args: input.args, result: input.result }) : void 0;
|
|
395865
|
+
if (sourceEvidence) {
|
|
395866
|
+
const receipt = this._canonicalAcceptedReceipts.get(input.toolCallId);
|
|
395867
|
+
receipt.summary += ` file_edit_precondition=${JSON.stringify({ path: this._normalizeEvidencePath(sourceEvidence.path), expected_hash: sourceEvidence.sourceHash })}`;
|
|
395868
|
+
}
|
|
395758
395869
|
const identity4 = tool?.getHistoryObservationIdentity?.(input.args, input.result) ?? (sourceEvidence ? JSON.stringify({ tool: "file_read", cwd: this.authoritativeWorkingDirectory(), path: sourceEvidence.path, hash: sourceEvidence.sourceHash, range: sourceEvidence.coverage }) : null);
|
|
395759
|
-
const
|
|
395870
|
+
const fileSourceBody = sourceEvidence?.coverage && typeof sourceEvidence.coverage.endLine === "number" ? issueQualifiedSourceBodyObservation({
|
|
395760
395871
|
scope: this._sourceBodyProjectionScope(),
|
|
395761
395872
|
callId: input.toolCallId,
|
|
395762
395873
|
path: this._normalizeEvidencePath(sourceEvidence.path),
|
|
@@ -395767,7 +395878,23 @@ ${workflowStatus}` } : {}
|
|
|
395767
395878
|
format: sourceEvidence.deliveryFormat,
|
|
395768
395879
|
body: input.result.llmContent ?? input.result.output
|
|
395769
395880
|
}) : null;
|
|
395770
|
-
|
|
395881
|
+
const admittedWeb = this._admittedWebSourceViews.get(input.result);
|
|
395882
|
+
const web = complete?.schema === "omnius.native-web-source.v1" ? complete : null;
|
|
395883
|
+
const webBody = web && (input.args["format"] === "raw_html" ? web.body : web.htmlEvidence?.article.text ?? web.body);
|
|
395884
|
+
const webSourceBody = web && webBody && admittedWeb?.source === web && admittedWeb.sourceCurrent() && admittedWeb.scopeId === this._sessionId && admittedWeb.runId === this.currentArtifactRunId() && admittedWeb.taskEpoch === this._taskEpoch && admittedWeb.modelContent === input.result.llmContent && admittedWeb.output === input.result.output && input.toolName === "web_fetch" ? issueQualifiedSourceBodyObservation({
|
|
395885
|
+
scope: this._sourceBodyProjectionScope(),
|
|
395886
|
+
callId: input.toolCallId,
|
|
395887
|
+
toolName: "web_fetch",
|
|
395888
|
+
path: JSON.stringify([web.receipt.requestedUrl, input.args["format"] === "raw_html" ? "raw_html" : "semantic"]),
|
|
395889
|
+
sourceHash: web.receipt.responseSha256,
|
|
395890
|
+
startLine: 1,
|
|
395891
|
+
endLine: webBody.split("\n").length,
|
|
395892
|
+
artifactLocator: stored.reference,
|
|
395893
|
+
format: "raw",
|
|
395894
|
+
body: webBody
|
|
395895
|
+
}) : null;
|
|
395896
|
+
const sourceBody = fileSourceBody ?? webSourceBody;
|
|
395897
|
+
if (fileSourceBody && sourceBody && (input.result.fullReadAdmitted === true || [...this._inlineReadArtifacts.values()].some((artifact2) => artifact2.path === sourceBody.path && artifact2.contentHash === sourceBody.sourceHash && artifact2.sourceRange.startLine === sourceBody.startLine && artifact2.sourceRange.endLine === sourceBody.endLine))) {
|
|
395771
395898
|
this._inlineReadArtifacts.set(input.toolCallId, {
|
|
395772
395899
|
callId: input.toolCallId,
|
|
395773
395900
|
path: sourceBody.path,
|
|
@@ -395797,6 +395924,12 @@ ${workflowStatus}` } : {}
|
|
|
395797
395924
|
...sourceEvidence ? { sourceRead: { path: sourceEvidence.path, hash: sourceEvidence.sourceHash, ...sourceEvidence.coverage } } : {},
|
|
395798
395925
|
...sourceBody ? { sourceBody } : {}
|
|
395799
395926
|
});
|
|
395927
|
+
} else if (webSourceBody) {
|
|
395928
|
+
this._historyObservations.set(input.toolCallId, {
|
|
395929
|
+
equivalenceKey: _createHash("sha256").update(`${webSourceBody.scope}:${input.toolCallId}`).digest("hex"),
|
|
395930
|
+
observedAt: web.receipt.fetchedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
395931
|
+
sourceBody: webSourceBody
|
|
395932
|
+
});
|
|
395800
395933
|
}
|
|
395801
395934
|
while (this._canonicalAcceptedReceipts.size > 128) {
|
|
395802
395935
|
const oldest = this._canonicalAcceptedReceipts.keys().next().value;
|
|
@@ -396690,7 +396823,7 @@ ${content}`)].join("\n\n");
|
|
|
396690
396823
|
const configuredTrigger = this.options.virtualContext?.triggerTokens;
|
|
396691
396824
|
const triggerTokens = Number.isFinite(configuredTrigger) && (configuredTrigger ?? 0) > 0 ? Math.floor(configuredTrigger) : Number.isFinite(envTrigger) && envTrigger > 0 ? Math.floor(envTrigger) : Math.max(1, Math.floor(physicalInputBudget * 0.6));
|
|
396692
396825
|
const configuredEvidenceBudget = this.options.virtualContext?.evidenceTokenBudget;
|
|
396693
|
-
const evidenceTokenBudget = Math.max(1, Math.min(physicalInputBudget, Number.isFinite(configuredEvidenceBudget) && (configuredEvidenceBudget ?? 0) > 0 ? Math.floor(configuredEvidenceBudget) : adaptiveBudget.exactEvidence));
|
|
396826
|
+
const evidenceTokenBudget = Math.max(1, Math.min(physicalInputBudget, Number.isFinite(configuredEvidenceBudget) && (configuredEvidenceBudget ?? 0) > 0 ? Math.floor(configuredEvidenceBudget) : configuredEvidenceBudget === Number.POSITIVE_INFINITY ? adaptiveBudget.exactEvidence : Math.min(8192, adaptiveBudget.exactEvidence)));
|
|
396694
396827
|
const configuredPinnedBudget = this.options.virtualContext?.pinnedMemoryTokenBudget;
|
|
396695
396828
|
const pinnedTokenBudget = Math.max(0, Math.min(physicalInputBudget, Number.isFinite(configuredPinnedBudget) && (configuredPinnedBudget ?? 0) > 0 ? Math.floor(configuredPinnedBudget) : adaptiveBudget.pinnedState));
|
|
396696
396829
|
const pinnedMessages = this._pinnedStructuredMemoryMessages(pinnedTokenBudget, physicalInputBudget, turn);
|
|
@@ -409471,10 +409604,19 @@ ${input.acceptedGoal}`);
|
|
|
409471
409604
|
return brief;
|
|
409472
409605
|
}
|
|
409473
409606
|
_sourceReadTaskBinding() {
|
|
409607
|
+
const authority = (input) => ({
|
|
409608
|
+
inputId: input.inputId,
|
|
409609
|
+
content: input.content,
|
|
409610
|
+
intent: input.intent,
|
|
409611
|
+
source: input.source,
|
|
409612
|
+
receivedAt: input.receivedAt,
|
|
409613
|
+
taskEpoch: input.taskEpoch,
|
|
409614
|
+
allowTaskReplacement: input.allowTaskReplacement
|
|
409615
|
+
});
|
|
409474
409616
|
return JSON.stringify({
|
|
409475
409617
|
goal: this._taskState.originalGoal || this._taskState.goal,
|
|
409476
409618
|
contract: this._taskObjectiveContract,
|
|
409477
|
-
steering: this._activeSteering
|
|
409619
|
+
steering: this._activeSteering ? [this._activeSteering.input, ...this._activeSteering.relatedInputs ?? []].map(authority) : void 0
|
|
409478
409620
|
});
|
|
409479
409621
|
}
|
|
409480
409622
|
/** A successful remote primary may allocate only its own returned tool calls.
|
|
@@ -422306,7 +422448,12 @@ ${marker}` : marker);
|
|
|
422306
422448
|
success: success !== false,
|
|
422307
422449
|
identicalToPreviousRun: this._observationLedger.identicalRunsFor(fingerprint2) >= 2
|
|
422308
422450
|
});
|
|
422309
|
-
|
|
422451
|
+
const compact4 = this.compactDiscoveryOutputForModel(toolName, args, output, success, toolCallId, provenance2?.fullReadAdmitted);
|
|
422452
|
+
const sourceRead = success === true && toolName === "file_read" ? this._historyObservations.get(toolCallId)?.sourceRead : void 0;
|
|
422453
|
+
const precondition = sourceRead ? `[FILE_EDIT_PRECONDITION]
|
|
422454
|
+
${JSON.stringify({ path: this._normalizeEvidencePath(sourceRead.path), expected_hash: sourceRead.hash })}
|
|
422455
|
+
` : "";
|
|
422456
|
+
return this.buildToolMessage(precondition + compact4, toolCallId, toolName);
|
|
422310
422457
|
}
|
|
422311
422458
|
compactDiscoveryOutputForModel(toolName, args, output, success, toolCallId, fullReadAdmitted) {
|
|
422312
422459
|
if (success !== true)
|
|
@@ -422606,13 +422753,16 @@ ${marker}` : marker);
|
|
|
422606
422753
|
return { args: { ...args, expected_hash: fresh.hash }, patchedCount: 1 };
|
|
422607
422754
|
}
|
|
422608
422755
|
if (toolName === "file_write" || toolName === "file_patch") {
|
|
422609
|
-
|
|
422610
|
-
return { args, patchedCount: 0 };
|
|
422611
|
-
}
|
|
422756
|
+
const supplied = this._normalizeExpectedHashValue(this._rawExpectedHashValue(args));
|
|
422612
422757
|
const path7 = this.extractPrimaryToolPath(args);
|
|
422613
422758
|
const fresh = path7 ? this._freshReadHashForEditPath(path7) : null;
|
|
422614
422759
|
if (!fresh)
|
|
422615
422760
|
return { args, patchedCount: 0 };
|
|
422761
|
+
if (supplied) {
|
|
422762
|
+
const readArtifact = [...this._historyObservations].some(([id5, observation]) => observation.sourceRead && this._normalizeEvidencePath(observation.sourceRead.path) === fresh.key && observation.sourceRead.hash === fresh.hash && this._canonicalAcceptedReceipts.get(id5)?.artifactLocator === `omnius-artifact://sha256/${supplied}`);
|
|
422763
|
+
if (supplied === fresh.hash || !readArtifact)
|
|
422764
|
+
return { args, patchedCount: 0 };
|
|
422765
|
+
}
|
|
422616
422766
|
return { args: { ...args, expected_hash: fresh.hash }, patchedCount: 1 };
|
|
422617
422767
|
}
|
|
422618
422768
|
if (toolName !== "batch_edit" || !Array.isArray(args["edits"])) {
|
|
@@ -427795,11 +427945,12 @@ ${description}`
|
|
|
427795
427945
|
* until recovery; other transient backend errors use bounded backoff.
|
|
427796
427946
|
* Returns the response on success, or null if recovery did not apply.
|
|
427797
427947
|
*/
|
|
427798
|
-
async waitForTransientRetry(delayMs) {
|
|
427948
|
+
async waitForTransientRetry(delayMs, operationSignal) {
|
|
427799
427949
|
const signals = [
|
|
427800
427950
|
this._abortController.signal,
|
|
427801
427951
|
this._turnAbortController.signal,
|
|
427802
|
-
this._inputWaitBoundaryController.signal
|
|
427952
|
+
this._inputWaitBoundaryController.signal,
|
|
427953
|
+
...operationSignal ? [operationSignal] : []
|
|
427803
427954
|
];
|
|
427804
427955
|
if (signals.some((signal) => signal.aborted))
|
|
427805
427956
|
return;
|
|
@@ -8144,7 +8144,6 @@ var NativeFrontend = class {
|
|
|
8144
8144
|
this.sessionPicker.on("blurred", stylePicker);
|
|
8145
8145
|
this.sessionRow.add(this.sessionPicker);
|
|
8146
8146
|
this.routeWarning = new TextRenderable11(renderer2, { id: "omnius-route-warning", content: "", width: "100%", wrapMode: "word", fg: colors.warning, attributes: TextAttributes11.BOLD | TextAttributes11.UNDERLINE, visible: false, flexShrink: 0 });
|
|
8147
|
-
this.root.add(this.routeWarning);
|
|
8148
8147
|
this.taskPane = new BoxRenderable12(renderer2, { id: "omnius-tasks", width: "100%", flexDirection: "column", maxHeight: 6, flexShrink: 0, overflow: "hidden", visible: false });
|
|
8149
8148
|
this.tasks = new NativeBlockList(this.context, this.taskPane);
|
|
8150
8149
|
this.root.add(this.taskPane);
|
|
@@ -8160,6 +8159,7 @@ var NativeFrontend = class {
|
|
|
8160
8159
|
this.root.add(this.body);
|
|
8161
8160
|
this.transcriptPane = new BoxRenderable12(renderer2, { id: "omnius-transcript-pane", flexDirection: "column", flexGrow: 1, flexShrink: 1, minWidth: 0, minHeight: 1 });
|
|
8162
8161
|
this.body.add(this.transcriptPane);
|
|
8162
|
+
this.transcriptPane.add(this.routeWarning);
|
|
8163
8163
|
this.scroll = new ScrollBoxRenderable8(renderer2, {
|
|
8164
8164
|
id: "omnius-conversation",
|
|
8165
8165
|
flexGrow: 1,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.891",
|
|
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.891",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED