@playcraft/common 0.1.89 → 0.1.91

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 (278) hide show
  1. package/dist/agent-memory.d.ts +88 -0
  2. package/dist/agent-memory.d.ts.map +1 -0
  3. package/dist/agent-memory.js +66 -0
  4. package/dist/agent-memory.js.map +1 -0
  5. package/dist/agent-personalization.d.ts +111 -0
  6. package/dist/agent-personalization.d.ts.map +1 -0
  7. package/dist/agent-personalization.js +32 -0
  8. package/dist/agent-personalization.js.map +1 -0
  9. package/dist/agent-tools/replica-validation.d.ts +24 -24
  10. package/dist/audio-library-stream.d.ts +2 -2
  11. package/dist/audio-package-node.d.ts +20 -0
  12. package/dist/audio-package-node.d.ts.map +1 -0
  13. package/dist/audio-package-node.js +77 -0
  14. package/dist/audio-package-node.js.map +1 -0
  15. package/dist/audio-program-package.d.ts +81 -0
  16. package/dist/audio-program-package.d.ts.map +1 -0
  17. package/dist/audio-program-package.js +268 -0
  18. package/dist/audio-program-package.js.map +1 -0
  19. package/dist/cloud-workspace/runtime/agent-background-processes.d.ts +2 -2
  20. package/dist/cloud-workspace/runtime/agent-build-delivery.d.ts +445 -0
  21. package/dist/cloud-workspace/runtime/agent-build-delivery.d.ts.map +1 -0
  22. package/dist/cloud-workspace/runtime/agent-build-delivery.js +215 -0
  23. package/dist/cloud-workspace/runtime/agent-build-delivery.js.map +1 -0
  24. package/dist/cloud-workspace/runtime/agent-command.d.ts +1 -1
  25. package/dist/cloud-workspace/runtime/agent-competitor-report.d.ts +10 -10
  26. package/dist/cloud-workspace/runtime/agent-connection.d.ts +1 -1
  27. package/dist/cloud-workspace/runtime/agent-issue-artifacts.d.ts +4 -4
  28. package/dist/cloud-workspace/runtime/agent-lifecycle.d.ts +3 -3
  29. package/dist/cloud-workspace/runtime/agent-mutation.d.ts +3 -3
  30. package/dist/cloud-workspace/runtime/agent-opencode-gateway.d.ts.map +1 -1
  31. package/dist/cloud-workspace/runtime/agent-opencode-gateway.js +1 -0
  32. package/dist/cloud-workspace/runtime/agent-opencode-gateway.js.map +1 -1
  33. package/dist/cloud-workspace/runtime/agent-opencode.d.ts +3 -3
  34. package/dist/cloud-workspace/runtime/agent-read.d.ts +2 -2
  35. package/dist/cloud-workspace/runtime/agent-source-project.d.ts +3 -3
  36. package/dist/cloud-workspace/runtime/agent-variant-git.d.ts +2 -2
  37. package/dist/cloud-workspace/runtime/artifact-generation-source.d.ts +32 -0
  38. package/dist/cloud-workspace/runtime/artifact-generation-source.d.ts.map +1 -0
  39. package/dist/cloud-workspace/runtime/artifact-generation-source.js +46 -0
  40. package/dist/cloud-workspace/runtime/artifact-generation-source.js.map +1 -0
  41. package/dist/cloud-workspace/runtime/artifacts.d.ts +10 -5
  42. package/dist/cloud-workspace/runtime/artifacts.d.ts.map +1 -1
  43. package/dist/cloud-workspace/runtime/artifacts.js +6 -2
  44. package/dist/cloud-workspace/runtime/artifacts.js.map +1 -1
  45. package/dist/cloud-workspace/runtime/asset-generation.d.ts +4 -4
  46. package/dist/cloud-workspace/runtime/asset-library-import.d.ts.map +1 -1
  47. package/dist/cloud-workspace/runtime/asset-library-import.js +41 -15
  48. package/dist/cloud-workspace/runtime/asset-library-import.js.map +1 -1
  49. package/dist/cloud-workspace/runtime/asset-library-save.d.ts +2 -2
  50. package/dist/cloud-workspace/runtime/asset-transfers.d.ts.map +1 -1
  51. package/dist/cloud-workspace/runtime/asset-transfers.js +100 -43
  52. package/dist/cloud-workspace/runtime/asset-transfers.js.map +1 -1
  53. package/dist/cloud-workspace/runtime/attachment-base64.d.ts +2 -0
  54. package/dist/cloud-workspace/runtime/attachment-base64.d.ts.map +1 -1
  55. package/dist/cloud-workspace/runtime/attachment-base64.js +4 -0
  56. package/dist/cloud-workspace/runtime/attachment-base64.js.map +1 -1
  57. package/dist/cloud-workspace/runtime/audio-adoption-receipt.d.ts +359 -0
  58. package/dist/cloud-workspace/runtime/audio-adoption-receipt.d.ts.map +1 -0
  59. package/dist/cloud-workspace/runtime/audio-adoption-receipt.js +39 -0
  60. package/dist/cloud-workspace/runtime/audio-adoption-receipt.js.map +1 -0
  61. package/dist/cloud-workspace/runtime/audio-artifact-package.d.ts +8 -0
  62. package/dist/cloud-workspace/runtime/audio-artifact-package.d.ts.map +1 -0
  63. package/dist/cloud-workspace/runtime/audio-artifact-package.js +102 -0
  64. package/dist/cloud-workspace/runtime/audio-artifact-package.js.map +1 -0
  65. package/dist/cloud-workspace/runtime/audio-asset-protocol.d.ts +2 -2
  66. package/dist/cloud-workspace/runtime/audio-library.d.ts +8 -8
  67. package/dist/cloud-workspace/runtime/batch-generation.d.ts +1 -0
  68. package/dist/cloud-workspace/runtime/batch-generation.d.ts.map +1 -1
  69. package/dist/cloud-workspace/runtime/batch-runs.d.ts +149 -27
  70. package/dist/cloud-workspace/runtime/batch-runs.d.ts.map +1 -1
  71. package/dist/cloud-workspace/runtime/batch-runs.js +13 -1
  72. package/dist/cloud-workspace/runtime/batch-runs.js.map +1 -1
  73. package/dist/cloud-workspace/runtime/chat-realtime.d.ts +2 -2
  74. package/dist/cloud-workspace/runtime/connectivity.d.ts +7 -7
  75. package/dist/cloud-workspace/runtime/delivery-format.d.ts +2 -0
  76. package/dist/cloud-workspace/runtime/delivery-format.d.ts.map +1 -1
  77. package/dist/cloud-workspace/runtime/delivery-format.js +11 -0
  78. package/dist/cloud-workspace/runtime/delivery-format.js.map +1 -1
  79. package/dist/cloud-workspace/runtime/delivery-preparation.d.ts +74 -0
  80. package/dist/cloud-workspace/runtime/delivery-preparation.d.ts.map +1 -0
  81. package/dist/cloud-workspace/runtime/delivery-preparation.js +45 -0
  82. package/dist/cloud-workspace/runtime/delivery-preparation.js.map +1 -0
  83. package/dist/cloud-workspace/runtime/delivery.d.ts +69 -69
  84. package/dist/cloud-workspace/runtime/draft-claim.d.ts +8 -0
  85. package/dist/cloud-workspace/runtime/draft-claim.d.ts.map +1 -0
  86. package/dist/cloud-workspace/runtime/draft-claim.js +13 -0
  87. package/dist/cloud-workspace/runtime/draft-claim.js.map +1 -0
  88. package/dist/cloud-workspace/runtime/draft-occupancy.d.ts +231 -0
  89. package/dist/cloud-workspace/runtime/draft-occupancy.d.ts.map +1 -0
  90. package/dist/cloud-workspace/runtime/draft-occupancy.js +130 -0
  91. package/dist/cloud-workspace/runtime/draft-occupancy.js.map +1 -0
  92. package/dist/cloud-workspace/runtime/events.d.ts +4 -4
  93. package/dist/cloud-workspace/runtime/execution-admission.d.ts +34 -5
  94. package/dist/cloud-workspace/runtime/execution-admission.d.ts.map +1 -1
  95. package/dist/cloud-workspace/runtime/execution-admission.js +17 -4
  96. package/dist/cloud-workspace/runtime/execution-admission.js.map +1 -1
  97. package/dist/cloud-workspace/runtime/execution-context.d.ts +4 -4
  98. package/dist/cloud-workspace/runtime/execution-grant.d.ts.map +1 -1
  99. package/dist/cloud-workspace/runtime/execution-grant.js +3 -2
  100. package/dist/cloud-workspace/runtime/execution-grant.js.map +1 -1
  101. package/dist/cloud-workspace/runtime/files.d.ts +11 -1
  102. package/dist/cloud-workspace/runtime/files.d.ts.map +1 -1
  103. package/dist/cloud-workspace/runtime/files.js +7 -4
  104. package/dist/cloud-workspace/runtime/files.js.map +1 -1
  105. package/dist/cloud-workspace/runtime/frame-animation-consumer.d.ts +260 -0
  106. package/dist/cloud-workspace/runtime/frame-animation-consumer.d.ts.map +1 -0
  107. package/dist/cloud-workspace/runtime/frame-animation-consumer.js +255 -0
  108. package/dist/cloud-workspace/runtime/frame-animation-consumer.js.map +1 -0
  109. package/dist/cloud-workspace/runtime/generation-selection-audio.d.ts +57 -0
  110. package/dist/cloud-workspace/runtime/generation-selection-audio.d.ts.map +1 -0
  111. package/dist/cloud-workspace/runtime/generation-selection-audio.js +68 -0
  112. package/dist/cloud-workspace/runtime/generation-selection-audio.js.map +1 -0
  113. package/dist/cloud-workspace/runtime/generation-selection.d.ts +997 -0
  114. package/dist/cloud-workspace/runtime/generation-selection.d.ts.map +1 -0
  115. package/dist/cloud-workspace/runtime/generation-selection.js +212 -0
  116. package/dist/cloud-workspace/runtime/generation-selection.js.map +1 -0
  117. package/dist/cloud-workspace/runtime/generations.d.ts +1 -1
  118. package/dist/cloud-workspace/runtime/generations.d.ts.map +1 -1
  119. package/dist/cloud-workspace/runtime/generations.js +2 -0
  120. package/dist/cloud-workspace/runtime/generations.js.map +1 -1
  121. package/dist/cloud-workspace/runtime/handshake.d.ts +2 -0
  122. package/dist/cloud-workspace/runtime/handshake.d.ts.map +1 -1
  123. package/dist/cloud-workspace/runtime/handshake.js +3 -0
  124. package/dist/cloud-workspace/runtime/handshake.js.map +1 -1
  125. package/dist/cloud-workspace/runtime/index.d.ts +20 -1
  126. package/dist/cloud-workspace/runtime/index.d.ts.map +1 -1
  127. package/dist/cloud-workspace/runtime/index.js +20 -1
  128. package/dist/cloud-workspace/runtime/index.js.map +1 -1
  129. package/dist/cloud-workspace/runtime/level-editor-agent.d.ts +68 -0
  130. package/dist/cloud-workspace/runtime/level-editor-agent.d.ts.map +1 -1
  131. package/dist/cloud-workspace/runtime/level-editor-agent.js +6 -0
  132. package/dist/cloud-workspace/runtime/level-editor-agent.js.map +1 -1
  133. package/dist/cloud-workspace/runtime/level-editor-authoring.d.ts +1 -1
  134. package/dist/cloud-workspace/runtime/level-editor-schema.d.ts +20 -0
  135. package/dist/cloud-workspace/runtime/level-editor-schema.d.ts.map +1 -1
  136. package/dist/cloud-workspace/runtime/level-editor-schema.js +3 -0
  137. package/dist/cloud-workspace/runtime/level-editor-schema.js.map +1 -1
  138. package/dist/cloud-workspace/runtime/model-capture-upload-grant.d.ts.map +1 -1
  139. package/dist/cloud-workspace/runtime/model-capture-upload-grant.js +6 -1
  140. package/dist/cloud-workspace/runtime/model-capture-upload-grant.js.map +1 -1
  141. package/dist/cloud-workspace/runtime/model-production.d.ts +31 -31
  142. package/dist/cloud-workspace/runtime/native-history.d.ts.map +1 -1
  143. package/dist/cloud-workspace/runtime/native-history.js +2 -2
  144. package/dist/cloud-workspace/runtime/native-history.js.map +1 -1
  145. package/dist/cloud-workspace/runtime/operations.d.ts +100 -12
  146. package/dist/cloud-workspace/runtime/operations.d.ts.map +1 -1
  147. package/dist/cloud-workspace/runtime/operations.js +7 -2
  148. package/dist/cloud-workspace/runtime/operations.js.map +1 -1
  149. package/dist/cloud-workspace/runtime/parameter-agent.d.ts +2 -2
  150. package/dist/cloud-workspace/runtime/parameter-locales.d.ts +2 -2
  151. package/dist/cloud-workspace/runtime/parameters.d.ts +34 -14
  152. package/dist/cloud-workspace/runtime/parameters.d.ts.map +1 -1
  153. package/dist/cloud-workspace/runtime/parameters.js +87 -28
  154. package/dist/cloud-workspace/runtime/parameters.js.map +1 -1
  155. package/dist/cloud-workspace/runtime/preview-runtime.d.ts +2 -2
  156. package/dist/cloud-workspace/runtime/previews.d.ts +8 -7
  157. package/dist/cloud-workspace/runtime/previews.d.ts.map +1 -1
  158. package/dist/cloud-workspace/runtime/production-inputs.d.ts +283 -0
  159. package/dist/cloud-workspace/runtime/production-inputs.d.ts.map +1 -0
  160. package/dist/cloud-workspace/runtime/production-inputs.js +174 -0
  161. package/dist/cloud-workspace/runtime/production-inputs.js.map +1 -0
  162. package/dist/cloud-workspace/runtime/project-preparation.d.ts +307 -0
  163. package/dist/cloud-workspace/runtime/project-preparation.d.ts.map +1 -0
  164. package/dist/cloud-workspace/runtime/project-preparation.js +110 -0
  165. package/dist/cloud-workspace/runtime/project-preparation.js.map +1 -0
  166. package/dist/cloud-workspace/runtime/prompt-enhancement.d.ts +1286 -0
  167. package/dist/cloud-workspace/runtime/prompt-enhancement.d.ts.map +1 -0
  168. package/dist/cloud-workspace/runtime/prompt-enhancement.js +321 -0
  169. package/dist/cloud-workspace/runtime/prompt-enhancement.js.map +1 -0
  170. package/dist/cloud-workspace/runtime/remix-references.d.ts +100 -44
  171. package/dist/cloud-workspace/runtime/remix-references.d.ts.map +1 -1
  172. package/dist/cloud-workspace/runtime/remix-references.js +71 -21
  173. package/dist/cloud-workspace/runtime/remix-references.js.map +1 -1
  174. package/dist/cloud-workspace/runtime/resource-grant.d.ts +1 -1
  175. package/dist/cloud-workspace/runtime/resource-grant.d.ts.map +1 -1
  176. package/dist/cloud-workspace/runtime/resource-grant.js +2 -2
  177. package/dist/cloud-workspace/runtime/resource-grant.js.map +1 -1
  178. package/dist/cloud-workspace/runtime/runtime-sha256.d.ts +3 -0
  179. package/dist/cloud-workspace/runtime/runtime-sha256.d.ts.map +1 -0
  180. package/dist/cloud-workspace/runtime/runtime-sha256.js +11 -0
  181. package/dist/cloud-workspace/runtime/runtime-sha256.js.map +1 -0
  182. package/dist/cloud-workspace/runtime/scheduled-task-proposals.d.ts +9 -9
  183. package/dist/cloud-workspace/runtime/scheduled-tasks.d.ts +6 -5
  184. package/dist/cloud-workspace/runtime/scheduled-tasks.d.ts.map +1 -1
  185. package/dist/cloud-workspace/runtime/scheduled-tasks.js +2 -1
  186. package/dist/cloud-workspace/runtime/scheduled-tasks.js.map +1 -1
  187. package/dist/cloud-workspace/runtime/session-personalization.d.ts +35 -0
  188. package/dist/cloud-workspace/runtime/session-personalization.d.ts.map +1 -0
  189. package/dist/cloud-workspace/runtime/session-personalization.js +9 -0
  190. package/dist/cloud-workspace/runtime/session-personalization.js.map +1 -0
  191. package/dist/cloud-workspace/runtime/session-restore.d.ts +31 -0
  192. package/dist/cloud-workspace/runtime/session-restore.d.ts.map +1 -1
  193. package/dist/cloud-workspace/runtime/session-restore.js +10 -4
  194. package/dist/cloud-workspace/runtime/session-restore.js.map +1 -1
  195. package/dist/cloud-workspace/runtime/skill-activation.d.ts +4 -0
  196. package/dist/cloud-workspace/runtime/skill-activation.d.ts.map +1 -1
  197. package/dist/cloud-workspace/runtime/skill-activation.js +69 -22
  198. package/dist/cloud-workspace/runtime/skill-activation.js.map +1 -1
  199. package/dist/cloud-workspace/runtime/terminal-session.d.ts +1 -1
  200. package/dist/cloud-workspace/runtime/variant-workspace.d.ts +8 -8
  201. package/dist/cloud-workspace/runtime/workspace-binding.d.ts +4 -4
  202. package/dist/cloud-workspace/runtime/workspace-confirmation.d.ts +1956 -0
  203. package/dist/cloud-workspace/runtime/workspace-confirmation.d.ts.map +1 -0
  204. package/dist/cloud-workspace/runtime/workspace-confirmation.js +591 -0
  205. package/dist/cloud-workspace/runtime/workspace-confirmation.js.map +1 -0
  206. package/dist/cloud-workspace/runtime/workspace-directories.d.ts +2 -2
  207. package/dist/cloud-workspace/runtime/workspace-facts.d.ts +3 -2
  208. package/dist/cloud-workspace/runtime/workspace-facts.d.ts.map +1 -1
  209. package/dist/cloud-workspace/runtime/workspace-model-source.d.ts +291 -0
  210. package/dist/cloud-workspace/runtime/workspace-model-source.d.ts.map +1 -0
  211. package/dist/cloud-workspace/runtime/workspace-model-source.js +128 -0
  212. package/dist/cloud-workspace/runtime/workspace-model-source.js.map +1 -0
  213. package/dist/cloud-workspace/runtime/workspace-notifications.d.ts +1 -1
  214. package/dist/cloud-workspace/runtime/workspace-notifications.d.ts.map +1 -1
  215. package/dist/cloud-workspace/runtime/workspace-notifications.js +147 -52
  216. package/dist/cloud-workspace/runtime/workspace-notifications.js.map +1 -1
  217. package/dist/cloud-workspace/runtime/workspace-parameter-confirmation.d.ts +101 -0
  218. package/dist/cloud-workspace/runtime/workspace-parameter-confirmation.d.ts.map +1 -0
  219. package/dist/cloud-workspace/runtime/workspace-parameter-confirmation.js +160 -0
  220. package/dist/cloud-workspace/runtime/workspace-parameter-confirmation.js.map +1 -0
  221. package/dist/cloud-workspace/runtime/workspace-public-source.d.ts +67 -0
  222. package/dist/cloud-workspace/runtime/workspace-public-source.d.ts.map +1 -0
  223. package/dist/cloud-workspace/runtime/workspace-public-source.js +97 -0
  224. package/dist/cloud-workspace/runtime/workspace-public-source.js.map +1 -0
  225. package/dist/cloud-workspace/runtime/workspace-refs.d.ts +73 -0
  226. package/dist/cloud-workspace/runtime/workspace-refs.d.ts.map +1 -0
  227. package/dist/cloud-workspace/runtime/workspace-refs.js +106 -0
  228. package/dist/cloud-workspace/runtime/workspace-refs.js.map +1 -0
  229. package/dist/cloud-workspace/runtime/workspace-ui.d.ts +269 -13
  230. package/dist/cloud-workspace/runtime/workspace-ui.d.ts.map +1 -1
  231. package/dist/cloud-workspace/runtime/workspace-ui.js +196 -32
  232. package/dist/cloud-workspace/runtime/workspace-ui.js.map +1 -1
  233. package/dist/inspiration/index.d.ts +12 -12
  234. package/dist/model-proxy/captures.d.ts +2 -2
  235. package/dist/model-proxy/index.d.ts +1 -0
  236. package/dist/model-proxy/index.d.ts.map +1 -1
  237. package/dist/model-proxy/index.js +1 -0
  238. package/dist/model-proxy/index.js.map +1 -1
  239. package/dist/model-proxy/provider-stats.d.ts +38 -0
  240. package/dist/model-proxy/provider-stats.d.ts.map +1 -0
  241. package/dist/model-proxy/provider-stats.js +2 -0
  242. package/dist/model-proxy/provider-stats.js.map +1 -0
  243. package/dist/preview/preview-devices.d.ts +20 -0
  244. package/dist/preview/preview-devices.d.ts.map +1 -0
  245. package/dist/preview/preview-devices.js +46 -0
  246. package/dist/preview/preview-devices.js.map +1 -0
  247. package/dist/project-skills/index.d.ts +1 -0
  248. package/dist/project-skills/index.d.ts.map +1 -1
  249. package/dist/project-skills/index.js +1 -0
  250. package/dist/project-skills/index.js.map +1 -1
  251. package/dist/project-skills/inventory.d.ts.map +1 -1
  252. package/dist/project-skills/inventory.js +42 -13
  253. package/dist/project-skills/inventory.js.map +1 -1
  254. package/dist/project-skills/local-snapshot.d.ts.map +1 -1
  255. package/dist/project-skills/local-snapshot.js +36 -11
  256. package/dist/project-skills/local-snapshot.js.map +1 -1
  257. package/dist/project-skills/protocol.d.ts +1 -4
  258. package/dist/project-skills/protocol.d.ts.map +1 -1
  259. package/dist/project-skills/protocol.js +90 -52
  260. package/dist/project-skills/protocol.js.map +1 -1
  261. package/dist/project-skills/remote-discovery.d.ts +2 -2
  262. package/dist/project-skills/source-digest-node.d.ts +5 -0
  263. package/dist/project-skills/source-digest-node.d.ts.map +1 -0
  264. package/dist/project-skills/source-digest-node.js +26 -0
  265. package/dist/project-skills/source-digest-node.js.map +1 -0
  266. package/dist/storage/cos.d.ts +6 -0
  267. package/dist/storage/cos.d.ts.map +1 -1
  268. package/dist/storage/cos.js +38 -10
  269. package/dist/storage/cos.js.map +1 -1
  270. package/dist/storage/upload-build-artifacts.d.ts +12 -0
  271. package/dist/storage/upload-build-artifacts.d.ts.map +1 -1
  272. package/dist/storage/upload-build-artifacts.js +17 -15
  273. package/dist/storage/upload-build-artifacts.js.map +1 -1
  274. package/dist/team-memory.d.ts +33 -0
  275. package/dist/team-memory.d.ts.map +1 -0
  276. package/dist/team-memory.js +39 -0
  277. package/dist/team-memory.js.map +1 -0
  278. package/package.json +31 -12
