@robota-sdk/agent-session 3.0.0-beta.95 → 3.0.0-beta.97
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/CHANGELOG.md +31 -0
- package/README.md +43 -2
- package/dist/node/index.cjs +10 -10
- package/dist/node/index.d.cts +90 -77
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.ts +90 -77
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +10 -10
- package/dist/node/index.js.map +1 -1
- package/package.json +5 -5
package/dist/node/index.d.cts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { ConversationAgent, IAIProvider, IAgentConfig, IContextWindowState, IEventService, IExecutionJournal, IHistoryEntry, IHookTypeExecutor, IPathProtectionPolicy, IRecoverableExecutionJournal, IResponseFormatConfig, IResumeExecutionOptions, IRunTraceContext, ISpinner, ISubprocessTraceEnv, ITerminalOutput, IToolAppView, IToolExecutionContext, IToolExecutionResult, IToolResultSpillStore, IToolSchema, IToolWaitRequest, IToolWithEventService, IUserInteraction, TBackgroundPermissionPolicy, TModelEffort, TModelEffortSelection, TPermissionMode, TSessionEndReason, TToolArgs, TToolChoice, TToolParameters, TUniversalMessage, TUniversalMessagePart, TUniversalValue } from "@robota-sdk/agent-core";
|
|
2
|
-
import { ICompactEvent, IInteractiveSessionRecord, IInteractiveSessionRecord as IInteractiveSessionRecord$1, IInteractiveSessionRecord as ISessionRecord, IInteractiveSessionStore, IInteractiveSessionStore as IInteractiveSessionStore$1, IInteractiveSessionStore as ISessionStore, IPromptHistoryBlock, IPromptHistoryEntry, IPromptHistoryReadOptions, IPromptHistorySource, IPromptHistoryWriter, IRuntimeToolInvokeOptions, ISessionListEntry, ISessionRecordDecodeIssue, TCompactTrigger, TPermissionRequester, TPermissionResultValue, TSessionLoadOutcome } from "@robota-sdk/agent-interface-session";
|
|
1
|
+
import { ConversationAgent, IAIProvider, IAgentConfig, IContextWindowState, IEventService, IExecutionJournal, IHistoryEntry, IHookTypeExecutor, IPathProtectionPolicy, IProviderRegistrationOptions, IRecoverableExecutionJournal, IResponseFormatConfig, IResumeExecutionOptions, IRunTraceContext, ISpinner, ISubprocessTraceEnv, ITerminalOutput, IToolAppView, IToolExecutionContext, IToolExecutionResult, IToolResultSpillStore, IToolSchema, IToolWaitRequest, IToolWithEventService, IUserInteraction, TBackgroundPermissionPolicy, TModelEffort, TModelEffortSelection, TPermissionMode, TProviderOwnership, TSessionEndReason, TToolArgs, TToolChoice, TToolParameters, TUniversalMessage, TUniversalMessagePart, TUniversalValue } from "@robota-sdk/agent-core";
|
|
2
|
+
import { ICompactEvent, IInteractiveSessionRecord, IInteractiveSessionRecord as IInteractiveSessionRecord$1, IInteractiveSessionRecord as ISessionRecord, IInteractiveSessionStore, IInteractiveSessionStore as IInteractiveSessionStore$1, IInteractiveSessionStore as ISessionStore, IPromptHistoryBlock, IPromptHistoryEntry, IPromptHistoryReadOptions, IPromptHistorySource, IPromptHistoryWriter, IRuntimeToolInvokeOptions, ISessionConversationSnapshot, ISessionListEntry, ISessionPendingExecution, ISessionRecordDecodeIssue, TCompactTrigger, TPermissionRequester, TPermissionResultValue, TSessionLoadOutcome } from "@robota-sdk/agent-interface-session";
|
|
3
3
|
//#region src/context-window-tracker.d.ts
|
|
4
4
|
/** Auto-compact when context usage reaches this fraction */
|
|
5
5
|
declare const AUTO_COMPACT_THRESHOLD = 0.835;
|
|
6
6
|
type TAutoCompactThreshold = number | false;
|
|
7
7
|
declare class ContextWindowTracker {
|
|
8
8
|
private contextUsedTokens;
|
|
9
|
-
private
|
|
9
|
+
private contextMaxTokens;
|
|
10
|
+
private readonly contextMaxTokensOverride;
|
|
10
11
|
private autoCompactThreshold;
|
|
11
12
|
constructor(model: string, contextMaxTokens?: number, autoCompactThreshold?: TAutoCompactThreshold);
|
|
12
13
|
/** Get current context window state */
|
|
13
14
|
getContextState(): IContextWindowState;
|
|
14
15
|
/** Whether auto-compaction threshold has been exceeded */
|
|
15
|
-
shouldAutoCompact(): boolean;
|
|
16
|
+
shouldAutoCompact(requestMessages?: TUniversalMessage[]): boolean;
|
|
17
|
+
/** Follow the active model unless the host supplied its own context budget. */
|
|
18
|
+
setModel(model: string): void;
|
|
16
19
|
/** The auto-compaction policy for this tracker. */
|
|
17
20
|
getAutoCompactThreshold(): TAutoCompactThreshold;
|
|
18
21
|
/** Update the auto-compaction policy for this tracker. */
|
|
@@ -313,6 +316,8 @@ interface ISessionOptions {
|
|
|
313
316
|
wrapAddedTools?: (tools: IToolWithEventService[]) => IToolWithEventService[];
|
|
314
317
|
/** Pre-constructed AI provider */
|
|
315
318
|
provider: IAIProvider;
|
|
319
|
+
/** Defaults to owned; a borrowed provider is closed by its external owner. */
|
|
320
|
+
providerOwnership?: TProviderOwnership;
|
|
316
321
|
/** Pre-built system message string */
|
|
317
322
|
systemMessage: string;
|
|
318
323
|
/** Terminal I/O for permission prompts */
|
|
@@ -538,15 +543,6 @@ type TSessionExecutionResult = {
|
|
|
538
543
|
status: 'waiting';
|
|
539
544
|
requests: readonly IToolWaitRequest[];
|
|
540
545
|
};
|
|
541
|
-
/**
|
|
542
|
-
* A journaled execution whose round is open in history — parked on saved waits, or stopped by a
|
|
543
|
-
* failure — so the Session accepts no new input until it is resumed or abandoned. `requests` are
|
|
544
|
-
* the saved waits whose effect has not been admitted; empty when a failure left the round open.
|
|
545
|
-
*/
|
|
546
|
-
interface ISessionPendingExecution {
|
|
547
|
-
executionId: string;
|
|
548
|
-
requests: readonly IToolWaitRequest[];
|
|
549
|
-
}
|
|
550
546
|
//#endregion
|
|
551
547
|
//#region src/turn-claim.d.ts
|
|
552
548
|
/**
|
|
@@ -623,6 +619,67 @@ declare class TurnClaim {
|
|
|
623
619
|
isRunning(): boolean;
|
|
624
620
|
}
|
|
625
621
|
//#endregion
|
|
622
|
+
//#region src/compaction-orchestrator.d.ts
|
|
623
|
+
/**
|
|
624
|
+
* Thrown when a compaction summary is invalid (non-string or empty provider content).
|
|
625
|
+
* Conversation history is append-only source data — callers must not clear or replace
|
|
626
|
+
* it when this is thrown (see SPEC § Compaction Failure Contract).
|
|
627
|
+
*/
|
|
628
|
+
declare class CompactionError extends Error {
|
|
629
|
+
constructor(message: string);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Default base template for the compaction summarization prompt — the one model-facing
|
|
633
|
+
* prompt surface this package owns (declared in SPEC § Boundaries). Intentionally
|
|
634
|
+
* domain-neutral: it must not assume a software-development conversation. Replaceable
|
|
635
|
+
* wholesale via {@link ICompactionOptions.basePrompt}.
|
|
636
|
+
*/
|
|
637
|
+
declare const DEFAULT_COMPACTION_PROMPT: string;
|
|
638
|
+
interface ICompactionOptions {
|
|
639
|
+
sessionId: string;
|
|
640
|
+
cwd: string;
|
|
641
|
+
model: string;
|
|
642
|
+
hooks?: Record<string, unknown>;
|
|
643
|
+
compactInstructions?: string;
|
|
644
|
+
/**
|
|
645
|
+
* Replaces the entire base instruction template of the compaction prompt
|
|
646
|
+
* (default: {@link DEFAULT_COMPACTION_PROMPT}). Focus instructions and the
|
|
647
|
+
* formatted conversation are appended after it.
|
|
648
|
+
*/
|
|
649
|
+
basePrompt?: string;
|
|
650
|
+
/** Additional hook type executors (e.g. prompt, agent) beyond the core defaults. */
|
|
651
|
+
hookTypeExecutors?: IHookTypeExecutor[];
|
|
652
|
+
}
|
|
653
|
+
declare class CompactionOrchestrator {
|
|
654
|
+
private readonly sessionId;
|
|
655
|
+
private readonly cwd;
|
|
656
|
+
private model;
|
|
657
|
+
private readonly hooks?;
|
|
658
|
+
private readonly compactInstructions?;
|
|
659
|
+
private readonly basePrompt?;
|
|
660
|
+
private readonly hookTypeExecutors?;
|
|
661
|
+
constructor(options: ICompactionOptions);
|
|
662
|
+
setModel(model: string): void;
|
|
663
|
+
/**
|
|
664
|
+
* Run compaction — summarize the conversation to free context space.
|
|
665
|
+
* @param provider - The AI provider to use for summarization
|
|
666
|
+
* @param history - The messages to summarise. Must not be empty: whether there is anything worth
|
|
667
|
+
* compacting is the caller's judgement, made before it commits to replacing the conversation
|
|
668
|
+
* (CORE-031).
|
|
669
|
+
* @param instructions - Optional focus instructions for the summary
|
|
670
|
+
* @param signal - The turn's cancellation signal (RUNTIME-004). Checked before the provider call
|
|
671
|
+
* and again after it: an abort throws rather than returning, so the caller's existing
|
|
672
|
+
* leave-history-untouched path covers a cancel as well as a failure.
|
|
673
|
+
* @param hookTraceEnv - The prompt's trace for PreCompact's command hooks, only inside a prompt
|
|
674
|
+
* @returns The generated summary string (always a non-empty string)
|
|
675
|
+
* @throws {CompactionError} when `history` is empty, or when the provider returns a non-string or
|
|
676
|
+
* empty summary — callers must leave the conversation history untouched in every such case
|
|
677
|
+
*/
|
|
678
|
+
compact(provider: IAIProvider, history: TUniversalMessage[], instructions?: string, signal?: AbortSignal, trigger?: TCompactTrigger, hookTraceEnv?: ISubprocessTraceEnv, executionJournal?: IExecutionJournal): Promise<string>;
|
|
679
|
+
/** Build the compaction prompt from conversation history */
|
|
680
|
+
private buildCompactionPrompt;
|
|
681
|
+
}
|
|
682
|
+
//#endregion
|
|
626
683
|
//#region src/permission-denial-log.d.ts
|
|
627
684
|
/**
|
|
628
685
|
* Why a call was refused:
|
|
@@ -781,9 +838,11 @@ declare class PermissionEnforcer {
|
|
|
781
838
|
//#endregion
|
|
782
839
|
//#region src/session-base.d.ts
|
|
783
840
|
declare abstract class SessionBase {
|
|
841
|
+
abstract assertInputAllowed(): void;
|
|
784
842
|
protected abstract readonly agent: ConversationAgent;
|
|
785
843
|
protected abstract readonly permissionEnforcer: PermissionEnforcer;
|
|
786
844
|
protected abstract readonly contextTracker: ContextWindowTracker;
|
|
845
|
+
protected abstract readonly compactionOrchestrator: CompactionOrchestrator;
|
|
787
846
|
protected abstract permissionMode: TPermissionMode;
|
|
788
847
|
protected abstract activePresetId: string;
|
|
789
848
|
protected abstract parallelSubagentsEnabled: boolean;
|
|
@@ -852,6 +911,7 @@ declare abstract class SessionBase {
|
|
|
852
911
|
temperature?: number;
|
|
853
912
|
maxOutputTokens?: number;
|
|
854
913
|
}): Promise<void>;
|
|
914
|
+
protected setActiveModel(model: string): void;
|
|
855
915
|
/** Read the selection for the next model call; provider default remains `auto`. */
|
|
856
916
|
getModelEffort(): TModelEffortSelection;
|
|
857
917
|
/** Run an operation with a temporary effort override and restore it on every exit path. */
|
|
@@ -986,7 +1046,7 @@ declare class Session extends SessionBase {
|
|
|
986
1046
|
private readonly onCompactEventCallback?;
|
|
987
1047
|
private readonly sessionLogger?;
|
|
988
1048
|
private readonly maxTurns?;
|
|
989
|
-
|
|
1049
|
+
protected readonly compactionOrchestrator: CompactionOrchestrator;
|
|
990
1050
|
private readonly runtimeTools;
|
|
991
1051
|
private readonly wrapAddedTools;
|
|
992
1052
|
/** Tools added while a turn ran, applied when the next one starts. */
|
|
@@ -995,7 +1055,10 @@ declare class Session extends SessionBase {
|
|
|
995
1055
|
private toolChange;
|
|
996
1056
|
private shuttingDown;
|
|
997
1057
|
/** Set while a journaled execution's round is open in history; cleared once it settles or is abandoned. */
|
|
998
|
-
private
|
|
1058
|
+
private recoveryState;
|
|
1059
|
+
private checkpointing;
|
|
1060
|
+
private get pendingExecution();
|
|
1061
|
+
private setPending;
|
|
999
1062
|
private shutdownPromise;
|
|
1000
1063
|
/** Stdout collected from SessionStart hooks, injected on first run(). */
|
|
1001
1064
|
private sessionStartStdout;
|
|
@@ -1024,6 +1087,16 @@ declare class Session extends SessionBase {
|
|
|
1024
1087
|
* records stay with the host. Resuming the execution afterwards is refused as a history conflict.
|
|
1025
1088
|
*/
|
|
1026
1089
|
abandonPendingExecution(executionId: string): void;
|
|
1090
|
+
/** Refuse admission before callers resolve input or change scheduling state. */
|
|
1091
|
+
assertInputAllowed(): void;
|
|
1092
|
+
private assertCheckpointSettled;
|
|
1093
|
+
getConversationSnapshot(): ISessionConversationSnapshot;
|
|
1094
|
+
/** Install a complete same-owner snapshot on a pristine, idle Session. */
|
|
1095
|
+
restoreConversation(snapshot: ISessionConversationSnapshot): void;
|
|
1096
|
+
/** Retry only persistence, never model or tool execution. A sink must acknowledge synchronously. */
|
|
1097
|
+
checkpoint(): void;
|
|
1098
|
+
private commitConversation;
|
|
1099
|
+
private saveAfterFailure;
|
|
1027
1100
|
/**
|
|
1028
1101
|
* Make tools available from the next turn on — for a capability that became usable mid-session,
|
|
1029
1102
|
* such as an MCP server connected after its sign-in. Each goes through the same wrappers and
|
|
@@ -1056,7 +1129,7 @@ declare class Session extends SessionBase {
|
|
|
1056
1129
|
* still run.
|
|
1057
1130
|
*/
|
|
1058
1131
|
shutdown(options?: ISessionShutdownOptions): Promise<void>;
|
|
1059
|
-
swapProvider(newProvider: IAIProvider, model: string): void;
|
|
1132
|
+
swapProvider(newProvider: IAIProvider, model: string, options?: IProviderRegistrationOptions): void;
|
|
1060
1133
|
compact(instructions?: string, trigger?: TCompactTrigger, signal?: AbortSignal, executionJournal?: IExecutionJournal): Promise<void>;
|
|
1061
1134
|
/** `hookTraceEnv` reaches PreCompact only for a compaction inside a prompt (see `executeRun`). */
|
|
1062
1135
|
private compactWith;
|
|
@@ -1067,66 +1140,6 @@ declare class Session extends SessionBase {
|
|
|
1067
1140
|
/** The permission pattern a "don't ask again" answer for this invocation grants. */
|
|
1068
1141
|
declare function consentScopeFor(toolName: string, toolArgs: TToolArgs): string;
|
|
1069
1142
|
//#endregion
|
|
1070
|
-
//#region src/compaction-orchestrator.d.ts
|
|
1071
|
-
/**
|
|
1072
|
-
* Thrown when a compaction summary is invalid (non-string or empty provider content).
|
|
1073
|
-
* Conversation history is append-only source data — callers must not clear or replace
|
|
1074
|
-
* it when this is thrown (see SPEC § Compaction Failure Contract).
|
|
1075
|
-
*/
|
|
1076
|
-
declare class CompactionError extends Error {
|
|
1077
|
-
constructor(message: string);
|
|
1078
|
-
}
|
|
1079
|
-
/**
|
|
1080
|
-
* Default base template for the compaction summarization prompt — the one model-facing
|
|
1081
|
-
* prompt surface this package owns (declared in SPEC § Boundaries). Intentionally
|
|
1082
|
-
* domain-neutral: it must not assume a software-development conversation. Replaceable
|
|
1083
|
-
* wholesale via {@link ICompactionOptions.basePrompt}.
|
|
1084
|
-
*/
|
|
1085
|
-
declare const DEFAULT_COMPACTION_PROMPT: string;
|
|
1086
|
-
interface ICompactionOptions {
|
|
1087
|
-
sessionId: string;
|
|
1088
|
-
cwd: string;
|
|
1089
|
-
model: string;
|
|
1090
|
-
hooks?: Record<string, unknown>;
|
|
1091
|
-
compactInstructions?: string;
|
|
1092
|
-
/**
|
|
1093
|
-
* Replaces the entire base instruction template of the compaction prompt
|
|
1094
|
-
* (default: {@link DEFAULT_COMPACTION_PROMPT}). Focus instructions and the
|
|
1095
|
-
* formatted conversation are appended after it.
|
|
1096
|
-
*/
|
|
1097
|
-
basePrompt?: string;
|
|
1098
|
-
/** Additional hook type executors (e.g. prompt, agent) beyond the core defaults. */
|
|
1099
|
-
hookTypeExecutors?: IHookTypeExecutor[];
|
|
1100
|
-
}
|
|
1101
|
-
declare class CompactionOrchestrator {
|
|
1102
|
-
private readonly sessionId;
|
|
1103
|
-
private readonly cwd;
|
|
1104
|
-
private readonly model;
|
|
1105
|
-
private readonly hooks?;
|
|
1106
|
-
private readonly compactInstructions?;
|
|
1107
|
-
private readonly basePrompt?;
|
|
1108
|
-
private readonly hookTypeExecutors?;
|
|
1109
|
-
constructor(options: ICompactionOptions);
|
|
1110
|
-
/**
|
|
1111
|
-
* Run compaction — summarize the conversation to free context space.
|
|
1112
|
-
* @param provider - The AI provider to use for summarization
|
|
1113
|
-
* @param history - The messages to summarise. Must not be empty: whether there is anything worth
|
|
1114
|
-
* compacting is the caller's judgement, made before it commits to replacing the conversation
|
|
1115
|
-
* (CORE-031).
|
|
1116
|
-
* @param instructions - Optional focus instructions for the summary
|
|
1117
|
-
* @param signal - The turn's cancellation signal (RUNTIME-004). Checked before the provider call
|
|
1118
|
-
* and again after it: an abort throws rather than returning, so the caller's existing
|
|
1119
|
-
* leave-history-untouched path covers a cancel as well as a failure.
|
|
1120
|
-
* @param hookTraceEnv - The prompt's trace for PreCompact's command hooks, only inside a prompt
|
|
1121
|
-
* @returns The generated summary string (always a non-empty string)
|
|
1122
|
-
* @throws {CompactionError} when `history` is empty, or when the provider returns a non-string or
|
|
1123
|
-
* empty summary — callers must leave the conversation history untouched in every such case
|
|
1124
|
-
*/
|
|
1125
|
-
compact(provider: IAIProvider, history: TUniversalMessage[], instructions?: string, signal?: AbortSignal, trigger?: TCompactTrigger, hookTraceEnv?: ISubprocessTraceEnv, executionJournal?: IExecutionJournal): Promise<string>;
|
|
1126
|
-
/** Build the compaction prompt from conversation history */
|
|
1127
|
-
private buildCompactionPrompt;
|
|
1128
|
-
}
|
|
1129
|
-
//#endregion
|
|
1130
1143
|
//#region src/conversation-transcript.d.ts
|
|
1131
1144
|
/**
|
|
1132
1145
|
* Render each message as one entry, in order. An entry is one line, except an assistant message
|
|
@@ -1681,7 +1694,7 @@ type TSessionRecordDecodeOutcome = {
|
|
|
1681
1694
|
* imports this module; declaring it there and importing it back would be a module cycle. The export
|
|
1682
1695
|
* from the package barrel is unchanged.
|
|
1683
1696
|
*/
|
|
1684
|
-
declare const SESSION_RECORD_ENVELOPE_VERSION =
|
|
1697
|
+
declare const SESSION_RECORD_ENVELOPE_VERSION = 2;
|
|
1685
1698
|
/** A persisted record with the version of the shape it was written in. */
|
|
1686
1699
|
interface IVersionedInteractiveSessionRecord {
|
|
1687
1700
|
schemaVersion: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/context-window-tracker.ts","../../src/session-log-reference-types.ts","../../src/session-log-sinks.ts","../../src/session-logger.ts","../../src/auto-mode-gate.ts","../../src/permission-types.ts","../../src/session-types.ts","../../src/session-resume.ts","../../src/session-recoverable.ts","../../src/turn-claim.ts","../../src/permission-denial-log.ts","../../src/permission-enforcer.ts","../../src/session-base.ts","../../src/session.ts","../../src/consent-scope.ts","../../src/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/context-window-tracker.ts","../../src/session-log-reference-types.ts","../../src/session-log-sinks.ts","../../src/session-logger.ts","../../src/auto-mode-gate.ts","../../src/permission-types.ts","../../src/session-types.ts","../../src/session-resume.ts","../../src/session-recoverable.ts","../../src/turn-claim.ts","../../src/compaction-orchestrator.ts","../../src/permission-denial-log.ts","../../src/permission-enforcer.ts","../../src/session-base.ts","../../src/session.ts","../../src/consent-scope.ts","../../src/conversation-transcript.ts","../../src/session-artifact.ts","../../src/scrub-sensitive.ts","../../src/session-log-events.ts","../../src/session-log-entry-types.ts","../../src/session-log-codec/index.ts","../../src/external-payload-source-types.ts","../../src/session-log-sources.ts","../../src/tool-result-spill-store.ts","../../src/prompt-history-file.ts","../../src/external-payload-resolution-contracts.ts","../../src/external-payload-resolver.ts","../../src/session-log-validation.ts","../../src/session-log-replay.ts","../../src/session-id.ts","../../src/session-store.ts","../../src/checkpoint-tree.ts","../../src/session-record-codec/decode-outcome.ts","../../src/session-record-codec/record-decoder.ts"],"mappings":";;;;cAca;KAED;cAEC;UACH;UACA;mBACS;UACT;EAGN,YAAA,eACA,2BACA,uBAAuB;;EAQzB,mBAAmB;;EAcnB,kBAAkB,kBAAkB;;EAWpC,SAAS;;EAKT,2BAA2B;;EAK3B,wBAAwB,sBAAsB;;;;;;;;;;EAa9C,kBAAkB,SAAS;;EAK3B;;;;;;;;;;;UCjFe;EACf;EACA;EACA;EACA;EACA;;;KAIU;KACA,kBAAkB,eAAe;UAE5B;EACf;EACA;;;;;iBCKc,yCACd,mBACA,gBACA,qBACC;;UAac;EACf,UAAU,mBAAmB,gBAAgB,qBAAqB;;;UAInD;EACf,OAAO,mBAAmB;WACjB,sBAAsB;;;cAIpB,8BAA8B,iBAAiB;mBAI7B;WAHpB,qBAAqB;mBACb;EAEY,YAAA;EAqB7B,OAAO,mBAAmB;EAW1B,UAAU,mBAAmB,gBAAgB,qBAAqB;;;;;;;;;;UCZnD;;EAEf,IAAI,mBAAmB,eAAe,MAA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ACf;EACA;EACA;EACA;EACA,UAAU;EACV,SAAS;EACT;EACA;EACA;;KAGU,yBAAyB,KAAK;WAC/B,wBAAwB;;iBASnB,sBACd,QAAQ,mBACR,UAAS,yBACR;iBA6Ba,wBACd,kBAAkB,qBACjB;;;;;;;;;;iBCpCa,gBAAgB;;iBAKhB,oBAAoB;;;;;;;;;cCuCvB,4BAA4B;mBACtB;mBACA;;;;;;;;;EAUL,YAAA,iBAAiB;;;;;;;;;;UAcrB;;;;;;;;;;;;;;UAoBA;;;;;;;;;;;;;;;EA0BR,KAAK,SAAS;;;;;;;;;EAoBd,KAAK,aAAa;;;;;;;;;EA2BlB,iBAAiB;;;;;;;;;;;;;UAuBT;;;;;EAcR,OAAO;;;;;;;;;;;;;;;;;;UCzNQ;EACf;;EAEA;;cAGW;mBACM;;mBAEA;UACT;;;;;;;SAQD,UAAU,OAAO,mBAAmB,oBAAoB;;;;;EAuB/D,cAAc;;;;;EAgBd,KAAK;;EAOL,OAAO;;EAMP;;EAKA;;;;;;EAaA,UAAU;;EAWV,IAAI;;MAKA;;;;;;;;;;;;KC1FM;WACG;WAA0B,QAAQ;;WAElC;WACA,iBAAiB;WACjB;;WAEA;WAAgC;WAA4C;;;;;;;;;;;;;;;;;;;;;;;;;cCY9E;;UAGI;EACf;EACA,QAAQ;;;;;;;;;cAUG;;;;;;;iBAgCG,+BAA+B,iBAAiB;;;;;;;;iBAuChD,wCACd,iBACC"}
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { ConversationAgent, ExecutionSuspendedError, IAIProvider, IAgentConfig, IContextWindowState, IEventService, IExecutionJournal, IHistoryEntry, IHookTypeExecutor, IPathProtectionPolicy, IRecoverableExecutionJournal, IResponseFormatConfig, IResumeExecutionOptions, IRunTraceContext, ISpinner, ISubprocessTraceEnv, ITerminalOutput, IToolAppView, IToolExecutionContext, IToolExecutionResult, IToolResultSpillStore, IToolSchema, IToolWaitRequest, IToolWithEventService, IUserInteraction, TBackgroundPermissionPolicy, TModelEffort, TModelEffortSelection, TPermissionMode, TSessionEndReason, TToolArgs, TToolChoice, TToolParameters, TUniversalMessage, TUniversalMessagePart, TUniversalValue } from "@robota-sdk/agent-core";
|
|
2
|
-
import { ICompactEvent, IInteractiveSessionRecord, IInteractiveSessionRecord as IInteractiveSessionRecord$1, IInteractiveSessionRecord as ISessionRecord, IInteractiveSessionStore, IInteractiveSessionStore as IInteractiveSessionStore$1, IInteractiveSessionStore as ISessionStore, IPromptHistoryBlock, IPromptHistoryEntry, IPromptHistoryReadOptions, IPromptHistorySource, IPromptHistoryWriter, IRuntimeToolInvokeOptions, ISessionListEntry, ISessionRecordDecodeIssue, TCompactTrigger, TPermissionRequester, TPermissionResultValue, TSessionLoadOutcome } from "@robota-sdk/agent-interface-session";
|
|
1
|
+
import { ConversationAgent, ExecutionSuspendedError, IAIProvider, IAgentConfig, IContextWindowState, IEventService, IExecutionJournal, IHistoryEntry, IHookTypeExecutor, IPathProtectionPolicy, IProviderRegistrationOptions, IRecoverableExecutionJournal, IResponseFormatConfig, IResumeExecutionOptions, IRunTraceContext, ISpinner, ISubprocessTraceEnv, ITerminalOutput, IToolAppView, IToolExecutionContext, IToolExecutionResult, IToolResultSpillStore, IToolSchema, IToolWaitRequest, IToolWithEventService, IUserInteraction, TBackgroundPermissionPolicy, TModelEffort, TModelEffortSelection, TPermissionMode, TProviderOwnership, TSessionEndReason, TToolArgs, TToolChoice, TToolParameters, TUniversalMessage, TUniversalMessagePart, TUniversalValue } from "@robota-sdk/agent-core";
|
|
2
|
+
import { ICompactEvent, IInteractiveSessionRecord, IInteractiveSessionRecord as IInteractiveSessionRecord$1, IInteractiveSessionRecord as ISessionRecord, IInteractiveSessionStore, IInteractiveSessionStore as IInteractiveSessionStore$1, IInteractiveSessionStore as ISessionStore, IPromptHistoryBlock, IPromptHistoryEntry, IPromptHistoryReadOptions, IPromptHistorySource, IPromptHistoryWriter, IRuntimeToolInvokeOptions, ISessionConversationSnapshot, ISessionListEntry, ISessionPendingExecution, ISessionRecordDecodeIssue, TCompactTrigger, TPermissionRequester, TPermissionResultValue, TSessionLoadOutcome } from "@robota-sdk/agent-interface-session";
|
|
3
3
|
//#region src/context-window-tracker.d.ts
|
|
4
4
|
/** Auto-compact when context usage reaches this fraction */
|
|
5
5
|
declare const AUTO_COMPACT_THRESHOLD = 0.835;
|
|
6
6
|
type TAutoCompactThreshold = number | false;
|
|
7
7
|
declare class ContextWindowTracker {
|
|
8
8
|
private contextUsedTokens;
|
|
9
|
-
private
|
|
9
|
+
private contextMaxTokens;
|
|
10
|
+
private readonly contextMaxTokensOverride;
|
|
10
11
|
private autoCompactThreshold;
|
|
11
12
|
constructor(model: string, contextMaxTokens?: number, autoCompactThreshold?: TAutoCompactThreshold);
|
|
12
13
|
/** Get current context window state */
|
|
13
14
|
getContextState(): IContextWindowState;
|
|
14
15
|
/** Whether auto-compaction threshold has been exceeded */
|
|
15
|
-
shouldAutoCompact(): boolean;
|
|
16
|
+
shouldAutoCompact(requestMessages?: TUniversalMessage[]): boolean;
|
|
17
|
+
/** Follow the active model unless the host supplied its own context budget. */
|
|
18
|
+
setModel(model: string): void;
|
|
16
19
|
/** The auto-compaction policy for this tracker. */
|
|
17
20
|
getAutoCompactThreshold(): TAutoCompactThreshold;
|
|
18
21
|
/** Update the auto-compaction policy for this tracker. */
|
|
@@ -313,6 +316,8 @@ interface ISessionOptions {
|
|
|
313
316
|
wrapAddedTools?: (tools: IToolWithEventService[]) => IToolWithEventService[];
|
|
314
317
|
/** Pre-constructed AI provider */
|
|
315
318
|
provider: IAIProvider;
|
|
319
|
+
/** Defaults to owned; a borrowed provider is closed by its external owner. */
|
|
320
|
+
providerOwnership?: TProviderOwnership;
|
|
316
321
|
/** Pre-built system message string */
|
|
317
322
|
systemMessage: string;
|
|
318
323
|
/** Terminal I/O for permission prompts */
|
|
@@ -538,15 +543,6 @@ type TSessionExecutionResult = {
|
|
|
538
543
|
status: 'waiting';
|
|
539
544
|
requests: readonly IToolWaitRequest[];
|
|
540
545
|
};
|
|
541
|
-
/**
|
|
542
|
-
* A journaled execution whose round is open in history — parked on saved waits, or stopped by a
|
|
543
|
-
* failure — so the Session accepts no new input until it is resumed or abandoned. `requests` are
|
|
544
|
-
* the saved waits whose effect has not been admitted; empty when a failure left the round open.
|
|
545
|
-
*/
|
|
546
|
-
interface ISessionPendingExecution {
|
|
547
|
-
executionId: string;
|
|
548
|
-
requests: readonly IToolWaitRequest[];
|
|
549
|
-
}
|
|
550
546
|
//#endregion
|
|
551
547
|
//#region src/turn-claim.d.ts
|
|
552
548
|
/**
|
|
@@ -623,6 +619,67 @@ declare class TurnClaim {
|
|
|
623
619
|
isRunning(): boolean;
|
|
624
620
|
}
|
|
625
621
|
//#endregion
|
|
622
|
+
//#region src/compaction-orchestrator.d.ts
|
|
623
|
+
/**
|
|
624
|
+
* Thrown when a compaction summary is invalid (non-string or empty provider content).
|
|
625
|
+
* Conversation history is append-only source data — callers must not clear or replace
|
|
626
|
+
* it when this is thrown (see SPEC § Compaction Failure Contract).
|
|
627
|
+
*/
|
|
628
|
+
declare class CompactionError extends Error {
|
|
629
|
+
constructor(message: string);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Default base template for the compaction summarization prompt — the one model-facing
|
|
633
|
+
* prompt surface this package owns (declared in SPEC § Boundaries). Intentionally
|
|
634
|
+
* domain-neutral: it must not assume a software-development conversation. Replaceable
|
|
635
|
+
* wholesale via {@link ICompactionOptions.basePrompt}.
|
|
636
|
+
*/
|
|
637
|
+
declare const DEFAULT_COMPACTION_PROMPT: string;
|
|
638
|
+
interface ICompactionOptions {
|
|
639
|
+
sessionId: string;
|
|
640
|
+
cwd: string;
|
|
641
|
+
model: string;
|
|
642
|
+
hooks?: Record<string, unknown>;
|
|
643
|
+
compactInstructions?: string;
|
|
644
|
+
/**
|
|
645
|
+
* Replaces the entire base instruction template of the compaction prompt
|
|
646
|
+
* (default: {@link DEFAULT_COMPACTION_PROMPT}). Focus instructions and the
|
|
647
|
+
* formatted conversation are appended after it.
|
|
648
|
+
*/
|
|
649
|
+
basePrompt?: string;
|
|
650
|
+
/** Additional hook type executors (e.g. prompt, agent) beyond the core defaults. */
|
|
651
|
+
hookTypeExecutors?: IHookTypeExecutor[];
|
|
652
|
+
}
|
|
653
|
+
declare class CompactionOrchestrator {
|
|
654
|
+
private readonly sessionId;
|
|
655
|
+
private readonly cwd;
|
|
656
|
+
private model;
|
|
657
|
+
private readonly hooks?;
|
|
658
|
+
private readonly compactInstructions?;
|
|
659
|
+
private readonly basePrompt?;
|
|
660
|
+
private readonly hookTypeExecutors?;
|
|
661
|
+
constructor(options: ICompactionOptions);
|
|
662
|
+
setModel(model: string): void;
|
|
663
|
+
/**
|
|
664
|
+
* Run compaction — summarize the conversation to free context space.
|
|
665
|
+
* @param provider - The AI provider to use for summarization
|
|
666
|
+
* @param history - The messages to summarise. Must not be empty: whether there is anything worth
|
|
667
|
+
* compacting is the caller's judgement, made before it commits to replacing the conversation
|
|
668
|
+
* (CORE-031).
|
|
669
|
+
* @param instructions - Optional focus instructions for the summary
|
|
670
|
+
* @param signal - The turn's cancellation signal (RUNTIME-004). Checked before the provider call
|
|
671
|
+
* and again after it: an abort throws rather than returning, so the caller's existing
|
|
672
|
+
* leave-history-untouched path covers a cancel as well as a failure.
|
|
673
|
+
* @param hookTraceEnv - The prompt's trace for PreCompact's command hooks, only inside a prompt
|
|
674
|
+
* @returns The generated summary string (always a non-empty string)
|
|
675
|
+
* @throws {CompactionError} when `history` is empty, or when the provider returns a non-string or
|
|
676
|
+
* empty summary — callers must leave the conversation history untouched in every such case
|
|
677
|
+
*/
|
|
678
|
+
compact(provider: IAIProvider, history: TUniversalMessage[], instructions?: string, signal?: AbortSignal, trigger?: TCompactTrigger, hookTraceEnv?: ISubprocessTraceEnv, executionJournal?: IExecutionJournal): Promise<string>;
|
|
679
|
+
/** Build the compaction prompt from conversation history */
|
|
680
|
+
private buildCompactionPrompt;
|
|
681
|
+
}
|
|
682
|
+
//#endregion
|
|
626
683
|
//#region src/permission-denial-log.d.ts
|
|
627
684
|
/**
|
|
628
685
|
* Why a call was refused:
|
|
@@ -781,9 +838,11 @@ declare class PermissionEnforcer {
|
|
|
781
838
|
//#endregion
|
|
782
839
|
//#region src/session-base.d.ts
|
|
783
840
|
declare abstract class SessionBase {
|
|
841
|
+
abstract assertInputAllowed(): void;
|
|
784
842
|
protected abstract readonly agent: ConversationAgent;
|
|
785
843
|
protected abstract readonly permissionEnforcer: PermissionEnforcer;
|
|
786
844
|
protected abstract readonly contextTracker: ContextWindowTracker;
|
|
845
|
+
protected abstract readonly compactionOrchestrator: CompactionOrchestrator;
|
|
787
846
|
protected abstract permissionMode: TPermissionMode;
|
|
788
847
|
protected abstract activePresetId: string;
|
|
789
848
|
protected abstract parallelSubagentsEnabled: boolean;
|
|
@@ -852,6 +911,7 @@ declare abstract class SessionBase {
|
|
|
852
911
|
temperature?: number;
|
|
853
912
|
maxOutputTokens?: number;
|
|
854
913
|
}): Promise<void>;
|
|
914
|
+
protected setActiveModel(model: string): void;
|
|
855
915
|
/** Read the selection for the next model call; provider default remains `auto`. */
|
|
856
916
|
getModelEffort(): TModelEffortSelection;
|
|
857
917
|
/** Run an operation with a temporary effort override and restore it on every exit path. */
|
|
@@ -986,7 +1046,7 @@ declare class Session extends SessionBase {
|
|
|
986
1046
|
private readonly onCompactEventCallback?;
|
|
987
1047
|
private readonly sessionLogger?;
|
|
988
1048
|
private readonly maxTurns?;
|
|
989
|
-
|
|
1049
|
+
protected readonly compactionOrchestrator: CompactionOrchestrator;
|
|
990
1050
|
private readonly runtimeTools;
|
|
991
1051
|
private readonly wrapAddedTools;
|
|
992
1052
|
/** Tools added while a turn ran, applied when the next one starts. */
|
|
@@ -995,7 +1055,10 @@ declare class Session extends SessionBase {
|
|
|
995
1055
|
private toolChange;
|
|
996
1056
|
private shuttingDown;
|
|
997
1057
|
/** Set while a journaled execution's round is open in history; cleared once it settles or is abandoned. */
|
|
998
|
-
private
|
|
1058
|
+
private recoveryState;
|
|
1059
|
+
private checkpointing;
|
|
1060
|
+
private get pendingExecution();
|
|
1061
|
+
private setPending;
|
|
999
1062
|
private shutdownPromise;
|
|
1000
1063
|
/** Stdout collected from SessionStart hooks, injected on first run(). */
|
|
1001
1064
|
private sessionStartStdout;
|
|
@@ -1024,6 +1087,16 @@ declare class Session extends SessionBase {
|
|
|
1024
1087
|
* records stay with the host. Resuming the execution afterwards is refused as a history conflict.
|
|
1025
1088
|
*/
|
|
1026
1089
|
abandonPendingExecution(executionId: string): void;
|
|
1090
|
+
/** Refuse admission before callers resolve input or change scheduling state. */
|
|
1091
|
+
assertInputAllowed(): void;
|
|
1092
|
+
private assertCheckpointSettled;
|
|
1093
|
+
getConversationSnapshot(): ISessionConversationSnapshot;
|
|
1094
|
+
/** Install a complete same-owner snapshot on a pristine, idle Session. */
|
|
1095
|
+
restoreConversation(snapshot: ISessionConversationSnapshot): void;
|
|
1096
|
+
/** Retry only persistence, never model or tool execution. A sink must acknowledge synchronously. */
|
|
1097
|
+
checkpoint(): void;
|
|
1098
|
+
private commitConversation;
|
|
1099
|
+
private saveAfterFailure;
|
|
1027
1100
|
/**
|
|
1028
1101
|
* Make tools available from the next turn on — for a capability that became usable mid-session,
|
|
1029
1102
|
* such as an MCP server connected after its sign-in. Each goes through the same wrappers and
|
|
@@ -1056,7 +1129,7 @@ declare class Session extends SessionBase {
|
|
|
1056
1129
|
* still run.
|
|
1057
1130
|
*/
|
|
1058
1131
|
shutdown(options?: ISessionShutdownOptions): Promise<void>;
|
|
1059
|
-
swapProvider(newProvider: IAIProvider, model: string): void;
|
|
1132
|
+
swapProvider(newProvider: IAIProvider, model: string, options?: IProviderRegistrationOptions): void;
|
|
1060
1133
|
compact(instructions?: string, trigger?: TCompactTrigger, signal?: AbortSignal, executionJournal?: IExecutionJournal): Promise<void>;
|
|
1061
1134
|
/** `hookTraceEnv` reaches PreCompact only for a compaction inside a prompt (see `executeRun`). */
|
|
1062
1135
|
private compactWith;
|
|
@@ -1067,66 +1140,6 @@ declare class Session extends SessionBase {
|
|
|
1067
1140
|
/** The permission pattern a "don't ask again" answer for this invocation grants. */
|
|
1068
1141
|
declare function consentScopeFor(toolName: string, toolArgs: TToolArgs): string;
|
|
1069
1142
|
//#endregion
|
|
1070
|
-
//#region src/compaction-orchestrator.d.ts
|
|
1071
|
-
/**
|
|
1072
|
-
* Thrown when a compaction summary is invalid (non-string or empty provider content).
|
|
1073
|
-
* Conversation history is append-only source data — callers must not clear or replace
|
|
1074
|
-
* it when this is thrown (see SPEC § Compaction Failure Contract).
|
|
1075
|
-
*/
|
|
1076
|
-
declare class CompactionError extends Error {
|
|
1077
|
-
constructor(message: string);
|
|
1078
|
-
}
|
|
1079
|
-
/**
|
|
1080
|
-
* Default base template for the compaction summarization prompt — the one model-facing
|
|
1081
|
-
* prompt surface this package owns (declared in SPEC § Boundaries). Intentionally
|
|
1082
|
-
* domain-neutral: it must not assume a software-development conversation. Replaceable
|
|
1083
|
-
* wholesale via {@link ICompactionOptions.basePrompt}.
|
|
1084
|
-
*/
|
|
1085
|
-
declare const DEFAULT_COMPACTION_PROMPT: string;
|
|
1086
|
-
interface ICompactionOptions {
|
|
1087
|
-
sessionId: string;
|
|
1088
|
-
cwd: string;
|
|
1089
|
-
model: string;
|
|
1090
|
-
hooks?: Record<string, unknown>;
|
|
1091
|
-
compactInstructions?: string;
|
|
1092
|
-
/**
|
|
1093
|
-
* Replaces the entire base instruction template of the compaction prompt
|
|
1094
|
-
* (default: {@link DEFAULT_COMPACTION_PROMPT}). Focus instructions and the
|
|
1095
|
-
* formatted conversation are appended after it.
|
|
1096
|
-
*/
|
|
1097
|
-
basePrompt?: string;
|
|
1098
|
-
/** Additional hook type executors (e.g. prompt, agent) beyond the core defaults. */
|
|
1099
|
-
hookTypeExecutors?: IHookTypeExecutor[];
|
|
1100
|
-
}
|
|
1101
|
-
declare class CompactionOrchestrator {
|
|
1102
|
-
private readonly sessionId;
|
|
1103
|
-
private readonly cwd;
|
|
1104
|
-
private readonly model;
|
|
1105
|
-
private readonly hooks?;
|
|
1106
|
-
private readonly compactInstructions?;
|
|
1107
|
-
private readonly basePrompt?;
|
|
1108
|
-
private readonly hookTypeExecutors?;
|
|
1109
|
-
constructor(options: ICompactionOptions);
|
|
1110
|
-
/**
|
|
1111
|
-
* Run compaction — summarize the conversation to free context space.
|
|
1112
|
-
* @param provider - The AI provider to use for summarization
|
|
1113
|
-
* @param history - The messages to summarise. Must not be empty: whether there is anything worth
|
|
1114
|
-
* compacting is the caller's judgement, made before it commits to replacing the conversation
|
|
1115
|
-
* (CORE-031).
|
|
1116
|
-
* @param instructions - Optional focus instructions for the summary
|
|
1117
|
-
* @param signal - The turn's cancellation signal (RUNTIME-004). Checked before the provider call
|
|
1118
|
-
* and again after it: an abort throws rather than returning, so the caller's existing
|
|
1119
|
-
* leave-history-untouched path covers a cancel as well as a failure.
|
|
1120
|
-
* @param hookTraceEnv - The prompt's trace for PreCompact's command hooks, only inside a prompt
|
|
1121
|
-
* @returns The generated summary string (always a non-empty string)
|
|
1122
|
-
* @throws {CompactionError} when `history` is empty, or when the provider returns a non-string or
|
|
1123
|
-
* empty summary — callers must leave the conversation history untouched in every such case
|
|
1124
|
-
*/
|
|
1125
|
-
compact(provider: IAIProvider, history: TUniversalMessage[], instructions?: string, signal?: AbortSignal, trigger?: TCompactTrigger, hookTraceEnv?: ISubprocessTraceEnv, executionJournal?: IExecutionJournal): Promise<string>;
|
|
1126
|
-
/** Build the compaction prompt from conversation history */
|
|
1127
|
-
private buildCompactionPrompt;
|
|
1128
|
-
}
|
|
1129
|
-
//#endregion
|
|
1130
1143
|
//#region src/conversation-transcript.d.ts
|
|
1131
1144
|
/**
|
|
1132
1145
|
* Render each message as one entry, in order. An entry is one line, except an assistant message
|
|
@@ -1681,7 +1694,7 @@ type TSessionRecordDecodeOutcome = {
|
|
|
1681
1694
|
* imports this module; declaring it there and importing it back would be a module cycle. The export
|
|
1682
1695
|
* from the package barrel is unchanged.
|
|
1683
1696
|
*/
|
|
1684
|
-
declare const SESSION_RECORD_ENVELOPE_VERSION =
|
|
1697
|
+
declare const SESSION_RECORD_ENVELOPE_VERSION = 2;
|
|
1685
1698
|
/** A persisted record with the version of the shape it was written in. */
|
|
1686
1699
|
interface IVersionedInteractiveSessionRecord {
|
|
1687
1700
|
schemaVersion: number;
|
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/context-window-tracker.ts","../../src/session-log-reference-types.ts","../../src/session-log-sinks.ts","../../src/session-logger.ts","../../src/auto-mode-gate.ts","../../src/permission-types.ts","../../src/session-types.ts","../../src/session-resume.ts","../../src/session-recoverable.ts","../../src/turn-claim.ts","../../src/permission-denial-log.ts","../../src/permission-enforcer.ts","../../src/session-base.ts","../../src/session.ts","../../src/consent-scope.ts","../../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/context-window-tracker.ts","../../src/session-log-reference-types.ts","../../src/session-log-sinks.ts","../../src/session-logger.ts","../../src/auto-mode-gate.ts","../../src/permission-types.ts","../../src/session-types.ts","../../src/session-resume.ts","../../src/session-recoverable.ts","../../src/turn-claim.ts","../../src/compaction-orchestrator.ts","../../src/permission-denial-log.ts","../../src/permission-enforcer.ts","../../src/session-base.ts","../../src/session.ts","../../src/consent-scope.ts","../../src/conversation-transcript.ts","../../src/session-artifact.ts","../../src/scrub-sensitive.ts","../../src/session-log-events.ts","../../src/session-log-entry-types.ts","../../src/session-log-codec/index.ts","../../src/external-payload-source-types.ts","../../src/session-log-sources.ts","../../src/tool-result-spill-store.ts","../../src/prompt-history-file.ts","../../src/external-payload-resolution-contracts.ts","../../src/external-payload-resolver.ts","../../src/session-log-validation.ts","../../src/session-log-replay.ts","../../src/session-id.ts","../../src/session-store.ts","../../src/checkpoint-tree.ts","../../src/session-record-codec/decode-outcome.ts","../../src/session-record-codec/record-decoder.ts"],"m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