@genesislcap/ai-assistant 14.437.6 → 14.438.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.
@@ -568,7 +568,7 @@
568
568
  {
569
569
  "kind": "Variable",
570
570
  "canonicalReference": "@genesislcap/ai-assistant!agenticActivityBus:var",
571
- "docComment": "/**\n * Pre-instantiated singleton event bus for AI assistant activity.\n *\n * - `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that popout windows opened from this tab show halo animations, while remaining isolated from unrelated tabs on the same origin (tab-scoped channel name). - `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the user clicked.\n *\n * @beta\n */\n",
571
+ "docComment": "/**\n * Pre-instantiated singleton event bus for AI assistant activity.\n *\n * - `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that popout windows opened from this tab show halo animations, while remaining isolated from unrelated tabs on the same origin (tab-scoped channel name). - `tool-loop-start` / `tool-loop-end` are cross-tab for the same reason: they describe the assistant's lifecycle (a turn beginning / ending), and the most common subscribers (workspace transitions, post-turn deferred recomputation, UI gates tied to the assistant being idle) need the event regardless of whether the user is interacting with the chat in the main tab or a popout window. Tab-local-only telemetry can subscribe and filter. - `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the user clicked.\n *\n * @beta\n */\n",
572
572
  "excerptTokens": [
573
573
  {
574
574
  "kind": "Content",
@@ -792,6 +792,60 @@
792
792
  "startIndex": 1,
793
793
  "endIndex": 2
794
794
  }
795
+ },
796
+ {
797
+ "kind": "PropertySignature",
798
+ "canonicalReference": "@genesislcap/ai-assistant!AgenticActivityEvents#\"tool-loop-end\":member",
799
+ "docComment": "/**\n * Fired when the tool loop completes for the current turn and control returns to the user on the **main chat prompt** (i.e. the next free-form user message can now be accepted).\n *\n * Boundary: this is the moment the user regains control of the main chat input. It is **not** fired when a tool handler hands a widget to the user mid-loop (e.g. while a planning widget is awaiting a click) — widget pauses are still inside the loop, the assistant still owns the turn, and the main chat input may be hidden during them. Wait for this event when you need to know that the assistant is fully idle and the user can type freely again.\n *\n * Emitted from the finally block of each `ChatDriver`'s `sendMessage` and `continueFromHistory`, so a multi-agent handoff fires this event once per agent.\n *\n * Distinct from {@link AgenticActivityEvents.'halo-stop'} — the halo event tracks the spinner animation lifecycle (which can flap mid-turn as tool calls resolve), whereas this event is a one-shot per turn boundary. Use this for hooks tied to a turn ending (telemetry flushes, post-turn workspace transitions, deferred state recomputation).\n */\n",
800
+ "excerptTokens": [
801
+ {
802
+ "kind": "Content",
803
+ "text": "'tool-loop-end': "
804
+ },
805
+ {
806
+ "kind": "Content",
807
+ "text": "undefined"
808
+ },
809
+ {
810
+ "kind": "Content",
811
+ "text": ";"
812
+ }
813
+ ],
814
+ "isReadonly": false,
815
+ "isOptional": false,
816
+ "releaseTag": "Beta",
817
+ "name": "\"tool-loop-end\"",
818
+ "propertyTypeTokenRange": {
819
+ "startIndex": 1,
820
+ "endIndex": 2
821
+ }
822
+ },
823
+ {
824
+ "kind": "PropertySignature",
825
+ "canonicalReference": "@genesislcap/ai-assistant!AgenticActivityEvents#\"tool-loop-start\":member",
826
+ "docComment": "/**\n * Fired immediately before the tool loop begins running for the current turn — after the busy flag is set and the user message (if any) has been appended, but before the first provider call. Pairs with {@link AgenticActivityEvents.'tool-loop-end'}.\n *\n * Boundary: this is the moment the assistant takes control from the user on the **main chat prompt** to begin a turn. It is **not** fired when a tool handler temporarily hands a widget to the user mid-loop (e.g. `requestInteraction` pausing a handler while a planning widget is rendered) — those widget pauses happen inside the loop and the assistant is still considered to own the turn.\n *\n * Fires from each `ChatDriver`'s `sendMessage` and `continueFromHistory`, so during a multi-agent handoff orchestrated by `OrchestratingDriver` it fires once per agent the orchestrator hands off to.\n *\n * Distinct from {@link AgenticActivityEvents.'halo-start'} — the halo event is keyed to tool-call messages arriving in the stream (UI animation concern), not to the loop boundary itself. Use this event for hooks tied to a turn beginning (telemetry, transient UI gates).\n */\n",
827
+ "excerptTokens": [
828
+ {
829
+ "kind": "Content",
830
+ "text": "'tool-loop-start': "
831
+ },
832
+ {
833
+ "kind": "Content",
834
+ "text": "undefined"
835
+ },
836
+ {
837
+ "kind": "Content",
838
+ "text": ";"
839
+ }
840
+ ],
841
+ "isReadonly": false,
842
+ "isOptional": false,
843
+ "releaseTag": "Beta",
844
+ "name": "\"tool-loop-start\"",
845
+ "propertyTypeTokenRange": {
846
+ "startIndex": 1,
847
+ "endIndex": 2
848
+ }
795
849
  }
796
850
  ],
