@spacefast/common 0.0.24 → 0.2.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.
Files changed (320) hide show
  1. package/brand-assets/LICENSE-Haskoy.txt +93 -0
  2. package/brand-assets/haskoy-latin-variable.woff2 +0 -0
  3. package/brand-assets/spacefast-favicon.svg +4 -4
  4. package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
  5. package/brand-assets/spacefast-wordmark.svg +2 -4
  6. package/dist/agents/connect-targets.d.ts +6 -146
  7. package/dist/agents/connect-targets.js +63 -295
  8. package/dist/agents/private-key-oauth.d.ts +31 -2
  9. package/dist/agents/private-key-oauth.js +166 -92
  10. package/dist/agents/registry/core.d.ts +292 -0
  11. package/dist/agents/registry/core.js +1388 -0
  12. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  13. package/dist/agents/registry/deeplink-probes.js +18 -0
  14. package/dist/agents/registry/node.d.ts +56 -0
  15. package/dist/agents/registry/node.js +339 -0
  16. package/dist/brand-assets-build.js +3 -6
  17. package/dist/brand-assets.d.ts +5 -15
  18. package/dist/brand-assets.js +12 -14
  19. package/dist/brand.d.ts +17 -0
  20. package/dist/brand.js +24 -4
  21. package/dist/config/domains.d.ts +79 -12
  22. package/dist/config/domains.js +128 -29
  23. package/dist/config/index.js +1 -2
  24. package/dist/contracts/abuse.js +9 -24
  25. package/dist/contracts/access-profiles.d.ts +86 -0
  26. package/dist/contracts/access-profiles.js +89 -0
  27. package/dist/contracts/access.d.ts +24 -30
  28. package/dist/contracts/access.js +33 -64
  29. package/dist/contracts/activity.d.ts +18 -1
  30. package/dist/contracts/activity.js +72 -26
  31. package/dist/contracts/analytics.js +8 -10
  32. package/dist/contracts/api-keys.d.ts +77 -52
  33. package/dist/contracts/api-keys.js +44 -24
  34. package/dist/contracts/application-journal.d.ts +216 -0
  35. package/dist/contracts/application-journal.js +167 -0
  36. package/dist/contracts/auth.d.ts +90 -17
  37. package/dist/contracts/auth.js +86 -17
  38. package/dist/contracts/beta.d.ts +9 -4
  39. package/dist/contracts/beta.js +20 -16
  40. package/dist/contracts/billing.d.ts +2 -1
  41. package/dist/contracts/billing.js +37 -11
  42. package/dist/contracts/bootstrap.d.ts +791 -0
  43. package/dist/contracts/bootstrap.js +51 -0
  44. package/dist/contracts/builds.d.ts +209 -18
  45. package/dist/contracts/builds.js +93 -27
  46. package/dist/contracts/channels.d.ts +43 -0
  47. package/dist/contracts/channels.js +25 -9
  48. package/dist/contracts/cli.d.ts +7 -0
  49. package/dist/contracts/cli.js +6 -0
  50. package/dist/contracts/collab-public.d.ts +1 -1
  51. package/dist/contracts/collab-public.js +5 -8
  52. package/dist/contracts/comments.d.ts +44 -34
  53. package/dist/contracts/comments.js +107 -77
  54. package/dist/contracts/commerce.d.ts +165 -0
  55. package/dist/contracts/commerce.js +146 -0
  56. package/dist/contracts/common.d.ts +3 -3
  57. package/dist/contracts/common.js +20 -31
  58. package/dist/contracts/content-contract-verification.d.ts +521 -0
  59. package/dist/contracts/content-contract-verification.js +320 -0
  60. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  61. package/dist/contracts/content-platform-fixture.js +44 -0
  62. package/dist/contracts/content-program.d.ts +994 -0
  63. package/dist/contracts/content-program.js +658 -0
  64. package/dist/contracts/content-sync.d.ts +290 -0
  65. package/dist/contracts/content-sync.js +167 -0
  66. package/dist/contracts/content.d.ts +432 -0
  67. package/dist/contracts/content.js +303 -0
  68. package/dist/contracts/continuation.d.ts +17 -1
  69. package/dist/contracts/continuation.js +23 -23
  70. package/dist/contracts/countries.js +3 -4
  71. package/dist/contracts/crons.d.ts +52 -0
  72. package/dist/contracts/crons.js +60 -0
  73. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  74. package/dist/contracts/dashboard-prefs.js +51 -0
  75. package/dist/contracts/device-auth.d.ts +234 -37
  76. package/dist/contracts/device-auth.js +267 -53
  77. package/dist/contracts/docs.d.ts +1 -5
  78. package/dist/contracts/docs.js +7 -15
  79. package/dist/contracts/domains.d.ts +501 -93
  80. package/dist/contracts/domains.js +193 -55
  81. package/dist/contracts/email-preferences.d.ts +3 -3
  82. package/dist/contracts/email-preferences.js +6 -7
  83. package/dist/contracts/enums.d.ts +27 -26
  84. package/dist/contracts/enums.js +68 -61
  85. package/dist/contracts/error-code-meta.d.ts +283 -7
  86. package/dist/contracts/error-code-meta.js +97 -5
  87. package/dist/contracts/error-codes.d.ts +5 -5
  88. package/dist/contracts/error-codes.js +82 -17
  89. package/dist/contracts/events.d.ts +100 -20
  90. package/dist/contracts/events.js +107 -20
  91. package/dist/contracts/execution.d.ts +48 -64
  92. package/dist/contracts/execution.js +52 -62
  93. package/dist/contracts/feature-lifecycle.d.ts +73 -27
  94. package/dist/contracts/feature-lifecycle.js +86 -26
  95. package/dist/contracts/features.d.ts +68 -19
  96. package/dist/contracts/features.js +42 -41
  97. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  98. package/dist/contracts/frame-session.d.ts +192 -0
  99. package/dist/contracts/frame-session.js +164 -0
  100. package/dist/contracts/functions.d.ts +338 -164
  101. package/dist/contracts/functions.js +367 -198
  102. package/dist/contracts/git.d.ts +27 -33
  103. package/dist/contracts/git.js +10 -11
  104. package/dist/contracts/grant-copy.d.ts +43 -0
  105. package/dist/contracts/grant-copy.js +44 -0
  106. package/dist/contracts/grants.d.ts +62 -54
  107. package/dist/contracts/grants.js +124 -23
  108. package/dist/contracts/ids.d.ts +4 -1
  109. package/dist/contracts/ids.js +6 -3
  110. package/dist/contracts/internal.d.ts +8 -18
  111. package/dist/contracts/internal.js +13 -14
  112. package/dist/contracts/mcp.d.ts +28 -0
  113. package/dist/contracts/mcp.js +28 -0
  114. package/dist/contracts/me.d.ts +6 -1
  115. package/dist/contracts/me.js +12 -6
  116. package/dist/contracts/notifications.d.ts +27 -29
  117. package/dist/contracts/notifications.js +9 -4
  118. package/dist/contracts/oauth-resources.d.ts +112 -10
  119. package/dist/contracts/oauth-resources.js +116 -11
  120. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  121. package/dist/contracts/oauth-scope-actions.js +126 -0
  122. package/dist/contracts/operations.d.ts +27 -4
  123. package/dist/contracts/operations.js +12 -6
  124. package/dist/contracts/pages.d.ts +31 -7
  125. package/dist/contracts/pages.js +22 -5
  126. package/dist/contracts/partner-notifications.d.ts +3 -0
  127. package/dist/contracts/partner-notifications.js +65 -0
  128. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  129. package/dist/contracts/{platform.js → partner.js} +27 -40
  130. package/dist/contracts/plan-policy.js +1 -1
  131. package/dist/contracts/principal-assertion.d.ts +43 -0
  132. package/dist/contracts/principal-assertion.js +67 -0
  133. package/dist/contracts/principals.d.ts +73 -0
  134. package/dist/contracts/principals.js +59 -0
  135. package/dist/contracts/privacy.d.ts +11 -0
  136. package/dist/contracts/privacy.js +17 -0
  137. package/dist/contracts/problem-document.js +3 -4
  138. package/dist/contracts/publish-archive.d.ts +269 -161
  139. package/dist/contracts/publish-archive.js +11 -1
  140. package/dist/contracts/push-new.d.ts +8 -8
  141. package/dist/contracts/quotas.js +5 -5
  142. package/dist/contracts/realtime.d.ts +52 -0
  143. package/dist/contracts/realtime.js +54 -0
  144. package/dist/contracts/repository-connections.d.ts +44 -31
  145. package/dist/contracts/repository-connections.js +17 -5
  146. package/dist/contracts/resources.d.ts +105 -14
  147. package/dist/contracts/resources.js +150 -26
  148. package/dist/contracts/route-inventory.d.ts +358 -0
  149. package/dist/contracts/route-inventory.js +141 -0
  150. package/dist/contracts/runtime-api.d.ts +206 -82
  151. package/dist/contracts/runtime-api.js +131 -70
  152. package/dist/contracts/runtime-app.d.ts +13 -23
  153. package/dist/contracts/runtime-app.js +39 -24
  154. package/dist/contracts/runtime-components.d.ts +143 -0
  155. package/dist/contracts/runtime-components.js +199 -0
  156. package/dist/contracts/runtime-db.d.ts +49 -23
  157. package/dist/contracts/runtime-db.js +87 -22
  158. package/dist/contracts/runtime-purge.d.ts +8 -0
  159. package/dist/contracts/runtime-purge.js +5 -0
  160. package/dist/contracts/runtime-services.d.ts +43 -75
  161. package/dist/contracts/runtime-services.js +29 -49
  162. package/dist/contracts/runtime-storage.d.ts +15 -14
  163. package/dist/contracts/runtime-storage.js +30 -14
  164. package/dist/contracts/sf-config-v1.d.ts +48 -14
  165. package/dist/contracts/slugs.js +13 -4
  166. package/dist/contracts/space-config.d.ts +283 -19
  167. package/dist/contracts/space-config.js +430 -80
  168. package/dist/contracts/spaces.d.ts +376 -290
  169. package/dist/contracts/spaces.js +200 -135
  170. package/dist/contracts/superadmin-activity.d.ts +3 -43
  171. package/dist/contracts/superadmin-activity.js +6 -30
  172. package/dist/contracts/superadmin-emails.d.ts +1 -0
  173. package/dist/contracts/superadmin-emails.js +17 -1
  174. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  175. package/dist/contracts/superadmin-runtime.js +141 -0
  176. package/dist/contracts/superadmin-search.d.ts +22 -2
  177. package/dist/contracts/superadmin-search.js +14 -6
  178. package/dist/contracts/superadmin-spaces.d.ts +438 -189
  179. package/dist/contracts/superadmin-spaces.js +131 -25
  180. package/dist/contracts/superadmin-teams.d.ts +5 -2
  181. package/dist/contracts/superadmin-teams.js +1 -2
  182. package/dist/contracts/superadmin-tenants.d.ts +627 -12
  183. package/dist/contracts/superadmin-tenants.js +32 -13
  184. package/dist/contracts/superadmin.d.ts +232 -37
  185. package/dist/contracts/superadmin.js +106 -22
  186. package/dist/contracts/tags.d.ts +85 -58
  187. package/dist/contracts/tags.js +47 -37
  188. package/dist/contracts/teams.d.ts +86 -26
  189. package/dist/contracts/teams.js +90 -31
  190. package/dist/contracts/tenants.d.ts +135 -0
  191. package/dist/contracts/tenants.js +120 -0
  192. package/dist/contracts/test-triggers.d.ts +70 -0
  193. package/dist/contracts/test-triggers.js +116 -0
  194. package/dist/contracts/theme-json.js +3 -8
  195. package/dist/contracts/transfers.d.ts +1 -0
  196. package/dist/contracts/transfers.js +3 -2
  197. package/dist/contracts/usage.d.ts +209 -0
  198. package/dist/contracts/usage.js +124 -12
  199. package/dist/contracts/variables.d.ts +2 -2
  200. package/dist/contracts/variables.js +9 -13
  201. package/dist/contracts/webhooks.d.ts +13 -5
  202. package/dist/contracts/webhooks.js +3 -1
  203. package/dist/contracts/zero.d.ts +72 -81
  204. package/dist/contracts/zero.js +80 -78
  205. package/dist/dashboard-paths/index.d.ts +24 -21
  206. package/dist/dashboard-paths/index.js +35 -47
  207. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  208. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  209. package/dist/docs/agent-arrival.d.ts +92 -0
  210. package/dist/docs/agent-arrival.js +227 -0
  211. package/dist/docs/agent-output-policy.d.ts +6 -0
  212. package/dist/docs/agent-output-policy.js +22 -0
  213. package/dist/docs/agent-prose.d.ts +12 -18
  214. package/dist/docs/agent-prose.js +73 -51
  215. package/dist/docs/agent-setup.d.ts +72 -41
  216. package/dist/docs/agent-setup.js +339 -436
  217. package/dist/docs/catalog.d.ts +153 -95
  218. package/dist/docs/catalog.js +163 -48
  219. package/dist/docs/error-docs.d.ts +2098 -1
  220. package/dist/docs/error-docs.js +421 -144
  221. package/dist/docs/index-build.d.ts +0 -1
  222. package/dist/docs/index-build.js +2 -3
  223. package/dist/docs/page-context-prompt.d.ts +77 -0
  224. package/dist/docs/page-context-prompt.js +131 -0
  225. package/dist/docs/reference-urls.d.ts +46 -0
  226. package/dist/docs/reference-urls.js +79 -0
  227. package/dist/docs/search.d.ts +6 -8
  228. package/dist/docs/search.js +10 -13
  229. package/dist/docs/skill-distribution.d.ts +4 -1
  230. package/dist/docs/skill-distribution.js +10 -5
  231. package/dist/docs/skills.d.ts +120 -120
  232. package/dist/docs/skills.js +121 -73
  233. package/dist/docs/start-prompts.d.ts +45 -0
  234. package/dist/docs/start-prompts.js +62 -0
  235. package/dist/domain-exploration.js +9 -13
  236. package/dist/og-template.d.ts +56 -0
  237. package/dist/og-template.js +56 -0
  238. package/dist/slug-policy/index.js +5 -11
  239. package/dist/test-helpers/fetch-stub.js +1 -0
  240. package/dist/utils/browser-credential.d.ts +13 -6
  241. package/dist/utils/browser-credential.js +14 -7
  242. package/dist/utils/build-settings.d.ts +21 -1
  243. package/dist/utils/build-settings.js +133 -15
  244. package/dist/utils/canonical-json.d.ts +3 -5
  245. package/dist/utils/canonical-json.js +4 -5
  246. package/dist/utils/cast-transport.d.ts +5 -17
  247. package/dist/utils/cast-transport.js +6 -19
  248. package/dist/utils/claim-token.js +1 -2
  249. package/dist/utils/comment-avatars.js +4 -6
  250. package/dist/utils/concurrency.js +3 -3
  251. package/dist/utils/content-type.d.ts +7 -6
  252. package/dist/utils/content-type.js +73 -51
  253. package/dist/utils/credential-policy.d.ts +50 -6
  254. package/dist/utils/credential-policy.js +126 -59
  255. package/dist/utils/dns-instructions.js +9 -9
  256. package/dist/utils/egress-policy.fixtures.json +1 -1
  257. package/dist/utils/error-code.js +1 -0
  258. package/dist/utils/generate-space-name.d.ts +3 -8
  259. package/dist/utils/generate-space-name.js +3 -8
  260. package/dist/utils/grant-decision.fixtures.json +2 -2
  261. package/dist/utils/grants.d.ts +0 -1
  262. package/dist/utils/grants.js +7 -8
  263. package/dist/utils/gravatar.d.ts +2 -4
  264. package/dist/utils/gravatar.js +6 -12
  265. package/dist/utils/id-hints.js +14 -23
  266. package/dist/utils/idempotency.d.ts +3 -3
  267. package/dist/utils/idempotency.js +6 -7
  268. package/dist/utils/local-space-state.d.ts +23 -26
  269. package/dist/utils/local-space-state.js +46 -46
  270. package/dist/utils/oauth-signed-query.d.ts +3 -5
  271. package/dist/utils/oauth-signed-query.js +6 -9
  272. package/dist/utils/one-shot-replay.d.ts +7 -6
  273. package/dist/utils/one-shot-replay.js +3 -5
  274. package/dist/utils/page-colors.d.ts +15 -19
  275. package/dist/utils/page-colors.js +23 -45
  276. package/dist/utils/page-fonts.d.ts +1 -1
  277. package/dist/utils/page-fonts.js +8 -20
  278. package/dist/utils/page-preview.d.ts +0 -1
  279. package/dist/utils/page-preview.js +0 -1
  280. package/dist/utils/pages.d.ts +33 -3
  281. package/dist/utils/pages.js +83 -30
  282. package/dist/utils/privacy-regions.d.ts +19 -0
  283. package/dist/utils/privacy-regions.js +91 -0
  284. package/dist/utils/publish-form-data.d.ts +4 -5
  285. package/dist/utils/publish-form-data.js +2 -3
  286. package/dist/utils/publish-policy.d.ts +11 -17
  287. package/dist/utils/publish-policy.fixtures.json +11 -5
  288. package/dist/utils/publish-policy.js +65 -110
  289. package/dist/utils/query-client.d.ts +2 -0
  290. package/dist/utils/query-client.js +10 -1
  291. package/dist/utils/runtime-paths.d.ts +4 -4
  292. package/dist/utils/runtime-paths.js +6 -8
  293. package/dist/utils/runtime-upload.d.ts +9 -0
  294. package/dist/utils/runtime-upload.js +12 -0
  295. package/dist/utils/secure-local-file.d.ts +3 -3
  296. package/dist/utils/secure-local-file.js +23 -40
  297. package/dist/utils/space-config.d.ts +12 -15
  298. package/dist/utils/space-config.js +13 -16
  299. package/dist/utils/static-runtime-policy.d.ts +10 -7
  300. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  301. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  302. package/dist/utils/static-runtime-policy.generated.js +70 -0
  303. package/dist/utils/static-runtime-policy.js +31 -132
  304. package/dist/utils/storage-policy.js +1 -2
  305. package/dist/utils/upload-session.d.ts +4 -1
  306. package/dist/utils/upload-session.js +41 -19
  307. package/dist/utils/version-path.js +11 -19
  308. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  309. package/dist/utils/wpcom-auth-redirects.js +1 -4
  310. package/dist/vocabulary.d.ts +13 -13
  311. package/dist/vocabulary.js +52 -27
  312. package/package.json +15 -18
  313. package/dist/agents/client-registry.d.ts +0 -22
  314. package/dist/agents/client-registry.js +0 -41
  315. package/dist/docs/agent-handoff-document.d.ts +0 -15
  316. package/dist/docs/agent-handoff-document.js +0 -180
  317. package/dist/docs/agent-solutions.d.ts +0 -110
  318. package/dist/docs/agent-solutions.js +0 -183
  319. package/dist/utils/query-keys.d.ts +0 -84
  320. package/dist/utils/query-keys.js +0 -108
