@genesislcap/ai-assistant 15.27.0 → 15.27.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.
@@ -3338,11 +3338,11 @@
3338
3338
  {
3339
3339
  "kind": "MethodSignature",
3340
3340
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#getActiveAgent:member(1)",
3341
- "docComment": "/**\n * The live `AgentConfig` currently active in the driver — the instance whose `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live state. Prefer this over looking the agent up in the host's `agents` array, which may mint fresh, never-activated configs.\n *\n * `undefined` means no agent is active (before the first activation, after a release), which is a different statement from the driver not being able to answer. Both drivers implement it since GENC-1580; see {@link AiDriver.primeRestoredAgentState} for why the `?` stays for now.\n */\n",
3341
+ "docComment": "/**\n * The live `AgentConfig` currently active in the driver — the instance whose `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live state. Prefer this over looking the agent up in the host's `agents` array, which may mint fresh, never-activated configs.\n *\n * `undefined` means no agent is active (before the first activation, after a release), which is a different statement from the driver not being able to answer — and since GENC-1580's breaking release the second case cannot arise, because the method is required.\n */\n",
3342
3342
  "excerptTokens": [
3343
3343
  {
3344
3344
  "kind": "Content",
3345
- "text": "getActiveAgent?(): "
3345
+ "text": "getActiveAgent(): "
3346
3346
  },
3347
3347
  {
3348
3348
  "kind": "Reference",
@@ -3358,7 +3358,7 @@
3358
3358
  "text": ";"
3359
3359
  }
3360
3360
  ],
3361
- "isOptional": true,
3361
+ "isOptional": false,
3362
3362
  "returnTypeTokenRange": {
3363
3363
  "startIndex": 1,
3364
3364
  "endIndex": 3
@@ -3901,11 +3901,11 @@
3901
3901
  {
3902
3902
  "kind": "MethodSignature",
3903
3903
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#primeRestoredAgentState:member(1)",
3904
- "docComment": "/**\n * Prime per-agent restored state for a session being rehydrated. Each entry (keyed by agent name) is handed to that agent's `onActivate`/`init` as `ctx.restored` on its next activation, then consumed.\n *\n * Implemented by every driver since GENC-1580 — each owns an `AgentSession` — so \"only multi-agent drivers implement it\" is no longer true. Still declared optional: this interface is exported and `@beta`, so requiring it would break any third party implementing it. The `?` comes off with the `installAgent` rename, which is the ticket's one breaking release.\n */\n",
3904
+ "docComment": "/**\n * Prime per-agent restored state for a session being rehydrated. Each entry (keyed by agent name) is handed to that agent's `onActivate`/`init` as `ctx.restored` on its next activation, then consumed.\n *\n * Required since GENC-1580's breaking release: every driver owns an `AgentSession`, so both shipped drivers implement it and a host no longer has to feature-detect before restoring.\n */\n",
3905
3905
  "excerptTokens": [
3906
3906
  {
3907
3907
  "kind": "Content",
3908
- "text": "primeRestoredAgentState?(snapshots: "
3908
+ "text": "primeRestoredAgentState(snapshots: "
3909
3909
  },
3910
3910
  {
3911
3911
  "kind": "Reference",
@@ -3929,7 +3929,7 @@
3929
3929
  "text": ";"
3930
3930
  }
3931
3931
  ],
3932
- "isOptional": true,
3932
+ "isOptional": false,
3933
3933
  "returnTypeTokenRange": {
3934
3934
  "startIndex": 4,
3935
3935
  "endIndex": 5
@@ -4199,11 +4199,11 @@
4199
4199
  {
4200
4200
  "kind": "MethodSignature",
4201
4201
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#setFlowOwner:member(1)",
4202
- "docComment": "/**\n * Set the transient flow lock — used to restore state on driver reconstruction (agents-array changes, pop-in/pop-out), **not** to steer routing; that is {@link AiDriver.setPinnedAgent}'s job. Writes without firing lifecycle hooks, because the flow it names is already running.\n *\n * Added to the interface in GENC-1580, as for {@link AiDriver.setPinnedAgent}.\n */\n",
4202
+ "docComment": "/**\n * Set the transient flow lock — used to restore state on driver reconstruction (agents-array changes, pop-in/pop-out), **not** to steer routing; that is {@link AiDriver.setPinnedAgent}'s job. Writes without firing lifecycle hooks, because the flow it names is already running.\n *\n * Added to the interface in GENC-1580, as for {@link AiDriver.setPinnedAgent}, and required since that ticket's breaking release.\n */\n",
4203
4203
  "excerptTokens": [
4204
4204
  {
4205
4205
  "kind": "Content",
4206
- "text": "setFlowOwner?(name: "
4206
+ "text": "setFlowOwner(name: "
4207
4207
  },
4208
4208
  {
4209
4209
  "kind": "Content",
@@ -4222,7 +4222,7 @@
4222
4222
  "text": ";"
4223
4223
  }
4224
4224
  ],
4225
- "isOptional": true,
4225
+ "isOptional": false,
4226
4226
  "returnTypeTokenRange": {
4227
4227
  "startIndex": 3,
4228
4228
  "endIndex": 4
@@ -4244,11 +4244,11 @@
4244
4244
  {
4245
4245
  "kind": "MethodSignature",
4246
4246
  "canonicalReference": "@genesislcap/ai-assistant!AiDriver#setPinnedAgent:member(1)",
4247
- "docComment": "/**\n * Pin routing to an agent by name, or `null` for automatic routing. A pin is sticky: it survives a stateful flow completing, so the next turn starts fresh on the same agent.\n *\n * On a driver with nothing to route between this is recorded rather than acted on — the pick belongs to the session, which outlives the question of which driver holds it.\n *\n * Added to the interface in GENC-1580 — it was previously reached by narrowing to `OrchestratingDriver` with `instanceof`. Optional, so adding it breaks no implementor.\n */\n",
4247
+ "docComment": "/**\n * Pin routing to an agent by name, or `null` for automatic routing. A pin is sticky: it survives a stateful flow completing, so the next turn starts fresh on the same agent.\n *\n * On a driver with nothing to route between this is recorded rather than acted on — the pick belongs to the session, which outlives the question of which driver holds it.\n *\n * Added to the interface in GENC-1580 — it was previously reached by narrowing to `OrchestratingDriver` with `instanceof`. Required since that ticket's breaking release.\n */\n",
4248
4248
  "excerptTokens": [
4249
4249
  {
4250
4250
  "kind": "Content",
4251
- "text": "setPinnedAgent?(name: "
4251
+ "text": "setPinnedAgent(name: "
4252
4252
  },
4253
4253
  {
4254
4254
  "kind": "Content",
@@ -4267,7 +4267,7 @@
4267
4267
  "text": ";"
4268
4268
  }
4269
4269
  ],
4270
- "isOptional": true,
4270
+ "isOptional": false,
4271
4271
  "returnTypeTokenRange": {
4272
4272
  "startIndex": 3,
4273
4273
  "endIndex": 4
@@ -5318,7 +5318,7 @@
5318
5318
  {
5319
5319
  "kind": "Method",
5320
5320
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#activateAgent:member(1)",
5321
- "docComment": "/**\n * Make `config` the active agent, firing its lifecycle hooks — `onDeactivate` on the outgoing agent, then `onActivate` on this one — before installing it.\n *\n * This is the entry point a host should use. {@link ChatDriver.applyAgent} installs a config *without* firing hooks, which is right for the two callers that need it (the orchestrator, which fires them through the shared session, and `invokeSubAgent`, where a child's config is not an activation) and wrong for everyone else.\n *\n * @beta\n */\n",
5321
+ "docComment": "/**\n * Make `config` the active agent, firing its lifecycle hooks — `onDeactivate` on the outgoing agent, then `onActivate` on this one — before installing it.\n *\n * This is the entry point a host should use. {@link ChatDriver.installAgent} installs a config *without* firing hooks, which is right for the two callers that need it (the orchestrator, which fires them through the shared session, and `invokeSubAgent`, where a child's config is not an activation) and wrong for everyone else.\n *\n * @beta\n */\n",
5322
5322
  "excerptTokens": [
5323
5323
  {
5324
5324
  "kind": "Content",
@@ -5369,55 +5369,6 @@
5369
5369
  "isAbstract": false,
5370
5370
  "name": "activateAgent"
5371
5371
  },
5372
- {
5373
- "kind": "Method",
5374
- "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#applyAgent:member(1)",
5375
- "docComment": "/**\n * Install `config` as the active agent **without firing lifecycle hooks**.\n *\n * Prefer {@link ChatDriver.activateAgent} unless you are deliberately skipping the hooks. Two callers are: `OrchestratingDriver`, which fires them through the shared {@link ChatDriver.agentSession} and then installs a decorated config, and `invokeSubAgent`, where the child driver's config is a tool surface rather than an activation.\n *\n * Renamed to `installAgent` in a follow-up (GENC-1580) — see `docs/migration-GENC-1580.md`. Until then the name says less than it should, so do not add a third caller to this path without checking which of the two above it resembles.\n */\n",
5376
- "excerptTokens": [
5377
- {
5378
- "kind": "Content",
5379
- "text": "applyAgent(config: "
5380
- },
5381
- {
5382
- "kind": "Reference",
5383
- "text": "AgentConfig",
5384
- "canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
5385
- },
5386
- {
5387
- "kind": "Content",
5388
- "text": "): "
5389
- },
5390
- {
5391
- "kind": "Content",
5392
- "text": "void"
5393
- },
5394
- {
5395
- "kind": "Content",
5396
- "text": ";"
5397
- }
5398
- ],
5399
- "isStatic": false,
5400
- "returnTypeTokenRange": {
5401
- "startIndex": 3,
5402
- "endIndex": 4
5403
- },
5404
- "releaseTag": "Public",
5405
- "isProtected": false,
5406
- "overloadIndex": 1,
5407
- "parameters": [
5408
- {
5409
- "parameterName": "config",
5410
- "parameterTypeTokenRange": {
5411
- "startIndex": 1,
5412
- "endIndex": 2
5413
- },
5414
- "isOptional": false
5415
- }
5416
- ],
5417
- "isOptional": false,
5418
- "isAbstract": false,
5419
- "name": "applyAgent"
5420
- },
5421
5372
  {
5422
5373
  "kind": "Method",
5423
5374
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#cancel:member(1)",
@@ -5667,7 +5618,7 @@
5667
5618
  {
5668
5619
  "kind": "Method",
5669
5620
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#getActiveAgent:member(1)",
5670
- "docComment": "/**\n * The live `AgentConfig` currently active in the driver — the instance whose `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live state. Prefer this over looking the agent up in the host's `agents` array, which may mint fresh, never-activated configs.\n *\n * `undefined` means no agent is active (before the first activation, after a release), which is a different statement from the driver not being able to answer. Both drivers implement it since GENC-1580; see {@link AiDriver.primeRestoredAgentState} for why the `?` stays for now.\n *\n * @beta\n */\n",
5621
+ "docComment": "/**\n * The live `AgentConfig` currently active in the driver — the instance whose `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live state. Prefer this over looking the agent up in the host's `agents` array, which may mint fresh, never-activated configs.\n *\n * `undefined` means no agent is active (before the first activation, after a release), which is a different statement from the driver not being able to answer — and since GENC-1580's breaking release the second case cannot arise, because the method is required.\n *\n * @beta\n */\n",
5671
5622
  "excerptTokens": [
5672
5623
  {
5673
5624
  "kind": "Content",
@@ -6342,6 +6293,55 @@
6342
6293
  "isAbstract": false,
6343
6294
  "name": "getTurnSnapshots"
6344
6295
  },
6296
+ {
6297
+ "kind": "Method",
6298
+ "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#installAgent:member(1)",
6299
+ "docComment": "/**\n * Install `config` as the active agent **without firing lifecycle hooks**.\n *\n * Prefer {@link ChatDriver.activateAgent} unless you are deliberately skipping the hooks. Two callers are: `OrchestratingDriver`, which fires them through the shared {@link ChatDriver.agentSession} and then installs a decorated config, and `invokeSubAgent`, where the child driver's config is a tool surface rather than an activation.\n *\n * Do not add a third caller to this path without checking which of the two above it resembles — whether the hooks should fire is the whole difference between this and `activateAgent`.\n */\n",
6300
+ "excerptTokens": [
6301
+ {
6302
+ "kind": "Content",
6303
+ "text": "installAgent(config: "
6304
+ },
6305
+ {
6306
+ "kind": "Reference",
6307
+ "text": "AgentConfig",
6308
+ "canonicalReference": "@genesislcap/ai-assistant!AgentConfig:type"
6309
+ },
6310
+ {
6311
+ "kind": "Content",
6312
+ "text": "): "
6313
+ },
6314
+ {
6315
+ "kind": "Content",
6316
+ "text": "void"
6317
+ },
6318
+ {
6319
+ "kind": "Content",
6320
+ "text": ";"
6321
+ }
6322
+ ],
6323
+ "isStatic": false,
6324
+ "returnTypeTokenRange": {
6325
+ "startIndex": 3,
6326
+ "endIndex": 4
6327
+ },
6328
+ "releaseTag": "Public",
6329
+ "isProtected": false,
6330
+ "overloadIndex": 1,
6331
+ "parameters": [
6332
+ {
6333
+ "parameterName": "config",
6334
+ "parameterTypeTokenRange": {
6335
+ "startIndex": 1,
6336
+ "endIndex": 2
6337
+ },
6338
+ "isOptional": false
6339
+ }
6340
+ ],
6341
+ "isOptional": false,
6342
+ "isAbstract": false,
6343
+ "name": "installAgent"
6344
+ },
6345
6345
  {
6346
6346
  "kind": "Method",
6347
6347
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#isBusy:member(1)",
@@ -6460,7 +6460,7 @@
6460
6460
  {
6461
6461
  "kind": "Method",
6462
6462
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriver#primeRestoredAgentState:member(1)",
6463
- "docComment": "/**\n * Prime per-agent restored state for a session being rehydrated. Each entry (keyed by agent name) is handed to that agent's `onActivate`/`init` as `ctx.restored` on its next activation, then consumed.\n *\n * Implemented by every driver since GENC-1580 — each owns an `AgentSession` — so \"only multi-agent drivers implement it\" is no longer true. Still declared optional: this interface is exported and `@beta`, so requiring it would break any third party implementing it. The `?` comes off with the `installAgent` rename, which is the ticket's one breaking release.\n */\n",
6463
+ "docComment": "/**\n * Prime per-agent restored state for a session being rehydrated. Each entry (keyed by agent name) is handed to that agent's `onActivate`/`init` as `ctx.restored` on its next activation, then consumed.\n *\n * Required since GENC-1580's breaking release: every driver owns an `AgentSession`, so both shipped drivers implement it and a host no longer has to feature-detect before restoring.\n */\n",
6464
6464
  "excerptTokens": [
6465
6465
  {
6466
6466
  "kind": "Content",
@@ -7179,7 +7179,7 @@
7179
7179
  {
7180
7180
  "kind": "Interface",
7181
7181
  "canonicalReference": "@genesislcap/ai-assistant!ChatDriverConfig:interface",
7182
- "docComment": "/**\n * Construction-time configuration for {@link ChatDriver}. Everything except the provider registry is optional — most fields are also settable per-agent via `applyAgent`, so a bare `new ChatDriver(registry)` is valid. Mirrors the `(registry, options)` shape of `OrchestratingDriver`.\n *\n * @beta\n */\n",
7182
+ "docComment": "/**\n * Construction-time configuration for {@link ChatDriver}. Everything except the provider registry is optional — most fields are also settable per-agent via `installAgent`, so a bare `new ChatDriver(registry)` is valid. Mirrors the `(registry, options)` shape of `OrchestratingDriver`.\n *\n * @beta\n */\n",
7183
7183
  "excerptTokens": [
7184
7184
  {
7185
7185
  "kind": "Content",
@@ -17064,7 +17064,7 @@
17064
17064
  {
17065
17065
  "kind": "Method",
17066
17066
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#getActiveAgent:member(1)",
17067
- "docComment": "/**\n * The live `AgentConfig` currently active in the driver — the instance whose `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live state. Prefer this over looking the agent up in the host's `agents` array, which may mint fresh, never-activated configs.\n *\n * `undefined` means no agent is active (before the first activation, after a release), which is a different statement from the driver not being able to answer. Both drivers implement it since GENC-1580; see {@link AiDriver.primeRestoredAgentState} for why the `?` stays for now.\n */\n",
17067
+ "docComment": "/**\n * The live `AgentConfig` currently active in the driver — the instance whose `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live state. Prefer this over looking the agent up in the host's `agents` array, which may mint fresh, never-activated configs.\n *\n * `undefined` means no agent is active (before the first activation, after a release), which is a different statement from the driver not being able to answer — and since GENC-1580's breaking release the second case cannot arise, because the method is required.\n */\n",
17068
17068
  "excerptTokens": [
17069
17069
  {
17070
17070
  "kind": "Content",
@@ -17666,7 +17666,7 @@
17666
17666
  {
17667
17667
  "kind": "Method",
17668
17668
  "canonicalReference": "@genesislcap/ai-assistant!OrchestratingDriver#primeRestoredAgentState:member(1)",
17669
- "docComment": "/**\n * Prime per-agent restored state for a session being rehydrated. Each entry (keyed by agent name) is handed to that agent's `onActivate`/`init` as `ctx.restored` on its next activation, then consumed.\n *\n * Implemented by every driver since GENC-1580 — each owns an `AgentSession` — so \"only multi-agent drivers implement it\" is no longer true. Still declared optional: this interface is exported and `@beta`, so requiring it would break any third party implementing it. The `?` comes off with the `installAgent` rename, which is the ticket's one breaking release.\n */\n",
17669
+ "docComment": "/**\n * Prime per-agent restored state for a session being rehydrated. Each entry (keyed by agent name) is handed to that agent's `onActivate`/`init` as `ctx.restored` on its next activation, then consumed.\n *\n * Required since GENC-1580's breaking release: every driver owns an `AgentSession`, so both shipped drivers implement it and a host no longer has to feature-detect before restoring.\n */\n",
17670
17670
  "excerptTokens": [
17671
17671
  {
17672
17672
  "kind": "Content",
@@ -760,12 +760,10 @@ export declare interface AiDriver extends EventTarget {
760
760
  * (keyed by agent name) is handed to that agent's `onActivate`/`init` as
761
761
  * `ctx.restored` on its next activation, then consumed.
762
762
  *
763
- * Implemented by every driver since GENC-1580 — each owns an `AgentSession` — so "only
764
- * multi-agent drivers implement it" is no longer true. Still declared optional: this interface
765
- * is exported and `@beta`, so requiring it would break any third party implementing it. The `?`
766
- * comes off with the `installAgent` rename, which is the ticket's one breaking release.
763
+ * Required since GENC-1580's breaking release: every driver owns an `AgentSession`, so both
764
+ * shipped drivers implement it and a host no longer has to feature-detect before restoring.
767
765
  */
768
- primeRestoredAgentState?(snapshots: Record<string, unknown>): void;
766
+ primeRestoredAgentState(snapshots: Record<string, unknown>): void;
769
767
  /**
770
768
  * Return the full, unredacted conversation history.
771
769
  */
@@ -784,10 +782,10 @@ export declare interface AiDriver extends EventTarget {
784
782
  * which may mint fresh, never-activated configs.
785
783
  *
786
784
  * `undefined` means no agent is active (before the first activation, after a release), which is
787
- * a different statement from the driver not being able to answer. Both drivers implement it
788
- * since GENC-1580; see {@link AiDriver.primeRestoredAgentState} for why the `?` stays for now.
785
+ * a different statement from the driver not being able to answer — and since GENC-1580's
786
+ * breaking release the second case cannot arise, because the method is required.
789
787
  */
790
- getActiveAgent?(): AgentConfig | undefined;
788
+ getActiveAgent(): AgentConfig | undefined;
791
789
  /**
792
790
  * Pin routing to an agent by name, or `null` for automatic routing. A pin is sticky: it
793
791
  * survives a stateful flow completing, so the next turn starts fresh on the same agent.
@@ -796,18 +794,19 @@ export declare interface AiDriver extends EventTarget {
796
794
  * belongs to the session, which outlives the question of which driver holds it.
797
795
  *
798
796
  * Added to the interface in GENC-1580 — it was previously reached by narrowing to
799
- * `OrchestratingDriver` with `instanceof`. Optional, so adding it breaks no implementor.
797
+ * `OrchestratingDriver` with `instanceof`. Required since that ticket's breaking release.
800
798
  */
801
- setPinnedAgent?(name: string | null): void;
799
+ setPinnedAgent(name: string | null): void;
802
800
  /**
803
801
  * Set the transient flow lock — used to restore state on driver reconstruction (agents-array
804
802
  * changes, pop-in/pop-out), **not** to steer routing; that is
805
803
  * {@link AiDriver.setPinnedAgent}'s job. Writes without firing lifecycle hooks, because the
806
804
  * flow it names is already running.
807
805
  *
808
- * Added to the interface in GENC-1580, as for {@link AiDriver.setPinnedAgent}.
806
+ * Added to the interface in GENC-1580, as for {@link AiDriver.setPinnedAgent}, and required
807
+ * since that ticket's breaking release.
809
808
  */
810
- setFlowOwner?(name: string | null): void;
809
+ setFlowOwner(name: string | null): void;
811
810
  /**
812
811
  * Headroom the next turn could need, and which agent set that requirement
813
812
  * (GENC-1582). `undefined` when no agent the turn could land on declares a
@@ -1541,7 +1540,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1541
1540
  private turnSeq;
1542
1541
  /**
1543
1542
  * Monotonic agent-activation counter — the `agentEnd` clock. Advances when the
1544
- * active flow ends: a swap to a different-named agent (`applyAgent`) OR an
1543
+ * active flow ends: a swap to a different-named agent (`installAgent`) OR an
1545
1544
  * explicit `releaseAgent` / `completeSubAgent`. A stateful agent re-resolving
1546
1545
  * the same name across turns keeps one activation. `agentEnd` fires for a
1547
1546
  * payload once a LATER activation is current (`callActivation < currentActivation`)
@@ -1572,7 +1571,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1572
1571
  * Union of every tool name advertised at any point during the current agent
1573
1572
  * activation. Lets the unknown-tool path tell a *stale* call (a real tool from
1574
1573
  * an earlier state, now retired — or one an open exclusive fold is hiding)
1575
- * apart from a *hallucinated* one. Reset on agent swap in `applyAgent`.
1574
+ * apart from a *hallucinated* one. Reset on agent swap in `installAgent`.
1576
1575
  */
1577
1576
  private readonly everSeenToolNames;
1578
1577
  /**
@@ -1689,7 +1688,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1689
1688
  */
1690
1689
  private activeFallbacks?;
1691
1690
  /**
1692
- * Active agent's unresolved-tool hook, captured from `applyAgent`. Consulted
1691
+ * Active agent's unresolved-tool hook, captured from `installAgent`. Consulted
1693
1692
  * only when a tool call cannot be dispatched (a stale or hallucinated name);
1694
1693
  * `undefined` keeps the framework's default messages. See
1695
1694
  * `resolveUnresolvedToolContent`.
@@ -1697,7 +1696,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1697
1696
  private activeOnUnresolvedTool?;
1698
1697
  /**
1699
1698
  * Caches validated provider lookups per name within the current agent. Cleared
1700
- * by `applyAgent` so each new agent's static/function-resolved names are
1699
+ * by `installAgent` so each new agent's static/function-resolved names are
1701
1700
  * validated fresh.
1702
1701
  */
1703
1702
  private resolvedProviderCache;
@@ -1795,7 +1794,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1795
1794
  * would make that case stop ending the turn.
1796
1795
  *
1797
1796
  * It matters most for a sub-agent's wall. The child can sit on a different
1798
- * vendor from its parent — `applyAgent` reads `config.provider` — so without
1797
+ * vendor from its parent — `installAgent` reads `config.provider` — so without
1799
1798
  * this the parent's short-circuit reports `lastResolvedProvider`, i.e. the one
1800
1799
  * vendor that did NOT refuse. Under a mixed registry that walls Gemini because
1801
1800
  * an Anthropic child 402'd, and if those are the only two reachable vendors the
@@ -1924,7 +1923,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1924
1923
  * Make `config` the active agent, firing its lifecycle hooks — `onDeactivate` on the outgoing
1925
1924
  * agent, then `onActivate` on this one — before installing it.
1926
1925
  *
1927
- * This is the entry point a host should use. {@link ChatDriver.applyAgent} installs a config
1926
+ * This is the entry point a host should use. {@link ChatDriver.installAgent} installs a config
1928
1927
  * *without* firing hooks, which is right for the two callers that need it (the orchestrator,
1929
1928
  * which fires them through the shared session, and `invokeSubAgent`, where a child's config is
1930
1929
  * not an activation) and wrong for everyone else.
@@ -1967,11 +1966,10 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1967
1966
  * {@link ChatDriver.agentSession} and then installs a decorated config, and `invokeSubAgent`,
1968
1967
  * where the child driver's config is a tool surface rather than an activation.
1969
1968
  *
1970
- * Renamed to `installAgent` in a follow-up (GENC-1580) — see `docs/migration-GENC-1580.md`.
1971
- * Until then the name says less than it should, so do not add a third caller to this path
1972
- * without checking which of the two above it resembles.
1969
+ * Do not add a third caller to this path without checking which of the two above it resembles —
1970
+ * whether the hooks should fire is the whole difference between this and `activateAgent`.
1973
1971
  */
1974
- applyAgent(config: AgentConfig): void;
1972
+ installAgent(config: AgentConfig): void;
1975
1973
  /**
1976
1974
  * Resolve the tool-result content for an unresolved tool call. Consults the
1977
1975
  * active agent's `onUnresolvedTool` hook (if any) with the attempted tool
@@ -2296,7 +2294,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
2296
2294
 
2297
2295
  /**
2298
2296
  * Construction-time configuration for {@link ChatDriver}. Everything except the provider
2299
- * registry is optional — most fields are also settable per-agent via `applyAgent`, so a
2297
+ * registry is optional — most fields are also settable per-agent via `installAgent`, so a
2300
2298
  * bare `new ChatDriver(registry)` is valid. Mirrors the `(registry, options)` shape of
2301
2299
  * `OrchestratingDriver`.
2302
2300
  *
@@ -4806,7 +4804,7 @@ export declare class OrchestratingDriver extends EventTarget implements AiDriver
4806
4804
  * **The inner driver's session, not one of our own.** One session is the invariant: two would
4807
4805
  * let the outer and inner driver disagree about which agent is active, and the inner one would
4808
4806
  * never be activated at all, because this driver installs a *decorated* config through
4809
- * `applyAgent` rather than going via `ChatDriver.activateAgent`. This driver keeps the routing
4807
+ * `installAgent` rather than going via `ChatDriver.activateAgent`. This driver keeps the routing
4810
4808
  * decisions; the session owns the lifecycle.
4811
4809
  */
4812
4810
  private get agentSession();
@@ -4913,7 +4911,7 @@ export declare class OrchestratingDriver extends EventTarget implements AiDriver
4913
4911
  getContextReserve(): ContextReserveResolution | undefined;
4914
4912
  /** {@inheritDoc AiDriver.getActiveAgent} */
4915
4913
  getActiveAgent(): AgentConfig | undefined;
4916
- private applyAgent;
4914
+ private installAgent;
4917
4915
  /**
4918
4916
  * Release the current stateful agent: fire `onDeactivate`, clear the
4919
4917
  * flow-owner lock, dispatch events so the host (and Redux) reflect the
@@ -5304,7 +5304,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
5304
5304
  this.turnSeq = 0;
5305
5305
  /**
5306
5306
  * Monotonic agent-activation counter — the `agentEnd` clock. Advances when the
5307
- * active flow ends: a swap to a different-named agent (`applyAgent`) OR an
5307
+ * active flow ends: a swap to a different-named agent (`installAgent`) OR an
5308
5308
  * explicit `releaseAgent` / `completeSubAgent`. A stateful agent re-resolving
5309
5309
  * the same name across turns keeps one activation. `agentEnd` fires for a
5310
5310
  * payload once a LATER activation is current (`callActivation < currentActivation`)
@@ -5345,7 +5345,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
5345
5345
  * Union of every tool name advertised at any point during the current agent
5346
5346
  * activation. Lets the unknown-tool path tell a *stale* call (a real tool from
5347
5347
  * an earlier state, now retired — or one an open exclusive fold is hiding)
5348
- * apart from a *hallucinated* one. Reset on agent swap in `applyAgent`.
5348
+ * apart from a *hallucinated* one. Reset on agent swap in `installAgent`.
5349
5349
  */
5350
5350
  this.everSeenToolNames = /* @__PURE__ */ new Set();
5351
5351
  /**
@@ -5396,7 +5396,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
5396
5396
  this.turnCancelled = false;
5397
5397
  /**
5398
5398
  * Caches validated provider lookups per name within the current agent. Cleared
5399
- * by `applyAgent` so each new agent's static/function-resolved names are
5399
+ * by `installAgent` so each new agent's static/function-resolved names are
5400
5400
  * validated fresh.
5401
5401
  */
5402
5402
  this.resolvedProviderCache = /* @__PURE__ */ new Map();
@@ -5702,7 +5702,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
5702
5702
  * Make `config` the active agent, firing its lifecycle hooks — `onDeactivate` on the outgoing
5703
5703
  * agent, then `onActivate` on this one — before installing it.
5704
5704
  *
5705
- * This is the entry point a host should use. {@link ChatDriver.applyAgent} installs a config
5705
+ * This is the entry point a host should use. {@link ChatDriver.installAgent} installs a config
5706
5706
  * *without* firing hooks, which is right for the two callers that need it (the orchestrator,
5707
5707
  * which fires them through the shared session, and `invokeSubAgent`, where a child's config is
5708
5708
  * not an activation) and wrong for everyone else.
@@ -5711,7 +5711,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
5711
5711
  */
5712
5712
  async activateAgent(config) {
5713
5713
  await this.agentSession.activate(config);
5714
- this.applyAgent(config);
5714
+ this.installAgent(config);
5715
5715
  }
5716
5716
  /**
5717
5717
  * {@inheritDoc AiDriver.getActiveAgent}
@@ -5756,11 +5756,10 @@ var ChatDriver = class _ChatDriver extends EventTarget {
5756
5756
  * {@link ChatDriver.agentSession} and then installs a decorated config, and `invokeSubAgent`,
5757
5757
  * where the child driver's config is a tool surface rather than an activation.
5758
5758
  *
5759
- * Renamed to `installAgent` in a follow-up (GENC-1580) — see `docs/migration-GENC-1580.md`.
5760
- * Until then the name says less than it should, so do not add a third caller to this path
5761
- * without checking which of the two above it resembles.
5759
+ * Do not add a third caller to this path without checking which of the two above it resembles —
5760
+ * whether the hooks should fire is the whole difference between this and `activateAgent`.
5762
5761
  */
5763
- applyAgent(config) {
5762
+ installAgent(config) {
5764
5763
  if (config.name !== this.activeAgentName) this.currentActivation += 1;
5765
5764
  this.systemPrompt = config.systemPrompt;
5766
5765
  if (typeof config.toolDefinitions === "function") {
@@ -6452,7 +6451,7 @@ var ChatDriver = class _ChatDriver extends EventTarget {
6452
6451
  } else {
6453
6452
  this.lifecycleController.signal.addEventListener("abort", disposeChild, { once: true });
6454
6453
  }
6455
- child.applyAgent({ ...subConfig, primerHistory: effectivePrimer });
6454
+ child.installAgent({ ...subConfig, primerHistory: effectivePrimer });
6456
6455
  child.setHostInteractionRequester(
6457
6456
  (componentName, data, opts) => this.requestInteraction(componentName, data, opts)
6458
6457
  );
@@ -7507,7 +7506,7 @@ var OrchestratingDriver = class extends EventTarget {
7507
7506
  * **The inner driver's session, not one of our own.** One session is the invariant: two would
7508
7507
  * let the outer and inner driver disagree about which agent is active, and the inner one would
7509
7508
  * never be activated at all, because this driver installs a *decorated* config through
7510
- * `applyAgent` rather than going via `ChatDriver.activateAgent`. This driver keeps the routing
7509
+ * `installAgent` rather than going via `ChatDriver.activateAgent`. This driver keeps the routing
7511
7510
  * decisions; the session owns the lifecycle.
7512
7511
  */
7513
7512
  get agentSession() {
@@ -7665,7 +7664,7 @@ var OrchestratingDriver = class extends EventTarget {
7665
7664
  let lastResult;
7666
7665
  while (true) {
7667
7666
  if (this.cancelled) break;
7668
- await this.applyAgent(currentAgent);
7667
+ await this.installAgent(currentAgent);
7669
7668
  let result;
7670
7669
  if (isHandoff) {
7671
7670
  const contextPrimer = handoffSummary ? [{ role: "user", content: `[Context from previous agent]: ${handoffSummary}` }] : [];
@@ -7747,7 +7746,7 @@ var OrchestratingDriver = class extends EventTarget {
7747
7746
  getActiveAgent() {
7748
7747
  return this.agentSession.getActive();
7749
7748
  }
7750
- async applyAgent(agent) {
7749
+ async installAgent(agent) {
7751
7750
  const { previousAgent, flowOwnerChangedTo } = await this.agentSession.activate(agent);
7752
7751
  if (flowOwnerChangedTo !== void 0) {
7753
7752
  this.dispatchEvent(new CustomEvent("flow-owner-changed", { detail: flowOwnerChangedTo }));
@@ -7772,7 +7771,7 @@ var OrchestratingDriver = class extends EventTarget {
7772
7771
  ]);
7773
7772
  }
7774
7773
  this.chatDriver.setProviderHistoryTransform((h) => transformHistoryForAgent(h, agent.name));
7775
- this.chatDriver.applyAgent(agentToApply);
7774
+ this.chatDriver.installAgent(agentToApply);
7776
7775
  this.dispatchEvent(new CustomEvent("orchestrating-stop"));
7777
7776
  this.dispatchEvent(new CustomEvent("agent-changed", { detail: agent }));
7778
7777
  }