dsh-supermemory 0.1.0 → 0.1.1

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 CHANGED
@@ -199,28 +199,55 @@ Requires Node `^22.19.0 || >=24.0.0`.
199
199
 
200
200
  ## Releasing
201
201
 
202
- Publishing runs from GitHub Actions through npm **trusted publishing (OIDC)** — no `NPM_TOKEN` secret exists, and every release carries provenance.
202
+ Publishing runs from GitHub Actions through npm **trusted publishing (OIDC)** — no `NPM_TOKEN` secret exists, and every release carries provenance. CI does not publish on its own: it *stages* the release, and a human approves it with a 2FA code.
203
203
 
204
- One-time setup on npm: open <https://www.npmjs.com/package/dsh-supermemory/access>, add a trusted publisher, choose GitHub Actions, and enter organization `nmindz`, repository `dsh-supermemory`, workflow `.github/workflows/release.yml`, environment `npm`.
204
+ One-time setup on npm: open <https://www.npmjs.com/package/dsh-supermemory/access>, add a trusted publisher, choose GitHub Actions, and enter organization `nmindz`, repository `dsh-supermemory`, workflow `.github/workflows/release.yml`, environment `production`. Under **Allowed actions**, leave *publish directly* unchecked — staged publishing is all this workflow needs, and it keeps CI from holding a credential that can ship a version by itself.
205
205
 
206
- Then each release is a version bump and a tag:
206
+ ### Conventional Commits drive the version
207
+
208
+ There is no manual version bump and no hand-written tag. [semantic-release](https://semantic-release.gitbook.io) reads the [Conventional Commits](https://www.conventionalcommits.org) since the last release and decides everything else — the version, `CHANGELOG.md`, the git tag, and the GitHub Release.
209
+
210
+ | Commit | Result |
211
+ |---|---|
212
+ | `fix: …` | patch — `0.1.0` → `0.1.1` |
213
+ | `feat: …` | minor — `0.1.0` → `0.2.0` |
214
+ | `feat!: …` or a `BREAKING CHANGE:` footer | major |
215
+ | `perf: …`, `refactor: …` | patch |
216
+ | `docs: …`, `test: …`, `chore: …`, `ci: …`, `build: …`, `style: …` | no release |
217
+
218
+ So a release is just a merge to `master`:
219
+
220
+ ```sh
221
+ git commit -m 'fix: render the status line from a symlinked install path'
222
+ git push origin master
223
+ ```
224
+
225
+ CI validates the commit, the release workflow runs once CI is green, and if the commits warrant a version it bumps `package.json`, writes `CHANGELOG.md`, tags `vX.Y.Z`, opens the GitHub Release, and stages the npm publish. Pull requests get their commit messages linted so a malformed one cannot silently cost a release.
226
+
227
+ The version then waits for you:
207
228
 
208
229
  ```sh
209
- npm version 0.1.1 --no-git-tag-version # edits package.json only
210
- git commit -am 'Release v0.1.1'
211
- git tag v0.1.1
212
- git push origin master --tags
230
+ npm stage list dsh-supermemory # find the stage id
231
+ npm stage view <stage-id> # inspect the tarball and provenance
232
+ npm stage approve <stage-id> # publishes it; asks for your 2FA code
233
+ npm stage reject <stage-id> # discards it instead
213
234
  ```
214
235
 
215
- The workflow refuses to publish when the tag and `package.json` version disagree, and runs `pnpm run check` before it publishes.
236
+ Requires npm 11.19 locally (`npm install -g npm@latest`).
216
237
 
217
- To publish by hand instead (requires `npm login` or a configured token):
238
+ To publish by hand instead, skipping staging entirely:
218
239
 
219
240
  ```sh
220
241
  pnpm run check
221
242
  npm publish --access public
222
243
  ```
223
244
 
245
+ Run semantic-release in CI only. It moves git refs as part of its work, and in a jj-colocated checkout jj re-imports those refs and rolls the working copy back onto them — locally it looks like it ate your unpushed commits. They are recoverable with `jj op log` and `jj op restore <op-id>`, but the tool has no business running there.
246
+
247
+ ### What a release costs
248
+
249
+ The package is built exactly once per commit. CI's `build` job produces `lib/`, verifies the tarball still carries the skill body and both auth templates, and uploads it; the release workflow downloads that artifact rather than rebuilding, and stages with `--ignore-scripts` so `prepublishOnly` does not rebuild either. Installs in CI use `--ignore-scripts` too, since the package's `prepare` hook exists only to make a git install usable. Runs on a superseded commit cancel themselves.
250
+
224
251
  ## License
225
252
 
226
253
  MIT. Derived from the MIT-licensed Claude Code `supermemory` plugin — see [NOTICE](NOTICE) for the file-by-file attribution. Supermemory, the `◪` mark, and the Supermemory brand belong to Supermemory; this is an independent port, not an official release.
package/lib/index.mjs CHANGED
@@ -1002,7 +1002,7 @@ function statuslineTip() {
1002
1002
  if (fs.existsSync(STATUSLINE_TIP_FILE)) return null;
1003
1003
  fs.mkdirSync(path.dirname(STATUSLINE_TIP_FILE), { recursive: true });
1004
1004
  fs.writeFileSync(STATUSLINE_TIP_FILE, (/* @__PURE__ */ new Date()).toISOString());
1005
- return `${MARK} supermemory status is live — render it anywhere with \`node -e "require('dsh-supermemory/statusline')" <<< '{"session_id":"…"}'\`, or read ~/.supermemory-claude/statusline.`;
1005
+ return `${MARK} supermemory status is live — render it anywhere with \`echo '{"session_id":"…"}' | node -e "import('dsh-supermemory/statusline')"\`, or read ~/.supermemory-claude/statusline.`;
1006
1006
  } catch {
1007
1007
  return null;
1008
1008
  }
@@ -1,3 +1,4 @@
1
+ import { fileURLToPath } from "node:url";
1
2
  import fs from "node:fs";
2
3
  import path from "node:path";
3
4
  import os from "node:os";
@@ -198,6 +199,24 @@ async function main() {
198
199
  if (output) process.stdout.write(output);
199
200
  } catch {}
200
201
  }
