@cluesmith/codev 2.0.0-rc.57 → 2.0.0-rc.59

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 (104) hide show
  1. package/dashboard/dist/assets/index-CXloFYpB.css +32 -0
  2. package/dashboard/dist/assets/index-Ca2fjOJf.js +131 -0
  3. package/dashboard/dist/assets/index-Ca2fjOJf.js.map +1 -0
  4. package/dashboard/dist/index.html +2 -2
  5. package/dist/agent-farm/commands/attach.d.ts.map +1 -1
  6. package/dist/agent-farm/commands/attach.js +31 -8
  7. package/dist/agent-farm/commands/attach.js.map +1 -1
  8. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  9. package/dist/agent-farm/commands/spawn.js +38 -28
  10. package/dist/agent-farm/commands/spawn.js.map +1 -1
  11. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  12. package/dist/agent-farm/commands/start.js +3 -226
  13. package/dist/agent-farm/commands/start.js.map +1 -1
  14. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  15. package/dist/agent-farm/commands/status.js +5 -2
  16. package/dist/agent-farm/commands/status.js.map +1 -1
  17. package/dist/agent-farm/db/index.d.ts.map +1 -1
  18. package/dist/agent-farm/db/index.js +45 -0
  19. package/dist/agent-farm/db/index.js.map +1 -1
  20. package/dist/agent-farm/db/schema.d.ts +1 -1
  21. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  22. package/dist/agent-farm/db/schema.js +2 -2
  23. package/dist/agent-farm/hq-connector.d.ts +0 -4
  24. package/dist/agent-farm/hq-connector.d.ts.map +1 -1
  25. package/dist/agent-farm/hq-connector.js +0 -15
  26. package/dist/agent-farm/hq-connector.js.map +1 -1
  27. package/dist/agent-farm/servers/tower-server.js +82 -22
  28. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  29. package/dist/cli.d.ts.map +1 -1
  30. package/dist/cli.js +2 -0
  31. package/dist/cli.js.map +1 -1
  32. package/dist/commands/consult/index.d.ts +1 -0
  33. package/dist/commands/consult/index.d.ts.map +1 -1
  34. package/dist/commands/consult/index.js +23 -4
  35. package/dist/commands/consult/index.js.map +1 -1
  36. package/dist/commands/porch/checks.d.ts +3 -2
  37. package/dist/commands/porch/checks.d.ts.map +1 -1
  38. package/dist/commands/porch/checks.js +8 -2
  39. package/dist/commands/porch/checks.js.map +1 -1
  40. package/dist/commands/porch/index.d.ts.map +1 -1
  41. package/dist/commands/porch/index.js +21 -23
  42. package/dist/commands/porch/index.js.map +1 -1
  43. package/dist/commands/porch/next.d.ts +22 -0
  44. package/dist/commands/porch/next.d.ts.map +1 -0
  45. package/dist/commands/porch/next.js +475 -0
  46. package/dist/commands/porch/next.js.map +1 -0
  47. package/dist/commands/porch/protocol.d.ts +3 -3
  48. package/dist/commands/porch/protocol.d.ts.map +1 -1
  49. package/dist/commands/porch/protocol.js +40 -6
  50. package/dist/commands/porch/protocol.js.map +1 -1
  51. package/dist/commands/porch/types.d.ts +36 -1
  52. package/dist/commands/porch/types.d.ts.map +1 -1
  53. package/dist/commands/porch/verdict.d.ts +31 -0
  54. package/dist/commands/porch/verdict.d.ts.map +1 -0
  55. package/dist/commands/porch/verdict.js +59 -0
  56. package/dist/commands/porch/verdict.js.map +1 -0
  57. package/package.json +5 -7
  58. package/skeleton/porch/prompts/defend.md +1 -1
  59. package/skeleton/porch/prompts/evaluate.md +2 -2
  60. package/skeleton/porch/prompts/implement.md +1 -1
  61. package/skeleton/porch/prompts/plan.md +1 -1
  62. package/skeleton/porch/prompts/review.md +4 -4
  63. package/skeleton/porch/prompts/specify.md +1 -1
  64. package/skeleton/porch/prompts/understand.md +2 -2
  65. package/skeleton/protocol-schema.json +3 -3
  66. package/skeleton/protocols/bugfix/builder-prompt.md +1 -1
  67. package/skeleton/protocols/experiment/protocol.md +3 -3
  68. package/skeleton/protocols/experiment/templates/notes.md +1 -1
  69. package/skeleton/protocols/maintain/protocol.md +1 -1
  70. package/skeleton/protocols/protocol-schema.json +1 -1
  71. package/skeleton/protocols/{spider → spir}/builder-prompt.md +1 -1
  72. package/skeleton/protocols/{spider → spir}/prompts/implement.md +1 -1
  73. package/skeleton/protocols/{spider → spir}/prompts/plan.md +2 -2
  74. package/skeleton/protocols/{spider → spir}/prompts/review.md +2 -2
  75. package/skeleton/protocols/{spider → spir}/prompts/specify.md +1 -1
  76. package/skeleton/protocols/{spider → spir}/protocol.json +2 -2
  77. package/skeleton/protocols/{spider → spir}/protocol.md +6 -8
  78. package/skeleton/protocols/{spider → spir}/templates/review.md +1 -1
  79. package/skeleton/protocols/tick/builder-prompt.md +1 -1
  80. package/skeleton/protocols/tick/protocol.md +18 -18
  81. package/skeleton/protocols/tick/templates/review.md +1 -1
  82. package/skeleton/resources/commands/overview.md +1 -1
  83. package/skeleton/resources/workflow-reference.md +2 -2
  84. package/skeleton/roles/architect.md +2 -2
  85. package/skeleton/roles/builder.md +2 -2
  86. package/skeleton/templates/AGENTS.md +1 -1
  87. package/skeleton/templates/CLAUDE.md +1 -1
  88. package/skeleton/templates/cheatsheet.md +3 -3
  89. package/skeleton/templates/projectlist.md +1 -1
  90. package/templates/dashboard/js/main.js +1 -1
  91. package/templates/open.html +26 -0
  92. package/dashboard/dist/assets/index-BV7KQvFU.css +0 -32
  93. package/dashboard/dist/assets/index-bhDjF0Oa.js +0 -131
  94. package/dashboard/dist/assets/index-bhDjF0Oa.js.map +0 -1
  95. package/dist/commands/porch/claude.d.ts +0 -27
  96. package/dist/commands/porch/claude.d.ts.map +0 -1
  97. package/dist/commands/porch/claude.js +0 -107
  98. package/dist/commands/porch/claude.js.map +0 -1
  99. package/dist/commands/porch/run.d.ts +0 -40
  100. package/dist/commands/porch/run.d.ts.map +0 -1
  101. package/dist/commands/porch/run.js +0 -893
  102. package/dist/commands/porch/run.js.map +0 -1
  103. /package/skeleton/protocols/{spider → spir}/templates/plan.md +0 -0
  104. /package/skeleton/protocols/{spider → spir}/templates/spec.md +0 -0
