@origintrail-official/dkg-node-ui 10.0.2 → 10.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/dist/chain-cursor-stores.d.ts +45 -0
- package/dist/chain-cursor-stores.d.ts.map +1 -0
- package/dist/chain-cursor-stores.js +107 -0
- package/dist/chain-cursor-stores.js.map +1 -0
- package/dist/chat-memory.d.ts +0 -17
- package/dist/chat-memory.d.ts.map +1 -1
- package/dist/chat-memory.js +6 -33
- package/dist/chat-memory.js.map +1 -1
- package/dist/db.d.ts +15 -0
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +40 -1
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/notifications-scope.d.ts +19 -0
- package/dist/notifications-scope.d.ts.map +1 -1
- package/dist/notifications-scope.js +34 -2
- package/dist/notifications-scope.js.map +1 -1
- package/dist-ui/assets/{3d-force-graph-CcVMtgO4.js → 3d-force-graph-DRDhpplH.js} +1 -1
- package/dist-ui/assets/AgentHub-DdUAxJoy.js +1 -0
- package/dist-ui/assets/AgentProfilePage-yI8fA4vv.js +1 -0
- package/dist-ui/assets/ApproveWalletsModal-9w2edv7e.js +57 -0
- package/dist-ui/assets/ConvictionDetailView-CcQMya-y.js +2 -0
- package/dist-ui/assets/Network-DpAKVzwi.js +1 -0
- package/dist-ui/assets/OnChainProvenanceCard-DMOm3jLz.js +1 -0
- package/dist-ui/assets/{Operations-CCMDENBd.js → Operations-DKJFp6hM.js} +1 -1
- package/dist-ui/assets/PublishingConviction-1CPHxNwp.js +2 -0
- package/dist-ui/assets/Settings-DaYMlGHD.js +1 -0
- package/dist-ui/assets/ccip-hCQYqfNz.js +1 -0
- package/dist-ui/assets/{index-BrxEjqsW.js → index-Bh_8bMB0.js} +3 -3
- package/dist-ui/assets/{index-W4n8cdTA.js → index-CVwCoJrM.js} +10 -10
- package/dist-ui/assets/index-D5UiTYlY.css +1 -0
- package/dist-ui/assets/index-DGpnb_b1.js +1661 -0
- package/dist-ui/assets/{jsonld-32FQRO67-CbN9NJJW.js → jsonld-32FQRO67-C3B_LjZ-.js} +2 -2
- package/dist-ui/assets/{jsonld-DkQdPwg5.js → jsonld-CoPRWQuM.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-CTUExXUn.js → renderer-3d-2EVDZII7-Bx6o7Gge.js} +2 -2
- package/dist-ui/index.html +2 -2
- package/package.json +5 -3
- package/dist-ui/assets/Admin-DNNaF7rz.js +0 -45
- package/dist-ui/assets/AgentHub-eWb_Tns6.js +0 -1
- package/dist-ui/assets/AgentProfilePage-D2T_V6PG.js +0 -1
- package/dist-ui/assets/Network-C6MDsv2e.js +0 -1
- package/dist-ui/assets/OnChainProvenanceCard-BbrU7jzL.js +0 -1
- package/dist-ui/assets/Settings-WaFKYtwQ.js +0 -1
- package/dist-ui/assets/ccip-CDdHldzo.js +0 -1
- package/dist-ui/assets/formatTrac-BTy0WudH.js +0 -1
- package/dist-ui/assets/index-2Gzrk1k3.js +0 -1661
- package/dist-ui/assets/index-CmliV5st.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X as e,P as t}from"./index-2Gzrk1k3.js";function n(){return e.jsxs("div",{className:"page-section",style:{display:"flex",flexDirection:"column",height:"100%",padding:0},children:[e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Agent Hub"}),e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:"Bring your own agent into the node. OpenClaw chat, network peers, and integrated-agent session history live here."})]}),e.jsx("div",{style:{flex:1,minHeight:0,border:"1px solid var(--border)",borderRadius:12,overflow:"hidden",background:"var(--bg)"},children:e.jsx(t,{})})]})}export{n as AgentHubPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ae as w,ak as A,Z as x,X as e,a as N,A as P,aj as C,ad as T,ah as R,am as E,al as $,R as j,c as D,b as M}from"./index-2Gzrk1k3.js";const S="http://www.w3.org/ns/prov#wasAttributedTo",k=[{iri:"http://dkg.io/ontology/decisions/Decision",label:"Decisions"},{iri:"http://dkg.io/ontology/tasks/Task",label:"Tasks"},{iri:"http://dkg.io/ontology/github/PullRequest",label:"Pull Requests"},{iri:"http://dkg.io/ontology/github/Issue",label:"Issues"},{iri:"http://dkg.io/ontology/github/Commit",label:"Commits"}],B=({agentUri:a,entityList:d,onSelectEntity:u,onOpenAgent:r,onBack:b})=>{const o=w(),c=A(),s=(o==null?void 0:o.get(a))??null,p=x.useMemo(()=>{const t=new Map;for(const l of d){if(!l.connections.some(f=>f.predicate===S&&f.targetUri===a))continue;const n=k.find(f=>l.types.includes(f.iri));if(!n)continue;const y=t.get(n.iri)??[];y.push(l),t.set(n.iri,y)}return t},[d,a]),g=x.useMemo(()=>{let t=0;for(const l of p.values())t+=l.length;return t},[p]),m=s!=null&&s.operatorUri?(o==null?void 0:o.get(s.operatorUri))??null:null,[v,h]=x.useState(null);return e.jsxs("div",{className:"v10-agent-profile",children:[e.jsxs("div",{className:"v10-agent-profile-header",children:[e.jsx("button",{type:"button",className:"v10-ka-back",onClick:b,children:"← Back"}),e.jsxs("div",{className:"v10-agent-profile-head",children:[e.jsx(N,{agent:s??void 0,fallbackUri:a,size:"lg",showOperator:!0}),(s==null?void 0:s.reputation)&&e.jsx("div",{className:"v10-agent-profile-reputation",children:s.reputation})]}),e.jsxs("div",{className:"v10-agent-profile-meta",children:[(s==null?void 0:s.walletAddress)&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Wallet"}),e.jsxs("span",{className:"v10-agent-profile-meta-val mono v10-agent-profile-wallet",title:s.walletAddress,children:[s.walletAddress,e.jsx("button",{type:"button",className:"v10-agent-profile-copy",onClick:t=>{var l;t.stopPropagation(),(l=navigator.clipboard)==null||l.writeText(s.walletAddress).catch(()=>{})},title:"Copy wallet address",children:"⎘"})]})]}),e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"URI"}),e.jsx("span",{className:"v10-agent-profile-meta-val mono",children:a})]}),(s==null?void 0:s.peerId)&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Peer ID"}),e.jsx("span",{className:"v10-agent-profile-meta-val mono",children:s.peerId})]}),m&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Driven by"}),e.jsx("span",{className:"v10-agent-profile-meta-val",children:e.jsx(N,{agent:m,size:"sm",onOpenAgent:r})})]}),(s==null?void 0:s.framework)&&e.jsxs("div",{className:"v10-agent-profile-meta-row",children:[e.jsx("span",{className:"v10-agent-profile-meta-lbl",children:"Framework"}),e.jsx("span",{className:"v10-agent-profile-meta-val mono",children:s.framework})]})]})]}),e.jsxs("div",{className:"v10-agent-profile-stats",children:[e.jsxs("button",{type:"button",className:`v10-agent-profile-stat${v===null?" active":""}`,onClick:()=>h(null),children:[e.jsx("span",{className:"v10-agent-profile-stat-val",children:g}),e.jsx("span",{className:"v10-agent-profile-stat-lbl",children:"All activity"})]}),k.map(t=>{const l=p.get(t.iri)??[];if(l.length===0)return null;const i=c==null?void 0:c.forType(t.iri),n=(i==null?void 0:i.color)??"#a855f7";return e.jsxs("button",{type:"button",className:`v10-agent-profile-stat${v===t.iri?" active":""}`,style:{"--stat-color":n},onClick:()=>h(t.iri),children:[e.jsx("span",{className:"v10-agent-profile-stat-val",children:l.length}),e.jsx("span",{className:"v10-agent-profile-stat-lbl",children:i!=null&&i.label?i.label:t.label})]},t.iri)})]}),e.jsx(P,{entities:d,agentUri:a,typeIri:v??void 0,onSelectEntity:u,onOpenAgent:r,title:e.jsxs(e.Fragment,{children:["All activity",s&&e.jsxs("span",{className:"v10-agent-profile-feed-sub",children:[" · authored by ",s.name]})]}),emptyHint:g===0?`${(s==null?void 0:s.name)??a} hasn't authored anything in this project yet.`:"No entries match the current filter."})]})},_=({contextGraphId:a,agentUri:d})=>{const u=C(a),r=T(a),b=R(a),{openTab:o,closeTab:c,activeTabId:s}=E(),{setActiveProject:p}=$(),g=j.useCallback(t=>{p(a),o({id:`project:${a}`,label:u.displayName||a.slice(0,16),closable:!0}),window.dispatchEvent(new CustomEvent("v10:open-entity",{detail:{contextGraphId:a,entityUri:t}}))},[a,o,u.displayName,p]),m=j.useCallback(t=>{var n;const l=t.startsWith("urn:dkg:agent:")?t.slice(14):t,i=((n=r.get(t))==null?void 0:n.name)??l;o({id:`agent:${a}|${l}`,label:`@ ${i}`,closable:!0})},[a,r,o]),v=j.useCallback(()=>{s&&c(s)},[s,c]),h=j.useMemo(()=>({...r,openAgent:m}),[r,m]);return e.jsx(D.Provider,{value:u,children:e.jsx(M.Provider,{value:h,children:e.jsx(B,{agentUri:d,entityList:b.entityList,onSelectEntity:g,onOpenAgent:m,onBack:v})})})};export{_ as AgentProfilePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ag as r,m as o,l as h,X as e,L as x,a5 as d,O as l}from"./index-2Gzrk1k3.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as h,af as x,X as e,aa as r}from"./index-2Gzrk1k3.js";import{u as N}from"./index-BrxEjqsW.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X as e,ag as j,Z as l,a6 as z,Q as E,S as B,H as $,K as W,J as I,R,ac as w,q as L,G as P,ab as C,N as D}from"./index-2Gzrk1k3.js";import{f as H,a as M,b as U}from"./formatTrac-BTy0WudH.js";const k="************",O=/[A-Za-z0-9_-]{16,}/g;function A(a){if(!a)return"";let n;try{n=new URL(a)}catch{return a.replace(O,k)}(n.username||n.password)&&(n.username="",n.password="");const r=n.pathname.split("/").map(t=>t.length<16?t:/^[A-Za-z0-9_-]+$/.test(t)?k:t);if(n.pathname=r.join("/"),n.search){const t=new URLSearchParams(n.search);for(const s of Array.from(t.keys()))/key|token|secret|auth/i.test(s)&&t.set(s,k);n.search=t.toString()}return n.toString()}function x({label:a,value:n,mono:r=!1}){return e.jsxs("div",{style:{marginBottom:14},children:[e.jsx("div",{className:"settings-field-label",children:a}),e.jsx("div",{className:`settings-field-value${r?" mono":""}`,children:n})]})}function F({rpcUrl:a}){const[n,r]=l.useState(!1),t=n?a:A(a);return e.jsxs("div",{style:{marginBottom:14},children:[e.jsxs("div",{className:"settings-field-label",style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{children:"RPC"}),e.jsx("button",{type:"button",onClick:()=>r(s=>!s),style:{background:"none",border:"1px solid var(--border)",color:"var(--text-dim)",cursor:"pointer",fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:4},"aria-label":n?"Redact RPC URL":"Reveal RPC URL",title:n?"Hide the path-token (recommended for screen-shares)":"Show full URL — careful, may contain a tenant secret",children:n?"Redact":"Reveal"})]}),e.jsx("div",{className:"settings-field-value mono",style:{wordBreak:"break-all"},children:t})]})}function q(){const{data:a}=j(I,[],6e4),[n,r]=l.useState(!1),[t,s]=l.useState(!1),[c,h]=l.useState(null),[m,i]=l.useState(!1),u=R.useRef(null),f=R.useRef(null);l.useEffect(()=>{a!=null&&r(a.enabled)},[a]);const g=l.useCallback(()=>{t||(h(null),n?(r(!1),s(!0),w(!1).catch(()=>{r(!0),h("Couldn’t update telemetry — try again.")}).finally(()=>s(!1))):i(!0))},[n,t]),y=l.useCallback(async()=>{var d;i(!1),h(null),r(!0),s(!0);try{await w(!0)}catch{r(!1),h("Couldn’t update telemetry — try again.")}finally{s(!1),(d=f.current)==null||d.focus()}},[]);return l.useEffect(()=>{var v;if(!m)return;const d=(v=u.current)==null?void 0:v.querySelector("button");d==null||d.focus();const o=S=>{var b;S.key==="Escape"&&(i(!1),(b=f.current)==null||b.focus())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[m]),e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Network Telemetry"})}),e.jsxs("div",{className:"card-body",children:[e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginBottom:16,lineHeight:1.6},children:"Local metrics are stored in SQLite and displayed in the Observability page."}),e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"10px 0"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:600},children:"Share telemetry with the network"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:2,lineHeight:1.5},children:"When enabled, metrics and logs are streamed to the OriginTrail network dashboard for network-wide diagnostics."})]}),e.jsx("button",{ref:f,type:"button",role:"switch","aria-checked":n,"aria-busy":t,"aria-disabled":t,"aria-label":"Share telemetry with the network",onClick:g,style:{width:38,height:22,borderRadius:11,border:"none",flexShrink:0,background:n?"var(--green)":"var(--border)",transition:"background .2s",position:"relative",marginLeft:16,cursor:t?"wait":"pointer",opacity:t?.6:1},children:e.jsx("span",{style:{position:"absolute",top:3,left:n?19:3,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left .2s",display:"block"}})})]}),e.jsx("div",{"aria-live":"polite",children:c&&e.jsx("div",{style:{fontSize:11,color:"var(--red)",marginTop:4},children:c})})]}),m&&e.jsx("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,.55)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":"Enable Telemetry Streaming?",style:{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:12,padding:"24px 28px",maxWidth:440,width:"90%",boxShadow:"0 8px 32px rgba(0,0,0,.3)"},children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,marginBottom:16},children:"Enable Telemetry Streaming?"}),e.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.7,marginBottom:12},children:"When enabled, the following data is streamed to the OriginTrail team:"}),e.jsxs("ul",{style:{fontSize:12,color:"var(--text)",lineHeight:1.8,margin:"0 0 14px 18px",padding:0},children:[e.jsx("li",{children:"Operation logs (publish, query, sync, gossip events)"}),e.jsx("li",{children:"Performance metrics (durations, throughput, error rates)"}),e.jsx("li",{children:"Node identity (peer ID, node name, network)"})]}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.7,marginBottom:12},children:["The following data is ",e.jsx("strong",{style:{color:"var(--text)"},children:"NEVER"})," shared via telemetry:"]}),e.jsxs("ul",{style:{fontSize:12,color:"var(--text)",lineHeight:1.8,margin:"0 0 16px 18px",padding:0},children:[e.jsx("li",{children:"Private keys or wallet credentials"}),e.jsx("li",{children:"Authentication tokens or API keys"}),e.jsx("li",{children:"Private triple content or personal data"}),e.jsx("li",{children:"File system paths or environment variables"})]}),e.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:20,lineHeight:1.5},children:"You can disable streaming at any time from this page."}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[e.jsx("button",{type:"button",onClick:()=>{var d;i(!1),(d=f.current)==null||d.focus()},style:{padding:"7px 18px",borderRadius:7,fontSize:12,fontWeight:600,cursor:"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:"var(--text-muted)"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:y,style:{padding:"7px 18px",borderRadius:7,fontSize:12,fontWeight:700,cursor:"pointer",border:"1px solid rgba(74,222,128,.4)",background:"rgba(74,222,128,.1)",color:"var(--green)"},children:"Enable Streaming"})]})]})})]})}function _(){const{data:a}=j(L,[],3e4),{data:n}=j(P,[],6e4),[r,t]=l.useState(90),[s,c]=l.useState(!1),[h,m]=l.useState(null),[i,u]=l.useState(null),f=R.useRef(null);l.useEffect(()=>{n!=null&&n.retentionDays&&t(n.retentionDays)},[n]),l.useEffect(()=>{var o;i!=null&&((o=f.current)==null||o.focus())},[i]);const g=l.useCallback(async()=>{if(i==null)return;const o=i;c(!1),m(null),u(null);try{await C(o),t(o),c(!0),setTimeout(()=>c(!1),2e3)}catch{m("Couldn’t save retention — try again.")}},[i]),y=l.useCallback(o=>{m(null),o<r?(c(!1),u(o)):(c(!1),u(null),C(o).then(()=>{t(o),c(!0),setTimeout(()=>c(!1),2e3)}).catch(()=>m("Couldn’t save retention — try again.")))},[r]),d=(a==null?void 0:a.store_bytes)??null;return e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Local Data Retention"})}),e.jsxs("div",{className:"card-body",children:[e.jsx("label",{htmlFor:"retention-select",className:"settings-field-label",style:{display:"block",marginBottom:5},children:"Keep local data for"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("select",{id:"retention-select",className:"input",value:i??r,onChange:o=>y(Number(o.target.value)),style:{width:160},children:[e.jsx("option",{value:7,children:"7 days"}),e.jsx("option",{value:30,children:"30 days"}),e.jsx("option",{value:90,children:"90 days"}),e.jsx("option",{value:180,children:"180 days"}),e.jsx("option",{value:365,children:"365 days"})]}),e.jsx("span",{"aria-live":"polite",children:s&&e.jsx("span",{style:{fontSize:10,color:"var(--green)",fontWeight:600},children:"Saved"})}),d!=null&&e.jsxs("span",{className:"mono",style:{fontSize:10,color:"var(--text-dim)"},children:["Store: ",D(d)]})]}),i!=null&&e.jsxs("div",{role:"group","aria-label":"Confirm retention reduction",style:{marginTop:8,padding:"10px 14px",borderRadius:8,background:"rgba(251,191,36,.06)",border:"1px solid rgba(251,191,36,.2)"},children:[e.jsxs("div",{style:{fontSize:11,color:"var(--amber)",fontWeight:600,marginBottom:4},children:["Reduce retention to ",i," days?"]}),e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",lineHeight:1.5,marginBottom:8},children:["Operations, logs, and metrics older than ",i," days will be permanently deleted."]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{ref:f,type:"button",onClick:g,style:{padding:"5px 14px",borderRadius:6,fontSize:11,fontWeight:700,cursor:"pointer",border:"1px solid rgba(251,191,36,.4)",background:"rgba(251,191,36,.1)",color:"var(--amber)"},children:"Prune & Save"}),e.jsx("button",{type:"button",onClick:()=>u(null),style:{padding:"5px 14px",borderRadius:6,fontSize:11,fontWeight:600,cursor:"pointer",border:"1px solid var(--border)",background:"var(--surface)",color:"var(--text-muted)"},children:"Cancel"})]})]}),i==null&&e.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:4},children:"Operations, logs, and metric snapshots older than this are pruned automatically."}),e.jsx("div",{"aria-live":"polite",children:h&&e.jsx("div",{style:{fontSize:11,color:"var(--red)",marginTop:4},children:h})})]})]})}function K(a){const n=Math.floor(a/1e3);if(n<60)return`${n}s`;const r=Math.floor(n/60);if(r<60)return`${r}m ${n%60}s`;const t=Math.floor(r/60);return t<24?`${t}h ${r%60}m`:`${Math.floor(t/24)}d ${t%24}h`}function Z(a){return a.length<=12?a:`${a.slice(0,6)}…${a.slice(-4)}`}function G(a){if(!a)return"Unknown";const n=a.includes(":")?a.split(":")[1]:a;switch(n){case"84532":return"Base Sepolia (Testnet)";case"8453":return"Base (Mainnet)";case"1":return"Ethereum Mainnet";case"11155111":return"Sepolia (Testnet)";case"31337":return"Local (Hardhat)";default:return`Chain ${n}`}}function X(){return e.jsxs("div",{className:"page-section",children:[e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("h1",{className:"page-title",style:{marginBottom:0},children:"Settings"}),e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:"Node configuration and preferences"})]}),e.jsx(Q,{})]})}function Q(){var g,y,d,o,v,S,b,N;const{data:a}=j($,[],3e4),{data:n}=j(W,[],6e4),r=a,t=n,[s,c]=l.useState(!1),[h,m]=l.useState(!1),i=(r==null?void 0:r.connectedPeers)??0,u=(r==null?void 0:r.peerId)!=null,f=l.useCallback(async()=>{if(!s){c(!0),setTimeout(()=>c(!1),5e3);return}m(!0);try{await z()}catch{m(!1),c(!1)}},[s]);return e.jsxs("div",{className:"settings-stack",children:[e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Node Identity"})}),e.jsxs("div",{className:"card-body",children:[e.jsx(x,{label:"Name",value:(r==null?void 0:r.name)??"—"}),e.jsx(x,{label:"Peer ID",value:(r==null?void 0:r.peerId)??"—",mono:!0}),e.jsx(x,{label:"Role",value:(r==null?void 0:r.nodeRole)??"—"}),e.jsx(x,{label:"Network",value:(r==null?void 0:r.networkName)??(r!=null&&r.networkId?`Network ${r.networkId}`:"—")}),e.jsx(x,{label:"Store",value:(r==null?void 0:r.storeBackend)??"—",mono:!0}),e.jsxs("div",{style:{padding:"10px 14px",borderRadius:8,background:u?"var(--green-dim)":"rgba(248,113,113,.05)",border:`1px solid ${u?"rgba(74,222,128,.2)":"rgba(248,113,113,.2)"}`},children:[e.jsx("div",{className:"mono",style:{fontSize:10,color:u?"var(--green)":"var(--red)",fontWeight:700},children:u?"● ONLINE":"● OFFLINE"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},title:"Peers = unique remote nodes. Direct + Relayed counts are libp2p connections — a single peer can hold both a direct and a relayed link, so they sum to ≥ Peers, not exactly equal to it.",children:u?`${i} peer${i!==1?"s":""} · ${((g=r==null?void 0:r.connections)==null?void 0:g.direct)??0} direct, ${((y=r==null?void 0:r.connections)==null?void 0:y.relayed)??0} relayed link${(((d=r==null?void 0:r.connections)==null?void 0:d.relayed)??0)===1?"":"s"} · up ${K((r==null?void 0:r.uptimeMs)??0)}`:"Node is not responding"})]})]})]}),e.jsxs("section",{className:"card",children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",children:"Blockchain Config"})}),e.jsxs("div",{className:"card-body",children:[e.jsx(x,{label:"Chain",value:G(t==null?void 0:t.chainId)}),((o=t==null?void 0:t.balances)==null?void 0:o.length)>0?t.balances.map((p,T)=>e.jsxs("div",{style:{marginBottom:10},children:[e.jsx(x,{label:t.balances.length>1?`Wallet ${T+1}`:"Operational Wallet",value:p.address,mono:!0}),e.jsxs("div",{style:{display:"flex",gap:16,marginTop:-6},children:[e.jsxs("span",{className:"mono",style:{fontSize:11,color:"var(--text-muted)"},title:B(p.eth),children:[E(p.eth)," ETH"]}),e.jsxs("span",{className:"mono",style:{fontSize:11,color:"var(--text-muted)"},title:U(p.trac),children:[H(p.trac)," ",M(p.symbol,t==null?void 0:t.chainId)]})]})]},p.address)):e.jsx(x,{label:"Operational Wallet",value:(v=t==null?void 0:t.wallets)!=null&&v[0]?Z(t.wallets[0]):"—",mono:!0}),(t==null?void 0:t.rpcUrl)&&e.jsx(F,{rpcUrl:t.rpcUrl}),t!=null&&t.error?e.jsxs("div",{style:{padding:"8px 12px",borderRadius:8,background:"rgba(248,113,113,.05)",border:"1px solid rgba(248,113,113,.2)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--red)",marginBottom:2},children:"⚠ Error"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)"},children:t.error})]}):(S=t==null?void 0:t.chainId)!=null&&S.includes("84532")||(b=t==null?void 0:t.chainId)!=null&&b.includes("31337")||(N=t==null?void 0:t.chainId)!=null&&N.includes("11155111")?e.jsxs("div",{style:{padding:"8px 12px",borderRadius:8,background:"var(--amber-dim)",border:"1px solid rgba(251,191,36,.2)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--amber)",marginBottom:2},children:"⚠ Testnet Mode"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)"},children:"No real TRAC is spent. Perfect for development."})]}):null]})]}),e.jsx(q,{}),e.jsx(_,{}),e.jsxs("section",{className:"card",style:{borderColor:"rgba(248,113,113,.2)",background:"rgba(248,113,113,.03)"},children:[e.jsx("div",{className:"card-header",children:e.jsx("h2",{className:"card-title",style:{color:"var(--red)"},children:"Danger Zone"})}),e.jsx("div",{className:"card-body",children:e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[e.jsx("button",{onClick:f,disabled:h,style:{padding:"8px 16px",borderRadius:8,border:`1px solid ${s?"var(--red)":"rgba(251,191,36,.3)"}`,background:s?"rgba(248,113,113,.15)":"rgba(251,191,36,.07)",color:s?"var(--red)":"var(--amber)",fontSize:12,fontWeight:600,cursor:h?"not-allowed":"pointer",opacity:h?.5:1},children:h?"Shutting down…":s?"Confirm Shutdown":"Shutdown Node"}),e.jsx("span",{"aria-live":"polite",children:s&&e.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:"Click again to confirm. The node process will terminate."})})]})})]})]})}export{X as SettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as u,b,s as k,d as R,f as M,j as S,l as $,c as A,a as T,e as C,g as w,i as E,H as p,h as G}from"./Admin-DNNaF7rz.js";import"./index-2Gzrk1k3.js";import"./formatTrac-BTy0WudH.js";class D extends u{constructor({callbackSelector:a,cause:t,data:f,extraData:e,sender:l,urls:i}){var o;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(o=t.metaMessages)!=null&&o.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(n=>` ${b(n)}`)],` Sender: ${l}`,` Data: ${f}`,` Callback selector: ${a}`,` Extra data: ${e}`].flat(),name:"OffchainLookupError"})}}class j extends u{constructor({result:a,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${b(t)}`,`Response: ${k(a)}`],name:"OffchainLookupResponseMalformedError"})}}class B extends u{constructor({sender:a,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${a}`],name:"OffchainLookupSenderMismatchError"})}}const F="0x556f1830",P={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function I(c,{blockNumber:a,blockTag:t,data:f,requestOptions:e,to:l}){var s;const{args:i}=R({data:f,abi:[P]}),[o,n,d,m,g]=i,{ccipRead:h}=c,r=h&&typeof(h==null?void 0:h.request)=="function"?h.request:U;try{if(!M(l,o))throw new B({sender:o,to:l});const y=n.includes(S)?await $({data:d,ccipRequest:x=>r({...x,requestOptions:e})}):await r({data:d,requestOptions:e,sender:o,urls:n}),{data:L}=await A(c,{blockNumber:a,blockTag:t,data:T([m,C([{type:"bytes"},{type:"bytes"}],[y,g])]),requestOptions:e,to:l});return L}catch(y){throw(s=e==null?void 0:e.signal)!=null&&s.aborted?w(e.signal):E(y)?y:new D({callbackSelector:m,cause:y,data:f,extraData:g,sender:o,urls:n})}}async function U({data:c,requestOptions:a,sender:t,urls:f}){var l,i,o;let e=new Error("An unknown error occurred.");for(let n=0;n<f.length;n++){if((l=a==null?void 0:a.signal)!=null&&l.aborted)throw w(a.signal);const d=f[n],m=d.includes("{data}")?"GET":"POST",g=m==="POST"?{data:c,sender:t}:void 0,h=m==="POST"?{"Content-Type":"application/json"}:{};try{const r=await fetch(d.replace("{sender}",t.toLowerCase()).replace("{data}",c),{body:JSON.stringify(g),headers:h,method:m,...a!=null&&a.signal?{signal:a.signal}:{}});let s;if((i=r.headers.get("Content-Type"))!=null&&i.startsWith("application/json")?s=(await r.json()).data:s=await r.text(),!r.ok){e=new p({body:g,details:s!=null&&s.error?k(s.error):r.statusText,headers:r.headers,status:r.status,url:d});continue}if(!G(s)){e=new j({result:s,url:d});continue}return s}catch(r){if((o=a==null?void 0:a.signal)!=null&&o.aborted)throw w(a.signal);if(E(r))throw r;e=new p({body:g,details:r.message,url:d})}}throw e}export{U as ccipRequest,I as offchainLookup,P as offchainLookupAbiItem,F as offchainLookupSignature};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(r,n){const t=(r??"").trim();if(!t)return"TRAC";const e=(n??"").includes(":")?(n??"").split(":")[1]:n??"";return e==="84532"||e==="11155111"||e==="31337"||e==="10200"||e==="20430"?/test/i.test(t)?t:`${t} (testnet)`:t}function i(r,n=2){if(r==null)return"—";let t;if(typeof r=="number")t=r;else{const e=String(r).trim();if(!/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(e))return"—";t=Number(e)}return Number.isFinite(t)?t.toFixed(n):"—"}function f(r){if(i(r)!=="—")return`Exact: ${r}`}export{o as a,f as b,i as f};
|