@scalar/agent-chat 0.9.14 → 0.9.15
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/App.vue.d.ts.map +1 -1
- package/dist/client-tools/execute-request.d.ts +1 -10
- package/dist/client-tools/execute-request.d.ts.map +1 -1
- package/dist/client-tools/execute-request.js +31 -46
- package/dist/client-tools/execute-request.js.map +1 -1
- package/dist/components/ContextItem.vue.d.ts.map +1 -1
- package/dist/components/ContextItem.vue.js +1 -1
- package/dist/components/ContextItem.vue.js.map +1 -1
- package/dist/components/ContextItem.vue.script.js +5 -5
- package/dist/components/ContextItem.vue.script.js.map +1 -1
- package/dist/components/{LoadingMiniOpenAPIDoc.vue.d.ts → LoadingSearchOpenAPIOperations.vue.d.ts} +1 -1
- package/dist/components/LoadingSearchOpenAPIOperations.vue.d.ts.map +1 -0
- package/dist/components/{LoadingMiniOpenAPIDoc.vue.js → LoadingSearchOpenAPIOperations.vue.js} +4 -4
- package/dist/components/LoadingSearchOpenAPIOperations.vue.js.map +1 -0
- package/dist/entities/index.d.ts +3 -3
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +7 -7
- package/dist/entities/tools/ask-for-authentication.d.ts +1 -0
- package/dist/entities/tools/ask-for-authentication.d.ts.map +1 -1
- package/dist/entities/tools/ask-for-authentication.js +4 -1
- package/dist/entities/tools/ask-for-authentication.js.map +1 -1
- package/dist/entities/tools/execute-request.d.ts +1 -0
- package/dist/entities/tools/execute-request.d.ts.map +1 -1
- package/dist/entities/tools/execute-request.js +2 -1
- package/dist/entities/tools/execute-request.js.map +1 -1
- package/dist/entities/tools/get-openapi-specs-summary.d.ts +12 -0
- package/dist/entities/tools/get-openapi-specs-summary.d.ts.map +1 -0
- package/dist/entities/tools/get-openapi-specs-summary.js +6 -0
- package/dist/entities/tools/get-openapi-specs-summary.js.map +1 -0
- package/dist/entities/tools/search-openapi-operations.d.ts +9 -0
- package/dist/entities/tools/search-openapi-operations.d.ts.map +1 -0
- package/dist/entities/tools/search-openapi-operations.js +7 -0
- package/dist/entities/tools/search-openapi-operations.js.map +1 -0
- package/dist/package.json +1 -2
- package/dist/state/state.d.ts +6 -6
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +2 -5
- package/dist/state/state.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
- package/dist/views/Chat/Chat.vue.js +1 -1
- package/dist/views/Chat/Chat.vue.js.map +1 -1
- package/dist/views/Chat/Chat.vue.script.js +8 -8
- package/dist/views/Chat/Chat.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.script.js +38 -44
- package/dist/views/Chat/Messages/AskForAuthentication.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js.map +1 -1
- package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.script.js.map +1 -1
- package/dist/views/Chat/Messages/{GetMiniOpenAPIDocTool.vue.d.ts → SearchOpenAPIOperationsTool.vue.d.ts} +3 -3
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.d.ts.map +1 -0
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.js +9 -0
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.js.map +1 -0
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.script.js +57 -0
- package/dist/views/Chat/Messages/SearchOpenAPIOperationsTool.vue.script.js.map +1 -0
- package/package.json +6 -7
- package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts.map +0 -1
- package/dist/components/LoadingMiniOpenAPIDoc.vue.js.map +0 -1
- package/dist/entities/tools/constants.d.ts +0 -2
- package/dist/entities/tools/constants.d.ts.map +0 -1
- package/dist/entities/tools/constants.js +0 -6
- package/dist/entities/tools/constants.js.map +0 -1
- package/dist/entities/tools/get-mini-openapi-spec.d.ts +0 -12
- package/dist/entities/tools/get-mini-openapi-spec.d.ts.map +0 -1
- package/dist/entities/tools/get-mini-openapi-spec.js +0 -7
- package/dist/entities/tools/get-mini-openapi-spec.js.map +0 -1
- package/dist/entities/tools/get-openapi-spec-summary.d.ts +0 -10
- package/dist/entities/tools/get-openapi-spec-summary.d.ts.map +0 -1
- package/dist/entities/tools/get-openapi-spec-summary.js +0 -6
- package/dist/entities/tools/get-openapi-spec-summary.js.map +0 -1
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +0 -1
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +0 -9
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js.map +0 -1
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.script.js +0 -39
- package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.script.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./SearchOpenAPIOperationsTool.vue.script.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/views/Chat/Messages/SearchOpenAPIOperationsTool.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-43dd2b86"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=SearchOpenAPIOperationsTool.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchOpenAPIOperationsTool.vue.js","names":[],"sources":["../../../../src/views/Chat/Messages/SearchOpenAPIOperationsTool.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarPopover } from '@scalar/components'\nimport { type ToolUIPart, type UIMessage } from 'ai'\nimport { computed, ref, watch, type Reactive, type Ref } from 'vue'\n\nimport ContextItem from '@/components/ContextItem.vue'\nimport LoadingSearchOpenAPIOperations from '@/components/LoadingSearchOpenAPIOperations.vue'\nimport type { SEARCH_OPENAPI_OPERATIONS_TOOL_NAME } from '@/entities/tools/search-openapi-operations'\nimport { getOperations } from '@/helpers'\nimport { useState, type Tools } from '@/state/state'\n\nconst { messagePart, message } = defineProps<{\n messagePart: Ref<\n ToolUIPart<Pick<Tools, typeof SEARCH_OPENAPI_OPERATIONS_TOOL_NAME>>\n >\n message: Reactive<UIMessage>\n}>()\n\nconst MAX_VISIBLE = 5\n\nconst messageFinished = ref(false)\n\nwatch(\n () => message,\n () => {\n const parts = message.parts\n\n const index = parts.findIndex(\n (part) =>\n 'toolCallId' in part &&\n part.toolCallId === messagePart.value.toolCallId,\n )\n\n messageFinished.value = Boolean(parts[index + 1])\n },\n)\n\nconst operations = computed(() => {\n if (!messagePart.value.output) {\n return\n }\n\n return messagePart.value.output.flatMap((spec) => {\n const title = spec.info?.title\n\n const documentOperations = getOperations(spec)\n\n return documentOperations\n .map(\n (operation) =>\n `${title ? `${title} - ` : ''}${operation.summary ?? ''}`,\n )\n .filter(Boolean)\n })\n})\n\nconst visibleOperations = computed(() =>\n operations.value?.slice(0, MAX_VISIBLE),\n)\nconst hiddenOperations = computed(\n () => operations.value?.slice(MAX_VISIBLE) ?? [],\n)\n\nconst state = useState()\n</script>\n\n<template>\n <div\n v-if=\"\n messagePart.value.state === 'input-available' &&\n state.chat.status === 'streaming'\n \">\n <LoadingSearchOpenAPIOperations />\n </div>\n <div\n v-if=\"operations\"\n class=\"operations\">\n <ContextItem\n v-for=\"operation of visibleOperations\"\n :key=\"operation\"\n :loading=\"!messageFinished\">\n {{ operation }}\n </ContextItem>\n <ScalarPopover\n v-if=\"hiddenOperations.length\"\n placement=\"bottom-start\">\n <ContextItem :loading=\"!messageFinished\">\n +{{ hiddenOperations.length }}\n </ContextItem>\n <template #popover>\n <div class=\"overflowPopover\">\n <ContextItem\n v-for=\"operation of hiddenOperations\"\n :key=\"operation\"\n :loading=\"!messageFinished\">\n {{ operation }}\n </ContextItem>\n </div>\n </template>\n </ScalarPopover>\n </div>\n</template>\n\n<style scoped>\n.operations {\n display: flex;\n gap: 5px;\n align-items: center;\n flex-wrap: wrap;\n margin-bottom: 12px;\n}\n.operations:empty {\n margin-bottom: -12px;\n}\n.overflowPopover {\n display: flex;\n flex-direction: column;\n gap: 5px;\n padding: 8px;\n}\n</style>\n"],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getOperations as e } from "../../../helpers.js";
|
|
2
|
+
import { useState as t } from "../../../state/state.js";
|
|
3
|
+
import n from "../../../components/ContextItem.vue.js";
|
|
4
|
+
import r from "../../../components/LoadingSearchOpenAPIOperations.vue.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, unref as _, watch as v, withCtx as y } from "vue";
|
|
6
|
+
import { ScalarPopover as b } from "@scalar/components";
|
|
7
|
+
//#region src/views/Chat/Messages/SearchOpenAPIOperationsTool.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var x = { key: 0 }, S = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "operations"
|
|
11
|
+
}, C = { class: "overflowPopover" }, w = 5, T = /* @__PURE__ */ f({
|
|
12
|
+
__name: "SearchOpenAPIOperationsTool",
|
|
13
|
+
props: {
|
|
14
|
+
messagePart: {},
|
|
15
|
+
message: {}
|
|
16
|
+
},
|
|
17
|
+
setup(f) {
|
|
18
|
+
let T = m(!1);
|
|
19
|
+
v(() => f.message, () => {
|
|
20
|
+
let e = f.message.parts;
|
|
21
|
+
T.value = !!e[e.findIndex((e) => "toolCallId" in e && e.toolCallId === f.messagePart.value.toolCallId) + 1];
|
|
22
|
+
});
|
|
23
|
+
let E = a(() => {
|
|
24
|
+
if (f.messagePart.value.output) return f.messagePart.value.output.flatMap((t) => {
|
|
25
|
+
let n = t.info?.title;
|
|
26
|
+
return e(t).map((e) => `${n ? `${n} - ` : ""}${e.summary ?? ""}`).filter(Boolean);
|
|
27
|
+
});
|
|
28
|
+
}), D = a(() => E.value?.slice(0, w)), O = a(() => E.value?.slice(w) ?? []), k = t();
|
|
29
|
+
return (e, t) => (p(), c(i, null, [f.messagePart.value.state === "input-available" && _(k).chat.status === "streaming" ? (p(), c("div", x, [d(r)])) : s("", !0), E.value ? (p(), c("div", S, [(p(!0), c(i, null, h(D.value, (e) => (p(), o(n, {
|
|
30
|
+
key: e,
|
|
31
|
+
loading: !T.value
|
|
32
|
+
}, {
|
|
33
|
+
default: y(() => [u(g(e), 1)]),
|
|
34
|
+
_: 2
|
|
35
|
+
}, 1032, ["loading"]))), 128)), O.value.length ? (p(), o(_(b), {
|
|
36
|
+
key: 0,
|
|
37
|
+
placement: "bottom-start"
|
|
38
|
+
}, {
|
|
39
|
+
popover: y(() => [l("div", C, [(p(!0), c(i, null, h(O.value, (e) => (p(), o(n, {
|
|
40
|
+
key: e,
|
|
41
|
+
loading: !T.value
|
|
42
|
+
}, {
|
|
43
|
+
default: y(() => [u(g(e), 1)]),
|
|
44
|
+
_: 2
|
|
45
|
+
}, 1032, ["loading"]))), 128))])]),
|
|
46
|
+
default: y(() => [d(n, { loading: !T.value }, {
|
|
47
|
+
default: y(() => [u(" +" + g(O.value.length), 1)]),
|
|
48
|
+
_: 1
|
|
49
|
+
}, 8, ["loading"])]),
|
|
50
|
+
_: 1
|
|
51
|
+
})) : s("", !0)])) : s("", !0)], 64));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
export { T as default };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=SearchOpenAPIOperationsTool.vue.script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchOpenAPIOperationsTool.vue.script.js","names":[],"sources":["../../../../src/views/Chat/Messages/SearchOpenAPIOperationsTool.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarPopover } from '@scalar/components'\nimport { type ToolUIPart, type UIMessage } from 'ai'\nimport { computed, ref, watch, type Reactive, type Ref } from 'vue'\n\nimport ContextItem from '@/components/ContextItem.vue'\nimport LoadingSearchOpenAPIOperations from '@/components/LoadingSearchOpenAPIOperations.vue'\nimport type { SEARCH_OPENAPI_OPERATIONS_TOOL_NAME } from '@/entities/tools/search-openapi-operations'\nimport { getOperations } from '@/helpers'\nimport { useState, type Tools } from '@/state/state'\n\nconst { messagePart, message } = defineProps<{\n messagePart: Ref<\n ToolUIPart<Pick<Tools, typeof SEARCH_OPENAPI_OPERATIONS_TOOL_NAME>>\n >\n message: Reactive<UIMessage>\n}>()\n\nconst MAX_VISIBLE = 5\n\nconst messageFinished = ref(false)\n\nwatch(\n () => message,\n () => {\n const parts = message.parts\n\n const index = parts.findIndex(\n (part) =>\n 'toolCallId' in part &&\n part.toolCallId === messagePart.value.toolCallId,\n )\n\n messageFinished.value = Boolean(parts[index + 1])\n },\n)\n\nconst operations = computed(() => {\n if (!messagePart.value.output) {\n return\n }\n\n return messagePart.value.output.flatMap((spec) => {\n const title = spec.info?.title\n\n const documentOperations = getOperations(spec)\n\n return documentOperations\n .map(\n (operation) =>\n `${title ? `${title} - ` : ''}${operation.summary ?? ''}`,\n )\n .filter(Boolean)\n })\n})\n\nconst visibleOperations = computed(() =>\n operations.value?.slice(0, MAX_VISIBLE),\n)\nconst hiddenOperations = computed(\n () => operations.value?.slice(MAX_VISIBLE) ?? [],\n)\n\nconst state = useState()\n</script>\n\n<template>\n <div\n v-if=\"\n messagePart.value.state === 'input-available' &&\n state.chat.status === 'streaming'\n \">\n <LoadingSearchOpenAPIOperations />\n </div>\n <div\n v-if=\"operations\"\n class=\"operations\">\n <ContextItem\n v-for=\"operation of visibleOperations\"\n :key=\"operation\"\n :loading=\"!messageFinished\">\n {{ operation }}\n </ContextItem>\n <ScalarPopover\n v-if=\"hiddenOperations.length\"\n placement=\"bottom-start\">\n <ContextItem :loading=\"!messageFinished\">\n +{{ hiddenOperations.length }}\n </ContextItem>\n <template #popover>\n <div class=\"overflowPopover\">\n <ContextItem\n v-for=\"operation of hiddenOperations\"\n :key=\"operation\"\n :loading=\"!messageFinished\">\n {{ operation }}\n </ContextItem>\n </div>\n </template>\n </ScalarPopover>\n </div>\n</template>\n\n<style scoped>\n.operations {\n display: flex;\n gap: 5px;\n align-items: center;\n flex-wrap: wrap;\n margin-bottom: 12px;\n}\n.operations:empty {\n margin-bottom: -12px;\n}\n.overflowPopover {\n display: flex;\n flex-direction: column;\n gap: 5px;\n padding: 8px;\n}\n</style>\n"],"mappings":";;;;;;;;;;qCAkBM,IAAc;;;;;;;EAEpB,IAAM,IAAkB,EAAI,GAAK;AAEjC,UACQ,EAAA,eACA;GACJ,IAAM,IAAQ,EAAA,QAAQ;AAQtB,KAAgB,QAAQ,EAAQ,EANlB,EAAM,WACjB,MACC,gBAAgB,KAChB,EAAK,eAAe,EAAA,YAAY,MAAM,WAC1C,GAE8C;IAElD;EAEA,IAAM,IAAa,QAAe;AAC3B,SAAA,YAAY,MAAM,OAIvB,QAAO,EAAA,YAAY,MAAM,OAAO,SAAS,MAAS;IAChD,IAAM,IAAQ,EAAK,MAAM;AAIzB,WAF2B,EAAc,EAAI,CAG1C,KACE,MACC,GAAG,IAAQ,GAAG,EAAM,OAAO,KAAK,EAAU,WAAW,KACzD,CACC,OAAO,QAAO;KAClB;IACF,EAEK,IAAoB,QACxB,EAAW,OAAO,MAAM,GAAG,EAAY,CACzC,EACM,IAAmB,QACjB,EAAW,OAAO,MAAM,EAAY,IAAI,EAAE,CAClD,EAEM,IAAQ,GAAS;qCAKN,EAAA,YAAY,MAAM,UAAK,qBAAgC,EAAA,EAAK,CAAC,KAAK,WAAM,eAAA,GAAA,EADvF,EAMM,OAAA,GAAA,CADJ,EAAkC,EAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA,EAG5B,EAAA,SAAA,GAAA,EADR,EA0BM,OA1BN,GA0BM,EAAA,EAAA,GAAA,EAvBJ,EAKc,GAAA,MAAA,EAJQ,EAAA,QAAb,YADT,EAKc,GAAA;GAHX,KAAK;GACL,SAAO,CAAG,EAAA;;oBACI,CAAA,EAAA,EAAZ,EAAS,EAAA,EAAA,CAAA,CAAA;;kCAGN,EAAA,MAAiB,UAAA,GAAA,EADzB,EAgBgB,EAAA,EAAA,EAAA;;GAdd,WAAU;;GAIC,SAAO,QAQV,CAPN,EAOM,OAPN,GAOM,EAAA,EAAA,GAAA,EANJ,EAKc,GAAA,MAAA,EAJQ,EAAA,QAAb,YADT,EAKc,GAAA;IAHX,KAAK;IACL,SAAO,CAAG,EAAA;;qBACI,CAAA,EAAA,EAAZ,EAAS,EAAA,EAAA,CAAA,CAAA;;;oBAPJ,CAFd,EAEc,GAAA,EAFA,SAAO,CAAG,EAAA,OAAA,EAAA;qBACrB,CAAA,EADsC,OACtC,EAAG,EAAA,MAAiB,OAAM,EAAA,EAAA,CAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "git+https://github.com/scalar/scalar.git",
|
|
11
11
|
"directory": "packages/agent-chat"
|
|
12
12
|
},
|
|
13
|
-
"version": "0.9.
|
|
13
|
+
"version": "0.9.15",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=22"
|
|
16
16
|
},
|
|
@@ -50,19 +50,18 @@
|
|
|
50
50
|
"vue": "^3.5.26",
|
|
51
51
|
"whatwg-mimetype": "4.0.0",
|
|
52
52
|
"zod": "^4.3.5",
|
|
53
|
-
"@scalar/api-client": "2.39.1",
|
|
54
53
|
"@scalar/helpers": "0.4.2",
|
|
55
|
-
"@scalar/
|
|
54
|
+
"@scalar/api-client": "2.39.2",
|
|
56
55
|
"@scalar/icons": "0.7.0",
|
|
56
|
+
"@scalar/components": "0.21.1",
|
|
57
|
+
"@scalar/openapi-types": "0.6.1",
|
|
57
58
|
"@scalar/json-magic": "0.12.4",
|
|
58
59
|
"@scalar/themes": "0.15.1",
|
|
59
|
-
"@scalar/openapi-types": "0.6.1",
|
|
60
|
-
"@scalar/types": "0.7.5",
|
|
61
60
|
"@scalar/use-toasts": "0.10.1",
|
|
62
|
-
"@scalar/
|
|
61
|
+
"@scalar/types": "0.7.5",
|
|
62
|
+
"@scalar/workspace-store": "0.41.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@modelcontextprotocol/sdk": "1.26.0",
|
|
66
65
|
"@tailwindcss/vite": "^4.2.0",
|
|
67
66
|
"@types/whatwg-mimetype": "3.0.2",
|
|
68
67
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingMiniOpenAPIDoc.vue.d.ts","sourceRoot":"","sources":["../../src/components/LoadingMiniOpenAPIDoc.vue"],"names":[],"mappings":"AAyFA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingMiniOpenAPIDoc.vue.js","names":[],"sources":["../../src/components/LoadingMiniOpenAPIDoc.vue"],"sourcesContent":["<template>\n <div class=\"sendingRequest\">\n <div class=\"playIcon\"></div>\n Retrieving relevant information...\n </div>\n</template>\n\n<style scoped>\n.playIcon {\n padding: 4px;\n height: 16px;\n width: 16px;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background: var(--scalar-background-1);\n border-radius: 50%;\n}\n\n.playIcon::before {\n content: '';\n width: 16px;\n height: 16px;\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n border-width: 1.5px;\n border-style: solid;\n border-color: currentcolor currentcolor transparent;\n border-image: initial;\n border-radius: 50%;\n background: var(--scalar-background-1);\n animation: 0.42s linear 0s infinite normal none running rotation;\n}\n\n.sendingRequest {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-font-size-3);\n margin-bottom: 10px;\n}\n\n.sendingRequest svg {\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: 50%;\n}\n\n@keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n</style>\n"],"mappings":";;;;kBACO,OAAM,kBAAgB;;aAA3B,EAGM,OAHN,GAGM,CAAA,GAAA,AAAA,EAAA,OAAA,CAFJ,EAA4B,OAAA,EAAvB,OAAM,YAAU,EAAA,MAAA,GAAA,EAAA,EAAO,wCAE9B,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,QAAQ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../../../src/entities/tools/constants.ts"],"sourcesContent":["export const TOOL_NAMESPACE_SLUG_DELIMITER = '---'\n"],"mappings":";AAAA,IAAa,IAAgC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
export declare const GET_MINI_OPENAPI_SPEC_TOOL_NAME: "get-mini-openapi-spec";
|
|
5
|
-
export declare const getMiniOpenAPIDocToolInputSchema: z.ZodObject<{
|
|
6
|
-
question: z.ZodString;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export type GetMiniOpenAPIDocToolInput = z.input<typeof getMiniOpenAPIDocToolInputSchema>;
|
|
9
|
-
export type GetMiniOpenAPIDocToolOutput = CallToolResult & {
|
|
10
|
-
structuredContent: Partial<OpenAPIV3_1.Document>;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=get-mini-openapi-spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-mini-openapi-spec.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/get-mini-openapi-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,+BAA+B,EAAG,uBAAgC,CAAA;AAE/E,eAAO,MAAM,gCAAgC;;iBAE3C,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AAEzF,MAAM,MAAM,2BAA2B,GAAG,cAAc,GAAG;IACzD,iBAAiB,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;CACjD,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { z as e } from "zod";
|
|
2
|
-
//#region src/entities/tools/get-mini-openapi-spec.ts
|
|
3
|
-
var t = "get-mini-openapi-spec", n = e.object({ question: e.string() });
|
|
4
|
-
//#endregion
|
|
5
|
-
export { t as GET_MINI_OPENAPI_SPEC_TOOL_NAME, n as getMiniOpenAPIDocToolInputSchema };
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=get-mini-openapi-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-mini-openapi-spec.js","names":[],"sources":["../../../src/entities/tools/get-mini-openapi-spec.ts"],"sourcesContent":["import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\nimport { z } from 'zod'\n\nexport const GET_MINI_OPENAPI_SPEC_TOOL_NAME = 'get-mini-openapi-spec' as const\n\nexport const getMiniOpenAPIDocToolInputSchema = z.object({\n question: z.string(),\n})\n\nexport type GetMiniOpenAPIDocToolInput = z.input<typeof getMiniOpenAPIDocToolInputSchema>\n\nexport type GetMiniOpenAPIDocToolOutput = CallToolResult & {\n structuredContent: Partial<OpenAPIV3_1.Document>\n}\n"],"mappings":";;AAIA,IAAa,IAAkC,yBAElC,IAAmC,EAAE,OAAO,EACvD,UAAU,EAAE,QAAQ,EACrB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
3
|
-
export declare const GET_OPENAPI_SPECS_SUMMARY_TOOL_NAME: "get-openapi-specs-summary";
|
|
4
|
-
export type GetOpenAPISpecsSummaryToolOutput = CallToolResult & {
|
|
5
|
-
structuredContent: {
|
|
6
|
-
info?: OpenAPIV3_1.InfoObject;
|
|
7
|
-
paths: string[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=get-openapi-spec-summary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-openapi-spec-summary.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/get-openapi-spec-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,eAAO,MAAM,mCAAmC,EAAG,2BAAoC,CAAA;AAEvF,MAAM,MAAM,gCAAgC,GAAG,cAAc,GAAG;IAC9D,iBAAiB,EAAE;QACjB,IAAI,CAAC,EAAE,WAAW,CAAC,UAAU,CAAA;QAC7B,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,CAAA;CACF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-openapi-spec-summary.js","names":[],"sources":["../../../src/entities/tools/get-openapi-spec-summary.ts"],"sourcesContent":["import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { OpenAPIV3_1 } from '@scalar/openapi-types'\n\nexport const GET_OPENAPI_SPECS_SUMMARY_TOOL_NAME = 'get-openapi-specs-summary' as const\n\nexport type GetOpenAPISpecsSummaryToolOutput = CallToolResult & {\n structuredContent: {\n info?: OpenAPIV3_1.InfoObject\n paths: string[]\n }\n}\n"],"mappings":";AAGA,IAAa,IAAsC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetMiniOpenAPIDocTool.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Chat/Messages/GetMiniOpenAPIDocTool.vue"],"names":[],"mappings":"AAyFA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,IAAI,CAAA;AACpD,OAAO,EAAwB,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAInE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAA;AAE7F,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AAEpD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,CACd,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,+BAA+B,CAAC,CAAC,CAChE,CAAA;IACD,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAC;AAuGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
-
import t from "./GetMiniOpenAPIDocTool.vue.script.js";
|
|
3
|
-
/* empty css */
|
|
4
|
-
//#region src/views/Chat/Messages/GetMiniOpenAPIDocTool.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-ecee6203"]]);
|
|
6
|
-
//#endregion
|
|
7
|
-
export { n as default };
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=GetMiniOpenAPIDocTool.vue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetMiniOpenAPIDocTool.vue.js","names":[],"sources":["../../../../src/views/Chat/Messages/GetMiniOpenAPIDocTool.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { type ToolUIPart, type UIMessage } from 'ai'\nimport { computed, ref, watch, type Reactive, type Ref } from 'vue'\n\nimport ContextItem from '@/components/ContextItem.vue'\nimport LoadingMiniOpenAPIDoc from '@/components/LoadingMiniOpenAPIDoc.vue'\nimport type { GET_MINI_OPENAPI_SPEC_TOOL_NAME } from '@/entities/tools/get-mini-openapi-spec'\nimport { getOperations } from '@/helpers'\nimport { useState, type Tools } from '@/state/state'\n\nconst { messagePart, message } = defineProps<{\n messagePart: Ref<\n ToolUIPart<Pick<Tools, typeof GET_MINI_OPENAPI_SPEC_TOOL_NAME>>\n >\n message: Reactive<UIMessage>\n}>()\n\nconst messageFinished = ref(false)\n\nwatch(\n () => message,\n () => {\n const parts = message.parts\n\n const index = parts.findIndex(\n (part) =>\n 'toolCallId' in part &&\n part.toolCallId === messagePart.value.toolCallId,\n )\n\n messageFinished.value = Boolean(parts[index + 1])\n },\n)\n\nconst operations = computed(() => {\n if (!messagePart.value.output?.structuredContent) {\n return\n }\n\n const title = messagePart.value.output?.structuredContent?.info?.title\n\n const documentOperations = getOperations(\n messagePart.value.output?.structuredContent,\n )\n\n return documentOperations\n .map(\n (operation) => `${title ? `${title} - ` : ''}${operation.summary ?? ''}`,\n )\n .filter(Boolean)\n})\n\nconst state = useState()\n</script>\n\n<template>\n <div\n v-if=\"\n messagePart.value.state === 'input-available' &&\n state.chat.status === 'streaming'\n \">\n <LoadingMiniOpenAPIDoc />\n </div>\n <div\n v-if=\"operations\"\n class=\"operations\">\n <ContextItem\n v-for=\"operation of operations\"\n :key=\"operation\"\n :loading=\"!messageFinished\">\n {{ operation }}\n </ContextItem>\n </div>\n</template>\n\n<style scoped>\n.operations {\n display: flex;\n gap: 5px;\n align-items: center;\n margin-bottom: 12px;\n}\n.operations:empty {\n margin-bottom: -12px;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { getOperations as e } from "../../../helpers.js";
|
|
2
|
-
import { useState as t } from "../../../state/state.js";
|
|
3
|
-
import n from "../../../components/ContextItem.vue.js";
|
|
4
|
-
import r from "../../../components/LoadingMiniOpenAPIDoc.vue.js";
|
|
5
|
-
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createTextVNode as l, createVNode as u, defineComponent as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
|
|
6
|
-
//#region src/views/Chat/Messages/GetMiniOpenAPIDocTool.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var y = { key: 0 }, b = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "operations"
|
|
10
|
-
}, x = /* @__PURE__ */ d({
|
|
11
|
-
__name: "GetMiniOpenAPIDocTool",
|
|
12
|
-
props: {
|
|
13
|
-
messagePart: {},
|
|
14
|
-
message: {}
|
|
15
|
-
},
|
|
16
|
-
setup(d) {
|
|
17
|
-
let x = p(!1);
|
|
18
|
-
_(() => d.message, () => {
|
|
19
|
-
let e = d.message.parts;
|
|
20
|
-
x.value = !!e[e.findIndex((e) => "toolCallId" in e && e.toolCallId === d.messagePart.value.toolCallId) + 1];
|
|
21
|
-
});
|
|
22
|
-
let S = a(() => {
|
|
23
|
-
if (!d.messagePart.value.output?.structuredContent) return;
|
|
24
|
-
let t = d.messagePart.value.output?.structuredContent?.info?.title;
|
|
25
|
-
return e(d.messagePart.value.output?.structuredContent).map((e) => `${t ? `${t} - ` : ""}${e.summary ?? ""}`).filter(Boolean);
|
|
26
|
-
}), C = t();
|
|
27
|
-
return (e, t) => (f(), c(i, null, [d.messagePart.value.state === "input-available" && g(C).chat.status === "streaming" ? (f(), c("div", y, [u(r)])) : s("", !0), S.value ? (f(), c("div", b, [(f(!0), c(i, null, m(S.value, (e) => (f(), o(n, {
|
|
28
|
-
key: e,
|
|
29
|
-
loading: !x.value
|
|
30
|
-
}, {
|
|
31
|
-
default: v(() => [l(h(e), 1)]),
|
|
32
|
-
_: 2
|
|
33
|
-
}, 1032, ["loading"]))), 128))])) : s("", !0)], 64));
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
//#endregion
|
|
37
|
-
export { x as default };
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=GetMiniOpenAPIDocTool.vue.script.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetMiniOpenAPIDocTool.vue.script.js","names":[],"sources":["../../../../src/views/Chat/Messages/GetMiniOpenAPIDocTool.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { type ToolUIPart, type UIMessage } from 'ai'\nimport { computed, ref, watch, type Reactive, type Ref } from 'vue'\n\nimport ContextItem from '@/components/ContextItem.vue'\nimport LoadingMiniOpenAPIDoc from '@/components/LoadingMiniOpenAPIDoc.vue'\nimport type { GET_MINI_OPENAPI_SPEC_TOOL_NAME } from '@/entities/tools/get-mini-openapi-spec'\nimport { getOperations } from '@/helpers'\nimport { useState, type Tools } from '@/state/state'\n\nconst { messagePart, message } = defineProps<{\n messagePart: Ref<\n ToolUIPart<Pick<Tools, typeof GET_MINI_OPENAPI_SPEC_TOOL_NAME>>\n >\n message: Reactive<UIMessage>\n}>()\n\nconst messageFinished = ref(false)\n\nwatch(\n () => message,\n () => {\n const parts = message.parts\n\n const index = parts.findIndex(\n (part) =>\n 'toolCallId' in part &&\n part.toolCallId === messagePart.value.toolCallId,\n )\n\n messageFinished.value = Boolean(parts[index + 1])\n },\n)\n\nconst operations = computed(() => {\n if (!messagePart.value.output?.structuredContent) {\n return\n }\n\n const title = messagePart.value.output?.structuredContent?.info?.title\n\n const documentOperations = getOperations(\n messagePart.value.output?.structuredContent,\n )\n\n return documentOperations\n .map(\n (operation) => `${title ? `${title} - ` : ''}${operation.summary ?? ''}`,\n )\n .filter(Boolean)\n})\n\nconst state = useState()\n</script>\n\n<template>\n <div\n v-if=\"\n messagePart.value.state === 'input-available' &&\n state.chat.status === 'streaming'\n \">\n <LoadingMiniOpenAPIDoc />\n </div>\n <div\n v-if=\"operations\"\n class=\"operations\">\n <ContextItem\n v-for=\"operation of operations\"\n :key=\"operation\"\n :loading=\"!messageFinished\">\n {{ operation }}\n </ContextItem>\n </div>\n</template>\n\n<style scoped>\n.operations {\n display: flex;\n gap: 5px;\n align-items: center;\n margin-bottom: 12px;\n}\n.operations:empty {\n margin-bottom: -12px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EAiBA,IAAM,IAAkB,EAAI,GAAK;AAEjC,UACQ,EAAA,eACA;GACJ,IAAM,IAAQ,EAAA,QAAQ;AAQtB,KAAgB,QAAQ,EAAQ,EANlB,EAAM,WACjB,MACC,gBAAgB,KAChB,EAAK,eAAe,EAAA,YAAY,MAAM,WAC1C,GAE8C;IAElD;EAEA,IAAM,IAAa,QAAe;AAChC,OAAI,CAAC,EAAA,YAAY,MAAM,QAAQ,kBAC7B;GAGF,IAAM,IAAQ,EAAA,YAAY,MAAM,QAAQ,mBAAmB,MAAM;AAMjE,UAJ2B,EACzB,EAAA,YAAY,MAAM,QAAQ,kBAC5B,CAGG,KACE,MAAc,GAAG,IAAQ,GAAG,EAAM,OAAO,KAAK,EAAU,WAAW,KACtE,CACC,OAAO,QAAO;IAClB,EAEK,IAAQ,GAAS;qCAKN,EAAA,YAAY,MAAM,UAAK,qBAAgC,EAAA,EAAK,CAAC,KAAK,WAAM,eAAA,GAAA,EADvF,EAMM,OAAA,GAAA,CADJ,EAAyB,EAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA,EAGnB,EAAA,SAAA,GAAA,EADR,EASM,OATN,GASM,EAAA,EAAA,GAAA,EANJ,EAKc,GAAA,MAAA,EAJQ,EAAA,QAAb,YADT,EAKc,GAAA;GAHX,KAAK;GACL,SAAO,CAAG,EAAA;;oBACI,CAAA,EAAA,EAAZ,EAAS,EAAA,EAAA,CAAA,CAAA"}
|