@@ -1,27 +0,0 @@
1
- /**
2
- * Claude Worker for Porch (Agent SDK)
3
- *
4
- * Invokes Claude programmatically via the Anthropic Agent SDK.
5
- * Replaces the old `claude --print` subprocess approach.
6
- *
7
- * The Worker has full tool access (Read, Edit, Bash, Glob, Grep)
8
- * and runs inside porch's process — no subprocess, no nested CLI.
9
- */
10
- export interface BuildResult {
11
- /** Whether the build completed successfully */
12
- success: boolean;
13
- /** Claude's output text */
14
- output: string;
15
- /** Total cost in USD (if available) */
16
- cost?: number;
17
- /** Duration in milliseconds (if available) */
18
- duration?: number;
19
- }
20
- /**
21
- * Run a build phase with a timeout.
22
- *
23
- * Wraps buildWithSDK with Promise.race against a timeout.
24
- * On timeout, returns a failure result (does not throw).
25
- */
26
- export declare function buildWithTimeout(prompt: string, outputPath: string, cwd: string, timeoutMs: number): Promise<BuildResult>;
27
- //# sourceMappingURL=claude.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/commands/porch/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,CAetB"}
@@ -1,107 +0,0 @@
1
- /**
2
- * Claude Worker for Porch (Agent SDK)
3
- *
4
- * Invokes Claude programmatically via the Anthropic Agent SDK.
5
- * Replaces the old `claude --print` subprocess approach.
6
- *
7
- * The Worker has full tool access (Read, Edit, Bash, Glob, Grep)
8
- * and runs inside porch's process — no subprocess, no nested CLI.
9
- */
10
- import * as fs from 'node:fs';
11
- /**
12
- * Run a build phase with a timeout.
13
- *
14
- * Wraps buildWithSDK with Promise.race against a timeout.
15
- * On timeout, returns a failure result (does not throw).
16
- */
17
- export async function buildWithTimeout(prompt, outputPath, cwd, timeoutMs) {
18
- let timer;
19
- const timeoutPromise = new Promise((resolve) => {
20
- timer = setTimeout(() => {
21
- resolve({
22
- success: false,
23
- output: '[TIMEOUT] Build exceeded deadline',
24
- duration: timeoutMs,
25
- });
26
- }, timeoutMs);
27
- });
28
- const result = await Promise.race([buildWithSDK(prompt, outputPath, cwd), timeoutPromise]);
29
- clearTimeout(timer);
30
- return result;
31
- }
32
- /**
33
- * Run a build phase using the Agent SDK (internal — use buildWithTimeout).
34
- */
35
- async function buildWithSDK(prompt, outputPath, cwd) {
36
- // Save prompt to file for reference
37
- const promptFile = outputPath.replace(/\.txt$/, '-prompt.txt');
38
- fs.writeFileSync(promptFile, prompt);
39
- // Create output file
40
- fs.writeFileSync(outputPath, '');
41
- // Dynamically import Agent SDK (it's ESM)
42
- const { query } = await import('@anthropic-ai/claude-agent-sdk');
43
- let output = '';
44
- let cost;
45
- let duration;
46
- let success = false;
47
- try {
48
- for await (const message of query({
49
- prompt,
50
- options: {
51
- allowedTools: ['Read', 'Edit', 'Write', 'Bash', 'Glob', 'Grep'],
52
- permissionMode: 'bypassPermissions',
53
- allowDangerouslySkipPermissions: true,
54
- cwd,
55
- maxTurns: 200,
56
- },
57
- })) {
58
- // Stream assistant messages to output file
59
- if (message.type === 'assistant' && message.message?.content) {
60
- for (const block of message.message.content) {
61
- if (block.type === 'text') {
62
- output += block.text + '\n';
63
- fs.appendFileSync(outputPath, block.text + '\n');
64
- }
65
- else if (block.type === 'tool_use') {
66
- const toolLine = `\n[tool: ${block.name}](${JSON.stringify(block.input).substring(0, 200)})\n`;
67
- output += toolLine;
68
- fs.appendFileSync(outputPath, toolLine);
69
- }
70
- }
71
- }
72
- // Capture tool progress for observability
73
- if (message.type === 'tool_progress') {
74
- const progressLine = `[tool_progress] ${JSON.stringify(message).substring(0, 500)}\n`;
75
- fs.appendFileSync(outputPath, progressLine);
76
- }
77
- // Capture result
78
- if (message.type === 'result') {
79
- if (message.subtype === 'success') {
80
- success = true;
81
- if (message.result) {
82
- output += message.result;
83
- fs.appendFileSync(outputPath, message.result);
84
- }
85
- cost = message.total_cost_usd;
86
- duration = message.duration_ms;
87
- }
88
- else {
89
- // Error result
90
- success = false;
91
- const errorMsg = `\n[Agent SDK error: ${message.subtype}]\n`;
92
- output += errorMsg;
93
- fs.appendFileSync(outputPath, errorMsg);
94
- duration = message.duration_ms;
95
- }
96
- }
97
- }
98
- }
99
- catch (err) {
100
- const errorMsg = `\n[Agent SDK exception: ${err.message}]\n`;
101
- output += errorMsg;
102
- fs.appendFileSync(outputPath, errorMsg);
103
- success = false;
104
- }
105
- return { success, output, cost, duration };
106
- }
107
- //# sourceMappingURL=claude.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../src/commands/porch/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAa9B;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAc,EACd,UAAkB,EAClB,GAAW,EACX,SAAiB;IAEjB,IAAI,KAAoC,CAAC;IACzC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAc,CAAC,OAAO,EAAE,EAAE;QAC1D,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YACtB,OAAO,CAAC;gBACN,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,mCAAmC;gBAC3C,QAAQ,EAAE,SAAS;aACpB,CAAC,CAAC;QACL,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CA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BAAuB,OAAO,CAAC,OAAO,KAAK,CAAC;oBAC7D,MAAM,IAAI,QAAQ,CAAC;oBACnB,EAAE,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;oBACxC,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;gBACjC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,2BAA4B,GAAa,CAAC,OAAO,KAAK,CAAC;QACxE,MAAM,IAAI,QAAQ,CAAC;QACnB,EAAE,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACxC,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC7C,CAAC"}
@@ -1,40 +0,0 @@
1
- /**
2
- * porch run - Main run loop (Build-Verify design)
3
- *
4
- * Porch orchestrates build-verify cycles:
5
- * 1. BUILD: Spawn Claude to create artifact
6
- * 2. VERIFY: Run 3-way consultation (Gemini, Codex, Claude)
7
- * 3. ITERATE: If any REQUEST_CHANGES, feed back to Claude
8
- * 4. COMPLETE: When all APPROVE (or max iterations), commit + push + gate
9
- */
10
- import type { Verdict } from './types.js';
11
- export interface RunOptions {
12
- /** Run a single build-verify iteration then exit (for step-by-step debugging) */
13
- singleIteration?: boolean;
14
- /** Run a single phase (build-verify + gate) then exit. Used by Builder (outer Claude) to stay in the loop. */
15
- singlePhase?: boolean;
16
- }
17
- /** Exit code when AWAITING_INPUT is detected in non-interactive mode */
18
- export declare const EXIT_AWAITING_INPUT = 3;
19
- /**
20
- * Main run loop for porch.
21
- * Spawns Claude for each phase and monitors until protocol complete.
22
- */
23
- export declare function run(projectRoot: string, projectId: string, options?: RunOptions): Promise<void>;
24
- /**
25
- * Parse verdict from consultation output.
26
- *
27
- * Looks for the verdict line in format:
28
- * VERDICT: APPROVE
29
- * VERDICT: REQUEST_CHANGES
30
- * VERDICT: COMMENT
31
- *
32
- * Also handles markdown formatting like:
33
- * **VERDICT: APPROVE**
34
- * *VERDICT: APPROVE*
35
- *
36
- * Safety: If no explicit verdict found (empty output, crash, malformed),
37
- * defaults to REQUEST_CHANGES to prevent proceeding with unverified code.
38
- */
39
- export declare function parseVerdict(output: string): Verdict;
40
- //# sourceMappingURL=run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/porch/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,KAAK,EAAyD,OAAO,EAAE,MAAM,YAAY,CAAC;AA4DjG,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8GAA8G;IAC9G,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAQrC;;;GAGG;AACH,wBAAsB,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAqezG;AAkMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAwBpD"}