@agimon-ai/po-web-dashboard 0.0.0-alpha.200 → 0.0.0-alpha.201
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/index.cjs +3 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/web/features/plugins/OrgLibrary.cjs +1 -1
- package/dist/web/features/plugins/OrgLibrary.cjs.map +1 -1
- package/dist/web/features/plugins/OrgLibrary.mjs +2 -2
- package/dist/web/features/plugins/OrgLibrary.mjs.map +1 -1
- package/dist/web/lib/authApi.cjs +2 -0
- package/dist/web/lib/authApi.cjs.map +1 -1
- package/dist/web/lib/authApi.d.mts.map +1 -1
- package/dist/web/lib/authApi.mjs +2 -0
- package/dist/web/lib/authApi.mjs.map +1 -1
- package/dist/web/lib/pluginRegistry.cjs +2 -2
- package/dist/web/lib/pluginRegistry.cjs.map +1 -1
- package/dist/web/lib/pluginRegistry.d.mts.map +1 -1
- package/dist/web/lib/pluginRegistry.mjs +2 -2
- package/dist/web/lib/pluginRegistry.mjs.map +1 -1
- package/dist/web/lib/selfHostShell.cjs +10 -1
- package/dist/web/lib/selfHostShell.cjs.map +1 -1
- package/dist/web/lib/selfHostShell.d.mts +13 -0
- package/dist/web/lib/selfHostShell.d.mts.map +1 -1
- package/dist/web/lib/selfHostShell.mjs +10 -2
- package/dist/web/lib/selfHostShell.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_selfHostShell = require("./web/lib/selfHostShell.cjs");
|
|
2
3
|
const require_authApi = require("./web/lib/authApi.cjs");
|
|
3
4
|
const require_browserNotifications = require("./web/lib/browserNotifications.cjs");
|
|
4
5
|
const require_sealedSession = require("./web/lib/sealedSession.cjs");
|
|
@@ -10,7 +11,6 @@ const require_hostIdentity = require("./web/lib/hostIdentity.cjs");
|
|
|
10
11
|
const require_homeApps = require("./web/lib/homeApps.cjs");
|
|
11
12
|
const require_leaderTree = require("./web/lib/leaderTree.cjs");
|
|
12
13
|
const require_pluginScopes = require("./web/lib/pluginScopes.cjs");
|
|
13
|
-
const require_selfHostShell = require("./web/lib/selfHostShell.cjs");
|
|
14
14
|
const require_templateCatalog = require("./web/lib/templateCatalog.cjs");
|
|
15
15
|
const require_uiTrace = require("./web/lib/uiTrace.cjs");
|
|
16
16
|
const require_pluginRegistry = require("./web/lib/pluginRegistry.cjs");
|
|
@@ -333,6 +333,7 @@ exports.invokeServerMethod = require_transport.invokeServerMethod;
|
|
|
333
333
|
exports.isConnectedModel = require_authApi.isConnectedModel;
|
|
334
334
|
exports.isDesktopClient = require_pluginRegistry.isDesktopClient;
|
|
335
335
|
exports.isHostId = require_hostIdentity.isHostId;
|
|
336
|
+
exports.isSelfHostShell = require_selfHostShell.isSelfHostShell;
|
|
336
337
|
exports.isSupportedImageMimeType = require_sessionModel.isSupportedImageMimeType;
|
|
337
338
|
exports.leaderConflicts = require_leaderTree.leaderConflicts;
|
|
338
339
|
exports.leaderGroup = require_leaderTree.leaderGroup;
|
|
@@ -591,6 +592,7 @@ exports.setSessionNameCommand = require_commands.setSessionNameCommand;
|
|
|
591
592
|
exports.setSessionRole = require_hubApi.setSessionRole;
|
|
592
593
|
exports.setSessionStreamed = require_sessionStore.setSessionStreamed;
|
|
593
594
|
exports.setSettingsDraft = require_settingsDraftStore.setSettingsDraft;
|
|
595
|
+
exports.setShellBridge = require_selfHostShell.setShellBridge;
|
|
594
596
|
exports.setThinkingLevelCommand = require_commands.setThinkingLevelCommand;
|
|
595
597
|
exports.setTransientTabSession = require_transientTabsStore.setTransientTabSession;
|
|
596
598
|
exports.setUiTraceSink = require_uiTrace.setUiTraceSink;
|
package/dist/index.d.mts
CHANGED
|
@@ -41,7 +41,7 @@ import { GatewaySettings, LoginFlowResult, LogoutResult, ProvidersResult, answer
|
|
|
41
41
|
import { BrowserNotificationDeliveryStatus, BrowserNotificationPermissionStatus, browserNotificationPermission, deliverBrowserNotification, requestBrowserNotificationPermission } from "./web/lib/browserNotifications.mjs";
|
|
42
42
|
import { FetchItemDetailResult, fetchContextItemDetail } from "./web/lib/contextDetailApi.mjs";
|
|
43
43
|
import { DashboardRoute, PLUGINS_PAGE_ID, PLUGINS_ROUTE, TEAM_PAGE_ID, TEAM_ROUTE, dashboardRouteFrom, useDashboardRoute } from "./web/lib/dashboardRoute.mjs";
|
|
44
|
-
import { teamPageUrl } from "./web/lib/selfHostShell.mjs";
|
|
44
|
+
import { isSelfHostShell, setShellBridge, teamPageUrl } from "./web/lib/selfHostShell.mjs";
|
|
45
45
|
import { bindDashboardTranscriptWatcher, watchDashboardTranscript } from "./web/lib/dashboardTranscript.mjs";
|
|
46
46
|
import { FileMention, mediaKindFor, parseFileMentions } from "./web/lib/fileMentions.mjs";
|
|
47
47
|
import { AddCoordinatorResult, CreateProfileInput, CreateSessionResult, EnsureHomeCoordinatorResult, RemoveWorkspaceResult, RemovedSessionsResult, RestartSessionResult, RestoreRemovedSessionResult, ResumeSessionResult, ReviveSessionResult, SessionGroupsResult, SessionHistoryResult, SetSessionRoleResult, StopSessionResult, WorkspaceResult, WorkspaceSandboxRequest, WorkspacesResult, addCoordinator, admitWorkspace, createGeneralSessionRequest, createProfile, createSession, createWorkspaceSession, deleteSessionGroup, discoverWorkspaces, ensureHomeCoordinator, getWorkspace, listDirectory, listLaunchProfiles, listPoFolders, listRemovedSessions, listSessionHistory, listSessions, listWorkspaceHistory, listWorkspaces, moveSession, readDormantTranscriptPage, removeWorkspace, renameSessionGroup, restartSession, restoreRemovedSession, resumeSession, resumeWorkspaceSession, reviveSession, searchDirectories, searchSessionFiles, setSessionGroups, setSessionRole, setWorkspaceInstructions, setWorkspaceSandbox, stopSession } from "./web/lib/hubApi.mjs";
|
|
@@ -83,4 +83,4 @@ import { firstSessionWelcomeFor } from "./web/lib/firstSessionWelcome.mjs";
|
|
|
83
83
|
import { DesktopPairingBridge, HostPairingGrant, PairingAccount, PairingAccountStatus, PairingHost, PairingRequest, createHostBrowserAccount, createHostPairingChannels, hostPairingPrefix, hostPairingStorageKey, pairHost, pairingJson, pairingPost, pairingRequest, readHostPairing, selectedHostAccount, signingFingerprint } from "./web/lib/hostPairing.mjs";
|
|
84
84
|
import { PairedHost, connectPairedHost, forgetPairedHost, onPairedHostsChanged, pairedHosts } from "./web/lib/pairedHosts.mjs";
|
|
85
85
|
import { useMediaQuery } from "./web/lib/useMediaQuery.mjs";
|
|
86
|
-
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, 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, LOCALE_STORAGE_KEY, 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, ModeToggleAction, ModelChoice, NativeTemplateCatalog, NewSessionDraft, NewSessionState, NoticeEntry, PACKAGED_MODES, PACKAGED_SELECTION_AXES, PLUGINS_PAGE_ID, PLUGINS_ROUTE, PairedHost, PairingAccount, PairingAccountStatus, PairingHost, PairingRequest, PaletteState, PlannedWritesInput, PoAccountBridge, PoAccountStatus, PoTeam, PoTeamClient, PoTeamGrant, PoTeamRole, PresetSettingsResult, ProfileIdentity, ProvidersResult, QueuedEntry, RailDialogState, RailRestartState, RailSessionInput, ReadConfigResult, ReadRepositorySettingsResult, ReduceSessionOptions, RemoveWorkspaceResult, RemovedSessionsResult, ResolvedFill, RestartSessionResult, RestoreRemovedSessionResult, ResumeDraft, ResumeSessionResult, ResumeTarget, ResumeView, ReviveSessionResult, RpcImage, Selection, SelectionAxis, SessionAsset, SessionGroupsResult, SessionHistoryResult, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SetSessionRoleResult, SettingsDraftState, SettingsDraftTarget, SettingsSection, SettingsSectionGroup, SettingsWorkspace, SettledEntry, SingleUnit, StatusClock, StatusLineInput, StopSessionResult, StoredSessionAttachment, TEAM_PAGE_ID, TEAM_ROUTE, TRIGGER_CHARS, 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, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginLocales, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionLifecycleSnapshot, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredLocale, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, assistantFailureText, attachComposerCapture, attachComposerContext, attachmentPrompt, availableLocales, 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, claimDialogMenu, clearCommand, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, firstSessionWelcomeFor, 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, invokeModeAction, invokeServerMethod, isConnectedModel, isDesktopClient, isHostId, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadParticipantAvatar, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, modeToggle, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, 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, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSettingsConfig, reconcileStoredLocale, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, recordWebPluginRenderFailure, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, 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, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectLocale, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionSetupActionFor, 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, setWebPluginHostPlatform, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsContributionCopy, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, storedLocale, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, toggleMode, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, updateDialogDraft, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useMediaQuery, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubAccess, watchHubLifecycle, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, whenSessionReady, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
|
|
86
|
+
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, 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, LOCALE_STORAGE_KEY, 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, ModeToggleAction, ModelChoice, NativeTemplateCatalog, NewSessionDraft, NewSessionState, NoticeEntry, PACKAGED_MODES, PACKAGED_SELECTION_AXES, PLUGINS_PAGE_ID, PLUGINS_ROUTE, PairedHost, PairingAccount, PairingAccountStatus, PairingHost, PairingRequest, PaletteState, PlannedWritesInput, PoAccountBridge, PoAccountStatus, PoTeam, PoTeamClient, PoTeamGrant, PoTeamRole, PresetSettingsResult, ProfileIdentity, ProvidersResult, QueuedEntry, RailDialogState, RailRestartState, RailSessionInput, ReadConfigResult, ReadRepositorySettingsResult, ReduceSessionOptions, RemoveWorkspaceResult, RemovedSessionsResult, ResolvedFill, RestartSessionResult, RestoreRemovedSessionResult, ResumeDraft, ResumeSessionResult, ResumeTarget, ResumeView, ReviveSessionResult, RpcImage, Selection, SelectionAxis, SessionAsset, SessionGroupsResult, SessionHistoryResult, SessionMeta, SessionRailModelInput, SessionSocket, SessionSocketHandlers, SessionState, SessionStats, SessionsState, SetSessionRoleResult, SettingsDraftState, SettingsDraftTarget, SettingsSection, SettingsSectionGroup, SettingsWorkspace, SettledEntry, SingleUnit, StatusClock, StatusLineInput, StopSessionResult, StoredSessionAttachment, TEAM_PAGE_ID, TEAM_ROUTE, TRIGGER_CHARS, 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, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginLocales, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionLifecycleSnapshot, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredLocale, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, assistantFailureText, attachComposerCapture, attachComposerContext, attachmentPrompt, availableLocales, 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, claimDialogMenu, clearCommand, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, firstSessionWelcomeFor, 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, invokeModeAction, invokeServerMethod, isConnectedModel, isDesktopClient, isHostId, isSelfHostShell, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadParticipantAvatar, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, modeToggle, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, 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, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSettingsConfig, reconcileStoredLocale, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, recordWebPluginRenderFailure, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, 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, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectLocale, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionSetupActionFor, 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, setShellBridge, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginHostPlatform, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsContributionCopy, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, storedLocale, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, toggleMode, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, updateDialogDraft, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useMediaQuery, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubAccess, watchHubLifecycle, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, whenSessionReady, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isSelfHostShell, setShellBridge, teamPageUrl } from "./web/lib/selfHostShell.mjs";
|
|
1
2
|
import { answerLogin, cancelLogin, isConnectedModel, listProviders, logoutProvider, readLogin, readProviderSharing, startLogin, writeProviderSharing } from "./web/lib/authApi.mjs";
|
|
2
3
|
import { browserNotificationPermission, deliverBrowserNotification, requestBrowserNotificationPermission } from "./web/lib/browserNotifications.mjs";
|
|
3
4
|
import { onSealedSignInRequired, rememberHostChannelKey, rememberedHostChannelKey, resetSealedSessions, restoreSealedSession, sealedHttpSession, sealedProtocolSession, sealedSession } from "./web/lib/sealedSession.mjs";
|
|
@@ -9,7 +10,6 @@ import { defaultHostId, isHostId, localHostId, parseHostKey, qualifyHostId, qual
|
|
|
9
10
|
import { homeAppEntries, homePageRoute } from "./web/lib/homeApps.mjs";
|
|
10
11
|
import { leaderConflicts, leaderGroup } from "./web/lib/leaderTree.mjs";
|
|
11
12
|
import { mergeScopedPlugins, pluginsAtScope } from "./web/lib/pluginScopes.mjs";
|
|
12
|
-
import { teamPageUrl } from "./web/lib/selfHostShell.mjs";
|
|
13
13
|
import { backdropId, bindBundledNativeTemplates, bindBundledWebTemplates, bundledNativeTemplate, collectNativeTemplates, collectWebTemplates, resolveBackdrop, resolveNativeTemplate, resolveWebTemplate } from "./web/lib/templateCatalog.mjs";
|
|
14
14
|
import { flushUiTrace, noteRender, noteStoreUpdate, setUiTraceSink, traceProfilerRender, traceStore, useRenderTrace } from "./web/lib/uiTrace.mjs";
|
|
15
15
|
import { HOST_SLOTS, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activityGroupSlot, allPluginLocales, allPluginThemes, bindSessionWebWorkspace, createWebPluginRegistry, dashboardTileFills, dashboardTileFillsAcrossHosts, dispatchChannelFrame, dropPluginSessionData, hostPluginProviders, hostSlotFills, hostSlotFillsAcrossHosts, installBundledWebPlugins, installHostWebPlugins, installSessionWebPlugins, installWebPlugins, installWorkspaceWebPlugins, installedWebPlugins, isDesktopClient, legacyHomeAppFills, nativeTemplateCatalog, paletteCommands, parseDashboardTileData, pluginActivityGroups, pluginContextActions, pluginDockFaces, pluginFileLinks, pluginHomeContributions, pluginLeaderBindings, pluginMcpAppRenderer, pluginModes, pluginOnboarding, pluginRepositorySettingsPanels, pluginSelectionAxes, pluginSettingsPanels, pluginSettingsSections, pluginThemes, pluginToolRenderer, pluginUserMessageActions, recordWebPluginRenderFailure, registeredWebPluginHostIds, removeHostWebPlugins, removeSessionWebPlugins, removeWorkspaceWebPlugins, resetWebPlugins, sessionToolRenderer, sessionWebPluginsInstalled, setWebPluginHostPlatform, setWebPluginLoadDiagnostics, slotFills, startPluginDefinitions, startWebPlugins, subscribeWebPluginRegistry, webPluginDiagnostics, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, workspaceSlotFills } from "./web/lib/pluginRegistry.mjs";
|
|
@@ -83,4 +83,4 @@ import { CLOUD_HUB_POLL_MS, createCloudHub } from "./web/lib/cloudHub.mjs";
|
|
|
83
83
|
import { createHostBrowserAccount, createHostPairingChannels, hostPairingPrefix, hostPairingStorageKey, pairHost, pairingJson, pairingPost, pairingRequest, readHostPairing, selectedHostAccount, signingFingerprint } from "./web/lib/hostPairing.mjs";
|
|
84
84
|
import { connectPairedHost, forgetPairedHost, onPairedHostsChanged, pairedHosts } from "./web/lib/pairedHosts.mjs";
|
|
85
85
|
import { useMediaQuery } from "./web/lib/useMediaQuery.mjs";
|
|
86
|
-
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, LOCALE_STORAGE_KEY, 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, TEAM_PAGE_ID, TEAM_ROUTE, TRIGGER_CHARS, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, accountStore, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, addCoordinator, addDashboardCoordinator, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginLocales, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionLifecycleSnapshot, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredLocale, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, assistantFailureText, attachComposerCapture, attachComposerContext, attachmentPrompt, availableLocales, 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, claimDialogMenu, clearCommand, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, firstSessionWelcomeFor, 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, invokeModeAction, invokeServerMethod, isConnectedModel, isDesktopClient, isHostId, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadParticipantAvatar, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, modeToggle, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, 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, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSettingsConfig, reconcileStoredLocale, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, recordWebPluginRenderFailure, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, 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, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectLocale, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionSetupActionFor, 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, setWebPluginHostPlatform, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsContributionCopy, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, storedLocale, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, toggleMode, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, updateDialogDraft, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useMediaQuery, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubAccess, watchHubLifecycle, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, whenSessionReady, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
|
|
86
|
+
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, LOCALE_STORAGE_KEY, 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, TEAM_PAGE_ID, TEAM_ROUTE, TRIGGER_CHARS, UPDATE_REQUIRED_REASON, abbreviateCwd, abortCommand, abortRun, accountStore, acquireModelContext, activateWebPluginHost, activateWebPluginSession, activateWebPluginWorkspace, activeSessionId, activityGroupSlot, activityGroups, activityWaitingCount, addCoordinator, addDashboardCoordinator, addPresetLayer, admitDashboardWorkspace, admitDeclaredDashboardWorkspaces, admitWorkspace, allPluginLocales, allPluginThemes, ansiSegments, answerDialogConfirm, answerDialogValue, answerLogin, appendComposerDraft, appendComposerQuote, appendQueued, appendUserPrompt, applyCaptureFrame, applyHistoryPage, applyProtocolQueue, applyProtocolTranscript, applySelectionAnswer, applySessionBacklog, applySessionFrame, applySessionInteractions, applySessionLifecycle, applySessionLifecycleSnapshot, applySessionRemoved, applySessionUpsert, applySessionsSnapshot, applyStoredLocale, applyStoredTheme, applyThreadFrame, applyThreadTranscriptFrame, applyWorkspaceRemoved, applyWorkspaceUpsert, applyWorkspacesSnapshot, assistantFailureText, attachComposerCapture, attachComposerContext, attachmentPrompt, availableLocales, 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, claimDialogMenu, clearCommand, clearComposerState, clearDialog, clearPendingMenu, clearQueueCommand, clearQueuedEntries, clearQueuedMessages, closeCoordinatorProfile, closeMoveSessionDialog, closeNewSession, closePalette, closeResumeDialog, closeSessionSharing, closeTransientTab, collectNativeTemplates, collectWebTemplates, commandCompletions, compactCommand, completeSessionTransfer, composerStore, composerSubmissionStore, configuredBackdrop, configuredTemplate, connectPairedHost, contextGroups, coordinatorHostTargets, createBotWithProfile, createCloudHub, createDashboardTransport, createGeneralSession, createGeneralSessionRequest, createHostBrowserAccount, createHostPairingChannels, createPagedTranscript, createPlainSession, createPreset, createProfile, createProtocolHubSocket, createProtocolLink, createSession, createToolCompletionTabs, createWebPluginRegistry, createWorkspaceSession, dashboardRouteFrom, dashboardStateFor, dashboardTileFills, dashboardTileFillsAcrossHosts, defaultHostId, deletePreset, deleteQueuedMessage, deleteSessionGroup, deliverBrowserNotification, dialogCancelled, dialogConfirmed, dialogDraftStore, dialogValue, disableBrowserTelemetry, disableLivePush, discardSettingsDraft, disconnectCaptures, discoverWorkspaceAdmission, discoverWorkspaces, dispatchChannelFrame, dispatchHeldSessionChannel, disposeModelContextAdapter, dockTabFor, dropComposerState, dropPluginSessionData, dropSessionStore, dropThreads, dropTransientTabs, emptySelection, enableLivePush, endSessionReplay, enqueueAutomaticCommand, ensureHomeCoordinator, ensureTemplateConfiguration, fetchContextItemDetail, fileCompletions, fileLinkFor, fileLinkMentions, fileTabForPath, findTransientTab, firstSessionWelcomeFor, 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, invokeModeAction, invokeServerMethod, isConnectedModel, isDesktopClient, isHostId, isSelfHostShell, isSupportedImageMimeType, leaderConflicts, leaderGroup, legacyHomeAppFills, listDirectory, listLaunchProfiles, listPoFolders, listProviders, listRemovedSessions, listSessionHistory, listSessions, listSettingsModels, listSettingsRepositories, listWorkspaceHistory, listWorkspaces, livePushStatus, liveSessionOptions, loadModelChoices, loadParticipantAvatar, loadSessionAsset, loadSessionAvatar, loadSettingsDraft, localHostId, logoutProvider, markSocketClosed, markToolPromptFailed, markUpdateRequired, mediaKindFor, mentionableSessions, menuStore, mergeScopedPlugins, modeToggle, moveDashboardSession, moveSession, movedSettingsLayer, nativeTemplateCatalog, newSessionDraftStore, newSessionStore, noSessions, noteRender, noteStoreUpdate, notifyHubConnected, onCaptureStatus, onComposerSubmitted, onHostConnected, onHubConnected, onPairedHostsChanged, onSealedSignInRequired, openGeneralSession, openMoveSessionDialog, openNewSession, openPalette, openResumeDialog, openSessionSharing, openTransientTab, ownerLabel, ownersOf, pairHost, pairedHosts, pairingJson, pairingPost, pairingRequest, paletteCommands, paletteStore, parseDashboardTileData, parseFileMentions, parseHostKey, parseSelection, 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, qualifyHostId, qualifyHostKey, queueFollowUp, queueFollowUpWithAck, railDialogStore, railParentIds, railRestartStore, railSessionStatus, railShortcutOrder, readDormantTranscriptPage, readHostHome, readHostPairing, readImageSettings, readLogin, readPresetSettings, readProviderSharing, readRepositorySettings, readSettingsConfig, reconcileStoredLocale, reconcileStoredTheme, recordBrowserError, recordBrowserPerformance, recordBrowserUiTrace, recordWebPluginRenderFailure, reduceSession, refreshAccount, refreshSessionFacts, refreshSessionSelection, refreshSessionStats, refreshTemplateConfiguration, refreshWebPluginCompositions, registerPromptInput, registeredWebPluginHostIds, releaseDialogMenu, releaseProtocolTranscript, releaseSessionActivityRenderer, releaseSessionTranscriptRenderer, releaseThreadRenderer, releaseTransport, reloadWebTemplateDecision, rememberHostChannelKey, rememberedHostChannelKey, removeHostWebPlugins, removePresetLayer, removeQueuedCommand, removeQueuedEntry, removeSessionWebPlugins, removeWorkspace, removeWorkspaceWebPlugins, renamePreset, renameSession, renameSessionGroup, renderRegion, renderSessionActivity, renderSessionTranscript, renderThread, replaceQueuedEntries, requestBrowserNotificationPermission, requestLatestHistory, requestNewerHistory, requestOlderHistory, requestSessionProtocolFrame, resetComposerStore, 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, rewindCommand, rewindToMessage, runCommand, runningCount, sameRailEntries, sameRailEntry, saveBackdropDefault, saveComposerDrafts, saveCoordinatorProfile, saveSettingsDraft, saveTemplateDefault, sealedHttpSession, sealedProtocolSession, sealedSession, searchDirectories, searchSessionFiles, seedHistoryCursor, selectFastMode, selectLocale, selectModel, selectTheme, selectThinkingLevel, selectWorkspace, selectedHostAccount, selectionAxes, selectionStatuses, sendFrame, sendFrameWithAck, sendHubFrame, sendSessionProtocolFrame, sessionModes, sessionMoveTarget, sessionSetupActionFor, 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, setShellBridge, setThinkingLevelCommand, setTransientTabSession, setUiTraceSink, setWebPluginHostPlatform, setWebPluginLoadDiagnostics, setWorkspaceHostLabel, setWorkspaceInstructions, setWorkspaceSandbox, settingsContributionCopy, settingsDraftKey, settingsDraftStore, settingsKeyOf, settingsLockedReason, settingsSection, settingsSectionGroups, settingsSections, signOutAccount, signingFingerprint, slotFills, splitHostId, startLogin, startPluginDefinitions, startWebPlugins, steerCommand, stopSession, storedLocale, streamedSessions, stripAnsi, submitCapture, submitComposerDraft, submitMessage, submitMessageWithAck, subscribeActivitySources, subscribeThread, subscribeWebPluginRegistry, summariseArgs, summaryValueEqual, tabComposerContext, takeComposerDraft, teamPageUrl, teamStore, templateStore, textFromContent, themeStore, threadStoreKey, timelineUnits, toQueuedEntries, toTimelineEntries, toggleMode, togglePalette, toolMessageProps, toolPromptClaim, toolPromptStore, totalTokens, traceProfilerRender, traceStore, transientTabsOf, transientTabsStore, transportForHost, triggerTokenAt, uiStore, unsubscribeThread, updateComposerState, updateCoordinatorProfileDraft, updateDialogDraft, updateResumeDraft, updateWorkspaceAdmission, uploadSessionAttachment, useActiveSession, useActiveSessionMeta, useActivityGroups, useComposerState, useDashboardRoute, useDashboardState, useDialogDraft, useDockFaceBadges, useDockFaces, useFileLinks, useHasOlderHistory, useMediaQuery, useNoSessions, useOpenTab, usePluginSlotProps, useRailEntries, useRailEntry, useRenderTrace, useTemplateConfiguration, useToolPrompt, useTransientTabs, useWebPluginRegistry, validateComposerCapture, waitForSession, watchDashboardTranscript, watchHubAccess, watchHubLifecycle, watchHubThread, webPluginCompositionStore, webPluginDiagnostics, webPluginMountState, webPluginRegistryForHost, webPluginRegistryRevision, webPluginsInstalled, webTabs, webTemplateCatalog, whenSessionReady, workspaceAdmissionStore, workspaceHostLabelsStore, workspaceName, workspaceSlotFills, workspacesStore, writeImageSettings, writePresetSettings, writeProviderSharing, writeRepositorySelection, writeSettingsValue };
|
|
@@ -16,7 +16,7 @@ const EMPTY = {
|
|
|
16
16
|
/** Product transport for the approved library View. No release metadata is inferred from archive filenames. */
|
|
17
17
|
function OrgLibrary() {
|
|
18
18
|
const t = (0, _agimon_ai_po_core_web.useT)();
|
|
19
|
-
const environment = require_selfHostShell.isSelfHostShell()
|
|
19
|
+
const environment = require_selfHostShell.isSelfHostShell() ? "cloud" : "desktop";
|
|
20
20
|
const [snapshot, setSnapshot] = (0, react.useState)();
|
|
21
21
|
const [state, setState] = (0, react.useState)("loading");
|
|
22
22
|
const [tab, setTab] = (0, react.useState)("org");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgLibrary.cjs","names":["useT","isSelfHostShell","teamPageUrl","useState","useRef","useCallback","readOrgLibrary","libraryReleaseId","uploadOrgLibrary","changeOrgLibrary","OrgLibraryView","Button","Input"],"sources":["../../../../src/web/features/plugins/OrgLibrary.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { Button, Input } from '@agimon-ai/po-web-components';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport {\n changeOrgLibrary,\n libraryReleaseId,\n readOrgLibrary,\n uploadOrgLibrary,\n type LibrarySnapshot,\n} from '../../lib/orgLibraryApi';\nimport { isSelfHostShell, teamPageUrl } from '../../lib/selfHostShell';\nimport { OrgLibraryView, type OrgLibraryItem, type OrgLibraryReview, type OrgLibraryTab } from './OrgLibraryView';\n\nconst EMPTY: OrgLibraryItem = { id: '', name: '', version: '', enabled: false, desktop: false };\n\n/** Product transport for the approved library View. No release metadata is inferred from archive filenames. */\nexport function OrgLibrary() {\n const t = useT();\n const environment = isSelfHostShell() || teamPageUrl() ? 'cloud' : 'desktop';\n const [snapshot, setSnapshot] = useState<LibrarySnapshot>();\n const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading');\n const [tab, setTab] = useState<OrgLibraryTab>('org');\n const [query, setQuery] = useState('');\n const [review, setReview] = useState<OrgLibraryReview>(null);\n const [selected, setSelected] = useState<OrgLibraryItem>(EMPTY);\n const [file, setFile] = useState<File>();\n const [kind, setKind] = useState<'agent' | 'runtime'>('agent');\n const [notice, setNotice] = useState<string>();\n const [busy, setBusy] = useState(false);\n const [verified, setVerified] = useState(false);\n const pending = useRef(false);\n const generation = useRef(0);\n const load = useCallback(async () => {\n const token = ++generation.current;\n try {\n const next = await readOrgLibrary(environment);\n if (token !== generation.current) return;\n setSnapshot(next);\n setVerified(!next.offline);\n setState('ready');\n setNotice(\n next.offline\n ? t(\n 'webDashboard.orgLibrary.offline',\n 'The library is offline. Previously verified choices have not changed.',\n )\n : undefined,\n );\n } catch (error) {\n if (token !== generation.current) return;\n setVerified(false);\n setState('error');\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.failed', 'The library could not be reached.'),\n );\n }\n }, [environment, t]);\n useEffect(() => {\n void load();\n return () => {\n generation.current++;\n };\n }, [load]);\n\n const items: OrgLibraryItem[] = (snapshot?.releases ?? []).map((pin) => ({\n id: libraryReleaseId(pin),\n name: pin.name,\n version: pin.version,\n enabled: !pin.removed && pin.enabled === true,\n desktop: pin.kind === 'runtime' && pin.cloud?.status !== 'runtime-ready' && pin.cloud?.status !== 'runtime-staging',\n removed: pin.removed,\n publisher: pin.uploader,\n reason: pin.cloud?.reason,\n file: pin.integrity,\n }));\n const format = file?.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz';\n const confirm = async () => {\n if (pending.current || !verified || !snapshot) return;\n pending.current = true;\n setBusy(true);\n try {\n if (review === 'zip' || review === 'tgz') {\n if (!file || environment !== 'cloud' || snapshot.role === 'member') return;\n await uploadOrgLibrary(snapshot.org, file, format, kind);\n } else {\n const target = review === 'update' ? selected.update : selected;\n const pin = snapshot.releases.find((entry) => libraryReleaseId(entry) === target?.id);\n if (!pin) return;\n const action =\n review === 'enable' || review === 'update'\n ? 'enable'\n : review === 'remove'\n ? 'disable'\n : review === 'remove-library'\n ? 'remove'\n : review === 'restore'\n ? 'restore'\n : undefined;\n if (!action) return;\n await changeOrgLibrary(environment, action, pin);\n }\n setReview(null);\n setFile(undefined);\n await load();\n } catch (error) {\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.changeFailed', 'The plugin choice could not be changed.'),\n );\n } finally {\n pending.current = false;\n setBusy(false);\n }\n };\n return (\n <OrgLibraryView\n role={snapshot?.role ?? 'member'}\n orgName={snapshot?.orgName ?? ''}\n environment={environment}\n tab={tab}\n onTabChange={setTab}\n state={state}\n releases={items}\n review={review}\n selected={selected}\n archive={{ ...EMPTY, file: file?.name }}\n query={query}\n onQueryChange={setQuery}\n notice={notice}\n busy={busy}\n canActivate={verified}\n libraryActions={environment === 'cloud' && verified}\n confirmDisabled={!verified || busy}\n uploadContent={\n <div className=\"flex flex-col gap-3\">\n <p>\n {t(\n 'webDashboard.orgLibrary.chooseArchive',\n 'Choose an archive. Package identity is validated by the server after upload. Uploading does not enable it.',\n )}\n </p>\n <div className=\"flex gap-2\">\n <Button\n variant={kind === 'agent' ? 'subtle' : 'ghost'}\n onClick={() => setKind('agent')}\n aria-pressed={kind === 'agent'}\n >\n {t('webDashboard.orgLibrary.agent', 'Agent plugin')}\n </Button>\n <Button\n variant={kind === 'runtime' ? 'subtle' : 'ghost'}\n onClick={() => setKind('runtime')}\n aria-pressed={kind === 'runtime'}\n >\n {t('webDashboard.orgLibrary.runtime', 'Runtime plugin')}\n </Button>\n </div>\n <Input\n type=\"file\"\n accept={kind === 'agent' ? '.zip,.tgz' : '.tgz'}\n aria-label={t('webDashboard.orgLibrary.archive', 'Plugin archive')}\n onChange={(event) => {\n const next = event.target.files?.[0];\n if (!next) return;\n if (\n (!next.name.toLowerCase().endsWith('.tgz') &&\n !(kind === 'agent' && next.name.toLowerCase().endsWith('.zip'))) ||\n next.size > (next.name.toLowerCase().endsWith('.zip') ? 6 : 32) * 1024 * 1024\n ) {\n setNotice(\n t(\n 'webDashboard.orgLibrary.invalidArchive',\n 'Choose a supported ZIP or tgz archive within the upload limit.',\n ),\n );\n return;\n }\n setFile(next);\n setReview(next.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz');\n }}\n />\n </div>\n }\n onReview={(next, item) => {\n if (busy || !verified) return;\n if (next === 'upload' && (environment !== 'cloud' || snapshot?.role === 'member')) return;\n if (next === 'enable' && item) {\n const active = items.find((entry) => entry.enabled && entry.name === item.name && entry.id !== item.id);\n if (active) {\n setSelected({ ...active, update: item });\n setReview('update');\n return;\n }\n }\n if (item) setSelected(item);\n setReview(next);\n }}\n onClose={() => {\n if (!busy) {\n setReview(null);\n setFile(undefined);\n }\n }}\n onConfirm={() => void confirm()}\n onRetry={() => void load()}\n onProvenance={(item) => {\n const pin = snapshot?.releases.find((entry) => libraryReleaseId(entry) === item.id);\n if (pin)\n setNotice(\n JSON.stringify({\n issuer: pin.issuer,\n org: pin.org,\n name: pin.name,\n version: pin.version,\n sha256: pin.sha256,\n integrity: pin.integrity,\n size: pin.size,\n uploader: pin.uploader,\n }),\n );\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,QAAwB;CAAE,IAAI;CAAI,MAAM;CAAI,SAAS;CAAI,SAAS;CAAO,SAAS;AAAM;;AAG9F,SAAgB,aAAa;CAC3B,MAAM,KAAA,GAAIA,uBAAAA,KAAAA,CAAK;CACf,MAAM,cAAcC,sBAAAA,gBAAgB,KAAKC,sBAAAA,YAAY,IAAI,UAAU;CACnE,MAAM,CAAC,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OrgLibrary.cjs","names":["useT","isSelfHostShell","useState","useRef","useCallback","readOrgLibrary","libraryReleaseId","uploadOrgLibrary","changeOrgLibrary","OrgLibraryView","Button","Input"],"sources":["../../../../src/web/features/plugins/OrgLibrary.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { Button, Input } from '@agimon-ai/po-web-components';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport {\n changeOrgLibrary,\n libraryReleaseId,\n readOrgLibrary,\n uploadOrgLibrary,\n type LibrarySnapshot,\n} from '../../lib/orgLibraryApi';\nimport { isSelfHostShell } from '../../lib/selfHostShell';\nimport { OrgLibraryView, type OrgLibraryItem, type OrgLibraryReview, type OrgLibraryTab } from './OrgLibraryView';\n\nconst EMPTY: OrgLibraryItem = { id: '', name: '', version: '', enabled: false, desktop: false };\n\n/** Product transport for the approved library View. No release metadata is inferred from archive filenames. */\nexport function OrgLibrary() {\n const t = useT();\n const environment = isSelfHostShell() ? 'cloud' : 'desktop';\n const [snapshot, setSnapshot] = useState<LibrarySnapshot>();\n const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading');\n const [tab, setTab] = useState<OrgLibraryTab>('org');\n const [query, setQuery] = useState('');\n const [review, setReview] = useState<OrgLibraryReview>(null);\n const [selected, setSelected] = useState<OrgLibraryItem>(EMPTY);\n const [file, setFile] = useState<File>();\n const [kind, setKind] = useState<'agent' | 'runtime'>('agent');\n const [notice, setNotice] = useState<string>();\n const [busy, setBusy] = useState(false);\n const [verified, setVerified] = useState(false);\n const pending = useRef(false);\n const generation = useRef(0);\n const load = useCallback(async () => {\n const token = ++generation.current;\n try {\n const next = await readOrgLibrary(environment);\n if (token !== generation.current) return;\n setSnapshot(next);\n setVerified(!next.offline);\n setState('ready');\n setNotice(\n next.offline\n ? t(\n 'webDashboard.orgLibrary.offline',\n 'The library is offline. Previously verified choices have not changed.',\n )\n : undefined,\n );\n } catch (error) {\n if (token !== generation.current) return;\n setVerified(false);\n setState('error');\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.failed', 'The library could not be reached.'),\n );\n }\n }, [environment, t]);\n useEffect(() => {\n void load();\n return () => {\n generation.current++;\n };\n }, [load]);\n\n const items: OrgLibraryItem[] = (snapshot?.releases ?? []).map((pin) => ({\n id: libraryReleaseId(pin),\n name: pin.name,\n version: pin.version,\n enabled: !pin.removed && pin.enabled === true,\n desktop: pin.kind === 'runtime' && pin.cloud?.status !== 'runtime-ready' && pin.cloud?.status !== 'runtime-staging',\n removed: pin.removed,\n publisher: pin.uploader,\n reason: pin.cloud?.reason,\n file: pin.integrity,\n }));\n const format = file?.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz';\n const confirm = async () => {\n if (pending.current || !verified || !snapshot) return;\n pending.current = true;\n setBusy(true);\n try {\n if (review === 'zip' || review === 'tgz') {\n if (!file || environment !== 'cloud' || snapshot.role === 'member') return;\n await uploadOrgLibrary(snapshot.org, file, format, kind);\n } else {\n const target = review === 'update' ? selected.update : selected;\n const pin = snapshot.releases.find((entry) => libraryReleaseId(entry) === target?.id);\n if (!pin) return;\n const action =\n review === 'enable' || review === 'update'\n ? 'enable'\n : review === 'remove'\n ? 'disable'\n : review === 'remove-library'\n ? 'remove'\n : review === 'restore'\n ? 'restore'\n : undefined;\n if (!action) return;\n await changeOrgLibrary(environment, action, pin);\n }\n setReview(null);\n setFile(undefined);\n await load();\n } catch (error) {\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.changeFailed', 'The plugin choice could not be changed.'),\n );\n } finally {\n pending.current = false;\n setBusy(false);\n }\n };\n return (\n <OrgLibraryView\n role={snapshot?.role ?? 'member'}\n orgName={snapshot?.orgName ?? ''}\n environment={environment}\n tab={tab}\n onTabChange={setTab}\n state={state}\n releases={items}\n review={review}\n selected={selected}\n archive={{ ...EMPTY, file: file?.name }}\n query={query}\n onQueryChange={setQuery}\n notice={notice}\n busy={busy}\n canActivate={verified}\n libraryActions={environment === 'cloud' && verified}\n confirmDisabled={!verified || busy}\n uploadContent={\n <div className=\"flex flex-col gap-3\">\n <p>\n {t(\n 'webDashboard.orgLibrary.chooseArchive',\n 'Choose an archive. Package identity is validated by the server after upload. Uploading does not enable it.',\n )}\n </p>\n <div className=\"flex gap-2\">\n <Button\n variant={kind === 'agent' ? 'subtle' : 'ghost'}\n onClick={() => setKind('agent')}\n aria-pressed={kind === 'agent'}\n >\n {t('webDashboard.orgLibrary.agent', 'Agent plugin')}\n </Button>\n <Button\n variant={kind === 'runtime' ? 'subtle' : 'ghost'}\n onClick={() => setKind('runtime')}\n aria-pressed={kind === 'runtime'}\n >\n {t('webDashboard.orgLibrary.runtime', 'Runtime plugin')}\n </Button>\n </div>\n <Input\n type=\"file\"\n accept={kind === 'agent' ? '.zip,.tgz' : '.tgz'}\n aria-label={t('webDashboard.orgLibrary.archive', 'Plugin archive')}\n onChange={(event) => {\n const next = event.target.files?.[0];\n if (!next) return;\n if (\n (!next.name.toLowerCase().endsWith('.tgz') &&\n !(kind === 'agent' && next.name.toLowerCase().endsWith('.zip'))) ||\n next.size > (next.name.toLowerCase().endsWith('.zip') ? 6 : 32) * 1024 * 1024\n ) {\n setNotice(\n t(\n 'webDashboard.orgLibrary.invalidArchive',\n 'Choose a supported ZIP or tgz archive within the upload limit.',\n ),\n );\n return;\n }\n setFile(next);\n setReview(next.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz');\n }}\n />\n </div>\n }\n onReview={(next, item) => {\n if (busy || !verified) return;\n if (next === 'upload' && (environment !== 'cloud' || snapshot?.role === 'member')) return;\n if (next === 'enable' && item) {\n const active = items.find((entry) => entry.enabled && entry.name === item.name && entry.id !== item.id);\n if (active) {\n setSelected({ ...active, update: item });\n setReview('update');\n return;\n }\n }\n if (item) setSelected(item);\n setReview(next);\n }}\n onClose={() => {\n if (!busy) {\n setReview(null);\n setFile(undefined);\n }\n }}\n onConfirm={() => void confirm()}\n onRetry={() => void load()}\n onProvenance={(item) => {\n const pin = snapshot?.releases.find((entry) => libraryReleaseId(entry) === item.id);\n if (pin)\n setNotice(\n JSON.stringify({\n issuer: pin.issuer,\n org: pin.org,\n name: pin.name,\n version: pin.version,\n sha256: pin.sha256,\n integrity: pin.integrity,\n size: pin.size,\n uploader: pin.uploader,\n }),\n );\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,QAAwB;CAAE,IAAI;CAAI,MAAM;CAAI,SAAS;CAAI,SAAS;CAAO,SAAS;AAAM;;AAG9F,SAAgB,aAAa;CAC3B,MAAM,KAAA,GAAIA,uBAAAA,KAAAA,CAAK;CACf,MAAM,cAAcC,sBAAAA,gBAAgB,IAAI,UAAU;CAClD,MAAM,CAAC,UAAU,gBAAA,GAAeC,MAAAA,SAAAA,CAA0B;CAC1D,MAAM,CAAC,OAAO,aAAA,GAAYA,MAAAA,SAAAA,CAAwC,SAAS;CAC3E,MAAM,CAAC,KAAK,WAAA,GAAUA,MAAAA,SAAAA,CAAwB,KAAK;CACnD,MAAM,CAAC,OAAO,aAAA,GAAYA,MAAAA,SAAAA,CAAS,EAAE;CACrC,MAAM,CAAC,QAAQ,cAAA,GAAaA,MAAAA,SAAAA,CAA2B,IAAI;CAC3D,MAAM,CAAC,UAAU,gBAAA,GAAeA,MAAAA,SAAAA,CAAyB,KAAK;CAC9D,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAAe;CACvC,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAA8B,OAAO;CAC7D,MAAM,CAAC,QAAQ,cAAA,GAAaA,MAAAA,SAAAA,CAAiB;CAC7C,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAAS,KAAK;CACtC,MAAM,CAAC,UAAU,gBAAA,GAAeA,MAAAA,SAAAA,CAAS,KAAK;CAC9C,MAAM,WAAA,GAAUC,MAAAA,OAAAA,CAAO,KAAK;CAC5B,MAAM,cAAA,GAAaA,MAAAA,OAAAA,CAAO,CAAC;CAC3B,MA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;IACd,QAAQ,KAAA,CAAS;GACnB;EACF;EACA,iBAAiB,KAAK,QAAQ;EAC9B,eAAe,KAAK,KAAK;EACzB,eAAe,SAAS;GACtB,MAAM,MAAM,UAAU,SAAS,MAAM,UAAUL,sBAAAA,iBAAiB,KAAK,MAAM,KAAK,EAAE;GAClF,IAAI,KACF,UACE,KAAK,UAAU;IACb,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,MAAM,IAAI;IACV,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,WAAW,IAAI;IACf,MAAM,IAAI;IACV,UAAU,IAAI;GAChB,CAAC,CACH;EACJ;CACD,CAAA;AAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSelfHostShell
|
|
1
|
+
import { isSelfHostShell } from "../../lib/selfHostShell.mjs";
|
|
2
2
|
import { changeOrgLibrary, libraryReleaseId, readOrgLibrary, uploadOrgLibrary } from "../../lib/orgLibraryApi.mjs";
|
|
3
3
|
import { OrgLibraryView } from "./OrgLibraryView.mjs";
|
|
4
4
|
import { useT } from "@agimon-ai/po-core/web";
|
|
@@ -16,7 +16,7 @@ const EMPTY = {
|
|
|
16
16
|
/** Product transport for the approved library View. No release metadata is inferred from archive filenames. */
|
|
17
17
|
function OrgLibrary() {
|
|
18
18
|
const t = useT();
|
|
19
|
-
const environment = isSelfHostShell()
|
|
19
|
+
const environment = isSelfHostShell() ? "cloud" : "desktop";
|
|
20
20
|
const [snapshot, setSnapshot] = useState();
|
|
21
21
|
const [state, setState] = useState("loading");
|
|
22
22
|
const [tab, setTab] = useState("org");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgLibrary.mjs","names":[],"sources":["../../../../src/web/features/plugins/OrgLibrary.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { Button, Input } from '@agimon-ai/po-web-components';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport {\n changeOrgLibrary,\n libraryReleaseId,\n readOrgLibrary,\n uploadOrgLibrary,\n type LibrarySnapshot,\n} from '../../lib/orgLibraryApi';\nimport { isSelfHostShell, teamPageUrl } from '../../lib/selfHostShell';\nimport { OrgLibraryView, type OrgLibraryItem, type OrgLibraryReview, type OrgLibraryTab } from './OrgLibraryView';\n\nconst EMPTY: OrgLibraryItem = { id: '', name: '', version: '', enabled: false, desktop: false };\n\n/** Product transport for the approved library View. No release metadata is inferred from archive filenames. */\nexport function OrgLibrary() {\n const t = useT();\n const environment = isSelfHostShell() || teamPageUrl() ? 'cloud' : 'desktop';\n const [snapshot, setSnapshot] = useState<LibrarySnapshot>();\n const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading');\n const [tab, setTab] = useState<OrgLibraryTab>('org');\n const [query, setQuery] = useState('');\n const [review, setReview] = useState<OrgLibraryReview>(null);\n const [selected, setSelected] = useState<OrgLibraryItem>(EMPTY);\n const [file, setFile] = useState<File>();\n const [kind, setKind] = useState<'agent' | 'runtime'>('agent');\n const [notice, setNotice] = useState<string>();\n const [busy, setBusy] = useState(false);\n const [verified, setVerified] = useState(false);\n const pending = useRef(false);\n const generation = useRef(0);\n const load = useCallback(async () => {\n const token = ++generation.current;\n try {\n const next = await readOrgLibrary(environment);\n if (token !== generation.current) return;\n setSnapshot(next);\n setVerified(!next.offline);\n setState('ready');\n setNotice(\n next.offline\n ? t(\n 'webDashboard.orgLibrary.offline',\n 'The library is offline. Previously verified choices have not changed.',\n )\n : undefined,\n );\n } catch (error) {\n if (token !== generation.current) return;\n setVerified(false);\n setState('error');\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.failed', 'The library could not be reached.'),\n );\n }\n }, [environment, t]);\n useEffect(() => {\n void load();\n return () => {\n generation.current++;\n };\n }, [load]);\n\n const items: OrgLibraryItem[] = (snapshot?.releases ?? []).map((pin) => ({\n id: libraryReleaseId(pin),\n name: pin.name,\n version: pin.version,\n enabled: !pin.removed && pin.enabled === true,\n desktop: pin.kind === 'runtime' && pin.cloud?.status !== 'runtime-ready' && pin.cloud?.status !== 'runtime-staging',\n removed: pin.removed,\n publisher: pin.uploader,\n reason: pin.cloud?.reason,\n file: pin.integrity,\n }));\n const format = file?.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz';\n const confirm = async () => {\n if (pending.current || !verified || !snapshot) return;\n pending.current = true;\n setBusy(true);\n try {\n if (review === 'zip' || review === 'tgz') {\n if (!file || environment !== 'cloud' || snapshot.role === 'member') return;\n await uploadOrgLibrary(snapshot.org, file, format, kind);\n } else {\n const target = review === 'update' ? selected.update : selected;\n const pin = snapshot.releases.find((entry) => libraryReleaseId(entry) === target?.id);\n if (!pin) return;\n const action =\n review === 'enable' || review === 'update'\n ? 'enable'\n : review === 'remove'\n ? 'disable'\n : review === 'remove-library'\n ? 'remove'\n : review === 'restore'\n ? 'restore'\n : undefined;\n if (!action) return;\n await changeOrgLibrary(environment, action, pin);\n }\n setReview(null);\n setFile(undefined);\n await load();\n } catch (error) {\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.changeFailed', 'The plugin choice could not be changed.'),\n );\n } finally {\n pending.current = false;\n setBusy(false);\n }\n };\n return (\n <OrgLibraryView\n role={snapshot?.role ?? 'member'}\n orgName={snapshot?.orgName ?? ''}\n environment={environment}\n tab={tab}\n onTabChange={setTab}\n state={state}\n releases={items}\n review={review}\n selected={selected}\n archive={{ ...EMPTY, file: file?.name }}\n query={query}\n onQueryChange={setQuery}\n notice={notice}\n busy={busy}\n canActivate={verified}\n libraryActions={environment === 'cloud' && verified}\n confirmDisabled={!verified || busy}\n uploadContent={\n <div className=\"flex flex-col gap-3\">\n <p>\n {t(\n 'webDashboard.orgLibrary.chooseArchive',\n 'Choose an archive. Package identity is validated by the server after upload. Uploading does not enable it.',\n )}\n </p>\n <div className=\"flex gap-2\">\n <Button\n variant={kind === 'agent' ? 'subtle' : 'ghost'}\n onClick={() => setKind('agent')}\n aria-pressed={kind === 'agent'}\n >\n {t('webDashboard.orgLibrary.agent', 'Agent plugin')}\n </Button>\n <Button\n variant={kind === 'runtime' ? 'subtle' : 'ghost'}\n onClick={() => setKind('runtime')}\n aria-pressed={kind === 'runtime'}\n >\n {t('webDashboard.orgLibrary.runtime', 'Runtime plugin')}\n </Button>\n </div>\n <Input\n type=\"file\"\n accept={kind === 'agent' ? '.zip,.tgz' : '.tgz'}\n aria-label={t('webDashboard.orgLibrary.archive', 'Plugin archive')}\n onChange={(event) => {\n const next = event.target.files?.[0];\n if (!next) return;\n if (\n (!next.name.toLowerCase().endsWith('.tgz') &&\n !(kind === 'agent' && next.name.toLowerCase().endsWith('.zip'))) ||\n next.size > (next.name.toLowerCase().endsWith('.zip') ? 6 : 32) * 1024 * 1024\n ) {\n setNotice(\n t(\n 'webDashboard.orgLibrary.invalidArchive',\n 'Choose a supported ZIP or tgz archive within the upload limit.',\n ),\n );\n return;\n }\n setFile(next);\n setReview(next.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz');\n }}\n />\n </div>\n }\n onReview={(next, item) => {\n if (busy || !verified) return;\n if (next === 'upload' && (environment !== 'cloud' || snapshot?.role === 'member')) return;\n if (next === 'enable' && item) {\n const active = items.find((entry) => entry.enabled && entry.name === item.name && entry.id !== item.id);\n if (active) {\n setSelected({ ...active, update: item });\n setReview('update');\n return;\n }\n }\n if (item) setSelected(item);\n setReview(next);\n }}\n onClose={() => {\n if (!busy) {\n setReview(null);\n setFile(undefined);\n }\n }}\n onConfirm={() => void confirm()}\n onRetry={() => void load()}\n onProvenance={(item) => {\n const pin = snapshot?.releases.find((entry) => libraryReleaseId(entry) === item.id);\n if (pin)\n setNotice(\n JSON.stringify({\n issuer: pin.issuer,\n org: pin.org,\n name: pin.name,\n version: pin.version,\n sha256: pin.sha256,\n integrity: pin.integrity,\n size: pin.size,\n uploader: pin.uploader,\n }),\n );\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,QAAwB;CAAE,IAAI;CAAI,MAAM;CAAI,SAAS;CAAI,SAAS;CAAO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,WAAW;GACnF,IAAI,SAAS,YAAY,MAAM;IAC7B,MAAM,SAAS,MAAM,MAAM,UAAU,MAAM,WAAW,MAAM,SAAS,KAAK,QAAQ,MAAM,OAAO,KAAK,EAAE;IACtG,IAAI,QAAQ;KACV,YAAY;MAAE,GAAG;MAAQ,QAAQ;KAAK,CAAC;KACvC,UAAU,QAAQ;KAClB;IACF;GACF;GACA,IAAI,MAAM,YAAY,IAAI;GAC1B,UAAU,IAAI;EAChB;EACA,eAAe;GACb,IAAI,CAAC,MAAM;IACT,UAAU,IAAI;IACd,QAAQ,KAAA,CAAS;GACnB;EACF;EACA,iBAAiB,KAAK,QAAQ;EAC9B,eAAe,KAAK,KAAK;EACzB,eAAe,SAAS;GACtB,MAAM,MAAM,UAAU,SAAS,MAAM,UAAU,iBAAiB,KAAK,MAAM,KAAK,EAAE;GAClF,IAAI,KACF,UACE,KAAK,UAAU;IACb,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,MAAM,IAAI;IACV,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,WAAW,IAAI;IACf,MAAM,IAAI;IACV,UAAU,IAAI;GAChB,CAAC,CACH;EACJ;CACD,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"OrgLibrary.mjs","names":[],"sources":["../../../../src/web/features/plugins/OrgLibrary.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { Button, Input } from '@agimon-ai/po-web-components';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport {\n changeOrgLibrary,\n libraryReleaseId,\n readOrgLibrary,\n uploadOrgLibrary,\n type LibrarySnapshot,\n} from '../../lib/orgLibraryApi';\nimport { isSelfHostShell } from '../../lib/selfHostShell';\nimport { OrgLibraryView, type OrgLibraryItem, type OrgLibraryReview, type OrgLibraryTab } from './OrgLibraryView';\n\nconst EMPTY: OrgLibraryItem = { id: '', name: '', version: '', enabled: false, desktop: false };\n\n/** Product transport for the approved library View. No release metadata is inferred from archive filenames. */\nexport function OrgLibrary() {\n const t = useT();\n const environment = isSelfHostShell() ? 'cloud' : 'desktop';\n const [snapshot, setSnapshot] = useState<LibrarySnapshot>();\n const [state, setState] = useState<'loading' | 'ready' | 'error'>('loading');\n const [tab, setTab] = useState<OrgLibraryTab>('org');\n const [query, setQuery] = useState('');\n const [review, setReview] = useState<OrgLibraryReview>(null);\n const [selected, setSelected] = useState<OrgLibraryItem>(EMPTY);\n const [file, setFile] = useState<File>();\n const [kind, setKind] = useState<'agent' | 'runtime'>('agent');\n const [notice, setNotice] = useState<string>();\n const [busy, setBusy] = useState(false);\n const [verified, setVerified] = useState(false);\n const pending = useRef(false);\n const generation = useRef(0);\n const load = useCallback(async () => {\n const token = ++generation.current;\n try {\n const next = await readOrgLibrary(environment);\n if (token !== generation.current) return;\n setSnapshot(next);\n setVerified(!next.offline);\n setState('ready');\n setNotice(\n next.offline\n ? t(\n 'webDashboard.orgLibrary.offline',\n 'The library is offline. Previously verified choices have not changed.',\n )\n : undefined,\n );\n } catch (error) {\n if (token !== generation.current) return;\n setVerified(false);\n setState('error');\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.failed', 'The library could not be reached.'),\n );\n }\n }, [environment, t]);\n useEffect(() => {\n void load();\n return () => {\n generation.current++;\n };\n }, [load]);\n\n const items: OrgLibraryItem[] = (snapshot?.releases ?? []).map((pin) => ({\n id: libraryReleaseId(pin),\n name: pin.name,\n version: pin.version,\n enabled: !pin.removed && pin.enabled === true,\n desktop: pin.kind === 'runtime' && pin.cloud?.status !== 'runtime-ready' && pin.cloud?.status !== 'runtime-staging',\n removed: pin.removed,\n publisher: pin.uploader,\n reason: pin.cloud?.reason,\n file: pin.integrity,\n }));\n const format = file?.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz';\n const confirm = async () => {\n if (pending.current || !verified || !snapshot) return;\n pending.current = true;\n setBusy(true);\n try {\n if (review === 'zip' || review === 'tgz') {\n if (!file || environment !== 'cloud' || snapshot.role === 'member') return;\n await uploadOrgLibrary(snapshot.org, file, format, kind);\n } else {\n const target = review === 'update' ? selected.update : selected;\n const pin = snapshot.releases.find((entry) => libraryReleaseId(entry) === target?.id);\n if (!pin) return;\n const action =\n review === 'enable' || review === 'update'\n ? 'enable'\n : review === 'remove'\n ? 'disable'\n : review === 'remove-library'\n ? 'remove'\n : review === 'restore'\n ? 'restore'\n : undefined;\n if (!action) return;\n await changeOrgLibrary(environment, action, pin);\n }\n setReview(null);\n setFile(undefined);\n await load();\n } catch (error) {\n setNotice(\n error instanceof Error\n ? error.message\n : t('webDashboard.orgLibrary.changeFailed', 'The plugin choice could not be changed.'),\n );\n } finally {\n pending.current = false;\n setBusy(false);\n }\n };\n return (\n <OrgLibraryView\n role={snapshot?.role ?? 'member'}\n orgName={snapshot?.orgName ?? ''}\n environment={environment}\n tab={tab}\n onTabChange={setTab}\n state={state}\n releases={items}\n review={review}\n selected={selected}\n archive={{ ...EMPTY, file: file?.name }}\n query={query}\n onQueryChange={setQuery}\n notice={notice}\n busy={busy}\n canActivate={verified}\n libraryActions={environment === 'cloud' && verified}\n confirmDisabled={!verified || busy}\n uploadContent={\n <div className=\"flex flex-col gap-3\">\n <p>\n {t(\n 'webDashboard.orgLibrary.chooseArchive',\n 'Choose an archive. Package identity is validated by the server after upload. Uploading does not enable it.',\n )}\n </p>\n <div className=\"flex gap-2\">\n <Button\n variant={kind === 'agent' ? 'subtle' : 'ghost'}\n onClick={() => setKind('agent')}\n aria-pressed={kind === 'agent'}\n >\n {t('webDashboard.orgLibrary.agent', 'Agent plugin')}\n </Button>\n <Button\n variant={kind === 'runtime' ? 'subtle' : 'ghost'}\n onClick={() => setKind('runtime')}\n aria-pressed={kind === 'runtime'}\n >\n {t('webDashboard.orgLibrary.runtime', 'Runtime plugin')}\n </Button>\n </div>\n <Input\n type=\"file\"\n accept={kind === 'agent' ? '.zip,.tgz' : '.tgz'}\n aria-label={t('webDashboard.orgLibrary.archive', 'Plugin archive')}\n onChange={(event) => {\n const next = event.target.files?.[0];\n if (!next) return;\n if (\n (!next.name.toLowerCase().endsWith('.tgz') &&\n !(kind === 'agent' && next.name.toLowerCase().endsWith('.zip'))) ||\n next.size > (next.name.toLowerCase().endsWith('.zip') ? 6 : 32) * 1024 * 1024\n ) {\n setNotice(\n t(\n 'webDashboard.orgLibrary.invalidArchive',\n 'Choose a supported ZIP or tgz archive within the upload limit.',\n ),\n );\n return;\n }\n setFile(next);\n setReview(next.name.toLowerCase().endsWith('.zip') ? 'zip' : 'tgz');\n }}\n />\n </div>\n }\n onReview={(next, item) => {\n if (busy || !verified) return;\n if (next === 'upload' && (environment !== 'cloud' || snapshot?.role === 'member')) return;\n if (next === 'enable' && item) {\n const active = items.find((entry) => entry.enabled && entry.name === item.name && entry.id !== item.id);\n if (active) {\n setSelected({ ...active, update: item });\n setReview('update');\n return;\n }\n }\n if (item) setSelected(item);\n setReview(next);\n }}\n onClose={() => {\n if (!busy) {\n setReview(null);\n setFile(undefined);\n }\n }}\n onConfirm={() => void confirm()}\n onRetry={() => void load()}\n onProvenance={(item) => {\n const pin = snapshot?.releases.find((entry) => libraryReleaseId(entry) === item.id);\n if (pin)\n setNotice(\n JSON.stringify({\n issuer: pin.issuer,\n org: pin.org,\n name: pin.name,\n version: pin.version,\n sha256: pin.sha256,\n integrity: pin.integrity,\n size: pin.size,\n uploader: pin.uploader,\n }),\n );\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,QAAwB;CAAE,IAAI;CAAI,MAAM;CAAI,SAAS;CAAI,SAAS;CAAO,SAAS;AAAM;;AAG9F,SAAgB,aAAa;CAC3B,MAAM,IAAI,KAAK;CACf,MAAM,cAAc,gBAAgB,IAAI,UAAU;CAClD,MAAM,CAAC,UAAU,eAAe,SAA0B;CAC1D,MAAM,CAAC,OAAO,YAAY,SAAwC,SAAS;CAC3E,MAAM,CAAC,KAAK,UAAU,SAAwB,KAAK;CACnD,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CACrC,MAAM,CAA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EACA,eAAe;GACb,IAAI,CAAC,MAAM;IACT,UAAU,IAAI;IACd,QAAQ,KAAA,CAAS;GACnB;EACF;EACA,iBAAiB,KAAK,QAAQ;EAC9B,eAAe,KAAK,KAAK;EACzB,eAAe,SAAS;GACtB,MAAM,MAAM,UAAU,SAAS,MAAM,UAAU,iBAAiB,KAAK,MAAM,KAAK,EAAE;GAClF,IAAI,KACF,UACE,KAAK,UAAU;IACb,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,MAAM,IAAI;IACV,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,WAAW,IAAI;IACf,MAAM,IAAI;IACV,UAAU,IAAI;GAChB,CAAC,CACH;EACJ;CACD,CAAA;AAEL"}
|
package/dist/web/lib/authApi.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const require_auth = require("../../types/auth.cjs");
|
|
2
|
+
const require_selfHostShell = require("./selfHostShell.cjs");
|
|
2
3
|
let _agimon_ai_po_web_security_browser = require("@agimon-ai/po-web-security/browser");
|
|
3
4
|
//#region src/web/lib/authApi.ts
|
|
4
5
|
const GATEWAY_SETTINGS_ROUTE = "/api/plugins/gateway/settings";
|
|
5
6
|
/** A missing optional package is not a provider-auth failure. */
|
|
6
7
|
async function readProviderSharing() {
|
|
8
|
+
if (require_selfHostShell.isSelfHostShell()) return { error: "not-installed" };
|
|
7
9
|
try {
|
|
8
10
|
const response = await (0, _agimon_ai_po_web_security_browser.fetchWithStepUp)(GATEWAY_SETTINGS_ROUTE);
|
|
9
11
|
const body = await response.json().catch(() => void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authApi.cjs","names":["fetchWithStepUp","AUTH_PROVIDERS_API_ROUTE","AUTH_LOGINS_API_ROUTE"],"sources":["../../../src/web/lib/authApi.ts"],"sourcesContent":["import { fetchWithStepUp } from '@agimon-ai/po-web-security/browser';\n\nimport {\n AUTH_LOGINS_API_ROUTE,\n AUTH_PROVIDERS_API_ROUTE,\n type AuthMethodType,\n type LoginFlowSnapshot,\n type ProviderAuthSummary,\n} from '../../types/auth';\n\nexport type ProvidersResult = { providers: ProviderAuthSummary[] } | { error: string };\nexport type LoginFlowResult = { flow: LoginFlowSnapshot } | { error: string };\nexport type LogoutResult = { ok: true } | { error: string };\n\nexport interface GatewaySettings {\n providers: { id: string; shared: boolean }[];\n peers: { hostId: string; machineName?: string; status: 'ok' | 'unreachable' | 'no-https' }[];\n /** The backend's caller locality decision, never inferred from the page URL. */\n editable?: boolean;\n}\n\nconst GATEWAY_SETTINGS_ROUTE = '/api/plugins/gateway/settings';\n\n/** A missing optional package is not a provider-auth failure. */\nexport async function readProviderSharing(): Promise<{ settings: GatewaySettings } | { error: string }> {\n try {\n const response = await fetchWithStepUp(GATEWAY_SETTINGS_ROUTE);\n const body: unknown = await response.json().catch(() => undefined);\n if (response.status === 404 || (response.ok && !isRecord(body))) return { error: 'not-installed' };\n if (response.ok && isRecord(body) && Array.isArray(body.providers) && Array.isArray(body.peers))\n return { settings: body as unknown as GatewaySettings };\n return {\n error: isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`,\n };\n } catch {\n return { error: UNREACHABLE };\n }\n}\n\nexport function writeProviderSharing(providerId: string, shared: boolean): Promise<LogoutResult> {\n return request(\n `/api/plugins/gateway/providers/${encodeURIComponent(providerId)}`,\n { method: 'PUT', headers: JSON_HEADERS, body: JSON.stringify({ shared }) },\n () => ({ ok: true as const }),\n );\n}\n\nconst UNREACHABLE = 'The cockpit hub is unreachable.';\nconst JSON_HEADERS = { 'Content-Type': 'application/json' };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * One shape for every provider-auth call: a network failure, a non-2xx\n * answer, and a 2xx body missing the expected field all come back as\n * `{ error }`, so the settings page has one branch to render.\n */\nasync function request<T>(\n input: string,\n init: RequestInit | undefined,\n pick: (body: Record<string, unknown>) => T | undefined,\n): Promise<T | { error: string }> {\n let response: Response;\n try {\n // Writing or clearing a provider credential redirects the machine's model\n // traffic, so a remote caller answers a passkey challenge for it first.\n response = await fetchWithStepUp(input, init);\n } catch {\n return { error: UNREACHABLE };\n }\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n body = undefined;\n }\n if (response.ok && isRecord(body)) {\n const picked = pick(body);\n if (picked !== undefined) return picked;\n }\n const error = isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`;\n return { error };\n}\n\nconst pickFlow = (body: Record<string, unknown>): { flow: LoginFlowSnapshot } | undefined =>\n isRecord(body.flow) ? { flow: body.flow as unknown as LoginFlowSnapshot } : undefined;\n\n/** Every provider Pi knows on the hub's machine, with its auth state. */\nexport function listProviders(): Promise<ProvidersResult> {\n return request(AUTH_PROVIDERS_API_ROUTE, undefined, (body) =>\n Array.isArray(body.providers) ? { providers: body.providers as ProviderAuthSummary[] } : undefined,\n );\n}\n\n/**\n * A model the person connected: signed in, or given a key. Pi reports an extension's own built-in key (a local\n * bridge registers a placeholder) as source `fallback`; that says nothing about whether the model answers.\n */\nexport function isConnectedModel(provider: ProviderAuthSummary): boolean {\n return (\n provider.kind !== 'po-feature' &&\n provider.authenticated !== undefined &&\n provider.authenticated.source !== 'fallback'\n );\n}\n\n/** Starts a sign-in on the hub; the returned flow is then polled with readLogin. */\nexport function startLogin(providerId: string, type: AuthMethodType): Promise<LoginFlowResult> {\n return request(\n AUTH_LOGINS_API_ROUTE,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ providerId, type }) },\n pickFlow,\n );\n}\n\nexport function readLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, undefined, pickFlow);\n}\n\nexport function answerLogin(flowId: string, promptId: string, value: string): Promise<LoginFlowResult> {\n return request(\n `${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}/answer`,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ promptId, value }) },\n pickFlow,\n );\n}\n\nexport function cancelLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, { method: 'DELETE' }, pickFlow);\n}\n\n/** Removes the credential /login stored; environment variables are untouched. */\nexport function logoutProvider(providerId: string): Promise<LogoutResult> {\n return request(`${AUTH_PROVIDERS_API_ROUTE}/${encodeURIComponent(providerId)}`, { method: 'DELETE' }, () => ({\n ok: true as const,\n }));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"authApi.cjs","names":["isSelfHostShell","fetchWithStepUp","AUTH_PROVIDERS_API_ROUTE","AUTH_LOGINS_API_ROUTE"],"sources":["../../../src/web/lib/authApi.ts"],"sourcesContent":["import { fetchWithStepUp } from '@agimon-ai/po-web-security/browser';\n\nimport {\n AUTH_LOGINS_API_ROUTE,\n AUTH_PROVIDERS_API_ROUTE,\n type AuthMethodType,\n type LoginFlowSnapshot,\n type ProviderAuthSummary,\n} from '../../types/auth';\nimport { isSelfHostShell } from './selfHostShell';\n\nexport type ProvidersResult = { providers: ProviderAuthSummary[] } | { error: string };\nexport type LoginFlowResult = { flow: LoginFlowSnapshot } | { error: string };\nexport type LogoutResult = { ok: true } | { error: string };\n\nexport interface GatewaySettings {\n providers: { id: string; shared: boolean }[];\n peers: { hostId: string; machineName?: string; status: 'ok' | 'unreachable' | 'no-https' }[];\n /** The backend's caller locality decision, never inferred from the page URL. */\n editable?: boolean;\n}\n\nconst GATEWAY_SETTINGS_ROUTE = '/api/plugins/gateway/settings';\n\n/** A missing optional package is not a provider-auth failure. */\nexport async function readProviderSharing(): Promise<{ settings: GatewaySettings } | { error: string }> {\n // A Worker has no local gateway, so the request could only 404.\n if (isSelfHostShell()) return { error: 'not-installed' };\n try {\n const response = await fetchWithStepUp(GATEWAY_SETTINGS_ROUTE);\n const body: unknown = await response.json().catch(() => undefined);\n if (response.status === 404 || (response.ok && !isRecord(body))) return { error: 'not-installed' };\n if (response.ok && isRecord(body) && Array.isArray(body.providers) && Array.isArray(body.peers))\n return { settings: body as unknown as GatewaySettings };\n return {\n error: isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`,\n };\n } catch {\n return { error: UNREACHABLE };\n }\n}\n\nexport function writeProviderSharing(providerId: string, shared: boolean): Promise<LogoutResult> {\n return request(\n `/api/plugins/gateway/providers/${encodeURIComponent(providerId)}`,\n { method: 'PUT', headers: JSON_HEADERS, body: JSON.stringify({ shared }) },\n () => ({ ok: true as const }),\n );\n}\n\nconst UNREACHABLE = 'The cockpit hub is unreachable.';\nconst JSON_HEADERS = { 'Content-Type': 'application/json' };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * One shape for every provider-auth call: a network failure, a non-2xx\n * answer, and a 2xx body missing the expected field all come back as\n * `{ error }`, so the settings page has one branch to render.\n */\nasync function request<T>(\n input: string,\n init: RequestInit | undefined,\n pick: (body: Record<string, unknown>) => T | undefined,\n): Promise<T | { error: string }> {\n let response: Response;\n try {\n // Writing or clearing a provider credential redirects the machine's model\n // traffic, so a remote caller answers a passkey challenge for it first.\n response = await fetchWithStepUp(input, init);\n } catch {\n return { error: UNREACHABLE };\n }\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n body = undefined;\n }\n if (response.ok && isRecord(body)) {\n const picked = pick(body);\n if (picked !== undefined) return picked;\n }\n const error = isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`;\n return { error };\n}\n\nconst pickFlow = (body: Record<string, unknown>): { flow: LoginFlowSnapshot } | undefined =>\n isRecord(body.flow) ? { flow: body.flow as unknown as LoginFlowSnapshot } : undefined;\n\n/** Every provider Pi knows on the hub's machine, with its auth state. */\nexport function listProviders(): Promise<ProvidersResult> {\n return request(AUTH_PROVIDERS_API_ROUTE, undefined, (body) =>\n Array.isArray(body.providers) ? { providers: body.providers as ProviderAuthSummary[] } : undefined,\n );\n}\n\n/**\n * A model the person connected: signed in, or given a key. Pi reports an extension's own built-in key (a local\n * bridge registers a placeholder) as source `fallback`; that says nothing about whether the model answers.\n */\nexport function isConnectedModel(provider: ProviderAuthSummary): boolean {\n return (\n provider.kind !== 'po-feature' &&\n provider.authenticated !== undefined &&\n provider.authenticated.source !== 'fallback'\n );\n}\n\n/** Starts a sign-in on the hub; the returned flow is then polled with readLogin. */\nexport function startLogin(providerId: string, type: AuthMethodType): Promise<LoginFlowResult> {\n return request(\n AUTH_LOGINS_API_ROUTE,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ providerId, type }) },\n pickFlow,\n );\n}\n\nexport function readLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, undefined, pickFlow);\n}\n\nexport function answerLogin(flowId: string, promptId: string, value: string): Promise<LoginFlowResult> {\n return request(\n `${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}/answer`,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ promptId, value }) },\n pickFlow,\n );\n}\n\nexport function cancelLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, { method: 'DELETE' }, pickFlow);\n}\n\n/** Removes the credential /login stored; environment variables are untouched. */\nexport function logoutProvider(providerId: string): Promise<LogoutResult> {\n return request(`${AUTH_PROVIDERS_API_ROUTE}/${encodeURIComponent(providerId)}`, { method: 'DELETE' }, () => ({\n ok: true as const,\n }));\n}\n"],"mappings":";;;;AAsBA,MAAM,yBAAyB;;AAG/B,eAAsB,sBAAkF;CAEtG,IAAIA,sBAAAA,gBAAgB,GAAG,OAAO,EAAE,OAAO,gBAAgB;CACvD,IAAI;EACF,MAAM,WAAW,OAAA,GAAMC,mCAAAA,gBAAAA,CAAgB,sBAAsB;EAC7D,MAAM,OAAgB,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;EAC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
|
1
|
+
{"version":3,"file":"authApi.d.mts","names":[],"sources":["../../../src/web/lib/authApi.ts"],"mappings":";;YAWY;EAAoB,WAAW;;EAA4B;;YAC3D;EAAoB,MAAM;;EAAwB;;YAClD;EAAiB;;EAAe;;iBAE3B;EACf;IAAa;IAAY;;EACzB;IAAS;IAAgB;IAAsB;;;EAE/C;;;wBAMoB,uBAAuB;EAAU,UAAU;;EAAsB;;wBAiBvE,qBAAqB,oBAAoB,kBAAkB,QAAQ;;wBAmDnE,iBAAiB,QAAQ;;;;;wBAUzB,iBAAiB,UAAU;;wBAS3B,WAAW,oBAAoB,MAAM,iBAAiB,QAAQ;wBAQ9D,UAAU,iBAAiB,QAAQ;wBAInC,YAAY,gBAAgB,kBAAkB,gBAAgB,QAAQ;wBAQtE,YAAY,iBAAiB,QAAQ;;wBAKrC,eAAe,qBAAqB,QAAQ"}
|
package/dist/web/lib/authApi.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { AUTH_LOGINS_API_ROUTE, AUTH_PROVIDERS_API_ROUTE } from "../../types/auth.mjs";
|
|
2
|
+
import { isSelfHostShell } from "./selfHostShell.mjs";
|
|
2
3
|
import { fetchWithStepUp } from "@agimon-ai/po-web-security/browser";
|
|
3
4
|
//#region src/web/lib/authApi.ts
|
|
4
5
|
const GATEWAY_SETTINGS_ROUTE = "/api/plugins/gateway/settings";
|
|
5
6
|
/** A missing optional package is not a provider-auth failure. */
|
|
6
7
|
async function readProviderSharing() {
|
|
8
|
+
if (isSelfHostShell()) return { error: "not-installed" };
|
|
7
9
|
try {
|
|
8
10
|
const response = await fetchWithStepUp(GATEWAY_SETTINGS_ROUTE);
|
|
9
11
|
const body = await response.json().catch(() => void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authApi.mjs","names":[],"sources":["../../../src/web/lib/authApi.ts"],"sourcesContent":["import { fetchWithStepUp } from '@agimon-ai/po-web-security/browser';\n\nimport {\n AUTH_LOGINS_API_ROUTE,\n AUTH_PROVIDERS_API_ROUTE,\n type AuthMethodType,\n type LoginFlowSnapshot,\n type ProviderAuthSummary,\n} from '../../types/auth';\n\nexport type ProvidersResult = { providers: ProviderAuthSummary[] } | { error: string };\nexport type LoginFlowResult = { flow: LoginFlowSnapshot } | { error: string };\nexport type LogoutResult = { ok: true } | { error: string };\n\nexport interface GatewaySettings {\n providers: { id: string; shared: boolean }[];\n peers: { hostId: string; machineName?: string; status: 'ok' | 'unreachable' | 'no-https' }[];\n /** The backend's caller locality decision, never inferred from the page URL. */\n editable?: boolean;\n}\n\nconst GATEWAY_SETTINGS_ROUTE = '/api/plugins/gateway/settings';\n\n/** A missing optional package is not a provider-auth failure. */\nexport async function readProviderSharing(): Promise<{ settings: GatewaySettings } | { error: string }> {\n try {\n const response = await fetchWithStepUp(GATEWAY_SETTINGS_ROUTE);\n const body: unknown = await response.json().catch(() => undefined);\n if (response.status === 404 || (response.ok && !isRecord(body))) return { error: 'not-installed' };\n if (response.ok && isRecord(body) && Array.isArray(body.providers) && Array.isArray(body.peers))\n return { settings: body as unknown as GatewaySettings };\n return {\n error: isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`,\n };\n } catch {\n return { error: UNREACHABLE };\n }\n}\n\nexport function writeProviderSharing(providerId: string, shared: boolean): Promise<LogoutResult> {\n return request(\n `/api/plugins/gateway/providers/${encodeURIComponent(providerId)}`,\n { method: 'PUT', headers: JSON_HEADERS, body: JSON.stringify({ shared }) },\n () => ({ ok: true as const }),\n );\n}\n\nconst UNREACHABLE = 'The cockpit hub is unreachable.';\nconst JSON_HEADERS = { 'Content-Type': 'application/json' };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * One shape for every provider-auth call: a network failure, a non-2xx\n * answer, and a 2xx body missing the expected field all come back as\n * `{ error }`, so the settings page has one branch to render.\n */\nasync function request<T>(\n input: string,\n init: RequestInit | undefined,\n pick: (body: Record<string, unknown>) => T | undefined,\n): Promise<T | { error: string }> {\n let response: Response;\n try {\n // Writing or clearing a provider credential redirects the machine's model\n // traffic, so a remote caller answers a passkey challenge for it first.\n response = await fetchWithStepUp(input, init);\n } catch {\n return { error: UNREACHABLE };\n }\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n body = undefined;\n }\n if (response.ok && isRecord(body)) {\n const picked = pick(body);\n if (picked !== undefined) return picked;\n }\n const error = isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`;\n return { error };\n}\n\nconst pickFlow = (body: Record<string, unknown>): { flow: LoginFlowSnapshot } | undefined =>\n isRecord(body.flow) ? { flow: body.flow as unknown as LoginFlowSnapshot } : undefined;\n\n/** Every provider Pi knows on the hub's machine, with its auth state. */\nexport function listProviders(): Promise<ProvidersResult> {\n return request(AUTH_PROVIDERS_API_ROUTE, undefined, (body) =>\n Array.isArray(body.providers) ? { providers: body.providers as ProviderAuthSummary[] } : undefined,\n );\n}\n\n/**\n * A model the person connected: signed in, or given a key. Pi reports an extension's own built-in key (a local\n * bridge registers a placeholder) as source `fallback`; that says nothing about whether the model answers.\n */\nexport function isConnectedModel(provider: ProviderAuthSummary): boolean {\n return (\n provider.kind !== 'po-feature' &&\n provider.authenticated !== undefined &&\n provider.authenticated.source !== 'fallback'\n );\n}\n\n/** Starts a sign-in on the hub; the returned flow is then polled with readLogin. */\nexport function startLogin(providerId: string, type: AuthMethodType): Promise<LoginFlowResult> {\n return request(\n AUTH_LOGINS_API_ROUTE,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ providerId, type }) },\n pickFlow,\n );\n}\n\nexport function readLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, undefined, pickFlow);\n}\n\nexport function answerLogin(flowId: string, promptId: string, value: string): Promise<LoginFlowResult> {\n return request(\n `${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}/answer`,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ promptId, value }) },\n pickFlow,\n );\n}\n\nexport function cancelLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, { method: 'DELETE' }, pickFlow);\n}\n\n/** Removes the credential /login stored; environment variables are untouched. */\nexport function logoutProvider(providerId: string): Promise<LogoutResult> {\n return request(`${AUTH_PROVIDERS_API_ROUTE}/${encodeURIComponent(providerId)}`, { method: 'DELETE' }, () => ({\n ok: true as const,\n }));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"authApi.mjs","names":[],"sources":["../../../src/web/lib/authApi.ts"],"sourcesContent":["import { fetchWithStepUp } from '@agimon-ai/po-web-security/browser';\n\nimport {\n AUTH_LOGINS_API_ROUTE,\n AUTH_PROVIDERS_API_ROUTE,\n type AuthMethodType,\n type LoginFlowSnapshot,\n type ProviderAuthSummary,\n} from '../../types/auth';\nimport { isSelfHostShell } from './selfHostShell';\n\nexport type ProvidersResult = { providers: ProviderAuthSummary[] } | { error: string };\nexport type LoginFlowResult = { flow: LoginFlowSnapshot } | { error: string };\nexport type LogoutResult = { ok: true } | { error: string };\n\nexport interface GatewaySettings {\n providers: { id: string; shared: boolean }[];\n peers: { hostId: string; machineName?: string; status: 'ok' | 'unreachable' | 'no-https' }[];\n /** The backend's caller locality decision, never inferred from the page URL. */\n editable?: boolean;\n}\n\nconst GATEWAY_SETTINGS_ROUTE = '/api/plugins/gateway/settings';\n\n/** A missing optional package is not a provider-auth failure. */\nexport async function readProviderSharing(): Promise<{ settings: GatewaySettings } | { error: string }> {\n // A Worker has no local gateway, so the request could only 404.\n if (isSelfHostShell()) return { error: 'not-installed' };\n try {\n const response = await fetchWithStepUp(GATEWAY_SETTINGS_ROUTE);\n const body: unknown = await response.json().catch(() => undefined);\n if (response.status === 404 || (response.ok && !isRecord(body))) return { error: 'not-installed' };\n if (response.ok && isRecord(body) && Array.isArray(body.providers) && Array.isArray(body.peers))\n return { settings: body as unknown as GatewaySettings };\n return {\n error: isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`,\n };\n } catch {\n return { error: UNREACHABLE };\n }\n}\n\nexport function writeProviderSharing(providerId: string, shared: boolean): Promise<LogoutResult> {\n return request(\n `/api/plugins/gateway/providers/${encodeURIComponent(providerId)}`,\n { method: 'PUT', headers: JSON_HEADERS, body: JSON.stringify({ shared }) },\n () => ({ ok: true as const }),\n );\n}\n\nconst UNREACHABLE = 'The cockpit hub is unreachable.';\nconst JSON_HEADERS = { 'Content-Type': 'application/json' };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * One shape for every provider-auth call: a network failure, a non-2xx\n * answer, and a 2xx body missing the expected field all come back as\n * `{ error }`, so the settings page has one branch to render.\n */\nasync function request<T>(\n input: string,\n init: RequestInit | undefined,\n pick: (body: Record<string, unknown>) => T | undefined,\n): Promise<T | { error: string }> {\n let response: Response;\n try {\n // Writing or clearing a provider credential redirects the machine's model\n // traffic, so a remote caller answers a passkey challenge for it first.\n response = await fetchWithStepUp(input, init);\n } catch {\n return { error: UNREACHABLE };\n }\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n body = undefined;\n }\n if (response.ok && isRecord(body)) {\n const picked = pick(body);\n if (picked !== undefined) return picked;\n }\n const error = isRecord(body) && typeof body.error === 'string' ? body.error : `The hub answered ${response.status}.`;\n return { error };\n}\n\nconst pickFlow = (body: Record<string, unknown>): { flow: LoginFlowSnapshot } | undefined =>\n isRecord(body.flow) ? { flow: body.flow as unknown as LoginFlowSnapshot } : undefined;\n\n/** Every provider Pi knows on the hub's machine, with its auth state. */\nexport function listProviders(): Promise<ProvidersResult> {\n return request(AUTH_PROVIDERS_API_ROUTE, undefined, (body) =>\n Array.isArray(body.providers) ? { providers: body.providers as ProviderAuthSummary[] } : undefined,\n );\n}\n\n/**\n * A model the person connected: signed in, or given a key. Pi reports an extension's own built-in key (a local\n * bridge registers a placeholder) as source `fallback`; that says nothing about whether the model answers.\n */\nexport function isConnectedModel(provider: ProviderAuthSummary): boolean {\n return (\n provider.kind !== 'po-feature' &&\n provider.authenticated !== undefined &&\n provider.authenticated.source !== 'fallback'\n );\n}\n\n/** Starts a sign-in on the hub; the returned flow is then polled with readLogin. */\nexport function startLogin(providerId: string, type: AuthMethodType): Promise<LoginFlowResult> {\n return request(\n AUTH_LOGINS_API_ROUTE,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ providerId, type }) },\n pickFlow,\n );\n}\n\nexport function readLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, undefined, pickFlow);\n}\n\nexport function answerLogin(flowId: string, promptId: string, value: string): Promise<LoginFlowResult> {\n return request(\n `${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}/answer`,\n { method: 'POST', headers: JSON_HEADERS, body: JSON.stringify({ promptId, value }) },\n pickFlow,\n );\n}\n\nexport function cancelLogin(flowId: string): Promise<LoginFlowResult> {\n return request(`${AUTH_LOGINS_API_ROUTE}/${encodeURIComponent(flowId)}`, { method: 'DELETE' }, pickFlow);\n}\n\n/** Removes the credential /login stored; environment variables are untouched. */\nexport function logoutProvider(providerId: string): Promise<LogoutResult> {\n return request(`${AUTH_PROVIDERS_API_ROUTE}/${encodeURIComponent(providerId)}`, { method: 'DELETE' }, () => ({\n ok: true as const,\n }));\n}\n"],"mappings":";;;;AAsBA,MAAM,yBAAyB;;AAG/B,eAAsB,sBAAkF;CAEtG,IAAI,gBAAgB,GAAG,OAAO,EAAE,OAAO,gBAAgB;CACvD,IAAI;EACF,MAAM,WAAW,MAAM,gBAAgB,sBAAsB;EAC7D,MAAM,OAAgB,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;EACjE,IAAI,SAAS,WAAW,OAAQ,SAAS,MAAM,CAAC,SAAS,IAAI,GAAI,O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B,gBAA0C;CACxD,OAAO,QAAQ,0BAA0B,KAAA,IAAY,SACnD,MAAM,QAAQ,KAAK,SAAS,IAAI,EAAE,WAAW,KAAK,UAAmC,IAAI,KAAA,CAC3F;AACF;;;;;AAMA,SAAgB,iBAAiB,UAAwC;CACvE,OACE,SAAS,SAAS,gBAClB,SAAS,kBAAkB,KAAA,KAC3B,SAAS,cAAc,WAAW;AAEtC;;AAGA,SAAgB,WAAW,YAAoB,MAAgD;CAC7F,OAAO,QACL,uBACA;EAAE,QAAQ;EAAQ,SAAS;EAAc,MAAM,KAAK,UAAU;GAAE;GAAY;EAAK,CAAC;CAAE,GACpF,QACF;AACF;AAEA,SAAgB,UAAU,QAA0C;CAClE,OAAO,QAAQ,GAAG,sBAAsB,GAAG,mBAAmB,MAAM,KAAK,KAAA,GAAW,QAAQ;AAC9F;AAEA,SAAgB,YAAY,QAAgB,UAAkB,OAAyC;CACrG,OAAO,QACL,GAAG,sBAAsB,GAAG,mBAAmB,MAAM,EAAE,UACvD;EAAE,QAAQ;EAAQ,SAAS;EAAc,MAAM,KAAK,UAAU;GAAE;GAAU;EAAM,CAAC;CAAE,GACnF,QACF;AACF;AAEA,SAAgB,YAAY,QAA0C;CACpE,OAAO,QAAQ,GAAG,sBAAsB,GAAG,mBAAmB,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,QAAQ;AACzG;;AAGA,SAAgB,eAAe,YAA2C;CACxE,OAAO,QAAQ,GAAG,yBAAyB,GAAG,mBAAmB,UAAU,KAAK,EAAE,QAAQ,SAAS,UAAU,EAC3G,IAAI,KACN,EAAE;AACJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
const require_selfHostShell = require("./selfHostShell.cjs");
|
|
1
2
|
const require_hostIdentity = require("./hostIdentity.cjs");
|
|
2
3
|
const require_homeApps = require("./homeApps.cjs");
|
|
3
4
|
const require_leaderTree = require("./leaderTree.cjs");
|
|
4
5
|
const require_pluginLocales = require("./pluginLocales.cjs");
|
|
5
6
|
const require_pluginScopes = require("./pluginScopes.cjs");
|
|
6
7
|
const require_pluginThemes = require("./pluginThemes.cjs");
|
|
7
|
-
const require_selfHostShell = require("./selfHostShell.cjs");
|
|
8
8
|
const require_templateCatalog = require("./templateCatalog.cjs");
|
|
9
9
|
const require_uiTrace = require("./uiTrace.cjs");
|
|
10
10
|
let _agimon_ai_po_core_web = require("@agimon-ai/po-core/web");
|
|
@@ -720,7 +720,7 @@ function createWebPluginRegistry(hostId) {
|
|
|
720
720
|
function pluginSettingsSections(scope = "host", workspaceId) {
|
|
721
721
|
const sections = (scope === "host" ? defaultState : workspaceState(workspaceId))?.settingsSections ?? [];
|
|
722
722
|
const visible = isDesktopClient() ? sections : sections.filter((section) => !section.desktopOnly);
|
|
723
|
-
if (!require_selfHostShell.isSelfHostShell()
|
|
723
|
+
if (!require_selfHostShell.isSelfHostShell()) return visible;
|
|
724
724
|
return visible.flatMap((section) => {
|
|
725
725
|
const fields = section.fields.filter((field) => !field.localOnly);
|
|
726
726
|
if (fields.length === 0 && section.fields.length > 0) return [];
|