{"version":3,"file":"RunInContainerSection.cjs","names":["useT","Spinner","AlertIcon","Button","Dialog","DialogContent","DialogHeader","DialogTitle","DialogDescription","DialogBody","DialogFooter","ShieldIcon","useRef","SettingsSection","SettingsSectionHeader","SettingsSectionTitle","SettingsSectionDescription","SettingsCard","SettingsRow","SettingsRowText","SettingsRowTitle","SettingsRowDescription","Switch","useStore","workspacesStore","runInContainerStore","useRailEntries","sessionsStore","runInContainerStateOf","runningContainerSessions","askRunInContainer","retryRunInContainer","cancelRunInContainer","confirmRunInContainer"],"sources":["../../../../src/web/features/settings/RunInContainerSection.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport {\n  AlertIcon,\n  Button,\n  Dialog,\n  DialogBody,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n  SettingsCard,\n  SettingsRow,\n  SettingsRowDescription,\n  SettingsRowText,\n  SettingsRowTitle,\n  SettingsSection,\n  SettingsSectionDescription,\n  SettingsSectionHeader,\n  SettingsSectionTitle,\n  ShieldIcon,\n  Spinner,\n  Switch,\n} from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { type RefObject, useRef } from 'react';\n\nimport type { SettingsRepository } from '../../../types/settings';\nimport {\n  askRunInContainer,\n  cancelRunInContainer,\n  confirmRunInContainer,\n  retryRunInContainer,\n  runInContainerStateOf,\n  runInContainerStore,\n  runningContainerSessions,\n  type RunInContainerDialog,\n  type RunInContainerState,\n  type RunningContainerSession,\n} from '../../stores/runInContainerStore';\nimport { sessionsStore, useRailEntries } from '../../stores/sessionsStore';\nimport { workspacesStore } from '../../stores/workspacesStore';\n\n/**\n * The per-workspace \"Run in container\" switch under Defaults. The View is the\n * approved design and takes everything as props; the Section connects it to the\n * hub workspace feed, the session list, and PATCH /api/workspaces/:id.\n */\n\nconst SWITCH_ID = 'run-in-container';\nconst HELP_ID = 'run-in-container-help';\nconst STATUS_ID = 'run-in-container-status';\n\n/** The status line under the help text: silent when off, a calm reason when unavailable, red only on failure. */\nfunction ContainerStatus({ state, onRetry }: { state: RunInContainerState; onRetry: () => void }) {\n  const t = useT();\n  switch (state.kind) {\n    case 'off':\n      return null;\n    case 'on':\n      return (\n        <p id={STATUS_ID} className=\"basis-full text-sm leading-relaxed text-po-dim\">\n          {t(\n            'webDashboard.settings.container.on',\n            'On. New sessions start in the container. Sessions already running stay on this computer until they close. Run',\n          )}{' '}\n          <code className=\"font-mono\">/po-sandbox</code>{' '}\n          {t('webDashboard.settings.container.onCheck', 'in a session to check where it runs.')}\n        </p>\n      );\n    case 'unavailable':\n      return (\n        <p\n          id={STATUS_ID}\n          data-testid=\"run-in-container-unavailable\"\n          className=\"basis-full rounded-md border border-po-border-soft bg-po-deep px-3 py-2 text-sm leading-relaxed text-po-text\"\n        >\n          {t('webDashboard.settings.container.unavailable', 'Not available on this computer right now.')} {state.reason}\n        </p>\n      );\n    case 'on-unavailable':\n      return (\n        <p\n          id={STATUS_ID}\n          data-testid=\"run-in-container-paused\"\n          className=\"basis-full rounded-md border border-po-border-soft bg-po-deep px-3 py-2 text-sm leading-relaxed text-po-text\"\n        >\n          {t('webDashboard.settings.container.paused', 'Container sessions are paused on this computer.')}{' '}\n          {state.reason} {t('webDashboard.settings.container.pausedEnd', 'New sessions cannot start until it is back.')}\n        </p>\n      );\n    case 'starting':\n    case 'stopping':\n      return (\n        <p id={STATUS_ID} className=\"flex basis-full items-center gap-2 text-sm leading-relaxed text-po-dim\">\n          <Spinner\n            label={\n              state.kind === 'starting'\n                ? t('webDashboard.settings.container.startingLabel', 'Starting the container')\n                : t('webDashboard.settings.container.stoppingLabel', 'Stopping the container')\n            }\n          />\n          {state.kind === 'starting'\n            ? t('webDashboard.settings.container.starting', 'Starting the container…')\n            : t(\n                'webDashboard.settings.container.stopping',\n                'Stopping the container and moving sessions back to this computer…',\n              )}\n        </p>\n      );\n    case 'error':\n      return (\n        <div\n          id={STATUS_ID}\n          role=\"alert\"\n          data-testid=\"run-in-container-error\"\n          className=\"flex basis-full flex-col items-start gap-2 rounded-md border border-po-edge-red bg-po-tint-red px-3 py-2 sm:flex-row sm:items-center sm:gap-3\"\n        >\n          <p className=\"flex min-w-0 flex-1 items-start gap-2 text-sm leading-relaxed text-po-text\">\n            <AlertIcon aria-hidden className=\"mt-0.5 size-3.5 shrink-0 text-po-red\" />\n            {/* A reason that already names Help mode keeps its own next step. */}\n            <span>\n              {state.message.includes('Help mode')\n                ? state.message\n                : t(\n                    'webDashboard.settings.container.troubleshoot',\n                    '{message} Turn on Help mode and ask Po to troubleshoot the sandbox.',\n                    {\n                      message: state.message,\n                    },\n                  )}\n            </span>\n          </p>\n          <Button variant=\"outline\" size=\"xs\" data-testid=\"run-in-container-retry\" onClick={onRetry}>\n            {t('webDashboard.settings.container.retry', 'Try again')}\n          </Button>\n        </div>\n      );\n  }\n}\n\n/** The dialogs have no trigger, so closing hands focus back to the switch explicitly. */\nexport function returnFocusTo(target: RefObject<HTMLButtonElement | null>) {\n  return (event: Event) => {\n    event.preventDefault();\n    target.current?.focus();\n  };\n}\n\ninterface ConfirmProps {\n  workspaceName: string;\n  returnFocus: RefObject<HTMLButtonElement | null>;\n  onCancel: () => void;\n  onConfirm: () => void;\n}\n\nfunction ConfirmOnDialog({ workspaceName, returnFocus, onCancel, onConfirm }: ConfirmProps) {\n  const t = useT();\n  return (\n    <Dialog open onOpenChange={(open) => (open ? undefined : onCancel())}>\n      <DialogContent data-testid=\"run-in-container-confirm-on\" onCloseAutoFocus={returnFocusTo(returnFocus)}>\n        <DialogHeader className=\"flex-col items-start gap-1\">\n          <DialogTitle>\n            {t('webDashboard.settings.container.confirmOnTitle', 'Run {name} in a container?', { name: workspaceName })}\n          </DialogTitle>\n          <DialogDescription>\n            {t(\n              'webDashboard.settings.container.confirmOnDescription',\n              'New sessions in this workspace will start inside a container on this computer.',\n            )}\n          </DialogDescription>\n        </DialogHeader>\n        <DialogBody>\n          <p className=\"text-base leading-relaxed text-po-text\">\n            {t(\n              'webDashboard.settings.container.confirmOnSaved',\n              'Saved sessions of this workspace move into the container, so you can resume them there.',\n            )}\n          </p>\n          <p className=\"text-base leading-relaxed text-po-text\">\n            {t(\n              'webDashboard.settings.container.confirmOnRunning',\n              'Sessions still running on this computer keep running here. Each one moves when it closes.',\n            )}\n          </p>\n          <p className=\"text-sm leading-relaxed text-po-dim\">\n            {t(\n              'webDashboard.settings.container.confirmOnData',\n              'Conversations and artifacts stay on this computer. Credentials stay with Po on the host.',\n            )}\n          </p>\n        </DialogBody>\n        <DialogFooter className=\"flex-wrap px-3 pb-3 sm:px-4 sm:pb-4\">\n          <Button variant=\"outline\" data-testid=\"run-in-container-cancel\" onClick={onCancel}>\n            {t('webDashboard.settings.container.cancel', 'Cancel')}\n          </Button>\n          <Button variant=\"primary\" data-testid=\"run-in-container-confirm\" onClick={onConfirm}>\n            {t('webDashboard.settings.container.run', 'Run in container')}\n          </Button>\n        </DialogFooter>\n      </DialogContent>\n    </Dialog>\n  );\n}\n\nfunction RunningSessionList({ sessions }: { sessions: readonly RunningContainerSession[] }) {\n  const t = useT();\n  return (\n    <ul\n      aria-label={t('webDashboard.settings.container.runningSessions', 'Running container sessions')}\n      className=\"flex flex-col divide-y divide-po-border-soft rounded-md border border-po-border-soft\"\n    >\n      {sessions.map((session) => (\n        <li key={session.id} className=\"flex min-w-0 items-center justify-between gap-3 px-3 py-2\">\n          <span className=\"min-w-0 truncate text-base text-po-text\">{session.name}</span>\n          <span className=\"shrink-0 text-sm text-po-dim first-letter:uppercase\">{session.status}</span>\n        </li>\n      ))}\n    </ul>\n  );\n}\n\nfunction ConfirmOffDialog({\n  workspaceName,\n  sessions,\n  returnFocus,\n  onCancel,\n  onConfirm,\n}: ConfirmProps & { sessions: readonly RunningContainerSession[] }) {\n  const t = useT();\n  const running = sessions.length > 0;\n  return (\n    <Dialog open onOpenChange={(open) => (open ? undefined : onCancel())}>\n      <DialogContent data-testid=\"run-in-container-confirm-off\" onCloseAutoFocus={returnFocusTo(returnFocus)}>\n        <DialogHeader className=\"flex-col items-start gap-1\">\n          <DialogTitle>\n            {t('webDashboard.settings.container.confirmOffTitle', 'Stop running {name} in a container?', {\n              name: workspaceName,\n            })}\n          </DialogTitle>\n          <DialogDescription>\n            {!running\n              ? t(\n                  'webDashboard.settings.container.confirmOffIdle',\n                  'Everything moves back to this computer, and you can resume its sessions here.',\n                )\n              : sessions.length === 1\n                ? t(\n                    'webDashboard.settings.container.confirmOffOne',\n                    'One session is running in the container. Turning this off stops them, and their current turns are interrupted.',\n                  )\n                : t(\n                    'webDashboard.settings.container.confirmOffMany',\n                    '{count} sessions are running in the container. Turning this off stops them, and their current turns are interrupted.',\n                    { count: sessions.length },\n                  )}\n          </DialogDescription>\n        </DialogHeader>\n        <DialogBody>\n          {running ? (\n            <>\n              <RunningSessionList sessions={sessions} />\n              <p className=\"text-base leading-relaxed text-po-text\">\n                {t(\n                  'webDashboard.settings.container.confirmOffThen',\n                  'Then everything moves back to this computer, and you can resume those sessions here.',\n                )}\n              </p>\n            </>\n          ) : null}\n          <p className=\"flex items-start gap-2 rounded-md border border-po-border-soft bg-po-deep px-3 py-2 text-sm leading-relaxed text-po-text\">\n            <ShieldIcon aria-hidden className=\"mt-0.5 size-3.5 shrink-0 text-po-dim\" />\n            <span>\n              {t(\n                'webDashboard.settings.container.confirmOffTrust',\n                'Switching off means trusting what this workspace produced while it was contained: its files, settings, and conversations.',\n              )}\n            </span>\n          </p>\n        </DialogBody>\n        <DialogFooter className=\"flex-wrap px-3 pb-3 sm:px-4 sm:pb-4\">\n          <Button variant=\"outline\" data-testid=\"run-in-container-cancel\" onClick={onCancel}>\n            {t('webDashboard.settings.container.keep', 'Keep in container')}\n          </Button>\n          {/* Rose (secondary): switching off is the person's own choice, a gentle ask; red stays for real failures. */}\n          <Button variant=\"secondary\" data-testid=\"run-in-container-confirm\" onClick={onConfirm}>\n            {running\n              ? t('webDashboard.settings.container.stopAndMove', 'Stop and move back')\n              : t('webDashboard.settings.container.switchOff', 'Switch off')}\n          </Button>\n        </DialogFooter>\n      </DialogContent>\n    </Dialog>\n  );\n}\n\nexport interface RunInContainerViewProps {\n  workspaceName: string;\n  state: RunInContainerState;\n  dialog?: RunInContainerDialog;\n  /** Listed by the off dialog; none switches it to the idle copy. */\n  runningSessions?: readonly RunningContainerSession[];\n  onCheckedChange?: (checked: boolean) => void;\n  onRetry?: () => void;\n  onCancel?: () => void;\n  onConfirm?: () => void;\n}\n\nconst NONE: readonly RunningContainerSession[] = [];\nconst ignore = (): void => undefined;\n\n/**\n * The one row and its confirmations. The switch shows the target while it\n * applies and is described by both the help and the status. Busy stays\n * focusable (aria-disabled) so a closing dialog can still hand focus back to\n * it; unavailable is natively disabled because nothing here can change it.\n */\nexport function RunInContainerView({\n  workspaceName,\n  state,\n  dialog,\n  runningSessions = NONE,\n  onCheckedChange = ignore,\n  onRetry = ignore,\n  onCancel = ignore,\n  onConfirm = ignore,\n}: RunInContainerViewProps) {\n  const t = useT();\n  const switchRef = useRef<HTMLButtonElement>(null);\n  const checked = state.kind === 'on' || state.kind === 'starting' || state.kind === 'on-unavailable';\n  const busy = state.kind === 'starting' || state.kind === 'stopping';\n  const disabled = state.kind === 'unavailable' || state.kind === 'on-unavailable';\n  const described = state.kind === 'off' ? HELP_ID : `${HELP_ID} ${STATUS_ID}`;\n  return (\n    <SettingsSection data-testid=\"run-in-container\">\n      <SettingsSectionHeader>\n        <SettingsSectionTitle>{t('webDashboard.settings.container.title', 'Where sessions run')}</SettingsSectionTitle>\n        <SettingsSectionDescription>\n          {t('webDashboard.settings.container.description', 'Applies to new sessions in this workspace.')}\n        </SettingsSectionDescription>\n      </SettingsSectionHeader>\n      <SettingsCard>\n        <SettingsRow\n          data-state={state.kind}\n          changed={state.kind === 'on' || state.kind === 'on-unavailable'}\n          className=\"items-start\"\n        >\n          <SettingsRowText className=\"gap-1\">\n            <SettingsRowTitle className=\"flex min-h-6 items-center\">\n              <label htmlFor={SWITCH_ID}>{t('webDashboard.settings.container.run', 'Run in container')}</label>\n            </SettingsRowTitle>\n            <SettingsRowDescription id={HELP_ID}>\n              {t(\n                'webDashboard.settings.container.help',\n                'New sessions run inside a container on this computer. Conversations and artifacts stay here, and credentials stay with Po on the host. It needs Docker running and the Po container runtime. To set it up, turn on Help mode and ask Po.',\n              )}\n            </SettingsRowDescription>\n          </SettingsRowText>\n          {/* ponytail: Switch has no tone prop and is always jade, which fits Po's own work here; add a tone prop to the shared Switch if a rose preference switch is ever needed. */}\n          <Switch\n            ref={switchRef}\n            id={SWITCH_ID}\n            data-testid=\"run-in-container-switch\"\n            checked={checked}\n            disabled={disabled}\n            aria-disabled={busy || undefined}\n            aria-busy={busy || undefined}\n            aria-describedby={described}\n            onCheckedChange={(next) => (busy ? undefined : onCheckedChange(next))}\n            className=\"mt-1 aria-disabled:pointer-events-none aria-disabled:opacity-40\"\n          />\n          <ContainerStatus state={state} onRetry={onRetry} />\n        </SettingsRow>\n      </SettingsCard>\n      {dialog === 'on' ? (\n        <ConfirmOnDialog\n          workspaceName={workspaceName}\n          returnFocus={switchRef}\n          onCancel={onCancel}\n          onConfirm={onConfirm}\n        />\n      ) : null}\n      {dialog === 'off' ? (\n        <ConfirmOffDialog\n          workspaceName={workspaceName}\n          sessions={runningSessions}\n          returnFocus={switchRef}\n          onCancel={onCancel}\n          onConfirm={onConfirm}\n        />\n      ) : null}\n    </SettingsSection>\n  );\n}\n\n/** Connected to the live workspace feed; renders nothing until the hub lists the workspace. */\nexport function RunInContainerSection({ repository }: { repository: SettingsRepository }) {\n  const workspaceId = repository.id;\n  const workspace = useStore(workspacesStore, (state) => state.byId[workspaceId]);\n  const local = useStore(runInContainerStore(workspaceId));\n  const sessions = useRailEntries();\n  const order = useStore(sessionsStore, (state) => state.order);\n  if (workspace === undefined) return null;\n  const state = runInContainerStateOf(workspace, local);\n  return (\n    <RunInContainerView\n      workspaceName={repository.name}\n      state={state}\n      dialog={local.dialog}\n      runningSessions={\n        local.dialog === 'off' ? runningContainerSessions(sessions, order, workspaceId, Date.now()) : NONE\n      }\n      onCheckedChange={(checked) => askRunInContainer(workspaceId, checked)}\n      onRetry={() => void retryRunInContainer(workspaceId)}\n      onCancel={() => cancelRunInContainer(workspaceId)}\n      onConfirm={() => void confirmRunInContainer(workspaceId)}\n    />\n  );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiDA,MAAM,YAAY;AAClB,MAAM,UAAU;AAChB,MAAM,YAAY;;AAGlB,SAAS,gBAAgB,EAAE,OAAO,WAAgE;CAChG,MAAM,KAAA,GAAIA,uBAAAA,KAAAA,CAAK;CACf,QAAQ,MAAM,MAAd;EACE,KAAK,OACH,OAAO;EACT,KAAK,MACH,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;GAAG,IAAI;GAAW,WAAU;GAA5B,UAAA;IACG,EACC,sCACA,+GACF;IAAG;IACH,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,WAAU;KAAY,UAAA;IAAiB,CAAA;IAAE;IAC9C,EAAE,2CAA2C,sCAAsC;GACnF;;EAEP,KAAK,eACH,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;GACE,IAAI;GACJ,eAAY;GACZ,WAAU;GAHZ,UAAA;IAKG,EAAE,+CAA+C,2CAA2C;IAAE;IAAE,MAAM;GACtG;;EAEP,KAAK,kBACH,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;GACE,IAAI;GACJ,eAAY;GACZ,WAAU;GAHZ,UAAA;IAKG,EAAE,0CAA0C,iDAAiD;IAAG;IAChG,MAAM;IAAO;IAAE,EAAE,6CAA6C,6CAA6C;GAC3G;;EAEP,KAAK;EACL,KAAK,YACH,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;GAAG,IAAI;GAAW,WAAU;GAA5B,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,6BAAAA,SAAD,EACE,OACE,MAAM,SAAS,aACX,EAAE,iDAAiD,wBAAwB,IAC3E,EAAE,iDA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