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,133 @@
1
+ export interface ArtifactReviewSourceIndexDatabase {
2
+ exec(sql: string): void;
3
+ prepare(sql: string): {
4
+ get(...args: unknown[]): unknown;
5
+ all(...args: unknown[]): unknown[];
6
+ run(...args: unknown[]): {
7
+ changes: number;
8
+ lastInsertRowid: number | bigint;
9
+ };
10
+ };
11
+ }
12
+ export interface ArtifactReviewSourceIndexOwner {
13
+ scopeId: string;
14
+ runId: string;
15
+ taskEpoch: number;
16
+ }
17
+ export interface ArtifactReviewSourceIndexSnapshot {
18
+ sequence: number;
19
+ }
20
+ export interface ArtifactReviewSourceIssuerReference {
21
+ owner: ArtifactReviewSourceIndexOwner;
22
+ sourceId: string;
23
+ sequence: number;
24
+ payloadSha256: string;
25
+ }
26
+ export interface ArtifactReviewSourceContinuationAdoptionReference {
27
+ schema: "omnius.artifact-review-source-adoption.v1";
28
+ issuer: ArtifactReviewSourceIssuerReference;
29
+ authoritySha256: string;
30
+ }
31
+ export interface ArtifactReviewSourceDelegationReference {
32
+ schema: "omnius.artifact-review-source-delegation.v1";
33
+ issuer: ArtifactReviewSourceIssuerReference;
34
+ authoritySha256: string;
35
+ delegationId: string;
36
+ claimId: string;
37
+ }
38
+ export type ArtifactReviewSourceAdoptionReference = ArtifactReviewSourceContinuationAdoptionReference | ArtifactReviewSourceDelegationReference;
39
+ export interface ArtifactReviewSourceIndexObservation extends ArtifactReviewSourceIndexOwner {
40
+ schema: "omnius.durable-tool-source-observation.v1" | "omnius.durable-corpus-page-source.v1" | "omnius.durable-corpus-native-read-source.v1";
41
+ toolCallId: string;
42
+ /** Original host call when one invocation issues multiple page handles. */
43
+ originToolCallId?: string;
44
+ toolName: string;
45
+ documentId: string;
46
+ chunkIds: string[];
47
+ bodyHash: string;
48
+ bodyBytes: number;
49
+ documentExtraction?: unknown;
50
+ }
51
+ export interface ArtifactReviewSourceIndexInput<T extends ArtifactReviewSourceIndexObservation = ArtifactReviewSourceIndexObservation> {
52
+ owner: ArtifactReviewSourceIndexOwner;
53
+ sourceId: string;
54
+ observation: T;
55
+ artifactUri: string;
56
+ verifiedSourcePath: string;
57
+ /** Recipient-owned reference; the original observation remains issuer-owned. */
58
+ adoption?: ArtifactReviewSourceAdoptionReference;
59
+ }
60
+ export interface ArtifactReviewSourceIndexEntry<T extends ArtifactReviewSourceIndexObservation = ArtifactReviewSourceIndexObservation> extends ArtifactReviewSourceIndexInput<T> {
61
+ sequence: number;
62
+ }
63
+ export interface ArtifactReviewSourceIndexPageRequest {
64
+ owner: ArtifactReviewSourceIndexOwner;
65
+ cursor?: string;
66
+ pageSize?: number;
67
+ snapshot?: ArtifactReviewSourceIndexSnapshot;
68
+ sourceIds?: string[];
69
+ toolCallIds?: string[];
70
+ }
71
+ export interface ArtifactReviewSourceIndexPage<T extends ArtifactReviewSourceIndexObservation = ArtifactReviewSourceIndexObservation> {
72
+ items: ArtifactReviewSourceIndexEntry<T>[];
73
+ nextCursor: string | null;
74
+ snapshot: ArtifactReviewSourceIndexSnapshot;
75
+ }
76
+ /** Private, host-issued source handles. This index is provenance lookup only:
77
+ * a reader must revalidate raw evidence, chunks, archive and original bytes.
78
+ * No summary, model call, or merely logged tool result can register a source. */
79
+ export declare class ArtifactReviewSourceIndex<T extends ArtifactReviewSourceIndexObservation = ArtifactReviewSourceIndexObservation> {
80
+ private readonly db;
81
+ constructor(db: ArtifactReviewSourceIndexDatabase);
82
+ /** Serialize a synchronous host claim transition with existing SQLite
83
+ * writers. The callback must never await or perform model/tool execution. */
84
+ withWriteTransaction<R>(operation: () => R): R;
85
+ /** Barrier metadata only: records an exact successful host model handoff.
86
+ * This does not mint native/visual grounding, semantic or delivery authority. */
87
+ recordObservedChannel(input: {
88
+ owner: ArtifactReviewSourceIndexOwner;
89
+ channel: "ocr_text";
90
+ callId: string;
91
+ corpusId: string;
92
+ inputId: string;
93
+ charStart: number;
94
+ charEnd: number;
95
+ textSha256: string;
96
+ requestSha256: string;
97
+ }): void;
98
+ observedChannels(owner: ArtifactReviewSourceIndexOwner): Array<"ocr_text">;
99
+ /** Called only after the production native source guard has verified its
100
+ * durable raw stores. Replays are exact and conflicting rebindings fail. */
101
+ append(input: ArtifactReviewSourceIndexInput<T>): ArtifactReviewSourceIndexEntry<T>;
102
+ /** Reopen an exact original row; summaries and newly asserted observations
103
+ * cannot create this reference. References always point to the first issuer. */
104
+ originalReference(entry: ArtifactReviewSourceIndexEntry<T>): ArtifactReviewSourceIssuerReference;
105
+ /** Called only after a host has admitted the exact same-task continuation
106
+ * and revalidated current source bytes. This is a reference, not a new read. */
107
+ adopt(input: {
108
+ owner: ArtifactReviewSourceIndexOwner;
109
+ issuer: ArtifactReviewSourceIssuerReference;
110
+ authoritySha256: string;
111
+ }): ArtifactReviewSourceIndexEntry<T>;
112
+ /** A fresh child has a separate session/storage identity. This row remains
113
+ * provenance only; the parent must validate its canonical delegation receipt
114
+ * and reopen native stores before making the source available to reviewers. */
115
+ adoptDelegated(input: {
116
+ owner: ArtifactReviewSourceIndexOwner;
117
+ issuer: ArtifactReviewSourceIssuerReference;
118
+ authoritySha256: string;
119
+ delegationId: string;
120
+ claimId: string;
121
+ }): ArtifactReviewSourceIndexEntry<T>;
122
+ reopenIssuer(reference: ArtifactReviewSourceIssuerReference): ArtifactReviewSourceIndexEntry<T>;
123
+ private insert;
124
+ /** Filters are applied in SQL before keyset pagination. The snapshot fixes
125
+ * the selected owner population while later native sources are appended. */
126
+ list(input: ArtifactReviewSourceIndexPageRequest): ArtifactReviewSourceIndexPage<T>;
127
+ private ids;
128
+ private owner;
129
+ private snapshot;
130
+ private validateInput;
131
+ private issuer;
132
+ private entry;
133
+ }
@@ -0,0 +1,213 @@
1
+ type SqliteDatabase = {
2
+ exec(sql: string): void;
3
+ prepare(sql: string): {
4
+ all(...params: unknown[]): unknown[];
5
+ get(...params: unknown[]): unknown;
6
+ run(...params: unknown[]): {
7
+ changes: number;
8
+ lastInsertRowid: number | bigint;
9
+ };
10
+ };
11
+ };
12
+ export type ContextMemoryRecordKind = "authority" | "steering" | "task" | "claim" | "artifact" | "artifact_extract" | "action" | "tool_call" | "tool_result" | "mutation" | "verifier" | "outcome" | "semantic_fact" | "procedural_rule" | "orientation" | "materialization";
13
+ export type ContextMemoryAuthority = "system" | "user" | "agent" | "tool_data" | "derived";
14
+ export type ContextMemoryTrustClass = "trusted_instruction" | "untrusted_data" | "derived_data";
15
+ export type ContextMemoryDependencyRelation = "requires" | "supports" | "refutes" | "plans" | "invokes" | "produces" | "mutates" | "verifies" | "supersedes" | "derived_from";
16
+ export interface ContextMemoryProvenance {
17
+ producer: string;
18
+ sourceIds?: string[];
19
+ sourceUri?: string;
20
+ sourceRevision?: string;
21
+ /** One-based inclusive source range when the evidence came from a file chunk. */
22
+ sourceRange?: {
23
+ start: number;
24
+ end: number;
25
+ };
26
+ fidelity?: "exact" | "derived_extract" | "partial" | "summary";
27
+ }
28
+ export interface ContextMemoryRecord {
29
+ id: string;
30
+ epoch: string;
31
+ kind: ContextMemoryRecordKind;
32
+ authority: ContextMemoryAuthority;
33
+ trustClass: ContextMemoryTrustClass;
34
+ body: string;
35
+ contentHash: string;
36
+ provenance: ContextMemoryProvenance;
37
+ metadata: Record<string, unknown>;
38
+ observedAt: string;
39
+ validFrom: string;
40
+ validUntil?: string;
41
+ supersedesId?: string;
42
+ }
43
+ export interface ContextMemoryTransaction {
44
+ id: string;
45
+ epoch: string;
46
+ taskId?: string;
47
+ status: "open" | "completed" | "blocked" | "abandoned";
48
+ recordIds: string[];
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ }
52
+ export interface ContextMemoryDependency {
53
+ sourceRecordId: string;
54
+ targetRecordId: string;
55
+ relation: ContextMemoryDependencyRelation;
56
+ requiredForActiveWork: boolean;
57
+ createdAt: string;
58
+ }
59
+ export interface AppendContextMemoryRecordInput {
60
+ id?: string;
61
+ epoch: string;
62
+ kind: ContextMemoryRecordKind;
63
+ authority: ContextMemoryAuthority;
64
+ trustClass?: ContextMemoryTrustClass;
65
+ body: string;
66
+ provenance: ContextMemoryProvenance;
67
+ metadata?: Record<string, unknown>;
68
+ observedAt?: string;
69
+ validFrom?: string;
70
+ }
71
+ export interface MaterializeWorkingSetInput {
72
+ epoch: string;
73
+ activeRecordIds: string[];
74
+ maxRecords?: number;
75
+ }
76
+ export interface MaterializedWorkingSet {
77
+ records: ContextMemoryRecord[];
78
+ transactionIds: string[];
79
+ fingerprint: string;
80
+ }
81
+ /**
82
+ * An append-only declaration of what the runner considers live right now.
83
+ *
84
+ * The declaration is intentionally separate from the records themselves: a
85
+ * task may change its active action without rewriting its original authority
86
+ * or evidence. This makes a materialized request explainable after the fact.
87
+ */
88
+ export interface ContextMemoryWorkingSet {
89
+ id: string;
90
+ epoch: string;
91
+ activeRecordIds: string[];
92
+ reason: string;
93
+ createdAt: string;
94
+ }
95
+ export interface GraphCutValidation {
96
+ valid: boolean;
97
+ blockedRecordIds: string[];
98
+ reasons: string[];
99
+ }
100
+ export interface ContextMemoryRetrievalQuery {
101
+ /** Task epoch is mandatory: retrieval can never cross an agent task epoch. */
102
+ epoch: string;
103
+ query: string;
104
+ /** Typed roots prevent callers from accidentally using an unrelated record. */
105
+ taskId?: string;
106
+ activeActionId?: string;
107
+ activeRecordIds?: string[];
108
+ claimIds?: string[];
109
+ sourceUris?: string[];
110
+ sourceRevisions?: string[];
111
+ sourceRanges?: Array<{
112
+ sourceUri: string;
113
+ start: number;
114
+ end: number;
115
+ }>;
116
+ allowedAuthorities?: ContextMemoryAuthority[];
117
+ maxRecords?: number;
118
+ /** Materialized bodies may be returned once per source under this bound. */
119
+ maxBodyChars?: number;
120
+ /** Optional additional body budget; estimated conservatively at four characters/token. */
121
+ maxBodyTokens?: number;
122
+ /**
123
+ * Temporal view of the ledger. The default is now; an explicit historical
124
+ * point may retrieve a revision that was current at that time.
125
+ */
126
+ asOf?: string;
127
+ /** Graph expansion is bounded even for malformed or unexpectedly dense graphs. */
128
+ maxGraphHops?: number;
129
+ /** Optional embedding/reranker score supplied by the host retrieval layer. */
130
+ semanticScore?: (record: ContextMemoryRecord) => number;
131
+ }
132
+ export interface ContextMemoryRetrievalMatch {
133
+ record: ContextMemoryRecord;
134
+ score: number;
135
+ exact: number;
136
+ lexical: number;
137
+ graph: number;
138
+ semantic: number;
139
+ /** Number of dependency edges from a typed active root, when applicable. */
140
+ graphHops?: number;
141
+ /** A refuting edge was traversed from active work; do not silently treat it as support. */
142
+ contradictsActiveWork: boolean;
143
+ }
144
+ export interface ContextMemoryRetrievalResult {
145
+ matches: ContextMemoryRetrievalMatch[];
146
+ abstained: boolean;
147
+ reason?: string;
148
+ /** The bounded graph walk reached its node limit; callers must not infer exhaustive coverage. */
149
+ graphTruncated?: boolean;
150
+ }
151
+ /** SQLite facade over immutable context-memory events. */
152
+ export declare class ContextMemoryLedger {
153
+ private readonly db;
154
+ constructor(db: SqliteDatabase);
155
+ private ensureSchema;
156
+ appendRecord(input: AppendContextMemoryRecordInput): ContextMemoryRecord;
157
+ getRecord(id: string): ContextMemoryRecord | null;
158
+ listRecords(epoch: string, opts?: {
159
+ includeSuperseded?: boolean;
160
+ }): ContextMemoryRecord[];
161
+ beginTransaction(input: {
162
+ id?: string;
163
+ epoch: string;
164
+ taskId?: string;
165
+ }): ContextMemoryTransaction;
166
+ attachTransactionRecord(transactionId: string, recordId: string): void;
167
+ setTransactionStatus(transactionId: string, status: ContextMemoryTransaction["status"]): void;
168
+ getTransaction(id: string): ContextMemoryTransaction | null;
169
+ linkDependency(input: Omit<ContextMemoryDependency, "createdAt"> & {
170
+ createdAt?: string;
171
+ }): void;
172
+ supersedeArtifact(oldRecordId: string, nextRecordId: string): void;
173
+ /**
174
+ * Persist a new active-root declaration. Roots must exist in the same epoch
175
+ * and the input is normalized deterministically so a state signature is
176
+ * meaningful across replays.
177
+ */
178
+ commitWorkingSet(input: {
179
+ id?: string;
180
+ epoch: string;
181
+ activeRecordIds: string[];
182
+ reason: string;
183
+ createdAt?: string;
184
+ }): ContextMemoryWorkingSet;
185
+ latestWorkingSet(epoch: string): ContextMemoryWorkingSet | null;
186
+ materializeWorkingSet(input: MaterializeWorkingSetInput): MaterializedWorkingSet;
187
+ /**
188
+ * Select only records that were temporally valid at `asOf`. Normal retrieval
189
+ * therefore cannot resurrect superseded evidence, while a replay can request
190
+ * the revision that was current at a historical instant.
191
+ */
192
+ private listRecordsAt;
193
+ /**
194
+ * Retrieval can walk both directions: dependencies are recorded from an
195
+ * action to its prerequisites, whereas a task query begins at the other end.
196
+ * The walk is restricted to active-work edges and hard-bounded for dense or
197
+ * malformed graphs.
198
+ */
199
+ private expandRetrievalGraph;
200
+ private validateRetrievalRoots;
201
+ /**
202
+ * Temporal hybrid retrieval over canonical ledger records. Exact source URI
203
+ * and dependency closure are primary; lexical and optional external semantic
204
+ * scores complement them. Superseded records are excluded by default.
205
+ */
206
+ retrieve(query: ContextMemoryRetrievalQuery): ContextMemoryRetrievalResult;
207
+ validateGraphCut(input: {
208
+ epoch: string;
209
+ retireRecordIds: string[];
210
+ activeRecordIds: string[];
211
+ }): GraphCutValidation;
212
+ }
213
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Initialise a SQLite database at the given path.
3
+ * Pass ":memory:" for an ephemeral in-memory database (useful for tests).
4
+ *
5
+ * On first call the function runs all migrations so every table is
6
+ * guaranteed to exist when the returned handle is used.
7
+ */
8
+ export declare function initDb(dbPath: string): any;
9
+ /** Provenance reopen: never creates a database, migrates it, or changes WAL. */
10
+ export declare function openReadOnlyDb(dbPath: string): any;
11
+ /** Close the database connection gracefully. */
12
+ export declare function closeDb(db: any): void;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * embeddings.ts — Embedding generation via Ollama /api/embed endpoint.
3
+ *
4
+ * Generates vector embeddings for procedural memories using a local Ollama
5
+ * instance. Compatible with any Ollama embedding model (nomic-embed-text,
6
+ * all-minilm, mxbai-embed-large, etc.).
7
+ *
8
+ * Falls back gracefully when Ollama is unavailable — memories are stored
9
+ * without embeddings and text search is used instead.
10
+ *
11
+ * Provenance:
12
+ * - Fortemi-react: uses transformers.js all-MiniLM-L6-v2 (768-dim) in-browser
13
+ * - We use Ollama /api/embed for server-side generation (any model/dimension)
14
+ * - Shared embedding space possible when both use the same model
15
+ */
16
+ export interface EmbeddingResult {
17
+ vector: Float32Array;
18
+ model: string;
19
+ dimensions: number;
20
+ }
21
+ export interface EmbeddingConfig {
22
+ /** Ollama base URL (default: http://localhost:11434) */
23
+ baseUrl?: string;
24
+ /** Explicit model; otherwise OMNIUS_EMBEDDING_MODEL, EMBED_MODEL, or nomic-embed-text. */
25
+ model?: string;
26
+ /** Request timeout in ms (default: 30000) */
27
+ timeoutMs?: number;
28
+ /** External cancellation, for example process-wide foreground preemption. */
29
+ signal?: AbortSignal;
30
+ }
31
+ /** Generate a vector, or null when embedding is unavailable. Never pulls models. */
32
+ export declare function generateEmbedding(text: string, config?: EmbeddingConfig): Promise<EmbeddingResult | null>;
33
+ /** Generate a batch with exact input cardinality, retaining null failure slots. */
34
+ export declare function generateEmbeddingBatch(texts: string[], config?: EmbeddingConfig): Promise<Array<EmbeddingResult | null>>;
35
+ /** Read-only exact-model inventory check. Does not load or generate from a model. */
36
+ export declare function checkEmbeddingAvailable(config?: EmbeddingConfig): Promise<boolean>;
@@ -0,0 +1,165 @@
1
+ type SqliteStatement = {
2
+ all(...params: unknown[]): unknown[];
3
+ get(...params: unknown[]): unknown;
4
+ run(...params: unknown[]): {
5
+ changes: number;
6
+ lastInsertRowid: number | bigint;
7
+ };
8
+ };
9
+ type SqliteDatabase = {
10
+ exec(sql: string): void;
11
+ prepare(sql: string): SqliteStatement;
12
+ };
13
+ export type EvidenceChunkKind = "code" | "markdown" | "conversation" | "json" | "log" | "text";
14
+ export type EvidenceParentKind = "document" | "section" | "file" | "module" | "class" | "function" | "block" | "turn" | "topic" | "json_node" | "event" | "stack";
15
+ export interface ImmutableEvidenceDocumentInput {
16
+ id?: string;
17
+ source: string;
18
+ sourceUri?: string;
19
+ messageId?: string;
20
+ timestamp?: string;
21
+ version: string;
22
+ originalText: string;
23
+ metadata?: Record<string, unknown>;
24
+ }
25
+ export interface ImmutableEvidenceChunkDraft {
26
+ id?: string;
27
+ kind: EvidenceChunkKind;
28
+ tokenStart: number;
29
+ tokenEnd: number;
30
+ charStart: number;
31
+ charEnd: number;
32
+ byteStart: number;
33
+ byteEnd: number;
34
+ parentId?: string;
35
+ parentKind?: EvidenceParentKind;
36
+ originalText: string;
37
+ metadata?: Record<string, unknown>;
38
+ symbols?: Array<{
39
+ value: string;
40
+ kind?: string;
41
+ }>;
42
+ entities?: Array<{
43
+ id?: string;
44
+ canonicalName: string;
45
+ aliases?: string[];
46
+ kind?: string;
47
+ }>;
48
+ }
49
+ export interface ImmutableEvidenceDocument {
50
+ id: string;
51
+ source: string;
52
+ sourceUri?: string;
53
+ messageId?: string;
54
+ timestamp: string;
55
+ version: string;
56
+ contentHash: string;
57
+ originalText: string;
58
+ metadata: Record<string, unknown>;
59
+ createdAt: string;
60
+ }
61
+ export interface ImmutableEvidenceChunk {
62
+ id: string;
63
+ documentId: string;
64
+ ordinal: number;
65
+ kind: EvidenceChunkKind;
66
+ tokenStart: number;
67
+ tokenEnd: number;
68
+ charStart: number;
69
+ charEnd: number;
70
+ byteStart: number;
71
+ byteEnd: number;
72
+ parentId?: string;
73
+ parentKind?: EvidenceParentKind;
74
+ previousChunkId?: string;
75
+ nextChunkId?: string;
76
+ contentHash: string;
77
+ originalText: string;
78
+ metadata: Record<string, unknown>;
79
+ createdAt: string;
80
+ }
81
+ export interface EvidenceSearchFilters {
82
+ documentIds?: string[];
83
+ source?: string;
84
+ sourceUri?: string;
85
+ messageId?: string;
86
+ version?: string;
87
+ after?: string;
88
+ before?: string;
89
+ kinds?: EvidenceChunkKind[];
90
+ /** Exact caller-defined isolation scopes, e.g. one Telegram chat/session. */
91
+ scopeIds?: string[];
92
+ }
93
+ export interface EvidenceSearchMatch {
94
+ chunk: ImmutableEvidenceChunk;
95
+ score: number;
96
+ channel: "bm25" | "exact" | "symbol" | "entity" | "recency" | "dense" | "graph" | "memory";
97
+ matchedValue?: string;
98
+ }
99
+ export interface EvidenceEntityInput {
100
+ id?: string;
101
+ canonicalName: string;
102
+ aliases?: string[];
103
+ kind?: string;
104
+ metadata?: Record<string, unknown>;
105
+ }
106
+ export interface EvidenceRelationshipInput {
107
+ id?: string;
108
+ fromEntityId: string;
109
+ toEntityId: string;
110
+ relation: string;
111
+ sourceChunkId: string;
112
+ validFrom?: string;
113
+ validUntil?: string;
114
+ metadata?: Record<string, unknown>;
115
+ }
116
+ export interface EvidenceEmbeddingInput {
117
+ chunkId: string;
118
+ model: string;
119
+ vector: number[];
120
+ }
121
+ /**
122
+ * Append-only, lossless source storage for virtualized context.
123
+ *
124
+ * Generated memories may be replaced or superseded elsewhere. Source text in
125
+ * this store may not: an idempotent replay is accepted only when its exact
126
+ * content and identity agree with the existing row.
127
+ */
128
+ export declare class ImmutableEvidenceStore {
129
+ private readonly db;
130
+ constructor(db: SqliteDatabase);
131
+ private ensureSchema;
132
+ appendDocument(input: ImmutableEvidenceDocumentInput, drafts: ImmutableEvidenceChunkDraft[]): {
133
+ document: ImmutableEvidenceDocument;
134
+ chunks: ImmutableEvidenceChunk[];
135
+ };
136
+ private validateDraft;
137
+ getDocument(id: string): ImmutableEvidenceDocument | null;
138
+ getChunk(id: string): ImmutableEvidenceChunk | null;
139
+ expand(chunkId: string): ImmutableEvidenceChunk;
140
+ listDocumentChunks(documentId: string): ImmutableEvidenceChunk[];
141
+ neighbors(chunkId: string, radius?: number): ImmutableEvidenceChunk[];
142
+ appendEntity(input: EvidenceEntityInput): {
143
+ id: string;
144
+ canonicalName: string;
145
+ aliases: string[];
146
+ kind: string;
147
+ };
148
+ appendRelationship(input: EvidenceRelationshipInput): string;
149
+ setEmbedding(input: EvidenceEmbeddingInput): void;
150
+ searchBm25(query: string, limit?: number, filters?: EvidenceSearchFilters): EvidenceSearchMatch[];
151
+ searchExact(value: string, limit?: number, filters?: EvidenceSearchFilters): EvidenceSearchMatch[];
152
+ searchSymbol(symbol: string, limit?: number, filters?: EvidenceSearchFilters): EvidenceSearchMatch[];
153
+ searchEntity(nameOrAlias: string, limit?: number, filters?: EvidenceSearchFilters): EvidenceSearchMatch[];
154
+ searchRecency(limit?: number, filters?: EvidenceSearchFilters): EvidenceSearchMatch[];
155
+ searchDense(model: string, queryVector: number[], limit?: number, filters?: EvidenceSearchFilters): EvidenceSearchMatch[];
156
+ expandEntityGraph(seedEntityIds: string[], hops?: number, limit?: number): EvidenceSearchMatch[];
157
+ corpusStats(filters?: EvidenceSearchFilters): {
158
+ documents: number;
159
+ chunks: number;
160
+ tokens: number;
161
+ characters: number;
162
+ };
163
+ private filterRows;
164
+ }
165
+ export {};
@@ -0,0 +1,65 @@
1
+ import type { EmbeddingConfig } from "./embeddings.js";
2
+ import type { MemoryChunkRecord, MemoryItemInput, MemoryItemRecord, MemoryJobRecord, MemoryScopeInput, MemoryVector, StoreChunkEmbeddingOptions } from "./memoryTypes.js";
3
+ import { UnifiedMemoryStore, type MemoryJobClaimScope } from "./unifiedMemoryStore.js";
4
+ export interface MemoryIngestInput extends MemoryItemInput {
5
+ scope?: MemoryScopeInput;
6
+ embedNow?: boolean;
7
+ maintainGraphNow?: boolean;
8
+ }
9
+ export interface MemoryIngestResult {
10
+ item: MemoryItemRecord;
11
+ chunks: MemoryChunkRecord[];
12
+ queuedJobs: number;
13
+ embeddingsStored: number;
14
+ graphNodes: number;
15
+ graphEdges: number;
16
+ }
17
+ export interface MemoryWorkerOptions {
18
+ embedding?: EmbeddingConfig;
19
+ batchSize?: number;
20
+ maxAttempts?: number;
21
+ /** Trusted host policy; a failing classifier makes the job terminal. */
22
+ shouldRetryJob?: (job: MemoryJobRecord, error: unknown) => boolean;
23
+ jobTypes?: string[];
24
+ claimScope?: MemoryJobClaimScope;
25
+ executeEmbeddingJob?: (context: MemoryEmbeddingJobContext) => Promise<void>;
26
+ }
27
+ export interface MemoryEmbeddingJobContext {
28
+ job: MemoryJobRecord;
29
+ item: MemoryItemRecord;
30
+ chunk: MemoryChunkRecord;
31
+ signal: AbortSignal;
32
+ assertCurrent: () => void;
33
+ commitEmbedding: (vector: MemoryVector, options: StoreChunkEmbeddingOptions) => boolean;
34
+ }
35
+ export interface MemoryWorkerRunResult {
36
+ claimed: number;
37
+ completed: number;
38
+ failed: number;
39
+ embeddedChunks: number;
40
+ graphItems: number;
41
+ }
42
+ export declare class MemoryIngestionService {
43
+ private readonly store;
44
+ private readonly options;
45
+ private activeRun;
46
+ constructor(store: UnifiedMemoryStore, options?: MemoryWorkerOptions);
47
+ ingest(input: MemoryIngestInput): Promise<MemoryIngestResult>;
48
+ runOnce(signal?: AbortSignal): Promise<MemoryWorkerRunResult>;
49
+ private runOwned;
50
+ refreshEmbeddings(limit?: number, embeddingSetSlug?: string): Promise<{
51
+ queued: number;
52
+ }>;
53
+ private embedChunks;
54
+ private handleJobFailure;
55
+ }
56
+ export declare function startMemoryWorker(service: {
57
+ runOnce(signal?: AbortSignal): Promise<unknown>;
58
+ }, options?: {
59
+ intervalMs?: number;
60
+ unref?: boolean;
61
+ signal?: AbortSignal;
62
+ }): {
63
+ runOnce: () => Promise<unknown>;
64
+ stop: () => Promise<void>;
65
+ };