@tai42/api-client 0.1.0

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 (48) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +28 -0
  3. package/dist/agents.d.ts +265 -0
  4. package/dist/agents.d.ts.map +1 -0
  5. package/dist/agents.js +200 -0
  6. package/dist/agents.js.map +1 -0
  7. package/dist/client.d.ts +1316 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +468 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/errors.d.ts +43 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +63 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/fleet-report.d.ts +61 -0
  16. package/dist/fleet-report.d.ts.map +1 -0
  17. package/dist/fleet-report.js +42 -0
  18. package/dist/fleet-report.js.map +1 -0
  19. package/dist/http.d.ts +69 -0
  20. package/dist/http.d.ts.map +1 -0
  21. package/dist/http.js +152 -0
  22. package/dist/http.js.map +1 -0
  23. package/dist/index.d.ts +23 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +16 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/schemas.d.ts +5469 -0
  28. package/dist/schemas.d.ts.map +1 -0
  29. package/dist/schemas.js +1103 -0
  30. package/dist/schemas.js.map +1 -0
  31. package/dist/sse.d.ts +27 -0
  32. package/dist/sse.d.ts.map +1 -0
  33. package/dist/sse.js +84 -0
  34. package/dist/sse.js.map +1 -0
  35. package/dist/tool-runs.d.ts +112 -0
  36. package/dist/tool-runs.d.ts.map +1 -0
  37. package/dist/tool-runs.js +70 -0
  38. package/dist/tool-runs.js.map +1 -0
  39. package/package.json +51 -0
  40. package/src/agents.ts +248 -0
  41. package/src/client.ts +837 -0
  42. package/src/errors.ts +67 -0
  43. package/src/fleet-report.ts +94 -0
  44. package/src/http.ts +198 -0
  45. package/src/index.ts +142 -0
  46. package/src/schemas.ts +1341 -0
  47. package/src/sse.ts +90 -0
  48. package/src/tool-runs.ts +103 -0
