@qwen-code/web-shell 0.28.6 → 0.29.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +26 -3
  2. package/dist/{PierreFilePreview-CAyMSfe1.js → PierreFilePreview-DNzgLsKu.js} +1 -1
  3. package/dist/{SpreadsheetPreview-sCcmRNTT.js → SpreadsheetPreview-B0lqDTmC.js} +2 -2
  4. package/dist/{WorkspaceFileBrowser-DEvIFGbs.js → WorkspaceFileBrowser-Ceci_Ofu.js} +2 -2
  5. package/dist/{WorkspacePdfRangePreview-iMWtsLo7.js → WorkspacePdfRangePreview-BQY92M0Z.js} +2 -2
  6. package/dist/{agents-route-CrZAsZhs.js → agents-route-C5I-mPuv.js} +2 -2
  7. package/dist/daemon-react-sdk.js +1 -1
  8. package/dist/{i18n-ru-C7ncd9S1.js → i18n-ru-LoTd6Qm6.js} +48 -30
  9. package/dist/{i18n-zh-cn-7l1xyTcL.js → i18n-zh-cn-69yYbjuK.js} +46 -18
  10. package/dist/{i18n-zh-tw-DU7AgDPK.js → i18n-zh-tw-BaBS2zL1.js} +58 -6
  11. package/dist/{index-D-5-_HVQ.js → index-D4vi6zJI.js} +84634 -79061
  12. package/dist/index.js +3 -3
  13. package/dist/sw.js +1 -1
  14. package/dist/transcript.js +4852 -4771
  15. package/dist/types/App.d.ts +9 -3
  16. package/dist/types/ManagedAgentWebShell.d.ts +2 -0
  17. package/dist/types/WebShellContexts.d.ts +8 -0
  18. package/dist/types/chat-core/ChatSurface.d.ts +47 -3
  19. package/dist/types/components/ChatContextHeader.d.ts +11 -3
  20. package/dist/types/components/ChatEditor.d.ts +2 -0
  21. package/dist/types/components/ComposerTaskChips.d.ts +4 -0
  22. package/dist/types/components/ComposerUsageStats.d.ts +4 -4
  23. package/dist/types/components/GitBranchIndicator.d.ts +4 -2
  24. package/dist/types/components/GitModePopover.d.ts +2 -1
  25. package/dist/types/components/LocalFilesControl.d.ts +2 -48
  26. package/dist/types/components/LocalFilesPanel.d.ts +52 -0
  27. package/dist/types/components/SessionOverviewPanel.d.ts +3 -2
  28. package/dist/types/components/artifacts/ArtifactPanel.d.ts +19 -2
  29. package/dist/types/components/artifacts/TokenUsageTrend.d.ts +2 -11
  30. package/dist/types/components/artifacts/TurnOutputs.d.ts +9 -0
  31. package/dist/types/components/artifacts/artifact-mime.d.ts +10 -0
  32. package/dist/types/components/artifacts/artifactUtils.d.ts +2 -4
  33. package/dist/types/components/artifacts/tokenUsageTotals.d.ts +60 -11
  34. package/dist/types/components/artifacts/turnOutputSelectors.d.ts +6 -0
  35. package/dist/types/components/artifacts/useArtifactWorkspaceTarget.d.ts +1 -0
  36. package/dist/types/components/channels/ChannelsManagerPage.d.ts +3 -1
  37. package/dist/types/components/composer/composer-integrations.d.ts +14 -0
  38. package/dist/types/components/composer/daemon-composer-integrations.d.ts +7 -0
  39. package/dist/types/components/dialogs/ScheduledTasksDialog.d.ts +21 -1
  40. package/dist/types/components/dialogs/WorkspaceHooksDialog.d.ts +9 -0
  41. package/dist/types/components/dialogs/scheduledTasksSchedule.d.ts +8 -0
  42. package/dist/types/components/extensions/ExtensionsManagerPage.d.ts +3 -1
  43. package/dist/types/components/managed/ManagedDiagnosticsPanel.d.ts +3 -1
  44. package/dist/types/components/managed/chat-controller.d.ts +1 -0
  45. package/dist/types/components/managed/managed-diagnostics-messages.d.ts +1 -1
  46. package/dist/types/components/managed/managed-usage-stats.d.ts +18 -0
  47. package/dist/types/components/managed/use-managed-actions.d.ts +6 -2
  48. package/dist/types/components/managed/use-managed-chat-controller.d.ts +32 -1
  49. package/dist/types/components/messages/MemoryMessage.d.ts +2 -1
  50. package/dist/types/components/messages/SettingsMessage.d.ts +13 -5
  51. package/dist/types/components/panels/EnvironmentPanel.d.ts +13 -1
  52. package/dist/types/components/plugins/PluginManagerPage.d.ts +3 -1
  53. package/dist/types/components/sidebar/ArchivedSessionsPanel.d.ts +53 -0
  54. package/dist/types/components/sidebar/StandaloneRecents.d.ts +8 -1
  55. package/dist/types/components/sidebar/WebShellSidebar.d.ts +8 -5
  56. package/dist/types/components/sidebar/WorkspaceDetailsTooltip.d.ts +12 -1
  57. package/dist/types/components/sidebar/WorkspaceMenu.d.ts +9 -2
  58. package/dist/types/components/sidebar/WorkspaceSection.d.ts +5 -1
  59. package/dist/types/components/sidebar/archived-session-sort.d.ts +14 -0
  60. package/dist/types/components/sidebar/archived-sessions-messages.d.ts +10 -0
  61. package/dist/types/components/sidebar/archived-sessions-messages.transcript-stub.d.ts +8 -0
  62. package/dist/types/components/sidebar/workspaceOverviewModel.d.ts +4 -2
  63. package/dist/types/components/workspace-agents/useAgentChatEntry.d.ts +3 -1
  64. package/dist/types/components/workspaces/WorkspaceDirectoriesSection.d.ts +3 -1
  65. package/dist/types/components/workspaces/use-workspace-trust-grant.d.ts +18 -0
  66. package/dist/types/customization.d.ts +12 -2
  67. package/dist/types/daemon/availability-context.d.ts +2 -1
  68. package/dist/types/daemon/availability.d.ts +4 -3
  69. package/dist/types/daemon/permission-signals.d.ts +0 -12
  70. package/dist/types/daemon/remotePromptSidechannel.d.ts +1 -8
  71. package/dist/types/daemon/session/DaemonSessionProvider.d.ts +1 -0
  72. package/dist/types/daemon/session/actions.d.ts +5 -2
  73. package/dist/types/daemon/session/httpErrors.d.ts +1 -0
  74. package/dist/types/daemon/session/types.d.ts +25 -5
  75. package/dist/types/daemon/timing.d.ts +1 -1
  76. package/dist/types/daemon/useDaemonChatController.d.ts +21 -1
  77. package/dist/types/daemon/workspace/hooks/useDaemonMemory.d.ts +5 -1
  78. package/dist/types/daemon/workspace/hooks/useDaemonOverloadPause.d.ts +41 -0
  79. package/dist/types/daemon/workspace/hooks/useDaemonSessions.d.ts +1 -0
  80. package/dist/types/daemon/workspace/hooks/useDaemonSettings.d.ts +5 -1
  81. package/dist/types/daemon/workspace/types.d.ts +10 -3
  82. package/dist/types/hooks/composer-draft-session.d.ts +7 -3
  83. package/dist/types/hooks/useBackgroundTasks.d.ts +7 -2
  84. package/dist/types/hooks/useComposerCore.d.ts +14 -1
  85. package/dist/types/hooks/useInputHistory.d.ts +4 -1
  86. package/dist/types/hooks/useScopedSessions.d.ts +1 -0
  87. package/dist/types/hooks/useSessionScheduledTasks.d.ts +97 -0
  88. package/dist/types/session-catalog/session-catalog-hooks.d.ts +1 -0
  89. package/dist/types/settings.d.ts +2 -1
  90. package/dist/types/utils/action-timeout.d.ts +6 -0
  91. package/dist/types/utils/remote-prompt-sidechannel.d.ts +13 -0
  92. package/dist/types/utils/scheduledTaskManualRun.d.ts +29 -0
  93. package/dist/types/utils/service-availability.d.ts +20 -0
  94. package/dist/types/utils/sessionPreparation.d.ts +2 -1
  95. package/dist/types/utils/shell-result-display.d.ts +26 -0
  96. package/dist/types/utils/taskActivity.d.ts +6 -0
  97. package/dist/{useDaemonMidTurnInjected-jDVqCK0b.js → useDaemonMidTurnInjected-BItW6Ibf.js} +7996 -7670
  98. package/package.json +1 -1
