@zat-design/sisyphus-scene 4.6.1 → 4.6.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.
package/README.md CHANGED
@@ -6,14 +6,16 @@
6
6
 
7
7
  ## 安装
8
8
 
9
- 需要 Node.js 18+、Sisyphus 4.x 和 Ant Design `>=6 <7`。默认安装 npm `latest` 稳定版:
9
+ 需要 Node.js 18+、Sisyphus 4.x 和 Ant Design `>=6 <7`。Node.js 20 可直接使用。选择 Codex 平台时,终端中的 Codex CLI 还需支持 `mcp list --json` 和 `mcp add`。默认安装 npm `latest` 稳定版:
10
10
 
11
11
  ```bash
12
12
  npx -y @zat-design/sisyphus-scene install --check
13
13
  npx -y @zat-design/sisyphus-scene install
14
14
  ```
15
15
 
16
- 常用参数:`--global`、`--platform claude,cursor,codex`、`--skip-mcp`、`--skill sisyphus-scene-legacy`。
16
+ 常用参数:`--global`、`--platform claude,cursor,codex`、`--skip-mcp`、`--skill sisyphus-scene-legacy`。`--skip-mcp` 只安装 Skill,不提供组件 API/demo 查询能力;不需要 Codex 时可显式使用 `--platform claude,cursor`。
17
+
18
+ Codex MCP 安装失败时,先在同一终端运行 `codex --version` 和 `codex mcp list --json`。若 Codex 命令非零退出且 stdout/stderr 为空,请检查当前终端实际命中的 Codex CLI 来源和兼容性;可临时使用 `--skip-mcp` 绕过 MCP,但这不代表 MCP 已安装。
17
19
 
18
20
  安装器会将 MCP 锁定到 Scene 自身精确版本。锁版或 beta 项目使用 `@<完整版本>`,并保持组件库、MCP 和 Scene 三包完全同版。
19
21
 
@@ -80,8 +80,7 @@ if (options.check) {
80
80
  process.exit(0);
81
81
  }
82
82
 
83
- const result = {
84
- skill: JSON.parse(run('sync-platforms.mjs', [...skillArgs, '--write'])),
85
- };
83
+ const result = {};
86
84
  if (configureMcp) result.mcp = JSON.parse(run('install-mcp.mjs', [...mcpArgs, '--write']));
85
+ result.skill = JSON.parse(run('sync-platforms.mjs', [...skillArgs, '--write']));
87
86
  process.stdout.write(`${JSON.stringify({ mode: 'write', ...result }, null, 2)}\n`);
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@zat-design/sisyphus-react-mcp@4.6.1"
7
+ "@zat-design/sisyphus-react-mcp@4.6.2"
8
8
  ]
9
9
  }
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-scene",
3
- "version": "4.6.1",
3
+ "version": "4.6.2",
4
4
  "description": "Sisyphus 业务场景 Agent 技能,跨 Claude Code、Codex、Cursor 分发 Sisyphus 4 + Ant Design 6 场景与 MCP 配置",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -74,24 +74,62 @@ const runCodex = (commandArgs) =>
74
74
  env: codexEnv,
75
75
  });
76
76
 
