@origintrail-official/dkg-node-ui 10.0.13 → 10.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/chat-memory.d.ts +43 -2
  2. package/dist/chat-memory.d.ts.map +1 -1
  3. package/dist/chat-memory.js +31 -7
  4. package/dist/chat-memory.js.map +1 -1
  5. package/dist/db.d.ts +23 -16
  6. package/dist/db.d.ts.map +1 -1
  7. package/dist/db.js +217 -108
  8. package/dist/db.js.map +1 -1
  9. package/dist/gelf-push-worker.d.ts +1 -1
  10. package/dist/gelf-push-worker.d.ts.map +1 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/otlp-log-worker.d.ts +3 -5
  16. package/dist/otlp-log-worker.d.ts.map +1 -1
  17. package/dist/otlp-log-worker.js +7 -5
  18. package/dist/otlp-log-worker.js.map +1 -1
  19. package/dist/routine-log-retention.d.ts +40 -0
  20. package/dist/routine-log-retention.d.ts.map +1 -0
  21. package/dist/routine-log-retention.js +262 -0
  22. package/dist/routine-log-retention.js.map +1 -0
  23. package/dist/structured-logger.d.ts.map +1 -1
  24. package/dist/structured-logger.js.map +1 -1
  25. package/dist-ui/assets/{3d-force-graph-C9KowW4u.js → 3d-force-graph-CnBoK4hA.js} +1 -1
  26. package/dist-ui/assets/{AgentHub-BVrcom9_.js → AgentHub-BOUZTvCO.js} +1 -1
  27. package/dist-ui/assets/{AgentProfilePage-C9XaTt7j.js → AgentProfilePage-DpF722ai.js} +1 -1
  28. package/dist-ui/assets/{ApproveWalletsModal-BdR2mshx.js → ApproveWalletsModal-CYQqAWZs.js} +3 -3
  29. package/dist-ui/assets/{ConvictionDetailView-cao48GL1.js → ConvictionDetailView-DYsWNc9M.js} +1 -1
  30. package/dist-ui/assets/{Network-B3jCYzr5.js → Network-JVFsFYhR.js} +1 -1
  31. package/dist-ui/assets/{OnChainProvenanceCard-DboMX4Aq.js → OnChainProvenanceCard-DISbYKx1.js} +1 -1
  32. package/dist-ui/assets/{Operations-Dg1gfLXv.js → Operations-Cmt3YpaX.js} +1 -1
  33. package/dist-ui/assets/{PublishingConviction-Byp6t69e.js → PublishingConviction-L-wHlnRP.js} +1 -1
  34. package/dist-ui/assets/{Settings-CxI0SKeV.js → Settings-CvBKeoTW.js} +1 -1
  35. package/dist-ui/assets/{ccip-wJ3OMRuz.js → ccip-m-rmKwvf.js} +1 -1
  36. package/dist-ui/assets/index-BfrYentv.js +1645 -0
  37. package/dist-ui/assets/{index-5DS6xjw0.js → index-UAg6wmCv.js} +3 -3
  38. package/dist-ui/assets/index-VYV5TH6q.css +1 -0
  39. package/dist-ui/assets/{jsonld-32FQRO67-CDirPi8u.js → jsonld-32FQRO67-iGNyLix6.js} +2 -2
  40. package/dist-ui/assets/{jsonld-CwHW9UDN.js → jsonld-CDhTpz6H.js} +1 -1
  41. package/dist-ui/assets/{renderer-3d-2EVDZII7-BNXV6iSu.js → renderer-3d-2EVDZII7-BdEgi2VZ.js} +2 -2
  42. package/dist-ui/assets/{shikiHighlighter-C-LWPPSu.js → shikiHighlighter-Dhz3-Gg5.js} +1 -1
  43. package/dist-ui/index.html +2 -2
  44. package/package.json +5 -4
  45. package/dist-ui/assets/index-DOjsv0r7.css +0 -1
  46. package/dist-ui/assets/index-KoAnx9JE.js +0 -1661
