@niscorp/nova 0.3.0 → 0.4.0

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 (226) hide show
  1. package/ACTION_DOCS.md +3 -1
  2. package/ADAPTER.md +19 -1
  3. package/CHANGELOG.md +33 -0
  4. package/DESIGN.md +9 -6
  5. package/I18N_DOCS.md +18 -3
  6. package/REACT_DOCS.md +4 -2
  7. package/README.md +94 -4
  8. package/SHELL_DOCS.md +24 -17
  9. package/TERMINAL_DOCS.md +24 -5
  10. package/dist/adapters/dom/components/index.cjs +2 -4
  11. package/dist/adapters/dom/components/index.cjs.map +1 -1
  12. package/dist/adapters/dom/components/index.d.cts +4 -4
  13. package/dist/adapters/dom/components/index.d.ts +4 -4
  14. package/dist/adapters/dom/components/index.js +1 -3
  15. package/dist/adapters/dom/components/index.js.map +1 -1
  16. package/dist/adapters/dom/index.cjs +14 -14
  17. package/dist/adapters/dom/index.d.cts +4 -4
  18. package/dist/adapters/dom/index.d.ts +4 -4
  19. package/dist/adapters/dom/index.js +12 -12
  20. package/dist/adapters/dom/server.cjs +13 -13
  21. package/dist/adapters/dom/server.cjs.map +1 -1
  22. package/dist/adapters/dom/server.d.cts +4 -4
  23. package/dist/adapters/dom/server.d.ts +4 -4
  24. package/dist/adapters/dom/server.js +12 -12
  25. package/dist/adapters/dom/server.js.map +1 -1
  26. package/dist/adapters/ink/index.js +0 -2
  27. package/dist/adapters/ink/index.js.map +1 -1
  28. package/dist/adapters/react/components/index.cjs +32 -32
  29. package/dist/adapters/react/components/index.d.cts +4 -4
  30. package/dist/adapters/react/components/index.d.ts +4 -4
  31. package/dist/adapters/react/components/index.js +13 -13
  32. package/dist/adapters/react/index.cjs +35 -35
  33. package/dist/adapters/react/index.d.cts +6 -6
  34. package/dist/adapters/react/index.d.ts +6 -6
  35. package/dist/adapters/react/index.js +13 -13
  36. package/dist/adapters/tty/components/index.cjs +2 -4
  37. package/dist/adapters/tty/components/index.cjs.map +1 -1
  38. package/dist/adapters/tty/components/index.d.cts +4 -4
  39. package/dist/adapters/tty/components/index.d.ts +4 -4
  40. package/dist/adapters/tty/components/index.js +1 -3
  41. package/dist/adapters/tty/components/index.js.map +1 -1
  42. package/dist/adapters/tty/index.cjs +12 -12
  43. package/dist/adapters/tty/index.cjs.map +1 -1
  44. package/dist/adapters/tty/index.d.cts +4 -4
  45. package/dist/adapters/tty/index.d.ts +4 -4
  46. package/dist/adapters/tty/index.js +10 -10
  47. package/dist/adapters/tty/index.js.map +1 -1
  48. package/dist/adapters/vue/components/index.cjs +32 -32
  49. package/dist/adapters/vue/components/index.d.cts +12 -12
  50. package/dist/adapters/vue/components/index.d.ts +12 -12
  51. package/dist/adapters/vue/components/index.js +13 -13
  52. package/dist/adapters/vue/index.cjs +41 -41
  53. package/dist/adapters/vue/index.cjs.map +1 -1
  54. package/dist/adapters/vue/index.d.cts +6 -6
  55. package/dist/adapters/vue/index.d.ts +6 -6
  56. package/dist/adapters/vue/index.js +14 -14
  57. package/dist/adapters/vue/index.js.map +1 -1
  58. package/dist/agent/index.cjs +6 -6
  59. package/dist/agent/index.cjs.map +1 -1
  60. package/dist/agent/index.d.cts +2 -2
  61. package/dist/agent/index.d.ts +2 -2
  62. package/dist/agent/index.js +3 -3
  63. package/dist/agent/index.js.map +1 -1
  64. package/dist/{chunk-QLFHYHJ2.js → chunk-2HWYS6OJ.js} +6 -6
  65. package/dist/chunk-2HWYS6OJ.js.map +1 -0
  66. package/dist/{chunk-7MATRNZZ.js → chunk-2SEZAI3I.js} +6 -6
  67. package/dist/chunk-2SEZAI3I.js.map +1 -0
  68. package/dist/{chunk-OE527MXF.cjs → chunk-3XFQI5P2.cjs} +2 -2
  69. package/dist/chunk-3XFQI5P2.cjs.map +1 -0
  70. package/dist/{chunk-P5SJ3QXJ.js → chunk-3YS2FBF5.js} +54 -68
  71. package/dist/chunk-3YS2FBF5.js.map +1 -0
  72. package/dist/{chunk-XQTI4Q4I.js → chunk-A4GK3PLP.js} +4 -4
  73. package/dist/chunk-A4GK3PLP.js.map +1 -0
  74. package/dist/{chunk-PMKWYOOX.cjs → chunk-BXUEWV7V.cjs} +2 -2
  75. package/dist/chunk-BXUEWV7V.cjs.map +1 -0
  76. package/dist/{chunk-RFBIGRCI.js → chunk-C63CBYD5.js} +3 -3
  77. package/dist/chunk-C63CBYD5.js.map +1 -0
  78. package/dist/{chunk-FSUMCJAR.cjs → chunk-CQZH3L3W.cjs} +39 -39
  79. package/dist/chunk-CQZH3L3W.cjs.map +1 -0
  80. package/dist/{chunk-RB4OMSPA.js → chunk-D42FJUQA.js} +7 -7
  81. package/dist/chunk-D42FJUQA.js.map +1 -0
  82. package/dist/{chunk-UGG7MCX4.cjs → chunk-DC5HONDE.cjs} +2 -2
  83. package/dist/chunk-DC5HONDE.cjs.map +1 -0
  84. package/dist/{chunk-HYFNOF7Y.cjs → chunk-EZ3AJRQ7.cjs} +8 -8
  85. package/dist/chunk-EZ3AJRQ7.cjs.map +1 -0
  86. package/dist/{chunk-ZYTWQZZC.cjs → chunk-FG6IKUHA.cjs} +26 -26
  87. package/dist/chunk-FG6IKUHA.cjs.map +1 -0
  88. package/dist/{chunk-DIFE573X.js → chunk-G4OQ4PEO.js} +6 -6
  89. package/dist/chunk-G4OQ4PEO.js.map +1 -0
  90. package/dist/{chunk-RBU5PHN4.js → chunk-GQVJ5UAS.js} +2 -2
  91. package/dist/chunk-GQVJ5UAS.js.map +1 -0
  92. package/dist/{chunk-KW34ZKF5.cjs → chunk-ITGR7P2B.cjs} +2 -2
  93. package/dist/chunk-ITGR7P2B.cjs.map +1 -0
  94. package/dist/{chunk-JI7ZRESP.js → chunk-JKULAG53.js} +2 -2
  95. package/dist/chunk-JKULAG53.js.map +1 -0
  96. package/dist/{chunk-PBPUSZIQ.cjs → chunk-K54CT3QN.cjs} +50 -69
  97. package/dist/chunk-K54CT3QN.cjs.map +1 -0
  98. package/dist/{chunk-7TS3YVQR.js → chunk-M2ZZUSH3.js} +6 -7
  99. package/dist/chunk-M2ZZUSH3.js.map +1 -0
  100. package/dist/{chunk-GV7UC3SS.cjs → chunk-MEZCO7ND.cjs} +2 -2
  101. package/dist/chunk-MEZCO7ND.cjs.map +1 -0
  102. package/dist/{chunk-D4PUWBN6.cjs → chunk-NBXZ3RAC.cjs} +2 -2
  103. package/dist/chunk-NBXZ3RAC.cjs.map +1 -0
  104. package/dist/{chunk-EG45GQOE.js → chunk-O2N4BVLL.js} +5 -5
  105. package/dist/chunk-O2N4BVLL.js.map +1 -0
  106. package/dist/{chunk-L5223LLX.js → chunk-OBFFZ23H.js} +2 -2
  107. package/dist/chunk-OBFFZ23H.js.map +1 -0
  108. package/dist/{chunk-WGZZKCJQ.cjs → chunk-QHX3VA55.cjs} +7 -7
  109. package/dist/chunk-QHX3VA55.cjs.map +1 -0
  110. package/dist/{chunk-PNQY6OFB.cjs → chunk-QTJ4ZQRM.cjs} +20 -20
  111. package/dist/chunk-QTJ4ZQRM.cjs.map +1 -0
  112. package/dist/{chunk-KOYRJXTI.cjs → chunk-RVU6YEHO.cjs} +10 -11
  113. package/dist/chunk-RVU6YEHO.cjs.map +1 -0
  114. package/dist/{chunk-V4BPFFFV.js → chunk-SCXYAXMO.js} +3 -3
  115. package/dist/chunk-SCXYAXMO.js.map +1 -0
  116. package/dist/{chunk-2MNLEL45.js → chunk-SVWDKXSH.js} +2 -2
  117. package/dist/chunk-SVWDKXSH.js.map +1 -0
  118. package/dist/{chunk-X5JTZ5LW.js → chunk-UXFQZX6O.js} +3 -3
  119. package/dist/chunk-UXFQZX6O.js.map +1 -0
  120. package/dist/{chunk-Z7CS43ZT.cjs → chunk-WQJZMXS5.cjs} +28 -28
  121. package/dist/chunk-WQJZMXS5.cjs.map +1 -0
  122. package/dist/{chunk-ECFWPZGL.cjs → chunk-X77B4ZKQ.cjs} +129 -143
  123. package/dist/chunk-X77B4ZKQ.cjs.map +1 -0
  124. package/dist/{chunk-AGEAMUQR.cjs → chunk-XHDQIQAG.cjs} +13 -13
  125. package/dist/chunk-XHDQIQAG.cjs.map +1 -0
  126. package/dist/{chunk-OE4E6IBD.js → chunk-Y3UKAJJX.js} +2 -2
  127. package/dist/chunk-Y3UKAJJX.js.map +1 -0
  128. package/dist/{chunk-XUSKGJRI.js → chunk-YV2G37TJ.js} +8 -27
  129. package/dist/chunk-YV2G37TJ.js.map +1 -0
  130. package/dist/{chunk-5YQIAS4V.cjs → chunk-ZR54IVVS.cjs} +20 -20
  131. package/dist/chunk-ZR54IVVS.cjs.map +1 -0
  132. package/dist/{chunk-M3UFIUXK.cjs → chunk-ZVQKCDUG.cjs} +7 -7
  133. package/dist/chunk-ZVQKCDUG.cjs.map +1 -0
  134. package/dist/{chunk-OGD5CCMZ.js → chunk-ZZRQAH5Z.js} +2 -2
  135. package/dist/chunk-ZZRQAH5Z.js.map +1 -0
  136. package/dist/devtools/index.cjs +12 -42
  137. package/dist/devtools/index.cjs.map +1 -1
  138. package/dist/devtools/index.d.cts +4 -4
  139. package/dist/devtools/index.d.ts +4 -4
  140. package/dist/devtools/index.js +9 -39
  141. package/dist/devtools/index.js.map +1 -1
  142. package/dist/document/index.cjs +16 -16
  143. package/dist/document/index.d.cts +6 -6
  144. package/dist/document/index.d.ts +6 -6
  145. package/dist/document/index.js +3 -3
  146. package/dist/{effects-CndX9K7D.d.cts → effects-DkBBrxVj.d.cts} +0 -2
  147. package/dist/{effects-CndX9K7D.d.ts → effects-DkBBrxVj.d.ts} +0 -2
  148. package/dist/{endpoints-CD-6Jl-H.d.ts → endpoints-DD6VsLv9.d.ts} +1 -1
  149. package/dist/{endpoints-Dem-EdRx.d.cts → endpoints-fqx9Vmf6.d.cts} +1 -1
  150. package/dist/examples/index.cjs +4 -4
  151. package/dist/examples/index.cjs.map +1 -1
  152. package/dist/examples/index.d.cts +4 -4
  153. package/dist/examples/index.d.ts +4 -4
  154. package/dist/examples/index.js +3 -3
  155. package/dist/examples/index.js.map +1 -1
  156. package/dist/{head-DRpbbj-l.d.ts → head-BvqHLqlL.d.ts} +2 -2
  157. package/dist/{head-CAzfTnpV.d.cts → head-CB1fcRjc.d.cts} +2 -2
  158. package/dist/i18n/index.cjs +13 -13
  159. package/dist/i18n/index.d.cts +4 -6
  160. package/dist/i18n/index.d.ts +4 -6
  161. package/dist/i18n/index.js +3 -3
  162. package/dist/{index-CNfzSBe2.d.ts → index-BjQX8XZl.d.ts} +1 -1
  163. package/dist/{index-caZoXSwr.d.cts → index-BoPH5aSd.d.cts} +1 -1
  164. package/dist/index.cjs +91 -91
  165. package/dist/index.d.cts +11 -11
  166. package/dist/index.d.ts +11 -11
  167. package/dist/index.js +11 -11
  168. package/dist/migrations/index.cjs +8 -9
  169. package/dist/migrations/index.cjs.map +1 -1
  170. package/dist/migrations/index.d.cts +1 -1
  171. package/dist/migrations/index.d.ts +1 -1
  172. package/dist/migrations/index.js +5 -6
  173. package/dist/migrations/index.js.map +1 -1
  174. package/dist/{palette-CIpPH90W.d.ts → palette-BZujb2rm.d.ts} +1 -1
  175. package/dist/{palette-CvwZZCkx.d.cts → palette-CCxWSi3C.d.cts} +1 -1
  176. package/dist/reflect/index.cjs +27 -27
  177. package/dist/reflect/index.d.cts +5 -5
  178. package/dist/reflect/index.d.ts +5 -5
  179. package/dist/reflect/index.js +9 -9
  180. package/dist/{types-qkzTfSye.d.cts → types-BTha1ZLR.d.cts} +4 -5
  181. package/dist/{types-D23TRvqe.d.ts → types-BxpSKUxn.d.ts} +4 -5
  182. package/dist/{types-qnKMx0_V.d.ts → types-CJC8mnzl.d.ts} +0 -1
  183. package/dist/{types-j290XhCn.d.cts → types-CR56luN7.d.cts} +0 -1
  184. package/dist/{types-DsWNYc7R.d.cts → types-D0x56Ya-.d.cts} +1 -1
  185. package/dist/{types-C9734_lJ.d.cts → types-DzB3TAQj.d.cts} +1 -1
  186. package/dist/{types-BWc-olbY.d.ts → types-LXw2RJfH.d.ts} +1 -1
  187. package/dist/{types-BSKx5MXW.d.ts → types-pbBIUNxw.d.ts} +1 -1
  188. package/package.json +7 -7
  189. package/dist/chunk-2MNLEL45.js.map +0 -1
  190. package/dist/chunk-5YQIAS4V.cjs.map +0 -1
  191. package/dist/chunk-7MATRNZZ.js.map +0 -1
  192. package/dist/chunk-7TS3YVQR.js.map +0 -1
  193. package/dist/chunk-AGEAMUQR.cjs.map +0 -1
  194. package/dist/chunk-D4PUWBN6.cjs.map +0 -1
  195. package/dist/chunk-DIFE573X.js.map +0 -1
  196. package/dist/chunk-ECFWPZGL.cjs.map +0 -1
  197. package/dist/chunk-EG45GQOE.js.map +0 -1
  198. package/dist/chunk-FSUMCJAR.cjs.map +0 -1
  199. package/dist/chunk-GV7UC3SS.cjs.map +0 -1
  200. package/dist/chunk-HYFNOF7Y.cjs.map +0 -1
  201. package/dist/chunk-JI7ZRESP.js.map +0 -1
  202. package/dist/chunk-KOYRJXTI.cjs.map +0 -1
  203. package/dist/chunk-KW34ZKF5.cjs.map +0 -1
  204. package/dist/chunk-L5223LLX.js.map +0 -1
  205. package/dist/chunk-M3UFIUXK.cjs.map +0 -1
  206. package/dist/chunk-OE4E6IBD.js.map +0 -1
  207. package/dist/chunk-OE527MXF.cjs.map +0 -1
  208. package/dist/chunk-OGD5CCMZ.js.map +0 -1
  209. package/dist/chunk-P5SJ3QXJ.js.map +0 -1
  210. package/dist/chunk-PBPUSZIQ.cjs.map +0 -1
  211. package/dist/chunk-PMKWYOOX.cjs.map +0 -1
  212. package/dist/chunk-PNQY6OFB.cjs.map +0 -1
  213. package/dist/chunk-QLFHYHJ2.js.map +0 -1
  214. package/dist/chunk-RB4OMSPA.js.map +0 -1
  215. package/dist/chunk-RBU5PHN4.js.map +0 -1
  216. package/dist/chunk-RFBIGRCI.js.map +0 -1
  217. package/dist/chunk-UGG7MCX4.cjs.map +0 -1
  218. package/dist/chunk-V4BPFFFV.js.map +0 -1
  219. package/dist/chunk-WGZZKCJQ.cjs.map +0 -1
  220. package/dist/chunk-X5JTZ5LW.js.map +0 -1
  221. package/dist/chunk-XQTI4Q4I.js.map +0 -1
  222. package/dist/chunk-XUSKGJRI.js.map +0 -1
  223. package/dist/chunk-Z7CS43ZT.cjs.map +0 -1
  224. package/dist/chunk-ZYTWQZZC.cjs.map +0 -1
  225. package/dist/{primitive-props-CGoJvmcH.d.cts → primitive-props-Cl5jiC8g.d.cts} +5 -5
  226. package/dist/{primitive-props-CGoJvmcH.d.ts → primitive-props-Cl5jiC8g.d.ts} +5 -5
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkPNQY6OFB_cjs = require('./chunk-PNQY6OFB.cjs');
4
- var chunkPBPUSZIQ_cjs = require('./chunk-PBPUSZIQ.cjs');
5
- var chunkFSUMCJAR_cjs = require('./chunk-FSUMCJAR.cjs');
6
- var chunkKW34ZKF5_cjs = require('./chunk-KW34ZKF5.cjs');
7
- var chunkOE527MXF_cjs = require('./chunk-OE527MXF.cjs');
3
+ var chunkQTJ4ZQRM_cjs = require('./chunk-QTJ4ZQRM.cjs');
4
+ var chunkK54CT3QN_cjs = require('./chunk-K54CT3QN.cjs');
5
+ var chunkCQZH3L3W_cjs = require('./chunk-CQZH3L3W.cjs');
6
+ var chunkITGR7P2B_cjs = require('./chunk-ITGR7P2B.cjs');
7
+ var chunk3XFQI5P2_cjs = require('./chunk-3XFQI5P2.cjs');
8
8
  var zod = require('zod');
