@deepseek-ai/dsh-api-session-controller 0.1.6-alpha.2 → 0.1.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +31 -8
  3. package/README.zh.md +31 -8
  4. package/lib/client.js +603 -515
  5. package/lib/index.js +299 -137
  6. package/lib/typert.host.js +373 -183
  7. package/lib/typert.remote-client.d.ts +10 -5
  8. package/lib/typert.remote-client.js +216 -124
  9. package/lib/types/archived-session-gate.d.ts +30 -0
  10. package/lib/types/archived-session-gate.js +52 -0
  11. package/lib/types/client/contract/session.d.ts +2 -0
  12. package/lib/types/client/contract/sessions.d.ts +11 -16
  13. package/lib/types/client/index.d.ts +1 -1
  14. package/lib/types/client/sessions/lineage.d.ts +4 -1
  15. package/lib/types/client/sessions/lineage.js +2 -1
  16. package/lib/types/client/sessions/manager.d.ts +66 -59
  17. package/lib/types/client/sessions/manager.js +249 -277
  18. package/lib/types/client/sessions/projection-store.d.ts +32 -13
  19. package/lib/types/client/sessions/projection-store.js +45 -13
  20. package/lib/types/client/sessions/remotes.d.ts +1 -2
  21. package/lib/types/client/sessions/service.d.ts +23 -35
  22. package/lib/types/client/sessions/service.js +35 -47
  23. package/lib/types/client/sessions/session.d.ts +18 -16
  24. package/lib/types/client/sessions/session.js +112 -50
  25. package/lib/types/commands.d.ts +4 -2
  26. package/lib/types/commands.js +72 -36
  27. package/lib/types/control.d.ts +2 -4
  28. package/lib/types/control.js +2 -44
  29. package/lib/types/history.js +1 -1
  30. package/lib/types/index.d.ts +32 -5
  31. package/lib/types/index.js +117 -13
  32. package/lib/types/list.js +24 -15
  33. package/lib/types/skill-catalog.js +60 -50
  34. package/lib/types/types.d.ts +37 -23
  35. package/lib/types/types.js +0 -1
  36. package/package.json +71 -76
@@ -1,11 +1,11 @@
1
1
  /** Browser-safe request, result, and lifecycle vocabulary for the Session Remote service. */
2
+ import type { NativeFileApplication } from '@deepseek-ai/dsh-native-command/types';
2
3
  import type { AttachmentIdType, ImageAttachmentLimits, ImageAttachmentRef, ImageMediaType } from '@deepseek-ai/dsh-attachment';
3
4
  import type { Branded } from '@deepseek-ai/dsh-brand';
4
5
  import type { LlmAttemptId, MessageId } from '@deepseek-ai/dsh-llm/brand';
5
- import type { ContentBlock } from '@deepseek-ai/dsh-llm';
6
+ import type { TextBlock } from '@deepseek-ai/dsh-llm';
6
7
  import type { SessionId, SessionSeqCursor } from '@deepseek-ai/dsh-session/types';
7
8
  import type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types';
8
- import type { JobId } from '@deepseek-ai/dsh-jobs/brand';
9
9
  import type { JsonValue } from '@deepseek-ai/dsh-util-values';
10
10
  import type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types';
