@deepseek-ai/dsh-session-reference 0.1.6-alpha.2 → 0.1.7-alpha.2
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/lib/index.js +5 -5
- package/lib/typert.host.js +47 -19
- package/lib/typert.remote-client.js +1 -1
- package/lib/types/index.d.ts +2 -3
- package/lib/types/index.js +3 -7
- package/lib/types/projection.js +1 -0
- package/package.json +39 -39
package/lib/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
2
|
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
3
3
|
import { LlmError, createUserMessage, freezeMessage } from "@deepseek-ai/dsh-llm";
|
|
4
|
-
import { SessionLogOffset, SessionSeq } from "@deepseek-ai/dsh-session";
|
|
5
4
|
import { isCompactCheckpointSource } from "@deepseek-ai/dsh-compaction";
|
|
6
5
|
import { TextRetainer } from "@deepseek-ai/dsh-output-retention";
|
|
7
6
|
import { assertNever } from "@deepseek-ai/dsh-util-values";
|
|
7
|
+
import { SessionSeq } from "@deepseek-ai/dsh-session";
|
|
8
8
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
9
9
|
//#region lib/types/spill.js
|
|
10
10
|
/** Full projected transcripts and model-visible spill outcomes for bounded reference previews. */
|
|
@@ -150,6 +150,7 @@ function projectSessionConversation(snapshot) {
|
|
|
150
150
|
});
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
153
|
+
case "developer/message":
|
|
153
154
|
case "system/message":
|
|
154
155
|
case "tool/result": break;
|
|
155
156
|
/* v8 ignore next 2 -- SurfaceEventType is closed and every variant is handled above. */
|
|
@@ -556,16 +557,15 @@ let SessionReferenceResolver = (() => {
|
|
|
556
557
|
* Nothing else is attempted. Folding a title from a log costs the whole
|
|
557
558
|
* log, and this call sits under every keystroke of `@` completion. A
|
|
558
559
|
* session that no projection can answer for — one persisted before the
|
|
559
|
-
* cache was composed
|
|
560
|
-
*
|
|
561
|
-
* checkpoints it.
|
|
560
|
+
* cache was composed — is labeled by its id and cannot be found by its
|
|
561
|
+
* title until it is opened once, which checkpoints it.
|
|
562
562
|
* @param record - the listed session, live or cold.
|
|
563
563
|
* @returns the title-backed mention label and the subagent-label-first display title.
|
|
564
564
|
*/
|
|
565
565
|
projectedLabels(record) {
|
|
566
566
|
const attached = this.ctx.get("sessions")?.get(record.header.id);
|
|
567
567
|
const projections = this.ctx.get("sessionProjections");
|
|
568
|
-
const snapshot = attached !== void 0 && projections !== void 0 ? projections.snapshot(attached, ["title", "subagent"]) :
|
|
568
|
+
const snapshot = attached !== void 0 && projections !== void 0 ? projections.snapshot(attached, ["title", "subagent"]) : this.ctx.get("sessionProjectionCache")?.cachedSnapshot(record.header, ["title", "subagent"]);
|
|
569
569
|
const label = titleOf(snapshot) ?? record.header.id;
|
|
570
570
|
const subagent = snapshot?.values.subagent;
|
|
571
571
|
return {
|
package/lib/typert.host.js
CHANGED
|
@@ -62,7 +62,7 @@ export const TYPERT = {
|
|
|
62
62
|
typeSymbol: '@deepseek-ai/dsh-session-reference#sessionReferenceResolver/candidates:result',
|
|
63
63
|
create: _deepseek_ai_dsh_session_reference_sessionReferenceResolver_candidates_result$schema,
|
|
64
64
|
},
|
|
65
|
-
sourceLocation: {"file":"packages/context/session-reference/src/index.ts","line":
|
|
65
|
+
sourceLocation: {"file":"packages/context/session-reference/src/index.ts","line":272,"column":9},
|
|
66
66
|
},
|
|
67
67
|
],
|
|
68
68
|
model: {
|
|
@@ -132,7 +132,7 @@ export const TYPERT = {
|
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
"name": "AssistantMessage",
|
|
135
|
-
"declaration": "export interface AssistantMessage extends
|
|
135
|
+
"declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"name": "AssistantProviderMetadata",
|
|
@@ -170,6 +170,10 @@ export const TYPERT = {
|
|
|
170
170
|
"name": "CommandSourceMap",
|
|
171
171
|
"declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
|
|
172
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"name": "CompactionCheckpointSource",
|
|
175
|
+
"declaration": "export type CompactionCheckpointSource = typeof COMPACT_CHECKPOINT_MARKER & { readonly compactionId: CompactionId; readonly sourceCommandId?: CommandId; };"
|
|
176
|
+
},
|
|
173
177
|
{
|
|
174
178
|
"name": "CompactionId",
|
|
175
179
|
"declaration": "export type CompactionId = Branded<'CompactionId'>;"
|
|
@@ -180,7 +184,7 @@ export const TYPERT = {
|
|
|
180
184
|
},
|
|
181
185
|
{
|
|
182
186
|
"name": "ContentBlockMap",
|
|
183
|
-
"declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-
|
|
187
|
+
"declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-addition': ToolAdditionBlock;\n 'tool-removal': ToolRemovalBlock;\n}"
|
|
184
188
|
},
|
|
185
189
|
{
|
|
186
190
|
"name": "ContentBlockType",
|
|
@@ -198,9 +202,13 @@ export const TYPERT = {
|
|
|
198
202
|
"name": "ContinuableSubagentDescriptorData",
|
|
199
203
|
"declaration": "export interface ContinuableSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'continuable';\n readonly label: string;\n readonly agentProvider?: string;\n readonly agentModel?: string;\n readonly agentReasoningEffort?: ReasoningEffortId;\n readonly persona?: string;\n readonly toolFilter?: ToolRestriction;\n}"
|
|
200
204
|
},
|
|
205
|
+
{
|
|
206
|
+
"name": "DeveloperMessage",
|
|
207
|
+
"declaration": "export interface DeveloperMessage extends MessageBase {\n readonly role: 'developer';\n}"
|
|
208
|
+
},
|
|
201
209
|
{
|
|
202
210
|
"name": "EpochHeader",
|
|
203
|
-
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n}"
|
|
211
|
+
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
|
|
204
212
|
},
|
|
205
213
|
{
|
|
206
214
|
"name": "FeedbackCategory",
|
|
@@ -294,6 +302,10 @@ export const TYPERT = {
|
|
|
294
302
|
"name": "JsonValue",
|
|
295
303
|
"declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
|
|
296
304
|
},
|
|
305
|
+
{
|
|
306
|
+
"name": "KnownCatalogMode",
|
|
307
|
+
"declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
|
|
308
|
+
},
|
|
297
309
|
{
|
|
298
310
|
"name": "LlmCallConfig",
|
|
299
311
|
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
|
|
@@ -308,7 +320,11 @@ export const TYPERT = {
|
|
|
308
320
|
},
|
|
309
321
|
{
|
|
310
322
|
"name": "Message",
|
|
311
|
-
"declaration": "export
|
|
323
|
+
"declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"name": "MessageBase",
|
|
327
|
+
"declaration": "export interface MessageBase {\n readonly id: MessageId;\n readonly content: readonly ContentBlock[];\n readonly source: MessageSource;\n}"
|
|
312
328
|
},
|
|
313
329
|
{
|
|
314
330
|
"name": "MessageFeedbackDelete",
|
|
@@ -334,13 +350,17 @@ export const TYPERT = {
|
|
|
334
350
|
"name": "MessageId",
|
|
335
351
|
"declaration": "export type MessageId = Branded<'MessageId'>;"
|
|
336
352
|
},
|
|
353
|
+
{
|
|
354
|
+
"name": "MessageRoleMap",
|
|
355
|
+
"declaration": "export interface MessageRoleMap {\n system: SystemMessage;\n developer: DeveloperMessage;\n user: UserMessage;\n assistant: AssistantMessage;\n tool: ToolResultMessage;\n}"
|
|
356
|
+
},
|
|
337
357
|
{
|
|
338
358
|
"name": "MessageSource",
|
|
339
359
|
"declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
|
|
340
360
|
},
|
|
341
361
|
{
|
|
342
362
|
"name": "MessageSourceMap",
|
|
343
|
-
"declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n
|
|
363
|
+
"declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n}"
|
|
344
364
|
},
|
|
345
365
|
{
|
|
346
366
|
"name": "ModelMessageSource",
|
|
@@ -400,7 +420,7 @@ export const TYPERT = {
|
|
|
400
420
|
},
|
|
401
421
|
{
|
|
402
422
|
"name": "Session",
|
|
403
|
-
"declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
423
|
+
"declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
404
424
|
},
|
|
405
425
|
{
|
|
406
426
|
"name": "SessionEvent",
|
|
@@ -408,7 +428,7 @@ export const TYPERT = {
|
|
|
408
428
|
},
|
|
409
429
|
{
|
|
410
430
|
"name": "SessionEventMap",
|
|
411
|
-
"declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
|
|
431
|
+
"declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n}"
|
|
412
432
|
},
|
|
413
433
|
{
|
|
414
434
|
"name": "SessionEventType",
|
|
@@ -480,7 +500,7 @@ export const TYPERT = {
|
|
|
480
500
|
},
|
|
481
501
|
{
|
|
482
502
|
"name": "SubagentCatalogEvent",
|
|
483
|
-
"declaration": "export type SubagentCatalogEvent = { readonly
|
|
503
|
+
"declaration": "export type SubagentCatalogEvent = { readonly childId: SessionId; readonly childCreatedAt: number; } & (({ readonly version: 0; } & KnownCatalogMode) | ({ readonly version: 1; } & (KnownCatalogMode | { readonly mode: 'unknown'; readonly label?: string; })));"
|
|
484
504
|
},
|
|
485
505
|
{
|
|
486
506
|
"name": "SubagentDescriptorBase",
|
|
@@ -496,7 +516,7 @@ export const TYPERT = {
|
|
|
496
516
|
},
|
|
497
517
|
{
|
|
498
518
|
"name": "SurfaceEventType",
|
|
499
|
-
"declaration": "export type SurfaceEventType = 'system/message' | 'user/message' | 'assistant/message' | 'tool/result';"
|
|
519
|
+
"declaration": "export type SurfaceEventType = 'system/message' | 'developer/message' | 'user/message' | 'assistant/message' | 'tool/result';"
|
|
500
520
|
},
|
|
501
521
|
{
|
|
502
522
|
"name": "SurfaceIntent",
|
|
@@ -508,7 +528,11 @@ export const TYPERT = {
|
|
|
508
528
|
},
|
|
509
529
|
{
|
|
510
530
|
"name": "SystemMessage",
|
|
511
|
-
"declaration": "export interface SystemMessage extends
|
|
531
|
+
"declaration": "export interface SystemMessage extends MessageBase {\n readonly role: 'system';\n readonly source: MessageSourceMap['system-prompt'];\n}"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "SystemPromptMessageSource",
|
|
535
|
+
"declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n}"
|
|
512
536
|
},
|
|
513
537
|
{
|
|
514
538
|
"name": "SystemPromptUpdate",
|
|
@@ -562,6 +586,10 @@ export const TYPERT = {
|
|
|
562
586
|
"name": "TokenUsage",
|
|
563
587
|
"declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
|
|
564
588
|
},
|
|
589
|
+
{
|
|
590
|
+
"name": "ToolAdditionBlock",
|
|
591
|
+
"declaration": "export interface ToolAdditionBlock {\n type: 'tool-addition';\n toolName: string;\n tool?: never;\n}"
|
|
592
|
+
},
|
|
565
593
|
{
|
|
566
594
|
"name": "ToolCallBlock",
|
|
567
595
|
"declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
|
|
@@ -575,20 +603,20 @@ export const TYPERT = {
|
|
|
575
603
|
"declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
|
|
576
604
|
},
|
|
577
605
|
{
|
|
578
|
-
"name": "
|
|
579
|
-
"declaration": "export interface
|
|
606
|
+
"name": "ToolRemovalBlock",
|
|
607
|
+
"declaration": "export interface ToolRemovalBlock {\n type: 'tool-removal';\n toolName: string;\n}"
|
|
580
608
|
},
|
|
581
609
|
{
|
|
582
|
-
"name": "
|
|
583
|
-
"declaration": "export interface
|
|
610
|
+
"name": "ToolRestriction",
|
|
611
|
+
"declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
|
|
584
612
|
},
|
|
585
613
|
{
|
|
586
614
|
"name": "ToolResultMessage",
|
|
587
|
-
"declaration": "export interface ToolResultMessage extends
|
|
615
|
+
"declaration": "export interface ToolResultMessage extends MessageBase {\n readonly role: 'tool';\n readonly source: ToolMessageSource;\n readonly toolCallId: ToolCallId;\n readonly isError?: boolean;\n}"
|
|
588
616
|
},
|
|
589
617
|
{
|
|
590
618
|
"name": "ToolSchema",
|
|
591
|
-
"declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
|
|
619
|
+
"declaration": "export interface ToolSchema {\n deferLoading?: true;\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
|
|
592
620
|
},
|
|
593
621
|
{
|
|
594
622
|
"name": "TurnEndCancelCause",
|
|
@@ -600,11 +628,11 @@ export const TYPERT = {
|
|
|
600
628
|
},
|
|
601
629
|
{
|
|
602
630
|
"name": "TurnEndReasonMap",
|
|
603
|
-
"declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n}"
|
|
631
|
+
"declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n forked: { kind: 'forked'; };\n}"
|
|
604
632
|
},
|
|
605
633
|
{
|
|
606
634
|
"name": "UserMessage",
|
|
607
|
-
"declaration": "export interface UserMessage extends
|
|
635
|
+
"declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
|
|
608
636
|
}
|
|
609
637
|
]
|
|
610
638
|
}
|
|
@@ -59,7 +59,7 @@ export const TYPERT_REMOTE = {
|
|
|
59
59
|
typeSymbol: '@deepseek-ai/dsh-session-reference#sessionReferenceResolver/candidates:result',
|
|
60
60
|
create: _deepseek_ai_dsh_session_reference_sessionReferenceResolver_candidates_result$schema,
|
|
61
61
|
},
|
|
62
|
-
sourceLocation: {"file":"packages/context/session-reference/src/index.ts","line":
|
|
62
|
+
sourceLocation: {"file":"packages/context/session-reference/src/index.ts","line":272,"column":9},
|
|
63
63
|
},
|
|
64
64
|
],
|
|
65
65
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -64,9 +64,8 @@ export declare class SessionReferenceResolver extends TypertRemoteService {
|
|
|
64
64
|
* Nothing else is attempted. Folding a title from a log costs the whole
|
|
65
65
|
* log, and this call sits under every keystroke of `@` completion. A
|
|
66
66
|
* session that no projection can answer for — one persisted before the
|
|
67
|
-
* cache was composed
|
|
68
|
-
*
|
|
69
|
-
* checkpoints it.
|
|
67
|
+
* cache was composed — is labeled by its id and cannot be found by its
|
|
68
|
+
* title until it is opened once, which checkpoints it.
|
|
70
69
|
* @param record - the listed session, live or cold.
|
|
71
70
|
* @returns the title-backed mention label and the subagent-label-first display title.
|
|
72
71
|
*/
|
package/lib/types/index.js
CHANGED
|
@@ -41,7 +41,6 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
41
41
|
import z from '@deepseek-ai/schemastery';
|
|
42
42
|
import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
43
43
|
import { createUserMessage, freezeMessage, LlmError } from '@deepseek-ai/dsh-llm';
|
|
44
|
-
import { SessionLogOffset } from '@deepseek-ai/dsh-session';
|
|
45
44
|
import { prepareReferenceOmission, REFERENCE_WARNING } from "./spill.js";
|
|
46
45
|
import { DEFAULT_CANDIDATE_LIMIT, DEFAULT_MAX_REFERENCE_BYTES, MAX_REFERENCES, SessionReferenceError, } from "./config.js";
|
|
47
46
|
import { retainReferencedSession } from "./projection.js";
|
|
@@ -207,9 +206,8 @@ let SessionReferenceResolver = (() => {
|
|
|
207
206
|
* Nothing else is attempted. Folding a title from a log costs the whole
|
|
208
207
|
* log, and this call sits under every keystroke of `@` completion. A
|
|
209
208
|
* session that no projection can answer for — one persisted before the
|
|
210
|
-
* cache was composed
|
|
211
|
-
*
|
|
212
|
-
* checkpoints it.
|
|
209
|
+
* cache was composed — is labeled by its id and cannot be found by its
|
|
210
|
+
* title until it is opened once, which checkpoints it.
|
|
213
211
|
* @param record - the listed session, live or cold.
|
|
214
212
|
* @returns the title-backed mention label and the subagent-label-first display title.
|
|
215
213
|
*/
|
|
@@ -218,9 +216,7 @@ let SessionReferenceResolver = (() => {
|
|
|
218
216
|
const projections = this.ctx.get('sessionProjections');
|
|
219
217
|
const snapshot = attached !== undefined && projections !== undefined
|
|
220
218
|
? projections.snapshot(attached, ['title', 'subagent'])
|
|
221
|
-
: record.header
|
|
222
|
-
? undefined
|
|
223
|
-
: this.ctx.get('sessionProjectionCache')?.cachedSnapshot(record.header, SessionLogOffset(0), ['title', 'subagent']);
|
|
219
|
+
: this.ctx.get('sessionProjectionCache')?.cachedSnapshot(record.header, ['title', 'subagent']);
|
|
224
220
|
const label = titleOf(snapshot) ?? record.header.id;
|
|
225
221
|
const subagent = snapshot?.values.subagent;
|
|
226
222
|
return {
|
package/lib/types/projection.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-reference",
|
|
3
3
|
"description": "Cross-session snapshot references and durable untrusted model context (ctx.sessionReferenceResolver)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -45,25 +45,25 @@
|
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@deepseek-ai/dsh-brand": "
|
|
49
|
-
"@deepseek-ai/
|
|
50
|
-
"@deepseek-ai/
|
|
48
|
+
"@deepseek-ai/dsh-brand": "0.1.7-alpha.2",
|
|
49
|
+
"@deepseek-ai/schemastery": "~3.18.4",
|
|
50
|
+
"@deepseek-ai/dsh-util-values": "0.1.7-alpha.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@deepseek-ai/
|
|
54
|
-
"@deepseek-ai/
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-session": "
|
|
59
|
-
"@deepseek-ai/dsh-session-projection": "
|
|
60
|
-
"@deepseek-ai/dsh-session-
|
|
61
|
-
"@deepseek-ai/dsh-session-
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
53
|
+
"@deepseek-ai/dsh-compaction": "0.1.7-alpha.2",
|
|
54
|
+
"@deepseek-ai/cordis": "~4.0.4",
|
|
55
|
+
"@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-output-retention": "0.1.7-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-session": "0.1.7-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-session-projection": "0.1.7-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-session-projection-cache": "0.1.7-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-session-query": "0.1.7-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-session-title": "0.1.7-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-spill": "0.1.7-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.7-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.7-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-subagent": "0.1.7-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-agent": "0.1.7-alpha.2"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@deepseek-ai/dsh-spill": {
|
|
@@ -74,26 +74,26 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@deepseek-ai/cordis": "
|
|
78
|
-
"@deepseek-ai/cordis-plugin-include": "
|
|
79
|
-
"@deepseek-ai/cordis-plugin-loader": "
|
|
80
|
-
"@deepseek-ai/dsh-
|
|
81
|
-
"@deepseek-ai/dsh-
|
|
82
|
-
"@deepseek-ai/dsh-
|
|
83
|
-
"@deepseek-ai/dsh-llm": "
|
|
84
|
-
"@deepseek-ai/dsh-
|
|
85
|
-
"@deepseek-ai/dsh-session-projection": "
|
|
86
|
-
"@deepseek-ai/dsh-session
|
|
87
|
-
"@deepseek-ai/dsh-
|
|
88
|
-
"@deepseek-ai/dsh-session-query
|
|
89
|
-
"@deepseek-ai/dsh-session-
|
|
90
|
-
"@deepseek-ai/dsh-
|
|
91
|
-
"@deepseek-ai/dsh-
|
|
92
|
-
"@deepseek-ai/dsh-
|
|
93
|
-
"@deepseek-ai/dsh-
|
|
94
|
-
"@deepseek-ai/dsh-
|
|
95
|
-
"@deepseek-ai/dsh-
|
|
96
|
-
"@deepseek-ai/dsh-tools": "
|
|
97
|
-
"@deepseek-ai/dsh-typert-protocol": "
|
|
77
|
+
"@deepseek-ai/cordis": "~4.0.4",
|
|
78
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.9",
|
|
79
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.5",
|
|
80
|
+
"@deepseek-ai/dsh-compaction": "0.1.7-alpha.2",
|
|
81
|
+
"@deepseek-ai/dsh-fs-local": "0.1.7-alpha.2",
|
|
82
|
+
"@deepseek-ai/dsh-agent": "0.1.7-alpha.2",
|
|
83
|
+
"@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
|
|
84
|
+
"@deepseek-ai/dsh-output-retention": "0.1.7-alpha.2",
|
|
85
|
+
"@deepseek-ai/dsh-session-projection": "0.1.7-alpha.2",
|
|
86
|
+
"@deepseek-ai/dsh-session": "0.1.7-alpha.2",
|
|
87
|
+
"@deepseek-ai/dsh-session-projection-cache": "0.1.7-alpha.2",
|
|
88
|
+
"@deepseek-ai/dsh-session-query": "0.1.7-alpha.2",
|
|
89
|
+
"@deepseek-ai/dsh-session-query-sqlite": "0.1.7-alpha.2",
|
|
90
|
+
"@deepseek-ai/dsh-session-title": "0.1.7-alpha.2",
|
|
91
|
+
"@deepseek-ai/dsh-spill": "0.1.7-alpha.2",
|
|
92
|
+
"@deepseek-ai/dsh-subagent": "0.1.7-alpha.2",
|
|
93
|
+
"@deepseek-ai/dsh-spill-local": "0.1.7-alpha.2",
|
|
94
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.7-alpha.2",
|
|
95
|
+
"@deepseek-ai/dsh-tool-fs": "0.1.7-alpha.2",
|
|
96
|
+
"@deepseek-ai/dsh-tools": "0.1.7-alpha.2",
|
|
97
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.7-alpha.2"
|
|
98
98
|
}
|
|
99
99
|
}
|