@kage-core/kage-graph-mcp 1.1.15 → 1.1.16

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 (3) hide show
  1. package/README.md +24 -13
  2. package/package.json +3 -4
  3. package/dist/release.js +0 -121
package/README.md CHANGED
@@ -9,15 +9,23 @@ This package exposes two surfaces:
9
9
 
10
10
  ## Latest Release
11
11
 
12
- `1.1.15` hardens the npm release path and memory-only review flow:
13
-
14
- - `npm run release:npm:dry-run` runs the guarded release checks without
15
- publishing.
16
- - `npm run release:npm` builds the release helper, requires a clean worktree,
17
- fetches the remote branch, verifies local `HEAD` contains `origin/<branch>`,
18
- runs tests and `npm pack --dry-run`, pushes the branch before publishing,
19
- publishes with `--access public`, verifies npm registry metadata, and performs
20
- a smoke install.
12
+ `1.1.16` fixes the guarded release helper's npm verification step:
13
+
14
+ - exact-version `npm view` checks now retry with backoff after publish so npm
15
+ registry propagation does not make a successful publish look failed.
16
+ - the release helper is maintainer-only repo tooling: public package metadata no
17
+ longer exposes npm release scripts, and `dist/release.js` is excluded from the
18
+ published tarball.
19
+
20
+ `1.1.15` hardened the npm release path and memory-only review flow:
21
+
22
+ - the source-repo maintainer helper can run the guarded release checks without
23
+ publishing, or push/publish/smoke-test when explicitly invoked from a built
24
+ checkout.
25
+ - it requires a clean worktree, fetches the remote branch, verifies local `HEAD`
26
+ contains `origin/<branch>`, runs tests and `npm pack --dry-run`, pushes the
27
+ branch before publishing, publishes with `--access public`, verifies npm
28
+ registry metadata, and performs a smoke install.
21
29
  - all git steps run with `GIT_EDITOR=true` so agent sessions cannot get stuck in
22
30
  an interactive commit or rebase editor.
23
31
  - `kage propose --from-diff` now includes repo memory packet-only changes from
@@ -54,14 +62,17 @@ This package exposes two surfaces:
54
62
  ```bash
55
63
  npm install
56
64
  npm run build
57
- npm run release:npm:dry-run
58
65
  ```
59
66
 
60
- Publishing from the repo should use the guarded release script after the release
61
- commit is ready:
67
+ Publishing from the source repo should use the guarded maintainer helper after
68
+ the release commit is ready. It is intentionally not exposed as a public npm
69
+ script or included in the published tarball:
62
70
 
63
71
  ```bash
64
- npm run release:npm
72
+ npm run build --prefix mcp
73
+ cd mcp
74
+ node dist/release.js --dry-run
75
+ node dist/release.js --publish --push --smoke
65
76
  ```
66
77
 
67
78
  The script fetches the current branch and blocks if the remote branch is not an
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@kage-core/kage-graph-mcp",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "Local-first repo memory, code graph, and recall MCP server for coding agents",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist/**/*.js",
8
8
  "!dist/**/*.test.js",
9
+ "!dist/release.js",
9
10
  "viewer/**/*",
10
11
  "!viewer/graphs/*.json",
11
12
  "README.md"
@@ -21,9 +22,7 @@
21
22
  "build": "tsc",
22
23
  "start": "node dist/index.js",
23
24
  "dev": "ts-node index.ts",
24
- "test": "npm run build && node --test dist/**/*.test.js",
25
- "release:npm:dry-run": "npm run build && node dist/release.js --dry-run",
26
- "release:npm": "npm run build && node dist/release.js --publish --push --smoke"
25
+ "test": "npm run build && node --test dist/**/*.test.js"
27
26
  },