797
851
  "extendsTokenRanges": []
@@ -84,6 +84,11 @@ export declare class AgenticActivityBus {
84
84
  * - `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that
85
85
  * popout windows opened from this tab show halo animations, while remaining isolated from
86
86
  * unrelated tabs on the same origin (tab-scoped channel name).
87
+ * - `tool-loop-start` / `tool-loop-end` are cross-tab for the same reason: they describe the
88
+ * assistant's lifecycle (a turn beginning / ending), and the most common subscribers
89
+ * (workspace transitions, post-turn deferred recomputation, UI gates tied to the assistant
90
+ * being idle) need the event regardless of whether the user is interacting with the chat
91
+ * in the main tab or a popout window. Tab-local-only telemetry can subscribe and filter.
87
92
  * - `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the
88
93
  * user clicked.
89
94
  *
@@ -128,6 +133,46 @@ export declare interface AgenticActivityEvents {
128
133
  'chat-popout': undefined;
129
134
  /** Fired when the user clicks the collapse button — moves assistant from layout back to bubble. State lives in the session store, not in this event. */
130
135
  'chat-popin': undefined;
136
+ /**
137
+ * Fired immediately before the tool loop begins running for the current turn — after the busy
138
+ * flag is set and the user message (if any) has been appended, but before the first
139
+ * provider call. Pairs with {@link AgenticActivityEvents.'tool-loop-end'}.
140
+ *
141
+ * Boundary: this is the moment the assistant takes control from the user on the **main chat
142
+ * prompt** to begin a turn. It is **not** fired when a tool handler temporarily hands a
143
+ * widget to the user mid-loop (e.g. `requestInteraction` pausing a handler while a planning
144
+ * widget is rendered) — those widget pauses happen inside the loop and the assistant is
145
+ * still considered to own the turn.
146
+ *
147
+ * Fires from each `ChatDriver`'s `sendMessage` and `continueFromHistory`, so during a
148
+ * multi-agent handoff orchestrated by `OrchestratingDriver` it fires once per agent
149
+ * the orchestrator hands off to.
150
+ *
151
+ * Distinct from {@link AgenticActivityEvents.'halo-start'} — the halo event is keyed to
152
+ * tool-call messages arriving in the stream (UI animation concern), not to the loop boundary
153
+ * itself. Use this event for hooks tied to a turn beginning (telemetry, transient UI gates).
154
+ */
155
+ 'tool-loop-start': undefined;
156
+ /**
157
+ * Fired when the tool loop completes for the current turn and control returns to the user
158
+ * on the **main chat prompt** (i.e. the next free-form user message can now be accepted).
159
+ *
160
+ * Boundary: this is the moment the user regains control of the main chat input. It is
161
+ * **not** fired when a tool handler hands a widget to the user mid-loop (e.g. while a
162
+ * planning widget is awaiting a click) — widget pauses are still inside the loop, the
163
+ * assistant still owns the turn, and the main chat input may be hidden during them. Wait
164
+ * for this event when you need to know that the assistant is fully idle and the user can
165
+ * type freely again.
166
+ *
167
+ * Emitted from the finally block of each `ChatDriver`'s `sendMessage` and
168
+ * `continueFromHistory`, so a multi-agent handoff fires this event once per agent.
169
+ *
170
+ * Distinct from {@link AgenticActivityEvents.'halo-stop'} — the halo event tracks the
171
+ * spinner animation lifecycle (which can flap mid-turn as tool calls resolve), whereas
172
+ * this event is a one-shot per turn boundary. Use this for hooks tied to a turn ending
173
+ * (telemetry flushes, post-turn workspace transitions, deferred state recomputation).
174
+ */
175
+ 'tool-loop-end': undefined;
131
176
  }
132
177
 
133
178
  /**
@@ -68,6 +68,11 @@ export declare class AgenticActivityBus {
68
68
  * - `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that
69
69
  * popout windows opened from this tab show halo animations, while remaining isolated from
70
70
  * unrelated tabs on the same origin (tab-scoped channel name).
71
+ * - `tool-loop-start` / `tool-loop-end` are cross-tab for the same reason: they describe the
72
+ * assistant's lifecycle (a turn beginning / ending), and the most common subscribers
73
+ * (workspace transitions, post-turn deferred recomputation, UI gates tied to the assistant
74
+ * being idle) need the event regardless of whether the user is interacting with the chat
75
+ * in the main tab or a popout window. Tab-local-only telemetry can subscribe and filter.
71
76
  * - `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the
72
77
  * user clicked.
73
78
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ai-activity-bus.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,+EAA+E;IAC/E,cAAc,CAAC,EAAE,CAAC,MAAM,qBAAqB,CAAC,EAAE,CAAC;IACjD,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAc;IAC7C,OAAO,CAAC,OAAO,CAAC,CAAmB;IAEnC;;;OAGG;gBACS,MAAM,CAAC,EAAE,wBAAwB;IAW7C;;;;;OAKG;IACH,SAAS,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAC7C,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,GAClD,MAAM,IAAI;IAWb;;;;;OAKG;IACH,OAAO,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI;IAO/F;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,qBAAqB,GAAG,IAAI;IAIzD;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,WAAW;CAGpB;AA6BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,oBAG7B,CAAC"}
1
+ {"version":3,"file":"ai-activity-bus.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,+EAA+E;IAC/E,cAAc,CAAC,EAAE,CAAC,MAAM,qBAAqB,CAAC,EAAE,CAAC;IACjD,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAc;IAC7C,OAAO,CAAC,OAAO,CAAC,CAAmB;IAEnC;;;OAGG;gBACS,MAAM,CAAC,EAAE,wBAAwB;IAW7C;;;;;OAKG;IACH,SAAS,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAC7C,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,GAClD,MAAM,IAAI;IAWb;;;;;OAKG;IACH,OAAO,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI;IAO/F;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,qBAAqB,GAAG,IAAI;IAIzD;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,WAAW;CAGpB;AA6BD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,oBAG7B,CAAC"}
@@ -23,5 +23,45 @@ export interface AgenticActivityEvents {
23
23
  'chat-popout': undefined;
24
24
  /** Fired when the user clicks the collapse button — moves assistant from layout back to bubble. State lives in the session store, not in this event. */
25
25
  'chat-popin': undefined;
26
+ /**
27
+ * Fired immediately before the tool loop begins running for the current turn — after the busy
28
+ * flag is set and the user message (if any) has been appended, but before the first
29
+ * provider call. Pairs with {@link AgenticActivityEvents.'tool-loop-end'}.
30
+ *
31
+ * Boundary: this is the moment the assistant takes control from the user on the **main chat
32
+ * prompt** to begin a turn. It is **not** fired when a tool handler temporarily hands a
33
+ * widget to the user mid-loop (e.g. `requestInteraction` pausing a handler while a planning
34
+ * widget is rendered) — those widget pauses happen inside the loop and the assistant is
35
+ * still considered to own the turn.
36
+ *
37
+ * Fires from each `ChatDriver`'s `sendMessage` and `continueFromHistory`, so during a
38
+ * multi-agent handoff orchestrated by `OrchestratingDriver` it fires once per agent
39
+ * the orchestrator hands off to.
40
+ *
41
+ * Distinct from {@link AgenticActivityEvents.'halo-start'} — the halo event is keyed to
42
+ * tool-call messages arriving in the stream (UI animation concern), not to the loop boundary
43
+ * itself. Use this event for hooks tied to a turn beginning (telemetry, transient UI gates).
44
+ */
45
+ 'tool-loop-start': undefined;
46
+ /**
47
+ * Fired when the tool loop completes for the current turn and control returns to the user
48
+ * on the **main chat prompt** (i.e. the next free-form user message can now be accepted).
49
+ *
50
+ * Boundary: this is the moment the user regains control of the main chat input. It is
51
+ * **not** fired when a tool handler hands a widget to the user mid-loop (e.g. while a
52
+ * planning widget is awaiting a click) — widget pauses are still inside the loop, the
53
+ * assistant still owns the turn, and the main chat input may be hidden during them. Wait
54
+ * for this event when you need to know that the assistant is fully idle and the user can
55
+ * type freely again.
56
+ *
57
+ * Emitted from the finally block of each `ChatDriver`'s `sendMessage` and
58
+ * `continueFromHistory`, so a multi-agent handoff fires this event once per agent.
59
+ *
60
+ * Distinct from {@link AgenticActivityEvents.'halo-stop'} — the halo event tracks the
61
+ * spinner animation lifecycle (which can flap mid-turn as tool calls resolve), whereas
62
+ * this event is a one-shot per turn boundary. Use this for hooks tied to a turn ending
63
+ * (telemetry flushes, post-turn workspace transitions, deferred state recomputation).
64
+ */
65
+ 'tool-loop-end': undefined;
26
66
  }
