@squadico/chatbot 1.3.0 → 1.4.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 (106) hide show
  1. package/README.md +109 -20
  2. package/dist/answer-CDGrP8YE.js +1193 -0
  3. package/dist/answer-CDGrP8YE.js.map +1 -0
  4. package/dist/answer-DRaV2dVt.cjs +8 -0
  5. package/dist/answer-DRaV2dVt.cjs.map +1 -0
  6. package/dist/chatbot-widgets.global.js +4 -0
  7. package/dist/chatbot-widgets.global.js.map +1 -0
  8. package/dist/chatbot.global.js +12 -7
  9. package/dist/chatbot.global.js.map +1 -1
  10. package/dist/components/ChatbotWidget.d.ts.map +1 -1
  11. package/dist/components/MessageList.d.ts +4 -1
  12. package/dist/components/MessageList.d.ts.map +1 -1
  13. package/dist/components/RichText.d.ts +6 -4
  14. package/dist/components/RichText.d.ts.map +1 -1
  15. package/dist/extras-ClIRRLqo.js +604 -0
  16. package/dist/extras-ClIRRLqo.js.map +1 -0
  17. package/dist/extras-lsCe4xgN.cjs +4 -0
  18. package/dist/extras-lsCe4xgN.cjs.map +1 -0
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +3 -2
  23. package/dist/jsx.d.ts +41 -0
  24. package/dist/jsx.d.ts.map +1 -1
  25. package/dist/lib/client.d.ts +8 -4
  26. package/dist/lib/client.d.ts.map +1 -1
  27. package/dist/lib/i18n.d.ts +20 -0
  28. package/dist/lib/i18n.d.ts.map +1 -1
  29. package/dist/lib/useChat.d.ts.map +1 -1
  30. package/dist/react.cjs +1 -1
  31. package/dist/react.js +1 -1
  32. package/dist/src-BjqOavOO.js +1984 -0
  33. package/dist/src-BjqOavOO.js.map +1 -0
  34. package/dist/src-DS8P9HdZ.cjs +7 -0
  35. package/dist/src-DS8P9HdZ.cjs.map +1 -0
  36. package/dist/types.d.ts +11 -2
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/widgets/approval/SqcApproval.d.ts +17 -0
  39. package/dist/widgets/approval/SqcApproval.d.ts.map +1 -0
  40. package/dist/widgets/approval/name.d.ts +3 -0
  41. package/dist/widgets/approval/name.d.ts.map +1 -0
  42. package/dist/widgets/chart/SqcChart.d.ts +19 -0
  43. package/dist/widgets/chart/SqcChart.d.ts.map +1 -0
  44. package/dist/widgets/chart/draw.d.ts +31 -0
  45. package/dist/widgets/chart/draw.d.ts.map +1 -0
  46. package/dist/widgets/chart/png.d.ts +10 -0
  47. package/dist/widgets/chart/png.d.ts.map +1 -0
  48. package/dist/widgets/chart/read.d.ts +11 -0
  49. package/dist/widgets/chart/read.d.ts.map +1 -0
  50. package/dist/widgets/chart/strings.d.ts +32 -0
  51. package/dist/widgets/chart/strings.d.ts.map +1 -0
  52. package/dist/widgets/choices/SqcChoices.d.ts +17 -0
  53. package/dist/widgets/choices/SqcChoices.d.ts.map +1 -0
  54. package/dist/widgets/confirm/SqcConfirm.d.ts +12 -0
  55. package/dist/widgets/confirm/SqcConfirm.d.ts.map +1 -0
  56. package/dist/widgets/define.d.ts +8 -0
  57. package/dist/widgets/define.d.ts.map +1 -0
  58. package/dist/widgets/element.d.ts +26 -0
  59. package/dist/widgets/element.d.ts.map +1 -0
  60. package/dist/widgets/extras-loader.d.ts +21 -0
  61. package/dist/widgets/extras-loader.d.ts.map +1 -0
  62. package/dist/widgets/extras.d.ts +3 -0
  63. package/dist/widgets/extras.d.ts.map +1 -0
  64. package/dist/widgets/extras.global.d.ts +2 -0
  65. package/dist/widgets/extras.global.d.ts.map +1 -0
  66. package/dist/widgets/form/SqcForm.d.ts +14 -0
  67. package/dist/widgets/form/SqcForm.d.ts.map +1 -0
  68. package/dist/widgets/form/reply.d.ts +7 -0
  69. package/dist/widgets/form/reply.d.ts.map +1 -0
  70. package/dist/widgets/i18n.d.ts +4 -0
  71. package/dist/widgets/i18n.d.ts.map +1 -0
  72. package/dist/widgets/index.d.ts +10 -0
  73. package/dist/widgets/index.d.ts.map +1 -0
  74. package/dist/widgets/inline.d.ts +11 -0
  75. package/dist/widgets/inline.d.ts.map +1 -0
  76. package/dist/widgets/live.d.ts +12 -0
  77. package/dist/widgets/live.d.ts.map +1 -0
  78. package/dist/widgets/names.d.ts +10 -0
  79. package/dist/widgets/names.d.ts.map +1 -0
  80. package/dist/widgets/parse/answer.d.ts +11 -0
  81. package/dist/widgets/parse/answer.d.ts.map +1 -0
  82. package/dist/widgets/parse/confirm.d.ts +19 -0
  83. package/dist/widgets/parse/confirm.d.ts.map +1 -0
  84. package/dist/widgets/parse/form.d.ts +6 -0
  85. package/dist/widgets/parse/form.d.ts.map +1 -0
  86. package/dist/widgets/styles.d.ts +3 -0
  87. package/dist/widgets/styles.d.ts.map +1 -0
  88. package/dist/widgets/table/SqcTable.d.ts +16 -0
  89. package/dist/widgets/table/SqcTable.d.ts.map +1 -0
  90. package/dist/widgets/types.d.ts +68 -0
  91. package/dist/widgets/types.d.ts.map +1 -0
  92. package/dist/widgets.cjs +1 -0
  93. package/dist/widgets.js +3 -0
  94. package/package.json +7 -2
  95. package/dist/components/Approval.d.ts +0 -37
  96. package/dist/components/Approval.d.ts.map +0 -1
  97. package/dist/components/Choices.d.ts +0 -27
  98. package/dist/components/Choices.d.ts.map +0 -1
  99. package/dist/components/Confirm.d.ts +0 -16
  100. package/dist/components/Confirm.d.ts.map +0 -1
  101. package/dist/lib/confirm.d.ts +0 -17
  102. package/dist/lib/confirm.d.ts.map +0 -1
  103. package/dist/src-DcJyi601.cjs +0 -8
  104. package/dist/src-DcJyi601.cjs.map +0 -1
  105. package/dist/src-Nh5rZvti.js +0 -2710
  106. package/dist/src-Nh5rZvti.js.map +0 -1