77
+ const formatCodexFailure = (commandArgs, result) => {
78
+ const stdout = String(result.stdout || '').trim() || '(empty)';
79
+ const stderr = String(result.stderr || '').trim() || '(empty)';
80
+ return [
81
+ `command: codex ${commandArgs.join(' ')}`,
82
+ `status: ${result.status ?? '(empty)'}`,
83
+ `signal: ${result.signal || '(empty)'}`,
84
+ `stdout: ${stdout}`,
85
+ `stderr: ${stderr}`,
86
+ '请运行 codex --version 和 codex mcp list --json 确认当前 Codex CLI 兼容性;仅安装 Skill 可临时使用 --skip-mcp。',
87
+ ].join('\n');
88
+ };
89
+
77
90
  const inspectCodex = () => {
78
91
  if (!fs.existsSync(codexHome)) {
79
- const version = runCodex(['--version']);
80
- if (version.error?.code === 'ENOENT') throw new Error('未找到 Codex CLI,无法配置 Codex MCP。');
81
- if (version.status !== 0)
82
- throw new Error(`Codex CLI 不可用:${version.stderr || version.stdout}`);
92
+ const commandArgs = ['--version'];
93
+ const result = runCodex(commandArgs);
94
+ if (result.error?.code === 'ENOENT') throw new Error('未找到 Codex CLI,无法配置 Codex MCP。');
95
+ if (result.status !== 0) {
96
+ throw new Error(`Codex CLI 不可用:\n${formatCodexFailure(commandArgs, result)}`);
97
+ }
83
98
  return { status: 'missing' };
84
99
  }
85
100
 
86
- const result = runCodex(['mcp', 'get', 'sisyphus-react', '--json']);
101
+ const commandArgs = ['mcp', 'list', '--json'];
102
+ const result = runCodex(commandArgs);
87
103
  if (result.error?.code === 'ENOENT') throw new Error('未找到 Codex CLI,无法配置 Codex MCP。');
88
104
  if (result.status !== 0) {
89
- const message = `${result.stderr || ''}${result.stdout || ''}`;
90
- if (/not found|no mcp server/i.test(message)) return { status: 'missing' };
91
- throw new Error(`读取 Codex MCP 配置失败:${message.trim()}`);
105
+ throw new Error(`读取 Codex MCP 配置失败:\n${formatCodexFailure(commandArgs, result)}`);
106
+ }
107
+
108
+ const output = String(result.stdout || '').trim();
109
+ if (!output) {
110
+ throw new Error(`Codex MCP 列表 JSON 为空:\n${formatCodexFailure(commandArgs, result)}`);
111
+ }
112
+
113
+ let values;
114
+ try {
115
+ values = JSON.parse(output);
116
+ } catch (error) {
117
+ throw new Error(
118
+ `Codex MCP 列表 JSON 解析失败:${error.message}\n${formatCodexFailure(commandArgs, result)}`,
119
+ );
120
+ }
121
+ if (!Array.isArray(values)) {
122
+ throw new Error(`Codex MCP 列表 JSON 必须是数组。\n${formatCodexFailure(commandArgs, result)}`);
123
+ }
124
+
125
+ const value = values.find((item) => item?.name === 'sisyphus-react');
126
+ if (!value) return { status: 'missing' };
127
+ if (value.enabled === false) {
128
+ throw new Error(
129
+ `${path.join(codexHome, 'config.toml')} 中的 sisyphus-react MCP 已禁用;请人工启用后重试。`,
130
+ );
92
131
  }
93
132
 
94
- const value = JSON.parse(result.stdout);
95
133
  const transport = value.transport || value;
96
134
  const expectedArgs = server.args || [];
97
135
  if (transport.command !== server.command || !sameJson(transport.args || [], expectedArgs)) {
@@ -141,16 +179,19 @@ for (const platform of platforms) {
141
179
  const inspected = inspectCodex();
142
180
  if (inspected.status === 'missing' && write) {
143
181
  fs.mkdirSync(codexHome, { recursive: true });
144
- const result = runCodex([
182
+ const commandArgs = [
145
183
  'mcp',
146
184
  'add',
147
185
  'sisyphus-react',
148
186
  '--',
149
187
  server.command,
150
188
  ...(server.args || []),
151
- ]);
152
- if (result.status !== 0)
153
- throw new Error(`写入 Codex MCP 配置失败:${result.stderr || result.stdout}`);
189
+ ];
190
+ const result = runCodex(commandArgs);
191
+ if (result.error?.code === 'ENOENT') throw new Error('未找到 Codex CLI,无法配置 Codex MCP。');
192
+ if (result.status !== 0) {
193
+ throw new Error(`写入 Codex MCP 配置失败:\n${formatCodexFailure(commandArgs, result)}`);
194
+ }
154
195
  }
155
196
  results.push({
156
197
  platform,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.6.1",
2
+ "version": "4.6.2",
3
3
  "schemaVersion": 2,
4
4
  "tools": [
5
5
  "sisyphus-get-meta-status",
@@ -8,13 +8,13 @@
8
8
  "apiEvidence": {
9
9
  "tool": "sisyphus-get-component-api",
10
10
  "target": "ProForm",
11
- "libraryVersion": "4.6.1",
11
+ "libraryVersion": "4.6.2",
12
12
  "schemaVersion": 2
13
13
  },
14
14
  "demoEvidence": {
15
15
  "tool": "sisyphus-get-example",
16
16
  "target": "ProForm/demos/base.tsx",
17
- "libraryVersion": "4.6.1",
17
+ "libraryVersion": "4.6.2",
18
18
  "schemaVersion": 2,
19
19
  "exampleId": "ProForm/demos/base.tsx"
20
20
  }
@@ -28,13 +28,13 @@
28
28
  "apiEvidence": {
29
29
  "tool": "sisyphus-get-component-api",
30
30
  "target": "ProTable",
31
- "libraryVersion": "4.6.1",
31
+ "libraryVersion": "4.6.2",
32
32
  "schemaVersion": 2
33
33
  },
34
34
  "demoEvidence": {
35
35
  "tool": "sisyphus-get-example",
36
36
  "target": "ProTable/demos/base.tsx",
37
- "libraryVersion": "4.6.1",
37
+ "libraryVersion": "4.6.2",
38
38
  "schemaVersion": 2,
39
39
  "exampleId": "ProTable/demos/base.tsx"
40
40
  }
@@ -7,7 +7,7 @@ examples: []
7
7
  # status: approved
8
8
  # application: xk-wjs-claim-web
9
9
  # capabilities: [search-form, data-table, table-tabs, drawer-form]
10
- # sisyphus_version: "4.6.1"
10
+ # sisyphus_version: "4.6.2"
11
11
  # antd_range: ">=6 <7"
12
12
  # paths:
13
13
  # - src/pages/litigationManagement/index.tsx