@genesislcap/ai-assistant 15.35.3 → 15.35.4
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.
- package/dist/ai-assistant.api.json +483 -0
- package/dist/ai-assistant.d.ts +192 -0
- package/dist/chat-driver.cjs +221 -4
- package/dist/chat-driver.cjs.map +2 -2
- package/dist/chat-driver.mjs +221 -4
- package/dist/chat-driver.mjs.map +2 -2
- package/dist/custom-elements.json +1616 -1350
- package/dist/dts/components/ai-driver/ai-driver.d.ts +31 -0
- package/dist/dts/components/ai-driver/ai-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts +93 -0
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +17 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/state/persistence/index.d.ts +1 -0
- package/dist/dts/state/persistence/index.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-persister.d.ts +12 -0
- package/dist/dts/state/persistence/session-persister.d.ts.map +1 -1
- package/dist/dts/state/persistence/session-snapshot.d.ts +14 -0
- package/dist/dts/state/persistence/session-snapshot.d.ts.map +1 -1
- package/dist/dts/utils/condense-history.d.ts +114 -0
- package/dist/dts/utils/condense-history.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +140 -17
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +17 -0
- package/dist/esm/state/persistence/session-persister.js +63 -15
- package/dist/esm/state/persistence/session-snapshot.js +2 -17
- package/dist/esm/utils/condense-history.js +123 -0
- package/package.json +18 -18
|
@@ -2,6 +2,7 @@ import type { ChatAttachment, ChatDriverResult, ChatMessage, ChatToolDefinition
|
|
|
2
2
|
import type { AgentConfig } from '../../config/config';
|
|
3
3
|
import type { DiagnosticEntry } from '../../state/persistence/diagnostics';
|
|
4
4
|
import type { InteractionContext } from '../../types/interaction-context';
|
|
5
|
+
import type { PersistedCondensePolicy } from '../../utils/condense-history';
|
|
5
6
|
import type { CompactionProjection } from '../../utils/context-tokens';
|
|
6
7
|
import type { CompactionPlanOptions } from '../../utils/history-transform';
|
|
7
8
|
import type { ContextGuardPolicy, TurnSnapshot } from '../chat-driver/chat-driver';
|
|
@@ -110,6 +111,36 @@ export interface AiDriver extends EventTarget {
|
|
|
110
111
|
* to project, and a caller falls back to {@link AiDriver.getRawHistory}.
|
|
111
112
|
*/
|
|
112
113
|
getHistoryForPersistence?(): ChatMessage[];
|
|
114
|
+
/**
|
|
115
|
+
* The `condenseWhen` policies that have NOT fired yet, for the tool calls in `messages` — the
|
|
116
|
+
* transcript being persisted — in a clock-independent form a later
|
|
117
|
+
* {@link AiDriver.restoreCondensePolicies} can re-register (GENC-1632). The companion of
|
|
118
|
+
* {@link AiDriver.getHistoryForPersistence}: that stores already-collapsed payloads as stubs;
|
|
119
|
+
* this keeps the not-yet-collapsed ones collapsible across a reload, where they would otherwise
|
|
120
|
+
* ride every provider call for the rest of the session. Optional, like its companion — a driver
|
|
121
|
+
* without condensation has none.
|
|
122
|
+
*
|
|
123
|
+
* @beta
|
|
124
|
+
*/
|
|
125
|
+
getCondensePoliciesForPersistence?(messages: readonly ChatMessage[]): PersistedCondensePolicy[];
|
|
126
|
+
/**
|
|
127
|
+
* Re-register policies from {@link AiDriver.getCondensePoliciesForPersistence} against a restored
|
|
128
|
+
* transcript (GENC-1632). Call after {@link AiDriver.loadHistory}: entries whose tool call is not
|
|
129
|
+
* in the loaded history are dropped. Tolerates `undefined` and malformed entries (an older or
|
|
130
|
+
* damaged snapshot), which are ignored.
|
|
131
|
+
*
|
|
132
|
+
* Returns how many entries were actually re-armed (`restored`) and how many of those are parked
|
|
133
|
+
* pending the next agent activation (`awaitingReactivation`) — narrower than `entries.length`,
|
|
134
|
+
* which counts what was offered, not what was accepted (a malformed entry, a trimmed-away call, or
|
|
135
|
+
* a first-wins duplicate is dropped silently). A caller logging the outcome needs this split to
|
|
136
|
+
* tell "all re-armed" from "none did".
|
|
137
|
+
*
|
|
138
|
+
* @beta
|
|
139
|
+
*/
|
|
140
|
+
restoreCondensePolicies?(entries: readonly unknown[] | undefined): {
|
|
141
|
+
restored: number;
|
|
142
|
+
awaitingReactivation: number;
|
|
143
|
+
};
|
|
113
144
|
/**
|
|
114
145
|
* The live `AgentConfig` currently active in the driver — the instance whose
|
|
115
146
|
* `onActivate` ran, so its `serialize`/`getDebugSnapshot` closures hold live
|
|
@@ -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,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;OAQG;IACH,KAAK,EAAE,QAAQ,GAAG,eAAe,CAAC;CACnC;AAED,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;I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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"}
|
|
@@ -4,6 +4,7 @@ import { type ActivityBus } from '../../channel/ai-activity-bus';
|
|
|
4
4
|
import type { AgentConfig, SystemPromptInput, ToolDefinitionsInput, ToolHandlersInput } from '../../config/config';
|
|
5
5
|
import type { DiagnosticEntry } from '../../state/persistence/diagnostics';
|
|
6
6
|
import type { InteractionContext } from '../../types/interaction-context';
|
|
7
|
+
import { type PersistedCondensePolicy } from '../../utils/condense-history';
|
|
7
8
|
import { type CompactionProjection } from '../../utils/context-tokens';
|
|
8
9
|
import { type CompactionPlanOptions } from '../../utils/history-transform';
|
|
9
10
|
import { AgentSession } from '../agent-session/agent-session';
|
|
@@ -208,8 +209,29 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
208
209
|
* provider call to collapse stale payloads from the model-bound history only.
|
|
209
210
|
* Accumulates across agents on a shared driver (a superseded read collapses no
|
|
210
211
|
* matter which agent made it) and is never cleared — it dies with the driver.
|
|
212
|
+
*
|
|
213
|
+
* "Dies with the driver" used to mean a page reload silently disarmed every policy that had
|
|
214
|
+
* not fired yet: the restored transcript carried the full payload and nothing was left to
|
|
215
|
+
* collapse it, so it rode every later provider call (GENC-1632). The unfired entries are now
|
|
216
|
+
* persisted with the session and re-registered on restore — see
|
|
217
|
+
* {@link ChatDriver.getCondensePoliciesForPersistence} and
|
|
218
|
+
* {@link ChatDriver.restoreCondensePolicies}.
|
|
211
219
|
*/
|
|
212
220
|
private readonly condensePolicies;
|
|
221
|
+
/**
|
|
222
|
+
* Restored policies whose owning activation was still live at save time, waiting for that agent
|
|
223
|
+
* to be re-installed so they can be stamped with the activation it resumes in (GENC-1632).
|
|
224
|
+
*
|
|
225
|
+
* They cannot be stamped at restore time. On a fresh page `activeAgentName` is unset, so the
|
|
226
|
+
* first `installAgent` after the reload is a "name change" and advances `currentActivation` —
|
|
227
|
+
* which is exactly the `agentEnd` signal. An entry stamped before that bump reads as belonging
|
|
228
|
+
* to an activation that has ended, and it and every `phaseEnd` entry (through the `agentEnd`
|
|
229
|
+
* backstop) collapse on the first provider call after the reload, mid-flow. For Create's
|
|
230
|
+
* Planning phase that is the uploaded scope document vanishing the moment the user carries on
|
|
231
|
+
* talking about it — a worse failure than the one being fixed. So the stamp is deferred to that
|
|
232
|
+
* `installAgent`, and consumed there once whichever agent it installs.
|
|
233
|
+
*/
|
|
234
|
+
private readonly condenseAwaitingReactivation;
|
|
213
235
|
/**
|
|
214
236
|
* Monotonic model-call counter for the driver's whole lifetime — the age clock
|
|
215
237
|
* for `condenseWhen({ on: { kind: 'age' } })`. The per-`sendMessage` `iterations`
|
|
@@ -816,6 +838,77 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
816
838
|
* unaffected — which is what makes the elision recoverable.
|
|
817
839
|
*/
|
|
818
840
|
getHistoryForPersistence(): ChatMessage[];
|
|
841
|
+
/** The four condensation clocks as they read now. */
|
|
842
|
+
private condenseClocks;
|
|
843
|
+
/**
|
|
844
|
+
* The `condenseWhen` policies that have not fired yet, for the calls in `messages`, in the
|
|
845
|
+
* clock-independent form {@link ChatDriver.restoreCondensePolicies} re-registers. See
|
|
846
|
+
* {@link AiDriver.getCondensePoliciesForPersistence}.
|
|
847
|
+
*
|
|
848
|
+
* The other half of {@link ChatDriver.getHistoryForPersistence} (GENC-1632). That stores the
|
|
849
|
+
* payloads the model has already stopped seeing as their stubs; this stores the policies for the
|
|
850
|
+
* ones it has NOT stopped seeing yet, so a reload does not strand them at full size for the rest
|
|
851
|
+
* of the session. Only entries whose call is in `messages` — the transcript actually being
|
|
852
|
+
* written — are returned, so a frozen (non-resumable) or compacted save carries no policy for a
|
|
853
|
+
* call it does not contain.
|
|
854
|
+
*
|
|
855
|
+
* @beta
|
|
856
|
+
*/
|
|
857
|
+
getCondensePoliciesForPersistence(messages: readonly ChatMessage[]): PersistedCondensePolicy[];
|
|
858
|
+
/**
|
|
859
|
+
* Re-register policies saved by {@link ChatDriver.getCondensePoliciesForPersistence} against
|
|
860
|
+
* the restored transcript. See {@link AiDriver.restoreCondensePolicies}.
|
|
861
|
+
*
|
|
862
|
+
* Call AFTER {@link ChatDriver.loadHistory} has seeded the restored transcript: an entry is
|
|
863
|
+
* re-registered only if its tool call is in the driver's history, so one whose call the
|
|
864
|
+
* restorable-boundary trim cut away (an orphaned trailing `tool_use`) is dropped rather than
|
|
865
|
+
* resurrected against nothing.
|
|
866
|
+
*
|
|
867
|
+
* First-wins still holds per call: an entry is skipped if a policy is already registered for its
|
|
868
|
+
* tool call — a restore never overrides what a live handler declared. `superseded` needs no
|
|
869
|
+
* special handling — survivors are resolved from HISTORY order on every pass, so a restored entry
|
|
870
|
+
* and a later call on the same `by` key resolve exactly as two live ones would.
|
|
871
|
+
*
|
|
872
|
+
* Clocks are rebased so each trigger is exactly as far from firing as it was at save time (see
|
|
873
|
+
* `rebaseRestoredCondensePolicy`), with one deferral. An entry owned by the activation that was
|
|
874
|
+
* live at save time, whose agent is not the one installed right now — the normal case on a
|
|
875
|
+
* fresh page, where nothing is installed yet — is parked in
|
|
876
|
+
* `condenseAwaitingReactivation` and stamped by the next `installAgent`: with
|
|
877
|
+
* that agent's resumed activation if it is the same agent, or left behind (so it reads as
|
|
878
|
+
* ended, which it has) if a different agent took over.
|
|
879
|
+
*
|
|
880
|
+
* A host with no agent to re-activate (a bare driver built from a static config) loses nothing
|
|
881
|
+
* by this: the entry's owner (`undefined`) matches the installed agent (`undefined`), so it is
|
|
882
|
+
* stamped live straight away and ends when the driver's single activation does — on
|
|
883
|
+
* `releaseAgent` / `completeSubAgent`, exactly as a policy registered live would.
|
|
884
|
+
*
|
|
885
|
+
* Returns how many entries were actually re-armed, split from how many were merely present in
|
|
886
|
+
* `entries` (review follow-up, GENC-1632): a malformed entry, one whose call the restorable-
|
|
887
|
+
* boundary trim removed, or a first-wins duplicate is silently dropped, so the caller's own count
|
|
888
|
+
* of `entries` can't tell "all of them came back" from "none did". `restored` is every entry that
|
|
889
|
+
* reached `condensePolicies`; `awaitingReactivation` is the subset of those parked pending the
|
|
890
|
+
* next `installAgent` rather than stamped live immediately.
|
|
891
|
+
*
|
|
892
|
+
* @beta
|
|
893
|
+
*/
|
|
894
|
+
restoreCondensePolicies(entries: readonly unknown[] | undefined): {
|
|
895
|
+
restored: number;
|
|
896
|
+
awaitingReactivation: number;
|
|
897
|
+
};
|
|
898
|
+
/**
|
|
899
|
+
* Stamp the restored entries parked in `condenseAwaitingReactivation` now that
|
|
900
|
+
* `installAgent` has advanced the activation clock for `agentName` (GENC-1632).
|
|
901
|
+
*
|
|
902
|
+
* Same agent → the flow the entry belonged to is resuming, so it takes the new activation and
|
|
903
|
+
* stays full until THAT activation ends (and, for `phaseEnd`, until the next `endPhase()`).
|
|
904
|
+
* Different agent → its owner did not come back; its activation is over, so it keeps the stamp
|
|
905
|
+
* it was restored with, which is now behind the clock, and collapses on the next provider call
|
|
906
|
+
* exactly as a live `agentEnd` payload does on a swap.
|
|
907
|
+
*
|
|
908
|
+
* One-shot: the set is emptied whatever the outcome, because only the FIRST activation after the
|
|
909
|
+
* restore can be the resumption. Any later swap is an ordinary activation boundary.
|
|
910
|
+
*/
|
|
911
|
+
private resumeRestoredCondensePolicies;
|
|
819
912
|
/**
|
|
820
913
|
* {@inheritDoc AiDriver.getSuggestions}
|
|
821
914
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAGlB,cAAc,EACd,gBAAgB,EAGhB,WAAW,
|
|
1
|
+
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAGlB,cAAc,EACd,gBAAgB,EAGhB,WAAW,EAQX,yBAAyB,EACzB,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;AAU7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAML,KAAK,uBAAuB,EAK7B,MAAM,8BAA8B,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,CAAC,oBAAoB;CAO7B"}
|
|
@@ -3,6 +3,7 @@ import type { ActivityBus } from '../../channel/ai-activity-bus';
|
|
|
3
3
|
import type { AgentConfig } from '../../config/config';
|
|
4
4
|
import type { DiagnosticEntry } from '../../state/persistence/diagnostics';
|
|
5
5
|
import type { InteractionContext } from '../../types/interaction-context';
|
|
6
|
+
import type { PersistedCondensePolicy } from '../../utils/condense-history';
|
|
6
7
|
import type { CompactionProjection } from '../../utils/context-tokens';
|
|
7
8
|
import type { CompactionPlanOptions } from '../../utils/history-transform';
|
|
8
9
|
import type { AiDriver, AllAgentSummary, ContextReserveResolution } from '../ai-driver/ai-driver';
|
|
@@ -185,6 +186,22 @@ export declare class OrchestratingDriver extends EventTarget implements AiDriver
|
|
|
185
186
|
* tests passed, and the feature did nothing.
|
|
186
187
|
*/
|
|
187
188
|
getHistoryForPersistence(): ChatMessage[];
|
|
189
|
+
/**
|
|
190
|
+
* Delegates to the inner {@link ChatDriver}, which owns the condensation registry and clocks
|
|
191
|
+
* (GENC-1632). The forward matters for the same reason as `getHistoryForPersistence` above: the
|
|
192
|
+
* persister reaches it through `?.`, so a missing forward would compile, pass the ChatDriver
|
|
193
|
+
* tests, and do nothing for every orchestrated host — which is every host with an agents array.
|
|
194
|
+
*/
|
|
195
|
+
getCondensePoliciesForPersistence(messages: readonly ChatMessage[]): PersistedCondensePolicy[];
|
|
196
|
+
/**
|
|
197
|
+
* Delegates to the inner {@link ChatDriver} (GENC-1632). The deferred activation stamp it
|
|
198
|
+
* performs is taken by the inner driver's `installAgent`, which this driver's own
|
|
199
|
+
* `installAgent` always reaches, so nothing extra is needed here.
|
|
200
|
+
*/
|
|
201
|
+
restoreCondensePolicies(entries: readonly unknown[] | undefined): {
|
|
202
|
+
restored: number;
|
|
203
|
+
awaitingReactivation: number;
|
|
204
|
+
};
|
|
188
205
|
/** {@inheritDoc AiDriver.setContextGuard} */
|
|
189
206
|
setContextGuard(policy?: ContextGuardPolicy): void;
|
|
190
207
|
/** {@inheritDoc AiDriver.compact} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAMZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAK3E,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EAClB,MAAM,4BAA4B,CAAC;AAkBpC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe;AACzB,kDAAkD;AAChD,YAAY;AACd,6EAA6E;GAC3E,UAAU;AACZ;;;;;GAKG;GACD,kBAAkB;AACpB,+DAA+D;GAC7D,kBAAkB;AACpB,kDAAkD;GAChD,gBAAgB;AAClB,kFAAkF;GAChF,sBAAsB;AACxB,oEAAoE;GAClE,mBAAmB;AACrB,0EAA0E;GACxE,QAAQ,CAAC;AAwEb;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,sBAAsB,ijBAIyH,CAAC;AAuB7J;;;;;;GAMG;AACH,qBAAa,mBA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AAO,CAAC,gBAAgB,CAAC;YAmC7E,mBAAmB;IAwJ3B,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIrF,qDAAqD;IACrD,uBAAuB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIjE;;;;OAIG;IACH,iBAAiB,IAAI,wBAAwB,GAAG,SAAS;IAiDzD,4CAA4C;IAC5C,cAAc,IAAI,WAAW,GAAG,SAAS;YAI3B,YAAY;IAqD1B;;;;;;;;;;OAUG;YACW,kBAAkB;IAYhC;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAKd;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAS9B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IAoCrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAgCd,QAAQ;IAmMtB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAe5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,SAAS,CAEjF"}
|
|
1
|
+
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAMZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CA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AE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIjE;;;;OAIG;IACH,iBAAiB,IAAI,wBAAwB,GAAG,SAAS;IAiDzD,4CAA4C;IAC5C,cAAc,IAAI,WAAW,GAAG,SAAS;YAI3B,YAAY;IAqD1B;;;;;;;;;;OAUG;YACW,kBAAkB;IAYhC;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAKd;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAS9B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;IAoCrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAgCd,QAAQ;IAmMtB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;CAe5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,SAAS,CAEjF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { PERSISTED_SESSION_VERSION } from './session-snapshot';
|
|
2
2
|
export type { PersistedSession } from './session-snapshot';
|
|
3
|
+
export type { PersistedCondensePolicy } from '../../utils/condense-history';
|
|
3
4
|
export { WebStorageSessionProvider } from './session-persistence-provider';
|
|
4
5
|
export type { SessionPersistenceProvider, SessionPersistenceConfig, SessionPreferences, } from './session-persistence-provider';
|
|
5
6
|
export { assembleDebugLog, withFreshMetaSnapshot } from './diagnostics';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EACV,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACxE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EACV,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACxE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -196,6 +196,18 @@ export declare class SessionPersister {
|
|
|
196
196
|
* persist or accumulate across reload→save→reload cycles.
|
|
197
197
|
*/
|
|
198
198
|
private messagesToPersist;
|
|
199
|
+
/**
|
|
200
|
+
* The `condenseWhen` policies still waiting to fire for the calls in `messages` (GENC-1632) —
|
|
201
|
+
* the half of condensation `getHistoryForPersistence` cannot carry, because a payload whose
|
|
202
|
+
* trigger has not fired is stored full and needs its policy to collapse after a reload.
|
|
203
|
+
*
|
|
204
|
+
* `flowDropped` is the frozen (non-resumable) save: its snapshot drops the running flow, so the
|
|
205
|
+
* activation that owned the pending payloads does not resume and they are written as ended.
|
|
206
|
+
*
|
|
207
|
+
* Never throws: a failure here costs a resumed session some context, which is not worth losing
|
|
208
|
+
* the save over.
|
|
209
|
+
*/
|
|
210
|
+
private condensePoliciesToPersist;
|
|
199
211
|
/**
|
|
200
212
|
* Capture the current session to durable storage (GENC-1351 §5.1). Reads the
|
|
201
213
|
* full transcript from the driver and the restorable scalars from the store, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-persister.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-persister.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"session-persister.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-persister.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAYrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AA8CnG;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,cAAc,EAAE,MAAM,wBAAwB,CAAC;IAC/C,+EAA+E;IAC/E,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,oEAAoE;IACpE,SAAS,EAAE,MAAM,QAAQ,GAAG,SAAS,CAAC;IACtC,mEAAmE;IACnE,QAAQ,EAAE,MAAM,kBAAkB,GAAG,SAAS,CAAC;IAC/C;;;;OAIG;IACH,oBAAoB,EAAE,MAAM,eAAe,EAAE,CAAC;IAC9C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE;QAC7B,oEAAoE;QACpE,eAAe,EAAE,MAAM,CAAC;QACxB,mEAAmE;QACnE,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,+DAA+D;QAC/D,MAAM,EAAE,MAAM,CAAC;KAChB,KAAK,IAAI,CAAC;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B;;;;;;;;;OASG;YACW,gBAAgB;IAsB9B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,yBAAyB;IAiBjC;;;;OAIG;YACW,cAAc;IAiO5B;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAyL9B;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;IAU/B;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBvC;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAatC;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAchD;;;;;;OAMG;IACH,mBAAmB,IAAI,IAAI;IAiB3B;;;;;;OAMG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,uBAAuB;IA6C/B,sEAAsE;IACtE,OAAO,IAAI,IAAI;CAMhB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChatMessage } from '@genesislcap/foundation-ai';
|
|
2
|
+
import type { PersistedCondensePolicy } from '../../utils/condense-history';
|
|
2
3
|
import type { LoadSessionPayload } from '../ai-assistant-slice';
|
|
3
4
|
/**
|
|
4
5
|
* Schema version of the persisted session shape. Bump on an incompatible
|
|
@@ -51,6 +52,18 @@ export interface PersistedSession {
|
|
|
51
52
|
* value shape is the agent's own, hence `unknown`.
|
|
52
53
|
*/
|
|
53
54
|
agentSnapshots: Record<string, unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* `condenseWhen` policies that had not fired yet when the session was saved, for tool calls in
|
|
57
|
+
* {@link PersistedSession.messages} (GENC-1632). Handed back to the driver on restore so those
|
|
58
|
+
* payloads still collapse when their trigger fires, instead of riding every provider call for the
|
|
59
|
+
* rest of the resumed session at full size. Payloads that HAD already collapsed need no entry:
|
|
60
|
+
* `messages` already stores them as the stubs the model was sent (GENC-1566).
|
|
61
|
+
*
|
|
62
|
+
* Optional and additive, so the schema `version` is unchanged: a snapshot written before this
|
|
63
|
+
* field existed restores exactly as it always did (nothing to re-register), and a reader that
|
|
64
|
+
* predates it ignores it. Omitted rather than written empty when there is nothing to carry.
|
|
65
|
+
*/
|
|
66
|
+
condensePolicies?: PersistedCondensePolicy[];
|
|
54
67
|
/**
|
|
55
68
|
* Interrupted-flow marker (GENC-1351 §5.9). Present when the session was saved
|
|
56
69
|
* while an agent declared its current state non-resumable (`resumable === false`).
|
|
@@ -86,6 +99,7 @@ export interface PersistedSessionInput {
|
|
|
86
99
|
activeModel?: string;
|
|
87
100
|
activeProviderName?: string;
|
|
88
101
|
agentSnapshots?: Record<string, unknown>;
|
|
102
|
+
condensePolicies?: PersistedCondensePolicy[];
|
|
89
103
|
}
|
|
90
104
|
/**
|
|
91
105
|
* Assemble a versioned {@link PersistedSession}, stamping `version` and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE;QACZ,+CAA+C;QAC/C,OAAO,EAAE,MAAM,CAAC;QAChB,gFAAgF;QAChF,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"session-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/state/persistence/session-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,W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3B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,gBAAgB,GAAG,kBAAkB,CAe5E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CA6B/E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAIjF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,GAChC,MAAM,EAAE,CAIV;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAQxE"}
|
|
@@ -42,6 +42,13 @@ export interface RegisteredCondensePolicy {
|
|
|
42
42
|
activation: number;
|
|
43
43
|
/** App-controlled phase epoch when the call was made — the `phaseEnd` clock. */
|
|
44
44
|
phaseEpoch: number;
|
|
45
|
+
/**
|
|
46
|
+
* Name of the agent whose activation made the call (`undefined` on a driver with no installed
|
|
47
|
+
* agent). Not read by any trigger — `activation` is the clock — but a restored entry needs it to
|
|
48
|
+
* tell whether the agent re-activated after a reload is the one that owned the call, or a
|
|
49
|
+
* different one that has taken over (GENC-1632, see {@link rebaseRestoredCondensePolicy}).
|
|
50
|
+
*/
|
|
51
|
+
agent?: string;
|
|
45
52
|
/** `context.condensed` already emitted for the args payload (fire-once). */
|
|
46
53
|
reportedArgs?: boolean;
|
|
47
54
|
/** `context.condensed` already emitted for the response payload (fire-once). */
|
|
@@ -105,6 +112,113 @@ export interface CondenseContext {
|
|
|
105
112
|
*/
|
|
106
113
|
batchCalls?: number;
|
|
107
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* The driver's four condensation clocks as raw values — what {@link RegisteredCondensePolicy}
|
|
117
|
+
* stamps at `condenseWhen` time, and what a persisted entry is re-expressed against on the way out
|
|
118
|
+
* and rebased onto on the way back in (GENC-1632).
|
|
119
|
+
*/
|
|
120
|
+
export interface CondenseClocks {
|
|
121
|
+
modelCall: number;
|
|
122
|
+
turn: number;
|
|
123
|
+
activation: number;
|
|
124
|
+
phaseEpoch: number;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A `condenseWhen` policy that had NOT fired when the session was saved, in the shape it is
|
|
128
|
+
* persisted in (GENC-1632).
|
|
129
|
+
*
|
|
130
|
+
* The clocks are stored as **elapsed counts, never raw values**, and that is the whole design. All
|
|
131
|
+
* four driver clocks restart at 0 on a page reload, so a raw stamp means nothing to the driver that
|
|
132
|
+
* reads it back, and it is wrong in whichever direction the arithmetic happens to fall. A phase
|
|
133
|
+
* epoch of 1 restored against a fresh driver's 0 needs TWO `endPhase()` calls to fire, so the
|
|
134
|
+
* Planning-phase document it guards is never shed at the end of Planning; an activation stamp
|
|
135
|
+
* that lands below the fresh driver's clock reads as "a later activation began" — the `agentEnd`
|
|
136
|
+
* trigger — and collapses the payload on the first provider call after the reload, mid-phase.
|
|
137
|
+
* "How far each clock had moved past the call when it was saved" survives any reset, because it
|
|
138
|
+
* is re-applied relative to whatever the new driver's clocks happen to read.
|
|
139
|
+
*
|
|
140
|
+
* Only unfired entries are persisted: a fired one has already been rendered into the stored
|
|
141
|
+
* transcript as the stub the model was sent (GENC-1566), so there is nothing left for it to do.
|
|
142
|
+
*
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
export interface PersistedCondensePolicy {
|
|
146
|
+
/** The tool call the policy is registered against. */
|
|
147
|
+
toolCallId: string;
|
|
148
|
+
/** The policy exactly as the tool declared it. */
|
|
149
|
+
policy: CondensePolicy;
|
|
150
|
+
/** Name of the agent whose activation made the call; absent on a driver with no installed agent. */
|
|
151
|
+
agent?: string;
|
|
152
|
+
/**
|
|
153
|
+
* How far each clock had advanced past the call's stamp at save time. `0` means "still the
|
|
154
|
+
* current one": the call's turn / activation / phase was the live one when the session was
|
|
155
|
+
* saved. A positive count means that boundary had already passed, so the trigger keyed on it
|
|
156
|
+
* fires on the first provider call after restore (it would have fired on the next call anyway;
|
|
157
|
+
* it only had not been latched because no call had happened since).
|
|
158
|
+
*/
|
|
159
|
+
elapsed: {
|
|
160
|
+
modelCalls: number;
|
|
161
|
+
turns: number;
|
|
162
|
+
activations: number;
|
|
163
|
+
phases: number;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** Whether `t` is a well-formed trigger — the same rule `condenseWhen` enforces on registration. */
|
|
167
|
+
export declare function isValidCondenseTrigger(t: CondenseTrigger | undefined): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Every tool-call id carried by an assistant message in `history`. Exported so the save side
|
|
170
|
+
* ({@link snapshotCondensePolicies}) and the restore side (`ChatDriver.restoreCondensePolicies`)
|
|
171
|
+
* compute "is this call still present?" from one definition — GENC-1632 review: the two had drifted
|
|
172
|
+
* into separate copies of the same loop.
|
|
173
|
+
*/
|
|
174
|
+
export declare function toolCallIdsIn(history: readonly ChatMessage[]): Set<string>;
|
|
175
|
+
/**
|
|
176
|
+
* The entries to PERSIST alongside `history` (GENC-1632): every registered policy that has not
|
|
177
|
+
* fired yet and whose tool call is still in the transcript being saved, re-expressed as elapsed
|
|
178
|
+
* clock counts (see {@link PersistedCondensePolicy}).
|
|
179
|
+
*
|
|
180
|
+
* `history` is the transcript actually being written, not the driver's live one, because the two
|
|
181
|
+
* can differ: a non-resumable save freezes at the last user message, and a compaction may have
|
|
182
|
+
* summarised a call away. An entry whose call is not in the saved transcript has nothing to
|
|
183
|
+
* collapse after a reload, so it is not written.
|
|
184
|
+
*
|
|
185
|
+
* Pure, no writes to the registry — safe on a save path that runs on every autosave.
|
|
186
|
+
*/
|
|
187
|
+
export declare function snapshotCondensePolicies(policies: ReadonlyMap<string, RegisteredCondensePolicy>, clocks: CondenseClocks, history: readonly ChatMessage[]): PersistedCondensePolicy[];
|
|
188
|
+
/**
|
|
189
|
+
* Validate one persisted entry read back from storage. Returns `undefined` for anything that is not
|
|
190
|
+
* a well-formed {@link PersistedCondensePolicy} — the blob came off a disk or a network, and a
|
|
191
|
+
* policy that cannot be evaluated must be dropped rather than reach `applyCondensation`, which
|
|
192
|
+
* trusts its registry. A missing or malformed `elapsed` count reads as `0` (the boundary had not
|
|
193
|
+
* passed), which errs towards keeping a payload visible rather than eliding it.
|
|
194
|
+
*/
|
|
195
|
+
export declare function parsePersistedCondensePolicy(value: unknown): PersistedCondensePolicy | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Re-register a persisted entry against a (typically fresh) driver's clocks (GENC-1632): each
|
|
198
|
+
* stamp is the current clock minus the elapsed count, so every trigger stands exactly as far from
|
|
199
|
+
* firing as it did when the session was saved.
|
|
200
|
+
*
|
|
201
|
+
* Per clock, what that means after a reload:
|
|
202
|
+
* - `age` — exact. The model-call distance is preserved, so a result seen twice of its three
|
|
203
|
+
* allowed looks gets one more. The rebased `iteration` is usually negative (the call predates
|
|
204
|
+
* this driver's first model call), which the trigger arithmetic is indifferent to; it does
|
|
205
|
+
* surface as a negative `turn` on the eventual `context.condensed` event.
|
|
206
|
+
* - `turnEnd` — a call from the turn that was running at save time collapses on the next
|
|
207
|
+
* `sendMessage`. That is the original intent, not an approximation: a reload ends the turn.
|
|
208
|
+
* - `phaseEnd` — collapses at the next `endPhase()`, or at once if the phase had already ended.
|
|
209
|
+
* - `agentEnd` (and `phaseEnd`'s backstop) — an entry whose activation had already ended collapses
|
|
210
|
+
* at once. One owned by the activation live at save time is stamped with the CURRENT
|
|
211
|
+
* activation, which reads as live; but the driver will very likely advance its activation clock
|
|
212
|
+
* when the agent is re-installed after the reload, so this stamp is provisional and the driver
|
|
213
|
+
* must re-stamp it at that point — see `ChatDriver.installAgent`. Leaving it here would collapse
|
|
214
|
+
* the payload the moment the flow resumes, which is the failure this whole mechanism exists to
|
|
215
|
+
* avoid.
|
|
216
|
+
*
|
|
217
|
+
* The `reported*` latches start clear, so the eventual full→stub transition reports once, like any
|
|
218
|
+
* other entry. The stored transcript cannot hold a stub for an unfired entry, so there is no
|
|
219
|
+
* earlier report to duplicate.
|
|
220
|
+
*/
|
|
221
|
+
export declare function rebaseRestoredCondensePolicy(entry: PersistedCondensePolicy, clocks: CondenseClocks): RegisteredCondensePolicy;
|
|
108
222
|
/**
|
|
109
223
|
* Structured detail for a `context.condensed` meta-event. The index signature
|
|
110
224
|
* lets it satisfy `recordMetaEvent`'s `Record<string, unknown>` detail param
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condense-history.d.ts","sourceRoot":"","sources":["../../../src/utils/condense-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG/F;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,uFAAuF;AACvF,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,cAAc,CAAC;IACvB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gFAAgF;IAChF,gBAAgB,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AC,MAAM,EAAE,wBAAwB,CAAC,GACtD,WAAW,EAAE,CA8Df"}
|
|
1
|
+
{"version":3,"file":"condense-history.d.ts","sourceRoot":"","sources":["../../../src/utils/condense-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG/F;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,uFAAuF;AACvF,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,cAAc,CAAC;IACvB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IACjD;;;OAGG;IACH,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;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