prjct-cli 2.1.1 → 2.1.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.
@@ -481,7 +481,7 @@ var at=Object.defineProperty;var Br=Object.getOwnPropertyDescriptor;var Hr=Objec
481
481
  );
482
482
 
483
483
  CREATE INDEX IF NOT EXISTS idx_wrc_rule ON workflow_rule_cache(rule_id);
484
- `)},"up")},{version:14,name:"workflow-rules-trust-source",up:c(n=>{try{n.run("ALTER TABLE workflow_rules ADD COLUMN trust_source TEXT NOT NULL DEFAULT 'local'")}catch{}},"up")}],xs=3,Ft=class{static{c(this,"PrjctDatabase")}connections=new Map;accessOrder=[];getDbPath(t){return ze.join(b.getGlobalProjectPath(t),"prjct.db")}getDb(t){let e=this.connections.get(t);if(e)return this.touchAccessOrder(t),e;this.connections.size>=xs&&this.evictLru();let r=this.getDbPath(t),s=ze.dirname(r);Mt.existsSync(s)||Mt.mkdirSync(s,{recursive:!0});let o=bs(r);return o.run("PRAGMA journal_mode = WAL"),o.run("PRAGMA synchronous = NORMAL"),o.run("PRAGMA cache_size = -2000"),o.run("PRAGMA temp_store = MEMORY"),o.run("PRAGMA mmap_size = 33554432"),this.runMigrations(o),this.connections.set(t,o),this.touchAccessOrder(t),o}close(t){if(t){let e=this.connections.get(t);e&&(e.close(),this.connections.delete(t),this.accessOrder=this.accessOrder.filter(r=>r!==t))}else this.connections.forEach(e=>{e.close()}),this.connections.clear(),this.accessOrder=[]}touchAccessOrder(t){this.accessOrder=this.accessOrder.filter(e=>e!==t),this.accessOrder.push(t)}evictLru(){if(this.accessOrder.length===0)return;let t=this.accessOrder.shift(),e=this.connections.get(t);e&&(e.close(),this.connections.delete(t))}checkpointAll(){for(let[t,e]of this.connections)try{e.run("PRAGMA wal_checkpoint(TRUNCATE)")}catch{}}exists(t){return Mt.existsSync(this.getDbPath(t))}getDoc(t,e){let s=this.getDb(t).prepare("SELECT data FROM kv_store WHERE key = ?").get(e);return s?JSON.parse(s.data):null}setDoc(t,e,r){let s=this.getDb(t),o=JSON.stringify(r),i=new Date().toISOString();s.prepare("INSERT OR REPLACE INTO kv_store (key, data, updated_at) VALUES (?, ?, ?)").run(e,o,i)}deleteDoc(t,e){this.getDb(t).prepare("DELETE FROM kv_store WHERE key = ?").run(e)}hasDoc(t,e){return this.getDb(t).prepare("SELECT 1 FROM kv_store WHERE key = ?").get(e)!==null}appendEvent(t,e,r,s){let o=this.getDb(t),i=new Date().toISOString();o.prepare("INSERT INTO events (type, task_id, data, timestamp) VALUES (?, ?, ?, ?)").run(e,s??null,JSON.stringify(r),i)}getEvents(t,e,r=100){let s=this.getDb(t);return e?s.prepare("SELECT * FROM events WHERE type = ? ORDER BY id DESC LIMIT ?").all(e,r):s.prepare("SELECT * FROM events ORDER BY id DESC LIMIT ?").all(r)}query(t,e,...r){return this.getDb(t).prepare(e).all(...r)}run(t,e,...r){this.getDb(t).prepare(e).run(...r)}get(t,e,...r){return this.getDb(t).prepare(e).get(...r)??null}transaction(t,e){let r=this.getDb(t);return r.transaction(e)(r)}runMigrations(t){t.run(`
484
+ `)},"up")},{version:14,name:"workflow-rules-trust-source",up:c(n=>{try{n.run("ALTER TABLE workflow_rules ADD COLUMN trust_source TEXT NOT NULL DEFAULT 'local'")}catch{}},"up")},{version:15,name:"disable-orphan-workflow-rules",up:c(n=>{let e=["pause","resume","reopen","next","dash","bug","idea","linear","jira","tokens","velocity","plan"].map(r=>`'${r}'`).join(",");n.run(`UPDATE workflow_rules SET enabled = 0 WHERE command IN (${e}) AND enabled = 1`)},"up")}],xs=3,Ft=class{static{c(this,"PrjctDatabase")}connections=new Map;accessOrder=[];getDbPath(t){return ze.join(b.getGlobalProjectPath(t),"prjct.db")}getDb(t){let e=this.connections.get(t);if(e)return this.touchAccessOrder(t),e;this.connections.size>=xs&&this.evictLru();let r=this.getDbPath(t),s=ze.dirname(r);Mt.existsSync(s)||Mt.mkdirSync(s,{recursive:!0});let o=bs(r);return o.run("PRAGMA journal_mode = WAL"),o.run("PRAGMA synchronous = NORMAL"),o.run("PRAGMA cache_size = -2000"),o.run("PRAGMA temp_store = MEMORY"),o.run("PRAGMA mmap_size = 33554432"),this.runMigrations(o),this.connections.set(t,o),this.touchAccessOrder(t),o}close(t){if(t){let e=this.connections.get(t);e&&(e.close(),this.connections.delete(t),this.accessOrder=this.accessOrder.filter(r=>r!==t))}else this.connections.forEach(e=>{e.close()}),this.connections.clear(),this.accessOrder=[]}touchAccessOrder(t){this.accessOrder=this.accessOrder.filter(e=>e!==t),this.accessOrder.push(t)}evictLru(){if(this.accessOrder.length===0)return;let t=this.accessOrder.shift(),e=this.connections.get(t);e&&(e.close(),this.connections.delete(t))}checkpointAll(){for(let[t,e]of this.connections)try{e.run("PRAGMA wal_checkpoint(TRUNCATE)")}catch{}}exists(t){return Mt.existsSync(this.getDbPath(t))}getDoc(t,e){let s=this.getDb(t).prepare("SELECT data FROM kv_store WHERE key = ?").get(e);return s?JSON.parse(s.data):null}setDoc(t,e,r){let s=this.getDb(t),o=JSON.stringify(r),i=new Date().toISOString();s.prepare("INSERT OR REPLACE INTO kv_store (key, data, updated_at) VALUES (?, ?, ?)").run(e,o,i)}deleteDoc(t,e){this.getDb(t).prepare("DELETE FROM kv_store WHERE key = ?").run(e)}hasDoc(t,e){return this.getDb(t).prepare("SELECT 1 FROM kv_store WHERE key = ?").get(e)!==null}appendEvent(t,e,r,s){let o=this.getDb(t),i=new Date().toISOString();o.prepare("INSERT INTO events (type, task_id, data, timestamp) VALUES (?, ?, ?, ?)").run(e,s??null,JSON.stringify(r),i)}getEvents(t,e,r=100){let s=this.getDb(t);return e?s.prepare("SELECT * FROM events WHERE type = ? ORDER BY id DESC LIMIT ?").all(e,r):s.prepare("SELECT * FROM events ORDER BY id DESC LIMIT ?").all(r)}query(t,e,...r){return this.getDb(t).prepare(e).all(...r)}run(t,e,...r){this.getDb(t).prepare(e).run(...r)}get(t,e,...r){return this.getDb(t).prepare(e).get(...r)??null}transaction(t,e){let r=this.getDb(t);return r.transaction(e)(r)}runMigrations(t){t.run(`
485
485
  CREATE TABLE IF NOT EXISTS _migrations (
486
486
  version INTEGER PRIMARY KEY,
487
487
  name TEXT NOT NULL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prjct-cli",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
5
5
  "main": "dist/bin/prjct.mjs",
6
6
  "bin": {