@krischoichoi/channel-web 0.6.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.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # @krischoichoi/channel-web
2
+
3
+ DeepSeek Harness Web client for the Channels dashboard: **Settings → 渠道**.
4
+
5
+ Host-side Cordis plugin plus a Web client surface. The host registers HTTP API
6
+ routes under `/dsh-channels/api/v1` and `/dsh-channels/api/v2`; the client
7
+ renders the channel setup panel (QR login, credentials form, status) inside the
8
+ Harness Web UI.
9
+
10
+ ## Install
11
+
12
+ The Web dashboard is part of the `@krischoichoi/dsh-channels` bundle:
13
+
14
+ ```bash
15
+ npx @deepseek-ai/dsh plugin --profile web add -w @krischoichoi/dsh-channels@latest
16
+ ```
17
+
18
+ To install it standalone:
19
+
20
+ ```bash
21
+ pnpm add @krischoichoi/channel-web
22
+ ```
23
+
24
+ ## What it does
25
+
26
+ | Surface | Responsibility |
27
+ | --- | --- |
28
+ | `src/host/routes.ts` | M1 read-only dashboard + adapter auth loop (`/dsh-channels/api/v1`) |
29
+ | `src/host/routes-v2.ts` | Control-plane API (`/dsh-channels/api/v2`) delegating to `ctx.channelControl` |
30
+ | `src/client/*` | React components for the 「设置 → 渠道」 dashboard |
31
+ | `src/protocol.ts` | Shared host/client protocol types |
32
+
33
+ Security notes:
34
+
35
+ - State-changing routes are loopback-only.
36
+ - Mutation bodies must be `application/json`.
37
+ - Secret values are never echoed; they are written through the credentials seam.
38
+
39
+ The plugin injects `webServer`, `channels`, and optionally `channelControl`.
40
+ When `channelControl` is absent, v2 routes return `503` so a standalone web
41
+ profile still boots.
42
+
43
+ ## Client build
44
+
45
+ The package declares a `dsh.client` block so the Harness Web runtime loads the
46
+ client surface from `@krischoichoi/channel-web/client`.
47
+
48
+ Against the Harness `0.1.5-rc.2` client module graph the contract is:
49
+
50
+ - `dsh.client.inject` lists client package dependency edges:
51
+ `@deepseek-ai/dsh-client-locale` provides the `locale` service and
52
+ `@deepseek-ai/dsh-client-ui-settings` owns the settings slot contract/runtime.
53
+ `dsh.client.external` is reserved for exact non-platform module requests;
54
+ this bundle has none.
55
+ `react`, `@deepseek-ai/cordis`, `@deepseek-ai/dsh-client-ui-primitives` and
56
+ `@deepseek-ai/dsh-client-ui-slots` are **static shell identities**
57
+ (`PLATFORM_MODULES` seeds compiled into the Vite shell) and must never
58
+ appear as dynamic graph rows.
59
+ - `lib/client.js` registers through `window.__ModuleLoader__.load({ id,
60
+ factory })` and keeps the static identities as `require()` externals
61
+ (inlining `ui-primitives` would pull in shiki/katex; inlining `react` would
62
+ duplicate the shell's React copy). Everything else (e.g. `qrcode`) is
63
+ bundled inline; `build.mjs` fails the build when the artifact requires an
64
+ undeclared external.
65
+ - Dependency layering: dynamic client dependency → `peerDependencies` +
66
+ `devDependencies`; static UI library (`ui-primitives`) and `react` →
67
+ `devDependencies` only.
68
+
69
+ ## Development
70
+
71
+ ```bash
72
+ pnpm --filter @krischoichoi/channel-web build
73
+ pnpm --filter @krischoichoi/channel-web typecheck
74
+ pnpm --filter @krischoichoi/channel-web test
75
+ ```
76
+
77
+ ## Related
78
+
79
+ - [Repository root](../../README.md)
80
+ - [Architecture design](../../docs/architecture.md)
81
+
82
+ ## License
83
+
84
+ [MIT](../../LICENSE)