@topolo/sdk 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topolo/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Typed client SDK for the Topolo platform. Used by TopoloCli, TopoloMCP, and third-party agents.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -149,10 +149,12 @@ export const APPLICATION_REQUIREMENTS = [
149
149
  'Auth service catalog contains the service ID and slug',
150
150
  'Permissions, role bundles, and API-key scopes exist for the service',
151
151
  'SDK, CLI, and MCP service discovery include the callable production API',
152
+ 'CloudControl production HTTP targets classify agent reachability with sdk_service_id or agent_callable:false',
152
153
  ],
153
154
  implementation: [
154
- 'Add production Worker api_url metadata before adding an SDK service ID',
155
- 'Expose stable service IDs through DEFAULT_SERVICE_URLS',
155
+ 'Add production Worker api_url metadata and sdk_service_id for every agent-callable API target',
156
+ 'Mark browser, documentation, and runtime-only Worker targets with agent_callable:false',
157
+ 'Expose stable service IDs through generated DEFAULT_SERVICE_URLS and live catalog discovery',
156
158
  'Keep typed SDK/CLI/MCP surfaces in sync when an API contract stabilizes',
157
159
  ],
158
160
  },
@@ -268,10 +270,17 @@ export function applicationRequirementScopes(
268
270
  // the deploy catalog union, so compare as string rather than assert overlap.
269
271
  const appId: string = application.id;
270
272
  const hasBrowserSurface =
271
- Boolean(application.productionUrl) || application.deployTargets.some((target) => target.kind === 'pages');
273
+ Boolean(application.productionUrl) ||
274
+ // String() keeps this guard valid after the Pages->Worker migration narrowed
275
+ // the generated kind union to "worker" (no "pages" literal remains).
276
+ application.deployTargets.some((target) => String(target.kind) === 'pages');
277
+ // An API surface means an agent-callable service — keyed on a resolved
278
+ // serviceId, NOT a bare apiUrl. After the Pages->Worker migration every
279
+ // frontend shell carries an apiUrl (its own serving domain), so apiUrl is no
280
+ // longer a signal for "exposes a callable API"; serviceId is.
272
281
  const hasApiSurface =
273
282
  application.services.length > 0 ||
274
- application.deployTargets.some((target) => Boolean(target.apiUrl));
283
+ application.deployTargets.some((target) => Boolean(target.serviceId));
275
284
 
276
285
  if (hasBrowserSurface) scopes.add('browser');
277
286
  if (hasApiSurface) scopes.add('api');
@@ -415,7 +424,9 @@ function evaluateRequirement(
415
424
  evidence,
416
425
  );
417
426
  case 'cloudflare-deployment-contract': {
418
- if (application.deployTargets.length === 0) {
427
+ // `< 1` rather than `=== 0`: every catalogued app now has >=1 deploy target,
428
+ // so the generated tuple-length union excludes 0 and `=== 0` fails typecheck.
429
+ if (application.deployTargets.length < 1) {
419
430
  return finding(requirement, 'missing', 'No CloudControl deploy targets are registered.', evidence);
420
431
  }
421
432
  evidence.push(`deployTargets=${application.deployTargets.length}`);