ccjk 13.3.6 → 13.3.7
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/agent-teams.mjs +7 -5
- package/dist/chunks/agent.mjs +2 -2
- package/dist/chunks/agents.mjs +16 -16
- package/dist/chunks/api-cli.mjs +6 -6
- package/dist/chunks/api-providers.mjs +1 -1
- package/dist/chunks/api.mjs +4 -4
- package/dist/chunks/auto-bootstrap.mjs +1 -1
- package/dist/chunks/auto-fix.mjs +49 -4
- package/dist/chunks/auto-fixer.mjs +7 -5
- package/dist/chunks/auto-init.mjs +9 -7208
- package/dist/chunks/auto-memory-bridge.mjs +9 -3
- package/dist/chunks/auto-updater.mjs +9 -9
- package/dist/chunks/auto-upgrade.mjs +5 -3
- package/dist/chunks/banner.mjs +4 -3
- package/dist/chunks/boost.mjs +118 -62
- package/dist/chunks/ccjk-agents.mjs +3 -3
- package/dist/chunks/ccjk-all.mjs +7 -7
- package/dist/chunks/ccjk-config.mjs +2 -2
- package/dist/chunks/ccjk-hooks.mjs +4 -4
- package/dist/chunks/ccjk-mcp.mjs +5 -5
- package/dist/chunks/ccjk-setup.mjs +5 -5
- package/dist/chunks/ccjk-skills.mjs +5 -5
- package/dist/chunks/ccr.mjs +18 -16
- package/dist/chunks/ccu.mjs +2 -2
- package/dist/chunks/check-updates.mjs +8 -8
- package/dist/chunks/claude-code-config-manager.mjs +12 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +7 -7
- package/dist/chunks/claude-config.mjs +1 -1
- package/dist/chunks/claude-wrapper.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +15 -15
- package/dist/chunks/codex-config-switch.mjs +7 -7
- package/dist/chunks/codex-provider-manager.mjs +7 -7
- package/dist/chunks/codex-uninstaller.mjs +2 -2
- package/dist/chunks/codex.mjs +5 -5
- package/dist/chunks/commands.mjs +2 -2
- package/dist/chunks/commands2.mjs +3 -3
- package/dist/chunks/commit.mjs +2 -2
- package/dist/chunks/completion.mjs +2 -2
- package/dist/chunks/config-consolidator.mjs +2 -2
- package/dist/chunks/config-switch.mjs +8 -8
- package/dist/chunks/config.mjs +6 -5
- package/dist/chunks/config2.mjs +5 -5
- package/dist/chunks/config3.mjs +4 -4
- package/dist/chunks/constants.mjs +1 -1
- package/dist/chunks/context-opt.mjs +92 -90
- package/dist/chunks/context.mjs +659 -0
- package/dist/chunks/dashboard.mjs +14 -9
- package/dist/chunks/doctor.mjs +4 -4
- package/dist/chunks/eval.mjs +502 -0
- package/dist/chunks/evolution.mjs +46 -39
- package/dist/chunks/health-alerts.mjs +9 -9
- package/dist/chunks/help.mjs +1 -1
- package/dist/chunks/hook-installer.mjs +6 -3
- package/dist/chunks/index.mjs +23 -0
- package/dist/chunks/index10.mjs +634 -571
- package/dist/chunks/index11.mjs +1061 -569
- package/dist/chunks/index12.mjs +914 -1076
- package/dist/chunks/index13.mjs +136 -951
- package/dist/chunks/index14.mjs +209 -185
- package/dist/chunks/index2.mjs +19 -24
- package/dist/chunks/index3.mjs +19085 -12
- package/dist/chunks/index4.mjs +16 -19092
- package/dist/chunks/index5.mjs +7602 -16
- package/dist/chunks/index6.mjs +159 -7590
- package/dist/chunks/index7.mjs +1602 -171
- package/dist/chunks/index8.mjs +19 -1602
- package/dist/chunks/index9.mjs +612 -15
- package/dist/chunks/init.mjs +26 -19
- package/dist/chunks/installer.mjs +5 -5
- package/dist/chunks/installer2.mjs +2 -2
- package/dist/chunks/intent-engine.mjs +1 -1
- package/dist/chunks/interview.mjs +4 -4
- package/dist/chunks/manager.mjs +1 -1
- package/dist/chunks/marketplace.mjs +2 -2
- package/dist/chunks/mcp-cli.mjs +12 -12
- package/dist/chunks/mcp.mjs +8 -8
- package/dist/chunks/memory.mjs +8 -8
- package/dist/chunks/menu-hierarchical.mjs +24 -22
- package/dist/chunks/menu.mjs +27 -22
- package/dist/chunks/metrics-display.mjs +2 -2
- package/dist/chunks/migrator.mjs +1 -1
- package/dist/chunks/monitor.mjs +2 -2
- package/dist/chunks/notification.mjs +6 -6
- package/dist/chunks/onboarding-wizard.mjs +6 -5
- package/dist/chunks/onboarding.mjs +4 -4
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/paradigm.mjs +2 -2
- package/dist/chunks/permission-manager.mjs +2 -2
- package/dist/chunks/permissions.mjs +3 -3
- package/dist/chunks/persistence-manager.mjs +19 -12
- package/dist/chunks/persistence.mjs +5 -3
- package/dist/chunks/plugin.mjs +2 -2
- package/dist/chunks/prompts.mjs +5 -5
- package/dist/chunks/providers.mjs +2 -2
- package/dist/chunks/quick-actions.mjs +7 -6
- package/dist/chunks/quick-provider.mjs +5 -4
- package/dist/chunks/quick-setup.mjs +20 -15
- package/dist/chunks/remote.mjs +15 -16
- package/dist/chunks/{convoy-manager.mjs → session-manager.mjs} +1129 -1095
- package/dist/chunks/session.mjs +2 -2
- package/dist/chunks/sessions.mjs +3 -3
- package/dist/chunks/silent-updater.mjs +1 -1
- package/dist/chunks/simple-config.mjs +2 -2
- package/dist/chunks/skill2.mjs +3 -3
- package/dist/chunks/skills-sync.mjs +5 -5
- package/dist/chunks/skills.mjs +3 -3
- package/dist/chunks/slash-commands.mjs +9 -8
- package/dist/chunks/smart-defaults.mjs +9 -5
- package/dist/chunks/startup.mjs +1 -1
- package/dist/chunks/stats.mjs +2 -2
- package/dist/chunks/status.mjs +37 -22
- package/dist/chunks/team.mjs +3 -3
- package/dist/chunks/thinking.mjs +4 -4
- package/dist/chunks/trace.mjs +2 -2
- package/dist/chunks/uninstall.mjs +9 -9
- package/dist/chunks/update.mjs +14 -11
- package/dist/chunks/upgrade-manager.mjs +3 -3
- package/dist/chunks/upgrade.mjs +25 -9
- package/dist/chunks/version-checker.mjs +4 -4
- package/dist/chunks/vim.mjs +3 -3
- package/dist/chunks/workflows.mjs +1 -1
- package/dist/chunks/wsl.mjs +1 -1
- package/dist/chunks/zero-config.mjs +4 -4
- package/dist/cli.mjs +60 -26
- package/dist/index.d.mts +4392 -4392
- package/dist/index.d.ts +4392 -4392
- package/dist/index.mjs +4314 -4314
- package/dist/shared/{ccjk.DcKLglJQ.mjs → ccjk.BIxuVL3_.mjs} +2 -2
- package/dist/shared/{ccjk.DJdmgr2d.mjs → ccjk.BJMRY2Ra.mjs} +5 -3
- package/dist/shared/{ccjk.B1TwPltj.mjs → ccjk.BOu1yav7.mjs} +3 -2
- package/dist/shared/{ccjk.mJpVRDZ8.mjs → ccjk.BWFpnOr3.mjs} +1 -1
- package/dist/shared/{ccjk.BfIpomdz.mjs → ccjk.CHUEFqmw.mjs} +3 -2
- package/dist/shared/{ccjk.CqdbaXqU.mjs → ccjk.CLUL0pAV.mjs} +9 -5
- package/dist/shared/{ccjk.Cot9p9_n.mjs → ccjk.Cjj8SVrn.mjs} +1 -1
- package/dist/shared/{ccjk.CfrpIIKy.mjs → ccjk.Crd_nEfj.mjs} +38 -20
- package/dist/shared/{ccjk.DCw2WnZU.mjs → ccjk.CvChMYvB.mjs} +1 -1
- package/dist/shared/{ccjk.CXzjn01x.mjs → ccjk.D8ZLYSZZ.mjs} +1 -1
- package/dist/shared/{ccjk.BrPUmTqm.mjs → ccjk.DJuyfrlL.mjs} +164 -82
- package/dist/shared/{ccjk.DHXfsrwn.mjs → ccjk.DRfdq6yl.mjs} +4 -4
- package/dist/shared/{ccjk.DXRAZcix.mjs → ccjk.DScm_NnL.mjs} +8 -4
- package/dist/shared/{ccjk.XsJWJuQP.mjs → ccjk.DfZKjHvG.mjs} +6 -128
- package/dist/shared/{ccjk.BFxsJM0k.mjs → ccjk.DwSebGy0.mjs} +4 -3
- package/dist/shared/ccjk.DxWqH-EF.mjs +170 -0
- package/dist/shared/{ccjk.Cwa_FiTX.mjs → ccjk.I6IuYdc_.mjs} +2 -2
- package/dist/shared/{ccjk.DpstNaeR.mjs → ccjk.KpFl2RDA.mjs} +3 -3
- package/dist/shared/{ccjk.dYDLfmph.mjs → ccjk._dESH4Rk.mjs} +1 -1
- package/dist/shared/{ccjk.BxSmJ8B7.mjs → ccjk.wLJHO0Af.mjs} +2 -1
- package/package.json +2 -1
- package/dist/chunks/index15.mjs +0 -218
- package/dist/shared/{ccjk.c-ETfBZ_.mjs → ccjk.eIn-g1yI.mjs} +96 -96
|
@@ -1,106 +1,11 @@
|
|
|
1
1
|
import { existsSync, readFileSync, mkdirSync, unlinkSync } from 'node:fs';
|
|
2
2
|
import os__default, { homedir } from 'node:os';
|
|
3
|
+
import { c as createDefaultGateway } from './ccjk.BtB1e5jm.mjs';
|
|
3
4
|
import { writeFileAtomic } from '../chunks/fs-operations.mjs';
|
|
4
5
|
import { Buffer } from 'node:buffer';
|
|
5
6
|
import crypto from 'node:crypto';
|
|
6
|
-
import { c as createDefaultGateway } from './ccjk.BtB1e5jm.mjs';
|
|
7
7
|
import { j as join } from './ccjk.bQ7Dh1g4.mjs';
|
|
8
8
|
|
|
9
|
-
const TOKEN_PREFIX = "ccjk_";
|
|
10
|
-
const TOKEN_LENGTH = 64;
|
|
11
|
-
const TOKEN_VERSION = 1;
|
|
12
|
-
function generateDeviceToken() {
|
|
13
|
-
const randomBytes = crypto.randomBytes(TOKEN_LENGTH / 2);
|
|
14
|
-
const randomHex = randomBytes.toString("hex");
|
|
15
|
-
return `${TOKEN_PREFIX}${TOKEN_VERSION}${randomHex}`;
|
|
16
|
-
}
|
|
17
|
-
function isValidTokenFormat(token) {
|
|
18
|
-
if (!token || typeof token !== "string") {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
if (!token.startsWith(TOKEN_PREFIX)) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
const expectedLength = TOKEN_PREFIX.length + 1 + TOKEN_LENGTH;
|
|
25
|
-
if (token.length !== expectedLength) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
const version = token[TOKEN_PREFIX.length];
|
|
29
|
-
if (!/^\d$/.test(version)) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
const hexPart = token.slice(TOKEN_PREFIX.length + 1);
|
|
33
|
-
if (!/^[a-f0-9]+$/i.test(hexPart)) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
function getDeviceInfo() {
|
|
39
|
-
return {
|
|
40
|
-
name: os__default.hostname(),
|
|
41
|
-
platform: os__default.platform(),
|
|
42
|
-
osVersion: os__default.release(),
|
|
43
|
-
arch: os__default.arch(),
|
|
44
|
-
username: os__default.userInfo().username,
|
|
45
|
-
machineId: generateMachineId()
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function generateMachineId() {
|
|
49
|
-
const components = [
|
|
50
|
-
os__default.hostname(),
|
|
51
|
-
os__default.platform(),
|
|
52
|
-
os__default.arch(),
|
|
53
|
-
os__default.cpus()[0]?.model || "unknown",
|
|
54
|
-
os__default.userInfo().username,
|
|
55
|
-
// Add network interface MAC addresses for uniqueness
|
|
56
|
-
...Object.values(os__default.networkInterfaces()).flat().filter((iface) => iface && !iface.internal && iface.mac !== "00:00:00:00:00:00").map((iface) => iface?.mac).filter(Boolean).slice(0, 3)
|
|
57
|
-
// Limit to first 3 MACs
|
|
58
|
-
];
|
|
59
|
-
const combined = components.join("|");
|
|
60
|
-
return crypto.createHash("sha256").update(combined).digest("hex").slice(0, 32);
|
|
61
|
-
}
|
|
62
|
-
function deriveEncryptionKey() {
|
|
63
|
-
const machineId = generateMachineId();
|
|
64
|
-
const salt = "ccjk-notification-token-v1";
|
|
65
|
-
return crypto.pbkdf2Sync(machineId, salt, 1e5, 32, "sha256");
|
|
66
|
-
}
|
|
67
|
-
function encryptToken(token) {
|
|
68
|
-
const key = deriveEncryptionKey();
|
|
69
|
-
const iv = crypto.randomBytes(16);
|
|
70
|
-
const cipher = crypto.createCipheriv("aes-256-gcm", key, iv);
|
|
71
|
-
let encrypted = cipher.update(token, "utf8", "hex");
|
|
72
|
-
encrypted += cipher.final("hex");
|
|
73
|
-
const authTag = cipher.getAuthTag();
|
|
74
|
-
return `${iv.toString("hex")}:${authTag.toString("hex")}:${encrypted}`;
|
|
75
|
-
}
|
|
76
|
-
function decryptToken(encryptedToken) {
|
|
77
|
-
try {
|
|
78
|
-
const parts = encryptedToken.split(":");
|
|
79
|
-
if (parts.length !== 3) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
const [ivHex, authTagHex, encrypted] = parts;
|
|
83
|
-
const key = deriveEncryptionKey();
|
|
84
|
-
const iv = Buffer.from(ivHex, "hex");
|
|
85
|
-
const authTag = Buffer.from(authTagHex, "hex");
|
|
86
|
-
const decipher = crypto.createDecipheriv("aes-256-gcm", key, iv);
|
|
87
|
-
decipher.setAuthTag(authTag);
|
|
88
|
-
let decrypted = decipher.update(encrypted, "hex", "utf8");
|
|
89
|
-
decrypted += decipher.final("utf8");
|
|
90
|
-
return decrypted;
|
|
91
|
-
} catch {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function maskToken(token) {
|
|
96
|
-
if (!token || token.length < 12) {
|
|
97
|
-
return "***";
|
|
98
|
-
}
|
|
99
|
-
const prefix = token.slice(0, TOKEN_PREFIX.length + 1);
|
|
100
|
-
const suffix = token.slice(-4);
|
|
101
|
-
return `${prefix}***...***${suffix}`;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
9
|
function validateBindRequest(request) {
|
|
105
10
|
const errors = [];
|
|
106
11
|
if (!request.code || typeof request.code !== "string") {
|
|
@@ -237,6 +142,101 @@ function validatePollResponse(response) {
|
|
|
237
142
|
};
|
|
238
143
|
}
|
|
239
144
|
|
|
145
|
+
const TOKEN_PREFIX = "ccjk_";
|
|
146
|
+
const TOKEN_LENGTH = 64;
|
|
147
|
+
const TOKEN_VERSION = 1;
|
|
148
|
+
function generateDeviceToken() {
|
|
149
|
+
const randomBytes = crypto.randomBytes(TOKEN_LENGTH / 2);
|
|
150
|
+
const randomHex = randomBytes.toString("hex");
|
|
151
|
+
return `${TOKEN_PREFIX}${TOKEN_VERSION}${randomHex}`;
|
|
152
|
+
}
|
|
153
|
+
function isValidTokenFormat(token) {
|
|
154
|
+
if (!token || typeof token !== "string") {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
if (!token.startsWith(TOKEN_PREFIX)) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
const expectedLength = TOKEN_PREFIX.length + 1 + TOKEN_LENGTH;
|
|
161
|
+
if (token.length !== expectedLength) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
const version = token[TOKEN_PREFIX.length];
|
|
165
|
+
if (!/^\d$/.test(version)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
const hexPart = token.slice(TOKEN_PREFIX.length + 1);
|
|
169
|
+
if (!/^[a-f0-9]+$/i.test(hexPart)) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
function getDeviceInfo() {
|
|
175
|
+
return {
|
|
176
|
+
name: os__default.hostname(),
|
|
177
|
+
platform: os__default.platform(),
|
|
178
|
+
osVersion: os__default.release(),
|
|
179
|
+
arch: os__default.arch(),
|
|
180
|
+
username: os__default.userInfo().username,
|
|
181
|
+
machineId: generateMachineId()
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function generateMachineId() {
|
|
185
|
+
const components = [
|
|
186
|
+
os__default.hostname(),
|
|
187
|
+
os__default.platform(),
|
|
188
|
+
os__default.arch(),
|
|
189
|
+
os__default.cpus()[0]?.model || "unknown",
|
|
190
|
+
os__default.userInfo().username,
|
|
191
|
+
// Add network interface MAC addresses for uniqueness
|
|
192
|
+
...Object.values(os__default.networkInterfaces()).flat().filter((iface) => iface && !iface.internal && iface.mac !== "00:00:00:00:00:00").map((iface) => iface?.mac).filter(Boolean).slice(0, 3)
|
|
193
|
+
// Limit to first 3 MACs
|
|
194
|
+
];
|
|
195
|
+
const combined = components.join("|");
|
|
196
|
+
return crypto.createHash("sha256").update(combined).digest("hex").slice(0, 32);
|
|
197
|
+
}
|
|
198
|
+
function deriveEncryptionKey() {
|
|
199
|
+
const machineId = generateMachineId();
|
|
200
|
+
const salt = "ccjk-notification-token-v1";
|
|
201
|
+
return crypto.pbkdf2Sync(machineId, salt, 1e5, 32, "sha256");
|
|
202
|
+
}
|
|
203
|
+
function encryptToken(token) {
|
|
204
|
+
const key = deriveEncryptionKey();
|
|
205
|
+
const iv = crypto.randomBytes(16);
|
|
206
|
+
const cipher = crypto.createCipheriv("aes-256-gcm", key, iv);
|
|
207
|
+
let encrypted = cipher.update(token, "utf8", "hex");
|
|
208
|
+
encrypted += cipher.final("hex");
|
|
209
|
+
const authTag = cipher.getAuthTag();
|
|
210
|
+
return `${iv.toString("hex")}:${authTag.toString("hex")}:${encrypted}`;
|
|
211
|
+
}
|
|
212
|
+
function decryptToken(encryptedToken) {
|
|
213
|
+
try {
|
|
214
|
+
const parts = encryptedToken.split(":");
|
|
215
|
+
if (parts.length !== 3) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
const [ivHex, authTagHex, encrypted] = parts;
|
|
219
|
+
const key = deriveEncryptionKey();
|
|
220
|
+
const iv = Buffer.from(ivHex, "hex");
|
|
221
|
+
const authTag = Buffer.from(authTagHex, "hex");
|
|
222
|
+
const decipher = crypto.createDecipheriv("aes-256-gcm", key, iv);
|
|
223
|
+
decipher.setAuthTag(authTag);
|
|
224
|
+
let decrypted = decipher.update(encrypted, "hex", "utf8");
|
|
225
|
+
decrypted += decipher.final("utf8");
|
|
226
|
+
return decrypted;
|
|
227
|
+
} catch {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function maskToken(token) {
|
|
232
|
+
if (!token || token.length < 12) {
|
|
233
|
+
return "***";
|
|
234
|
+
}
|
|
235
|
+
const prefix = token.slice(0, TOKEN_PREFIX.length + 1);
|
|
236
|
+
const suffix = token.slice(-4);
|
|
237
|
+
return `${prefix}***...***${suffix}`;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
240
|
const CLOUD_API_BASE_URL = "https://api.claudehome.cn";
|
|
241
241
|
const POLL_TIMEOUT = 6e4;
|
|
242
242
|
const TOKEN_FILE_PATH = join(homedir(), ".ccjk", "cloud-token.json");
|