ccjk 12.0.7 → 12.0.9
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/dist/chunks/agents.mjs +1 -1
- package/dist/chunks/auto-fixer.mjs +93 -0
- package/dist/chunks/auto-updater.mjs +3 -2
- package/dist/chunks/boost.mjs +1 -1
- package/dist/chunks/ccr.mjs +4 -3
- package/dist/chunks/check-updates.mjs +3 -2
- package/dist/chunks/claude-code-incremental-manager.mjs +3 -2
- package/dist/chunks/codex-config-switch.mjs +2 -1
- package/dist/chunks/codex-provider-manager.mjs +2 -1
- package/dist/chunks/codex-uninstaller.mjs +1 -1
- package/dist/chunks/codex.mjs +1 -1
- package/dist/chunks/config-switch.mjs +2 -1
- package/dist/chunks/config2.mjs +2 -1
- package/dist/chunks/doctor.mjs +1 -0
- package/dist/chunks/features.mjs +3 -2
- package/dist/chunks/index10.mjs +569 -1061
- package/dist/chunks/index11.mjs +1076 -913
- package/dist/chunks/index12.mjs +951 -135
- package/dist/chunks/index13.mjs +184 -209
- package/dist/chunks/index14.mjs +210 -655
- package/dist/chunks/index4.mjs +1 -1
- package/dist/chunks/index7.mjs +201 -2182
- package/dist/chunks/init.mjs +5 -5
- package/dist/chunks/installer.mjs +2 -1
- package/dist/chunks/mcp-cli.mjs +2 -1
- package/dist/chunks/mcp.mjs +2 -1
- package/dist/chunks/menu.mjs +22 -11
- package/dist/chunks/onboarding-wizard.mjs +93 -0
- package/dist/chunks/onboarding.mjs +1 -0
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/prompts.mjs +2 -1
- package/dist/chunks/quick-actions.mjs +1 -1
- package/dist/chunks/quick-provider.mjs +1 -0
- package/dist/chunks/quick-setup.mjs +3 -2
- package/dist/chunks/remote.mjs +1 -0
- package/dist/chunks/status.mjs +7 -2
- package/dist/chunks/uninstall.mjs +3 -2
- package/dist/chunks/update.mjs +3 -2
- package/dist/chunks/upgrade-manager.mjs +1 -1
- package/dist/chunks/wsl.mjs +1 -1
- package/dist/cli.mjs +19 -3
- package/dist/shared/{ccjk.DOwtZMk8.mjs → ccjk.BWFpnOr3.mjs} +7 -1831
- package/dist/shared/{ccjk.D5MFQT7w.mjs → ccjk.CNMWk_mE.mjs} +7 -7
- package/dist/shared/{ccjk.BRZ9ww8S.mjs → ccjk.CvChMYvB.mjs} +1 -1
- package/dist/shared/ccjk.DeWpAShp.mjs +1828 -0
- package/dist/shared/{ccjk.BwfbSKN2.mjs → ccjk.Dx-O9dWz.mjs} +1 -1
- package/package.json +2 -2
package/dist/chunks/index13.mjs
CHANGED
|
@@ -1,218 +1,193 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import fs, { constants } from 'node:fs/promises';
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
4
3
|
import process__default from 'node:process';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import 'node:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
import { i as installSuperpowers } from '../shared/ccjk._dESH4Rk.mjs';
|
|
5
|
+
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import 'node:fs/promises';
|
|
8
|
+
import 'node:util';
|
|
9
|
+
import './index5.mjs';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
|
|
12
|
+
const CORE_SKILLS = [
|
|
13
|
+
"agent-browser",
|
|
14
|
+
"tdd",
|
|
15
|
+
"debugging",
|
|
16
|
+
"code-review",
|
|
17
|
+
"git-worktrees"
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
function getSuperpowersDir$1() {
|
|
21
|
+
return join(homedir(), ".claude", "plugins", "superpowers");
|
|
18
22
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return fs__default.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
|
23
|
-
} catch {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
23
|
+
function isSuperpowersInstalled() {
|
|
24
|
+
const superpowersDir = getSuperpowersDir$1();
|
|
25
|
+
return existsSync(superpowersDir) && existsSync(join(superpowersDir, "skills"));
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
function areCoreSkillsInstalled() {
|
|
28
|
+
const skillsDir = join(getSuperpowersDir$1(), "skills");
|
|
29
|
+
if (!existsSync(skillsDir)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
for (const skill of CORE_SKILLS) {
|
|
33
|
+
const skillPath = join(skillsDir, skill);
|
|
34
|
+
if (!existsSync(skillPath) || !existsSync(join(skillPath, "skill.json"))) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
40
|
+
async function autoInstallSuperpowers(lang = "zh-CN") {
|
|
41
|
+
try {
|
|
42
|
+
if (isSuperpowersInstalled() && areCoreSkillsInstalled()) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
const result = await installSuperpowers({
|
|
46
|
+
lang,
|
|
47
|
+
skipPrompt: true
|
|
48
|
+
// Skip user prompts for silent installation
|
|
49
|
+
});
|
|
50
|
+
if (!result.success) {
|
|
51
|
+
if (process__default.env.DEBUG) {
|
|
52
|
+
console.error("[CCJK Zero-Config] Installation failed:", result.error || result.message);
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return isSuperpowersInstalled() && areCoreSkillsInstalled();
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (process__default.env.DEBUG) {
|
|
59
|
+
console.error("[CCJK Zero-Config] Auto-install failed:", error);
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
64
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.trim()
|
|
109
|
-
// Strip surrounding quotes
|
|
110
|
-
.replaceAll(/^["']|["']$/g, '');
|
|
111
|
-
}
|
|
65
|
+
function getSkillsDir() {
|
|
66
|
+
return join(homedir(), ".claude", "plugins", "superpowers", "skills");
|
|
67
|
+
}
|
|
68
|
+
function isSkillInstalled(skillName) {
|
|
69
|
+
const skillPath = join(getSkillsDir(), skillName);
|
|
70
|
+
return existsSync(skillPath) && existsSync(join(skillPath, "skill.json"));
|
|
71
|
+
}
|
|
72
|
+
async function loadSkill(skillName) {
|
|
73
|
+
try {
|
|
74
|
+
if (!isSkillInstalled(skillName)) {
|
|
75
|
+
return {
|
|
76
|
+
skill: skillName,
|
|
77
|
+
success: false,
|
|
78
|
+
error: "Skill not installed"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const skillJsonPath = join(getSkillsDir(), skillName, "skill.json");
|
|
82
|
+
const skillJson = JSON.parse(readFileSync(skillJsonPath, "utf-8"));
|
|
83
|
+
if (!skillJson.name || !skillJson.version) {
|
|
84
|
+
return {
|
|
85
|
+
skill: skillName,
|
|
86
|
+
success: false,
|
|
87
|
+
error: "Invalid skill.json format"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
skill: skillName,
|
|
92
|
+
success: true
|
|
93
|
+
};
|
|
94
|
+
} catch (error) {
|
|
95
|
+
return {
|
|
96
|
+
skill: skillName,
|
|
97
|
+
success: false,
|
|
98
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async function loadCoreSkills(_lang = "zh-CN") {
|
|
103
|
+
const results = await Promise.all(
|
|
104
|
+
CORE_SKILLS.map((skill) => loadSkill(skill))
|
|
105
|
+
);
|
|
106
|
+
if (process__default.env.DEBUG) {
|
|
107
|
+
const successful = results.filter((r) => r.success);
|
|
108
|
+
const failed = results.filter((r) => !r.success);
|
|
109
|
+
console.log(`[Zero-Config] Loaded ${successful.length}/${CORE_SKILLS.length} core skills`);
|
|
110
|
+
if (failed.length > 0) {
|
|
111
|
+
console.log(`[Zero-Config] Failed skills: ${failed.map((r) => r.skill).join(", ")}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return results;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
for (const [index, path] of pathArray.entries()) {
|
|
191
|
-
if (!isUrl(path)) {
|
|
192
|
-
indicesToConvert.push(index);
|
|
193
|
-
pathsToConvert.push(path);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Start with original paths (URLs stay as-is)
|
|
198
|
-
const results = [...pathArray];
|
|
199
|
-
|
|
200
|
-
if (pathsToConvert.length > 0) {
|
|
201
|
-
try {
|
|
202
|
-
const {stdout} = await execFile('wslpath', ['-aw', ...pathsToConvert], {encoding: 'utf8'});
|
|
203
|
-
const convertedPaths = stdout.split(/\r?\n/).filter(Boolean);
|
|
204
|
-
|
|
205
|
-
for (const [index, originalIndex] of indicesToConvert.entries()) {
|
|
206
|
-
results[originalIndex] = convertedPaths[index] ?? pathArray[originalIndex];
|
|
207
|
-
}
|
|
208
|
-
} catch {
|
|
209
|
-
// If wslpath fails, keep original paths
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return isBatch ? results : results[0];
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const isUncPath = path => /^\\\\/u.test(path);
|
|
117
|
+
function getActivationStatePath() {
|
|
118
|
+
return join(homedir(), ".claude", "plugins", "superpowers", ".activation-state.json");
|
|
119
|
+
}
|
|
120
|
+
function getSuperpowersDir() {
|
|
121
|
+
return join(homedir(), ".claude", "plugins", "superpowers");
|
|
122
|
+
}
|
|
123
|
+
function loadActivationState() {
|
|
124
|
+
try {
|
|
125
|
+
const statePath = getActivationStatePath();
|
|
126
|
+
if (!existsSync(statePath)) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const stateJson = readFileSync(statePath, "utf-8");
|
|
130
|
+
return JSON.parse(stateJson);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (process__default.env.DEBUG) {
|
|
133
|
+
console.error("[Zero-Config] Failed to load activation state:", error);
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function saveActivationState(status) {
|
|
139
|
+
try {
|
|
140
|
+
const statePath = getActivationStatePath();
|
|
141
|
+
writeFileSync(statePath, JSON.stringify(status, null, 2), "utf-8");
|
|
142
|
+
} catch (error) {
|
|
143
|
+
if (process__default.env.DEBUG) {
|
|
144
|
+
console.error("[Zero-Config] Failed to save activation state:", error);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function checkActivationStatus() {
|
|
149
|
+
const superpowersInstalled = existsSync(getSuperpowersDir());
|
|
150
|
+
const savedState = loadActivationState();
|
|
151
|
+
if (savedState) {
|
|
152
|
+
return savedState;
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
isInstalled: superpowersInstalled,
|
|
156
|
+
coreSkillsLoaded: false,
|
|
157
|
+
loadedSkills: [],
|
|
158
|
+
needsActivation: true,
|
|
159
|
+
lastActivation: void 0
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
async function activateSuperpowers(lang = "zh-CN") {
|
|
163
|
+
const currentStatus = checkActivationStatus();
|
|
164
|
+
if (!currentStatus.needsActivation) {
|
|
165
|
+
return currentStatus;
|
|
166
|
+
}
|
|
167
|
+
if (!currentStatus.isInstalled) {
|
|
168
|
+
const installSuccess = await autoInstallSuperpowers(lang);
|
|
169
|
+
if (!installSuccess) {
|
|
170
|
+
return {
|
|
171
|
+
isInstalled: false,
|
|
172
|
+
coreSkillsLoaded: false,
|
|
173
|
+
loadedSkills: [],
|
|
174
|
+
needsActivation: true,
|
|
175
|
+
lastActivation: void 0
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const loadResults = await loadCoreSkills(lang);
|
|
180
|
+
const successfulLoads = loadResults.filter((r) => r.success);
|
|
181
|
+
const allCoreSkillsLoaded = successfulLoads.length === loadResults.length;
|
|
182
|
+
const newStatus = {
|
|
183
|
+
isInstalled: true,
|
|
184
|
+
coreSkillsLoaded: allCoreSkillsLoaded,
|
|
185
|
+
loadedSkills: successfulLoads.map((r) => r.skill),
|
|
186
|
+
needsActivation: false,
|
|
187
|
+
lastActivation: (/* @__PURE__ */ new Date()).toISOString()
|
|
188
|
+
};
|
|
189
|
+
saveActivationState(newStatus);
|
|
190
|
+
return newStatus;
|
|
191
|
+
}
|
|
217
192
|
|
|
218
|
-
export {
|
|
193
|
+
export { activateSuperpowers, autoInstallSuperpowers, checkActivationStatus, loadCoreSkills, loadSkill };
|