dsh-auto-flow 0.1.0

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.
@@ -0,0 +1,314 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ const dsh_auto_flow_autoFlow_exec_parameter_0$schema = z.object({
5
+ 'command': z.string(),
6
+ 'workdir': z.union([z.undefined(), z.string()]).optional(),
7
+ 'timeoutMs': z.union([z.undefined(), z.number()]).optional(),
8
+ 'stdoutMaxBytes': z.union([z.undefined(), z.number()]).optional(),
9
+ 'runInBackground': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
10
+ })
11
+ const dsh_auto_flow_autoFlow_exec_result$schema = z.union([z.object({
12
+ 'kind': z.literal("foreground"),
13
+ 'exitCode': z.union([z.literal(null), z.number()]),
14
+ 'signal': z.union([z.literal(null), z.string()]),
15
+ 'timedOut': z.boolean(),
16
+ 'aborted': z.boolean(),
17
+ 'timeoutMs': z.number(),
18
+ 'stdout': z.object({
19
+ 'text': z.string(),
20
+ 'truncated': z.boolean(),
21
+ 'spillPath': z.union([z.undefined(), z.string()]).optional(),
22
+ }),
23
+ 'stderr': z.object({
24
+ 'text': z.string(),
25
+ 'truncated': z.boolean(),
26
+ 'spillPath': z.union([z.undefined(), z.string()]).optional(),
27
+ }),
28
+ 'sandbox': z.union([z.undefined(), z.object({
29
+ 'mode': z.string(),
30
+ 'denied': z.boolean(),
31
+ 'enforcement': z.union([z.undefined(), z.string()]).optional(),
32
+ 'runnerFailed': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
33
+ })]).optional(),
34
+ }), z.object({
35
+ 'kind': z.literal("background"),
36
+ 'jobId': z.string(),
37
+ })])
38
+ const dsh_auto_flow_autoFlow_execKill_parameter_0$schema = z.string()
39
+ const dsh_auto_flow_autoFlow_execKill_result$schema = z.object({
40
+ 'kind': z.union([z.literal("requested"), z.literal("already-finished")]),
41
+ })
42
+ const dsh_auto_flow_autoFlow_execRead_parameter_0$schema = z.string()
43
+ const dsh_auto_flow_autoFlow_execRead_result$schema = z.object({
44
+ 'text': z.string(),
45
+ 'status': z.string(),
46
+ 'detail': z.union([z.undefined(), z.string()]).optional(),
47
+ })
48
+ const dsh_auto_flow_autoFlow_last_result$schema = z.union([z.literal(null), z.object({
49
+ 'id': z.number(),
50
+ 'text': z.string(),
51
+ 'createdAt': z.number(),
52
+ })])
53
+ const dsh_auto_flow_autoFlow_list_result$schema = z.array(z.object({
54
+ 'id': z.number(),
55
+ 'text': z.string(),
56
+ 'createdAt': z.number(),
57
+ }))
58
+ const dsh_auto_flow_autoFlow_send_parameter_0$schema = z.string()
59
+ const dsh_auto_flow_autoFlow_send_result$schema = z.object({
60
+ 'id': z.number(),
61
+ 'text': z.string(),
62
+ 'createdAt': z.number(),
63
+ })
64
+
65
+ export const TYPERT = {
66
+ package: 'dsh-auto-flow',
67
+ face: 'host',
68
+ schemas: [
69
+ ],
70
+ invocations: [
71
+ {
72
+ id: 'dsh-auto-flow#autoFlow/exec',
73
+ service: 'autoFlow',
74
+ namespace: 'autoFlow',
75
+ method: 'exec',
76
+ invocation: { kind: 'direct' },
77
+ parameters: [
78
+ {
79
+ name: 'request',
80
+ wire: 'request',
81
+ source: 'json',
82
+ codec: {
83
+ mode: 'strict',
84
+ typeSymbol: 'dsh-auto-flow/types#ExecRequest',
85
+ schema: dsh_auto_flow_autoFlow_exec_parameter_0$schema,
86
+ },
87
+ },
88
+ ],
89
+ result: {
90
+ mode: 'strict',
91
+ typeSymbol: 'dsh-auto-flow/types#ExecResult',
92
+ schema: dsh_auto_flow_autoFlow_exec_result$schema,
93
+ },
94
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":511,"column":9},
95
+ },
96
+ {
97
+ id: 'dsh-auto-flow#autoFlow/execKill',
98
+ service: 'autoFlow',
99
+ namespace: 'autoFlow',
100
+ method: 'execKill',
101
+ invocation: { kind: 'direct' },
102
+ parameters: [
103
+ {
104
+ name: 'jobId',
105
+ wire: 'jobId',
106
+ source: 'json',
107
+ codec: {
108
+ mode: 'strict',
109
+ typeSymbol: 'dsh-auto-flow#autoFlow/execKill:jobId',
110
+ schema: dsh_auto_flow_autoFlow_execKill_parameter_0$schema,
111
+ },
112
+ },
113
+ ],
114
+ result: {
115
+ mode: 'strict',
116
+ typeSymbol: 'dsh-auto-flow/types#ExecKillResult',
117
+ schema: dsh_auto_flow_autoFlow_execKill_result$schema,
118
+ },
119
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":585,"column":9},
120
+ },
121
+ {
122
+ id: 'dsh-auto-flow#autoFlow/execRead',
123
+ service: 'autoFlow',
124
+ namespace: 'autoFlow',
125
+ method: 'execRead',
126
+ invocation: { kind: 'direct' },
127
+ parameters: [
128
+ {
129
+ name: 'jobId',
130
+ wire: 'jobId',
131
+ source: 'json',
132
+ codec: {
133
+ mode: 'strict',
134
+ typeSymbol: 'dsh-auto-flow#autoFlow/execRead:jobId',
135
+ schema: dsh_auto_flow_autoFlow_execRead_parameter_0$schema,
136
+ },
137
+ },
138
+ ],
139
+ result: {
140
+ mode: 'strict',
141
+ typeSymbol: 'dsh-auto-flow/types#ExecReadResult',
142
+ schema: dsh_auto_flow_autoFlow_execRead_result$schema,
143
+ },
144
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":559,"column":9},
145
+ },
146
+ {
147
+ id: 'dsh-auto-flow#autoFlow/last',
148
+ service: 'autoFlow',
149
+ namespace: 'autoFlow',
150
+ method: 'last',
151
+ invocation: { kind: 'direct' },
152
+ parameters: [
153
+ ],
154
+ result: {
155
+ mode: 'strict',
156
+ typeSymbol: 'dsh-auto-flow#autoFlow/last:result',
157
+ schema: dsh_auto_flow_autoFlow_last_result$schema,
158
+ },
159
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":487,"column":3},
160
+ },
161
+ {
162
+ id: 'dsh-auto-flow#autoFlow/list',
163
+ service: 'autoFlow',
164
+ namespace: 'autoFlow',
165
+ method: 'list',
166
+ invocation: { kind: 'direct' },
167
+ parameters: [
168
+ ],
169
+ result: {
170
+ mode: 'strict',
171
+ typeSymbol: 'dsh-auto-flow#autoFlow/list:result',
172
+ schema: dsh_auto_flow_autoFlow_list_result$schema,
173
+ },
174
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":481,"column":3},
175
+ },
176
+ {
177
+ id: 'dsh-auto-flow#autoFlow/send',
178
+ service: 'autoFlow',
179
+ namespace: 'autoFlow',
180
+ method: 'send',
181
+ invocation: { kind: 'direct' },
182
+ parameters: [
183
+ {
184
+ name: 'text',
185
+ wire: 'text',
186
+ source: 'json',
187
+ codec: {
188
+ mode: 'strict',
189
+ typeSymbol: 'dsh-auto-flow#autoFlow/send:text',
190
+ schema: dsh_auto_flow_autoFlow_send_parameter_0$schema,
191
+ },
192
+ },
193
+ ],
194
+ result: {
195
+ mode: 'strict',
196
+ typeSymbol: 'dsh-auto-flow/types#Greeting',
197
+ schema: dsh_auto_flow_autoFlow_send_result$schema,
198
+ },
199
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":453,"column":9},
200
+ },
201
+ ],
202
+ model: {
203
+ "services": [
204
+ {
205
+ "description": "示例服务:类本身就是插件——static inject / Config 是 Cordis 类插件的约定, 构造器里的注册(工具/事件/设置/命令)随插件卸载自动回收。 平台服务消费方式(跨插件协作走 Cordis 服务、禁止互相 import): - 必需依赖用 `static inject`(tools); - 可选依赖用 `ctx.inject([...], cb)`(settings / commands / systemPrompt / autoFlowFormatter)——服务缺失时插件照常加载; - shell / sandboxPolicy 是可选服务:用 `ctx.get(...)` 读取,未组合时 `exec` 报错、插件其余部分照常工作; - 持久层异步打开走 `[Service.init]`(storageDomain 可选:缺省退化为内存态)。",
206
+ "summary": "示例服务:类本身就是插件——static inject / Config 是 Cordis 类插件的约定, 构造器里的注册(工具/事件/设置/命令)随插件卸载自动回收。 平台服务消费方式(跨插件协作走 Cordis 服务、禁止互相 import): - 必需依赖用 `static inject`(tools); - 可选依赖用 `ctx.inject([...], cb)`(settings / commands / systemPrompt / autoFlowFormatter)——服务缺失时插件照常加载; - shell / sandboxPolicy 是可选服务:用 `ctx.get(...)` 读取,未组合时 `exec` 报错、插件其余部分照常工作; - 持久层异步打开走 `[Service.init]`(storageDomain 可选:缺省退化为内存态)。",
207
+ "tags": [],
208
+ "jsDoc": "/**\n * 示例服务:类本身就是插件——static inject / Config 是 Cordis 类插件的约定,\n * 构造器里的注册(工具/事件/设置/命令)随插件卸载自动回收。\n *\n * 平台服务消费方式(跨插件协作走 Cordis 服务、禁止互相 import):\n * - 必需依赖用 `static inject`(tools);\n * - 可选依赖用 `ctx.inject([...], cb)`(settings / commands / systemPrompt /\n * autoFlowFormatter)——服务缺失时插件照常加载;\n * - shell / sandboxPolicy 是可选服务:用 `ctx.get(...)` 读取,未组合时\n * `exec` 报错、插件其余部分照常工作;\n * - 持久层异步打开走 `[Service.init]`(storageDomain 可选:缺省退化为内存态)。\n */",
209
+ "key": "autoFlow",
210
+ "exportName": "AutoFlowService",
211
+ "members": [
212
+ {
213
+ "kind": "method",
214
+ "name": "send",
215
+ "signature": "@Remote('send') async send(text: string): Promise<Greeting>",
216
+ "summary": "追加一条问候并返回记录(写透 domain storage;若有第二包则先格式化;提交后发域事件)。 不追加自定义会话事件:harness 的 session 持久化读路径会拒绝 `KNOWN_SESSION_EVENT_TYPES` 之外的事件类型(除非信封标记 `ignorable`,而 `Session.append` 无此参数),把插件 自定义事件写进会话日志会导致该会话在重启后无法打开。",
217
+ "jsDoc": "/**\n * 追加一条问候并返回记录(写透 domain storage;若有第二包则先格式化;提交后发域事件)。\n *\n * 不追加自定义会话事件:harness 的 session 持久化读路径会拒绝 `KNOWN_SESSION_EVENT_TYPES`\n * 之外的事件类型(除非信封标记 `ignorable`,而 `Session.append` 无此参数),把插件\n * 自定义事件写进会话日志会导致该会话在重启后无法打开。\n */"
218
+ },
219
+ {
220
+ "kind": "method",
221
+ "name": "list",
222
+ "signature": "@Remote('list') list(): Promise<Greeting[]>",
223
+ "summary": "返回全部问候记录(内存视图,已由 domain storage 水合)。",
224
+ "jsDoc": "/** 返回全部问候记录(内存视图,已由 domain storage 水合)。 */"
225
+ },
226
+ {
227
+ "kind": "method",
228
+ "name": "last",
229
+ "signature": "@Remote('last') last(): Promise<Greeting | null>",
230
+ "summary": "返回最近一次提交的问候(由域事件监听器维护),首次提交前为 null。",
231
+ "jsDoc": "/** 返回最近一次提交的问候(由域事件监听器维护),首次提交前为 null。 */"
232
+ },
233
+ {
234
+ "kind": "method",
235
+ "name": "exec",
236
+ "signature": "@Remote('exec') async exec(request: ExecRequest): Promise<ExecResult>",
237
+ "summary": "执行一条命令行(宿主内经 ctx.shell,与 bash 工具同一执行器,绝不经过模型)。 输出只回调用方、不进会话日志。@Remote 严格契约保证浏览器端完整类型与校验。 相比模型工具(@deepseek-ai/dsh-tool-bash)的 shell 面,@Remote 轻执行只能拿到 能映射过来的子集:timeoutMs / stdoutMaxBytes / sandboxPolicy / 后台任务 / 结果保真。 模型工具专属的 seam(shellEnv.collect 需要 ToolExecution、sandbox 升级需要 approval + callId、abort 需要 ToolExecution.signal)不适用于",
238
+ "jsDoc": "/**\n * 执行一条命令行(宿主内经 ctx.shell,与 bash 工具同一执行器,绝不经过模型)。\n * 输出只回调用方、不进会话日志。@Remote 严格契约保证浏览器端完整类型与校验。\n *\n * 相比模型工具(@deepseek-ai/dsh-tool-bash)的 shell 面,@Remote 轻执行只能拿到\n * 能映射过来的子集:timeoutMs / stdoutMaxBytes / sandboxPolicy / 后台任务 / 结果保真。\n * 模型工具专属的 seam(shellEnv.collect 需要 ToolExecution、sandbox 升级需要 approval\n * + callId、abort 需要 ToolExecution.signal)不适用于 @Remote,此处不做。\n *\n * 注意:@Remote 方法不能带 `agent: Agent` 参数——第三方仓库的 typert 生成器无法解析\n * `agent` lookup(其 wire 类型 SessionId 是 branded 类型,官方 monorepo 内才可用)。\n * 因此沙箱策略退化为「部署默认」(`sandboxPolicy.resolve()` 无 session)。\n *\n * 后台执行不走 ctx.jobs(那是给模型工具 job_output/job_kill 用的,需要 agent owner +\n * dsh-tool-jobs 控制器,@Remote 里拿不到):直接用 `shell.start()` 拿 ShellProcess\n * 句柄,自管在 this.background Map 里,execRead/execKill 直接操作句柄;卸载时统一 kill。\n *\n * shell / sandboxPolicy 是可选依赖:未组合时抛对应 RemoteError,插件其余照常。\n */"
239
+ },
240
+ {
241
+ "kind": "method",
242
+ "name": "execRead",
243
+ "signature": "@Remote('execRead') async execRead(jobId: string): Promise<ExecReadResult>",
244
+ "summary": "读后台进程的下一次增量/终态输出(自管 ShellProcess 句柄,不依赖 ctx.jobs)。",
245
+ "jsDoc": "/** 读后台进程的下一次增量/终态输出(自管 ShellProcess 句柄,不依赖 ctx.jobs)。 */"
246
+ },
247
+ {
248
+ "kind": "method",
249
+ "name": "execKill",
250
+ "signature": "@Remote('execKill') async execKill(jobId: string): Promise<ExecKillResult>",
251
+ "summary": "请求取消后台进程(自管 ShellProcess 句柄,不依赖 ctx.jobs)。",
252
+ "jsDoc": "/** 请求取消后台进程(自管 ShellProcess 句柄,不依赖 ctx.jobs)。 */"
253
+ }
254
+ ],
255
+ "types": [
256
+ {
257
+ "name": "ExecBackgroundResult",
258
+ "declaration": "export interface ExecBackgroundResult {\n kind: 'background';\n jobId: string;\n}"
259
+ },
260
+ {
261
+ "name": "ExecForegroundResult",
262
+ "declaration": "export interface ExecForegroundResult {\n kind: 'foreground';\n exitCode: number | null;\n signal: string | null;\n timedOut: boolean;\n aborted: boolean;\n timeoutMs: number;\n stdout: ExecOutput;\n stderr: ExecOutput;\n sandbox?: ExecSandboxInfo;\n}"
263
+ },
264
+ {
265
+ "name": "ExecKillResult",
266
+ "declaration": "export interface ExecKillResult {\n kind: 'requested' | 'already-finished';\n}"
267
+ },
268
+ {
269
+ "name": "ExecOutput",
270
+ "declaration": "export interface ExecOutput {\n text: string;\n truncated: boolean;\n spillPath?: string;\n}"
271
+ },
272
+ {
273
+ "name": "ExecReadResult",
274
+ "declaration": "export interface ExecReadResult {\n text: string;\n status: string;\n detail?: string;\n}"
275
+ },
276
+ {
277
+ "name": "ExecRequest",
278
+ "declaration": "export interface ExecRequest {\n command: string;\n workdir?: string;\n timeoutMs?: number;\n stdoutMaxBytes?: number;\n runInBackground?: boolean;\n}"
279
+ },
280
+ {
281
+ "name": "ExecResult",
282
+ "declaration": "export type ExecResult = ExecForegroundResult | ExecBackgroundResult;"
283
+ },
284
+ {
285
+ "name": "ExecSandboxInfo",
286
+ "declaration": "export interface ExecSandboxInfo {\n mode: string;\n denied: boolean;\n enforcement?: string;\n runnerFailed?: boolean;\n}"
287
+ },
288
+ {
289
+ "name": "Greeting",
290
+ "declaration": "export interface Greeting {\n id: number;\n text: string;\n createdAt: number;\n}"
291
+ }
292
+ ]
293
+ }
294
+ ],
295
+ "events": [
296
+ {
297
+ "description": "一次问候已提交(域事件,跨插件实时通知 seam)。发出方在 `send` 提交后 emit;其它插件可 `ctx.on('autoFlow/recorded', ...)` 订阅。",
298
+ "summary": "一次问候已提交(域事件,跨插件实时通知 seam)。发出方在 `send` 提交后 emit;其它插件可 `ctx.on('autoFlow/recorded', ...)` 订阅。",
299
+ "tags": [
300
+ {
301
+ "name": "mode",
302
+ "comment": "emit",
303
+ "text": "@mode emit"
304
+ }
305
+ ],
306
+ "jsDoc": "/**\n * 一次问候已提交(域事件,跨插件实时通知 seam)。发出方在 `send` 提交后\n * emit;其它插件可 `ctx.on('autoFlow/recorded', ...)` 订阅。\n * @mode emit\n */",
307
+ "name": "autoFlow/recorded",
308
+ "mode": "emit",
309
+ "signature": "'autoFlow/recorded'(payload: { readonly greeting: Greeting; }): void"
310
+ }
311
+ ],
312
+ "objects": []
313
+ },
314
+ }
@@ -0,0 +1,32 @@
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 { ExecKillResult, ExecReadResult, ExecRequest, ExecResult, Greeting } from 'dsh-auto-flow/types'
7
+
8
+ declare module '@deepseek-ai/dsh-typert-protocol' {
9
+ interface TypertRemoteNamespace$6175746f466c6f77 {
10
+ exec: (request: ExecRequest) => Promise<RemoteResult<ExecResult>>
11
+ execKill: (jobId: string) => Promise<RemoteResult<ExecKillResult>>
12
+ execRead: (jobId: string) => Promise<RemoteResult<ExecReadResult>>
13
+ last: () => Promise<RemoteResult<Greeting | null>>
14
+ list: () => Promise<RemoteResult<Greeting[]>>
15
+ send: (text: string) => Promise<RemoteResult<Greeting>>
16
+ }
17
+ interface TypertRemoteMap {
18
+ 'autoFlow/exec': (request: ExecRequest) => Promise<RemoteResult<ExecResult>>
19
+ 'autoFlow/execKill': (jobId: string) => Promise<RemoteResult<ExecKillResult>>
20
+ 'autoFlow/execRead': (jobId: string) => Promise<RemoteResult<ExecReadResult>>
21
+ 'autoFlow/last': () => Promise<RemoteResult<Greeting | null>>
22
+ 'autoFlow/list': () => Promise<RemoteResult<Greeting[]>>
23
+ 'autoFlow/send': (text: string) => Promise<RemoteResult<Greeting>>
24
+ }
25
+ interface TypertRemoteNamespaceMap {
26
+ 'autoFlow': TypertRemoteNamespace$6175746f466c6f77
27
+ }
28
+ }
29
+
30
+ export declare const TYPERT_REMOTE: TypertRemoteContribution
31
+ export default TYPERT_REMOTE
32
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,201 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ const dsh_auto_flow_autoFlow_exec_parameter_0$schema = z.object({
5
+ 'command': z.string(),
6
+ 'workdir': z.union([z.undefined(), z.string()]).optional(),
7
+ 'timeoutMs': z.union([z.undefined(), z.number()]).optional(),
8
+ 'stdoutMaxBytes': z.union([z.undefined(), z.number()]).optional(),
9
+ 'runInBackground': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
10
+ })
11
+ const dsh_auto_flow_autoFlow_exec_result$schema = z.union([z.object({
12
+ 'kind': z.literal("foreground"),
13
+ 'exitCode': z.union([z.literal(null), z.number()]),
14
+ 'signal': z.union([z.literal(null), z.string()]),
15
+ 'timedOut': z.boolean(),
16
+ 'aborted': z.boolean(),
17
+ 'timeoutMs': z.number(),
18
+ 'stdout': z.object({
19
+ 'text': z.string(),
20
+ 'truncated': z.boolean(),
21
+ 'spillPath': z.union([z.undefined(), z.string()]).optional(),
22
+ }),
23
+ 'stderr': z.object({
24
+ 'text': z.string(),
25
+ 'truncated': z.boolean(),
26
+ 'spillPath': z.union([z.undefined(), z.string()]).optional(),
27
+ }),
28
+ 'sandbox': z.union([z.undefined(), z.object({
29
+ 'mode': z.string(),
30
+ 'denied': z.boolean(),
31
+ 'enforcement': z.union([z.undefined(), z.string()]).optional(),
32
+ 'runnerFailed': z.union([z.undefined(), z.literal(false), z.literal(true)]).optional(),
33
+ })]).optional(),
34
+ }), z.object({
35
+ 'kind': z.literal("background"),
36
+ 'jobId': z.string(),
37
+ })])
38
+ const dsh_auto_flow_autoFlow_execKill_parameter_0$schema = z.string()
39
+ const dsh_auto_flow_autoFlow_execKill_result$schema = z.object({
40
+ 'kind': z.union([z.literal("requested"), z.literal("already-finished")]),
41
+ })
42
+ const dsh_auto_flow_autoFlow_execRead_parameter_0$schema = z.string()
43
+ const dsh_auto_flow_autoFlow_execRead_result$schema = z.object({
44
+ 'text': z.string(),
45
+ 'status': z.string(),
46
+ 'detail': z.union([z.undefined(), z.string()]).optional(),
47
+ })
48
+ const dsh_auto_flow_autoFlow_last_result$schema = z.union([z.literal(null), z.object({
49
+ 'id': z.number(),
50
+ 'text': z.string(),
51
+ 'createdAt': z.number(),
52
+ })])
53
+ const dsh_auto_flow_autoFlow_list_result$schema = z.array(z.object({
54
+ 'id': z.number(),
55
+ 'text': z.string(),
56
+ 'createdAt': z.number(),
57
+ }))
58
+ const dsh_auto_flow_autoFlow_send_parameter_0$schema = z.string()
59
+ const dsh_auto_flow_autoFlow_send_result$schema = z.object({
60
+ 'id': z.number(),
61
+ 'text': z.string(),
62
+ 'createdAt': z.number(),
63
+ })
64
+
65
+ export const TYPERT_REMOTE = {
66
+ package: 'dsh-auto-flow',
67
+ descriptors: [
68
+ {
69
+ id: 'dsh-auto-flow#autoFlow/exec',
70
+ service: 'autoFlow',
71
+ namespace: 'autoFlow',
72
+ method: 'exec',
73
+ invocation: { kind: 'direct' },
74
+ parameters: [
75
+ {
76
+ name: 'request',
77
+ wire: 'request',
78
+ source: 'json',
79
+ codec: {
80
+ mode: 'strict',
81
+ typeSymbol: 'dsh-auto-flow/types#ExecRequest',
82
+ schema: dsh_auto_flow_autoFlow_exec_parameter_0$schema,
83
+ },
84
+ },
85
+ ],
86
+ result: {
87
+ mode: 'strict',
88
+ typeSymbol: 'dsh-auto-flow/types#ExecResult',
89
+ schema: dsh_auto_flow_autoFlow_exec_result$schema,
90
+ },
91
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":511,"column":9},
92
+ },
93
+ {
94
+ id: 'dsh-auto-flow#autoFlow/execKill',
95
+ service: 'autoFlow',
96
+ namespace: 'autoFlow',
97
+ method: 'execKill',
98
+ invocation: { kind: 'direct' },
99
+ parameters: [
100
+ {
101
+ name: 'jobId',
102
+ wire: 'jobId',
103
+ source: 'json',
104
+ codec: {
105
+ mode: 'strict',
106
+ typeSymbol: 'dsh-auto-flow#autoFlow/execKill:jobId',
107
+ schema: dsh_auto_flow_autoFlow_execKill_parameter_0$schema,
108
+ },
109
+ },
110
+ ],
111
+ result: {
112
+ mode: 'strict',
113
+ typeSymbol: 'dsh-auto-flow/types#ExecKillResult',
114
+ schema: dsh_auto_flow_autoFlow_execKill_result$schema,
115
+ },
116
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":585,"column":9},
117
+ },
118
+ {
119
+ id: 'dsh-auto-flow#autoFlow/execRead',
120
+ service: 'autoFlow',
121
+ namespace: 'autoFlow',
122
+ method: 'execRead',
123
+ invocation: { kind: 'direct' },
124
+ parameters: [
125
+ {
126
+ name: 'jobId',
127
+ wire: 'jobId',
128
+ source: 'json',
129
+ codec: {
130
+ mode: 'strict',
131
+ typeSymbol: 'dsh-auto-flow#autoFlow/execRead:jobId',
132
+ schema: dsh_auto_flow_autoFlow_execRead_parameter_0$schema,
133
+ },
134
+ },
135
+ ],
136
+ result: {
137
+ mode: 'strict',
138
+ typeSymbol: 'dsh-auto-flow/types#ExecReadResult',
139
+ schema: dsh_auto_flow_autoFlow_execRead_result$schema,
140
+ },
141
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":559,"column":9},
142
+ },
143
+ {
144
+ id: 'dsh-auto-flow#autoFlow/last',
145
+ service: 'autoFlow',
146
+ namespace: 'autoFlow',
147
+ method: 'last',
148
+ invocation: { kind: 'direct' },
149
+ parameters: [
150
+ ],
151
+ result: {
152
+ mode: 'strict',
153
+ typeSymbol: 'dsh-auto-flow#autoFlow/last:result',
154
+ schema: dsh_auto_flow_autoFlow_last_result$schema,
155
+ },
156
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":487,"column":3},
157
+ },
158
+ {
159
+ id: 'dsh-auto-flow#autoFlow/list',
160
+ service: 'autoFlow',
161
+ namespace: 'autoFlow',
162
+ method: 'list',
163
+ invocation: { kind: 'direct' },
164
+ parameters: [
165
+ ],
166
+ result: {
167
+ mode: 'strict',
168
+ typeSymbol: 'dsh-auto-flow#autoFlow/list:result',
169
+ schema: dsh_auto_flow_autoFlow_list_result$schema,
170
+ },
171
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":481,"column":3},
172
+ },
173
+ {
174
+ id: 'dsh-auto-flow#autoFlow/send',
175
+ service: 'autoFlow',
176
+ namespace: 'autoFlow',
177
+ method: 'send',
178
+ invocation: { kind: 'direct' },
179
+ parameters: [
180
+ {
181
+ name: 'text',
182
+ wire: 'text',
183
+ source: 'json',
184
+ codec: {
185
+ mode: 'strict',
186
+ typeSymbol: 'dsh-auto-flow#autoFlow/send:text',
187
+ schema: dsh_auto_flow_autoFlow_send_parameter_0$schema,
188
+ },
189
+ },
190
+ ],
191
+ result: {
192
+ mode: 'strict',
193
+ typeSymbol: 'dsh-auto-flow/types#Greeting',
194
+ schema: dsh_auto_flow_autoFlow_send_result$schema,
195
+ },
196
+ sourceLocation: {"file":"packages/dsh-auto-flow/src/index.ts","line":453,"column":9},
197
+ },
198
+ ],
199
+ }
200
+
201
+ export default TYPERT_REMOTE
package/lib/types.d.ts ADDED
@@ -0,0 +1,106 @@
1
+ //#region src/types.d.ts
2
+ /**
3
+ * dsh-auto-flow 的共享业务类型;Host 与 Client 都从这里取(经本包 ./types 出口)。
4
+ * 本文件必须保持「浏览器安全」:只含纯 JSON 可序列化的载荷与类型词汇,
5
+ * 不 import 任何 Host 专属值(Agent / HarnessError 等只在 Host 半 src/index.ts 用)。
6
+ */
7
+ /** 一条问候记录。 */
8
+ interface Greeting {
9
+ /** 记录 id(自增)。 */
10
+ id: number;
11
+ /** 问候内容(含前缀)。 */
12
+ text: string;
13
+ /** 创建时间戳(毫秒)。 */
14
+ createdAt: number;
15
+ }
16
+ /** 一次运行捕获的一路输出(CollectedOutput 的客户端安全投影)。 */
17
+ interface ExecOutput {
18
+ /** 已捕获文本。 */
19
+ text: string;
20
+ /** 捕获是否被截断(完整输出在 spillPath)。 */
21
+ truncated: boolean;
22
+ /** 截断时的完整输出文件路径。 */
23
+ spillPath?: string;
24
+ }
25
+ /** 一次运行附带的沙箱事实(ShellSandboxInfo 的客户端安全投影,mode 字符串化)。 */
26
+ interface ExecSandboxInfo {
27
+ /** 命令实际运行的模式(read-only / workspace-write / danger-full-access)。 */
28
+ mode: string;
29
+ /** 沙箱是否拒绝了某次文件操作。 */
30
+ denied: boolean;
31
+ /** 选定 runner 对请求模式的执行完整度。 */
32
+ enforcement?: string;
33
+ /** 沙箱 runner 是否在命令运行前就失败(命令未运行)。 */
34
+ runnerFailed?: boolean;
35
+ }
36
+ /**
37
+ * exec Remote 方法的请求(经 ctx.shell seam,与 bash 工具同一执行器、绝不经过模型)。
38
+ * 轻执行:输出只回调用方,不进会话日志。
39
+ */
40
+ interface ExecRequest {
41
+ /** 通过 Host 默认 shell 执行的命令行。 */
42
+ command: string;
43
+ /** 工作目录;缺省用执行器的已配置工作目录。 */
44
+ workdir?: string;
45
+ /** 超时(毫秒);执行器会应用其默认值并封顶。后台执行忽略。 */
46
+ timeoutMs?: number;
47
+ /** 前台 stdout 捕获预算(字节);需要完整解析 stdout 的进程内消费者用。 */
48
+ stdoutMaxBytes?: number;
49
+ /** 置 true 走后台(立即返回 jobId,经 execRead/execKill 消费),不设超时。 */
50
+ runInBackground?: boolean;
51
+ }
52
+ /** 前台执行的完成结果(从 ctx.shell 的 ShellRunResult 映射,保留截断/沙箱事实)。 */
53
+ interface ExecForegroundResult {
54
+ kind: 'foreground';
55
+ /** 退出码;被信号杀死时为 null。 */
56
+ exitCode: number | null;
57
+ /** 终止信号(如 'SIGTERM');正常退出为 null。 */
58
+ signal: string | null;
59
+ /** 执行器自身超时是否先终止了命令。 */
60
+ timedOut: boolean;
61
+ /** 调用方取消是否先终止了命令。 */
62
+ aborted: boolean;
63
+ /** 本次实际生效的超时(默认/封顶之后)。 */
64
+ timeoutMs: number;
65
+ stdout: ExecOutput;
66
+ stderr: ExecOutput;
67
+ /** 沙箱执行事实;未沙箱化的执行器缺省。 */
68
+ sandbox?: ExecSandboxInfo;
69
+ }
70
+ /** 后台执行的确认:立即返回 job id,客户端经 execRead/execKill 消费。 */
71
+ interface ExecBackgroundResult {
72
+ kind: 'background';
73
+ jobId: string;
74
+ }
75
+ /** exec Remote 方法的结果:前台完整输出,或后台 job id。 */
76
+ type ExecResult = ExecForegroundResult | ExecBackgroundResult;
77
+ /** 后台进程的一次增量读取(经 shell.start 句柄 readOutput,客户端安全)。 */
78
+ interface ExecReadResult {
79
+ /** 本次增量(流式)或终态输出(final-output)。 */
80
+ text: string;
81
+ /** job 当前状态:running | stopping | completed | killed | failed。 */
82
+ status: string;
83
+ /** 终态详情(如 'exit code: 0'),未终态缺省。 */
84
+ detail?: string;
85
+ }
86
+ /** execKill 的返回。 */
87
+ interface ExecKillResult {
88
+ /** requested:已请求取消;already-finished:已终态。 */
89
+ kind: 'requested' | 'already-finished';
90
+ }
91
+ declare module '@deepseek-ai/dsh-typert-protocol' {
92
+ interface RemoteErrorDetailsMap {
93
+ /** exec 命令超过配置的 UTF-8 字节上界。 */
94
+ 'autoFlow/command-too-long': {
95
+ readonly maxBytes: number;
96
+ readonly actualBytes: number;
97
+ };
98
+ /** 组合未提供 ctx.shell 提供方(@deepseek-ai/dsh-shell)。 */
99
+ 'autoFlow/shell-missing': {};
100
+ /** 后台 job 不存在或已结束。 */
101
+ 'autoFlow/job-not-found': {};
102
+ }
103
+ }
104
+ //#endregion
105
+ export { ExecBackgroundResult, ExecForegroundResult, ExecKillResult, ExecOutput, ExecReadResult, ExecRequest, ExecResult, ExecSandboxInfo, Greeting };
106
+ //# sourceMappingURL=types.d.ts.map
package/lib/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};