@topolo/sdk 0.4.0 → 0.4.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.cts CHANGED
@@ -31,9 +31,177 @@ interface AgentIdentity {
31
31
  agentName?: string;
32
32
  }
33
33
 
34
+ interface TopoloClientOptions {
35
+ credential: TopoloCredential;
36
+ agent: AgentIdentity;
37
+ /** Per-service URL overrides. Useful for staging/dev. */
38
+ serviceUrls?: Record<string, string>;
39
+ /** Per-service TopoloAuth service id overrides from the owning app/deployment. */
40
+ serviceIds?: Record<string, string>;
41
+ /**
42
+ * When true, mutating helpers (POST/PUT/PATCH/DELETE) require callers to pass
43
+ * `{ confirm: true }`. Defaults to true. Set false only for trusted surfaces.
44
+ */
45
+ requireConfirmForWrites?: boolean;
46
+ /** HTTP request timeout (ms). Default 30s. */
47
+ timeoutMs?: number;
48
+ /** Injected fetch, for testing. Defaults to global fetch. */
49
+ fetch?: typeof fetch;
50
+ /**
51
+ * Observability hook. Fires once per request lifecycle (`request` at start,
52
+ * then exactly one of `response` or `error`). Safe to leave unset — off by
53
+ * default. Intended for CLI/MCP hosts to surface request-level diagnostics
54
+ * and for consumers building their own logging/tracing.
55
+ */
56
+ debug?: (event: TopoloDebugEvent) => void;
57
+ }
58
+ type TopoloDebugEvent = {
59
+ phase: 'request';
60
+ method: string;
61
+ service: string;
62
+ path: string;
63
+ url: string;
64
+ requestId: string;
65
+ } | {
66
+ phase: 'response';
67
+ method: string;
68
+ service: string;
69
+ path: string;
70
+ url: string;
71
+ requestId: string;
72
+ status: number;
73
+ durationMs: number;
74
+ } | {
75
+ phase: 'error';
76
+ method: string;
77
+ service: string;
78
+ path: string;
79
+ url: string;
80
+ requestId: string;
81
+ durationMs: number;
82
+ error: string;
83
+ status?: number;
84
+ };
85
+ interface RequestOptions {
86
+ service: string;
87
+ path: string;
88
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
89
+ query?: Record<string, string | number | boolean | undefined>;
90
+ body?: unknown;
91
+ /** Explicit write-acknowledgement for mutating calls. */
92
+ confirm?: boolean;
93
+ /** Extra headers appended after auth/audit headers. */
94
+ headers?: Record<string, string>;
95
+ signal?: AbortSignal;
96
+ }
97
+ /**
98
+ * A single entry from the live platform service catalog. Returned by
99
+ * {@link TopoloClient.listServices}. Shape mirrors the public-safe projection
100
+ * from TopoloAuth `GET /api/services/catalog`.
101
+ */
102
+ interface TopoloServiceCatalogEntry {
103
+ serviceId: string;
104
+ slug: string | null;
105
+ name: string | null;
106
+ description: string | null;
107
+ baseUrl: string | null;
108
+ status: string | null;
109
+ surfaceKind: string | null;
110
+ launchable: boolean;
111
+ permissions: string[];
112
+ }
113
+ declare class TopoloClient {
114
+ private readonly credential;
115
+ private readonly agent;
116
+ private readonly serviceUrls?;
117
+ private readonly serviceIds?;
118
+ private readonly requireConfirmForWrites;
119
+ private readonly timeoutMs;
120
+ private readonly fetchImpl;
121
+ private readonly debug?;
122
+ private serviceCatalogCache;
123
+ /**
124
+ * Process-wide cache for slug → service-id lookups. Keyed by
125
+ * `${authBaseUrl}|${slug}` so multiple `TopoloClient` instances pointing at
126
+ * the same Auth share, but staging vs prod don't poison each other.
127
+ * Cleared via `TopoloClient.clearServiceIdCache()` if a test needs it.
128
+ */
129
+ private static readonly serviceIdCache;
130
+ /**
131
+ * Drop the slug→service-id cache. Test-only — production callers should
132
+ * let the 5-minute TTL expire naturally.
133
+ */
134
+ static clearServiceIdCache(): void;
135
+ constructor(options: TopoloClientOptions);
136
+ private emit;
137
+ /**
138
+ * Low-level JSON request. Prefer the typed module helpers (identity, crm, ...)
139
+ * for anything a caller would reach for; this stays exported for escape-hatch
140
+ * use and for the generic `topolo api` / MCP passthrough tool.
141
+ */
142
+ request<T = unknown>(opts: RequestOptions): Promise<T>;
143
+ private resolveRequestService;
144
+ private resolveLiveCallableService;
145
+ /**
146
+ * Resolve a service-slug → opaque service-id via caller config or TopoloAuth.
147
+ *
148
+ * Cache: 5 minutes per process per `(slug, auth_base_url)`. Negative
149
+ * results (404) are cached for 60s so a typo doesn't hot-loop the
150
+ * resolver. Returns null when the slug isn't registered — callers decide
151
+ * whether to throw.
152
+ *
153
+ * No credential is sent: the endpoint is public (slugs aren't secret).
154
+ * This keeps the resolver usable during early bootstrap before a caller
155
+ * has acquired an access token.
156
+ */
157
+ getServiceIdBySlug(slug: string): Promise<string | null>;
158
+ /**
159
+ * List the platform service catalog from the live registry
160
+ * (`GET /api/services/catalog` on TopoloAuth). Credential-aware: the
161
+ * caller's credential is attached, so the result only includes services the
162
+ * credential's organization and effective permissions can use.
163
+ *
164
+ * Security boundary: this never falls back to the generated global snapshot.
165
+ * The live Auth catalog is the authority because it is scoped to the caller's
166
+ * organization and effective permissions.
167
+ */
168
+ listServices(): Promise<TopoloServiceCatalogEntry[]>;
169
+ /**
170
+ * Bundled generated registry for tooling that audits platform packaging, not
171
+ * for deciding what the current credential may use.
172
+ */
173
+ listBundledServices(): TopoloServiceCatalogEntry[];
174
+ /**
175
+ * Introspect the current credential. Returns the caller's resolved identity,
176
+ * organization, and permission set. Used by CLI `whoami` and by MCP to gate
177
+ * advertised tools by scope.
178
+ *
179
+ * Both JWT access tokens and platform API keys are resolved via the unified
180
+ * `GET /api/auth/me` endpoint on TopoloAuth, which does not require service
181
+ * credentials. The caller's possession of the credential secret is proof.
182
+ */
183
+ introspect(): Promise<CredentialIntrospection>;
184
+ }
185
+ interface CredentialIntrospection {
186
+ kind: 'api_key' | 'access_token';
187
+ user: {
188
+ id: string;
189
+ email: string;
190
+ name: string | null;
191
+ role: string;
192
+ permissions: string[];
193
+ };
194
+ organization: {
195
+ id: string;
196
+ slug: string;
197
+ name: string;
198
+ } | null;
199
+ }
200
+
34
201
  declare const SERVICES: {
35
202
  readonly agent: "https://agent-api.topolo.app";
36
203
  readonly auth: "https://auth.topolo.app";
204
+ readonly backup: "https://backup.topolo.app";
37
205
  readonly books: "https://books.topolo.app";
38
206
  readonly bugfix: "https://bugfix.topolo.app";
39
207
  readonly bytes: "https://bytes-api.topolo.app";
@@ -44,7 +212,6 @@ declare const SERVICES: {
44
212
  readonly compose: "https://compose.topolo.app";
45
213
  readonly consent: "https://consent.topolo.app";
46
214
  readonly crm: "https://crm-api.topolo.app";
47
- readonly customer_success: "https://success.topolo.app";
48
215
  readonly developers: "https://developers.topolo.app";
49
216
  readonly director: "https://director.topolo.app";
50
217
  readonly feed: "https://feed-api.topolo.app";
@@ -58,9 +225,10 @@ declare const SERVICES: {
58
225
  readonly localize: "https://localize.topolo.app";
59
226
  readonly mail: "https://mail.topolo.app";
60
227
  readonly mdm: "https://mdm-api.topolo.app";
61
- readonly messaging: "https://messages.topolo.app";
228
+ readonly messages: "https://messages.topolo.app";
62
229
  readonly nexus: "https://nexus-api.topolo.app";
63
230
  readonly notify: "https://notify.topolo.app";
231
+ readonly observability_watch: "https://observability-watch.topolo.app";
64
232
  readonly one: "https://one.topolo.app";
65
233
  readonly p2p: "https://p2p.topolo.app";
66
234
  readonly pay: "https://pay.topolo.app";
@@ -74,6 +242,7 @@ declare const SERVICES: {
74
242
  readonly socialize: "https://socialize-api.topolo.app";
75
243
  readonly spaces: "https://spaces.topolo.app";
76
244
  readonly status: "https://status.topolo.app";
245
+ readonly success: "https://success.topolo.app";
77
246
  readonly support: "https://support.topolo.app";
78
247
  readonly survey: "https://survey.topolo.app";
79
248
  readonly voice: "https://voice.topolo.app";
@@ -91,11 +260,18 @@ declare const APPLICATIONS: {
91
260
  readonly services: readonly [];
92
261
  readonly deployTargets: readonly [{
93
262
  readonly name: "topolo-admin";
94
- readonly kind: "pages";
95
- readonly apiUrl: null;
263
+ readonly kind: "worker";
264
+ readonly apiUrl: "https://admin.topolo.app";
96
265
  readonly domains: readonly ["admin.topolo.app"];
97
266
  readonly routes: readonly [];
98
267
  readonly serviceId: null;
268
+ }, {
269
+ readonly name: "topolo-admin-api";
270
+ readonly kind: "worker";
271
+ readonly apiUrl: null;
272
+ readonly domains: readonly [];
273
+ readonly routes: readonly [];
274
+ readonly serviceId: null;
99
275
  }];
100
276
  };
101
277
  readonly agent: {
@@ -108,12 +284,12 @@ declare const APPLICATIONS: {
108
284
  readonly deployTargets: readonly [{
109
285
  readonly name: "topolo-agent";
110
286
  readonly kind: "worker";
111
- readonly apiUrl: null;
287
+ readonly apiUrl: "https://agent.topolo.app";
112
288
  readonly domains: readonly ["agent.topolo.app"];
113
289
  readonly routes: readonly [];
114
290
  readonly serviceId: null;
115
291
  }, {
116
- readonly name: "topolo-agent-worker";
292
+ readonly name: "topolo-agent-api";
117
293
  readonly kind: "worker";
118
294
  readonly apiUrl: "https://agent-api.topolo.app";
119
295
  readonly domains: readonly ["agent-api.topolo.app"];
@@ -142,15 +318,15 @@ declare const APPLICATIONS: {
142
318
  readonly appDir: "TopoloBackup";
143
319
  readonly name: "topolo-backup";
144
320
  readonly packageName: "topolo-backup";
145
- readonly productionUrl: null;
146
- readonly services: readonly [];
321
+ readonly productionUrl: "https://backup.topolo.app";
322
+ readonly services: readonly ["backup"];
147
323
  readonly deployTargets: readonly [{
148
324
  readonly name: "topolo-backup";
149
325
  readonly kind: "worker";
150
- readonly apiUrl: null;
151
- readonly domains: readonly [];
326
+ readonly apiUrl: "https://backup.topolo.app";
327
+ readonly domains: readonly ["backup.topolo.app"];
152
328
  readonly routes: readonly [];
153
- readonly serviceId: null;
329
+ readonly serviceId: "backup";
154
330
  }];
155
331
  };
156
332
  readonly books: {
@@ -165,8 +341,15 @@ declare const APPLICATIONS: {
165
341
  readonly kind: "worker";
166
342
  readonly apiUrl: "https://books.topolo.app";
167
343
  readonly domains: readonly ["books.topolo.app"];
168
- readonly routes: readonly ["books.topolo.app"];
344
+ readonly routes: readonly [];
169
345
  readonly serviceId: "books";
346
+ }, {
347
+ readonly name: "topolo-books-api";
348
+ readonly kind: "worker";
349
+ readonly apiUrl: null;
350
+ readonly domains: readonly [];
351
+ readonly routes: readonly [];
352
+ readonly serviceId: null;
170
353
  }];
171
354
  };
172
355
  readonly bugfix: {
@@ -181,7 +364,7 @@ declare const APPLICATIONS: {
181
364
  readonly kind: "worker";
182
365
  readonly apiUrl: "https://bugfix.topolo.app";
183
366
  readonly domains: readonly ["bugfix.topolo.app"];
184
- readonly routes: readonly ["bugfix.topolo.app"];
367
+ readonly routes: readonly [];
185
368
  readonly serviceId: "bugfix";
186
369
  }];
187
370
  };
@@ -194,8 +377,8 @@ declare const APPLICATIONS: {
194
377
  readonly services: readonly ["bytes"];
195
378
  readonly deployTargets: readonly [{
196
379
  readonly name: "topolo-bytes";
197
- readonly kind: "pages";
198
- readonly apiUrl: null;
380
+ readonly kind: "worker";
381
+ readonly apiUrl: "https://bytes.topolo.app";
199
382
  readonly domains: readonly ["bytes.topolo.app"];
200
383
  readonly routes: readonly [];
201
384
  readonly serviceId: null;
@@ -220,8 +403,15 @@ declare const APPLICATIONS: {
220
403
  readonly kind: "worker";
221
404
  readonly apiUrl: "https://calendar.topolo.app";
222
405
  readonly domains: readonly ["calendar.topolo.app"];
223
- readonly routes: readonly ["calendar.topolo.app"];
406
+ readonly routes: readonly [];
224
407
  readonly serviceId: "calendar";
408
+ }, {
409
+ readonly name: "topolo-calendar-api";
410
+ readonly kind: "worker";
411
+ readonly apiUrl: null;
412
+ readonly domains: readonly [];
413
+ readonly routes: readonly [];
414
+ readonly serviceId: null;
225
415
  }];
226
416
  };
227
417
  readonly capacity: {
@@ -252,19 +442,17 @@ declare const APPLICATIONS: {
252
442
  readonly kind: "worker";
253
443
  readonly apiUrl: "https://chat.topolo.app";
254
444
  readonly domains: readonly ["chat.topolo.app"];
255
- readonly routes: readonly ["chat.topolo.app"];
445
+ readonly routes: readonly [];
256
446
  readonly serviceId: "chat";
447
+ }, {
448
+ readonly name: "topolo-chat-api";
449
+ readonly kind: "worker";
450
+ readonly apiUrl: null;
451
+ readonly domains: readonly [];
452
+ readonly routes: readonly [];
453
+ readonly serviceId: null;
257
454
  }];
258
455
  };
259
- readonly cloudcontrol: {
260
- readonly id: "cloudcontrol";
261
- readonly appDir: "TopoloCloudControl";
262
- readonly name: "cloudcontrol";
263
- readonly packageName: "topolo-cloudcontrol";
264
- readonly productionUrl: null;
265
- readonly services: readonly [];
266
- readonly deployTargets: readonly [];
267
- };
268
456
  readonly commerce: {
269
457
  readonly id: "commerce";
270
458
  readonly appDir: "TopoloCommerce";
@@ -281,22 +469,22 @@ declare const APPLICATIONS: {
281
469
  readonly serviceId: "commerce";
282
470
  }, {
283
471
  readonly name: "topolo-commerce-guest-web";
284
- readonly kind: "pages";
285
- readonly apiUrl: null;
472
+ readonly kind: "worker";
473
+ readonly apiUrl: "https://guest.topolo.app";
286
474
  readonly domains: readonly ["guest.topolo.app"];
287
475
  readonly routes: readonly [];
288
476
  readonly serviceId: null;
289
477
  }, {
290
478
  readonly name: "topolo-commerce-ops-web";
291
- readonly kind: "pages";
292
- readonly apiUrl: null;
479
+ readonly kind: "worker";
480
+ readonly apiUrl: "https://commerce.topolo.app";
293
481
  readonly domains: readonly ["commerce.topolo.app"];
294
482
  readonly routes: readonly [];
295
483
  readonly serviceId: null;
296
484
  }, {
297
485
  readonly name: "topolo-commerce-station-web";
298
- readonly kind: "pages";
299
- readonly apiUrl: null;
486
+ readonly kind: "worker";
487
+ readonly apiUrl: "https://station-commerce.topolo.app";
300
488
  readonly domains: readonly ["station-commerce.topolo.app"];
301
489
  readonly routes: readonly [];
302
490
  readonly serviceId: null;
@@ -314,8 +502,15 @@ declare const APPLICATIONS: {
314
502
  readonly kind: "worker";
315
503
  readonly apiUrl: "https://compose.topolo.app";
316
504
  readonly domains: readonly ["compose.topolo.app"];
317
- readonly routes: readonly ["compose.topolo.app"];
505
+ readonly routes: readonly [];
318
506
  readonly serviceId: "compose";
507
+ }, {
508
+ readonly name: "topolo-compose-api";
509
+ readonly kind: "worker";
510
+ readonly apiUrl: null;
511
+ readonly domains: readonly [];
512
+ readonly routes: readonly [];
513
+ readonly serviceId: null;
319
514
  }];
320
515
  };
321
516
  readonly consent: {
@@ -330,8 +525,15 @@ declare const APPLICATIONS: {
330
525
  readonly kind: "worker";
331
526
  readonly apiUrl: "https://consent.topolo.app";
332
527
  readonly domains: readonly ["consent.topolo.app"];
333
- readonly routes: readonly ["consent.topolo.app"];
528
+ readonly routes: readonly [];
334
529
  readonly serviceId: "consent";
530
+ }, {
531
+ readonly name: "topolo-consent-api";
532
+ readonly kind: "worker";
533
+ readonly apiUrl: null;
534
+ readonly domains: readonly [];
535
+ readonly routes: readonly [];
536
+ readonly serviceId: null;
335
537
  }];
336
538
  };
337
539
  readonly crm: {
@@ -351,28 +553,12 @@ declare const APPLICATIONS: {
351
553
  }, {
352
554
  readonly name: "topolo-crm-app";
353
555
  readonly kind: "worker";
354
- readonly apiUrl: null;
556
+ readonly apiUrl: "https://crm.topolo.app";
355
557
  readonly domains: readonly ["crm.topolo.app"];
356
558
  readonly routes: readonly [];
357
559
  readonly serviceId: null;
358
560
  }];
359
561
  };
360
- readonly customer_success: {
361
- readonly id: "customer_success";
362
- readonly appDir: "TopoloSuccess";
363
- readonly name: "topolo-success";
364
- readonly packageName: "topolo-success";
365
- readonly productionUrl: "https://success.topolo.app";
366
- readonly services: readonly ["customer_success"];
367
- readonly deployTargets: readonly [{
368
- readonly name: "topolo-success";
369
- readonly kind: "worker";
370
- readonly apiUrl: "https://success.topolo.app";
371
- readonly domains: readonly ["success.topolo.app"];
372
- readonly routes: readonly ["success.topolo.app"];
373
- readonly serviceId: "customer_success";
374
- }];
375
- };
376
562
  readonly developers: {
377
563
  readonly id: "developers";
378
564
  readonly appDir: "TopoloDevelopers";
@@ -394,6 +580,13 @@ declare const APPLICATIONS: {
394
580
  readonly domains: readonly ["developers.topolo.app"];
395
581
  readonly routes: readonly [];
396
582
  readonly serviceId: "developers";
583
+ }, {
584
+ readonly name: "topolo-developers-api";
585
+ readonly kind: "worker";
586
+ readonly apiUrl: null;
587
+ readonly domains: readonly [];
588
+ readonly routes: readonly [];
589
+ readonly serviceId: null;
397
590
  }];
398
591
  };
399
592
  readonly director: {
@@ -408,8 +601,15 @@ declare const APPLICATIONS: {
408
601
  readonly kind: "worker";
409
602
  readonly apiUrl: "https://director.topolo.app";
410
603
  readonly domains: readonly ["director.topolo.app"];
411
- readonly routes: readonly ["director.topolo.app"];
604
+ readonly routes: readonly [];
412
605
  readonly serviceId: "director";
606
+ }, {
607
+ readonly name: "topolo-director-api";
608
+ readonly kind: "worker";
609
+ readonly apiUrl: null;
610
+ readonly domains: readonly [];
611
+ readonly routes: readonly [];
612
+ readonly serviceId: null;
413
613
  }];
414
614
  };
415
615
  readonly docs: {
@@ -421,11 +621,18 @@ declare const APPLICATIONS: {
421
621
  readonly services: readonly [];
422
622
  readonly deployTargets: readonly [{
423
623
  readonly name: "topolo-docs";
424
- readonly kind: "pages";
425
- readonly apiUrl: null;
624
+ readonly kind: "worker";
625
+ readonly apiUrl: "https://docs.topolo.app";
426
626
  readonly domains: readonly ["docs.topolo.app"];
427
627
  readonly routes: readonly [];
428
628
  readonly serviceId: null;
629
+ }, {
630
+ readonly name: "topolo-docs-api";
631
+ readonly kind: "worker";
632
+ readonly apiUrl: null;
633
+ readonly domains: readonly [];
634
+ readonly routes: readonly [];
635
+ readonly serviceId: null;
429
636
  }];
430
637
  };
431
638
  readonly feed: {
@@ -433,22 +640,29 @@ declare const APPLICATIONS: {
433
640
  readonly appDir: "TopoloFeed";
434
641
  readonly name: "TopoloFeed";
435
642
  readonly packageName: "topolo-feed";
436
- readonly productionUrl: "https://feed-api.topolo.app";
643
+ readonly productionUrl: "https://feed.topolo.app";
437
644
  readonly services: readonly ["feed"];
438
645
  readonly deployTargets: readonly [{
439
646
  readonly name: "topolo-feed-analytics-api";
440
647
  readonly kind: "worker";
441
648
  readonly apiUrl: "https://feed-analytics-api.topolo.app";
442
649
  readonly domains: readonly ["feed-analytics-api.topolo.app"];
443
- readonly routes: readonly ["feed-analytics-api.topolo.app"];
650
+ readonly routes: readonly [];
444
651
  readonly serviceId: null;
445
652
  }, {
446
653
  readonly name: "topolo-feed-api";
447
654
  readonly kind: "worker";
448
655
  readonly apiUrl: "https://feed-api.topolo.app";
449
656
  readonly domains: readonly ["feed-api.topolo.app"];
450
- readonly routes: readonly ["feed-api.topolo.app"];
657
+ readonly routes: readonly [];
451
658
  readonly serviceId: "feed";
659
+ }, {
660
+ readonly name: "topolo-feed-web";
661
+ readonly kind: "worker";
662
+ readonly apiUrl: "https://feed.topolo.app";
663
+ readonly domains: readonly ["feed.topolo.app"];
664
+ readonly routes: readonly [];
665
+ readonly serviceId: null;
452
666
  }];
453
667
  };
454
668
  readonly flow: {
@@ -463,21 +677,28 @@ declare const APPLICATIONS: {
463
677
  readonly kind: "worker";
464
678
  readonly apiUrl: "https://flow.topolo.app";
465
679
  readonly domains: readonly ["flow.topolo.app"];
466
- readonly routes: readonly ["flow.topolo.app"];
680
+ readonly routes: readonly [];
467
681
  readonly serviceId: "flow";
682
+ }, {
683
+ readonly name: "topolo-flow-api";
684
+ readonly kind: "worker";
685
+ readonly apiUrl: null;
686
+ readonly domains: readonly [];
687
+ readonly routes: readonly [];
688
+ readonly serviceId: null;
468
689
  }];
469
690
  };
470
691
  readonly forecast: {
471
692
  readonly id: "forecast";
472
693
  readonly appDir: "TopoloForecast";
473
- readonly name: "forecast-cloud";
694
+ readonly name: "topolo-forecast";
474
695
  readonly packageName: "topolo-forecast";
475
696
  readonly productionUrl: "https://forecast.topolo.app";
476
697
  readonly services: readonly ["forecast"];
477
698
  readonly deployTargets: readonly [{
478
699
  readonly name: "topolo-forecast";
479
700
  readonly kind: "worker";
480
- readonly apiUrl: null;
701
+ readonly apiUrl: "https://forecast.topolo.app";
481
702
  readonly domains: readonly ["forecast.topolo.app"];
482
703
  readonly routes: readonly [];
483
704
  readonly serviceId: null;
@@ -502,8 +723,15 @@ declare const APPLICATIONS: {
502
723
  readonly kind: "worker";
503
724
  readonly apiUrl: "https://forms.topolo.app";
504
725
  readonly domains: readonly ["forms.topolo.app"];
505
- readonly routes: readonly ["forms.topolo.app"];
726
+ readonly routes: readonly [];
506
727
  readonly serviceId: "forms";
728
+ }, {
729
+ readonly name: "topolo-forms-api";
730
+ readonly kind: "worker";
731
+ readonly apiUrl: null;
732
+ readonly domains: readonly [];
733
+ readonly routes: readonly [];
734
+ readonly serviceId: null;
507
735
  }];
508
736
  };
509
737
  readonly home: {
@@ -518,8 +746,15 @@ declare const APPLICATIONS: {
518
746
  readonly kind: "worker";
519
747
  readonly apiUrl: "https://home.topolo.app";
520
748
  readonly domains: readonly ["home.topolo.app"];
521
- readonly routes: readonly ["home.topolo.app"];
749
+ readonly routes: readonly [];
522
750
  readonly serviceId: "home";
751
+ }, {
752
+ readonly name: "topolo-home-api";
753
+ readonly kind: "worker";
754
+ readonly apiUrl: null;
755
+ readonly domains: readonly [];
756
+ readonly routes: readonly [];
757
+ readonly serviceId: null;
523
758
  }];
524
759
  };
525
760
  readonly insights: {
@@ -534,8 +769,15 @@ declare const APPLICATIONS: {
534
769
  readonly kind: "worker";
535
770
  readonly apiUrl: "https://insights.topolo.app";
536
771
  readonly domains: readonly ["insights.topolo.app"];
537
- readonly routes: readonly ["insights.topolo.app"];
772
+ readonly routes: readonly [];
538
773
  readonly serviceId: "insights";
774
+ }, {
775
+ readonly name: "topolo-insights-api";
776
+ readonly kind: "worker";
777
+ readonly apiUrl: null;
778
+ readonly domains: readonly [];
779
+ readonly routes: readonly [];
780
+ readonly serviceId: null;
539
781
  }];
540
782
  };
541
783
  readonly inventory: {
@@ -550,8 +792,15 @@ declare const APPLICATIONS: {
550
792
  readonly kind: "worker";
551
793
  readonly apiUrl: "https://inventory.topolo.app";
552
794
  readonly domains: readonly ["inventory.topolo.app"];
553
- readonly routes: readonly ["inventory.topolo.app"];
795
+ readonly routes: readonly [];
554
796
  readonly serviceId: "inventory";
797
+ }, {
798
+ readonly name: "topolo-inventory-api";
799
+ readonly kind: "worker";
800
+ readonly apiUrl: null;
801
+ readonly domains: readonly [];
802
+ readonly routes: readonly [];
803
+ readonly serviceId: null;
555
804
  }];
556
805
  };
557
806
  readonly learn: {
@@ -564,7 +813,7 @@ declare const APPLICATIONS: {
564
813
  readonly deployTargets: readonly [{
565
814
  readonly name: "topolo-learn";
566
815
  readonly kind: "worker";
567
- readonly apiUrl: null;
816
+ readonly apiUrl: "https://learn.topolo.app";
568
817
  readonly domains: readonly ["learn.topolo.app"];
569
818
  readonly routes: readonly [];
570
819
  readonly serviceId: null;
@@ -605,8 +854,15 @@ declare const APPLICATIONS: {
605
854
  readonly kind: "worker";
606
855
  readonly apiUrl: "https://mail.topolo.app";
607
856
  readonly domains: readonly ["mail.topolo.app"];
608
- readonly routes: readonly ["mail.topolo.app"];
857
+ readonly routes: readonly [];
609
858
  readonly serviceId: "mail";
859
+ }, {
860
+ readonly name: "topolo-mail-api";
861
+ readonly kind: "worker";
862
+ readonly apiUrl: null;
863
+ readonly domains: readonly [];
864
+ readonly routes: readonly [];
865
+ readonly serviceId: null;
610
866
  }];
611
867
  };
612
868
  readonly mdm: {
@@ -621,33 +877,40 @@ declare const APPLICATIONS: {
621
877
  readonly kind: "worker";
622
878
  readonly apiUrl: "https://mdm-api.topolo.app";
623
879
  readonly domains: readonly ["mdm-api.topolo.app"];
624
- readonly routes: readonly ["mdm-api.topolo.app"];
880
+ readonly routes: readonly [];
625
881
  readonly serviceId: "mdm";
626
882
  }, {
627
883
  readonly name: "topolo-mdm-console";
628
884
  readonly kind: "worker";
629
- readonly apiUrl: null;
885
+ readonly apiUrl: "https://mdm.topolo.app";
630
886
  readonly domains: readonly ["mdm.topolo.app"];
631
- readonly routes: readonly ["mdm.topolo.app"];
887
+ readonly routes: readonly [];
632
888
  readonly serviceId: null;
633
889
  }];
634
890
  };
635
- readonly messaging: {
636
- readonly id: "messaging";
637
- readonly appDir: "TopoloMessaging";
638
- readonly name: "topolo-messaging";
639
- readonly packageName: "topolo-messaging";
891
+ readonly messages: {
892
+ readonly id: "messages";
893
+ readonly appDir: "TopoloMessages";
894
+ readonly name: "topolo-messages";
895
+ readonly packageName: "topolo-messages";
640
896
  readonly productionUrl: "https://messages.topolo.app";
641
- readonly services: readonly ["messaging"];
897
+ readonly services: readonly ["messages"];
642
898
  readonly deployTargets: readonly [{
643
- readonly name: "topolo-messaging";
899
+ readonly name: "topolo-messages";
644
900
  readonly kind: "worker";
645
901
  readonly apiUrl: "https://messages.topolo.app";
646
902
  readonly domains: readonly ["messages.topolo.app"];
647
903
  readonly routes: readonly [];
648
- readonly serviceId: "messaging";
904
+ readonly serviceId: "messages";
905
+ }, {
906
+ readonly name: "topolo-messages-api";
907
+ readonly kind: "worker";
908
+ readonly apiUrl: null;
909
+ readonly domains: readonly [];
910
+ readonly routes: readonly [];
911
+ readonly serviceId: null;
649
912
  }, {
650
- readonly name: "topolo-messaging-dispatch";
913
+ readonly name: "topolo-messages-dispatch";
651
914
  readonly kind: "worker";
652
915
  readonly apiUrl: null;
653
916
  readonly domains: readonly [];
@@ -699,9 +962,16 @@ declare const APPLICATIONS: {
699
962
  readonly appDir: "TopoloObservabilityWatch";
700
963
  readonly name: "topolo-observability-watch";
701
964
  readonly packageName: "topolo-observability-watch";
702
- readonly productionUrl: null;
703
- readonly services: readonly [];
704
- readonly deployTargets: readonly [];
965
+ readonly productionUrl: "https://observability-watch.topolo.app";
966
+ readonly services: readonly ["observability_watch"];
967
+ readonly deployTargets: readonly [{
968
+ readonly name: "topolo-observability-watch";
969
+ readonly kind: "worker";
970
+ readonly apiUrl: "https://observability-watch.topolo.app";
971
+ readonly domains: readonly ["observability-watch.topolo.app"];
972
+ readonly routes: readonly [];
973
+ readonly serviceId: "observability_watch";
974
+ }];
705
975
  };
706
976
  readonly one: {
707
977
  readonly id: "one";
@@ -712,25 +982,25 @@ declare const APPLICATIONS: {
712
982
  readonly services: readonly ["one"];
713
983
  readonly deployTargets: readonly [{
714
984
  readonly name: "topolo-one";
715
- readonly kind: "pages";
716
- readonly apiUrl: null;
717
- readonly domains: readonly ["one.topolo.app"];
718
- readonly routes: readonly [];
719
- readonly serviceId: null;
720
- }, {
721
- readonly name: "topolo-one-website";
722
985
  readonly kind: "worker";
723
986
  readonly apiUrl: null;
724
- readonly domains: readonly ["topolo.io", "www.topolo.io"];
987
+ readonly domains: readonly [];
725
988
  readonly routes: readonly [];
726
989
  readonly serviceId: null;
727
990
  }, {
728
- readonly name: "topolo-one-worker";
991
+ readonly name: "topolo-one-api";
729
992
  readonly kind: "worker";
730
993
  readonly apiUrl: "https://one.topolo.app";
731
- readonly domains: readonly ["one.topolo.app", "topolo.app", "www.topolo.app"];
732
- readonly routes: readonly ["one.topolo.app/*", "topolo.app", "www.topolo.app/*"];
994
+ readonly domains: readonly ["one.topolo.app"];
995
+ readonly routes: readonly ["one.topolo.app/*", "www.topolo.app/*"];
733
996
  readonly serviceId: "one";
997
+ }, {
998
+ readonly name: "topolo-one-website";
999
+ readonly kind: "worker";
1000
+ readonly apiUrl: "https://topolo.io";
1001
+ readonly domains: readonly ["topolo.io"];
1002
+ readonly routes: readonly ["topolo.io", "www.topolo.io"];
1003
+ readonly serviceId: null;
734
1004
  }];
735
1005
  };
736
1006
  readonly p2p: {
@@ -745,8 +1015,15 @@ declare const APPLICATIONS: {
745
1015
  readonly kind: "worker";
746
1016
  readonly apiUrl: "https://p2p.topolo.app";
747
1017
  readonly domains: readonly ["p2p.topolo.app"];
748
- readonly routes: readonly ["p2p.topolo.app"];
1018
+ readonly routes: readonly [];
749
1019
  readonly serviceId: "p2p";
1020
+ }, {
1021
+ readonly name: "topolo-p2p-api";
1022
+ readonly kind: "worker";
1023
+ readonly apiUrl: null;
1024
+ readonly domains: readonly [];
1025
+ readonly routes: readonly [];
1026
+ readonly serviceId: null;
750
1027
  }];
751
1028
  };
752
1029
  readonly pay: {
@@ -763,6 +1040,13 @@ declare const APPLICATIONS: {
763
1040
  readonly domains: readonly ["pay.topolo.app"];
764
1041
  readonly routes: readonly [];
765
1042
  readonly serviceId: "pay";
1043
+ }, {
1044
+ readonly name: "topolo-pay-api";
1045
+ readonly kind: "worker";
1046
+ readonly apiUrl: null;
1047
+ readonly domains: readonly [];
1048
+ readonly routes: readonly [];
1049
+ readonly serviceId: null;
766
1050
  }];
767
1051
  };
768
1052
  readonly people: {
@@ -777,8 +1061,15 @@ declare const APPLICATIONS: {
777
1061
  readonly kind: "worker";
778
1062
  readonly apiUrl: "https://people.topolo.app";
779
1063
  readonly domains: readonly ["people.topolo.app"];
780
- readonly routes: readonly ["people.topolo.app"];
1064
+ readonly routes: readonly [];
781
1065
  readonly serviceId: "people";
1066
+ }, {
1067
+ readonly name: "topolo-people-api";
1068
+ readonly kind: "worker";
1069
+ readonly apiUrl: null;
1070
+ readonly domains: readonly [];
1071
+ readonly routes: readonly [];
1072
+ readonly serviceId: null;
782
1073
  }];
783
1074
  };
784
1075
  readonly pulse: {
@@ -793,8 +1084,15 @@ declare const APPLICATIONS: {
793
1084
  readonly kind: "worker";
794
1085
  readonly apiUrl: "https://pulse.topolo.app";
795
1086
  readonly domains: readonly ["pulse.topolo.app"];
796
- readonly routes: readonly ["pulse.topolo.app"];
1087
+ readonly routes: readonly [];
797
1088
  readonly serviceId: "pulse";
1089
+ }, {
1090
+ readonly name: "topolo-pulse-api";
1091
+ readonly kind: "worker";
1092
+ readonly apiUrl: null;
1093
+ readonly domains: readonly [];
1094
+ readonly routes: readonly [];
1095
+ readonly serviceId: null;
798
1096
  }];
799
1097
  };
800
1098
  readonly quro: {
@@ -809,7 +1107,7 @@ declare const APPLICATIONS: {
809
1107
  readonly kind: "worker";
810
1108
  readonly apiUrl: "https://api.ol0.me";
811
1109
  readonly domains: readonly ["api.ol0.me"];
812
- readonly routes: readonly [];
1110
+ readonly routes: readonly ["api.ol0.me/*"];
813
1111
  readonly serviceId: "quro.api";
814
1112
  }, {
815
1113
  readonly name: "quro-redirect-system";
@@ -821,7 +1119,7 @@ declare const APPLICATIONS: {
821
1119
  }, {
822
1120
  readonly name: "quro-ui";
823
1121
  readonly kind: "worker";
824
- readonly apiUrl: null;
1122
+ readonly apiUrl: "https://quro.topolo.app";
825
1123
  readonly domains: readonly ["quro.topolo.app"];
826
1124
  readonly routes: readonly [];
827
1125
  readonly serviceId: null;
@@ -837,7 +1135,7 @@ declare const APPLICATIONS: {
837
1135
  readonly deployTargets: readonly [{
838
1136
  readonly name: "topolo-roadmapper";
839
1137
  readonly kind: "worker";
840
- readonly apiUrl: null;
1138
+ readonly apiUrl: "https://roadmapper.topolo.app";
841
1139
  readonly domains: readonly ["roadmapper.topolo.app"];
842
1140
  readonly routes: readonly [];
843
1141
  readonly serviceId: null;
@@ -862,8 +1160,15 @@ declare const APPLICATIONS: {
862
1160
  readonly kind: "worker";
863
1161
  readonly apiUrl: "https://sign.topolo.app";
864
1162
  readonly domains: readonly ["sign.topolo.app"];
865
- readonly routes: readonly ["sign.topolo.app"];
1163
+ readonly routes: readonly [];
866
1164
  readonly serviceId: "sign";
1165
+ }, {
1166
+ readonly name: "topolo-sign-api";
1167
+ readonly kind: "worker";
1168
+ readonly apiUrl: null;
1169
+ readonly domains: readonly [];
1170
+ readonly routes: readonly [];
1171
+ readonly serviceId: null;
867
1172
  }];
868
1173
  };
869
1174
  readonly social_studio: {
@@ -876,7 +1181,7 @@ declare const APPLICATIONS: {
876
1181
  readonly deployTargets: readonly [{
877
1182
  readonly name: "topolo-social-studio";
878
1183
  readonly kind: "worker";
879
- readonly apiUrl: null;
1184
+ readonly apiUrl: "https://studio.topolo.app";
880
1185
  readonly domains: readonly ["studio.topolo.app"];
881
1186
  readonly routes: readonly [];
882
1187
  readonly serviceId: null;
@@ -905,8 +1210,8 @@ declare const APPLICATIONS: {
905
1210
  readonly services: readonly ["socialize"];
906
1211
  readonly deployTargets: readonly [{
907
1212
  readonly name: "topolo-socialize";
908
- readonly kind: "pages";
909
- readonly apiUrl: null;
1213
+ readonly kind: "worker";
1214
+ readonly apiUrl: "https://socialize.topolo.app";
910
1215
  readonly domains: readonly ["socialize.topolo.app"];
911
1216
  readonly routes: readonly [];
912
1217
  readonly serviceId: null;
@@ -938,8 +1243,15 @@ declare const APPLICATIONS: {
938
1243
  readonly kind: "worker";
939
1244
  readonly apiUrl: "https://spaces.topolo.app";
940
1245
  readonly domains: readonly ["spaces.topolo.app"];
941
- readonly routes: readonly ["spaces.topolo.app"];
1246
+ readonly routes: readonly [];
942
1247
  readonly serviceId: "spaces";
1248
+ }, {
1249
+ readonly name: "topolo-spaces-api";
1250
+ readonly kind: "worker";
1251
+ readonly apiUrl: null;
1252
+ readonly domains: readonly [];
1253
+ readonly routes: readonly [];
1254
+ readonly serviceId: null;
943
1255
  }];
944
1256
  };
945
1257
  readonly status: {
@@ -954,10 +1266,33 @@ declare const APPLICATIONS: {
954
1266
  readonly kind: "worker";
955
1267
  readonly apiUrl: "https://status.topolo.app";
956
1268
  readonly domains: readonly ["status.topolo.app"];
957
- readonly routes: readonly ["status.topolo.app"];
1269
+ readonly routes: readonly [];
958
1270
  readonly serviceId: "status";
959
1271
  }];
960
1272
  };
1273
+ readonly success: {
1274
+ readonly id: "success";
1275
+ readonly appDir: "TopoloSuccess";
1276
+ readonly name: "topolo-success";
1277
+ readonly packageName: "topolo-success";
1278
+ readonly productionUrl: "https://success.topolo.app";
1279
+ readonly services: readonly ["success"];
1280
+ readonly deployTargets: readonly [{
1281
+ readonly name: "topolo-success";
1282
+ readonly kind: "worker";
1283
+ readonly apiUrl: "https://success.topolo.app";
1284
+ readonly domains: readonly ["success.topolo.app"];
1285
+ readonly routes: readonly ["success.topolo.app"];
1286
+ readonly serviceId: "success";
1287
+ }, {
1288
+ readonly name: "topolo-success-api";
1289
+ readonly kind: "worker";
1290
+ readonly apiUrl: null;
1291
+ readonly domains: readonly [];
1292
+ readonly routes: readonly [];
1293
+ readonly serviceId: null;
1294
+ }];
1295
+ };
961
1296
  readonly support: {
962
1297
  readonly id: "support";
963
1298
  readonly appDir: "TopoloSupport";
@@ -972,6 +1307,13 @@ declare const APPLICATIONS: {
972
1307
  readonly domains: readonly ["support.topolo.app"];
973
1308
  readonly routes: readonly ["support.topolo.app/*"];
974
1309
  readonly serviceId: "support";
1310
+ }, {
1311
+ readonly name: "topolo-support-api";
1312
+ readonly kind: "worker";
1313
+ readonly apiUrl: null;
1314
+ readonly domains: readonly [];
1315
+ readonly routes: readonly [];
1316
+ readonly serviceId: null;
975
1317
  }];
976
1318
  };
977
1319
  readonly survey: {
@@ -986,8 +1328,15 @@ declare const APPLICATIONS: {
986
1328
  readonly kind: "worker";
987
1329
  readonly apiUrl: "https://survey.topolo.app";
988
1330
  readonly domains: readonly ["survey.topolo.app"];
989
- readonly routes: readonly ["survey.topolo.app"];
1331
+ readonly routes: readonly [];
990
1332
  readonly serviceId: "survey";
1333
+ }, {
1334
+ readonly name: "topolo-survey-api";
1335
+ readonly kind: "worker";
1336
+ readonly apiUrl: null;
1337
+ readonly domains: readonly [];
1338
+ readonly routes: readonly [];
1339
+ readonly serviceId: null;
991
1340
  }];
992
1341
  };
993
1342
  readonly voice: {
@@ -1002,8 +1351,15 @@ declare const APPLICATIONS: {
1002
1351
  readonly kind: "worker";
1003
1352
  readonly apiUrl: "https://voice.topolo.app";
1004
1353
  readonly domains: readonly ["voice.topolo.app"];
1005
- readonly routes: readonly ["voice.topolo.app"];
1354
+ readonly routes: readonly [];
1006
1355
  readonly serviceId: "voice";
1356
+ }, {
1357
+ readonly name: "topolo-voice-api";
1358
+ readonly kind: "worker";
1359
+ readonly apiUrl: null;
1360
+ readonly domains: readonly [];
1361
+ readonly routes: readonly [];
1362
+ readonly serviceId: null;
1007
1363
  }];
1008
1364
  };
1009
1365
  readonly web: {
@@ -1025,12 +1381,12 @@ declare const APPLICATIONS: {
1025
1381
  readonly kind: "worker";
1026
1382
  readonly apiUrl: "https://sites.topolo.app";
1027
1383
  readonly domains: readonly ["sites.topolo.app"];
1028
- readonly routes: readonly [];
1384
+ readonly routes: readonly ["*.sites.topolo.app/*", "sites.topolo.app"];
1029
1385
  readonly serviceId: null;
1030
1386
  }, {
1031
1387
  readonly name: "topolo-web-studio";
1032
1388
  readonly kind: "worker";
1033
- readonly apiUrl: null;
1389
+ readonly apiUrl: "https://web.topolo.app";
1034
1390
  readonly domains: readonly ["web.topolo.app"];
1035
1391
  readonly routes: readonly [];
1036
1392
  readonly serviceId: null;
@@ -1122,8 +1478,8 @@ declare const APPLICATION_REQUIREMENTS: readonly [{
1122
1478
  readonly title: "Register protected APIs as platform services";
1123
1479
  readonly summary: "Callable app APIs need a stable service ID, service slug, permissions, role bundles, and API-key scopes before agents or users rely on them.";
1124
1480
  readonly appliesTo: readonly ["api"];
1125
- readonly evidence: readonly ["Auth service catalog contains the service ID and slug", "Permissions, role bundles, and API-key scopes exist for the service", "SDK, CLI, and MCP service discovery include the callable production API"];
1126
- readonly implementation: readonly ["Add production Worker api_url metadata before adding an SDK service ID", "Expose stable service IDs through DEFAULT_SERVICE_URLS", "Keep typed SDK/CLI/MCP surfaces in sync when an API contract stabilizes"];
1481
+ readonly evidence: readonly ["Auth service catalog contains the service ID and slug", "Permissions, role bundles, and API-key scopes exist for the service", "SDK, CLI, and MCP service discovery include the callable production API", "CloudControl production HTTP targets classify agent reachability with sdk_service_id or agent_callable:false"];
1482
+ readonly implementation: readonly ["Add production Worker api_url metadata and sdk_service_id for every agent-callable API target", "Mark browser, documentation, and runtime-only Worker targets with agent_callable:false", "Expose stable service IDs through generated DEFAULT_SERVICE_URLS and live catalog discovery", "Keep typed SDK/CLI/MCP surfaces in sync when an API contract stabilizes"];
1127
1483
  }, {
1128
1484
  readonly id: "organization-scoped-data";
1129
1485
  readonly title: "Keep application data organization-scoped";
@@ -1191,167 +1547,6 @@ declare function auditAllApplicationRequirements(applicationIds?: readonly Appli
1191
1547
  declare const DEFAULT_SERVICE_URLS: Record<ServiceId, string>;
1192
1548
  declare function resolveServiceUrl(service: ServiceId, overrides?: Partial<Record<ServiceId, string>>): string;
1193
1549
 
1194
- interface TopoloClientOptions {
1195
- credential: TopoloCredential;
1196
- agent: AgentIdentity;
1197
- /** Per-service URL overrides. Useful for staging/dev. */
1198
- serviceUrls?: Partial<Record<ServiceId, string>>;
1199
- /** Per-service TopoloAuth service id overrides from the owning app/deployment. */
1200
- serviceIds?: Partial<Record<ServiceId, string>>;
1201
- /**
1202
- * When true, mutating helpers (POST/PUT/PATCH/DELETE) require callers to pass
1203
- * `{ confirm: true }`. Defaults to true. Set false only for trusted surfaces.
1204
- */
1205
- requireConfirmForWrites?: boolean;
1206
- /** HTTP request timeout (ms). Default 30s. */
1207
- timeoutMs?: number;
1208
- /** Injected fetch, for testing. Defaults to global fetch. */
1209
- fetch?: typeof fetch;
1210
- /**
1211
- * Observability hook. Fires once per request lifecycle (`request` at start,
1212
- * then exactly one of `response` or `error`). Safe to leave unset — off by
1213
- * default. Intended for CLI/MCP hosts to surface request-level diagnostics
1214
- * and for consumers building their own logging/tracing.
1215
- */
1216
- debug?: (event: TopoloDebugEvent) => void;
1217
- }
1218
- type TopoloDebugEvent = {
1219
- phase: 'request';
1220
- method: string;
1221
- service: ServiceId;
1222
- path: string;
1223
- url: string;
1224
- requestId: string;
1225
- } | {
1226
- phase: 'response';
1227
- method: string;
1228
- service: ServiceId;
1229
- path: string;
1230
- url: string;
1231
- requestId: string;
1232
- status: number;
1233
- durationMs: number;
1234
- } | {
1235
- phase: 'error';
1236
- method: string;
1237
- service: ServiceId;
1238
- path: string;
1239
- url: string;
1240
- requestId: string;
1241
- durationMs: number;
1242
- error: string;
1243
- status?: number;
1244
- };
1245
- interface RequestOptions {
1246
- service: ServiceId;
1247
- path: string;
1248
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
1249
- query?: Record<string, string | number | boolean | undefined>;
1250
- body?: unknown;
1251
- /** Explicit write-acknowledgement for mutating calls. */
1252
- confirm?: boolean;
1253
- /** Extra headers appended after auth/audit headers. */
1254
- headers?: Record<string, string>;
1255
- signal?: AbortSignal;
1256
- }
1257
- /**
1258
- * A single entry from the live platform service catalog. Returned by
1259
- * {@link TopoloClient.listServices}. Shape mirrors the public-safe projection
1260
- * from TopoloAuth `GET /api/services/catalog`.
1261
- */
1262
- interface TopoloServiceCatalogEntry {
1263
- serviceId: string;
1264
- slug: string | null;
1265
- name: string | null;
1266
- description: string | null;
1267
- baseUrl: string | null;
1268
- status: string | null;
1269
- surfaceKind: string | null;
1270
- launchable: boolean;
1271
- }
1272
- declare class TopoloClient {
1273
- private readonly credential;
1274
- private readonly agent;
1275
- private readonly serviceUrls?;
1276
- private readonly serviceIds?;
1277
- private readonly requireConfirmForWrites;
1278
- private readonly timeoutMs;
1279
- private readonly fetchImpl;
1280
- private readonly debug?;
1281
- /**
1282
- * Process-wide cache for slug → service-id lookups. Keyed by
1283
- * `${authBaseUrl}|${slug}` so multiple `TopoloClient` instances pointing at
1284
- * the same Auth share, but staging vs prod don't poison each other.
1285
- * Cleared via `TopoloClient.clearServiceIdCache()` if a test needs it.
1286
- */
1287
- private static readonly serviceIdCache;
1288
- /**
1289
- * Drop the slug→service-id cache. Test-only — production callers should
1290
- * let the 5-minute TTL expire naturally.
1291
- */
1292
- static clearServiceIdCache(): void;
1293
- constructor(options: TopoloClientOptions);
1294
- private emit;
1295
- /**
1296
- * Low-level JSON request. Prefer the typed module helpers (identity, crm, ...)
1297
- * for anything a caller would reach for; this stays exported for escape-hatch
1298
- * use and for the generic `topolo api` / MCP passthrough tool.
1299
- */
1300
- request<T = unknown>(opts: RequestOptions): Promise<T>;
1301
- /**
1302
- * Resolve a service-slug → opaque service-id via caller config or TopoloAuth.
1303
- *
1304
- * Cache: 5 minutes per process per `(slug, auth_base_url)`. Negative
1305
- * results (404) are cached for 60s so a typo doesn't hot-loop the
1306
- * resolver. Returns null when the slug isn't registered — callers decide
1307
- * whether to throw.
1308
- *
1309
- * No credential is sent: the endpoint is public (slugs aren't secret).
1310
- * This keeps the resolver usable during early bootstrap before a caller
1311
- * has acquired an access token.
1312
- */
1313
- getServiceIdBySlug(slug: string): Promise<string | null>;
1314
- /**
1315
- * List the platform service catalog from the live registry
1316
- * (`GET /api/services/catalog` on TopoloAuth). Credential-aware: the
1317
- * caller's credential is attached, so an authenticated caller in an
1318
- * entitled org also receives the `developer_only` services its role
1319
- * permits; an unauthenticated/agent caller receives `active` only.
1320
- *
1321
- * Resilient: on any network/HTTP failure this falls back to the
1322
- * build-time generated `APPLICATIONS` snapshot so offline/degraded
1323
- * callers still get a usable (if static) catalog. The live result is
1324
- * authoritative; the snapshot is a floor, not a cap.
1325
- */
1326
- listServices(): Promise<TopoloServiceCatalogEntry[]>;
1327
- private generatedCatalogFallback;
1328
- /**
1329
- * Introspect the current credential. Returns the caller's resolved identity,
1330
- * organization, and permission set. Used by CLI `whoami` and by MCP to gate
1331
- * advertised tools by scope.
1332
- *
1333
- * Both JWT access tokens and platform API keys are resolved via the unified
1334
- * `GET /api/auth/me` endpoint on TopoloAuth, which does not require service
1335
- * credentials. The caller's possession of the credential secret is proof.
1336
- */
1337
- introspect(): Promise<CredentialIntrospection>;
1338
- }
1339
- interface CredentialIntrospection {
1340
- kind: 'api_key' | 'access_token';
1341
- user: {
1342
- id: string;
1343
- email: string;
1344
- name: string | null;
1345
- role: string;
1346
- permissions: string[];
1347
- };
1348
- organization: {
1349
- id: string;
1350
- slug: string;
1351
- name: string;
1352
- } | null;
1353
- }
1354
-
1355
1550
  declare class TopoloSdkError extends Error {
1356
1551
  readonly code: string;
1357
1552
  constructor(code: string, message: string);