@wallarm-org/design-system 4.6.2 → 4.7.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 (69) hide show
  1. package/dist/components/AgentAvatar/AgentAvatar.d.ts +45 -0
  2. package/dist/components/AgentAvatar/AgentAvatar.js +544 -0
  3. package/dist/components/AgentAvatar/AgentAvatarGroup.d.ts +12 -0
  4. package/dist/components/AgentAvatar/AgentAvatarGroup.js +25 -0
  5. package/dist/components/AgentAvatar/index.d.ts +4 -0
  6. package/dist/components/AgentAvatar/index.js +3 -0
  7. package/dist/components/AgentAvatar/useBakedLayers.d.ts +9 -0
  8. package/dist/components/AgentAvatar/useBakedLayers.js +75 -0
  9. package/dist/components/AgentAvatar/useCharacter.d.ts +39 -0
  10. package/dist/components/AgentAvatar/useCharacter.js +251 -0
  11. package/dist/components/AgentGlyph/AgentGlyph.d.ts +30 -0
  12. package/dist/components/AgentGlyph/AgentGlyph.js +192 -0
  13. package/dist/components/AgentGlyph/index.d.ts +4 -0
  14. package/dist/components/AgentGlyph/index.js +2 -0
  15. package/dist/components/AgentLookBuilder/index.d.ts +3 -0
  16. package/dist/components/AgentLookBuilder/index.js +2 -0
  17. package/dist/components/AgentLookBuilder/kit.d.ts +36 -0
  18. package/dist/components/AgentLookBuilder/kit.js +30 -0
  19. package/dist/components/Chat/ChatGreeting.d.ts +1 -1
  20. package/dist/components/Chat/ChatGreeting.js +95 -44
  21. package/dist/components/Chat/ChatHeaderTitle.d.ts +1 -1
  22. package/dist/components/Chat/ChatHeaderTitle.js +32 -29
  23. package/dist/components/WallySkeleton/WallySkeleton.js +92 -71
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +2 -0
  26. package/dist/lib/agent-characters/bake.d.ts +40 -0
  27. package/dist/lib/agent-characters/bake.js +220 -0
  28. package/dist/lib/agent-characters/canvas.d.ts +7 -0
  29. package/dist/lib/agent-characters/canvas.js +22 -0
  30. package/dist/lib/agent-characters/char.d.ts +32 -0
  31. package/dist/lib/agent-characters/char.js +375 -0
  32. package/dist/lib/agent-characters/color.d.ts +6 -0
  33. package/dist/lib/agent-characters/color.js +20 -0
  34. package/dist/lib/agent-characters/data.gen.d.ts +106 -0
  35. package/dist/lib/agent-characters/data.gen.js +3854 -0
  36. package/dist/lib/agent-characters/engine.d.ts +206 -0
  37. package/dist/lib/agent-characters/engine.js +1241 -0
  38. package/dist/lib/agent-characters/eyes.d.ts +18 -0
  39. package/dist/lib/agent-characters/eyes.js +132 -0
  40. package/dist/lib/agent-characters/geom.d.ts +23 -0
  41. package/dist/lib/agent-characters/geom.js +109 -0
  42. package/dist/lib/agent-characters/glyph.d.ts +21 -0
  43. package/dist/lib/agent-characters/glyph.js +126 -0
  44. package/dist/lib/agent-characters/look.d.ts +24 -0
  45. package/dist/lib/agent-characters/look.js +68 -0
  46. package/dist/lib/agent-characters/motion.d.ts +73 -0
  47. package/dist/lib/agent-characters/motion.js +1215 -0
  48. package/dist/lib/agent-characters/paths.d.ts +13 -0
  49. package/dist/lib/agent-characters/paths.js +118 -0
  50. package/dist/lib/agent-characters/places.d.ts +76 -0
  51. package/dist/lib/agent-characters/places.js +64 -0
  52. package/dist/lib/agent-characters/propOf.d.ts +7 -0
  53. package/dist/lib/agent-characters/propOf.js +20 -0
  54. package/dist/lib/agent-characters/props.d.ts +4 -0
  55. package/dist/lib/agent-characters/props.js +337 -0
  56. package/dist/lib/agent-characters/queue.d.ts +23 -0
  57. package/dist/lib/agent-characters/queue.js +73 -0
  58. package/dist/lib/agent-characters/runtime.d.ts +69 -0
  59. package/dist/lib/agent-characters/runtime.js +178 -0
  60. package/dist/lib/agent-characters/svg.d.ts +6 -0
  61. package/dist/lib/agent-characters/svg.js +6 -0
  62. package/dist/lib/agent-characters/worker.d.ts +6 -0
  63. package/dist/lib/agent-characters/worker.js +94 -0
  64. package/dist/metadata/components.json +689 -276
  65. package/dist/theme/components/agent-avatar.css +42 -0
  66. package/dist/theme/index.css +1 -0
  67. package/dist/utils/renderSvgNode.d.ts +4 -0
  68. package/dist/utils/renderSvgNode.js +12 -0
  69. package/package.json +2 -1