201
- if (process.argv[1] && import.meta.url === `file://${process.argv[1]}`) main();
202
+ /**
203
+ * Whether this module was run as the entry point.
204
+ *
205
+ * Comparing `import.meta.url` to `file://${process.argv[1]}` is wrong twice
206
+ * over: the template leaves spaces and other reserved characters unescaped,
207
+ * and `import.meta.url` is already resolved through symlinks while `argv[1]`
208
+ * is not — so on macOS a script under `/tmp` (a symlink to `/private/tmp`)
209
+ * never matched and the renderer silently printed nothing. Compare real paths.
210
+ */
211
+ function invokedDirectly() {
212
+ const entry = process.argv[1];
213
+ if (!entry) return false;
214
+ try {
215
+ return fs.realpathSync(fileURLToPath(import.meta.url)) === fs.realpathSync(entry);
216
+ } catch {
217
+ return false;
218
+ }
219
+ }
220
+ if (invokedDirectly()) main();
202
221
  //#endregion
203
222
  export { CONTEXT_TTL_MS, ERROR_TTL_MS, SAVING_TTL_MS, STATUSLINE_INPUT_TIMEOUT_MS, TICK_MS, getStatusLabel, readState, readStatuslineInput, renderStatusline };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-supermemory",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Persistent memory across DeepSeek Harness (DSH) sessions using Supermemory. A native port of the Claude Code supermemory plugin.",
5
5
  "keywords": [
6
6
  "dsh",
@@ -85,6 +85,8 @@
85
85
  }
86
86
  },
87
87
  "devDependencies": {
88
+ "@commitlint/cli": "^21.2.2",
89
+ "@commitlint/config-conventional": "^21.2.2",
88
90
  "@deepseek-ai/cordis": "^4.0.2",
89
91
  "@deepseek-ai/dsh-agent": "0.1.2-rc.1",
90
92
  "@deepseek-ai/dsh-commands": "0.1.2-rc.1",
@@ -93,7 +95,16 @@
93
95
  "@deepseek-ai/dsh-session": "0.1.2-rc.1",
94
96
  "@deepseek-ai/dsh-skill": "0.1.2-rc.1",
95
97
  "@deepseek-ai/dsh-tools": "0.1.2-rc.1",
98
+ "@semantic-release/changelog": "^7.0.0",
99
+ "@semantic-release/commit-analyzer": "^13.0.1",
100
+ "@semantic-release/exec": "^7.1.0",
101
+ "@semantic-release/git": "^11.0.1",
102
+ "@semantic-release/github": "^12.0.9",
103
+ "@semantic-release/npm": "^13.1.5",
104
+ "@semantic-release/release-notes-generator": "^14.1.1",
96
105
  "@types/node": "^24.10.0",
106
+ "conventional-changelog-conventionalcommits": "^9.3.1",
107
+ "semantic-release": "^25.0.9",
97
108
  "tsdown": "^0.22.2",
98
109
  "typescript": "^6.0.0"
99
110
  },
@@ -109,6 +120,14 @@
109
120
  ]
110
121
  }
111
122
  },
123
+ "scripts": {
124
+ "build": "tsdown",
125
+ "prepare": "tsdown",
126
+ "typecheck": "tsc --noEmit",
127
+ "test": "node --test --experimental-strip-types test/*.test.ts",
128
+ "check": "npm run typecheck && npm test && npm run build",
129
+ "prepublishOnly": "npm run check"
130
+ },
112
131
  "license": "MIT",
113
132
  "repository": {
114
133
  "type": "git",
@@ -117,11 +136,5 @@
117
136
  "bugs": {
118
137
  "url": "https://github.com/nmindz/dsh-supermemory/issues"
119
138
  },
120
- "homepage": "https://github.com/nmindz/dsh-supermemory#readme",
121
- "scripts": {
122
- "build": "tsdown",
123
- "typecheck": "tsc --noEmit",
124
- "test": "node --test --experimental-strip-types test/*.test.ts",
125
- "check": "npm run typecheck && npm test && npm run build"
126
- }
127
- }
139
+ "homepage": "https://github.com/nmindz/dsh-supermemory#readme"
140
+ }