27
67
  //# sourceMappingURL=ai-activity-channel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai-activity-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,YAAY,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtC,iFAAiF;IACjF,WAAW,EAAE,SAAS,CAAC;IACvB,mJAAmJ;IACnJ,aAAa,EAAE,SAAS,CAAC;IACzB,wJAAwJ;IACxJ,YAAY,EAAE,SAAS,CAAC;CACzB"}
1
+ {"version":3,"file":"ai-activity-channel.d.ts","sourceRoot":"","sources":["../../../src/channel/ai-activity-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,YAAY,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtC,iFAAiF;IACjF,WAAW,EAAE,SAAS,CAAC;IACvB,mJAAmJ;IACnJ,aAAa,EAAE,SAAS,CAAC;IACzB,wJAAwJ;IACxJ,YAAY,EAAE,SAAS,CAAC;IACxB;;;;;;;;;;;;;;;;;;OAkBG;IACH,iBAAiB,EAAE,SAAS,CAAC;IAC7B;;;;;;;;;;;;;;;;;;OAkBG;IACH,eAAe,EAAE,SAAS,CAAC;CAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAKX,yBAAyB,EAE1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EACV,WAAW,EAEX,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,E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wBrF,wFAAwF;IACxF,OAAO,CAAC,OAAO;IAKf;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA+BxB,uFAAuF;IACvF,OAAO,CAAC,QAAQ;IAqChB,OAAO,CAAC,aAAa;IAQrB,8EAA8E;IAC9E,OAAO,CAAC,SAAS;IAWjB,mFAAmF;IACnF,OAAO,CAAC,2BAA2B;YAkCrB,WAAW;IA0XzB,OAAO,CAAC,eAAe;CAgBxB"}
1
+ {"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EAKX,yBAAyB,EAE1B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,WAAW,EAEX,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAUxE,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAMhE;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AAE9E;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,aAAa,CAAC,EAAE,OAAO,CAAC;CACz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;;OAgBG;IACU,kBAAkB,CAAC,CAAC,EAC/B,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,GAAG,EACT,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,CAAC,CAAC;IAkCb;;;OAGG;IACI,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;IAyBnE;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAS3C,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyB/F;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAsC3B;;;;;OAKG;YACW,cAAc;IAmF5B;;;OAGG;IACG,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0BrF,wFAAwF;IACxF,OAAO,CAAC,OAAO;IAKf;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA+BxB,uFAAuF;IACvF,OAAO,CAAC,QAAQ;IAqChB,OAAO,CAAC,aAAa;IAQrB,8EAA8E;IAC9E,OAAO,CAAC,SAAS;IAWjB,mFAAmF;IACnF,OAAO,CAAC,2BAA2B;YAkCrB,WAAW;IA0XzB,OAAO,CAAC,eAAe;CAgBxB"}
@@ -115,12 +115,17 @@ function getTabScopedChannelName(base) {
115
115
  * - `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that
116
116
  * popout windows opened from this tab show halo animations, while remaining isolated from
117
117
  * unrelated tabs on the same origin (tab-scoped channel name).
118
+ * - `tool-loop-start` / `tool-loop-end` are cross-tab for the same reason: they describe the
119
+ * assistant's lifecycle (a turn beginning / ending), and the most common subscribers
120
+ * (workspace transitions, post-turn deferred recomputation, UI gates tied to the assistant
121
+ * being idle) need the event regardless of whether the user is interacting with the chat
122
+ * in the main tab or a popout window. Tab-local-only telemetry can subscribe and filter.
118
123
  * - `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the
119
124
  * user clicked.
120
125
  *
121
126
  * @beta
122
127
  */
123
128
  export const agenticActivityBus = new AgenticActivityBus({
124
- crossTabEvents: ['halo-start', 'halo-stop'],
129
+ crossTabEvents: ['halo-start', 'halo-stop', 'tool-loop-start', 'tool-loop-end'],
125
130
  channelName: getTabScopedChannelName('foundation-ai-activity'),
126
131
  });
@@ -1,5 +1,6 @@
1
1
  import { __awaiter } from "tslib";
2
2
  import { MalformedFunctionCallError } from '@genesislcap/foundation-ai';
3
+ import { agenticActivityBus } from '../../channel/ai-activity-bus';
3
4
  import { applyHistoryCap } from '../../utils/history-transform';
4
5
  import { logger } from '../../utils/logger';
5
6
  import { TOOL_FOLD_SYMBOL } from '../../utils/tool-fold';
@@ -376,6 +377,7 @@ export class ChatDriver extends EventTarget {
376
377
  this.subAgentCompletion = undefined;
377
378
  this.agentReleaseRequested = false;
378
379
  this.appendToHistory({ role: 'user', content: userInput, attachments });
380
+ agenticActivityBus.publish('tool-loop-start', undefined);
379
381
  try {
380
382
  return yield this.runToolLoop(userInput, attachments);
381
383
  }
@@ -386,6 +388,7 @@ export class ChatDriver extends EventTarget {
386
388
  }
387
389
  finally {
388
390
  this.busy = false;
391
+ agenticActivityBus.publish('tool-loop-end', undefined);
389
392
  }
390
393
  });
391
394
  }
