sisyphi 1.0.7 → 1.0.9

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 (29) hide show
  1. package/dist/daemon.js +22 -14
  2. package/dist/daemon.js.map +1 -1
  3. package/dist/templates/agent-plugin/hooks/CLAUDE.md +57 -0
  4. package/dist/templates/agent-plugin/hooks/debug-user-prompt.sh +15 -0
  5. package/dist/templates/agent-plugin/hooks/hooks.json +12 -8
  6. package/dist/templates/agent-plugin/hooks/operator-user-prompt.sh +14 -0
  7. package/dist/templates/agent-plugin/hooks/plan-user-prompt.sh +1 -4
  8. package/dist/templates/agent-plugin/hooks/review-plan-user-prompt.sh +16 -0
  9. package/dist/templates/agent-plugin/hooks/review-user-prompt.sh +16 -0
  10. package/dist/templates/agent-plugin/hooks/spec-user-prompt.sh +1 -4
  11. package/dist/templates/agent-plugin/hooks/test-spec-user-prompt.sh +14 -0
  12. package/dist/templates/companion-plugin/hooks/hooks.json +6 -4
  13. package/dist/templates/orchestrator-base.md +9 -9
  14. package/dist/templates/orchestrator-impl.md +14 -8
  15. package/dist/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +26 -12
  16. package/package.json +1 -1
  17. package/templates/agent-plugin/hooks/CLAUDE.md +57 -0
  18. package/templates/agent-plugin/hooks/debug-user-prompt.sh +15 -0
  19. package/templates/agent-plugin/hooks/hooks.json +12 -8
  20. package/templates/agent-plugin/hooks/operator-user-prompt.sh +14 -0
  21. package/templates/agent-plugin/hooks/plan-user-prompt.sh +1 -4
  22. package/templates/agent-plugin/hooks/review-plan-user-prompt.sh +16 -0
  23. package/templates/agent-plugin/hooks/review-user-prompt.sh +16 -0
  24. package/templates/agent-plugin/hooks/spec-user-prompt.sh +1 -4
  25. package/templates/agent-plugin/hooks/test-spec-user-prompt.sh +14 -0
  26. package/templates/companion-plugin/hooks/hooks.json +6 -4
  27. package/templates/orchestrator-base.md +9 -9
  28. package/templates/orchestrator-impl.md +14 -8
  29. package/templates/orchestrator-plugin/skills/orchestration/task-patterns.md +26 -12
package/dist/daemon.js CHANGED
@@ -1058,23 +1058,28 @@ function createAgentPlugin(cwd, sessionId, agentId, agentType, agentConfig) {
1058
1058
  }
1059
1059
  const hooksConfig = {
1060
1060
  PreToolUse: [
1061
- { matcher: "SendMessage", hook: { type: "command", command: "bash hooks/intercept-send-message.sh" } }
1061
+ { matcher: "SendMessage", hooks: [{ type: "command", command: "bash ${CLAUDE_PLUGIN_ROOT}/hooks/intercept-send-message.sh" }] }
1062
1062
  ],
1063
1063
  Stop: [
1064
- { hook: { type: "command", command: "bash hooks/require-submit.sh" } }
1064
+ { hooks: [{ type: "command", command: "bash ${CLAUDE_PLUGIN_ROOT}/hooks/require-submit.sh" }] }
1065
1065
  ]
1066
1066
  };
1067
1067
  const normalizedType = agentType?.replace(/^sisyphus:/, "") ?? "";
1068
- if (normalizedType === "plan") {
1069
- hooksConfig.UserPromptSubmit = [
1070
- { hook: { type: "command", command: "bash hooks/plan-user-prompt.sh" } }
1071
- ];
1072
- copyFileSync2(`${srcHooks}/plan-user-prompt.sh`, `${base}/hooks/plan-user-prompt.sh`);
1073
- } else if (normalizedType === "spec-draft") {
1068
+ const userPromptHooks = {
1069
+ "plan": "plan-user-prompt.sh",
1070
+ "spec-draft": "spec-user-prompt.sh",
1071
+ "review": "review-user-prompt.sh",
1072
+ "review-plan": "review-plan-user-prompt.sh",
1073
+ "debug": "debug-user-prompt.sh",
1074
+ "operator": "operator-user-prompt.sh",
1075
+ "test-spec": "test-spec-user-prompt.sh"
1076
+ };
1077
+ const hookScript = userPromptHooks[normalizedType];
1078
+ if (hookScript) {
1074
1079
  hooksConfig.UserPromptSubmit = [
1075
- { hook: { type: "command", command: "bash hooks/spec-user-prompt.sh" } }
1080
+ { hooks: [{ type: "command", command: `bash \${CLAUDE_PLUGIN_ROOT}/hooks/${hookScript}` }] }
1076
1081
  ];
1077
- copyFileSync2(`${srcHooks}/spec-user-prompt.sh`, `${base}/hooks/spec-user-prompt.sh`);
1082
+ copyFileSync2(`${srcHooks}/${hookScript}`, `${base}/hooks/${hookScript}`);
1078
1083
  }
1079
1084
  writeFileSync4(`${base}/hooks/hooks.json`, JSON.stringify({ hooks: hooksConfig }, null, 2), "utf-8");
1080
1085
  return base;
@@ -1320,14 +1325,17 @@ async function handleAgentSubmit(cwd, sessionId, agentId, report) {
1320
1325
  });
1321
1326
  const session = getSession(cwd, sessionId);
1322
1327
  const agent = session.agents.find((a) => a.id === agentId);
1328
+ const allDone = allAgentsDone(session);
1323
1329
  if (agent?.paneId) {
1324
1330
  unregisterAgentPane(sessionId, agentId);
1325
- try {
1326
- killPane(agent.paneId);
1327
- } catch {
1331
+ if (!allDone) {
1332
+ try {
1333
+ killPane(agent.paneId);
1334
+ } catch {
1335
+ }
1328
1336
  }
1329
1337
  }
1330
- return allAgentsDone(getSession(cwd, sessionId));
1338
+ return allDone;
1331
1339
  }
1332
1340
  async function handleAgentKilled(cwd, sessionId, agentId, reason) {
1333
1341
  unregisterAgentPane(sessionId, agentId);