omnius 1.0.259 → 1.0.261
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 +103 -18
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -563680,6 +563680,64 @@ var init_contextEngine = __esm({
|
|
|
563680
563680
|
});
|
|
563681
563681
|
|
|
563682
563682
|
// packages/orchestrator/dist/prompt-cache.js
|
|
563683
|
+
function applyCacheMarker(msg, marker) {
|
|
563684
|
+
const role = msg.role;
|
|
563685
|
+
const content = msg.content;
|
|
563686
|
+
if (role === "tool") {
|
|
563687
|
+
msg.cache_control = { ...marker };
|
|
563688
|
+
return;
|
|
563689
|
+
}
|
|
563690
|
+
if (content === null || content === void 0 || content === "") {
|
|
563691
|
+
msg.cache_control = { ...marker };
|
|
563692
|
+
return;
|
|
563693
|
+
}
|
|
563694
|
+
if (typeof content === "string") {
|
|
563695
|
+
msg.content = [
|
|
563696
|
+
{ type: "text", text: content, cache_control: { ...marker } }
|
|
563697
|
+
];
|
|
563698
|
+
return;
|
|
563699
|
+
}
|
|
563700
|
+
if (Array.isArray(content) && content.length > 0) {
|
|
563701
|
+
const last2 = content[content.length - 1];
|
|
563702
|
+
if (last2 && typeof last2 === "object") {
|
|
563703
|
+
last2.cache_control = { ...marker };
|
|
563704
|
+
}
|
|
563705
|
+
}
|
|
563706
|
+
}
|
|
563707
|
+
function applyAnthropicMessageCacheControl(messages2, maxBreakpoints = 3, cacheTtl = "5m") {
|
|
563708
|
+
if (!messages2 || messages2.length === 0)
|
|
563709
|
+
return messages2;
|
|
563710
|
+
if (maxBreakpoints <= 0)
|
|
563711
|
+
return structuredClone(messages2);
|
|
563712
|
+
const result = structuredClone(messages2);
|
|
563713
|
+
const marker = { type: "ephemeral" };
|
|
563714
|
+
if (cacheTtl === "1h") {
|
|
563715
|
+
marker.ttl = "1h";
|
|
563716
|
+
}
|
|
563717
|
+
const start2 = Math.max(0, result.length - maxBreakpoints);
|
|
563718
|
+
for (let i2 = start2; i2 < result.length; i2++) {
|
|
563719
|
+
applyCacheMarker(result[i2], marker);
|
|
563720
|
+
}
|
|
563721
|
+
return result;
|
|
563722
|
+
}
|
|
563723
|
+
function applySystemCacheControl(system, cacheTtl = "5m") {
|
|
563724
|
+
const marker = { type: "ephemeral" };
|
|
563725
|
+
if (cacheTtl === "1h") {
|
|
563726
|
+
marker.ttl = "1h";
|
|
563727
|
+
}
|
|
563728
|
+
if (typeof system === "string" && system.length > 0) {
|
|
563729
|
+
return [{ type: "text", text: system, cache_control: { ...marker } }];
|
|
563730
|
+
}
|
|
563731
|
+
if (Array.isArray(system) && system.length > 0) {
|
|
563732
|
+
const result = structuredClone(system);
|
|
563733
|
+
const last2 = result[result.length - 1];
|
|
563734
|
+
if (last2 && typeof last2 === "object") {
|
|
563735
|
+
last2.cache_control = { ...marker };
|
|
563736
|
+
}
|
|
563737
|
+
return result;
|
|
563738
|
+
}
|
|
563739
|
+
return system;
|
|
563740
|
+
}
|
|
563683
563741
|
var init_prompt_cache = __esm({
|
|
563684
563742
|
"packages/orchestrator/dist/prompt-cache.js"() {
|
|
563685
563743
|
"use strict";
|
|
@@ -580471,6 +580529,15 @@ ${description}`
|
|
|
580471
580529
|
}
|
|
580472
580530
|
if (anthropicTools.length > 0)
|
|
580473
580531
|
body.tools = anthropicTools;
|
|
580532
|
+
if (request.enablePromptCaching !== false) {
|
|
580533
|
+
const ttl = request.promptCacheTtl ?? "5m";
|
|
580534
|
+
if (body.system !== void 0) {
|
|
580535
|
+
body.system = applySystemCacheControl(body.system, ttl);
|
|
580536
|
+
body.messages = applyAnthropicMessageCacheControl(anthropicMessages, 3, ttl);
|
|
580537
|
+
} else {
|
|
580538
|
+
body.messages = applyAnthropicMessageCacheControl(anthropicMessages, 4, ttl);
|
|
580539
|
+
}
|
|
580540
|
+
}
|
|
580474
580541
|
const fetchOpts = {
|
|
580475
580542
|
method: "POST",
|
|
580476
580543
|
headers: this.authHeaders(),
|
|
@@ -585981,8 +586048,13 @@ function buildFolderListing(dirPath, cwd4, limit = 200) {
|
|
|
585981
586048
|
return lines.join("\n");
|
|
585982
586049
|
}
|
|
585983
586050
|
function expandFileReference(ref, cwd4, allowedRoot) {
|
|
585984
|
-
|
|
585985
|
-
|
|
586051
|
+
let filePath;
|
|
586052
|
+
try {
|
|
586053
|
+
filePath = resolvePath3(cwd4, ref.target, allowedRoot);
|
|
586054
|
+
ensureReferencePathAllowed(filePath);
|
|
586055
|
+
} catch (err) {
|
|
586056
|
+
return [`${ref.raw}: ${err.message}`, null];
|
|
586057
|
+
}
|
|
585986
586058
|
if (!statSync38(filePath, { throwIfNoEntry: false })?.isFile()) {
|
|
585987
586059
|
return [`${ref.raw}: file not found`, null];
|
|
585988
586060
|
}
|
|
@@ -585997,7 +586069,8 @@ function expandFileReference(ref, cwd4, allowedRoot) {
|
|
|
585997
586069
|
text2 = lines.slice(startIdx, endIdx).join("\n");
|
|
585998
586070
|
}
|
|
585999
586071
|
const lang = codeFenceLanguage(filePath);
|
|
586000
|
-
const
|
|
586072
|
+
const rangeSuffix = ref.lineStart !== null ? `:${ref.lineStart}${ref.lineEnd && ref.lineEnd !== ref.lineStart ? `-${ref.lineEnd}` : ""}` : "";
|
|
586073
|
+
const label = `${ref.target}${rangeSuffix}`;
|
|
586001
586074
|
const tokens = estimateTokens6(text2);
|
|
586002
586075
|
return [
|
|
586003
586076
|
null,
|
|
@@ -586008,8 +586081,13 @@ ${text2}
|
|
|
586008
586081
|
];
|
|
586009
586082
|
}
|
|
586010
586083
|
function expandFolderReference(ref, cwd4, allowedRoot) {
|
|
586011
|
-
|
|
586012
|
-
|
|
586084
|
+
let dirPath;
|
|
586085
|
+
try {
|
|
586086
|
+
dirPath = resolvePath3(cwd4, ref.target, allowedRoot);
|
|
586087
|
+
ensureReferencePathAllowed(dirPath);
|
|
586088
|
+
} catch (err) {
|
|
586089
|
+
return [`${ref.raw}: ${err.message}`, null];
|
|
586090
|
+
}
|
|
586013
586091
|
if (!statSync38(dirPath, { throwIfNoEntry: false })?.isDirectory()) {
|
|
586014
586092
|
return [`${ref.raw}: folder not found`, null];
|
|
586015
586093
|
}
|
|
@@ -586098,10 +586176,14 @@ function parseContextReferences(message2) {
|
|
|
586098
586176
|
continue;
|
|
586099
586177
|
}
|
|
586100
586178
|
const kind = groups.kind;
|
|
586101
|
-
|
|
586179
|
+
const rawValue = groups.value || "";
|
|
586180
|
+
let value2 = stripTrailingPunctuation(rawValue);
|
|
586102
586181
|
let target = value2;
|
|
586103
586182
|
let lineStart = null;
|
|
586104
586183
|
let lineEnd = null;
|
|
586184
|
+
const strippedCount = rawValue.length - value2.length;
|
|
586185
|
+
const raw = strippedCount > 0 ? match[0].slice(0, match[0].length - strippedCount) : match[0];
|
|
586186
|
+
const end = match.index + raw.length;
|
|
586105
586187
|
if (kind === "file") {
|
|
586106
586188
|
const rangeMatch = value2.match(/^(?<path>.+?):(?<start>\d+)(?:-(?<end>\d+))?$/);
|
|
586107
586189
|
if (rangeMatch) {
|
|
@@ -586111,11 +586193,11 @@ function parseContextReferences(message2) {
|
|
|
586111
586193
|
}
|
|
586112
586194
|
}
|
|
586113
586195
|
refs.push({
|
|
586114
|
-
raw
|
|
586196
|
+
raw,
|
|
586115
586197
|
kind,
|
|
586116
586198
|
target,
|
|
586117
586199
|
start: match.index,
|
|
586118
|
-
end
|
|
586200
|
+
end,
|
|
586119
586201
|
lineStart,
|
|
586120
586202
|
lineEnd
|
|
586121
586203
|
});
|
|
@@ -586168,10 +586250,10 @@ async function preprocessContextReferences(message2, opts) {
|
|
|
586168
586250
|
injectedTokens += estimateTokens6(block);
|
|
586169
586251
|
}
|
|
586170
586252
|
}
|
|
586171
|
-
const hardLimit = Math.max(1, Math.floor(opts.contextWindowSize *
|
|
586253
|
+
const hardLimit = Math.max(1, Math.floor(opts.contextWindowSize * 1.5));
|
|
586172
586254
|
const softLimit = Math.max(1, Math.floor(opts.contextWindowSize * 0.25));
|
|
586173
586255
|
if (injectedTokens > hardLimit) {
|
|
586174
|
-
warnings.push(`@ context injection refused: ${injectedTokens} tokens exceeds the
|
|
586256
|
+
warnings.push(`@ context injection refused: ${injectedTokens} tokens exceeds the hard limit (${hardLimit}).`);
|
|
586175
586257
|
return {
|
|
586176
586258
|
message: message2,
|
|
586177
586259
|
originalMessage: message2,
|
|
@@ -586183,7 +586265,7 @@ async function preprocessContextReferences(message2, opts) {
|
|
|
586183
586265
|
};
|
|
586184
586266
|
}
|
|
586185
586267
|
if (injectedTokens > softLimit) {
|
|
586186
|
-
warnings.push(`@ context injection warning: ${injectedTokens} tokens exceeds the
|
|
586268
|
+
warnings.push(`@ context injection warning: ${injectedTokens} tokens exceeds the soft limit (${softLimit}).`);
|
|
586187
586269
|
}
|
|
586188
586270
|
let stripped = removeReferenceTokens(message2, refs);
|
|
586189
586271
|
let final2 = stripped;
|
|
@@ -619433,7 +619515,7 @@ function createJob(input) {
|
|
|
619433
619515
|
const schedule = input.schedule;
|
|
619434
619516
|
const skills = input.skills || [];
|
|
619435
619517
|
const repeatTimes = input.repeat != null && input.repeat > 0 ? input.repeat : null;
|
|
619436
|
-
const autoRepeat =
|
|
619518
|
+
const autoRepeat = repeatTimes;
|
|
619437
619519
|
const deliver = input.deliver || (input.origin ? "origin" : "local");
|
|
619438
619520
|
const id = randomUUID17().slice(0, 12);
|
|
619439
619521
|
const label = input.name || input.prompt.slice(0, 50).trim() || "cron job";
|
|
@@ -619584,7 +619666,7 @@ function getDueJobs() {
|
|
|
619584
619666
|
if (nextDt <= _now.getTime()) {
|
|
619585
619667
|
const grace = computeGraceSeconds(job.schedule);
|
|
619586
619668
|
if (job.schedule.kind !== "once") {
|
|
619587
|
-
const elapsed = (_now.getTime() - nextDt) / 1e3;
|
|
619669
|
+
const elapsed = Math.floor((_now.getTime() - nextDt) / 1e3);
|
|
619588
619670
|
if (elapsed > grace) {
|
|
619589
619671
|
const newNext = computeNextRun(job.schedule, _now.toISOString());
|
|
619590
619672
|
if (newNext) {
|
|
@@ -619608,8 +619690,9 @@ function saveJobOutput(jobId, output) {
|
|
|
619608
619690
|
chmodSync3(jobOutDir, 448);
|
|
619609
619691
|
} catch {
|
|
619610
619692
|
}
|
|
619611
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")
|
|
619612
|
-
const
|
|
619693
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
619694
|
+
const suffix = randomUUID17().slice(0, 6);
|
|
619695
|
+
const outFile = join133(jobOutDir, `${timestamp}-${suffix}.md`);
|
|
619613
619696
|
writeFileSync60(outFile, output, "utf-8");
|
|
619614
619697
|
secureFile(outFile);
|
|
619615
619698
|
return outFile;
|
|
@@ -701021,7 +701104,7 @@ function resetSessionLock() {
|
|
|
701021
701104
|
_interactiveSessionActive = false;
|
|
701022
701105
|
_interactiveSessionReason = "";
|
|
701023
701106
|
}
|
|
701024
|
-
function createTaskCompleteTool(modelTier, repoRoot) {
|
|
701107
|
+
function createTaskCompleteTool(modelTier, repoRoot, skipSessionGuard) {
|
|
701025
701108
|
const summaryDesc = modelTier === "small" || modelTier === "medium" ? "Your complete response to the user. For questions/chat: put your FULL answer here (this is what the user will see). For coding tasks: brief summary of what was accomplished." : "Brief summary of what was accomplished";
|
|
701026
701109
|
return {
|
|
701027
701110
|
name: "task_complete",
|
|
@@ -701034,7 +701117,7 @@ function createTaskCompleteTool(modelTier, repoRoot) {
|
|
|
701034
701117
|
required: ["summary"]
|
|
701035
701118
|
},
|
|
701036
701119
|
async execute(args) {
|
|
701037
|
-
if (_interactiveSessionActive) {
|
|
701120
|
+
if (_interactiveSessionActive && !skipSessionGuard) {
|
|
701038
701121
|
return {
|
|
701039
701122
|
success: false,
|
|
701040
701123
|
output: `SESSION STILL ACTIVE. Call your next interaction tool NOW. Do NOT produce text — call a tool immediately to continue the session.`,
|
|
@@ -704959,7 +705042,9 @@ Review its full output via sub_agent(action='output', id='${id}')`
|
|
|
704959
705042
|
if (!subToolInstances.some((t2) => nameOf(t2) === "todo_read"))
|
|
704960
705043
|
subToolInstances.push(new TodoReadTool());
|
|
704961
705044
|
subRunner.registerTools(subToolInstances.map(adaptTool6));
|
|
704962
|
-
|
|
705045
|
+
const subAgentId = opts.id || `sub-${Date.now()}`;
|
|
705046
|
+
statusBar.registerAgentView(subAgentId, `Sub-agent ${subAgentId}`, "sub");
|
|
705047
|
+
subRunner.registerTool(createTaskCompleteTool(subTier, repoRoot, true));
|
|
704963
705048
|
const systemCtx = opts.systemPromptAddition ? `Working directory: ${repoRoot}
|
|
704964
705049
|
|
|
704965
705050
|
${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.261",
|
|
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.261",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED