@muxoai/sdk 0.3.1 → 0.4.0-preview.20261010.2

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.
package/dist/index.d.ts CHANGED
@@ -1,349 +1,1352 @@
1
- import type { AnalyticsTrackInput, AppSearchInput, AuthUsersInput, BrowserDriveInput, ComputeContainerInput, DbQueryInput, DbWriteInput, DeployContainerInput, DeployEdgeInput, DeploySiteInput, DnsManageInput, DomainsRegisterInput, EmailSendInput, Envelope, FeatureFlagInput, KvStoreInput, LlmChatInput, LlmEmbedInput, LlmImageInput, LlmSttInput, LlmTtsInput, MemorySearchInput, MemoryStoreInput, ObservabilityLogInput, PaymentEvent, PaymentsChargeInput, PaymentsIntentInput, PaymentsListInput, PaymentsRefundInput, PaymentsStatus, QueueEmitInput, SandboxInput, SmsSendInput, StorageObjectInput, ToolCard, ToolContract, ToolRunResult, ToolsDiscoverInput, ToolsInspectInput, ToolsRunInput, VectorSearchInput, VideoGenerateInput, WebCrawlInput, WebExtractInput, WebMonitorInput, WebScrapeInput, WebSearchInput, ContextScope, ContextPacket, ContextDiff, ContextMemory, EntityResolution, LedgerEntry, EvalReport, Session } from './types';
2
- export type { AnalyticsTrackInput, AppSearchInput, AuthUsersInput, BrowserDriveInput, ComputeContainerInput, DbQueryInput, DbWriteInput, DeployContainerInput, DeployEdgeInput, DeploySiteInput, DnsManageInput, DomainsRegisterInput, EmailSendInput, Envelope, FeatureFlagInput, KvStoreInput, LlmChatInput, LlmEmbedInput, LlmImageInput, LlmSttInput, LlmTtsInput, MemorySearchInput, MemoryStoreInput, MuxoError, ObservabilityLogInput, PaymentEvent, PaymentIntentResult, PaymentsChargeInput, PaymentsIntentInput, PaymentsListInput, PaymentsRefundInput, PaymentsStatus, QueueEmitInput, RefundResult, SandboxInput, SmsSendInput, StorageObjectInput, ToolCard, ToolContract, ToolHealth, ToolInputSchema, ToolPrice, ToolRunResult, ToolsDiscoverInput, ToolsInspectInput, ToolsRunInput, Usage, VectorSearchInput, VideoGenerateInput, WebCrawlInput, WebExtractInput, WebMonitorInput, WebScrapeInput, WebSearchInput, ContextScope, ContextPacket, ContextDiff, ContextMemory, EntityResolution, LedgerEntry, EvalReport, Session, } from './types';
3
- export { OrgBrain, type OrgBrainOptions, type AnswerPath, type BrainOrg, type BrainSpace, type BrainAnswer, type BrainApproval, type BrainSelf, type CreateSpaceInput, } from './brain.js';
4
- export interface MuxoOptions {
5
- /** Omit to bootstrap: a keyless client can call `keys.create()` for a free key. */
6
- key?: string;
7
- baseUrl?: string;
1
+ import { z } from 'zod';
2
+
3
+ declare const riskSchema: z.ZodEnum<{
4
+ read: "read";
5
+ write: "write";
6
+ admin: "admin";
7
+ financial: "financial";
8
+ provisioning: "provisioning";
9
+ destructive: "destructive";
10
+ }>;
11
+ export type ActionRisk = z.infer<typeof riskSchema>;
12
+ declare const operations: {
13
+ readonly get_organization: {
14
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
15
+ path: string;
16
+ title: string;
17
+ description: string;
18
+ scope: string | null;
19
+ input: z.ZodObject<{}, z.core.$strict>;
20
+ output: z.ZodObject<{
21
+ organization_id: z.ZodString;
22
+ project_id: z.ZodString;
23
+ profile_id: z.ZodString;
24
+ name: z.ZodString;
25
+ role: z.ZodLiteral<"owner">;
26
+ budget: z.ZodObject<{
27
+ currency: z.ZodLiteral<"USD">;
28
+ lifetime_cap_minor: z.ZodNumber;
29
+ committed_bound_minor: z.ZodNumber;
30
+ remaining_minor: z.ZodNumber;
31
+ automatic_recharge: z.ZodLiteral<false>;
32
+ }, z.core.$strict>;
33
+ }, z.core.$strict>;
34
+ annotations: {
35
+ readOnlyHint: boolean;
36
+ destructiveHint: boolean;
37
+ idempotentHint: boolean;
38
+ openWorldHint: boolean;
39
+ };
40
+ };
41
+ readonly get_profile: {
42
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
43
+ path: string;
44
+ title: string;
45
+ description: string;
46
+ scope: string | null;
47
+ input: z.ZodObject<{}, z.core.$strict>;
48
+ output: z.ZodObject<{
49
+ id: z.ZodString;
50
+ name: z.ZodOptional<z.ZodString>;
51
+ email: z.ZodOptional<z.ZodEmail>;
52
+ nickname: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strict>;
54
+ annotations: {
55
+ readOnlyHint: boolean;
56
+ destructiveHint: boolean;
57
+ idempotentHint: boolean;
58
+ openWorldHint: boolean;
59
+ };
60
+ };
61
+ readonly search_tools: {
62
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
63
+ path: string;
64
+ title: string;
65
+ description: string;
66
+ scope: string | null;
67
+ input: z.ZodObject<{
68
+ query: z.ZodString;
69
+ toolkit: z.ZodOptional<z.ZodString>;
70
+ kind: z.ZodOptional<z.ZodEnum<{
71
+ toolkit: "toolkit";
72
+ tool: "tool";
73
+ provider: "provider";
74
+ service: "service";
75
+ }>>;
76
+ limit: z.ZodDefault<z.ZodNumber>;
77
+ cursor: z.ZodOptional<z.ZodString>;
78
+ }, z.core.$strict>;
79
+ output: z.ZodObject<{
80
+ tools: z.ZodArray<z.ZodObject<{
81
+ id: z.ZodString;
82
+ version: z.ZodString;
83
+ title: z.ZodString;
84
+ description: z.ZodString;
85
+ risk: z.ZodEnum<{
86
+ read: "read";
87
+ write: "write";
88
+ admin: "admin";
89
+ financial: "financial";
90
+ provisioning: "provisioning";
91
+ destructive: "destructive";
92
+ }>;
93
+ certification: z.ZodEnum<{
94
+ discovered: "discovered";
95
+ reviewed: "reviewed";
96
+ contract_tested: "contract_tested";
97
+ enabled: "enabled";
98
+ quarantined: "quarantined";
99
+ }>;
100
+ readiness: z.ZodObject<{
101
+ state: z.ZodEnum<{
102
+ approval_required: "approval_required";
103
+ payment_required: "payment_required";
104
+ ready: "ready";
105
+ unavailable: "unavailable";
106
+ connection_required: "connection_required";
107
+ scope_required: "scope_required";
108
+ owner_action_required: "owner_action_required";
109
+ restricted: "restricted";
110
+ }>;
111
+ reason: z.ZodString;
112
+ }, z.core.$strict>;
113
+ catalogue: z.ZodOptional<z.ZodDiscriminatedUnion<[
114
+ z.ZodObject<{
115
+ kind: z.ZodLiteral<"toolkit">;
116
+ supplier: z.ZodLiteral<"composio">;
117
+ slug: z.ZodString;
118
+ source_url: z.ZodURL;
119
+ managed_oauth: z.ZodNullable<z.ZodBoolean>;
120
+ instant_tools: z.ZodNullable<z.ZodBoolean>;
121
+ no_auth: z.ZodNullable<z.ZodBoolean>;
122
+ tools_count: z.ZodNumber;
123
+ }, z.core.$strict>,
124
+ z.ZodObject<{
125
+ kind: z.ZodLiteral<"tool">;
126
+ supplier: z.ZodLiteral<"composio">;
127
+ slug: z.ZodString;
128
+ source_url: z.ZodURL;
129
+ instant_tool: z.ZodBoolean;
130
+ no_auth: z.ZodNullable<z.ZodBoolean>;
131
+ }, z.core.$strict>,
132
+ z.ZodObject<{
133
+ kind: z.ZodLiteral<"provider">;
134
+ supplier: z.ZodLiteral<"projects">;
135
+ slug: z.ZodString;
136
+ source_url: z.ZodURL;
137
+ observed_at: z.ZodISODateTime;
138
+ native_reference: z.ZodString;
139
+ categories: z.ZodArray<z.ZodString>;
140
+ }, z.core.$strict>,
141
+ z.ZodObject<{
142
+ kind: z.ZodLiteral<"service">;
143
+ supplier: z.ZodLiteral<"projects">;
144
+ provider_id: z.ZodString;
145
+ service_id: z.ZodString;
146
+ source_url: z.ZodURL;
147
+ observed_at: z.ZodISODateTime;
148
+ supplier_availability: z.ZodString;
149
+ categories: z.ZodArray<z.ZodString>;
150
+ }, z.core.$strict>
151
+ ], "kind">>;
152
+ }, z.core.$strict>>;
153
+ next_cursor: z.ZodNullable<z.ZodString>;
154
+ }, z.core.$strict>;
155
+ annotations: {
156
+ readOnlyHint: boolean;
157
+ destructiveHint: boolean;
158
+ idempotentHint: boolean;
159
+ openWorldHint: boolean;
160
+ };
161
+ };
162
+ readonly inspect_tool: {
163
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
164
+ path: string;
165
+ title: string;
166
+ description: string;
167
+ scope: string | null;
168
+ input: z.ZodObject<{
169
+ tool_id: z.ZodString;
170
+ version: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strict>;
172
+ output: z.ZodObject<{
173
+ id: z.ZodString;
174
+ version: z.ZodString;
175
+ title: z.ZodString;
176
+ description: z.ZodString;
177
+ risk: z.ZodEnum<{
178
+ read: "read";
179
+ write: "write";
180
+ admin: "admin";
181
+ financial: "financial";
182
+ provisioning: "provisioning";
183
+ destructive: "destructive";
184
+ }>;
185
+ certification: z.ZodEnum<{
186
+ discovered: "discovered";
187
+ reviewed: "reviewed";
188
+ contract_tested: "contract_tested";
189
+ enabled: "enabled";
190
+ quarantined: "quarantined";
191
+ }>;
192
+ readiness: z.ZodObject<{
193
+ state: z.ZodEnum<{
194
+ approval_required: "approval_required";
195
+ payment_required: "payment_required";
196
+ ready: "ready";
197
+ unavailable: "unavailable";
198
+ connection_required: "connection_required";
199
+ scope_required: "scope_required";
200
+ owner_action_required: "owner_action_required";
201
+ restricted: "restricted";
202
+ }>;
203
+ reason: z.ZodString;
204
+ }, z.core.$strict>;
205
+ catalogue: z.ZodOptional<z.ZodDiscriminatedUnion<[
206
+ z.ZodObject<{
207
+ kind: z.ZodLiteral<"toolkit">;
208
+ supplier: z.ZodLiteral<"composio">;
209
+ slug: z.ZodString;
210
+ source_url: z.ZodURL;
211
+ managed_oauth: z.ZodNullable<z.ZodBoolean>;
212
+ instant_tools: z.ZodNullable<z.ZodBoolean>;
213
+ no_auth: z.ZodNullable<z.ZodBoolean>;
214
+ tools_count: z.ZodNumber;
215
+ }, z.core.$strict>,
216
+ z.ZodObject<{
217
+ kind: z.ZodLiteral<"tool">;
218
+ supplier: z.ZodLiteral<"composio">;
219
+ slug: z.ZodString;
220
+ source_url: z.ZodURL;
221
+ instant_tool: z.ZodBoolean;
222
+ no_auth: z.ZodNullable<z.ZodBoolean>;
223
+ }, z.core.$strict>,
224
+ z.ZodObject<{
225
+ kind: z.ZodLiteral<"provider">;
226
+ supplier: z.ZodLiteral<"projects">;
227
+ slug: z.ZodString;
228
+ source_url: z.ZodURL;
229
+ observed_at: z.ZodISODateTime;
230
+ native_reference: z.ZodString;
231
+ categories: z.ZodArray<z.ZodString>;
232
+ }, z.core.$strict>,
233
+ z.ZodObject<{
234
+ kind: z.ZodLiteral<"service">;
235
+ supplier: z.ZodLiteral<"projects">;
236
+ provider_id: z.ZodString;
237
+ service_id: z.ZodString;
238
+ source_url: z.ZodURL;
239
+ observed_at: z.ZodISODateTime;
240
+ supplier_availability: z.ZodString;
241
+ categories: z.ZodArray<z.ZodString>;
242
+ }, z.core.$strict>
243
+ ], "kind">>;
244
+ input_schema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
245
+ output_schema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
246
+ supplier_details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
247
+ }, z.core.$strict>;
248
+ annotations: {
249
+ readOnlyHint: boolean;
250
+ destructiveHint: boolean;
251
+ idempotentHint: boolean;
252
+ openWorldHint: boolean;
253
+ };
254
+ };
255
+ readonly start_connection: {
256
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
257
+ path: string;
258
+ title: string;
259
+ description: string;
260
+ scope: string | null;
261
+ input: z.ZodObject<{
262
+ toolkit: z.ZodString;
263
+ operation_id: z.ZodString;
264
+ connection_route: z.ZodOptional<z.ZodLiteral<"managed">>;
265
+ }, z.core.$strict>;
266
+ output: z.ZodObject<{
267
+ connection_id: z.ZodString;
268
+ state: z.ZodLiteral<"pending">;
269
+ handoff_url: z.ZodURL;
270
+ expires_at: z.ZodISODateTime;
271
+ }, z.core.$strict>;
272
+ annotations: {
273
+ readOnlyHint: boolean;
274
+ destructiveHint: boolean;
275
+ idempotentHint: boolean;
276
+ openWorldHint: boolean;
277
+ };
278
+ };
279
+ readonly connection_status: {
280
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
281
+ path: string;
282
+ title: string;
283
+ description: string;
284
+ scope: string | null;
285
+ input: z.ZodObject<{
286
+ toolkit: z.ZodOptional<z.ZodString>;
287
+ connection_id: z.ZodOptional<z.ZodString>;
288
+ connection_route: z.ZodOptional<z.ZodLiteral<"managed">>;
289
+ }, z.core.$strict>;
290
+ output: z.ZodObject<{
291
+ connections: z.ZodArray<z.ZodObject<{
292
+ id: z.ZodString;
293
+ toolkit: z.ZodString;
294
+ label: z.ZodString;
295
+ execution_version: z.ZodOptional<z.ZodString>;
296
+ consent_expires_at: z.ZodOptional<z.ZodISODateTime>;
297
+ disconnect_state: z.ZodOptional<z.ZodEnum<{
298
+ claimed: "claimed";
299
+ succeeded: "succeeded";
300
+ unknown_outcome: "unknown_outcome";
301
+ }>>;
302
+ state: z.ZodEnum<{
303
+ pending: "pending";
304
+ ready: "ready";
305
+ unavailable: "unavailable";
306
+ scope_required: "scope_required";
307
+ revoked: "revoked";
308
+ }>;
309
+ }, z.core.$strict>>;
310
+ }, z.core.$strict>;
311
+ annotations: {
312
+ readOnlyHint: boolean;
313
+ destructiveHint: boolean;
314
+ idempotentHint: boolean;
315
+ openWorldHint: boolean;
316
+ };
317
+ };
318
+ readonly plan_action: {
319
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
320
+ path: string;
321
+ title: string;
322
+ description: string;
323
+ scope: string | null;
324
+ input: z.ZodObject<{
325
+ tool_id: z.ZodString;
326
+ version: z.ZodString;
327
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
328
+ connection_id: z.ZodOptional<z.ZodString>;
329
+ audience: z.ZodString;
330
+ operation_id: z.ZodString;
331
+ funding: z.ZodOptional<z.ZodObject<{
332
+ resource_id: z.ZodString;
333
+ mode: z.ZodEnum<{
334
+ customer_funded: "customer_funded";
335
+ muxo_funded: "muxo_funded";
336
+ }>;
337
+ }, z.core.$strict>>;
338
+ }, z.core.$strict>;
339
+ output: z.ZodObject<{
340
+ plan_id: z.ZodString;
341
+ tool_id: z.ZodString;
342
+ version: z.ZodString;
343
+ risk: z.ZodEnum<{
344
+ read: "read";
345
+ write: "write";
346
+ admin: "admin";
347
+ financial: "financial";
348
+ provisioning: "provisioning";
349
+ destructive: "destructive";
350
+ }>;
351
+ readiness: z.ZodObject<{
352
+ state: z.ZodEnum<{
353
+ approval_required: "approval_required";
354
+ payment_required: "payment_required";
355
+ ready: "ready";
356
+ unavailable: "unavailable";
357
+ connection_required: "connection_required";
358
+ scope_required: "scope_required";
359
+ owner_action_required: "owner_action_required";
360
+ restricted: "restricted";
361
+ }>;
362
+ reason: z.ZodString;
363
+ }, z.core.$strict>;
364
+ expires_at: z.ZodISODateTime;
365
+ cost: z.ZodObject<{
366
+ supplier_units: z.ZodNullable<z.ZodNumber>;
367
+ supplier_unit: z.ZodNullable<z.ZodString>;
368
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
369
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
370
+ currency: z.ZodNullable<z.ZodString>;
371
+ treatment: z.ZodEnum<{
372
+ included: "included";
373
+ external_provider: "external_provider";
374
+ muxo_tool_usage: "muxo_tool_usage";
375
+ muxo_resource: "muxo_resource";
376
+ muxo_provisioning: "muxo_provisioning";
377
+ muxo_internal: "muxo_internal";
378
+ unresolved: "unresolved";
379
+ }>;
380
+ funding_mode: z.ZodOptional<z.ZodEnum<{
381
+ customer_funded: "customer_funded";
382
+ muxo_funded: "muxo_funded";
383
+ }>>;
384
+ }, z.core.$strict>;
385
+ approval_url: z.ZodNullable<z.ZodURL>;
386
+ payment: z.ZodOptional<z.ZodObject<{
387
+ state: z.ZodEnum<{
388
+ approval_required: "approval_required";
389
+ payment_required: "payment_required";
390
+ checkout_pending: "checkout_pending";
391
+ checkout_uncertain: "checkout_uncertain";
392
+ payment_processing: "payment_processing";
393
+ payment_failed: "payment_failed";
394
+ funded: "funded";
395
+ suspended: "suspended";
396
+ }>;
397
+ amount_minor: z.ZodNumber;
398
+ currency: z.ZodLiteral<"USD">;
399
+ handoff_url: z.ZodNullable<z.ZodURL>;
400
+ supplier_ready: z.ZodBoolean;
401
+ automatic_recharge: z.ZodLiteral<false>;
402
+ refund: z.ZodOptional<z.ZodObject<{
403
+ treatment: z.ZodLiteral<"automatic_whole_cent_fractional_manual">;
404
+ recorded_at: z.ZodISODateTime;
405
+ state: z.ZodEnum<{
406
+ claimed: "claimed";
407
+ uncertain: "uncertain";
408
+ blocked: "blocked";
409
+ not_needed: "not_needed";
410
+ fractional_only: "fractional_only";
411
+ pending: "pending";
412
+ requires_action: "requires_action";
413
+ succeeded: "succeeded";
414
+ failed: "failed";
415
+ canceled: "canceled";
416
+ }>;
417
+ refund_amount_minor: z.ZodNumber;
418
+ refunded_minor: z.ZodNumber;
419
+ refund_due_usd_24: z.ZodString;
420
+ fractional_refund_due_usd_24: z.ZodString;
421
+ reconciliation_required: z.ZodBoolean;
422
+ automatic_retry: z.ZodLiteral<false>;
423
+ }, z.core.$strict>>;
424
+ }, z.core.$strict>>;
425
+ credits: z.ZodOptional<z.ZodObject<{
426
+ treatment: z.ZodEnum<{
427
+ subscription_credits: "subscription_credits";
428
+ usage_credits: "usage_credits";
429
+ }>;
430
+ maximum_usd_24: z.ZodString;
431
+ maximum_credits: z.ZodString;
432
+ usd_per_credit: z.ZodLiteral<"0.01">;
433
+ rate_hash: z.ZodString;
434
+ terms_hash: z.ZodString;
435
+ automatic_overages: z.ZodLiteral<false>;
436
+ automatic_topups: z.ZodLiteral<false>;
437
+ }, z.core.$strict>>;
438
+ intent_hash: z.ZodOptional<z.ZodString>;
439
+ }, z.core.$strict>;
440
+ annotations: {
441
+ readOnlyHint: boolean;
442
+ destructiveHint: boolean;
443
+ idempotentHint: boolean;
444
+ openWorldHint: boolean;
445
+ };
446
+ };
447
+ readonly get_plan: {
448
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
449
+ path: string;
450
+ title: string;
451
+ description: string;
452
+ scope: string | null;
453
+ input: z.ZodObject<{
454
+ plan_id: z.ZodString;
455
+ }, z.core.$strict>;
456
+ output: z.ZodObject<{
457
+ plan: z.ZodObject<{
458
+ plan_id: z.ZodString;
459
+ tool_id: z.ZodString;
460
+ version: z.ZodString;
461
+ risk: z.ZodEnum<{
462
+ read: "read";
463
+ write: "write";
464
+ admin: "admin";
465
+ financial: "financial";
466
+ provisioning: "provisioning";
467
+ destructive: "destructive";
468
+ }>;
469
+ readiness: z.ZodObject<{
470
+ state: z.ZodEnum<{
471
+ approval_required: "approval_required";
472
+ payment_required: "payment_required";
473
+ ready: "ready";
474
+ unavailable: "unavailable";
475
+ connection_required: "connection_required";
476
+ scope_required: "scope_required";
477
+ owner_action_required: "owner_action_required";
478
+ restricted: "restricted";
479
+ }>;
480
+ reason: z.ZodString;
481
+ }, z.core.$strict>;
482
+ expires_at: z.ZodISODateTime;
483
+ cost: z.ZodObject<{
484
+ supplier_units: z.ZodNullable<z.ZodNumber>;
485
+ supplier_unit: z.ZodNullable<z.ZodString>;
486
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
487
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
488
+ currency: z.ZodNullable<z.ZodString>;
489
+ treatment: z.ZodEnum<{
490
+ included: "included";
491
+ external_provider: "external_provider";
492
+ muxo_tool_usage: "muxo_tool_usage";
493
+ muxo_resource: "muxo_resource";
494
+ muxo_provisioning: "muxo_provisioning";
495
+ muxo_internal: "muxo_internal";
496
+ unresolved: "unresolved";
497
+ }>;
498
+ funding_mode: z.ZodOptional<z.ZodEnum<{
499
+ customer_funded: "customer_funded";
500
+ muxo_funded: "muxo_funded";
501
+ }>>;
502
+ }, z.core.$strict>;
503
+ approval_url: z.ZodNullable<z.ZodURL>;
504
+ payment: z.ZodOptional<z.ZodObject<{
505
+ state: z.ZodEnum<{
506
+ approval_required: "approval_required";
507
+ payment_required: "payment_required";
508
+ checkout_pending: "checkout_pending";
509
+ checkout_uncertain: "checkout_uncertain";
510
+ payment_processing: "payment_processing";
511
+ payment_failed: "payment_failed";
512
+ funded: "funded";
513
+ suspended: "suspended";
514
+ }>;
515
+ amount_minor: z.ZodNumber;
516
+ currency: z.ZodLiteral<"USD">;
517
+ handoff_url: z.ZodNullable<z.ZodURL>;
518
+ supplier_ready: z.ZodBoolean;
519
+ automatic_recharge: z.ZodLiteral<false>;
520
+ refund: z.ZodOptional<z.ZodObject<{
521
+ treatment: z.ZodLiteral<"automatic_whole_cent_fractional_manual">;
522
+ recorded_at: z.ZodISODateTime;
523
+ state: z.ZodEnum<{
524
+ claimed: "claimed";
525
+ uncertain: "uncertain";
526
+ blocked: "blocked";
527
+ not_needed: "not_needed";
528
+ fractional_only: "fractional_only";
529
+ pending: "pending";
530
+ requires_action: "requires_action";
531
+ succeeded: "succeeded";
532
+ failed: "failed";
533
+ canceled: "canceled";
534
+ }>;
535
+ refund_amount_minor: z.ZodNumber;
536
+ refunded_minor: z.ZodNumber;
537
+ refund_due_usd_24: z.ZodString;
538
+ fractional_refund_due_usd_24: z.ZodString;
539
+ reconciliation_required: z.ZodBoolean;
540
+ automatic_retry: z.ZodLiteral<false>;
541
+ }, z.core.$strict>>;
542
+ }, z.core.$strict>>;
543
+ credits: z.ZodOptional<z.ZodObject<{
544
+ treatment: z.ZodEnum<{
545
+ subscription_credits: "subscription_credits";
546
+ usage_credits: "usage_credits";
547
+ }>;
548
+ maximum_usd_24: z.ZodString;
549
+ maximum_credits: z.ZodString;
550
+ usd_per_credit: z.ZodLiteral<"0.01">;
551
+ rate_hash: z.ZodString;
552
+ terms_hash: z.ZodString;
553
+ automatic_overages: z.ZodLiteral<false>;
554
+ automatic_topups: z.ZodLiteral<false>;
555
+ }, z.core.$strict>>;
556
+ intent_hash: z.ZodOptional<z.ZodString>;
557
+ }, z.core.$strict>;
558
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
559
+ approved: z.ZodBoolean;
560
+ run_id: z.ZodNullable<z.ZodString>;
561
+ next_action: z.ZodEnum<{
562
+ payment_required: "payment_required";
563
+ expired: "expired";
564
+ unavailable: "unavailable";
565
+ human_approval_required: "human_approval_required";
566
+ supplier_funding_required: "supplier_funding_required";
567
+ execute_read: "execute_read";
568
+ execute_write: "execute_write";
569
+ execute_admin: "execute_admin";
570
+ execute_financial: "execute_financial";
571
+ execute_provisioning: "execute_provisioning";
572
+ execute_destructive: "execute_destructive";
573
+ inspect_run: "inspect_run";
574
+ }>;
575
+ automatic_retry: z.ZodLiteral<false>;
576
+ }, z.core.$strict>;
577
+ annotations: {
578
+ readOnlyHint: boolean;
579
+ destructiveHint: boolean;
580
+ idempotentHint: boolean;
581
+ openWorldHint: boolean;
582
+ };
583
+ };
584
+ readonly get_run_context: {
585
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
586
+ path: string;
587
+ title: string;
588
+ description: string;
589
+ scope: string | null;
590
+ input: z.ZodObject<{
591
+ run_id: z.ZodString;
592
+ max_bytes: z.ZodDefault<z.ZodNumber>;
593
+ audience: z.ZodDefault<z.ZodLiteral<"private">>;
594
+ }, z.core.$strict>;
595
+ output: z.ZodObject<{
596
+ state: z.ZodEnum<{
597
+ ready: "ready";
598
+ partial: "partial";
599
+ expired: "expired";
600
+ unavailable: "unavailable";
601
+ }>;
602
+ packet: z.ZodNullable<z.ZodObject<{
603
+ kind: z.ZodLiteral<"untrusted_run_context">;
604
+ run_id: z.ZodString;
605
+ receipt_id: z.ZodNullable<z.ZodString>;
606
+ tool_id: z.ZodString;
607
+ version: z.ZodString;
608
+ generated_at: z.ZodISODateTime;
609
+ expires_at: z.ZodNullable<z.ZodISODateTime>;
610
+ audience: z.ZodLiteral<"private">;
611
+ items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
612
+ coverage: z.ZodObject<{
613
+ available: z.ZodNumber;
614
+ included: z.ZodNumber;
615
+ omitted: z.ZodNumber;
616
+ }, z.core.$strict>;
617
+ notes: z.ZodArray<z.ZodString>;
618
+ }, z.core.$strict>>;
619
+ bytes: z.ZodNumber;
620
+ persisted: z.ZodLiteral<false>;
621
+ supplier_calls: z.ZodLiteral<0>;
622
+ }, z.core.$strict>;
623
+ annotations: {
624
+ readOnlyHint: boolean;
625
+ destructiveHint: boolean;
626
+ idempotentHint: boolean;
627
+ openWorldHint: boolean;
628
+ };
629
+ };
630
+ readonly execute_read: {
631
+ annotations: {
632
+ idempotentHint: boolean;
633
+ readOnlyHint: boolean;
634
+ destructiveHint: boolean;
635
+ openWorldHint: boolean;
636
+ };
637
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
638
+ path: string;
639
+ title: string;
640
+ description: string;
641
+ scope: string | null;
642
+ input: z.ZodObject<{
643
+ plan_id: z.ZodString;
644
+ operation_id: z.ZodString;
645
+ }, z.core.$strict>;
646
+ output: z.ZodObject<{
647
+ run_id: z.ZodString;
648
+ state: z.ZodEnum<{
649
+ succeeded: "succeeded";
650
+ failed: "failed";
651
+ unknown_outcome: "unknown_outcome";
652
+ planned: "planned";
653
+ waiting_for_user: "waiting_for_user";
654
+ awaiting_approval: "awaiting_approval";
655
+ reserved: "reserved";
656
+ running: "running";
657
+ cancelled: "cancelled";
658
+ partially_completed: "partially_completed";
659
+ }>;
660
+ receipt_id: z.ZodNullable<z.ZodString>;
661
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
662
+ sources: z.ZodArray<z.ZodObject<{
663
+ id: z.ZodString;
664
+ url: z.ZodURL;
665
+ title: z.ZodString;
666
+ }, z.core.$strict>>;
667
+ cost: z.ZodNullable<z.ZodObject<{
668
+ supplier_units: z.ZodNullable<z.ZodNumber>;
669
+ supplier_unit: z.ZodNullable<z.ZodString>;
670
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
671
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
672
+ currency: z.ZodNullable<z.ZodString>;
673
+ treatment: z.ZodEnum<{
674
+ included: "included";
675
+ external_provider: "external_provider";
676
+ muxo_tool_usage: "muxo_tool_usage";
677
+ muxo_resource: "muxo_resource";
678
+ muxo_provisioning: "muxo_provisioning";
679
+ muxo_internal: "muxo_internal";
680
+ unresolved: "unresolved";
681
+ }>;
682
+ funding_mode: z.ZodOptional<z.ZodEnum<{
683
+ customer_funded: "customer_funded";
684
+ muxo_funded: "muxo_funded";
685
+ }>>;
686
+ }, z.core.$strict>>;
687
+ }, z.core.$strict>;
688
+ };
689
+ readonly execute_write: {
690
+ annotations: {
691
+ idempotentHint: boolean;
692
+ readOnlyHint: boolean;
693
+ destructiveHint: boolean;
694
+ openWorldHint: boolean;
695
+ };
696
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
697
+ path: string;
698
+ title: string;
699
+ description: string;
700
+ scope: string | null;
701
+ input: z.ZodObject<{
702
+ plan_id: z.ZodString;
703
+ operation_id: z.ZodString;
704
+ }, z.core.$strict>;
705
+ output: z.ZodObject<{
706
+ run_id: z.ZodString;
707
+ state: z.ZodEnum<{
708
+ succeeded: "succeeded";
709
+ failed: "failed";
710
+ unknown_outcome: "unknown_outcome";
711
+ planned: "planned";
712
+ waiting_for_user: "waiting_for_user";
713
+ awaiting_approval: "awaiting_approval";
714
+ reserved: "reserved";
715
+ running: "running";
716
+ cancelled: "cancelled";
717
+ partially_completed: "partially_completed";
718
+ }>;
719
+ receipt_id: z.ZodNullable<z.ZodString>;
720
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
721
+ sources: z.ZodArray<z.ZodObject<{
722
+ id: z.ZodString;
723
+ url: z.ZodURL;
724
+ title: z.ZodString;
725
+ }, z.core.$strict>>;
726
+ cost: z.ZodNullable<z.ZodObject<{
727
+ supplier_units: z.ZodNullable<z.ZodNumber>;
728
+ supplier_unit: z.ZodNullable<z.ZodString>;
729
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
730
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
731
+ currency: z.ZodNullable<z.ZodString>;
732
+ treatment: z.ZodEnum<{
733
+ included: "included";
734
+ external_provider: "external_provider";
735
+ muxo_tool_usage: "muxo_tool_usage";
736
+ muxo_resource: "muxo_resource";
737
+ muxo_provisioning: "muxo_provisioning";
738
+ muxo_internal: "muxo_internal";
739
+ unresolved: "unresolved";
740
+ }>;
741
+ funding_mode: z.ZodOptional<z.ZodEnum<{
742
+ customer_funded: "customer_funded";
743
+ muxo_funded: "muxo_funded";
744
+ }>>;
745
+ }, z.core.$strict>>;
746
+ }, z.core.$strict>;
747
+ };
748
+ readonly execute_admin: {
749
+ annotations: {
750
+ idempotentHint: boolean;
751
+ readOnlyHint: boolean;
752
+ destructiveHint: boolean;
753
+ openWorldHint: boolean;
754
+ };
755
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
756
+ path: string;
757
+ title: string;
758
+ description: string;
759
+ scope: string | null;
760
+ input: z.ZodObject<{
761
+ plan_id: z.ZodString;
762
+ operation_id: z.ZodString;
763
+ }, z.core.$strict>;
764
+ output: z.ZodObject<{
765
+ run_id: z.ZodString;
766
+ state: z.ZodEnum<{
767
+ succeeded: "succeeded";
768
+ failed: "failed";
769
+ unknown_outcome: "unknown_outcome";
770
+ planned: "planned";
771
+ waiting_for_user: "waiting_for_user";
772
+ awaiting_approval: "awaiting_approval";
773
+ reserved: "reserved";
774
+ running: "running";
775
+ cancelled: "cancelled";
776
+ partially_completed: "partially_completed";
777
+ }>;
778
+ receipt_id: z.ZodNullable<z.ZodString>;
779
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
780
+ sources: z.ZodArray<z.ZodObject<{
781
+ id: z.ZodString;
782
+ url: z.ZodURL;
783
+ title: z.ZodString;
784
+ }, z.core.$strict>>;
785
+ cost: z.ZodNullable<z.ZodObject<{
786
+ supplier_units: z.ZodNullable<z.ZodNumber>;
787
+ supplier_unit: z.ZodNullable<z.ZodString>;
788
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
789
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
790
+ currency: z.ZodNullable<z.ZodString>;
791
+ treatment: z.ZodEnum<{
792
+ included: "included";
793
+ external_provider: "external_provider";
794
+ muxo_tool_usage: "muxo_tool_usage";
795
+ muxo_resource: "muxo_resource";
796
+ muxo_provisioning: "muxo_provisioning";
797
+ muxo_internal: "muxo_internal";
798
+ unresolved: "unresolved";
799
+ }>;
800
+ funding_mode: z.ZodOptional<z.ZodEnum<{
801
+ customer_funded: "customer_funded";
802
+ muxo_funded: "muxo_funded";
803
+ }>>;
804
+ }, z.core.$strict>>;
805
+ }, z.core.$strict>;
806
+ };
807
+ readonly execute_financial: {
808
+ annotations: {
809
+ idempotentHint: boolean;
810
+ readOnlyHint: boolean;
811
+ destructiveHint: boolean;
812
+ openWorldHint: boolean;
813
+ };
814
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
815
+ path: string;
816
+ title: string;
817
+ description: string;
818
+ scope: string | null;
819
+ input: z.ZodObject<{
820
+ plan_id: z.ZodString;
821
+ operation_id: z.ZodString;
822
+ }, z.core.$strict>;
823
+ output: z.ZodObject<{
824
+ run_id: z.ZodString;
825
+ state: z.ZodEnum<{
826
+ succeeded: "succeeded";
827
+ failed: "failed";
828
+ unknown_outcome: "unknown_outcome";
829
+ planned: "planned";
830
+ waiting_for_user: "waiting_for_user";
831
+ awaiting_approval: "awaiting_approval";
832
+ reserved: "reserved";
833
+ running: "running";
834
+ cancelled: "cancelled";
835
+ partially_completed: "partially_completed";
836
+ }>;
837
+ receipt_id: z.ZodNullable<z.ZodString>;
838
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
839
+ sources: z.ZodArray<z.ZodObject<{
840
+ id: z.ZodString;
841
+ url: z.ZodURL;
842
+ title: z.ZodString;
843
+ }, z.core.$strict>>;
844
+ cost: z.ZodNullable<z.ZodObject<{
845
+ supplier_units: z.ZodNullable<z.ZodNumber>;
846
+ supplier_unit: z.ZodNullable<z.ZodString>;
847
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
848
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
849
+ currency: z.ZodNullable<z.ZodString>;
850
+ treatment: z.ZodEnum<{
851
+ included: "included";
852
+ external_provider: "external_provider";
853
+ muxo_tool_usage: "muxo_tool_usage";
854
+ muxo_resource: "muxo_resource";
855
+ muxo_provisioning: "muxo_provisioning";
856
+ muxo_internal: "muxo_internal";
857
+ unresolved: "unresolved";
858
+ }>;
859
+ funding_mode: z.ZodOptional<z.ZodEnum<{
860
+ customer_funded: "customer_funded";
861
+ muxo_funded: "muxo_funded";
862
+ }>>;
863
+ }, z.core.$strict>>;
864
+ }, z.core.$strict>;
865
+ };
866
+ readonly execute_provisioning: {
867
+ annotations: {
868
+ idempotentHint: boolean;
869
+ readOnlyHint: boolean;
870
+ destructiveHint: boolean;
871
+ openWorldHint: boolean;
872
+ };
873
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
874
+ path: string;
875
+ title: string;
876
+ description: string;
877
+ scope: string | null;
878
+ input: z.ZodObject<{
879
+ plan_id: z.ZodString;
880
+ operation_id: z.ZodString;
881
+ }, z.core.$strict>;
882
+ output: z.ZodObject<{
883
+ run_id: z.ZodString;
884
+ state: z.ZodEnum<{
885
+ succeeded: "succeeded";
886
+ failed: "failed";
887
+ unknown_outcome: "unknown_outcome";
888
+ planned: "planned";
889
+ waiting_for_user: "waiting_for_user";
890
+ awaiting_approval: "awaiting_approval";
891
+ reserved: "reserved";
892
+ running: "running";
893
+ cancelled: "cancelled";
894
+ partially_completed: "partially_completed";
895
+ }>;
896
+ receipt_id: z.ZodNullable<z.ZodString>;
897
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
898
+ sources: z.ZodArray<z.ZodObject<{
899
+ id: z.ZodString;
900
+ url: z.ZodURL;
901
+ title: z.ZodString;
902
+ }, z.core.$strict>>;
903
+ cost: z.ZodNullable<z.ZodObject<{
904
+ supplier_units: z.ZodNullable<z.ZodNumber>;
905
+ supplier_unit: z.ZodNullable<z.ZodString>;
906
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
907
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
908
+ currency: z.ZodNullable<z.ZodString>;
909
+ treatment: z.ZodEnum<{
910
+ included: "included";
911
+ external_provider: "external_provider";
912
+ muxo_tool_usage: "muxo_tool_usage";
913
+ muxo_resource: "muxo_resource";
914
+ muxo_provisioning: "muxo_provisioning";
915
+ muxo_internal: "muxo_internal";
916
+ unresolved: "unresolved";
917
+ }>;
918
+ funding_mode: z.ZodOptional<z.ZodEnum<{
919
+ customer_funded: "customer_funded";
920
+ muxo_funded: "muxo_funded";
921
+ }>>;
922
+ }, z.core.$strict>>;
923
+ }, z.core.$strict>;
924
+ };
925
+ readonly execute_destructive: {
926
+ annotations: {
927
+ idempotentHint: boolean;
928
+ readOnlyHint: boolean;
929
+ destructiveHint: boolean;
930
+ openWorldHint: boolean;
931
+ };
932
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
933
+ path: string;
934
+ title: string;
935
+ description: string;
936
+ scope: string | null;
937
+ input: z.ZodObject<{
938
+ plan_id: z.ZodString;
939
+ operation_id: z.ZodString;
940
+ }, z.core.$strict>;
941
+ output: z.ZodObject<{
942
+ run_id: z.ZodString;
943
+ state: z.ZodEnum<{
944
+ succeeded: "succeeded";
945
+ failed: "failed";
946
+ unknown_outcome: "unknown_outcome";
947
+ planned: "planned";
948
+ waiting_for_user: "waiting_for_user";
949
+ awaiting_approval: "awaiting_approval";
950
+ reserved: "reserved";
951
+ running: "running";
952
+ cancelled: "cancelled";
953
+ partially_completed: "partially_completed";
954
+ }>;
955
+ receipt_id: z.ZodNullable<z.ZodString>;
956
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
957
+ sources: z.ZodArray<z.ZodObject<{
958
+ id: z.ZodString;
959
+ url: z.ZodURL;
960
+ title: z.ZodString;
961
+ }, z.core.$strict>>;
962
+ cost: z.ZodNullable<z.ZodObject<{
963
+ supplier_units: z.ZodNullable<z.ZodNumber>;
964
+ supplier_unit: z.ZodNullable<z.ZodString>;
965
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
966
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
967
+ currency: z.ZodNullable<z.ZodString>;
968
+ treatment: z.ZodEnum<{
969
+ included: "included";
970
+ external_provider: "external_provider";
971
+ muxo_tool_usage: "muxo_tool_usage";
972
+ muxo_resource: "muxo_resource";
973
+ muxo_provisioning: "muxo_provisioning";
974
+ muxo_internal: "muxo_internal";
975
+ unresolved: "unresolved";
976
+ }>;
977
+ funding_mode: z.ZodOptional<z.ZodEnum<{
978
+ customer_funded: "customer_funded";
979
+ muxo_funded: "muxo_funded";
980
+ }>>;
981
+ }, z.core.$strict>>;
982
+ }, z.core.$strict>;
983
+ };
984
+ readonly get_run: {
985
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
986
+ path: string;
987
+ title: string;
988
+ description: string;
989
+ scope: string | null;
990
+ input: z.ZodObject<{
991
+ run_id: z.ZodString;
992
+ }, z.core.$strict>;
993
+ output: z.ZodObject<{
994
+ run_id: z.ZodString;
995
+ state: z.ZodEnum<{
996
+ succeeded: "succeeded";
997
+ failed: "failed";
998
+ unknown_outcome: "unknown_outcome";
999
+ planned: "planned";
1000
+ waiting_for_user: "waiting_for_user";
1001
+ awaiting_approval: "awaiting_approval";
1002
+ reserved: "reserved";
1003
+ running: "running";
1004
+ cancelled: "cancelled";
1005
+ partially_completed: "partially_completed";
1006
+ }>;
1007
+ receipt_id: z.ZodNullable<z.ZodString>;
1008
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1009
+ sources: z.ZodArray<z.ZodObject<{
1010
+ id: z.ZodString;
1011
+ url: z.ZodURL;
1012
+ title: z.ZodString;
1013
+ }, z.core.$strict>>;
1014
+ cost: z.ZodNullable<z.ZodObject<{
1015
+ supplier_units: z.ZodNullable<z.ZodNumber>;
1016
+ supplier_unit: z.ZodNullable<z.ZodString>;
1017
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
1018
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
1019
+ currency: z.ZodNullable<z.ZodString>;
1020
+ treatment: z.ZodEnum<{
1021
+ included: "included";
1022
+ external_provider: "external_provider";
1023
+ muxo_tool_usage: "muxo_tool_usage";
1024
+ muxo_resource: "muxo_resource";
1025
+ muxo_provisioning: "muxo_provisioning";
1026
+ muxo_internal: "muxo_internal";
1027
+ unresolved: "unresolved";
1028
+ }>;
1029
+ funding_mode: z.ZodOptional<z.ZodEnum<{
1030
+ customer_funded: "customer_funded";
1031
+ muxo_funded: "muxo_funded";
1032
+ }>>;
1033
+ }, z.core.$strict>>;
1034
+ }, z.core.$strict>;
1035
+ annotations: {
1036
+ readOnlyHint: boolean;
1037
+ destructiveHint: boolean;
1038
+ idempotentHint: boolean;
1039
+ openWorldHint: boolean;
1040
+ };
1041
+ };
1042
+ readonly cancel_run: {
1043
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
1044
+ path: string;
1045
+ title: string;
1046
+ description: string;
1047
+ scope: string | null;
1048
+ input: z.ZodObject<{
1049
+ run_id: z.ZodString;
1050
+ operation_id: z.ZodString;
1051
+ }, z.core.$strict>;
1052
+ output: z.ZodObject<{
1053
+ run_id: z.ZodString;
1054
+ state: z.ZodEnum<{
1055
+ succeeded: "succeeded";
1056
+ failed: "failed";
1057
+ unknown_outcome: "unknown_outcome";
1058
+ planned: "planned";
1059
+ waiting_for_user: "waiting_for_user";
1060
+ awaiting_approval: "awaiting_approval";
1061
+ reserved: "reserved";
1062
+ running: "running";
1063
+ cancelled: "cancelled";
1064
+ partially_completed: "partially_completed";
1065
+ }>;
1066
+ receipt_id: z.ZodNullable<z.ZodString>;
1067
+ result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1068
+ sources: z.ZodArray<z.ZodObject<{
1069
+ id: z.ZodString;
1070
+ url: z.ZodURL;
1071
+ title: z.ZodString;
1072
+ }, z.core.$strict>>;
1073
+ cost: z.ZodNullable<z.ZodObject<{
1074
+ supplier_units: z.ZodNullable<z.ZodNumber>;
1075
+ supplier_unit: z.ZodNullable<z.ZodString>;
1076
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
1077
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
1078
+ currency: z.ZodNullable<z.ZodString>;
1079
+ treatment: z.ZodEnum<{
1080
+ included: "included";
1081
+ external_provider: "external_provider";
1082
+ muxo_tool_usage: "muxo_tool_usage";
1083
+ muxo_resource: "muxo_resource";
1084
+ muxo_provisioning: "muxo_provisioning";
1085
+ muxo_internal: "muxo_internal";
1086
+ unresolved: "unresolved";
1087
+ }>;
1088
+ funding_mode: z.ZodOptional<z.ZodEnum<{
1089
+ customer_funded: "customer_funded";
1090
+ muxo_funded: "muxo_funded";
1091
+ }>>;
1092
+ }, z.core.$strict>>;
1093
+ }, z.core.$strict>;
1094
+ annotations: {
1095
+ readOnlyHint: boolean;
1096
+ destructiveHint: boolean;
1097
+ idempotentHint: boolean;
1098
+ openWorldHint: boolean;
1099
+ };
1100
+ };
1101
+ readonly get_receipt: {
1102
+ lane?: "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
1103
+ path: string;
1104
+ title: string;
1105
+ description: string;
1106
+ scope: string | null;
1107
+ input: z.ZodObject<{
1108
+ receipt_id: z.ZodString;
1109
+ }, z.core.$strict>;
1110
+ output: z.ZodObject<{
1111
+ receipt_id: z.ZodString;
1112
+ run_id: z.ZodString;
1113
+ tool_id: z.ZodString;
1114
+ version: z.ZodString;
1115
+ outcome: z.ZodEnum<{
1116
+ succeeded: "succeeded";
1117
+ failed: "failed";
1118
+ unknown_outcome: "unknown_outcome";
1119
+ cancelled: "cancelled";
1120
+ partially_completed: "partially_completed";
1121
+ }>;
1122
+ cost: z.ZodObject<{
1123
+ supplier_units: z.ZodNullable<z.ZodNumber>;
1124
+ supplier_unit: z.ZodNullable<z.ZodString>;
1125
+ supplier_cash_minor: z.ZodNullable<z.ZodNumber>;
1126
+ muxo_cash_minor: z.ZodNullable<z.ZodNumber>;
1127
+ currency: z.ZodNullable<z.ZodString>;
1128
+ treatment: z.ZodEnum<{
1129
+ included: "included";
1130
+ external_provider: "external_provider";
1131
+ muxo_tool_usage: "muxo_tool_usage";
1132
+ muxo_resource: "muxo_resource";
1133
+ muxo_provisioning: "muxo_provisioning";
1134
+ muxo_internal: "muxo_internal";
1135
+ unresolved: "unresolved";
1136
+ }>;
1137
+ funding_mode: z.ZodOptional<z.ZodEnum<{
1138
+ customer_funded: "customer_funded";
1139
+ muxo_funded: "muxo_funded";
1140
+ }>>;
1141
+ }, z.core.$strict>;
1142
+ recorded_at: z.ZodISODateTime;
1143
+ native: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1144
+ }, z.core.$strict>;
1145
+ annotations: {
1146
+ readOnlyHint: boolean;
1147
+ destructiveHint: boolean;
1148
+ idempotentHint: boolean;
1149
+ openWorldHint: boolean;
1150
+ };
1151
+ };
1152
+ };
1153
+ export type OperationName = keyof typeof operations;
1154
+ export type OperationInput<N extends OperationName> = z.input<(typeof operations)[N]["input"]>;
1155
+ export type OperationOutput<N extends OperationName> = z.output<(typeof operations)[N]["output"]>;
1156
+ declare const errorCodeSchema: z.ZodEnum<{
1157
+ approval_required: "approval_required";
1158
+ payment_required: "payment_required";
1159
+ unknown_outcome: "unknown_outcome";
1160
+ supplier_funding_required: "supplier_funding_required";
1161
+ unauthenticated: "unauthenticated";
1162
+ insufficient_scope: "insufficient_scope";
1163
+ forbidden: "forbidden";
1164
+ invalid_input: "invalid_input";
1165
+ not_found: "not_found";
1166
+ not_configured: "not_configured";
1167
+ conflict: "conflict";
1168
+ budget_exceeded: "budget_exceeded";
1169
+ rate_limited: "rate_limited";
1170
+ internal: "internal";
1171
+ }>;
1172
+ type ErrorCode = z.infer<typeof errorCodeSchema>;
1173
+ export type SurfaceResult<T = unknown> = {
1174
+ ok: true;
1175
+ data: T;
1176
+ } | {
1177
+ ok: false;
1178
+ error: {
1179
+ code: ErrorCode;
1180
+ message: string;
1181
+ };
1182
+ };
1183
+ declare const workspaceCommand: z.ZodObject<{
1184
+ operation: z.ZodEnum<{
1185
+ execute_read: "execute_read";
1186
+ execute_write: "execute_write";
1187
+ execute_admin: "execute_admin";
1188
+ execute_financial: "execute_financial";
1189
+ execute_provisioning: "execute_provisioning";
1190
+ execute_destructive: "execute_destructive";
1191
+ get_run: "get_run";
1192
+ get_organization: "get_organization";
1193
+ get_profile: "get_profile";
1194
+ search_tools: "search_tools";
1195
+ inspect_tool: "inspect_tool";
1196
+ start_connection: "start_connection";
1197
+ connection_status: "connection_status";
1198
+ plan_action: "plan_action";
1199
+ get_plan: "get_plan";
1200
+ get_run_context: "get_run_context";
1201
+ cancel_run: "cancel_run";
1202
+ get_receipt: "get_receipt";
1203
+ initialize: "initialize";
1204
+ request_human_handoff: "request_human_handoff";
1205
+ review_human_handoff: "review_human_handoff";
1206
+ confirm_human_handoff: "confirm_human_handoff";
1207
+ human_handoff_receipt: "human_handoff_receipt";
1208
+ review_invitation: "review_invitation";
1209
+ confirm_invitation: "confirm_invitation";
1210
+ snapshot: "snapshot";
1211
+ get_free_plan: "get_free_plan";
1212
+ get_subscription_credits: "get_subscription_credits";
1213
+ get_prepaid_credits: "get_prepaid_credits";
1214
+ plan_prepaid_topup: "plan_prepaid_topup";
1215
+ get_prepaid_plan: "get_prepaid_plan";
1216
+ review_prepaid: "review_prepaid";
1217
+ checkout_prepaid: "checkout_prepaid";
1218
+ plan_subscription: "plan_subscription";
1219
+ get_subscription_plan: "get_subscription_plan";
1220
+ review_subscription: "review_subscription";
1221
+ checkout_subscription: "checkout_subscription";
1222
+ cancel_subscription: "cancel_subscription";
1223
+ invite: "invite";
1224
+ accept: "accept";
1225
+ revoke_invitation: "revoke_invitation";
1226
+ update_member: "update_member";
1227
+ grant_project: "grant_project";
1228
+ share_source: "share_source";
1229
+ register_source: "register_source";
1230
+ register_document: "register_document";
1231
+ inspect_source: "inspect_source";
1232
+ revoke_source: "revoke_source";
1233
+ delegate: "delegate";
1234
+ revoke_delegation: "revoke_delegation";
1235
+ connection_handoff: "connection_handoff";
1236
+ disconnect_connection: "disconnect_connection";
1237
+ review_plan: "review_plan";
1238
+ approve_action: "approve_action";
1239
+ plan_resource: "plan_resource";
1240
+ get_resource_plan: "get_resource_plan";
1241
+ review_resource: "review_resource";
1242
+ approve_resource: "approve_resource";
1243
+ execute_resource: "execute_resource";
1244
+ resource_receipt: "resource_receipt";
1245
+ reconcile_resource: "reconcile_resource";
1246
+ list_resources: "list_resources";
1247
+ resource_runtime: "resource_runtime";
1248
+ register_resource_source: "register_resource_source";
1249
+ memory_consent: "memory_consent";
1250
+ revoke_memory_consent: "revoke_memory_consent";
1251
+ memory_submit: "memory_submit";
1252
+ memory_capture: "memory_capture";
1253
+ memory_approve: "memory_approve";
1254
+ memory_read: "memory_read";
1255
+ memory_search: "memory_search";
1256
+ memory_bootstrap: "memory_bootstrap";
1257
+ memory_navigate: "memory_navigate";
1258
+ memory_retract: "memory_retract";
1259
+ memory_erase: "memory_erase";
1260
+ memory_export: "memory_export";
1261
+ memory_maintain: "memory_maintain";
1262
+ memory_index: "memory_index";
1263
+ }>;
1264
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1265
+ }, z.core.$strict>;
1266
+ export type WorkspaceCommand = z.input<typeof workspaceCommand>;
1267
+ declare const workspaceContextSchema: z.ZodObject<{
1268
+ id: z.ZodString;
1269
+ projectId: z.ZodString;
1270
+ }, z.core.$strict>;
1271
+ type WorkspaceContext = z.infer<typeof workspaceContextSchema>;
1272
+ declare const workspaceOrganizationSchema: z.ZodObject<{
1273
+ version: z.ZodLiteral<"workspace-v2">;
1274
+ organization_id: z.ZodString;
1275
+ project_id: z.ZodString;
1276
+ profile_id: z.ZodString;
1277
+ actor_id: z.ZodString;
1278
+ kind: z.ZodEnum<{
1279
+ service: "service";
1280
+ human: "human";
1281
+ }>;
1282
+ role: z.ZodEnum<{
1283
+ owner: "owner";
1284
+ lead: "lead";
1285
+ member: "member";
1286
+ operator: "operator";
1287
+ billing: "billing";
1288
+ }>;
1289
+ permissions: z.ZodArray<z.ZodEnum<{
1290
+ plan: "plan";
1291
+ resource: "resource";
1292
+ billing: "billing";
1293
+ approve: "approve";
1294
+ memory: "memory";
1295
+ }>>;
1296
+ }, z.core.$strict>;
1297
+ type WorkspaceOperationOutput<N extends OperationName> = N extends "get_organization" ? z.infer<typeof workspaceOrganizationSchema> : OperationOutput<N>;
1298
+ export type ClientErrorCode = "invalid_input" | "invalid_credential" | "transport_error" | "invalid_response" | "timeout" | "cancelled";
1299
+ /** Safe to report to a harness. Never retains raw exceptions, arguments, or tokens. */
1300
+ export declare class MuxoClientError extends Error {
1301
+ readonly code: ClientErrorCode;
1302
+ readonly operation?: OperationName | undefined;
1303
+ readonly outcomeUnknown: boolean;
1304
+ readonly operationId?: string | undefined;
1305
+ constructor(code: ClientErrorCode, operation?: OperationName | undefined, outcomeUnknown?: boolean, operationId?: string | undefined);
1306
+ toResult(): {
1307
+ ok: false;
1308
+ error: {
1309
+ code: ClientErrorCode;
1310
+ message: string;
1311
+ };
1312
+ recovery: {
1313
+ outcome_unknown: boolean;
1314
+ automatic_retry: false;
1315
+ next_action: string;
1316
+ operation_id?: string;
1317
+ operation?: "execute_read" | "execute_write" | "execute_admin" | "execute_financial" | "execute_provisioning" | "execute_destructive" | "get_run" | "get_organization" | "get_profile" | "search_tools" | "inspect_tool" | "start_connection" | "connection_status" | "plan_action" | "get_plan" | "get_run_context" | "cancel_run" | "get_receipt";
1318
+ };
1319
+ };
8
1320
  }
9
- /**
10
- * Which packet and session a capability call belongs to.
11
- *
12
- * Both are optional and advisory: they never change whether a call is allowed,
13
- * only how well the resulting receipt can be explained afterwards.
14
- */
15
- export interface CallBinding {
16
- /** The packet whose context grounded this call, from `context.fetch`/`query`. */
17
- packetId?: string;
18
- /** The session whose context window this call joins. */
19
- session?: string;
1321
+ export declare class MuxoClient {
1322
+ private readonly options;
1323
+ private readonly baseUrl;
1324
+ private readonly transport;
1325
+ private readonly timeoutMs;
1326
+ readonly workspaceContext: Readonly<WorkspaceContext> | null;
1327
+ constructor(options: {
1328
+ baseUrl: string;
1329
+ /** Resolve a protected OAuth token or scoped server key, never log it. */
1330
+ credential: () => string | Promise<string>;
1331
+ fetch?: typeof fetch;
1332
+ /** Deadline includes credential resolution and response streaming. No retries. */
1333
+ timeoutMs?: number;
1334
+ /** Routing hint only. The server verifies the exact live workspace grant. */
1335
+ workspace?: WorkspaceContext;
1336
+ });
1337
+ /** Explicit tenant address is verified server-side. No retries or human authority substitution. */
1338
+ workspace(id: string, raw: WorkspaceCommand, signal?: AbortSignal): Promise<{
1339
+ ok: true;
1340
+ data: import("zod").JSONType;
1341
+ } | {
1342
+ ok: false;
1343
+ error: {
1344
+ code: string;
1345
+ message: string;
1346
+ };
1347
+ }>;
1348
+ workspaceCall<N extends OperationName>(name: N, input: OperationInput<N>, signal?: AbortSignal): Promise<SurfaceResult<WorkspaceOperationOutput<N>>>;
1349
+ call<N extends OperationName>(name: N, input: OperationInput<N>, signal?: AbortSignal): Promise<SurfaceResult<OperationOutput<N>>>;
20
1350
  }
21
- export declare class Muxo {
22
- readonly key: string;
23
- readonly baseUrl: string;
24
- constructor({ key, baseUrl }?: MuxoOptions);
25
- private request;
26
- /**
27
- * Call a capability.
28
- *
29
- * `packetId` and `session` are Muxo's governance fields, not the capability's
30
- * arguments: they label the signed ledger entry and fold the call into a
31
- * session's context window, which is what turns a receipt from "what ran"
32
- * into "what ran, on what grounding". They are stripped before the input
33
- * reaches the provider. Omit them and the call still meters, budgets, and
34
- * signs — it is just harder to reconstruct afterwards.
35
- */
36
- call<T = unknown>(capability: string, input: object, opts?: CallBinding): Promise<Envelope<T>>;
37
- search: (input: WebSearchInput) => Promise<Envelope<unknown>>;
38
- read_page: (input: WebScrapeInput) => Promise<Envelope<unknown>>;
39
- extract: (input: WebExtractInput) => Promise<Envelope<unknown>>;
40
- crawl_site: (input: WebCrawlInput) => Promise<Envelope<unknown>>;
41
- watch_page: (input: WebMonitorInput) => Promise<Envelope<unknown>>;
42
- browse: (input: BrowserDriveInput) => Promise<Envelope<unknown>>;
43
- ask_ai: (input: LlmChatInput) => Promise<Envelope<unknown>>;
44
- embed: (input: LlmEmbedInput) => Promise<Envelope<unknown>>;
45
- say: (input: LlmTtsInput) => Promise<Envelope<unknown>>;
46
- make_image: (input: LlmImageInput) => Promise<Envelope<unknown>>;
47
- transcribe: (input: LlmSttInput) => Promise<Envelope<unknown>>;
48
- run_code: (input: SandboxInput) => Promise<Envelope<unknown>>;
49
- run_container: (input: ComputeContainerInput) => Promise<Envelope<unknown>>;
50
- publish_site: (input: DeploySiteInput) => Promise<Envelope<unknown>>;
51
- deploy_container: (input: DeployContainerInput) => Promise<Envelope<unknown>>;
52
- deploy_edge: (input: DeployEdgeInput) => Promise<Envelope<unknown>>;
53
- buy_domain: (input: DomainsRegisterInput) => Promise<Envelope<unknown>>;
54
- manage_dns: (input: DnsManageInput) => Promise<Envelope<unknown>>;
55
- cache: (input: KvStoreInput) => Promise<Envelope<unknown>>;
56
- save: (input: DbWriteInput) => Promise<Envelope<unknown>>;
57
- query: (input: DbQueryInput) => Promise<Envelope<unknown>>;
58
- store_file: (input: StorageObjectInput) => Promise<Envelope<unknown>>;
59
- search_similar: (input: VectorSearchInput) => Promise<Envelope<unknown>>;
60
- send_email: (input: EmailSendInput) => Promise<Envelope<unknown>>;
61
- log: (input: ObservabilityLogInput) => Promise<Envelope<unknown>>;
62
- enqueue: (input: QueueEmitInput) => Promise<Envelope<unknown>>;
63
- send_text: (input: SmsSendInput) => Promise<Envelope<unknown>>;
64
- track: (input: AnalyticsTrackInput) => Promise<Envelope<unknown>>;
65
- search_app: (input: AppSearchInput) => Promise<Envelope<unknown>>;
66
- remember: (input: MemoryStoreInput) => Promise<Envelope<unknown>>;
67
- recall: (input: MemorySearchInput) => Promise<Envelope<unknown>>;
68
- check_flag: (input: FeatureFlagInput) => Promise<Envelope<unknown>>;
69
- make_video: (input: VideoGenerateInput) => Promise<Envelope<unknown>>;
70
- users: (input: AuthUsersInput) => Promise<Envelope<unknown>>;
71
- charge: (input: PaymentsChargeInput) => Promise<Envelope<unknown>>;
72
- refund: (input: PaymentsRefundInput) => Promise<Envelope<unknown>>;
73
- payment: (input: PaymentsIntentInput) => Promise<Envelope<unknown>>;
74
- payment_history: (input?: PaymentsListInput) => Promise<Envelope<unknown>>;
75
- find_tools: (input: ToolsDiscoverInput) => Promise<Envelope<ToolCard[]>>;
76
- inspect_tool: (input: ToolsInspectInput) => Promise<Envelope<ToolContract>>;
77
- run_tool: (input: ToolsRunInput) => Promise<Envelope<ToolRunResult>>;
78
- web: {
79
- search: (input: WebSearchInput) => Promise<Envelope<unknown>>;
80
- scrape: (input: WebScrapeInput) => Promise<Envelope<unknown>>;
81
- extract: (input: WebExtractInput) => Promise<Envelope<unknown>>;
82
- crawl: (input: WebCrawlInput) => Promise<Envelope<unknown>>;
83
- monitor: (input: WebMonitorInput) => Promise<Envelope<unknown>>;
84
- };
85
- browser: {
86
- drive: (input: BrowserDriveInput) => Promise<Envelope<unknown>>;
87
- };
88
- llm: {
89
- chat: (input: LlmChatInput) => Promise<Envelope<unknown>>;
90
- embed: (input: LlmEmbedInput) => Promise<Envelope<unknown>>;
91
- tts: (input: LlmTtsInput) => Promise<Envelope<unknown>>;
92
- image: (input: LlmImageInput) => Promise<Envelope<unknown>>;
93
- stt: (input: LlmSttInput) => Promise<Envelope<unknown>>;
94
- };
95
- compute: {
96
- sandbox: (input: SandboxInput) => Promise<Envelope<unknown>>;
97
- container: (input: ComputeContainerInput) => Promise<Envelope<unknown>>;
98
- };
99
- deploy: {
100
- site: (input: DeploySiteInput) => Promise<Envelope<unknown>>;
101
- container: (input: DeployContainerInput) => Promise<Envelope<unknown>>;
102
- edge: (input: DeployEdgeInput) => Promise<Envelope<unknown>>;
103
- };
104
- domains: {
105
- register: (input: DomainsRegisterInput) => Promise<Envelope<unknown>>;
106
- };
107
- dns: {
108
- manage: (input: DnsManageInput) => Promise<Envelope<unknown>>;
109
- };
110
- kv: {
111
- store: (input: KvStoreInput) => Promise<Envelope<unknown>>;
112
- };
113
- db: {
114
- write: (input: DbWriteInput) => Promise<Envelope<unknown>>;
115
- query: (input: DbQueryInput) => Promise<Envelope<unknown>>;
116
- };
117
- storage: {
118
- object: (input: StorageObjectInput) => Promise<Envelope<unknown>>;
119
- };
120
- vectors: {
121
- search: (input: VectorSearchInput) => Promise<Envelope<unknown>>;
122
- };
123
- email: {
124
- send: (input: EmailSendInput) => Promise<Envelope<unknown>>;
125
- };
126
- observability: {
127
- log: (input: ObservabilityLogInput) => Promise<Envelope<unknown>>;
128
- };
129
- queue: {
130
- emit: (input: QueueEmitInput) => Promise<Envelope<unknown>>;
131
- };
132
- sms: {
133
- send: (input: SmsSendInput) => Promise<Envelope<unknown>>;
134
- };
135
- analytics: {
136
- track: (input: AnalyticsTrackInput) => Promise<Envelope<unknown>>;
137
- };
138
- appsearch: {
139
- query: (input: AppSearchInput) => Promise<Envelope<unknown>>;
140
- };
141
- memory: {
142
- store: (input: MemoryStoreInput) => Promise<Envelope<unknown>>;
143
- search: (input: MemorySearchInput) => Promise<Envelope<unknown>>;
144
- };
145
- featureflags: {
146
- evaluate: (input: FeatureFlagInput) => Promise<Envelope<unknown>>;
147
- };
148
- video: {
149
- generate: (input: VideoGenerateInput) => Promise<Envelope<unknown>>;
150
- };
151
- auth: {
152
- users: (input: AuthUsersInput) => Promise<Envelope<unknown>>;
153
- };
154
- payments: {
155
- charge: (input: PaymentsChargeInput) => Promise<Envelope<unknown>>;
156
- refund: (input: PaymentsRefundInput) => Promise<Envelope<unknown>>;
157
- intent: (input: PaymentsIntentInput) => Promise<Envelope<unknown>>;
158
- list: (input?: PaymentsListInput) => Promise<Envelope<unknown>>;
159
- onboard: () => Promise<Envelope<PaymentsStatus & {
160
- onboarding_url: string | null;
161
- }>>;
162
- status: () => Promise<Envelope<PaymentsStatus>>;
163
- events: (limit?: number) => Promise<Envelope<{
164
- events: PaymentEvent[];
165
- }>>;
166
- setWebhook: (url: string) => Promise<Envelope<{
167
- url: string;
168
- secret: string;
169
- }>>;
170
- clearWebhook: () => Promise<Envelope<{
171
- cleared: boolean;
172
- }>>;
173
- };
174
- tools: {
175
- discover: (input: ToolsDiscoverInput) => Promise<Envelope<ToolCard[]>>;
176
- inspect: (input: ToolsInspectInput) => Promise<Envelope<ToolContract>>;
177
- run: (input: ToolsRunInput) => Promise<Envelope<ToolRunResult>>;
178
- };
179
- /** Ingest into the entity spine — `docs`, `csv`, `records` (SQL/CRM rows), `http`, or `tool`. */
180
- ingest: (input: {
181
- docs?: {
182
- id: string;
183
- text: string;
184
- type?: string;
185
- name?: string;
186
- }[];
187
- csv?: Record<string, unknown>;
188
- records?: Record<string, unknown>;
189
- http?: Record<string, unknown>;
190
- tool?: Record<string, unknown>;
191
- }) => Promise<Envelope<{
192
- entities: number;
193
- facts: number;
194
- }>>;
195
- context: {
196
- fetch: (input: {
197
- task: string;
198
- scope?: ContextScope;
199
- entities?: string[];
200
- tokenBudget?: number;
201
- }) => Promise<Envelope<ContextPacket>>;
202
- query: (input: {
203
- question: string;
204
- scope?: ContextScope;
205
- tokenBudget?: number;
206
- }) => Promise<Envelope<{
207
- answer: string;
208
- packet: ContextPacket;
209
- }>>;
210
- diff: (cursor: string) => Promise<Envelope<ContextDiff>>;
211
- replay: (packetId: string, at?: number) => Promise<Envelope<ContextPacket>>;
212
- ledger: (query?: {
213
- entity?: string;
214
- session?: string;
215
- since?: number;
216
- actions?: boolean;
217
- decisions?: boolean;
218
- }) => Promise<Envelope<LedgerEntry[]>>;
219
- /** Sign a human judgment about a proposed call into the same prev-hash
220
- * chain as the calls, so a refusal is as provable as an approval. `args`
221
- * is hashed server-side and never stored raw. */
222
- decide: (input: {
223
- action: string;
224
- outcome: "approved" | "rejected" | "amended";
225
- decidedBy: string;
226
- args?: Record<string, unknown>;
227
- surface?: string;
228
- credits?: number;
229
- approvalId?: string;
230
- }) => Promise<Envelope<{
231
- seq: number;
232
- kind: string;
233
- contentHash: string;
234
- decision: unknown;
235
- }>>;
236
- writeback: (input: {
237
- entity: string;
238
- rows: unknown[];
239
- scope?: ContextScope;
240
- approval?: boolean;
241
- }) => Promise<Envelope<{
242
- applied: number;
243
- auditId: string;
244
- }>>;
245
- eval: () => Promise<Envelope<EvalReport>>;
246
- };
247
- memoryPlane: {
248
- add: (input: {
249
- text: string;
250
- scope?: ContextScope;
251
- entityIds?: string[];
252
- confidence?: number;
253
- }) => Promise<Envelope<ContextMemory>>;
254
- search: (query: string, k?: number) => Promise<Envelope<ContextMemory[]>>;
255
- forget: (id: string) => Promise<Envelope<{
256
- forgotten: boolean;
257
- }>>;
258
- };
259
- entity: {
260
- resolve: (ref: string, type?: string) => Promise<Envelope<EntityResolution>>;
261
- graph: (id: string) => Promise<Envelope<{
262
- entityId: string;
263
- relations: unknown[];
264
- neighbors: string[];
265
- }>>;
266
- };
267
- sessions: {
268
- create: (input?: {
269
- scope?: ContextScope;
270
- ttlMs?: number;
271
- id?: string;
272
- metadata?: Record<string, unknown>;
273
- }) => Promise<Envelope<Session>>;
274
- list: () => Promise<Envelope<Session[]>>;
275
- /** Read a session, including its persisted context `window`. */
276
- get: (id: string) => Promise<Envelope<Session>>;
277
- use: (id: string) => Promise<Envelope<Session>>;
278
- forget: (id: string) => Promise<Envelope<{
279
- forgotten: boolean;
280
- }>>;
281
- };
282
- /**
283
- * Call a capability bound to a session, so the call joins that session's
284
- * context window and its receipt carries the session.
285
- *
286
- * This is the grounded-call path: create a session, `context.fetch` into it,
287
- * then call through here and every subsequent call is already sitting on the
288
- * grounding the session accumulated — no re-fetch per tool call, and a
289
- * receipt that can reconstruct the whole sequence.
290
- */
291
- grounded: {
292
- fetch: (session: string, input: {
293
- task: string;
294
- scope?: ContextScope;
295
- entities?: string[];
296
- tokenBudget?: number;
297
- }) => Promise<Envelope<ContextPacket>>;
298
- query: (session: string, input: {
299
- question: string;
300
- scope?: ContextScope;
301
- tokenBudget?: number;
302
- }) => Promise<Envelope<{
303
- answer: string;
304
- packet: ContextPacket;
305
- }>>;
306
- call: <T = unknown>(session: string, capability: string, input: object, packetId?: string) => Promise<Envelope<T>>;
307
- };
308
- actions: {
309
- import: (kind: "toolkit" | "mcp" | "connectors", name: string) => Promise<Envelope<{
310
- kind: string;
311
- name: string;
312
- url?: string;
313
- }>>;
314
- list: (kind: "toolkit" | "mcp" | "connectors", name: string) => Promise<Envelope<{
315
- kind: string;
316
- name: string;
317
- actions: unknown[];
318
- }>>;
319
- run: (kind: "toolkit" | "mcp" | "connectors", name: string, action: string, args?: Record<string, unknown>) => Promise<Envelope<unknown>>;
320
- };
321
- credits: {
322
- balance: () => Promise<Envelope<unknown>>;
323
- packs: () => Promise<{
324
- ok: false;
325
- error: import("./types").MuxoError;
326
- } | unknown[]>;
327
- checkout: (pack: string) => Promise<Envelope<unknown>>;
328
- };
329
- workflows: {
330
- run: (name: string, params?: Record<string, string | number | boolean>) => Promise<Envelope<unknown>>;
331
- executions: (name: string) => Promise<Envelope<unknown>>;
332
- };
333
- status: () => Promise<Envelope<unknown>>;
334
- capabilities: () => Promise<Envelope<unknown>>;
335
- usage: () => Promise<Envelope<unknown>>;
336
- manifest: {
337
- get: () => Promise<Envelope<unknown>>;
338
- put: (text: string) => Promise<Envelope<unknown>>;
339
- versions: () => Promise<Envelope<unknown>>;
340
- plan: (text: string) => Promise<Envelope<unknown>>;
341
- };
342
- keys: {
343
- list: () => Promise<Envelope<unknown>>;
344
- create: () => Promise<Envelope<unknown>>;
345
- revoke: (id: string) => Promise<Envelope<unknown>>;
346
- };
347
- rollback(version?: number): Promise<Envelope<unknown>>;
348
- }
349
- //# sourceMappingURL=index.d.ts.map
1351
+
1352
+ export {};