@tangle-network/agent-app 0.27.2 → 0.29.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 (127) hide show
  1. package/dist/DesignCanvas-AOIVN3SJ.js +12 -0
  2. package/dist/DesignCanvasEditor-IB2FMBBD.js +13 -0
  3. package/dist/InviteAcceptPage-EUOGZO2X.js +7 -0
  4. package/dist/MembersPanel-4CGUQRPF.js +8 -0
  5. package/dist/MembersPanel-4CGUQRPF.js.map +1 -0
  6. package/dist/{TimelineEditor-JDG54OBP.js → TimelineEditor-Z7C6BFP5.js} +2 -2
  7. package/dist/TimelineEditor-Z7C6BFP5.js.map +1 -0
  8. package/dist/access-ChAHG4Tp.d.ts +539 -0
  9. package/dist/{apply-Cp8c3K9D.d.ts → apply-Gk4raT2j.d.ts} +3 -1
  10. package/dist/{chunk-AFDROJ64.js → chunk-2QI7XV2T.js} +1 -1
  11. package/dist/chunk-2QI7XV2T.js.map +1 -0
  12. package/dist/chunk-3G334FVA.js +162 -0
  13. package/dist/chunk-3G334FVA.js.map +1 -0
  14. package/dist/chunk-3SVAA3MA.js +41 -0
  15. package/dist/chunk-3SVAA3MA.js.map +1 -0
  16. package/dist/{chunk-LUE4HO5C.js → chunk-4IQMTTNE.js} +10 -10
  17. package/dist/chunk-4IQMTTNE.js.map +1 -0
  18. package/dist/chunk-535V6BH6.js +128 -0
  19. package/dist/chunk-535V6BH6.js.map +1 -0
  20. package/dist/chunk-63CE7FEZ.js +63 -0
  21. package/dist/chunk-63CE7FEZ.js.map +1 -0
  22. package/dist/{chunk-5RT6KY4G.js → chunk-GQRL6VNU.js} +1 -1
  23. package/dist/chunk-GQRL6VNU.js.map +1 -0
  24. package/dist/{chunk-SCG5JJ4C.js → chunk-HFC4BTWJ.js} +32 -4
  25. package/dist/chunk-HFC4BTWJ.js.map +1 -0
  26. package/dist/{chunk-7QCIYDGC.js → chunk-IOREXWLM.js} +2 -2
  27. package/dist/{chunk-6UOE5CTA.js → chunk-JT6HHO5P.js} +5 -10
  28. package/dist/chunk-JT6HHO5P.js.map +1 -0
  29. package/dist/{chunk-JZAJE3JL.js → chunk-M2EBUDZ7.js} +19 -5
  30. package/dist/chunk-M2EBUDZ7.js.map +1 -0
  31. package/dist/{chunk-HABVCJJT.js → chunk-N4ZFKQ5C.js} +271 -404
  32. package/dist/chunk-N4ZFKQ5C.js.map +1 -0
  33. package/dist/chunk-S5CAJX6O.js +14 -0
  34. package/dist/chunk-S5CAJX6O.js.map +1 -0
  35. package/dist/{chunk-RJ2ZHK5D.js → chunk-S6WS2B32.js} +132 -7
  36. package/dist/chunk-S6WS2B32.js.map +1 -0
  37. package/dist/chunk-SQV7NUEM.js +136 -0
  38. package/dist/chunk-SQV7NUEM.js.map +1 -0
  39. package/dist/chunk-UAKFCMWK.js +1 -0
  40. package/dist/chunk-UAKFCMWK.js.map +1 -0
  41. package/dist/chunk-V5XZKHCL.js +296 -0
  42. package/dist/chunk-V5XZKHCL.js.map +1 -0
  43. package/dist/chunk-XWJXZ6WE.js +604 -0
  44. package/dist/chunk-XWJXZ6WE.js.map +1 -0
  45. package/dist/chunk-Y2SZVW35.js +125 -0
  46. package/dist/chunk-Y2SZVW35.js.map +1 -0
  47. package/dist/{chunk-27LQXQSS.js → chunk-YEWTVDDT.js} +224 -767
  48. package/dist/chunk-YEWTVDDT.js.map +1 -0
  49. package/dist/{chunk-UDXMR3AD.js → chunk-YNALYIQ3.js} +56 -18
  50. package/dist/chunk-YNALYIQ3.js.map +1 -0
  51. package/dist/command-stack-CkjelfK_.d.ts +267 -0
  52. package/dist/design-canvas/drizzle.d.ts +2 -2
  53. package/dist/design-canvas/index.d.ts +7 -6
  54. package/dist/design-canvas/index.js +3 -2
  55. package/dist/design-canvas-react/engine.d.ts +349 -0
  56. package/dist/design-canvas-react/engine.js +86 -0
  57. package/dist/design-canvas-react/engine.js.map +1 -0
  58. package/dist/design-canvas-react/index.d.ts +69 -649
  59. package/dist/design-canvas-react/index.js +84 -173
  60. package/dist/design-canvas-react/index.js.map +1 -1
  61. package/dist/design-canvas-react/lazy.d.ts +6 -0
  62. package/dist/design-canvas-react/lazy.js +9 -0
  63. package/dist/design-canvas-react/lazy.js.map +1 -0
  64. package/dist/{export-presets-Dl5Aa5xj.d.ts → export-presets-DAsU5Wal.d.ts} +2 -143
  65. package/dist/flow-types-Cb_AblZs.d.ts +25 -0
  66. package/dist/index.d.ts +11 -8
  67. package/dist/index.js +21 -8
  68. package/dist/lazy-BHHqS8-j.d.ts +72 -0
  69. package/dist/missions/index.d.ts +12 -0
  70. package/dist/missions/index.js +1 -1
  71. package/dist/{model-BHLN208Z.d.ts → model-BBwyOuWG.d.ts} +3 -1
  72. package/dist/operations-DLIvvD00.d.ts +144 -0
  73. package/dist/platform/index.js +1 -1
  74. package/dist/roles-CLtYKHHl.d.ts +49 -0
  75. package/dist/runtime/index.d.ts +33 -33
  76. package/dist/runtime/index.js +1 -1
  77. package/dist/sequences/index.d.ts +1 -1
  78. package/dist/sequences/index.js +2 -1
  79. package/dist/sequences-react/index.d.ts +15 -1
  80. package/dist/sequences-react/index.js +2 -2
  81. package/dist/{store-CUStmtdH.d.ts → store-CFyxgTlD.d.ts} +1 -1
  82. package/dist/teams/drizzle.d.ts +42 -0
  83. package/dist/teams/drizzle.js +194 -0
  84. package/dist/teams/drizzle.js.map +1 -0
  85. package/dist/teams/index.d.ts +44 -0
  86. package/dist/teams/index.js +39 -0
  87. package/dist/teams/index.js.map +1 -0
  88. package/dist/teams/members-api.d.ts +152 -0
  89. package/dist/teams/members-api.js +261 -0
  90. package/dist/teams/members-api.js.map +1 -0
  91. package/dist/teams-react/index.d.ts +81 -0
  92. package/dist/teams-react/index.js +12 -0
  93. package/dist/teams-react/index.js.map +1 -0
  94. package/dist/teams-react/lazy.d.ts +9 -0
  95. package/dist/teams-react/lazy.js +13 -0
  96. package/dist/teams-react/lazy.js.map +1 -0
  97. package/dist/theme/index.d.ts +80 -0
  98. package/dist/theme/index.js +14 -0
  99. package/dist/theme/index.js.map +1 -0
  100. package/dist/theme/tailwind-preset.d.ts +65 -0
  101. package/dist/theme/tailwind-preset.js +33 -0
  102. package/dist/theme/tailwind-preset.js.map +1 -0
  103. package/dist/theme/tokens.css +95 -0
  104. package/dist/trace/index.d.ts +2 -18
  105. package/dist/trace/index.js +2 -2
  106. package/dist/web/index.d.ts +25 -2
  107. package/dist/web/index.js +3 -1
  108. package/dist/web-react/index.d.ts +71 -31
  109. package/dist/web-react/index.js +625 -486
  110. package/dist/web-react/index.js.map +1 -1
  111. package/package.json +53 -3
  112. package/dist/DesignCanvas-73IUJJUP.js +0 -10
  113. package/dist/DesignCanvasEditor-6F2UTOSW.js +0 -9
  114. package/dist/chunk-27LQXQSS.js.map +0 -1
  115. package/dist/chunk-5RT6KY4G.js.map +0 -1
  116. package/dist/chunk-6UOE5CTA.js.map +0 -1
  117. package/dist/chunk-AFDROJ64.js.map +0 -1
  118. package/dist/chunk-HABVCJJT.js.map +0 -1
  119. package/dist/chunk-JZAJE3JL.js.map +0 -1
  120. package/dist/chunk-LUE4HO5C.js.map +0 -1
  121. package/dist/chunk-RJ2ZHK5D.js.map +0 -1
  122. package/dist/chunk-SCG5JJ4C.js.map +0 -1
  123. package/dist/chunk-UDXMR3AD.js.map +0 -1
  124. /package/dist/{DesignCanvas-73IUJJUP.js.map → DesignCanvas-AOIVN3SJ.js.map} +0 -0
  125. /package/dist/{DesignCanvasEditor-6F2UTOSW.js.map → DesignCanvasEditor-IB2FMBBD.js.map} +0 -0
  126. /package/dist/{TimelineEditor-JDG54OBP.js.map → InviteAcceptPage-EUOGZO2X.js.map} +0 -0
  127. /package/dist/{chunk-7QCIYDGC.js.map → chunk-IOREXWLM.js.map} +0 -0
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Typed mirror of tokens.css for runtime/JS theming. The canonical source is
3
+ * tokens.css (`import '@tangle-network/agent-app/styles'`); this module is for
4
+ * apps that compute theme variables in JS, or read color values where CSS
5
+ * custom properties cannot reach — notably Konva canvas render code, which
6
+ * paints to a bitmap and cannot resolve `var(--…)`.
7
+ *
8
+ * Values are shadcn-style HSL channel triples ("H S% L%"); wrap with `color()`.
9
+ */
10
+ interface AgentAppTheme {
11
+ background: string;
12
+ foreground: string;
13
+ card: string;
14
+ cardForeground: string;
15
+ popover: string;
16
+ popoverForeground: string;
17
+ primary: string;
18
+ primaryForeground: string;
19
+ secondary: string;
20
+ secondaryForeground: string;
21
+ muted: string;
22
+ mutedForeground: string;
23
+ accent: string;
24
+ accentForeground: string;
25
+ destructive: string;
26
+ destructiveForeground: string;
27
+ border: string;
28
+ input: string;
29
+ ring: string;
30
+ success: string;
31
+ successForeground: string;
32
+ warning: string;
33
+ warningForeground: string;
34
+ /** Full CSS color (not a triple) — the canvas/scene backdrop. */
35
+ canvasBackdrop: string;
36
+ /** Konva render palette — full hex colors the bitmap canvas paints with
37
+ * (it cannot resolve `var(--…)`). NOT emitted by themeToCssVars. */
38
+ canvasRender: CanvasRenderPalette;
39
+ }
40
+ /**
41
+ * Colors the Konva design-canvas paints directly. Konva renders to a bitmap
42
+ * and cannot read CSS custom properties, so these are full hex strings sourced
43
+ * from the active theme and threaded through the canvas components.
44
+ */
45
+ interface CanvasRenderPalette {
46
+ /** Grid line color (GridLayer). */
47
+ grid: string;
48
+ /** Grid-snap guide line (SnapGuidesOverlay, kind 'grid'). */
49
+ snapGrid: string;
50
+ /** Saved ruler-guide snap line (kind 'guide'). */
51
+ snapGuide: string;
52
+ /** Page edge/center snap line (kinds 'page-edge'/'page-center'). */
53
+ snapPage: string;
54
+ /** Element edge/center snap line (kinds 'element-edge'/'element-center'). */
55
+ snapElement: string;
56
+ /** Transformer border + anchor stroke (SelectionLayer). */
57
+ selectionStroke: string;
58
+ /** Transformer anchor fill (SelectionLayer). */
59
+ selectionAnchorFill: string;
60
+ /** Video placeholder fill (ElementNode VideoNode). */
61
+ placeholderFill: string;
62
+ /** Video placeholder stroke (ElementNode VideoNode). */
63
+ placeholderStroke: string;
64
+ /** Broken/loading image placeholder fill (ElementNode ImageNode). */
65
+ brokenFill: string;
66
+ /** Broken/loading image placeholder stroke (ElementNode ImageNode). */
67
+ brokenStroke: string;
68
+ }
69
+ declare const lightTheme: AgentAppTheme;
70
+ declare const darkTheme: AgentAppTheme;
71
+ /** Wrap a channel triple in `hsl()`; pass through values already in a color form. */
72
+ declare function themeColor(value: string): string;
73
+ /**
74
+ * Map a theme to the full CSS-variable set (shadcn triples + canvas/sequences
75
+ * aliases + canvas surface). Apply at runtime to scope a theme without loading
76
+ * tokens.css: `Object.assign(el.style, themeToCssVars(darkTheme))`.
77
+ */
78
+ declare function themeToCssVars(theme: AgentAppTheme): Record<string, string>;
79
+
80
+ export { type AgentAppTheme, type CanvasRenderPalette, darkTheme, lightTheme, themeColor, themeToCssVars };
@@ -0,0 +1,14 @@
1
+ import "../chunk-UAKFCMWK.js";
2
+ import {
3
+ darkTheme,
4
+ lightTheme,
5
+ themeColor,
6
+ themeToCssVars
7
+ } from "../chunk-Y2SZVW35.js";
8
+ export {
9
+ darkTheme,
10
+ lightTheme,
11
+ themeColor,
12
+ themeToCssVars
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Tailwind preset mapping the shadcn semantic color names used by web-react
3
+ * (bg-card, text-muted-foreground, border-border, …) onto the CSS variables in
4
+ * tokens.css — so a consuming app themes every agent-app surface from one source.
5
+ *
6
+ * // tailwind.config.{js,ts}
7
+ * import agentAppPreset from '@tangle-network/agent-app/tailwind-preset'
8
+ * export default { presets: [agentAppPreset], content: [...] }
9
+ *
10
+ * Pair with `import '@tangle-network/agent-app/styles'` for the variable values.
11
+ * design-canvas/sequences need no preset — they consume vars via arbitrary
12
+ * values (bg-[var(--bg-input)]), which Tailwind supports without color config.
13
+ */
14
+ declare const agentAppPreset: {
15
+ darkMode: [string, string];
16
+ theme: {
17
+ extend: {
18
+ colors: {
19
+ background: string;
20
+ foreground: string;
21
+ border: string;
22
+ input: string;
23
+ ring: string;
24
+ success: {
25
+ DEFAULT: string;
26
+ foreground: string;
27
+ };
28
+ warning: {
29
+ DEFAULT: string;
30
+ foreground: string;
31
+ };
32
+ card: {
33
+ DEFAULT: string;
34
+ foreground: string;
35
+ };
36
+ popover: {
37
+ DEFAULT: string;
38
+ foreground: string;
39
+ };
40
+ primary: {
41
+ DEFAULT: string;
42
+ foreground: string;
43
+ };
44
+ secondary: {
45
+ DEFAULT: string;
46
+ foreground: string;
47
+ };
48
+ muted: {
49
+ DEFAULT: string;
50
+ foreground: string;
51
+ };
52
+ accent: {
53
+ DEFAULT: string;
54
+ foreground: string;
55
+ };
56
+ destructive: {
57
+ DEFAULT: string;
58
+ foreground: string;
59
+ };
60
+ };
61
+ };
62
+ };
63
+ };
64
+
65
+ export { agentAppPreset as default };
@@ -0,0 +1,33 @@
1
+ // src/theme/tailwind-preset.ts
2
+ var withForeground = (name) => ({
3
+ DEFAULT: `hsl(var(--${name}))`,
4
+ foreground: `hsl(var(--${name}-foreground))`
5
+ });
6
+ var agentAppPreset = {
7
+ darkMode: ["class", '[data-theme="dark"]'],
8
+ theme: {
9
+ extend: {
10
+ colors: {
11
+ background: "hsl(var(--background))",
12
+ foreground: "hsl(var(--foreground))",
13
+ border: "hsl(var(--border))",
14
+ input: "hsl(var(--input))",
15
+ ring: "hsl(var(--ring))",
16
+ success: withForeground("success"),
17
+ warning: withForeground("warning"),
18
+ card: withForeground("card"),
19
+ popover: withForeground("popover"),
20
+ primary: withForeground("primary"),
21
+ secondary: withForeground("secondary"),
22
+ muted: withForeground("muted"),
23
+ accent: withForeground("accent"),
24
+ destructive: withForeground("destructive")
25
+ }
26
+ }
27
+ }
28
+ };
29
+ var tailwind_preset_default = agentAppPreset;
30
+ export {
31
+ tailwind_preset_default as default
32
+ };
33
+ //# sourceMappingURL=tailwind-preset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/tailwind-preset.ts"],"sourcesContent":["/**\n * Tailwind preset mapping the shadcn semantic color names used by web-react\n * (bg-card, text-muted-foreground, border-border, …) onto the CSS variables in\n * tokens.css — so a consuming app themes every agent-app surface from one source.\n *\n * // tailwind.config.{js,ts}\n * import agentAppPreset from '@tangle-network/agent-app/tailwind-preset'\n * export default { presets: [agentAppPreset], content: [...] }\n *\n * Pair with `import '@tangle-network/agent-app/styles'` for the variable values.\n * design-canvas/sequences need no preset — they consume vars via arbitrary\n * values (bg-[var(--bg-input)]), which Tailwind supports without color config.\n */\n\nconst withForeground = (name: string) => ({\n DEFAULT: `hsl(var(--${name}))`,\n foreground: `hsl(var(--${name}-foreground))`,\n})\n\nconst agentAppPreset = {\n darkMode: ['class', '[data-theme=\"dark\"]'] as [string, string],\n theme: {\n extend: {\n colors: {\n background: 'hsl(var(--background))',\n foreground: 'hsl(var(--foreground))',\n border: 'hsl(var(--border))',\n input: 'hsl(var(--input))',\n ring: 'hsl(var(--ring))',\n success: withForeground('success'),\n warning: withForeground('warning'),\n card: withForeground('card'),\n popover: withForeground('popover'),\n primary: withForeground('primary'),\n secondary: withForeground('secondary'),\n muted: withForeground('muted'),\n accent: withForeground('accent'),\n destructive: withForeground('destructive'),\n },\n },\n },\n}\n\nexport default agentAppPreset\n"],"mappings":";AAcA,IAAM,iBAAiB,CAAC,UAAkB;AAAA,EACxC,SAAS,aAAa,IAAI;AAAA,EAC1B,YAAY,aAAa,IAAI;AAC/B;AAEA,IAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC,SAAS,qBAAqB;AAAA,EACzC,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,QAAQ;AAAA,QACN,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS,eAAe,SAAS;AAAA,QACjC,SAAS,eAAe,SAAS;AAAA,QACjC,MAAM,eAAe,MAAM;AAAA,QAC3B,SAAS,eAAe,SAAS;AAAA,QACjC,SAAS,eAAe,SAAS;AAAA,QACjC,WAAW,eAAe,WAAW;AAAA,QACrC,OAAO,eAAe,OAAO;AAAA,QAC7B,QAAQ,eAAe,QAAQ;AAAA,QAC/B,aAAa,eAAe,aAAa;AAAA,MAC3C;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,0BAAQ;","names":[]}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * agent-app design tokens — the single source of truth for theming every React
3
+ * surface (design-canvas-react, sequences-react, web-react).
4
+ *
5
+ * Import once at your app root: import '@tangle-network/agent-app/styles'
6
+ * Dark mode: set `data-theme="dark"` (or class `dark`) on a parent element.
7
+ *
8
+ * Two vocabularies resolve to ONE set of channel triples:
9
+ * - shadcn semantic names (--card, --foreground, --muted-foreground, …) —
10
+ * consumed by web-react via Tailwind classes (bg-card, text-foreground).
11
+ * Wire them with the Tailwind preset: import '@tangle-network/agent-app/tailwind-preset'.
12
+ * - canvas/sequences alias names (--bg-input, --text-primary, …) — full
13
+ * colors consumed directly via Tailwind arbitrary values (bg-[var(--bg-input)]).
14
+ * These need no Tailwind config; tokens.css alone is enough.
15
+ *
16
+ * The aliases reference the triples, so redefining only the triples in the dark
17
+ * scope re-themes both vocabularies through the cascade.
18
+ */
19
+
20
+ :root {
21
+ /* shadcn channel triples — "H S% L%", consumed as hsl(var(--name)) */
22
+ --background: 0 0% 100%;
23
+ --foreground: 222 47% 11%;
24
+ --card: 0 0% 100%;
25
+ --card-foreground: 222 47% 11%;
26
+ --popover: 0 0% 100%;
27
+ --popover-foreground: 222 47% 11%;
28
+ --primary: 221 83% 47%;
29
+ --primary-foreground: 0 0% 100%;
30
+ --secondary: 210 40% 96%;
31
+ --secondary-foreground: 222 47% 30%;
32
+ --muted: 210 40% 96%;
33
+ /* 44% L (was 47%) so muted text clears WCAG AA even on subtly tinted surfaces
34
+ (e.g. the failed tool card's 5%-red wash); ~4.7:1 on white. */
35
+ --muted-foreground: 215 16% 44%;
36
+ --accent: 210 40% 96%;
37
+ --accent-foreground: 222 47% 11%;
38
+ --destructive: 0 72% 45%;
39
+ --destructive-foreground: 0 0% 100%;
40
+ --border: 214 32% 91%;
41
+ --input: 214 32% 91%;
42
+ --ring: 221 83% 53%;
43
+ /* note: --primary below is darkened from 53% → 47% L so the brand blue clears
44
+ WCAG AA (4.5:1) when used AS TEXT on a light surface; --ring stays at the
45
+ brighter 53% (a 2px focus ring only needs 3:1 non-text contrast). */
46
+ /* status colors — dark enough on light surfaces to clear AA as text (used by
47
+ chips, dots, and solid buttons via the Tailwind preset's success/warning). */
48
+ --success: 142 72% 29%;
49
+ --success-foreground: 0 0% 100%;
50
+ --warning: 38 92% 32%;
51
+ --warning-foreground: 38 92% 12%;
52
+
53
+ /* canvas/sequences aliases — full colors, resolve to the triples above */
54
+ --bg-input: hsl(var(--card));
55
+ --text-primary: hsl(var(--foreground));
56
+ --text-secondary: hsl(var(--secondary-foreground));
57
+ --text-muted: hsl(var(--muted-foreground));
58
+ --text-danger: hsl(var(--destructive));
59
+ --text-warning: hsl(var(--warning));
60
+ --border-default: hsl(var(--border));
61
+ --brand-primary: hsl(var(--primary));
62
+
63
+ /* canvas-only surfaces (not part of the shadcn vocabulary). Name matches the
64
+ `--canvas-backdrop` the design-canvas Workspace references (with a #1a1a1a fallback). */
65
+ --canvas-backdrop: hsl(220 13% 91%);
66
+ }
67
+
68
+ [data-theme='dark'],
69
+ .dark {
70
+ --background: 222 47% 7%;
71
+ --foreground: 210 40% 98%;
72
+ --card: 222 47% 11%;
73
+ --card-foreground: 210 40% 98%;
74
+ --popover: 222 47% 11%;
75
+ --popover-foreground: 210 40% 98%;
76
+ --primary: 217 91% 72%;
77
+ --primary-foreground: 222 47% 11%;
78
+ --secondary: 217 33% 17%;
79
+ --secondary-foreground: 210 40% 90%;
80
+ --muted: 217 33% 17%;
81
+ --muted-foreground: 215 20% 65%;
82
+ --accent: 217 33% 17%;
83
+ --accent-foreground: 210 40% 98%;
84
+ --destructive: 0 78% 67%;
85
+ --destructive-foreground: 0 0% 12%;
86
+ --border: 217 33% 20%;
87
+ --input: 217 33% 20%;
88
+ --ring: 217 91% 60%;
89
+ --success: 142 60% 50%;
90
+ --success-foreground: 142 80% 12%;
91
+ --warning: 38 95% 58%;
92
+ --warning-foreground: 38 92% 12%;
93
+
94
+ --canvas-backdrop: hsl(0 0% 10%);
95
+ }
@@ -1,3 +1,4 @@
1
+ import { a as FlowTrace, F as FlowSpan } from '../flow-types-Cb_AblZs.js';
1
2
  import { S as StepAgentActivity } from '../agent-activity-C8ZG0F0M.js';
2
3
 
3
4
  /**
@@ -154,23 +155,6 @@ interface TimedEvent {
154
155
  t: number;
155
156
  event: Record<string, unknown>;
156
157
  }
157
- interface FlowSpan {
158
- kind: 'pipeline' | 'model' | 'tool';
159
- name: string;
160
- startMs: number;
161
- endMs: number;
162
- approx?: boolean;
163
- meta?: Record<string, unknown>;
164
- }
165
- interface FlowTrace {
166
- spans: FlowSpan[];
167
- totalMs: number;
168
- promptTokens: number;
169
- completionTokens: number;
170
- /** Computed when per-token pricing is supplied. */
171
- costUsd?: number;
172
- toolCalls: number;
173
- }
174
158
  /** Parse stored turn-event lines (JSON strings with `_t`) into TimedEvents. */
