@vib795/agent-memory 0.1.10 → 0.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.
- package/HOWTO.md +42 -10
- package/README.md +122 -13
- package/package.json +5 -1
- package/uninstall.ps1 +54 -0
- package/uninstall.sh +39 -0
- package/update.ps1 +45 -0
- package/update.sh +26 -0
package/HOWTO.md
CHANGED
|
@@ -236,16 +236,17 @@ Prompt files are copies, not links, so they do not update themselves.
|
|
|
236
236
|
|
|
237
237
|
### GitHub Copilot CLI
|
|
238
238
|
|
|
239
|
-
**
|
|
239
|
+
**Supported.** `setup` installs the three skills into `~/.copilot/skills/<name>/`, and
|
|
240
|
+
they appear as `/handoff`, `/remember` and `/recall`.
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
GitHub documents two personal skill directories, `~/.copilot/skills` and
|
|
243
|
+
`~/.agents/skills`, and Copilot reads both. The shared one is always written, so
|
|
244
|
+
Copilot is served even on a machine that has never run the CLI; the `.copilot` one is
|
|
245
|
+
written as well when that directory exists, so a machine that has run it keeps its
|
|
246
|
+
skills where its own documentation says to look.
|
|
244
247
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
per repository — which is the exact problem this package exists to solve everywhere
|
|
248
|
-
else.
|
|
248
|
+
Earlier versions of this guide said Copilot CLI was unsupported. That was true when it
|
|
249
|
+
was written and stopped being true in 0.1.5.
|
|
249
250
|
|
|
250
251
|
---
|
|
251
252
|
|
|
@@ -326,9 +327,40 @@ agent-memory doctor
|
|
|
326
327
|
|
|
327
328
|
---
|
|
328
329
|
|
|
329
|
-
## 12.
|
|
330
|
+
## 12. Updating it
|
|
330
331
|
|
|
331
|
-
**
|
|
332
|
+
**Installed from npm:**
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
npm install -g @vib795/agent-memory@latest
|
|
336
|
+
agent-memory setup
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
The second line is not optional. Prompt files are copies rather than links, so VS Code
|
|
340
|
+
keeps reading the old text until something rewrites them, and nothing warns you.
|
|
341
|
+
|
|
342
|
+
**Installed from a clone** — one command, which pulls and re-runs the installer:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
./update.sh # macOS / Linux
|
|
346
|
+
powershell -ExecutionPolicy Bypass -File .\update.ps1 # Windows
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Both finish with `agent-memory doctor`, so you find out straight away if a tool was
|
|
350
|
+
left holding stale files. Your notes are never touched by an upgrade.
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## 13. Removing it
|
|
355
|
+
|
|
356
|
+
**One command, which does the two steps in the order that works:**
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
./uninstall.sh # macOS / Linux
|
|
360
|
+
powershell -ExecutionPolicy Bypass -File .\uninstall.ps1 # Windows
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Or by hand. The order matters, and npm will not do it for you:**
|
|
332
364
|
|
|
333
365
|
```bash
|
|
334
366
|
agent-memory uninstall # first — this removes the commands from your tools
|
package/README.md
CHANGED
|
@@ -322,32 +322,111 @@ A transcript summary reads fine and still leaves the next agent asking questions
|
|
|
322
322
|
|
|
323
323
|
## Use
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
Three commands, two different jobs. You type the slash command in your agent; the
|
|
326
|
+
agent runs the CLI. The terminal equivalents are shown so you can see what it did,
|
|
327
|
+
and drive it by hand when you want to.
|
|
326
328
|
|
|
327
|
-
|
|
329
|
+
### `/remember` — keep what stays true
|
|
330
|
+
|
|
331
|
+
Mid-session, when something worth keeping has been established:
|
|
328
332
|
|
|
329
333
|
```
|
|
330
|
-
/
|
|
334
|
+
/remember
|
|
335
|
+
/remember the retry policy on the orders webhook
|
|
331
336
|
```
|
|
332
337
|
|
|
333
|
-
|
|
338
|
+
Bare, it selects the durable knowledge itself. With an argument, it writes that and
|
|
339
|
+
nothing else. Either way it makes one terminal call, and `write` reports each id:
|
|
334
340
|
|
|
335
341
|
```
|
|
336
|
-
|
|
342
|
+
created auth-service [system]
|
|
343
|
+
created use-sessions [decision]
|
|
344
|
+
warning: use-sessions: redacted 1x github-token
|
|
337
345
|
```
|
|
338
346
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
347
|
+
That warning is the redactor firing before anything reached disk. The skill then
|
|
348
|
+
repeats the list back to you with titles attached, so you can see what was captured
|
|
349
|
+
without opening the files.
|
|
342
350
|
|
|
351
|
+
What it ran, which you can run yourself:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
agent-memory write --from-json - --source remember <<'JSON'
|
|
355
|
+
{"nodes":[
|
|
356
|
+
{"id":"use-sessions","type":"decision",
|
|
357
|
+
"title":"Chose server sessions over JWT",
|
|
358
|
+
"body":"Why: revocation had to take effect immediately.\nRejected: short-TTL JWT, because logout would lag by the TTL.\nImplemented in src/auth/session.js:42.",
|
|
359
|
+
"edges":[{"rel":"evidence-for","dst":"auth-service"}]}
|
|
360
|
+
]}
|
|
361
|
+
JSON
|
|
343
362
|
```
|
|
344
|
-
|
|
345
|
-
|
|
363
|
+
|
|
364
|
+
### `/recall` — answer from memory before deriving again
|
|
365
|
+
|
|
366
|
+
You rarely type this one. Ask a question memory should already answer and the agent
|
|
367
|
+
invokes it on its own, because the skill description advertises what is in the store:
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
Why do we use sessions instead of JWT here?
|
|
371
|
+
/recall the auth decision
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
It reads the routing map first, then pulls only the notes it needs:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
agent-memory tree # what exists, scoped to this repo
|
|
378
|
+
agent-memory get use-sessions --depth 1 # that note plus its neighbourhood
|
|
379
|
+
agent-memory search "session revocation" # full text, when the tree misses
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
A note that is still current prints clean, with its edges:
|
|
383
|
+
|
|
346
384
|
```
|
|
385
|
+
## use-sessions [decision] depth 0
|
|
386
|
+
Chose server sessions over JWT
|
|
347
387
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
388
|
+
Why: revocation had to take effect immediately.
|
|
389
|
+
|
|
390
|
+
-> evidence-for auth-service
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Once the code has moved on underneath it, the same note arrives carrying the warning.
|
|
394
|
+
This is the part that keeps the store honest:
|
|
395
|
+
|
|
396
|
+
```
|
|
397
|
+
## use-sessions [decision] depth 0 [captured 47 commits ago — verify before trusting]
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### `/handoff` — move a thread to another window
|
|
401
|
+
|
|
402
|
+
In window A:
|
|
403
|
+
|
|
404
|
+
```
|
|
405
|
+
/handoff
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
It writes the working-state file and prints a pickup line. In window B, any repo,
|
|
409
|
+
paste it:
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
Read ~/.agents/handoffs/migrate-orders-to-result-type.md and continue this work. Follow the Next action.
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
`/handoff` also writes durable knowledge into the graph in the same request — same
|
|
416
|
+
turn, no extra request charged. To see what it produced:
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
ls ~/.agents/handoffs/ # index.md, <thread>.md, one <thread>.prev.md
|
|
420
|
+
agent-memory tree # the nodes it captured on the way past
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Housekeeping
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
agent-memory doctor # after install, after an upgrade, when something looks off
|
|
427
|
+
agent-memory compact # dedup, decay, regenerate the routing digest
|
|
428
|
+
agent-memory tree --repo # every repo, not just this one
|
|
429
|
+
```
|
|
351
430
|
|
|
352
431
|
## Where things live
|
|
353
432
|
|
|
@@ -398,10 +477,40 @@ What is deliberately unproven, and where you will find out: the cold-read test
|
|
|
398
477
|
fresh chat in a repo untouched for a month, answering correctly from the digest
|
|
399
478
|
alone. That needs real elapsed time and cannot be faked in a test suite.
|
|
400
479
|
|
|
480
|
+
## Update
|
|
481
|
+
|
|
482
|
+
An upgrade is not finished until `setup` has run again. Prompt files are copies
|
|
483
|
+
rather than links, so an editor keeps reading the old text until something rewrites
|
|
484
|
+
them, and nothing warns you.
|
|
485
|
+
|
|
486
|
+
**Installed from npm:**
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
npm install -g @vib795/agent-memory@latest
|
|
490
|
+
agent-memory setup
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**Installed from a clone** — one command, which pulls and re-runs the installer:
|
|
494
|
+
|
|
495
|
+
```bash
|
|
496
|
+
./update.sh # macOS / Linux
|
|
497
|
+
powershell -ExecutionPolicy Bypass -File .\update.ps1 # Windows
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
Both end in `agent-memory doctor`, so you find out immediately if an agent was left
|
|
501
|
+
holding stale files. Your notes are never touched by an upgrade.
|
|
502
|
+
|
|
401
503
|
## Uninstall
|
|
402
504
|
|
|
403
505
|
Order matters, and npm will not do it for you:
|
|
404
506
|
|
|
507
|
+
```bash
|
|
508
|
+
./uninstall.sh # macOS / Linux
|
|
509
|
+
powershell -ExecutionPolicy Bypass -File .\uninstall.ps1 # Windows
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Or by hand, which is the same two steps in the same order:
|
|
513
|
+
|
|
405
514
|
```bash
|
|
406
515
|
agent-memory uninstall # first — removes every skill link and prompt file
|
|
407
516
|
npm uninstall -g @vib795/agent-memory
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vib795/agent-memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Durable cross-repo knowledge graph for GitHub Copilot and Claude Code. Markdown source of truth, disposable SQLite index, zero runtime dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-copilot",
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"skills/",
|
|
37
37
|
"install.sh",
|
|
38
38
|
"install.ps1",
|
|
39
|
+
"update.sh",
|
|
40
|
+
"update.ps1",
|
|
41
|
+
"uninstall.sh",
|
|
42
|
+
"uninstall.ps1",
|
|
39
43
|
"README.md",
|
|
40
44
|
"HOWTO.md",
|
|
41
45
|
"LICENSE"
|
package/uninstall.ps1
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Removes the skills and the CLI, in the order that is recoverable.
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
npm will not enforce that order and gets it wrong on its own: `npm uninstall -g`
|
|
7
|
+
deletes the package and leaves one link per skill per agent pointing at nothing,
|
|
8
|
+
which every one of those agents still tries to load. By then the binary that would
|
|
9
|
+
have cleaned them up is gone too, so tooling cannot fix it. This unlinks first and
|
|
10
|
+
removes the package second.
|
|
11
|
+
|
|
12
|
+
Your notes are never touched. They are plain markdown under
|
|
13
|
+
%USERPROFILE%\.agents\memory, they outlive the tool that indexed them, and removing
|
|
14
|
+
them is your call, not this script's.
|
|
15
|
+
|
|
16
|
+
.EXAMPLE
|
|
17
|
+
powershell -ExecutionPolicy Bypass -File .\uninstall.ps1
|
|
18
|
+
#>
|
|
19
|
+
|
|
20
|
+
# Not 'Stop': a half-finished uninstall is worse than a reported failure, so each step
|
|
21
|
+
# is allowed to fail and say so.
|
|
22
|
+
$ErrorActionPreference = 'Continue'
|
|
23
|
+
|
|
24
|
+
$source = $PSScriptRoot
|
|
25
|
+
|
|
26
|
+
$node = Get-Command node -ErrorAction SilentlyContinue
|
|
27
|
+
if (-not $node) {
|
|
28
|
+
Write-Error "node not found on PATH. agent-memory needs Node >= 22.5."
|
|
29
|
+
exit 1
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Write-Host "Removing skills" -ForegroundColor Cyan
|
|
33
|
+
# Run from the checkout rather than the installed binary, so this still works when the
|
|
34
|
+
# global package is already gone.
|
|
35
|
+
& node (Join-Path $source 'src\cli.js') uninstall
|
|
36
|
+
|
|
37
|
+
Write-Host ""
|
|
38
|
+
Write-Host "Removing the CLI" -ForegroundColor Cyan
|
|
39
|
+
try {
|
|
40
|
+
& npm uninstall -g '@vib795/agent-memory' 2>&1 | Out-Null
|
|
41
|
+
$npmExit = $LASTEXITCODE
|
|
42
|
+
} catch {
|
|
43
|
+
$npmExit = 1
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if ($npmExit -eq 0) {
|
|
47
|
+
Write-Host " [npm] package removed" -ForegroundColor Green
|
|
48
|
+
} else {
|
|
49
|
+
Write-Host " [npm] not removed. It may not be installed globally:" -ForegroundColor Yellow
|
|
50
|
+
Write-Host " npm uninstall -g `"@vib795/agent-memory`"" -ForegroundColor Yellow
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Write-Host ""
|
|
54
|
+
Write-Host "Done. Your notes are untouched." -ForegroundColor Cyan
|
package/uninstall.sh
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Removes the skills and the CLI, in the order that is recoverable.
|
|
3
|
+
#
|
|
4
|
+
# npm will not enforce that order and gets it wrong on its own: `npm uninstall -g`
|
|
5
|
+
# deletes the package and leaves one link per skill per agent pointing at nothing,
|
|
6
|
+
# which every one of those agents still tries to load. By then the binary that would
|
|
7
|
+
# have cleaned them up is gone too, so tooling cannot fix it. Unlink first, remove
|
|
8
|
+
# the package second.
|
|
9
|
+
#
|
|
10
|
+
# Your notes are never touched. They are plain markdown under ~/.agents/memory, they
|
|
11
|
+
# outlive the tool that indexed them, and removing them is your call, not this script's.
|
|
12
|
+
#
|
|
13
|
+
# No `set -e`: a half-finished uninstall is worse than a reported failure, so each
|
|
14
|
+
# step is allowed to fail and say so.
|
|
15
|
+
set -uo pipefail
|
|
16
|
+
|
|
17
|
+
source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
18
|
+
|
|
19
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
20
|
+
echo "node not found on PATH. agent-memory needs Node >= 22.5." >&2
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
echo "Removing skills"
|
|
25
|
+
# Run from the checkout rather than the installed binary, so this still works when
|
|
26
|
+
# the global package is already gone.
|
|
27
|
+
node "$source_dir/src/cli.js" uninstall
|
|
28
|
+
|
|
29
|
+
echo
|
|
30
|
+
echo "Removing the CLI"
|
|
31
|
+
if npm uninstall -g @vib795/agent-memory >/dev/null 2>&1; then
|
|
32
|
+
echo " [npm] package removed"
|
|
33
|
+
else
|
|
34
|
+
echo " [npm] not removed. It may not be installed globally, or may need sudo:"
|
|
35
|
+
echo " npm uninstall -g @vib795/agent-memory"
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
echo
|
|
39
|
+
echo "Done. Your notes are untouched at ${AGENT_MEMORY_HOME:-$HOME/.agents/memory}."
|
package/update.ps1
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Updates a clone install: pull, then re-run the installer.
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
The install logic is deliberately not repeated here. install.ps1 already relinks the
|
|
7
|
+
skills, relinks the CLI and runs doctor; an update is exactly that plus a pull, and
|
|
8
|
+
writing it a second time is how the two drift.
|
|
9
|
+
|
|
10
|
+
Re-running setup is not optional on an upgrade. Prompt files are copies rather than
|
|
11
|
+
links, so VS Code keeps reading the old text until something rewrites it.
|
|
12
|
+
|
|
13
|
+
.EXAMPLE
|
|
14
|
+
powershell -ExecutionPolicy Bypass -File .\update.ps1
|
|
15
|
+
#>
|
|
16
|
+
|
|
17
|
+
$ErrorActionPreference = 'Stop'
|
|
18
|
+
|
|
19
|
+
$source = $PSScriptRoot
|
|
20
|
+
|
|
21
|
+
if (-not (Test-Path (Join-Path $source '.git'))) {
|
|
22
|
+
Write-Host "This is not a git checkout, so there is nothing to pull." -ForegroundColor Yellow
|
|
23
|
+
Write-Host "If you installed from npm, update with:" -ForegroundColor Yellow
|
|
24
|
+
Write-Host " npm install -g @vib795/agent-memory@latest" -ForegroundColor Yellow
|
|
25
|
+
Write-Host " agent-memory setup" -ForegroundColor Yellow
|
|
26
|
+
exit 1
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Write-Host "Pulling" -ForegroundColor Cyan
|
|
30
|
+
# git writes ordinary progress to stderr, and `Stop` would treat that as terminating.
|
|
31
|
+
$previousPreference = $ErrorActionPreference
|
|
32
|
+
$ErrorActionPreference = 'Continue'
|
|
33
|
+
try {
|
|
34
|
+
& git -C $source pull --ff-only 2>&1 | Write-Host
|
|
35
|
+
$gitExit = $LASTEXITCODE
|
|
36
|
+
} finally {
|
|
37
|
+
$ErrorActionPreference = $previousPreference
|
|
38
|
+
}
|
|
39
|
+
if ($gitExit -ne 0) {
|
|
40
|
+
Write-Error "git pull failed. Resolve that first, then run this again."
|
|
41
|
+
exit 1
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Write-Host ""
|
|
45
|
+
& powershell -ExecutionPolicy Bypass -File (Join-Path $source 'install.ps1')
|
package/update.sh
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Updates a clone install: pull, then re-run the installer.
|
|
3
|
+
#
|
|
4
|
+
# The install logic is deliberately not repeated here. install.sh already relinks the
|
|
5
|
+
# skills, relinks the CLI and runs doctor; an update is exactly that plus a pull, and
|
|
6
|
+
# writing it a second time is how the two drift.
|
|
7
|
+
#
|
|
8
|
+
# Re-running setup is not optional on an upgrade. Prompt files are copies rather than
|
|
9
|
+
# links, so an editor keeps reading the old text until something rewrites it.
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
13
|
+
|
|
14
|
+
if [ ! -d "$source_dir/.git" ]; then
|
|
15
|
+
echo "This is not a git checkout, so there is nothing to pull." >&2
|
|
16
|
+
echo "If you installed from npm, update with:" >&2
|
|
17
|
+
echo " npm install -g @vib795/agent-memory@latest" >&2
|
|
18
|
+
echo " agent-memory setup" >&2
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
echo "Pulling"
|
|
23
|
+
git -C "$source_dir" pull --ff-only
|
|
24
|
+
|
|
25
|
+
echo
|
|
26
|
+
exec "$source_dir/install.sh"
|