@squadico/chatbot 1.2.1 → 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 (110) hide show
  1. package/README.md +109 -19
  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/element.d.ts.map +1 -1
  16. package/dist/extras-ClIRRLqo.js +604 -0
  17. package/dist/extras-ClIRRLqo.js.map +1 -0
  18. package/dist/extras-lsCe4xgN.cjs +4 -0
  19. package/dist/extras-lsCe4xgN.cjs.map +1 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +3 -2
  24. package/dist/jsx.d.ts +43 -0
  25. package/dist/jsx.d.ts.map +1 -1
  26. package/dist/lib/client.d.ts +8 -4
  27. package/dist/lib/client.d.ts.map +1 -1
  28. package/dist/lib/i18n.d.ts +20 -0
  29. package/dist/lib/i18n.d.ts.map +1 -1
  30. package/dist/lib/useChat.d.ts.map +1 -1
  31. package/dist/react.cjs +1 -1
  32. package/dist/react.cjs.map +1 -1
  33. package/dist/react.d.ts.map +1 -1
  34. package/dist/react.js +2 -2
  35. package/dist/react.js.map +1 -1
  36. package/dist/src-BjqOavOO.js +1984 -0
  37. package/dist/src-BjqOavOO.js.map +1 -0
  38. package/dist/src-DS8P9HdZ.cjs +7 -0
  39. package/dist/src-DS8P9HdZ.cjs.map +1 -0
  40. package/dist/types.d.ts +14 -2
  41. package/dist/types.d.ts.map +1 -1
  42. package/dist/widgets/approval/SqcApproval.d.ts +17 -0
  43. package/dist/widgets/approval/SqcApproval.d.ts.map +1 -0
  44. package/dist/widgets/approval/name.d.ts +3 -0
  45. package/dist/widgets/approval/name.d.ts.map +1 -0
  46. package/dist/widgets/chart/SqcChart.d.ts +19 -0
  47. package/dist/widgets/chart/SqcChart.d.ts.map +1 -0
  48. package/dist/widgets/chart/draw.d.ts +31 -0
  49. package/dist/widgets/chart/draw.d.ts.map +1 -0
  50. package/dist/widgets/chart/png.d.ts +10 -0
  51. package/dist/widgets/chart/png.d.ts.map +1 -0
  52. package/dist/widgets/chart/read.d.ts +11 -0
  53. package/dist/widgets/chart/read.d.ts.map +1 -0
  54. package/dist/widgets/chart/strings.d.ts +32 -0
  55. package/dist/widgets/chart/strings.d.ts.map +1 -0
  56. package/dist/widgets/choices/SqcChoices.d.ts +17 -0
  57. package/dist/widgets/choices/SqcChoices.d.ts.map +1 -0
  58. package/dist/widgets/confirm/SqcConfirm.d.ts +12 -0
  59. package/dist/widgets/confirm/SqcConfirm.d.ts.map +1 -0
  60. package/dist/widgets/define.d.ts +8 -0
  61. package/dist/widgets/define.d.ts.map +1 -0
  62. package/dist/widgets/element.d.ts +26 -0
  63. package/dist/widgets/element.d.ts.map +1 -0
  64. package/dist/widgets/extras-loader.d.ts +21 -0
  65. package/dist/widgets/extras-loader.d.ts.map +1 -0
  66. package/dist/widgets/extras.d.ts +3 -0
  67. package/dist/widgets/extras.d.ts.map +1 -0
  68. package/dist/widgets/extras.global.d.ts +2 -0
  69. package/dist/widgets/extras.global.d.ts.map +1 -0
  70. package/dist/widgets/form/SqcForm.d.ts +14 -0
  71. package/dist/widgets/form/SqcForm.d.ts.map +1 -0
  72. package/dist/widgets/form/reply.d.ts +7 -0
  73. package/dist/widgets/form/reply.d.ts.map +1 -0
  74. package/dist/widgets/i18n.d.ts +4 -0
  75. package/dist/widgets/i18n.d.ts.map +1 -0
  76. package/dist/widgets/index.d.ts +10 -0
  77. package/dist/widgets/index.d.ts.map +1 -0
  78. package/dist/widgets/inline.d.ts +11 -0
  79. package/dist/widgets/inline.d.ts.map +1 -0
  80. package/dist/widgets/live.d.ts +12 -0
  81. package/dist/widgets/live.d.ts.map +1 -0
  82. package/dist/widgets/names.d.ts +10 -0
  83. package/dist/widgets/names.d.ts.map +1 -0
  84. package/dist/widgets/parse/answer.d.ts +11 -0
  85. package/dist/widgets/parse/answer.d.ts.map +1 -0
  86. package/dist/widgets/parse/confirm.d.ts +19 -0
  87. package/dist/widgets/parse/confirm.d.ts.map +1 -0
  88. package/dist/widgets/parse/form.d.ts +6 -0
  89. package/dist/widgets/parse/form.d.ts.map +1 -0
  90. package/dist/widgets/styles.d.ts +3 -0
  91. package/dist/widgets/styles.d.ts.map +1 -0
  92. package/dist/widgets/table/SqcTable.d.ts +16 -0
  93. package/dist/widgets/table/SqcTable.d.ts.map +1 -0
  94. package/dist/widgets/types.d.ts +68 -0
  95. package/dist/widgets/types.d.ts.map +1 -0
  96. package/dist/widgets.cjs +1 -0
  97. package/dist/widgets.js +3 -0
  98. package/package.json +7 -2
  99. package/dist/components/Approval.d.ts +0 -37
  100. package/dist/components/Approval.d.ts.map +0 -1
  101. package/dist/components/Choices.d.ts +0 -27
  102. package/dist/components/Choices.d.ts.map +0 -1
  103. package/dist/components/Confirm.d.ts +0 -16
  104. package/dist/components/Confirm.d.ts.map +0 -1
  105. package/dist/lib/confirm.d.ts +0 -17
  106. package/dist/lib/confirm.d.ts.map +0 -1
  107. package/dist/src-2GKPJcbZ.js +0 -2708
  108. package/dist/src-2GKPJcbZ.js.map +0 -1
  109. package/dist/src-CcILETWB.cjs +0 -8
  110. package/dist/src-CcILETWB.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/widgets/types.ts"],"names":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;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,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;