175
159
  declare function timedEventsFromLines(lines: string[]): TimedEvent[];
176
160
  /**
@@ -204,4 +188,4 @@ declare function renderHistogram(values: number[], opts?: {
204
188
  format?: (v: number) => string;
205
189
  }): string;
206
190
 
207
- export { type DistributionSummary, type FlowSpan, type FlowTrace, type LoopTraceEventLike, type MissionFlowStep, type MissionTraceContext, type StepSpanContext, type TimedEvent, buildFlowTrace, childSpanContext, composeMissionFlowTrace, createMissionTraceContext, delegationActivityToFlowSpans, loopTraceEventsToFlowSpans, renderHistogram, renderWaterfall, stepActivityFlowTrace, summarize, timedEventsFromLines, traceEnv };
191
+ export { type DistributionSummary, FlowSpan, FlowTrace, type LoopTraceEventLike, type MissionFlowStep, type MissionTraceContext, type StepSpanContext, type TimedEvent, buildFlowTrace, childSpanContext, composeMissionFlowTrace, createMissionTraceContext, delegationActivityToFlowSpans, loopTraceEventsToFlowSpans, renderHistogram, renderWaterfall, stepActivityFlowTrace, summarize, timedEventsFromLines, traceEnv };
@@ -7,13 +7,13 @@ import {
7
7
  summarize,
8
8
  timedEventsFromLines,
9
9
  traceEnv
10
- } from "../chunk-5RT6KY4G.js";
10
+ } from "../chunk-GQRL6VNU.js";
11
11
  import {
12
12
  composeMissionFlowTrace,
13
13
  delegationActivityToFlowSpans,
14
14
  loopTraceEventsToFlowSpans,
15
15
  stepActivityFlowTrace
16
- } from "../chunk-AFDROJ64.js";
16
+ } from "../chunk-2QI7XV2T.js";
17
17
  export {
18
18
  buildFlowTrace,
19
19
  childSpanContext,
@@ -33,7 +33,18 @@ interface RateLimitResult {
33
33
  resetAt: number;
34
34
  }
35
35
  /** KV-backed sliding-window rate limit. Stores recent timestamps per key,
36
- * prunes the window, allows until `limit` is hit. */
36
+ * prunes the window, allows until `limit` is hit.
37
+ *
38
+ * Read-modify-write is best-effort, NOT atomic: KV has no compare-and-swap, so
39
+ * two requests racing on the same key can each read the same pre-state and both
40
+ * write — a concurrent burst can momentarily admit up to one extra request per
41
+ * racing writer. This is acceptable for coarse abuse limiting; it is NOT a hard
42
+ * quota gate.
43
+ *
44
+ * Fail-CLOSED on unreadable state: corrupt/non-array KV (a poisoned or
45
+ * truncated value) is treated as a full window, so a tampered key cannot reset
46
+ * the count and bypass the limiter. A bare `JSON.parse` here would throw and
47
+ * abort the request handler, silently disabling the limit (fail-open). */
37
48
  declare function checkRateLimit(kv: KvLike, key: string, limit: number, windowSeconds: number): Promise<RateLimitResult>;