@@ -503,6 +506,7 @@ export class ChatDriver extends EventTarget {
503
506
  }
504
507
  this.busy = true;
505
508
  this.subAgentCompletion = undefined;
509
+ agenticActivityBus.publish('tool-loop-start', undefined);
506
510
  try {
507
511
  return yield this.runToolLoop('', undefined, transientPrimer);
508
512
  }
@@ -513,6 +517,7 @@ export class ChatDriver extends EventTarget {
513
517
  }
514
518
  finally {
515
519
  this.busy = false;
520
+ agenticActivityBus.publish('tool-loop-end', undefined);
516
521
  }
517
522
  });
518
523
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/ai-assistant",
3
3
  "description": "Genesis AI Assistant micro-frontend",
4
- "version": "14.437.6",
4
+ "version": "14.438.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -64,24 +64,24 @@
64
64
  }
65
65
  },
66
66
  "devDependencies": {
67
- "@genesislcap/foundation-testing": "14.437.6",
68
- "@genesislcap/genx": "14.437.6",
69
- "@genesislcap/rollup-builder": "14.437.6",
70
- "@genesislcap/ts-builder": "14.437.6",
71
- "@genesislcap/uvu-playwright-builder": "14.437.6",
72
- "@genesislcap/vite-builder": "14.437.6",
73
- "@genesislcap/webpack-builder": "14.437.6",
67
+ "@genesislcap/foundation-testing": "14.438.0",
68
+ "@genesislcap/genx": "14.438.0",
69
+ "@genesislcap/rollup-builder": "14.438.0",
70
+ "@genesislcap/ts-builder": "14.438.0",
71
+ "@genesislcap/uvu-playwright-builder": "14.438.0",
72
+ "@genesislcap/vite-builder": "14.438.0",
73
+ "@genesislcap/webpack-builder": "14.438.0",
74
74
  "@types/dompurify": "^3.0.5",
75
75
  "@types/marked": "^5.0.2"
76
76
  },
