dsh-connect 0.5.0 → 0.5.3

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 CHANGED
@@ -1,21 +1,197 @@
1
1
  # dsh-connect
2
2
 
3
- The **channel-agnostic core** for connecting [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (**DSH**) agents to chat platforms (Feishu / Lark and more): session binding, agent driving, streaming reply bridging, and local commands.
3
+ The **channel-agnostic core** for connecting [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (**DSH**) agents to chat platforms (Feishu / Lark first, more to come): session binding, agent driving, streaming reply bridging, interactive menu cards, and local commands.
4
4
 
5
- > Install together with a channel adapter, e.g. [dsh-connect-feishu](https://www.npmjs.com/package/dsh-connect-feishu).
5
+ > Install together with a channel adapter — e.g. [dsh-connect-feishu](https://www.npmjs.com/package/dsh-connect-feishu) — or the optional [dsh-connect-web](https://www.npmjs.com/package/dsh-connect-web) mirror monitor.
6
6
 
7
- ## Install
7
+ ## Overview
8
+
9
+ `dsh-connect` binds a chat conversation to a DSH agent session and drives it end to end:
10
+
11
+ - **Session binding & routing** — one chat ⇄ one agent session, persisted in a `bindings.json` route store; sessions can be created, resumed, switched, cleared and mirrored to the DSH Web GUI.
12
+ - **Streaming replies** — DSH `assistant/chunk` events are bridged into the channel's native streaming (Feishu typewriter cards): the thinking hint opens the reasoning phase, reasoning streams live with readable paragraph breaks, tool calls appear as `🔧` progress lines, and a liveness heartbeat keeps the card moving even through long silent stretches (long first-token waits, heavy tool runs) so it never sits frozen on "Thinking…".
13
+ - **Notification levels** — per-chat control over how much of the process is streamed: `尽量输出过程` (full process) / `输出重要节点` (key milestones) / `只输出结果` (result only). Switch any time via the settings menu or `/notify`; the choice is persisted per chat and applies immediately.
14
+ - **Task-end stats** — after every task a compact card reports the model used, input/output tokens, elapsed time and context-window usage, and suggests `/compact` when the context is getting full.
15
+ - **Interactive menus** — button cards for status, tasks, history, goals, schedule, model/effort switching, workspace picking, language, and more (see the in-chat `/` commands).
16
+ - **Media handling** — downloads user images/attachments, passes them to a vision-capable model (or a configured vision model) so text-only main models never stall on images.
17
+ - **Locking & queuing** — per-chat write locks coordinate Feishu and Web writers; queued messages drain when the lock releases.
18
+ - **Web mirror (auto)** — every Feishu conversation is automatically available in the DSH Web GUI as a mirrored session (disable with `autoMirror: false`).
19
+
20
+ **Who is it for?** Anyone running DSH who wants to operate agents from a chat platform — solo operators running a bot for their own workspaces, and small teams sharing a bot in group chats with an allowlist.
21
+
22
+ ## Compatibility
23
+
24
+ | Aspect | Value |
25
+ |---|---|
26
+ | DSH version | `^0.1.0-rc.6` (peer `@deepseek-ai/dsh-agent`, `dsh-llm`, `dsh-session`) |
27
+ | Cordis | `^4.0.1` |
28
+ | Node.js | ≥ 20 (ESM, `NodeNext`) |
29
+ | Last verified | **2026-08-16** against DSH `0.1.0-rc.6` on Windows (Feishu WebSocket transport) |
30
+
31
+ The plugin runs on the DSH **Host plane** (process-level singleton services), not inside an agent preset.
32
+
33
+ ## Install / Uninstall
34
+
35
+ Plugin management is a thin wrapper over pnpm in the DSH profile:
8
36
 
9
37
  ```sh
38
+ # Install (core + Feishu adapter)
10
39
  dsh plugin --profile web add dsh-connect dsh-connect-feishu
40
+
41
+ # Optional: Web mirror monitor
42
+ dsh plugin --profile web add dsh-connect-web
43
+ ```
44
+
45
+ **Upgrade**
46
+
47
+ ```sh
48
+ dsh plugin --profile web update dsh-connect dsh-connect-feishu
11
49
  ```
12
50
 
13
- ## Documentation
51
+ **Disable** — remove the entries from the profile patch so the plugins stop loading (see `~/.dsh/profiles/<profile>/cordis.patch.yml`):
52
+
53
+ ```yaml
54
+ - insert:
55
+ - id: connect # delete this block (and connect-feishu) to disable
56
+ name: dsh-connect
57
+ ```
58
+
59
+ **Complete removal** — uninstall the packages and delete the data they created:
60
+
61
+ ```sh
62
+ dsh plugin --profile web remove dsh-connect dsh-connect-feishu
63
+ # then remove the plugin data (see "Permissions & data" below):
64
+ rm -rf .dsh-connect # binding route store (stateDir)
65
+ rm -f ~/.dsh/.dsh-connect/feishu-credentials.json
66
+ ```
67
+
68
+ ## Quick start
69
+
70
+ 1. **Install the plugins** (see above).
71
+ 2. **Add the minimal config** to `~/.dsh/profiles/<profile>/cordis.patch.yml` (also see [`examples/profile-cordis.patch.yml`](../../examples/profile-cordis.patch.yml)):
72
+
73
+ ```yaml
74
+ - insert:
75
+ - id: connect
76
+ name: dsh-connect
77
+ # workDir: D:\your\workdir # agent working directory (default: process cwd)
78
+ - id: connect-feishu
79
+ name: dsh-connect-feishu
80
+ config:
81
+ appId: cli_xxxx
82
+ appSecret: cli_secret_xxxx
83
+ transport: websocket
84
+ requireMention: true
85
+ dmMode: open
86
+ ```
87
+
88
+ 3. **Start the host** — `dsh web` (or `dsh run`). With no credentials configured, `dsh-connect-feishu` enters **one-click onboarding**: scan the QR / open the link from the log to authorize the bot.
89
+ 4. **Send a message** to the bot in Feishu. The bot replies with a streaming card; `/help` lists all commands; the conversation also appears in the DSH Web GUI automatically (auto-mirror).
90
+
91
+ A fully reproducible example is the `examples/` folder plus `docs/feishu-setup.md` (Feishu app creation, event subscriptions, publishing).
92
+
93
+ ## Configuration
94
+
95
+ Configuration lives in the DSH profile patch (`cordis.patch.yml`) under each plugin's `config:`. `dsh.shared.config.json` in the project root (or its parent) can supply workspace/state defaults that take precedence for those keys.
96
+
97
+ ### `dsh-connect` (core)
98
+
99
+ | Key | Default | Description |
100
+ |---|---|---|
101
+ | `agentPreset` | roster default | Agent preset id composed into each bound session |
102
+ | `workDir` | process cwd | Absolute working directory for each bound agent |
103
+ | `workspaces` | `[]` | Extra workdirs offered by the `/dir` picker |
104
+ | `visionModel` | auto-detected | `{ provider, model }` used to describe images when the main model can't see them |
105
+ | `language` | `zh` | User-facing message language: `zh` / `en` |
106
+ | `allowUsers` | `[]` | Sender allowlist (open_id). Empty = allow all |
107
+ | `allowChats` | `[]` | Chat allowlist (chat_id). Empty = allow all |
108
+ | `stateDir` | `.dsh-connect` | Directory holding the `bindings.json` route store (env `DSH_CONNECT_STATE_DIR` overrides) |
109
+ | `autoMirror` | `true` | Automatically create a Web GUI mirror for every new session |
110
+ | `streamHeartbeatMs` | `60000` | Liveness heartbeat interval (ms) for the streaming card; `0` disables it |
111
+ | `notifyLevel` | `important` | Default notification level: `full` (stream everything) / `important` (key milestones) / `result` (answer only); per-chat override via settings menu or `/notify` |
112
+ | `progressTimeoutMs` | `300000` | Proactive progress-notice interval (ms): when a turn has sent no standalone card/text for this long, a status card reports the latest milestone; `0` disables; per-chat override via settings menu or `/progress` |
113
+
114
+ ### `dsh-connect-feishu` (adapter)
115
+
116
+ | Key | Default | Description |
117
+ |---|---|---|
118
+ | `appId` | env `FEISHU_APP_ID` | Feishu custom app id (**secret**) |
119
+ | `appSecret` | env `FEISHU_APP_SECRET` | Feishu custom app secret (**secret**) |
120
+ | `transport` | `websocket` | `websocket` = long connection (no public network); `webhook` needs public HTTPS |
121
+ | `verificationToken` | — | Webhook verification token (**secret**) |
122
+ | `encryptKey` | — | Webhook encrypt key (**secret**) |
123
+ | `requireMention` | `true` | Groups only respond when the bot is @mentioned |
124
+ | `dmMode` | `open` | DM policy: `open` / `allowlist` / `pair` / `disabled` |
125
+ | `language` | `zh` | User-facing message language: `zh` / `en` |
126
+
127
+ **Environment variables**
128
+
129
+ | Variable | Purpose |
130
+ |---|---|
131
+ | `FEISHU_APP_ID` / `FEISHU_APP_SECRET` | Feishu credentials — preferred over putting secrets in config files |
132
+ | `DSH_CONNECT_STATE_DIR` | Overrides `stateDir` for the binding store |
133
+ | `DSH_HOME` | Overrides the `~/.dsh` base for credential files |
134
+
135
+ **Sensitive items** — `appSecret`, `verificationToken`, `encryptKey`, and `feishu-credentials.json`. Prefer environment variables or one-click onboarding; keep them out of version control.
136
+
137
+ ## Permissions & data
138
+
139
+ - **Files written**
140
+ - `<stateDir>/bindings.json` (default `.dsh-connect/`) — the chat ⇄ session route store (chat keys, session ids, mirror and lock state).
141
+ - `~/.dsh/.dsh-connect/feishu-credentials.json` — Feishu credentials saved by one-click onboarding.
142
+ - `<workDir>/.dsh-connect-images/` — user images/attachments staged for the agent's tools.
143
+ - DSH's own session logs and settings under `~/.dsh/` (sessions, settings, etc.).
144
+ - **Network**
145
+ - Feishu Open Platform: WebSocket long connection (or webhook over public HTTPS), plus HTTPS API calls (media download, cards).
146
+ - LLM provider APIs used by DSH for the agent's model (e.g. DeepSeek), plus the optional vision model.
147
+ - **User data** — message text and attachments flow through the bot to the agent session; they are stored in the DSH session log like any DSH conversation. The allowlists (`allowUsers` / `allowChats`) limit who can drive the bot.
148
+
149
+ ## Troubleshooting
150
+
151
+ Logs come from the DSH host logger (run `dsh web` in a terminal); plugin messages are prefixed `connect:` / `connect-feishu:`.
152
+
153
+ | Symptom | Likely cause / fix |
154
+ |---|---|
155
+ | `connect-feishu: adapter init failed` / `start failed` | Bad credentials, app not published, or network blocked. Check `appId`/`appSecret`, re-run onboarding, verify the bot is online in the Feishu console. |
156
+ | `connect: resume of <id> failed, creating fresh session` | The persisted session could not be resumed (missing workdir, persistence issue). Check `workDir` and `~/.dsh/sessions`. |
157
+ | Session-locked notices | Another client (Feishu or Web) holds the write lock. Use `/unlock` or wait for the lock timeout. |
158
+ | Model switch in the Web GUI appears ignored | Fixed in the current main: the plugin no longer pins a static default model over the Web GUI's session selection. Restart `dsh web` so the rebuilt plugin is loaded. |
159
+ | `[用户发送了图片,但下载失败…]` | Feishu `im:resource` permission is missing on the app; grant it and re-approve. |
160
+ | Streaming reply is one unbroken blob | Fixed in the current main: block boundaries and the reasoning/answer split now insert blank lines (and reasoning soft breaks are expanded for Feishu cards). Restart `dsh web`. |
161
+ | Card frozen on "Thinking…" with no progress on a long task | Fixed in the current main: reasoning now streams live, tool calls show as `🔧` progress lines, and a liveness heartbeat updates the card during silent stretches. Restart `dsh web`. |
162
+ | Menu cards don't update / expire | Cards auto-close after 60 s idle by design; re-open the menu. |
163
+
164
+ **Rollback** — reinstall a previous release (`dsh plugin --profile web add dsh-connect@<version>` after removing the current one), or `git checkout` the pinned commit in a source install.
165
+
166
+ ## Development
167
+
168
+ This is a pnpm workspace; the plugins are independent npm packages under `packages/`:
169
+
170
+ ```
171
+ packages/
172
+ connect/ # this package — channel-agnostic core
173
+ connect-feishu/ # Feishu / Lark adapter
174
+ connect-web/ # optional Web mirror monitor
175
+ ```
176
+
177
+ ```sh
178
+ pnpm install
179
+
180
+ # build & typecheck one package
181
+ pnpm --filter dsh-connect build
182
+ pnpm --filter dsh-connect typecheck
183
+
184
+ # unit tests (node:test)
185
+ pnpm test
186
+ # or run one suite
187
+ node packages/connect/test/unit.test.mjs
188
+ ```
14
189
 
15
- For features, the command list, configuration options, and channel setup steps, see the GitHub repository:
190
+ **Structure** — `src/runner.ts` owns the per-chat agent driver and the streaming bridge (`applyStreamChunk` is the pure, unit-tested chunk assembler); `src/service.ts` owns the adapter registry and routing; `src/i18n.ts` holds the `zh`/`en` dictionaries (keep keys in sync across both); `src/binding.ts` is the route store.
16
191
 
17
- https://github.com/IvanWu2015/dsh-connect
192
+ **Contributing** — PRs welcome at [github.com/IvanWu2015/dsh-connect](https://github.com/IvanWu2015/dsh-connect). For user-facing strings, add the key to both `zh` and `en` in `src/i18n.ts`. Release notes live in `CHANGELOG.md`; see `docs/PUBLISHING.md` for the release flow.
18
193
 
19
- ## License
194
+ ## License & security
20
195
 
21
- MIT
196
+ - **License:** MIT (see `LICENSE`).
197
+ - **Security:** report vulnerabilities **privately** — use the GitHub security advisory flow on the repository, or contact the maintainer via the email listed on the GitHub profile. Please do not open public issues for credential exposure. Treat `appSecret` / `verificationToken` / `encryptKey` / `feishu-credentials.json` as secrets: prefer environment variables, and never commit them.
package/lib/binding.d.ts CHANGED
@@ -16,13 +16,66 @@ export interface ChatBinding {
16
16
  ownerKey: string;
17
17
  createdAt: number;
18
18
  lastActiveAt: number;
19
+ /** Per-chat UI language override (`zh` / `en`); falls back to the plugin config. */
20
+ language?: "zh" | "en";
21
+ /** Per-chat notification level for streaming replies; falls back to the plugin config. */
22
+ notifyLevel?: "full" | "important" | "result";
23
+ /** Per-chat proactive progress-notice interval ms (0 disables); falls back to the plugin config. */
24
+ progressTimeoutMs?: number;
25
+ /** Timestamp when the first-time welcome card was sent (undefined = not yet welcomed). */
26
+ welcomedAt?: number;
27
+ /** Web mirror session id (shared with DSH Web for viewing). */
28
+ webMirrorSessionId?: string;
29
+ /** Session lock status: which channel currently owns write access. */
30
+ lockOwner?: "feishu" | "web";
31
+ /** Timestamp when the lock was acquired (for timeout detection). */
32
+ lockAcquiredAt?: number;
33
+ /** Lock timeout in milliseconds (default 5 minutes). */
34
+ lockTimeoutMs?: number;
35
+ /** Queued messages waiting for lock release (Web → Feishu bridge). */
36
+ queuedMessages?: Array<{
37
+ text: string;
38
+ senderKey: string;
39
+ timestamp: number;
40
+ replyRef?: string;
41
+ images?: readonly string[];
42
+ files?: readonly string[];
43
+ }>;
19
44
  /** Every conversation ever opened in this chat, oldest last. */
20
45
  sessions: ChatSessionRecord[];
21
46
  }
47
+ /** Callback type for binding change events. */
48
+ export type BindingChangeCallback = (binding: ChatBinding, changeType: "add" | "update" | "delete") => void;
22
49
  export declare class BindingStore {
23
50
  private readonly map;
24
51
  private readonly file;
52
+ private readonly changeListeners;
25
53
  constructor(stateDir?: string);
54
+ /**
55
+ * Register a listener for binding changes.
56
+ * @param callback - Function called when any binding is added, updated, or deleted
57
+ * @returns Unsubscribe function
58
+ */
59
+ onChange(callback: BindingChangeCallback): () => void;
60
+ /**
61
+ * Emit a change event to all registered listeners.
62
+ */
63
+ private emitChange;
64
+ /**
65
+ * Iterate over all bindings in the store.
66
+ * @returns Iterator of all ChatBinding entries
67
+ */
68
+ entries(): IterableIterator<ChatBinding>;
69
+ /**
70
+ * Get all bindings as an array.
71
+ */
72
+ list(): ChatBinding[];
73
+ /**
74
+ * Find bindings by webMirrorSessionId.
75
+ * @param sessionId - The session ID to search for
76
+ * @returns Array of bindings that have this sessionId as their webMirrorSessionId
77
+ */
78
+ findByWebMirror(sessionId: string): ChatBinding[];
26
79
  get(channel: string, chatKey: string): ChatBinding | undefined;
27
80
  put(binding: ChatBinding): void;
28
81
  delete(channel: string, chatKey: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAUA,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,GAAG,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AA0BD,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkC;IACtD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;gBAElB,QAAQ,CAAC,EAAE,MAAM;IAM7B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI9D,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAK/B,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAK9C,OAAO,CAAC,IAAI;IAyBZ,OAAO,CAAC,IAAI;CAQb"}
1
+ {"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AA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CAAC;IACH,gEAAgE;IAChE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AA0BD,+CAA+C;AAC/C,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAAC;AAE5G,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkC;IACtD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoC;gBAExD,QAAQ,CAAC,EAAE,MAAM;IAM7B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,IAAI;IAOrD;;OAEG;IACH,OAAO,CAAC,UAAU;IAUlB;;;OAGG;IACH,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC;IAIxC;;OAEG;IACH,IAAI,IAAI,WAAW,EAAE;IAIrB;;;;OAIG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE;IAUjD,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI9D,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAQ/B,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAU9C,OAAO,CAAC,IAAI;IAoCZ,OAAO,CAAC,IAAI;CAQb"}
package/lib/binding.js CHANGED
@@ -33,21 +33,81 @@ function normalizeSessions(value) {
33
33
  export class BindingStore {
34
34
  map = new Map();
35
35
  file;
36
+ changeListeners = new Set();
36
37
  constructor(stateDir) {
37
38
  const dir = stateDir ?? process.env.DSH_CONNECT_STATE_DIR ?? ".dsh-connect";
38
39
  this.file = resolve(dir, "bindings.json");
39
40
  this.load();
40
41
  }
42
+ /**
43
+ * Register a listener for binding changes.
44
+ * @param callback - Function called when any binding is added, updated, or deleted
45
+ * @returns Unsubscribe function
46
+ */
47
+ onChange(callback) {
48
+ this.changeListeners.add(callback);
49
+ return () => {
50
+ this.changeListeners.delete(callback);
51
+ };
52
+ }
53
+ /**
54
+ * Emit a change event to all registered listeners.
55
+ */
56
+ emitChange(binding, changeType) {
57
+ for (const listener of this.changeListeners) {
58
+ try {
59
+ listener(binding, changeType);
60
+ }
61
+ catch {
62
+ // Listener errors should not break the store
63
+ }
64
+ }
65
+ }
66
+ /**
67
+ * Iterate over all bindings in the store.
68
+ * @returns Iterator of all ChatBinding entries
69
+ */
70
+ entries() {
71
+ return this.map.values();
72
+ }
73
+ /**
74
+ * Get all bindings as an array.
75
+ */
76
+ list() {
77
+ return [...this.map.values()];
78
+ }
79
+ /**
80
+ * Find bindings by webMirrorSessionId.
81
+ * @param sessionId - The session ID to search for
82
+ * @returns Array of bindings that have this sessionId as their webMirrorSessionId
83
+ */
84
+ findByWebMirror(sessionId) {
85
+ const results = [];
86
+ for (const binding of this.map.values()) {
87
+ if (binding.webMirrorSessionId === sessionId) {
88
+ results.push(binding);
89
+ }
90
+ }
91
+ return results;
92
+ }
41
93
  get(channel, chatKey) {
42
94
  return this.map.get(keyOf(channel, chatKey));
43
95
  }
44
96
  put(binding) {
45
- this.map.set(keyOf(binding.channel, binding.chatKey), binding);
97
+ const key = keyOf(binding.channel, binding.chatKey);
98
+ const existed = this.map.has(key);
99
+ this.map.set(key, binding);
46
100
  this.save();
101
+ this.emitChange(binding, existed ? "update" : "add");
47
102
  }
48
103
  delete(channel, chatKey) {
49
- this.map.delete(keyOf(channel, chatKey));
50
- this.save();
104
+ const key = keyOf(channel, chatKey);
105
+ const binding = this.map.get(key);
106
+ if (binding !== undefined) {
107
+ this.map.delete(key);
108
+ this.save();
109
+ this.emitChange(binding, "delete");
110
+ }
51
111
  }
52
112
  load() {
53
113
  try {
@@ -69,6 +129,15 @@ export class BindingStore {
69
129
  ownerKey: typeof b.ownerKey === "string" ? b.ownerKey : "",
70
130
  createdAt: typeof b.createdAt === "number" ? b.createdAt : Date.now(),
71
131
  lastActiveAt: typeof b.lastActiveAt === "number" ? b.lastActiveAt : Date.now(),
132
+ ...(b.language === "zh" || b.language === "en" ? { language: b.language } : {}),
133
+ ...(b.notifyLevel === "full" || b.notifyLevel === "important" || b.notifyLevel === "result" ? { notifyLevel: b.notifyLevel } : {}),
134
+ ...(typeof b.progressTimeoutMs === "number" && b.progressTimeoutMs >= 0 ? { progressTimeoutMs: b.progressTimeoutMs } : {}),
135
+ ...(typeof b.welcomedAt === "number" ? { welcomedAt: b.welcomedAt } : {}),
136
+ ...(typeof b.webMirrorSessionId === "string" ? { webMirrorSessionId: b.webMirrorSessionId } : {}),
137
+ ...(b.lockOwner === "feishu" || b.lockOwner === "web" ? { lockOwner: b.lockOwner } : {}),
138
+ ...(typeof b.lockAcquiredAt === "number" ? { lockAcquiredAt: b.lockAcquiredAt } : {}),
139
+ ...(typeof b.lockTimeoutMs === "number" ? { lockTimeoutMs: b.lockTimeoutMs } : {}),
140
+ ...(Array.isArray(b.queuedMessages) ? { queuedMessages: b.queuedMessages.filter((m) => typeof m === "object" && m !== null && typeof m.text === "string" && typeof m.senderKey === "string") } : {}),
72
141
  sessions: normalizeSessions(b.sessions),
73
142
  });
74
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"binding.js","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyB7C,SAAS,KAAK,CAAC,OAAe,EAAE,OAAe;IAC7C,OAAO,GAAG,OAAO,SAAS,OAAO,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACr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G,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAA+D,EAAE,CACjJ,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,OAAQ,CAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAQ,CAAS,CAAC,SAAS,KAAK,QAAQ,CACvH,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBACT,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC;iBACxC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,wCAAwC;QAC1C,CAAC;IACH,CAAC;IAEO,IAAI;QACV,IAAI,CAAC;YACH,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACnD,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACpF,CAAC;QAAC,MAAM,CAAC;YACP,kEAAkE;QACpE,CAAC;IACH,CAAC;CACF"}
package/lib/commands.d.ts CHANGED
@@ -39,8 +39,22 @@ export type Command = {
39
39
  readonly kind: "schedule";
40
40
  } | {
41
41
  readonly kind: "model";
42
+ } | {
43
+ readonly kind: "notify";
44
+ } | {
45
+ readonly kind: "progress";
42
46
  } | {
43
47
  readonly kind: "workspaces";
48
+ } | {
49
+ readonly kind: "mirror";
50
+ readonly timeoutMin?: number;
51
+ } | {
52
+ readonly kind: "unlock";
53
+ } | {
54
+ readonly kind: "renew";
55
+ } | {
56
+ readonly kind: "export";
57
+ readonly format?: "markdown" | "pdf";
44
58
  } | {
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
  return { kind: "model" };
55
+ case "/notify":
56
+ case "/notice":
57
+ return { kind: "notify" };
58
+ case "/progress":
59
+ case "/remind-interval":
60
+ return { kind: "progress" };
55
61
  case "/workspaces":
56
62
  case "/wslist":
57
63
  return { kind: "workspaces" };
64
+ case "/mirror":
65
+ case "/web": {
66
+ // Parse optional --timeout N parameter
67
+ if (arg !== undefined && arg !== "") {
68
+ const timeoutMatch = arg.match(/--timeout\s+(\d+)/);
69
+ if (timeoutMatch) {
70
+ const timeoutMin = parseInt(timeoutMatch[1], 10);
71
+ return { kind: "mirror", timeoutMin };
72
+ }
73
+ }
74
+ return { kind: "mirror" };
75
+ }
76
+ case "/unlock":
77
+ case "/release":
78
+ return { kind: "unlock" };
79
+ case "/renew":
80
+ case "/renew-lock":
81
+ return { kind: "renew" };
82
+ case "/export": {
83
+ // Parse optional format parameter: /export markdown or /export pdf
84
+ if (arg === "markdown" || arg === "md") {
85
+ return { kind: "export", format: "markdown" };
86
+ }
87
+ else if (arg === "pdf") {
88
+ return { kind: "export", format: "pdf" };
89
+ }
90
+ return { kind: "export" };
91
+ }
58
92
  case "/help":
59
93
  case "/start":
60
94
  return { kind: "help" };
@@ -78,7 +112,13 @@ export function helpText(t) {
78
112
  "- `/goals` " + t.helpGoals,
79
113
  "- `/schedule` " + t.helpSchedule,
80
114
  "- `/model` " + t.helpModel,
115
+ "- `/notify` " + t.helpNotify,
116
+ "- `/progress` " + t.helpProgress,
81
117
  "- `/workspaces` " + t.helpWorkspaces,
118
+ "- `/mirror [--timeout N]` create Web mirror session (optional timeout in minutes)",
119
+ "- `/unlock` manually release session lock",
120
+ "- `/renew` renew current session lock timeout",
121
+ "- `/export [markdown|pdf]` export conversation history",
82
122
  "- `/new` " + t.helpNew,
83
123
  "- `/clear` " + t.helpClear,
84
124
  "- `/stop` " + t.helpStop,
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AA4BA,MAAM,UAAU,YAA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CAAW;IAClC,OAAO;QACL,CAAC,CAAC,UAAU;QACZ,YAAY,GAAG,CAAC,CAAC,QAAQ;QACzB,uBAAuB,GAAG,CAAC,CAAC,YAAY;QACxC,cAAc,GAAG,CAAC,CAAC,UAAU;QAC7B,YAAY,GAAG,CAAC,CAAC,QAAQ;QACzB,uBAAuB,GAAG,CAAC,CAAC,QAAQ;QACpC,WAAW,GAAG,CAAC,CAAC,OAAO;QACvB,iCAAiC,GAAG,CAAC,CAAC,aAAa;QACnD,eAAe,GAAG,CAAC,CAAC,WAAW;QAC/B,eAAe,GAAG,CAAC,CAAC,WAAW;QAC/B,uBAAuB,GAAG,CAAC,CAAC,WAAW;QACvC,aAAa,GAAG,CAAC,CAAC,SAAS;QAC3B,gBAAgB,GAAG,CAAC,CAAC,YAAY;QACjC,aAAa,GAAG,CAAC,CAAC,SAAS;QAC3B,cAAc,GAAG,CAAC,CAAC,UAAU;QAC7B,gBAAgB,GAAG,CAAC,CAAC,YAAY;QACjC,kBAAkB,GAAG,CAAC,CAAC,cAAc;QACrC,mFAAmF;QACnF,2CAA2C;QAC3C,+CAA+C;QAC/C,wDAAwD;QACxD,WAAW,GAAG,CAAC,CAAC,OAAO;QACvB,aAAa,GAAG,CAAC,CAAC,SAAS;QAC3B,YAAY,GAAG,CAAC,CAAC,QAAQ;QACzB,IAAI,GAAG,CAAC,CAAC,SAAS;KACnB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
package/lib/i18n.d.ts CHANGED
@@ -28,12 +28,71 @@ export interface Messages {
28
28
  rootSectionSystem: string;
29
29
  rootMenuFooter: string;
30
30
  thinkingHint: string;
31
+ toolCalling(name: string, summary: string | undefined): string;
32
+ processingHeartbeat(minutes: number): string;
31
33
  processingFailed(detail: string): string;
34
+ processingStarted(preview: string): string;
35
+ progressReminder(minutes: number, status: string): string;
36
+ progressThinking: string;
37
+ progressMenuTitle: string;
38
+ progressOff: string;
39
+ progressMinutes(n: number): string;
40
+ progressSet(label: string): string;
41
+ progressSetting(label: string): string;
42
+ menuSettingsProgress: string;
43
+ helpProgress: string;
44
+ compactStarted: string;
45
+ compactDone: string;
46
+ questionCardTitle: string;
47
+ questionCardHint: string;
48
+ questionMultiHint: string;
49
+ questionStep(index: number, total: number): string;
50
+ questionTextHint(question: string): string;
51
+ questionWaiting(question: string): string;
52
+ approvalCardTitle: string;
53
+ approvalAsk(toolName: string, reason: string | undefined): string;
54
+ approveLabel: string;
55
+ rejectLabel: string;
56
+ answerReceived: string;
57
+ questionToolCall(text: string): string;
58
+ welcomeTitle: string;
59
+ welcomeBody(workdir: string): string;
60
+ errorAdvicePermission: string;
61
+ errorAdviceNetwork: string;
62
+ errorAdviceModel: string;
63
+ errorAdviceGeneric: string;
64
+ processingFailedAdvice(detail: string, advice: string): string;
65
+ confirmTitle: string;
66
+ confirmYes: string;
67
+ confirmNo: string;
68
+ confirmClearText: string;
69
+ confirmNewText: string;
70
+ actionCancelled: string;
71
+ toolStepLabel(n: number, name: string): string;
72
+ queuedHint(n: number): string;
73
+ notifyFull: string;
74
+ notifyImportant: string;
75
+ notifyResult: string;
76
+ notifyFullDesc: string;
77
+ notifyImportantDesc: string;
78
+ notifyResultDesc: string;
79
+ notifySet(level: string, description: string): string;
80
+ taskStatsHeader(duration: string): string;
81
+ taskStatsModel(providerModel: string): string;
82
+ taskStatsTokensIn(tokens: string, cached: string | undefined): string;
83
+ taskStatsTokensOut(tokens: string): string;
84
+ taskStatsSteps(count: number): string;
85
+ taskStatsContext(usedPct: string, window: string): string;
86
+ taskStatsCompactOk: string;
87
+ taskStatsCompactSuggest: string;
88
+ taskDuration(ms: number): string;
32
89
  imageDownloadFailed(imageError: string): string;
90
+ fileDownloadFailed(fileError: string): string;
33
91
  imagesStaged(locations: string, description: string): string;
34
92
  imageDescriptionLabel(description: string): string;
35
93
  imageNoDescription: string;
36
94
  visionPrompt: string;
95
+ filesStaged(count: number, locations: string): string;
37
96
  taskEnded(reasonLabel: string): string;
38
97
  errorCode(code: string): string;
39
98
  reasonMessage(message: string): string;
@@ -65,15 +124,26 @@ export interface Messages {
65
124
  menuSettingsReasoning: string;
66
125
  menuSettingsNotify: string;
67
126
  menuSettingsOverview: string;
127
+ menuSettingsLanguage: string;
128
+ languageZh: string;
129
+ languageEn: string;
130
+ languageSet(lang: string): string;
68
131
  streamLabel(on: boolean): string;
69
132
  summaryLabel(on: boolean): string;
70
133
  statusNoSession(workdir: string): string;
71
134
  statusRunning: string;
72
135
  statusIdle: string;
136
+ statusExecuting: string;
137
+ statusWaiting: string;
73
138
  statusField(status: string): string;
74
139
  modelField(model: string): string;
75
140
  workdirField(workdir: string): string;
76
141
  queuedField(n: number): string;
142
+ queueEmpty: string;
143
+ queueDetail(n: number): string;
144
+ lastTurnReason(reason: string): string;
145
+ lastTurnTime(time: string): string;
146
+ noTurnHistory: string;
77
147
  sessionField(id: string): string;
78
148
  contextField(total: number, surface: number): string;
79
149
  noTodos: string;
@@ -134,6 +204,25 @@ export interface Messages {
134
204
  workspaceSessions(n: number): string;
135
205
  workspacesCount(n: number, list: string): string;
136
206
  currentDir: string;
207
+ mirrorCreated(sessionId: string): string;
208
+ mirrorAlreadyExists(sessionId: string): string;
209
+ mirrorNotConfigured: string;
210
+ sessionLockedBy(channel: string): string;
211
+ sessionReadOnly: string;
212
+ lockReleased: string;
213
+ lockTimeoutReleased(minutes: number): string;
214
+ unlockSuccess: string;
215
+ unlockNoLock: string;
216
+ lockRenewed(minutes: number): string;
217
+ messageQueued(position: number): string;
218
+ queueProcessed(count: number): string;
219
+ exportMarkdown(path: string): string;
220
+ exportPdfNotSupported: string;
221
+ exportNoSession: string;
222
+ exportFailed(error: string): string;
223
+ mirrorStatus(sessionId: string, lockedBy?: string, timeoutMin?: number, queuedCount?: number): string;
224
+ webMirrorIndicator: string;
225
+ sessionAvailableOnWeb: string;
137
226
  helpHeader: string;
138
227
  helpMenu: string;
139
228
  helpSettings: string;
@@ -148,6 +237,7 @@ export interface Messages {
148
237
  helpGoals: string;
149
238
  helpSchedule: string;
150
239
  helpModel: string;
240
+ helpNotify: string;
151
241
  helpWorkspaces: string;
152
242
  helpNew: string;
153
243
  helpClear: string;