Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion harness/pstack/claude-code/.claude-plugin/plugin.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion harness/pstack/claude-code/plugin.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion harness/pstack/claude-code/skills/statechart/SKILL.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions harness/pstack/claude-code/skills/statechart/scripts/janitor.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions harness/pstack/claude-code/skills/statechart/scripts/kill.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 9 additions & 15 deletions harness/pstack/claude-code/skills/statechart/scripts/run.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions harness/pstack/claude-code/skills/statechart/scripts/statechart.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pstack/.cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pstack",
"displayName": "pstack",
"version": "0.15.45",
"version": "0.15.46",
"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.",
"author": {
"name": "Lauren Tan"
Expand Down
2 changes: 1 addition & 1 deletion pstack/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "pstack",
"version": "0.15.45",
"version": "0.15.46",
"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.",
"author": {
"name": "Lauren Tan"
Expand Down
2 changes: 1 addition & 1 deletion pstack/skills/statechart/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Work in a scratch folder outside the repo. Write a TLA+ spec and its config. The
<skill dir>/scripts/statechart SPEC.tla [--config FILE] [--view FILE] [--out DIR]
```

`scripts/statechart.ts` is TypeScript, so run it with a runtime that can execute TypeScript.
`scripts/statechart.ts` is TypeScript, so run it with a runtime that can execute TypeScript. `scripts/statechart` is a POSIX shell script that picks one. On native Windows, run `node --disable-warning=ExperimentalWarning <skill dir>/scripts/statechart.ts` with Node 22.18 to 22.x, or Node 23.6 or later.

The first run installs TLC and Java with mise and needs the network.

Expand Down
5 changes: 4 additions & 1 deletion pstack/skills/statechart/scripts/frontends/dot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export const parseState = (label: string, parsed = new Map<string, [string, Valu

export type Lines = string | Iterable<string>;

export const linesOf = (input: Lines) => (typeof input === "string" ? input.split("\n") : input);
export const splitLines = (text: string) =>
(text.endsWith("\r") ? text.slice(0, -1) : text).split(/\r?\n/);

export const linesOf = (input: Lines) => (typeof input === "string" ? splitLines(input) : input);

export function parseDot(input: Lines): Graph {
const states = new Map<string, State>();
Expand Down
13 changes: 13 additions & 0 deletions pstack/skills/statechart/scripts/janitor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import fs from "node:fs";
import { finished } from "node:stream/promises";
import { killGroup } from "./kill.ts";

const [pid, ...dirs] = process.argv.slice(2);

let input = "";
process.stdin.setEncoding("utf8").on("data", (chunk: string) => (input += chunk));
await finished(process.stdin).catch(() => {});
const running = !input.includes("exited");
const groupOutlivesWorker = process.platform !== "win32";
if (running || groupOutlivesWorker) await killGroup(Number(pid));
for (const dir of dirs) fs.rmSync(dir, { recursive: true, force: true });
15 changes: 15 additions & 0 deletions pstack/skills/statechart/scripts/kill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { spawn } from "node:child_process";

export const killGroup = (pid: number) =>
new Promise<void>((resolve) => {
if (process.platform === "win32") {
spawn("taskkill", ["/pid", String(pid), "/t", "/f"], { stdio: "ignore" })
.on("error", () => resolve())
.on("exit", () => resolve());
return;
}
try {
process.kill(-pid, "SIGKILL");
} catch {}
resolve();
});
Loading
Loading