@surething/cockpit 1.0.215 → 1.0.217
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +2 -2
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +1 -1
- package/.next-prod/server/app/_not-found.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +2 -2
- package/.next-prod/server/chunks/2939.js +1 -1
- package/.next-prod/server/chunks/8916.js +1 -1
- package/.next-prod/server/chunks/9658.js +5 -5
- package/.next-prod/server/chunks/9877.js +10 -1
- package/.next-prod/server/functions-config-manifest.json +1 -0
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +1 -1
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/6345-d477b8d5c682b1fb.js +14 -0
- package/.next-prod/static/chunks/6917-0a22d7764ca45244.js +29 -0
- package/.next-prod/static/chunks/app/{layout-a0362651ba6e6e6f.js → layout-8e3a54b794cb35b6.js} +1 -1
- package/.next-prod/static/chunks/app/{project/page-1b14cabf47df9ff7.js → page-3ab0a0f28cbdc8e2.js} +1 -1
- package/.next-prod/static/chunks/app/{page-1b14cabf47df9ff7.js → project/page-3ab0a0f28cbdc8e2.js} +1 -1
- package/.next-prod/static/css/fc2730c2dbe4866e.css +1 -0
- package/.next-prod/trace +13 -13
- package/.next-prod/trace-build +1 -1
- package/README.md +3 -2
- package/README.zh.md +3 -2
- package/bin/cock-codegraph.mjs +28 -13
- package/bin/cock-connection.mjs +151 -0
- package/bin/cock.mjs +12 -1
- package/bin/setup-dev.mjs +15 -13
- package/dist/{chunk-CZWJPTRO.mjs → chunk-GCYLMG43.mjs} +2486 -1047
- package/dist/chunk-O4P2J44N.mjs +314 -0
- package/dist/{chunk-KRTISG5I.mjs → chunk-W6G6X3FP.mjs} +196 -9
- package/dist/httpApi.mjs +75 -2
- package/dist/scheduledTasks.mjs +9 -1158
- package/dist/{server-OSOMFNXR.mjs → server-ZBUZ24TC.mjs} +4 -2
- package/dist/wsServer.mjs +24 -19
- package/package.json +1 -1
- package/server.mjs +5 -1
- package/.next-prod/static/chunks/5188-415582403ef0e29c.js +0 -29
- package/.next-prod/static/chunks/6345-e5ceeb2aeb698eb6.js +0 -14
- package/.next-prod/static/css/cc6d733cdf607b30.css +0 -1
- package/dist/chunk-ZJ6CC3MH.mjs +0 -223
- /package/.next-prod/static/{dtH6UmANw3cgn-jbRuVu4 → 7pu1LXbRRLfg05VN3u39s}/_buildManifest.js +0 -0
- /package/.next-prod/static/{dtH6UmANw3cgn-jbRuVu4 → 7pu1LXbRRLfg05VN3u39s}/_ssgManifest.js +0 -0
package/dist/chunk-ZJ6CC3MH.mjs
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
// packages/feature/console/src/server/plugins/neo4j/neo4jCore.ts
|
|
2
|
-
import neo4j from "neo4j-driver";
|
|
3
|
-
async function createNeo4jDriver(connectionString) {
|
|
4
|
-
const url = new URL(connectionString);
|
|
5
|
-
const scheme = url.protocol.replace(":", "");
|
|
6
|
-
const host = url.hostname;
|
|
7
|
-
const port = url.port || "7687";
|
|
8
|
-
const user = decodeURIComponent(url.username || "neo4j");
|
|
9
|
-
const password = decodeURIComponent(url.password || "");
|
|
10
|
-
const uri = `${scheme}://${host}:${port}`;
|
|
11
|
-
const driver = neo4j.driver(uri, neo4j.auth.basic(user, password));
|
|
12
|
-
await driver.verifyConnectivity();
|
|
13
|
-
return driver;
|
|
14
|
-
}
|
|
15
|
-
async function runCypherWithDriver(driver, cypher, params) {
|
|
16
|
-
const session = driver.session();
|
|
17
|
-
try {
|
|
18
|
-
const start = Date.now();
|
|
19
|
-
const result = await session.run(cypher, params || {});
|
|
20
|
-
const duration = Date.now() - start;
|
|
21
|
-
const records = result.records.map((record) => {
|
|
22
|
-
const obj = {};
|
|
23
|
-
for (const key of record.keys) {
|
|
24
|
-
obj[key] = serializeValue(record.get(key));
|
|
25
|
-
}
|
|
26
|
-
return obj;
|
|
27
|
-
});
|
|
28
|
-
return {
|
|
29
|
-
records,
|
|
30
|
-
keys: result.records.length > 0 ? result.records[0].keys : [],
|
|
31
|
-
duration,
|
|
32
|
-
counters: result.summary.counters.updates()
|
|
33
|
-
};
|
|
34
|
-
} finally {
|
|
35
|
-
await session.close();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function serializeValue(val) {
|
|
39
|
-
if (val === null || val === void 0) return null;
|
|
40
|
-
if (neo4j.isInt(val)) return val.toNumber();
|
|
41
|
-
if (val && typeof val === "object" && "labels" in val && "properties" in val) {
|
|
42
|
-
const node = val;
|
|
43
|
-
return {
|
|
44
|
-
_type: "node",
|
|
45
|
-
_id: serializeValue(node.identity),
|
|
46
|
-
_labels: node.labels,
|
|
47
|
-
...Object.fromEntries(
|
|
48
|
-
Object.entries(node.properties).map(([k, v]) => [k, serializeValue(v)])
|
|
49
|
-
)
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
if (val && typeof val === "object" && "type" in val && "start" in val && "end" in val && "properties" in val) {
|
|
53
|
-
const rel = val;
|
|
54
|
-
return {
|
|
55
|
-
_type: "relationship",
|
|
56
|
-
_id: serializeValue(rel.identity),
|
|
57
|
-
_relType: rel.type,
|
|
58
|
-
_start: serializeValue(rel.start),
|
|
59
|
-
_end: serializeValue(rel.end),
|
|
60
|
-
...Object.fromEntries(
|
|
61
|
-
Object.entries(rel.properties).map(([k, v]) => [k, serializeValue(v)])
|
|
62
|
-
)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
if (val && typeof val === "object" && "segments" in val) {
|
|
66
|
-
const path = val;
|
|
67
|
-
return {
|
|
68
|
-
_type: "path",
|
|
69
|
-
segments: path.segments.map((s) => ({
|
|
70
|
-
start: serializeValue(s.start),
|
|
71
|
-
relationship: serializeValue(s.relationship),
|
|
72
|
-
end: serializeValue(s.end)
|
|
73
|
-
}))
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
if (Array.isArray(val)) return val.map((v) => serializeValue(v));
|
|
77
|
-
if (val && typeof val === "object" && val.constructor === Object) {
|
|
78
|
-
return Object.fromEntries(
|
|
79
|
-
Object.entries(val).map(([k, v]) => [k, serializeValue(v)])
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
return val;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// packages/shared/utils/src/paths.ts
|
|
86
|
-
import { homedir } from "os";
|
|
87
|
-
import { join } from "path";
|
|
88
|
-
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
89
|
-
import { existsSync, writeFileSync, mkdirSync, readdirSync } from "fs";
|
|
90
|
-
import { execSync } from "child_process";
|
|
91
|
-
var HOME_DIR = homedir();
|
|
92
|
-
var COCKPIT_DIR = join(HOME_DIR, ".cockpit");
|
|
93
|
-
var COCKPIT_PROJECTS_DIR = join(COCKPIT_DIR, "projects");
|
|
94
|
-
var GLOBAL_STATE_FILE = join(COCKPIT_DIR, "state.json");
|
|
95
|
-
var PINNED_SESSIONS_FILE = join(COCKPIT_DIR, "pinned-sessions.json");
|
|
96
|
-
var NOTE_FILE = join(COCKPIT_DIR, "note.md");
|
|
97
|
-
var SCHEDULED_TASKS_FILE = join(COCKPIT_DIR, "scheduled-tasks.json");
|
|
98
|
-
var SETTINGS_FILE = join(COCKPIT_DIR, "settings.json");
|
|
99
|
-
var SKILLS_FILE = join(COCKPIT_DIR, "skills.json");
|
|
100
|
-
var REVIEW_DIR = join(COCKPIT_DIR, "review");
|
|
101
|
-
var REVIEW_SIGNAL_FILE = join(REVIEW_DIR, "_signal");
|
|
102
|
-
var CLAUDE_DIR = join(HOME_DIR, ".claude");
|
|
103
|
-
var CLAUDE_PROJECTS_DIR = join(CLAUDE_DIR, "projects");
|
|
104
|
-
var CLAUDE2_DIR = join(HOME_DIR, ".claude2");
|
|
105
|
-
var CLAUDE2_PROJECTS_DIR = join(CLAUDE2_DIR, "projects");
|
|
106
|
-
var DEEPSEEK_DIR = join(COCKPIT_DIR, "deepseek");
|
|
107
|
-
var DEEPSEEK_PROJECTS_DIR = join(DEEPSEEK_DIR, "projects");
|
|
108
|
-
function encodePath(path) {
|
|
109
|
-
return path.replace(/[/.]/g, "-");
|
|
110
|
-
}
|
|
111
|
-
function getCockpitProjectDir(cwd) {
|
|
112
|
-
return join(COCKPIT_PROJECTS_DIR, encodePath(cwd));
|
|
113
|
-
}
|
|
114
|
-
function getTerminalHistoryPath(cwd, tabId) {
|
|
115
|
-
return join(getCockpitProjectDir(cwd), `terminal-history-${tabId}.jsonl`);
|
|
116
|
-
}
|
|
117
|
-
function getTerminalOutputPath(cwd, commandId) {
|
|
118
|
-
return join(getCockpitProjectDir(cwd), `terminal-output-${commandId}.txt`);
|
|
119
|
-
}
|
|
120
|
-
function getClaudeProjectDir(cwd) {
|
|
121
|
-
return join(CLAUDE_PROJECTS_DIR, encodePath(cwd));
|
|
122
|
-
}
|
|
123
|
-
function getClaudeSessionPath(cwd, sessionId) {
|
|
124
|
-
return join(getClaudeProjectDir(cwd), `${sessionId}.jsonl`);
|
|
125
|
-
}
|
|
126
|
-
function getClaude2ProjectDir(cwd) {
|
|
127
|
-
return join(CLAUDE2_PROJECTS_DIR, encodePath(cwd));
|
|
128
|
-
}
|
|
129
|
-
function getClaude2SessionPath(cwd, sessionId) {
|
|
130
|
-
return join(getClaude2ProjectDir(cwd), `${sessionId}.jsonl`);
|
|
131
|
-
}
|
|
132
|
-
function getOllamaSessionsDir(cwd) {
|
|
133
|
-
return join(COCKPIT_DIR, "ollama-sessions", encodePath(cwd));
|
|
134
|
-
}
|
|
135
|
-
function getOllamaSessionPath(cwd, sessionId) {
|
|
136
|
-
return join(getOllamaSessionsDir(cwd), `${sessionId}.jsonl`);
|
|
137
|
-
}
|
|
138
|
-
function findCodexSessionPath(threadId) {
|
|
139
|
-
const codexSessionsDir = join(HOME_DIR, ".codex", "sessions");
|
|
140
|
-
if (!existsSync(codexSessionsDir)) return null;
|
|
141
|
-
try {
|
|
142
|
-
const result = execSync(
|
|
143
|
-
`find ${JSON.stringify(codexSessionsDir)} -name "*${threadId}.jsonl" -type f 2>/dev/null`,
|
|
144
|
-
{ encoding: "utf8", timeout: 3e3 }
|
|
145
|
-
).trim();
|
|
146
|
-
if (result) {
|
|
147
|
-
return result.split("\n")[0];
|
|
148
|
-
}
|
|
149
|
-
} catch {
|
|
150
|
-
}
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
function findKimiSessionPath(sessionId) {
|
|
154
|
-
const sessionsDir = join(HOME_DIR, ".kimi", "sessions");
|
|
155
|
-
if (!existsSync(sessionsDir)) return null;
|
|
156
|
-
try {
|
|
157
|
-
for (const hash of readdirSync(sessionsDir)) {
|
|
158
|
-
const candidate = join(sessionsDir, hash, sessionId, "context.jsonl");
|
|
159
|
-
if (existsSync(candidate)) return candidate;
|
|
160
|
-
}
|
|
161
|
-
} catch {
|
|
162
|
-
}
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
async function ensureDir(dirPath) {
|
|
166
|
-
if (!existsSync(dirPath)) {
|
|
167
|
-
await mkdir(dirPath, { recursive: true });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
async function ensureParentDir(filePath) {
|
|
171
|
-
const dir = join(filePath, "..");
|
|
172
|
-
await ensureDir(dir);
|
|
173
|
-
}
|
|
174
|
-
async function readJsonFile(filePath, defaultValue) {
|
|
175
|
-
try {
|
|
176
|
-
const content = await readFile(filePath, "utf-8");
|
|
177
|
-
return JSON.parse(content);
|
|
178
|
-
} catch {
|
|
179
|
-
return defaultValue;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
async function writeJsonFile(filePath, data) {
|
|
183
|
-
await ensureParentDir(filePath);
|
|
184
|
-
await writeFile(filePath, JSON.stringify(data, null, 2), "utf-8");
|
|
185
|
-
}
|
|
186
|
-
var g_fileLocks = globalThis;
|
|
187
|
-
var fileLocks = g_fileLocks.__cockpitFileLocks ?? (g_fileLocks.__cockpitFileLocks = /* @__PURE__ */ new Map());
|
|
188
|
-
function withFileLock(filePath, fn) {
|
|
189
|
-
const prev = fileLocks.get(filePath) ?? Promise.resolve();
|
|
190
|
-
const run = prev.then(fn);
|
|
191
|
-
const chain = run.then(() => {
|
|
192
|
-
}, () => {
|
|
193
|
-
});
|
|
194
|
-
fileLocks.set(filePath, chain);
|
|
195
|
-
chain.then(() => {
|
|
196
|
-
if (fileLocks.get(filePath) === chain) {
|
|
197
|
-
fileLocks.delete(filePath);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
return run;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export {
|
|
204
|
-
createNeo4jDriver,
|
|
205
|
-
runCypherWithDriver,
|
|
206
|
-
serializeValue,
|
|
207
|
-
GLOBAL_STATE_FILE,
|
|
208
|
-
SCHEDULED_TASKS_FILE,
|
|
209
|
-
REVIEW_DIR,
|
|
210
|
-
REVIEW_SIGNAL_FILE,
|
|
211
|
-
CLAUDE2_DIR,
|
|
212
|
-
getTerminalHistoryPath,
|
|
213
|
-
getTerminalOutputPath,
|
|
214
|
-
getClaudeSessionPath,
|
|
215
|
-
getClaude2SessionPath,
|
|
216
|
-
getOllamaSessionPath,
|
|
217
|
-
findCodexSessionPath,
|
|
218
|
-
findKimiSessionPath,
|
|
219
|
-
ensureParentDir,
|
|
220
|
-
readJsonFile,
|
|
221
|
-
writeJsonFile,
|
|
222
|
-
withFileLock
|
|
223
|
-
};
|
/package/.next-prod/static/{dtH6UmANw3cgn-jbRuVu4 → 7pu1LXbRRLfg05VN3u39s}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|