@spacefast/common 0.0.13 → 0.0.17

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 (154) hide show
  1. package/dist/agents/client-registry.d.ts +22 -0
  2. package/dist/agents/client-registry.js +41 -0
  3. package/dist/agents/connect-targets.d.ts +51 -6
  4. package/dist/agents/connect-targets.js +93 -28
  5. package/dist/brand.d.ts +0 -11
  6. package/dist/brand.js +0 -20
  7. package/dist/config/domains.d.ts +15 -6
  8. package/dist/config/domains.js +24 -10
  9. package/dist/config/postgres-budget.d.ts +3 -0
  10. package/dist/config/postgres-budget.js +6 -1
  11. package/dist/config/postgres-budget.json +2 -1
  12. package/dist/contracts/abuse.js +1 -1
  13. package/dist/contracts/access.d.ts +149 -44
  14. package/dist/contracts/access.js +94 -8
  15. package/dist/contracts/activity.js +5 -1
  16. package/dist/contracts/api-keys.js +9 -9
  17. package/dist/contracts/archives.js +11 -11
  18. package/dist/contracts/beta.js +1 -1
  19. package/dist/contracts/builds.js +14 -14
  20. package/dist/contracts/channels.js +2 -2
  21. package/dist/contracts/comments.d.ts +86 -15
  22. package/dist/contracts/comments.js +116 -20
  23. package/dist/contracts/common.d.ts +12 -12
  24. package/dist/contracts/common.js +33 -30
  25. package/dist/contracts/continuation.js +5 -5
  26. package/dist/contracts/data-source-routes.js +1 -1
  27. package/dist/contracts/device-auth.d.ts +6 -6
  28. package/dist/contracts/device-auth.js +12 -12
  29. package/dist/contracts/docs.d.ts +10 -10
  30. package/dist/contracts/domains.js +39 -33
  31. package/dist/contracts/enums.d.ts +2 -10
  32. package/dist/contracts/enums.js +0 -2
  33. package/dist/contracts/error-code-meta.d.ts +116 -47
  34. package/dist/contracts/error-code-meta.js +37 -16
  35. package/dist/contracts/error-codes.d.ts +7 -4
  36. package/dist/contracts/error-codes.js +46 -21
  37. package/dist/contracts/events.d.ts +10 -3
  38. package/dist/contracts/events.js +33 -5
  39. package/dist/contracts/execution.d.ts +26 -0
  40. package/dist/contracts/execution.js +21 -0
  41. package/dist/contracts/feature-lifecycle.d.ts +21 -24
  42. package/dist/contracts/feature-lifecycle.js +28 -26
  43. package/dist/contracts/features.js +4 -4
  44. package/dist/contracts/functions.d.ts +8 -140
  45. package/dist/contracts/functions.js +9 -19
  46. package/dist/contracts/git.d.ts +1 -1
  47. package/dist/contracts/grants.d.ts +96 -79
  48. package/dist/contracts/grants.js +130 -43
  49. package/dist/contracts/ids.d.ts +2 -2
  50. package/dist/contracts/ids.js +2 -4
  51. package/dist/contracts/internal.js +2 -2
  52. package/dist/contracts/mcp.d.ts +17 -556
  53. package/dist/contracts/mcp.js +9 -103
  54. package/dist/contracts/me.js +3 -4
  55. package/dist/contracts/notifications.d.ts +108 -0
  56. package/dist/contracts/notifications.js +54 -0
  57. package/dist/contracts/oauth-resources.d.ts +18 -1
  58. package/dist/contracts/oauth-resources.js +22 -2
  59. package/dist/contracts/operations.d.ts +2 -50
  60. package/dist/contracts/operations.js +0 -19
  61. package/dist/contracts/pages.d.ts +8 -4
  62. package/dist/contracts/pages.js +16 -3
  63. package/dist/contracts/platform.js +10 -8
  64. package/dist/contracts/problem-document.d.ts +14 -0
  65. package/dist/contracts/problem-document.js +35 -0
  66. package/dist/contracts/push-new.d.ts +21 -6
  67. package/dist/contracts/push-new.js +3 -7
  68. package/dist/contracts/resources.d.ts +8 -7
  69. package/dist/contracts/resources.js +9 -6
  70. package/dist/contracts/runtime-api.d.ts +162 -92
  71. package/dist/contracts/runtime-api.js +99 -27
  72. package/dist/contracts/runtime-app.d.ts +41 -11
  73. package/dist/contracts/runtime-app.js +22 -1
  74. package/dist/contracts/runtime-db.d.ts +424 -0
  75. package/dist/contracts/runtime-db.js +108 -0
  76. package/dist/contracts/runtime-storage.d.ts +120 -0
  77. package/dist/contracts/runtime-storage.js +40 -0
  78. package/dist/contracts/sf-config-v1.d.ts +49 -1
  79. package/dist/contracts/sf-config-v1.js +2 -2
  80. package/dist/contracts/sites.d.ts +1 -0
  81. package/dist/contracts/sites.js +20 -12
  82. package/dist/contracts/space-config.d.ts +62 -22
  83. package/dist/contracts/space-config.js +173 -47
  84. package/dist/contracts/spaces.d.ts +79 -45
  85. package/dist/contracts/spaces.js +66 -50
  86. package/dist/contracts/superadmin-spaces.d.ts +13 -2
  87. package/dist/contracts/superadmin-spaces.js +15 -0
  88. package/dist/contracts/superadmin-tenants.js +4 -4
  89. package/dist/contracts/superadmin.d.ts +4 -0
  90. package/dist/contracts/superadmin.js +14 -1
  91. package/dist/contracts/tags.d.ts +17 -17
  92. package/dist/contracts/tags.js +1 -1
  93. package/dist/contracts/teams.js +25 -16
  94. package/dist/contracts/theme-json.js +1 -1
  95. package/dist/contracts/transfers.js +4 -4
  96. package/dist/contracts/variables.js +3 -3
  97. package/dist/contracts/zero.d.ts +204 -338
  98. package/dist/contracts/zero.js +94 -98
  99. package/dist/dashboard-paths/index.d.ts +16 -1
  100. package/dist/dashboard-paths/index.js +18 -0
  101. package/dist/docs/agent-handoff-document.d.ts +2 -2
  102. package/dist/docs/agent-handoff-document.js +8 -7
  103. package/dist/docs/agent-prose.d.ts +22 -3
  104. package/dist/docs/agent-prose.js +221 -51
  105. package/dist/docs/agent-setup.d.ts +13 -10
  106. package/dist/docs/agent-setup.js +279 -53
  107. package/dist/docs/agent-solutions.d.ts +6 -6
  108. package/dist/docs/agent-solutions.js +23 -21
  109. package/dist/docs/catalog.d.ts +29 -74
  110. package/dist/docs/catalog.js +65 -92
  111. package/dist/docs/error-docs.js +293 -221
  112. package/dist/docs/skill-distribution.d.ts +2 -0
  113. package/dist/docs/skill-distribution.js +7 -4
  114. package/dist/docs/skills.d.ts +546 -0
  115. package/dist/docs/skills.js +340 -0
  116. package/dist/utils/browser-credential.d.ts +19 -0
  117. package/dist/utils/browser-credential.js +62 -0
  118. package/dist/utils/comment-avatars.d.ts +7 -0
  119. package/dist/utils/comment-avatars.js +42 -0
  120. package/dist/utils/content-type.d.ts +3 -3
  121. package/dist/utils/content-type.js +38 -61
  122. package/dist/utils/domain-diagnostics.d.ts +5 -5
  123. package/dist/utils/domain-diagnostics.js +21 -10
  124. package/dist/utils/local-space-state.d.ts +78 -4
  125. package/dist/utils/local-space-state.js +383 -82
  126. package/dist/utils/one-shot-replay.d.ts +14 -0
  127. package/dist/utils/one-shot-replay.js +21 -0
  128. package/dist/utils/page-preview.d.ts +7 -0
  129. package/dist/utils/page-preview.js +9 -0
  130. package/dist/utils/pages.d.ts +2 -11
  131. package/dist/utils/pages.js +58 -14
  132. package/dist/utils/publish-form-data.d.ts +22 -0
  133. package/dist/utils/publish-form-data.js +26 -0
  134. package/dist/utils/publish-policy.js +20 -4
  135. package/dist/utils/query-keys.d.ts +7 -4
  136. package/dist/utils/query-keys.js +13 -4
  137. package/dist/utils/runtime-paths.d.ts +3 -0
  138. package/dist/utils/runtime-paths.js +7 -0
  139. package/dist/utils/secure-local-file.d.ts +73 -0
  140. package/dist/utils/secure-local-file.js +1373 -0
  141. package/dist/utils/space-config.d.ts +13 -4
  142. package/dist/utils/space-config.js +123 -15
  143. package/dist/utils/storage-policy.d.ts +20 -0
  144. package/dist/utils/storage-policy.fixtures.json +174 -0
  145. package/dist/utils/storage-policy.js +193 -0
  146. package/dist/utils/upload-session.d.ts +12 -1
  147. package/dist/utils/upload-session.js +37 -2
  148. package/dist/utils/version-file-browser.d.ts +13 -0
  149. package/dist/utils/version-file-browser.js +59 -0
  150. package/package.json +19 -1
  151. package/dist/contracts/mounts.d.ts +0 -142
  152. package/dist/contracts/mounts.js +0 -56
  153. package/dist/utils/asset-fingerprint.d.ts +0 -64
  154. package/dist/utils/asset-fingerprint.js +0 -620
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { executionInspectPolicySchema, runtimeKindSchema, type ExecutionCapabilities } from "./execution.js";
2
+ import { runtimeKindSchema, type ExecutionCapabilities } from "./execution.js";
3
3
  /**
4
4
  * Spacefast Functions: tenant workers run as Cloudflare Dynamic Workers.
5
5
  *
@@ -41,8 +41,6 @@ export declare const FUNCTIONS_RUNTIME_KIND = "functions";
41
41
  export declare const FUNCTIONS_SOURCE_METADATA_KEY = "spacefastFunctions";
42
42
  export declare const FUNCTIONS_PLATFORM_ROUTE_PREFIX = "/__spacefast/functions";
43
43
  export declare const FUNCTIONS_RUNTIME_ROUTE_PATHS: {
44
- readonly config: "/__spacefast/functions/config";
45
- readonly inspect: "/__spacefast/functions/inspect";
46
44
  readonly logs: "/__spacefast/functions/logs";
47
45
  /** Where a dispatched worker calls back for brokered capabilities. */
