omnius 1.0.919 → 1.0.921

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 39069563 bytes
4
- sha256: 09925cc3f137038b2d5b87ba304d5bf950e4b937b62711c9271edc5c6af3a586
3
+ size: 39079539 bytes
4
+ sha256: 5a35c2692d6eb0106e5507e145a3e20285073674687ae05e02ef11d4d312354c
package/dist/library.js CHANGED
@@ -352804,6 +352804,125 @@ var StructuredMemoryExtractionQueue = class {
352804
352804
  }
352805
352805
  };
352806
352806
 
352807
+ // packages/orchestrator/dist/append-only-outbound.js
352808
+ var APPEND_ONLY_FRAME_UPDATE_MARKER = "[ACTIVE TASK FRAME UPDATE v1]";
352809
+ var APPEND_ONLY_HOST_MESSAGE_MARKER = "[HOST RUNTIME MESSAGE v1: host-authored, not from the user]";
352810
+ var APPEND_ONLY_MAX_UPDATE_CHARS = 24e3;
352811
+ function projectionMarker(message, kinds3) {
352812
+ if (typeof message.content !== "string")
352813
+ return void 0;
352814
+ if (message.content.startsWith(APPEND_ONLY_FRAME_UPDATE_MARKER))
352815
+ return APPEND_ONLY_FRAME_UPDATE_MARKER;
352816
+ if (message.role !== "system")
352817
+ return void 0;
352818
+ return kinds3.find((kind) => message.content.startsWith(kind.marker))?.marker;
352819
+ }
352820
+ function sameMessage(left, right) {
352821
+ return JSON.stringify(left) === JSON.stringify(right);
352822
+ }
352823
+ function renderProjectionLineDiff(before, after) {
352824
+ const a = before.split("\n"), b = after.split("\n");
352825
+ let head = 0;
352826
+ while (head < a.length && head < b.length && a[head] === b[head])
352827
+ head++;
352828
+ let tail = 0;
352829
+ while (tail < a.length - head && tail < b.length - head && a[a.length - 1 - tail] === b[b.length - 1 - tail])
352830
+ tail++;
352831
+ const midA = a.slice(head, a.length - tail), midB = b.slice(head, b.length - tail);
352832
+ if (midA.length === 0 && midB.length === 0)
352833
+ return "";
352834
+ const lcs = Array.from({ length: midA.length + 1 }, () => new Array(midB.length + 1).fill(0));
352835
+ for (let i2 = midA.length - 1; i2 >= 0; i2--)
352836
+ for (let j2 = midB.length - 1; j2 >= 0; j2--)
352837
+ lcs[i2][j2] = midA[i2] === midB[j2] ? lcs[i2 + 1][j2 + 1] + 1 : Math.max(lcs[i2 + 1][j2], lcs[i2][j2 + 1]);
352838
+ const ops = [];
352839
+ let i = 0, j = 0;
352840
+ while (i < midA.length || j < midB.length) {
352841
+ if (i < midA.length && j < midB.length && midA[i] === midB[j]) {
352842
+ ops.push({ kind: " ", line: midA[i], indexA: head + i });
352843
+ i++;
352844
+ j++;
352845
+ } else if (j < midB.length && (i >= midA.length || lcs[i][j + 1] >= lcs[i + 1][j])) {
352846
+ ops.push({ kind: "+", line: midB[j], indexA: head + i });
352847
+ j++;
352848
+ } else {
352849
+ ops.push({ kind: "-", line: midA[i], indexA: head + i });
352850
+ i++;
352851
+ }
352852
+ }
352853
+ const out = [];
352854
+ let inHunk = false;
352855
+ for (const op of ops) {
352856
+ if (op.kind === " ") {
352857
+ inHunk = false;
352858
+ continue;
352859
+ }
352860
+ if (!inHunk) {
352861
+ const context = a[op.indexA - 1];
352862
+ out.push(`@@ after: ${context === void 0 ? "(start)" : context.trim() ? context.slice(0, 160) : "(blank line)"}`);
352863
+ inHunk = true;
352864
+ }
352865
+ out.push(`${op.kind} ${op.line}`);
352866
+ }
352867
+ return out.join("\n");
352868
+ }
352869
+ function projectAppendOnlyOutbound(input) {
352870
+ const { key, messages: messages2, previous, kinds: kinds3 } = input;
352871
+ const maxUpdateChars = input.maxUpdateChars ?? APPEND_ONLY_MAX_UPDATE_CHARS;
352872
+ const firstProjection = messages2.findIndex((message) => projectionMarker(message, kinds3) !== void 0);
352873
+ const base = firstProjection < 0 ? [...messages2] : messages2.slice(0, firstProjection);
352874
+ const tail = firstProjection < 0 ? [] : messages2.slice(firstProjection);
352875
+ const projections = /* @__PURE__ */ new Map();
352876
+ const tailIsProjections = tail.every((message) => {
352877
+ const marker = projectionMarker(message, kinds3);
352878
+ if (!marker || marker === APPEND_ONLY_FRAME_UPDATE_MARKER || projections.has(marker))
352879
+ return false;
352880
+ projections.set(marker, message.content);
352881
+ return true;
352882
+ });
352883
+ const full = (reason) => ({
352884
+ messages: messages2,
352885
+ mode: "full",
352886
+ reason,
352887
+ state: { key, sent: messages2, base, projections: tailIsProjections ? projections : /* @__PURE__ */ new Map(), updateChars: 0 }
352888
+ });
352889
+ if (!tailIsProjections)
352890
+ return full("projections_not_at_tail");
352891
+ if (!previous || previous.key !== key)
352892
+ return full("new_chain");
352893
+ if (base.length < previous.base.length || previous.base.some((message, index) => !sameMessage(message, base[index])))
352894
+ return full("history_rewritten");
352895
+ if (projections.size !== previous.projections.size || [...projections.keys()].some((marker) => !previous.projections.has(marker)))
352896
+ return full("projection_kinds_changed");
352897
+ const updates = [];
352898
+ for (const kind of kinds3) {
352899
+ const now2 = projections.get(kind.marker);
352900
+ if (now2 === void 0)
352901
+ continue;
352902
+ const diff = renderProjectionLineDiff(previous.projections.get(kind.marker), now2);
352903
+ if (diff)
352904
+ updates.push(`[${kind.label}]
352905
+ ${diff}`);
352906
+ }
352907
+ const update = updates.length ? [
352908
+ APPEND_ONLY_FRAME_UPDATE_MARKER,
352909
+ "Host runtime update, not a message from the user. The task frame and context blocks in the system prompt are from an earlier turn. Apply these line changes to them in order; the result is the current state. Lines marked - are no longer true; lines marked + are new.",
352910
+ ...updates
352911
+ ].join("\n") : "";
352912
+ const updateChars = previous.updateChars + update.length;
352913
+ if (updateChars > maxUpdateChars)
352914
+ return full("update_budget_exceeded");
352915
+ const appended = base.slice(previous.base.length).map((message) => message.role === "system" && typeof message.content === "string" ? { ...message, role: "user", content: `${APPEND_ONLY_HOST_MESSAGE_MARKER}
352916
+ ${message.content}` } : message);
352917
+ const sent = [...previous.sent, ...appended, ...update ? [{ role: "user", content: update }] : []];
352918
+ return {
352919
+ messages: sent,
352920
+ mode: "extended",
352921
+ reason: update ? "extended_with_update" : "extended_unchanged",
352922
+ state: { key, sent, base, projections, updateChars }
352923
+ };
352924
+ }
352925
+
352807
352926
  // packages/orchestrator/dist/source-read-evidence.js
