@spacefast/common 0.0.23 → 0.0.26

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 (224) 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.js +1 -1
  7. package/dist/agents/private-key-oauth.d.ts +0 -1
  8. package/dist/agents/private-key-oauth.js +46 -63
  9. package/dist/brand-assets-build.js +4 -6
  10. package/dist/brand-assets.d.ts +5 -15
  11. package/dist/brand-assets.js +15 -14
  12. package/dist/config/domains.d.ts +47 -7
  13. package/dist/config/domains.js +66 -10
  14. package/dist/config/index.d.ts +0 -1
  15. package/dist/config/index.js +0 -1
  16. package/dist/contracts/abuse.d.ts +2 -0
  17. package/dist/contracts/abuse.js +12 -0
  18. package/dist/contracts/access.d.ts +124 -12
  19. package/dist/contracts/access.js +73 -9
  20. package/dist/contracts/activity.d.ts +1 -1
  21. package/dist/contracts/activity.js +5 -12
  22. package/dist/contracts/api-keys.d.ts +21 -21
  23. package/dist/contracts/api-keys.js +2 -2
  24. package/dist/contracts/beta.js +1 -1
  25. package/dist/contracts/billing.d.ts +3 -35
  26. package/dist/contracts/billing.js +33 -52
  27. package/dist/contracts/builds.d.ts +30 -18
  28. package/dist/contracts/builds.js +28 -9
  29. package/dist/contracts/channels.js +1 -1
  30. package/dist/contracts/cli.d.ts +10 -0
  31. package/dist/contracts/cli.js +10 -0
  32. package/dist/contracts/collab-public.d.ts +63 -0
  33. package/dist/contracts/collab-public.js +46 -0
  34. package/dist/contracts/comments.d.ts +282 -53
  35. package/dist/contracts/comments.js +173 -52
  36. package/dist/contracts/common.d.ts +3 -3
  37. package/dist/contracts/common.js +5 -5
  38. package/dist/contracts/crons.d.ts +35 -0
  39. package/dist/contracts/crons.js +42 -0
  40. package/dist/contracts/device-auth.d.ts +6 -6
  41. package/dist/contracts/device-auth.js +2 -2
  42. package/dist/contracts/docs.js +2 -2
  43. package/dist/contracts/domains.d.ts +38 -27
  44. package/dist/contracts/domains.js +29 -2
  45. package/dist/contracts/enums.d.ts +34 -30
  46. package/dist/contracts/enums.js +62 -48
  47. package/dist/contracts/error-code-meta.d.ts +50 -125
  48. package/dist/contracts/error-code-meta.js +29 -41
  49. package/dist/contracts/error-codes.d.ts +1 -1
  50. package/dist/contracts/error-codes.js +14 -33
  51. package/dist/contracts/execution.d.ts +47 -66
  52. package/dist/contracts/execution.js +53 -49
  53. package/dist/contracts/feature-lifecycle-core.d.ts +0 -6
  54. package/dist/contracts/feature-lifecycle-core.js +2 -31
  55. package/dist/contracts/feature-lifecycle.d.ts +12 -52
  56. package/dist/contracts/feature-lifecycle.js +16 -59
  57. package/dist/contracts/features.d.ts +48 -60
  58. package/dist/contracts/features.js +59 -51
  59. package/dist/contracts/functions.d.ts +266 -72
  60. package/dist/contracts/functions.js +260 -37
  61. package/dist/contracts/git.d.ts +28 -34
  62. package/dist/contracts/git.js +10 -11
  63. package/dist/contracts/grants.d.ts +9 -5
  64. package/dist/contracts/grants.js +18 -9
  65. package/dist/contracts/ids.js +2 -2
  66. package/dist/contracts/internal.d.ts +8 -6
  67. package/dist/contracts/internal.js +12 -12
  68. package/dist/contracts/mcp.d.ts +11 -0
  69. package/dist/contracts/mcp.js +5 -0
  70. package/dist/contracts/me.js +1 -1
  71. package/dist/contracts/oauth-resources.d.ts +4 -3
  72. package/dist/contracts/oauth-resources.js +12 -3
  73. package/dist/contracts/operations.d.ts +90 -5
  74. package/dist/contracts/operations.js +77 -3
  75. package/dist/contracts/pages.d.ts +12 -7
  76. package/dist/contracts/pages.js +24 -1
  77. package/dist/contracts/plan-policy.d.ts +0 -2
  78. package/dist/contracts/plan-policy.js +2 -3
  79. package/dist/contracts/platform.d.ts +61 -148
  80. package/dist/contracts/platform.js +70 -126
  81. package/dist/contracts/publish-archive.d.ts +508 -0
  82. package/dist/contracts/publish-archive.js +32 -0
  83. package/dist/contracts/push-new.d.ts +4 -4
  84. package/dist/contracts/quotas.js +2 -2
  85. package/dist/contracts/repository-connections.d.ts +43 -30
  86. package/dist/contracts/repository-connections.js +11 -3
  87. package/dist/contracts/resources.d.ts +12 -24
  88. package/dist/contracts/resources.js +36 -16
  89. package/dist/contracts/runtime-api.d.ts +433 -192
  90. package/dist/contracts/runtime-api.js +421 -356
  91. package/dist/contracts/runtime-app.d.ts +127 -120
  92. package/dist/contracts/runtime-app.js +19 -10
  93. package/dist/contracts/runtime-db.d.ts +5 -5
  94. package/dist/contracts/runtime-db.js +2 -2
  95. package/dist/contracts/runtime-purge.d.ts +8 -0
  96. package/dist/contracts/runtime-purge.js +7 -0
  97. package/dist/contracts/runtime-services.d.ts +219 -0
  98. package/dist/contracts/runtime-services.js +437 -0
  99. package/dist/contracts/runtime-storage.d.ts +46 -32
  100. package/dist/contracts/runtime-storage.js +31 -8
  101. package/dist/contracts/sf-config-v1.d.ts +48 -10
  102. package/dist/contracts/space-config.d.ts +69 -18
  103. package/dist/contracts/space-config.js +226 -27
  104. package/dist/contracts/spaces.d.ts +236 -450
  105. package/dist/contracts/spaces.js +131 -151
  106. package/dist/contracts/superadmin-activity.d.ts +57 -4
  107. package/dist/contracts/superadmin-activity.js +48 -2
  108. package/dist/contracts/superadmin-search.d.ts +126 -0
  109. package/dist/contracts/superadmin-search.js +61 -0
  110. package/dist/contracts/superadmin-spaces.d.ts +361 -92
  111. package/dist/contracts/superadmin-spaces.js +97 -24
  112. package/dist/contracts/superadmin-teams.d.ts +28 -10
  113. package/dist/contracts/superadmin-teams.js +5 -8
  114. package/dist/contracts/superadmin-tenants.d.ts +0 -6
  115. package/dist/contracts/superadmin-tenants.js +1 -7
  116. package/dist/contracts/superadmin.d.ts +135 -54
  117. package/dist/contracts/superadmin.js +46 -23
  118. package/dist/contracts/tags.d.ts +12 -12
  119. package/dist/contracts/tags.js +3 -3
  120. package/dist/contracts/teams.d.ts +49 -14
  121. package/dist/contracts/teams.js +40 -22
  122. package/dist/contracts/transfers.d.ts +0 -49
  123. package/dist/contracts/transfers.js +4 -8
  124. package/dist/contracts/usage.d.ts +61 -0
  125. package/dist/contracts/usage.js +64 -0
  126. package/dist/contracts/variables.d.ts +2 -7
  127. package/dist/contracts/variables.js +9 -8
  128. package/dist/contracts/webhooks.d.ts +2 -2
  129. package/dist/contracts/zero.d.ts +102 -73
  130. package/dist/contracts/zero.js +94 -32
  131. package/dist/dashboard-paths/index.d.ts +1 -1
  132. package/dist/dashboard-paths/index.js +1 -0
  133. package/dist/docs/agent-prose.d.ts +2 -2
  134. package/dist/docs/agent-prose.js +63 -70
  135. package/dist/docs/agent-setup.js +45 -15
  136. package/dist/docs/catalog.d.ts +24 -24
  137. package/dist/docs/catalog.js +35 -24
  138. package/dist/docs/error-docs.js +194 -270
  139. package/dist/docs/skills.d.ts +12 -12
  140. package/dist/docs/skills.js +4 -4
  141. package/dist/test-helpers/fetch-stub.d.ts +16 -0
  142. package/dist/test-helpers/fetch-stub.js +25 -0
  143. package/dist/utils/build-settings.d.ts +5 -1
  144. package/dist/utils/build-settings.js +91 -13
  145. package/dist/utils/canonical-json.d.ts +10 -0
  146. package/dist/utils/canonical-json.js +22 -0
  147. package/dist/utils/cast-transport.d.ts +28 -0
  148. package/dist/utils/cast-transport.js +52 -0
  149. package/dist/utils/claim-token.d.ts +0 -8
  150. package/dist/utils/claim-token.js +3 -15
  151. package/dist/utils/concurrency.js +1 -0
  152. package/dist/utils/credential-policy.d.ts +1 -1
  153. package/dist/utils/credential-policy.js +4 -3
  154. package/dist/utils/dns-instructions.js +9 -9
  155. package/dist/utils/env-file.d.ts +17 -0
  156. package/dist/utils/env-file.js +96 -0
  157. package/dist/utils/error-code.d.ts +2 -0
  158. package/dist/utils/error-code.js +8 -0
  159. package/dist/utils/generate-space-name.d.ts +8 -10
  160. package/dist/utils/generate-space-name.js +206 -21
  161. package/dist/utils/grant-decision.fixtures.json +2938 -0
  162. package/dist/utils/grants.d.ts +2 -0
  163. package/dist/utils/grants.js +26 -1
  164. package/dist/utils/gravatar.d.ts +9 -0
  165. package/dist/utils/gravatar.js +31 -0
  166. package/dist/utils/idempotency.d.ts +6 -0
  167. package/dist/utils/idempotency.js +28 -0
  168. package/dist/utils/local-space-state.d.ts +9 -16
  169. package/dist/utils/local-space-state.js +20 -50
  170. package/dist/utils/one-shot-replay.d.ts +4 -1
  171. package/dist/utils/page-colors.d.ts +14 -12
  172. package/dist/utils/page-colors.js +15 -13
  173. package/dist/utils/page-fonts.d.ts +2 -2
  174. package/dist/utils/page-fonts.js +15 -4
  175. package/dist/utils/pages.d.ts +21 -3
  176. package/dist/utils/pages.js +42 -13
  177. package/dist/utils/publish-form-data.d.ts +12 -0
  178. package/dist/utils/publish-form-data.js +10 -0
  179. package/dist/utils/publish-policy.d.ts +27 -0
  180. package/dist/utils/publish-policy.fixtures.json +403 -0
  181. package/dist/utils/publish-policy.js +45 -20
  182. package/dist/utils/push-new.d.ts +7 -0
  183. package/dist/utils/push-new.js +7 -0
  184. package/dist/utils/query-keys.d.ts +4 -5
  185. package/dist/utils/query-keys.js +2 -3
  186. package/dist/utils/runtime-paths.d.ts +5 -0
  187. package/dist/utils/runtime-paths.js +5 -0
  188. package/dist/utils/runtime-upload-batch.d.ts +0 -5
  189. package/dist/utils/runtime-upload-batch.js +1 -27
  190. package/dist/utils/runtime-upload.d.ts +6 -11
  191. package/dist/utils/runtime-upload.js +10 -13
  192. package/dist/utils/secure-local-file.js +5 -16
  193. package/dist/utils/space-config.d.ts +1 -34
  194. package/dist/utils/space-config.js +8 -326
  195. package/dist/utils/static-runtime-policy.d.ts +9 -3
  196. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  197. package/dist/utils/static-runtime-policy.js +22 -56
  198. package/dist/utils/storage-policy.d.ts +1 -1
  199. package/dist/utils/storage-policy.js +3 -1
  200. package/dist/utils/structured-error.d.ts +14 -0
  201. package/dist/utils/structured-error.js +22 -0
  202. package/dist/utils/upload-session.d.ts +4 -1
  203. package/dist/utils/upload-session.js +33 -5
  204. package/dist/utils/version-path.js +13 -4
  205. package/dist/vocabulary.d.ts +13 -11
  206. package/dist/vocabulary.js +42 -28
  207. package/package.json +7 -17
  208. package/dist/config/postgres-budget.d.ts +0 -129
  209. package/dist/config/postgres-budget.js +0 -140
  210. package/dist/config/postgres-budget.json +0 -51
  211. package/dist/contracts/archives.d.ts +0 -331
  212. package/dist/contracts/archives.js +0 -120
  213. package/dist/contracts/deployments.d.ts +0 -574
  214. package/dist/contracts/deployments.js +0 -97
  215. package/dist/contracts/sites.d.ts +0 -416
  216. package/dist/contracts/sites.js +0 -168
  217. package/dist/contracts/superadmin-queues.d.ts +0 -414
  218. package/dist/contracts/superadmin-queues.js +0 -202
  219. package/dist/contracts/superadmin-runtime.d.ts +0 -27
  220. package/dist/contracts/superadmin-runtime.js +0 -38
  221. package/dist/index.d.ts +0 -1
  222. package/dist/index.js +0 -1
  223. package/dist/utils/api.d.ts +0 -4
  224. package/dist/utils/api.js +0 -13