9
9
  var strata = require('@niscorp/strata');
10
10
 
@@ -170,7 +170,7 @@ var reconcileCanvas = (shell, canvasId, desired, options) => {
170
170
  const before = runtime?.getData() ?? {};
171
171
  if (runtime === void 0 || Object.keys(input).length === 0 || !differs(before, input)) continue;
172
172
  const definition = definitionOf?.(entry.actionId);
173
- const reAims = definition !== void 0 && Object.keys(input).some((key) => chunkPBPUSZIQ_cjs.mountInputKeys(definition).has(key));
173
+ const reAims = definition !== void 0 && Object.keys(input).some((key) => chunkK54CT3QN_cjs.mountInputKeys(definition).has(key));
174
174
  if (!reAims) {
175
175
  runtime.setData({ ...before, ...input });
176
176
  changed = true;
@@ -199,10 +199,7 @@ var createJournal = (limit) => {
199
199
  entries.push({ canvas, stack });
200
200
  if (entries.length > limit) entries.shift();
201
201
  },
202
- // A pop somebody performed themselves IS a back. Without this the journal
203
- // would still hold the entry that pop just satisfied, and the next press of
204
- // the back button would spend itself restoring a position already on screen
205
- // — the double-tap that makes a back button feel broken.
202
+ // A pop somebody performed themselves is a back.
206
203
  consume: (canvas) => {
207
204
  if (off()) return;
208
205
  for (let i = entries.length - 1; i >= 0; i -= 1) {
@@ -212,9 +209,8 @@ var createJournal = (limit) => {
212
209
  }
213
210
  },
214
211
  take: () => entries.pop(),
215
- // REVOCATION REACHES THE JOURNAL OR IT IS NOT REVOCATION. An entry naming
216
- // an action this shell no longer serves would hand it back on the way out —
217
- // a grant dropped at the front door and returned through the back one.
212
+ // An entry naming an action this shell no longer serves would hand a
213
+ // revoked action back through `back`.
218
214
  forgetAction: (actionId) => {
219
215
  for (let i = entries.length - 1; i >= 0; i -= 1) {
220
216
  if (entries[i]?.stack.some((frame) => frame.action === actionId) === true) entries.splice(i, 1);
@@ -316,7 +312,7 @@ var resolveHeaders = (headers, chain) => {
316
312
  if (headers === void 0) return void 0;
317
313
  const out = {};
318
314
  for (const key of Object.keys(headers)) {
319
- const value = chunkPBPUSZIQ_cjs.resolve(headers[key], chain);
315
+ const value = chunkK54CT3QN_cjs.resolve(headers[key], chain);
320
316
  out[key] = typeof value === "string" ? value : String(value ?? "");
321
317
  }
322
318
  return out;
@@ -356,8 +352,8 @@ var callEndpoint = async (options) => {
356
352
  }
357
353
  };
358
354
  var callHttpEndpoint = async (endpoint, { data, fetch: fetchFn = defaultFetch, transform, signal }) => {
359
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(data);
360
- const resolvedUrl = chunkPBPUSZIQ_cjs.resolve(endpoint.url, chain);
355
+ const chain = chunkK54CT3QN_cjs.createScopeChain(data);
356
+ const resolvedUrl = chunkK54CT3QN_cjs.resolve(endpoint.url, chain);
361
357
  const url = typeof resolvedUrl === "string" ? resolvedUrl : String(resolvedUrl ?? "");
362
358
  const headers = resolveHeaders(endpoint.headers, chain);
363
359
  let body;
@@ -388,7 +384,7 @@ var callHttpEndpoint = async (endpoint, { data, fetch: fetchFn = defaultFetch, t
388
384
  }
389
385
  if (!response.ok) {
390
386
  const failed = await tryParseJson(response);
391
- const message = chunkKW34ZKF5_cjs.hasKey(failed, "message") && typeof failed["message"] === "string" ? failed["message"] : `HTTP ${response.status}`;
387
+ const message = chunkITGR7P2B_cjs.hasKey(failed, "message") && typeof failed["message"] === "string" ? failed["message"] : `HTTP ${response.status}`;
392
388
  return { ok: false, error: { status: response.status, message, data: failed } };
393
389
  }
394
390
  if (response.status === 204 || response.status === 205) {
@@ -524,19 +520,19 @@ var noopOnError = (_error) => {
524
520
  var resolveMutationValues = (list, chain, extras) => {
525
521
  return list.map((m) => {
526
522
  if ("set" in m && "value" in m) {
527
- return { ...m, value: chunkPBPUSZIQ_cjs.resolve(m.value, chain, extras) };
523
+ return { ...m, value: chunkK54CT3QN_cjs.resolve(m.value, chain, extras) };
528
524
  }
529
525
  if ("push" in m && typeof m.push === "string" && "value" in m) {
530
- return { ...m, value: chunkPBPUSZIQ_cjs.resolve(m.value, chain, extras) };
526
+ return { ...m, value: chunkK54CT3QN_cjs.resolve(m.value, chain, extras) };
531
527
  }
532
528
  if ("removeAt" in m && typeof m.index === "string") {
533
- return { ...m, index: Number(chunkPBPUSZIQ_cjs.resolve(m.index, chain, extras)) };
529
+ return { ...m, index: Number(chunkK54CT3QN_cjs.resolve(m.index, chain, extras)) };
534
530
  }
535
531
  if ("move" in m) {
536
532
  return {
537
533
  ...m,
538
- from: typeof m.from === "string" ? Number(chunkPBPUSZIQ_cjs.resolve(m.from, chain, extras)) : m.from,
539
- to: typeof m.to === "string" ? Number(chunkPBPUSZIQ_cjs.resolve(m.to, chain, extras)) : m.to
534
+ from: typeof m.from === "string" ? Number(chunkK54CT3QN_cjs.resolve(m.from, chain, extras)) : m.from,
535
+ to: typeof m.to === "string" ? Number(chunkK54CT3QN_cjs.resolve(m.to, chain, extras)) : m.to
540
536
  };
541
537
  }
542
538
  return m;
@@ -545,8 +541,8 @@ var resolveMutationValues = (list, chain, extras) => {
545
541
  var writeTarget = (dataStore, target, value) => {
546
542
  if (target === void 0) return;
547
543
  dataStore.update((curr) => {
548
- const next = chunkFSUMCJAR_cjs.setPath(curr, target, value);
549
- return chunkKW34ZKF5_cjs.isObject(next) ? next : curr;
544
+ const next = chunkCQZH3L3W_cjs.setPath(curr, target, value);
545
+ return chunkITGR7P2B_cjs.isObject(next) ? next : curr;
550
546
  });
551
547
  };
552
548
  var raiseUnknown = async (message, onError, ctx, strictError) => {
@@ -559,7 +555,7 @@ var raiseUnknown = async (message, onError, ctx, strictError) => {
559
555
  return;
560
556
  }
561
557
  if (ctx.lifecycleHook !== void 0) {
562
- throw new chunkFSUMCJAR_cjs.LifecycleError(message, { hook: ctx.lifecycleHook });
558
+ throw new chunkCQZH3L3W_cjs.LifecycleError(message, { hook: ctx.lifecycleHook });
563
559
  }
564
560
  if (ctx.strict && strictError !== void 0) throw strictError;
565
561
  };
@@ -571,11 +567,11 @@ var runCall = async (callName, onSuccess, onError, ctx) => {
571
567
  }
572
568
  let endpoint = raw;
573
569
  if ("fn" in raw) {
574
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(ctx.dataStore.get());
575
- const fn = String(chunkPBPUSZIQ_cjs.resolve(raw.fn, chain, ctx.extras) ?? "");
570
+ const chain = chunkK54CT3QN_cjs.createScopeChain(ctx.dataStore.get());
571
+ const fn = String(chunkK54CT3QN_cjs.resolve(raw.fn, chain, ctx.extras) ?? "");
576
572
  endpoint = { ...raw, fn };
577
573
  if (ctx.functions[fn] === void 0) {
578
- await raiseUnknown(`unknown function: ${fn}`, onError, ctx, new chunkFSUMCJAR_cjs.UnknownFunctionError(fn));
574
+ await raiseUnknown(`unknown function: ${fn}`, onError, ctx, new chunkCQZH3L3W_cjs.UnknownFunctionError(fn));
579
575
  return;
580
576
  }
581
577
  }
@@ -619,7 +615,7 @@ var runCall = async (callName, onSuccess, onError, ctx) => {
619
615
  return;
620
616
  }
621
617
  if (ctx.lifecycleHook !== void 0) {
622
- throw new chunkFSUMCJAR_cjs.LifecycleError(`endpoint '${callName}' failed: ${result.error.message}`, {
618
+ throw new chunkCQZH3L3W_cjs.LifecycleError(`endpoint '${callName}' failed: ${result.error.message}`, {
623
619
  hook: ctx.lifecycleHook
624
620
  });
625
621
  }
@@ -630,14 +626,14 @@ var navigate = (effect, ctx) => {
630
626
  withCause(ctx.cause, () => onNavigate(effect));
631
627
  };
632
628
  var resolveInputMap = (input, ctx) => {
633
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(ctx.dataStore.get());
629
+ const chain = chunkK54CT3QN_cjs.createScopeChain(ctx.dataStore.get());
634
630
  return Object.fromEntries(
635
- Object.entries(input).map(([key, value]) => [key, chunkPBPUSZIQ_cjs.resolve(value, chain, ctx.extras)])
631
+ Object.entries(input).map(([key, value]) => [key, chunkK54CT3QN_cjs.resolve(value, chain, ctx.extras)])
636
632
  );
637
633
  };
638
634
  var resolveNavTarget = (nav, ctx) => {
639
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(ctx.dataStore.get());
640
- const out = { ...nav, action: String(chunkPBPUSZIQ_cjs.resolve(nav.action, chain, ctx.extras) ?? "") };
635
+ const chain = chunkK54CT3QN_cjs.createScopeChain(ctx.dataStore.get());
636
+ const out = { ...nav, action: String(chunkK54CT3QN_cjs.resolve(nav.action, chain, ctx.extras) ?? "") };
641
637
  if (nav.input !== void 0) out.input = resolveInputMap(nav.input, ctx);
642
638
  return out;
643
639
  };
@@ -646,24 +642,24 @@ var resolveNavInput = (effect, ctx) => {
646
642
  if ("replace" in effect) return { replace: resolveNavTarget(effect.replace, ctx) };
647
643
  if ("resetTo" in effect) return { resetTo: resolveNavTarget(effect.resetTo, ctx) };
648
644
  if ("popTo" in effect) {
649
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(ctx.dataStore.get());
650
- return { popTo: { ...effect.popTo, instance: String(chunkPBPUSZIQ_cjs.resolve(effect.popTo.instance, chain, ctx.extras) ?? "") } };
645
+ const chain = chunkK54CT3QN_cjs.createScopeChain(ctx.dataStore.get());
646
+ return { popTo: { ...effect.popTo, instance: String(chunkK54CT3QN_cjs.resolve(effect.popTo.instance, chain, ctx.extras) ?? "") } };
651
647
  }
652
648
  if ("removeInstance" in effect) {
653
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(ctx.dataStore.get());
654
- return { removeInstance: { ...effect.removeInstance, instance: String(chunkPBPUSZIQ_cjs.resolve(effect.removeInstance.instance, chain, ctx.extras) ?? "") } };
649
+ const chain = chunkK54CT3QN_cjs.createScopeChain(ctx.dataStore.get());
650
+ return { removeInstance: { ...effect.removeInstance, instance: String(chunkK54CT3QN_cjs.resolve(effect.removeInstance.instance, chain, ctx.extras) ?? "") } };
655
651
  }
656
652
  return effect;
657
653
  };
658
654
  var resolveReconcile = (step, ctx) => {
659
655
  const { to, action, input, ...rest } = step.reconcile;
660
- const rows = chunkPBPUSZIQ_cjs.resolve(to, chunkPBPUSZIQ_cjs.createScopeChain(ctx.dataStore.get()), ctx.extras);
656
+ const rows = chunkK54CT3QN_cjs.resolve(to, chunkK54CT3QN_cjs.createScopeChain(ctx.dataStore.get()), ctx.extras);
661
657
  const desired = (Array.isArray(rows) ? rows : []).flatMap((row) => {
662
- if (!chunkKW34ZKF5_cjs.isObject(row)) return [];
658
+ if (!chunkITGR7P2B_cjs.isObject(row)) return [];
663
659
  const actionId = row[action];
664
660
  if (typeof actionId !== "string" || actionId === "") return [];
665
661
  const seeded = input === void 0 ? void 0 : row[input];
666
- return [chunkKW34ZKF5_cjs.isObject(seeded) ? { actionId, input: seeded } : { actionId }];
662
+ return [chunkITGR7P2B_cjs.isObject(seeded) ? { actionId, input: seeded } : { actionId }];
667
663
  });
668
664
  return { reconcile: { ...rest, desired } };
669
665
  };
@@ -673,10 +669,10 @@ var executeSteps = async (steps, ctx) => {
673
669
  if (buffer.length === 0) return;
674
670
  const list = buffer;
675
671
  buffer = [];
676
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(ctx.dataStore.get());
672
+ const chain = chunkK54CT3QN_cjs.createScopeChain(ctx.dataStore.get());
677
673
  const resolved = resolveMutationValues(list, chain, ctx.extras);
678
674
  ctx.dataStore.update(
679
- (curr) => chunkFSUMCJAR_cjs.applyMutations(curr, resolved, { ...ctx.initial === void 0 ? {} : { initial: ctx.initial }, strict: ctx.strict })
675
+ (curr) => chunkCQZH3L3W_cjs.applyMutations(curr, resolved, { ...ctx.initial === void 0 ? {} : { initial: ctx.initial }, strict: ctx.strict })
680
676
  );
681
677
  };
682
678
  for (const step of steps) {
@@ -684,7 +680,7 @@ var executeSteps = async (steps, ctx) => {
684
680
  buffer = [];
685
681
  return;
686
682
  }
687
- if (chunkPBPUSZIQ_cjs.isMutationStep(step)) {
683
+ if (chunkK54CT3QN_cjs.isMutationStep(step)) {
688
684
  buffer.push(step);
689
685
  continue;
690
686
  }
@@ -696,10 +692,10 @@ var executeSteps = async (steps, ctx) => {
696
692
  }
697
693
  if ("emit" in step) {
698
694
  const data = ctx.dataStore.get();
699
- const chain = chunkPBPUSZIQ_cjs.createScopeChain(data);
700
- const resolvedChannel = chunkPBPUSZIQ_cjs.resolve(step.emit.channel, chain, ctx.extras);
695
+ const chain = chunkK54CT3QN_cjs.createScopeChain(data);
696
+ const resolvedChannel = chunkK54CT3QN_cjs.resolve(step.emit.channel, chain, ctx.extras);
701
697
  const channel = typeof resolvedChannel === "string" ? resolvedChannel : String(resolvedChannel ?? "");
702
- const payload = step.emit.payload === void 0 ? void 0 : chunkPBPUSZIQ_cjs.resolve(step.emit.payload, chain, ctx.extras);
698
+ const payload = step.emit.payload === void 0 ? void 0 : chunkK54CT3QN_cjs.resolve(step.emit.payload, chain, ctx.extras);
703
699
  const { messageBus, cause } = ctx;
704
700
  const delivered = new Promise((resolve2) => {
705
701
  nextTask(() => {
@@ -770,7 +766,7 @@ var runLifecycleHook = async (hook, definition, buildContext) => {
770
766
  } catch (err) {
771
767
  if (!ctx.strict) {
772
768
  ctx.onError(
773
- err instanceof chunkFSUMCJAR_cjs.LifecycleError ? err : new chunkFSUMCJAR_cjs.LifecycleError(
769
+ err instanceof chunkCQZH3L3W_cjs.LifecycleError ? err : new chunkCQZH3L3W_cjs.LifecycleError(
774
770
  err instanceof Error ? err.message : String(err),
775
771
  { hook },
776
772
  { cause: err }
@@ -778,8 +774,8 @@ var runLifecycleHook = async (hook, definition, buildContext) => {
778
774
  );
779
775
  return;
780
776
  }
781
- if (err instanceof chunkFSUMCJAR_cjs.LifecycleError) throw err;
782
- throw new chunkFSUMCJAR_cjs.LifecycleError(
777
+ if (err instanceof chunkCQZH3L3W_cjs.LifecycleError) throw err;
778
+ throw new chunkCQZH3L3W_cjs.LifecycleError(
783
779
  err instanceof Error ? err.message : String(err),
784
780
  { hook },
785
781
  { cause: err }
@@ -811,8 +807,8 @@ var isLayoutNode = (value) => {
811
807
  if (value === null) return true;
812
808
  const t = typeof value;
813
809
  if (t === "string" || t === "number" || t === "boolean") return true;
814
- if (chunkKW34ZKF5_cjs.isArray(value)) return true;
815
- if (chunkKW34ZKF5_cjs.isObject(value)) return true;
810
+ if (chunkITGR7P2B_cjs.isArray(value)) return true;
811
+ if (chunkITGR7P2B_cjs.isObject(value)) return true;
816
812
  return false;
817
813
  };
818
814
  var renderRuntime = (definition, dataStore, ctx) => {
@@ -821,27 +817,27 @@ var renderRuntime = (definition, dataStore, ctx) => {
821
817
  if (typeof layout === "string") {
822
818
  const target = ctx.store.get(layout);
823
819
  if (target === void 0) return [];
824
- return chunkPBPUSZIQ_cjs.renderLayoutFromStore(target, dataStore, ctx);
820
+ return chunkK54CT3QN_cjs.renderLayoutFromStore(target, dataStore, ctx);
825
821
  }
826
822
  if (!isLayoutNode(layout)) return [];
827
- return chunkPBPUSZIQ_cjs.renderLayoutFromStore(layout, dataStore, ctx);
823
+ return chunkK54CT3QN_cjs.renderLayoutFromStore(layout, dataStore, ctx);
828
824
  };
829
825
 
830
826
  // src/action/runtime/triggers.ts
831
827
  var eventRef = (event) => {
832
- if (!chunkKW34ZKF5_cjs.hasKey(event, "ref")) return void 0;
828
+ if (!chunkITGR7P2B_cjs.hasKey(event, "ref")) return void 0;
833
829
  const candidate = event["ref"];
834
830
  return typeof candidate === "string" ? candidate : void 0;
835
831
  };
836
832
  var eventKey = (event) => {
837
- if (!chunkKW34ZKF5_cjs.hasKey(event, "key")) return void 0;
833
+ if (!chunkITGR7P2B_cjs.hasKey(event, "key")) return void 0;
838
834
  const candidate = event["key"];
839
835
  return typeof candidate === "string" ? candidate : void 0;
840
836
  };
841
837
  var toNovaError = (err) => {
842
- if (err instanceof chunkFSUMCJAR_cjs.NovaError) return err;
838
+ if (err instanceof chunkCQZH3L3W_cjs.NovaError) return err;
843
839
  const message = err instanceof Error ? err.message : String(err);
844
- return new chunkFSUMCJAR_cjs.NovaError(chunkFSUMCJAR_cjs.ErrorCodes.lifecycle, message, {}, { cause: err });
840
+ return new chunkCQZH3L3W_cjs.NovaError(chunkCQZH3L3W_cjs.ErrorCodes.lifecycle, message, {}, { cause: err });
845
841
  };
846
842
  var fireTrigger = (trigger, buildContext, event, cause) => {
847
843
  const built = buildContext();
@@ -849,7 +845,7 @@ var fireTrigger = (trigger, buildContext, event, cause) => {
849
845
  if (built.suspended === true) return;
850
846
  if (isRunaway(cause)) {
851
847
  const what = trigger.message === void 0 ? "A trigger" : `The trigger on "${trigger.message}"`;
852
- built.onError(new chunkFSUMCJAR_cjs.NovaError(chunkFSUMCJAR_cjs.ErrorCodes.runaway, runawayMessage(cause, what), { channel: trigger.message, depth: cause.depth, hops: cause.root.hops }));
848
+ built.onError(new chunkCQZH3L3W_cjs.NovaError(chunkCQZH3L3W_cjs.ErrorCodes.runaway, runawayMessage(cause, what), { channel: trigger.message, depth: cause.depth, hops: cause.root.hops }));
853
849
  return;
854
850
  }
855
851
  const base = { ...built, cause };
@@ -860,7 +856,7 @@ var fireTrigger = (trigger, buildContext, event, cause) => {
860
856
  ctx.onChain?.(chain);
861
857
  };
862
858
  var eventOrigin = (event) => {
863
- if (!chunkKW34ZKF5_cjs.hasKey(event, "origin")) return void 0;
859
+ if (!chunkITGR7P2B_cjs.hasKey(event, "origin")) return void 0;
864
860
  const candidate = event["origin"];
865
861
  return typeof candidate === "string" ? candidate : void 0;
866
862
  };
@@ -915,7 +911,7 @@ var createActionRuntime = (config) => {
915
911
  const statusSubscribers = [];
916
912
  let triggerHandle;
917
913
  let modelWriteOff;
918
- const modelListeners = /* @__PURE__ */ new Map();
914
+ const modelPaths = /* @__PURE__ */ new Map();
919
915
  dataStore.subscribe((next) => {
920
916
  instance.data = next;
921
917
  });
@@ -977,7 +973,7 @@ var createActionRuntime = (config) => {
977
973
  reloadAgain = void 0;
978
974
  const hop = nextCause(next.cause);
979
975
  if (isRunaway(hop)) {
980
- onError(new chunkFSUMCJAR_cjs.NovaError(chunkFSUMCJAR_cjs.ErrorCodes.runaway, runawayMessage(hop, `Reloading "${definition.id}"`), { depth: hop.depth, hops: hop.root.hops }));
976
+ onError(new chunkCQZH3L3W_cjs.NovaError(chunkCQZH3L3W_cjs.ErrorCodes.runaway, runawayMessage(hop, `Reloading "${definition.id}"`), { depth: hop.depth, hops: hop.root.hops }));
981
977
  return;
982
978
  }
983
979
  await runLifecycleHook("mount", definition, () => buildContext(abortController.signal, hop));
@@ -998,9 +994,6 @@ var createActionRuntime = (config) => {
998
994
  ...config.fetch === void 0 ? {} : { fetch: config.fetch },
999
995
  ...config.transform === void 0 ? {} : { transform: config.transform },
1000
996
  ...onNavigate === void 0 ? {} : { onNavigate },
1001
- // Stamp the call event with this instance's identity before it flows up to
1002
- // the shell's telemetry — `runCall` only knows the endpoint, the runtime
1003
- // knows who made it.
1004
997
  ...config.onEndpoint === void 0 ? {} : { onEndpoint: (event) => config.onEndpoint({ ...event, instanceId: instance.id, canvasId: instance.canvasId }) },
1005
998
  ...config.onChain === void 0 ? {} : { onChain: config.onChain },
1006
999
  calls,
@@ -1010,10 +1003,6 @@ var createActionRuntime = (config) => {
1010
1003
  onError,
1011
1004
  signal,
1012
1005
  suspended: instance.status === "suspended",
1013
- // `reload` — re-run this instance's own mount hook. The same refresh
1014
- // `resume` performs, made available as a step for canvases that never
1015
- // suspend (a list keeps every card active, so nothing else would ever
1016
- // re-read one).
1017
1006
  onReload: reload,
1018
1007
  ...cause === void 0 ? {} : { cause }
1019
1008
  });
@@ -1033,10 +1022,10 @@ var createActionRuntime = (config) => {
1033
1022
  if (event.type !== "ui:model" || instance.status === "suspended") return;
1034
1023
  if (event.origin !== void 0 && event.origin !== instance.id) return;
1035
1024
  if (event.ref === void 0) return;
1036
- const path = modelListeners.get(event.ref);
1025
+ const path = modelPaths.get(event.ref);
1037
1026
  if (path === void 0) return;
1038
1027
  dataStore.update(
1039
- (curr) => chunkFSUMCJAR_cjs.applyMutations(curr, [{ set: path, value: event.payload }], { initial: initialSnapshot, strict })
1028
+ (curr) => chunkCQZH3L3W_cjs.applyMutations(curr, [{ set: path, value: event.payload }], { initial: initialSnapshot, strict })
1040
1029
  );
1041
1030
  });
1042
1031
  }
@@ -1064,14 +1053,14 @@ var createActionRuntime = (config) => {
1064
1053
  const applyMutationList = (mutations) => {
1065
1054
  if (mutations.length === 0) return;
1066
1055
  dataStore.update(
1067
- (curr) => chunkFSUMCJAR_cjs.applyMutations(curr, mutations, { initial: initialSnapshot, strict })
1056
+ (curr) => chunkCQZH3L3W_cjs.applyMutations(curr, mutations, { initial: initialSnapshot, strict })
1068
1057
  );
1069
1058
  };
1070
- const StepArraySchema = zod.z.array(chunkFSUMCJAR_cjs.StepSchema);
1059
+ const StepArraySchema = zod.z.array(chunkCQZH3L3W_cjs.StepSchema);
1071
1060
  const runSteps = async (steps) => {
1072
1061
  const parsed = StepArraySchema.safeParse(steps);
1073
1062
  if (!parsed.success) {
1074
- const error = new chunkFSUMCJAR_cjs.DefinitionValidationError(
1063
+ const error = new chunkCQZH3L3W_cjs.DefinitionValidationError(
1075
1064
  "Invalid steps passed to runtime.executeSteps",
1076
1065
  { failures: [{ id: definition.id, issues: parsed.error.issues }] }
1077
1066
  );
@@ -1090,7 +1079,7 @@ var createActionRuntime = (config) => {
1090
1079
  const parent = ambientCause();
1091
1080
  const cause = nextCause(parent);
1092
1081
  if (isRunaway(cause)) {
1093
- onError(new chunkFSUMCJAR_cjs.NovaError(chunkFSUMCJAR_cjs.ErrorCodes.runaway, runawayMessage(cause, `Mounting "${definition.id}"`), { depth: cause.depth, hops: cause.root.hops }));
1082
+ onError(new chunkCQZH3L3W_cjs.NovaError(chunkCQZH3L3W_cjs.ErrorCodes.runaway, runawayMessage(cause, `Mounting "${definition.id}"`), { depth: cause.depth, hops: cause.root.hops }));
1094
1083
  } else {
1095
1084
  await runLifecycleHook("mount", definition, () => buildContext(abortController.signal, cause));
1096
1085
  }
@@ -1100,7 +1089,7 @@ var createActionRuntime = (config) => {
1100
1089
  abortController.abort();
1101
1090
  stopFollowing();
1102
1091
  detach();
1103
- teardownModelListeners();
1092
+ modelPaths.clear();
1104
1093
  const unmountController = new AbortController();
1105
1094
  await runLifecycleHook(
1106
1095
  "unmount",
@@ -1119,11 +1108,8 @@ var createActionRuntime = (config) => {
1119
1108
  await runLifecycleHook("resume", definition, buildContext);
1120
1109
  };
1121
1110
  const reconcileModelBindings = (nodes) => {
1122
- modelListeners.clear();
1123
- for (const b of collectModelBindings(nodes)) modelListeners.set(b.ref, b.path);
1124
- };
1125
- const teardownModelListeners = () => {
1126
- modelListeners.clear();
1111
+ modelPaths.clear();
1112
+ for (const b of collectModelBindings(nodes)) modelPaths.set(b.ref, b.path);
1127
1113
  };
1128
1114
  const render = () => {
1129
1115
  const language = config.i18n?.();
@@ -1150,7 +1136,7 @@ var createActionRuntime = (config) => {
1150
1136
  const dispose = () => {
1151
1137
  stopFollowing();
1152
1138
  detach();
1153
- teardownModelListeners();
1139
+ modelPaths.clear();
1154
1140
  statusSubscribers.length = 0;
1155
1141
  };
1156
1142
  return {
@@ -1185,11 +1171,11 @@ var validateActions = (actions) => {
1185
1171
  failures.push({ id: actionId, issues: [{ code: "custom", path: [], message: strata.depthRefusal(), input: void 0 }] });
1186
1172
  continue;
1187
1173
  }
1188
- const result = chunkFSUMCJAR_cjs.ActionDefinitionSchema.safeParse(def);
1174
+ const result = chunkCQZH3L3W_cjs.ActionDefinitionSchema.safeParse(def);
1189
1175
  if (!result.success) failures.push({ id: actionId, issues: result.error.issues });
1190
1176
  }
1191
1177
  if (failures.length > 0) {
1192
- throw new chunkFSUMCJAR_cjs.DefinitionValidationError(
1178
+ throw new chunkCQZH3L3W_cjs.DefinitionValidationError(
1193
1179
  `${failures.length} action definition(s) failed validation`,
1194
1180
  { failures }
1195
1181
  );
@@ -1202,16 +1188,21 @@ var validateFragments = (fragments) => {
1202
1188
  failures.push({ id: fragmentId, issues: [{ code: "custom", path: [], message: strata.depthRefusal(), input: void 0 }] });
1203
1189
  continue;
1204
1190
  }
1205
- const result = chunkFSUMCJAR_cjs.ActionFragmentSchema.safeParse(frag);
1191
+ const result = chunkCQZH3L3W_cjs.ActionFragmentSchema.safeParse(frag);
1206
1192
  if (!result.success) failures.push({ id: fragmentId, issues: result.error.issues });
1207
1193
  }
1208
1194
  if (failures.length > 0) {
1209
- throw new chunkFSUMCJAR_cjs.DefinitionValidationError(
1195
+ throw new chunkCQZH3L3W_cjs.DefinitionValidationError(
1210
1196
  `${failures.length} action fragment(s) failed validation`,
1211
1197
  { failures }
1212
1198
  );
1213
1199
  }
1214
1200
  };
1201
+ var refuseSharedId = (id) => {
1202
+ throw new chunkCQZH3L3W_cjs.DefinitionValidationError(`"${id}" is the id of an action and of a fragment`, {
1203
+ failures: [{ id, issues: [{ code: "custom", path: [], message: "an id names an action or a fragment, never both", input: void 0 }] }]
1204
+ });
1205
+ };
1215
1206
  var snapshotCanvas = (canvas) => {
1216
1207
  const stack = canvas.stack.slice();
1217
1208
  return {
@@ -1281,14 +1272,14 @@ var DEFAULT_SHELL_LAYOUT = {
1281
1272
  as: "c",
1282
1273
  key: "id",
1283
1274
  do: {
1284
- component: chunkPNQY6OFB_cjs.CANVAS_SLOT_NAME,
1275
+ component: chunkQTJ4ZQRM_cjs.CANVAS_SLOT_NAME,
1285
1276
  props: { canvasId: "$.c.id" }
1286
1277
  }
1287
1278
  }
1288
1279
  ]
1289
1280
  };
1290
1281
  var DEFAULT_ACTION_LAYOUT = {
1291
- component: chunkPNQY6OFB_cjs.ACTION_SLOT_NAME,
1282
+ component: chunkQTJ4ZQRM_cjs.ACTION_SLOT_NAME,
1292
1283
  props: { instanceId: "$.active.id" }
1293
1284
  };
1294
1285
 
@@ -1303,24 +1294,21 @@ var flattenNode = (node, shell) => {
1303
1294
  }
1304
1295
  return node;
1305
1296
  }
1306
- if (node.name === chunkPNQY6OFB_cjs.CANVAS_SLOT_NAME) {
1297
+ if (node.name === chunkQTJ4ZQRM_cjs.CANVAS_SLOT_NAME) {
1307
1298
  const canvasId = asString(node.props["canvasId"]);
1308
1299
  if (canvasId === void 0) return emptyFragment();
1309
1300
  return { type: "fragment", children: flattenRenderTree(shell.getCanvasRenderTree(canvasId), shell) };
1310
1301
  }
1311
- if (node.name === chunkPNQY6OFB_cjs.ACTION_SLOT_NAME) {
1302
+ if (node.name === chunkQTJ4ZQRM_cjs.ACTION_SLOT_NAME) {
1312
1303
  const instanceId = asString(node.props["instanceId"]);
1313
1304
  if (instanceId === void 0) return emptyFragment();
1314
1305
  const runtime = shell.getRuntime(instanceId);
1315
1306
  if (runtime === void 0) return emptyFragment();
1316
1307
  return {
1317
1308
  type: "component",
1318
- name: chunkPNQY6OFB_cjs.ACTION_SLOT_NAME,
1319
- // identity only — never the definition itself (wire weight)
1309
+ name: chunkQTJ4ZQRM_cjs.ACTION_SLOT_NAME,
1320
1310
  props: { instanceId, canvasId: runtime.instance.canvasId, definitionId: runtime.instance.definitionId },
1321
1311
  children: runtime.render(),
1322
- // keyed by instance so a renderer remounts when the instance changes
1323
- // (no stale DOM state across instance swaps, enter animations fire)
1324
1312
  key: instanceId
1325
1313
  };
1326
1314
  }
@@ -1461,8 +1449,12 @@ var createTelemetry = (config) => {
1461
1449
 
1462
1450
  // src/shell/shell.ts
1463
1451
  var defaultShellIdFactory = createIdFactory("shell");
1452
+ var isFragment = (definition) => typeof definition === "object" && definition !== null && "kind" in definition && definition.kind === "fragment";
1464
1453
  var createShell = (config) => {
1465
1454
  validateActions(config.actions);
1455
+ validateFragments(config.fragments ?? {});
1456
+ const shared = Object.keys(config.fragments ?? {}).find((fragmentId) => Object.hasOwn(config.actions, fragmentId));
1457
+ if (shared !== void 0) refuseSharedId(shared);
1466
1458
  const id = (config.shellIdFn ?? defaultShellIdFactory)();
1467
1459
  const instanceIdFn = config.instanceIdFn ?? createIdFactory("act");
1468
1460
  const strict = config.strict ?? false;
@@ -1470,14 +1462,14 @@ var createShell = (config) => {
1470
1462
  const messageBus = config.messageBus ?? createMessageBus();
1471
1463
  const registry = createRuntimeRegistry();
1472
1464
  const telemetry = createTelemetry(config.telemetry);
1473
- const componentRegistry = config.registry ?? chunkOE527MXF_cjs.createComponentRegistry();
1465
+ const componentRegistry = config.registry ?? chunk3XFQI5P2_cjs.createComponentRegistry();
1474
1466
  if (config.components !== void 0) componentRegistry.registerAll(config.components);
1475
- const layoutStore = config.layoutStore ?? chunkPBPUSZIQ_cjs.createLayoutStore();
1467
+ const layoutStore = config.layoutStore ?? chunkK54CT3QN_cjs.createLayoutStore();
1476
1468
  let pendingStrictError;
1477
1469
  const toLifecycleError = (err) => {
1478
- if (err instanceof chunkFSUMCJAR_cjs.LifecycleError) return err;
1470
+ if (err instanceof chunkCQZH3L3W_cjs.LifecycleError) return err;
1479
1471
  const message = err instanceof Error ? err.message : String(err);
1480
- return new chunkFSUMCJAR_cjs.LifecycleError(message, {}, { cause: err });
1472
+ return new chunkCQZH3L3W_cjs.LifecycleError(message, {}, { cause: err });
1481
1473
  };
1482
1474
  const handleLifecycleRejection = (err) => {
1483
1475
  const lifecycleErr = toLifecycleError(err);
@@ -1485,7 +1477,7 @@ var createShell = (config) => {
1485
1477
  pendingStrictError = lifecycleErr;
1486
1478
  }
1487
1479
  if (config.onError === void 0) return;
1488
- if (err instanceof chunkFSUMCJAR_cjs.NovaError) {
1480
+ if (err instanceof chunkCQZH3L3W_cjs.NovaError) {
1489
1481
  config.onError(err);
1490
1482
  return;
1491
1483
  }
@@ -1514,24 +1506,29 @@ var createShell = (config) => {
1514
1506
  }
1515
1507
  const canvasOrder = config.canvases.map((cfg) => cfg.id);
1516
1508
  let canvasLayout = config.canvasLayout;
1517
- const actions = { ...config.actions };
1509
+ const definitions = { ...config.actions, ...config.fragments };
1510
+ const actionOf = (actionId) => {
1511
+ const held = definitions[actionId];
1512
+ return held === void 0 || isFragment(held) ? void 0 : held;
1513
+ };
1514
+ const fragmentOf = (fragmentId) => {
1515
+ const held = definitions[fragmentId];
1516
+ return held !== void 0 && isFragment(held) ? held : void 0;
1517
+ };
1518
1518
  let phrases = config.phrases;
1519
1519
  let bearing = config.phrases !== void 0 || config.phraseKeys !== void 0;
1520
1520
  const SOURCE = {};
1521
1521
  const language = () => {
1522
1522
  if (!bearing) return void 0;
1523
1523
  return {
1524
- // An empty book translates nothing and still fills patterns, which is
1525
- // exactly what the source language needs.
1526
1524
  phrases: phrases ?? SOURCE,
1527
1525
  ...config.phraseKeys === void 0 ? {} : { phraseKeys: config.phraseKeys },
1528
1526
  ...config.onPhraseMiss === void 0 ? {} : { onPhraseMiss: config.onPhraseMiss }
1529
1527
  };
1530
1528
  };
1531
- const fragments = { ...config.fragments ?? {} };
1532
1529
  let disposed = false;
1533
1530
  const guardNotDisposed = () => {
1534
- if (disposed) throw new chunkFSUMCJAR_cjs.ShellDisposedError("Shell disposed");
1531
+ if (disposed) throw new chunkCQZH3L3W_cjs.ShellDisposedError("Shell disposed");
1535
1532
  };
1536
1533
  const guardNoPendingStrictError = () => {
1537
1534
  if (pendingStrictError === void 0) return;
@@ -1551,19 +1548,28 @@ var createShell = (config) => {
1551
1548
  return created;
1552
1549
  };
1553
1550
  const getDefinition = (actionId) => {
1554
- const def = actions[actionId];
1555
- if (def === void 0) throw new chunkFSUMCJAR_cjs.UnknownActionError(`Unknown action: ${actionId}`, { actionId });
1551
+ const def = actionOf(actionId);
1552
+ if (def === void 0) throw new chunkCQZH3L3W_cjs.UnknownActionError(`Unknown action: ${actionId}`, { actionId });
1556
1553
  return def;
1557
1554
  };
1558
1555
  const registerAction = (definition) => {
1559
1556
  guard();
1560
- validateActions({ [definition.id]: definition });
1561
- actions[definition.id] = definition;
1557
+ if (isFragment(definition)) {
1558
+ if (definition.id === void 0) throw new chunkCQZH3L3W_cjs.UnknownFragmentError("Fragment is missing an id", { fragmentId: "" });
1559
+ validateFragments({ [definition.id]: definition });
1560
+ } else {
1561
+ validateActions({ [definition.id]: definition });
1562
+ }
1563
+ const held = Object.hasOwn(definitions, definition.id) ? definitions[definition.id] : void 0;
1564
+ if (held !== void 0 && isFragment(held) !== isFragment(definition)) refuseSharedId(definition.id);
1565
+ definitions[definition.id] = definition;
1562
1566
  };
1563
1567
  const removeAction = (actionId) => {
1564
1568
  guard();
1565
- if (actions[actionId] === void 0) return;
1566
- delete actions[actionId];
1569
+ const held = definitions[actionId];
1570
+ if (held === void 0) return;
1571
+ delete definitions[actionId];
1572
+ if (isFragment(held)) return;
1567
1573
  journal.forgetAction(actionId);
1568
1574
  let changed = false;
1569
1575
  for (const [, canvas] of canvases) {
@@ -1579,20 +1585,14 @@ var createShell = (config) => {
1579
1585
  if (changed) fireState();
1580
1586
  };
1581
1587
  const getFragment = (fragmentId) => {
1582
- const frag = fragments[fragmentId];
1583
- if (frag === void 0) throw new chunkFSUMCJAR_cjs.UnknownFragmentError(`Unknown fragment: ${fragmentId}`, { fragmentId });
1588
+ const frag = fragmentOf(fragmentId);
1589
+ if (frag === void 0) throw new chunkCQZH3L3W_cjs.UnknownFragmentError(`Unknown fragment: ${fragmentId}`, { fragmentId });
1584
1590
  return frag;
1585
1591
  };
1586
- const registerFragment = (fragment) => {
1587
- guard();
1588
- if (fragment.id === void 0) throw new chunkFSUMCJAR_cjs.UnknownFragmentError("Fragment is missing an id", { fragmentId: "" });
1589
- validateFragments({ [fragment.id]: fragment });
1590
- fragments[fragment.id] = fragment;
1591
- };
1592
1592
  const resolveDefinition = (actionId, fragmentIds) => {
1593
1593
  const def = getDefinition(actionId);
1594
1594
  if (fragmentIds === void 0 || fragmentIds.length === 0) return def;
1595
- return chunkPBPUSZIQ_cjs.composeAction(def, fragmentIds.map(getFragment));
1595
+ return chunkK54CT3QN_cjs.composeAction(def, fragmentIds.map(getFragment));
1596
1596
  };
1597
1597
  const announced = /* @__PURE__ */ new Map();
1598
1598
  let announcing = false;
@@ -1638,9 +1638,6 @@ var createShell = (config) => {
1638
1638
  pop: (cid) => pop(cid),
1639
1639
  replace: (cid, aid, input, frags) => replace(cid, aid, input, frags),
1640
1640
  clear: (cid) => clear(cid),
1641
- // ONE position, then both halves — see ShellNavOps.resetTo. The record is
1642
- // taken outside the mute so the deck being thrown away is what back returns
1643
- // to; the calls inside it record nothing of their own.
1644
1641
  resetTo: (cid, aid, input, frags) => {
1645
1642
  record(cid);
1646
1643
  journal.mute(() => {
@@ -1650,19 +1647,14 @@ var createShell = (config) => {
1650
1647
  },
1651
1648
  popTo: (cid, iid) => popTo(cid, iid),
1652
1649
  removeInstance: (cid, iid) => removeInstance(cid, iid),
1653
- // ONE movement, like resetTo: the position before it is what back returns
1654
- // to — recorded only when something actually moved, so a reconcile that
1655
- // found the canvas already right leaves no empty step in history. Rows
1656
- // naming an action this shell does not have are skipped: ungranted is
1657
- // absent, as an ungranted `initial` candidate is.
1658
1650
  reconcile: (cid, desired, options) => {
1659
1651
  const before = positionOf(cid);
1660
- const known = desired.filter((entry) => actions[entry.actionId] !== void 0).map((entry) => options.with === void 0 ? entry : { ...entry, with: options.with });
1652
+ const known = desired.filter((entry) => actionOf(entry.actionId) !== void 0).map((entry) => options.with === void 0 ? entry : { ...entry, with: options.with });
1661
1653
  const result = journal.mute(
1662
1654
  () => reconcileCanvas(shell, cid, known, {
1663
1655
  origin: options.origin,
1664
1656
  ...options.own === void 0 ? {} : { own: options.own },
1665
- definitionOf: (actionId) => actions[actionId]
1657
+ definitionOf: actionOf
1666
1658
  })
1667
1659
  );
1668
1660
  if (result.changed) journal.record(cid, before);
@@ -1682,8 +1674,6 @@ var createShell = (config) => {
1682
1674
  i18n: language,
1683
1675
  instanceIdFn,
1684
1676
  onNavigate: (cid, effect) => navigationHandler(cid, effect),
1685
- // Every endpoint call an action makes flows to telemetry — the shell's one
1686
- // observability surface (state, data, and now endpoints all land here).
1687
1677
  onEndpoint: (event) => telemetry.fireEndpoint(event),
1688
1678
  onChain: chains.hold
1689
1679
  });
@@ -1798,7 +1788,8 @@ var createShell = (config) => {
1798
1788
  if (common === canvas.stack.length && common === entry.stack.length) return false;
1799
1789
  for (let i = common; i < entry.stack.length; i += 1) {
1800
1790
  const frame = entry.stack[i];
1801
- if (frame !== void 0 && actions[frame.action] === void 0) return false;
1791
+ if (frame === void 0) continue;
1792
+ if (actionOf(frame.action) === void 0 || frame.with?.some((fragmentId) => fragmentOf(fragmentId) === void 0) === true) return false;
1802
1793
  }
1803
1794
  journal.mute(() => {
1804
1795
  const standing = canvas.clearStack();
@@ -1931,7 +1922,7 @@ var createShell = (config) => {
1931
1922
  const resolved = typeof layout === "string" ? layoutStore.get(layout) : layout;
1932
1923
  if (resolved === void 0) return [];
1933
1924
  const current = language();
1934
- return chunkPBPUSZIQ_cjs.renderLayoutFromStore(
1925
+ return chunkK54CT3QN_cjs.renderLayoutFromStore(
1935
1926
  resolved,
1936
1927
  { get: () => data },
1937
1928
  {
@@ -1954,9 +1945,9 @@ var createShell = (config) => {
1954
1945
  return renderLayoutOrRef(canvasLayout ?? DEFAULT_SHELL_LAYOUT, { canvases: canvasList });
1955
1946
  };
1956
1947
  const titleOf = (instance) => {
1957
- const def = registry.get(instance.id)?.definition ?? actions[instance.definitionId];
1948
+ const def = registry.get(instance.id)?.definition ?? actionOf(instance.definitionId);
1958
1949
  if (def?.title !== void 0) {
1959
- const resolved = chunkPBPUSZIQ_cjs.resolve(def.title, chunkPBPUSZIQ_cjs.createScopeChain(instance.data));
1950
+ const resolved = chunkK54CT3QN_cjs.resolve(def.title, chunkK54CT3QN_cjs.createScopeChain(instance.data));
1960
1951
  if (resolved !== void 0 && resolved !== null && resolved !== "") return String(resolved);
1961
1952
  }
1962
1953
  return def?.name ?? instance.definitionId;
@@ -1992,7 +1983,6 @@ var createShell = (config) => {
1992
1983
  back,
1993
1984
  registerAction,
1994
1985
  removeAction,
1995
- registerFragment,
1996
1986
  addCanvas,
1997
1987
  removeCanvas,
1998
1988
  setCanvasLayout,
@@ -2023,8 +2013,8 @@ var createShell = (config) => {
2023
2013
  var hasVisibleContent = (nodes) => nodes.some((node) => {
2024
2014
  if (node.type === "text") return node.value !== "";
2025
2015
  if (node.type === "fragment") return hasVisibleContent(node.children);
2026
- if (node.type === "component" && node.name === chunkPNQY6OFB_cjs.ACTION_SLOT_NAME) return hasVisibleContent(node.children);
2027
- if (chunkPNQY6OFB_cjs.isHeadNode(node)) return false;
2016
+ if (node.type === "component" && node.name === chunkQTJ4ZQRM_cjs.ACTION_SLOT_NAME) return hasVisibleContent(node.children);
2017
+ if (chunkQTJ4ZQRM_cjs.isHeadNode(node)) return false;
2028
2018
  return true;
2029
2019
  });
2030
2020
  var canvasTreeOf = (shell, canvasId) => {
@@ -2035,10 +2025,6 @@ var shellView = (shell) => ({
2035
2025
  api: {
2036
2026
  frame: () => shell.getShellRenderTree(),
2037
2027
  canvasTree: (canvasId) => canvasTreeOf(shell, canvasId),
2038
- // An event that names no origin belongs to the canvas's ACTIVE instance — on
2039
- // a card deck that is the only one drawn. One that names its own (an
2040
- // adapter stamps it at the instance boundary, `scopeDispatch`) keeps it. A
2041
- // canvas with nothing mounted dispatches unstamped.
2042
2028
  dispatch: (canvasId, event) => {
2043
2029
  const active = shell.getState().canvases[canvasId]?.active;
2044
2030
  shell.dispatch(event.origin === void 0 && active !== void 0 ? { ...event, origin: active.id } : event);
@@ -2113,5 +2099,5 @@ exports.scopeDispatch = scopeDispatch;
2113
2099
  exports.shellIdle = shellIdle;
2114
2100
  exports.shellSettled = shellSettled;
2115
2101
  exports.shellView = shellView;
2116
- //# sourceMappingURL=chunk-ECFWPZGL.cjs.map
2117
- //# sourceMappingURL=chunk-ECFWPZGL.cjs.map
2102
+ //# sourceMappingURL=chunk-X77B4ZKQ.cjs.map
2103
+ //# sourceMappingURL=chunk-X77B4ZKQ.cjs.map