77
77
  "dependencies": {
78
- "@genesislcap/foundation-ai": "14.437.6",
79
- "@genesislcap/foundation-logger": "14.437.6",
80
- "@genesislcap/foundation-redux": "14.437.6",
81
- "@genesislcap/foundation-ui": "14.437.6",
82
- "@genesislcap/foundation-utils": "14.437.6",
83
- "@genesislcap/rapid-design-system": "14.437.6",
84
- "@genesislcap/web-core": "14.437.6",
78
+ "@genesislcap/foundation-ai": "14.438.0",
79
+ "@genesislcap/foundation-logger": "14.438.0",
80
+ "@genesislcap/foundation-redux": "14.438.0",
81
+ "@genesislcap/foundation-ui": "14.438.0",
82
+ "@genesislcap/foundation-utils": "14.438.0",
83
+ "@genesislcap/rapid-design-system": "14.438.0",
84
+ "@genesislcap/web-core": "14.438.0",
85
85
  "dompurify": "^3.3.1",
86
86
  "marked": "^17.0.3"
87
87
  },
@@ -93,5 +93,5 @@
93
93
  "publishConfig": {
94
94
  "access": "public"
95
95
  },
96
- "gitHead": "8e8032f3226d1e6fa13ade21262a4ef7768caa9d"
96
+ "gitHead": "2aadae08b54d594c850d65c00a18e3ce5064069c"
97
97
  }
