@imgly/codesign-mcp 0.7.2 → 0.7.3-next.20261125135902.gfdc6ee3

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 (539) hide show
  1. package/README.md +35 -17
  2. package/dist/cli/license.js +1 -1
  3. package/dist/runtime/cli/commands.d.ts +2 -0
  4. package/dist/runtime/cli/commands.d.ts.map +1 -1
  5. package/dist/runtime/cli/commands.js +56 -1
  6. package/dist/runtime/cli/commands.js.map +1 -1
  7. package/dist/runtime/cli/main.d.ts.map +1 -1
  8. package/dist/runtime/cli/main.js +5 -0
  9. package/dist/runtime/cli/main.js.map +1 -1
  10. package/dist/runtime/codesign-shim/codesign-router/protocol/types.mjs +1 -0
  11. package/dist/runtime/codesign-shim/codesign-router/release-build.generated.mjs +1 -1
  12. package/dist/server-client-types/protocol/types.d.ts +25 -3
  13. package/dist/server-client.mjs +1 -0
  14. package/dist/server.d.ts +2 -0
  15. package/dist/server.d.ts.map +1 -1
  16. package/dist/server.js +4 -2
  17. package/dist/server.js.map +1 -1
  18. package/node_modules/@imgly/codesign-billing/README.md +138 -0
  19. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/charge.d.ts +30 -5
  20. package/node_modules/@imgly/codesign-billing/dist/charge.d.ts.map +1 -0
  21. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/charge.js +16 -1
  22. package/node_modules/@imgly/codesign-billing/dist/charge.js.map +1 -0
  23. package/node_modules/@imgly/codesign-billing/dist/charges.d.ts +71 -0
  24. package/node_modules/@imgly/codesign-billing/dist/charges.d.ts.map +1 -0
  25. package/node_modules/@imgly/codesign-billing/dist/charges.js +198 -0
  26. package/node_modules/@imgly/codesign-billing/dist/charges.js.map +1 -0
  27. package/node_modules/@imgly/codesign-billing/dist/index.d.ts +6 -0
  28. package/node_modules/@imgly/codesign-billing/dist/index.d.ts.map +1 -0
  29. package/node_modules/@imgly/codesign-billing/dist/index.js +6 -0
  30. package/node_modules/@imgly/codesign-billing/dist/index.js.map +1 -0
  31. package/node_modules/@imgly/codesign-billing/dist/ledger.d.ts +55 -0
  32. package/node_modules/@imgly/codesign-billing/dist/ledger.d.ts.map +1 -0
  33. package/node_modules/@imgly/codesign-billing/dist/ledger.js +80 -0
  34. package/node_modules/@imgly/codesign-billing/dist/ledger.js.map +1 -0
  35. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/metering.d.ts +9 -1
  36. package/node_modules/@imgly/codesign-billing/dist/metering.d.ts.map +1 -0
  37. package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/metering.js +77 -21
  38. package/node_modules/@imgly/codesign-billing/dist/metering.js.map +1 -0
  39. package/node_modules/@imgly/codesign-billing/dist/refusal.d.ts +20 -0
  40. package/node_modules/@imgly/codesign-billing/dist/refusal.d.ts.map +1 -0
  41. package/node_modules/@imgly/codesign-billing/dist/refusal.js +13 -0
  42. package/node_modules/@imgly/codesign-billing/dist/refusal.js.map +1 -0
  43. package/node_modules/@imgly/codesign-billing/package.json +30 -0
  44. package/node_modules/@imgly/codesign-router/dist/config/unit-config.d.ts +13 -5
  45. package/node_modules/@imgly/codesign-router/dist/config/unit-config.d.ts.map +1 -1
  46. package/node_modules/@imgly/codesign-router/dist/config/unit-config.js +18 -12
  47. package/node_modules/@imgly/codesign-router/dist/config/unit-config.js.map +1 -1
  48. package/node_modules/@imgly/codesign-router/dist/consent.d.ts +6 -2
  49. package/node_modules/@imgly/codesign-router/dist/consent.d.ts.map +1 -1
  50. package/node_modules/@imgly/codesign-router/dist/consent.js +65 -9
  51. package/node_modules/@imgly/codesign-router/dist/consent.js.map +1 -1
  52. package/node_modules/@imgly/codesign-router/dist/protocol/types.d.ts +25 -3
  53. package/node_modules/@imgly/codesign-router/dist/protocol/types.d.ts.map +1 -1
  54. package/node_modules/@imgly/codesign-router/dist/protocol/types.js +1 -0
  55. package/node_modules/@imgly/codesign-router/dist/protocol/types.js.map +1 -1
  56. package/node_modules/@imgly/codesign-router/dist/release-build.generated.d.ts +1 -1
  57. package/node_modules/@imgly/codesign-router/dist/release-build.generated.d.ts.map +1 -1
  58. package/node_modules/@imgly/codesign-router/dist/release-build.generated.js +1 -1
  59. package/node_modules/@imgly/codesign-router/dist/release-build.generated.js.map +1 -1
  60. package/node_modules/@imgly/codesign-router/dist/router/channels-v2.d.ts.map +1 -1
  61. package/node_modules/@imgly/codesign-router/dist/router/channels-v2.js +14 -4
  62. package/node_modules/@imgly/codesign-router/dist/router/channels-v2.js.map +1 -1
  63. package/node_modules/@imgly/codesign-router/dist/router/main.d.ts.map +1 -1
  64. package/node_modules/@imgly/codesign-router/dist/router/main.js +9 -1
  65. package/node_modules/@imgly/codesign-router/dist/router/main.js.map +1 -1
  66. package/node_modules/@imgly/codesign-sdk/CHANGELOG.md +24 -0
  67. package/node_modules/@imgly/codesign-sdk/README.md +8 -7
  68. package/node_modules/@imgly/codesign-sdk/dist/abort.d.ts +1 -0
  69. package/node_modules/@imgly/codesign-sdk/dist/abort.js +18 -0
  70. package/node_modules/@imgly/codesign-sdk/dist/assets/inline.generated.js +12 -12
  71. package/node_modules/@imgly/codesign-sdk/dist/browser/index.d.ts +1 -1
  72. package/node_modules/@imgly/codesign-sdk/dist/browser/worker.d.ts +1 -1
  73. package/node_modules/@imgly/codesign-sdk/dist/browser/worker.js +15 -8
  74. package/node_modules/@imgly/codesign-sdk/dist/cesdk-utils/index.js +2 -0
  75. package/node_modules/@imgly/codesign-sdk/dist/codesign-error.d.ts +38 -1
  76. package/node_modules/@imgly/codesign-sdk/dist/codesign-error.js +9 -0
  77. package/node_modules/@imgly/codesign-sdk/dist/codesign.d.ts +19 -12
  78. package/node_modules/@imgly/codesign-sdk/dist/codesign.js +268 -43
  79. package/node_modules/@imgly/codesign-sdk/dist/design/animatable.generated.js +3 -0
  80. package/node_modules/@imgly/codesign-sdk/dist/design/capabilities.generated.js +1 -0
  81. package/node_modules/@imgly/codesign-sdk/dist/design/facade.d.ts +1 -1
  82. package/node_modules/@imgly/codesign-sdk/dist/design/facade.js +128 -36
  83. package/node_modules/@imgly/codesign-sdk/dist/design/keyframes.js +2 -1
  84. package/node_modules/@imgly/codesign-sdk/dist/design/lint.d.ts +1 -1
  85. package/node_modules/@imgly/codesign-sdk/dist/design/lint.js +82 -5
  86. package/node_modules/@imgly/codesign-sdk/dist/design/props.generated.js +3 -0
  87. package/node_modules/@imgly/codesign-sdk/dist/design/run-offsets.d.ts +10 -0
  88. package/node_modules/@imgly/codesign-sdk/dist/design/run-offsets.js +26 -0
  89. package/node_modules/@imgly/codesign-sdk/dist/design/scene-lint.d.ts +23 -1
  90. package/node_modules/@imgly/codesign-sdk/dist/design/scene-lint.js +194 -3
  91. package/node_modules/@imgly/codesign-sdk/dist/design/timeline-poses.d.ts +8 -0
  92. package/node_modules/@imgly/codesign-sdk/dist/design/timeline-poses.js +53 -0
  93. package/node_modules/@imgly/codesign-sdk/dist/design/variables.d.ts +14 -0
  94. package/node_modules/@imgly/codesign-sdk/dist/design/variables.js +250 -37
  95. package/node_modules/@imgly/codesign-sdk/dist/designs/s3-presigner.d.ts +50 -0
  96. package/node_modules/@imgly/codesign-sdk/dist/designs/s3-presigner.js +116 -0
  97. package/node_modules/@imgly/codesign-sdk/dist/designs/types.d.ts +79 -3
  98. package/node_modules/@imgly/codesign-sdk/dist/engine/audio-extract.d.ts +12 -1
  99. package/node_modules/@imgly/codesign-sdk/dist/engine/audio-extract.js +20 -4
  100. package/node_modules/@imgly/codesign-sdk/dist/engine/engine-capacity.d.ts +20 -7
  101. package/node_modules/@imgly/codesign-sdk/dist/engine/engine-capacity.js +31 -14
  102. package/node_modules/@imgly/codesign-sdk/dist/engine/headless.d.ts +4 -0
  103. package/node_modules/@imgly/codesign-sdk/dist/engine/headless.js +20 -0
  104. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/check.d.ts +1 -14
  105. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/check.js +2 -7
  106. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/metered.d.ts +1 -2
  107. package/node_modules/@imgly/codesign-sdk/dist/executor/billing/metered.js +120 -91
  108. package/node_modules/@imgly/codesign-sdk/dist/executor/encode-watchdog.d.ts +2 -2
  109. package/node_modules/@imgly/codesign-sdk/dist/executor/encode-watchdog.js +10 -4
  110. package/node_modules/@imgly/codesign-sdk/dist/executor/engine-protocol.d.ts +1 -1
  111. package/node_modules/@imgly/codesign-sdk/dist/executor/engine-protocol.js +13 -3
  112. package/node_modules/@imgly/codesign-sdk/dist/executor/executor-options.d.ts +6 -7
  113. package/node_modules/@imgly/codesign-sdk/dist/executor/executor-options.js +14 -7
  114. package/node_modules/@imgly/codesign-sdk/dist/executor/handler.d.ts +47 -2
  115. package/node_modules/@imgly/codesign-sdk/dist/executor/handler.js +519 -8
  116. package/node_modules/@imgly/codesign-sdk/dist/executor/node.d.ts +42 -6
  117. package/node_modules/@imgly/codesign-sdk/dist/executor/node.js +231 -9
  118. package/node_modules/@imgly/codesign-sdk/dist/exporters/fig.d.ts +13 -0
  119. package/node_modules/@imgly/codesign-sdk/dist/exporters/fig.js +28 -0
  120. package/node_modules/@imgly/codesign-sdk/dist/exporters/html.d.ts +18 -2
  121. package/node_modules/@imgly/codesign-sdk/dist/exporters/html.js +129 -15
  122. package/node_modules/@imgly/codesign-sdk/dist/exporters/index.d.ts +5 -2
  123. package/node_modules/@imgly/codesign-sdk/dist/exporters/index.js +2 -2
  124. package/node_modules/@imgly/codesign-sdk/dist/exporters/node.d.ts +1 -1
  125. package/node_modules/@imgly/codesign-sdk/dist/exporters/node.js +4 -3
  126. package/node_modules/@imgly/codesign-sdk/dist/exporters/psd.js +1 -1
  127. package/node_modules/@imgly/codesign-sdk/dist/formats/av-limit.d.ts +2 -0
  128. package/node_modules/@imgly/codesign-sdk/dist/formats/av-limit.js +1 -1
  129. package/node_modules/@imgly/codesign-sdk/dist/formats/design-sniff.d.ts +3 -1
  130. package/node_modules/@imgly/codesign-sdk/dist/formats/design-sniff.js +7 -0
  131. package/node_modules/@imgly/codesign-sdk/dist/formats/import-registry.d.ts +1 -1
  132. package/node_modules/@imgly/codesign-sdk/dist/formats/import-registry.js +4 -2
  133. package/node_modules/@imgly/codesign-sdk/dist/formats/import-warnings.d.ts +5 -0
  134. package/node_modules/@imgly/codesign-sdk/dist/formats/import-warnings.js +31 -0
  135. package/node_modules/@imgly/codesign-sdk/dist/formats/media-facts.d.ts +15 -0
  136. package/node_modules/@imgly/codesign-sdk/dist/formats/media-facts.js +26 -0
  137. package/node_modules/@imgly/codesign-sdk/dist/formats/mime.d.ts +6 -0
  138. package/node_modules/@imgly/codesign-sdk/dist/formats/mime.js +37 -0
  139. package/node_modules/@imgly/codesign-sdk/dist/formats/refuse-media.d.ts +7 -0
  140. package/node_modules/@imgly/codesign-sdk/dist/formats/refuse-media.js +46 -0
  141. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-export.d.ts +6 -0
  142. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-export.js +20 -0
  143. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-import.d.ts +3 -0
  144. package/node_modules/@imgly/codesign-sdk/dist/formats/svg-import.js +25 -0
  145. package/node_modules/@imgly/codesign-sdk/dist/formats/zip-entries.d.ts +2 -0
  146. package/node_modules/@imgly/codesign-sdk/dist/formats/zip-entries.js +1 -0
  147. package/node_modules/@imgly/codesign-sdk/dist/gateway/asset-generate.d.ts +10 -4
  148. package/node_modules/@imgly/codesign-sdk/dist/gateway/asset-generate.js +205 -79
  149. package/node_modules/@imgly/codesign-sdk/dist/gateway/client.d.ts +23 -2
  150. package/node_modules/@imgly/codesign-sdk/dist/gateway/client.js +40 -41
  151. package/node_modules/@imgly/codesign-sdk/dist/gateway/index.d.ts +3 -0
  152. package/node_modules/@imgly/codesign-sdk/dist/gateway/index.js +4 -0
  153. package/node_modules/@imgly/codesign-sdk/dist/gateway/types.d.ts +18 -3
  154. package/node_modules/@imgly/codesign-sdk/dist/gateway/upload-origin.d.ts +3 -0
  155. package/node_modules/@imgly/codesign-sdk/dist/gateway/upload-origin.js +5 -0
  156. package/node_modules/@imgly/codesign-sdk/dist/host/edit-code.d.ts +2 -0
  157. package/node_modules/@imgly/codesign-sdk/dist/host/edit-code.js +8 -1
  158. package/node_modules/@imgly/codesign-sdk/dist/host/preview-size.d.ts +4 -2
  159. package/node_modules/@imgly/codesign-sdk/dist/host/preview-size.js +7 -4
  160. package/node_modules/@imgly/codesign-sdk/dist/host.d.ts +34 -5
  161. package/node_modules/@imgly/codesign-sdk/dist/host.js +6 -0
  162. package/node_modules/@imgly/codesign-sdk/dist/importers/fig.d.ts +4 -0
  163. package/node_modules/@imgly/codesign-sdk/dist/importers/fig.js +57 -0
  164. package/node_modules/@imgly/codesign-sdk/dist/importers/index.d.ts +2 -2
  165. package/node_modules/@imgly/codesign-sdk/dist/importers/index.js +38 -25
  166. package/node_modules/@imgly/codesign-sdk/dist/importers/node.d.ts +5 -0
  167. package/node_modules/@imgly/codesign-sdk/dist/importers/node.js +8 -0
  168. package/node_modules/@imgly/codesign-sdk/dist/importers/pdf-fonts.d.ts +20 -0
  169. package/node_modules/@imgly/codesign-sdk/dist/importers/pdf-fonts.js +76 -0
  170. package/node_modules/@imgly/codesign-sdk/dist/importers/shared.d.ts +14 -0
  171. package/node_modules/@imgly/codesign-sdk/dist/importers/shared.js +18 -0
  172. package/node_modules/@imgly/codesign-sdk/dist/index.d.ts +5 -4
  173. package/node_modules/@imgly/codesign-sdk/dist/index.js +2 -1
  174. package/node_modules/@imgly/codesign-sdk/dist/internal/index.d.ts +24 -17
  175. package/node_modules/@imgly/codesign-sdk/dist/internal/index.js +19 -10
  176. package/node_modules/@imgly/codesign-sdk/dist/node/edit-renders.d.ts +5 -0
  177. package/node_modules/@imgly/codesign-sdk/dist/node/edit-renders.js +73 -0
  178. package/node_modules/@imgly/codesign-sdk/dist/node/engine-child.js +18 -2
  179. package/node_modules/@imgly/codesign-sdk/dist/node/engine-http.js +8 -2
  180. package/node_modules/@imgly/codesign-sdk/dist/node/index.d.ts +1 -0
  181. package/node_modules/@imgly/codesign-sdk/dist/node/index.js +1 -0
  182. package/node_modules/@imgly/codesign-sdk/dist/node/media-probe.js +1 -1
  183. package/node_modules/@imgly/codesign-sdk/dist/sdk-version.generated.js +2 -2
  184. package/node_modules/@imgly/codesign-sdk/dist/session/engine-session.d.ts +59 -13
  185. package/node_modules/@imgly/codesign-sdk/dist/session/engine-session.js +19 -0
  186. package/node_modules/@imgly/codesign-sdk/dist/session/export-facts.d.ts +1 -14
  187. package/node_modules/@imgly/codesign-sdk/dist/session/export-facts.js +15 -4
  188. package/node_modules/@imgly/codesign-sdk/dist/session/file-formats.d.ts +5 -0
  189. package/node_modules/@imgly/codesign-sdk/dist/session/guarded-engine-session.d.ts +2 -0
  190. package/node_modules/@imgly/codesign-sdk/dist/session/guarded-engine-session.js +18 -7
  191. package/node_modules/@imgly/codesign-sdk/dist/session/local-engine-session.js +247 -68
  192. package/node_modules/@imgly/codesign-sdk/dist/session/local-engine.js +2 -2
  193. package/node_modules/@imgly/codesign-sdk/dist/session/multipart.js +10 -2
  194. package/node_modules/@imgly/codesign-sdk/dist/session/pending-video.js +2 -3
  195. package/node_modules/@imgly/codesign-sdk/dist/session/read-resolved.js +93 -6
  196. package/node_modules/@imgly/codesign-sdk/dist/session/remote.d.ts +34 -10
  197. package/node_modules/@imgly/codesign-sdk/dist/session/remote.js +377 -87
  198. package/node_modules/@imgly/codesign-sdk/dist/session/render-id.js +11 -2
  199. package/node_modules/@imgly/codesign-sdk/dist/session/session.d.ts +67 -6
  200. package/node_modules/@imgly/codesign-sdk/dist/session/session.js +213 -32
  201. package/node_modules/@imgly/codesign-sdk/dist/session/silent-audio.d.ts +18 -0
  202. package/node_modules/@imgly/codesign-sdk/dist/session/silent-audio.js +47 -0
  203. package/node_modules/@imgly/codesign-sdk/dist/session/transfers.d.ts +85 -0
  204. package/node_modules/@imgly/codesign-sdk/dist/session/transfers.js +80 -0
  205. package/node_modules/@imgly/codesign-sdk/dist/session/url-guard.d.ts +30 -0
  206. package/node_modules/@imgly/codesign-sdk/dist/session/url-guard.js +187 -0
  207. package/node_modules/@imgly/codesign-sdk/dist/session/url-source.d.ts +21 -0
  208. package/node_modules/@imgly/codesign-sdk/dist/session/url-source.js +163 -0
  209. package/node_modules/@imgly/codesign-sdk/dist/session/wire.d.ts +8 -1
  210. package/node_modules/@imgly/codesign-sdk/dist/session/wire.js +2 -1
  211. package/node_modules/@imgly/codesign-sdk/dist/session-instructions.js +2 -2
  212. package/node_modules/@imgly/codesign-sdk/dist/sessions/state.d.ts +3 -1
  213. package/node_modules/@imgly/codesign-sdk/dist/sessions/state.js +5 -1
  214. package/node_modules/@imgly/codesign-sdk/dist/signed-urls.d.ts +3 -0
  215. package/node_modules/@imgly/codesign-sdk/dist/signed-urls.js +30 -0
  216. package/node_modules/@imgly/codesign-sdk/dist/skill-tool.js +12 -12
  217. package/node_modules/@imgly/codesign-sdk/dist/sources/handshake.d.ts +2 -0
  218. package/node_modules/@imgly/codesign-sdk/dist/sources/mime.js +0 -1
  219. package/node_modules/@imgly/codesign-sdk/dist/sources/route.d.ts +8 -1
  220. package/node_modules/@imgly/codesign-sdk/dist/sources/route.js +17 -2
  221. package/node_modules/@imgly/codesign-sdk/dist/sources/search.js +9 -2
  222. package/node_modules/@imgly/codesign-sdk/dist/sources/types.d.ts +8 -1
  223. package/node_modules/@imgly/codesign-sdk/dist/testing/conformance.js +11 -6
  224. package/node_modules/@imgly/codesign-sdk/dist/testing/fake-engine.d.ts +1 -1
  225. package/node_modules/@imgly/codesign-sdk/dist/testing/fake-engine.js +11 -4
  226. package/node_modules/@imgly/codesign-sdk/dist/tools/edit.js +11 -4
  227. package/node_modules/@imgly/codesign-sdk/dist/tools/errors.js +2 -2
  228. package/node_modules/@imgly/codesign-sdk/dist/tools/export-formats/table.d.ts +4 -4
  229. package/node_modules/@imgly/codesign-sdk/dist/tools/export-formats/table.js +8 -0
  230. package/node_modules/@imgly/codesign-sdk/dist/tools/export.d.ts +3 -1
  231. package/node_modules/@imgly/codesign-sdk/dist/tools/export.js +75 -12
  232. package/node_modules/@imgly/codesign-sdk/dist/tools/omit-defaults.d.ts +3 -0
  233. package/node_modules/@imgly/codesign-sdk/dist/tools/omit-defaults.js +7 -0
  234. package/node_modules/@imgly/codesign-sdk/dist/tools/preview.js +42 -19
  235. package/node_modules/@imgly/codesign-sdk/dist/tools/source-tools.js +11 -4
  236. package/node_modules/@imgly/codesign-sdk/package.json +18 -10
  237. package/node_modules/@imgly/codesign-server/assets/ai-plugins/apps.mjs +5 -5
  238. package/node_modules/@imgly/codesign-server/assets/ai-plugins/image-gateway.mjs +5 -5
  239. package/node_modules/@imgly/codesign-server/assets/ai-plugins/version.json +1 -1
  240. package/node_modules/@imgly/codesign-server/dist/catalog/link.d.ts.map +1 -1
  241. package/node_modules/@imgly/codesign-server/dist/catalog/link.js +2 -1
  242. package/node_modules/@imgly/codesign-server/dist/catalog/link.js.map +1 -1
  243. package/node_modules/@imgly/codesign-server/dist/catalog/local-server.d.ts.map +1 -1
  244. package/node_modules/@imgly/codesign-server/dist/catalog/local-server.js +1 -0
  245. package/node_modules/@imgly/codesign-server/dist/catalog/local-server.js.map +1 -1
  246. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.d.ts +59 -1
  247. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.d.ts.map +1 -1
  248. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.js +127 -23
  249. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.js.map +1 -1
  250. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.d.ts +7 -0
  251. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.d.ts.map +1 -1
  252. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.js +65 -15
  253. package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.js.map +1 -1
  254. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.d.ts +2 -0
  255. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.d.ts.map +1 -1
  256. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.js +15 -5
  257. package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.js.map +1 -1
  258. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.d.ts +1 -1
  259. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.d.ts.map +1 -1
  260. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.js +7 -6
  261. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.js.map +1 -1
  262. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.d.ts +2 -2
  263. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.d.ts.map +1 -1
  264. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.js +14 -4
  265. package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.js.map +1 -1
  266. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.d.ts +10 -0
  267. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.d.ts.map +1 -1
  268. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.js +106 -22
  269. package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.js.map +1 -1
  270. package/node_modules/@imgly/codesign-server/dist/cli/connectors.js +1 -1
  271. package/node_modules/@imgly/codesign-server/dist/cli/connectors.js.map +1 -1
  272. package/node_modules/@imgly/codesign-server/dist/cli/doctor/checks/mcp-servers.js +1 -1
  273. package/node_modules/@imgly/codesign-server/dist/cli/doctor/checks/mcp-servers.js.map +1 -1
  274. package/node_modules/@imgly/codesign-server/dist/cli/pack.d.ts +1 -1
  275. package/node_modules/@imgly/codesign-server/dist/cli/pack.d.ts.map +1 -1
  276. package/node_modules/@imgly/codesign-server/dist/cli/pack.js +24 -18
  277. package/node_modules/@imgly/codesign-server/dist/cli/pack.js.map +1 -1
  278. package/node_modules/@imgly/codesign-server/dist/conversation/instructions.js +1 -1
  279. package/node_modules/@imgly/codesign-server/dist/conversation/instructions.js.map +1 -1
  280. package/node_modules/@imgly/codesign-server/dist/conversation/main.d.ts.map +1 -1
  281. package/node_modules/@imgly/codesign-server/dist/conversation/main.js +4 -3
  282. package/node_modules/@imgly/codesign-server/dist/conversation/main.js.map +1 -1
  283. package/node_modules/@imgly/codesign-server/dist/conversation/stage.d.ts +4 -0
  284. package/node_modules/@imgly/codesign-server/dist/conversation/stage.d.ts.map +1 -1
  285. package/node_modules/@imgly/codesign-server/dist/conversation/stage.js +13 -0
  286. package/node_modules/@imgly/codesign-server/dist/conversation/stage.js.map +1 -1
  287. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.d.ts +0 -6
  288. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.d.ts.map +1 -1
  289. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.js +0 -58
  290. package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.js.map +1 -1
  291. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.d.ts +10 -0
  292. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.d.ts.map +1 -0
  293. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.js +84 -0
  294. package/node_modules/@imgly/codesign-server/dist/credentials/keychain.js.map +1 -0
  295. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.d.ts +1 -3
  296. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.d.ts.map +1 -1
  297. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.js +3 -23
  298. package/node_modules/@imgly/codesign-server/dist/credentials/token-store.js.map +1 -1
  299. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.d.ts +59 -8
  300. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.d.ts.map +1 -1
  301. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.js +317 -40
  302. package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.js.map +1 -1
  303. package/node_modules/@imgly/codesign-server/dist/design/engine.js +4 -9
  304. package/node_modules/@imgly/codesign-server/dist/design/engine.js.map +1 -1
  305. package/node_modules/@imgly/codesign-server/dist/design/engines.d.ts +5 -0
  306. package/node_modules/@imgly/codesign-server/dist/design/engines.d.ts.map +1 -1
  307. package/node_modules/@imgly/codesign-server/dist/design/engines.js +49 -0
  308. package/node_modules/@imgly/codesign-server/dist/design/engines.js.map +1 -1
  309. package/node_modules/@imgly/codesign-server/dist/design/host.d.ts +2 -0
  310. package/node_modules/@imgly/codesign-server/dist/design/host.d.ts.map +1 -1
  311. package/node_modules/@imgly/codesign-server/dist/design/host.js +10 -6
  312. package/node_modules/@imgly/codesign-server/dist/design/host.js.map +1 -1
  313. package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.d.ts.map +1 -1
  314. package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.js +34 -5
  315. package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.js.map +1 -1
  316. package/node_modules/@imgly/codesign-server/dist/design/local-design.d.ts +42 -5
  317. package/node_modules/@imgly/codesign-server/dist/design/local-design.d.ts.map +1 -1
  318. package/node_modules/@imgly/codesign-server/dist/design/local-design.js +175 -38
  319. package/node_modules/@imgly/codesign-server/dist/design/local-design.js.map +1 -1
  320. package/node_modules/@imgly/codesign-server/dist/design/local-tools.d.ts +27 -1
  321. package/node_modules/@imgly/codesign-server/dist/design/local-tools.d.ts.map +1 -1
  322. package/node_modules/@imgly/codesign-server/dist/design/local-tools.js +65 -7
  323. package/node_modules/@imgly/codesign-server/dist/design/local-tools.js.map +1 -1
  324. package/node_modules/@imgly/codesign-server/dist/design/main.d.ts.map +1 -1
  325. package/node_modules/@imgly/codesign-server/dist/design/main.js +23 -10
  326. package/node_modules/@imgly/codesign-server/dist/design/main.js.map +1 -1
  327. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.d.ts +4 -0
  328. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.d.ts.map +1 -0
  329. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.js +13 -0
  330. package/node_modules/@imgly/codesign-server/dist/design/node-exporters.js.map +1 -0
  331. package/node_modules/@imgly/codesign-server/dist/design/probe-media.d.ts +2 -0
  332. package/node_modules/@imgly/codesign-server/dist/design/probe-media.d.ts.map +1 -0
  333. package/node_modules/@imgly/codesign-server/dist/design/probe-media.js +16 -0
  334. package/node_modules/@imgly/codesign-server/dist/design/probe-media.js.map +1 -0
  335. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.d.ts +22 -3
  336. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.d.ts.map +1 -1
  337. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.js +123 -32
  338. package/node_modules/@imgly/codesign-server/dist/design/remote-resources.js.map +1 -1
  339. package/node_modules/@imgly/codesign-server/dist/design/save.d.ts +5 -0
  340. package/node_modules/@imgly/codesign-server/dist/design/save.d.ts.map +1 -1
  341. package/node_modules/@imgly/codesign-server/dist/design/save.js +9 -0
  342. package/node_modules/@imgly/codesign-server/dist/design/save.js.map +1 -1
  343. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.d.ts +33 -4
  344. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.d.ts.map +1 -1
  345. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.js +121 -43
  346. package/node_modules/@imgly/codesign-server/dist/design/sessions/store.js.map +1 -1
  347. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.d.ts +8 -0
  348. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.d.ts.map +1 -1
  349. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.js +50 -61
  350. package/node_modules/@imgly/codesign-server/dist/design/workspace-files.js.map +1 -1
  351. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.d.ts +24 -2
  352. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.d.ts.map +1 -1
  353. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.js +132 -17
  354. package/node_modules/@imgly/codesign-server/dist/design/workspace-library.js.map +1 -1
  355. package/node_modules/@imgly/codesign-server/dist/services/archives/create.d.ts.map +1 -1
  356. package/node_modules/@imgly/codesign-server/dist/services/archives/create.js +19 -6
  357. package/node_modules/@imgly/codesign-server/dist/services/archives/create.js.map +1 -1
  358. package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.d.ts.map +1 -1
  359. package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.js +10 -7
  360. package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.js.map +1 -1
  361. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.d.ts +3 -1
  362. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.d.ts.map +1 -1
  363. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.js +5 -4
  364. package/node_modules/@imgly/codesign-server/dist/services/archives/pack.js.map +1 -1
  365. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.d.ts +56 -0
  366. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.d.ts.map +1 -0
  367. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.js +218 -0
  368. package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.js.map +1 -0
  369. package/node_modules/@imgly/codesign-server/dist/services/archives/seed.d.ts.map +1 -1
  370. package/node_modules/@imgly/codesign-server/dist/services/archives/seed.js +33 -124
  371. package/node_modules/@imgly/codesign-server/dist/services/archives/seed.js.map +1 -1
  372. package/node_modules/@imgly/codesign-server/dist/services/archives/template.d.ts +1 -0
  373. package/node_modules/@imgly/codesign-server/dist/services/archives/template.d.ts.map +1 -1
  374. package/node_modules/@imgly/codesign-server/dist/services/archives/template.js +1 -1
  375. package/node_modules/@imgly/codesign-server/dist/services/archives/template.js.map +1 -1
  376. package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.d.ts.map +1 -1
  377. package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.js +2 -1
  378. package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.js.map +1 -1
  379. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.d.ts +9 -5
  380. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.d.ts.map +1 -1
  381. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.js +14 -19
  382. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.js.map +1 -1
  383. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.d.ts +2 -0
  384. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.d.ts.map +1 -1
  385. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.js +1 -0
  386. package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.js.map +1 -1
  387. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.d.ts.map +1 -1
  388. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.js +4 -1
  389. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.js.map +1 -1
  390. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.d.ts +5 -1
  391. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.d.ts.map +1 -1
  392. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.js +67 -6
  393. package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.js.map +1 -1
  394. package/node_modules/@imgly/codesign-server/dist/services/flags/manifest.js +2 -2
  395. package/node_modules/@imgly/codesign-server/dist/services/flags/manifest.js.map +1 -1
  396. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.d.ts +3 -3
  397. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.d.ts.map +1 -1
  398. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.js +3 -3
  399. package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.js.map +1 -1
  400. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.d.ts +15 -0
  401. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.d.ts.map +1 -0
  402. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.js +14 -0
  403. package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.js.map +1 -0
  404. package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.d.ts.map +1 -1
  405. package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.js +36 -0
  406. package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.js.map +1 -1
  407. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.d.ts +2 -2
  408. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.d.ts.map +1 -1
  409. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.js +3 -5
  410. package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.js.map +1 -1
  411. package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.d.ts.map +1 -1
  412. package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.js +5 -4
  413. package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.js.map +1 -1
  414. package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.d.ts.map +1 -1
  415. package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.js +0 -64
  416. package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.js.map +1 -1
  417. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.d.ts +4 -0
  418. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.d.ts.map +1 -1
  419. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.js +4 -0
  420. package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.js.map +1 -1
  421. package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.d.ts.map +1 -1
  422. package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.js +2 -24
  423. package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.js.map +1 -1
  424. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.d.ts +4 -2
  425. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.d.ts.map +1 -1
  426. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.js +15 -14
  427. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.js.map +1 -1
  428. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.d.ts +12 -2
  429. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.d.ts.map +1 -1
  430. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.js +42 -12
  431. package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.js.map +1 -1
  432. package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.d.ts.map +1 -1
  433. package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.js +1 -2
  434. package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.js.map +1 -1
  435. package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.d.ts.map +1 -1
  436. package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.js +24 -2
  437. package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.js.map +1 -1
  438. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.d.ts +47 -0
  439. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.d.ts.map +1 -0
  440. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.js +167 -0
  441. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.js.map +1 -0
  442. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.d.ts +2 -0
  443. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.d.ts.map +1 -1
  444. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.js +2 -0
  445. package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.js.map +1 -1
  446. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.d.ts +32 -0
  447. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.d.ts.map +1 -0
  448. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.js +79 -0
  449. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.js.map +1 -0
  450. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.d.ts +35 -0
  451. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.d.ts.map +1 -0
  452. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.js +185 -0
  453. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.js.map +1 -0
  454. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.d.ts +74 -0
  455. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.d.ts.map +1 -0
  456. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.js +82 -0
  457. package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.js.map +1 -0
  458. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.d.ts +10 -0
  459. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.d.ts.map +1 -1
  460. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.js +1 -0
  461. package/node_modules/@imgly/codesign-server/dist/services/workspace/types.js.map +1 -1
  462. package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.d.ts.map +1 -1
  463. package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.js +5 -0
  464. package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.js.map +1 -1
  465. package/node_modules/@imgly/codesign-server/package.json +13 -11
  466. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.d.ts +2 -1
  467. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.d.ts.map +1 -1
  468. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.js +5 -1
  469. package/node_modules/@imgly/design-lint/dist/rules/text-legibility.js.map +1 -1
  470. package/node_modules/@imgly/design-lint/package.json +2 -2
  471. package/node_modules/@imgly/figma-exporter/CHANGELOG.md +79 -0
  472. package/node_modules/@imgly/figma-exporter/LICENSE.md +137 -0
  473. package/node_modules/@imgly/figma-exporter/README.md +201 -0
  474. package/node_modules/@imgly/figma-exporter/THIRD_PARTY_NOTICES.md +475 -0
  475. package/node_modules/@imgly/figma-exporter/dist/index.cjs +1 -0
  476. package/node_modules/@imgly/figma-exporter/dist/index.d.cts +8833 -0
  477. package/node_modules/@imgly/figma-exporter/dist/index.d.ts +8833 -0
  478. package/node_modules/@imgly/figma-exporter/dist/index.js +1 -0
  479. package/node_modules/@imgly/figma-exporter/package.json +92 -0
  480. package/node_modules/@imgly/figma-importer/CHANGELOG.md +84 -0
  481. package/node_modules/@imgly/figma-importer/LICENSE.md +137 -0
  482. package/node_modules/@imgly/figma-importer/README.md +256 -0
  483. package/node_modules/@imgly/figma-importer/THIRD_PARTY_NOTICES.md +446 -0
  484. package/node_modules/@imgly/figma-importer/dist/index.cjs +2 -0
  485. package/node_modules/@imgly/figma-importer/dist/index.d.cts +12831 -0
  486. package/node_modules/@imgly/figma-importer/dist/index.d.ts +12831 -0
  487. package/node_modules/@imgly/figma-importer/dist/index.js +2 -0
  488. package/node_modules/@imgly/figma-importer/package.json +85 -0
  489. package/node_modules/@imgly/html-exporter/CHANGELOG.md +35 -0
  490. package/node_modules/@imgly/html-exporter/README.md +45 -4
  491. package/node_modules/@imgly/html-exporter/dist/index.cjs +610 -493
  492. package/node_modules/@imgly/html-exporter/dist/index.d.cts +235 -216
  493. package/node_modules/@imgly/html-exporter/dist/index.d.ts +235 -216
  494. package/node_modules/@imgly/html-exporter/dist/index.js +610 -493
  495. package/node_modules/@imgly/html-exporter/package.json +15 -10
  496. package/node_modules/@imgly/idml-exporter/CHANGELOG.md +10 -0
  497. package/node_modules/@imgly/idml-exporter/README.md +17 -18
  498. package/node_modules/@imgly/idml-exporter/dist/harfbuzz.browser.js +1 -1
  499. package/node_modules/@imgly/idml-exporter/dist/index.cjs +8 -11
  500. package/node_modules/@imgly/idml-exporter/dist/index.d.cts +14480 -10275
  501. package/node_modules/@imgly/idml-exporter/dist/index.d.ts +14480 -10275
  502. package/node_modules/@imgly/idml-exporter/dist/index.js +8 -10
  503. package/node_modules/@imgly/idml-exporter/dist/woff2.browser.js +14 -14
  504. package/node_modules/@imgly/idml-exporter/package.json +17 -12
  505. package/node_modules/@imgly/idml-importer/CHANGELOG.md +37 -0
  506. package/node_modules/@imgly/idml-importer/README.md +148 -17
  507. package/node_modules/@imgly/idml-importer/dist/index.cjs +6 -5
  508. package/node_modules/@imgly/idml-importer/dist/index.d.cts +1003 -632
  509. package/node_modules/@imgly/idml-importer/dist/index.d.ts +1003 -632
  510. package/node_modules/@imgly/idml-importer/dist/index.js +6 -5
  511. package/node_modules/@imgly/idml-importer/package.json +9 -9
  512. package/node_modules/@imgly/pdf-importer/CHANGELOG.md +59 -0
  513. package/node_modules/@imgly/pdf-importer/README.md +71 -7
  514. package/node_modules/@imgly/pdf-importer/dist/browser.d.ts +940 -788
  515. package/node_modules/@imgly/pdf-importer/dist/browser.js +17 -15
  516. package/node_modules/@imgly/pdf-importer/dist/node.cjs +17 -16
  517. package/node_modules/@imgly/pdf-importer/dist/node.d.cts +940 -788
  518. package/node_modules/@imgly/pdf-importer/dist/node.d.ts +940 -788
  519. package/node_modules/@imgly/pdf-importer/dist/node.js +17 -15
  520. package/node_modules/@imgly/pdf-importer/dist/pdf.worker.mjs +80265 -61990
  521. package/node_modules/@imgly/pdf-importer/package.json +13 -13
  522. package/node_modules/@imgly/psd-exporter/CHANGELOG.md +12 -0
  523. package/node_modules/@imgly/psd-exporter/README.md +50 -7
  524. package/node_modules/@imgly/psd-exporter/dist/index.cjs +5 -7
  525. package/node_modules/@imgly/psd-exporter/dist/index.d.cts +14332 -10063
  526. package/node_modules/@imgly/psd-exporter/dist/index.d.ts +14332 -10063
  527. package/node_modules/@imgly/psd-exporter/dist/index.js +5 -6
  528. package/node_modules/@imgly/psd-exporter/dist/wawoff2-LICENSE.txt +19 -0
  529. package/node_modules/@imgly/psd-exporter/dist/woff2.browser.js +19 -0
  530. package/node_modules/@imgly/psd-exporter/package.json +26 -9
  531. package/node_modules/@imgly/psd-importer/CHANGELOG.md +29 -1
  532. package/node_modules/@imgly/psd-importer/README.md +22 -30
  533. package/node_modules/@imgly/psd-importer/dist/index.cjs +11 -11
  534. package/node_modules/@imgly/psd-importer/dist/index.d.cts +10479 -12978
  535. package/node_modules/@imgly/psd-importer/dist/index.d.ts +10479 -12978
  536. package/node_modules/@imgly/psd-importer/dist/index.js +11 -11
  537. package/node_modules/@imgly/psd-importer/package.json +8 -11
  538. package/package.json +28 -17
  539. package/node_modules/@imgly/pdf-importer/dist/browser.d.cts +0 -941
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/protocol/types.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,qHAAqH;AACrH,kCAAkC;AAUlC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAElE,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAAa,EAC0B,EAAE,CACxC,YAAmC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AA4nCtD,uGAAuG;AACvG,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,QAAQ;IACtB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,QAAQ;IACzB,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,QAAQ;IAClB,iBAAiB,EAAE,QAAQ;IAC3B,uBAAuB,EAAE,QAAQ;IACjC,uBAAuB,EAAE,QAAQ;IACjC,cAAc,EAAE,MAAM;IACtB,gBAAgB,EAAE,MAAM;IACxB,eAAe,EAAE,QAAQ;CAEW,CAAC;AAEvC,mHAAmH;AACnH,sFAAsF;AACtF,MAAM,UAAU,QAAQ,CAAC,EAAU;IACjC,OAAO,mCAAmC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAe;IAChD,OAAO,sIAAsI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,MAAM,uBAAuB,CAAC,CAAC,CAAC,YAAY,uBAAuB,CAAC;AAClP,CAAC","sourcesContent":["// The server protocol, version 2: one protocol for every link (client ⇄ router ⇄ unit), NDJSON over a transport.\n// Additive only within a version: a new method, event or optional field is fine; renaming or removing one, or making\n// one required, is a new version.\n\nimport type { UiEvent } from './ui-events.js';\n\nexport type Role = 'client' | 'router' | 'unit';\n\nexport type UnitKind = 'design' | 'conversation';\n\nexport type UpdateChannel = 'stable' | 'next' | 'canary';\n\nexport const CLIENT_KINDS = ['mcp', 'app', 'cli', 'tui'] as const;\n\nexport const isClientKind = (\n kind: unknown\n): kind is (typeof CLIENT_KINDS)[number] =>\n (CLIENT_KINDS as readonly unknown[]).includes(kind);\n\nexport interface ClientIdentity {\n kind: (typeof CLIENT_KINDS)[number];\n /** The MCP host's `clientInfo.name`, when the adapter is the client. */\n name?: string;\n version?: string;\n}\n\n/** What runs the client (Claude Code, opencode, a CI job …), read from its environment at the edge; a unit validates it again. */\nexport interface HarnessFields {\n model?: string;\n modelSource?: 'codex-meta';\n effort?: string;\n sandbox?: string;\n entrypoint?: string;\n aiAgent?: string;\n attended?: boolean;\n geminiCli?: true;\n opencode?: true;\n ci?: boolean;\n termProgram?: string;\n}\n\n/** The client's view of its environment, read once at the edge; the router builds the unit's config from it. */\nexport interface ClientConfig {\n /** CESDK_LICENSE / IMGLY_CESDK_LICENSE; never logged, never shown. */\n licence?: string;\n viewer?: { enabled?: boolean; host?: string };\n telemetry?: { usage?: boolean; errors?: boolean };\n engine?: { prefer?: 'auto' | 'native' | 'wasm' };\n gateway?: {\n /** IMGLY_GATEWAY_BASE_URL; only in a build that is not a release. */\n baseURL?: string;\n /** IMGLY_GATEWAY_API_KEY, or the file IMGLY_GATEWAY_API_KEY_FILE names; never logged, never shown. */\n apiKey?: string;\n };\n /** CODESIGN_WORKSPACE: a path the router resolves to a registered workspace. */\n workspacePath?: string;\n}\n\nexport interface ToolDef {\n name: string;\n title?: string;\n description: string;\n inputSchema: Record<string, unknown>;\n annotations?: { readOnlyHint?: boolean; destructiveHint?: boolean };\n}\n\nexport type Part =\n | { type: 'text'; text: string }\n | { type: 'image'; mimeType: string; data: string }\n | { type: 'resource'; uri: string; mimeType?: string; text?: string };\n\nexport interface ToolResult {\n content: Part[];\n isError?: boolean;\n}\n\nexport type ErrorKind =\n /** No common version, a request before `hello`, or a malformed line. */\n | 'protocol'\n /** The role may not call this method. */\n | 'forbidden'\n | 'unknown_method'\n | 'invalid_params'\n /** No live unit holds the design or session asked for. */\n | 'not_live'\n | 'timeout'\n /** The connection closed before the answer. */\n | 'closed'\n | 'in_use'\n | 'not_installed'\n /** The design is open in a unit of another runtime version than the channel pinned. */\n | 'version_mismatch'\n | 'internal';\n\nexport interface WireError {\n kind: ErrorKind;\n message: string;\n}\n\nexport type Empty = Record<string, never>;\n\n// --- Roles and versions\n\nexport interface HelloParams {\n role: Role;\n /** The protocol versions this side speaks, inclusive. */\n range: [number, number];\n client?: ClientIdentity;\n unit?: { id: string; kind: UnitKind };\n pid: number;\n}\n\nexport interface ServerInfo {\n version: string;\n /** The runtime version new units start on. */\n runtime: string;\n channel: UpdateChannel;\n}\n\nexport interface HelloResult {\n protocol: number;\n server: ServerInfo;\n pid: number;\n}\n\n/** A unit's answer to the router's `hello`: who it is, for the router that adopts it. */\nexport interface UnitHelloResult {\n protocol: number;\n unit: UnitRecord;\n pid: number;\n}\n\n/** What a unit writes to units/<id>/unit.json. */\nexport interface UnitRecord {\n id: string;\n kind: UnitKind;\n runtime: string;\n sdk: string;\n cesdk: string;\n pid: number;\n /** ms since the epoch. */\n startedAt: number;\n workspace: string;\n design?: string;\n conversation?: string;\n /** The engine child, which holds the engine and runs the model's code. */\n enginePid?: number;\n engine?: { flavor: 'native' | 'wasm'; reason?: string };\n /** It never takes the workspace's `.lock` while its router holds it (R8): absent, the router yields its hold. */\n workspaceHold?: true;\n}\n\n// --- Channels\n\nexport interface ChannelOpenParams {\n kind: UnitKind;\n client: ClientIdentity;\n /** A workspace id; `default` when omitted. */\n workspace?: string;\n /** A design's uri: join the live unit that holds it; `not_live` when none does. */\n attach?: string;\n /** A unit id: rejoin that unit after a handoff. */\n session?: string;\n /** With `kind: 'design'`: bind to that chat's active tab; with `kind: 'conversation'`: that chat (omitted: a new one). */\n conversation?: string;\n /** The tools the client draws (decision 36). */\n clientTools?: ToolDef[];\n /** With `clientTools` on a conversation channel: how to use them, added to the chat agent's instructions. */\n clientInstructions?: string;\n /** With `kind: 'conversation'`, for a new chat only: what it makes, kept in its record; `design` when omitted. */\n chatKind?: ChatKind;\n /** With `kind: 'conversation'`: the chat's user-server gateway, which gets no replay and is not one of its clients. */\n userServers?: boolean;\n /** With `kind: 'design'` and `conversation`: the kind of the client holding that chat, for usage telemetry. */\n chatClientKind?: ClientIdentity['kind'];\n /** A channel the server opens for itself (a chat's stage): its calls are not counted as usage. */\n internal?: boolean;\n config?: ClientConfig;\n /** For error reports and usage telemetry of this channel's calls. */\n harness?: HarnessFields;\n /** With `conversation`: the harness of the chat's client (the editor), reported as `chat*` fields. */\n chatHarness?: HarnessFields;\n /** An installed version: the channel's unit runs from it instead of `current`. */\n runtime?: string;\n /** With `kind: 'design'`: a one-shot command (cdsn's): the unit it started ends when it leaves, not after the idle time. */\n oneShot?: boolean;\n}\n\nexport type ChatKind = 'design' | 'style';\n\nexport interface ChannelOpenResult {\n channel: string;\n unit: string;\n runtime: string;\n workspace: string;\n design?: string;\n /** With `design`: its latest revision on the unit, when the unit saved it; a `design.changed` before the channel opened named it. */\n revision?: string;\n}\n\n/** `channel.open` from the router to the unit it chose. */\nexport interface UnitChannelOpenParams {\n channel: string;\n kind: UnitKind;\n client: ClientIdentity;\n workspace: string;\n conversation?: string;\n clientTools?: ToolDef[];\n clientInstructions?: string;\n chatKind?: ChatKind;\n userServers?: boolean;\n chatClientKind?: ClientIdentity['kind'];\n internal?: boolean;\n harness?: HarnessFields;\n chatHarness?: HarnessFields;\n /** A chat's design channel: the design its active tab names (`conversation.design`), opened by a unit holding none. */\n design?: string;\n}\n\nexport interface ChannelParams {\n channel: string;\n}\n\nexport interface ChannelMovedParams {\n channel: string;\n unit: string;\n runtime: string;\n}\n\nexport interface ChannelClosedParams {\n channel: string;\n reason: string;\n /** The unit died rather than being parked or handed over; its requests in flight failed with `sessionEndedNotice`. */\n unexpected?: boolean;\n design?: string;\n}\n\n// --- Design operations (channel-scoped)\n\nexport interface ToolsCallParams {\n channel: string;\n call: string;\n name: string;\n arguments: Record<string, unknown>;\n progress?: boolean;\n /** The MCP host's `_meta` of the call (progress token, client info), passed through as it came. */\n meta?: Record<string, unknown>;\n /** Unique across connections: a call that repeats it, after the router died under the first, gets the first's answer. */\n once?: string;\n}\n\nexport interface ProgressParams {\n channel: string;\n call: string;\n progress: number;\n total?: number;\n message?: string;\n}\n\nexport interface SkillInfo {\n name: string;\n description: string;\n uri: string;\n files: string[];\n /** The skill's SKILL.md frontmatter. */\n frontmatter?: Record<string, unknown>;\n /** Every file of the skill, so a client lists them without reading each. */\n entries?: SkillEntry[];\n}\n\nexport interface SkillEntry {\n uri: string;\n digest: string;\n size: number;\n}\n\nexport interface PromptInfo {\n name: string;\n title?: string;\n description?: string;\n arguments?: { name: string; description?: string; required?: boolean }[];\n}\n\nexport interface PromptsGetResult {\n description?: string;\n messages: { role: 'user' | 'assistant'; content: Part }[];\n}\n\nexport interface PromptsCompleteParams {\n channel: string;\n prompt: string;\n argument: { name: string; value: string };\n /** Values of the prompt's other arguments, already chosen. */\n context?: Record<string, string>;\n}\n\n/** A design in the library, as `designs` lists it. */\nexport interface DesignSummary {\n uri: string;\n title: string;\n [field: string]: unknown;\n}\n\nexport interface DesignChangedParams {\n workspace: string;\n uri: string;\n unit: string;\n revision: string;\n by: { tool?: string; client?: ClientIdentity };\n}\n\nexport interface AuthState {\n signedIn: boolean;\n email?: string;\n /** The account's display name, once the server has learned it. */\n name?: string;\n}\n\n/** A short-lived IMG.LY access token for a client's own gateway requests; both absent while signed out. */\nexport interface AuthToken {\n accessToken?: string;\n /** epoch ms */\n expiresAt?: number;\n}\n\n// --- Routing a design\n\nexport interface DesignRef {\n workspace: string;\n uri: string;\n}\n\n/** `design.claim`: the channel whose call asked for the design is the one that moves when another unit holds it; none for a person's download in the viewer, which moves nothing. */\nexport interface DesignClaimParams extends DesignRef {\n channel?: string;\n}\n\nexport type DesignClaimResult = { granted: true } | { heldBy: string };\n\n// --- Chats\n\nexport interface Attachment {\n name: string;\n mimeType: string;\n /** base64; or `path`, a file the server may read. */\n data?: string;\n path?: string;\n}\n\nexport interface ChatTab {\n id: string;\n designUri?: string;\n title: string;\n}\n\nexport interface Usage {\n /** Input read at full price: not from the provider's prompt cache. */\n inputTokens?: number;\n outputTokens?: number;\n /** Input read from the prompt cache, and written to it. */\n cachedTokens?: number;\n cacheWriteTokens?: number;\n /** The part of the output the model spent reasoning, where the agent says it. */\n reasoningTokens?: number;\n costUsd?: number;\n /** The tokens in the agent's context window, and its size (ACP `usage_update` used, size). */\n contextTokens?: number;\n contextSize?: number;\n}\n\nexport type ChatUpdate =\n /** The user's prompt, so a client that attaches later sees both sides. */\n | { kind: 'user'; text: string; attachments?: Attachment[] }\n | { kind: 'message'; text: string }\n | { kind: 'thought'; text: string }\n | {\n kind: 'tool_call';\n id: string;\n name: string;\n title?: string;\n arguments?: unknown;\n }\n | {\n kind: 'tool_call_update';\n id: string;\n status?: 'running' | 'completed' | 'failed';\n content?: Part[];\n /** The call's input once the agent has more of it than its `tool_call` carried. */\n arguments?: unknown;\n }\n | { kind: 'usage'; usage: Usage; nextTool?: string }\n | {\n kind: 'config';\n /** Each model with the efforts it takes; `efforts` is the current model's. */\n models?: AgentModel[];\n model?: string;\n efforts?: string[];\n effort?: string;\n }\n | { kind: 'step'; title: string; detail?: string }\n | { kind: 'stage'; uri: string; revision: string; pages: Part[] }\n | { kind: 'tabs'; tabs: ChatTab[]; active?: string };\n\nexport interface ChatUpdateParams {\n channel: string;\n /** Omitted for an update outside a turn (the tabs). */\n turn?: string;\n update: ChatUpdate;\n}\n\nexport interface ChatDoneParams {\n channel: string;\n turn: string;\n stopReason: string;\n /** With stopReason `error`: what went wrong. */\n message?: string;\n /**\n * With stopReason `error`, a failure a client may word itself: `text-tool-call`, the agent wrote a tool call as text;\n * `tools-unavailable`, CoDesign's tools did not start and the prompt was not sent.\n */\n failure?: 'text-tool-call' | 'tools-unavailable';\n usage?: Usage;\n}\n\nexport interface ClientCallParams {\n channel: string;\n call: string;\n name: string;\n arguments: Record<string, unknown>;\n /** The chat the call belongs to; the router fills it in. */\n conversation?: string;\n}\n\nexport interface AgentStatus {\n name: string;\n installed?: boolean;\n signedIn: boolean;\n label?: string;\n /** What `chat.configure` may pick for this agent, with the efforts each model takes. */\n models?: AgentModel[];\n /** The model and effort it runs when none is picked. */\n model?: string;\n effort?: string;\n}\n\nexport interface AgentModel {\n value: string;\n name: string;\n /** The picker's one-line description (\"Best for everyday, complex tasks\"). */\n description?: string;\n efforts?: string[];\n}\n\n// --- The user's MCP servers (decisions 40, 41, 60 B, 61): `mcp.json`, answered by a conversation unit\n\n/** How a server is reached, in mcp.json's common fields; a secret appears only as `${secret:<key>}`. */\nexport type UserServerSpec =\n | {\n type: 'stdio';\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n }\n | { type: 'http'; url: string; headers?: Record<string, string> };\n\nexport interface UserServerSettings {\n enabled: boolean;\n /** `none`: the headers carry the key; `now` / `when-needed`: OAuth. */\n signIn: 'none' | 'now' | 'when-needed';\n /** `changes-only`: a tool the server marks read-only and not destructive runs without asking. */\n approvals: 'every-call' | 'changes-only';\n /** `always` runs without asking, `off` is not offered to the agent; a tool not listed asks. */\n tools: Record<string, 'always' | 'off'>;\n}\n\nexport interface UserServerInfo extends UserServerSettings {\n name: string;\n id: string;\n server: UserServerSpec;\n /** `needs_signin`: an OAuth server with no token in the store. */\n state: 'ready' | 'disabled' | 'needs_signin';\n addedAt: number;\n}\n\nexport interface UserServerAddParams {\n channel: string;\n name: string;\n server: UserServerSpec;\n /** Header or env values to keep in the credential store, by header or variable name; mcp.json gets references. */\n secrets?: Record<string, string>;\n signIn?: UserServerSettings['signIn'];\n /** A client id to use instead of dynamic registration. */\n oauthClient?: { clientId: string; clientSecret?: string };\n}\n\n/** What the gateway connects with: an enabled, signed-in server with its secrets and token resolved. */\nexport interface UserServerConnection extends Pick<\n UserServerSettings,\n 'approvals' | 'tools'\n> {\n name: string;\n server: UserServerSpec;\n /** epoch ms: when the OAuth token in `server.headers` expires; `userServers.refresh` before it. */\n expiresAt?: number;\n}\n\nexport interface PermissionRequestParams {\n channel: string;\n call: string;\n /** The user server's name and its tool's, untrusted text. */\n server: string;\n tool: string;\n arguments: Record<string, unknown>;\n /** As the server says. */\n hints?: { readOnlyHint?: boolean; destructiveHint?: boolean };\n}\n\n/** `always` allows the tool from now on; a `deny` from the unit carries the text the agent gets. */\nexport interface PermissionAnswer {\n outcome: 'allow' | 'always' | 'deny';\n message?: string;\n}\n\n// --- Admin\n\nexport interface UnitInfo extends UnitRecord {\n channels: number;\n}\n\nexport interface StatusResult {\n protocol: number;\n server: ServerInfo;\n managed: boolean;\n home: string;\n units: UnitInfo[];\n clients: number;\n}\n\nexport interface UpdateCheckResult {\n current: string;\n latest?: string;\n staged?: string;\n /** Why there is nothing to do: managed by a package manager, or no release found. */\n reason?: string;\n}\n\nexport type ExperimentState = 'default' | 'enabled' | 'disabled';\n\n/** One experiment as `experiments.list` answers it: `default` is the channel's, `on` what the server does; `value` and `defaultValue` only on one that carries a number. */\nexport interface ExperimentInfo {\n id: string;\n title: string;\n description: string;\n state: ExperimentState;\n default: boolean;\n on: boolean;\n value?: number;\n defaultValue?: number;\n}\n\nexport interface WorkspaceInfo {\n id: string;\n name: string;\n path: string;\n}\n\n/** A style's `metadata.json` (spec 2026-10-20-asset-pack-design.md, \"Styles\"): the app's `kit.json` renamed. */\nexport interface StyleMetadata {\n title: string;\n savedAt: number;\n /** Counts the saves; a save that names an older one is refused. */\n revision: number;\n createdAt?: number;\n /** What the style was made from, as the person gave it. */\n source?: string;\n origin?: { pack?: string; migrated?: string };\n nameSource?: 'input' | 'detected' | 'user';\n generative?: 'allowed';\n /** The app's record of the style's fonts (their licences, the installed families it uses). */\n fonts?: Record<string, unknown>;\n}\n\nexport interface StyleSummary {\n id: string;\n title: string;\n savedAt: number;\n revision: number;\n origin?: StyleMetadata['origin'];\n}\n\n/** A style as `styles.get` answers it: its content, never a path into the workspace (the server owns the folder). */\nexport interface StyleInfo {\n id: string;\n metadata: StyleMetadata;\n tokens: Record<string, unknown> | null;\n styleMd: string;\n /** The files of its `sources/` folder, by name. */\n references: string[];\n preview: boolean;\n /** Asked with `styles.get`'s `assets`: the files it added to the workspace's assets, by their sidecars' current filename (a file added without a name is left out). */\n assets?: Array<{ uri: string; filename: string }>;\n}\n\n/** `styles.save`: the style's files as local paths, which the server hashes into `assets/`. */\nexport interface StyleSaveParams {\n /** A new style when absent. */\n id?: string;\n /** The revision the writer read; a style saved since is refused (`conflict`). */\n revision?: number;\n title?: string;\n tokens?: Record<string, unknown>;\n styleMd?: string;\n /** A path as it stands (or will stand) in `tokens` → the local file it names: replaced by the file's `workspace://assets/…` URI. */\n files?: Record<string, string>;\n /** Files to keep in `sources/`, by name → local path; `null` removes one. */\n references?: Record<string, string | null>;\n /** The specimen card, a local PNG. */\n preview?: string;\n metadata?: Omit<StyleMetadata, 'title' | 'savedAt' | 'revision' | 'origin'>;\n}\n\nexport interface StyleMigrationReport {\n migrated: number;\n /** Kits left in the app's folder, with why. */\n failed: Array<{ id: string; reason: string }>;\n}\n\n/** One of a pack's sources or styles. */\nexport interface PackPart {\n id: string;\n title: string;\n /** A source's kind (templates, images, typefaces, colors); absent for a style. */\n kind?: string;\n /** How many assets a source lists. */\n items?: number;\n /** A source's content (its content.json), with `pack.list`'s `content: true`. */\n content?: Record<string, unknown>;\n}\n\nexport interface PackSummary {\n id: string;\n title: string;\n version: string;\n sources: PackPart[];\n styles: PackPart[];\n}\n\n/** What `workspace.import` did (spec 2026-10-20-asset-pack-design.md, \"Importing an old workspace\"). */\nexport interface WorkspaceImportResult {\n /** Designs written, archives and pre-0.4 roots included. */\n designs: number;\n /** Of those, archives that became plain scenes. */\n archives: number;\n /** Of those, an older CoDesign's unsaved drafts, each imported as a new design. */\n drafts: number;\n /** Of those, files copied as they are, with why. */\n asIs: Array<{ path: string; reason: string }>;\n assets: number;\n /** 0.5 labels folded into the workspace's asset records. */\n labels: number;\n styles: number;\n sources: number;\n /** Ids the workspace holds with other content: left as they are. */\n skipped: Array<{ path: string; reason: string }>;\n failed: Array<{ path: string; reason: string }>;\n /** The first-start notice went: the import was whole and came from the folder it names. */\n noticeCleared: boolean;\n}\n\n/** What `pack.install` did, or would do (`dryRun`). */\nexport interface PackInstallResult extends PackSummary {\n outcome: 'installed' | 'upgraded' | 'unchanged';\n /** The version installed before, for an upgrade or an unchanged reinstall. */\n previous?: string;\n /** Asset files the pack adds, and those the workspace already has (they only gain the group). */\n assets: { added: number; present: number };\n dryRun?: boolean;\n /** For a `url`: the host it came from, and the downloaded file a confirming `pack.install { path }` installs. */\n host?: string;\n path?: string;\n}\n\n/** `pack.install`: a local file or an `https` URL; `dryRun` answers the plan and writes nothing. */\nexport interface PackInstallParams {\n channel: string;\n workspace?: string;\n path?: string;\n url?: string;\n dryRun?: boolean;\n}\n\n/** `design.read`: a design's file, or that it has none yet. */\nexport type DesignReadResult =\n | { exists: false }\n | {\n exists: true;\n /** Where the file is (to show it in the file manager); the server's to write. */\n file: string;\n /** The file's time and size: changes with every write, cheap to compare. */\n version: string;\n /** The file's bytes, base64: a plain scene, or an archive from before. Not with `data: false`. */\n data?: string;\n /** The revision `design.changed` names. Not with `data: false`. */\n revision?: string;\n savedAt?: number;\n /** The PNG of its first page the server keeps beside it, and its version (the file's time). */\n thumbnail?: { file: string; version: number };\n };\n\n/** Where `assets.locate` found one uri's file: the server's to write, the client's to read. */\nexport interface AssetLocation {\n file: string;\n size: number;\n /** The name the asset was added under (its sidecar's `meta.filename`); absent for an export or an asset with none. */\n filename?: string;\n}\n\n/** `assets.import`: a file kept once in the workspace's store, by its bytes; `file` is where it is stored. */\nexport interface AssetsImportResult {\n uri: string;\n relPath: string;\n file: string;\n size: number;\n /** The store held these bytes already: nothing was copied. */\n existed: boolean;\n}\n\n/** `pack.create` (experiment `pack-create`): a pack from the workspace's designs (as templates), styles and images. */\nexport interface PackCreateParams {\n channel: string;\n workspace?: string;\n /** The file to write, ending in `.imglypack` or `.cdsnpack`. */\n out: string;\n id: string;\n /** Semver; the same ids at a higher version make an upgrade. */\n version: string;\n title: string;\n /** Design ids or `workspace://designs/<ab>/<rest>.imgly` URIs; each becomes a template. */\n designs?: string[];\n /** Style ids; each goes in as `<id>.<name>`. */\n styles?: string[];\n /** Asset files or `workspace://assets/…` URIs for the pack's images source. */\n images?: string[];\n /** The text of the pack's `LICENSE`. */\n license?: string;\n /** Whether the styles' fonts and colors make a typeface and a color source; default true. */\n typefaces?: boolean;\n colors?: boolean;\n /** Answer the plan and write nothing. */\n dryRun?: boolean;\n}\n\n/** What `pack.create` wrote, or would write (`dryRun`). */\nexport interface PackCreateResult extends PackSummary {\n /** The asset files in the pack: templates, the files everything names, its images. */\n assets: number;\n /** The image assets the designs and styles name, as `workspace://assets/…` URIs. */\n used: string[];\n dryRun?: boolean;\n /** The file written and its size. */\n path?: string;\n bytes?: number;\n}\n\n// --- Method maps: method → params → result, one per answering side\n\nexport interface M<P, R> {\n params: P;\n result: R;\n}\n\n/** Channel-scoped methods: a client sends them to the router, which forwards them to the channel's unit. */\nexport interface ChannelMethods {\n 'tools.list': M<ChannelParams, { tools: ToolDef[] }>;\n 'tools.call': M<ToolsCallParams, ToolResult>;\n 'tools.cancel': M<{ channel: string; call: string }, Empty>;\n instructions: M<ChannelParams, { text: string }>;\n 'skills.list': M<ChannelParams, { skills: SkillInfo[] }>;\n 'skills.read': M<\n { channel: string; uri: string },\n { text: string; mimeType: string }\n >;\n 'prompts.list': M<ChannelParams, { prompts: PromptInfo[] }>;\n 'prompts.get': M<\n { channel: string; name: string; arguments?: Record<string, string> },\n PromptsGetResult\n >;\n 'prompts.complete': M<\n PromptsCompleteParams,\n { values: string[]; total?: number; hasMore?: boolean }\n >;\n 'designs.list': M<\n { channel: string; workspace?: string },\n { designs: DesignSummary[] }\n >;\n /** `dir` is the workspace's styles folder, `assets` the folder of the files they name. */\n 'styles.list': M<\n { channel: string; workspace?: string },\n { styles: StyleSummary[]; dir: string; assets: string }\n >;\n 'styles.get': M<\n { channel: string; workspace?: string; id: string; assets?: boolean },\n { style: StyleInfo }\n >;\n /** A style's own files (`preview.png`, `sources/<name>`) as paths to read, `files[i]` for `files[i]`; null for any other name, a file that resolves outside the style's folder, or a missing one. */\n 'styles.locate': M<\n { channel: string; workspace?: string; id: string; files: string[] },\n { files: Array<AssetLocation | null> }\n >;\n /** `files`: each `files` entry's ref → the `workspace://assets/…` URI its file got. */\n 'styles.save': M<\n { channel: string; workspace?: string } & StyleSaveParams,\n { style: StyleInfo; files: Record<string, string> }\n >;\n 'styles.duplicate': M<\n { channel: string; workspace?: string; id: string },\n { style: StyleInfo }\n >;\n /** Copies a style and the assets it names into the workspace `to` (an id of `workspaces.json`). */\n 'styles.copy': M<\n { channel: string; workspace?: string; id: string; to: string },\n { style: StyleInfo }\n >;\n 'styles.delete': M<\n { channel: string; workspace?: string; id: string },\n Empty\n >;\n /** Copies the app's styles (`<from>/brands/<uuid>/`) into the channel's workspace, or the one named, once each. */\n 'styles.migrate': M<\n { channel: string; workspace?: string; from: string },\n StyleMigrationReport\n >;\n /** Imports an older workspace folder (`from`, only read) into the channel's workspace, or the one named. */\n 'workspace.import': M<\n { channel: string; workspace?: string; from: string },\n WorkspaceImportResult\n >;\n /** Refuses the whole pack (`refused`) or installs it, then sends `sources.changed`. */\n 'pack.install': M<PackInstallParams, PackInstallResult>;\n /** Where seeding the signed-in account's pack stands in the channel's workspace (`seed.changed` follows each change). */\n 'seed.status': M<ChannelParams, SeedState>;\n /** `dir` is the workspace's sources folder (`<dir>/<source id>/content.json`), `assets` the folder of their files. */\n 'pack.list': M<\n {\n channel: string;\n workspace?: string;\n /** Each source with its content, so a client reads no file of the workspace. */\n content?: boolean;\n },\n {\n packs: PackSummary[];\n /** The workspace's folders, for older apps that read them; a client asks with `content` instead. */\n dir: string;\n assets: string;\n }\n >;\n /** A design's file as it is: its bytes (base64), revision and save time, and where its thumbnail is; or that it has none yet. */\n 'design.read': M<\n {\n channel: string;\n workspace?: string;\n uri: string;\n /** False: only where the file is, its version and thumbnail, without its bytes and revision. */\n data?: boolean;\n },\n DesignReadResult\n >;\n /** Whether this CoDesign may write the workspace: `readOnly` is the message when a newer one updated its format. */\n 'workspace.status': M<\n { channel: string; workspace?: string },\n {\n readOnly?: string;\n /** 0.6's first start set the previous workspace aside (`previous`, absolute): the notice to show, until it is imported. */\n freshStart?: { notice: string; previous: string; at: number };\n }\n >;\n /** The fresh start's notice gone for good (the set-aside folder and every design stay): the new status. Idempotent; a workspace a newer CoDesign updated is refused. */\n 'workspace.dismissNotice': M<\n { channel: string; workspace?: string },\n ChannelMethods['workspace.status']['result']\n >;\n /** A design out of the library, with what is kept beside it: deleted, or with `trash` moved to the workspace's `.trash/`. */\n 'designs.remove': M<\n { channel: string; workspace?: string; uri: string; trash?: boolean },\n { trashed?: string }\n >;\n /** Where each asset or export file is (`files[i]` answers `uris[i]`): null when it is not one, not there, or links out. */\n 'assets.locate': M<\n { channel: string; workspace?: string; uris: string[] },\n { files: Array<AssetLocation | null> }\n >;\n /** The workspace's generated images written at or after `since` (epoch ms, 1 s slack), newest first, at most 24, without `exclude`: what a split that broke off may have left. */\n 'assets.since': M<\n { channel: string; workspace?: string; since: number; exclude?: string },\n { uris: string[] }\n >;\n 'assets.import': M<\n {\n channel: string;\n workspace?: string;\n path: string;\n /** How the asset came to be; a person's upload when omitted. */\n group?: 'uploads' | 'imported' | 'generated';\n },\n AssetsImportResult\n >;\n /** Writes a pack from the workspace (experiment `pack-create`); refused, writing nothing, when anything fails. */\n 'pack.create': M<PackCreateParams, PackCreateResult>;\n /** Takes `pack:<id>` off every asset and deletes the pack's sources and styles; no asset or design. */\n 'pack.remove': M<\n { channel: string; workspace?: string; id: string },\n { removed: PackPart[] }\n >;\n /** A new design from a pack template: `source` is the templates source, `item` the template's asset id. */\n 'designs.fromTemplate': M<\n { channel: string; workspace?: string; source: string; item: string },\n { id: string; uri: string; title: string }\n >;\n 'experiments.list': M<ChannelParams, { experiments: ExperimentInfo[] }>;\n 'experiments.set': M<\n /** `value` left out keeps the one set, except that `default` then clears it too. */\n { channel: string; id: string; state: ExperimentState; value?: number },\n { experiments: ExperimentInfo[] }\n >;\n 'design.save': M<\n { channel: string; scene: string },\n { uri: string; revision: string }\n >;\n /** A client's own UI event (CODE-842): a catalog event, which the unit records with the envelope it adds; anything else is dropped. */\n 'ui.event': M<ChannelParams & UiEvent, Record<string, never>>;\n 'auth.status': M<ChannelParams, AuthState>;\n /** `switchAccount` asks the sign-in page for an account even when the browser has one signed in. */\n 'auth.login': M<ChannelParams & { switchAccount?: boolean }, { url: string }>;\n /** Abandon the pending sign-in: its link stops working and the next `auth.login` starts a new one. */\n 'auth.cancel': M<ChannelParams, Empty>;\n 'auth.logout': M<ChannelParams, AuthState>;\n /** `fresh` renews a token the gateway refused. */\n 'auth.token': M<ChannelParams & { fresh?: boolean }, AuthToken>;\n 'chat.prompt': M<\n { channel: string; text: string; attachments?: Attachment[] },\n { turn: string }\n >;\n 'chat.cancel': M<{ channel: string; turn: string }, Empty>;\n 'chat.configure': M<\n {\n channel: string;\n model?: string;\n effort?: string;\n mode?: 'auto' | 'manual';\n /** The agent the chat's next turn runs on. */\n agent?: 'claude' | 'codex' | 'codesign';\n },\n Empty\n >;\n 'chat.tabs': M<ChannelParams, { tabs: ChatTab[]; active?: string }>;\n 'userServers.list': M<ChannelParams, { servers: UserServerInfo[] }>;\n 'userServers.add': M<UserServerAddParams, UserServerInfo>;\n 'userServers.remove': M<{ channel: string; name: string }, Empty>;\n /** Changes what is given; a tool set to `ask` drops its `always` or `off`. */\n 'userServers.set': M<\n {\n channel: string;\n name: string;\n enabled?: boolean;\n approvals?: UserServerSettings['approvals'];\n tools?: Record<string, 'ask' | 'always' | 'off'>;\n },\n UserServerInfo\n >;\n /** OAuth: the sign-in page the client opens; the loopback redirect finishes it and stores the token. */\n 'userServers.signin': M<{ channel: string; name: string }, { url: string }>;\n /** From the gateway: the chat's enabled servers it can start. */\n 'userServers.connect': M<ChannelParams, { servers: UserServerConnection[] }>;\n /** From the gateway, before `expiresAt` or after a 401: the server with a new token. */\n 'userServers.refresh': M<\n {\n channel: string;\n name: string;\n /** The access token a 401 refused. */\n stale?: string;\n },\n UserServerConnection\n >;\n /** From the gateway before a call to a user server; the unit asks the chat's client when it must. */\n 'permission.request': M<PermissionRequestParams, PermissionAnswer>;\n}\n\nexport type ConsentAnswer = 'granted' | 'denied';\n\nexport interface AdminMethods {\n status: M<Empty, StatusResult>;\n 'units.list': M<Empty, { units: UnitInfo[] }>;\n 'update.check': M<Empty, UpdateCheckResult>;\n 'update.apply': M<Empty, UpdateCheckResult>;\n /** The channel this home updates from and the version running; no network. */\n 'update.status': M<Empty, { channel: UpdateChannel; current: string }>;\n /** `downgrade` (default true, the CLI) grants the switch one install below `current`; the app sends false. */\n 'update.channel': M<{ channel: UpdateChannel; downgrade?: boolean }, Empty>;\n handoff: M<Empty, Empty>;\n shutdown: M<Empty, Empty>;\n 'workspaces.list': M<Empty, { workspaces: WorkspaceInfo[] }>;\n /** The machine's analytics answer, if any, and its install id (`~/.codesign/id`, minted if missing; absent when it cannot be). */\n 'telemetry.consent.get': M<\n Empty,\n { analytics?: ConsentAnswer; installId?: string }\n >;\n /** Stores the answer; units started afterwards take it (a running unit keeps its own). */\n 'telemetry.consent.set': M<{ analytics: ConsentAnswer }, Empty>;\n}\n\n/** What the router answers, from a client or a unit; `ROLE_ONLY` says which role may call what. */\nexport interface RouterMethods\n extends ChannelMethods, AdminMethods, AgentMethods {\n hello: M<HelloParams, HelloResult>;\n 'channel.open': M<ChannelOpenParams, ChannelOpenResult>;\n 'channel.close': M<ChannelParams, Empty>;\n 'design.claim': M<DesignClaimParams, DesignClaimResult>;\n 'design.release': M<DesignRef, Empty>;\n /** From a unit: the router runs the client tool on the client that declared it on the conversation's channel. */\n 'client.call': M<ClientCallParams, ToolResult>;\n /** From a client after its `switch_tab` or `start_design`: relayed as `conversation.activate`, then the agent's design channel moves. */\n 'chat.activate': M<{ channel: string; tab: ChatTab }, Empty>;\n}\n\n/** Answered by a conversation unit; the router relays them from a client. */\nexport interface AgentMethods {\n 'agents.status': M<Empty, { agents: AgentStatus[] }>;\n 'agent.install': M<{ agent: string }, { installed: boolean }>;\n /**\n * `signin` names this sign-in in the `agent.auth.changed` that ends it; a new sign-in cancels the agent's previous one.\n * `opened`: the agent said it opens its own sign-in page, so the client does not open `url`; `cdsn` prints how to sign in by hand.\n * `browser`: the program Claude's CLI opens its page with (BROWSER, decision 29).\n */\n 'agent.signin': M<\n { agent: string; browser?: string },\n { url: string; signin: string; opened?: boolean }\n >;\n /** Hands sign-in `signin` the code its page shows (Claude, decision 29). */\n 'agent.signin.code': M<\n { agent: string; signin: string; code: string },\n { signedIn: boolean }\n >;\n /** Stops the sign-in `signin` if it still runs; its `agent.auth.changed` follows. */\n 'agent.signin.cancel': M<{ agent: string; signin: string }, Empty>;\n}\n\n/** What a unit answers, from the router. */\nexport interface UnitMethods extends ChannelMethods, AgentMethods {\n hello: M<HelloParams, UnitHelloResult>;\n 'channel.open': M<\n UnitChannelOpenParams,\n Pick<ChannelOpenResult, 'design' | 'revision'>\n >;\n 'channel.close': M<ChannelParams, Empty>;\n /** Asked of a conversation unit: its active tab's design. */\n 'conversation.design': M<\n { conversation: string },\n /** The active tab's design, and the tab itself. */\n { workspace: string; uri?: string; tab?: ChatTab }\n >;\n /** Told to a conversation unit: the tab the agent works in now; the unit keeps it in the chat's record. */\n 'conversation.activate': M<{ conversation: string; tab: ChatTab }, Empty>;\n 'draft.save': M<Empty, { saved: boolean }>;\n park: M<Empty, Empty>;\n ping: M<Empty, Empty>;\n}\n\n/** What a client answers, from the router. */\nexport interface ClientMethods {\n 'client.call': M<ClientCallParams, ToolResult>;\n /** The permission card for a call to a user server, on the chat's conversation channel; no timeout. */\n 'permission.request': M<PermissionRequestParams, PermissionAnswer>;\n}\n\n/** Where seeding stands: one `running`, then exactly one `done` or `failed`, after every sign-in and every unit start. */\nexport type SeedPhase = 'running' | 'done' | 'failed';\n\n/** The pack seeded for the signed-in account (specs/2026-11-10-packs-on-sign-in-design.md). */\nexport interface SeedState {\n /** The workspace's id in `workspaces.json`. */\n workspace: string;\n /** `done` also when there was nothing to seed, the account had it already, or nobody is signed in; `failed` is tried again at a later unit start; a pack that failed waits 15 min, doubling per failure, at most a day. */\n state: SeedPhase;\n /** The pack this run seeded, with the person's own copies it holds, in the pack's order: on every `done` of a workspace that holds them, also when an earlier run made them. */\n pack?: {\n id: string;\n version: string;\n designs: Array<{ uri: string; title: string }>;\n /** Style ids. */\n styles: string[];\n };\n}\n\n/** Events the router sends a client. */\n/** An agent's status (`agents.status`'s fields), sent when a sign-in or an install ended. */\nexport interface AgentAuthState extends Omit<AgentStatus, 'name'> {\n agent: string;\n /** The sign-in this ends (`agent.signin`'s `signin`); absent after an install. */\n signin?: string;\n}\n\nexport interface AgentInstallProgress {\n agent: string;\n progress: number;\n message?: string;\n}\n\nexport interface ClientEvents {\n 'channel.moved': ChannelMovedParams;\n 'channel.closed': ChannelClosedParams;\n 'tools.changed': Empty;\n 'server.handoff': Empty;\n progress: ProgressParams;\n 'design.changed': DesignChangedParams;\n 'auth.changed': AuthState;\n 'chat.update': ChatUpdateParams;\n 'chat.done': ChatDoneParams;\n 'agent.auth.changed': AgentAuthState;\n 'agent.install.progress': AgentInstallProgress;\n 'sources.changed': SourcesChangedParams;\n 'seed.changed': SeedState;\n}\n\n/** A workspace's installed sources (packs) changed: an editor refreshes its dock and pickers, a unit its engine's sources. */\nexport interface SourcesChangedParams {\n /** The workspace's id in `workspaces.json`. */\n workspace: string;\n}\n\n/** Events a unit sends the router, which passes the channel-scoped ones on by their `channel`. */\nexport interface UnitEvents {\n progress: ProgressParams;\n 'design.changed': DesignChangedParams;\n 'chat.update': ChatUpdateParams;\n 'chat.done': ChatDoneParams;\n /** No channel: the router sends them to every client and every other unit. */\n 'auth.changed': AuthState;\n 'agent.auth.changed': AgentAuthState;\n /** No channel: the router sends it to the clients waiting on that agent's `agent.install`. */\n 'agent.install.progress': AgentInstallProgress;\n /** No channel: the router sends it to every client and every other unit. */\n 'sources.changed': SourcesChangedParams;\n /** No channel: the router sends it to every client and every other unit. */\n 'seed.changed': SeedState;\n}\n\n/** Events the router sends a unit. */\nexport interface RouterToUnitEvents {\n 'auth.changed': AuthState;\n 'agent.auth.changed': AgentAuthState;\n 'sources.changed': SourcesChangedParams;\n 'seed.changed': SeedState;\n}\n\nexport type MethodMap<T> = { [K in keyof T]: M<unknown, unknown> };\nexport type ParamsOf<\n T extends MethodMap<T>,\n K extends keyof T\n> = T[K]['params'];\nexport type ResultOf<\n T extends MethodMap<T>,\n K extends keyof T\n> = T[K]['result'];\n\n/** Admin methods are answered only for `client`; `design.claim` / `design.release` only for `unit`. */\nexport const ROLE_ONLY = {\n status: 'client',\n 'units.list': 'client',\n 'update.check': 'client',\n 'update.apply': 'client',\n 'update.status': 'client',\n 'update.channel': 'client',\n handoff: 'client',\n shutdown: 'client',\n 'workspaces.list': 'client',\n 'telemetry.consent.get': 'client',\n 'telemetry.consent.set': 'client',\n 'design.claim': 'unit',\n 'design.release': 'unit',\n 'chat.activate': 'client'\n} as const satisfies Partial<Record<keyof RouterMethods, Role>> &\n Record<keyof AdminMethods, 'client'>;\n\n/** What the model hears when the unit under its channel died: the call may not have run; open the design again. */\n/** A chat id names its unit's and its record's directories, so it is a plain name. */\nexport function isChatId(id: string): boolean {\n return /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/.test(id);\n}\n\nexport function sessionEndedNotice(design?: string): string {\n return `The design session ended unexpectedly, so the last call may not have completed. This connection now works in a new, empty session: ${design !== undefined ? `open ${design} again and preview it` : 'preview it'} before you continue.`;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/protocol/types.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,qHAAqH;AACrH,kCAAkC;AAUlC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAElE,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAAa,EAC0B,EAAE,CACxC,YAAmC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAwoCtD,uGAAuG;AACvG,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,QAAQ;IACtB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,QAAQ;IACzB,gBAAgB,EAAE,QAAQ;IAC1B,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,QAAQ;IAClB,iBAAiB,EAAE,QAAQ;IAC3B,uBAAuB,EAAE,QAAQ;IACjC,uBAAuB,EAAE,QAAQ;IACjC,uBAAuB,EAAE,QAAQ;IACjC,cAAc,EAAE,MAAM;IACtB,gBAAgB,EAAE,MAAM;IACxB,eAAe,EAAE,QAAQ;CAEW,CAAC;AAEvC,mHAAmH;AACnH,sFAAsF;AACtF,MAAM,UAAU,QAAQ,CAAC,EAAU;IACjC,OAAO,mCAAmC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAe;IAChD,OAAO,sIAAsI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,MAAM,uBAAuB,CAAC,CAAC,CAAC,YAAY,uBAAuB,CAAC;AAClP,CAAC","sourcesContent":["// The server protocol, version 2: one protocol for every link (client ⇄ router ⇄ unit), NDJSON over a transport.\n// Additive only within a version: a new method, event or optional field is fine; renaming or removing one, or making\n// one required, is a new version.\n\nimport type { UiEvent } from './ui-events.js';\n\nexport type Role = 'client' | 'router' | 'unit';\n\nexport type UnitKind = 'design' | 'conversation';\n\nexport type UpdateChannel = 'stable' | 'next' | 'canary';\n\nexport const CLIENT_KINDS = ['mcp', 'app', 'cli', 'tui'] as const;\n\nexport const isClientKind = (\n kind: unknown\n): kind is (typeof CLIENT_KINDS)[number] =>\n (CLIENT_KINDS as readonly unknown[]).includes(kind);\n\nexport interface ClientIdentity {\n kind: (typeof CLIENT_KINDS)[number];\n /** The MCP host's `clientInfo.name`, when the adapter is the client. */\n name?: string;\n version?: string;\n}\n\n/** What runs the client (Claude Code, opencode, a CI job …), read from its environment at the edge; a unit validates it again. */\nexport interface HarnessFields {\n model?: string;\n modelSource?: 'codex-meta';\n effort?: string;\n sandbox?: string;\n entrypoint?: string;\n aiAgent?: string;\n attended?: boolean;\n geminiCli?: true;\n opencode?: true;\n ci?: boolean;\n termProgram?: string;\n}\n\n/** The client's view of its environment, read once at the edge; the router builds the unit's config from it. */\nexport interface ClientConfig {\n /** CESDK_LICENSE / IMGLY_CESDK_LICENSE; never logged, never shown. */\n licence?: string;\n viewer?: { enabled?: boolean; host?: string };\n telemetry?: { usage?: boolean; errors?: boolean };\n engine?: { prefer?: 'auto' | 'native' | 'wasm' };\n gateway?: {\n /** IMGLY_GATEWAY_BASE_URL; only in a build that is not a release. */\n baseURL?: string;\n /** IMGLY_GATEWAY_API_KEY, or the file IMGLY_GATEWAY_API_KEY_FILE names; never logged, never shown. */\n apiKey?: string;\n };\n /** CODESIGN_WORKSPACE: a path the router resolves to a registered workspace. */\n workspacePath?: string;\n}\n\nexport interface ToolDef {\n name: string;\n title?: string;\n description: string;\n inputSchema: Record<string, unknown>;\n annotations?: { readOnlyHint?: boolean; destructiveHint?: boolean };\n}\n\nexport type Part =\n | { type: 'text'; text: string }\n | { type: 'image'; mimeType: string; data: string }\n | { type: 'resource'; uri: string; mimeType?: string; text?: string };\n\nexport interface ToolResult {\n content: Part[];\n isError?: boolean;\n}\n\nexport type ErrorKind =\n /** No common version, a request before `hello`, or a malformed line. */\n | 'protocol'\n /** The role may not call this method. */\n | 'forbidden'\n | 'unknown_method'\n | 'invalid_params'\n /** No live unit holds the design or session asked for. */\n | 'not_live'\n | 'timeout'\n /** The connection closed before the answer. */\n | 'closed'\n | 'in_use'\n | 'not_installed'\n /** The design is open in a unit of another runtime version than the channel pinned. */\n | 'version_mismatch'\n | 'internal';\n\nexport interface WireError {\n kind: ErrorKind;\n message: string;\n}\n\nexport type Empty = Record<string, never>;\n\n// --- Roles and versions\n\nexport interface HelloParams {\n role: Role;\n /** The protocol versions this side speaks, inclusive. */\n range: [number, number];\n client?: ClientIdentity;\n unit?: { id: string; kind: UnitKind };\n pid: number;\n}\n\nexport interface ServerInfo {\n version: string;\n /** The runtime version new units start on. */\n runtime: string;\n channel: UpdateChannel;\n}\n\nexport interface HelloResult {\n protocol: number;\n server: ServerInfo;\n pid: number;\n}\n\n/** A unit's answer to the router's `hello`: who it is, for the router that adopts it. */\nexport interface UnitHelloResult {\n protocol: number;\n unit: UnitRecord;\n pid: number;\n}\n\n/** What a unit writes to units/<id>/unit.json. */\nexport interface UnitRecord {\n id: string;\n kind: UnitKind;\n runtime: string;\n sdk: string;\n cesdk: string;\n pid: number;\n /** ms since the epoch. */\n startedAt: number;\n workspace: string;\n design?: string;\n conversation?: string;\n /** The engine child, which holds the engine and runs the model's code. */\n enginePid?: number;\n engine?: { flavor: 'native' | 'wasm'; reason?: string };\n /** It never takes the workspace's `.lock` while its router holds it (R8): absent, the router yields its hold. */\n workspaceHold?: true;\n}\n\n// --- Channels\n\nexport interface ChannelOpenParams {\n kind: UnitKind;\n client: ClientIdentity;\n /** A workspace id; `default` when omitted. */\n workspace?: string;\n /** A design's uri: join the live unit that holds it; `not_live` when none does. */\n attach?: string;\n /** A unit id: rejoin that unit after a handoff. */\n session?: string;\n /** With `kind: 'design'`: bind to that chat's active tab; with `kind: 'conversation'`: that chat (omitted: a new one). */\n conversation?: string;\n /** The tools the client draws (decision 36). */\n clientTools?: ToolDef[];\n /** With `clientTools` on a conversation channel: how to use them, added to the chat agent's instructions. */\n clientInstructions?: string;\n /** With `kind: 'conversation'`, for a new chat only: what it makes, kept in its record; `design` when omitted. */\n chatKind?: ChatKind;\n /** With `kind: 'conversation'`: the chat's user-server gateway, which gets no replay and is not one of its clients. */\n userServers?: boolean;\n /** With `kind: 'design'` and `conversation`: the kind of the client holding that chat, for usage telemetry. */\n chatClientKind?: ClientIdentity['kind'];\n /** A channel the server opens for itself (a chat's stage): its calls are not counted as usage. */\n internal?: boolean;\n config?: ClientConfig;\n /** For error reports and usage telemetry of this channel's calls. */\n harness?: HarnessFields;\n /** With `conversation`: the harness of the chat's client (the editor), reported as `chat*` fields. */\n chatHarness?: HarnessFields;\n /** An installed version: the channel's unit runs from it instead of `current`. */\n runtime?: string;\n /** With `kind: 'design'`: a one-shot command (cdsn's): the unit it started ends when it leaves, not after the idle time. */\n oneShot?: boolean;\n}\n\nexport type ChatKind = 'design' | 'style';\n\nexport interface ChannelOpenResult {\n channel: string;\n unit: string;\n runtime: string;\n workspace: string;\n design?: string;\n /** With `design`: its latest revision on the unit, when the unit saved it; a `design.changed` before the channel opened named it. */\n revision?: string;\n}\n\n/** `channel.open` from the router to the unit it chose. */\nexport interface UnitChannelOpenParams {\n channel: string;\n kind: UnitKind;\n client: ClientIdentity;\n workspace: string;\n conversation?: string;\n clientTools?: ToolDef[];\n clientInstructions?: string;\n chatKind?: ChatKind;\n userServers?: boolean;\n chatClientKind?: ClientIdentity['kind'];\n internal?: boolean;\n harness?: HarnessFields;\n chatHarness?: HarnessFields;\n /** A chat's design channel: the design its active tab names (`conversation.design`), opened by a unit holding none. */\n design?: string;\n}\n\nexport interface ChannelParams {\n channel: string;\n}\n\nexport interface ChannelMovedParams {\n channel: string;\n unit: string;\n runtime: string;\n}\n\nexport interface ChannelClosedParams {\n channel: string;\n reason: string;\n /** The unit died rather than being parked or handed over; its requests in flight failed with `sessionEndedNotice`. */\n unexpected?: boolean;\n design?: string;\n}\n\n// --- Design operations (channel-scoped)\n\nexport interface ToolsCallParams {\n channel: string;\n call: string;\n name: string;\n arguments: Record<string, unknown>;\n progress?: boolean;\n /** The MCP host's `_meta` of the call (progress token, client info), passed through as it came. */\n meta?: Record<string, unknown>;\n /** Unique across connections: a call that repeats it, after the router died under the first, gets the first's answer. */\n once?: string;\n}\n\nexport interface ProgressParams {\n channel: string;\n call: string;\n progress: number;\n total?: number;\n message?: string;\n}\n\nexport interface SkillInfo {\n name: string;\n description: string;\n uri: string;\n files: string[];\n /** The skill's SKILL.md frontmatter. */\n frontmatter?: Record<string, unknown>;\n /** Every file of the skill, so a client lists them without reading each. */\n entries?: SkillEntry[];\n}\n\nexport interface SkillEntry {\n uri: string;\n digest: string;\n size: number;\n}\n\nexport interface PromptInfo {\n name: string;\n title?: string;\n description?: string;\n arguments?: { name: string; description?: string; required?: boolean }[];\n}\n\nexport interface PromptsGetResult {\n description?: string;\n messages: { role: 'user' | 'assistant'; content: Part }[];\n}\n\nexport interface PromptsCompleteParams {\n channel: string;\n prompt: string;\n argument: { name: string; value: string };\n /** Values of the prompt's other arguments, already chosen. */\n context?: Record<string, string>;\n}\n\n/** A design in the library, as `designs` lists it. */\nexport interface DesignSummary {\n uri: string;\n title: string;\n [field: string]: unknown;\n}\n\nexport interface DesignChangedParams {\n workspace: string;\n uri: string;\n unit: string;\n revision: string;\n by: { tool?: string; client?: ClientIdentity };\n}\n\nexport interface AuthState {\n signedIn: boolean;\n email?: string;\n /** The account's display name, once the server has learned it. */\n name?: string;\n}\n\n/** A short-lived IMG.LY access token for a client's own gateway requests; both absent while signed out. */\nexport interface AuthToken {\n accessToken?: string;\n /** epoch ms */\n expiresAt?: number;\n}\n\n// --- Routing a design\n\nexport interface DesignRef {\n workspace: string;\n uri: string;\n}\n\n/** `design.claim`: the channel whose call asked for the design is the one that moves when another unit holds it; none for a person's download in the viewer, which moves nothing. */\nexport interface DesignClaimParams extends DesignRef {\n channel?: string;\n}\n\nexport type DesignClaimResult = { granted: true } | { heldBy: string };\n\n// --- Chats\n\nexport interface Attachment {\n name: string;\n mimeType: string;\n /** base64; or `path`, a file the server may read. */\n data?: string;\n path?: string;\n}\n\nexport interface ChatTab {\n id: string;\n designUri?: string;\n title: string;\n}\n\nexport interface Usage {\n /** Input read at full price: not from the provider's prompt cache. */\n inputTokens?: number;\n outputTokens?: number;\n /** Input read from the prompt cache, and written to it. */\n cachedTokens?: number;\n cacheWriteTokens?: number;\n /** The part of the output the model spent reasoning, where the agent says it. */\n reasoningTokens?: number;\n costUsd?: number;\n /** The tokens in the agent's context window, and its size (ACP `usage_update` used, size). */\n contextTokens?: number;\n contextSize?: number;\n}\n\nexport type ChatUpdate =\n /** The user's prompt, so a client that attaches later sees both sides. */\n | { kind: 'user'; text: string; attachments?: Attachment[] }\n | { kind: 'message'; text: string }\n | { kind: 'thought'; text: string }\n | {\n kind: 'tool_call';\n id: string;\n name: string;\n title?: string;\n arguments?: unknown;\n }\n | {\n kind: 'tool_call_update';\n id: string;\n status?: 'running' | 'completed' | 'failed';\n content?: Part[];\n /** The call's input once the agent has more of it than its `tool_call` carried. */\n arguments?: unknown;\n }\n | { kind: 'usage'; usage: Usage; nextTool?: string }\n | {\n kind: 'config';\n /** Each model with the efforts it takes; `efforts` is the current model's. */\n models?: AgentModel[];\n model?: string;\n efforts?: string[];\n effort?: string;\n }\n | { kind: 'step'; title: string; detail?: string }\n | { kind: 'stage'; uri: string; revision: string; pages: Part[] }\n | { kind: 'tabs'; tabs: ChatTab[]; active?: string };\n\nexport interface ChatUpdateParams {\n channel: string;\n /** Omitted for an update outside a turn (the tabs). */\n turn?: string;\n update: ChatUpdate;\n}\n\nexport interface ChatDoneParams {\n channel: string;\n turn: string;\n stopReason: string;\n /** With stopReason `error`: what went wrong. */\n message?: string;\n /**\n * With stopReason `error`, a failure a client may word itself: `text-tool-call`, the agent wrote a tool call as text;\n * `tools-unavailable`, CoDesign's tools did not start and the prompt was not sent.\n */\n failure?: 'text-tool-call' | 'tools-unavailable';\n usage?: Usage;\n}\n\nexport interface ClientCallParams {\n channel: string;\n call: string;\n name: string;\n arguments: Record<string, unknown>;\n /** The chat the call belongs to; the router fills it in. */\n conversation?: string;\n}\n\nexport interface AgentStatus {\n name: string;\n installed?: boolean;\n signedIn: boolean;\n label?: string;\n /** What `chat.configure` may pick for this agent, with the efforts each model takes. */\n models?: AgentModel[];\n /** The model and effort it runs when none is picked. */\n model?: string;\n effort?: string;\n}\n\nexport interface AgentModel {\n value: string;\n name: string;\n /** The picker's one-line description (\"Best for everyday, complex tasks\"). */\n description?: string;\n efforts?: string[];\n}\n\n// --- The user's MCP servers (decisions 40, 41, 60 B, 61): `mcp.json`, answered by a conversation unit\n\n/** How a server is reached, in mcp.json's common fields; a secret appears only as `${secret:<key>}`. */\nexport type UserServerSpec =\n | {\n type: 'stdio';\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n }\n | { type: 'http'; url: string; headers?: Record<string, string> };\n\nexport interface UserServerSettings {\n enabled: boolean;\n /** `none`: the headers carry the key; `now` / `when-needed`: OAuth. */\n signIn: 'none' | 'now' | 'when-needed';\n /** `changes-only`: a tool the server marks read-only and not destructive runs without asking. */\n approvals: 'every-call' | 'changes-only';\n /** `always` runs without asking, `off` is not offered to the agent; a tool not listed asks. */\n tools: Record<string, 'always' | 'off'>;\n}\n\nexport interface UserServerInfo extends UserServerSettings {\n name: string;\n id: string;\n server: UserServerSpec;\n /** `needs_signin`: an OAuth server with no token in the store. */\n state: 'ready' | 'disabled' | 'needs_signin';\n addedAt: number;\n}\n\nexport interface UserServerAddParams {\n channel: string;\n name: string;\n server: UserServerSpec;\n /** Header or env values to keep in the credential store, by header or variable name; mcp.json gets references. */\n secrets?: Record<string, string>;\n signIn?: UserServerSettings['signIn'];\n /** A client id to use instead of dynamic registration. */\n oauthClient?: { clientId: string; clientSecret?: string };\n}\n\n/** What the gateway connects with: an enabled, signed-in server with its secrets and token resolved. */\nexport interface UserServerConnection extends Pick<\n UserServerSettings,\n 'approvals' | 'tools'\n> {\n name: string;\n server: UserServerSpec;\n /** epoch ms: when the OAuth token in `server.headers` expires; `userServers.refresh` before it. */\n expiresAt?: number;\n}\n\nexport interface PermissionRequestParams {\n channel: string;\n call: string;\n /** The user server's name and its tool's, untrusted text. */\n server: string;\n tool: string;\n arguments: Record<string, unknown>;\n /** As the server says. */\n hints?: { readOnlyHint?: boolean; destructiveHint?: boolean };\n}\n\n/** `always` allows the tool from now on; a `deny` from the unit carries the text the agent gets. */\nexport interface PermissionAnswer {\n outcome: 'allow' | 'always' | 'deny';\n message?: string;\n}\n\n// --- Admin\n\nexport interface UnitInfo extends UnitRecord {\n channels: number;\n}\n\nexport interface StatusResult {\n protocol: number;\n server: ServerInfo;\n managed: boolean;\n home: string;\n units: UnitInfo[];\n clients: number;\n}\n\nexport interface UpdateCheckResult {\n current: string;\n latest?: string;\n staged?: string;\n /** Why there is nothing to do: managed by a package manager, or no release found. */\n reason?: string;\n}\n\nexport type ExperimentState = 'default' | 'enabled' | 'disabled';\n\n/** One experiment as `experiments.list` answers it: `default` is the channel's, `on` what the server does; `value` and `defaultValue` only on one that carries a number. */\nexport interface ExperimentInfo {\n id: string;\n title: string;\n description: string;\n state: ExperimentState;\n default: boolean;\n on: boolean;\n value?: number;\n defaultValue?: number;\n}\n\nexport interface WorkspaceInfo {\n id: string;\n name: string;\n path: string;\n}\n\n/** A style's `metadata.json` (spec 2026-10-20-asset-pack-design.md, \"Styles\"): the app's `kit.json` renamed. */\nexport interface StyleMetadata {\n title: string;\n savedAt: number;\n /** Counts the saves; a save that names an older one is refused. */\n revision: number;\n createdAt?: number;\n /** What the style was made from, as the person gave it. */\n source?: string;\n origin?: { pack?: string; migrated?: string };\n nameSource?: 'input' | 'detected' | 'user';\n generative?: 'allowed';\n /** The app's record of the style's fonts (their licences, the installed families it uses). */\n fonts?: Record<string, unknown>;\n}\n\nexport interface StyleSummary {\n id: string;\n title: string;\n savedAt: number;\n revision: number;\n origin?: StyleMetadata['origin'];\n}\n\n/** A style as `styles.get` answers it: its content, never a path into the workspace (the server owns the folder). */\nexport interface StyleInfo {\n id: string;\n metadata: StyleMetadata;\n tokens: Record<string, unknown> | null;\n styleMd: string;\n /** The files of its `sources/` folder, by name. */\n references: string[];\n preview: boolean;\n /** Asked with `styles.get`'s `assets`: the files it added to the workspace's assets, by their sidecars' current filename (a file added without a name is left out). */\n assets?: Array<{ uri: string; filename: string }>;\n}\n\n/** `styles.save`: the style's files as local paths, which the server hashes into `assets/`. */\nexport interface StyleSaveParams {\n /** A new style when absent. */\n id?: string;\n /** The revision the writer read; a style saved since is refused (`conflict`). */\n revision?: number;\n title?: string;\n tokens?: Record<string, unknown>;\n styleMd?: string;\n /** A path as it stands (or will stand) in `tokens` → the local file it names: replaced by the file's `workspace://assets/…` URI. */\n files?: Record<string, string>;\n /** Files to keep in `sources/`, by name → local path; `null` removes one. */\n references?: Record<string, string | null>;\n /** The specimen card, a local PNG. */\n preview?: string;\n metadata?: Omit<StyleMetadata, 'title' | 'savedAt' | 'revision' | 'origin'>;\n}\n\nexport interface StyleMigrationReport {\n migrated: number;\n /** Kits left in the app's folder, with why. */\n failed: Array<{ id: string; reason: string }>;\n}\n\n/** One of a pack's sources or styles. */\nexport interface PackPart {\n id: string;\n title: string;\n /** A source's kind (templates, images, typefaces, colors); absent for a style. */\n kind?: string;\n /** How many assets a source lists. */\n items?: number;\n /** A source's content (its content.json), with `pack.list`'s `content: true`. */\n content?: Record<string, unknown>;\n}\n\nexport interface PackSummary {\n id: string;\n title: string;\n version: string;\n sources: PackPart[];\n styles: PackPart[];\n}\n\n/** What `workspace.import` did (spec 2026-10-20-asset-pack-design.md, \"Importing an old workspace\"). */\nexport interface WorkspaceImportResult {\n /** Designs written, archives and pre-0.4 roots included. */\n designs: number;\n /** Of those, archives that became plain scenes. */\n archives: number;\n /** Of those, an older CoDesign's unsaved drafts, each imported as a new design. */\n drafts: number;\n /** Of those, files copied as they are, with why. */\n asIs: Array<{ path: string; reason: string }>;\n assets: number;\n /** 0.5 labels folded into the workspace's asset records. */\n labels: number;\n styles: number;\n sources: number;\n /** Ids the workspace holds with other content: left as they are. */\n skipped: Array<{ path: string; reason: string }>;\n failed: Array<{ path: string; reason: string }>;\n /** The first-start notice went: the import was whole and came from the folder it names. */\n noticeCleared: boolean;\n}\n\n/** What `pack.install` did, or would do (`dryRun`). */\nexport interface PackInstallResult extends PackSummary {\n outcome: 'installed' | 'upgraded' | 'unchanged';\n /** The version installed before, for an upgrade or an unchanged reinstall. */\n previous?: string;\n /** Asset files the pack adds, and those the workspace already has (they only gain the group). */\n assets: { added: number; present: number };\n dryRun?: boolean;\n /**\n * What opening the pack added to the workspace as the person's own (a pack is seeded, never kept installed): its\n * templates as designs, its styles as styles. A dry run names titles only; `unchanged` adds nothing.\n */\n added?: {\n designs: Array<{ title: string; uri?: string }>;\n styles: Array<{ title: string; id?: string }>;\n };\n /** For a `url`: the host it came from, and the downloaded file a confirming `pack.install { path }` seeds. */\n host?: string;\n path?: string;\n}\n\n/** `pack.install`: a local file or an `https` URL; `dryRun` answers the plan and writes nothing. */\nexport interface PackInstallParams {\n channel: string;\n workspace?: string;\n path?: string;\n url?: string;\n dryRun?: boolean;\n}\n\n/** `design.read`: a design's file, or that it has none yet. */\nexport type DesignReadResult =\n | { exists: false }\n | {\n exists: true;\n /** Where the file is (to show it in the file manager); the server's to write. */\n file: string;\n /** The file's time and size: changes with every write, cheap to compare. */\n version: string;\n /** The file's bytes, base64: a plain scene, or an archive from before. Not with `data: false`. */\n data?: string;\n /** The revision `design.changed` names. Not with `data: false`. */\n revision?: string;\n savedAt?: number;\n /** The PNG of its first page the server keeps beside it, and its version (the file's time). */\n thumbnail?: { file: string; version: number };\n };\n\n/** Where `assets.locate` found one uri's file: the server's to write, the client's to read. */\nexport interface AssetLocation {\n file: string;\n size: number;\n /** The name the asset was added under (its sidecar's `meta.filename`); absent for an export or an asset with none. */\n filename?: string;\n}\n\n/** `assets.import`: a file kept once in the workspace's store, by its bytes; `file` is where it is stored. */\nexport interface AssetsImportResult {\n uri: string;\n relPath: string;\n file: string;\n size: number;\n /** The store held these bytes already: nothing was copied. */\n existed: boolean;\n}\n\n/** `pack.create` (experiment `pack-create`): a pack from the workspace's designs (as templates), styles and images. */\nexport interface PackCreateParams {\n channel: string;\n workspace?: string;\n /** The file to write, ending in `.imglypack` or `.cdsnpack`. */\n out: string;\n id: string;\n /** Semver; the same ids at a higher version make an upgrade. */\n version: string;\n title: string;\n /** Design ids or `workspace://designs/<ab>/<rest>.imgly` URIs; each becomes a template. */\n designs?: string[];\n /** Style ids; each goes in as `<id>.<name>`. */\n styles?: string[];\n /** Asset files or `workspace://assets/…` URIs for the pack's images source. */\n images?: string[];\n /** The text of the pack's `LICENSE`. */\n license?: string;\n /** Whether the styles' fonts and colors make a typeface and a color source; default true. */\n typefaces?: boolean;\n colors?: boolean;\n /** Answer the plan and write nothing. */\n dryRun?: boolean;\n}\n\n/** What `pack.create` wrote, or would write (`dryRun`). */\nexport interface PackCreateResult extends PackSummary {\n /** The asset files in the pack: templates, the files everything names, its images. */\n assets: number;\n /** The image assets the designs and styles name, as `workspace://assets/…` URIs. */\n used: string[];\n dryRun?: boolean;\n /** The file written and its size. */\n path?: string;\n bytes?: number;\n}\n\n// --- Method maps: method → params → result, one per answering side\n\nexport interface M<P, R> {\n params: P;\n result: R;\n}\n\n/** Channel-scoped methods: a client sends them to the router, which forwards them to the channel's unit. */\nexport interface ChannelMethods {\n 'tools.list': M<ChannelParams, { tools: ToolDef[] }>;\n 'tools.call': M<ToolsCallParams, ToolResult>;\n 'tools.cancel': M<{ channel: string; call: string }, Empty>;\n instructions: M<ChannelParams, { text: string }>;\n 'skills.list': M<ChannelParams, { skills: SkillInfo[] }>;\n 'skills.read': M<\n { channel: string; uri: string },\n { text: string; mimeType: string }\n >;\n 'prompts.list': M<ChannelParams, { prompts: PromptInfo[] }>;\n 'prompts.get': M<\n { channel: string; name: string; arguments?: Record<string, string> },\n PromptsGetResult\n >;\n 'prompts.complete': M<\n PromptsCompleteParams,\n { values: string[]; total?: number; hasMore?: boolean }\n >;\n 'designs.list': M<\n { channel: string; workspace?: string },\n { designs: DesignSummary[] }\n >;\n /** `dir` is the workspace's styles folder, `assets` the folder of the files they name. */\n 'styles.list': M<\n { channel: string; workspace?: string },\n { styles: StyleSummary[]; dir: string; assets: string }\n >;\n 'styles.get': M<\n { channel: string; workspace?: string; id: string; assets?: boolean },\n { style: StyleInfo }\n >;\n /** A style's own files (`preview.png`, `sources/<name>`) as paths to read, `files[i]` for `files[i]`; null for any other name, a file that resolves outside the style's folder, or a missing one. */\n 'styles.locate': M<\n { channel: string; workspace?: string; id: string; files: string[] },\n { files: Array<AssetLocation | null> }\n >;\n /** `files`: each `files` entry's ref → the `workspace://assets/…` URI its file got. */\n 'styles.save': M<\n { channel: string; workspace?: string } & StyleSaveParams,\n { style: StyleInfo; files: Record<string, string> }\n >;\n 'styles.duplicate': M<\n { channel: string; workspace?: string; id: string },\n { style: StyleInfo }\n >;\n /** Copies a style and the assets it names into the workspace `to` (an id of `workspaces.json`). */\n 'styles.copy': M<\n { channel: string; workspace?: string; id: string; to: string },\n { style: StyleInfo }\n >;\n 'styles.delete': M<\n { channel: string; workspace?: string; id: string },\n Empty\n >;\n /** Copies the app's styles (`<from>/brands/<uuid>/`) into the channel's workspace, or the one named, once each. */\n 'styles.migrate': M<\n { channel: string; workspace?: string; from: string },\n StyleMigrationReport\n >;\n /** Imports an older workspace folder (`from`, only read) into the channel's workspace, or the one named. */\n 'workspace.import': M<\n { channel: string; workspace?: string; from: string },\n WorkspaceImportResult\n >;\n /** Refuses the whole pack (`refused`) or seeds it: templates become own designs, styles own styles, images uploads; no pack stays installed and no `sources.changed` is sent. */\n 'pack.install': M<PackInstallParams, PackInstallResult>;\n /** Where seeding the signed-in account's pack stands in the channel's workspace (`seed.changed` follows each change). */\n 'seed.status': M<ChannelParams, SeedState>;\n /** `dir` is the workspace's sources folder (`<dir>/<source id>/content.json`), `assets` the folder of their files. */\n 'pack.list': M<\n {\n channel: string;\n workspace?: string;\n /** Each source with its content, so a client reads no file of the workspace. */\n content?: boolean;\n },\n {\n packs: PackSummary[];\n /** The workspace's folders, for older apps that read them; a client asks with `content` instead. */\n dir: string;\n assets: string;\n }\n >;\n /** A design's file as it is: its bytes (base64), revision and save time, and where its thumbnail is; or that it has none yet. */\n 'design.read': M<\n {\n channel: string;\n workspace?: string;\n uri: string;\n /** False: only where the file is, its version and thumbnail, without its bytes and revision. */\n data?: boolean;\n },\n DesignReadResult\n >;\n /** Whether this CoDesign may write the workspace: `readOnly` is the message when a newer one updated its format. */\n 'workspace.status': M<\n { channel: string; workspace?: string },\n {\n readOnly?: string;\n /** 0.6's first start set the previous workspace aside (`previous`, absolute): the notice to show, until it is imported. */\n freshStart?: { notice: string; previous: string; at: number };\n }\n >;\n /** The fresh start's notice gone for good (the set-aside folder and every design stay): the new status. Idempotent; a workspace a newer CoDesign updated is refused. */\n 'workspace.dismissNotice': M<\n { channel: string; workspace?: string },\n ChannelMethods['workspace.status']['result']\n >;\n /** A design out of the library, with what is kept beside it: deleted, or with `trash` moved to the workspace's `.trash/`. */\n 'designs.remove': M<\n { channel: string; workspace?: string; uri: string; trash?: boolean },\n { trashed?: string }\n >;\n /** Where each asset or export file is (`files[i]` answers `uris[i]`): null when it is not one, not there, or links out. */\n 'assets.locate': M<\n { channel: string; workspace?: string; uris: string[] },\n { files: Array<AssetLocation | null> }\n >;\n /** The workspace's generated images written at or after `since` (epoch ms, 1 s slack), newest first, at most 24, without `exclude`: what a split that broke off may have left. */\n 'assets.since': M<\n { channel: string; workspace?: string; since: number; exclude?: string },\n { uris: string[] }\n >;\n 'assets.import': M<\n {\n channel: string;\n workspace?: string;\n path: string;\n /** How the asset came to be; a person's upload when omitted. */\n group?: 'uploads' | 'imported' | 'generated';\n },\n AssetsImportResult\n >;\n /** Writes a pack from the workspace (experiment `pack-create`); refused, writing nothing, when anything fails. */\n 'pack.create': M<PackCreateParams, PackCreateResult>;\n /** Takes `pack:<id>` off every asset and deletes the pack's sources and styles; no asset or design. */\n 'pack.remove': M<\n { channel: string; workspace?: string; id: string },\n { removed: PackPart[] }\n >;\n /** A new design from a pack template: `source` is the templates source, `item` the template's asset id. */\n 'designs.fromTemplate': M<\n { channel: string; workspace?: string; source: string; item: string },\n { id: string; uri: string; title: string }\n >;\n 'experiments.list': M<ChannelParams, { experiments: ExperimentInfo[] }>;\n 'experiments.set': M<\n /** `value` left out keeps the one set, except that `default` then clears it too. */\n { channel: string; id: string; state: ExperimentState; value?: number },\n { experiments: ExperimentInfo[] }\n >;\n 'design.save': M<\n { channel: string; scene: string },\n { uri: string; revision: string }\n >;\n /** A client's own UI event (CODE-842): a catalog event, which the unit records with the envelope it adds; anything else is dropped. */\n 'ui.event': M<ChannelParams & UiEvent, Record<string, never>>;\n 'auth.status': M<ChannelParams, AuthState>;\n /** `switchAccount` asks the sign-in page for an account even when the browser has one signed in. */\n 'auth.login': M<ChannelParams & { switchAccount?: boolean }, { url: string }>;\n /** Abandon the pending sign-in: its link stops working and the next `auth.login` starts a new one. */\n 'auth.cancel': M<ChannelParams, Empty>;\n 'auth.logout': M<ChannelParams, AuthState>;\n /** `fresh` renews a token the gateway refused. */\n 'auth.token': M<ChannelParams & { fresh?: boolean }, AuthToken>;\n 'chat.prompt': M<\n { channel: string; text: string; attachments?: Attachment[] },\n { turn: string }\n >;\n 'chat.cancel': M<{ channel: string; turn: string }, Empty>;\n 'chat.configure': M<\n {\n channel: string;\n model?: string;\n effort?: string;\n mode?: 'auto' | 'manual';\n /** The agent the chat's next turn runs on. */\n agent?: 'claude' | 'codex' | 'codesign';\n },\n Empty\n >;\n 'chat.tabs': M<ChannelParams, { tabs: ChatTab[]; active?: string }>;\n 'userServers.list': M<ChannelParams, { servers: UserServerInfo[] }>;\n 'userServers.add': M<UserServerAddParams, UserServerInfo>;\n 'userServers.remove': M<{ channel: string; name: string }, Empty>;\n /** Changes what is given; a tool set to `ask` drops its `always` or `off`. */\n 'userServers.set': M<\n {\n channel: string;\n name: string;\n enabled?: boolean;\n approvals?: UserServerSettings['approvals'];\n tools?: Record<string, 'ask' | 'always' | 'off'>;\n },\n UserServerInfo\n >;\n /** OAuth: the sign-in page the client opens; the loopback redirect finishes it and stores the token. */\n 'userServers.signin': M<{ channel: string; name: string }, { url: string }>;\n /** From the gateway: the chat's enabled servers it can start. */\n 'userServers.connect': M<ChannelParams, { servers: UserServerConnection[] }>;\n /** From the gateway, before `expiresAt` or after a 401: the server with a new token. */\n 'userServers.refresh': M<\n {\n channel: string;\n name: string;\n /** The access token a 401 refused. */\n stale?: string;\n },\n UserServerConnection\n >;\n /** From the gateway before a call to a user server; the unit asks the chat's client when it must. */\n 'permission.request': M<PermissionRequestParams, PermissionAnswer>;\n}\n\nexport type ConsentAnswer = 'granted' | 'denied';\n/** `cdsn telemetry`'s answer: `off` stops usage telemetry and error reports for every client on the machine. */\nexport type ReportsAnswer = 'on' | 'off';\n\nexport interface AdminMethods {\n status: M<Empty, StatusResult>;\n 'units.list': M<Empty, { units: UnitInfo[] }>;\n 'update.check': M<Empty, UpdateCheckResult>;\n 'update.apply': M<Empty, UpdateCheckResult>;\n /** The channel this home updates from and the version running; no network. */\n 'update.status': M<Empty, { channel: UpdateChannel; current: string }>;\n /** `downgrade` (default true, the CLI) grants the switch one install below `current`; the app sends false. */\n 'update.channel': M<{ channel: UpdateChannel; downgrade?: boolean }, Empty>;\n handoff: M<Empty, Empty>;\n shutdown: M<Empty, Empty>;\n 'workspaces.list': M<Empty, { workspaces: WorkspaceInfo[] }>;\n /** The machine's analytics answer, if any, its reports opt-out, if set, and its install id (`~/.codesign/id`, minted if missing; absent when it cannot be). */\n 'telemetry.consent.get': M<\n Empty,\n { analytics?: ConsentAnswer; reports?: 'off'; installId?: string }\n >;\n /** Stores the answer; units started afterwards take it (a running unit keeps its own). */\n 'telemetry.consent.set': M<{ analytics: ConsentAnswer }, Empty>;\n /** Stores the machine's reports opt-out (`cdsn telemetry`), keeping the analytics answer; units started afterwards take it. */\n 'telemetry.reports.set': M<{ reports: ReportsAnswer }, Empty>;\n}\n\n/** What the router answers, from a client or a unit; `ROLE_ONLY` says which role may call what. */\nexport interface RouterMethods\n extends ChannelMethods, AdminMethods, AgentMethods {\n hello: M<HelloParams, HelloResult>;\n 'channel.open': M<ChannelOpenParams, ChannelOpenResult>;\n 'channel.close': M<ChannelParams, Empty>;\n 'design.claim': M<DesignClaimParams, DesignClaimResult>;\n 'design.release': M<DesignRef, Empty>;\n /** From a unit: the router runs the client tool on the client that declared it on the conversation's channel. */\n 'client.call': M<ClientCallParams, ToolResult>;\n /** From a client after its `switch_tab` or `start_design`: relayed as `conversation.activate`, then the agent's design channel moves. */\n 'chat.activate': M<{ channel: string; tab: ChatTab }, Empty>;\n}\n\n/** Answered by a conversation unit; the router relays them from a client. */\nexport interface AgentMethods {\n 'agents.status': M<Empty, { agents: AgentStatus[] }>;\n 'agent.install': M<{ agent: string }, { installed: boolean }>;\n /**\n * `signin` names this sign-in in the `agent.auth.changed` that ends it; a new sign-in cancels the agent's previous one.\n * `opened`: the agent said it opens its own sign-in page, so the client does not open `url`; `cdsn` prints how to sign in by hand.\n * `browser`: the program Claude's CLI opens its page with (BROWSER, decision 29).\n */\n 'agent.signin': M<\n { agent: string; browser?: string },\n { url: string; signin: string; opened?: boolean }\n >;\n /** Hands sign-in `signin` the code its page shows (Claude, decision 29). */\n 'agent.signin.code': M<\n { agent: string; signin: string; code: string },\n { signedIn: boolean }\n >;\n /** Stops the sign-in `signin` if it still runs; its `agent.auth.changed` follows. */\n 'agent.signin.cancel': M<{ agent: string; signin: string }, Empty>;\n}\n\n/** What a unit answers, from the router. */\nexport interface UnitMethods extends ChannelMethods, AgentMethods {\n hello: M<HelloParams, UnitHelloResult>;\n 'channel.open': M<\n UnitChannelOpenParams,\n Pick<ChannelOpenResult, 'design' | 'revision'>\n >;\n 'channel.close': M<ChannelParams, Empty>;\n /** Asked of a conversation unit: its active tab's design. */\n 'conversation.design': M<\n { conversation: string },\n /** The active tab's design, and the tab itself. */\n { workspace: string; uri?: string; tab?: ChatTab }\n >;\n /** Told to a conversation unit: the tab the agent works in now; the unit keeps it in the chat's record. */\n 'conversation.activate': M<{ conversation: string; tab: ChatTab }, Empty>;\n 'draft.save': M<Empty, { saved: boolean }>;\n park: M<Empty, Empty>;\n ping: M<Empty, Empty>;\n}\n\n/** What a client answers, from the router. */\nexport interface ClientMethods {\n 'client.call': M<ClientCallParams, ToolResult>;\n /** The permission card for a call to a user server, on the chat's conversation channel; no timeout. */\n 'permission.request': M<PermissionRequestParams, PermissionAnswer>;\n}\n\n/** Where seeding stands: one `running`, then exactly one `done` or `failed`, after every sign-in and every unit start. */\nexport type SeedPhase = 'running' | 'done' | 'failed';\n\n/** The pack seeded for the signed-in account (specs/2026-11-10-packs-on-sign-in-design.md). */\nexport interface SeedState {\n /** The workspace's id in `workspaces.json`. */\n workspace: string;\n /** `done` also when there was nothing to seed, the account had it already, or nobody is signed in; `failed` is tried again at a later unit start; a pack that failed waits 15 min, doubling per failure, at most a day. */\n state: SeedPhase;\n /** The pack this run seeded, with the person's own copies it holds, in the pack's order: on every `done` of a workspace that holds them, also when an earlier run made them. */\n pack?: {\n id: string;\n version: string;\n designs: Array<{ uri: string; title: string }>;\n /** Style ids. */\n styles: string[];\n };\n}\n\n/** Events the router sends a client. */\n/** An agent's status (`agents.status`'s fields), sent when a sign-in or an install ended. */\nexport interface AgentAuthState extends Omit<AgentStatus, 'name'> {\n agent: string;\n /** The sign-in this ends (`agent.signin`'s `signin`); absent after an install. */\n signin?: string;\n}\n\nexport interface AgentInstallProgress {\n agent: string;\n progress: number;\n message?: string;\n}\n\nexport interface ClientEvents {\n 'channel.moved': ChannelMovedParams;\n 'channel.closed': ChannelClosedParams;\n 'tools.changed': Empty;\n 'server.handoff': Empty;\n progress: ProgressParams;\n 'design.changed': DesignChangedParams;\n 'auth.changed': AuthState;\n 'chat.update': ChatUpdateParams;\n 'chat.done': ChatDoneParams;\n 'agent.auth.changed': AgentAuthState;\n 'agent.install.progress': AgentInstallProgress;\n 'sources.changed': SourcesChangedParams;\n 'seed.changed': SeedState;\n}\n\n/** A workspace's installed sources (packs) changed: an editor refreshes its dock and pickers, a unit its engine's sources. */\nexport interface SourcesChangedParams {\n /** The workspace's id in `workspaces.json`. */\n workspace: string;\n}\n\n/** Events a unit sends the router, which passes the channel-scoped ones on by their `channel`. */\nexport interface UnitEvents {\n progress: ProgressParams;\n 'design.changed': DesignChangedParams;\n 'chat.update': ChatUpdateParams;\n 'chat.done': ChatDoneParams;\n /** No channel: the router sends them to every client and every other unit. */\n 'auth.changed': AuthState;\n 'agent.auth.changed': AgentAuthState;\n /** No channel: the router sends it to the clients waiting on that agent's `agent.install`. */\n 'agent.install.progress': AgentInstallProgress;\n /** No channel: the router sends it to every client and every other unit. */\n 'sources.changed': SourcesChangedParams;\n /** No channel: the router sends it to every client and every other unit. */\n 'seed.changed': SeedState;\n}\n\n/** Events the router sends a unit. */\nexport interface RouterToUnitEvents {\n 'auth.changed': AuthState;\n 'agent.auth.changed': AgentAuthState;\n 'sources.changed': SourcesChangedParams;\n 'seed.changed': SeedState;\n}\n\nexport type MethodMap<T> = { [K in keyof T]: M<unknown, unknown> };\nexport type ParamsOf<\n T extends MethodMap<T>,\n K extends keyof T\n> = T[K]['params'];\nexport type ResultOf<\n T extends MethodMap<T>,\n K extends keyof T\n> = T[K]['result'];\n\n/** Admin methods are answered only for `client`; `design.claim` / `design.release` only for `unit`. */\nexport const ROLE_ONLY = {\n status: 'client',\n 'units.list': 'client',\n 'update.check': 'client',\n 'update.apply': 'client',\n 'update.status': 'client',\n 'update.channel': 'client',\n handoff: 'client',\n shutdown: 'client',\n 'workspaces.list': 'client',\n 'telemetry.consent.get': 'client',\n 'telemetry.consent.set': 'client',\n 'telemetry.reports.set': 'client',\n 'design.claim': 'unit',\n 'design.release': 'unit',\n 'chat.activate': 'client'\n} as const satisfies Partial<Record<keyof RouterMethods, Role>> &\n Record<keyof AdminMethods, 'client'>;\n\n/** What the model hears when the unit under its channel died: the call may not have run; open the design again. */\n/** A chat id names its unit's and its record's directories, so it is a plain name. */\nexport function isChatId(id: string): boolean {\n return /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/.test(id);\n}\n\nexport function sessionEndedNotice(design?: string): string {\n return `The design session ended unexpectedly, so the last call may not have completed. This connection now works in a new, empty session: ${design !== undefined ? `open ${design} again and preview it` : 'preview it'} before you continue.`;\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  export declare const RELEASE_BUILD = true;
2
- export declare const CHANNEL = "stable";
2
+ export declare const CHANNEL = "next";
3
3
  //# sourceMappingURL=release-build.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-build.generated.d.ts","sourceRoot":"","sources":["../src/release-build.generated.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"release-build.generated.d.ts","sourceRoot":"","sources":["../src/release-build.generated.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,eAAO,MAAM,OAAO,SAAS,CAAC"}
