@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/README.md +19 -4
- package/dist/index.cjs +482 -221
- package/dist/index.d.cts +466 -271
- package/dist/index.d.ts +466 -271
- package/dist/index.js +482 -221
- package/package.json +1 -1
- package/src/application-requirements.ts +16 -5
- package/src/applications.generated.ts +349 -171
- package/src/client.test.ts +170 -11
- package/src/client.ts +165 -64
- package/src/modules/p2p.test.ts +25 -2
- package/src/services.generated.ts +4 -2
- package/src/services.test.ts +11 -5
package/package.json
CHANGED
|
@@ -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
|
|
155
|
-
'
|
|
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) ||
|
|
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.
|
|
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
|
-
|
|
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}`);
|