@qwen-code/web-shell 0.27.4-nightly.20261116.eb3a599ef3 → 0.28.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 (25) hide show
  1. package/dist/{PierreFilePreview-BSPYtMfT.js → PierreFilePreview-D6shMVrF.js} +1 -1
  2. package/dist/{SpreadsheetPreview-Dt3j8svo.js → SpreadsheetPreview-CI7hXBn_.js} +2 -2
  3. package/dist/{WorkspaceFileBrowser-BEfKDZo-.js → WorkspaceFileBrowser-D2lUYsk2.js} +2 -2
  4. package/dist/{agents-route-CoQyuI6v.js → agents-route-Cekk3UIP.js} +2 -2
  5. package/dist/daemon-react-sdk.js +1 -1
  6. package/dist/{index-CDuO1Jdf.js → index-BNap2Fh4.js} +60933 -60055
  7. package/dist/index.js +3 -3
  8. package/dist/sw.js +1 -1
  9. package/dist/transcript.js +2761 -2707
  10. package/dist/types/components/BranchPickerPopover.d.ts +11 -1
  11. package/dist/types/components/ChatEditor.d.ts +4 -0
  12. package/dist/types/components/artifacts/ArtifactPanel.d.ts +11 -1
  13. package/dist/types/components/artifacts/ChangeOverviewPanel.d.ts +4 -0
  14. package/dist/types/components/artifacts/change-overview.d.ts +95 -0
  15. package/dist/types/components/artifacts/useChangeOverview.d.ts +21 -0
  16. package/dist/types/components/sidebar/ActivityDateSessions.d.ts +22 -0
  17. package/dist/types/components/sidebar/SessionGroupSection.d.ts +4 -2
  18. package/dist/types/components/sidebar/SessionSortMenu.d.ts +7 -1
  19. package/dist/types/components/sidebar/activity-model.d.ts +1 -1
  20. package/dist/types/customization.d.ts +1 -1
  21. package/dist/types/daemon/session/types.d.ts +6 -2
  22. package/dist/types/session-catalog/session-catalog-hooks.d.ts +4 -1
  23. package/dist/types/utils/gitModeIntent.d.ts +14 -4
  24. package/dist/{useDaemonMidTurnInjected-CF_pQHJz.js → useDaemonMidTurnInjected-FRZ0JLKH.js} +567 -458
  25. package/package.json +1 -1
@@ -32,6 +32,16 @@ interface BranchPickerPopoverProps {
32
32
  onOpenWorktrees?: () => void;
33
33
  /** Opens the commit history graph. */
34
34
  onOpenLog?: () => void;
35
+ /**
36
+ * "Create branch here": turn the session's detached managed worktree
37
+ * into a named branch. Offered only for detached worktree sessions.
38
+ */
39
+ onCreateWorktreeBranch?: (name: string) => Promise<void>;
40
+ /**
41
+ * "Hand off": move the session between its managed worktree and the
42
+ * local checkout. Direction follows gitCwd (worktree path => 'local').
43
+ */
44
+ onHandoff?: (to: 'local' | 'worktree') => Promise<void>;
35
45
  children: React.ReactNode;
36
46
  }
37
47
  type HintTone = 'muted' | 'info' | 'warning';
