@deepseek-ai/dsh-api-terminal-controller 0.1.6-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.
- package/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +93 -0
- package/README.zh.md +93 -0
- package/lib/client.js +677 -0
- package/lib/index.js +844 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +1131 -0
- package/lib/typert.remote-client.d.ts +49 -0
- package/lib/typert.remote-client.js +529 -0
- package/lib/types/client/close-requests.d.ts +31 -0
- package/lib/types/client/close-requests.js +75 -0
- package/lib/types/client/index.d.ts +88 -0
- package/lib/types/client/index.js +157 -0
- package/lib/types/client/model.d.ts +119 -0
- package/lib/types/client/model.js +323 -0
- package/lib/types/client/shell-preference.d.ts +11 -0
- package/lib/types/client/shell-preference.js +26 -0
- package/lib/types/index.d.ts +135 -0
- package/lib/types/index.js +371 -0
- package/lib/types/shells.d.ts +21 -0
- package/lib/types/shells.js +54 -0
- package/lib/types/stream.d.ts +29 -0
- package/lib/types/stream.js +78 -0
- package/lib/types/terminal.d.ts +61 -0
- package/lib/types/terminal.js +168 -0
- package/lib/types/types.d.ts +69 -0
- package/lib/types/types.js +2 -0
- package/package.json +93 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import type {
|
|
3
|
+
RemoteResult,
|
|
4
|
+
TypertRemoteContribution,
|
|
5
|
+
} from '@deepseek-ai/dsh-typert-protocol'
|
|
6
|
+
import type { TerminalAttachmentId, TerminalCreateRequest, TerminalEnvironment, TerminalFrame, TerminalShell, WebTerminalId, WebTerminalInfo } from '@deepseek-ai/dsh-api-terminal-controller/types'
|
|
7
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types'
|
|
8
|
+
|
|
9
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
10
|
+
interface TypertRemoteNamespace$7465726d696e616c {
|
|
11
|
+
close: (agentId: SessionId, id: WebTerminalId) => Promise<RemoteResult<void>>
|
|
12
|
+
create: (agentId: SessionId, request: TerminalCreateRequest, signal?: AbortSignal) => Promise<RemoteResult<WebTerminalInfo>>
|
|
13
|
+
environment: (agentId: SessionId, signal?: AbortSignal) => Promise<RemoteResult<TerminalEnvironment>>
|
|
14
|
+
follow: (agentId: SessionId, id: WebTerminalId, attachmentId: TerminalAttachmentId, signal?: AbortSignal) => AsyncIterable<TerminalFrame>
|
|
15
|
+
list: (sessionId: SessionId) => Promise<RemoteResult<WebTerminalInfo[]>>
|
|
16
|
+
rename: (agentId: SessionId, id: WebTerminalId, title: string) => Promise<RemoteResult<void>>
|
|
17
|
+
resize: (agentId: SessionId, id: WebTerminalId, attachmentId: TerminalAttachmentId, cols: number, rows: number) => Promise<RemoteResult<void>>
|
|
18
|
+
shells: (agentId: SessionId, signal?: AbortSignal) => Promise<RemoteResult<TerminalShell[]>>
|
|
19
|
+
write: (agentId: SessionId, id: WebTerminalId, attachmentId: TerminalAttachmentId, data: string) => Promise<RemoteResult<void>>
|
|
20
|
+
}
|
|
21
|
+
interface TypertRemoteMap {
|
|
22
|
+
'terminal/close': (agentId: SessionId, id: WebTerminalId) => Promise<RemoteResult<void>>
|
|
23
|
+
'terminal/create': (agentId: SessionId, request: TerminalCreateRequest, signal?: AbortSignal) => Promise<RemoteResult<WebTerminalInfo>>
|
|
24
|
+
'terminal/environment': (agentId: SessionId, signal?: AbortSignal) => Promise<RemoteResult<TerminalEnvironment>>
|
|
25
|
+
'terminal/follow': (agentId: SessionId, id: WebTerminalId, attachmentId: TerminalAttachmentId, signal?: AbortSignal) => AsyncIterable<TerminalFrame>
|
|
26
|
+
'terminal/list': (sessionId: SessionId) => Promise<RemoteResult<WebTerminalInfo[]>>
|
|
27
|
+
'terminal/rename': (agentId: SessionId, id: WebTerminalId, title: string) => Promise<RemoteResult<void>>
|
|
28
|
+
'terminal/resize': (agentId: SessionId, id: WebTerminalId, attachmentId: TerminalAttachmentId, cols: number, rows: number) => Promise<RemoteResult<void>>
|
|
29
|
+
'terminal/shells': (agentId: SessionId, signal?: AbortSignal) => Promise<RemoteResult<TerminalShell[]>>
|
|
30
|
+
'terminal/write': (agentId: SessionId, id: WebTerminalId, attachmentId: TerminalAttachmentId, data: string) => Promise<RemoteResult<void>>
|
|
31
|
+
}
|
|
32
|
+
interface TypertRemoteNamespaceMap {
|
|
33
|
+
'terminal': TypertRemoteNamespace$7465726d696e616c
|
|
34
|
+
}
|
|
35
|
+
interface TypertRemoteScopeMap {
|
|
36
|
+
'agent:terminal/close': (id: WebTerminalId) => Promise<RemoteResult<void>>
|
|
37
|
+
'agent:terminal/create': (request: TerminalCreateRequest, signal?: AbortSignal) => Promise<RemoteResult<WebTerminalInfo>>
|
|
38
|
+
'agent:terminal/environment': (signal?: AbortSignal) => Promise<RemoteResult<TerminalEnvironment>>
|
|
39
|
+
'agent:terminal/follow': (id: WebTerminalId, attachmentId: TerminalAttachmentId, signal?: AbortSignal) => AsyncIterable<TerminalFrame>
|
|
40
|
+
'agent:terminal/rename': (id: WebTerminalId, title: string) => Promise<RemoteResult<void>>
|
|
41
|
+
'agent:terminal/resize': (id: WebTerminalId, attachmentId: TerminalAttachmentId, cols: number, rows: number) => Promise<RemoteResult<void>>
|
|
42
|
+
'agent:terminal/shells': (signal?: AbortSignal) => Promise<RemoteResult<TerminalShell[]>>
|
|
43
|
+
'agent:terminal/write': (id: WebTerminalId, attachmentId: TerminalAttachmentId, data: string) => Promise<RemoteResult<void>>
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare const TYPERT_REMOTE: TypertRemoteContribution
|
|
48
|
+
export default TYPERT_REMOTE
|
|
49
|
+
//# sourceMappingURL=typert.remote-client.d.ts.map
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_close_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
5
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_close_parameter_1$schema = z.intersection(z.string(), z.unknown())
|
|
6
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_close_result$schema = z.void()
|
|
7
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_create_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
8
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_create_parameter_1$schema = z.object({
|
|
9
|
+
'shellPath': z.string().readonly().optional(),
|
|
10
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
11
|
+
'cols': z.number().readonly(),
|
|
12
|
+
'rows': z.number().readonly(),
|
|
13
|
+
})
|
|
14
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_create_result$schema = z.object({
|
|
15
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
16
|
+
'title': z.string().readonly(),
|
|
17
|
+
'shell': z.object({
|
|
18
|
+
'path': z.string().readonly(),
|
|
19
|
+
'args': z.array(z.string()).readonly(),
|
|
20
|
+
'name': z.string().readonly(),
|
|
21
|
+
}).readonly(),
|
|
22
|
+
'cwd': z.string().readonly(),
|
|
23
|
+
'cols': z.number().readonly(),
|
|
24
|
+
'rows': z.number().readonly(),
|
|
25
|
+
'state': z.union([z.literal("running"), z.literal("failed"), z.literal("exited")]).readonly(),
|
|
26
|
+
'exitCode': z.union([z.literal(null), z.number()]).readonly(),
|
|
27
|
+
'error': z.string().readonly().optional(),
|
|
28
|
+
'controllerId': z.intersection(z.string(), z.unknown()).readonly().optional(),
|
|
29
|
+
})
|
|
30
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_environment_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
31
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_environment_result$schema = z.object({
|
|
32
|
+
'cwd': z.string().readonly(),
|
|
33
|
+
'maxInputBytes': z.number().readonly(),
|
|
34
|
+
'maxCols': z.number().readonly(),
|
|
35
|
+
'maxRows': z.number().readonly(),
|
|
36
|
+
'scrollback': z.number().readonly(),
|
|
37
|
+
})
|
|
38
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_follow_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
39
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_follow_parameter_1$schema = z.intersection(z.string(), z.unknown())
|
|
40
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_follow_parameter_2$schema = z.intersection(z.string(), z.unknown())
|
|
41
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_follow_result$schema = z.union([z.object({
|
|
42
|
+
'type': z.literal("snapshot").readonly(),
|
|
43
|
+
'sequence': z.number().readonly(),
|
|
44
|
+
'screen': z.string().readonly(),
|
|
45
|
+
'info': z.object({
|
|
46
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
47
|
+
'title': z.string().readonly(),
|
|
48
|
+
'shell': z.object({
|
|
49
|
+
'path': z.string().readonly(),
|
|
50
|
+
'args': z.array(z.string()).readonly(),
|
|
51
|
+
'name': z.string().readonly(),
|
|
52
|
+
}).readonly(),
|
|
53
|
+
'cwd': z.string().readonly(),
|
|
54
|
+
'cols': z.number().readonly(),
|
|
55
|
+
'rows': z.number().readonly(),
|
|
56
|
+
'state': z.union([z.literal("running"), z.literal("failed"), z.literal("exited")]).readonly(),
|
|
57
|
+
'exitCode': z.union([z.literal(null), z.number()]).readonly(),
|
|
58
|
+
'error': z.string().readonly().optional(),
|
|
59
|
+
'controllerId': z.intersection(z.string(), z.unknown()).readonly().optional(),
|
|
60
|
+
}).readonly(),
|
|
61
|
+
}), z.object({
|
|
62
|
+
'type': z.literal("output").readonly(),
|
|
63
|
+
'sequence': z.number().readonly(),
|
|
64
|
+
'data': z.string().readonly(),
|
|
65
|
+
}), z.object({
|
|
66
|
+
'type': z.literal("state").readonly(),
|
|
67
|
+
'info': z.object({
|
|
68
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
69
|
+
'title': z.string().readonly(),
|
|
70
|
+
'shell': z.object({
|
|
71
|
+
'path': z.string().readonly(),
|
|
72
|
+
'args': z.array(z.string()).readonly(),
|
|
73
|
+
'name': z.string().readonly(),
|
|
74
|
+
}).readonly(),
|
|
75
|
+
'cwd': z.string().readonly(),
|
|
76
|
+
'cols': z.number().readonly(),
|
|
77
|
+
'rows': z.number().readonly(),
|
|
78
|
+
'state': z.union([z.literal("running"), z.literal("failed"), z.literal("exited")]).readonly(),
|
|
79
|
+
'exitCode': z.union([z.literal(null), z.number()]).readonly(),
|
|
80
|
+
'error': z.string().readonly().optional(),
|
|
81
|
+
'controllerId': z.intersection(z.string(), z.unknown()).readonly().optional(),
|
|
82
|
+
}).readonly(),
|
|
83
|
+
})])
|
|
84
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
85
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_list_result$schema = z.array(z.object({
|
|
86
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
87
|
+
'title': z.string().readonly(),
|
|
88
|
+
'shell': z.object({
|
|
89
|
+
'path': z.string().readonly(),
|
|
90
|
+
'args': z.array(z.string()).readonly(),
|
|
91
|
+
'name': z.string().readonly(),
|
|
92
|
+
}).readonly(),
|
|
93
|
+
'cwd': z.string().readonly(),
|
|
94
|
+
'cols': z.number().readonly(),
|
|
95
|
+
'rows': z.number().readonly(),
|
|
96
|
+
'state': z.union([z.literal("running"), z.literal("failed"), z.literal("exited")]).readonly(),
|
|
97
|
+
'exitCode': z.union([z.literal(null), z.number()]).readonly(),
|
|
98
|
+
'error': z.string().readonly().optional(),
|
|
99
|
+
'controllerId': z.intersection(z.string(), z.unknown()).readonly().optional(),
|
|
100
|
+
}))
|
|
101
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_rename_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
102
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_rename_parameter_1$schema = z.intersection(z.string(), z.unknown())
|
|
103
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_rename_parameter_2$schema = z.string()
|
|
104
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_rename_result$schema = z.void()
|
|
105
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
106
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_1$schema = z.intersection(z.string(), z.unknown())
|
|
107
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_2$schema = z.intersection(z.string(), z.unknown())
|
|
108
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_3$schema = z.number()
|
|
109
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_4$schema = z.number()
|
|
110
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_resize_result$schema = z.void()
|
|
111
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_shells_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
112
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_shells_result$schema = z.array(z.object({
|
|
113
|
+
'path': z.string().readonly(),
|
|
114
|
+
'args': z.array(z.string()).readonly(),
|
|
115
|
+
'name': z.string().readonly(),
|
|
116
|
+
}))
|
|
117
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
118
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_1$schema = z.intersection(z.string(), z.unknown())
|
|
119
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_2$schema = z.intersection(z.string(), z.unknown())
|
|
120
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_3$schema = z.string()
|
|
121
|
+
const _deepseek_ai_dsh_api_terminal_controller_terminal_write_result$schema = z.void()
|
|
122
|
+
|
|
123
|
+
export const TYPERT_REMOTE = {
|
|
124
|
+
package: '@deepseek-ai/dsh-api-terminal-controller',
|
|
125
|
+
descriptors: [
|
|
126
|
+
{
|
|
127
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/close',
|
|
128
|
+
service: 'terminalController',
|
|
129
|
+
namespace: 'terminal',
|
|
130
|
+
method: 'close',
|
|
131
|
+
invocation: { kind: 'direct' },
|
|
132
|
+
scope: {
|
|
133
|
+
context: 'agent',
|
|
134
|
+
wire: 'agentId',
|
|
135
|
+
},
|
|
136
|
+
parameters: [
|
|
137
|
+
{
|
|
138
|
+
name: 'agent',
|
|
139
|
+
wire: 'agentId',
|
|
140
|
+
source: 'lookup',
|
|
141
|
+
lookup: 'agent',
|
|
142
|
+
codec: {
|
|
143
|
+
mode: 'strict',
|
|
144
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
145
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_close_parameter_0$schema,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'id',
|
|
150
|
+
wire: 'id',
|
|
151
|
+
source: 'json',
|
|
152
|
+
codec: {
|
|
153
|
+
mode: 'strict',
|
|
154
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#WebTerminalId',
|
|
155
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_close_parameter_1$schema,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
result: {
|
|
160
|
+
mode: 'strict',
|
|
161
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/close:result',
|
|
162
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_close_result$schema,
|
|
163
|
+
},
|
|
164
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":247,"column":9},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/create',
|
|
168
|
+
service: 'terminalController',
|
|
169
|
+
namespace: 'terminal',
|
|
170
|
+
method: 'create',
|
|
171
|
+
invocation: { kind: 'direct' },
|
|
172
|
+
scope: {
|
|
173
|
+
context: 'agent',
|
|
174
|
+
wire: 'agentId',
|
|
175
|
+
},
|
|
176
|
+
parameters: [
|
|
177
|
+
{
|
|
178
|
+
name: 'agent',
|
|
179
|
+
wire: 'agentId',
|
|
180
|
+
source: 'lookup',
|
|
181
|
+
lookup: 'agent',
|
|
182
|
+
codec: {
|
|
183
|
+
mode: 'strict',
|
|
184
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
185
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_create_parameter_0$schema,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'request',
|
|
190
|
+
wire: 'request',
|
|
191
|
+
source: 'json',
|
|
192
|
+
codec: {
|
|
193
|
+
mode: 'strict',
|
|
194
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#TerminalCreateRequest',
|
|
195
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_create_parameter_1$schema,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
cancellation: { parameter: 'signal' },
|
|
200
|
+
result: {
|
|
201
|
+
mode: 'strict',
|
|
202
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#WebTerminalInfo',
|
|
203
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_create_result$schema,
|
|
204
|
+
},
|
|
205
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":155,"column":9},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/environment',
|
|
209
|
+
service: 'terminalController',
|
|
210
|
+
namespace: 'terminal',
|
|
211
|
+
method: 'environment',
|
|
212
|
+
invocation: { kind: 'direct' },
|
|
213
|
+
scope: {
|
|
214
|
+
context: 'agent',
|
|
215
|
+
wire: 'agentId',
|
|
216
|
+
},
|
|
217
|
+
parameters: [
|
|
218
|
+
{
|
|
219
|
+
name: 'agent',
|
|
220
|
+
wire: 'agentId',
|
|
221
|
+
source: 'lookup',
|
|
222
|
+
lookup: 'agent',
|
|
223
|
+
codec: {
|
|
224
|
+
mode: 'strict',
|
|
225
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
226
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_environment_parameter_0$schema,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
cancellation: { parameter: 'signal' },
|
|
231
|
+
result: {
|
|
232
|
+
mode: 'strict',
|
|
233
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#TerminalEnvironment',
|
|
234
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_environment_result$schema,
|
|
235
|
+
},
|
|
236
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":115,"column":3},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/follow',
|
|
240
|
+
service: 'terminalController',
|
|
241
|
+
namespace: 'terminal',
|
|
242
|
+
method: 'follow',
|
|
243
|
+
mode: 'stream',
|
|
244
|
+
invocation: { kind: 'direct' },
|
|
245
|
+
scope: {
|
|
246
|
+
context: 'agent',
|
|
247
|
+
wire: 'agentId',
|
|
248
|
+
},
|
|
249
|
+
parameters: [
|
|
250
|
+
{
|
|
251
|
+
name: 'agent',
|
|
252
|
+
wire: 'agentId',
|
|
253
|
+
source: 'lookup',
|
|
254
|
+
lookup: 'agent',
|
|
255
|
+
codec: {
|
|
256
|
+
mode: 'strict',
|
|
257
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
258
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_follow_parameter_0$schema,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'id',
|
|
263
|
+
wire: 'id',
|
|
264
|
+
source: 'json',
|
|
265
|
+
codec: {
|
|
266
|
+
mode: 'strict',
|
|
267
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#WebTerminalId',
|
|
268
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_follow_parameter_1$schema,
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'attachmentId',
|
|
273
|
+
wire: 'attachmentId',
|
|
274
|
+
source: 'json',
|
|
275
|
+
codec: {
|
|
276
|
+
mode: 'strict',
|
|
277
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#TerminalAttachmentId',
|
|
278
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_follow_parameter_2$schema,
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
cancellation: { parameter: 'signal' },
|
|
283
|
+
result: {
|
|
284
|
+
mode: 'strict',
|
|
285
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#TerminalFrame',
|
|
286
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_follow_result$schema,
|
|
287
|
+
},
|
|
288
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":194,"column":3},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/list',
|
|
292
|
+
service: 'terminalController',
|
|
293
|
+
namespace: 'terminal',
|
|
294
|
+
method: 'list',
|
|
295
|
+
invocation: { kind: 'direct' },
|
|
296
|
+
parameters: [
|
|
297
|
+
{
|
|
298
|
+
name: 'sessionId',
|
|
299
|
+
wire: 'sessionId',
|
|
300
|
+
source: 'json',
|
|
301
|
+
codec: {
|
|
302
|
+
mode: 'strict',
|
|
303
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
304
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_list_parameter_0$schema,
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
result: {
|
|
309
|
+
mode: 'strict',
|
|
310
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/list:result',
|
|
311
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_list_result$schema,
|
|
312
|
+
},
|
|
313
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":141,"column":3},
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/rename',
|
|
317
|
+
service: 'terminalController',
|
|
318
|
+
namespace: 'terminal',
|
|
319
|
+
method: 'rename',
|
|
320
|
+
invocation: { kind: 'direct' },
|
|
321
|
+
scope: {
|
|
322
|
+
context: 'agent',
|
|
323
|
+
wire: 'agentId',
|
|
324
|
+
},
|
|
325
|
+
parameters: [
|
|
326
|
+
{
|
|
327
|
+
name: 'agent',
|
|
328
|
+
wire: 'agentId',
|
|
329
|
+
source: 'lookup',
|
|
330
|
+
lookup: 'agent',
|
|
331
|
+
codec: {
|
|
332
|
+
mode: 'strict',
|
|
333
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
334
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_rename_parameter_0$schema,
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: 'id',
|
|
339
|
+
wire: 'id',
|
|
340
|
+
source: 'json',
|
|
341
|
+
codec: {
|
|
342
|
+
mode: 'strict',
|
|
343
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#WebTerminalId',
|
|
344
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_rename_parameter_1$schema,
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: 'title',
|
|
349
|
+
wire: 'title',
|
|
350
|
+
source: 'json',
|
|
351
|
+
codec: {
|
|
352
|
+
mode: 'strict',
|
|
353
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/rename:title',
|
|
354
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_rename_parameter_2$schema,
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
result: {
|
|
359
|
+
mode: 'strict',
|
|
360
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/rename:result',
|
|
361
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_rename_result$schema,
|
|
362
|
+
},
|
|
363
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":235,"column":3},
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/resize',
|
|
367
|
+
service: 'terminalController',
|
|
368
|
+
namespace: 'terminal',
|
|
369
|
+
method: 'resize',
|
|
370
|
+
invocation: { kind: 'direct' },
|
|
371
|
+
scope: {
|
|
372
|
+
context: 'agent',
|
|
373
|
+
wire: 'agentId',
|
|
374
|
+
},
|
|
375
|
+
parameters: [
|
|
376
|
+
{
|
|
377
|
+
name: 'agent',
|
|
378
|
+
wire: 'agentId',
|
|
379
|
+
source: 'lookup',
|
|
380
|
+
lookup: 'agent',
|
|
381
|
+
codec: {
|
|
382
|
+
mode: 'strict',
|
|
383
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
384
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_0$schema,
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: 'id',
|
|
389
|
+
wire: 'id',
|
|
390
|
+
source: 'json',
|
|
391
|
+
codec: {
|
|
392
|
+
mode: 'strict',
|
|
393
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#WebTerminalId',
|
|
394
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_1$schema,
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: 'attachmentId',
|
|
399
|
+
wire: 'attachmentId',
|
|
400
|
+
source: 'json',
|
|
401
|
+
codec: {
|
|
402
|
+
mode: 'strict',
|
|
403
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#TerminalAttachmentId',
|
|
404
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_2$schema,
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: 'cols',
|
|
409
|
+
wire: 'cols',
|
|
410
|
+
source: 'json',
|
|
411
|
+
codec: {
|
|
412
|
+
mode: 'strict',
|
|
413
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/resize:cols',
|
|
414
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_3$schema,
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
name: 'rows',
|
|
419
|
+
wire: 'rows',
|
|
420
|
+
source: 'json',
|
|
421
|
+
codec: {
|
|
422
|
+
mode: 'strict',
|
|
423
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/resize:rows',
|
|
424
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_resize_parameter_4$schema,
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
],
|
|
428
|
+
result: {
|
|
429
|
+
mode: 'strict',
|
|
430
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/resize:result',
|
|
431
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_resize_result$schema,
|
|
432
|
+
},
|
|
433
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":223,"column":9},
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/shells',
|
|
437
|
+
service: 'terminalController',
|
|
438
|
+
namespace: 'terminal',
|
|
439
|
+
method: 'shells',
|
|
440
|
+
invocation: { kind: 'direct' },
|
|
441
|
+
scope: {
|
|
442
|
+
context: 'agent',
|
|
443
|
+
wire: 'agentId',
|
|
444
|
+
},
|
|
445
|
+
parameters: [
|
|
446
|
+
{
|
|
447
|
+
name: 'agent',
|
|
448
|
+
wire: 'agentId',
|
|
449
|
+
source: 'lookup',
|
|
450
|
+
lookup: 'agent',
|
|
451
|
+
codec: {
|
|
452
|
+
mode: 'strict',
|
|
453
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
454
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_shells_parameter_0$schema,
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
],
|
|
458
|
+
cancellation: { parameter: 'signal' },
|
|
459
|
+
result: {
|
|
460
|
+
mode: 'strict',
|
|
461
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/shells:result',
|
|
462
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_shells_result$schema,
|
|
463
|
+
},
|
|
464
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":130,"column":3},
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: '@deepseek-ai/dsh-api-terminal-controller#terminal/write',
|
|
468
|
+
service: 'terminalController',
|
|
469
|
+
namespace: 'terminal',
|
|
470
|
+
method: 'write',
|
|
471
|
+
invocation: { kind: 'direct' },
|
|
472
|
+
scope: {
|
|
473
|
+
context: 'agent',
|
|
474
|
+
wire: 'agentId',
|
|
475
|
+
},
|
|
476
|
+
parameters: [
|
|
477
|
+
{
|
|
478
|
+
name: 'agent',
|
|
479
|
+
wire: 'agentId',
|
|
480
|
+
source: 'lookup',
|
|
481
|
+
lookup: 'agent',
|
|
482
|
+
codec: {
|
|
483
|
+
mode: 'strict',
|
|
484
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
485
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_0$schema,
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
name: 'id',
|
|
490
|
+
wire: 'id',
|
|
491
|
+
source: 'json',
|
|
492
|
+
codec: {
|
|
493
|
+
mode: 'strict',
|
|
494
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#WebTerminalId',
|
|
495
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_1$schema,
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: 'attachmentId',
|
|
500
|
+
wire: 'attachmentId',
|
|
501
|
+
source: 'json',
|
|
502
|
+
codec: {
|
|
503
|
+
mode: 'strict',
|
|
504
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller/types#TerminalAttachmentId',
|
|
505
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_2$schema,
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: 'data',
|
|
510
|
+
wire: 'data',
|
|
511
|
+
source: 'json',
|
|
512
|
+
codec: {
|
|
513
|
+
mode: 'strict',
|
|
514
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/write:data',
|
|
515
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_write_parameter_3$schema,
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
],
|
|
519
|
+
result: {
|
|
520
|
+
mode: 'strict',
|
|
521
|
+
typeSymbol: '@deepseek-ai/dsh-api-terminal-controller#terminal/write:result',
|
|
522
|
+
schema: _deepseek_ai_dsh_api_terminal_controller_terminal_write_result$schema,
|
|
523
|
+
},
|
|
524
|
+
sourceLocation: {"file":"packages/api/terminal-controller/src/index.ts","line":208,"column":9},
|
|
525
|
+
},
|
|
526
|
+
],
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export default TYPERT_REMOTE
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Unfinished close requests survive reload independently of the removed sidebar tabs. */
|
|
2
|
+
import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
3
|
+
import type { WebTerminalId } from '../types.ts';
|
|
4
|
+
/** An explicit cleanup request; no process or open-tab metadata is mirrored here. */
|
|
5
|
+
export interface TerminalCloseRequest {
|
|
6
|
+
readonly sessionId: SessionId;
|
|
7
|
+
readonly id: WebTerminalId;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
}
|
|
10
|
+
/** Each request has its own storage key, so other browser windows cannot overwrite its cleanup. */
|
|
11
|
+
export declare class TerminalCloseRequests {
|
|
12
|
+
private readonly requests;
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Read cleanup work still awaiting Host confirmation.
|
|
16
|
+
* @returns unfinished requests owned by this browser instance.
|
|
17
|
+
*/
|
|
18
|
+
pending(): readonly TerminalCloseRequest[];
|
|
19
|
+
/**
|
|
20
|
+
* Retain cleanup across reload before removing a tab.
|
|
21
|
+
* @param request - close intent to save before removing its tab.
|
|
22
|
+
*/
|
|
23
|
+
save(request: TerminalCloseRequest): void;
|
|
24
|
+
/**
|
|
25
|
+
* Forget confirmed cleanup in memory and browser storage.
|
|
26
|
+
* @param id - terminal whose Host cleanup succeeded.
|
|
27
|
+
*/
|
|
28
|
+
remove(id: WebTerminalId): void;
|
|
29
|
+
private load;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=close-requests.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const PREFIX = 'dsh.terminal.close.v1.';
|
|
2
|
+
/** Each request has its own storage key, so other browser windows cannot overwrite its cleanup. */
|
|
3
|
+
export class TerminalCloseRequests {
|
|
4
|
+
requests = new Map();
|
|
5
|
+
constructor() {
|
|
6
|
+
try {
|
|
7
|
+
if (typeof localStorage === 'undefined')
|
|
8
|
+
return;
|
|
9
|
+
for (let index = 0; index < localStorage.length; index++) {
|
|
10
|
+
const key = localStorage.key(index);
|
|
11
|
+
if (key?.startsWith(PREFIX))
|
|
12
|
+
this.load(key);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
console.error('Terminal cleanup recovery failed:', error);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Read cleanup work still awaiting Host confirmation.
|
|
21
|
+
* @returns unfinished requests owned by this browser instance.
|
|
22
|
+
*/
|
|
23
|
+
pending() { return [...this.requests.values()]; }
|
|
24
|
+
/**
|
|
25
|
+
* Retain cleanup across reload before removing a tab.
|
|
26
|
+
* @param request - close intent to save before removing its tab.
|
|
27
|
+
*/
|
|
28
|
+
save(request) {
|
|
29
|
+
this.requests.set(request.id, request);
|
|
30
|
+
try {
|
|
31
|
+
if (typeof localStorage !== 'undefined')
|
|
32
|
+
localStorage.setItem(PREFIX + request.id, JSON.stringify(request));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.error('Terminal cleanup persistence failed:', error);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Forget confirmed cleanup in memory and browser storage.
|
|
40
|
+
* @param id - terminal whose Host cleanup succeeded.
|
|
41
|
+
*/
|
|
42
|
+
remove(id) {
|
|
43
|
+
this.requests.delete(id);
|
|
44
|
+
try {
|
|
45
|
+
if (typeof localStorage !== 'undefined')
|
|
46
|
+
localStorage.removeItem(PREFIX + id);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error('Terminal cleanup persistence failed:', error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
load(key) {
|
|
53
|
+
try {
|
|
54
|
+
const raw = localStorage.getItem(key);
|
|
55
|
+
if (raw === null)
|
|
56
|
+
return;
|
|
57
|
+
const parsed = JSON.parse(raw);
|
|
58
|
+
if (!isRequest(parsed) || key !== PREFIX + parsed.id)
|
|
59
|
+
throw new Error('Invalid terminal cleanup request');
|
|
60
|
+
this.requests.set(parsed.id, parsed);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error('Terminal cleanup recovery failed:', error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function isRequest(value) {
|
|
68
|
+
if (typeof value !== 'object' || value === null)
|
|
69
|
+
return false;
|
|
70
|
+
const request = value;
|
|
71
|
+
return typeof request.sessionId === 'string' && request.sessionId.length > 0
|
|
72
|
+
&& typeof request.id === 'string' && /^[\w-]{1,128}$/u.test(request.id)
|
|
73
|
+
&& typeof request.title === 'string';
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=close-requests.js.map
|