@scalar/agent-chat 0.4.7 → 0.5.2
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 +56 -1
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +25 -20
- package/dist/Chat.vue.d.ts +5 -1
- package/dist/Chat.vue.d.ts.map +1 -1
- package/dist/Chat.vue.js +26 -22
- package/dist/client-tools/execute-request.d.ts +72 -0
- package/dist/client-tools/execute-request.d.ts.map +1 -0
- package/dist/client-tools/execute-request.js +92 -0
- package/dist/components/ActionsDropdown.vue.d.ts +17 -0
- package/dist/components/ActionsDropdown.vue.d.ts.map +1 -0
- package/dist/components/ActionsDropdown.vue.js +7 -0
- package/dist/components/ActionsDropdown.vue2.js +50 -0
- package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +1 -1
- package/dist/components/FreeMessagesInfoSection.vue.js +2 -2
- package/dist/components/FreeMessagesInfoSection.vue2.js +19 -19
- package/dist/components/RequestPreview.vue.d.ts +3 -3
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/RequestPreview.vue.js +2 -2
- package/dist/components/RequestPreview.vue2.js +31 -31
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +16 -16
- package/dist/entities/registry/document.d.ts +1 -0
- package/dist/entities/registry/document.d.ts.map +1 -1
- package/dist/entities/tools/execute-request.d.ts +27 -34
- package/dist/entities/tools/execute-request.d.ts.map +1 -1
- package/dist/entities/tools/execute-request.js +5 -4
- package/dist/helpers.d.ts +36 -275
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +44 -86
- package/dist/hooks/use-chat-approvals.d.ts +17 -10
- package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
- package/dist/hooks/use-chat-approvals.js +28 -15
- package/dist/hooks/use-search.d.ts +2 -0
- package/dist/hooks/use-search.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/package.json +2 -1
- package/dist/plugins/persistance.d.ts +16 -0
- package/dist/plugins/persistance.d.ts.map +1 -0
- package/dist/plugins/persistance.js +23 -0
- package/dist/state/state.d.ts +16 -5
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +148 -101
- package/dist/style.css +1 -1
- package/dist/views/Catalog/Catalog.vue.d.ts +7 -0
- package/dist/views/Catalog/Catalog.vue.d.ts.map +1 -0
- package/dist/views/Catalog/Catalog.vue.js +8 -0
- package/dist/views/Catalog/Catalog.vue2.js +70 -0
- package/dist/views/Chat/Chat.vue.d.ts +2 -0
- 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.vue2.js +36 -35
- 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 +50 -52
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +8 -7
- package/dist/views/Layout.vue.d.ts +2 -0
- package/dist/views/Layout.vue.d.ts.map +1 -1
- package/dist/views/Layout.vue.js +2 -2
- package/dist/views/Layout.vue2.js +16 -14
- package/dist/views/PromptForm.vue.d.ts +2 -0
- package/dist/views/PromptForm.vue.d.ts.map +1 -1
- package/dist/views/PromptForm.vue.js +1 -1
- package/dist/views/PromptForm.vue2.js +112 -99
- package/dist/views/Settings/Auth.vue.d.ts +2 -2
- package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
- package/dist/views/Settings/Auth.vue.js +32 -32
- package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +1 -1
- package/dist/views/Settings/DocSettings.vue2.js +22 -21
- package/dist/views/Start.vue.d.ts +2 -0
- package/dist/views/Start.vue.d.ts.map +1 -1
- package/dist/views/Start.vue.js +2 -2
- package/dist/views/Start.vue2.js +22 -21
- package/package.json +9 -8
package/dist/helpers.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
|
-
import type
|
|
4
|
-
import type { OperationObject
|
|
5
|
-
import { type SecuritySchemes } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
import { type Auth } from '@scalar/workspace-store/entities/auth';
|
|
4
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
6
5
|
export declare function getOperations(doc: Partial<OpenAPIV3_1.Document>): OperationObject[];
|
|
7
6
|
/** Generate document settings from workspace store */
|
|
8
7
|
export declare function createDocumentSettings(workspaceStore: WorkspaceStore): {
|
|
9
8
|
[k: string]: {
|
|
10
9
|
activeServer: import("@scalar/workspace-store/schemas/v3.1/strict/server").ServerObject | null;
|
|
11
|
-
securitySchemes:
|
|
10
|
+
securitySchemes: import("@scalar/api-client/v2/blocks/scalar-auth-selector-block").SecuritySchemeObjectSecret[];
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
/**
|
|
@@ -20,52 +19,26 @@ export declare const authStorage: () => {
|
|
|
20
19
|
/**
|
|
21
20
|
* Retrieves and coerces the authentication schemes stored in local storage.
|
|
22
21
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} & {
|
|
40
|
-
bearerFormat?: string | undefined;
|
|
41
|
-
type: "http";
|
|
42
|
-
scheme: "basic" | "bearer";
|
|
43
|
-
}) | ({
|
|
44
|
-
description?: string | undefined;
|
|
45
|
-
} & {
|
|
46
|
-
type: "oauth2";
|
|
47
|
-
flows: {
|
|
22
|
+
getAuth: (slug: string) => {
|
|
23
|
+
secrets: {
|
|
24
|
+
[x: string]: ({
|
|
25
|
+
type: "apiKey";
|
|
26
|
+
} & {
|
|
27
|
+
'x-scalar-secret-token': string;
|
|
28
|
+
}) | ({
|
|
29
|
+
type: "http";
|
|
30
|
+
} & {
|
|
31
|
+
'x-scalar-secret-token': string;
|
|
32
|
+
} & {
|
|
33
|
+
'x-scalar-secret-username': string;
|
|
34
|
+
'x-scalar-secret-password': string;
|
|
35
|
+
}) | ({
|
|
36
|
+
type: "oauth2";
|
|
37
|
+
} & {
|
|
48
38
|
password?: ({
|
|
49
|
-
refreshUrl: string;
|
|
50
|
-
scopes: {
|
|
51
|
-
[x: string]: string;
|
|
52
|
-
};
|
|
53
|
-
} & {
|
|
54
39
|
'x-scalar-secret-client-id': string;
|
|
55
40
|
} & {
|
|
56
41
|
'x-scalar-secret-token': string;
|
|
57
|
-
} & {
|
|
58
|
-
'x-scalar-security-query'?: {
|
|
59
|
-
[x: string]: string;
|
|
60
|
-
} | undefined;
|
|
61
|
-
} & {
|
|
62
|
-
'x-scalar-security-body'?: {
|
|
63
|
-
[x: string]: string;
|
|
64
|
-
} | undefined;
|
|
65
|
-
} & {
|
|
66
|
-
'x-tokenName'?: string | undefined;
|
|
67
|
-
} & {
|
|
68
|
-
tokenUrl: string;
|
|
69
42
|
} & {
|
|
70
43
|
'x-scalar-secret-username': string;
|
|
71
44
|
'x-scalar-secret-password': string;
|
|
@@ -75,266 +48,54 @@ export declare const authStorage: () => {
|
|
|
75
48
|
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
76
49
|
}) | undefined;
|
|
77
50
|
implicit?: ({
|
|
78
|
-
refreshUrl: string;
|
|
79
|
-
scopes: {
|
|
80
|
-
[x: string]: string;
|
|
81
|
-
};
|
|
82
|
-
} & {
|
|
83
51
|
'x-scalar-secret-client-id': string;
|
|
84
52
|
} & {
|
|
85
53
|
'x-scalar-secret-token': string;
|
|
86
|
-
} & {
|
|
87
|
-
'x-scalar-security-query'?: {
|
|
88
|
-
[x: string]: string;
|
|
89
|
-
} | undefined;
|
|
90
|
-
} & {
|
|
91
|
-
'x-scalar-security-body'?: {
|
|
92
|
-
[x: string]: string;
|
|
93
|
-
} | undefined;
|
|
94
|
-
} & {
|
|
95
|
-
'x-tokenName'?: string | undefined;
|
|
96
|
-
} & {
|
|
97
|
-
authorizationUrl: string;
|
|
98
54
|
} & {
|
|
99
55
|
'x-scalar-secret-redirect-uri': string;
|
|
100
56
|
}) | undefined;
|
|
101
57
|
clientCredentials?: ({
|
|
102
|
-
refreshUrl: string;
|
|
103
|
-
scopes: {
|
|
104
|
-
[x: string]: string;
|
|
105
|
-
};
|
|
106
|
-
} & {
|
|
107
58
|
'x-scalar-secret-client-id': string;
|
|
108
59
|
} & {
|
|
109
60
|
'x-scalar-secret-token': string;
|
|
110
|
-
} & {
|
|
111
|
-
'x-scalar-security-query'?: {
|
|
112
|
-
[x: string]: string;
|
|
113
|
-
} | undefined;
|
|
114
|
-
} & {
|
|
115
|
-
'x-scalar-security-body'?: {
|
|
116
|
-
[x: string]: string;
|
|
117
|
-
} | undefined;
|
|
118
|
-
} & {
|
|
119
|
-
'x-tokenName'?: string | undefined;
|
|
120
|
-
} & {
|
|
121
|
-
tokenUrl: string;
|
|
122
61
|
} & {
|
|
123
62
|
'x-scalar-secret-client-secret': string;
|
|
124
63
|
} & {
|
|
125
64
|
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
126
65
|
}) | undefined;
|
|
127
66
|
authorizationCode?: ({
|
|
128
|
-
refreshUrl: string;
|
|
129
|
-
scopes: {
|
|
130
|
-
[x: string]: string;
|
|
131
|
-
};
|
|
132
|
-
} & {
|
|
133
67
|
'x-scalar-secret-client-id': string;
|
|
134
68
|
} & {
|
|
135
69
|
'x-scalar-secret-token': string;
|
|
136
|
-
} & {
|
|
137
|
-
'x-scalar-security-query'?: {
|
|
138
|
-
[x: string]: string;
|
|
139
|
-
} | undefined;
|
|
140
|
-
} & {
|
|
141
|
-
'x-scalar-security-body'?: {
|
|
142
|
-
[x: string]: string;
|
|
143
|
-
} | undefined;
|
|
144
|
-
} & {
|
|
145
|
-
'x-tokenName'?: string | undefined;
|
|
146
|
-
} & {
|
|
147
|
-
authorizationUrl: string;
|
|
148
|
-
tokenUrl: string;
|
|
149
70
|
} & {
|
|
150
71
|
'x-scalar-secret-client-secret': string;
|
|
151
72
|
} & {
|
|
152
73
|
'x-scalar-secret-redirect-uri': string;
|
|
153
|
-
} & {
|
|
154
|
-
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
155
74
|
} & {
|
|
156
75
|
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
157
76
|
}) | undefined;
|
|
158
|
-
};
|
|
159
|
-
} & {
|
|
160
|
-
'x-default-scopes'?: string[] | undefined;
|
|
161
|
-
}) | ({
|
|
162
|
-
description?: string | undefined;
|
|
163
|
-
} & {
|
|
164
|
-
type: "openIdConnect";
|
|
165
|
-
openIdConnectUrl: string;
|
|
166
|
-
}) | ({
|
|
167
|
-
description?: string | undefined;
|
|
168
|
-
summary?: string | undefined;
|
|
169
|
-
$ref: string;
|
|
170
|
-
} & {
|
|
171
|
-
$status?: "loading" | "error" | undefined;
|
|
172
|
-
$global?: boolean | undefined;
|
|
173
|
-
} & {
|
|
174
|
-
'$ref-value': ({
|
|
175
|
-
description?: string | undefined;
|
|
176
|
-
} & {
|
|
177
|
-
'x-scalar-secret-token': string;
|
|
178
|
-
} & {
|
|
179
|
-
type: "apiKey";
|
|
180
|
-
in: "cookie" | "query" | "header";
|
|
181
|
-
name: string;
|
|
182
|
-
}) | ({
|
|
183
|
-
description?: string | undefined;
|
|
184
|
-
} & {
|
|
185
|
-
'x-scalar-secret-token': string;
|
|
186
|
-
} & {
|
|
187
|
-
'x-scalar-secret-username': string;
|
|
188
|
-
'x-scalar-secret-password': string;
|
|
189
|
-
} & {
|
|
190
|
-
bearerFormat?: string | undefined;
|
|
191
|
-
type: "http";
|
|
192
|
-
scheme: "basic" | "bearer";
|
|
193
|
-
}) | ({
|
|
194
|
-
description?: string | undefined;
|
|
195
|
-
} & {
|
|
196
|
-
type: "oauth2";
|
|
197
|
-
flows: {
|
|
198
|
-
password?: ({
|
|
199
|
-
refreshUrl: string;
|
|
200
|
-
scopes: {
|
|
201
|
-
[x: string]: string;
|
|
202
|
-
};
|
|
203
|
-
} & {
|
|
204
|
-
'x-scalar-secret-client-id': string;
|
|
205
|
-
} & {
|
|
206
|
-
'x-scalar-secret-token': string;
|
|
207
|
-
} & {
|
|
208
|
-
'x-scalar-security-query'?: {
|
|
209
|
-
[x: string]: string;
|
|
210
|
-
} | undefined;
|
|
211
|
-
} & {
|
|
212
|
-
'x-scalar-security-body'?: {
|
|
213
|
-
[x: string]: string;
|
|
214
|
-
} | undefined;
|
|
215
|
-
} & {
|
|
216
|
-
'x-tokenName'?: string | undefined;
|
|
217
|
-
} & {
|
|
218
|
-
tokenUrl: string;
|
|
219
|
-
} & {
|
|
220
|
-
'x-scalar-secret-username': string;
|
|
221
|
-
'x-scalar-secret-password': string;
|
|
222
|
-
} & {
|
|
223
|
-
'x-scalar-secret-client-secret': string;
|
|
224
|
-
} & {
|
|
225
|
-
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
226
|
-
}) | undefined;
|
|
227
|
-
implicit?: ({
|
|
228
|
-
refreshUrl: string;
|
|
229
|
-
scopes: {
|
|
230
|
-
[x: string]: string;
|
|
231
|
-
};
|
|
232
|
-
} & {
|
|
233
|
-
'x-scalar-secret-client-id': string;
|
|
234
|
-
} & {
|
|
235
|
-
'x-scalar-secret-token': string;
|
|
236
|
-
} & {
|
|
237
|
-
'x-scalar-security-query'?: {
|
|
238
|
-
[x: string]: string;
|
|
239
|
-
} | undefined;
|
|
240
|
-
} & {
|
|
241
|
-
'x-scalar-security-body'?: {
|
|
242
|
-
[x: string]: string;
|
|
243
|
-
} | undefined;
|
|
244
|
-
} & {
|
|
245
|
-
'x-tokenName'?: string | undefined;
|
|
246
|
-
} & {
|
|
247
|
-
authorizationUrl: string;
|
|
248
|
-
} & {
|
|
249
|
-
'x-scalar-secret-redirect-uri': string;
|
|
250
|
-
}) | undefined;
|
|
251
|
-
clientCredentials?: ({
|
|
252
|
-
refreshUrl: string;
|
|
253
|
-
scopes: {
|
|
254
|
-
[x: string]: string;
|
|
255
|
-
};
|
|
256
|
-
} & {
|
|
257
|
-
'x-scalar-secret-client-id': string;
|
|
258
|
-
} & {
|
|
259
|
-
'x-scalar-secret-token': string;
|
|
260
|
-
} & {
|
|
261
|
-
'x-scalar-security-query'?: {
|
|
262
|
-
[x: string]: string;
|
|
263
|
-
} | undefined;
|
|
264
|
-
} & {
|
|
265
|
-
'x-scalar-security-body'?: {
|
|
266
|
-
[x: string]: string;
|
|
267
|
-
} | undefined;
|
|
268
|
-
} & {
|
|
269
|
-
'x-tokenName'?: string | undefined;
|
|
270
|
-
} & {
|
|
271
|
-
tokenUrl: string;
|
|
272
|
-
} & {
|
|
273
|
-
'x-scalar-secret-client-secret': string;
|
|
274
|
-
} & {
|
|
275
|
-
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
276
|
-
}) | undefined;
|
|
277
|
-
authorizationCode?: ({
|
|
278
|
-
refreshUrl: string;
|
|
279
|
-
scopes: {
|
|
280
|
-
[x: string]: string;
|
|
281
|
-
};
|
|
282
|
-
} & {
|
|
283
|
-
'x-scalar-secret-client-id': string;
|
|
284
|
-
} & {
|
|
285
|
-
'x-scalar-secret-token': string;
|
|
286
|
-
} & {
|
|
287
|
-
'x-scalar-security-query'?: {
|
|
288
|
-
[x: string]: string;
|
|
289
|
-
} | undefined;
|
|
290
|
-
} & {
|
|
291
|
-
'x-scalar-security-body'?: {
|
|
292
|
-
[x: string]: string;
|
|
293
|
-
} | undefined;
|
|
294
|
-
} & {
|
|
295
|
-
'x-tokenName'?: string | undefined;
|
|
296
|
-
} & {
|
|
297
|
-
authorizationUrl: string;
|
|
298
|
-
tokenUrl: string;
|
|
299
|
-
} & {
|
|
300
|
-
'x-scalar-secret-client-secret': string;
|
|
301
|
-
} & {
|
|
302
|
-
'x-scalar-secret-redirect-uri': string;
|
|
303
|
-
} & {
|
|
304
|
-
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
305
|
-
} & {
|
|
306
|
-
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
307
|
-
}) | undefined;
|
|
308
|
-
};
|
|
309
|
-
} & {
|
|
310
|
-
'x-default-scopes'?: string[] | undefined;
|
|
311
|
-
}) | ({
|
|
312
|
-
description?: string | undefined;
|
|
313
|
-
} & {
|
|
314
|
-
type: "openIdConnect";
|
|
315
|
-
openIdConnectUrl: string;
|
|
316
77
|
});
|
|
317
|
-
}
|
|
78
|
+
};
|
|
79
|
+
selected: {
|
|
80
|
+
document?: {
|
|
81
|
+
selectedIndex: number;
|
|
82
|
+
selectedSchemes: {}[];
|
|
83
|
+
} | undefined;
|
|
84
|
+
path?: {
|
|
85
|
+
[x: string]: {
|
|
86
|
+
[x: string]: {
|
|
87
|
+
selectedIndex: number;
|
|
88
|
+
selectedSchemes: {}[];
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
} | undefined;
|
|
92
|
+
};
|
|
318
93
|
};
|
|
319
94
|
/**
|
|
320
95
|
* Stores the authentication schemes in local storage.
|
|
321
|
-
* @param value The
|
|
322
|
-
*/
|
|
323
|
-
setSchemas: (slug: string, value: SecuritySchemes) => void;
|
|
324
|
-
/**
|
|
325
|
-
* Retrieves and coerces the selected authentication schemes stored in local storage.
|
|
326
|
-
*/
|
|
327
|
-
getSelectedSchemes: (slug: string) => {
|
|
328
|
-
'x-scalar-selected-security'?: {
|
|
329
|
-
selectedSchemes: {}[];
|
|
330
|
-
selectedIndex: number;
|
|
331
|
-
} | undefined;
|
|
332
|
-
};
|
|
333
|
-
/**
|
|
334
|
-
* Stores the user's selected authentication schemes in local storage.
|
|
335
|
-
* @param value The XScalarSelectedSecurity object to stringify and store.
|
|
96
|
+
* @param value The Auth object to stringify and store.
|
|
336
97
|
*/
|
|
337
|
-
|
|
98
|
+
setAuth: (slug: string, value: Auth) => void;
|
|
338
99
|
};
|
|
339
100
|
/**
|
|
340
101
|
* Restores authentication secrets from local storage to the workspace store.
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uCAAuC,CAAA;AAG7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,GACwB,eAAe,EAAE,CACxG;AAOD,sDAAsD;AACtD,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc;;;;;EAgBpE;AAKD;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAMpB;;OAEG;oBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAItB;;;OAGG;oBACa,MAAM,SAAS,IAAI;CAItC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GAAI,mCAG3C;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;CAC/B,KAAG,IAIH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,UAmB7C"}
|
package/dist/helpers.js
CHANGED
|
@@ -1,120 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { coerceValue as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return Object.values(e.paths ?? {}).flatMap((c) => Object.values(c ?? {}));
|
|
1
|
+
import { mergeSecurity as a } from "@scalar/api-client/v2/blocks/scalar-auth-selector-block";
|
|
2
|
+
import { getSelectedServer as c } from "@scalar/api-client/v2/features/operation";
|
|
3
|
+
import { getServers as n } from "@scalar/api-client/v2/helpers";
|
|
4
|
+
import { safeLocalStorage as u, REFERENCE_LS_KEYS as i } from "@scalar/helpers/object/local-storage";
|
|
5
|
+
import { AuthSchema as m } from "@scalar/workspace-store/entities/auth";
|
|
6
|
+
import { coerceValue as h } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
7
|
+
function U(t) {
|
|
8
|
+
return Object.values(t.paths ?? {}).flatMap((r) => Object.values(r ?? {}));
|
|
10
9
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
return t ? s.reduce((r, n) => {
|
|
14
|
-
const o = t[n];
|
|
15
|
-
return o && r.push(h(o)), r;
|
|
16
|
-
}, []) : [];
|
|
10
|
+
function p(t, r, e) {
|
|
11
|
+
return Object.values(a(r?.components?.securitySchemes, {}, e, t));
|
|
17
12
|
}
|
|
18
|
-
function
|
|
13
|
+
function x(t) {
|
|
19
14
|
return Object.fromEntries(
|
|
20
|
-
Object.entries(
|
|
21
|
-
const
|
|
22
|
-
documentUrl:
|
|
15
|
+
Object.entries(t.workspace.documents).map(([r, e]) => {
|
|
16
|
+
const s = n(e.servers, {
|
|
17
|
+
documentUrl: e?.["x-scalar-original-source-url"]
|
|
23
18
|
});
|
|
24
19
|
return [
|
|
25
|
-
|
|
20
|
+
r,
|
|
26
21
|
{
|
|
27
|
-
activeServer:
|
|
28
|
-
securitySchemes:
|
|
22
|
+
activeServer: c(e, s),
|
|
23
|
+
securitySchemes: p(r, e, t.auth)
|
|
29
24
|
}
|
|
30
25
|
];
|
|
31
26
|
})
|
|
32
27
|
);
|
|
33
28
|
}
|
|
34
|
-
const
|
|
35
|
-
const
|
|
29
|
+
const o = u(), S = () => {
|
|
30
|
+
const t = (r) => `${i.AUTH}-${r}`;
|
|
36
31
|
return {
|
|
37
32
|
/**
|
|
38
33
|
* Retrieves and coerces the authentication schemes stored in local storage.
|
|
39
34
|
*/
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
return
|
|
35
|
+
getAuth: (r) => {
|
|
36
|
+
const e = JSON.parse(o.getItem(t(r)) ?? "{}");
|
|
37
|
+
return h(m, e);
|
|
43
38
|
},
|
|
44
39
|
/**
|
|
45
40
|
* Stores the authentication schemes in local storage.
|
|
46
|
-
* @param value The
|
|
41
|
+
* @param value The Auth object to stringify and store.
|
|
47
42
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
/**
|
|
52
|
-
* Retrieves and coerces the selected authentication schemes stored in local storage.
|
|
53
|
-
*/
|
|
54
|
-
getSelectedSchemes: (t) => {
|
|
55
|
-
const r = JSON.parse(m.getItem(s("selectedSchemes", t)) ?? "{}");
|
|
56
|
-
return y(E, r);
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* Stores the user's selected authentication schemes in local storage.
|
|
60
|
-
* @param value The XScalarSelectedSecurity object to stringify and store.
|
|
61
|
-
*/
|
|
62
|
-
setSelectedSchemes: (t, r) => {
|
|
63
|
-
m.setItem(s("selectedSchemes", t), JSON.stringify(r));
|
|
43
|
+
setAuth: (r, e) => {
|
|
44
|
+
o.setItem(t(r), JSON.stringify(e));
|
|
64
45
|
}
|
|
65
46
|
};
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (typeof t != "object") {
|
|
70
|
-
e[s] = t;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
p(h(e[s]), t);
|
|
74
|
-
}
|
|
75
|
-
}, I = (e, c) => Object.keys(e).every((s) => c.has(s)), U = (e, c) => e >= c ? c - 1 : e, H = ({
|
|
76
|
-
documentName: e,
|
|
77
|
-
workspaceStore: c
|
|
47
|
+
}, A = ({
|
|
48
|
+
documentName: t,
|
|
49
|
+
workspaceStore: r
|
|
78
50
|
}) => {
|
|
79
|
-
const s =
|
|
80
|
-
|
|
81
|
-
return;
|
|
82
|
-
const n = f().getSelectedSchemes(e), o = new Set(Object.keys(t.components?.securitySchemes ?? {})), S = n["x-scalar-selected-security"]?.selectedSchemes?.filter((a) => I(a, o));
|
|
83
|
-
if (!t["x-scalar-selected-security"] && S && S.length > 0) {
|
|
84
|
-
const a = n["x-scalar-selected-security"]?.selectedIndex, i = U(a ?? 0, S.length);
|
|
85
|
-
t["x-scalar-selected-security"] = {
|
|
86
|
-
selectedIndex: i,
|
|
87
|
-
selectedSchemes: S
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const g = t.components?.securitySchemes ?? {};
|
|
91
|
-
for (const [a, i] of Object.entries(s)) {
|
|
92
|
-
const u = h(g[a]);
|
|
93
|
-
l(u) && p(u, i);
|
|
94
|
-
}
|
|
51
|
+
const s = S().getAuth(t);
|
|
52
|
+
r.auth.load({ [t]: s });
|
|
95
53
|
};
|
|
96
|
-
function
|
|
54
|
+
function E(t) {
|
|
97
55
|
try {
|
|
98
|
-
return JSON.parse(
|
|
56
|
+
return JSON.parse(t);
|
|
99
57
|
} catch {
|
|
100
58
|
return;
|
|
101
59
|
}
|
|
102
60
|
}
|
|
103
|
-
function
|
|
61
|
+
function b(t) {
|
|
104
62
|
try {
|
|
105
|
-
if (
|
|
106
|
-
return
|
|
107
|
-
const
|
|
108
|
-
return new URL(`https://proxy.scalar.com/?${
|
|
63
|
+
if (t.startsWith("/") || t.startsWith("http://localhost"))
|
|
64
|
+
return t;
|
|
65
|
+
const r = new URLSearchParams({ scalar_url: t });
|
|
66
|
+
return new URL(`https://proxy.scalar.com/?${r}`).toString();
|
|
109
67
|
} catch {
|
|
110
|
-
return console.error(`Invalid URL provided: ${
|
|
68
|
+
return console.error(`Invalid URL provided: ${t}`), t;
|
|
111
69
|
}
|
|
112
70
|
}
|
|
113
71
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
72
|
+
S as authStorage,
|
|
73
|
+
x as createDocumentSettings,
|
|
74
|
+
U as getOperations,
|
|
75
|
+
b as makeScalarProxyUrl,
|
|
76
|
+
A as restoreAuthSecretsFromStorage,
|
|
77
|
+
E as safeParseJson
|
|
120
78
|
};
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { ToolUIPart, UIMessagePart } from 'ai';
|
|
2
|
+
import { type Tools } from '../state/state.js';
|
|
3
|
+
type RequestToolPart = ToolUIPart & {
|
|
4
|
+
type: 'tool-execute-request';
|
|
5
|
+
state: 'input-available';
|
|
6
|
+
input: Tools['execute-request']['input'];
|
|
7
|
+
};
|
|
8
|
+
export declare function requestPartRequiresApproval(part: UIMessagePart<any, Tools>): part is RequestToolPart;
|
|
9
|
+
export declare function useRequestApprovals(): {
|
|
10
|
+
approvalRequiredParts: import("vue").ComputedRef<({
|
|
3
11
|
type: `tool-${string}`;
|
|
4
12
|
} & {
|
|
5
13
|
toolCallId: string;
|
|
6
14
|
title?: string;
|
|
7
15
|
providerExecuted?: boolean;
|
|
8
16
|
} & {
|
|
9
|
-
state: "
|
|
17
|
+
state: "input-available";
|
|
10
18
|
input: unknown;
|
|
11
19
|
output?: never;
|
|
12
20
|
errorText?: never;
|
|
13
21
|
callProviderMetadata?: import("ai").ProviderMetadata;
|
|
14
|
-
approval
|
|
15
|
-
id: string;
|
|
16
|
-
approved?: never;
|
|
17
|
-
reason?: never;
|
|
18
|
-
};
|
|
22
|
+
approval?: never;
|
|
19
23
|
} & {
|
|
20
|
-
|
|
24
|
+
type: "tool-execute-request";
|
|
25
|
+
state: "input-available";
|
|
26
|
+
input: Tools["execute-request"]["input"];
|
|
21
27
|
})[]>;
|
|
22
|
-
|
|
28
|
+
respondToRequestApprovals: (approved: boolean) => Promise<void>;
|
|
23
29
|
};
|
|
30
|
+
export {};
|
|
24
31
|
//# sourceMappingURL=use-chat-approvals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chat-approvals.d.ts","sourceRoot":"","sources":["../../src/hooks/use-chat-approvals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-chat-approvals.d.ts","sourceRoot":"","sources":["../../src/hooks/use-chat-approvals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAMnD,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,eAAe,CAAA;AAEpD,KAAK,eAAe,GAAG,UAAU,GAAG;IAClC,IAAI,EAAE,sBAAsB,CAAA;IAC5B,KAAK,EAAE,iBAAiB,CAAA;IACxB,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAA;CACzC,CAAA;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,IAAI,eAAe,CAMpG;AAED,wBAAgB,mBAAmB;;;;;;;;;;;;;;;cAb3B,sBAAsB;eACrB,iBAAiB;eACjB,KAAK,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;;0CAqBW,OAAO;EAuB3D"}
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
import { computed as l } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { executeRequestTool as i } from "../client-tools/execute-request.js";
|
|
3
|
+
import { createDocumentSettings as n } from "../helpers.js";
|
|
4
|
+
import { useState as m } from "../state/state.js";
|
|
5
|
+
import { EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME as s } from "../entities/tools/execute-request.js";
|
|
6
|
+
function a(t) {
|
|
7
|
+
return t.type === `tool-${s}` && t.state === "input-available" && t.input?.method?.toLowerCase() !== "get";
|
|
5
8
|
}
|
|
6
|
-
function
|
|
7
|
-
const t =
|
|
8
|
-
async function
|
|
9
|
-
const
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
function h() {
|
|
10
|
+
const t = m(), r = l(() => t.chat.messages.filter((e) => e.parts.some(a)).flatMap((e) => e.parts).filter(a));
|
|
11
|
+
async function u(e) {
|
|
12
|
+
const p = r.value.map(async (o) => {
|
|
13
|
+
if (!e)
|
|
14
|
+
return await t.chat.addToolOutput({
|
|
15
|
+
tool: s,
|
|
16
|
+
toolCallId: o.toolCallId,
|
|
17
|
+
state: "output-error",
|
|
18
|
+
errorText: "The user denied the request."
|
|
19
|
+
});
|
|
20
|
+
await i({
|
|
21
|
+
documentSettings: n(t.workspaceStore),
|
|
22
|
+
input: o.input,
|
|
23
|
+
toolCallId: o.toolCallId,
|
|
24
|
+
chat: t.chat
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
await Promise.all(p);
|
|
16
28
|
}
|
|
17
|
-
return {
|
|
29
|
+
return { approvalRequiredParts: r, respondToRequestApprovals: u };
|
|
18
30
|
}
|
|
19
31
|
export {
|
|
20
|
-
|
|
32
|
+
a as requestPartRequiresApproval,
|
|
33
|
+
h as useRequestApprovals
|
|
21
34
|
};
|
|
@@ -9,6 +9,7 @@ export declare function useSearch(): {
|
|
|
9
9
|
logoUrl: string | null;
|
|
10
10
|
slug: string;
|
|
11
11
|
removable?: boolean | undefined;
|
|
12
|
+
searchEnabled?: boolean | undefined;
|
|
12
13
|
}[], ApiMetadata[] | {
|
|
13
14
|
id: string;
|
|
14
15
|
title: string;
|
|
@@ -17,6 +18,7 @@ export declare function useSearch(): {
|
|
|
17
18
|
logoUrl: string | null;
|
|
18
19
|
slug: string;
|
|
19
20
|
removable?: boolean | undefined;
|
|
21
|
+
searchEnabled?: boolean | undefined;
|
|
20
22
|
}[]>;
|
|
21
23
|
};
|
|
22
24
|
//# sourceMappingURL=use-search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-search.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG/D,wBAAgB,SAAS
|
|
1
|
+
{"version":3,"file":"use-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-search.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG/D,wBAAgB,SAAS;;;;;;;;;;;;;;;;;;;;;EAiCxB"}
|