@8wave/ai-elements 0.121.0-beta.56 → 0.121.0-beta.58

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.
@@ -39,13 +39,13 @@ type __VLS_Props = {
39
39
  */
40
40
  followPageDialogs?: boolean | string;
41
41
  };
42
- declare var __VLS_74: {}, __VLS_77: {}, __VLS_95: string, __VLS_96: {};
42
+ declare var __VLS_81: {}, __VLS_84: {}, __VLS_102: string, __VLS_103: {};
43
43
  type __VLS_Slots = {} & {
44
- [K in NonNullable<typeof __VLS_95>]?: (props: typeof __VLS_96) => any;
44
+ [K in NonNullable<typeof __VLS_102>]?: (props: typeof __VLS_103) => any;
45
45
  } & {
46
- 'header-actions'?: (props: typeof __VLS_74) => any;
46
+ 'header-actions'?: (props: typeof __VLS_81) => any;
47
47
  } & {
48
- actions?: (props: typeof __VLS_77) => any;
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[];