@@ -74,5 +84,5 @@ export declare function deriveActionHints(t: TranslateFn, data: DaemonGitBranche
74
84
  * re-fetched. Exported for tests.
75
85
  */
76
86
  export declare function listingContradictsStatus(data: DaemonGitBranchesResult, status: DaemonWorkspaceGitStatus): boolean;
77
- export declare function BranchPickerPopover({ open, onOpenChange, workspaceCwd, gitCwd, gitSessionId, side, onBranchChanged, status, onStatusRefreshed, onOpenDiff, onOpenCommit, onOpenWorktrees, onOpenLog, children, }: BranchPickerPopoverProps): import("react/jsx-runtime").JSX.Element;
87
+ export declare function BranchPickerPopover({ open, onOpenChange, workspaceCwd, gitCwd, gitSessionId, side, onBranchChanged, status, onStatusRefreshed, onOpenDiff, onOpenCommit, onOpenWorktrees, onOpenLog, onCreateWorktreeBranch, onHandoff, children, }: BranchPickerPopoverProps): import("react/jsx-runtime").JSX.Element;
78
88
  export {};
@@ -76,6 +76,10 @@ interface ChatEditorProps {
76
76
  onOpenWorktrees?: () => void;
77
77
  /** Opens the commit history graph. */
78
78
  onOpenLog?: () => void;
79
+ /** "Create branch here" for the session's detached managed worktree. */
80
+ onCreateWorktreeBranch?: (name: string) => Promise<void>;
81
+ /** "Hand off" between the session's worktree and the local checkout. */
82
+ onHandoff?: (to: 'local' | 'worktree') => Promise<void>;
79
83
  /** Workspace name shown in the pane composer's `workspace` toolbar chip. */
80
84
  workspaceName?: string;
81
85
  /** Full workspace cwd, used as the chip's tooltip. */
@@ -175,6 +175,13 @@ export type ArtifactPanelTab = {
175
175
  sessionId: string;
176
176
  sessionActions?: DaemonSessionActions;
177
177
  closeWithPane?: boolean;
178
+ } | {
179
+ id: string;
180
+ kind: 'change_overview';
181
+ title: string;
182
+ workspaceCwd: string;
183
+ workspaceId?: string;
184
+ sessionId?: string;
178
185
  } | {
179
186
  id: string;
180
187
  kind: 'workflow';
@@ -218,6 +225,9 @@ interface ArtifactPanelProps {
218
225
  onOpenMemoryFile?: (file: DaemonContextMemoryDetail, workspaceCwd: string) => void;
219
226
  latestReviewAvailable?: boolean;
220
227
  onOpenLatestReview?: () => void;
228
+ /** Open the delivery-unit change overview tab (git workspaces only). */
229
+ changeOverviewAvailable?: boolean;
230
+ onOpenChangeOverview?: () => void;
221
231
  /** Open an interactive terminal tab in this panel (shown as an empty-state action). */
222
232
  onOpenTerminal?: () => void;
223
233
  /** Open this session's trajectory tab (shown as an empty-state action). */
@@ -283,5 +293,5 @@ interface ArtifactPanelProps {
283
293
  fullscreen?: boolean;
284
294
  onToggleFullscreen?: () => void;
285
295
  }
286
- export declare function ArtifactPanel({ contextUsageControls, artifacts, tabs, activeTabId, reviewChanges, selectedReviewPath, panelWidth, workspaceCwd, loading, restoring, error, onSelectTab, onSelectTurnCallsPrompt, onCloseTab, onOpenFilePreview, onOpenMemoryFile, latestReviewAvailable, onOpenLatestReview, onOpenTerminal, onOpenTrajectory, trajectoryTabId, onOpenFiles, onReferenceFile, onOpenWebPreview, onWebPreviewChange, items, sideTaskAvailable, sideTasks, archivedSideTasks, sideTasksLoading, onCreateSideTask, onOpenSideTask, onArchiveSideTasks, onUnarchiveSideTasks, onSideTaskMenuOpen, onCreateSideTaskSession, onSideTaskCreated, onSideTaskTitleChange, onSideTaskInitialPromptRefused, onNestedRightPanelOpen, onNestedArtifactsChange, onOpenNestedSubagent, agentTasks, agentTraceLoading, agentTraceError, onOpenWorkflowAgent, onError, sessionWorkflowEnabled, modelManagement, unavailableModels, mountUnavailableModelTooltip, workflow, onImageIngestionNotice, deferSubagentMount, onClose, variant, fullscreen, onToggleFullscreen, }: ArtifactPanelProps): import("react/jsx-runtime").JSX.Element;
296
+ export declare function ArtifactPanel({ contextUsageControls, artifacts, tabs, activeTabId, reviewChanges, selectedReviewPath, panelWidth, workspaceCwd, loading, restoring, error, onSelectTab, onSelectTurnCallsPrompt, onCloseTab, onOpenFilePreview, onOpenMemoryFile, latestReviewAvailable, onOpenLatestReview, changeOverviewAvailable, onOpenChangeOverview, onOpenTerminal, onOpenTrajectory, trajectoryTabId, onOpenFiles, onReferenceFile, onOpenWebPreview, onWebPreviewChange, items, sideTaskAvailable, sideTasks, archivedSideTasks, sideTasksLoading, onCreateSideTask, onOpenSideTask, onArchiveSideTasks, onUnarchiveSideTasks, onSideTaskMenuOpen, onCreateSideTaskSession, onSideTaskCreated, onSideTaskTitleChange, onSideTaskInitialPromptRefused, onNestedRightPanelOpen, onNestedArtifactsChange, onOpenNestedSubagent, agentTasks, agentTraceLoading, agentTraceError, onOpenWorkflowAgent, onError, sessionWorkflowEnabled, modelManagement, unavailableModels, mountUnavailableModelTooltip, workflow, onImageIngestionNotice, deferSubagentMount, onClose, variant, fullscreen, onToggleFullscreen, }: ArtifactPanelProps): import("react/jsx-runtime").JSX.Element;
287
297
  export {};
@@ -0,0 +1,4 @@
1
+ export declare function ChangeOverviewPanel({ workspaceCwd, sessionId, }: {
2
+ workspaceCwd: string;
3
+ sessionId?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,95 @@
1
+ import type { DaemonGitCommitDetail } from '@qwen-code/sdk/daemon';
2
+ /** One delivery unit in the change overview: a batch of changed files. */
3
+ export interface ChangeOverviewFile {
4
+ path: string;
5
+ additions: number;
6
+ deletions: number;
7
+ /** Binary rows carry zero counts by design; render a marker, not "+0 -0". */
8
+ isBinary?: boolean;
9
+ }
10
+ /** Why a PR's file list could not be fetched, so the panel can say so honestly. */
11
+ export type PrUnavailableCause = 'cli' | 'route' | 'error';
12
+ export type ChangeOverviewUnit = {
13
+ kind: 'uncommitted';
14
+ id: 'uncommitted';
15
+ files: ChangeOverviewFile[];
16
+ additions: number;
17
+ deletions: number;
18
+ filesCount: number;
19
+ hiddenCount: number;
20
+ } | {
21
+ kind: 'pr';
22
+ id: string;
23
+ number: number;
24
+ title: string;
25
+ url: string;
26
+ /** 'unavailable' when the file list could not be fetched. */
27
+ state: 'ready' | 'unavailable';
28
+ /** Present when state is 'unavailable'; names the actual failure cause. */
29
+ unavailableCause?: PrUnavailableCause;
30
+ files: ChangeOverviewFile[];
31
+ additions: number;
32
+ deletions: number;
33
+ filesCount: number;
34
+ hiddenCount: number;
35
+ } | {
36
+ kind: 'commit';
37
+ id: string;
38
+ sha: string;
39
+ shortSha: string;
40
+ subject: string;
41
+ files: ChangeOverviewFile[];
42
+ additions: number;
43
+ deletions: number;
44
+ filesCount: number;
45
+ hiddenCount: number;
46
+ };
47
+ /**
48
+ * The `[host/]owner/repo` a bound PR's URL points at, so its file list is
49
+ * resolved in that repository rather than by number in the session's checkout
50
+ * (a same number in another repo is a different PR). The host is carried
51
+ * through to `gh --repo` in its documented [HOST/]OWNER/REPO form: dropping it
52
+ * would resolve an Enterprise PR's slug on github.com and could render a
53
+ * foreign same-numbered PR's files under this PR's heading. Returns undefined
54
+ * for anything that is not a plain GitHub PR URL with a valid slug and a bare
55
+ * hostname[:port] host.
56
+ */
57
+ export declare function prRepoFromUrl(url: string): string | undefined;
58
+ /**
59
+ * Classify a failed PR-files fetch from the daemon error's wire shape, so the
60
+ * panel names the real cause instead of always blaming a missing `gh` or an
61
+ * old daemon. `github_cli_unavailable` → gh missing; a 404 → the daemon
62
+ * predates the route; anything else (expired token, rate limit, transient
63
+ * daemon error) → a generic retryable failure.
64
+ */
65
+ export declare function prUnavailableCauseFromError(error: unknown): PrUnavailableCause;
66
+ /**
67
+ * The git log range that yields the commit-fallback window: commits a bound PR
68
+ * does not cover. With a known PR head, only commits after it are loose (the
69
+ * PR units already show the rest); without one, the session's base branch (or
70
+ * HEAD's recent history) bounds the window.
71
+ *
72
+ * Returns a range string, or one of two distinct sentinels: `undefined` means
73
+ * "no baseline — walk HEAD's recent history" (an omitted range), while `null`
74
+ * means "refuse the fallback". A base branch git permits but the daemon's
75
+ * whitelist rejects (e.g. `feat@2026`) would be dropped server-side into an
76
+ * unscoped walk that re-lists pre-session history, so it must skip the fetch
77
+ * entirely (`null`), not fall through to the omitted-range path. The literal
78
+ * `'HEAD'` is the daemon's detached-HEAD sentinel (session.ts treats it the
79
+ * same way), not a baseline: composing `HEAD..HEAD` would be always-empty and
80
+ * silently render a committing session as having no loose commits, so it maps
81
+ * to the no-baseline walk instead.
82
+ */
83
+ export declare function commitFallbackRange(latestPrHeadSha: string | undefined, baseBranch: string | undefined): string | null | undefined;
84
+ /**
85
+ * Map commit-fallback log entries to units. The caller already fetched the
86
+ * loose window via {@link commitFallbackRange}, so covered commits are absent.
87
+ * Merge commits are skipped — their diff-tree detail is the merge's own
88
+ * introduction, not session work — as are commits whose detail is unavailable.
89
+ */
90
+ export declare function buildCommitFallbackUnits(entries: readonly {
91
+ sha: string;
92
+ shortSha: string;
93
+ subject: string;
94
+ parents: string[];
95
+ }[], details: ReadonlyMap<string, DaemonGitCommitDetail>): ChangeOverviewUnit[];
@@ -0,0 +1,21 @@
1
+ import { type ChangeOverviewUnit } from './change-overview';
2
+ export interface ChangeOverviewState {
3
+ /** False when the workspace is not a git repository. */
4
+ gitAvailable: boolean;
5
+ /** True when a fetch failed transiently; retryable, not a workspace property. */
6
+ loadFailed: boolean;
7
+ loading: boolean;
8
+ units: ChangeOverviewUnit[];
9
+ /** True when the commit-fallback window is capped and older commits exist. */
10
+ commitsTruncated: boolean;
11
+ }
12
+ /**
13
+ * Assemble the session's delivery-unit change overview from git: the
14
+ * uncommitted batch, one unit per bound PR (with its changed-file list and
15
+ * scale), and a commit fallback for commits no bound PR covers. Read-only;
16
+ * every fetch degrades gracefully so a missing `gh` or an old daemon never
17
+ * blanks the panel.
18
+ */
19
+ export declare function useChangeOverview(workspaceCwd: string, sessionId?: string): ChangeOverviewState & {
20
+ refresh: () => void;
21
+ };
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { DaemonSessionSummary } from '@qwen-code/sdk/daemon';
3
+ import { type ActivityEntry } from './activity-model';
4
+ import type { SessionSort } from './SessionSortMenu';
5
+ export type ActivityDateGroupId = 'today' | 'thisWeek' | 'last30Days' | 'older';
6
+ export declare function groupActivityDateSessions(entries: readonly ActivityEntry[], sortBy: SessionSort, now?: number): Array<{
7
+ id: ActivityDateGroupId;
8
+ entries: ActivityEntry[];
9
+ }>;
10
+ interface ActivityDateSessionsProps {
11
+ entries: readonly ActivityEntry[];
12
+ sortBy: SessionSort;
13
+ loading: boolean;
14
+ unavailable: boolean;
15
+ hasMore: boolean;
16
+ onRetry: () => void;
17
+ renderSession: (entry: ActivityEntry) => ReactNode;
18
+ editingSessionIdentity?: string | null;
19
+ sessionIdentity: (session: DaemonSessionSummary) => string;
20
+ }
21
+ export declare function ActivityDateSessions({ entries, sortBy, loading, unavailable, hasMore, onRetry, renderSession, editingSessionIdentity, sessionIdentity, }: ActivityDateSessionsProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -7,7 +7,9 @@ export interface SessionGroupSectionProps {
7
7
  expanded: boolean;
8
8
  color?: DaemonSessionGroupColor;
9
9
  icon?: ReactNode;
10
- children: ReactNode;
10
+ children?: ReactNode;
11
+ itemCount?: number;
12
+ renderChildren?: (visibleCount: number) => ReactNode;
11
13
  onToggle: () => void;
12
14
  onRename?: () => void;
13
15
  onDelete?: () => void;
@@ -16,4 +18,4 @@ export interface SessionGroupSectionProps {
16
18
  actionsDisabled?: boolean;
17
19
  limitSessions?: boolean;
18
20
  }
19
- export declare function SessionGroupSection({ label, count, expanded, color, icon, children, onToggle, onRename, onDelete, renameLabel, deleteLabel, actionsDisabled, limitSessions, }: SessionGroupSectionProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function SessionGroupSection({ label, count, expanded, color, icon, children, itemCount, renderChildren, onToggle, onRename, onDelete, renameLabel, deleteLabel, actionsDisabled, limitSessions, }: SessionGroupSectionProps): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,21 @@
1
1
  import type { DaemonWorkspaceCapability } from '@qwen-code/sdk/daemon';
2
2
  export type SessionSort = 'updatedAt' | 'lastUserPromptAt';
3
+ export type SessionGroupBy = 'workspace' | 'activityDate';
3
4
  export type WorkspaceFilter = 'all' | 'standalone' | `workspace:${string}`;
4
5
  export declare function readSessionSort(host: string): SessionSort;
5
6
  export declare function writeSessionSort(host: string, sort: SessionSort): void;
7
+ export declare function readSessionGroupBy(host: string): SessionGroupBy;
8
+ export declare function writeSessionGroupBy(host: string, groupBy: SessionGroupBy): void;
6
9
  export declare function readWorkspaceFilter(host: string): WorkspaceFilter;
7
10
  export declare function writeWorkspaceFilter(host: string, filter: WorkspaceFilter): void;
8
- export declare function SessionSortMenu({ value, onChange, workspaceValue, onWorkspaceChange, workspaces, sortEnabled, triggerClassName, }: {
11
+ export declare function SessionSortMenu({ value, onChange, workspaceValue, onWorkspaceChange, groupValue, onGroupChange, groupEnabled, workspaces, sortEnabled, triggerClassName, }: {
9
12
  value: SessionSort;
10
13
  onChange: (value: SessionSort) => void;
11
14
  workspaceValue: WorkspaceFilter;
12
15
  onWorkspaceChange: (value: WorkspaceFilter) => void;
16
+ groupValue: SessionGroupBy;
17
+ onGroupChange: (value: SessionGroupBy) => void;
18
+ groupEnabled: boolean;
13
19
  workspaces: readonly DaemonWorkspaceCapability[];
14
20
  sortEnabled?: boolean;
15
21
  triggerClassName?: string;
@@ -20,7 +20,7 @@ export declare function activityRecency({ session }: ActivityEntry): number;
20
20
  export declare function isActivityUnread(entry: ActivityEntry): boolean;
21
21
  export declare function activityState(entry: ActivityEntry): ActivityState;
22
22
  export declare function activityNeedsAttention(entry: ActivityEntry): boolean;
23
- export declare function isActivityEligible(entry: ActivityEntry, preferences: ActivityPreferences): boolean;
23
+ export declare function isActivityEligible(entry: ActivityEntry, preferences: ActivityPreferences, includeChildren?: boolean): boolean;
24
24
  export declare function openActivitySnapshot(entries: ActivityEntry[], preferences: ActivityPreferences, now?: number): ActivitySnapshot;
25
25
  export declare function updateActivitySnapshot(snapshot: ActivitySnapshot, entries: ActivityEntry[], preferences: ActivityPreferences): ActivitySnapshot;
26
26
  export declare function clearReadActivitySnapshot(snapshot: ActivitySnapshot, entries: ActivityEntry[], preferences: ActivityPreferences): ActivitySnapshot;
@@ -143,7 +143,7 @@ export interface WebShellChatHeaderOptions {
143
143
  /** Built-in header actions to show. Token and context usage are opt-in. */
144
144
  items?: readonly WebShellChatHeaderItem[];
145
145
  }
146
- export type WebShellRightPanelItem = 'files' | 'review' | 'sideTask' | 'terminal' | 'webPreview' | 'trajectory';
146
+ export type WebShellRightPanelItem = 'files' | 'review' | 'sideTask' | 'terminal' | 'webPreview' | 'trajectory' | 'changeOverview';
147
147
  export interface WebShellRightPanelOptions {
148
148
  /** Empty-state actions to show. Defaults to review and sideTask. */
149
149
  items?: readonly WebShellRightPanelItem[];
@@ -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, 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, 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';
8
8
  export type DaemonConnectionStatus = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error';
9
9
  export interface DaemonSessionOwnerSnapshot {
10
10
  isCurrent(): boolean;
@@ -252,7 +252,7 @@ export type DaemonPromptSettledListener = (event: DaemonPromptSettledEvent) => v
252
252
  export type DaemonPromptSettlementSubscribe = (listener: DaemonPromptSettledListener) => () => void;
253
253
  export type DaemonNoticeSeverity = 'info' | 'warning' | 'error';
254
254
  export type DaemonNoticeCategory = 'validation' | 'user_action' | 'connection' | 'protocol' | 'lifecycle' | 'system';
255
- export type DaemonNoticeOperation = 'send_prompt' | 'continue_session' | 'send_shell_command' | 'switch_model' | 'set_reasoning_effort' | 'set_workflow_mode' | 'set_approval_mode' | 'submit_permission' | 'cancel_prompt' | 'attach_session' | 'load_session' | 'resume_session' | 'create_session' | 'close_session' | 'rename_session' | 'bind_session_pr' | 'release_session' | 'list_sessions' | 'load_context' | 'load_context_usage' | 'load_tasks' | 'load_artifacts' | 'read_attachment' | 'remove_attachment' | 'cancel_task' | 'control_workflow' | 'run_saved_workflow' | 'read_saved_workflow' | 'load_goal' | 'control_goal' | 'clear_goal' | 'load_stats' | 'rewind_snapshots' | 'rewind_session' | 'refresh_commands' | 'recap_session' | 'generate_session_content' | 'btw_session' | 'branch_session' | 'fork_session' | 'record_session' | 'stream' | 'normalize_event';
255
+ export type DaemonNoticeOperation = 'send_prompt' | 'continue_session' | 'send_shell_command' | 'switch_model' | 'set_reasoning_effort' | 'set_workflow_mode' | 'set_approval_mode' | 'submit_permission' | 'cancel_prompt' | 'attach_session' | 'load_session' | 'resume_session' | 'create_session' | 'close_session' | 'rename_session' | 'bind_session_pr' | 'release_session' | 'list_sessions' | 'load_context' | 'load_context_usage' | 'load_tasks' | 'load_artifacts' | 'read_attachment' | 'remove_attachment' | 'cancel_task' | 'control_workflow' | 'run_saved_workflow' | 'read_saved_workflow' | 'load_goal' | 'control_goal' | 'clear_goal' | 'load_stats' | 'rewind_snapshots' | 'rewind_session' | 'refresh_commands' | 'recap_session' | 'generate_session_content' | 'btw_session' | 'branch_session' | 'create_worktree_branch' | 'handoff_worktree' | 'fork_session' | 'record_session' | 'stream' | 'normalize_event';
256
256
  export interface DaemonSessionNotice {
257
257
  id: string;
258
258
  severity: DaemonNoticeSeverity;
@@ -653,6 +653,10 @@ export interface DaemonSessionActions {
653
653
  switchStarted: boolean;
654
654
  sourceWarnings?: string[];
655
655
  }>;
656
+ /** "Create branch here" on the session's detached managed worktree. */
657
+ createWorktreeBranch(name: string): Promise<DaemonWorktreeBranchResult>;
658
+ /** "Hand off" between the managed worktree and the local checkout. */
659
+ handoffWorktree(to: 'local' | 'worktree'): Promise<DaemonWorktreeHandoffResult>;
656
660
  forkSession(directive: string): Promise<DaemonForkSessionResult>;
657
661
  }
658
662
  export interface DaemonSessionContextValue {
@@ -6,6 +6,9 @@ interface SessionCatalogHookOptions {
6
6
  maxAgeMs?: number;
7
7
  pollIntervalMs?: number;
8
8
  }
9
+ interface SessionCatalogQueriesOptions extends SessionCatalogHookOptions {
10
+ pollQueries?: (query: SessionCatalogQuery, index: number) => boolean;
11
+ }
9
12
  export interface WebShellSessionsOptions extends SessionCatalogHookOptions {
10
13
  sortBy?: 'updatedAt' | 'lastUserPromptAt';
11
14
  pageSize?: number;
@@ -32,7 +35,7 @@ export declare function useSessionCatalogQuery(client: DaemonClient, query: Sess
32
35
  error?: Error;
33
36
  updatedAt?: number;
34
37
  };
35
- export declare function useSessionCatalogQueries(client: DaemonClient, queries: readonly SessionCatalogQuery[], options?: SessionCatalogHookOptions): readonly SessionCatalogSnapshot[];
38
+ export declare function useSessionCatalogQueries(client: DaemonClient, queries: readonly SessionCatalogQuery[], options?: SessionCatalogQueriesOptions): readonly SessionCatalogSnapshot[];
36
39
  /**
37
40
  * Whether the daemon reports a prompt in flight for `sessionId`, together with
38
41
  * whether that answer is allowed to *settle* a running turn.
@@ -9,14 +9,24 @@ import type { DaemonWorkspaceGitStatus } from '@qwen-code/sdk/daemon';
9
9
  * session can no longer apply and must fall back to the current branch.
10
10
  *
11
11
  * Only definitive states reset it: a session already exists, the workspace
12
- * is not trusted, or git status answered and reported no branch. A status
13
- * that is merely absent — not fetched yet, or a poll round that failed — is
12
+ * is not trusted, git status answered and reported neither a branch nor a
13
+ * detached HEAD, or the workspace has no commits (an unborn HEAD has no
14
+ * worktree base — the create path would refuse, and the fast status that
15
+ * armed the intent may have omitted hasHead entirely). A status that is
16
+ * merely absent — not fetched yet, or a poll round that failed — is
14
17
  * transient and leaves the intent alone; otherwise one rejected refetch
15
18
  * while a draft sits would silently turn a requested worktree task into a
16
- * plain session in the main checkout.
19
+ * plain session in the main checkout. hasHead === undefined is transient
20
+ * the same way.
21
+ *
22
+ * The git-status test mirrors `App.gitModeEligible`: a detached HEAD
23
+ * (tag/SHA checkout) reports branch:null with detached:true and is exactly
24
+ * the shared-checkout shape the worktree default isolates, so it must NOT
25
+ * reset the intent — only a non-Git workspace (no branch and not detached)
26
+ * or an unborn HEAD does.
17
27
  */
18
28
  export declare function gitModeIntentMustReset({ sessionId, workspaceTrusted, gitStatus, }: {
19
29
  sessionId: string | null | undefined;
20
30
  workspaceTrusted: boolean | undefined;
21
- gitStatus: Pick<DaemonWorkspaceGitStatus, 'branch'> | undefined;
31
+ gitStatus: Pick<DaemonWorkspaceGitStatus, 'branch' | 'hasHead' | 'detached'> | undefined;
22
32
  }): boolean;