@shenlee/devcrew 0.1.1 → 0.1.2

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 (37) hide show
  1. package/README.md +19 -5
  2. package/README.zh-CN.md +19 -5
  3. package/dist/packages/adapters/src/index.js +3 -2
  4. package/dist/packages/core/src/paths.js +3 -0
  5. package/dist/packages/core/src/store.js +6 -0
  6. package/dist/packages/core/src/types.js +1 -0
  7. package/dist/packages/core/src/version.js +1 -1
  8. package/dist/packages/core/src/workflow.js +51 -20
  9. package/dist/packages/orchestrator/src/index.js +118 -154
  10. package/dist/packages/orchestrator/src/worktree.js +198 -0
  11. package/dist/packages/service/src/stdio.js +19 -3
  12. package/dist/packages/service/src/tools.js +3 -3
  13. package/docs/claude-code.md +1 -1
  14. package/docs/codex.md +6 -2
  15. package/docs/quickstart.md +1 -1
  16. package/docs/superpowers/plans/2026-07-10-p0-foundation-repair.md +939 -0
  17. package/docs/superpowers/specs/2026-07-10-p0-foundation-repair-design.md +182 -0
  18. package/docs/workflow.md +21 -4
  19. package/package.json +1 -1
  20. package/packages/adapters/src/index.ts +4 -3
  21. package/packages/core/src/paths.ts +4 -0
  22. package/packages/core/src/store.ts +7 -0
  23. package/packages/core/src/types.ts +7 -0
  24. package/packages/core/src/version.ts +1 -1
  25. package/packages/core/src/workflow.ts +55 -20
  26. package/packages/orchestrator/src/index.ts +136 -179
  27. package/packages/orchestrator/src/worktree.ts +269 -0
  28. package/packages/service/src/stdio.ts +27 -6
  29. package/packages/service/src/tools.ts +2 -2
  30. package/plugins/devcrew-codex/.codex-plugin/plugin.json +1 -1
  31. package/plugins/devcrew-codex/.mcp.json +1 -1
  32. package/plugins/devcrew-codex/agents/architect.toml +6 -0
  33. package/plugins/devcrew-codex/agents/implementer.toml +6 -0
  34. package/plugins/devcrew-codex/agents/pm.toml +7 -0
  35. package/plugins/devcrew-codex/agents/tester.toml +6 -0
  36. package/plugins/devcrew-codex/assets/logo.png +0 -0
  37. package/scripts/smoke-codex-plugin.mjs +1 -1
@@ -2,14 +2,25 @@ import { callDevCrewTool, listDevCrewTools } from "./tools.js";
2
2
  import { DEVCREW_VERSION } from "../../core/src/index.js";
3
3
 
4
4
  interface JsonRpcRequest {
5
+ jsonrpc: "2.0";
5
6
  id?: string | number | null;
6
- method?: string;
7
+ method: string;
7
8
  params?: Record<string, unknown>;
8
9
  }
9
10
 
10
11
  type JsonWriter = (message: unknown) => void;
11
12
  type RequestHandler = (request: JsonRpcRequest) => Promise<void>;
12
13
 
14
+ function isJsonRpcRequest(value: unknown): value is JsonRpcRequest {
15
+ return (
16
+ typeof value === "object" &&
17
+ value !== null &&
18
+ !Array.isArray(value) &&
19
+ (value as { jsonrpc?: unknown }).jsonrpc === "2.0" &&
20
+ typeof (value as { method?: unknown }).method === "string"
21
+ );
22
+ }
23
+
13
24
  function writeJson(message: unknown): void {
14
25
  process.stdout.write(`${JSON.stringify(message)}\n`);
15
26
  }
@@ -61,7 +72,7 @@ async function handleRequest(request: JsonRpcRequest, write: JsonWriter): Promis
61
72
  return;
62
73
  }
63
74
 
