@genesislcap/ai-assistant 15.77.0 → 15.78.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.
Files changed (87) hide show
  1. package/dist/ai-assistant.api.json +796 -7
  2. package/dist/ai-assistant.d.ts +305 -12
  3. package/dist/chat-driver.cjs +28 -1
  4. package/dist/chat-driver.cjs.map +2 -2
  5. package/dist/chat-driver.mjs +28 -1
  6. package/dist/chat-driver.mjs.map +2 -2
  7. package/dist/custom-elements.json +1230 -468
  8. package/dist/dts/autopilot/autopilot-driver.d.ts +28 -0
  9. package/dist/dts/autopilot/autopilot-driver.d.ts.map +1 -1
  10. package/dist/dts/channel/ai-activity-channel.d.ts +20 -2
  11. package/dist/dts/channel/ai-activity-channel.d.ts.map +1 -1
  12. package/dist/dts/components/chat-bubble/chat-bubble.d.ts +2 -0
  13. package/dist/dts/components/chat-bubble/chat-bubble.d.ts.map +1 -1
  14. package/dist/dts/components/chat-driver/interaction-controller.d.ts.map +1 -1
  15. package/dist/dts/components/notification-level/index.d.ts +2 -0
  16. package/dist/dts/components/notification-level/index.d.ts.map +1 -0
  17. package/dist/dts/components/notification-level/notification-level.d.ts +51 -0
  18. package/dist/dts/components/notification-level/notification-level.d.ts.map +1 -0
  19. package/dist/dts/components/notification-level/notification-level.styles.d.ts +3 -0
  20. package/dist/dts/components/notification-level/notification-level.styles.d.ts.map +1 -0
  21. package/dist/dts/components/notification-level/notification-level.template.d.ts +5 -0
  22. package/dist/dts/components/notification-level/notification-level.template.d.ts.map +1 -0
  23. package/dist/dts/components/settings-modal/settings-modal.styles.d.ts.map +1 -1
  24. package/dist/dts/components/settings-modal/settings-modal.template.d.ts.map +1 -1
  25. package/dist/dts/config/config.d.ts +2 -2
  26. package/dist/dts/config/define-stateful-agent.d.ts +1 -1
  27. package/dist/dts/index.d.ts +2 -0
  28. package/dist/dts/index.d.ts.map +1 -1
  29. package/dist/dts/main/main.d.ts +79 -6
  30. package/dist/dts/main/main.d.ts.map +1 -1
  31. package/dist/dts/notifications/agent-notifications.d.ts +139 -0
  32. package/dist/dts/notifications/agent-notifications.d.ts.map +1 -0
  33. package/dist/dts/notifications/agent-notifier.d.ts +58 -0
  34. package/dist/dts/notifications/agent-notifier.d.ts.map +1 -0
  35. package/dist/dts/notifications/index.d.ts +2 -0
  36. package/dist/dts/notifications/index.d.ts.map +1 -0
  37. package/dist/dts/notifications/notification-level-picker.template.d.ts +31 -0
  38. package/dist/dts/notifications/notification-level-picker.template.d.ts.map +1 -0
  39. package/dist/dts/notifications/notification-settings.d.ts +42 -0
  40. package/dist/dts/notifications/notification-settings.d.ts.map +1 -0
  41. package/dist/dts/react.d.ts +10 -0
  42. package/dist/dts/state/ai-assistant-slice.d.ts +12 -5
  43. package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
  44. package/dist/dts/state/interaction-context.d.ts +13 -0
  45. package/dist/dts/state/interaction-context.d.ts.map +1 -1
  46. package/dist/dts/state/persistence/session-persistence-provider.d.ts +5 -0
  47. package/dist/dts/state/persistence/session-persistence-provider.d.ts.map +1 -1
  48. package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
  49. package/dist/dts/state/persistence/session-snapshot.d.ts +19 -6
  50. package/dist/dts/state/persistence/session-snapshot.d.ts.map +1 -1
  51. package/dist/dts/state/session-store.d.ts +1 -0
  52. package/dist/dts/state/session-store.d.ts.map +1 -1
  53. package/dist/dts/types/interaction-context.d.ts +23 -0
  54. package/dist/dts/types/interaction-context.d.ts.map +1 -1
  55. package/dist/dts/utils/attachment-note.d.ts +18 -0
  56. package/dist/dts/utils/attachment-note.d.ts.map +1 -0
  57. package/dist/dts/utils/resolve-preference-baseline.d.ts +3 -0
  58. package/dist/dts/utils/resolve-preference-baseline.d.ts.map +1 -1
  59. package/dist/esm/autopilot/autopilot-driver.js +66 -3
  60. package/dist/esm/components/chat-bubble/chat-bubble.js +17 -3
  61. package/dist/esm/components/chat-driver/interaction-controller.js +5 -0
  62. package/dist/esm/components/notification-level/index.js +1 -0
  63. package/dist/esm/components/notification-level/notification-level.js +124 -0
  64. package/dist/esm/components/notification-level/notification-level.styles.js +20 -0
  65. package/dist/esm/components/notification-level/notification-level.template.js +11 -0
  66. package/dist/esm/components/settings-modal/settings-modal.styles.js +6 -0
  67. package/dist/esm/components/settings-modal/settings-modal.template.js +10 -1
  68. package/dist/esm/index.js +2 -0
  69. package/dist/esm/main/main.js +217 -27
  70. package/dist/esm/main/main.template.js +2 -2
  71. package/dist/esm/notifications/agent-notifications.js +172 -0
  72. package/dist/esm/notifications/agent-notifier.js +86 -0
  73. package/dist/esm/notifications/index.js +1 -0
  74. package/dist/esm/notifications/notification-level-picker.template.js +49 -0
  75. package/dist/esm/notifications/notification-settings.js +42 -0
  76. package/dist/esm/state/ai-assistant-slice.js +5 -0
  77. package/dist/esm/state/interaction-context.js +27 -0
  78. package/dist/esm/state/persistence/session-persister.js +24 -21
  79. package/dist/esm/state/persistence/session-snapshot.js +20 -7
  80. package/dist/esm/utils/attachment-note.js +19 -0
  81. package/dist/esm/utils/resolve-preference-baseline.js +9 -0
  82. package/dist/react.cjs +7 -0
  83. package/dist/react.mjs +6 -0
  84. package/docs/notifications.md +169 -0
  85. package/docs/styling.md +1 -1
  86. package/package.json +17 -17
  87. package/sandbox/fixtures.ts +3 -3
@@ -0,0 +1,139 @@
1
+ import type { ChatNotificationsConfig } from '@genesislcap/foundation-ai';
2
+ /**
3
+ * How often the person wants a browser notification when the assistant needs them (GENC-1676).
4
+ * Each level includes the one before it.
5
+ *
6
+ * - `'off'` — never. The default, always: the browser makes the person grant permission, so
7
+ * nothing can switch it on for them.
8
+ * - `'autopilot'` — only when the autopilot hands back to the person or stops working. Offered
9
+ * only when the app sets `chatConfig.ui.notifications.autopilot`.
10
+ * - `'needs-input'` — every `'autopilot'` case, plus any widget that asks for the person's
11
+ * attention (`InteractionContext.requestAttention`).
12
+ *
13
+ * @beta
14
+ */
15
+ export type AgentNotificationLevel = 'off' | 'autopilot' | 'needs-input';
16
+ /**
17
+ * Whether this page may show notifications: the browser's own `NotificationPermission`, or
18
+ * `'unsupported'` where there is no Notification API (an old browser, an insecure context, Node).
19
+ *
20
+ * @beta
21
+ */
22
+ export type AgentNotificationPermission = NotificationPermission | 'unsupported';
23
+ /**
24
+ * What an agent notification is about.
25
+ *
26
+ * - `'widget-needs-input'` — a widget asked for the person's attention.
27
+ * - `'autopilot-handed-back'` — the autopilot handed something to the person.
28
+ * - `'autopilot-stopped'` — the autopilot stopped working: the flow ended, the turn ended with
29
+ * nothing left for it to answer, or it hit a wall such as the budget.
30
+ *
31
+ * @beta
32
+ */
33
+ export type AgentAttentionKind = 'widget-needs-input' | 'autopilot-handed-back' | 'autopilot-stopped';
34
+ /**
35
+ * The detail of the `agent-attention` activity-bus event: something in a session needs the person.
36
+ * Published whatever the person's level is; the assistant for that session decides whether to
37
+ * notify.
38
+ *
39
+ * @beta
40
+ */
41
+ export interface AgentAttentionDetail {
42
+ /** The session it happened in. A sub-agent's session is `<parent>::sub:<id>`. */
43
+ readonly sessionKey: string;
44
+ readonly kind: AgentAttentionKind;
45
+ /** The interaction it is about, when there is one. */
46
+ readonly interactionId?: string;
47
+ /** Text that replaces the default message for this one notification. */
48
+ readonly message?: string;
49
+ }
50
+ /**
51
+ * The notification's text when neither the app nor the widget gives one.
52
+ *
53
+ * @beta
54
+ */
55
+ export declare const DEFAULT_AGENT_NOTIFICATION_MESSAGE = "The assistant is ready for your next input";
56
+ /**
57
+ * Narrow an untrusted value (a stored preference, a plain-JS app) to a level, or `undefined`.
58
+ * `hasOwnProperty`, not `in`, so `'constructor'` and friends are rejected.
59
+ *
60
+ * @internal
61
+ */
62
+ export declare const asAgentNotificationLevel: (value: unknown) => AgentNotificationLevel | undefined;
63
+ /**
64
+ * Whether the app offers notifications at all (`chatConfig.ui.notifications.enabled`).
65
+ *
66
+ * @internal
67
+ */
68
+ export declare const notificationsOffered: (config: ChatNotificationsConfig | undefined) => boolean;
69
+ /**
70
+ * Whether `level` is one the app offers: anything when notifications are offered, except
71
+ * `'autopilot'` without the `autopilot` option.
72
+ *
73
+ * @internal
74
+ */
75
+ export declare const levelOffered: (level: AgentNotificationLevel, config: ChatNotificationsConfig | undefined) => boolean;
76
+ /**
77
+ * The level that applies, given the stored one and what the app offers. A stored level the app
78
+ * no longer offers counts as `'off'`; the stored value itself is left alone, so offering it again
79
+ * restores the person's choice.
80
+ *
81
+ * @internal
82
+ */
83
+ export declare const effectiveNotificationLevel: (stored: AgentNotificationLevel, config: ChatNotificationsConfig | undefined) => AgentNotificationLevel;
84
+ /**
85
+ * Whether a level notifies for a kind of event.
86
+ *
87
+ * @internal
88
+ */
89
+ export declare const levelAllows: (level: AgentNotificationLevel, kind: AgentAttentionKind) => boolean;
90
+ /**
91
+ * Whether an event's session is `sessionKey` or one of its sub-agents' sessions.
92
+ *
93
+ * @internal
94
+ */
95
+ export declare const belongsToSession: (eventSessionKey: string, sessionKey: string) => boolean;
96
+ /**
97
+ * Whether this page may show notifications. Safe to call anywhere, including Node.
98
+ *
99
+ * @beta
100
+ */
101
+ export declare function agentNotificationPermission(): AgentNotificationPermission;
102
+ /**
103
+ * Ask the person for permission to show notifications, and resolve to the result. Call it from a
104
+ * click or key handler: browsers ignore or refuse a request that does not come from the person.
105
+ * Resolves straight away when permission is already decided or unsupported, since a browser only
106
+ * ever asks once.
107
+ *
108
+ * @beta
109
+ */
110
+ export declare function requestAgentNotificationPermission(): Promise<AgentNotificationPermission>;
111
+ /**
112
+ * Follow this page's notification permission (GENC-1676): `listener` runs whenever it changes —
113
+ * answered here, or changed by the person in the browser's own site settings while the page is
114
+ * open. Returns an unsubscribe. Safe where there is no Permissions API: only answers given here
115
+ * are seen then.
116
+ *
117
+ * @internal
118
+ */
119
+ export declare function watchAgentNotificationPermission(listener: (permission: AgentNotificationPermission) => void): () => void;
120
+ /**
121
+ * The hint under a notification level picker when the browser will not show notifications. A
122
+ * block shows even at Off: otherwise picking a level would snap back with no reason given, since
123
+ * a browser that has blocked them never asks again.
124
+ *
125
+ * @internal
126
+ */
127
+ export declare function notificationPermissionHint(level: AgentNotificationLevel, permission: AgentNotificationPermission): string;
128
+ /**
129
+ * A person picked a level in a notification picker (GENC-1676). Turning notifications on asks the
130
+ * browser for permission first, and leaves the level alone if they refuse. Call it straight from
131
+ * the click: the request is made before anything is awaited, which the browser requires.
132
+ *
133
+ * Resolves to what happened: `'applied'`; `'refused'`, so the picker can snap back to the level
134
+ * that still applies; or `'same'`, for a picker re-reporting the level it already shows.
135
+ *
136
+ * @internal
137
+ */
138
+ export declare function chooseAgentNotificationLevel(level: AgentNotificationLevel, current: AgentNotificationLevel, apply: (level: AgentNotificationLevel) => void): Promise<'applied' | 'refused' | 'same'>;
139
+ //# sourceMappingURL=agent-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notifications.d.ts","sourceRoot":"","sources":["../../../src/notifications/agent-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,WAAW,GAAG,aAAa,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,sBAAsB,GAAG,aAAa,CAAC;AAEjF;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAC1B,oBAAoB,GACpB,uBAAuB,GACvB,mBAAmB,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,sDAAsD;IACtD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,wEAAwE;IACxE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,kCA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C"}
@@ -0,0 +1,58 @@
1
+ import { type AgentAttentionDetail, type AgentNotificationLevel, type AgentNotificationPermission } from './agent-notifications';
2
+ /**
3
+ * What the notifier touches outside itself, so tests can swap it for fakes.
4
+ *
5
+ * @internal
6
+ */
7
+ export interface AgentNotifierEnv {
8
+ permission(): AgentNotificationPermission;
9
+ /** Whether the person is looking at this page: visible and focused. */
10
+ tabActive(): boolean;
11
+ show(title: string, options: NotificationOptions, onClick: () => void): void;
12
+ now(): number;
13
+ }
14
+ /**
15
+ * What the assistant knows that the event does not.
16
+ *
17
+ * @internal
18
+ */
19
+ export interface AgentNotifyContext {
20
+ /** The level that applies: the person's choice, narrowed to what the app offers. */
21
+ readonly level: AgentNotificationLevel;
22
+ /** The notification's title: the assistant's header title. */
23
+ readonly title: string;
24
+ /** The app's message, from `chatConfig.ui.notifications.message`. */
25
+ readonly message?: string;
26
+ /** What clicking the notification does, after focusing the window. */
27
+ readonly onClick: () => void;
28
+ }
29
+ /**
30
+ * The tag a notification carries. The browser replaces a notification that has the same tag, so
31
+ * windows that share a session never stack copies. Interaction ids are unique, so one interaction
32
+ * gets one notification whichever session reported it (a sub-agent's or its parent's); everything
33
+ * else the autopilot reports shares one per session.
34
+ *
35
+ * @internal
36
+ */
37
+ export declare const agentNotificationTag: (detail: AgentAttentionDetail) => string;
38
+ /**
39
+ * Decides whether an `agent-attention` event becomes a browser notification, and shows it
40
+ * (GENC-1676). One per page, shared by every assistant on it.
41
+ *
42
+ * Shows nothing when the level does not cover the event, when permission is not granted, while
43
+ * the person is looking at the page (the in-page UI covers that), or when the same tag was just
44
+ * shown — unless the repeat brings a widget's own message the first lacked. That one replaces the
45
+ * notification under the same tag, silently: the autopilot reports a widget it declines before
46
+ * the widget's own request is reported, and the widget's words are the better ones.
47
+ *
48
+ * @internal
49
+ */
50
+ export declare class AgentNotifier {
51
+ private readonly env;
52
+ /** Each tag shown within the repeat window: when, and whether it carried a widget's message. */
53
+ private readonly shown;
54
+ constructor(env?: AgentNotifierEnv);
55
+ /** Show a notification for `detail` if it should be shown. Returns whether it was. */
56
+ notify(detail: AgentAttentionDetail, context: AgentNotifyContext): boolean;
57
+ }
58
+ //# sourceMappingURL=agent-notifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notifier.d.ts","sourceRoot":"","sources":["../../../src/notifications/agent-notifier.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EACjC,MAAM,uBAAuB,CAAC;AAU/B;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,IAAI,2BAA2B,CAAC;IAC1C,uEAAuE;IACvE,SAAS,IAAI,OAAO,CAAC;IACrB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC7E,GAAG,IAAI,MAAM,CAAC;CACf;AAmBD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,oBAAoB,KAAG,MAGjB,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;IAIZ,OAAO,CAAC,QAAQ,CAAC,GAAG;IAHhC,gGAAgG;IAChG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuD;gBAEhD,GAAG,GAAE,gBAA6B;IAE/D,sFAAsF;IACtF,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO;CAgC3E"}
@@ -0,0 +1,2 @@
1
+ export { agentNotificationPermission, DEFAULT_AGENT_NOTIFICATION_MESSAGE, requestAgentNotificationPermission, type AgentAttentionDetail, type AgentAttentionKind, type AgentNotificationLevel, type AgentNotificationPermission, } from './agent-notifications';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,GACjC,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type ViewTemplate } from '@genesislcap/web-core';
2
+ import { type AgentNotificationLevel } from './agent-notifications';
3
+ /**
4
+ * What a notification level picker reads and calls (GENC-1676): the assistant, in its own
5
+ * settings, and `foundation-ai-notification-level` anywhere else.
6
+ *
7
+ * @internal
8
+ */
9
+ export interface NotificationLevelPickerSource {
10
+ /** The level that applies: what the picker shows. */
11
+ readonly effectiveNotificationLevel: AgentNotificationLevel;
12
+ /** Whether to offer the `'autopilot'` level. */
13
+ readonly notificationAutopilotOffered: boolean;
14
+ /**
15
+ * Bumped to make the picker re-read its value when a choice did not take (permission refused),
16
+ * since the level, and so its binding, did not change.
17
+ */
18
+ readonly notificationPickerRevision: number;
19
+ /** The person picked a level. Called straight from their click, for the permission request. */
20
+ chooseNotificationLevel(level: AgentNotificationLevel): Promise<void>;
21
+ }
22
+ /**
23
+ * Picker for the agent notification level (GENC-1676): the design system's segmented control, as
24
+ * the timestamps picker uses, with the same guard against the items' own `change` echoes — only
25
+ * the group's own `change` is a choice. The value binding also reads `notificationPickerRevision`,
26
+ * so a refused choice snaps back to the level that still applies.
27
+ *
28
+ * @internal
29
+ */
30
+ export declare const notificationLevelPickerTemplate: <T extends NotificationLevelPickerSource>(segmentedControlTag: string, segmentedItemTag: string) => ViewTemplate<T>;
31
+ //# sourceMappingURL=notification-level-picker.template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-level-picker.template.d.ts","sourceRoot":"","sources":["../../../src/notifications/notification-level-picker.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAA4B,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE9F;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC5C,qDAAqD;IACrD,QAAQ,CAAC,0BAA0B,EAAE,sBAAsB,CAAC;IAC5D,gDAAgD;IAChD,QAAQ,CAAC,4BAA4B,EAAE,OAAO,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,+FAA+F;IAC/F,uBAAuB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAwBD;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAAI,CAAC,SAAS,6BAA6B,EACrF,qBAAqB,MAAM,EAC3B,kBAAkB,MAAM,KACvB,YAAY,CAAC,CAAC,CAyBhB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { AgentNotificationLevel } from './agent-notifications';
2
+ /**
3
+ * What an assistant lends a notification level picker outside its own settings (GENC-1676): the
4
+ * level for its session and what the app offers, and a way to set it that goes through the
5
+ * assistant's own rules and saving.
6
+ *
7
+ * @internal
8
+ */
9
+ export interface NotificationSettingsHost {
10
+ /** The session the assistant holds now. Read on every lookup: a session switch moves it. */
11
+ sessionKey(): string | undefined;
12
+ /** The level that applies: the person's choice, narrowed to what the app offers. */
13
+ effectiveLevel(): AgentNotificationLevel;
14
+ /** Whether the app offers notifications at all. */
15
+ offered(): boolean;
16
+ /** Whether the app offers the `'autopilot'` level. */
17
+ autopilotOffered(): boolean;
18
+ /** Set the level, as the assistant's `notificationLevel` setter does. */
19
+ setLevel(level: AgentNotificationLevel): void;
20
+ }
21
+ /**
22
+ * Make an assistant's notification settings reachable by session. Returns the undo, for its
23
+ * disconnect.
24
+ *
25
+ * @internal
26
+ */
27
+ export declare function addNotificationSettingsHost(host: NotificationSettingsHost): () => void;
28
+ /**
29
+ * The notification settings for a session, from the assistant that holds it; `undefined` while no
30
+ * connected assistant does. The latest to connect wins: its views share one store anyway.
31
+ *
32
+ * @internal
33
+ */
34
+ export declare function notificationSettingsFor(sessionKey: string | undefined): NotificationSettingsHost | undefined;
35
+ /**
36
+ * Tell pickers that a session's notification settings may have changed: the level, what the app
37
+ * offers, or which assistant holds the session.
38
+ *
39
+ * @internal
40
+ */
41
+ export declare function announceNotificationSettings(sessionKey: string | undefined): void;
42
+ //# sourceMappingURL=notification-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-settings.d.ts","sourceRoot":"","sources":["../../../src/notifications/notification-settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC,4FAA4F;IAC5F,UAAU,IAAI,MAAM,GAAG,SAAS,CAAC;IACjC,oFAAoF;IACpF,cAAc,IAAI,sBAAsB,CAAC;IACzC,mDAAmD;IACnD,OAAO,IAAI,OAAO,CAAC;IACnB,sDAAsD;IACtD,gBAAgB,IAAI,OAAO,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC/C;AAKD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,IAAI,CAOtF;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,wBAAwB,GAAG,SAAS,CAKtC;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAEjF"}
@@ -13,6 +13,7 @@ import type { AiChatMarkdown as AiChatMarkdownWC } from './components/chat-markd
13
13
  import type { AiFlowingWavesIndicator as AiFlowingWavesIndicatorWC } from './components/flowing-waves-indicator';
14
14
  import type { AiHaloOverlay as AiHaloOverlayWC } from './components/halo-overlay';
15
15
  import type { MessageFeedback as MessageFeedbackWC } from './components/message-feedback/message-feedback';
16
+ import type { AiNotificationLevel as AiNotificationLevelWC } from './components/notification-level/notification-level';
16
17
  import type { AiPlasmaOrbIndicator as AiPlasmaOrbIndicatorWC } from './components/plasma-orb-indicator';
17
18
  import type { FoundationAiPopoutManager as FoundationAiPopoutManagerWC } from './components/popout-manager/popout-manager';
18
19
  import type { AiWavesIndicator as AiWavesIndicatorWC } from './components/waves-indicator';
@@ -174,6 +175,15 @@ export declare const MessageFeedback: React.ForwardRefExoticComponent<
174
175
  >;
175
176
  export type MessageFeedbackRef = MessageFeedbackWC;
176
177
 
178
+ export declare const AiNotificationLevel: React.ForwardRefExoticComponent<
179
+ React.PropsWithChildren<
180
+ Omit<PublicOf<AiNotificationLevelWC>, 'children' | 'style'> &
181
+ HTMLWCProps & {
182
+ }
183
+ > & React.RefAttributes<AiNotificationLevelWC>
184
+ >;
185
+ export type AiNotificationLevelRef = AiNotificationLevelWC;
186
+
177
187
  export declare const FoundationAiPopoutManager: React.ForwardRefExoticComponent<
