ticketpro-auto-setup 1.1.6 → 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
|
-
|
|
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
|
-
|
|
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
|
|
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');
|
|
@@ -172,15 +173,13 @@ function ensureCclineStatusLine() {
|
|
|
172
173
|
const currentCommand = current && typeof current === 'object' && typeof current.command === 'string'
|
|
173
174
|
? current.command
|
|
174
175
|
: '';
|
|
175
|
-
|
|
176
|
+
// 使用绝对路径,避免某些环境下 "~" 不展开导致 statusLine 命令不可执行
|
|
177
|
+
const localCmd = localCcline;
|
|
176
178
|
const fallbackCmd = resolvedGlobal && fs.existsSync(resolvedGlobal) ? resolvedGlobal : localCmd;
|
|
177
|
-
// 需要补丁的条件:
|
|
178
|
-
// 1) 没有 statusLine
|
|
179
|
-
// 2) statusLine 不是 ccline
|
|
180
|
-
// 3) statusLine 指向本地 ccline 但本地文件不存在(坏链路)
|
|
181
179
|
const needPatch = !currentCommand ||
|
|
182
180
|
!currentCommand.includes('ccline') ||
|
|
183
|
-
(currentCommand.includes('~/.claude/ccline/ccline') && !fs.existsSync(localCcline))
|
|
181
|
+
(currentCommand.includes('~/.claude/ccline/ccline') && !fs.existsSync(localCcline)) ||
|
|
182
|
+
currentCommand.includes('~/.claude/ccline/ccline');
|
|
184
183
|
if (needPatch) {
|
|
185
184
|
settings.statusLine = {
|
|
186
185
|
type: 'command',
|
|
@@ -190,9 +189,10 @@ function ensureCclineStatusLine() {
|
|
|
190
189
|
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
|
|
191
190
|
log.success(`ccline statusLine patched: ${settings.statusLine.command}`);
|
|
192
191
|
}
|
|
192
|
+
return { name: 'ccline statusLine', success: true };
|
|
193
193
|
}
|
|
194
|
-
catch {
|
|
195
|
-
|
|
194
|
+
catch (err) {
|
|
195
|
+
return { name: 'ccline statusLine', success: false, error: err.message };
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
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-
|
|
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();
|