@zenera/cli 1.1.10 → 1.1.12

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 (65) hide show
  1. package/README.md +69 -15
  2. package/dist/banner.js +69 -47
  3. package/dist/cache.d.ts +98 -0
  4. package/dist/cache.js +301 -0
  5. package/dist/catalog.d.ts +3 -0
  6. package/dist/catalog.js +35 -11
  7. package/dist/commands/cache.d.ts +7 -0
  8. package/dist/commands/cache.js +245 -0
  9. package/dist/commands/check.js +6 -3
  10. package/dist/commands/index.js +5 -0
  11. package/dist/commands/init.js +8 -4
  12. package/dist/commands/key.js +68 -14
  13. package/dist/commands/memory.d.ts +3 -0
  14. package/dist/commands/memory.js +375 -0
  15. package/dist/commands/models.js +17 -1
  16. package/dist/commands/run.js +11 -3
  17. package/dist/commands/sandbox.js +70 -23
  18. package/dist/engine.js +14 -9
  19. package/dist/home.d.ts +2 -2
  20. package/dist/home.js +2 -2
  21. package/dist/keys.d.ts +22 -0
  22. package/dist/keys.js +105 -2
  23. package/dist/lib.d.ts +1 -0
  24. package/dist/lib.js +1 -0
  25. package/dist/liveness.js +11 -0
  26. package/dist/main.js +9 -0
  27. package/dist/podman.js +43 -9
  28. package/dist/projects.js +10 -2
  29. package/dist/resolve.d.ts +4 -0
  30. package/dist/resolve.js +43 -17
  31. package/dist/scaffold.js +22 -1
  32. package/dist/term.d.ts +23 -2
  33. package/dist/term.js +215 -8
  34. package/dist/tui/app.d.ts +10 -0
  35. package/dist/tui/app.js +478 -54
  36. package/dist/tui/theme.d.ts +13 -2
  37. package/dist/tui/theme.js +26 -13
  38. package/dist/tui/wrap.d.ts +92 -0
  39. package/dist/tui/wrap.js +147 -2
  40. package/dist/validate.d.ts +2 -0
  41. package/dist/validate.js +87 -2
  42. package/package.json +2 -2
  43. package/templates/editor/.github/copilot-instructions.md +200 -55
  44. package/templates/editor/.github/prompts/new-agent.prompt.md +5 -2
  45. package/templates/editor/.github/prompts/review-project.prompt.md +5 -0
  46. package/templates/editor/.github/prompts/sync-with-spec.prompt.md +11 -4
  47. package/templates/editor/.github/skills/zen-cli/SKILL.md +3 -0
  48. package/templates/editor/.github/skills/zen-cli/references/faker.md +18 -8
  49. package/templates/editor/.github/skills/zen-cli/references/keys.md +7 -7
  50. package/templates/editor/.github/skills/zen-cli/references/memory.md +113 -0
  51. package/templates/editor/.github/skills/zen-cli/references/rag.md +2 -2
  52. package/templates/editor/.github/skills/zen-cli/references/run.md +3 -1
  53. package/templates/editor/.github/skills/zen-memory/SKILL.md +555 -0
  54. package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +575 -0
  55. package/templates/editor/.github/skills/{api-schema-index → zen-rag-schema}/SKILL.md +4 -4
  56. package/templates/editor/.vscode/settings.json +4 -2
  57. package/templates/parts/exa.prompt.md.tmpl +4 -0
  58. package/templates/parts/exa.spec.md.tmpl +2 -0
  59. package/templates/project/INSTRUCTIONS.md +8 -0
  60. package/templates/project/SPECIFICATION.md.tmpl +47 -0
  61. package/templates/project/agents/prompts/{default.md → default.md.tmpl} +4 -0
  62. package/templates/project/agents.yaml.tmpl +4 -0
  63. package/templates/project/gitignore +7 -1
  64. package/templates/project/scripts/_setup.sh +101 -0
  65. package/templates/project/SPECIFICATION.md +0 -6
