@genesislcap/ai-assistant 15.27.0-agent-log-submit.3 → 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.
Files changed (36) hide show
  1. package/dist/ai-assistant.api.json +77 -838
  2. package/dist/ai-assistant.d.ts +23 -179
  3. package/dist/chat-driver.cjs +13 -14
  4. package/dist/chat-driver.cjs.map +2 -2
  5. package/dist/chat-driver.mjs +13 -14
  6. package/dist/chat-driver.mjs.map +2 -2
  7. package/dist/custom-elements.json +17 -454
  8. package/dist/dts/components/ai-driver/ai-driver.d.ts +11 -12
  9. package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
  10. package/dist/dts/components/ai-driver/stub-driver.d.ts +17 -0
  11. package/dist/dts/components/ai-driver/stub-driver.d.ts.map +1 -0
  12. package/dist/dts/components/chat-driver/chat-driver.d.ts +10 -11
  13. package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
  14. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +2 -2
  15. package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
  16. package/dist/dts/components/settings-modal/settings-modal.d.ts.map +1 -1
  17. package/dist/dts/components/settings-modal/settings-modal.styles.d.ts.map +1 -1
  18. package/dist/dts/components/settings-modal/settings-modal.template.d.ts +0 -8
  19. package/dist/dts/components/settings-modal/settings-modal.template.d.ts.map +1 -1
  20. package/dist/dts/index.d.ts +0 -1
  21. package/dist/dts/index.d.ts.map +1 -1
  22. package/dist/dts/main/main.d.ts +0 -148
  23. package/dist/dts/main/main.d.ts.map +1 -1
  24. package/dist/esm/components/ai-driver/stub-driver.js +16 -0
  25. package/dist/esm/components/chat-driver/chat-driver.js +11 -12
  26. package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +5 -5
  27. package/dist/esm/components/settings-modal/settings-modal.js +0 -1
  28. package/dist/esm/components/settings-modal/settings-modal.styles.js +5 -85
  29. package/dist/esm/components/settings-modal/settings-modal.template.js +23 -167
  30. package/dist/esm/main/main.js +20 -444
  31. package/dist/esm/state/persistence/session-persister.js +20 -20
  32. package/docs/migration-GENC-1580.md +108 -58
  33. package/package.json +16 -16
  34. package/dist/dts/utils/resolve-debug-log-note.d.ts +0 -25
  35. package/dist/dts/utils/resolve-debug-log-note.d.ts.map +0 -1
  36. package/dist/esm/utils/resolve-debug-log-note.js +0 -37
