@agimon-ai/po-web-dashboard 0.0.0-alpha.164 → 0.0.0-alpha.166

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 CHANGED
@@ -126,6 +126,7 @@ exports.canSaveSettings = require_settingsDraft.canSaveSettings;
126
126
  exports.cancelDialog = require_sessionStore.cancelDialog;
127
127
  exports.catalogEntries = require_catalogEntries.catalogEntries;
128
128
  exports.claimDialogMenu = require_menuStore.claimDialogMenu;
129
+ exports.clearCommand = require_commands.clearCommand;
129
130
  exports.clearDialog = require_sessionModel.clearDialog;
130
131
  exports.clearPendingMenu = require_menuStore.clearPendingMenu;
131
132
  exports.clearQueueCommand = require_commands.clearQueueCommand;
package/dist/core.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { qrMatrix } from "./web/lib/qrMatrix.mjs";
2
2
  import { AgentInfo, AssistantEntry, CommandInfo, DialogMethod, DialogRequest, EditorTextRequest, EntryKind, InputSender, IntercomEntry, ModelChoice, NoticeEntry, ProfileIdentity, QueuedEntry, ReduceSessionOptions, SessionState, SessionStats, SettledEntry, TimelineEntry, ToolEntry, UserEntry, UserImage, appendQueued, appendUserPrompt, applySelectionAnswer, clearDialog, clearQueuedEntries, imagesFromContent, initialSessionState, isSupportedImageMimeType, prependHistory, reduceSession, removeQueuedEntry, replaceQueuedEntries, selectionStatuses, summariseArgs, textFromContent } from "./web/lib/sessionModel.mjs";
