spets 0.2.7 → 0.2.8
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/dist/index.js +35 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -588,11 +588,11 @@ You execute spets workflow commands. Follow orchestrator instructions exactly.
|
|
|
588
588
|
|
|
589
589
|
IF \`$ARGUMENTS\` starts with "resume":
|
|
590
590
|
Extract optional task ID from arguments (e.g. "resume abc-123" or "resume --task abc-123")
|
|
591
|
-
RUN \`npx spets orchestrate resume <taskId>\` (omit taskId if none provided)
|
|
591
|
+
RUN \`npx --yes spets orchestrate resume <taskId>\` (omit taskId if none provided)
|
|
592
592
|
ELSE IF \`$ARGUMENTS\` starts with "list":
|
|
593
|
-
RUN \`npx spets orchestrate list\`
|
|
593
|
+
RUN \`npx --yes spets orchestrate list\`
|
|
594
594
|
ELSE:
|
|
595
|
-
RUN \`npx spets orchestrate init "$ARGUMENTS"\`
|
|
595
|
+
RUN \`npx --yes spets orchestrate init "$ARGUMENTS"\`
|
|
596
596
|
|
|
597
597
|
## Loop
|
|
598
598
|
|
|
@@ -630,11 +630,11 @@ You execute spets workflow commands. Follow orchestrator instructions exactly.
|
|
|
630
630
|
|
|
631
631
|
IF \`$ARGUMENTS\` starts with "resume":
|
|
632
632
|
Extract optional task ID from arguments (e.g. "resume abc-123" or "resume --task abc-123")
|
|
633
|
-
RUN \`npx spets orchestrate resume <taskId>\` (omit taskId if none provided)
|
|
633
|
+
RUN \`node dist/index.js orchestrate resume <taskId> || npx --yes spets orchestrate resume <taskId>\` (omit taskId if none provided)
|
|
634
634
|
ELSE IF \`$ARGUMENTS\` starts with "list":
|
|
635
|
-
RUN \`npx spets orchestrate list\`
|
|
635
|
+
RUN \`node dist/index.js orchestrate list || npx --yes spets orchestrate list\`
|
|
636
636
|
ELSE:
|
|
637
|
-
RUN \`npx spets orchestrate init "$ARGUMENTS"\`
|
|
637
|
+
RUN \`node dist/index.js orchestrate init "$ARGUMENTS" || npx --yes spets orchestrate init "$ARGUMENTS"\`
|
|
638
638
|
|
|
639
639
|
## Loop
|
|
640
640
|
|
|
@@ -672,11 +672,11 @@ You execute spets workflow commands. Follow orchestrator instructions exactly.
|
|
|
672
672
|
|
|
673
673
|
IF \`$ARGUMENTS\` starts with "resume":
|
|
674
674
|
Extract optional task ID from arguments (e.g. "resume abc-123" or "resume --task abc-123")
|
|
675
|
-
RUN \`npx spets orchestrate resume <taskId>\` (omit taskId if none provided)
|
|
675
|
+
RUN \`npx --yes spets orchestrate resume <taskId>\` (omit taskId if none provided)
|
|
676
676
|
ELSE IF \`$ARGUMENTS\` starts with "list":
|
|
677
|
-
RUN \`npx spets orchestrate list\`
|
|
677
|
+
RUN \`npx --yes spets orchestrate list\`
|
|
678
678
|
ELSE:
|
|
679
|
-
RUN \`npx spets orchestrate init "$ARGUMENTS"\`
|
|
679
|
+
RUN \`npx --yes spets orchestrate init "$ARGUMENTS"\`
|
|
680
680
|
|
|
681
681
|
## Loop
|
|
682
682
|
|
|
@@ -1500,6 +1500,21 @@ var LIST_TASKS = "Show tasks to user. Ask which to resume. Run:\n npx spets orc
|
|
|
1500
1500
|
var LIST_EMPTY = "No resumable tasks found. Show this to the user. Stop.";
|
|
1501
1501
|
|
|
1502
1502
|
// src/orchestrator/responses.ts
|
|
1503
|
+
function getOrchestrateCommandPrefix() {
|
|
1504
|
+
const override = process.env.SPETS_ORCHESTRATE_CMD?.trim();
|
|
1505
|
+
if (override) {
|
|
1506
|
+
return override;
|
|
1507
|
+
}
|
|
1508
|
+
const entryScript = process.argv[1];
|
|
1509
|
+
if (entryScript && existsSync10(entryScript)) {
|
|
1510
|
+
const escapedPath = entryScript.includes(" ") ? `"${entryScript.replace(/"/g, '\\"')}"` : entryScript;
|
|
1511
|
+
return `node ${escapedPath} orchestrate`;
|
|
1512
|
+
}
|
|
1513
|
+
return "npx --yes spets orchestrate";
|
|
1514
|
+
}
|
|
1515
|
+
function buildOrchestrateCommand(args) {
|
|
1516
|
+
return `${getOrchestrateCommandPrefix()} ${args}`;
|
|
1517
|
+
}
|
|
1503
1518
|
function buildPhaseExploreResponse(cwd, state) {
|
|
1504
1519
|
const steps = getSteps(cwd);
|
|
1505
1520
|
const outputPath = getOutputPath(cwd);
|
|
@@ -1520,7 +1535,7 @@ function buildPhaseExploreResponse(cwd, state) {
|
|
|
1520
1535
|
previousOutput,
|
|
1521
1536
|
cwd
|
|
1522
1537
|
});
|
|
1523
|
-
const onComplete = `
|
|
1538
|
+
const onComplete = buildOrchestrateCommand(`explore-done ${state.taskId}`);
|
|
1524
1539
|
return {
|
|
1525
1540
|
type: "phase",
|
|
1526
1541
|
phase: "explore",
|
|
@@ -1549,7 +1564,7 @@ function buildPhaseClarifyResponse(cwd, state) {
|
|
|
1549
1564
|
// Legacy support
|
|
1550
1565
|
cwd
|
|
1551
1566
|
});
|
|
1552
|
-
const onComplete = `
|
|
1567
|
+
const onComplete = buildOrchestrateCommand(`clarify-done ${state.taskId}`);
|
|
1553
1568
|
return {
|
|
1554
1569
|
type: "phase",
|
|
1555
1570
|
phase: "clarify",
|
|
@@ -1605,7 +1620,7 @@ ${issues}`;
|
|
|
1605
1620
|
verifyFeedback,
|
|
1606
1621
|
cwd
|
|
1607
1622
|
});
|
|
1608
|
-
const onComplete = `
|
|
1623
|
+
const onComplete = buildOrchestrateCommand(`execute-done ${state.taskId}`);
|
|
1609
1624
|
const outputFile = join9(outputPath, state.taskId, `${state.currentStep}.md`);
|
|
1610
1625
|
return {
|
|
1611
1626
|
type: "phase",
|
|
@@ -1645,7 +1660,7 @@ function buildPhaseVerifyResponse(cwd, state) {
|
|
|
1645
1660
|
loadedKnowledge: state.loadedKnowledge?.map((k) => ({ filename: k.filename, content: k.content })),
|
|
1646
1661
|
cwd
|
|
1647
1662
|
});
|
|
1648
|
-
const onComplete = `
|
|
1663
|
+
const onComplete = buildOrchestrateCommand(`verify-done ${state.taskId}`);
|
|
1649
1664
|
return {
|
|
1650
1665
|
type: "phase",
|
|
1651
1666
|
phase: "verify",
|
|
@@ -1675,7 +1690,7 @@ function buildPhaseKnowledgeResponse(cwd, state) {
|
|
|
1675
1690
|
guide,
|
|
1676
1691
|
cwd
|
|
1677
1692
|
});
|
|
1678
|
-
const onComplete = `
|
|
1693
|
+
const onComplete = buildOrchestrateCommand(`knowledge-extract-done ${state.taskId}`);
|
|
1679
1694
|
return {
|
|
1680
1695
|
type: "phase",
|
|
1681
1696
|
phase: "knowledge",
|
|
@@ -1693,7 +1708,7 @@ function buildPhaseKnowledgeResponse(cwd, state) {
|
|
|
1693
1708
|
};
|
|
1694
1709
|
}
|
|
1695
1710
|
function buildCheckpointClarifyResponse(state) {
|
|
1696
|
-
const onComplete = `
|
|
1711
|
+
const onComplete = buildOrchestrateCommand(`clarified ${state.taskId}`);
|
|
1697
1712
|
return {
|
|
1698
1713
|
type: "checkpoint",
|
|
1699
1714
|
checkpoint: "clarify",
|
|
@@ -1708,10 +1723,10 @@ function buildCheckpointApproveResponse(cwd, state) {
|
|
|
1708
1723
|
const outputPath = getOutputPath(cwd);
|
|
1709
1724
|
const specPath = join9(outputPath, state.taskId, `${state.currentStep}.md`);
|
|
1710
1725
|
const cmds = {
|
|
1711
|
-
approve: `
|
|
1712
|
-
revise: `
|
|
1713
|
-
reject: `
|
|
1714
|
-
stop: `
|
|
1726
|
+
approve: buildOrchestrateCommand(`approve ${state.taskId}`),
|
|
1727
|
+
revise: buildOrchestrateCommand(`revise ${state.taskId} '<feedback>'`),
|
|
1728
|
+
reject: buildOrchestrateCommand(`reject ${state.taskId}`),
|
|
1729
|
+
stop: buildOrchestrateCommand(`stop ${state.taskId}`)
|
|
1715
1730
|
};
|
|
1716
1731
|
return {
|
|
1717
1732
|
type: "checkpoint",
|
|
@@ -1738,7 +1753,7 @@ function buildCompleteResponse(cwd, state, status) {
|
|
|
1738
1753
|
}
|
|
1739
1754
|
const messages = {
|
|
1740
1755
|
completed: "Workflow completed successfully",
|
|
1741
|
-
stopped: `Workflow stopped. Resume with:
|
|
1756
|
+
stopped: `Workflow stopped. Resume with: ${buildOrchestrateCommand(`resume ${state.taskId}`)}`,
|
|
1742
1757
|
rejected: "Workflow rejected"
|
|
1743
1758
|
};
|
|
1744
1759
|
return {
|