package/dist/types.d.ts CHANGED
@@ -39,8 +39,8 @@ export interface HostUser {
39
39
  * refused.
40
40
  */
41
41
  export type SubjectTokenSource = () => string | null | undefined | Promise<string | null | undefined>;
42
- /** What a file sent with a question is: sent as a picture, or read as text. */
43
- export type ChatAttachmentKind = 'image' | 'document';
42
+ /** What a file of a turn is: a picture, a document read as text, or a chart an agent drew. */
43
+ export type ChatAttachmentKind = 'image' | 'document' | 'chart';
44
44
  /**
45
45
  * One file attached to a question, as the panel knows it.
46
46
  *
@@ -54,6 +54,12 @@ export interface ChatAttachment {
54
54
  filename: string;
55
55
  contentType: string;
56
56
  }
57
+ /**
58
+ * What an agent is busy with before it writes: searching its knowledge, following
59
+ * a skill, asking a member of its team, or using some other tool. A kind of work,
60
+ * never the tool itself — its name and arguments are not the visitor's to read.
61
+ */
62
+ export type ChatActivity = 'knowledge' | 'skill' | 'delegation' | 'tool';
57
63
  export interface ChatMessage {
58
64
  id: string;
59
65
  role: ChatRole;
@@ -65,6 +71,9 @@ export interface ChatMessage {
65
71
  createdAt: number;
66
72
  /** `true` while SSE tokens are still coming in. */
67
73
  streaming?: boolean;
74
+ /** What the agent is doing while the answer has no words yet. Cleared by the
75
+ * first one. */
76
+ activity?: ChatActivity;
68
77
  /** `true` when the message carries an error instead of an answer. */
69
78
  error?: boolean;
70
79
  /** Which agent wrote it, on an application that holds several. Absent on a
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;2DACuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAC7B,MAAM,GACN,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAA;AAEtC,+EAA+E;AAC/E,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,CAAA;AAErD;;;;;;GAMG;A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3E,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;mEAE+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;4EACwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,8DAA8D;IAC9D,eAAe,CAAC,EAAE,kBAAkB,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sDAAsD;IACtD,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,IAAI,IAAI,CAAA;IAChB,SAAS,IAAI,IAAI,CAAA;IACjB,UAAU,IAAI,IAAI,CAAA;IAClB,2EAA2E;IAC3E,KAAK,IAAI,IAAI,CAAA;IACb,uEAAuE;IACvE,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B;gCAC4B;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,CAAC,SAAS,gBAAgB,EACzC,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAC1D,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAA;IACP,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAA;CACR"}
@@ -0,0 +1,17 @@
1
+ import type { JSX } from 'preact';
2
+ import type { PendingApproval } from '../../types';
3
+ import type { WidgetBase } from '../element';
4
+ export interface ApprovalProps {
5
+ /** The paused call, when the agent asked for it without a word of its own. */
6
+ call?: PendingApproval;
7
+ }
8
+ /**
9
+ * Decision on a tool call the agent stopped before making: yes, or no.
10
+ *
11
+ * Answers with `sqc-decision` rather than `sqc-reply`: a decision releases the
12
+ * call, it is not a message. The model's values are drawn as text, never markup.
13
+ * Once decided (or locked by the host) the group is frozen, and a call is not
14
+ * approved twice.
15
+ */
16
+ export declare function SqcApproval({ call, locked, language, }: ApprovalProps & Pick<WidgetBase, 'locked' | 'language'>): JSX.Element;
17
+ //# sourceMappingURL=SqcApproval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqcApproval.d.ts","sourceRoot":"","sources":["../../../src/widgets/approval/SqcApproval.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAGjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAG5C,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB;AAWD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,MAAM,EACN,QAAQ,GACT,EAAE,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC,OAAO,CAsDvE"}
@@ -0,0 +1,3 @@
1
+ /** A name a person can read: `pull_request_read` becomes "Pull request read". */
2
+ export declare function readable(name: string): string;
3
+ //# sourceMappingURL=name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../src/widgets/approval/name.ts"],"names":[],"mappings":"AAKA,iFAAiF;AACjF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS7C"}
@@ -0,0 +1,19 @@
1
+ import type { JSX } from 'preact';
2
+ import type { WidgetBase } from '../element';
3
+ import type { ReadChart } from '../types';
4
+ interface ChartProps {
5
+ /** The chart, already read. */
6
+ chart?: ReadChart;
7
+ /** Or the text of the chart file, now or as it arrives: read here, where its reader lives. */
8
+ body?: string | Promise<string>;
9
+ /** Shown while the file loads, when it is not a chart, and as the title of an untitled one. */
10
+ filename?: string;
11
+ }
12
+ /**
13
+ * A chart an agent drew, under its answer: title, legend, the drawing with a
14
+ * tooltip, its figures on demand, and a PNG to keep. Read-only — it answers
15
+ * nothing, so it never replies or locks.
16
+ */
17
+ export declare function SqcChart(props: ChartProps & WidgetBase): JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=SqcChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqcChart.d.ts","sourceRoot":"","sources":["../../../src/widgets/chart/SqcChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAMzC,UAAU,UAAU;IAClB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,8FAA8F;IAC9F,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC/B,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAqDD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,GAAG,CAAC,OAAO,CA8EpE"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * A chart drawn by hand in SVG: bars (grouped, stacked, horizontal), lines,
3
+ * areas, a pie or a donut, a scatter. No chart library — the widget carries
4
+ * its own weight to every host page.
5
+ *
6
+ * Drawn in a fixed `viewBox` scaled to the width it is given. Every colour is
7
+ * written inline, as a `var(--sqc-series-N, default)`, so a host can theme the
8
+ * series and the PNG export (which loses the stylesheet) can resolve them.
9
+ * Labels from the model are text nodes: whatever markup they hold stays inert.
10
+ */
11
+ import type { JSX } from 'preact';
12
+ import type { ReadChart } from '../types';
13
+ export declare const WIDTH = 560;
14
+ export declare const HEIGHT = 280;
15
+ /** The colour of series `index`; the backend refuses more series than there are colours. */
16
+ export declare function seriesColour(index: number): string;
17
+ /** What the tooltip says about the mark under the pointer, placed in `viewBox` units. */
18
+ export interface Tip {
19
+ x: number;
20
+ y: number;
21
+ title: string;
22
+ line: string;
23
+ }
24
+ interface DrawProps {
25
+ chart: ReadChart;
26
+ format: (value: number) => string;
27
+ onTip: (tip: Tip | null) => void;
28
+ }
29
+ export declare function ChartDrawing({ chart, format, onTip }: DrawProps): JSX.Element;
30
+ export {};
31
+ //# sourceMappingURL=draw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../../src/widgets/chart/draw.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,KAAK,MAAM,CAAA;AACxB,eAAO,MAAM,MAAM,MAAM,CAAA;AAIzB,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED,yFAAyF;AACzF,MAAM,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,KAAK,IAAI,CAAA;CACjC;AAuGD,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAgN7E"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The drawn chart as a PNG the visitor keeps.
3
+ *
4
+ * The SVG is serialised and painted on a canvas. Its colours are custom
5
+ * properties, which mean nothing outside the page: each `var(--x, fallback)`
6
+ * is swapped for what it resolves to on the element, so the picture is the
7
+ * chart in the theme it was seen in.
8
+ */
9
+ export declare function downloadPng(svg: SVGSVGElement, host: Element, filename: string): void;
10
+ //# sourceMappingURL=png.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"png.d.ts","sourceRoot":"","sources":["../../../src/widgets/chart/png.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAmCrF"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The chart in a file `show_chart` wrote (`apps/backend/app/agents/builtins/charts.py`),
3
+ * or `null` for something that is not one.
4
+ *
5
+ * Read defensively: the file came from a model, through a tool that checked it,
6
+ * and a screen still owes the visitor a name rather than a crash if it is not
7
+ * what it should be.
8
+ */
9
+ import { type ReadChart } from '../types';
10
+ export declare function readChart(body: string): ReadChart | null;
11
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/widgets/chart/read.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAML,KAAK,SAAS,EAEf,MAAM,UAAU,CAAA;AAkCjB,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CA2BxD"}
@@ -0,0 +1,32 @@
1
+ import type { LanguageCode } from '../../lib/i18n';
2
+ /**
3
+ * The copy of `<sqc-chart>`. Kept beside it rather than in the chat's strings:
4
+ * the chart ships in the extras file, and the chat's own budget is spent.
5
+ */
6
+ declare const STRINGS: {
7
+ en: {
8
+ download: string;
9
+ show: string;
10
+ hide: string;
11
+ category: string;
12
+ series: string;
13
+ };
14
+ fr: {
15
+ download: string;
16
+ show: string;
17
+ hide: string;
18
+ category: string;
19
+ series: string;
20
+ };
21
+ es: {
22
+ download: string;
23
+ show: string;
24
+ hide: string;
25
+ category: string;
26
+ series: string;
27
+ };
28
+ };
29
+ export type ChartStrings = (typeof STRINGS)['en'];
30
+ export declare function chartStrings(language: LanguageCode): ChartStrings;
31
+ export {};
32
+ //# sourceMappingURL=strings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../src/widgets/chart/strings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;GAGG;AACH,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;CAsBZ,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAA;AAEjD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,CAEjE"}
@@ -0,0 +1,17 @@
1
+ import type { JSX } from 'preact';
2
+ import type { WidgetBase } from '../element';
3
+ interface ChoicesProps {
4
+ options: string[];
5
+ multiple?: boolean;
6
+ /** Options pre-ticked by the Markdown (`- (x) …`, `- [x] …`). */
7
+ checked?: string[];
8
+ }
9
+ /**
10
+ * Options offered by the assistant. Single, drawn with round marks: one click
11
+ * answers with the label.
12
+ * Multiple: tick any, then one button sends the labels comma-joined. The label
13
+ * sent is stripped of its markup — the agent matches candidates by name.
14
+ */
15
+ export declare function SqcChoices({ options, multiple, checked, locked, language, reply, }: ChoicesProps & WidgetBase): JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=SqcChoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqcChoices.d.ts","sourceRoot":"","sources":["../../../src/widgets/choices/SqcChoices.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAI5C,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAUD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAY,EACZ,QAAQ,EACR,OAAO,EACP,MAAM,EACN,QAAQ,EACR,KAAK,GACN,EAAE,YAAY,GAAG,UAAU,GAAG,GAAG,CAAC,OAAO,CAwDzC"}
@@ -0,0 +1,12 @@
1
+ import type { JSX } from 'preact';
2
+ import type { WidgetBase } from '../element';
3
+ /**
4
+ * Yes / No under a closed question. A bare "yes" is recognised agent-side
5
+ * without a model call, so the word sent is the one of the visitor's language.
6
+ *
7
+ * The third button sends nothing: it asks the host, through `sqc-compose`, to
8
+ * hand the visitor the composer. The widget stays live until their message
9
+ * arrives — they may still change their mind and click Yes.
10
+ */
11
+ export declare function SqcConfirm({ locked, language, reply }: WidgetBase): JSX.Element;
12
+ //# sourceMappingURL=SqcConfirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqcConfirm.d.ts","sourceRoot":"","sources":["../../../src/widgets/confirm/SqcConfirm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAGjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAuC/E"}
@@ -0,0 +1,8 @@
1
+ export { WIDGET_TAGS } from './names';
2
+ /**
3
+ * Registers the widget elements every answer may hold. Idempotent; does nothing
4
+ * where there is no DOM. The heavier, rarer ones (form, chart, approval) live
5
+ * in `./extras`.
6
+ */
7
+ export declare function defineChatWidgets(): void;
8
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/widgets/define.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAcxC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Runtime shared by every widget element (`<sqc-table>`, `<sqc-choices>`…).
3
+ *
4
+ * An element is a Preact component in a shadow root, driven by properties and
5
+ * answering through one DOM event, so the chat widget and any other host (the
6
+ * console) use it the same way and know nothing of what is inside.
7
+ *
8
+ * The class is built when `createWidgetElement` is called — from
9
+ * `defineChatWidgets()`, never at module level — because `class X extends
10
+ * HTMLElement` throws on a server-side import.
11
+ */
12
+ import { type FunctionComponent } from 'preact';
13
+ import type { LanguageCode } from '../lib/i18n';
14
+ export interface WidgetBase {
15
+ /** An answered or superseded widget: shown, no longer interactive. */
16
+ locked: boolean;
17
+ language: LanguageCode;
18
+ /** Sends text back as the visitor's answer, and locks the widget. */
19
+ reply: (text: string) => void;
20
+ }
21
+ /**
22
+ * `css` is passed in rather than imported, so a bundle holding only some of
23
+ * the elements (the extras, loaded on first use) carries only their styles.
24
+ */
25
+ export declare function createWidgetElement<P>(Component: FunctionComponent<P & WidgetBase>, props: (keyof P)[], css: string): CustomElementConstructor;
26
+ //# sourceMappingURL=element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/widgets/element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,YAAY,CAAA;IACtB,qEAAqE;IACrE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAkBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,SAAS,EAAE,iBAAiB,CAAC,CAAC,GAAG,UAAU,CAAC,EAC5C,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,EAClB,GAAG,EAAE,MAAM,GACV,wBAAwB,CA6E1B"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * URL and CSP nonce of the running script. `currentScript` only holds while a
3
+ * classic script evaluates: null in a module script, where nothing is captured.
4
+ */
5
+ export declare function captureScript(): {
6
+ src: string;
7
+ nonce: string;
8
+ };
9
+ /**
10
+ * Where the extras file sits for a main script at `src`: beside it, or in
11
+ * `dist/` under a short CDN URL (`…/@squadico/chatbot@1.4.0`), where jsDelivr
12
+ * and unpkg serve the main file named by the package's `jsdelivr` / `unpkg`
13
+ * fields.
14
+ */
15
+ export declare function extrasUrl(src: string): string;
16
+ /** Appends a `<script>` for the extras file of the main script at `src`. */
17
+ export declare function injectScript(src: string, nonce?: string): Promise<void>;
18
+ /** Runs `load` once it has succeeded; a failure is logged and forgotten, so the next call tries again. */
19
+ export declare function retrying(load: () => Promise<void>): () => Promise<void>;
20
+ export declare const loadWidgetExtras: () => Promise<void>;
21
+ //# sourceMappingURL=extras-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extras-loader.d.ts","sourceRoot":"","sources":["../../src/widgets/extras-loader.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,aAAa,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAG9D;AAKD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK7C;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBnE;AAED,0GAA0G;AAC1G,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAOvE;AAED,eAAO,MAAM,gBAAgB,QAT8B,OAAO,CAAC,IAAI,CAatE,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** Registers the extra elements. Idempotent; does nothing where there is no DOM. */
2
+ export declare function defineWidgetExtras(): void;
3
+ //# sourceMappingURL=extras.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extras.d.ts","sourceRoot":"","sources":["../../src/widgets/extras.ts"],"names":[],"mappings":"AAmBA,oFAAoF;AACpF,wBAAgB,kBAAkB,IAAI,IAAI,CAiBzC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=extras.global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extras.global.d.ts","sourceRoot":"","sources":["../../src/widgets/extras.global.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type { JSX } from 'preact';
2
+ import type { WidgetBase } from '../element';
3
+ import type { FormSpec } from '../types';
4
+ interface FormProps {
5
+ form?: FormSpec;
6
+ }
7
+ /**
8
+ * Fields the assistant asks for. Checked on submit (required, email, number);
9
+ * a valid form answers with `formReply` and locks. Labels are rendered as
10
+ * text: whatever markup the model wrote stays inert.
11
+ */
12
+ export declare function SqcForm({ form, locked, language, reply }: FormProps & WidgetBase): JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=SqcForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqcForm.d.ts","sourceRoot":"","sources":["../../../src/widgets/form/SqcForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAGjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnD,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB;AAaD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,UAAU,GAAG,GAAG,CAAC,OAAO,CA6E9F"}
@@ -0,0 +1,7 @@
1
+ import type { FormSpec } from '../types';
2
+ /**
3
+ * What a submitted form says to the agent: one `label : value` line per filled
4
+ * field, in the order the agent asked for them. An empty field is left out.
5
+ */
6
+ export declare function formReply(form: FormSpec, values: Record<string, string>): string;
7
+ //# sourceMappingURL=reply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../src/widgets/form/reply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAMhF"}
@@ -0,0 +1,4 @@
1
+ import { type LanguageCode, type Strings } from '../lib/i18n';
2
+ /** The copy of a language, for an element that is only told its code. */
3
+ export declare function strings(language: LanguageCode): Strings;
4
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/widgets/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAA;AAE5E,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAEvD"}
@@ -0,0 +1,10 @@
1
+ /** What a host needs to draw the widget elements. */
2
+ export { defineChatWidgets, WIDGET_TAGS } from './define';
3
+ export { defineWidgetExtras } from './extras';
4
+ export { loadWidgetExtras } from './extras-loader';
5
+ export { isLive } from './live';
6
+ export type { WidgetBase } from './element';
7
+ export type { WidgetBlock, ParsedAnswer, FormSpec, FormField, FieldType, ReadChart, ChartType, } from './types';
8
+ export { readChart } from './chart/read';
9
+ export { parseAnswer } from './parse/answer';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,GACV,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Inline Markdown shared by the answer text and the widget elements: emphasis,
3
+ * code, links. Everything is produced as Preact nodes, hence escaped by
4
+ * construction; a link is only rendered when its href is navigable.
5
+ */
6
+ import type { JSX } from 'preact';
7
+ export type Inline = JSX.Element | string;
8
+ export declare function inline(text: string, keyPrefix: string): Inline[];
9
+ /** Text without markup: what the agent must receive when an option is clicked. */
10
+ export declare function plain(text: string): string;
11
+ //# sourceMappingURL=inline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/widgets/inline.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEjC,MAAM,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,MAAM,CAAA;AAuBzC,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CA2BhE;AAED,kFAAkF;AAClF,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK1C"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Whether a message's widgets still await an answer.
3
+ *
4
+ * Only the last message, written by the assistant and finished, is waited on:
5
+ * anything followed by another message has been answered (or abandoned), which
6
+ * is what a reloaded transcript must show — locked, not live again.
7
+ */
8
+ export declare function isLive(index: number, messages: readonly {
9
+ role: string;
10
+ streaming?: boolean;
11
+ }[]): boolean;
12
+ //# sourceMappingURL=live.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../src/widgets/live.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,GACzD,OAAO,CAKT"}
@@ -0,0 +1,10 @@
1
+ /** Tag names of the widget elements, in a module of their own so either bundle can name them. */
2
+ export declare const WIDGET_TAGS: {
3
+ readonly table: "sqc-table";
4
+ readonly choices: "sqc-choices";
5
+ readonly confirm: "sqc-confirm";
6
+ readonly form: "sqc-form";
7
+ readonly chart: "sqc-chart";
8
+ readonly approval: "sqc-approval";
9
+ };
10
+ //# sourceMappingURL=names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../src/widgets/names.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,eAAO,MAAM,WAAW;;;;;;;CAOd,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { LanguageCode } from '../../lib/i18n';
2
+ import type { ParsedAnswer } from '../types';
3
+ /**
4
+ * Splits an answer into markdown, table, choices and form blocks. A fence that
5
+ * is invalid, unknown or still open (answer streaming) stays markdown, verbatim.
6
+ *
7
+ * `confirmable`: whether Yes / No buttons may go under this answer. Where they
8
+ * do, the `(yes/no)` marker that asked for them is not shown.
9
+ */
10
+ export declare function parseAnswer(text: string, language: LanguageCode, confirmable?: boolean): ParsedAnswer;
11
+ //# sourceMappingURL=answer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"answer.d.ts","sourceRoot":"","sources":["../../../src/widgets/parse/answer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,UAAU,CAAA;AAuBzD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,YAAY,EACtB,WAAW,UAAO,GACjB,YAAY,CAuFd"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Detection of the assistant's closed questions, so "Yes" / "No" can be offered
3
+ * instead of making the user retype the answer.
4
+ *
5
+ * The `Chat display` skill (apps/backend/app/agents/display_skill.py) has the
6
+ * agent mark such a question explicitly: its last line ends with `(yes/no)`,
7
+ * `(oui/non)` or `(sí/no)`, a marker hidden once the buttons are drawn.
8
+ *
9
+ * An agent without the skill writes no marker, so the phrasings agents actually
10
+ * produce are recognised too, as a fallback. That list is deliberately narrow:
11
+ * an open question ("Which records would you like to see?") must not bring up
12
+ * buttons. It is keyed by language, the widget's locale picking the set — a
13
+ * single English set would leave a French-speaking host without buttons.
14
+ */
15
+ import { type LanguageCode } from '../../lib/i18n';
16
+ /** The answer without its closing yes/no marker. */
17
+ export declare function unmark(text: string): string;
18
+ export declare function isConfirmationPrompt(text: string, language?: LanguageCode): boolean;
19
+ //# sourceMappingURL=confirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../../src/widgets/parse/confirm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AA2CpE,oDAAoD;AACpD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,YAA+B,GACxC,OAAO,CAeT"}
@@ -0,0 +1,6 @@
1
+ import type { FormSpec } from '../types';
2
+ export declare const MAX_OPTIONS = 20;
3
+ export declare const MAX_FIELDS = 12;
4
+ /** A `form` fence body, or `null` when it is not valid or exceeds the limits. */
5
+ export declare function readForm(json: string): FormSpec | null;
6
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/widgets/parse/form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE9D,eAAO,MAAM,WAAW,KAAK,CAAA;AAC7B,eAAO,MAAM,UAAU,KAAK,CAAA;AA2C5B,iFAAiF;AACjF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAgBtD"}
@@ -0,0 +1,3 @@
1
+ /** One stylesheet for every widget element: theme first, then each component's. */
2
+ export declare const WIDGET_CSS: string;
3
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/widgets/styles.ts"],"names":[],"mappings":"AAKA,mFAAmF;AACnF,eAAO,MAAM,UAAU,QAA8C,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { JSX } from 'preact';
2
+ import type { WidgetBase } from '../element';
3
+ interface TableProps {
4
+ table: {
5
+ header: string[];
6
+ rows: string[][];
7
+ };
8
+ }
9
+ /**
10
+ * A record listing: click a header to sort (numbers by value), at most 200
11
+ * rows drawn, the whole table copied as TSV. Cells are inline Markdown turned
12
+ * into nodes, never HTML.
13
+ */
14
+ export declare function SqcTable({ table, language }: TableProps & WidgetBase): JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=SqcTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SqcTable.d.ts","sourceRoot":"","sources":["../../../src/widgets/table/SqcTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAM5C,UAAU,UAAU;IAClB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAA;KAAE,CAAA;CAC9C;AAOD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,GAAG,CAAC,OAAO,CA6ElF"}
@@ -0,0 +1,68 @@
1
+ /** Blocks an agent answer is split into: what the widget elements render. */
2
+ export type FieldType = 'text' | 'number' | 'date' | 'email' | 'select';
3
+ export interface FormField {
4
+ name: string;
5
+ label: string;
6
+ type: FieldType;
7
+ required: boolean;
8
+ options?: string[];
9
+ }
10
+ export interface FormSpec {
11
+ title?: string;
12
+ submit?: string;
13
+ fields: FormField[];
14
+ }
15
+ export type WidgetBlock = {
16
+ kind: 'markdown';
17
+ text: string;
18
+ } | {
19
+ kind: 'table';
20
+ header: string[];
21
+ rows: string[][];
22
+ }
23
+ /** `checked`: the options the Markdown pre-ticked (`(x)` / `[x]`), if any. */
24
+ | {
25
+ kind: 'choices';
26
+ options: string[];
27
+ multiple: boolean;
28
+ checked?: string[];
29
+ } | {
30
+ kind: 'form';
31
+ form: FormSpec;
32
+ };
33
+ export interface ParsedAnswer {
34
+ blocks: WidgetBlock[];
35
+ confirm: boolean;
36
+ }
37
+ /** What an agent's `show_chart` tool writes, read into what a screen draws. */
38
+ export declare const CHART_TYPES: readonly ["bar", "line", "area", "pie", "scatter"];
39
+ export type ChartType = (typeof CHART_TYPES)[number];
40
+ export interface ValuedSeries {
41
+ name: string;
42
+ values: number[];
43
+ }
44
+ export interface Point {
45
+ x: number;
46
+ y: number;
47
+ }
48
+ export interface PointSeries {
49
+ name: string;
50
+ points: Point[];
51
+ }
52
+ export interface ChartCommon {
53
+ title: string;
54
+ xLabel: string;
55
+ yLabel: string;
56
+ stacked: boolean;
57
+ horizontal: boolean;
58
+ donut: boolean;
59
+ }
60
+ export type ReadChart = ChartCommon & ({
61
+ type: 'scatter';
62
+ series: PointSeries[];
63
+ } | {
64
+ type: Exclude<ChartType, 'scatter'>;
65
+ categories: string[];
66
+ series: ValuedSeries[];
67
+ });
68
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/widgets/types.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEvE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAA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OAAO,CAAA;CACf;AAED,MAAM,MAAM,SAAS,GAAG,WAAW,GACjC,CACI;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,WAAW,EAAE,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CACxF,CAAA"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./extras-lsCe4xgN.cjs"),t=require("./answer-DRaV2dVt.cjs");exports.WIDGET_TAGS=t.l,exports.defineChatWidgets=t.a,exports.defineWidgetExtras=e.t,exports.isLive=t.n,exports.loadWidgetExtras=t.r,exports.parseAnswer=t.t,exports.readChart=e.r;