48
46
  readonly relay: "/__spacefast/functions/relay";
@@ -103,29 +101,6 @@ export declare const functionsRouteSchema: z.ZodObject<{
103
101
  subtree: z.ZodDefault<z.ZodBoolean>;
104
102
  }, z.core.$strict>;
105
103
  export type FunctionsRoute = z.infer<typeof functionsRouteSchema>;
106
- export declare const functionsEndpointSourceSchema: z.ZodObject<{
107
- method: z.ZodEnum<{
108
- POST: "POST";
109
- PUT: "PUT";
110
- GET: "GET";
111
- HEAD: "HEAD";
112
- PATCH: "PATCH";
113
- DELETE: "DELETE";
114
- OPTIONS: "OPTIONS";
115
- }>;
116
- path: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
117
- endpointId: z.ZodString;
118
- source: z.ZodString;
119
- capabilities: z.ZodDefault<z.ZodObject<{
120
- db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
121
- fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
122
- auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
123
- env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
124
- realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
125
- logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
126
- }, z.core.$strip>>;
127
- }, z.core.$strict>;
128
- export type FunctionsEndpointSource = z.infer<typeof functionsEndpointSourceSchema>;
129
104
  /**
130
105
  * One module in a bundle, in the shape the Worker Loader consumes.
131
106
  *
@@ -192,7 +167,7 @@ export type FunctionsBundleRef = z.infer<typeof functionsBundleRefSchema>;
192
167
  *
193
168
  * Both halves are load-bearing. The digest alone is unguessable to anyone who
194
169
  * lacks the bytes, but it is derivable by anyone who *has* them, and it shows up
195
- * in build output and `sf functions inspect`. The token adds the dimension the
170
+ * in build output and `sf runtime status`. The token adds the dimension the
196
171
  * digest cannot: holding the code does not entitle you to fetch it from us, and
197
172
  * rotating the site secret invalidates every URL at once.
198
173
  */
