@genesislcap/ai-assistant 15.24.2 → 15.26.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 (47) hide show
  1. package/dist/ai-assistant.api.json +1065 -33
  2. package/dist/ai-assistant.d.ts +288 -102
  3. package/dist/chat-driver.cjs +630 -378
  4. package/dist/chat-driver.cjs.map +4 -4
  5. package/dist/chat-driver.mjs +630 -378
  6. package/dist/chat-driver.mjs.map +4 -4
  7. package/dist/custom-elements.json +1198 -388
  8. package/dist/dts/components/agent-session/agent-session.d.ts +134 -0
  9. package/dist/dts/components/agent-session/agent-session.d.ts.map +1 -0
  10. package/dist/dts/components/agent-session/index.d.ts +2 -0
  11. package/dist/dts/components/agent-session/index.d.ts.map +1 -0
  12. package/dist/dts/components/ai-driver/ai-driver.d.ts +31 -4
  13. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  14. package/dist/dts/components/chat-driver/chat-driver.constants.d.ts +52 -0
  15. package/dist/dts/components/chat-driver/chat-driver.constants.d.ts.map +1 -0
  16. package/dist/dts/components/chat-driver/chat-driver.d.ts +100 -82
  17. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  18. package/dist/dts/components/chat-driver/fold-controller.d.ts +82 -0
  19. package/dist/dts/components/chat-driver/fold-controller.d.ts.map +1 -0
  20. package/dist/dts/components/chat-driver/turn-failures.d.ts +20 -1
  21. package/dist/dts/components/chat-driver/turn-failures.d.ts.map +1 -1
  22. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +14 -24
  23. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  24. package/dist/dts/index.d.ts +1 -0
  25. package/dist/dts/index.d.ts.map +1 -1
  26. package/dist/dts/main/main.d.ts +6 -16
  27. package/dist/dts/main/main.d.ts.map +1 -1
  28. package/dist/dts/suggestions/generate-suggestions.d.ts +35 -0
  29. package/dist/dts/suggestions/generate-suggestions.d.ts.map +1 -0
  30. package/dist/dts/utils/agents-key.d.ts +10 -0
  31. package/dist/dts/utils/agents-key.d.ts.map +1 -0
  32. package/dist/dts/utils/resolve-turn-input.d.ts +9 -0
  33. package/dist/dts/utils/resolve-turn-input.d.ts.map +1 -0
  34. package/dist/esm/components/agent-session/agent-session.js +208 -0
  35. package/dist/esm/components/agent-session/index.js +1 -0
  36. package/dist/esm/components/chat-driver/chat-driver.constants.js +72 -0
  37. package/dist/esm/components/chat-driver/chat-driver.js +190 -395
  38. package/dist/esm/components/chat-driver/fold-controller.js +184 -0
  39. package/dist/esm/components/chat-driver/turn-failures.js +14 -0
  40. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +48 -131
  41. package/dist/esm/index.js +1 -0
  42. package/dist/esm/main/main.js +11 -38
  43. package/dist/esm/suggestions/generate-suggestions.js +123 -0
  44. package/dist/esm/utils/agents-key.js +24 -0
  45. package/dist/esm/utils/resolve-turn-input.js +16 -0
  46. package/docs/migration-GENC-1580.md +44 -36
  47. package/package.json +16 -16
