memeloop 0.0.1 → 0.1.1

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 (228) hide show
  1. package/README.md +63 -0
  2. package/dist/browser.cjs +1413 -0
  3. package/dist/browser.cjs.map +1 -0
  4. package/dist/browser.d.cts +3066 -0
  5. package/dist/browser.d.ts +3066 -0
  6. package/dist/browser.js +43 -0
  7. package/dist/chunk-2C6BJZI3.js +382 -0
  8. package/dist/chunk-2C6BJZI3.js.map +1 -0
  9. package/dist/chunk-426CJUZP.js +630 -0
  10. package/dist/chunk-426CJUZP.js.map +1 -0
  11. package/dist/chunk-7ZDTB4VZ.js +63 -0
  12. package/dist/chunk-7ZDTB4VZ.js.map +1 -0
  13. package/dist/chunk-AZFYDWIN.js +98 -0
  14. package/dist/chunk-AZFYDWIN.js.map +1 -0
  15. package/dist/chunk-BGPU4RR7.js +367 -0
  16. package/dist/chunk-BGPU4RR7.js.map +1 -0
  17. package/dist/chunk-CCEFAOSH.js +496 -0
  18. package/dist/chunk-CCEFAOSH.js.map +1 -0
  19. package/dist/chunk-FWSY5HOA.js +63 -0
  20. package/dist/chunk-FWSY5HOA.js.map +1 -0
  21. package/dist/chunk-GYIOMQMY.js +8726 -0
  22. package/dist/chunk-GYIOMQMY.js.map +1 -0
  23. package/dist/chunk-K6P63KD4.js +68 -0
  24. package/dist/chunk-K6P63KD4.js.map +1 -0
  25. package/dist/chunk-KFS2EJT6.js +42 -0
  26. package/dist/chunk-KFS2EJT6.js.map +1 -0
  27. package/dist/chunk-MAJWHAKR.js +3637 -0
  28. package/dist/chunk-MAJWHAKR.js.map +1 -0
  29. package/dist/chunk-MRKY4HGF.js +205 -0
  30. package/dist/chunk-MRKY4HGF.js.map +1 -0
  31. package/dist/chunk-T7FSXWFR.js +2744 -0
  32. package/dist/chunk-T7FSXWFR.js.map +1 -0
  33. package/dist/chunk-VZKQX5PP.js +1 -0
  34. package/dist/chunk-VZKQX5PP.js.map +1 -0
  35. package/dist/chunk-WAI6BODI.js +175 -0
  36. package/dist/chunk-WAI6BODI.js.map +1 -0
  37. package/dist/chunk-YMNXDNDW.js +798 -0
  38. package/dist/chunk-YMNXDNDW.js.map +1 -0
  39. package/dist/conversation.cjs +208 -0
  40. package/dist/conversation.cjs.map +1 -0
  41. package/dist/conversation.d.cts +100 -0
  42. package/dist/conversation.d.ts +100 -0
  43. package/dist/conversation.js +21 -0
  44. package/dist/conversation.js.map +1 -0
  45. package/dist/device-network-portable.cjs +702 -0
  46. package/dist/device-network-portable.cjs.map +1 -0
  47. package/dist/device-network-portable.d.cts +110 -0
  48. package/dist/device-network-portable.d.ts +110 -0
  49. package/dist/device-network-portable.js +53 -0
  50. package/dist/device-network-portable.js.map +1 -0
  51. package/dist/device-network.cjs +906 -0
  52. package/dist/device-network.cjs.map +1 -0
  53. package/dist/device-network.d.cts +6 -0
  54. package/dist/device-network.d.ts +6 -0
  55. package/dist/device-network.js +59 -0
  56. package/dist/device-network.js.map +1 -0
  57. package/dist/fetchProvider-WWnWnQFP.d.ts +91 -0
  58. package/dist/fetchProvider-toTHy5Nu.d.cts +91 -0
  59. package/dist/index.cjs +28051 -5459
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +94 -1320
  62. package/dist/index.d.ts +94 -1320
  63. package/dist/index.js +10616 -2420
  64. package/dist/index.js.map +1 -1
  65. package/dist/interface-IrKBFtL1.d.cts +493 -0
  66. package/dist/interface-IrKBFtL1.d.ts +493 -0
  67. package/dist/llm-providers.cjs +43 -8
  68. package/dist/llm-providers.cjs.map +1 -1
  69. package/dist/llm-providers.d.cts +2 -1
  70. package/dist/llm-providers.d.ts +2 -1
  71. package/dist/llm-providers.js +4 -2
  72. package/dist/llm-providers.js.map +1 -1
  73. package/dist/loop-api.cjs +5227 -2010
  74. package/dist/loop-api.cjs.map +1 -1
  75. package/dist/loop-api.d.cts +11 -5
  76. package/dist/loop-api.d.ts +11 -5
  77. package/dist/loop-api.js +86 -49
  78. package/dist/mobile.cjs +2711 -0
  79. package/dist/mobile.cjs.map +1 -0
  80. package/dist/mobile.d.cts +6 -0
  81. package/dist/mobile.d.ts +6 -0
  82. package/dist/mobile.js +22 -0
  83. package/dist/mobile.js.map +1 -0
  84. package/dist/orchestration-portable-BHB_YrNN.d.ts +2192 -0
  85. package/dist/orchestration-portable-mvYBvGBb.d.cts +2192 -0
  86. package/dist/orchestration-portable.cjs +9553 -0
  87. package/dist/orchestration-portable.cjs.map +1 -0
  88. package/dist/orchestration-portable.d.cts +5 -0
  89. package/dist/orchestration-portable.d.ts +5 -0
  90. package/dist/orchestration-portable.js +290 -0
  91. package/dist/orchestration-portable.js.map +1 -0
  92. package/dist/pairingInvite-BXPWY3aM.d.cts +149 -0
  93. package/dist/pairingInvite-Cuz0wuq9.d.ts +149 -0
  94. package/dist/promptConcat-0WNFTg4l.d.ts +516 -0
  95. package/dist/promptConcat-D6wr5V-V.d.cts +516 -0
  96. package/dist/providerRegistry-Bi6pAvSj.d.ts +86 -0
  97. package/dist/providerRegistry-CPsktuiX.d.cts +86 -0
  98. package/dist/registry-D0kbxksn.d.cts +393 -0
  99. package/dist/registry-DDbvhlhs.d.ts +393 -0
  100. package/dist/remoteClient-B_spK019.d.ts +87 -0
  101. package/dist/remoteClient-CBggnRy3.d.cts +87 -0
  102. package/dist/runtime-PGWR6FIV.js +18 -0
  103. package/dist/runtime-PGWR6FIV.js.map +1 -0
  104. package/dist/scriptDeploymentPipeline-CXJcC82H.d.ts +2464 -0
  105. package/dist/scriptDeploymentPipeline-yG1ZhVVI.d.cts +2464 -0
  106. package/dist/syncCloudDevices-BEqwgrhD.d.ts +49 -0
  107. package/dist/syncCloudDevices-Ds_Kcgrv.d.cts +49 -0
  108. package/dist/types-7pYti-k9.d.cts +255 -0
  109. package/dist/types-CdFVSntj.d.ts +255 -0
  110. package/package.json +110 -35
  111. package/dist/anthropic.cjs +0 -72
  112. package/dist/anthropic.cjs.map +0 -1
  113. package/dist/anthropic.d.cts +0 -21
  114. package/dist/anthropic.d.ts +0 -21
  115. package/dist/anthropic.js +0 -21
  116. package/dist/anthropic.js.map +0 -1
  117. package/dist/azure.cjs +0 -72
  118. package/dist/azure.cjs.map +0 -1
  119. package/dist/azure.d.cts +0 -21
  120. package/dist/azure.d.ts +0 -21
  121. package/dist/azure.js +0 -21
  122. package/dist/azure.js.map +0 -1
  123. package/dist/chunk-3CN7DFBL.js +0 -4894
  124. package/dist/chunk-3CN7DFBL.js.map +0 -1
  125. package/dist/chunk-4AZ4D7U5.js +0 -32
  126. package/dist/chunk-4AZ4D7U5.js.map +0 -1
  127. package/dist/chunk-6ON4XSOV.js +0 -63
  128. package/dist/chunk-6ON4XSOV.js.map +0 -1
  129. package/dist/chunk-DJQNGIXX.js +0 -4793
  130. package/dist/chunk-DJQNGIXX.js.map +0 -1
  131. package/dist/chunk-FKQP6AOQ.js +0 -32
  132. package/dist/chunk-FKQP6AOQ.js.map +0 -1
  133. package/dist/chunk-OVJ7JJBA.js +0 -35
  134. package/dist/chunk-OVJ7JJBA.js.map +0 -1
  135. package/dist/chunk-P4UZ7IXC.js +0 -42
  136. package/dist/chunk-YHJ2AEFR.js +0 -4933
  137. package/dist/chunk-YHJ2AEFR.js.map +0 -1
  138. package/dist/chunk-YVK7RYRO.js +0 -4973
  139. package/dist/chunk-YVK7RYRO.js.map +0 -1
  140. package/dist/code-assistant.json +0 -114
  141. package/dist/cohere.cjs +0 -72
  142. package/dist/cohere.cjs.map +0 -1
  143. package/dist/cohere.d.cts +0 -21
  144. package/dist/cohere.d.ts +0 -21
  145. package/dist/cohere.js +0 -21
  146. package/dist/cohere.js.map +0 -1
  147. package/dist/deepseek.cjs +0 -72
  148. package/dist/deepseek.cjs.map +0 -1
  149. package/dist/deepseek.d.cts +0 -21
  150. package/dist/deepseek.d.ts +0 -21
  151. package/dist/deepseek.js +0 -21
  152. package/dist/deepseek.js.map +0 -1
  153. package/dist/dist-65U7OYRG.js +0 -1257
  154. package/dist/dist-65U7OYRG.js.map +0 -1
  155. package/dist/fetchProvider-Cu4WkU5O.d.cts +0 -819
  156. package/dist/fetchProvider-Cu4WkU5O.d.ts +0 -819
  157. package/dist/frontend-ui-ux.json +0 -105
  158. package/dist/general-assistant.json +0 -95
  159. package/dist/git-master.json +0 -51
  160. package/dist/google-vertex.cjs +0 -72
  161. package/dist/google-vertex.cjs.map +0 -1
  162. package/dist/google-vertex.d.cts +0 -21
  163. package/dist/google-vertex.d.ts +0 -21
  164. package/dist/google-vertex.js +0 -21
  165. package/dist/google-vertex.js.map +0 -1
  166. package/dist/google.cjs +0 -72
  167. package/dist/google.cjs.map +0 -1
  168. package/dist/google.d.cts +0 -21
  169. package/dist/google.d.ts +0 -21
  170. package/dist/google.js +0 -21
  171. package/dist/google.js.map +0 -1
  172. package/dist/groq.cjs +0 -72
  173. package/dist/groq.cjs.map +0 -1
  174. package/dist/groq.d.cts +0 -21
  175. package/dist/groq.d.ts +0 -21
  176. package/dist/groq.js +0 -21
  177. package/dist/groq.js.map +0 -1
  178. package/dist/index.d.mts +0 -3203
  179. package/dist/index.mjs +0 -7064
  180. package/dist/index.mjs.map +0 -1
  181. package/dist/mistral.cjs +0 -72
  182. package/dist/mistral.cjs.map +0 -1
  183. package/dist/mistral.d.cts +0 -21
  184. package/dist/mistral.d.ts +0 -21
  185. package/dist/mistral.js +0 -21
  186. package/dist/mistral.js.map +0 -1
  187. package/dist/multipart-parser-EJCXIUHC.js +0 -372
  188. package/dist/multipart-parser-EJCXIUHC.js.map +0 -1
  189. package/dist/openai.cjs +0 -72
  190. package/dist/openai.cjs.map +0 -1
  191. package/dist/openai.d.cts +0 -21
  192. package/dist/openai.d.ts +0 -21
  193. package/dist/openai.js +0 -21
  194. package/dist/openai.js.map +0 -1
  195. package/dist/perplexity.cjs +0 -72
  196. package/dist/perplexity.cjs.map +0 -1
  197. package/dist/perplexity.d.cts +0 -21
  198. package/dist/perplexity.d.ts +0 -21
  199. package/dist/perplexity.js +0 -21
  200. package/dist/perplexity.js.map +0 -1
  201. package/dist/playwright.json +0 -52
  202. package/dist/promptConcat-BJdazTg5.d.cts +0 -1832
  203. package/dist/promptConcat-BJdazTg5.d.ts +0 -1832
  204. package/dist/promptConcat-CAkpni_8.d.cts +0 -1834
  205. package/dist/promptConcat-CAkpni_8.d.ts +0 -1834
  206. package/dist/promptConcat-CfH5-GAE.d.cts +0 -1036
  207. package/dist/promptConcat-ChcAZOOL.d.ts +0 -1036
  208. package/dist/promptConcat-G5TnJVRy.d.cts +0 -1800
  209. package/dist/promptConcat-G5TnJVRy.d.ts +0 -1800
  210. package/dist/promptConcat-L72eowzp.d.ts +0 -1090
  211. package/dist/promptConcat-eLHdN7K8.d.cts +0 -1090
  212. package/dist/src-VTSXKG72.js +0 -1409
  213. package/dist/src-VTSXKG72.js.map +0 -1
  214. package/dist/togetherai.cjs +0 -72
  215. package/dist/togetherai.cjs.map +0 -1
  216. package/dist/togetherai.d.cts +0 -21
  217. package/dist/togetherai.d.ts +0 -21
  218. package/dist/togetherai.js +0 -21
  219. package/dist/togetherai.js.map +0 -1
  220. package/dist/types-B0Jm2l38.d.cts +0 -767
  221. package/dist/types-B0Jm2l38.d.ts +0 -767
  222. package/dist/xai.cjs +0 -72
  223. package/dist/xai.cjs.map +0 -1
  224. package/dist/xai.d.cts +0 -21
  225. package/dist/xai.d.ts +0 -21
  226. package/dist/xai.js +0 -21
  227. package/dist/xai.js.map +0 -1
  228. /package/dist/{chunk-P4UZ7IXC.js.map → browser.js.map} +0 -0