@@ -241,28 +216,6 @@ export declare const functionsWorkerArtifactSchema: z.ZodObject<{
241
216
  realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
242
217
  logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
243
218
  }, z.core.$strip>>;
244
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
245
- method: z.ZodEnum<{
246
- POST: "POST";
247
- PUT: "PUT";
248
- GET: "GET";
249
- HEAD: "HEAD";
250
- PATCH: "PATCH";
251
- DELETE: "DELETE";
252
- OPTIONS: "OPTIONS";
253
- }>;
254
- path: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
255
- endpointId: z.ZodString;
256
- source: z.ZodString;
257
- capabilities: z.ZodDefault<z.ZodObject<{
258
- db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
259
- fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
260
- auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
261
- env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
262
- realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
263
- logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
264
- }, z.core.$strip>>;
265
- }, z.core.$strict>>>;
266
219
  }, z.core.$strict>;
267
220
  export type FunctionsWorkerArtifact = z.infer<typeof functionsWorkerArtifactSchema>;
268
221
  /**
@@ -379,39 +332,11 @@ export declare const functionsSourceFinalizeSchema: z.ZodObject<{
379
332
  realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
380
333
  logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
381
334
  }, z.core.$strip>>;
382
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
383
- method: z.ZodEnum<{
384
- POST: "POST";
385
- PUT: "PUT";
386
- GET: "GET";
387
- HEAD: "HEAD";
388
- PATCH: "PATCH";
389
- DELETE: "DELETE";
390
- OPTIONS: "OPTIONS";
391
- }>;
392
- path: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
393
- endpointId: z.ZodString;
394
- source: z.ZodString;
395
- capabilities: z.ZodDefault<z.ZodObject<{
396
- db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
397
- fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
398
- auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
399
- env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
400
- realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
401
- logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
402
- }, z.core.$strip>>;
403
- }, z.core.$strict>>>;
404
335
  }, z.core.$strict>;
405
336
  variables: z.ZodDefault<z.ZodObject<{
406
337
  source: z.ZodLiteral<"spacefast-variables">;
407
338
  names: z.ZodDefault<z.ZodArray<z.ZodString>>;
408
339
  }, z.core.$strict>>;
409
- inspect: z.ZodDefault<z.ZodObject<{
410
- policy: z.ZodDefault<z.ZodEnum<{
411
- public: "public";
412
- private: "private";
413
- }>>;
414
- }, z.core.$strict>>;
415
340
  }, z.core.$strict>;
416
341
  export type FunctionsSourceFinalize = z.infer<typeof functionsSourceFinalizeSchema>;
417
342
  /**
@@ -457,39 +382,11 @@ export declare const functionsRuntimeConfigSchema: z.ZodObject<{
457
382
  realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
458
383
  logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
459
384
  }, z.core.$strip>>;
460
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
461
- method: z.ZodEnum<{
462
- POST: "POST";
463
- PUT: "PUT";
464
- GET: "GET";
465
- HEAD: "HEAD";
466
- PATCH: "PATCH";
467
- DELETE: "DELETE";
468
- OPTIONS: "OPTIONS";
469
- }>;
470
- path: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
471
- endpointId: z.ZodString;
472
- source: z.ZodString;
473
- capabilities: z.ZodDefault<z.ZodObject<{
474
- db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
475
- fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
476
- auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
477
- env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
478
- realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
479
- logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
480
- }, z.core.$strip>>;
481
- }, z.core.$strict>>>;
482
385
  }, z.core.$strict>;
483
386
  variables: z.ZodDefault<z.ZodObject<{
484
387
  source: z.ZodLiteral<"spacefast-variables">;
485
388
  names: z.ZodDefault<z.ZodArray<z.ZodString>>;
486
389
  }, z.core.$strict>>;
487
- inspect: z.ZodDefault<z.ZodObject<{
488
- policy: z.ZodDefault<z.ZodEnum<{
489
- public: "public";
490
- private: "private";
491
- }>>;
492
- }, z.core.$strict>>;
493
390
  host: z.ZodObject<{
494
391
  hostname: z.ZodString;
495
392
  bundleUrl: z.ZodString;
@@ -546,39 +443,11 @@ export declare const functionsDeployMetadataSchema: z.ZodObject<{
546
443
  realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
547
444
  logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
548
445
  }, z.core.$strip>>;
549
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
550
- method: z.ZodEnum<{
551
- POST: "POST";
552
- PUT: "PUT";
553
- GET: "GET";
554
- HEAD: "HEAD";
555
- PATCH: "PATCH";
556
- DELETE: "DELETE";
557
- OPTIONS: "OPTIONS";
558
- }>;
559
- path: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
560
- endpointId: z.ZodString;
561
- source: z.ZodString;
562
- capabilities: z.ZodDefault<z.ZodObject<{
563
- db: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
564
- fetch: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
565
- auth: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
566
- env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
567
- realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
568
- logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
569
- }, z.core.$strip>>;
570
- }, z.core.$strict>>>;
571
446
  }, z.core.$strict>;
572
447
  variables: z.ZodDefault<z.ZodObject<{
573
448
  source: z.ZodLiteral<"spacefast-variables">;
574
449
  names: z.ZodDefault<z.ZodArray<z.ZodString>>;
575
450
  }, z.core.$strict>>;
576
- inspect: z.ZodDefault<z.ZodObject<{
577
- policy: z.ZodDefault<z.ZodEnum<{
578
- public: "public";
579
- private: "private";
580
- }>>;
581
- }, z.core.$strict>>;
582
451
  }, z.core.$strict>;
583
452
  }, z.core.$strict>;
584
453
  export type FunctionsDeployMetadata = z.infer<typeof functionsDeployMetadataSchema>;
@@ -599,7 +468,6 @@ export declare function createFunctionsSourceFinalize(input: {
599
468
  routes?: z.input<typeof functionsRouteSchema>[];
600
469
  capabilities?: ExecutionCapabilities;
601
470
  variableNames?: string[];
602
- inspectPolicy?: z.input<typeof executionInspectPolicySchema>;
603
471
  }): FunctionsSourceFinalize;
604
472
  /**
605
473
  * What a version's worker is currently doing, as an observer of the space can
@@ -623,6 +491,11 @@ export type FunctionsExecutionState = z.infer<typeof functionsExecutionStateSche
623
491
  * reader switches on one field rather than probing for which product answered.
624
492
  * No `versionId`: the status response it rides in already names the live
625
493
  * version.
494
+ *
495
+ * Everything but `executionState` is a field of the version's own finalize
496
+ * metadata, so this answers whether or not the origin is reachable. There is no
497
+ * `database` field: `capabilities.db` is the fact the whole `/db` family
498
+ * branches on, and stating it twice invites the two to disagree.
626
499
  */
