@ours.network/mcp 0.17.0-nightly.8 → 0.17.0
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/README.md +0 -41
- package/dist/cli.js +84 -85
- package/dist/index.js +80 -64
- package/dist/mufl_code/8ED6356B41CC689C75DA3302AD7856058131661A6ABBAC961E71BA838D8C97A3.muflo +0 -0
- package/package.json +5 -4
- package/dist/association.js +0 -2
- package/dist/push.js +0 -2
- package/dist/service-instance.js +0 -47
package/dist/mufl_code/8ED6356B41CC689C75DA3302AD7856058131661A6ABBAC961E71BA838D8C97A3.muflo
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ours.network/mcp",
|
|
3
|
-
"version": "0.17.0
|
|
4
|
-
"description": "MCP server daemon for ours
|
|
3
|
+
"version": "0.17.0",
|
|
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",
|
|
7
7
|
"author": "Adapt Toolkit",
|
|
@@ -48,10 +48,11 @@
|
|
|
48
48
|
"serve": "node dist/cli.js serve",
|
|
49
49
|
"prepublishOnly": "node build.mjs",
|
|
50
50
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
51
|
-
"test": "
|
|
51
|
+
"test": "bash ../../scripts/test-receipts-mufl.sh && bash ../../scripts/test-notifications-mufl.sh && bash ../../scripts/test-contact-uniqueness-mufl.sh && bash ../../scripts/test-temp-remove-me-mufl.sh && node test/contact-lines.test.mjs && node test/loopback-bind.test.mjs && node test/lease-binding.test.mjs && node test/proxy-request-failback.test.mjs && node test/proxy-exit-on-stdin-eof.test.mjs && node test/proxy-dead-stderr.test.mjs && node test/session-restore.test.mjs && node test/env-bind-identity.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/file-save-stream.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 && node test/contact-uniqueness-daemon.test.mjs && node test/contact-uniqueness-import.test.mjs && node test/contact-uniqueness-book.test.mjs && node test/invite-modes.test.mjs && node test/temp-identities.test.mjs"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@
|
|
54
|
+
"@adapt-toolkit/sdk": "0.10.12",
|
|
55
|
+
"@adapt-toolkit/sdk-native": "0.10.12"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
package/dist/association.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import*as A from"node:fs";import{homedir as L}from"node:os";import{isAbsolute as U,join as M,normalize as V,resolve as H}from"node:path";import{homedir as R}from"node:os";import{join as C,resolve as D}from"node:path";var F=3050;function k(t=R()){return D(C(t,".ours"))}function J(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function j(t){return typeof t=="string"?t:void 0}function b(t,e=R()){return{port:J(t.port)??F,stateDir:D(j(t.stateDir)??k(e))}}var E=1,x=["claude-code","codex","hermes"],n=class extends Error{code;constructor(e,o="INVALID_ASSOCIATION"){super(`ours profile association: ${e}. Re-run the Nightly installer to repair this association`),this.name="AssociationError",this.code=o}};function $(t,e,o){for(let r of Object.keys(t))if(!e.includes(r))throw new n(`${o} contains unsupported field ${JSON.stringify(r)}`)}function Q(t){let e=[],o;for(let r=0;r<t.length;r+=1){let c=t[r],i;if(c==="--application"){if(t[r+1]===void 0)throw new n("--application requires a value","INVALID_APPLICATION");i=t[++r]}else if(c.startsWith("--application="))i=c.slice(14);else{e.push(c);continue}if(!x.includes(i))throw new n(`unknown application ${JSON.stringify(i)}`,"INVALID_APPLICATION");if(o&&o!==i)throw new n("only one --application value may be supplied","INVALID_APPLICATION");o=i}return{application:o,argv:e}}function X(t,e){if(t&&e!=="proxy"&&e!=="watch")throw new n(`--application is legal only for client commands proxy and watch, not ${e}`,"APPLICATION_NOT_ALLOWED")}function z(t=process.env,e=L()){return t.OURS_INSTALL_PROFILES?P(t.OURS_INSTALL_PROFILES,"OURS_INSTALL_PROFILES"):M(e,".ours","installer-profiles.json")}function P(t,e){if(typeof t!="string"||!t||t.includes("\0")||!U(t)||V(t)!==t||t==="/")throw new n(`${e} must be a normalized absolute path`,"UNSAFE_PATH");return t}function T(t,e){let o=/^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,30}[A-Za-z0-9])?$/;if(!o.test(e))throw new n(`invalid profile id ${JSON.stringify(e)}`);if(!t||typeof t!="object"||Array.isArray(t))throw new n(`profile ${JSON.stringify(e)} is not an object`);let r=t;$(r,["label","host","port","configPath","stateDir","serviceName","ownership"],`profile ${e}`);let c=typeof r.label=="string"?r.label.trim():"";if(!c)throw new n(`profile ${JSON.stringify(e)} has no label`);let i=String(r.host??"").toLowerCase();if(i!=="127.0.0.1"&&i!=="localhost")throw new n(`profile ${JSON.stringify(e)} uses non-loopback host ${JSON.stringify(r.host)}`,"UNSAFE_HOST");let s=Number(r.port);if(!Number.isInteger(s)||s<1||s>65535)throw new n(`profile ${JSON.stringify(e)} has invalid port`,"INVALID_PORT");let p=r.ownership;if(!p||typeof p!="object"||Array.isArray(p))throw new n(`profile ${JSON.stringify(e)} has no explicit ownership`);let f=p;if($(f,["config","service","state"],`profile ${e} ownership`),typeof f.config!="boolean"||typeof f.service!="boolean"||typeof f.state!="boolean")throw new n(`profile ${JSON.stringify(e)} has invalid ownership`);let l=typeof r.serviceName=="string"?r.serviceName.trim():"";if(e!=="default"&&!l||l&&!o.test(l))throw new n(`profile ${JSON.stringify(e)} has invalid serviceName`);return{label:c,host:"127.0.0.1",port:s,configPath:P(r.configPath,`profile ${e} configPath`),stateDir:P(r.stateDir,`profile ${e} stateDir`),serviceName:l,ownership:{config:f.config,service:f.service,state:f.state}}}function _(t,e){let o;try{o=A.readFileSync(t,"utf8")}catch(r){throw new n(`cannot read ${e} ${t}: ${r.message}`,"READ_FAILED")}try{let r=JSON.parse(o);if(!r||typeof r!="object"||Array.isArray(r))throw new Error("expected an object");return r}catch(r){throw new n(`${e} ${t} is corrupt JSON: ${r.message}`,"CORRUPT_JSON")}}function w(t){try{return A.realpathSync(t)}catch{return H(t)}}function Y(t,e=process.env,o=L()){if(!t||e.OURS_CONFIG||e.OURS_PORT||e.OURS_STATE_DIR)return null;let r=z(e,o);if(!A.existsSync(r))return null;let c=_(r,"installer profile registry");if($(c,["version","profiles","harnessAssociations"],"registry"),c.version!==E)throw new n(`registry version is ${JSON.stringify(c.version)}, expected ${E}`,"UNSUPPORTED_VERSION");let i=c.profiles,s=c.harnessAssociations;if(!i||typeof i!="object"||Array.isArray(i)||!s||typeof s!="object"||Array.isArray(s))throw new n("registry schema is invalid");let p=i,f=s,l=Object.fromEntries(Object.entries(p).map(([g,d])=>[g,T(d,g)])),h=Object.entries(l);for(let g=0;g<h.length;g+=1){let[d,N]=h[g];for(let[v,O]of h.slice(g+1)){let I=N.port===O.port?"endpoint":w(N.stateDir)===w(O.stateDir)?"stateDir":N.configPath===O.configPath?"configPath":N.serviceName===O.serviceName?"serviceName":"";if(I)throw new n(`profiles ${d} and ${v} collide on ${I}`,"PROFILE_COLLISION")}}for(let[g,d]of Object.entries(f))if(!x.includes(g)||typeof d!="string"||!(d in p))throw new n(`registry contains invalid association ${JSON.stringify(g)} -> ${JSON.stringify(d)}`);let a=f[t];if(a===void 0)return null;if(typeof a!="string"||!(a in p))throw new n(`${t} names missing profile ${JSON.stringify(a)}`);let u=T(p[a],a),m=_(u.configPath,`associated daemon config for ${a}`),y=b(m,o),S=w(y.stateDir);if(y.port!==u.port)throw new n(`profile ${a} expects port ${u.port} but ${u.configPath} resolves port ${y.port}`,"CONFIG_DRIFT");if(S!==w(u.stateDir))throw new n(`profile ${a} expects stateDir ${u.stateDir} but ${u.configPath} resolves ${S}`,"CONFIG_DRIFT");return{application:t,profileId:a,profile:u,registryPath:r}}async function tt(t,e,o,{fetch:r=globalThis.fetch,timeoutMs:c=2e3}={}){if(!t)return;let{profileId:i,profile:s}=t;if(e.port!==s.port||w(e.stateDir)!==w(s.stateDir))throw new n(`resolved runtime config drifted from profile ${i}`,"CONFIG_DRIFT");let p=async(a,u)=>{let m=new AbortController,y=setTimeout(()=>m.abort(),c);try{return await r(`http://127.0.0.1:${s.port}${a}`,{headers:u,signal:m.signal})}finally{clearTimeout(y)}},f;try{f=await p("/info")}catch(a){throw new n(`profile ${i} daemon is unreachable on 127.0.0.1:${s.port}: ${a.message}`,"UNREACHABLE")}if(!f.ok)throw new n(`profile ${i} /info returned HTTP ${f.status}`,"INCOMPATIBLE_DAEMON");let l=await f.json();if(l?.name!=="ours"||typeof l?.stateDir!="string")throw new n(`profile ${i} endpoint is not an ours daemon`,"INCOMPATIBLE_DAEMON");if(w(l.stateDir)!==w(s.stateDir))throw new n(`profile ${i} expects stateDir ${s.stateDir} but the daemon reports ${l.stateDir}`,"DAEMON_DRIFT");let h;try{h=await p("/identities",o?{"x-ours-api-token":o}:void 0)}catch(a){throw new n(`profile ${i} protected API probe failed: ${a.message}`,"AUTH_PROBE_FAILED")}if(h.status===401||h.status===403)throw new n(`profile ${i} rejected its selected authentication`,"AUTH_FAILED");if(!h.ok)throw new n(`profile ${i} protected API returned HTTP ${h.status}`,"INCOMPATIBLE_DAEMON")}export{x as ASSOCIATED_APPLICATIONS,n as AssociationError,E as INSTALLER_PROFILES_VERSION,X as assertApplicationCommand,z as installerProfilesPath,Q as parseApplicationArgs,Y as resolveRuntimeAssociation,tt as verifyRuntimeAssociation};
|
package/dist/push.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
function t(n,s,o){let e;try{e=n()}catch(r){o(s,r);return}e&&typeof e.then=="function"&&e.then(void 0,r=>o(s,r))}function i(n,s,o,e){t(()=>n.sendLoggingMessage({level:"info",logger:"ours",data:o}),"sendLoggingMessage",e),t(()=>n.server.sendResourceUpdated({uri:s}),"sendResourceUpdated",e)}export{i as pushInboxNotifications};
|
package/dist/service-instance.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
var a="ours.service",o="solutions.adaptframework.ours",g=/^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,30}[A-Za-z0-9])?$/;function s(e){let t=typeof e=="string"?e.trim():"";return t?t.length>32?{ok:!1,name:"",reason:"service name must be 32 characters or fewer"}:g.test(t)?{ok:!0,name:t}:{ok:!1,name:"",reason:"service name must be 1\u201332 characters of letters, digits, hyphen or underscore, starting and ending with a letter or digit"}:{ok:!0,name:""}}function k(e=""){let{ok:t,name:n}=s(e);return!t||!n?a:`ours-${n}.service`}function c(e=""){let{ok:t,name:n}=s(e);return!t||!n?o:`${o}.${n}`}function l(e=""){let{ok:t,name:n}=s(e);return t&&n?`ours MCP daemon (instance "${n}") \u2014 secure agent-to-agent messaging over ADAPT`:"ours MCP daemon (secure agent-to-agent messaging over ADAPT)"}function m(e){let t=s(e.instance).name,n=t?`Environment=OURS_SERVICE_NAME=${t}
|
|
3
|
-
`:"",i=t&&e.configPath?`Environment=OURS_CONFIG=${e.configPath}
|
|
4
|
-
`:"";return`[Unit]
|
|
5
|
-
Description=${l(t)}
|
|
6
|
-
After=network-online.target
|
|
7
|
-
Wants=network-online.target
|
|
8
|
-
|
|
9
|
-
[Service]
|
|
10
|
-
Type=simple
|
|
11
|
-
ExecStart=${e.execPath} ${e.self} serve
|
|
12
|
-
Environment=OURS_TRANSPORT=http
|
|
13
|
-
Environment=OURS_PORT=${e.port}
|
|
14
|
-
Environment=OURS_BROKER_URL=${e.brokerUrl}
|
|
15
|
-
Environment=OURS_STATE_DIR=${e.stateDir}
|
|
16
|
-
${i}${n}Restart=on-failure
|
|
17
|
-
RestartSec=2
|
|
18
|
-
|
|
19
|
-
[Install]
|
|
20
|
-
WantedBy=default.target
|
|
21
|
-
`}function r(e){return String(e).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}function f(e){let t=s(e.instance).name,n=t?` <key>OURS_SERVICE_NAME</key><string>${r(t)}</string>
|
|
22
|
-
`:"",i=t&&e.configPath?` <key>OURS_CONFIG</key><string>${r(e.configPath)}</string>
|
|
23
|
-
`:"";return`<?xml version="1.0" encoding="UTF-8"?>
|
|
24
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
25
|
-
<plist version="1.0">
|
|
26
|
-
<dict>
|
|
27
|
-
<key>Label</key><string>${r(c(t))}</string>
|
|
28
|
-
<key>ProgramArguments</key>
|
|
29
|
-
<array>
|
|
30
|
-
<string>${r(e.execPath)}</string>
|
|
31
|
-
<string>${r(e.self)}</string>
|
|
32
|
-
<string>serve</string>
|
|
33
|
-
</array>
|
|
34
|
-
<key>EnvironmentVariables</key>
|
|
35
|
-
<dict>
|
|
36
|
-
<key>OURS_TRANSPORT</key><string>http</string>
|
|
37
|
-
<key>OURS_PORT</key><string>${e.port}</string>
|
|
38
|
-
<key>OURS_BROKER_URL</key><string>${r(e.brokerUrl)}</string>
|
|
39
|
-
<key>OURS_STATE_DIR</key><string>${r(e.stateDir)}</string>
|
|
40
|
-
${i}${n} </dict>
|
|
41
|
-
<key>RunAtLoad</key><true/>
|
|
42
|
-
<key>KeepAlive</key><true/>
|
|
43
|
-
<key>StandardOutPath</key><string>${r(e.logPath??"")}</string>
|
|
44
|
-
<key>StandardErrorPath</key><string>${r(e.logPath??"")}</string>
|
|
45
|
-
</dict>
|
|
46
|
-
</plist>
|
|
47
|
-
`}export{o as DEFAULT_LAUNCHD_LABEL,a as DEFAULT_SYSTEMD_UNIT,f as buildLaunchdPlist,m as buildSystemdUnit,c as launchdLabel,s as normalizeInstanceName,l as serviceDescription,k as systemdUnitName};
|