@@ -0,0 +1,3 @@
1
+ import { r as e, t } from "./extras-ClIRRLqo.js";
2
+ import { a as n, l as r, n as i, r as a, t as o } from "./answer-CDGrP8YE.js";
3
+ export { r as WIDGET_TAGS, n as defineChatWidgets, t as defineWidgetExtras, i as isLive, a as loadWidgetExtras, o as parseAnswer, e as readChart };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squadico/chatbot",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "description": "Chatbot Squadico — web component (HTML, Next.js, Vue 2, Vue 3)",
5
5
  "homepage": "https://www.squadico.com/integrations/website",
6
6
  "keywords": [
@@ -40,6 +40,11 @@
40
40
  "import": "./dist/react.js",
41
41
  "require": "./dist/react.cjs"
42
42
  },
43
+ "./widgets": {
44
+ "types": "./dist/widgets/index.d.ts",
45
+ "import": "./dist/widgets.js",
46
+ "require": "./dist/widgets.cjs"
47
+ },
43
48
  "./jsx": {
44
49
  "types": "./dist/jsx.d.ts"
45
50
  },
@@ -49,7 +54,7 @@
49
54
  "scripts": {
50
55
  "dev": "vite",
51
56
  "build": "npm run build:bundles && npm run build:types",
52
- "build:bundles": "vite build && vite build --config vite.config.standalone.ts",
57
+ "build:bundles": "vite build && vite build --config vite.config.standalone.ts && vite build --config vite.config.widgets.ts",
53
58
  "build:types": "tsc -p tsconfig.build.json",
54
59
  "type-check": "tsc --noEmit",
55
60
  "test": "vitest run",
@@ -1,37 +0,0 @@
1
- /**
2
- * Decision on a tool call the agent stopped before making: yes, or no.
3
- *
4
- * The agent paused before calling the tool and wrote what it would do (that is the
5
- * message body); these buttons are what releases the call, not a bare "yes"
6
- * interpreted by the model. Nothing has been written while they are here.
7
- *
8
- * **When it wrote nothing, the call speaks for itself.** Several models ask for a
9
- * tool with no sentence at all, and a visitor then faces an empty bubble with two
10
- * buttons under it — a decision nobody can take. So `call`, passed only in that
11
- * case, names what would be used and with what: approving "read a pull request"
12
- * is not approving *which* one. The values come from a model and are printed as
13
- * text, never as markup.
14
- *
15
- * Two answers and no third. There used to be a "correct it" button that opened an
16
- * input, and the API has never had anything to send it to — a control that cannot be
17
- * honoured is worse than one that is missing. Saying something else is a new
18
- * message, and the backend closes the pending call as it goes out: asking instead of
19
- * deciding is a decision too.
20
- *
21
- * Once the decision is made the group is frozen — the history has to stay readable,
22
- * and a call is not approved twice.
23
- */
24
- import type { JSX } from 'preact';
25
- import type { Locale } from '../lib/i18n';
26
- import type { PendingApproval } from '../types';
27
- export interface ApprovalProps {
28
- locale: Locale;
29
- /** The paused call, when the agent asked for it without a word of its own.
30
- * Absent when it explained itself: its sentence is the message body, and
31
- * saying the same thing twice reads as two requests. */
32
- call?: PendingApproval;
33
- /** Absent when the group is frozen: decision already made, or turn in flight. */
34
- onDecide?: (approved: boolean, label: string) => void;
35
- }
36
- export declare function Approval({ locale, call, onDecide }: ApprovalProps): JSX.Element;
37
- //# sourceMappingURL=Approval.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Approval.d.ts","sourceRoot":"","sources":["../../src/components/Approval.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd;;6DAEyD;IACzD,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACtD;AA+BD,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAmD/E"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Clickable options built from the Markdown checkboxes (`- [ ] Name`) the
3
- * assistant writes when it offers candidates.
4
- *
5
- * The agent resolves the answer by name, so clicking an option amounts to
6
- * sending its exact label as a message. The choice is single — the agent expects
7
- * one candidate per turn — and the group locks as soon as an option is taken, so
8
- * the history stays readable.
9
- */
10
- import type { ComponentChildren, JSX } from 'preact';
11
- import type { Locale } from '../lib/i18n';
12
- export interface ChoiceItem {
13
- /** Plain text sent to the agent. */
14
- label: string;
15
- /** Checkbox already ticked in the Markdown (`- [x] …`). */
16
- checked: boolean;
17
- /** Rendered label (inline Markdown is already applied to it). */
18
- content: ComponentChildren;
19
- }
20
- export interface ChoicesProps {
21
- items: ChoiceItem[];
22
- locale: Locale;
23
- /** Absent when the group is frozen: older message, or turn in flight. */
24
- onPick?: (label: string) => void;
25
- }
26
- export declare function Choices({ items, locale, onPick }: ChoicesProps): JSX.Element;
27
- //# sourceMappingURL=Choices.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Choices.d.ts","sourceRoot":"","sources":["../../src/components/Choices.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,UAAU;IACzB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,OAAO,EAAE,OAAO,CAAA;IAChB,iEAAiE;IACjE,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAUD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO,CA+B5E"}
@@ -1,16 +0,0 @@
1
- /**
2
- * "Yes" / "No" buttons under a closed question from the assistant.
3
- *
4
- * A bare "yes" or "no" is recognised agent-side without going through the LLM,
5
- * so clicking is exactly the same as typing the answer. As with the tickable
6
- * options, the group locks on the choice made, so the history stays readable.
7
- */
8
- import type { JSX } from 'preact';
9
- import type { Locale } from '../lib/i18n';
10
- export interface ConfirmProps {
11
- locale: Locale;
12
- /** Absent when the group is frozen: older message, or turn in flight. */
13
- onPick?: (answer: string) => void;
14
- }
15
- export declare function Confirm({ locale, onPick }: ConfirmProps): JSX.Element;
16
- //# sourceMappingURL=Confirm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Confirm.d.ts","sourceRoot":"","sources":["../../src/components/Confirm.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC;AAED,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO,CA8BrE"}
@@ -1,17 +0,0 @@
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 protocol exposes nothing explicit for this (the API only returns text), so
6
- * this leans on the phrasings agents actually produce. The list is deliberately
7
- * narrow: an open question ("Which records would you like to see?") must not
8
- * bring up buttons.
9
- *
10
- * A question asked in the user's language is only recognisable with that
11
- * language's phrasings: the patterns are therefore keyed by language, and the
12
- * widget's locale picks the set — a single English set would leave a
13
- * French-speaking host without buttons.
14
- */
15
- import { type LanguageCode } from './i18n';
16
- export declare function isConfirmationPrompt(text: string, language?: LanguageCode): boolean;
17
- //# sourceMappingURL=confirm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../src/lib/confirm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAuC5D,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,YAA+B,GACxC,OAAO,CAcT"}