ccjk 13.5.3 → 13.5.4
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 +5 -5
- package/dist/chunks/boost.mjs +8 -1
- package/dist/chunks/ccjk-config.mjs +17 -0
- package/dist/chunks/context.mjs +316 -1
- package/dist/chunks/features.mjs +37 -9
- package/dist/chunks/index4.mjs +8 -1
- package/dist/{shared/ccjk.Crd_nEfj.mjs → chunks/memory-check.mjs} +18 -424
- package/dist/chunks/memory-paths.mjs +259 -0
- package/dist/chunks/memory-sync.mjs +209 -0
- package/dist/chunks/memory.mjs +140 -17
- package/dist/chunks/onboarding-wizard.mjs +8 -1
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/quick-actions.mjs +8 -1
- package/dist/chunks/status.mjs +8 -1
- package/dist/cli.mjs +9 -2
- package/dist/shared/ccjk.xkKNsC02.mjs +421 -0
- package/package.json +68 -65
- package/dist/chunks/auto-memory-bridge.mjs +0 -221
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccjk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.5.
|
|
4
|
+
"version": "13.5.4",
|
|
5
|
+
"packageManager": "pnpm@10.17.1",
|
|
5
6
|
"description": "Turn Claude Code into a production-ready AI dev environment with one-command setup, persistent memory, MCP automation, cloud sync, and zero-config browser workflows.",
|
|
6
7
|
"author": {
|
|
7
8
|
"name": "CCJK Team",
|
|
@@ -80,69 +81,6 @@
|
|
|
80
81
|
"engines": {
|
|
81
82
|
"node": ">=20"
|
|
82
83
|
},
|
|
83
|
-
"dependencies": {
|
|
84
|
-
"better-sqlite3": "^12.6.2",
|
|
85
|
-
"fdir": "^6.5.0",
|
|
86
|
-
"globby": "^14.1.0",
|
|
87
|
-
"ioredis": "^5.9.3",
|
|
88
|
-
"node-cron": "^4.2.1",
|
|
89
|
-
"sql.js": "^1.14.0",
|
|
90
|
-
"tar": "^7.5.9",
|
|
91
|
-
"tinyglobby": "^0.2.15",
|
|
92
|
-
"web-tree-sitter": "^0.26.5"
|
|
93
|
-
},
|
|
94
|
-
"devDependencies": {
|
|
95
|
-
"@antfu/eslint-config": "^5.4.1",
|
|
96
|
-
"@anthropic-ai/sdk": "^0.52.0",
|
|
97
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
98
|
-
"@types/fs-extra": "^11.0.4",
|
|
99
|
-
"@types/inquirer": "^9.0.9",
|
|
100
|
-
"@types/node": "^22.18.6",
|
|
101
|
-
"@types/node-cron": "^3.0.11",
|
|
102
|
-
"@types/semver": "^7.7.1",
|
|
103
|
-
"@types/uuid": "^11.0.0",
|
|
104
|
-
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
105
|
-
"@typescript-eslint/parser": "^6.0.0",
|
|
106
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
107
|
-
"@vitest/ui": "^3.2.4",
|
|
108
|
-
"ansis": "^4.2.0",
|
|
109
|
-
"cac": "^6.7.14",
|
|
110
|
-
"chokidar": "^4.0.3",
|
|
111
|
-
"concurrently": "^9.2.1",
|
|
112
|
-
"consola": "^3.4.2",
|
|
113
|
-
"dayjs": "^1.11.19",
|
|
114
|
-
"eslint": "^9.36.0",
|
|
115
|
-
"eslint-plugin-format": "^1.4.0",
|
|
116
|
-
"find-up-simple": "^1.0.1",
|
|
117
|
-
"fs-extra": "^11.3.3",
|
|
118
|
-
"gray-matter": "^4.0.3",
|
|
119
|
-
"handlebars": "^4.7.8",
|
|
120
|
-
"husky": "^9.1.7",
|
|
121
|
-
"i18next": "^25.8.13",
|
|
122
|
-
"i18next-fs-backend": "^2.6.1",
|
|
123
|
-
"inquirer": "^12.9.6",
|
|
124
|
-
"inquirer-toggle": "^1.0.1",
|
|
125
|
-
"lint-staged": "^16.2.7",
|
|
126
|
-
"lowdb": "^7.0.1",
|
|
127
|
-
"nanoid": "^5.1.6",
|
|
128
|
-
"ofetch": "^1.5.1",
|
|
129
|
-
"ohash": "^1.1.4",
|
|
130
|
-
"ora": "^8.2.0",
|
|
131
|
-
"pathe": "^2.0.3",
|
|
132
|
-
"pkgroll": "^2.26.3",
|
|
133
|
-
"prettier": "^3.8.1",
|
|
134
|
-
"semver": "^7.7.4",
|
|
135
|
-
"shx": "^0.4.0",
|
|
136
|
-
"smol-toml": "^1.6.0",
|
|
137
|
-
"tinyexec": "^1.0.2",
|
|
138
|
-
"trash": "^10.1.0",
|
|
139
|
-
"tsx": "^4.21.0",
|
|
140
|
-
"tweetnacl": "^1.0.3",
|
|
141
|
-
"typescript": "^5.9.3",
|
|
142
|
-
"unbuild": "^3.6.1",
|
|
143
|
-
"uuid": "^11.1.0",
|
|
144
|
-
"vitest": "^3.2.4"
|
|
145
|
-
},
|
|
146
84
|
"scripts": {
|
|
147
85
|
"dev": "tsx ./src/cli.ts",
|
|
148
86
|
"build": "unbuild",
|
|
@@ -150,6 +88,7 @@
|
|
|
150
88
|
"typecheck": "tsc --noEmit",
|
|
151
89
|
"release:verify": "node scripts/release-verify.mjs",
|
|
152
90
|
"release:verify:full": "node scripts/release-verify.mjs --with-tests",
|
|
91
|
+
"prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm contract:check && pnpm build",
|
|
153
92
|
"lint": "eslint",
|
|
154
93
|
"lint:fix": "eslint --fix",
|
|
155
94
|
"test": "vitest",
|
|
@@ -171,6 +110,7 @@
|
|
|
171
110
|
"test:integration:run": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
|
|
172
111
|
"test:integration:ui": "NODE_ENV=test vitest --config vitest.integration.config.ts --ui",
|
|
173
112
|
"test:integration:coverage": "NODE_ENV=test vitest run --config vitest.integration.config.ts --coverage",
|
|
113
|
+
"prepare": "husky",
|
|
174
114
|
"format": "prettier --write src/**/*.ts",
|
|
175
115
|
"prepublish:fix": "node scripts/fix-package-catalog.mjs",
|
|
176
116
|
"cleanup": "node scripts/cleanup.js",
|
|
@@ -205,5 +145,68 @@
|
|
|
205
145
|
"i18n:check": "tsx scripts/check-i18n.ts",
|
|
206
146
|
"i18n:report": "tsx scripts/check-i18n.ts --report",
|
|
207
147
|
"contract:check": "node scripts/check-remote-contract.mjs"
|
|
148
|
+
},
|
|
149
|
+
"dependencies": {
|
|
150
|
+
"better-sqlite3": "^12.6.2",
|
|
151
|
+
"fdir": "^6.5.0",
|
|
152
|
+
"globby": "^14.1.0",
|
|
153
|
+
"ioredis": "^5.9.3",
|
|
154
|
+
"node-cron": "^4.2.1",
|
|
155
|
+
"sql.js": "^1.14.0",
|
|
156
|
+
"tar": "^7.5.9",
|
|
157
|
+
"tinyglobby": "^0.2.15",
|
|
158
|
+
"web-tree-sitter": "^0.26.5"
|
|
159
|
+
},
|
|
160
|
+
"devDependencies": {
|
|
161
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
162
|
+
"@anthropic-ai/sdk": "^0.52.0",
|
|
163
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
164
|
+
"@types/fs-extra": "^11.0.4",
|
|
165
|
+
"@types/inquirer": "^9.0.9",
|
|
166
|
+
"@types/node": "^22.18.6",
|
|
167
|
+
"@types/node-cron": "^3.0.11",
|
|
168
|
+
"@types/semver": "^7.7.1",
|
|
169
|
+
"@types/uuid": "^11.0.0",
|
|
170
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
171
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
172
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
173
|
+
"@vitest/ui": "^3.2.4",
|
|
174
|
+
"ansis": "^4.2.0",
|
|
175
|
+
"cac": "^6.7.14",
|
|
176
|
+
"chokidar": "^4.0.3",
|
|
177
|
+
"concurrently": "^9.2.1",
|
|
178
|
+
"consola": "^3.4.2",
|
|
179
|
+
"dayjs": "^1.11.19",
|
|
180
|
+
"eslint": "^9.36.0",
|
|
181
|
+
"eslint-plugin-format": "^1.4.0",
|
|
182
|
+
"find-up-simple": "^1.0.1",
|
|
183
|
+
"fs-extra": "^11.3.3",
|
|
184
|
+
"gray-matter": "^4.0.3",
|
|
185
|
+
"handlebars": "^4.7.8",
|
|
186
|
+
"husky": "^9.1.7",
|
|
187
|
+
"i18next": "^25.8.13",
|
|
188
|
+
"i18next-fs-backend": "^2.6.1",
|
|
189
|
+
"inquirer": "^12.9.6",
|
|
190
|
+
"inquirer-toggle": "^1.0.1",
|
|
191
|
+
"lint-staged": "^16.2.7",
|
|
192
|
+
"lowdb": "^7.0.1",
|
|
193
|
+
"nanoid": "^5.1.6",
|
|
194
|
+
"ofetch": "^1.5.1",
|
|
195
|
+
"ohash": "^1.1.4",
|
|
196
|
+
"ora": "^8.2.0",
|
|
197
|
+
"pathe": "^2.0.3",
|
|
198
|
+
"pkgroll": "^2.26.3",
|
|
199
|
+
"prettier": "^3.8.1",
|
|
200
|
+
"semver": "^7.7.4",
|
|
201
|
+
"shx": "^0.4.0",
|
|
202
|
+
"smol-toml": "^1.6.0",
|
|
203
|
+
"tinyexec": "^1.0.2",
|
|
204
|
+
"trash": "^10.1.0",
|
|
205
|
+
"tsx": "^4.21.0",
|
|
206
|
+
"tweetnacl": "^1.0.3",
|
|
207
|
+
"typescript": "^5.9.3",
|
|
208
|
+
"unbuild": "^3.6.1",
|
|
209
|
+
"uuid": "^11.1.0",
|
|
210
|
+
"vitest": "^3.2.4"
|
|
208
211
|
}
|
|
209
|
-
}
|
|
212
|
+
}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { stat, writeFile, readdir, readFile } from 'node:fs/promises';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
4
|
-
|
|
5
|
-
function parseAutoMemory(content) {
|
|
6
|
-
const lines = content.split("\n");
|
|
7
|
-
const entries = [];
|
|
8
|
-
let currentEntry = null;
|
|
9
|
-
for (const line of lines) {
|
|
10
|
-
const headerMatch = line.match(/^(#{1,6})\s+(.+)$/);
|
|
11
|
-
if (headerMatch) {
|
|
12
|
-
if (currentEntry && currentEntry.content.length > 0) {
|
|
13
|
-
entries.push(currentEntry);
|
|
14
|
-
}
|
|
15
|
-
currentEntry = {
|
|
16
|
-
title: headerMatch[2].trim(),
|
|
17
|
-
content: [],
|
|
18
|
-
level: headerMatch[1].length
|
|
19
|
-
};
|
|
20
|
-
} else if (currentEntry && line.trim()) {
|
|
21
|
-
currentEntry.content.push(line);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (currentEntry && currentEntry.content.length > 0) {
|
|
25
|
-
entries.push(currentEntry);
|
|
26
|
-
}
|
|
27
|
-
return entries;
|
|
28
|
-
}
|
|
29
|
-
function autoMemoryToBrainContext(entries, projectPath) {
|
|
30
|
-
const context = {
|
|
31
|
-
facts: [],
|
|
32
|
-
patterns: [],
|
|
33
|
-
decisions: [],
|
|
34
|
-
metadata: {
|
|
35
|
-
source: "auto-memory",
|
|
36
|
-
projectPath,
|
|
37
|
-
syncedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
for (const entry of entries) {
|
|
41
|
-
const contentText = entry.content.join("\n").trim();
|
|
42
|
-
const titleLower = entry.title.toLowerCase();
|
|
43
|
-
if (titleLower.includes("architecture") || titleLower.includes("pattern") || titleLower.includes("design")) {
|
|
44
|
-
context.patterns.push({
|
|
45
|
-
name: entry.title,
|
|
46
|
-
description: contentText,
|
|
47
|
-
category: "architecture"
|
|
48
|
-
});
|
|
49
|
-
} else if (titleLower.includes("decision") || titleLower.includes("choice") || titleLower.includes("why")) {
|
|
50
|
-
context.decisions.push({
|
|
51
|
-
decision: entry.title,
|
|
52
|
-
rationale: contentText,
|
|
53
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
context.facts.push({
|
|
57
|
-
key: entry.title,
|
|
58
|
-
value: contentText,
|
|
59
|
-
confidence: 0.9
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return context;
|
|
64
|
-
}
|
|
65
|
-
function brainContextToAutoMemory(context) {
|
|
66
|
-
const lines = [];
|
|
67
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
68
|
-
lines.push("# CCJK Brain Memory");
|
|
69
|
-
lines.push("");
|
|
70
|
-
lines.push(`Last synced: ${timestamp}`);
|
|
71
|
-
lines.push("");
|
|
72
|
-
if (context.facts.length > 0) {
|
|
73
|
-
lines.push("## Key Facts");
|
|
74
|
-
lines.push("");
|
|
75
|
-
for (const fact of context.facts) {
|
|
76
|
-
lines.push(`### ${fact.key}`);
|
|
77
|
-
lines.push(fact.value);
|
|
78
|
-
lines.push("");
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (context.patterns.length > 0) {
|
|
82
|
-
lines.push("## Patterns & Architecture");
|
|
83
|
-
lines.push("");
|
|
84
|
-
for (const pattern of context.patterns) {
|
|
85
|
-
lines.push(`### ${pattern.name}`);
|
|
86
|
-
lines.push(pattern.description);
|
|
87
|
-
if (pattern.category) {
|
|
88
|
-
lines.push(`Category: ${pattern.category}`);
|
|
89
|
-
}
|
|
90
|
-
lines.push("");
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (context.decisions.length > 0) {
|
|
94
|
-
lines.push("## Decisions");
|
|
95
|
-
lines.push("");
|
|
96
|
-
for (const decision of context.decisions) {
|
|
97
|
-
lines.push(`### ${decision.decision}`);
|
|
98
|
-
lines.push(decision.rationale);
|
|
99
|
-
if (decision.timestamp) {
|
|
100
|
-
lines.push(`Decided: ${decision.timestamp}`);
|
|
101
|
-
}
|
|
102
|
-
lines.push("");
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return lines.join("\n");
|
|
106
|
-
}
|
|
107
|
-
async function findAutoMemoryFiles(claudeProjectsDir) {
|
|
108
|
-
const baseDir = claudeProjectsDir || join(homedir(), ".claude", "projects");
|
|
109
|
-
const documents = [];
|
|
110
|
-
try {
|
|
111
|
-
const projectDirs = await readdir(baseDir);
|
|
112
|
-
for (const projectDir of projectDirs) {
|
|
113
|
-
const memoryPath = join(baseDir, projectDir, "memory", "MEMORY.md");
|
|
114
|
-
try {
|
|
115
|
-
const content = await readFile(memoryPath, "utf-8");
|
|
116
|
-
const entries = parseAutoMemory(content);
|
|
117
|
-
const projectPath = projectDir.startsWith("-") ? projectDir.slice(1).replace(/-/g, "/") : projectDir;
|
|
118
|
-
documents.push({
|
|
119
|
-
projectPath,
|
|
120
|
-
entries,
|
|
121
|
-
rawContent: content
|
|
122
|
-
});
|
|
123
|
-
} catch {
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
} catch {
|
|
128
|
-
return [];
|
|
129
|
-
}
|
|
130
|
-
return documents;
|
|
131
|
-
}
|
|
132
|
-
async function syncAutoMemoryToBrain(session, config) {
|
|
133
|
-
const documents = await findAutoMemoryFiles(config?.claudeProjectsDir);
|
|
134
|
-
for (const doc of documents) {
|
|
135
|
-
if (session.metadata?.projectPath === doc.projectPath) {
|
|
136
|
-
const brainContext = autoMemoryToBrainContext(doc.entries, doc.projectPath);
|
|
137
|
-
session.context.facts.push(...brainContext.facts);
|
|
138
|
-
session.context.patterns.push(...brainContext.patterns);
|
|
139
|
-
session.context.decisions.push(...brainContext.decisions);
|
|
140
|
-
session.metadata = {
|
|
141
|
-
...session.metadata,
|
|
142
|
-
autoMemorySyncedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
async function syncBrainToAutoMemory(session, config) {
|
|
148
|
-
if (!config?.bidirectional) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const projectPath = session.metadata?.projectPath;
|
|
152
|
-
if (!projectPath) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
const baseDir = config.claudeProjectsDir || join(homedir(), ".claude", "projects");
|
|
156
|
-
const projectDirName = `-${projectPath.replace(/\//g, "-")}`;
|
|
157
|
-
const memoryDir = join(baseDir, projectDirName, "memory");
|
|
158
|
-
const memoryPath = join(memoryDir, "MEMORY.md");
|
|
159
|
-
const content = brainContextToAutoMemory(session.context);
|
|
160
|
-
try {
|
|
161
|
-
await stat(memoryDir);
|
|
162
|
-
} catch {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
await writeFile(memoryPath, content, "utf-8");
|
|
166
|
-
}
|
|
167
|
-
class AutoMemoryBridge {
|
|
168
|
-
config;
|
|
169
|
-
syncTimer;
|
|
170
|
-
constructor(config) {
|
|
171
|
-
this.config = {
|
|
172
|
-
claudeProjectsDir: config?.claudeProjectsDir || join(homedir(), ".claude", "projects"),
|
|
173
|
-
syncInterval: config?.syncInterval ?? 0,
|
|
174
|
-
bidirectional: config?.bidirectional ?? false
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Start periodic sync
|
|
179
|
-
*/
|
|
180
|
-
startSync(session) {
|
|
181
|
-
if (this.config.syncInterval <= 0) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
this.syncTimer = setInterval(async () => {
|
|
185
|
-
try {
|
|
186
|
-
await syncAutoMemoryToBrain(session, this.config);
|
|
187
|
-
if (this.config.bidirectional) {
|
|
188
|
-
await syncBrainToAutoMemory(session, this.config);
|
|
189
|
-
}
|
|
190
|
-
} catch (err) {
|
|
191
|
-
console.error("Auto-memory sync failed:", err);
|
|
192
|
-
}
|
|
193
|
-
}, this.config.syncInterval);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Stop periodic sync
|
|
197
|
-
*/
|
|
198
|
-
stopSync() {
|
|
199
|
-
if (this.syncTimer) {
|
|
200
|
-
clearInterval(this.syncTimer);
|
|
201
|
-
this.syncTimer = void 0;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Perform one-time sync
|
|
206
|
-
*/
|
|
207
|
-
async sync(session) {
|
|
208
|
-
await syncAutoMemoryToBrain(session, this.config);
|
|
209
|
-
if (this.config.bidirectional) {
|
|
210
|
-
await syncBrainToAutoMemory(session, this.config);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
async syncToClaude(session) {
|
|
214
|
-
if (!session) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
await syncBrainToAutoMemory(session, this.config);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export { AutoMemoryBridge, autoMemoryToBrainContext, brainContextToAutoMemory, findAutoMemoryFiles, parseAutoMemory, syncAutoMemoryToBrain, syncBrainToAutoMemory };
|