omnius 1.0.923 → 1.0.925

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.
Files changed (239) hide show
  1. package/dist/{providerRegistry.d.ts → _types/backend-vllm/providerRegistry.d.ts} +0 -1
  2. package/dist/_types/backend-vllm/types.d.ts +209 -0
  3. package/dist/_types/execution/av/media-capability.d.ts +94 -0
  4. package/dist/_types/execution/delegation-contract.d.ts +102 -0
  5. package/dist/_types/execution/evidence.d.ts +68 -0
  6. package/dist/_types/execution/html-source-evidence.d.ts +65 -0
  7. package/dist/_types/execution/mcp/types.d.ts +169 -0
  8. package/dist/_types/execution/mutation-contract.d.ts +102 -0
  9. package/dist/_types/execution/nol/artifacts.d.ts +39 -0
  10. package/dist/_types/execution/nol/checkpoint-edits.d.ts +98 -0
  11. package/dist/_types/execution/nol/distributions.d.ts +128 -0
  12. package/dist/_types/execution/nol/gguf-checkpoint-edits.d.ts +194 -0
  13. package/dist/_types/execution/nol/gguf-control-reader.d.ts +224 -0
  14. package/dist/_types/execution/nol/lora-exports.d.ts +129 -0
  15. package/dist/_types/execution/nol/neuronary.d.ts +212 -0
  16. package/dist/_types/execution/nol/pytorch-control-reader.d.ts +143 -0
  17. package/dist/_types/execution/nol/qwen35-head-sites.d.ts +61 -0
  18. package/dist/_types/execution/nol/worker-assets.d.ts +82 -0
  19. package/dist/_types/execution/nol/worker-protocol.d.ts +94 -0
  20. package/dist/_types/execution/page-content-source.d.ts +40 -0
  21. package/dist/_types/execution/rapid-computer-use/artifact-store.d.ts +21 -0
  22. package/dist/_types/execution/rapid-computer-use/contracts.d.ts +320 -0
  23. package/dist/_types/execution/rapid-computer-use/decision.d.ts +70 -0
  24. package/dist/_types/execution/rapid-computer-use/desktop-verification.d.ts +23 -0
  25. package/dist/_types/execution/rapid-computer-use/geometry.d.ts +57 -0
  26. package/dist/_types/execution/rapid-computer-use/planner.d.ts +78 -0
  27. package/dist/_types/execution/rapid-computer-use/trace.d.ts +80 -0
  28. package/dist/_types/execution/rapid-computer-use/visual.d.ts +48 -0
  29. package/dist/_types/execution/shell-runs.d.ts +78 -0
  30. package/dist/_types/execution/streamed-web-source.d.ts +64 -0
  31. package/dist/_types/execution/tools/browser-page-fallback.d.ts +25 -0
  32. package/dist/_types/execution/tools/network-egress-policy.d.ts +30 -0
  33. package/dist/_types/execution/tools/pdf-native-tables.d.ts +46 -0
  34. package/dist/_types/execution/tools/todo-store.d.ts +133 -0
  35. package/dist/_types/execution/tools/web-fetch.d.ts +57 -0
  36. package/dist/_types/execution/tools/workboard.d.ts +1223 -0
  37. package/dist/_types/execution/types.d.ts +549 -0
  38. package/dist/_types/execution/web-source.d.ts +14 -0
  39. package/dist/_types/memory/artifactReviewSourceIndex.d.ts +133 -0
  40. package/dist/_types/memory/contextMemoryLedger.d.ts +213 -0
  41. package/dist/_types/memory/db.d.ts +12 -0
  42. package/dist/_types/memory/embeddings.d.ts +36 -0
  43. package/dist/_types/memory/immutableEvidenceStore.d.ts +165 -0
  44. package/dist/_types/memory/memoryIngestion.d.ts +65 -0
  45. package/dist/_types/memory/memoryTypes.d.ts +312 -0
  46. package/dist/_types/memory/sourceCorpusStore.d.ts +331 -0
  47. package/dist/_types/memory/structuredMemoryStore.d.ts +105 -0
  48. package/dist/_types/memory/unifiedMemoryStore.d.ts +127 -0
  49. package/dist/_types/memory/virtualMemory.d.ts +187 -0
  50. package/dist/_types/orchestrator/agentic-page-content-receipt.d.ts +20 -0
  51. package/dist/_types/orchestrator/agentic-web-fetch-receipt.d.ts +20 -0
  52. package/dist/_types/orchestrator/agenticRunner.d.ts +5219 -0
  53. package/dist/_types/orchestrator/app-state.d.ts +171 -0
  54. package/dist/_types/orchestrator/artifactClaimCritic.d.ts +63 -0
  55. package/dist/_types/orchestrator/artifactQuality.d.ts +15 -0
  56. package/dist/_types/orchestrator/artifactSemanticIntegrity.d.ts +203 -0
  57. package/dist/_types/orchestrator/canonical-context-projection.d.ts +254 -0
  58. package/dist/_types/orchestrator/canonical-source-body-projection.d.ts +51 -0
  59. package/dist/_types/orchestrator/completion-review-pending.d.ts +24 -0
  60. package/dist/_types/orchestrator/completionContract.d.ts +103 -0
  61. package/dist/_types/orchestrator/completionFinalization.d.ts +224 -0
  62. package/dist/_types/orchestrator/completionLedger.d.ts +429 -0
  63. package/dist/_types/orchestrator/completionReadiness.d.ts +234 -0
  64. package/dist/_types/orchestrator/context-admission.d.ts +93 -0
  65. package/dist/_types/orchestrator/context-dump-retention.d.ts +25 -0
  66. package/dist/_types/orchestrator/context-fabric.d.ts +133 -0
  67. package/dist/_types/orchestrator/contextEngine.d.ts +68 -0
  68. package/dist/_types/orchestrator/contextWindowDump.d.ts +327 -0
  69. package/dist/_types/orchestrator/convergence-breaker.d.ts +225 -0
  70. package/dist/_types/orchestrator/convergence-progress.d.ts +66 -0
  71. package/dist/_types/orchestrator/deliveryCoverage.d.ts +181 -0
  72. package/dist/_types/orchestrator/document-persistence-goal-binding.d.ts +106 -0
  73. package/dist/_types/orchestrator/durable-document-worker.d.ts +85 -0
  74. package/dist/_types/orchestrator/evidenceBranch.d.ts +291 -0
  75. package/dist/_types/orchestrator/expected-inference-response.d.ts +55 -0
  76. package/dist/_types/orchestrator/expectedOutcomeContract.d.ts +58 -0
  77. package/dist/_types/orchestrator/failure-taxonomy.d.ts +36 -0
  78. package/dist/_types/orchestrator/focusSupervisor.d.ts +436 -0
  79. package/dist/_types/orchestrator/forced-update-requirement-recovery.d.ts +105 -0
  80. package/dist/_types/orchestrator/hooks.d.ts +100 -0
  81. package/dist/_types/orchestrator/inference-pressure.d.ts +61 -0
  82. package/dist/_types/orchestrator/integrationClosure.d.ts +89 -0
  83. package/dist/_types/orchestrator/interruption-lifecycle.d.ts +154 -0
  84. package/dist/_types/orchestrator/live-memory-passages.d.ts +51 -0
  85. package/dist/_types/orchestrator/liveVirtualContext.d.ts +84 -0
  86. package/dist/_types/orchestrator/memory-compiler.d.ts +254 -0
  87. package/dist/_types/orchestrator/memory-consolidation.d.ts +134 -0
  88. package/dist/_types/orchestrator/model-router.d.ts +17 -0
  89. package/dist/_types/orchestrator/modelResponseDiagnostics.d.ts +71 -0
  90. package/dist/_types/orchestrator/nativeRequirementAmendment.d.ts +63 -0
  91. package/dist/_types/orchestrator/nol/coordinator.d.ts +204 -0
  92. package/dist/_types/orchestrator/nol/datasets.d.ts +58 -0
  93. package/dist/_types/orchestrator/nol/discovery.d.ts +286 -0
  94. package/dist/_types/orchestrator/nol/evaluation.d.ts +59 -0
  95. package/dist/_types/orchestrator/nol/model-validation.d.ts +198 -0
  96. package/dist/_types/orchestrator/nol/statistics.d.ts +142 -0
  97. package/dist/_types/orchestrator/nol/store.d.ts +133 -0
  98. package/dist/_types/orchestrator/nol/variant-registry.d.ts +292 -0
  99. package/dist/_types/orchestrator/ollama-context-policy.d.ts +34 -0
  100. package/dist/_types/orchestrator/personality.d.ts +66 -0
  101. package/dist/_types/orchestrator/prompt-cache.d.ts +24 -0
  102. package/dist/_types/orchestrator/remote-inference-fallback.d.ts +224 -0
  103. package/dist/_types/orchestrator/remote-inference-policy.d.ts +58 -0
  104. package/dist/_types/orchestrator/request-budget.d.ts +75 -0
  105. package/dist/_types/orchestrator/requirementCoverage.d.ts +69 -0
  106. package/dist/_types/orchestrator/reviewedInterpretation.d.ts +111 -0
  107. package/dist/_types/orchestrator/runEvents.d.ts +115 -0
  108. package/dist/_types/orchestrator/runtime-rollout.d.ts +63 -0
  109. package/dist/_types/orchestrator/semanticVerification.d.ts +135 -0
  110. package/dist/_types/orchestrator/source-wide-extraction.d.ts +202 -0
  111. package/dist/_types/orchestrator/steeringIntake.d.ts +123 -0
  112. package/dist/_types/orchestrator/structured-memory-extraction-worker.d.ts +89 -0
  113. package/dist/_types/orchestrator/structuredMemoryInference.d.ts +62 -0
  114. package/dist/_types/orchestrator/successful-procedure-memory.d.ts +127 -0
  115. package/dist/_types/orchestrator/supportedAnswer.d.ts +68 -0
  116. package/dist/_types/orchestrator/taskEffectEvidence.d.ts +38 -0
  117. package/dist/_types/orchestrator/taskExecutionSnapshot.d.ts +67 -0
  118. package/dist/_types/orchestrator/taskObjective.d.ts +310 -0
  119. package/dist/_types/orchestrator/taskObjectiveContinuation.d.ts +134 -0
  120. package/dist/_types/orchestrator/taskRequirementReview.d.ts +246 -0
  121. package/dist/_types/orchestrator/taskRequirements.d.ts +80 -0
  122. package/dist/_types/orchestrator/taskSemanticAdmission.d.ts +159 -0
  123. package/dist/_types/orchestrator/taskWorkDelegation.d.ts +147 -0
  124. package/dist/_types/orchestrator/taskWorkPlan.d.ts +177 -0
  125. package/dist/_types/orchestrator/telegram-passive-history.d.ts +42 -0
  126. package/dist/_types/orchestrator/terminalTaskReport.d.ts +91 -0
  127. package/dist/_types/orchestrator/todoObservability.d.ts +147 -0
  128. package/dist/_types/orchestrator/tool-exposure-policy.d.ts +100 -0
  129. package/dist/_types/orchestrator/trajectory-checkpoint.d.ts +159 -0
  130. package/dist/_types/orchestrator/types.d.ts +185 -0
  131. package/dist/_types/schemas/dispatch.d.ts +53 -0
  132. package/dist/_types/schemas/feature-workflow.d.ts +362 -0
  133. package/dist/_types/schemas/messages.d.ts +15 -0
  134. package/dist/_types/schemas/nol-assets.d.ts +955 -0
  135. package/dist/_types/schemas/nol-json.d.ts +2 -0
  136. package/dist/_types/schemas/nol.d.ts +3995 -0
  137. package/dist/_types/schemas/patch.d.ts +47 -0
  138. package/dist/_types/schemas/plan.d.ts +47 -0
  139. package/dist/_types/schemas/repoProfile.d.ts +116 -0
  140. package/dist/_types/schemas/retrieval.d.ts +44 -0
  141. package/dist/_types/schemas/task.d.ts +57 -0
  142. package/dist/_types/schemas/tools.d.ts +16 -0
  143. package/dist/_types/schemas/verification.d.ts +31 -0
  144. package/dist/api/py-embed.js +3353 -1829
  145. package/dist/assets/nol-checkpoint-editor.py +701 -0
  146. package/dist/assets/nol-gguf-checkpoint-editor.py +785 -0
  147. package/dist/assets/nol-gguf-control-reader.py +428 -0
  148. package/dist/assets/nol-gne-tools-worker.py +425 -0
  149. package/dist/assets/nol-gne-worker.py +1081 -0
  150. package/dist/assets/nol-lora-exporter.py +349 -0
  151. package/dist/assets/nol-pytorch-control-reader.py +470 -0
  152. package/dist/assets/nol-transformers-nnsight-worker.py +512 -0
  153. package/dist/assets/nol-transformers-peft-validation-worker.py +385 -0
  154. package/dist/assets/nol-transformers-peft-worker.py +488 -0
  155. package/dist/assets/nol-transformers-research-worker.py +472 -0
  156. package/dist/assets/nol-transformers-worker.py +920 -0
  157. package/dist/assets/nol-vllm-owned-worker.py +803 -0
  158. package/dist/assets/nol-vllm-runtime.py +695 -0
  159. package/dist/assets/nol-vllm-tokenizer.py +93 -0
  160. package/dist/assets/nol-vllm-worker.py +201 -0
  161. package/dist/computer-use/configured-planner.d.ts +37 -0
  162. package/dist/computer-use/configured-point.d.ts +35 -0
  163. package/dist/computer-use/host-session.d.ts +60 -0
  164. package/dist/computer-use/runner-ui-port.d.ts +37 -0
  165. package/dist/computer-use/session-review.d.ts +14 -0
  166. package/dist/computer-use/task-spec.d.ts +84 -0
  167. package/dist/discovery.d.ts +16 -2
  168. package/dist/index.js +2 -2
  169. package/dist/library.d.ts +94 -10
  170. package/dist/library.js +144003 -87414
  171. package/dist/memory-maintenance-worker.js +1676 -511
  172. package/dist/nol/cpu-control-reader-profile.d.ts +93 -0
  173. package/dist/nol/cpu-control-reader-service.d.ts +87 -0
  174. package/dist/nol/cuda-lease.d.ts +111 -0
  175. package/dist/nol/cuda-mutations.d.ts +34 -0
  176. package/dist/nol/export-runtime-config.d.ts +114 -0
  177. package/dist/nol/export-service.d.ts +143 -0
  178. package/dist/nol/facade.d.ts +147 -0
  179. package/dist/nol/gguf-cpu-control-reader-profile.d.ts +106 -0
  180. package/dist/nol/gguf-cpu-control-reader-service.d.ts +91 -0
  181. package/dist/nol/gguf-model-control-verifier.d.ts +120 -0
  182. package/dist/nol/gguf-parameter-inventory.d.ts +28 -0
  183. package/dist/nol/gne-adapter.d.ts +134 -0
  184. package/dist/nol/gne-agent-evaluation.d.ts +84 -0
  185. package/dist/nol/gne-profile.d.ts +124 -0
  186. package/dist/nol/gne-tools-profile.d.ts +148 -0
  187. package/dist/nol/gne-tools-transport.d.ts +194 -0
  188. package/dist/nol/model-actions.d.ts +662 -0
  189. package/dist/nol/model-control-verifier.d.ts +135 -0
  190. package/dist/nol/model-json-scorer.d.ts +13 -0
  191. package/dist/nol/model-runtime-config.d.ts +830 -0
  192. package/dist/nol/model-serving.d.ts +130 -0
  193. package/dist/nol/model-subject-adapter.d.ts +72 -0
  194. package/dist/nol/model-validation-factory.d.ts +113 -0
  195. package/dist/nol/neuronary-catalog.d.ts +130 -0
  196. package/dist/nol/orphan-custody.d.ts +72 -0
  197. package/dist/nol/peft-conformance.d.ts +48 -0
  198. package/dist/nol/peft-control-types.d.ts +137 -0
  199. package/dist/nol/peft-control-verifier.d.ts +8 -0
  200. package/dist/nol/peft-model-actions.d.ts +41 -0
  201. package/dist/nol/peft-model-authority.d.ts +146 -0
  202. package/dist/nol/peft-model-controls.d.ts +20 -0
  203. package/dist/nol/peft-model-host.d.ts +47 -0
  204. package/dist/nol/peft-model-profile.d.ts +161 -0
  205. package/dist/nol/peft-model-runtime-config.d.ts +174 -0
  206. package/dist/nol/peft-model-subject-adapter.d.ts +36 -0
  207. package/dist/nol/peft-validation.d.ts +105 -0
  208. package/dist/nol/persistent-parameter-inventory.d.ts +32 -0
  209. package/dist/nol/runtime.d.ts +100 -0
  210. package/dist/nol/sqlite-store.d.ts +80 -0
  211. package/dist/nol/transformers-adapter.d.ts +119 -0
  212. package/dist/nol/transformers-nnsight.d.ts +87 -0
  213. package/dist/nol/transformers-peft.d.ts +107 -0
  214. package/dist/nol/transformers-research.d.ts +114 -0
  215. package/dist/nol/variant-service.d.ts +143 -0
  216. package/dist/nol/variant-store.d.ts +51 -0
  217. package/dist/nol/vllm-actions.d.ts +774 -0
  218. package/dist/nol/vllm-adapter.d.ts +1473 -0
  219. package/dist/nol/vllm-authority.d.ts +55 -0
  220. package/dist/nol/vllm-conformance.d.ts +662 -0
  221. package/dist/nol/vllm-profile.d.ts +850 -0
  222. package/dist/nol/vllm-protocol.d.ts +1505 -0
  223. package/dist/nol/vllm-runtime-config.d.ts +120 -0
  224. package/dist/nol/vllm-runtime.d.ts +34 -0
  225. package/dist/nol/vllm-startup.d.ts +235 -0
  226. package/dist/omni-setup-worker.js +3433 -1909
  227. package/dist/service-version.d.ts +0 -1
  228. package/dist/tui/async-process.d.ts +27 -0
  229. package/dist/tui/native/worker.js +3 -1
  230. package/dist/tui/telegram-action-session-registry.d.ts +136 -0
  231. package/dist/tui/telegram-cognition-queue.d.ts +154 -0
  232. package/dist/tui/telegram-context-packet-v2.d.ts +99 -0
  233. package/dist/tui/telegram-input-ownership.d.ts +78 -0
  234. package/dist/tui/telegram-turn-contract-v2.d.ts +62 -0
  235. package/dist/update-worker-runtime.js +4216 -2603
  236. package/docs/DISCOVERY.json +389 -0
  237. package/docs/DISCOVERY.md +4 -0
  238. package/npm-shrinkwrap.json +28 -12
  239. package/package.json +3 -2
