omnius 1.0.541 → 1.0.542
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 +105 -12
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -583238,6 +583238,36 @@ var init_completion_resolution_verifier = __esm({
|
|
|
583238
583238
|
});
|
|
583239
583239
|
|
|
583240
583240
|
// packages/orchestrator/dist/evidenceBranch.js
|
|
583241
|
+
function buildBranchExtractionBrief(input) {
|
|
583242
|
+
const path16 = cleanBriefText(input.path, 320) || "the requested file";
|
|
583243
|
+
const intent = firstBriefText([
|
|
583244
|
+
input.assistantIntent,
|
|
583245
|
+
input.trajectoryNextAction,
|
|
583246
|
+
input.currentStep
|
|
583247
|
+
]);
|
|
583248
|
+
const openQuestion = cleanBriefText(input.trajectoryOpenQuestion, 280);
|
|
583249
|
+
const focus = openQuestion || intent;
|
|
583250
|
+
const request = openQuestion ? `Determine the exact file-local facts in ${path16} that answer this unresolved agent question: ${openQuestion}` : intent ? `Identify the exact file-local facts in ${path16} that the active agent needs before it can ${asActionClause(intent)}.` : `Identify the exact declarations, behavior, and configuration in ${path16} needed to choose the next narrow action.`;
|
|
583251
|
+
const triggerEvidence = uniqueBriefLines([
|
|
583252
|
+
`The active action is a whole-file read of ${path16}; disk inspection found ${Math.max(0, input.lineCount)} lines / ${Math.max(0, input.byteCount)} bytes, so the parent context would otherwise receive only a preview.`,
|
|
583253
|
+
input.trajectoryAssessment ? `Current trajectory assessment: ${cleanBriefText(input.trajectoryAssessment, 360)}` : "No current file-level evidence has been returned to the parent yet.",
|
|
583254
|
+
input.currentStep ? `Current task step: ${cleanBriefText(input.currentStep, 260)}` : "",
|
|
583255
|
+
input.recentFailure ? `Recent unresolved evidence: ${cleanBriefText(input.recentFailure, 320)}` : ""
|
|
583256
|
+
]);
|
|
583257
|
+
const returnContract = focus ? `Return only the exact declarations, values, behavior, and line spans that resolve: ${focus}` : "Return only the exact declarations, values, behavior, and line spans needed for the next safe action.";
|
|
583258
|
+
const retrievalQuery = uniqueBriefLines([
|
|
583259
|
+
path16,
|
|
583260
|
+
focus,
|
|
583261
|
+
openQuestion,
|
|
583262
|
+
"relevant declarations behavior configuration line spans"
|
|
583263
|
+
]).join(" ");
|
|
583264
|
+
return {
|
|
583265
|
+
request: cleanBriefText(request, 520),
|
|
583266
|
+
triggerEvidence: triggerEvidence.slice(0, 4),
|
|
583267
|
+
returnContract: cleanBriefText(returnContract, 520),
|
|
583268
|
+
retrievalQuery: cleanBriefText(retrievalQuery, 700)
|
|
583269
|
+
};
|
|
583270
|
+
}
|
|
583241
583271
|
function buildStructuralPreview2(lines, path16, query) {
|
|
583242
583272
|
const n2 = lines.length;
|
|
583243
583273
|
const clip3 = (l2) => l2.length > 180 ? l2.slice(0, 180) + "…" : l2;
|
|
@@ -583264,6 +583294,29 @@ function queryTerms(query) {
|
|
|
583264
583294
|
...new Set(query.toLowerCase().replace(/[^a-z0-9_<>./-]+/g, " ").split(/\s+/).filter((w) => w.length > 2 && !STOPWORDS2.has(w)))
|
|
583265
583295
|
];
|
|
583266
583296
|
}
|
|
583297
|
+
function cleanBriefText(value2, max) {
|
|
583298
|
+
const clean5 = String(value2 ?? "").replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, "").replace(/[\x00-\x1F\x7F]/g, " ").replace(/\s+/g, " ").trim();
|
|
583299
|
+
return clean5.length > max ? `${clean5.slice(0, Math.max(0, max - 1))}…` : clean5;
|
|
583300
|
+
}
|
|
583301
|
+
function firstBriefText(values) {
|
|
583302
|
+
for (const value2 of values) {
|
|
583303
|
+
const clean5 = cleanBriefText(value2, 320);
|
|
583304
|
+
if (!clean5)
|
|
583305
|
+
continue;
|
|
583306
|
+
if (/^take one narrow, evidence-backed action/i.test(clean5))
|
|
583307
|
+
continue;
|
|
583308
|
+
return clean5;
|
|
583309
|
+
}
|
|
583310
|
+
return "";
|
|
583311
|
+
}
|
|
583312
|
+
function uniqueBriefLines(values) {
|
|
583313
|
+
return [
|
|
583314
|
+
...new Set(values.map((value2) => cleanBriefText(value2, 700)).filter(Boolean))
|
|
583315
|
+
];
|
|
583316
|
+
}
|
|
583317
|
+
function asActionClause(value2) {
|
|
583318
|
+
return cleanBriefText(value2, 320).replace(/^to\s+/i, "").replace(/[.?!]+$/, "").replace(/^([A-Z])/, (match) => match.toLowerCase());
|
|
583319
|
+
}
|
|
583267
583320
|
function selectWindows(lines, terms2) {
|
|
583268
583321
|
const matched = [];
|
|
583269
583322
|
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
@@ -583314,12 +583367,17 @@ function selectWindows(lines, terms2) {
|
|
|
583314
583367
|
score: m2.score
|
|
583315
583368
|
}));
|
|
583316
583369
|
}
|
|
583317
|
-
function extractionPrompt(
|
|
583370
|
+
function extractionPrompt(brief, path16, windows) {
|
|
583318
583371
|
const blocks = windows.map((w) => `--- ${path16} lines ${w.start}-${w.end} ---
|
|
583319
583372
|
${w.text}`).join("\n\n");
|
|
583320
583373
|
return [
|
|
583321
|
-
`You are an extraction worker in a throwaway context. Extract ONLY
|
|
583322
|
-
`
|
|
583374
|
+
`You are an extraction worker in a throwaway context. Extract ONLY the information requested by the active agent; do not summarize the whole file.`,
|
|
583375
|
+
`[AGENTIC BRANCH REQUEST]`,
|
|
583376
|
+
`Request: ${brief.request}`,
|
|
583377
|
+
`Why this branch is needed now:`,
|
|
583378
|
+
...brief.triggerEvidence.map((evidence) => `- ${evidence}`),
|
|
583379
|
+
`Return contract: ${brief.returnContract}`,
|
|
583380
|
+
`Retrieval focus: ${brief.retrievalQuery}`,
|
|
583323
583381
|
``,
|
|
583324
583382
|
`File excerpts:`,
|
|
583325
583383
|
blocks,
|
|
@@ -583358,7 +583416,14 @@ function parseExtraction(raw) {
|
|
|
583358
583416
|
};
|
|
583359
583417
|
}
|
|
583360
583418
|
async function extractEvidence(opts) {
|
|
583361
|
-
const { path: path16,
|
|
583419
|
+
const { path: path16, content, fileVersion, backend } = opts;
|
|
583420
|
+
const brief = opts.brief ?? buildBranchExtractionBrief({
|
|
583421
|
+
path: path16,
|
|
583422
|
+
lineCount: content.split("\n").length,
|
|
583423
|
+
byteCount: content.length,
|
|
583424
|
+
assistantIntent: opts.query
|
|
583425
|
+
});
|
|
583426
|
+
const query = brief.retrievalQuery || opts.query;
|
|
583362
583427
|
const lines = content.split("\n");
|
|
583363
583428
|
const terms2 = queryTerms(query);
|
|
583364
583429
|
if (terms2.length > 0) {
|
|
@@ -583433,7 +583498,7 @@ async function extractEvidence(opts) {
|
|
|
583433
583498
|
const resp = await backend.chatCompletion({
|
|
583434
583499
|
messages: [
|
|
583435
583500
|
{ role: "system", content: "You extract precise facts from file excerpts. Output ONLY a JSON object." },
|
|
583436
|
-
{ role: "user", content: extractionPrompt(
|
|
583501
|
+
{ role: "user", content: extractionPrompt(brief, path16, windows) }
|
|
583437
583502
|
],
|
|
583438
583503
|
tools: [],
|
|
583439
583504
|
temperature: 0,
|
|
@@ -595289,6 +595354,28 @@ ${notice}`;
|
|
|
595289
595354
|
return "unknown";
|
|
595290
595355
|
return entry.stale ? "stale" : "fresh";
|
|
595291
595356
|
}
|
|
595357
|
+
/**
|
|
595358
|
+
* Turn a large whole-file read into an explicit request from the active
|
|
595359
|
+
* agent state, rather than treating the original user prompt as the query.
|
|
595360
|
+
*/
|
|
595361
|
+
_buildBranchExtractionBrief(input) {
|
|
595362
|
+
const visibleAssistantIntent = [...input.messages].reverse().find((message2) => message2.role === "assistant" && typeof message2.content === "string" && message2.content.trim().length > 0);
|
|
595363
|
+
const assistantIntent = visibleAssistantIntent ? sanitizeTrajectoryText(sanitizeModelVisibleContextText(String(visibleAssistantIntent.content)), 320) : "";
|
|
595364
|
+
const trajectory = this._trajectoryCheckpoint;
|
|
595365
|
+
const latestFailure = this._recentFailures.at(-1);
|
|
595366
|
+
const recentFailure = latestFailure ? `${latestFailure.tool} at turn ${latestFailure.turn}: ${sanitizeTrajectoryText(latestFailure.error || latestFailure.output, 320)}` : "";
|
|
595367
|
+
return buildBranchExtractionBrief({
|
|
595368
|
+
path: input.path,
|
|
595369
|
+
lineCount: input.lineCount,
|
|
595370
|
+
byteCount: input.byteCount,
|
|
595371
|
+
assistantIntent,
|
|
595372
|
+
trajectoryAssessment: trajectory?.situationAssessment,
|
|
595373
|
+
trajectoryNextAction: trajectory?.nextAction || this._taskState.nextAction,
|
|
595374
|
+
trajectoryOpenQuestion: trajectory?.openQuestions[0],
|
|
595375
|
+
currentStep: this._taskState.currentStep,
|
|
595376
|
+
recentFailure
|
|
595377
|
+
});
|
|
595378
|
+
}
|
|
595292
595379
|
/**
|
|
595293
595380
|
* Rebuild the one current checkpoint at the context boundary. This shared
|
|
595294
595381
|
* method is deliberately used by normal and brute-force loops via
|
|
@@ -600849,15 +600936,17 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
600849
600936
|
}
|
|
600850
600937
|
}
|
|
600851
600938
|
if (fullContent && shouldBranchRead(trueBytes, trueLines, false)) {
|
|
600852
|
-
const
|
|
600853
|
-
|
|
600854
|
-
|
|
600855
|
-
|
|
600856
|
-
|
|
600939
|
+
const branchBrief = this._buildBranchExtractionBrief({
|
|
600940
|
+
path: pRaw,
|
|
600941
|
+
lineCount: trueLines,
|
|
600942
|
+
byteCount: trueBytes,
|
|
600943
|
+
messages: messages2
|
|
600944
|
+
});
|
|
600857
600945
|
try {
|
|
600858
600946
|
const ev = await extractEvidence({
|
|
600859
600947
|
path: pRaw,
|
|
600860
|
-
query,
|
|
600948
|
+
query: branchBrief.retrievalQuery,
|
|
600949
|
+
brief: branchBrief,
|
|
600861
600950
|
content: fullContent,
|
|
600862
600951
|
// the REAL body, not the preview
|
|
600863
600952
|
fileVersion: this._worldFacts.files.get(pRaw)?.writeCount ?? 0,
|
|
@@ -600868,7 +600957,11 @@ Respond with EXACTLY this structure before your next tool call:
|
|
|
600868
600957
|
});
|
|
600869
600958
|
output = [
|
|
600870
600959
|
`[BRANCH-EXTRACT] ${pRaw} is large (${trueLines} lines, ${trueBytes} bytes); a whole-file read only returns a preview, so it was read in an isolated branch and distilled.`,
|
|
600871
|
-
`
|
|
600960
|
+
`[AGENTIC EXTRACTION REQUEST] ${branchBrief.request}`,
|
|
600961
|
+
`Evidence driving this request:`,
|
|
600962
|
+
...branchBrief.triggerEvidence.map((evidence) => `- ${evidence}`),
|
|
600963
|
+
`Looking for: ${branchBrief.returnContract}`,
|
|
600964
|
+
`Retrieval focus: "${branchBrief.retrievalQuery.slice(0, 240)}"`,
|
|
600872
600965
|
`Relevant evidence (lines ${ev.sourceStart ?? "?"}-${ev.sourceEnd ?? "?"}, confidence ${ev.confidence.toFixed(2)}):`,
|
|
600873
600966
|
ev.claim,
|
|
600874
600967
|
`If you need a different region, call file_read with a specific offset+limit. Do NOT re-read the whole file — you already have the relevant content above.`
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.542",
|
|
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.542",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED