@genesislcap/ai-assistant 15.77.0 → 15.78.0

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 (74) hide show
  1. package/dist/ai-assistant.api.json +753 -24
  2. package/dist/ai-assistant.d.ts +273 -3
  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 +636 -2
  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/index.d.ts +2 -0
  26. package/dist/dts/index.d.ts.map +1 -1
  27. package/dist/dts/main/main.d.ts +56 -1
  28. package/dist/dts/main/main.d.ts.map +1 -1
  29. package/dist/dts/notifications/agent-notifications.d.ts +139 -0
  30. package/dist/dts/notifications/agent-notifications.d.ts.map +1 -0
  31. package/dist/dts/notifications/agent-notifier.d.ts +58 -0
  32. package/dist/dts/notifications/agent-notifier.d.ts.map +1 -0
  33. package/dist/dts/notifications/index.d.ts +2 -0
  34. package/dist/dts/notifications/index.d.ts.map +1 -0
  35. package/dist/dts/notifications/notification-level-picker.template.d.ts +31 -0
  36. package/dist/dts/notifications/notification-level-picker.template.d.ts.map +1 -0
  37. package/dist/dts/notifications/notification-settings.d.ts +42 -0
  38. package/dist/dts/notifications/notification-settings.d.ts.map +1 -0
  39. package/dist/dts/react.d.ts +10 -0
  40. package/dist/dts/state/ai-assistant-slice.d.ts +8 -0
  41. package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
  42. package/dist/dts/state/interaction-context.d.ts +13 -0
  43. package/dist/dts/state/interaction-context.d.ts.map +1 -1
  44. package/dist/dts/state/persistence/session-persistence-provider.d.ts +5 -0
  45. package/dist/dts/state/persistence/session-persistence-provider.d.ts.map +1 -1
  46. package/dist/dts/state/session-store.d.ts +1 -0
  47. package/dist/dts/state/session-store.d.ts.map +1 -1
  48. package/dist/dts/types/interaction-context.d.ts +23 -0
  49. package/dist/dts/types/interaction-context.d.ts.map +1 -1
  50. package/dist/dts/utils/resolve-preference-baseline.d.ts +3 -0
  51. package/dist/dts/utils/resolve-preference-baseline.d.ts.map +1 -1
  52. package/dist/esm/autopilot/autopilot-driver.js +66 -3
  53. package/dist/esm/components/chat-bubble/chat-bubble.js +17 -3
  54. package/dist/esm/components/chat-driver/interaction-controller.js +5 -0
  55. package/dist/esm/components/notification-level/index.js +1 -0
  56. package/dist/esm/components/notification-level/notification-level.js +124 -0
  57. package/dist/esm/components/notification-level/notification-level.styles.js +20 -0
  58. package/dist/esm/components/notification-level/notification-level.template.js +11 -0
  59. package/dist/esm/components/settings-modal/settings-modal.styles.js +6 -0
  60. package/dist/esm/components/settings-modal/settings-modal.template.js +10 -1
  61. package/dist/esm/index.js +2 -0
  62. package/dist/esm/main/main.js +159 -12
  63. package/dist/esm/notifications/agent-notifications.js +172 -0
  64. package/dist/esm/notifications/agent-notifier.js +86 -0
  65. package/dist/esm/notifications/index.js +1 -0
  66. package/dist/esm/notifications/notification-level-picker.template.js +49 -0
  67. package/dist/esm/notifications/notification-settings.js +42 -0
  68. package/dist/esm/state/ai-assistant-slice.js +5 -0
  69. package/dist/esm/state/interaction-context.js +27 -0
  70. package/dist/esm/utils/resolve-preference-baseline.js +9 -0
  71. package/dist/react.cjs +7 -0
  72. package/dist/react.mjs +6 -0
  73. package/docs/notifications.md +169 -0
  74. package/package.json +17 -17
@@ -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;
@@ -305,6 +312,7 @@ export declare const aiAssistantSlice: import("@reduxjs/toolkit").Slice<AiAssist
305
312
  setShowNarration(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<boolean>): void;
306
313
  setShowAgentSwitchIndicator(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<boolean>): void;
307
314
  setTimestampDisplay(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<TimestampDisplay>): void;
315
+ setNotificationLevel(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<AgentNotificationLevel>): void;
308
316
  setEnabledAnimations(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<AiAssistantAnimation[]>): void;
309
317
  setSuggestionsState(state: import("immer").WritableDraft<AiAssistantSessionState>, action: PayloadAction<SuggestionsState>): void;
310
318
  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,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,WAAW,EAAE,C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;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,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,sFAAsF;IACtF,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,qGAAqG;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AAwB,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,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IAC9E,gFAAgF;IAChF,eAAe,CAAC,CAAC,UAAU,EAAE,MAAM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;;;;;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;IACzC;;;;;;;;;;OAUG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,O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kB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI1F"}
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6C4/lB,CAAC;aAAsB,CAAC;;;;;;cAAy9D,CAAC;aAAob,CAAC;;;;;;;;;;;;;;;wCAvCl9qB;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;IA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I,IAAI,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAE5C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAOhC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/B;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAE7C;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAE1C,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAEjD;;;;OAIG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAE3C;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC,wGAAwG;IACxG,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAMzC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,SAAS,CAAC;IAE7C;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAC/C"}
@@ -1,5 +1,6 @@
1
1
  import type { ChatConfig, TimestampDisplay } from '@genesislcap/foundation-ai';
2
2
  import { type AiAssistantAnimation } from '../main/main.types';
3
+ import { type AgentNotificationLevel } from '../notifications/agent-notifications';
3
4
  import type { SessionPreferences } from '../state/persistence/session-persistence-provider';
4
5
  /**
5
6
  * Whether a preference write is a no-op, so a setter can bail before touching the store.
@@ -27,6 +28,8 @@ export interface ResolvedPreferenceBaseline {
27
28
  showNarration: boolean;
28
29
  showAgentSwitchIndicator: boolean;
29
30
  timestampDisplay: TimestampDisplay;
31
+ /** Stored only: no config layer, so `'off'` unless the person (or the app) chose otherwise. */
32
+ notificationLevel: AgentNotificationLevel;
30
33
  enabledAnimations: AiAssistantAnimation[];
31
34
  /**
32
35
  * The remembered "remember chat" toggle — present only when stored prefs carried
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-preference-baseline.d.ts","sourceRoot":"","sources":["../../../src/utils/resolve-preference-baseline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAG5F;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAK7E;AAED;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;IAC1C;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,EAAE,gBAA2B,CAAC;AA+BpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,EACpB,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAC5C,0BAA0B,CAwC5B"}
1
+ {"version":3,"file":"resolve-preference-baseline.d.ts","sourceRoot":"","sources":["../../../src/utils/resolve-preference-baseline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAG5F;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAK7E;AAED;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,+FAA+F;IAC/F,iBAAiB,EAAE,sBAAsB,CAAC;IAC1C,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;IAC1C;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,EAAE,gBAA2B,CAAC;AA+BpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,EACpB,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAC5C,0BAA0B,CA+C5B"}
@@ -1,4 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
+ import { NOOP_ACTIVITY_BUS } from '../channel/ai-activity-bus';
2
3
  import { BaseDriverDecorator } from '../components/ai-driver/base-driver-decorator';
3
4
  import { recordMetaEvent } from '../state/debug-event-log';
4
5
  import { getInteractionRegistration, registerInteraction } from '../state/interaction-registry';
@@ -13,6 +14,20 @@ import { AUTOPILOT_HAND_BACK, HandBackController, handBackAsText, } from './hand
13
14
  export const AUTOPILOT_CLAIMANT = 'autopilot';
14
15
  /** How the working agent is told about a decision when the config gives no phrase. */
15
16
  const DEFAULT_DECISION_FRAMING = "Decided on the user's behalf";
