open-pstack 0.9.173 → 0.9.174

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/NOTICE.md CHANGED
@@ -38,7 +38,7 @@ Summary of structural changes:
38
38
  - Six skills imported from `cursor-team-kit`: `deslop`, `make-pr-easy-to-review`, `fix-ci`, `fix-merge-conflicts`, `get-pr-comments`, `what-did-i-get-done`. Five are copied verbatim with no rewiring needed. `deslop` is a policy fork that `tools/forks.json` declares.
39
39
  - Three skills and two agents imported from `thermos`: `thermos`, `thermo-nuclear-review`, `thermo-nuclear-code-quality-review`, `thermo-nuclear-review-subagent`, and `thermo-nuclear-code-quality-review-subagent`. The skills' `subagent_type` values take the `pstack:` namespace, and the agents' parent-orchestration notes name Claude Code's tools; `tools/substitutions.json` lists each rewrite.
40
40
  - `plugins/pstack/skills/babysit/` is independently authored as the Claude Code analog of Cursor's `/babysit` built-in. It has no upstream pstack equivalent; its workflow is informed by Cursor's public `/babysit` behavior. No code or prose was copied from any source.
41
- - `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `bootstrap.ts`, `package.json`, `bun.lock`). `worktree-audit.mjs` is a port-only rewrite of upstream's `worktree-audit.sh`, which `tools/upstream.json` excludes from sync; it reads the Claude Code, Codex, and Pi transcript directories instead of Cursor's and reports prunable worktrees. Port edits, each on the forked list `bun tools/sync.mjs --dry-run` prints: `bootstrap.ts` fails clearly under node and installs locked production dependencies only, into the user cache instead of the plugin; `package.json` typechecks the whole tree; `tsconfig.json` is port-only. Everything else is upstream's code under the upstream MIT license.
41
+ - `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `bootstrap.ts`, `package.json`, `bun.lock`). `worktree-audit.mjs` is a port-only rewrite of upstream's `worktree-audit.sh`, which `tools/upstream.json` excludes from sync; it reads the Claude Code, Codex, and Pi transcript directories instead of Cursor's and reports prunable worktrees. The port edits upstream files here and adds files of its own, such as `watch-pr/shipping.ts`. [`tools/forks.json`](tools/forks.json) lists each edited upstream file with the reason for the edit. `bun tools/sync.mjs pstack <pinned sha> --dry-run`, with the SHA from [`tools/upstream.json`](tools/upstream.json), prints those files with their changed-line counts, then lists the port-only files. The files on neither list are upstream's code under the upstream MIT license.
42
42
  - `plugins/pstack/agents/comment-sicko.md` is upstream's `Comment Sicko` agent, renamed to `comment-sicko` so the name works as a Claude Code `subagent_type`. The body is verbatim.
43
43
  - A Codex build shares the same `skills/` tree. It adds `plugins/pstack/.codex-plugin/plugin.json`, a root `.agents/plugins/marketplace.json`, and `plugins/pstack/skills/poteto-mode/references/codex-tools.md` (the Claude-to-Codex tool, model, built-in, and per-skill map). Affected skill entry points link to this map. See the [reference](docs/reference.md#codex).
44
44
 
package/lib/bundle.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, renameSync, rmSync } from "node:fs";
2
- import { dirname, join, relative, sep } from "node:path";
1
+ import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, renameSync, rmSync } from "node:fs";
2
+ import { basename, dirname, join, relative, sep } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
 
5
5
  const installerRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
@@ -30,6 +30,19 @@ export const stableDir = ({ home, env }) =>
30
30
  export const withoutNodeModules = (root) => (src) =>
31
31
  !relative(root, src).split(sep).includes("node_modules");
32
32
 
