-
Notifications
You must be signed in to change notification settings - Fork 0
fix: close the last two seams in the skill content, and stop the docs recommending a broken install (0.6.5) #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -427,15 +427,31 @@ GitHub, and it is the path to use behind a proxy that blocks or quarantines npm: | |
|
|
||
| ```bash | ||
| git clone https://github.com/vib795/agent-memory.git | ||
| npm install -g ./agent-memory | ||
| cd agent-memory && npm pack | ||
| npm install -g ./vib795-agent-memory-*.tgz | ||
| agent-memory setup | ||
| ``` | ||
|
|
||
| **Do not install from the git URL directly.** `npm install -g <git-url>` does not | ||
| **Pack first; do not install the directory.** `npm install -g ./agent-memory` looks | ||
| equivalent and is not: npm links the global install to that folder rather than copying | ||
|
Comment on lines
+435
to
+436
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- README.md lines 410-445 ---'
sed -n '410,445p' README.md
printf '%s\n' '--- relevant install commands ---'
rg -n -C 3 'npm (install|pack)|agent-memory|directory|tarball' README.md
printf '%s\n' '--- path-resolution check ---'
python3 - <<'PY'
from pathlib import PurePosixPath
clone = PurePosixPath('/tmp/agent-memory')
for cwd, command_path in [
(clone, './agent-memory'),
(clone.parent, './agent-memory'),
(clone, '.'),
]:
print(f'cwd={cwd} path={command_path} resolves_to={PurePosixPath(cwd, command_path)}')
PYRepository: vib795/agent-memory Length of output: 20103 Clarify the working directory for the directory-install example. The preceding 🤖 Prompt for AI Agents |
||
| it, which shows up as an arrow in `npm list -g`: | ||
|
|
||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add a language tag to the diagnostic code fence. Markdownlint MD040 flags this fence. Change the opening fence to 🧰 Tools🪛 markdownlint-cli2 (0.23.2)[warning] 439-439: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| `-- @vib795/agent-memory@0.6.5 -> .\..\..\..\agent-memory | ||
| ``` | ||
|
|
||
| Move or delete the clone afterwards and the global install points at nothing — the same | ||
| breakage as the git-URL case below, arriving later and harder to trace. Installing a | ||
| packed tarball copies, so the clone becomes disposable. Verified on npm 11.x. | ||
|
|
||
| **Do not install from the git URL directly either.** `npm install -g <git-url>` does not | ||
| work for this package: npm resolves a git install through | ||
| `~/.npm/_cacache/tmp/git-clone*` and then removes that directory, leaving the global | ||
| install pointing at a path that no longer exists. Cloning first avoids npm's git | ||
| handling entirely. Verified on npm 11.18. | ||
| install pointing at a path that no longer exists. Verified on npm 11.18. | ||
|
|
||
| **And run the installed binary, not the checkout.** Skill links resolve relative to the | ||
| code that creates them, so `npm run setup` inside a clone aims every link at that clone. | ||
| Use `agent-memory setup`, which runs the copy npm installed. | ||
|
|
||
| Every release is mirrored to **GitHub Packages**. Treat that as redundancy rather | ||
| than a second front door: GitHub Packages requires authentication even for public | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,8 @@ import { compact, maybeCompact } from './compact.js'; | |
| import { staleness, currentRepo, reviewCandidates, captureGap } from './staleness.js'; | ||
| import { setup as runSetup, unlinkSkills, danglingSkillLinks, SKILLS } from './setup.js'; | ||
| import { detectTargets, installableTargets } from './targets.js'; | ||
| import { join, dirname } from 'node:path'; | ||
| import { join, dirname, resolve, sep } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { atomicWrite } from './atomic.js'; | ||
| import { redactNodeForExport, buildReceipt, renderReceipt } from './pii.js'; | ||
|
|
||
|
|
@@ -29,6 +30,41 @@ import { redactNodeForExport, buildReceipt, renderReceipt } from './pii.js'; | |
|
|
||
| const MIN_NODE = [22, 5]; | ||
|
|
||
| /** | ||
| * Where this process is actually running from, and what version it is. | ||
| * | ||
| * "What am I running" is the first question in every install problem and used to need | ||
| * `npm list -g` to answer, which reports what npm believes rather than what is on PATH. | ||
| * These read the package next to the running code, so they answer for the copy that | ||
| * will actually execute. | ||
| */ | ||
| function packageRoot() { | ||
| return resolve(dirname(fileURLToPath(import.meta.url)), '..'); | ||
| } | ||
|
|
||
| function installedVersion() { | ||
| try { | ||
| return JSON.parse(readFileSync(join(packageRoot(), 'package.json'), 'utf8')).version; | ||
| } catch { | ||
| return 'unknown'; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Whether the running code lives outside any `node_modules` tree. | ||
| * | ||
| * `npm install -g <folder>` links rather than copies, so a global install can be a | ||
| * pointer at a checkout the user will eventually tidy away — and skill links, which | ||
| * resolve relative to this file, follow it there. Node resolves symlinks before it sets | ||
| * `import.meta.url`, so the link itself is already invisible from in here; what stays | ||
| * visible, and is the thing that actually matters, is that the code is not sitting in an | ||
| * installed package. Running from a working copy is legitimate, so this reports the | ||
| * condition rather than failing on it. | ||
| */ | ||
| function runningFromWorkingCopy() { | ||
| return !packageRoot().split(sep).includes('node_modules'); | ||
| } | ||
|
|
||
| function parseArgs(argv) { | ||
| const opts = { _: [] }; | ||
| for (let i = 0; i < argv.length; i++) { | ||
|
|
@@ -93,6 +129,8 @@ const USAGE = `agent-memory — durable cross-repo knowledge for coding agents | |
| engagement [show|list|use <name>] which client store this window writes to | ||
| [purge <name> --yes] delete one engagement's store entirely | ||
|
|
||
| --version this version, and the path it runs from | ||
|
|
||
| Add --json to any command for machine-readable output. | ||
| Engagement: ${ENGAGEMENT.name} (${ENGAGEMENT.source}) | ||
| Store: ${paths.root}`; | ||
|
|
@@ -460,6 +498,25 @@ function cmdDoctor() { | |
| // reading it against the wrong client is the mistake this is here to prevent. | ||
| add('engagement', true, `${ENGAGEMENT.name} (${ENGAGEMENT.source})`); | ||
|
|
||
| // Second, because "which version is this" preceded every other question in the one | ||
| // install failure this tool has actually been debugged through, and answering it | ||
| // needed a separate npm command that reports what npm believes rather than what ran. | ||
| add('version', true, `${installedVersion()} at ${packageRoot()}`); | ||
|
|
||
| // Skill links point at whatever copy of the code creates them. When that copy is a | ||
| // working directory rather than an installed package, deleting the directory dangles | ||
| // every link at once — which is exactly how this tool's own skill links were lost. | ||
| // Reported, not failed: running from a checkout is a normal thing to do deliberately. | ||
| add( | ||
| 'runs from an installed package', | ||
| true, | ||
| runningFromWorkingCopy() | ||
| ? `no — working copy at ${packageRoot()}; skill links will point here, so moving or ` + | ||
| 'deleting it breaks them. For a durable install: `npm pack` then ' + | ||
| '`npm install -g <tgz>`, and re-run setup.' | ||
| : 'yes', | ||
| ); | ||
|
|
||
|
Comment on lines
+501
to
+519
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 2 'node:sqlite|experimental-sqlite|MIN_NODE|nodeVersionOk|function main' \
src/cli.js package.json README.mdRepository: vib795/agent-memory Length of output: 2083 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- package metadata ---'
cat -n package.json | sed -n '1,140p'
printf '%s\n' '--- cli imports and version guard ---'
cat -n src/cli.js | sed -n '1,120p'
cat -n src/cli.js | sed -n '480,535p'
cat -n src/cli.js | sed -n '970,1020p'
printf '%s\n' '--- sqlite references and import forms ---'
rg -n -C 3 --glob '*.js' --glob '*.json' 'node:sqlite|experimental-sqlite|sqlite' .Repository: vib795/agent-memory Length of output: 13332 Raise the minimum Node.js version to 22.13.0.
🤖 Prompt for AI Agents |
||
| add('node version', nodeVersionOk(), `${process.versions.node} (need >= ${MIN_NODE.join('.')})`); | ||
| if (!nodeVersionOk()) { | ||
| return { | ||
|
|
@@ -933,6 +990,12 @@ function main(argv) { | |
| process.stdout.write(`${USAGE}\n`); | ||
| return 0; | ||
| } | ||
| if (cmd === '--version' || cmd === '-v' || cmd === 'version') { | ||
| // Prints the path as well as the number. A version alone cannot tell you that the | ||
| // binary on PATH belongs to a different install than the one you just upgraded. | ||
| process.stdout.write(`${installedVersion()}\n${packageRoot()}\n`); | ||
| return 0; | ||
| } | ||
| const fn = COMMANDS[cmd]; | ||
| if (!fn) { | ||
| process.stderr.write(`Unknown command ${JSON.stringify(cmd)}.\n\n${USAGE}\n`); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: vib795/agent-memory
Length of output: 1090
🏁 Script executed:
Repository: vib795/agent-memory
Length of output: 1430
🌐 Web query:
npm CLI documentation npm pack --silent output filename💡 Result:
When you run the npm pack command, npm packs the specified package and prints the filename of the generated tarball to stdout by default [1][2]. Regarding the use of the --silent flag with npm pack: 1. Primary Output: The --silent flag is designed to reduce log levels, but it does not inherently suppress all output, particularly from lifecycle scripts (such as prepack or prepare) that may be triggered during the packing process [3][4]. 2. Lifecycle Scripts: If your package includes lifecycle scripts that write to stdout, those scripts will continue to print their output to the console even when --silent is used [4][5]. 3. Recommended Approach: To ensure you only capture the filename of the generated tarball, you may need to suppress the output of those lifecycle scripts. Using --foreground-scripts=false in conjunction with --silent is often cited as a way to suppress script output and achieve cleaner stdout [4][5][6]. Example usage: npm pack --silent --foreground-scripts=false If you are programmatically parsing this output, note that reliance on stdout for the filename can be affected by any additional output from your environment or scripts [4][5]. Always verify that your specific lifecycle scripts are not emitting unintended information to stdout [5].
Citations:
Install the tarball returned by
npm packIf older
.tgzfiles remain, the glob can match multiple files. Capture the filename fromnpm pack --silentand install that file.🤖 Prompt for AI Agents