178
188
  React.PropsWithChildren<
179
189
  Omit<PublicOf<FoundationAiPopoutManagerWC>, 'children' | 'style'> &
@@ -2,6 +2,7 @@ import type { AggregateUsage, AIProviderRegistryStatusEntry, AIProviderType, Cha
2
2
  import type { PayloadAction } from '@genesislcap/foundation-redux';
3
3
  import type { AgentConfig } from '../config/config';
4
4
  import type { AiAssistantAnimation, AiAssistantState, SuggestionsState } from '../main/main.types';
5
+ import type { AgentNotificationLevel } from '../notifications/agent-notifications';
5
6
  /**
6
7
  * A single in-flight per-call chat-input override pushed by a `requestSubAgent`
7
8
  * or `requestInteraction` call. Tracked as an array (not a counter) so the
@@ -94,6 +95,12 @@ export interface AiAssistantSessionState {
94
95
  * drifted the transcript would render one mode and then flick to the other on load.
95
96
  */
96
97
  timestampDisplay: TimestampDisplay;
98
+ /**
99
+ * The person's agent notification level (GENC-1676), as chosen. Always starts `'off'`: no
100
+ * config can switch it on. What applies is narrowed by `chatConfig.ui.notifications`, but the
101
+ * choice itself is kept, so offering a level again restores it.
102
+ */
103
+ notificationLevel: AgentNotificationLevel;
97
104
  enabledAnimations: AiAssistantAnimation[];
98
105
  suggestionsState: SuggestionsState;
99
106
  contextTokens: number | undefined;
@@ -144,11 +151,10 @@ export interface AiAssistantSessionState {
144
151
  flowOwnerAgentName: string | null;
145
152
  /**
146
153
  * The user prompt that started the current guided flow (GENC-1351 §5.9) —
147
- * captured when a flow-owner locks in, cleared when it releases. Persisted only
148
- * into a *non-resumable tombstone* (not the normal snapshot), where it pre-fills
149
- * the composer on return so the user can re-run the task. Slice-backed (like
150
- * {@link flowOwnerAgentName}) so both element instances agree and it survives
151
- * pop-in/out.
154
+ * captured when a flow-owner locks in, cleared when it releases. A non-resumable
155
+ * tombstone hands back the user's last message instead, and falls back to this only
156
+ * when the transcript has none. Slice-backed (like {@link flowOwnerAgentName}) so
157
+ * both element instances agree and it survives pop-in/out.
152
158
  */
153
159
  flowActivationPrompt: string | null;
154
160
  /**
@@ -305,6 +311,7 @@ export declare const aiAssistantSlice: import("@reduxjs/toolkit").Slice<AiAssist
305
311
  setShowNarration(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<boolean>): void;
306
312
  setShowAgentSwitchIndicator(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<boolean>): void;
307
313
  setTimestampDisplay(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<TimestampDisplay>): void;
314
+ setNotificationLevel(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<AgentNotificationLevel>): void;
308
315
  setEnabledAnimations(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<AiAssistantAnimation[]>): void;
309
316
  setSuggestionsState(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<SuggestionsState>): void;
310
317
  setContextTokens(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<number | undefined>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-assistant-slice.d.ts","sourceRoot":"","sources":["../../../src/state/ai-assistant-slice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,6BAA6B,EAC7B,cAAc,EACd,4BAA4B,EAC5B,WAAW,EACX,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAInG;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,IAAI,EAAE,4BAA4B,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,YAA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OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IAoB3F;;;;;;;;OAQG;4FAC6B,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC;IAG5D;;;;;;;;;OASG;4FAGO,aAAa,CAAC;QACpB,MAAM,EAAE,cAAc,CAAC;QACvB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB;;;;;;WAMG;QACH,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC;IA2BJ;;;;;;;;;;;;OAYG;2FAGO,aAAa,CAAC;QAAE,MAAM,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;KAAE,CAAC;yFA0B3D,aAAa,CAAC,MAAM,CAAC;gGAGd,aAAa,CAAC,WAAW,EAAE,CAAC;+FAG7B,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC;4FAG/B,aAAa,CAAC,aAAa,CAAC;+FAGzB,aAAa,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAGhE;;;;;OAKG;uFACwB,aAAa,CAAC,kBAAkB,CAAC;IAkB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;;oCAkCL,CAAC"}
@@ -23,6 +23,12 @@ export interface InteractionContextHandle {
23
23
  setHeldBy(holder: InteractionHolder): boolean;
24
24
  /** Install the controller the platform built from the widget's registration (GENC-1660). */
25
25
  setController(controller: unknown): void;
26
+ /**
27
+ * Say who holds the interaction is decided: every interceptor has been offered it (GENC-1676).
28
+ * Until then `requestAttention` only records the wish, because the controller is built, and may
29
+ * ask, before a claimant can claim. Host-only. Idempotent.
30
+ */
31
+ markOffered(): void;
26
32
  /**
27
33
  * The surface with the platform's half — `prepare`, which checks and readies an action without
28
34
  * running it. Host-only: a claimant runs actions through its `InteractionHold`, never directly.
@@ -31,6 +37,8 @@ export interface InteractionContextHandle {
31
37
  }
32
38
  /** What the driver lends a context so it can settle itself. */
33
39
  export interface InteractionContextDeps {
40
+ /** The session the interaction belongs to (GENC-1676). Empty when absent. */
41
+ readonly sessionKey?: string;
34
42
  /**
35
43
  * Settle the interaction, through the same path as a widget's `interaction-completed` (GENC-1660).
36
44
  * Absent where nothing can settle it (a context built on its own in a test).
@@ -40,6 +48,11 @@ export interface InteractionContextDeps {
40
48
  readonly checkpoint?: unknown;
41
49
  /** Persist a checkpoint. Absent where nothing persists it (a context built on its own in a test). */
42
50
  saveCheckpoint?(checkpoint: unknown): void;
51
+ /**
52
+ * Tell the person this interaction needs them (GENC-1676). Absent where nothing can (a context
53
+ * built on its own in a test).
54
+ */
55
+ requestAttention?(message?: string): void;
43
56
  }
44
57
  /**
45
58
  * Create a live, per-interaction context (GENC-1390). Framework-agnostic: the
@@ -1 +1 @@
1
- {"version":3,"file":"interaction-context.d.ts","sourceRoot":"","sources":["../../../src/state/interaction-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAE1F,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAElG;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAC9C,4FAA4F;IAC5F,aAAa,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;CAC/C;AAED,+DAA+D;AAC/D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,OAAO,CAAC,CAAC,MAAM,EA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IACH,gBAAgB,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE,sBAA2B,GAChC,wBAAwB,CAuL1B"}
@@ -107,6 +107,11 @@ export interface SessionPreferences {
107
107
  * Absent keeps the `chatConfig.ui.showTimestamps` default, which is `'always'`.
108
108
  */
109
109
  timestampDisplay?: string;
110
+ /**
111
+ * The agent notification level (`AgentNotificationLevel` values, as plain strings). Absent
112
+ * means `'off'`: unlike the other preferences, no config default can switch it on.
113
+ */
114
+ notificationLevel?: string;
110
115
  /** Enabled loading-animation ids (`AiAssistantAnimation` values, as plain strings). */
111
116
  animations?: string[];
112
117
  }
@@ -1 +1 @@
1
- {"version":3,"file":"session-persistence-provider.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-persistence-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;OAUG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC3D,yEAAyE;IACzE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,mDAAmD;IACnD,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;;;;;;;;OASG;IACH,eAAe,CAAC,CAAC,UAAU,EAAE,MAAM,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IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,0BAA0B,CAAC;CACvC;AAID;;;;;;;;;;;GAWG;AACH,qBAAa,yBAA0B,YAAW,0BAA0B;IAC1E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;gBAEpB,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAO;IAM3F,OAAO,CAAC,UAAU;IAIlB,mFAAmF;IACnF,OAAO,CAAC,cAAc;IAIhB,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAY1D,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAenE,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAW5E,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI1F"}
1
+ {"version":3,"file":"session-persistence-provider.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-persistence-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACz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M,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAW5E,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-persister.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-persister.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAYrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AA6DnG;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,cAAc,EAAE,MAAM,wBAAwB,CAAC;IAC/C,+EAA+E;IAC/E,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,oEAAoE;IACpE,SAAS,EAAE,MAAM,QAAQ,GAAG,SAAS,CAAC;IACtC,mEAAmE;IACnE,QAAQ,EAAE,MAAM,kBAAkB,GAAG,SAAS,CAAC;IAC/C;;;;OAIG;IACH,oBAAoB,EAAE,MAAM,eAAe,EAAE,CAAC;IAC9C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE;QAC7B,oEAAoE;QACpE,eAAe,EAAE,MAAM,CAAC;QACxB,mEAAmE;QACnE,WAAW,CAAC,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;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IAqBzB;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;;;;;;;;OASG;YACW,gBAAgB;IAsB9B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,yBAAyB;IAiBjC;;;;OAIG;YACW,cAAc;IAmO5B;;;;;;;;;;OAUG;IACG,OAAO,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAkNpD;;;;;OAKG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAkBpC;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IAU/B;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBvC;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAatC;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAchD;;;;;;OAMG;IACH,mBAAmB,IAAI,IAAI;IAiB3B;;;;;;OAMG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,uBAAuB;IA6C/B,sEAAsE;IACtE,OAAO,IAAI,IAAI;CAMhB"}
1
+ {"version":3,"file":"session-persister.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-persister.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAarE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AA+DnG;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,2FA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CAAC,IAAI,CAAC;IAatC;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAchD;;;;;;OAMG;IACH,mBAAmB,IAAI,IAAI;IAiB3B;;;;;;OAMG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,uBAAuB;IA6C/B,sEAAsE;IACtE,OAAO,IAAI,IAAI;CAMhB"}
@@ -95,7 +95,12 @@ export interface PersistedSession {
95
95
  interrupted?: {
96
96
  /** Shown as an assistant message on return. */
97
97
  message: string;
98
- /** The prompt that started the flow, pre-filled into the composer on return. */
98
+ /**
99
+ * The user's last message before the save, as the transcript holds it, or the prompt
100
+ * captured when the flow took the lock if the transcript has no user message. Pre-filled
101
+ * into the composer on return without the line naming any files: the files stay on the
102
+ * transcript message and are not put back in the composer.
103
+ */
99
104
  prompt?: string;
100
105
  };
101
106
  }
@@ -135,9 +140,9 @@ export declare function createPersistedSession(input: PersistedSessionInput): Pe
135
140
  * unit-testable independent of the save path:
136
141
  * - `resumeMessage`: the agent's `notResumableMessage` when non-blank, else the
137
142
  * passed default.
138
- * - `resumePrompt`: the captured flow-activating prompt, falling back to the last
139
- * user message in the transcript (covers a stateless agent that declines to
140
- * persist without owning a flow); `undefined` when neither exists.
143
+ * - `resumePrompt`: the last user message in the transcript — the request that was
144
+ * in flight — falling back to the captured flow-activating prompt when there is
145
+ * none; `undefined` when neither exists.
141
146
  *
142
147
  * @internal
143
148
  */
@@ -153,12 +158,20 @@ export declare function resolveNonResumableNotice(input: {
153
158
  /**
154
159
  * Index of the last `user`-role message in `messages`, or `-1` when there is none.
155
160
  * The single backward scan behind "what did the user last say" — used to slice the
156
- * transcript to a clean boundary (`keepThroughLastUserMessage`) and to recover a
157
- * flow-activation prompt. Allocation-free (no reversed copy).
161
+ * transcript to a clean boundary (`keepThroughLastUserMessage`) and to pick the
162
+ * prompt an interrupted flow hands back. Allocation-free (no reversed copy).
158
163
  *
159
164
  * @internal
160
165
  */
161
166
  export declare function lastUserMessageIndex(messages: ReadonlyArray<ChatMessage>): number;
167
+ /**
168
+ * The files of the message an interrupted `prompt` came from: the last user message in
169
+ * `messages`, when its text is the prompt. An older snapshot's prompt can be another text, and
170
+ * that message's files are not its own.
171
+ *
172
+ * @internal
173
+ */
174
+ export declare function interruptedPromptFiles(messages: ReadonlyArray<ChatMessage>, prompt: string | undefined): ChatMessage['attachments'];
162
175
  /**
163
176
  * Type guard: is `value` a {@link PersistedSession} we can safely restore?
164
177
  * Gates on matching schema version, same host, and a messages array — the
@@ -1 +1 @@
1
- {"version":3,"file":"session-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,aA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MG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,CAe5E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CA6B/E;AAQD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,EACpC,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,MAAM,GAAG,SAAS,CAsBpB;AA0BD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAIjF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,GAChC,MAAM,EAAE,CAIV;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAQxE"}
@@ -8,6 +8,7 @@ declare function makeStore(devTools: boolean | undefined): import("@genesislcap/
8
8
  setShowNarration(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<boolean>): void;
9
9
  setShowAgentSwitchIndicator(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<boolean>): void;
10
10
  setTimestampDisplay(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("@genesislcap/foundation-ai").TimestampDisplay>): void;
11
+ setNotificationLevel(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("..").AgentNotificationLevel>): void;
11
12
  setEnabledAnimations(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("..").AiAssistantAnimation[]>): void;
12
13
  setSuggestionsState(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<import("..").SuggestionsState>): void;
13
14
  setContextTokens(state: import("immer").WritableDraft<AiAssistantSessionState>, action: import("@reduxjs/toolkit").PayloadAction<number | undefined>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/state/session-store.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAIvD,iBAAS,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;cA6Cw8kB,CAAC;aAAsB,CAAC;;;;;;cAAy9D,CAAC;aAAob,CAAC;;;;;;;;;;;;;;;wCAvC95pB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAMnF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/state/session-store.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAIvD,iBAAS,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6Ci+lB,CAAC;aAAsB,CAAC;;;;;;cAAy9D,CAAC;aAAob,CAAC;;;;;;;;;;;;;;;wCAvCv7qB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAMnF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -48,6 +48,13 @@ export interface PersistedInteractionCheckpoint {
48
48
  export interface InteractionContext<TState extends object = Record<string, unknown>, TCheckpoint = unknown> {
49
49
  /** Stable id of the interaction this context belongs to. */
50
50
  readonly interactionId: string;
51
+ /**
52
+ * The session the interaction belongs to (GENC-1676) — plain data, the same in Node. A view
53
+ * passes it to anything that works per session, such as
54
+ * `<foundation-ai-notification-level session-key="...">`. Empty for a context made outside a
55
+ * session (an inert fallback, a test).
56
+ */
57
+ readonly sessionKey: string;
51
58
  /**
52
59
  * Who holds this pending interaction right now: `'user'`, or the id of the interceptor that
53
60
  * claimed it, e.g. `'autopilot'` (GENC-1660). `'user'` unless something claimed it.
@@ -141,6 +148,22 @@ export interface InteractionContext<TState extends object = Record<string, unkno
141
148
  claimantOwns(action: string): boolean;
142
149
  /** When the controller last called `notify()` (or the interaction opened), in epoch ms. A heartbeat. */
143
150
  readonly lastActivityAt: number;
151
+ /**
152
+ * Say this interaction needs the person to act (GENC-1676). If their notification level covers
153
+ * it and they are not looking at the page, they get a browser notification. Call it at the
154
+ * moment the widget starts waiting on the person — not before, if it has work to do first. A
155
+ * widget that only shows information never calls it.
156
+ *
157
+ * Safe to call from anywhere, the controller's constructor included: the platform reports it
158
+ * only once it has decided who holds the interaction, and drops it if a claimant (the autopilot)
159
+ * holds it then or when it is called — the claimant's own hand-back notifies instead. Only the
160
+ * first call counts, whatever happened to it; later ones do nothing, as do calls after the
161
+ * interaction ends.
162
+ *
163
+ * @param message - The notification's text for this case. Defaults to the app's
164
+ * `chatConfig.ui.notifications.message`, then to "The assistant is ready for your next input".
165
+ */
166
+ requestAttention(message?: string): void;
144
167
  /**
145
168
  * What is already done, for long work that should survive a reload: the last checkpoint saved,
146
169
  * or the one the platform handed over — after a restore, the first request for the same widget
@@ -1 +1 @@
1
- {"version":3,"file":"interaction-context.d.ts","sourceRoot":"","sources":["../../../src/types/interaction-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,kBAAkB,CACjC,MAAM,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/C,WAAW,GAAG,OAAO;IAErB,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;;;;;;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