17
+ /**
18
+ * Declines that leave an interaction with the person while the autopilot runs for its flow: it
19
+ * may not answer this one, so the person has to. The others (paused, another flow, no autopilot)
20
+ * mean it was never the autopilot's to answer.
21
+ */
22
+ const HANDED_TO_PERSON = new Set(['policy', 'userOnly', 'no-controller']);
23
+ /**
24
+ * Nothing is happening, and not because the person paused it or has its hand-back: in its flow,
25
+ * or after its flow ended. Whether that is a stop depends on what came before; see `watchForStop`.
26
+ */
27
+ const isIdle = (state) => (state.mode === 'running' || state.mode === 'unavailable') &&
28
+ !state.working &&
29
+ !state.needsUser &&
30
+ !state.pause;
16
31
  /** How a written answer sent on the user's behalf is framed, when the config gives no phrase. */
17
32
  const DEFAULT_REPLY_FRAMING = "Answered on the user's behalf.";
18
33
  /**
@@ -73,7 +88,7 @@ const DEFAULT_COPY = {
73
88
  */
74
89
  export class AutopilotDriver extends BaseDriverDecorator {
75
90
  constructor(inner, options) {
76
- var _a, _b, _c;
91
+ var _a, _b, _c, _d;
77
92
  super(inner);
78
93
  this.listeners = new Set();
79
94
  this.sessions = new Map();
@@ -94,9 +109,16 @@ export class AutopilotDriver extends BaseDriverDecorator {
94
109
  this.turnsInFlight = 0;
95
110
  /** Written questions being answered right now; see `working`. */
96
111
  this.answersInFlight = 0;
112
+ /**
113
+ * Whether the autopilot has been running, and working, since it last stopped or was paused: so
114
+ * going idle now is a stop to report. Outlives its flow ending, so a turn still running then is
115
+ * waited out. See `watchForStop`.
116
+ */
117
+ this.ranSinceStop = false;
97
118
  this.agents = options.agents;
98
119
  this.providerRegistry = options.providerRegistry;
99
120
  this.sessionKey = (_a = options.sessionKey) !== null && _a !== void 0 ? _a : '';
121
+ this.activityBus = (_b = options.activityBus) !== null && _b !== void 0 ? _b : NOOP_ACTIVITY_BUS;
100
122
  // The turn-level hand-back is a widget like any other: registered, so it has a controller and a
101
123
  // text form. Once per app, whichever autopilot gets there first.
102
124
  if (!getInteractionRegistration(AUTOPILOT_HAND_BACK)) {
@@ -118,7 +140,7 @@ export class AutopilotDriver extends BaseDriverDecorator {
118
140
  };
119
141
  // Every hook on the inner driver is undone by `detach()`, so this decorator can be dropped
120
142
  // while the driver it wrapped lives on.
121
- const removeInterceptor = (_b = inner.addInteractionInterceptor) === null || _b === void 0 ? void 0 : _b.call(inner, {
143
+ const removeInterceptor = (_c = inner.addInteractionInterceptor) === null || _c === void 0 ? void 0 : _c.call(inner, {
122
144
  id: AUTOPILOT_CLAIMANT,
123
145
  // Read when a claimed interaction settles: the framing of the flow the autopilot serves.
124
146
  get decisionFraming() {
@@ -132,7 +154,7 @@ export class AutopilotDriver extends BaseDriverDecorator {
132
154
  });
133
155
  if (removeInterceptor)
134
156
  this.onDetach(removeInterceptor);
135
- const removeCapability = (_c = inner.provideHandlerCapability) === null || _c === void 0 ? void 0 : _c.call(inner, AUTOPILOT_CLAIMANT, (scope) => this.capabilityFor(scope));
157
+ const removeCapability = (_d = inner.provideHandlerCapability) === null || _d === void 0 ? void 0 : _d.call(inner, AUTOPILOT_CLAIMANT, (scope) => this.capabilityFor(scope));
136
158
  if (removeCapability)
137
159
  this.onDetach(removeCapability);
138
160
  const onFlowOwnerChanged = (e) => this.onFlowOwnerChanged(e.detail);
@@ -143,6 +165,7 @@ export class AutopilotDriver extends BaseDriverDecorator {
143
165
  inner.addEventListener('history-updated', onHistoryUpdated);
144
166
  this.onDetach(() => {
145
167
  this.disarmWatchdog();
168
+ clearTimeout(this.stopCheck);
146
169
  inner.removeEventListener('flow-owner-changed', onFlowOwnerChanged);
147
170
  inner.removeEventListener('history-updated', onHistoryUpdated);
148
171
  this.releaseHeld();
@@ -522,6 +545,7 @@ export class AutopilotDriver extends BaseDriverDecorator {
522
545
  this.turnHandBack = { why };
523
546
  this.consecutiveReplies = 0;
524
547
  this.notify();
548
+ this.attention('autopilot-handed-back');
525
549
  let result;
526
550
  try {
527
551
  result = yield this.inner.presentInteraction(AUTOPILOT_HAND_BACK, data, {
@@ -594,6 +618,10 @@ export class AutopilotDriver extends BaseDriverDecorator {
594
618
  component: opened.componentName,
595
619
  reason,
596
620
  });
621
+ // The run waits on the person now. Its own turn-level hand-back reports itself.
622
+ if (HANDED_TO_PERSON.has(reason) && opened.componentName !== AUTOPILOT_HAND_BACK) {
623
+ this.attention('autopilot-handed-back', opened.interactionId);
624
+ }
597
625
  return undefined;
598
626
  };
599
627
  const owner = this.flowOwner();
@@ -760,6 +788,7 @@ export class AutopilotDriver extends BaseDriverDecorator {
760
788
  trigger,
761
789
  });
762
790
  this.notify();
791
+ this.attention('autopilot-handed-back', held.opened.interactionId);
763
792
  }
764
793
  /**
765
794
  * On detach: hand a claimed interaction the autopilot still holds to the person, stopping its
@@ -886,7 +915,41 @@ export class AutopilotDriver extends BaseDriverDecorator {
886
915
  record(type, detail) {
887
916
  recordMetaEvent(this.sessionKey, type, detail);
888
917
  }
918
+ /** Report that something needs the person, for the assistant to notify them (GENC-1676). */
919
+ attention(kind, interactionId) {
920
+ this.activityBus.publish('agent-attention', Object.assign({ sessionKey: this.sessionKey, kind }, (interactionId ? { interactionId } : {})));
921
+ }
922
+ /**
923
+ * Report the autopilot stopping work on its own (GENC-1676): after running and working, nothing
924
+ * is happening and nothing waits on the person — the turn ended with nothing for it to answer,
925
+ * hit a wall such as the budget, or its flow ended. A flow that ends mid-turn is reported once
926
+ * the turn ends, not while the assistant is still writing. A pause by the person is not a stop,
927
+ * and a hand-back reports itself.
928
+ *
929
+ * Confirmed a task later, because one state change can briefly look like a stop on the way to
930
+ * something else (a turn ending just before the next starts).
931
+ */
932
+ watchForStop() {
933
+ const state = this.state;
934
+ if (state.mode === 'paused') {
935
+ // The person paused it (or Stop did): whatever follows is not the autopilot stopping.
936
+ this.ranSinceStop = false;
937
+ return;
938
+ }
939
+ if (state.mode === 'running' && state.working)
940
+ this.ranSinceStop = true;
941
+ if (!this.ranSinceStop || !isIdle(state) || this.stopCheck)
942
+ return;
943
+ this.stopCheck = setTimeout(() => {
944
+ this.stopCheck = undefined;
945
+ if (!this.ranSinceStop || !isIdle(this.state))
946
+ return;
947
+ this.ranSinceStop = false;
948
+ this.attention('autopilot-stopped');
949
+ }, 0);
950
+ }
889
951
  notify() {
952
+ this.watchForStop();
890
953
  for (const listener of this.listeners) {
891
954
  try {
892
955
  listener();
@@ -162,9 +162,7 @@ let AiChatBubble = class AiChatBubble extends GenesisElement {
162
162
  this.startCloseDialog();
163
163
  }
164
164
  else {
165
- this.dialogLeft = Math.max(VIEWPORT_EDGE_MARGIN, this.bubbleLeft - DIALOG_BUBBLE_HORIZONTAL_OFFSET);
166
- this.dialogTop = Math.max(VIEWPORT_EDGE_MARGIN, this.bubbleTop - DIALOG_OPEN_TOP_OFFSET);
167
- this.dialogOpen = true;
165
+ this.openDialog();
168
166
  this.showWaitingIfBadged();
169
167
  }
170
168
  }
@@ -197,10 +195,20 @@ let AiChatBubble = class AiChatBubble extends GenesisElement {
197
195
  });
198
196
  this.refreshNeedsUser();
199
197
  const unsubNeedsUser = agenticActivityBus.subscribe('autopilot-needs-user', () => this.refreshNeedsUser());
198
+ // Asked from outside the bubble, e.g. a notification clicked (GENC-1676): open on what waits.
199
+ const unsubShowWaiting = agenticActivityBus.subscribe('autopilot-show-waiting', (detail) => {
200
+ if (this.hidden || this.dialogOpen)
201
+ return;
202
+ if ((detail === null || detail === void 0 ? void 0 : detail.sessionKey) && detail.sessionKey !== this.assistantSessionKey())
203
+ return;
204
+ this.cancelClose();
205
+ this.openDialog();
206
+ });
200
207
  this.unsubBus = () => {
201
208
  unsubPopout();
202
209
  unsubPopin();
203
210
  unsubNeedsUser();
211
+ unsubShowWaiting();
204
212
  };
205
213
  // Measure tooltip width once after first render. The bubble is visible on connect
206
214
  // (dialogOpen starts false), so the element is in the DOM by the time rAF fires.
@@ -292,6 +300,12 @@ let AiChatBubble = class AiChatBubble extends GenesisElement {
292
300
  const assistant = this.findAssistant([...this.children]);
293
301
  return (_a = assistant === null || assistant === void 0 ? void 0 : assistant.stateKey) !== null && _a !== void 0 ? _a : undefined;
294
302
  }
303
+ /** Open the dialog beside the orb. */
304
+ openDialog() {
305
+ this.dialogLeft = Math.max(VIEWPORT_EDGE_MARGIN, this.bubbleLeft - DIALOG_BUBBLE_HORIZONTAL_OFFSET);
306
+ this.dialogTop = Math.max(VIEWPORT_EDGE_MARGIN, this.bubbleTop - DIALOG_OPEN_TOP_OFFSET);
307
+ this.dialogOpen = true;
308
+ }
295
309
  /** Opened from the badge: take the person to what is waiting on them (GENC-1660). */
296
310
  showWaitingIfBadged() {
297
311
  if (!this.needsUser)
@@ -420,9 +420,11 @@ export class InteractionController {
420
420
  // including a controller resolving in its constructor, before its message is appended,
421
421
  // which `resolve` holds back until there is a message to patch.
422
422
  const handle = createInteractionContext(interactionId, {
423
+ sessionKey: this.deps.sessionKey,
423
424
  resolve: (result) => this.resolve(interactionId, result),
424
425
  checkpoint: this.takeOverCheckpoint(componentName, data, interactionId),
425
426
  saveCheckpoint: (value) => this.saveCheckpoint(interactionId, componentName, value),
427
+ requestAttention: (message) => this.deps.activityBus.publish('agent-attention', Object.assign({ sessionKey: this.deps.sessionKey, kind: 'widget-needs-input', interactionId }, (message ? { message } : {}))),
426
428
  });
427
429
  this.contexts.set(interactionId, handle);
428
430
  bindStepRecorder(handle.context, (step, outcome) => recordMetaEvent(this.deps.sessionKey, 'interaction.step', {
@@ -456,6 +458,9 @@ export class InteractionController {
456
458
  ownerPath,
457
459
  userOnly: (options === null || options === void 0 ? void 0 : options.userOnly) === true,
458
460
  });
461
+ // Who holds it is decided: a `requestAttention` the controller made while being built can
462
+ // now report, or be dropped if a claimant holds it (GENC-1676).
463
+ handle.markOffered();
459
464
  recordMetaEvent(this.deps.sessionKey, 'interaction.requested', Object.assign({ interactionId, component: componentName, agent: this.deps.activeAgentName(), ownerPath,
460
465
  heldBy }, ((options === null || options === void 0 ? void 0 : options.userOnly) ? { userOnly: true } : {})));
461
466
  // Signal the park boundary on the activity bus so turn-aware UI can tell
@@ -0,0 +1 @@
1
+ export * from './notification-level';