ticketpro-auto-setup 1.1.7 → 1.1.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.
@@ -10,4 +10,10 @@ import type { StepResult } from '../types/index.js';
10
10
  * 通过 spawn + 周期性写 stdin "N\n" 实现跨平台自动应答。
11
11
  */
12
12
  export declare function installCodeAbyss(target: 'claude' | 'codex' | 'both'): Promise<StepResult>;
13
+ /**
14
+ * 兜底确保 statusLine 指向 ccline。
15
+ * 某些环境下 code-abyss 可能因配置合并策略未写入该字段,
16
+ * 或写入了 ~/.claude/ccline/ccline 但该路径实际不存在(例如 nvm 全局安装)。
17
+ */
18
+ export declare function repairCclineStatusLine(): StepResult;
13
19
  //# sourceMappingURL=code-abyss.d.ts.map
@@ -49,7 +49,7 @@ async function runCodeAbyss(target, spinner) {
49
49
  const result = await spawnCodeAbyss(npxCmd, ['-y', 'code-abyss', '--target', target, '-y']);
50
50
  if (result.success) {
51
51
  if (target === 'claude') {
52
- ensureCclineStatusLine();
52
+ repairCclineStatusLine();
53
53
  }
54
54
  spinner.succeed(`code-abyss installed → ${target}`);
55
55
  return { name, success: true };
@@ -64,7 +64,7 @@ async function runCodeAbyss(target, spinner) {
64
64
  const execResult = await spawnCodeAbyss('code-abyss', ['--target', target, '-y']);
65
65
  if (execResult.success) {
66
66
  if (target === 'claude') {
67
- ensureCclineStatusLine();
67
+ repairCclineStatusLine();
68
68
  }
69
69
  spinner.succeed(`code-abyss installed → ${target} (global)`);
70
70
  return { name, success: true };
@@ -135,19 +135,20 @@ function spawnCodeAbyss(command, args) {
135
135
  * 某些环境下 code-abyss 可能因配置合并策略未写入该字段,
136
136
  * 或写入了 ~/.claude/ccline/ccline 但该路径实际不存在(例如 nvm 全局安装)。
137
137
  */
138
- function ensureCclineStatusLine() {
138
+ export function repairCclineStatusLine() {
139
139
  try {
140
140
  const { homeDir } = getPlatform();
141
141
  const claudeDir = getClaudeDir();
142
142
  const settingsPath = path.join(claudeDir, 'settings.json');
143
- if (!fs.existsSync(settingsPath))
144
- return;
143
+ if (!fs.existsSync(settingsPath)) {
144
+ return { name: 'ccline statusLine', success: false, error: 'settings.json not found' };
145
+ }
145
146
  let settings = {};
146
147
  try {
147
148
  settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
148
149
  }
149
150
  catch {
150
- return;
151
+ return { name: 'ccline statusLine', success: false, error: 'settings.json parse failed' };
151
152
  }
152
153
  const cclineDir = path.join(claudeDir, 'ccline');
153
154
  const localCcline = path.join(cclineDir, 'ccline');
@@ -175,11 +176,6 @@ function ensureCclineStatusLine() {
175
176
  // 使用绝对路径,避免某些环境下 "~" 不展开导致 statusLine 命令不可执行
176
177
  const localCmd = localCcline;
177
178
  const fallbackCmd = resolvedGlobal && fs.existsSync(resolvedGlobal) ? resolvedGlobal : localCmd;
178
- // 需要补丁的条件:
179
- // 1) 没有 statusLine
180
- // 2) statusLine 不是 ccline
181
- // 3) statusLine 指向本地 ccline 但本地文件不存在(坏链路)
182
- // 4) statusLine 使用 ~/ 相对 home 写法(在部分环境不会展开)
183
179
  const needPatch = !currentCommand ||
184
180
  !currentCommand.includes('ccline') ||
185
181
  (currentCommand.includes('~/.claude/ccline/ccline') && !fs.existsSync(localCcline)) ||
@@ -193,9 +189,10 @@ function ensureCclineStatusLine() {
193
189
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
194
190
  log.success(`ccline statusLine patched: ${settings.statusLine.command}`);
195
191
  }
192
+ return { name: 'ccline statusLine', success: true };
196
193
  }
197
- catch {
198
- // 静默兜底,不影响主流程
194
+ catch (err) {
195
+ return { name: 'ccline statusLine', success: false, error: err.message };
199
196
  }
200
197
  }
201
198
  //# sourceMappingURL=code-abyss.js.map
@@ -26,7 +26,9 @@ async function ensureUvx() {
26
26
  if (!hasPip3 && !hasPip) {
27
27
  log.error('未检测到 Python / pip!无法安装 uvx。');
28
28
  log.error('GrokSearch MCP 需要 Python 环境,请先安装 Python:');
29
- log.dim(' Ubuntu/Debian: sudo apt install python3 python3-pip');
29
+ log.dim(' Ubuntu/Debian: sudo apt update && sudo apt install python3 python3-venv');
30
+ log.dim(' Ubuntu 最小镜像可再执行: python3 -m ensurepip --upgrade');
31
+ log.dim(' 若系统禁用 ensurepip: sudo apt install python3-full');
30
32
  log.dim(' macOS: brew install python3');
31
33
  log.dim(' Windows: https://www.python.org/downloads/');
32
34
  return false;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { checkbox, input, password } from '@inquirer/prompts';
5
5
  import chalk from 'chalk';
6
- import { installCodeAbyss } from '../installers/code-abyss.js';
6
+ import { installCodeAbyss, repairCclineStatusLine } from '../installers/code-abyss.js';
7
7
  import { installJshookSkill } from '../installers/jshook-skill.js';
8
8
  import { installGrokSearchForClaude } from '../installers/grok-search.js';
9
9
  import { log } from '../utils/logger.js';
@@ -56,6 +56,19 @@ export async function claudeSetupPage(state) {
56
56
  const result = await installJshookSkill();
57
57
  state.results.push(result);
58
58
  }
59
+ // 双技能并装兜底:再次修复 ccline statusLine
60
+ // 场景:部分环境在后续步骤可能改写 settings.json,导致 statusLine 丢失/失效
61
+ if (extensions.includes('code-abyss')) {
62
+ const repairResult = repairCclineStatusLine();
63
+ if (!repairResult.success) {
64
+ state.results.push({
65
+ name: 'ccline statusLine',
66
+ success: false,
67
+ error: repairResult.error,
68
+ });
69
+ log.warn(`ccline statusLine 兜底修复失败: ${repairResult.error}`);
70
+ }
71
+ }
59
72
  // 配置 GrokSearch
60
73
  if (extensions.includes('grok-search')) {
61
74
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ticketpro-auto-setup",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "TicketPro Auto Setup Wizard — 一键配置 Claude Code CLI / Codex CLI",
5
5
  "type": "module",
6
6
  "bin": {