@deepseekharness-mobile/protocol 0.1.0 → 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.
Files changed (2) hide show
  1. package/README.md +47 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,10 +1,32 @@
1
- # @deepseekharness-mobile/protocol
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
- The versioned wire contract (`dsh-mobile/1`) shared by the [DSH Mobile](https://github.com/joseph12n/dsh-mobile)
4
- host plugin and its PWA.
4
+ <h1>@deepseekharness-mobile/protocol</h1>
5
5
 
6
- It contains the Zod schemas for the envelopes, the client and server messages, the capability
7
- names and the pairing URL, so both ends validate the same frames.
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.
8
30
 
9
31
  ## Install
10
32
 
@@ -18,8 +40,28 @@ pnpm add @deepseekharness-mobile/protocol
18
40
  import { ClientMessage, PROTOCOL_VERSION, ServerMessage } from '@deepseekharness-mobile/protocol';
19
41
 
20
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);
21
46
  ```
22
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
+
23
65
  ## License
24
66
 
25
67
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepseekharness-mobile/protocol",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Versioned wire contract shared by the DSH Mobile host plugin and PWA",
5
5
  "license": "MIT",
6
6
  "type": "module",