64
- throw new Error(`Unsupported JSON-RPC method: ${request.method ?? "unknown"}`);
75
+ throw new Error(`Unsupported JSON-RPC method: ${request.method}`);
65
76
  } catch (error) {
66
77
  write({
67
78
  jsonrpc: "2.0",
@@ -85,9 +96,9 @@ export function createStdioLineProcessor(
85
96
  return queue;
86
97
  }
87
98
 
88
- let request: JsonRpcRequest;
99
+ let request: unknown;
89
100
  try {
90
- request = JSON.parse(trimmed) as JsonRpcRequest;
101
+ request = JSON.parse(trimmed) as unknown;
91
102
  } catch {
92
103
  write({
93
104
  jsonrpc: "2.0",
@@ -97,8 +108,18 @@ export function createStdioLineProcessor(
97
108
  return queue;
98
109
  }
99
110
 
100
- queue = queue.then(() => handler(request));
101
- return queue;
111
+ if (!isJsonRpcRequest(request)) {
112
+ write({
113
+ jsonrpc: "2.0",
114
+ id: null,
115
+ error: { code: -32600, message: "Invalid Request" },
116
+ });
117
+ return queue;
118
+ }
119
+
120
+ const task = queue.then(() => handler(request));
121
+ queue = task.catch(() => undefined);
122
+ return task;
102
123
  };
103
124
  }
104
125
 
@@ -1,5 +1,4 @@
1
1
  import {
2
- approveWorkflow,
3
2
  getArtifact,
4
3
  getActiveRunId,
5
4
  getWorkflowStatus,
@@ -9,6 +8,7 @@ import {
9
8
  } from "../../core/src/index.js";
10
9
  import {
11
10
  answerOrchestratedWorkflow,
11
+ approveOrchestratedWorkflow,
12
12
  continueOrchestratedWorkflow,
13
13
  rejectOrchestratedWorkflow,
14
14
  startOrchestratedWorkflow,
@@ -193,7 +193,7 @@ export async function callDevCrewTool(name: string, args: Record<string, unknown
193
193
  return success(`${summarizeState(state)}. Answer recorded.`, { state });
194
194
  }
195
195
  if (name === "devcrew_approve") {
196
- const state = await approveWorkflow((await withActiveRun(args)) as never);
196
+ const state = await approveOrchestratedWorkflow((await withActiveRun(args)) as never);
197
197
  return success(`${summarizeState(state)}. Gate approved.`, { state });
198
198
  }
199
199
  if (name === "devcrew_reject") {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devcrew",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "DevCrew gated multi-role workflow service for Codex.",
5
5
  "author": {
6
6
  "name": "DevCrew Contributors",
@@ -6,7 +6,7 @@
6
6
  "exec",
7
7
  "--silent",
8
8
  "--yes",
9
- "--package=@shenlee/devcrew@0.1.1",
9
+ "--package=@shenlee/devcrew@0.1.2",
10
10
  "--",
11
11
  "node",
12
12
  "-e",
@@ -3,4 +3,10 @@ description = "technical architecture specialist. Designs implementation, deploy
3
3
  developer_instructions = """
4
4
  You are the DevCrew architect role. technical architecture specialist. Designs implementation, deployment, interfaces, and review criteria.
5
5
  Return concise Markdown and keep inherited host permissions.
6
+
7
+ Produce these required sections:
8
+ - Technical Decisions (for each key decision record Decision, Options Considered, Choice, Rationale, and Trade-offs)
9
+ - Interface Contracts (for each interface give the signature, request/response schema, error contract, and data model)
10
+ - Data Flow and Deployment (data flow, deployment expectations, and rollback strategy)
11
+ - Architecture Review Checklist (how the design traces back to the approved requirements)
6
12
  """
@@ -3,4 +3,10 @@ description = "Implementation engineer. Writes code according to approved archit
3
3
  developer_instructions = """
4
4
  You are the DevCrew implementer role. Implementation engineer. Writes code according to approved architecture and discovered standards.
5
5
  Return concise Markdown and keep inherited host permissions.
6
+
7
+ Produce these required sections:
8
+ - Implementation Summary (the smallest change that satisfies the approved architecture)
9
+ - Standards Compliance (follow discovered standards and lint/format rules; run available lint/format/typecheck and report results)
10
+ - Changed Files (every file you created or modified)
11
+ - Tests Added or Updated (tests covering success, edge, and failure paths)
6
12
  """
@@ -3,4 +3,11 @@ description = "Product manager. Clarifies requirements, scope boundaries, succes
3
3
  developer_instructions = """
4
4
  You are the DevCrew pm role. Product manager. Clarifies requirements, scope boundaries, success criteria, and requester approvals.
5
5
  Return concise Markdown and keep inherited host permissions.
6
+
7
+ Produce these required sections:
8
+ - Functional Scope (explicit In Scope and Out of Scope lists)
9
+ - Users and Scenarios (primary users and their key scenarios)
10
+ - Acceptance Criteria (testable criteria written as Given / When / Then)
11
+ - Priorities (classify each requirement as Must / Should / Could / Won't (MoSCoW))
12
+ - Open Questions (unresolved clarifications for the requester)
6
13
  """
@@ -3,4 +3,10 @@ description = "Testing and acceptance specialist. Verifies functionality, regres
3
3
  developer_instructions = """
4
4
  You are the DevCrew tester role. Testing and acceptance specialist. Verifies functionality, regressions, and acceptance evidence.
5
5
  Return concise Markdown and keep inherited host permissions.
6
+
7
+ Produce these required sections:
8
+ - Test Cases (enumerate cases as a table with ID, Scenario, Type (happy/edge/failure/regression), and Expected result)
9
+ - Coverage (run the coverage command and report the coverage summary plus any gaps)
10
+ - Verification Evidence (exact commands, exit codes, and key output)
11
+ - Known Risks (residual risks and follow-ups)
6
12
  """
@@ -298,7 +298,7 @@ async function main() {
298
298
  await client.request("initialize", {
299
299
  protocolVersion: "2025-03-26",
300
300
  capabilities: {},
301
- clientInfo: { name: "devcrew-codex-plugin-smoke", version: "0.1.1" },
301
+ clientInfo: { name: "devcrew-codex-plugin-smoke", version: "0.1.2" },
302
302
  });
303
303
  client.notify("notifications/initialized", {});
304
304
  const tools = await client.request("tools/list", {});