@8wave/ai-elements 0.98.0-beta.5 → 0.99.0-beta.1
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/README.md +24 -5
- package/dist/_chunks/{PkToolShowForm-BNV4Ja6g.js → PkToolShowForm-dFuoqTPs.js} +84 -80
- package/dist/_chunks/PkToolShowForm-dFuoqTPs.js.map +1 -0
- package/dist/ai-elements.es.js +3153 -2982
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DHkhT0Jf.js → PkChatbot-BlG1WlAO.js} +7 -7
- package/dist-vue/_chunks/{PkChatbot-DHkhT0Jf.js.map → PkChatbot-BlG1WlAO.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-BrufA7o1.js +752 -0
- package/dist-vue/_chunks/PkChatbotMessages-BrufA7o1.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js → PkChatbotStepToolDetail-BVI72gyx.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js.map → PkChatbotStepToolDetail-BVI72gyx.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-Dv9NkYER.js +172 -0
- package/dist-vue/_chunks/{PkChatbotSteps-BpqdFhsG.js.map → PkChatbotSteps-Dv9NkYER.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C08TsXiL.js → PkChatbotViewChat-CAqvbbfN.js} +66 -66
- package/dist-vue/_chunks/PkChatbotViewChat-CAqvbbfN.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js → PkChatbotViewConversations-Cq41H-tc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js.map → PkChatbotViewConversations-Cq41H-tc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js → PkChatbotViewFiles-DNuzmBJc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js.map → PkChatbotViewFiles-DNuzmBJc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js → PkChatbotViewProfile-C0BXIY2N.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js.map → PkChatbotViewProfile-C0BXIY2N.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-C-mWyeka.js → PkToolShowForm-CQuX08lk.js} +62 -58
- package/dist-vue/_chunks/PkToolShowForm-CQuX08lk.js.map +1 -0
- package/dist-vue/_chunks/{createChatbotApiClient-BOBdBxmf.js → createChatbotApiClient-BMZltBLh.js} +367 -363
- package/dist-vue/_chunks/createChatbotApiClient-BMZltBLh.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-BJ-EDmND.js → useChatbotStore-DZiorgLW.js} +113 -103
- package/dist-vue/_chunks/{useChatbotStore-BJ-EDmND.js.map → useChatbotStore-DZiorgLW.js.map} +1 -1
- package/dist-vue/_chunks/{utils-BMa8jwJS.js → utils-Cru8TJxe.js} +48 -30
- package/dist-vue/_chunks/utils-Cru8TJxe.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +3 -3
- package/dist-vue/index.js +4351 -4041
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +16 -0
- package/dist-vue/packages/components/src/PkCheckboxField.d.ts +45 -0
- package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +2 -2
- package/dist-vue/packages/components/src/PkPwaInstallPrompt.d.ts +4 -0
- package/dist-vue/packages/components/src/PkPwaOfflineNotice.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +11 -2
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +24 -2
- package/dist-vue/packages/components/src/chat/PkToolApprovalBadge.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/PkToolApprovalCard.d.ts +35 -0
- package/dist-vue/packages/components/src/chat/PkToolApprovalPreviewMessage.d.ts +11 -0
- package/dist-vue/packages/components/src/chat/index.d.ts +2 -1
- package/dist-vue/packages/components/src/chat/toolApprovalPreviews.d.ts +12 -0
- package/dist-vue/packages/components/src/chat/toolComponentMap.d.ts +5 -3
- package/dist-vue/packages/components/src/chat/useChatScroll.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +13 -0
- package/dist-vue/packages/components/src/index.d.ts +4 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +34 -1
- package/dist-vue/packages/models/src/schema/Agent.d.ts +48 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +6 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js +0 -48
- package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js.map +0 -1
- package/dist/_chunks/PkToolShowForm-BNV4Ja6g.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js +0 -630
- package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-BpqdFhsG.js +0 -172
- package/dist-vue/_chunks/PkChatbotViewChat-C08TsXiL.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js +0 -48
- package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowForm-C-mWyeka.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BOBdBxmf.js.map +0 -1
- package/dist-vue/_chunks/utils-BMa8jwJS.js.map +0 -1
- package/dist-vue/packages/components/src/chat/PkToolRequestConfirm.d.ts +0 -11
package/dist-vue/locales.js
CHANGED
|
@@ -197,6 +197,7 @@ var e = {
|
|
|
197
197
|
teams: "Microsoft Teams",
|
|
198
198
|
formMaxSteps: "Maximum steps",
|
|
199
199
|
formMaxOptionsPerStep: "Max options per step",
|
|
200
|
+
toolRequiresApproval: "Ask the user to confirm",
|
|
200
201
|
chatWidget: "Chat Widget",
|
|
201
202
|
widgetUrl: "Widget URL",
|
|
202
203
|
loadDelay: "Load Delay (ms)",
|
|
@@ -256,6 +257,7 @@ var e = {
|
|
|
256
257
|
includeThoughts: "View reasoning",
|
|
257
258
|
thinking: "Thinking",
|
|
258
259
|
enabled: "Enabled",
|
|
260
|
+
toolApprovalBadge: "User confirm",
|
|
259
261
|
calendarEvent: "Event",
|
|
260
262
|
comparison: "Comparison",
|
|
261
263
|
contactUs: "Contact us",
|
|
@@ -335,6 +337,7 @@ var e = {
|
|
|
335
337
|
dismissableNotice: "It will be hidden after the first message.",
|
|
336
338
|
privacyPolicyNotice: "Displayed at the bottom of the contact form. Supports Markdown.",
|
|
337
339
|
fileUploadEnabled: "Allow users to attach files to their messages.",
|
|
340
|
+
approvalChannels: "A tool can ask the user to confirm before it runs: expand a tool to turn it on. On API endpoints and scheduled runs the call is refused.",
|
|
338
341
|
platformSupported: "Renders natively on WhatsApp and Teams",
|
|
339
342
|
formMaxSteps: "Maximum number of steps the agent can generate in a single form (min. 1, max. 10).",
|
|
340
343
|
formMaxOptionsPerStep: "Maximum number of options for each choice step (min. 2, max. 10).",
|
|
@@ -342,6 +345,7 @@ var e = {
|
|
|
342
345
|
useAllUserKb: "Reads the memories the user shared with all their agents, not just this one. Writing stays scoped to this agent.",
|
|
343
346
|
useAllUserFiles: "Searches all the user's files, including those uploaded on other agents, not just this agent's."
|
|
344
347
|
},
|
|
348
|
+
toolRequiresApproval: "The assistant waits for approval in the chat before running.",
|
|
345
349
|
channelWidgetDisabled: "The Widget channel is disabled: the embed code and loader will not work.",
|
|
346
350
|
channelAppDisabled: "The App channel is disabled: the direct link and iframe will not work.",
|
|
347
351
|
embedCode: "Copy and paste this code to embed the agent in your website.",
|
|
@@ -456,6 +460,10 @@ var e = {
|
|
|
456
460
|
reasoning: "Reasoning...",
|
|
457
461
|
streaming: "Loading..."
|
|
458
462
|
},
|
|
463
|
+
toolApproval: {
|
|
464
|
+
expired: "This request is no longer answerable: the action was not performed.",
|
|
465
|
+
prompt: "Your confirmation is needed to continue:"
|
|
466
|
+
},
|
|
459
467
|
validation: { invalidPhoneNumber: "The number entered is incorrect" },
|
|
460
468
|
showForm: {
|
|
461
469
|
step: "Step {current} of {total}",
|
|
@@ -666,6 +674,7 @@ var e = {
|
|
|
666
674
|
teams: "Microsoft Teams",
|
|
667
675
|
formMaxSteps: "Numero massimo di step",
|
|
668
676
|
formMaxOptionsPerStep: "Opzioni massime per step",
|
|
677
|
+
toolRequiresApproval: "Chiedi conferma all'utente",
|
|
669
678
|
chatWidget: "Chat Widget",
|
|
670
679
|
widgetUrl: "URL widget",
|
|
671
680
|
loadDelay: "Ritardo caricamento (ms)",
|
|
@@ -725,6 +734,7 @@ var e = {
|
|
|
725
734
|
includeThoughts: "Visualizza ragionamento",
|
|
726
735
|
thinking: "Pensiero",
|
|
727
736
|
enabled: "Abilitato",
|
|
737
|
+
toolApprovalBadge: "Conferma utente",
|
|
728
738
|
calendarEvent: "Evento",
|
|
729
739
|
comparison: "Confronto",
|
|
730
740
|
contactUs: "Contattaci",
|
|
@@ -804,6 +814,7 @@ var e = {
|
|
|
804
814
|
dismissableNotice: "Verrà nascosto dopo il primo messaggio.",
|
|
805
815
|
privacyPolicyNotice: "Visibile del modulo di contatto.",
|
|
806
816
|
fileUploadEnabled: "Permetti agli utenti di allegare file ai messaggi.",
|
|
817
|
+
approvalChannels: "Un tool può chiedere conferma all'utente prima di eseguire: espandi il tool per attivarla. Via API o in esecuzioni schedulate la chiamata viene rifiutata.",
|
|
807
818
|
platformSupported: "Resa nativa su WhatsApp e Teams",
|
|
808
819
|
formMaxSteps: "Numero massimo di step che l'agente può generare in un singolo form (min. 1, max. 10).",
|
|
809
820
|
formMaxOptionsPerStep: "Numero massimo di opzioni per ciascuno step di scelta (min. 2, max. 10).",
|
|
@@ -811,6 +822,7 @@ var e = {
|
|
|
811
822
|
useAllUserKb: "Legge le memorie che l'utente ha condiviso con tutti i suoi agenti, non solo con questo. La scrittura resta legata a questo agente.",
|
|
812
823
|
useAllUserFiles: "Cerca in tutti i file dell'utente, anche quelli caricati su altri agenti, non solo in quelli di questo agente."
|
|
813
824
|
},
|
|
825
|
+
toolRequiresApproval: "Prima di eseguire, l'assistente attende l'approvazione in chat.",
|
|
814
826
|
channelWidgetDisabled: "Il canale Widget è disabilitato: il codice embed e il loader non funzioneranno.",
|
|
815
827
|
channelAppDisabled: "Il canale App è disabilitato: il link diretto e l'iframe non funzioneranno.",
|
|
816
828
|
embedCode: "Copia e incolla questo codice per incorporare l'agente nel tuo sito web.",
|
|
@@ -925,6 +937,10 @@ var e = {
|
|
|
925
937
|
reasoning: "Ragionamento...",
|
|
926
938
|
streaming: "Caricamento..."
|
|
927
939
|
},
|
|
940
|
+
toolApproval: {
|
|
941
|
+
expired: "Questa richiesta non è più confermabile: l'azione non è stata eseguita.",
|
|
942
|
+
prompt: "Per continuare serve la tua conferma:"
|
|
943
|
+
},
|
|
928
944
|
validation: { invalidPhoneNumber: "Il numero inserito non è corretto" },
|
|
929
945
|
showForm: {
|
|
930
946
|
step: "Domanda {current} di {total}",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
label: string;
|
|
4
|
+
hint?: string;
|
|
5
|
+
/** Field name, unique within the form. */
|
|
6
|
+
name?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
/**
|
|
11
|
+
* A checkbox (or switch) with a bold label and an optional hint below it, the
|
|
12
|
+
* shape settings panels use for every boolean option. It exists because that
|
|
13
|
+
* markup was copied in ~30 places: same three elements, same utility classes,
|
|
14
|
+
* drifting one edit at a time.
|
|
15
|
+
*
|
|
16
|
+
* Layout only. Wording stays with the caller, so labels keep living next to
|
|
17
|
+
* the option they describe (and in the caller's i18n keys).
|
|
18
|
+
*
|
|
19
|
+
* Extra content under the hint (badges, a channel-support strip) goes in the
|
|
20
|
+
* default slot; options that need a whole custom body are better off with
|
|
21
|
+
* `VvCheckbox` directly.
|
|
22
|
+
*
|
|
23
|
+
* Anything else is forwarded to `VvCheckbox`, `switch` included: options that
|
|
24
|
+
* read as on/off rather than opt-in pass it as a plain attribute.
|
|
25
|
+
*/
|
|
26
|
+
modelValue?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
29
|
+
declare var __VLS_8: {};
|
|
30
|
+
type __VLS_Slots = {} & {
|
|
31
|
+
default?: (props: typeof __VLS_8) => any;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_base: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
34
|
+
"update:modelValue": (value: boolean) => any;
|
|
35
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
37
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -14,7 +14,7 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
14
14
|
allowEmpty?: boolean;
|
|
15
15
|
force?: boolean;
|
|
16
16
|
} & {
|
|
17
|
-
"onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: Partial<T>[]) => any) | undefined;
|
|
18
18
|
}> & (typeof globalThis extends {
|
|
19
19
|
__VLS_PROPS_FALLBACK: infer P;
|
|
20
20
|
} ? P : {});
|
|
@@ -34,7 +34,7 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
34
34
|
} & {
|
|
35
35
|
actions?: (props: {}) => any;
|
|
36
36
|
};
|
|
37
|
-
emit: (evt: "update:modelValue", value: T[]) => void;
|
|
37
|
+
emit: (evt: "update:modelValue", value: Partial<T>[]) => void;
|
|
38
38
|
}>) => VNode & {
|
|
39
39
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
40
40
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const __VLS_export: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const __VLS_export: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -48,6 +48,13 @@ type __VLS_ModelProps = {
|
|
|
48
48
|
origins?: string[];
|
|
49
49
|
};
|
|
50
50
|
'disabledTools'?: AgentBuiltInTool[];
|
|
51
|
+
/**
|
|
52
|
+
* Tools that ask the user to confirm before running
|
|
53
|
+
* (docs/specs/tool-approval-interface.md). Names are canonical tool-set
|
|
54
|
+
* keys, so built-ins go in verbatim; the MCP and API tool pages add their
|
|
55
|
+
* own prefixed entries to the same list.
|
|
56
|
+
*/
|
|
57
|
+
'approvalTools'?: string[];
|
|
51
58
|
'useAllUserKb'?: boolean;
|
|
52
59
|
'useAllUserFiles'?: boolean;
|
|
53
60
|
'formMaxSteps'?: AgentFormSettings['maxSteps'];
|
|
@@ -87,9 +94,9 @@ type __VLS_ModelProps = {
|
|
|
87
94
|
};
|
|
88
95
|
};
|
|
89
96
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
90
|
-
declare var
|
|
97
|
+
declare var __VLS_592: {};
|
|
91
98
|
type __VLS_Slots = {} & {
|
|
92
|
-
default?: (props: typeof
|
|
99
|
+
default?: (props: typeof __VLS_592) => any;
|
|
93
100
|
};
|
|
94
101
|
declare const __VLS_base: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
95
102
|
"update:reasoning": (value: {
|
|
@@ -262,6 +269,7 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Com
|
|
|
262
269
|
origins?: string[];
|
|
263
270
|
}) => any;
|
|
264
271
|
"update:disabledTools": (value: AgentBuiltInTool[]) => any;
|
|
272
|
+
"update:approvalTools": (value: string[]) => any;
|
|
265
273
|
"update:useAllUserKb": (value: boolean) => any;
|
|
266
274
|
"update:useAllUserFiles": (value: boolean) => any;
|
|
267
275
|
"update:formMaxSteps": (value: number) => any;
|
|
@@ -470,6 +478,7 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Com
|
|
|
470
478
|
origins?: string[];
|
|
471
479
|
}) => any) | undefined;
|
|
472
480
|
"onUpdate:disabledTools"?: ((value: AgentBuiltInTool[]) => any) | undefined;
|
|
481
|
+
"onUpdate:approvalTools"?: ((value: string[]) => any) | undefined;
|
|
473
482
|
"onUpdate:useAllUserKb"?: ((value: boolean) => any) | undefined;
|
|
474
483
|
"onUpdate:useAllUserFiles"?: ((value: boolean) => any) | undefined;
|
|
475
484
|
"onUpdate:formMaxSteps"?: ((value: number) => any) | undefined;
|
|
@@ -20,6 +20,12 @@ type __VLS_Props = {
|
|
|
20
20
|
showMessageDateTime?: boolean;
|
|
21
21
|
showMessageTokensCount?: boolean;
|
|
22
22
|
showAllMessageParts?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Lets the user answer the tool requests rendered in the feed (approval
|
|
25
|
+
* and confirm cards). Off by default: the log viewers render the same
|
|
26
|
+
* messages read-only and have nothing to answer with.
|
|
27
|
+
*/
|
|
28
|
+
interactive?: boolean;
|
|
23
29
|
showExtendedSteps?: boolean;
|
|
24
30
|
isDark?: boolean;
|
|
25
31
|
/** Show a floating "back to bottom" button when the user scrolls up (fullscreen layout) */
|
|
@@ -34,7 +40,7 @@ declare var __VLS_25: {
|
|
|
34
40
|
part: TextUIPart;
|
|
35
41
|
index: number;
|
|
36
42
|
isLoading: boolean;
|
|
37
|
-
},
|
|
43
|
+
}, __VLS_73: `tool-${string}`, __VLS_74: {
|
|
38
44
|
message: UIChatMessage;
|
|
39
45
|
part: {
|
|
40
46
|
type: `tool-${string}`;
|
|
@@ -43,7 +49,7 @@ declare var __VLS_25: {
|
|
|
43
49
|
isLoading: boolean;
|
|
44
50
|
};
|
|
45
51
|
type __VLS_Slots = {} & {
|
|
46
|
-
[K in NonNullable<typeof
|
|
52
|
+
[K in NonNullable<typeof __VLS_73>]?: (props: typeof __VLS_74) => any;
|
|
47
53
|
} & {
|
|
48
54
|
text?: (props: typeof __VLS_25) => any;
|
|
49
55
|
};
|
|
@@ -60,6 +66,14 @@ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, Component
|
|
|
60
66
|
"scroll-down": () => any;
|
|
61
67
|
"auto-retry": () => any;
|
|
62
68
|
"reset-chat": () => any;
|
|
69
|
+
"approval-respond": (payload: {
|
|
70
|
+
id: string;
|
|
71
|
+
approved: boolean;
|
|
72
|
+
}) => any;
|
|
73
|
+
"confirm-respond": (payload: {
|
|
74
|
+
toolCallId: string;
|
|
75
|
+
confirmed: boolean;
|
|
76
|
+
}) => any;
|
|
63
77
|
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
64
78
|
onUpvote?: ((message: UIChatMessage) => any) | undefined;
|
|
65
79
|
onDownvote?: ((message: UIChatMessage) => any) | undefined;
|
|
@@ -73,6 +87,14 @@ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, Component
|
|
|
73
87
|
"onScroll-down"?: (() => any) | undefined;
|
|
74
88
|
"onAuto-retry"?: (() => any) | undefined;
|
|
75
89
|
"onReset-chat"?: (() => any) | undefined;
|
|
90
|
+
"onApproval-respond"?: ((payload: {
|
|
91
|
+
id: string;
|
|
92
|
+
approved: boolean;
|
|
93
|
+
}) => any) | undefined;
|
|
94
|
+
"onConfirm-respond"?: ((payload: {
|
|
95
|
+
toolCallId: string;
|
|
96
|
+
confirmed: boolean;
|
|
97
|
+
}) => any) | undefined;
|
|
76
98
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
77
99
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
78
100
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const __VLS_export: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The single confirmation card of the chat. It renders two things that are
|
|
4
|
+
* the same question for the user:
|
|
5
|
+
*
|
|
6
|
+
* - **approval**: a tool call the backend suspended waiting for consent
|
|
7
|
+
* (`approval-requested`), plus its resolved states so the decision stays
|
|
8
|
+
* visible in the transcript;
|
|
9
|
+
* - **confirm**: a `requestConfirm` call, the client-side tool the model uses
|
|
10
|
+
* to have an action it described approved. Same layout, its own wording
|
|
11
|
+
* (Proceed / Cancel, as on the messaging channels).
|
|
12
|
+
*
|
|
13
|
+
* The body comes from `toolApprovalPreviews[toolName]` when the tool has a
|
|
14
|
+
* dedicated preview (localized, human copy: e.g. `sendEmail` will reuse the
|
|
15
|
+
* email renderer); tools without one show only the localized prompt, never
|
|
16
|
+
* a raw echo of the call input. Adding a preview never requires touching
|
|
17
|
+
* this component.
|
|
18
|
+
*/
|
|
19
|
+
type __VLS_Props = {
|
|
20
|
+
part: unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the user can still answer. False in read-only views (chat
|
|
23
|
+
* logs) and, for approvals, once the conversation has moved past the
|
|
24
|
+
* request: the backend closes an abandoned approval as denied, so
|
|
25
|
+
* answering it later would not run the tool.
|
|
26
|
+
*/
|
|
27
|
+
actionable?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
30
|
+
respond: (approved: boolean) => any;
|
|
31
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
|
+
onRespond?: ((approved: boolean) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Preview for the tools whose input is already a sentence written for the
|
|
4
|
+
* user (`requestConfirm`): it is shown as-is, with no key/value framing.
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
input?: unknown;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -28,6 +28,7 @@ import { default as PkMessageDetail } from './PkMessageDetail';
|
|
|
28
28
|
import { default as PkStreamingMarkdown } from './PkStreamingMarkdown';
|
|
29
29
|
import { default as PkToolShowForm } from './PkToolShowForm';
|
|
30
30
|
import { default as PkToolShowArtifact } from './PkToolShowArtifact';
|
|
31
|
+
import { default as PkToolApprovalBadge } from './PkToolApprovalBadge';
|
|
31
32
|
import { default as PkToolShowEmail } from './PkToolShowEmail';
|
|
32
33
|
import { default as PkToolShowMessage } from './PkToolShowMessage';
|
|
33
34
|
import { default as PkToolShowWebPages } from './PkToolShowWebPages';
|
|
@@ -46,4 +47,4 @@ import { default as PkWebSearchSettings } from './PkWebSearchSettings';
|
|
|
46
47
|
import { default as PkStreamingMarkdownAutoscroll } from './PkStreamingMarkdownAutoscroll';
|
|
47
48
|
import { default as PkWelcomePopup } from './PkWelcomePopup';
|
|
48
49
|
import { default as PkChatbotAuth } from './PkChatbotAuth';
|
|
49
|
-
export { PkAgentSelectorInline, PkAgentSettingsPanel, PkAuroraCanvas, PkAvatar, PkChatSidebar, PkChatSidebarConversationItem, PkChatbot, PkChatbotEmptyState, PkChatbotError, PkChatbotFeedbackForm, PkChatbotFilePreview, PkChatbotInput, PkChatbotMessages, PkChatbotSteps, PkChatbotStepToolDetail, PkChatbotViewChat, PkChunkPreview, PkChatbotViewConversations, PkChatbotViewProfile, PkCode, PkCopyBlock, PkDocumentHeader, PkLanguageModel, PkLanguageModelCombobox, PkMessageParts, PkMessageDetail, PkStreamingMarkdown, PkStreamingMarkdownAutoscroll, PkToolShowForm, PkToolShowArtifact, PkToolShowEmail, PkToolShowMessage, PkToolShowWebPages, PkToolShowProductList, PkToolShowContactForm, PkToolShowCalendarEvent, PkToolShowComparison, PkToolShowLocation, PkToolShowQrCode, PkToolShowImageGallery, PkToolShowSuggestedReply, PkToolShowSources, PkRetryCountdown, PkReasoningChat, PkReasoningSettings, PkWebSearchSettings, PkWelcomePopup, PkChatbotAuth, };
|
|
50
|
+
export { PkAgentSelectorInline, PkAgentSettingsPanel, PkAuroraCanvas, PkAvatar, PkChatSidebar, PkChatSidebarConversationItem, PkChatbot, PkChatbotEmptyState, PkChatbotError, PkChatbotFeedbackForm, PkChatbotFilePreview, PkChatbotInput, PkChatbotMessages, PkChatbotSteps, PkChatbotStepToolDetail, PkChatbotViewChat, PkChunkPreview, PkChatbotViewConversations, PkChatbotViewProfile, PkCode, PkCopyBlock, PkDocumentHeader, PkLanguageModel, PkLanguageModelCombobox, PkMessageParts, PkMessageDetail, PkStreamingMarkdown, PkStreamingMarkdownAutoscroll, PkToolShowForm, PkToolShowArtifact, PkToolApprovalBadge, PkToolShowEmail, PkToolShowMessage, PkToolShowWebPages, PkToolShowProductList, PkToolShowContactForm, PkToolShowCalendarEvent, PkToolShowComparison, PkToolShowLocation, PkToolShowQrCode, PkToolShowImageGallery, PkToolShowSuggestedReply, PkToolShowSources, PkRetryCountdown, PkReasoningChat, PkReasoningSettings, PkWebSearchSettings, PkWelcomePopup, PkChatbotAuth, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a tool name to the component that renders a human-readable preview of
|
|
4
|
+
* its input inside `PkToolApprovalCard`. The preview receives the tool call
|
|
5
|
+
* input as its `input` prop.
|
|
6
|
+
*
|
|
7
|
+
* Registering a preview needs no change to the card: tools with no entry here
|
|
8
|
+
* show only the localized confirmation prompt (no raw echo of the call input).
|
|
9
|
+
* Reuse the component that already renders that kind of payload when there is
|
|
10
|
+
* one (e.g. `sendEmail` will reuse `PkToolShowEmail`).
|
|
11
|
+
*/
|
|
12
|
+
export declare const toolApprovalPreviews: Record<string, Component>;
|
|
@@ -2,8 +2,10 @@ import { defineAsyncComponent } from 'vue';
|
|
|
2
2
|
/**
|
|
3
3
|
* Maps tool `part.type` to the corresponding component for auto-rendering.
|
|
4
4
|
* Only includes simple tools that accept only a `:part` prop.
|
|
5
|
-
* Interactive tools (
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Interactive tools (showContactForm, showSuggestedReply, showSources,
|
|
6
|
+
* showMultipleChoice) must be wired explicitly in the parent with their
|
|
7
|
+
* required callbacks/events. Consent requests (`requestConfirm` and the tool
|
|
8
|
+
* calls suspended for approval) are not here either: `PkChatbotMessages`
|
|
9
|
+
* renders them all with `PkToolApprovalCard`.
|
|
8
10
|
*/
|
|
9
11
|
export declare const toolComponentMap: Record<string, ReturnType<typeof defineAsyncComponent>>;
|
|
@@ -10,6 +10,12 @@ interface UseChatScrollOptions {
|
|
|
10
10
|
* child.
|
|
11
11
|
*/
|
|
12
12
|
contentEl?: () => HTMLElement | null;
|
|
13
|
+
/**
|
|
14
|
+
* Awaited right before the new-exchange scroll. Lets the host apply the
|
|
15
|
+
* layout that changes the content height (the anchor spacer) first, so
|
|
16
|
+
* the scroll targets the final bottom instead of an intermediate one.
|
|
17
|
+
*/
|
|
18
|
+
beforeNewMessageScroll?: () => void | Promise<void>;
|
|
13
19
|
onScrollUp?: () => void;
|
|
14
20
|
onScrollDown?: () => void;
|
|
15
21
|
}
|
|
@@ -10,6 +10,19 @@ export declare function mergeConsecutiveTextParts(parts: UIMessage['parts']): UI
|
|
|
10
10
|
export declare function isStreamingPart(part: UIMessage['parts'][number] | null | undefined): part is Extract<UIMessage['parts'][number], {
|
|
11
11
|
streaming?: boolean;
|
|
12
12
|
}>;
|
|
13
|
+
export declare function isToolApprovalPart(part: UIMessage['parts'][number] | null | undefined): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The client-side tool the model uses to have an action it described approved.
|
|
16
|
+
* It predates the SDK's approval gate and keeps its own round-trip (it resolves
|
|
17
|
+
* through `addToolOutput`), but it asks the user the very same question, so it
|
|
18
|
+
* shares `PkToolApprovalCard` instead of having a card of its own.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CONFIRM_TOOL_NAME = "requestConfirm";
|
|
21
|
+
export declare function isToolConfirmPart(part: UIMessage['parts'][number] | null | undefined): boolean;
|
|
22
|
+
/** True for any part the confirmation card is responsible for. */
|
|
23
|
+
export declare function isConfirmationCardPart(part: UIMessage['parts'][number] | null | undefined): boolean;
|
|
24
|
+
/** The id of the pending approval request on a tool part, if any. */
|
|
25
|
+
export declare function getToolApprovalId(part: UIMessage['parts'][number] | null | undefined): string | undefined;
|
|
13
26
|
export declare function getPartState(part: UIMessage['parts'][number] | null | undefined): string | undefined;
|
|
14
27
|
export declare function isLoadingState(state?: string): boolean;
|
|
15
28
|
export declare function getContrast(hexcolor?: string): 'black' | 'white';
|
|
@@ -11,6 +11,7 @@ import { default as PkEditorRadioButtons } from './PkEditorRadioButtons';
|
|
|
11
11
|
import { default as PkEditorCheckboxButtons } from './PkEditorCheckboxButtons';
|
|
12
12
|
import { default as PkEditorRepeater } from './PkEditorRepeater';
|
|
13
13
|
import { default as PkEditorWyswyg } from './PkEditorWyswyg';
|
|
14
|
+
import { default as PkCheckboxField } from './PkCheckboxField';
|
|
14
15
|
import { default as PkFieldset } from './PkFieldset';
|
|
15
16
|
import { default as PkInfobox } from './PkInfobox';
|
|
16
17
|
import { default as PkSchemaField } from './PkSchemaField';
|
|
@@ -19,6 +20,8 @@ import { default as PkLazyImg } from './PkLazyImg';
|
|
|
19
20
|
import { default as PkLightbox } from './PkLightbox';
|
|
20
21
|
import { default as PkLoader } from './PkLoader';
|
|
21
22
|
import { default as PkMedia } from './PkMedia';
|
|
23
|
+
import { default as PkPwaInstallPrompt } from './PkPwaInstallPrompt';
|
|
24
|
+
import { default as PkPwaOfflineNotice } from './PkPwaOfflineNotice';
|
|
22
25
|
import { default as PkRelativeTime } from './PkRelativeTime';
|
|
23
26
|
import { default as PkSkeleton } from './PkSkeleton';
|
|
24
27
|
import { default as PkSvgViewer } from './PkSvgViewer';
|
|
@@ -27,4 +30,4 @@ export * from './chat';
|
|
|
27
30
|
export * from './input';
|
|
28
31
|
export * from './table';
|
|
29
32
|
export * from './types';
|
|
30
|
-
export { PkBadge, PkEditorAgentType, PkEditorDocumentType, PkEditorNotificationType, PkEditorCode, PkEditorJsonSchema, PkEditorMarkdown, PkEditorMedia, PkEditorPrompt, PkEditorRadioButtons, PkEditorCheckboxButtons, PkEditorRepeater, PkEditorWyswyg, PkFieldset, PkInfobox, PkSchemaField, PkIntegrationProvider, PkLazyImg, PkLightbox, PkLoader, PkMedia, PkRelativeTime, PkSkeleton, PkSvgViewer, PkUrl, };
|
|
33
|
+
export { PkBadge, PkEditorAgentType, PkEditorDocumentType, PkEditorNotificationType, PkEditorCode, PkEditorJsonSchema, PkEditorMarkdown, PkEditorMedia, PkEditorPrompt, PkEditorRadioButtons, PkEditorCheckboxButtons, PkEditorRepeater, PkEditorWyswyg, PkCheckboxField, PkFieldset, PkInfobox, PkSchemaField, PkIntegrationProvider, PkLazyImg, PkLightbox, PkLoader, PkMedia, PkPwaInstallPrompt, PkPwaOfflineNotice, PkRelativeTime, PkSkeleton, PkSvgViewer, PkUrl, };
|
|
@@ -349,6 +349,9 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
349
349
|
userFiles: {
|
|
350
350
|
useAllUserFiles: boolean;
|
|
351
351
|
};
|
|
352
|
+
approval: {
|
|
353
|
+
tools: string[];
|
|
354
|
+
};
|
|
352
355
|
} | undefined, {
|
|
353
356
|
disabled: AgentBuiltInTool[];
|
|
354
357
|
showForm: {
|
|
@@ -406,6 +409,9 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
406
409
|
userFiles: {
|
|
407
410
|
useAllUserFiles: boolean;
|
|
408
411
|
};
|
|
412
|
+
approval: {
|
|
413
|
+
tools: string[];
|
|
414
|
+
};
|
|
409
415
|
} | undefined>;
|
|
410
416
|
headers: globalThis.Ref<Record<string, string> | undefined, Record<string, string> | undefined>;
|
|
411
417
|
revisedAnswers: globalThis.Ref<{
|
|
@@ -1512,6 +1518,11 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
1512
1518
|
toolCallId: string;
|
|
1513
1519
|
output: unknown;
|
|
1514
1520
|
}) => void;
|
|
1521
|
+
addToolApprovalResponse: (params: {
|
|
1522
|
+
id: string;
|
|
1523
|
+
approved: boolean;
|
|
1524
|
+
reason?: string;
|
|
1525
|
+
}) => void;
|
|
1515
1526
|
handleFileSelect: (file: File) => Promise<void>;
|
|
1516
1527
|
clearFileLimitError: () => void;
|
|
1517
1528
|
clearPendingAttachments: (revokeAll?: boolean) => void;
|
|
@@ -1864,6 +1875,9 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
1864
1875
|
userFiles: {
|
|
1865
1876
|
useAllUserFiles: boolean;
|
|
1866
1877
|
};
|
|
1878
|
+
approval: {
|
|
1879
|
+
tools: string[];
|
|
1880
|
+
};
|
|
1867
1881
|
} | undefined, {
|
|
1868
1882
|
disabled: AgentBuiltInTool[];
|
|
1869
1883
|
showForm: {
|
|
@@ -1921,6 +1935,9 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
1921
1935
|
userFiles: {
|
|
1922
1936
|
useAllUserFiles: boolean;
|
|
1923
1937
|
};
|
|
1938
|
+
approval: {
|
|
1939
|
+
tools: string[];
|
|
1940
|
+
};
|
|
1924
1941
|
} | undefined>;
|
|
1925
1942
|
headers: globalThis.Ref<Record<string, string> | undefined, Record<string, string> | undefined>;
|
|
1926
1943
|
revisedAnswers: globalThis.Ref<{
|
|
@@ -3027,6 +3044,11 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
3027
3044
|
toolCallId: string;
|
|
3028
3045
|
output: unknown;
|
|
3029
3046
|
}) => void;
|
|
3047
|
+
addToolApprovalResponse: (params: {
|
|
3048
|
+
id: string;
|
|
3049
|
+
approved: boolean;
|
|
3050
|
+
reason?: string;
|
|
3051
|
+
}) => void;
|
|
3030
3052
|
handleFileSelect: (file: File) => Promise<void>;
|
|
3031
3053
|
clearFileLimitError: () => void;
|
|
3032
3054
|
clearPendingAttachments: (revokeAll?: boolean) => void;
|
|
@@ -3379,6 +3401,9 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
3379
3401
|
userFiles: {
|
|
3380
3402
|
useAllUserFiles: boolean;
|
|
3381
3403
|
};
|
|
3404
|
+
approval: {
|
|
3405
|
+
tools: string[];
|
|
3406
|
+
};
|
|
3382
3407
|
} | undefined, {
|
|
3383
3408
|
disabled: AgentBuiltInTool[];
|
|
3384
3409
|
showForm: {
|
|
@@ -3436,6 +3461,9 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
3436
3461
|
userFiles: {
|
|
3437
3462
|
useAllUserFiles: boolean;
|
|
3438
3463
|
};
|
|
3464
|
+
approval: {
|
|
3465
|
+
tools: string[];
|
|
3466
|
+
};
|
|
3439
3467
|
} | undefined>;
|
|
3440
3468
|
headers: globalThis.Ref<Record<string, string> | undefined, Record<string, string> | undefined>;
|
|
3441
3469
|
revisedAnswers: globalThis.Ref<{
|
|
@@ -4542,6 +4570,11 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
4542
4570
|
toolCallId: string;
|
|
4543
4571
|
output: unknown;
|
|
4544
4572
|
}) => void;
|
|
4573
|
+
addToolApprovalResponse: (params: {
|
|
4574
|
+
id: string;
|
|
4575
|
+
approved: boolean;
|
|
4576
|
+
reason?: string;
|
|
4577
|
+
}) => void;
|
|
4545
4578
|
handleFileSelect: (file: File) => Promise<void>;
|
|
4546
4579
|
clearFileLimitError: () => void;
|
|
4547
4580
|
clearPendingAttachments: (revokeAll?: boolean) => void;
|
|
@@ -4553,4 +4586,4 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
|
|
|
4553
4586
|
navigate: (view: ChatbotView) => void;
|
|
4554
4587
|
renameChatTitle: (chatId: string, title: string) => Promise<void>;
|
|
4555
4588
|
deleteChat: (chatId: string) => Promise<void>;
|
|
4556
|
-
}, "regenerate" | "initialize" | "loadConversations" | "loadChatFiles" | "getChatFileUrl" | "getChatFilePreviewUrl" | "deleteChatFile" | "handleSubmit" | "sendMessage" | "stopGeneration" | "startNewChat" | "addToolOutput" | "handleFileSelect" | "clearFileLimitError" | "clearPendingAttachments" | "onUpvote" | "onDownvote" | "onFeedback" | "onFeedbackSubmit" | "onLeadSubmit" | "navigate" | "renameChatTitle" | "deleteChat">>;
|
|
4589
|
+
}, "regenerate" | "initialize" | "loadConversations" | "loadChatFiles" | "getChatFileUrl" | "getChatFilePreviewUrl" | "deleteChatFile" | "handleSubmit" | "sendMessage" | "stopGeneration" | "startNewChat" | "addToolOutput" | "addToolApprovalResponse" | "handleFileSelect" | "clearFileLimitError" | "clearPendingAttachments" | "onUpvote" | "onDownvote" | "onFeedback" | "onFeedbackSubmit" | "onLeadSubmit" | "navigate" | "renameChatTitle" | "deleteChat">>;
|
|
@@ -176,6 +176,28 @@ export declare enum AgentBuiltInTool {
|
|
|
176
176
|
ShowWebPages = "showWebPages",
|
|
177
177
|
ShowMultipleChoice = "showMultipleChoice"
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Prefixes the runtime tool set uses for the tools an agent configures. They are
|
|
181
|
+
* part of a contract shared by three places: the services that build the tool
|
|
182
|
+
* set, the approval list that matches names against it, and the backoffice UI
|
|
183
|
+
* that writes those names. A mismatch is silent (a name matching no tool simply
|
|
184
|
+
* never gates anything), so the prefixes live here and nowhere else.
|
|
185
|
+
*/
|
|
186
|
+
export declare const MCP_TOOL_PREFIX = "mcp-";
|
|
187
|
+
export declare const API_TOOL_PREFIX = "api-";
|
|
188
|
+
/** Tool-set key of an MCP tool, from the name the server advertises. */
|
|
189
|
+
export declare const mcpToolKey: (toolName: string) => string;
|
|
190
|
+
/** Tool-set key of an agent API tool, from its configured name. */
|
|
191
|
+
export declare const apiToolKey: (toolName: string) => string;
|
|
192
|
+
/**
|
|
193
|
+
* Returns true if the tool can be put behind the user-approval gate
|
|
194
|
+
* (`settings.tools.approval.tools`, see docs/specs/tool-approval-interface.md).
|
|
195
|
+
*
|
|
196
|
+
* Only tools that run server-side qualify: a presentation tool has nothing to
|
|
197
|
+
* approve, and a client-resolved one (geolocation, OAuth connect) already asks
|
|
198
|
+
* the user by construction, since it is the browser or the user who answers it.
|
|
199
|
+
*/
|
|
200
|
+
export declare function canRequireApproval(toolName: string): boolean;
|
|
179
201
|
/**
|
|
180
202
|
* Returns true if the tool renders a UI element (card, form, list, etc.).
|
|
181
203
|
* Used in `prepareStep` to prevent duplicate UI elements across streaming steps.
|
|
@@ -317,6 +339,20 @@ export declare const AgentUserFilesSchema: z.ZodObject<{
|
|
|
317
339
|
useAllUserFiles: z.ZodDefault<z.ZodBoolean>;
|
|
318
340
|
}, z.core.$strip>;
|
|
319
341
|
export type AgentUserFiles = z.infer<typeof AgentUserFilesSchema>;
|
|
342
|
+
/**
|
|
343
|
+
* Human-in-the-loop approval settings. Lists the tools whose calls must be
|
|
344
|
+
* approved by the user before they execute. Names are matched against the tool
|
|
345
|
+
* set of the turn, so any tool can be listed: built-in (`sendEmail`), API tools
|
|
346
|
+
* (`api-<name>`) and MCP tools (`mcp-<server>_<tool>`).
|
|
347
|
+
*
|
|
348
|
+
* The gate is UX, not security: it only suspends execution on interactive
|
|
349
|
+
* channels. On non-interactive ones (messaging platforms, API, scheduled runs)
|
|
350
|
+
* a listed tool is denied instead of hanging forever, see `toolApproval.ts`.
|
|
351
|
+
*/
|
|
352
|
+
export declare const AgentToolApprovalSchema: z.ZodObject<{
|
|
353
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
export type AgentToolApproval = z.infer<typeof AgentToolApprovalSchema>;
|
|
320
356
|
export declare const AgentToolsSchema: z.ZodObject<{
|
|
321
357
|
disabled: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof AgentBuiltInTool>>>;
|
|
322
358
|
showForm: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
@@ -382,6 +418,9 @@ export declare const AgentToolsSchema: z.ZodObject<{
|
|
|
382
418
|
userFiles: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
383
419
|
useAllUserFiles: z.ZodDefault<z.ZodBoolean>;
|
|
384
420
|
}, z.core.$strip>>>;
|
|
421
|
+
approval: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
422
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
423
|
+
}, z.core.$strip>>>;
|
|
385
424
|
}, z.core.$strip>;
|
|
386
425
|
export type AgentTools = z.infer<typeof AgentToolsSchema>;
|
|
387
426
|
/**
|
|
@@ -908,6 +947,9 @@ export declare const AgentSettingsSchema: z.ZodObject<{
|
|
|
908
947
|
userFiles: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
909
948
|
useAllUserFiles: z.ZodDefault<z.ZodBoolean>;
|
|
910
949
|
}, z.core.$strip>>>;
|
|
950
|
+
approval: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
951
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
952
|
+
}, z.core.$strip>>>;
|
|
911
953
|
}, z.core.$strip>>>;
|
|
912
954
|
fileUpload: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
913
955
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1213,6 +1255,9 @@ export declare const AgentDtoSchema: z.ZodObject<{
|
|
|
1213
1255
|
userFiles: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1214
1256
|
useAllUserFiles: z.ZodDefault<z.ZodBoolean>;
|
|
1215
1257
|
}, z.core.$strip>>>;
|
|
1258
|
+
approval: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1259
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1260
|
+
}, z.core.$strip>>>;
|
|
1216
1261
|
}, z.core.$strip>>>;
|
|
1217
1262
|
fileUpload: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1218
1263
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1519,6 +1564,9 @@ export declare const AgentSchema: z.ZodLazy<z.ZodObject<{
|
|
|
1519
1564
|
userFiles: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1520
1565
|
useAllUserFiles: z.ZodDefault<z.ZodBoolean>;
|
|
1521
1566
|
}, z.core.$strip>>>;
|
|
1567
|
+
approval: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1568
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1569
|
+
}, z.core.$strip>>>;
|
|
1522
1570
|
}, z.core.$strip>>>;
|
|
1523
1571
|
fileUpload: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1524
1572
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -295,6 +295,9 @@ export declare const ReasoningChatSchema: z.ZodObject<{
|
|
|
295
295
|
userFiles: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
296
296
|
useAllUserFiles: z.ZodDefault<z.ZodBoolean>;
|
|
297
297
|
}, z.core.$strip>>>;
|
|
298
|
+
approval: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
299
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
300
|
+
}, z.core.$strip>>>;
|
|
298
301
|
}, z.core.$strip>>>;
|
|
299
302
|
fileUpload: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
300
303
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -652,6 +655,9 @@ export declare const ReasoningChatSchema: z.ZodObject<{
|
|
|
652
655
|
userFiles: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
653
656
|
useAllUserFiles: z.ZodDefault<z.ZodBoolean>;
|
|
654
657
|
}, z.core.$strip>>>;
|
|
658
|
+
approval: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
659
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
660
|
+
}, z.core.$strip>>>;
|
|
655
661
|
}, z.core.$strip>>>;
|
|
656
662
|
fileUpload: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
657
663
|
enabled: z.ZodDefault<z.ZodBoolean>;
|