@@ -0,0 +1,10 @@
1
+ export declare const CLI_EXIT_CODES: {
2
+ readonly ok: 0;
3
+ readonly validation: 2;
4
+ readonly auth: 10;
5
+ readonly notFound: 20;
6
+ readonly conflict: 30;
7
+ readonly network: 40;
8
+ readonly timeout: 50;
9
+ readonly unknown: 1;
10
+ };
@@ -0,0 +1,10 @@
1
+ export const CLI_EXIT_CODES = {
2
+ ok: 0,
3
+ validation: 2,
4
+ auth: 10,
5
+ notFound: 20,
6
+ conflict: 30,
7
+ network: 40,
8
+ timeout: 50,
9
+ unknown: 1,
10
+ };
@@ -0,0 +1,63 @@
1
+ import { z } from "zod";
2
+ /** A person, as everyone else may see them. Identity colors are not themeable. */
3
+ export declare const publicActorSchema: z.ZodObject<{
4
+ name: z.ZodString;
5
+ color: z.ZodString;
6
+ avatar_url: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export type PublicActor = z.infer<typeof publicActorSchema>;
9
+ /** A thread as a list renders it — the body is an excerpt, the anchor is gone. */
10
+ export declare const publicThreadSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ path: z.ZodString;
13
+ version_id: z.ZodNullable<z.ZodString>;
14
+ author: z.ZodObject<{
15
+ name: z.ZodString;
16
+ color: z.ZodString;
17
+ avatar_url: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ excerpt: z.ZodString;
20
+ open: z.ZodBoolean;
21
+ unread: z.ZodBoolean;
22
+ reply_count: z.ZodNumber;
23
+ reacted: z.ZodBoolean;
24
+ created_at: z.ZodString;
25
+ }, z.core.$strip>;
26
+ export type PublicThread = z.infer<typeof publicThreadSchema>;
27
+ export declare const publicEventKindSchema: z.ZodEnum<{
28
+ publish: "publish";
29
+ archive: "archive";
30
+ thread: "thread";
31
+ reply: "reply";
32
+ reaction: "reaction";
33
+ }>;
34
+ export type PublicEventKind = z.infer<typeof publicEventKindSchema>;
35
+ /** One activity tick. `line` is the rendered sentence; the rest is addressing. */
36
+ export declare const publicEventSchema: z.ZodObject<{
37
+ kind: z.ZodEnum<{
38
+ publish: "publish";
39
+ archive: "archive";
40
+ thread: "thread";
41
+ reply: "reply";
42
+ reaction: "reaction";
43
+ }>;
44
+ actor: z.ZodOptional<z.ZodObject<{
45
+ name: z.ZodString;
46
+ color: z.ZodString;
47
+ avatar_url: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>>;
49
+ thread_id: z.ZodOptional<z.ZodString>;
50
+ path: z.ZodOptional<z.ZodString>;
51
+ version_id: z.ZodOptional<z.ZodString>;
52
+ line: z.ZodString;
53
+ at: z.ZodString;
54
+ }, z.core.$strip>;
55
+ export type PublicEvent = z.infer<typeof publicEventSchema>;
56
+ /** A version as a chip or a switcher names it. */
57
+ export declare const publicVersionSchema: z.ZodObject<{
58
+ id: z.ZodString;
59
+ label: z.ZodString;
60
+ live: z.ZodBoolean;
61
+ published_at: z.ZodNullable<z.ZodString>;
62
+ }, z.core.$strip>;
63
+ export type PublicVersion = z.infer<typeof publicVersionSchema>;
@@ -0,0 +1,46 @@
1
+ // The Collab public types — the sanitized shapes every collab surface emits or
2
+ // renders (collab-public-api.html §5). One home: the SDK, the overlay, the
3
+ // dashboard bridge, the control-plane projection and any published layout all
4
+ // import from here. Re-exported nowhere.
5
+ //
6
+ // Sanitized means sanitized: no emails, no raw authority refs, no anchors. A
7
+ // custom layout can restyle everything these carry and escalate nothing.
8
+ import { z } from "zod";
9
+ /** A person, as everyone else may see them. Identity colors are not themeable. */
10
+ export const publicActorSchema = z.object({
11
+ name: z.string().min(1).max(160),
12
+ color: z.string().min(1).max(32),
13
+ avatar_url: z.string().url().max(2048).optional(),
14
+ });
15
+ /** A thread as a list renders it — the body is an excerpt, the anchor is gone. */
16
+ export const publicThreadSchema = z.object({
17
+ id: z.string().min(1).max(128),
18
+ path: z.string().min(1).max(2048),
19
+ version_id: z.string().min(1).max(128).nullable(),
20
+ author: publicActorSchema,
21
+ excerpt: z.string().max(2048),
22
+ open: z.boolean(),
23
+ unread: z.boolean(),
24
+ reply_count: z.number().int().min(0),
25
+ /** The viewer reacted to this thread. */
26
+ reacted: z.boolean(),
27
+ created_at: z.string().min(1).max(64),
28
+ });
29
+ export const publicEventKindSchema = z.enum(["thread", "reply", "reaction", "archive", "publish"]);
30
+ /** One activity tick. `line` is the rendered sentence; the rest is addressing. */
31
+ export const publicEventSchema = z.object({
32
+ kind: publicEventKindSchema,
33
+ actor: publicActorSchema.optional(),
34
+ thread_id: z.string().min(1).max(128).optional(),
35
+ path: z.string().min(1).max(2048).optional(),
36
+ version_id: z.string().min(1).max(128).optional(),
37
+ line: z.string().max(2048),
38
+ at: z.string().min(1).max(64),
39
+ });
40
+ /** A version as a chip or a switcher names it. */
41
+ export const publicVersionSchema = z.object({
42
+ id: z.string().min(1).max(128),
43
+ label: z.string().min(1).max(64),
44
+ live: z.boolean(),
45
+ published_at: z.string().min(1).max(64).nullable(),
46
+ });
@@ -40,6 +40,20 @@ export declare const collaborationPublicProfileSchema: z.ZodObject<{
40
40
  avatar_url: z.ZodNullable<z.ZodURL>;
41
41
  }, z.core.$strict>;
42
42
  export type CollaborationPublicProfile = z.infer<typeof collaborationPublicProfileSchema>;
43
+ /**
44
+ * Where the browser holding this ticket is.
45
+ *
46
+ * "embed" is a third-party site the owner allowlisted, and it is its own state
47
+ * precisely so nothing pretends a foreign origin is a published Spacefast host:
48
+ * the room an embed ticket names is origin-scoped, and both the mint and Cast
49
+ * refuse the pairing in either direction.
50
+ */
51
+ export declare const collaborationSurfaceSchema: z.ZodEnum<{
52
+ preview: "preview";
53
+ published: "published";
54
+ embed: "embed";
55
+ }>;
56
+ export type CollaborationSurface = z.infer<typeof collaborationSurfaceSchema>;
43
57
  export declare const collaborationTicketClaimsSchema: z.ZodObject<{
44
58
  sub: z.ZodString;
45
59
  email: z.ZodOptional<z.ZodString>;
@@ -74,6 +88,7 @@ export declare const collaborationTicketClaimsSchema: z.ZodObject<{
74
88
  surface: z.ZodEnum<{
75
89
  preview: "preview";
76
90
  published: "published";
91
+ embed: "embed";
77
92
  }>;
78
93
  nonce: z.ZodString;
79
94
  iat: z.ZodNumber;
@@ -82,9 +97,30 @@ export declare const collaborationTicketClaimsSchema: z.ZodObject<{
82
97
  iss: z.ZodLiteral<"spacefast-api">;
83
98
  aud: z.ZodString;
84
99
  }, z.core.$strip>;
100
+ export declare const commentsSurfaceSchema: z.ZodEnum<{
101
+ off: "off";
102
+ previews: "previews";
103
+ everywhere: "everywhere";
104
+ }>;
105
+ export declare const COMMENTS_EMBED_ORIGINS_MAX = 20;
106
+ /**
107
+ * A site the Space owner allows the one-line Collab insert to run on.
108
+ *
109
+ * Exactly one https origin — scheme, host, and port, nothing else. No
110
+ * wildcards: on a foreign site this list IS the entitlement, and `*.example.com`
111
+ * hands it to every subdomain the site ever loses control of. An off-shape
112
+ * value is refused rather than normalized, so what the owner typed and what the
113
+ * server matches are the same string.
114
+ */
115
+ export declare const commentsEmbedOriginSchema: z.ZodString;
85
116
  export declare const collaborationSettingsSchema: z.ZodObject<{
86
117
  spamFilterEnabled: z.ZodOptional<z.ZodBoolean>;
87
- publishedComments: z.ZodOptional<z.ZodBoolean>;
118
+ surface: z.ZodDefault<z.ZodEnum<{
119
+ off: "off";
120
+ previews: "previews";
121
+ everywhere: "everywhere";
122
+ }>>;
123
+ embedOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
88
124
  notificationPreferences: z.ZodOptional<z.ZodObject<{
89
125
  newThreads: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
90
126
  newReplies: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
@@ -94,12 +130,16 @@ export declare const collaborationSettingsSchema: z.ZodObject<{
94
130
  export declare const collaborationSchema: z.ZodObject<{
95
131
  spaceId: z.ZodString;
96
132
  revision: z.ZodNumber;
97
- enabled: z.ZodBoolean;
98
133
  castResourceId: z.ZodNullable<z.ZodString>;
99
134
  castResourceKey: z.ZodNullable<z.ZodString>;
100
135
  settings: z.ZodObject<{
101
136
  spamFilterEnabled: z.ZodOptional<z.ZodBoolean>;
102
- publishedComments: z.ZodOptional<z.ZodBoolean>;
137
+ surface: z.ZodDefault<z.ZodEnum<{
138
+ off: "off";
139
+ previews: "previews";
140
+ everywhere: "everywhere";
141
+ }>>;
142
+ embedOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
103
143
  notificationPreferences: z.ZodOptional<z.ZodObject<{
104
144
  newThreads: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
105
145
  newReplies: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
@@ -111,42 +151,91 @@ export declare const collaborationSchema: z.ZodObject<{
111
151
  }, z.core.$strip>;
112
152
  export declare const collaborationUpdateSchema: z.ZodObject<{
113
153
  expectedRevision: z.ZodNumber;
114
- enabled: z.ZodOptional<z.ZodBoolean>;
115
- settings: z.ZodOptional<z.ZodObject<{
154
+ settings: z.ZodObject<{
116
155
  spamFilterEnabled: z.ZodOptional<z.ZodBoolean>;
117
- publishedComments: z.ZodOptional<z.ZodBoolean>;
156
+ surface: z.ZodOptional<z.ZodEnum<{
157
+ off: "off";
158
+ previews: "previews";
159
+ everywhere: "everywhere";
160
+ }>>;
161
+ embedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
162
  notificationPreferences: z.ZodOptional<z.ZodObject<{
119
163
  newThreads: z.ZodOptional<z.ZodBoolean>;
120
164
  newReplies: z.ZodOptional<z.ZodBoolean>;
121
165
  statusChanges: z.ZodOptional<z.ZodBoolean>;
122
166
  }, z.core.$strict>>;
123
- }, z.core.$strict>>;
167
+ }, z.core.$strict>;
124
168
  }, z.core.$strip>;
125
- export declare const commentsTicketRequestSchema: z.ZodObject<{
126
- spaceId: z.ZodString;
169
+ /**
170
+ * The overlay's whole configuration, in one shape.
171
+ *
172
+ * Both lanes carry this: the Space's own origins get it from the runtime's
173
+ * same-origin exchange, a third-party site fetches it over CORS keyed by
174
+ * `data-space`. Only the transport differs — the SDK parses one shape.
175
+ */
176
+ export declare const collabOverlayConfigSchema: z.ZodObject<{
177
+ enabled: z.ZodBoolean;
178
+ resource_key: z.ZodNullable<z.ZodString>;
179
+ room_key: z.ZodNullable<z.ZodString>;
180
+ version: z.ZodObject<{
181
+ id: z.ZodNullable<z.ZodString>;
182
+ current: z.ZodNullable<z.ZodString>;
183
+ url: z.ZodNullable<z.ZodString>;
184
+ }, z.core.$strip>;
185
+ space: z.ZodObject<{
186
+ live_url: z.ZodNullable<z.ZodString>;
187
+ }, z.core.$strip>;
188
+ theme: z.ZodObject<{
189
+ accent: z.ZodNullable<z.ZodString>;
190
+ hide_branding: z.ZodBoolean;
191
+ }, z.core.$strip>;
192
+ ws_url: z.ZodNullable<z.ZodString>;
193
+ endpoints: z.ZodObject<{
194
+ ticket: z.ZodString;
195
+ }, z.core.$strip>;
196
+ features: z.ZodObject<{
197
+ picker: z.ZodOptional<z.ZodBoolean>;
198
+ drawing: z.ZodBoolean;
199
+ capture: z.ZodBoolean;
200
+ attachments: z.ZodBoolean;
201
+ notices: z.ZodBoolean;
202
+ }, z.core.$strip>;
203
+ }, z.core.$strip>;
204
+ export type CollabOverlayConfig = z.infer<typeof collabOverlayConfigSchema>;
205
+ export declare const commentsEmbedIdentitySchema: z.ZodObject<{
206
+ name: z.ZodString;
207
+ namedByUser: z.ZodBoolean;
208
+ }, z.core.$strip>;
209
+ export declare const commentsEmbedTicketRequestSchema: z.ZodObject<{
127
210
  pagePath: z.ZodDefault<z.ZodString>;
128
- origin: z.ZodString;
129
- versionId: z.ZodOptional<z.ZodString>;
130
- identity: z.ZodOptional<z.ZodObject<{
211
+ identity: z.ZodObject<{
131
212
  name: z.ZodString;
132
- anonymousId: z.ZodString;
133
213
  namedByUser: z.ZodBoolean;
134
- }, z.core.$strip>>;
214
+ }, z.core.$strip>;
215
+ visitorToken: z.ZodOptional<z.ZodString>;
135
216
  }, z.core.$strip>;
136
- export declare const commentsTicketResponseSchema: z.ZodObject<{
217
+ export declare const commentsEmbedTicketResponseSchema: z.ZodObject<{
137
218
  token: z.ZodString;
138
219
  expiresAt: z.ZodString;
139
220
  cast: z.ZodObject<{
140
221
  resource: z.ZodString;
141
222
  room: z.ZodString;
142
223
  }, z.core.$strip>;
224
+ visitorToken: z.ZodString;
225
+ visitorExpiresAt: z.ZodString;
143
226
  }, z.core.$strip>;
144
- export declare const realtimeTokenRequestSchema: z.ZodObject<{
145
- versionId: z.ZodOptional<z.ZodString>;
146
- scope: z.ZodDefault<z.ZodEnum<{
147
- space: "space";
148
- version: "version";
149
- }>>;
227
+ export declare const commentsTicketResponseSchema: z.ZodObject<{
228
+ token: z.ZodString;
229
+ expiresAt: z.ZodString;
230
+ cast: z.ZodObject<{
231
+ resource: z.ZodString;
232
+ room: z.ZodString;
233
+ wsUrl: z.ZodNullable<z.ZodString>;
234
+ }, z.core.$strip>;
235
+ notice: z.ZodNullable<z.ZodObject<{
236
+ token: z.ZodString;
237
+ room: z.ZodString;
238
+ }, z.core.$strip>>;
150
239
  }, z.core.$strip>;
151
240
  export declare const realtimeTokenResponseSchema: z.ZodObject<{
152
241
  token: z.ZodString;
@@ -154,8 +243,16 @@ export declare const realtimeTokenResponseSchema: z.ZodObject<{
154
243
  cast: z.ZodObject<{
155
244
  resource: z.ZodString;
156
245
  room: z.ZodString;
246
+ wsUrl: z.ZodNullable<z.ZodString>;
157
247
  }, z.core.$strip>;
158
248
  }, z.core.$strip>;
249
+ /**
250
+ * A Space-level fact worth interrupting someone for. It travels as a `notice`
251
+ * on the Space's notice room — never as an event in a page room — because it
252
+ * is not conversation content: every open surface needs it regardless of which
253
+ * page it happens to be sitting on, including surfaces (the dashboard) that
254
+ * are in no page room at all.
255
+ */
159
256
  export declare const noticePublishSchema: z.ZodObject<{
160
257
  versionId: z.ZodOptional<z.ZodString>;
161
258
  kind: z.ZodDefault<z.ZodString>;
@@ -168,13 +265,18 @@ export declare const noticePublishSchema: z.ZodObject<{
168
265
  warning: "warning";
169
266
  }>>;
170
267
  payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
171
- durable: z.ZodDefault<z.ZodBoolean>;
172
- idempotencyKey: z.ZodOptional<z.ZodString>;
173
268
  }, z.core.$strip>;
269
+ /** The wire shape of one notice, shared by the platform and comment lanes. */
270
+ export declare const spaceNoticeSchema: z.ZodObject<{
271
+ kind: z.ZodString;
272
+ version_id: z.ZodNullable<z.ZodString>;
273
+ }, z.core.$loose>;
174
274
  export declare const noticePublishResponseSchema: z.ZodObject<{
175
275
  status: z.ZodString;
176
- event: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
- broadcast: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
276
+ notice: z.ZodObject<{
277
+ kind: z.ZodString;
278
+ version_id: z.ZodNullable<z.ZodString>;
279
+ }, z.core.$loose>;
178
280
  }, z.core.$strip>;
179
281
  export declare const COLLAB_VERSION_URLS_MAX_IDS = 50;
180
282
  export declare const collabVersionUrlSchema: z.ZodObject<{
@@ -193,6 +295,57 @@ export declare const commentAuthorSchema: z.ZodObject<{
193
295
  color: z.ZodNullable<z.ZodString>;
194
296
  }, z.core.$strip>;
195
297
  export declare const commentTargetSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
298
+ /**
299
+ * How many attachments one thread or reply may carry. Mirrors Cast's own
300
+ * `@attachment_limit`: Cast is the authority that enforces it on write, this
301
+ * bound is what REST readers can rely on.
302
+ */
303
+ export declare const COMMENT_ATTACHMENT_MAX_COUNT = 10;
304
+ /**
305
+ * A pointer to a storage object on the Space's own runtime plus the descriptor
306
+ * needed to render it — never a URL. Cast stores exactly this (snake_case) under
307
+ * `metadata.attachments`; the id is a bare 32-hex object id.
308
+ */
309
+ export declare const commentAttachmentSchema: z.ZodObject<{
310
+ id: z.ZodString;
311
+ name: z.ZodString;
312
+ contentType: z.ZodString;
313
+ size: z.ZodNumber;
314
+ kind: z.ZodEnum<{
315
+ file: "file";
316
+ image: "image";
317
+ screenshot: "screenshot";
318
+ }>;
319
+ crop: z.ZodOptional<z.ZodObject<{
320
+ x: z.ZodNumber;
321
+ y: z.ZodNumber;
322
+ width: z.ZodNumber;
323
+ height: z.ZodNumber;
324
+ }, z.core.$strip>>;
325
+ }, z.core.$strip>;
326
+ /**
327
+ * What a REST reader gets: the stored attachment plus a freshly composed read
328
+ * URL. `url` is null when the runtime's revocable read key cannot be resolved —
329
+ * an honest degraded read rather than a dead link or a dropped attachment.
330
+ */
331
+ export declare const commentAttachmentViewSchema: z.ZodObject<{
332
+ id: z.ZodString;
333
+ name: z.ZodString;
334
+ contentType: z.ZodString;
335
+ size: z.ZodNumber;
336
+ kind: z.ZodEnum<{
337
+ file: "file";
338
+ image: "image";
339
+ screenshot: "screenshot";
340
+ }>;
341
+ crop: z.ZodOptional<z.ZodObject<{
342
+ x: z.ZodNumber;
343
+ y: z.ZodNumber;
344
+ width: z.ZodNumber;
345
+ height: z.ZodNumber;
346
+ }, z.core.$strip>>;
347
+ url: z.ZodNullable<z.ZodString>;
348
+ }, z.core.$strip>;
196
349
  export declare const commentReactionActorSchema: z.ZodObject<{
197
350
  name: z.ZodNullable<z.ZodString>;
198
351
  }, z.core.$strip>;
@@ -217,6 +370,31 @@ export declare const commentReactionUpdateSchema: z.ZodObject<{
217
370
  add: "add";
218
371
  }>;
219
372
  }, z.core.$strip>;
373
+ /**
374
+ * A reply keeps Cast's own free-form shape; `attachments` is the one field the
375
+ * API composes rather than passes through (Cast carries it in the reply's
376
+ * `metadata`, without URLs).
377
+ */
378
+ export declare const commentReplyViewSchema: z.ZodObject<{
379
+ attachments: z.ZodArray<z.ZodObject<{
380
+ id: z.ZodString;
381
+ name: z.ZodString;
382
+ contentType: z.ZodString;
383
+ size: z.ZodNumber;
384
+ kind: z.ZodEnum<{
385
+ file: "file";
386
+ image: "image";
387
+ screenshot: "screenshot";
388
+ }>;
389
+ crop: z.ZodOptional<z.ZodObject<{
390
+ x: z.ZodNumber;
391
+ y: z.ZodNumber;
392
+ width: z.ZodNumber;
393
+ height: z.ZodNumber;
394
+ }, z.core.$strip>>;
395
+ url: z.ZodNullable<z.ZodString>;
396
+ }, z.core.$strip>>;
397
+ }, z.core.$loose>;
220
398
  export declare const commentThreadSchema: z.ZodObject<{
221
399
  id: z.ZodString;
222
400
  castThreadId: z.ZodString;
@@ -253,7 +431,44 @@ export declare const commentThreadSchema: z.ZodObject<{
253
431
  name: z.ZodNullable<z.ZodString>;
254
432
  }, z.core.$strip>>;
255
433
  }, z.core.$strip>>;
256
- comments: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
434
+ attachments: z.ZodArray<z.ZodObject<{
435
+ id: z.ZodString;
436
+ name: z.ZodString;
437
+ contentType: z.ZodString;
438
+ size: z.ZodNumber;
439
+ kind: z.ZodEnum<{
440
+ file: "file";
441
+ image: "image";
442
+ screenshot: "screenshot";
443
+ }>;
444
+ crop: z.ZodOptional<z.ZodObject<{
445
+ x: z.ZodNumber;
446
+ y: z.ZodNumber;
447
+ width: z.ZodNumber;
448
+ height: z.ZodNumber;
449
+ }, z.core.$strip>>;
450
+ url: z.ZodNullable<z.ZodString>;
451
+ }, z.core.$strip>>;
452
+ comments: z.ZodArray<z.ZodObject<{
453
+ attachments: z.ZodArray<z.ZodObject<{
454
+ id: z.ZodString;
455
+ name: z.ZodString;
456
+ contentType: z.ZodString;
457
+ size: z.ZodNumber;
458
+ kind: z.ZodEnum<{
459
+ file: "file";
460
+ image: "image";
461
+ screenshot: "screenshot";
462
+ }>;
463
+ crop: z.ZodOptional<z.ZodObject<{
464
+ x: z.ZodNumber;
465
+ y: z.ZodNumber;
466
+ width: z.ZodNumber;
467
+ height: z.ZodNumber;
468
+ }, z.core.$strip>>;
469
+ url: z.ZodNullable<z.ZodString>;
470
+ }, z.core.$strip>>;
471
+ }, z.core.$loose>>;
257
472
  permalink: z.ZodNullable<z.ZodString>;
258
473
  updatedAt: z.ZodNullable<z.ZodString>;
259
474
  }, z.core.$strip>;
@@ -284,32 +499,6 @@ export declare const commentCreateSchema: z.ZodObject<{
284
499
  target: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
285
500
  idempotencyKey: z.ZodOptional<z.ZodString>;
286
501
  }, z.core.$strip>;
287
- export declare const commentScreenshotCreateSchema: z.ZodObject<{
288
- versionId: z.ZodString;
289
- pagePath: z.ZodDefault<z.ZodString>;
290
- contentType: z.ZodEnum<{
291
- "image/jpeg": "image/jpeg";
292
- "image/png": "image/png";
293
- "image/webp": "image/webp";
294
- }>;
295
- contentBase64: z.ZodString;
296
- }, z.core.$strip>;
297
- export declare const commentScreenshotSchema: z.ZodObject<{
298
- id: z.ZodString;
299
- key: z.ZodString;
300
- url: z.ZodString;
301
- expiresAt: z.ZodString;
302
- }, z.core.$strip>;
303
- export declare const commentScreenshotRefreshSchema: z.ZodObject<{
304
- versionId: z.ZodString;
305
- pagePath: z.ZodDefault<z.ZodString>;
306
- key: z.ZodString;
307
- }, z.core.$strip>;
308
- export declare const commentScreenshotRefreshResponseSchema: z.ZodObject<{
309
- key: z.ZodString;
310
- url: z.ZodString;
311
- expiresAt: z.ZodString;
312
- }, z.core.$strip>;
313
502
  export declare const commentReplySchema: z.ZodObject<{
314
503
  body: z.ZodString;
315
504
  idempotencyKey: z.ZodOptional<z.ZodString>;
@@ -367,7 +556,44 @@ export declare const commentListResponseSchema: z.ZodObject<{
367
556
  name: z.ZodNullable<z.ZodString>;
368
557
  }, z.core.$strip>>;
369
558
  }, z.core.$strip>>;
370
- comments: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
559
+ attachments: z.ZodArray<z.ZodObject<{
560
+ id: z.ZodString;
561
+ name: z.ZodString;
562
+ contentType: z.ZodString;
563
+ size: z.ZodNumber;
564
+ kind: z.ZodEnum<{
565
+ file: "file";
566
+ image: "image";
567
+ screenshot: "screenshot";
568
+ }>;
569
+ crop: z.ZodOptional<z.ZodObject<{
570
+ x: z.ZodNumber;
571
+ y: z.ZodNumber;
572
+ width: z.ZodNumber;
573
+ height: z.ZodNumber;
574
+ }, z.core.$strip>>;
575
+ url: z.ZodNullable<z.ZodString>;
576
+ }, z.core.$strip>>;
577
+ comments: z.ZodArray<z.ZodObject<{
578
+ attachments: z.ZodArray<z.ZodObject<{
579
+ id: z.ZodString;
580
+ name: z.ZodString;
581
+ contentType: z.ZodString;
582
+ size: z.ZodNumber;
583
+ kind: z.ZodEnum<{
584
+ file: "file";
585
+ image: "image";
586
+ screenshot: "screenshot";
587
+ }>;
588
+ crop: z.ZodOptional<z.ZodObject<{
589
+ x: z.ZodNumber;
590
+ y: z.ZodNumber;
591
+ width: z.ZodNumber;
592
+ height: z.ZodNumber;
593
+ }, z.core.$strip>>;
594
+ url: z.ZodNullable<z.ZodString>;
595
+ }, z.core.$strip>>;
596
+ }, z.core.$loose>>;
371
597
  permalink: z.ZodNullable<z.ZodString>;
372
598
  updatedAt: z.ZodNullable<z.ZodString>;
373
599
  }, z.core.$strip>>;
@@ -385,5 +611,8 @@ export declare const commentExportResponseSchema: z.ZodObject<{
385
611
  }, z.core.$strip>;
386
612
  export type Collaboration = z.infer<typeof collaborationSchema>;
387
613
  export type CollaborationUpdate = z.infer<typeof collaborationUpdateSchema>;
614
+ export type CommentsSurface = z.infer<typeof commentsSurfaceSchema>;
388
615
  export type CollabVersionUrl = z.infer<typeof collabVersionUrlSchema>;
389
616
  export type CommentThread = z.infer<typeof commentThreadSchema>;
617
+ export type CommentAttachment = z.infer<typeof commentAttachmentSchema>;
618
+ export type CommentAttachmentView = z.infer<typeof commentAttachmentViewSchema>;