@@ -0,0 +1,2192 @@
1
+ import './interface-IrKBFtL1.cjs';
2
+ import { aE as ArtifactTrust, aD as ArtifactReviewKind, ax as ArtifactDestination, aC as ArtifactReviewEvidence, az as ArtifactRecordResource, b9 as DataClassification, bv as ModelClassSpec, k as ILLMProvider, bH as NetworkAttachmentResource, bL as NetworkClassResource, bJ as NetworkAttachmentStatus, A as AgentFrameworkContext, f as AgentLoopInput, e as AgentLoopGenerator, cB as ToolAdmissionPolicy, cS as ToolOperationResource, cP as ToolOperationApprovalEvidence, cT as ToolOperationResult, aT as ControlStoreActor, m as IToolRegistry, bh as InfrastructureDriverType, aq as AgentWorkloadResource, aS as ControlStore, bP as NodeTrustClass, z as ToolOperationEffect, by as ModelEndpointResource, a1 as AgentRunResource, b$ as RuntimeClassSpec, bq as ModelCallRecordSpec, br as ModelCallRecordStatus, d2 as VolumeAccessMode, cY as ToolRiskLevel } from './scriptDeploymentPipeline-yG1ZhVVI.cjs';
3
+ import { D as Device } from './types-7pYti-k9.cjs';
4
+ import './remoteClient-CBggnRy3.cjs';
5
+
6
+ declare function artifactTrustRank(trust: ArtifactTrust): number;
7
+ /** The trust of a derived artifact: the lowest of its parents and producer. */
8
+ declare function deriveArtifactTrust(parents: ArtifactRecordResource[], producerTrust: ArtifactTrust): ArtifactTrust;
9
+ interface ArtifactDestinationPolicy {
10
+ /** Minimum producer/lineage trust accepted by default. */
11
+ minimumTrust: ArtifactTrust;
12
+ /** Exact policy revision review evidence must be bound to. */
13
+ policyDigest: string;
14
+ requiredReviews: ArtifactReviewKind[];
15
+ /** Explicitly allow lower lineage trust after every required review passes. */
16
+ allowLowerTrust?: boolean;
17
+ }
18
+ declare const DEFAULT_DESTINATION_POLICIES: Record<ArtifactDestination, ArtifactDestinationPolicy>;
19
+ interface ArtifactAdmissionDecision {
20
+ admitted: boolean;
21
+ reason: string;
22
+ }
23
+ /**
24
+ * Decide whether an artifact may enter a destination. Evidence is valid only
25
+ * for the exact content hash, policy revision, and destination it names.
26
+ */
27
+ declare function canArtifactEnter(artifact: ArtifactRecordResource, destination: ArtifactDestination, policy?: ArtifactDestinationPolicy): ArtifactAdmissionDecision;
28
+ /** Throwing variant for driver/controller enforcement points. */
29
+ declare function assertArtifactAdmission(artifact: ArtifactRecordResource, destination: ArtifactDestination, policy?: ArtifactDestinationPolicy): void;
30
+ /**
31
+ * Content storage does not own review or promotion authority. Implementations
32
+ * stream through a hard byte limit and return a digest they computed.
33
+ */
34
+ interface ArtifactContentStore {
35
+ put(content: AsyncIterable<Uint8Array>, options: {
36
+ mimeType?: string;
37
+ maxBytes: number;
38
+ }): Promise<{
39
+ contentHash: string;
40
+ sizeBytes: number;
41
+ }>;
42
+ get(contentHash: string): Promise<AsyncIterable<Uint8Array> | null>;
43
+ delete(contentHash: string): Promise<void>;
44
+ }
45
+ interface ArtifactInspectionRequest {
46
+ contentHash: string;
47
+ policyDigest: string;
48
+ destinations: ArtifactDestination[];
49
+ maxBytes: number;
50
+ }
51
+ interface ArtifactInspectionResult {
52
+ contentHash: string;
53
+ policyDigest: string;
54
+ reviews: ArtifactReviewEvidence[];
55
+ }
56
+ /** Host adapter that parses content in a separate sandbox, never a controller. */
57
+ interface ArtifactInspectionExecutor {
58
+ inspect(request: ArtifactInspectionRequest): Promise<ArtifactInspectionResult>;
59
+ }
60
+ /** Narrow trusted writer; workers and inspection sandboxes never receive it. */
61
+ interface ArtifactReviewWriter {
62
+ appendReview(contentHash: string, evidence: ArtifactReviewEvidence): Promise<void>;
63
+ quarantine(contentHash: string, reason: string): Promise<void>;
64
+ }
65
+ /** Execute inspection externally, validate its binding, and quarantine failures. */
66
+ declare function inspectAndRecordArtifact(artifact: ArtifactRecordResource, request: Omit<ArtifactInspectionRequest, 'contentHash'>, executor: ArtifactInspectionExecutor, writer: ArtifactReviewWriter): Promise<ArtifactInspectionResult>;
67
+
68
+ declare function classificationRank(value: DataClassification): number;
69
+ interface ModelProviderDataPolicy {
70
+ /** Requests above this classification are rejected with FORBIDDEN. */
71
+ maxInputClassification?: DataClassification;
72
+ /** Classification stamped on outputs produced by this endpoint. */
73
+ outputClassification?: DataClassification;
74
+ }
75
+ declare function assertClassificationAllowed(policy: ModelProviderDataPolicy | undefined, classification: DataClassification | undefined): void;
76
+ interface ModelGenerateMessage {
77
+ role: 'system' | 'user' | 'assistant' | 'tool';
78
+ content: string;
79
+ }
80
+ interface ModelGenerateRequest {
81
+ /** ModelCallRecord name; correlates the call and anchors idempotency. */
82
+ callId: string;
83
+ modelClassRef: {
84
+ apiVersion: string;
85
+ kind: string;
86
+ name: string;
87
+ };
88
+ /** Required digest from the ModelClass; drivers must not serve a mismatch. */
89
+ modelDigest?: string;
90
+ messages: ModelGenerateMessage[];
91
+ maxOutputTokens?: number;
92
+ temperature?: number;
93
+ inputClassification?: DataClassification;
94
+ signal?: AbortSignal;
95
+ }
96
+ interface ModelStreamChunk {
97
+ type: 'delta' | 'usage' | 'error' | 'done';
98
+ delta?: string;
99
+ usage?: {
100
+ inputTokens?: number;
101
+ outputTokens?: number;
102
+ };
103
+ error?: {
104
+ code: string;
105
+ message: string;
106
+ retryable: boolean;
107
+ };
108
+ }
109
+ interface ModelProviderHealth {
110
+ healthy: boolean;
111
+ detail?: string;
112
+ checkedAt: string;
113
+ }
114
+ /**
115
+ * Portable model provider contract. Local runtimes (in-process, ollama) and
116
+ * gateway-mediated remote models implement the same interface; loops select
117
+ * models declaratively via ModelClass/ModelEndpoint and never touch provider
118
+ * SDK objects. Drivers enforce input classification before any token leaves
119
+ * the node.
120
+ */
121
+ interface ModelProviderDriver {
122
+ listModels(): Promise<ModelClassSpec[]>;
123
+ getHealth(): Promise<ModelProviderHealth>;
124
+ generate(request: ModelGenerateRequest): AsyncIterable<ModelStreamChunk>;
125
+ cancel?(callId: string): Promise<void>;
126
+ }
127
+ interface LegacyLLMProviderDriverOptions {
128
+ /** ModelClass specs this legacy provider can serve. */
129
+ models: ModelClassSpec[];
130
+ dataPolicy?: ModelProviderDataPolicy;
131
+ /** Map a portable generate request into the legacy provider's request shape. */
132
+ toLegacyRequest?: (request: ModelGenerateRequest) => unknown;
133
+ /** Extract a text delta from a legacy stream chunk; return undefined to skip. */
134
+ toDelta?: (chunk: unknown) => string | undefined;
135
+ }
136
+ /**
137
+ * Adapt an existing `ILLMProvider` to the portable `ModelProviderDriver`
138
+ * contract so current runtimes can be scheduled and policy-enforced without
139
+ * rewriting providers. Classification is enforced in the adapter, before the
140
+ * legacy provider is invoked.
141
+ */
142
+ declare function createModelProviderDriverFromLLMProvider(provider: ILLMProvider, options: LegacyLLMProviderDriverOptions): ModelProviderDriver;
143
+
144
+ /**
145
+ * NetworkDriver: the CNI-like contract between the runtime and node network
146
+ * implementations (process env, proxy, netns, firewall, eBPF, ...). Drivers
147
+ * declare what they can enforce; the control plane validates a NetworkClass
148
+ * against driver capabilities before scheduling, and never starts a workload
149
+ * whose `enforcement: required` class cannot be fully enforced.
150
+ */
151
+ type NetworkEnforceableFeature = 'dns' | 'proxy' | 'ingress' | 'egress' | 'bandwidth' | 'service-access';
152
+ type NetworkEnforcementLevel = 'none' | 'process' | 'namespace' | 'host' | 'external';
153
+ interface NetworkDriverCapabilities {
154
+ /** Driver name referenced by NetworkClass.spec.driver. */
155
+ name: string;
156
+ /** Features this driver can enforce. */
157
+ enforcedFeatures: NetworkEnforceableFeature[];
158
+ /** Strongest isolation boundary the driver actually controls. */
159
+ enforcementLevel: NetworkEnforcementLevel;
160
+ }
161
+ interface NetworkAttachRequest {
162
+ attachment: NetworkAttachmentResource;
163
+ networkClass: NetworkClassResource;
164
+ /** Opaque sandbox handle (process, container, namespace) to attach. */
165
+ sandboxRef: string;
166
+ }
167
+ interface NetworkDriverHealth {
168
+ healthy: boolean;
169
+ detail?: string;
170
+ checkedAt: string;
171
+ }
172
+ interface NetworkDriver {
173
+ getCapabilities(): Promise<NetworkDriverCapabilities>;
174
+ /**
175
+ * Attach a workload sandbox to the network described by its class. On
176
+ * success the status carries an opaque `handle` consumers must not parse;
177
+ * degraded features (best-effort classes only) are listed in `degraded`.
178
+ */
179
+ prepare(request: NetworkAttachRequest): Promise<NetworkAttachmentStatus>;
180
+ check(handle: string): Promise<NetworkAttachmentStatus | null>;
181
+ update(handle: string, request: NetworkAttachRequest): Promise<NetworkAttachmentStatus>;
182
+ resolveService(name: string, handle?: string): Promise<string | undefined>;
183
+ /** Idempotently release the handle; status CAS retries may call this again. */
184
+ release(handle: string): Promise<void>;
185
+ getHealth(): Promise<NetworkDriverHealth>;
186
+ }
187
+ interface NetworkClassSatisfaction {
188
+ satisfied: boolean;
189
+ /** Features present in the class that the driver cannot enforce. */
190
+ unsupportedFeatures: NetworkEnforceableFeature[];
191
+ reason?: string;
192
+ }
193
+ /** Features configured by the class that require driver enforcement. */
194
+ declare function featuresRequiredByClass(networkClass: NetworkClassResource): NetworkEnforceableFeature[];
195
+ /**
196
+ * Validate that a driver can satisfy a NetworkClass. For
197
+ * `enforcement: required` every configured feature must be enforceable and
198
+ * the driver must support required enforcement; for `best-effort` the check
199
+ * reports which features would degrade instead of failing.
200
+ */
201
+ declare function canDriverSatisfyClass(capabilities: NetworkDriverCapabilities, networkClass: NetworkClassResource): NetworkClassSatisfaction;
202
+
203
+ /**
204
+ * Context passed to builtin tool implementations.
205
+ * Extends AgentFrameworkContext with optional capabilities for MCP proxy, spawn and remote agent.
206
+ */
207
+ interface BuiltinToolContext extends AgentFrameworkContext {
208
+ /**
209
+ * Cooperative cancellation for the current durable ToolOperation.
210
+ * Implementations that block on I/O should pass this signal downstream.
211
+ */
212
+ operationSignal?: AbortSignal;
213
+ /**
214
+ * 当前工具执行时对应的 conversationId(由宿主/运行时注入)。
215
+ * IM 会话工具依赖该值定位会话来源;缺失时工具返回错误而不是抛异常。
216
+ */
217
+ activeToolConversationId?: string;
218
+ /**
219
+ * Run the local task agent (for spawnAgent). If not provided, spawnAgent tool will return an error.
220
+ */
221
+ runLocalAgent?(input: AgentLoopInput): AgentLoopGenerator;
222
+ /**
223
+ * List known peer devices (for remoteAgent). If not provided, remoteAgent returns empty list / "not configured".
224
+ */
225
+ getPeers?(): Promise<Device[]>;
226
+ /**
227
+ * Send JSON-RPC to a peer node (for remoteAgent and MCP proxy). If not provided, remote calls fail.
228
+ */
229
+ sendRpcToNode?(nodeId: string, method: string, parameters: unknown): Promise<unknown>;
230
+ /**
231
+ * Call a tool on a remote MCP server on the given node (for mcpClient). If not provided, mcpClient returns error.
232
+ */
233
+ mcpCallRemote?(nodeId: string, serverName: string, toolName: string, arguments_: Record<string, unknown>): Promise<unknown>;
234
+ /**
235
+ * `remoteAgent` 等待远端流式输出的超时(毫秒)。默认 30000。
236
+ */
237
+ remoteAgentStreamTimeoutMs?: number;
238
+ /** 本节点 ID(用于 `spawnAgent` / `remoteAgent` 的 `detailRef.nodeId`)。未设时 spawn 使用 `"local"`。 */
239
+ localNodeId?: string;
240
+ /** `askQuestion` 阻塞前回调(可将 questionId 推送到 IM / UI,供 `resolveQuestion` RPC 回填)。 */
241
+ notifyAskQuestion?(payload: {
242
+ questionId: string;
243
+ question: string;
244
+ conversationId?: string;
245
+ inputType?: 'single-select' | 'multi-select' | 'text';
246
+ options?: Array<{
247
+ label: string;
248
+ description?: string;
249
+ }>;
250
+ allowFreeform?: boolean;
251
+ }): void;
252
+ }
253
+ /** Tool implementation: (args, context) => result. Context is bound at registration time. */
254
+ type BuiltinToolImpl = (arguments_: Record<string, unknown>, context: BuiltinToolContext) => Promise<unknown> | AsyncIterable<unknown>;
255
+
256
+ interface ToolExecutionDriver {
257
+ execute(operation: ToolOperationResource, options?: {
258
+ signal?: AbortSignal;
259
+ /** Required by managed routes; ignored by legacy narrow drivers. */
260
+ actor?: ControlStoreActor;
261
+ leaseEpoch?: string;
262
+ }): Promise<ToolOperationResource>;
263
+ }
264
+ type ToolOperationApprovalDecision = ToolOperationApprovalEvidence;
265
+ interface ToolOperationApprovalRequest {
266
+ operation: ToolOperationResource;
267
+ /** Trusted policy explanation; never interpreted as authority by itself. */
268
+ reason?: string;
269
+ signal?: AbortSignal;
270
+ }
271
+ /** Host-owned approval boundary. Implementations bind authenticated users and durable audit. */
272
+ interface ToolOperationApprovalBroker {
273
+ requestApproval(request: ToolOperationApprovalRequest): Promise<ToolOperationApprovalDecision>;
274
+ }
275
+ interface InProcessToolExecutionDriverOptions {
276
+ context: BuiltinToolContext;
277
+ /**
278
+ * Host-bound trusted admission policy. Enforced before approval checks and
279
+ * tool lookup; the model, scripts, and agent configuration cannot override
280
+ * it. Denied operations fail with `FORBIDDEN` and are still audited.
281
+ */
282
+ admission?: ToolAdmissionPolicy;
283
+ approvalBroker?: ToolOperationApprovalBroker;
284
+ auditor?: (operation: ToolOperationResource, result: ToolOperationResult) => Promise<void> | void;
285
+ maxOutputLength?: number;
286
+ }
287
+ declare function createInProcessToolExecutionDriver(registry: IToolRegistry, options: InProcessToolExecutionDriverOptions): ToolExecutionDriver;
288
+
289
+ interface DriverManifest {
290
+ name: string;
291
+ version: string;
292
+ kind: InfrastructureDriverType;
293
+ capabilities: Record<string, boolean | string | number>;
294
+ supportsCancellation: boolean;
295
+ supportsBackpressure: boolean;
296
+ supportsAdoption: boolean;
297
+ supportsFencing: boolean;
298
+ }
299
+ interface DriverConformanceTest {
300
+ name: string;
301
+ description: string;
302
+ run: (driver: unknown) => Promise<void>;
303
+ }
304
+ interface DriverConformanceSuite {
305
+ interfaceKind: DriverManifest['kind'];
306
+ tests: DriverConformanceTest[];
307
+ }
308
+ interface FakeDriverOptions {
309
+ latencyMs?: number;
310
+ failureRate?: number;
311
+ supportsCancellation?: boolean;
312
+ supportsBackpressure?: boolean;
313
+ supportsAdoption?: boolean;
314
+ supportsFencing?: boolean;
315
+ }
316
+ /**
317
+ * Create a fake network driver for conformance testing.
318
+ */
319
+ declare function createFakeNetworkDriver(options?: FakeDriverOptions): NetworkDriver;
320
+ /**
321
+ * Create a fake model provider driver for conformance testing.
322
+ */
323
+ declare function createFakeModelProviderDriver(options?: FakeDriverOptions): ModelProviderDriver;
324
+ /**
325
+ * Create a fake tool execution driver for conformance testing.
326
+ */
327
+ declare function createFakeToolExecutionDriver(options?: FakeDriverOptions): ToolExecutionDriver;
328
+ /**
329
+ * Run a conformance suite against a driver.
330
+ */
331
+ declare function runConformanceSuite(suite: DriverConformanceSuite, driver: unknown): Promise<{
332
+ passed: number;
333
+ failed: number;
334
+ failures: Array<{
335
+ name: string;
336
+ error: string;
337
+ }>;
338
+ }>;
339
+ /**
340
+ * Standard conformance tests for network drivers.
341
+ */
342
+ declare function createNetworkDriverConformanceSuite(): DriverConformanceSuite;
343
+ /**
344
+ * Standard conformance tests for model provider drivers.
345
+ */
346
+ declare function createModelProviderDriverConformanceSuite(): DriverConformanceSuite;
347
+ /**
348
+ * Standard conformance tests for tool execution drivers.
349
+ */
350
+ declare function createToolExecutionDriverConformanceSuite(): DriverConformanceSuite;
351
+ /**
352
+ * Standard lifecycle and crash-adoption contract for optional external
353
+ * orchestrators. Resource factories keep backend-specific runtime-image
354
+ * annotations out of portable core while allowing this exact suite to run
355
+ * against Swarm, Kubernetes, and future plugins.
356
+ */
357
+ declare function createExternalOrchestrationDriverConformanceSuite(options: {
358
+ createWorkload: (name: string) => AgentWorkloadResource;
359
+ createToolOperation: (name: string) => ToolOperationResource;
360
+ actor?: ControlStoreActor;
361
+ }): DriverConformanceSuite;
362
+
363
+ declare const DRIVER_REQUEST_API_VERSION = "drivers.memeloop.io/v1alpha1";
364
+ interface DriverRequestEnvelope<TPayload = unknown> {
365
+ apiVersion: typeof DRIVER_REQUEST_API_VERSION;
366
+ method: string;
367
+ resource: {
368
+ apiVersion: string;
369
+ kind: string;
370
+ name: string;
371
+ uid: string;
372
+ generation: number;
373
+ };
374
+ run?: {
375
+ uid: string;
376
+ attempt: number;
377
+ };
378
+ fencingEpoch?: number;
379
+ requestId: string;
380
+ idempotencyKey: string;
381
+ deadline: string;
382
+ actor: ControlStoreActor;
383
+ session?: {
384
+ id: string;
385
+ keyFingerprint?: string;
386
+ };
387
+ capabilityHandleRef?: string;
388
+ trace: {
389
+ traceId: string;
390
+ spanId: string;
391
+ parentSpanId?: string;
392
+ };
393
+ payloadSchemaDigest: string;
394
+ payload: TPayload;
395
+ }
396
+ /** Stable JSON-compatible representation used when a host binds a digest or idempotency key. */
397
+ declare function canonicalDriverValue(value: unknown): string;
398
+ /**
399
+ * Validate the common §10 driver request envelope before a driver interprets
400
+ * its payload. Unknown top-level fields and newer versions fail closed so an
401
+ * old driver cannot silently weaken policy.
402
+ */
403
+ declare function assertDriverRequestEnvelope<TPayload = unknown>(value: unknown, options?: {
404
+ now?: () => Date;
405
+ maxFutureDeadlineMs?: number;
406
+ requireRun?: boolean;
407
+ requireFencing?: boolean;
408
+ requireCapability?: boolean;
409
+ expectedMethod?: string;
410
+ }): asserts value is DriverRequestEnvelope<TPayload>;
411
+
412
+ interface CredentialManagementCapabilities {
413
+ name: string;
414
+ supportsRenewal: boolean;
415
+ supportsProofOfPossession: boolean;
416
+ supportsMaterialization: boolean;
417
+ supportedExposures: CredentialIssuePayload['exposure'][];
418
+ maxTtlMs: number;
419
+ persistence: 'process' | 'host' | 'external';
420
+ threatAssumptions: string[];
421
+ }
422
+ interface CredentialIssuePayload {
423
+ runRef: {
424
+ apiVersion: string;
425
+ kind: string;
426
+ name: string;
427
+ uid: string;
428
+ };
429
+ workerKey: string;
430
+ target: string;
431
+ targetMethod: string;
432
+ targetDriver: string;
433
+ audience: string;
434
+ policyDigest: string;
435
+ ttlMs: number;
436
+ exposure: 'none' | 'worker-visible' | 'potentially-exposed';
437
+ }
438
+ interface ManagedCredentialGrant {
439
+ grantHandle: string;
440
+ resourceUid: string;
441
+ runUid: string;
442
+ attempt: number;
443
+ workerKey: string;
444
+ target: string;
445
+ targetMethod: string;
446
+ targetDriver: string;
447
+ audience: string;
448
+ policyDigest: string;
449
+ issuedAt: string;
450
+ expiresAt: string;
451
+ revoked: boolean;
452
+ exposure: CredentialIssuePayload['exposure'];
453
+ rotationRequired: boolean;
454
+ }
455
+ interface ManagedCredentialMaterialization {
456
+ materializationHandle: string;
457
+ grantHandle: string;
458
+ resourceUid: string;
459
+ targetDriver: string;
460
+ expiresAt: string;
461
+ }
462
+ /** §10.7 broker surface. No method returns raw credential material. */
463
+ interface CredentialManagementDriver {
464
+ getCapabilities(): Promise<CredentialManagementCapabilities>;
465
+ issue(request: DriverRequestEnvelope<CredentialIssuePayload>): Promise<ManagedCredentialGrant>;
466
+ renew(request: DriverRequestEnvelope<{
467
+ grantHandle: string;
468
+ ttlMs: number;
469
+ }>): Promise<ManagedCredentialGrant>;
470
+ revoke(request: DriverRequestEnvelope<{
471
+ grantHandle: string;
472
+ }>): Promise<void>;
473
+ inspect(request: DriverRequestEnvelope<{
474
+ grantHandle: string;
475
+ }>): Promise<ManagedCredentialGrant | undefined>;
476
+ materialize(request: DriverRequestEnvelope<{
477
+ grantHandle: string;
478
+ targetDriver: string;
479
+ proof: {
480
+ challengeId: string;
481
+ signature: string;
482
+ };
483
+ }>): Promise<ManagedCredentialMaterialization>;
484
+ }
485
+ interface FakeCredentialManagementState {
486
+ grants: Map<string, ManagedCredentialGrant>;
487
+ materializations: Map<string, ManagedCredentialMaterialization>;
488
+ idempotency: Map<string, string>;
489
+ fences: Map<string, number>;
490
+ consumedChallenges: Set<string>;
491
+ nextHandle: number;
492
+ }
493
+ declare function createFakeCredentialManagementState(): FakeCredentialManagementState;
494
+ /** Durable-state reference broker used by the portable conformance harness. */
495
+ declare function createFakeCredentialManagementDriver(options?: {
496
+ state?: FakeCredentialManagementState;
497
+ now?: () => Date;
498
+ maxTtlMs?: number;
499
+ }): CredentialManagementDriver;
500
+ declare function createCredentialManagementConformanceSuite(options: {
501
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string): DriverRequestEnvelope<T>;
502
+ recreate(driver: CredentialManagementDriver): CredentialManagementDriver;
503
+ }): DriverConformanceSuite;
504
+
505
+ /**
506
+ * ModelAccessHandle: a short-lived opaque credential issued by a trusted
507
+ * CredentialBroker. It authorizes model calls through a ModelGateway without
508
+ * ever handing the worker a provider API key. The handle binds the Run,
509
+ * attempt, worker proof-of-possession key, model, audience, policy digest,
510
+ * budgets, and expiry. Handles must never be written to logs, checkpoints,
511
+ * status, or resource specs.
512
+ */
513
+ interface ModelAccessHandleBudget {
514
+ maxInputTokens?: number;
515
+ maxOutputTokens?: number;
516
+ maxCost?: number;
517
+ currency?: string;
518
+ maxConcurrent?: number;
519
+ }
520
+ interface ModelAccessHandleClaims {
521
+ handleId: string;
522
+ runRef?: {
523
+ apiVersion: string;
524
+ kind: string;
525
+ name: string;
526
+ uid?: string;
527
+ };
528
+ attempt?: number;
529
+ /** Fingerprint of the worker's ephemeral public key (proof-of-possession binding). */
530
+ workerKey?: string;
531
+ modelClassRef: {
532
+ apiVersion: string;
533
+ kind: string;
534
+ name: string;
535
+ };
536
+ modelDigest?: string;
537
+ /** Gateway/endpoint audience this handle is valid for. */
538
+ audience: string;
539
+ /** Digest of the admission/policy snapshot the handle was issued under. */
540
+ policyDigest?: string;
541
+ budget?: ModelAccessHandleBudget;
542
+ issuedAt: string;
543
+ expiresAt: string;
544
+ }
545
+ interface ModelAccessHandle {
546
+ /** Opaque token presented to the gateway. */
547
+ token: string;
548
+ claims: ModelAccessHandleClaims;
549
+ }
550
+ interface IssueModelAccessHandleRequest {
551
+ handleId?: string;
552
+ runRef?: ModelAccessHandleClaims['runRef'];
553
+ attempt?: number;
554
+ workerKey?: string;
555
+ modelClassRef: ModelAccessHandleClaims['modelClassRef'];
556
+ modelDigest?: string;
557
+ policyDigest?: string;
558
+ budget?: ModelAccessHandleBudget;
559
+ /** Lifetime override in milliseconds; capped by the broker's max TTL. */
560
+ ttlMs?: number;
561
+ }
562
+ /**
563
+ * Injectable crypto port. Core stays platform-neutral; Node hosts plug in an
564
+ * HMAC/Ed25519 implementation, tests use fakes.
565
+ */
566
+ interface ModelHandleSigner {
567
+ sign(payload: Uint8Array): Promise<Uint8Array>;
568
+ verify(payload: Uint8Array, signature: Uint8Array): Promise<boolean>;
569
+ }
570
+ interface ModelAccessHandleBroker {
571
+ issueModelAccessHandle(request: IssueModelAccessHandleRequest): Promise<ModelAccessHandle>;
572
+ verifyModelAccessHandle(token: string, options?: VerifyModelAccessHandleOptions): Promise<ModelAccessHandleClaims>;
573
+ /**
574
+ * Revoke a handle by id (e.g. on Run cancellation or worker compromise).
575
+ * Verification of a revoked handle fails with FORBIDDEN before expiry.
576
+ */
577
+ revokeModelAccessHandle(handleId: string): void;
578
+ }
579
+ interface VerifyModelAccessHandleOptions {
580
+ /** Required audience; defaults to the broker's own audience. */
581
+ audience?: string;
582
+ /** Presented worker key fingerprint; must match the claim when the claim exists. */
583
+ workerKey?: string;
584
+ now?: () => Date;
585
+ }
586
+ declare function base64UrlEncode(bytes: Uint8Array): string;
587
+ declare function base64UrlDecode(value: string): Uint8Array;
588
+ interface InMemoryModelAccessHandleBrokerOptions {
589
+ signer: ModelHandleSigner;
590
+ /** Gateway audience handles are issued for and verified against. */
591
+ audience: string;
592
+ /** Default TTL when the request does not specify one (default 15min). */
593
+ defaultTtlMs?: number;
594
+ /** Hard cap on any requested TTL (default 60min). */
595
+ maxTtlMs?: number;
596
+ now?: () => Date;
597
+ }
598
+ /**
599
+ * In-memory reference CredentialBroker for model access. Suitable for tests
600
+ * and single-process hosts; multi-node deployments replace it with a broker
601
+ * backed by the control plane's signing key (see plan 24.34/24.35).
602
+ */
603
+ declare function createInMemoryModelAccessHandleBroker(options: InMemoryModelAccessHandleBrokerOptions): ModelAccessHandleBroker;
604
+
605
+ /**
606
+ * CredentialGrant broker contract (plan 24.46).
607
+ *
608
+ * Generalizes the ModelAccessHandle pattern to arbitrary scoped credentials
609
+ * (tool operations, SSH, cloud APIs, model access). Every grant is bound to
610
+ * Run/attempt/worker key/target/method/audience/policy digest/expiry, and the
611
+ * broker records exposure and post-task rotation requirements. Grants resolve
612
+ * to opaque handles; raw secret material never appears here — the broker only
613
+ * signs and verifies scoped claims.
614
+ */
615
+ interface CredentialGrantScope {
616
+ runRef: {
617
+ apiVersion: string;
618
+ kind: string;
619
+ name: string;
620
+ uid: string;
621
+ };
622
+ attempt: number;
623
+ /** Fingerprint of the worker's ephemeral public key (proof-of-possession binding). */
624
+ workerKey: string;
625
+ target: string;
626
+ method: string;
627
+ audience: string;
628
+ policyDigest: string;
629
+ }
630
+ interface CredentialGrantProof {
631
+ /** Broker-issued, one-time challenge identifier. */
632
+ challengeId: string;
633
+ signature: Uint8Array;
634
+ }
635
+ interface CredentialProofVerifier {
636
+ /** Verify the worker signature and atomically consume the challenge. */
637
+ verifyAndConsume(request: {
638
+ workerKey: string;
639
+ grantId: string;
640
+ audience: string;
641
+ proof: CredentialGrantProof;
642
+ }): Promise<boolean>;
643
+ }
644
+ interface CredentialGrantVerification extends CredentialGrantScope {
645
+ proof: CredentialGrantProof;
646
+ }
647
+ interface CredentialGrantClaims extends CredentialGrantScope {
648
+ grantId: string;
649
+ issuedAt: string;
650
+ expiresAt: string;
651
+ renewedAt?: string;
652
+ }
653
+ interface CredentialGrantHandle {
654
+ /** Opaque token presented to the target driver. */
655
+ token: string;
656
+ claims: CredentialGrantClaims;
657
+ }
658
+ interface CredentialGrantInspection {
659
+ grantId: string;
660
+ scope: CredentialGrantScope;
661
+ issuedAt: string;
662
+ expiresAt: string;
663
+ revoked: boolean;
664
+ expired: boolean;
665
+ /** Exposure assessment used to decide post-task rotation. */
666
+ exposure: 'none' | 'worker-visible' | 'potentially-exposed';
667
+ rotationRequired: boolean;
668
+ rotationReason?: string;
669
+ }
670
+ interface IssueCredentialGrantRequest extends CredentialGrantScope {
671
+ grantId?: string;
672
+ ttlMs?: number;
673
+ }
674
+ interface CredentialBrokerDriver {
675
+ issue(request: IssueCredentialGrantRequest): Promise<CredentialGrantHandle>;
676
+ /** Renew an unexpired, unrevoked grant; returns a new token with a fresh expiry. */
677
+ renew(token: string, options?: {
678
+ ttlMs?: number;
679
+ now?: () => Date;
680
+ }): Promise<CredentialGrantHandle>;
681
+ revoke(grantId: string): void;
682
+ inspect(token: string): Promise<CredentialGrantInspection>;
683
+ /** Verify the token's entire scope and the worker's proof of possession. */
684
+ verify(token: string, requirements: CredentialGrantVerification): Promise<CredentialGrantClaims>;
685
+ }
686
+ interface InMemoryCredentialBrokerOptions {
687
+ signer: ModelHandleSigner;
688
+ proofVerifier: CredentialProofVerifier;
689
+ defaultTtlMs?: number;
690
+ maxTtlMs?: number;
691
+ now?: () => Date;
692
+ }
693
+ declare function createInMemoryCredentialBroker(options: InMemoryCredentialBrokerOptions): CredentialBrokerDriver;
694
+
695
+ interface ArtifactManagementCapabilities {
696
+ name: string;
697
+ maxArtifactBytes: number;
698
+ supportsStreaming: boolean;
699
+ supportsScan: boolean;
700
+ supportsSanitize: boolean;
701
+ supportsVerify: boolean;
702
+ supportsMount: boolean;
703
+ inspectionIsolation: 'none' | 'process' | 'namespace' | 'container' | 'external';
704
+ persistence: 'process' | 'host' | 'external';
705
+ threatAssumptions: string[];
706
+ }
707
+ interface ArtifactPutPayload {
708
+ expectedContentHash?: string;
709
+ mimeType: string;
710
+ trust: ArtifactTrust;
711
+ producerRunUid?: string;
712
+ parentContentHashes?: string[];
713
+ maxBytes: number;
714
+ }
715
+ interface ManagedArtifact {
716
+ artifactHandle: string;
717
+ resourceUid: string;
718
+ contentHash: string;
719
+ sizeBytes: number;
720
+ mimeType: string;
721
+ trust: ArtifactTrust;
722
+ parentContentHashes: string[];
723
+ reviews: ArtifactReviewEvidence[];
724
+ quarantined: boolean;
725
+ quarantineReason?: string;
726
+ promotedDestinations: ArtifactDestination[];
727
+ createdAt: string;
728
+ }
729
+ interface ManagedArtifactMount {
730
+ mountHandle: string;
731
+ artifactHandle: string;
732
+ resourceUid: string;
733
+ destination: ArtifactDestination;
734
+ readOnly: true;
735
+ }
736
+ interface ArtifactInspectionInput {
737
+ bytes: Uint8Array;
738
+ contentHash: string;
739
+ mimeType: string;
740
+ }
741
+ interface ArtifactSanitizationResult {
742
+ bytes: Uint8Array;
743
+ mimeType: string;
744
+ properties: string[];
745
+ }
746
+ /**
747
+ * Host-owned hostile-content inspection boundary. Production implementations
748
+ * run this port outside the controller process and apply their own resource
749
+ * and parser limits.
750
+ */
751
+ interface ArtifactInspector {
752
+ scan(input: ArtifactInspectionInput): Promise<string[]>;
753
+ sanitize(input: ArtifactInspectionInput): Promise<ArtifactSanitizationResult>;
754
+ verify(input: ArtifactInspectionInput, properties: string[]): Promise<boolean>;
755
+ }
756
+ interface ArtifactManagementDriver {
757
+ getCapabilities(): Promise<ArtifactManagementCapabilities>;
758
+ put(request: DriverRequestEnvelope<ArtifactPutPayload>, content: AsyncIterable<Uint8Array>): Promise<ManagedArtifact>;
759
+ resolve(request: DriverRequestEnvelope<{
760
+ contentHash: string;
761
+ }>): Promise<ManagedArtifact | undefined>;
762
+ read(request: DriverRequestEnvelope<{
763
+ artifactHandle: string;
764
+ }>): AsyncIterable<Uint8Array>;
765
+ scan(request: DriverRequestEnvelope<{
766
+ artifactHandle: string;
767
+ policyDigest: string;
768
+ destinations: ArtifactDestination[];
769
+ }>): Promise<ArtifactReviewEvidence>;
770
+ sanitize(request: DriverRequestEnvelope<{
771
+ artifactHandle: string;
772
+ outputResource: {
773
+ uid: string;
774
+ name: string;
775
+ generation: number;
776
+ };
777
+ policyDigest: string;
778
+ destinations: ArtifactDestination[];
779
+ }>): Promise<ManagedArtifact>;
780
+ verify(request: DriverRequestEnvelope<{
781
+ artifactHandle: string;
782
+ policyDigest: string;
783
+ destinations: ArtifactDestination[];
784
+ properties: string[];
785
+ }>): Promise<ArtifactReviewEvidence>;
786
+ promote(request: DriverRequestEnvelope<{
787
+ artifactHandle: string;
788
+ destination: ArtifactDestination;
789
+ }>): Promise<ManagedArtifact>;
790
+ quarantine(request: DriverRequestEnvelope<{
791
+ artifactHandle: string;
792
+ reason: string;
793
+ }>): Promise<ManagedArtifact>;
794
+ mount(request: DriverRequestEnvelope<{
795
+ artifactHandle: string;
796
+ destination: ArtifactDestination;
797
+ }>): Promise<ManagedArtifactMount>;
798
+ unmount(request: DriverRequestEnvelope<{
799
+ mountHandle: string;
800
+ }>): Promise<void>;
801
+ delete(request: DriverRequestEnvelope<{
802
+ artifactHandle: string;
803
+ }>): Promise<void>;
804
+ }
805
+ interface ArtifactRecord {
806
+ descriptor: ManagedArtifact;
807
+ bytes: Uint8Array;
808
+ }
809
+ interface FakeArtifactManagementState {
810
+ artifacts: Map<string, ArtifactRecord>;
811
+ byContentHash: Map<string, Map<string, string>>;
812
+ mounts: Map<string, ManagedArtifactMount>;
813
+ idempotency: Map<string, string>;
814
+ fences: Map<string, number>;
815
+ nextMount: number;
816
+ }
817
+ declare function createFakeArtifactManagementState(): FakeArtifactManagementState;
818
+ interface ArtifactManagementStateSnapshot {
819
+ version: 1;
820
+ artifacts: Array<{
821
+ descriptor: ManagedArtifact;
822
+ bytesHex: string;
823
+ }>;
824
+ mounts: ManagedArtifactMount[];
825
+ idempotency: Array<[string, string]>;
826
+ fences: Array<[string, number]>;
827
+ nextMount: number;
828
+ }
829
+ /** JSON-safe snapshot for a trusted host store; content hashes are rechecked on restore. */
830
+ declare function snapshotArtifactManagementState(state: FakeArtifactManagementState): ArtifactManagementStateSnapshot;
831
+ /** Restore only structurally valid state; every content digest is verified. */
832
+ declare function restoreArtifactManagementState(snapshot: ArtifactManagementStateSnapshot): Promise<FakeArtifactManagementState>;
833
+ /** Stateful content-addressed reference driver with bounded hostile-input handling. */
834
+ declare function createFakeArtifactManagementDriver(options?: {
835
+ state?: FakeArtifactManagementState;
836
+ now?: () => Date;
837
+ maxArtifactBytes?: number;
838
+ reviewer?: string;
839
+ destinationPolicies?: Partial<Record<ArtifactDestination, ArtifactDestinationPolicy>>;
840
+ inspector?: ArtifactInspector;
841
+ capabilities?: Partial<ArtifactManagementCapabilities>;
842
+ }): ArtifactManagementDriver;
843
+ declare function createArtifactManagementConformanceSuite(options: {
844
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string): DriverRequestEnvelope<T>;
845
+ recreate(driver: ArtifactManagementDriver): ArtifactManagementDriver;
846
+ }): DriverConformanceSuite;
847
+
848
+ type AuditTelemetryRecordKind = 'audit' | 'event' | 'metric' | 'trace';
849
+ type AuditEffect = 'read' | 'create' | 'update' | 'delete' | 'execute' | 'decision' | 'security';
850
+ interface AuditTelemetryCapabilities {
851
+ name: string;
852
+ recordKinds: AuditTelemetryRecordKind[];
853
+ appendOnly: true;
854
+ trustedReceiverTime: true;
855
+ tamperEvident: true;
856
+ maxRecordsPerResource: number;
857
+ maxAttributes: number;
858
+ persistence: 'process' | 'host' | 'external';
859
+ threatAssumptions: string[];
860
+ }
861
+ interface AuditProvenance {
862
+ source: 'controller' | 'gateway' | 'driver' | 'worker' | 'operator';
863
+ producer: string;
864
+ subject?: string;
865
+ }
866
+ interface AuditTelemetryRecord {
867
+ sequence: number;
868
+ recordHandle: string;
869
+ resourceUid: string;
870
+ kind: AuditTelemetryRecordKind;
871
+ receivedAt: string;
872
+ actor: {
873
+ id: string;
874
+ kind: 'controller' | 'verifier' | 'admin';
875
+ };
876
+ policyDigest: string;
877
+ capabilityDigest: string;
878
+ effect: AuditEffect;
879
+ provenance: AuditProvenance;
880
+ attributes: Record<string, string>;
881
+ data: {
882
+ kind: 'audit';
883
+ action: string;
884
+ outcome: 'success' | 'denied' | 'failure';
885
+ reasonCode?: string;
886
+ } | {
887
+ kind: 'event';
888
+ name: string;
889
+ severity: 'debug' | 'info' | 'warning' | 'error' | 'critical';
890
+ } | {
891
+ kind: 'metric';
892
+ name: string;
893
+ value: number;
894
+ unit: string;
895
+ } | {
896
+ kind: 'trace';
897
+ name: string;
898
+ traceId: string;
899
+ spanId: string;
900
+ durationMs: number;
901
+ status: 'ok' | 'error';
902
+ };
903
+ previousDigest?: string;
904
+ recordDigest: string;
905
+ }
906
+ interface CommonRecordPayload {
907
+ policyDigest: string;
908
+ effect: AuditEffect;
909
+ provenance: AuditProvenance;
910
+ attributes?: Record<string, string>;
911
+ }
912
+ interface AuditTelemetryManagementDriver {
913
+ getCapabilities(): Promise<AuditTelemetryCapabilities>;
914
+ appendAudit(request: DriverRequestEnvelope<CommonRecordPayload & {
915
+ action: string;
916
+ outcome: 'success' | 'denied' | 'failure';
917
+ reasonCode?: string;
918
+ }>): Promise<AuditTelemetryRecord>;
919
+ emitEvent(request: DriverRequestEnvelope<CommonRecordPayload & {
920
+ name: string;
921
+ severity: 'debug' | 'info' | 'warning' | 'error' | 'critical';
922
+ }>): Promise<AuditTelemetryRecord>;
923
+ emitMetric(request: DriverRequestEnvelope<CommonRecordPayload & {
924
+ name: string;
925
+ value: number;
926
+ unit: string;
927
+ }>): Promise<AuditTelemetryRecord>;
928
+ emitTrace(request: DriverRequestEnvelope<CommonRecordPayload & {
929
+ name: string;
930
+ traceId: string;
931
+ spanId: string;
932
+ durationMs: number;
933
+ status: 'ok' | 'error';
934
+ }>): Promise<AuditTelemetryRecord>;
935
+ readRecords(request: DriverRequestEnvelope<{
936
+ afterSequence?: number;
937
+ limit: number;
938
+ kinds?: AuditTelemetryRecordKind[];
939
+ }>): Promise<{
940
+ records: AuditTelemetryRecord[];
941
+ chainHead?: string;
942
+ }>;
943
+ }
944
+ interface FakeAuditTelemetryState {
945
+ records: AuditTelemetryRecord[];
946
+ idempotency: Map<string, number>;
947
+ idempotencyFingerprints: Map<string, string>;
948
+ fences: Map<string, number>;
949
+ appendTail: Promise<void>;
950
+ }
951
+ declare function createFakeAuditTelemetryState(): FakeAuditTelemetryState;
952
+ /**
953
+ * Durable-state, append-only reference sink. It deliberately accepts only
954
+ * bounded metadata, never arbitrary log payloads or worker-supplied timestamps.
955
+ */
956
+ declare function createFakeAuditTelemetryManagementDriver(options?: {
957
+ state?: FakeAuditTelemetryState;
958
+ now?: () => Date;
959
+ maxRecordsPerResource?: number;
960
+ maxAttributes?: number;
961
+ }): AuditTelemetryManagementDriver;
962
+ declare function createAuditTelemetryConformanceSuite(options: {
963
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string, actorKind?: 'controller' | 'verifier' | 'admin'): DriverRequestEnvelope<T>;
964
+ recreate(driver: AuditTelemetryManagementDriver): AuditTelemetryManagementDriver;
965
+ createQuotaDriver(): AuditTelemetryManagementDriver;
966
+ }): DriverConformanceSuite;
967
+
968
+ interface ControlStoreConformanceFactory {
969
+ create(): ControlStore | Promise<ControlStore>;
970
+ actor: ControlStoreActor;
971
+ snapshotTarget(testName: string): string | Promise<string>;
972
+ prefix?: string;
973
+ }
974
+ /**
975
+ * Backend-neutral §10.1 contract. Every test creates an isolated client/store
976
+ * instance so the exact same suite can run against Quorum, SQLite, and etcd.
977
+ */
978
+ declare function createControlStoreConformanceSuite(factory: ControlStoreConformanceFactory): DriverConformanceSuite;
979
+
980
+ type PolicyDecisionKind = 'resource-admission' | 'placement' | 'tool-operation' | 'approval' | 'transition';
981
+ type PolicyDecisionOutcome = 'allow' | 'deny' | 'pending';
982
+ interface PolicyApprovalCapabilities {
983
+ name: string;
984
+ decisions: PolicyDecisionKind[];
985
+ defaultOutcome: 'deny';
986
+ supportsDurableApproval: boolean;
987
+ supportsExplanation: boolean;
988
+ persistence: 'process' | 'host' | 'external';
989
+ threatAssumptions: string[];
990
+ }
991
+ interface PolicyDecision {
992
+ decisionHandle: string;
993
+ resourceUid: string;
994
+ kind: PolicyDecisionKind;
995
+ outcome: PolicyDecisionOutcome;
996
+ policyDigest: string;
997
+ inputDigest: string;
998
+ actorId: string;
999
+ reasons: string[];
1000
+ obligations: string[];
1001
+ decidedAt: string;
1002
+ approval?: {
1003
+ subjectDigest: string;
1004
+ requestedBy: string;
1005
+ requestedAt: string;
1006
+ expiresAt: string;
1007
+ decidedBy?: string;
1008
+ resolvedAt?: string;
1009
+ resolutionInputDigest?: string;
1010
+ };
1011
+ }
1012
+ interface PolicyExplanation {
1013
+ decision: PolicyDecision;
1014
+ summary: string;
1015
+ }
1016
+ interface PolicyApprovalManagementDriver {
1017
+ getCapabilities(): Promise<PolicyApprovalCapabilities>;
1018
+ admitResource(request: DriverRequestEnvelope<{
1019
+ policyDigest: string;
1020
+ resourceApiVersion: string;
1021
+ resourceKind: string;
1022
+ }>): Promise<PolicyDecision>;
1023
+ authorizePlacement(request: DriverRequestEnvelope<{
1024
+ policyDigest: string;
1025
+ nodeId: string;
1026
+ nodeTrustClass: NodeTrustClass;
1027
+ requiredTrustClass: NodeTrustClass;
1028
+ attested: boolean;
1029
+ driverConformancePassed: boolean;
1030
+ }>): Promise<PolicyDecision>;
1031
+ authorizeToolOperation(request: DriverRequestEnvelope<{
1032
+ policyDigest: string;
1033
+ toolName: string;
1034
+ effect: ToolOperationEffect;
1035
+ operationDigest: string;
1036
+ approvalDecisionHandle?: string;
1037
+ }>): Promise<PolicyDecision>;
1038
+ requestApproval(request: DriverRequestEnvelope<{
1039
+ policyDigest: string;
1040
+ subjectKind: 'tool-operation' | 'resource' | 'placement' | 'transition';
1041
+ subjectDigest: string;
1042
+ reason: string;
1043
+ ttlMs: number;
1044
+ }>): Promise<PolicyDecision>;
1045
+ resolveApproval(request: DriverRequestEnvelope<{
1046
+ approvalDecisionHandle: string;
1047
+ outcome: 'allow' | 'deny';
1048
+ reason: string;
1049
+ }>): Promise<PolicyDecision>;
1050
+ verifyTransition(request: DriverRequestEnvelope<{
1051
+ policyDigest: string;
1052
+ transition: string;
1053
+ from: string;
1054
+ to: string;
1055
+ evidenceDigest: string;
1056
+ }>): Promise<PolicyDecision>;
1057
+ explainDecision(request: DriverRequestEnvelope<{
1058
+ decisionHandle: string;
1059
+ }>): Promise<PolicyExplanation>;
1060
+ }
1061
+ interface FakePolicyApprovalState {
1062
+ decisions: Map<string, PolicyDecision>;
1063
+ idempotency: Map<string, string>;
1064
+ idempotencyFingerprints: Map<string, string>;
1065
+ fences: Map<string, number>;
1066
+ nextHandle: number;
1067
+ }
1068
+ declare function createFakePolicyApprovalState(): FakePolicyApprovalState;
1069
+ /**
1070
+ * Deterministic, durable-state policy reference. Its allow rules are explicit
1071
+ * constructor-owned configuration; request payloads can never grant authority.
1072
+ */
1073
+ declare function createFakePolicyApprovalManagementDriver(options?: {
1074
+ state?: FakePolicyApprovalState;
1075
+ now?: () => Date;
1076
+ admittedResourceTypes?: Array<{
1077
+ apiVersion: string;
1078
+ kind: string;
1079
+ }>;
1080
+ allowedTools?: string[];
1081
+ allowedTransitions?: string[];
1082
+ }): PolicyApprovalManagementDriver;
1083
+ declare function createPolicyApprovalConformanceSuite(options: {
1084
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string, actorKind?: 'controller' | 'verifier' | 'admin'): DriverRequestEnvelope<T>;
1085
+ recreate(driver: PolicyApprovalManagementDriver): PolicyApprovalManagementDriver;
1086
+ }): DriverConformanceSuite;
1087
+
1088
+ type IdentityDomain = 'enrollment' | 'workload' | 'device' | 'control-plane';
1089
+ interface IdentityAttestationCapabilities {
1090
+ name: string;
1091
+ identityDomains: IdentityDomain[];
1092
+ attestationFormats: string[];
1093
+ supportsProofOfPossession: boolean;
1094
+ supportsChannelBinding: boolean;
1095
+ supportsRotation: boolean;
1096
+ maxChallengeTtlMs: number;
1097
+ maxSessionTtlMs: number;
1098
+ persistence: 'process' | 'host' | 'external';
1099
+ threatAssumptions: string[];
1100
+ }
1101
+ interface IdentityEnrollment {
1102
+ enrollmentHandle: string;
1103
+ resourceUid: string;
1104
+ domain: IdentityDomain;
1105
+ subject: string;
1106
+ trustClass: NodeTrustClass;
1107
+ bootstrapKeyFingerprint: string;
1108
+ expiresAt: string;
1109
+ consumed: boolean;
1110
+ revoked: boolean;
1111
+ }
1112
+ interface IdentityChallenge {
1113
+ challengeHandle: string;
1114
+ enrollmentHandle: string;
1115
+ resourceUid: string;
1116
+ nonce: string;
1117
+ channelBinding: string;
1118
+ expiresAt: string;
1119
+ consumed: boolean;
1120
+ }
1121
+ interface AttestedIdentity {
1122
+ identityHandle: string;
1123
+ resourceUid: string;
1124
+ domain: IdentityDomain;
1125
+ subject: string;
1126
+ trustClass: NodeTrustClass;
1127
+ keyFingerprint: string;
1128
+ channelBinding: string;
1129
+ attestationFormat: string;
1130
+ evidenceDigest: string;
1131
+ issuedAt: string;
1132
+ rotatedAt?: string;
1133
+ revoked: boolean;
1134
+ revokeReason?: string;
1135
+ }
1136
+ interface IdentitySession {
1137
+ sessionHandle: string;
1138
+ identityHandle: string;
1139
+ resourceUid: string;
1140
+ domain: IdentityDomain;
1141
+ audience: string;
1142
+ channelBinding: string;
1143
+ issuedAt: string;
1144
+ expiresAt: string;
1145
+ revoked: boolean;
1146
+ }
1147
+ type IdentityInspection = {
1148
+ kind: 'enrollment';
1149
+ value: IdentityEnrollment;
1150
+ } | {
1151
+ kind: 'challenge';
1152
+ value: IdentityChallenge;
1153
+ } | {
1154
+ kind: 'identity';
1155
+ value: AttestedIdentity;
1156
+ } | {
1157
+ kind: 'session';
1158
+ value: IdentitySession;
1159
+ };
1160
+ interface IdentityAttestationManagementDriver {
1161
+ getCapabilities(): Promise<IdentityAttestationCapabilities>;
1162
+ enroll(request: DriverRequestEnvelope<{
1163
+ domain: IdentityDomain;
1164
+ subject: string;
1165
+ trustClass: NodeTrustClass;
1166
+ bootstrapKeyFingerprint: string;
1167
+ ttlMs: number;
1168
+ }>): Promise<IdentityEnrollment>;
1169
+ challenge(request: DriverRequestEnvelope<{
1170
+ enrollmentHandle: string;
1171
+ channelBinding: string;
1172
+ ttlMs: number;
1173
+ }>): Promise<IdentityChallenge>;
1174
+ attest(request: DriverRequestEnvelope<{
1175
+ challengeHandle: string;
1176
+ publicKeyFingerprint: string;
1177
+ channelBinding: string;
1178
+ attestation: {
1179
+ format: string;
1180
+ evidenceDigest: string;
1181
+ };
1182
+ proof: string;
1183
+ }>): Promise<AttestedIdentity>;
1184
+ issueSession(request: DriverRequestEnvelope<{
1185
+ identityHandle: string;
1186
+ domain: IdentityDomain;
1187
+ audience: string;
1188
+ channelBinding: string;
1189
+ ttlMs: number;
1190
+ }>): Promise<IdentitySession>;
1191
+ rotate(request: DriverRequestEnvelope<{
1192
+ identityHandle: string;
1193
+ newKeyFingerprint: string;
1194
+ channelBinding: string;
1195
+ proof: string;
1196
+ }>): Promise<AttestedIdentity>;
1197
+ revoke(request: DriverRequestEnvelope<{
1198
+ identityHandle: string;
1199
+ reason: string;
1200
+ }>): Promise<AttestedIdentity>;
1201
+ inspect(request: DriverRequestEnvelope<{
1202
+ handle: string;
1203
+ }>): Promise<IdentityInspection | undefined>;
1204
+ }
1205
+ interface FakeIdentityAttestationState {
1206
+ enrollments: Map<string, IdentityEnrollment>;
1207
+ challenges: Map<string, IdentityChallenge>;
1208
+ identities: Map<string, AttestedIdentity>;
1209
+ sessions: Map<string, IdentitySession>;
1210
+ idempotency: Map<string, string>;
1211
+ idempotencyFingerprints: Map<string, string>;
1212
+ fences: Map<string, number>;
1213
+ nextHandle: number;
1214
+ }
1215
+ declare function createFakeIdentityAttestationState(): FakeIdentityAttestationState;
1216
+ /** Durable-state deterministic reference identity and attestation driver. */
1217
+ declare function createFakeIdentityAttestationManagementDriver(options?: {
1218
+ state?: FakeIdentityAttestationState;
1219
+ now?: () => Date;
1220
+ maxChallengeTtlMs?: number;
1221
+ maxSessionTtlMs?: number;
1222
+ allowedEvidenceDigests?: string[];
1223
+ }): IdentityAttestationManagementDriver;
1224
+ declare function createIdentityAttestationConformanceSuite(options: {
1225
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string, actorKind?: 'controller' | 'verifier' | 'admin'): DriverRequestEnvelope<T>;
1226
+ recreate(driver: IdentityAttestationManagementDriver): IdentityAttestationManagementDriver;
1227
+ }): DriverConformanceSuite;
1228
+
1229
+ interface LoopRuntimeCapabilities {
1230
+ name: string;
1231
+ isolation: Array<'none' | 'process' | 'container' | 'wasm' | 'remote'>;
1232
+ supportedTrustClasses: NodeTrustClass[];
1233
+ supportsCheckpoint: boolean;
1234
+ supportsRestore: boolean;
1235
+ supportsAdoption: boolean;
1236
+ persistence: 'none' | 'process' | 'host' | 'external';
1237
+ threatAssumptions: string[];
1238
+ }
1239
+ interface LoopRuntimePreparePayload {
1240
+ runtimeClass: string;
1241
+ runtimeDigest: string;
1242
+ scriptDigest?: string;
1243
+ isolation: LoopRuntimeCapabilities['isolation'][number];
1244
+ trustClass: NodeTrustClass;
1245
+ }
1246
+ interface LoopRuntimePrepared {
1247
+ preparationHandle: string;
1248
+ }
1249
+ interface LoopRuntimeStartPayload {
1250
+ preparationHandle: string;
1251
+ }
1252
+ interface ManagedLoopRunStatus {
1253
+ runHandle: string;
1254
+ resourceUid: string;
1255
+ phase: 'Prepared' | 'Running' | 'Completed' | 'Failed' | 'Cancelled';
1256
+ fencingEpoch: number;
1257
+ updatedAt: string;
1258
+ summary?: string;
1259
+ error?: {
1260
+ code: string;
1261
+ message: string;
1262
+ retryable: boolean;
1263
+ };
1264
+ }
1265
+ interface LoopRuntimeCheckpoint {
1266
+ checkpointHandle: string;
1267
+ runHandle: string;
1268
+ resourceUid: string;
1269
+ createdAt: string;
1270
+ }
1271
+ interface LoopRuntimeManagementDriver {
1272
+ getCapabilities(): Promise<LoopRuntimeCapabilities>;
1273
+ prepare(request: DriverRequestEnvelope<LoopRuntimePreparePayload>): Promise<LoopRuntimePrepared>;
1274
+ start(request: DriverRequestEnvelope<LoopRuntimeStartPayload>): Promise<ManagedLoopRunStatus>;
1275
+ watch(request: DriverRequestEnvelope<{
1276
+ runHandle: string;
1277
+ }>): AsyncIterable<ManagedLoopRunStatus>;
1278
+ checkpoint(request: DriverRequestEnvelope<{
1279
+ runHandle: string;
1280
+ }>): Promise<LoopRuntimeCheckpoint>;
1281
+ restore(request: DriverRequestEnvelope<{
1282
+ checkpointHandle: string;
1283
+ }>): Promise<ManagedLoopRunStatus>;
1284
+ cancel(request: DriverRequestEnvelope<{
1285
+ runHandle: string;
1286
+ }>): Promise<ManagedLoopRunStatus>;
1287
+ inspect(request: DriverRequestEnvelope<{
1288
+ runHandle: string;
1289
+ }>): Promise<ManagedLoopRunStatus | undefined>;
1290
+ adopt(request: DriverRequestEnvelope<{
1291
+ runHandle: string;
1292
+ }>): Promise<ManagedLoopRunStatus>;
1293
+ delete(request: DriverRequestEnvelope<{
1294
+ runHandle: string;
1295
+ }>): Promise<void>;
1296
+ }
1297
+ interface PreparationRecord {
1298
+ handle: string;
1299
+ resourceUid: string;
1300
+ fence: number;
1301
+ }
1302
+ interface FakeLoopRuntimeState {
1303
+ preparations: Map<string, PreparationRecord>;
1304
+ runs: Map<string, ManagedLoopRunStatus>;
1305
+ checkpoints: Map<string, LoopRuntimeCheckpoint>;
1306
+ idempotency: Map<string, string>;
1307
+ fences: Map<string, number>;
1308
+ nextHandle: number;
1309
+ }
1310
+ declare function createFakeLoopRuntimeState(): FakeLoopRuntimeState;
1311
+ /**
1312
+ * Stateful portable reference driver. Supplying the same state to a new
1313
+ * instance simulates a driver-host restart and makes adoption testable.
1314
+ */
1315
+ declare function createFakeLoopRuntimeManagementDriver(options?: {
1316
+ state?: FakeLoopRuntimeState;
1317
+ now?: () => Date;
1318
+ }): LoopRuntimeManagementDriver;
1319
+ declare function createLoopRuntimeManagementConformanceSuite(options: {
1320
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string): DriverRequestEnvelope<T>;
1321
+ recreate(driver: LoopRuntimeManagementDriver): LoopRuntimeManagementDriver;
1322
+ }): DriverConformanceSuite;
1323
+
1324
+ interface ManagedCredentialAdapterStateStore {
1325
+ get(key: string): Promise<unknown>;
1326
+ put(key: string, value: unknown): Promise<void>;
1327
+ delete(key: string): Promise<void>;
1328
+ }
1329
+ interface ManagedCredentialBrokerAdapterOptions {
1330
+ name: string;
1331
+ maxTtlMs: number;
1332
+ now?: () => Date;
1333
+ /**
1334
+ * Resolve the verified grant inside a trusted target driver. The returned
1335
+ * value must be an opaque reference, never raw credential material.
1336
+ */
1337
+ materialize(claims: CredentialGrantClaims, targetDriver: string): Promise<string>;
1338
+ revokeMaterialization?(handle: string): Promise<void>;
1339
+ authorizeRequest(request: DriverRequestEnvelope): boolean | Promise<boolean>;
1340
+ /**
1341
+ * Trusted host storage for restart adoption. The signed token never enters
1342
+ * ControlStore; Electron/Node hosts can back this with their credential vault.
1343
+ */
1344
+ handleStore?: {
1345
+ get(stableHandle: string): Promise<CredentialGrantHandle | undefined>;
1346
+ put(stableHandle: string, handle: CredentialGrantHandle): Promise<void>;
1347
+ delete(stableHandle: string): Promise<void>;
1348
+ };
1349
+ /** Durable non-secret fencing, idempotency, and materialization metadata. */
1350
+ stateStore?: ManagedCredentialAdapterStateStore;
1351
+ stableHandleFor?(request: DriverRequestEnvelope<CredentialIssuePayload>): string;
1352
+ threatAssumptions: string[];
1353
+ }
1354
+ /**
1355
+ * Adapts the existing signed CredentialBroker to the managed protocol.
1356
+ * Host persistence requires both the secret handleStore and a non-secret
1357
+ * stateStore. A token vault alone can recover a token but cannot preserve
1358
+ * fencing, idempotency, or target-materialization revocation metadata.
1359
+ */
1360
+ declare function createManagedCredentialBrokerAdapter(broker: CredentialBrokerDriver, options: ManagedCredentialBrokerAdapterOptions): CredentialManagementDriver;
1361
+
1362
+ /**
1363
+ * Loop Runtime Driver (plan §10.2, Phase 4.2).
1364
+ *
1365
+ * The cognition-plane counterpart of the tool execution driver (24.28): a
1366
+ * LoopRuntimeDriver starts an AgentLoopRun-equivalent execution for a bound
1367
+ * AgentWorkload and reports a terminal outcome. The in-process
1368
+ * implementation runs the loop in the current process through the existing
1369
+ * profile/script machinery — the same contracts apply as for remote drivers
1370
+ * (no authorization bypass; scripts re-pass the host load gate on import).
1371
+ */
1372
+ interface LoopRunStartRequest {
1373
+ /** Bound workload being executed. */
1374
+ workload: AgentWorkloadResource;
1375
+ /** AgentRun resource tracking this attempt. */
1376
+ run: AgentRunResource;
1377
+ /** Fenced ModelEndpoint selected independently for this run. */
1378
+ modelEndpoint?: ModelEndpointResource;
1379
+ /** Independently bound and prepared network attachment for this run. */
1380
+ networkAttachment?: NetworkAttachmentResource;
1381
+ /** Ephemeral host-resolved mounts; never persisted in ControlStore. */
1382
+ volumeMounts?: Array<{
1383
+ name: string;
1384
+ mountPath: string;
1385
+ readOnly: boolean;
1386
+ }>;
1387
+ /**
1388
+ * Script source resolved by the host for `spec.scriptReference` workloads.
1389
+ * The driver re-admits it through the host script load gate before import.
1390
+ */
1391
+ scriptSource?: string;
1392
+ /** Message delivered to the loop as its input. */
1393
+ message?: string;
1394
+ }
1395
+ interface LoopRunOutcome {
1396
+ phase: 'Completed' | 'Failed' | 'Cancelled';
1397
+ summary?: string;
1398
+ error?: {
1399
+ code: string;
1400
+ message: string;
1401
+ retryable: boolean;
1402
+ };
1403
+ }
1404
+ interface LoopRunHandle {
1405
+ /** Terminal outcome of the run. */
1406
+ wait(): Promise<LoopRunOutcome>;
1407
+ /** Request cancellation; the loop observes it through the cancellation set. */
1408
+ cancel(): Promise<void>;
1409
+ }
1410
+ interface LoopRuntimeDriver {
1411
+ start(request: LoopRunStartRequest): Promise<LoopRunHandle>;
1412
+ }
1413
+ interface InProcessLoopRuntimeDriverOptions {
1414
+ /**
1415
+ * Resolve a provider for an independently placed endpoint. Downstream hosts
1416
+ * use this port for remote ModelGateway transports. Returning undefined
1417
+ * fails closed.
1418
+ */
1419
+ resolveModelProvider?: (endpoint: ModelEndpointResource, request: LoopRunStartRequest) => Promise<ILLMProvider | undefined>;
1420
+ }
1421
+ /**
1422
+ * In-process LoopRuntimeDriver: executes profile workloads through the
1423
+ * definition store and script workloads through a synthesized AgentAgent
1424
+ * profile whose source was resolved (and admitted) upstream.
1425
+ */
1426
+ declare function createInProcessLoopRuntimeDriver(context: AgentFrameworkContext, options?: InProcessLoopRuntimeDriverOptions): LoopRuntimeDriver;
1427
+ interface RuntimeClassRoutingDriverOptions {
1428
+ /**
1429
+ * Driver for profile workloads and for script workloads whose RuntimeClass
1430
+ * declares `isolation: 'none'`.
1431
+ */
1432
+ inProcessDriver: LoopRuntimeDriver;
1433
+ /**
1434
+ * Driver for script workloads whose RuntimeClass declares
1435
+ * `isolation: 'process'` (all built-in classes do). When absent, such
1436
+ * workloads fail closed with UNSUPPORTED rather than silently running
1437
+ * in-process (plan 24.18: declared isolation must be real).
1438
+ */
1439
+ processDriver?: LoopRuntimeDriver;
1440
+ /** RuntimeClass specs by name (defaults to the built-in classes). */
1441
+ runtimeClasses?: Record<string, RuntimeClassSpec>;
1442
+ }
1443
+ /**
1444
+ * Route a bound workload to the driver that honors its declared RuntimeClass
1445
+ * isolation. Unknown or missing classes fail closed — admission (plan 24.18)
1446
+ * assigns a RuntimeClass before scheduling, and there is no silent fallback
1447
+ * to a weaker isolation level.
1448
+ */
1449
+ declare function createRuntimeClassRoutingDriver(options: RuntimeClassRoutingDriverOptions): LoopRuntimeDriver;
1450
+
1451
+ interface ManagedLoopRuntimeExecutionRouteOptions extends Omit<ManagedLoopRuntimeAdapterOptions, 'resolveStartRequest'> {
1452
+ createPreparePayload(request: LoopRunStartRequest): LoopRuntimePreparePayload;
1453
+ createRequest<T>(request: LoopRunStartRequest, method: string, payload: T): DriverRequestEnvelope<T>;
1454
+ }
1455
+ interface ManagedLoopRuntimeExecutionRoute {
1456
+ /** Existing controller-facing facade; every effect traverses management. */
1457
+ executionDriver: LoopRuntimeDriver;
1458
+ /** Complete management surface for host discovery and direct inspection. */
1459
+ managementDriver: LoopRuntimeManagementDriver;
1460
+ }
1461
+ interface ManagedLoopRuntimeAdapterOptions {
1462
+ capabilities: LoopRuntimeCapabilities;
1463
+ resolveStartRequest(request: DriverRequestEnvelope<LoopRuntimePreparePayload>): Promise<LoopRunStartRequest>;
1464
+ now?: () => Date;
1465
+ requireCapability?: boolean;
1466
+ /** Trusted host verifier for the opaque capability on every lifecycle call. */
1467
+ authorizeRequest?: (request: DriverRequestEnvelope) => boolean | Promise<boolean>;
1468
+ }
1469
+ /**
1470
+ * Adapt the production narrow execution facade to the complete management
1471
+ * protocol without overstating crash/checkpoint support. Live handles remain
1472
+ * host-memory state, so adoption, checkpoint and restore fail UNSUPPORTED.
1473
+ */
1474
+ declare function createManagedLoopRuntimeAdapter(executionDriver: LoopRuntimeDriver, options: ManagedLoopRuntimeAdapterOptions): LoopRuntimeManagementDriver;
1475
+ /**
1476
+ * Route the existing controller-facing execution facade through the complete
1477
+ * managed protocol without persisting ephemeral launch material in resources.
1478
+ */
1479
+ declare function createManagedLoopRuntimeExecutionRoute(executionDriver: LoopRuntimeDriver, options: ManagedLoopRuntimeExecutionRouteOptions): ManagedLoopRuntimeExecutionRoute;
1480
+
1481
+ /**
1482
+ * ModelGateway (plan §12, §21.3): the trusted model path.
1483
+ *
1484
+ * The gateway holds no provider credential itself — it guards an
1485
+ * `ModelGatewayExecutor` (host-provided, e.g. the legacy provider adapter)
1486
+ * that performs the actual call with host-held keys. Workers present a
1487
+ * short-lived `ModelAccessHandle` (24.34) instead of a provider key; the
1488
+ * gateway verifies Run/model/audience/expiry/proof-of-possession and
1489
+ * enforces per-Run token, cost, concurrency, and request-rate budgets at
1490
+ * the gateway (§12.4 — not only in the worker). Every call produces a
1491
+ * `ModelCallRecord` (24.32) via the injected recorder.
1492
+ *
1493
+ * Secret discipline (§12.4): handle tokens, prompts, and model output are
1494
+ * never written to records, logs, or thrown error details.
1495
+ */
1496
+ interface ModelGatewayGenerateRequest extends ModelGenerateRequest {
1497
+ /** Opaque ModelAccessHandle token presented by the caller. Never recorded. */
1498
+ accessHandle: string;
1499
+ /** Presented worker key fingerprint for the proof-of-possession check. */
1500
+ workerKey?: string;
1501
+ }
1502
+ interface ModelGatewayCallRecord {
1503
+ /** ModelCallRecord correlation id (ModelGenerateRequest.callId). */
1504
+ callId: string;
1505
+ spec: ModelCallRecordSpec;
1506
+ status: ModelCallRecordStatus;
1507
+ }
1508
+ /** Audit port; hosts persist ModelCallRecord resources (e.g. ControlStore). */
1509
+ interface ModelGatewayRecorder {
1510
+ recordCall(record: ModelGatewayCallRecord): Promise<void> | void;
1511
+ }
1512
+ /** Performs the actual provider call with host-held credentials. */
1513
+ interface ModelGatewayExecutor {
1514
+ listModels?(): Promise<ModelClassSpec[]>;
1515
+ getHealth?(): Promise<ModelProviderHealth>;
1516
+ generate(request: ModelGenerateRequest): AsyncIterable<ModelStreamChunk>;
1517
+ cancel?(callId: string): Promise<void>;
1518
+ }
1519
+ interface ModelGatewayOptions {
1520
+ /** Handle issuer/verifier (24.34). */
1521
+ broker: ModelAccessHandleBroker;
1522
+ /** Host provider executor holding the real credentials. */
1523
+ executor: ModelGatewayExecutor;
1524
+ /** Audit recorder for ModelCallRecords; recording failures never break calls. */
1525
+ recorder?: ModelGatewayRecorder;
1526
+ /** Host-asserted caller identity stamped on records (never self-reported). */
1527
+ caller?: string;
1528
+ /** Required handle audience (defaults to the broker's audience). */
1529
+ audience?: string;
1530
+ /** Cost charged per token (input + output) when the stream reports usage. */
1531
+ costPerToken?: number;
1532
+ /** Currency stamped on recorded usage. */
1533
+ currency?: string;
1534
+ /** Sliding-window request rate limit per handle (requests/second). */
1535
+ maxRequestsPerSecond?: number;
1536
+ /** Sink for non-fatal gateway errors (e.g. recorder failures). */
1537
+ onError?: (error: unknown) => void;
1538
+ now?: () => Date;
1539
+ }
1540
+ interface ModelGateway {
1541
+ listModels(): Promise<ModelClassSpec[]>;
1542
+ getHealth(): Promise<ModelProviderHealth>;
1543
+ generate(request: ModelGatewayGenerateRequest): AsyncIterable<ModelStreamChunk>;
1544
+ /** Abort an in-flight call (e.g. Run cancellation). */
1545
+ cancel(callId: string): Promise<void>;
1546
+ /** Revoke a handle immediately (Run completion, cancellation, policy change). */
1547
+ revokeHandle(handleId: string): void;
1548
+ /** Revoke every handle the gateway has verified for the given Run name. */
1549
+ revokeRunHandles(runName: string): void;
1550
+ }
1551
+ declare function createModelGateway(options: ModelGatewayOptions): ModelGateway;
1552
+
1553
+ interface GatewayMediatedLLMProviderOptions {
1554
+ gateway: ModelGateway;
1555
+ broker: ModelAccessHandleBroker;
1556
+ /** ModelClass the loops are bound to; handles are issued for this model. */
1557
+ modelClassRef: ModelAccessHandleClaims['modelClassRef'];
1558
+ modelDigest?: string;
1559
+ /** Admission/policy snapshot digest bound into every issued handle. */
1560
+ policyDigest?: string;
1561
+ /** Worker key fingerprint bound into issued handles (PoP). */
1562
+ workerKey?: string;
1563
+ /** Static Run binding, or derive one per chat request (e.g. workload runs). */
1564
+ runRef?: ModelAccessHandleClaims['runRef'];
1565
+ /** Immutable AgentRun attempt bound into issued handles. */
1566
+ attempt?: number;
1567
+ runRefForRequest?: (request: unknown) => ModelAccessHandleClaims['runRef'] | undefined;
1568
+ /** Budget stamped into every issued handle (enforced at the gateway). */
1569
+ budget?: ModelAccessHandleBudget;
1570
+ /** Per-call handle TTL in milliseconds (broker default applies when unset). */
1571
+ handleTtlMs?: number;
1572
+ /** Display name/model for the ILLMProvider surface. */
1573
+ name?: string;
1574
+ modelId?: string;
1575
+ model?: unknown;
1576
+ /** Customize callId derivation (default: conversationId + sequence). */
1577
+ callIdForRequest?: (request: unknown, sequence: number) => string;
1578
+ }
1579
+ /**
1580
+ * Route legacy loop model calls through the ModelGateway (plan §12.1, 24.35):
1581
+ * loops keep the `ILLMProvider` surface, but every `chat()` issues a
1582
+ * short-lived handle, streams through the gateway's verification, budget
1583
+ * enforcement, and audit, and revokes the handle when the call ends (§12.1
1584
+ * step 6). No provider key exists on this path by construction.
1585
+ */
1586
+ declare function createGatewayMediatedLLMProvider(options: GatewayMediatedLLMProviderOptions): ILLMProvider;
1587
+
1588
+ interface ManagedModelDescriptor {
1589
+ modelClass: string;
1590
+ provider: string;
1591
+ model: string;
1592
+ digest: string;
1593
+ modalities: Array<'text' | 'image' | 'audio' | 'video' | 'embedding'>;
1594
+ contextWindow: number;
1595
+ residency: string[];
1596
+ mode: 'local' | 'broker';
1597
+ maxInputClassification: DataClassification;
1598
+ outputClassification: DataClassification;
1599
+ inputTrust: 'untrusted' | 'sanitized' | 'trusted';
1600
+ outputTrust: 'untrusted' | 'sanitized' | 'trusted';
1601
+ inputCostPerMillion?: number;
1602
+ outputCostPerMillion?: number;
1603
+ }
1604
+ interface ModelManagementCapabilities {
1605
+ name: string;
1606
+ streaming: boolean;
1607
+ cancellation: boolean;
1608
+ usageEstimation: boolean;
1609
+ maxConcurrentCalls: number;
1610
+ maxOutputTokens: number;
1611
+ persistence: 'process' | 'host' | 'external';
1612
+ threatAssumptions: string[];
1613
+ }
1614
+ interface ManagedModelRequest {
1615
+ modelClass: string;
1616
+ modelDigest: string;
1617
+ messages: Array<{
1618
+ role: 'system' | 'user' | 'assistant' | 'tool';
1619
+ content: string;
1620
+ }>;
1621
+ maxOutputTokens: number;
1622
+ temperature?: number;
1623
+ inputClassification: DataClassification;
1624
+ residency?: string;
1625
+ }
1626
+ interface ManagedModelEstimate {
1627
+ inputTokens: number;
1628
+ maximumOutputTokens: number;
1629
+ maximumCost: number;
1630
+ }
1631
+ interface ManagedModelUsage {
1632
+ callHandle: string;
1633
+ resourceUid: string;
1634
+ modelClass: string;
1635
+ modelDigest: string;
1636
+ phase: 'Running' | 'Completed' | 'Cancelled' | 'Failed';
1637
+ inputTokens: number;
1638
+ outputTokens: number;
1639
+ cost: number;
1640
+ fencingEpoch: number;
1641
+ updatedAt: string;
1642
+ }
1643
+ type ManagedModelChunk = {
1644
+ type: 'started';
1645
+ callHandle: string;
1646
+ } | {
1647
+ type: 'delta';
1648
+ delta: string;
1649
+ } | {
1650
+ type: 'usage';
1651
+ inputTokens: number;
1652
+ outputTokens: number;
1653
+ cost: number;
1654
+ } | {
1655
+ type: 'error';
1656
+ error: {
1657
+ code: string;
1658
+ message: string;
1659
+ retryable: boolean;
1660
+ };
1661
+ } | {
1662
+ type: 'done';
1663
+ };
1664
+ /** Complete §10.4 provider lifecycle; the capability is in the host envelope. */
1665
+ interface ModelManagementDriver {
1666
+ getCapabilities(): Promise<ModelManagementCapabilities>;
1667
+ listModels(request: DriverRequestEnvelope<Record<string, never>>): Promise<ManagedModelDescriptor[]>;
1668
+ estimate(request: DriverRequestEnvelope<ManagedModelRequest>): Promise<ManagedModelEstimate>;
1669
+ generate(request: DriverRequestEnvelope<ManagedModelRequest>, options?: {
1670
+ signal?: AbortSignal;
1671
+ }): AsyncIterable<ManagedModelChunk>;
1672
+ cancel(request: DriverRequestEnvelope<{
1673
+ callHandle: string;
1674
+ }>): Promise<ManagedModelUsage>;
1675
+ inspectUsage(request: DriverRequestEnvelope<{
1676
+ callHandle: string;
1677
+ }>): Promise<ManagedModelUsage | undefined>;
1678
+ getHealth(request: DriverRequestEnvelope<Record<string, never>>): Promise<{
1679
+ healthy: boolean;
1680
+ checkedAt: string;
1681
+ detail?: string;
1682
+ }>;
1683
+ }
1684
+ interface ModelCallRecord {
1685
+ usage: ManagedModelUsage;
1686
+ chunks: ManagedModelChunk[];
1687
+ inputFingerprint: string;
1688
+ capabilityHandleRef: string;
1689
+ sessionKeyFingerprint?: string;
1690
+ }
1691
+ interface FakeModelManagementState {
1692
+ calls: Map<string, ModelCallRecord>;
1693
+ idempotency: Map<string, string>;
1694
+ fences: Map<string, number>;
1695
+ nextHandle: number;
1696
+ }
1697
+ declare function createFakeModelManagementState(): FakeModelManagementState;
1698
+ declare function createFakeModelManagementDriver(options?: {
1699
+ state?: FakeModelManagementState;
1700
+ now?: () => Date;
1701
+ models?: ManagedModelDescriptor[];
1702
+ authorizeAccess?: (request: DriverRequestEnvelope, model: ManagedModelDescriptor) => boolean | Promise<boolean>;
1703
+ generateText?: (request: ManagedModelRequest, signal?: AbortSignal) => AsyncIterable<string>;
1704
+ capabilities?: Partial<ModelManagementCapabilities>;
1705
+ }): ModelManagementDriver;
1706
+ declare function createModelManagementConformanceSuite(options: {
1707
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string): DriverRequestEnvelope<T>;
1708
+ recreate(driver: ModelManagementDriver): ModelManagementDriver;
1709
+ }): DriverConformanceSuite;
1710
+
1711
+ interface ManagedModelGatewayAccess {
1712
+ /** Opaque signed token presented only to ModelGateway; never retained by the adapter. */
1713
+ token: string;
1714
+ /** Presented proof-of-possession fingerprint when the signed handle requires one. */
1715
+ workerKey?: string;
1716
+ /** Non-secret digest that binds idempotency/inspection to the same authority. */
1717
+ authorityFingerprint: string;
1718
+ }
1719
+ interface ManagedModelGatewayAdapterOptions {
1720
+ models: ManagedModelDescriptor[];
1721
+ capabilities: ModelManagementCapabilities;
1722
+ /**
1723
+ * Verify the envelope capability against the selected model/Run/session and
1724
+ * return the already-authorized gateway token. Undefined means denial.
1725
+ */
1726
+ resolveAccess(request: DriverRequestEnvelope, model: ManagedModelDescriptor): Promise<ManagedModelGatewayAccess | undefined>;
1727
+ now?: () => Date;
1728
+ }
1729
+ /**
1730
+ * Adapt the real signed ModelGateway into the complete management protocol.
1731
+ * Stream/idempotency state is process-local, so crash adoption is not claimed.
1732
+ */
1733
+ declare function createManagedModelGatewayAdapter(gateway: ModelGateway, options: ManagedModelGatewayAdapterOptions): ModelManagementDriver;
1734
+
1735
+ interface NetworkManagementCapabilities {
1736
+ name: string;
1737
+ enforcedFeatures: NetworkEnforceableFeature[];
1738
+ enforcementLevel: NetworkEnforcementLevel;
1739
+ supportedTrustClasses: NodeTrustClass[];
1740
+ supportsPolicyUpdate: boolean;
1741
+ supportsServiceResolution: boolean;
1742
+ persistence: 'process' | 'host' | 'external';
1743
+ maxPolicyRules: number;
1744
+ threatAssumptions: string[];
1745
+ }
1746
+ interface ManagedNetworkPolicy {
1747
+ digest: string;
1748
+ dns?: {
1749
+ policy: 'default' | 'custom' | 'none';
1750
+ servers?: string[];
1751
+ };
1752
+ proxy?: {
1753
+ httpProxy?: string;
1754
+ httpsProxy?: string;
1755
+ noProxy?: string[];
1756
+ mandatory?: boolean;
1757
+ };
1758
+ ingress?: {
1759
+ defaultAction: 'allow' | 'deny';
1760
+ rules?: Array<{
1761
+ target: string;
1762
+ ports?: number[];
1763
+ protocol?: string;
1764
+ action?: 'allow' | 'deny';
1765
+ }>;
1766
+ };
1767
+ egress?: {
1768
+ defaultAction: 'allow' | 'deny';
1769
+ rules?: Array<{
1770
+ target: string;
1771
+ ports?: number[];
1772
+ protocol?: string;
1773
+ action?: 'allow' | 'deny';
1774
+ }>;
1775
+ };
1776
+ bandwidth?: {
1777
+ ingressKbps?: number;
1778
+ egressKbps?: number;
1779
+ };
1780
+ serviceAllowlist?: string[];
1781
+ dataClassification?: 'public' | 'internal' | 'confidential' | 'restricted';
1782
+ }
1783
+ interface NetworkPreparePayload {
1784
+ sandboxHandle: string;
1785
+ networkClass: string;
1786
+ networkClassDigest: string;
1787
+ requestedFeatures: NetworkEnforceableFeature[];
1788
+ minimumEnforcementLevel: NetworkEnforcementLevel;
1789
+ trustClass: NodeTrustClass;
1790
+ policy: ManagedNetworkPolicy;
1791
+ }
1792
+ interface ManagedNetworkStatus {
1793
+ networkHandle: string;
1794
+ resourceUid: string;
1795
+ phase: 'Ready' | 'Released';
1796
+ enforcementLevel: NetworkEnforcementLevel;
1797
+ verifiedFeatures: NetworkEnforceableFeature[];
1798
+ degradedFeatures: NetworkEnforceableFeature[];
1799
+ policyDigest: string;
1800
+ fencingEpoch: number;
1801
+ updatedAt: string;
1802
+ }
1803
+ interface ManagedServiceResolution {
1804
+ networkHandle: string;
1805
+ resourceUid: string;
1806
+ serviceName: string;
1807
+ serviceHandle: string;
1808
+ resolvedAt: string;
1809
+ }
1810
+ /** Complete §10.5 managed CNI-like surface. */
1811
+ interface NetworkManagementDriver {
1812
+ getCapabilities(): Promise<NetworkManagementCapabilities>;
1813
+ prepareNetwork(request: DriverRequestEnvelope<NetworkPreparePayload>): Promise<ManagedNetworkStatus>;
1814
+ checkNetwork(request: DriverRequestEnvelope<{
1815
+ networkHandle: string;
1816
+ }>): Promise<ManagedNetworkStatus | undefined>;
1817
+ resolveService(request: DriverRequestEnvelope<{
1818
+ networkHandle: string;
1819
+ serviceName: string;
1820
+ }>): Promise<ManagedServiceResolution>;
1821
+ updatePolicy(request: DriverRequestEnvelope<{
1822
+ networkHandle: string;
1823
+ requestedFeatures: NetworkEnforceableFeature[];
1824
+ minimumEnforcementLevel: NetworkEnforcementLevel;
1825
+ policy: ManagedNetworkPolicy;
1826
+ }>): Promise<ManagedNetworkStatus>;
1827
+ releaseNetwork(request: DriverRequestEnvelope<{
1828
+ networkHandle: string;
1829
+ }>): Promise<void>;
1830
+ }
1831
+ interface IdempotencyRecord {
1832
+ fingerprint: string;
1833
+ resultHandle: string;
1834
+ }
1835
+ interface FakeNetworkManagementState {
1836
+ networks: Map<string, ManagedNetworkStatus>;
1837
+ services: Map<string, ManagedServiceResolution>;
1838
+ idempotency: Map<string, IdempotencyRecord>;
1839
+ fences: Map<string, number>;
1840
+ nextHandle: number;
1841
+ }
1842
+ declare function createFakeNetworkManagementState(): FakeNetworkManagementState;
1843
+ declare function countManagedNetworkPolicyRules(policy: ManagedNetworkPolicy): number;
1844
+ declare function assertManagedNetworkPolicy(value: unknown): asserts value is ManagedNetworkPolicy;
1845
+ /** Fail closed on payload extensions so older drivers cannot ignore new policy fields. */
1846
+ declare function assertNetworkPreparePayload(value: unknown): asserts value is NetworkPreparePayload;
1847
+ declare function assertNetworkUpdatePayload(value: unknown): void;
1848
+ declare function createFakeNetworkManagementDriver(options?: {
1849
+ state?: FakeNetworkManagementState;
1850
+ now?: () => Date;
1851
+ capabilities?: Partial<NetworkManagementCapabilities>;
1852
+ }): NetworkManagementDriver;
1853
+ declare function createNetworkManagementConformanceSuite(options: {
1854
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string): DriverRequestEnvelope<T>;
1855
+ recreate(driver: NetworkManagementDriver): NetworkManagementDriver;
1856
+ }): DriverConformanceSuite;
1857
+
1858
+ interface ResolvedManagedNetworkRequest {
1859
+ attachRequest: NetworkAttachRequest;
1860
+ /** Digest independently calculated from the current NetworkClass desired state. */
1861
+ networkClassDigest: string;
1862
+ /** Digest independently calculated from the effective policy passed to the native driver. */
1863
+ policyDigest: string;
1864
+ }
1865
+ interface ManagedNetworkAdapterOptions {
1866
+ supportedTrustClasses: NodeTrustClass[];
1867
+ threatAssumptions: string[];
1868
+ maxPolicyRules: number;
1869
+ resolveAttachRequest(request: DriverRequestEnvelope<NetworkPreparePayload>): Promise<ResolvedManagedNetworkRequest>;
1870
+ verifyCapability(request: DriverRequestEnvelope): Promise<boolean> | boolean;
1871
+ now?: () => Date;
1872
+ }
1873
+ /**
1874
+ * Wrap a host's narrow CNI-like driver in the complete managed protocol.
1875
+ *
1876
+ * The wrapper deliberately advertises process persistence: native handles and
1877
+ * capability/fencing state cannot be adopted after a host process restart.
1878
+ */
1879
+ declare function createManagedNetworkAdapter(nativeDriver: NetworkDriver, options: ManagedNetworkAdapterOptions): NetworkManagementDriver;
1880
+
1881
+ interface StorageManagementCapabilities {
1882
+ name: string;
1883
+ controllerService: boolean;
1884
+ nodeService: boolean;
1885
+ accessModes: VolumeAccessMode[];
1886
+ supportsSnapshots: boolean;
1887
+ supportsExpansion: boolean;
1888
+ supportsReplication: boolean;
1889
+ supportsBackup: boolean;
1890
+ persistence: 'process' | 'host' | 'external';
1891
+ threatAssumptions: string[];
1892
+ }
1893
+ interface StorageProvisionPayload {
1894
+ capacityBytes: number;
1895
+ accessMode: VolumeAccessMode;
1896
+ storageClass: string;
1897
+ replicaCount: number;
1898
+ }
1899
+ interface ManagedVolume {
1900
+ volumeHandle: string;
1901
+ resourceUid: string;
1902
+ capacityBytes: number;
1903
+ accessMode: VolumeAccessMode;
1904
+ fencingEpoch: number;
1905
+ phase: 'Available' | 'Deleted';
1906
+ }
1907
+ interface ManagedVolumeSnapshot {
1908
+ snapshotHandle: string;
1909
+ volumeHandle: string;
1910
+ resourceUid: string;
1911
+ createdAt: string;
1912
+ }
1913
+ interface ManagedVolumeBackup {
1914
+ backupHandle: string;
1915
+ volumeHandle: string;
1916
+ resourceUid: string;
1917
+ createdAt: string;
1918
+ }
1919
+ interface ManagedReplicaHealth {
1920
+ volumeHandle: string;
1921
+ healthy: number;
1922
+ desired: number;
1923
+ rebuilding: boolean;
1924
+ checkedAt: string;
1925
+ }
1926
+ interface ManagedVolumeStage {
1927
+ stageHandle: string;
1928
+ volumeHandle: string;
1929
+ resourceUid: string;
1930
+ nodeId: string;
1931
+ }
1932
+ interface ManagedVolumePublication {
1933
+ publishHandle: string;
1934
+ stageHandle: string;
1935
+ resourceUid: string;
1936
+ workloadUid: string;
1937
+ readOnly: boolean;
1938
+ }
1939
+ interface ManagedVolumeStats {
1940
+ capacityBytes: number;
1941
+ usedBytes: number;
1942
+ availableBytes: number;
1943
+ }
1944
+ /** Complete §10.6 CSI-like controller and node management surface. */
1945
+ interface StorageManagementDriver {
1946
+ getCapabilities(): Promise<StorageManagementCapabilities>;
1947
+ provision(request: DriverRequestEnvelope<StorageProvisionPayload>): Promise<ManagedVolume>;
1948
+ deleteVolume(request: DriverRequestEnvelope<{
1949
+ volumeHandle: string;
1950
+ }>): Promise<void>;
1951
+ createSnapshot(request: DriverRequestEnvelope<{
1952
+ volumeHandle: string;
1953
+ }>): Promise<ManagedVolumeSnapshot>;
1954
+ restoreSnapshot(request: DriverRequestEnvelope<{
1955
+ snapshotHandle: string;
1956
+ capacityBytes?: number;
1957
+ }>): Promise<ManagedVolume>;
1958
+ expand(request: DriverRequestEnvelope<{
1959
+ volumeHandle: string;
1960
+ capacityBytes: number;
1961
+ }>): Promise<ManagedVolume>;
1962
+ getReplicaHealth(request: DriverRequestEnvelope<{
1963
+ volumeHandle: string;
1964
+ }>): Promise<ManagedReplicaHealth>;
1965
+ rebuildReplica(request: DriverRequestEnvelope<{
1966
+ volumeHandle: string;
1967
+ replicaCount: number;
1968
+ }>): Promise<ManagedReplicaHealth>;
1969
+ createBackup(request: DriverRequestEnvelope<{
1970
+ volumeHandle: string;
1971
+ }>): Promise<ManagedVolumeBackup>;
1972
+ stage(request: DriverRequestEnvelope<{
1973
+ volumeHandle: string;
1974
+ nodeId: string;
1975
+ }>): Promise<ManagedVolumeStage>;
1976
+ publish(request: DriverRequestEnvelope<{
1977
+ stageHandle: string;
1978
+ workloadUid: string;
1979
+ readOnly: boolean;
1980
+ }>): Promise<ManagedVolumePublication>;
1981
+ unpublish(request: DriverRequestEnvelope<{
1982
+ publishHandle: string;
1983
+ }>): Promise<void>;
1984
+ unstage(request: DriverRequestEnvelope<{
1985
+ stageHandle: string;
1986
+ }>): Promise<void>;
1987
+ getStats(request: DriverRequestEnvelope<{
1988
+ publishHandle: string;
1989
+ }>): Promise<ManagedVolumeStats>;
1990
+ }
1991
+ interface VolumeRecord {
1992
+ volume: ManagedVolume;
1993
+ desiredReplicas: number;
1994
+ }
1995
+ interface FakeStorageManagementState {
1996
+ volumes: Map<string, VolumeRecord>;
1997
+ snapshots: Map<string, ManagedVolumeSnapshot>;
1998
+ backups: Map<string, ManagedVolumeBackup>;
1999
+ stages: Map<string, ManagedVolumeStage>;
2000
+ publications: Map<string, ManagedVolumePublication>;
2001
+ idempotency: Map<string, string>;
2002
+ fences: Map<string, number>;
2003
+ nextHandle: number;
2004
+ }
2005
+ declare function createFakeStorageManagementState(): FakeStorageManagementState;
2006
+ /**
2007
+ * Stateful reference implementation. Reusing its state across instances
2008
+ * simulates a driver-host restart and proves that opaque handles remain
2009
+ * inspectable without relying on process memory.
2010
+ */
2011
+ declare function createFakeStorageManagementDriver(options?: {
2012
+ state?: FakeStorageManagementState;
2013
+ now?: () => Date;
2014
+ }): StorageManagementDriver;
2015
+ declare function createStorageManagementConformanceSuite(options: {
2016
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string): DriverRequestEnvelope<T>;
2017
+ recreate(driver: StorageManagementDriver): StorageManagementDriver;
2018
+ }): DriverConformanceSuite;
2019
+
2020
+ interface ManagedToolDescriptor {
2021
+ name: string;
2022
+ version: string;
2023
+ description: string;
2024
+ inputSchema: Record<string, unknown>;
2025
+ outputSchema: Record<string, unknown>;
2026
+ schemaDigest: string;
2027
+ effect: ToolOperationEffect;
2028
+ risk: ToolRiskLevel;
2029
+ targets: string[];
2030
+ supportsIdempotency: boolean;
2031
+ supportsFencing: boolean;
2032
+ supportsEvidence: boolean;
2033
+ }
2034
+ interface ToolCatalogSnapshot {
2035
+ catalogDigest: string;
2036
+ tools: ManagedToolDescriptor[];
2037
+ }
2038
+ interface ToolManagementCapabilities {
2039
+ name: string;
2040
+ supportsStreaming: boolean;
2041
+ supportsCancellation: boolean;
2042
+ supportsBackpressure: boolean;
2043
+ supportsUnknownEffectReconciliation: boolean;
2044
+ maxOutputBytes: number;
2045
+ maxOutputChunks: number;
2046
+ persistence: 'process' | 'host' | 'external';
2047
+ threatAssumptions: string[];
2048
+ }
2049
+ interface PreparedToolExecution {
2050
+ preparationHandle: string;
2051
+ resourceUid: string;
2052
+ toolName: string;
2053
+ version: string;
2054
+ schemaDigest: string;
2055
+ catalogDigest: string;
2056
+ target: string;
2057
+ effect: ToolOperationEffect;
2058
+ idempotencyKey?: string;
2059
+ cleaned: boolean;
2060
+ }
2061
+ interface AuthorizedToolExecution {
2062
+ authorizationHandle: string;
2063
+ preparationHandle: string;
2064
+ resourceUid: string;
2065
+ policyDecisionHandle: string;
2066
+ policyDigest: string;
2067
+ authorizedAt: string;
2068
+ expiresAt: string;
2069
+ }
2070
+ type ManagedToolExecutionPhase = 'Prepared' | 'Running' | 'Completed' | 'Failed' | 'Cancelled' | 'Unknown';
2071
+ interface ManagedToolExecution {
2072
+ executionHandle: string;
2073
+ preparationHandle: string;
2074
+ authorizationHandle: string;
2075
+ resourceUid: string;
2076
+ phase: ManagedToolExecutionPhase;
2077
+ startedAt?: string;
2078
+ completedAt?: string;
2079
+ outputBytes: number;
2080
+ outputChunks: number;
2081
+ error?: {
2082
+ code: string;
2083
+ message: string;
2084
+ };
2085
+ cleaned: boolean;
2086
+ }
2087
+ interface ManagedToolOutputChunk {
2088
+ executionHandle: string;
2089
+ index: number;
2090
+ data: string;
2091
+ final: boolean;
2092
+ }
2093
+ interface ManagedToolEvidence {
2094
+ evidenceHandle: string;
2095
+ executionHandle: string;
2096
+ resourceUid: string;
2097
+ outcome: ManagedToolExecutionPhase;
2098
+ outputDigest: string;
2099
+ recordedAt: string;
2100
+ }
2101
+ interface ToolManagementDriver {
2102
+ getCapabilities(): Promise<ToolManagementCapabilities>;
2103
+ discover(request: DriverRequestEnvelope<{
2104
+ namePrefix?: string;
2105
+ }>): Promise<ToolCatalogSnapshot>;
2106
+ describe(request: DriverRequestEnvelope<{
2107
+ name: string;
2108
+ version?: string;
2109
+ catalogDigest: string;
2110
+ }>): Promise<ManagedToolDescriptor | undefined>;
2111
+ prepare(request: DriverRequestEnvelope<{
2112
+ name: string;
2113
+ version: string;
2114
+ schemaDigest: string;
2115
+ catalogDigest: string;
2116
+ target: string;
2117
+ effect: ToolOperationEffect;
2118
+ operationIdempotencyKey?: string;
2119
+ }>): Promise<PreparedToolExecution>;
2120
+ authorize(request: DriverRequestEnvelope<{
2121
+ preparationHandle: string;
2122
+ policyDecisionHandle: string;
2123
+ policyDigest: string;
2124
+ ttlMs: number;
2125
+ }>): Promise<AuthorizedToolExecution>;
2126
+ invoke(request: DriverRequestEnvelope<{
2127
+ preparationHandle: string;
2128
+ authorizationHandle: string;
2129
+ arguments: Record<string, unknown>;
2130
+ }>, options?: {
2131
+ signal?: AbortSignal;
2132
+ }): AsyncIterable<ManagedToolOutputChunk>;
2133
+ inspect(request: DriverRequestEnvelope<{
2134
+ executionHandle?: string;
2135
+ preparationHandle?: string;
2136
+ }>): Promise<ManagedToolExecution | undefined>;
2137
+ reconcileUnknownEffect(request: DriverRequestEnvelope<{
2138
+ executionHandle: string;
2139
+ resultObserved: boolean;
2140
+ evidenceDigest?: string;
2141
+ }>): Promise<ManagedToolExecution>;
2142
+ collectEvidence(request: DriverRequestEnvelope<{
2143
+ executionHandle: string;
2144
+ }>): Promise<ManagedToolEvidence>;
2145
+ cleanup(request: DriverRequestEnvelope<{
2146
+ preparationHandle: string;
2147
+ executionHandle?: string;
2148
+ }>): Promise<void>;
2149
+ }
2150
+ interface FakeToolManagementState {
2151
+ preparations: Map<string, PreparedToolExecution>;
2152
+ authorizations: Map<string, AuthorizedToolExecution>;
2153
+ executions: Map<string, ManagedToolExecution>;
2154
+ outputs: Map<string, ManagedToolOutputChunk[]>;
2155
+ evidence: Map<string, ManagedToolEvidence>;
2156
+ idempotency: Map<string, string>;
2157
+ idempotencyFingerprints: Map<string, string>;
2158
+ fences: Map<string, number>;
2159
+ nextHandle: number;
2160
+ }
2161
+ declare function createFakeToolManagementState(): FakeToolManagementState;
2162
+ /**
2163
+ * Complete durable-state reference for the §10.3 lifecycle. Policy authority
2164
+ * is supplied by an injected trusted verifier, never by an `allow` payload.
2165
+ */
2166
+ declare function createFakeToolManagementDriver(options?: {
2167
+ state?: FakeToolManagementState;
2168
+ now?: () => Date;
2169
+ tools?: ManagedToolDescriptor[];
2170
+ verifyPolicyDecision?: (input: {
2171
+ handle: string;
2172
+ policyDigest: string;
2173
+ resourceUid: string;
2174
+ tool: ManagedToolDescriptor;
2175
+ target: string;
2176
+ }) => boolean | Promise<boolean>;
2177
+ executor?: (tool: ManagedToolDescriptor, target: string, arguments_: Record<string, unknown>, signal?: AbortSignal, resourceUid?: string) => AsyncIterable<string>;
2178
+ maxOutputBytes?: number;
2179
+ maxOutputChunks?: number;
2180
+ capabilities?: Partial<ToolManagementCapabilities>;
2181
+ }): ToolManagementDriver;
2182
+ declare function createToolManagementConformanceSuite(options: {
2183
+ createRequest<T>(method: string, payload: T, idempotencyKey: string, fencingEpoch?: number, resourceUid?: string, actorKind?: 'controller' | 'verifier' | 'admin'): DriverRequestEnvelope<T>;
2184
+ recreate(driver: ToolManagementDriver): ToolManagementDriver;
2185
+ }): DriverConformanceSuite;
2186
+ /**
2187
+ * Catalog discovery is a separately selectable manifest kind. Reuse only the
2188
+ * unified driver's catalog cases; execution evidence cannot admit a catalog.
2189
+ */
2190
+ declare function createToolCatalogConformanceSuite(options: Parameters<typeof createToolManagementConformanceSuite>[0]): DriverConformanceSuite;
2191
+
2192
+ export { type GatewayMediatedLLMProviderOptions as $, type ArtifactAdmissionDecision as A, type BuiltinToolContext as B, type ControlStoreConformanceFactory as C, type CredentialGrantProof as D, type CredentialGrantScope as E, type CredentialGrantVerification as F, type CredentialIssuePayload as G, type CredentialManagementCapabilities as H, type CredentialManagementDriver as I, type CredentialProofVerifier as J, DEFAULT_DESTINATION_POLICIES as K, DRIVER_REQUEST_API_VERSION as L, type DriverConformanceSuite as M, type DriverConformanceTest as N, type DriverManifest as O, type DriverRequestEnvelope as P, type FakeArtifactManagementState as Q, type FakeAuditTelemetryState as R, type FakeCredentialManagementState as S, type FakeDriverOptions as T, type FakeIdentityAttestationState as U, type FakeLoopRuntimeState as V, type FakeModelManagementState as W, type FakeNetworkManagementState as X, type FakePolicyApprovalState as Y, type FakeStorageManagementState as Z, type FakeToolManagementState as _, type BuiltinToolImpl as a, type ModelGatewayExecutor as a$, type IdentityAttestationCapabilities as a0, type IdentityAttestationManagementDriver as a1, type IdentityChallenge as a2, type IdentityDomain as a3, type IdentityEnrollment as a4, type IdentityInspection as a5, type IdentitySession as a6, type InMemoryCredentialBrokerOptions as a7, type InMemoryModelAccessHandleBrokerOptions as a8, type InProcessLoopRuntimeDriverOptions as a9, type ManagedModelEstimate as aA, type ManagedModelGatewayAccess as aB, type ManagedModelGatewayAdapterOptions as aC, type ManagedModelRequest as aD, type ManagedModelUsage as aE, type ManagedNetworkAdapterOptions as aF, type ManagedNetworkPolicy as aG, type ManagedNetworkStatus as aH, type ManagedReplicaHealth as aI, type ManagedServiceResolution as aJ, type ManagedToolDescriptor as aK, type ManagedToolEvidence as aL, type ManagedToolExecution as aM, type ManagedToolExecutionPhase as aN, type ManagedToolOutputChunk as aO, type ManagedVolume as aP, type ManagedVolumeBackup as aQ, type ManagedVolumePublication as aR, type ManagedVolumeSnapshot as aS, type ManagedVolumeStage as aT, type ManagedVolumeStats as aU, type ModelAccessHandle as aV, type ModelAccessHandleBroker as aW, type ModelAccessHandleBudget as aX, type ModelAccessHandleClaims as aY, type ModelGateway as aZ, type ModelGatewayCallRecord as a_, type InProcessToolExecutionDriverOptions as aa, type IssueCredentialGrantRequest as ab, type IssueModelAccessHandleRequest as ac, type LegacyLLMProviderDriverOptions as ad, type LoopRunHandle as ae, type LoopRunOutcome as af, type LoopRunStartRequest as ag, type LoopRuntimeCapabilities as ah, type LoopRuntimeCheckpoint as ai, type LoopRuntimeDriver as aj, type LoopRuntimeManagementDriver as ak, type LoopRuntimePreparePayload as al, type LoopRuntimePrepared as am, type LoopRuntimeStartPayload as an, type ManagedArtifact as ao, type ManagedArtifactMount as ap, type ManagedCredentialAdapterStateStore as aq, type ManagedCredentialBrokerAdapterOptions as ar, type ManagedCredentialGrant as as, type ManagedCredentialMaterialization as at, type ManagedLoopRunStatus as au, type ManagedLoopRuntimeAdapterOptions as av, type ManagedLoopRuntimeExecutionRoute as aw, type ManagedLoopRuntimeExecutionRouteOptions as ax, type ManagedModelChunk as ay, type ManagedModelDescriptor as az, type ArtifactContentStore as b, createFakeAuditTelemetryManagementDriver as b$, type ModelGatewayGenerateRequest as b0, type ModelGatewayOptions as b1, type ModelGatewayRecorder as b2, type ModelGenerateMessage as b3, type ModelGenerateRequest as b4, type ModelHandleSigner as b5, type ModelManagementCapabilities as b6, type ModelManagementDriver as b7, type ModelProviderDataPolicy as b8, type ModelProviderDriver as b9, type ToolManagementCapabilities as bA, type ToolManagementDriver as bB, type ToolOperationApprovalBroker as bC, type ToolOperationApprovalDecision as bD, type ToolOperationApprovalRequest as bE, type VerifyModelAccessHandleOptions as bF, artifactTrustRank as bG, assertArtifactAdmission as bH, assertClassificationAllowed as bI, assertDriverRequestEnvelope as bJ, assertManagedNetworkPolicy as bK, assertNetworkPreparePayload as bL, assertNetworkUpdatePayload as bM, base64UrlDecode as bN, base64UrlEncode as bO, canArtifactEnter as bP, canDriverSatisfyClass as bQ, canonicalDriverValue as bR, classificationRank as bS, countManagedNetworkPolicyRules as bT, createArtifactManagementConformanceSuite as bU, createAuditTelemetryConformanceSuite as bV, createControlStoreConformanceSuite as bW, createCredentialManagementConformanceSuite as bX, createExternalOrchestrationDriverConformanceSuite as bY, createFakeArtifactManagementDriver as bZ, createFakeArtifactManagementState as b_, type ModelProviderHealth as ba, type ModelStreamChunk as bb, type NetworkAttachRequest as bc, type NetworkClassSatisfaction as bd, type NetworkDriver as be, type NetworkDriverCapabilities as bf, type NetworkDriverHealth as bg, type NetworkEnforceableFeature as bh, type NetworkEnforcementLevel as bi, type NetworkManagementCapabilities as bj, type NetworkManagementDriver as bk, type NetworkPreparePayload as bl, type PolicyApprovalCapabilities as bm, type PolicyApprovalManagementDriver as bn, type PolicyDecision as bo, type PolicyDecisionKind as bp, type PolicyDecisionOutcome as bq, type PolicyExplanation as br, type PreparedToolExecution as bs, type ResolvedManagedNetworkRequest as bt, type RuntimeClassRoutingDriverOptions as bu, type StorageManagementCapabilities as bv, type StorageManagementDriver as bw, type StorageProvisionPayload as bx, type ToolCatalogSnapshot as by, type ToolExecutionDriver as bz, type ArtifactDestinationPolicy as c, createFakeAuditTelemetryState as c0, createFakeCredentialManagementDriver as c1, createFakeCredentialManagementState as c2, createFakeIdentityAttestationManagementDriver as c3, createFakeIdentityAttestationState as c4, createFakeLoopRuntimeManagementDriver as c5, createFakeLoopRuntimeState as c6, createFakeModelManagementDriver as c7, createFakeModelManagementState as c8, createFakeModelProviderDriver as c9, createNetworkDriverConformanceSuite as cA, createNetworkManagementConformanceSuite as cB, createPolicyApprovalConformanceSuite as cC, createRuntimeClassRoutingDriver as cD, createStorageManagementConformanceSuite as cE, createToolCatalogConformanceSuite as cF, createToolExecutionDriverConformanceSuite as cG, createToolManagementConformanceSuite as cH, deriveArtifactTrust as cI, featuresRequiredByClass as cJ, inspectAndRecordArtifact as cK, restoreArtifactManagementState as cL, runConformanceSuite as cM, snapshotArtifactManagementState as cN, createFakeNetworkDriver as ca, createFakeNetworkManagementDriver as cb, createFakeNetworkManagementState as cc, createFakePolicyApprovalManagementDriver as cd, createFakePolicyApprovalState as ce, createFakeStorageManagementDriver as cf, createFakeStorageManagementState as cg, createFakeToolExecutionDriver as ch, createFakeToolManagementDriver as ci, createFakeToolManagementState as cj, createGatewayMediatedLLMProvider as ck, createIdentityAttestationConformanceSuite as cl, createInMemoryCredentialBroker as cm, createInMemoryModelAccessHandleBroker as cn, createInProcessLoopRuntimeDriver as co, createInProcessToolExecutionDriver as cp, createLoopRuntimeManagementConformanceSuite as cq, createManagedCredentialBrokerAdapter as cr, createManagedLoopRuntimeAdapter as cs, createManagedLoopRuntimeExecutionRoute as ct, createManagedModelGatewayAdapter as cu, createManagedNetworkAdapter as cv, createModelGateway as cw, createModelManagementConformanceSuite as cx, createModelProviderDriverConformanceSuite as cy, createModelProviderDriverFromLLMProvider as cz, type ArtifactInspectionExecutor as d, type ArtifactInspectionInput as e, type ArtifactInspectionRequest as f, type ArtifactInspectionResult as g, type ArtifactInspector as h, type ArtifactManagementCapabilities as i, type ArtifactManagementDriver as j, type ArtifactManagementStateSnapshot as k, type ArtifactPutPayload as l, type ArtifactReviewWriter as m, type ArtifactSanitizationResult as n, type AttestedIdentity as o, type AuditEffect as p, type AuditProvenance as q, type AuditTelemetryCapabilities as r, type AuditTelemetryManagementDriver as s, type AuditTelemetryRecord as t, type AuditTelemetryRecordKind as u, type AuthorizedToolExecution as v, type CredentialBrokerDriver as w, type CredentialGrantClaims as x, type CredentialGrantHandle as y, type CredentialGrantInspection as z };