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,171 @@
1
+ /**
2
+ * app-state.ts — Centralized Application State
3
+ *
4
+ * Consolidates all scattered state fields into a single typed object.
5
+ * Tracks 35 fields across 8 categories, bridging the gap from Omnius's
6
+ * current ~35 scattered fields toward Hannover's 150+ structured state.
7
+ *
8
+ * Naming convention: Omnius uses camelCase (matching existing codebase).
9
+ * Hannover equivalents noted in comments for cross-reference.
10
+ *
11
+ * This is NOT reactive (no subscribe/notify). It's a typed state container
12
+ * that can be upgraded to reactive later if needed (add subscribe() wrapper).
13
+ *
14
+ * Reference: Hannover src/state/AppState.ts
15
+ */
16
+ import type { McpConnection } from "../execution/mcp/types.js";
17
+ /** Tool execution decision record (Hannover: toolDecisions) */
18
+ export interface ToolDecision {
19
+ toolName: string;
20
+ decision: "allow" | "deny" | "ask";
21
+ reason: string;
22
+ timestamp: number;
23
+ /** Source of the decision: hook, rule, user, default */
24
+ source: "hook" | "rule" | "user" | "default";
25
+ }
26
+ /** Cost tracking across the full session (Hannover: costState) */
27
+ export interface SessionCostState {
28
+ /** Total input tokens across all tasks */
29
+ totalInputTokens: number;
30
+ /** Total output tokens across all tasks */
31
+ totalOutputTokens: number;
32
+ /** Estimated total cost in USD */
33
+ totalCostUsd: number;
34
+ /** Cache hit count (prompt cache reuse) */
35
+ cacheHits: number;
36
+ /** Cache miss count */
37
+ cacheMisses: number;
38
+ /** Number of completed tasks */
39
+ taskCount: number;
40
+ }
41
+ /** Nexus P2P connection health (Hannover: remoteConnectionStatus) */
42
+ export type NexusConnectionStatus = "disconnected" | "connecting" | "connected" | "degraded" | "reconnecting";
43
+ /** Plugin state summary */
44
+ export interface PluginState {
45
+ name: string;
46
+ version: string;
47
+ loaded: boolean;
48
+ contributedTools: number;
49
+ contributedSkills: number;
50
+ contributedMcpServers: number;
51
+ }
52
+ /** Hook execution result record */
53
+ export interface HookExecutionRecord {
54
+ hookType: string;
55
+ toolName?: string;
56
+ success: boolean;
57
+ directive?: string;
58
+ durationMs: number;
59
+ timestamp: number;
60
+ }
61
+ /** Speculative tool execution state (Hannover: speculativeToolUse) */
62
+ export interface SpeculativeExecution {
63
+ /** Whether speculation is enabled */
64
+ enabled: boolean;
65
+ /** Tool being speculatively executed (if any) */
66
+ pendingTool?: string;
67
+ /** Whether the speculation was used (cache hit) */
68
+ lastHit: boolean;
69
+ /** Total speculation attempts */
70
+ attempts: number;
71
+ /** Total cache hits */
72
+ hits: number;
73
+ }
74
+ /** Agent task summary for TUI display (Hannover: tasksMap) */
75
+ export interface AgentTaskSummary {
76
+ id: string;
77
+ agentType: string;
78
+ status: string;
79
+ prompt: string;
80
+ startedAt: number;
81
+ toolUseCount: number;
82
+ turnsCompleted: number;
83
+ }
84
+ export interface AppState {
85
+ /** Unique session identifier */
86
+ sessionId: string;
87
+ /** Session start timestamp */
88
+ sessionStartTime: number;
89
+ /** Total turns executed across all tasks in this session */
90
+ totalTurns: number;
91
+ /** Current model name */
92
+ model: string;
93
+ /** Model tier classification */
94
+ modelTier: "small" | "medium" | "large";
95
+ /** Live context window size (tokens) */
96
+ contextWindowSize: number;
97
+ /** Max output tokens for current model */
98
+ maxOutputTokens: number;
99
+ /** Current message history length (for compaction decisions) */
100
+ historyLength: number;
101
+ /** Per-tool usage histogram */
102
+ toolUseCountByName: Map<string, number>;
103
+ /** Duration of last tool execution (ms) */
104
+ lastToolDurationMs: number;
105
+ /** Most recent error message (for TUI display) */
106
+ lastError: string | null;
107
+ /** Files modified since last LLM turn */
108
+ fileChangesSinceLastTurn: Set<string>;
109
+ /** All files modified since session start */
110
+ modifiedFilesSinceStart: Set<string>;
111
+ /** Record of tool allow/deny decisions (Hannover: toolDecisions) */
112
+ toolDecisions: ToolDecision[];
113
+ /** Maximum decision history size */
114
+ toolDecisionMaxHistory: number;
115
+ /** Session-wide cost state (Hannover: costState) */
116
+ costState: SessionCostState;
117
+ /** Active MCP server connections (Hannover: mcpClients) */
118
+ mcpConnections: McpConnection[];
119
+ /** Loaded plugins (Hannover: loadedPlugins) */
120
+ loadedPlugins: PluginState[];
121
+ /** Discovered skill names (Hannover: discoveredSkillNames) */
122
+ discoveredSkillNames: Set<string>;
123
+ /** Nexus connection health (Hannover: remoteConnectionStatus) */
124
+ nexusConnectionStatus: NexusConnectionStatus;
125
+ /** Agent task summaries for TUI display (Hannover: tasks) */
126
+ agentTasks: Map<string, AgentTaskSummary>;
127
+ /** Hook execution history (last 50) */
128
+ hookExecutionHistory: HookExecutionRecord[];
129
+ /** Speculative tool pre-execution state */
130
+ speculativeExecution: SpeculativeExecution;
131
+ /** Verbose mode flag */
132
+ verbose: boolean;
133
+ /** Current activity label (spinner text) */
134
+ spinnerTip: string;
135
+ /** Expanded view mode */
136
+ expandedView: boolean;
137
+ }
138
+ /**
139
+ * Create a fresh AppState with defaults.
140
+ */
141
+ export declare function createAppState(opts?: {
142
+ sessionId?: string;
143
+ model?: string;
144
+ modelTier?: "small" | "medium" | "large";
145
+ contextWindowSize?: number;
146
+ verbose?: boolean;
147
+ }): AppState;
148
+ /**
149
+ * Record a tool decision in the audit trail.
150
+ */
151
+ export declare function recordToolDecision(state: AppState, decision: Omit<ToolDecision, "timestamp">): void;
152
+ /**
153
+ * Record a tool execution in counters.
154
+ */
155
+ export declare function recordToolExecution(state: AppState, toolName: string, durationMs: number, success: boolean, filePath?: string): void;
156
+ /**
157
+ * Clear per-turn state (called at the start of each LLM turn).
158
+ */
159
+ export declare function clearTurnState(state: AppState): void;
160
+ /**
161
+ * Record a hook execution.
162
+ */
163
+ export declare function recordHookExecution(state: AppState, record: Omit<HookExecutionRecord, "timestamp">): void;
164
+ /**
165
+ * Update cost state with token usage from a completed turn.
166
+ */
167
+ export declare function recordTokenUsage(state: AppState, inputTokens: number, outputTokens: number, costUsd: number, cacheHit: boolean): void;
168
+ /**
169
+ * Get a human-readable state summary (for /stats command or debugging).
170
+ */
171
+ export declare function getStateSummary(state: AppState): string;
@@ -0,0 +1,63 @@
1
+ export interface ArtifactClaimEvidenceV1 {
2
+ id: string;
3
+ kind: "semantic_review" | "provider_delivery";
4
+ artifactSha256: string;
5
+ summary: string;
6
+ destination?: string;
7
+ }
8
+ export interface ArtifactClaimCriticCompletionRequestV1 {
9
+ model: string;
10
+ requestId: string;
11
+ systemPrompt: string;
12
+ userPrompt: string;
13
+ responseSchema: Record<string, unknown>;
14
+ }
15
+ export interface ArtifactClassifiedClaimV1 {
16
+ claim: string;
17
+ classification: "semantic" | "transport" | "mixed" | "other";
18
+ support: "supported" | "unsupported" | "uncertain";
19
+ evidenceIds: string[];
20
+ rationale: string;
21
+ }
22
+ export type ArtifactClaimCriticIssueCodeV1 = "claim_critic_unavailable" | "claim_critic_output_invalid" | "claim_reply_binding_mismatch" | "claim_span_not_found" | "claim_evidence_unknown" | "claim_evidence_wrong_kind" | "claim_not_supported" | "claim_critic_verdict_not_pass";
23
+ export interface ArtifactClaimCriticIssueV1 {
24
+ code: ArtifactClaimCriticIssueCodeV1;
25
+ detail: string;
26
+ claim?: string;
27
+ evidenceId?: string;
28
+ }
29
+ /** A missing inference verdict is not a semantic rejection of the candidate. */
30
+ export interface ArtifactReviewTransportFailureV1 {
31
+ schema: "omnius.artifact-review-transport-failure.v1";
32
+ phase: "artifact_semantic" | "artifact_claim";
33
+ retryable: true;
34
+ }
35
+ export interface ArtifactClaimCriticResultV1 {
36
+ schema: "omnius.artifact-claim-critic-result.v1";
37
+ passed: boolean;
38
+ verdict?: "pass" | "revise" | "insufficient_evidence";
39
+ replySha256: string;
40
+ claims: ArtifactClassifiedClaimV1[];
41
+ issues: ArtifactClaimCriticIssueV1[];
42
+ transportFailure?: ArtifactReviewTransportFailureV1;
43
+ reviewer?: {
44
+ kind: "independent_model";
45
+ freshContext: true;
46
+ model: string;
47
+ requestId: string;
48
+ };
49
+ }
50
+ export interface ArtifactClaimCriticInputV1 {
51
+ proposedReply: string;
52
+ evidence: readonly ArtifactClaimEvidenceV1[];
53
+ model: string;
54
+ requestId: string;
55
+ /** Host-selected review scope. Source facts and other work have separate gates. */
56
+ scope?: "artifact_assertions";
57
+ complete: (request: ArtifactClaimCriticCompletionRequestV1) => Promise<string>;
58
+ }
59
+ /**
60
+ * Classify reply claims with an independent model. No phrase list, regex, or
61
+ * deterministic language classifier participates in this decision.
62
+ */
63
+ export declare function runArtifactClaimCriticV1(input: ArtifactClaimCriticInputV1): Promise<ArtifactClaimCriticResultV1>;
@@ -0,0 +1,15 @@
1
+ export type ArtifactMode = "user-task" | "internal";
2
+ export interface ArtifactQualityInput {
3
+ artifactMode?: ArtifactMode;
4
+ goal?: string;
5
+ summary?: string;
6
+ toolsUsed?: string[];
7
+ filesTouched?: string[];
8
+ turns?: number;
9
+ }
10
+ export interface ArtifactQualityDecision {
11
+ eligible: boolean;
12
+ reason?: string;
13
+ }
14
+ export declare function isInternalArtifactPrompt(text: unknown): boolean;
15
+ export declare function assessTaskArtifactQuality(input: ArtifactQualityInput): ArtifactQualityDecision;
@@ -0,0 +1,203 @@
1
+ import type { ArtifactReviewSourceAdoptionReference } from "../memory/artifactReviewSourceIndex.js";
2
+ import type { ArtifactReviewTransportFailureV1 } from "./artifactClaimCritic.js";
3
+ /**
4
+ * Host-owned semantic integrity contracts for generated artifacts.
5
+ *
6
+ * Implements: ASI-REQ-001 through ASI-REQ-017.
7
+ * Model output may propose a coverage verdict, but only the deterministic
8
+ * verifier in this module can mint a passing semantic review receipt.
9
+ */
10
+ export interface ArtifactRequirementSourceV1 {
11
+ sourceId: string;
12
+ text: string;
13
+ /** Unmarked legacy sources remain explicit artifact obligations. */
14
+ role?: "artifact_requirement" | "task_context" | "source_context";
15
+ }
16
+ export interface ArtifactRequirementV1 {
17
+ id: string;
18
+ sourceId: string;
19
+ sourceText: string;
20
+ text: string;
21
+ listKind: "numbered" | "bulleted" | "prose";
22
+ ordinal?: string;
23
+ sha256: string;
24
+ sourceRole?: ArtifactRequirementSourceV1["role"];
25
+ }
26
+ export interface ArtifactRequirementLedgerV1 {
27
+ schema: "omnius.artifact-requirement-ledger.v1";
28
+ ledgerId: string;
29
+ sourceDigest: string;
30
+ createdAt: string;
31
+ sources: readonly ArtifactRequirementSourceV1[];
32
+ requirements: readonly ArtifactRequirementV1[];
33
+ }
34
+ export type ArtifactCoverageStatusV1 = "covered" | "partial" | "missing" | "contradicted" | "not_applicable";
35
+ export interface ArtifactEvidenceAnchorV1 {
36
+ anchor: string;
37
+ excerpt: string;
38
+ }
39
+ export interface ArtifactRequirementCoverageV1 {
40
+ requirementId: string;
41
+ status: ArtifactCoverageStatusV1;
42
+ evidence: ArtifactEvidenceAnchorV1[];
43
+ rationale: string;
44
+ /** A fresh reviewer classifies task context; its exact source is checked. */
45
+ applicability?: {
46
+ kind: "artifact_content" | "task_control" | "source_context";
47
+ sourceId: string;
48
+ sourceExcerpt: string;
49
+ };
50
+ }
51
+ export interface ArtifactSemanticReviewBindingV1 {
52
+ inputId: string;
53
+ decisionId: string | null;
54
+ /** Host-minted compatibility for an authenticated private admin worker. */
55
+ authority?: "authenticated_admin";
56
+ scopeId: string;
57
+ runId: string;
58
+ taskEpoch: number;
59
+ }
60
+ /** Host-verified observations; never drafting history or ambient memory. */
61
+ export interface ArtifactReviewSourceEvidenceV1 {
62
+ schema: "omnius.artifact-review-source-evidence.v1";
63
+ scopeId: string;
64
+ runId: string;
65
+ taskEpoch: number;
66
+ /** A bounded page of one immutable owner population; never a corpus cap. */
67
+ toolOwnerId?: string;
68
+ nextCursor?: string | null;
69
+ snapshot?: {
70
+ sequence: number;
71
+ };
72
+ selectedSourceIds?: string[];
73
+ /** True only when this page contains the entire selected population and
74
+ * every source validates. A resumed final page alone is not whole coverage. */
75
+ complete?: boolean;
76
+ sources: Array<{
77
+ sourceId: string;
78
+ toolCallId: string;
79
+ toolName: string;
80
+ sourcePath: string;
81
+ /** Exact original tool source reference, reopened from immutable provenance. */
82
+ requestedSourceRef?: string;
83
+ /** Absolute immutable-index path, returned only after original-byte and source proof validation. */
84
+ verifiedSourcePath?: string;
85
+ sourceSha256?: string;
86
+ bodySha256: string;
87
+ artifactUri: string;
88
+ text: string;
89
+ documentId?: string;
90
+ chunkIds?: string[];
91
+ documentExtraction?: unknown;
92
+ /** Separate complete-native corpus provenance, never a PDF-reader receipt. */
93
+ sourceDatabase?: {
94
+ path: string;
95
+ scopeId: string;
96
+ };
97
+ nativeCorpusPage?: unknown;
98
+ /** Current exact retained-source span; its original acquisition remains
99
+ * separate and is not relabeled as a whole-page model read. */
100
+ nativeCorpusRead?: unknown;
101
+ /** Private original issuer, not current delivery or tool execution authority. */
102
+ issuingToolOwnerId?: string;
103
+ /** Explicit same-task recipient reference; the source stays issuer-owned. */
104
+ adoption?: ArtifactReviewSourceAdoptionReference;
105
+ }>;
106
+ }
107
+ export interface ArtifactSemanticReviewContextV1 {
108
+ binding: ArtifactSemanticReviewBindingV1;
109
+ sourceEvidence: ArtifactReviewSourceEvidenceV1;
110
+ }
111
+ export interface ArtifactUnsupportedAdditionV1 {
112
+ anchor: string;
113
+ excerpt: string;
114
+ rationale: string;
115
+ }
116
+ export interface ArtifactSemanticReviewerV1 {
117
+ kind: "independent_model";
118
+ freshContext: boolean;
119
+ model: string;
120
+ requestId: string;
121
+ }
122
+ export interface ArtifactSemanticReviewCandidateV1 {
123
+ schema: "omnius.artifact-semantic-review-candidate.v1";
124
+ ledgerId: string;
125
+ requirementSourceDigest: string;
126
+ artifactSha256: string;
127
+ artifactEvidenceDigest: string;
128
+ verdict: "pass" | "revise" | "insufficient_evidence";
129
+ coverage: ArtifactRequirementCoverageV1[];
130
+ unsupportedAdditions: ArtifactUnsupportedAdditionV1[];
131
+ reviewer: ArtifactSemanticReviewerV1;
132
+ reviewBinding?: ArtifactSemanticReviewBindingV1;
133
+ sourceEvidenceDigest?: string;
134
+ }
135
+ export type ArtifactSemanticVerificationCodeV1 = "candidate_invalid" | "candidate_schema_invalid" | "ledger_binding_mismatch" | "source_digest_mismatch" | "artifact_hash_invalid" | "artifact_evidence_digest_mismatch" | "reviewer_not_independent" | "coverage_invalid" | "coverage_unknown_requirement" | "coverage_duplicate_requirement" | "coverage_missing_requirement" | "coverage_not_complete" | "coverage_evidence_missing" | "coverage_evidence_not_found" | "unsupported_addition_present" | "review_verdict_not_pass" | "receipt_schema_invalid" | "receipt_digest_invalid" | "critic_output_invalid" | "critic_unavailable" | "review_unchanged_artifact" | "review_attempts_exhausted";
136
+ export interface ArtifactSemanticVerificationIssueV1 {
137
+ code: ArtifactSemanticVerificationCodeV1;
138
+ detail: string;
139
+ requirementId?: string;
140
+ anchor?: string;
141
+ }
142
+ export interface ArtifactSemanticReviewReceiptV1 extends Omit<ArtifactSemanticReviewCandidateV1, "schema"> {
143
+ schema: "omnius.artifact-semantic-review-receipt.v1";
144
+ verifiedAt: string;
145
+ verificationDigest: string;
146
+ }
147
+ export interface ArtifactSemanticVerificationResultV1 {
148
+ schema: "omnius.artifact-semantic-verification-result.v1";
149
+ passed: boolean;
150
+ issues: ArtifactSemanticVerificationIssueV1[];
151
+ receipt?: ArtifactSemanticReviewReceiptV1;
152
+ transportFailure?: ArtifactReviewTransportFailureV1;
153
+ }
154
+ export interface ArtifactSemanticCriticCompletionRequestV1 {
155
+ model: string;
156
+ requestId: string;
157
+ systemPrompt: string;
158
+ userPrompt: string;
159
+ responseSchema: Record<string, unknown>;
160
+ }
161
+ export interface ArtifactSemanticCriticInputV1 {
162
+ ledger: ArtifactRequirementLedgerV1;
163
+ artifactSha256: string;
164
+ artifactEvidenceText: string;
165
+ model: string;
166
+ requestId: string;
167
+ reviewContext?: ArtifactSemanticReviewContextV1;
168
+ complete: (request: ArtifactSemanticCriticCompletionRequestV1) => Promise<string>;
169
+ }
170
+ /** Build and deeply freeze the admitted task's authoritative requirement set. */
171
+ export declare function buildArtifactRequirementLedgerV1(rawSources: readonly ArtifactRequirementSourceV1[], createdAt?: string): ArtifactRequirementLedgerV1;
172
+ /**
173
+ * Verify a proposed semantic review without trusting its prose or verdict.
174
+ * A receipt exists only when every deterministic invariant is satisfied.
175
+ */
176
+ export declare function verifyArtifactSemanticReviewV1(input: {
177
+ ledger: ArtifactRequirementLedgerV1;
178
+ artifactSha256: string;
179
+ artifactEvidenceText: string;
180
+ candidate: unknown;
181
+ verifiedAt?: string;
182
+ reviewContext?: ArtifactSemanticReviewContextV1;
183
+ }): ArtifactSemanticVerificationResultV1;
184
+ /**
185
+ * Revalidate a persisted semantic receipt against its authoritative ledger.
186
+ * The receipt digest is recomputed rather than trusted, so callers cannot
187
+ * promote a hand-written `passed: true` summary into semantic authority.
188
+ */
189
+ export declare function verifyArtifactSemanticReviewReceiptV1(input: {
190
+ ledger: ArtifactRequirementLedgerV1;
191
+ artifactSha256: string;
192
+ artifactEvidenceText: string;
193
+ receipt: unknown;
194
+ reviewContext?: ArtifactSemanticReviewContextV1;
195
+ }): ArtifactSemanticVerificationResultV1;
196
+ /**
197
+ * Run an independent semantic critic through an injected transport. The
198
+ * transport receives no drafting history or earlier conclusions. Binding and
199
+ * reviewer identity are host-owned and cannot be supplied by the model.
200
+ */
201
+ export declare function runArtifactSemanticCriticV1(input: ArtifactSemanticCriticInputV1): Promise<ArtifactSemanticVerificationResultV1>;
202
+ /** Stable JSON schema fragment for fresh-context critic prompts. */
203
+ export declare function artifactSemanticReviewCandidateSchemaV1(): Record<string, unknown>;