@@ -270,7 +270,7 @@ export class SessionPersister {
270
270
  */
271
271
  persistSession() {
272
272
  return __awaiter(this, void 0, void 0, function* () {
273
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
273
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
274
274
  const { provider, enabled } = this.deps.getPersistence();
275
275
  if (!enabled || !provider)
276
276
  return;
@@ -288,7 +288,7 @@ export class SessionPersister {
288
288
  // mints fresh configs (the showcase) would otherwise hand us a never-activated
289
289
  // closure whose `serialize()` returns undefined.
290
290
  const liveSnapshots = {};
291
- const liveActive = (_a = driver === null || driver === void 0 ? void 0 : driver.getActiveAgent) === null || _a === void 0 ? void 0 : _a.call(driver);
291
+ const liveActive = driver === null || driver === void 0 ? void 0 : driver.getActiveAgent();
292
292
  if (liveActive === null || liveActive === void 0 ? void 0 : liveActive.serialize) {
293
293
  try {
294
294
  const snap = liveActive.serialize();
@@ -344,7 +344,7 @@ export class SessionPersister {
344
344
  sessionKey: key,
345
345
  host: window.location.host,
346
346
  messages: messages.slice(0, Math.min(boundary, messages.length)),
347
- activeAgentName: (_b = s.activeAgent) === null || _b === void 0 ? void 0 : _b.name,
347
+ activeAgentName: (_a = s.activeAgent) === null || _a === void 0 ? void 0 : _a.name,
348
348
  pinnedAgentName: s.pinnedAgentName,
349
349
  flowOwnerAgentName: null,
350
350
  sessionCostUsd: s.sessionUsage.costUsd,
@@ -365,7 +365,7 @@ export class SessionPersister {
365
365
  return;
366
366
  }
367
367
  this.logMeta('persistence.suppressed', {
368
- agent: (_c = liveActive === null || liveActive === void 0 ? void 0 : liveActive.name) !== null && _c !== void 0 ? _c : null,
368
+ agent: (_b = liveActive === null || liveActive === void 0 ? void 0 : liveActive.name) !== null && _b !== void 0 ? _b : null,
369
369
  isFlowOwner: s.flowOwnerAgentName === (liveActive === null || liveActive === void 0 ? void 0 : liveActive.name),
370
370
  frozeAtMessages: frozen.messages.length,
371
371
  custom: !!(liveActive === null || liveActive === void 0 ? void 0 : liveActive.notResumableMessage),
@@ -382,7 +382,7 @@ export class SessionPersister {
382
382
  // event was added to the resumable branch — so a session that broke while an agent was
383
383
  // mid-flow still reported nothing at all, which is precisely the blind spot the
384
384
  // user-facing warning exists to cover.
385
- this.recordSaveOutcome(false, (_d = e === null || e === void 0 ? void 0 : e.message) !== null && _d !== void 0 ? _d : String(e));
385
+ this.recordSaveOutcome(false, (_c = e === null || e === void 0 ? void 0 : e.message) !== null && _c !== void 0 ? _c : String(e));
386
386
  // Deliberately NOT reporting from here. This is the non-resumable branch and a reload is
387
387
  // the modal's only action, so advising one now would destroy the in-flight work the
388
388
  // snapshot could not carry. `recordSaveOutcome` has already set `_brokenSince`, so the
@@ -395,11 +395,11 @@ export class SessionPersister {
395
395
  this.logMeta('persistence.save-failed', {
396
396
  messages: frozen.messages.length,
397
397
  agents: [],
398
- active: (_e = liveActive === null || liveActive === void 0 ? void 0 : liveActive.name) !== null && _e !== void 0 ? _e : null,
398
+ active: (_d = liveActive === null || liveActive === void 0 ? void 0 : liveActive.name) !== null && _d !== void 0 ? _d : null,
399
399
  hasSerialize: !!(liveActive === null || liveActive === void 0 ? void 0 : liveActive.serialize),
400
400
  frozen: true,
401
- error: (_f = e === null || e === void 0 ? void 0 : e.name) !== null && _f !== void 0 ? _f : typeof e,
402
- message: (_g = e === null || e === void 0 ? void 0 : e.message) !== null && _g !== void 0 ? _g : String(e),
401
+ error: (_e = e === null || e === void 0 ? void 0 : e.name) !== null && _e !== void 0 ? _e : typeof e,
402
+ message: (_f = e === null || e === void 0 ? void 0 : e.message) !== null && _f !== void 0 ? _f : String(e),
403
403
  });
404
404
  logger.error('Session save (interrupted marker) failed:', e);
405
405
  }
@@ -411,7 +411,7 @@ export class SessionPersister {
411
411
  sessionKey: key,
412
412
  host: window.location.host,
413
413
  messages: [...messages],
414
- activeAgentName: (_h = s.activeAgent) === null || _h === void 0 ? void 0 : _h.name,
414
+ activeAgentName: (_g = s.activeAgent) === null || _g === void 0 ? void 0 : _g.name,
415
415
  pinnedAgentName: s.pinnedAgentName,
416
416
  flowOwnerAgentName: s.flowOwnerAgentName,
417
417
  sessionCostUsd: s.sessionUsage.costUsd,
@@ -435,7 +435,7 @@ export class SessionPersister {
435
435
  const captured = {
436
436
  messages: messages.length,
437
437
  agents: Object.keys(agentSnapshots),
438
- active: (_j = liveActive === null || liveActive === void 0 ? void 0 : liveActive.name) !== null && _j !== void 0 ? _j : null,
438
+ active: (_h = liveActive === null || liveActive === void 0 ? void 0 : liveActive.name) !== null && _h !== void 0 ? _h : null,
439
439
  hasSerialize: !!(liveActive === null || liveActive === void 0 ? void 0 : liveActive.serialize),
440
440
  agentSnapshots,
441
441
  };
@@ -454,7 +454,7 @@ export class SessionPersister {
454
454
  // means the body never reached the wire at all, because a provider builds its
455
455
  // request body inside the `fetch` init, so a throw while serialising creates no
456
456
  // request and leaves no server-side trace.
457
- this.recordSaveOutcome(false, (_k = e === null || e === void 0 ? void 0 : e.message) !== null && _k !== void 0 ? _k : String(e));
457
+ this.recordSaveOutcome(false, (_j = e === null || e === void 0 ? void 0 : e.message) !== null && _j !== void 0 ? _j : String(e));
458
458
  // Report straight away rather than waiting for the next attempt: we are on the resumable
459
459
  // path, so a reload is safe NOW, and a one-cycle delay is a second of extra exposure for
460
460
  // no benefit.
@@ -471,8 +471,8 @@ export class SessionPersister {
471
471
  agents: captured.agents,
472
472
  active: captured.active,
473
473
  hasSerialize: captured.hasSerialize,
474
- error: (_l = e === null || e === void 0 ? void 0 : e.name) !== null && _l !== void 0 ? _l : typeof e,
475
- message: (_m = e === null || e === void 0 ? void 0 : e.message) !== null && _m !== void 0 ? _m : String(e),
474
+ error: (_k = e === null || e === void 0 ? void 0 : e.name) !== null && _k !== void 0 ? _k : typeof e,
475
+ message: (_l = e === null || e === void 0 ? void 0 : e.message) !== null && _l !== void 0 ? _l : String(e),
476
476
  });
477
477
  logger.error('Session save failed:', e);
478
478
  }
@@ -487,7 +487,7 @@ export class SessionPersister {
487
487
  */
488
488
  restore() {
489
489
  return __awaiter(this, void 0, void 0, function* () {
490
- var _a, _b, _c, _d, _e;
490
+ var _a, _b, _c, _d;
491
491
  const { provider } = this.deps.getPersistence();
492
492
  if (!provider)
493
493
  return;
@@ -536,8 +536,8 @@ export class SessionPersister {
536
536
  // Prime each stateful agent's persisted machine/state image FIRST — before
537
537
  // seeding Redux or driver history — so the image is waiting on the driver no
538
538
  // matter when the agent re-activates. The flow-owner lock self-heals on
539
- // activation (OrchestratingDriver.applyAgent re-sets it).
540
- (_a = driver === null || driver === void 0 ? void 0 : driver.primeRestoredAgentState) === null || _a === void 0 ? void 0 : _a.call(driver, snapshot.agentSnapshots);
539
+ // activation (OrchestratingDriver.installAgent re-sets it).
540
+ driver === null || driver === void 0 ? void 0 : driver.primeRestoredAgentState(snapshot.agentSnapshots);
541
541
  // Seed the carry-forward cache so the immediate post-restore autosave (fired
542
542
  // by the history change below, before any agent re-activates) preserves the
543
543
  // machine snapshot instead of overwriting it with an empty one (GENC-1351).
@@ -550,7 +550,7 @@ export class SessionPersister {
550
550
  // actually came back (meta events reset on reload, so this is the only window
551
551
  // onto the saved→loaded handoff).
552
552
  this.logMeta('persistence.restored', {
553
- agents: Object.keys((_b = snapshot.agentSnapshots) !== null && _b !== void 0 ? _b : {}),
553
+ agents: Object.keys((_a = snapshot.agentSnapshots) !== null && _a !== void 0 ? _a : {}),
554
554
  agentSnapshots: snapshot.agentSnapshots,
555
555
  pinnedAgentName: snapshot.pinnedAgentName,
556
556
  flowOwnerAgentName: snapshot.flowOwnerAgentName,
@@ -618,7 +618,7 @@ export class SessionPersister {
618
618
  }
619
619
  const messages = [...trimmed, ...trailers];
620
620
  ref.actions.aiAssistant.loadSession(toLoadSessionPayload(Object.assign(Object.assign({}, snapshot), { messages })));
621
- (_c = driver === null || driver === void 0 ? void 0 : driver.loadHistory) === null || _c === void 0 ? void 0 : _c.call(driver, [...messages]);
621
+ (_b = driver === null || driver === void 0 ? void 0 : driver.loadHistory) === null || _b === void 0 ? void 0 : _b.call(driver, [...messages]);
622
622
  // Interrupted flow (§5.9): pre-fill the composer with the prompt that started
623
623
  // the flow so "send it again" is one keystroke, and record it for observability.
624
624
  if (snapshot.interrupted) {
@@ -641,8 +641,8 @@ export class SessionPersister {
641
641
  // driver's routing agrees with the restored (picker-locked) store state.
642
642
  const orchestrator = asOrchestrator(driver);
643
643
  if (orchestrator) {
644
- orchestrator.setPinnedAgent((_d = snapshot.pinnedAgentName) !== null && _d !== void 0 ? _d : null);
645
- orchestrator.setFlowOwner((_e = snapshot.flowOwnerAgentName) !== null && _e !== void 0 ? _e : null);
644
+ orchestrator.setPinnedAgent((_c = snapshot.pinnedAgentName) !== null && _c !== void 0 ? _c : null);
645
+ orchestrator.setFlowOwner((_d = snapshot.flowOwnerAgentName) !== null && _d !== void 0 ? _d : null);
646
646
  }
647
647
  logger.debug('Session restored', { key, messages: messages.length });
648
648
  }
@@ -1,47 +1,26 @@
1
1
  # Migration Guide — GENC-1580 (agent lifecycle leaves the orchestrator)
2
2
 
3
- > ## ⚠️ Partly shipped — the rename has not landed, so do not action the rename
3
+ > ## ⚠️ §4 only is still unshipped
4
4
  >
5
- > The structural half of this change is in. What is **not** in is the one part that would break
6
- > you: `ChatDriver.applyAgent` has not been renamed. It was held back deliberately, to land alone
7
- > as the last PR of GENC-1580 — the rename cannot be caught by a compiler in a JavaScript caller,
8
- > so it is worth scheduling rather than absorbing alongside a refactor.
5
+ > Everything in this guide is now true **except §4** (`pinned-changed`), which carries its own
6
+ > notice. The breaking rename landed in this release.
9
7
  >
10
- > **What the package you are reading this in actually has:**
8
+ > **Self-check, whatever version you are on:** if `ChatDriver.installAgent` exists, you are on the
9
+ > breaking release and §1–§3 and §5 apply. If only `applyAgent` exists, you are on an earlier one
10
+ > and should not touch your calls.
11
11
  >
12
- > | This guide says | Actually available today |
13
- > | --- | --- |
14
- > | `ChatDriver.activateAgent` | ✓ — available, fires the lifecycle hooks |
15
- > | `ChatDriver.agentSession` | ✓ — available (`@internal`) |
16
- > | `getActiveAgent` / `primeRestoredAgentState` implemented by both drivers | ✓ — and `setPinnedAgent` / `setFlowOwner` are on the interface now, all four **optional** |
17
- > | `ChatDriver.installAgent` | ✗ — **still `ChatDriver.applyAgent`, unchanged** |
18
- > | `pinned-changed` is dispatched | ✗ — still dead wiring (§7.2 of `code-health.md`) |
12
+ > **What breaks:** `ChatDriver.applyAgent` is gone (§1), and four `AiDriver` members are now
13
+ > required rather than optional (§3). Both are compile-time breaks in TypeScript; §1 is **not**
14
+ > caught by a compiler in a JavaScript caller, which is why it shipped alone.
19
15
  >
20
- > **Self-check, whatever version you are on:** if `installAgent` is not present on `ChatDriver`,
21
- > the rename has not landed and you should not touch your `applyAgent` calls. §4 is also **not**
22
- > shipped — it carries its own notice. Everything else here is current.
16
+ > **This ships as a MINOR version, not a major.** The AI surface is `@beta` and has no external
17
+ > consumers — the only callers are migrated by hand alongside the release. So a `^15` range will
18
+ > pick this up: if you call `ChatDriver` directly or implement `AiDriver`, read §1 and §3 before
19
+ > upgrading rather than relying on the version number to warn you.
23
20
  >
24
- > **Nothing you have today breaks on this release.** `applyAgent` keeps working, and every
25
- > `AiDriver` member this ticket touched is declared optional, so an implementor of that interface
26
- > is unaffected too.
27
- >
28
- > GENC-1580 ships in more than one PR. The first delivered an internal decomposition of `main.ts`
29
- > only — five feature controllers, no public API change of any kind. **The agent-lifecycle work
30
- > described here comes in a later PR under the same ticket**, and this notice is removed in the
31
- > same change that makes the guide true.
32
- >
33
- > ---
34
- >
35
- > When it does land: **config-compatible — no changes required to `chatConfig`, `agents`, or
36
- > `persistence`.** No element property, attribute, event or `::part()` changes. Nothing about which
37
- > driver runs your agents changes, so **no runtime behaviour changes**.
38
- >
39
- > You will need to read this if you call `ChatDriver` directly, or if you implement `AiDriver`
40
- > yourself. If you only configure the element, there is nothing here for you.
41
- >
42
- > All surfaces below are `@beta` unless marked otherwise.
43
-
44
- ---
21
+ > **Config-compatible** — no changes to `chatConfig`, `agents` or `persistence`, no element
22
+ > property, attribute, event or `::part()` changes, and **no runtime behaviour changes**. You only
23
+ > need this guide if you call `ChatDriver` directly or implement `AiDriver` yourself.
45
24
 
46
25
  ## Why
47
26
 
@@ -67,8 +46,9 @@ longer depends on which driver you got.
67
46
 
68
47
  ### 1. `ChatDriver.applyAgent` is renamed to `installAgent`
69
48
 
70
- **This is the only breaking change in this release.** `applyAgent` was public `@beta` and appeared
71
- in the published type rollup.
49
+ `applyAgent` was public `@beta` and appeared in the published type rollup, so this is a
50
+ compile-time break for a TypeScript caller — and a silent one for a JavaScript caller, which is
51
+ why it shipped in a release of its own.
72
52
 
73
53
  ```ts
74
54
  // before
@@ -97,6 +77,10 @@ name `installAgent` says what it does, so the next reader has to choose delibera
97
77
  state to restore, `activateAgent`. If you are re-applying a per-turn tool surface on an agent
98
78
  already activated, `installAgent`.
99
79
 
80
+ `OrchestratingDriver`'s own private `applyAgent` was renamed to match. It was never public, so
81
+ there is nothing to do — but the two are related, and leaving them differently named would have
82
+ been worse than the original footgun.
83
+
100
84
  ### 2. `ChatDriver.agentSession` is exposed
101
85
 
102
86
  ```ts
@@ -123,27 +107,90 @@ which is the coupling that used to span two classes.
123
107
 
124
108
  | Member | Was | Now |
125
109
  | --- | --- | --- |
126
- | `getActiveAgent?()` | `OrchestratingDriver` only | both |
127
- | `setPinnedAgent?(name)` | not on the interface | both |
128
- | `setFlowOwner?(name)` | not on the interface | both |
129
- | `primeRestoredAgentState?(snapshots)` | `OrchestratingDriver` only | both |
110
+ | `getActiveAgent()` | `OrchestratingDriver` only, optional | both, **required** |
111
+ | `setPinnedAgent(name)` | not on the interface | both, **required** |
112
+ | `setFlowOwner(name)` | not on the interface | both, **required** |
113
+ | `primeRestoredAgentState(snapshots)` | `OrchestratingDriver` only, optional | both, **required** |
114
+
115
+ **If you only call these, there is nothing to do** — and you can now drop your guards, because the
116
+ interface finally promises what both shipped drivers have always provided:
117
+
118
+ ```ts
119
+ // before
120
+ const reserve = driver.getActiveAgent?.()?.contextReserve;
130
121
 
131
- **Nothing to do, and nothing breaks.** All four are declared **optional**, so a third party
132
- implementing `AiDriver` is unaffected: two were already optional and two are new additions. Keep
133
- your `?.()` guards — they still type-check, and the interface makes no promise a caller can lean
134
- on yet.
122
+ // after
123
+ const reserve = driver.getActiveAgent()?.contextReserve;
124
+ ```
135
125
 
136
- The `?` comes off in the same release as the `installAgent` rename, which is the only breaking
137
- change in this ticket. That is when the guards can go:
126
+ **If you implement `AiDriver` yourself, this is the break.** Add the four methods. Each has a
127
+ sensible inert form if your driver has nothing to route between — record the value and return it,
128
+ or no-op:
138
129
 
139
130
  ```ts
140
- // after the breaking release, not before
141
- const reserve = driver.getActiveAgent().contextReserve;
131
+ import type { AgentConfig } from '@genesislcap/ai-assistant';
132
+
133
+ class MyDriver implements AiDriver {
134
+ // …your existing members — `AiDriver` extends `EventTarget` and has 11 required
135
+ // members in total, so this fragment alone will not compile…
136
+
137
+ private active?: AgentConfig;
138
+
139
+ getActiveAgent() {
140
+ return this.active;
141
+ }
142
+ setPinnedAgent(_name: string | null) {}
143
+ setFlowOwner(_name: string | null) {}
144
+ primeRestoredAgentState(_snapshots: Record<string, unknown>) {}
145
+ }
142
146
  ```
143
147
 
144
- Fourteen members on `AiDriver` remain optional. They are a separate problem, and `ai-driver.ts`
145
- still carries a doc comment claiming the element depends only on this interface, which is not yet
146
- true.
148
+ <details>
149
+ <summary>A complete inert implementation, if you want one to start from</summary>
150
+
151
+ `AiDriver` extends `EventTarget` and has 11 required members. This compiles as written — the four
152
+ above plus the seven that were already required:
153
+
154
+ ```ts
155
+ import type { ChatAttachment, ChatDriverResult, ChatMessage } from '@genesislcap/foundation-ai';
156
+ import type { AgentConfig, AiDriver } from '@genesislcap/ai-assistant';
157
+
158
+ class MyDriver extends EventTarget implements AiDriver {
159
+ private active?: AgentConfig;
160
+
161
+ // the four this release promotes
162
+ getActiveAgent() {
163
+ return this.active;
164
+ }
165
+ setPinnedAgent(_name: string | null) {}
166
+ setFlowOwner(_name: string | null) {}
167
+ primeRestoredAgentState(_snapshots: Record<string, unknown>) {}
168
+
169
+ // the seven that were already required
170
+ async sendMessage(_input: string, _attachments?: ChatAttachment[]): Promise<ChatDriverResult> {
171
+ return { reason: 'done' };
172
+ }
173
+ async continueFromHistory(_primer?: ChatMessage[]): Promise<ChatDriverResult> {
174
+ return { reason: 'done' };
175
+ }
176
+ resolveInteraction(_interactionId: string, _result: unknown) {}
177
+ loadHistory(_messages: ChatMessage[]) {}
178
+ isBusy() {
179
+ return false;
180
+ }
181
+ async getSuggestions(): Promise<string[]> {
182
+ return [];
183
+ }
184
+ getActiveProviderName() {
185
+ return 'my-provider';
186
+ }
187
+ }
188
+ ```
189
+
190
+ </details>
191
+
192
+ Fourteen of `AiDriver`'s 25 members remain optional — compaction, diagnostics, interactions,
193
+ `cancel`/`dispose`. Feature-detect those as before; this release changes nothing about them.
147
194
 
148
195
  ### 4. `pinned-changed` — still not dispatched, still nothing to do
149
196
 
@@ -182,8 +229,9 @@ behaviour on the session-restore path and deserves its own release to be judged
182
229
  a release.
183
230
  - `OrchestratingDriver`'s routing: classification, handoffs, the handoff cap, terminality rules,
184
231
  the continuation tool, and per-agent history masking.
185
- - `OrchestratingDriver.applyAgent` — it was already private, and stays private. It shrinks, but its
186
- name and signature are not part of any contract.
232
+ - `OrchestratingDriver`'s installer — private before and after, so its rename to `installAgent`
233
+ (§1) is invisible to you; it also shrank, but neither its name nor its signature is part of any
234
+ contract.
187
235
  - Session persistence and restore, including the shape written to the persistence provider.
188
236
 
189
237
  ## Known remaining: sub-agent lifecycle
@@ -208,8 +256,10 @@ This release also splits the two largest modules. None of it is consumer-visible
208
256
  package's entry points (`.`, `./config`, `./chat-driver`, `./react`), but if you deep-import from
209
257
  `dist/esm/...` — which is unsupported — paths have moved:
210
258
 
211
- - `chat-driver.ts` sheds its turn-failure taxonomy, interaction handling, turn recording, turn
212
- setup, fold machinery and provider resolution into sibling modules.
259
+ - `chat-driver.ts` sheds its turn-failure taxonomy (`turn-failures.ts`), interaction handling
260
+ (`interaction-controller.ts`), turn recording and diagnostics (`turn-recorder.ts`), fold
261
+ machinery (`fold-controller.ts`) and its constants (`chat-driver.constants.ts`) into sibling
262
+ modules. Turn setup and provider resolution were considered and **not** extracted.
213
263
  - `main.ts` sheds the settings modal, composer controls, cost ledger, budget latching, context gate
214
264
  and diagnostics assembly into controllers.
215
265
 
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": "15.27.0-agent-log-submit.3",
4
+ "version": "15.27.1",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -74,26 +74,26 @@
74
74
  }
75
75
  },
76
76
  "devDependencies": {
77
- "@genesislcap/foundation-testing": "15.27.0-agent-log-submit.3",
78
- "@genesislcap/genx": "15.27.0-agent-log-submit.3",
79
- "@genesislcap/rollup-builder": "15.27.0-agent-log-submit.3",
80
- "@genesislcap/ts-builder": "15.27.0-agent-log-submit.3",
81
- "@genesislcap/uvu-playwright-builder": "15.27.0-agent-log-submit.3",
82
- "@genesislcap/vite-builder": "15.27.0-agent-log-submit.3",
83
- "@genesislcap/webpack-builder": "15.27.0-agent-log-submit.3",
77
+ "@genesislcap/foundation-testing": "15.27.1",
78
+ "@genesislcap/genx": "15.27.1",
79
+ "@genesislcap/rollup-builder": "15.27.1",
80
+ "@genesislcap/ts-builder": "15.27.1",
81
+ "@genesislcap/uvu-playwright-builder": "15.27.1",
82
+ "@genesislcap/vite-builder": "15.27.1",
83
+ "@genesislcap/webpack-builder": "15.27.1",
84
84
  "@types/dompurify": "^3.0.5",
85
85
  "@types/marked": "^5.0.2",
86
86
  "esbuild": "0.25.12"
87
87
  },
88
88
  "dependencies": {
89
- "@genesislcap/foundation-ai": "15.27.0-agent-log-submit.3",
90
- "@genesislcap/foundation-logger": "15.27.0-agent-log-submit.3",
91
- "@genesislcap/foundation-notifications": "15.27.0-agent-log-submit.3",
92
- "@genesislcap/foundation-redux": "15.27.0-agent-log-submit.3",
93
- "@genesislcap/foundation-ui": "15.27.0-agent-log-submit.3",
94
- "@genesislcap/foundation-utils": "15.27.0-agent-log-submit.3",
95
- "@genesislcap/rapid-design-system": "15.27.0-agent-log-submit.3",
96
- "@genesislcap/web-core": "15.27.0-agent-log-submit.3",
89
+ "@genesislcap/foundation-ai": "15.27.1",
90
+ "@genesislcap/foundation-logger": "15.27.1",
91
+ "@genesislcap/foundation-notifications": "15.27.1",
92
+ "@genesislcap/foundation-redux": "15.27.1",
93
+ "@genesislcap/foundation-ui": "15.27.1",
94
+ "@genesislcap/foundation-utils": "15.27.1",
95
+ "@genesislcap/rapid-design-system": "15.27.1",
96
+ "@genesislcap/web-core": "15.27.1",
97
97
  "dompurify": "^3.3.1",
98
98
  "marked": "^17.0.3"
99
99
  },
@@ -1,25 +0,0 @@
1
- import type { ChatDebugLogSubmitConfig } from '@genesislcap/foundation-ai';
2
- /** Default cap on the user's note. Short by design — it is a caption for the log, not a report. */
3
- export declare const DEBUG_LOG_NOTE_DEFAULT_MAX_LENGTH = 500;
4
- /** Default prompt in the empty note. */
5
- export declare const DEBUG_LOG_NOTE_DEFAULT_PLACEHOLDER = "What were you doing, or what went wrong? (optional)";
6
- /** The same prompt for a `required` note — "(optional)" would contradict the disabled Send. */
7
- export declare const DEBUG_LOG_NOTE_REQUIRED_PLACEHOLDER = "What were you doing, or what went wrong?";
8
- /** `ChatDebugLogNoteConfig` with every option resolved. */
9
- export interface ResolvedDebugLogNoteConfig {
10
- placeholder: string;
11
- required: boolean;
12
- maxLength: number;
13
- }
14
- /**
15
- * Resolve `debugLogSubmit.note` — `undefined`/`true` mean "compose box with defaults",
16
- * `false` means "no compose box, send on first click" (→ `null`), and an object customises
17
- * the box. Keeps the template free of the boolean-or-object dance.
18
- */
19
- export declare function resolveDebugLogNoteConfig(config: ChatDebugLogSubmitConfig | undefined): ResolvedDebugLogNoteConfig | null;
20
- /**
21
- * Normalise the typed note for the submission: trimmed, and `undefined` when empty so a
22
- * host can `message ?? fallback` without checking for whitespace.
23
- */
24
- export declare function normalizeDebugLogNote(note: string): string | undefined;
25
- //# sourceMappingURL=resolve-debug-log-note.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-debug-log-note.d.ts","sourceRoot":"","sources":["../../../src/utils/resolve-debug-log-note.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEnG,mGAAmG;AACnG,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD,wCAAwC;AACxC,eAAO,MAAM,kCAAkC,wDACQ,CAAC;AAExD,+FAA+F;AAC/F,eAAO,MAAM,mCAAmC,6CAA6C,CAAC;AAE9F,2DAA2D;AAC3D,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,wBAAwB,GAAG,SAAS,GAC3C,0BAA0B,GAAG,IAAI,CAmBnC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGtE"}
@@ -1,37 +0,0 @@
1
- /** Default cap on the user's note. Short by design — it is a caption for the log, not a report. */
2
- export const DEBUG_LOG_NOTE_DEFAULT_MAX_LENGTH = 500;
3
- /** Default prompt in the empty note. */
4
- export const DEBUG_LOG_NOTE_DEFAULT_PLACEHOLDER = 'What were you doing, or what went wrong? (optional)';
5
- /** The same prompt for a `required` note — "(optional)" would contradict the disabled Send. */
6
- export const DEBUG_LOG_NOTE_REQUIRED_PLACEHOLDER = 'What were you doing, or what went wrong?';
7
- /**
8
- * Resolve `debugLogSubmit.note` — `undefined`/`true` mean "compose box with defaults",
9
- * `false` means "no compose box, send on first click" (→ `null`), and an object customises
10
- * the box. Keeps the template free of the boolean-or-object dance.
11
- */
12
- export function resolveDebugLogNoteConfig(config) {
13
- var _a;
14
- if (!config || config.note === false)
15
- return null;
16
- // `typeof null === 'object'`: a host building its config dynamically can hand us `null`
17
- // even though the type forbids it, and that must read as "defaults", not crash.
18
- const note = typeof config.note === 'object' && config.note !== null ? config.note : {};
19
- // `>= 1`, not `> 0`: a fractional cap under 1 would floor to 0 and lock the textarea.
20
- const maxLength = typeof note.maxLength === 'number' && note.maxLength >= 1
21
- ? Math.floor(note.maxLength)
22
- : DEBUG_LOG_NOTE_DEFAULT_MAX_LENGTH;
23
- const required = note.required === true;
24
- return {
25
- placeholder: (_a = note.placeholder) !== null && _a !== void 0 ? _a : (required ? DEBUG_LOG_NOTE_REQUIRED_PLACEHOLDER : DEBUG_LOG_NOTE_DEFAULT_PLACEHOLDER),
26
- required,
27
- maxLength,
28
- };
29
- }
30
- /**
31
- * Normalise the typed note for the submission: trimmed, and `undefined` when empty so a
32
- * host can `message ?? fallback` without checking for whitespace.
33
- */
34
- export function normalizeDebugLogNote(note) {
35
- const trimmed = note.trim();
36
- return trimmed.length > 0 ? trimmed : undefined;
37
- }