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,292 @@
1
+ import { type NolArtifactRef, type NolComparisonReport, type NolDatasetSplitManifest, type NolExperimentManifest, type NolModelManifest, type NolRecipeRevision, type NolRuntimeBinding, type NolValidationReceipt, type NolVariantManifest } from "../../schemas/nol.js";
2
+ import { type NolModelValidationPlan, type NolModelValidationReceipt, type NolModelEvaluationBundle } from "../../schemas/nol-assets.js";
3
+ export interface NolVariantRegistrationBundle {
4
+ schema: "omnius.nol.variant-registration.v1";
5
+ artifactKind: "recipe" | "adapter" | "checkpoint";
6
+ variant: NolArtifactRef;
7
+ model: NolArtifactRef;
8
+ /** Complete ancestor/source model closure, preserving each distinct view. */
9
+ parents: NolArtifactRef[];
10
+ recipe?: NolArtifactRef;
11
+ implementation: NolArtifactRef;
12
+ calibrations: NolArtifactRef[];
13
+ exportReceipt?: NolArtifactRef;
14
+ }
15
+ export interface NolRegisteredVariant {
16
+ id: string;
17
+ variantDigest: string;
18
+ status: "experimental";
19
+ bundle: NolVariantRegistrationBundle;
20
+ createdAtMs: number;
21
+ }
22
+ export interface NolVariantEvaluationBundle {
23
+ schema: "omnius.nol.variant-evaluation.v1";
24
+ /** Explicit scientific subject. Exports MUST use their actual asset/model,
25
+ * never inherit an evaluation of the source activation/weight recipe. */
26
+ evaluationSubjectDigest: string;
27
+ experiment: NolArtifactRef;
28
+ dataset: NolArtifactRef;
29
+ comparison: NolArtifactRef;
30
+ validation: NolArtifactRef;
31
+ capabilities: NolArtifactRef;
32
+ /** Additional complete trial/control/native proofs required by host policy. */
33
+ evidence: NolArtifactRef[];
34
+ }
35
+ export interface NolVerifiedVariantEvaluation {
36
+ registration: NolRegisteredVariant;
37
+ variant: NolVariantManifest;
38
+ model: NolModelManifest;
39
+ recipe: NolRecipeRevision | null;
40
+ bundle: NolVariantEvaluationBundle;
41
+ experiment: NolExperimentManifest;
42
+ dataset: NolDatasetSplitManifest;
43
+ comparison: NolComparisonReport;
44
+ validation: NolValidationReceipt;
45
+ }
46
+ export interface NolVerifiedModelEvaluation {
47
+ registration: NolRegisteredVariant;
48
+ variant: NolVariantManifest;
49
+ model: NolModelManifest;
50
+ bundle: NolModelEvaluationBundle;
51
+ plan: NolModelValidationPlan;
52
+ dataset: NolDatasetSplitManifest;
53
+ comparison: NolComparisonReport;
54
+ validation: NolModelValidationReceipt;
55
+ }
56
+ export interface NolVariantLiveProof {
57
+ /** Host must verify actual completed/current-generation job, accepted native
58
+ * trials, controls, final test and cleanup, then recheck at each fence. Rows
59
+ * inserted through generic persistence APIs are not issuance authority. */
60
+ assertCurrent(): void;
61
+ }
62
+ export interface NolVariantValidationTicket {
63
+ readonly __nolValidationTicket?: never;
64
+ }
65
+ export interface NolVariantActionTicket {
66
+ readonly __nolActionTicket?: never;
67
+ }
68
+ export type NolVariantTargetKind = "research" | "sandbox";
69
+ export type NolVariantBindingAction = "select" | "rollback" | "clear" | "revoke" | "reconcile";
70
+ export interface NolVariantActionScope {
71
+ projectId: string;
72
+ targetId: string;
73
+ targetKind: NolVariantTargetKind;
74
+ action: NolVariantBindingAction;
75
+ operationId: string;
76
+ expectedVersion: number;
77
+ variantDigest: string | null;
78
+ validationDigest: string | null;
79
+ /** Hash of the full intended runtime binding; null only for guarded clear. */
80
+ bindingDigest: string | null;
81
+ }
82
+ export interface NolVariantSelection {
83
+ variantDigest: string;
84
+ registrationId: string;
85
+ validationDigest: string;
86
+ evaluationBundle: NolVariantEvaluationBundle | NolModelEvaluationBundle;
87
+ binding: NolRuntimeBinding;
88
+ }
89
+ export interface NolVariantBindingTarget {
90
+ projectId: string;
91
+ targetId: string;
92
+ kind: NolVariantTargetKind;
93
+ runtime: Pick<NolRuntimeBinding, "backend" | "runtimeBuildDigest" | "dependencyLockDigest">;
94
+ }
95
+ export interface NolVariantBindingState {
96
+ target: NolVariantBindingTarget;
97
+ version: number;
98
+ state: "ready" | "pending" | "unknown";
99
+ /** Historical last confirmed selection. In pending/unknown state this is NOT
100
+ * proof of the host's currently applied binding. */
101
+ lastConfirmedSelection: NolVariantSelection | null;
102
+ pendingOperationId: string | null;
103
+ }
104
+ export interface NolVariantBindingIntent {
105
+ schema: "omnius.nol.research-binding-intent.v1";
106
+ scope: NolVariantActionScope;
107
+ authorizationId: string;
108
+ authorization: {
109
+ id: string;
110
+ actorId: string;
111
+ issuedAtMs: number;
112
+ expiresAtMs: number;
113
+ };
114
+ previous: NolVariantSelection | null;
115
+ next: NolVariantSelection | null;
116
+ hostEffect: "registry_database_only" | "sandbox_host_binding";
117
+ }
118
+ export interface NolVariantBindingOperation {
119
+ intentDigest: string;
120
+ intent: NolVariantBindingIntent;
121
+ nonce: string;
122
+ reservedVersion: number;
123
+ status: "pending" | "applied" | "not_applied" | "unknown" | "revoked";
124
+ bridgeStarted: boolean;
125
+ proof: NolArtifactRef | null;
126
+ createdAtMs: number;
127
+ updatedAtMs: number;
128
+ }
129
+ export interface NolVariantBindingHistory {
130
+ version: number;
131
+ kind: "created" | "reserved" | "bridge_started" | "applied" | "not_applied" | "unknown" | "revoked" | "reconciled";
132
+ operationId: string | null;
133
+ payload: unknown;
134
+ recordedAtMs: number;
135
+ }
136
+ export interface NolVariantReconciliation {
137
+ schema: "omnius.nol.sandbox-reconciliation.v1";
138
+ id: string;
139
+ operationId: string;
140
+ intentDigest: string;
141
+ nonce: string;
142
+ previousVersion: number;
143
+ resultingVersion: number;
144
+ outcome: "applied" | "not_applied";
145
+ proof: NolArtifactRef;
146
+ previousSelection: NolVariantSelection | null;
147
+ nextSelection: NolVariantSelection | null;
148
+ authorization: NolVariantBindingIntent["authorization"];
149
+ }
150
+ /** Persistence is a data/fencing boundary, never validation authority. Every
151
+ * method that changes selection must run guard synchronously IN its atomic SQL
152
+ * transaction. No hashing, user callback awaits or model work inside SQL. */
153
+ export interface NolVariantSelectionStore {
154
+ register(input: Omit<NolRegisteredVariant, "createdAtMs">): NolRegisteredVariant;
155
+ getRegistration(variantDigest: string): NolRegisteredVariant | null;
156
+ createTarget(target: NolVariantBindingTarget): NolVariantBindingState;
157
+ getTarget(projectId: string, targetId: string): NolVariantBindingState | null;
158
+ getOperation(projectId: string, targetId: string, operationId: string): NolVariantBindingOperation | null;
159
+ previousSelection(projectId: string, targetId: string): NolVariantSelection | null | undefined;
160
+ reserve(intent: NolVariantBindingIntent, guard: () => void): {
161
+ operation: NolVariantBindingOperation;
162
+ created: boolean;
163
+ };
164
+ startBridge(operation: NolVariantBindingOperation, guard: () => void): NolVariantBindingOperation;
165
+ settle(operation: NolVariantBindingOperation, outcome: "applied" | "not_applied" | "unknown", proof: NolArtifactRef | null, guard: () => void): NolVariantBindingOperation;
166
+ revoke(scope: NolVariantActionScope, guard: () => void): NolVariantBindingOperation;
167
+ history(projectId: string, targetId: string): NolVariantBindingHistory[];
168
+ getReconciliation(projectId: string, targetId: string, id: string): NolVariantReconciliation | null;
169
+ reconcile(input: {
170
+ operation: NolVariantBindingOperation;
171
+ expectedVersion: number;
172
+ id: string;
173
+ outcome: "applied" | "not_applied";
174
+ proof: NolArtifactRef;
175
+ authorization: NolVariantBindingIntent["authorization"];
176
+ }, guard: () => void): NolVariantReconciliation;
177
+ }
178
+ export interface NolVariantRegistryLimits {
179
+ maxMetadataBytes: number;
180
+ maxUniqueArtifactBytes: number;
181
+ maxArtifacts: number;
182
+ maxParents: number;
183
+ maxDurationMs: number;
184
+ maxTicketLifetimeMs: number;
185
+ }
186
+ export interface NolVariantArtifacts {
187
+ /** Must stream/hash complete bytes, including GB weight files. */
188
+ verify(ref: NolArtifactRef, signal?: AbortSignal): Promise<void>;
189
+ /** Called ONLY for metadata admitted under maxMetadataBytes, never weights. */
190
+ readBytes(ref: NolArtifactRef, signal?: AbortSignal): Promise<Uint8Array>;
191
+ }
192
+ export interface NolSandboxBindingBridge {
193
+ /** Trusted host integration only. No production bridge is supported here.
194
+ * A proof is an immutable omnius.nol.sandbox-apply.v1 artifact with exact
195
+ * intentDigest, nonce, previous/next selections and outcome. Unknown/throw
196
+ * leaves the target unresolved and never authorizes a selection commit. */
197
+ apply(input: {
198
+ operation: NolVariantBindingOperation;
199
+ assertCurrent(): void;
200
+ signal?: AbortSignal;
201
+ }): Promise<{
202
+ outcome: "applied" | "not_applied" | "unknown";
203
+ proof?: NolArtifactRef;
204
+ }>;
205
+ /** READ-ONLY examination of the durable host route and physical job custody.
206
+ * Never repeat apply or replay a native dispatch while recovering an outcome. */
207
+ inspect?(input: {
208
+ operation: NolVariantBindingOperation;
209
+ targetVersion: number;
210
+ assertCurrent(): void;
211
+ signal?: AbortSignal;
212
+ }): Promise<{
213
+ outcome: "applied" | "not_applied" | "unknown";
214
+ proof?: NolArtifactRef;
215
+ }>;
216
+ }
217
+ /** Kept by trusted host code, like NolHostAuthority; never pass this issuer to
218
+ * a command body/tool. Empty opaque tickets cannot be recreated from JSON or
219
+ * persisted rows. A fresh process must re-run the actual host verification. */
220
+ export declare class NolVariantHostAuthority {
221
+ private readonly options;
222
+ private readonly modelValidations;
223
+ private readonly validations;
224
+ private readonly actions;
225
+ constructor(options: {
226
+ verifyEvaluation(context: Readonly<NolVerifiedVariantEvaluation>, signal?: AbortSignal): Promise<NolVariantLiveProof>;
227
+ verifyModelEvaluation?(context: Readonly<NolVerifiedModelEvaluation>, signal?: AbortSignal): Promise<NolVariantLiveProof>;
228
+ now?: () => number;
229
+ ticketLifetimeMs: number;
230
+ });
231
+ private now;
232
+ get ticketLifetimeMs(): number;
233
+ issueValidation(contextToken: object, signal?: AbortSignal): Promise<NolVariantValidationTicket>;
234
+ /** Separate issuer path: a model-validation plan is never cast to an old recipe experiment. */
235
+ issueModelValidation(contextToken: object, signal?: AbortSignal): Promise<NolVariantValidationTicket>;
236
+ /** Host caller/auth middleware owns this grant. The callback must recheck
237
+ * real project/target/action authorization, not user-supplied role strings. */
238
+ issueAction(input: {
239
+ actorId: string;
240
+ scope: NolVariantActionScope;
241
+ expiresAtMs: number;
242
+ assertCurrent(): void;
243
+ }): NolVariantActionTicket;
244
+ revokeValidation(ticket: NolVariantValidationTicket): void;
245
+ revokeAction(ticket: NolVariantActionTicket): void;
246
+ inspectValidation(ticket: unknown): Readonly<NolVerifiedVariantEvaluation>;
247
+ inspectModelValidation(ticket: unknown): Readonly<NolVerifiedModelEvaluation> | undefined;
248
+ inspectAction(ticket: unknown, expected: NolVariantActionScope): Readonly<NolVariantBindingIntent["authorization"]>;
249
+ }
250
+ /** Research/sandbox metadata selection only. No endpoint, model registry,
251
+ * daemon setting or production binding is changed by this module. */
252
+ export declare class NolVariantRegistry {
253
+ private readonly options;
254
+ constructor(options: {
255
+ store: NolVariantSelectionStore;
256
+ artifacts: NolVariantArtifacts;
257
+ authority: NolVariantHostAuthority;
258
+ limits: NolVariantRegistryLimits;
259
+ requiredValidationGateIds: readonly string[];
260
+ requiredModelValidationGateIds?: readonly string[];
261
+ sandboxBridge?: NolSandboxBindingBridge;
262
+ });
263
+ private registration;
264
+ registerExperimental(bundle: NolVariantRegistrationBundle, signal?: AbortSignal, assertCurrent?: () => void): Promise<NolRegisteredVariant>;
265
+ validate(variantDigest: string, evaluation: NolVariantEvaluationBundle | NolModelEvaluationBundle, signal?: AbortSignal): Promise<NolVariantValidationTicket>;
266
+ validateModelExport(variantDigest: string, input: NolModelEvaluationBundle, signal?: AbortSignal): Promise<NolVariantValidationTicket>;
267
+ /** Host setup only. It creates an empty research/sandbox metadata target;
268
+ * neither this nor a registration is an activation/promotion. */
269
+ createTarget(target: NolVariantBindingTarget): NolVariantBindingState;
270
+ private selection;
271
+ change(input: {
272
+ projectId: string;
273
+ targetId: string;
274
+ action: "select" | "rollback" | "clear";
275
+ operationId: string;
276
+ expectedVersion: number;
277
+ authorization: NolVariantActionTicket;
278
+ validation?: NolVariantValidationTicket;
279
+ signal?: AbortSignal;
280
+ }): Promise<NolVariantBindingOperation>;
281
+ revoke(scopeValue: NolVariantActionScope, authorization: NolVariantActionTicket): NolVariantBindingOperation;
282
+ reconcileSandbox(input: {
283
+ projectId: string;
284
+ targetId: string;
285
+ operationId: string;
286
+ reconciliationId: string;
287
+ expectedVersion: number;
288
+ expectedNonce: string;
289
+ authorization: NolVariantActionTicket;
290
+ signal?: AbortSignal;
291
+ }): Promise<NolVariantReconciliation>;
292
+ }
@@ -0,0 +1,34 @@
1
+ declare const CONSTRAINT_HEADER_NAMES: readonly [
2
+ "X-Ollama-Unify-GPU-UUIDs",
3
+ "X-Ollama-Unify-CPU-Offload",
4
+ "X-Ollama-Unify-Context-Headroom-MiB"
5
+ ];
6
+ /** Host placement constraints, shared with the actual generation request. */
7
+ export type OllamaContextConstraintHeaders = Readonly<Partial<Record<typeof CONSTRAINT_HEADER_NAMES[number], string>>>;
8
+ /** Capacity of the selected proxy's native transport, including empty-output
9
+ * recovery. This is broker policy, not the model's advertised training window
10
+ * or the runner's adaptive attention budget. */
11
+ export interface OllamaTransportContextCapability {
12
+ readonly contextLimitTokens: number;
13
+ readonly source: "ollama_unify_native_context_policy";
14
+ readonly discoveryPath: string;
15
+ readonly endpoint: string;
16
+ readonly model: string;
17
+ readonly policy: "exact_model_profile" | "default_max_context" | "verified_model_maximum";
18
+ readonly nativeRecoverySharesLimit: true;
19
+ readonly modelMaximumContextTokens?: number;
20
+ readonly modelDigest?: string;
21
+ readonly limitReason?: string;
22
+ readonly provenance?: "host_discovery" | "live_discovery";
23
+ }
24
+ /** Managed automatic capacity replaces stale client defaults. Legacy policy
25
+ * remains a ceiling on an explicitly configured client window. */
26
+ export declare function resolveOllamaContextWindow(configured: number | undefined, capability: OllamaTransportContextCapability | undefined): number | undefined;
27
+ /** Refreshes may increase capacity only within the same verified model/endpoint scope. */
28
+ export declare function refreshOllamaTransportContextCapability(previous: OllamaTransportContextCapability | undefined, current: OllamaTransportContextCapability | undefined): OllamaTransportContextCapability | undefined;
29
+ /** Read-only, authenticated metadata negotiation; never admits or loads a model. */
30
+ export declare function queryOllamaTransportContextCapability(baseUrl: string, model: string, modelMaximumContextTokens: number, apiKey?: string, constraints?: OllamaContextConstraintHeaders): Promise<OllamaTransportContextCapability | undefined>;
31
+ /** Read only endpoint-bound host discovery. Ownership of a backend/private
32
+ * lane does not mean that lane applies the public proxy's request clamp. */
33
+ export declare function readOllamaTransportContextCapability(baseUrl: string, model: string, discoveryPath?: string, apiKey?: string, constraints?: OllamaContextConstraintHeaders): OllamaTransportContextCapability | undefined;
34
+ export {};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * personality.ts — Transient personality profile for controlling agent response style.
3
+ *
4
+ * Based on the SAC framework (arXiv:2506.20993) which models personality
5
+ * expression along five behavioral intensity dimensions rather than binary
6
+ * trait toggling. Adapted here for controlling agent verbosity/conciseness.
7
+ *
8
+ * Research provenance:
9
+ * - SAC: arXiv:2506.20993 (intensity dimensions, adjective anchoring)
10
+ * - Lost in the Middle: arXiv:2307.03172 (prompt position optimization)
11
+ * - Same Task, More Tokens: arXiv:2402.14848 (prompt length ≤ 3K tokens)
12
+ * - Anthropic Context Engineering (2025) (altitude calibration, positive framing)
13
+ * - Linear Personality Probing: arXiv:2512.17639 (prompt-level > activation-level)
14
+ */
15
+ /** Intensity level (1–5) for a personality dimension */
16
+ export type Intensity = 1 | 2 | 3 | 4 | 5;
17
+ /**
18
+ * Transient personality profile for controlling agent response style.
19
+ *
20
+ * Each dimension is 1–5:
21
+ * 1 = minimal (concise, silent, terse)
22
+ * 3 = balanced (default)
23
+ * 5 = maximal (verbose, explanatory, thorough)
24
+ */
25
+ export interface PersonalityProfile {
26
+ /** How often the agent narrates its actions (1=silent, 5=running commentary) */
27
+ frequency: Intensity;
28
+ /** Depth of reasoning exposed in output (1=results only, 5=full chain of thought) */
29
+ depth: Intensity;
30
+ /** When the agent decides to speak vs. act silently (1=only on failure, 5=narrate everything) */
31
+ threshold: Intensity;
32
+ /** Effort invested in response formatting (1=raw, 5=polished markdown) */
33
+ effort: Intensity;
34
+ /** Willingness to offer unsolicited context (1=never, 5=proactive suggestions) */
35
+ willingness: Intensity;
36
+ }
37
+ /** Named personality preset key */
38
+ export type PersonalityPresetName = "concise" | "balanced" | "verbose" | "pedagogical" | "stark" | "autist";
39
+ /** Preset personality profiles */
40
+ export declare const PERSONALITY_PRESETS: Record<PersonalityPresetName, Readonly<PersonalityProfile>>;
41
+ /** All valid preset names */
42
+ export declare const PRESET_NAMES: PersonalityPresetName[];
43
+ /**
44
+ * Compile a PersonalityProfile into a system prompt suffix.
45
+ *
46
+ * Uses adjective-based semantic anchoring (SAC framework) and positive framing
47
+ * (KAIST research via The Prompt Report arXiv:2406.06608) rather than negated
48
+ * instructions.
49
+ *
50
+ * Token budget: ≤80 tokens at any intensity level (per Levy et al. 2024).
51
+ * Returns empty string for balanced (default) profiles — no suffix needed.
52
+ */
53
+ export declare function compilePersonalityPrompt(profile: PersonalityProfile, presetName?: PersonalityPresetName): string;
54
+ /**
55
+ * Get the average intensity of a profile (1.0–5.0).
56
+ * Useful for display and tier classification.
57
+ */
58
+ export declare function profileIntensity(profile: PersonalityProfile): number;
59
+ /**
60
+ * Get a human-readable label for a profile's intensity level.
61
+ */
62
+ export declare function profileLabel(profile: PersonalityProfile): string;
63
+ /**
64
+ * Look up a preset by name, or return undefined if not found.
65
+ */
66
+ export declare function getPreset(name: string): PersonalityProfile | undefined;
@@ -0,0 +1,24 @@
1
+ export interface CacheControl {
2
+ type: "ephemeral";
3
+ ttl?: string;
4
+ }
5
+ export type PromptCacheTtl = "5m" | "1h";
6
+ export type PromptCacheTtlSetting = PromptCacheTtl | "auto";
7
+ /**
8
+ * Resolve an adaptive cache tier from the trusted runtime surface. Human-paced
9
+ * sessions benefit from surviving normal pauses; machine-paced runs generally
10
+ * complete within the five-minute tier and should avoid the higher write cost.
11
+ */
12
+ export declare function resolvePromptCacheTtl(setting: PromptCacheTtlSetting, surface: string): PromptCacheTtl;
13
+ export declare function applyCacheMarker(msg: Record<string, unknown>, marker: CacheControl): void;
14
+ export declare function applyAnthropicCacheControl(messages: Record<string, unknown>[], cacheTtl?: string): Record<string, unknown>[];
15
+ /**
16
+ * Place cache_control breakpoints on the last `maxBreakpoints` messages of a
17
+ * non-system message array. Used by the Anthropic backend, which carries the
18
+ * system prompt as a separate `system` param (cached via
19
+ * applySystemCacheControl) rather than as a message — so the message array
20
+ * gets the remaining breakpoints. Anthropic permits at most 4 cache_control
21
+ * blocks total, so system (1) + last 3 messages keeps within the limit.
22
+ */
23
+ export declare function applyAnthropicMessageCacheControl(messages: Record<string, unknown>[], maxBreakpoints?: number, cacheTtl?: string): Record<string, unknown>[];
24
+ export declare function applySystemCacheControl(system: string | Record<string, unknown>[], cacheTtl?: string): string | Record<string, unknown>[];
@@ -0,0 +1,224 @@
1
+ import { type NetworkEgressValidationOptions } from "../execution/tools/network-egress-policy.js";
2
+ import type { AgenticBackend, StreamChunk } from "./agenticRunner.js";
3
+ import { type RemoteInferencePolicy } from "./remote-inference-policy.js";
4
+ import { InputValidationFailure, type ExpectedInferenceResponseKind } from "./expected-inference-response.js";
5
+ export interface InferenceFallbackApprovalReceipt {
6
+ reason: "local_inference_unavailable" | "primary_inference_unavailable";
7
+ signal?: AbortSignal;
8
+ }
9
+ /** Host-only route lifecycle. Never includes endpoints, credentials or provider bodies. */
10
+ export interface InferenceRouteLifecycleReceipt {
11
+ location: "local" | "remote";
12
+ phase: "selected" | "succeeded" | "failed" | "discovery";
13
+ model: string;
14
+ providerId: string;
15
+ backendType: "ollama" | "vllm";
16
+ logicalRequestId?: string;
17
+ /** First trusted local model token/tool progress, distinct from pending selection. */
18
+ semanticProgress?: true;
19
+ /** Genuine completed route metadata only; never authorizes another dispatch. */
20
+ contextCapacity?: CompletedInferenceContextCapacity;
21
+ discovery?: {
22
+ stage: "catalog" | "availability" | "eligibility" | "cooldown";
23
+ outcome: "live" | "cached" | "last_known_good" | "bundled" | "unavailable" | "no_eligible_models" | "cooling";
24
+ modelCount?: number;
25
+ requiredOutputTokens?: number;
26
+ availableOutputTokens?: number;
27
+ category?: "timeout" | "transport" | "invalid_metadata";
28
+ reason?: "selected_model_not_in_active_free_catalog";
29
+ status?: number;
30
+ };
31
+ schemaAdapter?: {
32
+ omittedNativeKeywords: readonly string[];
33
+ nativeFormat?: "prompt_only";
34
+ hostValidation: "unchanged";
35
+ };
36
+ failure?: {
37
+ category: "model_unavailable" | "access_denied" | "request_rejected" | "authentication" | "rate_limit" | "upstream_unavailable" | "timeout" | "not_ready" | "empty_response" | "invalid_response" | "transport";
38
+ status?: number;
39
+ catalogReason?: "not_in_active_free_catalog";
40
+ /** Allowlisted exact local broker reason; never provider error prose. */
41
+ brokerReason?: string;
42
+ accessReason?: "free_tier_client_restricted";
43
+ /** Closed host-normalized diagnostic; never provider prose. */
44
+ authReason?: "expired_key";
45
+ responseBodySha256?: string;
46
+ validationReason?: InputValidationFailure | "transport_envelope";
47
+ expectedKind?: ExpectedInferenceResponseKind;
48
+ apiShape?: "chat_completions" | "responses" | "anthropic_messages" | "ollama";
49
+ schemaDigest?: string;
50
+ deadlineKind?: "local_first_frame" | "remote_aggregate" | "remote_attempt" | "caller_request" | "provider_idle" | "request";
51
+ streamFrames?: readonly ("visible_content" | "thinking" | "tool_call" | "metadata")[];
52
+ streamCommitPolicy?: "immediate" | "validated_turn";
53
+ /** Host retry policy, distinct from a provider availability claim. */
54
+ disposition?: "retry_same_model" | "repair_same_model" | "rotate_model" | "surface_error";
55
+ reason?: "model_unavailable" | "unsupported_capability" | "transient" | "terminal" | "authentication" | "access_restricted" | "request_rejected" | "response_contract" | "adapter_or_configuration";
56
+ attempt?: number;
57
+ retryDelayMs?: number;
58
+ };
59
+ }
60
+ type Request = Parameters<AgenticBackend["chatCompletion"]>[0] & {
61
+ localAdmissionFailure?: unknown;
62
+ onInferenceFallbackRequired?: (receipt: InferenceFallbackApprovalReceipt) => Promise<boolean>;
63
+ };
64
+ type Result = Awaited<ReturnType<AgenticBackend["chatCompletion"]>>;
65
+ export interface RemoteInferenceRoute {
66
+ baseUrl: string;
67
+ model: string;
68
+ apiKey?: string;
69
+ providerId?: string;
70
+ protocol: "openai-chat" | "anthropic-messages";
71
+ }
72
+ type StreamingBackend = AgenticBackend & {
73
+ chatCompletionStream?: (request: Request) => AsyncGenerator<StreamChunk>;
74
+ };
75
+ export interface LocalBrokerAdmissionFailure {
76
+ retryable?: boolean;
77
+ reason_code?: string;
78
+ logical_request_id?: string;
79
+ admission_retained?: boolean;
80
+ cause_reason_code?: string;
81
+ retry_after_ms?: number;
82
+ }
83
+ export interface RemoteInferenceFallbackOptions {
84
+ /** Issued only by the exact managed Ollama transport; never inferred from a model response. */
85
+ localBroker?: {
86
+ admissionFailure: (error: unknown) => LocalBrokerAdmissionFailure | null;
87
+ };
88
+ /** Actual selected-loopback HTTP evidence, never arbitrary error text. */
89
+ localReadiness?: (error: unknown) => "loading" | "queued" | undefined;
90
+ policy?: RemoteInferencePolicy;
91
+ env?: NodeJS.ProcessEnv;
92
+ fetch?: typeof fetch;
93
+ dnsLookup?: NetworkEgressValidationOptions["dnsLookup"];
94
+ now?: () => number;
95
+ onRoute?: (route: {
96
+ providerId?: string;
97
+ model: string;
98
+ }) => void;
99
+ }
100
+ /** Catalog-declared capacity for one exact host request, never an HTTP/model-output claim. */
101
+ export interface PreparedInferenceContextCapacity {
102
+ readonly schema: "omnius.inference-context-capacity.v1";
103
+ readonly location: "remote";
104
+ readonly source: "remote_catalog";
105
+ readonly providerId: string;
106
+ readonly model: string;
107
+ readonly contextLimitTokens: number;
108
+ readonly maxInputTokens?: number;
109
+ readonly maxOutputTokens?: number;
110
+ readonly estimatedInputTokens: number;
111
+ readonly requiredOutputTokens: number;
112
+ readonly token: object;
113
+ }
114
+ /** Actual successful route's declared capacity, not a lease for generation. */
115
+ export interface CompletedInferenceContextCapacity {
116
+ readonly schema: "omnius.completed-inference-context-capacity.v1";
117
+ readonly location: "remote";
118
+ readonly source: "remote_catalog";
119
+ readonly providerId: string;
120
+ readonly model: string;
121
+ readonly contextLimitTokens: number;
122
+ readonly maxInputTokens?: number;
123
+ readonly maxOutputTokens?: number;
124
+ readonly token: object;
125
+ }
126
+ /** JSON, selected/failed routes and changed inputs cannot confer source capacity. */
127
+ export declare function getCompletedInferenceContextCapacity(value: unknown, request: Request): CompletedInferenceContextCapacity | undefined;
128
+ /** A JSON copy or changed source/owner/schema cannot confer route capacity. */
129
+ export declare function getPreparedInferenceContextCapacity(value: unknown, request: Request): PreparedInferenceContextCapacity | undefined;
130
+ /** Safe host-owned terminal failure. Provider bodies and credentials never escape. */
131
+ export declare class RemoteInferenceUnavailableError extends Error {
132
+ readonly code = "remote_inference_unavailable";
133
+ readonly fatal = true;
134
+ readonly retryable = false;
135
+ constructor(primary?: "local" | "selected");
136
+ }
137
+ /** Manual fallback never discovers providers or sends context without approval. */
138
+ export declare class InferenceFallbackApprovalError extends Error {
139
+ readonly code: "fallback_approval_required" | "fallback_declined";
140
+ readonly fatal = true;
141
+ readonly retryable = false;
142
+ constructor(code: "fallback_approval_required" | "fallback_declined", reason?: InferenceFallbackApprovalReceipt["reason"]);
143
+ }
144
+ /** Sequential local-first fallback. No generation probes, prompt races or mutation replay. */
145
+ export declare class RemoteInferenceFallback {
146
+ private readonly primary;
147
+ private readonly makeBackend;
148
+ private readonly options;
149
+ private policy;
150
+ private readonly now;
151
+ private readonly env;
152
+ lastRoute?: {
153
+ providerId: string;
154
+ model: string;
155
+ kind: "keyless" | "configured";
156
+ };
157
+ constructor(primary: {
158
+ baseUrl: string;
159
+ model: string;
160
+ apiKey?: string;
161
+ additionalSecrets?: () => readonly string[];
162
+ providerId?: string;
163
+ backendType?: "ollama" | "vllm";
164
+ }, makeBackend: (route: RemoteInferenceRoute) => StreamingBackend, options?: RemoteInferenceFallbackOptions);
165
+ reloadPolicy(): void;
166
+ private requestScope;
167
+ private capacityPrimaryScope;
168
+ private capacityPolicyScope;
169
+ /** Read-only route discovery; never loads or generates with any local/remote model. */
170
+ prepareContextCapacity(request: Request, options?: {
171
+ maxContextTokens?: number;
172
+ }): Promise<PreparedInferenceContextCapacity | undefined>;
173
+ private preparedCapacity;
174
+ eligible(request: Request): boolean;
175
+ localAdmissionTimeoutMs(request: Request): number | undefined;
176
+ private localAttemptTimeoutMs;
177
+ private localRequest;
178
+ private localWaiting;
179
+ private initialWaitTimeout;
180
+ private retainedLocalAdmission;
181
+ private localBrokerReason;
182
+ complete(request: Request, local: (request: Request) => Promise<Result>): Promise<Result>;
183
+ /** The same remote phase can be exercised live without fabricating a local reply. */
184
+ private completeRemote;
185
+ stream(request: Request, local: (request: Request) => AsyncGenerator<StreamChunk>): AsyncGenerator<StreamChunk>;
186
+ private streamRemote;
187
+ private fence;
188
+ private fenceRemoteDeadline;
189
+ /** Telegram owns a whole generated turn before any answer/tool frame escapes.
190
+ * This never re-executes a prior successful turn; failed uncommitted frames
191
+ * are discarded and only the selected complete valid turn is released.
192
+ */
193
+ private commitStreamTurn;
194
+ private approveRemoteFallback;
195
+ private scrubber;
196
+ private requireUsableStream;
197
+ /** Auxiliary JSON is internal until the selected route satisfies the exact host contract. */
198
+ private requireValidatedStructuredStream;
199
+ private scrubStream;
200
+ private recordRoute;
201
+ private lifecycle;
202
+ /** Discovery receipts never imply that a model was selected or generated. */
203
+ private discovery;
204
+ private prepare;
205
+ private attempt;
206
+ private boundedStream;
207
+ private abortable;
208
+ private validate;
209
+ private schemaRestrictionKey;
210
+ private schemaRestrictions;
211
+ private learnNativeSchemaRestriction;
212
+ private prepareModelContract;
213
+ private remoteRequest;
214
+ private compatible;
215
+ private remoteMinimumOutputTokens;
216
+ private remoteOutputTokens;
217
+ private remoteInputTokens;
218
+ private cooldown;
219
+ private retryableCandidates;
220
+ private candidates;
221
+ private catalogCandidates;
222
+ private read;
223
+ }
224
+ export {};