@origintrail-official/dkg-node-ui 10.0.1 → 10.0.3

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 (59) hide show
  1. package/dist/chain-cursor-stores.d.ts +45 -0
  2. package/dist/chain-cursor-stores.d.ts.map +1 -0
  3. package/dist/chain-cursor-stores.js +107 -0
  4. package/dist/chain-cursor-stores.js.map +1 -0
  5. package/dist/chat-memory.d.ts +0 -17
  6. package/dist/chat-memory.d.ts.map +1 -1
  7. package/dist/chat-memory.js +6 -33
  8. package/dist/chat-memory.js.map +1 -1
  9. package/dist/db.d.ts +15 -0
  10. package/dist/db.d.ts.map +1 -1
  11. package/dist/db.js +40 -1
  12. package/dist/db.js.map +1 -1
  13. package/dist/index.d.ts +6 -3
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +6 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/notifications-scope.d.ts +19 -0
  18. package/dist/notifications-scope.d.ts.map +1 -1
  19. package/dist/notifications-scope.js +34 -2
  20. package/dist/notifications-scope.js.map +1 -1
  21. package/dist/otlp-log-worker.d.ts +127 -0
  22. package/dist/otlp-log-worker.d.ts.map +1 -0
  23. package/dist/otlp-log-worker.js +268 -0
  24. package/dist/otlp-log-worker.js.map +1 -0
  25. package/dist/telemetry-resource.d.ts +41 -0
  26. package/dist/telemetry-resource.d.ts.map +1 -0
  27. package/dist/telemetry-resource.js +31 -0
  28. package/dist/telemetry-resource.js.map +1 -0
  29. package/dist/telemetry.d.ts +75 -16
  30. package/dist/telemetry.d.ts.map +1 -1
  31. package/dist/telemetry.js +152 -29
  32. package/dist/telemetry.js.map +1 -1
  33. package/dist-ui/assets/{3d-force-graph-DII0C0lY.js → 3d-force-graph-DRDhpplH.js} +1 -1
  34. package/dist-ui/assets/AgentHub-DdUAxJoy.js +1 -0
  35. package/dist-ui/assets/AgentProfilePage-yI8fA4vv.js +1 -0
  36. package/dist-ui/assets/ApproveWalletsModal-9w2edv7e.js +57 -0
  37. package/dist-ui/assets/ConvictionDetailView-CcQMya-y.js +2 -0
  38. package/dist-ui/assets/Network-DpAKVzwi.js +1 -0
  39. package/dist-ui/assets/OnChainProvenanceCard-DMOm3jLz.js +1 -0
  40. package/dist-ui/assets/{Operations-BC6Cv6cR.js → Operations-DKJFp6hM.js} +3 -3
  41. package/dist-ui/assets/PublishingConviction-1CPHxNwp.js +2 -0
  42. package/dist-ui/assets/Settings-DaYMlGHD.js +1 -0
  43. package/dist-ui/assets/ccip-hCQYqfNz.js +1 -0
  44. package/dist-ui/assets/{index-D0Mz0SVt.js → index-Bh_8bMB0.js} +3 -3
  45. package/dist-ui/assets/{index-ByLJSVQ3.js → index-CVwCoJrM.js} +9 -9
  46. package/dist-ui/assets/index-D5UiTYlY.css +1 -0
  47. package/dist-ui/assets/index-DGpnb_b1.js +1661 -0
  48. package/dist-ui/assets/{jsonld-32FQRO67-B4_tUX65.js → jsonld-32FQRO67-C3B_LjZ-.js} +2 -2
  49. package/dist-ui/assets/{jsonld-D5RXTCJi.js → jsonld-CoPRWQuM.js} +1 -1
  50. package/dist-ui/assets/{renderer-3d-2EVDZII7-BTYEjwma.js → renderer-3d-2EVDZII7-Bx6o7Gge.js} +2 -2
  51. package/dist-ui/index.html +2 -2
  52. package/package.json +14 -3
  53. package/dist-ui/assets/AgentHub-D3eOrb3Z.js +0 -1
  54. package/dist-ui/assets/AgentProfilePage-jB-v9soG.js +0 -1
  55. package/dist-ui/assets/Network-d4igcZQ0.js +0 -1
  56. package/dist-ui/assets/OnChainProvenanceCard-BL6ou6s9.js +0 -1
  57. package/dist-ui/assets/Settings-DXSjvx2a.js +0 -1
  58. package/dist-ui/assets/index-B6UQm9N_.js +0 -1670
  59. package/dist-ui/assets/index-BgRu6zNc.css +0 -1