38
49
  interface CookieOptions {
39
50
  name: string;
@@ -68,5 +79,17 @@ interface SecurityHeaderOptions {
68
79
  * referrer-policy, XSS) + optional product disclaimer/retention. The security
69
80
  * set is generic; the disclaimer/retention are the product's. */
70
81
  declare function addSecurityHeaders(response: Response, opts?: SecurityHeaderOptions): Response;
82
+ /**
83
+ * Canonical media-reference boundary shared by every surface that persists a
84
+ * media url (sequences clips, design-canvas image/video src). The ONE rule:
85
+ * remote `http(s)` or a rooted `/api/` path are allowed; everything else is
86
+ * rejected, with a named reason for known-bad local/inline schemes so the
87
+ * thrown message is actionable for an LLM planner. The url is trimmed before
88
+ * the scheme check so leading whitespace cannot smuggle a rejected scheme past
89
+ * a naive `startsWith`.
90
+ *
91
+ * @param what - noun for the error message (e.g. 'media url', 'src').
92
+ */
93
+ declare function assertMediaUrl(url: string, what?: string): void;
71
94
 
72
- export { type CookieOptions, type JsonObject, type KvLike, type RateLimitResult, type RequestContext, type SecurityHeaderOptions, addSecurityHeaders, checkRateLimit, clearCookieHeader, extractRequestContext, parseJsonObjectBody, readCookieValue, requireString, serializeCookie };
95
+ export { type CookieOptions, type JsonObject, type KvLike, type RateLimitResult, type RequestContext, type SecurityHeaderOptions, addSecurityHeaders, assertMediaUrl, checkRateLimit, clearCookieHeader, extractRequestContext, parseJsonObjectBody, readCookieValue, requireString, serializeCookie };
package/dist/web/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  addSecurityHeaders,
3
+ assertMediaUrl,
3
4
  checkRateLimit,
4
5
  clearCookieHeader,
5
6
  extractRequestContext,
@@ -7,9 +8,10 @@ import {
7
8
  readCookieValue,
8
9
  requireString,
9
10
  serializeCookie
10
- } from "../chunk-SCG5JJ4C.js";
11
+ } from "../chunk-HFC4BTWJ.js";
11
12
  export {
12
13
  addSecurityHeaders,
14
+ assertMediaUrl,
13
15
  checkRateLimit,
14
16
  clearCookieHeader,
15
17
  extractRequestContext,
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { S as StepAgentActivity } from '../agent-activity-C8ZG0F0M.js';
4
- import { FlowTrace } from '../trace/index.js';
5
- import { Harness } from '../harness/index.js';
4
+ import { a as FlowTrace } from '../flow-types-Cb_AblZs.js';
6
5
  import { C as CatalogModel } from '../model-catalog-BEAEVDaa.js';
6
+ import { Harness } from '../harness/index.js';
7
7
 
8
8
  /**
9
9
  * Client-side chat-stream consumption — the NDJSON parse loop every agent
@@ -248,8 +248,10 @@ declare function useSandboxTerminalConnection(opts: UseSandboxTerminalConnection
248
248
  interface SeatPaywallProps {
249
249
  /** Human product name shown in the headline, e.g. "Creative". */
250
250
  product: string;
251
- /** Fired when the user clicks the unlock CTA — route them to checkout. */
252
- onCheckout: () => void;
251
+ /** Fired when the user clicks the unlock CTA — route them to checkout. When
252
+ * it returns a promise the button shows a pending state and ignores repeat
253
+ * clicks until it settles (no double-charge on a slow checkout open). */
254
+ onCheckout: () => void | Promise<void>;
253
255
  /** Monthly seat price in whole dollars. Default 100. */
254
256
  priceUsd?: number;
255
257
  /** Included monthly AI usage in whole dollars. Default 50. */
@@ -266,6 +268,59 @@ interface SeatPaywallProps {
266
268
  */
267
269
  declare function SeatPaywall({ product, onCheckout, priceUsd, includedUsageUsd, tagline, ctaLabel, }: SeatPaywallProps): ReactNode;
268
270
 
271
+ /**
272
+ * Keyboard + pointer model for a trigger-and-popover pair, dependency-free.
273
+ * Outside-mousedown and Escape both close; Escape also returns focus to the
274
+ * trigger so keyboard users aren't dropped at the top of the document. The
275
+ * returned `triggerProps` carry the ARIA contract (`aria-haspopup`/
276
+ * `aria-expanded`); spread them onto the trigger button.
277
+ */
278
+ declare function usePopover(open: boolean, setOpen: (open: boolean) => void): {
279
+ containerRef: react.RefObject<HTMLDivElement | null>;
280
+ triggerRef: react.RefObject<HTMLButtonElement | null>;
281
+ triggerProps: {
282
+ ref: react.RefObject<HTMLButtonElement | null>;
283
+ 'aria-haspopup': true;
284
+ 'aria-expanded': boolean;
285
+ };
286
+ };
287
+ /**
288
+ * Guard an async action against double-submit. `run` ignores re-entrant calls
289
+ * while a promise is in flight and flips `pending` so the caller can disable
290
+ * the control — the fix for double-charge / double-approve on a slow network.
291
+ * Settles (success or throw) before clearing, and no-ops state updates after
292
+ * unmount.
293
+ */
294
+ declare function usePending(): {
295
+ pending: boolean;
296
+ run: (action: () => void | Promise<void>) => void;
297
+ };
298
+ interface ModelPickerProps {
299
+ value: string;
300
+ onChange: (id: string) => void;
301
+ /** Catalogue models — from `GET`ing the app's catalogue route (see
302
+ * `runtime/model-catalog`), plus any product-specific entries appended. */
303
+ models: CatalogModel[];
304
+ loading?: boolean;
305
+ /** Render a provider logo/badge; default is a generic sparkle. */
306
+ renderProviderBadge?: (provider: string) => ReactNode;
307
+ /** Section label for `featured` models. */
308
+ recommendedLabel?: string;
309
+ }
310
+ /**
311
+ * Searchable model picker pill + popover: a featured/recommended section
312
+ * first, then per-provider groups in catalogue order (the server already
313
+ * sorts providers by tier).
314
+ */
315
+ declare function ModelPicker({ value, onChange, models, loading, renderProviderBadge, recommendedLabel }: ModelPickerProps): react.JSX.Element;
316
+ interface EffortPickerProps {
317
+ value: string;
318
+ onChange: (id: string) => void;
319
+ }
320
+ /** Reasoning-effort selector pill, styled to match {@link ModelPicker}. Show
321
+ * it only when the selected model `supportsReasoning`. */
322
+ declare function EffortPicker({ value, onChange }: EffortPickerProps): react.JSX.Element;
323
+
269
324
  interface AgentSessionControlsProps {
270
325
  /** Catalog models — canonical provider-prefixed ids. */
271
326
  models: CatalogModel[];
@@ -304,31 +359,6 @@ interface ChatMessageMetrics {
304
359
  declare function formatModelCost(msg: ChatMessageMetrics, models: CatalogModel[]): string | null;
305
360
  /** "38 tok/s" from completion tokens over first-token→end duration; null when unknown. */
306
361
  declare function formatTokensPerSecond(msg: ChatMessageMetrics): string | null;
307
- interface ModelPickerProps {
308
- value: string;
309
- onChange: (id: string) => void;
310
- /** Catalogue models — from `GET`ing the app's catalogue route (see
311
- * `runtime/model-catalog`), plus any product-specific entries appended. */
312
- models: CatalogModel[];
313
- loading?: boolean;
314
- /** Render a provider logo/badge; default is a generic sparkle. */
315
- renderProviderBadge?: (provider: string) => ReactNode;
316
- /** Section label for `featured` models. */
317
- recommendedLabel?: string;
318
- }
319
- /**
320
- * Searchable model picker pill + popover: a featured/recommended section
321
- * first, then per-provider groups in catalogue order (the server already
322
- * sorts providers by tier).
323
- */
324
- declare function ModelPicker({ value, onChange, models, loading, renderProviderBadge, recommendedLabel }: ModelPickerProps): react.JSX.Element;
325
- interface EffortPickerProps {
326
- value: string;
327
- onChange: (id: string) => void;
328
- }
329
- /** Reasoning-effort selector pill, styled to match {@link ModelPicker}. Show
330
- * it only when the selected model `supportsReasoning`. */
331
- declare function EffortPicker({ value, onChange }: EffortPickerProps): react.JSX.Element;
332
362
  /** One step of a retained tool run (e.g. a sandbox command + its output). */
333
363
  interface ToolRunStep {
334
364
  at: string;
@@ -398,6 +428,16 @@ interface ChatMessagesProps {
398
428
  onToolCallClick?: (call: ChatToolCallInfo, message: ChatUiMessage) => void;
399
429
  /** Per-tool custom detail renderers for expanded tool cards. */
400
430
  toolRenderers?: ToolDetailRenderers;
431
+ /** Stream-error affordance: when the turn failed (a thrown transport error or
432
+ * a loop-level `onErrorEvent`), pass the message here to render an error row.
433
+ * A failed turn otherwise just stops with no UI signal. */
434
+ error?: string | null;
435
+ /** Retry control shown on the error row; omit to render the error without a
436
+ * retry button (e.g. when the product retries automatically). */
437
+ onRetry?: () => void;
438
+ /** Zero-state renderer, shown when there are no messages and the turn is
439
+ * neither loading nor errored. Omit to render nothing (current behavior). */
440
+ renderEmpty?: () => ReactNode;
401
441
  }
402
442
  interface ProposalApprovalHandlers {
403
443
  onApprove: (proposalId: string, toolCallId: string) => void | Promise<void>;
@@ -412,6 +452,6 @@ type ToolDetailRenderers = Record<string, (call: ChatToolCallInfo, message: Chat
412
452
  * model id, tokens/sec, and cost, plus a collapsible thinking section and
413
453
  * tool-call chips.
414
454
  */
415
- declare function ChatMessages({ messages, models, renderMarkdown, renderExtras, userLabel, agentLabel, loading, approval, onToolCallClick, toolRenderers, }: ChatMessagesProps): react.JSX.Element;
455
+ declare function ChatMessages({ messages, models, renderMarkdown, renderExtras, userLabel, agentLabel, loading, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, }: ChatMessagesProps): react.JSX.Element;
416
456
 
417
- export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, type ChatMessageMetrics, ChatMessages, type ChatMessagesProps, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ConsumeChatStreamResult, EffortPicker, type EffortPickerProps, FlowWaterfall, type FlowWaterfallProps, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type ProposalApprovalHandlers, ProviderLogo, type ProviderLogoProps, RunDrillIn, type RunDrillInProps, type SandboxTerminalConnection, type SandboxTerminalConnectionResponse, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type UseSandboxTerminalConnectionOptions, type UseSandboxTerminalConnectionResult, type WaterfallRow, activityTone, consumeChatStream, dispatchChatStreamLine, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, mergeActivityPages, nextRevealCount, pendingApprovalOf, streamChatTurn, useSandboxTerminalConnection, useSmoothText, waterfallLayout };
457
+ export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, type ChatMessageMetrics, ChatMessages, type ChatMessagesProps, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ConsumeChatStreamResult, EffortPicker, type EffortPickerProps, FlowWaterfall, type FlowWaterfallProps, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type ProposalApprovalHandlers, ProviderLogo, type ProviderLogoProps, RunDrillIn, type RunDrillInProps, type SandboxTerminalConnection, type SandboxTerminalConnectionResponse, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type UseSandboxTerminalConnectionOptions, type UseSandboxTerminalConnectionResult, type WaterfallRow, activityTone, consumeChatStream, dispatchChatStreamLine, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, mergeActivityPages, nextRevealCount, pendingApprovalOf, streamChatTurn, usePending, usePopover, useSandboxTerminalConnection, useSmoothText, waterfallLayout };