wyrm-mcp 8.5.7 → 8.5.8

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.
@@ -1,2 +1,4 @@
1
- import n from"better-sqlite3";import{NodeSqliteFacade as i}from"./node-sqlite-facade.js";let t=!1;function a(){try{return require("node:sqlite"),!0}catch{return!1}}function o(){if(process.env.WYRM_STORAGE==="node"){if(a())return"node";t||(t=!0,process.stderr.write(`wyrm: WYRM_STORAGE=node requested but node:sqlite is unavailable in this Node runtime; falling back to better-sqlite3
2
- `))}return"better-sqlite3"}function s(e,r={}){return o()==="node"?new i(e,r):new n(e,r)}export{s as openDatabase,o as resolveBackend};
1
+ import o from"better-sqlite3";import{createRequire as l}from"node:module";import{NodeSqliteFacade as n}from"./node-sqlite-facade.js";const d=l(import.meta.url);let i=!1;function s(){try{return d("node:sqlite"),!0}catch{return!1}}function u(){if(process.env.WYRM_STORAGE==="node"){if(s())return"node";i||(i=!0,process.stderr.write(`wyrm: WYRM_STORAGE=node requested but node:sqlite is unavailable in this Node runtime; falling back to better-sqlite3
2
+ `))}return"better-sqlite3"}function c(e){const t=e instanceof Error?e.message:String(e);return/bindings file|better_sqlite3\.node|did not self-register|NODE_MODULE_VERSION|different Node\.js version|ERR_DLOPEN|invalid ELF header|Cannot find module/i.test(t)}function q(e,t={}){if(u()==="node")return new n(e,t);try{return new o(e,t)}catch(r){if(c(r)&&s()){if(!i){i=!0;const a=r instanceof Error?r.message.split(`
3
+ `)[0]:String(r);process.stderr.write(`wyrm: better-sqlite3 native binding unavailable (${a}); falling back to built-in node:sqlite (experimental). Rebuild the native driver with: npm install -g wyrm-mcp --allow-scripts=wyrm-mcp,better-sqlite3
4
+ `)}return new n(e,t)}throw r}}export{q as openDatabase,u as resolveBackend};
@@ -1 +1 @@
1
- import*as h from"fs";const u={1:"SQLITE_ERROR",5:"SQLITE_BUSY",6:"SQLITE_LOCKED",8:"SQLITE_READONLY",10:"SQLITE_IOERR",11:"SQLITE_CORRUPT",13:"SQLITE_FULL",14:"SQLITE_CANTOPEN",19:"SQLITE_CONSTRAINT",21:"SQLITE_MISUSE"};function c(r){if(r&&typeof r=="object"){const t=r;if(typeof t.errcode=="number"){const e=u[t.errcode&255];e&&(t.code=e)}}throw r}function d(r){return typeof r=="bigint"&&r<=BigInt(Number.MAX_SAFE_INTEGER)?Number(r):r}class I{stmt;constructor(t){this.stmt=t}get(...t){try{return this.stmt.get(...t)}catch(e){c(e)}}all(...t){try{return this.stmt.all(...t)}catch(e){c(e)}}run(...t){try{const e=this.stmt.run(...t);return{changes:Number(e.changes),lastInsertRowid:d(e.lastInsertRowid)}}catch(e){c(e)}}*iterate(...t){try{yield*this.stmt.iterate(...t)}catch(e){c(e)}}safeIntegers(t=!0){return this.stmt.setReadBigInts(t),this}}class m{db;txDepth=0;name;open=!0;constructor(t,e={}){if(e.fileMustExist&&t!==":memory:"&&!h.existsSync(t)){const n=new Error(`unable to open database file: ${t}`);throw n.code="SQLITE_CANTOPEN",n}const{DatabaseSync:s}=require("node:sqlite");this.db=e.readonly?new s(t,{readOnly:!0}):new s(t),this.name=t}prepare(t){try{return new I(this.db.prepare(t))}catch(e){c(e)}}exec(t){try{return this.db.exec(t),this}catch(e){c(e)}}pragma(t,e){try{const s=this.db.prepare(`PRAGMA ${t}`).all();if(e?.simple){const n=s[0];return n===void 0?void 0:n[Object.keys(n)[0]]}return s}catch(s){c(s)}}transaction(t){const e=n=>(...E)=>{const a=this.txDepth>0,i=`wyrm_sp_${this.txDepth}`;this.exec(a?`SAVEPOINT ${i}`:n),this.txDepth++;try{const o=t(...E);return this.txDepth--,this.exec(a?`RELEASE ${i}`:"COMMIT"),o}catch(o){this.txDepth--;try{this.exec(a?`ROLLBACK TO ${i}; RELEASE ${i}`:"ROLLBACK")}catch{}throw o}};return Object.assign(e("BEGIN"),{immediate:e("BEGIN IMMEDIATE"),deferred:e("BEGIN DEFERRED"),exclusive:e("BEGIN EXCLUSIVE")})}close(){this.db.close(),this.open=!1}}export{m as NodeSqliteFacade};
1
+ import*as h from"fs";import{createRequire as u}from"node:module";const d=u(import.meta.url),I={1:"SQLITE_ERROR",5:"SQLITE_BUSY",6:"SQLITE_LOCKED",8:"SQLITE_READONLY",10:"SQLITE_IOERR",11:"SQLITE_CORRUPT",13:"SQLITE_FULL",14:"SQLITE_CANTOPEN",19:"SQLITE_CONSTRAINT",21:"SQLITE_MISUSE"};function c(r){if(r&&typeof r=="object"){const t=r;if(typeof t.errcode=="number"){const e=I[t.errcode&255];e&&(t.code=e)}}throw r}function m(r){return typeof r=="bigint"&&r<=BigInt(Number.MAX_SAFE_INTEGER)?Number(r):r}class l{stmt;constructor(t){this.stmt=t}get(...t){try{return this.stmt.get(...t)}catch(e){c(e)}}all(...t){try{return this.stmt.all(...t)}catch(e){c(e)}}run(...t){try{const e=this.stmt.run(...t);return{changes:Number(e.changes),lastInsertRowid:m(e.lastInsertRowid)}}catch(e){c(e)}}*iterate(...t){try{yield*this.stmt.iterate(...t)}catch(e){c(e)}}safeIntegers(t=!0){return this.stmt.setReadBigInts(t),this}}class S{db;txDepth=0;name;open=!0;constructor(t,e={}){if(e.fileMustExist&&t!==":memory:"&&!h.existsSync(t)){const n=new Error(`unable to open database file: ${t}`);throw n.code="SQLITE_CANTOPEN",n}const{DatabaseSync:s}=d("node:sqlite");this.db=e.readonly?new s(t,{readOnly:!0}):new s(t),this.name=t}prepare(t){try{return new l(this.db.prepare(t))}catch(e){c(e)}}exec(t){try{return this.db.exec(t),this}catch(e){c(e)}}pragma(t,e){try{const s=this.db.prepare(`PRAGMA ${t}`).all();if(e?.simple){const n=s[0];return n===void 0?void 0:n[Object.keys(n)[0]]}return s}catch(s){c(s)}}transaction(t){const e=n=>(...E)=>{const o=this.txDepth>0,i=`wyrm_sp_${this.txDepth}`;this.exec(o?`SAVEPOINT ${i}`:n),this.txDepth++;try{const a=t(...E);return this.txDepth--,this.exec(o?`RELEASE ${i}`:"COMMIT"),a}catch(a){this.txDepth--;try{this.exec(o?`ROLLBACK TO ${i}; RELEASE ${i}`:"ROLLBACK")}catch{}throw a}};return Object.assign(e("BEGIN"),{immediate:e("BEGIN IMMEDIATE"),deferred:e("BEGIN DEFERRED"),exclusive:e("BEGIN EXCLUSIVE")})}close(){this.db.close(),this.open=!1}}export{S as NodeSqliteFacade};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "contract": "wyrm-cloud-memory-v2",
3
- "version": "8.5.7",
3
+ "version": "8.5.8",
4
4
  "derivedFrom": "standard tier MINUS device-local/egress/subprocess (src/cloud-profile.ts)",
5
5
  "count": 19,
6
6
  "tools": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "contract": "wyrm-cloud-memory-v1",
3
- "version": "8.5.7",
3
+ "version": "8.5.8",
4
4
  "tools": [
5
5
  {
6
6
  "name": "wyrm_recall",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "contract": "wyrm-cloud-memory-v1",
3
- "version": "8.5.7",
3
+ "version": "8.5.8",
4
4
  "generatedBy": "scripts/gen-tool-manifest.mjs (from the dist/ registry modules — never hand-edited)",
5
5
  "tiers": {
6
6
  "core": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wyrm-mcp",
3
- "version": "8.5.7",
3
+ "version": "8.5.8",
4
4
  "mcpName": "lk.ghosts/wyrm",
5
5
  "description": "Local-first persistent memory for AI agents over MCP. Ground truths, negative learning (recorded failures block repeats), decision causality, hybrid recall, live memory streams, run-attributed fleet memory — a structured SQLite memory on your machine, no cloud or LLM required. Claude / Copilot / Cursor / Windsurf / Codex.",
6
6
  "type": "module",