@burdenoff/microfe-vibecontrols 2026.522.9 → 2026.523.2

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.
@@ -0,0 +1,632 @@
1
+ import { VIBE_PERMISSIONS as e } from "../../constants/permissions.js";
2
+ import { VibeLlmContextAdminPanel as t } from "./VibeLlmContextAdminPanel.js";
3
+ import { useMemo as n, useState as r } from "react";
4
+ import { Bot as i, Check as a, Clock as o, Copy as s, EyeOff as ee, Info as c, Lock as l, RefreshCw as te, RotateCw as ne, Trash2 as u } from "lucide-react";
5
+ import { gql as d } from "@apollo/client";
6
+ import { useMutation as f, useQuery as p } from "@apollo/client/react";
7
+ import { usePermissions as m } from "@burdenoff/fe-libs/shared/providers/shell";
8
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
9
+ //#region src/components/vibe/VibeLlmContextTabPanel.tsx
10
+ var v = [
11
+ "core",
12
+ "agents",
13
+ "sessions",
14
+ "notes",
15
+ "catalogs",
16
+ "docs",
17
+ "config",
18
+ "security",
19
+ "plugins"
20
+ ], y = d`
21
+ query MyVibeLlmContextSettings($vibeId: ID!) {
22
+ myVibeLlmContextSettings(vibeId: $vibeId) {
23
+ vibeId
24
+ ttlSeconds
25
+ includeCredentials
26
+ includes
27
+ customContextText
28
+ defaultAgentIdOverride
29
+ sessionsLimit
30
+ notesLimit
31
+ docsPagesLimit
32
+ securityRunsLimit
33
+ updatedAt
34
+ }
35
+ }
36
+ `, b = d`
37
+ query MyVibeLlmContextTokens($vibeId: ID!) {
38
+ myVibeLlmContextTokens(vibeId: $vibeId) {
39
+ id
40
+ vibeId
41
+ userId
42
+ label
43
+ tokenFingerprint
44
+ includeCredentials
45
+ includes
46
+ status
47
+ expiresAt
48
+ lastFetchedAt
49
+ fetchCount
50
+ createdAt
51
+ revokedAt
52
+ revokedReason
53
+ }
54
+ }
55
+ `, re = d`
56
+ mutation SetMyVibeLlmContextSettings($vibeId: ID!, $input: VibeLlmContextSettingsInput!) {
57
+ setMyVibeLlmContextSettings(vibeId: $vibeId, input: $input) {
58
+ vibeId
59
+ ttlSeconds
60
+ includeCredentials
61
+ includes
62
+ customContextText
63
+ defaultAgentIdOverride
64
+ sessionsLimit
65
+ notesLimit
66
+ docsPagesLimit
67
+ securityRunsLimit
68
+ updatedAt
69
+ }
70
+ }
71
+ `, x = d`
72
+ mutation GenerateVibeLlmContextUrl($vibeId: ID!, $input: VibeLlmContextMintInput) {
73
+ generateVibeLlmContextUrl(vibeId: $vibeId, input: $input) {
74
+ tokenId
75
+ url
76
+ token
77
+ expiresAt
78
+ ttlSeconds
79
+ includes
80
+ includeCredentials
81
+ label
82
+ tokenFingerprint
83
+ }
84
+ }
85
+ `, S = d`
86
+ mutation RevokeVibeLlmContextToken($tokenId: ID!) {
87
+ revokeVibeLlmContextToken(tokenId: $tokenId) {
88
+ id
89
+ status
90
+ revokedAt
91
+ }
92
+ }
93
+ `, C = d`
94
+ mutation RotateVibeLlmContextUrl($tokenId: ID!, $input: VibeLlmContextMintInput) {
95
+ rotateVibeLlmContextUrl(tokenId: $tokenId, input: $input) {
96
+ tokenId
97
+ url
98
+ token
99
+ expiresAt
100
+ ttlSeconds
101
+ includes
102
+ includeCredentials
103
+ label
104
+ tokenFingerprint
105
+ }
106
+ }
107
+ `, w = d`
108
+ mutation RevokeAllMyVibeLlmContextTokens($vibeId: ID!) {
109
+ revokeAllMyVibeLlmContextTokens(vibeId: $vibeId)
110
+ }
111
+ `, T = d`
112
+ query MyVibeLlmContextTokenAudits($tokenId: ID!, $limit: Int) {
113
+ myVibeLlmContextTokenAudits(tokenId: $tokenId, limit: $limit) {
114
+ id
115
+ fetchedAt
116
+ remoteIp
117
+ userAgent
118
+ format
119
+ bytes
120
+ durationMs
121
+ status
122
+ }
123
+ }
124
+ `, E = [
125
+ {
126
+ label: "1 hour",
127
+ hours: 1
128
+ },
129
+ {
130
+ label: "6 hours",
131
+ hours: 6
132
+ },
133
+ {
134
+ label: "24 hours",
135
+ hours: 24
136
+ },
137
+ {
138
+ label: "7 days",
139
+ hours: 168
140
+ }
141
+ ];
142
+ async function D(e) {
143
+ try {
144
+ await navigator.clipboard.writeText(e);
145
+ } catch {
146
+ let t = document.createElement("textarea");
147
+ t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
148
+ }
149
+ }
150
+ function O(e) {
151
+ let t = new Date(e).getTime() - Date.now();
152
+ if (t < 0) return "expired";
153
+ let n = Math.floor(t / (1e3 * 60 * 60)), r = Math.floor(t % (1e3 * 60 * 60) / (1e3 * 60));
154
+ return n > 24 ? `${Math.floor(n / 24)}d` : n > 0 ? `${n}h ${r}m` : `${r}m`;
155
+ }
156
+ function k({ vibeId: d, attachedAgents: T = [] }) {
157
+ let { hasPermission: k } = m(), ae = k(e.VIBE_MANAGE), oe = p(y, {
158
+ variables: { vibeId: d },
159
+ fetchPolicy: "cache-and-network"
160
+ }), A = p(b, {
161
+ variables: { vibeId: d },
162
+ fetchPolicy: "cache-and-network"
163
+ }), [se, j] = f(re, { refetchQueries: ["MyVibeLlmContextSettings"] }), [M, N] = f(x, { refetchQueries: ["MyVibeLlmContextTokens"] }), [P] = f(S, { refetchQueries: ["MyVibeLlmContextTokens"] }), [F] = f(C, { refetchQueries: ["MyVibeLlmContextTokens"] }), [I] = f(w, { refetchQueries: ["MyVibeLlmContextTokens"] }), L = oe.data?.myVibeLlmContextSettings, R = A.data?.myVibeLlmContextTokens ?? [], [z, B] = r(1), [V, H] = r(!1), [U, W] = r(new Set(v)), [G, K] = r(""), [q, J] = r(""), [Y, ce] = r(""), [X, Z] = r(null), [le, Q] = r(!1), [$, ue] = r(null);
164
+ n(() => {
165
+ L && (B(Math.max(1, Math.round((L.ttlSeconds ?? 3600) / 3600))), H(L.includeCredentials), W(new Set(L.includes ?? v)), K(L.customContextText ?? ""), J(L.defaultAgentIdOverride ?? ""));
166
+ }, [L]);
167
+ let de = (e) => {
168
+ W((t) => {
169
+ let n = new Set(t);
170
+ return n.has(e) ? n.delete(e) : n.add(e), n;
171
+ });
172
+ };
173
+ return /* @__PURE__ */ _("div", {
174
+ className: "space-y-6 max-w-5xl",
175
+ children: [
176
+ /* @__PURE__ */ g("div", {
177
+ className: "rounded-lg border border-status-warning-border bg-status-warning-bg/30 p-4",
178
+ children: /* @__PURE__ */ _("div", {
179
+ className: "flex items-start gap-3",
180
+ children: [/* @__PURE__ */ g(l, { className: "w-5 h-5 text-status-warning-text mt-0.5" }), /* @__PURE__ */ _("div", {
181
+ className: "text-sm text-text-primary",
182
+ children: [/* @__PURE__ */ g("p", {
183
+ className: "font-medium mb-1",
184
+ children: "LLM Context — share this vibe with any LLM via a signed URL"
185
+ }), /* @__PURE__ */ g("p", {
186
+ className: "text-text-secondary",
187
+ children: "Anyone with the URL can read the snapshot until it expires. When \"Include credentials\" is on, the snapshot exposes agent tunnel URLs + API keys. Default is redacted. Rotate or revoke any URL from the list below at any time."
188
+ })]
189
+ })]
190
+ })
191
+ }),
192
+ /* @__PURE__ */ _("section", {
193
+ className: "bg-bg-surface border border-border-default rounded-lg p-5 space-y-4",
194
+ children: [
195
+ /* @__PURE__ */ _("header", {
196
+ className: "flex items-center justify-between",
197
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h3", {
198
+ className: "text-base font-semibold text-text-primary",
199
+ children: "Saved settings"
200
+ }), /* @__PURE__ */ g("p", {
201
+ className: "text-sm text-text-secondary",
202
+ children: "Defaults used when you generate a URL. Snapshotted into each minted token, so future edits don't change already-minted URLs."
203
+ })] }), /* @__PURE__ */ g("button", {
204
+ onClick: async () => {
205
+ await se({ variables: {
206
+ vibeId: d,
207
+ input: {
208
+ ttlSeconds: Math.max(60, Math.min(10080 * 60, z * 60 * 60)),
209
+ includeCredentials: V,
210
+ includes: Array.from(U),
211
+ customContextText: G,
212
+ defaultAgentIdOverride: q || null
213
+ }
214
+ } });
215
+ },
216
+ disabled: j.loading,
217
+ className: "px-3 py-1.5 text-sm bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover disabled:opacity-50",
218
+ children: j.loading ? "Saving…" : "Save settings"
219
+ })]
220
+ }),
221
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
222
+ className: "block text-sm font-medium text-text-primary mb-2",
223
+ children: "URL expiry"
224
+ }), /* @__PURE__ */ _("div", {
225
+ className: "flex flex-wrap items-center gap-2",
226
+ children: [
227
+ E.map((e) => /* @__PURE__ */ g("button", {
228
+ onClick: () => B(e.hours),
229
+ className: `px-3 py-1.5 text-sm rounded-md border ${z === e.hours ? "bg-action-primary-bg text-action-primary-text border-action-primary-bg" : "bg-bg-sunken text-text-primary border-border-default"}`,
230
+ children: e.label
231
+ }, e.hours)),
232
+ /* @__PURE__ */ g("span", {
233
+ className: "text-sm text-text-secondary mx-1",
234
+ children: "or custom hours:"
235
+ }),
236
+ /* @__PURE__ */ g("input", {
237
+ type: "number",
238
+ min: 1,
239
+ max: 168,
240
+ value: z,
241
+ onChange: (e) => B(Math.max(1, Math.min(168, Number(e.target.value) || 1))),
242
+ className: "w-24 px-2 py-1.5 text-sm bg-bg-sunken border border-border-default rounded-md text-text-primary"
243
+ })
244
+ ]
245
+ })] }),
246
+ /* @__PURE__ */ g("div", { children: /* @__PURE__ */ _("label", {
247
+ className: "flex items-center gap-2 text-sm text-text-primary",
248
+ children: [
249
+ /* @__PURE__ */ g("input", {
250
+ type: "checkbox",
251
+ checked: V,
252
+ onChange: (e) => H(e.target.checked),
253
+ className: "w-4 h-4"
254
+ }),
255
+ /* @__PURE__ */ g("span", { children: "Include credentials (tunnel URLs + agent API keys)" }),
256
+ !V && /* @__PURE__ */ g(ee, { className: "w-4 h-4 text-text-secondary" })
257
+ ]
258
+ }) }),
259
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
260
+ className: "block text-sm font-medium text-text-primary mb-2",
261
+ children: "Sections to include"
262
+ }), /* @__PURE__ */ g("div", {
263
+ className: "flex flex-wrap gap-2",
264
+ children: v.map((e) => /* @__PURE__ */ g("button", {
265
+ onClick: () => de(e),
266
+ className: `px-2.5 py-1 text-xs rounded-full border ${U.has(e) ? "bg-action-primary-bg/10 text-action-primary-bg border-action-primary-bg" : "bg-bg-sunken text-text-secondary border-border-default"}`,
267
+ children: e
268
+ }, e))
269
+ })] }),
270
+ T.length > 0 && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
271
+ className: "block text-sm font-medium text-text-primary mb-2",
272
+ children: "Default agent for context fetch"
273
+ }), /* @__PURE__ */ _("select", {
274
+ value: q,
275
+ onChange: (e) => J(e.target.value),
276
+ className: "w-full px-3 py-2 text-sm bg-bg-sunken border border-border-default rounded-md text-text-primary",
277
+ children: [/* @__PURE__ */ g("option", {
278
+ value: "",
279
+ children: "(use my per-vibe default from settings)"
280
+ }), T.map((e) => /* @__PURE__ */ g("option", {
281
+ value: e.id,
282
+ children: e.name
283
+ }, e.id))]
284
+ })] }),
285
+ /* @__PURE__ */ _("div", { children: [
286
+ /* @__PURE__ */ g("label", {
287
+ className: "block text-sm font-medium text-text-primary mb-2",
288
+ children: "Custom context text"
289
+ }),
290
+ /* @__PURE__ */ g("textarea", {
291
+ value: G,
292
+ onChange: (e) => K(e.target.value.slice(0, 8192)),
293
+ rows: 5,
294
+ placeholder: "Free-form notes embedded in every snapshot you mint AFTER saving (existing tokens keep their original copy).",
295
+ className: "w-full px-3 py-2 text-sm bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
296
+ }),
297
+ /* @__PURE__ */ _("p", {
298
+ className: "text-xs text-text-secondary mt-1",
299
+ children: [G.length, " / 8192 chars"]
300
+ })
301
+ ] })
302
+ ]
303
+ }),
304
+ /* @__PURE__ */ _("section", {
305
+ className: "bg-bg-surface border border-border-default rounded-lg p-5 space-y-4",
306
+ children: [
307
+ /* @__PURE__ */ _("header", { children: [/* @__PURE__ */ g("h3", {
308
+ className: "text-base font-semibold text-text-primary",
309
+ children: "Generate a new URL"
310
+ }), /* @__PURE__ */ g("p", {
311
+ className: "text-sm text-text-secondary",
312
+ children: "Mints a fresh signed URL using your current settings. The full token is only shown once — copy it before navigating away. Use Rotate below if you lose it."
313
+ })] }),
314
+ /* @__PURE__ */ _("div", {
315
+ className: "flex flex-wrap items-end gap-2",
316
+ children: [/* @__PURE__ */ _("div", {
317
+ className: "flex-1 min-w-[200px]",
318
+ children: [/* @__PURE__ */ g("label", {
319
+ className: "block text-sm font-medium text-text-primary mb-1",
320
+ children: "Label (optional)"
321
+ }), /* @__PURE__ */ g("input", {
322
+ type: "text",
323
+ value: Y,
324
+ onChange: (e) => ce(e.target.value.slice(0, 120)),
325
+ placeholder: "e.g. Claude desktop",
326
+ className: "w-full px-3 py-2 text-sm bg-bg-sunken border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder"
327
+ })]
328
+ }), /* @__PURE__ */ g("button", {
329
+ onClick: async () => {
330
+ let e = await M({ variables: {
331
+ vibeId: d,
332
+ input: {
333
+ label: Y || null,
334
+ ttlSeconds: Math.max(60, Math.min(10080 * 60, z * 60 * 60)),
335
+ includeCredentials: V,
336
+ includes: Array.from(U)
337
+ }
338
+ } });
339
+ e.data && (Z(e.data.generateVibeLlmContextUrl), Q(!1));
340
+ },
341
+ disabled: N.loading,
342
+ className: "px-4 py-2 text-sm bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover disabled:opacity-50",
343
+ children: N.loading ? "Generating…" : "Generate URL"
344
+ })]
345
+ }),
346
+ X && /* @__PURE__ */ _("div", {
347
+ className: "rounded-md border border-status-success-border bg-status-success-bg/20 p-3",
348
+ children: [/* @__PURE__ */ _("div", {
349
+ className: "flex items-center gap-2 text-sm mb-2",
350
+ children: [
351
+ /* @__PURE__ */ g(a, { className: "w-4 h-4 text-status-success-text" }),
352
+ /* @__PURE__ */ g("span", {
353
+ className: "font-medium text-text-primary",
354
+ children: "URL generated"
355
+ }),
356
+ /* @__PURE__ */ _("span", {
357
+ className: "text-xs text-text-secondary",
358
+ children: ["expires in ", O(X.expiresAt)]
359
+ })
360
+ ]
361
+ }), /* @__PURE__ */ _("div", {
362
+ className: "flex items-center gap-2",
363
+ children: [/* @__PURE__ */ g("input", {
364
+ readOnly: !0,
365
+ value: X.url,
366
+ className: "flex-1 px-2 py-1.5 text-xs bg-bg-sunken border border-border-default rounded font-mono text-text-primary",
367
+ "aria-label": "Generated LLM context URL"
368
+ }), /* @__PURE__ */ g("button", {
369
+ onClick: async () => {
370
+ X && (await D(X.url), Q(!0), setTimeout(() => Q(!1), 2e3));
371
+ },
372
+ className: "px-2 py-1.5 text-xs bg-bg-sunken border border-border-default rounded text-text-primary",
373
+ "aria-label": "Copy URL",
374
+ children: le ? /* @__PURE__ */ g(a, { className: "w-4 h-4 text-status-success-text" }) : /* @__PURE__ */ g(s, { className: "w-4 h-4" })
375
+ })]
376
+ })]
377
+ })
378
+ ]
379
+ }),
380
+ /* @__PURE__ */ _("section", {
381
+ className: "bg-bg-surface border border-border-default rounded-lg p-5 space-y-3",
382
+ children: [
383
+ /* @__PURE__ */ _("header", {
384
+ className: "flex items-center justify-between",
385
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h3", {
386
+ className: "text-base font-semibold text-text-primary",
387
+ children: "Your active URLs"
388
+ }), /* @__PURE__ */ g("p", {
389
+ className: "text-sm text-text-secondary",
390
+ children: "Tokens you minted for this vibe. Revoke and rotate work immediately; revoked tokens fail with 403 even if the JWT hasn't expired."
391
+ })] }), /* @__PURE__ */ _("button", {
392
+ onClick: () => I({ variables: { vibeId: d } }),
393
+ className: "flex items-center gap-1 px-3 py-1.5 text-sm bg-status-error-bg/10 text-status-error-text border border-status-error-border rounded-md hover:bg-status-error-bg/20",
394
+ children: [/* @__PURE__ */ g(u, { className: "w-4 h-4" }), "Revoke all"]
395
+ })]
396
+ }),
397
+ A.loading && R.length === 0 && /* @__PURE__ */ _("div", {
398
+ className: "text-sm text-text-secondary py-4 flex items-center gap-2",
399
+ children: [/* @__PURE__ */ g(te, { className: "w-4 h-4 animate-spin" }), "Loading tokens…"]
400
+ }),
401
+ R.length === 0 && !A.loading && /* @__PURE__ */ _("div", {
402
+ className: "text-sm text-text-secondary py-4 flex items-center gap-2",
403
+ children: [/* @__PURE__ */ g(c, { className: "w-4 h-4" }), "No URLs minted yet for this vibe."]
404
+ }),
405
+ R.length > 0 && /* @__PURE__ */ g("div", {
406
+ className: "overflow-x-auto",
407
+ children: /* @__PURE__ */ _("table", {
408
+ className: "w-full text-sm",
409
+ children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ _("tr", {
410
+ className: "border-b border-border-default text-left text-xs text-text-secondary",
411
+ children: [
412
+ /* @__PURE__ */ g("th", {
413
+ className: "py-2 pr-3",
414
+ children: "Label"
415
+ }),
416
+ /* @__PURE__ */ g("th", {
417
+ className: "py-2 pr-3",
418
+ children: "Fingerprint"
419
+ }),
420
+ /* @__PURE__ */ g("th", {
421
+ className: "py-2 pr-3",
422
+ children: "Sections"
423
+ }),
424
+ /* @__PURE__ */ g("th", {
425
+ className: "py-2 pr-3",
426
+ children: "Creds"
427
+ }),
428
+ /* @__PURE__ */ g("th", {
429
+ className: "py-2 pr-3",
430
+ children: "Status"
431
+ }),
432
+ /* @__PURE__ */ g("th", {
433
+ className: "py-2 pr-3",
434
+ children: "Expires"
435
+ }),
436
+ /* @__PURE__ */ g("th", {
437
+ className: "py-2 pr-3",
438
+ children: "Fetches"
439
+ }),
440
+ /* @__PURE__ */ g("th", {
441
+ className: "py-2 pr-3",
442
+ children: "Actions"
443
+ })
444
+ ]
445
+ }) }), /* @__PURE__ */ g("tbody", { children: R.map((e) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("tr", {
446
+ className: "border-b border-border-subtle align-top",
447
+ children: [
448
+ /* @__PURE__ */ g("td", {
449
+ className: "py-2 pr-3 text-text-primary",
450
+ children: e.label ?? "—"
451
+ }),
452
+ /* @__PURE__ */ g("td", {
453
+ className: "py-2 pr-3 font-mono text-xs text-text-secondary",
454
+ children: e.tokenFingerprint
455
+ }),
456
+ /* @__PURE__ */ g("td", {
457
+ className: "py-2 pr-3 text-text-secondary",
458
+ children: /* @__PURE__ */ g("span", {
459
+ className: "text-xs",
460
+ children: e.includes.join(", ")
461
+ })
462
+ }),
463
+ /* @__PURE__ */ g("td", {
464
+ className: "py-2 pr-3",
465
+ children: e.includeCredentials ? /* @__PURE__ */ g("span", {
466
+ className: "text-xs text-status-warning-text",
467
+ children: "on"
468
+ }) : /* @__PURE__ */ g("span", {
469
+ className: "text-xs text-text-secondary",
470
+ children: "off"
471
+ })
472
+ }),
473
+ /* @__PURE__ */ g("td", {
474
+ className: "py-2 pr-3",
475
+ children: /* @__PURE__ */ g("span", {
476
+ className: `text-xs px-1.5 py-0.5 rounded ${e.status === "ACTIVE" ? "bg-status-success-bg/20 text-status-success-text" : "bg-bg-sunken text-text-secondary"}`,
477
+ children: e.status
478
+ })
479
+ }),
480
+ /* @__PURE__ */ g("td", {
481
+ className: "py-2 pr-3 text-xs text-text-secondary",
482
+ children: /* @__PURE__ */ _("span", {
483
+ className: "inline-flex items-center gap-1",
484
+ children: [/* @__PURE__ */ g(o, { className: "w-3 h-3" }), O(e.expiresAt)]
485
+ })
486
+ }),
487
+ /* @__PURE__ */ g("td", {
488
+ className: "py-2 pr-3 text-xs text-text-secondary",
489
+ children: e.fetchCount
490
+ }),
491
+ /* @__PURE__ */ g("td", {
492
+ className: "py-2 pr-3",
493
+ children: /* @__PURE__ */ _("div", {
494
+ className: "flex gap-1",
495
+ children: [/* @__PURE__ */ g("button", {
496
+ onClick: () => ue($ === e.id ? null : e.id),
497
+ title: "Show fetch history",
498
+ className: "p-1.5 text-text-secondary hover:text-text-primary",
499
+ children: /* @__PURE__ */ g(c, { className: "w-4 h-4" })
500
+ }), e.status === "ACTIVE" && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
501
+ onClick: async () => {
502
+ let t = await F({ variables: { tokenId: e.id } });
503
+ t.data && (Z(t.data.rotateVibeLlmContextUrl), Q(!1));
504
+ },
505
+ title: "Rotate (revoke + mint a new one with same settings)",
506
+ className: "p-1.5 text-text-secondary hover:text-text-primary",
507
+ children: /* @__PURE__ */ g(ne, { className: "w-4 h-4" })
508
+ }), /* @__PURE__ */ g("button", {
509
+ onClick: () => P({ variables: { tokenId: e.id } }),
510
+ title: "Revoke",
511
+ className: "p-1.5 text-status-error-text hover:opacity-80",
512
+ children: /* @__PURE__ */ g(u, { className: "w-4 h-4" })
513
+ })] })]
514
+ })
515
+ })
516
+ ]
517
+ }, e.id), $ === e.id && /* @__PURE__ */ g("tr", { children: /* @__PURE__ */ g("td", {
518
+ colSpan: 8,
519
+ className: "py-2 pr-3 bg-bg-sunken/40",
520
+ children: /* @__PURE__ */ g(ie, { tokenId: e.id })
521
+ }) }, `${e.id}-audits`)] })) })]
522
+ })
523
+ })
524
+ ]
525
+ }),
526
+ ae && /* @__PURE__ */ g(t, { vibeId: d }),
527
+ /* @__PURE__ */ _("p", {
528
+ className: "text-xs text-text-secondary flex items-center gap-1",
529
+ children: [
530
+ /* @__PURE__ */ g(i, { className: "w-3 h-3" }),
531
+ "Tip: pipe the URL to any LLM with",
532
+ " ",
533
+ /* @__PURE__ */ g("code", {
534
+ className: "bg-bg-sunken px-1 rounded",
535
+ children: "curl <url>"
536
+ }),
537
+ " or",
538
+ " ",
539
+ /* @__PURE__ */ g("code", {
540
+ className: "bg-bg-sunken px-1 rounded",
541
+ children: "curl -H \"Accept: text/markdown\" <url>"
542
+ }),
543
+ " ",
544
+ "for a markdown snapshot."
545
+ ]
546
+ })
547
+ ]
548
+ });
549
+ }
550
+ function ie({ tokenId: e }) {
551
+ let { data: t, loading: n } = p(T, {
552
+ variables: {
553
+ tokenId: e,
554
+ limit: 100
555
+ },
556
+ fetchPolicy: "cache-and-network"
557
+ }), r = t?.myVibeLlmContextTokenAudits ?? [];
558
+ return /* @__PURE__ */ g("div", {
559
+ className: "text-xs",
560
+ children: n && r.length === 0 ? /* @__PURE__ */ g("span", {
561
+ className: "text-text-secondary",
562
+ children: "Loading audit log…"
563
+ }) : r.length === 0 ? /* @__PURE__ */ g("span", {
564
+ className: "text-text-secondary",
565
+ children: "No fetches yet."
566
+ }) : /* @__PURE__ */ _("table", {
567
+ className: "w-full",
568
+ children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ _("tr", {
569
+ className: "text-text-secondary",
570
+ children: [
571
+ /* @__PURE__ */ g("th", {
572
+ className: "text-left py-1 pr-2",
573
+ children: "When"
574
+ }),
575
+ /* @__PURE__ */ g("th", {
576
+ className: "text-left py-1 pr-2",
577
+ children: "IP"
578
+ }),
579
+ /* @__PURE__ */ g("th", {
580
+ className: "text-left py-1 pr-2",
581
+ children: "Format"
582
+ }),
583
+ /* @__PURE__ */ g("th", {
584
+ className: "text-left py-1 pr-2",
585
+ children: "Bytes"
586
+ }),
587
+ /* @__PURE__ */ g("th", {
588
+ className: "text-left py-1 pr-2",
589
+ children: "Status"
590
+ }),
591
+ /* @__PURE__ */ g("th", {
592
+ className: "text-left py-1 pr-2",
593
+ children: "UA"
594
+ })
595
+ ]
596
+ }) }), /* @__PURE__ */ g("tbody", { children: r.map((e) => /* @__PURE__ */ _("tr", {
597
+ className: "text-text-primary border-t border-border-subtle",
598
+ children: [
599
+ /* @__PURE__ */ g("td", {
600
+ className: "py-1 pr-2",
601
+ children: new Date(e.fetchedAt).toLocaleString()
602
+ }),
603
+ /* @__PURE__ */ g("td", {
604
+ className: "py-1 pr-2 font-mono",
605
+ children: e.remoteIp ?? "—"
606
+ }),
607
+ /* @__PURE__ */ g("td", {
608
+ className: "py-1 pr-2",
609
+ children: e.format
610
+ }),
611
+ /* @__PURE__ */ g("td", {
612
+ className: "py-1 pr-2",
613
+ children: e.bytes
614
+ }),
615
+ /* @__PURE__ */ g("td", {
616
+ className: "py-1 pr-2",
617
+ children: e.status
618
+ }),
619
+ /* @__PURE__ */ g("td", {
620
+ className: "py-1 pr-2 truncate max-w-[260px]",
621
+ title: e.userAgent ?? "",
622
+ children: e.userAgent ?? "—"
623
+ })
624
+ ]
625
+ }, e.id)) })]
626
+ })
627
+ });
628
+ }
629
+ //#endregion
630
+ export { k as VibeLlmContextTabPanel };
631
+
632
+ //# sourceMappingURL=VibeLlmContextTabPanel.js.map