@origintrail-official/dkg-node-ui 10.0.24 → 10.0.25
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-ui/assets/ActivityFeed-vyl2XdLo.js +99 -0
- package/dist-ui/assets/{AgentHub-BO9jGbJl.js → AgentHub-CYfAoOWF.js} +1 -1
- package/dist-ui/assets/AgentProfilePage-BjQm0je4.js +1 -0
- package/dist-ui/assets/{ApproveWalletsModal-C2Tu29tB.js → ApproveWalletsModal-CzWJ4KyU.js} +3 -3
- package/dist-ui/assets/{ContextGraphPrimitives-BqlTIZHy.js → ContextGraphPrimitives-ecppTns4.js} +1 -1
- package/dist-ui/assets/{ConvictionDetailView-J-DAKHtP.js → ConvictionDetailView-CuLUhbzR.js} +2 -2
- package/dist-ui/assets/MemoryLayerView-Dymg_Zf_.js +2 -0
- package/dist-ui/assets/MemoryReadStatus-D4HXCImC.js +1 -0
- package/dist-ui/assets/MemoryStackView-Bq8Fbh5W.js +1 -0
- package/dist-ui/assets/{Network-DV9K48MH.js → Network-F76S9_1V.js} +1 -1
- package/dist-ui/assets/{OnChainProvenanceCard-jxk66g53.js → OnChainProvenanceCard-CCwK3sRG.js} +1 -1
- package/dist-ui/assets/{Operations-CNB1BMYg.js → Operations-aVCBUh8u.js} +1 -1
- package/dist-ui/assets/ProjectView-Cb1PQ-jm.js +290 -0
- package/dist-ui/assets/{PublishingConviction-DbP1i3v0.js → PublishingConviction-BnAJjHL8.js} +2 -2
- package/dist-ui/assets/{Settings-I6g3MQCV.js → Settings-rEyPw1oS.js} +1 -1
- package/dist-ui/assets/{browserWalletTransaction-CXv612Pn.js → browserWalletTransaction-BJBFRjXx.js} +3 -3
- package/dist-ui/assets/{ccip-DY93ay8e.js → ccip-DYOqJfs7.js} +1 -1
- package/dist-ui/assets/{index-CIt7zWgM.css → index-CAdbSAQK.css} +1 -1
- package/dist-ui/assets/index-HEpqHVfE.js +1143 -0
- package/dist-ui/assets/index-_vQ99L0s.js +192 -0
- package/dist-ui/assets/{jsonld-32FQRO67-DKLfQ_nD.js → jsonld-32FQRO67-DVqZhSL_.js} +2 -2
- package/dist-ui/assets/{jsonld-BgpgXlDQ.js → jsonld-Dpm03cay.js} +1 -1
- package/dist-ui/assets/renderer-3d-IRPVRQWX-DjW_h88e.js +5126 -0
- package/dist-ui/assets/{shikiHighlighter-BXl6qMQO.js → shikiHighlighter-DL7LOds2.js} +4 -4
- package/dist-ui/assets/truncate-BWdqLeqV.js +22 -0
- package/dist-ui/assets/{useEntityOnChainReceipt-CUGQNIsP.js → useEntityOnChainReceipt-B_uLyqZc.js} +5 -5
- package/dist-ui/index.html +2 -2
- package/package.json +4 -4
- package/dist-ui/assets/3d-force-graph-DvzZZzFn.js +0 -1015
- package/dist-ui/assets/ActivityFeed-B5QxV1dk.js +0 -99
- package/dist-ui/assets/AgentProfilePage-DJJTn1WD.js +0 -1
- package/dist-ui/assets/MemoryLayerView-BOxI-_TF.js +0 -2
- package/dist-ui/assets/MemoryStackView-BTyZZKNm.js +0 -1
- package/dist-ui/assets/ProjectView-BP4vNSXI.js +0 -290
- package/dist-ui/assets/index-CumB6j2m.js +0 -192
- package/dist-ui/assets/index-DW3dBcQk.js +0 -1175
- package/dist-ui/assets/renderer-3d-2EVDZII7-BCmzI8Ii.js +0 -2
- package/dist-ui/assets/three.module-BXIk8GZS.js +0 -4112
- package/dist-ui/assets/truncate-BaiMkAOo.js +0 -1
- package/dist-ui/assets/useProjectActivity-BOgGdtS7.js +0 -1
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
var Ke=Object.defineProperty;var Je=(e,t,r)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var w=(e,t,r)=>Je(e,typeof t!="symbol"?t+"":t,r);import{aM as et,bn as ke,bb as tt,be as f,R as Z,O as Oe,bf as rt,aP as d}from"./index-DW3dBcQk.js";import{u as at,b as nt,r as st}from"./useProjectActivity-BOgGdtS7.js";function ot(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function le(e,t,r=""){const o=ot(e),a=e==null?void 0:e.length;if(!o||t!==void 0){const i=r&&`"${r}" `,s="",u=o?`length=${a}`:`type=${typeof e}`,p=i+"expected Uint8Array"+s+", got "+u;throw o?new RangeError(p):new TypeError(p)}return e}function be(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function it(e,t){le(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function ce(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function se(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function C(e,t){return e<<32-t|e>>>t}const ct=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",lt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ut(e){if(le(e),ct)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=lt[e[r]];return t}function pt(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function dt(e,t={}){const r=(a,n)=>e(n).update(a).digest(),o=e(void 0);return r.outputLen=o.outputLen,r.blockLen=o.blockLen,r.canXOF=o.canXOF,r.create=a=>e(a),Object.assign(r,t),Object.freeze(r)}const ft=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function ht(e,t,r){return e&t^~e&r}function mt(e,t,r){return e&t^e&r^t&r}class gt{constructor(t,r,o,a){w(this,"blockLen");w(this,"outputLen");w(this,"canXOF",!1);w(this,"padOffset");w(this,"isLE");w(this,"buffer");w(this,"view");w(this,"finished",!1);w(this,"length",0);w(this,"pos",0);w(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=o,this.isLE=a,this.buffer=new Uint8Array(t),this.view=se(this.buffer)}update(t){be(this),le(t);const{view:r,buffer:o,blockLen:a}=this,n=t.length;for(let i=0;i<n;){const s=Math.min(a-this.pos,n-i);if(s===a){const u=se(t);for(;a<=n-i;i+=a)this.process(u,i);continue}o.set(t.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===a&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){be(this),it(t,this),this.finished=!0;const{buffer:r,view:o,blockLen:a,isLE:n}=this;let{pos:i}=this;r[i++]=128,ce(this.buffer.subarray(i)),this.padOffset>a-i&&(this.process(o,0),i=0);for(let l=i;l<a;l++)r[l]=0;o.setBigUint64(a-8,BigInt(this.length*8),n),this.process(o,0);const s=se(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const p=u/4,h=this.get();if(p>h.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<p;l++)s.setUint32(4*l,h[l],n)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const o=t.slice(0,r);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:o,length:a,finished:n,destroyed:i,pos:s}=this;return t.destroyed=i,t.finished=n,t.length=a,t.pos=s,a%r&&t.buffer.set(o),t}clone(){return this._cloneInto()}}const I=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bt=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),L=new Uint32Array(64);class yt extends gt{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:r,C:o,D:a,E:n,F:i,G:s,H:u}=this;return[t,r,o,a,n,i,s,u]}set(t,r,o,a,n,i,s,u){this.A=t|0,this.B=r|0,this.C=o|0,this.D=a|0,this.E=n|0,this.F=i|0,this.G=s|0,this.H=u|0}process(t,r){for(let l=0;l<16;l++,r+=4)L[l]=t.getUint32(r,!1);for(let l=16;l<64;l++){const b=L[l-15],g=L[l-2],S=C(b,7)^C(b,18)^b>>>3,v=C(g,17)^C(g,19)^g>>>10;L[l]=v+L[l-7]+S+L[l-16]|0}let{A:o,B:a,C:n,D:i,E:s,F:u,G:p,H:h}=this;for(let l=0;l<64;l++){const b=C(s,6)^C(s,11)^C(s,25),g=h+b+ht(s,u,p)+bt[l]+L[l]|0,v=(C(o,2)^C(o,13)^C(o,22))+mt(o,a,n)|0;h=p,p=u,u=s,s=i+g|0,i=n,n=a,a=o,o=g+v|0}o=o+this.A|0,a=a+this.B|0,n=n+this.C|0,i=i+this.D|0,s=s+this.E|0,u=u+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(o,a,n,i,s,u,p,h)}roundClean(){ce(L)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ce(this.buffer)}}class wt extends yt{constructor(){super(32);w(this,"A",I[0]|0);w(this,"B",I[1]|0);w(this,"C",I[2]|0);w(this,"D",I[3]|0);w(this,"E",I[4]|0);w(this,"F",I[5]|0);w(this,"G",I[6]|0);w(this,"H",I[7]|0)}}const vt=dt(()=>new wt,ft(1));var A;(function(e){e.WorkingMemory="WM",e.SharedWorkingMemory="SWM",e.VerifiableMemory="VM"})(A||(A={}));function oe(e){switch(e){case A.WorkingMemory:return"_working_memory";case A.SharedWorkingMemory:return"_shared_memory";case A.VerifiableMemory:return"_verifiable_memory"}}var ye;(function(e){e[e.SelfAttested=0]="SelfAttested",e[e.Endorsed=1]="Endorsed",e[e.PartiallyVerified=2]="PartiallyVerified",e[e.ConsensusVerified=3]="ConsensusVerified"})(ye||(ye={}));var we;(function(e){e.CREATE="CREATE",e.UPDATE="UPDATE"})(we||(we={}));A.WorkingMemory,A.SharedWorkingMemory,A.VerifiableMemory,A.VerifiableMemory;A.WorkingMemory,A.SharedWorkingMemory,A.SharedWorkingMemory,A.VerifiableMemory;const At=["working-memory","shared-working-memory","verifiable-memory"],St=(1n<<72n)-1n;St.toString();oe(A.WorkingMemory),A.WorkingMemory,oe(A.SharedWorkingMemory),A.SharedWorkingMemory,oe(A.VerifiableMemory),A.VerifiableMemory;function $e(e,t){return`did:dkg:context-graph:${e}/${t}`}function Ie(e){return!e||e.length===0?{valid:!1,reason:"Sub-graph name cannot be empty"}:e.startsWith("_")?{valid:!1,reason:'Sub-graph names starting with "_" are reserved for protocol graphs'}:e.includes("/")?{valid:!1,reason:'Sub-graph names cannot contain "/"'}:/[<>"{}|^`\\\s]/.test(e)?{valid:!1,reason:"Sub-graph name contains characters unsafe for IRIs"}:e==="context"||e==="assertion"||e==="draft"?{valid:!1,reason:`"${e}" is a reserved path segment`}:{valid:!0}}const Et=["string","integer","number","boolean","iri"],xt=/^[A-Za-z][A-Za-z0-9_]*$/,Ct=/^[+-]?\d+$/,Nt=/^[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d+)?$/;function F(e){if(e==null||e==="")return[];if(!Array.isArray(e))throw new Error("Query parameters must be an array.");const t=new Set;return e.map((r,o)=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`Query parameter at index ${o} must be an object.`);const a=r,n=typeof a.name=="string"?a.name.trim():"";if(!xt.test(n))throw new Error(`Query parameter at index ${o} has an invalid name: ${n||"<empty>"}.`);if(t.has(n))throw new Error(`Duplicate query parameter: ${n}.`);t.add(n);const i=a.type;if(typeof i!="string"||!Et.includes(i))throw new Error(`Query parameter ${n} has an unsupported type: ${String(i)}.`);const s={name:n,type:i};typeof a.label=="string"&&a.label.trim()&&(s.label=a.label.trim()),typeof a.description=="string"&&a.description.trim()&&(s.description=a.description.trim());let u;if(a.required!==void 0){if(typeof a.required!="boolean")throw new Error(`Query parameter ${n} required must be a boolean.`);u=a.required}const p=a.defaultValue!==void 0;if(p){if(!je(a.defaultValue))throw new Error(`Query parameter ${n} has an invalid defaultValue.`);Te(s,a.defaultValue),s.defaultValue=a.defaultValue}if(u===!0&&p)throw new Error(`Required query parameter ${n} cannot declare a defaultValue.`);if(u===!1&&!p)throw new Error(`Optional query parameter ${n} must declare a defaultValue.`);return s})}function hr(e){return e.defaultValue===void 0}function Pt(e){return JSON.stringify(F(e))}function Rt(e){const t=[];for(const r of _e(e))t.includes(r.name)||t.push(r.name);return t}function Le(e,t){const r=F(t),o=new Set(r.map(n=>n.name)),a=new Set(Rt(e));for(const n of a)if(!o.has(n))throw new Error(`SPARQL template uses undeclared query parameter: ${n}.`);for(const n of r)if(!a.has(n.name))throw new Error(`Query parameter ${n.name} is not used by the SPARQL template.`)}function kt(e,t,r){const o=F(t);Le(e,o);const a=new Set(o.map(p=>p.name));for(const p of Object.keys(r))if(!a.has(p))throw new Error(`Unknown query parameter: ${p}.`);const n=new Map;for(const p of o){const h=r[p.name],l=ve(h)?p.defaultValue:h;if(ve(l))throw new Error(`Missing required query parameter: ${p.name}.`);if(!je(l))throw new Error(`Query parameter ${p.name} must be a string, number, or boolean.`);n.set(p.name,Te(p,l))}const i=_e(e);let s="",u=0;for(const p of i)s+=e.slice(u,p.start),s+=n.get(p.name),u=p.end;return s+e.slice(u)}function Te(e,t){switch(e.type){case"string":return ke(String(t));case"integer":{const r=String(t).trim();if(!Ct.test(r))throw new Error(`Query parameter ${e.name} must be an integer.`);return r}case"number":{const r=String(t).trim();if(!Nt.test(r))throw new Error(`Query parameter ${e.name} must be a number.`);return r}case"boolean":{if(t===!0||t==="true")return"true";if(t===!1||t==="false")return"false";throw new Error(`Query parameter ${e.name} must be true or false.`)}case"iri":{const r=String(t).trim();if(!et(r))throw new Error(`Query parameter ${e.name} must be a safe absolute IRI.`);return`<${r}>`}}}function je(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ve(e){return e==null}function _e(e){const t=[...e.matchAll(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g)],r=e.replace(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g,n=>"0".repeat(n.length)),o=tt(r);if(o.status!=="valid")throw new Error("SPARQL template contains invalid lexical syntax.");const a=[];for(const n of t){const i=n.index;if(o.masked[i]===" ")continue;const s=i+n[0].length,u=e[i-1],p=e[s];if(u&&/[A-Za-z0-9_?:.%~-]/.test(u)||p&&/[A-Za-z0-9_?:.%~-]/.test(p))throw new Error(`Query parameter ${n[1]} must occupy a complete SPARQL term position.`);a.push({name:n[1],start:i,end:s})}return a}const Ot=2,ue="__context_graph",mr="ui-saved-queries",gr="Saved queries",E="http://dkg.io/ontology/profile/",Ae="http://schema.org/",Se="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",$t="http://www.w3.org/2001/XMLSchema#integer";class k extends Error{constructor(r="Incompatible query-catalog daemon contract. Upgrade the daemon and retry."){super(r);w(this,"code","QUERY_CATALOG_CONTRACT_INCOMPATIBLE");this.name="QueryCatalogContractError"}}function It(e,t){if(t===ue)return`did:dkg:context-graph:${e}`;const r=Ie(t);if(!r.valid)throw new Error(`Invalid query-catalog subgraph "${t}": ${r.reason}`);return $e(e,t)}function Lt(e,t){const r=`did:dkg:context-graph:${e}`;if(t===r)return ue;const o=`${r}/`;if(!t.startsWith(o))throw new Error(`Query-catalog scope graph <${t}> is outside context graph "${e}".`);const a=t.slice(o.length),n=Ie(a);if(!n.valid)throw new Error(`Invalid query-catalog scope graph <${t}>: ${n.reason}`);if($e(e,a)!==t)throw new Error(`Query-catalog scope graph <${t}> is not a canonical subgraph IRI.`);return a}function br(e,t={}){return{sparql:kt(e.sparql,e.parameters,t),...e.view?{view:e.view}:{},...e.subGraph&&e.subGraph!==ue?{subGraphName:e.subGraph}:{}}}function Tt(e){return At.includes(e)?e:void 0}function jt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new k;const t=e,r=t.capabilities;if(t.schemaVersion!==Ot||(r==null?void 0:r.canonicalItems)!==!0||(r==null?void 0:r.queryParameters)!==!0||(r==null?void 0:r.executionView)!==!0||(r==null?void 0:r.graphScopeIri)!==!0||!Array.isArray(t.items))throw new k;return t.items.map((o,a)=>{if(!o||typeof o!="object"||Array.isArray(o))throw new k(`Invalid query-catalog item at index ${a}.`);const n=o,i=["queryIri","catalogIri","slug","name","sparql","catalogSlug","catalogName","subGraph","scopeGraph"];for(const l of i)if(typeof n[l]!="string")throw new k(`Invalid query-catalog item ${a}: ${l} must be a string.`);if(typeof n.rank!="number"||!Number.isFinite(n.rank)||typeof n.catalogRank!="number"||!Number.isFinite(n.catalogRank))throw new k(`Invalid query-catalog item ${a}: ranks must be finite numbers.`);const s=n.view===void 0?void 0:Tt(String(n.view));if(n.view!==void 0&&s===void 0)throw new k(`Invalid query-catalog item ${a}: unsupported execution view.`);const u=n.scopeGraph,p=typeof t.contextGraphId=="string"?t.contextGraphId:void 0;if(!p)throw new k("Invalid query-catalog response: contextGraphId must be a string.");let h;try{h=Lt(p,u)}catch(l){throw new k(`Invalid query-catalog item ${a}: ${l instanceof Error?l.message:String(l)}`)}if(h!==n.subGraph)throw new k(`Invalid query-catalog item ${a}: scopeGraph and subGraph do not match.`);return{queryIri:n.queryIri,catalogIri:n.catalogIri,slug:n.slug,name:n.name,...typeof n.description=="string"?{description:n.description}:{},sparql:n.sparql,...typeof n.resultColumn=="string"?{resultColumn:n.resultColumn}:{},rank:n.rank,catalogSlug:n.catalogSlug,catalogName:n.catalogName,...typeof n.catalogDescription=="string"?{catalogDescription:n.catalogDescription}:{},catalogRank:n.catalogRank,subGraph:n.subGraph,scopeGraph:u,parameters:F(n.parameters),...s?{view:s}:{}}})}function _t(e){const t=new Map;for(const r of e){const o=`${r.subGraph}|${r.catalogSlug}`,a=t.get(o);if(a){if(a.name!==r.catalogName||a.description!==r.catalogDescription||a.rank!==r.catalogRank)throw new Error(`Query catalog ${r.catalogSlug} has conflicting metadata.`);a.queries.push(r);continue}t.set(o,{slug:r.catalogSlug,subGraph:r.subGraph,name:r.catalogName,description:r.catalogDescription,rank:r.catalogRank,queries:[r]})}return[...t.values()].map(r=>({...r,queries:[...r.queries].sort((o,a)=>o.rank-a.rank||o.name.localeCompare(a.name))})).sort((r,o)=>r.subGraph.localeCompare(o.subGraph)||r.rank-o.rank||r.name.localeCompare(o.name))}function Mt(e){return e.trim().toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"saved-query"}function Ee(e,t,r){return`urn:dkg:profile:${encodeURIComponent(e)}:${t}:${encodeURIComponent(r)}`}function Gt(e){return ut(vt(pt(e)))}function N(e){return JSON.stringify(e)}function xe(e){return`"${e}"^^<${$t}>`}function yr(e){const t=F(e.parameters),r=JSON.stringify({subGraph:e.subGraph,catalogSlug:e.catalogSlug,name:e.name,description:e.description,sparql:e.sparql,resultColumn:e.resultColumn,rank:e.rank,parameters:t,view:e.view}),o=`${Mt(e.name)}-${Gt(r)}`,a=Ee(e.contextGraphId,"catalog",e.catalogSlug),n=Ee(e.contextGraphId,"query",o),i=It(e.contextGraphId,e.subGraph);Le(e.sparql,t);const s=[{subject:a,predicate:Se,object:`${E}QueryCatalog`,graph:""},{subject:a,predicate:`${E}scopeGraph`,object:i,graph:""},{subject:a,predicate:`${E}forSubGraph`,object:N(e.subGraph),graph:""},{subject:a,predicate:`${E}displayName`,object:N(e.catalogName),graph:""},{subject:a,predicate:`${E}rank`,object:xe(e.catalogRank),graph:""},{subject:n,predicate:Se,object:`${E}SavedQuery`,graph:""},{subject:n,predicate:`${E}scopeGraph`,object:i,graph:""},{subject:n,predicate:`${E}forSubGraph`,object:N(e.subGraph),graph:""},{subject:n,predicate:`${E}inCatalog`,object:a,graph:""},{subject:n,predicate:`${E}displayName`,object:N(e.name),graph:""},{subject:n,predicate:`${E}sparqlQuery`,object:N(e.sparql),graph:""},{subject:n,predicate:`${E}rank`,object:xe(e.rank),graph:""}];return e.catalogDescription&&s.push({subject:a,predicate:`${Ae}description`,object:N(e.catalogDescription),graph:""}),e.description&&s.push({subject:n,predicate:`${Ae}description`,object:N(e.description),graph:""}),e.resultColumn&&s.push({subject:n,predicate:`${E}resultColumn`,object:N(e.resultColumn),graph:""}),t.length>0&&s.push({subject:n,predicate:`${E}queryParameters`,object:N(Pt(t)),graph:""}),e.view&&s.push({subject:n,predicate:`${E}executionView`,object:N(e.view),graph:""}),{savedQuery:{queryIri:n,catalogIri:a,slug:o,name:e.name,description:e.description,sparql:e.sparql,resultColumn:e.resultColumn,rank:e.rank,catalogSlug:e.catalogSlug,catalogName:e.catalogName,catalogDescription:e.catalogDescription,catalogRank:e.catalogRank,subGraph:e.subGraph,scopeGraph:i,parameters:t,view:e.view,queryUri:n,catalogUri:a},quads:s}}const Ut=new Set(["meta"]),Me="__root__";function wr(e){return!Ut.has(e.name)}function G(e){const t=`did:dkg:context-graph:${e}/meta`;return`FILTER(strstarts(str(?g), ${ke(t)}))`}async function H(e,t){var o;const r=await Oe(e,{contextGraphId:t});return((o=r==null?void 0:r.result)==null?void 0:o.bindings)??[]}async function Qt(e){const t=await rt(e);return jt(t)}const P={displayName:"Project",primaryColor:"#a855f7",accentColor:"#22c55e"},Ce=e=>({slug:e,displayName:e,icon:"•",color:"#64748b",rank:99}),qt={slug:Me,displayName:"Root",description:"Entities not in any subgraph (Context Graph root)",icon:"⊘",rank:99},Ne=e=>({typeIri:e,label:e.split(/[/#]/).pop()||e,color:"#64748b"}),B="http://dkg.io/ontology/profile/";function Ge(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"&&"value"in e){const t=e.value;return t==null?"":String(t)}return String(e)}function m(e){const t=Ge(e);if(!t)return"";const r=t.match(/^"((?:[^"\\]|\\.)*)"(?:@[\w-]+|\^\^<[^>]+>)?$/);return r?r[1].replace(/\\"/g,'"').replace(/\\n/g,`
|
|
2
|
-
`).replace(/\\\\/g,"\\"):t}function Ht(e){const t=m(e),r=parseInt(t,10);return Number.isFinite(r)?r:0}function Ft(e){return`PREFIX prof: <${B}>
|
|
3
|
-
PREFIX schema: <http://schema.org/>
|
|
4
|
-
SELECT ?profile ?name ?description ?primary ?accent
|
|
5
|
-
WHERE {
|
|
6
|
-
GRAPH ?g {
|
|
7
|
-
?profile a prof:Profile .
|
|
8
|
-
OPTIONAL { ?profile prof:displayName ?name }
|
|
9
|
-
OPTIONAL { ?profile schema:description ?description }
|
|
10
|
-
OPTIONAL { ?profile prof:primaryColor ?primary }
|
|
11
|
-
OPTIONAL { ?profile prof:accentColor ?accent }
|
|
12
|
-
}
|
|
13
|
-
${G(e)}
|
|
14
|
-
} LIMIT 1`}function Bt(e){return`PREFIX prof: <${B}>
|
|
15
|
-
PREFIX schema: <http://schema.org/>
|
|
16
|
-
SELECT ?slug ?displayName ?description ?icon ?color ?rank ?timelinePredicate ?sourceAssertion
|
|
17
|
-
WHERE {
|
|
18
|
-
GRAPH ?g {
|
|
19
|
-
?b a prof:SubGraphBinding ;
|
|
20
|
-
prof:forSubGraph ?slug .
|
|
21
|
-
OPTIONAL { ?b prof:displayName ?displayName }
|
|
22
|
-
OPTIONAL { ?b schema:description ?description }
|
|
23
|
-
OPTIONAL { ?b prof:icon ?icon }
|
|
24
|
-
OPTIONAL { ?b prof:color ?color }
|
|
25
|
-
OPTIONAL { ?b prof:rank ?rank }
|
|
26
|
-
OPTIONAL { ?b prof:timelinePredicate ?timelinePredicate }
|
|
27
|
-
OPTIONAL { ?b prof:sourceAssertion ?sourceAssertion }
|
|
28
|
-
}
|
|
29
|
-
${G(e)}
|
|
30
|
-
}`}function Vt(e){return`PREFIX prof: <${B}>
|
|
31
|
-
SELECT ?chip ?subGraph ?type ?predicate ?label
|
|
32
|
-
(GROUP_CONCAT(DISTINCT ?v; separator="|") AS ?values)
|
|
33
|
-
WHERE {
|
|
34
|
-
GRAPH ?g {
|
|
35
|
-
?chip a prof:FilterChip ;
|
|
36
|
-
prof:forSubGraph ?subGraph ;
|
|
37
|
-
prof:forType ?type ;
|
|
38
|
-
prof:onPredicate ?predicate ;
|
|
39
|
-
prof:chipValue ?v .
|
|
40
|
-
OPTIONAL { ?chip prof:label ?label }
|
|
41
|
-
}
|
|
42
|
-
${G(e)}
|
|
43
|
-
}
|
|
44
|
-
GROUP BY ?chip ?subGraph ?type ?predicate ?label`}function Dt(e){const t=e.map(s=>s.catalogIri?s:{...s,catalogSlug:`default:${s.subGraph}`}),r=t.map(s=>({slug:s.slug,subGraph:s.subGraph,catalogSlug:s.catalogSlug,catalogName:s.catalogName,catalogDescription:s.catalogDescription,catalogRank:s.catalogRank,name:s.name,description:s.description,sparql:s.sparql,resultColumn:s.resultColumn??"",rank:s.rank,view:s.view,parameters:s.parameters})),o=new Map(t.map((s,u)=>[s.queryIri,r[u]])),a=_t(t).map(s=>({slug:s.slug,subGraph:s.subGraph,name:s.name,description:s.description,rank:s.rank,queries:s.queries.map(u=>o.get(u.queryIri)).filter(u=>!!u)})),n=new Map,i=new Map;for(const s of a){const u=n.get(s.subGraph)??[];u.push(s),n.set(s.subGraph,u);const p=i.get(s.subGraph)??[];p.push(...s.queries),i.set(s.subGraph,p)}return{queryCatalogs:a,savedQueries:r,catalogsBySubGraph:n,queriesBySubGraph:i}}function Wt(e){return`PREFIX prof: <${B}>
|
|
45
|
-
SELECT ?type ?label ?icon ?color ?detailHint
|
|
46
|
-
?promoteLabel ?promoteHint ?publishLabel ?publishHint
|
|
47
|
-
WHERE {
|
|
48
|
-
GRAPH ?g {
|
|
49
|
-
?b a prof:EntityTypeBinding ;
|
|
50
|
-
prof:forType ?type .
|
|
51
|
-
OPTIONAL { ?b prof:label ?label }
|
|
52
|
-
OPTIONAL { ?b prof:icon ?icon }
|
|
53
|
-
OPTIONAL { ?b prof:color ?color }
|
|
54
|
-
OPTIONAL { ?b prof:detailHint ?detailHint }
|
|
55
|
-
OPTIONAL { ?b prof:promoteLabel ?promoteLabel }
|
|
56
|
-
OPTIONAL { ?b prof:promoteHint ?promoteHint }
|
|
57
|
-
OPTIONAL { ?b prof:publishLabel ?publishLabel }
|
|
58
|
-
OPTIONAL { ?b prof:publishHint ?publishHint }
|
|
59
|
-
}
|
|
60
|
-
${G(e)}
|
|
61
|
-
}`}function zt(e){return`PREFIX prof: <${B}>
|
|
62
|
-
PREFIX schema: <http://schema.org/>
|
|
63
|
-
SELECT ?view ?name ?description ?nodeSize
|
|
64
|
-
(GROUP_CONCAT(DISTINCT ?incType; separator="|") AS ?includeTypes)
|
|
65
|
-
(GROUP_CONCAT(DISTINCT ?empPred; separator="|") AS ?emphasizePredicates)
|
|
66
|
-
WHERE {
|
|
67
|
-
GRAPH ?g {
|
|
68
|
-
?view a prof:ViewConfig .
|
|
69
|
-
OPTIONAL { ?view prof:displayName ?name }
|
|
70
|
-
OPTIONAL { ?view schema:description ?description }
|
|
71
|
-
OPTIONAL { ?view prof:nodeSize ?nodeSize }
|
|
72
|
-
OPTIONAL { ?view prof:includeType ?incType }
|
|
73
|
-
OPTIONAL { ?view prof:emphasizePredicate ?empPred }
|
|
74
|
-
}
|
|
75
|
-
${G(e)}
|
|
76
|
-
}
|
|
77
|
-
GROUP BY ?view ?name ?description ?nodeSize`}function T(e){const t=Ge(e);if(!t)return"";const r=t.trim();return r.startsWith("<")&&r.endsWith(">")?r.slice(1,-1):r}function vr(e){const[t,r]=f.useState(!0),[o,a]=f.useState(),[n,i]=f.useState(P.displayName),[s,u]=f.useState(),[p,h]=f.useState(P.primaryColor),[l,b]=f.useState(P.accentColor),[g,S]=f.useState([]),[v,O]=f.useState([]),[U,V]=f.useState([]),[pe,D]=f.useState([]),[W,Q]=f.useState([]),[z,j]=f.useState([]),M=f.useRef(new Map),K=f.useRef(new Map),J=f.useRef(new Map),ee=f.useRef(new Map),te=f.useRef(new Map),re=f.useRef(new Map),$=f.useRef();f.useEffect(()=>{if($.current=void 0,i(e??P.displayName),u(void 0),h(P.primaryColor),b(P.accentColor),S([]),O([]),V([]),D([]),Q([]),j([]),M.current=new Map,K.current=new Map,J.current=new Map,ee.current=new Map,te.current=new Map,re.current=new Map,a(void 0),!e){r(!1);return}let y=!1;return(async()=>{r(!0);try{const[_,We,ze,Xe,Ye,ae]=await Promise.all([H(Ft(e),e).catch(()=>[]),H(Bt(e),e).catch(()=>[]),H(Wt(e),e).catch(()=>[]),H(zt(e),e).catch(()=>[]),H(Vt(e),e).catch(()=>[]),Qt(e).then(c=>({rows:c,error:void 0})).catch(c=>({rows:[],error:c instanceof Error?c.message:String(c)}))]);if(y)return;const de=e;if(_[0]){const c=_[0];i(m(c.name)||de),u(m(c.description)||void 0),h(m(c.primary)||P.primaryColor),b(m(c.accent)||P.accentColor)}else i(de),u(void 0),h(P.primaryColor),b(P.accentColor);const fe=We.map(c=>({slug:m(c.slug),displayName:m(c.displayName)||m(c.slug),description:m(c.description)||void 0,icon:m(c.icon)||void 0,color:m(c.color)||void 0,rank:Ht(c.rank)||99,timelinePredicate:T(c.timelinePredicate)||void 0,sourceAssertion:m(c.sourceAssertion)||void 0})).filter(c=>c.slug).sort((c,x)=>c.rank-x.rank);S(fe),K.current=new Map(fe.map(c=>[c.slug,c]));const he=ze.map(c=>({typeIri:T(c.type),label:m(c.label)||void 0,icon:m(c.icon)||void 0,color:m(c.color)||void 0,detailHint:m(c.detailHint)||void 0,promoteLabel:m(c.promoteLabel)||void 0,promoteHint:m(c.promoteHint)||void 0,publishLabel:m(c.publishLabel)||void 0,publishHint:m(c.publishHint)||void 0})).filter(c=>c.typeIri);O(he),M.current=new Map(he.map(c=>[c.typeIri,c]));const me=Xe.map(c=>{const x=T(c.view),Y=x.split(":view:").pop()??x;return{slug:Y,name:m(c.name)||Y,description:m(c.description)||void 0,nodeSize:m(c.nodeSize)||void 0,includeTypes:m(c.includeTypes).split("|").map(q=>T(q.trim())).filter(Boolean),emphasizePredicates:m(c.emphasizePredicates).split("|").map(q=>T(q.trim())).filter(Boolean)}});V(me),J.current=new Map(me.map(c=>[c.slug,c]));const ge=Ye.map(c=>{const x=T(c.chip),Y=x.split(":chip:").pop()??x,q=m(c.values).split("|").map(Ze=>m(Ze.trim())).filter(Boolean);return{slug:Y,subGraph:m(c.subGraph),typeIri:T(c.type),predicate:T(c.predicate),label:m(c.label)||"Filter",values:q}}).filter(c=>c.subGraph&&c.predicate&&c.values.length>0);D(ge);const ne=new Map;for(const c of ge){const x=ne.get(c.subGraph)??[];x.push(c),ne.set(c.subGraph,x)}ee.current=ne;const X=Dt(ae.rows);Q(X.queryCatalogs),j(X.savedQueries),te.current=X.catalogsBySubGraph,re.current=X.queriesBySubGraph,$.current=e,ae.error&&a(ae.error)}catch(_){y||a((_==null?void 0:_.message)??String(_))}finally{y||r(!1)}})(),()=>{y=!0}},[e]);const qe=f.useCallback(y=>y===Me?qt:$.current!==e?Ce(y):K.current.get(y)??Ce(y),[e]),He=f.useCallback(y=>$.current===e?M.current.get(y)??Ne(y):Ne(y),[e]),Fe=f.useCallback(y=>$.current===e?J.current.get(y):void 0,[e]),Be=f.useCallback(y=>$.current===e?ee.current.get(y)??[]:[],[e]),Ve=f.useCallback(y=>$.current===e?te.current.get(y)??[]:[],[e]),De=f.useCallback(y=>$.current===e?re.current.get(y)??[]:[],[e]);return{contextGraphId:e??"",displayName:n,description:s,primaryColor:p,accentColor:l,subGraphs:g,typeBindings:v,views:U,filterChips:pe,queryCatalogs:W,savedQueries:z,loading:t,error:o,forSubGraph:qe,forType:He,view:Fe,chipsFor:Be,savedQueryCatalogsFor:Ve,savedQueriesFor:De}}const Xt=Z.createContext(null);function Yt(){return f.useContext(Xt)}const Zt="http://dkg.io/ontology/agent/";function Kt(e){return`PREFIX ag: <${Zt}>
|
|
78
|
-
PREFIX schema: <http://schema.org/>
|
|
79
|
-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
|
80
|
-
SELECT ?a ?kind ?name ?label ?fw ?op ?wallet ?peerId ?avatar ?reputation
|
|
81
|
-
WHERE {
|
|
82
|
-
GRAPH ?g {
|
|
83
|
-
?a a ag:Agent .
|
|
84
|
-
OPTIONAL { ?a a ag:HumanAgent . BIND("human" AS ?kind) }
|
|
85
|
-
OPTIONAL { ?a a ag:AIAgent . BIND("ai" AS ?kindAi) }
|
|
86
|
-
OPTIONAL { ?a schema:name ?name }
|
|
87
|
-
OPTIONAL { ?a rdfs:label ?label }
|
|
88
|
-
OPTIONAL { ?a ag:framework ?fw }
|
|
89
|
-
OPTIONAL { ?a ag:operator ?op }
|
|
90
|
-
OPTIONAL { ?a ag:walletAddress ?wallet }
|
|
91
|
-
OPTIONAL { ?a ag:peerId ?peerId }
|
|
92
|
-
OPTIONAL { ?a ag:avatar ?avatar }
|
|
93
|
-
OPTIONAL { ?a ag:reputation ?reputation }
|
|
94
|
-
}
|
|
95
|
-
${G(e)}
|
|
96
|
-
}`}function Ue(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"&&"value"in e){const t=e.value;return t==null?"":String(t)}return String(e)}function R(e){const t=Ue(e);if(!t)return"";const r=t.match(/^"((?:[^"\\]|\\.)*)"(?:@[\w-]+|\^\^<[^>]+>)?$/);return r?r[1].replace(/\\"/g,'"').replace(/\\n/g,`
|
|
97
|
-
`).replace(/\\\\/g,"\\"):t}function Pe(e){const t=Ue(e);if(!t)return"";const r=t.trim();return r.startsWith("<")&&r.endsWith(">")?r.slice(1,-1):r}function Jt(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)|0;return`hsl(${((t%360+360)%360+25)%360}, 55%, 58%)`}function er(e){const t=new Map;for(const r of e){const o=Pe(r.a);if(!o)continue;const a=t.get(o),n=R(r.kindAi)==="ai"||R(r.kind)==="ai"?"ai":R(r.kind)==="human"?"human":(a==null?void 0:a.kind)??"ai",i={uri:o,name:R(r.name)||R(r.label)||o.split(":").pop()||o,kind:n,framework:R(r.fw)||(a==null?void 0:a.framework),operatorUri:Pe(r.op)||(a==null?void 0:a.operatorUri),walletAddress:R(r.wallet)||(a==null?void 0:a.walletAddress),peerId:R(r.peerId)||(a==null?void 0:a.peerId),avatar:R(r.avatar)||(a==null?void 0:a.avatar),reputation:R(r.reputation)||(a==null?void 0:a.reputation),color:Jt(o)};i.kind==="human"&&!i.framework&&(i.framework="human"),t.set(o,i)}for(const r of t.values())if(r.operatorUri){const o=t.get(r.operatorUri);o&&(r.operatorName=o.name)}return t}function Ar(e){const[t,r]=f.useState(()=>new Map),[o,a]=f.useState(!0),[n,i]=f.useState(),s=f.useRef(new Map);f.useEffect(()=>{if(!e){a(!1);return}let l=!1;return(async()=>{var b;a(!0),i(void 0);try{const g=await Oe(Kt(e),{contextGraphId:e});if(l)return;const S=((b=g==null?void 0:g.result)==null?void 0:b.bindings)??[],v=er(S);r(v),s.current=v}catch(g){l||i((g==null?void 0:g.message)??String(g))}finally{l||a(!1)}})(),()=>{l=!0}},[e]);const u=f.useCallback(l=>s.current.get(l),[]),p=Z.useMemo(()=>[...t.values()].sort((l,b)=>l.name.localeCompare(b.name)),[t]),h=f.useCallback(l=>{},[]);return{agents:t,list:p,loading:o,error:n,get:u,openAgent:h}}const tr=Z.createContext(null);function Qe(){return f.useContext(tr)}const Re={"claude-code":"⦿",openclaw:"◈",hermes:"⬡",gemini:"✧",human:"👤"};function rr(e,t){return e&&Re[e]?Re[e]:t==="human"?"👤":"◉"}function ar(e){const t=e.trim();if(!t)return"?";const r=t.split(/[\s_-]+/).filter(Boolean);return r.length===1?r[0].slice(0,2).toUpperCase():(r[0][0]+(r[1][0]??"")).toUpperCase()}function nr(e){const t=e.trim();return t.length<=11?t:`${t.slice(0,6)}…${t.slice(-4)}`}const sr=({agent:e,fallbackUri:t,size:r="sm",showOperator:o=!1,onOpenAgent:a,className:n=""})=>{const i=Qe();if(!e&&!t)return null;const s=a??(i==null?void 0:i.openAgent),u=(e==null?void 0:e.uri)??t,p=(e==null?void 0:e.name)??(t?nr(t.split(":").pop()??t):"unknown"),h=(e==null?void 0:e.kind)??"ai",l=e==null?void 0:e.framework,b=rr(l,h),g=(e==null?void 0:e.color)??"hsl(0, 0%, 55%)",S=[p,l?`framework: ${l}`:null,e!=null&&e.operatorName?`operator: ${e.operatorName}`:null,e!=null&&e.walletAddress?`wallet: ${e.walletAddress}`:null,e!=null&&e.peerId?`peer: ${e.peerId.slice(0,20)}…`:null,e!=null&&e.reputation?`— ${e.reputation}`:null,u].filter(Boolean).join(`
|
|
98
|
-
`),v=s?()=>s(u):void 0,O=!!v;return d.jsxs("span",{className:`v10-agent-chip v10-agent-chip-${r}${O?" interactive":""} ${n}`,style:{"--agent-color":g},onClick:v?U=>{U.stopPropagation(),v()}:void 0,title:S,role:O?"button":void 0,tabIndex:O?0:void 0,children:[d.jsxs("span",{className:"v10-agent-chip-avatar",style:{background:g},children:[d.jsx("span",{className:"v10-agent-chip-initials",children:ar(p)}),d.jsx("span",{className:"v10-agent-chip-glyph",title:l??h,children:b})]}),d.jsxs("span",{className:"v10-agent-chip-body",children:[d.jsx("span",{className:"v10-agent-chip-name",children:p}),r==="lg"&&((e==null?void 0:e.operatorName)||l)&&d.jsxs("span",{className:"v10-agent-chip-sub",children:[l&&h==="ai"&&d.jsx("span",{className:"v10-agent-chip-fw",children:l}),(e==null?void 0:e.operatorName)&&h==="ai"&&d.jsxs(d.Fragment,{children:[l&&d.jsx("span",{className:"v10-agent-chip-sep",children:"·"}),d.jsxs("span",{className:"v10-agent-chip-op",children:["driven by ",e.operatorName]})]}),h==="human"&&d.jsx("span",{className:"v10-agent-chip-fw",children:"human"})]}),r==="md"&&o&&(e==null?void 0:e.operatorName)&&h==="ai"&&d.jsx("span",{className:"v10-agent-chip-sub",children:d.jsxs("span",{className:"v10-agent-chip-op",children:["· ",e.operatorName]})})]})]})},ie={working:"#64748b",shared:"#f59e0b",verified:"#22c55e"},or={working:"◇",shared:"◈",verified:"◉"},ir=200,Sr=({entities:e,agentUri:t,typeIri:r,subGraph:o,limit:a,includeUndated:n=!0,swmEvents:i,lifecycleEvents:s,lifecycleError:u,title:p,onSelectEntity:h,onOpenAgent:l,emptyHint:b,className:g=""})=>{const{items:S,hasMore:v}=at(e,{agentUri:t,typeIri:r,subGraph:o,limit:a,includeUndated:n,swmEvents:i,lifecycleEvents:s}),O=Z.useMemo(()=>nt(S),[S]),U=Qe(),V=Yt(),D=v?`${a??ir}+`:String(S.length),W=u!=null&&S.length===0,Q=p?d.jsxs("div",{className:"v10-activity-feed-title",children:[d.jsx("span",{className:"v10-activity-feed-title-label",children:p}),d.jsx("span",{className:"v10-activity-feed-title-count","data-state":W?"error":void 0,children:W?"—":D})]}):null,z=u?d.jsx("div",{className:"v10-activity-feed-error",role:"status","aria-live":"polite",title:u,children:"Couldn't load recent activity."}):null;return S.length===0?d.jsxs("div",{className:`v10-activity-feed v10-activity-feed-empty ${g}`,children:[Q,z??d.jsx("div",{className:"v10-activity-feed-empty-hint",children:b??"No activity with a timestamp yet."})]}):d.jsxs("div",{className:`v10-activity-feed ${g}`,children:[Q,z,O.map(j=>d.jsxs("div",{className:"v10-activity-feed-bucket",children:[d.jsxs("div",{className:"v10-activity-feed-bucket-head",children:[d.jsx("span",{className:"v10-activity-feed-bucket-label",children:j.label}),d.jsx("span",{className:"v10-activity-feed-bucket-count",children:j.items.length})]}),d.jsx("div",{className:"v10-activity-feed-items",children:j.items.map(M=>d.jsx(cr,{item:M,agents:U,profile:V,onSelectEntity:h,onOpenAgent:l},M.id))})]},j.key))]})};function cr({item:e,agents:t,profile:r,onSelectEntity:o,onOpenAgent:a}){const n=e.authorUri?t==null?void 0:t.get(e.authorUri):null,i=e.event==="typed",s=i&&e.kindUri?r==null?void 0:r.forType(e.kindUri):null,u=e.event==="added"?"Added":e.event==="promoted"?e.entityCount!=null&&e.entityCount>0?`Promoted to SWM · ${e.entityCount} ${e.entityCount===1?"entity":"entities"}`:"Promoted to SWM":e.event==="published"?"Published to VM":(s==null?void 0:s.label)??(e.kindUri?e.kindUri.split(/[#/]/).pop():null)??"Entity",p=e.event==="added"?"+":e.event==="promoted"?"⇡":e.event==="published"?"◉":(s==null?void 0:s.icon)??"◆",h=e.event==="promoted"?ie.shared:e.event==="published"?ie.verified:e.event==="added"?"#64748b":(s==null?void 0:s.color)??"#a855f7",l=ie[e.layer],b=i?lr(e.entity):null,g=(()=>{const v=[];return e.event!=="typed"&&v.push(u),v.push(e.entity.label),e.at&&v.push(e.at.toISOString()),v.join(`
|
|
99
|
-
`)})(),S=d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"v10-activity-feed-layer",style:{color:l},title:`${e.layer} memory`,children:or[e.layer]}),d.jsxs("span",{className:"v10-activity-feed-type",style:{"--type-color":h},children:[d.jsx("span",{className:"v10-activity-feed-type-icon",children:p}),d.jsx("span",{className:"v10-activity-feed-type-label",children:u})]}),d.jsx("span",{className:"v10-activity-feed-title-text",children:e.entity.label}),b&&d.jsx("span",{className:`v10-activity-feed-status status-${ur(b)}`,children:b}),(n||e.authorUri)&&d.jsx("span",{className:"v10-activity-feed-author",children:d.jsx(sr,{agent:n??void 0,fallbackUri:e.authorUri??void 0,size:"sm",onOpenAgent:a})}),d.jsx("span",{className:"v10-activity-feed-time",title:e.at?e.at.toLocaleString():"no timestamp",children:st(e.at)})]});return e.clickable?d.jsx("button",{type:"button",className:"v10-activity-feed-row",onClick:()=>o(e.entity.uri),title:g,children:S}):d.jsx("div",{className:"v10-activity-feed-row v10-activity-feed-row-static",title:g,"aria-disabled":"true",children:S})}function lr(e){var r;const t=["http://dkg.io/ontology/decisions/status","http://dkg.io/ontology/tasks/status","http://dkg.io/ontology/github/state"];for(const o of t){const a=(r=e.properties.get(o))==null?void 0:r[0];if(a)return a}return null}function ur(e){switch(e){case"accepted":case"done":case"merged":return"good";case"proposed":case"in_progress":case"open":return"warn";case"rejected":case"superseded":case"blocked":case"cancelled":return"bad";default:return"neutral"}}export{Sr as A,ue as C,Xt as P,Me as R,gr as U,sr as a,tr as b,mr as c,yr as d,wr as e,Qe as f,vr as g,Yt as h,hr as i,br as p,Mt as q,Ar as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{be as x,aP as e,bF as w,bN as P,bM as A,R as b}from"./index-DW3dBcQk.js";import{f as C,h as T,a as N,A as R,g as E,u as M,P as $,b as D}from"./ActivityFeed-B5QxV1dk.js";import"./useProjectActivity-BOgGdtS7.js";const F="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"}],S=({agentUri:a,entityList:d,onSelectEntity:u,onOpenAgent:r,onBack:j})=>{const o=C(),c=T(),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===F&&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:j,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(R,{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."})]})},V=({contextGraphId:a,agentUri:d})=>{const u=E(a),r=M(a),j=w(a),{openTab:o,closeTab:c,activeTabId:s}=P(),{setActiveProject:p}=A(),g=b.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=b.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=b.useCallback(()=>{s&&c(s)},[s,c]),h=b.useMemo(()=>({...r,openAgent:m}),[r,m]);return e.jsx($.Provider,{value:u,children:e.jsx(D.Provider,{value:h,children:e.jsx(S,{agentUri:d,entityList:j.entityList,onSelectEntity:g,onOpenAgent:m,onBack:v})})})};export{V as AgentProfilePage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CumB6j2m.js","assets/index-DW3dBcQk.js","assets/index-CIt7zWgM.css","assets/string-DtUow4KV.js","assets/OnChainProvenanceCard-jxk66g53.js","assets/useEntityOnChainReceipt-CUGQNIsP.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{be as i,a0 as pe,ak as B,q as oe,bH as be,aP as e,R as K,bA as I,O as ge,bG as q,ag as xe,aS as de,bd as fe,b3 as je,b4 as Ne,f as we,bc as ie,F as ye,E as re,_ as Y,aZ as Se}from"./index-DW3dBcQk.js";import{t as he}from"./truncate-BaiMkAOo.js";const ke={"application/pdf":"pdf","application/json":"text","text/plain":"text","text/csv":"text","text/markdown":"markdown","image/png":"image","image/jpeg":"image","image/gif":"image","image/webp":"image"};function ne(s){const c=ke[s];return c?c==="markdown"?"text":c:"binary"}async function ce(s){const c=await fetch(s,{headers:oe()});if(!c.ok)throw new Error(`HTTP ${c.status}`);const l=await c.blob();return URL.createObjectURL(l)}function Ce({open:s,onClose:c,assertionName:l,contextGraphId:g,subGraphName:d}){const[r,v]=i.useState(null),[N,C]=i.useState(null),[h,w]=i.useState(null),[y,x]=i.useState(!0),[p,S]=i.useState(null);i.useEffect(()=>{if(s)return x(!0),S(null),v(null),C(null),w(null),pe(l,g,d).then(async b=>{v(b);const A=ne(b.detectedContentType),E=B(b.fileHash,b.detectedContentType);if(A==="text"){const t=await fetch(E,{headers:oe()});t.ok&&C(await t.text())}else if(A==="pdf"||A==="image"){const t=await ce(E);w(t)}}).catch(b=>S(b.message??"Failed to load file info")).finally(()=>x(!1)),()=>{h&&URL.revokeObjectURL(h)}},[s,l,g,d]),i.useEffect(()=>()=>{h&&URL.revokeObjectURL(h)},[h]);const{dialogRef:n,onBackdropClick:u}=be(s,c);if(!s)return null;const o=r?ne(r.detectedContentType):null,f=r?B(r.fileHash,r.detectedContentType):null,k=async(b,A)=>{try{const E=await ce(b),t=document.createElement("a");t.href=E,t.download=A,t.click(),URL.revokeObjectURL(E)}catch{window.open(b,"_blank")}};return e.jsx("div",{className:"v10-modal-overlay",onClick:u,role:"presentation",children:e.jsxs("div",{className:"v10-modal-box v10-file-preview-modal",ref:n,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-file-preview-title",children:[e.jsxs("div",{className:"v10-modal-header",children:[e.jsx("div",{id:"dkg-file-preview-title",className:"v10-modal-title",children:l}),e.jsx("button",{type:"button",className:"v10-modal-close",onClick:c,"aria-label":"Close file preview",title:"Close (Esc)",children:"×"})]}),y&&e.jsx("div",{className:"v10-file-preview-loading",children:"Loading file preview..."}),p&&e.jsxs("div",{className:"v10-file-preview-error",children:[e.jsx("p",{children:p}),e.jsx("p",{style:{fontSize:11,marginTop:4},children:"File preview requires the extraction status to still be cached on the node. If the node was restarted, the preview metadata may be unavailable."})]}),r&&!y&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"v10-file-preview-meta",children:[e.jsx("span",{className:"v10-file-preview-meta-item",children:r.detectedContentType}),e.jsxs("span",{className:"v10-file-preview-meta-item",children:[r.tripleCount," triples extracted"]}),e.jsx("span",{className:"v10-file-preview-meta-item",children:r.pipelineUsed}),r.completedAt&&e.jsx("span",{className:"v10-file-preview-meta-item",children:new Date(r.completedAt).toLocaleString()})]}),e.jsxs("div",{className:"v10-file-preview-content",children:[o==="pdf"&&h&&e.jsx("iframe",{src:h,className:"v10-file-preview-iframe",title:`Preview: ${l}`}),o==="image"&&h&&e.jsx("img",{src:h,alt:l,className:"v10-file-preview-image"}),o==="text"&&N!=null&&e.jsx("pre",{className:"v10-file-preview-text",children:N}),o==="binary"&&e.jsxs("div",{className:"v10-file-preview-binary",children:[e.jsx("p",{children:"This file type cannot be previewed directly."}),f&&e.jsx("button",{className:"v10-file-preview-download",onClick:()=>k(f,l),children:"Download file"})]})]}),e.jsxs("div",{className:"v10-file-preview-footer",children:[f&&e.jsx("button",{className:"v10-file-preview-download",onClick:()=>k(f,l),children:"Download original"}),r.mdIntermediateHash&&e.jsx("button",{className:"v10-file-preview-download",onClick:()=>k(B(r.mdIntermediateHash,"text/markdown"),`${l}.md`),children:"Download markdown intermediate"})]})]})]})})}const Ee=i.lazy(()=>Y(()=>import("./index-CumB6j2m.js").then(s=>s.h),__vite__mapDeps([0,1,2,3])).then(s=>({default:s.RdfGraph}))),Le=i.lazy(()=>Y(()=>import("./index-CumB6j2m.js").then(s=>s.h),__vite__mapDeps([0,1,2,3])).then(s=>({default:s.NodePanel}))),Pe=i.lazy(()=>Y(()=>import("./OnChainProvenanceCard-jxk66g53.js"),__vite__mapDeps([4,1,2,0,3,5])).then(s=>({default:s.OnChainProvenanceCard}))),Ae={wm:{label:"Working Memory",color:"var(--layer-working)",icon:"◇",description:"Private agent drafts. Fast local storage."},swm:{label:"Shared Working Memory",color:"var(--layer-shared)",icon:"◈",description:"Shared proposals with collaborators. TTL-bounded."},vm:{label:"Verifiable Memory",color:"var(--layer-verified)",icon:"◉",description:"Endorsed, published, on-chain knowledge."}},Re={labelMode:"humanized",renderer:"2d",labels:Se({extraPredicates:["http://schema.org/text"]}),style:{classColors:{"http://schema.org/Person":"#f472b6","http://schema.org/Organization":"#fb923c","http://schema.org/Place":"#34d399","http://schema.org/Product":"#c084fc","http://schema.org/Event":"#facc15","http://schema.org/CreativeWork":"#7dd3fc","http://schema.org/Thing":"#94a3b8"},defaultNodeColor:"#94a3b8",defaultEdgeColor:"#5f8598",edgeWidth:.9},hexagon:{baseSize:4,minSize:3,maxSize:6,scaleWithDegree:!0},focus:{maxNodes:3e3,hops:999}},Te=e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),e.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}),Me=e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"6",cy:"6",r:"3"}),e.jsx("circle",{cx:"18",cy:"6",r:"3"}),e.jsx("circle",{cx:"6",cy:"18",r:"3"}),e.jsx("circle",{cx:"18",cy:"18",r:"3"}),e.jsx("line",{x1:"8.5",y1:"7.5",x2:"15.5",y2:"16.5"}),e.jsx("line",{x1:"15.5",y1:"7.5",x2:"8.5",y2:"16.5"})]});function Ve({layer:s,contextGraphId:c,externalQuery:l,externalQueryKey:g,queryPresetOptions:d}){var le,te;const r=Ae[s],[v,N]=i.useState("graph"),[C,h]=i.useState(""),[w,y]=i.useState(""),[x,p]=i.useState(""),[S,n]=i.useState(""),[u,o]=i.useState("any"),[f,k]=i.useState(50),[b,A]=i.useState(""),[E,t]=i.useState("any"),[m,L]=i.useState(50),[U,P]=i.useState(s!=="vm"),j=K.useRef(s);K.useEffect(()=>{j.current!==s&&(j.current=s,h(""),P(s!=="vm"),y(""),p(""),n(""),o("any"),k(50),A(""),t("any"),L(50))},[s]),K.useEffect(()=>{l!==void 0&&(h(""),y(l),p(l))},[l,g]);const W=i.useMemo(()=>s==="wm"?`SELECT ?s ?p ?o WHERE { GRAPH <${`did:dkg:context-graph:${c}/_meta`}> { ?g <http://dkg.io/ontology/memoryLayer> "WM" } GRAPH ?g { ?s ?p ?o } FILTER(!CONTAINS(STR(?g), "/meta/assertion/")) } LIMIT 1000`:s==="vm"?Ue({query:b,field:E,limit:m}):"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 500",[c,s,E,m,b]),R=x||W,H=s==="swm"?"_shared_memory":void 0,O=s==="swm",Z=s==="vm"?"verifiable-memory":void 0,J=s==="wm"&&R===W,{data:M,loading:V,error:X,refresh:T}=I(()=>ge(R,{contextGraphId:c,includeSharedMemory:O,graphSuffix:H,view:Z,includeContextGraphPartitions:J}),[R,c,O,H,Z,J],0);q(c,T,{layers:[s]});const{data:F}=I(xe,[],3e4),me=F==null?void 0:F.blockExplorerUrl,ee=i.useCallback(()=>{const a=w.trim();if(a===x){T();return}p(a)},[x,w,T]),se=i.useCallback(()=>{const a=S!==b||u!==E||f!==m;if(a&&(A(S),t(u),L(f)),x){p("");return}a||T()},[x,E,m,b,u,f,S,T]),_=((le=M==null?void 0:M.result)==null?void 0:le.bindings)??((te=M==null?void 0:M.results)==null?void 0:te.bindings)??[],z=i.useMemo(()=>_.map(a=>({subject:$(a.s)??"",predicate:$(a.p)??"",object:$(a.o)??""})).filter(a=>a.subject&&a.predicate&&a.object),[_]),ue=i.useCallback(a=>{a!=null&&a.id&&p(`SELECT (<${a.id}> AS ?s) ?p ?o WHERE { <${a.id}> ?p ?o } LIMIT 100`)},[]);return e.jsxs("div",{className:"v10-memory-layer-view",children:[e.jsxs("div",{className:"v10-mlv-header",children:[e.jsx("span",{className:"v10-mlv-icon",style:{color:r.color},children:r.icon}),e.jsxs("div",{children:[e.jsx("h2",{className:"v10-mlv-title",children:r.label}),e.jsx("p",{className:"v10-mlv-desc",children:r.description})]})]}),s==="wm"&&e.jsx(_e,{contextGraphId:c,onPromoted:T}),s==="swm"&&e.jsx($e,{contextGraphId:c,onPublished:T}),s==="vm"&&e.jsxs("div",{className:"v10-vm-search-panel",children:[e.jsxs("div",{className:"v10-vm-search-header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"v10-vm-search-title",children:"Search Verifiable Memory"}),e.jsx("div",{className:"v10-vm-search-desc",children:"Search published triples by subject, predicate, object, or across all fields."})]}),e.jsx("button",{className:"v10-vm-search-toggle",type:"button",onClick:()=>P(a=>!a),children:U?"Hide SPARQL":"Advanced SPARQL"})]}),e.jsxs("div",{className:"v10-vm-search-controls",children:[e.jsx("input",{type:"text",className:"v10-mlv-query-input",placeholder:"Search verifiable memory...",value:S,onChange:a=>n(a.target.value),onKeyDown:a=>{a.key==="Enter"&&se()}}),e.jsxs("select",{className:"v10-vm-search-select",value:u,onChange:a=>o(a.target.value),children:[e.jsx("option",{value:"any",children:"Any field"}),e.jsx("option",{value:"subject",children:"Subject"}),e.jsx("option",{value:"predicate",children:"Predicate"}),e.jsx("option",{value:"object",children:"Object"})]}),e.jsxs("select",{className:"v10-vm-search-select",value:String(f),onChange:a=>k(Number.parseInt(a.target.value,10)||50),children:[e.jsx("option",{value:"25",children:"25 rows"}),e.jsx("option",{value:"50",children:"50 rows"}),e.jsx("option",{value:"100",children:"100 rows"}),e.jsx("option",{value:"200",children:"200 rows"})]}),e.jsx("button",{className:"v10-mlv-run-btn",onClick:se,children:"Search"})]})]}),(s!=="vm"||U)&&e.jsxs("div",{className:"v10-mlv-query-bar",children:[d!=null&&d.length?e.jsxs("select",{className:"v10-vm-search-select",value:C,onChange:a=>{const D=a.target.value;h(D);const G=d.find(ve=>ve.label===D),ae=(G==null?void 0:G.query)??"";y(ae),p(ae)},children:[e.jsx("option",{value:"",children:"Select common query..."}),d.map(a=>e.jsx("option",{value:a.label,children:a.label},a.label))]}):e.jsx("input",{type:"text",className:"v10-mlv-query-input",placeholder:"Custom SPARQL query...",value:w,onChange:a=>y(a.target.value),onKeyDown:a=>{a.key==="Enter"&&ee()}}),e.jsx("button",{className:"v10-mlv-run-btn",onClick:ee,children:"Run"}),x&&e.jsx("button",{className:"v10-mlv-clear-btn",onClick:()=>p(""),title:"Reset to full layer overview",children:"Reset"}),e.jsxs("div",{className:"v10-mlv-view-toggle",children:[e.jsx("button",{className:`v10-mlv-toggle-btn ${v==="table"?"active":""}`,onClick:()=>N("table"),title:"Table view",children:Te}),e.jsx("button",{className:`v10-mlv-toggle-btn ${v==="graph"?"active":""}`,onClick:()=>N("graph"),title:"Graph view",children:Me})]})]}),V&&e.jsx("p",{className:"v10-mlv-status",children:"Loading..."}),X&&e.jsxs("p",{className:"v10-mlv-status",style:{color:"var(--accent-red)"},children:["Error: ",X]}),!V&&_.length===0&&e.jsxs("div",{className:"v10-mlv-empty",children:[e.jsxs("p",{children:["No triples found in ",r.label.toLowerCase(),"."]}),e.jsxs("p",{style:{fontSize:11,marginTop:4},children:[s==="wm"&&"Import files or chat with your agent to generate working memory.",s==="swm"&&"Promote assertions from working memory to share with collaborators.",s==="vm"&&"Publish shared memory to create verified on-chain knowledge."]})]}),!V&&_.length>0&&v==="table"&&e.jsxs("div",{className:"v10-mlv-table-wrap",children:[e.jsxs("div",{className:"v10-mlv-result-count",children:[_.length," triples"]}),e.jsxs("table",{className:"v10-mlv-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Subject"}),e.jsx("th",{children:"Predicate"}),e.jsx("th",{children:"Object"})]})}),e.jsx("tbody",{children:_.map((a,D)=>e.jsxs("tr",{children:[e.jsx("td",{className:"v10-mlv-cell",children:Q($(a.s))}),e.jsx("td",{className:"v10-mlv-cell",children:Q($(a.p))}),e.jsx("td",{className:"v10-mlv-cell",children:Q($(a.o))})]},D))})]})]}),!V&&z.length>0&&v==="graph"&&e.jsxs("div",{className:"v10-mlv-graph-container",children:[e.jsxs("div",{className:"v10-mlv-graph-info",children:[e.jsxs("span",{children:[z.length," triples"]}),x&&e.jsx("span",{className:"v10-mlv-graph-info-custom",children:"filtered"})]}),e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"v10-mlv-graph-loading",children:"Loading graph renderer..."}),children:e.jsxs(Ee,{data:z,format:"triples",options:Re,style:{width:"100%",height:"100%"},onNodeClick:ue,initialFit:!0,children:[e.jsx(Le,{className:"v10-mlv-node-panel",showUri:!0,showTypes:!0,showProperties:!0,showMetadata:!1,maxValueLength:150}),e.jsx(Pe,{contextGraphId:c,layer:s,explorerUrl:me})]})})]})]})}function _e({contextGraphId:s,onPromoted:c}){const{data:l,loading:g,refresh:d}=I(()=>de(s,"wm"),[s],0);q(s,d,{layers:["wm"]});const[r,v]=i.useState(null),[N,C]=i.useState(null),[h,w]=i.useState(null),[y,x]=i.useState(null),p=i.useCallback(async n=>{v(n.graphUri),C(null),w(null);try{const u=await ie(s,n.name,n.subGraph?{subGraphName:n.subGraph}:{}),o=ye(n.name,u);C({message:o.message+(n.subGraph?` (in ${n.subGraph})`:""),kind:o.kind==="success"?"success":"noop",subGraph:n.subGraph}),d(),c()}catch(u){const o=re(n.name,u);w(o?{message:o.message,kind:"not-persisted"}:{message:(u==null?void 0:u.message)??"Promote failed",kind:"other"})}finally{v(null)}},[s,d,c]),S=i.useCallback(async()=>{if(!(l!=null&&l.length))return;v("__all__"),C(null),w(null);let n=0,u=null;try{for(const k of l)u=k.name,(await ie(s,k.name,k.subGraph?{subGraphName:k.subGraph}:{})).promotedCount===0&&(n+=1);const o=l.length-n,f=n>0?` (${n} already shared or still committing)`:"";C({message:o>0?`Shared ${o} complete Knowledge Asset${o===1?"":"s"} to Shared Working Memory${f}.`:"No Knowledge Assets were newly shared — all were already in Shared Working Memory or still committing.",kind:o>0?"success":"noop"}),d(),c()}catch(o){const f=re(u??"selected assertion",o);w(f?{message:f.message,kind:"not-persisted"}:{message:(o==null?void 0:o.message)??"Promote failed",kind:"other"})}finally{v(null)}},[l,s,d,c]);return g?e.jsx("div",{className:"v10-assertion-list-loading",children:"Loading assertions..."}):l!=null&&l.length?e.jsxs("div",{className:"v10-assertion-list",children:[e.jsxs("div",{className:"v10-assertion-list-header",children:[e.jsxs("span",{className:"v10-assertion-list-title",children:["Assertions in Working Memory (",l.length,")"]}),e.jsx("button",{className:"v10-btn-promote-all",disabled:r!==null,onClick:S,children:r==="__all__"?"Sharing...":"Share Complete KAs → SWM"})]}),e.jsx("div",{className:"v10-assertion-items",children:l.map(n=>e.jsxs("div",{className:"v10-assertion-item",children:[e.jsxs("div",{className:"v10-assertion-item-info",children:[e.jsx("button",{className:"v10-assertion-item-name clickable",title:n.graphUri,onClick:()=>x({name:n.name,subGraph:n.subGraph}),children:n.name}),n.tripleCount!=null&&e.jsxs("span",{className:"v10-assertion-item-count",children:[n.tripleCount," triples"]}),n.subGraph&&e.jsxs("span",{className:"v10-item-count v10-item-subgraph",title:`In sub-graph: ${n.subGraph}`,children:["› ",he(n.subGraph,18)]})]}),e.jsx("button",{className:"v10-btn-promote",disabled:r!==null,onClick:()=>p(n),title:"Share this complete Knowledge Asset to Shared Working Memory",children:r===n.graphUri?"Promoting...":"→ SWM"})]},n.graphUri))}),N&&e.jsx("div",{className:N.kind==="success"?"v10-promote-result success":"v10-promote-result info",children:N.message}),h&&e.jsx("div",{className:"v10-promote-result error",children:h.message}),y&&e.jsx(Ce,{open:!0,onClose:()=>x(null),assertionName:y.name,subGraphName:y.subGraph,contextGraphId:s})]}):null}function $e({contextGraphId:s,onPublished:c}){const{data:l,loading:g,refresh:d}=I(()=>de(s,"swm"),[s],0);q(s,d,{layers:["swm"]});const[r,v]=i.useState(new Set),[N,C]=i.useState(!1),[h,w]=i.useState(null),[y,x]=i.useState(null),p=(l==null?void 0:l.map(t=>t.graphUri))??[],S=p.length>0&&p.every(t=>r.has(t)),n=i.useCallback(t=>{v(m=>{const L=new Set(m);return L.has(t)?L.delete(t):L.add(t),L})},[]),u=i.useCallback(()=>{v(S?new Set:new Set(p))},[S,p]),o=i.useCallback(async t=>{if(t.length!==0){C(!0),w(null),x(null);try{w(await fe(s,t)),v(new Set),d(),c()}catch(m){x((m==null?void 0:m.message)??"Publish failed")}finally{C(!1)}}},[s,d,c]),f=i.useCallback(()=>{const t=(l??[]).filter(m=>r.has(m.graphUri));return o(t)},[l,r,o]),k=i.useCallback(()=>o(l??[]),[l,o]),b=(l==null?void 0:l.reduce((t,m)=>t+(m.tripleCount??0),0))??0,A=(l==null?void 0:l.filter(t=>r.has(t.graphUri)).reduce((t,m)=>t+(m.tripleCount??0),0))??0,E=!g&&(!l||l.length===0);return g?e.jsx("div",{className:"v10-assertion-list-loading",children:"Loading SWM contents..."}):E?e.jsxs("div",{className:"v10-publish-panel",children:[e.jsx("div",{className:"v10-publish-panel-header",children:e.jsx("span",{className:"v10-publish-panel-title",children:"Publish to Verifiable Memory"})}),e.jsx("div",{className:"v10-publish-panel-empty",children:"No data in Shared Working Memory yet. Promote assertions from Working Memory first."})]}):e.jsxs("div",{className:"v10-publish-panel",children:[e.jsxs("div",{className:"v10-publish-panel-header",children:[e.jsxs("span",{className:"v10-publish-panel-title",children:["Knowledge assets in Shared Working Memory (",l.length," asset",l.length===1?"":"s"," · ",b," triples)"]}),e.jsxs("div",{className:"v10-publish-panel-header-actions",children:[e.jsx("button",{className:"v10-publish-panel-refresh",onClick:d,title:"Refresh",children:"↻"}),e.jsx("button",{className:"v10-btn-promote-all",disabled:N,onClick:k,children:N&&r.size===0?"Publishing...":"Publish All → VM"})]})]}),e.jsxs("div",{className:"v10-publish-select-bar",children:[e.jsxs("label",{className:"v10-publish-select-all",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:u}),e.jsx("span",{children:"Select all"})]}),r.size>0&&e.jsx("button",{className:"v10-btn-publish",disabled:N,onClick:f,children:N?"Publishing...":`Publish ${r.size} selected (${A} triples) → VM`})]}),e.jsx("div",{className:"v10-assertion-items",children:l.map(t=>e.jsxs("div",{className:`v10-assertion-item ${r.has(t.graphUri)?"selected":""}`,children:[e.jsx("label",{className:"v10-publish-entity-check",children:e.jsx("input",{type:"checkbox",checked:r.has(t.graphUri),onChange:()=>n(t.graphUri)})}),e.jsxs("div",{className:"v10-assertion-item-info",children:[e.jsx("span",{className:"v10-assertion-item-name",title:t.graphUri,children:t.name}),t.subGraph&&e.jsxs("span",{className:"v10-item-count v10-item-subgraph",title:`In sub-graph: ${t.subGraph}`,children:["› ",he(t.subGraph,18)]}),t.tripleCount!=null&&e.jsxs("span",{className:"v10-assertion-item-count",children:[t.tripleCount," triples"]})]})]},t.graphUri))}),h&&(()=>{const{published:t,total:m,partial:L,partialError:U,failures:P,sample:j,convictionCostCovered:W}=h,R=je(h),H=t===m&&t>0&&L===0,O=(j==null?void 0:j.status)==="confirmed"&&!!j.txHash;return e.jsxs("div",{className:`v10-publish-result-card ${H?"success":"error"}`,children:[e.jsx("div",{className:"v10-publish-result-title",children:t>0?`Published ${t} of ${m} knowledge asset${m===1?"":"s"} to Verifiable Memory`:R&&P.length===0?"Publish outcome unknown":"NOT published to Verifiable Memory"}),L>0&&e.jsxs("div",{className:"v10-publish-result-details",style:{marginBottom:6},children:["⚠ ",L," asset",L===1?"":"s",": ",Ne(U)]}),P.length>0&&e.jsxs("div",{className:"v10-publish-result-details",style:{marginBottom:6},children:[P.length," asset",P.length===1?"":"s"," could not be published — ",P[0].name,": ",P[0].error,P.length>1?` (+${P.length-1} more)`:""]}),R&&e.jsxs("div",{className:"v10-publish-result-details",style:{marginBottom:6},children:["⚠ ",R]}),e.jsxs("div",{className:"v10-publish-result-details",children:[(j==null?void 0:j.kaId)!=null&&e.jsxs("div",{children:[e.jsx("span",{className:"v10-publish-result-label",children:"Knowledge Asset:"})," ",j.kaId]}),O?e.jsxs("div",{className:"v10-publish-result-tx",children:[e.jsx("span",{className:"v10-publish-result-label",children:"Tx hash:"})," ",e.jsx("span",{className:"mono",title:j.txHash,children:j.txHash}),j.blockNumber!=null&&e.jsxs("span",{className:"v10-publish-result-block",children:[" (block ",j.blockNumber,")"]})]}):e.jsxs("div",{className:"v10-publish-result-details",children:["Verifiable Memory requires a confirmed ",e.jsx("code",{children:"KCCreated"})," event. If a publish did not land on-chain, check the node logs (typically a missing publisher wallet, an unfunded signer, or a chain adapter that isn't V10-ready)."]}),e.jsx(we,{convictionCostCovered:W})]})]})})(),y&&e.jsx("div",{className:"v10-publish-result-card error",children:y})]})}function $(s){if(s!=null)return typeof s=="string"?s:typeof s=="object"&&"value"in s?String(s.value):String(s)}function Q(s){if(!s)return"—";const c=s.lastIndexOf("#"),l=s.lastIndexOf("/"),g=Math.max(c,l);return g>=0?s.slice(g+1):s}function Ue(s){const c=Number.isFinite(s.limit)&&s.limit>0?Math.floor(s.limit):50,l=s.query.trim();if(!l)return`SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT ${c}`;const g=We(l.toLowerCase()),d={subject:`CONTAINS(LCASE(STR(?s)), "${g}")`,predicate:`CONTAINS(LCASE(STR(?p)), "${g}")`,object:`CONTAINS(LCASE(STR(?o)), "${g}")`};return`SELECT ?s ?p ?o WHERE { ?s ?p ?o . FILTER(${s.field==="any"?`(${d.subject} || ${d.predicate} || ${d.object})`:d[s.field]}) } LIMIT ${c}`}function We(s){return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")}export{Ve as MemoryLayerView,$e as PublishPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bM as u,bB as x,be as v,aP as e,bF as j,bN as b,bE as y}from"./index-DW3dBcQk.js";import{r as N}from"./useProjectActivity-BOgGdtS7.js";const k=[{key:"working",title:"Working Memory",short:"WM",icon:"◇",color:"#64748b",desc:"Private agent drafts",tabPrefix:"wm"},{key:"shared",title:"Shared Working Memory",short:"SWM",icon:"◈",color:"#f59e0b",desc:"Team proposals",tabPrefix:"swm"},{key:"verified",title:"Verifiable Memory",short:"VM",icon:"◉",color:"#22c55e",desc:"On-chain knowledge",tabPrefix:"vm"}],f=["http://purl.org/dc/terms/created","http://dkg.io/ontology/github/mergedAt","http://dkg.io/ontology/github/closedAt","http://dkg.io/ontology/decisions/date","http://dkg.io/ontology/tasks/dueDate"];function P(){const{contextGraphs:s}=u(),{hidden:a}=x(),l=v.useMemo(()=>s.filter(t=>!a.has(t.id)),[s,a]);return e.jsxs("div",{className:"v10-memstack",children:[e.jsxs("div",{className:"v10-memstack-head",children:[e.jsx("h1",{className:"v10-memstack-title",children:"Memory Stack"}),e.jsxs("p",{className:"v10-memstack-sub",children:["Every layer across every context graph, at a glance. ",l.length," visible context graph",l.length===1?"":"s"," · hidden context graphs are skipped."]})]}),l.length===0?e.jsx("div",{className:"v10-memstack-empty",children:"No visible context graphs. Create one from the sidebar or un-hide dismissed ones."}):e.jsxs("div",{className:"v10-memstack-table",children:[e.jsxs("div",{className:"v10-memstack-colheads",children:[e.jsx("div",{className:"v10-memstack-colhead project"}),k.map(t=>e.jsxs("div",{className:"v10-memstack-colhead",style:{color:t.color},children:[e.jsx("span",{className:"v10-memstack-colhead-icon",children:t.icon}),e.jsx("span",{className:"v10-memstack-colhead-title",children:t.title}),e.jsx("span",{className:"v10-memstack-colhead-desc",children:t.desc})]},t.key))]}),l.map(t=>e.jsx(g,{cg:t},t.id))]})]})}function g({cg:s}){const a=j(s.id),{openTab:l}=b(),t=y(a),r=v.useMemo(()=>{const c={working:{entities:[],tripleCount:t.wm},shared:{entities:[],tripleCount:t.swm},verified:{entities:[],tripleCount:t.vm}};for(const i of a.entityList)c[i.trustLevel].entities.push(i);for(const i of Object.keys(c))c[i].entities.sort((o,n)=>{const d=h(o),p=h(n);return d&&p?p-d:d?-1:p?1:o.label.localeCompare(n.label)});return c},[a.entityList,t]),m=()=>l({id:`project:${s.id}`,label:s.name||s.id.slice(0,16),closable:!0});return e.jsxs("div",{className:"v10-memstack-row",children:[e.jsxs("div",{className:"v10-memstack-project",children:[e.jsxs("button",{type:"button",className:"v10-memstack-project-btn",onClick:m,children:[e.jsx("span",{className:"v10-memstack-project-dot"}),e.jsx("span",{className:"v10-memstack-project-name",children:s.name||s.id})]}),s.description&&e.jsx("div",{className:"v10-memstack-project-desc",title:s.description,children:s.description}),a.loading&&!a.entityList.length&&e.jsx("div",{className:"v10-memstack-project-status",children:"loading…"}),a.error&&e.jsx("div",{className:"v10-memstack-project-status error",children:a.error})]}),k.map(c=>{const i=r[c.key];return e.jsx(C,{cgId:s.id,color:c.color,layerTitle:c.title,tabPrefix:c.tabPrefix,entityCount:i.entities.length,tripleCount:i.tripleCount,recent:i.entities.slice(0,4),onOpenLayer:()=>l({id:`${c.tabPrefix}:${s.id}`,label:`${c.short} · ${s.name||s.id.slice(0,12)}`,closable:!0})},c.key)})]})}function C({cgId:s,color:a,layerTitle:l,tabPrefix:t,entityCount:r,tripleCount:m,recent:c,onOpenLayer:i}){const o=r===0;return e.jsxs("div",{className:`v10-memstack-cell${o?" empty":""}`,style:{"--cell-color":a},children:[e.jsxs("div",{className:"v10-memstack-cell-stats",children:[e.jsx("span",{className:"v10-memstack-cell-n",children:r}),e.jsxs("span",{className:"v10-memstack-cell-n-lbl",children:["entit",r===1?"y":"ies"]}),e.jsx("span",{className:"v10-memstack-cell-sep",children:"·"}),e.jsx("span",{className:"v10-memstack-cell-t",children:m.toLocaleString()}),e.jsx("span",{className:"v10-memstack-cell-t-lbl",children:"triples"})]}),c.length>0?e.jsx("ul",{className:"v10-memstack-cell-recent",children:c.map(n=>e.jsxs("li",{className:"v10-memstack-cell-recent-item",title:n.label,children:[e.jsx("span",{className:"v10-memstack-cell-recent-bullet"}),e.jsx("span",{className:"v10-memstack-cell-recent-label",children:n.label}),e.jsx("span",{className:"v10-memstack-cell-recent-time",children:N(M(n))})]},n.uri))}):e.jsxs("div",{className:"v10-memstack-cell-empty-hint",children:["Nothing in ",t.toUpperCase()," yet"]}),!o&&e.jsxs("button",{type:"button",className:"v10-memstack-cell-open",onClick:i,title:`Open ${l}`,children:["Open ",t.toUpperCase()," →"]})]})}function h(s){var a;for(const l of f){const t=(a=s.properties.get(l))==null?void 0:a[0];if(!t)continue;const r=new Date(t.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"));if(Number.isFinite(r.getTime()))return r.getTime()}return null}function M(s){const a=h(s);return a?new Date(a):null}export{P as MemoryStackView};
|