@deepseekharness-mobile/protocol 0.0.0-stage → 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 joseph12n
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,67 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/joseph12n/dsh-mobile/main/docs/assets/logo.png" width="72" alt="DSH Mobile" />
2
3
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
4
+ <h1>@deepseekharness-mobile/protocol</h1>
5
+
6
+ <p><strong>The versioned wire contract for DSH Mobile.</strong><br />
7
+ Zod schemas for the envelopes, messages, capabilities and pairing URL shared by the host
8
+ plugin and the PWA.</p>
9
+
10
+ <p>
11
+ <a href="https://www.npmjs.com/package/@deepseekharness-mobile/protocol"><img src="https://img.shields.io/npm/v/@deepseekharness-mobile/protocol?label=npm&color=4D6BFE" alt="npm" /></a>
12
+ <a href="https://github.com/joseph12n/dsh-mobile/actions/workflows/ci.yml"><img src="https://github.com/joseph12n/dsh-mobile/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
13
+ <a href="https://sonarcloud.io/summary/new_code?id=joseph12n_dsh-mobile"><img src="https://sonarcloud.io/api/project_badges/measure?project=joseph12n_dsh-mobile&metric=alert_status" alt="Quality Gate" /></a>
14
+ <a href="https://github.com/joseph12n/dsh-mobile/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-4D6BFE.svg" alt="License" /></a>
15
+ <a href="https://github.com/joseph12n/dsh-mobile/blob/main/packages/protocol/package.json"><img src="https://img.shields.io/badge/TypeScript-5.9-3178C6?logo=typescript&logoColor=white" alt="TypeScript" /></a>
16
+ <a href="https://github.com/joseph12n/dsh-mobile/blob/main/packages/protocol/package.json"><img src="https://img.shields.io/badge/node-%3E%3D24-339933?logo=nodedotjs&logoColor=white" alt="Node" /></a>
17
+ </p>
18
+ </div>
19
+
20
+ ## The contract
21
+
22
+ The phone never talks to DSH's internals. It talks **`dsh-mobile/1`**: a versioned protocol with
23
+ one Zod schema per frame, owned by this package and consumed by both ends.
24
+
25
+ - **One schema, two consumers.** An incompatible change breaks the build instead of the user.
26
+ - **Envelopes.** Every frame carries `v`, `id`, `at` and `type`; requests pair with `*.ok`
27
+ responses and typed `error` frames.
28
+ - **Capabilities.** `hello.ok` lists what the host can do; the client gates its UI on that list.
29
+ - **Pairing.** `parsePairingUrl` and the 10-minute, single-use code format live here too.
30
+
31
+ ## Install
32
+
33
+ ```sh
34
+ pnpm add @deepseekharness-mobile/protocol
35
+ ```
36
+
37
+ ## Use
38
+
39
+ ```ts
40
+ import { ClientMessage, PROTOCOL_VERSION, ServerMessage } from '@deepseekharness-mobile/protocol';
41
+
42
+ const frame = ClientMessage.safeParse(input);
43
+ if (!frame.success) throw new Error('not a dsh-mobile/1 frame');
44
+
45
+ const reply = ServerMessage.safeParse(output);
46
+ ```
47
+
48
+ ## Inside
49
+
50
+ | Module | What it holds |
51
+ | ------------- | -------------------------------------------------------------- |
52
+ | `messages.ts` | The client and server message unions and the `error` codes |
53
+ | `domain.ts` | Sessions, transcripts, models, activity, providers and devices |
54
+ | `pairing.ts` | The pairing URL and the code format |
55
+ | `version.ts` | `PROTOCOL_VERSION` and the `dsh-mobile/1` constant |
56
+
57
+ ## Links
58
+
59
+ - [Repository](https://github.com/joseph12n/dsh-mobile) — the product and the host plugin.
60
+ - [`@deepseekharness-mobile/companion`](https://www.npmjs.com/package/@deepseekharness-mobile/companion)
61
+ — the plugin that speaks this contract.
62
+ - [Architecture](https://github.com/joseph12n/dsh-mobile/blob/main/docs/architecture.md) — the
63
+ layers and the decisions behind them.
64
+
65
+ ## License
66
+
67
+ MIT
@@ -0,0 +1,381 @@
1
+ import { z } from 'zod';
2
+ export declare const SessionId: z.ZodString;
3
+ export type SessionId = z.infer<typeof SessionId>;
4
+ export declare const SessionState: z.ZodEnum<{
5
+ error: "error";
6
+ idle: "idle";
7
+ working: "working";
8
+ waiting: "waiting";
9
+ done: "done";
10
+ }>;
11
+ export type SessionState = z.infer<typeof SessionState>;
12
+ export declare const Capability: z.ZodEnum<{
13
+ "session.create": "session.create";
14
+ "workspace.archive": "workspace.archive";
15
+ "session.history": "session.history";
16
+ "reply.send": "reply.send";
17
+ "question.answer": "question.answer";
18
+ "run.start": "run.start";
19
+ "run.cancel": "run.cancel";
20
+ "workspace.list": "workspace.list";
21
+ "workspace.unarchive": "workspace.unarchive";
22
+ "model.select": "model.select";
23
+ "command.run": "command.run";
24
+ "session.activity": "session.activity";
25
+ "devices.manage": "devices.manage";
26
+ "providers.list": "providers.list";
27
+ "provider.connect": "provider.connect";
28
+ }>;
29
+ export type Capability = z.infer<typeof Capability>;
30
+ export declare const Capabilities: z.ZodArray<z.ZodString>;
31
+ export type Capabilities = z.infer<typeof Capabilities>;
32
+ export declare const ModelSelection: z.ZodObject<{
33
+ provider: z.ZodString;
34
+ model: z.ZodString;
35
+ reasoningEffort: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ export type ModelSelection = z.infer<typeof ModelSelection>;
38
+ export declare const ReasoningEffortOption: z.ZodObject<{
39
+ id: z.ZodString;
40
+ name: z.ZodString;
41
+ description: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ export type ReasoningEffortOption = z.infer<typeof ReasoningEffortOption>;
44
+ export declare const ModelOption: z.ZodObject<{
45
+ id: z.ZodString;
46
+ name: z.ZodString;
47
+ description: z.ZodOptional<z.ZodString>;
48
+ reasoningEfforts: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ id: z.ZodString;
50
+ name: z.ZodString;
51
+ description: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strip>>>;
53
+ defaultReasoningEffort: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ export type ModelOption = z.infer<typeof ModelOption>;
56
+ export declare const ModelGroup: z.ZodObject<{
57
+ id: z.ZodString;
58
+ name: z.ZodString;
59
+ models: z.ZodArray<z.ZodObject<{
60
+ id: z.ZodString;
61
+ name: z.ZodString;
62
+ description: z.ZodOptional<z.ZodString>;
63
+ reasoningEfforts: z.ZodOptional<z.ZodArray<z.ZodObject<{
64
+ id: z.ZodString;
65
+ name: z.ZodString;
66
+ description: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>>>;
68
+ defaultReasoningEffort: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>>;
70
+ }, z.core.$strip>;
71
+ export type ModelGroup = z.infer<typeof ModelGroup>;
72
+ export declare const ModelFailure: z.ZodObject<{
73
+ id: z.ZodString;
74
+ name: z.ZodString;
75
+ message: z.ZodString;
76
+ }, z.core.$strip>;
77
+ export type ModelFailure = z.infer<typeof ModelFailure>;
78
+ export declare const ModelCatalog: z.ZodObject<{
79
+ default: z.ZodOptional<z.ZodObject<{
80
+ provider: z.ZodString;
81
+ model: z.ZodString;
82
+ reasoningEffort: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strip>>;
84
+ groups: z.ZodArray<z.ZodObject<{
85
+ id: z.ZodString;
86
+ name: z.ZodString;
87
+ models: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ name: z.ZodString;
90
+ description: z.ZodOptional<z.ZodString>;
91
+ reasoningEfforts: z.ZodOptional<z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ name: z.ZodString;
94
+ description: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>>>;
96
+ defaultReasoningEffort: z.ZodOptional<z.ZodString>;
97
+ }, z.core.$strip>>;
98
+ }, z.core.$strip>>;
99
+ failures: z.ZodArray<z.ZodObject<{
100
+ id: z.ZodString;
101
+ name: z.ZodString;
102
+ message: z.ZodString;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>;
105
+ export type ModelCatalog = z.infer<typeof ModelCatalog>;
106
+ export declare const SessionSummary: z.ZodObject<{
107
+ id: z.ZodString;
108
+ title: z.ZodString;
109
+ state: z.ZodEnum<{
110
+ error: "error";
111
+ idle: "idle";
112
+ working: "working";
113
+ waiting: "waiting";
114
+ done: "done";
115
+ }>;
116
+ updatedAt: z.ZodNumber;
117
+ seq: z.ZodNumber;
118
+ pendingQuestions: z.ZodNumber;
119
+ model: z.ZodOptional<z.ZodObject<{
120
+ provider: z.ZodString;
121
+ model: z.ZodString;
122
+ reasoningEffort: z.ZodOptional<z.ZodString>;
123
+ }, z.core.$strip>>;
124
+ archived: z.ZodOptional<z.ZodBoolean>;
125
+ workspaceId: z.ZodOptional<z.ZodString>;
126
+ }, z.core.$strip>;
127
+ export type SessionSummary = z.infer<typeof SessionSummary>;
128
+ export declare const Workspace: z.ZodObject<{
129
+ id: z.ZodString;
130
+ title: z.ZodString;
131
+ directory: z.ZodString;
132
+ sessionIds: z.ZodArray<z.ZodString>;
133
+ }, z.core.$strip>;
134
+ export type Workspace = z.infer<typeof Workspace>;
135
+ export declare const TranscriptEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
136
+ kind: z.ZodLiteral<"message">;
137
+ role: z.ZodEnum<{
138
+ user: "user";
139
+ assistant: "assistant";
140
+ }>;
141
+ text: z.ZodString;
142
+ reasoning: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>, z.ZodObject<{
144
+ kind: z.ZodLiteral<"tool">;
145
+ name: z.ZodString;
146
+ summary: z.ZodString;
147
+ status: z.ZodEnum<{
148
+ error: "error";
149
+ running: "running";
150
+ ok: "ok";
151
+ }>;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ kind: z.ZodLiteral<"state">;
154
+ state: z.ZodEnum<{
155
+ error: "error";
156
+ idle: "idle";
157
+ working: "working";
158
+ waiting: "waiting";
159
+ done: "done";
160
+ }>;
161
+ }, z.core.$strip>], "kind">;
162
+ export type TranscriptEvent = z.infer<typeof TranscriptEvent>;
163
+ export declare const QuestionOption: z.ZodObject<{
164
+ label: z.ZodString;
165
+ description: z.ZodOptional<z.ZodString>;
166
+ }, z.core.$strip>;
167
+ export type QuestionOption = z.infer<typeof QuestionOption>;
168
+ export declare const QuestionItem: z.ZodObject<{
169
+ id: z.ZodString;
170
+ text: z.ZodString;
171
+ detail: z.ZodOptional<z.ZodString>;
172
+ header: z.ZodOptional<z.ZodString>;
173
+ options: z.ZodArray<z.ZodObject<{
174
+ label: z.ZodString;
175
+ description: z.ZodOptional<z.ZodString>;
176
+ }, z.core.$strip>>;
177
+ multiSelect: z.ZodBoolean;
178
+ allowCustom: z.ZodBoolean;
179
+ }, z.core.$strip>;
180
+ export type QuestionItem = z.infer<typeof QuestionItem>;
181
+ export declare const QuestionState: z.ZodEnum<{
182
+ open: "open";
183
+ continued: "continued";
184
+ }>;
185
+ export type QuestionState = z.infer<typeof QuestionState>;
186
+ export declare const QuestionBatch: z.ZodObject<{
187
+ callId: z.ZodString;
188
+ sessionId: z.ZodString;
189
+ state: z.ZodEnum<{
190
+ open: "open";
191
+ continued: "continued";
192
+ }>;
193
+ items: z.ZodArray<z.ZodObject<{
194
+ id: z.ZodString;
195
+ text: z.ZodString;
196
+ detail: z.ZodOptional<z.ZodString>;
197
+ header: z.ZodOptional<z.ZodString>;
198
+ options: z.ZodArray<z.ZodObject<{
199
+ label: z.ZodString;
200
+ description: z.ZodOptional<z.ZodString>;
201
+ }, z.core.$strip>>;
202
+ multiSelect: z.ZodBoolean;
203
+ allowCustom: z.ZodBoolean;
204
+ }, z.core.$strip>>;
205
+ createdAt: z.ZodNumber;
206
+ }, z.core.$strip>;
207
+ export type QuestionBatch = z.infer<typeof QuestionBatch>;
208
+ export declare const CommandInfo: z.ZodObject<{
209
+ name: z.ZodString;
210
+ description: z.ZodString;
211
+ hint: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>;
213
+ export type CommandInfo = z.infer<typeof CommandInfo>;
214
+ export declare const CommandResult: z.ZodObject<{
215
+ kind: z.ZodEnum<{
216
+ error: "error";
217
+ success: "success";
218
+ }>;
219
+ text: z.ZodOptional<z.ZodString>;
220
+ }, z.core.$strip>;
221
+ export type CommandResult = z.infer<typeof CommandResult>;
222
+ export declare const ActivityGoal: z.ZodObject<{
223
+ objective: z.ZodString;
224
+ phase: z.ZodString;
225
+ roundsStarted: z.ZodNumber;
226
+ maxRounds: z.ZodOptional<z.ZodNumber>;
227
+ }, z.core.$strip>;
228
+ export type ActivityGoal = z.infer<typeof ActivityGoal>;
229
+ export declare const ActivitySubagent: z.ZodObject<{
230
+ id: z.ZodString;
231
+ label: z.ZodOptional<z.ZodString>;
232
+ activity: z.ZodEnum<{
233
+ running: "running";
234
+ inactive: "inactive";
235
+ }>;
236
+ depth: z.ZodNumber;
237
+ hasChildren: z.ZodOptional<z.ZodBoolean>;
238
+ }, z.core.$strip>;
239
+ export type ActivitySubagent = z.infer<typeof ActivitySubagent>;
240
+ export declare const ActivityTodo: z.ZodObject<{
241
+ content: z.ZodString;
242
+ status: z.ZodEnum<{
243
+ pending: "pending";
244
+ in_progress: "in_progress";
245
+ completed: "completed";
246
+ }>;
247
+ }, z.core.$strip>;
248
+ export type ActivityTodo = z.infer<typeof ActivityTodo>;
249
+ export declare const SessionActivity: z.ZodObject<{
250
+ goal: z.ZodOptional<z.ZodObject<{
251
+ objective: z.ZodString;
252
+ phase: z.ZodString;
253
+ roundsStarted: z.ZodNumber;
254
+ maxRounds: z.ZodOptional<z.ZodNumber>;
255
+ }, z.core.$strip>>;
256
+ subagents: z.ZodArray<z.ZodObject<{
257
+ id: z.ZodString;
258
+ label: z.ZodOptional<z.ZodString>;
259
+ activity: z.ZodEnum<{
260
+ running: "running";
261
+ inactive: "inactive";
262
+ }>;
263
+ depth: z.ZodNumber;
264
+ hasChildren: z.ZodOptional<z.ZodBoolean>;
265
+ }, z.core.$strip>>;
266
+ todos: z.ZodOptional<z.ZodObject<{
267
+ open: z.ZodNumber;
268
+ total: z.ZodNumber;
269
+ items: z.ZodArray<z.ZodObject<{
270
+ content: z.ZodString;
271
+ status: z.ZodEnum<{
272
+ pending: "pending";
273
+ in_progress: "in_progress";
274
+ completed: "completed";
275
+ }>;
276
+ }, z.core.$strip>>;
277
+ }, z.core.$strip>>;
278
+ planActive: z.ZodOptional<z.ZodBoolean>;
279
+ }, z.core.$strip>;
280
+ export type SessionActivity = z.infer<typeof SessionActivity>;
281
+ export declare const ProviderCredential: z.ZodEnum<{
282
+ unknown: "unknown";
283
+ set: "set";
284
+ missing: "missing";
285
+ }>;
286
+ export type ProviderCredential = z.infer<typeof ProviderCredential>;
287
+ export declare const ProviderCredentialSource: z.ZodEnum<{
288
+ file: "file";
289
+ env: "env";
290
+ "project-env": "project-env";
291
+ "user-env": "user-env";
292
+ }>;
293
+ export type ProviderCredentialSource = z.infer<typeof ProviderCredentialSource>;
294
+ export declare const ProviderAction: z.ZodEnum<{
295
+ "add-key": "add-key";
296
+ "add-provider": "add-provider";
297
+ none: "none";
298
+ desktop: "desktop";
299
+ }>;
300
+ export type ProviderAction = z.infer<typeof ProviderAction>;
301
+ export declare const ProviderView: z.ZodObject<{
302
+ id: z.ZodString;
303
+ name: z.ZodString;
304
+ configured: z.ZodBoolean;
305
+ credential: z.ZodEnum<{
306
+ unknown: "unknown";
307
+ set: "set";
308
+ missing: "missing";
309
+ }>;
310
+ credentialSource: z.ZodOptional<z.ZodEnum<{
311
+ file: "file";
312
+ env: "env";
313
+ "project-env": "project-env";
314
+ "user-env": "user-env";
315
+ }>>;
316
+ action: z.ZodEnum<{
317
+ "add-key": "add-key";
318
+ "add-provider": "add-provider";
319
+ none: "none";
320
+ desktop: "desktop";
321
+ }>;
322
+ }, z.core.$strip>;
323
+ export type ProviderView = z.infer<typeof ProviderView>;
324
+ export declare const ProviderTestCode: z.ZodEnum<{
325
+ ok: "ok";
326
+ rejected: "rejected";
327
+ unreachable: "unreachable";
328
+ unsupported: "unsupported";
329
+ invalid: "invalid";
330
+ }>;
331
+ export type ProviderTestCode = z.infer<typeof ProviderTestCode>;
332
+ export declare const ProviderTestResult: z.ZodObject<{
333
+ provider: z.ZodString;
334
+ ok: z.ZodBoolean;
335
+ code: z.ZodEnum<{
336
+ ok: "ok";
337
+ rejected: "rejected";
338
+ unreachable: "unreachable";
339
+ unsupported: "unsupported";
340
+ invalid: "invalid";
341
+ }>;
342
+ detail: z.ZodOptional<z.ZodString>;
343
+ }, z.core.$strip>;
344
+ export type ProviderTestResult = z.infer<typeof ProviderTestResult>;
345
+ export declare const ProviderConnection: z.ZodObject<{
346
+ provider: z.ZodString;
347
+ credential: z.ZodEnum<{
348
+ unknown: "unknown";
349
+ set: "set";
350
+ missing: "missing";
351
+ }>;
352
+ credentialSource: z.ZodOptional<z.ZodEnum<{
353
+ file: "file";
354
+ env: "env";
355
+ "project-env": "project-env";
356
+ "user-env": "user-env";
357
+ }>>;
358
+ }, z.core.$strip>;
359
+ export type ProviderConnection = z.infer<typeof ProviderConnection>;
360
+ export declare const QuestionAnswerItem: z.ZodObject<{
361
+ id: z.ZodString;
362
+ selected: z.ZodArray<z.ZodString>;
363
+ custom: z.ZodOptional<z.ZodString>;
364
+ }, z.core.$strip>;
365
+ export type QuestionAnswerItem = z.infer<typeof QuestionAnswerItem>;
366
+ export declare const HostInfo: z.ZodObject<{
367
+ id: z.ZodString;
368
+ name: z.ZodString;
369
+ version: z.ZodString;
370
+ platform: z.ZodString;
371
+ capabilities: z.ZodArray<z.ZodString>;
372
+ }, z.core.$strip>;
373
+ export type HostInfo = z.infer<typeof HostInfo>;
374
+ export declare const DeviceInfo: z.ZodObject<{
375
+ id: z.ZodString;
376
+ name: z.ZodString;
377
+ createdAt: z.ZodNumber;
378
+ lastSeenAt: z.ZodNumber;
379
+ }, z.core.$strip>;
380
+ export type DeviceInfo = z.infer<typeof DeviceInfo>;
381
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../src/domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS,aAAoB,CAAC;AAC3C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,YAAY;;;;;;EAA0D,CAAC;AACpF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;EAgBrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,YAAY,yBAA6B,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc;;;;iBAIzB,CAAC;AACH,MAAM,MAAM,cAAc,G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domain.js ADDED
@@ -0,0 +1,189 @@
1
+ import { z } from 'zod';
2
+ export const SessionId = z.string().min(1);
3
+ export const SessionState = z.enum(['idle', 'working', 'waiting', 'done', 'error']);
4
+ export const Capability = z.enum([
5
+ 'session.create',
6
+ 'workspace.archive',
7
+ 'session.history',
8
+ 'reply.send',
9
+ 'question.answer',
10
+ 'run.start',
11
+ 'run.cancel',
12
+ 'workspace.list',
13
+ 'workspace.unarchive',
14
+ 'model.select',
15
+ 'command.run',
16
+ 'session.activity',
17
+ 'devices.manage',
18
+ 'providers.list',
19
+ 'provider.connect',
20
+ ]);
21
+ export const Capabilities = z.array(z.string().min(1));
22
+ export const ModelSelection = z.object({
23
+ provider: z.string().min(1),
24
+ model: z.string().min(1),
25
+ reasoningEffort: z.string().min(1).optional(),
26
+ });
27
+ export const ReasoningEffortOption = z.object({
28
+ id: z.string().min(1),
29
+ name: z.string(),
30
+ description: z.string().optional(),
31
+ });
32
+ export const ModelOption = z.object({
33
+ id: z.string().min(1),
34
+ name: z.string(),
35
+ description: z.string().optional(),
36
+ reasoningEfforts: z.array(ReasoningEffortOption).optional(),
37
+ defaultReasoningEffort: z.string().min(1).optional(),
38
+ });
39
+ export const ModelGroup = z.object({
40
+ id: z.string().min(1),
41
+ name: z.string(),
42
+ models: z.array(ModelOption),
43
+ });
44
+ export const ModelFailure = z.object({
45
+ id: z.string().min(1),
46
+ name: z.string(),
47
+ message: z.string(),
48
+ });
49
+ export const ModelCatalog = z.object({
50
+ default: ModelSelection.optional(),
51
+ groups: z.array(ModelGroup),
52
+ failures: z.array(ModelFailure),
53
+ });
54
+ export const SessionSummary = z.object({
55
+ id: SessionId,
56
+ title: z.string(),
57
+ state: SessionState,
58
+ updatedAt: z.number().int().nonnegative(),
59
+ seq: z.number().int().nonnegative(),
60
+ pendingQuestions: z.number().int().nonnegative(),
61
+ model: ModelSelection.optional(),
62
+ archived: z.boolean().optional(),
63
+ workspaceId: z.string().optional(),
64
+ });
65
+ export const Workspace = z.object({
66
+ id: z.string().min(1),
67
+ title: z.string(),
68
+ directory: z.string().min(1),
69
+ sessionIds: z.array(SessionId),
70
+ });
71
+ export const TranscriptEvent = z.discriminatedUnion('kind', [
72
+ z.object({
73
+ kind: z.literal('message'),
74
+ role: z.enum(['user', 'assistant']),
75
+ text: z.string(),
76
+ reasoning: z.string().optional(),
77
+ }),
78
+ z.object({
79
+ kind: z.literal('tool'),
80
+ name: z.string(),
81
+ summary: z.string(),
82
+ status: z.enum(['running', 'ok', 'error']),
83
+ }),
84
+ z.object({
85
+ kind: z.literal('state'),
86
+ state: SessionState,
87
+ }),
88
+ ]);
89
+ export const QuestionOption = z.object({
90
+ label: z.string(),
91
+ description: z.string().optional(),
92
+ });
93
+ export const QuestionItem = z.object({
94
+ id: z.string().min(1),
95
+ text: z.string(),
96
+ detail: z.string().optional(),
97
+ header: z.string().optional(),
98
+ options: z.array(QuestionOption),
99
+ multiSelect: z.boolean(),
100
+ allowCustom: z.boolean(),
101
+ });
102
+ export const QuestionState = z.enum(['open', 'continued']);
103
+ export const QuestionBatch = z.object({
104
+ callId: z.string().min(1),
105
+ sessionId: SessionId,
106
+ state: QuestionState,
107
+ items: z.array(QuestionItem),
108
+ createdAt: z.number().int().nonnegative(),
109
+ });
110
+ export const CommandInfo = z.object({
111
+ name: z.string().min(1),
112
+ description: z.string(),
113
+ hint: z.string().optional(),
114
+ });
115
+ export const CommandResult = z.object({
116
+ kind: z.enum(['success', 'error']),
117
+ text: z.string().optional(),
118
+ });
119
+ export const ActivityGoal = z.object({
120
+ objective: z.string(),
121
+ phase: z.string(),
122
+ roundsStarted: z.number().int().nonnegative(),
123
+ maxRounds: z.number().int().positive().optional(),
124
+ });
125
+ export const ActivitySubagent = z.object({
126
+ id: z.string().min(1),
127
+ label: z.string().optional(),
128
+ activity: z.enum(['running', 'inactive']),
129
+ depth: z.number().int().positive(),
130
+ hasChildren: z.boolean().optional(),
131
+ });
132
+ export const ActivityTodo = z.object({
133
+ content: z.string(),
134
+ status: z.enum(['pending', 'in_progress', 'completed']),
135
+ });
136
+ export const SessionActivity = z.object({
137
+ goal: ActivityGoal.optional(),
138
+ subagents: z.array(ActivitySubagent).max(50),
139
+ todos: z
140
+ .object({
141
+ open: z.number().int().nonnegative(),
142
+ total: z.number().int().nonnegative(),
143
+ items: z.array(ActivityTodo).max(10),
144
+ })
145
+ .optional(),
146
+ planActive: z.boolean().optional(),
147
+ });
148
+ export const ProviderCredential = z.enum(['set', 'missing', 'unknown']);
149
+ export const ProviderCredentialSource = z.enum(['file', 'env', 'project-env', 'user-env']);
150
+ export const ProviderAction = z.enum(['add-key', 'add-provider', 'none', 'desktop']);
151
+ export const ProviderView = z.object({
152
+ id: z.string().min(1),
153
+ name: z.string(),
154
+ configured: z.boolean(),
155
+ credential: ProviderCredential,
156
+ credentialSource: ProviderCredentialSource.optional(),
157
+ action: ProviderAction,
158
+ });
159
+ export const ProviderTestCode = z.enum(['ok', 'rejected', 'unreachable', 'unsupported', 'invalid']);
160
+ export const ProviderTestResult = z.object({
161
+ provider: z.string().min(1),
162
+ ok: z.boolean(),
163
+ code: ProviderTestCode,
164
+ detail: z.string().optional(),
165
+ });
166
+ export const ProviderConnection = z.object({
167
+ provider: z.string().min(1),
168
+ credential: ProviderCredential,
169
+ credentialSource: ProviderCredentialSource.optional(),
170
+ });
171
+ export const QuestionAnswerItem = z.object({
172
+ id: z.string().min(1),
173
+ selected: z.array(z.string()),
174
+ custom: z.string().optional(),
175
+ });
176
+ export const HostInfo = z.object({
177
+ id: z.string().min(1),
178
+ name: z.string(),
179
+ version: z.string(),
180
+ platform: z.string(),
181
+ capabilities: Capabilities,
182
+ });
183
+ export const DeviceInfo = z.object({
184
+ id: z.string().min(1),
185
+ name: z.string(),
186
+ createdAt: z.number().int().nonnegative(),
187
+ lastSeenAt: z.number().int().nonnegative(),
188
+ });
189
+ //# sourceMappingURL=domain.js.map