@chatcode/chatcode-cli 3.0.4-rc.1 → 3.0.4-rc.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.
Files changed (123) hide show
  1. package/lib/{command-errors-BkCHTQHj.js → command-errors-CScdshCl.js} +12 -12
  2. package/lib/{command-trees-5HFyC5sI.js → command-trees-Dc17MYfV.js} +2 -2
  3. package/lib/{component-identity-De91VHwW.js → component-identity-DFJD_d-P.js} +3 -3
  4. package/lib/{dist-CsDWUvQ4.js → dist-w_sIm4VD.js} +231 -231
  5. package/lib/{extension-events-CdYCRP0o.js → extension-events-qXmhzmHo.js} +26 -26
  6. package/lib/{frames-DOX-Jgk8.js → frames-B89znn_0.js} +4 -4
  7. package/lib/{host-access-Bk4xps5E.js → host-access-B0CRAwsX.js} +1 -1
  8. package/lib/{keymap-CJ1kvLR2.js → keymap-CIoVICBI.js} +2 -2
  9. package/lib/{plugin-XR7ncbnW.js → plugin-BKQsL2xn.js} +1638 -1363
  10. package/lib/{scenes-CAmWncZD.js → scenes-BRf-zMpF.js} +3 -3
  11. package/lib/{settings-sections-CakcvBv9.js → settings-sections-4gMhveN_.js} +3 -3
  12. package/lib/{statusBarSettings-BPPS_Usm.js → statusBarSettings-CnmdSHkO.js} +3 -3
  13. package/lib/{supports-color-DyChQwlI.js → supports-color-CcW-FGjr.js} +2 -2
  14. package/lib/{themes-OjcUpZzw.js → themes-Ce97Zsri.js} +12 -12
  15. package/lib/tui-compat-command-trees.js +1 -1
  16. package/lib/tui-compat-extensions.js +3 -3
  17. package/lib/tui-compat-plugin-host.js +5 -5
  18. package/lib/tui-compat-scenes.js +1 -1
  19. package/lib/tui-compat-settings-sections.js +1 -1
  20. package/lib/tui-compat-working-activity.js +4 -4
  21. package/lib/tui-compat-workspaces.js +1 -1
  22. package/lib/tui-compat.js +5 -5
  23. package/lib/{workspaces-XY7UdfXp.js → workspaces-1xrm-e3V.js} +2 -2
  24. package/package.json +29 -28
  25. package/runtime/manifest.json +2 -2
  26. package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +118 -22
  27. package/runtime/node_modules/@deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts +20 -3
  28. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +113 -39
  29. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/index.js +4 -0
  30. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.d.ts +3 -0
  31. package/runtime/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.js +1 -0
  32. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +173 -34
  33. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +48 -28
  34. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +24 -19
  35. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.d.ts +9 -1
  36. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/agent.js +36 -6
  37. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/archived-session-gate.js +1 -1
  38. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +4 -1
  39. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/service.d.ts +1 -1
  40. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.d.ts +2 -2
  41. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +24 -8
  42. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.d.ts +4 -3
  43. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +31 -14
  44. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.d.ts +6 -0
  45. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/list.js +89 -4
  46. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/remote-events.d.ts +1 -1
  47. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/types.d.ts +18 -1
  48. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/client.js +30 -0
  49. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/index.js +83 -2
  50. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.host.js +104 -11
  51. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.remote-client.d.ts +5 -1
  52. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.remote-client.js +78 -11
  53. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/model.d.ts +14 -1
  54. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/model.js +17 -0
  55. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/service.d.ts +15 -0
  56. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/service.js +12 -0
  57. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/commands.d.ts +13 -1
  58. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/commands.js +44 -2
  59. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/index.d.ts +13 -1
  60. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/index.js +22 -0
  61. package/runtime/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/types.d.ts +17 -0
  62. package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/client.js +931 -7
  63. package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/index.js +57 -19
  64. package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/client/index.d.ts +5 -2
  65. package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/config.d.ts +12 -0
  66. package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/events.d.ts +4 -4
  67. package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/lib/types/index.d.ts +3 -8
  68. package/runtime/node_modules/@deepseek-ai/dsh-client-hmr/package.json +6 -2
  69. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +10 -0
  70. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/types/client/present-open.d.ts +1 -1
  71. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +8 -4
  72. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  73. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  74. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +3 -1
  75. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +1917 -206
  76. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/ArchivedSessions.d.ts +13 -0
  77. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/contract/slots.d.ts +4 -0
  78. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/locales.d.ts +40 -0
  79. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/recent.d.ts +11 -0
  80. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/rows/RecentList.d.ts +15 -0
  81. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/rows/Rows.d.ts +6 -1
  82. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/session-actions/DeleteSession.d.ts +24 -0
  83. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/stores.d.ts +2 -2
  84. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/types/client/tree.d.ts +15 -13
  85. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +3 -1
  86. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/index.js +16 -0
  87. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +7 -3
  88. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.remote-client.js +6 -2
  89. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/index.js +20 -0
  90. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/types/types.d.ts +5 -0
  91. package/runtime/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +5 -2
  92. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/index.js +4 -0
  93. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/typert.host.js +5 -5
  94. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/typert.remote-client.js +5 -5
  95. package/runtime/node_modules/@deepseek-ai/dsh-schedule/lib/types/index.js +5 -0
  96. package/runtime/node_modules/@deepseek-ai/dsh-session/lib/types/index.d.ts +21 -0
  97. package/runtime/node_modules/@deepseek-ai/dsh-session-persistence/lib/index.js +12 -0
  98. package/runtime/node_modules/@deepseek-ai/dsh-session-persistence/lib/types/index.d.ts +15 -0
  99. package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/index.js +95 -2
  100. package/runtime/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/types/index.d.ts +3 -1
  101. package/runtime/node_modules/@deepseek-ai/dsh-session-projection-cache/lib/index.js +25 -1
  102. package/runtime/node_modules/@deepseek-ai/dsh-session-projection-cache/lib/types/index.d.ts +1 -0
  103. package/runtime/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +2 -1
  104. package/runtime/node_modules/@deepseek-ai/dsh-session-query/lib/index.js +13 -0
  105. package/runtime/node_modules/@deepseek-ai/dsh-session-query/lib/types/observation.d.ts +5 -0
  106. package/runtime/node_modules/@deepseek-ai/dsh-session-query-sqlite/lib/index.js +26 -0
  107. package/runtime/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +2 -1
  108. package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/index.js +5 -1
  109. package/runtime/node_modules/@deepseek-ai/dsh-storage-domain/lib/types/domain.d.ts +2 -2
  110. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/control.d.ts +1 -1
  111. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/index.js +106 -56
  112. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/config.d.ts +2 -2
  113. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/index.d.ts +2 -1
  114. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/services/tianti/config.d.ts +4 -2
  115. package/runtime/node_modules/@deepseek-ai/dsh-tianti/lib/types/tools.d.ts +2 -2
  116. package/runtime/node_modules/@deepseek-ai/dsh-tianti/package.json +2 -0
  117. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +103 -12
  118. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/index.js +215 -4
  119. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/invariant.js +6 -1
  120. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.d.ts +31 -0
  121. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.js +219 -2
  122. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/spec.d.ts +4 -0
  123. package/runtime/node_modules/@deepseek-ai/dsh-workspace/lib/types/spec.js +4 -0
