@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.
- package/README.md +26 -3
- package/dist/{PierreFilePreview-CAyMSfe1.js → PierreFilePreview-DNzgLsKu.js} +1 -1
- package/dist/{SpreadsheetPreview-sCcmRNTT.js → SpreadsheetPreview-B0lqDTmC.js} +2 -2
- package/dist/{WorkspaceFileBrowser-DEvIFGbs.js → WorkspaceFileBrowser-Ceci_Ofu.js} +2 -2
- package/dist/{WorkspacePdfRangePreview-iMWtsLo7.js → WorkspacePdfRangePreview-BQY92M0Z.js} +2 -2
- package/dist/{agents-route-CrZAsZhs.js → agents-route-C5I-mPuv.js} +2 -2
- package/dist/daemon-react-sdk.js +1 -1
- package/dist/{i18n-ru-C7ncd9S1.js → i18n-ru-LoTd6Qm6.js} +48 -30
- package/dist/{i18n-zh-cn-7l1xyTcL.js → i18n-zh-cn-69yYbjuK.js} +46 -18
- package/dist/{i18n-zh-tw-DU7AgDPK.js → i18n-zh-tw-BaBS2zL1.js} +58 -6
- package/dist/{index-D-5-_HVQ.js → index-D4vi6zJI.js} +84634 -79061
- package/dist/index.js +3 -3
- package/dist/sw.js +1 -1
- package/dist/transcript.js +4852 -4771
- package/dist/types/App.d.ts +9 -3
- package/dist/types/ManagedAgentWebShell.d.ts +2 -0
- package/dist/types/WebShellContexts.d.ts +8 -0
- package/dist/types/chat-core/ChatSurface.d.ts +47 -3
- package/dist/types/components/ChatContextHeader.d.ts +11 -3
- package/dist/types/components/ChatEditor.d.ts +2 -0
- package/dist/types/components/ComposerTaskChips.d.ts +4 -0
- package/dist/types/components/ComposerUsageStats.d.ts +4 -4
- package/dist/types/components/GitBranchIndicator.d.ts +4 -2
- package/dist/types/components/GitModePopover.d.ts +2 -1
- package/dist/types/components/LocalFilesControl.d.ts +2 -48
- package/dist/types/components/LocalFilesPanel.d.ts +52 -0
- package/dist/types/components/SessionOverviewPanel.d.ts +3 -2
- package/dist/types/components/artifacts/ArtifactPanel.d.ts +19 -2
- package/dist/types/components/artifacts/TokenUsageTrend.d.ts +2 -11
- package/dist/types/components/artifacts/TurnOutputs.d.ts +9 -0
- package/dist/types/components/artifacts/artifact-mime.d.ts +10 -0
- package/dist/types/components/artifacts/artifactUtils.d.ts +2 -4
- package/dist/types/components/artifacts/tokenUsageTotals.d.ts +60 -11
- package/dist/types/components/artifacts/turnOutputSelectors.d.ts +6 -0
- package/dist/types/components/artifacts/useArtifactWorkspaceTarget.d.ts +1 -0
- package/dist/types/components/channels/ChannelsManagerPage.d.ts +3 -1
- package/dist/types/components/composer/composer-integrations.d.ts +14 -0
- package/dist/types/components/composer/daemon-composer-integrations.d.ts +7 -0
- package/dist/types/components/dialogs/ScheduledTasksDialog.d.ts +21 -1
- package/dist/types/components/dialogs/WorkspaceHooksDialog.d.ts +9 -0
- package/dist/types/components/dialogs/scheduledTasksSchedule.d.ts +8 -0
- package/dist/types/components/extensions/ExtensionsManagerPage.d.ts +3 -1
- package/dist/types/components/managed/ManagedDiagnosticsPanel.d.ts +3 -1
- package/dist/types/components/managed/chat-controller.d.ts +1 -0
- package/dist/types/components/managed/managed-diagnostics-messages.d.ts +1 -1
- package/dist/types/components/managed/managed-usage-stats.d.ts +18 -0
- package/dist/types/components/managed/use-managed-actions.d.ts +6 -2
- package/dist/types/components/managed/use-managed-chat-controller.d.ts +32 -1
- package/dist/types/components/messages/MemoryMessage.d.ts +2 -1
- package/dist/types/components/messages/SettingsMessage.d.ts +13 -5
- package/dist/types/components/panels/EnvironmentPanel.d.ts +13 -1
- package/dist/types/components/plugins/PluginManagerPage.d.ts +3 -1
- package/dist/types/components/sidebar/ArchivedSessionsPanel.d.ts +53 -0
- package/dist/types/components/sidebar/StandaloneRecents.d.ts +8 -1
- package/dist/types/components/sidebar/WebShellSidebar.d.ts +8 -5
- package/dist/types/components/sidebar/WorkspaceDetailsTooltip.d.ts +12 -1
- package/dist/types/components/sidebar/WorkspaceMenu.d.ts +9 -2
- package/dist/types/components/sidebar/WorkspaceSection.d.ts +5 -1
- package/dist/types/components/sidebar/archived-session-sort.d.ts +14 -0
- package/dist/types/components/sidebar/archived-sessions-messages.d.ts +10 -0
- package/dist/types/components/sidebar/archived-sessions-messages.transcript-stub.d.ts +8 -0
- package/dist/types/components/sidebar/workspaceOverviewModel.d.ts +4 -2
- package/dist/types/components/workspace-agents/useAgentChatEntry.d.ts +3 -1
- package/dist/types/components/workspaces/WorkspaceDirectoriesSection.d.ts +3 -1
- package/dist/types/components/workspaces/use-workspace-trust-grant.d.ts +18 -0
- package/dist/types/customization.d.ts +12 -2
- package/dist/types/daemon/availability-context.d.ts +2 -1
- package/dist/types/daemon/availability.d.ts +4 -3
- package/dist/types/daemon/permission-signals.d.ts +0 -12
- package/dist/types/daemon/remotePromptSidechannel.d.ts +1 -8
- package/dist/types/daemon/session/DaemonSessionProvider.d.ts +1 -0
- package/dist/types/daemon/session/actions.d.ts +5 -2
- package/dist/types/daemon/session/httpErrors.d.ts +1 -0
- package/dist/types/daemon/session/types.d.ts +25 -5
- package/dist/types/daemon/timing.d.ts +1 -1
- package/dist/types/daemon/useDaemonChatController.d.ts +21 -1
- package/dist/types/daemon/workspace/hooks/useDaemonMemory.d.ts +5 -1
- package/dist/types/daemon/workspace/hooks/useDaemonOverloadPause.d.ts +41 -0
- package/dist/types/daemon/workspace/hooks/useDaemonSessions.d.ts +1 -0
- package/dist/types/daemon/workspace/hooks/useDaemonSettings.d.ts +5 -1
- package/dist/types/daemon/workspace/types.d.ts +10 -3
- package/dist/types/hooks/composer-draft-session.d.ts +7 -3
- package/dist/types/hooks/useBackgroundTasks.d.ts +7 -2
- package/dist/types/hooks/useComposerCore.d.ts +14 -1
- package/dist/types/hooks/useInputHistory.d.ts +4 -1
- package/dist/types/hooks/useScopedSessions.d.ts +1 -0
- package/dist/types/hooks/useSessionScheduledTasks.d.ts +97 -0
- package/dist/types/session-catalog/session-catalog-hooks.d.ts +1 -0
- package/dist/types/settings.d.ts +2 -1
- package/dist/types/utils/action-timeout.d.ts +6 -0
- package/dist/types/utils/remote-prompt-sidechannel.d.ts +13 -0
- package/dist/types/utils/scheduledTaskManualRun.d.ts +29 -0
- package/dist/types/utils/service-availability.d.ts +20 -0
- package/dist/types/utils/sessionPreparation.d.ts +2 -1
- package/dist/types/utils/shell-result-display.d.ts +26 -0
- package/dist/types/utils/taskActivity.d.ts +6 -0
- package/dist/{useDaemonMidTurnInjected-jDVqCK0b.js → useDaemonMidTurnInjected-BItW6Ibf.js} +7996 -7670
- package/package.json +1 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export interface OverloadRefusal {
|
|
7
|
+
message: string;
|
|
8
|
+
expiresAt: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const OVERLOAD_REFUSAL_TTL_MS = 15000;
|
|
11
|
+
export declare const OVERLOAD_POLL_INTERVAL_MS = 5000;
|
|
12
|
+
/**
|
|
13
|
+
* Combines the two load-admission pause sources: the proactive status poll
|
|
14
|
+
* (`runtime.loadAdmission.overloaded`) and an unexpired `system_overloaded`
|
|
15
|
+
* refusal hint. The poll side is derived each render; the refusal side is a
|
|
16
|
+
* single expiring value owned by the caller, cleared through
|
|
17
|
+
* `onRefusalExpired` so a poll gap cannot hide a fresh refusal and the UI
|
|
18
|
+
* never stays paused longer than the daemon's retry hint without poll
|
|
19
|
+
* confirmation.
|
|
20
|
+
*
|
|
21
|
+
* Best-effort by design: without an ancestor workspace provider (embedded
|
|
22
|
+
* pickers, provider-less renders) the poll simply never runs instead of
|
|
23
|
+
* throwing, and the reactive refusal hint still works.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useDaemonOverloadPause(options: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
refusal: OverloadRefusal | null;
|
|
28
|
+
onRefusalExpired: () => void;
|
|
29
|
+
}): {
|
|
30
|
+
paused: boolean;
|
|
31
|
+
pollOverloaded: boolean;
|
|
32
|
+
loadAdmission: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
overloaded: boolean;
|
|
35
|
+
reason: string | null;
|
|
36
|
+
loadRatio: number;
|
|
37
|
+
eventLoopLagP99Ms: number;
|
|
38
|
+
sampledAtMs: number;
|
|
39
|
+
} | undefined;
|
|
40
|
+
refusalMessage: string | undefined;
|
|
41
|
+
};
|
|
@@ -25,6 +25,7 @@ export declare function useDaemonSessions(options?: DaemonSessionsOptions): {
|
|
|
25
25
|
workspaceCwd?: string;
|
|
26
26
|
sessionContext?: import("../../index.js").DaemonProductSessionContext;
|
|
27
27
|
artifactCountHint?: number;
|
|
28
|
+
restoredSession?: import("@qwen-code/sdk/daemon").DaemonSessionClient;
|
|
28
29
|
}) => Promise<void>) | undefined;
|
|
29
30
|
resumeSession: ((sessionId: string, options?: {
|
|
30
31
|
workspaceCwd?: string;
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { DaemonResourceOptions } from '../types.js';
|
|
7
|
-
|
|
7
|
+
interface DaemonSettingsOptions extends DaemonResourceOptions {
|
|
8
|
+
workspaceCwd?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function useDaemonSettings(options?: DaemonSettingsOptions): {
|
|
8
11
|
status: import("@qwen-code/sdk/daemon").DaemonWorkspaceSettingsStatus | undefined;
|
|
9
12
|
settings: import("@qwen-code/sdk/daemon").DaemonSettingDescriptor[];
|
|
10
13
|
setValue: (scope: "workspace" | "user", key: string, value: unknown, options?: {
|
|
@@ -23,3 +26,4 @@ export declare function useDaemonSettings(options?: DaemonResourceOptions): {
|
|
|
23
26
|
error?: Error;
|
|
24
27
|
}>;
|
|
25
28
|
};
|
|
29
|
+
export {};
|
|
@@ -170,6 +170,8 @@ export interface DaemonChannelPairingActions {
|
|
|
170
170
|
/** One recorded fire of a recurring scheduled task, newest last in
|
|
171
171
|
* {@link DaemonScheduledTask.runs}. Mirrors the daemon's wire shape. */
|
|
172
172
|
export interface DaemonScheduledTaskRun {
|
|
173
|
+
/** Distinguishes runs of the same task at the same timestamp. */
|
|
174
|
+
runId?: string;
|
|
173
175
|
/** Fire time (epoch ms). */
|
|
174
176
|
at: number;
|
|
175
177
|
/** `'scheduled'` (on-time), `'catch-up'` (fired late), or `'manual'` (user
|
|
@@ -539,11 +541,16 @@ export interface DaemonWorkspaceActions extends Pick<DaemonClient, 'getSubscript
|
|
|
539
541
|
listDirectory(dirPath: string): Promise<DaemonDirectoryListing>;
|
|
540
542
|
listScheduledTasks(workspaceId?: string): Promise<DaemonScheduledTask[]>;
|
|
541
543
|
createScheduledTask(req: DaemonCreateScheduledTaskRequest, workspaceId?: string): Promise<DaemonScheduledTask>;
|
|
542
|
-
|
|
544
|
+
/** Reject before executing a prompt or recording a run when this daemon
|
|
545
|
+
* cannot safely select the exact expected owner. */
|
|
546
|
+
assertScheduledTaskOwnerSelection(expectedSessionId?: string | null): Promise<void>;
|
|
547
|
+
/** The optional expected owner disambiguates same-id records; null means
|
|
548
|
+
* unbound, while omitting it retains compatibility for unique ids. */
|
|
549
|
+
updateScheduledTask(id: string, patch: DaemonUpdateScheduledTaskRequest, workspaceId?: string, expectedSessionId?: string | null): Promise<DaemonScheduledTask>;
|
|
543
550
|
/** Run now. Persistent tasks are only recorded here and are executed by the
|
|
544
551
|
* caller; per-run tasks are dispatched into a fresh daemon session. */
|
|
545
|
-
runScheduledTask(id: string, workspaceId?: string): Promise<DaemonScheduledTask>;
|
|
546
|
-
deleteScheduledTask(id: string, workspaceId?: string): Promise<void>;
|
|
552
|
+
runScheduledTask(id: string, workspaceId?: string, expectedSessionId?: string | null): Promise<DaemonScheduledTask>;
|
|
553
|
+
deleteScheduledTask(id: string, workspaceId?: string, expectedSessionId?: string | null): Promise<void>;
|
|
547
554
|
/** The `/autofix-pr` watches of a workspace's clone; `workspaceId` as for
|
|
548
555
|
* `listScheduledTasks`. Only to a daemon advertising `autofix_pr_watches`. */
|
|
549
556
|
listAutofixPrWatches(workspaceId?: string): Promise<DaemonAutofixPrWatchList>;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { DaemonInputAnnotation } from '@qwen-code/sdk/daemon';
|
|
2
2
|
import type { WebShellComposerTag } from '../customization';
|
|
3
|
-
import type { InlineTagPlacement } from './useComposerCore';
|
|
3
|
+
import type { InlineTagPlacement, PendingComposerDraftReferences } from './useComposerCore';
|
|
4
4
|
import { type ComposerDraftAttachments, type ComposerDraftAttachmentStore } from './composer-draft-attachments';
|
|
5
5
|
export interface ComposerDraftContent {
|
|
6
6
|
text: string;
|
|
7
7
|
inlineTags: InlineTagPlacement[];
|
|
8
8
|
tags: WebShellComposerTag[];
|
|
9
9
|
inputAnnotations: DaemonInputAnnotation[];
|
|
10
|
+
pendingCustomReferences?: PendingComposerDraftReferences;
|
|
10
11
|
}
|
|
11
|
-
type
|
|
12
|
-
|
|
12
|
+
export type ComposerDraftChange = 'content' | 'attachments' | 'clear' | {
|
|
13
|
+
addedReferences: InlineTagPlacement[];
|
|
14
|
+
};
|
|
15
|
+
type Listener = (change: ComposerDraftChange) => void;
|
|
13
16
|
export declare function findComposerDraftSession(key: string | undefined): ComposerDraftSession | undefined;
|
|
14
17
|
export declare function getComposerDraftSession(key: string, content: ComposerDraftContent, store: ComposerDraftAttachmentStore | null): ComposerDraftSession;
|
|
15
18
|
export declare class ComposerDraftSession {
|
|
@@ -32,6 +35,7 @@ export declare class ComposerDraftSession {
|
|
|
32
35
|
private release;
|
|
33
36
|
private emit;
|
|
34
37
|
setContent(content: ComposerDraftContent, source?: Listener): void;
|
|
38
|
+
resolveCustomReferences(addedReferences: InlineTagPlacement[]): void;
|
|
35
39
|
private persist;
|
|
36
40
|
setAttachments(attachments: ComposerDraftAttachments, clear?: boolean): void;
|
|
37
41
|
restoreAttachments(): void;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import type { DaemonSessionTaskWithWorkflowStatus } from '@qwen-code/sdk/daemon';
|
|
1
|
+
import type { DaemonSessionScheduledTaskStatus, DaemonSessionTaskWithWorkflowStatus } from '@qwen-code/sdk/daemon';
|
|
2
2
|
export declare function useBackgroundTasks(sessionId: string | undefined, taskActivityKey: string,
|
|
3
3
|
/**
|
|
4
4
|
* Whether any background task tool call is still running. Passed in as a
|
|
5
5
|
* fact rather than re-parsed out of `taskActivityKey`, whose rendering is
|
|
6
6
|
* not injective (callId is unconstrained text).
|
|
7
7
|
*/
|
|
8
|
-
taskActivityActive: boolean, connected: boolean, refreshTrigger?: number, workflowsEnabled?: boolean
|
|
8
|
+
taskActivityActive: boolean, connected: boolean, refreshTrigger?: number, workflowsEnabled?: boolean, onScheduledTasks?: (tasks: readonly DaemonSessionScheduledTaskStatus[]) => void,
|
|
9
|
+
/**
|
|
10
|
+
* Session cron / loop activity. Shares the one request-driven snapshot
|
|
11
|
+
* channel instead of opening an independent session-status request path.
|
|
12
|
+
*/
|
|
13
|
+
scheduledTaskActivityKey?: string): DaemonSessionTaskWithWorkflowStatus[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type ClipboardEventHandler, type DragEventHandler } from 'react';
|
|
2
2
|
import { EditorView } from '@codemirror/view';
|
|
3
|
-
import { Compartment } from '@codemirror/state';
|
|
3
|
+
import { Compartment, type ChangeDesc } from '@codemirror/state';
|
|
4
4
|
import type { CommandInfo } from '../adapters/types';
|
|
5
5
|
import type { PromptFile, PromptImage } from '../adapters/promptTypes';
|
|
6
6
|
import type { UseDaemonFollowupSuggestionReturn } from '@qwen-code/web-shell/daemon-react-sdk';
|
|
@@ -150,6 +150,19 @@ export interface UseComposerCoreOptions {
|
|
|
150
150
|
editorTheme: Parameters<typeof EditorView.theme>[0];
|
|
151
151
|
}
|
|
152
152
|
export declare function getComposerDraftStorageKey(sessionId: string | undefined, workspaceCwd: string | undefined): string | undefined;
|
|
153
|
+
interface ComposerReferenceDraft {
|
|
154
|
+
text: string;
|
|
155
|
+
inlineTags: InlineTagPlacement[];
|
|
156
|
+
tags: WebShellComposerTag[];
|
|
157
|
+
}
|
|
158
|
+
type DraftReferenceRange = Pick<InlineTagPlacement, 'start' | 'end'>;
|
|
159
|
+
type StoredComposerReferenceDraft = ComposerReferenceDraft & {
|
|
160
|
+
customInlineRanges?: DraftReferenceRange[];
|
|
161
|
+
};
|
|
162
|
+
export interface PendingComposerDraftReferences {
|
|
163
|
+
draft: StoredComposerReferenceDraft;
|
|
164
|
+
changes?: ChangeDesc;
|
|
165
|
+
}
|
|
153
166
|
export declare function captureComposerDraftGuard(storageKey: string | undefined): () => boolean;
|
|
154
167
|
export declare function clearComposerDraftIfMatches(storageKey: string | undefined, text: string): void;
|
|
155
168
|
export interface SearchState {
|
|
@@ -8,11 +8,14 @@ export declare function getShellHistoryStorageKey(workspaceCwd?: string): string
|
|
|
8
8
|
export declare function mergeRemoteInputHistory(localEntries: readonly string[], remoteEntries: readonly string[], previousRemoteEntries?: readonly string[] | null): string[];
|
|
9
9
|
export declare function pushInputHistoryEntry(storageKey: string, text: string, fallbackStorageKey?: string): void;
|
|
10
10
|
export declare function useInputHistory(storageKey?: string, fallbackStorageKey?: string, remoteHistoryEnabled?: boolean): {
|
|
11
|
-
push: (text: string
|
|
11
|
+
push: (text: string, { keepLocalOnRemoteMiss }?: {
|
|
12
|
+
keepLocalOnRemoteMiss?: boolean | undefined;
|
|
13
|
+
}) => void;
|
|
12
14
|
applyRemoteEntries: (remoteEntries: readonly string[], expectedMutationVersion?: number, remoteRevision?: string) => boolean;
|
|
13
15
|
getMutationVersion: () => number;
|
|
14
16
|
navigateUp: (currentText: string) => string | null;
|
|
15
17
|
navigateDown: () => string | null;
|
|
18
|
+
endNavigation: () => string | null;
|
|
16
19
|
isNavigating: () => boolean;
|
|
17
20
|
reset: () => void;
|
|
18
21
|
searchReverse: (query: string) => string | null;
|
|
@@ -30,6 +30,7 @@ export declare function useScopedSessions(workspaceCwd: string | undefined, opti
|
|
|
30
30
|
workspaceCwd?: string;
|
|
31
31
|
sessionContext?: import("@qwen-code/web-shell/daemon-react-sdk").DaemonProductSessionContext;
|
|
32
32
|
artifactCountHint?: number;
|
|
33
|
+
restoredSession?: import("@qwen-code/sdk/daemon").DaemonSessionClient;
|
|
33
34
|
}) => Promise<void>) | undefined;
|
|
34
35
|
resumeSession: ((sessionId: string, options?: {
|
|
35
36
|
workspaceCwd?: string;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { DaemonSessionScheduledTaskStatus } from '@qwen-code/sdk/daemon';
|
|
2
|
+
import { type DaemonScheduledTask } from '@qwen-code/web-shell/daemon-react-sdk';
|
|
3
|
+
import { scheduledTaskRuntimeKey } from '../components/dialogs/scheduledTasksSchedule';
|
|
4
|
+
import { type ScheduledTaskRunPrompt } from '../utils/scheduledTaskManualRun';
|
|
5
|
+
export type ScheduledTaskActionErrorHandler = (err: unknown, fallback: string) => void;
|
|
6
|
+
export interface SessionDurableScheduledTask {
|
|
7
|
+
scope: 'durable';
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
prompt: string;
|
|
11
|
+
cronExpr: string;
|
|
12
|
+
recurring: boolean;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
lastFiredAt: number | null;
|
|
16
|
+
nextRunAt: number | null;
|
|
17
|
+
gate: string | null;
|
|
18
|
+
workspaceId?: string;
|
|
19
|
+
task: DaemonScheduledTask;
|
|
20
|
+
}
|
|
21
|
+
export interface SessionScopedScheduledTask {
|
|
22
|
+
scope: 'session';
|
|
23
|
+
source: 'cron' | 'wakeup';
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
prompt: string;
|
|
27
|
+
cronExpr: string;
|
|
28
|
+
recurring: boolean;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
createdAt: number;
|
|
31
|
+
lastFiredAt: number | null;
|
|
32
|
+
nextRunAt: number | null;
|
|
33
|
+
expiresAt: number | null;
|
|
34
|
+
gate?: string;
|
|
35
|
+
task: DaemonSessionScheduledTaskStatus;
|
|
36
|
+
}
|
|
37
|
+
export type SessionScheduledTask = SessionDurableScheduledTask | SessionScopedScheduledTask;
|
|
38
|
+
export { scheduledTaskRuntimeKey };
|
|
39
|
+
export type SessionScheduledTaskLiveState = 'active' | 'paused';
|
|
40
|
+
export interface SessionScheduledTasksResult {
|
|
41
|
+
tasks: readonly SessionScheduledTask[];
|
|
42
|
+
activeCount: number;
|
|
43
|
+
activeSessionCount: number;
|
|
44
|
+
nextRunAt: number | null;
|
|
45
|
+
taskStatusById: ReadonlyMap<string, SessionScheduledTaskLiveState>;
|
|
46
|
+
liveSessionTaskById: ReadonlyMap<string, DaemonSessionScheduledTaskStatus>;
|
|
47
|
+
confirmedDeletedDurableTaskKeys: ReadonlySet<string>;
|
|
48
|
+
isDurableTaskDeletionConfirmed: (task: {
|
|
49
|
+
id: string;
|
|
50
|
+
workspaceId?: string;
|
|
51
|
+
sessionId?: string | null;
|
|
52
|
+
}) => boolean;
|
|
53
|
+
confirmedCancelledSessionTaskIds: ReadonlySet<string>;
|
|
54
|
+
confirmSessionCancellation: (taskId: string, expectedSessionId?: string, source?: 'cron' | 'wakeup') => void;
|
|
55
|
+
confirmDurableDeletion: (task: {
|
|
56
|
+
id: string;
|
|
57
|
+
workspaceId?: string;
|
|
58
|
+
sessionId?: string | null;
|
|
59
|
+
}) => void;
|
|
60
|
+
hasLiveDurableSnapshot: boolean;
|
|
61
|
+
hasLiveSessionSnapshot: boolean;
|
|
62
|
+
busyIds: ReadonlySet<string>;
|
|
63
|
+
manualRunActive: boolean;
|
|
64
|
+
syncSessionTasks: (tasks: readonly DaemonSessionScheduledTaskStatus[]) => void;
|
|
65
|
+
refresh: () => void;
|
|
66
|
+
toggleDurableTask: (task: SessionDurableScheduledTask) => Promise<void>;
|
|
67
|
+
runDurableTask: (task: SessionDurableScheduledTask) => Promise<void>;
|
|
68
|
+
deleteDurableTask: (task: SessionDurableScheduledTask) => Promise<boolean>;
|
|
69
|
+
cancelSessionTask: (task: SessionScopedScheduledTask) => Promise<boolean>;
|
|
70
|
+
cancelSessionTaskById: (taskId: string, source?: 'cron' | 'wakeup') => Promise<boolean>;
|
|
71
|
+
}
|
|
72
|
+
export declare function useSessionScheduledTasks(options: {
|
|
73
|
+
sessionId: string | undefined;
|
|
74
|
+
workspaceId: string | undefined;
|
|
75
|
+
workspaceCwd?: string;
|
|
76
|
+
connected: boolean;
|
|
77
|
+
durableEnabled: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Actual evidence of scheduling in this conversation. Empty means silent:
|
|
80
|
+
* no always-on durable HTTP probe on ordinary conversation opens.
|
|
81
|
+
*/
|
|
82
|
+
activityKey: string;
|
|
83
|
+
/** Session is a dedicated persistent scheduled-task conversation. */
|
|
84
|
+
durableSeeded?: boolean;
|
|
85
|
+
/** Actual bound-session prompt admission, not the record-only /run route. */
|
|
86
|
+
onRunPrompt: ScheduledTaskRunPrompt;
|
|
87
|
+
shouldRefuseManualRun?: (task: DaemonScheduledTask) => boolean;
|
|
88
|
+
onOverloadRefused?: () => void;
|
|
89
|
+
onError: ScheduledTaskActionErrorHandler;
|
|
90
|
+
/**
|
|
91
|
+
* App calls this hook above the `<I18nProvider>` it renders, where `useI18n()`
|
|
92
|
+
* falls back to key passthrough. Passing App's translator localizes errors
|
|
93
|
+
* constructed inside the hook and manual-run helper too.
|
|
94
|
+
*/
|
|
95
|
+
translate?: (key: string) => string;
|
|
96
|
+
refreshTrigger?: number;
|
|
97
|
+
}): SessionScheduledTasksResult;
|
|
@@ -105,6 +105,7 @@ export declare function useWebShellSessions(options?: WebShellSessionsOptions):
|
|
|
105
105
|
workspaceCwd?: string;
|
|
106
106
|
sessionContext?: import("@qwen-code/web-shell/daemon-react-sdk").DaemonProductSessionContext;
|
|
107
107
|
artifactCountHint?: number;
|
|
108
|
+
restoredSession?: import("@qwen-code/sdk/daemon").DaemonSessionClient;
|
|
108
109
|
}) => Promise<void>) | undefined;
|
|
109
110
|
resumeSession: ((sessionId: string, options?: {
|
|
110
111
|
workspaceCwd?: string;
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare const SETTING_KEYS: {
|
|
|
56
56
|
readonly 'setting:max-sessions': "serve.maxSessions";
|
|
57
57
|
readonly 'setting:model-proposed-goals': "goals.modelProposed";
|
|
58
58
|
readonly 'setting:arena-artifacts': "agents.arena.preserveArtifacts";
|
|
59
|
+
readonly 'setting:worktree-retention': "worktree.maxRetained";
|
|
59
60
|
readonly 'setting:session-workflow': "experimental.sessionWorkflow";
|
|
60
61
|
readonly 'setting:generated-ui': "experimental.generatedUi";
|
|
61
62
|
readonly 'setting:scheduled-tasks': "experimental.cron";
|
|
@@ -72,7 +73,7 @@ declare const SETTING_KEYS: {
|
|
|
72
73
|
readonly 'setting:voice-model': "voiceModel";
|
|
73
74
|
readonly 'setting:image-model': "imageModel";
|
|
74
75
|
};
|
|
75
|
-
declare const BUILTIN_IDS: readonly ["builtin:chat-width", "builtin:browser-notifications", "builtin:live-setup", "builtin:local-control", "builtin:connections", "builtin:archived-sessions", "builtin:workspace-directories", "builtin:model-management"];
|
|
76
|
+
declare const BUILTIN_IDS: readonly ["builtin:chat-width", "builtin:arrow-key-history", "builtin:browser-notifications", "builtin:live-setup", "builtin:local-control", "builtin:connections", "builtin:archived-sessions", "builtin:workspace-directories", "builtin:model-management"];
|
|
76
77
|
export type WebShellSettingItemId = keyof typeof SETTING_KEYS | (typeof BUILTIN_IDS)[number];
|
|
77
78
|
export declare const WEB_SHELL_SETTING_ITEM_IDS: readonly WebShellSettingItemId[];
|
|
78
79
|
export interface WebShellSettingsOptions {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
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 {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { DaemonScheduledTask, DaemonWorkspaceActions } from '@qwen-code/web-shell/daemon-react-sdk';
|
|
7
|
+
import type { TranslateFn } from '../components/dialogs/scheduledTasksSchedule.js';
|
|
8
|
+
export type ScheduledTaskRunPrompt = (prompt: string, sessionId: string | null, workspaceCwd?: string, isStale?: () => boolean, beforeDispatch?: () => void | Promise<void>) => void | Promise<void>;
|
|
9
|
+
export declare function createScheduledTaskCancellation(message: string): DOMException;
|
|
10
|
+
export declare function isScheduledTaskCancellation(error: unknown): boolean;
|
|
11
|
+
export interface ScheduledTaskManualRunErrorHandlers {
|
|
12
|
+
reload: () => void | Promise<void>;
|
|
13
|
+
onError: (err: unknown, fallback: string) => void;
|
|
14
|
+
isCurrent?: () => boolean;
|
|
15
|
+
/** Checks the direct daemon path selected by the fresh task mode. */
|
|
16
|
+
isDirectDispatchCurrent?: () => boolean;
|
|
17
|
+
/** Optional stronger guard for the original SDK owner of a one-shot. */
|
|
18
|
+
isOwnerCurrent?: () => boolean;
|
|
19
|
+
/** Reports a consumed one-shot even when its original UI scope is gone. */
|
|
20
|
+
onOneShotError?: (error: unknown, fallback: string) => void;
|
|
21
|
+
/** True once this owner/task deletion has been confirmed. */
|
|
22
|
+
isStale?: () => boolean;
|
|
23
|
+
/** Re-read live App state after refresh, before a manual run consumes a
|
|
24
|
+
* one-shot or dispatches a fresh-session attempt that must be refused. */
|
|
25
|
+
shouldRefuseManualRun?: (task: DaemonScheduledTask) => boolean;
|
|
26
|
+
overloadDetail?: string;
|
|
27
|
+
onOverloadRefused?: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function runScheduledTaskManually(task: DaemonScheduledTask, actions: Pick<DaemonWorkspaceActions, 'listScheduledTasks' | 'runScheduledTask' | 'assertScheduledTaskOwnerSelection'>, onRunPrompt: ScheduledTaskRunPrompt, t: TranslateFn, { reload, onError, isCurrent, isStale, isDirectDispatchCurrent, isOwnerCurrent, onOneShotError, shouldRefuseManualRun, overloadDetail, onOverloadRefused, }: ScheduledTaskManualRunErrorHandlers): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export type ServiceAvailabilityState = 'available' | 'unavailable' | 'auth-required';
|
|
7
|
+
export interface ServiceAvailabilityController {
|
|
8
|
+
getSnapshot(): ServiceAvailabilityState;
|
|
9
|
+
subscribe(listener: () => void): () => void;
|
|
10
|
+
assertAvailable(): void;
|
|
11
|
+
getGeneration(): number;
|
|
12
|
+
reportFailure(error: unknown, signal?: AbortSignal, generation?: number, source?: 'fetch' | 'consumer'): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class ServiceUnavailableError extends Error {
|
|
15
|
+
constructor(message?: string);
|
|
16
|
+
}
|
|
17
|
+
export declare function isServiceUnavailableError(error: unknown): boolean;
|
|
18
|
+
export declare const ServiceAvailabilityContext: import("react").Context<ServiceAvailabilityController | undefined>;
|
|
19
|
+
export declare function useServiceAvailabilityController(): ServiceAvailabilityController | undefined;
|
|
20
|
+
export declare function useServiceAvailability(): ServiceAvailabilityState;
|
|
@@ -50,10 +50,11 @@ type PromptSessionActions = {
|
|
|
50
50
|
}) => Promise<void>;
|
|
51
51
|
};
|
|
52
52
|
export declare function isDaemonApprovalMode(mode: string): mode is DaemonApprovalMode;
|
|
53
|
-
export declare function createAndAttachSessionForPrompt({ sessionActions, modelId, startupConfig, reasoningEffort, modeId, planMode, workspaceCwd, sessionContext, worktree, branch, sessionSourceType, onSessionCreated, onSessionAllocated, getCurrentSessionId, getCurrentWorkspaceCwd, sourceVersion, getCurrentSourceVersion, warn, }: {
|
|
53
|
+
export declare function createAndAttachSessionForPrompt({ sessionActions, modelId, startupConfig, supportsSessionStartupConfig, reasoningEffort, modeId, planMode, workspaceCwd, sessionContext, worktree, branch, sessionSourceType, onSessionCreated, onSessionAllocated, getCurrentSessionId, getCurrentWorkspaceCwd, sourceVersion, getCurrentSourceVersion, warn, }: {
|
|
54
54
|
sessionActions: PromptSessionActions;
|
|
55
55
|
modelId?: string;
|
|
56
56
|
startupConfig?: SessionStartupConfig;
|
|
57
|
+
supportsSessionStartupConfig?: boolean;
|
|
57
58
|
reasoningEffort?: ReasoningSelection;
|
|
58
59
|
modeId?: string;
|
|
59
60
|
planMode?: boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Browser-safe runtime guard for `ShellResultDisplay` matching
|
|
8
|
+
* `@qwen-code/qwen-code-core/shellResult` so shared tool-output renderers do
|
|
9
|
+
* not pull `@qwen-code/sdk/daemon` into the managed-only bundle.
|
|
10
|
+
*/
|
|
11
|
+
export interface ShellResultDisplay {
|
|
12
|
+
type: 'shell_result';
|
|
13
|
+
version: 1;
|
|
14
|
+
text: string;
|
|
15
|
+
output: string;
|
|
16
|
+
directory: string;
|
|
17
|
+
exitCode: number | null;
|
|
18
|
+
signal: number | null;
|
|
19
|
+
pid: number | null;
|
|
20
|
+
error: string | null;
|
|
21
|
+
outcome: 'completed' | 'failed' | 'cancelled' | 'timed_out';
|
|
22
|
+
notices: string[];
|
|
23
|
+
truncated: boolean;
|
|
24
|
+
outputFiles: string[];
|
|
25
|
+
}
|
|
26
|
+
export declare function isShellResultDisplay(value: unknown): value is ShellResultDisplay;
|
|
@@ -16,3 +16,9 @@ export declare function getTaskActivityKey(messages: readonly Message[]): string
|
|
|
16
16
|
export declare function hasActiveTaskActivity(messages: readonly Message[], options?: {
|
|
17
17
|
workflowsEnabled?: boolean;
|
|
18
18
|
}): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Change-detection key for cron/loop activity in a session's transcript.
|
|
21
|
+
* Covers tool invocations and cron/loop-triggered user turns so live session
|
|
22
|
+
* scheduled task views re-sync after creates, deletes, wakeups, and fires.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getScheduledTaskActivityKey(messages: readonly Message[]): string;
|