@burdenoff/microfe-vibecontrols 2026.529.2 → 2026.529.3

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,22 @@
1
+ import { useTerminalCapabilityUrl as e } from "../../hooks/useTerminalCapabilityUrl.js";
2
+ import { forwardRef as t } from "react";
3
+ import { Fragment as n, jsx as r } from "react/jsx-runtime";
4
+ //#region src/components/sessions/TerminalIframe.tsx
5
+ var i = t(function({ sessionId: t, agentId: i, baseTtydUrl: a, title: o, className: s, allow: c, onLoad: l, onError: u, fallback: d }, f) {
6
+ let { url: p, remint: m } = e(i, t, a);
7
+ return p ? /* @__PURE__ */ r("iframe", {
8
+ ref: f,
9
+ src: p,
10
+ title: o,
11
+ className: s,
12
+ allow: c,
13
+ onLoad: l,
14
+ onError: () => {
15
+ m(), u?.();
16
+ }
17
+ }) : /* @__PURE__ */ r(n, { children: d ?? null });
18
+ });
19
+ //#endregion
20
+ export { i as TerminalIframe };
21
+
22
+ //# sourceMappingURL=TerminalIframe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TerminalIframe.js","names":[],"sources":["../../../src/components/sessions/TerminalIframe.tsx"],"sourcesContent":["/**\n * TerminalIframe — renders the ttyd iframe with an F3-compliant\n * capability token appended as a `#vt=<token>` URL fragment.\n *\n * Each tab in the sessions terminal panel needs its own capability mint\n * (the iframe-token is scoped to `/terminal/<sessionId>`). React hooks\n * can't be called in a `tabs.map(...)` loop, so the iframe rendering is\n * extracted here and the hook runs per component instance.\n *\n * Stale browser tabs and reopened sessions hit a 10-minute cookie TTL\n * inside the agent; `onError` triggers `remint()` which re-fetches a\n * fresh token and re-iframes.\n */\nimport { type ReactNode, forwardRef } from 'react';\n\nimport { useTerminalCapabilityUrl } from '@/hooks/useTerminalCapabilityUrl';\n\nexport interface TerminalIframeProps {\n /** Session id — used as resourceId for the capability mint. */\n sessionId: string;\n /** Agent id owning this session — required for the mint mutation. */\n agentId: string | null | undefined;\n /** Bare ttyd tunnel URL from `session.ttydUrl`. Hook strips any legacy ?apiKey=. */\n baseTtydUrl: string | null | undefined;\n /** Title for accessibility. */\n title: string;\n /** Optional className for the iframe. */\n className?: string;\n /** Permissions-Policy allow attribute (clipboard). */\n allow?: string;\n /** Called on iframe load. Use to flip connection status to connected. */\n onLoad?: () => void;\n /** Called on iframe error. We re-mint internally + bubble the event. */\n onError?: () => void;\n /** Slot for fallback content when no URL is available yet. */\n fallback?: ReactNode;\n}\n\nexport const TerminalIframe = forwardRef<HTMLIFrameElement, TerminalIframeProps>(\n function TerminalIframe(\n { sessionId, agentId, baseTtydUrl, title, className, allow, onLoad, onError, fallback },\n ref\n ) {\n const { url, remint } = useTerminalCapabilityUrl(agentId, sessionId, baseTtydUrl);\n\n if (!url) {\n return <>{fallback ?? null}</>;\n }\n\n return (\n <iframe\n ref={ref}\n src={url}\n title={title}\n className={className}\n allow={allow}\n onLoad={onLoad}\n onError={() => {\n // Re-mint on any iframe error — covers both 401 (cookie expired\n // mid-session) and network blips.\n remint();\n onError?.();\n }}\n />\n );\n }\n);\n"],"mappings":";;;;AAsCA,IAAa,IAAiB,EAC5B,SACE,EAAE,cAAW,YAAS,gBAAa,UAAO,cAAW,UAAO,WAAQ,YAAS,eAC7E,GACA;CACA,IAAM,EAAE,QAAK,cAAW,EAAyB,GAAS,GAAW,EAAY;AAMjF,QAJK,IAKH,kBAAC,UAAD;EACO;EACL,KAAK;EACE;EACI;EACJ;EACC;EACR,eAAe;AAIb,GADA,GAAQ,EACR,KAAW;;EAEb,CAAA,GAjBK,kBAAA,GAAA,EAAA,UAAG,KAAY,MAAQ,CAAA;EAoBnC"}