cueme 0.1.11 → 0.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cueme",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Cue command protocol adapter (stdin/stdout JSON)",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
package/src/cli.js CHANGED
@@ -103,6 +103,7 @@ async function main() {
103
103
  ' cueme proto ls',
104
104
  ' cueme proto path <agent>',
105
105
  ' cueme fix <issue>',
106
+ ' cueme migrate',
106
107
  ' cueme join <agent_runtime>',
107
108
  ' cueme cue <agent_id> -',
108
109
  ' cueme pause <agent_id> [prompt|-]',
package/src/db.js CHANGED
@@ -112,7 +112,7 @@ async function initSchema(db) {
112
112
  const reqCount = reqCountRow ? Number(reqCountRow.n) : 0;
113
113
  const respCount = respCountRow ? Number(respCountRow.n) : 0;
114
114
  if (reqCount === 0 && respCount === 0) {
115
- await run(db, 'INSERT INTO schema_meta (key, value) VALUES (?, ?)', ['schema_version', '2']);
115
+ await run(db, 'INSERT INTO schema_meta (key, value) VALUES (?, ?)', ['schema_version', '3']);
116
116
  }
117
117
  }
118
118
  }
package/src/handler.js CHANGED
@@ -336,13 +336,41 @@ async function handlePause(db, { agent_id, prompt }) {
336
336
  });
337
337
  }
338
338
 
339
+ async function handleMigrate(db) {
340
+ await initSchema(db);
341
+
342
+ await run(
343
+ db,
344
+ [
345
+ 'CREATE TABLE IF NOT EXISTS conversation_pins (',
346
+ ' conv_type TEXT NOT NULL,',
347
+ ' conv_id TEXT NOT NULL,',
348
+ ' view TEXT NOT NULL,',
349
+ ' pin_order INTEGER PRIMARY KEY AUTOINCREMENT,',
350
+ ' pinned_at DATETIME DEFAULT CURRENT_TIMESTAMP,',
351
+ ' UNIQUE(conv_type, conv_id, view)',
352
+ ')',
353
+ ].join('\n')
354
+ );
355
+
356
+ await run(db, 'UPDATE schema_meta SET value = ? WHERE key = ?', ['3', 'schema_version']);
357
+ await run(db, 'INSERT OR IGNORE INTO schema_meta (key, value) VALUES (?, ?)', [
358
+ 'schema_version',
359
+ '3',
360
+ ]);
361
+
362
+ return { ok: true, data: { message: 'migrated schema_version to 3' } };
363
+ }
364
+
339
365
  async function handleCommand({ subcommand, args }) {
340
366
  const { db, dbPath } = openDb();
341
367
  try {
342
- await initSchema(db);
343
-
344
368
  if (subcommand === 'join') return await handleJoin(db, args.agent_runtime);
345
369
 
370
+ if (subcommand === 'migrate') return await handleMigrate(db);
371
+
372
+ await initSchema(db);
373
+
346
374
  if (subcommand === 'cue') {
347
375
  const agent_id = (args.agent_id ?? '').toString();
348
376
  const prompt = (args.prompt ?? '').toString();