claude2codex 0.3.4 → 0.3.5

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/README.md CHANGED
@@ -143,6 +143,11 @@ The workflow reaches Claude in two layers. Neither needs extra installation.
143
143
 
144
144
  The MCP server handles the workflow protocol. Your project files only need to carry **project-specific context** — don't repeat what the server already provides.
145
145
 
146
+ To see exactly what the server already provides, read the verbatim prompts (generated from the code, so they never drift):
147
+
148
+ - **[What Claude sees](https://github.com/PrestoOverture/c2c/blob/main/prompts/what-claude-sees.md)** — server instructions, the `c2c-workflow` Prompt, and tool descriptions. Read before writing `CLAUDE.md`.
149
+ - **[What Codex sees](https://github.com/PrestoOverture/c2c/blob/main/prompts/what-codex-sees.md)** — the protocol, rendered Goal/Delta Contracts, and the thread-goal objective. Read before writing `AGENTS.md`.
150
+
146
151
  **`CLAUDE.md`** (for Claude — the architect/reviewer):
147
152
 
148
153
  ```markdown
package/README.zh-CN.md CHANGED
@@ -157,6 +157,11 @@ npx claude2codex
157
157
 
158
158
  MCP 服务器负责工作流协议。你的项目文件只需要放**项目特有的上下文**——不要重复服务器已经提供的内容。
159
159
 
160
+ 服务器具体提供了哪些内容,可以直接看原文(由代码生成,与实际发送的内容始终一致,英文):
161
+
162
+ - **[What Claude sees](https://github.com/PrestoOverture/c2c/blob/main/prompts/what-claude-sees.md)**:服务器 instructions、`c2c-workflow` Prompt 和工具描述。写 `CLAUDE.md` 之前先读这份。
163
+ - **[What Codex sees](https://github.com/PrestoOverture/c2c/blob/main/prompts/what-codex-sees.md)**:协议、渲染后的 Goal/Delta Contract 和 thread-goal objective。写 `AGENTS.md` 之前先读这份。
164
+
160
165
  `CLAUDE.md`(给 Claude——架构师/审查者):
161
166
 
162
167
  ```markdown
package/dist/server.js CHANGED
@@ -262,7 +262,7 @@ var CodexAppServer = class {
262
262
  */
263
263
  async initialize() {
264
264
  const result = await this.request("initialize", {
265
- clientInfo: { name: "claude2codex", title: "Claude\u2194Codex Contract Bridge", version: "0.3.4" },
265
+ clientInfo: { name: "claude2codex", title: "Claude\u2194Codex Contract Bridge", version: "0.3.5" },
266
266
  capabilities: { experimentalApi: true }
267
267
  });
268
268
  this.notify("initialized", {});
@@ -968,7 +968,7 @@ var SERVER_INSTRUCTIONS = `When the user asks to delegate work to Codex (or to u
968
968
  If a Codex job itself fails (error, 0 tokens, no handoff), report it and wait; don't implement the task yourself unless the user explicitly asks.
969
969
  Full formats: the c2c-workflow prompt.`;
970
970
  var server = new McpServer(
971
- { name: "c2c-codex", version: "0.3.4" },
971
+ { name: "c2c-codex", version: "0.3.5" },
972
972
  { instructions: SERVER_INSTRUCTIONS }
973
973
  );
974
974
  var reasoningEffort = z.enum(["low", "medium", "high", "xhigh", "max", "ultra"]);
@@ -1038,8 +1038,8 @@ server.registerTool(
1038
1038
  description: "Start a Codex implementation job for a Goal Contract. Sets the contract as a Codex thread goal (the /goal loop keeps Codex iterating until the objective is achieved or the token budget is hit) and sends the full contract as the first turn. Returns a job_id immediately; poll codex_status, then fetch codex_result when done. Language-agnostic: verification commands come from the contract's Success Conditions, not from this server.",
1039
1039
  inputSchema: {
1040
1040
  goal: z.string().min(1).describe(`What the code must do when this task is done. ${objectiveBudgetDescription}`),
1041
- constraints: z.array(z.string()).describe("Technical boundaries: files to touch, patterns to follow, 'Do not modify' lists."),
1042
- success_conditions: z.array(z.string()).min(1).describe(`Checkable criteria proving the goal is met. At least one must be a runnable command/test. ${objectiveBudgetDescription}`),
1041
+ constraints: z.array(z.string()).describe("Only what Codex would get wrong without being told: genuine risks, not a review checklist."),
1042
+ success_conditions: z.array(z.string()).min(1).describe(`Checkable criteria proving the goal is met. At least one must be a runnable command/test; command-based ones should say how they fail when the defect exists. ${objectiveBudgetDescription}`),
1043
1043
  token_budget: z.number().int().positive().optional().describe("Optional token budget for the Codex goal loop (thread/goal/set tokenBudget)."),
1044
1044
  cwd: z.string().optional().describe("Working directory for Codex. Defaults to the project directory."),
1045
1045
  context_files: contextFiles.optional().describe("Files or directories Codex should read before implementing."),
@@ -1091,8 +1091,8 @@ server.registerTool(
1091
1091
  description: "Read-only estimate made before starting a job. Measures the fully rendered Goal Contract prompt and returns approx_prompt_tokens using an approximate characters/4 heuristic, plus local completed-job history.",
1092
1092
  inputSchema: {
1093
1093
  goal: z.string().min(1).describe(`What the code must do when this task is done. ${objectiveBudgetDescription}`),
1094
- constraints: z.array(z.string()).describe("Technical boundaries: files to touch, patterns to follow, 'Do not modify' lists."),
1095
- success_conditions: z.array(z.string()).min(1).describe(`Checkable criteria proving the goal is met. At least one must be a runnable command/test. ${objectiveBudgetDescription}`),
1094
+ constraints: z.array(z.string()).describe("Only what Codex would get wrong without being told: genuine risks, not a review checklist."),
1095
+ success_conditions: z.array(z.string()).min(1).describe(`Checkable criteria proving the goal is met. At least one must be a runnable command/test; command-based ones should say how they fail when the defect exists. ${objectiveBudgetDescription}`),
1096
1096
  cwd: z.string().optional().describe("Working directory used to resolve relative context_files paths. Defaults to the project directory."),
1097
1097
  context_files: contextFiles.optional().describe("Files or directories included in the rendered prompt.")
1098
1098
  },
@@ -1229,9 +1229,7 @@ server.registerPrompt("c2c-workflow", {
1229
1229
  messages: [{
1230
1230
  role: "user",
1231
1231
  content: { type: "text", text: `
1232
- You are the **architect and reviewer**. Codex is the **implementer**. You draft contracts, delegate via the \`codex\` MCP server, and review the output. You do not implement the task yourself.
1233
-
1234
- If \`codex_config\` errors, tell the user to install the MCP server (npm: \`claude2codex\`).
1232
+ You are the **architect and reviewer**. Codex is the **implementer**. You draft contracts, delegate via the \`codex_*\` tools, and review the output. You do not implement the task yourself.
1235
1233
 
1236
1234
  ## Workflow
1237
1235
 
@@ -1257,7 +1255,6 @@ Only what Codex would get wrong without being told. One line of
1257
1255
  ### Success Conditions
1258
1256
  - [ ] Assertions, not paragraphs. At least one is a command whose exit code decides.
1259
1257
  - [ ] Command-based conditions must be falsifiable: describe how they fail when the defect exists. Subjective criteria should be marked as needing reviewer judgment.
1260
- - [ ] Handoff includes: Changed Files, Validation, Success Conditions, Risks & Deviations.
1261
1258
  \`\`\`
1262
1259
 
1263
1260
  **Write lean contracts.** Goal and Success Conditions are what Codex acts on. Constraints are for genuine risks only \u2014 don't front-load your review checklist into the contract.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude2codex",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "description": "MCP server bridging Claude (architect/reviewer) and Codex (implementer) via Goal/Delta Contracts and Codex's thread-goal loop.",
6
6
  "bin": {
@@ -30,6 +30,7 @@
30
30
  "start": "bun src/server.ts",
31
31
  "build": "tsup",
32
32
  "test": "bun test",
33
+ "gen:prompt-docs": "bun scripts/gen-prompt-docs.ts",
33
34
  "prepack": "cp ../README.md ../README.zh-CN.md ../PATTERNS.md ../PATTERNS.zh-CN.md .",
34
35
  "postpack": "rm -f README.md README.zh-CN.md PATTERNS.md PATTERNS.zh-CN.md"
35
36
  },