352808
352927
  init_dist5();
352809
352928
  import { createHash as createHash60 } from "node:crypto";
@@ -389669,6 +389788,10 @@ var AgenticRunner = class _AgenticRunner {
389669
389788
  _toolExposureRevision = 0;
389670
389789
  /** Exposure revision the most recent tool definitions were built from. */
389671
389790
  _toolDefsExposureRevision = -1;
389791
+ /** Previous primary request, for the append-only outbound projection. */
389792
+ _appendOnlyOutbound;
389793
+ /** Per primary turn: whether the request extended the previous one, and why not when it did not. */
389794
+ appendOnlyOutboundDecisions = [];
389672
389795
  /** Selected method definition only; observation/status counters do not change schemas. */
389673
389796
  _selectedWorkToolExposureKey = null;
389674
389797
  pendingRuntimeGuidanceMessages = [];
@@ -396402,6 +396525,54 @@ ${workflowStatus}` } : {}
396402
396525
  this._contextAdmissionOutputIntents.set(request, Math.max(this._contextAdmissionOutputIntents.get(request) ?? 0, floor));
396403
396526
  }
396404
396527
  }
396528
+ /**
396529
+ * Primary turns only: send the previous request verbatim plus this turn's history and a compact
396530
+ * frame update, so hybrid/recurrent models resume from their KV checkpoint instead of re-reading
396531
+ * the whole prompt (see append-only-outbound.ts). Falls back to the full request whenever the
396532
+ * extension would need compaction that the full request does not.
396533
+ */
396534
+ _applyAppendOnlyOutboundProjection(request) {
396535
+ if (process.env["OMNIUS_APPEND_ONLY_OUTBOUND"] === "0" || !request.logicalRequestId?.endsWith(":primary"))
396536
+ return;
396537
+ if (process.env["OMNIUS_APPEND_ONLY_OUTBOUND"] !== "1" && this.backend.prefersAppendOnlyPrompts?.() !== true)
396538
+ return;
396539
+ const key = JSON.stringify([
396540
+ this.currentArtifactRunId(),
396541
+ this._taskEpoch,
396542
+ _createHash("sha256").update(JSON.stringify(request.tools ?? [])).digest("hex")
396543
+ ]);
396544
+ const steering = this._activeSteering;
396545
+ const steeringPending = Boolean(this._currentSteeringReplyPending() || steering?.input.taskEpoch === this._taskEpoch && steering.gatesOldPlan && steering.requiresReconciliation && !steering.reconciliation);
396546
+ const projected = projectAppendOnlyOutbound({
396547
+ key,
396548
+ messages: request.messages,
396549
+ previous: steeringPending ? void 0 : this._appendOnlyOutbound,
396550
+ kinds: [
396551
+ { marker: CANONICAL_TASK_FRAME_MARKER, label: "canonical task frame" },
396552
+ { marker: _AgenticRunner.CONTEXT_FRAME_MARKER, label: "active context frame" },
396553
+ { marker: "[TELEGRAM PASSIVE HISTORY", label: "passive chat history" }
396554
+ ]
396555
+ });
396556
+ if (steeringPending)
396557
+ projected.reason = "steering_pending";
396558
+ const record9 = (mode, reason) => {
396559
+ this.appendOnlyOutboundDecisions.push({ logicalRequestId: request.logicalRequestId, mode, reason });
396560
+ if (this.appendOnlyOutboundDecisions.length > 64)
396561
+ this.appendOnlyOutboundDecisions.shift();
396562
+ };
396563
+ if (projected.mode === "extended") {
396564
+ const fullBudget = this._outboundRequestBudget(request);
396565
+ const extendedBudget = this._outboundRequestBudget({ ...request, messages: projected.messages });
396566
+ if (extendedBudget.compactionEligible && !fullBudget.compactionEligible) {
396567
+ this._appendOnlyOutbound = { ...projected.state, sent: request.messages, updateChars: 0 };
396568
+ record9("full", "extension_needs_compaction");
396569
+ return;
396570
+ }
396571
+ request.messages = projected.messages;
396572
+ }
396573
+ this._appendOnlyOutbound = projected.state;
396574
+ record9(projected.mode, projected.reason);
396575
+ }
396405
396576
  _applyTelegramPassiveHistoryProjection(request, turn) {
396406
396577
  this._preparePrimaryOutputReservation(request);
396407
396578
  const source = this._telegramPassiveHistory;
@@ -396607,6 +396778,7 @@ ${workflowStatus}` } : {}
396607
396778
  this._applyCanonicalOutboundProjection(request, turn);
