@burdenoff/microfe-sandbox 2026.715.1 → 2026.731.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sandbox/pages/AdminPage.d.ts.map +1 -1
- package/dist/sandbox/pages/AdminPage.js.map +1 -1
- package/dist/sandbox/pages/SandboxCreatePage.d.ts.map +1 -1
- package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -1
- package/dist/sandbox/pages/SandboxDetailPage.d.ts.map +1 -1
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -1
- package/dist/sandbox/types/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/AdminPage.tsx"],"names":[],"mappings":"AAqMA,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"AdminPage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/AdminPage.tsx"],"names":[],"mappings":"AAqMA,wBAAgB,SAAS,gCA+cxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPage.js","names":[],"sources":["../../../src/sandbox/pages/AdminPage.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { Activity, Clock3, Loader2, Save, Shield, Users } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport {\n Badge,\n Button,\n Card,\n CardContent,\n GlassCard,\n Input,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '../components/ui';\nimport { tWithFallback } from '../utils/i18n';\nimport { PageLayout } from '../components/PageLayout';\nimport {\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n type NextStep,\n} from '@burdenoff/fe-libs/ui';\nimport { useSandbox } from '../providers/SandboxProvider';\n\ntype FilterKind = 'all' | 'USER' | 'INTERNAL';\ntype FilterSource = 'all' | 'MANUAL' | 'AI_ASSISTANT' | 'DOCS_BUILDER' | 'SYSTEM';\n\nconst GET_SANDBOX_STATS = gql`\n query AdminPageGetSandboxStats($context: ContextInput!) {\n getSandboxStats(context: $context) {\n activeSandboxes\n totalCreated\n totalDeleted\n runningNow\n provisioningNow\n stoppedNow\n expiredCount\n failedCount\n totalCpuUsed\n totalMemoryUsed\n }\n }\n`;\n\nconst GET_SANDBOX_CONFIG = gql`\n query AdminPageGetSandboxConfig($context: ContextInput!) {\n getSandboxConfig(context: $context) {\n id\n defaultTtlSeconds\n maxTtlSeconds\n maxConcurrentPerUser\n maxConcurrentPerWorkspace\n defaultCpuRequest\n defaultCpuLimit\n defaultMemoryRequest\n defaultMemoryLimit\n workspaceId\n updatedAt\n allowedTemplates\n }\n }\n`;\n\nconst LIST_ALL_SANDBOXES = gql`\n query AdminPageListAllSandboxes(\n $context: ContextInput!\n $filter: SandboxFilterInput\n $pagination: SandboxPaginationInput\n ) {\n listAllSandboxes(context: $context, filter: $filter, pagination: $pagination) {\n items {\n id\n name\n description\n template\n mode\n status\n metadata\n ttlSeconds\n expiresAt\n createdBy\n createdAt\n updatedAt\n errorMessage\n resources {\n cpuRequest\n memoryRequest\n }\n }\n total\n hasMore\n }\n }\n`;\n\nconst UPDATE_SANDBOX_CONFIG = gql`\n mutation AdminPageUpdateSandboxConfig($input: UpdateSandboxConfigInput!) {\n updateSandboxConfig(input: $input) {\n id\n defaultTtlSeconds\n maxTtlSeconds\n maxConcurrentPerUser\n maxConcurrentPerWorkspace\n }\n }\n`;\n\ninterface AdminStats {\n activeSandboxes: number;\n totalCreated: number;\n totalDeleted: number;\n runningNow: number;\n provisioningNow: number;\n stoppedNow: number;\n expiredCount: number;\n failedCount: number;\n totalCpuUsed: string;\n totalMemoryUsed: string;\n}\n\ninterface AdminSandbox {\n id: string;\n name: string;\n description?: string | null;\n template: string;\n mode: string;\n status: string;\n metadata?: Record<string, unknown> | null;\n ttlSeconds: number;\n expiresAt?: string | null;\n createdBy: string;\n createdAt: string;\n updatedAt: string;\n errorMessage?: string | null;\n resources?: {\n cpuRequest?: string | null;\n memoryRequest?: string | null;\n } | null;\n}\n\ninterface AdminConfig {\n id: string;\n defaultTtlSeconds: number;\n maxTtlSeconds: number;\n maxConcurrentPerUser: number;\n maxConcurrentPerWorkspace: number;\n}\n\nfunction inferSandboxSource(\n sandbox: Pick<AdminSandbox, 'name' | 'template' | 'metadata'>\n): FilterSource {\n if (\n typeof sandbox.metadata?.assistantMode === 'string' ||\n typeof sandbox.metadata?.assistantAuth === 'object' ||\n sandbox.name.startsWith('ai-assistant-')\n ) {\n return 'AI_ASSISTANT';\n }\n\n if (\n sandbox.template === 'DOCS_BUILDER' ||\n typeof sandbox.metadata?.docsRevisionId === 'string' ||\n typeof sandbox.metadata?.docsSiteId === 'string' ||\n typeof sandbox.metadata?.docsBuildImageId === 'string' ||\n sandbox.name.startsWith('docs-build-') ||\n sandbox.name.startsWith('docs-image-canary-')\n ) {\n return 'DOCS_BUILDER';\n }\n\n return 'MANUAL';\n}\n\nfunction inferSandboxKind(\n sandbox: Pick<AdminSandbox, 'name' | 'template' | 'metadata'>\n): FilterKind {\n return inferSandboxSource(sandbox) === 'MANUAL' ? 'USER' : 'INTERNAL';\n}\n\nfunction formatTtl(seconds: number): string {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n if (hours > 0 && minutes > 0) return `${hours}h ${minutes}m`;\n if (hours > 0) return `${hours}h`;\n return `${minutes}m`;\n}\n\nfunction formatDate(value?: string | null): string {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\nexport function AdminPage() {\n const { workspaceId } = useSandbox();\n const { t } = useI18n();\n const [search, setSearch] = useState('');\n const [kind, setKind] = useState<FilterKind>('all');\n const [source, setSource] = useState<FilterSource>('all');\n const [page, setPage] = useState(1);\n const [formState, setFormState] = useState({\n defaultTtlSeconds: '3600',\n maxTtlSeconds: '86400',\n maxConcurrentPerUser: '3',\n maxConcurrentPerWorkspace: '10',\n });\n\n const { data: statsData, loading: statsLoading } = useQuery<{ getSandboxStats: AdminStats }>(\n GET_SANDBOX_STATS,\n {\n variables: { context: { workspaceId } },\n skip: !workspaceId,\n }\n );\n\n const {\n data: configData,\n loading: configLoading,\n refetch: refetchConfig,\n } = useQuery<{ getSandboxConfig: AdminConfig }>(GET_SANDBOX_CONFIG, {\n variables: { context: { workspaceId } },\n skip: !workspaceId,\n });\n\n const {\n data: sandboxesData,\n loading: sandboxesLoading,\n refetch: refetchSandboxes,\n } = useQuery<{\n listAllSandboxes: { items: AdminSandbox[]; total: number; hasMore: boolean };\n }>(LIST_ALL_SANDBOXES, {\n variables: {\n context: { workspaceId },\n pagination: { page, limit: 100 },\n },\n skip: !workspaceId,\n });\n\n const [updateSandboxConfig, { loading: savingConfig }] = useMutation(UPDATE_SANDBOX_CONFIG);\n\n useEffect(() => {\n const config = configData?.getSandboxConfig;\n if (!config) return;\n setFormState({\n defaultTtlSeconds: String(config.defaultTtlSeconds),\n maxTtlSeconds: String(config.maxTtlSeconds),\n maxConcurrentPerUser: String(config.maxConcurrentPerUser),\n maxConcurrentPerWorkspace: String(config.maxConcurrentPerWorkspace),\n });\n }, [configData?.getSandboxConfig]);\n\n const stats = statsData?.getSandboxStats;\n const list = sandboxesData?.listAllSandboxes;\n const derivedSandboxes = useMemo(\n () =>\n (list?.items ?? []).map((sandbox) => ({\n ...sandbox,\n kind: inferSandboxKind(sandbox),\n source: inferSandboxSource(sandbox),\n agentEnabled: inferSandboxKind(sandbox) === 'USER',\n })),\n [list?.items]\n );\n const filteredSandboxes = useMemo(\n () =>\n derivedSandboxes.filter((sandbox) => {\n if (search.trim()) {\n const needle = search.trim().toLowerCase();\n const haystack =\n `${sandbox.name} ${sandbox.description ?? ''} ${sandbox.createdBy}`.toLowerCase();\n if (!haystack.includes(needle)) {\n return false;\n }\n }\n\n if (kind !== 'all' && sandbox.kind !== kind) {\n return false;\n }\n\n if (source !== 'all' && sandbox.source !== source) {\n return false;\n }\n\n return true;\n }),\n [derivedSandboxes, kind, search, source]\n );\n const totalPages = Math.max(1, Math.ceil((list?.total ?? 0) / 100));\n\n const cards = useMemo(\n () => [\n {\n label: tWithFallback(t, 'sandbox.admin.stats.activeTotal', 'Active total'),\n value: stats?.activeSandboxes ?? 0,\n icon: <Activity size={18} className=\"text-primary\" />,\n },\n {\n label: tWithFallback(t, 'sandbox.admin.stats.userSandboxes', 'User sandboxes'),\n value: derivedSandboxes.filter((sandbox) => sandbox.kind === 'USER').length,\n icon: <Users size={18} className=\"text-status-success-text\" />,\n },\n {\n label: tWithFallback(t, 'sandbox.admin.stats.internalSandboxes', 'Internal sandboxes'),\n value: derivedSandboxes.filter((sandbox) => sandbox.kind === 'INTERNAL').length,\n icon: <Shield size={18} className=\"text-status-warning-text\" />,\n },\n {\n label: tWithFallback(t, 'sandbox.admin.stats.failedExpired', 'Failed / expired'),\n value: (stats?.failedCount ?? 0) + (stats?.expiredCount ?? 0),\n icon: <Clock3 size={18} className=\"text-status-error-text\" />,\n },\n ],\n [derivedSandboxes, stats, t]\n );\n\n const handleSaveConfig = async () => {\n if (!workspaceId) return;\n\n await updateSandboxConfig({\n variables: {\n input: {\n context: { workspaceId },\n defaultTtlSeconds: Number(formState.defaultTtlSeconds),\n maxTtlSeconds: Number(formState.maxTtlSeconds),\n maxConcurrentPerUser: Number(formState.maxConcurrentPerUser),\n maxConcurrentPerWorkspace: Number(formState.maxConcurrentPerWorkspace),\n },\n },\n });\n\n await Promise.all([refetchConfig(), refetchSandboxes()]);\n };\n\n // Orientation for admins landing on the dashboard for the first time.\n const nextSteps: NextStep[] = [\n {\n id: 'review-config',\n label: tWithFallback(t, 'sandbox.admin.nextSteps.config.label', 'Set workspace defaults'),\n description: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.config.desc',\n 'Tune default/max TTL and per-user / per-workspace concurrency limits.'\n ),\n icon: <Save size={16} />,\n href: '#sandbox-admin-config',\n },\n {\n id: 'review-internal',\n label: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.internal.label',\n 'Audit internal sandboxes'\n ),\n description: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.internal.desc',\n 'Filter to system / AI-created sandboxes to spot anything stuck or orphaned.'\n ),\n icon: <Shield size={16} />,\n onClick: () => setKind('INTERNAL'),\n },\n {\n id: 'review-failed',\n label: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.failed.label',\n 'Investigate failed / expired'\n ),\n description: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.failed.desc',\n 'Search the list for sandboxes that errored so resources can be reclaimed.'\n ),\n icon: <Clock3 size={16} />,\n href: '#sandbox-admin-list',\n },\n ];\n\n return (\n <PageLayout\n title={tWithFallback(t, 'sandbox.admin.title', 'Sandbox Admin')}\n subtitle={tWithFallback(\n t,\n 'sandbox.admin.subtitle',\n 'Monitor internal and user sandboxes, review usage split, and manage workspace-level defaults.'\n )}\n icon={<Shield size={24} />}\n headerContent={\n <Badge variant=\"secondary\">\n {stats\n ? tWithFallback(\n t,\n 'sandbox.admin.usageSplit',\n '{{user}} user / {{internal}} internal visible',\n {\n user: derivedSandboxes.filter((sandbox) => sandbox.kind === 'USER').length,\n internal: derivedSandboxes.filter((sandbox) => sandbox.kind === 'INTERNAL')\n .length,\n }\n )\n : tWithFallback(t, 'sandbox.admin.loadingUsageSplit', 'Loading usage split…')}\n </Badge>\n }\n >\n <PagePurpose>\n {tWithFallback(\n t,\n 'sandbox.admin.purpose',\n 'The operator view of every sandbox in this workspace — both the ones members spin up and the internal ones created by the AI assistant or docs builder. Use it to watch usage, hunt down failed or runaway environments, and set the guardrails (TTLs and concurrency limits) everyone else inherits.'\n )}\n </PagePurpose>\n\n <NextSteps storageKey=\"sandbox-admin\" steps={nextSteps} />\n\n {statsLoading ? (\n <div className=\"flex items-center justify-center min-h-[160px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n ) : (\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4\">\n {cards.map((card, index) => (\n <GlassCard\n key={card.label}\n treatment={index === 0 ? 'glass' : 'metric'}\n glow={index === 0}\n className=\"flex items-center justify-between p-5\"\n >\n <div>\n <p className=\"text-sm text-text-secondary\">{card.label}</p>\n <p className=\"mt-2 text-2xl font-semibold tabular-nums\">{card.value}</p>\n </div>\n <div className=\"rounded-xl bg-bg-sunken/70 p-3\">{card.icon}</div>\n </GlassCard>\n ))}\n </div>\n )}\n\n <div className=\"mt-6 grid grid-cols-1 gap-6 xl:grid-cols-[360px_minmax(0,1fr)]\">\n <Card id=\"sandbox-admin-config\">\n <CardContent className=\"space-y-4 p-5\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {tWithFallback(t, 'sandbox.admin.config.title', 'Workspace sandbox config')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.config.subtitle',\n 'Admin defaults used for manual/user sandboxes.'\n )}\n </p>\n </div>\n {configLoading && <Loader2 className=\"size-4 animate-spin text-primary\" />}\n </div>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.admin.config.defaultTtl', 'Default TTL (seconds)')}\n </span>\n <Input\n value={formState.defaultTtlSeconds}\n onChange={(event) =>\n setFormState((prev) => ({ ...prev, defaultTtlSeconds: event.target.value }))\n }\n />\n </label>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.admin.config.maxTtl', 'Max TTL (seconds)')}\n </span>\n <Input\n value={formState.maxTtlSeconds}\n onChange={(event) =>\n setFormState((prev) => ({ ...prev, maxTtlSeconds: event.target.value }))\n }\n />\n </label>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.config.maxConcurrentUser',\n 'Max concurrent per user'\n )}\n </span>\n <Input\n value={formState.maxConcurrentPerUser}\n onChange={(event) =>\n setFormState((prev) => ({ ...prev, maxConcurrentPerUser: event.target.value }))\n }\n />\n </label>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.config.maxConcurrentWorkspace',\n 'Max concurrent per workspace'\n )}\n </span>\n <Input\n value={formState.maxConcurrentPerWorkspace}\n onChange={(event) =>\n setFormState((prev) => ({\n ...prev,\n maxConcurrentPerWorkspace: event.target.value,\n }))\n }\n />\n </label>\n\n <Button onClick={() => void handleSaveConfig()} disabled={savingConfig || !workspaceId}>\n {savingConfig ? <Loader2 size={16} className=\"animate-spin\" /> : <Save size={16} />}\n {tWithFallback(t, 'sandbox.admin.config.save', 'Save config')}\n </Button>\n </CardContent>\n </Card>\n\n <Card id=\"sandbox-admin-list\">\n <CardContent className=\"space-y-4 p-5\">\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {tWithFallback(t, 'sandbox.admin.list.title', 'All sandboxes')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.list.subtitle',\n 'Superadmins can review both internal and user-owned sandboxes here.'\n )}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n <Input\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n placeholder={tWithFallback(t, 'sandbox.admin.list.search', 'Search sandboxes')}\n />\n\n <Select value={kind} onValueChange={(value) => setKind(value as FilterKind)}>\n <SelectTrigger>\n <SelectValue placeholder=\"Kind\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">All kinds</SelectItem>\n <SelectItem value=\"USER\">User</SelectItem>\n <SelectItem value=\"INTERNAL\">Internal</SelectItem>\n </SelectContent>\n </Select>\n\n <Select value={source} onValueChange={(value) => setSource(value as FilterSource)}>\n <SelectTrigger>\n <SelectValue placeholder=\"Source\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">All sources</SelectItem>\n <SelectItem value=\"MANUAL\">Manual</SelectItem>\n <SelectItem value=\"AI_ASSISTANT\">AI assistant</SelectItem>\n <SelectItem value=\"DOCS_BUILDER\">Docs builder</SelectItem>\n <SelectItem value=\"SYSTEM\">System</SelectItem>\n </SelectContent>\n </Select>\n </div>\n </div>\n\n {sandboxesLoading ? (\n <div className=\"flex items-center justify-center min-h-[220px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n ) : filteredSandboxes.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tWithFallback(t, 'sandbox.admin.list.empty.title', 'No sandboxes found')}\n description={tWithFallback(\n t,\n 'sandbox.admin.list.empty.description',\n 'Try adjusting the filters or create a sandbox from the product UI.'\n )}\n />\n ) : (\n <div className=\"space-y-3\">\n {filteredSandboxes.map((sandbox) => (\n <div\n key={sandbox.id}\n className=\"grid gap-3 rounded-xl border border-border-seam bg-bg-surface p-4 lg:grid-cols-[minmax(0,2fr)_auto_auto_auto] lg:items-center\"\n >\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <p className=\"truncate font-semibold\">{sandbox.name}</p>\n <Badge variant={sandbox.kind === 'INTERNAL' ? 'destructive' : 'secondary'}>\n {sandbox.kind}\n </Badge>\n <Badge variant=\"outline\">{sandbox.source}</Badge>\n <Badge variant=\"outline\">{sandbox.template}</Badge>\n <Badge variant=\"outline\">{sandbox.status}</Badge>\n {sandbox.agentEnabled && <Badge variant=\"outline\">Agent enabled</Badge>}\n </div>\n <p className=\"mt-1 truncate text-sm text-text-secondary\">\n {sandbox.description ||\n tWithFallback(\n t,\n 'sandbox.admin.list.noDescription',\n 'No description provided'\n )}\n </p>\n </div>\n\n <div className=\"text-sm text-text-secondary\">\n <div>Owner: {sandbox.createdBy}</div>\n <div>TTL: {formatTtl(sandbox.ttlSeconds)}</div>\n </div>\n\n <div className=\"text-sm text-text-secondary\">\n <div>CPU: {sandbox.resources?.cpuRequest ?? '—'}</div>\n <div>Memory: {sandbox.resources?.memoryRequest ?? '—'}</div>\n </div>\n\n <div className=\"text-sm text-text-secondary lg:text-right\">\n <div>Created: {formatDate(sandbox.createdAt)}</div>\n <div>Expires: {formatDate(sandbox.expiresAt)}</div>\n </div>\n </div>\n ))}\n\n <div className=\"flex items-center justify-between pt-2 text-sm text-text-secondary\">\n <span>\n Page {page} of {totalPages}\n </span>\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setPage((prev) => Math.max(1, prev - 1))}\n disabled={page <= 1}\n >\n Previous\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setPage((prev) => Math.min(totalPages, prev + 1))}\n disabled={page >= totalPages}\n >\n Next\n </Button>\n </div>\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,IAAM,IAAoB,CAAG;;;;;;;;;;;;;;;GAiBvB,IAAqB,CAAG;;;;;;;;;;;;;;;;;GAmBxB,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCxB,IAAwB,CAAG;;;;;;;;;;;AAqDjC,SAAS,EACP,GACc;AAoBd,QAlBE,OAAO,EAAQ,UAAU,iBAAkB,YAC3C,OAAO,EAAQ,UAAU,iBAAkB,YAC3C,EAAQ,KAAK,WAAW,gBAAgB,GAEjC,iBAIP,EAAQ,aAAa,kBACrB,OAAO,EAAQ,UAAU,kBAAmB,YAC5C,OAAO,EAAQ,UAAU,cAAe,YACxC,OAAO,EAAQ,UAAU,oBAAqB,YAC9C,EAAQ,KAAK,WAAW,cAAc,IACtC,EAAQ,KAAK,WAAW,qBAAqB,GAEtC,iBAGF;;AAGT,SAAS,EACP,GACY;AACZ,QAAO,EAAmB,EAAQ,KAAK,WAAW,SAAS;;AAG7D,SAAS,EAAU,GAAyB;CA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ACtD,kBAAC,OAAD,EAAA,UAAA,CAAK,YAAS,EAAQ,WAAW,iBAAiB,IAAU,EAAA,CAAA,CACxD;;SAEN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CAAK,aAAU,EAAW,EAAQ,UAAU,CAAO,EAAA,CAAA,EACnD,kBAAC,OAAD,EAAA,UAAA,CAAK,aAAU,EAAW,EAAQ,UAAU,CAAO,EAAA,CAAA,CAC/C;;SACF;UAtCC,EAAQ,GAsCT,CACN,EAEF,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD,EAAA,UAAA;SAAM;SACE;SAAK;SAAK;SACX,EAAA,CAAA,EACP,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,GAAD;UACE,SAAQ;UACR,MAAK;UACL,eAAe,GAAS,MAAS,KAAK,IAAI,GAAG,IAAO,EAAE,CAAC;UACvD,UAAU,KAAQ;oBACnB;UAEQ,CAAA,EACT,kBAAC,GAAD;UACE,SAAQ;UACR,MAAK;UACL,eAAe,GAAS,MAAS,KAAK,IAAI,GAAY,IAAO,EAAE,CAAC;UAChE,UAAU,KAAQ;oBACnB;UAEQ,CAAA,CACL;WACF;UACF;SAEI;;KACT,CAAA,CACH;;GACK"}
|
|
1
|
+
{"version":3,"file":"AdminPage.js","names":[],"sources":["../../../src/sandbox/pages/AdminPage.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { Activity, Clock3, Loader2, Save, Shield, Users } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport {\n Badge,\n Button,\n Card,\n CardContent,\n GlassCard,\n Input,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '../components/ui';\nimport { tWithFallback } from '../utils/i18n';\nimport { PageLayout } from '../components/PageLayout';\nimport {\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n type NextStep,\n} from '@burdenoff/fe-libs/ui';\nimport { useSandbox } from '../providers/SandboxProvider';\n\ntype FilterKind = 'all' | 'USER' | 'INTERNAL';\ntype FilterSource = 'all' | 'MANUAL' | 'AI_ASSISTANT' | 'DOCS_BUILDER' | 'SYSTEM';\n\nconst GET_SANDBOX_STATS = gql`\n query AdminPageGetSandboxStats($context: ContextInput!) {\n getSandboxStats(context: $context) {\n activeSandboxes\n totalCreated\n totalDeleted\n runningNow\n provisioningNow\n stoppedNow\n expiredCount\n failedCount\n totalCpuUsed\n totalMemoryUsed\n }\n }\n`;\n\nconst GET_SANDBOX_CONFIG = gql`\n query AdminPageGetSandboxConfig($context: ContextInput!) {\n getSandboxConfig(context: $context) {\n id\n defaultTtlSeconds\n maxTtlSeconds\n maxConcurrentPerUser\n maxConcurrentPerWorkspace\n defaultCpuRequest\n defaultCpuLimit\n defaultMemoryRequest\n defaultMemoryLimit\n workspaceId\n updatedAt\n allowedTemplates\n }\n }\n`;\n\nconst LIST_ALL_SANDBOXES = gql`\n query AdminPageListAllSandboxes(\n $context: ContextInput!\n $filter: SandboxFilterInput\n $pagination: SandboxPaginationInput\n ) {\n listAllSandboxes(context: $context, filter: $filter, pagination: $pagination) {\n items {\n id\n name\n description\n template\n mode\n status\n metadata\n ttlSeconds\n expiresAt\n createdBy\n createdAt\n updatedAt\n errorMessage\n resources {\n cpuRequest\n memoryRequest\n }\n }\n total\n hasMore\n }\n }\n`;\n\nconst UPDATE_SANDBOX_CONFIG = gql`\n mutation AdminPageUpdateSandboxConfig($input: UpdateSandboxConfigInput!) {\n updateSandboxConfig(input: $input) {\n id\n defaultTtlSeconds\n maxTtlSeconds\n maxConcurrentPerUser\n maxConcurrentPerWorkspace\n }\n }\n`;\n\ninterface AdminStats {\n activeSandboxes: number;\n totalCreated: number;\n totalDeleted: number;\n runningNow: number;\n provisioningNow: number;\n stoppedNow: number;\n expiredCount: number;\n failedCount: number;\n totalCpuUsed: string;\n totalMemoryUsed: string;\n}\n\ninterface AdminSandbox {\n id: string;\n name: string;\n description?: string | null;\n template: string;\n mode: string;\n status: string;\n metadata?: Record<string, unknown> | null;\n ttlSeconds: number;\n expiresAt?: string | null;\n createdBy: string;\n createdAt: string;\n updatedAt: string;\n errorMessage?: string | null;\n resources?: {\n cpuRequest?: string | null;\n memoryRequest?: string | null;\n } | null;\n}\n\ninterface AdminConfig {\n id: string;\n defaultTtlSeconds: number;\n maxTtlSeconds: number;\n maxConcurrentPerUser: number;\n maxConcurrentPerWorkspace: number;\n}\n\nfunction inferSandboxSource(\n sandbox: Pick<AdminSandbox, 'name' | 'template' | 'metadata'>\n): FilterSource {\n if (\n typeof sandbox.metadata?.assistantMode === 'string' ||\n typeof sandbox.metadata?.assistantAuth === 'object' ||\n sandbox.name.startsWith('ai-assistant-')\n ) {\n return 'AI_ASSISTANT';\n }\n\n if (\n sandbox.template === 'DOCS_BUILDER' ||\n typeof sandbox.metadata?.docsRevisionId === 'string' ||\n typeof sandbox.metadata?.docsSiteId === 'string' ||\n typeof sandbox.metadata?.docsBuildImageId === 'string' ||\n sandbox.name.startsWith('docs-build-') ||\n sandbox.name.startsWith('docs-image-canary-')\n ) {\n return 'DOCS_BUILDER';\n }\n\n return 'MANUAL';\n}\n\nfunction inferSandboxKind(\n sandbox: Pick<AdminSandbox, 'name' | 'template' | 'metadata'>\n): FilterKind {\n return inferSandboxSource(sandbox) === 'MANUAL' ? 'USER' : 'INTERNAL';\n}\n\nfunction formatTtl(seconds: number): string {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n if (hours > 0 && minutes > 0) return `${hours}h ${minutes}m`;\n if (hours > 0) return `${hours}h`;\n return `${minutes}m`;\n}\n\nfunction formatDate(value?: string | null): string {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\nexport function AdminPage() {\n const { workspaceId } = useSandbox();\n const { t } = useI18n();\n const [search, setSearch] = useState('');\n const [kind, setKind] = useState<FilterKind>('all');\n const [source, setSource] = useState<FilterSource>('all');\n const [page, setPage] = useState(1);\n const [formState, setFormState] = useState({\n defaultTtlSeconds: '3600',\n maxTtlSeconds: '86400',\n maxConcurrentPerUser: '3',\n maxConcurrentPerWorkspace: '10',\n });\n\n const { data: statsData, loading: statsLoading } = useQuery<{ getSandboxStats: AdminStats }>(\n GET_SANDBOX_STATS,\n {\n variables: { context: { workspaceId } },\n skip: !workspaceId,\n }\n );\n\n const {\n data: configData,\n loading: configLoading,\n refetch: refetchConfig,\n } = useQuery<{ getSandboxConfig: AdminConfig }>(GET_SANDBOX_CONFIG, {\n variables: { context: { workspaceId } },\n skip: !workspaceId,\n });\n\n const {\n data: sandboxesData,\n loading: sandboxesLoading,\n refetch: refetchSandboxes,\n } = useQuery<{\n listAllSandboxes: { items: AdminSandbox[]; total: number; hasMore: boolean };\n }>(LIST_ALL_SANDBOXES, {\n variables: {\n context: { workspaceId },\n pagination: { page, limit: 100 },\n },\n skip: !workspaceId,\n });\n\n const [updateSandboxConfig, { loading: savingConfig }] = useMutation(UPDATE_SANDBOX_CONFIG);\n\n useEffect(() => {\n const config = configData?.getSandboxConfig;\n if (!config) return;\n setFormState({\n defaultTtlSeconds: String(config.defaultTtlSeconds),\n maxTtlSeconds: String(config.maxTtlSeconds),\n maxConcurrentPerUser: String(config.maxConcurrentPerUser),\n maxConcurrentPerWorkspace: String(config.maxConcurrentPerWorkspace),\n });\n }, [configData?.getSandboxConfig]);\n\n const stats = statsData?.getSandboxStats;\n const list = sandboxesData?.listAllSandboxes;\n const derivedSandboxes = useMemo(\n () =>\n (list?.items ?? []).map((sandbox) => ({\n ...sandbox,\n kind: inferSandboxKind(sandbox),\n source: inferSandboxSource(sandbox),\n agentEnabled: inferSandboxKind(sandbox) === 'USER',\n })),\n [list?.items]\n );\n const filteredSandboxes = useMemo(\n () =>\n derivedSandboxes.filter((sandbox) => {\n if (search.trim()) {\n const needle = search.trim().toLowerCase();\n const haystack =\n `${sandbox.name} ${sandbox.description ?? ''} ${sandbox.createdBy}`.toLowerCase();\n if (!haystack.includes(needle)) {\n return false;\n }\n }\n\n if (kind !== 'all' && sandbox.kind !== kind) {\n return false;\n }\n\n if (source !== 'all' && sandbox.source !== source) {\n return false;\n }\n\n return true;\n }),\n [derivedSandboxes, kind, search, source]\n );\n const totalPages = Math.max(1, Math.ceil((list?.total ?? 0) / 100));\n\n const cards = useMemo(\n () => [\n {\n label: tWithFallback(t, 'sandbox.admin.stats.activeTotal', 'Active total'),\n value: stats?.activeSandboxes ?? 0,\n icon: <Activity size={18} className=\"text-primary\" />,\n },\n {\n label: tWithFallback(t, 'sandbox.admin.stats.userSandboxes', 'User sandboxes'),\n value: derivedSandboxes.filter((sandbox) => sandbox.kind === 'USER').length,\n icon: <Users size={18} className=\"text-status-success-text\" />,\n },\n {\n label: tWithFallback(t, 'sandbox.admin.stats.internalSandboxes', 'Internal sandboxes'),\n value: derivedSandboxes.filter((sandbox) => sandbox.kind === 'INTERNAL').length,\n icon: <Shield size={18} className=\"text-status-warning-text\" />,\n },\n {\n label: tWithFallback(t, 'sandbox.admin.stats.failedExpired', 'Failed / expired'),\n value: (stats?.failedCount ?? 0) + (stats?.expiredCount ?? 0),\n icon: <Clock3 size={18} className=\"text-status-error-text\" />,\n },\n ],\n [derivedSandboxes, stats, t]\n );\n\n const handleSaveConfig = async () => {\n if (!workspaceId) return;\n\n await updateSandboxConfig({\n variables: {\n input: {\n context: { workspaceId },\n defaultTtlSeconds: Number(formState.defaultTtlSeconds),\n maxTtlSeconds: Number(formState.maxTtlSeconds),\n maxConcurrentPerUser: Number(formState.maxConcurrentPerUser),\n maxConcurrentPerWorkspace: Number(formState.maxConcurrentPerWorkspace),\n },\n },\n });\n\n await Promise.all([refetchConfig(), refetchSandboxes()]);\n };\n\n // Orientation for admins landing on the dashboard for the first time.\n const nextSteps: NextStep[] = [\n {\n id: 'review-config',\n label: tWithFallback(t, 'sandbox.admin.nextSteps.config.label', 'Set workspace defaults'),\n description: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.config.desc',\n 'Tune default/max TTL and per-user / per-workspace concurrency limits.'\n ),\n icon: <Save size={16} />,\n href: '#sandbox-admin-config',\n },\n {\n id: 'review-internal',\n label: tWithFallback(t, 'sandbox.admin.nextSteps.internal.label', 'Audit internal sandboxes'),\n description: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.internal.desc',\n 'Filter to system / AI-created sandboxes to spot anything stuck or orphaned.'\n ),\n icon: <Shield size={16} />,\n onClick: () => setKind('INTERNAL'),\n },\n {\n id: 'review-failed',\n label: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.failed.label',\n 'Investigate failed / expired'\n ),\n description: tWithFallback(\n t,\n 'sandbox.admin.nextSteps.failed.desc',\n 'Search the list for sandboxes that errored so resources can be reclaimed.'\n ),\n icon: <Clock3 size={16} />,\n href: '#sandbox-admin-list',\n },\n ];\n\n return (\n <PageLayout\n title={tWithFallback(t, 'sandbox.admin.title', 'Sandbox Admin')}\n subtitle={tWithFallback(\n t,\n 'sandbox.admin.subtitle',\n 'Monitor internal and user sandboxes, review usage split, and manage workspace-level defaults.'\n )}\n icon={<Shield size={24} />}\n headerContent={\n <Badge variant=\"secondary\">\n {stats\n ? tWithFallback(\n t,\n 'sandbox.admin.usageSplit',\n '{{user}} user / {{internal}} internal visible',\n {\n user: derivedSandboxes.filter((sandbox) => sandbox.kind === 'USER').length,\n internal: derivedSandboxes.filter((sandbox) => sandbox.kind === 'INTERNAL')\n .length,\n }\n )\n : tWithFallback(t, 'sandbox.admin.loadingUsageSplit', 'Loading usage split…')}\n </Badge>\n }\n >\n <PagePurpose>\n {tWithFallback(\n t,\n 'sandbox.admin.purpose',\n 'The operator view of every sandbox in this workspace — both the ones members spin up and the internal ones created by the AI assistant or docs builder. Use it to watch usage, hunt down failed or runaway environments, and set the guardrails (TTLs and concurrency limits) everyone else inherits.'\n )}\n </PagePurpose>\n\n <NextSteps storageKey=\"sandbox-admin\" steps={nextSteps} />\n\n {statsLoading ? (\n <div className=\"flex items-center justify-center min-h-[160px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n ) : (\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4\">\n {cards.map((card, index) => (\n <GlassCard\n key={card.label}\n treatment={index === 0 ? 'glass' : 'metric'}\n glow={index === 0}\n className=\"flex items-center justify-between p-5\"\n >\n <div>\n <p className=\"text-sm text-text-secondary\">{card.label}</p>\n <p className=\"mt-2 text-2xl font-semibold tabular-nums\">{card.value}</p>\n </div>\n <div className=\"rounded-xl bg-bg-sunken/70 p-3\">{card.icon}</div>\n </GlassCard>\n ))}\n </div>\n )}\n\n <div className=\"mt-6 grid grid-cols-1 gap-6 xl:grid-cols-[360px_minmax(0,1fr)]\">\n <Card id=\"sandbox-admin-config\">\n <CardContent className=\"space-y-4 p-5\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {tWithFallback(t, 'sandbox.admin.config.title', 'Workspace sandbox config')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.config.subtitle',\n 'Admin defaults used for manual/user sandboxes.'\n )}\n </p>\n </div>\n {configLoading && <Loader2 className=\"size-4 animate-spin text-primary\" />}\n </div>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.admin.config.defaultTtl', 'Default TTL (seconds)')}\n </span>\n <Input\n value={formState.defaultTtlSeconds}\n onChange={(event) =>\n setFormState((prev) => ({ ...prev, defaultTtlSeconds: event.target.value }))\n }\n />\n </label>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.admin.config.maxTtl', 'Max TTL (seconds)')}\n </span>\n <Input\n value={formState.maxTtlSeconds}\n onChange={(event) =>\n setFormState((prev) => ({ ...prev, maxTtlSeconds: event.target.value }))\n }\n />\n </label>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.config.maxConcurrentUser',\n 'Max concurrent per user'\n )}\n </span>\n <Input\n value={formState.maxConcurrentPerUser}\n onChange={(event) =>\n setFormState((prev) => ({ ...prev, maxConcurrentPerUser: event.target.value }))\n }\n />\n </label>\n\n <label className=\"block space-y-1\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.config.maxConcurrentWorkspace',\n 'Max concurrent per workspace'\n )}\n </span>\n <Input\n value={formState.maxConcurrentPerWorkspace}\n onChange={(event) =>\n setFormState((prev) => ({\n ...prev,\n maxConcurrentPerWorkspace: event.target.value,\n }))\n }\n />\n </label>\n\n <Button onClick={() => void handleSaveConfig()} disabled={savingConfig || !workspaceId}>\n {savingConfig ? <Loader2 size={16} className=\"animate-spin\" /> : <Save size={16} />}\n {tWithFallback(t, 'sandbox.admin.config.save', 'Save config')}\n </Button>\n </CardContent>\n </Card>\n\n <Card id=\"sandbox-admin-list\">\n <CardContent className=\"space-y-4 p-5\">\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {tWithFallback(t, 'sandbox.admin.list.title', 'All sandboxes')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.admin.list.subtitle',\n 'Superadmins can review both internal and user-owned sandboxes here.'\n )}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n <Input\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n placeholder={tWithFallback(t, 'sandbox.admin.list.search', 'Search sandboxes')}\n />\n\n <Select value={kind} onValueChange={(value) => setKind(value as FilterKind)}>\n <SelectTrigger>\n <SelectValue placeholder=\"Kind\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">All kinds</SelectItem>\n <SelectItem value=\"USER\">User</SelectItem>\n <SelectItem value=\"INTERNAL\">Internal</SelectItem>\n </SelectContent>\n </Select>\n\n <Select value={source} onValueChange={(value) => setSource(value as FilterSource)}>\n <SelectTrigger>\n <SelectValue placeholder=\"Source\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"all\">All sources</SelectItem>\n <SelectItem value=\"MANUAL\">Manual</SelectItem>\n <SelectItem value=\"AI_ASSISTANT\">AI assistant</SelectItem>\n <SelectItem value=\"DOCS_BUILDER\">Docs builder</SelectItem>\n <SelectItem value=\"SYSTEM\">System</SelectItem>\n </SelectContent>\n </Select>\n </div>\n </div>\n\n {sandboxesLoading ? (\n <div className=\"flex items-center justify-center min-h-[220px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n ) : filteredSandboxes.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tWithFallback(t, 'sandbox.admin.list.empty.title', 'No sandboxes found')}\n description={tWithFallback(\n t,\n 'sandbox.admin.list.empty.description',\n 'Try adjusting the filters or create a sandbox from the product UI.'\n )}\n />\n ) : (\n <div className=\"space-y-3\">\n {filteredSandboxes.map((sandbox) => (\n <div\n key={sandbox.id}\n className=\"grid gap-3 rounded-xl border border-border-seam bg-bg-surface p-4 lg:grid-cols-[minmax(0,2fr)_auto_auto_auto] lg:items-center\"\n >\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <p className=\"truncate font-semibold\">{sandbox.name}</p>\n <Badge variant={sandbox.kind === 'INTERNAL' ? 'destructive' : 'secondary'}>\n {sandbox.kind}\n </Badge>\n <Badge variant=\"outline\">{sandbox.source}</Badge>\n <Badge variant=\"outline\">{sandbox.template}</Badge>\n <Badge variant=\"outline\">{sandbox.status}</Badge>\n {sandbox.agentEnabled && <Badge variant=\"outline\">Agent enabled</Badge>}\n </div>\n <p className=\"mt-1 truncate text-sm text-text-secondary\">\n {sandbox.description ||\n tWithFallback(\n t,\n 'sandbox.admin.list.noDescription',\n 'No description provided'\n )}\n </p>\n </div>\n\n <div className=\"text-sm text-text-secondary\">\n <div>Owner: {sandbox.createdBy}</div>\n <div>TTL: {formatTtl(sandbox.ttlSeconds)}</div>\n </div>\n\n <div className=\"text-sm text-text-secondary\">\n <div>CPU: {sandbox.resources?.cpuRequest ?? '—'}</div>\n <div>Memory: {sandbox.resources?.memoryRequest ?? '—'}</div>\n </div>\n\n <div className=\"text-sm text-text-secondary lg:text-right\">\n <div>Created: {formatDate(sandbox.createdAt)}</div>\n <div>Expires: {formatDate(sandbox.expiresAt)}</div>\n </div>\n </div>\n ))}\n\n <div className=\"flex items-center justify-between pt-2 text-sm text-text-secondary\">\n <span>\n Page {page} of {totalPages}\n </span>\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setPage((prev) => Math.max(1, prev - 1))}\n disabled={page <= 1}\n >\n Previous\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setPage((prev) => Math.min(totalPages, prev + 1))}\n disabled={page >= totalPages}\n >\n Next\n </Button>\n </div>\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,IAAM,IAAoB,CAAG;;;;;;;;;;;;;;;GAiBvB,IAAqB,CAAG;;;;;;;;;;;;;;;;;GAmBxB,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCxB,IAAwB,CAAG;;;;;;;;;;;AAqDjC,SAAS,EACP,GACc;AAoBd,QAlBE,OAAO,EAAQ,UAAU,iBAAkB,YAC3C,OAAO,EAAQ,UAAU,iBAAkB,YAC3C,EAAQ,KAAK,WAAW,gBAAgB,GAEjC,iBAIP,EAAQ,aAAa,kBACrB,OAAO,EAAQ,UAAU,kBAAmB,YAC5C,OAAO,EAAQ,UAAU,cAAe,YACxC,OAAO,EAAQ,UAAU,oBAAqB,YAC9C,EAAQ,KAAK,WAAW,cAAc,IACtC,EAAQ,KAAK,WAAW,qBAAqB,GAEtC,iBAGF;;AAGT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;UAAK,WAAU;oBAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CAAK,SAAM,EAAQ,WAAW,cAAc,IAAU,EAAA,CAAA,EACtD,kBAAC,OAAD,EAAA,UAAA,CAAK,YAAS,EAAQ,WAAW,iBAAiB,IAAU,EAAA,CAAA,CACxD;;SAEN,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CAAK,aAAU,EAAW,EAAQ,UAAU,CAAO,EAAA,CAAA,EACnD,kBAAC,OAAD,EAAA,UAAA,CAAK,aAAU,EAAW,EAAQ,UAAU,CAAO,EAAA,CAAA,CAC/C;;SACF;UAtCC,EAAQ,GAsCT,CACN,EAEF,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD,EAAA,UAAA;SAAM;SACE;SAAK;SAAK;SACX,EAAA,CAAA,EACP,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,GAAD;UACE,SAAQ;UACR,MAAK;UACL,eAAe,GAAS,MAAS,KAAK,IAAI,GAAG,IAAO,EAAE,CAAC;UACvD,UAAU,KAAQ;oBACnB;UAEQ,CAAA,EACT,kBAAC,GAAD;UACE,SAAQ;UACR,MAAK;UACL,eAAe,GAAS,MAAS,KAAK,IAAI,GAAY,IAAO,EAAE,CAAC;UAChE,UAAU,KAAQ;oBACnB;UAEQ,CAAA,CACL;WACF;UACF;SAEI;;KACT,CAAA,CACH;;GACK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxCreatePage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/SandboxCreatePage.tsx"],"names":[],"mappings":"AA8LA,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"SandboxCreatePage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/SandboxCreatePage.tsx"],"names":[],"mappings":"AA8LA,wBAAgB,iBAAiB,gCAq6ChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxCreatePage.js","names":[],"sources":["../../../src/sandbox/pages/SandboxCreatePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n ArrowLeft,\n Save,\n Loader2,\n AlertCircle,\n CheckCircle2,\n X,\n Box,\n Settings,\n Info,\n Cpu,\n MemoryStick,\n Timer,\n Plus,\n Trash2,\n Container,\n Database,\n HelpCircle,\n} from 'lucide-react';\nimport { Button, Card, CardContent, Badge, EmphasisPanel } from '../components/ui';\nimport { OptionalFields, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useSandbox } from '../providers/SandboxProvider';\nimport { PageLayout } from '../components/PageLayout';\nimport { TagsInput } from '../components/TagsInput';\nimport { FilesFolderPicker } from '../components/FilesFolderPicker';\nimport { useSandboxEvents } from '../utils/sandboxEvents';\nimport { tWithFallback } from '../utils/i18n';\nimport { stripBurdenoffRegistry, withBurdenoffRegistry } from '../utils/imageRegistry';\nimport {\n useListSandboxTemplatesQuery,\n useCreateSandboxMutation,\n} from '../../generated/wspace-operations';\nimport type {\n SandboxTemplateType,\n SandboxTemplate,\n SandboxMode,\n ContainerSpec,\n EnvVar,\n} from '../types';\n\ntype NotificationType = 'success' | 'error';\n\ntype StorageMode = 'NONE' | 'EPHEMERAL' | 'PERSISTENT';\n\ninterface ContainerFormData {\n /** Stable client-side row id, used as React `key` so add/remove/reorder\n * doesn't shift component state across siblings. Never sent to the API. */\n _rowId: string;\n name: string;\n image: string;\n ports: { _rowId: string; containerPort: number; name: string }[];\n env: EnvVar[];\n requestsCpu: string;\n requestsMemory: string;\n limitsCpu: string;\n limitsMemory: string;\n _registryType?: 'burdenoff' | 'custom';\n}\n\nlet _rowIdCounter = 0;\nfunction nextRowId(): string {\n _rowIdCounter += 1;\n return `row-${_rowIdCounter}-${Date.now()}`;\n}\n\ninterface FormData {\n name: string;\n description: string;\n template: SandboxTemplateType;\n mode: SandboxMode;\n cpuRequest: string;\n cpuLimit: string;\n memoryRequest: string;\n memoryLimit: string;\n ttlSeconds: number;\n templateId: string;\n containers: ContainerFormData[];\n storageMode: StorageMode;\n storageSizeGi: number;\n storageMountPath: string;\n storageRetainOnDelete: boolean;\n filesFolderId: string | null;\n globalGatewayUrl: string;\n workspaceGatewayUrl: string;\n}\n\nconst templateOptions: {\n value: SandboxTemplateType;\n labelKey: string;\n labelFallback: string;\n descriptionKey: string;\n descriptionFallback: string;\n icon: typeof Box;\n}[] = [\n {\n value: 'MISC_SHELL' as SandboxTemplateType,\n labelKey: 'sandbox.create.templateType.defaultSandbox.label',\n labelFallback: 'Default Sandbox',\n descriptionKey: 'sandbox.create.templateType.defaultSandbox.description',\n descriptionFallback:\n 'Pre-configured development environment with VibeControls agent, Bun, nginx, and common dev tools',\n icon: Box,\n },\n {\n value: 'CUSTOM' as SandboxTemplateType,\n labelKey: 'sandbox.create.templateType.customSandbox.label',\n labelFallback: 'Custom Sandbox',\n descriptionKey: 'sandbox.create.templateType.customSandbox.description',\n descriptionFallback: 'Configure your own container image and resources',\n icon: Settings,\n },\n];\n\nfunction buildEmptyContainer(): ContainerFormData {\n return {\n _rowId: nextRowId(),\n name: '',\n image: '',\n ports: [],\n env: [],\n requestsCpu: '',\n requestsMemory: '',\n limitsCpu: '',\n limitsMemory: '',\n };\n}\n\nfunction HelpTip({ text }: { text: string }) {\n const [open, setOpen] = useState(false);\n return (\n <span className=\"relative inline-block ml-1.5\">\n <button\n type=\"button\"\n onClick={() => setOpen(!open)}\n className=\"text-text-tertiary hover:text-text-secondary transition-colors\"\n >\n <HelpCircle size={14} />\n </button>\n {open && (\n <div className=\"absolute left-0 top-6 z-50 w-64 rounded-lg border border-border-default bg-bg-surface p-3 text-xs text-text-secondary shadow-lg\">\n {text}\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n aria-label=\"Close help tip\"\n className=\"absolute top-1 right-1 text-text-tertiary hover:text-text-secondary\"\n >\n <X size={12} />\n </button>\n </div>\n )}\n </span>\n );\n}\n\n/**\n * Create Sandbox Page\n * Form for creating a new sandbox with container and resource configuration\n */\n// Detect environment from hostname — alpha/local uses alpha image, production uses stable\nconst isAlphaEnv =\n typeof window !== 'undefined' &&\n (window.location.hostname.includes('alpha') ||\n window.location.hostname.endsWith('.local.burdenoff.com') ||\n window.location.hostname === 'localhost' ||\n window.location.hostname === '127.0.0.1');\n\n// FQDN required by sandbox-svc registry allowlist (burdenoffregistry.azurecr.io/*,\n// ghcr.io/algoshred/*, docker.io/library/*, …). Bare paths like\n// `sandbox/vibecontrols:alpha` are rejected at createSandbox.\nconst DEFAULT_SANDBOX_IMAGE = isAlphaEnv\n ? 'burdenoffregistry.azurecr.io/sandbox/vibecontrols-alpha:2026.401.5-alpha'\n : 'burdenoffregistry.azurecr.io/sandbox/vibecontrols:2026.401.4-alpha';\n\n// In \"Burdenoff repositories\" mode `container.image` holds only the\n// path-after-registry; submit re-adds the registry. The default/placeholder\n// must therefore be stripped, or the fixed prefix span shows (and stores) it\n// twice. See ./utils/imageRegistry for the round-trip helpers.\nconst DEFAULT_SANDBOX_IMAGE_PATH = stripBurdenoffRegistry(DEFAULT_SANDBOX_IMAGE);\n\nconst DEFAULT_GLOBAL_GATEWAY_URL = isAlphaEnv\n ? 'https://alphagraphql.burdenoff.com/global/graphql'\n : 'https://graphql.burdenoff.com/global/graphql';\n\nconst DEFAULT_WSPACE_GATEWAY_URL = isAlphaEnv\n ? 'https://alphagraphqlworkspaces.burdenoff.com/workspaces/graphql'\n : 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql';\n\nexport function SandboxCreatePage() {\n const { basePath = '/', navigate, workspaceId } = useSandbox();\n const sandboxEvents = useSandboxEvents();\n const { t } = useI18n();\n const [tags, setTags] = useState<string[]>([]);\n\n const [formData, setFormData] = useState<FormData>({\n name: '',\n description: '',\n template: 'MISC_SHELL',\n mode: 'DEPLOYMENT',\n cpuRequest: '250m',\n cpuLimit: '2',\n memoryRequest: '512Mi',\n memoryLimit: '2Gi',\n ttlSeconds: 10800,\n templateId: '',\n containers: [\n {\n _rowId: nextRowId(),\n name: 'main',\n image: DEFAULT_SANDBOX_IMAGE_PATH,\n ports: [\n { _rowId: nextRowId(), containerPort: 80, name: 'nginx' },\n { _rowId: nextRowId(), containerPort: 3005, name: 'agent' },\n ],\n env: [],\n requestsCpu: '250m',\n requestsMemory: '512Mi',\n limitsCpu: '2',\n limitsMemory: '2Gi',\n _registryType: 'burdenoff' as const,\n },\n ],\n storageMode: 'NONE',\n storageSizeGi: 10,\n storageMountPath: '/data',\n storageRetainOnDelete: false,\n filesFolderId: null,\n globalGatewayUrl: DEFAULT_GLOBAL_GATEWAY_URL,\n workspaceGatewayUrl: DEFAULT_WSPACE_GATEWAY_URL,\n });\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n const [notification, setNotification] = useState<{\n type: NotificationType;\n message: string;\n } | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const { data: templatesData } = useListSandboxTemplatesQuery({\n variables: { context: { workspaceId }, template: formData.template as any },\n skip: !workspaceId,\n });\n const [createSandbox] = useCreateSandboxMutation();\n const filteredTemplates = (templatesData?.listSandboxTemplates?.items ?? []) as any[];\n\n const showNotification = (type: NotificationType, message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n const handleTemplateSelect = (template: SandboxTemplate) => {\n setFormData((prev) => ({\n ...prev,\n templateId: template.id,\n cpuRequest: template.resources?.cpuRequest ?? prev.cpuRequest,\n cpuLimit: template.resources?.cpuLimit ?? prev.cpuLimit,\n memoryRequest: template.resources?.memoryRequest ?? prev.memoryRequest,\n memoryLimit: template.resources?.memoryLimit ?? prev.memoryLimit,\n ttlSeconds: template.ttlSeconds,\n template: template.template,\n containers:\n template.containers && template.containers.length > 0\n ? template.containers.map((c) => ({\n _rowId: nextRowId(),\n name: c.name,\n image: c.image,\n ports:\n c.ports?.map((p) => ({\n _rowId: nextRowId(),\n containerPort: p.containerPort,\n name: p.name ?? '',\n })) ?? [],\n env: c.env ?? [],\n requestsCpu: c.resources?.requestsCpu ?? '',\n requestsMemory: c.resources?.requestsMemory ?? '',\n limitsCpu: c.resources?.limitsCpu ?? '',\n limitsMemory: c.resources?.limitsMemory ?? '',\n }))\n : prev.containers,\n storageMode: template.storage?.mode ?? prev.storageMode,\n storageSizeGi: template.storage?.sizeGi ?? prev.storageSizeGi,\n storageMountPath: template.storage?.mountPath ?? prev.storageMountPath,\n storageRetainOnDelete: template.storage?.retainOnDelete ?? prev.storageRetainOnDelete,\n }));\n };\n\n const handleInputChange = (field: keyof FormData, value: string | number | boolean | null) => {\n setFormData((prev) => ({ ...prev, [field]: value }));\n if (field === 'templateId') return;\n // Clear template selection when customizing\n if (\n ['cpuRequest', 'cpuLimit', 'memoryRequest', 'memoryLimit', 'ttlSeconds'].includes(\n field as string\n )\n ) {\n setFormData((prev) => ({ ...prev, templateId: '' }));\n }\n if (errors[field as string]) {\n setErrors((prev) => {\n const next = { ...prev };\n delete next[field as string];\n return next;\n });\n }\n };\n\n // Container management\n const addContainer = () => {\n setFormData((prev) => ({\n ...prev,\n containers: [...prev.containers, buildEmptyContainer()],\n templateId: '',\n }));\n };\n\n const removeContainer = (index: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.filter((_, i) => i !== index),\n templateId: '',\n }));\n };\n\n const updateContainer = (index: number, field: keyof ContainerFormData, value: any) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) => (i === index ? { ...c, [field]: value } : c)),\n templateId: '',\n }));\n };\n\n const addPort = (containerIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex\n ? { ...c, ports: [...c.ports, { _rowId: nextRowId(), containerPort: 8080, name: '' }] }\n : c\n ),\n }));\n };\n\n const removePort = (containerIndex: number, portIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex ? { ...c, ports: c.ports.filter((_, pi) => pi !== portIndex) } : c\n ),\n }));\n };\n\n const addEnvVar = (containerIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex ? { ...c, env: [...c.env, { name: '', value: '' }] } : c\n ),\n }));\n };\n\n const removeEnvVar = (containerIndex: number, envIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex ? { ...c, env: c.env.filter((_, ei) => ei !== envIndex) } : c\n ),\n }));\n };\n\n const validateForm = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!formData.name.trim())\n newErrors.name = tWithFallback(t, 'sandbox.create.errors.nameRequired', 'Name is required');\n if (!formData.cpuRequest.trim())\n newErrors.cpuRequest = tWithFallback(\n t,\n 'sandbox.create.errors.cpuRequestRequired',\n 'CPU request is required'\n );\n if (!formData.cpuLimit.trim())\n newErrors.cpuLimit = tWithFallback(\n t,\n 'sandbox.create.errors.cpuLimitRequired',\n 'CPU limit is required'\n );\n if (!formData.memoryRequest.trim())\n newErrors.memoryRequest = tWithFallback(\n t,\n 'sandbox.create.errors.memoryRequestRequired',\n 'Memory request is required'\n );\n if (!formData.memoryLimit.trim())\n newErrors.memoryLimit = tWithFallback(\n t,\n 'sandbox.create.errors.memoryLimitRequired',\n 'Memory limit is required'\n );\n if (formData.ttlSeconds < 600 || formData.ttlSeconds > 86400)\n newErrors.ttlSeconds = tWithFallback(\n t,\n 'sandbox.create.errors.ttlRange',\n 'TTL must be 10m-24h'\n );\n if (formData.containers.length === 0)\n newErrors.containers = tWithFallback(\n t,\n 'sandbox.create.errors.containersRequired',\n 'At least one container is required'\n );\n formData.containers.forEach((c, i) => {\n if (!c.name.trim())\n newErrors[`container_${i}_name`] = tWithFallback(\n t,\n 'sandbox.create.errors.containerNameRequired',\n 'Container name is required'\n );\n if (!c.image.trim())\n newErrors[`container_${i}_image`] = tWithFallback(\n t,\n 'sandbox.create.errors.containerImageRequired',\n 'Container image is required'\n );\n });\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!validateForm()) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.create.notifications.fixErrors', 'Please fix the form errors')\n );\n return;\n }\n setSubmitting(true);\n try {\n const containers = formData.containers.map((c) => {\n const fullImage =\n (c._registryType || 'burdenoff') === 'burdenoff'\n ? withBurdenoffRegistry(c.image)\n : c.image;\n return {\n name: c.name,\n image: fullImage,\n ports:\n c.ports.length > 0\n ? c.ports.map((p) => ({ containerPort: p.containerPort, name: p.name || undefined }))\n : undefined,\n env: c.env.length > 0 ? c.env.filter((e) => e.name.trim()) : undefined,\n resources:\n c.requestsCpu || c.requestsMemory || c.limitsCpu || c.limitsMemory\n ? {\n requestsCpu: c.requestsCpu || undefined,\n requestsMemory: c.requestsMemory || undefined,\n limitsCpu: c.limitsCpu || undefined,\n limitsMemory: c.limitsMemory || undefined,\n }\n : undefined,\n };\n });\n\n const result = await createSandbox({\n variables: {\n input: {\n context: { workspaceId },\n name: formData.name,\n description: formData.description || undefined,\n template: formData.template as any,\n mode: formData.mode as any,\n containers,\n resources: {\n cpuRequest: formData.cpuRequest,\n cpuLimit: formData.cpuLimit,\n memoryRequest: formData.memoryRequest,\n memoryLimit: formData.memoryLimit,\n },\n storage: {\n mode: formData.storageMode,\n sizeGi: formData.storageMode !== 'NONE' ? formData.storageSizeGi : undefined,\n mountPath: formData.storageMode !== 'NONE' ? formData.storageMountPath : undefined,\n retainOnDelete:\n formData.storageMode === 'PERSISTENT' ? formData.storageRetainOnDelete : false,\n filesFolderId:\n formData.storageMode !== 'NONE' && formData.filesFolderId\n ? formData.filesFolderId\n : undefined,\n },\n ttlSeconds: formData.ttlSeconds,\n metadata: {\n globalGatewayUrl: formData.globalGatewayUrl || undefined,\n workspaceGatewayUrl: formData.workspaceGatewayUrl || undefined,\n tags: tags.length ? tags : undefined,\n },\n },\n },\n });\n // MutateResult wrapper surfaces non-throwing GraphQL errors via `error`.\n // Without this guard, a failed mutation (e.g. registry-allowlist reject)\n // still fires the success toast and navigates.\n if (result.error) {\n showNotification(\n 'error',\n tWithFallback(\n t,\n 'sandbox.create.notifications.createFailed',\n 'Failed to create sandbox'\n ) + `: ${result.error.message}`\n );\n return;\n }\n const created = result.data?.createSandbox;\n if (!created) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.create.notifications.createFailed', 'Failed to create sandbox')\n );\n return;\n }\n sandboxEvents.sandboxCreated({\n sandboxId: created.id,\n kind: (created.kind?.toLowerCase?.() === 'internal' ? 'internal' : 'user') as\n | 'user'\n | 'internal',\n source: created.source ?? 'manual',\n });\n showNotification(\n 'success',\n tWithFallback(\n t,\n 'sandbox.create.notifications.createSuccess',\n 'Sandbox created successfully! Provisioning...'\n )\n );\n const detailPath = `${basePath.replace(/\\/$/, '')}/${created.id}`;\n setTimeout(() => navigate?.(detailPath), 1500);\n } catch (err) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.create.notifications.createFailed', 'Failed to create sandbox')\n );\n } finally {\n setSubmitting(false);\n }\n };\n\n const formatTTL = (seconds: number): string => {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n if (hours > 0 && minutes > 0) return `${hours}h ${minutes}m`;\n if (hours > 0) return `${hours}h`;\n return `${minutes}m`;\n };\n\n return (\n <PageLayout showHeader={false}>\n {/* Notification */}\n {notification && (\n <div\n className={`fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200 ${\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n }`}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <AlertCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n <button\n type=\"button\"\n onClick={() => setNotification(null)}\n aria-label=\"Dismiss notification\"\n className=\"ml-2 p-1 rounded-md hover:bg-accent\"\n >\n <X size={16} />\n </button>\n </div>\n )}\n\n {/* Header — single emphasis zone for the page intent */}\n <EmphasisPanel className=\"overflow-hidden bg-hero-mesh\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"flex size-11 flex-shrink-0 items-center justify-center rounded-lg hover:bg-bg-sunken/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border\"\n aria-label={tWithFallback(\n t,\n 'sandbox.create.header.back.ariaLabel',\n 'Back to sandboxes'\n )}\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Box size={24} className=\"text-primary\" />\n </div>\n <h1 className=\"text-2xl sm:text-3xl font-bold\">\n {tWithFallback(t, 'sandbox.create.header.title', 'Create Sandbox')}\n </h1>\n </div>\n </div>\n <PagePurpose className=\"mt-3\">\n {tWithFallback(\n t,\n 'sandbox.create.purpose',\n 'Define a fresh, throwaway environment: pick a base image (or a template), set how much CPU/memory it gets, choose storage and a time-to-live, then launch. Use it to test a build, demo an AI agent, or reproduce an issue — it tears itself down when the TTL runs out.'\n )}\n </PagePurpose>\n </EmphasisPanel>\n\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n {/* Basic Info */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Info size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.basicInfo.title', 'Basic Information')}\n </h2>\n\n {/* Name */}\n <div>\n <label htmlFor=\"name\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.name.label', 'Name')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n aria-label=\"Name\"\n type=\"text\"\n id=\"name\"\n value={formData.name}\n onChange={(e) => handleInputChange('name', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.name\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder={tWithFallback(\n t,\n 'sandbox.create.fields.name.placeholder',\n 'My Sandbox'\n )}\n />\n {errors.name && (\n <p className=\"text-sm text-status-error-text mt-1 flex items-center gap-1\">\n <AlertCircle size={14} />\n {errors.name}\n </p>\n )}\n </div>\n\n {/* Description */}\n <div>\n <label htmlFor=\"description\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.description.label', 'Description')}\n </label>\n <textarea\n aria-label=\"Description\"\n id=\"description\"\n value={formData.description}\n onChange={(e) => handleInputChange('description', e.target.value)}\n rows={3}\n className=\"w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder={tWithFallback(\n t,\n 'sandbox.create.fields.description.placeholder',\n 'What is this sandbox for?'\n )}\n />\n </div>\n\n {/* Template Type */}\n <div>\n <label className=\"block text-sm font-semibold mb-3\">\n {tWithFallback(t, 'sandbox.create.fields.template.label', 'Template')}\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n {templateOptions.map((option) => {\n const Icon = option.icon;\n const isSelected = formData.template === option.value;\n return (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => {\n if (option.value === 'MISC_SHELL') {\n setFormData((prev) => ({\n ...prev,\n template: 'MISC_SHELL',\n containers: [\n {\n _rowId: nextRowId(),\n name: 'main',\n image: DEFAULT_SANDBOX_IMAGE_PATH,\n ports: [\n { _rowId: nextRowId(), containerPort: 80, name: 'nginx' },\n { _rowId: nextRowId(), containerPort: 3005, name: 'agent' },\n ],\n env: [],\n requestsCpu: '250m',\n requestsMemory: '512Mi',\n limitsCpu: '2',\n limitsMemory: '2Gi',\n _registryType: 'burdenoff',\n },\n ],\n }));\n } else {\n setFormData((prev) => ({\n ...prev,\n template: 'CUSTOM',\n containers: [{ ...buildEmptyContainer(), name: 'main', image: '' }],\n }));\n }\n }}\n className={`p-4 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <Icon\n size={24}\n className={isSelected ? 'text-primary' : 'text-text-secondary'}\n />\n <p className=\"font-medium mt-2\">\n {tWithFallback(t, option.labelKey, option.labelFallback)}\n </p>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tWithFallback(t, option.descriptionKey, option.descriptionFallback)}\n </p>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Execution Mode */}\n <div>\n <label className=\"block text-sm font-semibold mb-3\">\n {tWithFallback(t, 'sandbox.create.fields.executionMode.label', 'Execution Mode')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.fields.executionMode.help',\n 'Deployment keeps your sandbox running continuously and restarts on failure. Job runs to completion and exits when done.'\n )}\n />\n </label>\n <div className=\"grid grid-cols-2 gap-3\">\n {[\n {\n value: 'DEPLOYMENT' as const,\n labelKey: 'sandbox.create.fields.executionMode.deployment.label',\n labelFallback: 'Deployment',\n descKey: 'sandbox.create.fields.executionMode.deployment.description',\n descFallback: 'Long-running container (restarts on failure)',\n },\n {\n value: 'JOB' as const,\n labelKey: 'sandbox.create.fields.executionMode.job.label',\n labelFallback: 'Job',\n descKey: 'sandbox.create.fields.executionMode.job.description',\n descFallback: 'Run-to-completion task (exits when done)',\n },\n ].map((option) => {\n const isSelected = formData.mode === option.value;\n return (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => handleInputChange('mode', option.value)}\n className={`p-3 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <p className=\"font-medium text-sm\">\n {tWithFallback(t, option.labelKey, option.labelFallback)}\n </p>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tWithFallback(t, option.descKey, option.descFallback)}\n </p>\n </button>\n );\n })}\n </div>\n </div>\n </CardContent>\n </Card>\n\n {/* Template Selection */}\n {filteredTemplates.length > 0 && (\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-4\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Box size={18} className=\"text-primary\" />\n {tWithFallback(\n t,\n 'sandbox.create.sections.quickStartTemplates.title',\n 'Quick Start Templates'\n )}\n </h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {filteredTemplates.map((template) => {\n const isSelected = formData.templateId === template.id;\n return (\n <button\n key={template.id}\n type=\"button\"\n onClick={() => handleTemplateSelect(template)}\n className={`p-4 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <div className=\"flex items-center gap-2 mb-2\">\n <span className=\"font-medium text-sm\">{template.name}</span>\n {template.isDefault && (\n <Badge variant=\"secondary\" className=\"text-xs\">\n {tWithFallback(\n t,\n 'sandbox.create.sections.quickStartTemplates.defaultBadge',\n 'Default'\n )}\n </Badge>\n )}\n </div>\n {template.description && (\n <p className=\"text-xs text-text-secondary mb-2\">{template.description}</p>\n )}\n <div className=\"flex items-center gap-2 text-xs text-text-secondary\">\n <span>{template.resources?.cpuRequest ?? '?'} CPU</span>\n <span className=\"text-text-secondary/40\">|</span>\n <span>{template.resources?.memoryRequest ?? '?'} mem</span>\n <span className=\"text-text-secondary/40\">|</span>\n <span>{template.containers?.length ?? 0} containers</span>\n <span className=\"text-text-secondary/40\">|</span>\n <span>{formatTTL(template.ttlSeconds)}</span>\n </div>\n </button>\n );\n })}\n </div>\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.create.sections.quickStartTemplates.hint',\n 'Select a template or customize resources below'\n )}\n </p>\n </CardContent>\n </Card>\n )}\n\n {/* Containers */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Container size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.containers.title', 'Containers')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.containers.help',\n 'A container is the application that runs inside your sandbox. The default sandbox image includes VibeControls agent, Bun, nginx, and common dev tools pre-installed.'\n )}\n />\n <Badge variant=\"secondary\">{formData.containers.length}</Badge>\n </h2>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={addContainer}>\n <Plus size={14} />\n {tWithFallback(\n t,\n 'sandbox.create.sections.containers.addContainer',\n 'Add Container'\n )}\n </Button>\n </div>\n {errors.containers && (\n <p className=\"text-sm text-status-error-text flex items-center gap-1\">\n <AlertCircle size={14} />\n {errors.containers}\n </p>\n )}\n\n <div className=\"space-y-4\">\n {formData.containers.map((container, cIdx) => (\n <div\n key={container._rowId}\n className=\"p-4 rounded-lg border-2 border-border-subtle/50 bg-bg-sunken/20 space-y-4\"\n >\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-semibold text-sm\">\n {tWithFallback(t, 'sandbox.create.container.heading', 'Container #{number}', {\n number: cIdx + 1,\n })}\n {container.name && `: ${container.name}`}\n </h3>\n {formData.containers.length > 1 && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"text-status-error-text hover:text-status-error-text size-7\"\n onClick={() => removeContainer(cIdx)}\n >\n <Trash2 size={14} />\n </Button>\n )}\n </div>\n\n {/* Container Name */}\n <div>\n <label className=\"block text-xs font-semibold mb-1\">\n {tWithFallback(t, 'sandbox.create.container.fields.name.label', 'Name')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n aria-label=\"Name\"\n type=\"text\"\n value={container.name}\n onChange={(e) => updateContainer(cIdx, 'name', e.target.value)}\n className={`w-full px-3 py-2 border-2 rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors[`container_${cIdx}_name`]\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder={tWithFallback(\n t,\n 'sandbox.create.container.fields.name.placeholder',\n 'main'\n )}\n />\n {errors[`container_${cIdx}_name`] && (\n <p className=\"text-xs text-status-error-text mt-1\">\n {errors[`container_${cIdx}_name`]}\n </p>\n )}\n </div>\n\n {/* Image Registry Selector */}\n <div>\n <label className=\"block text-xs font-semibold mb-1\">\n {tWithFallback(t, 'sandbox.create.container.fields.image.label', 'Image')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <div className=\"flex gap-2 mb-2\">\n <button\n type=\"button\"\n onClick={() => updateContainer(cIdx, '_registryType', 'burdenoff')}\n className={`flex-1 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${\n (container._registryType || 'burdenoff') === 'burdenoff'\n ? 'border-primary bg-action-primary-bg/10 text-primary'\n : 'border-border-default text-text-secondary hover:bg-bg-sunken'\n }`}\n >\n {tWithFallback(\n t,\n 'sandbox.create.container.fields.image.registryBurdenoff',\n 'Burdenoff Repositories'\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => updateContainer(cIdx, '_registryType', 'custom')}\n className={`flex-1 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${\n container._registryType === 'custom'\n ? 'border-primary bg-action-primary-bg/10 text-primary'\n : 'border-border-default text-text-secondary hover:bg-bg-sunken'\n }`}\n >\n {tWithFallback(\n t,\n 'sandbox.create.container.fields.image.registryCustom',\n 'Custom (Docker Hub)'\n )}\n </button>\n </div>\n {(container._registryType || 'burdenoff') === 'burdenoff' ? (\n <div className=\"flex items-center\">\n <span className=\"px-3 py-2 border-2 border-r-0 rounded-l-lg bg-bg-sunken text-xs text-text-secondary font-mono whitespace-nowrap\">\n burdenoffregistry.azurecr.io/\n </span>\n <input\n aria-label=\"input\"\n type=\"text\"\n value={stripBurdenoffRegistry(container.image)}\n onChange={(e) => updateContainer(cIdx, 'image', e.target.value)}\n className={`w-full px-3 py-2 border-2 rounded-r-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors[`container_${cIdx}_image`]\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder={DEFAULT_SANDBOX_IMAGE_PATH}\n />\n </div>\n ) : (\n <input\n aria-label=\"input\"\n type=\"text\"\n value={container.image}\n onChange={(e) => updateContainer(cIdx, 'image', e.target.value)}\n className={`w-full px-3 py-2 border-2 rounded-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors[`container_${cIdx}_image`]\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"nginx:alpine\"\n />\n )}\n {errors[`container_${cIdx}_image`] && (\n <p className=\"text-xs text-status-error-text mt-1\">\n {errors[`container_${cIdx}_image`]}\n </p>\n )}\n </div>\n\n {/* Per-container resources (optional) */}\n <div>\n <p className=\"text-xs font-semibold mb-2 text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.create.container.resources.title',\n 'Per-Container Resources (optional)'\n )}\n </p>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.cpuReq', 'CPU Req')}\n </label>\n <input\n aria-label=\"CPU Req\"\n type=\"text\"\n value={container.requestsCpu}\n onChange={(e) => updateContainer(cIdx, 'requestsCpu', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"250m\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.cpuLim', 'CPU Lim')}\n </label>\n <input\n aria-label=\"CPU Lim\"\n type=\"text\"\n value={container.limitsCpu}\n onChange={(e) => updateContainer(cIdx, 'limitsCpu', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"1\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.memReq', 'Mem Req')}\n </label>\n <input\n aria-label=\"Mem Req\"\n type=\"text\"\n value={container.requestsMemory}\n onChange={(e) => updateContainer(cIdx, 'requestsMemory', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"512Mi\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.memLim', 'Mem Lim')}\n </label>\n <input\n aria-label=\"Mem Lim\"\n type=\"text\"\n value={container.limitsMemory}\n onChange={(e) => updateContainer(cIdx, 'limitsMemory', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"2Gi\"\n />\n </div>\n </div>\n </div>\n\n {/* Ports */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <p className=\"text-xs font-semibold text-text-secondary\">\n {tWithFallback(t, 'sandbox.create.container.ports.title', 'Ports')}\n </p>\n <button\n type=\"button\"\n onClick={() => addPort(cIdx)}\n className=\"text-xs text-primary hover:underline\"\n >\n {tWithFallback(t, 'sandbox.create.container.ports.add', '+ Add Port')}\n </button>\n </div>\n {container.ports.map((port, pIdx) => (\n <div key={port._rowId} className=\"flex items-center gap-2 mb-2\">\n <input\n aria-label=\"input\"\n type=\"number\"\n value={port.containerPort}\n onChange={(e) => {\n const newPorts = [...container.ports];\n newPorts[pIdx] = {\n ...newPorts[pIdx],\n containerPort: Number(e.target.value),\n };\n updateContainer(cIdx, 'ports', newPorts);\n }}\n className=\"w-24 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"8080\"\n />\n <input\n aria-label=\"input\"\n type=\"text\"\n value={port.name}\n onChange={(e) => {\n const newPorts = [...container.ports];\n newPorts[pIdx] = { ...newPorts[pIdx], name: e.target.value };\n updateContainer(cIdx, 'ports', newPorts);\n }}\n className=\"flex-1 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder={tWithFallback(\n t,\n 'sandbox.create.container.ports.namePlaceholder',\n 'Port name (optional)'\n )}\n />\n <button\n type=\"button\"\n onClick={() => removePort(cIdx, pIdx)}\n className=\"p-1.5 text-status-error-text hover:bg-status-error-bg/10 rounded\"\n >\n <X size={12} />\n </button>\n </div>\n ))}\n </div>\n\n {/* Env Vars */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <p className=\"text-xs font-semibold text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.create.container.envVars.title',\n 'Environment Variables'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => addEnvVar(cIdx)}\n className=\"text-xs text-primary hover:underline\"\n >\n {tWithFallback(t, 'sandbox.create.container.envVars.add', '+ Add Variable')}\n </button>\n </div>\n {container.env.map((envVar, eIdx) => (\n <div\n key={`${container._rowId}-env-${eIdx}-${envVar.name}`}\n className=\"flex items-center gap-2 mb-2\"\n >\n <input\n aria-label=\"input\"\n type=\"text\"\n value={envVar.name}\n onChange={(e) => {\n const newEnv = [...container.env];\n newEnv[eIdx] = { ...newEnv[eIdx], name: e.target.value };\n updateContainer(cIdx, 'env', newEnv);\n }}\n className=\"w-1/3 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"KEY\"\n />\n <input\n aria-label=\"input\"\n type=\"text\"\n value={envVar.value}\n onChange={(e) => {\n const newEnv = [...container.env];\n newEnv[eIdx] = { ...newEnv[eIdx], value: e.target.value };\n updateContainer(cIdx, 'env', newEnv);\n }}\n className=\"flex-1 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"value\"\n />\n <button\n type=\"button\"\n onClick={() => removeEnvVar(cIdx, eIdx)}\n className=\"p-1.5 text-status-error-text hover:bg-status-error-bg/10 rounded\"\n >\n <X size={12} />\n </button>\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n\n {/* Resources */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Cpu size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.podResources.title', 'Pod Resources')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.podResources.help',\n 'Resources allocated to the entire sandbox. CPU is in millicores (1000m = 1 CPU core). Memory in MiB or GiB.'\n )}\n />\n </h2>\n\n <OptionalFields\n title={tWithFallback(\n t,\n 'sandbox.create.sections.podResources.advancedTitle',\n 'Advanced resource limits'\n )}\n description={tWithFallback(\n t,\n 'sandbox.create.sections.podResources.advancedDescription',\n 'CPU and memory requests/limits. Defaults work for most sandboxes.'\n )}\n >\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-5\">\n {/* CPU Request */}\n <div>\n <label\n htmlFor=\"cpuRequest\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <Cpu size={14} className=\"text-status-info-text\" />\n {tWithFallback(t, 'sandbox.create.fields.cpuRequest.label', 'CPU Request')}\n </label>\n <input\n aria-label=\"CPU Request\"\n type=\"text\"\n id=\"cpuRequest\"\n value={formData.cpuRequest}\n onChange={(e) => handleInputChange('cpuRequest', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.cpuRequest\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"500m\"\n />\n {errors.cpuRequest && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.cpuRequest}</p>\n )}\n </div>\n\n {/* CPU Limit */}\n <div>\n <label\n htmlFor=\"cpuLimit\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <Cpu size={14} className=\"text-status-info-text\" />\n {tWithFallback(t, 'sandbox.create.fields.cpuLimit.label', 'CPU Limit')}\n </label>\n <input\n aria-label=\"CPU Limit\"\n type=\"text\"\n id=\"cpuLimit\"\n value={formData.cpuLimit}\n onChange={(e) => handleInputChange('cpuLimit', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.cpuLimit\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"2\"\n />\n {errors.cpuLimit && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.cpuLimit}</p>\n )}\n </div>\n\n {/* Memory Request */}\n <div>\n <label\n htmlFor=\"memoryRequest\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <MemoryStick size={14} className=\"text-accent-purple-subtle\" />\n {tWithFallback(\n t,\n 'sandbox.create.fields.memoryRequest.label',\n 'Memory Request'\n )}\n </label>\n <input\n aria-label=\"Memory Request\"\n type=\"text\"\n id=\"memoryRequest\"\n value={formData.memoryRequest}\n onChange={(e) => handleInputChange('memoryRequest', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.memoryRequest\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"1Gi\"\n />\n {errors.memoryRequest && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.memoryRequest}</p>\n )}\n </div>\n\n {/* Memory Limit */}\n <div>\n <label\n htmlFor=\"memoryLimit\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <MemoryStick size={14} className=\"text-accent-purple-subtle\" />\n {tWithFallback(t, 'sandbox.create.fields.memoryLimit.label', 'Memory Limit')}\n </label>\n <input\n aria-label=\"Memory Limit\"\n type=\"text\"\n id=\"memoryLimit\"\n value={formData.memoryLimit}\n onChange={(e) => handleInputChange('memoryLimit', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.memoryLimit\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"4Gi\"\n />\n {errors.memoryLimit && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.memoryLimit}</p>\n )}\n </div>\n </div>\n </OptionalFields>\n\n {/* TTL */}\n <div>\n <label\n htmlFor=\"ttlSeconds\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <Timer size={14} className=\"text-status-info-text\" />\n {tWithFallback(t, 'sandbox.create.fields.ttl.label', 'Time to Live')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.fields.ttl.help',\n \"Your sandbox will be automatically destroyed after this duration to save resources. You can extend it while it's running.\"\n )}\n />\n <Badge variant=\"outline\" className=\"text-xs ml-auto\">\n {formatTTL(formData.ttlSeconds)}\n </Badge>\n </label>\n <input\n aria-label=\"Time to Live\"\n type=\"range\"\n id=\"ttlSeconds\"\n min={600}\n max={86400}\n step={600}\n value={formData.ttlSeconds}\n onChange={(e) => handleInputChange('ttlSeconds', Number(e.target.value))}\n className=\"w-full mt-2 accent-primary\"\n />\n <div className=\"flex justify-between text-xs text-text-secondary mt-1\">\n <span>10m</span>\n <span>4h</span>\n <span>12h</span>\n <span>24h</span>\n </div>\n {errors.ttlSeconds && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.ttlSeconds}</p>\n )}\n </div>\n\n <div>\n <label className=\"text-sm font-semibold mb-2 flex items-center gap-2\">\n {tWithFallback(t, 'sandbox.create.fields.tags.label', 'Tags')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.fields.tags.help',\n 'Free-form labels. Use them to filter the sandbox list. Max 32 tags, 64 chars each.'\n )}\n />\n </label>\n <TagsInput value={tags} onChange={setTags} />\n </div>\n </CardContent>\n </Card>\n\n {/* Storage */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Database size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.storage.title', 'Storage')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.storage.help',\n 'Ephemeral storage is fast but lost when the sandbox stops. Persistent storage survives restarts.'\n )}\n />\n </h2>\n\n {/* Storage Mode */}\n <div>\n <label className=\"block text-sm font-semibold mb-3\">\n {tWithFallback(t, 'sandbox.create.fields.storageMode.label', 'Mode')}\n </label>\n <div className=\"grid grid-cols-3 gap-3\">\n {(['NONE', 'EPHEMERAL', 'PERSISTENT'] as StorageMode[]).map((mode) => {\n const isSelected = formData.storageMode === mode;\n const labels: Record<StorageMode, string> = {\n NONE: tWithFallback(t, 'sandbox.create.fields.storageMode.none.label', 'None'),\n EPHEMERAL: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.ephemeral.label',\n 'Ephemeral'\n ),\n PERSISTENT: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.persistent.label',\n 'Persistent'\n ),\n };\n const descriptions: Record<StorageMode, string> = {\n NONE: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.none.description',\n 'No persistent storage'\n ),\n EPHEMERAL: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.ephemeral.description',\n 'Lost when sandbox stops'\n ),\n PERSISTENT: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.persistent.description',\n 'Retained across restarts'\n ),\n };\n return (\n <button\n key={mode}\n type=\"button\"\n onClick={() => handleInputChange('storageMode', mode)}\n className={`p-3 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <p className=\"font-medium text-sm\">{labels[mode]}</p>\n <p className=\"text-xs text-text-secondary mt-0.5\">{descriptions[mode]}</p>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Storage details when not NONE */}\n {formData.storageMode !== 'NONE' && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-5\">\n <div>\n <label htmlFor=\"storageSizeGi\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.storageSizeGi.label', 'Size (GiB)')}\n </label>\n <input\n aria-label=\"Size (GiB)\"\n type=\"number\"\n id=\"storageSizeGi\"\n value={formData.storageSizeGi}\n onChange={(e) => handleInputChange('storageSizeGi', Number(e.target.value))}\n min={1}\n max={200}\n className=\"w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n />\n </div>\n <div>\n <label htmlFor=\"storageMountPath\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.storageMountPath.label', 'Mount Path')}\n </label>\n <input\n aria-label=\"Mount Path\"\n type=\"text\"\n id=\"storageMountPath\"\n value={formData.storageMountPath}\n onChange={(e) => handleInputChange('storageMountPath', e.target.value)}\n className=\"w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder=\"/data\"\n />\n </div>\n {formData.storageMode === 'PERSISTENT' && (\n <div className=\"flex items-center gap-3 sm:col-span-2\">\n <input\n aria-label=\"input\"\n type=\"checkbox\"\n id=\"storageRetainOnDelete\"\n checked={formData.storageRetainOnDelete}\n onChange={(e) => handleInputChange('storageRetainOnDelete', e.target.checked)}\n className=\"size-4 rounded border-border-subtle text-primary focus:ring-primary/20\"\n />\n <label htmlFor=\"storageRetainOnDelete\" className=\"text-sm font-medium\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.storageRetainOnDelete.label',\n 'Retain volume data when sandbox is deleted'\n )}\n </label>\n </div>\n )}\n <div className=\"sm:col-span-2\">\n <FilesFolderPicker\n value={formData.filesFolderId}\n onChange={(folderId) => handleInputChange('filesFolderId', folderId)}\n />\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n\n {/* Advanced: Gateway URLs */}\n {formData.template === 'MISC_SHELL' && (\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-5\">\n <details>\n <summary className=\"cursor-pointer text-sm font-semibold text-text-secondary flex items-center gap-2\">\n <Settings size={14} />\n {tWithFallback(\n t,\n 'sandbox.create.sections.advancedSettings.title',\n 'Advanced Settings'\n )}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.advancedSettings.help',\n 'Override the gateway URLs the sandbox agent uses for authentication and API calls. Useful when exposing local gateways via tunnel for development.'\n )}\n />\n </summary>\n <div className=\"mt-4 space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.globalGatewayUrl.label',\n 'Global Gateway URL'\n )}\n </label>\n <input\n aria-label=\"Global Gateway URL\"\n type=\"text\"\n value={formData.globalGatewayUrl}\n onChange={(e) => handleInputChange('globalGatewayUrl', e.target.value)}\n placeholder={DEFAULT_GLOBAL_GATEWAY_URL}\n className=\"w-full rounded-lg border border-border-subtle px-3 py-2 text-sm font-mono bg-bg-surface focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary\"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.globalGatewayUrl.hint',\n 'The agent authenticates via this URL. Override with a tunnel URL to reach local gateways.'\n )}\n </p>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.workspaceGatewayUrl.label',\n 'Workspace Gateway URL'\n )}\n </label>\n <input\n aria-label=\"Workspace Gateway URL\"\n type=\"text\"\n value={formData.workspaceGatewayUrl}\n onChange={(e) => handleInputChange('workspaceGatewayUrl', e.target.value)}\n placeholder={DEFAULT_WSPACE_GATEWAY_URL}\n className=\"w-full rounded-lg border border-border-subtle px-3 py-2 text-sm font-mono bg-bg-surface focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary\"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.workspaceGatewayUrl.hint',\n 'The agent reports to this URL. Override with a tunnel URL to reach local gateways.'\n )}\n </p>\n </div>\n </div>\n </details>\n </CardContent>\n </Card>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-col sm:flex-row gap-3 pt-2\">\n <Button type=\"submit\" disabled={submitting} size=\"lg\">\n {submitting ? <Loader2 size={18} className=\"animate-spin\" /> : <Save size={18} />}\n {tWithFallback(t, 'sandbox.create.actions.submit', 'Create Sandbox')}\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => navigate?.(basePath)}\n disabled={submitting}\n >\n {tWithFallback(t, 'sandbox.create.actions.cancel', 'Cancel')}\n </Button>\n </div>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6DA,IAAI,IAAgB;AACpB,SAAS,IAAoB;AAE3B,QADA,KAAiB,GACV,OAAO,EAAc,GAAG,KAAK,KAAK;;AAwB3C,IAAM,KAOA,CACJ;CACE,OAAO;CACP,UAAU;CACV,eAAe;CACf,gBAAgB;CAChB,qBACE;CACF,MAAM;CACP,EACD;CACE,OAAO;CACP,UAAU;CACV,eAAe;CACf,gBAAgB;CAChB,qBAAqB;CACrB,MAAM;C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AAD,EAAA,UAAA;SACE,kBAAC,SAAD;UAAO,WAAU;oBACd,EACC,GACA,mDACA,wBACD;UACK,CAAA;SACR,kBAAC,SAAD;UACE,cAAW;UACX,MAAK;UACL,OAAO,EAAS;UAChB,WAAW,MAAM,EAAkB,uBAAuB,EAAE,OAAO,MAAM;UACzE,aAAa;UACb,WAAU;UACV,CAAA;SACF,kBAAC,KAAD;UAAG,WAAU;oBACV,EACC,GACA,kDACA,qFACD;UACC,CAAA;SACA,EAAA,CAAA,CACF;UACE,EAAA,CAAA;OACE,CAAA;MACT,CAAA;KAIT,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,GAAD;OAAQ,MAAK;OAAS,UAAU;OAAY,MAAK;iBAAjD,CACG,IAAa,kBAAC,GAAD;QAAS,MAAM;QAAI,WAAU;QAAiB,CAAA,GAAG,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EAChF,EAAc,GAAG,iCAAiC,iBAAiB,CAC7D;UACT,kBAAC,GAAD;OACE,MAAK;OACL,SAAQ;OACR,eAAe,IAAW,EAAS;OACnC,UAAU;iBAET,EAAc,GAAG,iCAAiC,SAAS;OACrD,CAAA,CACL;;KACD;;GACI"}
|
|
1
|
+
{"version":3,"file":"SandboxCreatePage.js","names":[],"sources":["../../../src/sandbox/pages/SandboxCreatePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n ArrowLeft,\n Save,\n Loader2,\n AlertCircle,\n CheckCircle2,\n X,\n Box,\n Settings,\n Info,\n Cpu,\n MemoryStick,\n Timer,\n Plus,\n Trash2,\n Container,\n Database,\n HelpCircle,\n} from 'lucide-react';\nimport { Button, Card, CardContent, Badge, EmphasisPanel } from '../components/ui';\nimport { OptionalFields, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useSandbox } from '../providers/SandboxProvider';\nimport { PageLayout } from '../components/PageLayout';\nimport { TagsInput } from '../components/TagsInput';\nimport { FilesFolderPicker } from '../components/FilesFolderPicker';\nimport { useSandboxEvents } from '../utils/sandboxEvents';\nimport { tWithFallback } from '../utils/i18n';\nimport { stripBurdenoffRegistry, withBurdenoffRegistry } from '../utils/imageRegistry';\nimport {\n useListSandboxTemplatesQuery,\n useCreateSandboxMutation,\n} from '../../generated/wspace-operations';\nimport type {\n SandboxTemplateType,\n SandboxTemplate,\n SandboxMode,\n ContainerSpec,\n EnvVar,\n} from '../types';\n\ntype NotificationType = 'success' | 'error';\n\ntype StorageMode = 'NONE' | 'EPHEMERAL' | 'PERSISTENT';\n\ninterface ContainerFormData {\n /** Stable client-side row id, used as React `key` so add/remove/reorder\n * doesn't shift component state across siblings. Never sent to the API. */\n _rowId: string;\n name: string;\n image: string;\n ports: { _rowId: string; containerPort: number; name: string }[];\n env: EnvVar[];\n requestsCpu: string;\n requestsMemory: string;\n limitsCpu: string;\n limitsMemory: string;\n _registryType?: 'burdenoff' | 'custom';\n}\n\nlet _rowIdCounter = 0;\nfunction nextRowId(): string {\n _rowIdCounter += 1;\n return `row-${_rowIdCounter}-${Date.now()}`;\n}\n\ninterface FormData {\n name: string;\n description: string;\n template: SandboxTemplateType;\n mode: SandboxMode;\n cpuRequest: string;\n cpuLimit: string;\n memoryRequest: string;\n memoryLimit: string;\n ttlSeconds: number;\n templateId: string;\n containers: ContainerFormData[];\n storageMode: StorageMode;\n storageSizeGi: number;\n storageMountPath: string;\n storageRetainOnDelete: boolean;\n filesFolderId: string | null;\n globalGatewayUrl: string;\n workspaceGatewayUrl: string;\n}\n\nconst templateOptions: {\n value: SandboxTemplateType;\n labelKey: string;\n labelFallback: string;\n descriptionKey: string;\n descriptionFallback: string;\n icon: typeof Box;\n}[] = [\n {\n value: 'MISC_SHELL' as SandboxTemplateType,\n labelKey: 'sandbox.create.templateType.defaultSandbox.label',\n labelFallback: 'Default Sandbox',\n descriptionKey: 'sandbox.create.templateType.defaultSandbox.description',\n descriptionFallback:\n 'Pre-configured development environment with VibeControls agent, Bun, nginx, and common dev tools',\n icon: Box,\n },\n {\n value: 'CUSTOM' as SandboxTemplateType,\n labelKey: 'sandbox.create.templateType.customSandbox.label',\n labelFallback: 'Custom Sandbox',\n descriptionKey: 'sandbox.create.templateType.customSandbox.description',\n descriptionFallback: 'Configure your own container image and resources',\n icon: Settings,\n },\n];\n\nfunction buildEmptyContainer(): ContainerFormData {\n return {\n _rowId: nextRowId(),\n name: '',\n image: '',\n ports: [],\n env: [],\n requestsCpu: '',\n requestsMemory: '',\n limitsCpu: '',\n limitsMemory: '',\n };\n}\n\nfunction HelpTip({ text }: { text: string }) {\n const [open, setOpen] = useState(false);\n return (\n <span className=\"relative inline-block ml-1.5\">\n <button\n type=\"button\"\n onClick={() => setOpen(!open)}\n className=\"text-text-tertiary hover:text-text-secondary transition-colors\"\n >\n <HelpCircle size={14} />\n </button>\n {open && (\n <div className=\"absolute left-0 top-6 z-50 w-64 rounded-lg border border-border-default bg-bg-surface p-3 text-xs text-text-secondary shadow-lg\">\n {text}\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n aria-label=\"Close help tip\"\n className=\"absolute top-1 right-1 text-text-tertiary hover:text-text-secondary\"\n >\n <X size={12} />\n </button>\n </div>\n )}\n </span>\n );\n}\n\n/**\n * Create Sandbox Page\n * Form for creating a new sandbox with container and resource configuration\n */\n// Detect environment from hostname — alpha/local uses alpha image, production uses stable\nconst isAlphaEnv =\n typeof window !== 'undefined' &&\n (window.location.hostname.includes('alpha') ||\n window.location.hostname.endsWith('.local.burdenoff.com') ||\n window.location.hostname === 'localhost' ||\n window.location.hostname === '127.0.0.1');\n\n// FQDN required by sandbox-svc registry allowlist (burdenoffregistry.azurecr.io/*,\n// ghcr.io/algoshred/*, docker.io/library/*, …). Bare paths like\n// `sandbox/vibecontrols:alpha` are rejected at createSandbox.\nconst DEFAULT_SANDBOX_IMAGE = isAlphaEnv\n ? 'burdenoffregistry.azurecr.io/sandbox/vibecontrols-alpha:2026.401.5-alpha'\n : 'burdenoffregistry.azurecr.io/sandbox/vibecontrols:2026.401.4-alpha';\n\n// In \"Burdenoff repositories\" mode `container.image` holds only the\n// path-after-registry; submit re-adds the registry. The default/placeholder\n// must therefore be stripped, or the fixed prefix span shows (and stores) it\n// twice. See ./utils/imageRegistry for the round-trip helpers.\nconst DEFAULT_SANDBOX_IMAGE_PATH = stripBurdenoffRegistry(DEFAULT_SANDBOX_IMAGE);\n\nconst DEFAULT_GLOBAL_GATEWAY_URL = isAlphaEnv\n ? 'https://alphagraphql.burdenoff.com/global/graphql'\n : 'https://graphql.burdenoff.com/global/graphql';\n\nconst DEFAULT_WSPACE_GATEWAY_URL = isAlphaEnv\n ? 'https://alphagraphqlworkspaces.burdenoff.com/workspaces/graphql'\n : 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql';\n\nexport function SandboxCreatePage() {\n const { basePath = '/', navigate, workspaceId } = useSandbox();\n const sandboxEvents = useSandboxEvents();\n const { t } = useI18n();\n const [tags, setTags] = useState<string[]>([]);\n\n const [formData, setFormData] = useState<FormData>({\n name: '',\n description: '',\n template: 'MISC_SHELL',\n mode: 'DEPLOYMENT',\n cpuRequest: '250m',\n cpuLimit: '2',\n memoryRequest: '512Mi',\n memoryLimit: '2Gi',\n ttlSeconds: 10800,\n templateId: '',\n containers: [\n {\n _rowId: nextRowId(),\n name: 'main',\n image: DEFAULT_SANDBOX_IMAGE_PATH,\n ports: [\n { _rowId: nextRowId(), containerPort: 80, name: 'nginx' },\n { _rowId: nextRowId(), containerPort: 3005, name: 'agent' },\n ],\n env: [],\n requestsCpu: '250m',\n requestsMemory: '512Mi',\n limitsCpu: '2',\n limitsMemory: '2Gi',\n _registryType: 'burdenoff' as const,\n },\n ],\n storageMode: 'NONE',\n storageSizeGi: 10,\n storageMountPath: '/data',\n storageRetainOnDelete: false,\n filesFolderId: null,\n globalGatewayUrl: DEFAULT_GLOBAL_GATEWAY_URL,\n workspaceGatewayUrl: DEFAULT_WSPACE_GATEWAY_URL,\n });\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n const [notification, setNotification] = useState<{\n type: NotificationType;\n message: string;\n } | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const { data: templatesData } = useListSandboxTemplatesQuery({\n variables: { context: { workspaceId }, template: formData.template as any },\n skip: !workspaceId,\n });\n const [createSandbox] = useCreateSandboxMutation();\n const filteredTemplates = (templatesData?.listSandboxTemplates?.items ?? []) as any[];\n\n const showNotification = (type: NotificationType, message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n const handleTemplateSelect = (template: SandboxTemplate) => {\n setFormData((prev) => ({\n ...prev,\n templateId: template.id,\n cpuRequest: template.resources?.cpuRequest ?? prev.cpuRequest,\n cpuLimit: template.resources?.cpuLimit ?? prev.cpuLimit,\n memoryRequest: template.resources?.memoryRequest ?? prev.memoryRequest,\n memoryLimit: template.resources?.memoryLimit ?? prev.memoryLimit,\n ttlSeconds: template.ttlSeconds,\n template: template.template,\n containers:\n template.containers && template.containers.length > 0\n ? template.containers.map((c) => ({\n _rowId: nextRowId(),\n name: c.name,\n image: c.image,\n ports:\n c.ports?.map((p) => ({\n _rowId: nextRowId(),\n containerPort: p.containerPort,\n name: p.name ?? '',\n })) ?? [],\n env: c.env ?? [],\n requestsCpu: c.resources?.requestsCpu ?? '',\n requestsMemory: c.resources?.requestsMemory ?? '',\n limitsCpu: c.resources?.limitsCpu ?? '',\n limitsMemory: c.resources?.limitsMemory ?? '',\n }))\n : prev.containers,\n storageMode: template.storage?.mode ?? prev.storageMode,\n storageSizeGi: template.storage?.sizeGi ?? prev.storageSizeGi,\n storageMountPath: template.storage?.mountPath ?? prev.storageMountPath,\n storageRetainOnDelete: template.storage?.retainOnDelete ?? prev.storageRetainOnDelete,\n }));\n };\n\n const handleInputChange = (field: keyof FormData, value: string | number | boolean | null) => {\n setFormData((prev) => ({ ...prev, [field]: value }));\n if (field === 'templateId') return;\n // Clear template selection when customizing\n if (\n ['cpuRequest', 'cpuLimit', 'memoryRequest', 'memoryLimit', 'ttlSeconds'].includes(\n field as string\n )\n ) {\n setFormData((prev) => ({ ...prev, templateId: '' }));\n }\n if (errors[field as string]) {\n setErrors((prev) => {\n const next = { ...prev };\n delete next[field as string];\n return next;\n });\n }\n };\n\n // Container management\n const addContainer = () => {\n setFormData((prev) => ({\n ...prev,\n containers: [...prev.containers, buildEmptyContainer()],\n templateId: '',\n }));\n };\n\n const removeContainer = (index: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.filter((_, i) => i !== index),\n templateId: '',\n }));\n };\n\n const updateContainer = (index: number, field: keyof ContainerFormData, value: any) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) => (i === index ? { ...c, [field]: value } : c)),\n templateId: '',\n }));\n };\n\n const addPort = (containerIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex\n ? { ...c, ports: [...c.ports, { _rowId: nextRowId(), containerPort: 8080, name: '' }] }\n : c\n ),\n }));\n };\n\n const removePort = (containerIndex: number, portIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex ? { ...c, ports: c.ports.filter((_, pi) => pi !== portIndex) } : c\n ),\n }));\n };\n\n const addEnvVar = (containerIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex ? { ...c, env: [...c.env, { name: '', value: '' }] } : c\n ),\n }));\n };\n\n const removeEnvVar = (containerIndex: number, envIndex: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) =>\n i === containerIndex ? { ...c, env: c.env.filter((_, ei) => ei !== envIndex) } : c\n ),\n }));\n };\n\n const validateForm = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!formData.name.trim())\n newErrors.name = tWithFallback(t, 'sandbox.create.errors.nameRequired', 'Name is required');\n if (!formData.cpuRequest.trim())\n newErrors.cpuRequest = tWithFallback(\n t,\n 'sandbox.create.errors.cpuRequestRequired',\n 'CPU request is required'\n );\n if (!formData.cpuLimit.trim())\n newErrors.cpuLimit = tWithFallback(\n t,\n 'sandbox.create.errors.cpuLimitRequired',\n 'CPU limit is required'\n );\n if (!formData.memoryRequest.trim())\n newErrors.memoryRequest = tWithFallback(\n t,\n 'sandbox.create.errors.memoryRequestRequired',\n 'Memory request is required'\n );\n if (!formData.memoryLimit.trim())\n newErrors.memoryLimit = tWithFallback(\n t,\n 'sandbox.create.errors.memoryLimitRequired',\n 'Memory limit is required'\n );\n if (formData.ttlSeconds < 600 || formData.ttlSeconds > 86400)\n newErrors.ttlSeconds = tWithFallback(\n t,\n 'sandbox.create.errors.ttlRange',\n 'TTL must be 10m-24h'\n );\n if (formData.containers.length === 0)\n newErrors.containers = tWithFallback(\n t,\n 'sandbox.create.errors.containersRequired',\n 'At least one container is required'\n );\n formData.containers.forEach((c, i) => {\n if (!c.name.trim())\n newErrors[`container_${i}_name`] = tWithFallback(\n t,\n 'sandbox.create.errors.containerNameRequired',\n 'Container name is required'\n );\n if (!c.image.trim())\n newErrors[`container_${i}_image`] = tWithFallback(\n t,\n 'sandbox.create.errors.containerImageRequired',\n 'Container image is required'\n );\n });\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!validateForm()) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.create.notifications.fixErrors', 'Please fix the form errors')\n );\n return;\n }\n setSubmitting(true);\n try {\n const containers = formData.containers.map((c) => {\n const fullImage =\n (c._registryType || 'burdenoff') === 'burdenoff'\n ? withBurdenoffRegistry(c.image)\n : c.image;\n return {\n name: c.name,\n image: fullImage,\n ports:\n c.ports.length > 0\n ? c.ports.map((p) => ({ containerPort: p.containerPort, name: p.name || undefined }))\n : undefined,\n env: c.env.length > 0 ? c.env.filter((e) => e.name.trim()) : undefined,\n resources:\n c.requestsCpu || c.requestsMemory || c.limitsCpu || c.limitsMemory\n ? {\n requestsCpu: c.requestsCpu || undefined,\n requestsMemory: c.requestsMemory || undefined,\n limitsCpu: c.limitsCpu || undefined,\n limitsMemory: c.limitsMemory || undefined,\n }\n : undefined,\n };\n });\n\n const result = await createSandbox({\n variables: {\n input: {\n context: { workspaceId },\n name: formData.name,\n description: formData.description || undefined,\n template: formData.template as any,\n mode: formData.mode as any,\n containers,\n resources: {\n cpuRequest: formData.cpuRequest,\n cpuLimit: formData.cpuLimit,\n memoryRequest: formData.memoryRequest,\n memoryLimit: formData.memoryLimit,\n },\n storage: {\n mode: formData.storageMode,\n sizeGi: formData.storageMode !== 'NONE' ? formData.storageSizeGi : undefined,\n mountPath: formData.storageMode !== 'NONE' ? formData.storageMountPath : undefined,\n retainOnDelete:\n formData.storageMode === 'PERSISTENT' ? formData.storageRetainOnDelete : false,\n filesFolderId:\n formData.storageMode !== 'NONE' && formData.filesFolderId\n ? formData.filesFolderId\n : undefined,\n },\n ttlSeconds: formData.ttlSeconds,\n metadata: {\n globalGatewayUrl: formData.globalGatewayUrl || undefined,\n workspaceGatewayUrl: formData.workspaceGatewayUrl || undefined,\n tags: tags.length ? tags : undefined,\n },\n },\n },\n });\n // MutateResult wrapper surfaces non-throwing GraphQL errors via `error`.\n // Without this guard, a failed mutation (e.g. registry-allowlist reject)\n // still fires the success toast and navigates.\n if (result.error) {\n showNotification(\n 'error',\n tWithFallback(\n t,\n 'sandbox.create.notifications.createFailed',\n 'Failed to create sandbox'\n ) + `: ${result.error.message}`\n );\n return;\n }\n const created = result.data?.createSandbox;\n if (!created) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.create.notifications.createFailed', 'Failed to create sandbox')\n );\n return;\n }\n sandboxEvents.sandboxCreated({\n sandboxId: created.id,\n kind: (created.kind?.toLowerCase?.() === 'internal' ? 'internal' : 'user') as\n 'user' | 'internal',\n source: created.source ?? 'manual',\n });\n showNotification(\n 'success',\n tWithFallback(\n t,\n 'sandbox.create.notifications.createSuccess',\n 'Sandbox created successfully! Provisioning...'\n )\n );\n const detailPath = `${basePath.replace(/\\/$/, '')}/${created.id}`;\n setTimeout(() => navigate?.(detailPath), 1500);\n } catch (err) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.create.notifications.createFailed', 'Failed to create sandbox')\n );\n } finally {\n setSubmitting(false);\n }\n };\n\n const formatTTL = (seconds: number): string => {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n if (hours > 0 && minutes > 0) return `${hours}h ${minutes}m`;\n if (hours > 0) return `${hours}h`;\n return `${minutes}m`;\n };\n\n return (\n <PageLayout showHeader={false}>\n {/* Notification */}\n {notification && (\n <div\n className={`fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200 ${\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n }`}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <AlertCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n <button\n type=\"button\"\n onClick={() => setNotification(null)}\n aria-label=\"Dismiss notification\"\n className=\"ml-2 p-1 rounded-md hover:bg-accent\"\n >\n <X size={16} />\n </button>\n </div>\n )}\n\n {/* Header — single emphasis zone for the page intent */}\n <EmphasisPanel className=\"overflow-hidden bg-hero-mesh\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"flex size-11 flex-shrink-0 items-center justify-center rounded-lg hover:bg-bg-sunken/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border\"\n aria-label={tWithFallback(\n t,\n 'sandbox.create.header.back.ariaLabel',\n 'Back to sandboxes'\n )}\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Box size={24} className=\"text-primary\" />\n </div>\n <h1 className=\"text-2xl sm:text-3xl font-bold\">\n {tWithFallback(t, 'sandbox.create.header.title', 'Create Sandbox')}\n </h1>\n </div>\n </div>\n <PagePurpose className=\"mt-3\">\n {tWithFallback(\n t,\n 'sandbox.create.purpose',\n 'Define a fresh, throwaway environment: pick a base image (or a template), set how much CPU/memory it gets, choose storage and a time-to-live, then launch. Use it to test a build, demo an AI agent, or reproduce an issue — it tears itself down when the TTL runs out.'\n )}\n </PagePurpose>\n </EmphasisPanel>\n\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n {/* Basic Info */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Info size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.basicInfo.title', 'Basic Information')}\n </h2>\n\n {/* Name */}\n <div>\n <label htmlFor=\"name\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.name.label', 'Name')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n aria-label=\"Name\"\n type=\"text\"\n id=\"name\"\n value={formData.name}\n onChange={(e) => handleInputChange('name', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.name\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder={tWithFallback(\n t,\n 'sandbox.create.fields.name.placeholder',\n 'My Sandbox'\n )}\n />\n {errors.name && (\n <p className=\"text-sm text-status-error-text mt-1 flex items-center gap-1\">\n <AlertCircle size={14} />\n {errors.name}\n </p>\n )}\n </div>\n\n {/* Description */}\n <div>\n <label htmlFor=\"description\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.description.label', 'Description')}\n </label>\n <textarea\n aria-label=\"Description\"\n id=\"description\"\n value={formData.description}\n onChange={(e) => handleInputChange('description', e.target.value)}\n rows={3}\n className=\"w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder={tWithFallback(\n t,\n 'sandbox.create.fields.description.placeholder',\n 'What is this sandbox for?'\n )}\n />\n </div>\n\n {/* Template Type */}\n <div>\n <label className=\"block text-sm font-semibold mb-3\">\n {tWithFallback(t, 'sandbox.create.fields.template.label', 'Template')}\n </label>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n {templateOptions.map((option) => {\n const Icon = option.icon;\n const isSelected = formData.template === option.value;\n return (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => {\n if (option.value === 'MISC_SHELL') {\n setFormData((prev) => ({\n ...prev,\n template: 'MISC_SHELL',\n containers: [\n {\n _rowId: nextRowId(),\n name: 'main',\n image: DEFAULT_SANDBOX_IMAGE_PATH,\n ports: [\n { _rowId: nextRowId(), containerPort: 80, name: 'nginx' },\n { _rowId: nextRowId(), containerPort: 3005, name: 'agent' },\n ],\n env: [],\n requestsCpu: '250m',\n requestsMemory: '512Mi',\n limitsCpu: '2',\n limitsMemory: '2Gi',\n _registryType: 'burdenoff',\n },\n ],\n }));\n } else {\n setFormData((prev) => ({\n ...prev,\n template: 'CUSTOM',\n containers: [{ ...buildEmptyContainer(), name: 'main', image: '' }],\n }));\n }\n }}\n className={`p-4 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <Icon\n size={24}\n className={isSelected ? 'text-primary' : 'text-text-secondary'}\n />\n <p className=\"font-medium mt-2\">\n {tWithFallback(t, option.labelKey, option.labelFallback)}\n </p>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tWithFallback(t, option.descriptionKey, option.descriptionFallback)}\n </p>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Execution Mode */}\n <div>\n <label className=\"block text-sm font-semibold mb-3\">\n {tWithFallback(t, 'sandbox.create.fields.executionMode.label', 'Execution Mode')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.fields.executionMode.help',\n 'Deployment keeps your sandbox running continuously and restarts on failure. Job runs to completion and exits when done.'\n )}\n />\n </label>\n <div className=\"grid grid-cols-2 gap-3\">\n {[\n {\n value: 'DEPLOYMENT' as const,\n labelKey: 'sandbox.create.fields.executionMode.deployment.label',\n labelFallback: 'Deployment',\n descKey: 'sandbox.create.fields.executionMode.deployment.description',\n descFallback: 'Long-running container (restarts on failure)',\n },\n {\n value: 'JOB' as const,\n labelKey: 'sandbox.create.fields.executionMode.job.label',\n labelFallback: 'Job',\n descKey: 'sandbox.create.fields.executionMode.job.description',\n descFallback: 'Run-to-completion task (exits when done)',\n },\n ].map((option) => {\n const isSelected = formData.mode === option.value;\n return (\n <button\n key={option.value}\n type=\"button\"\n onClick={() => handleInputChange('mode', option.value)}\n className={`p-3 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <p className=\"font-medium text-sm\">\n {tWithFallback(t, option.labelKey, option.labelFallback)}\n </p>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tWithFallback(t, option.descKey, option.descFallback)}\n </p>\n </button>\n );\n })}\n </div>\n </div>\n </CardContent>\n </Card>\n\n {/* Template Selection */}\n {filteredTemplates.length > 0 && (\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-4\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Box size={18} className=\"text-primary\" />\n {tWithFallback(\n t,\n 'sandbox.create.sections.quickStartTemplates.title',\n 'Quick Start Templates'\n )}\n </h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {filteredTemplates.map((template) => {\n const isSelected = formData.templateId === template.id;\n return (\n <button\n key={template.id}\n type=\"button\"\n onClick={() => handleTemplateSelect(template)}\n className={`p-4 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <div className=\"flex items-center gap-2 mb-2\">\n <span className=\"font-medium text-sm\">{template.name}</span>\n {template.isDefault && (\n <Badge variant=\"secondary\" className=\"text-xs\">\n {tWithFallback(\n t,\n 'sandbox.create.sections.quickStartTemplates.defaultBadge',\n 'Default'\n )}\n </Badge>\n )}\n </div>\n {template.description && (\n <p className=\"text-xs text-text-secondary mb-2\">{template.description}</p>\n )}\n <div className=\"flex items-center gap-2 text-xs text-text-secondary\">\n <span>{template.resources?.cpuRequest ?? '?'} CPU</span>\n <span className=\"text-text-secondary/40\">|</span>\n <span>{template.resources?.memoryRequest ?? '?'} mem</span>\n <span className=\"text-text-secondary/40\">|</span>\n <span>{template.containers?.length ?? 0} containers</span>\n <span className=\"text-text-secondary/40\">|</span>\n <span>{formatTTL(template.ttlSeconds)}</span>\n </div>\n </button>\n );\n })}\n </div>\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.create.sections.quickStartTemplates.hint',\n 'Select a template or customize resources below'\n )}\n </p>\n </CardContent>\n </Card>\n )}\n\n {/* Containers */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Container size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.containers.title', 'Containers')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.containers.help',\n 'A container is the application that runs inside your sandbox. The default sandbox image includes VibeControls agent, Bun, nginx, and common dev tools pre-installed.'\n )}\n />\n <Badge variant=\"secondary\">{formData.containers.length}</Badge>\n </h2>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={addContainer}>\n <Plus size={14} />\n {tWithFallback(\n t,\n 'sandbox.create.sections.containers.addContainer',\n 'Add Container'\n )}\n </Button>\n </div>\n {errors.containers && (\n <p className=\"text-sm text-status-error-text flex items-center gap-1\">\n <AlertCircle size={14} />\n {errors.containers}\n </p>\n )}\n\n <div className=\"space-y-4\">\n {formData.containers.map((container, cIdx) => (\n <div\n key={container._rowId}\n className=\"p-4 rounded-lg border-2 border-border-subtle/50 bg-bg-sunken/20 space-y-4\"\n >\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-semibold text-sm\">\n {tWithFallback(t, 'sandbox.create.container.heading', 'Container #{number}', {\n number: cIdx + 1,\n })}\n {container.name && `: ${container.name}`}\n </h3>\n {formData.containers.length > 1 && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"text-status-error-text hover:text-status-error-text size-7\"\n onClick={() => removeContainer(cIdx)}\n >\n <Trash2 size={14} />\n </Button>\n )}\n </div>\n\n {/* Container Name */}\n <div>\n <label className=\"block text-xs font-semibold mb-1\">\n {tWithFallback(t, 'sandbox.create.container.fields.name.label', 'Name')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <input\n aria-label=\"Name\"\n type=\"text\"\n value={container.name}\n onChange={(e) => updateContainer(cIdx, 'name', e.target.value)}\n className={`w-full px-3 py-2 border-2 rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors[`container_${cIdx}_name`]\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder={tWithFallback(\n t,\n 'sandbox.create.container.fields.name.placeholder',\n 'main'\n )}\n />\n {errors[`container_${cIdx}_name`] && (\n <p className=\"text-xs text-status-error-text mt-1\">\n {errors[`container_${cIdx}_name`]}\n </p>\n )}\n </div>\n\n {/* Image Registry Selector */}\n <div>\n <label className=\"block text-xs font-semibold mb-1\">\n {tWithFallback(t, 'sandbox.create.container.fields.image.label', 'Image')}{' '}\n <span className=\"text-status-error-text\">*</span>\n </label>\n <div className=\"flex gap-2 mb-2\">\n <button\n type=\"button\"\n onClick={() => updateContainer(cIdx, '_registryType', 'burdenoff')}\n className={`flex-1 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${\n (container._registryType || 'burdenoff') === 'burdenoff'\n ? 'border-primary bg-action-primary-bg/10 text-primary'\n : 'border-border-default text-text-secondary hover:bg-bg-sunken'\n }`}\n >\n {tWithFallback(\n t,\n 'sandbox.create.container.fields.image.registryBurdenoff',\n 'Burdenoff Repositories'\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => updateContainer(cIdx, '_registryType', 'custom')}\n className={`flex-1 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${\n container._registryType === 'custom'\n ? 'border-primary bg-action-primary-bg/10 text-primary'\n : 'border-border-default text-text-secondary hover:bg-bg-sunken'\n }`}\n >\n {tWithFallback(\n t,\n 'sandbox.create.container.fields.image.registryCustom',\n 'Custom (Docker Hub)'\n )}\n </button>\n </div>\n {(container._registryType || 'burdenoff') === 'burdenoff' ? (\n <div className=\"flex items-center\">\n <span className=\"px-3 py-2 border-2 border-r-0 rounded-l-lg bg-bg-sunken text-xs text-text-secondary font-mono whitespace-nowrap\">\n burdenoffregistry.azurecr.io/\n </span>\n <input\n aria-label=\"input\"\n type=\"text\"\n value={stripBurdenoffRegistry(container.image)}\n onChange={(e) => updateContainer(cIdx, 'image', e.target.value)}\n className={`w-full px-3 py-2 border-2 rounded-r-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors[`container_${cIdx}_image`]\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder={DEFAULT_SANDBOX_IMAGE_PATH}\n />\n </div>\n ) : (\n <input\n aria-label=\"input\"\n type=\"text\"\n value={container.image}\n onChange={(e) => updateContainer(cIdx, 'image', e.target.value)}\n className={`w-full px-3 py-2 border-2 rounded-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors[`container_${cIdx}_image`]\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"nginx:alpine\"\n />\n )}\n {errors[`container_${cIdx}_image`] && (\n <p className=\"text-xs text-status-error-text mt-1\">\n {errors[`container_${cIdx}_image`]}\n </p>\n )}\n </div>\n\n {/* Per-container resources (optional) */}\n <div>\n <p className=\"text-xs font-semibold mb-2 text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.create.container.resources.title',\n 'Per-Container Resources (optional)'\n )}\n </p>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.cpuReq', 'CPU Req')}\n </label>\n <input\n aria-label=\"CPU Req\"\n type=\"text\"\n value={container.requestsCpu}\n onChange={(e) => updateContainer(cIdx, 'requestsCpu', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"250m\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.cpuLim', 'CPU Lim')}\n </label>\n <input\n aria-label=\"CPU Lim\"\n type=\"text\"\n value={container.limitsCpu}\n onChange={(e) => updateContainer(cIdx, 'limitsCpu', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"1\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.memReq', 'Mem Req')}\n </label>\n <input\n aria-label=\"Mem Req\"\n type=\"text\"\n value={container.requestsMemory}\n onChange={(e) => updateContainer(cIdx, 'requestsMemory', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"512Mi\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-text-secondary mb-1\">\n {tWithFallback(t, 'sandbox.create.container.resources.memLim', 'Mem Lim')}\n </label>\n <input\n aria-label=\"Mem Lim\"\n type=\"text\"\n value={container.limitsMemory}\n onChange={(e) => updateContainer(cIdx, 'limitsMemory', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"2Gi\"\n />\n </div>\n </div>\n </div>\n\n {/* Ports */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <p className=\"text-xs font-semibold text-text-secondary\">\n {tWithFallback(t, 'sandbox.create.container.ports.title', 'Ports')}\n </p>\n <button\n type=\"button\"\n onClick={() => addPort(cIdx)}\n className=\"text-xs text-primary hover:underline\"\n >\n {tWithFallback(t, 'sandbox.create.container.ports.add', '+ Add Port')}\n </button>\n </div>\n {container.ports.map((port, pIdx) => (\n <div key={port._rowId} className=\"flex items-center gap-2 mb-2\">\n <input\n aria-label=\"input\"\n type=\"number\"\n value={port.containerPort}\n onChange={(e) => {\n const newPorts = [...container.ports];\n newPorts[pIdx] = {\n ...newPorts[pIdx],\n containerPort: Number(e.target.value),\n };\n updateContainer(cIdx, 'ports', newPorts);\n }}\n className=\"w-24 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"8080\"\n />\n <input\n aria-label=\"input\"\n type=\"text\"\n value={port.name}\n onChange={(e) => {\n const newPorts = [...container.ports];\n newPorts[pIdx] = { ...newPorts[pIdx], name: e.target.value };\n updateContainer(cIdx, 'ports', newPorts);\n }}\n className=\"flex-1 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder={tWithFallback(\n t,\n 'sandbox.create.container.ports.namePlaceholder',\n 'Port name (optional)'\n )}\n />\n <button\n type=\"button\"\n onClick={() => removePort(cIdx, pIdx)}\n className=\"p-1.5 text-status-error-text hover:bg-status-error-bg/10 rounded\"\n >\n <X size={12} />\n </button>\n </div>\n ))}\n </div>\n\n {/* Env Vars */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <p className=\"text-xs font-semibold text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.create.container.envVars.title',\n 'Environment Variables'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => addEnvVar(cIdx)}\n className=\"text-xs text-primary hover:underline\"\n >\n {tWithFallback(t, 'sandbox.create.container.envVars.add', '+ Add Variable')}\n </button>\n </div>\n {container.env.map((envVar, eIdx) => (\n <div\n key={`${container._rowId}-env-${eIdx}-${envVar.name}`}\n className=\"flex items-center gap-2 mb-2\"\n >\n <input\n aria-label=\"input\"\n type=\"text\"\n value={envVar.name}\n onChange={(e) => {\n const newEnv = [...container.env];\n newEnv[eIdx] = { ...newEnv[eIdx], name: e.target.value };\n updateContainer(cIdx, 'env', newEnv);\n }}\n className=\"w-1/3 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"KEY\"\n />\n <input\n aria-label=\"input\"\n type=\"text\"\n value={envVar.value}\n onChange={(e) => {\n const newEnv = [...container.env];\n newEnv[eIdx] = { ...newEnv[eIdx], value: e.target.value };\n updateContainer(cIdx, 'env', newEnv);\n }}\n className=\"flex-1 px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"value\"\n />\n <button\n type=\"button\"\n onClick={() => removeEnvVar(cIdx, eIdx)}\n className=\"p-1.5 text-status-error-text hover:bg-status-error-bg/10 rounded\"\n >\n <X size={12} />\n </button>\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n\n {/* Resources */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Cpu size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.podResources.title', 'Pod Resources')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.podResources.help',\n 'Resources allocated to the entire sandbox. CPU is in millicores (1000m = 1 CPU core). Memory in MiB or GiB.'\n )}\n />\n </h2>\n\n <OptionalFields\n title={tWithFallback(\n t,\n 'sandbox.create.sections.podResources.advancedTitle',\n 'Advanced resource limits'\n )}\n description={tWithFallback(\n t,\n 'sandbox.create.sections.podResources.advancedDescription',\n 'CPU and memory requests/limits. Defaults work for most sandboxes.'\n )}\n >\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-5\">\n {/* CPU Request */}\n <div>\n <label\n htmlFor=\"cpuRequest\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <Cpu size={14} className=\"text-status-info-text\" />\n {tWithFallback(t, 'sandbox.create.fields.cpuRequest.label', 'CPU Request')}\n </label>\n <input\n aria-label=\"CPU Request\"\n type=\"text\"\n id=\"cpuRequest\"\n value={formData.cpuRequest}\n onChange={(e) => handleInputChange('cpuRequest', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.cpuRequest\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"500m\"\n />\n {errors.cpuRequest && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.cpuRequest}</p>\n )}\n </div>\n\n {/* CPU Limit */}\n <div>\n <label\n htmlFor=\"cpuLimit\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <Cpu size={14} className=\"text-status-info-text\" />\n {tWithFallback(t, 'sandbox.create.fields.cpuLimit.label', 'CPU Limit')}\n </label>\n <input\n aria-label=\"CPU Limit\"\n type=\"text\"\n id=\"cpuLimit\"\n value={formData.cpuLimit}\n onChange={(e) => handleInputChange('cpuLimit', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.cpuLimit\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"2\"\n />\n {errors.cpuLimit && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.cpuLimit}</p>\n )}\n </div>\n\n {/* Memory Request */}\n <div>\n <label\n htmlFor=\"memoryRequest\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <MemoryStick size={14} className=\"text-accent-purple-subtle\" />\n {tWithFallback(\n t,\n 'sandbox.create.fields.memoryRequest.label',\n 'Memory Request'\n )}\n </label>\n <input\n aria-label=\"Memory Request\"\n type=\"text\"\n id=\"memoryRequest\"\n value={formData.memoryRequest}\n onChange={(e) => handleInputChange('memoryRequest', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.memoryRequest\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"1Gi\"\n />\n {errors.memoryRequest && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.memoryRequest}</p>\n )}\n </div>\n\n {/* Memory Limit */}\n <div>\n <label\n htmlFor=\"memoryLimit\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <MemoryStick size={14} className=\"text-accent-purple-subtle\" />\n {tWithFallback(t, 'sandbox.create.fields.memoryLimit.label', 'Memory Limit')}\n </label>\n <input\n aria-label=\"Memory Limit\"\n type=\"text\"\n id=\"memoryLimit\"\n value={formData.memoryLimit}\n onChange={(e) => handleInputChange('memoryLimit', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.memoryLimit\n ? 'border-status-error-border'\n : 'border-border-subtle focus:border-primary'\n }`}\n placeholder=\"4Gi\"\n />\n {errors.memoryLimit && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.memoryLimit}</p>\n )}\n </div>\n </div>\n </OptionalFields>\n\n {/* TTL */}\n <div>\n <label\n htmlFor=\"ttlSeconds\"\n className=\"text-sm font-semibold mb-2 flex items-center gap-2\"\n >\n <Timer size={14} className=\"text-status-info-text\" />\n {tWithFallback(t, 'sandbox.create.fields.ttl.label', 'Time to Live')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.fields.ttl.help',\n \"Your sandbox will be automatically destroyed after this duration to save resources. You can extend it while it's running.\"\n )}\n />\n <Badge variant=\"outline\" className=\"text-xs ml-auto\">\n {formatTTL(formData.ttlSeconds)}\n </Badge>\n </label>\n <input\n aria-label=\"Time to Live\"\n type=\"range\"\n id=\"ttlSeconds\"\n min={600}\n max={86400}\n step={600}\n value={formData.ttlSeconds}\n onChange={(e) => handleInputChange('ttlSeconds', Number(e.target.value))}\n className=\"w-full mt-2 accent-primary\"\n />\n <div className=\"flex justify-between text-xs text-text-secondary mt-1\">\n <span>10m</span>\n <span>4h</span>\n <span>12h</span>\n <span>24h</span>\n </div>\n {errors.ttlSeconds && (\n <p className=\"text-sm text-status-error-text mt-1\">{errors.ttlSeconds}</p>\n )}\n </div>\n\n <div>\n <label className=\"text-sm font-semibold mb-2 flex items-center gap-2\">\n {tWithFallback(t, 'sandbox.create.fields.tags.label', 'Tags')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.fields.tags.help',\n 'Free-form labels. Use them to filter the sandbox list. Max 32 tags, 64 chars each.'\n )}\n />\n </label>\n <TagsInput value={tags} onChange={setTags} />\n </div>\n </CardContent>\n </Card>\n\n {/* Storage */}\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Database size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.create.sections.storage.title', 'Storage')}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.storage.help',\n 'Ephemeral storage is fast but lost when the sandbox stops. Persistent storage survives restarts.'\n )}\n />\n </h2>\n\n {/* Storage Mode */}\n <div>\n <label className=\"block text-sm font-semibold mb-3\">\n {tWithFallback(t, 'sandbox.create.fields.storageMode.label', 'Mode')}\n </label>\n <div className=\"grid grid-cols-3 gap-3\">\n {(['NONE', 'EPHEMERAL', 'PERSISTENT'] as StorageMode[]).map((mode) => {\n const isSelected = formData.storageMode === mode;\n const labels: Record<StorageMode, string> = {\n NONE: tWithFallback(t, 'sandbox.create.fields.storageMode.none.label', 'None'),\n EPHEMERAL: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.ephemeral.label',\n 'Ephemeral'\n ),\n PERSISTENT: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.persistent.label',\n 'Persistent'\n ),\n };\n const descriptions: Record<StorageMode, string> = {\n NONE: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.none.description',\n 'No persistent storage'\n ),\n EPHEMERAL: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.ephemeral.description',\n 'Lost when sandbox stops'\n ),\n PERSISTENT: tWithFallback(\n t,\n 'sandbox.create.fields.storageMode.persistent.description',\n 'Retained across restarts'\n ),\n };\n return (\n <button\n key={mode}\n type=\"button\"\n onClick={() => handleInputChange('storageMode', mode)}\n className={`p-3 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-action-primary-bg/5 shadow-sm'\n : 'border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50'\n }`}\n >\n <p className=\"font-medium text-sm\">{labels[mode]}</p>\n <p className=\"text-xs text-text-secondary mt-0.5\">{descriptions[mode]}</p>\n </button>\n );\n })}\n </div>\n </div>\n\n {/* Storage details when not NONE */}\n {formData.storageMode !== 'NONE' && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-5\">\n <div>\n <label htmlFor=\"storageSizeGi\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.storageSizeGi.label', 'Size (GiB)')}\n </label>\n <input\n aria-label=\"Size (GiB)\"\n type=\"number\"\n id=\"storageSizeGi\"\n value={formData.storageSizeGi}\n onChange={(e) => handleInputChange('storageSizeGi', Number(e.target.value))}\n min={1}\n max={200}\n className=\"w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n />\n </div>\n <div>\n <label htmlFor=\"storageMountPath\" className=\"block text-sm font-semibold mb-2\">\n {tWithFallback(t, 'sandbox.create.fields.storageMountPath.label', 'Mount Path')}\n </label>\n <input\n aria-label=\"Mount Path\"\n type=\"text\"\n id=\"storageMountPath\"\n value={formData.storageMountPath}\n onChange={(e) => handleInputChange('storageMountPath', e.target.value)}\n className=\"w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder=\"/data\"\n />\n </div>\n {formData.storageMode === 'PERSISTENT' && (\n <div className=\"flex items-center gap-3 sm:col-span-2\">\n <input\n aria-label=\"input\"\n type=\"checkbox\"\n id=\"storageRetainOnDelete\"\n checked={formData.storageRetainOnDelete}\n onChange={(e) => handleInputChange('storageRetainOnDelete', e.target.checked)}\n className=\"size-4 rounded border-border-subtle text-primary focus:ring-primary/20\"\n />\n <label htmlFor=\"storageRetainOnDelete\" className=\"text-sm font-medium\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.storageRetainOnDelete.label',\n 'Retain volume data when sandbox is deleted'\n )}\n </label>\n </div>\n )}\n <div className=\"sm:col-span-2\">\n <FilesFolderPicker\n value={formData.filesFolderId}\n onChange={(folderId) => handleInputChange('filesFolderId', folderId)}\n />\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n\n {/* Advanced: Gateway URLs */}\n {formData.template === 'MISC_SHELL' && (\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-5\">\n <details>\n <summary className=\"cursor-pointer text-sm font-semibold text-text-secondary flex items-center gap-2\">\n <Settings size={14} />\n {tWithFallback(\n t,\n 'sandbox.create.sections.advancedSettings.title',\n 'Advanced Settings'\n )}\n <HelpTip\n text={tWithFallback(\n t,\n 'sandbox.create.sections.advancedSettings.help',\n 'Override the gateway URLs the sandbox agent uses for authentication and API calls. Useful when exposing local gateways via tunnel for development.'\n )}\n />\n </summary>\n <div className=\"mt-4 space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.globalGatewayUrl.label',\n 'Global Gateway URL'\n )}\n </label>\n <input\n aria-label=\"Global Gateway URL\"\n type=\"text\"\n value={formData.globalGatewayUrl}\n onChange={(e) => handleInputChange('globalGatewayUrl', e.target.value)}\n placeholder={DEFAULT_GLOBAL_GATEWAY_URL}\n className=\"w-full rounded-lg border border-border-subtle px-3 py-2 text-sm font-mono bg-bg-surface focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary\"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.globalGatewayUrl.hint',\n 'The agent authenticates via this URL. Override with a tunnel URL to reach local gateways.'\n )}\n </p>\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary mb-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.workspaceGatewayUrl.label',\n 'Workspace Gateway URL'\n )}\n </label>\n <input\n aria-label=\"Workspace Gateway URL\"\n type=\"text\"\n value={formData.workspaceGatewayUrl}\n onChange={(e) => handleInputChange('workspaceGatewayUrl', e.target.value)}\n placeholder={DEFAULT_WSPACE_GATEWAY_URL}\n className=\"w-full rounded-lg border border-border-subtle px-3 py-2 text-sm font-mono bg-bg-surface focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary\"\n />\n <p className=\"text-xs text-text-secondary mt-1\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.workspaceGatewayUrl.hint',\n 'The agent reports to this URL. Override with a tunnel URL to reach local gateways.'\n )}\n </p>\n </div>\n </div>\n </details>\n </CardContent>\n </Card>\n )}\n\n {/* Actions */}\n <div className=\"flex flex-col sm:flex-row gap-3 pt-2\">\n <Button type=\"submit\" disabled={submitting} size=\"lg\">\n {submitting ? <Loader2 size={18} className=\"animate-spin\" /> : <Save size={18} />}\n {tWithFallback(t, 'sandbox.create.actions.submit', 'Create Sandbox')}\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => navigate?.(basePath)}\n disabled={submitting}\n >\n {tWithFallback(t, 'sandbox.create.actions.cancel', 'Cancel')}\n </Button>\n </div>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6DA,IAAI,IAAgB;AACpB,SAAS,IAAoB;AAE3B,QADA,KAAiB,GACV,OAAO,EAAc,GAAG,KAAK,KAAK;;AAwB3C,IAAM,KAOA,CACJ;CACE,OAAO;CACP,UAAU;CACV,eAAe;CACf,gBAAgB;CAChB,qBACE;CACF,MAAM;CACP,EACD;CACE,OAAO;CACP,UAAU;CACV,eAAe;CACf,gBAAgB;CAChB,qBAAqB;CACrB,MAAM;CACP,CACF;AAED,SAAS,IAAyC;AAChD,QAAO;EACL,QAAQ,GAAW;EACnB,MAAM;EACN,OAAO;EACP,OAAO,EAAE;EACT,KAAK,EAAE;EACP,aAAa;EACb,gBAAgB;EAChB,WAAW;EACX,cAAc;EACf;;AAGH,SAAS,EAAQ,EAAE,WAA0B;CAC3C,IAAM,CAAC,GAAM,KAAW,EAAS,GAAM;AACvC,QACE,kBAAC,QAAD;EAAM,WAAU;YAAhB,CACE,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAQ,CAAC,EAAK;GAC7B,WAAU;aAEV,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;GACjB,CAAA,EACR,KACC,kBAAC,OAAD;GAAK,WAAU;aAAf,CACG,GACD,kBAAC,UA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AC,GAAD;QAAS,MAAM;QAAI,WAAU;QAAiB,CAAA,GAAG,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EAChF,EAAc,GAAG,iCAAiC,iBAAiB,CAC7D;UACT,kBAAC,GAAD;OACE,MAAK;OACL,SAAQ;OACR,eAAe,IAAW,EAAS;OACnC,UAAU;iBAET,EAAc,GAAG,iCAAiC,SAAS;OACrD,CAAA,CACL;;KACD;;GACI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxDetailPage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/SandboxDetailPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SandboxDetailPage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/SandboxDetailPage.tsx"],"names":[],"mappings":"AAuKA;;;GAGG;AACH,wBAAgB,iBAAiB,gCA8yBhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxDetailPage.js","names":[],"sources":["../../../src/sandbox/pages/SandboxDetailPage.tsx"],"sourcesContent":["import { useState, useCallback, useEffect, useRef, useMemo, type ReactNode } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n ArrowLeft,\n StopCircle,\n Trash2,\n Timer,\n Copy,\n CheckCircle2,\n Terminal,\n Info,\n RefreshCw,\n Clock,\n AlertCircle,\n Container,\n Network,\n Database,\n Shield,\n XCircle,\n Play,\n Cog,\n Download,\n} from 'lucide-react';\nimport {\n Button,\n Badge,\n Card,\n CardContent,\n GlassCard,\n EmphasisPanel,\n ShowMore,\n CTAOverflowMenu,\n type CTAAction,\n} from '../components/ui';\nimport { StatusBadge } from '../components/StatusBadge';\nimport { ResourceDisplay } from '../components/ResourceDisplay';\nimport { SandboxTypeIcon } from '../components/SandboxTypeIcon';\nimport { CountdownTimer } from '../components/CountdownTimer';\nimport { ExtendTTLModal } from '../components/ExtendTTLModal';\nimport { SandboxActivityTab } from '../components/SandboxActivityTab';\nimport { SandboxAgentAppPanel } from '../components/SandboxAgentAppPanel';\nimport { SandboxScriptRunnerPanel } from '../components/SandboxScriptRunnerPanel';\nimport { useSandbox } from '../providers/SandboxProvider';\nimport { useSandboxEvents } from '../utils/sandboxEvents';\nimport { PageLayout } from '../components/PageLayout';\nimport { IllustratedEmptyState, PagePurpose, NextSteps, type NextStep } from '@burdenoff/fe-libs/ui';\nimport { tWithFallback } from '../utils/i18n';\nimport type { Sandbox } from '../types';\nimport {\n useGetSandboxQuery,\n useGetSandboxLogsLazyQuery,\n useStopSandboxMutation,\n useDeleteSandboxMutation,\n useExtendSandboxTtlMutation,\n useOnSandboxStatusChangedSubscription,\n} from '../../generated/wspace-operations';\nimport {\n isNative,\n nativeCopyText,\n nativeImpact,\n nativeNotify,\n nativeToast,\n} from '../../utils/nativeBridge';\n\nfunction formatDateTime(isoString: string): string {\n return new Date(isoString).toLocaleString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nfunction formatTTL(seconds: number): string {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n if (hours > 0) return `${hours}h ${minutes}m`;\n return `${minutes}m`;\n}\n\nfunction formatTTLRemaining(expiresAt?: string): string | null {\n if (!expiresAt) return null;\n const remaining = new Date(expiresAt).getTime() - Date.now();\n if (remaining <= 0) return 'Expired';\n const hours = Math.floor(remaining / 3600000);\n const minutes = Math.floor((remaining % 3600000) / 60000);\n if (hours > 0) return `${hours}h ${minutes}m remaining`;\n return `${minutes}m remaining`;\n}\n\n/**\n * Module-scope copy button so React can preserve its instance between renders\n * of the parent page (previously defined inline, which destroyed local state on\n * every parent re-render).\n */\nfunction CopyButton({\n isCopied,\n onCopy,\n ariaLabel,\n}: {\n isCopied: boolean;\n onCopy: () => void;\n ariaLabel: string;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onCopy}\n className=\"p-1 rounded hover:bg-bg-sunken transition-colors\"\n aria-label={ariaLabel}\n >\n {isCopied ? (\n <CheckCircle2 size={14} className=\"text-status-success-text\" />\n ) : (\n <Copy size={14} className=\"text-text-secondary\" />\n )}\n </button>\n );\n}\n\nfunction CopyField({\n value,\n field,\n copiedField,\n onCopy,\n ariaLabel,\n}: {\n value: string;\n field: string;\n copiedField: string | null;\n onCopy: (value: string, field: string) => void;\n ariaLabel: string;\n}) {\n return (\n <CopyButton\n isCopied={copiedField === field}\n onCopy={() => onCopy(value, field)}\n ariaLabel={ariaLabel}\n />\n );\n}\n\n/**\n * Wraps content in the Boff UI 2.0 `ShowMore` progressive-disclosure primitive\n * only when `enabled` (e.g. long lists), otherwise renders children inline so we\n * never add a redundant \"Show more\" affordance to short content.\n */\nfunction MaybeShowMore({\n enabled,\n collapsedHeight,\n children,\n}: {\n enabled: boolean;\n collapsedHeight?: number;\n children: ReactNode;\n}) {\n if (!enabled) return <>{children}</>;\n return <ShowMore collapsedHeight={collapsedHeight}>{children}</ShowMore>;\n}\n\n/**\n * Sandbox Detail Page\n * Shows full sandbox information with actions\n */\nexport function SandboxDetailPage() {\n const { sandboxId } = useParams<{ sandboxId: string }>();\n const { basePath = '/', navigate, workspaceId } = useSandbox();\n const { t } = useI18n();\n const [copiedField, setCopiedField] = useState<string | null>(null);\n const [showExtendModal, setShowExtendModal] = useState(false);\n const [extendLoading, setExtendLoading] = useState(false);\n\n // Real GraphQL query\n const { data, loading, refetch } = useGetSandboxQuery({\n variables: { context: { workspaceId }, id: sandboxId! },\n skip: !sandboxId || !workspaceId,\n });\n\n // Live updates: server pushes status / TTL / deletion via the same Sandbox\n // entity, so Apollo cache normalization (key: id) auto-refreshes the page\n // without a refetch round-trip.\n useOnSandboxStatusChangedSubscription({\n variables: { workspaceId: workspaceId!, sandboxId: sandboxId! },\n skip: !sandboxId || !workspaceId,\n });\n\n const [stopSandbox] = useStopSandboxMutation();\n const [deleteSandbox] = useDeleteSandboxMutation();\n const [extendTTL] = useExtendSandboxTtlMutation();\n const sandboxEvents = useSandboxEvents();\n\n const sandbox = data?.getSandbox;\n\n const handleCopy = async (value: string, field: string) => {\n nativeImpact('light');\n const ok = await nativeCopyText(value);\n if (ok) {\n nativeNotify('success');\n if (isNative()) void nativeToast(`Copied ${field}`);\n setCopiedField(field);\n setTimeout(() => setCopiedField(null), 2000);\n } else {\n nativeNotify('error');\n }\n };\n\n const handleCopyField = (value: string, field: string) => {\n void handleCopy(value, field);\n };\n const copyAriaLabel = (field: string) =>\n tWithFallback(t, 'sandbox.detail.actions.copy.ariaLabel', 'Copy {field}', { field });\n\n if (loading) {\n return (\n <PageLayout showHeader={false}>\n <div className=\"flex items-center justify-center h-64\">\n <RefreshCw size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (!sandbox) {\n return (\n <PageLayout showHeader={false}>\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tWithFallback(t, 'sandbox.detail.notFound.message', 'Sandbox not found')}\n action={\n <Button variant=\"outline\" onClick={() => navigate?.(basePath)}>\n {tWithFallback(t, 'sandbox.detail.notFound.backButton', 'Back to Sandboxes')}\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n const isActive =\n sandbox.status === 'RUNNING' ||\n sandbox.status === 'PROVISIONING' ||\n sandbox.status === 'PENDING';\n const canStop = sandbox.status === 'RUNNING';\n const canDelete =\n sandbox.status === 'STOPPED' ||\n sandbox.status === 'ERROR' ||\n sandbox.status === 'EXPIRED' ||\n sandbox.status === 'FAILED';\n const canExtend = sandbox.status === 'RUNNING';\n\n // Secondary actions collapse into the overflow (\"More\") menu; Refresh stays\n // as the single primary CTA. Destructive Delete lives in the menu.\n const headerActions: CTAAction[] = [\n ...(canExtend\n ? [\n {\n label: tWithFallback(t, 'sandbox.detail.actions.extendTtl', 'Extend TTL'),\n onSelect: () => setShowExtendModal(true),\n icon: <Timer size={16} />,\n } as CTAAction,\n ]\n : []),\n ...(canStop\n ? [\n {\n label: tWithFallback(t, 'sandbox.detail.actions.stop', 'Stop'),\n onSelect: () =>\n void stopSandbox({\n variables: { context: { workspaceId }, id: sandbox.id },\n }).then(() => refetch()),\n icon: <StopCircle size={16} />,\n } as CTAAction,\n ]\n : []),\n ...(canDelete\n ? [\n {\n label: tWithFallback(t, 'sandbox.detail.actions.delete', 'Delete'),\n onSelect: () =>\n void deleteSandbox({\n variables: { context: { workspaceId }, id: sandbox.id },\n }).then(() => {\n navigate?.(basePath);\n }),\n icon: <Trash2 size={16} />,\n intent: 'destructive',\n } as CTAAction,\n ]\n : []),\n ];\n\n // Concrete, context-aware next actions so a new user isn't lost on this\n // multi-section detail page. Each step wires to a real handler/anchor and is\n // only offered when it actually applies to the current sandbox state.\n const nextSteps: NextStep[] = ([\n sandbox.network?.internalUrl && sandbox.status === 'RUNNING'\n ? {\n id: 'copy-url',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.copyUrl.label',\n 'Copy the internal URL to connect'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.copyUrl.desc',\n 'Use it to reach the running service from another sandbox or tool.'\n ),\n icon: <Network size={16} />,\n onClick: () => handleCopyField(sandbox.network!.internalUrl!, 'internalUrl'),\n }\n : null,\n sandbox.status === 'RUNNING'\n ? {\n id: 'run-script',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.runScript.label',\n 'Run a script inside the sandbox'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.runScript.desc',\n 'Execute a command or generated script, review the output, then promote it.'\n ),\n icon: <Terminal size={16} />,\n href: '#sandbox-script-runner',\n }\n : null,\n canExtend\n ? {\n id: 'extend-ttl',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.extendTtl.label',\n 'Extend the time-to-live'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.extendTtl.desc',\n 'Keep this sandbox alive longer before it auto-expires.'\n ),\n icon: <Timer size={16} />,\n onClick: () => setShowExtendModal(true),\n }\n : null,\n canStop\n ? {\n id: 'stop',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.stop.label',\n 'Stop the sandbox when you are done'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.stop.desc',\n 'Frees up resources and concurrency for your workspace.'\n ),\n icon: <StopCircle size={16} />,\n onClick: () =>\n void stopSandbox({\n variables: { context: { workspaceId }, id: sandbox.id },\n }).then(() => refetch()),\n }\n : null,\n ] as (NextStep | null)[]).filter((step): step is NextStep => step !== null);\n\n return (\n <PageLayout showHeader={false}>\n {/* Hero — the single emphasis zone: identity + status + lifecycle countdown */}\n <EmphasisPanel className=\"overflow-hidden bg-hero-mesh\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex items-center gap-3 min-w-0\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"flex size-11 flex-shrink-0 items-center justify-center rounded-lg hover:bg-bg-sunken/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border\"\n aria-label={tWithFallback(\n t,\n 'sandbox.detail.header.back.ariaLabel',\n 'Back to sandboxes'\n )}\n >\n <ArrowLeft size={20} />\n </button>\n <SandboxTypeIcon type={sandbox.template} size={28} />\n <div className=\"min-w-0\">\n <h1 className=\"truncate text-2xl sm:text-3xl font-bold\">{sandbox.name}</h1>\n <div className=\"flex flex-wrap items-center gap-2 mt-1\">\n <StatusBadge status={sandbox.status} size=\"md\" />\n <span className=\"text-sm text-text-secondary font-mono truncate\">{sandbox.id}</span>\n <CopyField\n value={sandbox.id}\n field=\"id\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('id')}\n />\n </div>\n </div>\n </div>\n\n {/* One primary CTA (Refresh); everything else in the overflow menu */}\n <CTAOverflowMenu\n className=\"flex-shrink-0\"\n primary={{\n label: tWithFallback(t, 'sandbox.detail.actions.refresh', 'Refresh'),\n onSelect: () => void refetch(),\n icon: <RefreshCw size={16} />,\n }}\n actions={headerActions}\n />\n </div>\n\n {sandbox.network?.internalUrl && sandbox.status === 'RUNNING' && (\n <div className=\"mt-4\">\n <Badge variant=\"outline\" className=\"gap-1.5 px-3 py-1.5 text-sm border-border-seam\">\n <Network size={14} />\n {sandbox.network.internalUrl}\n <CopyField\n value={sandbox.network.internalUrl}\n field=\"internalUrl\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('internalUrl')}\n />\n </Badge>\n </div>\n )}\n\n {/* Countdown Timer */}\n {sandbox.status === 'RUNNING' && sandbox.expiresAt && (\n <div className=\"mt-4\">\n <CountdownTimer\n expiresAt={sandbox.expiresAt}\n onExpired={() => refetch()}\n onExtend={() => setShowExtendModal(true)}\n />\n </div>\n )}\n </EmphasisPanel>\n\n <PagePurpose>\n {tWithFallback(\n t,\n 'sandbox.detail.purpose',\n 'This is the control room for a single sandbox — inspect its status, networking, containers, storage and live logs, run scripts inside it, extend its lifetime, or tear it down. Everything you do here is isolated to this one disposable environment.'\n )}\n </PagePurpose>\n\n {nextSteps.length > 0 && <NextSteps storageKey=\"sandbox-detail\" steps={nextSteps} />}\n\n {/* Description */}\n {sandbox.description && (\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-5\">\n <div className=\"flex items-start gap-3\">\n <Info size={18} className=\"text-primary flex-shrink-0 mt-0.5\" />\n <p className=\"text-sm text-text-secondary leading-relaxed\">{sandbox.description}</p>\n </div>\n </CardContent>\n </Card>\n )}\n\n {/* Grid Layout for Details */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n {/* Resources */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <RefreshCw size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.resources.title', 'Resources')}\n </h3>\n <ResourceDisplay\n cpuRequest={sandbox.resources?.cpuRequest ?? '0'}\n cpuLimit={sandbox.resources?.cpuLimit}\n memoryRequest={sandbox.resources?.memoryRequest ?? '0'}\n memoryLimit={sandbox.resources?.memoryLimit}\n containerCount={sandbox.containers?.length}\n layout=\"grid\"\n />\n </div>\n </GlassCard>\n\n {/* Kubernetes Info */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Shield size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.title', 'Kubernetes')}\n </h3>\n <div className=\"space-y-3\">\n {sandbox.crdName && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.crdName', 'CRD Name')}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-mono\">{sandbox.crdName}</span>\n <CopyField\n value={sandbox.crdName}\n field=\"crdName\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('crdName')}\n />\n </div>\n </div>\n )}\n {sandbox.podName && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.podName', 'Pod Name')}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-mono\">{sandbox.podName}</span>\n <CopyField\n value={sandbox.podName}\n field=\"podName\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('podName')}\n />\n </div>\n </div>\n )}\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.namespace', 'Namespace')}\n </span>\n <span className=\"text-sm font-mono\">{sandbox.namespace}</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.runtimeClass',\n 'Runtime Class'\n )}\n </span>\n <Badge variant=\"secondary\" className=\"font-mono text-xs\">\n {sandbox.runtimeClass}\n </Badge>\n </div>\n {sandbox.network?.serviceName && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.serviceName',\n 'Service Name'\n )}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-mono\">{sandbox.network.serviceName}</span>\n <CopyField\n value={sandbox.network.serviceName}\n field=\"serviceName\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('serviceName')}\n />\n </div>\n </div>\n )}\n {sandbox.network?.internalUrl && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.internalUrl',\n 'Internal URL'\n )}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm text-primary font-mono truncate max-w-48\">\n {sandbox.network.internalUrl}\n </span>\n <CopyField\n value={sandbox.network.internalUrl}\n field=\"internalUrl\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('internalUrl')}\n />\n </div>\n </div>\n )}\n {/* Per-container URLs for multi-container sandboxes */}\n {sandbox.network?.containerUrls &&\n typeof sandbox.network.containerUrls === 'object' &&\n Object.keys(sandbox.network.containerUrls).filter((k: string) => !k.includes(':'))\n .length > 1 && (\n <div className=\"mt-3 pt-3 border-t border-border-subtle/30\">\n <p className=\"text-xs font-semibold text-text-secondary mb-2\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.containerEndpoints',\n 'Container Endpoints'\n )}\n </p>\n <div className=\"space-y-1.5\">\n {Object.entries(\n sandbox.network.containerUrls as Record<string, string>\n ).reduce<ReactNode[]>((acc, [name, url]) => {\n if (name.includes(':')) return acc;\n acc.push(\n <div key={name} className=\"flex items-center justify-between\">\n <span className=\"text-xs text-text-secondary font-mono\">{name}</span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-xs text-primary font-mono truncate max-w-40\">\n {url}\n </span>\n <CopyField\n value={url}\n field={`container-${name}`}\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel(`container-${name}`)}\n />\n </div>\n </div>\n );\n return acc;\n }, [])}\n </div>\n </div>\n )}\n </div>\n </div>\n </GlassCard>\n\n {/* Lifecycle */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Clock size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.title', 'Lifecycle')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.ttl', 'TTL')}\n </span>\n <span className=\"text-sm font-medium\">{formatTTL(sandbox.ttlSeconds)}</span>\n </div>\n {sandbox.expiresAt && isActive && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.expires', 'Expires')}\n </span>\n <Badge variant=\"outline\" className=\"gap-1\">\n <Timer size={12} />\n {formatTTLRemaining(sandbox.expiresAt)}\n </Badge>\n </div>\n )}\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.created', 'Created')}\n </span>\n <span className=\"text-sm\">{formatDateTime(sandbox.createdAt)}</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.updated', 'Updated')}\n </span>\n <span className=\"text-sm\">{formatDateTime(sandbox.updatedAt)}</span>\n </div>\n {sandbox.stoppedAt && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.stopped', 'Stopped')}\n </span>\n <span className=\"text-sm\">{formatDateTime(sandbox.stoppedAt)}</span>\n </div>\n )}\n </div>\n </div>\n </GlassCard>\n\n {/* Details */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Info size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.details.title', 'Details')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.template', 'Template')}\n </span>\n <SandboxTypeIcon type={sandbox.template} showLabel />\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.mode', 'Mode')}\n </span>\n <Badge variant=\"outline\" className=\"gap-1 text-xs font-mono\">\n {sandbox.mode === 'JOB' ? (\n <>\n <Play size={12} />{' '}\n {tWithFallback(t, 'sandbox.detail.cards.details.mode.job', 'Job')}\n </>\n ) : (\n <>\n <Cog size={12} />{' '}\n {tWithFallback(\n t,\n 'sandbox.detail.cards.details.mode.deployment',\n 'Deployment'\n )}\n </>\n )}\n </Badge>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.workspace', 'Workspace')}\n </span>\n <span className=\"text-sm font-mono\">{sandbox.workspaceId}</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.createdBy', 'Created By')}\n </span>\n <span className=\"text-sm\">{sandbox.createdBy}</span>\n </div>\n </div>\n </div>\n </GlassCard>\n </div>\n\n {/* Containers */}\n {sandbox.containers && sandbox.containers.length > 0 && (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Container size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.containers.title', 'Containers')}\n <Badge variant=\"secondary\" className=\"ml-1\">\n {sandbox.containers.length}\n </Badge>\n </h3>\n <MaybeShowMore enabled={sandbox.containers.length > 4} collapsedHeight={220}>\n <div className=\"space-y-3\">\n {sandbox.containers.map((container: any, idx: number) => {\n const status = sandbox.containerStatuses?.find(\n (cs: any) => cs.name === container.name\n );\n return (\n <div\n key={container.name || idx}\n className=\"flex items-center justify-between p-3 rounded-lg border border-border-seam hover:bg-bg-sunken/30 transition-colors\"\n >\n <div className=\"flex items-center gap-3 min-w-0\">\n <div\n className={`w-2.5 h-2.5 rounded-full flex-shrink-0 ${\n status?.ready\n ? 'bg-status-success-text motion-safe:animate-vc-glow-pulse'\n : status\n ? 'bg-status-warning-text animate-pulse'\n : 'bg-text-tertiary'\n }`}\n />\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium\">{container.name}</p>\n <p className=\"text-xs text-text-secondary font-mono truncate\">\n {container.image}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n {container.ports?.map((p: any) => (\n <Badge\n key={p.containerPort}\n variant=\"outline\"\n className=\"text-xs font-mono\"\n >\n :{p.containerPort}\n {p.name ? ` (${p.name})` : ''}\n </Badge>\n ))}\n {status && (\n <Badge\n variant={status.ready ? 'default' : 'secondary'}\n className={`text-xs ${\n status.ready\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : ''\n }`}\n >\n {status.ready\n ? tWithFallback(\n t,\n 'sandbox.detail.cards.containers.status.ready',\n 'Ready'\n )\n : tWithFallback(\n t,\n 'sandbox.detail.cards.containers.status.notReady',\n 'Not Ready'\n )}\n </Badge>\n )}\n {status?.restartCount !== undefined && status.restartCount > 0 && (\n <Badge variant=\"outline\" className=\"text-xs text-status-warning-text\">\n {status.restartCount} restart{status.restartCount !== 1 ? 's' : ''}\n </Badge>\n )}\n </div>\n </div>\n );\n })}\n </div>\n </MaybeShowMore>\n </div>\n </GlassCard>\n )}\n\n {/* Storage */}\n {sandbox.storage && sandbox.storage.mode !== 'NONE' && (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Database size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.storage.title', 'Storage')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.storage.mode', 'Mode')}\n </span>\n <Badge variant=\"outline\">\n {sandbox.storage.mode === 'EPHEMERAL'\n ? tWithFallback(t, 'sandbox.detail.cards.storage.ephemeral', 'Ephemeral')\n : tWithFallback(t, 'sandbox.detail.cards.storage.persistent', 'Persistent')}\n </Badge>\n </div>\n {sandbox.storage.sizeGi && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.storage.size', 'Size')}\n </span>\n <span className=\"text-sm font-medium\">{sandbox.storage.sizeGi} GiB</span>\n </div>\n )}\n {sandbox.storage.mountPath && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.storage.mountPath', 'Mount Path')}\n </span>\n <span className=\"text-sm font-mono\">{sandbox.storage.mountPath}</span>\n </div>\n )}\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.storage.retainOnDelete',\n 'Retain on Delete'\n )}\n </span>\n <Badge variant={sandbox.storage.retainOnDelete ? 'default' : 'secondary'}>\n {sandbox.storage.retainOnDelete\n ? tWithFallback(t, 'sandbox.detail.cards.storage.retainYes', 'Yes')\n : tWithFallback(t, 'sandbox.detail.cards.storage.retainNo', 'No')}\n </Badge>\n </div>\n </div>\n </div>\n </GlassCard>\n )}\n\n {/* Error Message */}\n {sandbox.errorMessage && (\n <Card className=\"border-status-error-border/50 bg-status-error-bg/5\">\n <CardContent className=\"p-5\">\n <h3 className=\"font-semibold text-status-error-text mb-2 flex items-center gap-2\">\n <AlertCircle size={18} />\n {tWithFallback(t, 'sandbox.detail.cards.errorDetails.title', 'Error Details')}\n </h3>\n <p className=\"text-sm text-status-error-text/80 font-mono bg-status-error-bg/5 rounded-lg p-3\">\n {sandbox.errorMessage}\n </p>\n </CardContent>\n </Card>\n )}\n\n {/* Auto-registered Application (DevPortal) */}\n {(() => {\n const meta = (sandbox.metadata as Record<string, unknown> | null) ?? null;\n const appId = (meta?.devPortalApplicationId ?? meta?.appId) as string | undefined;\n const clientId = meta?.clientId as string | undefined;\n const clientSecret = meta?.clientSecretRevealOnce as string | undefined;\n if (!appId && !clientId) return null;\n return (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <SandboxAgentAppPanel appId={appId} clientId={clientId} clientSecret={clientSecret} />\n </div>\n </GlassCard>\n );\n })()}\n\n {/* Activity / audit feed scoped to this sandbox */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {tWithFallback(t, 'sandbox.detail.cards.activity.title', 'Activity')}\n </h3>\n <SandboxActivityTab sandboxId={sandbox.id} workspaceId={workspaceId ?? ''} />\n </div>\n </GlassCard>\n\n {/* Container Logs */}\n <SandboxLogsPanel sandbox={sandbox} workspaceId={workspaceId ?? ''} />\n\n {/* Script Runner — run an AI-generated script in the sandbox, review, then promote */}\n <div id=\"sandbox-script-runner\">\n <SandboxScriptRunnerPanel sandbox={sandbox} workspaceId={workspaceId ?? ''} />\n </div>\n\n {/* Extend TTL Modal */}\n {sandbox.expiresAt && (\n <ExtendTTLModal\n isOpen={showExtendModal}\n onClose={() => setShowExtendModal(false)}\n currentExpiresAt={sandbox.expiresAt}\n isLoading={extendLoading}\n onExtend={(additionalSeconds) => {\n setExtendLoading(true);\n extendTTL({\n variables: {\n context: { workspaceId },\n id: sandbox.id,\n additionalSeconds,\n },\n })\n .then((res) => {\n const updated = res.data?.extendSandboxTTL;\n if (updated) {\n sandboxEvents.sandboxExtended({\n sandboxId: updated.id,\n addedSeconds: additionalSeconds,\n newExpiresAt: updated.expiresAt as unknown as string,\n });\n }\n refetch();\n })\n .catch((err) => {\n console.error('Failed to extend TTL:', err);\n })\n .finally(() => {\n setExtendLoading(false);\n setShowExtendModal(false);\n });\n }}\n />\n )}\n </PageLayout>\n );\n}\n\n/**\n * Real logs panel that fetches container logs via the getSandboxLogs query.\n */\nfunction SandboxLogsPanel({ sandbox, workspaceId }: { sandbox: any; workspaceId: string }) {\n const { t } = useI18n();\n const [selectedContainer, setSelectedContainer] = useState<string>(\n sandbox.containers?.[0]?.name ?? ''\n );\n const [tailLines, setTailLines] = useState(100);\n const logsEndRef = useRef<HTMLDivElement>(null);\n\n const [fetchLogs, { data: logsData, loading: logsLoading, error: logsError }] =\n useGetSandboxLogsLazyQuery();\n\n const canFetchLogs = sandbox.status === 'RUNNING' || sandbox.status === 'PROVISIONING';\n\n const handleFetchLogs = useCallback(() => {\n if (!selectedContainer || !canFetchLogs) return;\n fetchLogs({\n variables: {\n context: { workspaceId },\n id: sandbox.id,\n containerName: selectedContainer,\n tailLines,\n },\n });\n }, [fetchLogs, workspaceId, sandbox.id, selectedContainer, tailLines, canFetchLogs]);\n\n // Auto-fetch logs when container changes and sandbox is running\n useEffect(() => {\n if (canFetchLogs && selectedContainer) {\n handleFetchLogs();\n }\n }, [selectedContainer, canFetchLogs, handleFetchLogs]);\n\n // Scroll to bottom when new logs arrive\n useEffect(() => {\n logsEndRef.current?.scrollIntoView({ behavior: 'smooth' });\n }, [logsData]);\n\n const logLines = logsData?.getSandboxLogs?.split('\\n') ?? [];\n\n return (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Terminal size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.logs.title', 'Logs')}\n </h3>\n <div className=\"flex items-center gap-2\">\n {/* Container selector */}\n {sandbox.containers && sandbox.containers.length > 1 && (\n <select\n value={selectedContainer}\n onChange={(e) => setSelectedContainer(e.target.value)}\n className=\"px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono\"\n >\n {sandbox.containers.map((c: any) => (\n <option key={c.name} value={c.name}>\n {c.name}\n </option>\n ))}\n </select>\n )}\n {/* Tail lines selector */}\n <select\n value={tailLines}\n onChange={(e) => setTailLines(Number(e.target.value))}\n className=\"px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono\"\n >\n <option value={50}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.50', '50 lines')}\n </option>\n <option value={100}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.100', '100 lines')}\n </option>\n <option value={500}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.500', '500 lines')}\n </option>\n <option value={1000}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.1000', '1000 lines')}\n </option>\n </select>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleFetchLogs}\n disabled={!canFetchLogs || logsLoading}\n >\n <RefreshCw size={14} className={logsLoading ? 'animate-spin' : ''} />\n {tWithFallback(t, 'sandbox.detail.logs.refresh', 'Refresh')}\n </Button>\n {logLines.length > 0 && (\n <>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n nativeImpact('light');\n void nativeCopyText(logLines.join('\\n')).then((ok) => {\n if (ok) {\n nativeNotify('success');\n if (isNative()) void nativeToast('Copied logs');\n } else {\n nativeNotify('error');\n }\n });\n }}\n title={tWithFallback(\n t,\n 'sandbox.detail.logs.copy.title',\n 'Copy logs to clipboard'\n )}\n >\n <Copy size={14} />\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n const blob = new Blob([logLines.join('\\n')], { type: 'text/plain' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `sandbox-${sandbox.name}-logs.txt`;\n a.click();\n URL.revokeObjectURL(url);\n }}\n title={tWithFallback(t, 'sandbox.detail.logs.download.title', 'Download logs')}\n >\n <Download size={14} />\n </Button>\n </>\n )}\n </div>\n </div>\n\n <div className=\"bg-zinc-950 text-zinc-300 rounded-lg p-4 font-mono text-xs leading-relaxed min-h-[200px] max-h-[500px] overflow-y-auto\">\n {!canFetchLogs && (\n <p className=\"text-zinc-500\">\n {tWithFallback(\n t,\n 'sandbox.detail.logs.unavailable',\n 'Logs are available when the sandbox is running.'\n )}\n </p>\n )}\n {logsLoading && (\n <p className=\"text-zinc-500 animate-pulse\">\n {tWithFallback(t, 'sandbox.detail.logs.fetching', 'Fetching logs...')}\n </p>\n )}\n {logsError && (\n <p className=\"text-status-error-text\">\n {tWithFallback(\n t,\n 'sandbox.detail.logs.fetchError',\n 'Failed to fetch logs: {message}',\n { message: logsError.message }\n )}\n </p>\n )}\n {logLines.length > 0 && !logsLoading\n ? logLines.map((line: string, idx: number) => (\n <p\n key={`${idx}:${line}`}\n className={\n line.toLowerCase().includes('error')\n ? 'text-status-error-text'\n : line.toLowerCase().includes('warn')\n ? 'text-status-warning-text'\n : 'text-zinc-300'\n }\n >\n {line}\n </p>\n ))\n : !logsLoading &&\n canFetchLogs &&\n !logsError && (\n <p className=\"text-zinc-500\">\n {tWithFallback(\n t,\n 'sandbox.det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AAa,CAAC,SAAS,OAAO,GACjC,6BACA;gBAGP;MACC,EAVG,GAAG,EAAI,GAAG,IAUb,CACJ,GACF,CAAC,KACD,KACA,CAAC,KACC,kBAAC,KAAD;MAAG,WAAU;gBACV,EACC,GACA,6BACA,uCACD;MACC,CAAA;KAEV,kBAAC,OAAD,EAAK,KAAK,GAAc,CAAA;KACpB;MACF;;EACI,CAAA"}
|
|
1
|
+
{"version":3,"file":"SandboxDetailPage.js","names":[],"sources":["../../../src/sandbox/pages/SandboxDetailPage.tsx"],"sourcesContent":["import { useState, useCallback, useEffect, useRef, useMemo, type ReactNode } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n ArrowLeft,\n StopCircle,\n Trash2,\n Timer,\n Copy,\n CheckCircle2,\n Terminal,\n Info,\n RefreshCw,\n Clock,\n AlertCircle,\n Container,\n Network,\n Database,\n Shield,\n XCircle,\n Play,\n Cog,\n Download,\n} from 'lucide-react';\nimport {\n Button,\n Badge,\n Card,\n CardContent,\n GlassCard,\n EmphasisPanel,\n ShowMore,\n CTAOverflowMenu,\n type CTAAction,\n} from '../components/ui';\nimport { StatusBadge } from '../components/StatusBadge';\nimport { ResourceDisplay } from '../components/ResourceDisplay';\nimport { SandboxTypeIcon } from '../components/SandboxTypeIcon';\nimport { CountdownTimer } from '../components/CountdownTimer';\nimport { ExtendTTLModal } from '../components/ExtendTTLModal';\nimport { SandboxActivityTab } from '../components/SandboxActivityTab';\nimport { SandboxAgentAppPanel } from '../components/SandboxAgentAppPanel';\nimport { SandboxScriptRunnerPanel } from '../components/SandboxScriptRunnerPanel';\nimport { useSandbox } from '../providers/SandboxProvider';\nimport { useSandboxEvents } from '../utils/sandboxEvents';\nimport { PageLayout } from '../components/PageLayout';\nimport {\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n type NextStep,\n} from '@burdenoff/fe-libs/ui';\nimport { tWithFallback } from '../utils/i18n';\nimport type { Sandbox } from '../types';\nimport {\n useGetSandboxQuery,\n useGetSandboxLogsLazyQuery,\n useStopSandboxMutation,\n useDeleteSandboxMutation,\n useExtendSandboxTtlMutation,\n useOnSandboxStatusChangedSubscription,\n} from '../../generated/wspace-operations';\nimport {\n isNative,\n nativeCopyText,\n nativeImpact,\n nativeNotify,\n nativeToast,\n} from '../../utils/nativeBridge';\n\nfunction formatDateTime(isoString: string): string {\n return new Date(isoString).toLocaleString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nfunction formatTTL(seconds: number): string {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n if (hours > 0) return `${hours}h ${minutes}m`;\n return `${minutes}m`;\n}\n\nfunction formatTTLRemaining(expiresAt?: string): string | null {\n if (!expiresAt) return null;\n const remaining = new Date(expiresAt).getTime() - Date.now();\n if (remaining <= 0) return 'Expired';\n const hours = Math.floor(remaining / 3600000);\n const minutes = Math.floor((remaining % 3600000) / 60000);\n if (hours > 0) return `${hours}h ${minutes}m remaining`;\n return `${minutes}m remaining`;\n}\n\n/**\n * Module-scope copy button so React can preserve its instance between renders\n * of the parent page (previously defined inline, which destroyed local state on\n * every parent re-render).\n */\nfunction CopyButton({\n isCopied,\n onCopy,\n ariaLabel,\n}: {\n isCopied: boolean;\n onCopy: () => void;\n ariaLabel: string;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onCopy}\n className=\"p-1 rounded hover:bg-bg-sunken transition-colors\"\n aria-label={ariaLabel}\n >\n {isCopied ? (\n <CheckCircle2 size={14} className=\"text-status-success-text\" />\n ) : (\n <Copy size={14} className=\"text-text-secondary\" />\n )}\n </button>\n );\n}\n\nfunction CopyField({\n value,\n field,\n copiedField,\n onCopy,\n ariaLabel,\n}: {\n value: string;\n field: string;\n copiedField: string | null;\n onCopy: (value: string, field: string) => void;\n ariaLabel: string;\n}) {\n return (\n <CopyButton\n isCopied={copiedField === field}\n onCopy={() => onCopy(value, field)}\n ariaLabel={ariaLabel}\n />\n );\n}\n\n/**\n * Wraps content in the Boff UI 2.0 `ShowMore` progressive-disclosure primitive\n * only when `enabled` (e.g. long lists), otherwise renders children inline so we\n * never add a redundant \"Show more\" affordance to short content.\n */\nfunction MaybeShowMore({\n enabled,\n collapsedHeight,\n children,\n}: {\n enabled: boolean;\n collapsedHeight?: number;\n children: ReactNode;\n}) {\n if (!enabled) return <>{children}</>;\n return <ShowMore collapsedHeight={collapsedHeight}>{children}</ShowMore>;\n}\n\n/**\n * Sandbox Detail Page\n * Shows full sandbox information with actions\n */\nexport function SandboxDetailPage() {\n const { sandboxId } = useParams<{ sandboxId: string }>();\n const { basePath = '/', navigate, workspaceId } = useSandbox();\n const { t } = useI18n();\n const [copiedField, setCopiedField] = useState<string | null>(null);\n const [showExtendModal, setShowExtendModal] = useState(false);\n const [extendLoading, setExtendLoading] = useState(false);\n\n // Real GraphQL query\n const { data, loading, refetch } = useGetSandboxQuery({\n variables: { context: { workspaceId }, id: sandboxId! },\n skip: !sandboxId || !workspaceId,\n });\n\n // Live updates: server pushes status / TTL / deletion via the same Sandbox\n // entity, so Apollo cache normalization (key: id) auto-refreshes the page\n // without a refetch round-trip.\n useOnSandboxStatusChangedSubscription({\n variables: { workspaceId: workspaceId!, sandboxId: sandboxId! },\n skip: !sandboxId || !workspaceId,\n });\n\n const [stopSandbox] = useStopSandboxMutation();\n const [deleteSandbox] = useDeleteSandboxMutation();\n const [extendTTL] = useExtendSandboxTtlMutation();\n const sandboxEvents = useSandboxEvents();\n\n const sandbox = data?.getSandbox;\n\n const handleCopy = async (value: string, field: string) => {\n nativeImpact('light');\n const ok = await nativeCopyText(value);\n if (ok) {\n nativeNotify('success');\n if (isNative()) void nativeToast(`Copied ${field}`);\n setCopiedField(field);\n setTimeout(() => setCopiedField(null), 2000);\n } else {\n nativeNotify('error');\n }\n };\n\n const handleCopyField = (value: string, field: string) => {\n void handleCopy(value, field);\n };\n const copyAriaLabel = (field: string) =>\n tWithFallback(t, 'sandbox.detail.actions.copy.ariaLabel', 'Copy {field}', { field });\n\n if (loading) {\n return (\n <PageLayout showHeader={false}>\n <div className=\"flex items-center justify-center h-64\">\n <RefreshCw size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (!sandbox) {\n return (\n <PageLayout showHeader={false}>\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tWithFallback(t, 'sandbox.detail.notFound.message', 'Sandbox not found')}\n action={\n <Button variant=\"outline\" onClick={() => navigate?.(basePath)}>\n {tWithFallback(t, 'sandbox.detail.notFound.backButton', 'Back to Sandboxes')}\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n const isActive =\n sandbox.status === 'RUNNING' ||\n sandbox.status === 'PROVISIONING' ||\n sandbox.status === 'PENDING';\n const canStop = sandbox.status === 'RUNNING';\n const canDelete =\n sandbox.status === 'STOPPED' ||\n sandbox.status === 'ERROR' ||\n sandbox.status === 'EXPIRED' ||\n sandbox.status === 'FAILED';\n const canExtend = sandbox.status === 'RUNNING';\n\n // Secondary actions collapse into the overflow (\"More\") menu; Refresh stays\n // as the single primary CTA. Destructive Delete lives in the menu.\n const headerActions: CTAAction[] = [\n ...(canExtend\n ? [\n {\n label: tWithFallback(t, 'sandbox.detail.actions.extendTtl', 'Extend TTL'),\n onSelect: () => setShowExtendModal(true),\n icon: <Timer size={16} />,\n } as CTAAction,\n ]\n : []),\n ...(canStop\n ? [\n {\n label: tWithFallback(t, 'sandbox.detail.actions.stop', 'Stop'),\n onSelect: () =>\n void stopSandbox({\n variables: { context: { workspaceId }, id: sandbox.id },\n }).then(() => refetch()),\n icon: <StopCircle size={16} />,\n } as CTAAction,\n ]\n : []),\n ...(canDelete\n ? [\n {\n label: tWithFallback(t, 'sandbox.detail.actions.delete', 'Delete'),\n onSelect: () =>\n void deleteSandbox({\n variables: { context: { workspaceId }, id: sandbox.id },\n }).then(() => {\n navigate?.(basePath);\n }),\n icon: <Trash2 size={16} />,\n intent: 'destructive',\n } as CTAAction,\n ]\n : []),\n ];\n\n // Concrete, context-aware next actions so a new user isn't lost on this\n // multi-section detail page. Each step wires to a real handler/anchor and is\n // only offered when it actually applies to the current sandbox state.\n const nextSteps: NextStep[] = (\n [\n sandbox.network?.internalUrl && sandbox.status === 'RUNNING'\n ? {\n id: 'copy-url',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.copyUrl.label',\n 'Copy the internal URL to connect'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.copyUrl.desc',\n 'Use it to reach the running service from another sandbox or tool.'\n ),\n icon: <Network size={16} />,\n onClick: () => handleCopyField(sandbox.network!.internalUrl!, 'internalUrl'),\n }\n : null,\n sandbox.status === 'RUNNING'\n ? {\n id: 'run-script',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.runScript.label',\n 'Run a script inside the sandbox'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.runScript.desc',\n 'Execute a command or generated script, review the output, then promote it.'\n ),\n icon: <Terminal size={16} />,\n href: '#sandbox-script-runner',\n }\n : null,\n canExtend\n ? {\n id: 'extend-ttl',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.extendTtl.label',\n 'Extend the time-to-live'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.extendTtl.desc',\n 'Keep this sandbox alive longer before it auto-expires.'\n ),\n icon: <Timer size={16} />,\n onClick: () => setShowExtendModal(true),\n }\n : null,\n canStop\n ? {\n id: 'stop',\n label: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.stop.label',\n 'Stop the sandbox when you are done'\n ),\n description: tWithFallback(\n t,\n 'sandbox.detail.nextSteps.stop.desc',\n 'Frees up resources and concurrency for your workspace.'\n ),\n icon: <StopCircle size={16} />,\n onClick: () =>\n void stopSandbox({\n variables: { context: { workspaceId }, id: sandbox.id },\n }).then(() => refetch()),\n }\n : null,\n ] as (NextStep | null)[]\n ).filter((step): step is NextStep => step !== null);\n\n return (\n <PageLayout showHeader={false}>\n {/* Hero — the single emphasis zone: identity + status + lifecycle countdown */}\n <EmphasisPanel className=\"overflow-hidden bg-hero-mesh\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex items-center gap-3 min-w-0\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"flex size-11 flex-shrink-0 items-center justify-center rounded-lg hover:bg-bg-sunken/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border\"\n aria-label={tWithFallback(\n t,\n 'sandbox.detail.header.back.ariaLabel',\n 'Back to sandboxes'\n )}\n >\n <ArrowLeft size={20} />\n </button>\n <SandboxTypeIcon type={sandbox.template} size={28} />\n <div className=\"min-w-0\">\n <h1 className=\"truncate text-2xl sm:text-3xl font-bold\">{sandbox.name}</h1>\n <div className=\"flex flex-wrap items-center gap-2 mt-1\">\n <StatusBadge status={sandbox.status} size=\"md\" />\n <span className=\"text-sm text-text-secondary font-mono truncate\">{sandbox.id}</span>\n <CopyField\n value={sandbox.id}\n field=\"id\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('id')}\n />\n </div>\n </div>\n </div>\n\n {/* One primary CTA (Refresh); everything else in the overflow menu */}\n <CTAOverflowMenu\n className=\"flex-shrink-0\"\n primary={{\n label: tWithFallback(t, 'sandbox.detail.actions.refresh', 'Refresh'),\n onSelect: () => void refetch(),\n icon: <RefreshCw size={16} />,\n }}\n actions={headerActions}\n />\n </div>\n\n {sandbox.network?.internalUrl && sandbox.status === 'RUNNING' && (\n <div className=\"mt-4\">\n <Badge variant=\"outline\" className=\"gap-1.5 px-3 py-1.5 text-sm border-border-seam\">\n <Network size={14} />\n {sandbox.network.internalUrl}\n <CopyField\n value={sandbox.network.internalUrl}\n field=\"internalUrl\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('internalUrl')}\n />\n </Badge>\n </div>\n )}\n\n {/* Countdown Timer */}\n {sandbox.status === 'RUNNING' && sandbox.expiresAt && (\n <div className=\"mt-4\">\n <CountdownTimer\n expiresAt={sandbox.expiresAt}\n onExpired={() => refetch()}\n onExtend={() => setShowExtendModal(true)}\n />\n </div>\n )}\n </EmphasisPanel>\n\n <PagePurpose>\n {tWithFallback(\n t,\n 'sandbox.detail.purpose',\n 'This is the control room for a single sandbox — inspect its status, networking, containers, storage and live logs, run scripts inside it, extend its lifetime, or tear it down. Everything you do here is isolated to this one disposable environment.'\n )}\n </PagePurpose>\n\n {nextSteps.length > 0 && <NextSteps storageKey=\"sandbox-detail\" steps={nextSteps} />}\n\n {/* Description */}\n {sandbox.description && (\n <Card className=\"border-border-seam\">\n <CardContent className=\"p-5\">\n <div className=\"flex items-start gap-3\">\n <Info size={18} className=\"text-primary flex-shrink-0 mt-0.5\" />\n <p className=\"text-sm text-text-secondary leading-relaxed\">{sandbox.description}</p>\n </div>\n </CardContent>\n </Card>\n )}\n\n {/* Grid Layout for Details */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n {/* Resources */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <RefreshCw size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.resources.title', 'Resources')}\n </h3>\n <ResourceDisplay\n cpuRequest={sandbox.resources?.cpuRequest ?? '0'}\n cpuLimit={sandbox.resources?.cpuLimit}\n memoryRequest={sandbox.resources?.memoryRequest ?? '0'}\n memoryLimit={sandbox.resources?.memoryLimit}\n containerCount={sandbox.containers?.length}\n layout=\"grid\"\n />\n </div>\n </GlassCard>\n\n {/* Kubernetes Info */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Shield size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.title', 'Kubernetes')}\n </h3>\n <div className=\"space-y-3\">\n {sandbox.crdName && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.crdName', 'CRD Name')}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-mono\">{sandbox.crdName}</span>\n <CopyField\n value={sandbox.crdName}\n field=\"crdName\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('crdName')}\n />\n </div>\n </div>\n )}\n {sandbox.podName && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.podName', 'Pod Name')}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-mono\">{sandbox.podName}</span>\n <CopyField\n value={sandbox.podName}\n field=\"podName\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('podName')}\n />\n </div>\n </div>\n )}\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.kubernetes.namespace', 'Namespace')}\n </span>\n <span className=\"text-sm font-mono\">{sandbox.namespace}</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.runtimeClass',\n 'Runtime Class'\n )}\n </span>\n <Badge variant=\"secondary\" className=\"font-mono text-xs\">\n {sandbox.runtimeClass}\n </Badge>\n </div>\n {sandbox.network?.serviceName && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.serviceName',\n 'Service Name'\n )}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-mono\">{sandbox.network.serviceName}</span>\n <CopyField\n value={sandbox.network.serviceName}\n field=\"serviceName\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('serviceName')}\n />\n </div>\n </div>\n )}\n {sandbox.network?.internalUrl && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.internalUrl',\n 'Internal URL'\n )}\n </span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm text-primary font-mono truncate max-w-48\">\n {sandbox.network.internalUrl}\n </span>\n <CopyField\n value={sandbox.network.internalUrl}\n field=\"internalUrl\"\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel('internalUrl')}\n />\n </div>\n </div>\n )}\n {/* Per-container URLs for multi-container sandboxes */}\n {sandbox.network?.containerUrls &&\n typeof sandbox.network.containerUrls === 'object' &&\n Object.keys(sandbox.network.containerUrls).filter((k: string) => !k.includes(':'))\n .length > 1 && (\n <div className=\"mt-3 pt-3 border-t border-border-subtle/30\">\n <p className=\"text-xs font-semibold text-text-secondary mb-2\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.kubernetes.containerEndpoints',\n 'Container Endpoints'\n )}\n </p>\n <div className=\"space-y-1.5\">\n {Object.entries(\n sandbox.network.containerUrls as Record<string, string>\n ).reduce<ReactNode[]>((acc, [name, url]) => {\n if (name.includes(':')) return acc;\n acc.push(\n <div key={name} className=\"flex items-center justify-between\">\n <span className=\"text-xs text-text-secondary font-mono\">{name}</span>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-xs text-primary font-mono truncate max-w-40\">\n {url}\n </span>\n <CopyField\n value={url}\n field={`container-${name}`}\n copiedField={copiedField}\n onCopy={handleCopyField}\n ariaLabel={copyAriaLabel(`container-${name}`)}\n />\n </div>\n </div>\n );\n return acc;\n }, [])}\n </div>\n </div>\n )}\n </div>\n </div>\n </GlassCard>\n\n {/* Lifecycle */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Clock size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.title', 'Lifecycle')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.ttl', 'TTL')}\n </span>\n <span className=\"text-sm font-medium\">{formatTTL(sandbox.ttlSeconds)}</span>\n </div>\n {sandbox.expiresAt && isActive && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.expires', 'Expires')}\n </span>\n <Badge variant=\"outline\" className=\"gap-1\">\n <Timer size={12} />\n {formatTTLRemaining(sandbox.expiresAt)}\n </Badge>\n </div>\n )}\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.created', 'Created')}\n </span>\n <span className=\"text-sm\">{formatDateTime(sandbox.createdAt)}</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.updated', 'Updated')}\n </span>\n <span className=\"text-sm\">{formatDateTime(sandbox.updatedAt)}</span>\n </div>\n {sandbox.stoppedAt && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.lifecycle.stopped', 'Stopped')}\n </span>\n <span className=\"text-sm\">{formatDateTime(sandbox.stoppedAt)}</span>\n </div>\n )}\n </div>\n </div>\n </GlassCard>\n\n {/* Details */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Info size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.details.title', 'Details')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.template', 'Template')}\n </span>\n <SandboxTypeIcon type={sandbox.template} showLabel />\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.mode', 'Mode')}\n </span>\n <Badge variant=\"outline\" className=\"gap-1 text-xs font-mono\">\n {sandbox.mode === 'JOB' ? (\n <>\n <Play size={12} />{' '}\n {tWithFallback(t, 'sandbox.detail.cards.details.mode.job', 'Job')}\n </>\n ) : (\n <>\n <Cog size={12} />{' '}\n {tWithFallback(\n t,\n 'sandbox.detail.cards.details.mode.deployment',\n 'Deployment'\n )}\n </>\n )}\n </Badge>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.workspace', 'Workspace')}\n </span>\n <span className=\"text-sm font-mono\">{sandbox.workspaceId}</span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.details.createdBy', 'Created By')}\n </span>\n <span className=\"text-sm\">{sandbox.createdBy}</span>\n </div>\n </div>\n </div>\n </GlassCard>\n </div>\n\n {/* Containers */}\n {sandbox.containers && sandbox.containers.length > 0 && (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Container size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.containers.title', 'Containers')}\n <Badge variant=\"secondary\" className=\"ml-1\">\n {sandbox.containers.length}\n </Badge>\n </h3>\n <MaybeShowMore enabled={sandbox.containers.length > 4} collapsedHeight={220}>\n <div className=\"space-y-3\">\n {sandbox.containers.map((container: any, idx: number) => {\n const status = sandbox.containerStatuses?.find(\n (cs: any) => cs.name === container.name\n );\n return (\n <div\n key={container.name || idx}\n className=\"flex items-center justify-between p-3 rounded-lg border border-border-seam hover:bg-bg-sunken/30 transition-colors\"\n >\n <div className=\"flex items-center gap-3 min-w-0\">\n <div\n className={`w-2.5 h-2.5 rounded-full flex-shrink-0 ${\n status?.ready\n ? 'bg-status-success-text motion-safe:animate-vc-glow-pulse'\n : status\n ? 'bg-status-warning-text animate-pulse'\n : 'bg-text-tertiary'\n }`}\n />\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium\">{container.name}</p>\n <p className=\"text-xs text-text-secondary font-mono truncate\">\n {container.image}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n {container.ports?.map((p: any) => (\n <Badge\n key={p.containerPort}\n variant=\"outline\"\n className=\"text-xs font-mono\"\n >\n :{p.containerPort}\n {p.name ? ` (${p.name})` : ''}\n </Badge>\n ))}\n {status && (\n <Badge\n variant={status.ready ? 'default' : 'secondary'}\n className={`text-xs ${\n status.ready\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : ''\n }`}\n >\n {status.ready\n ? tWithFallback(\n t,\n 'sandbox.detail.cards.containers.status.ready',\n 'Ready'\n )\n : tWithFallback(\n t,\n 'sandbox.detail.cards.containers.status.notReady',\n 'Not Ready'\n )}\n </Badge>\n )}\n {status?.restartCount !== undefined && status.restartCount > 0 && (\n <Badge variant=\"outline\" className=\"text-xs text-status-warning-text\">\n {status.restartCount} restart{status.restartCount !== 1 ? 's' : ''}\n </Badge>\n )}\n </div>\n </div>\n );\n })}\n </div>\n </MaybeShowMore>\n </div>\n </GlassCard>\n )}\n\n {/* Storage */}\n {sandbox.storage && sandbox.storage.mode !== 'NONE' && (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"font-semibold mb-4 flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Database size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.cards.storage.title', 'Storage')}\n </h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.storage.mode', 'Mode')}\n </span>\n <Badge variant=\"outline\">\n {sandbox.storage.mode === 'EPHEMERAL'\n ? tWithFallback(t, 'sandbox.detail.cards.storage.ephemeral', 'Ephemeral')\n : tWithFallback(t, 'sandbox.detail.cards.storage.persistent', 'Persistent')}\n </Badge>\n </div>\n {sandbox.storage.sizeGi && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.storage.size', 'Size')}\n </span>\n <span className=\"text-sm font-medium\">{sandbox.storage.sizeGi} GiB</span>\n </div>\n )}\n {sandbox.storage.mountPath && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.detail.cards.storage.mountPath', 'Mount Path')}\n </span>\n <span className=\"text-sm font-mono\">{sandbox.storage.mountPath}</span>\n </div>\n )}\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'sandbox.detail.cards.storage.retainOnDelete',\n 'Retain on Delete'\n )}\n </span>\n <Badge variant={sandbox.storage.retainOnDelete ? 'default' : 'secondary'}>\n {sandbox.storage.retainOnDelete\n ? tWithFallback(t, 'sandbox.detail.cards.storage.retainYes', 'Yes')\n : tWithFallback(t, 'sandbox.detail.cards.storage.retainNo', 'No')}\n </Badge>\n </div>\n </div>\n </div>\n </GlassCard>\n )}\n\n {/* Error Message */}\n {sandbox.errorMessage && (\n <Card className=\"border-status-error-border/50 bg-status-error-bg/5\">\n <CardContent className=\"p-5\">\n <h3 className=\"font-semibold text-status-error-text mb-2 flex items-center gap-2\">\n <AlertCircle size={18} />\n {tWithFallback(t, 'sandbox.detail.cards.errorDetails.title', 'Error Details')}\n </h3>\n <p className=\"text-sm text-status-error-text/80 font-mono bg-status-error-bg/5 rounded-lg p-3\">\n {sandbox.errorMessage}\n </p>\n </CardContent>\n </Card>\n )}\n\n {/* Auto-registered Application (DevPortal) */}\n {(() => {\n const meta = (sandbox.metadata as Record<string, unknown> | null) ?? null;\n const appId = (meta?.devPortalApplicationId ?? meta?.appId) as string | undefined;\n const clientId = meta?.clientId as string | undefined;\n const clientSecret = meta?.clientSecretRevealOnce as string | undefined;\n if (!appId && !clientId) return null;\n return (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <SandboxAgentAppPanel appId={appId} clientId={clientId} clientSecret={clientSecret} />\n </div>\n </GlassCard>\n );\n })()}\n\n {/* Activity / audit feed scoped to this sandbox */}\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n {tWithFallback(t, 'sandbox.detail.cards.activity.title', 'Activity')}\n </h3>\n <SandboxActivityTab sandboxId={sandbox.id} workspaceId={workspaceId ?? ''} />\n </div>\n </GlassCard>\n\n {/* Container Logs */}\n <SandboxLogsPanel sandbox={sandbox} workspaceId={workspaceId ?? ''} />\n\n {/* Script Runner — run an AI-generated script in the sandbox, review, then promote */}\n <div id=\"sandbox-script-runner\">\n <SandboxScriptRunnerPanel sandbox={sandbox} workspaceId={workspaceId ?? ''} />\n </div>\n\n {/* Extend TTL Modal */}\n {sandbox.expiresAt && (\n <ExtendTTLModal\n isOpen={showExtendModal}\n onClose={() => setShowExtendModal(false)}\n currentExpiresAt={sandbox.expiresAt}\n isLoading={extendLoading}\n onExtend={(additionalSeconds) => {\n setExtendLoading(true);\n extendTTL({\n variables: {\n context: { workspaceId },\n id: sandbox.id,\n additionalSeconds,\n },\n })\n .then((res) => {\n const updated = res.data?.extendSandboxTTL;\n if (updated) {\n sandboxEvents.sandboxExtended({\n sandboxId: updated.id,\n addedSeconds: additionalSeconds,\n newExpiresAt: updated.expiresAt as unknown as string,\n });\n }\n refetch();\n })\n .catch((err) => {\n console.error('Failed to extend TTL:', err);\n })\n .finally(() => {\n setExtendLoading(false);\n setShowExtendModal(false);\n });\n }}\n />\n )}\n </PageLayout>\n );\n}\n\n/**\n * Real logs panel that fetches container logs via the getSandboxLogs query.\n */\nfunction SandboxLogsPanel({ sandbox, workspaceId }: { sandbox: any; workspaceId: string }) {\n const { t } = useI18n();\n const [selectedContainer, setSelectedContainer] = useState<string>(\n sandbox.containers?.[0]?.name ?? ''\n );\n const [tailLines, setTailLines] = useState(100);\n const logsEndRef = useRef<HTMLDivElement>(null);\n\n const [fetchLogs, { data: logsData, loading: logsLoading, error: logsError }] =\n useGetSandboxLogsLazyQuery();\n\n const canFetchLogs = sandbox.status === 'RUNNING' || sandbox.status === 'PROVISIONING';\n\n const handleFetchLogs = useCallback(() => {\n if (!selectedContainer || !canFetchLogs) return;\n fetchLogs({\n variables: {\n context: { workspaceId },\n id: sandbox.id,\n containerName: selectedContainer,\n tailLines,\n },\n });\n }, [fetchLogs, workspaceId, sandbox.id, selectedContainer, tailLines, canFetchLogs]);\n\n // Auto-fetch logs when container changes and sandbox is running\n useEffect(() => {\n if (canFetchLogs && selectedContainer) {\n handleFetchLogs();\n }\n }, [selectedContainer, canFetchLogs, handleFetchLogs]);\n\n // Scroll to bottom when new logs arrive\n useEffect(() => {\n logsEndRef.current?.scrollIntoView({ behavior: 'smooth' });\n }, [logsData]);\n\n const logLines = logsData?.getSandboxLogs?.split('\\n') ?? [];\n\n return (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <div className=\"p-5\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold flex items-center gap-2\">\n <div className=\"p-1.5 rounded-lg bg-action-primary-bg/10\">\n <Terminal size={14} className=\"text-primary\" />\n </div>\n {tWithFallback(t, 'sandbox.detail.logs.title', 'Logs')}\n </h3>\n <div className=\"flex items-center gap-2\">\n {/* Container selector */}\n {sandbox.containers && sandbox.containers.length > 1 && (\n <select\n value={selectedContainer}\n onChange={(e) => setSelectedContainer(e.target.value)}\n className=\"px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono\"\n >\n {sandbox.containers.map((c: any) => (\n <option key={c.name} value={c.name}>\n {c.name}\n </option>\n ))}\n </select>\n )}\n {/* Tail lines selector */}\n <select\n value={tailLines}\n onChange={(e) => setTailLines(Number(e.target.value))}\n className=\"px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono\"\n >\n <option value={50}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.50', '50 lines')}\n </option>\n <option value={100}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.100', '100 lines')}\n </option>\n <option value={500}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.500', '500 lines')}\n </option>\n <option value={1000}>\n {tWithFallback(t, 'sandbox.detail.logs.tailLines.1000', '1000 lines')}\n </option>\n </select>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleFetchLogs}\n disabled={!canFetchLogs || logsLoading}\n >\n <RefreshCw size={14} className={logsLoading ? 'animate-spin' : ''} />\n {tWithFallback(t, 'sandbox.detail.logs.refresh', 'Refresh')}\n </Button>\n {logLines.length > 0 && (\n <>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n nativeImpact('light');\n void nativeCopyText(logLines.join('\\n')).then((ok) => {\n if (ok) {\n nativeNotify('success');\n if (isNative()) void nativeToast('Copied logs');\n } else {\n nativeNotify('error');\n }\n });\n }}\n title={tWithFallback(\n t,\n 'sandbox.detail.logs.copy.title',\n 'Copy logs to clipboard'\n )}\n >\n <Copy size={14} />\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n const blob = new Blob([logLines.join('\\n')], { type: 'text/plain' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `sandbox-${sandbox.name}-logs.txt`;\n a.click();\n URL.revokeObjectURL(url);\n }}\n title={tWithFallback(t, 'sandbox.detail.logs.download.title', 'Download logs')}\n >\n <Download size={14} />\n </Button>\n </>\n )}\n </div>\n </div>\n\n <div className=\"bg-zinc-950 text-zinc-300 rounded-lg p-4 font-mono text-xs leading-relaxed min-h-[200px] max-h-[500px] overflow-y-auto\">\n {!canFetchLogs && (\n <p className=\"text-zinc-500\">\n {tWithFallback(\n t,\n 'sandbox.detail.logs.unavailable',\n 'Logs are available when the sandbox is running.'\n )}\n </p>\n )}\n {logsLoading && (\n <p className=\"text-zinc-500 animate-pulse\">\n {tWithFallback(t, 'sandbox.detail.logs.fetching', 'Fetching logs...')}\n </p>\n )}\n {logsError && (\n <p className=\"text-status-error-text\">\n {tWithFallback(\n t,\n 'sandbox.detail.logs.fetchError',\n 'Failed to fetch logs: {message}',\n { message: logsError.message }\n )}\n </p>\n )}\n {logLines.length > 0 && !logsLoading\n ? logLines.map((line: string, idx: number) => (\n <p\n key={`${idx}:${line}`}\n className={\n line.toLowerCase().includes('error')\n ? 'text-status-error-text'\n : line.toLowerCase().includes('warn')\n ? 'text-status-warning-text'\n : 'text-zinc-300'\n }\n >\n {line}\n </p>\n ))\n : !logsLoading &&\n canFetchLogs &&\n !logsError && (\n <p className=\"text-zinc-500\">\n {tWithFallback(\n t,\n 'sandbox.detail.logs.empty',\n 'No logs yet. Click Refresh to fetch.'\n )}\n </p>\n )}\n <div ref={logsEndRef} />\n </div>\n </div>\n </GlassCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsEA,SAAS,EAAe,GAA2B;AACjD,QAAO,IAAI,KAAK,EAAU,CAAC,eAAe,KAAA,GAAW;EACnD,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACT,CAAC;;AAGJ,SAAS,GAAU,GAAy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",
|
|
4
4
|
"description": "Burdenoff Sandbox Microfrontend - Manage ephemeral sandbox environments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "vite",
|
|
25
|
-
"build": "tsc && MFE_DTS=1 vite build",
|
|
25
|
+
"build": "tsc && MFE_DTS=1 bash scripts/build-limits.sh --gate vite build",
|
|
26
26
|
"lint": "eslint .",
|
|
27
27
|
"lint:sanity": "if [ \"${CI:-}\" = \"true\" ]; then bun run lint; else bun run lint -- --cache --cache-location .eslintcache; fi",
|
|
28
28
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
29
|
-
"type:check": "tsc --noEmit",
|
|
29
|
+
"type:check": "bash scripts/build-limits.sh tsc --noEmit",
|
|
30
30
|
"test": "bun test",
|
|
31
|
-
"sanity": "bun run codegen && bun run lint:sanity && bun run format && bun run type:check && bun run test && bun run build",
|
|
31
|
+
"sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run codegen && bun run lint:sanity && bun run format && bun run type:check && bun run test && bun run build'",
|
|
32
32
|
"schema:pull": "graphql-codegen --project schema-wspace && graphql-codegen --project schema-global",
|
|
33
33
|
"codegen": "graphql-codegen --project wspace && graphql-codegen --project global",
|
|
34
34
|
"codegen:all": "bun run schema:pull && bun run codegen",
|