@topolo/sdk 0.2.12 → 0.4.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.
package/dist/index.d.cts CHANGED
@@ -65,12 +65,14 @@ declare const SERVICES: {
65
65
  readonly p2p: "https://p2p.topolo.app";
66
66
  readonly pay: "https://pay.topolo.app";
67
67
  readonly people: "https://people.topolo.app";
68
+ readonly pulse: "https://pulse.topolo.app";
68
69
  readonly "quro.api": "https://api.ol0.me";
69
70
  readonly "quro.redirect": "https://ol0.me";
70
71
  readonly roadmapper: "https://roadmapper-api.topolo.app";
71
72
  readonly sign: "https://sign.topolo.app";
72
73
  readonly social_studio: "https://studio-api.topolo.app";
73
74
  readonly socialize: "https://socialize-api.topolo.app";
75
+ readonly spaces: "https://spaces.topolo.app";
74
76
  readonly status: "https://status.topolo.app";
75
77
  readonly support: "https://support.topolo.app";
76
78
  readonly survey: "https://survey.topolo.app";
@@ -78,7 +80,6 @@ declare const SERVICES: {
78
80
  readonly web: "https://web-api.topolo.app";
79
81
  };
80
82
  type ServiceId = keyof typeof SERVICES;
81
- declare const PLATFORM_SERVICE_IDS: Partial<Record<ServiceId, string>>;
82
83
 
83
84
  declare const APPLICATIONS: {
84
85
  readonly admin: {
@@ -136,6 +137,22 @@ declare const APPLICATIONS: {
136
137
  readonly serviceId: "auth";
137
138
  }];
138
139
  };
140
+ readonly backup: {
141
+ readonly id: "backup";
142
+ readonly appDir: "TopoloBackup";
143
+ readonly name: "topolo-backup";
144
+ readonly packageName: "topolo-backup";
145
+ readonly productionUrl: null;
146
+ readonly services: readonly [];
147
+ readonly deployTargets: readonly [{
148
+ readonly name: "topolo-backup";
149
+ readonly kind: "worker";
150
+ readonly apiUrl: null;
151
+ readonly domains: readonly [];
152
+ readonly routes: readonly [];
153
+ readonly serviceId: null;
154
+ }];
155
+ };
139
156
  readonly books: {
140
157
  readonly id: "books";
141
158
  readonly appDir: "TopoloBooks";
@@ -239,15 +256,6 @@ declare const APPLICATIONS: {
239
256
  readonly serviceId: "chat";
240
257
  }];
241
258
  };
242
- readonly cli: {
243
- readonly id: "cli";
244
- readonly appDir: "TopoloCli";
245
- readonly name: "@topolo/cli";
246
- readonly packageName: "@topolo/cli";
247
- readonly productionUrl: null;
248
- readonly services: readonly [];
249
- readonly deployTargets: readonly [];
250
- };
251
259
  readonly cloudcontrol: {
252
260
  readonly id: "cloudcontrol";
253
261
  readonly appDir: "TopoloCloudControl";
@@ -365,22 +373,6 @@ declare const APPLICATIONS: {
365
373
  readonly serviceId: "customer_success";
366
374
  }];
367
375
  };
368
- readonly d1_backup: {
369
- readonly id: "d1_backup";
370
- readonly appDir: "TopoloD1Backup";
371
- readonly name: "topolo-d1-backup";
372
- readonly packageName: "topolo-d1-backup";
373
- readonly productionUrl: null;
374
- readonly services: readonly [];
375
- readonly deployTargets: readonly [{
376
- readonly name: "topolo-d1-backup";
377
- readonly kind: "worker";
378
- readonly apiUrl: null;
379
- readonly domains: readonly [];
380
- readonly routes: readonly [];
381
- readonly serviceId: null;
382
- }];
383
- };
384
376
  readonly developers: {
385
377
  readonly id: "developers";
386
378
  readonly appDir: "TopoloDevelopers";
@@ -617,15 +609,6 @@ declare const APPLICATIONS: {
617
609
  readonly serviceId: "mail";
618
610
  }];
