larkway 0.3.58 → 0.3.60
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 +5 -3
- package/README.zh.md +1 -1
- package/bin/larkway.mjs +51 -0
- package/dist/cli/index.js +6172 -5852
- package/dist/main.js +15 -1
- package/package.json +3 -3
- package/bin/larkway +0 -25
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
You @ the bot in a Feishu thread. It runs on your machine — reading your real codebase, executing commands, opening MRs — and posts the result back. You define what the agent knows and what it can do. Larkway just carries the messages.
|
|
10
10
|
|
|
11
|
-
**Current release: v0.3.
|
|
11
|
+
**Current release: v0.3.60**
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -61,7 +61,7 @@ Feishu thread
|
|
|
61
61
|
|
|
62
62
|
**What Larkway does NOT do** — the agent decides everything else:
|
|
63
63
|
|
|
64
|
-
- No GitLab
|
|
64
|
+
- No GitHub/GitLab API calls (the agent runs `gh`/`glab` itself)
|
|
65
65
|
- No worktree creation (the agent runs `git worktree add`)
|
|
66
66
|
- No dev server management (the agent starts it)
|
|
67
67
|
- No orchestration logic — the agent reads your `AGENTS.md` / `CLAUDE.md` / skills and plans its own steps
|
|
@@ -163,6 +163,7 @@ Secrets live only in `~/.larkway/.env` (mode 0600). Config and memory contain no
|
|
|
163
163
|
- **Session continuity** — every Feishu thread maps to a persistent `session_id`; the agent remembers what it did in prior turns
|
|
164
164
|
- **Agent Workspace** — each bot gets its own workspace where the agent clones the repo itself, with per-thread session dirs; concurrent threads don't trip over each other's git state (expect disk usage and a slower first turn on large repos — clones are per-session, GC'd after 24h idle)
|
|
165
165
|
- **Codex runtime pre-checks** — `larkway doctor` validates Codex state directory writability before start
|
|
166
|
+
- **OS-service daemon** — `larkway start` registers the bridge with launchd (macOS) / systemd (Linux): survives reboots and auto-restarts on crash; `larkway stop` stops it and disables autostart
|
|
166
167
|
- **Topic ↔ Feishu task handle** — turn a topic into a Feishu task and the agent claims it, then keeps its lifecycle (done/failed/reopened, stalled, handed off, overdue) in sync automatically — see below
|
|
167
168
|
|
|
168
169
|
---
|
|
@@ -194,10 +195,11 @@ platform-fact writeups: [docs/task-handle.md](docs/task-handle.md).
|
|
|
194
195
|
|
|
195
196
|
## Requirements
|
|
196
197
|
|
|
198
|
+
- **macOS or Linux** — native Windows is not supported yet (the runtime depends on POSIX tooling such as `bash` and `pgrep`); on Windows, install and run everything (Node.js, larkway, Claude Code / Codex, `lark-cli`) inside [WSL](https://learn.microsoft.com/windows/wsl/install)
|
|
197
199
|
- **Node.js 20+ LTS**
|
|
198
200
|
- **A Claude Code or Codex subscription** with local CLI installed and logged in
|
|
199
201
|
- **`lark-cli`** — Feishu long-connection client and message utilities: `npm i -g @larksuite/cli`, then `lark-cli auth login` (the agent uses it to read thread history and attachments; `larkway doctor` checks it's present)
|
|
200
|
-
- **`
|
|
202
|
+
- **`git` + `gh`** — for bots that open PRs (GitHub is the default forge; use `glab` instead for GitLab repos; both optional for read-only bots)
|
|
201
203
|
- **An always-on host machine** — the bridge must stay running to receive Feishu events; a laptop that sleeps will miss messages; a small server or desktop works well
|
|
202
204
|
|
|
203
205
|
---
|
package/README.zh.md
CHANGED
package/bin/larkway.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// larkway CLI shim — resolves the package root from this script's own location
|
|
3
|
+
// so it works whether invoked via `bin/larkway`, an absolute path, or a symlink
|
|
4
|
+
// on PATH (e.g. after `npm i -g`).
|
|
5
|
+
//
|
|
6
|
+
// Written in Node (not bash) so npm's cross-platform bin shims work everywhere:
|
|
7
|
+
// a bash shebang made Windows installs fail at startup with
|
|
8
|
+
// `/bin/bash: C:Users...: No such file or directory` before any of our code ran.
|
|
9
|
+
//
|
|
10
|
+
// Startup priority:
|
|
11
|
+
// 1. dist/cli/index.js exists → import it in-process (installed package / post-build)
|
|
12
|
+
// 2. otherwise → `npx tsx src/cli/index.ts` (fresh clone dev mode, no build)
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
|
+
import { spawnSync } from "node:child_process";
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
17
|
+
|
|
18
|
+
if (process.platform === "win32") {
|
|
19
|
+
// The bridge runtime depends on POSIX tooling (bash supervisor, pgrep, lsof),
|
|
20
|
+
// so native Windows is not supported yet — fail fast with guidance instead of
|
|
21
|
+
// crashing later with an obscure error.
|
|
22
|
+
console.error(
|
|
23
|
+
[
|
|
24
|
+
"larkway 暂不支持原生 Windows 运行(依赖 bash / pgrep 等 POSIX 工具)。",
|
|
25
|
+
"推荐在 WSL(Windows Subsystem for Linux)中安装使用:",
|
|
26
|
+
" 1. 安装 WSL: https://learn.microsoft.com/windows/wsl/install",
|
|
27
|
+
" 2. 在 WSL 终端内安装 Node.js 20+,然后 `npm i -g larkway`",
|
|
28
|
+
" 3. Claude Code / Codex 也需安装在 WSL 内",
|
|
29
|
+
"",
|
|
30
|
+
"larkway does not yet support native Windows (it depends on POSIX tooling",
|
|
31
|
+
"such as bash and pgrep). Please install and run it inside WSL instead.",
|
|
32
|
+
].join("\n"),
|
|
33
|
+
);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const selfPath = fileURLToPath(import.meta.url);
|
|
38
|
+
const repoRoot = path.resolve(path.dirname(selfPath), "..");
|
|
39
|
+
const distEntry = path.join(repoRoot, "dist", "cli", "index.js");
|
|
40
|
+
|
|
41
|
+
if (existsSync(distEntry)) {
|
|
42
|
+
await import(pathToFileURL(distEntry).href);
|
|
43
|
+
} else {
|
|
44
|
+
// Dev fallback: run TypeScript source directly via tsx.
|
|
45
|
+
const result = spawnSync(
|
|
46
|
+
"npx",
|
|
47
|
+
["tsx", path.join(repoRoot, "src", "cli", "index.ts"), ...process.argv.slice(2)],
|
|
48
|
+
{ stdio: "inherit" },
|
|
49
|
+
);
|
|
50
|
+
process.exit(result.status ?? 1);
|
|
51
|
+
}
|