@opencx/widget-react 5.0.0-beta.7 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/Chart.impl--lw4WUeY.cjs +2 -0
  2. package/dist/Chart.impl--lw4WUeY.cjs.map +1 -0
  3. package/dist/Chart.impl-B5gmO6Us.js +207 -0
  4. package/dist/Chart.impl-B5gmO6Us.js.map +1 -0
  5. package/dist/{index-D_f1MZUH.js → index-BiL9m1to.js} +6452 -5051
  6. package/dist/index-BiL9m1to.js.map +1 -0
  7. package/dist/index-rkpSpEfw.cjs +375 -0
  8. package/dist/index-rkpSpEfw.cjs.map +1 -0
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/package.json.d.ts +1 -1
  12. package/dist/src/WidgetPopoverContent.d.ts.map +1 -1
  13. package/dist/src/companion/CompanionContent.d.ts.map +1 -1
  14. package/dist/src/companion/CompanionFrame.d.ts +2 -1
  15. package/dist/src/companion/CompanionFrame.d.ts.map +1 -1
  16. package/dist/src/companion/CompanionQuestions.d.ts +11 -0
  17. package/dist/src/companion/CompanionQuestions.d.ts.map +1 -0
  18. package/dist/src/companion/WidgetCompanion.d.ts.map +1 -1
  19. package/dist/src/companion/message-styles.d.ts +8 -1
  20. package/dist/src/companion/message-styles.d.ts.map +1 -1
  21. package/dist/src/components/ClarificationQuestions.d.ts.map +1 -1
  22. package/dist/src/components/ConnectionsSettings.d.ts.map +1 -1
  23. package/dist/src/components/Header.d.ts.map +1 -1
  24. package/dist/src/components/PageActionCard.d.ts +17 -0
  25. package/dist/src/components/PageActionCard.d.ts.map +1 -0
  26. package/dist/src/components/ReplyQuote.d.ts +7 -0
  27. package/dist/src/components/ReplyQuote.d.ts.map +1 -0
  28. package/dist/src/components/RichText.d.ts +6 -2
  29. package/dist/src/components/RichText.d.ts.map +1 -1
  30. package/dist/src/components/StreamingTurn.d.ts +7 -1
  31. package/dist/src/components/StreamingTurn.d.ts.map +1 -1
  32. package/dist/src/components/UserMessage.d.ts.map +1 -1
  33. package/dist/src/components/configured-text-styles.d.ts +11 -0
  34. package/dist/src/components/configured-text-styles.d.ts.map +1 -0
  35. package/dist/src/components/custom-components/AgentMessageDefaultComponent.d.ts.map +1 -1
  36. package/dist/src/hooks/useInitialQuestionRequired.d.ts +3 -0
  37. package/dist/src/hooks/useInitialQuestionRequired.d.ts.map +1 -0
  38. package/dist/src/index.d.ts.map +1 -1
  39. package/dist/src/json-render/Chart.impl.d.ts.map +1 -1
  40. package/dist/src/json-render/SpecRenderer.d.ts +6 -1
  41. package/dist/src/json-render/SpecRenderer.d.ts.map +1 -1
  42. package/dist/src/json-render/StreamingShimmer.d.ts +12 -0
  43. package/dist/src/json-render/StreamingShimmer.d.ts.map +1 -0
  44. package/dist/src/json-render/chart-axis.d.ts +30 -0
  45. package/dist/src/json-render/chart-axis.d.ts.map +1 -0
  46. package/dist/src/json-render/registry.d.ts.map +1 -1
  47. package/dist/src/json-render/segment-content.d.ts +14 -6
  48. package/dist/src/json-render/segment-content.d.ts.map +1 -1
  49. package/dist/src/page-controls/accessible-name.d.ts +7 -0
  50. package/dist/src/page-controls/accessible-name.d.ts.map +1 -0
  51. package/dist/src/page-controls/act-input.d.ts +18 -0
  52. package/dist/src/page-controls/act-input.d.ts.map +1 -0
  53. package/dist/src/page-controls/act-types.d.ts +28 -0
  54. package/dist/src/page-controls/act-types.d.ts.map +1 -0
  55. package/dist/src/page-controls/act.d.ts +10 -0
  56. package/dist/src/page-controls/act.d.ts.map +1 -0
  57. package/dist/src/page-controls/action-meaning.d.ts +7 -0
  58. package/dist/src/page-controls/action-meaning.d.ts.map +1 -0
  59. package/dist/src/page-controls/control-ref.d.ts +18 -0
  60. package/dist/src/page-controls/control-ref.d.ts.map +1 -0
  61. package/dist/src/page-controls/cursor.d.ts +72 -0
  62. package/dist/src/page-controls/cursor.d.ts.map +1 -0
  63. package/dist/src/page-controls/guard.d.ts +47 -0
  64. package/dist/src/page-controls/guard.d.ts.map +1 -0
  65. package/dist/src/page-controls/native-setter.d.ts +16 -0
  66. package/dist/src/page-controls/native-setter.d.ts.map +1 -0
  67. package/dist/src/page-controls/off-limits.d.ts +16 -0
  68. package/dist/src/page-controls/off-limits.d.ts.map +1 -0
  69. package/dist/src/page-controls/pointer-sequence.d.ts +16 -0
  70. package/dist/src/page-controls/pointer-sequence.d.ts.map +1 -0
  71. package/dist/src/page-controls/read-controls.d.ts +4 -0
  72. package/dist/src/page-controls/read-controls.d.ts.map +1 -0
  73. package/dist/src/page-controls/select-option.d.ts +3 -0
  74. package/dist/src/page-controls/select-option.d.ts.map +1 -0
  75. package/dist/src/page-controls/send-context.d.ts +20 -0
  76. package/dist/src/page-controls/send-context.d.ts.map +1 -0
  77. package/dist/src/page-controls/types.d.ts +52 -0
  78. package/dist/src/page-controls/types.d.ts.map +1 -0
  79. package/dist/src/page-marks/agent-mark.d.ts +6 -5
  80. package/dist/src/page-marks/agent-mark.d.ts.map +1 -1
  81. package/dist/src/page-marks/mark-source.d.ts +6 -0
  82. package/dist/src/page-marks/mark-source.d.ts.map +1 -0
  83. package/dist/src/page-marks/mark-thumbnail.d.ts +2 -0
  84. package/dist/src/page-marks/mark-thumbnail.d.ts.map +1 -1
  85. package/dist/src/page-marks/page-element.d.ts +1 -7
  86. package/dist/src/page-marks/page-element.d.ts.map +1 -1
  87. package/dist/src/page-marks/usePageMarking.d.ts +1 -6
  88. package/dist/src/page-marks/usePageMarking.d.ts.map +1 -1
  89. package/dist/src/page-privacy.d.ts +11 -0
  90. package/dist/src/page-privacy.d.ts.map +1 -0
  91. package/dist/src/screens/chat/ChatFooter.d.ts.map +1 -1
  92. package/dist/src/screens/chat/ChatInput.d.ts +3 -1
  93. package/dist/src/screens/chat/ChatInput.d.ts.map +1 -1
  94. package/dist/src/screens/chat/agent/AgentChatPageActions.d.ts +13 -0
  95. package/dist/src/screens/chat/agent/AgentChatPageActions.d.ts.map +1 -0
  96. package/dist/src/screens/chat/agent/AgentChatPageEffects.d.ts.map +1 -1
  97. package/dist/src/screens/chat/agent/use-page-effect-is-current.d.ts +5 -0
  98. package/dist/src/screens/chat/agent/use-page-effect-is-current.d.ts.map +1 -0
  99. package/dist/src/screens/chat/agent/useStreamFollow.d.ts +4 -0
  100. package/dist/src/screens/chat/agent/useStreamFollow.d.ts.map +1 -1
  101. package/dist/src/screens/chat/usePageMarkComposer.d.ts +1 -0
  102. package/dist/src/screens/chat/usePageMarkComposer.d.ts.map +1 -1
  103. package/dist/src/screens/index.d.ts.map +1 -1
  104. package/package.json +3 -3
  105. package/dist/Chart.impl-C-1c9nkk.js +0 -153
  106. package/dist/Chart.impl-C-1c9nkk.js.map +0 -1
  107. package/dist/Chart.impl-Ck7Md2bC.cjs +0 -2
  108. package/dist/Chart.impl-Ck7Md2bC.cjs.map +0 -1
  109. package/dist/index-B3pRBUF2.cjs +0 -343
  110. package/dist/index-B3pRBUF2.cjs.map +0 -1
  111. package/dist/index-D_f1MZUH.js.map +0 -1
