@agimon-ai/po-web-dashboard 0.0.0-alpha.151 → 0.0.0-alpha.152

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.
Files changed (54) hide show
  1. package/dist/core.cjs +3 -0
  2. package/dist/core.d.mts +2 -2
  3. package/dist/core.mjs +2 -2
  4. package/dist/types/plugins.d.mts +42 -0
  5. package/dist/types/plugins.d.mts.map +1 -1
  6. package/dist/types.d.mts +2 -2
  7. package/dist/web/features/plugins/ExternalPluginPage.cjs +215 -0
  8. package/dist/web/features/plugins/ExternalPluginPage.cjs.map +1 -0
  9. package/dist/web/features/plugins/ExternalPluginPage.mjs +215 -0
  10. package/dist/web/features/plugins/ExternalPluginPage.mjs.map +1 -0
  11. package/dist/web/features/plugins/ExternalPluginView.cjs +378 -0
  12. package/dist/web/features/plugins/ExternalPluginView.cjs.map +1 -0
  13. package/dist/web/features/plugins/ExternalPluginView.mjs +378 -0
  14. package/dist/web/features/plugins/ExternalPluginView.mjs.map +1 -0
  15. package/dist/web/features/plugins/PluginCatalogView.cjs +4 -0
  16. package/dist/web/features/plugins/PluginCatalogView.cjs.map +1 -1
  17. package/dist/web/features/plugins/PluginCatalogView.mjs +4 -0
  18. package/dist/web/features/plugins/PluginCatalogView.mjs.map +1 -1
  19. package/dist/web/features/plugins/PluginDetailView.cjs +5 -20
  20. package/dist/web/features/plugins/PluginDetailView.cjs.map +1 -1
  21. package/dist/web/features/plugins/PluginDetailView.mjs +5 -20
  22. package/dist/web/features/plugins/PluginDetailView.mjs.map +1 -1
  23. package/dist/web/features/plugins/PluginOnboarding.cjs +10 -3
  24. package/dist/web/features/plugins/PluginOnboarding.cjs.map +1 -1
  25. package/dist/web/features/plugins/PluginOnboarding.mjs +10 -3
  26. package/dist/web/features/plugins/PluginOnboarding.mjs.map +1 -1
  27. package/dist/web/features/plugins/PluginsPage.cjs +31 -19
  28. package/dist/web/features/plugins/PluginsPage.cjs.map +1 -1
  29. package/dist/web/features/plugins/PluginsPage.d.mts.map +1 -1
  30. package/dist/web/features/plugins/PluginsPage.mjs +32 -20
  31. package/dist/web/features/plugins/PluginsPage.mjs.map +1 -1
  32. package/dist/web/lib/catalogEntries.cjs +69 -15
  33. package/dist/web/lib/catalogEntries.cjs.map +1 -1
  34. package/dist/web/lib/catalogEntries.d.mts +15 -1
  35. package/dist/web/lib/catalogEntries.d.mts.map +1 -1
  36. package/dist/web/lib/catalogEntries.mjs +67 -16
  37. package/dist/web/lib/catalogEntries.mjs.map +1 -1
  38. package/dist/web/lib/cloudHub.cjs +22 -2
  39. package/dist/web/lib/cloudHub.cjs.map +1 -1
  40. package/dist/web/lib/cloudHub.d.mts +5 -1
  41. package/dist/web/lib/cloudHub.d.mts.map +1 -1
  42. package/dist/web/lib/cloudHub.mjs +22 -2
  43. package/dist/web/lib/cloudHub.mjs.map +1 -1
  44. package/dist/web/lib/pluginMarketplaceApi.cjs +107 -3
  45. package/dist/web/lib/pluginMarketplaceApi.cjs.map +1 -1
  46. package/dist/web/lib/pluginMarketplaceApi.mjs +102 -4
  47. package/dist/web/lib/pluginMarketplaceApi.mjs.map +1 -1
  48. package/dist/web/lib/pluginRegistry.cjs +4 -3
  49. package/dist/web/lib/pluginRegistry.cjs.map +1 -1
  50. package/dist/web/lib/pluginRegistry.d.mts +2 -0
  51. package/dist/web/lib/pluginRegistry.d.mts.map +1 -1
  52. package/dist/web/lib/pluginRegistry.mjs +4 -3
  53. package/dist/web/lib/pluginRegistry.mjs.map +1 -1
  54. package/package.json +5 -5
package/dist/core.cjs CHANGED
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "HOST_SLOTS", {
54
54
  return _agimon_ai_po_core_web.HOST_SLOTS;
55
55
  }
56
56
  });
57
+ exports.INSTALL_LOST_AFTER = require_catalogEntries.INSTALL_LOST_AFTER;
57
58
  exports.ImageRefScope = require_imageRefStore.ImageRefScope;
58
59
  exports.LEGACY_WORKSPACE_ID = require_sessionRailModel.LEGACY_WORKSPACE_ID;
59
60
  exports.MAX_COMPLETION_ITEMS = require_composerCompletion.MAX_COMPLETION_ITEMS;
@@ -152,6 +153,7 @@ exports.dropTransientTabs = require_transientTabsStore.dropTransientTabs;
152
153
  exports.endSessionReplay = require_sessionStore.endSessionReplay;
153
154
  exports.enqueueAutomaticCommand = require_commands.enqueueAutomaticCommand;
154
155
  exports.externalId = require_catalogEntries.externalId;
156
+ exports.externalServerRows = require_catalogEntries.externalServerRows;
155
157
  exports.fileCompletions = require_composerCompletion.fileCompletions;
156
158
  exports.fileLinkMentions = require_composition.fileLinkMentions;
157
159
  exports.fileTabForPath = require_composition.fileTabForPath;
@@ -181,6 +183,7 @@ exports.imagesFromContent = require_sessionModel.imagesFromContent;
181
183
  exports.inactiveTotal = require_contextComposition.inactiveTotal;
182
184
  exports.initialSessionState = require_sessionModel.initialSessionState;
183
185
  exports.installHostWebPlugins = require_pluginRegistry.installHostWebPlugins;
186
+ exports.installReadLost = require_catalogEntries.installReadLost;
184
187
  exports.installSessionWebPlugins = require_pluginRegistry.installSessionWebPlugins;
185
188
  exports.installWebPlugins = require_pluginRegistry.installWebPlugins;
186
189
  exports.installWorkspaceWebPlugins = require_pluginRegistry.installWorkspaceWebPlugins;
package/dist/core.d.mts CHANGED
@@ -14,7 +14,7 @@ import { mergeScopedPlugins, pluginsAtScope } from "./web/lib/pluginScopes.mjs";
14
14
  import { ComposerPromptClaim, DialogPromptClaim, ToolPromptClaim, ToolPromptInput, toolPromptClaim } from "./web/lib/toolPrompt.mjs";
15
15
  import { UiTraceRecord, UiTraceSink, flushUiTrace, noteRender, noteStoreUpdate, setUiTraceSink, traceProfilerRender, traceStore, useRenderTrace } from "./web/lib/uiTrace.mjs";
