omnius 1.0.922 → 1.0.924

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 (241) 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 +5216 -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 +26 -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 +137700 -81150
  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 +462 -0
  237. package/docs/DISCOVERY.md +6 -0
  238. package/docs/work-orders/evidence/telegram-catch-up-attention-live-20261104.json +743 -0
  239. package/docs/work-orders/telegram-catch-up-attention-repair-20261104.md +133 -0
  240. package/npm-shrinkwrap.json +28 -12
  241. package/package.json +3 -2
@@ -0,0 +1,169 @@
1
+ /**
2
+ * mcp/types.ts — MCP Protocol Types (JSON-RPC 2.0)
3
+ *
4
+ * Implements the Model Context Protocol specification (MCP 2025-06-18)
5
+ * without requiring the @modelcontextprotocol/sdk dependency.
6
+ *
7
+ * Protocol reference: https://modelcontextprotocol.io/specification/2025-06-18/
8
+ * Hannover reference: src/services/mcp/types.ts
9
+ */
10
+ export interface JsonRpcRequest {
11
+ jsonrpc: "2.0";
12
+ id: number | string;
13
+ method: string;
14
+ params?: Record<string, unknown>;
15
+ }
16
+ export interface JsonRpcResponse {
17
+ jsonrpc: "2.0";
18
+ id: number | string | null;
19
+ result?: unknown;
20
+ error?: JsonRpcError;
21
+ }
22
+ export interface JsonRpcError {
23
+ code: number;
24
+ message: string;
25
+ data?: unknown;
26
+ }
27
+ export interface JsonRpcNotification {
28
+ jsonrpc: "2.0";
29
+ method: string;
30
+ params?: Record<string, unknown>;
31
+ }
32
+ export interface McpStdioConfig {
33
+ type?: "stdio";
34
+ command: string;
35
+ args?: string[];
36
+ env?: Record<string, string>;
37
+ }
38
+ export interface McpHttpConfig {
39
+ type: "http" | "sse";
40
+ url: string;
41
+ headers?: Record<string, string>;
42
+ }
43
+ export type McpServerConfig = McpStdioConfig | McpHttpConfig;
44
+ export interface McpConfig {
45
+ mcpServers: Record<string, McpServerConfig>;
46
+ }
47
+ export interface McpToolDefinition {
48
+ name: string;
49
+ /** Human-readable display name (spec 2025-06-18) */
50
+ title?: string;
51
+ description?: string;
52
+ inputSchema: {
53
+ type: "object";
54
+ properties?: Record<string, unknown>;
55
+ required?: string[];
56
+ [key: string]: unknown;
57
+ };
58
+ /** Optional output schema for structuredContent validation */
59
+ outputSchema?: {
60
+ type: "object";
61
+ properties?: Record<string, unknown>;
62
+ required?: string[];
63
+ [key: string]: unknown;
64
+ };
65
+ annotations?: {
66
+ title?: string;
67
+ readOnlyHint?: boolean;
68
+ destructiveHint?: boolean;
69
+ openWorldHint?: boolean;
70
+ };
71
+ _meta?: Record<string, unknown>;
72
+ }
73
+ export interface McpResource {
74
+ uri: string;
75
+ name?: string;
76
+ description?: string;
77
+ mimeType?: string;
78
+ }
79
+ export interface McpPrompt {
80
+ name: string;
81
+ description?: string;
82
+ arguments?: Array<{
83
+ name: string;
84
+ description?: string;
85
+ required?: boolean;
86
+ }>;
87
+ }
88
+ export interface McpAnnotations {
89
+ audience?: ("user" | "assistant")[];
90
+ priority?: number;
91
+ lastModified?: string;
92
+ }
93
+ export interface McpTextContent {
94
+ type: "text";
95
+ text: string;
96
+ annotations?: McpAnnotations;
97
+ }
98
+ export interface McpImageContent {
99
+ type: "image";
100
+ data: string;
101
+ mimeType: string;
102
+ annotations?: McpAnnotations;
103
+ }
104
+ export interface McpAudioContent {
105
+ type: "audio";
106
+ data: string;
107
+ mimeType: string;
108
+ annotations?: McpAnnotations;
109
+ }
110
+ export interface McpResourceLinkContent {
111
+ type: "resource_link";
112
+ uri: string;
113
+ name?: string;
114
+ description?: string;
115
+ mimeType?: string;
116
+ annotations?: McpAnnotations;
117
+ }
118
+ export interface McpEmbeddedResource {
119
+ type: "resource";
120
+ resource: {
121
+ uri: string;
122
+ mimeType?: string;
123
+ text?: string;
124
+ blob?: string;
125
+ annotations?: McpAnnotations;
126
+ };
127
+ }
128
+ export type McpContent = McpTextContent | McpImageContent | McpAudioContent | McpResourceLinkContent | McpEmbeddedResource;
129
+ export interface McpToolCallResult {
130
+ content: McpContent[];
131
+ /** Spec 2025-06-18: structured JSON output (for tools with outputSchema) */
132
+ structuredContent?: unknown;
133
+ isError?: boolean;
134
+ _meta?: Record<string, unknown>;
135
+ }
136
+ export interface McpServerCapabilities {
137
+ tools?: {
138
+ listChanged?: boolean;
139
+ };
140
+ resources?: {
141
+ subscribe?: boolean;
142
+ listChanged?: boolean;
143
+ };
144
+ prompts?: {
145
+ listChanged?: boolean;
146
+ };
147
+ }
148
+ export interface McpServerInfo {
149
+ name: string;
150
+ version: string;
151
+ }
152
+ export interface McpInitializeResult {
153
+ protocolVersion: string;
154
+ capabilities: McpServerCapabilities;
155
+ serverInfo: McpServerInfo;
156
+ instructions?: string;
157
+ }
158
+ export type McpConnectionStatus = "connected" | "failed" | "pending" | "disconnected";
159
+ export interface McpConnection {
160
+ name: string;
161
+ status: McpConnectionStatus;
162
+ config: McpServerConfig;
163
+ capabilities?: McpServerCapabilities;
164
+ serverInfo?: McpServerInfo;
165
+ instructions?: string;
166
+ tools: McpToolDefinition[];
167
+ resources: McpResource[];
168
+ error?: string;
169
+ }
@@ -0,0 +1,102 @@
1
+ export type MutationAgentRole = "explorer" | "mutation_worker" | "coordinator" | "proposal";
2
+ export type MutationLeaseState = "active" | "proposal_only" | "pending_merge" | "merged" | "released";
3
+ export interface MutationWorkerContract {
4
+ role: MutationAgentRole;
5
+ ownerAgentId: string;
6
+ taskId?: string;
7
+ ownedFiles: string[];
8
+ ownedDirs: string[];
9
+ forbiddenFiles: string[];
10
+ forbiddenDirs: string[];
11
+ expectedArtifacts: string[];
12
+ verifierCommand?: string;
13
+ expectedOutputArtifact?: string;
14
+ mergeStrategy?: string;
15
+ stopCondition?: string;
16
+ artifactKeys: string[];
17
+ leaseState: MutationLeaseState;
18
+ baseHash?: string;
19
+ expiresAt?: string;
20
+ worktreePath?: string;
21
+ proposalMode: boolean;
22
+ }
23
+ export interface MutationContractValidation {
24
+ valid: boolean;
25
+ errors: string[];
26
+ }
27
+ export interface MutationScopeCheck {
28
+ allowed: boolean;
29
+ reason?: string;
30
+ offendingPath?: string;
31
+ reasonClass?: "mutation_scope_conflict" | "proposal_mode_required";
32
+ }
33
+ export interface ShellMutationPathExtraction {
34
+ mutates: boolean;
35
+ paths: string[];
36
+ unknownMutation: boolean;
37
+ reason?: string;
38
+ }
39
+ /**
40
+ * A shell command can syntactically contain a write while leaving no durable
41
+ * project delta (for example `cat > test/probe.mjs; node test/probe.mjs; rm
42
+ * test/probe.mjs`). Safety checks need the attempted write; controller state
43
+ * needs the observed post-command truth. Keep those facts separate.
44
+ */
45
+ export interface ShellMutationObservation {
46
+ attempted: boolean;
47
+ attemptedPaths: string[];
48
+ effectivePaths: string[];
49
+ transientPaths: string[];
50
+ unknownPaths: string[];
51
+ basis: "path_fingerprint" | "unavailable";
52
+ }
53
+ /**
54
+ * Reduce a static shell-write extraction and pre/post path fingerprints into
55
+ * durable mutation truth. `missing` is an explicit state, not an absent
56
+ * sample, so a create-and-remove probe is distinguishable from an unreadable
57
+ * path. Callers may use content hashes for files and stat signatures for
58
+ * directories.
59
+ */
60
+ export declare function observeShellMutation(extraction: ShellMutationPathExtraction, before: ReadonlyMap<string, string | undefined>, after: ReadonlyMap<string, string | undefined>): ShellMutationObservation;
61
+ export interface DelegationMutationScopeDerivation {
62
+ args: Record<string, unknown>;
63
+ changed: boolean;
64
+ mutationLikely: boolean;
65
+ proposalOnly: boolean;
66
+ ownedFiles: string[];
67
+ ownedDirs: string[];
68
+ reason?: string;
69
+ }
70
+ export declare function normalizeMutationPath(root: string, pathValue: string): string;
71
+ export declare function parseMutationWorkerContract(args: Record<string, unknown>, options?: {
72
+ workingDir?: string;
73
+ ownerAgentId?: string;
74
+ subagentType?: string;
75
+ defaultProposalMode?: boolean;
76
+ }): MutationWorkerContract;
77
+ export declare function validateMutationWorkerContract(contract: MutationWorkerContract): MutationContractValidation;
78
+ export declare function mutationScopesOverlap(left: Pick<MutationWorkerContract, "ownedFiles" | "ownedDirs">, right: Pick<MutationWorkerContract, "ownedFiles" | "ownedDirs">): boolean;
79
+ export declare function coordinatorOwnedArtifactReason(pathValue: string): string | null;
80
+ export declare function checkMutationScope(contract: MutationWorkerContract | null | undefined, paths: string[], options?: {
81
+ workingDir?: string;
82
+ proposalMode?: boolean;
83
+ }): MutationScopeCheck;
84
+ export declare function checkShellMutationScope(contract: MutationWorkerContract | null | undefined, command: string, options?: {
85
+ workingDir?: string;
86
+ proposalMode?: boolean;
87
+ }): MutationScopeCheck & {
88
+ extraction: ShellMutationPathExtraction;
89
+ };
90
+ export declare function mutationContractToEnv(contract: MutationWorkerContract): Record<string, string>;
91
+ export declare function mutationContractFromEnv(env?: NodeJS.ProcessEnv, workingDir?: string): MutationWorkerContract | null;
92
+ export declare function deriveDelegationMutationScope(args: Record<string, unknown>, options?: {
93
+ workingDir?: string;
94
+ defaultVerifierCommand?: string | null;
95
+ enabled?: boolean;
96
+ }): DelegationMutationScopeDerivation;
97
+ export declare function renderMutationContractForPrompt(contract: MutationWorkerContract): string;
98
+ export declare function detectWorkspaceDestructiveCommand(command: string, workspaceRoot?: string): string | null;
99
+ export declare function extractShellMutationPaths(command: string, options?: {
100
+ workingDir?: string;
101
+ }): ShellMutationPathExtraction;
102
+ export declare function isShellCommandLikelyMutatingFilesystem(command: string): boolean;
@@ -0,0 +1,39 @@
1
+ import { type NolArtifactRef } from "../../schemas/nol.js";
2
+ export declare const nolJsonDigest: (value: unknown) => string;
3
+ /** Canonical tagged-record identity. A model's friendly ID is excluded; every
4
+ * other identity-bearing field remains. Its tensor map has a separate digest. */
5
+ export declare function nolRecordDigest(value: unknown): string;
6
+ export declare function assertNolRecordDigest(value: unknown): void;
7
+ /** Explicit construction helper; parsing/verification never rewrites identity. */
8
+ export declare function sealNolRecord<T extends {
9
+ schema: string;
10
+ }>(value: T): T;
11
+ /** Complete-file digest; no sampled prefix, implicit model loading or inference. */
12
+ export declare function nolFileDigest(path: string, signal?: AbortSignal): Promise<{
13
+ sha256: string;
14
+ sizeBytes: number;
15
+ }>;
16
+ /** Private, atomically published content-addressed artifacts. Every read rehashes.
17
+ * Aggregate experiment storage admission belongs to the coordinator/store. */
18
+ export declare class NolArtifactStore {
19
+ readonly root: string;
20
+ readonly maxArtifactBytes: number;
21
+ constructor(options: {
22
+ root: string;
23
+ maxArtifactBytes: number;
24
+ });
25
+ private pathFor;
26
+ private directory;
27
+ private publish;
28
+ putBytes(bytes: Uint8Array, mediaType?: string, signal?: AbortSignal): Promise<NolArtifactRef>;
29
+ putJson(value: unknown, signal?: AbortSignal): Promise<NolArtifactRef>;
30
+ importFile(path: string, mediaType?: string, options?: {
31
+ expectedSha256?: string;
32
+ maxBytes?: number;
33
+ signal?: AbortSignal;
34
+ }): Promise<NolArtifactRef>;
35
+ private readVerified;
36
+ verify(ref: NolArtifactRef, signal?: AbortSignal): Promise<void>;
37
+ readBytes(ref: NolArtifactRef, signal?: AbortSignal): Promise<Buffer>;
38
+ readJson(ref: NolArtifactRef, signal?: AbortSignal): Promise<unknown>;
39
+ }
@@ -0,0 +1,98 @@
1
+ import { type NolArtifactRef, type NolModelManifest, type NolRecipeRevision } from "../../schemas/nol.js";
2
+ export interface NolCheckpointEditLimits {
3
+ maxInputBytes: number;
4
+ /** Aggregate unique operand artifact bytes. */
5
+ maxArtifactBytes: number;
6
+ /** Entire exported directory, including its provenance receipt. */
7
+ maxOutputBytes: number;
8
+ /** Conservative cumulative tensor-payload/explicit workspace reservation.
9
+ * Python/Torch runtime objects, allocator/BLAS overhead and baseline process
10
+ * RSS are outside this limit; it is not a process address-space guarantee. */
11
+ maxWorkingBytes: number;
12
+ maxArithmeticUnits: number;
13
+ maxOperations: number;
14
+ maxDurationMs: number;
15
+ maxProtocolBytes: number;
16
+ }
17
+ export interface NolCheckpointEditReceipt {
18
+ schema: "omnius.nol.checkpoint-edit.v1";
19
+ exportId: string;
20
+ parentModelDigest: string;
21
+ recipeDigest: string;
22
+ sourceModelDigests: string[];
23
+ editorSha256: string;
24
+ runtime: {
25
+ python: string;
26
+ torch: string;
27
+ safetensors: string;
28
+ };
29
+ numericalPolicy: string;
30
+ inferencePerformed: false;
31
+ cudaUsed: false;
32
+ files: Array<{
33
+ path: string;
34
+ before: {
35
+ sha256: string;
36
+ sizeBytes: number;
37
+ };
38
+ after: {
39
+ sha256: string;
40
+ sizeBytes: number;
41
+ };
42
+ changed: boolean;
43
+ representation: "copied_exact_file" | "safetensors_preserved_untouched_tensor_bytes" | "pytorch_reencoded_verified_tensor_bytes";
44
+ }>;
45
+ operations: Array<{
46
+ operationId: string;
47
+ operation: string;
48
+ siteId: string;
49
+ name: string;
50
+ beforeTensorSha256: string;
51
+ afterTensorSha256: string;
52
+ changedElements: number;
53
+ /** Difference between this worker's float64 result and its stored dtype
54
+ * round trip; excludes operand decoding and native BLAS summation error.
55
+ * This is not a bound against exact real arithmetic or inference behavior. */
56
+ maxAbsRoundingError: number;
57
+ }>;
58
+ usage: {
59
+ inputBytes: number;
60
+ artifactBytes: number;
61
+ outputBytes: number;
62
+ reservedWorkingBytes: number;
63
+ arithmeticUnits: number;
64
+ durationMs: number;
65
+ };
66
+ }
67
+ export interface NolCheckpointEditInput {
68
+ pythonPath: string;
69
+ editorPath?: string;
70
+ expectedEditorSha256: string;
71
+ model: NolModelManifest;
72
+ recipe: NolRecipeRevision;
73
+ checkpointRoot: string;
74
+ sourceCheckpoints?: ReadonlyArray<{
75
+ model: NolModelManifest;
76
+ root: string;
77
+ }>;
78
+ artifactRoot: string;
79
+ outputDirectory: string;
80
+ limits: NolCheckpointEditLimits;
81
+ orthogonalityTolerance: number;
82
+ signal?: AbortSignal;
83
+ }
84
+ /** Explicit, CPU-only persistent parameter edit. Importing this module does no
85
+ * I/O and never imports Torch, allocates CUDA or instantiates a model. The final
86
+ * publish uses Linux renameat2(RENAME_NOREPLACE), with no overwrite fallback.
87
+ * Cancellation is observed until the atomic commit; a verified committed export
88
+ * is returned successfully if cancellation arrives after that commit point.
89
+ * Returned artifact references identify verified LOCAL export files; callers
90
+ * must import those files into their quota-managed CAS before runtime use or
91
+ * registration. This function does not register, promote or deploy a model. */
92
+ export declare function editNolCheckpoint(input: NolCheckpointEditInput): Promise<{
93
+ outputDirectory: string;
94
+ model: NolModelManifest;
95
+ receipt: NolCheckpointEditReceipt;
96
+ receiptArtifact: NolArtifactRef;
97
+ receiptPath: string;
98
+ }>;
@@ -0,0 +1,128 @@
1
+ import { type NolArtifactRef, type NolRuntimeBinding } from "../../schemas/nol.js";
2
+ import { type NolArtifactStore } from "./artifacts.js";
3
+ declare const SCHEMA: "omnius.nol.conditional-distribution.v1";
4
+ declare const RESULT: "omnius.nol.conditional-distribution-comparison.v1";
5
+ export declare const NOL_RAW_DISTRIBUTION_PROCESSING_DIGEST: string;
6
+ /** The native producer must establish these facts. Parsing/hashing this record
7
+ * establishes immutable metadata and artifact identity, never native authority. */
8
+ export interface NolConditionalDistribution {
9
+ schema: typeof SCHEMA;
10
+ observationDigest: string;
11
+ coverage: "full_vocabulary";
12
+ values: "logits" | "log_probabilities" | "probabilities";
13
+ stage: "raw_model" | "processed_sampling";
14
+ processingDigest: string;
15
+ vocabularySize: number;
16
+ conditioning: {
17
+ mode: "teacher_forced";
18
+ attentionMask: "causal_unpadded";
19
+ tokenizerDigest: string;
20
+ vocabularyDigest: string;
21
+ chatTemplateDigest: string;
22
+ inputIds: NolArtifactRef;
23
+ positionIds: NolArtifactRef;
24
+ tokenEncoding: "u32_le";
25
+ inputTokenCount: number;
26
+ promptTokenCount: number;
27
+ /** Row r predicts the next token after exactly this many input IDs.
28
+ * Its native computation position is prefixTokenCounts[r] - 1. */
29
+ prefixTokenCounts: number[];
30
+ };
31
+ source: {
32
+ binding: NolRuntimeBinding;
33
+ variantDigest: string;
34
+ recipeDigest: string | null;
35
+ computeDtype: "float16" | "bfloat16" | "float32" | "float64";
36
+ };
37
+ tensor: {
38
+ artifact: NolArtifactRef;
39
+ shape: [
40
+ number,
41
+ number
42
+ ];
43
+ dtype: "f32" | "f64";
44
+ encoding: "ieee754_le";
45
+ };
46
+ receipts: {
47
+ source: NolArtifactRef;
48
+ native: NolArtifactRef;
49
+ hardware: NolArtifactRef;
50
+ };
51
+ }
52
+ export interface NolDistributionLimits {
53
+ maxRows: number;
54
+ maxVocabularySize: number;
55
+ maxReadBytes: number;
56
+ maxWorkingBytes: number;
57
+ /** Scalar visits, including each normalization and metric pass. */
58
+ maxWorkUnits: number;
59
+ maxDurationMs: number;
60
+ /** Allowed absolute row mass/log-mass error before explicit renormalization. */
61
+ normalizationTolerance: number;
62
+ maxAbsLogValue: number;
63
+ }
64
+ export type NolDistributionMeasure = {
65
+ status: "finite";
66
+ value: number;
67
+ } | {
68
+ status: "positive_infinity";
69
+ reason: "candidate_zero_on_baseline_support";
70
+ };
71
+ export interface NolConditionalDistributionComparison {
72
+ schema: typeof RESULT;
73
+ comparisonDigest: string;
74
+ scope: "same_runtime_intervention";
75
+ direction: "baseline_to_candidate";
76
+ units: "nats";
77
+ normalization: "validated_then_float64_row_renormalization";
78
+ numericPolicy: {
79
+ arithmetic: "ieee754_float64";
80
+ probabilityUnderflow: "finite_log_support_preserved_small_mass_terms_rounded";
81
+ negativeRoundoffClamp: 1e-10;
82
+ };
83
+ acceptanceAuthority: "none";
84
+ nativeObservationAuthorityVerified: false;
85
+ baseline: NolConditionalDistribution;
86
+ candidate: NolConditionalDistribution;
87
+ conditioningDigest: string;
88
+ limits: NolDistributionLimits;
89
+ rows: Array<{
90
+ prefixTokenCount: number;
91
+ computationPosition: number;
92
+ positionId: number;
93
+ baselineEntropy: NolDistributionMeasure;
94
+ candidateEntropy: NolDistributionMeasure;
95
+ crossEntropy: NolDistributionMeasure;
96
+ kl: NolDistributionMeasure;
97
+ baselineSupportSize: number;
98
+ candidateSupportSize: number;
99
+ }>;
100
+ mean: {
101
+ baselineEntropy: NolDistributionMeasure;
102
+ candidateEntropy: NolDistributionMeasure;
103
+ crossEntropy: NolDistributionMeasure;
104
+ kl: NolDistributionMeasure;
105
+ };
106
+ accounting: {
107
+ verifiedArtifactBytes: number;
108
+ peakWorkingBytesBound: number;
109
+ scalarVisits: number;
110
+ rowsCompared: number;
111
+ completeVocabularyElementsPerRow: number;
112
+ };
113
+ }
114
+ export declare function sealNolConditionalDistribution(value: Omit<NolConditionalDistribution, "observationDigest">): NolConditionalDistribution;
115
+ export declare function parseNolConditionalDistribution(value: unknown): NolConditionalDistribution;
116
+ /** Compares complete conditional distributions on identical forced prefixes.
117
+ * Uses public rehashing CAS reads. All artifact bytes and worst-case collected
118
+ * buffers/row workspaces are admitted before I/O. Rows are evaluated in bounded
119
+ * incremental passes with cooperative cancellation; no tensor publication,
120
+ * native observation receipt or scientific acceptance authority is created. */
121
+ export declare function compareNolConditionalDistributions(input: {
122
+ baseline: NolConditionalDistribution;
123
+ candidate: NolConditionalDistribution;
124
+ artifacts: Pick<NolArtifactStore, "readBytes" | "verify">;
125
+ limits: NolDistributionLimits;
126
+ signal?: AbortSignal;
127
+ }): Promise<NolConditionalDistributionComparison>;
128
+ export {};