lark-remote 0.2.0 → 0.2.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/CHANGELOG.md +11 -3
- package/README.en.md +5 -5
- package/README.md +5 -5
- package/dist/bridge/index.js +1 -1
- package/dist/connector/index.js +0 -1
- package/dist/index.js +1 -1
- package/dist/router/index.js +1 -1
- package/dist/session/claude/sessions.js +1 -1
- package/dist/session/dsh/sessions.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.1] - 2026-09-11
|
|
9
|
+
|
|
10
|
+
### 新增
|
|
11
|
+
|
|
12
|
+
- **Windows 正式支持**:原生 Windows 支持已在真机完成验证,README / getting-started 的平台前置条件从「macOS / Linux,暂不支持 Windows」更新为 macOS / Linux / Windows 10+
|
|
13
|
+
|
|
14
|
+
### 变更
|
|
15
|
+
|
|
16
|
+
- **安全文档措辞更新**:README 安全警告与 `SECURITY.md` 反映 Claude 审批模式——`permissionMode` 可配置(默认 `bypassPermissions`,配置为其他值即启用飞书卡片交互式审批),不再表述为「固定 bypassPermissions」;审批卡片描述从 Codex 专属改为 Claude / Codex / Kimi 通用
|
|
17
|
+
|
|
8
18
|
## [0.2.0] - 2026-09-11
|
|
9
19
|
|
|
10
20
|
### 新增
|
|
@@ -62,7 +72,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
62
72
|
### 变更
|
|
63
73
|
|
|
64
74
|
- kimi ACP 能力声明:`fs` 保持关闭(走本地磁盘兜底,避免未实现的 `fs/*` RPC 报 `METHOD_NOT_FOUND`),`terminal` 打开
|
|
65
|
-
- 文档清理:移除设计文档中对内部文档名(`lessons-redlines`)与本地仓库路径(`/Users/.../lark-remote`)的引用
|
|
66
75
|
|
|
67
76
|
## [0.1.10] - 2026-08-22
|
|
68
77
|
|
|
@@ -212,7 +221,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
212
221
|
- `displayTitle`/`summary` 跳过 task-notification 注入
|
|
213
222
|
- 修复 `scanClaudeSessions` 对迁移到其他目录的会话的遗漏(S2)
|
|
214
223
|
- 修复 probe 生命周期、工厂回退、卡片回调等评审发现的问题(F1-F8)
|
|
215
|
-
- 清理引用已删除文档(lessons-redlines、resume-card-budget-failure-analysis)导致的失效链接
|
|
216
224
|
|
|
217
225
|
### 变更
|
|
218
226
|
|
|
@@ -221,7 +229,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
221
229
|
- 移除 `pnpm-lock.yaml`,统一使用 `bun.lock` 管理依赖
|
|
222
230
|
- 新增 husky lint-staged pre-commit / pre-push 钩子(提交前 lint + typecheck)
|
|
223
231
|
- 启用 npm provenance(构建产物可溯源)
|
|
224
|
-
- 移除 watchdog 相关用户文档及 `open-source-playbook` 等临时文档
|
|
225
232
|
|
|
226
233
|
### 测试
|
|
227
234
|
|
|
@@ -300,3 +307,4 @@ Initial release.
|
|
|
300
307
|
[0.1.6]: https://github.com/bungabungawoda/lark-remote/releases/tag/v0.1.6
|
|
301
308
|
[0.1.7]: https://github.com/bungabungawoda/lark-remote/releases/tag/v0.1.7
|
|
302
309
|
[0.1.8]: https://github.com/bungabungawoda/lark-remote/releases/tag/v0.1.8
|
|
310
|
+
[0.2.1]: https://github.com/bungabungawoda/lark-remote/releases/tag/v0.2.1
|
package/README.en.md
CHANGED
|
@@ -16,20 +16,20 @@ Designed for a single-user, peer-to-peer private chat. The agent's system prompt
|
|
|
16
16
|
|
|
17
17
|
## ⚠️ Security Warning (read first)
|
|
18
18
|
|
|
19
|
-
This tool turns Feishu messages directly into local agent executions. Claude
|
|
19
|
+
This tool turns Feishu messages directly into local agent executions. **Out of the box, agents run without approval prompts**: Claude defaults to `bypassPermissions` (no approval card), but that permission mode is **configurable** — set it to anything other than `bypassPermissions` (`default` / `acceptEdits` / `auto` / `dontAsk` / `plan`) to enable interactive approval, where high-risk actions wait for your confirmation on the Feishu card. Codex uses the **app-server approval mode** (default `approvalPolicy=on-request` — command execution requires your confirmation on the Feishu card, sandbox defaults to `workspace-write`); Kimi defaults to `manual` (per-action approval); other agents run with their CLI defaults. **In any mode**, agents can read and write the local directories you specify. You MUST:
|
|
20
20
|
|
|
21
21
|
- **Use it only in your own private (p2p) chat.** Never add the bot to any group chat; never let anyone else talk to it.
|
|
22
22
|
- Restrict the app's visibility to **yourself only** in the Feishu Open Platform.
|
|
23
23
|
- Don't run it on a machine holding data you can't afford to lose; prefer a dedicated user / machine / container.
|
|
24
24
|
- Keep credentials such as `appSecret` in your local `config.yaml` only — **never commit them anywhere**.
|
|
25
25
|
|
|
26
|
-
In
|
|
26
|
+
In approval mode (Claude, Codex, Kimi), an approval card arrives before a command runs — approve or reject it right in Feishu:
|
|
27
27
|
|
|
28
|
-