11
11
  declare module '@deepseek-ai/dsh-session-projection/types' {
@@ -42,10 +42,24 @@ export interface SessionListMetadata {
42
42
  /** Latest human-authored prompt time in the folded prefix. */
43
43
  readonly lastPromptAt: number | null;
44
44
  }
45
- /** Every available cached wire value used as partial, possibly stale Session-list hints. */
45
+ /**
46
+ * Every available wire value a Session-list row carries as partial, possibly
47
+ * stale hints. `kind` and `asOfSeq` are independent facts: `kind` says which
48
+ * sequence space `asOfSeq` belongs to, and therefore how a client may merge
49
+ * the block; `asOfSeq` is the producer's watermark in that space.
50
+ */
46
51
  export interface SessionProjectionHints {
52
+ /**
53
+ * `sequenced`: the Host's live registry produced the block for an attached
54
+ * Session, so `asOfSeq` is comparable with baselines and frames of the same
55
+ * connection. `cached`: a header-only listing viewed the block from the
56
+ * persisted projection cache, so `asOfSeq` is the stored record's own
57
+ * watermark and must not be compared with the connected Session's values.
58
+ */
59
+ readonly kind: 'cached' | 'sequenced';
60
+ /** Watermark of the block in the sequence space named by `kind`. */
47
61
  readonly asOfSeq: number;
48
- /** Provider-validated values present in the cache; omitted keys remain unknown. */
62
+ /** Provider-validated values present in the block; omitted keys remain unknown. */
49
63
  readonly values: SessionProjectionValues;
50
64
  }
51
65
  /** Complete projection values at an exact Session event cursor. */
@@ -135,7 +149,7 @@ export interface ModelCatalog {
135
149
  export type QueueAction = {
136
150
  readonly kind: 'edit';
137
151
  /** Non-empty text-only replacement content. */
138
- readonly content: readonly ContentBlock[];
152
+ readonly content: readonly TextBlock[];
139
153
  } | {
140
154
  readonly kind: 'remove';
141
155
  } | {
@@ -143,6 +157,8 @@ export type QueueAction = {
143
157
  };
144
158
  /** One Session list entry. */
145
159
  export interface SessionSummary {
160
+ /** Whether this Session currently owns a live Agent. */
161
+ readonly agentAvailable: boolean;
146
162
  readonly sessionId: SessionId;
147
163
  readonly updatedAt: number;
148
164
  readonly running: boolean;
@@ -172,6 +188,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
172
188
  readonly requestedCwd: string;
173
189
  readonly existingCwd?: string;
174
190
  };
191
+ 'session/projections-unavailable': Record<string, never>;
175
192
  'session/writer-held': {
176
193
  readonly sessionId: SessionId;
177
194
  };
@@ -287,6 +304,7 @@ export interface SessionRenameValue {
287
304
  /** Session fork request. */
288
305
  export interface SessionForkRequest {
289
306
  readonly sessionId: SessionId;
307
+ /** Exact inclusive source event seq; omission selects the latest completed-turn prefix. */
290
308
  readonly atSeq?: number;
291
309
  }
292
310
  /** Identity of a newly forked Session. */
@@ -339,6 +357,8 @@ export interface SessionCancelValue {
339
357
  export interface SessionOpenWorkspacePathRequest {
340
358
  /** File-manager navigation when requested; omission uses the default application. */
341
359
  readonly action?: 'reveal';
360
+ /** Registered application identifier; ignored for reveal. Omission preserves the operating system default. */
361
+ readonly application?: string;
342
362
  /** Path after best-effort Session workspace resolution, in Host filesystem syntax. */
343
363
  readonly path: string;
344
364
  }
@@ -366,8 +386,14 @@ export type SessionAddress = {
366
386
  readonly kind: 'subagent';
367
387
  readonly parentSessionId: SessionId;
368
388
  readonly childSessionId: SessionId;
369
- readonly mode: 'one-shot' | 'continuable';
389
+ readonly mode: 'one-shot' | 'continuable' | 'unknown';
370
390
  };
391
+ /** One non-activating Session projection read. */
392
+ export interface SessionProjectionsRequest {
393
+ readonly sessionId: SessionId;
394
+ }
395
+ /** Complete Session projection baseline; null when the Session does not exist. */
396
+ export type SessionProjectionsValue = SessionProjectionBaseline | null;
371
397
  /** One raw Session event in the Remote journal. */
372
398
  export interface SessionEventEntry {
373
399
  readonly type: 'event';
@@ -489,19 +515,8 @@ export type SessionFollowFrame = {
489
515
  readonly type: 'assistant-stream';
490
516
  readonly frame: SessionAssistantStreamFrame;
491
517
  };
492
- /** Browser-safe background-job row. */
493
- export interface SessionJob {
494
- readonly id: JobId;
495
- readonly kind: string;
496
- readonly label: string;
497
- readonly status: 'running' | 'stopping' | 'completed' | 'killed' | 'failed';
498
- readonly detail?: string;
499
- readonly startedAt: number;
500
- readonly finishedAt?: number;
501
- }
502
518
  /** Complete live control baseline emitted once per control stream generation. */
503
519
  export interface SessionControlBaseline {
504
- readonly jobs: Readonly<Record<SessionId, readonly SessionJob[]>>;
505
520
  readonly projections: Readonly<Record<SessionId, SessionProjectionBaseline>>;
506
521
  }
507
522
  /** One finished projection value and its durable watermark. */
@@ -515,19 +530,16 @@ export interface SessionProjectionUpdate {
515
530
  export type SessionControlFrame = {
516
531
  readonly type: 'baseline';
517
532
  readonly value: SessionControlBaseline;
518
- } | {
519
- readonly type: 'jobs';
520
- readonly sessionId: SessionId;
521
- readonly jobs: readonly SessionJob[];
522
533
  } | ({
523
534
  readonly type: 'projection';
524
535
  } & SessionProjectionUpdate);
525
536
  declare module '@deepseek-ai/cordis' {
526
537
  interface Events {
527
538
  /**
528
- * A Session became visible to Session list consumers.
539
+ * A Session became visible or its Agent was created or disposed.
540
+ * Consumers upsert the summary and replace its current running and availability state.
529
541
  * @mode emit
530
- * @param summary - initial list row for the Session.
542
+ * @param summary - current list row for the Session.
531
543
  */
532
544
  'api-session/added'(summary: SessionSummary): void;
533
545
  /**
@@ -561,4 +573,6 @@ declare module '@deepseek-ai/cordis' {
561
573
  }
562
574
  /** JSON-compatible projection value accepted by list consumers. */
563
575
  export type SessionProjectionValue = JsonValue;
576
+ /** Application metadata returned by the serving desktop for one file. */
577
+ export type SessionWorkspacePathApplication = NativeFileApplication;
564
578
  //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,3 @@
1
- /** Browser-safe request, result, and lifecycle vocabulary for the Session Remote service. */
2
1
  /** Maximum number of Sessions returned by one search. */
3
2
  export const SESSION_SEARCH_RESULT_LIMIT = 20;
4
3
  /** Maximum search snippet length in Unicode code points. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-api-session-controller",
3
3
  "description": "Session Remote commands, cold reads, and live control transport",
4
- "version": "0.1.6-alpha.2",
4
+ "version": "0.1.7-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -67,45 +67,41 @@
67
67
  "dependencies": {
68
68
  "mime-types": "^3.0.2",
69
69
  "zod": "^4.4.3",
70
- "@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
71
- "@deepseek-ai/dsh-deque": "^0.1.6-alpha.2",
72
- "@deepseek-ai/schemastery": "^3.18.2"
70
+ "@deepseek-ai/dsh-deque": "^0.1.7-alpha.1",
71
+ "@deepseek-ai/schemastery": "^3.18.3",
72
+ "@deepseek-ai/dsh-brand": "^0.1.7-alpha.1"
73
73
  },
74
74
  "peerDependencies": {
75
- "@deepseek-ai/cordis": "^4.0.2",
76
- "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
77
- "@deepseek-ai/dsh-agent-default-model": "^0.1.6-alpha.2",
78
- "@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.2",
79
- "@deepseek-ai/dsh-api-gateway": "^0.1.6-alpha.2",
80
- "@deepseek-ai/dsh-attachment": "^0.1.6-alpha.2",
81
- "@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
82
- "@deepseek-ai/dsh-commands": "^0.1.6-alpha.2",
83
- "@deepseek-ai/dsh-client-file-upload": "^0.1.6-alpha.2",
84
- "@deepseek-ai/dsh-file-reference": "^0.1.6-alpha.2",
85
- "@deepseek-ai/dsh-fs": "^0.1.6-alpha.2",
86
- "@deepseek-ai/dsh-jobs": "^0.1.6-alpha.2",
87
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
88
- "@deepseek-ai/dsh-scope": "^0.1.6-alpha.2",
89
- "@deepseek-ai/dsh-session-projection-cache": "^0.1.6-alpha.2",
90
- "@deepseek-ai/dsh-session-title": "^0.1.6-alpha.2",
91
- "@deepseek-ai/dsh-session-query": "^0.1.6-alpha.2",
92
- "@deepseek-ai/dsh-skill": "^0.1.6-alpha.2",
93
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
94
- "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
95
- "@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2",
96
- "@deepseek-ai/dsh-typert-registry": "^0.1.6-alpha.2",
97
- "@deepseek-ai/dsh-util-time": "^0.1.6-alpha.2",
98
- "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2",
99
- "@deepseek-ai/dsh-util-workspace-path": "^0.1.6-alpha.2",
100
- "@deepseek-ai/dsh-native-command": "^0.1.6-alpha.2",
101
- "@deepseek-ai/dsh-workspace": "^0.1.6-alpha.2",
102
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
103
- "@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.2"
75
+ "@deepseek-ai/cordis": "^4.0.3",
76
+ "@deepseek-ai/dsh-agent": "^0.1.7-alpha.1",
77
+ "@deepseek-ai/dsh-agent-default-model": "^0.1.7-alpha.1",
78
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.1.7-alpha.1",
79
+ "@deepseek-ai/dsh-api-gateway": "^0.1.7-alpha.1",
80
+ "@deepseek-ai/dsh-client-connection": "^0.1.7-alpha.1",
81
+ "@deepseek-ai/dsh-client-file-upload": "^0.1.7-alpha.1",
82
+ "@deepseek-ai/dsh-commands": "^0.1.7-alpha.1",
83
+ "@deepseek-ai/dsh-attachment": "^0.1.7-alpha.1",
84
+ "@deepseek-ai/dsh-fs": "^0.1.7-alpha.1",
85
+ "@deepseek-ai/dsh-llm": "^0.1.7-alpha.1",
86
+ "@deepseek-ai/dsh-file-reference": "^0.1.7-alpha.1",
87
+ "@deepseek-ai/dsh-native-command": "^0.1.7-alpha.1",
88
+ "@deepseek-ai/dsh-scope": "^0.1.7-alpha.1",
89
+ "@deepseek-ai/dsh-session-projection-cache": "^0.1.7-alpha.1",
90
+ "@deepseek-ai/dsh-session-title": "^0.1.7-alpha.1",
91
+ "@deepseek-ai/dsh-session-query": "^0.1.7-alpha.1",
92
+ "@deepseek-ai/dsh-skill": "^0.1.7-alpha.1",
93
+ "@deepseek-ai/dsh-typert-registry": "^0.1.7-alpha.1",
94
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.7-alpha.1",
95
+ "@deepseek-ai/dsh-session": "^0.1.7-alpha.1",
96
+ "@deepseek-ai/dsh-util-time": "^0.1.7-alpha.1",
97
+ "@deepseek-ai/dsh-subagent": "^0.1.7-alpha.1",
98
+ "@deepseek-ai/dsh-util-values": "^0.1.7-alpha.1",
99
+ "@deepseek-ai/dsh-workspace": "^0.1.7-alpha.1",
100
+ "@deepseek-ai/dsh-util-workspace-path": "^0.1.7-alpha.1",
101
+ "@deepseek-ai/dsh-session-projection": "^0.1.7-alpha.1",
102
+ "@deepseek-ai/dsh-session-persistence": "^0.1.7-alpha.1"
104
103
  },
105
104
  "peerDependenciesMeta": {
106
- "@deepseek-ai/dsh-jobs": {
107
- "optional": true
108
- },
109
105
  "@deepseek-ai/dsh-session-persistence": {
110
106
  "optional": true
111
107
  },
@@ -115,46 +111,45 @@
115
111
  },
116
112
  "devDependencies": {
117
113
  "@types/mime-types": "^3.0.1",
118
- "@deepseek-ai/cordis": "^4.0.2",
119
- "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
120
- "@deepseek-ai/dsh-agent-default-model": "^0.1.6-alpha.2",
121
- "@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.2",
122
- "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.6-alpha.2",
123
- "@deepseek-ai/dsh-api-gateway": "^0.1.6-alpha.2",
124
- "@deepseek-ai/dsh-attachment": "^0.1.6-alpha.2",
125
- "@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
126
- "@deepseek-ai/dsh-client-store": "^0.1.6-alpha.2",
127
- "@deepseek-ai/dsh-client-file-upload": "^0.1.6-alpha.2",
128
- "@deepseek-ai/dsh-client-test-runtime": "^0.1.6-alpha.2",
129
- "@deepseek-ai/dsh-commands": "^0.1.6-alpha.2",
130
- "@deepseek-ai/dsh-file-reference": "^0.1.6-alpha.2",
131
- "@deepseek-ai/dsh-fs-local": "^0.1.6-alpha.2",
132
- "@deepseek-ai/dsh-jobs": "^0.1.6-alpha.2",
133
- "@deepseek-ai/dsh-native-command": "^0.1.6-alpha.2",
134
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
135
- "@deepseek-ai/dsh-permission-presets": "^0.1.6-alpha.2",
136
- "@deepseek-ai/dsh-remote-mock": "^0.1.6-alpha.2",
137
- "@deepseek-ai/dsh-scope": "^0.1.6-alpha.2",
138
- "@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.2",
139
- "@deepseek-ai/dsh-fs": "^0.1.6-alpha.2",
140
- "@deepseek-ai/dsh-session-projection-cache": "^0.1.6-alpha.2",
141
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
142
- "@deepseek-ai/dsh-session-query": "^0.1.6-alpha.2",
143
- "@deepseek-ai/dsh-session-title": "^0.1.6-alpha.2",
144
- "@deepseek-ai/dsh-skill": "^0.1.6-alpha.2",
145
- "@deepseek-ai/dsh-storage": "^0.1.6-alpha.2",
146
- "@deepseek-ai/dsh-storage-domain": "^0.1.6-alpha.2",
147
- "@deepseek-ai/dsh-storage-json": "^0.1.6-alpha.2",
148
- "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
149
- "@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2",
150
- "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2",
151
- "@deepseek-ai/dsh-util-time": "^0.1.6-alpha.2",
152
- "@deepseek-ai/dsh-util-workspace-path": "^0.1.6-alpha.2",
153
- "@deepseek-ai/dsh-workspace": "^0.1.6-alpha.2",
154
- "@deepseek-ai/dsh-util-crypto": "^0.1.6-alpha.2",
155
- "@deepseek-ai/dsh-typert-registry": "^0.1.6-alpha.2",
156
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
157
- "@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.2"
114
+ "@deepseek-ai/dsh-agent": "^0.1.7-alpha.1",
115
+ "@deepseek-ai/dsh-agent-default-model": "^0.1.7-alpha.1",
116
+ "@deepseek-ai/dsh-agent-loop": "^0.1.7-alpha.1",
117
+ "@deepseek-ai/dsh-api-gateway": "^0.1.7-alpha.1",
118
+ "@deepseek-ai/dsh-client-connection": "^0.1.7-alpha.1",
119
+ "@deepseek-ai/dsh-attachment": "^0.1.7-alpha.1",
120
+ "@deepseek-ai/dsh-client-file-upload": "^0.1.7-alpha.1",
121
+ "@deepseek-ai/dsh-client-store": "^0.1.7-alpha.1",
122
+ "@deepseek-ai/dsh-client-test-runtime": "^0.1.7-alpha.1",
123
+ "@deepseek-ai/dsh-commands": "^0.1.7-alpha.1",
124
+ "@deepseek-ai/dsh-file-reference": "^0.1.7-alpha.1",
125
+ "@deepseek-ai/dsh-fs": "^0.1.7-alpha.1",
126
+ "@deepseek-ai/dsh-fs-local": "^0.1.7-alpha.1",
127
+ "@deepseek-ai/dsh-llm": "^0.1.7-alpha.1",
128
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.1.7-alpha.1",
129
+ "@deepseek-ai/cordis": "^4.0.3",
130
+ "@deepseek-ai/dsh-native-command": "^0.1.7-alpha.1",
131
+ "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.7-alpha.1",
132
+ "@deepseek-ai/dsh-permission-presets": "^0.1.7-alpha.1",
133
+ "@deepseek-ai/dsh-scope": "^0.1.7-alpha.1",
134
+ "@deepseek-ai/dsh-session-persistence": "^0.1.7-alpha.1",
135
+ "@deepseek-ai/dsh-session": "^0.1.7-alpha.1",
136
+ "@deepseek-ai/dsh-session-projection": "^0.1.7-alpha.1",
137
+ "@deepseek-ai/dsh-session-projection-cache": "^0.1.7-alpha.1",
138
+ "@deepseek-ai/dsh-session-title": "^0.1.7-alpha.1",
139
+ "@deepseek-ai/dsh-skill": "^0.1.7-alpha.1",
140
+ "@deepseek-ai/dsh-storage": "^0.1.7-alpha.1",
141
+ "@deepseek-ai/dsh-remote-mock": "^0.1.7-alpha.1",
142
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.7-alpha.1",
143
+ "@deepseek-ai/dsh-typert-registry": "^0.1.7-alpha.1",
144
+ "@deepseek-ai/dsh-util-crypto": "^0.1.7-alpha.1",
145
+ "@deepseek-ai/dsh-storage-domain": "^0.1.7-alpha.1",
146
+ "@deepseek-ai/dsh-util-time": "^0.1.7-alpha.1",
147
+ "@deepseek-ai/dsh-storage-json": "^0.1.7-alpha.1",
148
+ "@deepseek-ai/dsh-session-query": "^0.1.7-alpha.1",
149
+ "@deepseek-ai/dsh-util-workspace-path": "^0.1.7-alpha.1",
150
+ "@deepseek-ai/dsh-workspace": "^0.1.7-alpha.1",
151
+ "@deepseek-ai/dsh-subagent": "^0.1.7-alpha.1",
152
+ "@deepseek-ai/dsh-util-values": "^0.1.7-alpha.1"
158
153
  },
159
154
  "scripts": {
160
155
  "bundle": "tsdown",