@@ -0,0 +1,1316 @@
1
+ /**
2
+ * The typed client: one method per endpoint, each validating
3
+ * its response against the matching zod schema. Server state flows through
4
+ * TanStack Query in the features; this client is a plain typed transport with no
5
+ * caching of its own.
6
+ */
7
+ import { type ApiConfig } from './http';
8
+ import { type SubmitToolRunArgs } from './tool-runs';
9
+ import * as s from './schemas';
10
+ export interface RunToolArgs {
11
+ readonly tool: string;
12
+ readonly kwargs?: Record<string, unknown>;
13
+ }
14
+ export interface StartConnectArgs {
15
+ readonly provider_id: string;
16
+ readonly alias: string;
17
+ readonly enabled_sub_services: string[];
18
+ readonly config_values?: Record<string, string>;
19
+ readonly return_url?: string;
20
+ }
21
+ /** Body for creating or editing an API key (POST/PUT `/api/auth/api-keys`). */
22
+ export interface ApiKeyBody {
23
+ readonly user_id: string;
24
+ readonly description: string;
25
+ readonly scopes: string[];
26
+ readonly policy_data?: Record<string, unknown> | null;
27
+ readonly condition?: string | null;
28
+ readonly condition_id?: string | null;
29
+ readonly condition_kwargs?: Record<string, unknown> | null;
30
+ }
31
+ /**
32
+ * Body for one-time claim-link creation (POST `/api/auth/claim-links`). The
33
+ * `api_key` is a raw key the caller holds (the just-minted key, client-side
34
+ * exactly once); `ttl_seconds` optionally overrides the default lifetime (the
35
+ * server caps it at its ceiling).
36
+ */
37
+ export interface ClaimLinkBody {
38
+ readonly api_key: string;
39
+ readonly ttl_seconds?: number | null;
40
+ }
41
+ /**
42
+ * Body for the fail-closed jq guard (POST `/api/auth/validate-condition`).
43
+ * `condition` (inline jq) and `condition_id` (named template) are mutually
44
+ * exclusive — send exactly one. `sample_context` is a `JqAuthContext`-shaped
45
+ * sample; when present the guard also evaluates the condition against it and
46
+ * returns the boolean `result` (else `result` is `null`).
47
+ */
48
+ export interface ValidateConditionBody {
49
+ readonly condition?: string;
50
+ readonly condition_id?: string;
51
+ readonly condition_kwargs?: Record<string, unknown>;
52
+ readonly sample_context?: Record<string, unknown>;
53
+ }
54
+ /**
55
+ * Body for binding a webhook verifier to a topic
56
+ * (PUT `/api/hooks/topics/{topic}/verifier`). `verifier` is a registered verifier
57
+ * NAME, resolved against the live registry at bind time (an unknown name is a loud
58
+ * 400). `config` is that verifier's config object — it carries a `secret_env` name,
59
+ * never a secret value — and defaults to `{}` when omitted.
60
+ */
61
+ export interface TopicVerifierBody {
62
+ readonly verifier: string;
63
+ readonly config?: Record<string, unknown>;
64
+ }
65
+ /** Body for adding a URL to a scope (POST `/api/auth/scopes`). */
66
+ export interface AddUrlToScopeBody {
67
+ readonly scope_id: string;
68
+ readonly url: string;
69
+ readonly pattern?: string;
70
+ }
71
+ /**
72
+ * Body for pinning a route public (POST `/api/auth/public-routes`). `pattern` is an
73
+ * optional regex the AC verifier full-matches request paths against, mapping every
74
+ * match to the `url` key (so a mount's whole subtree can be pinned in one call).
75
+ */
76
+ export interface PinRoutePublicBody {
77
+ readonly url: string;
78
+ readonly pattern?: string;
79
+ }
80
+ /**
81
+ * Body for creating a preset (POST `/api/presets`). `tags` are the preset's
82
+ * categorization labels. `extensions` is the combos list — the create flow OMITS
83
+ * it when there are no combos (the route rejects an explicit `extensions: []`).
84
+ * `output_schema` is the optional author-set output JSON Schema. Each combo
85
+ * element is a bare extension name or a `{ name, config }` mapping.
86
+ */
87
+ export interface CreatePresetBody {
88
+ readonly name: string;
89
+ readonly base_tool: string;
90
+ readonly description?: string;
91
+ readonly fixed_kwargs?: Record<string, unknown>;
92
+ readonly tags?: readonly string[];
93
+ readonly extensions?: readonly s.PresetExtensionElement[][];
94
+ readonly output_schema?: Record<string, unknown> | null;
95
+ }
96
+ /**
97
+ * Body for saving a new preset version (POST `/api/presets/{name}/versions`). At
98
+ * least one field must be provided (an empty body is a loud 400). Each field's
99
+ * sentinel is uniform: omitted carries the active version's value forward; an
100
+ * explicit `[]` clears `tags`/`extensions`, and an explicit `null` clears
101
+ * `output_schema`.
102
+ */
103
+ export interface SavePresetVersionBody {
104
+ readonly fixed_kwargs?: Record<string, unknown>;
105
+ readonly tags?: readonly string[];
106
+ readonly extensions?: readonly s.PresetExtensionElement[][];
107
+ readonly output_schema?: Record<string, unknown> | null;
108
+ }
109
+ /**
110
+ * Body for the dry-run validate door (POST `/api/presets/validate`). `name` is
111
+ * required and selects the verdict mode server-side: CREATE when no preset named
112
+ * `name` exists (then `base_tool` is required), VERSION when one does (the version
113
+ * fields are read under save-version semantics). The draft is sent exactly as the
114
+ * matching write would send it.
115
+ */
116
+ export interface ValidatePresetBody {
117
+ readonly name: string;
118
+ readonly base_tool?: string;
119
+ readonly description?: string;
120
+ readonly fixed_kwargs?: Record<string, unknown>;
121
+ readonly tags?: readonly string[];
122
+ readonly extensions?: readonly s.PresetExtensionElement[][];
123
+ readonly output_schema?: Record<string, unknown> | null;
124
+ }
125
+ /**
126
+ * Body for a storage upload (POST `/api/storage/resources`). Exactly ONE of
127
+ * `content_text` (stored verbatim) or `content_base64` (a base64 string decoded to
128
+ * bytes) supplies the content for `id`; uploading an existing id overwrites it
129
+ * (provider passthrough semantics).
130
+ */
131
+ export interface StorageUploadBody {
132
+ readonly id: string;
133
+ readonly content_text?: string;
134
+ readonly content_base64?: string;
135
+ }
136
+ /** The observability-metrics window + bucket size (GET query params). */
137
+ export interface MetricsQuery {
138
+ readonly from?: string;
139
+ readonly to?: string;
140
+ readonly granularity?: string;
141
+ }
142
+ /**
143
+ * The observability runs filter. List/dict-valued params (`tags`) are
144
+ * JSON-encoded into the query string; scalars are sent verbatim. Shared by
145
+ * `listRuns` and the `exportRuns` download.
146
+ */
147
+ export interface RunsQuery {
148
+ readonly from?: string;
149
+ readonly to?: string;
150
+ readonly tags?: string[];
151
+ readonly status?: 'error' | 'success';
152
+ readonly minCost?: number;
153
+ readonly maxCost?: number;
154
+ readonly minTokens?: number;
155
+ readonly maxTokens?: number;
156
+ readonly minLatencyMs?: number;
157
+ readonly maxLatencyMs?: number;
158
+ readonly sort?: string;
159
+ readonly dir?: 'asc' | 'desc';
160
+ readonly page?: number;
161
+ readonly pageSize?: number;
162
+ }
163
+ /**
164
+ * The marketplace search filter (GET `/api/marketplace/search` query params).
165
+ * `tags` is sent as REPEATED `tags` params, one per value; `page` is supplied
166
+ * per-request by the infinite query, never from the URL. `tier`, `namespace`,
167
+ * `contract`, and `page_size` are accepted by the route but the v1 UI sends none
168
+ * of them (every v1 row is official/tai42; the page size stays the server
169
+ * default) — they exist for contract completeness.
170
+ */
171
+ export interface MarketplaceSearchQuery {
172
+ readonly q?: string;
173
+ readonly kind?: string;
174
+ readonly category?: string;
175
+ readonly tags?: string[];
176
+ readonly namespace?: string;
177
+ readonly tier?: string;
178
+ readonly contract?: string;
179
+ readonly sort?: 'downloads' | 'updated' | 'name' | 'relevance';
180
+ readonly page?: number;
181
+ readonly page_size?: number;
182
+ }
183
+ /** Body for installing / updating a plugin. `ref` is `namespace/name`. */
184
+ export interface MarketplaceInstallBody {
185
+ readonly ref: string;
186
+ readonly version?: string;
187
+ }
188
+ /** Body for uninstalling a plugin. */
189
+ export interface MarketplaceUninstallBody {
190
+ readonly ref: string;
191
+ }
192
+ /**
193
+ * Whether a login-method target is a safe same-origin relative API path. The
194
+ * login screen is the one page where a misconfigured/compromised manifest could
195
+ * redirect CREDENTIALS off-origin, so a `submit_path`/`href` MUST start `/api/`
196
+ * — anything else (absolute URL, protocol-relative `//host`, missing prefix) is
197
+ * rejected. The `/api/` prefix already excludes `//`-prefixed values; the
198
+ * explicit double-slash clause is kept for readability.
199
+ */
200
+ export declare function isSafeApiPath(path: string): boolean;
201
+ export declare function createApiClient(config: ApiConfig): {
202
+ readonly listTools: (signal?: AbortSignal) => Promise<string[]>;
203
+ readonly getToolSchema: (name: string, signal?: AbortSignal) => Promise<{
204
+ input: Record<string, unknown>;
205
+ output: Record<string, unknown> | null;
206
+ description: string | null;
207
+ }>;
208
+ readonly getAllToolSchemas: (signal?: AbortSignal) => Promise<Record<string, {
209
+ input: Record<string, unknown>;
210
+ output: Record<string, unknown> | null;
211
+ description: string | null;
212
+ }>>;
213
+ readonly runTool: (args: RunToolArgs, signal?: AbortSignal) => Promise<unknown>;
214
+ readonly submitToolRun: (args: SubmitToolRunArgs, signal?: AbortSignal) => Promise<{
215
+ run_id: string;
216
+ }>;
217
+ readonly getToolRun: (runId: string, signal?: AbortSignal) => Promise<{
218
+ status: "failed" | "running" | "succeeded" | "lost";
219
+ run_id: string;
220
+ tool_name: string;
221
+ started_at: string;
222
+ error?: string | undefined;
223
+ result?: unknown;
224
+ finished_at?: string | undefined;
225
+ }>;
226
+ readonly listToolRuns: (toolName: string, signal?: AbortSignal) => Promise<{
227
+ status: "failed" | "running" | "succeeded" | "lost";
228
+ run_id: string;
229
+ tool_name: string;
230
+ started_at: string;
231
+ finished_at?: string | undefined;
232
+ }[]>;
233
+ readonly listToolTags: (signal?: AbortSignal) => Promise<{
234
+ name: string;
235
+ tags: string[];
236
+ }[]>;
237
+ readonly listPresets: (signal?: AbortSignal) => Promise<{
238
+ description: string;
239
+ name: string;
240
+ tags: string[];
241
+ base_tool: string;
242
+ active_version: number;
243
+ extensions: (string | {
244
+ name: string;
245
+ config: Record<string, unknown>;
246
+ })[][];
247
+ output_schema: Record<string, unknown> | null;
248
+ conflicted: boolean;
249
+ conflicted_reason: string | null;
250
+ }[]>;
251
+ readonly createPreset: (body: CreatePresetBody) => Promise<{
252
+ description: string;
253
+ name: string;
254
+ tags: string[];
255
+ base_tool: string;
256
+ active_version: number;
257
+ extensions: (string | {
258
+ name: string;
259
+ config: Record<string, unknown>;
260
+ })[][];
261
+ output_schema: Record<string, unknown> | null;
262
+ conflicted: boolean;
263
+ conflicted_reason: string | null;
264
+ }>;
265
+ readonly getPreset: (name: string, signal?: AbortSignal) => Promise<{
266
+ description: string;
267
+ name: string;
268
+ tags: string[];
269
+ base_tool: string;
270
+ active_version: number;
271
+ extensions: (string | {
272
+ name: string;
273
+ config: Record<string, unknown>;
274
+ })[][];
275
+ output_schema: Record<string, unknown> | null;
276
+ conflicted: boolean;
277
+ conflicted_reason: string | null;
278
+ fixed_kwargs: Record<string, unknown>;
279
+ }>;
280
+ readonly listPresetVersions: (name: string, signal?: AbortSignal) => Promise<{
281
+ tags: string[];
282
+ version: number;
283
+ body: {
284
+ description: string;
285
+ tags: string[];
286
+ base_tool: string;
287
+ extensions: (string | {
288
+ name: string;
289
+ config: Record<string, unknown>;
290
+ })[][];
291
+ output_schema: Record<string, unknown> | null;
292
+ fixed_kwargs: Record<string, unknown>;
293
+ };
294
+ created_at: string;
295
+ is_current: boolean;
296
+ }[]>;
297
+ readonly getPresetVersion: (name: string, version: number, signal?: AbortSignal) => Promise<{
298
+ tags: string[];
299
+ version: number;
300
+ body: {
301
+ description: string;
302
+ tags: string[];
303
+ base_tool: string;
304
+ extensions: (string | {
305
+ name: string;
306
+ config: Record<string, unknown>;
307
+ })[][];
308
+ output_schema: Record<string, unknown> | null;
309
+ fixed_kwargs: Record<string, unknown>;
310
+ };
311
+ created_at: string;
312
+ is_current: boolean;
313
+ }>;
314
+ readonly savePresetVersion: (name: string, body: SavePresetVersionBody) => Promise<{
315
+ tags: string[];
316
+ version: number;
317
+ body: {
318
+ description: string;
319
+ tags: string[];
320
+ base_tool: string;
321
+ extensions: (string | {
322
+ name: string;
323
+ config: Record<string, unknown>;
324
+ })[][];
325
+ output_schema: Record<string, unknown> | null;
326
+ fixed_kwargs: Record<string, unknown>;
327
+ };
328
+ created_at: string;
329
+ is_current: boolean;
330
+ }>;
331
+ readonly rollbackPreset: (name: string, version: number) => Promise<{
332
+ name: string;
333
+ active_version: number;
334
+ }>;
335
+ readonly deletePreset: (name: string) => Promise<{
336
+ name: string;
337
+ deleted: true;
338
+ }>;
339
+ readonly renamePreset: (name: string, newName: string) => Promise<{
340
+ name: string;
341
+ active_version: number;
342
+ renamed_from: string;
343
+ }>;
344
+ readonly getPresetReferees: (name: string, signal?: AbortSignal) => Promise<{
345
+ name: string;
346
+ referees: string[];
347
+ }>;
348
+ readonly validatePreset: (body: ValidatePresetBody) => Promise<{
349
+ error: string | null;
350
+ valid: boolean;
351
+ }>;
352
+ readonly setPresetVersionTags: (name: string, version: number, tags: readonly string[]) => Promise<{
353
+ name: string;
354
+ tags: string[];
355
+ version: number;
356
+ }>;
357
+ readonly getStorageInfo: (signal?: AbortSignal) => Promise<{
358
+ present: boolean;
359
+ provider: string | null;
360
+ module: string | null;
361
+ }>;
362
+ readonly listStorageResources: (signal?: AbortSignal) => Promise<{
363
+ resources: string[];
364
+ }>;
365
+ readonly statStorageResource: (id: string, signal?: AbortSignal) => Promise<{
366
+ id: string;
367
+ content_type: string | null;
368
+ }>;
369
+ readonly downloadStorageResource: (id: string, signal?: AbortSignal) => Promise<Blob>;
370
+ readonly uploadStorageResource: (body: StorageUploadBody) => Promise<{
371
+ id: string;
372
+ stored: true;
373
+ }>;
374
+ readonly deleteStorageResource: (id: string) => Promise<{
375
+ deleted: true;
376
+ id: string;
377
+ }>;
378
+ readonly deleteStorageDir: (path: string) => Promise<{
379
+ deleted: true;
380
+ dir: string;
381
+ }>;
382
+ readonly getBackendInfo: (signal?: AbortSignal) => Promise<{
383
+ present: boolean;
384
+ module: string | null;
385
+ backend: string | null;
386
+ }>;
387
+ readonly listFleetWorkers: (signal?: AbortSignal) => Promise<{
388
+ workers: {
389
+ kind: "backend" | "serve";
390
+ origin: string;
391
+ pid: number;
392
+ }[];
393
+ }>;
394
+ readonly reloadFleetConfig: (targets: string[] | null) => Promise<{
395
+ error: string | null;
396
+ op: string;
397
+ reachable: boolean;
398
+ local_only: boolean;
399
+ results: {
400
+ error: string | null;
401
+ origin: string;
402
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
403
+ detail: string | null;
404
+ payload?: unknown;
405
+ }[];
406
+ }>;
407
+ readonly listExtensions: (signal?: AbortSignal) => Promise<{
408
+ name: string;
409
+ kind: string;
410
+ }[]>;
411
+ readonly getToolExtensions: (name: string, signal?: AbortSignal) => Promise<{
412
+ combos: (string | {
413
+ name: string;
414
+ config: Record<string, unknown>;
415
+ })[][];
416
+ available: {
417
+ name: string;
418
+ kind: string;
419
+ }[];
420
+ }>;
421
+ readonly setToolExtensions: (name: string, combos: readonly s.PresetExtensionElement[][]) => Promise<{
422
+ status: string;
423
+ env_keys: number;
424
+ fanout: {
425
+ mode: "local-only";
426
+ note: string;
427
+ } | {
428
+ error: string | null;
429
+ op: string;
430
+ reachable: boolean;
431
+ local_only: boolean;
432
+ results: {
433
+ error: string | null;
434
+ origin: string;
435
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
436
+ detail: string | null;
437
+ payload?: unknown;
438
+ }[];
439
+ mode: "fleet";
440
+ } | {
441
+ error: string | null;
442
+ op: string;
443
+ reachable: boolean;
444
+ local_only: boolean;
445
+ results: {
446
+ error: string | null;
447
+ origin: string;
448
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
449
+ detail: string | null;
450
+ payload?: unknown;
451
+ }[];
452
+ mode: "unreachable";
453
+ };
454
+ }>;
455
+ readonly listTemplates: (signal?: AbortSignal) => Promise<string[]>;
456
+ readonly getTemplate: (templateId: string) => Promise<{
457
+ template: string;
458
+ schema: Record<string, unknown>;
459
+ }>;
460
+ readonly uploadTemplate: (path: string, content: string) => Promise<{
461
+ path: string;
462
+ uploaded: true;
463
+ }>;
464
+ readonly deleteTemplate: (path: string) => Promise<{
465
+ path: string;
466
+ deleted: true;
467
+ }>;
468
+ readonly renderTemplate: (body: {
469
+ content?: string;
470
+ template_id?: string;
471
+ kwargs?: Record<string, unknown>;
472
+ }) => Promise<{
473
+ rendered: string;
474
+ }>;
475
+ readonly clearTemplatesCache: () => Promise<{
476
+ cleared: true;
477
+ }>;
478
+ readonly getManifest: (signal?: AbortSignal) => Promise<{
479
+ mcp: Record<string, unknown>[];
480
+ user_tools: string[];
481
+ }>;
482
+ readonly setMcpConfig: (mcp: unknown[]) => Promise<{
483
+ status: string;
484
+ env_keys: number;
485
+ fanout: {
486
+ mode: "local-only";
487
+ note: string;
488
+ } | {
489
+ error: string | null;
490
+ op: string;
491
+ reachable: boolean;
492
+ local_only: boolean;
493
+ results: {
494
+ error: string | null;
495
+ origin: string;
496
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
497
+ detail: string | null;
498
+ payload?: unknown;
499
+ }[];
500
+ mode: "fleet";
501
+ } | {
502
+ error: string | null;
503
+ op: string;
504
+ reachable: boolean;
505
+ local_only: boolean;
506
+ results: {
507
+ error: string | null;
508
+ origin: string;
509
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
510
+ detail: string | null;
511
+ payload?: unknown;
512
+ }[];
513
+ mode: "unreachable";
514
+ };
515
+ }>;
516
+ readonly getMcpStatus: (signal?: AbortSignal) => Promise<{
517
+ failed: {
518
+ status: string;
519
+ title: string;
520
+ }[];
521
+ bound: Record<string, string[]>;
522
+ }>;
523
+ readonly reloadMcp: (title: string) => Promise<{
524
+ error: string | null;
525
+ op: string;
526
+ reachable: boolean;
527
+ local_only: boolean;
528
+ results: {
529
+ error: string | null;
530
+ origin: string;
531
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
532
+ detail: string | null;
533
+ payload?: unknown;
534
+ }[];
535
+ }>;
536
+ readonly listSubMcp: (signal?: AbortSignal) => Promise<Record<string, Record<string, unknown>>>;
537
+ readonly createSubMcp: (slug: string, tools: string[]) => Promise<{
538
+ slug: string;
539
+ tools: string[];
540
+ }>;
541
+ readonly deleteSubMcp: (slug: string) => Promise<{
542
+ slug: string;
543
+ removed: true;
544
+ }>;
545
+ readonly getEnvConfig: (signal?: AbortSignal) => Promise<{
546
+ env: Record<string, string>;
547
+ secret_keys: string[];
548
+ }>;
549
+ readonly setEnvConfig: (env: Record<string, string>) => Promise<{
550
+ status: string;
551
+ env_keys: number;
552
+ fanout: {
553
+ mode: "local-only";
554
+ note: string;
555
+ } | {
556
+ error: string | null;
557
+ op: string;
558
+ reachable: boolean;
559
+ local_only: boolean;
560
+ results: {
561
+ error: string | null;
562
+ origin: string;
563
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
564
+ detail: string | null;
565
+ payload?: unknown;
566
+ }[];
567
+ mode: "fleet";
568
+ } | {
569
+ error: string | null;
570
+ op: string;
571
+ reachable: boolean;
572
+ local_only: boolean;
573
+ results: {
574
+ error: string | null;
575
+ origin: string;
576
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
577
+ detail: string | null;
578
+ payload?: unknown;
579
+ }[];
580
+ mode: "unreachable";
581
+ };
582
+ }>;
583
+ readonly getConfigMode: (signal?: AbortSignal) => Promise<{
584
+ config_mode: string;
585
+ read_only: boolean;
586
+ }>;
587
+ readonly listProviders: (signal?: AbortSignal) => Promise<{
588
+ description: string;
589
+ kind: "oauth" | "none";
590
+ id: string;
591
+ origin: "system" | "community";
592
+ display_name: string;
593
+ icon_url: string;
594
+ category: string;
595
+ sub_services: {
596
+ description: string;
597
+ id: string;
598
+ display_name: string;
599
+ scopes: string[];
600
+ }[];
601
+ config_fields: {
602
+ key: string;
603
+ required: boolean;
604
+ label: string;
605
+ target: "env" | "header";
606
+ secret: boolean;
607
+ }[];
608
+ }[]>;
609
+ readonly listConnections: (signal?: AbortSignal) => Promise<{
610
+ items: {
611
+ kind: "oauth" | "none";
612
+ created_at: string;
613
+ connection_id: string;
614
+ provider_id: string;
615
+ alias: string;
616
+ account_identity: string | null;
617
+ enabled_sub_services: string[];
618
+ granted_scopes: string[];
619
+ auth_health_state: "healthy" | "reconnect_required" | "refresh_failing";
620
+ }[];
621
+ total: number;
622
+ }>;
623
+ readonly getConnection: (id: string, signal?: AbortSignal) => Promise<{
624
+ kind: "oauth" | "none";
625
+ created_at: string;
626
+ connection_id: string;
627
+ provider_id: string;
628
+ alias: string;
629
+ account_identity: string | null;
630
+ enabled_sub_services: string[];
631
+ granted_scopes: string[];
632
+ auth_health_state: "healthy" | "reconnect_required" | "refresh_failing";
633
+ }>;
634
+ readonly startConnect: (args: StartConnectArgs) => Promise<{
635
+ flow_id: string;
636
+ authorize_url: string;
637
+ } | {
638
+ fanout: {
639
+ mode: "local-only";
640
+ note: string;
641
+ } | {
642
+ error: string | null;
643
+ op: string;
644
+ reachable: boolean;
645
+ local_only: boolean;
646
+ results: {
647
+ error: string | null;
648
+ origin: string;
649
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
650
+ detail: string | null;
651
+ payload?: unknown;
652
+ }[];
653
+ mode: "fleet";
654
+ } | {
655
+ error: string | null;
656
+ op: string;
657
+ reachable: boolean;
658
+ local_only: boolean;
659
+ results: {
660
+ error: string | null;
661
+ origin: string;
662
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
663
+ detail: string | null;
664
+ payload?: unknown;
665
+ }[];
666
+ mode: "unreachable";
667
+ } | null;
668
+ connection_id: string;
669
+ added_manifest_entries: string[];
670
+ }>;
671
+ readonly disconnect: (id: string) => Promise<{
672
+ fanout: {
673
+ mode: "local-only";
674
+ note: string;
675
+ } | {
676
+ error: string | null;
677
+ op: string;
678
+ reachable: boolean;
679
+ local_only: boolean;
680
+ results: {
681
+ error: string | null;
682
+ origin: string;
683
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
684
+ detail: string | null;
685
+ payload?: unknown;
686
+ }[];
687
+ mode: "fleet";
688
+ } | {
689
+ error: string | null;
690
+ op: string;
691
+ reachable: boolean;
692
+ local_only: boolean;
693
+ results: {
694
+ error: string | null;
695
+ origin: string;
696
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
697
+ detail: string | null;
698
+ payload?: unknown;
699
+ }[];
700
+ mode: "unreachable";
701
+ } | null;
702
+ connection_id: string;
703
+ upstream_revoke_outcome: "failed" | "success" | "skipped";
704
+ upstream_revoke_status: number | null;
705
+ removed_manifest_entries: string[];
706
+ }>;
707
+ readonly reconnect: (id: string, enabled_sub_services: string[], return_url?: string) => Promise<{
708
+ flow_id: string;
709
+ authorize_url: string;
710
+ }>;
711
+ readonly patchSubServices: (id: string, enabled_sub_services: string[], return_url?: string) => Promise<{
712
+ fanout: {
713
+ mode: "local-only";
714
+ note: string;
715
+ } | {
716
+ error: string | null;
717
+ op: string;
718
+ reachable: boolean;
719
+ local_only: boolean;
720
+ results: {
721
+ error: string | null;
722
+ origin: string;
723
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
724
+ detail: string | null;
725
+ payload?: unknown;
726
+ }[];
727
+ mode: "fleet";
728
+ } | {
729
+ error: string | null;
730
+ op: string;
731
+ reachable: boolean;
732
+ local_only: boolean;
733
+ results: {
734
+ error: string | null;
735
+ origin: string;
736
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
737
+ detail: string | null;
738
+ payload?: unknown;
739
+ }[];
740
+ mode: "unreachable";
741
+ } | null;
742
+ connection_id: string;
743
+ enabled_sub_services: string[];
744
+ flow_id: string | null;
745
+ authorize_url: string | null;
746
+ added_manifest_entries: string[];
747
+ removed_manifest_entries: string[];
748
+ consent_required: boolean;
749
+ }>;
750
+ readonly completeOAuth: (state: string, code: string, error?: string) => Promise<{
751
+ kind: "success";
752
+ fanout: {
753
+ mode: "local-only";
754
+ note: string;
755
+ } | {
756
+ error: string | null;
757
+ op: string;
758
+ reachable: boolean;
759
+ local_only: boolean;
760
+ results: {
761
+ error: string | null;
762
+ origin: string;
763
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
764
+ detail: string | null;
765
+ payload?: unknown;
766
+ }[];
767
+ mode: "fleet";
768
+ } | {
769
+ error: string | null;
770
+ op: string;
771
+ reachable: boolean;
772
+ local_only: boolean;
773
+ results: {
774
+ error: string | null;
775
+ origin: string;
776
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
777
+ detail: string | null;
778
+ payload?: unknown;
779
+ }[];
780
+ mode: "unreachable";
781
+ } | null;
782
+ connection_id: string;
783
+ return_url: string;
784
+ } | {
785
+ kind: "failed";
786
+ reason: string;
787
+ } | {
788
+ message: string;
789
+ kind: "cancelled";
790
+ }>;
791
+ readonly listStudioPlugins: (signal?: AbortSignal) => Promise<{
792
+ name: string;
793
+ version: string;
794
+ api_version: number;
795
+ entry: string;
796
+ integrity: Record<string, string>;
797
+ contributions: {
798
+ tool_panels: Record<string, string>;
799
+ pages: string[];
800
+ settings_tabs: string[];
801
+ nav_entries: string[];
802
+ };
803
+ }[]>;
804
+ readonly answerInteraction: (interactionId: string, answer: unknown) => Promise<{
805
+ status: string;
806
+ interaction_id: string;
807
+ }>;
808
+ readonly listChannels: (signal?: AbortSignal) => Promise<{
809
+ channels: string[];
810
+ }>;
811
+ readonly listNotifications: (signal?: AbortSignal) => Promise<{
812
+ notifications: {
813
+ message: string;
814
+ created_at: string;
815
+ id: string;
816
+ recipient: string | null;
817
+ }[];
818
+ }>;
819
+ readonly listAgents: (signal?: AbortSignal) => Promise<{
820
+ items: {
821
+ description: string;
822
+ name: string;
823
+ tool_name: string;
824
+ input_schema: Record<string, unknown>;
825
+ spec_runnable: boolean;
826
+ }[];
827
+ total: number;
828
+ }>;
829
+ readonly listSpecRunnableAgents: (signal?: AbortSignal) => Promise<{
830
+ items: {
831
+ description: string;
832
+ name: string;
833
+ tool_name: string;
834
+ input_schema: Record<string, unknown>;
835
+ spec_runnable: boolean;
836
+ }[];
837
+ total: number;
838
+ }>;
839
+ readonly streamAgentRun: (name: string, input: unknown, signal?: AbortSignal) => Promise<AsyncGenerator<import("./agents").ParsedAgentEvent, any, any>>;
840
+ readonly streamAuthoredAgentRun: (name: string, input: unknown, signal?: AbortSignal) => Promise<AsyncGenerator<import("./agents").ParsedAgentEvent, any, any>>;
841
+ readonly listHooks: (topic?: string, signal?: AbortSignal) => Promise<{
842
+ items: {
843
+ name: string;
844
+ topic: string;
845
+ tool: string;
846
+ tool_kwargs: Record<string, unknown>;
847
+ condition: string | null;
848
+ condition_id: string | null;
849
+ condition_kwargs: Record<string, unknown>;
850
+ expr: string | null;
851
+ expr_id: string | null;
852
+ expr_kwargs: Record<string, unknown>;
853
+ }[];
854
+ total: number;
855
+ topic_verifiers: Record<string, {
856
+ config: Record<string, unknown>;
857
+ verifier: string;
858
+ }>;
859
+ }>;
860
+ readonly registerHook: (params: s.HookParams) => Promise<{
861
+ name: string;
862
+ registered: boolean;
863
+ }>;
864
+ readonly unregisterHook: (name: string) => Promise<{
865
+ name: string;
866
+ removed: boolean;
867
+ }>;
868
+ readonly listHookVerifiers: (signal?: AbortSignal) => Promise<string[]>;
869
+ readonly setTopicVerifier: (topic: string, body: TopicVerifierBody) => Promise<{
870
+ topic: string;
871
+ verifier: string;
872
+ }>;
873
+ readonly deleteTopicVerifier: (topic: string) => Promise<{
874
+ removed: boolean;
875
+ topic: string;
876
+ }>;
877
+ readonly getMcpConfigSchema: (signal?: AbortSignal) => Promise<Record<string, unknown>>;
878
+ readonly getSettingsSchema: (signal?: AbortSignal) => Promise<{
879
+ groups: {
880
+ name: string;
881
+ module: string;
882
+ qualname: string;
883
+ fields: {
884
+ type: string;
885
+ description: string | null;
886
+ required: boolean;
887
+ name: string;
888
+ secret: boolean;
889
+ env_var: string;
890
+ nested_group: string | null;
891
+ value?: unknown;
892
+ default?: unknown;
893
+ }[];
894
+ }[];
895
+ }>;
896
+ readonly listScopes: (signal?: AbortSignal) => Promise<Record<string, string>>;
897
+ readonly addUrlToScope: (body: AddUrlToScopeBody) => Promise<{
898
+ url: string;
899
+ scope_id: string;
900
+ }>;
901
+ readonly removeUrlFromScope: (body: {
902
+ url: string;
903
+ }) => Promise<{
904
+ url: string;
905
+ }>;
906
+ readonly removeScope: (scopeId: string) => Promise<{
907
+ scope_id: string;
908
+ deleted_keys: number;
909
+ }>;
910
+ readonly listAuthRoutes: (signal?: AbortSignal) => Promise<{
911
+ path: string;
912
+ methods: string[];
913
+ mapped: string | null;
914
+ }[]>;
915
+ readonly listPublicRoutes: (signal?: AbortSignal) => Promise<string[]>;
916
+ readonly pinRoutePublic: (body: PinRoutePublicBody) => Promise<{
917
+ url: string;
918
+ }>;
919
+ readonly unpinPublicRoute: (url: string) => Promise<{
920
+ url: string;
921
+ }>;
922
+ readonly listTokensPayload: (signal?: AbortSignal) => Promise<{
923
+ description: string;
924
+ scopes: string[];
925
+ user_id: string;
926
+ condition?: string | null | undefined;
927
+ condition_id?: string | null | undefined;
928
+ condition_kwargs?: unknown;
929
+ policy_data?: unknown;
930
+ }[]>;
931
+ readonly createApiKey: (body: ApiKeyBody) => Promise<string>;
932
+ readonly editApiKey: (userId: string, body: Omit<ApiKeyBody, "user_id">) => Promise<{
933
+ user_id: string;
934
+ updated: boolean;
935
+ }>;
936
+ readonly revokeApiKey: (userId: string) => Promise<{
937
+ user_id: string;
938
+ revoked: boolean;
939
+ }>;
940
+ readonly createClaimLink: (body: ClaimLinkBody) => Promise<{
941
+ token: string;
942
+ claim_path: string;
943
+ expires_at: string;
944
+ }>;
945
+ readonly getMe: (signal?: AbortSignal) => Promise<{
946
+ tools: string[];
947
+ scopes: string[];
948
+ user_id: string;
949
+ owner_user_id: string | null;
950
+ admin: boolean;
951
+ routes: {
952
+ path: string;
953
+ methods: string[];
954
+ }[];
955
+ route_patterns: {
956
+ scope_id: string;
957
+ pattern: string;
958
+ }[];
959
+ sub_mcp: {
960
+ slug: string;
961
+ tools: string[];
962
+ transport: string;
963
+ }[];
964
+ agents: string[];
965
+ mintable: boolean;
966
+ }>;
967
+ readonly getLoginMethods: (options?: {
968
+ signal?: AbortSignal;
969
+ }) => Promise<{
970
+ methods: ({
971
+ shape: "form";
972
+ id: string;
973
+ title: string;
974
+ fields: {
975
+ name: string;
976
+ label: string;
977
+ secret: boolean;
978
+ autocomplete?: string | undefined;
979
+ }[];
980
+ purpose: "login" | "bootstrap" | "invite";
981
+ submit_path: string;
982
+ } | {
983
+ shape: "button";
984
+ id: string;
985
+ label: string;
986
+ href: string;
987
+ icon?: string | undefined;
988
+ })[];
989
+ bootstrap: boolean;
990
+ }>;
991
+ readonly submitLoginForm: (path: string, values: Record<string, string>) => Promise<{
992
+ user_id: string;
993
+ token: string;
994
+ }>;
995
+ readonly exchangeSsoCode: (code: string) => Promise<{
996
+ user_id: string;
997
+ token: string;
998
+ }>;
999
+ readonly claimLogin: (body: {
1000
+ token: string;
1001
+ }) => Promise<{
1002
+ user_id: string;
1003
+ token: string;
1004
+ }>;
1005
+ readonly getAuthCapabilities: (signal?: AbortSignal) => Promise<{
1006
+ mintable: boolean;
1007
+ providers: {
1008
+ name: string;
1009
+ mintable: boolean;
1010
+ }[];
1011
+ }>;
1012
+ readonly logout: () => Promise<{
1013
+ revoked: boolean;
1014
+ }>;
1015
+ readonly validateCondition: (body: ValidateConditionBody) => Promise<{
1016
+ ok: boolean;
1017
+ result: boolean | null;
1018
+ }>;
1019
+ readonly listPolicyVersions: (userId: string, signal?: AbortSignal) => Promise<{
1020
+ tags: string[];
1021
+ version: number;
1022
+ body: {
1023
+ scopes: string[];
1024
+ condition: string | null;
1025
+ condition_id: string | null;
1026
+ condition_kwargs?: unknown;
1027
+ policy_data?: unknown;
1028
+ };
1029
+ created_at: string;
1030
+ is_current: boolean;
1031
+ }[]>;
1032
+ readonly rollbackPolicy: (userId: string, version: number) => Promise<{
1033
+ active_version: number;
1034
+ user_id: string;
1035
+ }>;
1036
+ readonly listBackupSections: (signal?: AbortSignal) => Promise<{
1037
+ name: string;
1038
+ secret: boolean;
1039
+ }[]>;
1040
+ readonly exportBackup: (sections: string[], signal?: AbortSignal) => Promise<Blob>;
1041
+ readonly importBackup: (body: {
1042
+ document: unknown;
1043
+ sections: string[];
1044
+ }) => Promise<{
1045
+ ok: boolean;
1046
+ sections: Record<string, {
1047
+ skipped: number;
1048
+ updated: number;
1049
+ errors: string[];
1050
+ created: number;
1051
+ fanout?: {
1052
+ mode: "local-only";
1053
+ note: string;
1054
+ } | {
1055
+ error: string | null;
1056
+ op: string;
1057
+ reachable: boolean;
1058
+ local_only: boolean;
1059
+ results: {
1060
+ error: string | null;
1061
+ origin: string;
1062
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
1063
+ detail: string | null;
1064
+ payload?: unknown;
1065
+ }[];
1066
+ mode: "fleet";
1067
+ } | {
1068
+ error: string | null;
1069
+ op: string;
1070
+ reachable: boolean;
1071
+ local_only: boolean;
1072
+ results: {
1073
+ error: string | null;
1074
+ origin: string;
1075
+ outcome: "applied" | "failed" | "missing" | "departed" | "timed_out";
1076
+ detail: string | null;
1077
+ payload?: unknown;
1078
+ }[];
1079
+ mode: "unreachable";
1080
+ } | undefined;
1081
+ new_api_keys?: {
1082
+ description: string;
1083
+ user_id: string;
1084
+ api_key: string;
1085
+ }[] | undefined;
1086
+ }>;
1087
+ }>;
1088
+ readonly listSchedules: (signal?: AbortSignal) => Promise<import("zod").objectOutputType<{
1089
+ name: import("zod").ZodString;
1090
+ enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
1091
+ schedule: import("zod").ZodOptional<import("zod").ZodType<unknown, import("zod").ZodTypeDef, unknown>>;
1092
+ target: import("zod").ZodOptional<import("zod").ZodType<unknown, import("zod").ZodTypeDef, unknown>>;
1093
+ args: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodType<unknown, import("zod").ZodTypeDef, unknown>, "many">>;
1094
+ kwargs: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodType<unknown, import("zod").ZodTypeDef, unknown>>>;
1095
+ }, import("zod").ZodTypeAny, "passthrough">[]>;
1096
+ readonly getServerDateTime: (signal?: AbortSignal) => Promise<import("zod").objectOutputType<{
1097
+ utc: import("zod").ZodType<unknown, import("zod").ZodTypeDef, unknown>;
1098
+ local: import("zod").ZodOptional<import("zod").ZodType<unknown, import("zod").ZodTypeDef, unknown>>;
1099
+ system: import("zod").ZodOptional<import("zod").ZodType<unknown, import("zod").ZodTypeDef, unknown>>;
1100
+ }, import("zod").ZodTypeAny, "passthrough">>;
1101
+ readonly addSchedule: (body: {
1102
+ tool_name: string;
1103
+ tool_kwargs: Record<string, unknown>;
1104
+ schedule_kwargs: Record<string, unknown>;
1105
+ }) => Promise<unknown>;
1106
+ readonly deleteSchedule: (name: string) => Promise<unknown>;
1107
+ readonly getObservabilityMetrics: (params?: MetricsQuery, signal?: AbortSignal) => Promise<{
1108
+ summary: {
1109
+ totalRuns: number;
1110
+ totalCost: number;
1111
+ totalTokens: number;
1112
+ averageLatencyMs: number;
1113
+ avgCostPerRun: number;
1114
+ avgTokensPerRun: number;
1115
+ timeToFirstTokenMs: number | null;
1116
+ };
1117
+ timeSeries: {
1118
+ totalTokens: number;
1119
+ bucket: string | null;
1120
+ runs: number;
1121
+ cost: number;
1122
+ avgLatencyMs: number;
1123
+ }[];
1124
+ byModel: {
1125
+ totalTokens: number;
1126
+ cost: number;
1127
+ avgLatencyMs: number;
1128
+ model: string;
1129
+ calls: number;
1130
+ }[];
1131
+ granularity: "hour" | "day" | "week";
1132
+ }>;
1133
+ readonly listRuns: (params?: RunsQuery, signal?: AbortSignal) => Promise<{
1134
+ items: {
1135
+ status: "error" | "success";
1136
+ tags: string[];
1137
+ id: string;
1138
+ totalTokens: number | null;
1139
+ cost: number | null;
1140
+ model: string | null;
1141
+ traceId: string;
1142
+ createdAt: string | null;
1143
+ latencyMs: number | null;
1144
+ fetchError: string | null;
1145
+ inputPreview?: unknown;
1146
+ outputPreview?: unknown;
1147
+ }[];
1148
+ page: number;
1149
+ nextPage: number | null;
1150
+ }>;
1151
+ readonly getRunTrace: (traceId: string, signal?: AbortSignal) => Promise<{
1152
+ tags: string[];
1153
+ totalCost: number | null;
1154
+ traceId: string;
1155
+ fetchError: string | null;
1156
+ timestamp: string | null;
1157
+ availability: "partial" | "unavailable" | "full";
1158
+ spans: {
1159
+ type: string | null;
1160
+ name: string | null;
1161
+ id: string;
1162
+ model: string | null;
1163
+ traceId: string | null;
1164
+ parentId: string | null;
1165
+ level: string | null;
1166
+ statusMessage: string | null;
1167
+ start: string | null;
1168
+ end: string | null;
1169
+ nodeId: string | null;
1170
+ input?: unknown;
1171
+ output?: unknown;
1172
+ usage?: unknown;
1173
+ metadata?: unknown;
1174
+ }[];
1175
+ input?: unknown;
1176
+ output?: unknown;
1177
+ metadata?: unknown;
1178
+ }>;
1179
+ readonly exportTrace: (traceId: string, signal?: AbortSignal) => Promise<Blob>;
1180
+ readonly exportRuns: (params: RunsQuery & {
1181
+ format: "csv" | "json";
1182
+ }, signal?: AbortSignal) => Promise<Blob>;
1183
+ readonly searchMarketplace: (query?: MarketplaceSearchQuery, signal?: AbortSignal) => Promise<{
1184
+ items: {
1185
+ description: string;
1186
+ name: string;
1187
+ tags: string[];
1188
+ display_name: string | null;
1189
+ icon_url: string | null;
1190
+ item: {
1191
+ description: string;
1192
+ name: string;
1193
+ tags: string[];
1194
+ kind: string;
1195
+ };
1196
+ ref: string;
1197
+ namespace: string;
1198
+ package: string;
1199
+ categories: string[];
1200
+ trust_tier: string;
1201
+ pricing: string;
1202
+ latest_version: string | null;
1203
+ downloads: number;
1204
+ updated_at: string;
1205
+ }[];
1206
+ total: number;
1207
+ page: number;
1208
+ page_size: number;
1209
+ }>;
1210
+ readonly getMarketplacePlugin: (namespace: string, name: string, signal?: AbortSignal) => Promise<{
1211
+ description: string;
1212
+ name: string;
1213
+ tags: string[];
1214
+ display_name: string | null;
1215
+ icon_url: string | null;
1216
+ namespace: string;
1217
+ package: string;
1218
+ categories: string[];
1219
+ trust_tier: string;
1220
+ pricing: string;
1221
+ downloads: number;
1222
+ readme_md: string | null;
1223
+ license: string | null;
1224
+ homepage_url: string | null;
1225
+ repository_url: string | null;
1226
+ latest: {
1227
+ status: string;
1228
+ version: string;
1229
+ items: {
1230
+ description: string;
1231
+ name: string;
1232
+ tags: string[];
1233
+ kind: string;
1234
+ }[];
1235
+ contract_range: string | null;
1236
+ published_at: string | null;
1237
+ } | null;
1238
+ versions: {
1239
+ status: string;
1240
+ version: string;
1241
+ contract_range: string | null;
1242
+ published_at: string | null;
1243
+ }[];
1244
+ }>;
1245
+ readonly listMarketplaceCategories: (signal?: AbortSignal) => Promise<string[]>;
1246
+ readonly listInstalledMarketplacePlugins: (signal?: AbortSignal) => Promise<{
1247
+ version: string;
1248
+ ref: string;
1249
+ latest: string | null;
1250
+ source: string;
1251
+ installed_at: string;
1252
+ update_available: boolean;
1253
+ missing_upstream: boolean;
1254
+ }[]>;
1255
+ readonly installMarketplacePlugin: (body: MarketplaceInstallBody) => Promise<{
1256
+ version: string;
1257
+ ref: string;
1258
+ advisories: {
1259
+ created_at: string;
1260
+ id: number;
1261
+ summary: string;
1262
+ listing: string;
1263
+ affected_versions: string;
1264
+ severity: string;
1265
+ withdrawn_at: string | null;
1266
+ }[];
1267
+ notes: string[];
1268
+ }>;
1269
+ readonly uninstallMarketplacePlugin: (body: MarketplaceUninstallBody) => Promise<{
1270
+ ref: string;
1271
+ notes: string[];
1272
+ uninstalled: true;
1273
+ }>;
1274
+ readonly updateMarketplacePlugin: (body: MarketplaceInstallBody) => Promise<{
1275
+ version: string;
1276
+ ref: string;
1277
+ advisories: {
1278
+ created_at: string;
1279
+ id: number;
1280
+ summary: string;
1281
+ listing: string;
1282
+ affected_versions: string;
1283
+ severity: string;
1284
+ withdrawn_at: string | null;
1285
+ }[];
1286
+ notes: string[];
1287
+ }>;
1288
+ readonly getMarketplaceAdvisories: (signal?: AbortSignal) => Promise<{
1289
+ advisories: {
1290
+ created_at: string;
1291
+ id: number;
1292
+ summary: string;
1293
+ listing: string;
1294
+ affected_versions: string;
1295
+ severity: string;
1296
+ withdrawn_at: string | null;
1297
+ }[];
1298
+ fetched_at: string;
1299
+ }>;
1300
+ readonly getHealth: (signal?: AbortSignal) => Promise<string>;
1301
+ readonly getMetrics: (signal?: AbortSignal) => Promise<string>;
1302
+ readonly getSystemKinds: (signal?: AbortSignal) => Promise<{
1303
+ kind: string;
1304
+ detail: string;
1305
+ state: "active" | "default" | "off";
1306
+ plugin: string | null;
1307
+ }[]>;
1308
+ /**
1309
+ * Open the authed interactions SSE stream. The caller drives reconnect +
1310
+ * backlog-replay dedup. Returns the raw frame iterator; the interactions
1311
+ * feature maps frames to typed events.
1312
+ */
1313
+ readonly streamInteractions: (signal?: AbortSignal) => Promise<AsyncGenerator<import("./sse").SseFrame, any, any>>;
1314
+ };
1315
+ export type ApiClient = ReturnType<typeof createApiClient>;
1316
+ //# sourceMappingURL=client.d.ts.map