@@ -0,0 +1,53 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { DaemonSessionSummary } from '@qwen-code/sdk/daemon';
3
+ import type { ArchivedConversationType, ArchivedSessionSort } from './archived-session-sort';
4
+ export interface ArchivedTypeOption {
5
+ value: ArchivedConversationType;
6
+ label: string;
7
+ }
8
+ export interface ArchivedSortOption {
9
+ value: ArchivedSessionSort;
10
+ label: string;
11
+ }
12
+ export interface ArchivedWorkspaceOption {
13
+ value: string;
14
+ label: string;
15
+ count?: number;
16
+ }
17
+ export interface ArchivedWorkspaceGroup {
18
+ cwd: string;
19
+ label: string;
20
+ sessions: DaemonSessionSummary[];
21
+ hasMore: boolean;
22
+ loadingMore: boolean;
23
+ loadMoreError?: string;
24
+ }
25
+ export type ArchivedEmptyState = 'none' | 'retry' | 'filtered' | 'workspace' | 'empty';
26
+ interface ArchivedSessionsPanelProps {
27
+ searchQuery: string;
28
+ onSearchQueryChange: (value: string) => void;
29
+ typeFilter: ArchivedConversationType;
30
+ onTypeFilterChange: (value: ArchivedConversationType) => void;
31
+ typeOptions: ArchivedTypeOption[];
32
+ sortBy: ArchivedSessionSort;
33
+ onSortByChange: (value: ArchivedSessionSort) => void;
34
+ sortOptions: ArchivedSortOption[];
35
+ workspaceFilter: string;
36
+ onWorkspaceFilterChange: (value: string) => void;
37
+ workspaceOptions: ArchivedWorkspaceOption[];
38
+ showWorkspaceFilter: boolean;
39
+ workspaceGroups: ArchivedWorkspaceGroup[];
40
+ renderSession: (session: DaemonSessionSummary) => ReactNode;
41
+ onLoadMoreWorkspace: (cwd: string) => void;
42
+ managedContent?: ReactNode;
43
+ standaloneContent?: ReactNode;
44
+ showPaginationSortHint: boolean;
45
+ emptyState: ArchivedEmptyState;
46
+ showFooterRetry: boolean;
47
+ onRetry: () => void;
48
+ onClearFilters: () => void;
49
+ onShowAllWorkspaces: () => void;
50
+ formatGroupCount: (count: number, hasMore: boolean) => string;
51
+ }
52
+ export declare function ArchivedSessionsPanel({ searchQuery, onSearchQueryChange, typeFilter, onTypeFilterChange, typeOptions, sortBy, onSortByChange, sortOptions, workspaceFilter, onWorkspaceFilterChange, workspaceOptions, showWorkspaceFilter, workspaceGroups, renderSession, onLoadMoreWorkspace, managedContent, standaloneContent, showPaginationSortHint, emptyState, showFooterRetry, onRetry, onClearFilters, onShowAllWorkspaces, formatGroupCount, }: ArchivedSessionsPanelProps): import("react/jsx-runtime").JSX.Element;
53
+ export {};
@@ -1,13 +1,18 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type DaemonSessionArchiveState, type DaemonStandaloneSessionSummary } from '@qwen-code/sdk/daemon';
3
+ import { type ArchivedSessionSort } from './archived-session-sort';
3
4
  interface StandaloneRecentsProps {
4
5
  sortBy?: 'updatedAt' | 'lastUserPromptAt';
6
+ clientSort?: ArchivedSessionSort;
5
7
  archiveState: DaemonSessionArchiveState;
6
8
  currentSessionId?: string;
7
9
  currentSessionReady?: boolean;
8
10
  refreshKey?: number;
9
11
  searchQuery?: string;
12
+ hideWhenSearchEmpty?: boolean;
13
+ groupCountLabel?: (count: number, hasMore: boolean) => string;
10
14
  onNewSession?: () => void;
15
+ newSessionDisabled?: boolean;
11
16
  renderSession: (session: DaemonStandaloneSessionSummary, options: {
12
17
  active: boolean;
13
18
  busy: boolean;
@@ -24,11 +29,13 @@ interface StandaloneRecentsProps {
24
29
  onMutated?: () => void;
25
30
  onStatusChange?: (status: {
26
31
  count: number;
32
+ matchedCount?: number;
33
+ hasMore?: boolean;
27
34
  loading: boolean;
28
35
  error: boolean;
29
36
  }) => void;
30
37
  onError: (error: unknown, fallback: string) => void;
31
38
  onNotice: (message: string) => void;
32
39
  }
33
- export declare function StandaloneRecents({ sortBy, archiveState, currentSessionId, currentSessionReady, refreshKey, searchQuery, onNewSession, renderSession, onLoadSession, onRenameSession, onMutated, onStatusChange, onError, onNotice, }: StandaloneRecentsProps): import("react/jsx-runtime").JSX.Element | null;
40
+ export declare function StandaloneRecents({ sortBy, clientSort, archiveState, currentSessionId, currentSessionReady, refreshKey, searchQuery, hideWhenSearchEmpty, groupCountLabel, onNewSession, newSessionDisabled, renderSession, onLoadSession, onRenameSession, onMutated, onStatusChange, onError, onNotice, }: StandaloneRecentsProps): import("react/jsx-runtime").JSX.Element | null;
34
41
  export {};
@@ -105,6 +105,11 @@ interface WebShellSidebarProps {
105
105
  /** Whether to offer the in-window split view (large screens only). */
106
106
  canOpenSplitView?: boolean;
107
107
  onNewSession: (workspaceCwd?: string) => Promise<boolean> | boolean;
108
+ /** Load-admission pause: while true the create entry points are disabled
109
+ * and a warning strip explains the daemon overload. */
110
+ overloadPaused?: boolean;
111
+ overloadDetail?: string;
112
+ onOverloadRefused?: () => void;
108
113
  onNewStandaloneSession?: () => Promise<boolean> | boolean;
109
114
  standaloneSessionsReloadToken?: number;
110
115
  onLoadSession: (sessionId: string, workspaceCwd?: string, artifactCount?: number) => Promise<void> | void;
@@ -182,10 +187,8 @@ interface WebShellSidebarProps {
182
187
  */
183
188
  workspaceOverview?: false | WebShellSidebarWorkspaceOverviewOptions;
184
189
  /**
185
- * Open a management page (MCP, skills, …) for a workspace. Offered on the
186
- * daemon's primary workspace only: the management pages read the
187
- * connection's bound workspace, so another workspace's row cannot open its
188
- * own view yet (#10399, layer B1).
190
+ * Open a management page (MCP, skills, extensions, channels, settings,
191
+ * context, hooks) scoped to the clicked workspace.
189
192
  */
190
193
  onOpenWorkspaceManagement?: (target: WorkspaceManagementTarget, workspaceCwd: string) => void;
191
194
  /** Start a new session that works in an isolated git worktree. */
@@ -194,4 +197,4 @@ interface WebShellSidebarProps {
194
197
  onLoadStandaloneSession?: (sessionId: string, displayName?: string) => Promise<void> | void;
195
198
  onStandaloneNotice?: (message: string) => void;
196
199
  }
197
- export declare function WebShellSidebar({ collapsed, layout, activePage, containerWidth, onOpenHome, onCollapsedChange, onOpenSettings, canOpenSettings, onOpenAgents, onOpenPlugins, onOpenChannels, onOpenChannelEvents, onOpenLive, onLiveVoiceSlotChange, onOpenManagedSessions, onOpenDaemonStatus, onOpenScheduledTasks, onOpenPrWatches, onOpenWorkflows, onOpenGoals, onOpenArtifacts, onOpenSessions, canOpenSessionsOverview, onOpenWorkspacesOverview, onOpenSplitView, onAddSessionToSplitView, splitSessionIds, canOpenSplitView, onNewSession, onNewStandaloneSession, standaloneSessionsReloadToken, onLoadSession, onOpenHostSession, onSelectCurrentSession, onSessionArchived, onSessionRenameConfirmed, onSessionsDeleted, onError, theme, onThemeChange, mobileOpen, onMobileClose, selectedWorkspaceCwd, onSelectWorkspace, onOpenGitDiff, onOpenCommit, onOpenAddWorkspace, workspaces: providedWorkspaces, lockedWorkspaceCwd, lockedWorkspace: lockedWorkspaceOptions, branding, primaryNav: primaryNavOptions, sessionContent, sessionHeader, managedWorkspaces, managedArchivedSessions, archivedSessionsTarget, onSearchQueryChange, currentSessionActive, showSessionSourceSwitch, showLive, hideProjectHeader, sessionActions: sessionActionsOptions, footer, workspaceOverview, onOpenWorkspaceManagement, onNewWorktreeSession, projectFeaturesEnabled, onLoadStandaloneSession, onStandaloneNotice, }: WebShellSidebarProps): import("react/jsx-runtime").JSX.Element;
200
+ export declare function WebShellSidebar({ collapsed, layout, activePage, containerWidth, onOpenHome, onCollapsedChange, onOpenSettings, canOpenSettings, onOpenAgents, onOpenPlugins, onOpenChannels, onOpenChannelEvents, onOpenLive, onLiveVoiceSlotChange, onOpenManagedSessions, onOpenDaemonStatus, onOpenScheduledTasks, onOpenPrWatches, onOpenWorkflows, onOpenGoals, onOpenArtifacts, onOpenSessions, canOpenSessionsOverview, onOpenWorkspacesOverview, onOpenSplitView, onAddSessionToSplitView, splitSessionIds, canOpenSplitView, onNewSession, overloadPaused, overloadDetail, onOverloadRefused, onNewStandaloneSession, standaloneSessionsReloadToken, onLoadSession, onOpenHostSession, onSelectCurrentSession, onSessionArchived, onSessionRenameConfirmed, onSessionsDeleted, onError, theme, onThemeChange, mobileOpen, onMobileClose, selectedWorkspaceCwd, onSelectWorkspace, onOpenGitDiff, onOpenCommit, onOpenAddWorkspace, workspaces: providedWorkspaces, lockedWorkspaceCwd, lockedWorkspace: lockedWorkspaceOptions, branding, primaryNav: primaryNavOptions, sessionContent, sessionHeader, managedWorkspaces, managedArchivedSessions, archivedSessionsTarget, onSearchQueryChange, currentSessionActive, showSessionSourceSwitch, showLive, hideProjectHeader, sessionActions: sessionActionsOptions, footer, workspaceOverview, onOpenWorkspaceManagement, onNewWorktreeSession, projectFeaturesEnabled, onLoadStandaloneSession, onStandaloneNotice, }: WebShellSidebarProps): import("react/jsx-runtime").JSX.Element;
@@ -37,6 +37,17 @@ interface WorkspaceDetailsTooltipProps {
37
37
  onBranchChanged: () => void;
38
38
  };
39
39
  onOpenChange?: (open: boolean) => void;
40
+ /**
41
+ * Optional handler invoked when the user clicks a manageable overview row
42
+ * (MCP, skills, extensions, channels, context, hooks). Rows without a
43
+ * handler or excluded by `manageableItems` stay read-only.
44
+ */
45
+ onOpenOverviewItem?: (item: WorkspaceOverviewItem) => void;
46
+ /**
47
+ * Subset of overview facets that render as clickable management rows when
48
+ * `onOpenOverviewItem` is provided. Defaults to all items when omitted.
49
+ */
50
+ manageableItems?: ReadonlySet<WorkspaceOverviewItem>;
40
51
  children: ReactElement;
41
52
  }
42
53
  /**
@@ -45,5 +56,5 @@ interface WorkspaceDetailsTooltipProps {
45
56
  * takes no persistent space, so known facets show even when their count is
46
57
  * zero; only unknown (unreported) facets stay hidden.
47
58
  */
48
- export declare function WorkspaceDetailsTooltip({ label, cwd, branch, gitStatus, sessions, overview, items, onOpenPathLocally, onOpenTerminalLocally, gitActions, onOpenChange, children, }: WorkspaceDetailsTooltipProps): import("react/jsx-runtime").JSX.Element;
59
+ export declare function WorkspaceDetailsTooltip({ label, cwd, branch, gitStatus, sessions, overview, items, onOpenPathLocally, onOpenTerminalLocally, gitActions, onOpenChange, onOpenOverviewItem, manageableItems, children, }: WorkspaceDetailsTooltipProps): import("react/jsx-runtime").JSX.Element;
49
60
  export {};
@@ -6,13 +6,15 @@
6
6
  import { type ComponentProps, type CSSProperties } from 'react';
7
7
  import type { DaemonWorkspaceCapability } from '@qwen-code/sdk/daemon';
8
8
  import { DropdownMenuContent } from '../ui/dropdown-menu';
9
- import { type WorkspaceManagementTarget, type WorkspaceOverviewSnapshot } from './workspaceOverviewModel';
9
+ import { type WorkspaceMenuManagementTarget, type WorkspaceOverviewSnapshot } from './workspaceOverviewModel';
10
10
  /**
11
11
  * Every action is optional: the sidebar passes only what the workspace's
12
12
  * trust, lock and registration state allows, and the menu lays out whatever
13
13
  * it gets. An empty action set renders nothing.
14
14
  */
15
15
  export interface WorkspaceMenuActions {
16
+ trust?: () => void;
17
+ trustPending?: boolean;
16
18
  rename?: () => void;
17
19
  copyPath?: () => void;
18
20
  openFolder?: () => void;
@@ -22,7 +24,12 @@ export interface WorkspaceMenuActions {
22
24
  createGroup?: () => void;
23
25
  moveUp?: () => void;
24
26
  moveDown?: () => void;
25
- openManagement?: (target: WorkspaceManagementTarget) => void;
27
+ openManagement?: (target: WorkspaceMenuManagementTarget) => void;
28
+ /**
29
+ * Subset of menu management targets offered for this workspace. When
30
+ * omitted, all five targets are offered whenever `openManagement` is set.
31
+ */
32
+ managementTargets?: readonly WorkspaceMenuManagementTarget[];
26
33
  reload?: () => void;
27
34
  remove?: () => void;
28
35
  }
@@ -142,6 +142,10 @@ interface WorkspaceSectionProps {
142
142
  onOpenGitDiff?: (workspaceCwd: string) => void;
143
143
  /** Commit entry for the same picker; the row still opens without it. */
144
144
  onOpenCommit?: (workspaceCwd: string) => void;
145
+ /** Opens the management view for a clicked overview facet in this workspace. */
146
+ onOpenOverviewItem?: (item: WorkspaceOverviewItem, workspaceCwd: string) => void;
147
+ /** Facets that render as interactive rows in the hover details popover. */
148
+ manageableOverviewItems?: ReadonlySet<WorkspaceOverviewItem>;
145
149
  }
146
- export declare function WorkspaceSection({ workspace, executionLabel, storageKey, remote, renderHeader, hideHeader, client, reloadToken, untrustedLabel, readOnlyLabel, trustToOpenLabel, noSessionsLabel, loadErrorLabel, untitledSessionLabel, organizationEnabled, sessionCatalogRequestsEnabled, sessionGroupCatalog, sessionLiveStateEnabled, sortBy, sourceType, channelGroupingEnabled, ungroupedLabel, searchQuery, expanded: controlledExpanded, expansionRequest, temporarilyCollapsed, dragHandleProps, autoExpandKey, forceAutoExpand, onExpandedChange, renderSessions, renderSession, pendingSession, mapSession, showSessionDetails, headerActions, overviewEnabled, overviewMenuOpen, overviewItems, gitBranchWanted, sessionStats, onRenameGroup, onDeleteGroup, renameGroupLabel, deleteGroupLabel, groupActionsDisabled, excludePinned, limitSessions, editingSessionId, isPinnedSectionMember, onOpenPathLocally, onOpenTerminalLocally, onOpenGitDiff, onOpenCommit, }: WorkspaceSectionProps): import("react/jsx-runtime").JSX.Element;
150
+ export declare function WorkspaceSection({ workspace, executionLabel, storageKey, remote, renderHeader, hideHeader, client, reloadToken, untrustedLabel, readOnlyLabel, trustToOpenLabel, noSessionsLabel, loadErrorLabel, untitledSessionLabel, organizationEnabled, sessionCatalogRequestsEnabled, sessionGroupCatalog, sessionLiveStateEnabled, sortBy, sourceType, channelGroupingEnabled, ungroupedLabel, searchQuery, expanded: controlledExpanded, expansionRequest, temporarilyCollapsed, dragHandleProps, autoExpandKey, forceAutoExpand, onExpandedChange, renderSessions, renderSession, pendingSession, mapSession, showSessionDetails, headerActions, overviewEnabled, overviewMenuOpen, overviewItems, gitBranchWanted, sessionStats, onRenameGroup, onDeleteGroup, renameGroupLabel, deleteGroupLabel, groupActionsDisabled, excludePinned, limitSessions, editingSessionId, isPinnedSectionMember, onOpenPathLocally, onOpenTerminalLocally, onOpenGitDiff, onOpenCommit, onOpenOverviewItem, manageableOverviewItems, }: WorkspaceSectionProps): import("react/jsx-runtime").JSX.Element;
147
151
  export {};
@@ -0,0 +1,14 @@
1
+ import type { DaemonSessionSummary } from '@qwen-code/sdk/daemon';
2
+ export type ArchivedSessionSort = 'updatedAt' | 'lastUserPromptAt' | 'createdAt' | 'alphabetical';
3
+ export type ArchivedConversationType = 'all' | 'tasks' | 'channels' | 'local' | 'cloud';
4
+ export type ArchivedTimestampKind = 'updatedAt' | 'lastUserPromptAt' | 'createdAt';
5
+ export declare function readArchivedSessionSort(host: string): ArchivedSessionSort;
6
+ export declare function writeArchivedSessionSort(host: string, sort: ArchivedSessionSort): void;
7
+ export declare function toServerArchivedSortBy(sort: ArchivedSessionSort, questionSortSupported: boolean): 'updatedAt' | 'lastUserPromptAt' | undefined;
8
+ export declare function resolveArchivedSessionTimestamp(session: DaemonSessionSummary, sort: ArchivedSessionSort): {
9
+ iso: string;
10
+ kind: ArchivedTimestampKind;
11
+ } | undefined;
12
+ export declare function formatArchivedTimestamp(iso: string, language: string): string;
13
+ export declare function compareArchivedSessions(a: DaemonSessionSummary, b: DaemonSessionSummary, sort: ArchivedSessionSort): number;
14
+ export declare function matchesArchivedSearch(session: DaemonSessionSummary, rawQuery: string): boolean;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ type MessageEntry = string | ((vars?: Record<string, string | number>) => string);
7
+ export declare const ARCHIVED_SESSIONS_MESSAGES_EN: Record<string, MessageEntry>;
8
+ export declare const ARCHIVED_SESSIONS_MESSAGES_ZH: Record<string, MessageEntry>;
9
+ export declare const ARCHIVED_SESSIONS_MESSAGES_RU: Record<string, MessageEntry>;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export declare const ARCHIVED_SESSIONS_MESSAGES_EN: {};
7
+ export declare const ARCHIVED_SESSIONS_MESSAGES_ZH: {};
8
+ export declare const ARCHIVED_SESSIONS_MESSAGES_RU: {};
@@ -14,8 +14,10 @@ export declare const WORKSPACE_OVERVIEW_ITEMS: readonly ["mcp", "skills", "exten
14
14
  export type WorkspaceOverviewItem = (typeof WORKSPACE_OVERVIEW_ITEMS)[number];
15
15
  /** Hooks are opt-in: most workspaces have none and the chip would only add noise. */
16
16
  export declare const DEFAULT_WORKSPACE_OVERVIEW_ITEMS: readonly WorkspaceOverviewItem[];
17
- /** Management pages a workspace row can open for itself. */
18
- export type WorkspaceManagementTarget = 'mcp' | 'skills' | 'extensions' | 'channels' | 'settings';
17
+ /** Management pages exposed inside the workspace `⋮` menu. */
18
+ export type WorkspaceMenuManagementTarget = 'mcp' | 'skills' | 'extensions' | 'channels' | 'settings';
19
+ /** Management targets a workspace row or hover details popover can open. */
20
+ export type WorkspaceManagementTarget = WorkspaceMenuManagementTarget | 'context' | 'hooks';
19
21
  export interface WorkspaceSessionStats {
20
22
  /** Sessions in the list the stats were computed from. */
21
23
  total: number;
@@ -82,7 +82,9 @@ export declare function useAgentChatEntry({ enabled, cwd, baseUrl, token, client
82
82
  * same lazy creation an ordinary first prompt goes through), with the
83
83
  * workspace it was created in.
84
84
  */
85
- ensureSession: () => Promise<AgentMentionSession | string | undefined>;
85
+ ensureSession: () => Promise<AgentMentionSession | string | {
86
+ paused: true;
87
+ } | undefined>;
86
88
  onSubmit: Submit;
87
89
  onError: (message: string) => void;
88
90
  /** Offered as the picker's last item: open the New agent page. */
@@ -8,4 +8,6 @@
8
8
  * panel. Adds and removes go through the daemon's workspace-directory route,
9
9
  * which applies them to live sessions and persists the workspace setting.
10
10
  */
11
- export declare function WorkspaceDirectoriesSection(): import("react/jsx-runtime").JSX.Element | null;
11
+ export declare function WorkspaceDirectoriesSection({ workspaceCwd: requestedWorkspaceCwd, }?: {
12
+ workspaceCwd?: string;
13
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { DaemonClient, DaemonWorkspaceCapability } from '@qwen-code/sdk/daemon';
7
+ export interface UseWorkspaceTrustGrantOptions {
8
+ client: DaemonClient;
9
+ workspaces: readonly DaemonWorkspaceCapability[];
10
+ refreshCapabilities?: () => Promise<unknown>;
11
+ onError: (error: unknown, message: string) => void;
12
+ errorMessage: string;
13
+ }
14
+ export interface WorkspaceTrustGrantState {
15
+ trustPendingCwd: string | null;
16
+ grantTrust: (ws: DaemonWorkspaceCapability) => void;
17
+ }
18
+ export declare function useWorkspaceTrustGrant({ client, workspaces, refreshCapabilities, onError, errorMessage, }: UseWorkspaceTrustGrantOptions): WorkspaceTrustGrantState;
@@ -136,7 +136,7 @@ export interface ToolHeaderExtraRenderInfo {
136
136
  export type ToolHeaderExtraRenderer = (info: ToolHeaderExtraRenderInfo) => ReactNode;
137
137
  export type WelcomeHeaderRenderer = (props: WelcomeHeaderProps) => ReactNode;
138
138
  export type WelcomeFooterRenderer = (props: WelcomeHeaderProps) => ReactNode;
139
- export type WebShellChatHeaderItem = 'title' | 'environment' | 'rightPanel' | 'artifacts' | 'tokenUsage' | 'contextUsage';
139
+ export type WebShellChatHeaderItem = 'title' | 'environment' | 'rightPanel' | 'scheduledTasks' | 'artifacts' | 'tokenUsage' | 'contextUsage';
140
140
  export interface WebShellChatHeaderOptions {
141
141
  /** Show the mobile-access QR entry in chat headers. Defaults to false. */
142
142
  showMobileAccess?: boolean;
@@ -148,7 +148,7 @@ export interface WebShellRightPanelOptions {
148
148
  /** Empty-state actions to show. Defaults to review and sideTask. */
149
149
  items?: readonly WebShellRightPanelItem[];
150
150
  }
151
- export type WebShellEnvironmentPanelItem = 'environment' | 'sources' | 'subagents' | 'backgroundTasks'
151
+ export type WebShellEnvironmentPanelItem = 'environment' | 'sources' | 'subagents' | 'backgroundTasks' | 'scheduledTasks'
152
152
  /** Legacy attachment-only view in the Sources section. */
153
153
  | 'attachments' | 'artifacts';
154
154
  export interface WebShellEnvironmentPanelOptions {
@@ -200,6 +200,14 @@ export interface ChatHeaderRenderInfo {
200
200
  * not while unrelated right-panel tabs are open.
201
201
  */
202
202
  artifactsTabActive?: boolean;
203
+ /** Scheduled tasks belonging to this session, including paused entries. */
204
+ scheduledTaskCount?: number;
205
+ /** Scheduled tasks in this session that can still fire. */
206
+ scheduledTaskActiveCount?: number;
207
+ /** Earliest next fire time among active session tasks. */
208
+ scheduledTaskNextRunAt?: number | null;
209
+ /** Opens this session's scheduled-tasks section when the host includes it. */
210
+ onOpenScheduledTasks?: () => void;
203
211
  /** Opens Settings deep-linked to Local Control (Daemon category). */
204
212
  onOpenLocalControlSettings?: () => void;
205
213
  }
@@ -436,6 +444,8 @@ export interface WebShellComposerApi {
436
444
  focus?(): void;
437
445
  insertText(text: string, options?: WebShellComposerTextOptions): void;
438
446
  setText(text: string): void;
447
+ /** Saves the current nonblank prompt text to Input history without sending it. */
448
+ saveCurrentDraftToHistory(): void;
439
449
  addTags(tags: readonly WebShellComposerTag[], options?: WebShellComposerTagOptions): void;
440
450
  removeTag(id: string): void;
441
451
  /** Clears text and/or top tags. Inline tags are part of the editor text. */
@@ -1,4 +1,5 @@
1
+ import type { Context } from 'react';
1
2
  import type { DaemonAvailability, DaemonAvailabilityState } from './availability.js';
2
- export declare const DaemonAvailabilityContext: import("react").Context<DaemonAvailability | undefined>;
3
+ export declare const DaemonAvailabilityContext: Context<DaemonAvailability | undefined>;
3
4
  export declare function useDaemonAvailabilityController(): DaemonAvailability | undefined;
4
5
  export declare function useDaemonAvailability(): DaemonAvailabilityState;
@@ -5,15 +5,16 @@
5
5
  */
6
6
  import { DaemonClient } from '@qwen-code/sdk/daemon';
7
7
  import type { DaemonCapabilities, DaemonClientOptions, DaemonTransport } from '@qwen-code/sdk/daemon';
8
- export type DaemonAvailabilityState = 'available' | 'unavailable' | 'auth-required';
9
- export declare class DaemonUnavailableError extends Error {
8
+ import { ServiceUnavailableError, type ServiceAvailabilityController, type ServiceAvailabilityState } from '../utils/service-availability.js';
9
+ export type DaemonAvailabilityState = ServiceAvailabilityState;
10
+ export declare class DaemonUnavailableError extends ServiceUnavailableError {
10
11
  constructor();
11
12
  }
12
13
  export declare function isDaemonUnavailableError(error: unknown): boolean;
13
14
  export declare function findDaemonAvailability(baseUrl: string, token?: string, client?: DaemonClient): DaemonAvailability | undefined;
14
15
  export declare function registerDaemonAvailability(baseUrl: string, token: string | undefined, availability: DaemonAvailability): () => void;
15
16
  /** One recovery loop for all requests owned by an active daemon connection. */
16
- export declare class DaemonAvailability {
17
+ export declare class DaemonAvailability implements ServiceAvailabilityController {
17
18
  private baseUrl;
18
19
  private token?;
19
20
  private nativeFetch;
@@ -1,16 +1,4 @@
1
- import type { DaemonTranscriptBlock } from '@qwen-code/sdk/daemon';
2
1
  import type { DaemonDecisionSettlement } from './chat-controller.js';
3
- /**
4
- * The option id a question answer must vote to be applied. A question is
5
- * answered by selecting its submit (`allow_once`) option with the answers
6
- * attached — the same wire shape `AskUserQuestion.handleSubmit` uses. Voting
7
- * with no option id sends a `cancelled` outcome, which discards the answers and
8
- * cancels the question, so the submit option is required. Returns undefined when
9
- * the request is not pending or has no submit option.
10
- */
11
- export declare function questionSubmitOptionId(pendingPermissions: ReadonlyArray<Extract<DaemonTranscriptBlock, {
12
- kind: 'permission';
13
- }>>, requestId: string): string | undefined;
14
2
  /**
15
3
  * The permission-derived signals the daemon controller needs but the provider
16
4
  * does not expose as explicit channels: approval currency and decision
@@ -3,11 +3,4 @@
3
3
  * Copyright 2026 Qwen Team
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export interface RemotePromptSidechannelEvent {
7
- sessionId: string;
8
- kind: 'prompt';
9
- }
10
- type RemotePromptListener = (event: RemotePromptSidechannelEvent) => void;
11
- export declare function subscribeSidechannelRemotePrompt(listener: RemotePromptListener): () => void;
12
- export declare function publishSidechannelRemotePrompt(event: RemotePromptSidechannelEvent): void;
13
- export {};
6
+ export { publishSidechannelRemotePrompt, subscribeSidechannelRemotePrompt, type RemotePromptSidechannelEvent, } from '../utils/remote-prompt-sidechannel.js';
@@ -39,6 +39,7 @@ export declare function useDaemonSessionOwnerGuard(): DaemonSessionOwnerGuard;
39
39
  export declare function useDaemonWorkspaceEventSignals(): DaemonWorkspaceEventSignals | undefined;
40
40
  export declare function useDaemonPromptStatus(): DaemonPromptStatus;
41
41
  export declare function useDaemonPromptSettled(listener: DaemonPromptSettledListener | undefined): void;
42
+ export declare function useOptionalDaemonPromptSettled(listener: DaemonPromptSettledListener | undefined): void;
42
43
  export declare function useDaemonConnection(): DaemonConnectionState;
43
44
  export declare function useDaemonSessionNotices(): {
44
45
  notices: readonly DaemonSessionNotice[];
@@ -23,6 +23,8 @@ export declare function resolveSessionRestoreTimeouts(capabilities: DaemonCapabi
23
23
  * the two reports a timeout on a spawn the daemon is still finishing.
24
24
  */
25
25
  export declare function resolveCreateWatchdogTimeoutMs(capabilities: DaemonCapabilities | undefined): number;
26
+ export declare function takePendingRestoredSession(load: PendingSessionLoad | undefined): DaemonSessionClient | undefined;
27
+ export declare function detachPendingRestoredSession(load: PendingSessionLoad | undefined): void;
26
28
  export interface CreateDaemonSessionActionsArgs {
27
29
  store: DaemonTranscriptStore;
28
30
  sessionRef: RefBox<DaemonSessionClient | undefined>;
@@ -61,7 +63,8 @@ export interface CreateDaemonSessionActionsArgs {
61
63
  flushTranscript: () => void;
62
64
  getCreateSessionRequest: () => CreateSessionRequest;
63
65
  createDetachedSession: (workspaceCwd?: string, overrides?: Pick<CreateSessionRequest, 'approvalMode' | 'sourceType' | 'worktree' | 'branch' | 'startupConfig'>) => Promise<DaemonSessionClient>;
64
- createDetachedStandaloneSession: (overrides?: Pick<CreateSessionRequest, 'approvalMode' | 'modelServiceId'>) => Promise<DaemonSessionClient>;
66
+ createDetachedStandaloneSession: (overrides?: Pick<CreateSessionRequest, 'approvalMode' | 'modelServiceId' | 'startupConfig'>) => Promise<DaemonSessionClient>;
67
+ restoreDetachedWorktreeSession: (sessionId: string, workspaceCwd: string) => Promise<DaemonSessionClient>;
65
68
  getDefaultSessionContext: () => DaemonProductSessionContext | undefined;
66
69
  getClient?: () => DaemonClient | undefined;
67
70
  getConnection: () => DaemonConnectionState;
@@ -92,7 +95,7 @@ export interface CreateDaemonSessionActionsArgs {
92
95
  export declare function getWorkspaceModelsAfterSessionClear(current: DaemonConnectionState): DaemonConnectionState['models'];
93
96
  export declare function getConnectionAfterSessionClear(current: DaemonConnectionState, clearedSessionId: string | undefined, preserveWorkspaceMetadata?: boolean, dropSessionContext?: boolean): DaemonConnectionState;
94
97
  export declare function advanceSessionRecoveryGeneration(generations: WeakMap<DaemonSessionClient, number>, session: DaemonSessionClient): number;
95
- export declare function createDaemonSessionActions({ store, sessionRef, activePromptsRef, settledPromptsRef, pendingSessionLoadRef, pendingSessionLoadIdRef, sessionConfigGeneration, sessionRecoveryGeneration, heartbeatSupportedRef, manualSessionClearRef, skipNextCleanupDetachSessionRef, passiveAssistantDoneTimerRef, daemonActivePromptRef, settleRestoredActivePrompt, flushTranscript, getCreateSessionRequest, createDetachedSession, createDetachedStandaloneSession, getDefaultSessionContext, getClient, getConnection, getPromptStatus, getEventDetailMode, hasSessionActivePrompt, resetCurrentSessionActivePrompt, restartEventStream, addNotice, setConnection, setPromptStatus, setRestoreSessionId, setRestoreSessionContext, setRestoreMode, setRestoreSessionNonce, setAttachSessionNonce, setNewSessionNonce, clearLiveJournalRepair, onGeneratedUiInvalidated, onPromptAdmitted, onContinuationAdmitted, onPromptRemoved, }: CreateDaemonSessionActionsArgs): DaemonSessionActions;
98
+ export declare function createDaemonSessionActions({ store, sessionRef, activePromptsRef, settledPromptsRef, pendingSessionLoadRef, pendingSessionLoadIdRef, sessionConfigGeneration, sessionRecoveryGeneration, heartbeatSupportedRef, manualSessionClearRef, skipNextCleanupDetachSessionRef, passiveAssistantDoneTimerRef, daemonActivePromptRef, settleRestoredActivePrompt, flushTranscript, getCreateSessionRequest, createDetachedSession, createDetachedStandaloneSession, restoreDetachedWorktreeSession, getDefaultSessionContext, getClient, getConnection, getPromptStatus, getEventDetailMode, hasSessionActivePrompt, resetCurrentSessionActivePrompt, restartEventStream, addNotice, setConnection, setPromptStatus, setRestoreSessionId, setRestoreSessionContext, setRestoreMode, setRestoreSessionNonce, setAttachSessionNonce, setNewSessionNonce, clearLiveJournalRepair, onGeneratedUiInvalidated, onPromptAdmitted, onContinuationAdmitted, onPromptRemoved, }: CreateDaemonSessionActionsArgs): DaemonSessionActions;
96
99
  /**
97
100
  * Key under which a shell command tracks its prompt in the active-prompt map.
98
101
  * Shell commands run as their own prompt alongside a conversation turn, so they
@@ -7,5 +7,6 @@ export declare function extractHttpStatus(error: unknown): number | undefined;
7
7
  export declare function isInvalidClientIdError(error: unknown): boolean;
8
8
  export declare function isAcpChildCapacityError(error: unknown): boolean;
9
9
  export declare function isSessionLimitExceededError(error: unknown): boolean;
10
+ export declare function isSystemOverloadedError(error: unknown): boolean;
10
11
  export declare function isRecord(value: unknown): value is Record<string, unknown>;
11
12
  export declare function isRecoverableAcpCapacityError(error: unknown): boolean;
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { ReactNode } from 'react';
7
- import type { CreateSessionRequest, DaemonBranchSessionRequest, DaemonWorktreeBranchResult, DaemonWorktreeHandoffResult, DaemonCapabilities, DaemonBackgroundTurn, DaemonEvent, DaemonApprovalMode, DaemonApprovalModeResult, DaemonAvailableCommand, DaemonForkSessionResult, DaemonInputAnnotation, DaemonSessionBtwResult, DaemonSessionGenerationEvent, DaemonSessionAttachmentReference, DaemonSessionAttachmentData, DaemonMidTurnMessageResult, DaemonMidTurnMessagesResult, DaemonRemoveMidTurnMessageResult, DaemonSendMidTurnMessagesNowResult, DaemonPendingPromptsResult, DaemonRemovePendingPromptResult, DaemonSessionContextStatus, DaemonSessionSavedWorkflowDetail, DaemonSessionContextUsageStatus, DaemonSessionRecapResult, DaemonRewindResult, DaemonRewindSnapshotInfo, DaemonSession, DaemonSessionClient, DaemonSessionPrInfo, DaemonSessionSummary, DaemonSessionSupportedCommandsStatus, DaemonSessionTaskRuntimeStatus, DaemonSessionTaskWithWorkflowStatus, DaemonSessionTasksStatus, DaemonSessionWorkflowTaskStatus, DaemonSessionWorkflowTasksStatus, DaemonSessionStatsStatus, DaemonSessionArtifact, DaemonSessionArtifactsEnvelope, DaemonSessionArtifactInput, DaemonSessionArtifactMutationResult, SessionSourceInput, SessionSourcesResult, SessionSourceUpsertResult, SessionSourceRemoveResult, DaemonSkillToggleMutation, DaemonShellCommandResult, DaemonTranscriptBlock, DaemonTranscriptStore, DaemonWorkspaceGitStatus, DaemonWorkspaceProvidersStatus, DaemonStandaloneCreationRecovery, DaemonStandaloneWorkingDirectory, HeartbeatResult, GoalControlRequest, GoalSnapshotV2, GoalStateResponse, PermissionResponse, PromptContentBlock, PromptResult, ReasoningSelection, SessionMetadataResult, SetModelResult } from '@qwen-code/sdk/daemon';
7
+ import type { CreateSessionRequest, DaemonBranchSessionRequest, DaemonWorktreeBranchResult, DaemonWorktreeHandoffResult, DaemonCapabilities, DaemonBackgroundTurn, DaemonEvent, DaemonApprovalMode, DaemonApprovalModeResult, DaemonAvailableCommand, DaemonForkSessionResult, DaemonInputAnnotation, DaemonSessionBtwResult, DaemonSessionGenerationEvent, DaemonSessionAttachmentReference, DaemonSessionAttachmentData, DaemonMidTurnMessageResult, DaemonMidTurnMessagesResult, DaemonRemoveMidTurnMessageResult, DaemonSendMidTurnMessagesNowResult, DaemonPendingPromptsResult, DaemonRemovePendingPromptResult, DaemonSessionContextStatus, DaemonSessionSavedWorkflowDetail, DaemonSessionContextUsageStatus, DaemonSessionRecapResult, DaemonRewindResult, DaemonRewindSnapshotInfo, DaemonSession, DaemonSessionClient, DaemonSessionPrInfo, DaemonSessionSummary, DaemonSessionSupportedCommandsStatus, DaemonSessionCancelableTaskKind, DaemonSessionTaskRuntimeStatus, DaemonSessionTasksStatus, DaemonSessionWorkflowTaskStatus, DaemonSessionWorkflowTasksStatus, DaemonSessionStatsStatus, DaemonSessionArtifact, DaemonSessionArtifactsEnvelope, DaemonSessionArtifactInput, DaemonSessionArtifactMutationResult, SessionSourceInput, SessionSourcesResult, SessionSourceUpsertResult, SessionSourceRemoveResult, DaemonSkillToggleMutation, DaemonShellCommandResult, DaemonTranscriptBlock, DaemonTranscriptStore, DaemonWorkspaceGitStatus, DaemonWorkspaceProvidersStatus, DaemonStandaloneCreationRecovery, DaemonStandaloneWorkingDirectory, HeartbeatResult, GoalControlRequest, GoalSnapshotV2, GoalStateResponse, PermissionResponse, PromptContentBlock, PromptResult, ReasoningSelection, SessionMetadataResult, SetModelResult } from '@qwen-code/sdk/daemon';
8
8
  export type DaemonConnectionStatus = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error';
9
9
  export interface DaemonSessionOwnerSnapshot {
10
10
  isCurrent(): boolean;
@@ -335,8 +335,8 @@ export interface SendPromptOptions {
335
335
  onAdmissionStarted?: () => void;
336
336
  /** Caller-generated key used to deduplicate retried prompt admissions. */
337
337
  idempotencyKey?: string;
338
- /** Revalidates the caller before every HTTP attempt, including client recovery. */
339
- beforeDispatch?: (clientId: string | undefined) => void;
338
+ /** Client-only revalidation, awaited before every HTTP attempt including recovery. */
339
+ beforeDispatch?: (clientId: string | undefined) => void | Promise<void>;
340
340
  /**
341
341
  * Fired once the daemon has ACCEPTED the prompt (admission), before the turn
342
342
  * runs to completion. Lets a caller act on "the prompt reached the session"
@@ -438,7 +438,10 @@ export interface DaemonSessionActions {
438
438
  * prompt status, or connection. The turn runs on the daemon after the
439
439
  * client detaches; a later loadSession attaches fresh.
440
440
  */
441
- sendDetachedPrompt(session: DaemonSessionClient, text: string, options?: Pick<SendPromptOptions, 'submittedPrompt' | 'suppressInputHistory' | 'images' | 'files' | 'inputAnnotations' | 'retry' | 'idempotencyKey' | 'onAdmissionStarted' | 'onAdmitted'>): Promise<SubmitPromptResult>;
441
+ sendDetachedPrompt(session: DaemonSessionClient, text: string, options?: Pick<SendPromptOptions, 'submittedPrompt' | 'suppressInputHistory' | 'images' | 'files' | 'inputAnnotations' | 'retry' | 'idempotencyKey' | 'onAdmissionStarted' | 'onAdmitted'> & {
442
+ /** Extra guard for an operation during detached client recovery. */
443
+ beforeDetachedDispatch?: SendPromptOptions['beforeDispatch'];
444
+ }): Promise<SubmitPromptResult>;
442
445
  cancel(): Promise<void>;
443
446
  setModel(modelId: string): Promise<SetModelResult>;
444
447
  refreshModels(beforeRefresh?: (target: {
@@ -468,7 +471,20 @@ export interface DaemonSessionActions {
468
471
  /** Artifact count from the clicked session's list summary, shown in
469
472
  * the header entry before the load response lands. Omit when unknown. */
470
473
  artifactCountHint?: number;
474
+ /**
475
+ * Hydrated client returned by restoreWorktreeSession. Ownership moves
476
+ * to this load; the provider consumes its replay instead of loading again.
477
+ */
478
+ restoredSession?: DaemonSessionClient;
471
479
  }): Promise<void>;
480
+ /**
481
+ * Restore a retained worktree into a hydrated client without binding it to
482
+ * this provider. Pass the result to loadSession, or detach it if navigation
483
+ * never takes ownership.
484
+ */
485
+ restoreWorktreeSession(sessionId: string, options: {
486
+ workspaceCwd: string;
487
+ }): Promise<DaemonSessionClient>;
472
488
  /** `memory` replay is reserved for the provider's live-journal repair. */
473
489
  reloadSession(signal: AbortSignal, options?: {
474
490
  replaySource?: 'configured' | 'memory';
@@ -634,7 +650,7 @@ export interface DaemonSessionActions {
634
650
  getTasks(opts?: GetTasksActionOptions): Promise<DaemonSessionTasksStatus>;
635
651
  getTaskRuntime(taskId: string): Promise<DaemonSessionTaskRuntimeStatus>;
636
652
  getWorkflowTasks(opts?: GetTasksActionOptions): Promise<DaemonSessionWorkflowTasksStatus>;
637
- cancelTask(taskId: string, kind: DaemonSessionTaskWithWorkflowStatus['kind']): Promise<{
653
+ cancelTask(taskId: string, kind: DaemonSessionCancelableTaskKind, source?: 'cron' | 'wakeup'): Promise<{
638
654
  cancelled: boolean;
639
655
  }>;
640
656
  controlWorkflowTask(taskId: string, action: 'pause' | 'resume' | 'retry' | 'rerun' | 'delete-history'): Promise<{
@@ -680,6 +696,8 @@ export interface DaemonSessionActions {
680
696
  sessionId: string;
681
697
  displayName: string;
682
698
  switchStarted: boolean;
699
+ /** False when an initiated switch fails to load or is aborted. */
700
+ switchCompleted?: Promise<boolean>;
683
701
  sourceWarnings?: string[];
684
702
  }>;
685
703
  /** "Create branch here" on the session's detached managed worktree. */
@@ -749,6 +767,8 @@ export interface PendingSessionLoad {
749
767
  reject: (error: unknown) => void;
750
768
  signal?: AbortSignal;
751
769
  replaySource?: 'configured' | 'memory';
770
+ /** Present until the provider takes ownership of this restored client. */
771
+ restoredSession?: DaemonSessionClient;
752
772
  reconcilePromptActivity?: boolean;
753
773
  }
754
774
  export {};
@@ -4,11 +4,11 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { DaemonTranscriptStore } from '@qwen-code/sdk/daemon';
7
+ export { withActionTimeout } from '../utils/action-timeout.js';
7
8
  export interface TimerRef {
8
9
  current: ReturnType<typeof setTimeout> | undefined;
9
10
  }
10
11
  export declare function getReconnectDelayMs(attempt: number, reconnectDelayMs: number, maxReconnectDelayMs: number): number;
11
- export declare function withActionTimeout<T>(promise: Promise<T>, message: string, timeoutMs?: number): Promise<T>;
12
12
  export declare function delay(delayMs: number, signal: AbortSignal): Promise<void>;
13
13
  export declare function clearPassiveAssistantDoneTimer(timerRef: TimerRef): void;
14
14
  export declare function schedulePassiveAssistantDone(store: DaemonTranscriptStore, timerRef: TimerRef, reason?: string, delayMs?: number, onDone?: () => void): void;
@@ -1,4 +1,24 @@
1
- import type { SessionChatController } from '../chat-core/contract.js';
1
+ import type { Admission, PendingApproval, PendingQuestion, SessionChatController } from '../chat-core/contract.js';
2
+ import type { DaemonConnectionState, DaemonSessionActions } from './session/types.js';
3
+ import { useDaemonTranscriptHistory } from './session/DaemonSessionProvider.js';
4
+ export interface DaemonChatControllerFromStateOptions {
5
+ readonly connection: Pick<DaemonConnectionState, 'sessionId' | 'workspaceCwd' | 'capabilities' | 'loadingTranscript' | 'missingSession' | 'planExecutionMode'>;
6
+ readonly actions: Pick<DaemonSessionActions, 'cancel' | 'submitPermission' | 'respondToPermission'> & Partial<Pick<DaemonSessionActions, 'submitPrompt'>>;
7
+ readonly transcriptHistory: Pick<ReturnType<typeof useDaemonTranscriptHistory>, 'hasMore' | 'loading' | 'capacityReached' | 'paginationError' | 'loadMore'>;
8
+ readonly messages: SessionChatController['messages'];
9
+ readonly pendingApprovals: readonly PendingApproval[];
10
+ readonly pendingQuestions: readonly PendingQuestion[];
11
+ readonly pendingSignature: string;
12
+ readonly transcriptState?: SessionChatController['transcriptState'];
13
+ readonly submitPermission?: (requestId: string, optionId: string) => Promise<Admission>;
14
+ }
15
+ /**
16
+ * Binds caller-owned daemon session state (already read from
17
+ * `DaemonSessionProvider` / `daemon-react-sdk` and frame-throttled transcript
18
+ * hooks) to {@link SessionChatController} without re-projecting messages or
19
+ * requiring a second context subscription stack.
20
+ */
21
+ export declare function useDaemonChatControllerFromState(options: DaemonChatControllerFromStateOptions): SessionChatController;
2
22
  /**
3
23
  * Binds the daemon session provider to the backend-neutral chat controller
4
24
  * (slice 2d). It constructs {@link createDaemonChatController} once per session
@@ -4,7 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { DaemonResourceOptions } from '../types.js';
7
- export declare function useDaemonMemory(options?: DaemonResourceOptions): {
7
+ interface DaemonMemoryOptions extends DaemonResourceOptions {
8
+ workspaceCwd?: string;
9
+ }
10
+ export declare function useDaemonMemory(options?: DaemonMemoryOptions): {
8
11
  status: import("@qwen-code/sdk/daemon").DaemonWorkspaceMemoryStatus | undefined;
9
12
  files: import("@qwen-code/sdk/daemon").DaemonWorkspaceMemoryFile[];
10
13
  readFile: (filePath: string, opts?: {
@@ -25,3 +28,4 @@ export declare function useDaemonMemory(options?: DaemonResourceOptions): {
25
28
  error?: Error;
26
29
  }>;
27
30
  };
31
+ export {};