@8wave/ai-elements 0.121.0-beta.57 → 0.121.0-beta.59
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 +16 -1
- package/dist/_chunks/Agent-FDL4Wq0B.js.map +1 -1
- package/dist/ai-elements.es.js +3039 -2713
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.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/Agent-CZUFbLo7.js.map +1 -1
- package/dist-vue/_chunks/PkAvatar-DwtZWSW4.js +38 -0
- package/dist-vue/_chunks/PkAvatar-DwtZWSW4.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-BjD_4yaD.js → PkChatbot-DtyJG8HB.js} +7 -8
- package/dist-vue/_chunks/PkChatbot-DtyJG8HB.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-CMNmmQdu.js → PkChatbotEmptyState-CivaIYxu.js} +2 -3
- package/dist-vue/_chunks/PkChatbotEmptyState-CivaIYxu.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotInput-CdpjDIzr.js → PkChatbotInput-mBl1PWIU.js} +88 -88
- package/dist-vue/_chunks/PkChatbotInput-mBl1PWIU.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-BqFY0Evp.js → PkChatbotViewChat-ZOpF5REL.js} +248 -243
- package/dist-vue/_chunks/PkChatbotViewChat-ZOpF5REL.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-DF_c4X6k.js → PkChatbotViewConversations-THKK5wGp.js} +52 -34
- package/dist-vue/_chunks/PkChatbotViewConversations-THKK5wGp.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewFiles-B76IwGGP.js → PkChatbotViewFiles-BOGd3r0o.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-B76IwGGP.js.map → PkChatbotViewFiles-BOGd3r0o.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-Bt0eH8fO.js → PkChatbotViewProfile-XtL9RfC7.js} +3 -4
- package/dist-vue/_chunks/PkChatbotViewProfile-XtL9RfC7.js.map +1 -0
- package/dist-vue/_chunks/{createChatbotApiClient-BYGLKd_e.js → createChatbotApiClient-Bt387Z64.js} +6 -5
- package/dist-vue/_chunks/createChatbotApiClient-Bt387Z64.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-O0u7mVit.js → useChatbotStore-pnj_3y4N.js} +718 -687
- package/dist-vue/_chunks/useChatbotStore-pnj_3y4N.js.map +1 -0
- package/dist-vue/_chunks/useDialogConfirm-fn7iV-iE.js +86 -0
- package/dist-vue/_chunks/useDialogConfirm-fn7iV-iE.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/apps/web-component/src/composables/usePagePresence.d.ts +17 -0
- package/dist-vue/apps/web-component/src/composables/usePageTools.d.ts +4 -3
- package/dist-vue/apps/web-component/src/pageTools/index.d.ts +11 -1
- package/dist-vue/composables.js +14 -6
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4252 -4009
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +24 -14
- package/dist-vue/packages/components/src/chat/PkAgentPresence.d.ts +34 -0
- package/dist-vue/packages/components/src/chat/PkAvatar.d.ts +6 -7
- package/dist-vue/packages/components/src/chat/PkChatSearchDialog.d.ts +19 -0
- package/dist-vue/packages/components/src/chat/{PkAgentSelectorInline.d.ts → PkChatShortcutsDialog.d.ts} +8 -5
- package/dist-vue/packages/components/src/chat/PkChatSidebar.d.ts +7 -8
- package/dist-vue/packages/components/src/chat/PkChatSidebarConversationItem.d.ts +2 -2
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +4 -1
- package/dist-vue/packages/components/src/chat/PkWorkingAurora.d.ts +25 -0
- package/dist-vue/packages/components/src/chat/index.d.ts +1 -2
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +11 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +21 -3
- package/dist-vue/packages/composable/src/chatbot/useConversationActions.d.ts +54 -1
- package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist-vue/_chunks/PkAvatar-uVRs_DD9.js +0 -43
- package/dist-vue/_chunks/PkAvatar-uVRs_DD9.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-BjD_4yaD.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotEmptyState-CMNmmQdu.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-CdpjDIzr.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-BqFY0Evp.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewConversations-DF_c4X6k.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewProfile-Bt0eH8fO.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BYGLKd_e.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-O0u7mVit.js.map +0 -1
- package/dist-vue/_chunks/useDialogConfirm-CyD9VTKg.js +0 -84
- package/dist-vue/_chunks/useDialogConfirm-CyD9VTKg.js.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { VvButton as e, VvButtonGroup as t, VvDialog as n, VvInputText as r } from "@volverjs/ui-vue/components";
|
|
2
|
+
import { defineComponent as i, h as a, nextTick as o, ref as s, watch as c } from "vue";
|
|
3
|
+
import { useI18n as l } from "vue-i18n";
|
|
4
|
+
// ../../packages/composable/src/useDialog.ts
|
|
5
|
+
var u = s(!1), d = s(), f = s(), p = s(), m = s(), h = s(!1), g = s(), _ = s(), v = () => {
|
|
6
|
+
let e = (e) => {
|
|
7
|
+
u.value = e;
|
|
8
|
+
}, t = () => {
|
|
9
|
+
d.value = void 0, f.value = void 0, p.value = void 0, m.value = void 0, h.value = void 0, g.value = void 0, _.value = void 0;
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
PkGlobalDialog: i({
|
|
13
|
+
name: "PkGlobalDialog",
|
|
14
|
+
render: () => a(n, {
|
|
15
|
+
modelValue: u.value,
|
|
16
|
+
title: d.value,
|
|
17
|
+
transition: f.value,
|
|
18
|
+
modifiers: p.value,
|
|
19
|
+
size: m.value,
|
|
20
|
+
keepOpen: h.value,
|
|
21
|
+
role: g.value,
|
|
22
|
+
"onUpdate:modelValue": e,
|
|
23
|
+
onAfterLeave: t
|
|
24
|
+
}, _.value)
|
|
25
|
+
}),
|
|
26
|
+
openDialog: (e, t) => (d.value = e?.title, f.value = e?.transition, p.value = e?.modifiers, m.value = e?.size, h.value = e?.keepOpen ?? !1, g.value = e?.role, _.value = t, o(() => {
|
|
27
|
+
u.value = !0;
|
|
28
|
+
}), u),
|
|
29
|
+
isOpen: u
|
|
30
|
+
};
|
|
31
|
+
}, y = () => {
|
|
32
|
+
let { openDialog: n } = v(), { t: i } = l({ useScope: "global" });
|
|
33
|
+
return { openDialogConfirm: ({ emitReject: o = !1, confirmLabel: l, cancelLabel: u, questionLabel: d, descriptionLabel: f, onlyConfirm: p = !1, passphrase: m, passphraseLabel: h, passphraseHint: g, title: _, danger: v = !1 } = {}) => new Promise((y, b) => {
|
|
34
|
+
let x = s(), S = n({
|
|
35
|
+
role: "alertdialog",
|
|
36
|
+
size: "small",
|
|
37
|
+
keepOpen: !0,
|
|
38
|
+
title: _
|
|
39
|
+
}, {
|
|
40
|
+
default: () => a("div", [
|
|
41
|
+
a("div", {
|
|
42
|
+
class: ["text-14 text-word-2", f ? "" : "mb-sm"],
|
|
43
|
+
style: "white-space: pre-line"
|
|
44
|
+
}, d ?? i("message.confirm")),
|
|
45
|
+
f ? a("p", {
|
|
46
|
+
class: "text-14 text-word-3 mt-xs mb-sm",
|
|
47
|
+
style: "white-space: pre-line"
|
|
48
|
+
}, f) : void 0,
|
|
49
|
+
m ? a(r, {
|
|
50
|
+
modelValue: x.value,
|
|
51
|
+
"onUpdate:modelValue": (e) => {
|
|
52
|
+
x.value = e;
|
|
53
|
+
},
|
|
54
|
+
type: "text",
|
|
55
|
+
name: "passphrase",
|
|
56
|
+
class: "mb-0",
|
|
57
|
+
floating: !0,
|
|
58
|
+
label: h ?? i("label.passphrase"),
|
|
59
|
+
hintLabel: g ?? i("hint.passphrase", { passphrase: m })
|
|
60
|
+
}) : void 0
|
|
61
|
+
]),
|
|
62
|
+
footer: () => a(t, () => {
|
|
63
|
+
let t = [];
|
|
64
|
+
return p || t.push(a(e, {
|
|
65
|
+
label: u ?? i("action.cancel"),
|
|
66
|
+
modifiers: "ghost",
|
|
67
|
+
onClick: () => {
|
|
68
|
+
S.value = !1;
|
|
69
|
+
}
|
|
70
|
+
})), t.push(a(e, {
|
|
71
|
+
label: l ?? i("action.proceed"),
|
|
72
|
+
modifiers: v ? "danger" : void 0,
|
|
73
|
+
disabled: m ? m !== x.value : !1,
|
|
74
|
+
onClick: () => {
|
|
75
|
+
y(!0), S.value = !1;
|
|
76
|
+
}
|
|
77
|
+
})), t;
|
|
78
|
+
})
|
|
79
|
+
}), C = c(S, (e) => {
|
|
80
|
+
e || (C(), o && b(), y(!1));
|
|
81
|
+
});
|
|
82
|
+
}) };
|
|
83
|
+
};
|
|
84
|
+
export { y as t };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=useDialogConfirm-fn7iV-iE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogConfirm-fn7iV-iE.js","names":["isOpen","ref","title","transition","modifiers","size","keepOpen","role","slots","useDialog","onUpdateModelValue","value","onAfterLeave","defineComponent","h","VvDialog","newProps","newSlots","nextTick","useDialogConfirm","$t","useI18n","passphraseText","openDialog","descriptionLabel","questionLabel","passphrase","VvInputText","passphraseLabel","passphraseHint","VvButtonGroup","toReturn","onlyConfirm","VvButton","cancelLabel","confirmLabel","danger","resolve","stopWatching","watch","open","emitReject","reject"],"sources":["../../../../packages/composable/src/useDialog.ts","../../../../packages/composable/src/useDialogConfirm.ts"],"sourcesContent":["import { VvDialog } from '@volverjs/ui-vue/components'\nimport { defineComponent, h, nextTick, ref, type VNode } from 'vue'\n\ntype DialogProps = {\n title?: string\n transition?: string\n modifiers?: string | string[]\n /** @deprecated use modifiers instead */\n size?: 'small' | 'standard' | 'fullscreen'\n role?: 'alert' | 'alertdialog'\n keepOpen?: boolean\n}\n\ntype DialogSlots = {\n footer?: () => VNode | string\n header?: () => VNode | string\n default?: () => VNode | string | VNode[] | string[]\n}\n\nconst isOpen = ref(false)\nconst title = ref<DialogProps['title']>()\nconst transition = ref<DialogProps['transition']>()\nconst modifiers = ref<DialogProps['modifiers']>()\nconst size = ref<DialogProps['size']>()\nconst keepOpen = ref<DialogProps['keepOpen']>(false)\nconst role = ref<DialogProps['role']>()\nconst slots = ref<DialogSlots>()\n\nexport const useDialog = () => {\n const onUpdateModelValue = (value: boolean) => {\n isOpen.value = value\n }\n\n const onAfterLeave = () => {\n title.value = undefined\n transition.value = undefined\n modifiers.value = undefined\n size.value = undefined\n keepOpen.value = undefined\n role.value = undefined\n slots.value = undefined\n }\n\n const PkGlobalDialog = defineComponent({\n name: 'PkGlobalDialog',\n render: () =>\n h(\n VvDialog,\n {\n modelValue: isOpen.value,\n title: title.value,\n transition: transition.value,\n modifiers: modifiers.value,\n size: size.value,\n keepOpen: keepOpen.value,\n role: role.value,\n 'onUpdate:modelValue': onUpdateModelValue,\n onAfterLeave: onAfterLeave,\n },\n slots.value,\n ),\n })\n\n const openDialog = (newProps: DialogProps, newSlots?: DialogSlots) => {\n title.value = newProps?.title\n transition.value = newProps?.transition\n modifiers.value = newProps?.modifiers\n size.value = newProps?.size\n keepOpen.value = newProps?.keepOpen ?? false\n role.value = newProps?.role\n slots.value = newSlots\n nextTick(() => {\n isOpen.value = true\n })\n return isOpen\n }\n\n return { PkGlobalDialog, openDialog, isOpen }\n}\n","import type { VNode } from 'vue'\nimport { h, ref, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport {\n VvButton,\n VvButtonGroup,\n VvInputText,\n} from '@volverjs/ui-vue/components'\nimport { useDialog } from './useDialog'\n\nexport const useDialogConfirm = () => {\n const { openDialog } = useDialog()\n const { t: $t } = useI18n({\n useScope: 'global',\n })\n\n /**\n * Ask before doing something, in three parts that a person reads in order.\n *\n * `title` is what is about to happen, short, in the dialog header.\n * `questionLabel` is the question itself. `descriptionLabel` is what it\n * costs: the consequences, secondary, under the question. Splitting them\n * is the whole point: a confirm that puts question and consequences in one\n * paragraph is read as a wall and answered without being read, which is\n * the opposite of what a confirm is for.\n *\n * `danger` draws the confirm button red, for an action that cannot be\n * undone (DESIGN.md, principle 1): the one strong button of the dialog\n * stays one, and its color says what it costs.\n *\n * Resolves `true` from the confirm button and `false` however else the\n * dialog closes (rejecting first with `emitReject`).\n */\n const openDialogConfirm = ({\n emitReject = false,\n confirmLabel,\n cancelLabel,\n questionLabel,\n descriptionLabel,\n onlyConfirm = false,\n passphrase,\n passphraseLabel,\n passphraseHint,\n title,\n danger = false,\n }: {\n emitReject?: boolean\n confirmLabel?: string\n cancelLabel?: string\n questionLabel?: string\n descriptionLabel?: string\n onlyConfirm?: boolean\n passphrase?: string\n passphraseLabel?: string\n passphraseHint?: string\n title?: string\n danger?: boolean\n } = {}) => {\n return new Promise<boolean>((resolve, reject) => {\n const passphraseText = ref<string>()\n const isOpen = openDialog(\n {\n role: 'alertdialog',\n size: 'small',\n keepOpen: true,\n title,\n },\n {\n default: () =>\n h('div', [\n h(\n 'div',\n {\n class: [\n 'text-14 text-word-2',\n descriptionLabel ? '' : 'mb-sm',\n ],\n style: 'white-space: pre-line',\n },\n questionLabel ?? $t('message.confirm'),\n ),\n descriptionLabel\n ? h(\n 'p',\n {\n class: 'text-14 text-word-3 mt-xs mb-sm',\n style: 'white-space: pre-line',\n },\n descriptionLabel,\n )\n : undefined,\n passphrase\n ? h(VvInputText, {\n modelValue: passphraseText.value,\n 'onUpdate:modelValue': (\n value: string,\n ) => {\n passphraseText.value = value\n },\n type: 'text',\n name: 'passphrase',\n class: 'mb-0',\n floating: true,\n label:\n passphraseLabel ??\n $t('label.passphrase'),\n hintLabel:\n passphraseHint ??\n $t('hint.passphrase', { passphrase }),\n })\n : undefined,\n ]),\n footer: () =>\n h(VvButtonGroup, () => {\n const toReturn: VNode[] = []\n if (!onlyConfirm) {\n toReturn.push(\n h(VvButton, {\n label:\n cancelLabel ?? $t('action.cancel'),\n modifiers: 'ghost',\n onClick: () => {\n isOpen.value = false\n },\n }),\n )\n }\n toReturn.push(\n h(VvButton, {\n label: confirmLabel ?? $t('action.proceed'),\n modifiers: danger ? 'danger' : undefined,\n disabled: passphrase\n ? passphrase !== passphraseText.value\n : false,\n onClick: () => {\n resolve(true)\n isOpen.value = false\n },\n }),\n )\n return toReturn\n }),\n },\n )\n // Closing is the answer \"no\", whatever closes it: Cancel, the\n // close button of the header, or a second Esc, which closes even\n // a `keepOpen` dialog. Without it a caller waited for ever. The\n // confirm button settles the promise first, so this cannot\n // override it.\n const stopWatching = watch(isOpen, (open) => {\n if (open) {\n return\n }\n stopWatching()\n if (emitReject) {\n reject()\n }\n resolve(false)\n })\n })\n }\n\n return { openDialogConfirm }\n}\n"],"mappings":"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"}
|
package/dist-vue/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createChatbotApiClient } from "./_chunks/createChatbotApiClient-
|
|
1
|
+
export { t as createChatbotApiClient } from "./_chunks/createChatbotApiClient-Bt387Z64.js";
|
|
@@ -39,13 +39,13 @@ type __VLS_Props = {
|
|
|
39
39
|
*/
|
|
40
40
|
followPageDialogs?: boolean | string;
|
|
41
41
|
};
|
|
42
|
-
declare var
|
|
42
|
+
declare var __VLS_81: {}, __VLS_84: {}, __VLS_102: string, __VLS_103: {};
|
|
43
43
|
type __VLS_Slots = {} & {
|
|
44
|
-
[K in NonNullable<typeof
|
|
44
|
+
[K in NonNullable<typeof __VLS_102>]?: (props: typeof __VLS_103) => any;
|
|
45
45
|
} & {
|
|
46
|
-
'header-actions'?: (props: typeof
|
|
46
|
+
'header-actions'?: (props: typeof __VLS_81) => any;
|
|
47
47
|
} & {
|
|
48
|
-
actions?: (props: typeof
|
|
48
|
+
actions?: (props: typeof __VLS_84) => any;
|
|
49
49
|
};
|
|
50
50
|
declare const __VLS_base: DefineComponent<__VLS_Props, {
|
|
51
51
|
sendMessage(text: string): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent's presence on the page while it acts (spec
|
|
3
|
+
* `page-tools-improvements.md`, M12): the element the page tools point at
|
|
4
|
+
* before acting on it, for `PkAgentPresence`. `point` resolves once the
|
|
5
|
+
* cursor clicked there, or after a short while at most; the last element
|
|
6
|
+
* stays the target between two actions, until control of the page ends.
|
|
7
|
+
* `clicks` counts the cursor's clicks, for the aurora's glints.
|
|
8
|
+
*/
|
|
9
|
+
export declare function usePagePresence(active: () => boolean): {
|
|
10
|
+
target: globalThis.ShallowRef<{
|
|
11
|
+
element: Element;
|
|
12
|
+
name: string;
|
|
13
|
+
} | undefined>;
|
|
14
|
+
clicks: globalThis.Ref<number, number>;
|
|
15
|
+
point: (element: Element, name: string) => Promise<void>;
|
|
16
|
+
arrived: (clicked: boolean) => void;
|
|
17
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { PageAccessCapability } from '../../../../packages/models/src';
|
|
2
2
|
import { RegisteredHostTool } from '../../../../packages/composable/src';
|
|
3
|
-
import { PageToolsTranslate } from '../pageTools';
|
|
3
|
+
import { PagePresence, PageToolsTranslate } from '../pageTools';
|
|
4
4
|
/**
|
|
5
5
|
* The page tools of the widget, for the agent's effective page access (spec
|
|
6
6
|
* `page-tools.md`). The fixed tools are rebuilt only when the capability
|
|
7
7
|
* changes, never on a change of language: a new registry starts new refs, and
|
|
8
8
|
* the model would lose the ones its last snapshot gave it. The annotated
|
|
9
|
-
* forms are read from the page each time they are asked for.
|
|
9
|
+
* forms are read from the page each time they are asked for. `presence`
|
|
10
|
+
* shows where the agent acts.
|
|
10
11
|
*/
|
|
11
|
-
export declare function usePageTools(capability: () => PageAccessCapability | undefined, t: PageToolsTranslate): {
|
|
12
|
+
export declare function usePageTools(capability: () => PageAccessCapability | undefined, t: PageToolsTranslate, presence?: PagePresence): {
|
|
12
13
|
registry: globalThis.ShallowRef<RegisteredHostTool[]>;
|
|
13
14
|
forms: () => RegisteredHostTool[];
|
|
14
15
|
registerPages: (declared: unknown) => void;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { PageAccessCapability } from '../../../../packages/models/src';
|
|
2
2
|
import { RegisteredHostTool } from '../../../../packages/composable/src';
|
|
3
|
+
/**
|
|
4
|
+
* Shows the user where the agent acts (spec `page-tools-improvements.md`,
|
|
5
|
+
* M12): the widget's cursor goes to the element before the action runs.
|
|
6
|
+
*/
|
|
7
|
+
export type PagePresence = {
|
|
8
|
+
/** Points at the element, named as the snapshot names it; resolves once the user can see it there. */
|
|
9
|
+
point: (element: Element, name: string) => Promise<void>;
|
|
10
|
+
};
|
|
3
11
|
/**
|
|
4
12
|
* A page of the site the app declares to the widget (`registerPages`, spec
|
|
5
13
|
* `page-tools-improvements.md`, M6): `<id>` or `:id` in its path stands for
|
|
@@ -16,8 +24,10 @@ export type PageToolsTranslate = (key: string, params?: Record<string, unknown>)
|
|
|
16
24
|
* of the agent. Empty when an excluded selector does not parse: an exclusion
|
|
17
25
|
* that does not apply must turn access off, not exclude less.
|
|
18
26
|
*/
|
|
19
|
-
export declare function createPageTools(capability: PageAccessCapability, { t, pages, }: {
|
|
27
|
+
export declare function createPageTools(capability: PageAccessCapability, { t, pages, presence, }: {
|
|
20
28
|
t: PageToolsTranslate;
|
|
21
29
|
/** The pages the app declared, read at each call. */
|
|
22
30
|
pages?: () => readonly DeclaredPage[];
|
|
31
|
+
/** Where the agent acts, shown before each action. */
|
|
32
|
+
presence?: PagePresence;
|
|
23
33
|
}): RegisteredHostTool[];
|