{"version":3,"file":"railDialogStore.mjs","names":[],"sources":["../../../src/web/stores/railDialogStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport { defaultHostId, splitHostId } from '../lib/hostIdentity';\nimport {\n  addCoordinator,\n  createGeneralSessionRequest,\n  createProfile,\n  type CreateProfileInput,\n  createWorkspaceSession,\n  restartSession,\n  moveSession,\n  restoreRemovedSession,\n  resumeSession,\n  resumeWorkspaceSession,\n} from '../lib/hubApi';\nimport type { RailRestartState } from '../lib/sessionRailModel';\nimport { applySessionUpsert, sessionsStore, waitForSession } from './sessionsStore';\nimport { applyWorkspaceUpsert } from './workspacesStore';\n\n/** Which history the resume dialog browses: one session's, or a whole workspace's. */\nexport type ResumeTarget = { sessionId: string } | { workspaceId: string };\n\n/** Dialog selection survives replacement of the dashboard app. */\nexport interface RailDialogState {\n  resume: ResumeTarget | null;\n  sharing: string | null;\n  move: { sessionId: string; pending: boolean; error: string } | null;\n  /** The add-bot dialog. Its state keeps the coordinator name from when it only created coordinators. */\n  coordinator: {\n    workspaceId?: string;\n    hostId?: string;\n    profile?: string;\n    actAsCoordinator?: boolean;\n    pending: boolean;\n    editingProfile?: boolean;\n    profileDraft?: CreateProfileInput;\n    profileRevision?: number;\n    error: string;\n  } | null;\n}\n\nconst initialState: RailDialogState = { resume: null, coordinator: null, move: null, sharing: null };\n\nexport const railDialogStore = new Store<RailDialogState>(initialState);\n\nexport function openSessionSharing(sessionId: string): void {\n  railDialogStore.setState((state) => ({ ...state, sharing: sessionId }));\n}\nexport function closeSessionSharing(): void {\n  railDialogStore.setState((state) => ({ ...state, sharing: null }));\n}\nexport function openResumeDialog(target: ResumeTarget): void {\n  if (resumeDraftStore.state.busy) return;\n  resumeDraftStore.setState(() => EMPTY_RESUME_DRAFT);\n  railDialogStore.setState((state) => ({ ...state, resume: target }));\n}\n\nexport function closeResumeDialog(): void {\n  if (resumeDraftStore.state.busy) return;\n  railDialogStore.setState((state) => (state.resume === null ? state : { ...state, resume: null }));\n  resumeDraftStore.setState(() => EMPTY_RESUME_DRAFT);\n}\n\n/** Opens the add-bot dialog for Home without a workspace id, else for that workspace. Capture the destination now, not after a filter or host changes. */\nexport async function addDashboardCoordinator(workspaceId?: string, hostId?: string): Promise<undefined> {\n  if (railDialogStore.state.coordinator?.pending) return undefined;\n  const target = {\n    workspaceId,\n    hostId: hostId ?? (workspaceId === undefined ? defaultHostId() : splitHostId(workspaceId)?.hostId),\n  };\n  railDialogStore.setState((state) => ({ ...state, coordinator: { ...target, pending: false, error: '' } }));\n  return undefined;\n}\n\nexport function closeCoordinatorProfile(): void {\n  railDialogStore.setState((state) => (state.coordinator?.pending ? state : { ...state, coordinator: null }));\n}\n\nexport function setCoordinatorProfile(profile: string | undefined): void {\n  railDialogStore.setState((state) =>\n    !state.coordinator || state.coordinator.pending\n      ? state\n      : {\n          ...state,\n          coordinator: { ...state.coordinator, profile, error: '' },\n        },\n  );\n}\n\nexport function setBotActAsCoordinator(actAsCoordinator: boolean): void {\n  railDialogStore.setState((state) =>\n    !state.coordinator || state.coordinator.pending\n      ? state\n      : { ...state, coordinator: { ...state.coordinator, actAsCoordinator, error: '' } },\n  );\n}\nexport function setCoordinatorProfileForm(open: boolean): void {\n  railDialogStore.setState((state) => {\n    const draft = state.coordinator;\n    if (!draft || draft.pending) return state;\n    return {\n      ...state,\n      coordinator: {\n        ...draft,\n        editingProfile: open,\n        profileDraft: draft.profileDraft ?? { displayName: '', alias: '', preset: 'focused' },\n        error: '',\n      },\n    };\n  });\n}\n\nexport function updateCoordinatorProfileDraft(profileDraft: CreateProfileInput): void {\n  railDialogStore.setState((state) =>\n    !state.coordinator?.editingProfile || state.coordinator.pending\n      ? state\n      : { ...state, coordinator: { ...state.coordinator, profileDraft, error: '' } },\n  );\n}\n\n/** Keep the saved alias, but let the destination catalog confirm that it can launch there. */\nexport async function saveCoordinatorProfile(): Promise<void> {\n  const draft = railDialogStore.state.coordinator;\n  if (!draft?.editingProfile || !draft.profileDraft || draft.pending) return;\n  railDialogStore.setState((state) => ({ ...state, coordinator: { ...draft, pending: true, error: '' } }));\n  const hostId = draft.hostId ?? (draft.workspaceId === undefined ? undefined : splitHostId(draft.workspaceId)?.hostId);\n  const result = await createProfile(draft.profileDraft, hostId);\n  railDialogStore.setState((state) => ({\n    ...state,\n    coordinator:\n      'error' in result\n        ? { ...draft, pending: false, error: result.error }\n        : {\n            ...draft,\n            pending: false,\n            error: '',\n            editingProfile: false,\n            profile: result.name,\n            profileRevision: (draft.profileRevision ?? 0) + 1,\n          },\n  }));\n}\n\n/**\n * A coordinator bot goes through the coordinator route; any other bot is a plain session with that profile.\n * `coordinatorBlocked` is the reason shown at submit time, so a stale opt-in never asks for a second coordinator.\n */\nexport async function createBotWithProfile(coordinatorBlocked?: string): Promise<void> {\n  const draft = railDialogStore.state.coordinator;\n  if (!draft?.profile || draft.pending || draft.editingProfile) return;\n  railDialogStore.setState((state) => ({ ...state, coordinator: { ...draft, pending: true, error: '' } }));\n  const selection = { profile: draft.profile };\n  // Only this person's Create bot action marks the session; the host records it, never the agent.\n  const bot = true as const;\n  const result =\n    draft.actAsCoordinator && !coordinatorBlocked\n      ? await addCoordinator(draft.workspaceId, draft.hostId, draft.profile, bot)\n      : draft.workspaceId === undefined\n        ? await createGeneralSessionRequest({ selection, bot }, draft.hostId)\n        : await createWorkspaceSession(draft.workspaceId, { selection, bot });\n  if (!('error' in result)) {\n    const hostId = draft.workspaceId === undefined ? draft.hostId : splitHostId(draft.workspaceId)?.hostId;\n    if ('workspace' in result && result.workspace !== undefined)\n      applyWorkspaceUpsert({ workspace: result.workspace }, hostId);\n    if ('session' in result && result.session !== undefined) applySessionUpsert({ session: result.session }, hostId);\n  }\n  railDialogStore.setState((state) => ({\n    ...state,\n    coordinator: 'error' in result ? { ...draft, pending: false, error: result.error } : null,\n  }));\n}\n/** The resume dialog's two lists: saved history, or sessions removed in the last 7 days. */\nexport type ResumeView = 'history' | 'removed';\n\nexport interface ResumeDraft {\n  view: ResumeView;\n  query: string;\n  selectedId: string | null;\n  resumedId?: string;\n  busy: boolean;\n  error: string;\n}\nconst EMPTY_RESUME_DRAFT: ResumeDraft = { view: 'history', query: '', selectedId: null, busy: false, error: '' };\nexport const resumeDraftStore = new Store<ResumeDraft>(EMPTY_RESUME_DRAFT);\nexport const railRestartStore = new Store<Record<string, RailRestartState>>({});\n\nexport function updateResumeDraft(update: Partial<Pick<ResumeDraft, 'query' | 'selectedId'>>): void {\n  if (resumeDraftStore.state.busy) return;\n  resumeDraftStore.setState((state) => ({\n    ...state,\n    ...update,\n    ...(update.selectedId === undefined ? {} : { resumedId: undefined }),\n  }));\n}\n\n/** Switching lists keeps the search text and drops a selection and error that belonged to the other list. */\nexport function setResumeView(view: ResumeView): void {\n  if (resumeDraftStore.state.busy) return;\n  resumeDraftStore.setState((state) =>\n    state.view === view ? state : { ...state, view, selectedId: null, resumedId: undefined, error: '' },\n  );\n}\n\n/**\n * Returns a removed session to History and selects it there, so the person\n * resumes it the usual way. A refusal lands in the dialog's error slot.\n */\nexport async function restoreRemovedThread(workspaceId: string, threadId: string): Promise<boolean> {\n  if (resumeDraftStore.state.busy) return false;\n  resumeDraftStore.setState((state) => ({ ...state, busy: true, error: '' }));\n  try {\n    const result = await restoreRemovedSession(workspaceId, threadId);\n    if ('error' in result) {\n      resumeDraftStore.setState((state) => ({ ...state, error: result.error }));\n      return false;\n    }\n    resumeDraftStore.setState((state) => ({ ...state, view: 'history', selectedId: threadId, resumedId: undefined }));\n    return true;\n  } finally {\n    resumeDraftStore.setState((state) => ({ ...state, busy: false }));\n  }\n}\n\nexport async function resumeDashboardSession(target: ResumeTarget): Promise<string | undefined> {\n  const draft = resumeDraftStore.state;\n  if (draft.busy || draft.selectedId === null || (!draft.resumedId && sessionsStore.state.byId[draft.selectedId]))\n    return;\n  resumeDraftStore.setState((state) => ({ ...state, busy: true, error: '' }));\n  try {\n    let sessionId = draft.resumedId;\n    if (sessionId === undefined) {\n      const result =\n        'workspaceId' in target\n          ? await resumeWorkspaceSession(target.workspaceId, draft.selectedId)\n          : await resumeSession(target.sessionId, draft.selectedId);\n      if ('error' in result) throw new Error(result.error);\n      sessionId = result.sessionId;\n      resumeDraftStore.setState((state) => ({ ...state, resumedId: sessionId }));\n      if (result.session !== undefined) applySessionUpsert({ session: result.session });\n    }\n    if (!(await waitForSession(sessionId)))\n      throw new Error('The thread resumed but has not appeared yet; it will show up in the rail.');\n    return sessionId;\n  } catch (cause) {\n    resumeDraftStore.setState((state) => ({ ...state, error: cause instanceof Error ? cause.message : String(cause) }));\n    return undefined;\n  } finally {\n    resumeDraftStore.setState((state) => ({ ...state, busy: false }));\n  }\n}\n\nexport async function restartDashboardSession(sessionId: string): Promise<void> {\n  if (railRestartStore.state[sessionId]?.restarting) return;\n  railRestartStore.setState((state) => ({ ...state, [sessionId]: { restarting: true } }));\n  try {\n    const result = await restartSession(sessionId);\n    if ('error' in result) throw new Error(result.error);\n    // The hub replaced the socket and may have rebuilt the app. Reload both together.\n    globalThis.location.reload();\n  } catch (cause) {\n    railRestartStore.setState((state) => ({\n      ...state,\n      [sessionId]: { restarting: false, error: cause instanceof Error ? cause.message : String(cause) },\n    }));\n  }\n}\n\n/** Test seam. */\nexport function resetRailDialogStore(): void {\n  railDialogStore.setState(() => initialState);\n  resumeDraftStore.setState(() => EMPTY_RESUME_DRAFT);\n  railRestartStore.setState(() => ({}));\n}\n\nexport function openMoveSessionDialog(sessionId: string): void {\n  if (railDialogStore.state.move?.pending) return;\n  railDialogStore.setState((state) => ({ ...state, move: { sessionId, pending: false, error: '' } }));\n}\n\nexport function closeMoveSessionDialog(): void {\n  railDialogStore.setState((state) => (state.move?.pending ? state : { ...state, move: null }));\n}\n\nexport async function moveDashboardSession(workspaceId: string): Promise<void> {\n  const draft = railDialogStore.state.move;\n  if (!draft || draft.pending) return;\n  railDialogStore.setState((state) => ({ ...state, move: { ...draft, pending: true, error: '' } }));\n  try {\n    const result = await moveSession(draft.sessionId, workspaceId);\n    if ('error' in result) throw new Error(result.error);\n    // As with restart, refresh the socket and the rebuilt workspace app together.\n    globalThis.location.reload();\n  } catch (cause) {\n    railDialogStore.setState((state) => ({\n      ...state,\n      move: { ...draft, pending: false, error: cause instanceof Error ? cause.message : String(cause) },\n    }));\n  }\n}\n"],"mappings":";;;;;;AAyCA,MAAM,eAAgC;CAAE,QAAQ;CAAM,aAAa;CAAM,MAAM;CAAM,SAAS;AAAK;AAEnG,MAAa,kBAAkB,IAAI,MAAuB,YAAY;AAEtE,SAAgB,mBAAmB,WAAyB;CAC1D,gBAAgB,UAAU,WAAW;EAAE,GAAG;EAAO,SAAS;CAAU,EAAE;AACxE;AACA,SAAgB,sBAA4B;CAC1C,gBAAgB,UAAU,WAAW;EAAE,GAAG;EAAO,SAAS;CAAK,EAAE;AACnE;AACA,SAAgB,iBAAiB,QAA4B;CAC3D,IAAI,iBAAiB,MAAM,MAAM;CACjC,iBAAiB,eAAe,kBAAkB;CAClD,gBAAgB,UAAU,WAAW;EAAE,GAAG;EAAO,QAAQ;CAAO,EAAE;AACpE;AAEA,SAAgB,oBAA0B;CACxC,IAAI,iBAAiB,MAAM,MAAM;CACjC,gBAAgB,UAAU,UAAW,MAAM,WAAW,OAAO,QAAQ;EAAE,GAAG;EAAO,QAAQ;CAAK,CAAE;CAChG,iBAAiB,eAAe,kBAAkB;AACpD;;AAGA,eAAsB,wBAAwB,aAAsB,QAAqC;CACvG,IAAI,gBAAgB,MAAM,aAAa,SAAS,OAAO,KAAA;CACvD,MAAM,SAAS;EACb;EACA,QAAQ,WAAW,gBAAgB,KAAA,IAAY,cAAc,IAAI,YAAY,WAAW,CAAC,EAAE;CAC7F;CACA,gBAAgB,UAAU,WAAW;EAAE,GAAG;EAAO,aAAa;GAAE,GAAG;GAAQ,SAAS;GAAO,OAAO;EAAG;CAAE,EAAE;AAE3G;AAEA,SAAgB,0BAAgC;CAC9C,gBAAgB,UAAU,UAAW,MAAM,aAAa,UAAU,QAAQ;EAAE,GAAG;EAAO,aAAa;CAAK,CA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