@ours.network/sdk 1.3.0 → 1.4.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.
Files changed (69) hide show
  1. package/README.md +26 -0
  2. package/dist/api/contacts.js +1 -1
  3. package/dist/api/conversations.js +1 -1
  4. package/dist/api/files.js +1 -1
  5. package/dist/api/identity.js +1 -1
  6. package/dist/api/messaging.js +1 -1
  7. package/dist/api/profile.js +1 -1
  8. package/dist/book.js +1 -1
  9. package/dist/boot.js +1 -1
  10. package/dist/{chunk-POZQQIY6.js → chunk-27I3P5QL.js} +1 -1
  11. package/dist/{chunk-BRVWXTBV.js → chunk-3RD3QQJ4.js} +1 -1
  12. package/dist/chunk-5WAHPQR4.js +2 -0
  13. package/dist/chunk-BL54LJNA.js +2 -0
  14. package/dist/{chunk-3GV4HJDR.js → chunk-BLI2K72H.js} +1 -1
  15. package/dist/{chunk-NR4BKEX7.js → chunk-BTPUV6I4.js} +1 -1
  16. package/dist/{chunk-PR5I52YC.js → chunk-BV7B7EOB.js} +1 -1
  17. package/dist/{chunk-KXSCALOD.js → chunk-CNRQI6PX.js} +1 -1
  18. package/dist/{chunk-V3DEZ3QC.js → chunk-DVSULKQM.js} +1 -1
  19. package/dist/{chunk-TJCOHSZK.js → chunk-EO6MBMHC.js} +1 -1
  20. package/dist/{chunk-QU4JXFWK.js → chunk-FHYNXFUQ.js} +1 -1
  21. package/dist/{chunk-5UCCZQKJ.js → chunk-FZVAUVTP.js} +1 -1
  22. package/dist/{chunk-XKUHQAZT.js → chunk-G42GGINF.js} +1 -1
  23. package/dist/{chunk-76IUB6EU.js → chunk-GFVCYM7M.js} +1 -1
  24. package/dist/{chunk-JYS5TDXB.js → chunk-GJKW5UGA.js} +1 -1
  25. package/dist/chunk-IQZXY4GI.js +2 -0
  26. package/dist/{chunk-Z6RV2H3U.js → chunk-LOKOJPRM.js} +1 -1
  27. package/dist/chunk-NBEWKZG4.js +2 -0
  28. package/dist/{chunk-KKNLSG4Z.js → chunk-NFQ7V7VN.js} +1 -1
  29. package/dist/{chunk-3SALLTXZ.js → chunk-NWFAMEGF.js} +1 -1
  30. package/dist/{chunk-VDLSQVR6.js → chunk-O6F7UFK2.js} +1 -1
  31. package/dist/{chunk-XTYFZQI6.js → chunk-OS7QJTVD.js} +1 -1
  32. package/dist/{chunk-WQUMJSH5.js → chunk-Q72S27KT.js} +1 -1
  33. package/dist/chunk-VXVW4KJU.js +2 -0
  34. package/dist/client/http.js +1 -1
  35. package/dist/client.js +1 -1
  36. package/dist/cluster/control.js +1 -1
  37. package/dist/cluster/manifest.js +1 -1
  38. package/dist/connector.js +1 -1
  39. package/dist/daemon.js +1 -1
  40. package/dist/errors.d.ts +10 -2
  41. package/dist/errors.js +1 -1
  42. package/dist/gc.js +1 -1
  43. package/dist/http/api-routes.js +1 -1
  44. package/dist/http/server.d.ts +6 -0
  45. package/dist/http/server.js +1 -1
  46. package/dist/identity/hierarchy.js +1 -1
  47. package/dist/identity/lease.js +1 -1
  48. package/dist/identity/lifecycle.js +1 -1
  49. package/dist/identity/model.js +1 -1
  50. package/dist/identity/provision.js +1 -1
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.js +1 -1
  53. package/dist/messaging/file-limit.d.ts +156 -0
  54. package/dist/messaging/file-limit.js +2 -0
  55. package/dist/messaging/send.js +1 -1
  56. package/dist/mufl/handlers.js +1 -1
  57. package/dist/mufl/tx.js +1 -1
  58. package/dist/mufl_code/7962BB01B1D3E782A1F80B083A900AEC30BAC8F8CE79282B31821802B94A39B6.muflo +0 -0
  59. package/dist/notify.js +1 -1
  60. package/dist/render/adapt-to-json.js +1 -1
  61. package/dist/runtime/env.js +1 -1
  62. package/dist/runtime/sdk-signal-ownership.d.ts +9 -0
  63. package/dist/runtime/sdk-signal-ownership.js +2 -0
  64. package/dist/state.js +1 -1
  65. package/dist/sweeps.js +1 -1
  66. package/package.json +2 -2
  67. package/dist/chunk-CWOJDHLH.js +0 -2
  68. package/dist/chunk-D25WNFJF.js +0 -2
  69. package/dist/chunk-UM73BGFH.js +0 -2
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
- import{d as D}from"./chunk-V64IUVSS.js";import{a as L}from"./chunk-37D5PCFY.js";import{a as de,b as ce}from"./chunk-VDLSQVR6.js";import{a as pe,d as le}from"./chunk-3GV4HJDR.js";import{b as ae}from"./chunk-JYS5TDXB.js";import{b as ie,c as se}from"./chunk-QU4JXFWK.js";import{b as re}from"./chunk-XKUHQAZT.js";import{C as oe,a as q,b as ee,l as te,n as ne}from"./chunk-V3DEZ3QC.js";import{a as $,b as X,c as u,e as x,f as Y,g as Z}from"./chunk-POZQQIY6.js";import{c as I,o as Q,v as W}from"./chunk-KKNLSG4Z.js";import{a as N,b as B,c as M,d as F,e as k,g as V,h as P,i as p,m as T,p as K}from"./chunk-76IUB6EU.js";import{createServer as he}from"node:http";import{randomUUID as we}from"node:crypto";import*as H from"node:fs";function Ie(s){if(!s||typeof s!="object"||Array.isArray(s))return!1;let r=s;return r.jsonrpc==="2.0"&&r.method==="initialize"}var Se=["brokerUrl","port","stateDir","gcIntervalMs","apiVisibility"];function fe(s){return new Promise((r,R)=>{let h="";s.on("data",a=>h+=a),s.on("end",()=>{try{r(JSON.parse(h))}catch(a){R(a)}}),s.on("error",R)})}async function Le(s={}){try{return await ve(s)}catch(r){throw P?.failed(),p(`fatal startup error: ${r?.stack??r}`),r}}async function ve(s){if(process.env.OURS_TEST_STARTUP_FAIL==="1")throw new Error("forced startup failure (OURS_TEST_STARTUP_FAIL)");if(s.config){let t=Se.filter(e=>s.config[e]!==B[e]);if(t.length>0)throw new Error(`startDaemon(config) disagrees with the config resolved at module load (${t.join(", ")}). The engine reads its config when src/runtime/env.ts is imported, so a later override cannot move the state dir, port or broker \u2014 set OURS_* env or config.json before importing the SDK.`)}let r=s.mcp,R=r?.isInitializeRequest??Ie,h=null;if(typeof s.onIdentityNotify=="function"){let t=s.onIdentityNotify;h=(e,i)=>{t(e,i,$.get(e)?.sid??null)},q(h)}p("booting wrapper\u2026"),await ae(),de(),p(`wrapper ready (identities=${I.size}), starting HTTP server\u2026`),P?.update("server");let a={},S=new Map,v=new Map,me=3e4,j=t=>{let e=v.get(t);e?e.n++:v.set(t,{n:1,since:Date.now()})},A=t=>{let e=v.get(t);e&&--e.n<=0&&v.delete(t)},G=()=>{let t=0;for(let e of[...S.keys()]){if(e==="stdio")continue;let i=u.get(e)?.pid;if(i===void 0||i<=1||x(i))continue;let n=v.get(e);if(n&&n.n>0&&Date.now()-n.since<me)continue;let o=S.get(e);S.delete(e),delete a[e],u.delete(e),v.delete(e),o?.close().catch(()=>{}),r?.onSessionClosed?.(e),t++,p(`session ${e.slice(0,8)}\u2026 reaped (client pid ${i} dead)`)}return t},U=setInterval(()=>{G(),se()},6e4);U.unref?.();let _=1e3,ue=10*6e4,f=new Map,ge=(t,e)=>{let i=Array.isArray(e)?e:[e];for(let n of i){let o=n;!o||typeof o!="object"||o.id===void 0||o.id===null||typeof o.method!="string"||f.set(`${t}:${String(o.id)}`,{method:o.method,at:Date.now()})}if(f.size>_){let n=Date.now()-ue;for(let[o,d]of f)if(d.at<n&&f.delete(o),f.size<=_)break;for(;f.size>_;){let o=f.keys().next();if(o.done)break;f.delete(o.value)}}},ye=(t,e)=>{try{let i=e instanceof Error?e.message:String(e),n=/No connection established for request ID:\s*(\S+)/.exec(i);if(!n)return;let o=n[1],d=f.get(`${t}:${o}`);f.delete(`${t}:${o}`),p(`UNDELIVERABLE RESPONSE session=${t.slice(0,8)}\u2026 request_id=${o} method=${d?.method??"unknown"} age_ms=${d?Date.now()-d.at:"unknown"} at=${new Date().toISOString()} \u2014 the answer was produced but its stream was already gone`)}catch{}},g=he(async(t,e)=>{let i=new URL(t.url,`http://localhost:${k}`);if(t.method==="GET"&&i.pathname==="/state-dir"){e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({stateDir:M,version:N,compat:1}));return}if(t.method==="GET"&&(i.pathname==="/version"||i.pathname==="/info")){e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({name:"ours",version:N,compat:1,protocol:re,pid:process.pid,stateDir:M}));return}if(t.method==="GET"&&i.pathname==="/identities"){if(!T(t,e))return;e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({identities:[...I.values()].map(n=>({name:n.name,...n.temp?{temporary:!0,stale:!x(n.temp.owner.pid)}:{}}))}));return}if(t.method==="GET"&&i.pathname==="/unread"){if(!T(t,e))return;e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify(ne()));return}{let n=/^\/identities\/([^/]+)\/notifications$/.exec(i.pathname);if(t.method==="GET"&&n){if(!T(t,e))return;let o=decodeURIComponent(n[1]);if(K(o)!==null){e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"invalid identity name"}));return}await te(t,e,o,i.searchParams.get("since"));return}}{let n=/^\/files\/([^/]+)$/.exec(i.pathname);if(t.method==="GET"&&n){if(!T(t,e))return;let o=decodeURIComponent(n[1]),d=t.headers["x-ours-lease-token"],w=typeof d=="string"&&d?Y(d):void 0,m=w?I.get(w.identity):void 0;if(!m){e.writeHead(401,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"no identity bound to this session"}));return}let y=W(m,o);if(!y){e.writeHead(404,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"no such file for the bound identity (run get_files first, or it belongs to another identity)"}));return}try{let l=H.statSync(y);e.writeHead(200,{"Content-Type":"application/octet-stream","Content-Length":String(l.size)});let E=H.createReadStream(y);E.on("error",()=>{try{e.destroy()}catch{}}),E.pipe(e)}catch(l){e.writeHead(500,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:`failed to read file: ${String(l)}`}))}return}}if(i.pathname.startsWith(pe)){await le(t,e,i.pathname,fe);return}if(i.pathname!=="/mcp"||!r){e.writeHead(404,{"Content-Type":"text/plain"}),e.end("Not found");return}if(T(t,e))try{if(t.method==="POST"){let n=await fe(t),o=t.headers["mcp-session-id"],d=t.headers["x-ours-lease-token"],w=t.headers["x-ours-client-pid"],m=w?parseInt(w,10):void 0,y={token:d,pid:Number.isInteger(m)?m:void 0};if(o&&a[o]){u.set(o,y),ge(o,n),j(o),D(e);try{await a[o].handleRequest(t,e,n)}finally{A(o)}}else if(!o&&R(n)){G();let l=r.createTransport({sessionIdGenerator:()=>we(),onsessioninitialized:c=>{a[c]=l,u.set(c,y),S.set(c,C),r.onSessionInitialized?.(c,C),p(`session ${c.slice(0,8)}\u2026 initialized`)}}),E={sessionId:()=>l.sessionId??"pending",leaseToken:()=>u.get(l.sessionId??"pending")?.token,clientPid:()=>u.get(l.sessionId??"pending")?.pid},C=r.createServer(E);C.server.onerror=c=>ye(l.sessionId??"pending",c),l.onclose=()=>{let c=l.sessionId;c&&(delete a[c],S.delete(c),u.delete(c),r.onSessionClosed?.(c),p(`session ${c.slice(0,8)}\u2026 closed (lease kept)`))},await C.connect(l),D(e),await l.handleRequest(t,e,n)}else e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Bad Request: No valid session ID"},id:null}))}else if(t.method==="GET"){let n=t.headers["mcp-session-id"];if(!n||!a[n]){e.writeHead(400,{"Content-Type":"text/plain"}),e.end("Invalid or missing session ID");return}j(n),D(e);try{await a[n].handleRequest(t,e)}finally{A(n)}}else if(t.method==="DELETE"){let n=t.headers["mcp-session-id"];if(!n||!a[n]){e.writeHead(400,{"Content-Type":"text/plain"}),e.end("Invalid or missing session ID");return}let o=u.get(n)?.token??t.headers["x-ours-lease-token"];if(o){for(let[d,w]of[...$]){if(w.token!==o)continue;$.delete(d);let m=I.get(d);m?.temp&&m.temp.owner.tokenHash===Q(o)&&!m.temp.closing&&ie(m,"owning session released its lease").catch(y=>p(`[${d}] close on lease release failed:`,String(y)))}X.delete(o),Z(),p(`lease released by token \u2026${o.slice(-6)}`)}await a[n].handleRequest(t,e)}else e.writeHead(405,{"Content-Type":"text/plain"}),e.end("Method not allowed")}catch(n){p("HTTP handler error:",String(n)),e.headersSent||(e.writeHead(500,{"Content-Type":"application/json"}),e.end(JSON.stringify({jsonrpc:"2.0",error:{code:-32603,message:"Internal server error"},id:null})))}});g.requestTimeout=0,await new Promise((t,e)=>{let i=n=>e(n);g.once("error",i),g.listen(k,"127.0.0.1",()=>{g.off("error",i),P?.ready(),p(`MCP server v${s.version??N} ready (transport=http, port=${k}, visibility=${V}, identities=${I.size}, state=${M}, broker=${F})`),t()})});let z=!1,J=async()=>{if(!z){z=!0,clearInterval(U),ce();for(let t of Object.keys(a)){try{await a[t].close()}catch{}delete a[t]}S.clear();for(let t of I.values())try{oe(t)}catch(e){p(`[${t.name}] shutdown save failed:`,String(e))}g.closeAllConnections?.()}},O=async()=>{p("shutting down\u2026"),await J(),g.close(),process.exit(0)};process.on("SIGINT",O),process.on("SIGTERM",O);let b=g.address();return{port:typeof b=="object"&&b!==null?b.port:k,close:async()=>{process.off("SIGINT",O),process.off("SIGTERM",O),h&&ee(h),await J(),await new Promise(t=>g.close(()=>t()))}}}export{Le as a};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
- import{a as P,b as B,c as C,d as b}from"./chunk-3SALLTXZ.js";import{a as g}from"./chunk-KXSCALOD.js";import{A as M,B as A,C as E,J as m,a as R}from"./chunk-UM73BGFH.js";import{E as v,F as u,G as F,J as _,g as p,h as $,m as y}from"./chunk-V3DEZ3QC.js";import{c as w}from"./chunk-Z6RV2H3U.js";import{i as c}from"./chunk-76IUB6EU.js";import{d as k}from"./chunk-LKFYUCN7.js";import{a as I}from"./chunk-P55RJGZU.js";import{readFile as q}from"node:fs/promises";import{basename as N}from"node:path";function O(s,r){if(s)return r!==void 0?{wire_id:s,sentence:r}:{wire_id:s}}async function Q(s,r){let e=g(s),{contact:o,text:n}=r,a=O(r.reply_to_wire_id,r.reply_to_sentence);try{let t=await u(async d=>b(await _(e,"::a2a_messaging::send_message",{contact:o,text:n,...a?{reply_to:a}:{}},d)));switch(t.kind){case"refused":c(`[e2e-route] refused cid=${t.cid} wire_id=${t.wireId} (downgrade_refused)`);break;case"migrating":c(`[migration] queued cid=${t.cid} wire_id=${t.wireId} (migrating, ${t.queued} queued)`);break;case"e2e":c(`[e2e-route] cid=${t.cid} wire_id=${t.wireId} verdict=e2e (core delivered over migrated session)${t.notRetained?" NOT RETAINED (oversized)":""}`),t.notRetained&&p(e,{event:"send_not_retained",wire_id:t.wireId,kind:"message"});break;default:break}return t}catch(t){if(!/Unknown contact/.test(String(t)))throw m("send_message",String(t));try{let d=P(e,o);return{kind:"introduced",text:d?await B(e,d,n):await C(e,o,n)}}catch(d){throw m("send_message",String(d),"FALLBACK_FAILED")}}}async function X(s,r){let e=g(s),{contact:o,path:n,data_base64:a,filename:t,mime:d}=r;if((n?1:0)+(a?1:0)!=1)throw M();let f,l;try{if(n)f=await q(n),l=t??N(n);else{if(!t)throw A();f=Buffer.from(a,"base64"),l=t}}catch(i){throw i instanceof R?i:E(String(i))}let h=d??(n?I(n):""),S=O(r.reply_to_wire_id,r.reply_to_sentence);try{let i=await u(async x=>{let T=e.pw.packet.NewBinaryFromBuffer(f).Attach(x);return b(await _(e,"::a2a_messaging::send_file",{contact:o,filename:l,mime:h,data:T,...S?{reply_to:S}:{}},x))});switch(i.kind){case"refused":c(`[e2e-route] refused cid=${i.cid} wire_id=${i.wireId} (downgrade_refused, file)`);break;case"migrating":c(`[migration] file-defer cid=${i.cid} wire_id=${i.wireId} (migrating, not queued)`);break;case"e2e":c(`[e2e-route] cid=${i.cid} wire_id=${i.wireId} verdict=e2e file (core delivered over migrated session)${i.notRetained?" NOT RETAINED (oversized)":""}`),i.notRetained&&p(e,{event:"send_not_retained",wire_id:i.wireId,kind:"file"});break;default:break}return{...i,filename:l,bytes:f.length,mime:h}}catch(i){throw m("send_file",String(i))}}async function Y(s){let r=g(s);try{return v(e=>w(F(r,"::actor::list_incoming_messages",e)))}catch(e){throw m("list_incoming_messages",String(e))}}async function Z(s){let r=g(s);try{let e=await u(async n=>{let a=await _(r,"::actor::get_messages",{},n);return w(a.Reduce("messages"))});y(r);let o=$(r);return k(e,o)}catch(e){throw m("get_messages",String(e))}}async function ee(s,r){let e=g(s),{msg_ids:o}=r;try{let n=await u(async a=>(await _(e,"::actor::defer_messages",{msg_ids:o},a)).Reduce("deferred").Visualize());return y(e),{deferred:n}}catch(n){throw m("defer_messages",String(n))}}export{Q as a,X as b,Y as c,Z as d,ee as e};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
2
- var t=class extends Error{constructor(n,r){super(r);this.code=n;this.name="OursError"}},i=()=>new t("NOT_BOUND","No identity bound to this session. Call choose_identity (or create_identity) first."),s=()=>new t("BINDING_REASSIGNED","Your identity binding was reassigned to another session. Call choose_identity again to continue."),a=e=>new t("BOUND_IDENTITY_GONE",`The bound identity "${e}" no longer exists. Choose another with choose_identity.`),d=e=>new t("TEMP_CLOSING",`The temporary identity "${e}" is closing and no longer accepts work. Its contacts are being notified and its local state deleted.`),_=(e,o)=>new t("NAME_TAKEN",`${e} failed: an identity named "${o}" already exists.`),c=()=>new t("NO_LEASE_HEADERS","create_temporary_identity failed: this client is not connected through the ours connector (no lease token / client pid headers), so there is no session lease to own the identity. Launch ours via the connector (`ours-mcp proxy`)."),l=()=>new t("RANDOM_NAME_EXHAUSTED","create_temporary_identity failed: could not pick a free random name after 5 attempts \u2014 retry."),E=e=>new t("ROOT_EXISTS",`create_root_identity failed: a root identity already exists ("${e}") \u2014 one root per host. Nothing to do.`),y=()=>new t("NOT_BOUND_NO_NAME","close_temporary_identity failed: no identity is bound to this session and no name was given."),N=e=>new t("NOT_TEMPORARY",`close_temporary_identity failed: "${e}" is a permanent identity. Use remove_identity if you really mean to delete it.`),p=(e,o)=>new t("TEMP_OWNED_ELSEWHERE",`close_temporary_identity failed: "${e}" is owned by another LIVE session (owner pid ${o}) \u2014 one session cannot delete another's temporary identity.`),O=(e,o,n)=>new t("DELETE_PARTIAL",`Temporary identity "${e}" closed with an error: ${o}. ${n}`),h=e=>new t("PATH_NOT_ABSOLUTE",`define_local_identity_file failed: path must be absolute (got "${e}").`),T=e=>new t("NO_SUCH_IDENTITY",`choose_identity failed: no identity named "${e}". Create it with create_identity.`),w=()=>new t("NO_LEASE_TOKEN","choose_identity failed: this client is not connected through the ours connector (no lease token header). Launch ours via the connector (`ours-mcp proxy`)."),u=e=>new t("TEMP_CLOSING",`choose_identity failed: temporary identity "${e}" is closing \u2014 its state is being deleted.`),m=(e,o)=>new t("TEMP_OWNED_ELSEWHERE",`choose_identity failed: "${e}" is a TEMPORARY identity owned by another live session (owner pid ${o}). Ownership is exclusive and cannot be overridden \u2014 not even with force. Create your own with create_temporary_identity.`),A=(e,o)=>new t("TEMP_STALE",`choose_identity failed: temporary identity "${e}" is STALE \u2014 its owning session (pid ${o}) is gone and it is pending automatic cleanup. It cannot be adopted by another session; use close_temporary_identity to reclaim (clean it up) now.`),I=e=>new t("BOUND_ELSEWHERE",`choose_identity declined: "${e}" is currently bound to another live session. Do not retry with force=true on your own \u2014 tell the user it is in use elsewhere and ask whether to forcibly rebind it here; only retry with force=true after they explicitly confirm.`),L=(e,o)=>new t("TEMP_OWNED_ELSEWHERE",`remove_identity failed: "${e}" is a TEMPORARY identity owned by another LIVE session (owner pid ${o}) \u2014 one session cannot delete another's temporary identity.`),g=(e,o,n)=>new t("DELETE_PARTIAL",`Temporary identity "${e}" closed with an error: ${o}.${n}`),D=(e,o)=>new t("ROOT_HAS_ROLES",`remove_identity failed: "${e}" is the root identity and still has ${o.length} role(s): ${o.join(", ")}. Remove the roles first.`),f=(e,o)=>new t("DELETE_PARTIAL",`Identity "${e}" removed from memory, but ${o}`),R=()=>new t("PUBLIC_INVITE_NAMED","generate_invite failed: a public invite cannot pre-assign a contact name \u2014 every redeemer would be registered under it. Omit `name` for a public invite."),S=()=>new t("NO_POLICY_ARGS","set_local_book_policy: pass expose and/or auto_accept."),x=()=>new t("SEND_ARGS","send_file: provide exactly one of `path` or `data_base64`."),b=()=>new t("SEND_ARGS","send_file: `filename` is required with `data_base64`."),$=e=>new t("FILE_UNREADABLE",`send_file: cannot read file: ${e}`),C=(e,o)=>new t("CONNECTOR_TOO_OLD","save_file could not be completed by your ours connector: it reached the daemon directly, which means the connector is too old to stream the bytes and write them as your OS user. Update the ours connector to use save_file, or fall back to get_files and copy the returned path yourself (`cp`)."+(o?"":` (Also note: no file with wire_id ${e} is currently on disk for this identity \u2014 run get_files first.)`)),M=()=>new t("NO_ROOT","No root identity exists on this host \u2014 create one with create_root_identity first."),P=e=>new t("INVALID_SELECTION",`get_files failed: wire_ids must contain 1-${e} items.`),v=()=>new t("MALFORMED_ID","get_files failed: every selected wire_id must be exactly 64 hexadecimal characters."),U=()=>new t("DUPLICATE_ID","get_files failed: wire_ids must not contain duplicates."),B=()=>new t("UNKNOWN_OR_STALE_ID","get_files failed: one or more selected wire_ids is unknown, stale, or no longer unread; no files were retrieved."),F=(e,o,n="TX_FAILED")=>new t(n,`${e} failed: ${o}`);export{t as a,i as b,s as c,a as d,d as e,_ as f,c as g,l as h,E as i,y as j,N as k,p as l,O as m,h as n,T as o,w as p,u as q,m as r,A as s,I as t,L as u,g as v,D as w,f as x,R as y,S as z,x as A,b as B,$ as C,C as D,M as E,P as F,v as G,U as H,B as I,F as J};