@hasna/todos 0.9.0 → 0.9.2

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/cli/index.js CHANGED
@@ -2138,13 +2138,22 @@ function runMigrations(db) {
2138
2138
  const result = db.query("SELECT MAX(id) as max_id FROM _migrations").get();
2139
2139
  const currentLevel = result?.max_id ?? 0;
2140
2140
  for (let i = currentLevel;i < MIGRATIONS.length; i++) {
2141
- db.run(MIGRATIONS[i]);
2141
+ db.exec(MIGRATIONS[i]);
2142
2142
  }
2143
2143
  } catch {
2144
2144
  for (const migration of MIGRATIONS) {
2145
2145
  db.exec(migration);
2146
2146
  }
2147
2147
  }
2148
+ ensureTableMigrations(db);
2149
+ }
2150
+ function ensureTableMigrations(db) {
2151
+ try {
2152
+ const hasAgents = db.query("SELECT name FROM sqlite_master WHERE type='table' AND name='agents'").get();
2153
+ if (!hasAgents) {
2154
+ db.exec(MIGRATIONS[4]);
2155
+ }
2156
+ } catch {}
2148
2157
  }
2149
2158
  function backfillTaskTags(db) {
2150
2159
  try {
package/dist/index.js CHANGED
@@ -215,13 +215,22 @@ function runMigrations(db) {
215
215
  const result = db.query("SELECT MAX(id) as max_id FROM _migrations").get();
216
216
  const currentLevel = result?.max_id ?? 0;
217
217
  for (let i = currentLevel;i < MIGRATIONS.length; i++) {
218
- db.run(MIGRATIONS[i]);
218
+ db.exec(MIGRATIONS[i]);
219
219
  }
220
220
  } catch {
221
221
  for (const migration of MIGRATIONS) {
222
222
  db.exec(migration);
223
223
  }
224
224
  }
225
+ ensureTableMigrations(db);
226
+ }
227
+ function ensureTableMigrations(db) {
228
+ try {
229
+ const hasAgents = db.query("SELECT name FROM sqlite_master WHERE type='table' AND name='agents'").get();
230
+ if (!hasAgents) {
231
+ db.exec(MIGRATIONS[4]);
232
+ }
233
+ } catch {}
225
234
  }
226
235
  function backfillTaskTags(db) {
227
236
  try {
package/dist/mcp/index.js CHANGED
@@ -4265,13 +4265,22 @@ function runMigrations(db) {
4265
4265
  const result = db.query("SELECT MAX(id) as max_id FROM _migrations").get();
4266
4266
  const currentLevel = result?.max_id ?? 0;
4267
4267
  for (let i = currentLevel;i < MIGRATIONS.length; i++) {
4268
- db.run(MIGRATIONS[i]);
4268
+ db.exec(MIGRATIONS[i]);
4269
4269
  }
4270
4270
  } catch {
4271
4271
  for (const migration of MIGRATIONS) {
4272
4272
  db.exec(migration);
4273
4273
  }
4274
4274
  }
4275
+ ensureTableMigrations(db);
4276
+ }
4277
+ function ensureTableMigrations(db) {
4278
+ try {
4279
+ const hasAgents = db.query("SELECT name FROM sqlite_master WHERE type='table' AND name='agents'").get();
4280
+ if (!hasAgents) {
4281
+ db.exec(MIGRATIONS[4]);
4282
+ }
4283
+ } catch {}
4275
4284
  }
4276
4285
  function backfillTaskTags(db) {
4277
4286
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",