@@ -1,11 +1,12 @@
1
1
  import { z } from 'zod';
2
+ import type { PublicEvent } from './events.js';
2
3
  export declare const workspaceUiRangeSchema: z.ZodObject<{
3
4
  startLine: z.ZodNumber;
4
5
  endLine: z.ZodNumber;
5
6
  }, z.core.$strict>;
6
7
  /** Observed browser state, separate from references explicitly selected by the user. */
7
8
  export declare const workspaceUiSnapshotSchema: z.ZodObject<{
8
- version: z.ZodLiteral<1>;
9
+ version: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
9
10
  viewId: z.ZodString;
10
11
  workspaceId: z.ZodString;
11
12
  directoryName: z.ZodString;
@@ -31,13 +32,13 @@ export declare const workspaceUiSnapshotSchema: z.ZodObject<{
31
32
  activeDelivery: z.ZodOptional<z.ZodObject<{
32
33
  buildId: z.ZodOptional<z.ZodString>;
33
34
  channel: z.ZodEnum<{
34
- google: "google";
35
- facebook: "facebook";
36
- tiktok: "tiktok";
37
35
  playcraft: "playcraft";
36
+ facebook: "facebook";
38
37
  snapchat: "snapchat";
39
38
  ironsource: "ironsource";
40
39
  applovin: "applovin";
40
+ google: "google";
41
+ tiktok: "tiktok";
41
42
  unity: "unity";
42
43
  liftoff: "liftoff";
43
44
  moloco: "moloco";
@@ -71,10 +72,10 @@ export declare const workspaceUiSnapshotSchema: z.ZodObject<{
71
72
  file: "file";
72
73
  document: "document";
73
74
  audio: "audio";
75
+ playable: "playable";
74
76
  model: "model";
75
77
  image: "image";
76
78
  video: "video";
77
- playable: "playable";
78
79
  }>>;
79
80
  versionCreatedAt: z.ZodOptional<z.ZodString>;
80
81
  isCurrentVersion: z.ZodOptional<z.ZodBoolean>;
@@ -103,6 +104,10 @@ export declare const workspaceUiCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObj
103
104
  directoryName: z.ZodString;
104
105
  sessionId: z.ZodString;
105
106
  expiresAt: z.ZodString;
107
+ intent: z.ZodOptional<z.ZodEnum<{
108
+ suggest: "suggest";
109
+ intervene: "intervene";
110
+ }>>;
106
111
  }, z.core.$strip>, z.ZodObject<{
107
112
  kind: z.ZodLiteral<"open_preview">;
108
113
  artifactId: z.ZodOptional<z.ZodString>;
@@ -114,16 +119,20 @@ export declare const workspaceUiCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObj
114
119
  directoryName: z.ZodString;
115
120
  sessionId: z.ZodString;
116
121
  expiresAt: z.ZodString;
122
+ intent: z.ZodOptional<z.ZodEnum<{
123
+ suggest: "suggest";
124
+ intervene: "intervene";
125
+ }>>;
117
126
  }, z.core.$strip>, z.ZodObject<{
118
127
  kind: z.ZodLiteral<"open_delivery">;
119
128
  channel: z.ZodOptional<z.ZodEnum<{
120
- google: "google";
121
- facebook: "facebook";
122
- tiktok: "tiktok";
123
129
  playcraft: "playcraft";
130
+ facebook: "facebook";
124
131
  snapchat: "snapchat";
125
132
  ironsource: "ironsource";
126
133
  applovin: "applovin";
134
+ google: "google";
135
+ tiktok: "tiktok";
127
136
  unity: "unity";
128
137
  liftoff: "liftoff";
129
138
  moloco: "moloco";
@@ -140,6 +149,10 @@ export declare const workspaceUiCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObj
140
149
  directoryName: z.ZodString;
141
150
  sessionId: z.ZodString;
142
151
  expiresAt: z.ZodString;
152
+ intent: z.ZodOptional<z.ZodEnum<{
153
+ suggest: "suggest";
154
+ intervene: "intervene";
155
+ }>>;
143
156
  }, z.core.$strip>, z.ZodObject<{
144
157
  kind: z.ZodLiteral<"open_task">;
145
158
  taskId: z.ZodOptional<z.ZodString>;
@@ -149,19 +162,26 @@ export declare const workspaceUiCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObj
149
162
  directoryName: z.ZodString;
150
163
  sessionId: z.ZodString;
151
164
  expiresAt: z.ZodString;
165
+ intent: z.ZodOptional<z.ZodEnum<{
166
+ suggest: "suggest";
167
+ intervene: "intervene";
168
+ }>>;
152
169
  }, z.core.$strip>], "kind">;
153
170
  export type WorkspaceUiCommand = z.infer<typeof workspaceUiCommandSchema>;
154
171
  export declare const workspaceUiResultSchema: z.ZodObject<{
155
172
  commandId: z.ZodString;
156
173
  viewId: z.ZodString;
174
+ protocolVersion: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
157
175
  status: z.ZodEnum<{
158
176
  failed: "failed";
159
177
  rejected: "rejected";
160
178
  opened: "opened";
179
+ deferred: "deferred";
180
+ suppressed: "suppressed";
161
181
  }>;
162
182
  reason: z.ZodOptional<z.ZodString>;
163
183
  snapshot: z.ZodOptional<z.ZodObject<{
164
- version: z.ZodLiteral<1>;
184
+ version: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
165
185
  viewId: z.ZodString;
166
186
  workspaceId: z.ZodString;
167
187
  directoryName: z.ZodString;
@@ -187,13 +207,13 @@ export declare const workspaceUiResultSchema: z.ZodObject<{
187
207
  activeDelivery: z.ZodOptional<z.ZodObject<{
188
208
  buildId: z.ZodOptional<z.ZodString>;
189
209
  channel: z.ZodEnum<{
190
- google: "google";
191
- facebook: "facebook";
192
- tiktok: "tiktok";
193
210
  playcraft: "playcraft";
211
+ facebook: "facebook";
194
212
  snapchat: "snapchat";
195
213
  ironsource: "ironsource";
196
214
  applovin: "applovin";
215
+ google: "google";
216
+ tiktok: "tiktok";
197
217
  unity: "unity";
198
218
  liftoff: "liftoff";
199
219
  moloco: "moloco";
@@ -227,10 +247,10 @@ export declare const workspaceUiResultSchema: z.ZodObject<{
227
247
  file: "file";
228
248
  document: "document";
229
249
  audio: "audio";
250
+ playable: "playable";
230
251
  model: "model";
231
252
  image: "image";
232
253
  video: "video";
233
- playable: "playable";
234
254
  }>>;
235
255
  versionCreatedAt: z.ZodOptional<z.ZodString>;
236
256
  isCurrentVersion: z.ZodOptional<z.ZodBoolean>;
@@ -245,8 +265,244 @@ export declare const workspaceUiResultSchema: z.ZodObject<{
245
265
  }, z.core.$strict>>;
246
266
  }, z.core.$strict>>;
247
267
  }, z.core.$strict>>;
268
+ anchor: z.ZodOptional<z.ZodObject<{
269
+ commandId: z.ZodString;
270
+ turnId: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strict>>;
248
272
  }, z.core.$strict>;
249
273
  export type WorkspaceUiResult = z.infer<typeof workspaceUiResultSchema>;
250
274
  export declare const WORKSPACE_UI_COMMAND_EVENT = "ui.command.requested";
251
275
  export declare const WORKSPACE_UI_RESULT_EVENT = "ui.command.resolved";
276
+ export declare const WORKSPACE_UI_SNAPSHOT_REQUEST_EVENT = "ui.snapshot.requested";
277
+ export declare const WORKSPACE_UI_SNAPSHOT_CLOSED_EVENT = "ui.snapshot.closed";
278
+ export declare const WORKSPACE_UI_SNAPSHOT_VERSION: 1;
279
+ /** The continuation's stable request ID identifies one frozen, server-timed observation exchange. */
280
+ export declare const workspaceUiSnapshotRequestSchema: z.ZodObject<{
281
+ expiresAt: z.ZodString;
282
+ version: z.ZodLiteral<1>;
283
+ requestId: z.ZodString;
284
+ viewId: z.ZodString;
285
+ workspaceId: z.ZodString;
286
+ directoryName: z.ZodString;
287
+ sessionId: z.ZodString;
288
+ runtimeId: z.ZodString;
289
+ generation: z.ZodNumber;
290
+ runtimeEpoch: z.ZodNumber;
291
+ }, z.core.$strict>;
292
+ export type WorkspaceUiSnapshotRequest = z.infer<typeof workspaceUiSnapshotRequestSchema>;
293
+ export type WorkspaceUiSnapshotRequestInput = Omit<WorkspaceUiSnapshotRequest, 'expiresAt'>;
294
+ /** A browser observes its current view; this is not a navigation or an opened receipt. */
295
+ export declare const workspaceUiSnapshotReplySchema: z.ZodObject<{
296
+ version: z.ZodLiteral<1>;
297
+ requestId: z.ZodString;
298
+ requestSequence: z.ZodNumber;
299
+ viewId: z.ZodString;
300
+ runtimeId: z.ZodString;
301
+ generation: z.ZodNumber;
302
+ runtimeEpoch: z.ZodNumber;
303
+ snapshot: z.ZodObject<{
304
+ viewId: z.ZodString;
305
+ workspaceId: z.ZodString;
306
+ directoryName: z.ZodString;
307
+ sessionId: z.ZodString;
308
+ revision: z.ZodNumber;
309
+ observedAt: z.ZodString;
310
+ panelOpen: z.ZodBoolean;
311
+ activeTab: z.ZodNullable<z.ZodString>;
312
+ openTabs: z.ZodArray<z.ZodString>;
313
+ activeFile: z.ZodOptional<z.ZodObject<{
314
+ path: z.ZodString;
315
+ range: z.ZodOptional<z.ZodObject<{
316
+ startLine: z.ZodNumber;
317
+ endLine: z.ZodNumber;
318
+ }, z.core.$strict>>;
319
+ dirty: z.ZodBoolean;
320
+ loadState: z.ZodEnum<{
321
+ error: "error";
322
+ ready: "ready";
323
+ loading: "loading";
324
+ }>;
325
+ }, z.core.$strict>>;
326
+ activeDelivery: z.ZodOptional<z.ZodObject<{
327
+ buildId: z.ZodOptional<z.ZodString>;
328
+ channel: z.ZodEnum<{
329
+ playcraft: "playcraft";
330
+ facebook: "facebook";
331
+ snapchat: "snapchat";
332
+ ironsource: "ironsource";
333
+ applovin: "applovin";
334
+ google: "google";
335
+ tiktok: "tiktok";
336
+ unity: "unity";
337
+ liftoff: "liftoff";
338
+ moloco: "moloco";
339
+ bigo: "bigo";
340
+ inmobi: "inmobi";
341
+ adikteev: "adikteev";
342
+ remerge: "remerge";
343
+ mintegral: "mintegral";
344
+ }>;
345
+ status: z.ZodOptional<z.ZodEnum<{
346
+ failed: "failed";
347
+ running: "running";
348
+ queued: "queued";
349
+ interrupted: "interrupted";
350
+ canceled: "canceled";
351
+ succeeded: "succeeded";
352
+ }>>;
353
+ }, z.core.$strict>>;
354
+ activeTask: z.ZodOptional<z.ZodObject<{
355
+ taskId: z.ZodOptional<z.ZodString>;
356
+ kind: z.ZodString;
357
+ status: z.ZodString;
358
+ }, z.core.$strict>>;
359
+ activePreview: z.ZodOptional<z.ZodObject<{
360
+ artifactId: z.ZodOptional<z.ZodString>;
361
+ versionId: z.ZodOptional<z.ZodString>;
362
+ previewId: z.ZodOptional<z.ZodString>;
363
+ name: z.ZodOptional<z.ZodString>;
364
+ path: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
365
+ kind: z.ZodOptional<z.ZodEnum<{
366
+ file: "file";
367
+ document: "document";
368
+ audio: "audio";
369
+ playable: "playable";
370
+ model: "model";
371
+ image: "image";
372
+ video: "video";
373
+ }>>;
374
+ versionCreatedAt: z.ZodOptional<z.ZodString>;
375
+ isCurrentVersion: z.ZodOptional<z.ZodBoolean>;
376
+ loadState: z.ZodEnum<{
377
+ error: "error";
378
+ ready: "ready";
379
+ loading: "loading";
380
+ }>;
381
+ viewport: z.ZodOptional<z.ZodObject<{
382
+ width: z.ZodNumber;
383
+ height: z.ZodNumber;
384
+ }, z.core.$strict>>;
385
+ }, z.core.$strict>>;
386
+ version: z.ZodLiteral<2>;
387
+ }, z.core.$strict>;
388
+ }, z.core.$strict>;
389
+ export type WorkspaceUiSnapshotReply = z.infer<typeof workspaceUiSnapshotReplySchema>;
390
+ /** A shared deadline closes to none once; a late reply can never change a dispatched payload. */
391
+ export declare const workspaceUiSnapshotClosedSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
392
+ requestSequence: z.ZodNumber;
393
+ status: z.ZodLiteral<"observed">;
394
+ snapshot: z.ZodObject<{
395
+ viewId: z.ZodString;
396
+ workspaceId: z.ZodString;
397
+ directoryName: z.ZodString;
398
+ sessionId: z.ZodString;
399
+ revision: z.ZodNumber;
400
+ observedAt: z.ZodString;
401
+ panelOpen: z.ZodBoolean;
402
+ activeTab: z.ZodNullable<z.ZodString>;
403
+ openTabs: z.ZodArray<z.ZodString>;
404
+ activeFile: z.ZodOptional<z.ZodObject<{
405
+ path: z.ZodString;
406
+ range: z.ZodOptional<z.ZodObject<{
407
+ startLine: z.ZodNumber;
408
+ endLine: z.ZodNumber;
409
+ }, z.core.$strict>>;
410
+ dirty: z.ZodBoolean;
411
+ loadState: z.ZodEnum<{
412
+ error: "error";
413
+ ready: "ready";
414
+ loading: "loading";
415
+ }>;
416
+ }, z.core.$strict>>;
417
+ activeDelivery: z.ZodOptional<z.ZodObject<{
418
+ buildId: z.ZodOptional<z.ZodString>;
419
+ channel: z.ZodEnum<{
420
+ playcraft: "playcraft";
421
+ facebook: "facebook";
422
+ snapchat: "snapchat";
423
+ ironsource: "ironsource";
424
+ applovin: "applovin";
425
+ google: "google";
426
+ tiktok: "tiktok";
427
+ unity: "unity";
428
+ liftoff: "liftoff";
429
+ moloco: "moloco";
430
+ bigo: "bigo";
431
+ inmobi: "inmobi";
432
+ adikteev: "adikteev";
433
+ remerge: "remerge";
434
+ mintegral: "mintegral";
435
+ }>;
436
+ status: z.ZodOptional<z.ZodEnum<{
437
+ failed: "failed";
438
+ running: "running";
439
+ queued: "queued";
440
+ interrupted: "interrupted";
441
+ canceled: "canceled";
442
+ succeeded: "succeeded";
443
+ }>>;
444
+ }, z.core.$strict>>;
445
+ activeTask: z.ZodOptional<z.ZodObject<{
446
+ taskId: z.ZodOptional<z.ZodString>;
447
+ kind: z.ZodString;
448
+ status: z.ZodString;
449
+ }, z.core.$strict>>;
450
+ activePreview: z.ZodOptional<z.ZodObject<{
451
+ artifactId: z.ZodOptional<z.ZodString>;
452
+ versionId: z.ZodOptional<z.ZodString>;
453
+ previewId: z.ZodOptional<z.ZodString>;
454
+ name: z.ZodOptional<z.ZodString>;
455
+ path: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
456
+ kind: z.ZodOptional<z.ZodEnum<{
457
+ file: "file";
458
+ document: "document";
459
+ audio: "audio";
460
+ playable: "playable";
461
+ model: "model";
462
+ image: "image";
463
+ video: "video";
464
+ }>>;
465
+ versionCreatedAt: z.ZodOptional<z.ZodString>;
466
+ isCurrentVersion: z.ZodOptional<z.ZodBoolean>;
467
+ loadState: z.ZodEnum<{
468
+ error: "error";
469
+ ready: "ready";
470
+ loading: "loading";
471
+ }>;
472
+ viewport: z.ZodOptional<z.ZodObject<{
473
+ width: z.ZodNumber;
474
+ height: z.ZodNumber;
475
+ }, z.core.$strict>>;
476
+ }, z.core.$strict>>;
477
+ version: z.ZodLiteral<2>;
478
+ }, z.core.$strict>;
479
+ version: z.ZodLiteral<1>;
480
+ requestId: z.ZodString;
481
+ viewId: z.ZodString;
482
+ workspaceId: z.ZodString;
483
+ directoryName: z.ZodString;
484
+ sessionId: z.ZodString;
485
+ runtimeId: z.ZodString;
486
+ generation: z.ZodNumber;
487
+ runtimeEpoch: z.ZodNumber;
488
+ }, z.core.$strict>, z.ZodObject<{
489
+ requestSequence: z.ZodNumber;
490
+ status: z.ZodLiteral<"unavailable">;
491
+ version: z.ZodLiteral<1>;
492
+ requestId: z.ZodString;
493
+ viewId: z.ZodString;
494
+ workspaceId: z.ZodString;
495
+ directoryName: z.ZodString;
496
+ sessionId: z.ZodString;
497
+ runtimeId: z.ZodString;
498
+ generation: z.ZodNumber;
499
+ runtimeEpoch: z.ZodNumber;
500
+ }, z.core.$strict>], "status">;
501
+ export type WorkspaceUiSnapshotClosed = z.infer<typeof workspaceUiSnapshotClosedSchema>;
502
+ export type WorkspaceUiSnapshotExchange = {
503
+ request: PublicEvent;
504
+ closed?: PublicEvent;
505
+ };
506
+ /** Native output cannot mint a platform observation challenge, including through notifications. */
507
+ export declare function isWorkspaceUiSnapshotRequestEvent(event: PublicEvent): boolean;
252
508
  //# sourceMappingURL=workspace-ui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-ui.d.ts","sourceRoot":"","sources":["../../../src/cloud-workspace/runtime/workspace-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,sBAAsB;;;kBAG8C,CAAC;AAElF,wFAAwF;AACxF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+C3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAY5E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAQnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAWlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,eAAO,MAAM,yBAAyB,wBAAwB,CAAC"}
1
+ {"version":3,"file":"workspace-ui.d.ts","sourceRoot":"","sources":["../../../src/cloud-workspace/runtime/workspace-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/C,eAAO,MAAM,sBAAsB;;;kBAMuC,CAAC;AAE3E,wFAAwF;AACxF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8E3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAc5E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAqBnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmDhC,CAAC;AACL,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAE/D,eAAO,MAAM,mCAAmC,0BAA0B,CAAC;AAC3E,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,6BAA6B,EAAG,CAAU,CAAC;AAcxD,qGAAqG;AACrG,eAAO,MAAM,gCAAgC;;;;;;;;;;;kBAKlC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAC;AAE5F,0FAA0F;AAC1F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAYqC,CAAC;AACjF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,iGAAiG;AACjG,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAwBxC,CAAC;AACL,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,2BAA2B,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAEzF,mGAAmG;AACnG,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAY7E"}
@@ -3,16 +3,22 @@ import { workspaceRelativePathSchema } from './files.js';
3
3
  import { workspaceDirectoryNameSchema } from './workspace-directories.js';
4
4
  import { isWorkspaceArtifactOutputPath, WORKSPACE_ARTIFACT_KINDS } from './artifacts.js';
5
5
  import { DELIVERY_CHANNELS } from './delivery.js';
6
+ import { runtimeSha256Text } from './runtime-sha256.js';
6
7
  const identity = z.string().min(1).max(256);
7
8
  const tab = z.string().min(1).max(2048);
8
9
  const loadState = z.enum(['loading', 'ready', 'error']);
9
- export const workspaceUiRangeSchema = z.object({
10
+ export const workspaceUiRangeSchema = z
11
+ .object({
10
12
  startLine: z.number().int().positive().max(1_000_000),
11
13
  endLine: z.number().int().positive().max(1_000_000),
12
- }).strict().refine(value => value.endLine >= value.startLine, 'invalid_ui_range');
14
+ })
15
+ .strict()
16
+ .refine((value) => value.endLine >= value.startLine, 'invalid_ui_range');
13
17
  /** Observed browser state, separate from references explicitly selected by the user. */
14
- export const workspaceUiSnapshotSchema = z.object({
15
- version: z.literal(1),
18
+ export const workspaceUiSnapshotSchema = z
19
+ .object({
20
+ // v1 legacy; v2 adds the panel-follow protocol. Front end only emits a version the runtime supports.
21
+ version: z.union([z.literal(1), z.literal(2)]),
16
22
  viewId: identity,
17
23
  workspaceId: identity,
18
24
  directoryName: workspaceDirectoryNameSchema,
@@ -22,43 +28,72 @@ export const workspaceUiSnapshotSchema = z.object({
22
28
  panelOpen: z.boolean(),
23
29
  activeTab: tab.nullable(),
24
30
  openTabs: z.array(tab).max(32),
25
- activeFile: z.object({
31
+ activeFile: z
32
+ .object({
26
33
  path: workspaceRelativePathSchema,
27
34
  range: workspaceUiRangeSchema.optional(),
28
35
  dirty: z.boolean(),
29
36
  loadState,
30
- }).strict().optional(),
31
- activeDelivery: z.object({
37
+ })
38
+ .strict()
39
+ .optional(),
40
+ activeDelivery: z
41
+ .object({
32
42
  buildId: identity.optional(),
33
43
  channel: z.enum(DELIVERY_CHANNELS),
34
- status: z.enum(['queued', 'running', 'succeeded', 'failed', 'canceled', 'interrupted']).optional(),
35
- }).strict().optional(),
36
- activeTask: z.object({
44
+ status: z
45
+ .enum(['queued', 'running', 'succeeded', 'failed', 'canceled', 'interrupted'])
46
+ .optional(),
47
+ })
48
+ .strict()
49
+ .optional(),
50
+ activeTask: z
51
+ .object({
37
52
  taskId: identity.optional(),
38
53
  kind: z.string().min(1).max(64),
39
54
  status: z.string().min(1).max(32),
40
- }).strict().optional(),
41
- activePreview: z.object({
55
+ })
56
+ .strict()
57
+ .optional(),
58
+ activePreview: z
59
+ .object({
42
60
  artifactId: identity.optional(),
43
61
  versionId: identity.optional(),
44
62
  previewId: identity.optional(),
45
63
  name: z.string().min(1).max(512).optional(),
46
- path: workspaceRelativePathSchema.refine(isWorkspaceArtifactOutputPath, 'invalid_preview_output_path').optional(),
64
+ path: workspaceRelativePathSchema
65
+ .refine(isWorkspaceArtifactOutputPath, 'invalid_preview_output_path')
66
+ .optional(),
47
67
  kind: z.enum(WORKSPACE_ARTIFACT_KINDS).optional(),
48
68
  versionCreatedAt: z.string().datetime().optional(),
49
69
  isCurrentVersion: z.boolean().optional(),
50
70
  loadState,
51
- viewport: z.object({
71
+ viewport: z
72
+ .object({
52
73
  width: z.number().int().positive().max(16384),
53
74
  height: z.number().int().positive().max(16384),
54
- }).strict().optional(),
55
- }).strict().superRefine((value, context) => {
56
- const hasVersionDetails = [value.name, value.path, value.kind, value.versionCreatedAt, value.isCurrentVersion]
57
- .some(field => field !== undefined);
75
+ })
76
+ .strict()
77
+ .optional(),
78
+ })
79
+ .strict()
80
+ .superRefine((value, context) => {
81
+ const hasVersionDetails = [
82
+ value.name,
83
+ value.path,
84
+ value.kind,
85
+ value.versionCreatedAt,
86
+ value.isCurrentVersion,
87
+ ].some((field) => field !== undefined);
58
88
  if (hasVersionDetails && (!value.artifactId || !value.versionId))
59
- context.addIssue({ code: z.ZodIssueCode.custom, message: 'preview_details_require_version' });
60
- }).optional(),
61
- }).strict();
89
+ context.addIssue({
90
+ code: z.ZodIssueCode.custom,
91
+ message: 'preview_details_require_version',
92
+ });
93
+ })
94
+ .optional(),
95
+ })
96
+ .strict();
62
97
  const commandScope = {
63
98
  commandId: identity,
64
99
  viewId: identity,
@@ -66,29 +101,158 @@ const commandScope = {
66
101
  directoryName: workspaceDirectoryNameSchema,
67
102
  sessionId: identity,
68
103
  expiresAt: z.string().datetime(),
104
+ // v2 follow intent; absent = legacy forced navigation. `navigate` is front-end-local, not in the enum.
105
+ intent: z.enum(['suggest', 'intervene']).optional(),
69
106
  };
70
107
  // Native event envelopes may add tracing fields; only these validated fields are executable.
71
108
  export const workspaceUiCommandSchema = z.discriminatedUnion('kind', [
72
- z.object({ ...commandScope, kind: z.literal('open_file'), path: workspaceRelativePathSchema,
73
- range: workspaceUiRangeSchema.optional() }),
74
- z.object({ ...commandScope, kind: z.literal('open_preview'), artifactId: identity.optional(),
75
- versionId: identity.optional(), previewId: identity.optional() }),
76
- z.object({ ...commandScope, kind: z.literal('open_delivery'), channel: z.enum(DELIVERY_CHANNELS).optional(),
77
- buildId: identity.optional() }),
109
+ z.object({
110
+ ...commandScope,
111
+ kind: z.literal('open_file'),
112
+ path: workspaceRelativePathSchema,
113
+ range: workspaceUiRangeSchema.optional(),
114
+ }),
115
+ z.object({
116
+ ...commandScope,
117
+ kind: z.literal('open_preview'),
118
+ artifactId: identity.optional(),
119
+ versionId: identity.optional(),
120
+ previewId: identity.optional(),
121
+ }),
122
+ z.object({
123
+ ...commandScope,
124
+ kind: z.literal('open_delivery'),
125
+ channel: z.enum(DELIVERY_CHANNELS).optional(),
126
+ buildId: identity.optional(),
127
+ }),
78
128
  z.object({ ...commandScope, kind: z.literal('open_task'), taskId: identity.optional() }),
79
129
  ]);
80
- export const workspaceUiResultSchema = z.object({
130
+ export const workspaceUiResultSchema = z
131
+ .object({
81
132
  commandId: identity,
82
133
  viewId: identity,
83
- status: z.enum(['opened', 'rejected', 'failed']),
134
+ // Absent / 1 = v1; 2 = v2. deferred/suppressed and anchor are only legal on a v2 result.
135
+ protocolVersion: z.union([z.literal(1), z.literal(2)]).optional(),
136
+ status: z.enum(['opened', 'rejected', 'failed', 'deferred', 'suppressed']),
84
137
  reason: z.string().min(1).max(256).optional(),
85
138
  snapshot: workspaceUiSnapshotSchema.optional(),
86
- }).strict().superRefine((value, context) => {
139
+ // deferred/suppressed leave an anchor pointing back at the command (and, best-effort, its turn).
140
+ anchor: z.object({ commandId: identity, turnId: identity.optional() }).strict().optional(),
141
+ })
142
+ .strict()
143
+ .superRefine((value, context) => {
144
+ const isDeferredLike = value.status === 'deferred' || value.status === 'suppressed';
87
145
  if (value.status === 'opened' && !value.snapshot)
88
- context.addIssue({ code: z.ZodIssueCode.custom, path: ['snapshot'], message: 'opened_requires_snapshot' });
146
+ context.addIssue({
147
+ code: z.ZodIssueCode.custom,
148
+ path: ['snapshot'],
149
+ message: 'opened_requires_snapshot',
150
+ });
89
151
  if (value.snapshot && value.snapshot.viewId !== value.viewId)
90
- context.addIssue({ code: z.ZodIssueCode.custom, path: ['snapshot', 'viewId'], message: 'ui_view_mismatch' });
152
+ context.addIssue({
153
+ code: z.ZodIssueCode.custom,
154
+ path: ['snapshot', 'viewId'],
155
+ message: 'ui_view_mismatch',
156
+ });
157
+ if (isDeferredLike && value.protocolVersion !== 2)
158
+ context.addIssue({
159
+ code: z.ZodIssueCode.custom,
160
+ path: ['status'],
161
+ message: 'deferred_requires_v2',
162
+ });
163
+ if (isDeferredLike && value.snapshot)
164
+ context.addIssue({
165
+ code: z.ZodIssueCode.custom,
166
+ path: ['snapshot'],
167
+ message: 'deferred_forbids_snapshot',
168
+ });
169
+ if (isDeferredLike && !value.anchor)
170
+ context.addIssue({
171
+ code: z.ZodIssueCode.custom,
172
+ path: ['anchor'],
173
+ message: 'deferred_requires_anchor',
174
+ });
175
+ if (isDeferredLike && value.anchor && value.anchor.commandId !== value.commandId)
176
+ context.addIssue({
177
+ code: z.ZodIssueCode.custom,
178
+ path: ['anchor', 'commandId'],
179
+ message: 'anchor_command_mismatch',
180
+ });
91
181
  });
92
182
  export const WORKSPACE_UI_COMMAND_EVENT = 'ui.command.requested';
93
183
  export const WORKSPACE_UI_RESULT_EVENT = 'ui.command.resolved';
184
+ export const WORKSPACE_UI_SNAPSHOT_REQUEST_EVENT = 'ui.snapshot.requested';
185
+ export const WORKSPACE_UI_SNAPSHOT_CLOSED_EVENT = 'ui.snapshot.closed';
186
+ export const WORKSPACE_UI_SNAPSHOT_VERSION = 1;
187
+ const snapshotExchangeScope = {
188
+ version: z.literal(WORKSPACE_UI_SNAPSHOT_VERSION),
189
+ requestId: z.string().uuid(),
190
+ viewId: identity,
191
+ workspaceId: identity,
192
+ directoryName: workspaceDirectoryNameSchema,
193
+ sessionId: identity,
194
+ runtimeId: identity,
195
+ generation: z.number().int().nonnegative(),
196
+ runtimeEpoch: z.number().int().nonnegative(),
197
+ };
198
+ /** The continuation's stable request ID identifies one frozen, server-timed observation exchange. */
199
+ export const workspaceUiSnapshotRequestSchema = z
200
+ .object({
201
+ ...snapshotExchangeScope,
202
+ expiresAt: z.string().datetime(),
203
+ })
204
+ .strict();
205
+ /** A browser observes its current view; this is not a navigation or an opened receipt. */
206
+ export const workspaceUiSnapshotReplySchema = z
207
+ .object({
208
+ version: z.literal(WORKSPACE_UI_SNAPSHOT_VERSION),
209
+ requestId: z.string().uuid(),
210
+ requestSequence: z.number().int().positive(),
211
+ viewId: identity,
212
+ runtimeId: identity,
213
+ generation: z.number().int().nonnegative(),
214
+ runtimeEpoch: z.number().int().nonnegative(),
215
+ snapshot: workspaceUiSnapshotSchema.extend({ version: z.literal(2) }),
216
+ })
217
+ .strict()
218
+ .refine((value) => value.snapshot.viewId === value.viewId, 'ui_view_mismatch');
219
+ /** A shared deadline closes to none once; a late reply can never change a dispatched payload. */
220
+ export const workspaceUiSnapshotClosedSchema = z
221
+ .discriminatedUnion('status', [
222
+ z
223
+ .object({
224
+ ...snapshotExchangeScope,
225
+ requestSequence: z.number().int().positive(),
226
+ status: z.literal('observed'),
227
+ snapshot: workspaceUiSnapshotSchema.extend({ version: z.literal(2) }),
228
+ })
229
+ .strict(),
230
+ z
231
+ .object({
232
+ ...snapshotExchangeScope,
233
+ requestSequence: z.number().int().positive(),
234
+ status: z.literal('unavailable'),
235
+ })
236
+ .strict(),
237
+ ])
238
+ .superRefine((value, context) => {
239
+ if (value.status !== 'observed')
240
+ return;
241
+ for (const key of ['viewId', 'workspaceId', 'directoryName', 'sessionId']) {
242
+ if (value.snapshot[key] !== value[key])
243
+ context.addIssue({ code: 'custom', path: ['snapshot', key], message: 'ui_scope_mismatch' });
244
+ }
245
+ });
246
+ /** Native output cannot mint a platform observation challenge, including through notifications. */
247
+ export function isWorkspaceUiSnapshotRequestEvent(event) {
248
+ const parsed = workspaceUiSnapshotRequestSchema.safeParse(event.payload);
249
+ return (parsed.success &&
250
+ event.type === WORKSPACE_UI_SNAPSHOT_REQUEST_EVENT &&
251
+ event.streamKind === 'workspace' &&
252
+ event.streamId === parsed.data.workspaceId &&
253
+ event.source?.runtimeId === `platform:${runtimeSha256Text(`workspace:${event.streamId}`)}` &&
254
+ event.source.generation === 0 &&
255
+ event.source.runtimeEpoch === 0 &&
256
+ event.source.sourceSequence === event.sequence);
257
+ }
94
258
  //# sourceMappingURL=workspace-ui.js.map