@moikapy/lich 0.3.1 → 0.5.0

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +12 -2
  3. package/dist/{chunk-P52U5M3L.js → chunk-CV2YH3FH.js} +449 -71
  4. package/dist/chunk-CV2YH3FH.js.map +1 -0
  5. package/dist/cli.d.ts +5 -0
  6. package/dist/cli.js +590 -25
  7. package/dist/cli.js.map +1 -1
  8. package/dist/{gateway-CWPVIU3W.js → gateway-W6S43ETE.js} +27 -18
  9. package/dist/gateway-W6S43ETE.js.map +1 -0
  10. package/dist/index.d.ts +58 -11
  11. package/dist/index.js +1 -1
  12. package/dist/{tui-K3EPRXTV.js → tui-DT7XWDTX.js} +8 -5
  13. package/dist/tui-DT7XWDTX.js.map +1 -0
  14. package/docs/architecture/overview.md +8 -6
  15. package/docs/architecture/plugins.md +57 -4
  16. package/docs/architecture/tools.md +16 -4
  17. package/docs/getting-started.md +15 -4
  18. package/docs/index.md +4 -3
  19. package/docs/user-guide/cli.md +24 -3
  20. package/docs/user-guide/godot.md +160 -0
  21. package/docs/user-guide/library.md +4 -2
  22. package/docs/user-guide/plugins.md +79 -5
  23. package/docs/user-guide/tui.md +4 -3
  24. package/examples/game_bridge/README.md +68 -0
  25. package/examples/game_bridge/bridge_io.mjs +60 -0
  26. package/examples/game_bridge/bridge_paths.mjs +11 -0
  27. package/examples/game_bridge/dungeon_memory.mjs +56 -0
  28. package/examples/game_bridge/enemy_actions.mjs +44 -0
  29. package/examples/game_bridge/game_bridge.plugin.mjs +17 -0
  30. package/examples/game_bridge/meteor_veto.mjs +22 -0
  31. package/examples/game_bridge/schemas.mjs +48 -0
  32. package/examples/game_bridge/snapshot.mjs +19 -0
  33. package/examples/game_bridge/validate_order.mjs +44 -0
  34. package/package.json +2 -1
  35. package/dist/chunk-P52U5M3L.js.map +0 -1
  36. package/dist/gateway-CWPVIU3W.js.map +0 -1
  37. package/dist/tui-K3EPRXTV.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ - add a `game_bridge` example plugin that queues batched enemy actions
6
+ and durable dungeon memory under `.lich/game/` for a Godot combat tick.
7
+ a `before_tool_call` hook holds meteor until round 3. node loads the
8
+ `.mjs` entry from `config.plugins`.
9
+ - load `config.plugins` on every CLI entry point and on `run_agent`
10
+ (`create_agent_with_plugins`). one-shot, chat, tui, and the gateway
11
+ bus no longer ignore plugin entries. broken plugins still warn and
12
+ continue. `create_agent` stays plugin-free.
13
+ - bare `lich` opens the TUI. On a TTY, when no config is in the search
14
+ chain and `LICH_MODEL` is unset, a readline wizard collects agent name,
15
+ provider, gateway env-var names (never secrets), and plugins, then
16
+ writes `.lich/config.json` once. Non-TTY stdin skips the wizard and
17
+ prints guidance. `lich init` writes the starter file through the same
18
+ writer and never overwrites an existing `.lich/config.json`.
19
+ - add `lich update`: compare the installed version with `npm view
20
+ @moikapy/lich version` and, when newer, run
21
+ `npm install -g @moikapy/lich@latest`. git clones are told to
22
+ `git pull`; npx cannot persist an update.
23
+ - document embedding that plugin beside a Godot game: one webhook call
24
+ per combat round, and the `.lich/game/` drain tick. see
25
+ docs/user-guide/godot.md.
26
+
27
+ ## 0.4.0
28
+
29
+ - add a self-improvement loop: `run_tests`, a gatekeeper plugin, and
30
+ `git_commit` (one commit per run, never pushes). `git_commit` is
31
+ registered by the gatekeeper, not the builtin tool list.
32
+ - fail-closed unless `LICH_ALLOW_SELF_COMMIT=1` at startup; unset or any
33
+ other value vetoes `git_commit`. a commit also needs a green `run_tests`
34
+ on a tree with no later `write_file`/`edit_file`.
35
+ - `run_tests` runs `LICH_TEST_COMMAND` in `work_dir` (default vitest) and
36
+ appends an optional filter as a quoted shell token.
37
+ - `docs_search` finds markdown skills under `.lich/skills` (fresh walk, no
38
+ `index.md` gate). `MEMORY.md` is never auto-loaded.
39
+ - close gatekeeper fail-open holes: git spawned with `hooksPath=/dev/null`,
40
+ pathspec magic rejected, denylist matches `commit-tree`/`update-ref` on
41
+ any occurrence, abort SIGKILLs the git child.
42
+ - honor per-tool `timeout_ms` (terminal is 5 min) instead of a flat 30s
43
+ executor budget.
44
+
3
45
  ## 0.3.1
