@burdenoff/microfe-assethandler 2026.710.1 → 2026.713.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.
Files changed (36) hide show
  1. package/dist/assethandler/AssetHandlerRoot.d.ts.map +1 -1
  2. package/dist/assethandler/AssetHandlerRoot.js +16 -8
  3. package/dist/assethandler/AssetHandlerRoot.js.map +1 -1
  4. package/dist/assethandler/components/AttachmentsPanel.d.ts.map +1 -1
  5. package/dist/assethandler/components/AttachmentsPanel.js.map +1 -1
  6. package/dist/assethandler/pages/AssetsAssetCategoriesPage.d.ts.map +1 -1
  7. package/dist/assethandler/pages/AssetsAssetCategoriesPage.js +144 -137
  8. package/dist/assethandler/pages/AssetsAssetCategoriesPage.js.map +1 -1
  9. package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
  10. package/dist/assethandler/pages/AssetsAssetCreatePage.js +202 -201
  11. package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
  12. package/dist/assethandler/pages/AssetsAssetListPage.d.ts.map +1 -1
  13. package/dist/assethandler/pages/AssetsAssetListPage.js +135 -132
  14. package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
  15. package/dist/assethandler/providers/AssetHandlerProvider.d.ts +14 -0
  16. package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
  17. package/dist/assethandler/providers/AssetHandlerProvider.js +14 -2
  18. package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
  19. package/dist/assethandler/store/assethandlerStore.d.ts.map +1 -1
  20. package/dist/assethandler/store/assethandlerStore.js.map +1 -1
  21. package/dist/assethandler/types/index.d.ts +32 -0
  22. package/dist/assethandler/types/index.d.ts.map +1 -1
  23. package/dist/services/createSandboxAssistantTransport.d.ts +8 -26
  24. package/dist/services/createSandboxAssistantTransport.d.ts.map +1 -1
  25. package/dist/services/createSandboxAssistantTransport.js +8 -114
  26. package/dist/services/createSandboxAssistantTransport.js.map +1 -1
  27. package/dist/types/assistant.d.ts.map +1 -1
  28. package/dist/utils/pageContext.d.ts.map +1 -1
  29. package/dist/utils/pageContext.js.map +1 -1
  30. package/package.json +2 -2
  31. package/dist/generated/wspace-operations.js +0 -255
  32. package/dist/generated/wspace-operations.js.map +0 -1
  33. package/dist/services/assistantApi.d.ts +0 -71
  34. package/dist/services/assistantApi.d.ts.map +0 -1
  35. package/dist/services/assistantApi.js +0 -215
  36. package/dist/services/assistantApi.js.map +0 -1
@@ -1,26 +1,11 @@
1
1
  /**
2
- * AssetHandler adapter for the shared fe-libs AssistantWidget.
2
+ * assethandler adapter for the shared fe-libs AssistantWidget transport.
3
3
  *
4
- * The floating widget (fe-libs, Layer 1) is backend-agnostic — it calls an
5
- * injected `AssistantTransport`. This hook builds a transport that reuses the
6
- * sandbox `api-calls` agent: it provisions/reuses a sandbox, opens a session,
7
- * dispatches the prompt async, then polls for the streamed answer. The agent
8
- * introspects the GraphQL schema and performs API calls on the user's behalf
9
- * using their workspace token, contextual to the current screen (via
10
- * `gatherPageContext`).
11
- *
12
- * This is a thin orchestration over the functions in `assistantApi`.
13
- */
14
- /**
15
- * Locally-defined mirror of the fe-libs `AssistantTransport` contract.
16
- *
17
- * We intentionally do NOT import the type from `@burdenoff/fe-libs` here:
18
- * microfe's tsconfig maps `@burdenoff/fe-libs/*` to fe-libs *source*, so
19
- * vite-plugin-dts would rewrite a cross-package type used in this hook's
20
- * public signature to a broken source-relative path in the emitted `.d.ts`.
21
- * Structural typing makes this shape assignable to fe-libs' `AssistantTransport`
22
- * at the call site (assethandler-app's AppShell), which is where compatibility
23
- * is enforced — drift there fails the app type-check.
4
+ * The sandbox lifecycle + poll/stream loop now lives in
5
+ * `@burdenoff/fe-libs/shared/assistant` (one implementation for all products);
6
+ * this is a thin wrapper. The exported name/shape are unchanged so app-shell
7
+ * imports don't move. The public return type is a LOCALLY-declared structural
8
+ * mirror — never re-export fe-libs types (vite-plugin-dts path rewriting).
24
9
  */