28
27
  "keywords": [
29
28
  "mcp",
package/dist/release.js DELETED
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseReleaseArgs = parseReleaseArgs;
4
- exports.buildNpmReleasePlan = buildNpmReleasePlan;
5
- exports.runNpmRelease = runNpmRelease;
6
- const node_child_process_1 = require("node:child_process");
7
- const node_fs_1 = require("node:fs");
8
- const node_os_1 = require("node:os");
9
- const node_path_1 = require("node:path");
10
- const DEFAULT_CACHE = "/private/tmp/kage-npm-cache";
11
- function parseReleaseArgs(argv) {
12
- const options = {
13
- publish: false,
14
- push: false,
15
- smoke: false,
16
- cache: DEFAULT_CACHE,
17
- };
18
- for (let index = 0; index < argv.length; index += 1) {
19
- const arg = argv[index];
20
- if (arg === "--publish")
21
- options.publish = true;
22
- else if (arg === "--dry-run")
23
- options.publish = false;
24
- else if (arg === "--push")
25
- options.push = true;
26
- else if (arg === "--smoke")
27
- options.smoke = true;
28
- else if (arg === "--cache") {
29
- const value = argv[index + 1];
30
- if (!value)
31
- throw new Error("--cache requires a path");
32
- options.cache = value;
33
- index += 1;
34
- }
35
- else {
36
- throw new Error(`Unknown release option: ${arg}`);
37
- }
38
- }
39
- return options;
40
- }
41
- function buildNpmReleasePlan(context) {
42
- const gitEnv = { GIT_EDITOR: "true" };
43
- const steps = [
44
- { name: "ensure clean worktree", command: "git", args: ["status", "--porcelain", "-uall"], env: gitEnv, expectEmptyStdout: true },
45
- { name: "fetch remote branch", command: "git", args: ["fetch", "origin", context.branch], env: gitEnv },
46
- { name: "ensure branch contains remote", command: "git", args: ["merge-base", "--is-ancestor", `origin/${context.branch}`, "HEAD"], env: gitEnv },
47
- { name: "run package tests", command: "npm", args: ["test"] },
48
- { name: "pack dry run", command: "npm", args: ["--cache", context.cache, "pack", "--dry-run"] },
49
- ];
50
- if (context.push) {
51
- steps.push({ name: "push branch", command: "git", args: ["push", "origin", context.branch], env: gitEnv });
52
- }
53
- if (context.publish) {
54
- steps.push({ name: "publish package", command: "npm", args: ["--cache", context.cache, "publish", "--access", "public"] }, { name: "verify npm version", command: "npm", args: ["view", `${context.packageName}@${context.version}`, "version"] });
55
- if (context.smoke) {
56
- steps.push({
57
- name: "smoke install published package",
58
- command: "npm",
59
- args: ["--cache", context.cache, "install", "--prefix", smokeInstallDir(context.version), `${context.packageName}@${context.version}`],
60
- });
61
- }
62
- }
63
- return steps;
64
- }
65
- function smokeInstallDir(version) {
66
- return (0, node_path_1.join)((0, node_os_1.tmpdir)(), `kage-npm-smoke-${version}`);
67
- }
68
- function stdout(command, args, cwd) {
69
- return (0, node_child_process_1.execFileSync)(command, args, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
70
- }
71
- function packageMetadata(packageDir) {
72
- const pkg = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(packageDir, "package.json"), "utf8"));
73
- if (typeof pkg.name !== "string" || typeof pkg.version !== "string") {
74
- throw new Error("package.json must contain string name and version");
75
- }
76
- return { name: pkg.name, version: pkg.version };
77
- }
78
- function runStep(step, cwd) {
79
- console.log(`release:npm: ${step.name}`);
80
- if (step.expectEmptyStdout) {
81
- const output = (0, node_child_process_1.execFileSync)(step.command, step.args, {
82
- cwd,
83
- encoding: "utf8",
84
- stdio: ["ignore", "pipe", "inherit"],
85
- env: { ...process.env, ...step.env },
86
- }).trim();
87
- if (output)
88
- throw new Error(`release:npm: ${step.name} failed because output was not empty:\n${output}`);
89
- return;
90
- }
91
- (0, node_child_process_1.execFileSync)(step.command, step.args, {
92
- cwd,
93
- stdio: "inherit",
94
- env: { ...process.env, ...step.env },
95
- });
96
- }
97
- function runNpmRelease(argv = process.argv.slice(2), packageDir = process.cwd()) {
98
- const options = parseReleaseArgs(argv);
99
- const repoRoot = stdout("git", ["rev-parse", "--show-toplevel"], packageDir);
100
- const branch = stdout("git", ["branch", "--show-current"], repoRoot);
101
- if (!branch)
102
- throw new Error("npm release requires a named git branch");
103
- (0, node_fs_1.mkdirSync)(options.cache, { recursive: true });
104
- if (options.smoke)
105
- (0, node_fs_1.mkdirSync)(smokeInstallDir(packageMetadata(packageDir).version), { recursive: true });
106
- const metadata = packageMetadata(packageDir);
107
- const plan = buildNpmReleasePlan({ ...options, branch, packageName: metadata.name, version: metadata.version });
108
- console.log(`release:npm: package ${metadata.name}@${metadata.version}`);
109
- console.log(`release:npm: mode ${options.publish ? "publish" : "dry-run"}`);
110
- for (const step of plan)
111
- runStep(step, repoRoot === (0, node_path_1.resolve)(packageDir, "..") ? packageDir : repoRoot);
112
- }
113
- if (process.argv[1] && process.argv[1].endsWith("release.js")) {
114
- try {
115
- runNpmRelease();
116
- }
117
- catch (error) {
118
- console.error(error instanceof Error ? error.message : String(error));
119
- process.exit(2);
120
- }
121
- }