4
46
 
5
47
  - Fix: published CLI bin now works — `dist/cli.js` shipped without its
package/README.md CHANGED
@@ -65,8 +65,9 @@ console.log(result.outcome.final?.content);
65
65
 
66
66
  ## Tools
67
67
 
68
- Twelve builtins ship with the agent (`register_builtin_tools`); all accept
68
+ Builtins ship with the agent (`register_builtin_tools`); all accept
69
69
  snake_case args and are registered under the `builtin` toolset.
70
+ `git_commit` is registered by the gatekeeper, not by that list.
70
71
 
71
72
  | Tool | Purpose |
72
73
  | --- | --- |
@@ -83,7 +84,8 @@ snake_case args and are registered under the `builtin` toolset.
83
84
  | `disk_usage` | `du -sb` sizes for depth-1 entries of a directory, sorted with a total. |
84
85
  | `env_get` | Inspect environment variables (names/lengths; secrets always masked). |
85
86
  | `docs_read` | Read a bundled lich doc (path relative to docs root; offset/limit; `.md` optional). |
86
- | `docs_search` | Keyword search across bundled lich docs with scored section snippets. |
87
+ | `docs_search` | Keyword search across bundled lich docs and `.lich/skills/*.md`, with scored section snippets. |
88
+ | `run_tests` | Run `LICH_TEST_COMMAND` in the working directory and return a structured pass/fail. |
87
89
 
88
90
  ## Plugins
89
91
 
@@ -93,6 +95,12 @@ object (`{name, tools?, hooks?}`) in your repo, list its file path in the
93
95
  observe or veto tool calls. See
94
96
  [docs/user-guide/plugins.md](docs/user-guide/plugins.md).
95
97
 
98
+ Skills are markdown files you write to `.lich/skills/` with `write_file`;
99
+ `docs_search` finds them. They are reference data, not instructions.
100
+ `MEMORY.md` is append-only, never auto-loaded; review it between appends and
101
+ the next self-commit. One gated `git_commit` per run requires
102
+ `LICH_ALLOW_SELF_COMMIT=1` and a green `run_tests` on a clean tree.
103
+
96
104
  ## Environment variables
97
105
 
98
106
  | Variable | Purpose |
@@ -101,6 +109,8 @@ observe or veto tool calls. See
101
109
  | `LICH_PROVIDER_KIND` | `openai_compat` \| `anthropic` \| `ollama` (default `openai_compat`) |
102
110
  | `LICH_BASE_URL` | provider base url (ollama default: `http://localhost:11434`) |
103
111
  | `LICH_API_KEY_ENV` | env var holding the api key (unused by ollama) |
112
+ | `LICH_ALLOW_SELF_COMMIT` | set to `1` to allow one gated `git_commit` per run; unset is fail-closed |
113
+ | `LICH_TEST_COMMAND` | command `run_tests` runs (default: `node node_modules/vitest/vitest.mjs run`) |
104
114
 
105
115
  ## Ollama
106
116