@@ -2,5 +2,5 @@
2
2
  // True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.
3
3
  export const RELEASE_BUILD = true;
4
4
  // The channel it is built for: stable | next | canary.
5
- export const CHANNEL = 'stable';
5
+ export const CHANNEL = 'next';
6
6
  //# sourceMappingURL=release-build.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-build.generated.js","sourceRoot":"","sources":["../src/release-build.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,uDAAuD;AACvD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-release-build.mjs — do not edit.\n// True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.\nexport const RELEASE_BUILD = true;\n// The channel it is built for: stable | next | canary.\nexport const CHANNEL = 'stable';\n"]}
1
+ {"version":3,"file":"release-build.generated.js","sourceRoot":"","sources":["../src/release-build.generated.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,uDAAuD;AACvD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC","sourcesContent":["// AUTO-GENERATED by scripts/generate-release-build.mjs — do not edit.\n// True only when IMGLY_RELEASE_BUILD=true was set at build/publish time.\nexport const RELEASE_BUILD = true;\n// The channel it is built for: stable | next | canary.\nexport const CHANNEL = 'next';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"channels-v2.d.ts","sourceRoot":"","sources":["../../src/router/channels-v2.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,cAAc,EAInB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAGlB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAGf,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAGhE,KAAK,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAC/E,KAAK,YAAY,GAAG,IAAI,CACtB,aAAa,EACb,WAAW,EACX,UAAU,EACV,kBAAkB,CACnB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,8GAA8G;IAC9G,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,iGAAiG;IACjG,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,0GAA0G;IAC1G,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gHAAgH;IAChH,UAAU,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IACvD,4EAA4E;IAC5E,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,iEAAiE;AACjE,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,cAAc,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IAC7C,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,gGAAgG;IAChG,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAoED,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,KAC9B,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;CACpE,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,CAAC,IAAI,EAAE;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAK,OAAO,CAAC,SAAS,CAAC;AACxB,qFAAqF;AACrF,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,EAClC,MAAM,EAAE,MAAM,UAAU,EACxB,KAAK,EAAE,aAAa;AACpB,sGAAsG;AACtG,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;AACrC,sGAAsG;AACtG,UAAU,EAAE,MAAM,OAAO;0BAi7BI,SAAS;2BAl6BzB,SAAS,aACT,MAAM,KAChB,OAAO,CAAC,MAAM,CAAC;;uBAw+BM,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;EAyB9C"}
1
+ {"version":3,"file":"channels-v2.d.ts","sourceRoot":"","sources":["../../src/router/channels-v2.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,cAAc,EAInB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAGlB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAGf,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAGhE,KAAK,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAC/E,KAAK,YAAY,GAAG,IAAI,CACtB,aAAa,EACb,WAAW,EACX,UAAU,EACV,kBAAkB,CACnB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,8GAA8G;IAC9G,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,iGAAiG;IACjG,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,0GAA0G;IAC1G,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gHAAgH;IAChH,UAAU,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IACvD,4EAA4E;IAC5E,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,iEAAiE;AACjE,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,cAAc,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IAC7C,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,gGAAgG;IAChG,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmFD,MAAM,MAAM,aAAa,GAAG;KACzB,CAAC,IAAI,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,KAC9B,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;CACpE,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,CAAC,IAAI,EAAE;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAK,OAAO,CAAC,SAAS,CAAC;AACxB,qFAAqF;AACrF,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,EAClC,MAAM,EAAE,MAAM,UAAU,EACxB,KAAK,EAAE,aAAa;AACpB,sGAAsG;AACtG,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;AACrC,sGAAsG;AACtG,UAAU,EAAE,MAAM,OAAO;0BA86BI,SAAS;2BA/5BzB,SAAS,aACT,MAAM,KAChB,OAAO,CAAC,MAAM,CAAC;;uBAq+BM,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;EAyB9C"}
@@ -12,6 +12,19 @@ import { resolveUnitConfig, readUnitConfig, writeUnitConfig } from '../config/un
12
12
  import { newSessionId, UNIT_ANSWER_MS } from '../units/lifecycle.js';
13
13
  import { draftNotSaved } from './channels.js';
14
14
  import { chatOf, routerClientTools } from './client-tools.js';
15
+ /** What turned a chat's usage or error reports off at the machine (the opt-out or the analytics answer), for its design units. */
16
+ function machineDecided(chat) {
17
+ if (chat === undefined)
18
+ return {};
19
+ const by = chat.usageDecidedBy;
20
+ return {
21
+ ...(!chat.usage &&
22
+ (by === 'consent' || by === 'machine') && { usageDecidedBy: by }),
23
+ ...(!chat.errors &&
24
+ chat.errorsDecidedBy === 'machine' && { errorsDecidedBy: 'machine' }),
25
+ ...(chat.machineOptOut && { machineOptOut: true })
26
+ };
27
+ }
15
28
  /** Every channel-scoped method: forwarded to the channel's unit unread. */
16
29
  const CHANNEL_METHODS = {
17
30
  'tools.list': true,
@@ -541,10 +554,7 @@ handingOff) {
541
554
  telemetry: {
542
555
  usage: allowed('usage'),
543
556
  errors: allowed('errors'),
544
- ...(chatConfig?.telemetry.usage === false &&
545
- chatConfig.telemetry.usageDecidedBy === 'consent' && {
546
- usageDecidedBy: 'consent'
547
- })
557
+ ...machineDecided(chatConfig?.telemetry)
548
558
  }
549
559
  };
550
560
  };