16
16
  import { repositorySettingsViewFromWire, settingsConfigViewFromWire, settingsScopeToWire, settingsWriteToWire } from "./web/lib/settingsWire.mjs";
17
- import { catalogEntries, destinationOf, externalId, filterEntries, presetSummaries } from "./web/lib/catalogEntries.mjs";
17
+ import { INSTALL_LOST_AFTER, catalogEntries, destinationOf, externalId, externalServerRows, filterEntries, installReadLost, presetSummaries } from "./web/lib/catalogEntries.mjs";
18
18
  import { TransientTabActions, pluginSessionContext, pluginSlotProps, renderRegion } from "./web/lib/pluginSlotProps.mjs";
19
19
  import { toolMessageProps } from "./web/lib/toolMessageProps.mjs";
20
20
  import { ToolRendererBoundary } from "./web/lib/ToolRendererBoundary.mjs";
@@ -44,4 +44,4 @@ import { createWebMcpSimulator } from "./web/lib/webmcpSimulator.mjs";
44
44
  import { defaultHostId, isHostId, localHostId, parseHostKey, qualifyHostId, qualifyHostKey, setDefaultHostId, splitHostId } from "./web/lib/hostIdentity.mjs";
45
45
  import { CLOUD_HUB_POLL_MS, CloudHub, CloudHubFetch, CloudHubOptions, CloudHubSnapshot, createCloudHub } from "./web/lib/cloudHub.mjs";
46
46
  import { asWorkspace } from "./web/lib/workspaceSummary.mjs";
