larkin 0.4.1 → 0.4.5
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 +76 -33
- package/artifacts/release/THIRD_PARTY_NOTICES.txt +218 -228
- package/assets/readme/larkin-github-cover.png +0 -0
- package/assets/readme/larkin-hero.svg +111 -0
- package/dist/agent/agent-state-store.cjs +193 -1
- package/dist/agent/agent-state-store.mjs +191 -0
- package/dist/app/agent-config.mjs +73 -6
- package/dist/app/agent-readiness.cjs +22 -2
- package/dist/app/agent-readiness.mjs +20 -2
- package/dist/app/binary-entry.mjs +6 -0
- package/dist/app/cli.mjs +7 -1
- package/dist/app/local-control.mjs +108 -2
- package/dist/app/run.mjs +8 -0
- package/dist/app/runtime-process.mjs +17 -1
- package/dist/app/session-cli.mjs +55 -20
- package/dist/dashboard/dashboard-view-model.mjs +12 -3
- package/dist/feishu/host-shell.cjs +104 -9
- package/dist/feishu/host-shell.mjs +105 -10
- package/dist/platform/config.cjs +406 -33
- package/dist/platform/config.mjs +405 -33
- package/dist/platform/process-boundary-trace.cjs +108 -0
- package/dist/platform/process-boundary-trace.mjs +102 -0
- package/dist/runtime/pi-artifact-provenance.cjs +147 -0
- package/dist/runtime/pi-artifact-provenance.mjs +139 -0
- package/dist/runtime/pi-compaction-recovery.cjs +703 -0
- package/dist/runtime/pi-compaction-recovery.mjs +679 -0
- package/dist/runtime/pi-model-catalog.cjs +2 -2
- package/dist/runtime/pi-model-catalog.mjs +2 -2
- package/dist/runtime/pi-profile-migration.cjs +556 -0
- package/dist/runtime/pi-profile-migration.mjs +515 -0
- package/dist/runtime/pi-provider-config.cjs +3 -3
- package/dist/runtime/pi-provider-config.mjs +3 -3
- package/dist/runtime/pi-rpc-client.cjs +39 -22
- package/dist/runtime/pi-rpc-client.mjs +39 -22
- package/dist/runtime/provider-error-classifier.cjs +39 -0
- package/dist/runtime/provider-error-classifier.mjs +34 -0
- package/dist/runtime/runtime-adapters.mjs +176 -27
- package/dist/runtime/runtime-host.cjs +630 -19
- package/dist/runtime/runtime-host.mjs +628 -18
- package/dist/runtime/runtime-readiness.cjs +6 -4
- package/dist/runtime/runtime-readiness.mjs +6 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./assets/readme/larkin-github-cover.png" width="100%" alt="Larkin connecting Codex, Claude Code, and Pi agent runtimes to Feishu with a local dashboard and message surfaces.">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="#quick-start">Quick start</a> · <a href="#requirements">Requirements</a> · <a href="#what-it-does">What it does</a> · <a href="#installation">Installation</a> · <a href="#usage">Usage</a> · <a href="#setup-and-configuration">Setup and configuration</a> · <a href="#details">Details</a> · <a href="#development">Development</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
Larkin is a local Runtime Host that connects Codex, Claude Code, and Pi agent runtimes to Feishu (Lark). It keeps sessions, reminders, interactive messages, and a local dashboard close to the machine that runs them.
|
|
4
10
|
|
|
5
11
|
## Requirements
|
|
6
12
|
|
|
@@ -9,9 +15,56 @@ Larkin connects Codex, Claude Code, and Pi agent runtimes to Feishu (Lark). It p
|
|
|
9
15
|
- At least one supported agent runtime and its authentication
|
|
10
16
|
- Bun 1.3.14 when running the npm package or building from source (standalone binaries bundle their own runtime)
|
|
11
17
|
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx larkin@latest setup
|
|
22
|
+
npx larkin@latest start
|
|
23
|
+
npx larkin@latest status
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## What it does
|
|
27
|
+
|
|
28
|
+
<table>
|
|
29
|
+
<tr>
|
|
30
|
+
<td valign="top">
|
|
31
|
+
|
|
32
|
+
**Runtime host**
|
|
33
|
+
|
|
34
|
+
Connect supported coding-agent runtimes to Feishu from one local process.
|
|
35
|
+
|
|
36
|
+
</td>
|
|
37
|
+
<td valign="top">
|
|
38
|
+
|
|
39
|
+
**Persistent workflow**
|
|
40
|
+
|
|
41
|
+
Keep sessions and reminders available across runs.
|
|
42
|
+
|
|
43
|
+
</td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<td valign="top">
|
|
47
|
+
|
|
48
|
+
**Message surfaces**
|
|
49
|
+
|
|
50
|
+
Work with Feishu messages, interactive cards, and related automation.
|
|
51
|
+
|
|
52
|
+
</td>
|
|
53
|
+
<td valign="top">
|
|
54
|
+
|
|
55
|
+
**Local visibility**
|
|
56
|
+
|
|
57
|
+
Inspect the host through the embedded dashboard and OpenTelemetry traces.
|
|
58
|
+
|
|
59
|
+
</td>
|
|
60
|
+
</tr>
|
|
61
|
+
</table>
|
|
62
|
+
|
|
63
|
+
The rest of this document uses the short `larkin` form; it works as-is after `npm install -g larkin`, or prefix any command with `npx larkin@latest` to run it without installing.
|
|
64
|
+
|
|
12
65
|
## Installation
|
|
13
66
|
|
|
14
|
-
|
|
67
|
+
Prefer npm:
|
|
15
68
|
|
|
16
69
|
```bash
|
|
17
70
|
# Run the latest version directly with npx — no install step, always the newest release
|
|
@@ -26,39 +79,28 @@ Standalone binaries for macOS, Linux, and Windows (x64) are attached to every [G
|
|
|
26
79
|
|
|
27
80
|
## Usage
|
|
28
81
|
|
|
29
|
-
|
|
30
|
-
npx larkin@latest setup
|
|
31
|
-
npx larkin@latest start
|
|
32
|
-
npx larkin@latest status
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
The rest of this document uses the short `larkin` form; it works as-is after `npm install -g larkin`, or prefix any command with `npx larkin@latest` to run it without installing.
|
|
36
|
-
|
|
37
|
-
Run `larkin --help` or `larkin config --help` for the available commands and configuration options. Local configuration is stored under `~/.larkin` by default; set `LARKIN_CONFIG_DIR` to use another directory.
|
|
82
|
+
Run `larkin --help` or `larkin config --help` for the available commands and configuration options. `larkin agents` reports event readiness, reply-scope readiness, subscription mode/status/dimension, arrivals, and read failures. Local configuration is stored under `~/.larkin` by default; set `LARKIN_CONFIG_DIR` to use another directory.
|
|
38
83
|
|
|
39
84
|
### Feishu message links
|
|
40
85
|
|
|
41
86
|
Feishu clients do not reliably render Markdown links such as `[label](URL)` as clickable in text or Markdown messages. When a recipient must be able to open a link, keep the complete bare HTTPS URL visible, for example: Issue 115 — https://github.com/eddiearc/larkin/issues/115. A label may accompany it, but must not replace the bare URL. Larkin does not rewrite exact, verbatim, or user-authored message bodies to enforce this guidance.
|
|
42
87
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
The
|
|
50
|
-
|
|
51
|
-
Pi
|
|
88
|
+
## Setup and configuration
|
|
89
|
+
|
|
90
|
+
During setup, a new Agent is offered Pi first, followed by Codex and Claude Code. Provider keys are stored only in the selected Agent's private provider directory, not in the ordinary Agent config. Setup also discovers every API-key and OAuth/subscription login exposed by the pinned official Pi registry and delegates those flows to Pi.
|
|
91
|
+
|
|
92
|
+
Use `larkin pi-auth status` or `larkin pi-auth logout <provider>` to manage Pi auth. The builtin Pi runtime loads Larkin's two supported extensions inline: background subagents and the 60-second foreground bash timeout guard are enabled without writing extension files or arguments. A compatible external Pi installation keeps the existing explicit `-e` extension path.
|
|
93
|
+
|
|
94
|
+
The bundled Pi identity is pinned to `@earendil-works/pi-coding-agent@0.84.2` in both `package.json` and `bun.lock`. Larkin launches it through the official RPC entrypoint and verifies the real RPC state/event handshake, compaction capability contract, and persisted session file before claiming readiness. The integration smoke test completes a provider turn, closes the process, and resumes the same session file; missing resume data fails closed instead of creating a fresh session.
|
|
95
|
+
|
|
96
|
+
For a controlled per-Agent switch, use `larkin pi-distribution show --agent <App ID>`, then provide a private snapshot destination for the atomic mutation: `larkin pi-distribution builtin --agent <App ID> --snapshot <private-file>`. Existing external Pi users can explicitly migrate the pinned 0.84.2 profile with `--import-external-profile`; this imports only `auth.json`, `models.json`, and `settings.json` into a new private per-Agent directory, preserves provider/model/auth bytes, and owns compaction at 40800/20000. Without that flag, builtin selection fails closed unless provider state is already configured. Roll back only when the snapshot CAS still matches with `larkin pi-distribution rollback --snapshot <private-file>`. Import and config changes are journaled together; source/target tampering refuses rollback, and sessions, Inbox data, unrelated provider files, and other Agents remain untouched.
|
|
52
97
|
|
|
53
|
-
|
|
98
|
+
<details>
|
|
99
|
+
<summary>Windows support and optional autostart</summary>
|
|
54
100
|
|
|
55
|
-
Windows 11 x64 core support covers the standalone CLI, local Runtime Host startup, builtin Pi RPC with the
|
|
56
|
-
inline extensions above, and the embedded Dashboard. Provider authentication, the official `lark-cli`, and
|
|
57
|
-
external Codex, Claude Code, or Pi executables remain separately installed dependencies; secret-bearing live
|
|
58
|
-
channel/provider tests are intentionally outside the hosted Windows CI gate.
|
|
101
|
+
Windows 11 x64 core support covers the standalone CLI, local Runtime Host startup, builtin Pi RPC with the inline extensions above, and the embedded Dashboard. Provider authentication, the official `lark-cli`, and external Codex, Claude Code, or Pi executables remain separately installed dependencies; secret-bearing live channel/provider tests are intentionally outside the hosted Windows CI gate.
|
|
59
102
|
|
|
60
|
-
An Administrator account can optionally start Larkin at that account's interactive logon with Task Scheduler.
|
|
61
|
-
From an elevated PowerShell prompt, adjust the executable and working-directory paths first:
|
|
103
|
+
An Administrator account can optionally start Larkin at that account's interactive logon with Task Scheduler. From an elevated PowerShell prompt, adjust the executable and working-directory paths first:
|
|
62
104
|
|
|
63
105
|
```powershell
|
|
64
106
|
$Exe = 'C:\Tools\Larkin\larkin.exe'
|
|
@@ -69,13 +111,13 @@ Register-ScheduledTask -TaskName 'Larkin Runtime Host' -Action $Action -Trigger
|
|
|
69
111
|
-Description 'Start Larkin for this Administrator account at logon' -RunLevel Highest
|
|
70
112
|
```
|
|
71
113
|
|
|
72
|
-
This is an optional per-user Administrator-logon task, not SYSTEM boot support or a Windows service. Keep the
|
|
73
|
-
|
|
74
|
-
normal Windows security policy and SmartScreen decisions still apply.
|
|
114
|
+
This is an optional per-user Administrator-logon task, not SYSTEM boot support or a Windows service. Keep the account profile available because Larkin stores its state there. Release executables are currently unsigned; normal Windows security policy and SmartScreen decisions still apply.
|
|
115
|
+
</details>
|
|
75
116
|
|
|
76
|
-
|
|
117
|
+
## Details
|
|
77
118
|
|
|
78
|
-
|
|
119
|
+
<details>
|
|
120
|
+
<summary>OpenTelemetry traces</summary>
|
|
79
121
|
|
|
80
122
|
Larkin records a privacy-safe timing waterfall for each woken Feishu message. Tracing is always enabled, and ended spans first enter a durable local OTLP/HTTP JSON spool. Message processing therefore does not depend on an observability backend being reachable.
|
|
81
123
|
|
|
@@ -136,6 +178,7 @@ larkin.message.process
|
|
|
136
178
|
```
|
|
137
179
|
|
|
138
180
|
The compose stack binds Grafana, Tempo, and OTLP only to `127.0.0.1` and persists `/data`. It is intended for development, demos, and testing. Do not expose its default credentials or plaintext OTLP port publicly; use a deployment-owned TLS/authenticated endpoint or private network for remote automatic upload.
|
|
181
|
+
</details>
|
|
139
182
|
|
|
140
183
|
## Development
|
|
141
184
|
|