@ours.network/sdk 3.0.2 → 3.0.4
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 +29 -0
- package/dist/api/contacts.js +1 -1
- package/dist/api/files.js +1 -1
- package/dist/api/history.js +1 -1
- package/dist/api/identity.js +1 -1
- package/dist/api/messaging.js +1 -1
- package/dist/api/profile.js +1 -1
- package/dist/api/types.d.ts +13 -2
- package/dist/book.js +1 -1
- package/dist/boot.js +1 -1
- package/dist/chunk-3FAS7737.js +2 -0
- package/dist/{chunk-23BNCGF6.js → chunk-4EICEZ36.js} +1 -1
- package/dist/chunk-63FBQ35M.js +2 -0
- package/dist/chunk-6ATIPILE.js +2 -0
- package/dist/chunk-6DRJYMF2.js +2 -0
- package/dist/{chunk-OMUFZVAY.js → chunk-6HS337DC.js} +1 -1
- package/dist/chunk-CBKH6ILH.js +2 -0
- package/dist/chunk-FMQOOSOQ.js +2 -0
- package/dist/{chunk-P62PZ44T.js → chunk-FP33FQ2P.js} +1 -1
- package/dist/chunk-HBHUWDY3.js +2 -0
- package/dist/{chunk-7GBZLXV2.js → chunk-IOL6KZNO.js} +1 -1
- package/dist/{chunk-WXCHUQ3J.js → chunk-JV64HCOG.js} +1 -1
- package/dist/chunk-L57CP5UJ.js +2 -0
- package/dist/{chunk-DRALQ2W5.js → chunk-MR2LCJLF.js} +1 -1
- package/dist/{chunk-SEZTXIKN.js → chunk-O2K2ME7S.js} +1 -1
- package/dist/{chunk-4NP2YNWX.js → chunk-QWAZLLE2.js} +1 -1
- package/dist/chunk-RFU57I64.js +2 -0
- package/dist/chunk-S6GRTEIM.js +2 -0
- package/dist/chunk-SQWLTVUX.js +2 -0
- package/dist/chunk-TKIAVV2O.js +2 -0
- package/dist/chunk-ULS3S767.js +2 -0
- package/dist/{chunk-GZNPN3B5.js → chunk-VD57XFNA.js} +1 -1
- package/dist/{chunk-KIS5USR4.js → chunk-VH4CORJZ.js} +1 -1
- package/dist/chunk-XEK46DXF.js +2 -0
- package/dist/client/http.d.ts +1 -0
- package/dist/client/http.js +1 -1
- package/dist/client/select.js +1 -1
- package/dist/client.js +1 -1
- package/dist/cluster/control.js +1 -1
- package/dist/cluster/manifest.js +1 -1
- package/dist/connector.js +1 -1
- package/dist/gc.js +1 -1
- package/dist/http/api-routes.js +1 -1
- package/dist/http/server.js +1 -1
- package/dist/identity/hierarchy.js +1 -1
- package/dist/identity/lease.d.ts +1 -0
- package/dist/identity/lease.js +1 -1
- package/dist/identity/lifecycle.d.ts +1 -1
- package/dist/identity/lifecycle.js +1 -1
- package/dist/identity/migration.d.ts +8 -0
- package/dist/identity/migration.js +2 -0
- package/dist/identity/model.d.ts +6 -0
- package/dist/identity/model.js +1 -1
- package/dist/identity/provision.js +1 -1
- package/dist/identity/reaper.d.ts +5 -0
- package/dist/identity/reaper.js +2 -0
- package/dist/identity/release.d.ts +3 -0
- package/dist/identity/release.js +2 -0
- package/dist/identity/staged.d.ts +14 -0
- package/dist/identity/staged.js +2 -0
- package/dist/index.js +1 -1
- package/dist/messaging/send.js +1 -1
- package/dist/mufl/handlers.js +1 -1
- package/dist/mufl/tx.js +1 -1
- package/dist/mufl_code/351F16D444E6DAA252D4A8D829D17204360D9015FEF670ACE68FB4747BB3B14E.muflo +0 -0
- package/dist/notify.js +1 -1
- package/dist/runtime/env.js +1 -1
- package/dist/state.js +1 -1
- package/dist/sweeps.js +1 -1
- package/dist/uploads.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2TG2NHED.js +0 -2
- package/dist/chunk-32DN6MBS.js +0 -2
- package/dist/chunk-5DE7MMDG.js +0 -2
- package/dist/chunk-7M7H7ZAV.js +0 -2
- package/dist/chunk-EPLWWBVB.js +0 -2
- package/dist/chunk-H7CVIQ7G.js +0 -2
- package/dist/chunk-HZCFYJAG.js +0 -2
- package/dist/chunk-Q44JJZFN.js +0 -2
- package/dist/chunk-S4JI2DB5.js +0 -2
- package/dist/chunk-USG7J2P2.js +0 -2
- package/dist/chunk-UVQY3IFO.js +0 -2
- package/dist/chunk-VIZVYPRQ.js +0 -2
package/dist/chunk-S4JI2DB5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as u,e as p}from"./chunk-7M7H7ZAV.js";import{B as m,f as l,r as f,v as c,z as w}from"./chunk-H7CVIQ7G.js";import{c as s,d}from"./chunk-EPLWWBVB.js";function x(e,t){if(!u||!s.has(u))return null;let n=s.get(t)??[...s.values()].find(r=>r.cid===t);if(!n||n.name===e.name)return null;let i=r=>r.name===u||p(r).roleId!=="";return i(e)&&i(n)?n:null}async function S(e,t,n){let i=m(t),r=await f(async a=>(await c(e,"::actor::connect_sibling",{name:t.name,target_ad:e.pw.packet.NewBinaryFromBuffer(i).Attach(a),text:n},a)).Reduce("wire_id").Visualize());return l(e),{text:`"${t.name}" was not a contact yet \u2014 connected as an intra-root sibling (delegation-cert auto-accept) and delivered the message.`,wireId:r}}async function N(e,t,n){if(!d)throw new Error(`"${t}" is not a contact, and the local contact book is unavailable.`);let i=w(),r=i[t]??Object.values(i).find(o=>o.container_id===t);if(!r)throw new Error(`"${t}" is not a contact and has no local contact-book entry. Use generate_invite/add_contact for remote peers, or list_local_contact_book to see local ones.`);if(r.container_id===e.cid)throw new Error("that contact-book entry is this identity itself.");let a=Buffer.from(r.address_document,"base64url"),g=Buffer.from(r.registrar_sig,"base64url"),y=m(e),k=await f(async o=>{let b=await c(d,"::actor::mint_introduction",{joiner_ad:d.pw.packet.NewBinaryFromBuffer(y).Attach(o),target_ad:d.pw.packet.NewBinaryFromBuffer(a).Attach(o)},o),h=Buffer.from(b.Reduce("intro").GetBinary());return(await c(e,"::actor::connect_local",{name:r.name,target_ad:e.pw.packet.NewBinaryFromBuffer(a).Attach(o),intro:e.pw.packet.NewBinaryFromBuffer(h).Attach(o),entry_sig:e.pw.packet.NewBinaryFromBuffer(g).Attach(o),text:n},o)).Reduce("wire_id").Visualize()});return l(e),{text:`"${r.name}" was not a contact yet \u2014 connected via the local contact book and sent the message with the introduction. If "${r.name}" requires approval for local introductions, delivery completes once they approve.`,wireId:k}}var q=e=>{let t=r=>!e.Reduce(r).IsNil(),n=e.Reduce("wire_id").Visualize(),i=t("sent_to")?e.Reduce("sent_to").Visualize():"";if(t("downgrade_refused"))return{kind:"refused",wireId:n,cid:i};if(t("migrating"))return{kind:"migrating",wireId:n,cid:i,queued:t("queued")?Number(e.Reduce("queued").Visualize()):0};if(t("route")){let r=t("retained")&&!e.Reduce("retained").GetBoolean();return{kind:"e2e",wireId:n,cid:i,notRetained:r}}return t("deferred")?{kind:"deferred",wireId:n,queued:t("queued")?Number(e.Reduce("queued").Visualize()):0}:{kind:"sent",wireId:n}};export{x as a,S as b,N as c,q as d};
|
package/dist/chunk-USG7J2P2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as d}from"./chunk-7M7H7ZAV.js";import{q as a,s as c}from"./chunk-H7CVIQ7G.js";import{c as s}from"./chunk-EPLWWBVB.js";function y(e){try{return a(n=>{let i=c(e,"::a2a_capabilities::get_manifest",n).Reduce("capabilities");return i.IsNil()?[]:[...i.GetKeys()].map(t=>typeof t=="string"?t:t.Visualize())})}catch{return[]}}function R(e){let n="",i="",t="",u="",l=[];try{a(g=>{let p=c(e,"::a2a_capabilities::get_manifest",g),r=o=>{let f=p.Reduce(o);return f.IsNil()?"":f.Visualize()};n=r("app_id"),i=r("name"),t=r("description"),u=r("version");let m=p.Reduce("capabilities");m.IsNil()||(l=[...m.GetKeys()].map(o=>typeof o=="string"?o:o.Visualize()))})}catch{}return{app_id:n,name:i,description:t,version:u,capabilities:l,monitoring_status:"unbound"}}function h(e){let n=[];for(let i of s.values()){if(i.name===e.name)continue;let t=d(i);t.rootCid===e.cid&&n.push({name:i.name,cid:i.cid,role_id:t.roleId,bio:t.bio,monitoring:t.monitoringEnabled,capabilities:y(i)})}return n}function v(e,n){let i=s.get(n)??[...s.values()].find(t=>t.cid===n);return!i||i.name===e.name?null:d(i).rootCid===e.cid?i:null}export{y as a,R as b,h as c,v as d};
|
package/dist/chunk-UVQY3IFO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as E}from"./chunk-JOKNFUW3.js";import{a as k,b as A,d as C}from"./chunk-7M7H7ZAV.js";import{E as x,j as y,q as T,r as I,s as _,v as R}from"./chunk-H7CVIQ7G.js";import{a as l,d as u,e as d,g as S}from"./chunk-5DE7MMDG.js";import{a as v,c as m,p as w}from"./chunk-EPLWWBVB.js";import{c as s,i as n}from"./chunk-4NP2YNWX.js";import{g as $}from"./chunk-TXAIJEXA.js";import{join as D}from"node:path";import*as i from"node:fs";function F(e){try{$(e)}catch(t){n(`closeHistory(${e.name}) failed:`,String(t))}try{v.remove_packet(e.cid)}catch(t){n(`remove_packet(${e.cid}) failed:`,String(t))}m.delete(e.name);try{x(e)}catch(t){n(`failed to unpublish "${e.name}" from the contact book:`,String(t))}l.has(e.name)&&(l.delete(e.name),S()),e.name===A&&(k(null),C());try{i.rmSync(e.dir,{recursive:!0,force:!0}),y.delete(e.name)}catch(t){return`deleting ${e.dir} failed: ${String(t)}`}return null}function L(e,t){let r=e.temp;return r?(r.closing||(r.closing=(async()=>{n(`[${e.name}] closing temporary identity (${t})`);let o=[];try{o=T(a=>E(_(e,"::a2a_messaging::list_contacts",a)))}catch(a){n(`[${e.name}] contact snapshot failed during close (continuing with local cleanup):`,String(a))}let p=0,c=0;u.add(e.name);try{for(let a of o)try{await I(async b=>{let h=(await R(e,"::a2a_messaging::remove_contact",{contact:a.container_id},b)).Reduce("notified");return h.IsNil()?!1:h.GetBoolean()})?p++:c++}catch(g){c++,n(`[${e.name}] remove-me to ${a.container_id} failed (continuing):`,String(g))}}finally{u.delete(e.name)}let f=F(e);return f?n(`[${e.name}] temporary identity close: LOCAL DELETE FAILED \u2014 ${f}`):n(`[${e.name}] temporary identity closed: ${o.length} contact(s), ${p} remove-me notice(s) queued, ${c} not sent (delivery unverified by design)`),{attempted:o.length,notified:p,failed:c,deleteError:f}})()),r.closing):Promise.reject(new Error(`identity "${e.name}" is not temporary`))}function K(){for(let e of[...m.values()]){let t=e.temp;if(!t||t.closing||d(t.owner.pid))continue;let r=l.get(e.name);r&&d(r.pid)||L(e,`stale lease \u2014 owner pid ${t.owner.pid} is dead`).catch(o=>n(`[${e.name}] stale-temp reclaim failed:`,String(o)))}}function Q(){if(i.existsSync(s))for(let e of i.readdirSync(s,{withFileTypes:!0})){if(!e.isDirectory()||m.has(e.name))continue;let t=D(s,e.name),r=w(t);if(!(!r||d(r.owner.pid)))try{i.rmSync(t,{recursive:!0,force:!0}),y.delete(e.name),n(`[${e.name}] removed orphaned temporary-identity dir (owner pid ${r.owner.pid} dead, no live packet)`)}catch(o){n(`[${e.name}] failed to remove orphaned temporary-identity dir:`,String(o))}}}export{F as a,L as b,K as c,Q as d};
|
package/dist/chunk-VIZVYPRQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as H}from"./chunk-EHCBEY52.js";import{c as L,d as B}from"./chunk-UVQY3IFO.js";import{d as F}from"./chunk-Q44JJZFN.js";import{a as u,b as n,c as A,d as U,e as P,f as C}from"./chunk-7M7H7ZAV.js";import{F as M,e as h,g,j as I,l as D,m as N}from"./chunk-H7CVIQ7G.js";import{a as v,b as E,c as O}from"./chunk-YRPUM6JG.js";import{j as k}from"./chunk-GZNPN3B5.js";import{g as $}from"./chunk-5DE7MMDG.js";import{a as f,b as _,c as l,d as b,p as y,q as S,u as R}from"./chunk-EPLWWBVB.js";import{d as m,h as s,i as o}from"./chunk-4NP2YNWX.js";import{adapt_wrapper as K}from"@adapt-toolkit/sdk/executables";var T=!1;function ne(){return T}function j(){if(T)throw new Error('bootWrapper() has already run in this process. It boots the ADAPT environment, which can only be initialised once \u2014 a second call fails inside the native layer with "Failed to invoke initializer in ADAPT environment", which names neither the double init nor the caller. NOTE THAT startDaemon() CALLS bootWrapper() ITSELF: the two are alternatives, not steps. Use startDaemon() for the HTTP daemon, or bootWrapper() alone for a stdio/in-process host \u2014 never both.');T=!0,H()}async function ae(){j(),s?.update("wrapper"),O(v());let x=["--broker_address",m,"--test_mode","--logger_config","--level","INFO","--stdout","stderr","--logger_config_end"];o(`booting wrapper (unit ${E.hash.slice(0,12)}\u2026, broker ${m})`),_(await K.start(x)),f.on_packet_created_cb=e=>o(`wrapper: packet ready ${e.slice(0,12)}\u2026`),f.start();let p=Number(process.env.OURS_TEST_BOOT_HOLD_MS||"")||0;p>0&&(o(`TEST HOLD: boot window open ${p}ms (OURS_TEST_BOOT_HOLD_MS)`),await new Promise(e=>setTimeout(e,p))),s?.update("registrar");try{await N()}catch(e){o("failed to start the contact-book registrar (local contact book disabled):",String(e))}S();let i=R(),d=Math.max(0,Number(process.env.OURS_TEST_FAKE_RESTORE_COUNT||"")||0),c=Math.max(0,Number(process.env.OURS_TEST_FAKE_RESTORE_MS||"")||0),W=i.length===0&&d>0?d:i.length;s?.update("identities",{completed:0,total:W});for(let e of i)I.add(e);if(i.length===0&&d>0){o(`TEST: simulating ${d} fake identity restore(s), ${c}ms each`);for(let e=0;e<d;e++)c>0&&await new Promise(a=>setTimeout(a,c)),s?.update("identities",{completed:e+1,total:d})}else if(i.length===0)o("no persisted identities \u2014 start with create_identity");else{o(`restoring ${i.length} identit${i.length===1?"y":"ies"}: ${i.join(", ")}`);for(let[e,a]of i.entries()){try{let t=await D(a);b&&await M(t);let r=y(t.dir);r&&(t.temp=r)}catch(t){throw o(`failed to restore "${a}":`,String(t)),t}s?.update("identities",{completed:e+1,total:i.length})}}s?.update("reconciliation"),F(),u(A()),n&&!l.has(n)&&(o(`root marker names a missing identity "${n}" \u2014 clearing it`),u(null),U()),n&&o(`root identity: ${n}`);{let e=n?l.get(n):void 0;n&&!e&&o(`re-delegation on upgrade DEGRADED: root "${n}" is not among the restored identities \u2014 role certs not refreshed this boot`);let a=[];if(e)for(let t of l.values()){if(t.name===e.name)continue;let r;try{r=P(t)}catch{r=void 0}if(!(!r||!r.hasCert)){if(r.rootCid!==e.cid){o(`[${t.name}] re-delegation skipped: delegated by a different root (${r.rootCid.slice(0,12)}\u2026), not this host root \u2014 left as-is`);continue}try{await C(e,t),a.push(t)}catch(w){k(t,{event:"redelegation_failed",error:String(w).slice(0,300)}),o(`[${t.name}] boot re-delegation (upgrade cert refresh) failed:`,String(w))}}}for(let t of l.values()){await h(t),await g(t);for(let r of[1e4,3e4,9e4])setTimeout(()=>{h(t).catch(()=>{})},r),setTimeout(()=>{g(t).catch(()=>{})},r)}a.length>0&&o(`refreshed ${a.length} role delegation cert(s) against the live AD on boot`)}$(),B(),L()}export{ne as a,ae as b};
|