47
- export { 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, 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 MinorMode, ModelChoice, type NativeTemplateCatalog, NoticeEntry, ProfileIdentity, QueuedEntry, RailRestartState, RailSessionInput, ReduceSessionOptions, ResolvedFill, RpcImage, SESSION_REFERENCE_SCHEME, type SelectionAxis, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettledEntry, StatusClock, StatusLineInput, TRIGGER_CHARS, ThreadTranscriptReader, TimelineEntry, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolRendererBoundary, type TransientTabActions, UPDATE_REQUIRED_REASON, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WebPluginRegistry, WorkspacesState, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, 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, 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, installHostWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginMinorModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railSessionStatus, readHostHome, reduceSession, 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, 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, sessionMinorModes, 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, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
47
+ export { 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 MinorMode, ModelChoice, type NativeTemplateCatalog, NoticeEntry, ProfileIdentity, QueuedEntry, RailRestartState, RailSessionInput, ReduceSessionOptions, ResolvedFill, RpcImage, SESSION_REFERENCE_SCHEME, type SelectionAxis, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SettledEntry, StatusClock, StatusLineInput, TRIGGER_CHARS, ThreadTranscriptReader, TimelineEntry, ToolEntry, ToolPromptClaim, ToolPromptInput, ToolRendererBoundary, type TransientTabActions, UPDATE_REQUIRED_REASON, UiTraceRecord, UiTraceSink, UserEntry, UserImage, WebPluginRegistry, WorkspacesState, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, 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, installHostWebPlugins, installReadLost, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginMinorModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railSessionStatus, readHostHome, reduceSession, 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, 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, sessionMinorModes, 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, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
package/dist/core.mjs CHANGED
@@ -41,7 +41,7 @@ import { applyThreadTranscriptFrame, bindThreadReader, dropThreads, heldThreads,
41
41
  import { closeTransientTab, dropTransientTabs, findTransientTab, openTransientTab, setTransientTabSession, transientTabsStore, useTransientTabs } from "./web/stores/transientTabsStore.mjs";
42
42
  import { updateDialogDraft, useDialogDraft } from "./web/stores/dialogDraftStore.mjs";
43
43
  import { CLOUD_HUB_POLL_MS, createCloudHub } from "./web/lib/cloudHub.mjs";
44
- import { catalogEntries, destinationOf, externalId, filterEntries, presetSummaries } from "./web/lib/catalogEntries.mjs";
44
+ import { INSTALL_LOST_AFTER, catalogEntries, destinationOf, externalId, externalServerRows, filterEntries, installReadLost, presetSummaries } from "./web/lib/catalogEntries.mjs";
45
45
  import { homeActivity, homeTime } from "./web/lib/homeActivity.mjs";
46
46
  import { createWebMcpSimulator } from "./web/lib/webmcpSimulator.mjs";
47
- export { BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, HOST_SLOTS, ImageRefScope, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, SESSION_REFERENCE_SCHEME, TRIGGER_CHARS, ToolRendererBoundary, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, 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, 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, installHostWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginMinorModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railSessionStatus, readHostHome, reduceSession, 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, 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, sessionMinorModes, 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, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
47
+ export { BUILTIN_COMMANDS, CLOUD_HUB_POLL_MS, HOST_SLOTS, INSTALL_LOST_AFTER, ImageRefScope, LEGACY_WORKSPACE_ID, MAX_COMPLETION_ITEMS, SESSION_REFERENCE_SCHEME, TRIGGER_CHARS, ToolRendererBoundary, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, allPluginThemes, answerDialogConfirm, answerDialogValue, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionLifecycle, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, asWorkspace, beginSessionReplay, beginSessionTransfer, bindBundledNativeTemplates, bindHistoryReader, bindHostTransport, bindImageReader, bindSessionFileLinkModes, bindSessionProtocol, bindSessionWebWorkspace, bindThreadReader, bindTransport, 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, installHostWebPlugins, installReadLost, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, invokeServerMethod, isDesktopClient, isHexTheme, isHostId, isSupportedImageMimeType, legacyHomeAppFills, liveSessionOptions, loadImageRef, loadModelChoices, localHostId, markSocketClosed, markUpdateRequired, mentionableSessions, menuStore, mergeScopedPlugins, minorModes, nativeTemplateCatalog, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, openTransientTab, ownerLabel, ownersOf, paletteCommands, parseDashboardTileData, parseHostKey, parseSelection, pendingMenuFor, pendingSetupView, personaInitials, plannedSettingsWrites, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginMinorModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSessionContext, pluginSettingsPanels, pluginSettingsSections, pluginSlotProps, pluginThemes, pluginToolRenderer, pluginUserMessageActions, pluginsAtScope, prependHistory, presetSummaries, projectedGroups, promoteQueuedCommand, promoteQueuedMessage, promptCommand, qrMatrix, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railSessionStatus, readHostHome, reduceSession, 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, 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, sessionMinorModes, 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, slotFills, splitHostId, startPluginDefinitions, startWebPlugins, steerCommand, streamedSessions, submitCapture, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, textFromContent, threadStoreKey, toolMessageProps, toolPromptClaim, totalTokens, traceProfilerRender, traceStore, transientTabsStore, transportForHost, triggerTokenAt, unsubscribeThread, updateDialogDraft, useActiveSession, useActiveSessionMeta, useActivityGroups, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useImageRefs, useNoSessions, useRailEntries, useRailEntry, useRenderTrace, useTransientTabs, validateComposerCapture, waitForSession, watchHubThread, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore };
@@ -27,6 +27,8 @@ export interface PluginEntry {
27
27
  setup: PluginSetup;
28
28
  /** Presets in the current scope that include this plugin. */
29
29
  inPresets: readonly string[];
30
+ /** In presets, but not the scope's default one: a new session does not start with it. */
31
+ outsideDefault?: boolean;
30
32
  /** Codex and Claude Code plugins only: on everywhere, or the domains that load it. */
31
33
  domains?: 'everywhere' | readonly string[];
32
34
  }
@@ -64,13 +66,53 @@ export interface ExternalPluginsView {
64
66
  origin: {
65
67
  kind: string;
66
68
  marketplace?: string;
69
+ path?: string;
67
70
  };
68
71
  skills: readonly string[];
69
72
  mcpServers: readonly string[];
70
73
  hooks: number;
71
74
  domains: readonly string[];
72
75
  enabled: boolean;
76
+ /** Only a plugin uploaded on this computer can be deleted. */
77
+ deletable?: boolean;
73
78
  }[];
74
79
  }
80
+ /** One of a plugin's MCP servers, as po-mcp's workspace catalog reports it. */
81
+ export type ExternalServerStatus = 'connected' | 'needs-sign-in' | 'needs-key' | 'failed' | 'not-checked';
82
+ export interface ExternalServerRow {
83
+ name: string;
84
+ kind?: 'remote' | 'local';
85
+ /** The URL, or the command without its arguments. */
86
+ target?: string;
87
+ status: ExternalServerStatus;
88
+ /** Key names the config asks for that the Vault cannot answer yet. Never values. */
89
+ missingKeys: readonly string[];
90
+ error?: string;
91
+ /** A sign-in has started and is not finished yet. */
92
+ signingIn?: boolean;
93
+ /** While a sign-in waits: the page the person opens to finish it, once the server has offered one. */
94
+ signInUrl?: string;
95
+ }
96
+ /** The subset of po-mcp's `McpRepositoryCatalog` this page reads; po-mcp is not a dependency. */
97
+ export interface McpCatalogWire {
98
+ servers: readonly {
99
+ name: string;
100
+ state: string;
101
+ error?: string;
102
+ missingSecrets?: readonly string[];
103
+ management?: {
104
+ kind?: 'remote' | 'local';
105
+ target?: string;
106
+ };
107
+ }[];
108
+ }
109
+ /** The subset of po-mcp's `McpAuthorizationFlow` this page reads. */
110
+ export interface McpAuthorizationWire {
111
+ id: string;
112
+ serverName: string;
113
+ status: 'starting' | 'waiting' | 'completed' | 'failed' | 'cancelled' | 'expired';
114
+ authorizationUrl?: string;
115
+ error?: string;
116
+ }
75
117
  //#endregion
76
118
  //# sourceMappingURL=plugins.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.mts","names":[],"sources":["../../src/types/plugins.ts"],"mappings":";;;;;;;YAQY;YAEA;;YAGA;YAEA;iBAaK;EACf;EACA;;EAEA;EACA;EACA,MAAM;;EAEN;EACA;EACA,QAAQ;EACR,SAAS;;EAET;EACA,OAAO;;EAEP;;EAEA;;;iBAIe;EACf;;EAEA;;EAEA;;iBAGe;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;;YAIU,eAAe;;YAGf,mBAAmB;iBAEd;EACf;IAAW;IAAc;;EACzB;IACE;IACA;IACA;IACA;MAAU;MAAc;;IACxB;IACA;IACA;IACA;IACA"}
1
+ {"version":3,"file":"plugins.d.mts","names":[],"sources":["../../src/types/plugins.ts"],"mappings":";;;;;;;YAQY;YAEA;;YAGA;YAEA;iBAaK;EACf;EACA;;EAEA;EACA;EACA,MAAM;;EAEN;EACA;EACA,QAAQ;EACR,SAAS;;EAET;EACA,OAAO;;EAEP;;EAEA;;EAEA;;;iBAIe;EACf;;EAEA;;EAEA;;iBAGe;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;;YAIU,eAAe;;YAGf,mBAAmB;iBAEd;EACf;IAAW;IAAc;;EACzB;IACE;IACA;IACA;IACA;MAAU;MAAc;MAAsB;;IAC9C;IACA;IACA;IACA;IACA;;IAEA;;;;YAKQ;iBAEK;EACf;EACA;;EAEA;EACA,QAAQ;;EAER;EACA;;EAEA;;EAEA;;;iBAIe;EACf;IACE;IACA;IACA;IACA;IACA;MAAe;MAA2B;;;;;iBAK7B;EACf;EACA;EACA;EACA;EACA"}
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ATTACHED_TYPE, ATTACH_ERROR_TYPE, ATTACH_TYPE, BRIDGE_STATUS_TYPE, BridgeState, BridgeStatusFrame, REPLAY_TYPE, SessionFrame, bridgeStatus } from "./types/session.mjs";
2
2
  import { AGENT_MODEL_ENTRY_TYPE, API_SESSION_QUERY_PARAM, CONTEXT_ENTRY_TYPE, ContextGroupKind, ContextGroupProjection, ContextItemProjection, ContextItemSource, ContextProjection, DIALOG_ANSWERED_TYPE, DIRECTORIES_API_ROUTE, DIRECTORY_CHILDREN_API_ROUTE, DirectoryListing, HISTORY_PAGE_SIZE, HISTORY_PAGE_TYPE, HISTORY_REQUEST_TYPE, HUB_HELLO_TYPE, HUB_PROTOCOL_VERSION, HUB_ROLE, HistoryPageFrame, HistoryRequestFrame, HubHelloFrame, MINOR_MODE_ENTRY_TYPE, MinorModeActionProjection, MinorModeProjection, MinorModeRecordProjection, PO_FOLDERS_API_ROUTE, PROFILE_IDENTITY_ENTRY_TYPE, PiSessionHistoryItem, RESOURCE_CATALOG_ENTRY_TYPE, RemovedSessionItem, SESSIONS_API_ROUTE, SESSION_COMMAND_TYPE, SessionCommandFrame, SessionGitStatus, SessionNativeComposition, SessionPhase, SessionProfile, SessionSummary, SessionWebComposition, WORKSPACES_API_ROUTE, WORKSPACE_SANDBOX_STATES, WorkspaceSandboxState, WorkspaceSummary, hubHello, sessionCommand } from "./types/hub.mjs";
3
3
  import { PresetCreateRequest, PresetLayerDefinition, PresetLayerRequest, PresetOperation, PresetReference, PresetRenameRequest, PresetScope, PresetWriteRequest, RepositoryCatalogOption, RepositorySelectionChanges, RepositorySelectionValue, RepositorySelectionWriteRequest, RepositorySettingsView, SETTINGS_CONFIG_API_ROUTE, SETTINGS_IMAGES_API_ROUTE, SETTINGS_MODELS_API_ROUTE, SETTINGS_PRESETS_API_ROUTE, SETTINGS_REPOSITORIES_API_ROUTE, SETTINGS_REPOSITORY_API_ROUTE, SETTINGS_REPOSITORY_SELECTION_API_ROUTE, SETTINGS_VALUE_API_ROUTE, SettingsBatchWriteRequest, SettingsConfigView, SettingsErrorView, SettingsFileScope, SettingsImagesView, SettingsImagesWriteRequest, SettingsKeyScope, SettingsModel, SettingsOrigin, SettingsPreset, SettingsPresetLayer, SettingsPresetsView, SettingsPresetsWriteRequest, SettingsRepository, SettingsScope, SettingsValueView, SettingsWireConfigView, SettingsWireKeyScope, SettingsWireOrigin, SettingsWireScope, SettingsWireValueView, SettingsWriteRequest } from "./types/settings.mjs";
4
- import { CatalogLayer, ExternalPluginsView, InstallOperation, PluginEntry, PluginIconKey, PluginInstall, PluginScope, PluginSetup, PluginSource, PresetSummary } from "./types/plugins.mjs";
4
+ import { CatalogLayer, ExternalPluginsView, ExternalServerRow, ExternalServerStatus, InstallOperation, McpAuthorizationWire, McpCatalogWire, PluginEntry, PluginIconKey, PluginInstall, PluginScope, PluginSetup, PluginSource, PresetSummary } from "./types/plugins.mjs";
5
5
  import { AUTH_LOGINS_API_ROUTE, AUTH_PROVIDERS_API_ROUTE, AuthMethodType, AuthRuntime, AuthRuntimeProvider, LoginEvent, LoginFlowSnapshot, LoginFlowStatus, LoginInteraction, LoginPrompt, LoginPromptView, LoginSelectOption, ProviderAuthMethod, ProviderAuthSummary } from "./types/auth.mjs";
6
6
  import { DEV_PROXY_API_ROUTE, DEV_PROXY_PREFIX, DEV_PROXY_TARGETS_ROUTE, DevProxyStateView, DevProxyTarget } from "./types/devProxy.mjs";
7
7
  import { MAX_SESSION_FILE_BYTES, MEDIA_TYPES, MediaKind, MediaType, SESSION_FILE_EXPECTED_SHA256_HEADER, SESSION_FILE_ROUTE, SESSION_FILE_SHA256_HEADER, sessionFileUrl } from "./types/media.mjs";
@@ -9,4 +9,4 @@ import { BUNDLE_MINIMUM_REVISION_PARAM, BUNDLE_SIGNING_KEY_PARAM, BundlePairingT
9
9
  import { CreateSessionMcpClientInput, CreatedSessionMcpClient, SessionMcpClient, SessionMcpConfig, SessionMcpRouting, SessionMcpScope, SessionMcpSkill, SessionMcpTool } from "./types/sessionMcp.mjs";
10
10
  import { WebServer, WebServerOptions } from "./types/bridge.mjs";
11
11
  import { PoNotificationEntry, parsePoNotificationEntry } from "./types/notification.mjs";
12
- export { AGENT_MODEL_ENTRY_TYPE, API_SESSION_QUERY_PARAM, ATTACHED_TYPE, ATTACH_ERROR_TYPE, ATTACH_TYPE, AUTH_LOGINS_API_ROUTE, AUTH_PROVIDERS_API_ROUTE, AuthMethodType, AuthRuntime, AuthRuntimeProvider, BRIDGE_STATUS_TYPE, BUNDLE_MINIMUM_REVISION_PARAM, BUNDLE_SIGNING_KEY_PARAM, BridgeState, BridgeStatusFrame, BundlePairingTrust, CONTEXT_ENTRY_TYPE, COOKIE_CEILING_SECONDS, CatalogLayer, ContextGroupKind, ContextGroupProjection, ContextItemProjection, ContextItemSource, ContextProjection, CreateSessionMcpClientInput, CreatedSessionMcpClient, DEVICE_COOKIE, DEV_PROXY_API_ROUTE, DEV_PROXY_PREFIX, DEV_PROXY_TARGETS_ROUTE, DIALOG_ANSWERED_TYPE, DIRECTORIES_API_ROUTE, DIRECTORY_CHILDREN_API_ROUTE, DevProxyStateView, DevProxyTarget, DirectoryListing, ExternalPluginsView, HISTORY_PAGE_SIZE, HISTORY_PAGE_TYPE, HISTORY_REQUEST_TYPE, HUB_HELLO_TYPE, HUB_PROTOCOL_VERSION, HUB_ROLE, HistoryPageFrame, HistoryRequestFrame, HubHelloFrame, InstallOperation, LoginEvent, LoginFlowSnapshot, LoginFlowStatus, LoginInteraction, LoginPrompt, LoginPromptView, LoginSelectOption, MAX_SESSION_FILE_BYTES, MEDIA_TYPES, MINOR_MODE_ENTRY_TYPE, MediaKind, MediaType, MinorModeActionProjection, MinorModeProjection, MinorModeRecordProjection, NATIVE_PAIRING_LINK_PREFIX, PAIRING_CLAIM_ROUTE, PAIRING_CODE_TTL_MS, PAIRING_PAGE_ROUTE, PAIRING_REQUEST_TTL_MS, PAIRING_STATUS_QUERY, PAIRING_STATUS_ROUTE, PASSKEY_AUTH_BEGIN_ROUTE, PASSKEY_AUTH_FINISH_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, PO_FOLDERS_API_ROUTE, PROFILE_IDENTITY_ENTRY_TYPE, PROTOCOL_SOCKET_ROUTE, PairedDeviceView, PairingRequestView, PairingStatus, PiSessionHistoryItem, PluginEntry, PluginIconKey, PluginInstall, PluginScope, PluginSetup, PluginSource, PoNotificationEntry, PresetCreateRequest, PresetLayerDefinition, PresetLayerRequest, PresetOperation, PresetReference, PresetRenameRequest, PresetScope, PresetSummary, PresetWriteRequest, ProviderAuthMethod, ProviderAuthSummary, REMOTE_API_ROUTE, REMOTE_CHANNEL_ROUTE, REMOTE_HTTP_ROUTE, REMOTE_PAIRING_REQUEST_TYPE, REMOTE_PUSH_KEY_ROUTE, REMOTE_PUSH_ROUTE, REMOTE_STATE_TYPE, REPLAY_TYPE, RESOURCE_CATALOG_ENTRY_TYPE, RemoteAccessSettings, RemoteAccessStateView, RemoteAccessStatus, RemoteChannelScope, RemovedSessionItem, RepositoryCatalogOption, RepositorySelectionChanges, RepositorySelectionValue, RepositorySelectionWriteRequest, RepositorySettingsView, SESSIONS_API_ROUTE, SESSION_COMMAND_TYPE, SESSION_FILE_EXPECTED_SHA256_HEADER, SESSION_FILE_ROUTE, SESSION_FILE_SHA256_HEADER, SETTINGS_CONFIG_API_ROUTE, SETTINGS_IMAGES_API_ROUTE, SETTINGS_MODELS_API_ROUTE, SETTINGS_PRESETS_API_ROUTE, SETTINGS_REPOSITORIES_API_ROUTE, SETTINGS_REPOSITORY_API_ROUTE, SETTINGS_REPOSITORY_SELECTION_API_ROUTE, SETTINGS_VALUE_API_ROUTE, STEP_UP_HEADER, SessionCommandFrame, SessionFrame, SessionGitStatus, SessionMcpClient, SessionMcpConfig, SessionMcpRouting, SessionMcpScope, SessionMcpSkill, SessionMcpTool, SessionNativeComposition, SessionPhase, SessionProfile, SessionSummary, SessionWebComposition, SettingsBatchWriteRequest, SettingsConfigView, SettingsErrorView, SettingsFileScope, SettingsImagesView, SettingsImagesWriteRequest, SettingsKeyScope, SettingsModel, SettingsOrigin, SettingsPreset, SettingsPresetLayer, SettingsPresetsView, SettingsPresetsWriteRequest, SettingsRepository, SettingsScope, SettingsValueView, SettingsWireConfigView, SettingsWireKeyScope, SettingsWireOrigin, SettingsWireScope, SettingsWireValueView, SettingsWriteRequest, TRUSTED_DEVICES_ROUTE, TrustedDevicePlatform, TrustedDeviceView, TunnelConfig, TunnelFailure, TunnelKind, TunnelLauncher, TunnelStartInput, TunnelStartResult, WEB_DEV_SERVER_PORT, WORKSPACES_API_ROUTE, WORKSPACE_SANDBOX_STATES, WebServer, WebServerOptions, WorkspaceSandboxState, WorkspaceSummary, bridgeStatus, hubHello, parsePoNotificationEntry, sessionCommand, sessionFileUrl };
12
+ export { AGENT_MODEL_ENTRY_TYPE, API_SESSION_QUERY_PARAM, ATTACHED_TYPE, ATTACH_ERROR_TYPE, ATTACH_TYPE, AUTH_LOGINS_API_ROUTE, AUTH_PROVIDERS_API_ROUTE, AuthMethodType, AuthRuntime, AuthRuntimeProvider, BRIDGE_STATUS_TYPE, BUNDLE_MINIMUM_REVISION_PARAM, BUNDLE_SIGNING_KEY_PARAM, BridgeState, BridgeStatusFrame, BundlePairingTrust, CONTEXT_ENTRY_TYPE, COOKIE_CEILING_SECONDS, CatalogLayer, ContextGroupKind, ContextGroupProjection, ContextItemProjection, ContextItemSource, ContextProjection, CreateSessionMcpClientInput, CreatedSessionMcpClient, DEVICE_COOKIE, DEV_PROXY_API_ROUTE, DEV_PROXY_PREFIX, DEV_PROXY_TARGETS_ROUTE, DIALOG_ANSWERED_TYPE, DIRECTORIES_API_ROUTE, DIRECTORY_CHILDREN_API_ROUTE, DevProxyStateView, DevProxyTarget, DirectoryListing, ExternalPluginsView, ExternalServerRow, ExternalServerStatus, HISTORY_PAGE_SIZE, HISTORY_PAGE_TYPE, HISTORY_REQUEST_TYPE, HUB_HELLO_TYPE, HUB_PROTOCOL_VERSION, HUB_ROLE, HistoryPageFrame, HistoryRequestFrame, HubHelloFrame, InstallOperation, LoginEvent, LoginFlowSnapshot, LoginFlowStatus, LoginInteraction, LoginPrompt, LoginPromptView, LoginSelectOption, MAX_SESSION_FILE_BYTES, MEDIA_TYPES, MINOR_MODE_ENTRY_TYPE, McpAuthorizationWire, McpCatalogWire, MediaKind, MediaType, MinorModeActionProjection, MinorModeProjection, MinorModeRecordProjection, NATIVE_PAIRING_LINK_PREFIX, PAIRING_CLAIM_ROUTE, PAIRING_CODE_TTL_MS, PAIRING_PAGE_ROUTE, PAIRING_REQUEST_TTL_MS, PAIRING_STATUS_QUERY, PAIRING_STATUS_ROUTE, PASSKEY_AUTH_BEGIN_ROUTE, PASSKEY_AUTH_FINISH_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, PO_FOLDERS_API_ROUTE, PROFILE_IDENTITY_ENTRY_TYPE, PROTOCOL_SOCKET_ROUTE, PairedDeviceView, PairingRequestView, PairingStatus, PiSessionHistoryItem, PluginEntry, PluginIconKey, PluginInstall, PluginScope, PluginSetup, PluginSource, PoNotificationEntry, PresetCreateRequest, PresetLayerDefinition, PresetLayerRequest, PresetOperation, PresetReference, PresetRenameRequest, PresetScope, PresetSummary, PresetWriteRequest, ProviderAuthMethod, ProviderAuthSummary, REMOTE_API_ROUTE, REMOTE_CHANNEL_ROUTE, REMOTE_HTTP_ROUTE, REMOTE_PAIRING_REQUEST_TYPE, REMOTE_PUSH_KEY_ROUTE, REMOTE_PUSH_ROUTE, REMOTE_STATE_TYPE, REPLAY_TYPE, RESOURCE_CATALOG_ENTRY_TYPE, RemoteAccessSettings, RemoteAccessStateView, RemoteAccessStatus, RemoteChannelScope, RemovedSessionItem, RepositoryCatalogOption, RepositorySelectionChanges, RepositorySelectionValue, RepositorySelectionWriteRequest, RepositorySettingsView, SESSIONS_API_ROUTE, SESSION_COMMAND_TYPE, SESSION_FILE_EXPECTED_SHA256_HEADER, SESSION_FILE_ROUTE, SESSION_FILE_SHA256_HEADER, SETTINGS_CONFIG_API_ROUTE, SETTINGS_IMAGES_API_ROUTE, SETTINGS_MODELS_API_ROUTE, SETTINGS_PRESETS_API_ROUTE, SETTINGS_REPOSITORIES_API_ROUTE, SETTINGS_REPOSITORY_API_ROUTE, SETTINGS_REPOSITORY_SELECTION_API_ROUTE, SETTINGS_VALUE_API_ROUTE, STEP_UP_HEADER, SessionCommandFrame, SessionFrame, SessionGitStatus, SessionMcpClient, SessionMcpConfig, SessionMcpRouting, SessionMcpScope, SessionMcpSkill, SessionMcpTool, SessionNativeComposition, SessionPhase, SessionProfile, SessionSummary, SessionWebComposition, SettingsBatchWriteRequest, SettingsConfigView, SettingsErrorView, SettingsFileScope, SettingsImagesView, SettingsImagesWriteRequest, SettingsKeyScope, SettingsModel, SettingsOrigin, SettingsPreset, SettingsPresetLayer, SettingsPresetsView, SettingsPresetsWriteRequest, SettingsRepository, SettingsScope, SettingsValueView, SettingsWireConfigView, SettingsWireKeyScope, SettingsWireOrigin, SettingsWireScope, SettingsWireValueView, SettingsWriteRequest, TRUSTED_DEVICES_ROUTE, TrustedDevicePlatform, TrustedDeviceView, TunnelConfig, TunnelFailure, TunnelKind, TunnelLauncher, TunnelStartInput, TunnelStartResult, WEB_DEV_SERVER_PORT, WORKSPACES_API_ROUTE, WORKSPACE_SANDBOX_STATES, WebServer, WebServerOptions, WorkspaceSandboxState, WorkspaceSummary, bridgeStatus, hubHello, parsePoNotificationEntry, sessionCommand, sessionFileUrl };
@@ -0,0 +1,215 @@
1
+ const require_settingsApi = require("../../lib/settingsApi.cjs");
2
+ const require_pluginMarketplaceApi = require("../../lib/pluginMarketplaceApi.cjs");
3
+ const require_catalogEntries = require("../../lib/catalogEntries.cjs");
4
+ const require_ExternalPluginView = require("./ExternalPluginView.cjs");
5
+ let react = require("react");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ //#region src/web/features/plugins/ExternalPluginPage.tsx
8
+ const SIGN_IN_POLL_MS = 1e3;
9
+ const SIGN_IN_ENDED = /* @__PURE__ */ new Set([
10
+ "failed",
11
+ "cancelled",
12
+ "expired"
13
+ ]);
14
+ /**
15
+ * One Codex or Claude Code plugin. Domains are po-domain's, written to the scope's own file; the
16
+ * MCP servers are po-mcp's, checked in one workspace because a server connects from one. Their
17
+ * sign-ins and keys are kept per plugin, so whichever workspace checks them, every one shares them.
18
+ */
19
+ function ExternalPluginPage({ entry, view, scope, workspace, offline, onBack, onView }) {
20
+ const plugin = view.plugins.find((candidate) => candidate.name === entry.name);
21
+ const domainWorkspace = scope.kind === "workspace" ? workspace?.id : void 0;
22
+ const [busy, setBusy] = (0, react.useState)(false);
23
+ const [error, setError] = (0, react.useState)();
24
+ const [found, setFound] = (0, react.useState)();
25
+ const target = workspace ?? found;
26
+ (0, react.useEffect)(() => {
27
+ if (workspace !== void 0) return void 0;
28
+ let current = true;
29
+ require_settingsApi.listSettingsRepositories().then((repositories) => {
30
+ const pick = repositories.find((repository) => repository.active) ?? repositories[0];
31
+ if (current) setFound(pick === void 0 ? null : {
32
+ id: pick.id,
33
+ name: pick.name
34
+ });
35
+ });
36
+ return () => {
37
+ current = false;
38
+ };
39
+ }, [workspace]);
40
+ const [catalog, setCatalog] = (0, react.useState)();
41
+ const [mcpAbsent, setMcpAbsent] = (0, react.useState)(false);
42
+ const [serverBusy, setServerBusy] = (0, react.useState)();
43
+ const [serverError, setServerError] = (0, react.useState)();
44
+ const [flows, setFlows] = (0, react.useState)({});
45
+ const [keyFor, setKeyFor] = (0, react.useState)();
46
+ const [keySaving, setKeySaving] = (0, react.useState)(false);
47
+ const [keyError, setKeyError] = (0, react.useState)();
48
+ const targetId = target?.id;
49
+ (0, react.useEffect)(() => {
50
+ if (targetId === void 0) return void 0;
51
+ let current = true;
52
+ require_pluginMarketplaceApi.readMcpCatalog(targetId).then((read) => {
53
+ if (!current) return;
54
+ if (!read.ok) setServerError(read.error);
55
+ else if (read.value === void 0) setMcpAbsent(true);
56
+ else setCatalog(read.value);
57
+ });
58
+ return () => {
59
+ current = false;
60
+ };
61
+ }, [targetId]);
62
+ const check = (0, react.useCallback)(async () => {
63
+ if (targetId === void 0) return;
64
+ setServerBusy("");
65
+ setServerError(void 0);
66
+ const read = await require_pluginMarketplaceApi.discoverMcp(targetId);
67
+ setServerBusy(void 0);
68
+ if (read.ok) setCatalog(read.value);
69
+ else setServerError(read.error);
70
+ }, [targetId]);
71
+ const waiting = Object.entries(flows).map(([server, flow]) => `${server}=${flow.id}`).join(",");
72
+ (0, react.useEffect)(() => {
73
+ if (waiting === "" || targetId === void 0) return void 0;
74
+ const timer = setInterval(() => {
75
+ for (const pair of waiting.split(",")) {
76
+ const [server = "", id = ""] = pair.split("=");
77
+ require_pluginMarketplaceApi.readMcpSignIn(targetId, id).then((read) => {
78
+ if (read.ok && read.value.status !== "completed" && !SIGN_IN_ENDED.has(read.value.status)) {
79
+ const url = read.value.authorizationUrl;
80
+ if (url !== void 0) setFlows((current) => current[server] ? {
81
+ ...current,
82
+ [server]: {
83
+ id,
84
+ url
85
+ }
86
+ } : current);
87
+ return;
88
+ }
89
+ setFlows(({ [server]: _done, ...rest }) => rest);
90
+ if (!read.ok) setServerError(read.error);
91
+ else if (read.value.status === "completed") check();
92
+ else setServerError(read.value.error ?? `The sign-in for ${server} ${read.value.status === "failed" ? "failed" : "ended"}.`);
93
+ });
94
+ }
95
+ }, SIGN_IN_POLL_MS);
96
+ return () => clearInterval(timer);
97
+ }, [
98
+ waiting,
99
+ targetId,
100
+ check
101
+ ]);
102
+ if (plugin === void 0) return null;
103
+ /** po-domain writes in order; each answers with the whole view, and the first refusal stops the rest. */
104
+ const change = async (steps) => {
105
+ setBusy(true);
106
+ setError(void 0);
107
+ for (const [route, body] of steps) {
108
+ const result = await require_pluginMarketplaceApi.changeExternalPlugin(route, body, domainWorkspace);
109
+ if (!result.ok) {
110
+ setError(result.error);
111
+ break;
112
+ }
113
+ onView(result.value);
114
+ }
115
+ setBusy(false);
116
+ };
117
+ const name = plugin.name;
118
+ const turnOn = ["toggle", {
119
+ plugin: name,
120
+ enabled: true
121
+ }];
122
+ const signIn = async (server) => {
123
+ if (targetId === void 0) return;
124
+ setServerBusy(server);
125
+ setServerError(void 0);
126
+ const started = await require_pluginMarketplaceApi.startMcpSignIn(targetId, server);
127
+ setServerBusy(void 0);
128
+ if (!started.ok) setServerError(started.error);
129
+ else if (started.value.status === "completed") check();
130
+ else if (SIGN_IN_ENDED.has(started.value.status)) setServerError(started.value.error ?? `The sign-in for ${server} didn't start.`);
131
+ else setFlows((current) => ({
132
+ ...current,
133
+ [server]: {
134
+ id: started.value.id,
135
+ ...started.value.authorizationUrl === void 0 ? {} : { url: started.value.authorizationUrl }
136
+ }
137
+ }));
138
+ };
139
+ const saveKeys = async (values) => {
140
+ if (targetId === void 0 || keyFor === void 0) return;
141
+ setKeySaving(true);
142
+ setKeyError(void 0);
143
+ for (const [key, value] of Object.entries(values)) {
144
+ const saved = await require_pluginMarketplaceApi.saveMcpKey(targetId, keyFor, key, value);
145
+ if (!saved.ok) {
146
+ setKeyError(saved.error);
147
+ setKeySaving(false);
148
+ return;
149
+ }
150
+ }
151
+ setKeySaving(false);
152
+ setKeyFor(void 0);
153
+ await check();
154
+ };
155
+ const rows = require_catalogEntries.externalServerRows(plugin.mcpServers, catalog).map((row) => {
156
+ const flow = flows[row.name];
157
+ return flow === void 0 ? row : {
158
+ ...row,
159
+ signingIn: true,
160
+ ...flow.url === void 0 ? {} : { signInUrl: flow.url }
161
+ };
162
+ });
163
+ const serversNote = serverError ?? (mcpAbsent ? "MCP servers are not part of Po on this computer." : target === void 0 ? "Finding a workspace to check them in." : target === null ? "Open a workspace to check them: Po connects servers from one." : `Check connects them from ${target.name}.`);
164
+ const keyRow = rows.find((row) => row.name === keyFor);
165
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ExternalPluginView.ExternalPluginView, {
166
+ plugin: entry,
167
+ ...plugin.version === void 0 ? {} : { version: plugin.version },
168
+ uploaded: plugin.origin.kind === "uploaded",
169
+ ...plugin.origin.kind === "folder" && plugin.origin.path ? { savedIn: plugin.origin.path } : {},
170
+ skills: plugin.skills,
171
+ hooks: plugin.hooks,
172
+ domains: view.domains.map((domain) => domain.name),
173
+ inDomains: plugin.domains,
174
+ enabled: plugin.enabled,
175
+ scopeNote: scope.kind === "host" ? `Editing ${scope.label}.${workspace === void 0 ? "" : ` ${workspace.name} can keep its own.`}` : `Editing ${scope.label} only; ${scope.host} keeps its own list.`,
176
+ servers: rows,
177
+ serversNote,
178
+ ...serverBusy === void 0 ? {} : { serverBusy },
179
+ ...error === void 0 ? {} : { error },
180
+ busy,
181
+ offline,
182
+ canCheck: targetId !== void 0 && !mcpAbsent,
183
+ ...keyRow === void 0 ? {} : { keyFor: keyRow },
184
+ keySaving,
185
+ ...keyError === void 0 ? {} : { keyError },
186
+ onBack,
187
+ onToggleDomain: (domain, on) => void change(on ? [["addToDomain", {
188
+ domain,
189
+ plugins: [name]
190
+ }], ...plugin.enabled ? [] : [turnOn]] : [["removeFromDomain", {
191
+ domain,
192
+ plugin: name
193
+ }]]),
194
+ onEverywhere: () => void change([...plugin.domains.map((domain) => ["removeFromDomain", {
195
+ domain,
196
+ plugin: name
197
+ }]), turnOn]),
198
+ onTurnOff: () => void change([["toggle", {
199
+ plugin: name,
200
+ enabled: false
201
+ }]]),
202
+ onCheckServers: () => void check(),
203
+ onSignIn: (server) => void signIn(server),
204
+ onAddKey: (server) => {
205
+ setKeyError(void 0);
206
+ setKeyFor(server);
207
+ },
208
+ onSaveKeys: (values) => void saveKeys(values),
209
+ onCloseKey: () => setKeyFor(void 0)
210
+ });
211
+ }
212
+ //#endregion
213
+ exports.ExternalPluginPage = ExternalPluginPage;
214
+
215
+ //# sourceMappingURL=ExternalPluginPage.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalPluginPage.cjs","names":["useState","listSettingsRepositories","readMcpCatalog","useCallback","discoverMcp","readMcpSignIn","changeExternalPlugin","startMcpSignIn","saveMcpKey","externalServerRows","ExternalPluginView"],"sources":["../../../../src/web/features/plugins/ExternalPluginPage.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport type { ExternalPluginsView, McpCatalogWire, PluginEntry, PluginScope } from '../../../types/plugins';\nimport { externalServerRows } from '../../lib/catalogEntries';\nimport {\n changeExternalPlugin,\n discoverMcp,\n readMcpCatalog,\n readMcpSignIn,\n saveMcpKey,\n startMcpSignIn,\n} from '../../lib/pluginMarketplaceApi';\nimport { listSettingsRepositories } from '../../lib/settingsApi';\nimport { ExternalPluginView } from './ExternalPluginView';\n\nconst SIGN_IN_POLL_MS = 1000;\nconst SIGN_IN_ENDED = new Set(['failed', 'cancelled', 'expired']);\n\ntype Target = { id: string; name: string };\ntype Step = readonly [Parameters<typeof changeExternalPlugin>[0], Record<string, unknown>];\n\n/**\n * One Codex or Claude Code plugin. Domains are po-domain's, written to the scope's own file; the\n * MCP servers are po-mcp's, checked in one workspace because a server connects from one. Their\n * sign-ins and keys are kept per plugin, so whichever workspace checks them, every one shares them.\n */\nexport function ExternalPluginPage({\n entry,\n view,\n scope,\n workspace,\n offline,\n onBack,\n onView,\n}: {\n entry: PluginEntry;\n view: ExternalPluginsView;\n scope: PluginScope;\n /** The workspace the Plugins page was opened for, if any. */\n workspace?: Target;\n offline: boolean;\n onBack: () => void;\n onView: (view: ExternalPluginsView) => void;\n}) {\n const plugin = view.plugins.find((candidate) => candidate.name === entry.name);\n const domainWorkspace = scope.kind === 'workspace' ? workspace?.id : undefined;\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string>();\n\n // Servers connect from a workspace: the one the page is for, else one that is open, else the first.\n const [found, setFound] = useState<Target | null>();\n const target = workspace ?? found;\n useEffect(() => {\n if (workspace !== undefined) return undefined;\n let current = true;\n void listSettingsRepositories().then((repositories) => {\n const pick = repositories.find((repository) => repository.active) ?? repositories[0];\n if (current) setFound(pick === undefined ? null : { id: pick.id, name: pick.name });\n });\n return () => {\n current = false;\n };\n }, [workspace]);\n\n const [catalog, setCatalog] = useState<McpCatalogWire>();\n const [mcpAbsent, setMcpAbsent] = useState(false);\n const [serverBusy, setServerBusy] = useState<string>();\n const [serverError, setServerError] = useState<string>();\n // A started sign-in, by server; its page arrives a moment after the flow starts.\n const [flows, setFlows] = useState<Record<string, { id: string; url?: string }>>({});\n const [keyFor, setKeyFor] = useState<string>();\n const [keySaving, setKeySaving] = useState(false);\n const [keyError, setKeyError] = useState<string>();\n\n const targetId = target?.id;\n useEffect(() => {\n if (targetId === undefined) return undefined;\n let current = true;\n void readMcpCatalog(targetId).then((read) => {\n if (!current) return;\n if (!read.ok) setServerError(read.error);\n else if (read.value === undefined) setMcpAbsent(true);\n else setCatalog(read.value);\n });\n return () => {\n current = false;\n };\n }, [targetId]);\n\n const check = useCallback(async () => {\n if (targetId === undefined) return;\n setServerBusy('');\n setServerError(undefined);\n const read = await discoverMcp(targetId);\n setServerBusy(undefined);\n if (read.ok) setCatalog(read.value);\n else setServerError(read.error);\n }, [targetId]);\n\n // An open sign-in is read until it ends; finishing it checks the servers again.\n const waiting = Object.entries(flows)\n .map(([server, flow]) => `${server}=${flow.id}`)\n .join(',');\n useEffect(() => {\n if (waiting === '' || targetId === undefined) return undefined;\n const timer = setInterval(() => {\n for (const pair of waiting.split(',')) {\n const [server = '', id = ''] = pair.split('=');\n void readMcpSignIn(targetId, id).then((read) => {\n if (read.ok && read.value.status !== 'completed' && !SIGN_IN_ENDED.has(read.value.status)) {\n const url = read.value.authorizationUrl;\n if (url !== undefined)\n setFlows((current) => (current[server] ? { ...current, [server]: { id, url } } : current));\n return;\n }\n setFlows(({ [server]: _done, ...rest }) => rest);\n if (!read.ok) setServerError(read.error);\n else if (read.value.status === 'completed') void check();\n else\n setServerError(\n read.value.error ?? `The sign-in for ${server} ${read.value.status === 'failed' ? 'failed' : 'ended'}.`,\n );\n });\n }\n }, SIGN_IN_POLL_MS);\n return () => clearInterval(timer);\n }, [waiting, targetId, check]);\n\n if (plugin === undefined) return null;\n\n /** po-domain writes in order; each answers with the whole view, and the first refusal stops the rest. */\n const change = async (steps: readonly Step[]) => {\n setBusy(true);\n setError(undefined);\n for (const [route, body] of steps) {\n const result = await changeExternalPlugin(route, body, domainWorkspace);\n if (!result.ok) {\n setError(result.error);\n break;\n }\n onView(result.value);\n }\n setBusy(false);\n };\n const name = plugin.name;\n const turnOn: Step = ['toggle', { plugin: name, enabled: true }];\n\n const signIn = async (server: string) => {\n if (targetId === undefined) return;\n setServerBusy(server);\n setServerError(undefined);\n const started = await startMcpSignIn(targetId, server);\n setServerBusy(undefined);\n if (!started.ok) setServerError(started.error);\n else if (started.value.status === 'completed') void check();\n else if (SIGN_IN_ENDED.has(started.value.status))\n setServerError(started.value.error ?? `The sign-in for ${server} didn't start.`);\n else\n setFlows((current) => ({\n ...current,\n [server]: {\n id: started.value.id,\n ...(started.value.authorizationUrl === undefined ? {} : { url: started.value.authorizationUrl }),\n },\n }));\n };\n\n const saveKeys = async (values: Readonly<Record<string, string>>) => {\n if (targetId === undefined || keyFor === undefined) return;\n setKeySaving(true);\n setKeyError(undefined);\n for (const [key, value] of Object.entries(values)) {\n const saved = await saveMcpKey(targetId, keyFor, key, value);\n if (!saved.ok) {\n setKeyError(saved.error);\n setKeySaving(false);\n return;\n }\n }\n setKeySaving(false);\n setKeyFor(undefined);\n await check();\n };\n\n const rows = externalServerRows(plugin.mcpServers, catalog).map((row) => {\n const flow = flows[row.name];\n return flow === undefined\n ? row\n : { ...row, signingIn: true, ...(flow.url === undefined ? {} : { signInUrl: flow.url }) };\n });\n const serversNote =\n serverError ??\n (mcpAbsent\n ? 'MCP servers are not part of Po on this computer.'\n : target === undefined\n ? 'Finding a workspace to check them in.'\n : target === null\n ? 'Open a workspace to check them: Po connects servers from one.'\n : `Check connects them from ${target.name}.`);\n const keyRow = rows.find((row) => row.name === keyFor);\n\n return (\n <ExternalPluginView\n plugin={entry}\n {...(plugin.version === undefined ? {} : { version: plugin.version })}\n uploaded={plugin.origin.kind === 'uploaded'}\n {...(plugin.origin.kind === 'folder' && plugin.origin.path ? { savedIn: plugin.origin.path } : {})}\n skills={plugin.skills}\n hooks={plugin.hooks}\n domains={view.domains.map((domain) => domain.name)}\n inDomains={plugin.domains}\n enabled={plugin.enabled}\n scopeNote={\n scope.kind === 'host'\n ? `Editing ${scope.label}.${workspace === undefined ? '' : ` ${workspace.name} can keep its own.`}`\n : `Editing ${scope.label} only; ${scope.host} keeps its own list.`\n }\n servers={rows}\n serversNote={serversNote}\n {...(serverBusy === undefined ? {} : { serverBusy })}\n {...(error === undefined ? {} : { error })}\n busy={busy}\n offline={offline}\n canCheck={targetId !== undefined && !mcpAbsent}\n {...(keyRow === undefined ? {} : { keyFor: keyRow })}\n keySaving={keySaving}\n {...(keyError === undefined ? {} : { keyError })}\n onBack={onBack}\n onToggleDomain={(domain, on) =>\n void change(\n on\n ? [['addToDomain', { domain, plugins: [name] }], ...(plugin.enabled ? [] : [turnOn])]\n : [['removeFromDomain', { domain, plugin: name }]],\n )\n }\n onEverywhere={() =>\n void change([...plugin.domains.map((domain): Step => ['removeFromDomain', { domain, plugin: name }]), turnOn])\n }\n onTurnOff={() => void change([['toggle', { plugin: name, enabled: false }]])}\n onCheckServers={() => void check()}\n onSignIn={(server) => void signIn(server)}\n onAddKey={(server) => {\n setKeyError(undefined);\n setKeyFor(server);\n }}\n onSaveKeys={(values) => void saveKeys(values)}\n onCloseKey={() => setKeyFor(undefined)}\n />\n );\n}\n"],"mappings":";;;;;;;AAeA,MAAM,kBAAkB;AACxB,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAU;CAAa;AAAS,CAAC;;;;;;AAUhE,SAAgB,mBAAmB,EACjC,OACA,MACA,OACA,WACA,SACA,QACA,UAUC;CACD,MAAM,SAAS,KAAK,QAAQ,MAAM,cAAc,UAAU,SAAS,MAAM,IAAI;CAC7E,MAAM,kBAAkB,MAAM,SAAS,cAAc,WAAW,KAAK,KAAA;CACrE,MAAM,CAAC,MAAM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