@@ -0,0 +1,436 @@
1
+ import { type ConvergenceBreaker, type ConvergenceBreakerCheckpoint } from "./convergence-breaker.js";
2
+ /** Stable host task identity; transport attempts and progress are deliberately absent. */
3
+ export declare function createFocusConvergenceScope(input: {
4
+ sessionId: string;
5
+ runId: string;
6
+ nativeTask?: {
7
+ sessionKey: string;
8
+ taskId: string;
9
+ originalInputId: string;
10
+ actorKey: string;
11
+ chatId: string;
12
+ messageThreadId: number;
13
+ };
14
+ objective?: {
15
+ originalRequestRef: string;
16
+ originalRequestHash: string;
17
+ };
18
+ }): string;
19
+ export type FocusSupervisorMode = "off" | "auto" | "strict";
20
+ export interface NegativeObservationScope {
21
+ taskEpoch: number;
22
+ /** Host-owned exact operation identity, including its execution directory. */
23
+ operationKey: string;
24
+ /** Only observed effects advance this version; model prose cannot renew it. */
25
+ evidenceStateVersion: number;
26
+ }
27
+ /**
28
+ * A bounded recovery budget for an executor-classified negative observation.
29
+ * This is independent of advisory focus heuristics and model tier. It never
30
+ * caches successful tool output, treats empty stdout as failure, or groups
31
+ * shell commands by guessed paths. Callers must supply trusted receipts.
32
+ */
33
+ export declare class NegativeObservationRecovery {
34
+ private taskEpoch;
35
+ private observations;
36
+ private refusedTurns;
37
+ private refusalStateVersion;
38
+ private lastFinishedTurn;
39
+ clear(): void;
40
+ private useEpoch;
41
+ observe(input: NegativeObservationScope & {
42
+ negative: boolean;
43
+ evidenceRef: string;
44
+ }): void;
45
+ admission(input: NegativeObservationScope): {
46
+ observations: number;
47
+ evidenceRefs: string[];
48
+ } | null;
49
+ /** Only full model turns count. Progress/control tools cannot refund a hold. */
50
+ finishTurn(input: {
51
+ taskEpoch: number;
52
+ evidenceStateVersion: number;
53
+ turn: number;
54
+ outcomes: Array<"held" | "executed" | "control">;
55
+ }): boolean;
56
+ }
57
+ export type FocusSupervisorModelTier = "small" | "medium" | "large";
58
+ export type FocusSupervisorState = "observe" | "warn" | "cached_evidence" | "forced_replan" | "single_next_action" | "verify_or_block" | "terminal_incomplete";
59
+ /** Lifecycle is controller state, not a second prompt protocol. */
60
+ export type FocusDirectiveLifecycleState = "active" | "satisfied" | "expired" | "superseded" | "cancelled";
61
+ export type FocusDirectiveSource = "duplicate_action" | "stale_write" | "verification_failure" | "repeated_failure" | "discovery_pressure" | "completion_gate" | "manual";
62
+ export interface FocusDirectiveSatisfaction {
63
+ kind: "fresh_read" | "distinct_action" | "verification" | "todo_update" | "blocked_completion" | "repair_verified";
64
+ target?: string;
65
+ family?: string;
66
+ }
67
+ export type FocusRequiredNextAction = "use_cached_evidence" | "update_todos" | "read_authoritative_target" | "disambiguate_edit_match" | "edit_different_target" | "run_verification" | "delegate_isolated_fix" | "creative_pivot_or_research" | "report_blocked" | "report_incomplete";
68
+ export type FocusCompletionStatus = "completed" | "blocked" | "incomplete" | "no_changes_required" | "needs_input";
69
+ export interface FocusContextSnapshot {
70
+ estimatedTokens?: number;
71
+ rawDiscoveryChars?: number;
72
+ activeEvidenceChars?: number;
73
+ activeFrameChars?: number;
74
+ signalToNoiseRatio?: number;
75
+ pressureRatio?: number;
76
+ droppedSignals?: number;
77
+ truncatedSignals?: number;
78
+ }
79
+ export interface FocusSupervisorDirective {
80
+ id: string;
81
+ state: FocusSupervisorState;
82
+ reason: string;
83
+ requiredNextAction: FocusRequiredNextAction;
84
+ forbiddenActionFamilies: string[];
85
+ createdTurn: number;
86
+ ignoredCount: number;
87
+ /** Task identity prevents an old recovery from governing a replacement task. */
88
+ taskEpoch?: number;
89
+ lifecycleState?: FocusDirectiveLifecycleState;
90
+ source?: FocusDirectiveSource;
91
+ evidenceRefs?: string[];
92
+ evidenceStateVersion?: number;
93
+ expiresAfterTurn?: number;
94
+ satisfaction?: FocusDirectiveSatisfaction;
95
+ resolvedTurn?: number;
96
+ resolutionReason?: string;
97
+ supersededBy?: string;
98
+ }
99
+ export interface FocusDirectiveLifecycleEvent {
100
+ directive: FocusSupervisorDirective;
101
+ taskEpoch: number;
102
+ transition: Exclude<FocusDirectiveLifecycleState, "active"> | "created";
103
+ turn: number;
104
+ reason: string;
105
+ }
106
+ export interface FocusDirectiveActivationInput {
107
+ turn: number;
108
+ state?: FocusSupervisorState;
109
+ reason: string;
110
+ requiredNextAction: FocusRequiredNextAction;
111
+ forbiddenActionFamilies?: string[];
112
+ source: FocusDirectiveSource;
113
+ evidenceRefs: string[];
114
+ evidenceStateVersion: number;
115
+ satisfaction?: FocusDirectiveSatisfaction;
116
+ }
117
+ export type FocusSupervisorDecision = {
118
+ kind: "pass";
119
+ state: FocusSupervisorState;
120
+ directive?: FocusSupervisorDirective;
121
+ } | {
122
+ kind: "inject_guidance";
123
+ state: FocusSupervisorState;
124
+ directive: FocusSupervisorDirective;
125
+ message: string;
126
+ } | {
127
+ kind: "block_tool_call";
128
+ state: FocusSupervisorState;
129
+ directive: FocusSupervisorDirective;
130
+ message: string;
131
+ success: boolean;
132
+ };
133
+ export interface FocusSupervisorOptions {
134
+ mode?: FocusSupervisorMode;
135
+ modelTier?: FocusSupervisorModelTier;
136
+ repeatGateMax?: number;
137
+ availableTools?: Iterable<string> | null;
138
+ /**
139
+ * Live set of tools the model can call directly in the request a directive
140
+ * will ride on. A registered but deferred tool is not an action the model
141
+ * can take this turn, so a directive must not require it. Wins over
142
+ * availableTools.
143
+ */
144
+ callableTools?: () => Iterable<string>;
145
+ /**
146
+ * WO-3: optional convergence circuit-breaker. When supplied, a failure family
147
+ * that has not converged across rounds/sessions escalates beyond
148
+ * `forced_replan` to a terminal report or a regenerate directive. When
149
+ * omitted, the supervisor behaves exactly as before.
150
+ */
151
+ convergenceBreaker?: ConvergenceBreaker | null;
152
+ /** Host task identity retained across its continuations, never a session-wide retry budget. */
153
+ convergenceScope?: () => string;
154
+ /**
155
+ * WO-9: the run's working directory, used only to canonicalize absolute↔
156
+ * relative path FORM in shell family keys so command variants collapse. When
157
+ * omitted, path-form normalization is skipped (redirections/pagers still
158
+ * normalize).
159
+ */
160
+ cwd?: string;
161
+ /**
162
+ * SILENCE: when true, the supervisor never emits `block_tool_call`. Every
163
+ * would-be block (loop-control, cached-evidence, deadlock, stale-preflight)
164
+ * downgrades to a non-binding `pass`, so the model is always free to take the
165
+ * action it proposed — including re-reading a file to verify a change landed.
166
+ * Directive/telemetry state is still tracked and advisory `inject_guidance`
167
+ * still fires; only the hard stops and cached-result re-serving are removed.
168
+ * Defaults to false at the class level (unit tests exercise blocking); the
169
+ * orchestrator constructs the live supervisor with silent=true by default
170
+ * (override via OMNIUS_FOCUS_SUPERVISOR_SILENT=0).
171
+ */
172
+ silent?: boolean;
173
+ /** Controller-owned task identity. Changing it supersedes active directives. */
174
+ taskEpoch?: number;
175
+ /** Optional override; defaults are intentionally short and tier-specific. */
176
+ directiveTtlTurns?: number;
177
+ /** Best-effort telemetry hook. It must never alter control flow. */
178
+ onDirectiveLifecycle?: (event: FocusDirectiveLifecycleEvent) => void;
179
+ }
180
+ export interface FocusProposedCallInput {
181
+ turn: number;
182
+ toolName: string;
183
+ args?: Record<string, unknown>;
184
+ completionStatus?: FocusCompletionStatus;
185
+ fingerprint: string;
186
+ isReadLike: boolean;
187
+ shellLikelyMutatesFilesystem?: boolean;
188
+ cachedResult?: string;
189
+ cachedResultFailed?: boolean;
190
+ duplicateHitCount?: number;
191
+ stalePreflightMessage?: string | null;
192
+ usesAuthoritativeTargetEvidence?: boolean;
193
+ context?: FocusContextSnapshot | null;
194
+ taskEpoch?: number;
195
+ evidenceRefs?: string[];
196
+ evidenceStateVersion?: number;
197
+ }
198
+ export interface FocusReadEvidence {
199
+ origin: "executed" | "reused";
200
+ path: string;
201
+ sourceHash: string;
202
+ currentHash: string;
203
+ coverage: {
204
+ startLine: number;
205
+ endLine: number;
206
+ };
207
+ /** Actual source line count from the host; permits a requested range to end at EOF. */
208
+ totalLines?: number;
209
+ complete: boolean;
210
+ /** Observational novelty never grants mutation, verification or goal authority. */
211
+ novelty?: "new_coverage" | "unchanged" | "unknown";
212
+ }
213
+ export interface FocusToolResultInput {
214
+ /** Host-validated source identity and requested byte/line coverage. */
215
+ readEvidence?: FocusReadEvidence;
216
+ /** Explicit control refusal/no-dispatch, separate from observed source data. */
217
+ controlOnly?: boolean;
218
+ sourceVersions?: Readonly<Record<string, string>>;
219
+ turn: number;
220
+ toolName: string;
221
+ args?: Record<string, unknown>;
222
+ fingerprint: string;
223
+ success: boolean;
224
+ output?: string;
225
+ error?: string;
226
+ mutated?: boolean;
227
+ isReadLike?: boolean;
228
+ noop?: boolean;
229
+ alreadyApplied?: boolean;
230
+ runtimeAuthored?: boolean;
231
+ /** Fresh host-observed mutation or provider ACK; advisory lifecycle only, never goal coverage. */
232
+ effectObserved?: boolean;
233
+ usedAuthoritativeTargetEvidence?: boolean;
234
+ evidenceRefs?: string[];
235
+ evidenceStateVersion?: number;
236
+ taskEpoch?: number;
237
+ }
238
+ export interface FocusCompletionBlockInput {
239
+ turn: number;
240
+ reason: string;
241
+ requiredNextAction?: FocusRequiredNextAction;
242
+ }
243
+ export interface FocusSupervisorSnapshot {
244
+ mode: FocusSupervisorMode;
245
+ enabled: boolean;
246
+ state: FocusSupervisorState;
247
+ directive: FocusSupervisorDirective | null;
248
+ lastDecision: string;
249
+ lastReason: string;
250
+ context?: FocusContextSnapshot;
251
+ }
252
+ interface FailureFamily {
253
+ count: number;
254
+ lastTurn: number;
255
+ sample: string;
256
+ errorClass: string;
257
+ }
258
+ export interface FocusSupervisorCheckpoint {
259
+ schema: "omnius.focus-supervisor-checkpoint.v1";
260
+ runId: string;
261
+ sessionId: string;
262
+ taskEpoch: number;
263
+ lastObservedTurn: number;
264
+ directiveCounter: number;
265
+ state: FocusSupervisorState;
266
+ directive: FocusSupervisorDirective | null;
267
+ failureFamilies: Array<[
268
+ string,
269
+ FailureFamily
270
+ ]>;
271
+ convergenceFamilyCounts: Array<[
272
+ string,
273
+ number
274
+ ]>;
275
+ repeatedViolationCounts: Array<[
276
+ string,
277
+ number
278
+ ]>;
279
+ sawMutationSinceFailure: boolean;
280
+ ignoredDirectiveStreak: number;
281
+ lastIgnoredDirectiveTurn: number | null;
282
+ sourceVersions: Record<string, string>;
283
+ convergenceBreaker?: ConvergenceBreakerCheckpoint;
284
+ }
285
+ export declare function isFocusSupervisorCheckpoint(value: unknown, identity: {
286
+ runId: string;
287
+ sessionId: string;
288
+ taskEpoch: number;
289
+ }): value is FocusSupervisorCheckpoint;
290
+ export declare class FocusSupervisor {
291
+ private mode;
292
+ private modelTier;
293
+ private repeatGateMax;
294
+ private state;
295
+ private directive;
296
+ private lastDecision;
297
+ private lastReason;
298
+ private lastContext;
299
+ private failureFamilies;
300
+ private convergenceBreaker;
301
+ private convergenceScope?;
302
+ /** WO-3: set when a mutation lands, consumed by the next observed failure. */
303
+ private sawMutationSinceFailure;
304
+ /** WO-9: run cwd for shell family path-form canonicalization. */
305
+ private familyCwd;
306
+ /** WO-9b: within-session repeat count per coarse action-identity family. */
307
+ private convergenceFamilyCounts;
308
+ private ignoredDirectiveStreak;
309
+ private lastIgnoredDirectiveTurn;
310
+ private repeatedViolationCounts;
311
+ private availableTools;
312
+ private callableTools;
313
+ /** SILENCE: when true, block() downgrades to pass() (never stops a call). */
314
+ private silent;
315
+ private taskEpoch;
316
+ private directiveTtlTurns;
317
+ private lastObservedTurn;
318
+ private onDirectiveLifecycle?;
319
+ private observedSourceVersions;
320
+ constructor(options?: FocusSupervisorOptions);
321
+ checkpoint(identity: {
322
+ runId: string;
323
+ sessionId: string;
324
+ }): FocusSupervisorCheckpoint;
325
+ restoreCheckpoint(value: unknown, identity: {
326
+ runId: string;
327
+ sessionId: string;
328
+ taskEpoch: number;
329
+ }): boolean;
330
+ get enabled(): boolean;
331
+ private convergenceKey;
332
+ get currentDirective(): FocusSupervisorDirective | null;
333
+ /**
334
+ * A task redirect/replacement is a control boundary. Old directives remain
335
+ * auditable through telemetry but cannot survive into the new task epoch.
336
+ */
337
+ setTaskEpoch(taskEpoch: number, turn?: number): void;
338
+ /**
339
+ * Controller integration point for structured detectors. It replaces the
340
+ * current directive only when the supplied evidence is newer or materially
341
+ * changes the recovery requirement; callers must not pass model prose alone.
342
+ */
343
+ activateEvidenceDirective(input: FocusDirectiveActivationInput): FocusSupervisorDirective | null;
344
+ supersedeActiveDirective(reason: string, turn?: number, supersededBy?: string): void;
345
+ cancelActiveDirective(reason: string, turn?: number): void;
346
+ /** A compact, factual record for a controller frame; no directive history. */
347
+ compactDirective(turn?: number): Record<string, unknown> | null;
348
+ /**
349
+ * CE-A1: the runner rehydrated evicted evidence back into the model's
350
+ * window. Any read-oriented directive is now satisfiable (or already
351
+ * satisfied), and prior "ignored directive" counts were artifacts of the
352
+ * model being unable to see the content it was told to use. Reset the
353
+ * escalation state instead of punishing the recovery.
354
+ */
355
+ noteEvidenceRehydration(target: string, evidence?: FocusReadEvidence): void;
356
+ private currentToolSurface;
357
+ private hasTool;
358
+ /** Whether any tool other than control/completion tools can act. */
359
+ private hasSubstantiveTool;
360
+ private resolveRequiredNextAction;
361
+ /**
362
+ * In silent small-model runner mode, cached failed shell output is diagnostic
363
+ * evidence, not a substitute for recovery. Asking a small model to "use cached
364
+ * evidence" repeatedly was itself a loop: it neither changed code nor
365
+ * selected a new diagnostic. Direct/strict supervisor consumers retain the
366
+ * legacy cache directive and its hard-block semantics.
367
+ */
368
+ private shellFailureRequiredNextAction;
369
+ snapshot(turn?: number): FocusSupervisorSnapshot;
370
+ observeContext(snapshot: FocusContextSnapshot): void;
371
+ renderFrame(turn?: number): string | null;
372
+ evaluateProposedCall(input: FocusProposedCallInput): FocusSupervisorDecision;
373
+ observeToolResult(input: FocusToolResultInput): void;
374
+ markCompletionBlocked(input: FocusCompletionBlockInput): void;
375
+ /**
376
+ * TRIAGE (replaces terminal-incomplete). A task is never abandoned. At the
377
+ * inflection where the old design would report incomplete, steer the model to
378
+ * a creative pivot or online research instead: the trajectory that failed is
379
+ * dead, but the TASK is not. The turn cap remains the ultimate backstop, so
380
+ * this cannot loop forever. Kept the method name so all callers are unchanged.
381
+ */
382
+ markTerminalIncomplete(reason: string, turn: number): void;
383
+ private shouldStrictlyIntervene;
384
+ private hasLowSignalContext;
385
+ private setDirective;
386
+ private clearSatisfiedDirective;
387
+ private expireDirectiveIfNeeded;
388
+ private transitionDirective;
389
+ private emitDirectiveLifecycle;
390
+ private pass;
391
+ private inject;
392
+ private block;
393
+ }
394
+ /**
395
+ * SILENCE: resolve whether the live supervisor should suppress hard blocks.
396
+ * Defaults to silenced (true) — the operator directive is that the supervisor
397
+ * must not stop agents or re-serve cached responses. Set
398
+ * OMNIUS_FOCUS_SUPERVISOR_SILENT to 0/false/off to restore blocking.
399
+ */
400
+ export declare function resolveFocusSupervisorSilent(envValue?: string | undefined): boolean;
401
+ export declare function resolveFocusSupervisorMode(configured?: FocusSupervisorMode, envValue?: string | undefined): FocusSupervisorMode;
402
+ /**
403
+ * WO-9: generic action-identity canonicalizer for shell family keys. This is a
404
+ * toolchain-agnostic normalizer — it operates ONLY on shell grammar (whitespace,
405
+ * stream redirections, trailing display pagers, and absolute↔relative path form
406
+ * relative to the run's cwd). It never matches any tool name, project literal,
407
+ * or command semantics. It is deliberately conservative: it strips only
408
+ * meaning-neutral decoration and preserves every flag/argument/subcommand, so it
409
+ * prefers false-split over false-merge (a false merge would prematurely abandon
410
+ * genuinely-different work). Verified across npm/cargo/pytest/make/go/generic
411
+ * shell — no ecosystem is special-cased.
412
+ */
413
+ export declare function normalizeShellForFamily(command: string, cwd?: string): string;
414
+ /**
415
+ * Generic verification-signal extractor: a numeric "how bad" measure of a
416
+ * failing action's output — lower is better. It prefers an explicit compiler/
417
+ * test total ("N errors", "N failed") and otherwise counts error/failure lines,
418
+ * a robust proxy for the error count across toolchains (gcc/clang `error:`, tsc
419
+ * `error TS`, cargo `error[`, pytest `N failed`, go `FAIL`). Tool-agnostic — no
420
+ * project or command literals. Returns undefined when the text carries no usable
421
+ * signal, so the breaker falls back to its mutation-based progress heuristic.
422
+ */
423
+ export declare function failureProgressSignal(text: string | undefined): number | undefined;
424
+ /**
425
+ * Is this failing action a VERIFICATION / build-feedback command? Generic and
426
+ * output-driven (no toolchain literals): a command-execution tool (not an edit)
427
+ * whose output carries a diagnostic artifact set (compiler errors / test
428
+ * failures, detected by the same cross-ecosystem grammar `failureProgressSignal`
429
+ * uses). This is the operator's principle in code — a `pio run` / `npm build` /
430
+ * `cargo test` / `tsc` / `pytest` that emits diagnostics is the verification
431
+ * ORACLE, so the breaker must never abandon it; it escalates to
432
+ * decompose-and-delegate instead. A plain `ls` / `git status` produces no
433
+ * diagnostics and is therefore NOT verification feedback.
434
+ */
435
+ export declare function isVerificationCommand(toolName: string, output: string | undefined): boolean;
436
+ export {};
@@ -0,0 +1,105 @@
1
+ import { type CompletionLedger } from "./completionLedger.js";
2
+ import { type NativeTaskRequirementAmendmentV1 } from "./nativeRequirementAmendment.js";
3
+ import type { TaskNativeExecutionScopeV1 } from "./reviewedInterpretation.js";
4
+ import type { ExpectedOutcomeContractV1 } from "./expectedOutcomeContract.js";
5
+ import type { InterruptionSnapshot } from "./interruption-lifecycle.js";
6
+ import type { SteeringInput } from "./steeringIntake.js";
7
+ interface RecoveryIdentity {
8
+ checkpointSha256: string;
9
+ runId: string;
10
+ sessionId: string;
11
+ taskEpoch: number;
12
+ ownerGeneration: number;
13
+ }
14
+ export interface ForcedUpdateRequirementRecovery extends RecoveryIdentity {
15
+ schema: "omnius.forced-update-requirement-recovery.v1";
16
+ completionLedger: CompletionLedger;
17
+ nativeScope: TaskNativeExecutionScopeV1;
18
+ expectedOutcome: ExpectedOutcomeContractV1;
19
+ steering: SteeringInput[];
20
+ requirementHolds: Array<{
21
+ inputId: string;
22
+ runId: string;
23
+ taskEpoch: number;
24
+ nativeInputSha256: string;
25
+ }>;
26
+ requirementAmendments: NativeTaskRequirementAmendmentV1[];
27
+ }
28
+ export type ForcedUpdateRequirementResolution = ({
29
+ inputId: string;
30
+ nativeInputSha256: string;
31
+ disposition: "amendment";
32
+ authority: NativeTaskRequirementAmendmentV1;
33
+ } | {
34
+ inputId: string;
35
+ nativeInputSha256: string;
36
+ disposition: "unchanged" | "context" | "no_action" | "cancelled";
37
+ review: {
38
+ requestSha256: string;
39
+ resultSha256: string;
40
+ model: string;
41
+ providerProtocol: string;
42
+ };
43
+ } | {
44
+ inputId: string;
45
+ nativeInputSha256: string;
46
+ disposition: "replacement";
47
+ decisionPayload: Record<string, unknown>;
48
+ decisionPayloadSha256: string;
49
+ review: {
50
+ requestSha256: string;
51
+ resultSha256: string;
52
+ model: string;
53
+ providerProtocol: string;
54
+ };
55
+ } | {
56
+ inputId: string;
57
+ nativeInputSha256: string;
58
+ disposition: "response";
59
+ decisionPayload: Record<string, unknown>;
60
+ decisionPayloadSha256: string;
61
+ review: {
62
+ requestSha256: string;
63
+ resultSha256: string;
64
+ model: string;
65
+ providerProtocol: string;
66
+ };
67
+ }) & {
68
+ steering?: SteeringInput;
69
+ };
70
+ export interface ForcedUpdateRequirementRecoveryReceipt extends RecoveryIdentity {
71
+ schema: "omnius.forced-update-requirement-recovery-receipt.v1";
72
+ resolutions: ForcedUpdateRequirementResolution[];
73
+ predecessor?: {
74
+ recovery: ForcedUpdateRequirementRecovery;
75
+ receipt: ForcedUpdateRequirementRecoveryReceipt;
76
+ };
77
+ }
78
+ export interface ForcedUpdateRequirementRecoveryResult {
79
+ completionLedger: CompletionLedger;
80
+ nativeScope: TaskNativeExecutionScopeV1;
81
+ expectedOutcome: ExpectedOutcomeContractV1;
82
+ recoveredSteering: SteeringInput[];
83
+ resolvedInputIds: string[];
84
+ replacementInputs: Array<Extract<ForcedUpdateRequirementResolution, {
85
+ disposition: "replacement";
86
+ }>>;
87
+ responseInputs: Array<Extract<ForcedUpdateRequirementResolution, {
88
+ disposition: "response";
89
+ }>>;
90
+ }
91
+ export type ForcedUpdateRequirementRecoveryHandler = (recovery: ForcedUpdateRequirementRecovery, context: {
92
+ signal: AbortSignal;
93
+ assertCurrent: () => void;
94
+ }) => Promise<ForcedUpdateRequirementRecoveryReceipt>;
95
+ /** A timed-out read has no result to adopt, but cannot hold its former unit
96
+ * forever. This removes only exact historical read-only ticket references;
97
+ * external uncertainty and every acceptance/evidence obligation remain. */
98
+ export declare function reconcileForcedUpdateReadOnlyOperations(ledger: CompletionLedger, interruption: InterruptionSnapshot): CompletionLedger;
99
+ /** Pure replay of an actual host review receipt. No inference, tools, delivery,
100
+ * or fabricated completion evidence is performed by restart recovery. */
101
+ export declare function applyForcedUpdateRequirementRecovery(recovery: ForcedUpdateRequirementRecovery, receipt: ForcedUpdateRequirementRecoveryReceipt): ForcedUpdateRequirementRecoveryResult;
102
+ /** Intermediate projection only; pending inputs still require their own
103
+ * actual review before the complete receipt can be durably admitted. */
104
+ export declare function projectForcedUpdateRequirementRecoveryPrefix(recovery: ForcedUpdateRequirementRecovery, receipt: ForcedUpdateRequirementRecoveryReceipt): ForcedUpdateRequirementRecoveryResult;
105
+ export {};
@@ -0,0 +1,100 @@
1
+ /**
2
+ * hooks.ts — Pre/Post Hook Chains for Tool Execution
3
+ *
4
+ * Configurable hook system that intercepts tool calls at 4 points:
5
+ * - pre_tool_use: Before tool execution (can block or modify)
6
+ * - post_tool_use: After successful execution
7
+ * - post_tool_use_failure: After failed execution
8
+ * - session_start / session_end: Session lifecycle
9
+ *
10
+ * Hooks are shell commands configured in .omnius/settings.json.
11
+ * Hook output is parsed for directives: ALLOW, DENY, MODIFY.
12
+ *
13
+ * Reference: Hannover src/utils/hooks/toolHooks.ts
14
+ * Reference: Hannover src/utils/hooks/hooksSettings.ts
15
+ */
16
+ export type HookType = "pre_tool_use" | "post_tool_use" | "post_tool_use_failure" | "session_start" | "session_end";
17
+ export interface HookDefinition {
18
+ /** Hook type (when it fires) */
19
+ type: HookType;
20
+ /** Shell command to execute */
21
+ command: string;
22
+ /** Timeout in milliseconds (default: 10000) */
23
+ timeoutMs?: number;
24
+ /** Tool name filter (glob pattern, e.g. "file_*" or "*") */
25
+ toolFilter?: string;
26
+ }
27
+ export interface HookResult {
28
+ /** Whether the hook executed successfully */
29
+ success: boolean;
30
+ /** Hook stdout output */
31
+ output: string;
32
+ /** Hook stderr output */
33
+ error?: string;
34
+ /** Parsed directive from output (for pre_tool_use) */
35
+ directive?: HookDirective;
36
+ /** Execution time in ms */
37
+ durationMs: number;
38
+ }
39
+ export type HookDirective = {
40
+ action: "allow";
41
+ } | {
42
+ action: "deny";
43
+ reason: string;
44
+ } | {
45
+ action: "modify";
46
+ args: Record<string, unknown>;
47
+ };
48
+ export interface HooksConfig {
49
+ pre_tool_use?: HookDefinition[];
50
+ post_tool_use?: HookDefinition[];
51
+ post_tool_use_failure?: HookDefinition[];
52
+ session_start?: HookDefinition[];
53
+ session_end?: HookDefinition[];
54
+ }
55
+ /**
56
+ * Execute a single hook command.
57
+ *
58
+ * Environment variables injected:
59
+ * - OMNIUS_HOOK_TYPE: The hook type
60
+ * - OMNIUS_TOOL_NAME: Tool name (for tool hooks)
61
+ * - OMNIUS_TOOL_ARGS: JSON-serialized tool arguments
62
+ * - OMNIUS_TOOL_RESULT: Tool result (for post hooks)
63
+ * - OMNIUS_TOOL_ERROR: Tool error (for failure hooks)
64
+ * - OMNIUS_SESSION_ID: Session identifier
65
+ */
66
+ export declare function executeHook(hook: HookDefinition, env?: Record<string, string>): Promise<HookResult>;
67
+ /**
68
+ * Manages hook execution for the agent session.
69
+ */
70
+ export declare class HookManager {
71
+ private config;
72
+ constructor(config?: HooksConfig);
73
+ /** Update hook configuration */
74
+ setConfig(config: HooksConfig): void;
75
+ /** Get current hook configuration */
76
+ getConfig(): Readonly<HooksConfig>;
77
+ /** Check if any hooks are configured */
78
+ hasHooks(): boolean;
79
+ /**
80
+ * Run pre_tool_use hooks.
81
+ * Returns: { allowed: true } or { allowed: false, reason } or { allowed: true, modifiedArgs }
82
+ */
83
+ runPreToolUse(toolName: string, args: Record<string, unknown>, sessionId?: string): Promise<{
84
+ allowed: boolean;
85
+ reason?: string;
86
+ modifiedArgs?: Record<string, unknown>;
87
+ }>;
88
+ /**
89
+ * Run post_tool_use hooks (after successful execution).
90
+ */
91
+ runPostToolUse(toolName: string, args: Record<string, unknown>, result: string, sessionId?: string): Promise<void>;
92
+ /**
93
+ * Run post_tool_use_failure hooks (after failed execution).
94
+ */
95
+ runPostToolUseFailure(toolName: string, args: Record<string, unknown>, error: string, sessionId?: string): Promise<void>;
96
+ /**
97
+ * Run session lifecycle hooks.
98
+ */
99
+ runSessionHook(type: "session_start" | "session_end", sessionId?: string): Promise<void>;
100
+ }