omnius 1.0.466 → 1.0.467

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
@@ -575230,6 +575230,9 @@ function violatesDirective(directive, input) {
575230
575230
  const summaryReportsDegraded = /^\s*(BLOCKED|INCOMPLETE|NEEDS[_ -]?INPUT)\b\s*:?/i.test(summaryText);
575231
575231
  const reportsDegradedCompletion = completionStatus === "blocked" || completionStatus === "incomplete" || completionStatus === "needs_input" || summaryReportsDegraded;
575232
575232
  if (directive.requiredNextAction === "report_blocked" || directive.requiredNextAction === "report_incomplete" || directive.state === "terminal_incomplete") {
575233
+ const completionGateDirective = directive.state !== "terminal_incomplete" && directive.forbiddenActionFamilies.includes("task_complete");
575234
+ if (completionGateDirective)
575235
+ return false;
575233
575236
  return !reportsDegradedCompletion;
575234
575237
  }
575235
575238
  return false;
@@ -575489,10 +575492,12 @@ var init_focusSupervisor = __esm({
575489
575492
  failureFamilies = /* @__PURE__ */ new Map();
575490
575493
  ignoredDirectiveStreak = 0;
575491
575494
  lastIgnoredDirectiveTurn = null;
575495
+ availableTools = null;
575492
575496
  constructor(options2 = {}) {
575493
575497
  this.mode = options2.mode ?? "auto";
575494
575498
  this.modelTier = options2.modelTier ?? "large";
575495
575499
  this.repeatGateMax = Math.max(0, Math.floor(options2.repeatGateMax ?? 3));
575500
+ this.availableTools = options2.availableTools ? new Set(Array.from(options2.availableTools)) : null;
575496
575501
  }
575497
575502
  get enabled() {
575498
575503
  return this.mode !== "off";
@@ -575500,6 +575505,15 @@ var init_focusSupervisor = __esm({
575500
575505
  get currentDirective() {
575501
575506
  return this.directive;
575502
575507
  }
575508
+ hasTool(name10) {
575509
+ return this.availableTools === null || this.availableTools.has(name10);
575510
+ }
575511
+ resolveRequiredNextAction(action) {
575512
+ if (action === "update_todos" && !this.hasTool("todo_write")) {
575513
+ return "report_blocked";
575514
+ }
575515
+ return action;
575516
+ }
575503
575517
  snapshot() {
575504
575518
  return {
575505
575519
  mode: this.mode,
@@ -575652,14 +575666,15 @@ var init_focusSupervisor = __esm({
575652
575666
  return this.inject(directive, `[FOCUS SUPERVISOR] ${directive.reason}. Required next action: ${directive.requiredNextAction}.`);
575653
575667
  }
575654
575668
  if (this.hasLowSignalContext(input.context) && input.isReadLike && !(this.directive?.requiredNextAction === "read_authoritative_target" || this.directive?.requiredNextAction === "use_cached_evidence")) {
575669
+ const requiredNextAction = this.resolveRequiredNextAction("update_todos");
575655
575670
  const directive = this.setDirective({
575656
575671
  turn: input.turn,
575657
575672
  state: "forced_replan",
575658
575673
  reason: "raw discovery is dominating active evidence in the context window",
575659
- requiredNextAction: "update_todos",
575674
+ requiredNextAction,
575660
575675
  forbiddenActionFamilies: [family]
575661
575676
  });
575662
- return this.inject(directive, "[FOCUS SUPERVISOR] Discovery noise is crowding the live context. Update the todo decomposition, then act on active evidence instead of broad rereads.");
575677
+ return this.inject(directive, requiredNextAction === "update_todos" ? "[FOCUS SUPERVISOR] Discovery noise is crowding the live context. Update the todo decomposition, then act on active evidence instead of broad rereads." : "[FOCUS SUPERVISOR] Discovery noise is crowding the live context, and todo_write is not available in this tool surface. Report blocked/incomplete with the concrete blocker, or proceed only if an available substantive tool can satisfy the task.");
575663
575678
  }
575664
575679
  this.lastDecision = "pass";
575665
575680
  this.lastReason = "";
@@ -575739,22 +575754,24 @@ var init_focusSupervisor = __esm({
575739
575754
  actionFamily(input.toolName, input.args),
575740
575755
  input.toolName
575741
575756
  ]) : input.toolName === "shell" ? [actionFamily(input.toolName, input.args)] : [actionFamily(input.toolName, input.args)];
575757
+ const requiredNextAction = ambiguousEditFailure ? "disambiguate_edit_match" : staleEditFailure ? "read_authoritative_target" : input.toolName === "shell" ? "use_cached_evidence" : this.resolveRequiredNextAction("update_todos");
575742
575758
  this.setDirective({
575743
575759
  turn: input.turn,
575744
575760
  state: "forced_replan",
575745
575761
  reason: `same ${input.toolName} failure family repeated ${next.count} times: ${next.sample}`,
575746
- requiredNextAction: ambiguousEditFailure ? "disambiguate_edit_match" : staleEditFailure ? "read_authoritative_target" : input.toolName === "shell" ? "use_cached_evidence" : "update_todos",
575762
+ requiredNextAction,
575747
575763
  forbiddenActionFamilies: forbidden
575748
575764
  });
575749
575765
  } else if (next.count === 1 && !this.directive) {
575750
575766
  const ambiguousEditFailure = isEditTool(input.toolName) && next.errorClass === "stale_ambiguous_target";
575751
575767
  const staleEditFailure = isEditTool(input.toolName) && next.errorClass.startsWith("stale_");
575752
575768
  const shellFailure = input.toolName === "shell";
575769
+ const requiredNextAction = ambiguousEditFailure ? "disambiguate_edit_match" : staleEditFailure ? "read_authoritative_target" : shellFailure ? "use_cached_evidence" : this.resolveRequiredNextAction("update_todos");
575753
575770
  this.setDirective({
575754
575771
  turn: input.turn,
575755
575772
  state: shellFailure ? "cached_evidence" : "warn",
575756
575773
  reason: `first ${input.toolName} failure (${next.errorClass}): ${next.sample}`,
575757
- requiredNextAction: ambiguousEditFailure ? "disambiguate_edit_match" : staleEditFailure ? "read_authoritative_target" : shellFailure ? "use_cached_evidence" : "update_todos",
575774
+ requiredNextAction,
575758
575775
  forbiddenActionFamilies: shellFailure ? [actionFamily(input.toolName, input.args)] : [actionFamily(input.toolName, input.args)]
575759
575776
  });
575760
575777
  }
@@ -575766,7 +575783,7 @@ var init_focusSupervisor = __esm({
575766
575783
  turn: input.turn,
575767
575784
  state: "verify_or_block",
575768
575785
  reason: input.reason,
575769
- requiredNextAction: input.requiredNextAction ?? "run_verification",
575786
+ requiredNextAction: this.resolveRequiredNextAction(input.requiredNextAction ?? "run_verification"),
575770
575787
  forbiddenActionFamilies: ["task_complete"]
575771
575788
  });
575772
575789
  }
@@ -581694,6 +581711,22 @@ ${result.output ?? ""}`;
581694
581711
  return [];
581695
581712
  return todos.filter((t2) => t2.status !== "completed");
581696
581713
  }
581714
+ _taskCompleteArgsReportDegraded(args) {
581715
+ const status = completionStatusFromTaskCompleteArgs(args);
581716
+ if (status === "blocked" || status === "incomplete" || status === "needs_input") {
581717
+ return true;
581718
+ }
581719
+ const summary = args && typeof args["summary"] === "string" ? args["summary"] : "";
581720
+ return /^\s*(BLOCKED|INCOMPLETE|NEEDS[_ -]?INPUT)\b\s*:?/i.test(summary);
581721
+ }
581722
+ _shouldBypassTodoCompletionGuardForTaskComplete(args) {
581723
+ if (!this._taskCompleteArgsReportDegraded(args))
581724
+ return false;
581725
+ if (this._completionIncompleteVerification)
581726
+ return true;
581727
+ const directive = this._focusSupervisor?.snapshot().directive;
581728
+ return directive?.state === "terminal_incomplete" || directive?.requiredNextAction === "report_incomplete" || directive?.requiredNextAction === "report_blocked";
581729
+ }
581697
581730
  /**
581698
581731
  * Build a guard prompt injected when the model attempts to call task_complete
581699
581732
  * while there are open todo items. This asks the model to verify each item by
@@ -583790,8 +583823,14 @@ ${latest.output || ""}`.trim();
583790
583823
  const artifactLines = intEnv("OMNIUS_CONTEXT_TREE_ARTIFACT_LINES", 1800, 100, 4e3);
583791
583824
  try {
583792
583825
  const scan = scanWorkspace({ root, maxFiles, maxDirs });
583793
- const compactTree = renderWorkspaceTree(scan, { maxLines: contextLines, sortBy: "recent" });
583794
- const fullTree = renderWorkspaceTree(scan, { maxLines: artifactLines, sortBy: "recent" });
583826
+ const compactTree = renderWorkspaceTree(scan, {
583827
+ maxLines: contextLines,
583828
+ sortBy: "recent"
583829
+ });
583830
+ const fullTree = renderWorkspaceTree(scan, {
583831
+ maxLines: artifactLines,
583832
+ sortBy: "recent"
583833
+ });
583795
583834
  const totalBytes = scan.files.reduce((sum, file) => sum + file.bytes, 0);
583796
583835
  const generatedAt = (/* @__PURE__ */ new Date()).toISOString();
583797
583836
  const focusSnapshot = this._focusSupervisor?.snapshot();
@@ -585892,7 +585931,8 @@ Respond with your assessment, then take action.`;
585892
585931
  this._focusSupervisor = this.options.focusSupervisor === "off" ? null : new FocusSupervisor({
585893
585932
  mode: this.options.focusSupervisor,
585894
585933
  modelTier: this.options.modelTier,
585895
- repeatGateMax: this._resolveRepeatGateMax()
585934
+ repeatGateMax: this._resolveRepeatGateMax(),
585935
+ availableTools: this.tools.keys()
585896
585936
  });
585897
585937
  if (!this._workingDirectory) {
585898
585938
  this._workingDirectory = _pathResolve(process.cwd());
@@ -591484,8 +591524,9 @@ ${sr.result.output}`;
591484
591524
  });
591485
591525
  continue;
591486
591526
  }
591527
+ const taskCompleteArgs = matchTc.arguments;
591487
591528
  const open2 = this.getOpenTodoItems();
591488
- if (open2.length > 0) {
591529
+ if (open2.length > 0 && !this._shouldBypassTodoCompletionGuardForTaskComplete(taskCompleteArgs)) {
591489
591530
  const guard = this.buildTodoCompletionGuard(open2);
591490
591531
  messages2.push({ role: "system", content: guard });
591491
591532
  this.emit({
@@ -591494,12 +591535,12 @@ ${sr.result.output}`;
591494
591535
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
591495
591536
  });
591496
591537
  } else {
591497
- if (holdTaskCompleteGates(matchTc.arguments, turn)) {
591538
+ if (holdTaskCompleteGates(taskCompleteArgs, turn)) {
591498
591539
  if (this._completionIncompleteVerification)
591499
591540
  break;
591500
591541
  continue;
591501
591542
  }
591502
- const _bp1 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(matchTc.arguments));
591543
+ const _bp1 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(taskCompleteArgs));
591503
591544
  if (_bp1 && !_bp1.proceed) {
591504
591545
  if (_bp1.feedback)
591505
591546
  emitBackwardPassAdvisory(_bp1.feedback, turn);
@@ -591508,7 +591549,7 @@ ${sr.result.output}`;
591508
591549
  continue;
591509
591550
  }
591510
591551
  completed = true;
591511
- summary = extractTaskCompleteSummary(matchTc.arguments);
591552
+ summary = extractTaskCompleteSummary(taskCompleteArgs);
591512
591553
  this._onTypedEvent?.({
591513
591554
  type: "completion_requested",
591514
591555
  runId: this._sessionId ?? "unknown",
@@ -591558,8 +591599,9 @@ ${sr.result.output}`;
591558
591599
  });
591559
591600
  continue;
591560
591601
  }
591602
+ const taskCompleteArgs = r2.tc.arguments;
591561
591603
  const open2 = this.getOpenTodoItems();
591562
- if (open2.length > 0) {
591604
+ if (open2.length > 0 && !this._shouldBypassTodoCompletionGuardForTaskComplete(taskCompleteArgs)) {
591563
591605
  const guard = this.buildTodoCompletionGuard(open2);
591564
591606
  messages2.push({ role: "system", content: guard });
591565
591607
  this.emit({
@@ -591568,12 +591610,12 @@ ${sr.result.output}`;
591568
591610
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
591569
591611
  });
591570
591612
  } else {
591571
- if (holdTaskCompleteGates(r2.tc.arguments, turn)) {
591613
+ if (holdTaskCompleteGates(taskCompleteArgs, turn)) {
591572
591614
  if (this._completionIncompleteVerification)
591573
591615
  break;
591574
591616
  continue;
591575
591617
  }
591576
- const _bp2 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(r2.tc.arguments));
591618
+ const _bp2 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(taskCompleteArgs));
591577
591619
  if (_bp2 && !_bp2.proceed) {
591578
591620
  if (_bp2.feedback)
591579
591621
  emitBackwardPassAdvisory(_bp2.feedback, turn);
@@ -591582,7 +591624,7 @@ ${sr.result.output}`;
591582
591624
  continue;
591583
591625
  }
591584
591626
  completed = true;
591585
- summary = extractTaskCompleteSummary(r2.tc.arguments);
591627
+ summary = extractTaskCompleteSummary(taskCompleteArgs);
591586
591628
  this._onTypedEvent?.({
591587
591629
  type: "completion_requested",
591588
591630
  runId: this._sessionId ?? "unknown",
@@ -591671,8 +591713,9 @@ ${sr.result.output}`;
591671
591713
  });
591672
591714
  continue;
591673
591715
  }
591716
+ const taskCompleteArgs = r2.tc.arguments;
591674
591717
  const open2 = this.getOpenTodoItems();
591675
- if (open2.length > 0) {
591718
+ if (open2.length > 0 && !this._shouldBypassTodoCompletionGuardForTaskComplete(taskCompleteArgs)) {
591676
591719
  const guard = this.buildTodoCompletionGuard(open2);
591677
591720
  messages2.push({ role: "system", content: guard });
591678
591721
  this.emit({
@@ -591681,12 +591724,12 @@ ${sr.result.output}`;
591681
591724
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
591682
591725
  });
591683
591726
  } else {
591684
- if (holdTaskCompleteGates(r2.tc.arguments, turn)) {
591727
+ if (holdTaskCompleteGates(taskCompleteArgs, turn)) {
591685
591728
  if (this._completionIncompleteVerification)
591686
591729
  break;
591687
591730
  continue;
591688
591731
  }
591689
- const _bp3 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(r2.tc.arguments));
591732
+ const _bp3 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(taskCompleteArgs));
591690
591733
  if (_bp3 && !_bp3.proceed) {
591691
591734
  if (_bp3.feedback)
591692
591735
  emitBackwardPassAdvisory(_bp3.feedback, turn);
@@ -591695,7 +591738,7 @@ ${sr.result.output}`;
591695
591738
  continue;
591696
591739
  }
591697
591740
  completed = true;
591698
- summary = extractTaskCompleteSummary(r2.tc.arguments);
591741
+ summary = extractTaskCompleteSummary(taskCompleteArgs);
591699
591742
  this._onTypedEvent?.({
591700
591743
  type: "completion_requested",
591701
591744
  runId: this._sessionId ?? "unknown",
@@ -592573,8 +592616,9 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
592573
592616
  });
592574
592617
  continue;
592575
592618
  }
592619
+ const taskCompleteArgs = tc.arguments;
592576
592620
  const open2 = this.getOpenTodoItems();
592577
- if (open2.length > 0) {
592621
+ if (open2.length > 0 && !this._shouldBypassTodoCompletionGuardForTaskComplete(taskCompleteArgs)) {
592578
592622
  const guard = this.buildTodoCompletionGuard(open2);
592579
592623
  messages2.push({ role: "system", content: guard });
592580
592624
  this.emit({
@@ -592583,12 +592627,12 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
592583
592627
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
592584
592628
  });
592585
592629
  } else {
592586
- if (holdTaskCompleteGates(tc.arguments, turn)) {
592630
+ if (holdTaskCompleteGates(taskCompleteArgs, turn)) {
592587
592631
  if (this._completionIncompleteVerification)
592588
592632
  break;
592589
592633
  continue;
592590
592634
  }
592591
- const _bp4 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(tc.arguments));
592635
+ const _bp4 = await this._runBackwardPassReview(turn, toolCallLog, extractTaskCompleteSummary(taskCompleteArgs));
592592
592636
  if (_bp4 && !_bp4.proceed) {
592593
592637
  if (_bp4.feedback)
592594
592638
  emitBackwardPassAdvisory(_bp4.feedback, turn);
@@ -592597,7 +592641,7 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
592597
592641
  continue;
592598
592642
  }
592599
592643
  completed = true;
592600
- summary = extractTaskCompleteSummary(tc.arguments);
592644
+ summary = extractTaskCompleteSummary(taskCompleteArgs);
592601
592645
  this._onTypedEvent?.({
592602
592646
  type: "completion_requested",
592603
592647
  runId: this._sessionId ?? "unknown",
@@ -592638,8 +592682,9 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
592638
592682
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
592639
592683
  });
592640
592684
  if (/task.?complete|all tests pass/i.test(content)) {
592685
+ const completionArgs = { summary: content };
592641
592686
  const open2 = this.getOpenTodoItems();
592642
- if (open2.length > 0) {
592687
+ if (open2.length > 0 && !this._shouldBypassTodoCompletionGuardForTaskComplete(completionArgs)) {
592643
592688
  const guard = this.buildTodoCompletionGuard(open2);
592644
592689
  messages2.push({ role: "system", content: guard });
592645
592690
  this.emit({
@@ -592648,7 +592693,6 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
592648
592693
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
592649
592694
  });
592650
592695
  } else {
592651
- const completionArgs = { summary: content };
592652
592696
  if (holdTaskCompleteGates(completionArgs, turn)) {
592653
592697
  if (this._completionIncompleteVerification)
592654
592698
  break;
@@ -737632,6 +737676,11 @@ function createTaskCompleteTool(modelTier2, repoRoot, skipSessionGuard) {
737632
737676
  required: ["summary"]
737633
737677
  },
737634
737678
  async execute(args) {
737679
+ const completionStatus = typeof args["status"] === "string" ? args["status"].trim().toLowerCase().replace(/[\s-]+/g, "_") : "";
737680
+ const summaryText = typeof args["summary"] === "string" ? args["summary"] : "";
737681
+ const reportsDegradedCompletion = completionStatus === "blocked" || completionStatus === "incomplete" || completionStatus === "needs_input" || /^\s*(BLOCKED|INCOMPLETE|NEEDS[_ -]?INPUT)\b\s*:?/i.test(
737682
+ summaryText
737683
+ );
737635
737684
  if (_interactiveSessionActive && !skipSessionGuard) {
737636
737685
  return {
737637
737686
  success: false,
@@ -737646,7 +737695,7 @@ function createTaskCompleteTool(modelTier2, repoRoot, skipSessionGuard) {
737646
737695
  const incomplete = todos.filter(
737647
737696
  (t2) => t2.status === "pending" || t2.status === "in_progress" || t2.status === "blocked"
737648
737697
  );
737649
- if (incomplete.length > 0) {
737698
+ if (incomplete.length > 0 && !reportsDegradedCompletion) {
737650
737699
  const incompleteList = incomplete.slice(0, 20).map(
737651
737700
  (t2) => ` - [${t2.status}] ${t2.content}${t2.blocker ? ` (blocked: ${t2.blocker})` : ""}`
737652
737701
  ).join("\n");
@@ -737672,9 +737721,11 @@ ${incompleteList}${more}
737672
737721
  ` + guidance
737673
737722
  };
737674
737723
  }
737675
- try {
737676
- writeTodos(sessionId, []);
737677
- } catch {
737724
+ if (incomplete.length === 0) {
737725
+ try {
737726
+ writeTodos(sessionId, []);
737727
+ } catch {
737728
+ }
737678
737729
  }
737679
737730
  }
737680
737731
  } catch {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.466",
3
+ "version": "1.0.467",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.466",
9
+ "version": "1.0.467",
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.466",
3
+ "version": "1.0.467",
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/index.js",