@scalar/agent-chat 0.2.5 → 0.2.7
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/api.d.ts +4 -4
- package/dist/api.js +1 -1
- package/dist/components/ContextItem.vue.d.ts.map +1 -1
- package/dist/components/ErrorMessage.vue.js +1 -1
- package/dist/components/ErrorMessage.vue2.js +1 -1
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
- package/dist/components/Selector.vue.d.ts +24 -0
- package/dist/components/Selector.vue.d.ts.map +1 -0
- package/dist/components/Selector.vue.js +67 -0
- package/dist/components/Selector.vue2.js +4 -0
- package/dist/components/ServerSelector.vue.d.ts +22 -0
- package/dist/components/ServerSelector.vue.d.ts.map +1 -0
- package/dist/components/ServerSelector.vue.js +57 -0
- package/dist/components/ServerSelector.vue2.js +4 -0
- package/dist/components/UploadSection.vue.d.ts.map +1 -1
- package/dist/entities/error/constants.d.ts +8 -0
- package/dist/entities/error/constants.d.ts.map +1 -0
- package/dist/entities/error/constants.js +6 -0
- package/dist/entities/error/helpers.d.ts +3 -0
- package/dist/entities/error/helpers.d.ts.map +1 -0
- package/dist/entities/error/helpers.js +9 -0
- package/dist/entities/tools/execute-request.d.ts +1 -1
- package/dist/entities/tools/execute-request.d.ts.map +1 -1
- package/dist/helpers.d.ts +0 -8
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +64 -68
- package/dist/package.json +1 -2
- package/dist/registry/add-documents-to-store.d.ts.map +1 -1
- package/dist/registry/add-documents-to-store.js +24 -23
- package/dist/style.css +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +2 -2
- package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +49 -45
- package/dist/views/PromptForm.vue.js +2 -2
- package/dist/views/PromptForm.vue2.js +5 -5
- package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +2 -2
- package/dist/views/Settings/DocSettings.vue2.js +27 -22
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/package.json +7 -8
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import { defineComponent as k, computed as a, createElementBlock as C, openBlock as
|
|
1
|
+
import { defineComponent as k, computed as a, createElementBlock as C, openBlock as u, normalizeClass as E, createElementVNode as v, createBlock as s, createCommentVNode as i, unref as l, withCtx as I, createTextVNode as N, createVNode as P } from "vue";
|
|
2
2
|
import { getSelectedServer as y } from "@scalar/api-client/v2/features/operation";
|
|
3
|
-
import { getActiveEnvironment as B } from "@scalar/api-client/v2/helpers";
|
|
4
|
-
import { ScalarButton as
|
|
5
|
-
import { ScalarIconArrowRight as
|
|
6
|
-
import
|
|
3
|
+
import { getActiveEnvironment as B, getServers as T } from "@scalar/api-client/v2/helpers";
|
|
4
|
+
import { ScalarButton as _ } from "@scalar/components";
|
|
5
|
+
import { ScalarIconArrowRight as w } from "@scalar/icons";
|
|
6
|
+
import x from "../../../components/AuthenticationProvided.vue.js";
|
|
7
7
|
import O from "../../../components/AuthenticationRequired.vue.js";
|
|
8
8
|
import { ASK_FOR_AUTHENTICATION_TOOL_NAME as b } from "../../../entities/tools/ask-for-authentication.js";
|
|
9
|
-
import { TOOL_NAMESPACE_SLUG_DELIMITER as
|
|
10
|
-
import { createDocumentName as
|
|
11
|
-
import { useState as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
9
|
+
import { TOOL_NAMESPACE_SLUG_DELIMITER as z } from "../../../entities/tools/constants.js";
|
|
10
|
+
import { createDocumentName as L } from "../../../registry/create-document-name.js";
|
|
11
|
+
import { useState as M } from "../../../state/state.js";
|
|
12
|
+
import R from "../../Settings/Auth.vue.js";
|
|
13
|
+
const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class: "authContentInner" }, Z = /* @__PURE__ */ k({
|
|
14
14
|
__name: "AskForAuthentication",
|
|
15
15
|
props: {
|
|
16
16
|
messagePart: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const { workspaceStore: d, eventBus: p, config: h, chat: f } =
|
|
20
|
-
if (!
|
|
18
|
+
setup(t) {
|
|
19
|
+
const { workspaceStore: d, eventBus: p, config: h, chat: f } = M(), o = a(() => {
|
|
20
|
+
if (!t.messagePart.value.input?.uniqueIdentifier || t.messagePart.value.state !== "input-available")
|
|
21
21
|
return;
|
|
22
|
-
const [
|
|
23
|
-
|
|
22
|
+
const [r, n] = t.messagePart.value.input.uniqueIdentifier.split(
|
|
23
|
+
z
|
|
24
24
|
);
|
|
25
|
-
if (!(!
|
|
26
|
-
return
|
|
27
|
-
}),
|
|
25
|
+
if (!(!r || !n))
|
|
26
|
+
return L(r, n);
|
|
27
|
+
}), e = a(() => {
|
|
28
28
|
if (o.value)
|
|
29
29
|
return d.workspace.documents[o.value];
|
|
30
|
-
}), l = a(() => {
|
|
31
|
-
if (t.value)
|
|
32
|
-
return B(d, t.value);
|
|
33
30
|
}), c = a(() => {
|
|
34
|
-
if (
|
|
35
|
-
return
|
|
31
|
+
if (e.value)
|
|
32
|
+
return B(d, e.value);
|
|
33
|
+
}), m = a(() => {
|
|
34
|
+
if (!e.value)
|
|
35
|
+
return;
|
|
36
|
+
const r = T(e.value.servers, {
|
|
37
|
+
documentUrl: e.value["x-scalar-original-source-url"]
|
|
38
|
+
});
|
|
39
|
+
return y(e.value, r);
|
|
36
40
|
}), g = a(
|
|
37
|
-
() =>
|
|
38
|
-
),
|
|
39
|
-
() => o.value &&
|
|
41
|
+
() => e?.value?.components?.securitySchemes ?? {}
|
|
42
|
+
), S = a(
|
|
43
|
+
() => o.value && c.value && m.value
|
|
40
44
|
);
|
|
41
|
-
async function
|
|
45
|
+
async function A() {
|
|
42
46
|
await f.addToolOutput({
|
|
43
|
-
toolCallId:
|
|
47
|
+
toolCallId: t.messagePart.value.toolCallId,
|
|
44
48
|
output: "Authentication provided.",
|
|
45
49
|
tool: b,
|
|
46
50
|
state: "output-available"
|
|
47
51
|
}), await f.sendMessage();
|
|
48
52
|
}
|
|
49
|
-
return (
|
|
53
|
+
return (r, n) => (u(), C("div", {
|
|
50
54
|
class: E(["askForAuthentication", {
|
|
51
|
-
open:
|
|
55
|
+
open: S.value
|
|
52
56
|
}])
|
|
53
57
|
}, [
|
|
54
|
-
v("div",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
v("div", V, [
|
|
59
|
+
t.messagePart.value.state === "output-available" ? (u(), s(x, { key: 0 })) : i("", !0),
|
|
60
|
+
t.messagePart.value.state === "input-available" ? (u(), s(O, { key: 1 })) : i("", !0),
|
|
61
|
+
t.messagePart.value.state === "input-available" ? (u(), s(l(_), {
|
|
58
62
|
key: 2,
|
|
59
63
|
class: "authorizeButton",
|
|
60
64
|
size: "xs",
|
|
61
|
-
onClick:
|
|
65
|
+
onClick: A
|
|
62
66
|
}, {
|
|
63
67
|
default: I(() => [
|
|
64
68
|
n[0] || (n[0] = N(" Authorize ", -1)),
|
|
65
|
-
P(
|
|
69
|
+
P(l(w), { weight: "bold" })
|
|
66
70
|
]),
|
|
67
71
|
_: 1
|
|
68
72
|
})) : i("", !0)
|
|
69
73
|
]),
|
|
70
|
-
v("div",
|
|
71
|
-
v("div",
|
|
72
|
-
o.value &&
|
|
74
|
+
v("div", q, [
|
|
75
|
+
v("div", F, [
|
|
76
|
+
o.value && e.value && c.value && m.value ? (u(), s(R, {
|
|
73
77
|
key: 0,
|
|
74
|
-
document:
|
|
75
|
-
environment:
|
|
76
|
-
eventBus:
|
|
78
|
+
document: e.value,
|
|
79
|
+
environment: c.value,
|
|
80
|
+
eventBus: l(p),
|
|
77
81
|
name: o.value,
|
|
78
|
-
options:
|
|
82
|
+
options: l(h),
|
|
79
83
|
securitySchemes: g.value,
|
|
80
|
-
selectedServer:
|
|
84
|
+
selectedServer: m.value
|
|
81
85
|
}, null, 8, ["document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])) : i("", !0)
|
|
82
86
|
])
|
|
83
87
|
])
|
|
@@ -85,5 +89,5 @@ const R = { class: "toggleButton" }, V = { class: "authContent" }, q = { class:
|
|
|
85
89
|
}
|
|
86
90
|
});
|
|
87
91
|
export {
|
|
88
|
-
|
|
92
|
+
Z as default
|
|
89
93
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./PromptForm.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-58345013"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
@@ -6,8 +6,8 @@ import G from "../components/ErrorMessage.vue.js";
|
|
|
6
6
|
import J from "../components/PaymentSection.vue.js";
|
|
7
7
|
import Q from "../components/SearchPopover.vue.js";
|
|
8
8
|
import W from "../components/UploadSection.vue.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { AgentErrorCodes as Y } from "../entities/error/constants.js";
|
|
10
|
+
import { MAX_PROMPT_SIZE as tt } from "../entities/prompt/constants.js";
|
|
11
11
|
import { useChatApprovals as et } from "../hooks/use-chat-approvals.js";
|
|
12
12
|
import { useChatError as ot } from "../hooks/use-chat-error.js";
|
|
13
13
|
import { useChatPendingClientToolParts as at } from "../hooks/use-chat-pending-client-tool-parts.js";
|
|
@@ -29,7 +29,7 @@ const lt = { class: "actionContainer" }, rt = ["disabled"], it = { class: "input
|
|
|
29
29
|
const P = x;
|
|
30
30
|
w({ focusPrompt: z });
|
|
31
31
|
const l = L("agentPrompt"), e = nt(), T = g(() => e.prompt.value.trim().length > 0), I = g(
|
|
32
|
-
() => e.prompt.value.trim().length >
|
|
32
|
+
() => e.prompt.value.trim().length > tt
|
|
33
33
|
);
|
|
34
34
|
y(e.prompt, () => {
|
|
35
35
|
if (l?.value) {
|
|
@@ -79,7 +79,7 @@ const lt = { class: "actionContainer" }, rt = ["disabled"], it = { class: "input
|
|
|
79
79
|
onApprove: o[0] || (o[0] = (s) => t(p)(!0)),
|
|
80
80
|
onReject: o[1] || (o[1] = (s) => t(p)(!1))
|
|
81
81
|
})) : c("", !0),
|
|
82
|
-
t(v)?.code === t(
|
|
82
|
+
t(v)?.code === t(Y).LIMIT_REACHED ? (n(), i(J, {
|
|
83
83
|
key: 3,
|
|
84
84
|
onApprove: o[2] || (o[2] = (s) => t(p)(!0)),
|
|
85
85
|
onReject: o[3] || (o[3] = (s) => t(p)(!1))
|
|
@@ -199,7 +199,7 @@ const lt = { class: "actionContainer" }, rt = ["disabled"], it = { class: "input
|
|
|
199
199
|
])
|
|
200
200
|
], 32),
|
|
201
201
|
S(a("div", ht, [...o[8] || (o[8] = [
|
|
202
|
-
N('<span data-v-
|
|
202
|
+
N('<span data-v-58345013>Add context from dozens of API's</span><div class="ml-auto flex items-center gap-1" data-v-58345013><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/stripe.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/notion.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/zoom-meetings.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/fathom.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/discord.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/x.png" data-v-58345013></button></div>', 2)
|
|
203
203
|
])], 512), [
|
|
204
204
|
[H, t(e).chat.messages.length <= 1]
|
|
205
205
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/DocSettings.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/DocSettings.vue"],"names":[],"mappings":"AA0EA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAOlF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;;AAoGF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DocSettings.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d556a3a1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getSelectedServer as
|
|
3
|
-
import { getActiveEnvironment as
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as d, computed as t, createElementBlock as a, openBlock as S, createElementVNode as s, createVNode as m, unref as n } from "vue";
|
|
2
|
+
import { getSelectedServer as f } from "@scalar/api-client/v2/features/operation";
|
|
3
|
+
import { getActiveEnvironment as g, getServers as B } from "@scalar/api-client/v2/helpers";
|
|
4
|
+
import h from "../../components/ServerSelector.vue.js";
|
|
5
|
+
import { useState as y } from "../../state/state.js";
|
|
6
|
+
import k from "./Auth.vue.js";
|
|
7
|
+
const p = { class: "docSettings" }, C = /* @__PURE__ */ d({
|
|
8
8
|
__name: "DocSettings",
|
|
9
9
|
props: {
|
|
10
10
|
document: {},
|
|
11
11
|
name: {}
|
|
12
12
|
},
|
|
13
13
|
setup(e) {
|
|
14
|
-
const { workspaceStore:
|
|
15
|
-
() =>
|
|
16
|
-
),
|
|
14
|
+
const { workspaceStore: u, config: i, eventBus: r } = y(), v = t(
|
|
15
|
+
() => g(u, e.document)
|
|
16
|
+
), c = t(() => {
|
|
17
|
+
const o = B(e.document.servers, {
|
|
18
|
+
documentUrl: e.document["x-scalar-original-source-url"]
|
|
19
|
+
});
|
|
20
|
+
return f(e.document, o);
|
|
21
|
+
}), l = t(
|
|
17
22
|
() => e.document.components?.securitySchemes ?? {}
|
|
18
23
|
);
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
m(
|
|
22
|
-
eventBus:
|
|
23
|
-
selectedServer:
|
|
24
|
+
return (o, x) => (S(), a("div", p, [
|
|
25
|
+
s("div", null, [
|
|
26
|
+
m(h, {
|
|
27
|
+
eventBus: n(r),
|
|
28
|
+
selectedServer: c.value,
|
|
24
29
|
servers: e.document.servers ?? []
|
|
25
30
|
}, null, 8, ["eventBus", "selectedServer", "servers"])
|
|
26
31
|
]),
|
|
27
|
-
|
|
28
|
-
m(
|
|
32
|
+
s("div", null, [
|
|
33
|
+
m(k, {
|
|
29
34
|
document: e.document,
|
|
30
|
-
environment:
|
|
31
|
-
eventBus:
|
|
35
|
+
environment: v.value,
|
|
36
|
+
eventBus: n(r),
|
|
32
37
|
name: e.name,
|
|
33
|
-
options:
|
|
34
|
-
securitySchemes:
|
|
35
|
-
selectedServer:
|
|
38
|
+
options: n(i),
|
|
39
|
+
securitySchemes: l.value,
|
|
40
|
+
selectedServer: c.value
|
|
36
41
|
}, null, 8, ["document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])
|
|
37
42
|
])
|
|
38
43
|
]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"AAwIA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAM3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;
|
|
1
|
+
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"AAwIA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAM3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;AA6KF,wBAMG"}
|
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.2.
|
|
13
|
+
"version": "0.2.7",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
@@ -50,16 +50,15 @@
|
|
|
50
50
|
"vue": "^3.5.26",
|
|
51
51
|
"whatwg-mimetype": "4.0.0",
|
|
52
52
|
"zod": "^4.3.5",
|
|
53
|
-
"@scalar/
|
|
54
|
-
"@scalar/
|
|
53
|
+
"@scalar/components": "0.16.30",
|
|
54
|
+
"@scalar/helpers": "0.2.9",
|
|
55
55
|
"@scalar/icons": "0.5.2",
|
|
56
|
-
"@scalar/api-
|
|
57
|
-
"@scalar/json-magic": "0.9.1",
|
|
56
|
+
"@scalar/api-client": "2.20.2",
|
|
58
57
|
"@scalar/openapi-types": "0.5.3",
|
|
59
|
-
"@scalar/types": "0.5.8",
|
|
60
|
-
"@scalar/helpers": "0.2.8",
|
|
61
58
|
"@scalar/themes": "0.13.26",
|
|
62
|
-
"@scalar/
|
|
59
|
+
"@scalar/json-magic": "0.9.3",
|
|
60
|
+
"@scalar/types": "0.5.10",
|
|
61
|
+
"@scalar/workspace-store": "0.26.2"
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
64
|
"@tailwindcss/vite": "^4.1.18",
|