@@ -85,6 +85,19 @@ export interface IWorkspaces {
85
85
  * @param sessionId - Session to unarchive.
86
86
  */
87
87
  unarchiveSession(sessionId: SessionId): Promise<void>;
88
+ /**
89
+ * Preview the archived root and owned subagent identities before confirmation.
90
+ * @param sessionId - archived root identity.
91
+ * @returns the identities covered by confirmation.
92
+ */
93
+ sessionDeletionScope(sessionId: SessionId): Promise<readonly SessionId[]>;
94
+ /**
95
+ * Permanently delete exactly the confirmed scope; live or changed scopes reject.
96
+ * @param sessionId - archived root identity.
97
+ * @param expectedSessionIds - identities confirmed by the user.
98
+ * @returns the identities removed after durable cleanup.
99
+ */
100
+ deleteSession(sessionId: SessionId, expectedSessionIds: readonly SessionId[]): Promise<readonly SessionId[]>;
88
101
  /**
89
102
  * Pin a Session ahead of unpinned Sessions on Workspace grouping surfaces.
90
103
  * @param sessionId - Session to pin.
@@ -124,6 +137,8 @@ export declare class WorkspaceController extends Service implements IWorkspaces
124
137
  readonly stopActivity?: boolean;
125
138
  }): Promise<void>;
126
139
  unarchiveSession(sessionId: SessionId): Promise<void>;
140
+ sessionDeletionScope(sessionId: SessionId): Promise<readonly SessionId[]>;
141
+ deleteSession(sessionId: SessionId, expectedSessionIds: readonly SessionId[]): Promise<readonly SessionId[]>;
127
142
  pinSession(sessionId: SessionId): Promise<void>;
128
143
  unpinSession(sessionId: SessionId): Promise<void>;
129
144
  insertSessionBefore(workspaceId: WorkspaceId, sessionId: SessionId, beforeSessionId?: SessionId): Promise<WorkspaceView>;
@@ -75,6 +75,18 @@ export class WorkspaceController extends Service {
75
75
  if (!result.ok)
76
76
  throw commandError('session unarchive', result.error);
77
77
  }
78
+ async sessionDeletionScope(sessionId) {
79
+ const result = await this.model.sessionDeletionScope(sessionId);
80
+ if (!result.ok)
81
+ throw new WorkspaceArchiveError(result.error);
82
+ return result.value.sessionIds;
83
+ }
84
+ async deleteSession(sessionId, expectedSessionIds) {
85
+ const result = await this.model.deleteSession(sessionId, expectedSessionIds);
86
+ if (!result.ok)
87
+ throw new WorkspaceArchiveError(result.error);
88
+ return result.value.sessionIds;
89
+ }
78
90
  async pinSession(sessionId) {
79
91
  const result = await this.model.pinSession(sessionId);
80
92
  if (!result.ok)
@@ -1,6 +1,6 @@
1
1
  /** Workspace command implementation and stable Remote failure mapping. */
2
2
  import type { Context } from '@deepseek-ai/cordis';
3
- import type { WorkspaceArchiveSessionRequest, WorkspaceArchiveValue, WorkspaceCreateRequest, WorkspaceCreateValue, WorkspaceDeleteRequest, WorkspaceDeleteValue, WorkspaceInsertBeforeRequest, WorkspaceInsertSessionBeforeRequest, WorkspaceOrderValue, WorkspacePinSessionRequest, WorkspacePinValue, WorkspaceRenameRequest, WorkspaceUnarchiveSessionRequest, WorkspaceUnpinSessionRequest, WorkspaceValue } from './types.ts';
3
+ import type { WorkspaceArchiveSessionRequest, WorkspaceArchiveValue, WorkspaceCreateRequest, WorkspaceCreateValue, WorkspaceDeleteRequest, WorkspaceDeleteValue, WorkspaceInsertBeforeRequest, WorkspaceInsertSessionBeforeRequest, WorkspaceOrderValue, WorkspacePinSessionRequest, WorkspacePinValue, WorkspaceRenameRequest, WorkspaceUnarchiveSessionRequest, WorkspaceUnpinSessionRequest, WorkspaceValue, WorkspaceSessionDeletionPreviewRequest, WorkspaceSessionDeletionRequest, WorkspaceSessionDeletionValue } from './types.ts';
4
4
  /** Implements Workspace mutations against the authoritative registry. */
5
5
  export declare class WorkspaceCommands {
6
6
  private readonly ctx;
@@ -54,6 +54,18 @@ export declare class WorkspaceCommands {
54
54
  * @returns the complete resulting archive set.
55
55
  */
56
56
  unarchiveSession(request: WorkspaceUnarchiveSessionRequest): Promise<WorkspaceArchiveValue>;
57
+ /**
58
+ * Preview the Session identities that would be permanently deleted.
59
+ * @param request - archived root to preview.
60
+ * @returns the complete deletion scope for confirmation.
61
+ */
62
+ sessionDeletionScope(request: WorkspaceSessionDeletionPreviewRequest): Promise<WorkspaceSessionDeletionValue>;
63
+ /**
64
+ * Delete an archived root and exactly its confirmed owned subagent scope.
65
+ * @param request - root and user-confirmed deletion scope.
66
+ * @returns identities removed after persistence and owner cleanup complete.
67
+ */
68
+ deleteSession(request: WorkspaceSessionDeletionRequest): Promise<WorkspaceSessionDeletionValue>;
57
69
  /**
58
70
  * Add one known unarchived Session to the registry-global pin set.
59
71
  * @param request - Session identity to pin.
@@ -1,5 +1,5 @@
1
1
  /** Workspace command implementation and stable Remote failure mapping. */
2
- import { WorkspaceActiveSessionError, WorkspaceArchivedSessionPinError, WorkspaceId, WorkspaceMoveInvalidError, WorkspaceOrderInvalidError, WorkspaceUnknownSessionError, } from '@deepseek-ai/dsh-workspace';
2
+ import { WorkspaceActiveSessionError, WorkspaceArchivedSessionPinError, WorkspaceId, WorkspaceMoveInvalidError, WorkspaceOrderInvalidError, WorkspaceUnknownSessionError, WorkspaceSessionDeletionError, } from '@deepseek-ai/dsh-workspace';
3
3
  import { RemoteError, remoteErrorOf } from '@deepseek-ai/dsh-typert-protocol';
4
4
  import { workspaceView } from "./feed.js";
5
5
  /** Implements Workspace mutations against the authoritative registry. */
@@ -138,9 +138,40 @@ export class WorkspaceCommands {
138
138
  * @returns the complete resulting archive set.
139
139
  */
140
140
  async unarchiveSession(request) {
141
- await this.ctx.workspaceRegistry.unarchiveSession(request.sessionId);
141
+ try {
142
+ await this.ctx.workspaceRegistry.unarchiveSession(request.sessionId);
143
+ }
144
+ catch (error) {
145
+ throw deletionError(error, request.sessionId);
146
+ }
142
147
  return { archivedSessionIds: [...this.ctx.workspaceRegistry.archivedSessionIds] };
143
148
  }
149
+ /**
150
+ * Preview the Session identities that would be permanently deleted.
151
+ * @param request - archived root to preview.
152
+ * @returns the complete deletion scope for confirmation.
153
+ */
154
+ async sessionDeletionScope(request) {
155
+ try {
156
+ return { sessionIds: await this.ctx.workspaceRegistry.sessionDeletionScope(request.sessionId) };
157
+ }
158
+ catch (error) {
159
+ throw deletionError(error, request.sessionId);
160
+ }
161
+ }
162
+ /**
163
+ * Delete an archived root and exactly its confirmed owned subagent scope.
164
+ * @param request - root and user-confirmed deletion scope.
165
+ * @returns identities removed after persistence and owner cleanup complete.
166
+ */
167
+ async deleteSession(request) {
168
+ try {
169
+ return { sessionIds: await this.ctx.workspaceRegistry.deleteSession(request.sessionId, request.expectedSessionIds) };
170
+ }
171
+ catch (error) {
172
+ throw deletionError(error, request.sessionId);
173
+ }
174
+ }
144
175
  /**
145
176
  * Add one known unarchived Session to the registry-global pin set.
146
177
  * @param request - Session identity to pin.
@@ -187,6 +218,17 @@ export class WorkspaceCommands {
187
218
  function workspaceNotFound(workspaceId) {
188
219
  return new RemoteError('workspace/not-found', `Workspace "${workspaceId}" not found`, { workspaceId });
189
220
  }
221
+ function deletionError(error, sessionId) {
222
+ if (error instanceof WorkspaceSessionDeletionError) {
223
+ return new RemoteError('workspace/session-delete-refused', 'Session deletion refused', {
224
+ sessionId, reason: error.reason,
225
+ }, { cause: error });
226
+ }
227
+ if (error instanceof WorkspaceActiveSessionError) {
228
+ return new RemoteError('workspace/session-active', error.message, { sessionId, activity: error.activity }, { cause: error });
229
+ }
230
+ return error;
231
+ }
190
232
  function errorMessage(error) {
191
233
  return error instanceof Error ? error.message : String(error);
192
234
  }
@@ -2,7 +2,7 @@
2
2
  import { Context } from '@deepseek-ai/cordis';
3
3
  import z from '@deepseek-ai/schemastery';
4
4
  import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
5
- import type { WorkspaceArchiveSessionRequest, WorkspaceArchiveValue, WorkspaceCreateRequest, WorkspaceCreateValue, WorkspaceDeleteRequest, WorkspaceDeleteValue, WorkspaceFollowFrame, WorkspaceInsertBeforeRequest, WorkspaceInsertSessionBeforeRequest, WorkspaceOrderValue, WorkspacePinSessionRequest, WorkspacePinValue, WorkspaceRenameRequest, WorkspaceUnarchiveSessionRequest, WorkspaceUnpinSessionRequest, WorkspaceValue } from './types.ts';
5
+ import type { WorkspaceArchiveSessionRequest, WorkspaceArchiveValue, WorkspaceCreateRequest, WorkspaceCreateValue, WorkspaceDeleteRequest, WorkspaceDeleteValue, WorkspaceFollowFrame, WorkspaceInsertBeforeRequest, WorkspaceInsertSessionBeforeRequest, WorkspaceOrderValue, WorkspacePinSessionRequest, WorkspacePinValue, WorkspaceRenameRequest, WorkspaceUnarchiveSessionRequest, WorkspaceSessionDeletionPreviewRequest, WorkspaceSessionDeletionRequest, WorkspaceSessionDeletionValue, WorkspaceUnpinSessionRequest, WorkspaceValue } from './types.ts';
6
6
  export type * from './types.ts';
7
7
  export { DirectoryPickerController } from './directory-picker.ts';
8
8
  /** First-use directory policy for the Host account. */
@@ -85,6 +85,18 @@ export declare class WorkspaceController extends TypertRemoteService {
85
85
  * @returns the complete resulting archive set.
86
86
  */
87
87
  unarchiveSession(request: WorkspaceUnarchiveSessionRequest): Promise<WorkspaceArchiveValue>;
88
+ /**
89
+ * Preview the archived root and owned subagent Sessions covered by deletion.
90
+ * @param request - archived root to preview.
91
+ * @returns complete deletion scope for confirmation.
92
+ */
93
+ sessionDeletionScope(request: WorkspaceSessionDeletionPreviewRequest): Promise<WorkspaceSessionDeletionValue>;
94
+ /**
95
+ * Permanently remove an archived Session and its confirmed owned subagents.
96
+ * @param request - archived root and confirmed scope.
97
+ * @returns identities permanently removed.
98
+ */
99
+ deleteSession(request: WorkspaceSessionDeletionRequest): Promise<WorkspaceSessionDeletionValue>;
88
100
  /**
89
101
  * Surface one known unarchived Session ahead of unpinned Sessions.
90
102
  * @param request - Session identity to pin.
@@ -52,6 +52,8 @@ let WorkspaceController = (() => {
52
52
  let _insertSessionBefore_decorators;
53
53
  let _archiveSession_decorators;
54
54
  let _unarchiveSession_decorators;
55
+ let _sessionDeletionScope_decorators;
56
+ let _deleteSession_decorators;
55
57
  let _pinSession_decorators;
56
58
  let _unpinSession_decorators;
57
59
  let _follow_decorators;
@@ -66,6 +68,8 @@ let WorkspaceController = (() => {
66
68
  _insertSessionBefore_decorators = [Remote('insertSessionBefore')];
67
69
  _archiveSession_decorators = [Remote('archiveSession')];
68
70
  _unarchiveSession_decorators = [Remote('unarchiveSession')];
71
+ _sessionDeletionScope_decorators = [Remote('sessionDeletionScope')];
72
+ _deleteSession_decorators = [Remote('deleteSession')];
69
73
  _pinSession_decorators = [Remote('pinSession')];
70
74
  _unpinSession_decorators = [Remote('unpinSession')];
71
75
  _follow_decorators = [Remote({ mode: 'stream' })];
@@ -77,6 +81,8 @@ let WorkspaceController = (() => {
77
81
  __esDecorate(this, null, _insertSessionBefore_decorators, { kind: "method", name: "insertSessionBefore", static: false, private: false, access: { has: obj => "insertSessionBefore" in obj, get: obj => obj.insertSessionBefore }, metadata: _metadata }, null, _instanceExtraInitializers);
78
82
  __esDecorate(this, null, _archiveSession_decorators, { kind: "method", name: "archiveSession", static: false, private: false, access: { has: obj => "archiveSession" in obj, get: obj => obj.archiveSession }, metadata: _metadata }, null, _instanceExtraInitializers);
79
83
  __esDecorate(this, null, _unarchiveSession_decorators, { kind: "method", name: "unarchiveSession", static: false, private: false, access: { has: obj => "unarchiveSession" in obj, get: obj => obj.unarchiveSession }, metadata: _metadata }, null, _instanceExtraInitializers);
84
+ __esDecorate(this, null, _sessionDeletionScope_decorators, { kind: "method", name: "sessionDeletionScope", static: false, private: false, access: { has: obj => "sessionDeletionScope" in obj, get: obj => obj.sessionDeletionScope }, metadata: _metadata }, null, _instanceExtraInitializers);
85
+ __esDecorate(this, null, _deleteSession_decorators, { kind: "method", name: "deleteSession", static: false, private: false, access: { has: obj => "deleteSession" in obj, get: obj => obj.deleteSession }, metadata: _metadata }, null, _instanceExtraInitializers);
80
86
  __esDecorate(this, null, _pinSession_decorators, { kind: "method", name: "pinSession", static: false, private: false, access: { has: obj => "pinSession" in obj, get: obj => obj.pinSession }, metadata: _metadata }, null, _instanceExtraInitializers);
81
87
  __esDecorate(this, null, _unpinSession_decorators, { kind: "method", name: "unpinSession", static: false, private: false, access: { has: obj => "unpinSession" in obj, get: obj => obj.unpinSession }, metadata: _metadata }, null, _instanceExtraInitializers);
82
88
  __esDecorate(this, null, _follow_decorators, { kind: "method", name: "follow", static: false, private: false, access: { has: obj => "follow" in obj, get: obj => obj.follow }, metadata: _metadata }, null, _instanceExtraInitializers);
@@ -178,6 +184,22 @@ let WorkspaceController = (() => {
178
184
  unarchiveSession(request) {
179
185
  return this.commands.unarchiveSession(request);
180
186
  }
187
+ /**
188
+ * Preview the archived root and owned subagent Sessions covered by deletion.
189
+ * @param request - archived root to preview.
190
+ * @returns complete deletion scope for confirmation.
191
+ */
192
+ sessionDeletionScope(request) {
193
+ return this.commands.sessionDeletionScope(request);
194
+ }
195
+ /**
196
+ * Permanently remove an archived Session and its confirmed owned subagents.
197
+ * @param request - archived root and confirmed scope.
198
+ * @returns identities permanently removed.
199
+ */
200
+ deleteSession(request) {
201
+ return this.commands.deleteSession(request);
202
+ }
181
203
  /**
182
204
  * Surface one known unarchived Session ahead of unpinned Sessions.
183
205
  * @param request - Session identity to pin.
@@ -42,6 +42,11 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
42
42
  readonly sessionId: SessionId;
43
43
  readonly activity: readonly SessionActivity[];
44
44
  };
45
+ /** Permanent deletion was refused before storage mutation. */
46
+ 'workspace/session-delete-refused': {
47
+ readonly sessionId: SessionId;
48
+ readonly reason: 'not-archived' | 'in-use' | 'deleted' | 'scope-changed';
49
+ };
45
50
  /** The Session or its anchor is not in the Workspace's manual order. */
46
51
  'workspace/move-invalid': {
47
52
  readonly workspaceId: WorkspaceId;
@@ -123,6 +128,18 @@ export interface WorkspaceArchiveSessionRequest {
123
128
  export interface WorkspaceUnarchiveSessionRequest {
124
129
  readonly sessionId: SessionId;
125
130
  }
131
+ /** Archived root whose deletion scope is requested. */
132
+ export interface WorkspaceSessionDeletionPreviewRequest {
133
+ readonly sessionId: SessionId;
134
+ }
135
+ /** Archived root and the exact scope confirmed by the user. */
136
+ export interface WorkspaceSessionDeletionRequest extends WorkspaceSessionDeletionPreviewRequest {
137
+ readonly expectedSessionIds: readonly SessionId[];
138
+ }
139
+ /** Root and owned subagent identities; independent forks are excluded. */
140
+ export interface WorkspaceSessionDeletionValue {
141
+ readonly sessionIds: readonly SessionId[];
142
+ }
126
143
  /** Complete archived Session set after a mutation. */
127
144
  export interface WorkspaceArchiveValue {
128
145
  readonly archivedSessionIds: readonly SessionId[];