@@ -0,0 +1,262 @@
1
+ const PROTECTED_LOG_LEVELS = ['warn', 'error'];
2
+ // Bump when the persisted index/trigger policy changes. Definition validation
3
+ // still repairs unexpected drift within a version (restores, dev databases).
4
+ export const ROUTINE_LOG_RETENTION_SCHEMA_VERSION = 1;
5
+ const protectedLogLevels = new Set(PROTECTED_LOG_LEVELS);
6
+ const PROTECTED_LOG_LEVELS_SQL = PROTECTED_LOG_LEVELS
7
+ .map((level) => `'${level.replaceAll("'", "''")}'`)
8
+ .join(', ');
9
+ function routineLevelSql(column) {
10
+ return `${column} NOT IN (${PROTECTED_LOG_LEVELS_SQL})`;
11
+ }
12
+ function protectedLevelSql(column) {
13
+ return `${column} IN (${PROTECTED_LOG_LEVELS_SQL})`;
14
+ }
15
+ const ROUTINE_LOG_INDEX_NAME = 'idx_logs_routine_id';
16
+ const ROUTINE_LOG_INDEX_SQL = `
17
+ CREATE INDEX ${ROUTINE_LOG_INDEX_NAME}
18
+ ON logs(id) WHERE ${routineLevelSql('level')}
19
+ `;
20
+ const RETENTION_TRIGGER_DEFINITIONS = [
21
+ {
22
+ name: 'track_routine_log_insert',
23
+ sql: `
24
+ CREATE TRIGGER track_routine_log_insert
25
+ AFTER INSERT ON logs
26
+ WHEN ${routineLevelSql('NEW.level')}
27
+ BEGIN
28
+ UPDATE log_retention_state
29
+ SET routine_count = routine_count + 1
30
+ WHERE singleton_id = 1;
31
+ END
32
+ `,
33
+ },
34
+ {
35
+ name: 'track_routine_log_delete',
36
+ sql: `
37
+ CREATE TRIGGER track_routine_log_delete
38
+ AFTER DELETE ON logs
39
+ WHEN ${routineLevelSql('OLD.level')}
40
+ BEGIN
41
+ UPDATE log_retention_state
42
+ SET routine_count = routine_count - 1
43
+ WHERE singleton_id = 1;
44
+ END
45
+ `,
46
+ },
47
+ {
48
+ name: 'track_routine_log_level_to_protected',
49
+ sql: `
50
+ CREATE TRIGGER track_routine_log_level_to_protected
51
+ AFTER UPDATE OF level ON logs
52
+ WHEN ${routineLevelSql('OLD.level')}
53
+ AND ${protectedLevelSql('NEW.level')}
54
+ BEGIN
55
+ UPDATE log_retention_state
56
+ SET routine_count = routine_count - 1
57
+ WHERE singleton_id = 1;
58
+ END
59
+ `,
60
+ },
61
+ {
62
+ name: 'track_routine_log_level_to_routine',
63
+ sql: `
64
+ CREATE TRIGGER track_routine_log_level_to_routine
65
+ AFTER UPDATE OF level ON logs
66
+ WHEN ${protectedLevelSql('OLD.level')}
67
+ AND ${routineLevelSql('NEW.level')}
68
+ BEGIN
69
+ UPDATE log_retention_state
70
+ SET routine_count = routine_count + 1
71
+ WHERE singleton_id = 1;
72
+ END
73
+ `,
74
+ },
75
+ ];
76
+ const RETENTION_SCHEMA_DEFINITIONS = [
77
+ { name: ROUTINE_LOG_INDEX_NAME, sql: ROUTINE_LOG_INDEX_SQL },
78
+ ...RETENTION_TRIGGER_DEFINITIONS,
79
+ ];
80
+ /** Exact production statement used for bounded oldest-row deletion. */
81
+ export const ROUTINE_LOG_PRUNE_SQL = `
82
+ DELETE FROM logs
83
+ WHERE id IN (
84
+ SELECT id
85
+ FROM logs
86
+ WHERE ${routineLevelSql('level')}
87
+ ORDER BY id ASC
88
+ LIMIT @deleteRows
89
+ )
90
+ `;
91
+ /**
92
+ * Install or repair every SQLite adjunct owned by routine-log retention.
93
+ * Missing state or triggers force a reseed from existing rows before triggers
94
+ * are installed, so upgraded/restored databases regain an exact counter.
95
+ */
96
+ export function installRoutineLogRetentionSchema(db) {
97
+ const install = db.transaction(() => {
98
+ const logsTable = db.prepare(`
99
+ SELECT 1 AS found FROM sqlite_master
100
+ WHERE type = 'table' AND name = 'logs'
101
+ `).get();
102
+ if (!logsTable)
103
+ return;
104
+ const stateTable = db.prepare(`
105
+ SELECT 1 AS found FROM sqlite_master
106
+ WHERE type = 'table' AND name = 'log_retention_state'
107
+ `).get();
108
+ const initialStateColumns = stateTable
109
+ ? new Set(db.prepare('PRAGMA table_info(log_retention_state)').all()
110
+ .map(({ name }) => name))
111
+ : new Set();
112
+ const stateRow = initialStateColumns.has('schema_version')
113
+ ? db.prepare(`
114
+ SELECT schema_version FROM log_retention_state WHERE singleton_id = 1
115
+ `).get()
116
+ : undefined;
117
+ const canonicalSchema = hasCanonicalRetentionDefinitions(db);
118
+ // Reopening a canonical database must not mutate the schema. In
119
+ // particular, recreating the partial index scans every routine log row and
120
+ // defeats the constant-time startup path this state table provides.
121
+ if (stateRow?.schema_version === ROUTINE_LOG_RETENTION_SCHEMA_VERSION
122
+ && canonicalSchema)
123
+ return;
124
+ db.exec(`
125
+ CREATE TABLE IF NOT EXISTS log_retention_state (
126
+ singleton_id INTEGER PRIMARY KEY CHECK (singleton_id = 1),
127
+ schema_version INTEGER NOT NULL CHECK (schema_version > 0),
128
+ routine_count INTEGER NOT NULL CHECK (routine_count >= 0)
129
+ )
130
+ `);
131
+ if (!initialStateColumns.has('schema_version') && stateTable) {
132
+ // Repairs databases created by an earlier development revision of V35.
133
+ db.exec(`
134
+ ALTER TABLE log_retention_state
135
+ ADD COLUMN schema_version INTEGER NOT NULL DEFAULT 0
136
+ `);
137
+ }
138
+ const repairedStateRow = db.prepare(`
139
+ SELECT schema_version FROM log_retention_state WHERE singleton_id = 1
140
+ `).get();
141
+ const needsSchemaRepair = !canonicalSchema;
142
+ const needsReseed = !repairedStateRow
143
+ || repairedStateRow.schema_version !== ROUTINE_LOG_RETENTION_SCHEMA_VERSION
144
+ || !canonicalSchema;
145
+ if (needsSchemaRepair) {
146
+ // Recreate every owned object from immutable versioned SQL only when
147
+ // validation found drift. Rebuilding the partial index is intentionally
148
+ // reserved for this repair path because it scans the logs table.
149
+ db.exec([
150
+ ...RETENTION_TRIGGER_DEFINITIONS.map(({ name }) => `DROP TRIGGER IF EXISTS ${name}`),
151
+ `DROP INDEX IF EXISTS ${ROUTINE_LOG_INDEX_NAME}`,
152
+ ROUTINE_LOG_INDEX_SQL,
153
+ ...RETENTION_TRIGGER_DEFINITIONS.map(({ sql }) => sql),
154
+ ].join(';\n'));
155
+ }
156
+ if (needsReseed) {
157
+ db.prepare(`
158
+ INSERT INTO log_retention_state(singleton_id, schema_version, routine_count)
159
+ SELECT 1, @schemaVersion, COUNT(*) FROM logs
160
+ WHERE ${routineLevelSql('level')}
161
+ ON CONFLICT(singleton_id) DO UPDATE SET
162
+ schema_version = excluded.schema_version,
163
+ routine_count = excluded.routine_count
164
+ `).run({ schemaVersion: ROUTINE_LOG_RETENTION_SCHEMA_VERSION });
165
+ }
166
+ });
167
+ // IMMEDIATE acquires the write reservation before validation/counting.
168
+ // Another connection can only commit after canonical triggers are active,
169
+ // so no write can fall between the seed and its maintenance boundary.
170
+ install.immediate();
171
+ }
172
+ function hasCanonicalRetentionDefinitions(db) {
173
+ const names = RETENTION_SCHEMA_DEFINITIONS.map(({ name }) => name);
174
+ const persisted = new Map(db.prepare(`
175
+ SELECT name, sql FROM sqlite_master
176
+ WHERE name IN (${names.map(() => '?').join(', ')})
177
+ `).all(...names)
178
+ .map(({ name, sql }) => [name, normalizeSchemaSql(sql ?? '')]));
179
+ return RETENTION_SCHEMA_DEFINITIONS.every(({ name, sql }) => (persisted.get(name) === normalizeSchemaSql(sql)));
180
+ }
181
+ function normalizeSchemaSql(sql) {
182
+ return sql.replace(/\s+/g, ' ').trim().replace(/;$/, '');
183
+ }
184
+ export class RoutineLogRetentionInvariantError extends Error {
185
+ constructor() {
186
+ super('Routine log retention state is missing its singleton row; reopen the database to repair it');
187
+ this.name = 'RoutineLogRetentionInvariantError';
188
+ }
189
+ }
190
+ /**
191
+ * Owns the complete count-based retention policy for routine log rows.
192
+ * Warning/error classification, guard cadence, overflow selection, and the
193
+ * bounded deletion statement live together so compatibility writes and the
194
+ * background pruner cannot drift onto different retention rules.
195
+ */
196
+ export class RoutineLogRetention {
197
+ db;
198
+ rowCap;
199
+ batchRows;
200
+ writesSinceGuard = 0;
201
+ constructor(db, rowCap, batchRows) {
202
+ this.db = db;
203
+ this.rowCap = rowCap;
204
+ this.batchRows = batchRows;
205
+ }
206
+ noteCommittedInsert(level) {
207
+ if (!this.isRoutineLevel(level))
208
+ return;
209
+ this.writesSinceGuard += 1;
210
+ // Each guard removes at most one configured batch, so its cadence must
211
+ // never admit more routine rows than that batch can remove.
212
+ const guardInterval = Math.min(1_000, Math.max(1, this.rowCap), this.batchRows);
213
+ if (this.writesSinceGuard < guardInterval)
214
+ return;
215
+ this.writesSinceGuard = 0;
216
+ try {
217
+ this.pruneOverflowBatch();
218
+ }
219
+ catch {
220
+ // The INSERT has already committed. Inline retention is therefore
221
+ // best-effort: surfacing this maintenance failure would falsely report
222
+ // the durable write as failed and invite duplicate retries. The
223
+ // independent volume pruner will retry the same bounded cleanup later.
224
+ }
225
+ }
226
+ hasOverflow() {
227
+ return this.routineCount() > this.rowCap;
228
+ }
229
+ pruneOverflowBatch() {
230
+ // Hold a write reservation from the counter read through deletion. Without
231
+ // it, two connections can both observe the same overflow and the second
232
+ // pruner can delete routine rows below the configured cap.
233
+ return this.db.transaction(() => this.pruneOverflowBatchLocked()).immediate();
234
+ }
235
+ pruneOverflowBatchLocked() {
236
+ const overflowRows = this.routineCount() - this.rowCap;
237
+ if (overflowRows <= 0) {
238
+ return { deleted: 0, hadOverflow: false, hasMore: false };
239
+ }
240
+ const deleteRows = Math.min(this.batchRows, overflowRows);
241
+ const deleted = this.db.prepare(ROUTINE_LOG_PRUNE_SQL).run({ deleteRows }).changes;
242
+ return {
243
+ deleted,
244
+ hadOverflow: true,
245
+ hasMore: overflowRows > deleteRows,
246
+ };
247
+ }
248
+ routineCount() {
249
+ const row = this.db.prepare(`
250
+ SELECT routine_count AS count
251
+ FROM log_retention_state
252
+ WHERE singleton_id = 1 AND schema_version = ?
253
+ `).get(ROUTINE_LOG_RETENTION_SCHEMA_VERSION);
254
+ if (!row)
255
+ throw new RoutineLogRetentionInvariantError();
256
+ return row.count;
257
+ }
258
+ isRoutineLevel(level) {
259
+ return !protectedLogLevels.has(level);
260
+ }
261
+ }
262
+ //# sourceMappingURL=routine-log-retention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routine-log-retention.js","sourceRoot":"","sources":["../src/routine-log-retention.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AACxD,8EAA8E;AAC9E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC;AACtD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS,oBAAoB,CAAC,CAAC;AACjE,MAAM,wBAAwB,GAAG,oBAAoB;KAClD,G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C,EAAE,CAAC;QACxD,OAAO,GAAG,CAAC,KAAK,CAAC;IACnB,CAAC;IAEO,cAAc,CAAC,KAAa;QAClC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"structured-logger.d.ts","sourceRoot":"","sources":["../src/structured-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,MAAM;IAGxC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBADnB,UAAU,EAAE,MAAM,EACD,EAAE,EAAE,WAAW;IAKzB,IAAI,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKlD,IAAI,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKlD,KAAK,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAK5D,OAAO,CAAC,OAAO;CAchB"}
1
+ {"version":3,"file":"structured-logger.d.ts","sourceRoot":"","sources":["../src/structured-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,MAAM;IAGxC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBADnB,UAAU,EAAE,MAAM,EACD,EAAE,EAAE,WAAW;IAKzB,IAAI,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKlD,IAAI,CAAC,GAAG,EAAE,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AAY,EAAE,GAAG,CAAC,WAAW;gBAC7B,MAAM,EAAG,IAA2C,CAAC,UAAU,IAAI,SAAS;gBAC5E,OAAO;aACR,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,+CAA+C;QACjD,CAAC;IACH,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
- import{v as Po,c8 as Lh,aG as Qe,cD as _n,cX as ce,br as bl,cY as V,aM as St,o as si,aO as kt,ct as _l,r as Dt,aQ as Uh,n as Yi,ax as cm,ae as Oh,K as Ih,l as kh,F as dm,bv as hm,ay as Gh,u as fm,cJ as pm,db as z,af as it,cm as xl,ba as cs,bo as Vh,co as Tl,dd as $h,dc as Oe,d6 as k,s as Ge,cd as Ss,aA as vt,bD as It,cZ as ze,a7 as gm,a6 as mm,B as ot,a5 as hs,T as xn,cW as Or,c_ as uo,cI as Zt,t as Ns,bt as ym,S as zh,c9 as bm,cv as vl,i as Wh,ag as _m,aw as xm,aE as Tm,cc as vm,C as Sm,A as Nm,d as Rm,b3 as wm,p as Ws,cO as ht,cr as js,cV as ds,al as st,cS as Ve,a3 as rt,e as jh,ca as Fo,cb as Do,P as Tn,Q as vn,c5 as Jt,c6 as Lo,b_ as Uo,b$ as qh,cT as Hh,cU as Xh,cQ as Sn,cR as Sl,cP as Nl,a0 as Oo,a4 as Kh,R as nn,bq as Hr,j as Em,bs as Am,aP as On,J as qs,a as pn,d3 as Un,bw as Js,d2 as Cm,_ as Rl,$ as wl,E as yu,W as lo,cn as ae,aL as ri,bn as El,aH as dc,bB as Io,d1 as Xr,d5 as Mm,d8 as co,aY as ko,q as Kr,ce as Go,aB as fs,aC as bu,b1 as Yr,b2 as Yh,b0 as xt,be as Qh,a8 as ho,aa as er,X as Zh,as as ii,aq as Al,f as Jh,b4 as ef,aF as hc,b8 as tr,d7 as Bm,cg as tf,cB as nf,bj as sf,bk as rf,bl as of,bm as af,U as uf,V as lf,cy as cf,cx as df,cz as hf,bi as ff,I as Pm,G as Fm,H as Dm,aI as pf,b7 as Nn,a_ as ks,cC as Gs,c as Vs,bb as gn,bf as gf,a9 as mf,ab as yf,Y as bf,at as _f,ar as xf,g as Tf,b5 as vf,bE as Cl,c4 as Qi,bX as Zi,bY as Ji,bZ as eo,c3 as fc,c2 as pc,bW as gc,bV as mc,c0 as _u,c1 as xu,bU as Tu,bx as vu,ci as Su,bC as fo,cl as Nu,bL as Ru,bM as wu,bN as Eu,bO as Au,bP as Cu,bQ as Mu,bR as Bu,bS as Pu,bG as Fu,bH as Du,bI as Lu,bF as Uu,bJ as Ou,bK as Iu,bT as ku,bA as Gu,ck as Vu,bz as po,cj as $u,M as Sf,aT as Lm,aV as Um,aU as Om,aW as Im,aS as km,aR as Gm,az as Vm,bu as $m,cw as zm,cq as Wm,by as jm,D as Vo,cF as Ml,cK as qm,cM as Hm,cL as Xm,a2 as go,bg as Km,ad as Ym,ac as Qm,Z as Zm,au as Jm,av as ey,h as ty,b6 as ny,O as sy,ai as ry,N as iy,ah as oy,ao as ay,cf as uy,d4 as ly,ap as cy,aN as dy,aX as hy,ch as Nf,a1 as Rf,b as fy,aZ as py,a$ as gy,aJ as mo,bd as wf,aK as Ef,m as Af,w as my,k as yy,x as by,cs as _y,bp as xy,y as yo,z as bo,cE as ia,b9 as oa,bc as Ty,bh as vy,aj as Sy,ak as Ny,L as Ry,cA as Bl,aD as wy,an as Ey,am as Ay,d9 as Cy,cu as yc,c7 as My,cp as bc,cN as By,c$ as Py,cH as Cf,cG as Fy,d0 as Dy}from"./three.module-BXIk8GZS.js";import{a3 as Ly}from"./index-KoAnx9JE.js";import{i as fe,s as Uy,e as Pl,c as Oy,d as Iy,a as ky,b as Gy,f as Vy,t as Mf,g as $y,G as zy,T as _c,E as xc}from"./index-5DS6xjw0.js";import{o as Wy,h as jy,m as qy}from"./ordinal-DhEzRPdO.js";const Hs=new bl,mn=new ce,Bf=new V,aa=new ce,to=new ce,_o=new V,zu=new V,Pf=new St,Ff=new V,Df=new V;let nt=null,qt=null;const yn=[],$n={NONE:-1,PAN:0,ROTATE:1};class Hy extends Po{constructor(e,t,n=null){super(t,n),this.objects=e,this.recursive=!0,this.transformGroup=!1,this.rotateSpeed=1,this.raycaster=new Lh,this.mouseButtons={LEFT:Qe.PAN,MIDDLE:Qe.PAN,RIGHT:Qe.ROTATE},this.touches={ONE:_n.PAN},this._onPointerMove=Xy.bind(this),this._onPointerDown=Ky.bind(this),this._onPointerCancel=Yy.bind(this),this._onContextMenu=Qy.bind(this),n!==null&&this.connect(n)}connect(e){super.connect(e),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerCancel),this.domElement.addEventListener("pointerleave",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerCancel),this.domElement.removeEventListener("pointerleave",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="",this.domElement.style.cursor=""}dispose(){this.disconnect()}_updatePointer(e){const t=this.domElement.getBoundingClientRect();mn.x=(e.clientX-t.left)/t.width*2-1,mn.y=-(e.clientY-t.top)/t.height*2+1}_updateState(e){let t;if(e.pointerType==="touch")t=this.touches.ONE;else switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=null}switch(t){case Qe.PAN:case _n.PAN:this.state=$n.PAN;break;case Qe.ROTATE:case _n.ROTATE:this.state=$n.ROTATE;break;default:this.state=$n.NONE}}}function Xy(i){const e=this.object,t=this.domElement,n=this.raycaster;if(this.enabled!==!1){if(this._updatePointer(i),n.setFromCamera(mn,e),nt)this.state===$n.PAN?n.ray.intersectPlane(Hs,_o)&&(nt.position.copy(_o.sub(Bf).applyMatrix4(Pf)),this.dispatchEvent({type:"drag",object:nt})):this.state===$n.ROTATE&&(aa.subVectors(mn,to).multiplyScalar(this.rotateSpeed),nt.rotateOnWorldAxis(Ff,aa.x),nt.rotateOnWorldAxis(Df.normalize(),-aa.y),this.dispatchEvent({type:"drag",object:nt})),to.copy(mn);else if(i.pointerType==="mouse"||i.pointerType==="pen")if(yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0){const s=yn[0].object;Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(s.matrixWorld)),qt!==s&&qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null),qt!==s&&(this.dispatchEvent({type:"hoveron",object:s}),t.style.cursor="pointer",qt=s)}else qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null);to.copy(mn)}}function Ky(i){const e=this.object,t=this.domElement,n=this.raycaster;this.enabled!==!1&&(this._updatePointer(i),this._updateState(i),yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0&&(this.transformGroup===!0?nt=Lf(yn[0].object):nt=yn[0].object,Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(nt.matrixWorld)),n.ray.intersectPlane(Hs,_o)&&(this.state===$n.PAN?(Pf.copy(nt.parent.matrixWorld).invert(),Bf.copy(_o).sub(zu.setFromMatrixPosition(nt.matrixWorld)),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})):this.state===$n.ROTATE&&(Ff.set(0,1,0).applyQuaternion(e.quaternion).normalize(),Df.set(1,0,0).applyQuaternion(e.quaternion).normalize(),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})))),to.copy(mn))}function Yy(){this.enabled!==!1&&(nt&&(this.dispatchEvent({type:"dragend",object:nt}),nt=null),this.domElement.style.cursor=qt?"pointer":"auto",this.state=$n.NONE)}function Qy(i){this.enabled!==!1&&i.preventDefault()}function Lf(i,e=null){return i.isGroup&&(e=i),i.parent===null?e:Lf(i.parent,e)}function Zy(i){eb(i);const e=Jy(i);return i.on=e.on,i.off=e.off,i.fire=e.fire,i}function Jy(i){let e=Object.create(null);return{on:function(t,n,s){if(typeof n!="function")throw new Error("callback is expected to be a function");let r=e[t];return r||(r=e[t]=[]),r.push({callback:n,ctx:s}),i},off:function(t,n){if(typeof t>"u")return e=Object.create(null),i;if(e[t])if(typeof n!="function")delete e[t];else{const o=e[t];for(let a=0;a<o.length;++a)o[a].callback===n&&o.splice(a,1)}return i},fire:function(t){const n=e[t];if(!n)return i;let s;arguments.length>1&&(s=Array.prototype.slice.call(arguments,1));for(let r=0;r<n.length;++r){const o=n[r];o.callback.apply(o.ctx,s)}return i}}}function eb(i){if(!i)throw new Error("Eventify cannot use falsy object as events subject");const e=["on","fire","off"];for(let t=0;t<e.length;++t)if(i.hasOwnProperty(e[t]))throw new Error("Subject cannot be eventified, since it already has property '"+e[t]+"'")}function tb(i){if(i=i||{},"uniqueLinkId"in i&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n",`
1
+ import{v as Po,c8 as Lh,aG as Qe,cD as _n,cX as ce,br as bl,cY as V,aM as St,o as si,aO as kt,ct as _l,r as Dt,aQ as Uh,n as Yi,ax as cm,ae as Oh,K as Ih,l as kh,F as dm,bv as hm,ay as Gh,u as fm,cJ as pm,db as z,af as it,cm as xl,ba as cs,bo as Vh,co as Tl,dd as $h,dc as Oe,d6 as k,s as Ge,cd as Ss,aA as vt,bD as It,cZ as ze,a7 as gm,a6 as mm,B as ot,a5 as hs,T as xn,cW as Or,c_ as uo,cI as Zt,t as Ns,bt as ym,S as zh,c9 as bm,cv as vl,i as Wh,ag as _m,aw as xm,aE as Tm,cc as vm,C as Sm,A as Nm,d as Rm,b3 as wm,p as Ws,cO as ht,cr as js,cV as ds,al as st,cS as Ve,a3 as rt,e as jh,ca as Fo,cb as Do,P as Tn,Q as vn,c5 as Jt,c6 as Lo,b_ as Uo,b$ as qh,cT as Hh,cU as Xh,cQ as Sn,cR as Sl,cP as Nl,a0 as Oo,a4 as Kh,R as nn,bq as Hr,j as Em,bs as Am,aP as On,J as qs,a as pn,d3 as Un,bw as Js,d2 as Cm,_ as Rl,$ as wl,E as yu,W as lo,cn as ae,aL as ri,bn as El,aH as dc,bB as Io,d1 as Xr,d5 as Mm,d8 as co,aY as ko,q as Kr,ce as Go,aB as fs,aC as bu,b1 as Yr,b2 as Yh,b0 as xt,be as Qh,a8 as ho,aa as er,X as Zh,as as ii,aq as Al,f as Jh,b4 as ef,aF as hc,b8 as tr,d7 as Bm,cg as tf,cB as nf,bj as sf,bk as rf,bl as of,bm as af,U as uf,V as lf,cy as cf,cx as df,cz as hf,bi as ff,I as Pm,G as Fm,H as Dm,aI as pf,b7 as Nn,a_ as ks,cC as Gs,c as Vs,bb as gn,bf as gf,a9 as mf,ab as yf,Y as bf,at as _f,ar as xf,g as Tf,b5 as vf,bE as Cl,c4 as Qi,bX as Zi,bY as Ji,bZ as eo,c3 as fc,c2 as pc,bW as gc,bV as mc,c0 as _u,c1 as xu,bU as Tu,bx as vu,ci as Su,bC as fo,cl as Nu,bL as Ru,bM as wu,bN as Eu,bO as Au,bP as Cu,bQ as Mu,bR as Bu,bS as Pu,bG as Fu,bH as Du,bI as Lu,bF as Uu,bJ as Ou,bK as Iu,bT as ku,bA as Gu,ck as Vu,bz as po,cj as $u,M as Sf,aT as Lm,aV as Um,aU as Om,aW as Im,aS as km,aR as Gm,az as Vm,bu as $m,cw as zm,cq as Wm,by as jm,D as Vo,cF as Ml,cK as qm,cM as Hm,cL as Xm,a2 as go,bg as Km,ad as Ym,ac as Qm,Z as Zm,au as Jm,av as ey,h as ty,b6 as ny,O as sy,ai as ry,N as iy,ah as oy,ao as ay,cf as uy,d4 as ly,ap as cy,aN as dy,aX as hy,ch as Nf,a1 as Rf,b as fy,aZ as py,a$ as gy,aJ as mo,bd as wf,aK as Ef,m as Af,w as my,k as yy,x as by,cs as _y,bp as xy,y as yo,z as bo,cE as ia,b9 as oa,bc as Ty,bh as vy,aj as Sy,ak as Ny,L as Ry,cA as Bl,aD as wy,an as Ey,am as Ay,d9 as Cy,cu as yc,c7 as My,cp as bc,cN as By,c$ as Py,cH as Cf,cG as Fy,d0 as Dy}from"./three.module-BXIk8GZS.js";import{a3 as Ly}from"./index-BfrYentv.js";import{i as fe,s as Uy,e as Pl,c as Oy,d as Iy,a as ky,b as Gy,f as Vy,t as Mf,g as $y,G as zy,T as _c,E as xc}from"./index-UAg6wmCv.js";import{o as Wy,h as jy,m as qy}from"./ordinal-DhEzRPdO.js";const Hs=new bl,mn=new ce,Bf=new V,aa=new ce,to=new ce,_o=new V,zu=new V,Pf=new St,Ff=new V,Df=new V;let nt=null,qt=null;const yn=[],$n={NONE:-1,PAN:0,ROTATE:1};class Hy extends Po{constructor(e,t,n=null){super(t,n),this.objects=e,this.recursive=!0,this.transformGroup=!1,this.rotateSpeed=1,this.raycaster=new Lh,this.mouseButtons={LEFT:Qe.PAN,MIDDLE:Qe.PAN,RIGHT:Qe.ROTATE},this.touches={ONE:_n.PAN},this._onPointerMove=Xy.bind(this),this._onPointerDown=Ky.bind(this),this._onPointerCancel=Yy.bind(this),this._onContextMenu=Qy.bind(this),n!==null&&this.connect(n)}connect(e){super.connect(e),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerCancel),this.domElement.addEventListener("pointerleave",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerCancel),this.domElement.removeEventListener("pointerleave",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="",this.domElement.style.cursor=""}dispose(){this.disconnect()}_updatePointer(e){const t=this.domElement.getBoundingClientRect();mn.x=(e.clientX-t.left)/t.width*2-1,mn.y=-(e.clientY-t.top)/t.height*2+1}_updateState(e){let t;if(e.pointerType==="touch")t=this.touches.ONE;else switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=null}switch(t){case Qe.PAN:case _n.PAN:this.state=$n.PAN;break;case Qe.ROTATE:case _n.ROTATE:this.state=$n.ROTATE;break;default:this.state=$n.NONE}}}function Xy(i){const e=this.object,t=this.domElement,n=this.raycaster;if(this.enabled!==!1){if(this._updatePointer(i),n.setFromCamera(mn,e),nt)this.state===$n.PAN?n.ray.intersectPlane(Hs,_o)&&(nt.position.copy(_o.sub(Bf).applyMatrix4(Pf)),this.dispatchEvent({type:"drag",object:nt})):this.state===$n.ROTATE&&(aa.subVectors(mn,to).multiplyScalar(this.rotateSpeed),nt.rotateOnWorldAxis(Ff,aa.x),nt.rotateOnWorldAxis(Df.normalize(),-aa.y),this.dispatchEvent({type:"drag",object:nt})),to.copy(mn);else if(i.pointerType==="mouse"||i.pointerType==="pen")if(yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0){const s=yn[0].object;Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(s.matrixWorld)),qt!==s&&qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null),qt!==s&&(this.dispatchEvent({type:"hoveron",object:s}),t.style.cursor="pointer",qt=s)}else qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null);to.copy(mn)}}function Ky(i){const e=this.object,t=this.domElement,n=this.raycaster;this.enabled!==!1&&(this._updatePointer(i),this._updateState(i),yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0&&(this.transformGroup===!0?nt=Lf(yn[0].object):nt=yn[0].object,Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(nt.matrixWorld)),n.ray.intersectPlane(Hs,_o)&&(this.state===$n.PAN?(Pf.copy(nt.parent.matrixWorld).invert(),Bf.copy(_o).sub(zu.setFromMatrixPosition(nt.matrixWorld)),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})):this.state===$n.ROTATE&&(Ff.set(0,1,0).applyQuaternion(e.quaternion).normalize(),Df.set(1,0,0).applyQuaternion(e.quaternion).normalize(),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})))),to.copy(mn))}function Yy(){this.enabled!==!1&&(nt&&(this.dispatchEvent({type:"dragend",object:nt}),nt=null),this.domElement.style.cursor=qt?"pointer":"auto",this.state=$n.NONE)}function Qy(i){this.enabled!==!1&&i.preventDefault()}function Lf(i,e=null){return i.isGroup&&(e=i),i.parent===null?e:Lf(i.parent,e)}function Zy(i){eb(i);const e=Jy(i);return i.on=e.on,i.off=e.off,i.fire=e.fire,i}function Jy(i){let e=Object.create(null);return{on:function(t,n,s){if(typeof n!="function")throw new Error("callback is expected to be a function");let r=e[t];return r||(r=e[t]=[]),r.push({callback:n,ctx:s}),i},off:function(t,n){if(typeof t>"u")return e=Object.create(null),i;if(e[t])if(typeof n!="function")delete e[t];else{const o=e[t];for(let a=0;a<o.length;++a)o[a].callback===n&&o.splice(a,1)}return i},fire:function(t){const n=e[t];if(!n)return i;let s;arguments.length>1&&(s=Array.prototype.slice.call(arguments,1));for(let r=0;r<n.length;++r){const o=n[r];o.callback.apply(o.ctx,s)}return i}}}function eb(i){if(!i)throw new Error("Eventify cannot use falsy object as events subject");const e=["on","fire","off"];for(let t=0;t<e.length;++t)if(i.hasOwnProperty(e[t]))throw new Error("Subject cannot be eventified, since it already has property '"+e[t]+"'")}function tb(i){if(i=i||{},"uniqueLinkId"in i&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n",`
2
2
  `,`Note: there is also change in default behavior: From now on each graph
3
3
  is considered to be not a multigraph by default (each edge is unique).`),i.multigraph=i.uniqueLinkId),i.multigraph===void 0&&(i.multigraph=!1),typeof Map!="function")throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var e=new Map,t=new Map,n={},s=0,r=i.multigraph?S:T,o=[],a=F,u=F,l=F,c=F,d={version:20,addNode:g,addLink:_,removeLink:P,removeNode:y,getNode:m,getNodeCount:N,getLinkCount:R,getEdgeCount:R,getLinksCount:R,getNodesCount:N,getLinks:v,forEachNode:ve,forEachLinkedNode:se,forEachLink:re,beginUpdate:l,endUpdate:c,clear:ee,hasLink:L,hasNode:m,getLink:L,getLinkById:j};return Zy(d),h(),d;function h(){var I=d.on;d.on=H;function H(){return d.beginUpdate=l=G,d.endUpdate=c=Q,a=f,u=p,d.on=I,I.apply(d,arguments)}}function f(I,H){o.push({link:I,changeType:H})}function p(I,H){o.push({node:I,changeType:H})}function g(I,H){if(I===void 0)throw new Error("Invalid node identifier");l();var le=m(I);return le?(le.data=H,u(le,"update")):(le=new nb(I,H),u(le,"add")),e.set(I,le),c(),le}function m(I){return e.get(I)}function y(I){var H=m(I);if(!H)return!1;l();var le=H.links;return le&&(le.forEach(D),H.links=null),e.delete(I),u(H,"remove"),c(),!0}function _(I,H,le){l();var Ce=m(I)||g(I),B=m(H)||g(H),U=r(I,H,le),K=t.has(U.id);return t.set(U.id,U),Tc(Ce,U),I!==H&&Tc(B,U),a(U,K?"update":"add"),c(),U}function T(I,H,le){var Ce=hi(I,H),B=t.get(Ce);return B?(B.data=le,B):new vc(I,H,le,Ce)}function S(I,H,le){var Ce=hi(I,H),B=n.hasOwnProperty(Ce);if(B||L(I,H)){B||(n[Ce]=0);var U="@"+ ++n[Ce];Ce=hi(I+U,H+U)}return new vc(I,H,le,Ce)}function N(){return e.size}function R(){return t.size}function v(I){var H=m(I);return H?H.links:null}function P(I,H){return H!==void 0&&(I=L(I,H)),D(I)}function D(I){if(!I||!t.get(I.id))return!1;l(),t.delete(I.id);var H=m(I.fromId),le=m(I.toId);return H&&H.links.delete(I),le&&le.links.delete(I),a(I,"remove"),c(),!0}function L(I,H){if(!(I===void 0||H===void 0))return t.get(hi(I,H))}function j(I){if(I!==void 0)return t.get(I)}function ee(){l(),ve(function(I){y(I.id)}),c()}function re(I){if(typeof I=="function")for(var H=t.values(),le=H.next();!le.done;){if(I(le.value))return!0;le=H.next()}}function se(I,H,le){var Ce=m(I);if(Ce&&Ce.links&&typeof H=="function")return le?oe(Ce.links,I,H):Z(Ce.links,I,H)}function Z(I,H,le){for(var Ce,B=I.values(),U=B.next();!U.done;){var K=U.value,me=K.fromId===H?K.toId:K.fromId;if(Ce=le(e.get(me),K),Ce)return!0;U=B.next()}}function oe(I,H,le){for(var Ce,B=I.values(),U=B.next();!U.done;){var K=U.value;if(K.fromId===H&&(Ce=le(e.get(K.toId),K),Ce))return!0;U=B.next()}}function F(){}function G(){s+=1}function Q(){s-=1,s===0&&o.length>0&&(d.fire("changed",o),o.length=0)}function ve(I){if(typeof I!="function")throw new Error("Function is expected to iterate over graph nodes. You passed "+I);for(var H=e.values(),le=H.next();!le.done;){if(I(le.value))return!0;le=H.next()}}}function nb(i,e){this.id=i,this.links=null,this.data=e}function Tc(i,e){i.links?i.links.add(e):i.links=new Set([e])}function vc(i,e,t,n){this.fromId=i,this.toId=e,this.data=t,this.id=n}function hi(i,e){return i.toString()+"👉 "+e.toString()}var fi={exports:{}},Cs={exports:{}},ua,Sc;function Uf(){return Sc||(Sc=1,ua=function(e){return e===0?"x":e===1?"y":e===2?"z":"c"+(e+1)}),ua}var la,Nc;function ar(){if(Nc)return la;Nc=1;const i=Uf();return la=function(t){return n;function n(s,r){let o=r&&r.indent||0,a=r&&r.join!==void 0?r.join:`
4
4
  `,u=Array(o+1).join(" "),l=[];for(let c=0;c<t;++c){let d=i(c),h=c===0?"":u;l.push(h+s.replace(/{var}/g,d))}return l.join(a)}},la}var Rc;function sb(){if(Rc)return Cs.exports;Rc=1;const i=ar();Cs.exports=e,Cs.exports.generateCreateBodyFunctionBody=t,Cs.exports.getVectorCode=s,Cs.exports.getBodyCode=n;function e(r,o){let a=t(r,o),{Body:u}=new Function(a)();return u}function t(r,o){return`
@@ -1 +1 @@
1
- import{ad as e,P as t}from"./index-KoAnx9JE.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
+ import{ad as e,P as t}from"./index-BfrYentv.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 +1 @@
1
- import{aB as w,aL as A,aq as x,ad as e,a as N,A as P,aK as C,aA as T,aF as R,aN as E,aM as M,R as j,f as $,b as B}from"./index-KoAnx9JE.js";const D="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"}],F=({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===D&&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}=M(),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($.Provider,{value:u,children:e.jsx(B.Provider,{value:h,children:e.jsx(F,{agentUri:d,entityList:b.entityList,onSelectEntity:g,onOpenAgent:m,onBack:v})})})};export{_ as AgentProfilePage};
1
+ import{aB as w,aL as A,aq as x,ad as e,a as N,A as P,aK as C,aA as T,aF as R,aN as E,aM as M,R as j,f as $,b as B}from"./index-BfrYentv.js";const D="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"}],F=({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===D&&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}=M(),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($.Provider,{value:u,children:e.jsx(B.Provider,{value:h,children:e.jsx(F,{agentUri:d,entityList:b.entityList,onSelectEntity:g,onOpenAgent:m,onBack:v})})})};export{_ as AgentProfilePage};