@origintrail-official/dkg-node-ui 10.0.11 → 10.0.13
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/LICENSE +201 -201
- package/README.md +50 -50
- package/dist/chain-cursor-stores.js +6 -6
- package/dist/chat-memory.js +209 -209
- package/dist/db.js +955 -955
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/telemetry.d.ts +56 -0
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +96 -6
- package/dist/telemetry.js.map +1 -1
- package/dist-ui/assets/{3d-force-graph-Bl6v-uII.js → 3d-force-graph-C9KowW4u.js} +1 -1
- package/dist-ui/assets/{AgentHub-D2vaQxlw.js → AgentHub-BVrcom9_.js} +1 -1
- package/dist-ui/assets/{AgentProfilePage-BgSTdsjD.js → AgentProfilePage-C9XaTt7j.js} +1 -1
- package/dist-ui/assets/{ApproveWalletsModal-D0Ub_eiD.js → ApproveWalletsModal-BdR2mshx.js} +3 -3
- package/dist-ui/assets/{ConvictionDetailView-CieVypna.js → ConvictionDetailView-cao48GL1.js} +1 -1
- package/dist-ui/assets/{Network-DKw_XEGi.js → Network-B3jCYzr5.js} +1 -1
- package/dist-ui/assets/{OnChainProvenanceCard-Dn_IEP7Q.js → OnChainProvenanceCard-DboMX4Aq.js} +1 -1
- package/dist-ui/assets/{Operations-BO2C3UWB.js → Operations-Dg1gfLXv.js} +1 -1
- package/dist-ui/assets/{PublishingConviction-xKRNHbzk.js → PublishingConviction-Byp6t69e.js} +1 -1
- package/dist-ui/assets/{Settings-DC_d9STV.js → Settings-CxI0SKeV.js} +1 -1
- package/dist-ui/assets/{ccip-zWfeQL8Q.js → ccip-wJ3OMRuz.js} +1 -1
- package/dist-ui/assets/{index-CwRQnNYh.js → index-5DS6xjw0.js} +3 -3
- package/dist-ui/assets/index-DOjsv0r7.css +1 -0
- package/dist-ui/assets/index-KoAnx9JE.js +1661 -0
- package/dist-ui/assets/{jsonld-B67IUHNU-C3ydusi_.js → jsonld-32FQRO67-CDirPi8u.js} +2 -2
- package/dist-ui/assets/{jsonld-G-CM-8JR.js → jsonld-CwHW9UDN.js} +1 -1
- package/dist-ui/assets/{renderer-3d-OSESAPET-ConXqyK6.js → renderer-3d-2EVDZII7-BNXV6iSu.js} +2 -2
- package/dist-ui/assets/{shikiHighlighter-C6lRYd1O.js → shikiHighlighter-C-LWPPSu.js} +1 -1
- package/dist-ui/index.html +14 -14
- package/package.json +4 -3
- package/dist-ui/assets/index-DEtfq9qv.css +0 -1
- package/dist-ui/assets/index-hrI-Ir4l.js +0 -1661
- /package/dist-ui/assets/{ntriples-SF2LFNMC-DH7OofPp.js → ntriples-ZWBY2WET-DH7OofPp.js} +0 -0
- /package/dist-ui/assets/{turtle-BXN4L2BY-BzTu0283.js → turtle-JJPK7LJ5-BzTu0283.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export type { MemoryToolContext, MemoryStats, MemoryEntity, SessionPublicationSt
|
|
|
18
18
|
export { LlmClient, LlmRequestError } from './llm/client.js';
|
|
19
19
|
export { resolveCapabilities } from './llm/capability-resolver.js';
|
|
20
20
|
export type { LlmConfig, LlmChatRequest, LlmChatMessage, LlmStreamEvent, LlmCompletionResult, LlmCapabilities } from './llm/types.js';
|
|
21
|
-
export { initTelemetry, shutdownTelemetry, isTelemetryConfigured, recordGauge, setOperationSpan, } from './telemetry.js';
|
|
21
|
+
export { initTelemetry, shutdownTelemetry, isTelemetryConfigured, flushTelemetry, TERMINAL_FLUSH_BUDGET_MS, recordGauge, setOperationSpan, } from './telemetry.js';
|
|
22
22
|
export type { TelemetryInitConfig, TelemetryResource, OtlpSignalConfig, TelemetryConfig } from './telemetry.js';
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtI,OAAO,EACL,aAAa,EAAE,iBAAiB,EAAE,qBAAqB,EAGvD,cAAc,EAAE,wBAAwB,EAExC,WAAW,EAAE,gBAAgB,GAC9B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,9 @@ export { ChatMemoryManager } from './chat-memory.js';
|
|
|
14
14
|
export { LlmClient, LlmRequestError } from './llm/client.js';
|
|
15
15
|
export { resolveCapabilities } from './llm/capability-resolver.js';
|
|
16
16
|
export { initTelemetry, shutdownTelemetry, isTelemetryConfigured,
|
|
17
|
+
// Flush-only hook for the daemon's terminal shutdown point: exports what has
|
|
18
|
+
// been recorded while leaving the provider live (shutdownTelemetry does not).
|
|
19
|
+
flushTelemetry, TERMINAL_FLUSH_BUDGET_MS,
|
|
17
20
|
// Back-compat shims for the pre-#1317 telemetry API (no-ops / legacy config).
|
|
18
21
|
recordGauge, setOperationSpan, } from './telemetry.js';
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,6BAA6B,EAC7B,yBAAyB,EAEzB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,mBAAmB;AACnB,uEAAuE;AACvE,sEAAsE;AACtE,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,2BAA2B,EAC3B,yCAAyC,GAC1C,MAAM,0BAA0B,CAAC;AA+BlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EA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AE,MAAM,0BAA0B,CAAC;AAOrF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAUrD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EACL,aAAa,EAAE,iBAAiB,EAAE,qBAAqB;AACvD,6EAA6E;AAC7E,8EAA8E;AAC9E,cAAc,EAAE,wBAAwB;AACxC,8EAA8E;AAC9E,WAAW,EAAE,gBAAgB,GAC9B,MAAM,gBAAgB,CAAC"}
|
package/dist/telemetry.d.ts
CHANGED
|
@@ -70,6 +70,53 @@ export interface TelemetryConfig {
|
|
|
70
70
|
export declare function initTelemetry(input: TelemetryInitConfig | TelemetryConfig): Promise<void>;
|
|
71
71
|
/** True once EITHER signal (traces or metrics) has registered a real provider. */
|
|
72
72
|
export declare function isTelemetryConfigured(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Wall-clock reserve for the terminal flush in the daemon's graceful-shutdown
|
|
75
|
+
* path. `SHUTDOWN_HARD_TIMEOUT_MS` is 15 s and the catch-up grace drain ahead
|
|
76
|
+
* of this may already have consumed 5 s, so the flush gets a fixed 2 s — well
|
|
77
|
+
* under the ~10 s remainder, leaving room for runner close, `agent.stop()`,
|
|
78
|
+
* the final `shutdownTelemetry()` and the database close behind it.
|
|
79
|
+
*/
|
|
80
|
+
export declare const TERMINAL_FLUSH_BUDGET_MS = 2000;
|
|
81
|
+
/**
|
|
82
|
+
* Flush pending spans/metrics WITHOUT tearing anything down.
|
|
83
|
+
*
|
|
84
|
+
* Exists because `shutdownTelemetry()` is not a flush: it shuts the providers
|
|
85
|
+
* down, clears the OTel API globals and calls `rebuildMetrics()`, so every
|
|
86
|
+
* later `getMetrics()` binds to a no-op meter. The daemon needs a point in
|
|
87
|
+
* shutdown where already-recorded terminal state is exported while the
|
|
88
|
+
* provider stays LIVE, because work that runs afterwards (`agent.stop()`
|
|
89
|
+
* quiescing parent-side sync) still emits the attempts, bytes and active time
|
|
90
|
+
* that belong to those same terminal records.
|
|
91
|
+
*
|
|
92
|
+
* ## Why each side is bounded differently
|
|
93
|
+
*
|
|
94
|
+
* Neither provider is bounded by default, and they are not bounded the same
|
|
95
|
+
* way (verified against the installed `@opentelemetry/sdk-*@2.8.0`):
|
|
96
|
+
*
|
|
97
|
+
* - `MetricReader.forceFlush(options)` applies **no timeout at all** when
|
|
98
|
+
* `options.timeoutMillis` is absent — it just awaits `onForceFlush()`, whose
|
|
99
|
+
* trailing `this._exporter.forceFlush()` is wrapped by nothing. Passing
|
|
100
|
+
* `timeoutMillis` routes the whole thing through `callWithTimeout`, so the
|
|
101
|
+
* argument — not this comment — is what bounds the meter.
|
|
102
|
+
* - `BasicTracerProvider.forceFlush()` accepts **no arguments**; it reads the
|
|
103
|
+
* constructor's `forceFlushTimeoutMillis` (default 30 000). The only way to
|
|
104
|
+
* bound it per call is to race it.
|
|
105
|
+
*
|
|
106
|
+
* The two bounded legs run concurrently, so the aggregate wait is also the
|
|
107
|
+
* budget. Deliberately there is NO extra outer race around both: an outer
|
|
108
|
+
* bound would return inside the budget even if one leg's own bound were
|
|
109
|
+
* removed, which would make the per-leg bounds untestable — and an untestable
|
|
110
|
+
* bound is how the previous "bounded" flush turned out to have no bound.
|
|
111
|
+
*
|
|
112
|
+
* Never throws into the shutdown path: a timeout or rejection is logged and
|
|
113
|
+
* teardown continues. Bounded effort, not a delivery guarantee — an exporter
|
|
114
|
+
* that cannot flush inside the reserve still loses its last points.
|
|
115
|
+
*/
|
|
116
|
+
export declare function flushTelemetry(options?: {
|
|
117
|
+
budgetMs?: number;
|
|
118
|
+
log?: (message: string) => void;
|
|
119
|
+
}): Promise<void>;
|
|
73
120
|
/**
|
|
74
121
|
* Flush + shut down providers. Used both at daemon teardown AND when telemetry
|
|
75
122
|
* is turned off via the runtime master gate, so it must FULLY reverse
|
|
@@ -77,6 +124,15 @@ export declare function isTelemetryConfigured(): boolean;
|
|
|
77
124
|
* later `initTelemetry` (live re-enable) can register fresh providers — without
|
|
78
125
|
* the `disable()` calls, the API keeps the first (now shut-down) provider and a
|
|
79
126
|
* re-enable would silently no-op. Safe if never initialized; idempotent.
|
|
127
|
+
*
|
|
128
|
+
* Flush and shutdown run SEQUENTIALLY per provider, and that is not tidiness.
|
|
129
|
+
* They used to be pushed into one array and awaited by a single `Promise.all`,
|
|
130
|
+
* i.e. started concurrently against the same provider — and
|
|
131
|
+
* `MeterProvider.forceFlush()` opens with `if (this._shutdown) { diag.warn(…);
|
|
132
|
+
* return; }`. Whichever call won the race decided whether the flush happened at
|
|
133
|
+
* all; it worked only because the synchronous `_shutdown` read happened to be
|
|
134
|
+
* scheduled first. Awaiting the flush before starting the shutdown removes the
|
|
135
|
+
* race instead of relying on scheduling order.
|
|
80
136
|
*/
|
|
81
137
|
export declare function shutdownTelemetry(): Promise<void>;
|
|
82
138
|
/**
|
package/dist/telemetry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAA+B,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAKnG;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WA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igured() {
|
|
115
115
|
return tracerProvider !== null || meterProvider !== null;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Wall-clock reserve for the terminal flush in the daemon's graceful-shutdown
|
|
119
|
+
* path. `SHUTDOWN_HARD_TIMEOUT_MS` is 15 s and the catch-up grace drain ahead
|
|
120
|
+
* of this may already have consumed 5 s, so the flush gets a fixed 2 s — well
|
|
121
|
+
* under the ~10 s remainder, leaving room for runner close, `agent.stop()`,
|
|
122
|
+
* the final `shutdownTelemetry()` and the database close behind it.
|
|
123
|
+
*/
|
|
124
|
+
export const TERMINAL_FLUSH_BUDGET_MS = 2_000;
|
|
125
|
+
/**
|
|
126
|
+
* Flush pending spans/metrics WITHOUT tearing anything down.
|
|
127
|
+
*
|
|
128
|
+
* Exists because `shutdownTelemetry()` is not a flush: it shuts the providers
|
|
129
|
+
* down, clears the OTel API globals and calls `rebuildMetrics()`, so every
|
|
130
|
+
* later `getMetrics()` binds to a no-op meter. The daemon needs a point in
|
|
131
|
+
* shutdown where already-recorded terminal state is exported while the
|
|
132
|
+
* provider stays LIVE, because work that runs afterwards (`agent.stop()`
|
|
133
|
+
* quiescing parent-side sync) still emits the attempts, bytes and active time
|
|
134
|
+
* that belong to those same terminal records.
|
|
135
|
+
*
|
|
136
|
+
* ## Why each side is bounded differently
|
|
137
|
+
*
|
|
138
|
+
* Neither provider is bounded by default, and they are not bounded the same
|
|
139
|
+
* way (verified against the installed `@opentelemetry/sdk-*@2.8.0`):
|
|
140
|
+
*
|
|
141
|
+
* - `MetricReader.forceFlush(options)` applies **no timeout at all** when
|
|
142
|
+
* `options.timeoutMillis` is absent — it just awaits `onForceFlush()`, whose
|
|
143
|
+
* trailing `this._exporter.forceFlush()` is wrapped by nothing. Passing
|
|
144
|
+
* `timeoutMillis` routes the whole thing through `callWithTimeout`, so the
|
|
145
|
+
* argument — not this comment — is what bounds the meter.
|
|
146
|
+
* - `BasicTracerProvider.forceFlush()` accepts **no arguments**; it reads the
|
|
147
|
+
* constructor's `forceFlushTimeoutMillis` (default 30 000). The only way to
|
|
148
|
+
* bound it per call is to race it.
|
|
149
|
+
*
|
|
150
|
+
* The two bounded legs run concurrently, so the aggregate wait is also the
|
|
151
|
+
* budget. Deliberately there is NO extra outer race around both: an outer
|
|
152
|
+
* bound would return inside the budget even if one leg's own bound were
|
|
153
|
+
* removed, which would make the per-leg bounds untestable — and an untestable
|
|
154
|
+
* bound is how the previous "bounded" flush turned out to have no bound.
|
|
155
|
+
*
|
|
156
|
+
* Never throws into the shutdown path: a timeout or rejection is logged and
|
|
157
|
+
* teardown continues. Bounded effort, not a delivery guarantee — an exporter
|
|
158
|
+
* that cannot flush inside the reserve still loses its last points.
|
|
159
|
+
*/
|
|
160
|
+
export async function flushTelemetry(options = {}) {
|
|
161
|
+
const budgetMs = options.budgetMs ?? TERMINAL_FLUSH_BUDGET_MS;
|
|
162
|
+
const log = options.log ?? ((message) => console.warn(message));
|
|
163
|
+
const tracer = tracerProvider;
|
|
164
|
+
const meter = meterProvider;
|
|
165
|
+
if (!tracer && !meter)
|
|
166
|
+
return;
|
|
167
|
+
const legs = [];
|
|
168
|
+
if (meter) {
|
|
169
|
+
legs.push(meter.forceFlush({ timeoutMillis: budgetMs }).catch((err) => {
|
|
170
|
+
log(`[telemetry-flush] metrics flush did not complete: ${errText(err)}`);
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
if (tracer) {
|
|
174
|
+
let timer;
|
|
175
|
+
const raced = Promise.race([
|
|
176
|
+
tracer.forceFlush(),
|
|
177
|
+
new Promise((resolve) => {
|
|
178
|
+
timer = setTimeout(() => resolve('timeout'), budgetMs);
|
|
179
|
+
}),
|
|
180
|
+
])
|
|
181
|
+
.then((outcome) => {
|
|
182
|
+
if (outcome === 'timeout') {
|
|
183
|
+
log(`[telemetry-flush] traces flush exceeded ${budgetMs}ms; continuing teardown.`);
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
.catch((err) => {
|
|
187
|
+
log(`[telemetry-flush] traces flush did not complete: ${errText(err)}`);
|
|
188
|
+
})
|
|
189
|
+
.finally(() => {
|
|
190
|
+
if (timer)
|
|
191
|
+
clearTimeout(timer);
|
|
192
|
+
});
|
|
193
|
+
legs.push(raced);
|
|
194
|
+
}
|
|
195
|
+
await Promise.all(legs);
|
|
196
|
+
}
|
|
197
|
+
function errText(err) {
|
|
198
|
+
return err instanceof Error ? err.message : String(err);
|
|
199
|
+
}
|
|
117
200
|
/**
|
|
118
201
|
* Flush + shut down providers. Used both at daemon teardown AND when telemetry
|
|
119
202
|
* is turned off via the runtime master gate, so it must FULLY reverse
|
|
@@ -121,20 +204,27 @@ export function isTelemetryConfigured() {
|
|
|
121
204
|
* later `initTelemetry` (live re-enable) can register fresh providers — without
|
|
122
205
|
* the `disable()` calls, the API keeps the first (now shut-down) provider and a
|
|
123
206
|
* re-enable would silently no-op. Safe if never initialized; idempotent.
|
|
207
|
+
*
|
|
208
|
+
* Flush and shutdown run SEQUENTIALLY per provider, and that is not tidiness.
|
|
209
|
+
* They used to be pushed into one array and awaited by a single `Promise.all`,
|
|
210
|
+
* i.e. started concurrently against the same provider — and
|
|
211
|
+
* `MeterProvider.forceFlush()` opens with `if (this._shutdown) { diag.warn(…);
|
|
212
|
+
* return; }`. Whichever call won the race decided whether the flush happened at
|
|
213
|
+
* all; it worked only because the synchronous `_shutdown` read happened to be
|
|
214
|
+
* scheduled first. Awaiting the flush before starting the shutdown removes the
|
|
215
|
+
* race instead of relying on scheduling order.
|
|
124
216
|
*/
|
|
125
217
|
export async function shutdownTelemetry() {
|
|
126
218
|
const hadTracer = !!tracerProvider;
|
|
127
219
|
const hadMeter = !!meterProvider;
|
|
128
|
-
const tasks = [];
|
|
129
220
|
if (tracerProvider) {
|
|
130
|
-
|
|
131
|
-
|
|
221
|
+
await tracerProvider.forceFlush().catch(() => { });
|
|
222
|
+
await tracerProvider.shutdown().catch(() => { });
|
|
132
223
|
}
|
|
133
224
|
if (meterProvider) {
|
|
134
|
-
|
|
135
|
-
|
|
225
|
+
await meterProvider.forceFlush().catch(() => { });
|
|
226
|
+
await meterProvider.shutdown().catch(() => { });
|
|
136
227
|
}
|
|
137
|
-
await Promise.all(tasks);
|
|
138
228
|
// Reset the global API so a subsequent initTelemetry() can re-register
|
|
139
229
|
// (setGlobal*Provider only takes effect once until the slot is disabled).
|
|
140
230
|
if (hadTracer)
|
package/dist/telemetry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAA+B,MAAM,yBAAyB,CAAC;AA2CnG,6EAA6E;AAC7E,qFAAqF;AACrF,IAAI,cAAc,GAA8B,IAAI,CAAC;AACrD,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C,+EAA+E;AAC/E,4CAA4C;AAC5C,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C,SAAS,WAAW,CAAC,GAAqB;IACxC,MAAM,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;IAC3C,IAAI,GAAG,CAAC,KAAK;QAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,GAAG,CAAC,KAAK,EAAE,CAAC;IAChE,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3D,CAAC;AAED,qFAAqF;AACrF,SAAS,mBAAmB,CAAC,KAA4C;IACvE,MAAM,MAAM,GAAG,KAAwB,CAAC;IACxC,MAAM,IAAI,GAAG,KAA4B,CAAC;IAC1C,IAAI,MAAM,CAAC,eAAe,IAAI,CAA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,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACjD,MAAM,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,uEAAuE;IACvE,0EAA0E;IAC1E,IAAI,SAAS;QAAE,SAAS,CAAC,OAAO,EAAE,CAAC;IACnC,IAAI,QAAQ,EAAE,CAAC;QACb,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,uEAAuE;QACvE,4EAA4E;QAC5E,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC;QAC1E,cAAc,EAAE,CAAC;IACnB,CAAC;IACD,cAAc,GAAG,IAAI,CAAC;IACtB,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,MAAc;IACvD,gEAAgE;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,YAAoB,EAAE,cAAsB;IAC3E,4DAA4D;AAC9D,CAAC"}
|
|
@@ -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-
|
|
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",`
|
|
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-
|
|
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 +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-
|
|
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};
|