myagentmemory 0.4.12 → 0.4.14
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 +118 -49
- package/dist/cli-spec.d.ts +25 -0
- package/dist/cli-spec.js +211 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +435 -71
- package/dist/completions.d.ts +13 -0
- package/dist/completions.js +429 -0
- package/dist/core.d.ts +22 -1
- package/dist/core.js +299 -62
- package/dist/hooks.d.ts +42 -0
- package/dist/hooks.js +444 -0
- package/dist/plugin-bootstrap.d.ts +190 -0
- package/dist/plugin-bootstrap.js +628 -0
- package/dist/plugin-host.d.ts +136 -0
- package/dist/plugin-host.js +98 -0
- package/dist/plugin-runtime.d.ts +21 -0
- package/dist/plugin-runtime.js +208 -0
- package/dist/plugin-service.d.ts +45 -0
- package/dist/plugin-service.js +395 -0
- package/docs/official-plugin-bootstrap.md +335 -0
- package/package.json +62 -11
- package/scripts/install-skills.sh +4 -1
- package/scripts/postinstall.cjs +23 -4
- package/src/cli-spec.ts +236 -0
- package/src/cli.ts +455 -82
- package/src/completions.ts +501 -0
- package/src/core.ts +314 -62
- package/src/hooks.ts +485 -0
- package/src/plugin-bootstrap.ts +931 -0
- package/src/plugin-host.ts +255 -0
- package/src/plugin-runtime.ts +296 -0
- package/src/plugin-service.ts +451 -0
- package/dist/agent-memory +0 -0
package/README.md
CHANGED
|
@@ -1,10 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AgentMemory
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Memory that survives the agent.** AgentMemory is a local, user-owned state layer for [Claude Code](https://claude.ai/code), [OpenAI Codex](https://github.com/openai/codex), [Cursor](https://cursor.com), and Agent (Cursor CLI). Keep scratch work, daily evidence, topic notes, and durable decisions as plain Markdown, then retrieve what matters with optional [qmd](https://github.com/tobi/qmd) search.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/myagentmemory)
|
|
6
|
+
[](https://www.npmjs.com/package/myagentmemory)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://jayzeng.github.io/agentmemory/)
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
[Website and quickstart](https://jayzeng.github.io/agentmemory/) · [Field report: lessons from 1,000+ coding-agent sessions](https://www.jayzeng.com/writing/agentmemory-field-report/) · [Install](#installation) · [CLI commands](#cli-commands) · [How it works](#how-it-works)
|
|
11
|
+
|
|
12
|
+
> **Field report:** “A session records what the agent did. Memory is a judgment about what the next agent should know.” Read [What 1000+ coding agent sessions taught me about LLM memory](https://www.jayzeng.com/writing/agentmemory-field-report/).
|
|
13
|
+
|
|
14
|
+
## Why AgentMemory?
|
|
15
|
+
|
|
16
|
+
Coding-agent sessions preserve activity. They do not decide which facts, decisions, and follow-ups should remain useful tomorrow. AgentMemory gives that accumulated state explicit lifetimes, a user-controlled home, and a path back into future work.
|
|
17
|
+
|
|
18
|
+
- **Different lifetimes and scopes** — route short-lived follow-ups, chronological evidence, continuing topics, and durable decisions to the right destination.
|
|
19
|
+
- **Curated continuity** — retain judgments that should affect future work instead of warehousing every transcript and abandoned path.
|
|
20
|
+
- **Plain Markdown, local-first** — read, edit, diff, back up, or delete every memory. No database, cloud service, or lock-in.
|
|
21
|
+
- **Optional retrieval** — skills load base context at session start and search related memories explicitly when a task needs them; qmd adds keyword, semantic, and hybrid search.
|
|
22
|
+
- **Shared across agents** — Claude Code, Codex, Cursor, and Agent can use the same store even as models and harnesses change.
|
|
23
|
+
- **Correctable state** — provenance, temporal status, secret screening, supersession, and forgetting help keep retained memory aligned with reality.
|
|
24
|
+
|
|
25
|
+
> **Naming:** `agentmemory` is the GitHub repo (and Homebrew tap), `myagentmemory` is the npm package, and `agent-memory` is the installed CLI binary. Also known as *coding agent memory* or *AI coding memory*.
|
|
26
|
+
|
|
27
|
+
### Product boundary
|
|
28
|
+
|
|
29
|
+
AgentMemory is free, open-source software under the MIT License. The core is a local Markdown store with a CLI, optional qmd search, and agent skills, and it remains fully usable without an account or commercial plugin. It does not automatically import every vendor transcript or silently decide what becomes durable. It is not a Python SDK, vector database, or knowledge graph. The Markdown files remain the source of truth.
|
|
30
|
+
|
|
31
|
+
### Optional official plugins
|
|
32
|
+
|
|
33
|
+
The MIT-licensed core can discover and host separately distributed, signed first-party plugins while remaining fully useful on its own. Optional plugins may use their own license and distribution terms; their implementation and browser assets are not part of the `myagentmemory` package. `agent-memory plugin list` and `plugin status` report local state. In an interactive terminal, `agent-memory plugin install` opens a nonce-bound loopback page for an email address, resumes the waiting command, verifies signed release metadata and the downloaded bundle, and installs atomically. This temporary beta grants unlimited local use. The email remains in a mode-0600 local activation record and is also sent with bounded activation metadata to the private commercial service; memory, sessions, queries, repository paths, IP addresses, and user-agent strings are not stored in the activation database. Authentication and payment will replace this temporary flow later. See the [official plugin bootstrap and host contract](docs/official-plugin-bootstrap.md).
|
|
8
34
|
|
|
9
35
|
## Installation
|
|
10
36
|
|
|
@@ -13,11 +39,11 @@ Long-term facts, daily logs, topic/event notes, and a scratchpad checklist store
|
|
|
13
39
|
brew tap jayzeng/agentmemory https://github.com/jayzeng/agentmemory
|
|
14
40
|
brew install jayzeng/agentmemory/agent-memory
|
|
15
41
|
|
|
16
|
-
# Install the CLI globally
|
|
42
|
+
# Install the portable CLI globally (Node.js 20+; macOS, Linux, or Windows)
|
|
17
43
|
npm install -g myagentmemory
|
|
18
44
|
|
|
19
|
-
# If
|
|
20
|
-
# npm config set
|
|
45
|
+
# If corporate TLS inspection requires a private CA, use your organization's CA file:
|
|
46
|
+
# npm config set cafile /path/to/corporate-ca.pem
|
|
21
47
|
|
|
22
48
|
# Or build from source
|
|
23
49
|
bun run build:cli
|
|
@@ -33,11 +59,9 @@ agent-memory install-skills
|
|
|
33
59
|
agent-memory uninstall-skills
|
|
34
60
|
```
|
|
35
61
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
If you're on Pi and prefer a native extension, use `pi-memory` (https://github.com/jayzeng/pi-memory) instead of installing this skill. The CLI + skill workflow here is the cross-platform alternative, and works fine on Pi without any extension.
|
|
62
|
+
The npm package installs a platform-neutral Node.js executable. The optional Homebrew and `build:cli` paths use a native binary built for the current platform.
|
|
39
63
|
|
|
40
|
-
|
|
64
|
+
`install-skills` writes a SKILL.md into each agent's config directory:
|
|
41
65
|
- `~/.claude/skills/agent-memory/SKILL.md` — Claude Code skill
|
|
42
66
|
- `~/.codex/skills/agent-memory/SKILL.md` — Codex skill
|
|
43
67
|
- `~/.cursor/skills/agent-memory/SKILL.md` — Cursor skill
|
|
@@ -47,6 +71,10 @@ This installs:
|
|
|
47
71
|
- `%USERPROFILE%\.cursor\skills\agent-memory\SKILL.md` — Cursor skill (Windows)
|
|
48
72
|
- `%USERPROFILE%\.agents\skills\agent-memory\SKILL.md` — Agent CLI skill (Windows)
|
|
49
73
|
|
|
74
|
+
### Pi users
|
|
75
|
+
|
|
76
|
+
If you're on Pi and prefer a native extension, use `pi-memory` (https://github.com/jayzeng/pi-memory) instead of installing this skill. The CLI + skill workflow here is the cross-platform alternative, and works fine on Pi without any extension.
|
|
77
|
+
|
|
50
78
|
### Optional: Enable search with qmd
|
|
51
79
|
|
|
52
80
|
When qmd is installed, the collection is automatically set up via `agent-memory init`.
|
|
@@ -62,25 +90,45 @@ qmd embed
|
|
|
62
90
|
|
|
63
91
|
Without qmd, all core tools (write/read/scratchpad) work normally. Only `memory_search` and selective injection require qmd.
|
|
64
92
|
|
|
65
|
-
##
|
|
93
|
+
## Memory lifecycle
|
|
94
|
+
|
|
95
|
+
AgentMemory implements a state lifecycle rather than a transcript archive. Scratch, daily, topic, and durable memory are destinations for different needs—not mandatory steps through which every entry must pass.
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Session / external evidence
|
|
99
|
+
│
|
|
100
|
+
▼
|
|
101
|
+
Extract, qualify, or discard
|
|
102
|
+
│
|
|
103
|
+
├── Scratch — short-lived follow-ups
|
|
104
|
+
├── Daily — chronological evidence
|
|
105
|
+
├── Topic — continuing threads
|
|
106
|
+
└── Durable — curated facts and decisions
|
|
107
|
+
│
|
|
108
|
+
▼
|
|
109
|
+
Retrieve · supersede · invalidate · forget
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The files are the current implementation of this lifecycle. The durable state remains useful even if the agent, model, harness, or optional retriever changes. The [field report](https://www.jayzeng.com/writing/agentmemory-field-report/) explains the evidence and design lessons behind it.
|
|
113
|
+
|
|
114
|
+
## Repository architecture
|
|
66
115
|
|
|
67
116
|
```
|
|
68
|
-
|
|
69
|
-
│ src/core.ts
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
│
|
|
77
|
-
│
|
|
78
|
-
│
|
|
79
|
-
│
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
`agent-memory` that invoke CLI
|
|
117
|
+
┌───────────────┐
|
|
118
|
+
│ src/core.ts │ ← all logic: paths, truncation, scratchpad,
|
|
119
|
+
└───────┬───────┘ context builder, qmd, tool functions
|
|
120
|
+
│
|
|
121
|
+
┌────┴─────┐
|
|
122
|
+
▼ ▼
|
|
123
|
+
┌─────────┐ ┌─────────────────────────┐
|
|
124
|
+
│ src/ │ │ skills/ │
|
|
125
|
+
│ cli.ts │ │ ├─ claude-code/SKILL.md │
|
|
126
|
+
│ │ │ ├─ codex/SKILL.md │
|
|
127
|
+
│ │ │ ├─ cursor/SKILL.md │
|
|
128
|
+
│ │ │ └─ agent/SKILL.md │
|
|
129
|
+
└─────────┘ └─────────────────────────┘
|
|
130
|
+
CLI command instruction files
|
|
131
|
+
`agent-memory` that invoke the CLI
|
|
84
132
|
```
|
|
85
133
|
|
|
86
134
|
The memory directory defaults to `~/.agent-memory/`. Override with `AGENT_MEMORY_DIR` env var or `--dir` flag.
|
|
@@ -89,15 +137,19 @@ The memory directory defaults to `~/.agent-memory/`. Override with `AGENT_MEMORY
|
|
|
89
137
|
|
|
90
138
|
| Command | Purpose |
|
|
91
139
|
|---------|---------|
|
|
92
|
-
| `agent-memory context [--no-search]` | Build
|
|
93
|
-
| `agent-memory write --target <long_term\|daily\|topic> --content <text> [--mode append\|overwrite] [--topic <name>] [--date YYYY-MM-DD]` | Write to memory files |
|
|
140
|
+
| `agent-memory context [--query <text>] [--no-search]` | Build context and optionally include qmd matches for a query |
|
|
141
|
+
| `agent-memory write --target <long_term\|daily\|topic> --content <text> [--mode append\|overwrite] [--source-uri <uri>] [--topic <name>] [--date YYYY-MM-DD]` | Write to memory files with optional provenance |
|
|
94
142
|
| `agent-memory read --target <long_term\|scratchpad\|daily\|list\|topic\|topics> [--date YYYY-MM-DD] [--topic <name>]` | Read memory files |
|
|
95
143
|
| `agent-memory scratchpad <add\|done\|undo\|clear_done\|list> [--text <text>]` | Manage checklist |
|
|
96
144
|
| `agent-memory search --query <text> [--mode keyword\|semantic\|deep] [--limit N]` | Search via qmd |
|
|
97
145
|
| `agent-memory install-skills` | Install bundled SKILL.md files into local agent directories |
|
|
98
146
|
| `agent-memory uninstall-skills` | Uninstall bundled SKILL.md files from local agent directories |
|
|
147
|
+
| `agent-memory completion [bash\|zsh\|fish\|powershell] [--stdout]` | Install or print shell completion |
|
|
148
|
+
| `agent-memory install-hooks [--yes] [--only <agents>]` | Install managed session-start memory hooks |
|
|
149
|
+
| `agent-memory uninstall-hooks [--only <agents>]` | Remove only hooks managed by AgentMemory |
|
|
99
150
|
| `agent-memory init` | Create dirs, detect qmd, setup collection |
|
|
100
151
|
| `agent-memory status` | Show config, qmd status, file counts |
|
|
152
|
+
| `agent-memory plugin <list\|status\|install\|update\|uninstall\|manage>` | Discover and manage optional signed first-party plugins |
|
|
101
153
|
|
|
102
154
|
Global flags: `--dir <path>` (override directory), `--json` (machine output)
|
|
103
155
|
|
|
@@ -115,14 +167,14 @@ If the first search doesn't find what you need, try rephrasing or switching mode
|
|
|
115
167
|
|
|
116
168
|
```
|
|
117
169
|
~/.agent-memory/
|
|
118
|
-
MEMORY.md
|
|
119
|
-
SCRATCHPAD.md
|
|
170
|
+
MEMORY.md # Curated long-term memory
|
|
171
|
+
SCRATCHPAD.md # Checklist of things to fix/remember
|
|
120
172
|
daily/
|
|
121
|
-
2026-02-15.md
|
|
173
|
+
2026-02-15.md # Daily append-only log
|
|
122
174
|
2026-02-14.md
|
|
123
175
|
...
|
|
124
176
|
topics/
|
|
125
|
-
auth.md
|
|
177
|
+
auth.md # Topic/event log linked back to daily entries
|
|
126
178
|
```
|
|
127
179
|
|
|
128
180
|
## Topic notes
|
|
@@ -139,25 +191,31 @@ agent-memory read --target topics
|
|
|
139
191
|
|
|
140
192
|
### Context injection
|
|
141
193
|
|
|
142
|
-
|
|
194
|
+
The context builder emits the following sections in priority order. Installed skills load base context at session start; callers can optionally supply `--query` to add relevant qmd results:
|
|
143
195
|
|
|
144
196
|
1. **Open scratchpad items** (up to 2K chars)
|
|
145
197
|
2. **Recent topic entries** (up to 2K chars) — most recent topic notes with backlinks
|
|
146
|
-
3. **Today's daily log** (up to 3K chars, tail)
|
|
198
|
+
3. **Today's daily log** (up to 3K chars, head + tail)
|
|
147
199
|
4. **Relevant memories via qmd search** (up to 2.5K chars) — searches using the user's current prompt to surface related past context
|
|
148
200
|
5. **MEMORY.md** (up to 4K chars, middle-truncated)
|
|
149
201
|
6. **Yesterday's daily log** (up to 3K chars, tail — lowest priority, trimmed first)
|
|
150
202
|
|
|
151
|
-
Total
|
|
203
|
+
Total output, including headings and truncation notices, is hard-capped at 16,000 characters. Explicitly untrusted, expired, superseded, revoked, or retired blocks are excluded; legacy secret-like values are redacted before injection. When qmd is unavailable, the relevant-memory step is skipped and the rest still works.
|
|
152
204
|
|
|
153
|
-
|
|
205
|
+
Claude Code loads base context through the skill's shell injection. Codex, Cursor, and Agent run the same base command at session start. The bundled skills use explicit search when a task relates to prior work; they make no host-level guarantee of automatic retrieval.
|
|
154
206
|
|
|
155
207
|
### Selective injection
|
|
156
208
|
|
|
157
|
-
When qmd is available, the
|
|
209
|
+
When qmd is available and `context --query` is supplied, the CLI sanitizes the query, limits it to 200 characters, and includes the top three keyword results with the standard context. Programmatic integrations should spawn the CLI with an argument array so query text is not evaluated by a shell.
|
|
158
210
|
|
|
159
211
|
The search has a 3-second timeout and fails silently. If qmd is down or the query returns nothing, injection falls back to the standard behavior.
|
|
160
212
|
|
|
213
|
+
### Provenance, temporal state, and secret screening
|
|
214
|
+
|
|
215
|
+
`write --source-uri <uri>` stores an addressable `Source:` line with the entry. Plain-Markdown compatibility is retained: complete write entries containing standalone header metadata lines such as `Trust: untrusted`, `Status: expired`, `Status: superseded`, `Status: revoked`, or `Status: retired` are kept on disk but omitted from direct, distilled, and auto-retrieved agent context. A standalone past `Valid until: YYYY-MM-DD` line is also honored. These phrases inside ordinary prose are not treated as metadata.
|
|
216
|
+
|
|
217
|
+
Writes screen a bounded set of high-confidence credential shapes and replace matching values with `[REDACTED_SECRET]` before persistence. Context rendering applies the same screening to legacy files. This is defense in depth, not a secrets vault; avoid passing real credentials in command arguments or memory content.
|
|
218
|
+
|
|
161
219
|
### Tags and links
|
|
162
220
|
|
|
163
221
|
Use `#tags` and `[[wiki-links]]` in memory content to improve searchability:
|
|
@@ -185,6 +243,7 @@ These are content conventions, not enforced metadata. qmd's full-text indexing m
|
|
|
185
243
|
|----------|--------|---------|-------------|
|
|
186
244
|
| `AGENT_MEMORY_DIR` | path | `~/.agent-memory` | Memory directory |
|
|
187
245
|
| `AGENT_MEMORY_QMD_UPDATE` | `background`, `manual`, `off` | `background` | Controls automatic `qmd update` after writes |
|
|
246
|
+
| `AGENT_MEMORY_PLUGIN_DIR` | path | `~/.agent-memory/system/plugins` | Machine-local official plugin installation root; independent of `AGENT_MEMORY_DIR` |
|
|
188
247
|
|
|
189
248
|
## Running tests
|
|
190
249
|
|
|
@@ -192,6 +251,14 @@ These are content conventions, not enforced metadata. qmd's full-text indexing m
|
|
|
192
251
|
# Unit tests (no LLM, no qmd — fast, deterministic)
|
|
193
252
|
bun test test/unit.test.ts
|
|
194
253
|
bun test test/cli.test.ts
|
|
254
|
+
|
|
255
|
+
# External-feedback dataset and deterministic capability probes
|
|
256
|
+
bun run build:eval
|
|
257
|
+
bun run test:eval
|
|
258
|
+
bun run eval:feedback
|
|
259
|
+
|
|
260
|
+
# Optional: add isolated live qmd multilingual retrieval probes
|
|
261
|
+
bun run eval:feedback --live-qmd
|
|
195
262
|
```
|
|
196
263
|
|
|
197
264
|
### Test levels
|
|
@@ -200,6 +267,7 @@ bun test test/cli.test.ts
|
|
|
200
267
|
|-------|------|-------------|---------------|
|
|
201
268
|
| Unit | `test/unit.test.ts` | None | Utilities, scratchpad parsing, context builder, qmd helpers, tool functions |
|
|
202
269
|
| CLI | `test/cli.test.ts` | None | CLI commands, subprocess integration |
|
|
270
|
+
| Feedback eval | `test/eval.test.ts`, `eval/` | qmd optional | External feedback, capability gaps, multilingual retrieval, and qualitative boundaries |
|
|
203
271
|
|
|
204
272
|
## Development
|
|
205
273
|
|
|
@@ -216,24 +284,25 @@ agent-memory install-skills
|
|
|
216
284
|
|
|
217
285
|
## Publishing (maintainers)
|
|
218
286
|
|
|
219
|
-
|
|
220
|
-
# Confirm package name is available
|
|
221
|
-
npm view agent-memory
|
|
287
|
+
Publication is tag-driven through `.github/workflows/publish-npm.yml`. Configure `jayzeng/agentmemory` and `publish-npm.yml` as the npm trusted publisher for `myagentmemory`, merge a versioned changelog/package update, and push the matching `v<version>` tag. The workflow uses short-lived OIDC credentials, runs the complete release gate, and publishes the public package with provenance. Do not publish this package from the private plugin workspace.
|
|
222
288
|
|
|
223
|
-
|
|
224
|
-
npm version patch
|
|
289
|
+
### Repository assets (maintainers)
|
|
225
290
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
291
|
+
- **Social preview image:** `.github/assets/social-preview.png` (1280×640)
|
|
292
|
+
- **Release notes template:** `.github/release.yml` (used by GitHub auto-generated release notes)
|
|
293
|
+
- **Landing page source:** `docs/index.html` (deployed by `.github/workflows/deploy-pages.yml`)
|
|
294
|
+
|
|
295
|
+
## Acknowledgments
|
|
296
|
+
|
|
297
|
+
Inspired by [skyfallsin/pi-mem](https://github.com/skyfallsin/pi-mem). Semantic search is powered by [qmd](https://github.com/tobi/qmd).
|
|
229
298
|
|
|
230
299
|
## Changelog
|
|
231
300
|
|
|
232
|
-
### 0.
|
|
301
|
+
### 0.4.12
|
|
233
302
|
|
|
234
303
|
- **Removed pi extension**: Removed `index.ts` and all pi-specific code (`@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`, `@sinclair/typebox` peer dependencies).
|
|
235
304
|
- **Standalone tool functions**: Extracted `memoryWrite()`, `memoryRead()`, `scratchpadAction()`, `memorySearch()` into `src/core.ts` as standalone functions usable without any framework.
|
|
236
|
-
- **Renamed package**: `pi-memory` → `agent-memory`.
|
|
305
|
+
- **Renamed package**: `pi-memory` → `myagentmemory` (npm); the CLI binary is `agent-memory`.
|
|
237
306
|
- **Renamed env var**: `PI_MEMORY_QMD_UPDATE` → `AGENT_MEMORY_QMD_UPDATE` (old name still works as fallback).
|
|
238
307
|
- **Default memory directory**: Now always `~/.agent-memory/`.
|
|
239
308
|
- **Removed pi-specific tests**: Deleted `test/e2e.ts`, `test/eval-recall.ts`, `test/unit.ts`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type CliValueKind = "directory" | "file" | "number" | "value";
|
|
2
|
+
export interface CliOptionSpec {
|
|
3
|
+
description: string;
|
|
4
|
+
value?: {
|
|
5
|
+
label: string;
|
|
6
|
+
kind: CliValueKind;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const COMMANDS: readonly ["context", "write", "read", "scratchpad", "search", "distil", "sync", "init", "status", "install-skills", "uninstall-skills", "install-hooks", "uninstall-hooks", "completion", "plugin", "version", "help"];
|
|
10
|
+
export declare const PLUGIN_COMMANDS: readonly ["list", "status", "install", "update", "uninstall", "manage"];
|
|
11
|
+
export declare const WORKER_ACTIONS: readonly [];
|
|
12
|
+
export declare const SCRATCHPAD_ACTIONS: readonly ["add", "done", "undo", "clear_done", "list"];
|
|
13
|
+
export declare const COMMAND_DESCRIPTIONS: Record<(typeof COMMANDS)[number], string>;
|
|
14
|
+
export declare const PLUGIN_COMMAND_DESCRIPTIONS: Record<(typeof PLUGIN_COMMANDS)[number], string>;
|
|
15
|
+
export declare const WORKER_ACTION_DESCRIPTIONS: Record<(typeof WORKER_ACTIONS)[number], string>;
|
|
16
|
+
export declare const SCRATCHPAD_ACTION_DESCRIPTIONS: Record<(typeof SCRATCHPAD_ACTIONS)[number], string>;
|
|
17
|
+
export declare const GLOBAL_OPTIONS: readonly ["--dir", "--json", "--help", "--version", "-h", "-V"];
|
|
18
|
+
export declare const COMMAND_OPTIONS: Record<string, readonly string[]>;
|
|
19
|
+
export declare const PLUGIN_COMMAND_OPTIONS: Record<string, readonly string[]>;
|
|
20
|
+
export declare const WORKER_ACTION_OPTIONS: Record<string, readonly string[]>;
|
|
21
|
+
export declare const SCRATCHPAD_ACTION_OPTIONS: Record<string, readonly string[]>;
|
|
22
|
+
export declare const OPTION_SPECS: Record<string, CliOptionSpec>;
|
|
23
|
+
export declare const SHELL_DESCRIPTIONS: Record<string, string>;
|
|
24
|
+
export declare function optionDescription(option: string): string;
|
|
25
|
+
export declare function optionTakesValue(option: string): boolean;
|
package/dist/cli-spec.js
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export const COMMANDS = [
|
|
2
|
+
"context",
|
|
3
|
+
"write",
|
|
4
|
+
"read",
|
|
5
|
+
"scratchpad",
|
|
6
|
+
"search",
|
|
7
|
+
"distil",
|
|
8
|
+
"sync",
|
|
9
|
+
"init",
|
|
10
|
+
"status",
|
|
11
|
+
"install-skills",
|
|
12
|
+
"uninstall-skills",
|
|
13
|
+
"install-hooks",
|
|
14
|
+
"uninstall-hooks",
|
|
15
|
+
"completion",
|
|
16
|
+
"plugin",
|
|
17
|
+
"version",
|
|
18
|
+
"help",
|
|
19
|
+
];
|
|
20
|
+
export const PLUGIN_COMMANDS = ["list", "status", "install", "update", "uninstall", "manage"];
|
|
21
|
+
export const WORKER_ACTIONS = [];
|
|
22
|
+
export const SCRATCHPAD_ACTIONS = ["add", "done", "undo", "clear_done", "list"];
|
|
23
|
+
export const COMMAND_DESCRIPTIONS = {
|
|
24
|
+
context: "build context from scratchpad, logs, topics, and long-term memory",
|
|
25
|
+
write: "append or overwrite a daily, topic, or long-term memory entry",
|
|
26
|
+
read: "read daily, topic, scratchpad, or long-term memory",
|
|
27
|
+
scratchpad: "add, complete, reopen, list, or clear persistent checklist items",
|
|
28
|
+
search: "search indexed memory with keyword, semantic, or deep qmd modes",
|
|
29
|
+
distil: "rebuild a compact MEMORY.md index from logs and topics",
|
|
30
|
+
sync: "update the qmd index and semantic embeddings",
|
|
31
|
+
init: "create memory storage and configure qmd when available",
|
|
32
|
+
status: "show memory paths, file counts, qmd, and embedding health",
|
|
33
|
+
"install-skills": "install core instructions for detected agents",
|
|
34
|
+
"uninstall-skills": "remove core instructions from detected agents",
|
|
35
|
+
"install-hooks": "install automatic SessionStart indexing and context hooks",
|
|
36
|
+
"uninstall-hooks": "remove only SessionStart hooks managed by agent-memory",
|
|
37
|
+
completion: "install or print Bash, Zsh, Fish, or PowerShell completion",
|
|
38
|
+
plugin: "index, recall, learn from, and evaluate prior agent sessions",
|
|
39
|
+
version: "print the installed agent-memory version",
|
|
40
|
+
help: "show top-level, command, or nested plugin help",
|
|
41
|
+
};
|
|
42
|
+
export const PLUGIN_COMMAND_DESCRIPTIONS = {
|
|
43
|
+
list: "list optional official plugins and local availability",
|
|
44
|
+
status: "show the installed bundle and entitlement state",
|
|
45
|
+
install: "authenticate if needed, then install or upgrade the official bundle",
|
|
46
|
+
update: "upgrade an existing official bundle when a compatible release exists",
|
|
47
|
+
uninstall: "remove official plugin executables while preserving user data",
|
|
48
|
+
manage: "open the AgentMemory account and billing website",
|
|
49
|
+
};
|
|
50
|
+
export const WORKER_ACTION_DESCRIPTIONS = {};
|
|
51
|
+
export const SCRATCHPAD_ACTION_DESCRIPTIONS = {
|
|
52
|
+
add: "add a new open checklist item; requires --text",
|
|
53
|
+
done: "complete the first open substring match; requires --text",
|
|
54
|
+
undo: "reopen the first completed substring match; requires --text",
|
|
55
|
+
clear_done: "remove every completed checklist item",
|
|
56
|
+
list: "show checklist items and completion counts",
|
|
57
|
+
};
|
|
58
|
+
export const GLOBAL_OPTIONS = ["--dir", "--json", "--help", "--version", "-h", "-V"];
|
|
59
|
+
export const COMMAND_OPTIONS = {
|
|
60
|
+
context: ["--query", "--no-search"],
|
|
61
|
+
write: ["--content", "--target", "--mode", "--topic", "--date", "--source-uri"],
|
|
62
|
+
read: ["--target", "--date", "--topic"],
|
|
63
|
+
scratchpad: ["--text"],
|
|
64
|
+
search: ["--query", "--mode", "--limit"],
|
|
65
|
+
distil: ["--dry-run"],
|
|
66
|
+
sync: [],
|
|
67
|
+
init: [],
|
|
68
|
+
status: ["--probe"],
|
|
69
|
+
"install-skills": [],
|
|
70
|
+
"uninstall-skills": [],
|
|
71
|
+
"install-hooks": ["--yes", "--all", "--only"],
|
|
72
|
+
"uninstall-hooks": ["--only"],
|
|
73
|
+
completion: ["--stdout"],
|
|
74
|
+
version: [],
|
|
75
|
+
help: [],
|
|
76
|
+
};
|
|
77
|
+
export const PLUGIN_COMMAND_OPTIONS = {
|
|
78
|
+
list: [],
|
|
79
|
+
status: ["--channel"],
|
|
80
|
+
install: ["--channel", "--no-browser", "--yes"],
|
|
81
|
+
update: ["--channel"],
|
|
82
|
+
uninstall: ["--yes"],
|
|
83
|
+
manage: ["--no-browser"],
|
|
84
|
+
};
|
|
85
|
+
export const WORKER_ACTION_OPTIONS = {};
|
|
86
|
+
export const SCRATCHPAD_ACTION_OPTIONS = {
|
|
87
|
+
add: ["--text"],
|
|
88
|
+
done: ["--text"],
|
|
89
|
+
undo: ["--text"],
|
|
90
|
+
clear_done: [],
|
|
91
|
+
list: [],
|
|
92
|
+
};
|
|
93
|
+
export const OPTION_SPECS = {
|
|
94
|
+
"--dir": { description: "override the active memory directory", value: { label: "directory", kind: "directory" } },
|
|
95
|
+
"--json": { description: "emit command-specific structured JSON" },
|
|
96
|
+
"--help": { description: "show help for the selected command" },
|
|
97
|
+
"--version": { description: "print the installed version and exit" },
|
|
98
|
+
"-h": { description: "show help for the selected command" },
|
|
99
|
+
"-V": { description: "print the installed version and exit" },
|
|
100
|
+
"--query": { description: "memory search or context-retrieval query", value: { label: "text", kind: "value" } },
|
|
101
|
+
"--no-search": { description: "build context without invoking qmd" },
|
|
102
|
+
"--content": { description: "memory entry content to persist", value: { label: "text", kind: "value" } },
|
|
103
|
+
"--target": { description: "memory destination or collection to read", value: { label: "target", kind: "value" } },
|
|
104
|
+
"--mode": { description: "write behavior or qmd search strategy", value: { label: "mode", kind: "value" } },
|
|
105
|
+
"--topic": { description: "topic name used to resolve a topic file", value: { label: "name", kind: "value" } },
|
|
106
|
+
"--date": { description: "daily-log date in YYYY-MM-DD form", value: { label: "date", kind: "value" } },
|
|
107
|
+
"--source-uri": {
|
|
108
|
+
description: "optional provenance URI stored with an entry",
|
|
109
|
+
value: { label: "uri", kind: "value" },
|
|
110
|
+
},
|
|
111
|
+
"--text": { description: "checklist item text or substring to match", value: { label: "text", kind: "value" } },
|
|
112
|
+
"--limit": { description: "maximum number of search or recall results", value: { label: "number", kind: "number" } },
|
|
113
|
+
"--dry-run": { description: "preview generated memory without writing MEMORY.md" },
|
|
114
|
+
"--probe": { description: "run a live semantic query to verify embeddings" },
|
|
115
|
+
"--since": { description: "metrics reporting window in days", value: { label: "days", kind: "number" } },
|
|
116
|
+
"--port": {
|
|
117
|
+
description: "web-console port; use 0 to select an available port",
|
|
118
|
+
value: { label: "number", kind: "number" },
|
|
119
|
+
},
|
|
120
|
+
"--state": { description: "override the plugin state root", value: { label: "directory", kind: "directory" } },
|
|
121
|
+
"--with-plugin": { description: "include both the core and optional plugin skills" },
|
|
122
|
+
"--plugin-only": { description: "operate only on the optional plugin skill" },
|
|
123
|
+
"--yes": { description: "apply eligible hook changes without confirmation" },
|
|
124
|
+
"--all": { description: "apply eligible hook changes without confirmation" },
|
|
125
|
+
"--only": {
|
|
126
|
+
description: "restrict hook changes to comma-separated agent keys",
|
|
127
|
+
value: { label: "agents", kind: "value" },
|
|
128
|
+
},
|
|
129
|
+
"--stdout": { description: "print the completion script without installing it" },
|
|
130
|
+
"--channel": {
|
|
131
|
+
description: "select the official release channel",
|
|
132
|
+
value: { label: "channel", kind: "value" },
|
|
133
|
+
},
|
|
134
|
+
"--no-browser": { description: "print account URLs instead of opening a browser" },
|
|
135
|
+
"--scope": {
|
|
136
|
+
description: "search globally or only in the current workspace",
|
|
137
|
+
value: { label: "scope", kind: "value" },
|
|
138
|
+
},
|
|
139
|
+
"--cwd": {
|
|
140
|
+
description: "restrict session operations to a working directory",
|
|
141
|
+
value: { label: "directory", kind: "directory" },
|
|
142
|
+
},
|
|
143
|
+
"--context": {
|
|
144
|
+
description: "surrounding events included with each recall hit",
|
|
145
|
+
value: { label: "number", kind: "number" },
|
|
146
|
+
},
|
|
147
|
+
"--pi": { description: "override the Pi session root", value: { label: "directory", kind: "directory" } },
|
|
148
|
+
"--codex": { description: "override the Codex session root", value: { label: "directory", kind: "directory" } },
|
|
149
|
+
"--claude": {
|
|
150
|
+
description: "override the Claude Code session root",
|
|
151
|
+
value: { label: "directory", kind: "directory" },
|
|
152
|
+
},
|
|
153
|
+
"--host": {
|
|
154
|
+
description: "session host (pi/codex/claude) or web loopback bind address",
|
|
155
|
+
value: { label: "host", kind: "value" },
|
|
156
|
+
},
|
|
157
|
+
"--max-per-host": {
|
|
158
|
+
description: "maximum session files read from each host",
|
|
159
|
+
value: { label: "number", kind: "number" },
|
|
160
|
+
},
|
|
161
|
+
"--recent": {
|
|
162
|
+
description: "most recently modified session files refreshed per host",
|
|
163
|
+
value: { label: "number", kind: "number" },
|
|
164
|
+
},
|
|
165
|
+
"--interval": {
|
|
166
|
+
description: "watch polling interval in milliseconds",
|
|
167
|
+
value: { label: "milliseconds", kind: "number" },
|
|
168
|
+
},
|
|
169
|
+
"--once": { description: "run one watch iteration and exit" },
|
|
170
|
+
"--lines": {
|
|
171
|
+
description: "number of recent worker log entries to return",
|
|
172
|
+
value: { label: "number", kind: "number" },
|
|
173
|
+
},
|
|
174
|
+
"--threshold": {
|
|
175
|
+
description: "minimum repeated evidence required for a candidate",
|
|
176
|
+
value: { label: "number", kind: "number" },
|
|
177
|
+
},
|
|
178
|
+
"--output": { description: "also write the report to this file", value: { label: "file", kind: "file" } },
|
|
179
|
+
"--replay": { description: "back up and rebuild derived learning layers" },
|
|
180
|
+
"--journal": {
|
|
181
|
+
description: "override the experience journal directory",
|
|
182
|
+
value: { label: "directory", kind: "directory" },
|
|
183
|
+
},
|
|
184
|
+
"--candidates-dir": {
|
|
185
|
+
description: "override the candidate ledger directory",
|
|
186
|
+
value: { label: "directory", kind: "directory" },
|
|
187
|
+
},
|
|
188
|
+
"--decisions-dir": {
|
|
189
|
+
description: "override the decision ledger directory",
|
|
190
|
+
value: { label: "directory", kind: "directory" },
|
|
191
|
+
},
|
|
192
|
+
"--auto-dir": {
|
|
193
|
+
description: "override the materialized auto-memory directory",
|
|
194
|
+
value: { label: "directory", kind: "directory" },
|
|
195
|
+
},
|
|
196
|
+
"--agent": { description: "internal SessionStart host key", value: { label: "agent", kind: "value" } },
|
|
197
|
+
"--token": { description: "internal session-worker lease token", value: { label: "token", kind: "value" } },
|
|
198
|
+
"--uninstall": { description: "use install-skills compatibility uninstall mode" },
|
|
199
|
+
};
|
|
200
|
+
export const SHELL_DESCRIPTIONS = {
|
|
201
|
+
bash: "generate or install Bash completion",
|
|
202
|
+
zsh: "generate or install Zsh completion",
|
|
203
|
+
fish: "generate or install Fish completion",
|
|
204
|
+
powershell: "generate or install PowerShell completion",
|
|
205
|
+
};
|
|
206
|
+
export function optionDescription(option) {
|
|
207
|
+
return OPTION_SPECS[option]?.description ?? option;
|
|
208
|
+
}
|
|
209
|
+
export function optionTakesValue(option) {
|
|
210
|
+
return OPTION_SPECS[option]?.value !== undefined;
|
|
211
|
+
}
|
package/dist/cli.d.ts
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
* search — Search via qmd
|
|
13
13
|
* init — Create dirs, detect qmd, setup collection
|
|
14
14
|
* status — Show config, qmd status, file counts
|
|
15
|
+
* completion — Install or print shell completion
|
|
16
|
+
* install-hooks — Install managed session-start hooks
|
|
17
|
+
* uninstall-hooks — Remove managed session-start hooks
|
|
18
|
+
* plugin — Discover and bootstrap optional official plugins
|
|
15
19
|
*
|
|
16
20
|
* Global flags:
|
|
17
21
|
* --dir <path> Override memory directory
|