@@ -0,0 +1,2 @@
1
+ import{ad as e,aN as $,aI as R,ap as y,ag as K,an as Q,Z as P,H as Z,n as E,aD as S,af as M,z as W,aM as J,$ as Y,aB as X,o as O,Q as I,a5 as ee,S as ae,a1 as ne}from"./index-DGpnb_b1.js";import{f as U,k as V,u as te,e as B,g as se,d as re,A as le,a as _,C as oe,E as ie,G as ce,F as de,H as pe,c as ue,W as me,D as he,x as ve}from"./ApproveWalletsModal-9w2edv7e.js";const D=(a,n)=>!!a&&!!n&&a.toLowerCase()===n.toLowerCase();function we({agents:a,nodeWallets:n,ownerIsPrimary:r,ownerTitle:l,confirmRemove:s,onAskRemove:t,onCancelRemove:i,onConfirmRemove:v,removeBusy:u,explorer:p}){return e.jsx("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:a.map(c=>{const h=n.some(f=>D(f,c)),o=D(s??void 0,c);return e.jsx("div",{className:"v10-pca-agent-row","data-testid":"pca-agent-row",children:e.jsx(U,{address:c,status:h?"approved · this node":"approved",statusTone:"success",trailing:o?e.jsxs("span",{className:"v10-pca-agent-confirm",children:[e.jsx("span",{children:h?"This is one of this node’s own signing wallets — its publishes will pay the direct cost (and revert if it holds no TRAC). Remove?":"Publishes from this wallet will pay the direct cost (and revert if it holds no TRAC). Remove?"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-deregister-btn","aria-label":`Confirm removing ${c}`,onClick:()=>v(c),disabled:u,children:u?"Removing…":"Yes, remove"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Cancel removing ${c}`,onClick:i,disabled:u,children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[p&&e.jsx("a",{className:"v10-pca-card-explorer",href:`${p}/address/${c}`,target:"_blank",rel:"noreferrer","aria-label":`View ${c} on explorer`,children:"↗"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Remove ${c}`,onClick:()=>t(c),disabled:!r,title:l,children:"Remove"})]})})},c)})})}function ge(){const a=$(l=>l.setBootstrap),n=$(l=>l.initWallet),r=R(l=>l.setScope);y.useEffect(()=>{let l=!1;return K().then(s=>{l||(r(Q(s)),a(s))}).catch(()=>{}).finally(()=>{l||n()}),()=>{l=!0}},[n,r,a])}function be(a){return a==="topup"?{requiresApproval:!0,actionLabel:"Sign top-up"}:{requiresApproval:!1,actionLabel:"Sign remove wallet"}}function q(a,n){const r=V(a,"action");return n==="remove"&&r.kind==="rejected"?"You rejected the remove-wallet transaction. No wallet was removed.":r.message}const fe={busy:!1,error:null,result:null};function z(){return y.useState(fe)}function xe({accountId:a,setFund:n,refresh:r}){const l=R(i=>i.topUpPending[a]??null),s=R(i=>i.clearTopUpPending),t=$(i=>i.bootstrap);y.useEffect(()=>{var p;if(!l||!((p=t==null?void 0:t.rpcUrls)!=null&&p.length))return;let i=!1,v=null;const u=async()=>{try{const h=await te(t.chainId,t.rpcUrls).getTransactionReceipt({hash:l.txHash});if(i)return;s(a),h.status==="success"?(n({busy:!1,error:null,warning:null,result:{txHash:l.txHash,message:"Top-up confirmed on-chain."}}),r()):n({busy:!1,error:"The pending top-up transaction reverted on-chain.",warning:null,result:null})}catch{i||(v=setTimeout(u,5e3))}};return u(),()=>{i=!0,v&&clearTimeout(v)}},[a,s,r,n,l,t])}function ye({accountId:a,snapshot:n,ownerTrac:r,explorer:l,access:s,ownerTitle:t,owner:i,deviceProgress:v,refresh:u}){const p=R(b=>b.topUpPending[a]??null),c=R(b=>b.setTopUpPending),h=R(b=>b.clearTopUpPending),[o,f]=y.useState(""),[m,w]=z();xe({accountId:a,setFund:w,refresh:u});const C=async()=>{var b,x;s.mode==="wallet"?v.begin("topup"):v.reset(),w({busy:!0,error:null,result:null,warning:null});try{const d=await i.topUp(a,o.trim());h(a),w({busy:!1,error:null,result:{txHash:d.txHash,message:`Added ${P(d.addedTokens)} TRAC.`}}),f(""),u()}catch(d){if(d instanceof Z&&d.status===504){const j=(b=d.body)==null?void 0:b.txHash;if(j){c({accountId:a,ownerEoa:n.owner,submittedAt:Date.now(),txHash:j,tokens:o.trim(),previousTopUpBufferTrac:n.topUpBufferTrac}),w({busy:!1,error:null,result:null,warning:{txHash:j,message:"Your top-up was submitted but we lost confirmation — it may already be on-chain. Verify on the explorer before adding again; a second top-up would lock additional TRAC."}});return}}if(d instanceof B&&d.txStep==="action"&&d.txHash){c({accountId:a,ownerEoa:n.owner,submittedAt:Date.now(),txHash:d.txHash,tokens:o.trim(),previousTopUpBufferTrac:n.topUpBufferTrac}),w({busy:!1,error:null,result:null,warning:{txHash:d.txHash,message:"Your top-up was submitted but we lost confirmation - it may already be on-chain. This exact transaction is being checked; do not add again until it resolves."}});return}if(s.mode==="wallet"){const j=V(d,d instanceof se?d.txStep:d instanceof B?d.txStep??"action":"action");w({busy:!1,error:j.message,result:null,warning:d instanceof re?null:void 0});return}w({busy:!1,error:((x=E(d,{accountId:a}))==null?void 0:x.message)??(d==null?void 0:d.message)??"Top-up failed.",result:null})}};return e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Funding"}),e.jsxs("p",{className:"v10-pca-detail-hint",children:["Top-up raises the spendable buffer. It does ",e.jsx("strong",{children:"not"})," extend the lock period — when the account expires you create a new one."]}),r!=null&&e.jsxs("p",{className:"v10-pca-detail-hint",children:["Owner balance: ",P(r)," TRAC"]}),e.jsxs("div",{className:"v10-pca-detail-form",children:[e.jsx("input",{className:"v10-form-input",type:"text",inputMode:"decimal",value:o,onChange:b=>f(b.target.value),placeholder:"Top up (TRAC)",disabled:!s.writesEnabled||m.busy||!!p,"aria-label":"Top-up amount in TRAC"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary","data-testid":"pca-topup-btn",onClick:C,disabled:!s.writesEnabled||m.busy||!!p||!/^\d+(\.\d+)?$/.test(o.trim())||Number(o.trim())<=0,title:t,children:m.busy?"Adding…":"Add funds"})]}),e.jsx(Ce,{state:m,explorer:l,onRecheck:u}),p&&e.jsxs("p",{className:"v10-pca-create-warn","data-testid":"pca-topup-pending",role:"alert",children:["Top-up transaction ",e.jsx("code",{children:p.txHash})," is pending confirmation. The top-up button is disabled while this exact receipt is checked; adding again could lock more TRAC."," ",e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:u,children:"Recheck account"})]})]})}function Ce({state:a,explorer:n,onRecheck:r}){if(a.warning){const s=n&&a.warning.txHash?`${n}/tx/${a.warning.txHash}`:void 0;return e.jsxs("p",{className:"v10-pca-create-warn","data-testid":"pca-action-warning",role:"alert",children:[a.warning.message," ",a.warning.txHash&&(s?e.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",children:[a.warning.txHash," ↗"]}):e.jsx("code",{children:a.warning.txHash}))," ",r&&e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:r,children:"Recheck"})]})}if(a.error)return e.jsx("p",{className:"v10-modal-error",role:"alert",children:a.error});if(!a.result)return null;const l=n&&a.result.txHash?`${n}/tx/${a.result.txHash}`:void 0;return e.jsxs("p",{className:"v10-pca-detail-result","data-testid":"pca-action-result",role:"status",children:[a.result.message," ",l&&e.jsx("a",{href:l,target:"_blank",rel:"noreferrer",children:"tx ↗"})," ","Still pending? You can close this and verify here."]})}const je=/^0x[0-9a-fA-F]{40}$/;function Ne({accountId:a,snapshot:n,wallets:r,explorer:l,access:s,ownerTitle:t,owner:i,deviceProgress:v,refresh:u}){const[p,c]=y.useState(""),[h,o]=y.useState(null),[f,m]=y.useState(null),[w,C]=z(),[b,x]=y.useState(!1),{data:d,loading:j,refresh:N}=S(()=>M(a),[a]),k=d&&d.accountId===a?d:null,G=async()=>{var T,A;o(null);const g=p.trim();if(!je.test(g)){o("Enter a valid 0x address.");return}try{const L=(T=(await W(a,g)).probedKey)==null?void 0:T.registered;o(L===!0?`✓ ${g} is an approved publishing wallet here.`:L===!1?`✗ ${g} is NOT approved here.`:`Couldn’t determine whether ${g} is approved here — retry.`)}catch(F){o(((A=E(F,{accountId:a}))==null?void 0:A.message)??"Probe failed.")}},H=async g=>{var T;s.mode==="wallet"?v.begin("remove"):v.reset(),C({busy:!0,error:null,result:null});try{await i.deregisterAgent(a,g),C({busy:!1,error:null,result:{message:`Removed ${g}.`}}),m(null),u(),N()}catch(A){C({busy:!1,error:s.mode==="wallet"?q(A,"remove"):((T=E(A,{accountId:a}))==null?void 0:T.message)??(A==null?void 0:A.message)??"Remove failed.",result:null})}};return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsxs("h3",{className:"v10-pca-detail-section-title",children:["Publishing wallets — ",n.agentCount," / 100"]}),e.jsxs("div",{className:"v10-pca-detail-form",children:[e.jsx(le,{mode:"single",value:p,onChange:c,label:"Check a wallet",cruxNote:null}),e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:G,children:"Probe"})]}),h&&e.jsx("p",{className:"v10-pca-detail-hint",role:"status",children:h}),j&&!k?e.jsx("p",{className:"v10-pca-detail-hint",role:"status",children:"Loading approved wallets…"}):k?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"v10-pca-detail-subhead",children:"Approved publishing wallets:"}),k.agents.length>0?e.jsx(we,{agents:k.agents,nodeWallets:r,ownerIsPrimary:s.writesEnabled,ownerTitle:t,confirmRemove:f,onAskRemove:g=>m(g),onCancelRemove:()=>m(null),onConfirmRemove:g=>H(g),removeBusy:w.busy,explorer:l}):e.jsx("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:e.jsx("p",{className:"v10-pca-handshake-empty",children:"No approved publishing wallets yet."})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"v10-pca-detail-subhead",children:"This node’s wallets:"}),e.jsxs("div",{className:"v10-pca-detail-agentlist","data-testid":"pca-agent-list",children:[r.map(g=>e.jsx(Ae,{accountId:a,wallet:g,ownerIsPrimary:s.writesEnabled,ownerTitle:t,confirming:f===g,onAskRemove:()=>m(g),onCancelRemove:()=>m(null),onConfirmRemove:()=>H(g),removeBusy:w.busy},g)),r.length===0&&e.jsx("p",{className:"v10-pca-handshake-empty",children:"No operational wallets on this node."})]}),e.jsx("p",{className:"v10-pca-overview-caveat",children:"ⓘ The chain exposes how many wallets are approved, not the full list — only this node’s wallets and any you probe are shown here."})]}),w.error&&e.jsx("p",{className:"v10-modal-error",role:"alert",children:w.error}),w.result&&e.jsx("p",{className:"v10-pca-detail-result",role:"status","data-testid":"pca-remove-result",children:w.result.message}),e.jsx("button",{type:"button",className:"v10-pca-card-btn primary",onClick:()=>x(!0),disabled:!s.writesEnabled,title:t,children:"+ Approve publishing wallet"})]}),b&&e.jsx(_,{accountId:a,initialMode:"self",onClose:()=>{x(!1),u(),N()}})]})}function Ae({accountId:a,wallet:n,ownerIsPrimary:r,ownerTitle:l,confirming:s,onAskRemove:t,onCancelRemove:i,onConfirmRemove:v,removeBusy:u}){var m;const{data:p,loading:c,error:h}=S(()=>W(a,n),[a,n]),o=(m=p==null?void 0:p.probedKey)==null?void 0:m.registered,f=!c&&(h!=null||p!=null&&o==null);return e.jsx("div",{className:"v10-pca-agent-row","data-testid":"pca-agent-row",children:e.jsx(U,{address:n,status:o===!0?"approved":o===!1?"not approved":f?"couldn’t determine":"checking…",statusTone:o===!0?"success":o===!1?"danger":"neutral",trailing:o===!0?s?e.jsxs("span",{className:"v10-pca-agent-confirm",children:[e.jsx("span",{children:"This is one of this node’s own signing wallets — its publishes will pay the direct cost (and revert if it holds no TRAC). Remove?"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","data-testid":"pca-deregister-btn","aria-label":`Confirm removing ${n}`,onClick:v,disabled:u,children:u?"Removing…":"Yes, remove"}),e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Cancel removing ${n}`,onClick:i,disabled:u,children:"Cancel"})]}):e.jsx("button",{type:"button",className:"v10-pca-card-btn","aria-label":`Remove ${n}`,onClick:t,disabled:!r,title:l,children:"Remove"}):void 0})})}function Re(a){const[n,r]=y.useState(!1),[l,s]=y.useState(!1),[t,i]=y.useState(null),v=J(c=>c.openTab);return{renewOpen:n,renewChaining:l,renewApprove:t,openRenew:()=>r(!0),closeRenew:()=>r(!1),onRenewSuccess:c=>{r(!1),s(!0),M(a).then(h=>({agents:h.agents,resolved:!0})).catch(()=>({agents:[],resolved:!1})).then(({agents:h,resolved:o})=>{s(!1),i({newAccountId:c,seedBulk:h.join(`
2
+ `),agentsResolved:o})})},onManageNew:c=>{r(!1),v({id:`conviction:${c}`,label:`PCA #${c}`,closable:!0})},clearRenewApprove:()=>i(null)}}function Te({accountId:a,snapshot:n,access:r,ownerTitle:l,health:s}){const t=Re(a);return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"v10-pca-detail-section",children:[e.jsx("h3",{className:"v10-pca-detail-section-title",children:"Lifecycle"}),(s==="expiring"||s==="expired")&&e.jsxs("p",{className:"v10-pca-card-warn",children:[Y(n.expiresAtTimestamp),". The lock period can’t be extended — Renew creates a fresh replacement account seeded from this one (the old TRAC stays locked until its own expiry)."]}),e.jsx("button",{type:"button",className:`v10-pca-card-btn${s==="expiring"||s==="expired"?" primary":""}`,"data-testid":"pca-renew-btn",onClick:()=>t.openRenew(),disabled:!r.writesEnabled,title:l,children:"Renew — create a replacement PCA"})]}),t.renewOpen&&e.jsx(oe,{seed:{tokens:n.committedTRACTrac,primaryNode:n.primaryNode&&n.primaryNode!=="0"?String(n.primaryNode):void 0,primaryNodeUnknown:n.primaryNode==null},replacingAccountId:a,initialOwnerKey:r.mode==="wallet"?"hardware":"hot",onClose:()=>t.closeRenew(),onApproveOwnWallets:t.onRenewSuccess,onManage:t.onManageNew,onGetSponsored:()=>t.closeRenew()}),t.renewChaining&&e.jsx("div",{className:"lazy-spinner",role:"status","data-testid":"pca-renew-chaining",children:"Preparing re-approval…"}),t.renewApprove&&e.jsx(_,{accountId:t.renewApprove.newAccountId,initialMode:"sponsor",seedBulk:t.renewApprove.seedBulk,deregisterFrom:a,seedAgentsResolved:t.renewApprove.agentsResolved,onClose:()=>t.clearRenewApprove()})]})}function Pe(a){return Y(a).replace(/^Expires in /,"")}function Ee({accountId:a}){var d,j;const{data:n,loading:r,error:l,refresh:s}=S(()=>W(a,void 0,{extended:!0}),[a]),t=(n==null?void 0:n.accountId)===a?n:null,{data:i,error:v,refresh:u}=S(I,[],0),p=X(N=>N.nodeStatus),c=(p==null?void 0:p.blockExplorerUrl)??null,h=$(N=>N.address),o=(i==null?void 0:i.wallets)??[],f=ve(i,v),m=ie({owner:t==null?void 0:t.owner,primaryWallet:o[0],primaryWalletState:f});if(ge(),r&&!t)return e.jsxs("div",{className:"lazy-spinner",children:["Loading PCA #",a,"…"]});if(l||!t)return e.jsx("div",{className:"v10-pca-detail",children:e.jsx("div",{className:"card",children:e.jsxs("div",{className:"card-body v10-pca-card-error",children:[e.jsxs("p",{children:["Couldn’t load PCA #",a,"."]}),e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:()=>s(),children:"Retry"})]})})});const w=o.some(N=>O(N,t.owner)),C=m.ownerUnknownCause==="wallets-loading",b=m.ownerUnknownCause==="wallets-unreadable",x=C?`Confirming ownership of PCA #${a}…`:b?`Couldn't load this node's wallets - can't confirm ownership of PCA #${a}.`:m.mode==="wallet"&&m.wrongNetwork?`Wrong network - switch the connected wallet to this node's PCA network to manage PCA #${a}.`:m.mode==="wallet"?`Connected wallet ${t.owner} owns PCA #${a}; device-signed owner actions are enabled.`:w?`Owner-only - PCA #${a} is owned by ${t.owner}, not this node's primary operational wallet, so node-UI can't sign for it.`:h?`Owner-only - connected as ${h}; switch to ${t.owner} to manage PCA #${a}.`:`Owner-only - connect ${t.owner} to manage PCA #${a}.`;return e.jsx(ke,{accountId:a,snapshot:t,wallets:o,ownerTrac:(j=(d=i==null?void 0:i.balances)==null?void 0:d.find(N=>O(N.address,t.owner)))==null?void 0:j.trac,explorer:c,access:m,connectedWallet:h,ownerOnlyReason:x,walletsLoading:C,walletsUnreadable:b,onRetryWallets:u,refresh:s})}function ke({accountId:a,snapshot:n,wallets:r,ownerTrac:l,explorer:s,access:t,connectedWallet:i,ownerOnlyReason:v,walletsLoading:u,walletsUnreadable:p,onRetryWallets:c,refresh:h}){const o=ce({labels:{idle:"Confirm on your device",approveActive:"Confirm on your device (1 of 2): approve TRAC",approveReady:"Allowance ready — continue to the owner action",actionActive:x=>x==="remove"?"Confirm on your device: remove wallet":"Confirm on your device (2 of 2): top up",submitted:"Waiting for on-chain confirmation",confirmed:"Transaction confirmed on-chain",failed:"Wallet transaction failed"},flow:x=>be(x??"topup"),describeActionError:(x,d)=>q(x,d??"topup")}),f=de({access:t,onWalletProgress:t.mode==="wallet"?o.onProgress:void 0}),m=ee(n),w=t.writesEnabled?void 0:v,C=(n.discountBps/100).toFixed(n.discountBps%100===0?0:1),b=i?t.mode==="wallet"?t.wrongNetwork?"Owner wallet matches; switch network before signing owner actions.":"Connected owner wallet will sign top-up, approve, remove, and renewal actions.":t.mode==="daemon"?"Connected wallet is available for wallet-owned PCAs; this account uses the node daemon for owner actions.":`Connected as ${i}; switch to ${n.owner} to manage owner actions.`:t.mode==="external"?"Connect the PCA owner wallet to manage this account. Provider metadata is display-only.":"Connect a wallet to view and manage wallet-owned PCAs from this tab.";return e.jsxs("div",{className:"v10-pca-detail","data-testid":"pca-detail",children:[e.jsxs("div",{className:"v10-pca-detail-band",children:[e.jsxs("span",{className:"v10-pca-detail-id",children:["PCA #",a]}),e.jsxs("span",{className:"badge badge-info",children:["◉ ",C,"% discount"]}),e.jsxs("span",{className:"v10-pca-detail-committed",children:[P(n.committedTRACTrac)," TRAC committed"]}),e.jsx("span",{className:"v10-pca-card-spacer"}),e.jsx(pe,{state:m})]}),e.jsxs("div",{className:"v10-modal-tip",role:"status",children:[b,i?e.jsx(ue,{}):e.jsx(me,{})]}),o.steps.length>0&&e.jsx(he,{steps:o.steps,currentLabel:o.currentLabel,blockExplorerUrl:s}),!t.writesEnabled&&(u?e.jsx("div",{className:"v10-modal-tip",role:"status",children:v}):e.jsxs("div",{className:"v10-modal-warning",role:"status",children:["ⓘ ",v," ",p?e.jsx("button",{type:"button",className:"v10-pca-card-btn",onClick:c,children:"Retry"}):"Wallet probe stays available."]})),e.jsx(ae,{items:[{id:"buffer",label:"Top-up buffer",value:`${P(n.topUpBufferTrac)} TRAC`},{id:"per-epoch",label:"TRAC per epoch",value:`${ne(n.baseEpochAllowance)} TRAC`},...n.remainingAllowanceTrac!=null?[{id:"remaining",label:"Remaining this epoch",value:`${P(n.remainingAllowanceTrac)} TRAC`,tooltip:n.currentEpoch!=null?`Current epoch ${n.currentEpoch}`:void 0}]:[],{id:"wallets",label:"Publishing wallets",value:`${n.agentCount} / 100`},{id:"expires",label:"Expires in",value:Pe(n.expiresAtTimestamp),tooltip:`Expiry epoch ${n.expiresAtEpoch}`},...n.primaryNode!=null?[{id:"primary-node",label:"Primary node",value:n.primaryNode==="0"?"None set":`Node #${n.primaryNode}`,tooltip:n.lastPrimaryNodeChangeEpoch!=null?`Last changed epoch ${n.lastPrimaryNodeChangeEpoch}`:void 0}]:[]]}),e.jsxs("div",{className:"v10-pca-detail-owner",children:[e.jsx("span",{className:"v10-pca-card-owner-lbl",children:"Owner"}),e.jsx(U,{address:n.owner,trailing:s?e.jsx("a",{className:"v10-pca-card-explorer",href:`${s}/address/${n.owner}`,target:"_blank",rel:"noreferrer","aria-label":"View owner on explorer",children:"↗"}):void 0})]}),e.jsx(ye,{accountId:a,snapshot:n,ownerTrac:l,explorer:s,access:t,ownerTitle:w,owner:f,deviceProgress:o,refresh:h}),e.jsx(Ne,{accountId:a,snapshot:n,wallets:r,explorer:s,access:t,ownerTitle:w,owner:f,deviceProgress:o,refresh:h}),e.jsx(Te,{accountId:a,snapshot:n,access:t,ownerTitle:w,health:m})]})}export{Ee as ConvictionDetailView};
@@ -0,0 +1 @@
1
+ import{aD as r,q as o,p as h,ad as e,L as x,aq as d,V as l}from"./index-DGpnb_b1.js";function j({agent:s}){if(s.connectionStatus==="self")return e.jsx("span",{className:"badge",style:{background:"var(--text-muted)"},children:"Self"});if(s.connectionStatus==="connected"){const n=s.connectionTransport==="relayed"?"Relayed":"Direct",i=s.connectedSinceMs?` · ${l(s.connectedSinceMs)}`:"";return e.jsxs("span",{className:"badge badge-success",title:`${s.connectionDirection??""} ${n.toLowerCase()} connection${i}`,children:[n,i]})}return e.jsx("span",{className:"badge",style:{background:"var(--error)"},children:"Disconnected"})}function v(){const{data:s}=r(o,[],1e4),{data:n}=r(h,[],15e3),i=(s==null?void 0:s.connections)??[],a=(n==null?void 0:n.agents)??[];return e.jsxs("div",{children:[e.jsxs(x,{to:"/",className:"page-back-link",style:{display:"inline-flex",alignItems:"center",gap:6,marginBottom:12,fontSize:13,color:"var(--text-secondary)",textDecoration:"none"},children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("path",{d:"M12 19l-7-7 7-7"})]}),"Back to dashboard"]}),e.jsx("h1",{className:"page-title",children:"Network"}),e.jsxs("div",{className:"stats-grid",children:[e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Total Connections"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.total)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Direct"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.direct)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Relayed"}),e.jsx("div",{className:"stat-value",children:(s==null?void 0:s.relayed)??"—"})]}),e.jsxs("div",{className:"stat-card",children:[e.jsx("div",{className:"stat-label",children:"Known Agents"}),e.jsx("div",{className:"stat-value",children:a.length})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"card-title",children:"Active Connections"}),i.length===0?e.jsxs("div",{className:"empty-state empty-state--compact",children:[e.jsx("div",{className:"empty-state-icon",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"M12 5l7 7-7 7"})]})}),e.jsx("div",{className:"empty-state-title",children:"No active connections"}),e.jsx("div",{className:"empty-state-desc",children:"Connections will appear here as your node links with peers on the network."})]}):e.jsxs("table",{className:"data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Peer"}),e.jsx("th",{children:"Transport"}),e.jsx("th",{children:"Direction"}),e.jsx("th",{children:"Remote Address"}),e.jsx("th",{children:"Duration"})]})}),e.jsx("tbody",{children:i.map((t,c)=>e.jsxs("tr",{children:[e.jsx("td",{className:"mono",children:d(t.peerId,12)}),e.jsx("td",{children:e.jsx("span",{className:`badge ${t.transport==="direct"?"badge-success":"badge-info"}`,children:t.transport})}),e.jsx("td",{children:t.direction}),e.jsx("td",{className:"mono",style:{fontSize:11},children:t.remoteAddr}),e.jsx("td",{children:l(t.durationMs)})]},c))})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"card-title",children:"Discovered Agents"}),a.length===0?e.jsxs("div",{className:"empty-state empty-state--compact",children:[e.jsx("div",{className:"empty-state-icon",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("div",{className:"empty-state-title",children:"No agents discovered"}),e.jsx("div",{className:"empty-state-desc",children:"Agents will be listed here as they are discovered through the network."})]}):e.jsxs("table",{className:"data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Name"}),e.jsx("th",{children:"PeerId"}),e.jsx("th",{children:"Framework"}),e.jsx("th",{children:"Role"}),e.jsx("th",{children:"Connection"})]})}),e.jsx("tbody",{children:a.map((t,c)=>e.jsxs("tr",{children:[e.jsx("td",{style:{fontWeight:600},children:t.name}),e.jsx("td",{className:"mono",children:d(t.peerId,12)}),e.jsx("td",{children:t.framework??"—"}),e.jsx("td",{children:t.nodeRole??"—"}),e.jsx("td",{children:e.jsx(j,{agent:t})})]},c))})]})]})]})}export{v as NetworkPage};
@@ -0,0 +1 @@
1
+ import{ap as h,aC as x,ad as e,aw as r}from"./index-DGpnb_b1.js";import{u as N}from"./index-Bh_8bMB0.js";import"./ordinal-DhEzRPdO.js";const b={wm:"This entity lives in Working Memory — a private local draft. It gets an on-chain anchor only after it is promoted and published to Verifiable Memory.",swm:"This entity lives in Shared Working Memory. It is not anchored on-chain until it is published to Verifiable Memory.",vm:"No on-chain receipt found for this entity yet. It may still be settling, or it was read back from a pre-cutover graph."},I=({contextGraphId:t,layer:a,explorerUrl:l})=>{const{selectedNode:n}=N(),[p,d]=h.useState(null),s=(n==null?void 0:n.id)??null;h.useEffect(()=>{d(null)},[s]);const v=!!s&&s!==p,i=x(t,s,v);if(!v||!n)return null;const o=y=>{var m;(m=navigator.clipboard)==null||m.writeText(y).catch(()=>{})},u=n.label||n.id,c=i.status==="verified";return e.jsxs("div",{className:`v10-graph-prov-card${c?" verified":""}`,role:"dialog","aria-label":"On-chain provenance",children:[e.jsxs("div",{className:"v10-graph-prov-head",children:[e.jsx("span",{className:"v10-graph-prov-glyph",children:c?"◉":"◌"}),e.jsx("span",{className:"v10-graph-prov-title",children:"On-chain provenance"}),c&&e.jsx("span",{className:"v10-graph-prov-badge",children:"VERIFIED"}),e.jsx("button",{type:"button",className:"v10-graph-prov-close",onClick:()=>d(s),"aria-label":"Dismiss",title:"Dismiss",children:"×"})]}),e.jsx("div",{className:"v10-graph-prov-entity",title:n.id,children:u}),i.status==="loading"&&e.jsx("div",{className:"v10-graph-prov-muted",children:"Resolving on-chain identity…"}),i.status==="error"&&e.jsx("div",{className:"v10-graph-prov-muted",children:"Couldn’t load on-chain identity."}),i.status==="offchain"&&e.jsxs("div",{className:"v10-graph-prov-offchain",children:[e.jsx("span",{className:"v10-graph-prov-offchain-tag",children:"Off-chain"}),e.jsx("p",{children:b[a??"vm"]})]}),c&&e.jsxs("div",{className:"v10-vm-identity",style:{margin:0,background:"none",border:"none",padding:0},children:[i.ual&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"UAL"}),e.jsx("span",{className:"v10-vm-identity-val mono",title:i.ual,children:i.ual}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.ual),title:"Copy UAL",children:"⎘"})]}),i.txHash&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Tx"}),l?e.jsxs("a",{className:"v10-vm-identity-val mono v10-graph-prov-link",href:`${l}/tx/${i.txHash}`,target:"_blank",rel:"noopener noreferrer",title:i.txHash,children:[r(i.txHash,10,8)," ↗"]}):e.jsx("span",{className:"v10-vm-identity-val mono",title:i.txHash,children:r(i.txHash,10,8)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.txHash),title:"Copy transaction hash",children:"⎘"})]}),i.blockNumber&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Block"}),e.jsx("span",{className:"v10-vm-identity-val mono",children:j(i.blockNumber)})]}),i.kaId&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"KA id"}),e.jsx("span",{className:"v10-vm-identity-val mono",title:i.kaId,children:r(i.kaId,8,8)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.kaId),title:"Copy KA id",children:"⎘"})]}),i.author&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Author"}),l?e.jsxs("a",{className:"v10-vm-identity-val mono v10-graph-prov-link",href:`${l}/address/${i.author}`,target:"_blank",rel:"noopener noreferrer",title:i.author,children:[r(i.author,6,4)," ↗"]}):e.jsx("span",{className:"v10-vm-identity-val mono",title:i.author,children:r(i.author,6,4)}),e.jsx("button",{type:"button",className:"v10-vm-identity-copy",onClick:()=>o(i.author),title:"Copy author address",children:"⎘"})]}),i.finalizedAt&&e.jsxs("div",{className:"v10-vm-identity-row",children:[e.jsx("span",{className:"v10-vm-identity-lbl",children:"Finalized"}),e.jsx("span",{className:"v10-vm-identity-val",children:f(i.finalizedAt)})]})]})]})};function j(t){const a=Number.parseInt(t,10);return Number.isFinite(a)?a.toLocaleString():t}function f(t){const a=new Date(t.replace(/^"|"$/g,""));return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):t}export{I as OnChainProvenanceCard};