627
500
  export declare const functionsAppSchema: z.ZodObject<{
628
501
  runtimeKind: z.ZodLiteral<"functions">;
@@ -658,16 +531,11 @@ export declare const functionsAppSchema: z.ZodObject<{
658
531
  serving: "serving";
659
532
  }>;
660
533
  bundleSize: z.ZodNumber;
534
+ bundleSha256: z.ZodString;
661
535
  variables: z.ZodObject<{
662
536
  source: z.ZodLiteral<"spacefast-variables">;
663
537
  names: z.ZodDefault<z.ZodArray<z.ZodString>>;
664
538
  }, z.core.$strict>;
665
- inspect: z.ZodObject<{
666
- policy: z.ZodEnum<{
667
- public: "public";
668
- private: "private";
669
- }>;
670
- }, z.core.$strict>;
671
539
  }, z.core.$strict>;
672
540
  export type FunctionsApp = z.infer<typeof functionsAppSchema>;
673
541
  /**
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { appRoutePathSchema, executionCapabilitiesSchema, executionEndpointSourceSchema, executionInspectPolicySchema, executionLogEntrySchema, executionLogListQuerySchema, executionLogListResponseSchema, executionSha256Schema, httpMethodSchema, runtimeKindSchema, } from "./execution.js";
2
+ import { appRoutePathSchema, executionCapabilitiesSchema, executionLogEntrySchema, executionLogListQuerySchema, executionLogListResponseSchema, executionSha256Schema, httpMethodSchema, runtimeKindSchema, } from "./execution.js";
3
3
  /**
4
4
  * Spacefast Functions: tenant workers run as Cloudflare Dynamic Workers.
5
5
  *
@@ -41,8 +41,6 @@ export const FUNCTIONS_RUNTIME_KIND = "functions";
41
41
  export const FUNCTIONS_SOURCE_METADATA_KEY = "spacefastFunctions";
42
42
  export const FUNCTIONS_PLATFORM_ROUTE_PREFIX = "/__spacefast/functions";
43
43
  export const FUNCTIONS_RUNTIME_ROUTE_PATHS = {
44
- config: `${FUNCTIONS_PLATFORM_ROUTE_PREFIX}/config`,
45
- inspect: `${FUNCTIONS_PLATFORM_ROUTE_PREFIX}/inspect`,
46
44
  logs: `${FUNCTIONS_PLATFORM_ROUTE_PREFIX}/logs`,
47
45
  /** Where a dispatched worker calls back for brokered capabilities. */
