@aleph-alpha/chat-kit 5.13.0 → 6.1.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.
- package/dist/{CkHistory.vue_vue_type_script_setup_true_lang-BNcJURkq.js → CkHistory.vue_vue_type_script_setup_true_lang-Cr8vF94e.js} +221 -115
- package/dist/adapters/responses-api.d.ts +1 -1
- package/dist/adapters/responses-api.d.ts.map +1 -1
- package/dist/adapters/responses-api.js +9 -7
- package/dist/apl-fqmucPXA.js +140 -0
- package/dist/asciiarmor-DucZyvP0.js +56 -0
- package/dist/asn1-BnOEsgAm.js +144 -0
- package/dist/asterisk-QAlztEwS.js +345 -0
- package/dist/brainfuck-DZVCuF_t.js +53 -0
- package/dist/chat-kit.css +1177 -12
- package/dist/clike-CTYGlS6x.js +799 -0
- package/dist/clojure-BhXMqnxz.js +849 -0
- package/dist/cmake-BGaNd9E7.js +71 -0
- package/dist/cobol-4yqQntpt.js +120 -0
- package/dist/coffeescript-D2dXvhEc.js +308 -0
- package/dist/commonlisp-CF_VNHQR.js +130 -0
- package/dist/components/base/CkHistoryItem/CkHistoryItem.vue.d.ts.map +1 -1
- package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.vue.d.ts.map +1 -1
- package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts.map +1 -1
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.stories.d.ts +41 -0
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.stories.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.vue.d.ts +26 -0
- package/dist/components/base/CkMilkdownEditor/CkMilkdownEditor.vue.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/codeMirrorTheme.d.ts +20 -0
- package/dist/components/base/CkMilkdownEditor/codeMirrorTheme.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/createCrepeEditor.d.ts +42 -0
- package/dist/components/base/CkMilkdownEditor/createCrepeEditor.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/crepeIcons.d.ts +33 -0
- package/dist/components/base/CkMilkdownEditor/crepeIcons.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/index.d.ts +3 -0
- package/dist/components/base/CkMilkdownEditor/index.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/markdownClassAttrs.d.ts +16 -0
- package/dist/components/base/CkMilkdownEditor/markdownClassAttrs.d.ts.map +1 -0
- package/dist/components/base/CkMilkdownEditor/types.d.ts +98 -0
- package/dist/components/base/CkMilkdownEditor/types.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +2 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +12 -11
- package/dist/composables/fileUpload/useFileUpload.d.ts.map +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/composables/useChat.d.ts.map +1 -1
- package/dist/composables/useConversations.d.ts.map +1 -1
- package/dist/createCrepeEditor-CFbvSH3s.js +74141 -0
- package/dist/crystal-DyuLTqLs.js +398 -0
- package/dist/css-DkSyTW67.js +1772 -0
- package/dist/cypher-Dlu_3r4V.js +121 -0
- package/dist/d-UURgV0Ux.js +179 -0
- package/dist/diff-B_Bi2Crb.js +25 -0
- package/dist/dockerfile-Bvk733Ga.js +201 -0
- package/dist/dtd-Dy74G54E.js +114 -0
- package/dist/dylan-TSb-Nfix.js +314 -0
- package/dist/ebnf-4fKAGW3a.js +140 -0
- package/dist/ecl-B59qGGVg.js +178 -0
- package/dist/eiffel-Dze7nlu3.js +134 -0
- package/dist/elm-DG7jkhNZ.js +176 -0
- package/dist/erlang-BO6gOnGA.js +674 -0
- package/dist/factor-CMxFHDqz.js +65 -0
- package/dist/fcl-CDDUNjTj.js +141 -0
- package/dist/forth-B9D2JCeE.js +116 -0
- package/dist/fortran-CAG2BFbe.js +467 -0
- package/dist/gas-0Aw8zDr5.js +293 -0
- package/dist/gherkin-DhZlEZiy.js +115 -0
- package/dist/groovy-CpwJiBl7.js +223 -0
- package/dist/handlers/index.js +1 -1
- package/dist/handlers/useChatKitLabels.d.ts +62 -1
- package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
- package/dist/haskell-ySd-OUo8.js +459 -0
- package/dist/haxe-7MlzfeYV.js +514 -0
- package/dist/http-BqypyemW.js +79 -0
- package/dist/idl-4HIGJlDI.js +985 -0
- package/dist/index-A5rWjRtZ.js +689 -0
- package/dist/index-B0ldhzaj.js +385 -0
- package/dist/index-BVOjyn3y.js +2490 -0
- package/dist/index-BWvkps_G.js +309 -0
- package/dist/index-BaS8OW8V.js +151 -0
- package/dist/index-BlHHEbV-.js +406 -0
- package/dist/index-BoqzHVNB.js +82 -0
- package/dist/index-C6zYjwIQ.js +704 -0
- package/dist/{index-Dn4ctxk8.js → index-C72e57-5.js} +48 -24
- package/dist/index-CMJGuXap.js +330 -0
- package/dist/index-CRfGWVdQ.js +116 -0
- package/dist/index-C_gTb50u.js +81 -0
- package/dist/index-DSU7cBGz.js +178 -0
- package/dist/index-DSq3gvqU.js +1767 -0
- package/dist/index-Da3777l2.js +289 -0
- package/dist/index-DdlzabmR.js +1021 -0
- package/dist/index-DhY_9bdS.js +61 -0
- package/dist/index-Dm6C1blN.js +1052 -0
- package/dist/index-Tj3pzx-E.js +327 -0
- package/dist/index-ZeRS5rER.js +97 -0
- package/dist/index-gzleljO6.js +157 -0
- package/dist/index-naWlQpaL.js +642 -0
- package/dist/index-sKO1lHHC.js +312 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -14
- package/dist/javascript-Bt8B7yTi.js +992 -0
- package/dist/julia-Bs6JJhYG.js +407 -0
- package/dist/livescript-DmzgM3Yt.js +296 -0
- package/dist/lua-Cvg8VrAA.js +256 -0
- package/dist/mathematica-DNLOL9PQ.js +110 -0
- package/dist/mbox-Ga7d4MMN.js +117 -0
- package/dist/mirc-Dma3B8rS.js +107 -0
- package/dist/mllike-DHn7xckP.js +334 -0
- package/dist/modelica-0d55jYY0.js +147 -0
- package/dist/mscgen-DdqZYINH.js +135 -0
- package/dist/mumps-Btr8VblO.js +93 -0
- package/dist/nginx-DTDtBDVN.js +141 -0
- package/dist/nsis-CyKBdPWp.js +62 -0
- package/dist/ntriples-CvgOYMpL.js +153 -0
- package/dist/octave-DYBj3-tl.js +200 -0
- package/dist/oz-R_e8WMIi.js +231 -0
- package/dist/pascal-GD8iposT.js +105 -0
- package/dist/perl-DL9mHpoi.js +1105 -0
- package/dist/pig-C_4T4YIV.js +101 -0
- package/dist/powershell-B0suO7Vd.js +328 -0
- package/dist/properties-BR-vP1aU.js +58 -0
- package/dist/protobuf-BxgpyhoW.js +77 -0
- package/dist/pug-vHnWR0UE.js +405 -0
- package/dist/puppet-Bdao66PW.js +137 -0
- package/dist/python-BFGRmuZ9.js +426 -0
- package/dist/q-CrbCVq4a.js +131 -0
- package/dist/r-V7nswm59.js +170 -0
- package/dist/rpm-C-DLY-If.js +109 -0
- package/dist/ruby-CQTpZw6f.js +331 -0
- package/dist/sas-D2UG-yhZ.js +207 -0
- package/dist/scheme-BKzrkGJD.js +222 -0
- package/dist/shell-BlsXDxCn.js +222 -0
- package/dist/sieve-CjwBwOY5.js +135 -0
- package/dist/simple-mode-DMneyfDu.js +130 -0
- package/dist/smalltalk-BOIGQuhN.js +121 -0
- package/dist/solr-CwD7U71z.js +69 -0
- package/dist/sparql-DYskk2vE.js +249 -0
- package/dist/spreadsheet-Bgtt3oLP.js +87 -0
- package/dist/sql-Cei9CMfk.js +342 -0
- package/dist/stex-C1nZSzAw.js +230 -0
- package/dist/stylus-BkS-boTH.js +565 -0
- package/dist/swift-FRZi1uvB.js +291 -0
- package/dist/tcl-CUcaCdmq.js +114 -0
- package/dist/test-utils/createTextPlugin.d.ts +7 -1
- package/dist/test-utils/createTextPlugin.d.ts.map +1 -1
- package/dist/textile-BnFpjsrl.js +414 -0
- package/dist/tiddlywiki-CjprD-Qp.js +218 -0
- package/dist/tiki-DK9DOeWn.js +268 -0
- package/dist/toml-BOuWGMcf.js +76 -0
- package/dist/troff-E1bJ0PPL.js +61 -0
- package/dist/ttcn-cfg-Dc39-fIP.js +133 -0
- package/dist/ttcn-tKd4HLu4.js +192 -0
- package/dist/turtle-Dq7-1WAf.js +124 -0
- package/dist/{useChatKitLabels-CMOr3Kjq.js → useChatKitLabels-Ww1Q7xUr.js} +26 -3
- package/dist/vb-Dp90gtsv.js +196 -0
- package/dist/vbscript-Bfn8O8I7.js +478 -0
- package/dist/velocity-BwIZK1TH.js +149 -0
- package/dist/verilog-CnT9bMk0.js +429 -0
- package/dist/vhdl-DCkMIyT9.js +158 -0
- package/dist/webidl-BTLTThCm.js +204 -0
- package/dist/xquery-BrBUuxMR.js +525 -0
- package/dist/yacas-b5lAVEIl.js +130 -0
- package/dist/z80-ClgwfNdB.js +92 -0
- package/package.json +11 -5
- package/src/adapters/responses-api.spec.ts +86 -0
- package/src/adapters/responses-api.ts +13 -9
- package/src/components/base/CkCitationCard/CkCitationCard.vue +1 -1
- package/src/components/base/CkCitationLabel/CkCitationLabel.vue +1 -1
- package/src/components/base/CkConversationLayout/CkConversationLayout.spec.ts +1 -5
- package/src/components/base/CkCopyMessageButton/CkCopyMessageButton.spec.ts +1 -1
- package/src/components/base/CkFeedbackButton/CkFeedbackButton.vue +3 -3
- package/src/components/base/CkFeedbackDialog/CkFeedbackDialog.vue +9 -9
- package/src/components/base/CkHistoryItem/CkHistoryItem.vue +5 -7
- package/src/components/base/CkHistoryWrapper/CkHistoryWrapper.vue +2 -1
- package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts +9 -4
- package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +1 -1
- package/src/components/base/CkMilkdownEditor/CkMilkdownEditor.spec.ts +221 -0
- package/src/components/base/CkMilkdownEditor/CkMilkdownEditor.stories.ts +274 -0
- package/src/components/base/CkMilkdownEditor/CkMilkdownEditor.vue +151 -0
- package/src/components/base/CkMilkdownEditor/codeMirrorTheme.ts +132 -0
- package/src/components/base/CkMilkdownEditor/createCrepeEditor.ts +192 -0
- package/src/components/base/CkMilkdownEditor/crepeIcons.ts +77 -0
- package/src/components/base/CkMilkdownEditor/index.ts +2 -0
- package/src/components/base/CkMilkdownEditor/markdownClassAttrs.ts +64 -0
- package/src/components/base/CkMilkdownEditor/milkdown-theme.css +441 -0
- package/src/components/base/CkMilkdownEditor/types.ts +100 -0
- package/src/components/base/CkModelSelector/CkModelSelector.vue +3 -3
- package/src/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.stories.ts +2 -2
- package/src/components/base/index.ts +6 -0
- package/src/components/index.ts +4 -0
- package/src/composables/fileUpload/useFileUpload.ts +45 -30
- package/src/composables/fileUpload/useFileUploadWrapper.spec.ts +1 -1
- package/src/composables/fileUpload/useFileUploadWrapper.ts +3 -3
- package/src/composables/useChat.ts +3 -1
- package/src/composables/useConversations.ts +8 -5
- package/src/handlers/useChatKitLabels.spec.ts +0 -1
- package/src/handlers/useChatKitLabels.ts +29 -2
- package/src/handlers/useMarkdownParser.ts +1 -1
- package/src/index.ts +4 -0
- package/src/test-setup.ts +3 -3
- package/src/test-utils/createTextPlugin.ts +11 -3
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
function mkZ80(ez80) {
|
|
2
|
+
var keywords1, keywords2;
|
|
3
|
+
if (ez80) {
|
|
4
|
+
keywords1 = /^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i;
|
|
5
|
+
keywords2 = /^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i;
|
|
6
|
+
} else {
|
|
7
|
+
keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i;
|
|
8
|
+
keywords2 = /^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i;
|
|
9
|
+
}
|
|
10
|
+
var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i;
|
|
11
|
+
var variables2 = /^(n?[zc]|p[oe]?|m)\b/i;
|
|
12
|
+
var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i;
|
|
13
|
+
var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;
|
|
14
|
+
return {
|
|
15
|
+
name: "z80",
|
|
16
|
+
startState: function() {
|
|
17
|
+
return {
|
|
18
|
+
context: 0
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
token: function(stream, state) {
|
|
22
|
+
if (!stream.column())
|
|
23
|
+
state.context = 0;
|
|
24
|
+
if (stream.eatSpace())
|
|
25
|
+
return null;
|
|
26
|
+
var w;
|
|
27
|
+
if (stream.eatWhile(/\w/)) {
|
|
28
|
+
if (ez80 && stream.eat(".")) {
|
|
29
|
+
stream.eatWhile(/\w/);
|
|
30
|
+
}
|
|
31
|
+
w = stream.current();
|
|
32
|
+
if (stream.indentation()) {
|
|
33
|
+
if ((state.context == 1 || state.context == 4) && variables1.test(w)) {
|
|
34
|
+
state.context = 4;
|
|
35
|
+
return "variable";
|
|
36
|
+
}
|
|
37
|
+
if (state.context == 2 && variables2.test(w)) {
|
|
38
|
+
state.context = 4;
|
|
39
|
+
return "variableName.special";
|
|
40
|
+
}
|
|
41
|
+
if (keywords1.test(w)) {
|
|
42
|
+
state.context = 1;
|
|
43
|
+
return "keyword";
|
|
44
|
+
} else if (keywords2.test(w)) {
|
|
45
|
+
state.context = 2;
|
|
46
|
+
return "keyword";
|
|
47
|
+
} else if (state.context == 4 && numbers.test(w)) {
|
|
48
|
+
return "number";
|
|
49
|
+
}
|
|
50
|
+
if (errors.test(w))
|
|
51
|
+
return "error";
|
|
52
|
+
} else if (stream.match(numbers)) {
|
|
53
|
+
return "number";
|
|
54
|
+
} else {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
} else if (stream.eat(";")) {
|
|
58
|
+
stream.skipToEnd();
|
|
59
|
+
return "comment";
|
|
60
|
+
} else if (stream.eat('"')) {
|
|
61
|
+
while (w = stream.next()) {
|
|
62
|
+
if (w == '"')
|
|
63
|
+
break;
|
|
64
|
+
if (w == "\\")
|
|
65
|
+
stream.next();
|
|
66
|
+
}
|
|
67
|
+
return "string";
|
|
68
|
+
} else if (stream.eat("'")) {
|
|
69
|
+
if (stream.match(/\\?.'/))
|
|
70
|
+
return "number";
|
|
71
|
+
} else if (stream.eat(".") || stream.sol() && stream.eat("#")) {
|
|
72
|
+
state.context = 5;
|
|
73
|
+
if (stream.eatWhile(/\w/))
|
|
74
|
+
return "def";
|
|
75
|
+
} else if (stream.eat("$")) {
|
|
76
|
+
if (stream.eatWhile(/[\da-f]/i))
|
|
77
|
+
return "number";
|
|
78
|
+
} else if (stream.eat("%")) {
|
|
79
|
+
if (stream.eatWhile(/[01]/))
|
|
80
|
+
return "number";
|
|
81
|
+
} else {
|
|
82
|
+
stream.next();
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const z80 = mkZ80(false);
|
|
89
|
+
mkZ80(true);
|
|
90
|
+
export {
|
|
91
|
+
z80
|
|
92
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/chat-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Chat kit package for building chat interfaces with Vue",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"author": "Pharia AI",
|
|
52
52
|
"license": "MIT",
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
54
|
+
"node": ">=22.13.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
@@ -62,11 +62,18 @@
|
|
|
62
62
|
"directory": "packages/chat-kit"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@aleph-alpha/ui-library": "
|
|
65
|
+
"@aleph-alpha/ui-library": "^6.0.0",
|
|
66
66
|
"pinia": "^3.0.0",
|
|
67
67
|
"vue": "^3.5.27"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
+
"@aleph-alpha/ui-library": "^6.0.0",
|
|
71
|
+
"@codemirror/language": "^6.11.0",
|
|
72
|
+
"@codemirror/state": "^6.5.0",
|
|
73
|
+
"@codemirror/view": "^6.38.0",
|
|
74
|
+
"@lezer/highlight": "^1.2.0",
|
|
75
|
+
"@milkdown/crepe": "^7.22.1",
|
|
76
|
+
"@milkdown/kit": "^7.22.1",
|
|
70
77
|
"dompurify": "^3.3.2",
|
|
71
78
|
"katex": "^0.17.0",
|
|
72
79
|
"mdast-util-find-and-replace": "^3.0.2",
|
|
@@ -76,8 +83,7 @@
|
|
|
76
83
|
"remark-math": "^6.0.0",
|
|
77
84
|
"remark-parse": "^11.0.0",
|
|
78
85
|
"remark-rehype": "^11.1.2",
|
|
79
|
-
"unified": "^11.0.5"
|
|
80
|
-
"@aleph-alpha/ui-library": "5.10.0"
|
|
86
|
+
"unified": "^11.0.5"
|
|
81
87
|
},
|
|
82
88
|
"devDependencies": {
|
|
83
89
|
"@storybook/addon-a11y": "10.2.17",
|
|
@@ -299,6 +299,92 @@ describe('responsesToTree', () => {
|
|
|
299
299
|
expect(assistant.content[2].type).toBe('text');
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
+
it('converts hosted native calls into tool parts without rewriting their type', () => {
|
|
303
|
+
const tree = responsesToTree([
|
|
304
|
+
makeResponse({
|
|
305
|
+
id: 'r1',
|
|
306
|
+
request_input: [userInput('What does the contract say?')],
|
|
307
|
+
output: [
|
|
308
|
+
toolOutput({
|
|
309
|
+
id: 'ws-1',
|
|
310
|
+
type: 'web_search_call',
|
|
311
|
+
display: {
|
|
312
|
+
text: 'Searched the internet for "EU AI Act"',
|
|
313
|
+
icon: 'globe',
|
|
314
|
+
phase: 'done',
|
|
315
|
+
},
|
|
316
|
+
}),
|
|
317
|
+
toolOutput({
|
|
318
|
+
id: 'fs-1',
|
|
319
|
+
type: 'file_search_call',
|
|
320
|
+
display: {
|
|
321
|
+
text: 'Searched documents for "contract terms"',
|
|
322
|
+
icon: 'file-search',
|
|
323
|
+
phase: 'done',
|
|
324
|
+
},
|
|
325
|
+
}),
|
|
326
|
+
toolOutput({
|
|
327
|
+
id: 'sh-1',
|
|
328
|
+
type: 'shell_call',
|
|
329
|
+
name: 'pirate-speak',
|
|
330
|
+
display: {
|
|
331
|
+
text: 'Read skill `pirate-speak`',
|
|
332
|
+
icon: 'sparkles',
|
|
333
|
+
phase: 'done',
|
|
334
|
+
},
|
|
335
|
+
}),
|
|
336
|
+
toolOutput({
|
|
337
|
+
id: 'fu-1',
|
|
338
|
+
type: 'fetch_url',
|
|
339
|
+
display: {
|
|
340
|
+
text: 'Searched google.com',
|
|
341
|
+
icon: 'globe',
|
|
342
|
+
phase: 'done',
|
|
343
|
+
},
|
|
344
|
+
}),
|
|
345
|
+
assistantOutput('msg-a1', 'The contract requires compliance.'),
|
|
346
|
+
],
|
|
347
|
+
}),
|
|
348
|
+
]);
|
|
349
|
+
|
|
350
|
+
const assistant = tree.nodes['msg-a1']!;
|
|
351
|
+
expect(assistant.content).toEqual([
|
|
352
|
+
expect.objectContaining({
|
|
353
|
+
type: 'tool',
|
|
354
|
+
id: 'ws-1',
|
|
355
|
+
name: 'web_search_call',
|
|
356
|
+
text: 'Searched the internet for "EU AI Act"',
|
|
357
|
+
icon: 'globe',
|
|
358
|
+
}),
|
|
359
|
+
expect.objectContaining({
|
|
360
|
+
type: 'tool',
|
|
361
|
+
id: 'fs-1',
|
|
362
|
+
name: 'file_search_call',
|
|
363
|
+
text: 'Searched documents for "contract terms"',
|
|
364
|
+
icon: 'file-search',
|
|
365
|
+
}),
|
|
366
|
+
expect.objectContaining({
|
|
367
|
+
type: 'tool',
|
|
368
|
+
id: 'sh-1',
|
|
369
|
+
name: 'pirate-speak',
|
|
370
|
+
text: 'Read skill `pirate-speak`',
|
|
371
|
+
icon: 'sparkles',
|
|
372
|
+
}),
|
|
373
|
+
expect.objectContaining({
|
|
374
|
+
type: 'tool',
|
|
375
|
+
id: 'fu-1',
|
|
376
|
+
name: 'fetch_url',
|
|
377
|
+
text: 'Searched google.com',
|
|
378
|
+
icon: 'globe',
|
|
379
|
+
}),
|
|
380
|
+
expect.objectContaining({
|
|
381
|
+
type: 'text',
|
|
382
|
+
id: 'msg-a1',
|
|
383
|
+
text: 'The contract requires compliance.',
|
|
384
|
+
}),
|
|
385
|
+
]);
|
|
386
|
+
});
|
|
387
|
+
|
|
302
388
|
it('forwards `display.text` and `display.icon` from a tool output onto the resulting tool content', () => {
|
|
303
389
|
const tree = responsesToTree([
|
|
304
390
|
makeResponse({
|
|
@@ -141,7 +141,11 @@ export type ResponseOutputToolType =
|
|
|
141
141
|
| 'file_search_call'
|
|
142
142
|
| 'code_interpreter_call'
|
|
143
143
|
| 'image_generation_call'
|
|
144
|
-
| 'local_shell_call'
|
|
144
|
+
| 'local_shell_call'
|
|
145
|
+
// Hosted Aleph Alpha extras. `shell_call` is the stored skill-fetch
|
|
146
|
+
// wrapper; `fetch_url` is the page-read behind hosted web search.
|
|
147
|
+
| 'shell_call'
|
|
148
|
+
| 'fetch_url';
|
|
145
149
|
|
|
146
150
|
/**
|
|
147
151
|
* Server-provided rendering hints for a tool invocation. The server emits a
|
|
@@ -377,16 +381,16 @@ function toAssistantParts(resp: StoredResponse): MessageContent[] {
|
|
|
377
381
|
parts.push(textPart(text, out.id || undefined));
|
|
378
382
|
break;
|
|
379
383
|
}
|
|
380
|
-
//
|
|
381
|
-
|
|
382
|
-
// a call the assistant made, so it is intentionally skipped.
|
|
383
|
-
case 'mcp_call':
|
|
384
|
-
case 'function_call':
|
|
385
|
-
case 'tool_call': {
|
|
386
|
-
parts.push(toolPart(out));
|
|
384
|
+
// Discovery catalog, not a call the assistant made.
|
|
385
|
+
case 'mcp_list_tools':
|
|
387
386
|
break;
|
|
388
|
-
|
|
387
|
+
// Every other `ResponseOutputTool` is an invocation — function /
|
|
388
|
+
// MCP / hosted builtins (`web_search_call`, `file_search_call`,
|
|
389
|
+
// `shell_call`, …). Hosts used to coerce those to `tool_call`
|
|
390
|
+
// before calling this adapter; converting them here keeps the
|
|
391
|
+
// stored item type intact for citations.
|
|
389
392
|
default:
|
|
393
|
+
parts.push(toolPart(out));
|
|
390
394
|
break;
|
|
391
395
|
}
|
|
392
396
|
}
|
|
@@ -35,7 +35,7 @@ const openSourceAriaLabel = computed(
|
|
|
35
35
|
() =>
|
|
36
36
|
props.openSourceLabel ??
|
|
37
37
|
labels.value.citationOpenSource ??
|
|
38
|
-
defaultChatKitLabels.citationOpenSource
|
|
38
|
+
defaultChatKitLabels.citationOpenSource,
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
// Both labels are clipped to the card width, so each gets the same tooltip
|
|
@@ -25,7 +25,7 @@ const isButton = computed(() => props.as === 'button');
|
|
|
25
25
|
const resolvedAriaLabel = computed(
|
|
26
26
|
() =>
|
|
27
27
|
props.ariaLabel ??
|
|
28
|
-
`${labels.value.citationSourceLabel ?? defaultChatKitLabels.citationSourceLabel
|
|
28
|
+
`${labels.value.citationSourceLabel ?? defaultChatKitLabels.citationSourceLabel} ${props.index}`,
|
|
29
29
|
);
|
|
30
30
|
</script>
|
|
31
31
|
|
|
@@ -26,7 +26,6 @@ const messages = [
|
|
|
26
26
|
function renderLayout(
|
|
27
27
|
msgs: Array<{ role: string; content: string }> = messages,
|
|
28
28
|
) {
|
|
29
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
30
29
|
const Wrapper = defineComponent({
|
|
31
30
|
setup() {
|
|
32
31
|
return () =>
|
|
@@ -55,7 +54,7 @@ function renderWithInstance(
|
|
|
55
54
|
{ withFooter = false }: { withFooter?: boolean } = {},
|
|
56
55
|
) {
|
|
57
56
|
let instance: LayoutInstance | undefined;
|
|
58
|
-
|
|
57
|
+
|
|
59
58
|
const Wrapper = defineComponent({
|
|
60
59
|
setup() {
|
|
61
60
|
const layoutRef = ref<LayoutInstance>();
|
|
@@ -167,7 +166,6 @@ describe('CkConversationLayout', () => {
|
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
it('provides the full message object including custom fields to scoped slots', () => {
|
|
170
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
171
169
|
const Wrapper = defineComponent({ setup: () => renderCustomSlotWrapper });
|
|
172
170
|
|
|
173
171
|
render(Wrapper);
|
|
@@ -206,7 +204,6 @@ describe('CkConversationLayout', () => {
|
|
|
206
204
|
});
|
|
207
205
|
|
|
208
206
|
it('gives the thread-footer the larger top margin when messages exist', () => {
|
|
209
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
210
207
|
const Wrapper = defineComponent({
|
|
211
208
|
setup() {
|
|
212
209
|
return () =>
|
|
@@ -233,7 +230,6 @@ describe('CkConversationLayout', () => {
|
|
|
233
230
|
});
|
|
234
231
|
|
|
235
232
|
it('gives the thread-footer the smaller top margin when there are no messages', () => {
|
|
236
|
-
// eslint-disable-next-line vue/one-component-per-file
|
|
237
233
|
const Wrapper = defineComponent({
|
|
238
234
|
setup() {
|
|
239
235
|
return () =>
|
|
@@ -5,7 +5,7 @@ import { flushPromises } from '@vue/test-utils';
|
|
|
5
5
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
6
6
|
|
|
7
7
|
describe('CkCopyMessageButton', () => {
|
|
8
|
-
const writeText = vi.fn((
|
|
8
|
+
const writeText = vi.fn(() => Promise.resolve());
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
11
|
writeText.mockReset();
|
|
@@ -32,19 +32,19 @@ const thumbsUpLabel = computed(
|
|
|
32
32
|
() =>
|
|
33
33
|
props.ariaLabelThumbsUp ??
|
|
34
34
|
labels.value.feedbackThumbsUp ??
|
|
35
|
-
defaultChatKitLabels.feedbackThumbsUp
|
|
35
|
+
defaultChatKitLabels.feedbackThumbsUp,
|
|
36
36
|
);
|
|
37
37
|
const thumbsDownLabel = computed(
|
|
38
38
|
() =>
|
|
39
39
|
props.ariaLabelThumbsDown ??
|
|
40
40
|
labels.value.feedbackThumbsDown ??
|
|
41
|
-
defaultChatKitLabels.feedbackThumbsDown
|
|
41
|
+
defaultChatKitLabels.feedbackThumbsDown,
|
|
42
42
|
);
|
|
43
43
|
const groupLabel = computed(
|
|
44
44
|
() =>
|
|
45
45
|
props.ariaLabelGroup ??
|
|
46
46
|
labels.value.feedbackGroup ??
|
|
47
|
-
defaultChatKitLabels.feedbackGroup
|
|
47
|
+
defaultChatKitLabels.feedbackGroup,
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
const isUpSelected = computed(() => props.value === 'up');
|
|
@@ -61,56 +61,56 @@ const title = computed(() => {
|
|
|
61
61
|
return (
|
|
62
62
|
titlePositive ??
|
|
63
63
|
labels.value.feedbackDialogTitlePositive ??
|
|
64
|
-
defaultChatKitLabels.feedbackDialogTitlePositive
|
|
64
|
+
defaultChatKitLabels.feedbackDialogTitlePositive
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
return (
|
|
68
68
|
titleNegative ??
|
|
69
69
|
labels.value.feedbackDialogTitleNegative ??
|
|
70
|
-
defaultChatKitLabels.feedbackDialogTitleNegative
|
|
70
|
+
defaultChatKitLabels.feedbackDialogTitleNegative
|
|
71
71
|
);
|
|
72
72
|
});
|
|
73
73
|
const responseHeading = computed(
|
|
74
74
|
() =>
|
|
75
75
|
responseHeadingProp ??
|
|
76
76
|
labels.value.feedbackDialogResponseHeading ??
|
|
77
|
-
defaultChatKitLabels.feedbackDialogResponseHeading
|
|
77
|
+
defaultChatKitLabels.feedbackDialogResponseHeading,
|
|
78
78
|
);
|
|
79
79
|
const description = computed(
|
|
80
80
|
() =>
|
|
81
81
|
descriptionProp ??
|
|
82
82
|
labels.value.feedbackDialogDescription ??
|
|
83
|
-
defaultChatKitLabels.feedbackDialogDescription
|
|
83
|
+
defaultChatKitLabels.feedbackDialogDescription,
|
|
84
84
|
);
|
|
85
85
|
const otherLabel = computed(
|
|
86
86
|
() =>
|
|
87
87
|
otherLabelProp ??
|
|
88
88
|
labels.value.feedbackDialogOtherLabel ??
|
|
89
|
-
defaultChatKitLabels.feedbackDialogOtherLabel
|
|
89
|
+
defaultChatKitLabels.feedbackDialogOtherLabel,
|
|
90
90
|
);
|
|
91
91
|
const otherTooltip = computed(
|
|
92
92
|
() =>
|
|
93
93
|
otherTooltipProp ??
|
|
94
94
|
labels.value.feedbackDialogOtherTooltip ??
|
|
95
|
-
defaultChatKitLabels.feedbackDialogOtherTooltip
|
|
95
|
+
defaultChatKitLabels.feedbackDialogOtherTooltip,
|
|
96
96
|
);
|
|
97
97
|
const freeTextPlaceholder = computed(
|
|
98
98
|
() =>
|
|
99
99
|
freeTextPlaceholderProp ??
|
|
100
100
|
labels.value.feedbackDialogFreeTextPlaceholder ??
|
|
101
|
-
defaultChatKitLabels.feedbackDialogFreeTextPlaceholder
|
|
101
|
+
defaultChatKitLabels.feedbackDialogFreeTextPlaceholder,
|
|
102
102
|
);
|
|
103
103
|
const cancelLabel = computed(
|
|
104
104
|
() =>
|
|
105
105
|
cancelLabelProp ??
|
|
106
106
|
labels.value.feedbackDialogCancelLabel ??
|
|
107
|
-
defaultChatKitLabels.feedbackDialogCancelLabel
|
|
107
|
+
defaultChatKitLabels.feedbackDialogCancelLabel,
|
|
108
108
|
);
|
|
109
109
|
const submitLabel = computed(
|
|
110
110
|
() =>
|
|
111
111
|
submitLabelProp ??
|
|
112
112
|
labels.value.feedbackDialogSubmitLabel ??
|
|
113
|
-
defaultChatKitLabels.feedbackDialogSubmitLabel
|
|
113
|
+
defaultChatKitLabels.feedbackDialogSubmitLabel,
|
|
114
114
|
);
|
|
115
115
|
|
|
116
116
|
// Multi-select: the user may pick zero or more reason codes. Backed by an
|
|
@@ -138,13 +138,11 @@ const actionPopoverPanelClass = computed(() => [
|
|
|
138
138
|
]);
|
|
139
139
|
|
|
140
140
|
const passthroughAttrs = computed(() => {
|
|
141
|
-
const {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
...rest
|
|
147
|
-
} = attrs as Record<string, unknown>;
|
|
141
|
+
const rest = { ...(attrs as Record<string, unknown>) };
|
|
142
|
+
delete rest.class;
|
|
143
|
+
delete rest.as;
|
|
144
|
+
delete rest.asChild;
|
|
145
|
+
delete rest['as-child'];
|
|
148
146
|
return rest;
|
|
149
147
|
});
|
|
150
148
|
|
|
@@ -24,7 +24,8 @@ const rootClass = computed(() => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const passthroughAttrs = computed(() => {
|
|
27
|
-
const
|
|
27
|
+
const rest = { ...(attrs as Record<string, unknown>) };
|
|
28
|
+
delete rest.class;
|
|
28
29
|
return rest;
|
|
29
30
|
});
|
|
30
31
|
</script>
|
|
@@ -394,16 +394,21 @@ export const MathExpressions: Story = {
|
|
|
394
394
|
parameters: { docs: { source: { code: mathTemplateSource } } },
|
|
395
395
|
};
|
|
396
396
|
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
type MdTextNode = { type: string; value?: string; children?: MdTextNode[] };
|
|
398
|
+
|
|
399
|
+
function visitTextNodes(
|
|
400
|
+
node: MdTextNode,
|
|
401
|
+
transform: (value: string) => string,
|
|
402
|
+
): void {
|
|
403
|
+
if (node.type === 'text' && node.value !== undefined) {
|
|
399
404
|
node.value = transform(node.value);
|
|
400
405
|
}
|
|
401
406
|
if (node.children) {
|
|
402
|
-
node.children.forEach((child
|
|
407
|
+
node.children.forEach((child) => visitTextNodes(child, transform));
|
|
403
408
|
}
|
|
404
409
|
}
|
|
405
410
|
|
|
406
|
-
const uppercasePlugin = () => (tree:
|
|
411
|
+
const uppercasePlugin = () => (tree: MdTextNode) => {
|
|
407
412
|
visitTextNodes(tree, (value) => value.toUpperCase());
|
|
408
413
|
};
|
|
409
414
|
|
|
@@ -146,7 +146,7 @@ export default defineComponent({
|
|
|
146
146
|
classes: mergedClasses.value,
|
|
147
147
|
tableLabel:
|
|
148
148
|
labels.value.markdownTableLabel ??
|
|
149
|
-
defaultChatKitLabels.markdownTableLabel
|
|
149
|
+
defaultChatKitLabels.markdownTableLabel,
|
|
150
150
|
renderCitation: (el) => renderCitationNode(el, slots.citation),
|
|
151
151
|
};
|
|
152
152
|
const children = parsedNodes.value
|