|
|
29
29
|
|
|
30
30
|
## Prerequisites
|
|
31
31
|
|
|
32
|
-
- OS: macOS / Linux
|
|
32
|
+
- OS: macOS / Linux / Windows 10+ (native Windows support is verified on real hardware, with behavior matching macOS/Linux)
|
|
33
33
|
- Node.js 20+ ([Bun](https://bun.sh/) for development)
|
|
34
34
|
- A Feishu custom app (either way): scan-to-create (a QR code pops up in the terminal on first launch; scan it with the Feishu app to create the app and write credentials automatically); or create one manually in the Open Platform — enable bot capability, subscribe to `im.message.receive_v1` and `card.action.trigger` via **long connection** (WebSocket, no public address needed), with at least the `im:message` scope.
|
|
35
35
|
- Claude Code CLI installed locally and logged in once in a terminal (`claude` → browser OAuth). Same idea for other agents (codex / opencode / pi / kimi): install the corresponding CLI first. DSH connects to a local DSH Web Host via HTTP+WebSocket (no local subprocess), default address `http://127.0.0.1:3080`.
|
|
@@ -70,7 +70,7 @@ defaultAgent: claude
|
|
|
70
70
|
claude:
|
|
71
71
|
model: claude-opus-4-8
|
|
72
72
|
effort: medium # low | medium | high | xhigh | max
|
|
73
|
-
#
|
|
73
|
+
permissionMode: bypassPermissions # Claude official --permission-mode: default | acceptEdits | auto | bypassPermissions | manual | dontAsk | plan (switchable via /config card; anything other than bypassPermissions enables approval)
|
|
74
74
|
stopGraceMs: 5000
|
|
75
75
|
|
|
76
76
|
logging:
|
package/README.md
CHANGED
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
|
|
17
17
|
## ⚠️ 安全警告(必读)
|
|
18
18
|
|
|
19
|
-
本工具会把飞书消息直接转为本地 agent
|
|
19
|
+
本工具会把飞书消息直接转为本地 agent 执行。**开箱默认是不弹审批的**:Claude 默认以 `bypassPermissions` 运行(无审批卡),但该权限模式**可配置**——把它改成 `bypassPermissions` 以外的值(`default` / `acceptEdits` / `auto` / `dontAsk` / `plan`)即启用交互式审批,高风险操作会在飞书卡片上等你确认;Codex 采用 **app-server 审批模式**(默认 `approvalPolicy=on-request`,执行命令需在飞书卡片上确认,沙箱默认 `workspace-write`);Kimi 默认 `manual`(逐条审批);其他 agent 以各自 CLI 的默认权限运行。**无论哪种模式**,agent 都能读写你指定的本地目录,请务必:
|
|
20
20
|
|
|
21
21
|
- **仅限你自己的私聊(p2p)使用**。不要把机器人拉进任何群聊,不要让任何其他人能与它对话。
|
|
22
22
|
- 在飞书开放平台把应用可见范围限制到**只有你自己**。
|
|
23
23
|
- 运行本工具的机器上不要存放与损失承受力不符的数据;建议在独立用户/机器/容器里运行。
|
|
24
24
|
- `appSecret` 等凭据只在本地 `config.yaml`,**不要提交到任何仓库**。
|
|
25
25
|
|
|
26
|
-
Codex
|
|
26
|
+
审批模式下(Claude、Codex、Kimi),执行命令前会收到审批卡片,可直接在飞书里允许或拒绝:
|
|
27
27
|
|
|
28
|
-

|
|
29
29
|
|
|
30
30
|
## 前置条件
|
|
31
31
|
|
|
32
|
-
- 操作系统:macOS / Linux
|
|
32
|
+
- 操作系统:macOS / Linux / Windows 10+(原生 Windows 支持已完成真机验证,行为与 macOS/Linux 对齐)
|
|
33
33
|
- Node.js 20+(开发时用 [Bun](https://bun.sh/))
|
|
34
34
|
- 飞书自建应用(二选一):扫码创建(首次启动终端弹二维码,飞书 App 扫码即自动创建并写入凭据);或手动在开放平台建应用——开启机器人能力,订阅 `im.message.receive_v1` 和 `card.action.trigger`,订阅方式选「长连接」(WebSocket,无需公网地址),权限至少 `im:message`。
|
|
35
35
|
- Claude Code CLI:本地安装并在终端完成一次登录(`claude` → 浏览器 OAuth)。使用其他 agent(codex / opencode / pi / kimi)同理,先装好对应 CLI;DSH 需本地 DSH Web Host 在跑(默认 `http://127.0.0.1:3080`),lark-remote 通过 HTTP+WebSocket 直连、不 spawn 本地子进程。
|
|
@@ -70,7 +70,7 @@ defaultAgent: claude
|
|
|
70
70
|
claude:
|
|
71
71
|
model: claude-opus-4-8
|
|
72
72
|
effort: medium # low | medium | high | xhigh | max
|
|
73
|
-
#
|
|
73
|
+
permissionMode: bypassPermissions # Claude 官方 --permission-mode:default | acceptEdits | auto | bypassPermissions | manual | dontAsk | plan(`/config` 卡片可切换;非 bypassPermissions 会启用审批)
|
|
74
74
|
stopGraceMs: 5000
|
|
75
75
|
|
|
76
76
|
logging:
|
package/dist/bridge/index.js
CHANGED
|
@@ -699,7 +699,7 @@ export class Bridge {
|
|
|
699
699
|
const workspaces = this.workspaceStore.list();
|
|
700
700
|
if (workspaces.length > 0) {
|
|
701
701
|
// NOTE: fallback uses insertion order, not sort preference — by design
|
|
702
|
-
// (
|
|
702
|
+
// (cwd fallback stays insertion-order for now)
|
|
703
703
|
cwd = workspaces[0].path;
|
|
704
704
|
getLogger().info(`[bridge] resolveCwd fallback cwd=${cwd} (first saved workspace)`);
|
|
705
705
|
}
|
package/dist/connector/index.js
CHANGED
|
@@ -130,7 +130,6 @@ export class FeishuConnector {
|
|
|
130
130
|
// 返回时,lark SDK 正常 resolve、@larksuite/channel 的 patchCard 丢弃返回值,
|
|
131
131
|
// 导致终态卡 patch 被业务层拒绝时全链路无日志无兜底。这里只观测不改行为——
|
|
132
132
|
// 不 throw、不重试,返回值原样透传。
|
|
133
|
-
// 详见 .adversarial-tdd/prompt-patchcard-business-code-observability.md
|
|
134
133
|
// Guard: unit-test mocks may omit rawClient; skip probe installation in that case.
|
|
135
134
|
const messageService = tryGetPatchService(this.channel);
|
|
136
135
|
if (messageService?.patch) {
|
package/dist/index.js
CHANGED
|
@@ -438,7 +438,7 @@ function setupMessageHandlers(connector, router, bridge, sessionStore, workspace
|
|
|
438
438
|
const workspaces = workspaceStore.list();
|
|
439
439
|
if (workspaces.length > 0) {
|
|
440
440
|
// NOTE: fallback uses insertion order, not sort preference — by design
|
|
441
|
-
// (
|
|
441
|
+
// (cwd fallback stays insertion-order for now)
|
|
442
442
|
workspace = workspaces[0].path;
|
|
443
443
|
}
|
|
444
444
|
}
|
package/dist/router/index.js
CHANGED
|
@@ -1029,7 +1029,7 @@ export class CommandRouter {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
const resolvedTarget = path.resolve(targetPath);
|
|
1031
1031
|
// 与 ls.browse 对齐:目标只要存在且是目录即可切换(不再做子树/父级限制)。
|
|
1032
|
-
// 安全边界由 binder owner 认证兜底,见 docs/architecture/design.md §9.7 更新说明。
|
|
1032
|
+
// 安全边界由 binder owner 认证兜底,见 docs/zh/architecture/design.md §9.7 更新说明。
|
|
1033
1033
|
if (!fs.existsSync(resolvedTarget) || !fs.statSync(resolvedTarget).isDirectory()) {
|
|
1034
1034
|
await this.bridge.sendResult({ text: `路径无效: ${resolvedTarget}` }, ctx);
|
|
1035
1035
|
return;
|
|
@@ -114,7 +114,7 @@ export function listClaudeSessions(cwd, opts = {}) {
|
|
|
114
114
|
const limit = opts.limit;
|
|
115
115
|
const projectsDir = opts.projectsDir ?? defaultProjectsDir();
|
|
116
116
|
const index = ensureSessionIndex(projectsDir);
|
|
117
|
-
// 首次调用延迟全量建索引;之后 5s
|
|
117
|
+
// 首次调用延迟全量建索引;之后 5s 按需节流增量刷新(拍板 3)。
|
|
118
118
|
index.refresh();
|
|
119
119
|
// 统一 parser 的完整 cwd 集合 → A→B→C 任意中间 cwd 都可列出(核心 bug 修复)。
|
|
120
120
|
// readdir 失败时索引保留旧快照(首次失败则为空),与旧扫描的 readdir 兜底等价。
|
|
@@ -24,7 +24,7 @@ import { truncateUtf8, TOOL_RESULT_MAX_BYTES } from '../../common/truncate.js';
|
|
|
24
24
|
* CC-05: history 拉取上限。DSH session.history 的 maxMessages 同时限制返回条数,
|
|
25
25
|
* 若用它同时充当展示截断,>50 事件的会话累计 usage 会少算。这里拉取一个足够大的
|
|
26
26
|
* 上限保证 usage 累加覆盖整个会话;展示仍由 capEvents(opts?.maxEvents ?? 50) 截断。
|
|
27
|
-
* (若 DSH 支持分页 cursor
|
|
27
|
+
* (若 DSH 支持分页 cursor 可改成分页,当前用有界大拉取)
|
|
28
28
|
*/
|
|
29
29
|
const DSH_HISTORY_FETCH_LIMIT = 10_000;
|
|
30
30
|
/** Synchronous unary POST via curl (the reader interface is synchronous). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lark-remote",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Feishu (Lark) private-chat bridge to local coding agents — Claude Code / Codex / opencode / pi / kimi, with live-streaming CardKit 2.0 cards",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|