25
10
  interface AssistantSendArgs {
26
11
  prompt: string;
@@ -31,12 +16,9 @@ export interface AssistantTransport {
31
16
  sendPrompt: (args: AssistantSendArgs) => Promise<{
32
17
  text: string;
33
18
  }>;
19
+ prewarm?: (level?: 'probe' | 'full') => void;
20
+ suspend?: () => void;
34
21
  }
35
- /**
36
- * Returns a memoized `AssistantTransport` wired to the VibeControls sandbox
37
- * `api-calls` agent. The sandbox + session are cached in refs so follow-up
38
- * turns reuse the warm environment for the lifetime of the host shell.
39
- */
40
22
  export declare function useSandboxAssistantTransport(): AssistantTransport;
41
23
  export {};
42
24
  //# sourceMappingURL=createSandboxAssistantTransport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createSandboxAssistantTransport.d.ts","sourceRoot":"","sources":["../../src/services/createSandboxAssistantTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAoBH;;;;;;;;;;GAUG;AACH,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAuHD;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,kBAAkB,CAmIjE"}
1
+ {"version":3,"file":"createSandboxAssistantTransport.d.ts","sourceRoot":"","sources":["../../src/services/createSandboxAssistantTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,4BAA4B,IAAI,kBAAkB,CAMjE"}
@@ -1,120 +1,14 @@
1
- import { createAssistantSandbox as e, createAssistantSession as t, extendAssistantSandboxTTL as n, findExistingSandbox as r, getAssistantMessages as i, sendAssistantPromptAsync as a, waitForAssistantServiceReady as o, waitForSandboxReady as s } from "./assistantApi.js";
2
- import { gatherPageContext as c } from "../utils/pageContext.js";
3
- import { useCallback as l, useMemo as u, useRef as d } from "react";
4
- import { useGatewayClient as f } from "@burdenoff/fe-libs/shared/graphql";
5
- import { useAuthToken as p } from "@burdenoff/fe-libs/shared/providers/shell";
1
+ import { gatherPageContext as e } from "../utils/pageContext.js";
2
+ import { useSandboxAssistantTransport as t } from "@burdenoff/fe-libs/shared/assistant";
6
3
  //#region src/services/createSandboxAssistantTransport.ts
7
- var m = "assistant", h = 18e4, g = 1500, _ = 3e4;
8
- function v(e) {
9
- try {
10
- let t = e === "workspaceId" ? "burdenoff-active-context-workspace" : "burdenoff-active-context-organization", n = localStorage.getItem(t);
11
- if (n) return n;
12
- let r = sessionStorage.getItem("bf-active-profile");
13
- if (!r) return "";
14
- let i = localStorage.getItem(`bf-p-${r}-context`);
15
- return i ? JSON.parse(i)[e] ?? "" : "";
16
- } catch {
17
- return "";
18
- }
19
- }
20
- function y() {
21
- return new URLSearchParams(window.location.search).get("workspace") ?? v("workspaceId");
22
- }
23
- function b() {
24
- return new URLSearchParams(window.location.search).get("org") ?? v("organizationId");
25
- }
26
- function x(e) {
27
- return e.info?.time?.created ?? 0;
28
- }
29
- function S(e) {
30
- return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
31
- }
32
- function C(e) {
33
- return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
34
- let t = e.state?.status ?? "running", n = e.tool ?? "tool";
35
- return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
4
+ function n() {
5
+ return t({
6
+ product: "assethandler",
7
+ gatherPageContext: e,
8
+ enableCredits: !0
36
9
  });
37
10
  }
38
- function w(e, t) {
39
- let n = e.filter((e) => e.info?.role === "assistant" && x(e) >= t).sort((e, t) => x(e) - x(t));
40
- if (n.length === 0) return {
41
- content: "Thinking…",
42
- done: !1
43
- };
44
- let r = n[n.length - 1], i = S(r.parts), a = C(r.parts);
45
- return {
46
- content: [i, ...a].filter(Boolean).join("\n\n") || "Thinking…",
47
- done: !!r.info?.time?.completed && (!!i || a.length > 0)
48
- };
49
- }
50
- function T(e) {
51
- return e.replace(/(Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/(X-Workspace-Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+\.[A-Za-z0-9._-]+\b/g, "[REDACTED_JWT]").replace(/\bsk-ant-[A-Za-z0-9-]+\b/g, "[REDACTED_API_KEY]");
52
- }
53
- function E(e) {
54
- let t = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
55
- return t.includes("rate limit exceeded") || t.includes("unauthorized") || t.includes("k8s api error 401") ? !1 : [
56
- "sandbox not found",
57
- "sandbox is not running",
58
- "sandbox service not available yet",
59
- "sandbox failed",
60
- "sandbox startup timed out",
61
- "assistant service did not become healthy",
62
- "proxy error: 404",
63
- "proxy error: 502",
64
- "proxy error: 503"
65
- ].some((e) => t.includes(e));
66
- }
67
- function D() {
68
- let v = f("workspace"), { getAccessToken: x, getWorkspaceToken: S, userId: C } = p(), D = d(null), O = d(null), k = l(async (n, i) => {
69
- let a = D.current;
70
- if (!a) {
71
- if (a = await r(v, n, m, i), !a) {
72
- if (!x()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
73
- a = await e(v, m, n, i);
74
- }
75
- await s(v, a, n, i), await o(v, a, n, i), D.current = a;
76
- }
77
- let c = O.current;
78
- return c || (c = (await t(v, a, n, m, i)).sessionId, O.current = c), {
79
- sandboxId: a,
80
- sessionId: c
81
- };
82
- }, [v, x]), A = l(async ({ prompt: e, onProgress: t, signal: r }) => {
83
- let o = y();
84
- if (!o) throw Error("The assistant needs an active workspace. Open a workspace and try again.");
85
- let s = {
86
- accessToken: x(),
87
- workspaceToken: S(),
88
- userId: C,
89
- organizationId: b()
90
- }, l = async (u) => {
91
- try {
92
- let { sandboxId: l, sessionId: u } = await k(o, s), d = Date.now();
93
- await a(v, l, o, u, e, m, c(), s);
94
- let f = Date.now() + h, p = Date.now(), y = w([], d);
95
- for (; Date.now() < f;) {
96
- if (r.aborted) throw Error("Cancelled");
97
- if (y = w(await i(v, l, o, u, s, 50), d), t(T(y.content)), y.done) break;
98
- Date.now() - p > _ && (await n(v, l, o, 600, s).catch(() => void 0), p = Date.now()), await new Promise((e) => setTimeout(e, g));
99
- }
100
- if (!y.done) throw Error("The assistant timed out while responding. Please try again.");
101
- return { text: T(y.content) };
102
- } catch (e) {
103
- if (u === 1 && E(e)) return D.current = null, O.current = null, l(2);
104
- throw e;
105
- }
106
- };
107
- return l(1);
108
- }, [
109
- v,
110
- k,
111
- x,
112
- S,
113
- C
114
- ]);
115
- return u(() => ({ sendPrompt: A }), [A]);
116
- }
117
11
  //#endregion
118
- export { D as useSandboxAssistantTransport };
12
+ export { n as useSandboxAssistantTransport };
119
13
 
120
14
  //# sourceMappingURL=createSandboxAssistantTransport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createSandboxAssistantTransport.js","names":[],"sources":["../../src/services/createSandboxAssistantTransport.ts"],"sourcesContent":["/**\n * AssetHandler adapter for the shared fe-libs AssistantWidget.\n *\n * The floating widget (fe-libs, Layer 1) is backend-agnostic — it calls an\n * injected `AssistantTransport`. This hook builds a transport that reuses the\n * sandbox `api-calls` agent: it provisions/reuses a sandbox, opens a session,\n * dispatches the prompt async, then polls for the streamed answer. The agent\n * introspects the GraphQL schema and performs API calls on the user's behalf\n * using their workspace token, contextual to the current screen (via\n * `gatherPageContext`).\n *\n * This is a thin orchestration over the functions in `assistantApi`.\n */\n\nimport { useCallback, useMemo, useRef } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\nimport { useAuthToken } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n createAssistantSandbox,\n createAssistantSession,\n extendAssistantSandboxTTL,\n findExistingSandbox,\n getAssistantMessages,\n sendAssistantPromptAsync,\n waitForAssistantServiceReady,\n waitForSandboxReady,\n type AssistantRawMessage,\n type AssistantSandboxAuthContext,\n} from '#src/services/assistantApi';\nimport { gatherPageContext } from '#src/utils/pageContext';\nimport type { AssistantMode } from '#src/types/assistant';\n\n/**\n * Locally-defined mirror of the fe-libs `AssistantTransport` contract.\n *\n * We intentionally do NOT import the type from `@burdenoff/fe-libs` here:\n * microfe's tsconfig maps `@burdenoff/fe-libs/*` to fe-libs *source*, so\n * vite-plugin-dts would rewrite a cross-package type used in this hook's\n * public signature to a broken source-relative path in the emitted `.d.ts`.\n * Structural typing makes this shape assignable to fe-libs' `AssistantTransport`\n * at the call site (assethandler-app's AppShell), which is where compatibility\n * is enforced — drift there fails the app type-check.\n */\ninterface AssistantSendArgs {\n prompt: string;\n onProgress: (partialText: string) => void;\n signal: AbortSignal;\n}\n\nexport interface AssistantTransport {\n sendPrompt: (args: AssistantSendArgs) => Promise<{ text: string }>;\n}\n\nconst MODE: AssistantMode = 'assistant';\nconst STREAM_BUDGET_MS = 180_000;\nconst POLL_INTERVAL_MS = 1500;\nconst TTL_EXTEND_INTERVAL_MS = 30_000;\n\n// ── Context helpers (mirror AssistantChatArea's resolution) ──────────\n\nfunction getProfileContextValue(key: 'workspaceId' | 'organizationId'): string {\n try {\n const activeContextKey =\n key === 'workspaceId'\n ? 'burdenoff-active-context-workspace'\n : 'burdenoff-active-context-organization';\n const activeContextValue = localStorage.getItem(activeContextKey);\n if (activeContextValue) return activeContextValue;\n\n const activeProfileId = sessionStorage.getItem('bf-active-profile');\n if (!activeProfileId) return '';\n const raw = localStorage.getItem(`bf-p-${activeProfileId}-context`);\n if (!raw) return '';\n const context = JSON.parse(raw) as { workspaceId?: string; organizationId?: string };\n return context[key] ?? '';\n } catch {\n return '';\n }\n}\n\nfunction getWorkspaceId(): string {\n const params = new URLSearchParams(window.location.search);\n return params.get('workspace') ?? getProfileContextValue('workspaceId');\n}\n\nfunction getOrganizationId(): string {\n const params = new URLSearchParams(window.location.search);\n return params.get('org') ?? getProfileContextValue('organizationId');\n}\n\n// ── Message-progress helpers (pure; mirror AssistantChatArea) ────────\n\nfunction getRawMessageCreatedAt(message: AssistantRawMessage): number {\n return message.info?.time?.created ?? 0;\n}\n\nfunction getAssistantText(parts: AssistantRawMessage['parts']): string {\n return (parts ?? [])\n .filter((part) => part.type === 'text' && typeof part.text === 'string')\n .map((part) => part.text?.trim() ?? '')\n .filter(Boolean)\n .join('\\n');\n}\n\nfunction getToolProgress(parts: AssistantRawMessage['parts']): string[] {\n return (parts ?? [])\n .filter((part) => part.type === 'tool' && part.tool)\n .map((part) => {\n const status = part.state?.status ?? 'running';\n const tool = part.tool ?? 'tool';\n if (status === 'completed') return `Completed: ${tool}`;\n if (status === 'failed') return `Failed: ${tool}`;\n return `Running: ${tool}`;\n });\n}\n\nfunction buildProgress(\n messages: AssistantRawMessage[],\n sinceMs: number\n): { content: string; done: boolean } {\n const relevant = messages\n .filter(\n (message) => message.info?.role === 'assistant' && getRawMessageCreatedAt(message) >= sinceMs\n )\n .sort((left, right) => getRawMessageCreatedAt(left) - getRawMessageCreatedAt(right));\n\n if (relevant.length === 0) return { content: 'Thinking…', done: false };\n\n const latest = relevant[relevant.length - 1]!;\n const text = getAssistantText(latest.parts);\n const toolProgress = getToolProgress(latest.parts);\n const content = [text, ...toolProgress].filter(Boolean).join('\\n\\n') || 'Thinking…';\n\n return {\n content,\n done: Boolean(latest.info?.time?.completed) && (Boolean(text) || toolProgress.length > 0),\n };\n}\n\nfunction sanitize(response: string): string {\n return response\n .replace(/(Authorization\\s*:\\s*Bearer\\s+)[^\\s\\n]+/gi, '$1[REDACTED]')\n .replace(/(X-Workspace-Authorization\\s*:\\s*Bearer\\s+)[^\\s\\n]+/gi, '$1[REDACTED]')\n .replace(/\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9._-]+\\.[A-Za-z0-9._-]+\\b/g, '[REDACTED_JWT]')\n .replace(/\\bsk-ant-[A-Za-z0-9-]+\\b/g, '[REDACTED_API_KEY]');\n}\n\nfunction isRecoverable(error: unknown): boolean {\n const message =\n error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();\n if (\n message.includes('rate limit exceeded') ||\n message.includes('unauthorized') ||\n message.includes('k8s api error 401')\n ) {\n return false;\n }\n return [\n 'sandbox not found',\n 'sandbox is not running',\n 'sandbox service not available yet',\n 'sandbox failed',\n 'sandbox startup timed out',\n 'assistant service did not become healthy',\n 'proxy error: 404',\n 'proxy error: 502',\n 'proxy error: 503',\n ].some((fragment) => message.includes(fragment));\n}\n\n/**\n * Returns a memoized `AssistantTransport` wired to the VibeControls sandbox\n * `api-calls` agent. The sandbox + session are cached in refs so follow-up\n * turns reuse the warm environment for the lifetime of the host shell.\n */\nexport function useSandboxAssistantTransport(): AssistantTransport {\n const apollo = useGatewayClient('workspace');\n const { getAccessToken, getWorkspaceToken, userId } = useAuthToken();\n\n const sandboxIdRef = useRef<string | null>(null);\n const sessionIdRef = useRef<string | null>(null);\n\n const ensureRuntime = useCallback(\n async (\n workspaceId: string,\n authContext: AssistantSandboxAuthContext\n ): Promise<{ sandboxId: string; sessionId: string }> => {\n let sandboxId = sandboxIdRef.current;\n if (!sandboxId) {\n sandboxId = await findExistingSandbox(apollo, workspaceId, MODE, authContext);\n if (!sandboxId) {\n if (!getAccessToken()) {\n throw new Error(\n 'API Calls mode requires an authenticated session. Please sign in again.'\n );\n }\n sandboxId = await createAssistantSandbox(apollo, MODE, workspaceId, authContext);\n }\n await waitForSandboxReady(apollo, sandboxId, workspaceId, authContext);\n await waitForAssistantServiceReady(apollo, sandboxId, workspaceId, authContext);\n sandboxIdRef.current = sandboxId;\n }\n\n let sessionId = sessionIdRef.current;\n if (!sessionId) {\n const result = await createAssistantSession(\n apollo,\n sandboxId,\n workspaceId,\n MODE,\n authContext\n );\n sessionId = result.sessionId;\n sessionIdRef.current = sessionId;\n }\n\n return { sandboxId, sessionId };\n },\n [apollo, getAccessToken]\n );\n\n const sendPrompt = useCallback(\n async ({ prompt, onProgress, signal }: AssistantSendArgs): Promise<{ text: string }> => {\n const workspaceId = getWorkspaceId();\n if (!workspaceId) {\n throw new Error('The assistant needs an active workspace. Open a workspace and try again.');\n }\n const authContext: AssistantSandboxAuthContext = {\n accessToken: getAccessToken(),\n workspaceToken: getWorkspaceToken(),\n userId,\n organizationId: getOrganizationId(),\n };\n\n const run = async (attempt: 1 | 2): Promise<{ text: string }> => {\n try {\n const { sandboxId, sessionId } = await ensureRuntime(workspaceId, authContext);\n\n const startedAt = Date.now();\n await sendAssistantPromptAsync(\n apollo,\n sandboxId,\n workspaceId,\n sessionId,\n prompt,\n MODE,\n gatherPageContext(),\n authContext\n );\n\n const timeoutAt = Date.now() + STREAM_BUDGET_MS;\n let lastTtlExtensionAt = Date.now();\n let progress = buildProgress([], startedAt);\n\n while (Date.now() < timeoutAt) {\n if (signal.aborted) throw new Error('Cancelled');\n\n const messages = await getAssistantMessages(\n apollo,\n sandboxId,\n workspaceId,\n sessionId,\n authContext,\n 50\n );\n progress = buildProgress(messages, startedAt);\n onProgress(sanitize(progress.content));\n if (progress.done) break;\n\n if (Date.now() - lastTtlExtensionAt > TTL_EXTEND_INTERVAL_MS) {\n await extendAssistantSandboxTTL(\n apollo,\n sandboxId,\n workspaceId,\n 600,\n authContext\n ).catch(() => undefined);\n lastTtlExtensionAt = Date.now();\n }\n\n await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));\n }\n\n if (!progress.done) {\n throw new Error('The assistant timed out while responding. Please try again.');\n }\n\n return { text: sanitize(progress.content) };\n } catch (error) {\n // A stale/expired sandbox or session is recoverable — drop the warm\n // refs and retry once from a clean runtime.\n if (attempt === 1 && isRecoverable(error)) {\n sandboxIdRef.current = null;\n sessionIdRef.current = null;\n return run(2);\n }\n throw error;\n }\n };\n\n return run(1);\n },\n [apollo, ensureRuntime, getAccessToken, getWorkspaceToken, userId]\n );\n\n return useMemo<AssistantTransport>(() => ({ sendPrompt }), [sendPrompt]);\n}\n"],"mappings":";;;;;;AAqDA,IAAM,IAAsB,aACtB,IAAmB,MACnB,IAAmB,MACnB,IAAyB;AAI/B,SAAS,EAAuB,GAA+C;AAC7E,KAAI;EACF,IAAM,IACJ,MAAQ,gBACJ,uCACA,yCACA,IAAqB,aAAa,QAAQ,EAAiB;AACjE,MAAI,EAAoB,QAAO;EAE/B,IAAM,IAAkB,eAAe,QAAQ,oBAAoB;AACnE,MAAI,CAAC,EAAiB,QAAO;EAC7B,IAAM,IAAM,aAAa,QAAQ,QAAQ,EAAgB,UAAU;AAGnE,SAFK,IACW,KAAK,MAAM,EAAI,CAChB,MAAQ,KAFN;SAGX;AACN,SAAO;;;AAIX,SAAS,IAAyB;AAEhC,QADe,IAAI,gBAAgB,OAAO,SAAS,OAAO,CAC5C,IAAI,YAAY,IAAI,EAAuB,cAAc;;AAGzE,SAAS,IAA4B;AAEnC,QADe,IAAI,gBAAgB,OAAO,SAAS,OAAO,CAC5C,IAAI,MAAM,IAAI,EAAuB,iBAAiB;;AAKtE,SAAS,EAAuB,GAAsC;AACpE,QAAO,EAAQ,MAAM,MAAM,WAAW;;AAGxC,SAAS,EAAiB,GAA6C;AACrE,SAAQ,KAAS,EAAE,EAChB,QAAQ,MAAS,EAAK,SAAS,UAAU,OAAO,EAAK,QAAS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AK,EAC/B,IAAW,EAAc,EAAE,EAAE,EAAU;AAE3C,WAAO,KAAK,KAAK,GAAG,IAAW;AAC7B,SAAI,EAAO,QAAS,OAAU,MAAM,YAAY;AAYhD,SAFA,IAAW,EARM,MAAM,EACrB,GACA,GACA,GACA,GACA,GACA,GACD,EACkC,EAAU,EAC7C,EAAW,EAAS,EAAS,QAAQ,CAAC,EAClC,EAAS,KAAM;AAanB,KAXI,KAAK,KAAK,GAAG,IAAqB,MACpC,MAAM,EACJ,GACA,GACA,GACA,KACA,EACD,CAAC,YAAY,KAAA,EAAU,EACxB,IAAqB,KAAK,KAAK,GAGjC,MAAM,IAAI,SAAS,MAAY,WAAW,GAAS,EAAiB,CAAC;;AAGvE,QAAI,CAAC,EAAS,KACZ,OAAU,MAAM,8DAA8D;AAGhF,WAAO,EAAE,MAAM,EAAS,EAAS,QAAQ,EAAE;YACpC,GAAO;AAGd,QAAI,MAAY,KAAK,EAAc,EAAM,CAGvC,QAFA,EAAa,UAAU,MACvB,EAAa,UAAU,MAChB,EAAI,EAAE;AAEf,UAAM;;;AAIV,SAAO,EAAI,EAAE;IAEf;EAAC;EAAQ;EAAe;EAAgB;EAAmB;EAAO,CACnE;AAED,QAAO,SAAmC,EAAE,eAAY,GAAG,CAAC,EAAW,CAAC"}
1
+ {"version":3,"file":"createSandboxAssistantTransport.js","names":[],"sources":["../../src/services/createSandboxAssistantTransport.ts"],"sourcesContent":["/**\n * assethandler adapter for the shared fe-libs AssistantWidget transport.\n *\n * The sandbox lifecycle + poll/stream loop now lives in\n * `@burdenoff/fe-libs/shared/assistant` (one implementation for all products);\n * this is a thin wrapper. The exported name/shape are unchanged so app-shell\n * imports don't move. The public return type is a LOCALLY-declared structural\n * mirror — never re-export fe-libs types (vite-plugin-dts path rewriting).\n */\n\nimport { useSandboxAssistantTransport as useSharedTransport } from '@burdenoff/fe-libs/shared/assistant';\nimport { gatherPageContext } from '#src/utils/pageContext';\n\ninterface AssistantSendArgs {\n prompt: string;\n onProgress: (partialText: string) => void;\n signal: AbortSignal;\n}\n\nexport interface AssistantTransport {\n sendPrompt: (args: AssistantSendArgs) => Promise<{ text: string }>;\n prewarm?: (level?: 'probe' | 'full') => void;\n suspend?: () => void;\n}\n\nexport function useSandboxAssistantTransport(): AssistantTransport {\n return useSharedTransport({\n product: 'assethandler',\n gatherPageContext: gatherPageContext,\n enableCredits: true,\n });\n}\n"],"mappings":";;;AAyBA,SAAgB,IAAmD;AACjE,QAAO,EAAmB;EACxB,SAAS;EACU;EACnB,eAAe;EAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.d.ts","sourceRoot":"","sources":["../../src/types/assistant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAElG,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAEhG,MAAM,MAAM,2BAA2B,GACnC,MAAM,GACN,cAAc,GACd,YAAY,GACZ,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;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wB,CAiD1B"}
1
+ {"version":3,"file":"pageContext.d.ts","sourceRoot":"","sources":["../../src/utils/pageContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,UAAU,wBAAwB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,WAAW;IAG1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CAoB/C;AAMD,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,wBAAwB,CA+C1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context\n * to be sent alongside every assistant prompt for better AI awareness.\n */\n\ninterface ConversationContextShape {\n entityType?: string;\n entityId?: string;\n activeTab?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface PageContext {\n // `currentUrl` (NOT `activeUrl`) — must match the agent's allowed-context-key\n // contract, otherwise the agent filters it out.\n currentUrl: string;\n currentPage: string;\n // The entity the user is currently looking at, resolved from the route. Lets\n // the assistant act on \"this / current / here\" without asking for an id.\n entityType?: string;\n entityId?: string;\n platform: string;\n version: string;\n viewportSize: string;\n userAgent: string;\n timestamp: string;\n}\n\nexport function gatherPageContext(): PageContext {\n const url = window.location.href;\n const pathSegments = window.location.pathname.split('/').filter(Boolean);\n const currentPage = pathSegments.slice(0, 3).join('/') || 'home';\n const entity = resolveAssetHandlerConversationContext(\n window.location.pathname,\n window.location.search\n );\n\n return {\n currentUrl: url,\n currentPage,\n entityType: entity.entityType,\n entityId: entity.entityId,\n platform: 'assethandler',\n version: import.meta.env.VITE_APP_VERSION ?? '2026.402.1',\n viewportSize: `${window.innerWidth}x${window.innerHeight}`,\n userAgent: navigator.userAgent,\n timestamp: new Date().toISOString(),\n };\n}\n\nfunction matchPath(pattern: RegExp, pathname: string): RegExpMatchArray | null {\n return pathname.match(pattern);\n}\n\nexport function resolveAssetHandlerConversationContext(\n pathname: string,\n search: string\n): ConversationContextShape {\n const params = new URLSearchParams(search);\n const directMatches: Array<[RegExp, string]> = [\n [/^\\/assets\\/([^/]+)$/, 'ASSETHANDLER_ASSET'],\n [/^\\/itil\\/incidents\\/([^/]+)$/, 'ASSETHANDLER_INCIDENT'],\n [/^\\/itil\\/changes\\/([^/]+)$/, 'ASSETHANDLER_CHANGE'],\n [/^\\/itil\\/problems\\/([^/]+)$/, 'ASSETHANDLER_PROBLEM'],\n [/^\\/operations\\/work-orders\\/([^/]+)$/, 'ASSETHANDLER_WORK_ORDER'],\n [/^\\/operations\\/maintenance\\/([^/]+)$/, 'ASSETHANDLER_MAINTENANCE'],\n [/^\\/finance\\/budgets\\/([^/]+)$/, 'ASSETHANDLER_BUDGET'],\n [/^\\/finance\\/invoices\\/([^/]+)$/, 'ASSETHANDLER_INVOICE'],\n [/^\\/transactions\\/([^/]+)$/, 'ASSETHANDLER_TRANSACTION'],\n [/^\\/security\\/compliance\\/([^/]+)$/, 'ASSETHANDLER_COMPLIANCE_FRAMEWORK'],\n [/^\\/security\\/policies\\/([^/]+)$/, 'ASSETHANDLER_POLICY'],\n [/^\\/security\\/events\\/([^/]+)$/, 'ASSETHANDLER_SECURITY_EVENT'],\n [/^\\/advanced\\/discovery-jobs\\/([^/]+)$/, 'ASSETHANDLER_DISCOVERY_JOB'],\n [/^\\/advanced\\/cmdb-browser\\/([^/]+)$/, 'ASSETHANDLER_CMDB_ITEM'],\n ];\n\n for (const [pattern, entityType] of directMatches) {\n const match = matchPath(pattern, pathname);\n if (match) {\n return {\n entityType,\n entityId: match[1],\n metadata: {\n routePattern: pattern.source,\n },\n };\n }\n }\n\n const activeTab =\n params.get('tab') ??\n (() => {\n const segments = pathname.split('/').filter(Boolean);\n return segments.length > 2 ? segments[segments.length - 1] : undefined;\n })();\n\n return {\n activeTab: activeTab ?? undefined,\n metadata: {\n ...(activeTab ? { activeTab } : {}),\n ...(params.get('selectedAssetId')\n ? { selectedAssetId: params.get('selectedAssetId') }\n : {}),\n ...(params.get('actionId') ? { actionId: params.get('actionId') } : {}),\n },\n };\n}\n"],"mappings":";AA4BA,SAAgB,IAAiC;CAC/C,IAAM,IAAM,OAAO,SAAS,MAEtB,IADe,OAAO,SAAS,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ,CACvC,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,IAAI,QACpD,IAAS,EACb,OAAO,SAAS,UAChB,OAAO,SAAS,OACjB;AAED,QAAO;EACL,YAAY;EACZ;EACA,YAAY,EAAO;EACnB,UAAU,EAAO;EACjB,UAAU;EACV,SAA6C;EAC7C,cAAc,GAAG,OAAO,WAAW,GAAG,OAAO;EAC7C,WAAW,UAAU;EACrB,4BAAW,IAAI,MAAM,EAAC,aAAa;EACpC;;AAGH,SAAS,EAAU,GAAiB,GAA2C;AAC7E,QAAO,EAAS,MAAM,EAAQ;;AAGhC,SAAgB,EACd,GACA,GAC0B;CAC1B,IAAM,IAAS,IAAI,gBAAgB,EAAO;AAkB1C,MAAK,IAAM,CAAC,GAAS,MAjB0B;EAC7C,CAAC,uBAAuB,qBAAqB;EAC7C,CAAC,gCAAgC,wBAAwB;EACzD,CAAC,8BAA8B,sBAAsB;EACrD,CAAC,+BAA+B,uBAAuB;EACvD,CAAC,wCAAwC,0BAA0B;EACnE,CAAC,wCAAwC,2BAA2B;EACpE,CAAC,iCAAiC,sBAAsB;EACxD,CAAC,kCAAkC,uBAAuB;EAC1D,CAAC,6BAA6B,2BAA2B;EACzD,CAAC,qCAAqC,oCAAoC;EAC1E,CAAC,mCAAmC,sBAAsB;EAC1D,CAAC,iCAAiC,8BAA8B;EAChE,CAAC,yCAAyC,6BAA6B;EACvE,CAAC,uCAAuC,yBAAyB;EAClE,EAEkD;EACjD,IAAM,IAAQ,EAAU,GAAS,EAAS;AAC1C,MAAI,EACF,QAAO;GACL;GACA,UAAU,EAAM;GAChB,UAAU,EACR,cAAc,EAAQ,QACvB;GACF;;CAIL,IAAM,IACJ,EAAO,IAAI,MAAM,WACV;EACL,IAAM,IAAW,EAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AACpD,SAAO,EAAS,SAAS,IAAI,EAAS,EAAS,SAAS,KAAK,KAAA;KAC3D;AAEN,QAAO;EACL,WAAW,KAAa,KAAA;EACxB,UAAU;GACR,GAAI,IAAY,EAAE,cAAW,GAAG,EAAE;GAClC,GAAI,EAAO,IAAI,kBAAkB,GAC7B,EAAE,iBAAiB,EAAO,IAAI,kBAAkB,EAAE,GAClD,EAAE;GACN,GAAI,EAAO,IAAI,WAAW,GAAG,EAAE,UAAU,EAAO,IAAI,WAAW,EAAE,GAAG,EAAE;GACvE;EACF"}
1
+ {"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context\n * to be sent alongside every assistant prompt for better AI awareness.\n */\n\ninterface ConversationContextShape {\n entityType?: string;\n entityId?: string;\n activeTab?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface PageContext {\n // `currentUrl` (NOT `activeUrl`) — must match the agent's allowed-context-key\n // contract, otherwise the agent filters it out.\n currentUrl: string;\n currentPage: string;\n // The entity the user is currently looking at, resolved from the route. Lets\n // the assistant act on \"this / current / here\" without asking for an id.\n entityType?: string;\n entityId?: string;\n platform: string;\n version: string;\n viewportSize: string;\n userAgent: string;\n timestamp: string;\n}\n\nexport function gatherPageContext(): PageContext {\n const url = window.location.href;\n const pathSegments = window.location.pathname.split('/').filter(Boolean);\n const currentPage = pathSegments.slice(0, 3).join('/') || 'home';\n const entity = resolveAssetHandlerConversationContext(\n window.location.pathname,\n window.location.search\n );\n\n return {\n currentUrl: url,\n currentPage,\n entityType: entity.entityType,\n entityId: entity.entityId,\n platform: 'assethandler',\n version: import.meta.env.VITE_APP_VERSION ?? '2026.402.1',\n viewportSize: `${window.innerWidth}x${window.innerHeight}`,\n userAgent: navigator.userAgent,\n timestamp: new Date().toISOString(),\n };\n}\n\nfunction matchPath(pattern: RegExp, pathname: string): RegExpMatchArray | null {\n return pathname.match(pattern);\n}\n\nexport function resolveAssetHandlerConversationContext(\n pathname: string,\n search: string\n): ConversationContextShape {\n const params = new URLSearchParams(search);\n const directMatches: Array<[RegExp, string]> = [\n [/^\\/assets\\/([^/]+)$/, 'ASSETHANDLER_ASSET'],\n [/^\\/itil\\/incidents\\/([^/]+)$/, 'ASSETHANDLER_INCIDENT'],\n [/^\\/itil\\/changes\\/([^/]+)$/, 'ASSETHANDLER_CHANGE'],\n [/^\\/itil\\/problems\\/([^/]+)$/, 'ASSETHANDLER_PROBLEM'],\n [/^\\/operations\\/work-orders\\/([^/]+)$/, 'ASSETHANDLER_WORK_ORDER'],\n [/^\\/operations\\/maintenance\\/([^/]+)$/, 'ASSETHANDLER_MAINTENANCE'],\n [/^\\/finance\\/budgets\\/([^/]+)$/, 'ASSETHANDLER_BUDGET'],\n [/^\\/finance\\/invoices\\/([^/]+)$/, 'ASSETHANDLER_INVOICE'],\n [/^\\/transactions\\/([^/]+)$/, 'ASSETHANDLER_TRANSACTION'],\n [/^\\/security\\/compliance\\/([^/]+)$/, 'ASSETHANDLER_COMPLIANCE_FRAMEWORK'],\n [/^\\/security\\/policies\\/([^/]+)$/, 'ASSETHANDLER_POLICY'],\n [/^\\/security\\/events\\/([^/]+)$/, 'ASSETHANDLER_SECURITY_EVENT'],\n [/^\\/advanced\\/discovery-jobs\\/([^/]+)$/, 'ASSETHANDLER_DISCOVERY_JOB'],\n [/^\\/advanced\\/cmdb-browser\\/([^/]+)$/, 'ASSETHANDLER_CMDB_ITEM'],\n ];\n\n for (const [pattern, entityType] of directMatches) {\n const match = matchPath(pattern, pathname);\n if (match) {\n return {\n entityType,\n entityId: match[1],\n metadata: {\n routePattern: pattern.source,\n },\n };\n }\n }\n\n const activeTab =\n params.get('tab') ??\n (() => {\n const segments = pathname.split('/').filter(Boolean);\n return segments.length > 2 ? segments[segments.length - 1] : undefined;\n })();\n\n return {\n activeTab: activeTab ?? undefined,\n metadata: {\n ...(activeTab ? { activeTab } : {}),\n ...(params.get('selectedAssetId') ? { selectedAssetId: params.get('selectedAssetId') } : {}),\n ...(params.get('actionId') ? { actionId: params.get('actionId') } : {}),\n },\n };\n}\n"],"mappings":";AA4BA,SAAgB,IAAiC;CAC/C,IAAM,IAAM,OAAO,SAAS,MAEtB,IADe,OAAO,SAAS,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ,CACvC,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,IAAI,QACpD,IAAS,EACb,OAAO,SAAS,UAChB,OAAO,SAAS,OACjB;AAED,QAAO;EACL,YAAY;EACZ;EACA,YAAY,EAAO;EACnB,UAAU,EAAO;EACjB,UAAU;EACV,SAA6C;EAC7C,cAAc,GAAG,OAAO,WAAW,GAAG,OAAO;EAC7C,WAAW,UAAU;EACrB,4BAAW,IAAI,MAAM,EAAC,aAAa;EACpC;;AAGH,SAAS,EAAU,GAAiB,GAA2C;AAC7E,QAAO,EAAS,MAAM,EAAQ;;AAGhC,SAAgB,EACd,GACA,GAC0B;CAC1B,IAAM,IAAS,IAAI,gBAAgB,EAAO;AAkB1C,MAAK,IAAM,CAAC,GAAS,MAjB0B;EAC7C,CAAC,uBAAuB,qBAAqB;EAC7C,CAAC,gCAAgC,wBAAwB;EACzD,CAAC,8BAA8B,sBAAsB;EACrD,CAAC,+BAA+B,uBAAuB;EACvD,CAAC,wCAAwC,0BAA0B;EACnE,CAAC,wCAAwC,2BAA2B;EACpE,CAAC,iCAAiC,sBAAsB;EACxD,CAAC,kCAAkC,uBAAuB;EAC1D,CAAC,6BAA6B,2BAA2B;EACzD,CAAC,qCAAqC,oCAAoC;EAC1E,CAAC,mCAAmC,sBAAsB;EAC1D,CAAC,iCAAiC,8BAA8B;EAChE,CAAC,yCAAyC,6BAA6B;EACvE,CAAC,uCAAuC,yBAAyB;EAClE,EAEkD;EACjD,IAAM,IAAQ,EAAU,GAAS,EAAS;AAC1C,MAAI,EACF,QAAO;GACL;GACA,UAAU,EAAM;GAChB,UAAU,EACR,cAAc,EAAQ,QACvB;GACF;;CAIL,IAAM,IACJ,EAAO,IAAI,MAAM,WACV;EACL,IAAM,IAAW,EAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AACpD,SAAO,EAAS,SAAS,IAAI,EAAS,EAAS,SAAS,KAAK,KAAA;KAC3D;AAEN,QAAO;EACL,WAAW,KAAa,KAAA;EACxB,UAAU;GACR,GAAI,IAAY,EAAE,cAAW,GAAG,EAAE;GAClC,GAAI,EAAO,IAAI,kBAAkB,GAAG,EAAE,iBAAiB,EAAO,IAAI,kBAAkB,EAAE,GAAG,EAAE;GAC3F,GAAI,EAAO,IAAI,WAAW,GAAG,EAAE,UAAU,EAAO,IAAI,WAAW,EAAE,GAAG,EAAE;GACvE;EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-assethandler",
3
- "version": "2026.710.1",
3
+ "version": "2026.713.2",
4
4
  "description": "Burdenoff AssetHandler Microfrontend",
5
5
  "type": "module",
6
6
  "files": [
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@apollo/client": "^4.0.11",
47
- "@burdenoff/fe-libs": "2026.625.5",
47
+ "@burdenoff/fe-libs": "2026.713.6",
48
48
  "clsx": "^2.1.1",
49
49
  "framer-motion": "^12.0.0",
50
50
  "graphql": "^16.10.0",
@@ -1,255 +0,0 @@
1
- import { gql as e } from "@apollo/client";
2
- import "@apollo/client/react";
3
- //#region src/generated/wspace-operations.ts
4
- var t = e`
5
- fragment AssetFields on Asset {
6
- id
7
- assetNumber
8
- name
9
- description
10
- category
11
- status
12
- condition
13
- serialNumber
14
- locationName
15
- assignedTo
16
- tags
17
- createdAt
18
- updatedAt
19
- }
20
- `, n = e`
21
- fragment IncidentFields on Incident {
22
- id
23
- title
24
- description
25
- category
26
- priority
27
- status
28
- assignedTo
29
- reportedBy
30
- reportedAt
31
- resolvedAt
32
- slaBreached
33
- }
34
- `, r = e`
35
- fragment TransactionFields on Transaction {
36
- id
37
- type
38
- status
39
- amount
40
- currency
41
- category
42
- description
43
- vendor
44
- department
45
- occurredAt
46
- }
47
- `, i = e`
48
- fragment WorkOrderFields on WorkOrder {
49
- id
50
- title
51
- description
52
- type
53
- status
54
- priority
55
- assetId
56
- assignedTo
57
- createdAt
58
- updatedAt
59
- }
60
- `, a = e`
61
- mutation CreateSandbox($input: CreateSandboxInput!) {
62
- createSandbox(input: $input) {
63
- id
64
- name
65
- status
66
- network {
67
- internalUrl
68
- }
69
- }
70
- }
71
- `, o = e`
72
- mutation ProxySandboxRequest($input: ProxySandboxRequestInput!) {
73
- proxySandboxRequest(input: $input) {
74
- status
75
- body
76
- }
77
- }
78
- `, s = e`
79
- mutation ExtendSandboxTtl($id: ID!, $additionalSeconds: Int!, $context: ContextInput!) {
80
- extendSandboxTTL(
81
- id: $id
82
- additionalSeconds: $additionalSeconds
83
- context: $context
84
- ) {
85
- id
86
- expiresAt
87
- }
88
- }
89
- `, c = e`
90
- query GetSandbox($id: ID!, $context: ContextInput!) {
91
- getSandbox(id: $id, context: $context) {
92
- id
93
- status
94
- errorMessage
95
- network {
96
- internalUrl
97
- }
98
- }
99
- }
100
- `, l = e`
101
- query GetActiveSandboxes($context: ContextInput!) {
102
- getActiveSandboxes(context: $context) {
103
- id
104
- name
105
- status
106
- metadata
107
- template
108
- createdBy
109
- }
110
- }
111
- `;
112
- e`
113
- query AssetHandlerBootstrap {
114
- dashboardOverview {
115
- totalAssets
116
- openIncidents
117
- openWorkOrders
118
- totalTransactions
119
- }
120
- assets {
121
- ...AssetFields
122
- }
123
- incidents {
124
- ...IncidentFields
125
- }
126
- workOrders {
127
- ...WorkOrderFields
128
- }
129
- maintenanceRecords {
130
- id
131
- assetId
132
- title
133
- description
134
- type
135
- status
136
- priority
137
- scheduledAt
138
- completedAt
139
- estimatedCost
140
- actualCost
141
- checklist
142
- createdAt
143
- updatedAt
144
- }
145
- transactions {
146
- ...TransactionFields
147
- }
148
- changeRequests {
149
- id
150
- title
151
- description
152
- type
153
- status
154
- risk
155
- requestedBy
156
- assignedTo
157
- affectedAssets
158
- scheduledStart
159
- scheduledEnd
160
- approvals
161
- createdAt
162
- updatedAt
163
- }
164
- problems {
165
- id
166
- title
167
- description
168
- status
169
- priority
170
- category
171
- assignedTo
172
- relatedIncidents
173
- rootCause
174
- workaround
175
- createdAt
176
- updatedAt
177
- }
178
- budgets {
179
- id
180
- name
181
- category
182
- allocated
183
- spent
184
- remaining
185
- period
186
- department
187
- status
188
- }
189
- invoices {
190
- id
191
- number
192
- vendor
193
- amount
194
- currency
195
- issueDate
196
- dueDate
197
- status
198
- items
199
- relatedPO
200
- }
201
- securityEvents: getVaultSecurityEvents {
202
- items {
203
- id
204
- eventType
205
- severity
206
- title: message
207
- description
208
- source: resourceType
209
- userId
210
- ipAddress
211
- occurredAt: timestamp
212
- resolved: reviewed
213
- }
214
- }
215
- complianceFrameworks: securityComplianceFrameworks(
216
- filter: {sourceProduct: "assethandler"}
217
- ) {
218
- items {
219
- id
220
- name
221
- version
222
- status
223
- score
224
- totalControls
225
- passedControls
226
- failedControls
227
- lastAssessment
228
- nextAssessment
229
- }
230
- }
231
- securityPolicies: securityGovernancePolicies(
232
- filter: {sourceProduct: "assethandler"}
233
- ) {
234
- items {
235
- id
236
- name
237
- description
238
- category
239
- status
240
- version
241
- effectiveDate
242
- reviewDate
243
- owner
244
- applicableTo
245
- }
246
- }
247
- }
248
- ${t}
249
- ${n}
250
- ${i}
251
- ${r}`;
252
- //#endregion
253
- export { a as CreateSandboxDocument, s as ExtendSandboxTtlDocument, l as GetActiveSandboxesDocument, c as GetSandboxDocument, o as ProxySandboxRequestDocument };
254
-
255
- //# sourceMappingURL=wspace-operations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wspace-operations.js","names":[],"sources":["../../src/generated/wspace-operations.ts"],"sourcesContent":["// @ts-nocheck\nimport * as Types from './wspace-types';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nimport * as ApolloReactHooks from '@apollo/client/react';\nconst defaultOptions = {} as const;\nexport type AssetFieldsFragment = { __typename?: 'Asset', id: string, assetNumber: string, name: string, description?: string | null, category: string, status: Types.AssetStatus, condition: Types.AssetCondition, serialNumber?: string | null, locationName?: string | null, assignedTo?: string | null, tags: Array<string>, createdAt: string, updatedAt: string };\n\nexport type IncidentFieldsFragment = { __typename?: 'Incident', id: string, title: string, description: string, category: string, priority: Types.Priority, status: Types.IncidentStatus, assignedTo?: string | null, reportedBy: string, reportedAt: string, resolvedAt?: string | null, slaBreached: boolean };\n\nexport type TransactionFieldsFragment = { __typename?: 'Transaction', id: string, type: Types.TransactionType, status: Types.TransactionStatus, amount: number, currency: string, category: string, description: string, vendor?: string | null, department?: string | null, occurredAt: string };\n\nexport type WorkOrderFieldsFragment = { __typename?: 'WorkOrder', id: string, title: string, description?: string | null, type: Types.WorkOrderType, status: Types.WorkOrderStatus, priority: Types.Priority, assetId?: string | null, assignedTo?: string | null, createdAt: string, updatedAt: string };\n\nexport type CreateSandboxMutationVariables = Types.Exact<{\n input: Types.CreateSandboxInput;\n}>;\n\n\nexport type CreateSandboxMutation = { __typename?: 'Mutation', createSandbox: { __typename?: 'Sandbox', id: string, name: string, status: Types.SandboxStatus, network: { __typename?: 'SandboxNetwork', internalUrl?: string | null } } };\n\nexport type ProxySandboxRequestMutationVariables = Types.Exact<{\n input: Types.ProxySandboxRequestInput;\n}>;\n\n\nexport type ProxySandboxRequestMutation = { __typename?: 'Mutation', proxySandboxRequest: { __typename?: 'ProxySandboxResponse', status: number, body?: Record<string, unknown> | null } };\n\nexport type ExtendSandboxTtlMutationVariables = Types.Exact<{\n id: Types.Scalars['ID']['input'];\n additionalSeconds: Types.Scalars['Int']['input'];\n context: Types.ContextInput;\n}>;\n\n\nexport type ExtendSandboxTtlMutation = { __typename?: 'Mutation', extendSandboxTTL: { __typename?: 'Sandbox', id: string, expiresAt: string } };\n\nexport type GetSandboxQueryVariables = Types.Exact<{\n id: Types.Scalars['ID']['input'];\n context: Types.ContextInput;\n}>;\n\n\nexport type GetSandboxQuery = { __typename?: 'Query', getSandbox?: { __typename?: 'Sandbox', id: string, status: Types.SandboxStatus, errorMessage?: string | null, network: { __typename?: 'SandboxNetwork', internalUrl?: string | null } } | null };\n\nexport type GetActiveSandboxesQueryVariables = Types.Exact<{\n context: Types.ContextInput;\n}>;\n\n\nexport type GetActiveSandboxesQuery = { __typename?: 'Query', getActiveSandboxes: Array<{ __typename?: 'Sandbox', id: string, name: string, status: Types.SandboxStatus, metadata?: Record<string, unknown> | null, template: Types.SandboxTemplate, createdBy: string }> };\n\nexport type AssetHandlerBootstrapQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type AssetHandlerBootstrapQuery = { __typename?: 'Query', dashboardOverview: { __typename?: 'DashboardOverview', totalAssets: number, openIncidents: number, openWorkOrders: number, totalTransactions: number }, assets: Array<{ __typename?: 'Asset', id: string, assetNumber: string, name: string, description?: string | null, category: string, status: Types.AssetStatus, condition: Types.AssetCondition, serialNumber?: string | null, locationName?: string | null, assignedTo?: string | null, tags: Array<string>, createdAt: string, updatedAt: string }>, incidents: Array<{ __typename?: 'Incident', id: string, title: string, description: string, category: string, priority: Types.Priority, status: Types.IncidentStatus, assignedTo?: string | null, reportedBy: string, reportedAt: string, resolvedAt?: string | null, slaBreached: boolean }>, workOrders: Array<{ __typename?: 'WorkOrder', id: string, title: string, description?: string | null, type: Types.WorkOrderType, status: Types.WorkOrderStatus, priority: Types.Priority, assetId?: string | null, assignedTo?: string | null, createdAt: string, updatedAt: string }>, maintenanceRecords: Array<{ __typename?: 'MaintenanceRecord', id: string, assetId: string, title: string, description?: string | null, type: string, status: string, priority: Types.Priority, scheduledAt?: string | null, completedAt?: string | null, estimatedCost?: number | null, actualCost?: number | null, checklist: Array<Record<string, unknown>>, createdAt: string, updatedAt: string }>, transactions: Array<{ __typename?: 'Transaction', id: string, type: Types.TransactionType, status: Types.TransactionStatus, amount: number, currency: string, category: string, description: string, vendor?: string | null, department?: string | null, occurredAt: string }>, changeRequests: Array<{ __typename?: 'ChangeRequest', id: string, title: string, description: string, type: string, status: Types.ChangeStatus, risk: Types.ChangeRisk, requestedBy: string, assignedTo?: string | null, affectedAssets: Array<string>, scheduledStart?: string | null, scheduledEnd?: string | null, approvals: Array<Record<string, unknown>>, createdAt: string, updatedAt: string }>, problems: Array<{ __typename?: 'Problem', id: string, title: string, description: string, status: Types.ProblemStatus, priority: Types.Priority, category: string, assignedTo?: string | null, relatedIncidents: Array<string>, rootCause?: string | null, workaround?: string | null, createdAt: string, updatedAt: string }>, budgets: Array<{ __typename?: 'AssetBudget', id: string, name: string, category: string, allocated: number, spent: number, remaining: number, period: string, department: string, status: Types.AssetBudgetStatus }>, invoices: Array<{ __typename?: 'Invoice', id: string, number: string, vendor: string, amount: number, currency: string, issueDate: string, dueDate: string, status: Types.InvoiceStatus, items: Array<Record<string, unknown>>, relatedPO?: string | null }>, securityEvents: { __typename?: 'VaultSecurityEventList', items: Array<{ __typename?: 'VaultSecurityEvent', id: string, eventType: Types.VaultSecurityEventType, severity: Types.VaultSecurityEventSeverity, description?: string | null, userId?: string | null, ipAddress?: string | null, title: string, source?: string | null, occurredAt: string, resolved: boolean }> }, complianceFrameworks: { __typename?: 'SecurityComplianceFrameworkList', items: Array<{ __typename?: 'SecurityComplianceFramework', id: string, name: string, version: string, status: Types.SecurityComplianceStatus, score: number, totalControls: number, passedControls: number, failedControls: number, lastAssessment: string, nextAssessment: string }> }, securityPolicies: { __typename?: 'SecurityGovernancePolicyList', items: Array<{ __typename?: 'SecurityGovernancePolicy', id: string, name: string, description?: string | null, category: string, status: Types.SecurityGovernancePolicyStatus, version: string, effectiveDate: string, reviewDate: string, owner: string, applicableTo: Array<string> }> } };\n\nexport const AssetFieldsFragmentDoc = gql`\n fragment AssetFields on Asset {\n id\n assetNumber\n name\n description\n category\n status\n condition\n serialNumber\n locationName\n assignedTo\n tags\n createdAt\n updatedAt\n}\n `;\nexport const IncidentFieldsFragmentDoc = gql`\n fragment IncidentFields on Incident {\n id\n title\n description\n category\n priority\n status\n assignedTo\n reportedBy\n reportedAt\n resolvedAt\n slaBreached\n}\n `;\nexport const TransactionFieldsFragmentDoc = gql`\n fragment TransactionFields on Transaction {\n id\n type\n status\n amount\n currency\n category\n description\n vendor\n department\n occurredAt\n}\n `;\nexport const WorkOrderFieldsFragmentDoc = gql`\n fragment WorkOrderFields on WorkOrder {\n id\n title\n description\n type\n status\n priority\n assetId\n assignedTo\n createdAt\n updatedAt\n}\n `;\nexport const CreateSandboxDocument = gql`\n mutation CreateSandbox($input: CreateSandboxInput!) {\n createSandbox(input: $input) {\n id\n name\n status\n network {\n internalUrl\n }\n }\n}\n `;\nexport type CreateSandboxMutationFn = Apollo.MutationFunction<Types.CreateSandboxMutation, Types.CreateSandboxMutationVariables>;\n\n/**\n * __useCreateSandboxMutation__\n *\n * To run a mutation, you first call `useCreateSandboxMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateSandboxMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createSandboxMutation, { data, loading, error }] = useCreateSandboxMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateSandboxMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.CreateSandboxMutation, Types.CreateSandboxMutationVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useMutation<Types.CreateSandboxMutation, Types.CreateSandboxMutationVariables>(CreateSandboxDocument, options);\n }\nexport type CreateSandboxMutationHookResult = ReturnType<typeof useCreateSandboxMutation>;\nexport type CreateSandboxMutationResult = Apollo.MutationResult<Types.CreateSandboxMutation>;\nexport type CreateSandboxMutationOptions = Apollo.BaseMutationOptions<Types.CreateSandboxMutation, Types.CreateSandboxMutationVariables>;\nexport const ProxySandboxRequestDocument = gql`\n mutation ProxySandboxRequest($input: ProxySandboxRequestInput!) {\n proxySandboxRequest(input: $input) {\n status\n body\n }\n}\n `;\nexport type ProxySandboxRequestMutationFn = Apollo.MutationFunction<Types.ProxySandboxRequestMutation, Types.ProxySandboxRequestMutationVariables>;\n\n/**\n * __useProxySandboxRequestMutation__\n *\n * To run a mutation, you first call `useProxySandboxRequestMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useProxySandboxRequestMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [proxySandboxRequestMutation, { data, loading, error }] = useProxySandboxRequestMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useProxySandboxRequestMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.ProxySandboxRequestMutation, Types.ProxySandboxRequestMutationVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useMutation<Types.ProxySandboxRequestMutation, Types.ProxySandboxRequestMutationVariables>(ProxySandboxRequestDocument, options);\n }\nexport type ProxySandboxRequestMutationHookResult = ReturnType<typeof useProxySandboxRequestMutation>;\nexport type ProxySandboxRequestMutationResult = Apollo.MutationResult<Types.ProxySandboxRequestMutation>;\nexport type ProxySandboxRequestMutationOptions = Apollo.BaseMutationOptions<Types.ProxySandboxRequestMutation, Types.ProxySandboxRequestMutationVariables>;\nexport const ExtendSandboxTtlDocument = gql`\n mutation ExtendSandboxTtl($id: ID!, $additionalSeconds: Int!, $context: ContextInput!) {\n extendSandboxTTL(\n id: $id\n additionalSeconds: $additionalSeconds\n context: $context\n ) {\n id\n expiresAt\n }\n}\n `;\nexport type ExtendSandboxTtlMutationFn = Apollo.MutationFunction<Types.ExtendSandboxTtlMutation, Types.ExtendSandboxTtlMutationVariables>;\n\n/**\n * __useExtendSandboxTtlMutation__\n *\n * To run a mutation, you first call `useExtendSandboxTtlMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useExtendSandboxTtlMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [extendSandboxTtlMutation, { data, loading, error }] = useExtendSandboxTtlMutation({\n * variables: {\n * id: // value for 'id'\n * additionalSeconds: // value for 'additionalSeconds'\n * context: // value for 'context'\n * },\n * });\n */\nexport function useExtendSandboxTtlMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.ExtendSandboxTtlMutation, Types.ExtendSandboxTtlMutationVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useMutation<Types.ExtendSandboxTtlMutation, Types.ExtendSandboxTtlMutationVariables>(ExtendSandboxTtlDocument, options);\n }\nexport type ExtendSandboxTtlMutationHookResult = ReturnType<typeof useExtendSandboxTtlMutation>;\nexport type ExtendSandboxTtlMutationResult = Apollo.MutationResult<Types.ExtendSandboxTtlMutation>;\nexport type ExtendSandboxTtlMutationOptions = Apollo.BaseMutationOptions<Types.ExtendSandboxTtlMutation, Types.ExtendSandboxTtlMutationVariables>;\nexport const GetSandboxDocument = gql`\n query GetSandbox($id: ID!, $context: ContextInput!) {\n getSandbox(id: $id, context: $context) {\n id\n status\n errorMessage\n network {\n internalUrl\n }\n }\n}\n `;\n\n/**\n * __useGetSandboxQuery__\n *\n * To run a query within a React component, call `useGetSandboxQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetSandboxQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetSandboxQuery({\n * variables: {\n * id: // value for 'id'\n * context: // value for 'context'\n * },\n * });\n */\nexport function useGetSandboxQuery(baseOptions: ApolloReactHooks.QueryHookOptions<Types.GetSandboxQuery, Types.GetSandboxQueryVariables> & ({ variables: Types.GetSandboxQueryVariables; skip?: boolean; } | { skip: boolean; }) ) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>(GetSandboxDocument, options);\n }\nexport function useGetSandboxLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>(GetSandboxDocument, options);\n }\n// @ts-ignore\nexport function useGetSandboxSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>;\nexport function useGetSandboxSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetSandboxQuery | undefined, Types.GetSandboxQueryVariables>;\nexport function useGetSandboxSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>(GetSandboxDocument, options);\n }\nexport type GetSandboxQueryHookResult = ReturnType<typeof useGetSandboxQuery>;\nexport type GetSandboxLazyQueryHookResult = ReturnType<typeof useGetSandboxLazyQuery>;\nexport type GetSandboxSuspenseQueryHookResult = ReturnType<typeof useGetSandboxSuspenseQuery>;\nexport type GetSandboxQueryResult = Apollo.QueryResult<Types.GetSandboxQuery, Types.GetSandboxQueryVariables>;\nexport const GetActiveSandboxesDocument = gql`\n query GetActiveSandboxes($context: ContextInput!) {\n getActiveSandboxes(context: $context) {\n id\n name\n status\n metadata\n template\n createdBy\n }\n}\n `;\n\n/**\n * __useGetActiveSandboxesQuery__\n *\n * To run a query within a React component, call `useGetActiveSandboxesQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetActiveSandboxesQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetActiveSandboxesQuery({\n * variables: {\n * context: // value for 'context'\n * },\n * });\n */\nexport function useGetActiveSandboxesQuery(baseOptions: ApolloReactHooks.QueryHookOptions<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables> & ({ variables: Types.GetActiveSandboxesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>(GetActiveSandboxesDocument, options);\n }\nexport function useGetActiveSandboxesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>(GetActiveSandboxesDocument, options);\n }\n// @ts-ignore\nexport function useGetActiveSandboxesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>;\nexport function useGetActiveSandboxesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetActiveSandboxesQuery | undefined, Types.GetActiveSandboxesQueryVariables>;\nexport function useGetActiveSandboxesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>(GetActiveSandboxesDocument, options);\n }\nexport type GetActiveSandboxesQueryHookResult = ReturnType<typeof useGetActiveSandboxesQuery>;\nexport type GetActiveSandboxesLazyQueryHookResult = ReturnType<typeof useGetActiveSandboxesLazyQuery>;\nexport type GetActiveSandboxesSuspenseQueryHookResult = ReturnType<typeof useGetActiveSandboxesSuspenseQuery>;\nexport type GetActiveSandboxesQueryResult = Apollo.QueryResult<Types.GetActiveSandboxesQuery, Types.GetActiveSandboxesQueryVariables>;\nexport const AssetHandlerBootstrapDocument = gql`\n query AssetHandlerBootstrap {\n dashboardOverview {\n totalAssets\n openIncidents\n openWorkOrders\n totalTransactions\n }\n assets {\n ...AssetFields\n }\n incidents {\n ...IncidentFields\n }\n workOrders {\n ...WorkOrderFields\n }\n maintenanceRecords {\n id\n assetId\n title\n description\n type\n status\n priority\n scheduledAt\n completedAt\n estimatedCost\n actualCost\n checklist\n createdAt\n updatedAt\n }\n transactions {\n ...TransactionFields\n }\n changeRequests {\n id\n title\n description\n type\n status\n risk\n requestedBy\n assignedTo\n affectedAssets\n scheduledStart\n scheduledEnd\n approvals\n createdAt\n updatedAt\n }\n problems {\n id\n title\n description\n status\n priority\n category\n assignedTo\n relatedIncidents\n rootCause\n workaround\n createdAt\n updatedAt\n }\n budgets {\n id\n name\n category\n allocated\n spent\n remaining\n period\n department\n status\n }\n invoices {\n id\n number\n vendor\n amount\n currency\n issueDate\n dueDate\n status\n items\n relatedPO\n }\n securityEvents: getVaultSecurityEvents {\n items {\n id\n eventType\n severity\n title: message\n description\n source: resourceType\n userId\n ipAddress\n occurredAt: timestamp\n resolved: reviewed\n }\n }\n complianceFrameworks: securityComplianceFrameworks(\n filter: {sourceProduct: \"assethandler\"}\n ) {\n items {\n id\n name\n version\n status\n score\n totalControls\n passedControls\n failedControls\n lastAssessment\n nextAssessment\n }\n }\n securityPolicies: securityGovernancePolicies(\n filter: {sourceProduct: \"assethandler\"}\n ) {\n items {\n id\n name\n description\n category\n status\n version\n effectiveDate\n reviewDate\n owner\n applicableTo\n }\n }\n}\n ${AssetFieldsFragmentDoc}\n${IncidentFieldsFragmentDoc}\n${WorkOrderFieldsFragmentDoc}\n${TransactionFieldsFragmentDoc}`;\n\n/**\n * __useAssetHandlerBootstrapQuery__\n *\n * To run a query within a React component, call `useAssetHandlerBootstrapQuery` and pass it any options that fit your needs.\n * When your component renders, `useAssetHandlerBootstrapQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useAssetHandlerBootstrapQuery({\n * variables: {\n * },\n * });\n */\nexport function useAssetHandlerBootstrapQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>(AssetHandlerBootstrapDocument, options);\n }\nexport function useAssetHandlerBootstrapLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>(AssetHandlerBootstrapDocument, options);\n }\n// @ts-ignore\nexport function useAssetHandlerBootstrapSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>;\nexport function useAssetHandlerBootstrapSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.AssetHandlerBootstrapQuery | undefined, Types.AssetHandlerBootstrapQueryVariables>;\nexport function useAssetHandlerBootstrapSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>(AssetHandlerBootstrapDocument, options);\n }\nexport type AssetHandlerBootstrapQueryHookResult = ReturnType<typeof useAssetHandlerBootstrapQuery>;\nexport type AssetHandlerBootstrapLazyQueryHookResult = ReturnType<typeof useAssetHandlerBootstrapLazyQuery>;\nexport type AssetHandlerBootstrapSuspenseQueryHookResult = ReturnType<typeof useAssetHandlerBootstrapSuspenseQuery>;\nexport type AssetHandlerBootstrapQueryResult = Apollo.QueryResult<Types.AssetHandlerBootstrapQuery, Types.AssetHandlerBootstrapQueryVariables>;"],"mappings":";;;AA0DA,IAAa,IAAyB,CAAG;;;;;;;;;;;;;;;;OAiB5B,IAA4B,CAAG;;;;;;;;;;;;;;OAe/B,IAA+B,CAAG;;;;;;;;;;;;;OAclC,IAA6B,CAAG;;;;;;;;;;;;;OAchC,IAAwB,CAAG;;;;;;;;;;;OAsC3B,IAA8B,CAAG;;;;;;;OAkCjC,IAA2B,CAAG;;;;;;;;;;;OAwC9B,IAAqB,CAAG;;;;;;;;;;;OAiDxB,IAA6B,CAAG;;;;;;;;;;;;AAgDA,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwI1C,EAAuB;EAC3B,EAA0B;EAC1B,EAA2B;EAC3B"}