@opencx/widget-react 5.0.0-beta.1 → 5.0.0-beta.10
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/Chart.impl-Bvq4fPaS.js +207 -0
- package/dist/Chart.impl-Bvq4fPaS.js.map +1 -0
- package/dist/Chart.impl-DraBzR6K.cjs +2 -0
- package/dist/Chart.impl-DraBzR6K.cjs.map +1 -0
- package/dist/index-BmTtBXqX.cjs +375 -0
- package/dist/index-BmTtBXqX.cjs.map +1 -0
- package/dist/index-C_5Vlyu1.js +14032 -0
- package/dist/index-C_5Vlyu1.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json.d.ts +5 -3
- package/dist/src/WidgetImperativeHandler.d.ts.map +1 -1
- package/dist/src/WidgetPopoverContent.d.ts.map +1 -1
- package/dist/src/companion/ChatPicker.d.ts +16 -0
- package/dist/src/companion/ChatPicker.d.ts.map +1 -0
- package/dist/src/companion/CompanionContent.d.ts +1 -3
- package/dist/src/companion/CompanionContent.d.ts.map +1 -1
- package/dist/src/companion/CompanionControlStyles.d.ts +4 -0
- package/dist/src/companion/CompanionControlStyles.d.ts.map +1 -0
- package/dist/src/companion/ConversationTitle.d.ts +4 -0
- package/dist/src/companion/ConversationTitle.d.ts.map +1 -0
- package/dist/src/companion/RestingPill.d.ts +7 -1
- package/dist/src/companion/RestingPill.d.ts.map +1 -1
- package/dist/src/companion/SessionCircles.d.ts +8 -0
- package/dist/src/companion/SessionCircles.d.ts.map +1 -0
- package/dist/src/companion/WidgetCompanion.d.ts.map +1 -1
- package/dist/src/companion/message-styles.d.ts +8 -1
- package/dist/src/companion/message-styles.d.ts.map +1 -1
- package/dist/src/companion/useChatPicker.d.ts +13 -0
- package/dist/src/companion/useChatPicker.d.ts.map +1 -0
- package/dist/src/companion/useCompanionOpenSync.d.ts +9 -0
- package/dist/src/companion/useCompanionOpenSync.d.ts.map +1 -0
- package/dist/src/companion/usePersistedPillDrag.d.ts.map +1 -1
- package/dist/src/companion/useSessionIdentity.d.ts +8 -0
- package/dist/src/companion/useSessionIdentity.d.ts.map +1 -0
- package/dist/src/components/AgentMessageGroup.d.ts +1 -2
- package/dist/src/components/AgentMessageGroup.d.ts.map +1 -1
- package/dist/src/components/ConnectionCard.d.ts +6 -0
- package/dist/src/components/ConnectionCard.d.ts.map +1 -0
- package/dist/src/components/ConnectionsSettings.d.ts +5 -0
- package/dist/src/components/ConnectionsSettings.d.ts.map +1 -0
- package/dist/src/components/Dialoger.d.ts.map +1 -1
- package/dist/src/components/ElicitationForm.d.ts +11 -0
- package/dist/src/components/ElicitationForm.d.ts.map +1 -0
- package/dist/src/components/Header.d.ts.map +1 -1
- package/dist/src/components/MessageActions.d.ts +2 -2
- package/dist/src/components/MessageActions.d.ts.map +1 -1
- package/dist/src/components/PageActionCard.d.ts +17 -0
- package/dist/src/components/PageActionCard.d.ts.map +1 -0
- package/dist/src/components/ReplyQuote.d.ts +7 -0
- package/dist/src/components/ReplyQuote.d.ts.map +1 -0
- package/dist/src/components/StepsGroup.d.ts.map +1 -1
- package/dist/src/components/StreamingTurn.d.ts +7 -1
- package/dist/src/components/StreamingTurn.d.ts.map +1 -1
- package/dist/src/components/TaskPlan.d.ts +12 -0
- package/dist/src/components/TaskPlan.d.ts.map +1 -0
- package/dist/src/components/UserMessage.d.ts.map +1 -1
- package/dist/src/components/ZoomableImage.d.ts.map +1 -1
- package/dist/src/components/custom-components/AgentMessageDefaultComponent.d.ts.map +1 -1
- package/dist/src/components/lib/McpIcon.d.ts +4 -0
- package/dist/src/components/lib/McpIcon.d.ts.map +1 -0
- package/dist/src/components/lib/button.d.ts +2 -0
- package/dist/src/components/lib/button.d.ts.map +1 -1
- package/dist/src/components/lib/wobble.d.ts +3 -3
- package/dist/src/components/lib/wobble.d.ts.map +1 -1
- package/dist/src/hooks/useCanHover.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/json-render/Chart.impl.d.ts.map +1 -1
- package/dist/src/json-render/SpecRenderer.d.ts +6 -1
- package/dist/src/json-render/SpecRenderer.d.ts.map +1 -1
- package/dist/src/json-render/StreamingShimmer.d.ts +12 -0
- package/dist/src/json-render/StreamingShimmer.d.ts.map +1 -0
- package/dist/src/json-render/chart-axis.d.ts +30 -0
- package/dist/src/json-render/chart-axis.d.ts.map +1 -0
- package/dist/src/json-render/registry.d.ts.map +1 -1
- package/dist/src/json-render/segment-content.d.ts +14 -6
- package/dist/src/json-render/segment-content.d.ts.map +1 -1
- package/dist/src/motion.d.ts +1 -0
- package/dist/src/motion.d.ts.map +1 -1
- package/dist/src/page-controls/accessible-name.d.ts +23 -0
- package/dist/src/page-controls/accessible-name.d.ts.map +1 -0
- package/dist/src/page-controls/act-input.d.ts +18 -0
- package/dist/src/page-controls/act-input.d.ts.map +1 -0
- package/dist/src/page-controls/act-types.d.ts +43 -0
- package/dist/src/page-controls/act-types.d.ts.map +1 -0
- package/dist/src/page-controls/act.d.ts +8 -0
- package/dist/src/page-controls/act.d.ts.map +1 -0
- package/dist/src/page-controls/control-ref.d.ts +28 -0
- package/dist/src/page-controls/control-ref.d.ts.map +1 -0
- package/dist/src/page-controls/cursor.d.ts +72 -0
- package/dist/src/page-controls/cursor.d.ts.map +1 -0
- package/dist/src/page-controls/guard.d.ts +47 -0
- package/dist/src/page-controls/guard.d.ts.map +1 -0
- package/dist/src/page-controls/native-setter.d.ts +16 -0
- package/dist/src/page-controls/native-setter.d.ts.map +1 -0
- package/dist/src/page-controls/needs-consent.d.ts +15 -0
- package/dist/src/page-controls/needs-consent.d.ts.map +1 -0
- package/dist/src/page-controls/off-limits.d.ts +16 -0
- package/dist/src/page-controls/off-limits.d.ts.map +1 -0
- package/dist/src/page-controls/pointer-sequence.d.ts +14 -0
- package/dist/src/page-controls/pointer-sequence.d.ts.map +1 -0
- package/dist/src/page-controls/read-controls.d.ts +4 -0
- package/dist/src/page-controls/read-controls.d.ts.map +1 -0
- package/dist/src/page-controls/send-context.d.ts +20 -0
- package/dist/src/page-controls/send-context.d.ts.map +1 -0
- package/dist/src/page-controls/types.d.ts +52 -0
- package/dist/src/page-controls/types.d.ts.map +1 -0
- package/dist/src/page-marks/agent-mark.d.ts +6 -5
- package/dist/src/page-marks/agent-mark.d.ts.map +1 -1
- package/dist/src/screens/chat/ChatInput.d.ts.map +1 -1
- package/dist/src/screens/chat/ChatMain.d.ts.map +1 -1
- package/dist/src/screens/chat/MessageGroups.d.ts +3 -1
- package/dist/src/screens/chat/MessageGroups.d.ts.map +1 -1
- package/dist/src/screens/chat/agent/AgentChatMain.d.ts.map +1 -1
- package/dist/src/screens/chat/agent/AgentChatPageActions.d.ts +13 -0
- package/dist/src/screens/chat/agent/AgentChatPageActions.d.ts.map +1 -0
- package/dist/src/screens/chat/agent/AgentChatPageEffects.d.ts.map +1 -1
- package/dist/src/screens/chat/agent/useStreamFollow.d.ts +4 -0
- package/dist/src/screens/chat/agent/useStreamFollow.d.ts.map +1 -1
- package/dist/src/screens/chat/useMentions.d.ts.map +1 -1
- package/dist/src/screens/sessions/index.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/Chart.impl-Cw-LLbMd.js +0 -153
- package/dist/Chart.impl-Cw-LLbMd.js.map +0 -1
- package/dist/Chart.impl-_h2MWB6m.cjs +0 -2
- package/dist/Chart.impl-_h2MWB6m.cjs.map +0 -1
- package/dist/index-CDQ8VXlE.js +0 -11557
- package/dist/index-CDQ8VXlE.js.map +0 -1
- package/dist/index-CTqMde4I.cjs +0 -234
- package/dist/index-CTqMde4I.cjs.map +0 -1
- package/dist/src/__tests__/motion-contract.spec.d.ts +0 -2
- package/dist/src/__tests__/motion-contract.spec.d.ts.map +0 -1
- package/dist/src/__tests__/question-capabilities.spec.d.ts +0 -2
- package/dist/src/__tests__/question-capabilities.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/app-frame.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/app-frame.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/companion-dismissal.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/companion-dismissal.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/companion-focus.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/companion-focus.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/companion-frame.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/companion-frame.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/companion-geometry.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/companion-geometry.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/companion-keyboard.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/companion-keyboard.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/host-scroll-lock.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/host-scroll-lock.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/layout-picker.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/layout-picker.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/message-styles.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/message-styles.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/use-companion-host-effects.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/use-companion-host-effects.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/use-companion-measurements.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/use-companion-measurements.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/use-host-portal.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/use-host-portal.spec.d.ts.map +0 -1
- package/dist/src/companion/__tests__/use-persisted-pill-drag.spec.d.ts +0 -2
- package/dist/src/companion/__tests__/use-persisted-pill-drag.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/clarification-questions.spec.d.ts +0 -2
- package/dist/src/components/__tests__/clarification-questions.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/dialoger-escape.spec.d.ts +0 -2
- package/dist/src/components/__tests__/dialoger-escape.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/header-title.spec.d.ts +0 -2
- package/dist/src/components/__tests__/header-title.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/message-actions.spec.d.ts +0 -2
- package/dist/src/components/__tests__/message-actions.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/rich-text-sanitize.spec.d.ts +0 -2
- package/dist/src/components/__tests__/rich-text-sanitize.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/steps-group-collapse.spec.d.ts +0 -2
- package/dist/src/components/__tests__/steps-group-collapse.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/steps-reasoning-markdown.spec.d.ts +0 -2
- package/dist/src/components/__tests__/steps-reasoning-markdown.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/steps-tool-io.spec.d.ts +0 -2
- package/dist/src/components/__tests__/steps-tool-io.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/streaming-turn-customization.spec.d.ts +0 -2
- package/dist/src/components/__tests__/streaming-turn-customization.spec.d.ts.map +0 -1
- package/dist/src/components/__tests__/streaming-turn-working.spec.d.ts +0 -2
- package/dist/src/components/__tests__/streaming-turn-working.spec.d.ts.map +0 -1
- package/dist/src/components/custom-components/__tests__/agent-message-spec-history.spec.d.ts +0 -2
- package/dist/src/components/custom-components/__tests__/agent-message-spec-history.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/catalog.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/catalog.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/chart.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/chart.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/json-render-error-boundary.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/json-render-error-boundary.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/normalize-spec.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/normalize-spec.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/phone-agent-card.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/phone-agent-card.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/props.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/props.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/segment-content.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/segment-content.spec.d.ts.map +0 -1
- package/dist/src/json-render/__tests__/spec-renderer.spec.d.ts +0 -2
- package/dist/src/json-render/__tests__/spec-renderer.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/agent-mark.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/agent-mark.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/mark-snapshot-upload.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/mark-snapshot-upload.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/page-element-name.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/page-element-name.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/page-element.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/page-element.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/page-mark-pill.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/page-mark-pill.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/page-mark-theme.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/page-mark-theme.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/page-mark-tile.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/page-mark-tile.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/page-marks-provider.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/page-marks-provider.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/picked-elements.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/picked-elements.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/sent-mark-chip.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/sent-mark-chip.spec.d.ts.map +0 -1
- package/dist/src/page-marks/__tests__/use-page-marking.spec.d.ts +0 -2
- package/dist/src/page-marks/__tests__/use-page-marking.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/__tests__/chat-input-clarification.spec.d.ts +0 -2
- package/dist/src/screens/chat/__tests__/chat-input-clarification.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/__tests__/chatInput.spec.d.ts +0 -2
- package/dist/src/screens/chat/__tests__/chatInput.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/__tests__/use-mentions.spec.d.ts +0 -2
- package/dist/src/screens/chat/__tests__/use-mentions.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/__tests__/useSentTextRecall.spec.d.ts +0 -2
- package/dist/src/screens/chat/__tests__/useSentTextRecall.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/agent/__tests__/agent-chat-main.promotion.spec.d.ts +0 -2
- package/dist/src/screens/chat/agent/__tests__/agent-chat-main.promotion.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/agent/__tests__/agent-chat-page-effects.spec.d.ts +0 -2
- package/dist/src/screens/chat/agent/__tests__/agent-chat-page-effects.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/agent/__tests__/scroll-follow.utils.spec.d.ts +0 -2
- package/dist/src/screens/chat/agent/__tests__/scroll-follow.utils.spec.d.ts.map +0 -1
- package/dist/src/screens/chat/agent/__tests__/useStreamFollow.spec.d.ts +0 -2
- package/dist/src/screens/chat/agent/__tests__/useStreamFollow.spec.d.ts.map +0 -1
- package/dist/src/utils/__tests__/attachment-kind.spec.d.ts +0 -2
- package/dist/src/utils/__tests__/attachment-kind.spec.d.ts.map +0 -1
- package/dist/src/utils/__tests__/keybindings.spec.d.ts +0 -2
- package/dist/src/utils/__tests__/keybindings.spec.d.ts.map +0 -1
- package/dist/src/utils/__tests__/resolve-trigger-side.spec.d.ts +0 -2
- package/dist/src/utils/__tests__/resolve-trigger-side.spec.d.ts.map +0 -1
- package/dist/src/utils/__tests__/strip-citation-refs.spec.d.ts +0 -2
- package/dist/src/utils/__tests__/strip-citation-refs.spec.d.ts.map +0 -1
- package/dist/src/utils/__tests__/strip-inline-markdown.spec.d.ts +0 -2
- package/dist/src/utils/__tests__/strip-inline-markdown.spec.d.ts.map +0 -1
- package/dist/src/utils/__tests__/svg-mask-url.spec.d.ts +0 -2
- package/dist/src/utils/__tests__/svg-mask-url.spec.d.ts.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Y-axis sizing for the cartesian charts.
|
|
3
|
+
*
|
|
4
|
+
* recharts 2.x has no auto-width axis: `YAxis.width` is a fixed number, and a
|
|
5
|
+
* tick label wider than the room left of its tick pokes out past the svg's
|
|
6
|
+
* left edge, where the viewport clips it. That is how a 120/80/150/90/200 bar
|
|
7
|
+
* chart rendered "0" for every tick in the 400px chat panel — only the last
|
|
8
|
+
* digit of each label survived. The axis is sized from the labels recharts
|
|
9
|
+
* actually painted instead: measured in a browser, estimated where the text
|
|
10
|
+
* cannot be measured (jsdom, a hidden embed).
|
|
11
|
+
*/
|
|
12
|
+
/** recharts' painted Y tick labels (`<text>`, right-anchored at their `x`). */
|
|
13
|
+
export declare const Y_TICK_LABEL_SELECTOR = ".recharts-yAxis .recharts-cartesian-axis-tick-value";
|
|
14
|
+
export declare function estimateTextWidth(text: string, fontSize: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* The painted width of an svg text node: the browser's glyph run when it can
|
|
17
|
+
* report one (a non-positive length means not laid out — a hidden embed), the
|
|
18
|
+
* estimate otherwise.
|
|
19
|
+
*/
|
|
20
|
+
export declare function measureSvgTextWidth(node: Element, fontSize: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* The narrowest `YAxis.width` that keeps every painted tick label inside the
|
|
23
|
+
* svg, or `null` when no Y ticks are in the DOM (a pie, or nothing painted
|
|
24
|
+
* yet). Derived from geometry, not from recharts constants: each label's
|
|
25
|
+
* right edge sits at its tick's `x`, and `currentWidth - x` is whatever gap
|
|
26
|
+
* the axis reserves between label and plot — so the requirement is the widest
|
|
27
|
+
* label plus that gap, whichever tick size/margin recharts applied.
|
|
28
|
+
*/
|
|
29
|
+
export declare function requiredYAxisWidth(container: ParentNode, currentWidth: number, fontSize: number): number | null;
|
|
30
|
+
//# sourceMappingURL=chart-axis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-axis.d.ts","sourceRoot":"","sources":["../../../src/json-render/chart-axis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,wDACqB,CAAC;AAExD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAYD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM3E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAaf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/json-render/registry.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/json-render/registry.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAwE5E,eAAO,MAAQ,QAAQ,gDA4OrB,CAAC;AAEH,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,EAAE,iBAOhC,CAAC"}
|
|
@@ -14,12 +14,20 @@ export type ContentSegment = {
|
|
|
14
14
|
* fence (persist raw, transform on serve). So the history path re-derives the
|
|
15
15
|
* spec from the stored text here.
|
|
16
16
|
*
|
|
17
|
-
* There is exactly ONE spec format: JSONL patch lines
|
|
18
|
-
*
|
|
19
|
-
* that hands back a card emits.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* There is exactly ONE spec format: JSONL patch lines — what the prompt
|
|
18
|
+
* instructs the model to emit inside a ` ```spec ` fence and what every tool
|
|
19
|
+
* that hands back a card emits. A model that forgets the fence still emits the
|
|
20
|
+
* same lines, and the live stream renders them as UI regardless (its transform
|
|
21
|
+
* drains every patch-shaped line, fenced or not), so a run of consecutive bare
|
|
22
|
+
* patch lines outside any fence is a spec block too — otherwise a reloaded
|
|
23
|
+
* transcript shows raw JSON where the customer watched a card.
|
|
24
|
+
*
|
|
25
|
+
* Everything else is markdown. A spec block (fenced or bare) is consumed only
|
|
26
|
+
* after its patches compile to renderable UI; malformed, unsupported, empty,
|
|
27
|
+
* and incomplete-only blocks remain visible as their original text. An
|
|
28
|
+
* unclosed fence (turn cut mid-stream) still compiles when enough valid
|
|
29
|
+
* patches arrived, and a cut-off patch line ending a bare run at the very end
|
|
30
|
+
* of the text is the run's tail, never a stray `{"op":...` bubble.
|
|
23
31
|
*/
|
|
24
32
|
export declare function segmentContent(text: string): ContentSegment[];
|
|
25
33
|
//# sourceMappingURL=segment-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-content.d.ts","sourceRoot":"","sources":["../../../src/json-render/segment-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAE/B
|
|
1
|
+
{"version":3,"file":"segment-content.d.ts","sourceRoot":"","sources":["../../../src/json-render/segment-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAoH7D"}
|
package/dist/src/motion.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
/** Strong ease-out for entering/exiting chrome (fades, veils, headers). */
|
|
13
13
|
export declare const EASE_OUT: readonly [0.23, 1, 0.32, 1];
|
|
14
|
+
export declare const EASE_OUT_CSS: string;
|
|
14
15
|
/** The default enter: a 200ms fade on `EASE_OUT`. */
|
|
15
16
|
export declare const FADE_TRANSITION: {
|
|
16
17
|
readonly duration: 0.2;
|
package/dist/src/motion.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,6BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,6BAA8B,CAAC;AACpD,eAAO,MAAM,YAAY,QAAyC,CAAC;AAEnE,qDAAqD;AACrD,eAAO,MAAM,eAAe;;;CAA6C,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;CAA8C,CAAC;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAUX,eAAO,MAAM,kBAAkB,QAA+C,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,oIAC2G,CAAC;AAEpI,eAAO,MAAM,WAAW,gIACuG,CAAC;AAEhI,eAAO,MAAM,YAAY,oIAC0G,CAAC;AAEpI,eAAO,MAAM,WAAW,yIACgH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The accessible name of a control — the words a screen reader would say.
|
|
3
|
+
*
|
|
4
|
+
* This is the whole point of reading the page: a customer says "the Change
|
|
5
|
+
* plan button", and the only way that matches a node is if we resolved the
|
|
6
|
+
* name the same way their browser does. A CSS class or a tag name is not a
|
|
7
|
+
* name; `aria-label`, a `<label>`, a `placeholder` and the visible text are.
|
|
8
|
+
*
|
|
9
|
+
* A trimmed-down accname resolution, in spec order for the cases that occur
|
|
10
|
+
* on real pages: aria-labelledby → aria-label → the native label (label
|
|
11
|
+
* element, legend, alt, title-of-image) → visible text → placeholder →
|
|
12
|
+
* title. `value` is NEVER a name source, even where the spec allows it for
|
|
13
|
+
* buttons, because an `<input type="submit" value="…">` is the one place
|
|
14
|
+
* where a field's value and its name are the same string, and letting it
|
|
15
|
+
* through would make "no values" depend on an input type.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the name. Returns '' when the control has none — a nameless
|
|
19
|
+
* control is one the agent cannot talk about, so the reader drops it rather
|
|
20
|
+
* than inventing a name out of markup.
|
|
21
|
+
*/
|
|
22
|
+
export declare function accessibleName(el: HTMLElement): string;
|
|
23
|
+
//# sourceMappingURL=accessible-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessible-name.d.ts","sourceRoot":"","sources":["../../../src/page-controls/accessible-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAqDH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAwCtD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What the agent is allowed to ask for. `ref` is the only way to name a
|
|
4
|
+
* control — there is no selector and no text — and the action set is closed,
|
|
5
|
+
* so an invented verb is refused rather than interpreted.
|
|
6
|
+
*/
|
|
7
|
+
export declare const actOnPageInputSchema: z.ZodObject<{
|
|
8
|
+
ref: z.ZodString;
|
|
9
|
+
action: z.ZodEnum<{
|
|
10
|
+
fill: "fill";
|
|
11
|
+
select: "select";
|
|
12
|
+
check: "check";
|
|
13
|
+
click: "click";
|
|
14
|
+
uncheck: "uncheck";
|
|
15
|
+
}>;
|
|
16
|
+
value: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
//# sourceMappingURL=act-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"act-input.d.ts","sourceRoot":"","sources":["../../../src/page-controls/act-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAK/B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Doing something on the customer's page, and knowing whether it happened.
|
|
3
|
+
*
|
|
4
|
+
* The rule that shapes all of this: the agent may only report what the page
|
|
5
|
+
* actually did. Firing a click is easy; knowing whether the click DID
|
|
6
|
+
* anything is the work, and it is the difference between "I've cancelled
|
|
7
|
+
* your subscription" and the truth.
|
|
8
|
+
*/
|
|
9
|
+
/** What the agent can do to a control. Deliberately small. */
|
|
10
|
+
export declare const PAGE_ACTIONS: readonly ["click", "fill", "select", "check", "uncheck"];
|
|
11
|
+
export type PageAction = (typeof PAGE_ACTIONS)[number];
|
|
12
|
+
/**
|
|
13
|
+
* Actions that COMMIT something on the customer's behalf — money moves, a
|
|
14
|
+
* record is destroyed, a form is submitted. These never happen without the
|
|
15
|
+
* visitor saying yes to that exact control, first.
|
|
16
|
+
*
|
|
17
|
+
* Recognised from what the control IS and what it SAYS, because that is all
|
|
18
|
+
* a page reliably tells us. It over-includes on purpose: asking about a
|
|
19
|
+
* harmless "Apply filters" button costs one chip, and not asking about
|
|
20
|
+
* "Delete account" costs an account.
|
|
21
|
+
*/
|
|
22
|
+
export declare const COMMITTING_WORDS: RegExp;
|
|
23
|
+
/** The answer, in the same words the server and the agent use. */
|
|
24
|
+
export type ActOutcome = 'done' | 'covered' | 'gone' | 'hidden' | 'unsupported' | 'no_change' | 'declined';
|
|
25
|
+
export type ActResult = {
|
|
26
|
+
outcome: ActOutcome;
|
|
27
|
+
/** One short sentence for the agent to pass on. Never page text. */
|
|
28
|
+
detail?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* How long the page gets to react before we look at what changed. Long
|
|
32
|
+
* enough for a re-render, a menu to open or a fetch to come back on a local
|
|
33
|
+
* network; short enough that the turn's round trip stays under its budget.
|
|
34
|
+
*/
|
|
35
|
+
export declare const SETTLE_MS = 500;
|
|
36
|
+
/**
|
|
37
|
+
* Controls the widget will never act on, whatever the agent asks and
|
|
38
|
+
* whatever the visitor allows. A password or a file picker is not something
|
|
39
|
+
* an agent types into, and a control inside a cross-origin frame is not
|
|
40
|
+
* something this page can honestly report on.
|
|
41
|
+
*/
|
|
42
|
+
export declare const NEVER_ACT_INPUT_TYPES: Set<string>;
|
|
43
|
+
//# sourceMappingURL=act-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"act-types.d.ts","sourceRoot":"","sources":["../../../src/page-controls/act-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,8DAA8D;AAC9D,eAAO,MAAM,YAAY,0DAMf,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAC4M,CAAC;AAE1O,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,SAAS,GACT,MAAM,GACN,QAAQ,GACR,aAAa,GACb,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,UAAU,CAAC;IACpB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAA0C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"act.d.ts","sourceRoot":"","sources":["../../../src/page-controls/act.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AA+FrB,wBAAsB,SAAS,CAAC,KAAK,EAAE;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,SAAS,CAAC,CAerB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The table behind the references — held here, in the page, never sent.
|
|
3
|
+
*
|
|
4
|
+
* Every control the agent can talk about is one the reader put in this table
|
|
5
|
+
* in this turn. The wire carries `c7`; only this module knows which node
|
|
6
|
+
* that is. Three properties fall out of that, and they are the reason the
|
|
7
|
+
* table exists instead of the agent authoring CSS selectors:
|
|
8
|
+
*
|
|
9
|
+
* - The agent cannot reach a node we did not offer it. There is no selector
|
|
10
|
+
* to widen, no text to guess at, no way to name the password field we
|
|
11
|
+
* skipped.
|
|
12
|
+
* - A reference is checkable. Before drawing or clicking, `resolve` says
|
|
13
|
+
* whether that exact node is still in the document — a stale reference
|
|
14
|
+
* after a re-render is a "no", not a click on whatever moved into place.
|
|
15
|
+
* - The nodes are held weakly, so a table entry never keeps a detached
|
|
16
|
+
* subtree of the customer's page alive.
|
|
17
|
+
*/
|
|
18
|
+
/** Open a new reading. Returns the mint function for its references. */
|
|
19
|
+
export declare function beginSnapshot(): (el: HTMLElement) => string;
|
|
20
|
+
/**
|
|
21
|
+
* The element behind a reference, or null — gone from the table, collected,
|
|
22
|
+
* or no longer in the document. "No longer the same node" and "not found"
|
|
23
|
+
* are deliberately the same answer: both mean do not act.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveRef(ref: string): HTMLElement | null;
|
|
26
|
+
/** Test seam: forget every reading. */
|
|
27
|
+
export declare function resetRefsForTest(): void;
|
|
28
|
+
//# sourceMappingURL=control-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-ref.d.ts","sourceRoot":"","sources":["../../../src/page-controls/control-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,wEAAwE;AACxE,wBAAgB,aAAa,IAAI,CAAC,EAAE,EAAE,WAAW,KAAK,MAAM,CAW3D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAM1D;AAED,uCAAuC;AACvC,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pointer the visitor watches.
|
|
3
|
+
*
|
|
4
|
+
* Without it the page simply changes: a menu opens, a field fills, and the
|
|
5
|
+
* customer is left to work out whether they did that or something did it to
|
|
6
|
+
* them. A cursor that travels to the control and presses it answers that
|
|
7
|
+
* before they have to ask.
|
|
8
|
+
*
|
|
9
|
+
* It is drawn, never simulated input — the real events still come from
|
|
10
|
+
* `firePointerSequence`. The two are kept in step by aiming both at the same
|
|
11
|
+
* point: the control's centre. If the gesture and the event were allowed to
|
|
12
|
+
* drift apart this would be theatre, and theatre about what an agent did to
|
|
13
|
+
* someone's account is worse than no animation at all.
|
|
14
|
+
*
|
|
15
|
+
* Widget-owned and `pointer-events: none` throughout. It lives inside a
|
|
16
|
+
* fixed, clipped, full-viewport layer so travelling near an edge cannot
|
|
17
|
+
* grow the host page's scroll area, and it never touches a customer
|
|
18
|
+
* element or intercepts a click.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CURSOR_APPEAR_MS = 260;
|
|
21
|
+
/** The long haul. A hand crossing a dashboard takes about this. */
|
|
22
|
+
export declare const CURSOR_TRAVEL_MS = 1600;
|
|
23
|
+
/** A hand stops before it presses; without this the two moves read as one jerk. */
|
|
24
|
+
export declare const CURSOR_REST_MS = 180;
|
|
25
|
+
export declare const CURSOR_PRESS_MS = 240;
|
|
26
|
+
type Cursor = {
|
|
27
|
+
/** Travel to a viewport point and stop there. */
|
|
28
|
+
moveTo(x: number, y: number): Promise<void>;
|
|
29
|
+
/** The squash and ring that read as a press. */
|
|
30
|
+
press(): Promise<void>;
|
|
31
|
+
/** Fade out and release the node. */
|
|
32
|
+
release(): void;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Take the pointer off the page NOW.
|
|
36
|
+
*
|
|
37
|
+
* `release` fades, which is right at the end of the work and wrong when
|
|
38
|
+
* something else is starting: the fade outlives the call, so effects in
|
|
39
|
+
* quick succession left ghosts drifting behind the live one. Anything still
|
|
40
|
+
* carrying the marker is removed outright here.
|
|
41
|
+
*/
|
|
42
|
+
export declare function dismissAgentCursor(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Put a pointer on the page, or hand back the one already there.
|
|
45
|
+
*
|
|
46
|
+
* Returns null when the document will not have it — the caller then does
|
|
47
|
+
* its own thing silently, because a missing animation must never stop the
|
|
48
|
+
* actual work.
|
|
49
|
+
*/
|
|
50
|
+
export declare function showAgentCursor(from?: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
}): Cursor | null;
|
|
54
|
+
/** The point both the gesture and the real event aim at. */
|
|
55
|
+
export declare function centreOf(el: HTMLElement): {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Bring the control into view and walk the pointer to it.
|
|
61
|
+
*
|
|
62
|
+
* Every failure here is swallowed on purpose. The caller owes the waiting
|
|
63
|
+
* turn an answer, and an animation that cannot run is not a reason to
|
|
64
|
+
* withhold one — the work still happens, it just happens unaccompanied.
|
|
65
|
+
*/
|
|
66
|
+
export declare function travelTo(el: HTMLElement, { press }?: {
|
|
67
|
+
press?: boolean;
|
|
68
|
+
}): Promise<{
|
|
69
|
+
done: () => void;
|
|
70
|
+
}>;
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/page-controls/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,mFAAmF;AACnF,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,eAAe,MAAM,CAAC;AAqFnC,KAAK,MAAM,GAAG;IACZ,iDAAiD;IACjD,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,gDAAgD;IAChD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,qCAAqC;IACrC,OAAO,IAAI,IAAI,CAAC;CACjB,CAAC;AAwBF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAOzC;AAQD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,GAAG,MAAM,GAAG,IAAI,CAgIhB;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAGlE;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,EAAE,EAAE,WAAW,EACf,EAAE,KAAa,EAAE,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1C,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAkB/B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The check that runs immediately before the widget touches a control —
|
|
3
|
+
* before it draws a mark, and (later) before it clicks.
|
|
4
|
+
*
|
|
5
|
+
* Between the reading that produced a reference and the tool call that uses
|
|
6
|
+
* it, a page can do anything: re-render, scroll, open a modal over the top.
|
|
7
|
+
* So the reference is not trusted as a permission to act; it is looked up,
|
|
8
|
+
* and then the element itself is asked three questions. Each "no" is a
|
|
9
|
+
* distinct answer, because the agent has to be able to say which one
|
|
10
|
+
* happened — "it is behind the dialog that just opened" is useful, "it
|
|
11
|
+
* didn't work" is not.
|
|
12
|
+
*/
|
|
13
|
+
export type GuardOutcome =
|
|
14
|
+
/** The element is there, visible, and the topmost thing at its own centre. */
|
|
15
|
+
{
|
|
16
|
+
ok: true;
|
|
17
|
+
element: HTMLElement;
|
|
18
|
+
}
|
|
19
|
+
/** The reference means nothing here: never minted, expired, or detached. */
|
|
20
|
+
| {
|
|
21
|
+
ok: false;
|
|
22
|
+
reason: 'gone';
|
|
23
|
+
}
|
|
24
|
+
/** Still in the document, but not on screen. */
|
|
25
|
+
| {
|
|
26
|
+
ok: false;
|
|
27
|
+
reason: 'hidden';
|
|
28
|
+
}
|
|
29
|
+
/** On screen, but something else is in front of it. */
|
|
30
|
+
| {
|
|
31
|
+
ok: false;
|
|
32
|
+
reason: 'covered';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The page says hands off — a region marked private, something hidden
|
|
36
|
+
* from assistive tech, a credential field, our own UI. Re-checked HERE
|
|
37
|
+
* and not only when the page was read, because a page can mark a region
|
|
38
|
+
* private after the reference to it was handed out.
|
|
39
|
+
*/
|
|
40
|
+
| {
|
|
41
|
+
ok: false;
|
|
42
|
+
reason: 'off-limits';
|
|
43
|
+
detail: string;
|
|
44
|
+
};
|
|
45
|
+
/** Look a reference up and ask the element whether it can be touched. */
|
|
46
|
+
export declare function guardRef(ref: string): GuardOutcome;
|
|
47
|
+
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../../src/page-controls/guard.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY;AACtB,8EAA8E;AAC5E;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE;AACpC,4EAA4E;GAC1E;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAC/B,gDAAgD;GAC9C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE;AACjC,uDAAuD;GACrD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE;AAClC;;;;;GAKG;GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AA6BxD,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CA6BlD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write a value the way a person would, so the framework notices.
|
|
3
|
+
*
|
|
4
|
+
* `el.value = x` sets the DOM property and nothing else. React tracks the
|
|
5
|
+
* last value it wrote on the node itself and compares against it, so a
|
|
6
|
+
* direct assignment followed by an `input` event looks to React like "the
|
|
7
|
+
* value is already what I think it is" and the change is swallowed — the
|
|
8
|
+
* field shows the new text and the app's state still holds the old one.
|
|
9
|
+
* Vue's v-model has the same shape of problem through its own listener.
|
|
10
|
+
*
|
|
11
|
+
* Going through the PROTOTYPE's setter is what a real keystroke does, and
|
|
12
|
+
* it is what makes the tracker see a change. Then the events: `input` for
|
|
13
|
+
* what is being typed, `change` for what was committed.
|
|
14
|
+
*/
|
|
15
|
+
export declare function setNativeValue(el: HTMLElement, value: string): boolean;
|
|
16
|
+
//# sourceMappingURL=native-setter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-setter.d.ts","sourceRoot":"","sources":["../../../src/page-controls/native-setter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAkBtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PageAction } from './act-types';
|
|
2
|
+
/**
|
|
3
|
+
* Does this need the visitor to say yes first?
|
|
4
|
+
*
|
|
5
|
+
* Yes for anything that commits: a payment, a deletion, a form going in.
|
|
6
|
+
* The test is what the control says and what it is — a submit button, or a
|
|
7
|
+
* name with a committing word in it — because that is all a page reliably
|
|
8
|
+
* offers, and because the customer reading "Delete account" is the one who
|
|
9
|
+
* understands what it means here.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately over-inclusive. A chip the visitor did not strictly need
|
|
12
|
+
* costs one tap; a missing chip costs whatever the button did.
|
|
13
|
+
*/
|
|
14
|
+
export declare function needsConsent(el: HTMLElement, action: PageAction): boolean;
|
|
15
|
+
//# sourceMappingURL=needs-consent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"needs-consent.d.ts","sourceRoot":"","sources":["../../../src/page-controls/needs-consent.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAgBzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one list of things the agent may never read, point at or touch —
|
|
3
|
+
* checked when the page is read AND again in the instant before anything
|
|
4
|
+
* happens.
|
|
5
|
+
*
|
|
6
|
+
* Twice, because the two moments are not the same moment. An application
|
|
7
|
+
* marks its card form private when that form mounts, which can be after the
|
|
8
|
+
* message was sent; a dialog becomes `aria-hidden` behind a newer one. A
|
|
9
|
+
* reference minted before any of that still resolves, so a rule enforced
|
|
10
|
+
* only at read time is a rule with a window in it.
|
|
11
|
+
*/
|
|
12
|
+
export type OffLimitsReason = 'private' | 'hidden-from-assistive-tech' | 'credential-field' | 'widget-owned';
|
|
13
|
+
export declare function offLimitsReason(el: HTMLElement): OffLimitsReason | null;
|
|
14
|
+
/** What to tell the agent, without describing what it was kept away from. */
|
|
15
|
+
export declare const OFF_LIMITS_DETAIL: Record<OffLimitsReason, string>;
|
|
16
|
+
//# sourceMappingURL=off-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"off-limits.d.ts","sourceRoot":"","sources":["../../../src/page-controls/off-limits.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,4BAA4B,GAC5B,kBAAkB,GAClB,cAAc,CAAC;AAEnB,wBAAgB,eAAe,CAAC,EAAE,EAAE,WAAW,GAAG,eAAe,GAAG,IAAI,CAWvE;AAED,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAQ7D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Click the way a pointer does, not the way `el.click()` does.
|
|
3
|
+
*
|
|
4
|
+
* `el.click()` dispatches one `click` event. Real interfaces listen for far
|
|
5
|
+
* more than that: a dropdown opens on `pointerdown`, a custom button
|
|
6
|
+
* highlights on `pointerover`, a menu item commits on `mouseup`. Anything
|
|
7
|
+
* built on a component library — which is most of what a support agent is
|
|
8
|
+
* ever asked to help with — simply does not respond to a bare click.
|
|
9
|
+
*
|
|
10
|
+
* So: the full sequence a mouse produces, at the control's own centre,
|
|
11
|
+
* with focus moved first like a real press does.
|
|
12
|
+
*/
|
|
13
|
+
export declare function firePointerSequence(el: HTMLElement): void;
|
|
14
|
+
//# sourceMappingURL=pointer-sequence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer-sequence.d.ts","sourceRoot":"","sources":["../../../src/page-controls/pointer-sequence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAyCzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-controls.d.ts","sourceRoot":"","sources":["../../../src/page-controls/read-controls.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AAsJjB,iEAAiE;AACjE,wBAAgB,gBAAgB,CAC9B,GAAG,GAAE,QAAmB,GACvB,mBAAmB,CAyDrB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PageMark } from '../page-marks/page-mark';
|
|
2
|
+
/**
|
|
3
|
+
* Everything about the customer's page that rides with one message.
|
|
4
|
+
*
|
|
5
|
+
* Two different things, sent together because they answer two different
|
|
6
|
+
* questions. The marks are what the visitor pointed at — deliberate, a
|
|
7
|
+
* gesture. The controls are what is simply THERE, read fresh at send time,
|
|
8
|
+
* so the agent can answer "where do I turn that off" without the visitor
|
|
9
|
+
* having to find and circle the switch first.
|
|
10
|
+
*
|
|
11
|
+
* Only the names go on the wire; the elements behind the references stay in
|
|
12
|
+
* the page (`control-ref.ts`). Reading happens at send time and nowhere
|
|
13
|
+
* else, which is what keeps a page turn free of an extra round trip.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildPageClientContext({ marks, readsPage, }: {
|
|
16
|
+
marks: PageMark[];
|
|
17
|
+
/** The org's page-context feature as the embed narrowed it. */
|
|
18
|
+
readsPage: boolean;
|
|
19
|
+
}): Record<string, unknown> | undefined;
|
|
20
|
+
//# sourceMappingURL=send-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-context.d.ts","sourceRoot":"","sources":["../../../src/page-controls/send-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,+DAA+D;IAC/D,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAmBtC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the agent knows about the controls on the customer's page.
|
|
3
|
+
*
|
|
4
|
+
* The widget reads the page itself and sends NAMES. The elements never
|
|
5
|
+
* leave the browser: each one is held here behind an opaque reference, and
|
|
6
|
+
* every later instruction — point at this, click that — comes back as one of
|
|
7
|
+
* those references. Nothing the agent says can name a node we did not offer
|
|
8
|
+
* it in this turn.
|
|
9
|
+
*
|
|
10
|
+
* What is deliberately absent: values. Not the text in a field, not the
|
|
11
|
+
* option a select is on, not a password, not a file name. A support agent
|
|
12
|
+
* needs to know that a "Change plan" button exists and is greyed out; it
|
|
13
|
+
* never needs to know what the visitor typed into "Card number".
|
|
14
|
+
*/
|
|
15
|
+
/** One control on the host page, as the agent reads it. */
|
|
16
|
+
export type PageControl = {
|
|
17
|
+
/** Opaque handle for this turn. The agent points with it; only we resolve it. */
|
|
18
|
+
ref: string;
|
|
19
|
+
/** What the control IS: button, link, textbox, checkbox, … (ARIA role). */
|
|
20
|
+
role: string;
|
|
21
|
+
/** The control's accessible name — the words a screen reader would say. */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Present and true only when the control cannot be used right now. */
|
|
24
|
+
disabled?: true;
|
|
25
|
+
};
|
|
26
|
+
/** One turn's reading of the page: the controls, and the table behind them. */
|
|
27
|
+
export type PageControlSnapshot = {
|
|
28
|
+
controls: PageControl[];
|
|
29
|
+
/** Whether the page had more controls than the cap allowed us to send. */
|
|
30
|
+
truncated: boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Attribute a customer puts on any part of their page the agent must never
|
|
34
|
+
* read. Everything inside is skipped whole — the control, its name, its
|
|
35
|
+
* existence. The one thing a page owner can say that the reader obeys
|
|
36
|
+
* without interpretation.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PRIVATE_REGION_ATTRIBUTE = "data-opencx-private";
|
|
39
|
+
/**
|
|
40
|
+
* Input types the reader refuses on sight, whatever else is true about them:
|
|
41
|
+
* a password is never described, and a file picker's name can carry the
|
|
42
|
+
* visitor's own file names.
|
|
43
|
+
*/
|
|
44
|
+
export declare const NEVER_READ_INPUT_TYPES: Set<string>;
|
|
45
|
+
/**
|
|
46
|
+
* How many controls one message carries. A page with more than this is read
|
|
47
|
+
* in full (so the cap applies to the busiest part, not a random prefix) but
|
|
48
|
+
* sends only the first `MAX_CONTROLS` in document order, and says so.
|
|
49
|
+
* Chosen against the prompt, not the DOM: 300 names is roughly 3k tokens.
|
|
50
|
+
*/
|
|
51
|
+
export declare const MAX_CONTROLS = 300;
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/page-controls/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,2DAA2D;AAC3D,MAAM,MAAM,WAAW,GAAG;IACxB,iFAAiF;IACjF,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,aAA0C,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const highlightElementInputSchema: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
text: z.ZodOptional<z.ZodString>;
|
|
3
|
+
ref: z.ZodString;
|
|
5
4
|
label: z.ZodOptional<z.ZodString>;
|
|
6
5
|
type: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
|
|
7
6
|
circle: "circle";
|
|
@@ -22,10 +21,12 @@ export declare function dismissActiveHighlight(): void;
|
|
|
22
21
|
* smooth scroll), and float an optional pointing callout. The page stays fully
|
|
23
22
|
* interactive throughout — nothing is dimmed and no click is trapped.
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* Takes the element, not a way of finding one: WHICH element is the caller's
|
|
25
|
+
* decision (`guardRef` — the reference the reader handed out, checked to be
|
|
26
|
+
* the same node, on screen and not covered). The pen only draws. Returns
|
|
27
|
+
* false when the ink could not be laid down at all.
|
|
27
28
|
*/
|
|
28
|
-
export declare function highlightElementOnHostPage(input: HighlightElementInput, { accentColor, surfaceColor, foregroundColor, zIndex, durationMs, seed, }?: {
|
|
29
|
+
export declare function highlightElementOnHostPage(el: HTMLElement, input: Omit<HighlightElementInput, 'ref'>, { accentColor, surfaceColor, foregroundColor, zIndex, durationMs, seed, }?: {
|
|
29
30
|
accentColor?: string;
|
|
30
31
|
surfaceColor?: string;
|
|
31
32
|
foregroundColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-mark.d.ts","sourceRoot":"","sources":["../../../src/page-marks/agent-mark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-mark.d.ts","sourceRoot":"","sources":["../../../src/page-marks/agent-mark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuCxB,eAAO,MAAM,2BAA2B;;;;;;;;;;iBAetC,CAAC;AAEH,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEzE,2FAA2F;AAC3F,eAAO,MAAM,6BAA6B,OAAO,CAAC;AA2BlD,yEAAyE;AACzE,wBAAgB,sBAAsB,SAErC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,EACzC,EACE,WAA4B,EAC5B,YAA6B,EAC7B,eAAiC,EACjC,MAAmB,EACnB,UAA0C,EAC1C,IAAI,GACL,GAAE;IACD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;CACV,GACL,OAAO,CAsLT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatInput.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AA8C5E;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,eAAe,EACf,WAAW,EACX,eAAe,GAChB,GAAE;IACD;;;;OAIG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CACtB,qBA2qBL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMain.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatMain.tsx"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"ChatMain.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatMain.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAUpE,wBAAgB,QAAQ,sBAgFvB"}
|
|
@@ -6,7 +6,9 @@ import { default as React } from 'react';
|
|
|
6
6
|
* (server-resolved agent branding wins); human-agent groups prefer the
|
|
7
7
|
* server-provided sender, patched by the `humanAgent` config override.
|
|
8
8
|
*/
|
|
9
|
-
export declare function MessageGroups({ groups }: {
|
|
9
|
+
export declare function MessageGroups({ groups, pendingReply, }: {
|
|
10
10
|
groups: WidgetMessageU[][];
|
|
11
|
+
/** The latest reply is still being prepared, including between polled updates. */
|
|
12
|
+
pendingReply?: boolean;
|
|
11
13
|
}): React.JSX.Element;
|
|
12
14
|
//# sourceMappingURL=MessageGroups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageGroups.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/MessageGroups.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"MessageGroups.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/MessageGroups.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,YAAoB,GACrB,EAAE;IACD,MAAM,EAAE,cAAc,EAAE,EAAE,CAAC;IAC3B,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,qBAwDA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentChatMain.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/AgentChatMain.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentChatMain.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/AgentChatMain.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAiBvC;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,sBAqN5B"}
|