@moikapy/lich 0.7.0 → 0.7.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 +60 -5
- package/README.md +38 -9
- package/dist/{chunk-JYURFAGB.js → chunk-CVX7LZWC.js} +2 -2
- package/dist/{chunk-SAEB3QL3.js → chunk-PZNYVGD4.js} +2 -2
- package/dist/{chunk-QVJCIZIF.js → chunk-WNFBIX4E.js} +629 -169
- package/dist/chunk-WNFBIX4E.js.map +1 -0
- package/dist/cli.js +8 -6
- package/dist/cli.js.map +1 -1
- package/dist/{gateway-5BG3YCZF.js → gateway-44QTIJTJ.js} +108 -49
- package/dist/gateway-44QTIJTJ.js.map +1 -0
- package/dist/index.d.ts +29 -1
- package/dist/index.js +2 -2
- package/dist/{tui-L6RABP2J.js → tui-MEJGEILU.js} +25 -10
- package/dist/tui-MEJGEILU.js.map +1 -0
- package/docs/architecture/overview.md +2 -3
- package/docs/architecture/tools.md +30 -3
- package/docs/getting-started.md +3 -3
- package/docs/index.md +1 -1
- package/docs/user-guide/cli.md +5 -4
- package/docs/user-guide/gateway.md +70 -16
- package/docs/user-guide/library.md +1 -1
- package/docs/user-guide/redot.md +2 -2
- package/docs/user-guide/tui.md +2 -2
- package/package.json +1 -1
- package/dist/chunk-QVJCIZIF.js.map +0 -1
- package/dist/gateway-5BG3YCZF.js.map +0 -1
- package/dist/tui-L6RABP2J.js.map +0 -1
- /package/dist/{chunk-JYURFAGB.js.map → chunk-CVX7LZWC.js.map} +0 -0
- /package/dist/{chunk-SAEB3QL3.js.map → chunk-PZNYVGD4.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.7.
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
- close agent-core review must-fixes A-1–A-4: multi-turn runs stop
|
|
6
|
+
duplicating history, tool pairs survive compression and gateway history
|
|
7
|
+
caps, and a mid-call abort becomes `stopped_reason: aborted` with the
|
|
8
|
+
abort signal reaching in-flight tools.
|
|
9
|
+
- harden the webhook gateway (G-1/G-2/G-3/G-5): binds to loopback by
|
|
10
|
+
default and requires a token when exposed, defaults public platforms
|
|
11
|
+
(telegram/discord/twitch) to deny with a configurable allowlist plus a
|
|
12
|
+
reduced safe toolset, catches telegram/discord reply send failures
|
|
13
|
+
instead of crashing the run, and forces `platform=webhook` on the HTTP
|
|
14
|
+
adapter.
|
|
15
|
+
- close MCP exit (M-1), empty Anthropic text, and env provider fallback:
|
|
16
|
+
one-shot/chat/TUI/gateway runs call `Agent.close()` so stdio MCP
|
|
17
|
+
sessions release; node children are still `unref`'d so the event loop
|
|
18
|
+
can drain (bun keeps the child attached — see below). an empty
|
|
19
|
+
Anthropic text block no longer 400s the session permanently, and
|
|
20
|
+
mcp-only project configs no longer shadow `LICH_MODEL` / env providers.
|
|
21
|
+
- close tools must-fixes S-1–S-5: file writes/edits resolve realpath so
|
|
22
|
+
symlink escapes are confined, `fetch_url`/`http_request` block private
|
|
23
|
+
and loopback URLs, `.lich/config.json` and `.env` are forbidden write
|
|
24
|
+
targets, terminal child env is scrubbed of provider secrets, and
|
|
25
|
+
dash-leading `run_tests` filters are rejected so they cannot open the
|
|
26
|
+
commit gate. `http_request` also strips IPv6 brackets before SSRF IP
|
|
27
|
+
classification so `[::1]` literals are not skipped, and asserts headers
|
|
28
|
+
through `Headers` after the `safe_fetch` merge.
|
|
29
|
+
- isolate usage per run (A-5) and memoize MCP attach (A-6): concurrent
|
|
30
|
+
`Agent.run` calls no longer mix `usage_total`, and attach races can
|
|
31
|
+
neither skip nor permanently fail.
|
|
32
|
+
- TUI: ignore message submit while a run is in flight (U-1), and walk the
|
|
33
|
+
newest-first recall ring so Up moves to older entries instead of
|
|
34
|
+
clamping on the newest (U-2).
|
|
35
|
+
- pin outbound HTTP: `fetch_url` and `http_request` keep the https
|
|
36
|
+
hostname for TLS/SNI and the `Host` header while `safe_fetch` pins the
|
|
37
|
+
connect to a vetted public IP through a custom DNS `lookup`, and
|
|
38
|
+
re-validates every redirect hop. the operator opt-out is exact:
|
|
39
|
+
`LICH_ALLOW_PRIVATE_URLS=1`; unset or any other value is fail-closed
|
|
40
|
+
(private/loopback URLs blocked).
|
|
41
|
+
- harden `grep_files`: the directory walk skips symbolic links (same
|
|
42
|
+
skip path as `SKIP_DIRS`), and every candidate read runs
|
|
43
|
+
`assert_file_tool_access`, so `.lich/config.json` is denied with
|
|
44
|
+
`forbidden_path: .lich/config.json`.
|
|
45
|
+
- twitch gateway: `PRIVMSG` matching is anchored (`^:... PRIVMSG #...
|
|
46
|
+
:...$` after the optional tags strip), so `USERNOTICE` and
|
|
47
|
+
`WHISPER` lines are not chat and cannot spoof the allowlist.
|
|
48
|
+
- bun stdio MCP children are no longer `unref`'d: one-shot and
|
|
49
|
+
short-lived runs wait for the MCP answer instead of letting the child
|
|
50
|
+
detach and exit early.
|
|
51
|
+
- add CI (tsc + vitest on Node 20/22), sync the 0.7.0 user docs with this
|
|
52
|
+
tree, and make `edit_file` treat `$` sequences literally while allowing
|
|
53
|
+
an empty `new_string` (#57).
|
|
54
|
+
- sync docs/architecture with the outbound-HTTP pin, grep hardening,
|
|
55
|
+
twitch anchor, and bun MCP exit changes (#61).
|
|
56
|
+
- add a manual Release workflow: Actions → Release → Run workflow (from
|
|
57
|
+
`main`) with a `patch|minor|major` bump runs `bun release`, then
|
|
58
|
+
publishes the packed tarball to npm with `NPM_TOKEN`. maintainer
|
|
59
|
+
plumbing, not a runtime change (#62).
|
|
60
|
+
|
|
61
|
+
## 0.7.0
|
|
4
62
|
|
|
5
63
|
- add a general MCP client. `mcp_servers` is a closed record of named
|
|
6
64
|
stdio or loopback-http entries, default off. tool names are
|
|
@@ -14,10 +72,7 @@
|
|
|
14
72
|
add uses the catalog or `--command`/`--url`, stays disabled, and
|
|
15
73
|
updates `.lich/config.json` through the existing writer without
|
|
16
74
|
dropping other keys.
|
|
17
|
-
- sync user docs with this tree.
|
|
18
|
-
(`lich --version` reads package.json). MCP commands are not in that
|
|
19
|
-
package. CLI, config, plugin load, and sidebar links match the code.
|
|
20
|
-
0.7.0 is not released.
|
|
75
|
+
- sync user docs with this tree. MCP is included in the 0.7.0 package.
|
|
21
76
|
|
|
22
77
|
## 0.6.0
|
|
23
78
|
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ mythology lives in display strings only.
|
|
|
15
15
|
| --- | --- | --- |
|
|
16
16
|
| **phylacteries** | JSONL session files in `.lich/sessions/` — conversations survive process death | This glossary; TUI `/sessions` listing label |
|
|
17
17
|
| **vessel-hopping** | Provider failover: 429/5xx retried with backoff, then the next provider takes over | This glossary |
|
|
18
|
-
| **the lair / wards** | `work_dir` confinement + `path_escape` guardrails | This glossary |
|
|
18
|
+
| **the lair / wards** | `work_dir` confinement + `path_escape` guardrails for file tools. Wards do **not** apply to `terminal` or `run_tests` (shell still runs in `work_dir`; secret env names are scrubbed on spawn). | This glossary |
|
|
19
19
|
| **lair actions** | Plugin hooks that observe or veto tool calls | This glossary |
|
|
20
20
|
| **familiars** | Gateway adapters (webhook/telegram/discord/twitch) routing into one shared agent | This glossary |
|
|
21
21
|
| **spells** | Builtin tools in the registry | This glossary |
|
|
@@ -101,7 +101,7 @@ snake_case args and are registered under the `builtin` toolset.
|
|
|
101
101
|
| `edit_file` | Replace a unique string in a file, with an optional replace-all. |
|
|
102
102
|
| `list_dir` | List a directory tree iteratively (dirs first, file sizes). |
|
|
103
103
|
| `terminal` | Run a shell command via `bash -lc` and capture output plus exit code. |
|
|
104
|
-
| `grep_files` | Regex search across files, skipping node_modules/.git/dist and binaries. |
|
|
104
|
+
| `grep_files` | Regex search across files, skipping node_modules/.git/dist, symlinks, and binaries; `.lich/config.json` is denied. |
|
|
105
105
|
| `fetch_url` | GET an http(s) URL and return the body text with a status header. |
|
|
106
106
|
| `web_search` | Web search via DuckDuckGo's HTML endpoint (no api key). |
|
|
107
107
|
| `http_request` | Generic HTTP calls (method/headers/body) for REST-ish APIs. |
|
|
@@ -137,6 +137,7 @@ the next self-commit. One gated `git_commit` per run requires
|
|
|
137
137
|
| `LICH_BASE_URL` | provider base url (ollama default: `http://localhost:11434`) |
|
|
138
138
|
| `LICH_API_KEY_ENV` | env var holding the api key (unused by ollama) |
|
|
139
139
|
| `LICH_ALLOW_SELF_COMMIT` | set to `1` to allow one gated `git_commit` per run; unset is fail-closed |
|
|
140
|
+
| `LICH_ALLOW_PRIVATE_URLS` | set to exactly `1` to let `fetch_url` / `http_request` reach private or loopback URLs; unset or any other value is fail-closed (blocked) |
|
|
140
141
|
| `LICH_TEST_COMMAND` | command `run_tests` runs (default: `node node_modules/vitest/vitest.mjs run`) |
|
|
141
142
|
|
|
142
143
|
## Ollama
|
|
@@ -254,12 +255,13 @@ command, or loopback HTTP). The game connects **to** lich through the webhook
|
|
|
254
255
|
and [`examples/game_bridge`](examples/game_bridge/README.md). Default is off.
|
|
255
256
|
`mcp_servers` is a closed record. Names are `mcp_<server>_<tool>`. `npx`,
|
|
256
257
|
`npm`, `bunx`, `uvx`, `curl`, `wget`, remote URLs, and shell metacharacters
|
|
257
|
-
are refused.
|
|
258
|
+
are refused. On Bun, stdio children are not `unref`'d, so a one-shot or
|
|
259
|
+
other short-lived run waits for the MCP answer instead of exiting while
|
|
260
|
+
the child is still working; `agent.close()` (which every CLI mode calls)
|
|
261
|
+
kills the child.
|
|
258
262
|
|
|
259
|
-
This source has `lich mcp list|add|enable|disable|remove` (changelog 0.7.0
|
|
260
|
-
|
|
261
|
-
commands; `lich --version` still prints `0.6.0` because it reads
|
|
262
|
-
`package.json`. From a clone: `bun src/cli.ts mcp list`. Redot is a catalog
|
|
263
|
+
This source has `lich mcp list|add|enable|disable|remove` (changelog 0.7.0).
|
|
264
|
+
From a clone: `bun src/cli.ts mcp list`. Redot is a catalog
|
|
263
265
|
entry (`redot --headless --mcp-server`), not a fork inside lich. Godot has
|
|
264
266
|
no official MCP server; lich does not download a community addon. See
|
|
265
267
|
[docs/user-guide/redot.md](docs/user-guide/redot.md).
|
|
@@ -277,15 +279,42 @@ packages in /tmp and break dependency resolution.
|
|
|
277
279
|
|
|
278
280
|
## Releasing
|
|
279
281
|
|
|
282
|
+
Update `CHANGELOG.md` first so the new version notes match what you ship
|
|
283
|
+
(GitHub release labels / automated notes are a follow-up).
|
|
284
|
+
|
|
285
|
+
### GitHub Actions (preferred)
|
|
286
|
+
|
|
287
|
+
Requires the `NPM_TOKEN` repository secret (npm **automation** or
|
|
288
|
+
granular token with publish access to `@moikapy/lich` — not a classic
|
|
289
|
+
token that needs interactive OTP, which `npm publish` in CI cannot
|
|
290
|
+
answer). It is typically already configured; if not, add it under
|
|
291
|
+
**Settings → Secrets and variables → Actions → New repository secret**.
|
|
292
|
+
1. Ensure Actions can push commits/tags to `main` (repo
|
|
293
|
+
**Settings → Actions → General → Workflow permissions**: read and
|
|
294
|
+
write; if branch protection blocks `GITHUB_TOKEN`, allow GitHub Actions
|
|
295
|
+
to bypass or push to `main`).
|
|
296
|
+
2. Run: **Actions → Release → Run workflow** (from `main` only) → choose
|
|
297
|
+
`bump` (`patch` / `minor` / `major`, default `patch`).
|
|
298
|
+
|
|
299
|
+
The workflow runs `bun release <bump>` (typecheck, test, bump, build,
|
|
300
|
+
pack + audit, commit, tag, push — no force-push), then
|
|
301
|
+
`npm publish test/.tmp/lich-<version>.tgz --access public` with
|
|
302
|
+
`NODE_AUTH_TOKEN` from `NPM_TOKEN`. It refuses to publish if the pack
|
|
303
|
+
file is missing. Permissions include `id-token: write` for a future npm
|
|
304
|
+
OIDC trusted-publishing switch; today the token path is what works.
|
|
305
|
+
|
|
306
|
+
### Local
|
|
307
|
+
|
|
280
308
|
```sh
|
|
281
309
|
bun release patch # or minor | major
|
|
310
|
+
npm publish test/.tmp/lich-<version>.tgz
|
|
282
311
|
```
|
|
283
312
|
|
|
284
313
|
Fails closed on a dirty tree, a non-main branch, a typecheck error, or a
|
|
285
314
|
test failure; bumps via `npm version`, builds, and packs + audits
|
|
286
315
|
`test/.tmp/lich-<version>.tgz` (SHA-512 + scope verification) before
|
|
287
|
-
committing, tagging `v<version>`, and pushing main.
|
|
288
|
-
|
|
316
|
+
committing, tagging `v<version>`, and pushing main. Local publish stays
|
|
317
|
+
interactive so npm can prompt for OTP.
|
|
289
318
|
|
|
290
319
|
## License
|
|
291
320
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WNFBIX4E.js";
|
|
4
4
|
|
|
5
5
|
// src/util/theme.ts
|
|
6
6
|
import { readFileSync } from "fs";
|
|
@@ -89,4 +89,4 @@ export {
|
|
|
89
89
|
notice_flavor,
|
|
90
90
|
load_theme
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-CVX7LZWC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalog_by_name
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WNFBIX4E.js";
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
import { readFileSync } from "fs";
|
|
@@ -55,4 +55,4 @@ export {
|
|
|
55
55
|
catalog_client_entry,
|
|
56
56
|
LICH_VERSION
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-PZNYVGD4.js.map
|