@guuey/chat 0.7.1 → 0.7.2
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/README.md +13 -0
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +7 -0
- package/dist/react/components.d.ts +8 -2
- package/dist/react/components.d.ts.map +1 -1
- package/dist/react/components.js +1 -1
- package/dist/react/guuey-chat.d.ts.map +1 -1
- package/dist/react/guuey-chat.js +2 -2
- package/dist/react/transcript.d.ts +1 -1
- package/dist/react/transcript.d.ts.map +1 -1
- package/dist/react/transcript.js +13 -2
- package/dist/react/use-transcript.d.ts +7 -1
- package/dist/react/use-transcript.d.ts.map +1 -1
- package/dist/react/use-transcript.js +29 -3
- package/dist/strings.d.ts +11 -0
- package/dist/strings.d.ts.map +1 -1
- package/dist/strings.js +1 -0
- package/dist/types.d.ts +17 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/corpus/__snapshots__/corpus.test.ts.snap +10 -0
- package/src/plan.ts +7 -1
- package/src/react/components.tsx +9 -1
- package/src/react/guuey-chat.tsx +2 -1
- package/src/react/transcript.tsx +23 -3
- package/src/react/use-transcript.ts +35 -4
- package/src/strings.ts +13 -0
- package/src/types.ts +27 -2
package/README.md
CHANGED
|
@@ -105,6 +105,19 @@ string (`ChatStrings`, the i18n seam) without forfeiting the rest:
|
|
|
105
105
|
calmPolicy({ toolGroup: { threshold: 3 }, strings: { thinking: "Pondering…" } });
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
## Strict-CSP hosts
|
|
109
|
+
|
|
110
|
+
Generated views boot a runtime and open a live channel to their MCP host;
|
|
111
|
+
a page CSP that omits those origins leaves the frame blank. Pass the view's
|
|
112
|
+
declared origins via `viewProps={{ cspOrigins: { resourceDomains, connectDomains } }}`
|
|
113
|
+
and a policy violation your page incurs on them upgrades the "didn't start"
|
|
114
|
+
label into the exact allowance to add. And on a policy without
|
|
115
|
+
`'unsafe-eval'`, zod v4 (a dependency) reports one `script-src eval`
|
|
116
|
+
violation at boot from its `new Function("")` probe — harmless, but noise
|
|
117
|
+
on that same channel; opt out with `z.config({ jitless: true })` in a
|
|
118
|
+
side-effect module that is your entry's FIRST import. Full notes on
|
|
119
|
+
docs.guuey.com → Chat UI kit → "Strict Content-Security-Policy hosts".
|
|
120
|
+
|
|
108
121
|
## Theme
|
|
109
122
|
|
|
110
123
|
`GuueyChatTheme` is a serializable token schema (zod) — the same object a
|
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;AAEpD,OAAO,KAAK,EASV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAIf,MAAM,YAAY,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;AAEpD,OAAO,KAAK,EASV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAIf,MAAM,YAAY,CAAC;AA0mBpB,uCAAuC;AACvC,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,EACxB,SAAS,GAAE,mBAAwB,GAClC,cAAc,CA2QhB;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
|
@@ -187,6 +187,11 @@ function viewLabel(item, policy) {
|
|
|
187
187
|
case "expired":
|
|
188
188
|
return s.viewExpired;
|
|
189
189
|
case "no-handshake":
|
|
190
|
+
// The host's CSP tripwire outranks the channel heuristic (guuey#235):
|
|
191
|
+
// a blocked runtime never negotiates on ANY channel, and the verdict
|
|
192
|
+
// is actionable — name the blocked URI and the allowance.
|
|
193
|
+
if (item.diagnosis !== null)
|
|
194
|
+
return s.viewCspBlocked(item.diagnosis);
|
|
190
195
|
// Channel-aware (R6): a ggui shell that never handshakes is a boot
|
|
191
196
|
// failure; inline tenant HTML may legitimately be a non-App document.
|
|
192
197
|
// Keyed on the TRUST channel (locators resolve to it by uri), not the
|
|
@@ -318,6 +323,7 @@ function planAssistantSource(source, slot, inputs, policy, overrides) {
|
|
|
318
323
|
channel: mount.channel,
|
|
319
324
|
phase: inputs.viewPhases?.[viewKey] ?? "negotiating",
|
|
320
325
|
label: null,
|
|
326
|
+
diagnosis: inputs.viewDiagnoses?.[viewKey] ?? null,
|
|
321
327
|
attribution: policy.debugDetail ? null : policy.strings.viaTool(tool.title),
|
|
322
328
|
toolTitle: tool.title,
|
|
323
329
|
// `result` is narrowed by `mount !== undefined` above; the scope
|
|
@@ -699,6 +705,7 @@ export function planTranscript(inputs, policy, overrides = {}) {
|
|
|
699
705
|
channel: mount?.channel ?? null,
|
|
700
706
|
phase: mount === undefined ? "expired" : (inputs.viewPhases?.[key] ?? "negotiating"),
|
|
701
707
|
label: null,
|
|
708
|
+
diagnosis: mount === undefined ? null : (inputs.viewDiagnoses?.[key] ?? null),
|
|
702
709
|
attribution: null,
|
|
703
710
|
toolTitle: null,
|
|
704
711
|
actionScope: scope,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { type ComponentType, type ReactNode } from "react";
|
|
22
22
|
import { type GuueyViewProps } from "@guuey/mcp-apps-host/react";
|
|
23
|
-
import type { ResolvedViewMount, ViewHostPhase } from "@guuey/mcp-apps-host";
|
|
23
|
+
import type { ResolvedViewMount, ViewCspDiagnosis, ViewHostPhase } from "@guuey/mcp-apps-host";
|
|
24
24
|
import type { ChatStrings } from "../strings.js";
|
|
25
25
|
import type { CitationsItem, CodeItem, CompactionItem, DataResultItem, DisplayItem, ErrorItem, HistoryBoundaryItem, ItemKey, MediaItem, NoticeItem, PromptItem, ReasoningItem, StatusLineItem, ToolGroupItem, ToolItem, UnknownItem, UserMessageItem, TextItem, ViewMountItem, ViewRefItem } from "../types.js";
|
|
26
26
|
/** Everything a rendered item may need beyond itself. */
|
|
@@ -44,6 +44,12 @@ export interface TranscriptItemContext {
|
|
|
44
44
|
resolvedMounts: ReadonlyMap<ItemKey, ResolvedViewMount | "expired">;
|
|
45
45
|
/** R6: live phase reports wired back into the next plan. */
|
|
46
46
|
onViewPhase: (key: ItemKey, phase: ViewHostPhase) => void;
|
|
47
|
+
/**
|
|
48
|
+
* R6: the host's CSP tripwire diagnosed the embedding page blocking a
|
|
49
|
+
* view (guuey#235) — wired back so the label names the cause. Optional:
|
|
50
|
+
* a hand-wired host that omits it simply keeps the channel heuristic.
|
|
51
|
+
*/
|
|
52
|
+
onViewDiagnosis?: (key: ItemKey, diagnosis: ViewCspDiagnosis) => void;
|
|
47
53
|
/**
|
|
48
54
|
* guuey#204: a promoted-view reference chip was activated — the host
|
|
49
55
|
* focuses/reveals its stage (canvas). Absent ⇒ the chip renders as a
|
|
@@ -63,7 +69,7 @@ export interface TranscriptItemContext {
|
|
|
63
69
|
viewProps?: ViewSlotProps | ((item: ViewMountItem, mount: ResolvedViewMount) => ViewSlotProps);
|
|
64
70
|
}
|
|
65
71
|
/** The per-view slice of `GuueyViewProps` a transcript may configure. */
|
|
66
|
-
export type ViewSlotProps = Pick<GuueyViewProps, "hostCapabilities" | "hostInfo" | "hostContext" | "onCallTool" | "onReadResource" | "onSizeChanged" | "negotiationTimeoutMs" | "dangerouslyAddSandboxFlags" | "allow" | "sandboxPageUrl" | "autoResize">;
|
|
72
|
+
export type ViewSlotProps = Pick<GuueyViewProps, "hostCapabilities" | "hostInfo" | "hostContext" | "onCallTool" | "onReadResource" | "onSizeChanged" | "negotiationTimeoutMs" | "dangerouslyAddSandboxFlags" | "allow" | "sandboxPageUrl" | "autoResize" | "cspOrigins">;
|
|
67
73
|
interface ItemProps<T> {
|
|
68
74
|
item: T;
|
|
69
75
|
ctx: TranscriptItemContext;
|
|
@@ -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,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
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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AC;IACrD,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9C,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAC/C,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3C,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzC,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IACnD,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,UAAU,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
|
@@ -101,7 +101,7 @@ export function DefaultView({ item, ctx }) {
|
|
|
101
101
|
// The function form resolves against the ACTUAL mount (per-channel relay
|
|
102
102
|
// URLs, per-locator action scoping); it runs only when something mounts.
|
|
103
103
|
const viewProps = typeof ctx.viewProps === "function" ? ctx.viewProps(item, mount) : (ctx.viewProps ?? {});
|
|
104
|
-
return (_jsxs("div", { className: "guuey-chat-view", children: [_jsx(GuueyView, { mount: mount, ...viewProps, onPhaseChange: (phase) => ctx.onViewPhase(item.key, phase) }), item.attribution !== null ? (_jsx("p", { className: "guuey-chat-attribution", children: item.attribution })) : null] }));
|
|
104
|
+
return (_jsxs("div", { className: "guuey-chat-view", children: [_jsx(GuueyView, { mount: mount, ...viewProps, onPhaseChange: (phase) => ctx.onViewPhase(item.key, phase), onCspDiagnosis: (diagnosis) => ctx.onViewDiagnosis?.(item.key, diagnosis) }), item.attribution !== null ? (_jsx("p", { className: "guuey-chat-attribution", children: item.attribution })) : null] }));
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* guuey#204: the "promote and reference" chip — stands in for the one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guuey-chat.d.ts","sourceRoot":"","sources":["../../src/react/guuey-chat.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAQL,KAAK,aAAa,EAEnB,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAA2B,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,i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,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAQD,eAAO,MAAM,SAAS,4GA4QpB,CAAC"}
|
package/dist/react/guuey-chat.js
CHANGED
|
@@ -110,7 +110,7 @@ export const GuueyChat = forwardRef(function GuueyChat(props, ref) {
|
|
|
110
110
|
return factory({ ...policyOverrides, strings });
|
|
111
111
|
}, [preset, policyOverrides, stringOverrides]);
|
|
112
112
|
const { inputs, resolvePrompt, answerHitlPrompt } = useTranscriptInputs(invoke);
|
|
113
|
-
const { plan, toggle, resolvedMounts, onViewPhase } = useTranscript({
|
|
113
|
+
const { plan, toggle, resolvedMounts, onViewPhase, onViewDiagnosis } = useTranscript({
|
|
114
114
|
inputs,
|
|
115
115
|
policy,
|
|
116
116
|
...(effectiveReader !== undefined ? { reader: effectiveReader } : {}),
|
|
@@ -213,7 +213,7 @@ export const GuueyChat = forwardRef(function GuueyChat(props, ref) {
|
|
|
213
213
|
onPromptAction?.(item, action);
|
|
214
214
|
}, [resolvePrompt, answerHitlPrompt, onHitlAnswer, onPromptAction]);
|
|
215
215
|
const strings = policy.strings;
|
|
216
|
-
return (_jsxs("div", { className: `guuey-chat-surface${className !== undefined ? ` ${className}` : ""}`, style: style, children: [_jsx(Transcript, { plan: plan, strings: strings, theme: theme, mode: mode, ...(windowing !== undefined ? { window: windowing } : {}), ...(components !== undefined ? { components } : {}), onToggle: toggle, onRetry: handleRetry, onPromptAction: handlePromptAction, ...(onErrorAction !== undefined ? { onErrorAction } : {}), resolvedMounts: resolvedMounts, onViewPhase: onViewPhase, ...(viewProps !== undefined ? { viewProps } : {}) }), _jsxs("form", { className: "guuey-chat-composer", onSubmit: (e) => {
|
|
216
|
+
return (_jsxs("div", { className: `guuey-chat-surface${className !== undefined ? ` ${className}` : ""}`, style: style, children: [_jsx(Transcript, { plan: plan, strings: strings, theme: theme, mode: mode, ...(windowing !== undefined ? { window: windowing } : {}), ...(components !== undefined ? { components } : {}), onToggle: toggle, onRetry: handleRetry, onPromptAction: handlePromptAction, ...(onErrorAction !== undefined ? { onErrorAction } : {}), resolvedMounts: resolvedMounts, onViewPhase: onViewPhase, onViewDiagnosis: onViewDiagnosis, ...(viewProps !== undefined ? { viewProps } : {}) }), _jsxs("form", { className: "guuey-chat-composer", onSubmit: (e) => {
|
|
217
217
|
e.preventDefault();
|
|
218
218
|
submit();
|
|
219
219
|
}, children: [_jsx("textarea", { ref: inputRef, className: "guuey-chat-composer-input", rows: 1, value: input, onChange: (e) => setInput(e.target.value), onKeyDown: (e) => {
|
|
@@ -25,7 +25,7 @@ export interface TranscriptWindowing {
|
|
|
25
25
|
/** Trailing items rendered; earlier ones sit behind the expander. */
|
|
26
26
|
tail: number;
|
|
27
27
|
}
|
|
28
|
-
export interface TranscriptProps extends Pick<TranscriptItemContext, "onToggle" | "onRetry" | "onPromptAction" | "onErrorAction" | "resolvedMounts" | "onViewPhase" | "onViewRef" | "viewProps"> {
|
|
28
|
+
export interface TranscriptProps extends Pick<TranscriptItemContext, "onToggle" | "onRetry" | "onPromptAction" | "onErrorAction" | "resolvedMounts" | "onViewPhase" | "onViewDiagnosis" | "onViewRef" | "viewProps"> {
|
|
29
29
|
plan: TranscriptPlan;
|
|
30
30
|
/** Per-slot component overrides (spec §3's override column). */
|
|
31
31
|
components?: Partial<TranscriptComponents>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../src/react/transcript.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACt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,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAwI5D"}
|
package/dist/react/transcript.js
CHANGED
|
@@ -24,9 +24,20 @@ import { themeCssVars } from "./theme-css.js";
|
|
|
24
24
|
/** How close to the bottom (px) still counts as pinned. */
|
|
25
25
|
const PIN_THRESHOLD_PX = 48;
|
|
26
26
|
export function Transcript(props) {
|
|
27
|
-
const { plan, components, strings = defaultChatStrings, theme = DEFAULT_CHAT_THEME, mode = "light", window: windowing = { tail: 80 }, className, style, onToggle, onRetry, onPromptAction, onErrorAction, resolvedMounts, onViewPhase, onViewRef, viewProps, } = props;
|
|
27
|
+
const { plan, components, strings = defaultChatStrings, theme = DEFAULT_CHAT_THEME, mode = "light", window: windowing = { tail: 80 }, className, style, onToggle, onRetry, onPromptAction, onErrorAction, resolvedMounts, onViewPhase, onViewDiagnosis, onViewRef, viewProps, } = props;
|
|
28
28
|
const resolvedComponents = useMemo(() => ({ ...defaultTranscriptComponents, ...components }), [components]);
|
|
29
|
-
const ctx = useMemo(() => ({
|
|
29
|
+
const ctx = useMemo(() => ({
|
|
30
|
+
strings,
|
|
31
|
+
onToggle,
|
|
32
|
+
onRetry,
|
|
33
|
+
onPromptAction,
|
|
34
|
+
onErrorAction,
|
|
35
|
+
resolvedMounts,
|
|
36
|
+
onViewPhase,
|
|
37
|
+
onViewDiagnosis,
|
|
38
|
+
onViewRef,
|
|
39
|
+
viewProps,
|
|
40
|
+
}), [strings, onToggle, onRetry, onPromptAction, onErrorAction, resolvedMounts, onViewPhase, onViewDiagnosis, onViewRef, viewProps]);
|
|
30
41
|
// ── Windowing ────────────────────────────────────────────────────────
|
|
31
42
|
const [extraShown, setExtraShown] = useState(0);
|
|
32
43
|
const tail = windowing === false ? Number.POSITIVE_INFINITY : windowing.tail;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UseAgentInvokeReturn } from "@guuey/agent-client";
|
|
2
2
|
import type { AgHitlAnswer, AgPausedAsk } from "@silverprotocol/core";
|
|
3
|
-
import { type ResolvedViewMount, type UiResourceReader, type ViewHostPhase } from "@guuey/mcp-apps-host";
|
|
3
|
+
import { type ResolvedViewMount, type UiResourceReader, type ViewCspDiagnosis, type ViewHostPhase } from "@guuey/mcp-apps-host";
|
|
4
4
|
import { type HitlPromptAction } from "../hitl.js";
|
|
5
5
|
import type { TranscriptPolicy } from "../policy.js";
|
|
6
6
|
import type { ChatDebugEvent, ItemKey, TranscriptInputs, TranscriptOverrides, TranscriptPlan } from "../types.js";
|
|
@@ -30,6 +30,12 @@ export interface UseTranscriptResult {
|
|
|
30
30
|
overrides: TranscriptOverrides;
|
|
31
31
|
/** Wire to `<GuueyView onPhaseChange>` (the default kit already does). */
|
|
32
32
|
onViewPhase: (key: ItemKey, phase: ViewHostPhase) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Wire to `<GuueyView onCspDiagnosis>` (the default kit already does):
|
|
35
|
+
* the host's CSP tripwire caught the embedding page blocking this view
|
|
36
|
+
* (guuey#235). Feeds `viewDiagnoses` so the R6 label names the cause.
|
|
37
|
+
*/
|
|
38
|
+
onViewDiagnosis: (key: ItemKey, diagnosis: ViewCspDiagnosis) => void;
|
|
33
39
|
/** Locator resolutions: mount material, or `"expired"` for a miss. */
|
|
34
40
|
resolvedMounts: ReadonlyMap<ItemKey, ResolvedViewMount | "expired">;
|
|
35
41
|
}
|
|
@@ -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,MA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AAE,iBAAiB,GAAG,mBAAmB,CAmIzC;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,CA+I3F"}
|
|
@@ -18,11 +18,16 @@ import { planTranscript } from "../plan.js";
|
|
|
18
18
|
export function useTranscript({ inputs, policy, reader, onDebugEvent, }) {
|
|
19
19
|
const [overrides, setOverrides] = useState({});
|
|
20
20
|
const [phases, setPhases] = useState({});
|
|
21
|
+
const [diagnoses, setDiagnoses] = useState({});
|
|
21
22
|
const [resolvedMounts, setResolvedMounts] = useState(new Map());
|
|
22
23
|
// The debug sink (gated on the debug policy — calm ignores it, spec §5).
|
|
23
24
|
const debugSink = useRef(null);
|
|
24
25
|
debugSink.current = policy.debugDetail && onDebugEvent !== undefined ? onDebugEvent : null;
|
|
25
|
-
const merged = useMemo(() => ({
|
|
26
|
+
const merged = useMemo(() => ({
|
|
27
|
+
...inputs,
|
|
28
|
+
viewPhases: { ...inputs.viewPhases, ...phases },
|
|
29
|
+
viewDiagnoses: { ...inputs.viewDiagnoses, ...diagnoses },
|
|
30
|
+
}), [inputs, phases, diagnoses]);
|
|
26
31
|
const plan = useMemo(() => planTranscript(merged, policy, overrides), [merged, policy, overrides]);
|
|
27
32
|
// Toggle flips the item's CURRENT resolved state (policy default or a
|
|
28
33
|
// previous override) — read from the plan so the first toggle of a
|
|
@@ -53,13 +58,34 @@ export function useTranscript({ inputs, policy, reader, onDebugEvent, }) {
|
|
|
53
58
|
// Mirror of `phases` for the change check OUTSIDE the state updater — a
|
|
54
59
|
// sink call inside an updater would double-fire under StrictMode.
|
|
55
60
|
const phasesRef = useRef({});
|
|
61
|
+
const diagnosesRef = useRef({});
|
|
56
62
|
const onViewPhase = useCallback((key, phase) => {
|
|
57
63
|
if (phasesRef.current[key] !== phase) {
|
|
58
64
|
phasesRef.current = { ...phasesRef.current, [key]: phase };
|
|
59
|
-
|
|
65
|
+
const diagnosis = diagnosesRef.current[key];
|
|
66
|
+
debugSink.current?.({
|
|
67
|
+
type: "view-phase",
|
|
68
|
+
key,
|
|
69
|
+
phase,
|
|
70
|
+
...(diagnosis !== undefined ? { diagnosis } : {}),
|
|
71
|
+
});
|
|
60
72
|
}
|
|
61
73
|
setPhases((prev) => (prev[key] === phase ? prev : { ...prev, [key]: phase }));
|
|
62
74
|
}, []);
|
|
75
|
+
// The tripwire fires BEFORE the negotiation window lapses (a blocked
|
|
76
|
+
// runtime never negotiates), so the diagnosis is usually known by the
|
|
77
|
+
// time `no-handshake` arrives — the phase event above carries it. If it
|
|
78
|
+
// lands after, re-emit the current phase with the verdict so a debug
|
|
79
|
+
// sink still sees the pairing.
|
|
80
|
+
const onViewDiagnosis = useCallback((key, diagnosis) => {
|
|
81
|
+
if (diagnosesRef.current[key] === diagnosis)
|
|
82
|
+
return;
|
|
83
|
+
diagnosesRef.current = { ...diagnosesRef.current, [key]: diagnosis };
|
|
84
|
+
const phase = phasesRef.current[key];
|
|
85
|
+
if (phase !== undefined)
|
|
86
|
+
debugSink.current?.({ type: "view-phase", key, phase, diagnosis });
|
|
87
|
+
setDiagnoses((prev) => (prev[key] === diagnosis ? prev : { ...prev, [key]: diagnosis }));
|
|
88
|
+
}, []);
|
|
63
89
|
// Plan-derived debug events, emitted once per sighting (post-render — the
|
|
64
90
|
// plan itself stays pure data).
|
|
65
91
|
const emittedUnknowns = useRef(new Set());
|
|
@@ -116,7 +142,7 @@ export function useTranscript({ inputs, policy, reader, onDebugEvent, }) {
|
|
|
116
142
|
void resolveViewMount(locator, read).then((resolved) => settle(resolved ?? "expired"), () => settle("expired"));
|
|
117
143
|
}
|
|
118
144
|
}, [plan, resolvedMounts]);
|
|
119
|
-
return { plan, toggle, overrides, onViewPhase, resolvedMounts };
|
|
145
|
+
return { plan, toggle, overrides, onViewPhase, onViewDiagnosis, resolvedMounts };
|
|
120
146
|
}
|
|
121
147
|
/** How often the escalation clock ticks while a status needs one. */
|
|
122
148
|
const ELAPSED_TICK_MS = 500;
|
package/dist/strings.d.ts
CHANGED
|
@@ -47,6 +47,17 @@ export interface ChatStrings {
|
|
|
47
47
|
viewInlineFallback: string;
|
|
48
48
|
viewExpired: string;
|
|
49
49
|
viewSandboxUnavailable: string;
|
|
50
|
+
/**
|
|
51
|
+
* R6 no-handshake with a CSP diagnosis (guuey#235): the embedding page's
|
|
52
|
+
* own policy blocked the view. Receives the structured verdict so a
|
|
53
|
+
* locale can shape the sentence; the en default names the blocked URI
|
|
54
|
+
* and the exact allowance to add.
|
|
55
|
+
*/
|
|
56
|
+
viewCspBlocked: (diagnosis: {
|
|
57
|
+
blockedUri: string;
|
|
58
|
+
violatedDirective: string;
|
|
59
|
+
suggestedEntry: string;
|
|
60
|
+
}) => string;
|
|
50
61
|
/** guuey#204: the chip text for a mount promoted to a host stage/canvas. */
|
|
51
62
|
viewPromoted: (title: string) => string;
|
|
52
63
|
/** Chip title when the mount has no producing-call title (history cards). */
|
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;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,qDAAq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E,MAAM,CAAC;IACrB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IAEf,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,oBAAoB,EAAE,MAAM,CAAC;IAE7B,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IAEpB,uCAAuC;IACvC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,eAAO,MAAM,kBAAkB,EAAE,WAkEhC,CAAC"}
|
package/dist/strings.js
CHANGED
|
@@ -28,6 +28,7 @@ export const defaultChatStrings = {
|
|
|
28
28
|
viewInlineFallback: "Showing plain content",
|
|
29
29
|
viewExpired: "This view expired",
|
|
30
30
|
viewSandboxUnavailable: "Interactive view unavailable",
|
|
31
|
+
viewCspBlocked: (d) => `This page's Content-Security-Policy blocks ${d.blockedUri} — add "${d.violatedDirective} ${d.suggestedEntry}" to the policy so the view can start`,
|
|
31
32
|
viewPromoted: (title) => `${title} — on canvas`,
|
|
32
33
|
viewRefFallbackTitle: "Card",
|
|
33
34
|
recoveredFromHistory: "recovered from history",
|
package/dist/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { AgGrantMode, AgNoticeSource, AgPausedAsk, AgReduceResult, AgSource, JsonValue } from "@silverprotocol/core";
|
|
15
15
|
import type { AgentInvokeStatus, HistoryCard } from "@guuey/agent-client";
|
|
16
|
-
import type { ViewHostPhase, ViewMount, ViewMountChannel } from "@guuey/mcp-apps-host";
|
|
16
|
+
import type { ViewCspDiagnosis, ViewHostPhase, ViewMount, ViewMountChannel } from "@guuey/mcp-apps-host";
|
|
17
17
|
/**
|
|
18
18
|
* One settled entry of the flat conversation transcript — structurally
|
|
19
19
|
* compatible with the hook's `AgentMessage`, plus the optional
|
|
@@ -119,6 +119,14 @@ export interface TranscriptInputs {
|
|
|
119
119
|
sendStates?: Readonly<Record<string, "sending" | "failed">>;
|
|
120
120
|
/** mountKey → live phase (R6 states). Keys match `ViewMountItem.key`. */
|
|
121
121
|
viewPhases?: Readonly<Record<string, ViewHostPhase>>;
|
|
122
|
+
/**
|
|
123
|
+
* mountKey → the host's CSP tripwire verdict (guuey#235): the embedding
|
|
124
|
+
* page's own policy blocked the view. Renderer-supplied like
|
|
125
|
+
* `viewPhases` (`<GuueyView onCspDiagnosis>` → `useTranscript`); a
|
|
126
|
+
* `no-handshake` mount with a diagnosis labels the actionable cause
|
|
127
|
+
* instead of the channel heuristic.
|
|
128
|
+
*/
|
|
129
|
+
viewDiagnoses?: Readonly<Record<string, ViewCspDiagnosis>>;
|
|
122
130
|
/**
|
|
123
131
|
* The mount key a host-owned stage/canvas surface currently shows
|
|
124
132
|
* (guuey#204 "promote and reference") — renderer-supplied state, like
|
|
@@ -228,6 +236,12 @@ export interface ViewMountItem extends BaseItem {
|
|
|
228
236
|
phase: ViewHostPhase | "expired";
|
|
229
237
|
/** The channel-aware state label the renderer shows for non-connected phases. */
|
|
230
238
|
label: string | null;
|
|
239
|
+
/**
|
|
240
|
+
* The CSP tripwire's verdict when the embedding page blocked this view
|
|
241
|
+
* (guuey#235) — WHY a `no-handshake`; `label` already carries its
|
|
242
|
+
* message, this is the structured form for renderers/debug sinks.
|
|
243
|
+
*/
|
|
244
|
+
diagnosis: ViewCspDiagnosis | null;
|
|
231
245
|
/** Calm chrome: "via {tool}" when this mount broke an R4 group. */
|
|
232
246
|
attribution: string | null;
|
|
233
247
|
/** The producing call's humanized title (live mounts); null for history cards. */
|
|
@@ -397,6 +411,8 @@ export type ChatDebugEvent = {
|
|
|
397
411
|
type: "view-phase";
|
|
398
412
|
key: ItemKey;
|
|
399
413
|
phase: ViewHostPhase | "expired";
|
|
414
|
+
/** Present when the host's CSP tripwire diagnosed the failure (guuey#235). */
|
|
415
|
+
diagnosis?: ViewCspDiagnosis;
|
|
400
416
|
} | {
|
|
401
417
|
type: "unknown-block";
|
|
402
418
|
key: ItemKey;
|
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,
|
|
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;IACx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AAa,GACb,UAAU,GACV,UAAU,GACV,SAAS,GACT,mBAAmB,GACnB,cAAc,GACd,WAAW,CAAC;AAEhB,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,QAAQ,CAAC;IACd,KAAK,EACD,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,SAAS,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,cAAc,GACtB;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B,GACD;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C,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;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guuey/chat",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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.0",
|
|
40
40
|
"@silverprotocol/richtext": "0.5.0",
|
|
41
41
|
"zod": "^4.3.6",
|
|
42
|
-
"@guuey/agent-client": "0.7.
|
|
43
|
-
"@guuey/mcp-apps-host": "0.7.
|
|
42
|
+
"@guuey/agent-client": "0.7.2",
|
|
43
|
+
"@guuey/mcp-apps-host": "0.7.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=18",
|
|
@@ -1085,6 +1085,7 @@ exports[`corpus > 7. view-never-handshakes — channel-aware labels on both chan
|
|
|
1085
1085
|
"actionScope": null,
|
|
1086
1086
|
"attribution": "via render form",
|
|
1087
1087
|
"channel": "inline",
|
|
1088
|
+
"diagnosis": null,
|
|
1088
1089
|
"expanded": true,
|
|
1089
1090
|
"key": "view.tInline",
|
|
1090
1091
|
"kind": "view",
|
|
@@ -1116,6 +1117,7 @@ exports[`corpus > 7. view-never-handshakes — channel-aware labels on both chan
|
|
|
1116
1117
|
"actionScope": "ui://ggui/render/render_00000000-0000-4000-8000-300000000001/c0ffee",
|
|
1117
1118
|
"attribution": "via ggui render",
|
|
1118
1119
|
"channel": "locator",
|
|
1120
|
+
"diagnosis": null,
|
|
1119
1121
|
"expanded": true,
|
|
1120
1122
|
"key": "view.tGgui",
|
|
1121
1123
|
"kind": "view",
|
|
@@ -1201,6 +1203,7 @@ exports[`corpus > 9. history-dead-locators — the expired path beside a healthy
|
|
|
1201
1203
|
"actionScope": "ui://ggui/render/old/1",
|
|
1202
1204
|
"attribution": null,
|
|
1203
1205
|
"channel": "locator",
|
|
1206
|
+
"diagnosis": null,
|
|
1204
1207
|
"expanded": true,
|
|
1205
1208
|
"key": "card.1",
|
|
1206
1209
|
"kind": "view",
|
|
@@ -1216,6 +1219,7 @@ exports[`corpus > 9. history-dead-locators — the expired path beside a healthy
|
|
|
1216
1219
|
"actionScope": null,
|
|
1217
1220
|
"attribution": null,
|
|
1218
1221
|
"channel": null,
|
|
1222
|
+
"diagnosis": null,
|
|
1219
1223
|
"expanded": true,
|
|
1220
1224
|
"key": "card.2",
|
|
1221
1225
|
"kind": "view",
|
|
@@ -1492,6 +1496,7 @@ exports[`corpus > 15. tools-around-a-view — the group SPLITS at the view's pos
|
|
|
1492
1496
|
"actionScope": null,
|
|
1493
1497
|
"attribution": "via ggui render",
|
|
1494
1498
|
"channel": "inline",
|
|
1499
|
+
"diagnosis": null,
|
|
1495
1500
|
"expanded": true,
|
|
1496
1501
|
"key": "view.t3",
|
|
1497
1502
|
"kind": "view",
|
|
@@ -1633,6 +1638,7 @@ exports[`corpus > 19. persisted-plus-live — the fold owns its trailing turns;
|
|
|
1633
1638
|
"actionScope": "ui://ggui/render/render_00000000-0000-4000-8000-300000000001/c0ffee",
|
|
1634
1639
|
"attribution": "via ggui render",
|
|
1635
1640
|
"channel": "locator",
|
|
1641
|
+
"diagnosis": null,
|
|
1636
1642
|
"expanded": true,
|
|
1637
1643
|
"key": "view.tA",
|
|
1638
1644
|
"kind": "view",
|
|
@@ -1676,6 +1682,7 @@ exports[`corpus > 19. persisted-plus-live — the fold owns its trailing turns;
|
|
|
1676
1682
|
"actionScope": "ui://ggui/render/old/1",
|
|
1677
1683
|
"attribution": null,
|
|
1678
1684
|
"channel": "locator",
|
|
1685
|
+
"diagnosis": null,
|
|
1679
1686
|
"expanded": true,
|
|
1680
1687
|
"key": "card.1",
|
|
1681
1688
|
"kind": "view",
|
|
@@ -1835,6 +1842,7 @@ exports[`corpus > 22. promoted-view — the stage's mount chips (guuey#204); oth
|
|
|
1835
1842
|
"actionScope": null,
|
|
1836
1843
|
"attribution": "via ggui render",
|
|
1837
1844
|
"channel": "inline",
|
|
1845
|
+
"diagnosis": null,
|
|
1838
1846
|
"expanded": true,
|
|
1839
1847
|
"key": "view.t1",
|
|
1840
1848
|
"kind": "view",
|
|
@@ -1902,6 +1910,7 @@ exports[`corpus > 23. meta-less-locator — a \`_meta\`-withholding producer's r
|
|
|
1902
1910
|
"actionScope": "ui://ggui/render/render_dark/h1",
|
|
1903
1911
|
"attribution": "via ggui render",
|
|
1904
1912
|
"channel": "locator",
|
|
1913
|
+
"diagnosis": null,
|
|
1905
1914
|
"expanded": true,
|
|
1906
1915
|
"key": "view.t1",
|
|
1907
1916
|
"kind": "view",
|
|
@@ -1946,6 +1955,7 @@ exports[`corpus > 24. prod-wire-ggui-render — ggui's production posture: no _m
|
|
|
1946
1955
|
"actionScope": "ui://ggui/render/render_5d11b1b4-75ba-44e5-81bb-0b420b86bb8e/7328555b44e72bd7",
|
|
1947
1956
|
"attribution": "via ggui render",
|
|
1948
1957
|
"channel": "locator",
|
|
1958
|
+
"diagnosis": null,
|
|
1949
1959
|
"expanded": true,
|
|
1950
1960
|
"key": "view.t1",
|
|
1951
1961
|
"kind": "view",
|
package/src/plan.ts
CHANGED
|
@@ -272,7 +272,7 @@ function trustChannel(item: Pick<ViewMountItem, "mount" | "channel">): "inline"
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
function viewLabel(
|
|
275
|
-
item: Pick<ViewMountItem, "phase" | "channel" | "mount">,
|
|
275
|
+
item: Pick<ViewMountItem, "phase" | "channel" | "mount" | "diagnosis">,
|
|
276
276
|
policy: TranscriptPolicy,
|
|
277
277
|
): string | null {
|
|
278
278
|
const s = policy.strings;
|
|
@@ -284,6 +284,10 @@ function viewLabel(
|
|
|
284
284
|
case "expired":
|
|
285
285
|
return s.viewExpired;
|
|
286
286
|
case "no-handshake":
|
|
287
|
+
// The host's CSP tripwire outranks the channel heuristic (guuey#235):
|
|
288
|
+
// a blocked runtime never negotiates on ANY channel, and the verdict
|
|
289
|
+
// is actionable — name the blocked URI and the allowance.
|
|
290
|
+
if (item.diagnosis !== null) return s.viewCspBlocked(item.diagnosis);
|
|
287
291
|
// Channel-aware (R6): a ggui shell that never handshakes is a boot
|
|
288
292
|
// failure; inline tenant HTML may legitimately be a non-App document.
|
|
289
293
|
// Keyed on the TRUST channel (locators resolve to it by uri), not the
|
|
@@ -427,6 +431,7 @@ function planAssistantSource(
|
|
|
427
431
|
channel: mount.channel,
|
|
428
432
|
phase: inputs.viewPhases?.[viewKey] ?? "negotiating",
|
|
429
433
|
label: null,
|
|
434
|
+
diagnosis: inputs.viewDiagnoses?.[viewKey] ?? null,
|
|
430
435
|
attribution: policy.debugDetail ? null : policy.strings.viaTool(tool.title),
|
|
431
436
|
toolTitle: tool.title,
|
|
432
437
|
// `result` is narrowed by `mount !== undefined` above; the scope
|
|
@@ -823,6 +828,7 @@ export function planTranscript(
|
|
|
823
828
|
channel: mount?.channel ?? null,
|
|
824
829
|
phase: mount === undefined ? "expired" : (inputs.viewPhases?.[key] ?? "negotiating"),
|
|
825
830
|
label: null,
|
|
831
|
+
diagnosis: mount === undefined ? null : (inputs.viewDiagnoses?.[key] ?? null),
|
|
826
832
|
attribution: null,
|
|
827
833
|
toolTitle: null,
|
|
828
834
|
actionScope: scope,
|
package/src/react/components.tsx
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
type ReactNode,
|
|
27
27
|
} from "react";
|
|
28
28
|
import { GuueyView, type GuueyViewProps } from "@guuey/mcp-apps-host/react";
|
|
29
|
-
import type { ResolvedViewMount, ViewHostPhase } from "@guuey/mcp-apps-host";
|
|
29
|
+
import type { ResolvedViewMount, ViewCspDiagnosis, ViewHostPhase } from "@guuey/mcp-apps-host";
|
|
30
30
|
import type { ChatStrings } from "../strings.js";
|
|
31
31
|
import type {
|
|
32
32
|
CitationsItem,
|
|
@@ -74,6 +74,12 @@ export interface TranscriptItemContext {
|
|
|
74
74
|
resolvedMounts: ReadonlyMap<ItemKey, ResolvedViewMount | "expired">;
|
|
75
75
|
/** R6: live phase reports wired back into the next plan. */
|
|
76
76
|
onViewPhase: (key: ItemKey, phase: ViewHostPhase) => void;
|
|
77
|
+
/**
|
|
78
|
+
* R6: the host's CSP tripwire diagnosed the embedding page blocking a
|
|
79
|
+
* view (guuey#235) — wired back so the label names the cause. Optional:
|
|
80
|
+
* a hand-wired host that omits it simply keeps the channel heuristic.
|
|
81
|
+
*/
|
|
82
|
+
onViewDiagnosis?: (key: ItemKey, diagnosis: ViewCspDiagnosis) => void;
|
|
77
83
|
/**
|
|
78
84
|
* guuey#204: a promoted-view reference chip was activated — the host
|
|
79
85
|
* focuses/reveals its stage (canvas). Absent ⇒ the chip renders as a
|
|
@@ -107,6 +113,7 @@ export type ViewSlotProps = Pick<
|
|
|
107
113
|
| "allow"
|
|
108
114
|
| "sandboxPageUrl"
|
|
109
115
|
| "autoResize"
|
|
116
|
+
| "cspOrigins"
|
|
110
117
|
>;
|
|
111
118
|
|
|
112
119
|
interface ItemProps<T> {
|
|
@@ -365,6 +372,7 @@ export function DefaultView({ item, ctx }: ItemProps<ViewMountItem>): ReactNode
|
|
|
365
372
|
mount={mount}
|
|
366
373
|
{...viewProps}
|
|
367
374
|
onPhaseChange={(phase) => ctx.onViewPhase(item.key, phase)}
|
|
375
|
+
onCspDiagnosis={(diagnosis) => ctx.onViewDiagnosis?.(item.key, diagnosis)}
|
|
368
376
|
/>
|
|
369
377
|
{item.attribution !== null ? (
|
|
370
378
|
<p className="guuey-chat-attribution">{item.attribution}</p>
|
package/src/react/guuey-chat.tsx
CHANGED
|
@@ -288,7 +288,7 @@ export const GuueyChat = forwardRef<GuueyChatHandle, GuueyChatProps>(function Gu
|
|
|
288
288
|
}, [preset, policyOverrides, stringOverrides]);
|
|
289
289
|
|
|
290
290
|
const { inputs, resolvePrompt, answerHitlPrompt } = useTranscriptInputs(invoke);
|
|
291
|
-
const { plan, toggle, resolvedMounts, onViewPhase } = useTranscript({
|
|
291
|
+
const { plan, toggle, resolvedMounts, onViewPhase, onViewDiagnosis } = useTranscript({
|
|
292
292
|
inputs,
|
|
293
293
|
policy,
|
|
294
294
|
...(effectiveReader !== undefined ? { reader: effectiveReader } : {}),
|
|
@@ -427,6 +427,7 @@ export const GuueyChat = forwardRef<GuueyChatHandle, GuueyChatProps>(function Gu
|
|
|
427
427
|
{...(onErrorAction !== undefined ? { onErrorAction } : {})}
|
|
428
428
|
resolvedMounts={resolvedMounts}
|
|
429
429
|
onViewPhase={onViewPhase}
|
|
430
|
+
onViewDiagnosis={onViewDiagnosis}
|
|
430
431
|
{...(viewProps !== undefined ? { viewProps } : {})}
|
|
431
432
|
/>
|
|
432
433
|
<form
|
package/src/react/transcript.tsx
CHANGED
|
@@ -46,7 +46,15 @@ export interface TranscriptWindowing {
|
|
|
46
46
|
export interface TranscriptProps
|
|
47
47
|
extends Pick<
|
|
48
48
|
TranscriptItemContext,
|
|
49
|
-
|
|
49
|
+
| "onToggle"
|
|
50
|
+
| "onRetry"
|
|
51
|
+
| "onPromptAction"
|
|
52
|
+
| "onErrorAction"
|
|
53
|
+
| "resolvedMounts"
|
|
54
|
+
| "onViewPhase"
|
|
55
|
+
| "onViewDiagnosis"
|
|
56
|
+
| "onViewRef"
|
|
57
|
+
| "viewProps"
|
|
50
58
|
> {
|
|
51
59
|
plan: TranscriptPlan;
|
|
52
60
|
/** Per-slot component overrides (spec §3's override column). */
|
|
@@ -77,6 +85,7 @@ export function Transcript(props: TranscriptProps): ReactNode {
|
|
|
77
85
|
onErrorAction,
|
|
78
86
|
resolvedMounts,
|
|
79
87
|
onViewPhase,
|
|
88
|
+
onViewDiagnosis,
|
|
80
89
|
onViewRef,
|
|
81
90
|
viewProps,
|
|
82
91
|
} = props;
|
|
@@ -86,8 +95,19 @@ export function Transcript(props: TranscriptProps): ReactNode {
|
|
|
86
95
|
[components],
|
|
87
96
|
);
|
|
88
97
|
const ctx: TranscriptItemContext = useMemo(
|
|
89
|
-
() => ({
|
|
90
|
-
|
|
98
|
+
() => ({
|
|
99
|
+
strings,
|
|
100
|
+
onToggle,
|
|
101
|
+
onRetry,
|
|
102
|
+
onPromptAction,
|
|
103
|
+
onErrorAction,
|
|
104
|
+
resolvedMounts,
|
|
105
|
+
onViewPhase,
|
|
106
|
+
onViewDiagnosis,
|
|
107
|
+
onViewRef,
|
|
108
|
+
viewProps,
|
|
109
|
+
}),
|
|
110
|
+
[strings, onToggle, onRetry, onPromptAction, onErrorAction, resolvedMounts, onViewPhase, onViewDiagnosis, onViewRef, viewProps],
|
|
91
111
|
);
|
|
92
112
|
|
|
93
113
|
// ── Windowing ────────────────────────────────────────────────────────
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
resolveViewMount,
|
|
19
19
|
type ResolvedViewMount,
|
|
20
20
|
type UiResourceReader,
|
|
21
|
+
type ViewCspDiagnosis,
|
|
21
22
|
type ViewHostPhase,
|
|
22
23
|
} from "@guuey/mcp-apps-host";
|
|
23
24
|
import { buildHitlAnswer, hitlPromptsFromFold, type HitlAnswerRecord, type HitlPromptAction } from "../hitl.js";
|
|
@@ -62,6 +63,12 @@ export interface UseTranscriptResult {
|
|
|
62
63
|
overrides: TranscriptOverrides;
|
|
63
64
|
/** Wire to `<GuueyView onPhaseChange>` (the default kit already does). */
|
|
64
65
|
onViewPhase: (key: ItemKey, phase: ViewHostPhase) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Wire to `<GuueyView onCspDiagnosis>` (the default kit already does):
|
|
68
|
+
* the host's CSP tripwire caught the embedding page blocking this view
|
|
69
|
+
* (guuey#235). Feeds `viewDiagnoses` so the R6 label names the cause.
|
|
70
|
+
*/
|
|
71
|
+
onViewDiagnosis: (key: ItemKey, diagnosis: ViewCspDiagnosis) => void;
|
|
65
72
|
/** Locator resolutions: mount material, or `"expired"` for a miss. */
|
|
66
73
|
resolvedMounts: ReadonlyMap<ItemKey, ResolvedViewMount | "expired">;
|
|
67
74
|
}
|
|
@@ -74,6 +81,7 @@ export function useTranscript({
|
|
|
74
81
|
}: UseTranscriptArgs): UseTranscriptResult {
|
|
75
82
|
const [overrides, setOverrides] = useState<TranscriptOverrides>({});
|
|
76
83
|
const [phases, setPhases] = useState<Readonly<Record<string, ViewHostPhase>>>({});
|
|
84
|
+
const [diagnoses, setDiagnoses] = useState<Readonly<Record<string, ViewCspDiagnosis>>>({});
|
|
77
85
|
const [resolvedMounts, setResolvedMounts] = useState<
|
|
78
86
|
ReadonlyMap<ItemKey, ResolvedViewMount | "expired">
|
|
79
87
|
>(new Map());
|
|
@@ -83,8 +91,12 @@ export function useTranscript({
|
|
|
83
91
|
debugSink.current = policy.debugDetail && onDebugEvent !== undefined ? onDebugEvent : null;
|
|
84
92
|
|
|
85
93
|
const merged = useMemo<TranscriptInputs>(
|
|
86
|
-
() => ({
|
|
87
|
-
|
|
94
|
+
() => ({
|
|
95
|
+
...inputs,
|
|
96
|
+
viewPhases: { ...inputs.viewPhases, ...phases },
|
|
97
|
+
viewDiagnoses: { ...inputs.viewDiagnoses, ...diagnoses },
|
|
98
|
+
}),
|
|
99
|
+
[inputs, phases, diagnoses],
|
|
88
100
|
);
|
|
89
101
|
const plan = useMemo(() => planTranscript(merged, policy, overrides), [merged, policy, overrides]);
|
|
90
102
|
|
|
@@ -114,13 +126,32 @@ export function useTranscript({
|
|
|
114
126
|
// Mirror of `phases` for the change check OUTSIDE the state updater — a
|
|
115
127
|
// sink call inside an updater would double-fire under StrictMode.
|
|
116
128
|
const phasesRef = useRef<Readonly<Record<string, ViewHostPhase>>>({});
|
|
129
|
+
const diagnosesRef = useRef<Readonly<Record<string, ViewCspDiagnosis>>>({});
|
|
117
130
|
const onViewPhase = useCallback((key: ItemKey, phase: ViewHostPhase) => {
|
|
118
131
|
if (phasesRef.current[key] !== phase) {
|
|
119
132
|
phasesRef.current = { ...phasesRef.current, [key]: phase };
|
|
120
|
-
|
|
133
|
+
const diagnosis = diagnosesRef.current[key];
|
|
134
|
+
debugSink.current?.({
|
|
135
|
+
type: "view-phase",
|
|
136
|
+
key,
|
|
137
|
+
phase,
|
|
138
|
+
...(diagnosis !== undefined ? { diagnosis } : {}),
|
|
139
|
+
});
|
|
121
140
|
}
|
|
122
141
|
setPhases((prev) => (prev[key] === phase ? prev : { ...prev, [key]: phase }));
|
|
123
142
|
}, []);
|
|
143
|
+
// The tripwire fires BEFORE the negotiation window lapses (a blocked
|
|
144
|
+
// runtime never negotiates), so the diagnosis is usually known by the
|
|
145
|
+
// time `no-handshake` arrives — the phase event above carries it. If it
|
|
146
|
+
// lands after, re-emit the current phase with the verdict so a debug
|
|
147
|
+
// sink still sees the pairing.
|
|
148
|
+
const onViewDiagnosis = useCallback((key: ItemKey, diagnosis: ViewCspDiagnosis) => {
|
|
149
|
+
if (diagnosesRef.current[key] === diagnosis) return;
|
|
150
|
+
diagnosesRef.current = { ...diagnosesRef.current, [key]: diagnosis };
|
|
151
|
+
const phase = phasesRef.current[key];
|
|
152
|
+
if (phase !== undefined) debugSink.current?.({ type: "view-phase", key, phase, diagnosis });
|
|
153
|
+
setDiagnoses((prev) => (prev[key] === diagnosis ? prev : { ...prev, [key]: diagnosis }));
|
|
154
|
+
}, []);
|
|
124
155
|
|
|
125
156
|
// Plan-derived debug events, emitted once per sighting (post-render — the
|
|
126
157
|
// plan itself stays pure data).
|
|
@@ -177,7 +208,7 @@ export function useTranscript({
|
|
|
177
208
|
}
|
|
178
209
|
}, [plan, resolvedMounts]);
|
|
179
210
|
|
|
180
|
-
return { plan, toggle, overrides, onViewPhase, resolvedMounts };
|
|
211
|
+
return { plan, toggle, overrides, onViewPhase, onViewDiagnosis, resolvedMounts };
|
|
181
212
|
}
|
|
182
213
|
|
|
183
214
|
// ─── useTranscriptInputs (the live assembler) ──────────────────────────────
|
package/src/strings.ts
CHANGED
|
@@ -55,6 +55,17 @@ export interface ChatStrings {
|
|
|
55
55
|
viewInlineFallback: string;
|
|
56
56
|
viewExpired: string;
|
|
57
57
|
viewSandboxUnavailable: string;
|
|
58
|
+
/**
|
|
59
|
+
* R6 no-handshake with a CSP diagnosis (guuey#235): the embedding page's
|
|
60
|
+
* own policy blocked the view. Receives the structured verdict so a
|
|
61
|
+
* locale can shape the sentence; the en default names the blocked URI
|
|
62
|
+
* and the exact allowance to add.
|
|
63
|
+
*/
|
|
64
|
+
viewCspBlocked: (diagnosis: {
|
|
65
|
+
blockedUri: string;
|
|
66
|
+
violatedDirective: string;
|
|
67
|
+
suggestedEntry: string;
|
|
68
|
+
}) => string;
|
|
58
69
|
/** guuey#204: the chip text for a mount promoted to a host stage/canvas. */
|
|
59
70
|
viewPromoted: (title: string) => string;
|
|
60
71
|
/** Chip title when the mount has no producing-call title (history cards). */
|
|
@@ -136,6 +147,8 @@ export const defaultChatStrings: ChatStrings = {
|
|
|
136
147
|
viewInlineFallback: "Showing plain content",
|
|
137
148
|
viewExpired: "This view expired",
|
|
138
149
|
viewSandboxUnavailable: "Interactive view unavailable",
|
|
150
|
+
viewCspBlocked: (d) =>
|
|
151
|
+
`This page's Content-Security-Policy blocks ${d.blockedUri} — add "${d.violatedDirective} ${d.suggestedEntry}" to the policy so the view can start`,
|
|
139
152
|
viewPromoted: (title) => `${title} — on canvas`,
|
|
140
153
|
viewRefFallbackTitle: "Card",
|
|
141
154
|
|
package/src/types.ts
CHANGED
|
@@ -20,7 +20,12 @@ import type {
|
|
|
20
20
|
JsonValue,
|
|
21
21
|
} from "@silverprotocol/core";
|
|
22
22
|
import type { AgentInvokeStatus, HistoryCard } from "@guuey/agent-client";
|
|
23
|
-
import type {
|
|
23
|
+
import type {
|
|
24
|
+
ViewCspDiagnosis,
|
|
25
|
+
ViewHostPhase,
|
|
26
|
+
ViewMount,
|
|
27
|
+
ViewMountChannel,
|
|
28
|
+
} from "@guuey/mcp-apps-host";
|
|
24
29
|
|
|
25
30
|
/**
|
|
26
31
|
* One settled entry of the flat conversation transcript — structurally
|
|
@@ -128,6 +133,14 @@ export interface TranscriptInputs {
|
|
|
128
133
|
sendStates?: Readonly<Record<string, "sending" | "failed">>;
|
|
129
134
|
/** mountKey → live phase (R6 states). Keys match `ViewMountItem.key`. */
|
|
130
135
|
viewPhases?: Readonly<Record<string, ViewHostPhase>>;
|
|
136
|
+
/**
|
|
137
|
+
* mountKey → the host's CSP tripwire verdict (guuey#235): the embedding
|
|
138
|
+
* page's own policy blocked the view. Renderer-supplied like
|
|
139
|
+
* `viewPhases` (`<GuueyView onCspDiagnosis>` → `useTranscript`); a
|
|
140
|
+
* `no-handshake` mount with a diagnosis labels the actionable cause
|
|
141
|
+
* instead of the channel heuristic.
|
|
142
|
+
*/
|
|
143
|
+
viewDiagnoses?: Readonly<Record<string, ViewCspDiagnosis>>;
|
|
131
144
|
/**
|
|
132
145
|
* The mount key a host-owned stage/canvas surface currently shows
|
|
133
146
|
* (guuey#204 "promote and reference") — renderer-supplied state, like
|
|
@@ -247,6 +260,12 @@ export interface ViewMountItem extends BaseItem {
|
|
|
247
260
|
phase: ViewHostPhase | "expired";
|
|
248
261
|
/** The channel-aware state label the renderer shows for non-connected phases. */
|
|
249
262
|
label: string | null;
|
|
263
|
+
/**
|
|
264
|
+
* The CSP tripwire's verdict when the embedding page blocked this view
|
|
265
|
+
* (guuey#235) — WHY a `no-handshake`; `label` already carries its
|
|
266
|
+
* message, this is the structured form for renderers/debug sinks.
|
|
267
|
+
*/
|
|
268
|
+
diagnosis: ViewCspDiagnosis | null;
|
|
250
269
|
/** Calm chrome: "via {tool}" when this mount broke an R4 group. */
|
|
251
270
|
attribution: string | null;
|
|
252
271
|
/** The producing call's humanized title (live mounts); null for history cards. */
|
|
@@ -448,7 +467,13 @@ export interface StatusLineItem {
|
|
|
448
467
|
* ignores it by design (spec §5's per-preset row).
|
|
449
468
|
*/
|
|
450
469
|
export type ChatDebugEvent =
|
|
451
|
-
| {
|
|
470
|
+
| {
|
|
471
|
+
type: "view-phase";
|
|
472
|
+
key: ItemKey;
|
|
473
|
+
phase: ViewHostPhase | "expired";
|
|
474
|
+
/** Present when the host's CSP tripwire diagnosed the failure (guuey#235). */
|
|
475
|
+
diagnosis?: ViewCspDiagnosis;
|
|
476
|
+
}
|
|
452
477
|
| { type: "unknown-block"; key: ItemKey; typeName: string; byteSize: number }
|
|
453
478
|
| { type: "turn-recovered"; marker: string };
|
|
454
479
|
|