@agimon-ai/po-web-dashboard 0.0.0-alpha.47 → 0.0.0-alpha.48
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/core.cjs +1 -0
- package/dist/core.d.mts +2 -2
- package/dist/core.mjs +2 -2
- package/dist/index.cjs +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/web/lib/sessionRailModel.cjs +17 -6
- package/dist/web/lib/sessionRailModel.cjs.map +1 -1
- package/dist/web/lib/sessionRailModel.d.mts +3 -1
- package/dist/web/lib/sessionRailModel.d.mts.map +1 -1
- package/dist/web/lib/sessionRailModel.mjs +17 -7
- package/dist/web/lib/sessionRailModel.mjs.map +1 -1
- package/dist/web/stores/sessionsStore.cjs +5 -2
- package/dist/web/stores/sessionsStore.cjs.map +1 -1
- package/dist/web/stores/sessionsStore.d.mts +4 -1
- package/dist/web/stores/sessionsStore.d.mts.map +1 -1
- package/dist/web/stores/sessionsStore.mjs +5 -2
- package/dist/web/stores/sessionsStore.mjs.map +1 -1
- package/package.json +5 -5
package/dist/core.cjs
CHANGED
|
@@ -192,6 +192,7 @@ exports.qualifyHostId = require_hostIdentity.qualifyHostId;
|
|
|
192
192
|
exports.qualifyHostKey = require_hostIdentity.qualifyHostKey;
|
|
193
193
|
exports.queueFollowUp = require_sessionStore.queueFollowUp;
|
|
194
194
|
exports.queueFollowUpWithAck = require_sessionStore.queueFollowUpWithAck;
|
|
195
|
+
exports.railSessionStatus = require_sessionRailModel.railSessionStatus;
|
|
195
196
|
exports.reduceSession = require_sessionModel.reduceSession;
|
|
196
197
|
exports.refreshSessionFacts = require_sessionStore.refreshSessionFacts;
|
|
197
198
|
exports.refreshSessionSelection = require_sessionStore.refreshSessionSelection;
|
package/dist/core.d.mts
CHANGED
|
@@ -14,7 +14,7 @@ import { toolMessageProps } from "./web/lib/toolMessageProps.mjs";
|
|
|
14
14
|
import { ToolRendererBoundary } from "./web/lib/ToolRendererBoundary.mjs";
|
|
15
15
|
import { updateDialogDraft, useDialogDraft } from "./web/stores/dialogDraftStore.mjs";
|
|
16
16
|
import { AttachPhase, StatusClock, StatusLineInput, abbreviateCwd, personaInitials, runningCount, sessionStatusClock, sessionStatusLine } from "./web/lib/sessionSummary.mjs";
|
|
17
|
-
import { LEGACY_WORKSPACE_ID, RailRestartState, RailSessionInput, SessionRailModelInput, buildRailWorkspaces, pendingSetupView, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
17
|
+
import { LEGACY_WORKSPACE_ID, RailRestartState, RailSessionInput, SessionRailModelInput, buildRailWorkspaces, pendingSetupView, railSessionStatus, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
18
18
|
import { SessionMeta, SessionsState, UPDATE_REQUIRED_REASON, activeSessionId, applySessionBacklog, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, beginSessionTransfer, completeSessionTransfer, markSocketClosed, markUpdateRequired, noSessions, resetSessions, resolveParentId, sameRailEntries, sameRailEntry, sessionsStore, setActiveSession, useActiveSessionMeta, useNoSessions, useRailEntries, useRailEntry, waitForSession } from "./web/stores/sessionsStore.mjs";
|
|
19
19
|
import { HistoryPage, abortRun, answerDialogConfirm, answerDialogValue, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySessionFrame, applySessionLifecycle, applyThreadFrame, beginSessionReplay, bindHistoryReader, cancelDialog, clearQueuedMessages, deleteQueuedMessage, dropSessionStore, endSessionReplay, loadModelChoices, promoteQueuedMessage, queueFollowUp, queueFollowUpWithAck, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, releaseProtocolTranscript, renameSession, requestLatestHistory, requestNewerHistory, requestOlderHistory, resetSessionStore, resetSessionStores, resumeQueuedMessages, rewindToMessage, runCommand, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, sessionStoreFor, setAgentLock, setHasNewerHistory, setSessionStreamed, streamedSessions, submitMessage, submitMessageWithAck, useActiveSession, useHasOlderHistory } from "./web/stores/sessionStore.mjs";
|
|
20
20
|
import { createPagedTranscript } from "./web/stores/pagedTranscriptStore.mjs";
|
|
@@ -34,4 +34,4 @@ import { bindSessionFileLinkModes, sessionMinorModes } from "./web/stores/fileLi
|
|
|
34
34
|
import { createToolCompletionTabs } from "./web/lib/toolCompletionTabs.mjs";
|
|
35
35
|
import { createWebMcpSimulator } from "./web/lib/webmcpSimulator.mjs";
|
|
36
36
|
import { localHostId, parseHostKey, qualifyHostId, qualifyHostKey, splitHostId } from "./web/lib/hostIdentity.mjs";
|
|
37
|
-
export { type ActivityGroup, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerPromptClaim, type ContextGroup, type ContextItemSource, DialogMethod, DialogPromptClaim, DialogRequest, EditorTextRequest, EntryKind, HOST_SLOTS, HistoryPage, ImageRefScope, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledHomeContribution, type InstalledNativeTemplate, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledUserMessageAction, IntercomEntry, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, MenuClaim, MenuKind, MenuState, type MinorMode, ModelChoice, type NativeTemplateCatalog, NoticeEntry, ProfileIdentity, QueuedEntry, RailRestartState, RailSessionInput, ReduceSessionOptions, ResolvedFill, RpcImage, type SelectionAxis, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettledEntry, StatusClock, StatusLineInput, TRIGGER_CHARS, ThreadTranscriptReader, TimelineEntry, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolRendererBoundary, type TransientTabActions, UPDATE_REQUIRED_REASON, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WebPluginRegistry, WorkspacesState, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, buildRailWorkspaces, builtinCommandFrame, cancelDialog, claimDialogMenu, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, deleteQueuedMessage, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, fileCompletions, fileTabForPath, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSupportedImageMimeType, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, reduceSession, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, replaceQueuedEntries, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveNativeTemplate, resolveParentId, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceName, workspaceSlotFills, workspacesStore };
|
|
37
|
+
export { type ActivityGroup, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerPromptClaim, type ContextGroup, type ContextItemSource, DialogMethod, DialogPromptClaim, DialogRequest, EditorTextRequest, EntryKind, HOST_SLOTS, HistoryPage, ImageRefScope, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledHomeContribution, type InstalledNativeTemplate, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledUserMessageAction, IntercomEntry, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, MenuClaim, MenuKind, MenuState, type MinorMode, ModelChoice, type NativeTemplateCatalog, NoticeEntry, ProfileIdentity, QueuedEntry, RailRestartState, RailSessionInput, ReduceSessionOptions, ResolvedFill, RpcImage, type SelectionAxis, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettledEntry, StatusClock, StatusLineInput, TRIGGER_CHARS, ThreadTranscriptReader, TimelineEntry, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolRendererBoundary, type TransientTabActions, UPDATE_REQUIRED_REASON, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WebPluginRegistry, WorkspacesState, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, buildRailWorkspaces, builtinCommandFrame, cancelDialog, claimDialogMenu, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, deleteQueuedMessage, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, fileCompletions, fileTabForPath, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSupportedImageMimeType, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railSessionStatus, reduceSession, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, replaceQueuedEntries, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveNativeTemplate, resolveParentId, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceName, workspaceSlotFills, workspacesStore };
|
package/dist/core.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { pluginSessionContext, pluginSlotProps } from "./web/lib/pluginSlotProps
|
|
|
16
16
|
import { createProtocolHubSocket } from "./web/lib/protocolHubSocket.mjs";
|
|
17
17
|
import { appendQueued, appendUserPrompt, applySelectionAnswer, clearDialog, clearQueuedEntries, imagesFromContent, initialSessionState, isSupportedImageMimeType, prependHistory, reduceSession, removeQueuedEntry, replaceQueuedEntries, selectionStatuses, summariseArgs, textFromContent } from "./web/lib/sessionModel.mjs";
|
|
18
18
|
import { abbreviateCwd, personaInitials, runningCount, sessionStatusClock, sessionStatusLine } from "./web/lib/sessionSummary.mjs";
|
|
19
|
-
import { LEGACY_WORKSPACE_ID, buildRailWorkspaces, pendingSetupView, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
19
|
+
import { LEGACY_WORKSPACE_ID, buildRailWorkspaces, pendingSetupView, railSessionStatus, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
20
20
|
import { createToolCompletionTabs } from "./web/lib/toolCompletionTabs.mjs";
|
|
21
21
|
import { toolMessageProps } from "./web/lib/toolMessageProps.mjs";
|
|
22
22
|
import { toolPromptClaim } from "./web/lib/toolPrompt.mjs";
|
|
@@ -34,4 +34,4 @@ import { closeTransientTab, dropTransientTabs, findTransientTab, openTransientTa
|
|
|
34
34
|
import { applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, resetWorkspaces, selectWorkspace, workspacesStore } from "./web/stores/workspacesStore.mjs";
|
|
35
35
|
import { updateDialogDraft, useDialogDraft } from "./web/stores/dialogDraftStore.mjs";
|
|
36
36
|
import { createWebMcpSimulator } from "./web/lib/webmcpSimulator.mjs";
|
|
37
|
-
export { BUILTIN_COMMANDS, HOST_SLOTS, ImageRefScope, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, TRIGGER_CHARS, ToolRendererBoundary, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, buildRailWorkspaces, builtinCommandFrame, cancelDialog, claimDialogMenu, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, deleteQueuedMessage, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, fileCompletions, fileTabForPath, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSupportedImageMimeType, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, reduceSession, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, replaceQueuedEntries, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveNativeTemplate, resolveParentId, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceName, workspaceSlotFills, workspacesStore };
|
|
37
|
+
export { BUILTIN_COMMANDS, HOST_SLOTS, ImageRefScope, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, TRIGGER_CHARS, ToolRendererBoundary, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, buildRailWorkspaces, builtinCommandFrame, cancelDialog, claimDialogMenu, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, deleteQueuedMessage, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, fileCompletions, fileTabForPath, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSupportedImageMimeType, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railSessionStatus, reduceSession, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, replaceQueuedEntries, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveNativeTemplate, resolveParentId, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceName, workspaceSlotFills, workspacesStore };
|
package/dist/index.cjs
CHANGED
|
@@ -365,6 +365,7 @@ exports.queueFollowUp = require_sessionStore.queueFollowUp;
|
|
|
365
365
|
exports.queueFollowUpWithAck = require_sessionStore.queueFollowUpWithAck;
|
|
366
366
|
exports.railDialogStore = require_railDialogStore.railDialogStore;
|
|
367
367
|
exports.railRestartStore = require_railDialogStore.railRestartStore;
|
|
368
|
+
exports.railSessionStatus = require_sessionRailModel.railSessionStatus;
|
|
368
369
|
exports.readDormantTranscriptPage = require_hubApi.readDormantTranscriptPage;
|
|
369
370
|
exports.readImageSettings = require_settingsApi.readImageSettings;
|
|
370
371
|
exports.readLogin = require_authApi.readLogin;
|
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ import { TransientTabActions, pluginSessionContext, pluginSlotProps } from "./we
|
|
|
13
13
|
import { toolMessageProps } from "./web/lib/toolMessageProps.mjs";
|
|
14
14
|
import { DialogDraft, dialogDraftStore, updateDialogDraft, useDialogDraft } from "./web/stores/dialogDraftStore.mjs";
|
|
15
15
|
import { AttachPhase, StatusClock, StatusLineInput, abbreviateCwd, personaInitials, runningCount, sessionStatusClock, sessionStatusLine } from "./web/lib/sessionSummary.mjs";
|
|
16
|
-
import { LEGACY_WORKSPACE_ID, RailRestartState, RailSessionInput, SessionRailModelInput, buildRailWorkspaces, pendingSetupView, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
16
|
+
import { LEGACY_WORKSPACE_ID, RailRestartState, RailSessionInput, SessionRailModelInput, buildRailWorkspaces, pendingSetupView, railSessionStatus, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
17
17
|
import { SessionMeta, SessionsState, UPDATE_REQUIRED_REASON, activeSessionId, applySessionBacklog, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, beginSessionTransfer, completeSessionTransfer, markSocketClosed, markUpdateRequired, noSessions, resetSessions, resolveParentId, sameRailEntries, sameRailEntry, sessionsStore, setActiveSession, useActiveSessionMeta, useNoSessions, useRailEntries, useRailEntry, waitForSession } from "./web/stores/sessionsStore.mjs";
|
|
18
18
|
import { HistoryPage, abortRun, answerDialogConfirm, answerDialogValue, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySessionFrame, applySessionLifecycle, applyThreadFrame, beginSessionReplay, bindHistoryReader, cancelDialog, clearQueuedMessages, deleteQueuedMessage, dropSessionStore, endSessionReplay, loadModelChoices, promoteQueuedMessage, queueFollowUp, queueFollowUpWithAck, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, releaseProtocolTranscript, renameSession, requestLatestHistory, requestNewerHistory, requestOlderHistory, resetSessionStore, resetSessionStores, resumeQueuedMessages, rewindToMessage, runCommand, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, sessionStoreFor, setAgentLock, setHasNewerHistory, setSessionStreamed, streamedSessions, submitMessage, submitMessageWithAck, useActiveSession, useHasOlderHistory } from "./web/stores/sessionStore.mjs";
|
|
19
19
|
import { BrowserPerformanceEvent, BrowserPerformanceEventName, browserReadyDuration, flushBrowserTelemetry, installBrowserErrorReporting, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace } from "./web/lib/browserTelemetry.mjs";
|
|
@@ -82,4 +82,4 @@ import { WorkspaceAdmissionDraft, admitDashboardWorkspace, resetWorkspaceAdmissi
|
|
|
82
82
|
import { EMPTY_SETTINGS_DRAFT, SettingsDraftState, SettingsDraftTarget, discardSettingsDraft, loadSettingsDraft, saveSettingsDraft, setSettingsDraft, settingsDraftKey, settingsDraftStore } from "./web/stores/settingsDraftStore.mjs";
|
|
83
83
|
import { dashboardStateFor, useDashboardState } from "./web/stores/dashboardStateStore.mjs";
|
|
84
84
|
import { DashboardRendererProvider, DashboardRenderers } from "./web/lib/dashboardRenderers.mjs";
|
|
85
|
-
export { ActivityGroup, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, BrowserNotificationDeliveryStatus, BrowserNotificationPermissionStatus, BrowserPerformanceEvent, BrowserPerformanceEventName, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerAttachment, ComposerContextAttachment, ComposerFileAttachment, ComposerImageAttachment, ComposerPromptClaim, ComposerSessionState, ComposerTextAttachment, ContextGroup, ContextGroupKind, ContextItem, ContextItemSource, ContextOwner, CreateSessionResult, DEFAULT_REPOSITORY_SETTINGS_SECTION, DEFAULT_SETTINGS_SECTION, DashboardRendererProvider, type DashboardRenderers, DashboardRoute, DevProxyState, DialogDraft, DialogMethod, DialogPromptClaim, DialogRequest, DockTab, EMPTY_NEW_SESSION_DRAFT, EMPTY_SETTINGS_DRAFT, EditorTextRequest, EntryKind, FetchItemDetailResult, FileLinkResolver, FileMention, GroupUnit, HOST_SLOTS, HistoryPage, ImageSettingsResult, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledHomeContribution, InstalledNativeTemplate, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledUserMessageAction, InstalledWebTemplate, IntercomEntry, LEGACY_WORKSPACE_ID, LeaderConflict, LeaderGroup, LeaderOption, LivePushStatus, LoginFlowResult, LogoutResult, MAX_COMPLETION_ITEMS, MAX_COMPOSER_ATTACHMENTS, MAX_COMPOSER_IMAGE_BYTES, MAX_COMPOSER_TEXT_BYTES, MAX_COMPOSER_TOTAL_IMAGE_BYTES, MAX_COMPOSER_TOTAL_TEXT_BYTES, MAX_COMPOSER_UPLOAD_BYTES, MenuClaim, MenuKind, MenuState, MinorMode, MinorModeAvailability, MinorModeSource, ModelChoice, NativeTemplateCatalog, NewSessionDraft, NewSessionState, NoticeEntry, PACKAGED_MINOR_MODES, PACKAGED_SELECTION_AXES, PairingResult, PaletteState, PasskeyOutcome, PasskeySupportView, PlannedWritesInput, ProfileIdentity, ProvidersResult, QueuedEntry, RailDialogState, RailRestartState, RailSessionInput, ReadConfigResult, ReadRepositorySettingsResult, ReduceSessionOptions, RemoteAccessState, RemoteStep, RemoveWorkspaceResult, ResolvedFill, RestartSessionResult, ResumeDraft, ResumeSessionResult, ResumeTarget, ReviveSessionResult, RpcImage, STEP_UP_HEADER_NAME, Selection, SelectionAxis, SessionAsset, SessionGroupsResult, SessionHistoryResult, SessionMcpResult, SessionMcpViewState, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettingsDraftState, SettingsDraftTarget, SettingsSection, SettingsWorkspace, SettledEntry, SingleUnit, StateResult, StatusClock, StatusLineInput, StopSessionResult, StoredSessionAttachment, TRIGGER_CHARS, TargetResult, TargetsResult, TemplateConfiguration, ThemeState, ThreadTranscriptReader, TimelineEntry, TimelineUnit, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolPromptState, TransientTabActions, UPDATE_REQUIRED_REASON, UiState, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WebPluginCompositionPhase, WebPluginCompositionState, WebPluginMountState, WebPluginRegistry, WebTemplateCatalog, WebTemplateDecision, WebTemplateDiagnostic, WorkspaceAdmissionDraft, WorkspaceResult, WorkspaceSandboxRequest, WorkspacesResult, WorkspacesState, WriteConfigResult, abbreviateCwd, abortCommand, abortRun, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, addDevProxyTarget, addPasskey, admitDashboardWorkspace, admitWorkspace, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, asWorkspace, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, canSaveSettings, cancelDialog, cancelLogin, claimDialogMenu, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredTemplate, contextGroups, createDashboardTransport, createDevProxyTarget, createPagedTranscript, createPlainSession, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, deleteDevProxyTarget, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, listDirectory, listPoFolders, listProviders, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, menuStore, mergeScopedPlugins, minorModes, mintPairingCode, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, onSealedSignInRequired, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openTransientTab, ownerLabel, ownersOf, paletteCommands, paletteStore, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railRestartStore, readDormantTranscriptPage, readImageSettings, readLogin, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renameSession, renameSessionGroup, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveComposerDrafts, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setPalettePath, setPendingMenu, setSessionGroups, setSessionNameCommand, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSections, showRemoteOptions, signInWithPasskey, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, tabComposerContext, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateDialogDraft, updateRemoteSettings, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useSessionMcp, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writeRepositorySelection, writeSettingsValue };
|
|
85
|
+
export { ActivityGroup, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, BrowserNotificationDeliveryStatus, BrowserNotificationPermissionStatus, BrowserPerformanceEvent, BrowserPerformanceEventName, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerAttachment, ComposerContextAttachment, ComposerFileAttachment, ComposerImageAttachment, ComposerPromptClaim, ComposerSessionState, ComposerTextAttachment, ContextGroup, ContextGroupKind, ContextItem, ContextItemSource, ContextOwner, CreateSessionResult, DEFAULT_REPOSITORY_SETTINGS_SECTION, DEFAULT_SETTINGS_SECTION, DashboardRendererProvider, type DashboardRenderers, DashboardRoute, DevProxyState, DialogDraft, DialogMethod, DialogPromptClaim, DialogRequest, DockTab, EMPTY_NEW_SESSION_DRAFT, EMPTY_SETTINGS_DRAFT, EditorTextRequest, EntryKind, FetchItemDetailResult, FileLinkResolver, FileMention, GroupUnit, HOST_SLOTS, HistoryPage, ImageSettingsResult, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledHomeContribution, InstalledNativeTemplate, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledUserMessageAction, InstalledWebTemplate, IntercomEntry, LEGACY_WORKSPACE_ID, LeaderConflict, LeaderGroup, LeaderOption, LivePushStatus, LoginFlowResult, LogoutResult, MAX_COMPLETION_ITEMS, MAX_COMPOSER_ATTACHMENTS, MAX_COMPOSER_IMAGE_BYTES, MAX_COMPOSER_TEXT_BYTES, MAX_COMPOSER_TOTAL_IMAGE_BYTES, MAX_COMPOSER_TOTAL_TEXT_BYTES, MAX_COMPOSER_UPLOAD_BYTES, MenuClaim, MenuKind, MenuState, MinorMode, MinorModeAvailability, MinorModeSource, ModelChoice, NativeTemplateCatalog, NewSessionDraft, NewSessionState, NoticeEntry, PACKAGED_MINOR_MODES, PACKAGED_SELECTION_AXES, PairingResult, PaletteState, PasskeyOutcome, PasskeySupportView, PlannedWritesInput, ProfileIdentity, ProvidersResult, QueuedEntry, RailDialogState, RailRestartState, RailSessionInput, ReadConfigResult, ReadRepositorySettingsResult, ReduceSessionOptions, RemoteAccessState, RemoteStep, RemoveWorkspaceResult, ResolvedFill, RestartSessionResult, ResumeDraft, ResumeSessionResult, ResumeTarget, ReviveSessionResult, RpcImage, STEP_UP_HEADER_NAME, Selection, SelectionAxis, SessionAsset, SessionGroupsResult, SessionHistoryResult, SessionMcpResult, SessionMcpViewState, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettingsDraftState, SettingsDraftTarget, SettingsSection, SettingsWorkspace, SettledEntry, SingleUnit, StateResult, StatusClock, StatusLineInput, StopSessionResult, StoredSessionAttachment, TRIGGER_CHARS, TargetResult, TargetsResult, TemplateConfiguration, ThemeState, ThreadTranscriptReader, TimelineEntry, TimelineUnit, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolPromptState, TransientTabActions, UPDATE_REQUIRED_REASON, UiState, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WebPluginCompositionPhase, WebPluginCompositionState, WebPluginMountState, WebPluginRegistry, WebTemplateCatalog, WebTemplateDecision, WebTemplateDiagnostic, WorkspaceAdmissionDraft, WorkspaceResult, WorkspaceSandboxRequest, WorkspacesResult, WorkspacesState, WriteConfigResult, abbreviateCwd, abortCommand, abortRun, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, addDevProxyTarget, addPasskey, admitDashboardWorkspace, admitWorkspace, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, asWorkspace, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, canSaveSettings, cancelDialog, cancelLogin, claimDialogMenu, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredTemplate, contextGroups, createDashboardTransport, createDevProxyTarget, createPagedTranscript, createPlainSession, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, deleteDevProxyTarget, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, listDirectory, listPoFolders, listProviders, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, menuStore, mergeScopedPlugins, minorModes, mintPairingCode, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, onSealedSignInRequired, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openTransientTab, ownerLabel, ownersOf, paletteCommands, paletteStore, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railRestartStore, railSessionStatus, readDormantTranscriptPage, readImageSettings, readLogin, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renameSession, renameSessionGroup, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveComposerDrafts, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setPalettePath, setPendingMenu, setSessionGroups, setSessionNameCommand, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSections, showRemoteOptions, signInWithPasskey, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, tabComposerContext, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateDialogDraft, updateRemoteSettings, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useSessionMcp, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writeRepositorySelection, writeSettingsValue };
|
package/dist/index.mjs
CHANGED
|
@@ -42,7 +42,7 @@ import { loadSessionAsset, uploadSessionAttachment } from "./web/lib/sessionAsse
|
|
|
42
42
|
import { loadSessionAvatar } from "./web/lib/sessionAvatar.mjs";
|
|
43
43
|
import { createSessionMcpClient, isSessionMcpActivity, listSessionMcpClients, readSessionMcpActivity, readSessionMcpConfig, removeSessionMcpSetup, revokeSessionMcpClient } from "./web/lib/sessionMcpApi.mjs";
|
|
44
44
|
import { abbreviateCwd, personaInitials, runningCount, sessionStatusClock, sessionStatusLine } from "./web/lib/sessionSummary.mjs";
|
|
45
|
-
import { LEGACY_WORKSPACE_ID, buildRailWorkspaces, pendingSetupView, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
45
|
+
import { LEGACY_WORKSPACE_ID, buildRailWorkspaces, pendingSetupView, railSessionStatus, workspaceName } from "./web/lib/sessionRailModel.mjs";
|
|
46
46
|
import { listSettingsModels, listSettingsRepositories, readImageSettings, readRepositorySettings, readSettingsConfig, writeImageSettings, writeRepositorySelection, writeSettingsValue } from "./web/lib/settingsApi.mjs";
|
|
47
47
|
import { canSaveSettings, plannedSettingsWrites, settingsKeyOf, settingsLockedReason } from "./web/lib/settingsDraft.mjs";
|
|
48
48
|
import { DEFAULT_REPOSITORY_SETTINGS_SECTION, DEFAULT_SETTINGS_SECTION, settingsSection, settingsSections } from "./web/lib/settingsSections.mjs";
|
|
@@ -82,4 +82,4 @@ import { admitDashboardWorkspace, resetWorkspaceAdmission, updateWorkspaceAdmiss
|
|
|
82
82
|
import { dialogDraftStore, updateDialogDraft, useDialogDraft } from "./web/stores/dialogDraftStore.mjs";
|
|
83
83
|
import { EMPTY_SETTINGS_DRAFT, discardSettingsDraft, loadSettingsDraft, saveSettingsDraft, setSettingsDraft, settingsDraftKey, settingsDraftStore } from "./web/stores/settingsDraftStore.mjs";
|
|
84
84
|
import { dashboardStateFor, useDashboardState } from "./web/stores/dashboardStateStore.mjs";
|
|
85
|
-
export { BUILTIN_COMMANDS, DEFAULT_REPOSITORY_SETTINGS_SECTION, DEFAULT_SETTINGS_SECTION, DashboardRendererProvider, EMPTY_NEW_SESSION_DRAFT, EMPTY_SETTINGS_DRAFT, HOST_SLOTS, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, MAX_COMPOSER_ATTACHMENTS, MAX_COMPOSER_IMAGE_BYTES, MAX_COMPOSER_TEXT_BYTES, MAX_COMPOSER_TOTAL_IMAGE_BYTES, MAX_COMPOSER_TOTAL_TEXT_BYTES, MAX_COMPOSER_UPLOAD_BYTES, PACKAGED_MINOR_MODES, PACKAGED_SELECTION_AXES, STEP_UP_HEADER_NAME, TRIGGER_CHARS, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, addDevProxyTarget, addPasskey, admitDashboardWorkspace, admitWorkspace, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, asWorkspace, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, canSaveSettings, cancelDialog, cancelLogin, claimDialogMenu, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredTemplate, contextGroups, createDashboardTransport, createDevProxyTarget, createPagedTranscript, createPlainSession, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, deleteDevProxyTarget, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, listDirectory, listPoFolders, listProviders, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, menuStore, mergeScopedPlugins, minorModes, mintPairingCode, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, onSealedSignInRequired, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openTransientTab, ownerLabel, ownersOf, paletteCommands, paletteStore, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railRestartStore, readDormantTranscriptPage, readImageSettings, readLogin, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renameSession, renameSessionGroup, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveComposerDrafts, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setPalettePath, setPendingMenu, setSessionGroups, setSessionNameCommand, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSections, showRemoteOptions, signInWithPasskey, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, tabComposerContext, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateDialogDraft, updateRemoteSettings, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useSessionMcp, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writeRepositorySelection, writeSettingsValue };
|
|
85
|
+
export { BUILTIN_COMMANDS, DEFAULT_REPOSITORY_SETTINGS_SECTION, DEFAULT_SETTINGS_SECTION, DashboardRendererProvider, EMPTY_NEW_SESSION_DRAFT, EMPTY_SETTINGS_DRAFT, HOST_SLOTS, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, MAX_COMPOSER_ATTACHMENTS, MAX_COMPOSER_IMAGE_BYTES, MAX_COMPOSER_TEXT_BYTES, MAX_COMPOSER_TOTAL_IMAGE_BYTES, MAX_COMPOSER_TOTAL_TEXT_BYTES, MAX_COMPOSER_UPLOAD_BYTES, PACKAGED_MINOR_MODES, PACKAGED_SELECTION_AXES, STEP_UP_HEADER_NAME, TRIGGER_CHARS, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, addDevProxyTarget, addPasskey, admitDashboardWorkspace, admitWorkspace, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, asWorkspace, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, canSaveSettings, cancelDialog, cancelLogin, claimDialogMenu, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredTemplate, contextGroups, createDashboardTransport, createDevProxyTarget, createPagedTranscript, createPlainSession, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, deleteDevProxyTarget, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, globalSlotFills, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, holdSessionChannels, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installGlobalWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, listDirectory, listPoFolders, listProviders, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, menuStore, mergeScopedPlugins, minorModes, mintPairingCode, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHubConnected, onSealedSignInRequired, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openTransientTab, ownerLabel, ownersOf, paletteCommands, paletteStore, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMinorModes, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railRestartStore, railSessionStatus, readDormantTranscriptPage, readImageSettings, readLogin, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renameSession, renameSessionGroup, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveComposerDrafts, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionMinorModes, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setPalettePath, setPendingMenu, setSessionGroups, setSessionNameCommand, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSections, showRemoteOptions, signInWithPasskey, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, tabComposerContext, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateDialogDraft, updateRemoteSettings, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useSessionMcp, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writeRepositorySelection, writeSettingsValue };
|
|
@@ -22,10 +22,8 @@ function pendingSetupView(setup) {
|
|
|
22
22
|
...needsRecovery ? { recovery } : {}
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const restart = input.restarts[id];
|
|
28
|
-
const restarting = restart?.restarting === true;
|
|
25
|
+
/** One session's status copy and clock as its card shows them, for a surface that reads only that session. */
|
|
26
|
+
function railSessionStatus({ summary, attach }, now) {
|
|
29
27
|
const statusInput = {
|
|
30
28
|
attach,
|
|
31
29
|
backgroundWorkActive: summary.backgroundWorkActive,
|
|
@@ -37,8 +35,20 @@ function sessionView(id, ordinal, input) {
|
|
|
37
35
|
dormant: summary.dormant,
|
|
38
36
|
...summary.activity === void 0 ? {} : { activity: summary.activity }
|
|
39
37
|
};
|
|
40
|
-
const
|
|
41
|
-
|
|
38
|
+
const clock = require_sessionSummary.sessionStatusClock(statusInput);
|
|
39
|
+
return {
|
|
40
|
+
status: require_sessionSummary.sessionStatusLine(statusInput, now),
|
|
41
|
+
...clock === void 0 ? {} : { clock }
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function sessionView(id, ordinal, input) {
|
|
45
|
+
const entry = input.byId[id];
|
|
46
|
+
const { summary, attach } = entry;
|
|
47
|
+
const restart = input.restarts[id];
|
|
48
|
+
const restarting = restart?.restarting === true;
|
|
49
|
+
const live = railSessionStatus(entry, input.now);
|
|
50
|
+
const status = restarting ? "restarting…" : live.status;
|
|
51
|
+
const clock = restarting ? void 0 : live.clock;
|
|
42
52
|
const nested = input.nested.has(id);
|
|
43
53
|
const profile = summary.profile;
|
|
44
54
|
const label = profile === void 0 ? void 0 : profile.displayName ?? profile.name;
|
|
@@ -108,6 +118,7 @@ function buildRailWorkspaces(input) {
|
|
|
108
118
|
exports.LEGACY_WORKSPACE_ID = LEGACY_WORKSPACE_ID;
|
|
109
119
|
exports.buildRailWorkspaces = buildRailWorkspaces;
|
|
110
120
|
exports.pendingSetupView = pendingSetupView;
|
|
121
|
+
exports.railSessionStatus = railSessionStatus;
|
|
111
122
|
exports.workspaceName = workspaceName;
|
|
112
123
|
|
|
113
124
|
//# sourceMappingURL=sessionRailModel.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionRailModel.cjs","names":["sessionStatusLine","sessionStatusClock","personaInitials","VOICE_ORCHESTRATOR_SESSION_PROVENANCE"],"sources":["../../../src/web/lib/sessionRailModel.ts"],"sourcesContent":["import { VOICE_ORCHESTRATOR_SESSION_PROVENANCE } from '@agimon-ai/po-core/hubChannel';\nimport type {\n WebTemplateRailPendingSetup,\n WebTemplateRailSession,\n WebTemplateRailWorkspace,\n} from '@agimon-ai/po-core/web';\n\nimport type { SessionSummary, WorkspaceSummary } from '../../types/hub';\nimport {\n personaInitials,\n sessionStatusClock,\n sessionStatusLine,\n type AttachPhase,\n type StatusLineInput,\n} from './sessionSummary';\n\n/** Sessions recorded without a workspace are grouped under this id. */\nexport const LEGACY_WORKSPACE_ID = 'legacy-workspace';\n\nexport interface RailSessionInput {\n summary: SessionSummary;\n attach: AttachPhase;\n}\n\n/** A restart the rail asked for: in flight, or failed with a reason. */\nexport interface RailRestartState {\n restarting: boolean;\n error?: string;\n}\n\nexport interface SessionRailModelInput {\n /** Rail order across every workspace; positions become the 1-9 ordinals. */\n order: readonly string[];\n byId: Readonly<Record<string, RailSessionInput>>;\n activeId: string | null;\n workspaceOrder: readonly string[];\n workspacesById: Readonly<Record<string, WorkspaceSummary>>;\n /** Sessions rendered under their parent. */\n nested: ReadonlySet<string>;\n /** When the status copy is read; a card's `clock` keeps it current after that. */\n now: number;\n restarts: Readonly<Record<string, RailRestartState>>;\n /** Loaded profile avatars by session id. */\n avatarUrls: Readonly<Record<string, string>>;\n}\n\nexport function workspaceName(workspace: Pick<WorkspaceSummary, 'root' | 'name'>): string {\n if (workspace.name) return workspace.name;\n const trimmed = workspace.root.replace(/\\/+$/u, '');\n return trimmed.slice(trimmed.lastIndexOf('/') + 1) || workspace.root;\n}\n\ntype PendingSetup = NonNullable<SessionSummary['pendingSetups']>[number];\n\n/** The status and recovery copy for a setup-only child reservation. */\nexport function pendingSetupView(setup: PendingSetup): WebTemplateRailPendingSetup {\n const setupType =\n setup.setupKind === 'existing-directory'\n ? 'conversation directory'\n : setup.setupKind === 'managed-worktree'\n ? 'automatic worktree'\n : 'conversation';\n const status =\n setup.status === 'failed'\n ? `${setupType} setup failed`\n : setup.status === 'interrupted'\n ? `${setupType} setup interrupted`\n : `${setupType} provisioning`;\n const recovery =\n setup.setupKind === undefined && setup.cwd !== undefined\n ? 'This existing setup has no verified provider. Inspect its ownership in Po before retrying.'\n : setup.errorCode === 'SESSION_UNAVAILABLE'\n ? 'The existing session is unavailable. Inspect or resume it in Po before retrying the conversation.'\n : setup.status === 'interrupted'\n ? 'Retry the authenticated conversation to resume this setup. The same setup will be reused.'\n : setup.setupKind === 'existing-directory'\n ? 'Inspect the selected directory, then retry the authenticated conversation. The same setup will be reused.'\n : 'Resolve the Git setup, then retry the authenticated conversation. The same setup will be reused.';\n const needsRecovery = setup.status === 'failed' || setup.status === 'interrupted';\n return {\n id: setup.id,\n name: setup.name,\n status,\n failed: setup.status === 'failed',\n ...(needsRecovery ? { recovery } : {}),\n };\n}\n\nfunction sessionView(id: string, ordinal: number, input: SessionRailModelInput): WebTemplateRailSession {\n const { summary, attach } = input.byId[id]!;\n const restart = input.restarts[id];\n const restarting = restart?.restarting === true;\n const statusInput: StatusLineInput = {\n attach,\n backgroundWorkActive: summary.backgroundWorkActive,\n phase: summary.phase,\n phaseSince: summary.phaseSince,\n awaitingInput: summary.awaitingInput,\n everPrompted: summary.everPrompted,\n lastSettledAt: summary.lastSettledAt,\n dormant: summary.dormant,\n ...(summary.activity === undefined ? {} : { activity: summary.activity }),\n };\n const status = restarting ? 'restarting…' : sessionStatusLine(statusInput, input.now);\n const clock = restarting ? undefined : sessionStatusClock(statusInput);\n const nested = input.nested.has(id);\n const profile = summary.profile;\n const label = profile === undefined ? undefined : (profile.displayName ?? profile.name);\n const avatarUrl = input.avatarUrls[id];\n return {\n id,\n name: summary.name,\n ordinal,\n active: id === input.activeId,\n nested,\n ...(nested && summary.sessionProvenance !== undefined ? { provenance: summary.sessionProvenance } : {}),\n status,\n ...(clock === undefined ? {} : { clock }),\n // The same priority the status copy uses: a refusal outranks the question,\n // and a restarting card is describing the restart, not the run it ended.\n // Background work that needs the reader, such as a failed workflow, is\n // marked the same way while the agent itself is idle.\n awaitingInput:\n (summary.awaitingInput ||\n (summary.activity?.attention === true && summary.phase === 'idle' && summary.dormant !== true)) &&\n attach !== 'refused' &&\n !restarting,\n restarting,\n restartBlocked: summary.dormant !== true && summary.phase !== undefined && summary.phase !== 'idle',\n ...(restart?.error === undefined ? {} : { error: restart.error }),\n ...(summary.git === undefined ? {} : { git: { branch: summary.git.branch, dirty: summary.git.dirty } }),\n ...(summary.groups === undefined || summary.groups.length === 0 ? {} : { groups: summary.groups }),\n ...(profile === undefined || label === undefined\n ? {}\n : {\n profile: {\n name: profile.name,\n label,\n initials: personaInitials(label),\n ...(avatarUrl === undefined ? {} : { avatarUrl }),\n },\n }),\n pendingSetups: (summary.pendingSetups ?? []).map(pendingSetupView),\n };\n}\n\n/** The rail's workspaces in host order, each with its sessions; ungrouped sessions last. */\nexport function buildRailWorkspaces(input: SessionRailModelInput): WebTemplateRailWorkspace[] {\n const ordinals = new Map(input.order.map((id, index) => [id, index + 1]));\n const grouped = new Set<string>();\n const workspaces: WebTemplateRailWorkspace[] = [];\n for (const workspaceId of input.workspaceOrder) {\n const workspace = input.workspacesById[workspaceId];\n if (workspace === undefined) continue;\n const ids = input.order.filter((id) => input.byId[id]?.summary.workspaceId === workspaceId);\n if (\n !ids.length &&\n Object.values(input.byId).some(\n ({ summary }) =>\n summary.workspaceId === workspaceId && summary.sessionProvenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n )\n )\n continue;\n for (const id of ids) grouped.add(id);\n workspaces.push({\n id: workspaceId,\n name: workspaceName(workspace),\n root: workspace.root,\n available: workspace.available !== false,\n legacy: false,\n sessions: ids.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n const legacy = input.order.filter((id) => !grouped.has(id) && input.byId[id] !== undefined);\n if (legacy.length > 0) {\n const root = input.byId[legacy[0]!]!.summary.cwd;\n workspaces.push({\n id: LEGACY_WORKSPACE_ID,\n name: workspaceName({ root }),\n root,\n available: false,\n legacy: true,\n sessions: legacy.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n return workspaces;\n}\n"],"mappings":";;;;AAiBA,MAAa,sBAAsB;AA6BnC,SAAgB,cAAc,WAA4D;CACxF,IAAI,UAAU,MAAM,OAAO,UAAU;CACrC,MAAM,UAAU,UAAU,KAAK,QAAQ,SAAS,EAAE;CAClD,OAAO,QAAQ,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,KAAK,UAAU;AAClE;;AAKA,SAAgB,iBAAiB,OAAkD;CACjF,MAAM,YACJ,MAAM,cAAc,uBAChB,2BACA,MAAM,cAAc,qBAClB,uBACA;CACR,MAAM,SACJ,MAAM,WAAW,WACb,GAAG,UAAU,iBACb,MAAM,WAAW,gBACf,GAAG,UAAU,sBACb,GAAG,UAAU;CACrB,MAAM,WACJ,MAAM,cAAc,KAAA,KAAa,MAAM,QAAQ,KAAA,IAC3C,+FACA,MAAM,cAAc,wBAClB,sGACA,MAAM,WAAW,gBACf,8FACA,MAAM,cAAc,uBAClB,8GACA;CACZ,MAAM,gBAAgB,MAAM,WAAW,YAAY,MAAM,WAAW;CACpE,OAAO;EACL,IAAI,MAAM;EACV,MAAM,MAAM;EACZ;EACA,QAAQ,MAAM,WAAW;EACzB,GAAI,gBAAgB,EAAE,SAAS,IAAI,CAAC;CACtC;AACF;AAEA,SAAS,YAAY,IAAY,SAAiB,OAAsD;CACtG,MAAM,EAAE,SAAS,WAAW,MAAM,KAAK;CACvC,MAAM,UAAU,MAAM,SAAS;CAC/B,MAAM,aAAa,SAAS,e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AI,CAAE,QAAQ;EAC7C,WAAW,KAAK;GACd,IAAI;GACJ,MAAM,cAAc,EAAE,KAAK,CAAC;GAC5B;GACA,WAAW;GACX,QAAQ;GACR,UAAU,OAAO,KAAK,OAAO,YAAY,IAAI,SAAS,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;EAC5E,CAAC;CACH;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"sessionRailModel.cjs","names":["sessionStatusClock","sessionStatusLine","personaInitials","VOICE_ORCHESTRATOR_SESSION_PROVENANCE"],"sources":["../../../src/web/lib/sessionRailModel.ts"],"sourcesContent":["import { VOICE_ORCHESTRATOR_SESSION_PROVENANCE } from '@agimon-ai/po-core/hubChannel';\nimport type {\n WebTemplateRailPendingSetup,\n WebTemplateRailSession,\n WebTemplateRailWorkspace,\n} from '@agimon-ai/po-core/web';\n\nimport type { SessionSummary, WorkspaceSummary } from '../../types/hub';\nimport {\n personaInitials,\n sessionStatusClock,\n sessionStatusLine,\n type AttachPhase,\n type StatusLineInput,\n} from './sessionSummary';\n\n/** Sessions recorded without a workspace are grouped under this id. */\nexport const LEGACY_WORKSPACE_ID = 'legacy-workspace';\n\nexport interface RailSessionInput {\n summary: SessionSummary;\n attach: AttachPhase;\n}\n\n/** A restart the rail asked for: in flight, or failed with a reason. */\nexport interface RailRestartState {\n restarting: boolean;\n error?: string;\n}\n\nexport interface SessionRailModelInput {\n /** Rail order across every workspace; positions become the 1-9 ordinals. */\n order: readonly string[];\n byId: Readonly<Record<string, RailSessionInput>>;\n activeId: string | null;\n workspaceOrder: readonly string[];\n workspacesById: Readonly<Record<string, WorkspaceSummary>>;\n /** Sessions rendered under their parent. */\n nested: ReadonlySet<string>;\n /** When the status copy is read; a card's `clock` keeps it current after that. */\n now: number;\n restarts: Readonly<Record<string, RailRestartState>>;\n /** Loaded profile avatars by session id. */\n avatarUrls: Readonly<Record<string, string>>;\n}\n\nexport function workspaceName(workspace: Pick<WorkspaceSummary, 'root' | 'name'>): string {\n if (workspace.name) return workspace.name;\n const trimmed = workspace.root.replace(/\\/+$/u, '');\n return trimmed.slice(trimmed.lastIndexOf('/') + 1) || workspace.root;\n}\n\ntype PendingSetup = NonNullable<SessionSummary['pendingSetups']>[number];\n\n/** The status and recovery copy for a setup-only child reservation. */\nexport function pendingSetupView(setup: PendingSetup): WebTemplateRailPendingSetup {\n const setupType =\n setup.setupKind === 'existing-directory'\n ? 'conversation directory'\n : setup.setupKind === 'managed-worktree'\n ? 'automatic worktree'\n : 'conversation';\n const status =\n setup.status === 'failed'\n ? `${setupType} setup failed`\n : setup.status === 'interrupted'\n ? `${setupType} setup interrupted`\n : `${setupType} provisioning`;\n const recovery =\n setup.setupKind === undefined && setup.cwd !== undefined\n ? 'This existing setup has no verified provider. Inspect its ownership in Po before retrying.'\n : setup.errorCode === 'SESSION_UNAVAILABLE'\n ? 'The existing session is unavailable. Inspect or resume it in Po before retrying the conversation.'\n : setup.status === 'interrupted'\n ? 'Retry the authenticated conversation to resume this setup. The same setup will be reused.'\n : setup.setupKind === 'existing-directory'\n ? 'Inspect the selected directory, then retry the authenticated conversation. The same setup will be reused.'\n : 'Resolve the Git setup, then retry the authenticated conversation. The same setup will be reused.';\n const needsRecovery = setup.status === 'failed' || setup.status === 'interrupted';\n return {\n id: setup.id,\n name: setup.name,\n status,\n failed: setup.status === 'failed',\n ...(needsRecovery ? { recovery } : {}),\n };\n}\n\n/** One session's status copy and clock as its card shows them, for a surface that reads only that session. */\nexport function railSessionStatus(\n { summary, attach }: RailSessionInput,\n now: number,\n): Pick<WebTemplateRailSession, 'status' | 'clock'> {\n const statusInput: StatusLineInput = {\n attach,\n backgroundWorkActive: summary.backgroundWorkActive,\n phase: summary.phase,\n phaseSince: summary.phaseSince,\n awaitingInput: summary.awaitingInput,\n everPrompted: summary.everPrompted,\n lastSettledAt: summary.lastSettledAt,\n dormant: summary.dormant,\n ...(summary.activity === undefined ? {} : { activity: summary.activity }),\n };\n const clock = sessionStatusClock(statusInput);\n return { status: sessionStatusLine(statusInput, now), ...(clock === undefined ? {} : { clock }) };\n}\n\nfunction sessionView(id: string, ordinal: number, input: SessionRailModelInput): WebTemplateRailSession {\n const entry = input.byId[id]!;\n const { summary, attach } = entry;\n const restart = input.restarts[id];\n const restarting = restart?.restarting === true;\n const live = railSessionStatus(entry, input.now);\n const status = restarting ? 'restarting…' : live.status;\n const clock = restarting ? undefined : live.clock;\n const nested = input.nested.has(id);\n const profile = summary.profile;\n const label = profile === undefined ? undefined : (profile.displayName ?? profile.name);\n const avatarUrl = input.avatarUrls[id];\n return {\n id,\n name: summary.name,\n ordinal,\n active: id === input.activeId,\n nested,\n ...(nested && summary.sessionProvenance !== undefined ? { provenance: summary.sessionProvenance } : {}),\n status,\n ...(clock === undefined ? {} : { clock }),\n // The same priority the status copy uses: a refusal outranks the question,\n // and a restarting card is describing the restart, not the run it ended.\n // Background work that needs the reader, such as a failed workflow, is\n // marked the same way while the agent itself is idle.\n awaitingInput:\n (summary.awaitingInput ||\n (summary.activity?.attention === true && summary.phase === 'idle' && summary.dormant !== true)) &&\n attach !== 'refused' &&\n !restarting,\n restarting,\n restartBlocked: summary.dormant !== true && summary.phase !== undefined && summary.phase !== 'idle',\n ...(restart?.error === undefined ? {} : { error: restart.error }),\n ...(summary.git === undefined ? {} : { git: { branch: summary.git.branch, dirty: summary.git.dirty } }),\n ...(summary.groups === undefined || summary.groups.length === 0 ? {} : { groups: summary.groups }),\n ...(profile === undefined || label === undefined\n ? {}\n : {\n profile: {\n name: profile.name,\n label,\n initials: personaInitials(label),\n ...(avatarUrl === undefined ? {} : { avatarUrl }),\n },\n }),\n pendingSetups: (summary.pendingSetups ?? []).map(pendingSetupView),\n };\n}\n\n/** The rail's workspaces in host order, each with its sessions; ungrouped sessions last. */\nexport function buildRailWorkspaces(input: SessionRailModelInput): WebTemplateRailWorkspace[] {\n const ordinals = new Map(input.order.map((id, index) => [id, index + 1]));\n const grouped = new Set<string>();\n const workspaces: WebTemplateRailWorkspace[] = [];\n for (const workspaceId of input.workspaceOrder) {\n const workspace = input.workspacesById[workspaceId];\n if (workspace === undefined) continue;\n const ids = input.order.filter((id) => input.byId[id]?.summary.workspaceId === workspaceId);\n if (\n !ids.length &&\n Object.values(input.byId).some(\n ({ summary }) =>\n summary.workspaceId === workspaceId && summary.sessionProvenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n )\n )\n continue;\n for (const id of ids) grouped.add(id);\n workspaces.push({\n id: workspaceId,\n name: workspaceName(workspace),\n root: workspace.root,\n available: workspace.available !== false,\n legacy: false,\n sessions: ids.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n const legacy = input.order.filter((id) => !grouped.has(id) && input.byId[id] !== undefined);\n if (legacy.length > 0) {\n const root = input.byId[legacy[0]!]!.summary.cwd;\n workspaces.push({\n id: LEGACY_WORKSPACE_ID,\n name: workspaceName({ root }),\n root,\n available: false,\n legacy: true,\n sessions: legacy.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n return workspaces;\n}\n"],"mappings":";;;;AAiBA,MAAa,sBAAsB;AA6BnC,SAAgB,cAAc,WAA4D;CACxF,IAAI,UAAU,MAAM,OAAO,UAAU;CACrC,MAAM,UAAU,UAAU,KAAK,QAAQ,SAAS,EAAE;CAClD,OAAO,QAAQ,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,KAAK,UAAU;AAClE;;AAKA,SAAgB,iBAAiB,OAAkD;CACjF,MAAM,YACJ,MAAM,cAAc,uBAChB,2BACA,MAAM,cAAc,qBAClB,uBACA;CACR,MAAM,SACJ,MAAM,WAAW,WACb,GAAG,UAAU,iBACb,MAAM,WAAW,gBACf,GAAG,UAAU,sBACb,GAAG,UAAU;CACrB,MAAM,WACJ,MAAM,cAAc,KAAA,KAAa,MAAM,QAAQ,KAAA,IAC3C,+FACA,MAAM,cAAc,wBAClB,sGACA,MAAM,WAAW,gBACf,8FACA,MAAM,cAAc,uBAClB,8GACA;CACZ,MAAM,gBAAgB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AAI,CAAC,CAAC,MACvB,EAAE,cACD,QAAQ,gBAAgB,eAAe,QAAQ,sBAAsBC,8BAAAA,qCACzE,GAEA;EACF,KAAK,MAAM,MAAM,KAAK,QAAQ,IAAI,EAAE;EACpC,WAAW,KAAK;GACd,IAAI;GACJ,MAAM,cAAc,SAAS;GAC7B,MAAM,UAAU;GAChB,WAAW,UAAU,cAAc;GACnC,QAAQ;GACR,UAAU,IAAI,KAAK,OAAO,YAAY,IAAI,SAAS,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;EACzE,CAAC;CACH;CACA,MAAM,SAAS,MAAM,MAAM,QAAQ,OAAO,CAAC,QAAQ,IAAI,EAAE,KAAK,MAAM,KAAK,QAAQ,KAAA,CAAS;CAC1F,IAAI,OAAO,SAAS,GAAG;EACrB,MAAM,OAAO,MAAM,KAAK,OAAO,GAAI,CAAE,QAAQ;EAC7C,WAAW,KAAK;GACd,IAAI;GACJ,MAAM,cAAc,EAAE,KAAK,CAAC;GAC5B;GACA,WAAW;GACX,QAAQ;GACR,UAAU,OAAO,KAAK,OAAO,YAAY,IAAI,SAAS,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;EAC5E,CAAC;CACH;CACA,OAAO;AACT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SessionSummary, WorkspaceSummary } from "../../types/hub.mjs";
|
|
2
2
|
import { AttachPhase } from "./sessionSummary.mjs";
|
|
3
|
-
import { WebTemplateRailPendingSetup, WebTemplateRailWorkspace } from "@agimon-ai/po-core/web";
|
|
3
|
+
import { WebTemplateRailPendingSetup, WebTemplateRailSession, WebTemplateRailWorkspace } from "@agimon-ai/po-core/web";
|
|
4
4
|
//#region src/web/lib/sessionRailModel.d.ts
|
|
5
5
|
/** Sessions recorded without a workspace are grouped under this id. */
|
|
6
6
|
export declare const LEGACY_WORKSPACE_ID = "legacy-workspace";
|
|
@@ -32,6 +32,8 @@ export declare function workspaceName(workspace: Pick<WorkspaceSummary, 'root' |
|
|
|
32
32
|
type PendingSetup = NonNullable<SessionSummary['pendingSetups']>[number];
|
|
33
33
|
/** The status and recovery copy for a setup-only child reservation. */
|
|
34
34
|
export declare function pendingSetupView(setup: PendingSetup): WebTemplateRailPendingSetup;
|
|
35
|
+
/** One session's status copy and clock as its card shows them, for a surface that reads only that session. */
|
|
36
|
+
export declare function railSessionStatus({ summary, attach }: RailSessionInput, now: number): Pick<WebTemplateRailSession, 'status' | 'clock'>;
|
|
35
37
|
/** The rail's workspaces in host order, each with its sessions; ungrouped sessions last. */
|
|
36
38
|
export declare function buildRailWorkspaces(input: SessionRailModelInput): WebTemplateRailWorkspace[];
|
|
37
39
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionRailModel.d.mts","names":[],"sources":["../../../src/web/lib/sessionRailModel.ts"],"mappings":";;;;;qBAiBa;iBAEI;EACf,SAAS;EACT,QAAQ;;;iBAIO;EACf;EACA;;iBAGe;;EAEf;EACA,MAAM,SAAS,eAAe;EAC9B;EACA;EACA,gBAAgB,SAAS,eAAe;;EAExC,QAAQ;;EAER;EACA,UAAU,SAAS,eAAe;;EAElC,YAAY,SAAS;;wBAGP,cAAc,WAAW,KAAK;KAMzC,eAAe,YAAY;;wBAGhB,iBAAiB,OAAO,eAAe;;
|
|
1
|
+
{"version":3,"file":"sessionRailModel.d.mts","names":[],"sources":["../../../src/web/lib/sessionRailModel.ts"],"mappings":";;;;;qBAiBa;iBAEI;EACf,SAAS;EACT,QAAQ;;;iBAIO;EACf;EACA;;iBAGe;;EAEf;EACA,MAAM,SAAS,eAAe;EAC9B;EACA;EACA,gBAAgB,SAAS,eAAe;;EAExC,QAAQ;;EAER;EACA,UAAU,SAAS,eAAe;;EAElC,YAAY,SAAS;;wBAGP,cAAc,WAAW,KAAK;KAMzC,eAAe,YAAY;;wBAGhB,iBAAiB,OAAO,eAAe;;wBAkCvC,oBACZ,SAAS,UAAU,kBACrB,cACC,KAAK;;wBAkEQ,oBAAoB,OAAO,wBAAwB"}
|
|
@@ -22,10 +22,8 @@ function pendingSetupView(setup) {
|
|
|
22
22
|
...needsRecovery ? { recovery } : {}
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const restart = input.restarts[id];
|
|
28
|
-
const restarting = restart?.restarting === true;
|
|
25
|
+
/** One session's status copy and clock as its card shows them, for a surface that reads only that session. */
|
|
26
|
+
function railSessionStatus({ summary, attach }, now) {
|
|
29
27
|
const statusInput = {
|
|
30
28
|
attach,
|
|
31
29
|
backgroundWorkActive: summary.backgroundWorkActive,
|
|
@@ -37,8 +35,20 @@ function sessionView(id, ordinal, input) {
|
|
|
37
35
|
dormant: summary.dormant,
|
|
38
36
|
...summary.activity === void 0 ? {} : { activity: summary.activity }
|
|
39
37
|
};
|
|
40
|
-
const
|
|
41
|
-
|
|
38
|
+
const clock = sessionStatusClock(statusInput);
|
|
39
|
+
return {
|
|
40
|
+
status: sessionStatusLine(statusInput, now),
|
|
41
|
+
...clock === void 0 ? {} : { clock }
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function sessionView(id, ordinal, input) {
|
|
45
|
+
const entry = input.byId[id];
|
|
46
|
+
const { summary, attach } = entry;
|
|
47
|
+
const restart = input.restarts[id];
|
|
48
|
+
const restarting = restart?.restarting === true;
|
|
49
|
+
const live = railSessionStatus(entry, input.now);
|
|
50
|
+
const status = restarting ? "restarting…" : live.status;
|
|
51
|
+
const clock = restarting ? void 0 : live.clock;
|
|
42
52
|
const nested = input.nested.has(id);
|
|
43
53
|
const profile = summary.profile;
|
|
44
54
|
const label = profile === void 0 ? void 0 : profile.displayName ?? profile.name;
|
|
@@ -105,6 +115,6 @@ function buildRailWorkspaces(input) {
|
|
|
105
115
|
return workspaces;
|
|
106
116
|
}
|
|
107
117
|
//#endregion
|
|
108
|
-
export { LEGACY_WORKSPACE_ID, buildRailWorkspaces, pendingSetupView, workspaceName };
|
|
118
|
+
export { LEGACY_WORKSPACE_ID, buildRailWorkspaces, pendingSetupView, railSessionStatus, workspaceName };
|
|
109
119
|
|
|
110
120
|
//# sourceMappingURL=sessionRailModel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionRailModel.mjs","names":[],"sources":["../../../src/web/lib/sessionRailModel.ts"],"sourcesContent":["import { VOICE_ORCHESTRATOR_SESSION_PROVENANCE } from '@agimon-ai/po-core/hubChannel';\nimport type {\n WebTemplateRailPendingSetup,\n WebTemplateRailSession,\n WebTemplateRailWorkspace,\n} from '@agimon-ai/po-core/web';\n\nimport type { SessionSummary, WorkspaceSummary } from '../../types/hub';\nimport {\n personaInitials,\n sessionStatusClock,\n sessionStatusLine,\n type AttachPhase,\n type StatusLineInput,\n} from './sessionSummary';\n\n/** Sessions recorded without a workspace are grouped under this id. */\nexport const LEGACY_WORKSPACE_ID = 'legacy-workspace';\n\nexport interface RailSessionInput {\n summary: SessionSummary;\n attach: AttachPhase;\n}\n\n/** A restart the rail asked for: in flight, or failed with a reason. */\nexport interface RailRestartState {\n restarting: boolean;\n error?: string;\n}\n\nexport interface SessionRailModelInput {\n /** Rail order across every workspace; positions become the 1-9 ordinals. */\n order: readonly string[];\n byId: Readonly<Record<string, RailSessionInput>>;\n activeId: string | null;\n workspaceOrder: readonly string[];\n workspacesById: Readonly<Record<string, WorkspaceSummary>>;\n /** Sessions rendered under their parent. */\n nested: ReadonlySet<string>;\n /** When the status copy is read; a card's `clock` keeps it current after that. */\n now: number;\n restarts: Readonly<Record<string, RailRestartState>>;\n /** Loaded profile avatars by session id. */\n avatarUrls: Readonly<Record<string, string>>;\n}\n\nexport function workspaceName(workspace: Pick<WorkspaceSummary, 'root' | 'name'>): string {\n if (workspace.name) return workspace.name;\n const trimmed = workspace.root.replace(/\\/+$/u, '');\n return trimmed.slice(trimmed.lastIndexOf('/') + 1) || workspace.root;\n}\n\ntype PendingSetup = NonNullable<SessionSummary['pendingSetups']>[number];\n\n/** The status and recovery copy for a setup-only child reservation. */\nexport function pendingSetupView(setup: PendingSetup): WebTemplateRailPendingSetup {\n const setupType =\n setup.setupKind === 'existing-directory'\n ? 'conversation directory'\n : setup.setupKind === 'managed-worktree'\n ? 'automatic worktree'\n : 'conversation';\n const status =\n setup.status === 'failed'\n ? `${setupType} setup failed`\n : setup.status === 'interrupted'\n ? `${setupType} setup interrupted`\n : `${setupType} provisioning`;\n const recovery =\n setup.setupKind === undefined && setup.cwd !== undefined\n ? 'This existing setup has no verified provider. Inspect its ownership in Po before retrying.'\n : setup.errorCode === 'SESSION_UNAVAILABLE'\n ? 'The existing session is unavailable. Inspect or resume it in Po before retrying the conversation.'\n : setup.status === 'interrupted'\n ? 'Retry the authenticated conversation to resume this setup. The same setup will be reused.'\n : setup.setupKind === 'existing-directory'\n ? 'Inspect the selected directory, then retry the authenticated conversation. The same setup will be reused.'\n : 'Resolve the Git setup, then retry the authenticated conversation. The same setup will be reused.';\n const needsRecovery = setup.status === 'failed' || setup.status === 'interrupted';\n return {\n id: setup.id,\n name: setup.name,\n status,\n failed: setup.status === 'failed',\n ...(needsRecovery ? { recovery } : {}),\n };\n}\n\nfunction sessionView(id: string, ordinal: number, input: SessionRailModelInput): WebTemplateRailSession {\n const { summary, attach } = input.byId[id]!;\n const restart = input.restarts[id];\n const restarting = restart?.restarting === true;\n const statusInput: StatusLineInput = {\n attach,\n backgroundWorkActive: summary.backgroundWorkActive,\n phase: summary.phase,\n phaseSince: summary.phaseSince,\n awaitingInput: summary.awaitingInput,\n everPrompted: summary.everPrompted,\n lastSettledAt: summary.lastSettledAt,\n dormant: summary.dormant,\n ...(summary.activity === undefined ? {} : { activity: summary.activity }),\n };\n const status = restarting ? 'restarting…' : sessionStatusLine(statusInput, input.now);\n const clock = restarting ? undefined : sessionStatusClock(statusInput);\n const nested = input.nested.has(id);\n const profile = summary.profile;\n const label = profile === undefined ? undefined : (profile.displayName ?? profile.name);\n const avatarUrl = input.avatarUrls[id];\n return {\n id,\n name: summary.name,\n ordinal,\n active: id === input.activeId,\n nested,\n ...(nested && summary.sessionProvenance !== undefined ? { provenance: summary.sessionProvenance } : {}),\n status,\n ...(clock === undefined ? {} : { clock }),\n // The same priority the status copy uses: a refusal outranks the question,\n // and a restarting card is describing the restart, not the run it ended.\n // Background work that needs the reader, such as a failed workflow, is\n // marked the same way while the agent itself is idle.\n awaitingInput:\n (summary.awaitingInput ||\n (summary.activity?.attention === true && summary.phase === 'idle' && summary.dormant !== true)) &&\n attach !== 'refused' &&\n !restarting,\n restarting,\n restartBlocked: summary.dormant !== true && summary.phase !== undefined && summary.phase !== 'idle',\n ...(restart?.error === undefined ? {} : { error: restart.error }),\n ...(summary.git === undefined ? {} : { git: { branch: summary.git.branch, dirty: summary.git.dirty } }),\n ...(summary.groups === undefined || summary.groups.length === 0 ? {} : { groups: summary.groups }),\n ...(profile === undefined || label === undefined\n ? {}\n : {\n profile: {\n name: profile.name,\n label,\n initials: personaInitials(label),\n ...(avatarUrl === undefined ? {} : { avatarUrl }),\n },\n }),\n pendingSetups: (summary.pendingSetups ?? []).map(pendingSetupView),\n };\n}\n\n/** The rail's workspaces in host order, each with its sessions; ungrouped sessions last. */\nexport function buildRailWorkspaces(input: SessionRailModelInput): WebTemplateRailWorkspace[] {\n const ordinals = new Map(input.order.map((id, index) => [id, index + 1]));\n const grouped = new Set<string>();\n const workspaces: WebTemplateRailWorkspace[] = [];\n for (const workspaceId of input.workspaceOrder) {\n const workspace = input.workspacesById[workspaceId];\n if (workspace === undefined) continue;\n const ids = input.order.filter((id) => input.byId[id]?.summary.workspaceId === workspaceId);\n if (\n !ids.length &&\n Object.values(input.byId).some(\n ({ summary }) =>\n summary.workspaceId === workspaceId && summary.sessionProvenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n )\n )\n continue;\n for (const id of ids) grouped.add(id);\n workspaces.push({\n id: workspaceId,\n name: workspaceName(workspace),\n root: workspace.root,\n available: workspace.available !== false,\n legacy: false,\n sessions: ids.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n const legacy = input.order.filter((id) => !grouped.has(id) && input.byId[id] !== undefined);\n if (legacy.length > 0) {\n const root = input.byId[legacy[0]!]!.summary.cwd;\n workspaces.push({\n id: LEGACY_WORKSPACE_ID,\n name: workspaceName({ root }),\n root,\n available: false,\n legacy: true,\n sessions: legacy.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n return workspaces;\n}\n"],"mappings":";;;;AAiBA,MAAa,sBAAsB;AA6BnC,SAAgB,cAAc,WAA4D;CACxF,IAAI,UAAU,MAAM,OAAO,UAAU;CACrC,MAAM,UAAU,UAAU,KAAK,QAAQ,SAAS,EAAE;CAClD,OAAO,QAAQ,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,KAAK,UAAU;AAClE;;AAKA,SAAgB,iBAAiB,OAAkD;CACjF,MAAM,YACJ,MAAM,cAAc,uBAChB,2BACA,MAAM,cAAc,qBAClB,uBACA;CACR,MAAM,SACJ,MAAM,WAAW,WACb,GAAG,UAAU,iBACb,MAAM,WAAW,gBACf,GAAG,UAAU,sBACb,GAAG,UAAU;CACrB,MAAM,WACJ,MAAM,cAAc,KAAA,KAAa,MAAM,QAAQ,KAAA,IAC3C,+FACA,MAAM,cAAc,wBAClB,sGACA,MAAM,WAAW,gBACf,8FACA,MAAM,cAAc,uBAClB,8GACA;CACZ,MAAM,gBAAgB,MAAM,WAAW,YAAY,MAAM,WAAW;CACpE,OAAO;EACL,IAAI,MAAM;EACV,MAAM,MAAM;EACZ;EACA,QAAQ,MAAM,WAAW;EACzB,GAAI,gBAAgB,EAAE,SAAS,IAAI,CAAC;CACtC;AACF;AAEA,SAAS,YAAY,IAAY,SAAiB,OAAsD;CACtG,MAAM,EAAE,SAAS,WAAW,MAAM,KAAK;CACvC,MAAM,UAAU,MAAM,SAAS;CAC/B,MAAM,aAAa,SAAS,eAAe;CAC3C,MAAM,cAA+B;EACnC;EACA,sBAAsB,QAAQ;EAC9B,OAAO,QAAQ;EACf,YAAY,QAAQ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AO,KAAK,OAAO,YAAY,IAAI,SAAS,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;EAC5E,CAAC;CACH;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"sessionRailModel.mjs","names":[],"sources":["../../../src/web/lib/sessionRailModel.ts"],"sourcesContent":["import { VOICE_ORCHESTRATOR_SESSION_PROVENANCE } from '@agimon-ai/po-core/hubChannel';\nimport type {\n WebTemplateRailPendingSetup,\n WebTemplateRailSession,\n WebTemplateRailWorkspace,\n} from '@agimon-ai/po-core/web';\n\nimport type { SessionSummary, WorkspaceSummary } from '../../types/hub';\nimport {\n personaInitials,\n sessionStatusClock,\n sessionStatusLine,\n type AttachPhase,\n type StatusLineInput,\n} from './sessionSummary';\n\n/** Sessions recorded without a workspace are grouped under this id. */\nexport const LEGACY_WORKSPACE_ID = 'legacy-workspace';\n\nexport interface RailSessionInput {\n summary: SessionSummary;\n attach: AttachPhase;\n}\n\n/** A restart the rail asked for: in flight, or failed with a reason. */\nexport interface RailRestartState {\n restarting: boolean;\n error?: string;\n}\n\nexport interface SessionRailModelInput {\n /** Rail order across every workspace; positions become the 1-9 ordinals. */\n order: readonly string[];\n byId: Readonly<Record<string, RailSessionInput>>;\n activeId: string | null;\n workspaceOrder: readonly string[];\n workspacesById: Readonly<Record<string, WorkspaceSummary>>;\n /** Sessions rendered under their parent. */\n nested: ReadonlySet<string>;\n /** When the status copy is read; a card's `clock` keeps it current after that. */\n now: number;\n restarts: Readonly<Record<string, RailRestartState>>;\n /** Loaded profile avatars by session id. */\n avatarUrls: Readonly<Record<string, string>>;\n}\n\nexport function workspaceName(workspace: Pick<WorkspaceSummary, 'root' | 'name'>): string {\n if (workspace.name) return workspace.name;\n const trimmed = workspace.root.replace(/\\/+$/u, '');\n return trimmed.slice(trimmed.lastIndexOf('/') + 1) || workspace.root;\n}\n\ntype PendingSetup = NonNullable<SessionSummary['pendingSetups']>[number];\n\n/** The status and recovery copy for a setup-only child reservation. */\nexport function pendingSetupView(setup: PendingSetup): WebTemplateRailPendingSetup {\n const setupType =\n setup.setupKind === 'existing-directory'\n ? 'conversation directory'\n : setup.setupKind === 'managed-worktree'\n ? 'automatic worktree'\n : 'conversation';\n const status =\n setup.status === 'failed'\n ? `${setupType} setup failed`\n : setup.status === 'interrupted'\n ? `${setupType} setup interrupted`\n : `${setupType} provisioning`;\n const recovery =\n setup.setupKind === undefined && setup.cwd !== undefined\n ? 'This existing setup has no verified provider. Inspect its ownership in Po before retrying.'\n : setup.errorCode === 'SESSION_UNAVAILABLE'\n ? 'The existing session is unavailable. Inspect or resume it in Po before retrying the conversation.'\n : setup.status === 'interrupted'\n ? 'Retry the authenticated conversation to resume this setup. The same setup will be reused.'\n : setup.setupKind === 'existing-directory'\n ? 'Inspect the selected directory, then retry the authenticated conversation. The same setup will be reused.'\n : 'Resolve the Git setup, then retry the authenticated conversation. The same setup will be reused.';\n const needsRecovery = setup.status === 'failed' || setup.status === 'interrupted';\n return {\n id: setup.id,\n name: setup.name,\n status,\n failed: setup.status === 'failed',\n ...(needsRecovery ? { recovery } : {}),\n };\n}\n\n/** One session's status copy and clock as its card shows them, for a surface that reads only that session. */\nexport function railSessionStatus(\n { summary, attach }: RailSessionInput,\n now: number,\n): Pick<WebTemplateRailSession, 'status' | 'clock'> {\n const statusInput: StatusLineInput = {\n attach,\n backgroundWorkActive: summary.backgroundWorkActive,\n phase: summary.phase,\n phaseSince: summary.phaseSince,\n awaitingInput: summary.awaitingInput,\n everPrompted: summary.everPrompted,\n lastSettledAt: summary.lastSettledAt,\n dormant: summary.dormant,\n ...(summary.activity === undefined ? {} : { activity: summary.activity }),\n };\n const clock = sessionStatusClock(statusInput);\n return { status: sessionStatusLine(statusInput, now), ...(clock === undefined ? {} : { clock }) };\n}\n\nfunction sessionView(id: string, ordinal: number, input: SessionRailModelInput): WebTemplateRailSession {\n const entry = input.byId[id]!;\n const { summary, attach } = entry;\n const restart = input.restarts[id];\n const restarting = restart?.restarting === true;\n const live = railSessionStatus(entry, input.now);\n const status = restarting ? 'restarting…' : live.status;\n const clock = restarting ? undefined : live.clock;\n const nested = input.nested.has(id);\n const profile = summary.profile;\n const label = profile === undefined ? undefined : (profile.displayName ?? profile.name);\n const avatarUrl = input.avatarUrls[id];\n return {\n id,\n name: summary.name,\n ordinal,\n active: id === input.activeId,\n nested,\n ...(nested && summary.sessionProvenance !== undefined ? { provenance: summary.sessionProvenance } : {}),\n status,\n ...(clock === undefined ? {} : { clock }),\n // The same priority the status copy uses: a refusal outranks the question,\n // and a restarting card is describing the restart, not the run it ended.\n // Background work that needs the reader, such as a failed workflow, is\n // marked the same way while the agent itself is idle.\n awaitingInput:\n (summary.awaitingInput ||\n (summary.activity?.attention === true && summary.phase === 'idle' && summary.dormant !== true)) &&\n attach !== 'refused' &&\n !restarting,\n restarting,\n restartBlocked: summary.dormant !== true && summary.phase !== undefined && summary.phase !== 'idle',\n ...(restart?.error === undefined ? {} : { error: restart.error }),\n ...(summary.git === undefined ? {} : { git: { branch: summary.git.branch, dirty: summary.git.dirty } }),\n ...(summary.groups === undefined || summary.groups.length === 0 ? {} : { groups: summary.groups }),\n ...(profile === undefined || label === undefined\n ? {}\n : {\n profile: {\n name: profile.name,\n label,\n initials: personaInitials(label),\n ...(avatarUrl === undefined ? {} : { avatarUrl }),\n },\n }),\n pendingSetups: (summary.pendingSetups ?? []).map(pendingSetupView),\n };\n}\n\n/** The rail's workspaces in host order, each with its sessions; ungrouped sessions last. */\nexport function buildRailWorkspaces(input: SessionRailModelInput): WebTemplateRailWorkspace[] {\n const ordinals = new Map(input.order.map((id, index) => [id, index + 1]));\n const grouped = new Set<string>();\n const workspaces: WebTemplateRailWorkspace[] = [];\n for (const workspaceId of input.workspaceOrder) {\n const workspace = input.workspacesById[workspaceId];\n if (workspace === undefined) continue;\n const ids = input.order.filter((id) => input.byId[id]?.summary.workspaceId === workspaceId);\n if (\n !ids.length &&\n Object.values(input.byId).some(\n ({ summary }) =>\n summary.workspaceId === workspaceId && summary.sessionProvenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n )\n )\n continue;\n for (const id of ids) grouped.add(id);\n workspaces.push({\n id: workspaceId,\n name: workspaceName(workspace),\n root: workspace.root,\n available: workspace.available !== false,\n legacy: false,\n sessions: ids.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n const legacy = input.order.filter((id) => !grouped.has(id) && input.byId[id] !== undefined);\n if (legacy.length > 0) {\n const root = input.byId[legacy[0]!]!.summary.cwd;\n workspaces.push({\n id: LEGACY_WORKSPACE_ID,\n name: workspaceName({ root }),\n root,\n available: false,\n legacy: true,\n sessions: legacy.map((id) => sessionView(id, ordinals.get(id) ?? 0, input)),\n });\n }\n return workspaces;\n}\n"],"mappings":";;;;AAiBA,MAAa,sBAAsB;AA6BnC,SAAgB,cAAc,WAA4D;CACxF,IAAI,UAAU,MAAM,OAAO,UAAU;CACrC,MAAM,UAAU,UAAU,KAAK,QAAQ,SAAS,EAAE;CAClD,OAAO,QAAQ,MAAM,QAAQ,YAAY,GAAG,IAAI,CAAC,KAAK,UAAU;AAClE;;AAKA,SAAgB,iBAAiB,OAAkD;CACjF,MAAM,YACJ,MAAM,cAAc,uBAChB,2BACA,MAAM,cAAc,qBAClB,uBACA;CACR,MAAM,SACJ,MAAM,WAAW,WACb,GAAG,UAAU,iBACb,MAAM,WAAW,gBACf,GAAG,UAAU,sBACb,GAAG,UAAU;CACrB,MAAM,WACJ,MAAM,cAAc,KAAA,KAAa,MAAM,QAAQ,KAAA,IAC3C,+FACA,MAAM,cAAc,wBAClB,sGACA,MAAM,WAAW,gBACf,8FACA,MAAM,cAAc,uBAClB,8GACA;CACZ,MAAM,gBAAgB,MAAM,WAAW,YAAY,MAAM,WAAW;CACpE,OAAO;EACL,IAAI,MAAM;EACV,MAAM,MAAM;EACZ;EACA,QAAQ,MAAM,WAAW;EACzB,GAAI,gBAAgB,EAAE,SAAS,IAAI,CAAC;CACtC;AACF;;AAGA,SAAgB,kBACd,EAAE,S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UAAU,cAAc;GACnC,QAAQ;GACR,UAAU,IAAI,KAAK,OAAO,YAAY,IAAI,SAAS,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;EACzE,CAAC;CACH;CACA,MAAM,SAAS,MAAM,MAAM,QAAQ,OAAO,CAAC,QAAQ,IAAI,EAAE,KAAK,MAAM,KAAK,QAAQ,KAAA,CAAS;CAC1F,IAAI,OAAO,SAAS,GAAG;EACrB,MAAM,OAAO,MAAM,KAAK,OAAO,GAAI,CAAE,QAAQ;EAC7C,WAAW,KAAK;GACd,IAAI;GACJ,MAAM,cAAc,EAAE,KAAK,CAAC;GAC5B;GACA,WAAW;GACX,QAAQ;GACR,UAAU,OAAO,KAAK,OAAO,YAAY,IAAI,SAAS,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;EAC5E,CAAC;CACH;CACA,OAAO;AACT"}
|
|
@@ -300,9 +300,12 @@ function waitForSession(sessionId, timeoutMs = APPEAR_TIMEOUT_MS) {
|
|
|
300
300
|
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* Reads the focused session's rail entry, or null while nothing is focused. Like the rail, it
|
|
305
|
+
* renders again only when more than `updatedAt` moved, which the hub bumps on unrelated pushes.
|
|
306
|
+
*/
|
|
304
307
|
function useActiveSessionMeta() {
|
|
305
|
-
return (0, _tanstack_react_store.useStore)(sessionsStore, (state) => state.activeId !== null ? state.byId[state.activeId] ?? null : null);
|
|
308
|
+
return (0, _tanstack_react_store.useStore)(sessionsStore, (state) => state.activeId !== null ? state.byId[state.activeId] ?? null : null, (left, right) => sameRailEntry(left ?? void 0, right ?? void 0));
|
|
306
309
|
}
|
|
307
310
|
/**
|
|
308
311
|
* Every rail entry, rendering again only when more than `updatedAt` moved. A
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionsStore.cjs","names":["traceStore","Store","bindSessionApiWorkspace","WORKFLOW_STEP_SESSION_PROVENANCE","WORKFLOW_DISPATCHER_SESSION_PROVENANCE","VOICE_ORCHESTRATOR_SESSION_PROVENANCE","qualifyHostId","splitHostId","useStore"],"sources":["../../../src/web/stores/sessionsStore.ts"],"sourcesContent":["import {\n VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n WORKFLOW_DISPATCHER_SESSION_PROVENANCE,\n WORKFLOW_STEP_SESSION_PROVENANCE,\n} from '@agimon-ai/po-core/hubChannel';\nimport { bindSessionApiWorkspace } from '@agimon-ai/po-core/web';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\n\nimport type { SessionSummary } from '../../types/hub';\nimport { qualifyHostId, splitHostId } from '../lib/hostIdentity';\nimport type { AttachPhase } from '../lib/sessionSummary';\nimport { traceStore } from '../lib/uiTrace';\n\n/** One rail entry: the hub's summary plus this page's view of its connection. */\nexport interface SessionMeta {\n summary: SessionSummary;\n /** summary.attach adjusted for sticky refusals and a lost page socket. */\n attach: AttachPhase;\n reason: string;\n /** Frames replayed into this page's timeline on the last subscribe. */\n replayed: number;\n /** Frames the hub's bounded ring lost before this page subscribed. */\n dropped: number;\n}\n\nexport interface SessionsState {\n /** Session ids in rail order: each parent immediately followed by its children. */\n order: string[];\n byId: Record<string, SessionMeta>;\n activeId: string | null;\n /** URL/tab ownership stays with the parent when a tab focuses another session. */\n tabOwnerId?: string | null;\n /** Destination shown while an autonomous voice handoff changes route and media ownership. */\n transferringToId: string | null;\n /** False until the first snapshot; routing waits for it before redirecting. */\n hydrated: boolean;\n /** The server needs newer client code. Only a reload clears it. */\n updateRequired: boolean;\n updateRequiredHosts?: Readonly<Record<string, boolean>>;\n}\n\n/** The one reason every session shows once the server needs newer client code. */\nexport const UPDATE_REQUIRED_REASON = 'This app is older than the Po server. Update Po to reconnect.';\n\nconst initialState: SessionsState = {\n order: [],\n byId: {},\n activeId: null,\n transferringToId: null,\n hydrated: false,\n updateRequired: false,\n};\n\nexport const sessionsStore = traceStore('sessions', new Store<SessionsState>(initialState));\nbindSessionApiWorkspace((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asSummary(value: unknown): SessionSummary | undefined {\n if (!isRecord(value) || typeof value.id !== 'string' || value.id === '') return undefined;\n return value as unknown as SessionSummary;\n}\n\n/**\n * The parent this session nests under, or undefined when it renders at the top\n * level.\n *\n * A parent that has since closed, this session itself, a parent in another\n * workspace, or a cycle all resolve to undefined. The only safe failure is to\n * render the row where it can still be seen rather than to hide or duplicate it.\n */\nexport function resolveParentId(byId: Record<string, SessionMeta>, id: string, limit?: number): string | undefined {\n const parent = byId[id]?.summary.parentSessionId;\n if (\n parent === undefined ||\n parent === id ||\n byId[parent] === undefined ||\n byId[parent].summary.workspaceId !== byId[id].summary.workspaceId\n )\n return undefined;\n let hops = 0;\n const hopLimit = limit ?? Object.keys(byId).length;\n for (let at: string | undefined = parent; at !== undefined; at = byId[at]?.summary.parentSessionId) {\n if (at === id) return undefined;\n if (++hops > hopLimit) return undefined;\n }\n return parent;\n}\n\n/** Internal sessions keep their history but take no rail row or keyboard ordinal. */\nfunction railHidden(meta: SessionMeta): boolean {\n const provenance = meta.summary.sessionProvenance;\n return (\n provenance === WORKFLOW_STEP_SESSION_PROVENANCE ||\n provenance === WORKFLOW_DISPATCHER_SESSION_PROVENANCE ||\n provenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE\n );\n}\n\n/**\n * Where a session sits in the rail: under its nearest ancestor the rail shows.\n *\n * A fork or worktree a step session opens is a real session, and under a\n * parent the rail leaves out it would never be listed, so it moves up to the\n * first ancestor that is, or becomes a root.\n */\nfunction railParentId(byId: Record<string, SessionMeta>, id: string, limit: number): string | undefined {\n let parent = resolveParentId(byId, id, limit);\n let hops = 0;\n while (parent !== undefined && railHidden(byId[parent]) && hops++ <= limit)\n parent = resolveParentId(byId, parent, limit);\n return parent;\n}\n\n/**\n * The rail's order: roots by creation, each immediately followed by its own\n * children.\n *\n * Ordinal shortcuts index this array positionally, which is why a child sits\n * directly after its parent instead of in a separate group: a worktree spawned\n * from the focused session lands on the next digit. With no lineage present\n * every session is a root and this produces exactly the flat creation sort it\n * replaces.\n */\nfunction sortedOrder(byId: Record<string, SessionMeta>): string[] {\n // A workflow step's session is read inside its workflow, never from the rail, so it\n // takes no row and no ordinal. It stays in `byId` for that view to follow. A\n // workflow dispatcher is a short-lived helper whose runs belong to its parent.\n const byCreation = (left: string, right: string): number => {\n const a = byId[left].summary;\n const b = byId[right].summary;\n return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);\n };\n const children = new Map<string, string[]>();\n const roots: string[] = [];\n const ids = Object.keys(byId);\n for (const id of ids) {\n if (railHidden(byId[id])) continue;\n const parent = railParentId(byId, id, ids.length);\n if (parent === undefined) {\n roots.push(id);\n continue;\n }\n const siblings = children.get(parent);\n if (siblings === undefined) children.set(parent, [id]);\n else siblings.push(id);\n }\n roots.sort(byCreation);\n for (const siblings of children.values()) siblings.sort(byCreation);\n const order: string[] = [];\n const visit = (id: string): void => {\n order.push(id);\n for (const child of children.get(id) ?? []) visit(child);\n };\n for (const root of roots) visit(root);\n return order;\n}\n\n/** Summaries are JSON wire values; object key insertion order is not meaningful. */\nfunction summaryValueEqual(left: unknown, right: unknown): boolean {\n if (left === right) return true;\n if (Array.isArray(left) || Array.isArray(right))\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => summaryValueEqual(value, right[index]))\n );\n if (!isRecord(left) || !isRecord(right)) return false;\n const keys = Object.keys(left);\n return (\n keys.length === Object.keys(right).length &&\n keys.every((key) => Object.hasOwn(right, key) && summaryValueEqual(left[key], right[key]))\n );\n}\n\n/** True when two rail entries differ at most in `summary.updatedAt`, which the hub bumps on every settled message. */\nexport function sameRailEntry(left: SessionMeta | undefined, right: SessionMeta | undefined): boolean {\n if (left === right) return true;\n if (left === undefined || right === undefined) return false;\n return (\n left.attach === right.attach &&\n left.reason === right.reason &&\n left.replayed === right.replayed &&\n left.dropped === right.dropped &&\n summaryValueEqual({ ...left.summary, updatedAt: '' }, { ...right.summary, updatedAt: '' })\n );\n}\n\n/** `byId` compared the way the rail reads it: an `updatedAt`-only change is no change. */\nexport function sameRailEntries(left: Record<string, SessionMeta>, right: Record<string, SessionMeta>): boolean {\n if (left === right) return true;\n const ids = Object.keys(left);\n return ids.length === Object.keys(right).length && ids.every((id) => sameRailEntry(left[id], right[id]));\n}\n\nfunction mergeSummary(\n previous: SessionMeta | undefined,\n summary: SessionSummary,\n updateRequired: boolean,\n): SessionMeta {\n // A refusal stays sticky while the hub retries. Only a successful attach clears it.\n const sticky = previous?.attach === 'refused' && summary.attach === 'connecting';\n // HTTP still lists sessions after the socket stopped for good.\n const attach = updateRequired ? 'offline' : sticky ? 'refused' : summary.attach;\n const reason = updateRequired ? UPDATE_REQUIRED_REASON : sticky ? previous.reason : (summary.attachReason ?? '');\n const retainedSummary = previous && summaryValueEqual(previous.summary, summary) ? previous.summary : summary;\n if (previous && retainedSummary === previous.summary && attach === previous.attach && reason === previous.reason)\n return previous;\n return {\n summary: retainedSummary,\n attach,\n reason,\n replayed: previous?.replayed ?? 0,\n dropped: previous?.dropped ?? 0,\n };\n}\n\nfunction retainOrder(previous: string[], byId: Record<string, SessionMeta>): string[] {\n const next = sortedOrder(byId);\n return previous.length === next.length && previous.every((id, index) => id === next[index]) ? previous : next;\n}\n\nfunction hostSummary(summary: SessionSummary, hostId?: string): SessionSummary {\n if (hostId === undefined) return summary;\n return {\n ...summary,\n id: qualifyHostId(hostId, summary.id),\n ...(summary.workspaceId === undefined ? {} : { workspaceId: qualifyHostId(hostId, summary.workspaceId) }),\n ...(summary.parentSessionId === undefined\n ? {}\n : { parentSessionId: qualifyHostId(hostId, summary.parentSessionId) }),\n };\n}\nfunction belongsToHost(key: string, hostId?: string): boolean {\n return splitHostId(key)?.hostId === hostId;\n}\nfunction needsUpdate(state: SessionsState, key: string): boolean {\n const hostId = splitHostId(key)?.hostId;\n return hostId === undefined ? state.updateRequired : state.updateRequiredHosts?.[hostId] === true;\n}\n\nexport function applySessionsSnapshot(frame: Record<string, unknown>, hostId?: string): void {\n if (!Array.isArray(frame.sessions)) return;\n const summaries = frame.sessions\n .map(asSummary)\n .filter((summary): summary is SessionSummary => Boolean(summary))\n .map((summary) => hostSummary(summary, hostId));\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = Object.fromEntries(\n Object.entries(state.byId).filter(([id]) => !belongsToHost(id, hostId)),\n );\n for (const summary of summaries)\n byId[summary.id] = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (\n state.hydrated &&\n Object.keys(state.byId).length === Object.keys(byId).length &&\n Object.keys(byId).every((id) => byId[id] === state.byId[id])\n )\n return state;\n return { ...state, byId, order: retainOrder(state.order, byId), hydrated: true };\n });\n}\n\nexport function applySessionUpsert(frame: Record<string, unknown>, hostId?: string): void {\n const parsed = asSummary(frame.session);\n if (!parsed) return;\n const summary = hostSummary(parsed, hostId);\n sessionsStore.setState((state) => {\n const meta = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (meta === state.byId[summary.id]) return state;\n const byId = { ...state.byId, [summary.id]: meta };\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\nexport function applySessionRemoved(frame: Record<string, unknown>, hostId?: string): void {\n if (typeof frame.sessionId !== 'string') return;\n const sessionId = hostId === undefined ? frame.sessionId : qualifyHostId(hostId, frame.sessionId);\n sessionsStore.setState((state) => {\n if (!(sessionId in state.byId)) return state;\n const byId = { ...state.byId };\n delete byId[sessionId];\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\n/** Records what the hub replayed into this page when a subscription started. */\nexport function applySessionBacklog(sessionId: string, replayed: number, dropped: number): void {\n sessionsStore.setState((state) => {\n const meta = state.byId[sessionId];\n if (!meta) return state;\n return { ...state, byId: { ...state.byId, [sessionId]: { ...meta, replayed, dropped } } };\n });\n}\n\n/**\n * The page socket died; every session is unreachable until it comes back.\n * Self-healing: the snapshot on reconnect restores the real states.\n */\nexport function markSocketClosed(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n if (!belongsToHost(id, hostId)) {\n byId[id] = meta;\n continue;\n }\n byId[id] = {\n ...meta,\n attach: 'offline',\n reason: needsUpdate(state, id) ? UPDATE_REQUIRED_REASON : 'The cockpit lost its bridge.',\n };\n }\n return { ...state, byId };\n });\n}\n\n/**\n * The server needs newer client code; every session is unreachable until the\n * page reloads with it. Unlike a closed socket nothing here heals on its own,\n * so later session lists keep the same state and reason.\n */\nexport function markUpdateRequired(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n byId[id] = belongsToHost(id, hostId) ? { ...meta, attach: 'offline', reason: UPDATE_REQUIRED_REASON } : meta;\n }\n return hostId === undefined\n ? { ...state, byId, updateRequired: true }\n : { ...state, byId, updateRequiredHosts: { ...state.updateRequiredHosts, [hostId]: true } };\n });\n}\n\nconst APPEAR_TIMEOUT_MS = 15_000;\n\n/**\n * Resolves once the session shows up in the rail, or false on timeout.\n *\n * A freshly created session exists on disk before its upsert reaches this\n * page; navigating to it too early trips the unknown-session fallback and\n * bounces the user back. Waiting here is what makes \"create, then land on it\"\n * one motion.\n */\nexport function waitForSession(sessionId: string, timeoutMs = APPEAR_TIMEOUT_MS): Promise<boolean> {\n if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);\n return new Promise((resolve) => {\n const finish = (found: boolean): void => {\n clearTimeout(timer);\n subscription.unsubscribe();\n resolve(found);\n };\n const subscription = sessionsStore.subscribe(() => {\n if (sessionId in sessionsStore.state.byId) finish(true);\n });\n const timer = setTimeout(() => finish(false), timeoutMs);\n });\n}\n\n/** Reads the focused session's rail entry, or null while nothing is focused. */\nexport function useActiveSessionMeta(): SessionMeta | null {\n return useStore(sessionsStore, (state) => (state.activeId !== null ? (state.byId[state.activeId] ?? null) : null));\n}\n\n/**\n * Every rail entry, rendering again only when more than `updatedAt` moved. A\n * reader that needs that field fresh, such as a recency sort, reads\n * `sessionsStore.state` while it renders.\n */\nexport function useRailEntries(): Record<string, SessionMeta> {\n return useStore(sessionsStore, (state) => state.byId, sameRailEntries);\n}\n\n/** One session's rail entry, rendering again only when more than `updatedAt` moved. */\nexport function useRailEntry(sessionId: string | null): SessionMeta | undefined {\n return useStore(sessionsStore, (state) => (sessionId === null ? undefined : state.byId[sessionId]), sameRailEntry);\n}\n\n/**\n * True once the hub has answered and reported no sessions at all.\n *\n * Several surfaces stand down on this, so the rule is named once rather than\n * spelled out at each of them. The hydration half is what keeps it honest: an\n * empty order before the first snapshot only means the hub has not answered\n * yet, and treating that as \"no sessions\" would flash an onboarding screen at\n * someone who has ten.\n */\nexport function noSessions(state: SessionsState): boolean {\n return state.hydrated && state.order.length === 0;\n}\n\nexport function useNoSessions(): boolean {\n return useStore(sessionsStore, noSessions);\n}\n\nexport function setActiveSession(sessionId: string | null, tabOwnerId: string | null = sessionId): void {\n sessionsStore.setState((state) =>\n state.activeId === sessionId && (state.tabOwnerId ?? state.activeId) === tabOwnerId\n ? state\n : { ...state, activeId: sessionId, tabOwnerId },\n );\n}\n\nexport function beginSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? state : { ...state, transferringToId: sessionId },\n );\n}\n\nexport function completeSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? { ...state, transferringToId: null } : state,\n );\n}\n\nexport function activeSessionId(): string | null {\n return sessionsStore.state.activeId;\n}\n\nexport function resetSessions(): void {\n sessionsStore.setState(() => initialState);\n}\n"],"mappings":";;;;;;;;AA2CA,MAAa,yBAAyB;AAEtC,MAAM,eAA8B;CAClC,OAAO,CAAC;CACR,MAAM,CAAC;CACP,UA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pC,cAAc,eAAe,YAAY;AAC3C"}
|
|
1
|
+
{"version":3,"file":"sessionsStore.cjs","names":["traceStore","Store","bindSessionApiWorkspace","WORKFLOW_STEP_SESSION_PROVENANCE","WORKFLOW_DISPATCHER_SESSION_PROVENANCE","VOICE_ORCHESTRATOR_SESSION_PROVENANCE","qualifyHostId","splitHostId","useStore"],"sources":["../../../src/web/stores/sessionsStore.ts"],"sourcesContent":["import {\n VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n WORKFLOW_DISPATCHER_SESSION_PROVENANCE,\n WORKFLOW_STEP_SESSION_PROVENANCE,\n} from '@agimon-ai/po-core/hubChannel';\nimport { bindSessionApiWorkspace } from '@agimon-ai/po-core/web';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\n\nimport type { SessionSummary } from '../../types/hub';\nimport { qualifyHostId, splitHostId } from '../lib/hostIdentity';\nimport type { AttachPhase } from '../lib/sessionSummary';\nimport { traceStore } from '../lib/uiTrace';\n\n/** One rail entry: the hub's summary plus this page's view of its connection. */\nexport interface SessionMeta {\n summary: SessionSummary;\n /** summary.attach adjusted for sticky refusals and a lost page socket. */\n attach: AttachPhase;\n reason: string;\n /** Frames replayed into this page's timeline on the last subscribe. */\n replayed: number;\n /** Frames the hub's bounded ring lost before this page subscribed. */\n dropped: number;\n}\n\nexport interface SessionsState {\n /** Session ids in rail order: each parent immediately followed by its children. */\n order: string[];\n byId: Record<string, SessionMeta>;\n activeId: string | null;\n /** URL/tab ownership stays with the parent when a tab focuses another session. */\n tabOwnerId?: string | null;\n /** Destination shown while an autonomous voice handoff changes route and media ownership. */\n transferringToId: string | null;\n /** False until the first snapshot; routing waits for it before redirecting. */\n hydrated: boolean;\n /** The server needs newer client code. Only a reload clears it. */\n updateRequired: boolean;\n updateRequiredHosts?: Readonly<Record<string, boolean>>;\n}\n\n/** The one reason every session shows once the server needs newer client code. */\nexport const UPDATE_REQUIRED_REASON = 'This app is older than the Po server. Update Po to reconnect.';\n\nconst initialState: SessionsState = {\n order: [],\n byId: {},\n activeId: null,\n transferringToId: null,\n hydrated: false,\n updateRequired: false,\n};\n\nexport const sessionsStore = traceStore('sessions', new Store<SessionsState>(initialState));\nbindSessionApiWorkspace((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asSummary(value: unknown): SessionSummary | undefined {\n if (!isRecord(value) || typeof value.id !== 'string' || value.id === '') return undefined;\n return value as unknown as SessionSummary;\n}\n\n/**\n * The parent this session nests under, or undefined when it renders at the top\n * level.\n *\n * A parent that has since closed, this session itself, a parent in another\n * workspace, or a cycle all resolve to undefined. The only safe failure is to\n * render the row where it can still be seen rather than to hide or duplicate it.\n */\nexport function resolveParentId(byId: Record<string, SessionMeta>, id: string, limit?: number): string | undefined {\n const parent = byId[id]?.summary.parentSessionId;\n if (\n parent === undefined ||\n parent === id ||\n byId[parent] === undefined ||\n byId[parent].summary.workspaceId !== byId[id].summary.workspaceId\n )\n return undefined;\n let hops = 0;\n const hopLimit = limit ?? Object.keys(byId).length;\n for (let at: string | undefined = parent; at !== undefined; at = byId[at]?.summary.parentSessionId) {\n if (at === id) return undefined;\n if (++hops > hopLimit) return undefined;\n }\n return parent;\n}\n\n/** Internal sessions keep their history but take no rail row or keyboard ordinal. */\nfunction railHidden(meta: SessionMeta): boolean {\n const provenance = meta.summary.sessionProvenance;\n return (\n provenance === WORKFLOW_STEP_SESSION_PROVENANCE ||\n provenance === WORKFLOW_DISPATCHER_SESSION_PROVENANCE ||\n provenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE\n );\n}\n\n/**\n * Where a session sits in the rail: under its nearest ancestor the rail shows.\n *\n * A fork or worktree a step session opens is a real session, and under a\n * parent the rail leaves out it would never be listed, so it moves up to the\n * first ancestor that is, or becomes a root.\n */\nfunction railParentId(byId: Record<string, SessionMeta>, id: string, limit: number): string | undefined {\n let parent = resolveParentId(byId, id, limit);\n let hops = 0;\n while (parent !== undefined && railHidden(byId[parent]) && hops++ <= limit)\n parent = resolveParentId(byId, parent, limit);\n return parent;\n}\n\n/**\n * The rail's order: roots by creation, each immediately followed by its own\n * children.\n *\n * Ordinal shortcuts index this array positionally, which is why a child sits\n * directly after its parent instead of in a separate group: a worktree spawned\n * from the focused session lands on the next digit. With no lineage present\n * every session is a root and this produces exactly the flat creation sort it\n * replaces.\n */\nfunction sortedOrder(byId: Record<string, SessionMeta>): string[] {\n // A workflow step's session is read inside its workflow, never from the rail, so it\n // takes no row and no ordinal. It stays in `byId` for that view to follow. A\n // workflow dispatcher is a short-lived helper whose runs belong to its parent.\n const byCreation = (left: string, right: string): number => {\n const a = byId[left].summary;\n const b = byId[right].summary;\n return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);\n };\n const children = new Map<string, string[]>();\n const roots: string[] = [];\n const ids = Object.keys(byId);\n for (const id of ids) {\n if (railHidden(byId[id])) continue;\n const parent = railParentId(byId, id, ids.length);\n if (parent === undefined) {\n roots.push(id);\n continue;\n }\n const siblings = children.get(parent);\n if (siblings === undefined) children.set(parent, [id]);\n else siblings.push(id);\n }\n roots.sort(byCreation);\n for (const siblings of children.values()) siblings.sort(byCreation);\n const order: string[] = [];\n const visit = (id: string): void => {\n order.push(id);\n for (const child of children.get(id) ?? []) visit(child);\n };\n for (const root of roots) visit(root);\n return order;\n}\n\n/** Summaries are JSON wire values; object key insertion order is not meaningful. */\nfunction summaryValueEqual(left: unknown, right: unknown): boolean {\n if (left === right) return true;\n if (Array.isArray(left) || Array.isArray(right))\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => summaryValueEqual(value, right[index]))\n );\n if (!isRecord(left) || !isRecord(right)) return false;\n const keys = Object.keys(left);\n return (\n keys.length === Object.keys(right).length &&\n keys.every((key) => Object.hasOwn(right, key) && summaryValueEqual(left[key], right[key]))\n );\n}\n\n/** True when two rail entries differ at most in `summary.updatedAt`, which the hub bumps on every settled message. */\nexport function sameRailEntry(left: SessionMeta | undefined, right: SessionMeta | undefined): boolean {\n if (left === right) return true;\n if (left === undefined || right === undefined) return false;\n return (\n left.attach === right.attach &&\n left.reason === right.reason &&\n left.replayed === right.replayed &&\n left.dropped === right.dropped &&\n summaryValueEqual({ ...left.summary, updatedAt: '' }, { ...right.summary, updatedAt: '' })\n );\n}\n\n/** `byId` compared the way the rail reads it: an `updatedAt`-only change is no change. */\nexport function sameRailEntries(left: Record<string, SessionMeta>, right: Record<string, SessionMeta>): boolean {\n if (left === right) return true;\n const ids = Object.keys(left);\n return ids.length === Object.keys(right).length && ids.every((id) => sameRailEntry(left[id], right[id]));\n}\n\nfunction mergeSummary(\n previous: SessionMeta | undefined,\n summary: SessionSummary,\n updateRequired: boolean,\n): SessionMeta {\n // A refusal stays sticky while the hub retries. Only a successful attach clears it.\n const sticky = previous?.attach === 'refused' && summary.attach === 'connecting';\n // HTTP still lists sessions after the socket stopped for good.\n const attach = updateRequired ? 'offline' : sticky ? 'refused' : summary.attach;\n const reason = updateRequired ? UPDATE_REQUIRED_REASON : sticky ? previous.reason : (summary.attachReason ?? '');\n const retainedSummary = previous && summaryValueEqual(previous.summary, summary) ? previous.summary : summary;\n if (previous && retainedSummary === previous.summary && attach === previous.attach && reason === previous.reason)\n return previous;\n return {\n summary: retainedSummary,\n attach,\n reason,\n replayed: previous?.replayed ?? 0,\n dropped: previous?.dropped ?? 0,\n };\n}\n\nfunction retainOrder(previous: string[], byId: Record<string, SessionMeta>): string[] {\n const next = sortedOrder(byId);\n return previous.length === next.length && previous.every((id, index) => id === next[index]) ? previous : next;\n}\n\nfunction hostSummary(summary: SessionSummary, hostId?: string): SessionSummary {\n if (hostId === undefined) return summary;\n return {\n ...summary,\n id: qualifyHostId(hostId, summary.id),\n ...(summary.workspaceId === undefined ? {} : { workspaceId: qualifyHostId(hostId, summary.workspaceId) }),\n ...(summary.parentSessionId === undefined\n ? {}\n : { parentSessionId: qualifyHostId(hostId, summary.parentSessionId) }),\n };\n}\nfunction belongsToHost(key: string, hostId?: string): boolean {\n return splitHostId(key)?.hostId === hostId;\n}\nfunction needsUpdate(state: SessionsState, key: string): boolean {\n const hostId = splitHostId(key)?.hostId;\n return hostId === undefined ? state.updateRequired : state.updateRequiredHosts?.[hostId] === true;\n}\n\nexport function applySessionsSnapshot(frame: Record<string, unknown>, hostId?: string): void {\n if (!Array.isArray(frame.sessions)) return;\n const summaries = frame.sessions\n .map(asSummary)\n .filter((summary): summary is SessionSummary => Boolean(summary))\n .map((summary) => hostSummary(summary, hostId));\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = Object.fromEntries(\n Object.entries(state.byId).filter(([id]) => !belongsToHost(id, hostId)),\n );\n for (const summary of summaries)\n byId[summary.id] = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (\n state.hydrated &&\n Object.keys(state.byId).length === Object.keys(byId).length &&\n Object.keys(byId).every((id) => byId[id] === state.byId[id])\n )\n return state;\n return { ...state, byId, order: retainOrder(state.order, byId), hydrated: true };\n });\n}\n\nexport function applySessionUpsert(frame: Record<string, unknown>, hostId?: string): void {\n const parsed = asSummary(frame.session);\n if (!parsed) return;\n const summary = hostSummary(parsed, hostId);\n sessionsStore.setState((state) => {\n const meta = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (meta === state.byId[summary.id]) return state;\n const byId = { ...state.byId, [summary.id]: meta };\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\nexport function applySessionRemoved(frame: Record<string, unknown>, hostId?: string): void {\n if (typeof frame.sessionId !== 'string') return;\n const sessionId = hostId === undefined ? frame.sessionId : qualifyHostId(hostId, frame.sessionId);\n sessionsStore.setState((state) => {\n if (!(sessionId in state.byId)) return state;\n const byId = { ...state.byId };\n delete byId[sessionId];\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\n/** Records what the hub replayed into this page when a subscription started. */\nexport function applySessionBacklog(sessionId: string, replayed: number, dropped: number): void {\n sessionsStore.setState((state) => {\n const meta = state.byId[sessionId];\n if (!meta) return state;\n return { ...state, byId: { ...state.byId, [sessionId]: { ...meta, replayed, dropped } } };\n });\n}\n\n/**\n * The page socket died; every session is unreachable until it comes back.\n * Self-healing: the snapshot on reconnect restores the real states.\n */\nexport function markSocketClosed(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n if (!belongsToHost(id, hostId)) {\n byId[id] = meta;\n continue;\n }\n byId[id] = {\n ...meta,\n attach: 'offline',\n reason: needsUpdate(state, id) ? UPDATE_REQUIRED_REASON : 'The cockpit lost its bridge.',\n };\n }\n return { ...state, byId };\n });\n}\n\n/**\n * The server needs newer client code; every session is unreachable until the\n * page reloads with it. Unlike a closed socket nothing here heals on its own,\n * so later session lists keep the same state and reason.\n */\nexport function markUpdateRequired(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n byId[id] = belongsToHost(id, hostId) ? { ...meta, attach: 'offline', reason: UPDATE_REQUIRED_REASON } : meta;\n }\n return hostId === undefined\n ? { ...state, byId, updateRequired: true }\n : { ...state, byId, updateRequiredHosts: { ...state.updateRequiredHosts, [hostId]: true } };\n });\n}\n\nconst APPEAR_TIMEOUT_MS = 15_000;\n\n/**\n * Resolves once the session shows up in the rail, or false on timeout.\n *\n * A freshly created session exists on disk before its upsert reaches this\n * page; navigating to it too early trips the unknown-session fallback and\n * bounces the user back. Waiting here is what makes \"create, then land on it\"\n * one motion.\n */\nexport function waitForSession(sessionId: string, timeoutMs = APPEAR_TIMEOUT_MS): Promise<boolean> {\n if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);\n return new Promise((resolve) => {\n const finish = (found: boolean): void => {\n clearTimeout(timer);\n subscription.unsubscribe();\n resolve(found);\n };\n const subscription = sessionsStore.subscribe(() => {\n if (sessionId in sessionsStore.state.byId) finish(true);\n });\n const timer = setTimeout(() => finish(false), timeoutMs);\n });\n}\n\n/**\n * Reads the focused session's rail entry, or null while nothing is focused. Like the rail, it\n * renders again only when more than `updatedAt` moved, which the hub bumps on unrelated pushes.\n */\nexport function useActiveSessionMeta(): SessionMeta | null {\n return useStore(\n sessionsStore,\n (state) => (state.activeId !== null ? (state.byId[state.activeId] ?? null) : null),\n (left, right) => sameRailEntry(left ?? undefined, right ?? undefined),\n );\n}\n\n/**\n * Every rail entry, rendering again only when more than `updatedAt` moved. A\n * reader that needs that field fresh, such as a recency sort, reads\n * `sessionsStore.state` while it renders.\n */\nexport function useRailEntries(): Record<string, SessionMeta> {\n return useStore(sessionsStore, (state) => state.byId, sameRailEntries);\n}\n\n/** One session's rail entry, rendering again only when more than `updatedAt` moved. */\nexport function useRailEntry(sessionId: string | null): SessionMeta | undefined {\n return useStore(sessionsStore, (state) => (sessionId === null ? undefined : state.byId[sessionId]), sameRailEntry);\n}\n\n/**\n * True once the hub has answered and reported no sessions at all.\n *\n * Several surfaces stand down on this, so the rule is named once rather than\n * spelled out at each of them. The hydration half is what keeps it honest: an\n * empty order before the first snapshot only means the hub has not answered\n * yet, and treating that as \"no sessions\" would flash an onboarding screen at\n * someone who has ten.\n */\nexport function noSessions(state: SessionsState): boolean {\n return state.hydrated && state.order.length === 0;\n}\n\nexport function useNoSessions(): boolean {\n return useStore(sessionsStore, noSessions);\n}\n\nexport function setActiveSession(sessionId: string | null, tabOwnerId: string | null = sessionId): void {\n sessionsStore.setState((state) =>\n state.activeId === sessionId && (state.tabOwnerId ?? state.activeId) === tabOwnerId\n ? state\n : { ...state, activeId: sessionId, tabOwnerId },\n );\n}\n\nexport function beginSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? state : { ...state, transferringToId: sessionId },\n );\n}\n\nexport function completeSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? { ...state, transferringToId: null } : state,\n );\n}\n\nexport function activeSessionId(): string | null {\n return sessionsStore.state.activeId;\n}\n\nexport function resetSessions(): void {\n sessionsStore.setState(() => initialState);\n}\n"],"mappings":";;;;;;;;AA2CA,MAAa,yBAAyB;AAEtC,MAAM,eAA8B;CAClC,OAAO,CAAC;CACR,MAAM,CAAC;CACP,UAAU;CACV,kBAAkB;CAClB,UAAU;CACV,gBAAgB;AAClB;AAEA,MAAa,gBAAgBA,gBAAAA,WAAW,YAAY,IAAIC,gBAAAA,MAAqB,YAAY,CAAC;CAC1FC,GAAAA,uBAAAA,wBAAAA,EAAyB,cAAc,cAAc,MAAM,KAAK,UAAU,EAAE,QAAQ,WAAW;AAE/F,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,UAAU,OAA4C;CAC7D,IAAI,CAAC,SAAS,KAAK,KAAK,OAAO,MAAM,OAAO,YAAY,MAAM,OAAO,IAAI,OAAO,KAAA;CAChF,OAAO;AACT;;;;;;;;;AAUA,SAAgB,gBAAgB,MAAmC,IAAY,OAAoC;CACjH,MAAM,SAAS,KAAK,GAAG,EAAE,QAAQ;CACjC,IACE,WAAW,KAAA,KACX,WAAW,MACX,KAAK,YAAY,KAAA,KACjB,KAAK,OAAO,CAAC,QAAQ,gBAAgB,KAAK,GAAG,CAAC,QAAQ,aAEtD,OAAO,KAAA;CACT,IAAI,OAAO;CACX,MAAM,WAAW,SAAS,OAAO,KAAK,IAAI,CAAC,CAAC;CAC5C,KAAK,IAAI,KAAyB,QAAQ,OAAO,KAAA,GAAW,KAAK,KAAK,GAAG,EAAE,QAAQ,iBAAiB;EAClG,IAAI,OAAO,IAAI,OAAO,KAAA;EACtB,IAAI,EAAE,OAAO,UAAU,OAAO,KAAA;CAChC;CACA,OAAO;AACT;;AAGA,SAAS,WAAW,MAA4B;CAC9C,MAAM,aAAa,KAAK,QAAQ;CAChC,OACE,eA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,MAAM,qBAAqB,YAAY,QAAQ;EAAE,GAAG;EAAO,kBAAkB;CAAU,CACzF;AACF;AAEA,SAAgB,wBAAwB,WAAyB;CAC/D,cAAc,UAAU,UACtB,MAAM,qBAAqB,YAAY;EAAE,GAAG;EAAO,kBAAkB;CAAK,IAAI,KAChF;AACF;AAEA,SAAgB,kBAAiC;CAC/C,OAAO,cAAc,MAAM;AAC7B;AAEA,SAAgB,gBAAsB;CACpC,cAAc,eAAe,YAAY;AAC3C"}
|
|
@@ -69,7 +69,10 @@ export declare function markUpdateRequired(hostId?: string): void;
|
|
|
69
69
|
* one motion.
|
|
70
70
|
*/
|
|
71
71
|
export declare function waitForSession(sessionId: string, timeoutMs?: number): Promise<boolean>;
|
|
72
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Reads the focused session's rail entry, or null while nothing is focused. Like the rail, it
|
|
74
|
+
* renders again only when more than `updatedAt` moved, which the hub bumps on unrelated pushes.
|
|
75
|
+
*/
|
|
73
76
|
export declare function useActiveSessionMeta(): SessionMeta | null;
|
|
74
77
|
/**
|
|
75
78
|
* Every rail entry, rendering again only when more than `updatedAt` moved. A
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionsStore.d.mts","names":[],"sources":["../../../src/web/stores/sessionsStore.ts"],"mappings":";;;;;iBAeiB;EACf,SAAS;;EAET,QAAQ;EACR;;EAEA;;EAEA;;iBAGe;;EAEf;EACA,MAAM,eAAe;EACrB;;EAEA;;EAEA;;EAEA;;EAEA;EACA,sBAAsB,SAAS;;;qBAIpB;qBAWA,eAAa,MAAA;;;;;;;;;wBAoBV,gBAAgB,MAAM,eAAe,cAAc,YAAY;;wBA0G/D,cAAc,MAAM,yBAAyB,OAAO;;wBAapD,gBAAgB,MAAM,eAAe,cAAc,OAAO,eAAe;wBAoDzE,sBAAsB,OAAO,yBAAyB;wBAsBtD,mBAAmB,OAAO,yBAAyB;wBAYnD,oBAAoB,OAAO,yBAAyB;;wBAYpD,oBAAoB,mBAAmB,kBAAkB;;;;;wBAYzD,iBAAiB;;;;;;wBAuBjB,mBAAmB;;;;;;;;;wBAsBnB,eAAe,mBAAmB,qBAAgC
|
|
1
|
+
{"version":3,"file":"sessionsStore.d.mts","names":[],"sources":["../../../src/web/stores/sessionsStore.ts"],"mappings":";;;;;iBAeiB;EACf,SAAS;;EAET,QAAQ;EACR;;EAEA;;EAEA;;iBAGe;;EAEf;EACA,MAAM,eAAe;EACrB;;EAEA;;EAEA;;EAEA;;EAEA;EACA,sBAAsB,SAAS;;;qBAIpB;qBAWA,eAAa,MAAA;;;;;;;;;wBAoBV,gBAAgB,MAAM,eAAe,cAAc,YAAY;;wBA0G/D,cAAc,MAAM,yBAAyB,OAAO;;wBAapD,gBAAgB,MAAM,eAAe,cAAc,OAAO,eAAe;wBAoDzE,sBAAsB,OAAO,yBAAyB;wBAsBtD,mBAAmB,OAAO,yBAAyB;wBAYnD,oBAAoB,OAAO,yBAAyB;;wBAYpD,oBAAoB,mBAAmB,kBAAkB;;;;;wBAYzD,iBAAiB;;;;;;wBAuBjB,mBAAmB;;;;;;;;;wBAsBnB,eAAe,mBAAmB,qBAAgC;;;;;wBAmBlE,wBAAwB;;;;;;wBAaxB,kBAAkB,eAAe;;wBAKjC,aAAa,2BAA2B;;;;;;;;;;wBAaxC,WAAW,OAAO;wBAIlB;wBAIA,iBAAiB,0BAA0B;wBAQ3C,qBAAqB;wBAMrB,wBAAwB;wBAMxB;wBAIA"}
|
|
@@ -300,9 +300,12 @@ function waitForSession(sessionId, timeoutMs = APPEAR_TIMEOUT_MS) {
|
|
|
300
300
|
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* Reads the focused session's rail entry, or null while nothing is focused. Like the rail, it
|
|
305
|
+
* renders again only when more than `updatedAt` moved, which the hub bumps on unrelated pushes.
|
|
306
|
+
*/
|
|
304
307
|
function useActiveSessionMeta() {
|
|
305
|
-
return useStore(sessionsStore, (state) => state.activeId !== null ? state.byId[state.activeId] ?? null : null);
|
|
308
|
+
return useStore(sessionsStore, (state) => state.activeId !== null ? state.byId[state.activeId] ?? null : null, (left, right) => sameRailEntry(left ?? void 0, right ?? void 0));
|
|
306
309
|
}
|
|
307
310
|
/**
|
|
308
311
|
* Every rail entry, rendering again only when more than `updatedAt` moved. A
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionsStore.mjs","names":[],"sources":["../../../src/web/stores/sessionsStore.ts"],"sourcesContent":["import {\n VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n WORKFLOW_DISPATCHER_SESSION_PROVENANCE,\n WORKFLOW_STEP_SESSION_PROVENANCE,\n} from '@agimon-ai/po-core/hubChannel';\nimport { bindSessionApiWorkspace } from '@agimon-ai/po-core/web';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\n\nimport type { SessionSummary } from '../../types/hub';\nimport { qualifyHostId, splitHostId } from '../lib/hostIdentity';\nimport type { AttachPhase } from '../lib/sessionSummary';\nimport { traceStore } from '../lib/uiTrace';\n\n/** One rail entry: the hub's summary plus this page's view of its connection. */\nexport interface SessionMeta {\n summary: SessionSummary;\n /** summary.attach adjusted for sticky refusals and a lost page socket. */\n attach: AttachPhase;\n reason: string;\n /** Frames replayed into this page's timeline on the last subscribe. */\n replayed: number;\n /** Frames the hub's bounded ring lost before this page subscribed. */\n dropped: number;\n}\n\nexport interface SessionsState {\n /** Session ids in rail order: each parent immediately followed by its children. */\n order: string[];\n byId: Record<string, SessionMeta>;\n activeId: string | null;\n /** URL/tab ownership stays with the parent when a tab focuses another session. */\n tabOwnerId?: string | null;\n /** Destination shown while an autonomous voice handoff changes route and media ownership. */\n transferringToId: string | null;\n /** False until the first snapshot; routing waits for it before redirecting. */\n hydrated: boolean;\n /** The server needs newer client code. Only a reload clears it. */\n updateRequired: boolean;\n updateRequiredHosts?: Readonly<Record<string, boolean>>;\n}\n\n/** The one reason every session shows once the server needs newer client code. */\nexport const UPDATE_REQUIRED_REASON = 'This app is older than the Po server. Update Po to reconnect.';\n\nconst initialState: SessionsState = {\n order: [],\n byId: {},\n activeId: null,\n transferringToId: null,\n hydrated: false,\n updateRequired: false,\n};\n\nexport const sessionsStore = traceStore('sessions', new Store<SessionsState>(initialState));\nbindSessionApiWorkspace((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asSummary(value: unknown): SessionSummary | undefined {\n if (!isRecord(value) || typeof value.id !== 'string' || value.id === '') return undefined;\n return value as unknown as SessionSummary;\n}\n\n/**\n * The parent this session nests under, or undefined when it renders at the top\n * level.\n *\n * A parent that has since closed, this session itself, a parent in another\n * workspace, or a cycle all resolve to undefined. The only safe failure is to\n * render the row where it can still be seen rather than to hide or duplicate it.\n */\nexport function resolveParentId(byId: Record<string, SessionMeta>, id: string, limit?: number): string | undefined {\n const parent = byId[id]?.summary.parentSessionId;\n if (\n parent === undefined ||\n parent === id ||\n byId[parent] === undefined ||\n byId[parent].summary.workspaceId !== byId[id].summary.workspaceId\n )\n return undefined;\n let hops = 0;\n const hopLimit = limit ?? Object.keys(byId).length;\n for (let at: string | undefined = parent; at !== undefined; at = byId[at]?.summary.parentSessionId) {\n if (at === id) return undefined;\n if (++hops > hopLimit) return undefined;\n }\n return parent;\n}\n\n/** Internal sessions keep their history but take no rail row or keyboard ordinal. */\nfunction railHidden(meta: SessionMeta): boolean {\n const provenance = meta.summary.sessionProvenance;\n return (\n provenance === WORKFLOW_STEP_SESSION_PROVENANCE ||\n provenance === WORKFLOW_DISPATCHER_SESSION_PROVENANCE ||\n provenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE\n );\n}\n\n/**\n * Where a session sits in the rail: under its nearest ancestor the rail shows.\n *\n * A fork or worktree a step session opens is a real session, and under a\n * parent the rail leaves out it would never be listed, so it moves up to the\n * first ancestor that is, or becomes a root.\n */\nfunction railParentId(byId: Record<string, SessionMeta>, id: string, limit: number): string | undefined {\n let parent = resolveParentId(byId, id, limit);\n let hops = 0;\n while (parent !== undefined && railHidden(byId[parent]) && hops++ <= limit)\n parent = resolveParentId(byId, parent, limit);\n return parent;\n}\n\n/**\n * The rail's order: roots by creation, each immediately followed by its own\n * children.\n *\n * Ordinal shortcuts index this array positionally, which is why a child sits\n * directly after its parent instead of in a separate group: a worktree spawned\n * from the focused session lands on the next digit. With no lineage present\n * every session is a root and this produces exactly the flat creation sort it\n * replaces.\n */\nfunction sortedOrder(byId: Record<string, SessionMeta>): string[] {\n // A workflow step's session is read inside its workflow, never from the rail, so it\n // takes no row and no ordinal. It stays in `byId` for that view to follow. A\n // workflow dispatcher is a short-lived helper whose runs belong to its parent.\n const byCreation = (left: string, right: string): number => {\n const a = byId[left].summary;\n const b = byId[right].summary;\n return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);\n };\n const children = new Map<string, string[]>();\n const roots: string[] = [];\n const ids = Object.keys(byId);\n for (const id of ids) {\n if (railHidden(byId[id])) continue;\n const parent = railParentId(byId, id, ids.length);\n if (parent === undefined) {\n roots.push(id);\n continue;\n }\n const siblings = children.get(parent);\n if (siblings === undefined) children.set(parent, [id]);\n else siblings.push(id);\n }\n roots.sort(byCreation);\n for (const siblings of children.values()) siblings.sort(byCreation);\n const order: string[] = [];\n const visit = (id: string): void => {\n order.push(id);\n for (const child of children.get(id) ?? []) visit(child);\n };\n for (const root of roots) visit(root);\n return order;\n}\n\n/** Summaries are JSON wire values; object key insertion order is not meaningful. */\nfunction summaryValueEqual(left: unknown, right: unknown): boolean {\n if (left === right) return true;\n if (Array.isArray(left) || Array.isArray(right))\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => summaryValueEqual(value, right[index]))\n );\n if (!isRecord(left) || !isRecord(right)) return false;\n const keys = Object.keys(left);\n return (\n keys.length === Object.keys(right).length &&\n keys.every((key) => Object.hasOwn(right, key) && summaryValueEqual(left[key], right[key]))\n );\n}\n\n/** True when two rail entries differ at most in `summary.updatedAt`, which the hub bumps on every settled message. */\nexport function sameRailEntry(left: SessionMeta | undefined, right: SessionMeta | undefined): boolean {\n if (left === right) return true;\n if (left === undefined || right === undefined) return false;\n return (\n left.attach === right.attach &&\n left.reason === right.reason &&\n left.replayed === right.replayed &&\n left.dropped === right.dropped &&\n summaryValueEqual({ ...left.summary, updatedAt: '' }, { ...right.summary, updatedAt: '' })\n );\n}\n\n/** `byId` compared the way the rail reads it: an `updatedAt`-only change is no change. */\nexport function sameRailEntries(left: Record<string, SessionMeta>, right: Record<string, SessionMeta>): boolean {\n if (left === right) return true;\n const ids = Object.keys(left);\n return ids.length === Object.keys(right).length && ids.every((id) => sameRailEntry(left[id], right[id]));\n}\n\nfunction mergeSummary(\n previous: SessionMeta | undefined,\n summary: SessionSummary,\n updateRequired: boolean,\n): SessionMeta {\n // A refusal stays sticky while the hub retries. Only a successful attach clears it.\n const sticky = previous?.attach === 'refused' && summary.attach === 'connecting';\n // HTTP still lists sessions after the socket stopped for good.\n const attach = updateRequired ? 'offline' : sticky ? 'refused' : summary.attach;\n const reason = updateRequired ? UPDATE_REQUIRED_REASON : sticky ? previous.reason : (summary.attachReason ?? '');\n const retainedSummary = previous && summaryValueEqual(previous.summary, summary) ? previous.summary : summary;\n if (previous && retainedSummary === previous.summary && attach === previous.attach && reason === previous.reason)\n return previous;\n return {\n summary: retainedSummary,\n attach,\n reason,\n replayed: previous?.replayed ?? 0,\n dropped: previous?.dropped ?? 0,\n };\n}\n\nfunction retainOrder(previous: string[], byId: Record<string, SessionMeta>): string[] {\n const next = sortedOrder(byId);\n return previous.length === next.length && previous.every((id, index) => id === next[index]) ? previous : next;\n}\n\nfunction hostSummary(summary: SessionSummary, hostId?: string): SessionSummary {\n if (hostId === undefined) return summary;\n return {\n ...summary,\n id: qualifyHostId(hostId, summary.id),\n ...(summary.workspaceId === undefined ? {} : { workspaceId: qualifyHostId(hostId, summary.workspaceId) }),\n ...(summary.parentSessionId === undefined\n ? {}\n : { parentSessionId: qualifyHostId(hostId, summary.parentSessionId) }),\n };\n}\nfunction belongsToHost(key: string, hostId?: string): boolean {\n return splitHostId(key)?.hostId === hostId;\n}\nfunction needsUpdate(state: SessionsState, key: string): boolean {\n const hostId = splitHostId(key)?.hostId;\n return hostId === undefined ? state.updateRequired : state.updateRequiredHosts?.[hostId] === true;\n}\n\nexport function applySessionsSnapshot(frame: Record<string, unknown>, hostId?: string): void {\n if (!Array.isArray(frame.sessions)) return;\n const summaries = frame.sessions\n .map(asSummary)\n .filter((summary): summary is SessionSummary => Boolean(summary))\n .map((summary) => hostSummary(summary, hostId));\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = Object.fromEntries(\n Object.entries(state.byId).filter(([id]) => !belongsToHost(id, hostId)),\n );\n for (const summary of summaries)\n byId[summary.id] = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (\n state.hydrated &&\n Object.keys(state.byId).length === Object.keys(byId).length &&\n Object.keys(byId).every((id) => byId[id] === state.byId[id])\n )\n return state;\n return { ...state, byId, order: retainOrder(state.order, byId), hydrated: true };\n });\n}\n\nexport function applySessionUpsert(frame: Record<string, unknown>, hostId?: string): void {\n const parsed = asSummary(frame.session);\n if (!parsed) return;\n const summary = hostSummary(parsed, hostId);\n sessionsStore.setState((state) => {\n const meta = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (meta === state.byId[summary.id]) return state;\n const byId = { ...state.byId, [summary.id]: meta };\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\nexport function applySessionRemoved(frame: Record<string, unknown>, hostId?: string): void {\n if (typeof frame.sessionId !== 'string') return;\n const sessionId = hostId === undefined ? frame.sessionId : qualifyHostId(hostId, frame.sessionId);\n sessionsStore.setState((state) => {\n if (!(sessionId in state.byId)) return state;\n const byId = { ...state.byId };\n delete byId[sessionId];\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\n/** Records what the hub replayed into this page when a subscription started. */\nexport function applySessionBacklog(sessionId: string, replayed: number, dropped: number): void {\n sessionsStore.setState((state) => {\n const meta = state.byId[sessionId];\n if (!meta) return state;\n return { ...state, byId: { ...state.byId, [sessionId]: { ...meta, replayed, dropped } } };\n });\n}\n\n/**\n * The page socket died; every session is unreachable until it comes back.\n * Self-healing: the snapshot on reconnect restores the real states.\n */\nexport function markSocketClosed(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n if (!belongsToHost(id, hostId)) {\n byId[id] = meta;\n continue;\n }\n byId[id] = {\n ...meta,\n attach: 'offline',\n reason: needsUpdate(state, id) ? UPDATE_REQUIRED_REASON : 'The cockpit lost its bridge.',\n };\n }\n return { ...state, byId };\n });\n}\n\n/**\n * The server needs newer client code; every session is unreachable until the\n * page reloads with it. Unlike a closed socket nothing here heals on its own,\n * so later session lists keep the same state and reason.\n */\nexport function markUpdateRequired(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n byId[id] = belongsToHost(id, hostId) ? { ...meta, attach: 'offline', reason: UPDATE_REQUIRED_REASON } : meta;\n }\n return hostId === undefined\n ? { ...state, byId, updateRequired: true }\n : { ...state, byId, updateRequiredHosts: { ...state.updateRequiredHosts, [hostId]: true } };\n });\n}\n\nconst APPEAR_TIMEOUT_MS = 15_000;\n\n/**\n * Resolves once the session shows up in the rail, or false on timeout.\n *\n * A freshly created session exists on disk before its upsert reaches this\n * page; navigating to it too early trips the unknown-session fallback and\n * bounces the user back. Waiting here is what makes \"create, then land on it\"\n * one motion.\n */\nexport function waitForSession(sessionId: string, timeoutMs = APPEAR_TIMEOUT_MS): Promise<boolean> {\n if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);\n return new Promise((resolve) => {\n const finish = (found: boolean): void => {\n clearTimeout(timer);\n subscription.unsubscribe();\n resolve(found);\n };\n const subscription = sessionsStore.subscribe(() => {\n if (sessionId in sessionsStore.state.byId) finish(true);\n });\n const timer = setTimeout(() => finish(false), timeoutMs);\n });\n}\n\n/** Reads the focused session's rail entry, or null while nothing is focused. */\nexport function useActiveSessionMeta(): SessionMeta | null {\n return useStore(sessionsStore, (state) => (state.activeId !== null ? (state.byId[state.activeId] ?? null) : null));\n}\n\n/**\n * Every rail entry, rendering again only when more than `updatedAt` moved. A\n * reader that needs that field fresh, such as a recency sort, reads\n * `sessionsStore.state` while it renders.\n */\nexport function useRailEntries(): Record<string, SessionMeta> {\n return useStore(sessionsStore, (state) => state.byId, sameRailEntries);\n}\n\n/** One session's rail entry, rendering again only when more than `updatedAt` moved. */\nexport function useRailEntry(sessionId: string | null): SessionMeta | undefined {\n return useStore(sessionsStore, (state) => (sessionId === null ? undefined : state.byId[sessionId]), sameRailEntry);\n}\n\n/**\n * True once the hub has answered and reported no sessions at all.\n *\n * Several surfaces stand down on this, so the rule is named once rather than\n * spelled out at each of them. The hydration half is what keeps it honest: an\n * empty order before the first snapshot only means the hub has not answered\n * yet, and treating that as \"no sessions\" would flash an onboarding screen at\n * someone who has ten.\n */\nexport function noSessions(state: SessionsState): boolean {\n return state.hydrated && state.order.length === 0;\n}\n\nexport function useNoSessions(): boolean {\n return useStore(sessionsStore, noSessions);\n}\n\nexport function setActiveSession(sessionId: string | null, tabOwnerId: string | null = sessionId): void {\n sessionsStore.setState((state) =>\n state.activeId === sessionId && (state.tabOwnerId ?? state.activeId) === tabOwnerId\n ? state\n : { ...state, activeId: sessionId, tabOwnerId },\n );\n}\n\nexport function beginSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? state : { ...state, transferringToId: sessionId },\n );\n}\n\nexport function completeSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? { ...state, transferringToId: null } : state,\n );\n}\n\nexport function activeSessionId(): string | null {\n return sessionsStore.state.activeId;\n}\n\nexport function resetSessions(): void {\n sessionsStore.setState(() => initialState);\n}\n"],"mappings":";;;;;;;;AA2CA,MAAa,yBAAyB;AAEtC,MAAM,eAA8B;CAClC,OAAO,CAAC;CACR,MAAM,CAAC;CACP,UAAU;CACV,kBAAkB;CAClB,UAAU;CACV,gBAAgB;AAClB;AAEA,MAAa,gBAAgB,WAAW,YAAY,IAAI,MAAqB,YAAY,CAAC;AAC1F,yBAAyB,cAAc,cAAc,MAAM,KAAK,UAAU,EAAE,QAAQ,WAAW;AAE/F,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,UAAU,OAA4C;CAC7D,IAAI,CAAC,SAAS,KAAK,KAAK,OAAO,MAAM,OAAO,YAAY,MAAM,OAAO,IAAI,OAAO,KAAA;CAChF,OAAO;AACT;;;;;;;;;AAUA,SAAgB,gBAAgB,MAAmC,IAAY,OAAoC;CACjH,MAAM,SAAS,KAAK,GAAG,EAAE,QAAQ;CACjC,IACE,WAAW,KAAA,KACX,WAAW,MACX,KAAK,YAAY,KAAA,KACjB,KAAK,OAAO,CAAC,QAAQ,gBAAgB,KAAK,GAAG,CAAC,QAAQ,aAEtD,OAAO,KAAA;CACT,IAAI,OAAO;CACX,MAAM,WAAW,SAAS,OAAO,KAAK,IAAI,CAAC,CAAC;CAC5C,KAAK,IAAI,KAAyB,QAAQ,OAAO,KAAA,GAAW,KAAK,KAAK,GAAG,EAAE,QAAQ,iBAAiB;EAClG,IAAI,OAAO,IAAI,OAAO,KAAA;EACtB,IAAI,EAAE,OAAO,UAAU,OAAO,KAAA;CAChC;CACA,OAAO;AACT;;AAGA,SAAS,WAAW,MAA4B;CAC9C,MAAM,aAAa,KAAK,QAAQ;CAChC,OACE,eAAe,oCACf,eAAe,0CACf,eAAe;AAEnB;;;;;;;;AASA,SAAS,aAAa,M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3C"}
|
|
1
|
+
{"version":3,"file":"sessionsStore.mjs","names":[],"sources":["../../../src/web/stores/sessionsStore.ts"],"sourcesContent":["import {\n VOICE_ORCHESTRATOR_SESSION_PROVENANCE,\n WORKFLOW_DISPATCHER_SESSION_PROVENANCE,\n WORKFLOW_STEP_SESSION_PROVENANCE,\n} from '@agimon-ai/po-core/hubChannel';\nimport { bindSessionApiWorkspace } from '@agimon-ai/po-core/web';\nimport { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\n\nimport type { SessionSummary } from '../../types/hub';\nimport { qualifyHostId, splitHostId } from '../lib/hostIdentity';\nimport type { AttachPhase } from '../lib/sessionSummary';\nimport { traceStore } from '../lib/uiTrace';\n\n/** One rail entry: the hub's summary plus this page's view of its connection. */\nexport interface SessionMeta {\n summary: SessionSummary;\n /** summary.attach adjusted for sticky refusals and a lost page socket. */\n attach: AttachPhase;\n reason: string;\n /** Frames replayed into this page's timeline on the last subscribe. */\n replayed: number;\n /** Frames the hub's bounded ring lost before this page subscribed. */\n dropped: number;\n}\n\nexport interface SessionsState {\n /** Session ids in rail order: each parent immediately followed by its children. */\n order: string[];\n byId: Record<string, SessionMeta>;\n activeId: string | null;\n /** URL/tab ownership stays with the parent when a tab focuses another session. */\n tabOwnerId?: string | null;\n /** Destination shown while an autonomous voice handoff changes route and media ownership. */\n transferringToId: string | null;\n /** False until the first snapshot; routing waits for it before redirecting. */\n hydrated: boolean;\n /** The server needs newer client code. Only a reload clears it. */\n updateRequired: boolean;\n updateRequiredHosts?: Readonly<Record<string, boolean>>;\n}\n\n/** The one reason every session shows once the server needs newer client code. */\nexport const UPDATE_REQUIRED_REASON = 'This app is older than the Po server. Update Po to reconnect.';\n\nconst initialState: SessionsState = {\n order: [],\n byId: {},\n activeId: null,\n transferringToId: null,\n hydrated: false,\n updateRequired: false,\n};\n\nexport const sessionsStore = traceStore('sessions', new Store<SessionsState>(initialState));\nbindSessionApiWorkspace((sessionId) => sessionsStore.state.byId[sessionId]?.summary.workspaceId);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asSummary(value: unknown): SessionSummary | undefined {\n if (!isRecord(value) || typeof value.id !== 'string' || value.id === '') return undefined;\n return value as unknown as SessionSummary;\n}\n\n/**\n * The parent this session nests under, or undefined when it renders at the top\n * level.\n *\n * A parent that has since closed, this session itself, a parent in another\n * workspace, or a cycle all resolve to undefined. The only safe failure is to\n * render the row where it can still be seen rather than to hide or duplicate it.\n */\nexport function resolveParentId(byId: Record<string, SessionMeta>, id: string, limit?: number): string | undefined {\n const parent = byId[id]?.summary.parentSessionId;\n if (\n parent === undefined ||\n parent === id ||\n byId[parent] === undefined ||\n byId[parent].summary.workspaceId !== byId[id].summary.workspaceId\n )\n return undefined;\n let hops = 0;\n const hopLimit = limit ?? Object.keys(byId).length;\n for (let at: string | undefined = parent; at !== undefined; at = byId[at]?.summary.parentSessionId) {\n if (at === id) return undefined;\n if (++hops > hopLimit) return undefined;\n }\n return parent;\n}\n\n/** Internal sessions keep their history but take no rail row or keyboard ordinal. */\nfunction railHidden(meta: SessionMeta): boolean {\n const provenance = meta.summary.sessionProvenance;\n return (\n provenance === WORKFLOW_STEP_SESSION_PROVENANCE ||\n provenance === WORKFLOW_DISPATCHER_SESSION_PROVENANCE ||\n provenance === VOICE_ORCHESTRATOR_SESSION_PROVENANCE\n );\n}\n\n/**\n * Where a session sits in the rail: under its nearest ancestor the rail shows.\n *\n * A fork or worktree a step session opens is a real session, and under a\n * parent the rail leaves out it would never be listed, so it moves up to the\n * first ancestor that is, or becomes a root.\n */\nfunction railParentId(byId: Record<string, SessionMeta>, id: string, limit: number): string | undefined {\n let parent = resolveParentId(byId, id, limit);\n let hops = 0;\n while (parent !== undefined && railHidden(byId[parent]) && hops++ <= limit)\n parent = resolveParentId(byId, parent, limit);\n return parent;\n}\n\n/**\n * The rail's order: roots by creation, each immediately followed by its own\n * children.\n *\n * Ordinal shortcuts index this array positionally, which is why a child sits\n * directly after its parent instead of in a separate group: a worktree spawned\n * from the focused session lands on the next digit. With no lineage present\n * every session is a root and this produces exactly the flat creation sort it\n * replaces.\n */\nfunction sortedOrder(byId: Record<string, SessionMeta>): string[] {\n // A workflow step's session is read inside its workflow, never from the rail, so it\n // takes no row and no ordinal. It stays in `byId` for that view to follow. A\n // workflow dispatcher is a short-lived helper whose runs belong to its parent.\n const byCreation = (left: string, right: string): number => {\n const a = byId[left].summary;\n const b = byId[right].summary;\n return a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);\n };\n const children = new Map<string, string[]>();\n const roots: string[] = [];\n const ids = Object.keys(byId);\n for (const id of ids) {\n if (railHidden(byId[id])) continue;\n const parent = railParentId(byId, id, ids.length);\n if (parent === undefined) {\n roots.push(id);\n continue;\n }\n const siblings = children.get(parent);\n if (siblings === undefined) children.set(parent, [id]);\n else siblings.push(id);\n }\n roots.sort(byCreation);\n for (const siblings of children.values()) siblings.sort(byCreation);\n const order: string[] = [];\n const visit = (id: string): void => {\n order.push(id);\n for (const child of children.get(id) ?? []) visit(child);\n };\n for (const root of roots) visit(root);\n return order;\n}\n\n/** Summaries are JSON wire values; object key insertion order is not meaningful. */\nfunction summaryValueEqual(left: unknown, right: unknown): boolean {\n if (left === right) return true;\n if (Array.isArray(left) || Array.isArray(right))\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => summaryValueEqual(value, right[index]))\n );\n if (!isRecord(left) || !isRecord(right)) return false;\n const keys = Object.keys(left);\n return (\n keys.length === Object.keys(right).length &&\n keys.every((key) => Object.hasOwn(right, key) && summaryValueEqual(left[key], right[key]))\n );\n}\n\n/** True when two rail entries differ at most in `summary.updatedAt`, which the hub bumps on every settled message. */\nexport function sameRailEntry(left: SessionMeta | undefined, right: SessionMeta | undefined): boolean {\n if (left === right) return true;\n if (left === undefined || right === undefined) return false;\n return (\n left.attach === right.attach &&\n left.reason === right.reason &&\n left.replayed === right.replayed &&\n left.dropped === right.dropped &&\n summaryValueEqual({ ...left.summary, updatedAt: '' }, { ...right.summary, updatedAt: '' })\n );\n}\n\n/** `byId` compared the way the rail reads it: an `updatedAt`-only change is no change. */\nexport function sameRailEntries(left: Record<string, SessionMeta>, right: Record<string, SessionMeta>): boolean {\n if (left === right) return true;\n const ids = Object.keys(left);\n return ids.length === Object.keys(right).length && ids.every((id) => sameRailEntry(left[id], right[id]));\n}\n\nfunction mergeSummary(\n previous: SessionMeta | undefined,\n summary: SessionSummary,\n updateRequired: boolean,\n): SessionMeta {\n // A refusal stays sticky while the hub retries. Only a successful attach clears it.\n const sticky = previous?.attach === 'refused' && summary.attach === 'connecting';\n // HTTP still lists sessions after the socket stopped for good.\n const attach = updateRequired ? 'offline' : sticky ? 'refused' : summary.attach;\n const reason = updateRequired ? UPDATE_REQUIRED_REASON : sticky ? previous.reason : (summary.attachReason ?? '');\n const retainedSummary = previous && summaryValueEqual(previous.summary, summary) ? previous.summary : summary;\n if (previous && retainedSummary === previous.summary && attach === previous.attach && reason === previous.reason)\n return previous;\n return {\n summary: retainedSummary,\n attach,\n reason,\n replayed: previous?.replayed ?? 0,\n dropped: previous?.dropped ?? 0,\n };\n}\n\nfunction retainOrder(previous: string[], byId: Record<string, SessionMeta>): string[] {\n const next = sortedOrder(byId);\n return previous.length === next.length && previous.every((id, index) => id === next[index]) ? previous : next;\n}\n\nfunction hostSummary(summary: SessionSummary, hostId?: string): SessionSummary {\n if (hostId === undefined) return summary;\n return {\n ...summary,\n id: qualifyHostId(hostId, summary.id),\n ...(summary.workspaceId === undefined ? {} : { workspaceId: qualifyHostId(hostId, summary.workspaceId) }),\n ...(summary.parentSessionId === undefined\n ? {}\n : { parentSessionId: qualifyHostId(hostId, summary.parentSessionId) }),\n };\n}\nfunction belongsToHost(key: string, hostId?: string): boolean {\n return splitHostId(key)?.hostId === hostId;\n}\nfunction needsUpdate(state: SessionsState, key: string): boolean {\n const hostId = splitHostId(key)?.hostId;\n return hostId === undefined ? state.updateRequired : state.updateRequiredHosts?.[hostId] === true;\n}\n\nexport function applySessionsSnapshot(frame: Record<string, unknown>, hostId?: string): void {\n if (!Array.isArray(frame.sessions)) return;\n const summaries = frame.sessions\n .map(asSummary)\n .filter((summary): summary is SessionSummary => Boolean(summary))\n .map((summary) => hostSummary(summary, hostId));\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = Object.fromEntries(\n Object.entries(state.byId).filter(([id]) => !belongsToHost(id, hostId)),\n );\n for (const summary of summaries)\n byId[summary.id] = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (\n state.hydrated &&\n Object.keys(state.byId).length === Object.keys(byId).length &&\n Object.keys(byId).every((id) => byId[id] === state.byId[id])\n )\n return state;\n return { ...state, byId, order: retainOrder(state.order, byId), hydrated: true };\n });\n}\n\nexport function applySessionUpsert(frame: Record<string, unknown>, hostId?: string): void {\n const parsed = asSummary(frame.session);\n if (!parsed) return;\n const summary = hostSummary(parsed, hostId);\n sessionsStore.setState((state) => {\n const meta = mergeSummary(state.byId[summary.id], summary, needsUpdate(state, summary.id));\n if (meta === state.byId[summary.id]) return state;\n const byId = { ...state.byId, [summary.id]: meta };\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\nexport function applySessionRemoved(frame: Record<string, unknown>, hostId?: string): void {\n if (typeof frame.sessionId !== 'string') return;\n const sessionId = hostId === undefined ? frame.sessionId : qualifyHostId(hostId, frame.sessionId);\n sessionsStore.setState((state) => {\n if (!(sessionId in state.byId)) return state;\n const byId = { ...state.byId };\n delete byId[sessionId];\n return { ...state, byId, order: retainOrder(state.order, byId) };\n });\n}\n\n/** Records what the hub replayed into this page when a subscription started. */\nexport function applySessionBacklog(sessionId: string, replayed: number, dropped: number): void {\n sessionsStore.setState((state) => {\n const meta = state.byId[sessionId];\n if (!meta) return state;\n return { ...state, byId: { ...state.byId, [sessionId]: { ...meta, replayed, dropped } } };\n });\n}\n\n/**\n * The page socket died; every session is unreachable until it comes back.\n * Self-healing: the snapshot on reconnect restores the real states.\n */\nexport function markSocketClosed(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n if (!belongsToHost(id, hostId)) {\n byId[id] = meta;\n continue;\n }\n byId[id] = {\n ...meta,\n attach: 'offline',\n reason: needsUpdate(state, id) ? UPDATE_REQUIRED_REASON : 'The cockpit lost its bridge.',\n };\n }\n return { ...state, byId };\n });\n}\n\n/**\n * The server needs newer client code; every session is unreachable until the\n * page reloads with it. Unlike a closed socket nothing here heals on its own,\n * so later session lists keep the same state and reason.\n */\nexport function markUpdateRequired(hostId?: string): void {\n sessionsStore.setState((state) => {\n const byId: Record<string, SessionMeta> = {};\n for (const [id, meta] of Object.entries(state.byId)) {\n byId[id] = belongsToHost(id, hostId) ? { ...meta, attach: 'offline', reason: UPDATE_REQUIRED_REASON } : meta;\n }\n return hostId === undefined\n ? { ...state, byId, updateRequired: true }\n : { ...state, byId, updateRequiredHosts: { ...state.updateRequiredHosts, [hostId]: true } };\n });\n}\n\nconst APPEAR_TIMEOUT_MS = 15_000;\n\n/**\n * Resolves once the session shows up in the rail, or false on timeout.\n *\n * A freshly created session exists on disk before its upsert reaches this\n * page; navigating to it too early trips the unknown-session fallback and\n * bounces the user back. Waiting here is what makes \"create, then land on it\"\n * one motion.\n */\nexport function waitForSession(sessionId: string, timeoutMs = APPEAR_TIMEOUT_MS): Promise<boolean> {\n if (sessionId in sessionsStore.state.byId) return Promise.resolve(true);\n return new Promise((resolve) => {\n const finish = (found: boolean): void => {\n clearTimeout(timer);\n subscription.unsubscribe();\n resolve(found);\n };\n const subscription = sessionsStore.subscribe(() => {\n if (sessionId in sessionsStore.state.byId) finish(true);\n });\n const timer = setTimeout(() => finish(false), timeoutMs);\n });\n}\n\n/**\n * Reads the focused session's rail entry, or null while nothing is focused. Like the rail, it\n * renders again only when more than `updatedAt` moved, which the hub bumps on unrelated pushes.\n */\nexport function useActiveSessionMeta(): SessionMeta | null {\n return useStore(\n sessionsStore,\n (state) => (state.activeId !== null ? (state.byId[state.activeId] ?? null) : null),\n (left, right) => sameRailEntry(left ?? undefined, right ?? undefined),\n );\n}\n\n/**\n * Every rail entry, rendering again only when more than `updatedAt` moved. A\n * reader that needs that field fresh, such as a recency sort, reads\n * `sessionsStore.state` while it renders.\n */\nexport function useRailEntries(): Record<string, SessionMeta> {\n return useStore(sessionsStore, (state) => state.byId, sameRailEntries);\n}\n\n/** One session's rail entry, rendering again only when more than `updatedAt` moved. */\nexport function useRailEntry(sessionId: string | null): SessionMeta | undefined {\n return useStore(sessionsStore, (state) => (sessionId === null ? undefined : state.byId[sessionId]), sameRailEntry);\n}\n\n/**\n * True once the hub has answered and reported no sessions at all.\n *\n * Several surfaces stand down on this, so the rule is named once rather than\n * spelled out at each of them. The hydration half is what keeps it honest: an\n * empty order before the first snapshot only means the hub has not answered\n * yet, and treating that as \"no sessions\" would flash an onboarding screen at\n * someone who has ten.\n */\nexport function noSessions(state: SessionsState): boolean {\n return state.hydrated && state.order.length === 0;\n}\n\nexport function useNoSessions(): boolean {\n return useStore(sessionsStore, noSessions);\n}\n\nexport function setActiveSession(sessionId: string | null, tabOwnerId: string | null = sessionId): void {\n sessionsStore.setState((state) =>\n state.activeId === sessionId && (state.tabOwnerId ?? state.activeId) === tabOwnerId\n ? state\n : { ...state, activeId: sessionId, tabOwnerId },\n );\n}\n\nexport function beginSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? state : { ...state, transferringToId: sessionId },\n );\n}\n\nexport function completeSessionTransfer(sessionId: string): void {\n sessionsStore.setState((state) =>\n state.transferringToId === sessionId ? { ...state, transferringToId: null } : state,\n );\n}\n\nexport function activeSessionId(): string | null {\n return sessionsStore.state.activeId;\n}\n\nexport function resetSessions(): void {\n sessionsStore.setState(() => initialState);\n}\n"],"mappings":";;;;;;;;AA2CA,MAAa,yBAAyB;AAEtC,MAAM,eAA8B;C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dashboard",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.48",
|
|
4
4
|
"description": "Shared browser state, actions and optional views for Po dashboard templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
65
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
66
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
64
|
+
"@agimon-ai/po-core": "0.0.0-alpha.48",
|
|
65
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.48",
|
|
66
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.48",
|
|
67
67
|
"@earendil-works/chord": "1.4.0",
|
|
68
68
|
"@simplewebauthn/browser": "^14.0.0",
|
|
69
69
|
"@tanstack/react-router": "1.170.45",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"qrcode-generator": "^2.0.4"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.
|
|
76
|
+
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.48",
|
|
77
77
|
"@types/node": "26.6.5",
|
|
78
78
|
"@types/react": "19.3.0",
|
|
79
79
|
"@types/react-dom": "19.3.0",
|