@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.
Files changed (140) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/README.md +29 -24
  3. package/agents/ci-watcher.md +28 -0
  4. package/agents/thermo-nuclear-code-quality-review.md +23 -0
  5. package/assets/logo.png +0 -0
  6. package/automations/benny/FOR_AGENTS.md +2 -1
  7. package/automations/benny/README.md +2 -2
  8. package/automations/benny/skills/setup-benny/SKILL.md +10 -9
  9. package/automations/benny/templates/reproduce-automation-prompt.md +1 -1
  10. package/automations/benny/templates/triage-automation-prompt.md +1 -1
  11. package/bin/pstack-routines-supervisor +9 -0
  12. package/docs/guide/01-setup.md +2 -2
  13. package/docs/guide/07-overnight.md +1 -1
  14. package/docs/guide/09-make-it-yours.md +1 -1
  15. package/docs/guide/10-recipes-and-pitfalls.md +1 -1
  16. package/docs/native-gaps.md +14 -8
  17. package/docs/parity-reverse-engineering.md +94 -0
  18. package/docs/parity-status.md +128 -0
  19. package/package.json +41 -6
  20. package/packaging/install-supervisor-unit.sh +164 -0
  21. package/packaging/launchd/com.pstack.routines-supervisor.plist.example +24 -0
  22. package/packaging/systemd/pstack-routines-supervisor.service.example +15 -0
  23. package/skills/architect/SKILL.md +1 -1
  24. package/skills/architect/references/runner-prompt.md +1 -1
  25. package/skills/arena/SKILL.md +4 -4
  26. package/skills/check-compiler-errors/SKILL.md +23 -0
  27. package/skills/create-skill/SKILL.md +515 -29
  28. package/skills/fix-ci/SKILL.md +29 -0
  29. package/skills/fix-merge-conflicts/SKILL.md +32 -0
  30. package/skills/get-pr-comments/SKILL.md +23 -0
  31. package/skills/how/SKILL.md +1 -1
  32. package/skills/ketchup/SKILL.md +2 -2
  33. package/skills/ketchup-video/SKILL.md +2 -2
  34. package/skills/loop-on-ci/SKILL.md +50 -0
  35. package/skills/make-bot-ui/SKILL.md +2 -2
  36. package/skills/make-pr-easy-to-review/SKILL.md +59 -0
  37. package/skills/new-branch-and-pr/SKILL.md +29 -0
  38. package/skills/no-inline-imports/SKILL.md +12 -0
  39. package/skills/poteto-help/SKILL.md +4 -4
  40. package/skills/poteto-mode/SKILL.md +2 -2
  41. package/skills/poteto-mode/playbooks/bug-fix.md +1 -1
  42. package/skills/poteto-mode/playbooks/feature.md +1 -1
  43. package/skills/poteto-mode/playbooks/hillclimb.md +1 -1
  44. package/skills/poteto-mode/playbooks/multi-phase-plan.md +2 -2
  45. package/skills/poteto-mode/playbooks/orchestrate.md +2 -2
  46. package/skills/poteto-mode/playbooks/perf-issue.md +1 -1
  47. package/skills/poteto-mode/playbooks/refactoring.md +1 -1
  48. package/skills/pr-review-canvas/SKILL.md +176 -0
  49. package/skills/pr-review-canvas/renderer.js +170 -0
  50. package/skills/pr-review-canvas/styles.css +96 -0
  51. package/skills/pr-review-canvas/template.html +18 -0
  52. package/skills/reflect/SKILL.md +2 -2
  53. package/skills/review-and-ship/SKILL.md +41 -0
  54. package/skills/run-smoke-tests/SKILL.md +42 -0
  55. package/skills/setup-pstack/SKILL.md +13 -13
  56. package/skills/statechart/scripts/test/cli.test.ts +1 -1
  57. package/skills/swarm/SKILL.md +2 -2
  58. package/skills/teach/SKILL.md +1 -1
  59. package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
  60. package/skills/typescript-exhaustive-switch/SKILL.md +10 -0
  61. package/skills/verify-this/SKILL.md +74 -0
  62. package/skills/weekly-review/SKILL.md +32 -0
  63. package/skills/what-did-i-get-done/SKILL.md +31 -0
  64. package/skills/why/SKILL.md +2 -2
  65. package/skills/workflow-from-chats/SKILL.md +50 -0
  66. package/src/ask.ts +24 -10
  67. package/src/child-env.ts +15 -2
  68. package/src/generate-image.ts +98 -0
  69. package/src/index.ts +28 -9
  70. package/src/loop.ts +74 -17
  71. package/src/mode.ts +89 -27
  72. package/src/paths.ts +18 -0
  73. package/src/pi-command.ts +12 -0
  74. package/src/plan.ts +285 -30
  75. package/src/rule.ts +4 -4
  76. package/src/sections.ts +27 -3
  77. package/src/subscriptions/durable-store.ts +531 -0
  78. package/src/subscriptions/durable-types.ts +69 -0
  79. package/src/subscriptions/ensure-supervisor.ts +67 -0
  80. package/src/subscriptions/index.ts +310 -282
  81. package/src/subscriptions/supervisor-main.ts +134 -0
  82. package/src/subscriptions/supervisor.ts +325 -0
  83. package/src/subscriptions/webhook.ts +82 -21
  84. package/src/task/agents.ts +39 -3
  85. package/src/task/card.ts +31 -0
  86. package/src/task/format.ts +17 -3
  87. package/src/task/models.ts +7 -0
  88. package/src/task/progress.ts +112 -0
  89. package/src/task/records.ts +7 -9
  90. package/src/task/registry.ts +9 -4
  91. package/src/task/runner.ts +116 -24
  92. package/src/task/stop.ts +3 -3
  93. package/src/task/tool.ts +158 -57
  94. package/src/task/worktree.ts +5 -3
  95. package/src/todo.ts +29 -4
  96. package/scripts/live-e2e.mjs +0 -257
  97. package/test/aliases.test.ts +0 -57
  98. package/test/ask.test.ts +0 -85
  99. package/test/autocomplete.test.ts +0 -39
  100. package/test/e2e/aliases.e2e.test.ts +0 -81
  101. package/test/e2e/ask.e2e.test.ts +0 -135
  102. package/test/e2e/harness.ts +0 -179
  103. package/test/e2e/host.e2e.test.ts +0 -193
  104. package/test/e2e/lifecycle.e2e.test.ts +0 -99
  105. package/test/e2e/mode.e2e.test.ts +0 -160
  106. package/test/e2e/package.e2e.test.ts +0 -67
  107. package/test/e2e/task.e2e.test.ts +0 -734
  108. package/test/e2e/todo.e2e.test.ts +0 -59
  109. package/test/fixtures/cursor-askquestion-calls.json +0 -806
  110. package/test/fixtures/fake-pi.mjs +0 -96
  111. package/test/fixtures/image-model.ts +0 -16
  112. package/test/fixtures/list-models.ts +0 -15
  113. package/test/fixtures/readonly-shell-exit.ts +0 -17
  114. package/test/fixtures/scripted-model.ts +0 -113
  115. package/test/loop.test.ts +0 -209
  116. package/test/mode.test.ts +0 -143
  117. package/test/plan.test.ts +0 -126
  118. package/test/readonly-shell-security.test.ts +0 -84
  119. package/test/readonly-shell.test.ts +0 -44
  120. package/test/records.test.ts +0 -143
  121. package/test/registry.test.ts +0 -18
  122. package/test/resources.test.ts +0 -162
  123. package/test/rule.test.ts +0 -92
  124. package/test/scripts.test.ts +0 -182
  125. package/test/sections.test.ts +0 -56
  126. package/test/subscriptions-cron.test.ts +0 -60
  127. package/test/subscriptions.test.ts +0 -598
  128. package/test/task-agents.test.ts +0 -49
  129. package/test/task-card.test.ts +0 -34
  130. package/test/task-fork.test.ts +0 -233
  131. package/test/task-format.test.ts +0 -65
  132. package/test/task-model.test.ts +0 -141
  133. package/test/task-runner.test.ts +0 -259
  134. package/test/task-schema.test.ts +0 -50
  135. package/test/task-status.test.ts +0 -155
  136. package/test/task-worktree.test.ts +0 -106
  137. package/test/todo.test.ts +0 -74
  138. package/test/visualize.test.ts +0 -152
  139. package/tsconfig.json +0 -5
  140. 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
- });