396608
396779
  }
396609
396780
  await this._applyUnifiedMemoryCompilationWithLifecycle(request);
396781
+ this._applyAppendOnlyOutboundProjection(request);
396610
396782
  this._applyContextAdmission(request);
396611
396783
  if ((this._lastContextAdmission?.decision === "reject" || request.preparedContextCapacity && !this._currentPreparedContextCapacity(request)) && await this._prepareRequestContextCapacity(request))
396612
396784
  this._applyContextAdmission(request, { allowContentCompaction: false });
@@ -431446,6 +431618,13 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
431446
431618
  localReadiness: (error) => this.usesLocalInferenceReadiness() && error instanceof InferenceHttpError ? localHttpReadinessReason(error.status, error.responseJson) : void 0
431447
431619
  });
431448
431620
  }
431621
+ /**
431622
+ * Local Ollama (and the llama.cpp runners behind it) is where re-reading the whole prompt each
431623
+ * turn was measured: 21-31k tokens per turn on a hybrid 27B model. Remote APIs keep today's shape.
431624
+ */
431625
+ prefersAppendOnlyPrompts() {
431626
+ return this.usesLocalGpuAdmission();
431627
+ }
431449
431628
  /** Remote endpoints never reserve a GPU on this host. */
431450
431629
  usesLocalGpuAdmission() {
431451
431630
  return this._provider.protocol === "ollama" && ["localhost", "127.0.0.1", "[::1]", "::1"].includes(new URL(this.baseUrl).hostname);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.919",
3
+ "version": "1.0.921",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.919",
9
+ "version": "1.0.921",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.919",
3
+ "version": "1.0.921",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/library.js",