@justjoshn/pi-pstack 0.15.36-pi.1 → 0.15.36-pi.12
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/CHANGELOG.md +94 -0
- package/README.md +29 -24
- package/agents/ci-watcher.md +28 -0
- package/agents/thermo-nuclear-code-quality-review.md +23 -0
- package/assets/logo.png +0 -0
- package/automations/benny/FOR_AGENTS.md +2 -1
- package/automations/benny/README.md +2 -2
- package/automations/benny/skills/setup-benny/SKILL.md +10 -9
- package/automations/benny/templates/reproduce-automation-prompt.md +1 -1
- package/automations/benny/templates/triage-automation-prompt.md +1 -1
- package/bin/pstack-routines-supervisor +9 -0
- package/docs/guide/01-setup.md +2 -2
- package/docs/guide/07-overnight.md +1 -1
- package/docs/guide/09-make-it-yours.md +1 -1
- package/docs/guide/10-recipes-and-pitfalls.md +1 -1
- package/docs/native-gaps.md +14 -8
- package/docs/parity-reverse-engineering.md +94 -0
- package/docs/parity-status.md +128 -0
- package/package.json +41 -6
- package/packaging/install-supervisor-unit.sh +164 -0
- package/packaging/launchd/com.pstack.routines-supervisor.plist.example +24 -0
- package/packaging/systemd/pstack-routines-supervisor.service.example +15 -0
- package/skills/architect/SKILL.md +1 -1
- package/skills/architect/references/runner-prompt.md +1 -1
- package/skills/arena/SKILL.md +4 -4
- package/skills/check-compiler-errors/SKILL.md +23 -0
- package/skills/create-skill/SKILL.md +515 -29
- package/skills/fix-ci/SKILL.md +29 -0
- package/skills/fix-merge-conflicts/SKILL.md +32 -0
- package/skills/get-pr-comments/SKILL.md +23 -0
- package/skills/how/SKILL.md +1 -1
- package/skills/ketchup/SKILL.md +2 -2
- package/skills/ketchup-video/SKILL.md +2 -2
- package/skills/loop-on-ci/SKILL.md +50 -0
- package/skills/make-bot-ui/SKILL.md +2 -2
- package/skills/make-pr-easy-to-review/SKILL.md +59 -0
- package/skills/new-branch-and-pr/SKILL.md +29 -0
- package/skills/no-inline-imports/SKILL.md +12 -0
- package/skills/poteto-help/SKILL.md +4 -4
- package/skills/poteto-mode/SKILL.md +2 -2
- package/skills/poteto-mode/playbooks/bug-fix.md +1 -1
- package/skills/poteto-mode/playbooks/feature.md +1 -1
- package/skills/poteto-mode/playbooks/hillclimb.md +1 -1
- package/skills/poteto-mode/playbooks/multi-phase-plan.md +2 -2
- package/skills/poteto-mode/playbooks/orchestrate.md +2 -2
- package/skills/poteto-mode/playbooks/perf-issue.md +1 -1
- package/skills/poteto-mode/playbooks/refactoring.md +1 -1
- package/skills/pr-review-canvas/SKILL.md +176 -0
- package/skills/pr-review-canvas/renderer.js +170 -0
- package/skills/pr-review-canvas/styles.css +96 -0
- package/skills/pr-review-canvas/template.html +18 -0
- package/skills/reflect/SKILL.md +2 -2
- package/skills/review-and-ship/SKILL.md +41 -0
- package/skills/run-smoke-tests/SKILL.md +42 -0
- package/skills/setup-pstack/SKILL.md +13 -13
- package/skills/statechart/scripts/test/cli.test.ts +1 -1
- package/skills/swarm/SKILL.md +2 -2
- package/skills/teach/SKILL.md +1 -1
- package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
- package/skills/typescript-exhaustive-switch/SKILL.md +10 -0
- package/skills/verify-this/SKILL.md +74 -0
- package/skills/weekly-review/SKILL.md +32 -0
- package/skills/what-did-i-get-done/SKILL.md +31 -0
- package/skills/why/SKILL.md +2 -2
- package/skills/workflow-from-chats/SKILL.md +50 -0
- package/src/ask.ts +24 -10
- package/src/child-env.ts +15 -2
- package/src/generate-image.ts +98 -0
- package/src/index.ts +28 -9
- package/src/loop.ts +74 -17
- package/src/mode.ts +89 -27
- package/src/paths.ts +18 -0
- package/src/pi-command.ts +12 -0
- package/src/plan.ts +285 -30
- package/src/rule.ts +4 -4
- package/src/sections.ts +27 -3
- package/src/subscriptions/durable-store.ts +531 -0
- package/src/subscriptions/durable-types.ts +69 -0
- package/src/subscriptions/ensure-supervisor.ts +67 -0
- package/src/subscriptions/index.ts +310 -282
- package/src/subscriptions/supervisor-main.ts +134 -0
- package/src/subscriptions/supervisor.ts +325 -0
- package/src/subscriptions/webhook.ts +82 -21
- package/src/task/agents.ts +39 -3
- package/src/task/card.ts +31 -0
- package/src/task/format.ts +17 -3
- package/src/task/models.ts +7 -0
- package/src/task/progress.ts +112 -0
- package/src/task/records.ts +7 -9
- package/src/task/registry.ts +9 -4
- package/src/task/runner.ts +116 -24
- package/src/task/stop.ts +3 -3
- package/src/task/tool.ts +158 -57
- package/src/task/worktree.ts +5 -3
- package/src/todo.ts +29 -4
- package/scripts/live-e2e.mjs +0 -257
- package/test/aliases.test.ts +0 -57
- package/test/ask.test.ts +0 -85
- package/test/autocomplete.test.ts +0 -39
- package/test/e2e/aliases.e2e.test.ts +0 -81
- package/test/e2e/ask.e2e.test.ts +0 -135
- package/test/e2e/harness.ts +0 -179
- package/test/e2e/host.e2e.test.ts +0 -193
- package/test/e2e/lifecycle.e2e.test.ts +0 -99
- package/test/e2e/mode.e2e.test.ts +0 -160
- package/test/e2e/package.e2e.test.ts +0 -67
- package/test/e2e/task.e2e.test.ts +0 -734
- package/test/e2e/todo.e2e.test.ts +0 -59
- package/test/fixtures/cursor-askquestion-calls.json +0 -806
- package/test/fixtures/fake-pi.mjs +0 -96
- package/test/fixtures/image-model.ts +0 -16
- package/test/fixtures/list-models.ts +0 -15
- package/test/fixtures/readonly-shell-exit.ts +0 -17
- package/test/fixtures/scripted-model.ts +0 -113
- package/test/loop.test.ts +0 -209
- package/test/mode.test.ts +0 -143
- package/test/plan.test.ts +0 -126
- package/test/readonly-shell-security.test.ts +0 -84
- package/test/readonly-shell.test.ts +0 -44
- package/test/records.test.ts +0 -143
- package/test/registry.test.ts +0 -18
- package/test/resources.test.ts +0 -162
- package/test/rule.test.ts +0 -92
- package/test/scripts.test.ts +0 -182
- package/test/sections.test.ts +0 -56
- package/test/subscriptions-cron.test.ts +0 -60
- package/test/subscriptions.test.ts +0 -598
- package/test/task-agents.test.ts +0 -49
- package/test/task-card.test.ts +0 -34
- package/test/task-fork.test.ts +0 -233
- package/test/task-format.test.ts +0 -65
- package/test/task-model.test.ts +0 -141
- package/test/task-runner.test.ts +0 -259
- package/test/task-schema.test.ts +0 -50
- package/test/task-status.test.ts +0 -155
- package/test/task-worktree.test.ts +0 -106
- package/test/todo.test.ts +0 -74
- package/test/visualize.test.ts +0 -152
- package/tsconfig.json +0 -5
- package/vitest.config.ts +0 -16
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { execFileSync } from 'node:child_process';
|
|
2
|
-
import { cpSync, existsSync, readFileSync } from 'node:fs';
|
|
3
|
-
import { join, resolve } from 'node:path';
|
|
4
|
-
|
|
5
|
-
import { afterEach, beforeEach, expect, test } from 'vitest';
|
|
6
|
-
import { PACKAGE_ROOT } from '../../src/paths.ts';
|
|
7
|
-
import { contentText, makeSandbox, piInvocation, runJson, type Sandbox, script, startRpc, toolEnds } from './harness.ts';
|
|
8
|
-
|
|
9
|
-
let sandbox: Sandbox;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
sandbox = makeSandbox({ packages: [] });
|
|
12
|
-
});
|
|
13
|
-
afterEach(() => sandbox.dispose());
|
|
14
|
-
|
|
15
|
-
const pi = (...args: string[]) => execFileSync(...piInvocation(args), { cwd: sandbox.workDir, env: sandbox.env, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
16
|
-
const settingsPackages = () => ((JSON.parse(readFileSync(join(sandbox.agentDir, 'settings.json'), 'utf8')) as { packages?: string[] }).packages ?? []).map((entry) => resolve(sandbox.agentDir, entry));
|
|
17
|
-
|
|
18
|
-
async function discovered(): Promise<{ commands: string[]; tools: string }> {
|
|
19
|
-
const rpc = startRpc(sandbox, ['--no-session']);
|
|
20
|
-
try {
|
|
21
|
-
rpc.send({ id: 'commands', type: 'get_commands' });
|
|
22
|
-
const response = await rpc.waitFor((event) => event['id'] === 'commands');
|
|
23
|
-
const commands = ((response['data'] as { commands: { name: string }[] }).commands ?? []).map((command) => command.name);
|
|
24
|
-
rpc.send({ type: 'prompt', message: 'list\n@@tools-list' });
|
|
25
|
-
const reply = await rpc.waitFor((event) => event.type === 'message_end' && (event['message'] as { role: string }).role === 'assistant');
|
|
26
|
-
return { commands, tools: contentText((reply['message'] as { content: { type: string; text?: string }[] }).content) };
|
|
27
|
-
} finally {
|
|
28
|
-
await rpc.close();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
test('installs from a fresh copy without node_modules, then removes cleanly (PKG-001)', async () => {
|
|
33
|
-
const copy = join(sandbox.root, 'pi-pstack');
|
|
34
|
-
cpSync(PACKAGE_ROOT, copy, { recursive: true, filter: (source) => !/\/(node_modules|coverage)(\/|$)/.test(source.slice(PACKAGE_ROOT.length)) });
|
|
35
|
-
expect(existsSync(join(copy, 'node_modules'))).toBe(false);
|
|
36
|
-
|
|
37
|
-
pi('install', copy);
|
|
38
|
-
expect(settingsPackages()).toEqual([copy]);
|
|
39
|
-
const installed = await discovered();
|
|
40
|
-
expect(installed.commands.filter((name) => ['mode', 'loop', 'skill:poteto-mode', 'skill:how', 'skill:create-skill', 'skill:deslop'].includes(name)).toSorted()).toEqual([
|
|
41
|
-
'loop',
|
|
42
|
-
'mode',
|
|
43
|
-
'skill:create-skill',
|
|
44
|
-
'skill:deslop',
|
|
45
|
-
'skill:how',
|
|
46
|
-
'skill:poteto-mode',
|
|
47
|
-
]);
|
|
48
|
-
expect(installed.commands.filter((name) => name.startsWith('skill:'))).toHaveLength(62);
|
|
49
|
-
expect(
|
|
50
|
-
installed.tools
|
|
51
|
-
.split(',')
|
|
52
|
-
.filter((name) => ['Task', 'TodoWrite', 'AskQuestion', 'Loop'].includes(name))
|
|
53
|
-
.toSorted(),
|
|
54
|
-
).toEqual(['AskQuestion', 'Loop', 'Task', 'TodoWrite']);
|
|
55
|
-
|
|
56
|
-
// A local install gets no dependency install, so the readonly shell has no sandbox module and must refuse (TASK-019).
|
|
57
|
-
const steps = [{ tool: 'bash', args: { command: 'touch escaped.txt' } }];
|
|
58
|
-
const readonlyRun = await runJson(sandbox, script([{ tool: 'Task', args: { description: 'ro', prompt: `go\n@@script ${JSON.stringify(steps)}`, readonly: true } }]), ['--no-session']);
|
|
59
|
-
expect(toolEnds(readonlyRun.events, 'Task')[0]?.text).toContain('no verified OS sandbox is available');
|
|
60
|
-
expect(existsSync(join(sandbox.workDir, 'escaped.txt'))).toBe(false);
|
|
61
|
-
|
|
62
|
-
pi('remove', copy);
|
|
63
|
-
expect(settingsPackages()).toEqual([]);
|
|
64
|
-
const removed = await discovered();
|
|
65
|
-
expect(removed.commands.filter((name) => name === 'mode' || name.startsWith('skill:'))).toEqual([]);
|
|
66
|
-
expect(removed.tools.split(',').filter((name) => ['Task', 'TodoWrite'].includes(name))).toEqual([]);
|
|
67
|
-
});
|