@spacefast/common 0.0.26 → 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 (302) hide show
  1. package/dist/agents/connect-targets.d.ts +6 -146
  2. package/dist/agents/connect-targets.js +63 -295
  3. package/dist/agents/private-key-oauth.d.ts +31 -1
  4. package/dist/agents/private-key-oauth.js +124 -33
  5. package/dist/agents/registry/core.d.ts +292 -0
  6. package/dist/agents/registry/core.js +1388 -0
  7. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  8. package/dist/agents/registry/deeplink-probes.js +18 -0
  9. package/dist/agents/registry/node.d.ts +56 -0
  10. package/dist/agents/registry/node.js +339 -0
  11. package/dist/brand-assets-build.js +1 -2
  12. package/dist/brand-assets.js +4 -7
  13. package/dist/brand.d.ts +17 -0
  14. package/dist/brand.js +24 -4
  15. package/dist/config/domains.d.ts +55 -28
  16. package/dist/config/domains.js +85 -41
  17. package/dist/config/index.js +1 -2
  18. package/dist/contracts/abuse.js +9 -24
  19. package/dist/contracts/access-profiles.d.ts +86 -0
  20. package/dist/contracts/access-profiles.js +89 -0
  21. package/dist/contracts/access.d.ts +21 -27
  22. package/dist/contracts/access.js +33 -64
  23. package/dist/contracts/activity.d.ts +18 -1
  24. package/dist/contracts/activity.js +70 -26
  25. package/dist/contracts/analytics.js +8 -10
  26. package/dist/contracts/api-keys.d.ts +77 -52
  27. package/dist/contracts/api-keys.js +44 -24
  28. package/dist/contracts/application-journal.d.ts +216 -0
  29. package/dist/contracts/application-journal.js +167 -0
  30. package/dist/contracts/auth.d.ts +90 -17
  31. package/dist/contracts/auth.js +86 -17
  32. package/dist/contracts/beta.d.ts +9 -4
  33. package/dist/contracts/beta.js +20 -16
  34. package/dist/contracts/billing.js +7 -11
  35. package/dist/contracts/bootstrap.d.ts +791 -0
  36. package/dist/contracts/bootstrap.js +51 -0
  37. package/dist/contracts/builds.d.ts +186 -7
  38. package/dist/contracts/builds.js +75 -21
  39. package/dist/contracts/channels.d.ts +43 -0
  40. package/dist/contracts/channels.js +25 -9
  41. package/dist/contracts/cli.d.ts +7 -0
  42. package/dist/contracts/cli.js +6 -0
  43. package/dist/contracts/collab-public.d.ts +1 -1
  44. package/dist/contracts/collab-public.js +5 -8
  45. package/dist/contracts/comments.d.ts +45 -35
  46. package/dist/contracts/comments.js +107 -77
  47. package/dist/contracts/commerce.d.ts +165 -0
  48. package/dist/contracts/commerce.js +146 -0
  49. package/dist/contracts/common.d.ts +3 -3
  50. package/dist/contracts/common.js +18 -29
  51. package/dist/contracts/content-contract-verification.d.ts +521 -0
  52. package/dist/contracts/content-contract-verification.js +320 -0
  53. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  54. package/dist/contracts/content-platform-fixture.js +44 -0
  55. package/dist/contracts/content-program.d.ts +994 -0
  56. package/dist/contracts/content-program.js +658 -0
  57. package/dist/contracts/content-sync.d.ts +290 -0
  58. package/dist/contracts/content-sync.js +167 -0
  59. package/dist/contracts/content.d.ts +432 -0
  60. package/dist/contracts/content.js +303 -0
  61. package/dist/contracts/continuation.d.ts +17 -1
  62. package/dist/contracts/continuation.js +23 -23
  63. package/dist/contracts/countries.js +3 -4
  64. package/dist/contracts/crons.d.ts +17 -0
  65. package/dist/contracts/crons.js +33 -15
  66. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  67. package/dist/contracts/dashboard-prefs.js +51 -0
  68. package/dist/contracts/device-auth.d.ts +234 -37
  69. package/dist/contracts/device-auth.js +267 -53
  70. package/dist/contracts/docs.d.ts +6 -10
  71. package/dist/contracts/docs.js +5 -13
  72. package/dist/contracts/domains.d.ts +499 -102
  73. package/dist/contracts/domains.js +169 -58
  74. package/dist/contracts/email-preferences.d.ts +3 -3
  75. package/dist/contracts/email-preferences.js +6 -7
  76. package/dist/contracts/enums.d.ts +26 -26
  77. package/dist/contracts/enums.js +61 -54
  78. package/dist/contracts/error-code-meta.d.ts +269 -7
  79. package/dist/contracts/error-code-meta.js +80 -5
  80. package/dist/contracts/error-codes.d.ts +5 -5
  81. package/dist/contracts/error-codes.js +78 -16
  82. package/dist/contracts/events.d.ts +100 -20
  83. package/dist/contracts/events.js +107 -20
  84. package/dist/contracts/execution.d.ts +47 -66
  85. package/dist/contracts/execution.js +51 -64
  86. package/dist/contracts/feature-lifecycle.d.ts +70 -14
  87. package/dist/contracts/feature-lifecycle.js +86 -15
  88. package/dist/contracts/features.d.ts +100 -37
  89. package/dist/contracts/features.js +21 -27
  90. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  91. package/dist/contracts/frame-session.d.ts +192 -0
  92. package/dist/contracts/frame-session.js +164 -0
  93. package/dist/contracts/functions.d.ts +218 -211
  94. package/dist/contracts/functions.js +273 -260
  95. package/dist/contracts/grant-copy.d.ts +43 -0
  96. package/dist/contracts/grant-copy.js +44 -0
  97. package/dist/contracts/grants.d.ts +64 -56
  98. package/dist/contracts/grants.js +124 -23
  99. package/dist/contracts/ids.d.ts +4 -1
  100. package/dist/contracts/ids.js +4 -1
  101. package/dist/contracts/internal.d.ts +5 -4
  102. package/dist/contracts/internal.js +12 -3
  103. package/dist/contracts/mcp.d.ts +17 -0
  104. package/dist/contracts/mcp.js +23 -0
  105. package/dist/contracts/me.d.ts +6 -1
  106. package/dist/contracts/me.js +12 -6
  107. package/dist/contracts/notifications.d.ts +27 -29
  108. package/dist/contracts/notifications.js +9 -4
  109. package/dist/contracts/oauth-resources.d.ts +112 -10
  110. package/dist/contracts/oauth-resources.js +116 -11
  111. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  112. package/dist/contracts/oauth-scope-actions.js +126 -0
  113. package/dist/contracts/operations.d.ts +27 -4
  114. package/dist/contracts/operations.js +11 -5
  115. package/dist/contracts/pages.d.ts +29 -5
  116. package/dist/contracts/pages.js +22 -5
  117. package/dist/contracts/partner-notifications.d.ts +3 -0
  118. package/dist/contracts/partner-notifications.js +65 -0
  119. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  120. package/dist/contracts/{platform.js → partner.js} +27 -40
  121. package/dist/contracts/plan-policy.d.ts +1 -1
  122. package/dist/contracts/principal-assertion.d.ts +43 -0
  123. package/dist/contracts/principal-assertion.js +67 -0
  124. package/dist/contracts/principals.d.ts +73 -0
  125. package/dist/contracts/principals.js +59 -0
  126. package/dist/contracts/privacy.d.ts +11 -0
  127. package/dist/contracts/privacy.js +17 -0
  128. package/dist/contracts/problem-document.js +3 -4
  129. package/dist/contracts/publish-archive.d.ts +116 -18
  130. package/dist/contracts/publish-archive.js +6 -3
  131. package/dist/contracts/push-new.d.ts +4 -4
  132. package/dist/contracts/quotas.js +3 -3
  133. package/dist/contracts/realtime.d.ts +52 -0
  134. package/dist/contracts/realtime.js +54 -0
  135. package/dist/contracts/repository-connections.d.ts +1 -1
  136. package/dist/contracts/repository-connections.js +6 -2
  137. package/dist/contracts/resources.d.ts +105 -14
  138. package/dist/contracts/resources.js +145 -21
  139. package/dist/contracts/route-inventory.d.ts +358 -0
  140. package/dist/contracts/route-inventory.js +141 -0
  141. package/dist/contracts/runtime-api.d.ts +112 -35
  142. package/dist/contracts/runtime-api.js +86 -66
  143. package/dist/contracts/runtime-app.d.ts +11 -21
  144. package/dist/contracts/runtime-app.js +39 -24
  145. package/dist/contracts/runtime-components.d.ts +143 -0
  146. package/dist/contracts/runtime-components.js +199 -0
  147. package/dist/contracts/runtime-db.d.ts +45 -19
  148. package/dist/contracts/runtime-db.js +85 -20
  149. package/dist/contracts/runtime-purge.js +3 -5
  150. package/dist/contracts/runtime-services.d.ts +43 -75
  151. package/dist/contracts/runtime-services.js +29 -49
  152. package/dist/contracts/runtime-storage.d.ts +14 -14
  153. package/dist/contracts/runtime-storage.js +28 -13
  154. package/dist/contracts/sf-config-v1.d.ts +14 -18
  155. package/dist/contracts/slugs.js +13 -4
  156. package/dist/contracts/space-config.d.ts +235 -28
  157. package/dist/contracts/space-config.js +246 -91
  158. package/dist/contracts/spaces.d.ts +360 -255
  159. package/dist/contracts/spaces.js +190 -122
  160. package/dist/contracts/superadmin-activity.d.ts +3 -43
  161. package/dist/contracts/superadmin-activity.js +6 -30
  162. package/dist/contracts/superadmin-emails.d.ts +1 -0
  163. package/dist/contracts/superadmin-emails.js +17 -1
  164. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  165. package/dist/contracts/superadmin-runtime.js +141 -0
  166. package/dist/contracts/superadmin-search.d.ts +22 -2
  167. package/dist/contracts/superadmin-search.js +14 -6
  168. package/dist/contracts/superadmin-spaces.d.ts +435 -186
  169. package/dist/contracts/superadmin-spaces.js +131 -25
  170. package/dist/contracts/superadmin-teams.d.ts +3 -0
  171. package/dist/contracts/superadmin-teams.js +1 -2
  172. package/dist/contracts/superadmin-tenants.d.ts +627 -6
  173. package/dist/contracts/superadmin-tenants.js +32 -7
  174. package/dist/contracts/superadmin.d.ts +98 -16
  175. package/dist/contracts/superadmin.js +63 -10
  176. package/dist/contracts/tags.d.ts +85 -58
  177. package/dist/contracts/tags.js +44 -34
  178. package/dist/contracts/teams.d.ts +72 -9
  179. package/dist/contracts/teams.js +84 -25
  180. package/dist/contracts/tenants.d.ts +135 -0
  181. package/dist/contracts/tenants.js +120 -0
  182. package/dist/contracts/test-triggers.d.ts +70 -0
  183. package/dist/contracts/test-triggers.js +116 -0
  184. package/dist/contracts/theme-json.js +3 -8
  185. package/dist/contracts/transfers.d.ts +1 -0
  186. package/dist/contracts/transfers.js +1 -0
  187. package/dist/contracts/usage.d.ts +209 -0
  188. package/dist/contracts/usage.js +124 -12
  189. package/dist/contracts/variables.d.ts +2 -2
  190. package/dist/contracts/variables.js +9 -13
  191. package/dist/contracts/webhooks.d.ts +13 -5
  192. package/dist/contracts/webhooks.js +3 -1
  193. package/dist/contracts/zero.d.ts +57 -64
  194. package/dist/contracts/zero.js +68 -66
  195. package/dist/dashboard-paths/index.d.ts +24 -21
  196. package/dist/dashboard-paths/index.js +35 -47
  197. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  198. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  199. package/dist/docs/agent-arrival.d.ts +92 -0
  200. package/dist/docs/agent-arrival.js +227 -0
  201. package/dist/docs/agent-output-policy.d.ts +6 -0
  202. package/dist/docs/agent-output-policy.js +22 -0
  203. package/dist/docs/agent-prose.d.ts +11 -17
  204. package/dist/docs/agent-prose.js +62 -37
  205. package/dist/docs/agent-setup.d.ts +72 -41
  206. package/dist/docs/agent-setup.js +336 -436
  207. package/dist/docs/catalog.d.ts +147 -89
  208. package/dist/docs/catalog.js +157 -42
  209. package/dist/docs/error-docs.d.ts +2098 -1
  210. package/dist/docs/error-docs.js +281 -16
  211. package/dist/docs/index-build.d.ts +0 -1
  212. package/dist/docs/index-build.js +2 -3
  213. package/dist/docs/page-context-prompt.d.ts +77 -0
  214. package/dist/docs/page-context-prompt.js +131 -0
  215. package/dist/docs/reference-urls.d.ts +46 -0
  216. package/dist/docs/reference-urls.js +79 -0
  217. package/dist/docs/search.d.ts +6 -8
  218. package/dist/docs/search.js +10 -13
  219. package/dist/docs/skill-distribution.d.ts +4 -1
  220. package/dist/docs/skill-distribution.js +10 -5
  221. package/dist/docs/skills.d.ts +117 -117
  222. package/dist/docs/skills.js +120 -72
  223. package/dist/docs/start-prompts.d.ts +45 -0
  224. package/dist/docs/start-prompts.js +62 -0
  225. package/dist/domain-exploration.js +9 -13
  226. package/dist/og-template.d.ts +56 -0
  227. package/dist/og-template.js +56 -0
  228. package/dist/slug-policy/index.js +5 -11
  229. package/dist/utils/browser-credential.d.ts +13 -6
  230. package/dist/utils/browser-credential.js +14 -7
  231. package/dist/utils/build-settings.d.ts +16 -0
  232. package/dist/utils/build-settings.js +63 -17
  233. package/dist/utils/canonical-json.d.ts +3 -5
  234. package/dist/utils/canonical-json.js +3 -5
  235. package/dist/utils/cast-transport.d.ts +5 -17
  236. package/dist/utils/cast-transport.js +6 -19
  237. package/dist/utils/claim-token.js +1 -2
  238. package/dist/utils/comment-avatars.js +4 -6
  239. package/dist/utils/concurrency.js +2 -3
  240. package/dist/utils/content-type.d.ts +7 -6
  241. package/dist/utils/content-type.js +73 -51
  242. package/dist/utils/credential-policy.d.ts +50 -6
  243. package/dist/utils/credential-policy.js +123 -57
  244. package/dist/utils/egress-policy.fixtures.json +1 -1
  245. package/dist/utils/generate-space-name.d.ts +3 -8
  246. package/dist/utils/generate-space-name.js +3 -8
  247. package/dist/utils/grants.d.ts +0 -1
  248. package/dist/utils/grants.js +4 -7
  249. package/dist/utils/gravatar.d.ts +2 -4
  250. package/dist/utils/gravatar.js +6 -12
  251. package/dist/utils/id-hints.js +14 -23
  252. package/dist/utils/idempotency.d.ts +3 -3
  253. package/dist/utils/idempotency.js +6 -7
  254. package/dist/utils/local-space-state.d.ts +15 -15
  255. package/dist/utils/local-space-state.js +34 -23
  256. package/dist/utils/oauth-signed-query.d.ts +3 -5
  257. package/dist/utils/oauth-signed-query.js +6 -9
  258. package/dist/utils/one-shot-replay.d.ts +3 -5
  259. package/dist/utils/one-shot-replay.js +3 -5
  260. package/dist/utils/page-colors.d.ts +4 -10
  261. package/dist/utils/page-colors.js +11 -35
  262. package/dist/utils/page-fonts.js +6 -11
  263. package/dist/utils/page-preview.d.ts +0 -1
  264. package/dist/utils/page-preview.js +0 -1
  265. package/dist/utils/pages.d.ts +22 -11
  266. package/dist/utils/pages.js +70 -30
  267. package/dist/utils/privacy-regions.d.ts +19 -0
  268. package/dist/utils/privacy-regions.js +91 -0
  269. package/dist/utils/publish-form-data.d.ts +4 -5
  270. package/dist/utils/publish-form-data.js +2 -3
  271. package/dist/utils/publish-policy.d.ts +10 -23
  272. package/dist/utils/publish-policy.js +63 -116
  273. package/dist/utils/query-client.d.ts +2 -0
  274. package/dist/utils/query-client.js +10 -1
  275. package/dist/utils/runtime-paths.d.ts +4 -4
  276. package/dist/utils/runtime-paths.js +6 -8
  277. package/dist/utils/runtime-upload.d.ts +4 -0
  278. package/dist/utils/runtime-upload.js +5 -0
  279. package/dist/utils/secure-local-file.d.ts +3 -3
  280. package/dist/utils/secure-local-file.js +18 -24
  281. package/dist/utils/space-config.d.ts +11 -14
  282. package/dist/utils/space-config.js +10 -16
  283. package/dist/utils/static-runtime-policy.d.ts +5 -8
  284. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  285. package/dist/utils/static-runtime-policy.generated.js +70 -0
  286. package/dist/utils/static-runtime-policy.js +17 -84
  287. package/dist/utils/storage-policy.js +1 -2
  288. package/dist/utils/upload-session.js +8 -14
  289. package/dist/utils/version-path.js +11 -19
  290. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  291. package/dist/utils/wpcom-auth-redirects.js +1 -4
  292. package/dist/vocabulary.d.ts +7 -7
  293. package/dist/vocabulary.js +30 -16
  294. package/package.json +14 -2
  295. package/dist/agents/client-registry.d.ts +0 -22
  296. package/dist/agents/client-registry.js +0 -41
  297. package/dist/docs/agent-handoff-document.d.ts +0 -15
  298. package/dist/docs/agent-handoff-document.js +0 -180
  299. package/dist/docs/agent-solutions.d.ts +0 -110
  300. package/dist/docs/agent-solutions.js +0 -183
  301. package/dist/utils/query-keys.d.ts +0 -84
  302. package/dist/utils/query-keys.js +0 -108