@@ -11,20 +11,16 @@ export declare const STATIC_RUNTIME_CONTROL_PATHS: string[];
11
11
  export declare const STATIC_RUNTIME_CONTROL_PREFIXES: string[];
12
12
  export declare function normalizePublishPath(relativePath: string): string;
13
13
  /**
14
- * The one subtree inside the runtime control prefix that a publish may write.
14
+ * The one subtree inside the runtime control prefix a publish may write, so a
15
+ * compiled worker bundle travels the ordinary manifest and upload path while
16
+ * staying unservable as static content.
15
17
  *
16
- * `sf publish` compiles a version's worker into `__spacefast/functions/bundles/`
17
- * so the bundle travels through the ordinary manifest and upload path instead of
18
- * needing a parallel one. Keeping it under the control prefix is what makes it
19
- * unservable as static content by default — the runtime answers it only behind a
20
- * signature.
21
- *
22
- * Scoped to `bundles/` rather than the whole `__spacefast/functions/` directory
23
- * on purpose: the sibling `config.json` holds the key those signatures are
24
- * minted with, and a publish that could overwrite it would be a publish that
25
- * could mint its own tokens.
18
+ * Scoped to `bundles/`, not the whole `__spacefast/functions/` directory: the
19
+ * sibling `config.json` holds the key its signatures are minted with.
26
20
  */