3
- import { BUILTIN_COMMANDS, RpcImage, abortCommand, builtinCommandFrame, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
3
+ import { BUILTIN_COMMANDS, RpcImage, abortCommand, builtinCommandFrame, clearCommand, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
4
4
  import { CompletionItem, CompletionKind, CompletionTrigger, MAX_COMPLETION_ITEMS, TRIGGER_CHARS, commandCompletions, fileCompletions, triggerTokenAt } from "./web/lib/composerCompletion.mjs";
5
5
  import { MentionableSession, SESSION_REFERENCE_SCHEME, resolveSessionReference, sessionCompletions, sessionSlug, sessionToken } from "./web/lib/sessionMentions.mjs";
6
6
  import { bindSessionProtocol, hasSessionProtocol, requestSessionProtocolFrame, sendSessionProtocolFrame } from "./web/lib/sessionProtocolCommands.mjs";
@@ -46,4 +46,4 @@ import { createWebMcpSimulator } from "./web/lib/webmcpSimulator.mjs";
46
46
  import { defaultHostId, isHostId, localHostId, parseHostKey, qualifyHostId, qualifyHostKey, setDefaultHostId, splitHostId } from "./web/lib/hostIdentity.mjs";
47
47
  import { CLOUD_HUB_POLL_MS, CloudHub, CloudHubFetch, CloudHubOptions, CloudHubSnapshot, createCloudHub } from "./web/lib/cloudHub.mjs";
48
48
  import { asWorkspace } from "./web/lib/workspaceSummary.mjs";
49
- export { AccountState, type ActivityGroup, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, CloudHub, CloudHubFetch, CloudHubOptions, CloudHubSnapshot, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerPromptClaim, type ContextGroup, type ContextItemSource, DialogMethod, DialogPromptClaim, DialogRequest, EditorTextRequest, EntryKind, HOST_SLOTS, HistoryPage, HomeActivityItem, HomeActivityModel, HomeActor, HomeHostRead, HomeSessionInput, HomeTarget, HomeWaitingItem, INSTALL_LOST_AFTER, ImageRefScope, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledDashboardTile, InstalledHomeContribution, InstalledHostPluginProvider, type InstalledNativeTemplate, InstalledOnboarding, type InstalledPluginTheme, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledSettingsSection, InstalledUserMessageAction, IntercomEntry, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, MentionableSession, MenuClaim, MenuKind, MenuState, type Mode, ModelChoice, type NativeTemplateCatalog, NoticeEntry, PoAccountBridge, PoAccountStatus, PoTeam, PoTeamClient, PoTeamGrant, PoTeamRole, ProfileIdentity, QueuedEntry, RailRestartState, RailSessionInput, ReduceSessionOptions, ResolvedFill, RpcImage, SESSION_REFERENCE_SCHEME, type SelectionAxis, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettledEntry, StatusClock, StatusLineInput, TODAY_PAGE_SIZE, TRIGGER_CHARS, ThreadTranscriptReader, TimelineEntry, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolRendererBoundary, type TransientTabActions, UPDATE_REQUIRED_REASON, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WAITING_PAGE_SIZE, WebPluginRegistry, WorkspacesState, abbreviateCwd, abortCommand, abortRun, accountStore, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindTransport, botCoordinatorBlocked, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, catalogEntries, claimDialogMenu, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, coordinatorHostTargets, createCloudHub, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteQueuedMessage, destinationOf, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, externalId, externalServerRows, fileCompletions, fileLinkMentions, fileTabForPath, filterEntries, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeActivity, homeAppEntries, homePageRoute, homeTime, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, installBundledWebPlugins, installHostWebPlugins, installReadLost, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, pageOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railParentIds, railSessionStatus, railShortcutOrder, readHostHome, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, renderRegion, replaceQueuedEntries, repositorySettingsViewFromWire, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveModes, resolveNativeTemplate, resolveParentId, resolveSessionReference, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, reuseRailWorkspaces, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionCompletions, sessionModes, sessionMoveTarget, sessionSlug, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToken, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDefaultHostId, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, settingsConfigViewFromWire, settingsKeyOf, settingsLockedReason, settingsScopeToWire, settingsWriteToWire, signOutAccount, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, teamStore, 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, watchHubAccess, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
49
+ export { AccountState, type ActivityGroup, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, CloudHub, CloudHubFetch, CloudHubOptions, CloudHubSnapshot, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerPromptClaim, type ContextGroup, type ContextItemSource, DialogMethod, DialogPromptClaim, DialogRequest, EditorTextRequest, EntryKind, HOST_SLOTS, HistoryPage, HomeActivityItem, HomeActivityModel, HomeActor, HomeHostRead, HomeSessionInput, HomeTarget, HomeWaitingItem, INSTALL_LOST_AFTER, ImageRefScope, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledDashboardTile, InstalledHomeContribution, InstalledHostPluginProvider, type InstalledNativeTemplate, InstalledOnboarding, type InstalledPluginTheme, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledSettingsSection, InstalledUserMessageAction, IntercomEntry, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, MentionableSession, MenuClaim, MenuKind, MenuState, type Mode, ModelChoice, type NativeTemplateCatalog, NoticeEntry, PoAccountBridge, PoAccountStatus, PoTeam, PoTeamClient, PoTeamGrant, PoTeamRole, ProfileIdentity, QueuedEntry, RailRestartState, RailSessionInput, ReduceSessionOptions, ResolvedFill, RpcImage, SESSION_REFERENCE_SCHEME, type SelectionAxis, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettledEntry, StatusClock, StatusLineInput, TODAY_PAGE_SIZE, TRIGGER_CHARS, ThreadTranscriptReader, TimelineEntry, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolRendererBoundary, type TransientTabActions, UPDATE_REQUIRED_REASON, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WAITING_PAGE_SIZE, WebPluginRegistry, WorkspacesState, abbreviateCwd, abortCommand, abortRun, accountStore, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindTransport, botCoordinatorBlocked, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, catalogEntries, claimDialogMenu, clearCommand, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, coordinatorHostTargets, createCloudHub, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteQueuedMessage, destinationOf, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, externalId, externalServerRows, fileCompletions, fileLinkMentions, fileTabForPath, filterEntries, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeActivity, homeAppEntries, homePageRoute, homeTime, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, installBundledWebPlugins, installHostWebPlugins, installReadLost, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, pageOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railParentIds, railSessionStatus, railShortcutOrder, readHostHome, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, renderRegion, replaceQueuedEntries, repositorySettingsViewFromWire, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveModes, resolveNativeTemplate, resolveParentId, resolveSessionReference, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, reuseRailWorkspaces, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionCompletions, sessionModes, sessionMoveTarget, sessionSlug, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToken, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDefaultHostId, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, settingsConfigViewFromWire, settingsKeyOf, settingsLockedReason, settingsScopeToWire, settingsWriteToWire, signOutAccount, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, teamStore, 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, watchHubAccess, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
package/dist/core.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { BUILTIN_COMMANDS, abortCommand, builtinCommandFrame, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
1
+ import { BUILTIN_COMMANDS, abortCommand, builtinCommandFrame, clearCommand, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
2
2
  import { MAX_COMPLETION_ITEMS, TRIGGER_CHARS, commandCompletions, fileCompletions, triggerTokenAt } from "./web/lib/composerCompletion.mjs";
3
3
  import { onComposerSubmitted } from "./web/lib/composerSubmissions.mjs";
4
4
  import { defaultHostId, isHostId, localHostId, parseHostKey, qualifyHostId, qualifyHostKey, setDefaultHostId, splitHostId } from "./web/lib/hostIdentity.mjs";
@@ -46,4 +46,4 @@ import { CLOUD_HUB_POLL_MS, createCloudHub } from "./web/lib/cloudHub.mjs";
46
46
  import { INSTALL_LOST_AFTER, catalogEntries, destinationOf, externalId, externalServerRows, filterEntries, installReadLost, presetSummaries } from "./web/lib/catalogEntries.mjs";
47
47
  import { TODAY_PAGE_SIZE, WAITING_PAGE_SIZE, homeActivity, homeTime, pageOf } from "./web/lib/homeActivity.mjs";
48
48
  import { createWebMcpSimulator } from "./web/lib/webmcpSimulator.mjs";
49
- export { BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, HOST_SLOTS, INSTALL_LOST_AFTER, ImageRefScope, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, SESSION_REFERENCE_SCHEME, TODAY_PAGE_SIZE, TRIGGER_CHARS, ToolRendererBoundary, UPDATE_REQUIRED_REASON, WAITING_PAGE_SIZE, abbreviateCwd, abortCommand, abortRun, accountStore, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindTransport, botCoordinatorBlocked, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, catalogEntries, claimDialogMenu, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, coordinatorHostTargets, createCloudHub, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteQueuedMessage, destinationOf, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, externalId, externalServerRows, fileCompletions, fileLinkMentions, fileTabForPath, filterEntries, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeActivity, homeAppEntries, homePageRoute, homeTime, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, installBundledWebPlugins, installHostWebPlugins, installReadLost, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, pageOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railParentIds, railSessionStatus, railShortcutOrder, readHostHome, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, renderRegion, replaceQueuedEntries, repositorySettingsViewFromWire, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveModes, resolveNativeTemplate, resolveParentId, resolveSessionReference, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, reuseRailWorkspaces, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionCompletions, sessionModes, sessionMoveTarget, sessionSlug, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToken, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDefaultHostId, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, settingsConfigViewFromWire, settingsKeyOf, settingsLockedReason, settingsScopeToWire, settingsWriteToWire, signOutAccount, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, teamStore, 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, watchHubAccess, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
49
+ export { BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, HOST_SLOTS, INSTALL_LOST_AFTER, ImageRefScope, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, SESSION_REFERENCE_SCHEME, TODAY_PAGE_SIZE, TRIGGER_CHARS, ToolRendererBoundary, UPDATE_REQUIRED_REASON, WAITING_PAGE_SIZE, abbreviateCwd, abortCommand, abortRun, accountStore, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindTransport, botCoordinatorBlocked, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, catalogEntries, claimDialogMenu, clearCommand, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeTransientTab, commandCompletions, compactCommand, completeSessionTransfer, contextGroups, coordinatorHostTargets, createCloudHub, createDashboardTransport, createPagedTranscript, createProtocolHubSocket, createToolCompletionTabs, createWebMcpSimulator, createWebPluginRegistry, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteQueuedMessage, destinationOf, dialogCancelled, dialogConfirmed, dialogValue, disconnectCaptures, dispatchChannelFrame, dispatchHeldSessionChannel, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, endSessionReplay, enqueueAutomaticCommand, externalId, externalServerRows, fileCompletions, fileLinkMentions, fileTabForPath, filterEntries, findTransientTab, flushUiTrace, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeActivity, homeAppEntries, homePageRoute, homeTime, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, installBundledWebPlugins, installHostWebPlugins, installReadLost, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, pageOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railParentIds, railSessionStatus, railShortcutOrder, readHostHome, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseTransport, removeHostWebPlugins, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspaceWebPlugins, renameSession, renderRegion, replaceQueuedEntries, repositorySettingsViewFromWire, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetMenuStore, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetWebPlugins, resetWorkspaces, resolveModes, resolveNativeTemplate, resolveParentId, resolveSessionReference, resubscribeThreads, resumeQueueCommand, resumeQueuedMessages, reuseRailWorkspaces, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, seedHistoryCursor, selectFastMode, selectModel, selectThinkingLevel, selectWorkspace, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionCompletions, sessionModes, sessionMoveTarget, sessionSlug, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToken, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setDefaultHostId, setHasNewerHistory, setModelCommand, setPendingMenu, setSessionNameCommand, setSessionStreamed, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, settingsConfigViewFromWire, settingsKeyOf, settingsLockedReason, settingsScopeToWire, settingsWriteToWire, signOutAccount, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, teamStore, 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, watchHubAccess, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
package/dist/index.cjs CHANGED
@@ -212,6 +212,7 @@ exports.cancelDialog = require_sessionStore.cancelDialog;
212
212
  exports.cancelLogin = require_authApi.cancelLogin;
213
213
  exports.choosePairTarget = require_remoteAccessStore.choosePairTarget;
214
214
  exports.claimDialogMenu = require_menuStore.claimDialogMenu;
215
+ exports.clearCommand = require_commands.clearCommand;
215
216
  exports.clearComposerState = require_composerStore.clearComposerState;
216
217
  exports.clearDialog = require_sessionModel.clearDialog;
217
218
  exports.clearPendingMenu = require_menuStore.clearPendingMenu;
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { qrMatrix } from "./web/lib/qrMatrix.mjs";
2
2
  import { AgentInfo, AssistantEntry, CommandInfo, DialogMethod, DialogRequest, EditorTextRequest, EntryKind, InputSender, IntercomEntry, ModelChoice, NoticeEntry, ProfileIdentity, QueuedEntry, ReduceSessionOptions, SessionState, SessionStats, SettledEntry, TimelineEntry, ToolEntry, UserEntry, UserImage, appendQueued, appendUserPrompt, applySelectionAnswer, clearDialog, clearQueuedEntries, imagesFromContent, initialSessionState, isSupportedImageMimeType, prependHistory, reduceSession, removeQueuedEntry, replaceQueuedEntries, selectionStatuses, summariseArgs, textFromContent } from "./web/lib/sessionModel.mjs";
3
- import { BUILTIN_COMMANDS, RpcImage, abortCommand, builtinCommandFrame, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
3
+ import { BUILTIN_COMMANDS, RpcImage, abortCommand, builtinCommandFrame, clearCommand, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
4
4
  import { CompletionItem, CompletionKind, CompletionTrigger, MAX_COMPLETION_ITEMS, TRIGGER_CHARS, commandCompletions, fileCompletions, triggerTokenAt } from "./web/lib/composerCompletion.mjs";
5
5
  import { bindSessionProtocol, hasSessionProtocol, requestSessionProtocolFrame, sendSessionProtocolFrame } from "./web/lib/sessionProtocolCommands.mjs";
6
6
  import { bindHostTransport, bindTransport, createDashboardTransport, invokeServerMethod, notifyHubConnected, onHostConnected, onHubConnected, readHostHome, releaseTransport, sendFrame, sendFrameWithAck, sendHubFrame, transportForHost, watchHubThread } from "./web/lib/transport.mjs";
@@ -89,4 +89,4 @@ import { dashboardStateFor, useDashboardState } from "./web/stores/dashboardStat
89
89
  import { DashboardRendererProvider, DashboardRenderers } from "./web/lib/dashboardRenderers.mjs";
90
90
  import { DesktopPairingBridge, HostPairingGrant, PairingAccount, PairingAccountStatus, PairingHost, PairingRequest, createHostBrowserAccount, createHostPairingChannels, hostPairingPrefix, hostPairingStorageKey, pairHost, pairingJson, pairingPost, pairingRequest, readHostPairing, selectedHostAccount, signingFingerprint } from "./web/lib/hostPairing.mjs";
91
91
  import { PairedHost, connectPairedHost, forgetPairedHost, onPairedHostsChanged, pairedHosts } from "./web/lib/pairedHosts.mjs";
92
- export { ACCOUNT_SETTINGS_SECTION, AccountState, ActivityGroup, AddCoordinatorResult, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, BrowserNotificationDeliveryStatus, BrowserNotificationPermissionStatus, BrowserPerformanceEvent, BrowserPerformanceEventName, CLOUD_HUB_POLL_MS, CloudHub, CloudHubFetch, CloudHubOptions, CloudHubSnapshot, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerAttachment, ComposerContextAttachment, ComposerFileAttachment, ComposerImageAttachment, ComposerPromptClaim, ComposerSessionState, ComposerTextAttachment, ContextGroup, ContextGroupKind, ContextItem, ContextItemSource, ContextOwner, CreateProfileInput, CreateSessionResult, DEFAULT_REPOSITORY_SETTINGS_SECTION, DEFAULT_SETTINGS_SECTION, DashboardRendererProvider, type DashboardRenderers, DashboardRoute, DesktopPairingBridge, DevProxyState, DialogDraft, DialogMethod, DialogPromptClaim, DialogRequest, DockTab, EMPTY_NEW_SESSION_DRAFT, EMPTY_SETTINGS_DRAFT, EditorTextRequest, EnsureHomeCoordinatorResult, EntryKind, FetchItemDetailResult, FileLinkResolver, FileMention, GatewaySettings, GroupUnit, HOST_SLOTS, HistoryPage, HostPairingGrant, ImageSettingsResult, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledDashboardTile, InstalledHomeContribution, InstalledHostPluginProvider, InstalledNativeTemplate, InstalledOnboarding, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledSettingsSection, 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, Mode, ModeAvailability, ModeSource, ModelChoice, NativeTemplateCatalog, NewSessionDraft, NewSessionState, NoticeEntry, PACKAGED_MODES, PACKAGED_SELECTION_AXES, PLUGINS_PAGE_ID, PLUGINS_ROUTE, PairTarget, PairedHost, PairingAccount, PairingAccountStatus, PairingHost, PairingRequest, PairingResult, PaletteState, PasskeyOutcome, PasskeySupportView, PlannedWritesInput, PoAccountBridge, PoAccountStatus, PoTeam, PoTeamClient, PoTeamGrant, PoTeamRole, PresetSettingsResult, ProfileIdentity, ProvidersResult, QueuedEntry, RailDialogState, RailRestartState, RailSessionInput, ReadConfigResult, ReadRepositorySettingsResult, ReduceSessionOptions, RemoteAccessState, RemoteStep, RemoveWorkspaceResult, RemovedSessionsResult, ResolvedFill, RestartSessionResult, RestoreRemovedSessionResult, ResumeDraft, ResumeSessionResult, ResumeTarget, ResumeView, ReviveSessionResult, RpcImage, STEP_UP_HEADER_NAME, Selection, SelectionAxis, SessionAsset, SessionGroupsResult, SessionHistoryResult, SessionMcpResult, SessionMcpViewState, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SetSessionRoleResult, SettingsDraftState, SettingsDraftTarget, SettingsSection, SettingsSectionGroup, SettingsWorkspace, SettledEntry, SingleUnit, StateResult, StatusClock, StatusLineInput, StopSessionResult, StoredSessionAttachment, TEAM_PAGE_ID, TEAM_ROUTE, 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, accountStore, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, addCoordinator, addDashboardCoordinator, addDevProxyTarget, addPasskey, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, backdropId, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, botCoordinatorBlocked, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, cancelLogin, choosePairTarget, claimDialogMenu, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createDevProxyTarget, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteDevProxyTarget, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, forgetPairedHost, generalSessionDraftKey, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, getWorkspace, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeAppEntries, homePageRoute, hostPairingPrefix, hostPairingStorageKey, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installBundledWebPlugins, installHostWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHostId, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, mintPairingCode, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotFills, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshAccount, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveBackdrop, resolveModes, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreRemovedSession, restoreRemovedThread, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reuseRailWorkspaces, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setBotActAsCoordinator, setCoordinatorProfile, setCoordinatorProfileForm, setDefaultHostId, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setNewSessionProfile, setPalettePath, setPendingMenu, setResumeView, setSessionGroups, setSessionNameCommand, setSessionRole, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, showRemoteOptions, signInWithPasskey, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, 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, watchHubAccess, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
92
+ export { ACCOUNT_SETTINGS_SECTION, AccountState, ActivityGroup, AddCoordinatorResult, AgentInfo, AssistantEntry, AttachPhase, BUILTIN_COMMANDS, BrowserNotificationDeliveryStatus, BrowserNotificationPermissionStatus, BrowserPerformanceEvent, BrowserPerformanceEventName, CLOUD_HUB_POLL_MS, CloudHub, CloudHubFetch, CloudHubOptions, CloudHubSnapshot, CommandInfo, CompletionItem, CompletionKind, CompletionTrigger, ComposerAttachment, ComposerContextAttachment, ComposerFileAttachment, ComposerImageAttachment, ComposerPromptClaim, ComposerSessionState, ComposerTextAttachment, ContextGroup, ContextGroupKind, ContextItem, ContextItemSource, ContextOwner, CreateProfileInput, CreateSessionResult, DEFAULT_REPOSITORY_SETTINGS_SECTION, DEFAULT_SETTINGS_SECTION, DashboardRendererProvider, type DashboardRenderers, DashboardRoute, DesktopPairingBridge, DevProxyState, DialogDraft, DialogMethod, DialogPromptClaim, DialogRequest, DockTab, EMPTY_NEW_SESSION_DRAFT, EMPTY_SETTINGS_DRAFT, EditorTextRequest, EnsureHomeCoordinatorResult, EntryKind, FetchItemDetailResult, FileLinkResolver, FileMention, GatewaySettings, GroupUnit, HOST_SLOTS, HistoryPage, HostPairingGrant, ImageSettingsResult, InputSender, InstallDiagnostic, InstallDiagnosticKind, InstalledContextAction, InstalledDashboardTile, InstalledHomeContribution, InstalledHostPluginProvider, InstalledNativeTemplate, InstalledOnboarding, InstalledRepositorySettingsPanel, InstalledSettingsPanel, InstalledSettingsSection, 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, Mode, ModeAvailability, ModeSource, ModelChoice, NativeTemplateCatalog, NewSessionDraft, NewSessionState, NoticeEntry, PACKAGED_MODES, PACKAGED_SELECTION_AXES, PLUGINS_PAGE_ID, PLUGINS_ROUTE, PairTarget, PairedHost, PairingAccount, PairingAccountStatus, PairingHost, PairingRequest, PairingResult, PaletteState, PasskeyOutcome, PasskeySupportView, PlannedWritesInput, PoAccountBridge, PoAccountStatus, PoTeam, PoTeamClient, PoTeamGrant, PoTeamRole, PresetSettingsResult, ProfileIdentity, ProvidersResult, QueuedEntry, RailDialogState, RailRestartState, RailSessionInput, ReadConfigResult, ReadRepositorySettingsResult, ReduceSessionOptions, RemoteAccessState, RemoteStep, RemoveWorkspaceResult, RemovedSessionsResult, ResolvedFill, RestartSessionResult, RestoreRemovedSessionResult, ResumeDraft, ResumeSessionResult, ResumeTarget, ResumeView, ReviveSessionResult, RpcImage, STEP_UP_HEADER_NAME, Selection, SelectionAxis, SessionAsset, SessionGroupsResult, SessionHistoryResult, SessionMcpResult, SessionMcpViewState, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SetSessionRoleResult, SettingsDraftState, SettingsDraftTarget, SettingsSection, SettingsSectionGroup, SettingsWorkspace, SettledEntry, SingleUnit, StateResult, StatusClock, StatusLineInput, StopSessionResult, StoredSessionAttachment, TEAM_PAGE_ID, TEAM_ROUTE, 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, accountStore, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, addCoordinator, addDashboardCoordinator, addDevProxyTarget, addPasskey, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, backdropId, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, botCoordinatorBlocked, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, cancelLogin, choosePairTarget, claimDialogMenu, clearCommand, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createDevProxyTarget, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteDevProxyTarget, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, forgetPairedHost, generalSessionDraftKey, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, getWorkspace, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeAppEntries, homePageRoute, hostPairingPrefix, hostPairingStorageKey, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installBundledWebPlugins, installHostWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHostId, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, mintPairingCode, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotFills, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshAccount, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveBackdrop, resolveModes, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreRemovedSession, restoreRemovedThread, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reuseRailWorkspaces, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setBotActAsCoordinator, setCoordinatorProfile, setCoordinatorProfileForm, setDefaultHostId, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setNewSessionProfile, setPalettePath, setPendingMenu, setResumeView, setSessionGroups, setSessionNameCommand, setSessionRole, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, showRemoteOptions, signInWithPasskey, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, 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, watchHubAccess, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { fetchWithStepUp } from "./web/lib/stepUp.mjs";
4
4
  import { answerLogin, cancelLogin, listProviders, logoutProvider, readLogin, readProviderSharing, startLogin, writeProviderSharing } from "./web/lib/authApi.mjs";
5
5
  import { browserNotificationPermission, deliverBrowserNotification, requestBrowserNotificationPermission } from "./web/lib/browserNotifications.mjs";
6
6
  import { browserReadyDuration, disableBrowserTelemetry, flushBrowserTelemetry, installBrowserErrorReporting, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace } from "./web/lib/browserTelemetry.mjs";
7
- import { BUILTIN_COMMANDS, abortCommand, builtinCommandFrame, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
7
+ import { BUILTIN_COMMANDS, abortCommand, builtinCommandFrame, clearCommand, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand } from "./web/lib/commands.mjs";
8
8
  import { MAX_COMPLETION_ITEMS, TRIGGER_CHARS, commandCompletions, fileCompletions, triggerTokenAt } from "./web/lib/composerCompletion.mjs";
9
9
  import { onComposerSubmitted, publishComposerSubmission } from "./web/lib/composerSubmissions.mjs";
10
10
  import { defaultHostId, isHostId, localHostId, parseHostKey, qualifyHostId, qualifyHostKey, setDefaultHostId, splitHostId } from "./web/lib/hostIdentity.mjs";
@@ -89,4 +89,4 @@ import { dashboardStateFor, useDashboardState } from "./web/stores/dashboardStat
89
89
  import { CLOUD_HUB_POLL_MS, createCloudHub } from "./web/lib/cloudHub.mjs";
90
90
  import { createHostBrowserAccount, createHostPairingChannels, hostPairingPrefix, hostPairingStorageKey, pairHost, pairingJson, pairingPost, pairingRequest, readHostPairing, selectedHostAccount, signingFingerprint } from "./web/lib/hostPairing.mjs";
91
91
  import { connectPairedHost, forgetPairedHost, onPairedHostsChanged, pairedHosts } from "./web/lib/pairedHosts.mjs";
92
- export { ACCOUNT_SETTINGS_SECTION, BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, 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_MODES, PACKAGED_SELECTION_AXES, PLUGINS_PAGE_ID, PLUGINS_ROUTE, STEP_UP_HEADER_NAME, TEAM_PAGE_ID, TEAM_ROUTE, TRIGGER_CHARS, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, accountStore, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, addCoordinator, addDashboardCoordinator, addDevProxyTarget, addPasskey, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, backdropId, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, botCoordinatorBlocked, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, cancelLogin, choosePairTarget, claimDialogMenu, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createDevProxyTarget, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteDevProxyTarget, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, forgetPairedHost, generalSessionDraftKey, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, getWorkspace, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeAppEntries, homePageRoute, hostPairingPrefix, hostPairingStorageKey, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installBundledWebPlugins, installHostWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHostId, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, mintPairingCode, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotFills, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshAccount, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveBackdrop, resolveModes, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreRemovedSession, restoreRemovedThread, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reuseRailWorkspaces, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setBotActAsCoordinator, setCoordinatorProfile, setCoordinatorProfileForm, setDefaultHostId, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setNewSessionProfile, setPalettePath, setPendingMenu, setResumeView, setSessionGroups, setSessionNameCommand, setSessionRole, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, showRemoteOptions, signInWithPasskey, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, 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, watchHubAccess, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
92
+ export { ACCOUNT_SETTINGS_SECTION, BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, 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_MODES, PACKAGED_SELECTION_AXES, PLUGINS_PAGE_ID, PLUGINS_ROUTE, STEP_UP_HEADER_NAME, TEAM_PAGE_ID, TEAM_ROUTE, TRIGGER_CHARS, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, accountStore, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, addCoordinator, addDashboardCoordinator, addDevProxyTarget, addPasskey, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, approveDevice, approvePairing, assertionFor, attachComposerCapture, attachComposerContext, attachmentPrompt, availableThemes, backdropId, beginSessionReplay, beginSessionTransfer, bindAccount, bindBundledNativeTemplates, bindBundledWebTemplates, bindDashboardTranscriptWatcher, bindFileLinkModes, bindHistoryReader, bindHostTransport, bindSessionActivityRenderer, bindSessionFileLinkModes, bindSessionProtocol, bindSessionTranscriptRenderer, bindSessionWebWorkspace, bindTeam, bindThreadReader, bindThreadRenderer, bindTransport, bindWebPluginCompositions, botCoordinatorBlocked, browserNotificationPermission, browserReadyDuration, buildRailWorkspaces, builtinCommandFrame, bundledNativeTemplate, canSaveSettings, cancelDialog, cancelLogin, choosePairTarget, claimDialogMenu, clearCommand, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeRemoteDialog, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createDevProxyTarget, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createSessionMcpClient, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deleteDevProxyTarget, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, denyDevice, denyPairing, devProxyStore, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, disableRemoteAccess, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, enableRemoteAccess, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fetchDevProxyTargets, fetchRemoteState, fetchWithStepUp, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, flushBrowserTelemetry, flushUiTrace, focusPrompt, focusWorkspaceWebPlugins, followUpCommand, forgetPairedHost, generalSessionDraftKey, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, getWorkspace, groupSummary, groupTone, hasSessionProtocol, heldSessionChannels, heldThreads, heldVoiceSessions, holdSessionChannels, holdVoiceSession, homeAppEntries, homePageRoute, hostPairingPrefix, hostPairingStorageKey, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, imagesFromContent, inactiveTotal, initialSessionState, inlineTextBytes, installBrowserErrorReporting, installBundledWebPlugins, installHostWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHostId, isSessionMcpActivity, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessionMcpClients, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, mintPairingCode, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newPairingCode, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openRemoteDialog, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, passkeysAvailable, pendingCaptureSessions, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotFills, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, protocolSocketUrl, publishComposerSubmission, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSessionMcpActivity, readSessionMcpConfig, readSettingsConfig, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, reduceSession, refreshAccount, refreshDevProxyTargets, refreshPasskeys, refreshRemoteState, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPasskey, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, remoteAccessStore, removeDevProxyTarget, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionMcpSetup, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, resetDevProxyStore, resetMenuStore, resetNewSessionStore, resetRailDialogStore, resetSealedSessions, resetSessionStore, resetSessionStores, resetSessions, resetThreads, resetToolPromptStore, resetTransientTabs, resetWebPlugins, resetWorkspaceAdmission, resetWorkspaces, resolveBackdrop, resolveModes, resolveNativeTemplate, resolveParentId, resolveWebTemplate, restartDashboardSession, restartSession, restoreComposerDrafts, restoreLivePushRegistration, restoreRemovedSession, restoreRemovedThread, restoreSealedSession, resubscribeThreads, resumeDashboardSession, resumeDraftStore, resumeQueueCommand, resumeQueuedMessages, resumeSession, resumeWorkspaceSession, retryWebPluginCompositions, reuseRailWorkspaces, reviveSession, revokeDevice, revokePairedDevice, revokeSessionMcpClient, revokeTrustedDevice, revokeTrustedNativeDevice, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveRemoteSettings, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionStatusClock, sessionStatusLine, sessionStoreFor, sessionToolRenderer, sessionWaitingCount, sessionWebPluginsInstalled, sessionsStore, setActiveSession, setAgentLock, setBotActAsCoordinator, setCoordinatorProfile, setCoordinatorProfileForm, setDefaultHostId, setDockOpen, setDockTab, setHasNewerHistory, setModelCommand, setNewSessionName, setNewSessionProfile, setPalettePath, setPendingMenu, setResumeView, setSessionGroups, setSessionNameCommand, setSessionRole, setSessionStreamed, setSettingsDraft, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, showRemoteOptions, signInWithPasskey, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, turnRemoteAccessOff, turnRemoteAccessOn, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, 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, watchHubAccess, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
@@ -74,7 +74,15 @@ function compactCommand(customInstructions) {
74
74
  ...customInstructions === void 0 ? {} : { customInstructions }
75
75
  };
76
76
  }
77
+ /** Drops the model's context without a summary. The transcript stays, with a notice where the memory restarts. */
78
+ function clearCommand() {
79
+ return {
80
+ type: "compact",
81
+ clear: true
82
+ };
83
+ }
77
84
  const COMPACT = "compact";
85
+ const CLEAR = "clear";
78
86
  /**
79
87
  * Pi's built-in slash commands that the cockpit can actually run.
80
88
  *
@@ -89,6 +97,9 @@ const COMPACT = "compact";
89
97
  const BUILTIN_COMMANDS = [{
90
98
  name: COMPACT,
91
99
  description: "Manually compact the session context"
100
+ }, {
101
+ name: CLEAR,
102
+ description: "Start fresh: Po forgets the conversation so far, the transcript stays"
92
103
  }];
93
104
  /**
94
105
  * The frame a typed built-in maps to, or undefined when the text is an
@@ -97,6 +108,7 @@ const BUILTIN_COMMANDS = [{
97
108
  */
98
109
  function builtinCommandFrame(text) {
99
110
  const matched = /^\/(\S+)(?:\s+([\s\S]*))?$/u.exec(text.trim());
111
+ if (matched?.[1] === CLEAR) return clearCommand();
100
112
  if (matched?.[1] !== COMPACT) return void 0;
101
113
  const argument = (matched[2] ?? "").trim();
102
114
  return compactCommand(argument.length > 0 ? argument : void 0);
@@ -151,6 +163,7 @@ function dialogCancelled(id) {
151
163
  exports.BUILTIN_COMMANDS = BUILTIN_COMMANDS;
152
164
  exports.abortCommand = abortCommand;
153
165
  exports.builtinCommandFrame = builtinCommandFrame;
166
+ exports.clearCommand = clearCommand;
154
167
  exports.clearQueueCommand = clearQueueCommand;
155
168
  exports.compactCommand = compactCommand;
156
169
  exports.dialogCancelled = dialogCancelled;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.cjs","names":[],"sources":["../../../src/web/lib/commands.ts"],"sourcesContent":["type Frame = Record<string, unknown>;\n\nexport interface RpcImage {\n type: 'image';\n data: string;\n mimeType: string;\n}\n\nexport function promptCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'prompt', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function steerCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'steer', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function followUpCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'follow_up', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function enqueueAutomaticCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'enqueue_automatic', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function removeQueuedCommand(id: string): Frame {\n return { type: 'remove_queued', id };\n}\n\nexport function promoteQueuedCommand(id: string, operationId?: string): Frame {\n return { type: 'promote_queued', id, ...(operationId === undefined ? {} : { operationId }) };\n}\n\nexport function resumeQueueCommand(): Frame {\n return { type: 'resume_queue' };\n}\n\n/** Requests in-place Pi session-tree navigation after the hub resolves the visible transcript id. */\nexport function rewindCommand(itemId: string): Frame {\n return { type: 'rewind', itemId };\n}\n\nexport function abortCommand(operationId?: string): Frame {\n return operationId === undefined ? { type: 'abort' } : { type: 'abort', operationId };\n}\n\nexport function clearQueueCommand(): Frame {\n return { type: 'clear_queue' };\n}\n\nexport function getStateCommand(): Frame {\n return { type: 'get_state' };\n}\n\nexport function getSessionStatsCommand(): Frame {\n return { type: 'get_session_stats' };\n}\n\nexport function getCommandsCommand(): Frame {\n return { type: 'get_commands' };\n}\n\nexport function compactCommand(customInstructions?: string): Frame {\n return { type: 'compact', ...(customInstructions === undefined ? {} : { customInstructions }) };\n}\n\nconst COMPACT = 'compact';\n\n/**\n * Pi's built-in slash commands that the cockpit can actually run.\n *\n * `get_commands` reports extension commands, prompt templates and skills, and\n * nothing else, so the built-ins never reach the palette on their own. Nor can\n * they be sent as prompts: `session.prompt` has no branch for them, and the\n * TUI runs them by matching the raw typed text, so a prompt-shaped `/compact`\n * arrives at the model as literal text. Each entry here therefore needs its\n * own RPC frame, which is why the list holds only what is wired below rather\n * than everything the TUI offers.\n */\nexport const BUILTIN_COMMANDS: ReadonlyArray<{ name: string; description: string }> = [\n { name: COMPACT, description: 'Manually compact the session context' },\n];\n\n/**\n * The frame a typed built-in maps to, or undefined when the text is an\n * ordinary prompt. The argument is passed through, so `/compact keep the API\n * decisions` reaches Pi as its custom instruction.\n */\nexport function builtinCommandFrame(text: string): Frame | undefined {\n // Split on any whitespace, not a space: the composer folds text attachments\n // into the draft with newlines, so a space-only split reads the newline as\n // part of the command name and silently sends the whole thing to the model.\n const matched = /^\\/(\\S+)(?:\\s+([\\s\\S]*))?$/u.exec(text.trim());\n if (matched?.[1] !== COMPACT) return undefined;\n const argument = (matched[2] ?? '').trim();\n return compactCommand(argument.length > 0 ? argument : undefined);\n}\nexport function getAvailableModelsCommand(): Frame {\n return { type: 'get_available_models' };\n}\n\nexport function getAvailableThinkingLevelsCommand(): Frame {\n return { type: 'get_available_thinking_levels' };\n}\n\nexport function setModelCommand(provider: string, modelId: string): Frame {\n return { type: 'set_model', provider, modelId };\n}\n\nexport function setThinkingLevelCommand(level: string): Frame {\n return { type: 'set_thinking_level', level };\n}\n\nexport function setSessionNameCommand(name: string): Frame {\n return { type: 'set_session_name', name };\n}\n\nexport function dialogValue(id: string, value: string): Frame {\n return { type: 'extension_ui_response', id, value };\n}\n\nexport function dialogConfirmed(id: string, confirmed: boolean): Frame {\n return { type: 'extension_ui_response', id, confirmed };\n}\n\nexport function dialogCancelled(id: string): Frame {\n return { type: 'extension_ui_response', id, cancelled: true };\n}\n"],"mappings":";AAQA,SAAgB,cAAc,SAAiB,SAAqB,CAAC,GAAU;CAC7E,OAAO;EAAE,MAAM;EAAU;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AAC7E;AAEA,SAAgB,aAAa,SAAiB,SAAqB,CAAC,GAAU;CAC5E,OAAO;EAAE,MAAM;EAAS;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AAC5E;AAEA,SAAgB,gBAAgB,SAAiB,SAAqB,CAAC,GAAU;CAC/E,OAAO;EAAE,MAAM;EAAa;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AAChF;AAEA,SAAgB,wBAAwB,SAAiB,SAAqB,CAAC,GAAU;CACvF,OAAO;EAAE,MAAM;EAAqB;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AACxF;AAEA,SAAgB,oBAAoB,IAAmB;CACrD,OAAO;EAAE,MAAM;E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,UAAkB,SAAwB;CACxE,OAAO;EAAE,MAAM;EAAa;EAAU;CAAQ;AAChD;AAEA,SAAgB,wBAAwB,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAsB;CAAM;AAC7C;AAEA,SAAgB,sBAAsB,MAAqB;CACzD,OAAO;EAAE,MAAM;EAAoB;CAAK;AAC1C;AAEA,SAAgB,YAAY,IAAY,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAM;AACpD;AAEA,SAAgB,gBAAgB,IAAY,WAA2B;CACrE,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAU;AACxD;AAEA,SAAgB,gBAAgB,IAAmB;CACjD,OAAO;EAAE,MAAM;EAAyB;EAAI,WAAW;CAAK;AAC9D"}
1
+ {"version":3,"file":"commands.cjs","names":[],"sources":["../../../src/web/lib/commands.ts"],"sourcesContent":["type Frame = Record<string, unknown>;\n\nexport interface RpcImage {\n type: 'image';\n data: string;\n mimeType: string;\n}\n\nexport function promptCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'prompt', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function steerCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'steer', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function followUpCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'follow_up', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function enqueueAutomaticCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'enqueue_automatic', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function removeQueuedCommand(id: string): Frame {\n return { type: 'remove_queued', id };\n}\n\nexport function promoteQueuedCommand(id: string, operationId?: string): Frame {\n return { type: 'promote_queued', id, ...(operationId === undefined ? {} : { operationId }) };\n}\n\nexport function resumeQueueCommand(): Frame {\n return { type: 'resume_queue' };\n}\n\n/** Requests in-place Pi session-tree navigation after the hub resolves the visible transcript id. */\nexport function rewindCommand(itemId: string): Frame {\n return { type: 'rewind', itemId };\n}\n\nexport function abortCommand(operationId?: string): Frame {\n return operationId === undefined ? { type: 'abort' } : { type: 'abort', operationId };\n}\n\nexport function clearQueueCommand(): Frame {\n return { type: 'clear_queue' };\n}\n\nexport function getStateCommand(): Frame {\n return { type: 'get_state' };\n}\n\nexport function getSessionStatsCommand(): Frame {\n return { type: 'get_session_stats' };\n}\n\nexport function getCommandsCommand(): Frame {\n return { type: 'get_commands' };\n}\n\nexport function compactCommand(customInstructions?: string): Frame {\n return { type: 'compact', ...(customInstructions === undefined ? {} : { customInstructions }) };\n}\n\n/** Drops the model's context without a summary. The transcript stays, with a notice where the memory restarts. */\nexport function clearCommand(): Frame {\n return { type: 'compact', clear: true };\n}\n\nconst COMPACT = 'compact';\nconst CLEAR = 'clear';\n\n/**\n * Pi's built-in slash commands that the cockpit can actually run.\n *\n * `get_commands` reports extension commands, prompt templates and skills, and\n * nothing else, so the built-ins never reach the palette on their own. Nor can\n * they be sent as prompts: `session.prompt` has no branch for them, and the\n * TUI runs them by matching the raw typed text, so a prompt-shaped `/compact`\n * arrives at the model as literal text. Each entry here therefore needs its\n * own RPC frame, which is why the list holds only what is wired below rather\n * than everything the TUI offers.\n */\nexport const BUILTIN_COMMANDS: ReadonlyArray<{ name: string; description: string }> = [\n { name: COMPACT, description: 'Manually compact the session context' },\n { name: CLEAR, description: 'Start fresh: Po forgets the conversation so far, the transcript stays' },\n];\n\n/**\n * The frame a typed built-in maps to, or undefined when the text is an\n * ordinary prompt. The argument is passed through, so `/compact keep the API\n * decisions` reaches Pi as its custom instruction.\n */\nexport function builtinCommandFrame(text: string): Frame | undefined {\n // Split on any whitespace, not a space: the composer folds text attachments\n // into the draft with newlines, so a space-only split reads the newline as\n // part of the command name and silently sends the whole thing to the model.\n const matched = /^\\/(\\S+)(?:\\s+([\\s\\S]*))?$/u.exec(text.trim());\n // A clear takes no argument: text after it is dropped rather than sent to the model.\n if (matched?.[1] === CLEAR) return clearCommand();\n if (matched?.[1] !== COMPACT) return undefined;\n const argument = (matched[2] ?? '').trim();\n return compactCommand(argument.length > 0 ? argument : undefined);\n}\nexport function getAvailableModelsCommand(): Frame {\n return { type: 'get_available_models' };\n}\n\nexport function getAvailableThinkingLevelsCommand(): Frame {\n return { type: 'get_available_thinking_levels' };\n}\n\nexport function setModelCommand(provider: string, modelId: string): Frame {\n return { type: 'set_model', provider, modelId };\n}\n\nexport function setThinkingLevelCommand(level: string): Frame {\n return { type: 'set_thinking_level', level };\n}\n\nexport function setSessionNameCommand(name: string): Frame {\n return { type: 'set_session_name', name };\n}\n\nexport function dialogValue(id: string, value: string): Frame {\n return { type: 'extension_ui_response', id, value };\n}\n\nexport function dialogConfirmed(id: string, confirmed: boolean): Frame {\n return { type: 'extension_ui_response', id, confirmed };\n}\n\nexport function dialogCancelled(id: string): Frame {\n return { type: 'extension_ui_response', id, cancelled: true };\n}\n"],"mappings":";AAQA,SAAgB,cAAc,SAAiB,SAAqB,CAAC,GAAU;CAC7E,OAAO;EAAE,MAAM;EAAU;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AAC7E;AAEA,SAAgB,aAAa,SAAiB,SAAqB,CAAC,GAAU;CAC5E,OAAO;EAAE,MAAM;EAAS;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AAC5E;AAEA,SAAgB,gBAAgB,SAAiB,SAAqB,CAAC,GAAU;CAC/E,OAAO;EAAE,MAAM;EAAa;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AAChF;AAEA,SAAgB,wBAAwB,SAAiB,SAAqB,CAAC,GAAU;CACvF,OAAO;EAAE,MAAM;EAAqB;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OAAO,IAAI,CAAC;CAAG;AACxF;AAEA,SAAgB,oBAAoB,IAAmB;CACrD,OAAO;EAAE,MAAM;EAAiB;CAAG;AACrC;AAEA,SAAgB,qBAAqB,IAAY,aAA6B;CAC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AO,EAAE,MAAM,uBAAuB;AACxC;AAEA,SAAgB,oCAA2C;CACzD,OAAO,EAAE,MAAM,gCAAgC;AACjD;AAEA,SAAgB,gBAAgB,UAAkB,SAAwB;CACxE,OAAO;EAAE,MAAM;EAAa;EAAU;CAAQ;AAChD;AAEA,SAAgB,wBAAwB,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAsB;CAAM;AAC7C;AAEA,SAAgB,sBAAsB,MAAqB;CACzD,OAAO;EAAE,MAAM;EAAoB;CAAK;AAC1C;AAEA,SAAgB,YAAY,IAAY,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAM;AACpD;AAEA,SAAgB,gBAAgB,IAAY,WAA2B;CACrE,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAU;AACxD;AAEA,SAAgB,gBAAgB,IAAmB;CACjD,OAAO;EAAE,MAAM;EAAyB;EAAI,WAAW;CAAK;AAC9D"}
@@ -20,6 +20,8 @@ export declare function getStateCommand(): Frame;
20
20
  export declare function getSessionStatsCommand(): Frame;
21
21
  export declare function getCommandsCommand(): Frame;
22
22
  export declare function compactCommand(customInstructions?: string): Frame;
23
+ /** Drops the model's context without a summary. The transcript stays, with a notice where the memory restarts. */
24
+ export declare function clearCommand(): Frame;
23
25
  /**
24
26
  * Pi's built-in slash commands that the cockpit can actually run.
25
27
  *
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.mts","names":[],"sources":["../../../src/web/lib/commands.ts"],"mappings":";KAAK,QAAQ;iBAEI;EACf;EACA;EACA;;wBAGc,cAAc,iBAAiB,SAAQ,aAAkB;wBAIzD,aAAa,iBAAiB,SAAQ,aAAkB;wBAIxD,gBAAgB,iBAAiB,SAAQ,aAAkB;wBAI3D,wBAAwB,iBAAiB,SAAQ,aAAkB;wBAInE,oBAAoB,aAAa;wBAIjC,qBAAqB,YAAY,uBAAuB;wBAIxD,sBAAsB;;wBAKtB,cAAc,iBAAiB;wBAI/B,aAAa,uBAAuB;wBAIpC,qBAAqB;wBAIrB,mBAAmB;wBAInB,0BAA0B;wBAI1B,sBAAsB;wBAItB,eAAe,8BAA8B;;;;;;;;;;;;qBAiBhD,kBAAkB;EAAgB;EAAc;;;;;;;wBAS7C,oBAAoB,eAAe;wBASnC,6BAA6B;wBAI7B,qCAAqC;wBAIrC,gBAAgB,kBAAkB,kBAAkB;wBAIpD,wBAAwB,gBAAgB;wBAIxC,sBAAsB,eAAe;wBAIrC,YAAY,YAAY,gBAAgB;wBAIxC,gBAAgB,YAAY,qBAAqB;wBAIjD,gBAAgB,aAAa"}
1
+ {"version":3,"file":"commands.d.mts","names":[],"sources":["../../../src/web/lib/commands.ts"],"mappings":";KAAK,QAAQ;iBAEI;EACf;EACA;EACA;;wBAGc,cAAc,iBAAiB,SAAQ,aAAkB;wBAIzD,aAAa,iBAAiB,SAAQ,aAAkB;wBAIxD,gBAAgB,iBAAiB,SAAQ,aAAkB;wBAI3D,wBAAwB,iBAAiB,SAAQ,aAAkB;wBAInE,oBAAoB,aAAa;wBAIjC,qBAAqB,YAAY,uBAAuB;wBAIxD,sBAAsB;;wBAKtB,cAAc,iBAAiB;wBAI/B,aAAa,uBAAuB;wBAIpC,qBAAqB;wBAIrB,mBAAmB;wBAInB,0BAA0B;wBAI1B,sBAAsB;wBAItB,eAAe,8BAA8B;;wBAK7C,gBAAgB;;;;;;;;;;;;qBAkBnB,kBAAkB;EAAgB;EAAc;;;;;;;wBAU7C,oBAAoB,eAAe;wBAWnC,6BAA6B;wBAI7B,qCAAqC;wBAIrC,gBAAgB,kBAAkB,kBAAkB;wBAIpD,wBAAwB,gBAAgB;wBAIxC,sBAAsB,eAAe;wBAIrC,YAAY,YAAY,gBAAgB;wBAIxC,gBAAgB,YAAY,qBAAqB;wBAIjD,gBAAgB,aAAa"}
@@ -74,7 +74,15 @@ function compactCommand(customInstructions) {
74
74
  ...customInstructions === void 0 ? {} : { customInstructions }
75
75
  };
76
76
  }
77
+ /** Drops the model's context without a summary. The transcript stays, with a notice where the memory restarts. */
78
+ function clearCommand() {
79
+ return {
80
+ type: "compact",
81
+ clear: true
82
+ };
83
+ }
77
84
  const COMPACT = "compact";
85
+ const CLEAR = "clear";
78
86
  /**
79
87
  * Pi's built-in slash commands that the cockpit can actually run.
80
88
  *
@@ -89,6 +97,9 @@ const COMPACT = "compact";
89
97
  const BUILTIN_COMMANDS = [{
90
98
  name: COMPACT,
91
99
  description: "Manually compact the session context"
100
+ }, {
101
+ name: CLEAR,
102
+ description: "Start fresh: Po forgets the conversation so far, the transcript stays"
92
103
  }];
93
104
  /**
94
105
  * The frame a typed built-in maps to, or undefined when the text is an
@@ -97,6 +108,7 @@ const BUILTIN_COMMANDS = [{
97
108
  */
98
109
  function builtinCommandFrame(text) {
99
110
  const matched = /^\/(\S+)(?:\s+([\s\S]*))?$/u.exec(text.trim());
111
+ if (matched?.[1] === CLEAR) return clearCommand();
100
112
  if (matched?.[1] !== COMPACT) return void 0;
101
113
  const argument = (matched[2] ?? "").trim();
102
114
  return compactCommand(argument.length > 0 ? argument : void 0);
@@ -148,6 +160,6 @@ function dialogCancelled(id) {
148
160
  };
149
161
  }
150
162
  //#endregion
151
- export { BUILTIN_COMMANDS, abortCommand, builtinCommandFrame, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand };
163
+ export { BUILTIN_COMMANDS, abortCommand, builtinCommandFrame, clearCommand, clearQueueCommand, compactCommand, dialogCancelled, dialogConfirmed, dialogValue, enqueueAutomaticCommand, followUpCommand, getAvailableModelsCommand, getAvailableThinkingLevelsCommand, getCommandsCommand, getSessionStatsCommand, getStateCommand, promoteQueuedCommand, promptCommand, removeQueuedCommand, resumeQueueCommand, rewindCommand, setModelCommand, setSessionNameCommand, setThinkingLevelCommand, steerCommand };
152
164
 
153
165
  //# sourceMappingURL=commands.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.mjs","names":[],"sources":["../../../src/web/lib/commands.ts"],"sourcesContent":["type Frame = Record<string, unknown>;\n\nexport interface RpcImage {\n type: 'image';\n data: string;\n mimeType: string;\n}\n\nexport function promptCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'prompt', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function steerCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'steer', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function followUpCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'follow_up', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function enqueueAutomaticCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'enqueue_automatic', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function removeQueuedCommand(id: string): Frame {\n return { type: 'remove_queued', id };\n}\n\nexport function promoteQueuedCommand(id: string, operationId?: string): Frame {\n return { type: 'promote_queued', id, ...(operationId === undefined ? {} : { operationId }) };\n}\n\nexport function resumeQueueCommand(): Frame {\n return { type: 'resume_queue' };\n}\n\n/** Requests in-place Pi session-tree navigation after the hub resolves the visible transcript id. */\nexport function rewindCommand(itemId: string): Frame {\n return { type: 'rewind', itemId };\n}\n\nexport function abortCommand(operationId?: string): Frame {\n return operationId === undefined ? { type: 'abort' } : { type: 'abort', operationId };\n}\n\nexport function clearQueueCommand(): Frame {\n return { type: 'clear_queue' };\n}\n\nexport function getStateCommand(): Frame {\n return { type: 'get_state' };\n}\n\nexport function getSessionStatsCommand(): Frame {\n return { type: 'get_session_stats' };\n}\n\nexport function getCommandsCommand(): Frame {\n return { type: 'get_commands' };\n}\n\nexport function compactCommand(customInstructions?: string): Frame {\n return { type: 'compact', ...(customInstructions === undefined ? {} : { customInstructions }) };\n}\n\nconst COMPACT = 'compact';\n\n/**\n * Pi's built-in slash commands that the cockpit can actually run.\n *\n * `get_commands` reports extension commands, prompt templates and skills, and\n * nothing else, so the built-ins never reach the palette on their own. Nor can\n * they be sent as prompts: `session.prompt` has no branch for them, and the\n * TUI runs them by matching the raw typed text, so a prompt-shaped `/compact`\n * arrives at the model as literal text. Each entry here therefore needs its\n * own RPC frame, which is why the list holds only what is wired below rather\n * than everything the TUI offers.\n */\nexport const BUILTIN_COMMANDS: ReadonlyArray<{ name: string; description: string }> = [\n { name: COMPACT, description: 'Manually compact the session context' },\n];\n\n/**\n * The frame a typed built-in maps to, or undefined when the text is an\n * ordinary prompt. The argument is passed through, so `/compact keep the API\n * decisions` reaches Pi as its custom instruction.\n */\nexport function builtinCommandFrame(text: string): Frame | undefined {\n // Split on any whitespace, not a space: the composer folds text attachments\n // into the draft with newlines, so a space-only split reads the newline as\n // part of the command name and silently sends the whole thing to the model.\n const matched = /^\\/(\\S+)(?:\\s+([\\s\\S]*))?$/u.exec(text.trim());\n if (matched?.[1] !== COMPACT) return undefined;\n const argument = (matched[2] ?? '').trim();\n return compactCommand(argument.length > 0 ? argument : undefined);\n}\nexport function getAvailableModelsCommand(): Frame {\n return { type: 'get_available_models' };\n}\n\nexport function getAvailableThinkingLevelsCommand(): Frame {\n return { type: 'get_available_thinking_levels' };\n}\n\nexport function setModelCommand(provider: string, modelId: string): Frame {\n return { type: 'set_model', provider, modelId };\n}\n\nexport function setThinkingLevelCommand(level: string): Frame {\n return { type: 'set_thinking_level', level };\n}\n\nexport function setSessionNameCommand(name: string): Frame {\n return { type: 'set_session_name', name };\n}\n\nexport function dialogValue(id: string, value: string): Frame {\n return { type: 'extension_ui_response', id, value };\n}\n\nexport function dialogConfirmed(id: string, confirmed: boolean): Frame {\n return { type: 'extension_ui_response', id, confirmed };\n}\n\nexport function dialogCancelled(id: string): Frame {\n return { type: 'extension_ui_response', id, cancelled: true };\n}\n"],"mappings":";AAQA,SAAgB,cAAc,SAAiB,SAAqB,CAAC,GAAU;CAC7E,OAAO;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BAAoC;CACjE,OAAO;EAAE,MAAM;EAAW,GAAI,uBAAuB,KAAA,IAAY,CAAC,IAAI,EAAE,mBAAmB;CAAG;AAChG;AAEA,MAAM,UAAU;;;;;;;;;;;;AAahB,MAAa,mBAAyE,CACpF;CAAE,MAAM;CAAS,aAAa;AAAuC,CACvE;;;;;;AAOA,SAAgB,oBAAoB,MAAiC;CAInE,MAAM,UAAU,8BAA8B,KAAK,KAAK,KAAK,CAAC;CAC9D,IAAI,UAAU,OAAO,SAAS,OAAO,KAAA;CACrC,MAAM,YAAY,QAAQ,MAAM,GAAA,CAAI,KAAK;CACzC,OAAO,eAAe,SAAS,SAAS,IAAI,WAAW,KAAA,CAAS;AAClE;AACA,SAAgB,4BAAmC;CACjD,OAAO,EAAE,MAAM,uBAAuB;AACxC;AAEA,SAAgB,oCAA2C;CACzD,OAAO,EAAE,MAAM,gCAAgC;AACjD;AAEA,SAAgB,gBAAgB,UAAkB,SAAwB;CACxE,OAAO;EAAE,MAAM;EAAa;EAAU;CAAQ;AAChD;AAEA,SAAgB,wBAAwB,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAsB;CAAM;AAC7C;AAEA,SAAgB,sBAAsB,MAAqB;CACzD,OAAO;EAAE,MAAM;EAAoB;CAAK;AAC1C;AAEA,SAAgB,YAAY,IAAY,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAM;AACpD;AAEA,SAAgB,gBAAgB,IAAY,WAA2B;CACrE,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAU;AACxD;AAEA,SAAgB,gBAAgB,IAAmB;CACjD,OAAO;EAAE,MAAM;EAAyB;EAAI,WAAW;CAAK;AAC9D"}
1
+ {"version":3,"file":"commands.mjs","names":[],"sources":["../../../src/web/lib/commands.ts"],"sourcesContent":["type Frame = Record<string, unknown>;\n\nexport interface RpcImage {\n type: 'image';\n data: string;\n mimeType: string;\n}\n\nexport function promptCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'prompt', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function steerCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'steer', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function followUpCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'follow_up', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function enqueueAutomaticCommand(message: string, images: RpcImage[] = []): Frame {\n return { type: 'enqueue_automatic', message, ...(images.length > 0 ? { images } : {}) };\n}\n\nexport function removeQueuedCommand(id: string): Frame {\n return { type: 'remove_queued', id };\n}\n\nexport function promoteQueuedCommand(id: string, operationId?: string): Frame {\n return { type: 'promote_queued', id, ...(operationId === undefined ? {} : { operationId }) };\n}\n\nexport function resumeQueueCommand(): Frame {\n return { type: 'resume_queue' };\n}\n\n/** Requests in-place Pi session-tree navigation after the hub resolves the visible transcript id. */\nexport function rewindCommand(itemId: string): Frame {\n return { type: 'rewind', itemId };\n}\n\nexport function abortCommand(operationId?: string): Frame {\n return operationId === undefined ? { type: 'abort' } : { type: 'abort', operationId };\n}\n\nexport function clearQueueCommand(): Frame {\n return { type: 'clear_queue' };\n}\n\nexport function getStateCommand(): Frame {\n return { type: 'get_state' };\n}\n\nexport function getSessionStatsCommand(): Frame {\n return { type: 'get_session_stats' };\n}\n\nexport function getCommandsCommand(): Frame {\n return { type: 'get_commands' };\n}\n\nexport function compactCommand(customInstructions?: string): Frame {\n return { type: 'compact', ...(customInstructions === undefined ? {} : { customInstructions }) };\n}\n\n/** Drops the model's context without a summary. The transcript stays, with a notice where the memory restarts. */\nexport function clearCommand(): Frame {\n return { type: 'compact', clear: true };\n}\n\nconst COMPACT = 'compact';\nconst CLEAR = 'clear';\n\n/**\n * Pi's built-in slash commands that the cockpit can actually run.\n *\n * `get_commands` reports extension commands, prompt templates and skills, and\n * nothing else, so the built-ins never reach the palette on their own. Nor can\n * they be sent as prompts: `session.prompt` has no branch for them, and the\n * TUI runs them by matching the raw typed text, so a prompt-shaped `/compact`\n * arrives at the model as literal text. Each entry here therefore needs its\n * own RPC frame, which is why the list holds only what is wired below rather\n * than everything the TUI offers.\n */\nexport const BUILTIN_COMMANDS: ReadonlyArray<{ name: string; description: string }> = [\n { name: COMPACT, description: 'Manually compact the session context' },\n { name: CLEAR, description: 'Start fresh: Po forgets the conversation so far, the transcript stays' },\n];\n\n/**\n * The frame a typed built-in maps to, or undefined when the text is an\n * ordinary prompt. The argument is passed through, so `/compact keep the API\n * decisions` reaches Pi as its custom instruction.\n */\nexport function builtinCommandFrame(text: string): Frame | undefined {\n // Split on any whitespace, not a space: the composer folds text attachments\n // into the draft with newlines, so a space-only split reads the newline as\n // part of the command name and silently sends the whole thing to the model.\n const matched = /^\\/(\\S+)(?:\\s+([\\s\\S]*))?$/u.exec(text.trim());\n // A clear takes no argument: text after it is dropped rather than sent to the model.\n if (matched?.[1] === CLEAR) return clearCommand();\n if (matched?.[1] !== COMPACT) return undefined;\n const argument = (matched[2] ?? '').trim();\n return compactCommand(argument.length > 0 ? argument : undefined);\n}\nexport function getAvailableModelsCommand(): Frame {\n return { type: 'get_available_models' };\n}\n\nexport function getAvailableThinkingLevelsCommand(): Frame {\n return { type: 'get_available_thinking_levels' };\n}\n\nexport function setModelCommand(provider: string, modelId: string): Frame {\n return { type: 'set_model', provider, modelId };\n}\n\nexport function setThinkingLevelCommand(level: string): Frame {\n return { type: 'set_thinking_level', level };\n}\n\nexport function setSessionNameCommand(name: string): Frame {\n return { type: 'set_session_name', name };\n}\n\nexport function dialogValue(id: string, value: string): Frame {\n return { type: 'extension_ui_response', id, value };\n}\n\nexport function dialogConfirmed(id: string, confirmed: boolean): Frame {\n return { type: 'extension_ui_response', id, confirmed };\n}\n\nexport function dialogCancelled(id: string): Frame {\n return { type: 'extension_ui_response', id, cancelled: true };\n}\n"],"mappings":";AAQA,SAAgB,cAAc,SAAiB,SAAqB,CAAC,GAAU;CAC7E,OAAO;EAAE,MAAM;EAAU;EAAS,GAAI,OAAO,SAAS,IAAI,EAAE,OA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,IAAY,CAAC,IAAI,EAAE,mBAAmB;CAAG;AAChG;;AAGA,SAAgB,eAAsB;CACpC,OAAO;EAAE,MAAM;EAAW,OAAO;CAAK;AACxC;AAEA,MAAM,UAAU;AAChB,MAAM,QAAQ;;;;;;;;;;;;AAad,MAAa,mBAAyE,CACpF;CAAE,MAAM;CAAS,aAAa;AAAuC,GACrE;CAAE,MAAM;CAAO,aAAa;AAAwE,CACtG;;;;;;AAOA,SAAgB,oBAAoB,MAAiC;CAInE,MAAM,UAAU,8BAA8B,KAAK,KAAK,KAAK,CAAC;CAE9D,IAAI,UAAU,OAAO,OAAO,OAAO,aAAa;CAChD,IAAI,UAAU,OAAO,SAAS,OAAO,KAAA;CACrC,MAAM,YAAY,QAAQ,MAAM,GAAA,CAAI,KAAK;CACzC,OAAO,eAAe,SAAS,SAAS,IAAI,WAAW,KAAA,CAAS;AAClE;AACA,SAAgB,4BAAmC;CACjD,OAAO,EAAE,MAAM,uBAAuB;AACxC;AAEA,SAAgB,oCAA2C;CACzD,OAAO,EAAE,MAAM,gCAAgC;AACjD;AAEA,SAAgB,gBAAgB,UAAkB,SAAwB;CACxE,OAAO;EAAE,MAAM;EAAa;EAAU;CAAQ;AAChD;AAEA,SAAgB,wBAAwB,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAsB;CAAM;AAC7C;AAEA,SAAgB,sBAAsB,MAAqB;CACzD,OAAO;EAAE,MAAM;EAAoB;CAAK;AAC1C;AAEA,SAAgB,YAAY,IAAY,OAAsB;CAC5D,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAM;AACpD;AAEA,SAAgB,gBAAgB,IAAY,WAA2B;CACrE,OAAO;EAAE,MAAM;EAAyB;EAAI;CAAU;AACxD;AAEA,SAAgB,gBAAgB,IAAmB;CACjD,OAAO;EAAE,MAAM;EAAyB;EAAI,WAAW;CAAK;AAC9D"}
@@ -63,7 +63,10 @@ function bindSessionProtocol(sessionId, service, receive) {
63
63
  case "abort": return typeof frame.operationId === "string" ? service.abortOperation({ operationId: frame.operationId }) : service.abort();
64
64
  case "clear_queue": return service.clearQueue();
65
65
  case "rewind": return service.rewind({ itemId: text(frame.itemId) });
66
- case "compact": return service.compact(frame.customInstructions === void 0 ? {} : { customInstructions: text(frame.customInstructions) });
66
+ case "compact": return service.compact({
67
+ ...frame.customInstructions === void 0 ? {} : { customInstructions: text(frame.customInstructions) },
68
+ ...frame.clear === true ? { clear: true } : {}
69
+ });
67
70
  case "set_session_name": return service.setName(text(frame.name));
68
71
  case "set_model": return service.setModel({
69
72
  provider: text(frame.provider),
@@ -1 +1 @@
1
- {"version":3,"file":"sessionProtocolCommands.cjs","names":[],"sources":["../../../src/web/lib/sessionProtocolCommands.ts"],"sourcesContent":["import type {\n ImageContentPart,\n SessionMessageArgs,\n SessionRef,\n ThinkingLevel,\n} from '@agimon-ai/po-core/sessionProtocol';\n\ntype Frame = Record<string, unknown>;\nconst senders = new Map<string, (frame: Frame) => void>();\nconst releases = new Map<string, () => void>();\ntype CommandResponse = { success: boolean; data?: unknown; error?: string };\nconst requesters = new Map<string, (frame: Frame) => Promise<CommandResponse>>();\nlet requestSequence = 0;\nconst PARALLEL_COMMANDS = new Set([\n 'compact',\n 'abort',\n 'steer',\n 'promote_queued',\n 'resume_queue',\n 'extension_ui_response',\n 'get_commands',\n 'get_available_models',\n 'get_available_thinking_levels',\n]);\n\nexport function bindSessionProtocol(\n sessionId: string,\n service: SessionRef,\n receive: (frame: Frame) => void,\n): () => void {\n let settled = Promise.resolve();\n let active = true;\n const acknowledgements = new Map<string, (response: CommandResponse) => void>();\n const lifetime = new AbortController();\n const text = (value: unknown): string => {\n if (typeof value !== 'string') throw new Error('Expected command text.');\n return value;\n };\n const images = (value: unknown): ImageContentPart[] | undefined => {\n if (value === undefined) return undefined;\n if (!Array.isArray(value)) throw new Error('Invalid command images.');\n return value.map((image: unknown) => {\n if (\n !image ||\n typeof image !== 'object' ||\n !('type' in image) ||\n image.type !== 'image' ||\n !('data' in image) ||\n !('mimeType' in image)\n )\n throw new Error('Invalid command image.');\n return { type: 'image', data: text(image.data), mimeType: text(image.mimeType) };\n });\n };\n const messageArgs = (frame: Frame): SessionMessageArgs => {\n const parsedImages = images(frame.images);\n // The device's zone rides on every message, so a remote host learns where the person is. The host validates it.\n const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n return {\n text: text(frame.message),\n ...(parsedImages === undefined ? {} : { images: parsedImages }),\n ...(timeZone ? { timeZone } : {}),\n };\n };\n const invoke = async (frame: Frame, signal?: AbortSignal): Promise<unknown> => {\n signal?.throwIfAborted();\n switch (frame.type) {\n case 'prompt':\n // An accepted prompt owns the agent turn. Its context must outlive a\n // focused-session replacement so leaving the page cannot abort Pi.\n return service.prompt({ ...messageArgs(frame), waitFor: 'accepted' });\n case 'steer':\n return service.steer(messageArgs(frame));\n case 'follow_up':\n return service.followUp(messageArgs(frame));\n case 'enqueue_automatic':\n return service.enqueueAutomatic(messageArgs(frame));\n case 'remove_queued':\n return service.removeQueued({ id: text(frame.id) });\n case 'promote_queued':\n return service.promoteQueued({\n id: text(frame.id),\n ...(frame.operationId === undefined ? {} : { operationId: text(frame.operationId) }),\n });\n case 'resume_queue':\n return service.resumeQueue();\n case 'abort':\n return typeof frame.operationId === 'string'\n ? service.abortOperation({ operationId: frame.operationId })\n : service.abort();\n case 'clear_queue':\n return service.clearQueue();\n case 'rewind':\n return service.rewind({ itemId: text(frame.itemId) });\n case 'compact':\n return service.compact(\n frame.customInstructions === undefined ? {} : { customInstructions: text(frame.customInstructions) },\n );\n case 'set_session_name':\n return service.setName(text(frame.name));\n case 'set_model':\n return service.setModel({ provider: text(frame.provider), id: text(frame.modelId) });\n case 'set_fast_mode':\n if (typeof frame.enabled !== 'boolean') throw new Error('Invalid Fast mode.');\n return service.setFastMode(frame.enabled);\n case 'set_agent_lock':\n if (typeof frame.locked !== 'boolean') throw new Error('Invalid agent lock.');\n return service.setAgentLock(frame.locked);\n case 'set_thinking_level': {\n const level = text(frame.level);\n if (!['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'].includes(level))\n throw new Error('Invalid thinking level.');\n return service.setThinking(level as ThinkingLevel);\n }\n case 'extension_ui_response': {\n const id = text(frame.id);\n if (frame.cancelled === true) return service.extensionUiResponse({ id, cancelled: true });\n if (typeof frame.confirmed === 'boolean')\n return service.extensionUiResponse({ id, confirmed: frame.confirmed });\n return service.extensionUiResponse({ id, value: text(frame.value) });\n }\n case 'get_state':\n return service.getState();\n case 'get_session_stats':\n return service.getSessionStats();\n case 'get_commands':\n return { commands: await service.getCommands() };\n case 'get_available_models':\n return { models: await service.getAvailableModels() };\n case 'get_available_thinking_levels':\n return { levels: await service.getAvailableThinkingLevels() };\n default:\n throw new Error(`Unsupported session command: ${String(frame.type)}`);\n }\n };\n const sender = (frame: Frame) => {\n const execute = async (signal?: AbortSignal) => {\n if (!active) return;\n let response: CommandResponse;\n try {\n response = { success: true, data: await invoke(frame, signal) };\n } catch (error) {\n response = { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n if (!active) return;\n receive({ type: 'response', id: frame.requestId ?? frame.id, command: frame.type, ...response });\n if (typeof frame.requestId === 'string') {\n acknowledgements.get(frame.requestId)?.(response);\n acknowledgements.delete(frame.requestId);\n }\n };\n // Long-running work must not block interruption, abort, or a dialog response that can release it.\n // An accepted prompt owns the agent turn, so leaving the page cannot abort Pi.\n if (frame.type === 'prompt') void execute();\n else if (PARALLEL_COMMANDS.has(String(frame.type))) void execute(lifetime.signal);\n else settled = settled.then(() => execute(lifetime.signal));\n };\n const request = (frame: Frame): Promise<CommandResponse> => {\n const requestId = `${sessionId}:${String(++requestSequence)}`;\n return new Promise((resolve) => {\n acknowledgements.set(requestId, resolve);\n sender({ ...frame, requestId });\n });\n };\n const release = () => {\n if (senders.get(sessionId) !== sender) return;\n active = false;\n for (const resolve of acknowledgements.values())\n resolve({\n success: false,\n error: 'Delivery uncertain: the session connection was replaced. Check the queue before resending.',\n });\n acknowledgements.clear();\n lifetime.abort(new Error('The session protocol binding was replaced.'));\n senders.delete(sessionId);\n requesters.delete(sessionId);\n releases.delete(sessionId);\n };\n releases.get(sessionId)?.();\n senders.set(sessionId, sender);\n requesters.set(sessionId, request);\n releases.set(sessionId, release);\n return release;\n}\n\nexport function hasSessionProtocol(sessionId: string): boolean {\n return senders.has(sessionId);\n}\n\nexport function sendSessionProtocolFrame(sessionId: string, frame: Frame): void {\n const sender = senders.get(sessionId);\n if (!sender) throw new Error('The session protocol is not connected.');\n sender(frame);\n}\n\n/** Await admission without equating its response with native input consumption. */\nexport function requestSessionProtocolFrame(sessionId: string, frame: Frame): Promise<CommandResponse> {\n const request = requesters.get(sessionId);\n if (!request) return Promise.resolve({ success: false, error: 'The session protocol is not connected.' });\n return request(frame);\n}\n"],"mappings":";AAQA,MAAM,0BAAU,IAAI,IAAoC;AACxD,MAAM,2BAAW,IAAI,IAAwB;AAE7C,MAAM,6BAAa,IAAI,IAAwD;AAC/E,IAAI,kBAAkB;AACtB,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,oBACd,WACA,SACA,SACY;CACZ,IAAI,UAAU,QAAQ,QAAQ;CAC9B,IAAI,SAAS;CACb,MAAM,mCAAmB,IAAI,IAAiD;CAC9E,MAAM,WAAW,IAAI,gBAAgB;CACrC,MAAM,QAAQ,UAA2B;EACvC,IAAI,OAAO,UAAU,UAAU,MAAM,IAAI,MAAM,wBAAwB;EACvE,OAAO;CACT;CACA,MAAM,UAAU,UAAmD;EACjE,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;EAChC,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,MAAM,IAAI,MAAM,yBAAyB;EACpE,OAAO,MAAM,KAAK,UAAmB;GACnC,IACE,CAAC,SACD,OAAO,UAAU,YACjB,EAAE,UAAU,UACZ,MAAM,SAAS,WACf,EAAE,UAAU,UACZ,EAAE,cAAc,QAEhB,MAAM,IAAI,MAAM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ACT,CAAC;EACH,iBAAiB,MAAM;EACvB,SAAS,sBAAM,IAAI,MAAM,4CAA4C,CAAC;EACtE,QAAQ,OAAO,SAAS;EACxB,WAAW,OAAO,SAAS;EAC3B,SAAS,OAAO,SAAS;CAC3B;CACA,SAAS,IAAI,SAAS,CAAC,GAAG;CAC1B,QAAQ,IAAI,WAAW,MAAM;CAC7B,WAAW,IAAI,WAAW,OAAO;CACjC,SAAS,IAAI,WAAW,OAAO;CAC/B,OAAO;AACT;AAEA,SAAgB,mBAAmB,WAA4B;CAC7D,OAAO,QAAQ,IAAI,SAAS;AAC9B;AAEA,SAAgB,yBAAyB,WAAmB,OAAoB;CAC9E,MAAM,SAAS,QAAQ,IAAI,SAAS;CACpC,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,wCAAwC;CACrE,OAAO,KAAK;AACd;;AAGA,SAAgB,4BAA4B,WAAmB,OAAwC;CACrG,MAAM,UAAU,WAAW,IAAI,SAAS;CACxC,IAAI,CAAC,SAAS,OAAO,QAAQ,QAAQ;EAAE,SAAS;EAAO,OAAO;CAAyC,CAAC;CACxG,OAAO,QAAQ,KAAK;AACtB"}
1
+ {"version":3,"file":"sessionProtocolCommands.cjs","names":[],"sources":["../../../src/web/lib/sessionProtocolCommands.ts"],"sourcesContent":["import type {\n ImageContentPart,\n SessionMessageArgs,\n SessionRef,\n ThinkingLevel,\n} from '@agimon-ai/po-core/sessionProtocol';\n\ntype Frame = Record<string, unknown>;\nconst senders = new Map<string, (frame: Frame) => void>();\nconst releases = new Map<string, () => void>();\ntype CommandResponse = { success: boolean; data?: unknown; error?: string };\nconst requesters = new Map<string, (frame: Frame) => Promise<CommandResponse>>();\nlet requestSequence = 0;\nconst PARALLEL_COMMANDS = new Set([\n 'compact',\n 'abort',\n 'steer',\n 'promote_queued',\n 'resume_queue',\n 'extension_ui_response',\n 'get_commands',\n 'get_available_models',\n 'get_available_thinking_levels',\n]);\n\nexport function bindSessionProtocol(\n sessionId: string,\n service: SessionRef,\n receive: (frame: Frame) => void,\n): () => void {\n let settled = Promise.resolve();\n let active = true;\n const acknowledgements = new Map<string, (response: CommandResponse) => void>();\n const lifetime = new AbortController();\n const text = (value: unknown): string => {\n if (typeof value !== 'string') throw new Error('Expected command text.');\n return value;\n };\n const images = (value: unknown): ImageContentPart[] | undefined => {\n if (value === undefined) return undefined;\n if (!Array.isArray(value)) throw new Error('Invalid command images.');\n return value.map((image: unknown) => {\n if (\n !image ||\n typeof image !== 'object' ||\n !('type' in image) ||\n image.type !== 'image' ||\n !('data' in image) ||\n !('mimeType' in image)\n )\n throw new Error('Invalid command image.');\n return { type: 'image', data: text(image.data), mimeType: text(image.mimeType) };\n });\n };\n const messageArgs = (frame: Frame): SessionMessageArgs => {\n const parsedImages = images(frame.images);\n // The device's zone rides on every message, so a remote host learns where the person is. The host validates it.\n const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n return {\n text: text(frame.message),\n ...(parsedImages === undefined ? {} : { images: parsedImages }),\n ...(timeZone ? { timeZone } : {}),\n };\n };\n const invoke = async (frame: Frame, signal?: AbortSignal): Promise<unknown> => {\n signal?.throwIfAborted();\n switch (frame.type) {\n case 'prompt':\n // An accepted prompt owns the agent turn. Its context must outlive a\n // focused-session replacement so leaving the page cannot abort Pi.\n return service.prompt({ ...messageArgs(frame), waitFor: 'accepted' });\n case 'steer':\n return service.steer(messageArgs(frame));\n case 'follow_up':\n return service.followUp(messageArgs(frame));\n case 'enqueue_automatic':\n return service.enqueueAutomatic(messageArgs(frame));\n case 'remove_queued':\n return service.removeQueued({ id: text(frame.id) });\n case 'promote_queued':\n return service.promoteQueued({\n id: text(frame.id),\n ...(frame.operationId === undefined ? {} : { operationId: text(frame.operationId) }),\n });\n case 'resume_queue':\n return service.resumeQueue();\n case 'abort':\n return typeof frame.operationId === 'string'\n ? service.abortOperation({ operationId: frame.operationId })\n : service.abort();\n case 'clear_queue':\n return service.clearQueue();\n case 'rewind':\n return service.rewind({ itemId: text(frame.itemId) });\n case 'compact':\n return service.compact({\n ...(frame.customInstructions === undefined ? {} : { customInstructions: text(frame.customInstructions) }),\n ...(frame.clear === true ? { clear: true } : {}),\n });\n case 'set_session_name':\n return service.setName(text(frame.name));\n case 'set_model':\n return service.setModel({ provider: text(frame.provider), id: text(frame.modelId) });\n case 'set_fast_mode':\n if (typeof frame.enabled !== 'boolean') throw new Error('Invalid Fast mode.');\n return service.setFastMode(frame.enabled);\n case 'set_agent_lock':\n if (typeof frame.locked !== 'boolean') throw new Error('Invalid agent lock.');\n return service.setAgentLock(frame.locked);\n case 'set_thinking_level': {\n const level = text(frame.level);\n if (!['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'].includes(level))\n throw new Error('Invalid thinking level.');\n return service.setThinking(level as ThinkingLevel);\n }\n case 'extension_ui_response': {\n const id = text(frame.id);\n if (frame.cancelled === true) return service.extensionUiResponse({ id, cancelled: true });\n if (typeof frame.confirmed === 'boolean')\n return service.extensionUiResponse({ id, confirmed: frame.confirmed });\n return service.extensionUiResponse({ id, value: text(frame.value) });\n }\n case 'get_state':\n return service.getState();\n case 'get_session_stats':\n return service.getSessionStats();\n case 'get_commands':\n return { commands: await service.getCommands() };\n case 'get_available_models':\n return { models: await service.getAvailableModels() };\n case 'get_available_thinking_levels':\n return { levels: await service.getAvailableThinkingLevels() };\n default:\n throw new Error(`Unsupported session command: ${String(frame.type)}`);\n }\n };\n const sender = (frame: Frame) => {\n const execute = async (signal?: AbortSignal) => {\n if (!active) return;\n let response: CommandResponse;\n try {\n response = { success: true, data: await invoke(frame, signal) };\n } catch (error) {\n response = { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n if (!active) return;\n receive({ type: 'response', id: frame.requestId ?? frame.id, command: frame.type, ...response });\n if (typeof frame.requestId === 'string') {\n acknowledgements.get(frame.requestId)?.(response);\n acknowledgements.delete(frame.requestId);\n }\n };\n // Long-running work must not block interruption, abort, or a dialog response that can release it.\n // An accepted prompt owns the agent turn, so leaving the page cannot abort Pi.\n if (frame.type === 'prompt') void execute();\n else if (PARALLEL_COMMANDS.has(String(frame.type))) void execute(lifetime.signal);\n else settled = settled.then(() => execute(lifetime.signal));\n };\n const request = (frame: Frame): Promise<CommandResponse> => {\n const requestId = `${sessionId}:${String(++requestSequence)}`;\n return new Promise((resolve) => {\n acknowledgements.set(requestId, resolve);\n sender({ ...frame, requestId });\n });\n };\n const release = () => {\n if (senders.get(sessionId) !== sender) return;\n active = false;\n for (const resolve of acknowledgements.values())\n resolve({\n success: false,\n error: 'Delivery uncertain: the session connection was replaced. Check the queue before resending.',\n });\n acknowledgements.clear();\n lifetime.abort(new Error('The session protocol binding was replaced.'));\n senders.delete(sessionId);\n requesters.delete(sessionId);\n releases.delete(sessionId);\n };\n releases.get(sessionId)?.();\n senders.set(sessionId, sender);\n requesters.set(sessionId, request);\n releases.set(sessionId, release);\n return release;\n}\n\nexport function hasSessionProtocol(sessionId: string): boolean {\n return senders.has(sessionId);\n}\n\nexport function sendSessionProtocolFrame(sessionId: string, frame: Frame): void {\n const sender = senders.get(sessionId);\n if (!sender) throw new Error('The session protocol is not connected.');\n sender(frame);\n}\n\n/** Await admission without equating its response with native input consumption. */\nexport function requestSessionProtocolFrame(sessionId: string, frame: Frame): Promise<CommandResponse> {\n const request = requesters.get(sessionId);\n if (!request) return Promise.resolve({ success: false, error: 'The session protocol is not connected.' });\n return request(frame);\n}\n"],"mappings":";AAQA,MAAM,0BAAU,IAAI,IAAoC;AACxD,MAAM,2BAAW,IAAI,IAAwB;AAE7C,MAAM,6BAAa,IAAI,IAAwD;AAC/E,IAAI,kBAAkB;AACtB,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,oBACd,WACA,SACA,SACY;CACZ,IAAI,UAAU,QAAQ,QAAQ;CAC9B,IAAI,SAAS;CACb,MAAM,mCAAmB,IAAI,IAAiD;CAC9E,MAAM,WAAW,IAAI,gBAAgB;CACrC,MAAM,QAA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../../src/web/lib/sessionProtocolCommands.ts"],"mappings":";;KAOK,QAAQ;KAGR;EAAoB;EAAkB;EAAgB;;wBAe3C,oBACd,mBACA,SAAS,YACT,UAAU,OAAO;wBA6JH,mBAAmB;wBAInB,yBAAyB,mBAAmB,OAAO;;wBAOnD,4BAA4B,mBAAmB,OAAO,QAAQ,QAAQ"}
1
+ {"version":3,"file":"sessionProtocolCommands.d.mts","names":[],"sources":["../../../src/web/lib/sessionProtocolCommands.ts"],"mappings":";;KAOK,QAAQ;KAGR;EAAoB;EAAkB;EAAgB;;wBAe3C,oBACd,mBACA,SAAS,YACT,UAAU,OAAO;wBA8JH,mBAAmB;wBAInB,yBAAyB,mBAAmB,OAAO;;wBAOnD,4BAA4B,mBAAmB,OAAO,QAAQ,QAAQ"}
@@ -63,7 +63,10 @@ function bindSessionProtocol(sessionId, service, receive) {
63
63
  case "abort": return typeof frame.operationId === "string" ? service.abortOperation({ operationId: frame.operationId }) : service.abort();
64
64
  case "clear_queue": return service.clearQueue();
65
65
  case "rewind": return service.rewind({ itemId: text(frame.itemId) });
66
- case "compact": return service.compact(frame.customInstructions === void 0 ? {} : { customInstructions: text(frame.customInstructions) });
66
+ case "compact": return service.compact({
67
+ ...frame.customInstructions === void 0 ? {} : { customInstructions: text(frame.customInstructions) },
68
+ ...frame.clear === true ? { clear: true } : {}
69
+ });
67
70
  case "set_session_name": return service.setName(text(frame.name));
68
71
  case "set_model": return service.setModel({
69
72
  provider: text(frame.provider),
@@ -1 +1 @@
1
- {"version":3,"file":"sessionProtocolCommands.mjs","names":[],"sources":["../../../src/web/lib/sessionProtocolCommands.ts"],"sourcesContent":["import type {\n ImageContentPart,\n SessionMessageArgs,\n SessionRef,\n ThinkingLevel,\n} from '@agimon-ai/po-core/sessionProtocol';\n\ntype Frame = Record<string, unknown>;\nconst senders = new Map<string, (frame: Frame) => void>();\nconst releases = new Map<string, () => void>();\ntype CommandResponse = { success: boolean; data?: unknown; error?: string };\nconst requesters = new Map<string, (frame: Frame) => Promise<CommandResponse>>();\nlet requestSequence = 0;\nconst PARALLEL_COMMANDS = new Set([\n 'compact',\n 'abort',\n 'steer',\n 'promote_queued',\n 'resume_queue',\n 'extension_ui_response',\n 'get_commands',\n 'get_available_models',\n 'get_available_thinking_levels',\n]);\n\nexport function bindSessionProtocol(\n sessionId: string,\n service: SessionRef,\n receive: (frame: Frame) => void,\n): () => void {\n let settled = Promise.resolve();\n let active = true;\n const acknowledgements = new Map<string, (response: CommandResponse) => void>();\n const lifetime = new AbortController();\n const text = (value: unknown): string => {\n if (typeof value !== 'string') throw new Error('Expected command text.');\n return value;\n };\n const images = (value: unknown): ImageContentPart[] | undefined => {\n if (value === undefined) return undefined;\n if (!Array.isArray(value)) throw new Error('Invalid command images.');\n return value.map((image: unknown) => {\n if (\n !image ||\n typeof image !== 'object' ||\n !('type' in image) ||\n image.type !== 'image' ||\n !('data' in image) ||\n !('mimeType' in image)\n )\n throw new Error('Invalid command image.');\n return { type: 'image', data: text(image.data), mimeType: text(image.mimeType) };\n });\n };\n const messageArgs = (frame: Frame): SessionMessageArgs => {\n const parsedImages = images(frame.images);\n // The device's zone rides on every message, so a remote host learns where the person is. The host validates it.\n const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n return {\n text: text(frame.message),\n ...(parsedImages === undefined ? {} : { images: parsedImages }),\n ...(timeZone ? { timeZone } : {}),\n };\n };\n const invoke = async (frame: Frame, signal?: AbortSignal): Promise<unknown> => {\n signal?.throwIfAborted();\n switch (frame.type) {\n case 'prompt':\n // An accepted prompt owns the agent turn. Its context must outlive a\n // focused-session replacement so leaving the page cannot abort Pi.\n return service.prompt({ ...messageArgs(frame), waitFor: 'accepted' });\n case 'steer':\n return service.steer(messageArgs(frame));\n case 'follow_up':\n return service.followUp(messageArgs(frame));\n case 'enqueue_automatic':\n return service.enqueueAutomatic(messageArgs(frame));\n case 'remove_queued':\n return service.removeQueued({ id: text(frame.id) });\n case 'promote_queued':\n return service.promoteQueued({\n id: text(frame.id),\n ...(frame.operationId === undefined ? {} : { operationId: text(frame.operationId) }),\n });\n case 'resume_queue':\n return service.resumeQueue();\n case 'abort':\n return typeof frame.operationId === 'string'\n ? service.abortOperation({ operationId: frame.operationId })\n : service.abort();\n case 'clear_queue':\n return service.clearQueue();\n case 'rewind':\n return service.rewind({ itemId: text(frame.itemId) });\n case 'compact':\n return service.compact(\n frame.customInstructions === undefined ? {} : { customInstructions: text(frame.customInstructions) },\n );\n case 'set_session_name':\n return service.setName(text(frame.name));\n case 'set_model':\n return service.setModel({ provider: text(frame.provider), id: text(frame.modelId) });\n case 'set_fast_mode':\n if (typeof frame.enabled !== 'boolean') throw new Error('Invalid Fast mode.');\n return service.setFastMode(frame.enabled);\n case 'set_agent_lock':\n if (typeof frame.locked !== 'boolean') throw new Error('Invalid agent lock.');\n return service.setAgentLock(frame.locked);\n case 'set_thinking_level': {\n const level = text(frame.level);\n if (!['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'].includes(level))\n throw new Error('Invalid thinking level.');\n return service.setThinking(level as ThinkingLevel);\n }\n case 'extension_ui_response': {\n const id = text(frame.id);\n if (frame.cancelled === true) return service.extensionUiResponse({ id, cancelled: true });\n if (typeof frame.confirmed === 'boolean')\n return service.extensionUiResponse({ id, confirmed: frame.confirmed });\n return service.extensionUiResponse({ id, value: text(frame.value) });\n }\n case 'get_state':\n return service.getState();\n case 'get_session_stats':\n return service.getSessionStats();\n case 'get_commands':\n return { commands: await service.getCommands() };\n case 'get_available_models':\n return { models: await service.getAvailableModels() };\n case 'get_available_thinking_levels':\n return { levels: await service.getAvailableThinkingLevels() };\n default:\n throw new Error(`Unsupported session command: ${String(frame.type)}`);\n }\n };\n const sender = (frame: Frame) => {\n const execute = async (signal?: AbortSignal) => {\n if (!active) return;\n let response: CommandResponse;\n try {\n response = { success: true, data: await invoke(frame, signal) };\n } catch (error) {\n response = { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n if (!active) return;\n receive({ type: 'response', id: frame.requestId ?? frame.id, command: frame.type, ...response });\n if (typeof frame.requestId === 'string') {\n acknowledgements.get(frame.requestId)?.(response);\n acknowledgements.delete(frame.requestId);\n }\n };\n // Long-running work must not block interruption, abort, or a dialog response that can release it.\n // An accepted prompt owns the agent turn, so leaving the page cannot abort Pi.\n if (frame.type === 'prompt') void execute();\n else if (PARALLEL_COMMANDS.has(String(frame.type))) void execute(lifetime.signal);\n else settled = settled.then(() => execute(lifetime.signal));\n };\n const request = (frame: Frame): Promise<CommandResponse> => {\n const requestId = `${sessionId}:${String(++requestSequence)}`;\n return new Promise((resolve) => {\n acknowledgements.set(requestId, resolve);\n sender({ ...frame, requestId });\n });\n };\n const release = () => {\n if (senders.get(sessionId) !== sender) return;\n active = false;\n for (const resolve of acknowledgements.values())\n resolve({\n success: false,\n error: 'Delivery uncertain: the session connection was replaced. Check the queue before resending.',\n });\n acknowledgements.clear();\n lifetime.abort(new Error('The session protocol binding was replaced.'));\n senders.delete(sessionId);\n requesters.delete(sessionId);\n releases.delete(sessionId);\n };\n releases.get(sessionId)?.();\n senders.set(sessionId, sender);\n requesters.set(sessionId, request);\n releases.set(sessionId, release);\n return release;\n}\n\nexport function hasSessionProtocol(sessionId: string): boolean {\n return senders.has(sessionId);\n}\n\nexport function sendSessionProtocolFrame(sessionId: string, frame: Frame): void {\n const sender = senders.get(sessionId);\n if (!sender) throw new Error('The session protocol is not connected.');\n sender(frame);\n}\n\n/** Await admission without equating its response with native input consumption. */\nexport function requestSessionProtocolFrame(sessionId: string, frame: Frame): Promise<CommandResponse> {\n const request = requesters.get(sessionId);\n if (!request) return Promise.resolve({ success: false, error: 'The session protocol is not connected.' });\n return request(frame);\n}\n"],"mappings":";AAQA,MAAM,0BAAU,IAAI,IAAoC;AACxD,MAAM,2BAAW,IAAI,IAAwB;AAE7C,MAAM,6BAAa,IAAI,IAAwD;AAC/E,IAAI,kBAAkB;AACtB,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CAC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C,CAAC;CACxG,OAAO,QAAQ,KAAK;AACtB"}
1
+ {"version":3,"file":"sessionProtocolCommands.mjs","names":[],"sources":["../../../src/web/lib/sessionProtocolCommands.ts"],"sourcesContent":["import type {\n ImageContentPart,\n SessionMessageArgs,\n SessionRef,\n ThinkingLevel,\n} from '@agimon-ai/po-core/sessionProtocol';\n\ntype Frame = Record<string, unknown>;\nconst senders = new Map<string, (frame: Frame) => void>();\nconst releases = new Map<string, () => void>();\ntype CommandResponse = { success: boolean; data?: unknown; error?: string };\nconst requesters = new Map<string, (frame: Frame) => Promise<CommandResponse>>();\nlet requestSequence = 0;\nconst PARALLEL_COMMANDS = new Set([\n 'compact',\n 'abort',\n 'steer',\n 'promote_queued',\n 'resume_queue',\n 'extension_ui_response',\n 'get_commands',\n 'get_available_models',\n 'get_available_thinking_levels',\n]);\n\nexport function bindSessionProtocol(\n sessionId: string,\n service: SessionRef,\n receive: (frame: Frame) => void,\n): () => void {\n let settled = Promise.resolve();\n let active = true;\n const acknowledgements = new Map<string, (response: CommandResponse) => void>();\n const lifetime = new AbortController();\n const text = (value: unknown): string => {\n if (typeof value !== 'string') throw new Error('Expected command text.');\n return value;\n };\n const images = (value: unknown): ImageContentPart[] | undefined => {\n if (value === undefined) return undefined;\n if (!Array.isArray(value)) throw new Error('Invalid command images.');\n return value.map((image: unknown) => {\n if (\n !image ||\n typeof image !== 'object' ||\n !('type' in image) ||\n image.type !== 'image' ||\n !('data' in image) ||\n !('mimeType' in image)\n )\n throw new Error('Invalid command image.');\n return { type: 'image', data: text(image.data), mimeType: text(image.mimeType) };\n });\n };\n const messageArgs = (frame: Frame): SessionMessageArgs => {\n const parsedImages = images(frame.images);\n // The device's zone rides on every message, so a remote host learns where the person is. The host validates it.\n const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n return {\n text: text(frame.message),\n ...(parsedImages === undefined ? {} : { images: parsedImages }),\n ...(timeZone ? { timeZone } : {}),\n };\n };\n const invoke = async (frame: Frame, signal?: AbortSignal): Promise<unknown> => {\n signal?.throwIfAborted();\n switch (frame.type) {\n case 'prompt':\n // An accepted prompt owns the agent turn. Its context must outlive a\n // focused-session replacement so leaving the page cannot abort Pi.\n return service.prompt({ ...messageArgs(frame), waitFor: 'accepted' });\n case 'steer':\n return service.steer(messageArgs(frame));\n case 'follow_up':\n return service.followUp(messageArgs(frame));\n case 'enqueue_automatic':\n return service.enqueueAutomatic(messageArgs(frame));\n case 'remove_queued':\n return service.removeQueued({ id: text(frame.id) });\n case 'promote_queued':\n return service.promoteQueued({\n id: text(frame.id),\n ...(frame.operationId === undefined ? {} : { operationId: text(frame.operationId) }),\n });\n case 'resume_queue':\n return service.resumeQueue();\n case 'abort':\n return typeof frame.operationId === 'string'\n ? service.abortOperation({ operationId: frame.operationId })\n : service.abort();\n case 'clear_queue':\n return service.clearQueue();\n case 'rewind':\n return service.rewind({ itemId: text(frame.itemId) });\n case 'compact':\n return service.compact({\n ...(frame.customInstructions === undefined ? {} : { customInstructions: text(frame.customInstructions) }),\n ...(frame.clear === true ? { clear: true } : {}),\n });\n case 'set_session_name':\n return service.setName(text(frame.name));\n case 'set_model':\n return service.setModel({ provider: text(frame.provider), id: text(frame.modelId) });\n case 'set_fast_mode':\n if (typeof frame.enabled !== 'boolean') throw new Error('Invalid Fast mode.');\n return service.setFastMode(frame.enabled);\n case 'set_agent_lock':\n if (typeof frame.locked !== 'boolean') throw new Error('Invalid agent lock.');\n return service.setAgentLock(frame.locked);\n case 'set_thinking_level': {\n const level = text(frame.level);\n if (!['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'].includes(level))\n throw new Error('Invalid thinking level.');\n return service.setThinking(level as ThinkingLevel);\n }\n case 'extension_ui_response': {\n const id = text(frame.id);\n if (frame.cancelled === true) return service.extensionUiResponse({ id, cancelled: true });\n if (typeof frame.confirmed === 'boolean')\n return service.extensionUiResponse({ id, confirmed: frame.confirmed });\n return service.extensionUiResponse({ id, value: text(frame.value) });\n }\n case 'get_state':\n return service.getState();\n case 'get_session_stats':\n return service.getSessionStats();\n case 'get_commands':\n return { commands: await service.getCommands() };\n case 'get_available_models':\n return { models: await service.getAvailableModels() };\n case 'get_available_thinking_levels':\n return { levels: await service.getAvailableThinkingLevels() };\n default:\n throw new Error(`Unsupported session command: ${String(frame.type)}`);\n }\n };\n const sender = (frame: Frame) => {\n const execute = async (signal?: AbortSignal) => {\n if (!active) return;\n let response: CommandResponse;\n try {\n response = { success: true, data: await invoke(frame, signal) };\n } catch (error) {\n response = { success: false, error: error instanceof Error ? error.message : String(error) };\n }\n if (!active) return;\n receive({ type: 'response', id: frame.requestId ?? frame.id, command: frame.type, ...response });\n if (typeof frame.requestId === 'string') {\n acknowledgements.get(frame.requestId)?.(response);\n acknowledgements.delete(frame.requestId);\n }\n };\n // Long-running work must not block interruption, abort, or a dialog response that can release it.\n // An accepted prompt owns the agent turn, so leaving the page cannot abort Pi.\n if (frame.type === 'prompt') void execute();\n else if (PARALLEL_COMMANDS.has(String(frame.type))) void execute(lifetime.signal);\n else settled = settled.then(() => execute(lifetime.signal));\n };\n const request = (frame: Frame): Promise<CommandResponse> => {\n const requestId = `${sessionId}:${String(++requestSequence)}`;\n return new Promise((resolve) => {\n acknowledgements.set(requestId, resolve);\n sender({ ...frame, requestId });\n });\n };\n const release = () => {\n if (senders.get(sessionId) !== sender) return;\n active = false;\n for (const resolve of acknowledgements.values())\n resolve({\n success: false,\n error: 'Delivery uncertain: the session connection was replaced. Check the queue before resending.',\n });\n acknowledgements.clear();\n lifetime.abort(new Error('The session protocol binding was replaced.'));\n senders.delete(sessionId);\n requesters.delete(sessionId);\n releases.delete(sessionId);\n };\n releases.get(sessionId)?.();\n senders.set(sessionId, sender);\n requesters.set(sessionId, request);\n releases.set(sessionId, release);\n return release;\n}\n\nexport function hasSessionProtocol(sessionId: string): boolean {\n return senders.has(sessionId);\n}\n\nexport function sendSessionProtocolFrame(sessionId: string, frame: Frame): void {\n const sender = senders.get(sessionId);\n if (!sender) throw new Error('The session protocol is not connected.');\n sender(frame);\n}\n\n/** Await admission without equating its response with native input consumption. */\nexport function requestSessionProtocolFrame(sessionId: string, frame: Frame): Promise<CommandResponse> {\n const request = requesters.get(sessionId);\n if (!request) return Promise.resolve({ success: false, error: 'The session protocol is not connected.' });\n return request(frame);\n}\n"],"mappings":";AAQA,MAAM,0BAAU,IAAI,IAAoC;AACxD,MAAM,2BAAW,IAAI,IAAwB;AAE7C,MAAM,6BAAa,IAAI,IAAwD;AAC/E,IAAI,kBAAkB;AACtB,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,oBACd,WACA,SACA,SACY;CACZ,IAAI,UAAU,QAAQ,QAAQ;CAC9B,IAAI,SAAS;CACb,MAAM,mCAAmB,IAAI,IAAiD;CAC9E,MAAM,WAAW,IAAI,gBAAgB;CACrC,MAAM,QAAQ,UAA2B;EACvC,IAAI,OAAO,UAAU,UAAU,MAAM,IAAI,MAAM,wBAAwB;EACvE,OAAO;CACT;CACA,MAAM,UAAU,UAAmD;EACjE,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;EAChC,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,MAAM,IAAI,MAAM,yBAAyB;EACpE,OAAO,MAAM,KAAK,UAAmB;GACnC,IACE,CAAC,SACD,OAAO,UAAU,YACjB,EAAE,UAAU,UACZ,MAAM,SAAS,WACf,EAAE,UAAU,UACZ,EAAE,cAAc,QAEhB,MAAM,IAAI,MAAM,wBAAwB;GAC1C,OAAO;IAAE,MAAM;IAAS,MAAM,KAAK,MAAM,IAAI;IAAG,UAAU,KAAK,MAAM,QAAQ;GAAE;EACjF,CAAC;CACH;CACA,MAAM,eAAe,UAAqC;EACxD,MAAM,eAAe,OAAO,MAAM,MAAM;EAExC,MAAM,WAAW,KAAK,eAAe,CAAC,CAAC,gBAAgB,CAAC,CAAC;EACzD,OAAO;GACL,MAAM,KAAK,MAAM,OAAO;GACxB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AAI,WAAW,MAAM;CAC7B,WAAW,IAAI,WAAW,OAAO;CACjC,SAAS,IAAI,WAAW,OAAO;CAC/B,OAAO;AACT;AAEA,SAAgB,mBAAmB,WAA4B;CAC7D,OAAO,QAAQ,IAAI,SAAS;AAC9B;AAEA,SAAgB,yBAAyB,WAAmB,OAAoB;CAC9E,MAAM,SAAS,QAAQ,IAAI,SAAS;CACpC,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,wCAAwC;CACrE,OAAO,KAAK;AACd;;AAGA,SAAgB,4BAA4B,WAAmB,OAAwC;CACrG,MAAM,UAAU,WAAW,IAAI,SAAS;CACxC,IAAI,CAAC,SAAS,OAAO,QAAQ,QAAQ;EAAE,SAAS;EAAO,OAAO;CAAyC,CAAC;CACxG,OAAO,QAAQ,KAAK;AACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-web-dashboard",
3
- "version": "0.0.0-alpha.164",
3
+ "version": "0.0.0-alpha.166",
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.164",
65
- "@agimon-ai/po-web-components": "0.0.0-alpha.164",
66
- "@agimon-ai/po-web-security": "0.0.0-alpha.164",
64
+ "@agimon-ai/po-core": "0.0.0-alpha.166",
65
+ "@agimon-ai/po-web-components": "0.0.0-alpha.166",
66
+ "@agimon-ai/po-web-security": "0.0.0-alpha.166",
67
67
  "@earendil-works/chord": "1.5.1",
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.164",
76
+ "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.166",
77
77
  "@types/node": "26.6.5",
78
78
  "@types/react": "19.3.0",
79
79
  "@types/react-dom": "19.3.0",