619
611
  };
620
- readonly mcp: {
621
- readonly id: "mcp";
622
- readonly appDir: "TopoloMCP";
623
- readonly name: "@topolo/mcp";
624
- readonly packageName: "@topolo/mcp";
625
- readonly productionUrl: null;
626
- readonly services: readonly [];
627
- readonly deployTargets: readonly [];
628
- };
629
612
  readonly mdm: {
630
613
  readonly id: "mdm";
631
614
  readonly appDir: "TopoloMDM";
@@ -723,7 +706,7 @@ declare const APPLICATIONS: {
723
706
  readonly one: {
724
707
  readonly id: "one";
725
708
  readonly appDir: "TopoloOne";
726
- readonly name: "topolo-oneclick-sso";
709
+ readonly name: "TopoloOne";
727
710
  readonly packageName: "topolo-oneclick-sso";
728
711
  readonly productionUrl: "https://one.topolo.app";
729
712
  readonly services: readonly ["one"];
@@ -803,9 +786,16 @@ declare const APPLICATIONS: {
803
786
  readonly appDir: "TopoloPulse";
804
787
  readonly name: "topolo-pulse";
805
788
  readonly packageName: "topolo-pulse";
806
- readonly productionUrl: null;
807
- readonly services: readonly [];
808
- readonly deployTargets: readonly [];
789
+ readonly productionUrl: "https://pulse.topolo.app";
790
+ readonly services: readonly ["pulse"];
791
+ readonly deployTargets: readonly [{
792
+ readonly name: "topolo-pulse";
793
+ readonly kind: "worker";
794
+ readonly apiUrl: "https://pulse.topolo.app";
795
+ readonly domains: readonly ["pulse.topolo.app"];
796
+ readonly routes: readonly ["pulse.topolo.app"];
797
+ readonly serviceId: "pulse";
798
+ }];
809
799
  };
810
800
  readonly quro: {
811
801
  readonly id: "quro";
@@ -936,6 +926,22 @@ declare const APPLICATIONS: {
936
926
  readonly serviceId: null;
937
927
  }];
938
928
  };
929
+ readonly spaces: {
930
+ readonly id: "spaces";
931
+ readonly appDir: "TopoloSpaces";
932
+ readonly name: "topolo-spaces";
933
+ readonly packageName: "@topolo/spaces";
934
+ readonly productionUrl: "https://spaces.topolo.app";
935
+ readonly services: readonly ["spaces"];
936
+ readonly deployTargets: readonly [{
937
+ readonly name: "topolo-spaces";
938
+ readonly kind: "worker";
939
+ readonly apiUrl: "https://spaces.topolo.app";
940
+ readonly domains: readonly ["spaces.topolo.app"];
941
+ readonly routes: readonly ["spaces.topolo.app"];
942
+ readonly serviceId: "spaces";
943
+ }];
944
+ };
939
945
  readonly status: {
940
946
  readonly id: "status";
941
947
  readonly appDir: "TopoloStatus";
@@ -1102,8 +1108,8 @@ declare const APPLICATION_REQUIREMENTS: readonly [{
1102
1108
  readonly title: "Use the shared Topolo auth boundary";
1103
1109
  readonly summary: "Applications must derive identity, organization, scopes, and service entitlement from TopoloAuth rather than inventing parallel auth state.";
1104
1110
  readonly appliesTo: readonly ["browser", "api", "tooling", "agent_surface"];
1105
- readonly evidence: readonly ["@topolo/auth-client or @topolo/auth-middleware is used where applicable", "No public command, tool, or SDK method accepts orgId", "Service slug and Auth service registration are documented for protected services"];
1106
- readonly implementation: readonly ["Use shared auth packages instead of copying token parsing or browser storage flows", "Derive organization from the credential on every request", "Route OAuth, refresh, logout, and SSO paths according to the shared Auth contract"];
1111
+ readonly evidence: readonly ["@topolo/auth-client or @topolo-io/worker-runtime is used where applicable", "No public command, tool, or SDK method accepts orgId", "Service slug and Auth service registration are documented for protected services"];
1112
+ readonly implementation: readonly ["Use shared auth/runtime packages instead of copying token parsing, gateway, or browser storage flows", "Derive organization from the credential on every request", "Route OAuth, refresh, logout, and SSO paths according to the shared Auth contract"];
1107
1113
  }, {
1108
1114
  readonly id: "shared-shell-and-launcher";
1109
1115
  readonly title: "Use the shared shell, launcher, and account menu";
@@ -1190,6 +1196,8 @@ interface TopoloClientOptions {
1190
1196
  agent: AgentIdentity;
1191
1197
  /** Per-service URL overrides. Useful for staging/dev. */
1192
1198
  serviceUrls?: Partial<Record<ServiceId, string>>;
1199
+ /** Per-service TopoloAuth service id overrides from the owning app/deployment. */
1200
+ serviceIds?: Partial<Record<ServiceId, string>>;
1193
1201
  /**
1194
1202
  * When true, mutating helpers (POST/PUT/PATCH/DELETE) require callers to pass
1195
1203
  * `{ confirm: true }`. Defaults to true. Set false only for trusted surfaces.
@@ -1246,14 +1254,42 @@ interface RequestOptions {
1246
1254
  headers?: Record<string, string>;
1247
1255
  signal?: AbortSignal;
1248
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
+ }
1249
1272
  declare class TopoloClient {
1250
1273
  private readonly credential;
1251
1274
  private readonly agent;
1252
1275
  private readonly serviceUrls?;
1276
+ private readonly serviceIds?;
1253
1277
  private readonly requireConfirmForWrites;
1254
1278
  private readonly timeoutMs;
1255
1279
  private readonly fetchImpl;
1256
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;
1257
1293
  constructor(options: TopoloClientOptions);
1258
1294
  private emit;
1259
1295
  /**
@@ -1262,6 +1298,33 @@ declare class TopoloClient {
1262
1298
  * use and for the generic `topolo api` / MCP passthrough tool.
1263
1299
  */
1264
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;
1265
1328
  /**
1266
1329
  * Introspect the current credential. Returns the caller's resolved identity,
1267
1330
  * organization, and permission set. Used by CLI `whoami` and by MCP to gate
@@ -1793,4 +1856,4 @@ declare function createTopolo(options: TopoloClientOptions): {
1793
1856
  };
1794
1857
  type Topolo = ReturnType<typeof createTopolo>;
1795
1858
 
1796
- export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, PLATFORM_SERVICE_IDS, type PublishCapabilityInput, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };
1859
+ export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };
package/dist/index.d.ts CHANGED
@@ -65,12 +65,14 @@ declare const SERVICES: {
65
65
  readonly p2p: "https://p2p.topolo.app";
66
66
  readonly pay: "https://pay.topolo.app";
67
67
  readonly people: "https://people.topolo.app";
68
+ readonly pulse: "https://pulse.topolo.app";
68
69
  readonly "quro.api": "https://api.ol0.me";
69
70
  readonly "quro.redirect": "https://ol0.me";
70
71
  readonly roadmapper: "https://roadmapper-api.topolo.app";
71
72
  readonly sign: "https://sign.topolo.app";
72
73
  readonly social_studio: "https://studio-api.topolo.app";
73
74
  readonly socialize: "https://socialize-api.topolo.app";
75
+ readonly spaces: "https://spaces.topolo.app";
74
76
  readonly status: "https://status.topolo.app";
75
77
  readonly support: "https://support.topolo.app";
76
78
  readonly survey: "https://survey.topolo.app";
@@ -78,7 +80,6 @@ declare const SERVICES: {
78
80
  readonly web: "https://web-api.topolo.app";
79
81
  };
80
82
  type ServiceId = keyof typeof SERVICES;
81
- declare const PLATFORM_SERVICE_IDS: Partial<Record<ServiceId, string>>;
82
83
 
83
84
  declare const APPLICATIONS: {
84
85
  readonly admin: {
@@ -136,6 +137,22 @@ declare const APPLICATIONS: {
136
137
  readonly serviceId: "auth";
137
138
  }];
138
139
  };
140
+ readonly backup: {
141
+ readonly id: "backup";
142
+ readonly appDir: "TopoloBackup";
143
+ readonly name: "topolo-backup";
144
+ readonly packageName: "topolo-backup";
145
+ readonly productionUrl: null;
146
+ readonly services: readonly [];
147
+ readonly deployTargets: readonly [{
148
+ readonly name: "topolo-backup";
149
+ readonly kind: "worker";
150
+ readonly apiUrl: null;
151
+ readonly domains: readonly [];
152
+ readonly routes: readonly [];
153
+ readonly serviceId: null;
154
+ }];
155
+ };
139
156
  readonly books: {
140
157
  readonly id: "books";
141
158
  readonly appDir: "TopoloBooks";
@@ -239,15 +256,6 @@ declare const APPLICATIONS: {
239
256
  readonly serviceId: "chat";
240
257
  }];
241
258
  };
242
- readonly cli: {
243
- readonly id: "cli";
244
- readonly appDir: "TopoloCli";
245
- readonly name: "@topolo/cli";
246
- readonly packageName: "@topolo/cli";
247
- readonly productionUrl: null;
248
- readonly services: readonly [];
249
- readonly deployTargets: readonly [];
250
- };
251
259
  readonly cloudcontrol: {
252
260
  readonly id: "cloudcontrol";
253
261
  readonly appDir: "TopoloCloudControl";
@@ -365,22 +373,6 @@ declare const APPLICATIONS: {
365
373
  readonly serviceId: "customer_success";
366
374
  }];
367
375
  };
368
- readonly d1_backup: {
369
- readonly id: "d1_backup";
370
- readonly appDir: "TopoloD1Backup";
371
- readonly name: "topolo-d1-backup";
372
- readonly packageName: "topolo-d1-backup";
373
- readonly productionUrl: null;
374
- readonly services: readonly [];
375
- readonly deployTargets: readonly [{
376
- readonly name: "topolo-d1-backup";
377
- readonly kind: "worker";
378
- readonly apiUrl: null;
379
- readonly domains: readonly [];
380
- readonly routes: readonly [];
381
- readonly serviceId: null;
382
- }];
383
- };
384
376
  readonly developers: {
385
377
  readonly id: "developers";
386
378
  readonly appDir: "TopoloDevelopers";
@@ -617,15 +609,6 @@ declare const APPLICATIONS: {
617
609
  readonly serviceId: "mail";
618
610
  }];
619
611
  };
620
- readonly mcp: {
621
- readonly id: "mcp";
622
- readonly appDir: "TopoloMCP";
623
- readonly name: "@topolo/mcp";
624
- readonly packageName: "@topolo/mcp";
625
- readonly productionUrl: null;
626
- readonly services: readonly [];
627
- readonly deployTargets: readonly [];
628
- };
629
612
  readonly mdm: {
630
613
  readonly id: "mdm";
631
614
  readonly appDir: "TopoloMDM";
@@ -723,7 +706,7 @@ declare const APPLICATIONS: {
723
706
  readonly one: {
724
707
  readonly id: "one";
725
708
  readonly appDir: "TopoloOne";
726
- readonly name: "topolo-oneclick-sso";
709
+ readonly name: "TopoloOne";
727
710
  readonly packageName: "topolo-oneclick-sso";
728
711
  readonly productionUrl: "https://one.topolo.app";
729
712
  readonly services: readonly ["one"];
@@ -803,9 +786,16 @@ declare const APPLICATIONS: {
803
786
  readonly appDir: "TopoloPulse";
804
787
  readonly name: "topolo-pulse";
805
788
  readonly packageName: "topolo-pulse";
806
- readonly productionUrl: null;
807
- readonly services: readonly [];
808
- readonly deployTargets: readonly [];
789
+ readonly productionUrl: "https://pulse.topolo.app";
790
+ readonly services: readonly ["pulse"];
791
+ readonly deployTargets: readonly [{
792
+ readonly name: "topolo-pulse";
793
+ readonly kind: "worker";
794
+ readonly apiUrl: "https://pulse.topolo.app";
795
+ readonly domains: readonly ["pulse.topolo.app"];
796
+ readonly routes: readonly ["pulse.topolo.app"];
797
+ readonly serviceId: "pulse";
798
+ }];
809
799
  };
810
800
  readonly quro: {
811
801
  readonly id: "quro";
@@ -936,6 +926,22 @@ declare const APPLICATIONS: {
936
926
  readonly serviceId: null;
937
927
  }];
938
928
  };
929
+ readonly spaces: {
930
+ readonly id: "spaces";
931
+ readonly appDir: "TopoloSpaces";
932
+ readonly name: "topolo-spaces";
933
+ readonly packageName: "@topolo/spaces";
934
+ readonly productionUrl: "https://spaces.topolo.app";
935
+ readonly services: readonly ["spaces"];
936
+ readonly deployTargets: readonly [{
937
+ readonly name: "topolo-spaces";
938
+ readonly kind: "worker";
939
+ readonly apiUrl: "https://spaces.topolo.app";
940
+ readonly domains: readonly ["spaces.topolo.app"];
941
+ readonly routes: readonly ["spaces.topolo.app"];
942
+ readonly serviceId: "spaces";
943
+ }];
944
+ };
939
945
  readonly status: {
940
946
  readonly id: "status";
941
947
  readonly appDir: "TopoloStatus";
@@ -1102,8 +1108,8 @@ declare const APPLICATION_REQUIREMENTS: readonly [{
1102
1108
  readonly title: "Use the shared Topolo auth boundary";
1103
1109
  readonly summary: "Applications must derive identity, organization, scopes, and service entitlement from TopoloAuth rather than inventing parallel auth state.";
1104
1110
  readonly appliesTo: readonly ["browser", "api", "tooling", "agent_surface"];
1105
- readonly evidence: readonly ["@topolo/auth-client or @topolo/auth-middleware is used where applicable", "No public command, tool, or SDK method accepts orgId", "Service slug and Auth service registration are documented for protected services"];
1106
- readonly implementation: readonly ["Use shared auth packages instead of copying token parsing or browser storage flows", "Derive organization from the credential on every request", "Route OAuth, refresh, logout, and SSO paths according to the shared Auth contract"];
1111
+ readonly evidence: readonly ["@topolo/auth-client or @topolo-io/worker-runtime is used where applicable", "No public command, tool, or SDK method accepts orgId", "Service slug and Auth service registration are documented for protected services"];
1112
+ readonly implementation: readonly ["Use shared auth/runtime packages instead of copying token parsing, gateway, or browser storage flows", "Derive organization from the credential on every request", "Route OAuth, refresh, logout, and SSO paths according to the shared Auth contract"];
1107
1113
  }, {
1108
1114
  readonly id: "shared-shell-and-launcher";
1109
1115
  readonly title: "Use the shared shell, launcher, and account menu";
@@ -1190,6 +1196,8 @@ interface TopoloClientOptions {
1190
1196
  agent: AgentIdentity;
1191
1197
  /** Per-service URL overrides. Useful for staging/dev. */
1192
1198
  serviceUrls?: Partial<Record<ServiceId, string>>;
1199
+ /** Per-service TopoloAuth service id overrides from the owning app/deployment. */
1200
+ serviceIds?: Partial<Record<ServiceId, string>>;
1193
1201
  /**
1194
1202
  * When true, mutating helpers (POST/PUT/PATCH/DELETE) require callers to pass
1195
1203
  * `{ confirm: true }`. Defaults to true. Set false only for trusted surfaces.
@@ -1246,14 +1254,42 @@ interface RequestOptions {
1246
1254
  headers?: Record<string, string>;
1247
1255
  signal?: AbortSignal;
1248
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
+ }
1249
1272
  declare class TopoloClient {
1250
1273
  private readonly credential;
1251
1274
  private readonly agent;
1252
1275
  private readonly serviceUrls?;
1276
+ private readonly serviceIds?;
1253
1277
  private readonly requireConfirmForWrites;
1254
1278
  private readonly timeoutMs;
1255
1279
  private readonly fetchImpl;
1256
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;
1257
1293
  constructor(options: TopoloClientOptions);
1258
1294
  private emit;
1259
1295
  /**
@@ -1262,6 +1298,33 @@ declare class TopoloClient {
1262
1298
  * use and for the generic `topolo api` / MCP passthrough tool.
1263
1299
  */
1264
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;
1265
1328
  /**
1266
1329
  * Introspect the current credential. Returns the caller's resolved identity,
1267
1330
  * organization, and permission set. Used by CLI `whoami` and by MCP to gate
@@ -1793,4 +1856,4 @@ declare function createTopolo(options: TopoloClientOptions): {
1793
1856
  };
1794
1857
  type Topolo = ReturnType<typeof createTopolo>;
1795
1858
 
1796
- export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, PLATFORM_SERVICE_IDS, type PublishCapabilityInput, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };
1859
+ export { APPLICATIONS, APPLICATION_REQUIREMENTS, APPLICATION_REQUIREMENTS_VERSION, type AgentIdentity, type ApplicationCatalogEntry, type ApplicationDeployTarget, type ApplicationId, type ApplicationRequirement, type ApplicationRequirementAudit, type ApplicationRequirementFinding, type ApplicationRequirementMigrationItem, type ApplicationRequirementScope, type ApplicationRequirementScore, type ApplicationRequirementStatus, type ApplicationRequirementsAuditReport, type CredentialIntrospection, type CrmContactSummary, CrmModule, DEFAULT_SERVICE_URLS, type DeviceAuthorizationResponse, IdentityModule, type ListContactsOptions, type ListContactsResult, type OAuthHelperOptions, type P2PActionDetail, type P2PActionRequestInput, type P2PActionRequestResult, type P2PActionRow, type P2PActionRun, type P2PCapability, type P2PConnection, type P2PHold, type P2PLedgerEntry, P2PModule, type P2PPolicy, type P2PPricingModel, type P2PSettlementBatch, type P2PSettlementGroup, type PublishCapabilityInput, type RequestOptions, type ServiceId, TOPOLO_WIDGET_ENDPOINT, TOPOLO_WIDGET_REFRESH_INTERVAL_MS, type TokenResponse, type Topolo, TopoloAuthError, type TopoloChartWidget, TopoloClient, type TopoloClientOptions, type TopoloCredential, type TopoloDebugEvent, TopoloHttpError, type TopoloNotificationsWidget, TopoloOAuth, TopoloPermissionError, type TopoloQuickActionsWidget, type TopoloRecentActivityWidget, TopoloSdkError, type TopoloServiceCatalogEntry, type TopoloStatsWidget, type TopoloWidget, type TopoloWidgetActionItem, type TopoloWidgetActivityItem, type TopoloWidgetApiResponse, type TopoloWidgetBase, type TopoloWidgetConfig, type TopoloWidgetDraft, type TopoloWidgetMetric, type TopoloWidgetNotificationItem, type TopoloWidgetResponseOptions, type TopoloWidgetSnapshotMetadata, type TopoloWidgetSnapshotMetric, type TopoloWidgetType, type TopoloWidgetValidationResult, applicationRequirementScopes, auditAllApplicationRequirements, auditApplicationRequirements, createTopolo, createTopoloWidgetError, createTopoloWidgetResponse, defineTopoloChartWidget, defineTopoloNotificationsWidget, defineTopoloQuickActionsWidget, defineTopoloRecentActivityWidget, defineTopoloStatsWidget, requirementsForApplication, resolveServiceUrl, validateTopoloWidgetResponse };