@ours.network/mcp 0.15.0 → 0.15.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.
@@ -0,0 +1,4 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ var d=25e3,u=`: ka
3
+
4
+ `;function a(e=process.env){let t=(e.OURS_SSE_KEEPALIVE_MS??"").trim();if(t==="")return 25e3;let n=Number(t);return Number.isFinite(n)&&n>=0?n:25e3}function p(e,t=a()){if(!(t>0))return;let n=!1,E=e.writeHead.bind(e);e.writeHead=(...r)=>{let o=typeof r[1]=="object"&&r[1]!==null?r[1]:r[2];if(o&&!Array.isArray(o))for(let[c,S]of Object.entries(o))c.toLowerCase()==="content-type"&&String(S).includes("text/event-stream")&&(n=!0);return E(...r)};let i=setInterval(()=>{if(!(!n||e.writableEnded||e.destroyed))try{e.write(u)}catch{}},t);i.unref?.();let s=()=>clearInterval(i);e.once("close",s),e.once("finish",s)}export{d as DEFAULT_SSE_KEEPALIVE_MS,u as KEEPALIVE_FRAME,p as armSseKeepalive,a as sseKeepaliveMs};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
+ import*as a from"node:fs";import{join as v}from"node:path";var A="startup-progress.json",b=1,y={initializing:"Initializing daemon",wrapper:"Starting protocol runtime",registrar:"Starting local contact book",identities:"Restoring identities",reconciliation:"Reconciling restored identities",server:"Opening local API",ready:"Daemon ready",failed:"Daemon startup failed"};function h(e){return v(e,A)}function R(e){return typeof e=="string"&&Object.hasOwn(y,e)}function x(e){try{let t=JSON.parse(a.readFileSync(h(e),"utf8"));return t.version!==b||!Number.isInteger(t.pid)||(t.pid??0)<=0||typeof t.bootId!="string"||!t.bootId||!R(t.phase)||!Number.isFinite(t.startedAt)||!Number.isFinite(t.updatedAt)||(t.completed!==void 0||t.total!==void 0)&&(!Number.isInteger(t.completed)||!Number.isInteger(t.total)||(t.completed??-1)<0||(t.total??-1)<0||(t.completed??0)>(t.total??0))?null:t}catch{return null}}function I(e,t={}){let s=t.pid??process.pid,n=t.now??Date.now,o=n(),p=h(e),d=`${p}.${s}.tmp`,u=Math.max(100,t.heartbeatMs??2e3),r=!1,i=!1,l={version:b,pid:s,bootId:`${s}-${o}`,phase:"initializing",startedAt:o,updatedAt:o},c=()=>{if(!i)try{a.mkdirSync(e,{recursive:!0,mode:448}),a.writeFileSync(d,`${JSON.stringify(l)}
3
+ `,{mode:384}),a.renameSync(d,p);try{a.chmodSync(p,384)}catch{}}catch{i=!0;try{a.rmSync(d,{force:!0})}catch{}}},m=(f,S)=>{l={version:b,pid:s,bootId:l.bootId,phase:f,...S?{completed:S.completed,total:S.total}:{},startedAt:o,updatedAt:n()},c()};c();let g=setInterval(()=>{r||(l={...l,updatedAt:n()},c())},u);g.unref?.();let P=f=>{r||(m(f),r=!0,clearInterval(g))};return{update:m,ready:()=>P("ready"),failed:()=>P("failed")}}function w(e){let t=y[e.phase];return e.phase==="identities"&&e.completed!==void 0&&e.total!==void 0?`${t} ${e.completed}/${e.total}`:t}function $(e,t){let s=`startup: ${w(e)}`;return t?`\r${s}\x1B[K`:`${s}
4
+ `}async function O(e){let t=e.now??Date.now,s=e.sleep??(r=>new Promise(i=>setTimeout(i,r))),n=t(),o=n,p=-1,d="",u=null;for(;;){if(await e.isReady())return{ok:!0,elapsedMs:t()-n,lastProgress:u};let r=e.readProgress();if(r?.pid===e.pid){u=r,r.updatedAt>p&&(p=r.updatedAt,o=t());let m=`${r.phase}:${r.completed??""}:${r.total??""}`;if(m!==d&&(d=m,e.onProgress?.(r)),r.phase==="failed")return{ok:!1,reason:"daemon-reported-failure",elapsedMs:t()-n,lastProgress:u}}if(!e.isProcessAlive())return{ok:!1,reason:"process-exited",elapsedMs:t()-n,lastProgress:u};let i=t()-n;if(i>=e.absoluteMs)return{ok:!1,reason:"absolute-timeout",elapsedMs:i,lastProgress:u};if(t()-o>=e.inactivityMs)return{ok:!1,reason:"inactivity-timeout",elapsedMs:i,lastProgress:u};let l=e.absoluteMs-i,c=e.inactivityMs-(t()-o);await s(Math.max(1,Math.min(e.pollMs,l,c)))}}export{A as STARTUP_PROGRESS_FILENAME,b as STARTUP_PROGRESS_VERSION,I as createStartupProgressReporter,w as formatStartupProgress,x as readStartupProgress,$ as renderStartupProgress,h as startupProgressPath,O as waitForStartup};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/mcp",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "MCP server daemon for ours — one native ADAPT wrapper hosting N self-sovereign identities, exposing secure agent-to-agent messaging tools over HTTP (Streamable HTTP). Run `ours-mcp start`.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",
@@ -48,7 +48,7 @@
48
48
  "serve": "node dist/cli.js serve",