@@ -0,0 +1,75 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import { bake, region, release, retain } from "../../lib/agent-characters/bake.js";
4
+ import { bakeSize } from "../../lib/agent-characters/char.js";
5
+ import { bakeInWorker } from "../../lib/agent-characters/worker.js";
6
+ const layerKey = (l)=>`${l.mat}|${l.col}|${l.d}`;
7
+ function useBakedLayers(layers, size, t0) {
8
+ const $ = c(9);
9
+ const run = void 0 === t0 ? bakeInWorker : t0;
10
+ let t1;
11
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
12
+ t1 = {};
13
+ $[0] = t1;
14
+ } else t1 = $[0];
15
+ const [baked, setBaked] = useState(t1);
16
+ let t2;
17
+ if ($[1] !== layers) {
18
+ t2 = layers.map(layerKey).join("\n");
19
+ $[1] = layers;
20
+ $[2] = t2;
21
+ } else t2 = $[2];
22
+ const signature = `${size}#${t2}`;
23
+ let t3;
24
+ if ($[3] !== layers || $[4] !== run || $[5] !== size) {
25
+ t3 = ()=>{
26
+ let alive = true;
27
+ const held = new Set();
28
+ const dpr = window.devicePixelRatio || 1;
29
+ const keys = new Set(layers.map(layerKey));
30
+ for (const l of layers){
31
+ let R;
32
+ try {
33
+ R = region(l.d)[2];
34
+ } catch {
35
+ continue;
36
+ }
37
+ const key = layerKey(l);
38
+ bake(l.d, l.col, bakeSize(R, size, dpr), l.mat, run).then(async (b)=>{
39
+ const img = new Image();
40
+ img.src = b.url;
41
+ await img.decode();
42
+ if (!alive) return;
43
+ retain(b.key);
44
+ held.add(b.key);
45
+ setBaked((prev)=>{
46
+ const next = {};
47
+ for (const [k, v] of Object.entries(prev))if (keys.has(k)) next[k] = v;
48
+ next[key] = b;
49
+ return next;
50
+ });
51
+ }).catch(_temp);
52
+ }
53
+ return ()=>{
54
+ alive = false;
55
+ for (const k_0 of held)release(k_0);
56
+ };
57
+ };
58
+ $[3] = layers;
59
+ $[4] = run;
60
+ $[5] = size;
61
+ $[6] = t3;
62
+ } else t3 = $[6];
63
+ let t4;
64
+ if ($[7] !== signature) {
65
+ t4 = [
66
+ signature
67
+ ];
68
+ $[7] = signature;
69
+ $[8] = t4;
70
+ } else t4 = $[8];
71
+ useEffect(t3, t4);
72
+ return baked;
73
+ }
74
+ function _temp() {}
75
+ export { layerKey, useBakedLayers };
@@ -0,0 +1,39 @@
1
+ import { type Ref, type RefObject } from 'react';
2
+ import type { AgentLook } from '../../lib/agent-characters/data.gen.js';
3
+ import { type Character } from '../../lib/agent-characters/engine.js';
4
+ import type { StateId } from '../../lib/agent-characters/eyes.js';
5
+ /** One-shot beats: they play in full, then the avatar shows `state` again (04 §5.2, D27). */
6
+ export type AgentAvatarBeat = 'hello' | 'done';
7
+ export interface AgentAvatarHandle {
8
+ /** Hello on drawer or chat open (from On duty only); Done when a run finishes. */
9
+ play(beat: AgentAvatarBeat): void;
10
+ /** «Cover all applications»: the crown fills to the top, then Done. */
11
+ coverAll(): void;
12
+ /** Hover or focus on Set up / Cover all (bound automatically when `cueRef` is set). */
13
+ cueHover(on: boolean): void;
14
+ }
15
+ /** Turns character motion on or off for the whole document (P7, a per-user setting; on by default). Reduced motion
16
+ * in the system settings turns it off as well. Off, every avatar shows its state's static frame. */
17
+ export declare const setAgentMotion: (enabled: boolean) => void;
18
+ /** Whether characters may move: the off switch and the system's reduced-motion setting, followed live. */
19
+ export declare function useAgentMotion(follow?: boolean): boolean;
20
+ /** states Done never plays from: Deactivated, Not set up, Inviting and the landing */
21
+ export declare const NO_DONE: Set<StateId>;
22
+ export interface CharacterParams {
23
+ look: Pick<AgentLook, 'shape' | 'color' | 'eyes' | 'prop'>;
24
+ size: number;
25
+ seed: string;
26
+ state: StateId;
27
+ cover: boolean;
28
+ cueRef?: RefObject<HTMLElement | null>;
29
+ onBeatEnd?: (beat: AgentAvatarBeat) => void;
30
+ /** the grey veil layers are needed: bake them */
31
+ requestVeil: () => void;
32
+ /** the runtime registry of neighbours, set by AgentAvatarGroup */
33
+ peers?: Set<Character>;
34
+ }
35
+ /**
36
+ * Drives the rendered character with the engine while mounted: one live character registered with the document
37
+ * runtime, disposed on unmount. React never re-renders for motion; state, coverage and beats go to the engine.
38
+ */
39
+ export declare function useCharacter(svgRef: RefObject<SVGSVGElement | null>, p: CharacterParams, handleRef?: Ref<AgentAvatarHandle>): void;
@@ -0,0 +1,251 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { useEffect, useImperativeHandle, useLayoutEffect, useRef, useSyncExternalStore } from "react";
3
+ import { createCharacter, joinPeers } from "../../lib/agent-characters/engine.js";
4
+ import { getRuntime } from "../../lib/agent-characters/runtime.js";
5
+ const setAgentMotion = (enabled)=>getRuntime().setMotionEnabled(enabled);
6
+ function useAgentMotion(t0) {
7
+ const $ = c(1);
8
+ const follow = void 0 === t0 ? true : t0;
9
+ let t1;
10
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
11
+ t1 = getRuntime();
12
+ $[0] = t1;
13
+ } else t1 = $[0];
14
+ const rt = t1;
15
+ return useSyncExternalStore(follow ? rt.subscribe : noSubscribe, rt.motionOn, _temp);
16
+ }
17
+ function _temp() {
18
+ return false;
19
+ }
20
+ const noSubscribe = ()=>()=>void 0;
21
+ function releaseCue(C, ch) {
22
+ C.off?.();
23
+ if (C.hv || C.fc) ch?.cueHover(false);
24
+ C.el = null;
25
+ C.off = null;
26
+ C.hv = C.fc = false;
27
+ }
28
+ const ACTIVE = new Set([
29
+ "idle",
30
+ "working",
31
+ "needs",
32
+ "failed"
33
+ ]);
34
+ const NO_DONE = new Set([
35
+ "off",
36
+ "box",
37
+ "invite",
38
+ "power"
39
+ ]);
40
+ function useCharacter(svgRef, p, handleRef) {
41
+ const $ = c(18);
42
+ const chRef = useRef(null);
43
+ const latest = useRef(p);
44
+ let t0;
45
+ if ($[0] !== p) {
46
+ t0 = ()=>{
47
+ latest.current = p;
48
+ };
49
+ $[0] = p;
50
+ $[1] = t0;
51
+ } else t0 = $[1];
52
+ useLayoutEffect(t0);
53
+ let t1;
54
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
55
+ t1 = {
56
+ beat: null,
57
+ recover: false
58
+ };
59
+ $[2] = t1;
60
+ } else t1 = $[2];
61
+ const run = useRef(t1);
62
+ let t2;
63
+ let t3;
64
+ if ($[3] !== svgRef) {
65
+ t2 = ()=>{
66
+ const svg = svgRef.current;
67
+ if (!svg) return;
68
+ const L = latest.current;
69
+ const R = run.current;
70
+ const ch = createCharacter(svg, L.look, {
71
+ size: L.size,
72
+ state: L.state,
73
+ live: true,
74
+ cover: L.cover,
75
+ salt: L.seed,
76
+ autoReturn: true,
77
+ cue: ()=>latest.current.cueRef?.current,
78
+ returnTo: ()=>latest.current.state,
79
+ onState: (st, from)=>{
80
+ if ("done" === st && "idle" === from) R.beat = "done";
81
+ if (st === from || "hello" !== from && "done" !== from || R.beat !== from) return;
82
+ R.beat = null;
83
+ if (R.recover) {
84
+ R.recover = false;
85
+ if (latest.current.cover) ch.setCover(true);
86
+ }
87
+ latest.current.onBeatEnd?.(from);
88
+ },
89
+ onCoverEnd: ()=>{
90
+ if ("done" === R.beat) R.recover = true;
91
+ else if (latest.current.cover) ch.setCover(true);
92
+ },
93
+ requestVeil: ()=>latest.current.requestVeil()
94
+ });
95
+ chRef.current = ch;
96
+ const leave = L.peers ? joinPeers(L.peers, ch) : void 0;
97
+ return ()=>{
98
+ ch.dispose();
99
+ chRef.current = null;
100
+ leave?.();
101
+ const cut = R.beat;
102
+ R.beat = null;
103
+ R.recover = false;
104
+ if (cut) latest.current.onBeatEnd?.(cut);
105
+ };
106
+ };
107
+ t3 = [
108
+ svgRef
109
+ ];
110
+ $[3] = svgRef;
111
+ $[4] = t2;
112
+ $[5] = t3;
113
+ } else {
114
+ t2 = $[4];
115
+ t3 = $[5];
116
+ }
117
+ useEffect(t2, t3);
118
+ let t4;
119
+ let t5;
120
+ if ($[6] !== p.state) {
121
+ t4 = ()=>{
122
+ const ch_0 = chRef.current;
123
+ if (!ch_0) return;
124
+ if ("hello" === ch_0.st || "done" === ch_0.st) return;
125
+ if (("box" === ch_0.st || "invite" === ch_0.st) && ACTIVE.has(p.state)) {
126
+ ch_0.setState("power");
127
+ ch_0.setState(p.state);
128
+ } else ch_0.setState(p.state);
129
+ };
130
+ t5 = [
131
+ p.state
132
+ ];
133
+ $[6] = p.state;
134
+ $[7] = t4;
135
+ $[8] = t5;
136
+ } else {
137
+ t4 = $[7];
138
+ t5 = $[8];
139
+ }
140
+ useEffect(t4, t5);
141
+ let t6;
142
+ let t7;
143
+ if ($[9] !== p.cover) {
144
+ t6 = ()=>{
145
+ const ch_1 = chRef.current;
146
+ if (!ch_1 || !p.cover && ch_1.filling) return;
147
+ ch_1.setCover(p.cover);
148
+ };
149
+ t7 = [
150
+ p.cover
151
+ ];
152
+ $[9] = p.cover;
153
+ $[10] = t6;
154
+ $[11] = t7;
155
+ } else {
156
+ t6 = $[10];
157
+ t7 = $[11];
158
+ }
159
+ useEffect(t6, t7);
160
+ let t8;
161
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
162
+ t8 = {
163
+ el: null,
164
+ off: null,
165
+ hv: false,
166
+ fc: false
167
+ };
168
+ $[12] = t8;
169
+ } else t8 = $[12];
170
+ const cue = useRef(t8);
171
+ let t9;
172
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
173
+ t9 = ()=>{
174
+ const el = latest.current.cueRef?.current ?? null;
175
+ const C = cue.current;
176
+ if (el === C.el) return;
177
+ releaseCue(C, chRef.current);
178
+ if (!el) return;
179
+ const up = ()=>chRef.current?.cueHover(C.hv || C.fc);
180
+ const enter = (e)=>{
181
+ if ("touch" === e.pointerType) return;
182
+ C.hv = true;
183
+ up();
184
+ };
185
+ const leave_0 = ()=>{
186
+ C.hv = false;
187
+ up();
188
+ };
189
+ const focusIn = ()=>{
190
+ C.fc = true;
191
+ up();
192
+ };
193
+ const focusOut = (e_0)=>{
194
+ C.fc = el.contains(e_0.relatedTarget);
195
+ up();
196
+ };
197
+ el.addEventListener("pointerenter", enter);
198
+ el.addEventListener("pointerleave", leave_0);
199
+ el.addEventListener("focusin", focusIn);
200
+ el.addEventListener("focusout", focusOut);
201
+ C.el = el;
202
+ C.off = ()=>{
203
+ el.removeEventListener("pointerenter", enter);
204
+ el.removeEventListener("pointerleave", leave_0);
205
+ el.removeEventListener("focusin", focusIn);
206
+ el.removeEventListener("focusout", focusOut);
207
+ };
208
+ };
209
+ $[13] = t9;
210
+ } else t9 = $[13];
211
+ useEffect(t9);
212
+ let t10;
213
+ let t11;
214
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
215
+ t10 = ()=>()=>releaseCue(cue.current, chRef.current);
216
+ t11 = [];
217
+ $[14] = t10;
218
+ $[15] = t11;
219
+ } else {
220
+ t10 = $[14];
221
+ t11 = $[15];
222
+ }
223
+ useEffect(t10, t11);
224
+ let t12;
225
+ let t13;
226
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
227
+ t12 = ()=>({
228
+ play (beat) {
229
+ const ch_2 = chRef.current;
230
+ if (!ch_2) return;
231
+ if ("hello" === beat) ch_2.greet();
232
+ else if (!NO_DONE.has(ch_2.st)) ch_2.setState("done");
233
+ if (ch_2.st === beat) run.current.beat = beat;
234
+ },
235
+ coverAll () {
236
+ chRef.current?.coverAll();
237
+ },
238
+ cueHover (on) {
239
+ chRef.current?.cueHover(on);
240
+ }
241
+ });
242
+ t13 = [];
243
+ $[16] = t12;
244
+ $[17] = t13;
245
+ } else {
246
+ t12 = $[16];
247
+ t13 = $[17];
248
+ }
249
+ useImperativeHandle(handleRef, t12, t13);
250
+ }
251
+ export { NO_DONE, setAgentMotion, useAgentMotion, useCharacter };
@@ -0,0 +1,30 @@
1
+ import type { FC, Ref, SVGProps } from 'react';
2
+ import type { AgentCharacterId, AgentLook } from '../../lib/agent-characters/data.gen.js';
3
+ import type { AgentGlyphSize } from '../../lib/agent-characters/places.js';
4
+ /** States a glyph draws statically. Hello and Done show their arcs; the glyph never animates. */
5
+ export type AgentGlyphState = 'idle' | 'hello' | 'working' | 'needs' | 'done' | 'failed' | 'off' | 'box' | 'invite';
6
+ type AgentGlyphLook = {
7
+ agent: AgentCharacterId;
8
+ look?: never;
9
+ } | {
10
+ look: AgentLook;
11
+ agent?: never;
12
+ };
13
+ export type AgentGlyphProps = Omit<SVGProps<SVGSVGElement>, 'ref' | 'children' | 'role' | 'tabIndex'> & AgentGlyphLook & {
14
+ ref?: Ref<SVGSVGElement>;
15
+ /** 16 beside text-xs, 20 beside text-sm or larger and in table rows (D3); 24 and 32 for other compact slots. */
16
+ size: AgentGlyphSize;
17
+ state?: AgentGlyphState;
18
+ /** The agent's template has applications (`applications_scoped`): only then can it show Partial coverage. */
19
+ hasApplications?: boolean;
20
+ /** `partial` draws the grey crown of Partial coverage, on duty only. */
21
+ coverage?: 'full' | 'partial';
22
+ /** `optical` lifts the body onto the text line (inline places); `box` keeps the box (ladders, stacks). */
23
+ align?: 'optical' | 'box';
24
+ };
25
+ /**
26
+ * An AI agent's character as a flat 16–32 px glyph: body, visor and eyes in the state's frame, plus a top-of-head
27
+ * prop. Static, with no canvas or animation code. Always decorative: place it next to the agent's visible name.
28
+ */
29
+ export declare const AgentGlyph: FC<AgentGlyphProps>;
30
+ export {};
@@ -0,0 +1,192 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as compiler_runtime_c } from "react/compiler-runtime";
3
+ import { CAST } from "../../lib/agent-characters/data.gen.js";
4
+ import { shapeOf } from "../../lib/agent-characters/geom.js";
5
+ import { glyphTree } from "../../lib/agent-characters/glyph.js";
6
+ import { defaultLook } from "../../lib/agent-characters/look.js";
7
+ import { cn } from "../../utils/cn.js";
8
+ import { renderSvgNode } from "../../utils/renderSvgNode.js";
9
+ const lookOf = (id)=>CAST.find((p)=>p.id === id) ?? defaultLook(id ?? "");
10
+ const AgentGlyph = (t0)=>{
11
+ const $ = compiler_runtime_c(55);
12
+ let agent;
13
+ let className;
14
+ let look;
15
+ let ref;
16
+ let rest;
17
+ let size;
18
+ let style;
19
+ let t1;
20
+ let t2;
21
+ let t3;
22
+ let t4;
23
+ if ($[0] !== t0) {
24
+ const { ref: t5, agent: t6, look: t7, size: t8, state: t9, hasApplications: t10, coverage: t11, align: t12, className: t13, style: t14, "aria-label": _label, "aria-labelledby": _labelledBy, ...t15 } = t0;
25
+ ref = t5;
26
+ agent = t6;
27
+ look = t7;
28
+ size = t8;
29
+ t1 = t9;
30
+ t2 = t10;
31
+ t3 = t11;
32
+ t4 = t12;
33
+ className = t13;
34
+ style = t14;
35
+ rest = t15;
36
+ $[0] = t0;
37
+ $[1] = agent;
38
+ $[2] = className;
39
+ $[3] = look;
40
+ $[4] = ref;
41
+ $[5] = rest;
42
+ $[6] = size;
43
+ $[7] = style;
44
+ $[8] = t1;
45
+ $[9] = t2;
46
+ $[10] = t3;
47
+ $[11] = t4;
48
+ } else {
49
+ agent = $[1];
50
+ className = $[2];
51
+ look = $[3];
52
+ ref = $[4];
53
+ rest = $[5];
54
+ size = $[6];
55
+ style = $[7];
56
+ t1 = $[8];
57
+ t2 = $[9];
58
+ t3 = $[10];
59
+ t4 = $[11];
60
+ }
61
+ const state = void 0 === t1 ? "idle" : t1;
62
+ const hasApplications = void 0 === t2 ? false : t2;
63
+ const coverage = void 0 === t3 ? "full" : t3;
64
+ const align = void 0 === t4 ? "optical" : t4;
65
+ const t5 = rest;
66
+ let props;
67
+ if ($[12] !== t5) {
68
+ const { role: _role, ...t6 } = t5;
69
+ props = t6;
70
+ $[12] = t5;
71
+ $[13] = props;
72
+ } else props = $[13];
73
+ let t6;
74
+ if ($[14] !== agent || $[15] !== look) {
75
+ t6 = look ?? lookOf(agent);
76
+ $[14] = agent;
77
+ $[15] = look;
78
+ $[16] = t6;
79
+ } else t6 = $[16];
80
+ const c = t6;
81
+ let t7;
82
+ if ($[17] !== c.shape) {
83
+ t7 = shapeOf(c.shape);
84
+ $[17] = c.shape;
85
+ $[18] = t7;
86
+ } else t7 = $[18];
87
+ const clipId = `agent-glyph-crown-${t7.id}`;
88
+ const partial = hasApplications && "partial" === coverage && "idle" === state;
89
+ let t10;
90
+ let t11;
91
+ let t12;
92
+ let t13;
93
+ let t14;
94
+ let t15;
95
+ let t16;
96
+ let t17;
97
+ let t18;
98
+ let t19;
99
+ let t8;
100
+ let t9;
101
+ if ($[19] !== agent || $[20] !== align || $[21] !== c || $[22] !== className || $[23] !== clipId || $[24] !== partial || $[25] !== props || $[26] !== ref || $[27] !== size || $[28] !== state || $[29] !== style) {
102
+ const t = glyphTree(c, size, partial ? "partly" : state, clipId);
103
+ const optical = "optical" === align;
104
+ t8 = props;
105
+ t9 = ref;
106
+ t10 = "agent-glyph";
107
+ t11 = agent;
108
+ t12 = state;
109
+ t13 = "-8 -14 136 128";
110
+ t14 = t.width;
111
+ t15 = t.height;
112
+ t16 = "true";
113
+ t17 = cn("block shrink-0", optical && "translate-y-[var(--oy)]", t.opacity && "opacity-55", className);
114
+ t18 = optical ? {
115
+ "--oy": `${t.oy}px`,
116
+ ...style
117
+ } : style;
118
+ t19 = t.children.map(_temp);
119
+ $[19] = agent;
120
+ $[20] = align;
121
+ $[21] = c;
122
+ $[22] = className;
123
+ $[23] = clipId;
124
+ $[24] = partial;
125
+ $[25] = props;
126
+ $[26] = ref;
127
+ $[27] = size;
128
+ $[28] = state;
129
+ $[29] = style;
130
+ $[30] = t10;
131
+ $[31] = t11;
132
+ $[32] = t12;
133
+ $[33] = t13;
134
+ $[34] = t14;
135
+ $[35] = t15;
136
+ $[36] = t16;
137
+ $[37] = t17;
138
+ $[38] = t18;
139
+ $[39] = t19;
140
+ $[40] = t8;
141
+ $[41] = t9;
142
+ } else {
143
+ t10 = $[30];
144
+ t11 = $[31];
145
+ t12 = $[32];
146
+ t13 = $[33];
147
+ t14 = $[34];
148
+ t15 = $[35];
149
+ t16 = $[36];
150
+ t17 = $[37];
151
+ t18 = $[38];
152
+ t19 = $[39];
153
+ t8 = $[40];
154
+ t9 = $[41];
155
+ }
156
+ let t20;
157
+ if ($[42] !== t10 || $[43] !== t11 || $[44] !== t12 || $[45] !== t13 || $[46] !== t14 || $[47] !== t15 || $[48] !== t16 || $[49] !== t17 || $[50] !== t18 || $[51] !== t19 || $[52] !== t8 || $[53] !== t9) {
158
+ t20 = /*#__PURE__*/ jsx("svg", {
159
+ ...t8,
160
+ ref: t9,
161
+ "data-slot": t10,
162
+ "data-agent": t11,
163
+ "data-state": t12,
164
+ viewBox: t13,
165
+ width: t14,
166
+ height: t15,
167
+ "aria-hidden": t16,
168
+ className: t17,
169
+ style: t18,
170
+ children: t19
171
+ });
172
+ $[42] = t10;
173
+ $[43] = t11;
174
+ $[44] = t12;
175
+ $[45] = t13;
176
+ $[46] = t14;
177
+ $[47] = t15;
178
+ $[48] = t16;
179
+ $[49] = t17;
180
+ $[50] = t18;
181
+ $[51] = t19;
182
+ $[52] = t8;
183
+ $[53] = t9;
184
+ $[54] = t20;
185
+ } else t20 = $[54];
186
+ return t20;
187
+ };
188
+ AgentGlyph.displayName = "AgentGlyph";
189
+ function _temp(n, i) {
190
+ return renderSvgNode(n, i);
191
+ }
192
+ export { AgentGlyph };
@@ -0,0 +1,4 @@
1
+ export type { AgentCharacterId, AgentColorId, AgentEyeStyle, AgentLook, AgentPropId, AgentShapeId, } from '../../lib/agent-characters/data.gen.js';
2
+ export { defaultLook } from '../../lib/agent-characters/look.js';
3
+ export type { AgentGlyphSize } from '../../lib/agent-characters/places.js';
4
+ export { AgentGlyph, type AgentGlyphProps, type AgentGlyphState } from './AgentGlyph.js';
@@ -0,0 +1,2 @@
1
+ export { defaultLook } from "../../lib/agent-characters/look.js";
2
+ export { AgentGlyph } from "./AgentGlyph.js";
@@ -0,0 +1,3 @@
1
+ export type { AgentColorId, AgentEyeStyle, AgentLook, AgentPropId, AgentShapeId, } from '../../lib/agent-characters/data.gen.js';
2
+ export { defaultLook, type LookIssue, type LookIssueCode, lookIssues, } from '../../lib/agent-characters/look.js';
3
+ export { AGENT_COLORS, AGENT_EYES, AGENT_PROPS, AGENT_SHAPES, type AgentColorOption, type AgentEyeOption, type AgentPropOption, type AgentShapeOption, enableAgentLookLibrary, } from './kit.js';
@@ -0,0 +1,2 @@
1
+ export { defaultLook, lookIssues } from "../../lib/agent-characters/look.js";
2
+ export { AGENT_COLORS, AGENT_EYES, AGENT_PROPS, AGENT_SHAPES, enableAgentLookLibrary } from "./kit.js";
@@ -0,0 +1,36 @@
1
+ import { type AgentColorDef, type AgentColorId, type AgentEyeStyle, type AgentPropId, type AgentShapeId } from '../../lib/agent-characters/data.gen.js';
2
+ /**
3
+ * Loads the full prop library (15 props on any shape) for every DS copy on the page. Any app that renders stored
4
+ * custom looks calls it once at start-up — the cards, rows and tables that show them, not only the picker.
5
+ * Without it only the six presets' props are drawn. Mounted glyphs pick it up on their next render; a mounted 3D
6
+ * character keeps what it drew until its look changes or it remounts, so call it before the first render.
7
+ */
8
+ export declare function enableAgentLookLibrary(): void;
9
+ export interface AgentShapeOption {
10
+ id: AgentShapeId;
11
+ name: string;
12
+ family: 'soft' | 'object';
13
+ }
14
+ export interface AgentColorOption {
15
+ id: AgentColorId;
16
+ name: string;
17
+ hex: string;
18
+ group: AgentColorDef['g'];
19
+ /** Wally's coral: never offered to other agents (D22) */
20
+ brand?: true;
21
+ }
22
+ export interface AgentEyeOption {
23
+ id: AgentEyeStyle;
24
+ name: string;
25
+ }
26
+ export interface AgentPropOption {
27
+ id: AgentPropId;
28
+ name: string;
29
+ /** drawn at glyph sizes (16–32 px); the others show only on the 3D character */
30
+ glyph: boolean;
31
+ }
32
+ export declare const AGENT_SHAPES: readonly AgentShapeOption[];
33
+ /** The full palette. Filter `brand` (coral, Wally only) out of pickers (D22). */
34
+ export declare const AGENT_COLORS: readonly AgentColorOption[];
35
+ export declare const AGENT_EYES: readonly AgentEyeOption[];
36
+ export declare const AGENT_PROPS: readonly AgentPropOption[];
@@ -0,0 +1,30 @@
1
+ import { COLORS, EYE_STYLES, GLYPH_PROPS, PROPS, SHAPES } from "../../lib/agent-characters/data.gen.js";
2
+ import { setPropLibrary } from "../../lib/agent-characters/propOf.js";
3
+ import { propDef } from "../../lib/agent-characters/props.js";
4
+ function enableAgentLookLibrary() {
5
+ setPropLibrary(propDef);
6
+ }
7
+ const AGENT_SHAPES = SHAPES.map((s)=>({
8
+ id: s.id,
9
+ name: s.name,
10
+ family: s.fam
11
+ }));
12
+ const AGENT_COLORS = COLORS.map((c)=>({
13
+ id: c.id,
14
+ name: c.name,
15
+ hex: c.hex,
16
+ group: c.g,
17
+ ...c.brand ? {
18
+ brand: true
19
+ } : {}
20
+ }));
21
+ const AGENT_EYES = EYE_STYLES.map((id)=>({
22
+ id,
23
+ name: id[0]?.toUpperCase() + id.slice(1)
24
+ }));
25
+ const AGENT_PROPS = PROPS.map(([id, name])=>({
26
+ id,
27
+ name,
28
+ glyph: GLYPH_PROPS.has(id)
29
+ }));
30
+ export { AGENT_COLORS, AGENT_EYES, AGENT_PROPS, AGENT_SHAPES, enableAgentLookLibrary };
@@ -2,7 +2,7 @@ import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
2
2
  import { type TestableProps } from '../../utils/testId.js';
3
3
  export interface ChatGreetingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, TestableProps {
4
4
  ref?: Ref<HTMLDivElement>;
5
- /** Heading under the Wally mark, e.g. "How can I help you today?". */
5
+ /** Heading under Wally, e.g. "How can I help you today?". */
6
6
  title: ReactNode;
7
7
  }
8
8
  export declare const ChatGreeting: FC<ChatGreetingProps>;