@cairnkeep/cli 1.0.3 → 1.0.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cairnkeep/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A durable, harness-agnostic memory + context layer for coding agents (Claude Code, OpenCode).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"zod": "^3.25.76"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
+
"prepack": "git ls-files -s | awk '$1==\"100755\"{print $4}' | xargs chmod 755",
|
|
35
36
|
"test": "for test in scripts/test-*.sh; do \"$test\" || exit 1; done",
|
|
36
37
|
"check:public": "scripts/verify-no-private-references.sh && scripts/verify-docs-parity.sh && npm test",
|
|
37
38
|
"prepublishOnly": "npm run check:public && npm --prefix mcp-memory-server ci && npm --prefix mcp-memory-server test"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Regression guard for the 744-perms packaging bug. A root-owned `sudo npm i -g`
|
|
3
|
+
# makes root the file owner, so a non-root user can only run cairn if "other"
|
|
4
|
+
# has the execute bit. A publisher umask can strip it at pack time; the
|
|
5
|
+
# `prepack` script re-applies git's tracked executable bit. This verifies
|
|
6
|
+
# prepack heals a umask-mangled entrypoint back to 755 (world-executable).
|
|
7
|
+
#
|
|
8
|
+
# Deliberately does NOT run `npm pack`: this test runs inside `npm test`, which
|
|
9
|
+
# runs inside `npm publish`'s prepublishOnly, and nesting npm that deep is not
|
|
10
|
+
# portable. Running the prepack command directly tests the same guarantee.
|
|
11
|
+
set -euo pipefail
|
|
12
|
+
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
|
13
|
+
cd "$ROOT"
|
|
14
|
+
fail() { echo "FAIL: $1" >&2; exit 1; }
|
|
15
|
+
|
|
16
|
+
prepack=$(node -e 'process.stdout.write(require("./package.json").scripts.prepack||"")')
|
|
17
|
+
[[ -n "$prepack" ]] || fail "package.json has no prepack script (perms fix missing)"
|
|
18
|
+
|
|
19
|
+
entry=bin/cairn
|
|
20
|
+
trap 'chmod 755 "$entry" 2>/dev/null || true' EXIT
|
|
21
|
+
chmod 744 "$entry" # simulate a stripping umask
|
|
22
|
+
sh -c "$prepack" # run the real prepack command
|
|
23
|
+
mode=$(stat -c '%a' "$entry" 2>/dev/null || stat -f '%Lp' "$entry") # GNU || BSD/macOS
|
|
24
|
+
[[ "$mode" == "755" ]] || fail "prepack did not restore $entry to 755 (got $mode) -- 744 packaging bug"
|
|
25
|
+
echo "OK: prepack restores shipped executables to 755"
|