48
46
  relay: `${FUNCTIONS_PLATFORM_ROUTE_PREFIX}/relay`,
@@ -100,7 +98,6 @@ export const functionsRouteSchema = z
100
98
  subtree: z.boolean().default(false),
101
99
  })
102
100
  .strict();
103
- export const functionsEndpointSourceSchema = executionEndpointSourceSchema(functionsRoutePathSchema);
104
101
  /**
105
102
  * One module in a bundle, in the shape the Worker Loader consumes.
106
103
  *
@@ -167,7 +164,7 @@ export const functionsBundleRefSchema = z
167
164
  *
168
165
  * Both halves are load-bearing. The digest alone is unguessable to anyone who
169
166
  * lacks the bytes, but it is derivable by anyone who *has* them, and it shows up
170
- * in build output and `sf functions inspect`. The token adds the dimension the
167
+ * in build output and `sf runtime status`. The token adds the dimension the
171
168
  * digest cannot: holding the code does not entitle you to fetch it from us, and
172
169
  * rotating the site secret invalidates every URL at once.
173
170
  */
@@ -224,7 +221,6 @@ export const functionsWorkerArtifactSchema = z
224
221
  * so an injected dependency cannot widen authority at runtime.
225
222
  */
226
223
  capabilities: executionCapabilitiesSchema,
