ccjk 14.0.0 → 14.1.0

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.
Files changed (35) hide show
  1. package/dist/chunks/agents.mjs +1 -1
  2. package/dist/chunks/ccr.mjs +13 -14
  3. package/dist/chunks/check-updates.mjs +1 -3
  4. package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
  5. package/dist/chunks/code-type-resolver.mjs +878 -0
  6. package/dist/chunks/config.mjs +42 -2
  7. package/dist/chunks/config2.mjs +2 -2
  8. package/dist/chunks/doctor.mjs +1 -1
  9. package/dist/chunks/index10.mjs +55 -11
  10. package/dist/chunks/init.mjs +42 -14
  11. package/dist/chunks/installer.mjs +2 -2
  12. package/dist/chunks/mcp.mjs +1 -1
  13. package/dist/chunks/package.mjs +1 -1
  14. package/dist/chunks/quick-setup.mjs +1 -3
  15. package/dist/chunks/research.mjs +733 -6
  16. package/dist/chunks/sessions.mjs +1 -1
  17. package/dist/chunks/skills-sync.mjs +5 -5126
  18. package/dist/chunks/slash-commands.mjs +1 -1
  19. package/dist/chunks/status.mjs +63 -16
  20. package/dist/chunks/uninstall.mjs +1 -3
  21. package/dist/cli.mjs +101 -20
  22. package/dist/i18n/locales/en/configuration.json +6 -2
  23. package/dist/i18n/locales/zh-CN/configuration.json +6 -2
  24. package/dist/index.d.mts +64 -17
  25. package/dist/index.d.ts +64 -17
  26. package/dist/index.mjs +11 -720
  27. package/dist/shared/ccjk.BO45TPXJ.mjs +807 -0
  28. package/dist/shared/{ccjk.BOO14f66.mjs → ccjk.CNhnT6uQ.mjs} +42 -6
  29. package/dist/shared/{ccjk.vO3d1ABk.mjs → ccjk.UhjQ1seV.mjs} +1 -1
  30. package/dist/shared/ccjk.y-a_1vK4.mjs +5127 -0
  31. package/package.json +1 -1
  32. package/dist/chunks/intent-engine.mjs +0 -142
  33. package/dist/chunks/smart-defaults.mjs +0 -425
  34. package/dist/shared/ccjk.DJuyfrlL.mjs +0 -348
  35. package/dist/shared/ccjk.yYQMbHH3.mjs +0 -115
@@ -5,6 +5,26 @@ import { j as join, d as dirname } from './ccjk.bQ7Dh1g4.mjs';
5
5
  class TaskPersistence {
6
6
  db;
7
7
  dbPath;
8
+ getSessionStmt;
9
+ parseSessionMetadata(value) {
10
+ if (typeof value !== "string" || value.length === 0) {
11
+ return {};
12
+ }
13
+ try {
14
+ const parsed = JSON.parse(value);
15
+ return parsed && typeof parsed === "object" ? parsed : {};
16
+ } catch {
17
+ return {};
18
+ }
19
+ }
20
+ rowToSession(row) {
21
+ return {
22
+ id: row.id,
23
+ createdAt: row.created_at,
24
+ updatedAt: row.updated_at,
25
+ metadata: this.parseSessionMetadata(row.metadata)
26
+ };
27
+ }
8
28
  constructor(dbPath) {
9
29
  this.dbPath = dbPath || join(
10
30
  process.env.HOME || process.env.USERPROFILE || ".",
@@ -206,7 +226,7 @@ class TaskPersistence {
206
226
  SELECT * FROM sessions WHERE id = ?
207
227
  `);
208
228
  const sessionRow = sessionStmt.get(sessionId);
209
- const metadata = sessionRow ? JSON.parse(sessionRow.metadata) : {};
229
+ const metadata = sessionRow ? this.parseSessionMetadata(sessionRow.metadata) : {};
210
230
  return {
211
231
  sessionId,
212
232
  tasks,
@@ -224,6 +244,19 @@ class TaskPersistence {
224
244
  const now = Date.now();
225
245
  stmt.run(sessionId, now, now, JSON.stringify(metadata));
226
246
  }
247
+ /**
248
+ * Get session by ID
249
+ */
250
+ getSession(sessionId) {
251
+ this.getSessionStmt ||= this.db.prepare(`
252
+ SELECT * FROM sessions WHERE id = ?
253
+ `);
254
+ const row = this.getSessionStmt.get(sessionId);
255
+ if (!row) {
256
+ return void 0;
257
+ }
258
+ return this.rowToSession(row);
259
+ }
227
260
  /**
228
261
  * List recent sessions
229
262
  */
@@ -232,11 +265,14 @@ class TaskPersistence {
232
265
  SELECT * FROM sessions ORDER BY created_at DESC LIMIT ?
233
266
  `);
234
267
  const rows = stmt.all(limit);
235
- return rows.map((row) => ({
236
- id: row.id,
237
- createdAt: row.created_at,
238
- metadata: JSON.parse(row.metadata)
239
- }));
268
+ return rows.map((row) => {
269
+ const session = this.rowToSession(row);
270
+ return {
271
+ id: session.id,
272
+ createdAt: session.createdAt,
273
+ metadata: session.metadata
274
+ };
275
+ });
240
276
  }
241
277
  /**
242
278
  * Clean up old sessions
@@ -296,4 +296,4 @@ function formatErrorForLogging(error) {
296
296
  };
297
297
  }
298
298
 
299
- export { CloudError as C, CloudErrorCode as a, CloudErrorFactory as b, isRateLimitError as c, isRetryableError as d, isRetryableErrorCode as e, formatErrorForLogging as f, getRetryDelay as g, handleCloudError as h, isAuthError as i };
299
+ export { CloudErrorFactory as C, CloudError as a, CloudErrorCode as b, isRateLimitError as c, isRetryableError as d, isRetryableErrorCode as e, formatErrorForLogging as f, getRetryDelay as g, handleCloudError as h, isAuthError as i };