33
+ // A scratch directory is named .pstack-stage-<pid>-<destination name>-XXXXXX,
34
+ // so a later run can tell whose it is. 0.9.173 named it .pstack-stage-XXXXXX.
35
+ const SCRATCH_NAME = /^\.pstack-stage-(?:(\d+)-(.+)-)?[A-Za-z0-9]{6}$/;
36
+
37
+ const running = (pid) => {
38
+ try {
39
+ process.kill(pid, 0);
40
+ return true;
41
+ } catch (error) {
42
+ return error.code === "EPERM";
43
+ }
44
+ };
45
+
33
46
  // Copy into a scratch directory beside the destination, then swap, so a rerun
34
47
  // converges and a crash leaves the previous copy whole. The scratch directory
35
48
  // holds the fresh and old copies one level down, so its own root carries no
@@ -38,12 +51,13 @@ export const withoutNodeModules = (root) => (src) =>
38
51
  // pstack. `exclude` names top-level entries only, so a nested
39
52
  // directory of the same name is still copied. `add` copies entries from the
40
53
  // source into the fresh copy after it, which is how a runtime whose manifest
41
- // must sit at the plugin root gets one.
54
+ // must sit at the plugin root gets one. Returns the warnings from removing the
55
+ // scratch directories earlier runs left.
42
56
  export function stagePlugin(source, dest, { exclude = [], add = [] } = {}) {
43
57
  const keep = withoutNodeModules(source);
44
58
  const filter = (src) => keep(src) && !exclude.includes(relative(source, src).split(sep)[0]);
45
59
  mkdirSync(dirname(dest), { recursive: true });
46
- const scratch = mkdtempSync(join(dirname(dest), ".pstack-stage-"));
60
+ const scratch = mkdtempSync(join(dirname(dest), `.pstack-stage-${process.pid}-${basename(dest)}-`));
47
61
  const fresh = join(scratch, "new");
48
62
  const old = join(scratch, "old");
49
63
  try {
@@ -62,4 +76,36 @@ export function stagePlugin(source, dest, { exclude = [], add = [] } = {}) {
62
76
  // When neither rename put a copy back at dest, the old copy is the only one left.
63
77
  if (entryExists(dest) || !entryExists(old)) rmSync(scratch, { recursive: true, force: true });
64
78
  }
79
+ return removeEarlierScratch(dest);
80
+ }
81
+
82
+ // A killed run leaves its scratch directory beside dest, and a run whose
83
+ // renames both failed leaves one holding the old copy. Once dest holds a fresh
84
+ // copy, neither is needed. A directory whose run is still going stays, since
85
+ // that run is still copying into it, and so does one that belongs to another
86
+ // destination in the same folder. 0.9.173's names carry neither fact, so any
87
+ // run removes them. A directory that cannot be listed or removed gives a
88
+ // warning, not an error, so it never fails an install that worked.
89
+ function removeEarlierScratch(dest) {
90
+ const parent = dirname(dest);
91
+ let names;
92
+ try {
93
+ names = readdirSync(parent);
94
+ } catch (error) {
95
+ return [`could not list ${parent}: ${error.code ?? error.message}`];
96
+ }
97
+ const warnings = [];
98
+ for (const name of names) {
99
+ const match = SCRATCH_NAME.exec(name);
100
+ if (!match) continue;
101
+ const [, pid, owner] = match;
102
+ if (pid && (owner !== basename(dest) || running(Number(pid)))) continue;
103
+ const path = join(parent, name);
104
+ try {
105
+ rmSync(path, { recursive: true, force: true });
106
+ } catch (error) {
107
+ warnings.push(`could not remove ${path}: ${error.code ?? error.message}`);
108
+ }
109
+ }
110
+ return warnings;
65
111
  }
package/lib/cli.mjs CHANGED
@@ -190,7 +190,7 @@ export async function main(argv) {
190
190
  if (needsBundle) {
191
191
  console.log(`\nStaging the bundled plugin at ${ctx.pluginDir}`);
192
192
  try {
193
- stagePlugin(source, ctx.pluginDir);
193
+ for (const warning of stagePlugin(source, ctx.pluginDir)) console.log(` ${warning}`);
194
194
  } catch (error) {
195
195
  console.error(`Could not stage the plugin at ${ctx.pluginDir}: ${error.message}`);
196
196
  return 1;
package/lib/harnesses.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { isAbsolute, join } from "node:path";
1
+ import { isAbsolute, join, sep } from "node:path";
2
2
 
3
3
  const REPO = "michael-denyer/pstack-claude";
4
4
  const SKILLS_LABEL =
@@ -121,20 +121,31 @@ export const HARNESSES = [
121
121
  needsBundle: true,
122
122
  // Vibe's native plugin format needs its manifest at the plugin root, so the
123
123
  // build under vibe/ is copied there after the shared tree.
124
- // Vibe loads user plugins from $VIBE_HOME/plugins when VIBE_HOME is set. A
125
- // relative value is ignored, since Vibe resolves it against its own
126
- // working directory and this one may differ.
127
- steps: ({ home, env, pluginDir }) => [
128
- {
129
- kind: "stage",
130
- from: pluginDir,
131
- to: join(isAbsolute(env.VIBE_HOME ?? "") ? env.VIBE_HOME : join(home, ".vibe"), "plugins", "pstack"),
132
- add: [
133
- { from: "vibe/plugin.json", to: "plugin.json" },
134
- { from: "vibe/ai.mistral.vibe", to: "ai.mistral.vibe" },
135
- ],
136
- },
137
- ],
124
+ // Vibe loads user plugins from $VIBE_HOME/plugins when VIBE_HOME is set. It
125
+ // expands a leading ~ to the home directory, and so does this. Any other
126
+ // relative value is ignored, with a warning, since Vibe resolves it against
127
+ // its own working directory and this one may differ.
128
+ steps: ({ home, env, pluginDir }) => {
129
+ const value = env.VIBE_HOME ?? "";
130
+ const tilde = value === "~" || value.startsWith("~/") || (sep === "\\" && value.startsWith("~\\"));
131
+ const vibeHome = tilde ? join(home, value.slice(1)) : value;
132
+ const ignored = vibeHome !== "" && !isAbsolute(vibeHome);
133
+ const to = join(isAbsolute(vibeHome) ? vibeHome : join(home, ".vibe"), "plugins", "pstack");
134
+ return [
135
+ {
136
+ kind: "stage",
137
+ from: pluginDir,
138
+ to,
139
+ add: [
140
+ { from: "vibe/plugin.json", to: "plugin.json" },
141
+ { from: "vibe/ai.mistral.vibe", to: "ai.mistral.vibe" },
142
+ ],
143
+ ...(ignored && {
144
+ warning: `VIBE_HOME "${value}" is not an absolute path, so pstack goes to ${to} instead. Vibe resolves a relative VIBE_HOME against the folder it starts in. Set VIBE_HOME to an absolute path and run again.`,
145
+ }),
146
+ },
147
+ ];
148
+ },
138
149
  },
139
150
  {
140
151
  id: "agy",
package/lib/steps.mjs CHANGED
@@ -21,7 +21,7 @@ export function describeStep(step) {
21
21
  case "copy":
22
22
  return `copy: ${step.from} -> ${step.to}`;
23
23
  case "stage":
24
- return `stage: ${step.from} -> ${step.to}${step.exclude?.length ? ` (without ${step.exclude.join(", ")})` : ""}`;
24
+ return `stage: ${step.from} -> ${step.to}${step.exclude?.length ? ` (without ${step.exclude.join(", ")})` : ""}${step.warning ? `\n warning: ${step.warning}` : ""}`;
25
25
  case "link-skills":
26
26
  return `link each skill under ${step.from} into ${step.to}`;
27
27
  case "manual":
@@ -90,8 +90,8 @@ const EXECUTORS = {
90
90
  }
91
91
  },
92
92
  stage: (step) => {
93
- stagePlugin(step.from, step.to, { exclude: step.exclude, add: step.add });
94
- return { ok: true };
93
+ const warnings = stagePlugin(step.from, step.to, { exclude: step.exclude, add: step.add });
94
+ return warnings.length ? { ok: true, detail: warnings.join("\n ") } : { ok: true };
95
95
  },
96
96
  "link-skills": (step, ctx) => {
97
97
  mkdirSync(step.to, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-pstack",
3
- "version": "0.9.173",
3
+ "version": "0.9.174",
4
4
  "description": "Install pstack into the agent harnesses on this machine: Claude Code, Codex, Pi, Copilot, Muse, OMP, Kimi, Grok, MiniMax, OpenCode, Antigravity, Vibe, and the shared skills directory.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.173",
3
+ "version": "0.9.174",
4
4
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to Antigravity. Original pstack by Lauren Tan (poteto).",
5
5
  "author": "Michael Denyer",
6
6
  "logo": "assets/pstack-icon.png",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pstack",
3
3
  "displayName": "pstack (Claude Code port)",
4
- "version": "0.9.173",
4
+ "version": "0.9.174",
5
5
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to Claude Code. Original pstack by Lauren Tan (poteto).",
6
6
  "author": {
7
7
  "name": "Michael Denyer",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.173",
3
+ "version": "0.9.174",
4
4
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Codex port of the Claude Code plugin; skills are shared, tool names resolve via skills/poteto-mode/references/codex-tools.md. Original pstack by Lauren Tan (poteto).",
5
5
  "author": {
6
6
  "name": "Michael Denyer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pstack",
3
3
  "displayName": "pstack (GitHub Copilot port)",
4
- "version": "0.9.173",
4
+ "version": "0.9.174",
5
5
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to GitHub Copilot CLI and app. Original pstack by Lauren Tan (poteto).",
6
6
  "author": {
7
7
  "name": "Michael Denyer",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.173",
3
+ "version": "0.9.174",
4
4
  "description": "pstack workflows and skills for Grok Build",
5
5
  "skills": [
6
6
  "./skills",
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "name": "pstack",
4
4
  "displayName": "pstack (Muse port)",
5
- "version": "0.9.173",
5
+ "version": "0.9.174",
6
6
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. Rigorous agent workflows you can parallelize with confidence. Muse port of the Claude Code plugin; skills are shared, tool names resolve via skills/poteto-mode/references/muse-tools.md. Original pstack by Lauren Tan (poteto).",
7
7
  "compat": {
8
8
  "source": "native",
@@ -55,10 +55,13 @@ case "$runtime" in
55
55
  vibe)
56
56
  # Vibe sets PLUGIN_ROOT for a plugin hook and runs it in the plugin root.
57
57
  : "${PLUGIN_ROOT:=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)}"
58
- # Vibe reads $VIBE_HOME when it is set. The hook runs in the plugin root, so
59
- # a relative value would name another directory than Vibe's; ignore it.
58
+ # Vibe reads $VIBE_HOME when it is set and expands a leading ~. The hook
59
+ # runs in the plugin root, so any other relative value would name another
60
+ # directory than Vibe's; ignore it. Under Git Bash on Windows an absolute
61
+ # value starts with a drive letter.
60
62
  case "${VIBE_HOME:-}" in
61
- /*) sheet="$VIBE_HOME/pstack-models.md" ;;
63
+ /* | [A-Za-z]:[\\/]*) sheet="$VIBE_HOME/pstack-models.md" ;;
64
+ "~" | "~"/*) sheet="$HOME${VIBE_HOME#?}/pstack-models.md" ;;
62
65
  *) sheet="$HOME/.vibe/pstack-models.md" ;;
63
66
  esac
64
67
  reader="${PLUGIN_ROOT}/skills/setup-pstack/scripts/read-sheet.sh"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pstack",
3
- "version": "0.9.173",
3
+ "version": "0.9.174",
4
4
  "private": true,
5
5
  "omp": {
6
6
  "extensions": ["./omp/index.mjs"]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pstack",
4
- "version": "0.9.173",
4
+ "version": "0.9.174",
5
5
  "description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to Vibe. Original pstack by Lauren Tan (poteto).",
6
6
  "author": {
7
7
  "name": "Michael Denyer",