27
21
  export declare const PUBLISHABLE_BUILD_ARTIFACT_PREFIX = "__spacefast/functions/bundles/";
22
+ /** The same carve-out for the Next-cache seed document. */
23
+ export declare const PUBLISHABLE_SEED_ARTIFACT_PREFIX = "__spacefast/functions/seeds/";
28
24
  export declare function publishPathIgnored(relativePath: string): boolean;
29
25
  export declare function publishPathIsConvention(relativePath: string): boolean;
30
26
  export declare function providerRuntimeFeatureWarnings(paths: readonly string[]): PublishManifestWarning[];
@@ -89,12 +85,10 @@ export type PublishRouteOwnership = {
89
85
  */
90
86
  export declare function canonicalizePublishRequestedRoute(route: string): string;
91
87
  /**
92
- * Expands artifact paths into the request routes they can serve. The runtime
93
- * resolves literal files, directory indexes, and clean `.html` aliases; two
94
- * different artifacts owning one request route is rejected at publish/finalize
95
- * instead of depending on lookup order. `routeOwnership` exposes the same
96
- * expansion in canonical access-route form so authorization and diagnostics
97
- * never have to infer a route from an artifact path.
88
+ * Expands artifact paths into the request routes they can serve: literal
89
+ * files, directory indexes and clean `.html` aliases. Two artifacts owning one
90
+ * route is rejected at publish rather than left to lookup order.
91
+ * `routeOwnership` restates the expansion in canonical access-route form.
98
92
  */
99
93
  export declare function analyzePublishRoutes(paths: readonly string[], options?: {
100
94
  index?: string | false;
@@ -146,6 +146,16 @@
146
146
  "path": "__spacefast/functions/bundlesX/evil.json",
147
147
  "expected": "static_runtime_control_path_not_supported"
148
148
  },
149
+ {
150
+ "path": "__spacefast/functions/seeds/abc123/seed.json",
151
+ "expected": null,
152
+ "why": "the Next-cache seed document, the bundle carve-out's sibling"
153
+ },
154
+ {
155
+ "path": "__spacefast/functions/seeds.json",
156
+ "expected": "static_runtime_control_path_not_supported",
157
+ "why": "the carve-out is the seeds/ prefix, not anything starting with seeds"
158
+ },
149
159
  {
150
160
  "path": "__spacefast/zero/deploy.json",
151
161
  "expected": null,
@@ -201,10 +211,6 @@
201
211
  "path": "engine-manifest.json",
202
212
  "expected": "static_runtime_control_path_not_supported"
203
213
  },
204
- {
205
- "path": "entrypoint-shim.php",
206
- "expected": "static_runtime_control_path_not_supported"
207
- },
208
214
  {
209
215
  "path": "nested/custom-redirects.php",
210
216
  "expected": null,
@@ -213,7 +219,7 @@
213
219
  {
214
220
  "path": "init.php",
215
221
  "expected": null,
216
- "why": "engine/init.php installs under .stattic/engine/, not the docroot"
222
+ "why": "engine/init.php installs inside an immutable release, not the docroot"
217
223
  },
218
224
  {
219
225
  "path": ".spacefast/storage/routes/current.php",
@@ -2,21 +2,17 @@ import { BRAND } from "../brand.js";
2
2
  import { WORST_CASE_QUOTAS } from "../contracts/quotas.js";
3
3
  import { SPACE_CONFIG_PRIVATE_FILES } from "../contracts/space-config.js";
4
4
  import { ZERO_RUNTIME_DEPLOY_PATH } from "../contracts/zero.js";
5
- // The ONE static publish policy (internal-docs/platform.md "Upload Contract"):
6
- // path denials, manifest scale caps, plan caps, duplicate detection, and the
7
- // free-plan content rules live here. Consumed by API manifest validation, CLI
8
- // local preflight, inline archive extraction, and the runtime parity fixtures
9
- // (the PHP twin is runtime/engine/admin/upload-policy.php).
5
+ // The ONE static publish policy (spec "Upload Contract"), shared by API
6
+ // manifest validation, CLI preflight and archive extraction. The PHP twin is
7
+ // runtime/engine/admin/upload-policy.php.
10
8
  import { canonicalizeVersionPath, normalizeVersionPath } from "./version-path.js";
11
- // Manifest scale caps (spec "Upload Contract"): the hard contract ceiling is
12
- // 100,000 files per version; plan policy may LOWER it (Free 20,000), never
13
- // raise it. Canonical paths cap at 1,024 bytes; manifest request bodies at
14
- // 16 MB, enforced fail-early before any upload session exists.
9
+ // Manifest scale caps (spec "Upload Contract"). Plan policy may LOWER the
10
+ // file-count ceiling (Free 20,000), never raise it. All are enforced before
11
+ // any upload session exists.
15
12
  export const MANIFEST_MAX_FILES_CEILING = 100_000;
16
13
  export const MANIFEST_MAX_PATH_BYTES = 1024;
17
14
  export const MANIFEST_MAX_BODY_BYTES = 16 * 1024 * 1024;
18
15
  export const MAX_VERSION_FILE_SIZE_BYTES = 64 * 1024 * 1024;
19
- // Worst-case artifact ceiling lives in the named raise-only quota table.
20
16
  export const MAX_VERSION_TOTAL_BYTES = WORST_CASE_QUOTAS.maxArtifactBytes;
21
17
  const IGNORED_EXACT_PATHS = new Set([
22
18
  ".DS_Store",
@@ -28,8 +24,7 @@ const IGNORED_EXACT_PATHS = new Set([
28
24
  ".env.test",
29
25
  ".npmrc",
30
26
  ".netrc",
31
- // CLI checkout state (current dir name plus the legacy pre-rename one —
32
- // user archives may contain either; both stay out of every publish).
27
+ // CLI checkout state. Both spellings appear in user archives.
33
28
  ".spacefast/state.json",
34
29
  ".stattic/state.json",
35
30
  "_routes.json",
@@ -57,33 +52,22 @@ const SENSITIVE_FILE_PATTERNS = [
57
52
  // Denied runtime private/control paths (spec "Static path policy").
58
53
  // Every list below is generated verbatim into runtime/engine/admin/upload-policy.php
59
54
  // by apps/control-plane/src/scripts/codegen-php-policy.ts, so the two enforcers
60
- // cannot hold different literals. Lowercase only both sides fold the path first.
55
+ // cannot hold different literals. Lowercase only; both sides fold the path first.
61
56
  export const STATIC_EXECUTION_CONTROL_FILES = [".htaccess", ".user.ini"];
62
- // Reserved runtime namespace segments are matched by PREFIX: the runtime owns
63
- // `/__spacefast/*` plus `__spacefast_generated/`, and the `__stattic` spelling
64
- // (`/__stattic_probe` today, more `/__stattic/*` routes planned) stays
65
- // reserved the same way. Mid-segment occurrences are ordinary content.
57
+ // Matched by PREFIX, so the runtime owns `__spacefast_generated/` as well as
58
+ // `/__spacefast/*`. Mid-segment occurrences are ordinary content.
66
59
  export const STATIC_RUNTIME_CONTROL_SEGMENT_PREFIXES = ["__spacefast", "__stattic"];
67
- // Reserved as WHOLE root segments. In runtime/engine/shared/context.php the
68
- // control table gives `/__sf` and `/__span` `match => 'namespace', fold => true`
69
- // rows, and `_stattic_control_path_row()` reads `namespace` as `=== '/__sf' ||
70
- // starts_with('/__sf/')`, so `/__sfx/...` and `/__spanish/page` are ordinary
71
- // tenant paths. Reserving more than the front door claims would refuse a publish
72
- // of content the front door then happily serves as tenant content.
60
+ // Reserved as WHOLE root segments, so `/__sfx/...` and `/__spanish/page` are
61
+ // ordinary tenant paths. Reserving more than the front door claims would refuse
62
+ // a publish of content the front door then serves anyway.
73
63
  //
74
- // This is a SUBSET of what the control table reserves, not a mirror of it: the
75
- // table also reserves the nested exact path `/__/collab` (the review link),
76
- // while the `/__/` prefix around it is tenant-publishable. Publish deliberately
77
- // does not claim that one — the reservation that matters is enforced at request
78
- // time, where serve.php refuses to let either a published file or a routing rule
79
- // answer a reserved route, and that refusal is what runtime/tests/collab-frame.test.ts
80
- // exercises by publishing a file at `__/collab` on purpose. The control table is
81
- // the authority; this list is a publish-time convenience, so keep it a subset
82
- // and never let it contradict the table.
64
+ // A SUBSET of what the control table in runtime/engine/shared/context.php
65
+ // reserves, never a mirror: the table also reserves `/__/collab`, enforced at
66
+ // request time by serve.php. The table is the authority; keep this list a
67
+ // subset of it.
83
68
  export const STATIC_RUNTIME_ROOT_SEGMENTS = ["__sf", "__span"];
84
- // Both the current and the legacy control-path spellings stay denied: spaces
85
- // published before the `.stattic` → `.spacefast` rename still serve from the
86
- // legacy on-disk layout, and user archives may carry either name.
69
+ // Both spellings stay denied: spaces published before the `.stattic`
70
+ // `.spacefast` rename still serve from the legacy on-disk layout.
87
71
  export const STATIC_RUNTIME_CONTROL_PATHS = [
88
72
  ".well-known/spacefast-runtime",
89
73
  ".well-known/stattic-runtime",
@@ -98,43 +82,34 @@ export function normalizePublishPath(relativePath) {
98
82
  return relativePath.replace(/\\/g, "/").replace(/^\/+/g, "");
99
83
  }
100
84
  /**
101
- * The one subtree inside the runtime control prefix that a publish may write.
85
+ * The one subtree inside the runtime control prefix a publish may write, so a
86
+ * compiled worker bundle travels the ordinary manifest and upload path while
87
+ * staying unservable as static content.
102
88
  *
103
- * `sf publish` compiles a version's worker into `__spacefast/functions/bundles/`
104
- * so the bundle travels through the ordinary manifest and upload path instead of
105
- * needing a parallel one. Keeping it under the control prefix is what makes it
106
- * unservable as static content by default — the runtime answers it only behind a
107
- * signature.
108
- *
109
- * Scoped to `bundles/` rather than the whole `__spacefast/functions/` directory
110
- * on purpose: the sibling `config.json` holds the key those signatures are
111
- * minted with, and a publish that could overwrite it would be a publish that
112
- * could mint its own tokens.
89
+ * Scoped to `bundles/`, not the whole `__spacefast/functions/` directory: the
90
+ * sibling `config.json` holds the key its signatures are minted with.
113
91
  */
114
92
  export const PUBLISHABLE_BUILD_ARTIFACT_PREFIX = "__spacefast/functions/bundles/";
93
+ /** The same carve-out for the Next-cache seed document. */
94
+ export const PUBLISHABLE_SEED_ARTIFACT_PREFIX = "__spacefast/functions/seeds/";
115
95
  /**
116
- * The one FILE inside the control prefix a publish may write.
117
- *
118
- * A Zero capsule's compiled server travels as version metadata, not content, so
119
- * a server-only change ships a byte-identical app shell and the version intent's
120
- * manifest comparison reads it as "no changes". `sf publish` writes the deploy's
121
- * digest here so the manifest moves whenever the deploy does — same reasoning as
122
- * the Functions bundle above, same channel.
123
- *
124
- * One exact path, not a prefix: its siblings under `__spacefast/zero/` are the
125
- * runtime's own artifact, config and binary, and a publish that could overwrite
126
- * those would be a publish that could replace the runtime.
96
+ * ZERO_RUNTIME_DEPLOY_PATH is the one FILE a publish may write inside the
97
+ * control prefix. A Zero capsule's server travels as version metadata, so a
98
+ * server-only change would otherwise ship a byte-identical shell that the
99
+ * manifest comparison reads as "no changes"; the deploy digest moves it. One
100
+ * exact path, not a prefix: its siblings under `__spacefast/zero/` are the
101
+ * runtime's own artifact, config and binary.
127
102
  */
128
103
  function isPublishableBuildArtifactPath(normalizedPath, lowerPath) {
129
104
  return (lowerPath.startsWith(PUBLISHABLE_BUILD_ARTIFACT_PREFIX) ||
105
+ lowerPath.startsWith(PUBLISHABLE_SEED_ARTIFACT_PREFIX) ||
130
106
  normalizedPath === ZERO_RUNTIME_DEPLOY_PATH);
131
107
  }
132
108
  export function publishPathIgnored(relativePath) {
133
109
  const path = normalizePublishPath(relativePath);
134
- // The agent state dirs hold one secret (state.json) plus committable tooling
135
- // (space.json). Drop only those files at any depth so a checkout archived one
136
- // level too high never ships a claim token — but keep serving legitimate
137
- // content in the same dirs (e.g. the legacy .stattic/routes.json convention).
110
+ // Drop these files at any depth so a checkout archived one level too high
111
+ // never ships a claim token, while other content in the same dirs still
112
+ // publishes (e.g. the legacy .stattic/routes.json convention).
138
113
  if (/(?:^|\/)\.(?:spacefast|stattic)\/(?:state|space)\.json$/.test(path) ||
139
114
  /(?:^|\/)\.spacefast-(?:[0-9a-f-]{36}\.(?:tmp|rollback|retired)|[0-9a-f]{24}\.lock)$/.test(path)) {
140
115
  return true;
@@ -151,11 +126,9 @@ export function publishPathIgnored(relativePath) {
151
126
  export function publishPathIsConvention(relativePath) {
152
127
  return RESERVED_CONVENTION_PATHS.has(normalizePublishPath(relativePath));
153
128
  }
154
- // Provider runtime features that have no Spacefast equivalent (spec "Routing And
155
- // Headers", migration diagnostics): Cloudflare Pages `_worker.js`/`_routes.json`
156
- // and Netlify's provider-specific function directory publish as inert content
157
- // with a warning so migrations are never silent. A root `functions/` directory
158
- // is Spacefast's own file-router convention and must never reach this warning.
129
+ // Provider runtime features with no Spacefast equivalent publish as inert
130
+ // content with a warning, so migrations are never silent. A root `functions/`
131
+ // directory is Spacefast's own convention and must never reach this warning.
159
132
  function providerRuntimeFeatureForPath(path) {
160
133
  if (path === "_worker.js") {
161
134
  return "Cloudflare Pages _worker.js";
@@ -210,9 +183,8 @@ export function staticUploadPathViolation(path, options = {}) {
210
183
  return pathViolation("invalid_file_path", "File path is invalid.", rawPath);
211
184
  }
212
185
  if (normalizedPath !== rawPath) {
213
- // The path the caller sent, not the normal form it missed: echoing a
214
- // rewritten path suggests the rewrite was accepted, and it is the one place
215
- // this policy used to report a different string than the runtime's copy.
186
+ // Echo the path the caller sent; a rewritten one would suggest the
187
+ // rewrite was accepted.
216
188
  return pathViolation("invalid_file_path", "File path is invalid.", rawPath);
217
189
  }
218
190
  if (new TextEncoder().encode(normalizedPath).length > MANIFEST_MAX_PATH_BYTES) {
@@ -280,12 +252,10 @@ export function canonicalizePublishRequestedRoute(route) {
280
252
  return segments.length === 0 ? "/" : `/${segments.join("/")}`;
281
253
  }
282
254
  /**
283
- * Expands artifact paths into the request routes they can serve. The runtime
284
- * resolves literal files, directory indexes, and clean `.html` aliases; two
285
- * different artifacts owning one request route is rejected at publish/finalize
286
- * instead of depending on lookup order. `routeOwnership` exposes the same
287
- * expansion in canonical access-route form so authorization and diagnostics
288
- * never have to infer a route from an artifact path.
255
+ * Expands artifact paths into the request routes they can serve: literal
256
+ * files, directory indexes and clean `.html` aliases. Two artifacts owning one
257
+ * route is rejected at publish rather than left to lookup order.
258
+ * `routeOwnership` restates the expansion in canonical access-route form.
289
259
  */
290
260
  export function analyzePublishRoutes(paths, options = {}) {
291
261
  const index = options.index === undefined ? "index.html" : options.index;
@@ -354,12 +324,10 @@ export function analyzePublishRoutes(paths, options = {}) {
354
324
  export function resolveManifestFileCap(maxFiles) {
355
325
  return Math.min(MANIFEST_MAX_FILES_CEILING, maxFiles && maxFiles > 0 ? maxFiles : MANIFEST_MAX_FILES_CEILING);
356
326
  }
357
- // The shared manifest validator (spec "Upload Contract"): canonicalizes every
358
- // path (decode-once + NFC), enforces the static path policy, the scale caps,
359
- // and plan caps, rejects post-canonicalization duplicates, and emits the
360
- // case-collision warning. Runs BEFORE any upload session is created; archive
361
- // extraction routes through the same checks. Returns the manifest with
362
- // canonical paths — callers use the returned files, never the input.
327
+ // The shared manifest validator (spec "Upload Contract"). Runs BEFORE any
328
+ // upload session is created; archive extraction routes through the same
329
+ // checks. Returns canonical paths, so callers use the returned files, never
330
+ // the input.
363
331
  export function validatePublishManifest(files, caps = {}) {
364
332
  const maxFiles = resolveManifestFileCap(caps.maxFiles);
365
333
  if (files.length > maxFiles) {
@@ -416,15 +384,13 @@ export function validatePublishManifest(files, caps = {}) {
416
384
  warnings: [],
417
385
  };
418
386
  }
419
- // Checkout state and credential paths (.spacefast/, .git/, .env*, …) are
420
- // silently dropped rather than rejected: agents that archive one level too
421
- // high must never publish a claim token to the live site, and failing the
422
- // whole manifest for it would punish the common accident.
387
+ // Dropped rather than rejected: failing a whole manifest over a stray
388
+ // .env or .spacefast/ would punish the common accident.
423
389
  if (publishPathIgnored(canonicalPath)) {
424
390
  continue;
425
391
  }
426
- // Case-only-differing paths are distinct (paths are byte-exact and
427
- // case-sensitive) but cannot round-trip case-insensitive filesystems.
392
+ // Distinct paths here, but they cannot round-trip a case-insensitive
393
+ // filesystem.
428
394
  const lowercase = canonicalPath.toLowerCase();
429
395
  const caseSibling = lowercasePaths.get(lowercase);
430
396
  if (caseSibling !== undefined && caseSibling !== canonicalPath) {
@@ -486,8 +452,7 @@ const FREE_PLAN_ALLOWED_UPLOAD_EXTENSIONS = new Set([
486
452
  ".txt",
487
453
  ".md",
488
454
  ".csv",
489
- // Opaque static payloads used by migration fixtures and served as
490
- // application/octet-stream by the runtime.
455
+ // Migration fixtures, served as application/octet-stream.
491
456
  ".customtype",
492
457
  ".xml",
493
458
  ".svg",
@@ -503,13 +468,10 @@ const FREE_PLAN_ALLOWED_UPLOAD_EXTENSIONS = new Set([
503
468
  ".ttf",
504
469
  ".otf",
505
470
  ]);
506
- // THE anonymous content enforcement (accept-and-scan posture): uploads are
507
- // accepted like any free publish, but until the space is claimed the runtime
508
- // only serves these content types, pushed as the generic route-config
509
- // `content_types` allowlist (exact types or `prefix/*` wildcards; the engine
510
- // enforces the list without knowing it means "anonymous"). Web-page content
511
- // only — no opaque octet-streams, archives (except scanned gzip, which
512
- // pagefind search indexes depend on), documents, or media containers.
471
+ // THE anonymous content enforcement: uploads are accepted like any free
472
+ // publish, but until the space is claimed the runtime serves only these types,
473
+ // pushed as the route-config `content_types` allowlist. Web-page content only.
474
+ // Gzip is the one archive, because pagefind search indexes need it.
513
475
  export const ANONYMOUS_SERVE_CONTENT_TYPES = [
514
476
  "text/*",
515
477
  "image/*",
@@ -534,20 +496,14 @@ function freePlanDeniedExecutablePath(filePath) {
534
496
  .split("/")
535
497
  .some((segment) => segment === "bin");
536
498
  }
537
- // Acceptance is deliberately identical for claimed-free and unclaimed
538
- // anonymous spaces (accept-and-scan posture): rejecting file types at upload
539
- // adds no safety — the bytes reach us before any scan either way so
540
- // publishes are accepted, every file goes through the scan pipeline, and the
541
- // SERVE-time content-type allowlist (ANONYMOUS_SERVE_CONTENT_TYPES via the
542
- // route-config `content_types` policy) is what keeps opaque binaries dark
543
- // until the space is claimed.
499
+ // Acceptance is deliberately identical for claimed-free and unclaimed spaces:
500
+ // rejecting types at upload adds no safety, since the bytes reach us before
501
+ // any scan either way. ANONYMOUS_SERVE_CONTENT_TYPES is what keeps opaque
502
+ // binaries dark until the space is claimed.
544
503
  export function freePlanCanUploadPath(filePath, options) {
545
504
  const path = normalizePublishPath(filePath);
546
- // Root Spacefast config files are platform machinery, not user content (spec "Space
547
- // Configuration Files": ships in the manifest, same lifecycle as
548
- // `_redirects`/`_headers`) — the plan's content-extension gate must never
549
- // eat it (e2e checkpoint 4: it was silently dropped on free publishes,
550
- // disabling fallback/meta/templates/theme for every free space).
505
+ // Platform machinery, not user content: same lifecycle as
506
+ // `_redirects`/`_headers`, so the content-extension gate must never eat them.
551
507
  if (SPACE_CONFIG_PRIVATE_FILES.includes(path)) {
552
508
  return true;
553
509
  }
@@ -571,8 +527,7 @@ export function freePlanCanUploadContentType(contentType) {
571
527
  normalized === "application/javascript" ||
572
528
  normalized === "application/json" ||
573
529
  normalized === "application/manifest+json" ||
574
- // Gzip stays allowed for anonymous spaces too: pagefind search indexes
575
- // ship as gzip fragments, and ClamAV decompresses gzip when scanning.
530
+ // pagefind ships gzip fragments, and ClamAV decompresses gzip when scanning.
576
531
  normalized === "application/gzip" ||
577
532
  normalized === "image/svg+xml" ||
578
533
  normalized === "application/xml" ||
@@ -4,4 +4,6 @@ export type ApiErrorLike = {
4
4
  };
5
5
  export declare function createSpacefastQueryClient(options?: {
6
6
  isClientError?: (error: unknown) => error is ApiErrorLike;
7
+ /** Default freshness window for every query, in milliseconds. */
8
+ staleTime?: number;
7
9
  }): QueryClient;
@@ -1,4 +1,13 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
+ /**
3
+ * Freshness for a caller that has not adopted a tiered caching policy.
4
+ *
5
+ * The tiers themselves (`STALE_TIME_MS`) live in `@spacefast/sdk/query`, which
6
+ * depends on this package — so they cannot be imported here and arrive as an
7
+ * argument instead. The dashboard passes `STALE_TIME_MS.normal`; superadmin
8
+ * still runs on this default.
9
+ */
10
+ const UNTIERED_STALE_TIME_MS = 60_000;
2
11
  export function createSpacefastQueryClient(options) {
3
12
  return new QueryClient({
4
13
  defaultOptions: {
@@ -12,7 +21,7 @@ export function createSpacefastQueryClient(options) {
12
21
  }
13
22
  return failureCount < 2;
14
23
  },
15
- staleTime: 60_000,
24
+ staleTime: options?.staleTime ?? UNTIERED_STALE_TIME_MS,
16
25
  refetchOnWindowFocus: true,
17
26
  refetchOnReconnect: true,
18
27
  },
@@ -2,13 +2,13 @@ export declare const SPACEFAST_RUNTIME_NAMESPACE: "/__spacefast";
2
2
  export declare const RUNTIME_MANAGEMENT_API_PATH: "/__spacefast/api.php";
3
3
  export declare const RUNTIME_UPLOAD_API_PATH: "/__spacefast/upload.php";
4
4
  export declare const RUNTIME_HEALTH_PATH: "/__spacefast/health.php";
5
+ export declare const RUNTIME_CONTENT_API_PATH: "/__spacefast/content.php";
5
6
  export declare const RUNTIME_COMMENTS_CONFIG_PATH: "/__spacefast/comments/config";
6
7
  export declare const RUNTIME_COMMENTS_TICKET_PATH: "/__spacefast/comments/ticket";
7
8
  export declare const RUNTIME_COMMENTS_VERSION_URLS_PATH: "/__spacefast/comments/version-urls";
8
- /** The review workspace the orb expands into a reserved control path on the
9
- * Space's own origin (collab-frame-plan §4), not part of the `/__spacefast`
10
- * exchange namespace because people paste this one into Slack.
11
- * The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in runtime/engine/shared/context.php. */
9
+ /** The review workspace, on the Space's own origin and outside the
10
+ * `/__spacefast` exchange namespace because people paste it into Slack.
11
+ * The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in shared/context.php. */
12
12
  export declare const RUNTIME_COLLAB_FRAME_PATH: "/__/collab";
13
13
  export declare function runtimeManagementPath(suffix: string): string;
14
14
  export declare function runtimeUploadPath(params: URLSearchParams | Record<string, string>): string;
@@ -2,17 +2,15 @@ export const SPACEFAST_RUNTIME_NAMESPACE = "/__spacefast";
2
2
  export const RUNTIME_MANAGEMENT_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/api.php`;
3
3
  export const RUNTIME_UPLOAD_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/upload.php`;
4
4
  export const RUNTIME_HEALTH_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/health.php`;
5
- // Same-origin Comments exchange paths served on every published host. The PHP
6
- // mirror is SPACEFAST_COMMENTS_*_PATH in runtime/engine/shared/context.php;
7
- // runtime/tests/spacefast-sdk.test.ts pins the PHP side and
8
- // packages/collab-sdk/test/entry.test.ts pins the SDK side to these literals.
5
+ export const RUNTIME_CONTENT_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/content.php`;
6
+ // Same-origin Comments exchange paths. The PHP mirror is
7
+ // SPACEFAST_COMMENTS_*_PATH in runtime/engine/shared/context.php.
9
8
  export const RUNTIME_COMMENTS_CONFIG_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/config`;
10
9
  export const RUNTIME_COMMENTS_TICKET_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/ticket`;
11
10
  export const RUNTIME_COMMENTS_VERSION_URLS_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/version-urls`;
12
- /** The review workspace the orb expands into a reserved control path on the
13
- * Space's own origin (collab-frame-plan §4), not part of the `/__spacefast`
14
- * exchange namespace because people paste this one into Slack.
15
- * The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in runtime/engine/shared/context.php. */
11
+ /** The review workspace, on the Space's own origin and outside the
12
+ * `/__spacefast` exchange namespace because people paste it into Slack.
13
+ * The PHP mirror is SPACEFAST_COLLAB_FRAME_PATH in shared/context.php. */
16
14
  export const RUNTIME_COLLAB_FRAME_PATH = "/__/collab";
17
15
  export function runtimeManagementPath(suffix) {
18
16
  const route = normalizeRuntimeRoute(suffix);
@@ -4,6 +4,15 @@ export declare function runtimeUploadFetchUrl(input: {
4
4
  uploadId: string;
5
5
  path: string;
6
6
  }): string;
7
+ export declare function runtimeUploadFileUrl(input: {
8
+ baseUrl: string;
9
+ uploadId: string;
10
+ path: string;
11
+ }): string;
12
+ export declare function runtimeUploadBlobsHaveUrl(input: {
13
+ baseUrl: string;
14
+ spaceId: string;
15
+ }): string;
7
16
  export declare function runtimeUploadBlobUrl(input: {
8
17
  baseUrl: string;
9
18
  spaceId: string;
@@ -15,6 +15,18 @@ export function runtimeUploadFetchUrl(input) {
15
15
  path: runtimeUploadCanonicalPath(input.path),
16
16
  }), input.baseUrl).toString();
17
17
  }
18
+ export function runtimeUploadFileUrl(input) {
19
+ return new URL(runtimeUploadPath({
20
+ op: "file",
21
+ upload_id: input.uploadId,
22
+ path: runtimeUploadCanonicalPath(input.path),
23
+ }), input.baseUrl).toString();
24
+ }
25
+ export function runtimeUploadBlobsHaveUrl(input) {
26
+ return new URL(runtimeUploadPath({
27
+ route: `/spaces/${encodeURIComponent(input.spaceId)}/blobs/have`,
28
+ }), input.baseUrl).toString();
29
+ }
18
30
  export function runtimeUploadBlobUrl(input) {
19
31
  return new URL(runtimeUploadPath({
20
32
  route: `/spaces/${encodeURIComponent(input.spaceId)}/blobs/${encodeURIComponent(input.sha256)}`,
@@ -51,9 +51,9 @@ export declare function secureOutputLocation(trustedPath: string, outputPath: st
51
51
  };
52
52
  /**
53
53
  * Writes beneath an explicitly trusted root without following output-tree
54
- * symlinks. Linux uses descriptor-relative operations; other supported
55
- * platforms use exclusive staging plus before-and-after ancestor identity
56
- * validation and fail closed if any binding changes.
54
+ * symlinks. Linux uses descriptor-relative operations; other platforms use
55
+ * exclusive staging plus before-and-after ancestor identity validation, and
56
+ * fail closed if any binding changes.
57
57
  */
58
58
  export declare function secureWriteFile(options: SecureWriteOptions): Promise<void>;
59
59
  export declare function secureReadFile(options: SecureReadOptions & {