@@ -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,CAgClD"}
@@ -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,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,16 @@
1
+ /** Widget dismissal must distinguish our page actions from visitor clicks. */
2
+ export declare function isAgentPointerEvent(event: Event): boolean;
3
+ /**
4
+ * Click the way a pointer does, not the way `el.click()` does.
5
+ *
6
+ * `el.click()` dispatches one `click` event. Real interfaces listen for far
7
+ * more than that: a dropdown opens on `pointerdown`, a custom button
8
+ * highlights on `pointerover`, a menu item commits on `mouseup`. Anything
9
+ * built on a component library — which is most of what a support agent is
10
+ * ever asked to help with — simply does not respond to a bare click.
11
+ *
12
+ * So: the full sequence a mouse produces, at the control's own centre,
13
+ * with focus moved first like a real press does.
14
+ */
15
+ export declare function firePointerSequence(el: HTMLElement, mayDispatch?: () => boolean): 'not-started' | 'interrupted' | 'completed';
16
+ //# 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":"AAEA,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,WAAW,EACf,WAAW,GAAE,MAAM,OAAoB,GACtC,aAAa,GAAG,aAAa,GAAG,WAAW,CAqD7C"}
@@ -0,0 +1,4 @@
1
+ import { PageControlSnapshot } from './types';
2
+ /** Read the host page's controls for this turn. Never throws. */
3
+ export declare function readPageControls(doc?: Document): PageControlSnapshot;
4
+ //# sourceMappingURL=read-controls.d.ts.map
@@ -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,CA6DrB"}
@@ -0,0 +1,3 @@
1
+ /** Resolve the same unambiguous, enabled option for consent and execution. */
2
+ export declare function resolveSelectOption(element: HTMLElement, value: string | undefined): HTMLOptionElement | null;
3
+ //# sourceMappingURL=select-option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-option.d.ts","sourceRoot":"","sources":["../../../src/page-controls/select-option.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,iBAAiB,GAAG,IAAI,CAsB1B"}
@@ -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;AAIjC;;;;;;;;;;;;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,CAuBtC"}
@@ -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
- selector: z.ZodOptional<z.ZodString>;
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
- * Returns false when the hint doesn't resolve to an element (the page may have
26
- * changed since the context was captured) — callers treat that as a no-op.
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;AAwCxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;iBAStC,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;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,qBAAqB,EAC5B,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,CAmLT"}
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"}
@@ -0,0 +1,6 @@
1
+ import { PageMark } from './page-mark';
2
+ export declare function registerPageMarkSources(mark: PageMark, elements: readonly HTMLElement[]): void;
3
+ export declare function isPageMarkShareable(mark: PageMark): boolean;
4
+ /** Refresh both serialized mark representations from the original live nodes. */
5
+ export declare function pageMarkForSend(mark: PageMark): PageMark | null;
6
+ //# sourceMappingURL=mark-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mark-source.d.ts","sourceRoot":"","sources":["../../../src/page-marks/mark-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAa5C,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,SAAS,WAAW,EAAE,QAGjC;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAa3D;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAa/D"}
@@ -22,4 +22,6 @@ export declare function awaitSnapshotUrl(mark: {
22
22
  export declare function fileFromDataUrl(dataUrl: string, name: string): File | null;
23
23
  /** The key's in-flight/settled snapshot, if one was started. */
24
24
  export declare function getThumbnail(key: object): Promise<string | null> | undefined;
25
+ /** Preserve a validated mark's local preview without sharing mutable metadata. */
26
+ export declare function copyThumbnail(source: object, target: object): void;
25
27
  //# sourceMappingURL=mark-thumbnail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mark-thumbnail.d.ts","sourceRoot":"","sources":["../../../src/page-marks/mark-thumbnail.ts"],"names":[],"mappings":"AA6DA,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,QAE1D;AAID;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9B,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,QAe/C;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAa1E;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAE5E"}
1
+ {"version":3,"file":"mark-thumbnail.d.ts","sourceRoot":"","sources":["../../../src/page-marks/mark-thumbnail.ts"],"names":[],"mappings":"AA+DA,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,QAG1D;AAID;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9B,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,QAoB/C;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAa1E;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAE5E;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAG3D"}
@@ -1,3 +1,4 @@
1
+ export { WIDGET_OWNED_SELECTOR } from '../page-privacy';
1
2
  /**
2
3
  * The page vocabulary shared by every mark on the host page — the visitor's
3
4
  * (`page-mark.ts`) and the agent's (`agent-mark.ts`).
@@ -57,13 +58,6 @@ export declare const VIEWPORT_MARGIN_PX = 8;
57
58
  export declare function clampRectToViewport(rect: Rect, margin?: number): Rect;
58
59
  /** Describe an element for the AI. */
59
60
  export declare function describeElement(el: HTMLElement): MarkedElement;
60
- /**
61
- * The single source of truth for "this node belongs to the widget": the embed
62
- * root, host-portaled chrome, and every mark overlay. Both the `closest()`
63
- * ownership check below and the mark-mode cursor's injected `:not()` chain
64
- * derive from this list — add new widget-owned markers HERE.
65
- */
66
- export declare const WIDGET_OWNED_SELECTOR: readonly ["#opencx-root", "[data-opencx-root]", "[data-opencx-overlay]"];
67
61
  /**
68
62
  * True for nodes that belong to the widget itself — no mark may ever target
69
63
  * the widget's own UI.
@@ -1 +1 @@
1
- {"version":3,"file":"page-element.d.ts","sourceRoot":"","sources":["../../../src/page-marks/page-element.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wDAAwD;AACxD,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAiDF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAoC3D;AAcD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CA+B7D;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAQxC;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,MAA2B,GAClC,IAAI,CAiBN;AAED,sCAAsC;AACtC,wBAAgB,eAAe,CAAC,EAAE,EAAE,WAAW,GAAG,aAAa,CAQ9D;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,0EAIxB,CAAC;AAIX;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAmBlE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,WAAW,GAAG,IAAI,CA8BrB"}
1
+ {"version":3,"file":"page-element.d.ts","sourceRoot":"","sources":["../../../src/page-marks/page-element.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD;;;;;;;GAOG;AAEH,wDAAwD;AACxD,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAiDF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CA0C3D;AAcD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CA+B7D;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAQxC;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,MAA2B,GAClC,IAAI,CAiBN;AAED,sCAAsC;AACtC,wBAAgB,eAAe,CAAC,EAAE,EAAE,WAAW,GAAG,aAAa,CAU9D;AAUD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAwBlE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,WAAW,GAAG,IAAI,CA8BrB"}
@@ -26,16 +26,11 @@ export type MarkHover = {
26
26
  * editor card stays usable, and the complete pointer/click sequence is
27
27
  * swallowed so marking a button never activates it.
28
28
  */
29
- export declare function usePageMarking({ enabled, onAttach, uploadSnapshot, accentColor, zIndex, }: {
29
+ export declare function usePageMarking({ enabled, onAttach, accentColor, zIndex, }: {
30
30
  /** Whether this composer currently exposes page marking. */
31
31
  enabled: boolean;
32
32
  /** Notification only — the provider owns the mark either way. */
33
33
  onAttach?: (mark: PageMark) => void;
34
- /**
35
- * Uploads a mark's thumbnail as a message file and resolves its URL (null
36
- * on failure). Without it, marks are sent text-only after a reload.
37
- */
38
- uploadSnapshot?: (file: File) => Promise<string | null>;
39
34
  accentColor: string;
40
35
  /** Host-page ink layer, normally resolved from the configured widget z-index. */
41
36
  zIndex: number;
@@ -1 +1 @@
1
- {"version":3,"file":"usePageMarking.d.ts","sourceRoot":"","sources":["../../../src/page-marks/usePageMarking.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,IAAI,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AAuBrB,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG;IACtB,uEAAuE;IACvE,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAQF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,cAAc,EACd,WAAW,EACX,MAAM,GACP,EAAE;IACD,4DAA4D;IAC5D,OAAO,EAAE,OAAO,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;CAChB;;;;sBA8BsC,SAAS;mBAoSrC,MAAM;IA2Cb,+DAA+D;;;;EAKlE"}
1
+ {"version":3,"file":"usePageMarking.d.ts","sourceRoot":"","sources":["../../../src/page-marks/usePageMarking.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,IAAI,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AAwBrB,gEAAgE;AAChE,MAAM,MAAM,SAAS,GAAG;IACtB,uEAAuE;IACvE,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAQF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,WAAW,EACX,MAAM,GACP,EAAE;IACD,4DAA4D;IAC5D,OAAO,EAAE,OAAO,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;CAChB;;;;sBA8BsC,SAAS;mBAoSrC,MAAM;IAyCb,+DAA+D;;;;EAKlE"}
@@ -0,0 +1,11 @@
1
+ /** Shared privacy boundary for page names, marks and captures. */
2
+ export declare const WIDGET_OWNED_SELECTOR: readonly ["#opencx-root", "[data-opencx-root]", "[data-opencx-overlay]"];
3
+ export declare const PAGE_VALUE_SELECTOR = "input,textarea,select,[contenteditable]:not([contenteditable=\"false\"]),[role=\"textbox\"],[role=\"searchbox\"],[role=\"combobox\"]";
4
+ export declare function isPageElementPrivate(el: Element): boolean;
5
+ /** Read from live nodes so CSS and private ancestors/referenced labels apply. */
6
+ export declare function safePageText(el: Element): string;
7
+ /** URL metadata never includes credentials, query parameters or fragments. */
8
+ export declare function safePageUrl(value: string): string;
9
+ /** Form values and opaque embedded pixels cannot be reliably redacted. */
10
+ export declare function canCapturePageElement(el: Element): boolean;
11
+ //# sourceMappingURL=page-privacy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-privacy.d.ts","sourceRoot":"","sources":["../../src/page-privacy.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,0EAIxB,CAAC;AAEX,eAAO,MAAM,mBAAmB,yIACgG,CAAC;AAuBjI,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CASzD;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAwBhD;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASjD;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAY1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatFooter.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatFooter.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoE1B,wBAAgB,UAAU,sBA2CzB"}
1
+ {"version":3,"file":"ChatFooter.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatFooter.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoE1B,wBAAgB,UAAU,sBAiDzB"}
@@ -4,7 +4,9 @@ import { default as React } from 'react';
4
4
  * Exported so companion's quick-ask state renders the exact same composer
5
5
  * (not a bespoke bar), inheriting every customization automatically.
6
6
  */
7
- export declare function ChatInput({ trailingActions, placeholder, hideAttachTools, }?: {
7
+ export declare function ChatInput({ trailingActions, placeholder, hideAttachTools, disabled, }?: {
8
+ /** Keep the composer visible while a required starter must be chosen. */
9
+ disabled?: boolean;
8
10
  /**
9
11
  * Extra controls rendered in the composer's action row, just before the
10
12
  * send button. Companion uses it to slot a conversation-history button into
@@ -1 +1 @@
1
- {"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatInput.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AA+C5E;;;;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,qBAuqBL"}
1
+ {"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatInput.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAkD5E;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,eAAe,EACf,WAAW,EACX,eAAe,EACf,QAAgB,GACjB,GAAE;IACD,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;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,qBAytBL"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The agent's hands on the host page.
3
+ *
4
+ * Three things happen here and nowhere else: the visitor is asked before
5
+ * every action, the action is performed against the element the
6
+ * reference resolves to, and the turn is told what actually happened.
7
+ *
8
+ * Every path answers the waiting call exactly once. A refusal, a decline, a
9
+ * click that changed nothing — all of them are answers, because the one
10
+ * thing the agent must never do is fill a silence with a success.
11
+ */
12
+ export declare function AgentChatPageActions(): null;
13
+ //# sourceMappingURL=AgentChatPageActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentChatPageActions.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/AgentChatPageActions.tsx"],"names":[],"mappings":"AAeA;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,SA0JnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AgentChatPageEffects.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/AgentChatPageEffects.tsx"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,SAuDnC"}
1
+ {"version":3,"file":"AgentChatPageEffects.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/AgentChatPageEffects.tsx"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,SAyInC"}
@@ -0,0 +1,5 @@
1
+ /** A delayed DOM effect must still belong to this mounted, active turn. */
2
+ export declare function usePageEffectIsCurrent(effects: readonly {
3
+ key: string;
4
+ }[], isStreaming: boolean): (key: string) => boolean;
5
+ //# sourceMappingURL=use-page-effect-is-current.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-page-effect-is-current.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/use-page-effect-is-current.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,EACnC,WAAW,EAAE,OAAO,SAYZ,MAAM,aAMf"}
@@ -18,6 +18,10 @@ export type StreamFollow = {
18
18
  *
19
19
  * `followKey` is the dependency list whose changes represent "new content"
20
20
  * (e.g. `[messages, liveItems]`); the follow effect re-runs on each change.
21
+ * Content that grows WITHOUT a `followKey` change — a lazily loaded chart
22
+ * chunk resolving, an image decoding, a reopened session's historical turn
23
+ * source landing from its own fetch — is followed through a `ResizeObserver`
24
+ * on the container's rows (below), never through timers.
21
25
  */
22
26
  export declare function useStreamFollow(followKey: DependencyList): StreamFollow;
23
27
  //# sourceMappingURL=useStreamFollow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStreamFollow.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/useStreamFollow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,YAAY,GAAG;IACzB,sCAAsC;IACtC,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/C,4CAA4C;IAC5C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;+CAC2C;IAC3C,cAAc,EAAE,OAAO,CAAC;IACxB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,GAAG,YAAY,CAoCvE"}
1
+ {"version":3,"file":"useStreamFollow.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat/agent/useStreamFollow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,YAAY,GAAG;IACzB,sCAAsC;IACtC,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/C,4CAA4C;IAC5C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;+CAC2C;IAC3C,cAAc,EAAE,OAAO,CAAC;IACxB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,GAAG,YAAY,CAgFvE"}
@@ -21,5 +21,6 @@ export declare function usePageMarkComposer({ enabled, inputRef, }: {
21
21
  disarm: () => void;
22
22
  toggle: () => void;
23
23
  };
24
+ uploadSnapshot: (file: File) => Promise<string | null>;
24
25
  };
25
26
  //# sourceMappingURL=usePageMarkComposer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePageMarkComposer.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/usePageMarkComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;CACjD;;;;;;;;;;;;;EAoCA"}
1
+ {"version":3,"file":"usePageMarkComposer.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/usePageMarkComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;CACjD;;;;;;;;;;;;;2BAcgB,IAAI,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;EAsB7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wBAAgB,UAAU,sBAsDzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wBAAgB,UAAU,sBAsDzB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opencx/widget-react",
3
3
  "private": false,
4
- "version": "5.0.0-beta.7",
4
+ "version": "5.0.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -40,8 +40,8 @@
40
40
  "tailwind-merge": "^2.4.0",
41
41
  "tinycolor2": "^1.6.0",
42
42
  "zod": "^4.3.6",
43
- "@opencx/widget-core": "5.0.0-beta.7",
44
- "@opencx/widget-react-headless": "5.0.0-beta.7"
43
+ "@opencx/widget-core": "5.0.0",
44
+ "@opencx/widget-react-headless": "5.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@types/react": ">=18 <20",
@@ -1,153 +0,0 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import d from "react";
3
- import { PieChart as b, Tooltip as f, Legend as S, Pie as k, Cell as C, Label as R, LineChart as v, CartesianGrid as p, XAxis as y, YAxis as g, Line as z, BarChart as O, Bar as _ } from "recharts";
4
- import { u as K } from "./index-D_f1MZUH.js";
5
- function A() {
6
- const t = d.useRef(null), [n, c] = d.useState(0);
7
- return d.useLayoutEffect(() => {
8
- const r = t.current;
9
- if (!r) return;
10
- const i = () => c(r.clientWidth);
11
- i();
12
- const l = new ResizeObserver(i);
13
- return l.observe(r), () => l.disconnect();
14
- }, []), { ref: t, width: n };
15
- }
16
- const L = "hsl(var(--opencx-foreground, 240 10% 20%))", x = [90, 70, 50, 30].map(
17
- (t) => `color-mix(in oklch, ${L} ${t}%, transparent)`
18
- ), u = (t) => x[t % x.length] ?? L, h = {
19
- borderRadius: 8,
20
- border: "1px solid color-mix(in oklch, currentColor 15%, transparent)",
21
- fontSize: 12
22
- };
23
- function P({
24
- type: t,
25
- data: n,
26
- height: c,
27
- centerLabel: r
28
- }) {
29
- const i = c ?? 220, { ref: l, width: a } = A();
30
- return n.length === 0 ? /* @__PURE__ */ e(T, { height: i }) : /* @__PURE__ */ e("div", { ref: l, className: "w-full text-foreground", style: { height: i }, children: a > 0 && (t === "pie" ? /* @__PURE__ */ s(b, { width: a, height: i, children: [
31
- /* @__PURE__ */ e(f, { contentStyle: h }),
32
- /* @__PURE__ */ e(
33
- S,
34
- {
35
- verticalAlign: "bottom",
36
- iconType: "circle",
37
- iconSize: 8,
38
- wrapperStyle: { fontSize: 12 }
39
- }
40
- ),
41
- /* @__PURE__ */ s(
42
- k,
43
- {
44
- data: n,
45
- dataKey: "value",
46
- nameKey: "label",
47
- outerRadius: "85%",
48
- innerRadius: "60%",
49
- children: [
50
- n.map((o, m) => /* @__PURE__ */ e(C, { fill: u(m) }, m)),
51
- r && /* @__PURE__ */ e(
52
- R,
53
- {
54
- position: "center",
55
- content: ({ viewBox: o }) => {
56
- if (o && "cx" in o && "cy" in o)
57
- return /* @__PURE__ */ e(
58
- "text",
59
- {
60
- x: o.cx,
61
- y: o.cy,
62
- textAnchor: "middle",
63
- dominantBaseline: "middle",
64
- className: "fill-foreground text-2xl font-medium",
65
- children: r
66
- }
67
- );
68
- }
69
- }
70
- )
71
- ]
72
- }
73
- )
74
- ] }) : t === "line" ? /* @__PURE__ */ s(
75
- v,
76
- {
77
- width: a,
78
- height: i,
79
- data: n,
80
- margin: { top: 8, right: 8, bottom: 0, left: -16 },
81
- children: [
82
- /* @__PURE__ */ e(p, { strokeOpacity: 0.15, vertical: !1 }),
83
- /* @__PURE__ */ e(
84
- y,
85
- {
86
- dataKey: "label",
87
- tickLine: !1,
88
- axisLine: !1,
89
- tickMargin: 10,
90
- fontSize: 11
91
- }
92
- ),
93
- /* @__PURE__ */ e(g, { tickLine: !1, axisLine: !1, fontSize: 11, width: 32 }),
94
- /* @__PURE__ */ e(f, { contentStyle: h }),
95
- /* @__PURE__ */ e(
96
- z,
97
- {
98
- type: "monotone",
99
- dataKey: "value",
100
- stroke: u(0),
101
- strokeWidth: 2,
102
- dot: !1
103
- }
104
- )
105
- ]
106
- }
107
- ) : /* @__PURE__ */ s(
108
- O,
109
- {
110
- width: a,
111
- height: i,
112
- data: n,
113
- margin: { top: 8, right: 8, bottom: 0, left: -16 },
114
- children: [
115
- /* @__PURE__ */ e(p, { strokeOpacity: 0.15, vertical: !1 }),
116
- /* @__PURE__ */ e(
117
- y,
118
- {
119
- dataKey: "label",
120
- tickLine: !1,
121
- axisLine: !1,
122
- tickMargin: 10,
123
- fontSize: 11
124
- }
125
- ),
126
- /* @__PURE__ */ e(g, { tickLine: !1, axisLine: !1, fontSize: 11, width: 32 }),
127
- /* @__PURE__ */ e(
128
- f,
129
- {
130
- contentStyle: h,
131
- cursor: { fillOpacity: 0.06 }
132
- }
133
- ),
134
- /* @__PURE__ */ e(_, { dataKey: "value", fill: u(0), radius: [4, 4, 0, 0] })
135
- ]
136
- }
137
- )) });
138
- }
139
- function T({ height: t }) {
140
- const { t: n } = K();
141
- return /* @__PURE__ */ e(
142
- "div",
143
- {
144
- className: "flex w-full items-center justify-center rounded-lg border border-muted-foreground/15 text-xs text-muted-foreground",
145
- style: { height: t },
146
- children: n("json_no_chart_data")
147
- }
148
- );
149
- }
150
- export {
151
- P as default
152
- };
153
- //# sourceMappingURL=Chart.impl-C-1c9nkk.js.map