@@ -139,12 +139,17 @@ function getTabScopedChannelName(base: string): string {
139
139
  * - `halo-start` / `halo-stop` are forwarded via a tab-scoped `BroadcastChannel` so that
140
140
  * popout windows opened from this tab show halo animations, while remaining isolated from
141
141
  * unrelated tabs on the same origin (tab-scoped channel name).
142
+ * - `tool-loop-start` / `tool-loop-end` are cross-tab for the same reason: they describe the
143
+ * assistant's lifecycle (a turn beginning / ending), and the most common subscribers
144
+ * (workspace transitions, post-turn deferred recomputation, UI gates tied to the assistant
145
+ * being idle) need the event regardless of whether the user is interacting with the chat
146
+ * in the main tab or a popout window. Tab-local-only telemetry can subscribe and filter.
142
147
  * - `chat-popout` / `chat-popin` are in-memory only — they must only affect the tab where the
143
148
  * user clicked.
144
149
  *
145
150
  * @beta
146
151
  */
147
152
  export const agenticActivityBus = new AgenticActivityBus({
148
- crossTabEvents: ['halo-start', 'halo-stop'],
153
+ crossTabEvents: ['halo-start', 'halo-stop', 'tool-loop-start', 'tool-loop-end'],
149
154
  channelName: getTabScopedChannelName('foundation-ai-activity'),
150
155
  });
@@ -21,4 +21,44 @@ export interface AgenticActivityEvents {
21
21
  'chat-popout': undefined;
22
22
  /** Fired when the user clicks the collapse button — moves assistant from layout back to bubble. State lives in the session store, not in this event. */
23
23
  'chat-popin': undefined;
24
+ /**
25
+ * Fired immediately before the tool loop begins running for the current turn — after the busy
26
+ * flag is set and the user message (if any) has been appended, but before the first
27
+ * provider call. Pairs with {@link AgenticActivityEvents.'tool-loop-end'}.
28
+ *
29
+ * Boundary: this is the moment the assistant takes control from the user on the **main chat
30
+ * prompt** to begin a turn. It is **not** fired when a tool handler temporarily hands a
31
+ * widget to the user mid-loop (e.g. `requestInteraction` pausing a handler while a planning
32
+ * widget is rendered) — those widget pauses happen inside the loop and the assistant is
33
+ * still considered to own the turn.
34
+ *
35
+ * Fires from each `ChatDriver`'s `sendMessage` and `continueFromHistory`, so during a
36
+ * multi-agent handoff orchestrated by `OrchestratingDriver` it fires once per agent
37
+ * the orchestrator hands off to.
38
+ *
39
+ * Distinct from {@link AgenticActivityEvents.'halo-start'} — the halo event is keyed to
40
+ * tool-call messages arriving in the stream (UI animation concern), not to the loop boundary
41
+ * itself. Use this event for hooks tied to a turn beginning (telemetry, transient UI gates).
42
+ */
43
+ 'tool-loop-start': undefined;
44
+ /**
45
+ * Fired when the tool loop completes for the current turn and control returns to the user
46
+ * on the **main chat prompt** (i.e. the next free-form user message can now be accepted).
47
+ *
48
+ * Boundary: this is the moment the user regains control of the main chat input. It is
49
+ * **not** fired when a tool handler hands a widget to the user mid-loop (e.g. while a
50
+ * planning widget is awaiting a click) — widget pauses are still inside the loop, the
51
+ * assistant still owns the turn, and the main chat input may be hidden during them. Wait
52
+ * for this event when you need to know that the assistant is fully idle and the user can
53
+ * type freely again.
54
+ *
55
+ * Emitted from the finally block of each `ChatDriver`'s `sendMessage` and
56
+ * `continueFromHistory`, so a multi-agent handoff fires this event once per agent.
57
+ *
58
+ * Distinct from {@link AgenticActivityEvents.'halo-stop'} — the halo event tracks the
59
+ * spinner animation lifecycle (which can flap mid-turn as tool calls resolve), whereas
60
+ * this event is a one-shot per turn boundary. Use this for hooks tied to a turn ending
61
+ * (telemetry flushes, post-turn workspace transitions, deferred state recomputation).
62
+ */
63
+ 'tool-loop-end': undefined;
24
64
  }
@@ -11,6 +11,7 @@ import type {
11
11
  SubAgentRequestOptions,
12
12
  } from '@genesislcap/foundation-ai';
13
13
  import { MalformedFunctionCallError } from '@genesislcap/foundation-ai';
14
+ import { agenticActivityBus } from '../../channel/ai-activity-bus';
14
15
  import type {
15
16
  AgentConfig,
16
17
  SystemPromptContext,
@@ -560,6 +561,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
560
561
  this.subAgentCompletion = undefined;
561
562
  this.agentReleaseRequested = false;
562
563
  this.appendToHistory({ role: 'user', content: userInput, attachments });
564
+ agenticActivityBus.publish('tool-loop-start', undefined);
563
565
 
564
566
  try {
565
567
  return await this.runToolLoop(userInput, attachments);
@@ -569,6 +571,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
569
571
  return { reason: 'done' };
570
572
  } finally {
571
573
  this.busy = false;
574
+ agenticActivityBus.publish('tool-loop-end', undefined);
572
575
  }
573
576
  }
574
577
 
@@ -721,6 +724,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
721
724
 
722
725
  this.busy = true;
723
726
  this.subAgentCompletion = undefined;
727
+ agenticActivityBus.publish('tool-loop-start', undefined);
724
728
  try {
725
729
  return await this.runToolLoop('', undefined, transientPrimer);
726
730
  } catch (e) {
@@ -729,6 +733,7 @@ export class ChatDriver extends EventTarget implements AiDriver {
729
733
  return { reason: 'done' };
730
734
  } finally {
731
735
  this.busy = false;
736
+ agenticActivityBus.publish('tool-loop-end', undefined);
732
737
  }
733
738
  }
734
739