@@ -65,13 +65,25 @@ export declare const EVENT_CATALOG: {
65
65
  path: z.ZodString;
66
66
  }, z.core.$strict>;
67
67
  };
68
- "cli.command.completed": {
68
+ "cli.agent_tooling.outcome": {
69
69
  sources: "cli"[];
70
- actors: "anonymous_machine"[];
70
+ actors: "system"[];
71
71
  properties: z.ZodObject<{
72
- command: z.ZodString;
73
- version: z.ZodString;
74
- error_class: z.ZodOptional<z.ZodString>;
72
+ event: z.ZodEnum<{
73
+ install: "install";
74
+ setup: "setup";
75
+ }>;
76
+ agentId: z.ZodString;
77
+ method: z.ZodString;
78
+ outcome: z.ZodEnum<{
79
+ failed: "failed";
80
+ skipped: "skipped";
81
+ installed: "installed";
82
+ }>;
83
+ reasonCode: z.ZodString;
84
+ cliVersion: z.ZodString;
85
+ os: z.ZodString;
86
+ timestamp: z.ZodString;
75
87
  }, z.core.$strict>;
76
88
  };
77
89
  "browser.funnel.claim_page_viewed": {
@@ -89,15 +101,44 @@ export declare const EVENT_CATALOG: {
89
101
  actors: ("analytics_id" | "anonymous_id")[];
90
102
  properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
91
103
  };
92
- "browser.funnel.claim_rescue_countdown_viewed": {
93
- sources: ("www" | "dashboard")[];
104
+ "browser.funnel.start_step_viewed": {
105
+ sources: "dashboard"[];
94
106
  actors: ("analytics_id" | "anonymous_id")[];
95
- properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
107
+ properties: z.ZodObject<{
108
+ mode: z.ZodEnum<{
109
+ start: "start";
110
+ "new-space": "new-space";
111
+ }>;
112
+ step: z.ZodString;
113
+ signed_in: z.ZodBoolean;
114
+ }, z.core.$strict>;
96
115
  };
97
- "browser.funnel.claim_reminder_requested": {
98
- sources: ("www" | "dashboard")[];
116
+ "browser.funnel.start_option_chosen": {
117
+ sources: "dashboard"[];
99
118
  actors: ("analytics_id" | "anonymous_id")[];
100
- properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
119
+ properties: z.ZodObject<{
120
+ mode: z.ZodEnum<{
121
+ start: "start";
122
+ "new-space": "new-space";
123
+ }>;
124
+ step: z.ZodString;
125
+ option_id: z.ZodString;
126
+ option_kind: z.ZodString;
127
+ }, z.core.$strict>;
128
+ };
129
+ "browser.funnel.start_prompt_copied": {
130
+ sources: "dashboard"[];
131
+ actors: ("analytics_id" | "anonymous_id")[];
132
+ properties: z.ZodObject<{
133
+ mode: z.ZodEnum<{
134
+ start: "start";
135
+ "new-space": "new-space";
136
+ }>;
137
+ step: z.ZodString;
138
+ agent_id: z.ZodNullable<z.ZodString>;
139
+ credentialed: z.ZodBoolean;
140
+ handoff_id: z.ZodNullable<z.ZodString>;
141
+ }, z.core.$strict>;
101
142
  };
102
143
  "domain.search.session_started": {
103
144
  sources: "domain-ssh"[];
@@ -242,6 +283,36 @@ export declare const EVENT_CATALOG: {
242
283
  operation_id: z.ZodString;
243
284
  }, z.core.$strict>;
244
285
  };
286
+ "auth.agent_handoff.redeemed": {
287
+ sources: "control-plane"[];
288
+ actors: ("system" | "analytics_id" | "anonymous_id")[];
289
+ properties: z.ZodObject<{
290
+ handoff_id: z.ZodString;
291
+ kind: z.ZodEnum<{
292
+ space: "space";
293
+ page_context: "page_context";
294
+ }>;
295
+ client_target: z.ZodString;
296
+ team_id: z.ZodString;
297
+ space_id: z.ZodNullable<z.ZodString>;
298
+ }, z.core.$strict>;
299
+ };
300
+ "auth.agent_handoff.fetched": {
301
+ sources: "control-plane"[];
302
+ actors: "system"[];
303
+ properties: z.ZodObject<{
304
+ handoff_id: z.ZodString;
305
+ space_id: z.ZodNullable<z.ZodString>;
306
+ kind: z.ZodEnum<{
307
+ space: "space";
308
+ anonymous: "anonymous";
309
+ page_context: "page_context";
310
+ }>;
311
+ client_target: z.ZodNullable<z.ZodString>;
312
+ team_id: z.ZodNullable<z.ZodString>;
313
+ fetch_count: z.ZodNumber;
314
+ }, z.core.$strict>;
315
+ };
245
316
  "feature.blocked": {
246
317
  sources: "control-plane"[];
247
318
  actors: ("system" | "analytics_id" | "anonymous_id")[];
@@ -269,12 +340,13 @@ export declare const eventNameSchema: z.ZodEnum<{
269
340
  "client.page_viewed": "client.page_viewed";
270
341
  "client.web_vital.measured": "client.web_vital.measured";
271
342
  "client.error.observed": "client.error.observed";
272
- "cli.command.completed": "cli.command.completed";
343
+ "cli.agent_tooling.outcome": "cli.agent_tooling.outcome";
273
344
  "browser.funnel.claim_page_viewed": "browser.funnel.claim_page_viewed";
274
345
  "browser.funnel.claim_token_validated": "browser.funnel.claim_token_validated";
275
346
  "browser.funnel.space_claimed": "browser.funnel.space_claimed";
276
- "browser.funnel.claim_rescue_countdown_viewed": "browser.funnel.claim_rescue_countdown_viewed";
277
- "browser.funnel.claim_reminder_requested": "browser.funnel.claim_reminder_requested";
347
+ "browser.funnel.start_step_viewed": "browser.funnel.start_step_viewed";
348
+ "browser.funnel.start_option_chosen": "browser.funnel.start_option_chosen";
349
+ "browser.funnel.start_prompt_copied": "browser.funnel.start_prompt_copied";
278
350
  "domain.search.session_started": "domain.search.session_started";
279
351
  "domain.search.session_ended": "domain.search.session_ended";
280
352
  "domain.search.lookup_requested": "domain.search.lookup_requested";
@@ -282,6 +354,8 @@ export declare const eventNameSchema: z.ZodEnum<{
282
354
  "version.intent.created": "version.intent.created";
283
355
  "version.finalize.queued": "version.finalize.queued";
284
356
  "version.promote.queued": "version.promote.queued";
357
+ "auth.agent_handoff.redeemed": "auth.agent_handoff.redeemed";
358
+ "auth.agent_handoff.fetched": "auth.agent_handoff.fetched";
285
359
  "feature.blocked": "feature.blocked";
286
360
  "abuse.limit_tripped": "abuse.limit_tripped";
287
361
  }>;
@@ -292,12 +366,13 @@ export declare const eventPayloadSchema: z.ZodObject<{
292
366
  "client.page_viewed": "client.page_viewed";
293
367
  "client.web_vital.measured": "client.web_vital.measured";
294
368
  "client.error.observed": "client.error.observed";
295
- "cli.command.completed": "cli.command.completed";
369
+ "cli.agent_tooling.outcome": "cli.agent_tooling.outcome";
296
370
  "browser.funnel.claim_page_viewed": "browser.funnel.claim_page_viewed";
297
371
  "browser.funnel.claim_token_validated": "browser.funnel.claim_token_validated";
298
372
  "browser.funnel.space_claimed": "browser.funnel.space_claimed";
299
- "browser.funnel.claim_rescue_countdown_viewed": "browser.funnel.claim_rescue_countdown_viewed";
300
- "browser.funnel.claim_reminder_requested": "browser.funnel.claim_reminder_requested";
373
+ "browser.funnel.start_step_viewed": "browser.funnel.start_step_viewed";
374
+ "browser.funnel.start_option_chosen": "browser.funnel.start_option_chosen";
375
+ "browser.funnel.start_prompt_copied": "browser.funnel.start_prompt_copied";
301
376
  "domain.search.session_started": "domain.search.session_started";
302
377
  "domain.search.session_ended": "domain.search.session_ended";
303
378
  "domain.search.lookup_requested": "domain.search.lookup_requested";
@@ -305,6 +380,8 @@ export declare const eventPayloadSchema: z.ZodObject<{
305
380
  "version.intent.created": "version.intent.created";
306
381
  "version.finalize.queued": "version.finalize.queued";
307
382
  "version.promote.queued": "version.promote.queued";
383
+ "auth.agent_handoff.redeemed": "auth.agent_handoff.redeemed";
384
+ "auth.agent_handoff.fetched": "auth.agent_handoff.fetched";
308
385
  "feature.blocked": "feature.blocked";
309
386
  "abuse.limit_tripped": "abuse.limit_tripped";
310
387
  }>;
@@ -354,12 +431,13 @@ export declare const eventIngestSchema: z.ZodObject<{
354
431
  "client.page_viewed": "client.page_viewed";
355
432
  "client.web_vital.measured": "client.web_vital.measured";
356
433
  "client.error.observed": "client.error.observed";
357
- "cli.command.completed": "cli.command.completed";
434
+ "cli.agent_tooling.outcome": "cli.agent_tooling.outcome";
358
435
  "browser.funnel.claim_page_viewed": "browser.funnel.claim_page_viewed";
359
436
  "browser.funnel.claim_token_validated": "browser.funnel.claim_token_validated";
360
437
  "browser.funnel.space_claimed": "browser.funnel.space_claimed";
361
- "browser.funnel.claim_rescue_countdown_viewed": "browser.funnel.claim_rescue_countdown_viewed";
362
- "browser.funnel.claim_reminder_requested": "browser.funnel.claim_reminder_requested";
438
+ "browser.funnel.start_step_viewed": "browser.funnel.start_step_viewed";
439
+ "browser.funnel.start_option_chosen": "browser.funnel.start_option_chosen";
440
+ "browser.funnel.start_prompt_copied": "browser.funnel.start_prompt_copied";
363
441
  "domain.search.session_started": "domain.search.session_started";
364
442
  "domain.search.session_ended": "domain.search.session_ended";
365
443
  "domain.search.lookup_requested": "domain.search.lookup_requested";
@@ -367,6 +445,8 @@ export declare const eventIngestSchema: z.ZodObject<{
367
445
  "version.intent.created": "version.intent.created";
368
446
  "version.finalize.queued": "version.finalize.queued";
369
447
  "version.promote.queued": "version.promote.queued";
448
+ "auth.agent_handoff.redeemed": "auth.agent_handoff.redeemed";
449
+ "auth.agent_handoff.fetched": "auth.agent_handoff.fetched";
370
450
  "feature.blocked": "feature.blocked";
371
451
  "abuse.limit_tripped": "abuse.limit_tripped";
372
452
  }>;
@@ -68,18 +68,16 @@ const webVitalPropertiesSchema = z
68
68
  path: pathSchema,
69
69
  })
70
70
  .strict();
71
- // An uncaught browser error is not a single label — `error.name` is "Error" for
72
- // almost every application throw, so a one-field shape both fails to attribute
73
- // and (because it feeds the sender's dedupe key) suppresses genuinely distinct
74
- // errors. Model the fingerprint instead: signal kind, thrown-value class,
75
- // redacted message, top frames, and a deterministic grouping key. Every string
76
- // stays within `propertyValueSchema`'s 512-char cap — the generic property bag
71
+ // `error.name` is "Error" for almost every application throw, so a one-field
72
+ // shape cannot attribute the error and, since it feeds the sender's dedupe key,
73
+ // suppresses distinct errors. Model the fingerprint instead. Every string stays
74
+ // within `propertyValueSchema`'s 512-char cap: the generic property bag
77
75
  // validates alongside this schema, so a longer field would 400 at ingest.
78
76
  const clientErrorPropertiesSchema = z
79
77
  .object({
80
78
  kind: z
81
79
  .enum(["uncaught_exception", "unhandled_rejection"])
82
- .describe("Which browser signal produced this orthogonal to what was thrown."),
80
+ .describe("Which browser signal produced the event. Orthogonal to what was thrown."),
83
81
  error_class: z
84
82
  .string()
85
83
  .min(1)
@@ -102,14 +100,88 @@ const clientErrorPropertiesSchema = z
102
100
  path: pathSchema,
103
101
  })
104
102
  .strict();
105
- const cliCommandPropertiesSchema = z
103
+ const cliAgentToolingPropertiesSchema = z
106
104
  .object({
107
- command: z.string().min(1).max(128),
108
- version: z.string().min(1).max(64),
109
- error_class: z.string().min(1).max(128).optional(),
105
+ event: z.enum(["install", "setup"]),
106
+ agentId: z.string().min(1).max(128),
107
+ method: z.string().min(1).max(128),
108
+ outcome: z.enum(["installed", "skipped", "failed"]),
109
+ reasonCode: z.string().min(1).max(128),
110
+ cliVersion: z.string().min(1).max(64),
111
+ os: z.string().min(1).max(64),
112
+ timestamp: z.string().datetime(),
110
113
  })
111
114
  .strict();
112
115
  const browserFunnelPropertiesSchema = propertyBagSchema.default({});
116
+ // The /start funnel — prompt copied → handoff fetched → handoff redeemed —
117
+ // followed across the browser and the control plane. `/start` runs signed out,
118
+ // so the join keys are ids that are safe to hold in analytics: `handoff_id` is
119
+ // the non-secret ledger id. The handoff URL, its UUID bearer, and any minted
120
+ // credential NEVER appear here — every shape
121
+ // below is strict, so a sender that adds one is rejected at ingest.
122
+ const startFunnelModeSchema = z
123
+ .enum(["start", "new-space"])
124
+ .describe("Which entry point the visitor is in: first-run /start, or new-space inside a team.");
125
+ const startFunnelStepSchema = z.string().min(1).max(64);
126
+ const startFunnelAgentIdSchema = z
127
+ .string()
128
+ .min(1)
129
+ .max(128)
130
+ .nullable()
131
+ .describe("Agent the visitor picked, or null before a pick.");
132
+ const startFunnelHandoffIdSchema = z
133
+ .string()
134
+ .min(1)
135
+ .max(128)
136
+ .nullable()
137
+ .describe("Non-secret agent-handoff ledger id; null when the prompt carries no credential.");
138
+ const startFunnelCredentialedSchema = z
139
+ .boolean()
140
+ .describe("Whether the copied prompt carried a handoff, not what the handoff was.");
141
+ const startStepViewedPropertiesSchema = z
142
+ .object({
143
+ mode: startFunnelModeSchema,
144
+ step: startFunnelStepSchema,
145
+ signed_in: z.boolean(),
146
+ })
147
+ .strict();
148
+ const startOptionChosenPropertiesSchema = z
149
+ .object({
150
+ mode: startFunnelModeSchema,
151
+ step: startFunnelStepSchema,
152
+ option_id: z.string().min(1).max(128),
153
+ option_kind: z.string().min(1).max(64),
154
+ })
155
+ .strict();
156
+ const startPromptCopiedPropertiesSchema = z
157
+ .object({
158
+ mode: startFunnelModeSchema,
159
+ step: startFunnelStepSchema,
160
+ agent_id: startFunnelAgentIdSchema,
161
+ credentialed: startFunnelCredentialedSchema,
162
+ handoff_id: startFunnelHandoffIdSchema,
163
+ })
164
+ .strict();
165
+ const agentHandoffRedeemedPropertiesSchema = z
166
+ .object({
167
+ handoff_id: z.string().min(1).max(128),
168
+ kind: z.enum(["space", "page_context"]),
169
+ client_target: z.string().min(1).max(128),
170
+ team_id: z.string().min(1).max(128),
171
+ space_id: z.string().min(1).max(128).nullable(),
172
+ })
173
+ .strict();
174
+ // Fetching is the one handoff event an `anonymous` handoff can produce: it has
175
+ // no team, no Space, and no chosen client, so those join keys are nullable here
176
+ // and never nullable on redemption, which anonymous handoffs cannot reach.
177
+ const agentHandoffFetchedPropertiesSchema = agentHandoffRedeemedPropertiesSchema
178
+ .extend({
179
+ kind: z.enum(["space", "page_context", "anonymous"]),
180
+ client_target: z.string().min(1).max(128).nullable(),
181
+ team_id: z.string().min(1).max(128).nullable(),
182
+ fetch_count: z.number().int().positive(),
183
+ })
184
+ .strict();
113
185
  const domainSearchPropertiesSchema = z
114
186
  .object({
115
187
  action: z.enum(["suggestions", "availability", "whois"]).nullable().optional(),
@@ -216,10 +288,10 @@ export const EVENT_CATALOG = {
216
288
  actors: ["analytics_id", "anonymous_id"],
217
289
  properties: clientErrorPropertiesSchema,
218
290
  },
219
- "cli.command.completed": {
291
+ "cli.agent_tooling.outcome": {
220
292
  sources: ["cli"],
221
- actors: ["anonymous_machine"],
222
- properties: cliCommandPropertiesSchema,
293
+ actors: ["system"],
294
+ properties: cliAgentToolingPropertiesSchema,
223
295
  },
224
296
  "browser.funnel.claim_page_viewed": {
225
297
  sources: ["dashboard", "www"],
@@ -236,15 +308,20 @@ export const EVENT_CATALOG = {
236
308
  actors: ["analytics_id", "anonymous_id"],
237
309
  properties: browserFunnelPropertiesSchema,
238
310
  },
239
- "browser.funnel.claim_rescue_countdown_viewed": {
240
- sources: ["dashboard", "www"],
311
+ "browser.funnel.start_step_viewed": {
312
+ sources: ["dashboard"],
241
313
  actors: ["analytics_id", "anonymous_id"],
242
- properties: browserFunnelPropertiesSchema,
314
+ properties: startStepViewedPropertiesSchema,
243
315
  },
244
- "browser.funnel.claim_reminder_requested": {
245
- sources: ["dashboard", "www"],
316
+ "browser.funnel.start_option_chosen": {
317
+ sources: ["dashboard"],
246
318
  actors: ["analytics_id", "anonymous_id"],
247
- properties: browserFunnelPropertiesSchema,
319
+ properties: startOptionChosenPropertiesSchema,
320
+ },
321
+ "browser.funnel.start_prompt_copied": {
322
+ sources: ["dashboard"],
323
+ actors: ["analytics_id", "anonymous_id"],
324
+ properties: startPromptCopiedPropertiesSchema,
248
325
  },
249
326
  "domain.search.session_started": {
250
327
  sources: ["domain-ssh"],
@@ -281,6 +358,16 @@ export const EVENT_CATALOG = {
281
358
  actors: ["analytics_id", "anonymous_id", "system"],
282
359
  properties: versionPromotePropertiesSchema,
283
360
  },
361
+ "auth.agent_handoff.redeemed": {
362
+ sources: ["control-plane"],
363
+ actors: ["analytics_id", "anonymous_id", "system"],
364
+ properties: agentHandoffRedeemedPropertiesSchema,
365
+ },
366
+ "auth.agent_handoff.fetched": {
367
+ sources: ["control-plane"],
368
+ actors: ["system"],
369
+ properties: agentHandoffFetchedPropertiesSchema,
370
+ },
284
371
  "feature.blocked": {
285
372
  sources: ["control-plane"],
286
373
  actors: ["analytics_id", "anonymous_id", "system"],
@@ -1,38 +1,28 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * The platform execution layer: everything true of running tenant code on
4
- * Spacefast regardless of which product is running it.
4
+ * Spacefast, regardless of which product runs it.
5
5
  *
6
- * Two products sit on top of this file, and they are genuinely different
7
- * things rather than two configurations of one thing:
8
- *
9
- * - **Zero** (`./zero.js`) runs capsules — schema, queries, mutations and
10
- * endpoints that share one parent-owned transaction — in the native runner
11
- * on a dedicated wp.cloud site, next to that site's MySQL.
6
+ * - **Zero** (`./zero.js`) runs capsules in the native runner on a dedicated
7
+ * wp.cloud site, next to that site's MySQL. A capsule is a schema, queries,
8
+ * mutations and endpoints sharing one parent-owned transaction.
12
9
  * - **Functions** (`./functions.js`) runs workers on Cloudflare Workers for
13
- * Platforms, carrying npm and framework output that we could never sandbox
14
- * as well ourselves.
10
+ * Platforms, carrying npm and framework output we could not sandbox as well
11
+ * ourselves.
15
12
  *
16
- * The only surface both can host is an endpoint that touches neither the
17
- * database, the caller's identity, nor realtime see `endpointIsPortable`.
18
- * That is the portable seam, and it is deliberately narrow: a capsule
19
- * handler's semantics depend on the transaction wrapped around it, which does
20
- * not exist on an isolate a continent away from the database.
13
+ * The only surface both can host is an endpoint touching neither the database,
14
+ * the caller's identity, nor realtime. See `endpointIsPortable`.
21
15
  *
22
- * Neither is a "kind" a space declares. Every space owns a site, so what runs
23
- * is a routing decision derived from what the published tree carries: static
24
- * files, a worker, a capsule, or any mix of the three in one publish. There is
25
- * no enum here to disagree with the tree.
16
+ * Neither is a "kind" a space declares. What runs is a routing decision derived
17
+ * from what the published tree carries, so there is no enum here to disagree
18
+ * with the tree.
26
19
  */
27
20
  /**
28
- * How a live runtime delivers realtime invalidations.
29
- *
30
- * One vocabulary end to end: the finalize payload, the client config a serving
31
- * runtime hands the browser, and every API response all name the transport
32
- * with these three values. `central` is the hosted relay, `cast` is the
33
- * collaboration service, and `local` is a dev machine serving its own socket —
34
- * a distinction a customer can act on, unlike the component names the transports
35
- * used to be called after.
21
+ * How a live runtime delivers realtime invalidations. One vocabulary end to
22
+ * end: the finalize payload, the client config handed to the browser, and every
23
+ * API response name the transport with these three values. `central` is the
24
+ * hosted relay, `cast` is the collaboration service, `local` is a dev machine
25
+ * serving its own socket.
36
26
  */
37
27
  export declare const RUNTIME_REALTIME_MODES: readonly ["central", "cast", "local"];
38
28
  export declare const runtimeRealtimeModeSchema: z.ZodEnum<{
@@ -62,13 +52,13 @@ export declare const SERVER_ENV_FILES: readonly [".env.server", ".env.lakebed.se
62
52
  export declare const EXECUTION_ENV_RESERVED_PREFIXES: readonly ["SPACEFAST_", "ZERO_"];
63
53
  /** Paths the platform owns on every space, whatever the product. */
64
54
  export declare const PLATFORM_ROUTE_PREFIX = "/__spacefast";
55
+ /** Runtime-owned files that travel inside a version but are never tenant files. */
56
+ export declare function runtimeInternalArtifactPath(path: string): boolean;
65
57
  /**
66
- * First path segments the platform claims. Matched as segment prefixes rather
67
- * than whole segments because the runtime already reserves the whole family —
68
- * `/__stattic_probe` is a live serving path, and `upload-policy.php` refuses
69
- * any first segment starting with either of these. Encoding it the same way
70
- * here keeps a capsule or worker from declaring a route the origin would
71
- * intercept before it ever reached them.
58
+ * First path segments the platform claims. Matched as segment prefixes, not
59
+ * whole segments: `/__stattic_probe` is a live serving path, and
60
+ * `upload-policy.php` refuses any first segment starting with one of these. A
61
+ * capsule or worker must not declare a route the origin would intercept first.
72
62
  */
73
63
  export declare const PLATFORM_RESERVED_ROUTE_SEGMENT_PREFIXES: readonly ["__spacefast", "__stattic", "__span"];
74
64
  export declare const executionSha256Schema: z.ZodString;
@@ -76,11 +66,11 @@ export declare const executionBase64Schema: z.ZodString;
76
66
  export declare const executionIdentifierSchema: z.ZodString;
77
67
  export declare const executionEnvNameSchema: z.ZodString;
78
68
  /**
79
- * Builds the route-path schema for a product. Structural rules — normalization,
80
- * traversal, wildcards, the platform's own prefixes are identical everywhere
81
- * and live here. Each product passes the extra paths and prefixes its own app
82
- * shell claims, because those differ: Zero's client router owns `/auth/*`,
83
- * a Functions worker owns nothing beyond what the platform reserves.
69
+ * Builds the route-path schema for a product. The structural rules are
70
+ * identical everywhere and live here: normalization, traversal, wildcards, and
71
+ * the platform's own prefixes. Each product passes the extra paths and prefixes
72
+ * its own app shell claims, because those differ: Zero's client router owns
73
+ * `/auth/*`, a Functions worker owns nothing beyond what the platform reserves.
84
74
  */
85
75
  export declare function appRoutePathSchema(options: {
86
76
  subject: string;
@@ -112,38 +102,30 @@ export declare const executionCapabilitiesSchema: z.ZodDefault<z.ZodObject<{
112
102
  gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
113
103
  spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
114
104
  email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
105
+ content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
115
106
  }, z.core.$strip>>;
116
107
  export type ExecutionCapabilities = z.infer<typeof executionCapabilitiesSchema>;
117
108
  /**
118
109
  * The order every surface renders a capability list in. Fixed rather than
119
110
  * derived from a response body, so two spaces never list their capabilities
120
- * differently because JSON came back reshuffled — and declared here, beside the
121
- * schema, so adding a capability cannot leave a renderer silently omitting it.
111
+ * differently because JSON came back reshuffled.
122
112
  */
123
- export declare const EXECUTION_CAPABILITY_ORDER: readonly ["db", "fetch", "auth", "env", "realtime", "logging", "gravatar", "spam", "email"];
113
+ export declare const EXECUTION_CAPABILITY_ORDER: readonly ["db", "fetch", "auth", "env", "realtime", "logging", "gravatar", "spam", "email", "content"];
124
114
  /**
125
- * The portable seam, stated as one predicate.
126
- *
127
- * `db`, `auth` and `realtime` are the three capabilities that bind a handler
128
- * to the local tier. `db` because Zero's store guarantees every handler runs
129
- * inside one parent-owned transaction, which an isolate reaching the database
130
- * over a relay cannot offer. `auth` because capsule identity is resolved
131
- * against that same transaction's view. `realtime` because invalidations are
132
- * emitted by the native runner beside the store, and the Functions grant
133
- * vocabulary has no counterpart for them — a worker declaring the capability
134
- * would fail closed at the relay with nothing to reach. Everything else —
135
- * fetch, env, logging, and the three platform services — is brokered
136
- * identically on both tiers and does not constrain placement.
115
+ * The portable seam. `db`, `auth` and `realtime` bind a handler to the local
116
+ * tier: `db` because Zero guarantees one parent-owned transaction that an
117
+ * isolate over a relay cannot offer, `auth` because capsule identity resolves
118
+ * against that transaction's view, `realtime` because the Functions grant
119
+ * vocabulary has no counterpart for invalidations. Everything else is brokered
120
+ * identically on both tiers.
137
121
  *
138
- * `email` is the one worth stating explicitly, because it looks like it should
139
- * bind: a Zero mutation's send is atomic with its database writes, and a
140
- * Function's is not. That is a difference in the *guarantee* either tier can
141
- * offer, not in what the handler is allowed to reach, and placement follows
142
- * what code reaches. An author who needs that atomicity writes a capsule.
122
+ * `email` looks like it should bind but does not: a Zero mutation's send is
123
+ * atomic with its writes and a Function's is not, which is a difference in
124
+ * guarantee, not in what the handler reaches. An author who needs that
125
+ * atomicity writes a capsule.
143
126
  *
144
- * Nothing here decides placement automatically: the product a version deploys
145
- * to is a property of what its author wrote, and this predicate only reports
146
- * whether the code could also have run on the other tier.
127
+ * This predicate reports only whether code could also have run on the other
128
+ * tier. It does not decide placement.
147
129
  */
148
130
  export declare function endpointIsPortable(capabilities: ExecutionCapabilities): boolean;
149
131
  /**
@@ -174,6 +156,7 @@ export declare function executionEndpointSourceSchema(routePathSchema: z.ZodType
174
156
  gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
175
157
  spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
176
158
  email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
159
+ content: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
177
160
  }, z.core.$strip>>;
178
161
  }, z.core.$strict>;
179
162
  /**
@@ -194,10 +177,9 @@ export declare function executionStaticFileSchema(options: {
194
177
  storageRoot: string;
195
178
  maxBytes: number;
196
179
  /**
197
- * The one underscore-prefixed root a platform compile may write into. Author
198
- * trees still cannot: the leading-underscore ban is what keeps `_headers` and
199
- * `_redirects` from being forged as content, and this exemption is a literal
200
- * prefix the compiler owns, not a relaxation of the rule.
180
+ * The one underscore-prefixed root a platform compile may write into. The
181
+ * leading-underscore ban keeps `_headers` and `_redirects` from being forged
182
+ * as content; this is a literal prefix the compiler owns, not a relaxation.
201
183
  */
202
184
  platformAssetRoot?: string;
203
185
  }): z.ZodObject<{
@@ -209,8 +191,7 @@ export declare function executionStaticFileSchema(options: {
209
191
  }, z.core.$strict>;
210
192
  /**
211
193
  * Whether a version's execution surface may be read by anyone or only by the
212
- * space's own members. Both products expose an inspect route; the policy is
213
- * the same question on each.
194
+ * space's own members. Both products expose an inspect route.
214
195
  */
215
196
  export declare const executionInspectPolicySchema: z.ZodEnum<{
216
197
  private: "private";