227
- endpoints: z.array(functionsEndpointSourceSchema).max(256).default([]),
228
224
  })
229
225
  .strict();
230
226
  /**
@@ -347,12 +343,6 @@ export const functionsSourceFinalizeSchema = z
347
343
  })
348
344
  .strict()
349
345
  .default({ source: "spacefast-variables", names: [] }),
350
- inspect: z
351
- .object({
352
- policy: executionInspectPolicySchema.default("private"),
353
- })
354
- .strict()
355
- .default({ policy: "private" }),
356
346
  })
357
347
  .strict();
358
348
  /**
@@ -406,13 +396,11 @@ export function createFunctionsSourceFinalize(input) {
406
396
  compatibilityFlags: input.compatibilityFlags ?? [],
407
397
  routes: input.routes ?? [],
408
398
  capabilities: input.capabilities ?? {},
409
- endpoints: [],
410
399
  },
411
400
  variables: {
412
401
  source: "spacefast-variables",
413
402
  names: input.variableNames ?? [],
414
403
  },
415
- ...(input.inspectPolicy ? { inspect: { policy: input.inspectPolicy } } : {}),
416
404
  });
417
405
  }
418
406
  /**
@@ -439,6 +427,11 @@ export const functionsExecutionStateSchema = z.enum([
439
427
  * reader switches on one field rather than probing for which product answered.
440
428
  * No `versionId`: the status response it rides in already names the live
441
429
  * version.
430
+ *
431
+ * Everything but `executionState` is a field of the version's own finalize
432
+ * metadata, so this answers whether or not the origin is reachable. There is no
433
+ * `database` field: `capabilities.db` is the fact the whole `/db` family
434
+ * branches on, and stating it twice invites the two to disagree.
442
435
  */
443
436
  export const functionsAppSchema = z
444
437
  .object({
@@ -452,17 +445,14 @@ export const functionsAppSchema = z
452
445
  capabilities: executionCapabilitiesSchema,
453
446
  executionState: functionsExecutionStateSchema,
454
447
  bundleSize: z.number().int().nonnegative(),
448
+ /** Digest of the bundle bytes; also this app's `artifactId` by default. */
449
+ bundleSha256: executionSha256Schema,
455
450
  variables: z
456
451
  .object({
457
452
  source: z.literal("spacefast-variables"),
458
453
  names: z.array(z.string()).default([]),
459
454
  })
460
455
  .strict(),
461
- inspect: z
462
- .object({
463
- policy: executionInspectPolicySchema,
464
- })
465
- .strict(),
466
456
  })
467
457
  .strict();
468
458
  /**
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
  export declare const buildTargetValues: readonly ["production", "preview"];
3
3
  export declare const buildTriggerValues: readonly ["manual", "push", "pull_request", "retry"];
4
4
  export declare const buildTarget: z.ZodEnum<{
5
- preview: "preview";
6
5
  production: "production";
6
+ preview: "preview";
7
7
  }>;
8
8
  export declare const buildTrigger: z.ZodEnum<{
9
9
  push: "push";