@guuey/chat 0.15.0 → 0.16.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.
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +10 -1
- package/dist/policy.d.ts +8 -0
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +2 -1
- package/dist/react/components.d.ts.map +1 -1
- package/dist/react/components.js +5 -0
- package/dist/react/guuey-chat.d.ts +21 -0
- package/dist/react/guuey-chat.d.ts.map +1 -1
- package/dist/react/guuey-chat.js +46 -2
- package/dist/react/use-transcript.d.ts.map +1 -1
- package/dist/react/use-transcript.js +20 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/strings.d.ts +5 -0
- package/dist/strings.d.ts.map +1 -1
- package/dist/strings.js +1 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/corpus/__snapshots__/corpus.test.ts.snap +25 -0
- package/src/plan.ts +11 -1
- package/src/policy.ts +13 -2
- package/src/react/components.tsx +27 -0
- package/src/react/guuey-chat.tsx +69 -1
- package/src/react/use-transcript.ts +20 -2
- package/src/react.tsx +6 -1
- package/src/strings.ts +6 -0
- package/src/types.ts +25 -1
package/dist/plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAkCA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,KAAK,EAUV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAIf,MAAM,YAAY,CAAC;AA2pBpB,uCAAuC;AACvC,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,EACxB,SAAS,GAAE,mBAAwB,GAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAkCA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,KAAK,EAUV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAIf,MAAM,YAAY,CAAC;AA2pBpB,uCAAuC;AACvC,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,EACxB,SAAS,GAAE,mBAAwB,GAClC,cAAc,CAwVhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,cAAc,CAAC,GACxD;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,GAAG,SAAS,CAiB5D"}
|
package/dist/plan.js
CHANGED
|
@@ -700,13 +700,22 @@ export function planTranscript(inputs, policy, overrides = {}) {
|
|
|
700
700
|
const sendState = user.clientMessageId !== undefined
|
|
701
701
|
? (inputs.sendStates?.[user.clientMessageId] ?? "sent")
|
|
702
702
|
: "sent";
|
|
703
|
+
// guuey#422 close-condition 3: a forwarded view directive (the
|
|
704
|
+
// `ui/message` doorbell's `<ggui_directive>` carrier, relayed through
|
|
705
|
+
// the composer's send gate) collapses into a calm continuation row.
|
|
706
|
+
// DISPLAY-ONLY — `text` stays wire-verbatim (expand reveals it); the
|
|
707
|
+
// wire itself was never touched. Marker matches ggui's runtime
|
|
708
|
+
// construction (`<ggui_directive kind="user-action">` inside the
|
|
709
|
+
// relayed prose).
|
|
710
|
+
const directive = policy.userMessage.collapseDirectives && user.text.includes("<ggui_directive");
|
|
703
711
|
conversation.push({
|
|
704
712
|
kind: "user",
|
|
705
713
|
key,
|
|
706
|
-
expanded:
|
|
714
|
+
expanded: resolveExpanded(key, !directive, overrides),
|
|
707
715
|
text: user.text,
|
|
708
716
|
state: sendState,
|
|
709
717
|
retry: sendState === "failed" && policy.userMessage.retryAffordance,
|
|
718
|
+
directive,
|
|
710
719
|
});
|
|
711
720
|
}
|
|
712
721
|
const assistant = assistants[slot];
|
package/dist/policy.d.ts
CHANGED
|
@@ -20,6 +20,14 @@ export interface TranscriptPolicy {
|
|
|
20
20
|
/** R0. */
|
|
21
21
|
userMessage: {
|
|
22
22
|
retryAffordance: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Collapse forwarded view-directive turns (guuey#422 `ui/message`
|
|
25
|
+
* relays carrying `<ggui_directive>`) into a calm
|
|
26
|
+
* `strings.directiveContinuation` row. Display-only — the sent/
|
|
27
|
+
* persisted text stays wire-verbatim, and expand reveals it. Debug
|
|
28
|
+
* preset shows the verbatim bubble (`false`).
|
|
29
|
+
*/
|
|
30
|
+
collapseDirectives: boolean;
|
|
23
31
|
};
|
|
24
32
|
/** R1 (markdown sanitization itself is the 3b renderer's security surface). */
|
|
25
33
|
text: {
|
package/dist/policy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtF,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,OAAO,EAAE,WAAW,CAAC;IACrB,gFAAgF;IAChF,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU;IACV,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,cAA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38
|
debugDetail: false,
|
|
39
|
-
userMessage: { retryAffordance: true },
|
|
39
|
+
userMessage: { retryAffordance: true, collapseDirectives: true },
|
|
40
40
|
text: { markdown: true },
|
|
41
41
|
reasoning: { show: true, expandedByDefault: false },
|
|
42
42
|
tool: { expandByDefault: false, argsVisible: false, humanizeTitle: humanizeToolName },
|
|
@@ -64,6 +64,7 @@ export function debugPolicy(overrides) {
|
|
|
64
64
|
const debug = {
|
|
65
65
|
...base,
|
|
66
66
|
debugDetail: true,
|
|
67
|
+
userMessage: { ...base.userMessage, collapseDirectives: false },
|
|
67
68
|
reasoning: { ...base.reasoning, expandedByDefault: true },
|
|
68
69
|
tool: { ...base.tool, expandByDefault: true, argsVisible: true },
|
|
69
70
|
toolGroup: { threshold: false },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/react/components.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,QAAQ,EACR,WAAW,EACX,eAAe,EACf,QAAQ,EACR,aAAa,EACb,WAAW,EACZ,MAAM,aAAa,CAAC;AAGrB,yDAAyD;AACzD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,WAAW,CAAC;IACrB,wEAAwE;IACx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U,CAAC,CAAC,CAAC;IAC7C,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3C,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACvD,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IACrD,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,2BAA2B,EAAE,oBAmBzC,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,oBAAoB,EAChC,GAAG,EAAE,qBAAqB,GACzB,SAAS,CAuEX"}
|
package/dist/react/components.js
CHANGED
|
@@ -42,6 +42,11 @@ function CopyButton({ text, ctx }) {
|
|
|
42
42
|
}
|
|
43
43
|
// ─── R0 ────────────────────────────────────────────────────────────────────
|
|
44
44
|
export function DefaultUserMessage({ item, ctx }) {
|
|
45
|
+
// guuey#422: a forwarded view directive renders as a calm continuation
|
|
46
|
+
// row — the wire-verbatim text sits behind the expand, never rewritten.
|
|
47
|
+
if (item.directive) {
|
|
48
|
+
return (_jsxs("div", { className: `guuey-chat-user guuey-chat-user-directive guuey-chat-user-${item.state}`, children: [_jsx(Collapsible, { itemKey: item.key, expanded: item.expanded, header: _jsx("span", { className: "guuey-chat-directive-label", children: ctx.strings.directiveContinuation }), ctx: ctx, children: _jsx("div", { className: "guuey-chat-user-bubble", children: item.text }) }), item.state === "failed" ? (_jsxs("p", { className: "guuey-chat-send-failed", role: "status", children: [ctx.strings.userCouldntSend, item.retry ? (_jsx("button", { type: "button", className: "guuey-chat-retry", onClick: () => ctx.onRetry?.(item), children: ctx.strings.userRetry })) : null] })) : null] }));
|
|
49
|
+
}
|
|
45
50
|
return (_jsxs("div", { className: `guuey-chat-user guuey-chat-user-${item.state}`, children: [_jsx("div", { className: "guuey-chat-user-bubble", children: item.text }), item.state === "failed" ? (_jsxs("p", { className: "guuey-chat-send-failed", role: "status", children: [ctx.strings.userCouldntSend, item.retry ? (_jsx("button", { type: "button", className: "guuey-chat-retry", onClick: () => ctx.onRetry?.(item), children: ctx.strings.userRetry })) : null] })) : null] }));
|
|
46
51
|
}
|
|
47
52
|
// ─── R1 ────────────────────────────────────────────────────────────────────
|
|
@@ -68,6 +68,15 @@ export declare function viewPropsWithThemeAnnounce(viewProps: TranscriptItemCont
|
|
|
68
68
|
* being the filing use case). Reach it via `ref` or `onReady` — both
|
|
69
69
|
* deliver the SAME stable object, valid for the component's whole life.
|
|
70
70
|
*/
|
|
71
|
+
/**
|
|
72
|
+
* One turn-lifecycle edge (guuey#403): `submit` = a turn left `ready`;
|
|
73
|
+
* `settled` = the invoke returned to `ready`. Mirrored structurally by
|
|
74
|
+
* `@guuey/agent-layout`'s `GuueyChatActivityEventShape` — keep the two in
|
|
75
|
+
* sync (the fs-contract mirror discipline).
|
|
76
|
+
*/
|
|
77
|
+
export interface GuueyChatActivityEvent {
|
|
78
|
+
type: "submit" | "settled";
|
|
79
|
+
}
|
|
71
80
|
export interface GuueyChatHandle {
|
|
72
81
|
/**
|
|
73
82
|
* Send `text` through exactly the Send button's gate: returns `false`
|
|
@@ -200,6 +209,18 @@ export interface GuueyChatProps {
|
|
|
200
209
|
onOAuthAuthorize?: (href: string, ask: AgPausedAsk) => void;
|
|
201
210
|
/** R11 action slot (sign-in / retry affordances). */
|
|
202
211
|
onErrorAction?: (item: ErrorItem) => void;
|
|
212
|
+
/**
|
|
213
|
+
* Turn-lifecycle notifications (guuey#403 — the agent-layout bridge's
|
|
214
|
+
* seam, though any host may listen): `submit` fires when a turn this
|
|
215
|
+
* surface started leaves `ready` — composer, `handle.send`, and the
|
|
216
|
+
* `ui/message` doorbell paths alike (the busy transition IS the truth:
|
|
217
|
+
* gate-refused sends never fire) — and `settled` when the invoke
|
|
218
|
+
* returns to `ready` (success, error, and abort all settle). Discrete
|
|
219
|
+
* per-turn edges only, NEVER per-token — safe to wire into layout
|
|
220
|
+
* state. `@guuey/agent-layout` mirrors {@link GuueyChatActivityEvent}
|
|
221
|
+
* structurally (its `bind.ts` — sync comment there points here).
|
|
222
|
+
*/
|
|
223
|
+
onActivity?: (event: GuueyChatActivityEvent) => void;
|
|
203
224
|
/**
|
|
204
225
|
* Callback route to the {@link GuueyChatHandle} for hosts that prefer
|
|
205
226
|
* wiring over refs. Fires ONCE per component instance, on mount, with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guuey-chat.d.ts","sourceRoot":"","sources":["../../src/react/guuey-chat.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EASL,KAAK,aAAa,EAEnB,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGtE,OAAO,KAAK,EAAsC,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAA2B,KAAK,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEvF,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,eAAe,EACf,UAAU,EAEV,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MA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;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAQD,eAAO,MAAM,SAAS,4GA6gBpB,CAAC"}
|
package/dist/react/guuey-chat.js
CHANGED
|
@@ -85,7 +85,7 @@ const PROMPT_STATE = {
|
|
|
85
85
|
dismiss: "dismissed",
|
|
86
86
|
};
|
|
87
87
|
export const GuueyChat = forwardRef(function GuueyChat(props, ref) {
|
|
88
|
-
const { endpointUrl, appId, apiBaseUrl, getAccessToken, getGuestSecret, adapters: adaptersProp, preset = "calm", policy: policyOverrides, components, strings: stringOverrides, theme = DEFAULT_CHAT_THEME, mode = "light", window: windowing, reader, onDebugEvent, viewProps, promotedViewKey, onViewRef, onViewsChange, onPromptAction, onHitlAnswer, oauthReturnTo, onOAuthAuthorize, onErrorAction, onReady, onThread, className, style, } = props;
|
|
88
|
+
const { endpointUrl, appId, apiBaseUrl, getAccessToken, getGuestSecret, adapters: adaptersProp, preset = "calm", policy: policyOverrides, components, strings: stringOverrides, theme = DEFAULT_CHAT_THEME, mode = "light", window: windowing, reader, onDebugEvent, viewProps, promotedViewKey, onViewRef, onViewsChange, onPromptAction, onHitlAnswer, oauthReturnTo, onOAuthAuthorize, onErrorAction, onActivity, onReady, onThread, className, style, } = props;
|
|
89
89
|
// Identity stabilization (guuey#303 QA — the template's own chat-rail
|
|
90
90
|
// shipped the failure): hosts pass inline literals and arrows, so prop
|
|
91
91
|
// IDENTITY is noise. The getter props route through refs (presence, not
|
|
@@ -275,6 +275,15 @@ export const GuueyChat = forwardRef(function GuueyChat(props, ref) {
|
|
|
275
275
|
// real turn starts, the agent calls ggui_consume, the card repaints.
|
|
276
276
|
// Busy/unavailable ⇒ dropped (the doorbell fires post-turn by design;
|
|
277
277
|
// mid-turn the consume pipe is live and no doorbell fires).
|
|
278
|
+
// guuey#422 close-condition 1 (ggui review): the machine ACKs the
|
|
279
|
+
// doorbell BEFORE delivery, so a busy-drop here would be an
|
|
280
|
+
// ACKed-then-silently-dropped message — the night's silence class in
|
|
281
|
+
// protocol clothes. Queue-and-drain instead: while a turn is live the
|
|
282
|
+
// directive queues (exact-text dedupe — a session's repeat doorbells
|
|
283
|
+
// collapse; the consume PIPE holds the gestures, the doorbell only
|
|
284
|
+
// wakes), and the idle transition drains one per turn. Unavailable chat
|
|
285
|
+
// cannot drain — that drop is LOUD (console.warn), never silent.
|
|
286
|
+
const pendingDoorbellsRef = useRef([]);
|
|
278
287
|
const defaultOnUserMessage = useCallback((params) => {
|
|
279
288
|
const content = params["content"];
|
|
280
289
|
if (!Array.isArray(content))
|
|
@@ -288,12 +297,47 @@ export const GuueyChat = forwardRef(function GuueyChat(props, ref) {
|
|
|
288
297
|
if (text.trim() === "")
|
|
289
298
|
return;
|
|
290
299
|
const live = liveRef.current;
|
|
291
|
-
if (!live.available
|
|
300
|
+
if (!live.available) {
|
|
301
|
+
console.warn("[GuueyChat] ui/message doorbell dropped — chat is unavailable (endpointUrl null); the view's gesture cannot start a turn here.");
|
|
292
302
|
return;
|
|
303
|
+
}
|
|
304
|
+
if (live.busy) {
|
|
305
|
+
if (!pendingDoorbellsRef.current.includes(text))
|
|
306
|
+
pendingDoorbellsRef.current.push(text);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
293
309
|
void live.invoke.send(text).catch(() => {
|
|
294
310
|
// The hook owns failure surfacing, same as every send path.
|
|
295
311
|
});
|
|
296
312
|
}, []);
|
|
313
|
+
// guuey#403: the turn-lifecycle edges. The busy TRANSITION is the one
|
|
314
|
+
// truthful seam every send path crosses (composer, handle, doorbell,
|
|
315
|
+
// drain, retry) and gate-refused sends never do; status leaves `ready`
|
|
316
|
+
// only via a real send (hydration and history reads never touch it).
|
|
317
|
+
const onActivityRef = useRef(onActivity);
|
|
318
|
+
onActivityRef.current = onActivity;
|
|
319
|
+
const prevBusyRef = useRef(busy);
|
|
320
|
+
useEffect(() => {
|
|
321
|
+
if (prevBusyRef.current === busy)
|
|
322
|
+
return;
|
|
323
|
+
prevBusyRef.current = busy;
|
|
324
|
+
onActivityRef.current?.({ type: busy ? "submit" : "settled" });
|
|
325
|
+
}, [busy]);
|
|
326
|
+
// The drain: one queued doorbell per idle transition — its send flips
|
|
327
|
+
// busy again, and the NEXT idle drains the next (never a turn storm).
|
|
328
|
+
useEffect(() => {
|
|
329
|
+
if (busy || pendingDoorbellsRef.current.length === 0)
|
|
330
|
+
return;
|
|
331
|
+
const next = pendingDoorbellsRef.current.shift();
|
|
332
|
+
if (next === undefined)
|
|
333
|
+
return;
|
|
334
|
+
const live = liveRef.current;
|
|
335
|
+
if (!live.available) {
|
|
336
|
+
console.warn("[GuueyChat] queued ui/message doorbell dropped — chat became unavailable.");
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
void live.invoke.send(next).catch(() => { });
|
|
340
|
+
}, [busy]);
|
|
297
341
|
const effectiveViewProps = useMemo(() => viewPropsWithThemeAnnounce(viewProps, mode, {
|
|
298
342
|
...(stagedDefaultOnCallTool !== undefined ? { onCallTool: stagedDefaultOnCallTool } : {}),
|
|
299
343
|
onUpdateModelContext: defaultOnUpdateModelContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-transcript.d.ts","sourceRoot":"","sources":["../../src/react/use-transcript.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAEL,KAAK,iBAAi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ACb,EAAE,iBAAiB,GAAG,mBAAmB,CA0JzC;AAID,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,gBAAgB,CAAC;IACzB;;;;;OAKG;IACH,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,KAAK,IAAI,CAAC;IAClF;;;;;;;;OAQG;IACH,gBAAgB,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,KAAK,YAAY,CAAC;CAChF;AAKD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,yBAAyB,CAsH3F"}
|
|
@@ -143,7 +143,26 @@ export function useTranscript({ inputs, policy, reader, onDebugEvent, }) {
|
|
|
143
143
|
}
|
|
144
144
|
// guuey#421: the roster knows a card's origin — a history card's
|
|
145
145
|
// locator skips the pod door (it 404s by construction there).
|
|
146
|
-
|
|
146
|
+
// guuey#408: a WIRED reader's miss additionally says WHICH uri went
|
|
147
|
+
// unread (fail-loud on the debug channel — a never-working transport
|
|
148
|
+
// must not vanish into placeholders). The reader-less arm above
|
|
149
|
+
// stays silent: no read happened, nothing failed.
|
|
150
|
+
const loudMiss = () => {
|
|
151
|
+
debugSink.current?.({
|
|
152
|
+
type: "locator-read-miss",
|
|
153
|
+
key: item.key,
|
|
154
|
+
resourceUri: locator.resourceUri,
|
|
155
|
+
origin: item.origin,
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
void resolveViewMount(locator, read, { origin: item.origin }).then((resolved) => {
|
|
159
|
+
if (resolved === undefined)
|
|
160
|
+
loudMiss();
|
|
161
|
+
settle(resolved ?? "expired");
|
|
162
|
+
}, () => {
|
|
163
|
+
loudMiss();
|
|
164
|
+
settle("expired");
|
|
165
|
+
});
|
|
147
166
|
}
|
|
148
167
|
}, [plan, resolvedMounts]);
|
|
149
168
|
return { plan, toggle, overrides, onViewPhase, onViewDiagnosis, resolvedMounts };
|
package/dist/react.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export { Transcript, type TranscriptProps, type TranscriptWindowing, } from "./react/transcript.js";
|
|
16
16
|
export { defaultTranscriptComponents, renderItem, DefaultUserMessage, DefaultText, DefaultReasoning, DefaultTool, DefaultToolGroup, DefaultDataResult, DefaultView, DefaultViewRef, DefaultMedia, DefaultCode, DefaultCitations, DefaultPrompt, DefaultError, DefaultHistoryBoundary, DefaultCompaction, DefaultUnknown, DefaultStatus, type TranscriptComponents, type TranscriptItemContext, type ViewSlotProps, } from "./react/components.js";
|
|
17
17
|
export { useTranscript, useTranscriptInputs, type UseTranscriptArgs, type UseTranscriptResult, type UseTranscriptInputsResult, } from "./react/use-transcript.js";
|
|
18
|
-
export { GuueyChat, type GuueyChatProps, type GuueyChatHandle } from "./react/guuey-chat.js";
|
|
18
|
+
export { GuueyChat, type GuueyChatActivityEvent, type GuueyChatProps, type GuueyChatHandle, } from "./react/guuey-chat.js";
|
|
19
19
|
export { oauthPromptAction, oauthReturnToHere, openOAuthAuthorize, useOAuthReturn, type OAuthPromptActionArgs, type OAuthWindow, type UseOAuthReturnResult, } from "./react/oauth-return.js";
|
|
20
20
|
export { Markdown } from "./react/markdown.js";
|
|
21
21
|
export { themeCssVars, type ThemeMode } from "./react/theme-css.js";
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,oBAAoB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/react.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export { Transcript, } from "./react/transcript.js";
|
|
16
16
|
export { defaultTranscriptComponents, renderItem, DefaultUserMessage, DefaultText, DefaultReasoning, DefaultTool, DefaultToolGroup, DefaultDataResult, DefaultView, DefaultViewRef, DefaultMedia, DefaultCode, DefaultCitations, DefaultPrompt, DefaultError, DefaultHistoryBoundary, DefaultCompaction, DefaultUnknown, DefaultStatus, } from "./react/components.js";
|
|
17
17
|
export { useTranscript, useTranscriptInputs, } from "./react/use-transcript.js";
|
|
18
|
-
export { GuueyChat } from "./react/guuey-chat.js";
|
|
18
|
+
export { GuueyChat, } from "./react/guuey-chat.js";
|
|
19
19
|
export { oauthPromptAction, oauthReturnToHere, openOAuthAuthorize, useOAuthReturn, } from "./react/oauth-return.js";
|
|
20
20
|
export { Markdown } from "./react/markdown.js";
|
|
21
21
|
export { themeCssVars } from "./react/theme-css.js";
|
package/dist/strings.d.ts
CHANGED
|
@@ -41,6 +41,11 @@ export interface ChatStrings {
|
|
|
41
41
|
/** R0. */
|
|
42
42
|
userCouldntSend: string;
|
|
43
43
|
userRetry: string;
|
|
44
|
+
/**
|
|
45
|
+
* R0 directive collapse (guuey#422): the calm label for a forwarded
|
|
46
|
+
* view-directive turn — the wire-verbatim text sits behind the expand.
|
|
47
|
+
*/
|
|
48
|
+
directiveContinuation: string;
|
|
44
49
|
/** R6 states. */
|
|
45
50
|
viewNegotiating: string;
|
|
46
51
|
viewBootFailure: string;
|
package/dist/strings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;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B,EAAE,WAyEhC,CAAC"}
|
package/dist/strings.js
CHANGED
|
@@ -46,6 +46,7 @@ export const defaultChatStrings = {
|
|
|
46
46
|
compaction: "Earlier conversation summarized",
|
|
47
47
|
userCouldntSend: "Couldn't send",
|
|
48
48
|
userRetry: "Retry",
|
|
49
|
+
directiveContinuation: "Continuing from your action…",
|
|
49
50
|
viewNegotiating: "Loading view…",
|
|
50
51
|
viewBootFailure: "This view couldn't start",
|
|
51
52
|
viewInlineFallback: "Showing plain content",
|
package/dist/types.d.ts
CHANGED
|
@@ -179,6 +179,18 @@ export interface UserMessageItem extends BaseItem {
|
|
|
179
179
|
state: "sending" | "sent" | "failed";
|
|
180
180
|
/** The failed-state affordance (policy-gated); never silently disappears. */
|
|
181
181
|
retry: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* The turn is a forwarded view directive (guuey#422 — a `ui/message`
|
|
184
|
+
* doorbell's `<ggui_directive>` carrier, relayed through the composer's
|
|
185
|
+
* send gate). DISPLAY-ONLY: `text` stays wire-verbatim — the calm
|
|
186
|
+
* renderer collapses the bubble into a quiet
|
|
187
|
+
* `strings.directiveContinuation` row (expand reveals the verbatim
|
|
188
|
+
* text); nothing about the wire changes. Collapse is policy-gated
|
|
189
|
+
* (`userMessage.collapseDirectives`) — `false` here means "render as an
|
|
190
|
+
* ordinary bubble" whether because the text is ordinary or the policy
|
|
191
|
+
* says show it.
|
|
192
|
+
*/
|
|
193
|
+
directive: boolean;
|
|
182
194
|
}
|
|
183
195
|
/** R1 — assistant text. */
|
|
184
196
|
export interface TextItem extends BaseItem {
|
|
@@ -468,6 +480,23 @@ export type ChatDebugEvent = {
|
|
|
468
480
|
| {
|
|
469
481
|
type: "model-context-update";
|
|
470
482
|
byteSize: number;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* A locator `resources/read` MISSED — the wired reader returned nothing
|
|
486
|
+
* or threw (guuey#408, the #401-class fail-loud lesson): a transport
|
|
487
|
+
* whose fallback never works is invisible when primary delivery
|
|
488
|
+
* succeeds and load-bearing exactly when it fails, so the miss must SAY
|
|
489
|
+
* SO somewhere observable. Carries the uri + lifecycle origin so a
|
|
490
|
+
* 100%-miss pattern is diagnosable from the builder surface; fires only
|
|
491
|
+
* when a reader was wired and failed (a reader-less host's placeholder
|
|
492
|
+
* is by construction, not a failure). Debug-only like every event here
|
|
493
|
+
* — calm end-user UX keeps deny == miss un-oracled.
|
|
494
|
+
*/
|
|
495
|
+
| {
|
|
496
|
+
type: "locator-read-miss";
|
|
497
|
+
key: ItemKey;
|
|
498
|
+
resourceUri: string;
|
|
499
|
+
origin: "live" | "history";
|
|
471
500
|
};
|
|
472
501
|
/**
|
|
473
502
|
* One renderable view the plan saw, BEFORE any chips/promotion pass —
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACX,cAAc,EACd,QAAQ,EACR,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,M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CAAE,GAC3E;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAC5C;;;;;GAKG;GACD;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AACpD;;;;;;;;;;GAUG;GACD;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,GAAG,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjG;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,OAAO,CAAC;IACb,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,4DAA4D;IAC5D,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,kEAAkE;IAClE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;OAIG;IACH,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guuey/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "The default end-user transcript UI for guuey agents — the headless view-model (planTranscript), calm/debug presets, the GuueyChatTheme token schema, the ChatStrings i18n seam, and (at ./react) the component kit that renders it: per-category components, <Transcript>, the live + history input assemblers, and stick-to-bottom/windowed/accessible transcript behavior; at ./native, the React Native renderer over the same view-model.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@silverprotocol/core": "0.5.1",
|
|
40
40
|
"@silverprotocol/richtext": "0.5.1",
|
|
41
41
|
"zod": "^4.3.6",
|
|
42
|
-
"@guuey/agent-client": "0.
|
|
43
|
-
"@guuey/mcp-apps-host": "0.
|
|
42
|
+
"@guuey/agent-client": "0.16.0",
|
|
43
|
+
"@guuey/mcp-apps-host": "0.16.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=18",
|
|
@@ -4,6 +4,7 @@ exports[`corpus > 1. forty-tools — grouping caps the rows; plan stays O(groups
|
|
|
4
4
|
{
|
|
5
5
|
"items": [
|
|
6
6
|
{
|
|
7
|
+
"directive": false,
|
|
7
8
|
"expanded": true,
|
|
8
9
|
"key": "u0",
|
|
9
10
|
"kind": "user",
|
|
@@ -841,6 +842,7 @@ exports[`corpus > 2. midstream-tool-failure — failed inline; badge without unr
|
|
|
841
842
|
{
|
|
842
843
|
"items": [
|
|
843
844
|
{
|
|
845
|
+
"directive": false,
|
|
844
846
|
"expanded": true,
|
|
845
847
|
"key": "u0",
|
|
846
848
|
"kind": "user",
|
|
@@ -978,6 +980,7 @@ exports[`corpus > 3. cold-start — R12 escalation at 0 / 2.5 s / 15 s 1`] = `
|
|
|
978
980
|
{
|
|
979
981
|
"items": [
|
|
980
982
|
{
|
|
983
|
+
"directive": false,
|
|
981
984
|
"expanded": true,
|
|
982
985
|
"key": "u0",
|
|
983
986
|
"kind": "user",
|
|
@@ -1002,6 +1005,7 @@ exports[`corpus > 4. consent-gate — pending grant-mode card → answered one-l
|
|
|
1002
1005
|
{
|
|
1003
1006
|
"items": [
|
|
1004
1007
|
{
|
|
1008
|
+
"directive": false,
|
|
1005
1009
|
"expanded": true,
|
|
1006
1010
|
"key": "u0",
|
|
1007
1011
|
"kind": "user",
|
|
@@ -1076,6 +1080,7 @@ exports[`corpus > 5. bypass-text-only — plan identical to a silver text-only s
|
|
|
1076
1080
|
{
|
|
1077
1081
|
"items": [
|
|
1078
1082
|
{
|
|
1083
|
+
"directive": false,
|
|
1079
1084
|
"expanded": true,
|
|
1080
1085
|
"key": "u0",
|
|
1081
1086
|
"kind": "user",
|
|
@@ -1103,6 +1108,7 @@ exports[`corpus > 7. view-never-handshakes — channel-aware labels on both chan
|
|
|
1103
1108
|
{
|
|
1104
1109
|
"items": [
|
|
1105
1110
|
{
|
|
1111
|
+
"directive": false,
|
|
1106
1112
|
"expanded": true,
|
|
1107
1113
|
"key": "u0",
|
|
1108
1114
|
"kind": "user",
|
|
@@ -1210,6 +1216,7 @@ exports[`corpus > 8. aborted-mid-stream — partial kept + Stopped.; no orphaned
|
|
|
1210
1216
|
{
|
|
1211
1217
|
"items": [
|
|
1212
1218
|
{
|
|
1219
|
+
"directive": false,
|
|
1213
1220
|
"expanded": true,
|
|
1214
1221
|
"key": "u0",
|
|
1215
1222
|
"kind": "user",
|
|
@@ -1255,6 +1262,7 @@ exports[`corpus > 9. history-dead-locators — the expired path beside a healthy
|
|
|
1255
1262
|
{
|
|
1256
1263
|
"items": [
|
|
1257
1264
|
{
|
|
1265
|
+
"directive": false,
|
|
1258
1266
|
"expanded": true,
|
|
1259
1267
|
"key": "u0",
|
|
1260
1268
|
"kind": "user",
|
|
@@ -1333,6 +1341,7 @@ exports[`corpus > 10. empty-turn — status resolves, no empty bubble 1`] = `
|
|
|
1333
1341
|
{
|
|
1334
1342
|
"items": [
|
|
1335
1343
|
{
|
|
1344
|
+
"directive": false,
|
|
1336
1345
|
"expanded": true,
|
|
1337
1346
|
"key": "u0",
|
|
1338
1347
|
"kind": "user",
|
|
@@ -1351,6 +1360,7 @@ exports[`corpus > 11. unknown-block-storm — labeled rows; nothing blank, nothi
|
|
|
1351
1360
|
{
|
|
1352
1361
|
"items": [
|
|
1353
1362
|
{
|
|
1363
|
+
"directive": false,
|
|
1354
1364
|
"expanded": true,
|
|
1355
1365
|
"key": "u0",
|
|
1356
1366
|
"kind": "user",
|
|
@@ -1396,6 +1406,7 @@ exports[`corpus > 12. interleaved-media-code-citations — ordering and aggregat
|
|
|
1396
1406
|
{
|
|
1397
1407
|
"items": [
|
|
1398
1408
|
{
|
|
1409
|
+
"directive": false,
|
|
1399
1410
|
"expanded": true,
|
|
1400
1411
|
"key": "u0",
|
|
1401
1412
|
"kind": "user",
|
|
@@ -1461,6 +1472,7 @@ exports[`corpus > 13. saturated-then-served — only R12 waiting, then a normal
|
|
|
1461
1472
|
{
|
|
1462
1473
|
"items": [
|
|
1463
1474
|
{
|
|
1475
|
+
"directive": false,
|
|
1464
1476
|
"expanded": true,
|
|
1465
1477
|
"key": "u0",
|
|
1466
1478
|
"kind": "user",
|
|
@@ -1488,6 +1500,7 @@ exports[`corpus > 14. reasoning-heavy — calm collapses to one line; debug expa
|
|
|
1488
1500
|
{
|
|
1489
1501
|
"items": [
|
|
1490
1502
|
{
|
|
1503
|
+
"directive": false,
|
|
1491
1504
|
"expanded": true,
|
|
1492
1505
|
"key": "u0",
|
|
1493
1506
|
"kind": "user",
|
|
@@ -1523,6 +1536,7 @@ exports[`corpus > 15. tools-around-a-view — the group SPLITS at the view's pos
|
|
|
1523
1536
|
{
|
|
1524
1537
|
"items": [
|
|
1525
1538
|
{
|
|
1539
|
+
"directive": false,
|
|
1526
1540
|
"expanded": true,
|
|
1527
1541
|
"key": "u0",
|
|
1528
1542
|
"kind": "user",
|
|
@@ -1690,6 +1704,7 @@ exports[`corpus > 16. user-send-failure — R0 failed with retry; the message ne
|
|
|
1690
1704
|
{
|
|
1691
1705
|
"items": [
|
|
1692
1706
|
{
|
|
1707
|
+
"directive": false,
|
|
1693
1708
|
"expanded": true,
|
|
1694
1709
|
"key": "u0",
|
|
1695
1710
|
"kind": "user",
|
|
@@ -1708,6 +1723,7 @@ exports[`corpus > 19. persisted-plus-live — the fold owns its trailing turns;
|
|
|
1708
1723
|
{
|
|
1709
1724
|
"items": [
|
|
1710
1725
|
{
|
|
1726
|
+
"directive": false,
|
|
1711
1727
|
"expanded": true,
|
|
1712
1728
|
"key": "u0",
|
|
1713
1729
|
"kind": "user",
|
|
@@ -1725,6 +1741,7 @@ exports[`corpus > 19. persisted-plus-live — the fold owns its trailing turns;
|
|
|
1725
1741
|
"text": "Here are some options.",
|
|
1726
1742
|
},
|
|
1727
1743
|
{
|
|
1744
|
+
"directive": false,
|
|
1728
1745
|
"expanded": true,
|
|
1729
1746
|
"key": "u1",
|
|
1730
1747
|
"kind": "user",
|
|
@@ -1770,6 +1787,7 @@ exports[`corpus > 19. persisted-plus-live — the fold owns its trailing turns;
|
|
|
1770
1787
|
"toolTitle": "ggui render",
|
|
1771
1788
|
},
|
|
1772
1789
|
{
|
|
1790
|
+
"directive": false,
|
|
1773
1791
|
"expanded": true,
|
|
1774
1792
|
"key": "u2",
|
|
1775
1793
|
"kind": "user",
|
|
@@ -1855,6 +1873,7 @@ exports[`corpus > 20. hitl-grant-modes — the persisted declaration renders; an
|
|
|
1855
1873
|
{
|
|
1856
1874
|
"items": [
|
|
1857
1875
|
{
|
|
1876
|
+
"directive": false,
|
|
1858
1877
|
"expanded": true,
|
|
1859
1878
|
"key": "u0",
|
|
1860
1879
|
"kind": "user",
|
|
@@ -1940,6 +1959,7 @@ exports[`corpus > 21. notice-rows — both arrival paths render labeled, never a
|
|
|
1940
1959
|
"text": "Model fell back to concise mode",
|
|
1941
1960
|
},
|
|
1942
1961
|
{
|
|
1962
|
+
"directive": false,
|
|
1943
1963
|
"expanded": true,
|
|
1944
1964
|
"key": "u0",
|
|
1945
1965
|
"kind": "user",
|
|
@@ -1967,6 +1987,7 @@ exports[`corpus > 22. promoted-view — the stage's mount chips (guuey#204); oth
|
|
|
1967
1987
|
{
|
|
1968
1988
|
"items": [
|
|
1969
1989
|
{
|
|
1990
|
+
"directive": false,
|
|
1970
1991
|
"expanded": true,
|
|
1971
1992
|
"key": "u0",
|
|
1972
1993
|
"kind": "user",
|
|
@@ -2071,6 +2092,7 @@ exports[`corpus > 23. meta-less-locator — a \`_meta\`-withholding producer's r
|
|
|
2071
2092
|
{
|
|
2072
2093
|
"items": [
|
|
2073
2094
|
{
|
|
2095
|
+
"directive": false,
|
|
2074
2096
|
"expanded": true,
|
|
2075
2097
|
"key": "u0",
|
|
2076
2098
|
"kind": "user",
|
|
@@ -2130,6 +2152,7 @@ exports[`corpus > 24. prod-wire-ggui-render — ggui's production posture: no _m
|
|
|
2130
2152
|
{
|
|
2131
2153
|
"items": [
|
|
2132
2154
|
{
|
|
2155
|
+
"directive": false,
|
|
2133
2156
|
"expanded": true,
|
|
2134
2157
|
"key": "u0",
|
|
2135
2158
|
"kind": "user",
|
|
@@ -2198,6 +2221,7 @@ exports[`corpus > 25. chips-presentation — EVERY view chips; the promoted key
|
|
|
2198
2221
|
{
|
|
2199
2222
|
"items": [
|
|
2200
2223
|
{
|
|
2224
|
+
"directive": false,
|
|
2201
2225
|
"expanded": true,
|
|
2202
2226
|
"key": "u0",
|
|
2203
2227
|
"kind": "user",
|
|
@@ -2291,6 +2315,7 @@ exports[`corpus > 25. oauth-auth-ask — kind:auth + authConfig oauth2 plans as
|
|
|
2291
2315
|
{
|
|
2292
2316
|
"items": [
|
|
2293
2317
|
{
|
|
2318
|
+
"directive": false,
|
|
2294
2319
|
"expanded": true,
|
|
2295
2320
|
"key": "u0",
|
|
2296
2321
|
"kind": "user",
|
package/src/plan.ts
CHANGED
|
@@ -823,13 +823,23 @@ export function planTranscript(
|
|
|
823
823
|
user.clientMessageId !== undefined
|
|
824
824
|
? (inputs.sendStates?.[user.clientMessageId] ?? "sent")
|
|
825
825
|
: "sent";
|
|
826
|
+
// guuey#422 close-condition 3: a forwarded view directive (the
|
|
827
|
+
// `ui/message` doorbell's `<ggui_directive>` carrier, relayed through
|
|
828
|
+
// the composer's send gate) collapses into a calm continuation row.
|
|
829
|
+
// DISPLAY-ONLY — `text` stays wire-verbatim (expand reveals it); the
|
|
830
|
+
// wire itself was never touched. Marker matches ggui's runtime
|
|
831
|
+
// construction (`<ggui_directive kind="user-action">` inside the
|
|
832
|
+
// relayed prose).
|
|
833
|
+
const directive =
|
|
834
|
+
policy.userMessage.collapseDirectives && user.text.includes("<ggui_directive");
|
|
826
835
|
conversation.push({
|
|
827
836
|
kind: "user",
|
|
828
837
|
key,
|
|
829
|
-
expanded:
|
|
838
|
+
expanded: resolveExpanded(key, !directive, overrides),
|
|
830
839
|
text: user.text,
|
|
831
840
|
state: sendState,
|
|
832
841
|
retry: sendState === "failed" && policy.userMessage.retryAffordance,
|
|
842
|
+
directive,
|
|
833
843
|
});
|
|
834
844
|
}
|
|
835
845
|
const assistant = assistants[slot];
|
package/src/policy.ts
CHANGED
|
@@ -19,7 +19,17 @@ export interface TranscriptPolicy {
|
|
|
19
19
|
*/
|
|
20
20
|
debugDetail: boolean;
|
|
21
21
|
/** R0. */
|
|
22
|
-
userMessage: {
|
|
22
|
+
userMessage: {
|
|
23
|
+
retryAffordance: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Collapse forwarded view-directive turns (guuey#422 `ui/message`
|
|
26
|
+
* relays carrying `<ggui_directive>`) into a calm
|
|
27
|
+
* `strings.directiveContinuation` row. Display-only — the sent/
|
|
28
|
+
* persisted text stays wire-verbatim, and expand reveals it. Debug
|
|
29
|
+
* preset shows the verbatim bubble (`false`).
|
|
30
|
+
*/
|
|
31
|
+
collapseDirectives: boolean;
|
|
32
|
+
};
|
|
23
33
|
/** R1 (markdown sanitization itself is the 3b renderer's security surface). */
|
|
24
34
|
text: { markdown: boolean };
|
|
25
35
|
/** R2. */
|
|
@@ -125,7 +135,7 @@ function calmBase(): TranscriptPolicy {
|
|
|
125
135
|
strings: defaultChatStrings,
|
|
126
136
|
locale: "en",
|
|
127
137
|
debugDetail: false,
|
|
128
|
-
userMessage: { retryAffordance: true },
|
|
138
|
+
userMessage: { retryAffordance: true, collapseDirectives: true },
|
|
129
139
|
text: { markdown: true },
|
|
130
140
|
reasoning: { show: true, expandedByDefault: false },
|
|
131
141
|
tool: { expandByDefault: false, argsVisible: false, humanizeTitle: humanizeToolName },
|
|
@@ -155,6 +165,7 @@ export function debugPolicy(overrides?: TranscriptPolicyOverrides): TranscriptPo
|
|
|
155
165
|
const debug: TranscriptPolicy = {
|
|
156
166
|
...base,
|
|
157
167
|
debugDetail: true,
|
|
168
|
+
userMessage: { ...base.userMessage, collapseDirectives: false },
|
|
158
169
|
reasoning: { ...base.reasoning, expandedByDefault: true },
|
|
159
170
|
tool: { ...base.tool, expandByDefault: true, argsVisible: true },
|
|
160
171
|
toolGroup: { threshold: false },
|
package/src/react/components.tsx
CHANGED
|
@@ -187,6 +187,33 @@ function CopyButton({ text, ctx }: { text: string; ctx: TranscriptItemContext })
|
|
|
187
187
|
// ─── R0 ────────────────────────────────────────────────────────────────────
|
|
188
188
|
|
|
189
189
|
export function DefaultUserMessage({ item, ctx }: ItemProps<UserMessageItem>): ReactNode {
|
|
190
|
+
// guuey#422: a forwarded view directive renders as a calm continuation
|
|
191
|
+
// row — the wire-verbatim text sits behind the expand, never rewritten.
|
|
192
|
+
if (item.directive) {
|
|
193
|
+
return (
|
|
194
|
+
<div className={`guuey-chat-user guuey-chat-user-directive guuey-chat-user-${item.state}`}>
|
|
195
|
+
<Collapsible
|
|
196
|
+
itemKey={item.key}
|
|
197
|
+
expanded={item.expanded}
|
|
198
|
+
header={<span className="guuey-chat-directive-label">{ctx.strings.directiveContinuation}</span>}
|
|
199
|
+
ctx={ctx}
|
|
200
|
+
>
|
|
201
|
+
{/* Verbatim quote — same never-rendered rule as the bubble. */}
|
|
202
|
+
<div className="guuey-chat-user-bubble">{item.text}</div>
|
|
203
|
+
</Collapsible>
|
|
204
|
+
{item.state === "failed" ? (
|
|
205
|
+
<p className="guuey-chat-send-failed" role="status">
|
|
206
|
+
{ctx.strings.userCouldntSend}
|
|
207
|
+
{item.retry ? (
|
|
208
|
+
<button type="button" className="guuey-chat-retry" onClick={() => ctx.onRetry?.(item)}>
|
|
209
|
+
{ctx.strings.userRetry}
|
|
210
|
+
</button>
|
|
211
|
+
) : null}
|
|
212
|
+
</p>
|
|
213
|
+
) : null}
|
|
214
|
+
</div>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
190
217
|
return (
|
|
191
218
|
<div className={`guuey-chat-user guuey-chat-user-${item.state}`}>
|
|
192
219
|
{/* User text is QUOTED, never rendered — whitespace preserved. */}
|
package/src/react/guuey-chat.tsx
CHANGED
|
@@ -118,6 +118,16 @@ export function viewPropsWithThemeAnnounce(
|
|
|
118
118
|
* being the filing use case). Reach it via `ref` or `onReady` — both
|
|
119
119
|
* deliver the SAME stable object, valid for the component's whole life.
|
|
120
120
|
*/
|
|
121
|
+
/**
|
|
122
|
+
* One turn-lifecycle edge (guuey#403): `submit` = a turn left `ready`;
|
|
123
|
+
* `settled` = the invoke returned to `ready`. Mirrored structurally by
|
|
124
|
+
* `@guuey/agent-layout`'s `GuueyChatActivityEventShape` — keep the two in
|
|
125
|
+
* sync (the fs-contract mirror discipline).
|
|
126
|
+
*/
|
|
127
|
+
export interface GuueyChatActivityEvent {
|
|
128
|
+
type: "submit" | "settled";
|
|
129
|
+
}
|
|
130
|
+
|
|
121
131
|
export interface GuueyChatHandle {
|
|
122
132
|
/**
|
|
123
133
|
* Send `text` through exactly the Send button's gate: returns `false`
|
|
@@ -247,6 +257,18 @@ export interface GuueyChatProps {
|
|
|
247
257
|
onOAuthAuthorize?: (href: string, ask: AgPausedAsk) => void;
|
|
248
258
|
/** R11 action slot (sign-in / retry affordances). */
|
|
249
259
|
onErrorAction?: (item: ErrorItem) => void;
|
|
260
|
+
/**
|
|
261
|
+
* Turn-lifecycle notifications (guuey#403 — the agent-layout bridge's
|
|
262
|
+
* seam, though any host may listen): `submit` fires when a turn this
|
|
263
|
+
* surface started leaves `ready` — composer, `handle.send`, and the
|
|
264
|
+
* `ui/message` doorbell paths alike (the busy transition IS the truth:
|
|
265
|
+
* gate-refused sends never fire) — and `settled` when the invoke
|
|
266
|
+
* returns to `ready` (success, error, and abort all settle). Discrete
|
|
267
|
+
* per-turn edges only, NEVER per-token — safe to wire into layout
|
|
268
|
+
* state. `@guuey/agent-layout` mirrors {@link GuueyChatActivityEvent}
|
|
269
|
+
* structurally (its `bind.ts` — sync comment there points here).
|
|
270
|
+
*/
|
|
271
|
+
onActivity?: (event: GuueyChatActivityEvent) => void;
|
|
250
272
|
/**
|
|
251
273
|
* Callback route to the {@link GuueyChatHandle} for hosts that prefer
|
|
252
274
|
* wiring over refs. Fires ONCE per component instance, on mount, with
|
|
@@ -313,6 +335,7 @@ export const GuueyChat = forwardRef<GuueyChatHandle, GuueyChatProps>(function Gu
|
|
|
313
335
|
oauthReturnTo,
|
|
314
336
|
onOAuthAuthorize,
|
|
315
337
|
onErrorAction,
|
|
338
|
+
onActivity,
|
|
316
339
|
onReady,
|
|
317
340
|
onThread,
|
|
318
341
|
className,
|
|
@@ -520,6 +543,15 @@ export const GuueyChat = forwardRef<GuueyChatHandle, GuueyChatProps>(function Gu
|
|
|
520
543
|
// real turn starts, the agent calls ggui_consume, the card repaints.
|
|
521
544
|
// Busy/unavailable ⇒ dropped (the doorbell fires post-turn by design;
|
|
522
545
|
// mid-turn the consume pipe is live and no doorbell fires).
|
|
546
|
+
// guuey#422 close-condition 1 (ggui review): the machine ACKs the
|
|
547
|
+
// doorbell BEFORE delivery, so a busy-drop here would be an
|
|
548
|
+
// ACKed-then-silently-dropped message — the night's silence class in
|
|
549
|
+
// protocol clothes. Queue-and-drain instead: while a turn is live the
|
|
550
|
+
// directive queues (exact-text dedupe — a session's repeat doorbells
|
|
551
|
+
// collapse; the consume PIPE holds the gestures, the doorbell only
|
|
552
|
+
// wakes), and the idle transition drains one per turn. Unavailable chat
|
|
553
|
+
// cannot drain — that drop is LOUD (console.warn), never silent.
|
|
554
|
+
const pendingDoorbellsRef = useRef<string[]>([]);
|
|
523
555
|
const defaultOnUserMessage = useCallback((params: { [key: string]: unknown }) => {
|
|
524
556
|
const content = params["content"];
|
|
525
557
|
if (!Array.isArray(content)) return;
|
|
@@ -533,12 +565,48 @@ export const GuueyChat = forwardRef<GuueyChatHandle, GuueyChatProps>(function Gu
|
|
|
533
565
|
.join("\n");
|
|
534
566
|
if (text.trim() === "") return;
|
|
535
567
|
const live = liveRef.current;
|
|
536
|
-
if (!live.available
|
|
568
|
+
if (!live.available) {
|
|
569
|
+
console.warn(
|
|
570
|
+
"[GuueyChat] ui/message doorbell dropped — chat is unavailable (endpointUrl null); the view's gesture cannot start a turn here.",
|
|
571
|
+
);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
if (live.busy) {
|
|
575
|
+
if (!pendingDoorbellsRef.current.includes(text)) pendingDoorbellsRef.current.push(text);
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
537
578
|
void live.invoke.send(text).catch(() => {
|
|
538
579
|
// The hook owns failure surfacing, same as every send path.
|
|
539
580
|
});
|
|
540
581
|
}, []);
|
|
541
582
|
|
|
583
|
+
// guuey#403: the turn-lifecycle edges. The busy TRANSITION is the one
|
|
584
|
+
// truthful seam every send path crosses (composer, handle, doorbell,
|
|
585
|
+
// drain, retry) and gate-refused sends never do; status leaves `ready`
|
|
586
|
+
// only via a real send (hydration and history reads never touch it).
|
|
587
|
+
const onActivityRef = useRef(onActivity);
|
|
588
|
+
onActivityRef.current = onActivity;
|
|
589
|
+
const prevBusyRef = useRef(busy);
|
|
590
|
+
useEffect(() => {
|
|
591
|
+
if (prevBusyRef.current === busy) return;
|
|
592
|
+
prevBusyRef.current = busy;
|
|
593
|
+
onActivityRef.current?.({ type: busy ? "submit" : "settled" });
|
|
594
|
+
}, [busy]);
|
|
595
|
+
|
|
596
|
+
// The drain: one queued doorbell per idle transition — its send flips
|
|
597
|
+
// busy again, and the NEXT idle drains the next (never a turn storm).
|
|
598
|
+
useEffect(() => {
|
|
599
|
+
if (busy || pendingDoorbellsRef.current.length === 0) return;
|
|
600
|
+
const next = pendingDoorbellsRef.current.shift();
|
|
601
|
+
if (next === undefined) return;
|
|
602
|
+
const live = liveRef.current;
|
|
603
|
+
if (!live.available) {
|
|
604
|
+
console.warn("[GuueyChat] queued ui/message doorbell dropped — chat became unavailable.");
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
void live.invoke.send(next).catch(() => {});
|
|
608
|
+
}, [busy]);
|
|
609
|
+
|
|
542
610
|
const effectiveViewProps = useMemo<TranscriptItemContext["viewProps"]>(
|
|
543
611
|
() =>
|
|
544
612
|
viewPropsWithThemeAnnounce(viewProps, mode, {
|
|
@@ -206,9 +206,27 @@ export function useTranscript({
|
|
|
206
206
|
}
|
|
207
207
|
// guuey#421: the roster knows a card's origin — a history card's
|
|
208
208
|
// locator skips the pod door (it 404s by construction there).
|
|
209
|
+
// guuey#408: a WIRED reader's miss additionally says WHICH uri went
|
|
210
|
+
// unread (fail-loud on the debug channel — a never-working transport
|
|
211
|
+
// must not vanish into placeholders). The reader-less arm above
|
|
212
|
+
// stays silent: no read happened, nothing failed.
|
|
213
|
+
const loudMiss = (): void => {
|
|
214
|
+
debugSink.current?.({
|
|
215
|
+
type: "locator-read-miss",
|
|
216
|
+
key: item.key,
|
|
217
|
+
resourceUri: locator.resourceUri,
|
|
218
|
+
origin: item.origin,
|
|
219
|
+
});
|
|
220
|
+
};
|
|
209
221
|
void resolveViewMount(locator, read, { origin: item.origin }).then(
|
|
210
|
-
(resolved) =>
|
|
211
|
-
|
|
222
|
+
(resolved) => {
|
|
223
|
+
if (resolved === undefined) loudMiss();
|
|
224
|
+
settle(resolved ?? "expired");
|
|
225
|
+
},
|
|
226
|
+
() => {
|
|
227
|
+
loudMiss();
|
|
228
|
+
settle("expired");
|
|
229
|
+
},
|
|
212
230
|
);
|
|
213
231
|
}
|
|
214
232
|
}, [plan, resolvedMounts]);
|
package/src/react.tsx
CHANGED
|
@@ -48,7 +48,12 @@ export {
|
|
|
48
48
|
type UseTranscriptResult,
|
|
49
49
|
type UseTranscriptInputsResult,
|
|
50
50
|
} from "./react/use-transcript.js";
|
|
51
|
-
export {
|
|
51
|
+
export {
|
|
52
|
+
GuueyChat,
|
|
53
|
+
type GuueyChatActivityEvent,
|
|
54
|
+
type GuueyChatProps,
|
|
55
|
+
type GuueyChatHandle,
|
|
56
|
+
} from "./react/guuey-chat.js";
|
|
52
57
|
export {
|
|
53
58
|
oauthPromptAction,
|
|
54
59
|
oauthReturnToHere,
|
package/src/strings.ts
CHANGED
|
@@ -48,6 +48,11 @@ export interface ChatStrings {
|
|
|
48
48
|
/** R0. */
|
|
49
49
|
userCouldntSend: string;
|
|
50
50
|
userRetry: string;
|
|
51
|
+
/**
|
|
52
|
+
* R0 directive collapse (guuey#422): the calm label for a forwarded
|
|
53
|
+
* view-directive turn — the wire-verbatim text sits behind the expand.
|
|
54
|
+
*/
|
|
55
|
+
directiveContinuation: string;
|
|
51
56
|
|
|
52
57
|
/** R6 states. */
|
|
53
58
|
viewNegotiating: string;
|
|
@@ -178,6 +183,7 @@ export const defaultChatStrings: ChatStrings = {
|
|
|
178
183
|
|
|
179
184
|
userCouldntSend: "Couldn't send",
|
|
180
185
|
userRetry: "Retry",
|
|
186
|
+
directiveContinuation: "Continuing from your action…",
|
|
181
187
|
|
|
182
188
|
viewNegotiating: "Loading view…",
|
|
183
189
|
viewBootFailure: "This view couldn't start",
|
package/src/types.ts
CHANGED
|
@@ -197,6 +197,18 @@ export interface UserMessageItem extends BaseItem {
|
|
|
197
197
|
state: "sending" | "sent" | "failed";
|
|
198
198
|
/** The failed-state affordance (policy-gated); never silently disappears. */
|
|
199
199
|
retry: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* The turn is a forwarded view directive (guuey#422 — a `ui/message`
|
|
202
|
+
* doorbell's `<ggui_directive>` carrier, relayed through the composer's
|
|
203
|
+
* send gate). DISPLAY-ONLY: `text` stays wire-verbatim — the calm
|
|
204
|
+
* renderer collapses the bubble into a quiet
|
|
205
|
+
* `strings.directiveContinuation` row (expand reveals the verbatim
|
|
206
|
+
* text); nothing about the wire changes. Collapse is policy-gated
|
|
207
|
+
* (`userMessage.collapseDirectives`) — `false` here means "render as an
|
|
208
|
+
* ordinary bubble" whether because the text is ordinary or the policy
|
|
209
|
+
* says show it.
|
|
210
|
+
*/
|
|
211
|
+
directive: boolean;
|
|
200
212
|
}
|
|
201
213
|
|
|
202
214
|
/** R1 — assistant text. */
|
|
@@ -516,7 +528,19 @@ export type ChatDebugEvent =
|
|
|
516
528
|
* COMPLEMENT — producers mirror it server-side — so the debug surface
|
|
517
529
|
* carries the fact and the size, not the payload.
|
|
518
530
|
*/
|
|
519
|
-
| { type: "model-context-update"; byteSize: number }
|
|
531
|
+
| { type: "model-context-update"; byteSize: number }
|
|
532
|
+
/**
|
|
533
|
+
* A locator `resources/read` MISSED — the wired reader returned nothing
|
|
534
|
+
* or threw (guuey#408, the #401-class fail-loud lesson): a transport
|
|
535
|
+
* whose fallback never works is invisible when primary delivery
|
|
536
|
+
* succeeds and load-bearing exactly when it fails, so the miss must SAY
|
|
537
|
+
* SO somewhere observable. Carries the uri + lifecycle origin so a
|
|
538
|
+
* 100%-miss pattern is diagnosable from the builder surface; fires only
|
|
539
|
+
* when a reader was wired and failed (a reader-less host's placeholder
|
|
540
|
+
* is by construction, not a failure). Debug-only like every event here
|
|
541
|
+
* — calm end-user UX keeps deny == miss un-oracled.
|
|
542
|
+
*/
|
|
543
|
+
| { type: "locator-read-miss"; key: ItemKey; resourceUri: string; origin: "live" | "history" };
|
|
520
544
|
|
|
521
545
|
/**
|
|
522
546
|
* One renderable view the plan saw, BEFORE any chips/promotion pass —
|