49
49
  "prepublishOnly": "node build.mjs",
50
50
  "typecheck": "tsc -p tsconfig.json --noEmit",
51
- "test": "bash ../../scripts/test-receipts-mufl.sh && bash ../../scripts/test-notifications-mufl.sh && node test/loopback-bind.test.mjs && node test/lease-binding.test.mjs && node test/session-restore.test.mjs && node test/daemon-restart-resume.test.mjs && node test/version-advisory.test.mjs && node test/files-helpers.test.mjs && node test/inbox-encryption.test.mjs && node test/validate-name.test.mjs && node test/port-visibility.test.mjs && node test/notify-http-api.test.mjs && node test/unread-http-api.test.mjs && node test/create-root-cli.test.mjs && node test/session-reaper.test.mjs && node test/mig1867-verify.test.mjs && node test/single-root-policy.test.mjs && node test/pre137-blob-import-regression.test.mjs && node test/transcribe-detect.test.mjs && node test/transcribe-stt.test.mjs && node test/voice-status-cli.test.mjs && node test/process-state.test.mjs && node test/voice-setup-config.test.mjs && node test/voice-setup-cli.test.mjs"
51
+ "test": "bash ../../scripts/test-receipts-mufl.sh && bash ../../scripts/test-notifications-mufl.sh && node test/loopback-bind.test.mjs && node test/lease-binding.test.mjs && node test/proxy-request-failback.test.mjs && node test/session-restore.test.mjs && node test/daemon-restart-resume.test.mjs && node test/sse-keepalive.test.mjs && node test/version-advisory.test.mjs && node test/files-helpers.test.mjs && node test/inbox-encryption.test.mjs && node test/validate-name.test.mjs && node test/port-visibility.test.mjs && node test/notify-http-api.test.mjs && node test/unread-http-api.test.mjs && node test/create-root-cli.test.mjs && node test/session-reaper.test.mjs && node test/mig1867-verify.test.mjs && node test/single-root-policy.test.mjs && node test/pre137-blob-import-regression.test.mjs && node test/transcribe-detect.test.mjs && node test/transcribe-stt.test.mjs && node test/voice-status-cli.test.mjs && node test/process-state.test.mjs && node test/voice-setup-config.test.mjs && node test/voice-setup-cli.test.mjs && node test/startup-progress.test.mjs && node test/startup-cli.test.mjs"
52
52
  },
53
53
  "dependencies": {
54
54
  "@adapt-toolkit/sdk": "0.10.12",