@@ -0,0 +1,113 @@
1
+ # Memory — `zen memory`
2
+
3
+ ```
4
+ zen memory [stats|ls|show|export|forget] [args] [options]
5
+ ```
6
+
7
+ Alias: `mem`.
8
+
9
+ The memory graph from outside the agents. It exists to answer the question
10
+ memory always eventually raises: **why did it recall that?**
11
+
12
+ Only projects that enable memory have one, and the commands say so rather than
13
+ inventing an empty graph. Turning it on is the `memory:` block in `agents.yaml`.
14
+
15
+ This document is the command. For how the graph is organised, how to configure
16
+ it, and how to decide what an agent should remember, read the `zen-memory`
17
+ skill.
18
+
19
+ ## Subcommands
20
+
21
+ | Command | What it does |
22
+ | ------------------------- | ------------------------------------------- |
23
+ | `zen memory stats` | Size, vocabulary, whether it is embedded |
24
+ | `zen memory ls` | Nodes, newest first. Changes nothing |
25
+ | `zen memory show <id>` | One node in full, with what it links to |
26
+ | `zen memory export [f]` | The whole graph as one HTML page |
27
+ | `zen memory forget <id…>` | Remove nodes, their vectors and their files |
28
+
29
+ | Flag | Meaning |
30
+ | ----------------------- | -------------------------------------------- |
31
+ | `--project <name\|dir>` | Which project. Inferred from the directory |
32
+ | `--kind <name>` | Only this kind of node |
33
+ | `--audience <name>` | Only nodes committed under this label |
34
+ | `--files` | Only nodes that remember a file |
35
+ | `--stale` | Only nodes something has superseded |
36
+ | `--limit <n>` | Rows to list. Default 30 |
37
+ | `--out <file>` | Where `export` writes. Default `memory.html` |
38
+ | `--open` | Open the exported page |
39
+ | `--yes` | Do not ask before removing |
40
+
41
+ ## It reads unmasked, on purpose
42
+
43
+ Memory is masked per agent: a node's `audience` decides who can see it. Recall
44
+ is masked, ranked and truncated as well, so what an agent gets is never the
45
+ whole picture.
46
+
47
+ This command ignores all of that. When the mask is the thing that is wrong, the
48
+ part that was hidden is exactly the part you need — and this is a person at a
49
+ terminal in the project directory, not an agent inside a run.
50
+
51
+ It also contacts no model. The store is opened without an embedder, so
52
+ inspection is free and works offline; the price is that `ls` filters by text
53
+ rather than by meaning.
54
+
55
+ ## `export` is the one to reach for
56
+
57
+ ```sh
58
+ zen memory export --open
59
+ ```
60
+
61
+ One self-contained HTML file, three panes:
62
+
63
+ - **left** — every node, with a search box and filters for kind, audience,
64
+ files, superseded and unlinked
65
+ - **middle** — the graph as a Mermaid diagram, coloured by kind, with pan,
66
+ zoom, and a hop-focus selector for following one node's neighbourhood
67
+ - **right** — whatever you clicked, in full: the text, the metadata, the links,
68
+ and **the remembered file's actual content** — rendered as an image when it is
69
+ one, and as text otherwise
70
+
71
+ Clicking a node in either the list or the diagram selects it in both. Above 300
72
+ drawn nodes the diagram asks you to narrow it with the filters, because a
73
+ Mermaid graph that large is not a picture of anything.
74
+
75
+ It is a single file with no server behind it, so it attaches to a bug report.
76
+ The only network it does is fetching Mermaid; without that it degrades to a
77
+ working list and detail view.
78
+
79
+ ## Forgetting
80
+
81
+ ```sh
82
+ zen memory forget 01M1YPN0C8QRQS5BCZ03ABQ1G0
83
+ ```
84
+
85
+ Asks first, unless `--yes`, and refuses outright when there is no terminal to
86
+ ask at. A node, its vector row and its remembered file bytes go together —
87
+ there is one implementation of that, shared with the agent-facing tool, so the
88
+ three cannot drift apart.
89
+
90
+ **Forgetting is rarely the right correction.** The agents' own way to fix a
91
+ wrong memory is to commit the corrected node and supersede the old one, which
92
+ keeps the record of having been wrong. `zen memory ls --stale` lists what has
93
+ been superseded that way. Use `forget` for what should never have been stored —
94
+ a secret, a mistake, a pile of noise — not for what merely became untrue.
95
+
96
+ ## Reading `stats`
97
+
98
+ ```
99
+ nodes 7
100
+ edges 6
101
+ superseded 1
102
+ files 1 · 640 B
103
+ embedding none — recall falls back to term overlap
104
+ vectors —
105
+ ```
106
+
107
+ `embedding none` is worth noticing: without an embedder, recall matches on
108
+ shared terms rather than on meaning, which works but is much blunter. Set
109
+ `memory.embedding` in `agents.yaml` to change it.
110
+
111
+ A vector count lower than the node count means some nodes were committed while
112
+ no embedder was configured, and they will only ever be found by term overlap
113
+ until they are re-embedded.
@@ -360,7 +360,7 @@ Every document is **copied into the index**, and every quoted line is read back
360
360
  out of that copy — so the index is one portable thing and what it quotes is the
361
361
  document rather than a reconstruction of it. Each document is named by its path
362
362
  relative to the common root of everything indexed, which is what keeps
363
- `nsx_4.1.0/api/routing.md` and `nsx_4.2.0/api/routing.md` apart.
363
+ `acme_4.1.0/api/routing.md` and `acme_4.2.0/api/routing.md` apart.
364
364
 
365
365
  ```
366
366
  docs-db/
@@ -395,7 +395,7 @@ ask; the second call is the same question inside one part of the tree.
395
395
 
396
396
  ```
397
397
  zen rag docs search "how are rate limits counted"
398
- zen rag docs search --file "nsx_4.2.*/api/**" "rate limit for the users route"
398
+ zen rag docs search --file "acme_4.2.*/api/**" "rate limit for the users route"
399
399
  zen rag docs search --section "Rate limits" --kind table "requests per minute"
400
400
  zen rag docs search --mode text "X-RateLimit-Remaining"
401
401
  ```
@@ -83,12 +83,14 @@ run history. Ids look like `20260825-143012-a7f3`.
83
83
  .data/
84
84
  state.json the live, resumable state, rewritten after every run
85
85
  session.json when it was made, and the workspace it is rooted at
86
- memory/
87
86
  blobs/
88
87
  sandbox/home/ /home/agent inside the container
89
88
  .lock held while a run is in flight
90
89
  ```
91
90
 
91
+ Memory is **not** in here: the graph belongs to the project, at
92
+ `<project>/memory/`, so what one session learned is there for the next one.
93
+
92
94
  The recorded workspace is what makes resuming safe: a session that quietly
93
95
  changed what "the workspace" meant between turns would be unexplainable, so it
94
96
  is written once and reused.