@@ -0,0 +1,134 @@
1
+ import type { AgentConfig } from '../../config/config';
2
+ /**
3
+ * What changed when an agent was activated or released.
4
+ *
5
+ * Returned rather than dispatched: the host listens on the `OrchestratingDriver`, not on the
6
+ * `ChatDriver` that owns the session, so a self-dispatching session would need telling which
7
+ * target to fire on.
8
+ *
9
+ * @beta
10
+ */
11
+ export interface AgentTransition {
12
+ /** The agent that was active before, if any. */
13
+ previousAgent?: AgentConfig;
14
+ /** True when the activation was a real swap rather than a re-apply of the same agent. */
15
+ switched: boolean;
16
+ /**
17
+ * Set when the flow-owner lock changed, to the value it changed *to* (`null` on release).
18
+ * `undefined` means unchanged — distinct from `null`, so a caller can tell "cleared" from
19
+ * "not touched" without re-reading.
20
+ */
21
+ flowOwnerChangedTo?: string | null;
22
+ }
23
+ /**
24
+ * Callbacks an {@link AgentSession} needs from its owner.
25
+ *
26
+ * @beta
27
+ */
28
+ export interface AgentSessionDeps {
29
+ /**
30
+ * The debug-log session key, read per call rather than captured: a driver's key is assigned
31
+ * after construction on some paths, so a value captured here would pin the wrong one.
32
+ */
33
+ sessionKey: () => string;
34
+ }
35
+ /**
36
+ * The stateful-agent contract: which agent is active, whether a flow or a user pin holds routing,
37
+ * and the `onActivate` / `onDeactivate` lifecycle around a swap. Either driver can own one.
38
+ *
39
+ * Knows nothing about routing, tool surfaces or transcripts — whether an agent is terminal, the
40
+ * continuation tool, the handoff marker in history all stay with the orchestrator, which is the
41
+ * only thing with agents to route between.
42
+ *
43
+ * @beta
44
+ */
45
+ export declare class AgentSession {
46
+ private readonly deps;
47
+ /**
48
+ * Aborted on disposal. Threaded into `AgentLifecycleContext.signal` so long-running
49
+ * `onActivate` work can bail if the session disconnects.
50
+ */
51
+ private readonly lifecycleAbortController;
52
+ private active?;
53
+ /**
54
+ * Sticky user pick from the picker (or the host's `setAgent` API). Only changes on explicit
55
+ * user action. Survives flow completion: when a stateful agent releases, the user-pin stays put
56
+ * and routing falls back to it on the next turn.
57
+ */
58
+ private pinned;
59
+ /**
60
+ * Transient flow lock — set when a stateful agent activates, cleared on release. While
61
+ * non-null, routing precedence goes to this agent and the picker is locked. Independent of
62
+ * the user pin so completing a flow doesn't wipe the user's sticky choice.
63
+ */
64
+ private flowOwner;
65
+ /**
66
+ * Per-agent restored state for a rehydrated session, keyed by agent name. Primed by the host on
67
+ * restore; each entry is passed to that agent's `onActivate` as `ctx.restored` on its next
68
+ * activation, then deleted so a later re-activation starts fresh.
69
+ */
70
+ private restoredStates;
71
+ constructor(deps: AgentSessionDeps);
72
+ /** The active agent, or `undefined` before the first activation and after a release. */
73
+ getActive(): AgentConfig | undefined;
74
+ /** The sticky user pin, or `null` for automatic routing. */
75
+ getPinned(): string | null;
76
+ /** The transient flow lock, or `null` when no flow holds routing. */
77
+ getFlowOwner(): string | null;
78
+ /**
79
+ * The name routing is locked to, flow lock first. A flow in progress outranks the user's
80
+ * sticky pick for the duration of the flow; neither being set means automatic routing.
81
+ */
82
+ getLockedName(): string | null;
83
+ /** Set the sticky user pin. `null` returns to automatic routing. */
84
+ setPinned(name: string | null): void;
85
+ /**
86
+ * Set the flow-owner lock directly — used to restore state on driver reconstruction
87
+ * (agents-array changes, pop-in/pop-out), not to steer routing. Writes without firing hooks or
88
+ * reporting a transition, because the flow it names is already running.
89
+ */
90
+ setFlowOwner(name: string | null): void;
91
+ /** Prime per-agent restored state for a rehydrated session. Replaces any pending entries. */
92
+ primeRestoredStates(snapshots: Record<string, unknown>): void;
93
+ /** Whether a restored snapshot is waiting for this agent's next activation. */
94
+ hasRestoredState(agentName: string): boolean;
95
+ /**
96
+ * Make `agent` active, firing the lifecycle hooks around the swap: outgoing `onDeactivate`
97
+ * first, then incoming `onActivate`. Both are awaited so heavy activation work (a machine
98
+ * restore, say) completes before the agent's first turn runs, and a throw from either is logged
99
+ * rather than propagated — an agent whose hook fails still activates.
100
+ *
101
+ * Re-activating the same agent by name is not a switch: no hooks fire, no lock moves, and no
102
+ * handoff is recorded. That guard matters because a per-turn re-resolve calls through here.
103
+ */
104
+ activate(agent: AgentConfig): Promise<AgentTransition>;
105
+ /**
106
+ * Release the active agent: fire `onDeactivate` and drop the flow lock.
107
+ *
108
+ * The user pin is intentionally **not** cleared — someone who explicitly picked this agent
109
+ * should stay on it after the flow ends, so the next message starts a fresh flow on the same
110
+ * agent rather than routing through the classifier.
111
+ *
112
+ * Returns `undefined` when there was no active agent, so a caller can skip its events.
113
+ */
114
+ release(): Promise<AgentTransition | undefined>;
115
+ /**
116
+ * Fire `onDeactivate` on the active agent and abort pending lifecycle work, for session
117
+ * teardown, so machines release resources cleanly. The session is not reusable afterwards: the
118
+ * abort signal stays aborted, so a later `activate` would hand its hook a dead signal.
119
+ *
120
+ * `onDeactivate` runs **before** the abort, deliberately: teardown that needs to flush state
121
+ * would otherwise be handed an already-aborted signal and have to skip its own work. The cost is
122
+ * that an `onActivate` still in flight keeps running until `onDeactivate` finishes — both hold
123
+ * the same signal. Acceptable because the two are sequenced by `activate`, so overlap only
124
+ * happens if a hook resolves before the work it started; a hook that must stop immediately
125
+ * should own its own cancellation.
126
+ */
127
+ dispose(): Promise<void>;
128
+ /**
129
+ * The one place `onDeactivate` is invoked. `reason` only reaches the warning text, which is what
130
+ * tells a log reader which path fired.
131
+ */
132
+ private fireDeactivate;
133
+ }
134
+ //# sourceMappingURL=agent-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-session.d.ts","sourceRoot":"","sources":["../../../../src/components/agent-session/agent-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,UAAU,EAAE,MAAM,MAAM,CAAC;CAC1B;AAKD;;;;;;;;;GASG;AACH,qBAAa,YAAY;IA8BX,OAAO,CAAC,QAAQ,CAAC,IAAI;IA7BjC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAyB;IAElE,OAAO,CAAC,MAAM,CAAC,CAAc;IAE7B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAuB;IAErC;;;;OAIG;IACH,OAAO,CAAC,SAAS,CAAuB;IAExC;;;;OAIG;IACH,OAAO,CAAC,cAAc,CAA+B;gBAExB,IAAI,EAAE,gBAAgB;IAEnD,wFAAwF;IACxF,SAAS,IAAI,WAAW,GAAG,SAAS;IAIpC,4DAA4D;IAC5D,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B,qEAAqE;IACrE,YAAY,IAAI,MAAM,GAAG,IAAI;IAI7B;;;OAGG;IACH,aAAa,IAAI,MAAM,GAAG,IAAI;IAI9B,oEAAoE;IACpE,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpC;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIvC,6FAA6F;IAC7F,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI7D,+EAA+E;IAC/E,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI5C;;;;;;;;OAQG;IACG,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC;IAkD5D;;;;;;;;OAQG;IACG,OAAO,IAAI,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAarD;;;;;;;;;;;OAWG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAO9B;;;OAGG;YACW,cAAc;CAgB7B"}
@@ -0,0 +1,2 @@
1
+ export * from './agent-session';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/agent-session/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -93,8 +93,12 @@ export interface AiDriver extends EventTarget {
93
93
  /**
94
94
  * Prime per-agent restored state for a session being rehydrated. Each entry
95
95
  * (keyed by agent name) is handed to that agent's `onActivate`/`init` as
96
- * `ctx.restored` on its next activation, then consumed. Optional — only
97
- * multi-agent drivers that own agent activation implement it.
96
+ * `ctx.restored` on its next activation, then consumed.
97
+ *
98
+ * Implemented by every driver since GENC-1580 — each owns an `AgentSession` — so "only
99
+ * multi-agent drivers implement it" is no longer true. Still declared optional: this interface
100
+ * is exported and `@beta`, so requiring it would break any third party implementing it. The `?`
101
+ * comes off with the `installAgent` rename, which is the ticket's one breaking release.
98
102
  */
99
103
  primeRestoredAgentState?(snapshots: Record<string, unknown>): void;
100
104
  /**
@@ -112,10 +116,33 @@ export interface AiDriver extends EventTarget {
112
116
  * The live `AgentConfig` currently active in the driver — the instance whose
113
117
  * `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live
114
118
  * state. Prefer this over looking the agent up in the host's `agents` array,
115
- * which may mint fresh, never-activated configs. Optional — only drivers that
116
- * retain the active config implement it.
119
+ * which may mint fresh, never-activated configs.
120
+ *
121
+ * `undefined` means no agent is active (before the first activation, after a release), which is
122
+ * a different statement from the driver not being able to answer. Both drivers implement it
123
+ * since GENC-1580; see {@link AiDriver.primeRestoredAgentState} for why the `?` stays for now.
117
124
  */
118
125
  getActiveAgent?(): AgentConfig | undefined;
126
+ /**
127
+ * Pin routing to an agent by name, or `null` for automatic routing. A pin is sticky: it
128
+ * survives a stateful flow completing, so the next turn starts fresh on the same agent.
129
+ *
130
+ * On a driver with nothing to route between this is recorded rather than acted on — the pick
131
+ * belongs to the session, which outlives the question of which driver holds it.
132
+ *
133
+ * Added to the interface in GENC-1580 — it was previously reached by narrowing to
134
+ * `OrchestratingDriver` with `instanceof`. Optional, so adding it breaks no implementor.
135
+ */
136
+ setPinnedAgent?(name: string | null): void;
137
+ /**
138
+ * Set the transient flow lock — used to restore state on driver reconstruction (agents-array
139
+ * changes, pop-in/pop-out), **not** to steer routing; that is
140
+ * {@link AiDriver.setPinnedAgent}'s job. Writes without firing lifecycle hooks, because the
141
+ * flow it names is already running.
142
+ *
143
+ * Added to the interface in GENC-1580, as for {@link AiDriver.setPinnedAgent}.
144
+ */
145
+ setFlowOwner?(name: string | null): void;
119
146
  /**
120
147
  * Headroom the next turn could need, and which agent set that requirement
121
148
  * (GENC-1582). `undefined` when no agent the turn could land on declares a
@@ -1 +1 @@
1
- {"version":3,"file":"ai-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/ai-driver/ai-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EACnB,MAAM,4BAA4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AAC;IAEzC;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,IAAI,wBAAwB,GAAG,SAAS,CAAC;IAE3D;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB,CAAC,IAAI,MAAM,GAAG,SAAS,CAAC;IAEzC;;;;;;;;OAQG;IACH,eAAe,CAAC,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEpD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAEvE;;;;;;;;;OASG;IACH,iBAAiB,CAAC,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,oBAAoB,GAAG,IAAI,CAAC;IAEjF;;;;;OAKG;IACH,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IAEtD;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC;IAElB;;OAEG;IACH,cAAc,CACZ,OAAO,EAAE,WAAW,EAAE,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,eAAe,EAAE,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAErB;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,aAAa,CAAC,YAAY,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,sBAAsB,CAAC,IAAI,aAAa,CAAC,eAAe,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,qBAAqB,IAAI,MAAM,CAAC;IAEhC;;;;OAIG;IACH,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,IAAI,CAAC;CACjB"}
@@ -0,0 +1,52 @@
1
+ import type { MetaEventType } from '../../state/debug-event-log';
2
+ /** Tuning constants for the tool loop — caps, retry ceilings, and the two retry nudges. */
3
+ export declare const DEFAULT_MAX_TOOL_ITERATIONS = 50;
4
+ export declare const DEFAULT_MAX_FOLD_OPERATIONS = 5;
5
+ export declare const DEFAULT_MAX_TURN_SNAPSHOTS = 400;
6
+ export declare const DEFAULT_MAX_UNKNOWN_TOOL_CALLS = 5;
7
+ export declare const MAX_STALE_TOOL_CALLS: number;
8
+ export declare const MAX_MALFORMED_RETRIES = 5;
9
+ export declare const MAX_EMPTY_RESPONSE_RETRIES = 3;
10
+ /**
11
+ * Framed-tail nudge added to a retry after a MALFORMED tool call.
12
+ *
13
+ * Exported so tests can assert placement (framed tail, never the system prompt) without pinning
14
+ * the wording — the copy is a prompt, and a prompt should be free to improve.
15
+ *
16
+ * @beta
17
+ */
18
+ export declare const MALFORMED_CALL_NUDGE = "IMPORTANT: Use only the structured function-call API to invoke tools. Do not write Python code or use Python-style syntax to call tools.";
19
+ /**
20
+ * Framed-tail nudge added to a retry after an EMPTY response.
21
+ *
22
+ * Rewritten in GENC-1573. The previous copy ("You must respond to the user's message. Call the
23
+ * appropriate tool or provide a text response") told a model that had just returned nothing to
24
+ * respond, without naming the one exit available to an agent that genuinely cannot act: saying so.
25
+ * Across nine failures in the measured session it changed nothing — all 29 attempts came back at
26
+ * 8–9 output tokens — and most of those were on a tool-less agent, for which "call the appropriate
27
+ * tool" is not an option at all. This version names the honest answer explicitly.
28
+ *
29
+ * @beta
30
+ */
31
+ export declare const EMPTY_RESPONSE_NUDGE = "IMPORTANT: Your previous attempt returned nothing at all, which is never a valid response. Answer the user's last message now, in prose \u2014 even if all you can honestly say is that you cannot help with it and why. If a tool is the right way to answer, call it. Do not return an empty response.";
32
+ export declare const MAX_SETUP_TRANSPORT_RETRIES = 3;
33
+ /**
34
+ * Sub-agent meta events worth folding into the parent's debug timeline: the
35
+ * per-attempt and per-failure signals that do NOT otherwise surface in the
36
+ * sub-agent's (now hoisted) messages — a retried-away malformed/empty attempt
37
+ * produces no message, and the stale-vs-hallucinated/streak diagnostics live only
38
+ * on the event. High-volume, message-derivable events (turn.start/turn.end,
39
+ * provider.selected, context.updated) are intentionally excluded: read the
40
+ * sub-agent's hoisted messages for model/tokens/cost and turn-by-turn activity.
41
+ * See `ChatDriver.invokeSubAgent`.
42
+ */
43
+ export declare const HARVESTED_SUBAGENT_EVENTS: ReadonlySet<MetaEventType>;
44
+ /**
45
+ * Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver.
46
+ *
47
+ * @beta
48
+ */
49
+ export declare const REQUEST_CONTINUATION_TOOL = "request_continuation";
50
+ /** Paired in history for each `request_continuation` so tool_calls stay balanced for the provider. */
51
+ export declare const HANDOFF_TOOL_RESULT_PLACEHOLDER = "Handoff to another specialist \u2014 routing continues on the next turn.";
52
+ //# sourceMappingURL=chat-driver.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-driver.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,2FAA2F;AAE3F,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAS7C,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAC9C,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAKhD,eAAO,MAAM,oBAAoB,QAAqC,CAAC;AAIvE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,6IAC2G,CAAC;AAE7I;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,6SACsQ,CAAC;AAGxS,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,aAAa,CAK/D,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE,sGAAsG;AACtG,eAAO,MAAM,+BAA+B,6EAC2B,CAAC"}
@@ -6,7 +6,10 @@ import type { DiagnosticEntry } from '../../state/persistence/diagnostics';
6
6
  import type { InteractionContext } from '../../types/interaction-context';
7
7
  import { type CompactionProjection } from '../../utils/context-tokens';
8
8
  import { type CompactionPlanOptions } from '../../utils/history-transform';
9
+ import { AgentSession } from '../agent-session/agent-session';
9
10
  import type { AiDriver, AllAgentSummary } from '../ai-driver/ai-driver';
11
+ /** Re-exported so `from './chat-driver'` keeps resolving these. */
12
+ export { EMPTY_RESPONSE_NUDGE, MALFORMED_CALL_NUDGE, REQUEST_CONTINUATION_TOOL, } from './chat-driver.constants';
10
13
  /**
11
14
  * The `budget` payload carried on a `'budget-exhausted'` {@link ChatDriverResult}.
12
15
  * Derived from the type rather than restated so the two cannot drift.
@@ -18,30 +21,6 @@ type BudgetDetail = NonNullable<Extract<ChatDriverResult, {
18
21
  type ProviderRefusedDetail = NonNullable<Extract<ChatDriverResult, {
19
22
  reason: 'done';
20
23
  }>['providerRefused']>;
21
- /**
22
- * Framed-tail nudge added to a retry after a MALFORMED tool call.
23
- *
24
- * Exported so tests can assert placement (framed tail, never the system prompt) without pinning
25
- * the wording — the copy is a prompt, and a prompt should be free to improve.
26
- *
27
- * @beta
28
- */
29
- export declare const MALFORMED_CALL_NUDGE = "IMPORTANT: Use only the structured function-call API to invoke tools. Do not write Python code or use Python-style syntax to call tools.";
30
- /**
31
- * Framed-tail nudge added to a retry after an EMPTY response.
32
- *
33
- * Rewritten in GENC-1573. The previous copy ("You must respond to the user's message. Call the
34
- * appropriate tool or provide a text response") told a model that had just returned nothing to
35
- * respond, without naming the one exit available to an agent that genuinely cannot act: saying so.
36
- * Across nine failures in the measured session it changed nothing — all 29 attempts came back at
37
- * 8–9 output tokens — and most of those were on a tool-less agent, for which "call the appropriate
38
- * tool" is not an option at all. This version names the honest answer explicitly.
39
- *
40
- * @beta
41
- */
42
- export declare const EMPTY_RESPONSE_NUDGE = "IMPORTANT: Your previous attempt returned nothing at all, which is never a valid response. Answer the user's last message now, in prose \u2014 even if all you can honestly say is that you cannot help with it and why. If a tool is the right way to answer, call it. Do not return an empty response.";
43
- /** Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver. */
44
- export declare const REQUEST_CONTINUATION_TOOL = "request_continuation";
45
24
  /**
46
25
  * Event emitted when the chat history is updated (new message appended).
47
26
  *
@@ -73,11 +52,9 @@ export interface TurnSnapshot {
73
52
  /** Name of the agent active when this LLM call ran. */
74
53
  agentName?: string;
75
54
  /**
76
- * The agent's resolved system prompt sent to the LLM, verbatim. NOTE: this is
77
- * now the *bare* prompt — the fold-surface suffix and the malformed/empty retry
78
- * nudge no longer mutate it (they kept it byte-unstable and busted prompt
79
- * caching), so they moved to {@link TurnSnapshot.tailContext}. To reconstruct
80
- * exactly what the model saw, read both fields.
55
+ * The agent's resolved system prompt sent to the LLM, verbatim — the **bare** prompt. The
56
+ * fold-surface suffix and the retry nudges live in {@link TurnSnapshot.tailContext} instead, to
57
+ * keep this byte-stable for prompt caching; read both fields to reconstruct what the model saw.
81
58
  */
82
59
  systemPrompt?: string;
83
60
  /**
@@ -213,6 +190,19 @@ export interface ChatDriverConfig {
213
190
  * reversible change.
214
191
  */
215
192
  budgetExhaustedMessage?: string;
193
+ /**
194
+ * Leave acting on `releaseAgent` to the owner of this driver.
195
+ *
196
+ * Set by `OrchestratingDriver` for its inner driver, which performs the release itself after the
197
+ * turn so it can fire the host-facing `agent-released` / `agent-changed` / `flow-owner-changed`
198
+ * events. Both drivers share one `AgentSession`, so releasing here first would empty it and make
199
+ * the orchestrator's own release a silent no-op — leaving the host with a locked picker and a
200
+ * stale active agent.
201
+ *
202
+ * Left unset, a driver releases its own agent, which is what a bare `ChatDriver` needs: nothing
203
+ * else is watching the flag.
204
+ */
205
+ deferAgentRelease?: boolean;
216
206
  /**
217
207
  * Overrides the transcript sentence shown when the upstream PROVIDER refuses the account
218
208
  * (GENC-1506) — see `TURN_FAILURE_EXITS.providerRefused.copy`.
@@ -370,10 +360,8 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
370
360
  * (`callPhaseEpoch < currentPhaseEpoch`), with an `agentEnd` backstop.
371
361
  */
372
362
  private currentPhaseEpoch;
373
- /** Stack of fold frames — grows when a fold opens, shrinks when it closes. */
374
- private foldStack;
375
- /** Consecutive fold open/close ops without a real tool call. Reset on real tool execution. */
376
- private consecutiveFoldOps;
363
+ /** Tool folds: the open-fold stack, the no-progress counter, and the tool-surface swap. */
364
+ private readonly folds;
377
365
  /** Consecutive unknown-tool calls without a real tool call. Reset on real tool execution. */
378
366
  private consecutiveUnknownToolCalls;
379
367
  /**
@@ -575,6 +563,21 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
575
563
  private readonly condenseBatchCalls;
576
564
  /** Session identity used to file meta events onto the shared debug-log timeline. */
577
565
  private readonly sessionKey;
566
+ /** See {@link ChatDriverConfig.deferAgentRelease}. */
567
+ private readonly deferAgentRelease;
568
+ /**
569
+ * The stateful-agent contract for this driver: active agent, user pin, flow lock, restored
570
+ * state, and the `onActivate` / `onDeactivate` hooks (§7.1).
571
+ *
572
+ * **Public because `OrchestratingDriver` reaches through to it.** The orchestrator decorates a
573
+ * config before installing it (the cross-agent continuation tool), so it cannot route through
574
+ * {@link ChatDriver.activateAgent} and must drive the session itself — and one shared session is
575
+ * the point: two would let `getActiveAgent()` disagree between the outer and inner driver.
576
+ * `@internal` rather than private so that reach is legal without six delegating one-liners.
577
+ *
578
+ * @internal
579
+ */
580
+ readonly agentSession: AgentSession;
578
581
  /** Injected activity bus; defaults to a no-op off-browser (Node/tests/headless). */
579
582
  private readonly activityBus;
580
583
  /**
@@ -648,7 +651,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
648
651
  * interaction is instead settled by `resolveInteraction` (user response or
649
652
  * timeout), which also stamps history and reverts the chat-input override.
650
653
  */
651
- dispose(): void;
654
+ dispose(): Promise<void>;
652
655
  /**
653
656
  * Stop the current turn (user "stop" button). Aborts the in-flight provider
654
657
  * request immediately; if a tool is mid-execution it runs to completion and
@@ -669,15 +672,6 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
669
672
  * cached history would otherwise gain a stray marker on remount).
670
673
  */
671
674
  private completeAbortedTurn;
672
- /**
673
- * Build the `done` loop result, carrying the typed failure reason when the turn
674
- * bailed (PTC-0). The discriminant stays `'done'` either way — the same value a
675
- * clean turn returns — so consumers matching on `reason === 'done'` are unchanged;
676
- * `failureReason` is simply present on a failure and absent on success. Omitted
677
- * (rather than set to `undefined`) so a happy-path result stays byte-identical to
678
- * the historical `{ reason: 'done' }`.
679
- */
680
- private turnDone;
681
675
  /**
682
676
  * End the turn on a terminal failure: fail upward when this driver is a sub-agent, speak
683
677
  * to the user when it is not, and hand the reason to the caller either way.
@@ -752,8 +746,55 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
752
746
  */
753
747
  private loopEndDetail;
754
748
  /**
755
- * Swap in a new agent's configuration. Called by OrchestratingDriver before
756
- * each specialist turn so the shared driver runs with the right tools and prompt.
749
+ * Make `config` the active agent, firing its lifecycle hooks — `onDeactivate` on the outgoing
750
+ * agent, then `onActivate` on this one — before installing it.
751
+ *
752
+ * This is the entry point a host should use. {@link ChatDriver.applyAgent} installs a config
753
+ * *without* firing hooks, which is right for the two callers that need it (the orchestrator,
754
+ * which fires them through the shared session, and `invokeSubAgent`, where a child's config is
755
+ * not an activation) and wrong for everyone else.
756
+ *
757
+ * @beta
758
+ */
759
+ activateAgent(config: AgentConfig): Promise<void>;
760
+ /**
761
+ * {@inheritDoc AiDriver.getActiveAgent}
762
+ *
763
+ * @beta
764
+ */
765
+ getActiveAgent(): AgentConfig | undefined;
766
+ /** {@inheritDoc AiDriver.primeRestoredAgentState} */
767
+ primeRestoredAgentState(snapshots: Record<string, unknown>): void;
768
+ /**
769
+ * Record the sticky agent pin. See {@link AiDriver.setPinnedAgent} for the contract.
770
+ *
771
+ * Recorded, not acted on: this driver has one agent and nothing to route between, so a pin
772
+ * changes no behaviour here. It is still honoured as state, because the session outlives the
773
+ * question of which driver is holding it — a host that pins before an orchestrator is built
774
+ * would otherwise lose the pick.
775
+ *
776
+ * @beta
777
+ */
778
+ setPinnedAgent(name: string | null): void;
779
+ /**
780
+ * Record the transient flow lock. See {@link AiDriver.setFlowOwner} for the contract.
781
+ *
782
+ * Recorded, not acted on, for the same reason as {@link ChatDriver.setPinnedAgent}.
783
+ *
784
+ * @beta
785
+ */
786
+ setFlowOwner(name: string | null): void;
787
+ /**
788
+ * Install `config` as the active agent **without firing lifecycle hooks**.
789
+ *
790
+ * Prefer {@link ChatDriver.activateAgent} unless you are deliberately skipping the hooks. Two
791
+ * callers are: `OrchestratingDriver`, which fires them through the shared
792
+ * {@link ChatDriver.agentSession} and then installs a decorated config, and `invokeSubAgent`,
793
+ * where the child driver's config is a tool surface rather than an activation.
794
+ *
795
+ * Renamed to `installAgent` in a follow-up (GENC-1580) — see `docs/migration-GENC-1580.md`.
796
+ * Until then the name says less than it should, so do not add a third caller to this path
797
+ * without checking which of the two above it resembles.
757
798
  */
758
799
  applyAgent(config: AgentConfig): void;
759
800
  /**
@@ -791,12 +832,6 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
791
832
  * throw all yield empty fields — attribution is diagnostic, never load-bearing.
792
833
  */
793
834
  private resolveStatusForProvider;
794
- /**
795
- * Resolve a per-turn config input that is either a static value or a function
796
- * of the turn context — the value-or-resolver shape shared by `provider`,
797
- * `temperature`, and `toolChoice`. Returns undefined when the input is unset.
798
- */
799
- private resolveTurnInput;
800
835
  /**
801
836
  * Returns the early-stop result set by `completeSubAgent`, if any.
802
837
  * Called by a parent `ChatDriver` after running this instance as a sub-agent.
@@ -834,6 +869,15 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
834
869
  * Consumed by the orchestrator to trigger the auto-pin release path.
835
870
  */
836
871
  getAgentReleaseRequested(): boolean;
872
+ /**
873
+ * Act on a `releaseAgent` call from a tool handler: fire `onDeactivate` and drop the flow lock,
874
+ * so the next turn starts clean and the persister does not serialize a flow that is over.
875
+ *
876
+ * No-op when the owner handles release ({@link ChatDriverConfig.deferAgentRelease}). The flag is
877
+ * cleared here rather than only at the next `sendMessage`, so the signal cannot be acted on twice
878
+ * and release a later agent that never asked.
879
+ */
880
+ private releaseIfRequested;
837
881
  /**
838
882
  * Return the per-turn snapshots captured so far. Used by the host's debug
839
883
  * log exporter to show what the LLM saw on each turn — system prompt, tool
@@ -934,6 +978,11 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
934
978
  * unaffected — which is what makes the elision recoverable.
935
979
  */
936
980
  getHistoryForPersistence(): ChatMessage[];
981
+ /**
982
+ * {@inheritDoc AiDriver.getSuggestions}
983
+ *
984
+ * @beta
985
+ */
937
986
  getSuggestions(history: ChatMessage[], prompt: string, count: number, allAgentInfo?: AllAgentSummary[]): Promise<string[]>;
938
987
  /**
939
988
  * Whether `compact()` would do anything right now — a summarizable run of older
@@ -1083,36 +1132,6 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1083
1132
  * Used by OrchestratingDriver after an agent handoff.
1084
1133
  */
1085
1134
  continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
1086
- /** Extract ToolFold metadata from a handler, or undefined if it isn't a fold facade. */
1087
- private getFold;
1088
- /**
1089
- * Search all currently registered fold facades (and their nested folds recursively)
1090
- * to find which fold contains a given tool name. Returns the immediate parent fold name.
1091
- */
1092
- private findFoldContaining;
1093
- /**
1094
- * If an open fold is hiding a previously-available tool, return the name of
1095
- * the fold to close to start getting it back. Only exclusive folds hide tools
1096
- * (they replace the tool set on open rather than extending it), so a base tool
1097
- * that was visible before the fold opened now sits in a fold-stack frame's
1098
- * `previousHandlers` but not in the live handler map. Only the top fold's
1099
- * `close_` tool is active, so that's always the actionable next step — even
1100
- * when the tool lives further down the stack, closing repeatedly walks back to
1101
- * it. Returns null when no open fold accounts for the tool.
1102
- */
1103
- private foldHidingTool;
1104
- /**
1105
- * Install the fold's inner tool set, replacing (exclusive) or extending (non-exclusive)
1106
- * the current tool set. Also injects the close tool. Does NOT touch the fold stack.
1107
- */
1108
- private applyFoldToolSet;
1109
- /** Open a fold: push a stack frame, swap the tool set, return the response message. */
1110
- private openFold;
1111
- private pushFoldFrame;
1112
- /** Close the top fold: pop the stack frame, restore the previous tool set. */
1113
- private closeFold;
1114
- /** Build the fold-awareness suffix appended to the system prompt each LLM call. */
1115
- private buildFoldSystemPromptSuffix;
1116
1135
  private runToolLoop;
1117
1136
  /**
1118
1137
  * Append prose the DRIVER wrote rather than the model — a failure notice, a limit explanation,
@@ -1133,5 +1152,4 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
1133
1152
  private appendDriverNotice;
1134
1153
  private appendToHistory;
1135
1154
  }
1136
- export {};
1137
1155
  //# sourceMappingURL=chat-driver.d.ts.map
@@ -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,cAAc,EAEd,kBAAkB,EAClB,cAAc,EAEd,cAAc,EACd,gBAAgB,EAGhB,WAAW,EAIX,cAAc,EAKd,yBAAyB,EAEzB,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EAOrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EACV,WAAW,EAKX,iBAAiB,EAKjB,oBAAoB,EACpB,iBAAiB,EAElB,MAAM,qBAAqB,CAAC;AAgB7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAM1E,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,KAAK,qBAAqB,EAG3B,MAAM,+B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