@qwen-code/web-shell 0.26.9 → 0.27.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 +5 -1
- package/dist/{PierreFilePreview-BWMV28K1.js → PierreFilePreview-UEHqgsfd.js} +1 -1
- package/dist/{SpreadsheetPreview-CpnnnQKn.js → SpreadsheetPreview-DT0Ef-9o.js} +2 -2
- package/dist/{WorkspaceFileBrowser-CwWFGqIW.js → WorkspaceFileBrowser-DRl4-_bE.js} +2 -2
- package/dist/{agents-route-BmgI-UF0.js → agents-route-BHbUCmGg.js} +2 -2
- package/dist/daemon-react-sdk.js +1 -1
- package/dist/{index-DrPRgTJc.js → index-FAyAO_wv.js} +58733 -56725
- package/dist/index.js +3 -3
- package/dist/sw.js +1 -1
- package/dist/transcript.js +8698 -8492
- package/dist/types/ManagedAgentWebShell.d.ts +15 -2
- package/dist/types/browser-notifications/messages.d.ts +9 -0
- package/dist/types/browser-notifications/messages.transcript-stub.d.ts +7 -0
- package/dist/types/completions/slashCompletion.d.ts +1 -0
- package/dist/types/components/SessionLimitBanner.d.ts +4 -0
- package/dist/types/components/StreamingStatus.d.ts +4 -1
- package/dist/types/components/WaitingMinigame.d.ts +24 -0
- package/dist/types/components/artifacts/tool-call-content.d.ts +2 -1
- package/dist/types/components/channels/channel-editor-state.d.ts +28 -1
- package/dist/types/components/managed/ManagedQuestionForm.d.ts +8 -1
- package/dist/types/components/managed/managed-agent-provider.d.ts +1 -0
- package/dist/types/components/managed/use-managed-actions.d.ts +8 -2
- package/dist/types/components/messages/AskUserQuestion.d.ts +7 -1
- package/dist/types/components/messages/toolFormatting.d.ts +23 -0
- package/dist/types/daemon/session/httpErrors.d.ts +1 -0
- package/dist/types/daemon/session/types.d.ts +5 -0
- package/dist/types/hooks/useQueuedPrompts.d.ts +4 -1
- package/dist/types/hooks/useScopedSessions.d.ts +4 -0
- package/dist/types/session-catalog/session-catalog-hooks.d.ts +1 -0
- package/dist/types/utils/askUserPermission.d.ts +7 -0
- package/dist/types/utils/waitingActivity.d.ts +55 -0
- package/dist/types/utils/waitingGamesConfig.d.ts +7 -0
- package/dist/types/utils/waitingMinigame.d.ts +53 -0
- package/dist/types/utils/waitingSnake.d.ts +40 -0
- package/dist/{useDaemonMidTurnInjected-4PDPakvk.js → useDaemonMidTurnInjected-Dhe-I6yG.js} +3297 -3135
- package/package.json +1 -1
|
@@ -12,8 +12,14 @@ import { type WebShellTheme } from './themeContext';
|
|
|
12
12
|
*/
|
|
13
13
|
type ManagedSessionsNavigationProps = Pick<ComponentProps<typeof ManagedSessionsPage>, 'navigationTarget' | 'archivedNavigationTarget' | 'onArchivedSessionsStatusChange' | 'navigationActive' | 'navigationSearch'>;
|
|
14
14
|
/** Change productScope with tenant/actor identity so saved selections and output caches are discarded. */
|
|
15
|
-
export interface ManagedAgentWebShellProps extends JavaManagedAgentProviderOptions, ManagedSessionsNavigationProps {
|
|
15
|
+
export interface ManagedAgentWebShellProps extends Omit<JavaManagedAgentProviderOptions, 'baseUrl'>, ManagedSessionsNavigationProps {
|
|
16
16
|
managedAgentProvider?: ManagedAgentProvider;
|
|
17
|
+
/**
|
|
18
|
+
* Backend base URL for the built-in Java provider. Required unless
|
|
19
|
+
* `managedAgentProvider` is supplied; a missing value fails loudly instead
|
|
20
|
+
* of resolving requests against `<origin>/undefined`.
|
|
21
|
+
*/
|
|
22
|
+
baseUrl?: string;
|
|
17
23
|
/** Only open the existing Session explicitly selected by the host. */
|
|
18
24
|
hostSessionOnly?: boolean;
|
|
19
25
|
sessionId?: string;
|
|
@@ -24,6 +30,13 @@ export interface ManagedAgentWebShellProps extends JavaManagedAgentProviderOptio
|
|
|
24
30
|
className?: string;
|
|
25
31
|
style?: CSSProperties;
|
|
26
32
|
}
|
|
27
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Managed-only 产品入口,不创建 daemon workspace/session context。
|
|
35
|
+
*
|
|
36
|
+
* The provider (and its `baseUrl` guard) resolves one level below this
|
|
37
|
+
* boundary: an error boundary cannot catch a throw from the component that
|
|
38
|
+
* renders it, and a host mounting before its config resolves would otherwise
|
|
39
|
+
* get a blank container instead of the shell's own fallback.
|
|
40
|
+
*/
|
|
28
41
|
export declare function ManagedAgentWebShell(props: ManagedAgentWebShellProps): import("react/jsx-runtime").JSX.Element;
|
|
29
42
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
type BrowserNotificationMessage = string | ((vars?: Record<string, string | number>) => string);
|
|
7
|
+
export declare const BROWSER_NOTIFICATION_MESSAGES_EN: Record<string, BrowserNotificationMessage>;
|
|
8
|
+
export declare const BROWSER_NOTIFICATION_MESSAGES_ZH: Record<string, BrowserNotificationMessage>;
|
|
9
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
interface StreamingStatusProps {
|
|
2
3
|
startedAt?: number;
|
|
3
4
|
backgroundLabel?: string;
|
|
@@ -16,6 +17,8 @@ interface StreamingStatusProps {
|
|
|
16
17
|
*/
|
|
17
18
|
hasActivePrompt?: boolean;
|
|
18
19
|
showResponseTokensPerSecond?: boolean;
|
|
20
|
+
/** Optional control rendered after the status metadata, e.g. the minigame. */
|
|
21
|
+
trailing?: ReactNode;
|
|
19
22
|
}
|
|
20
|
-
export declare function StreamingStatus({ startedAt, backgroundLabel, showPhrase, hasActivePrompt, showResponseTokensPerSecond, }: StreamingStatusProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
export declare function StreamingStatus({ startedAt, backgroundLabel, showPhrase, hasActivePrompt, showResponseTokensPerSecond, trailing, }: StreamingStatusProps): import("react/jsx-runtime").JSX.Element | null;
|
|
21
24
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { type WaitingActivityDay, type WaitingTokenUsage } from '../utils/waitingActivity';
|
|
7
|
+
export interface WaitingMinigameProps {
|
|
8
|
+
open: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
activity?: readonly WaitingActivityDay[];
|
|
11
|
+
tokenUsage?: WaitingTokenUsage;
|
|
12
|
+
/** Jump to the message that represents the clicked activity bucket. */
|
|
13
|
+
onSelectActivity?: (messageId: string) => void;
|
|
14
|
+
/** Game entry is opt-in; the activity and token views are always available. */
|
|
15
|
+
gamesEnabled?: boolean;
|
|
16
|
+
/** Delay before the game entry appears; the product default is 5s. */
|
|
17
|
+
entryDelayMs?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function WaitingMinigame({ open, onClose, activity, tokenUsage, onSelectActivity, gamesEnabled, entryDelayMs, }: WaitingMinigameProps): import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export interface WaitingMinigameButtonProps {
|
|
21
|
+
open: boolean;
|
|
22
|
+
onToggle: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function WaitingMinigameButton({ open, onToggle, }: WaitingMinigameButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { DaemonToolTranscriptBlock } from '@qwen-code/sdk/daemon';
|
|
7
7
|
import type { ACPToolCall } from '../../adapters/types';
|
|
8
|
+
import { stringifyValue } from '../messages/toolFormatting';
|
|
8
9
|
/** The longest stretch of one argument or result put in the DOM by default. */
|
|
9
10
|
export declare const MAX_DETAIL_LENGTH = 4000;
|
|
10
|
-
export
|
|
11
|
+
export { stringifyValue };
|
|
11
12
|
/** Valid JSON renders as a code block; anything else stays plain text. */
|
|
12
13
|
export declare function ToolCallDetail({ text, limit, }: {
|
|
13
14
|
text: string;
|
|
@@ -30,7 +30,7 @@ export interface ChannelGroupOverrideDraft {
|
|
|
30
30
|
senders: '' | 'open' | 'allowlist';
|
|
31
31
|
allowedUsers: string;
|
|
32
32
|
}
|
|
33
|
-
export type ChannelEditorValidationCode = 'required' | 'credential' | 'duplicate' | 'invalid' | 'invalidGroupId' | 'invalidOption' | 'invalidRepoId' | 'conflictingRepoAliases' | 'invalidGroupEntry' | 'number' | 'outOfRange' | 'policy' | 'requiresBoundDelivery';
|
|
33
|
+
export type ChannelEditorValidationCode = 'required' | 'credential' | 'duplicate' | 'invalid' | 'invalidGroupId' | 'invalidOption' | 'invalidRepoId' | 'repoFilterRequired' | 'conflictingRepoAliases' | 'invalidGroupEntry' | 'number' | 'outOfRange' | 'policy' | 'requiresBoundDelivery';
|
|
34
34
|
export type ChannelEditorValidationErrors = Record<string, ChannelEditorValidationCode>;
|
|
35
35
|
/** Access fields that only gate direct messages, which repository-only channels never receive. */
|
|
36
36
|
export declare const PRIVATE_ONLY_FIELD_KEYS: Set<string>;
|
|
@@ -40,6 +40,33 @@ export declare const PRIVATE_ONLY_FIELD_KEYS: Set<string>;
|
|
|
40
40
|
* and a row for a half-typed repository would only flicker.
|
|
41
41
|
*/
|
|
42
42
|
export declare function repositoryAllowlistIds(value: string): string[];
|
|
43
|
+
/** Whether the repository event filter processes a list at all. */
|
|
44
|
+
export declare function isRepoFilterActive(mode: unknown): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* GitHub areas whose two-segment URLs look like `owner/repo` but are not
|
|
47
|
+
* repositories. Shortening one would silently filter a nonexistent
|
|
48
|
+
* repository — fatal under an allowlist — so these URLs pass through
|
|
49
|
+
* unchanged and validation rejects them by name instead.
|
|
50
|
+
*
|
|
51
|
+
* Best-effort by construction: a denylist of GitHub's top-level paths cannot
|
|
52
|
+
* be complete, and a future GitHub area can reintroduce the hazard until it
|
|
53
|
+
* is added here. The enumerated test over this set keeps every listed root
|
|
54
|
+
* rejected; the residual risk is documented in the design doc.
|
|
55
|
+
*
|
|
56
|
+
* Exported so the test can enumerate every member instead of sampling a few.
|
|
57
|
+
*/
|
|
58
|
+
export declare const GITHUB_RESERVED_URL_PATHS: Set<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Canonicalize the repository filter input: lowercase, deduplicate, strip
|
|
61
|
+
* trailing sentence punctuation a paste can carry (`.`, `)`, …), and shorten
|
|
62
|
+
* GitHub web URLs (repository, PR, or issue pages, with an optional `.git`,
|
|
63
|
+
* trailing path, query, or fragment) to `owner/repo` — only when the URL's
|
|
64
|
+
* host is the channel's own GitHub web host and its path is not the baseUrl's
|
|
65
|
+
* API prefix. Entries that are not repository URLs on that host pass through
|
|
66
|
+
* unchanged so validation can name them. Shared by the validator and the save
|
|
67
|
+
* path so the two cannot disagree.
|
|
68
|
+
*/
|
|
69
|
+
export declare function normalizeRepositoryFilterInput(value: string, baseUrl?: string): string;
|
|
43
70
|
export declare function toList(value: string): string[];
|
|
44
71
|
/**
|
|
45
72
|
* The one record rule, shared by validation, the save path, and the editor's
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { ManagedAgentPendingQuestionAction, ManagedAgentQuestionResponse } from './managed-agent-provider';
|
|
2
|
-
export
|
|
2
|
+
export type ManagedQuestionDraft = Record<string, {
|
|
3
|
+
optionIds: string[];
|
|
4
|
+
text: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function ManagedQuestionForm({ action, draft, onDraftChange, submitting, disabled, onSubmit, }: {
|
|
3
7
|
action: ManagedAgentPendingQuestionAction;
|
|
8
|
+
draft: ManagedQuestionDraft;
|
|
9
|
+
onDraftChange(draft: ManagedQuestionDraft): void;
|
|
10
|
+
submitting: boolean;
|
|
4
11
|
disabled?: boolean;
|
|
5
12
|
onSubmit(response: ManagedAgentQuestionResponse): Promise<void>;
|
|
6
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -208,6 +208,7 @@ interface ManagedAgentActionIdentity {
|
|
|
208
208
|
toolName: string;
|
|
209
209
|
inputRevision: number;
|
|
210
210
|
policyRevision: string;
|
|
211
|
+
createdAt?: number;
|
|
211
212
|
expiresAt: number;
|
|
212
213
|
}
|
|
213
214
|
export interface ManagedAgentPendingPermissionAction extends ManagedAgentActionIdentity {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { ManagedAgentPendingAction, ManagedAgentActionResponse, ManagedAgentProvider, ManagedAgentSessionEvent } from './managed-agent-provider';
|
|
2
|
+
import type { ManagedQuestionDraft } from './ManagedQuestionForm';
|
|
3
|
+
export declare function managedActionKey(action: ManagedAgentPendingAction): string;
|
|
2
4
|
export interface ManagedActionsState {
|
|
3
5
|
actions: readonly ManagedAgentPendingAction[];
|
|
4
|
-
/** The
|
|
6
|
+
/** The selected pending request; answered ones stay hidden while they settle. */
|
|
5
7
|
action?: ManagedAgentPendingAction;
|
|
8
|
+
select(action: ManagedAgentPendingAction): void;
|
|
9
|
+
questionDraft: ManagedQuestionDraft;
|
|
10
|
+
setQuestionDraft(action: ManagedAgentPendingAction, draft: ManagedQuestionDraft): void;
|
|
11
|
+
submitting: boolean;
|
|
6
12
|
/** Reading the pending approvals failed; retries run in the background. */
|
|
7
13
|
loadError?: unknown;
|
|
8
14
|
/**
|
|
@@ -21,7 +27,7 @@ export interface ManagedActionsState {
|
|
|
21
27
|
* re-probes instead of treating one 403 as permanent for the mount.
|
|
22
28
|
*/
|
|
23
29
|
respondForbidden: boolean;
|
|
24
|
-
respond(
|
|
30
|
+
respond(action: ManagedAgentPendingAction, response: ManagedAgentActionResponse): Promise<void>;
|
|
25
31
|
/** Reads the pending approvals again now. */
|
|
26
32
|
retry(): void;
|
|
27
33
|
}
|
|
@@ -5,6 +5,12 @@ interface AskUserQuestionProps {
|
|
|
5
5
|
onError: (error: unknown, fallback: string) => void;
|
|
6
6
|
variant?: 'inline' | 'floating';
|
|
7
7
|
customInputLabel?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Opens a side task that explains the pending question before the user
|
|
10
|
+
* answers. Omitted when the host has no side-task surface, which hides the
|
|
11
|
+
* action entirely.
|
|
12
|
+
*/
|
|
13
|
+
onAskDetails?: () => void;
|
|
8
14
|
/**
|
|
9
15
|
* Whether this question should pull keyboard focus to its first option when it
|
|
10
16
|
* becomes the topmost one. Defaults to true. Split-view panes pass false so an
|
|
@@ -14,5 +20,5 @@ interface AskUserQuestionProps {
|
|
|
14
20
|
*/
|
|
15
21
|
keyboardActive?: boolean;
|
|
16
22
|
}
|
|
17
|
-
export declare function AskUserQuestion({ request, onConfirm, onError, variant, keyboardActive, customInputLabel, }: AskUserQuestionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
export declare function AskUserQuestion({ request, onConfirm, onError, variant, keyboardActive, customInputLabel, onAskDetails, }: AskUserQuestionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
18
24
|
export {};
|
|
@@ -30,6 +30,29 @@ export declare function getQuestionAnswerResult(tool: ACPToolCall): {
|
|
|
30
30
|
}>;
|
|
31
31
|
} | null;
|
|
32
32
|
export declare function truncateText(text: string, max: number): string;
|
|
33
|
+
/** Longest payload stretch a transcript card renders before "Show more". */
|
|
34
|
+
export declare const MAX_TOOL_PAYLOAD_LENGTH = 4000;
|
|
35
|
+
/** Ceiling after "Show more", matching the trajectory inspector. */
|
|
36
|
+
export declare const EXPANDED_TOOL_PAYLOAD_LENGTH = 40000;
|
|
37
|
+
export declare function stringifyValue(value: unknown): string;
|
|
38
|
+
/**
|
|
39
|
+
* Re-indents a canonical JSON object or array for display. The input must be
|
|
40
|
+
* exactly its compact JSON form or its two-space form; anything else — plain
|
|
41
|
+
* text, a primitive, a truncated document, JSON Lines, a mixed JSON/text log
|
|
42
|
+
* or non-canonical JSON — is returned as recorded so the caller can fall back
|
|
43
|
+
* to plain text. Formatting therefore never rewrites literals, duplicate
|
|
44
|
+
* keys, key order or string escapes.
|
|
45
|
+
*
|
|
46
|
+
* These rules are scoped to the transcript tool card. The sibling
|
|
47
|
+
* ToolCallDetail used by the turn-calls / trajectory panes still fences via a
|
|
48
|
+
* bare JSON.parse, so identical bytes can render differently per surface;
|
|
49
|
+
* lifting one shared Arguments/Result renderer is tracked as a follow-up
|
|
50
|
+
* rather than widened into this change.
|
|
51
|
+
*/
|
|
52
|
+
export declare function formatJsonPayload(text: string, maxFormattedLength?: number, maxInputLength?: number): {
|
|
53
|
+
text: string;
|
|
54
|
+
json: boolean;
|
|
55
|
+
};
|
|
33
56
|
export declare function getToolDescription(tool: ACPToolCall, workspaceCwd?: string): string;
|
|
34
57
|
export declare function getToolSummaryDescription(tool: ACPToolCall, workspaceCwd?: string): string;
|
|
35
58
|
export declare function getShellToolSemanticDescription(tool: ACPToolCall): string;
|
|
@@ -6,5 +6,6 @@
|
|
|
6
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
|
+
export declare function isSessionLimitExceededError(error: unknown): boolean;
|
|
9
10
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
10
11
|
export declare function isRecoverableAcpCapacityError(error: unknown): boolean;
|
|
@@ -84,6 +84,11 @@ export interface DaemonConnectionState {
|
|
|
84
84
|
/** Authoritative Goal v2 state for the current session. */
|
|
85
85
|
goalState?: GoalSnapshotV2;
|
|
86
86
|
backgroundTurn?: DaemonBackgroundTurn;
|
|
87
|
+
/** Browser-owned send, including the gap before an authoritative user echo. */
|
|
88
|
+
localPrompt?: {
|
|
89
|
+
sessionId: string;
|
|
90
|
+
startedAt: number;
|
|
91
|
+
};
|
|
87
92
|
/** Stops a lagging live-state snapshot from reviving the finished execution. */
|
|
88
93
|
finishedBackgroundTurnId?: string;
|
|
89
94
|
/** Local monotonic time; orders background events against live-state requests. */
|
|
@@ -36,6 +36,9 @@ interface UseQueuedPromptsArgs {
|
|
|
36
36
|
* the legacy local fallback used by older daemons.
|
|
37
37
|
*/
|
|
38
38
|
canQueryMidTurn: boolean;
|
|
39
|
+
/** Whether `session_prompt` advertises the native prompt queue routes.
|
|
40
|
+
* OpenAPI hosts can send prompts without exposing the daemon queue. */
|
|
41
|
+
canQueryPendingPrompts: boolean;
|
|
39
42
|
/**
|
|
40
43
|
* Whether the daemon advertises `session_attachments`. With it,
|
|
41
44
|
* attachments travel with a mid-turn message and are injected into the
|
|
@@ -76,5 +79,5 @@ export interface UseQueuedPromptsResult {
|
|
|
76
79
|
editLastQueuedPrompt: () => boolean;
|
|
77
80
|
clearQueuedPrompts: () => boolean;
|
|
78
81
|
}
|
|
79
|
-
export declare function useQueuedPrompts({ getPromptDispatchError, connected, writeBlocked, runtimeStopped, sessionId, workspaceCwd, clientId, canMutateMidTurn, canQueryMidTurn, canInjectMidTurnMedia, workspaceFileActions, streamingState, sessionHasActivePrompt, holdQueuedPromptsLocally, sessionActions: unguardedSessionActions, store, editorRef, reportError, t, }: UseQueuedPromptsArgs): UseQueuedPromptsResult;
|
|
82
|
+
export declare function useQueuedPrompts({ getPromptDispatchError, connected, writeBlocked, runtimeStopped, sessionId, workspaceCwd, clientId, canMutateMidTurn, canQueryMidTurn, canQueryPendingPrompts, canInjectMidTurnMedia, workspaceFileActions, streamingState, sessionHasActivePrompt, holdQueuedPromptsLocally, sessionActions: unguardedSessionActions, store, editorRef, reportError, t, }: UseQueuedPromptsArgs): UseQueuedPromptsResult;
|
|
80
83
|
export {};
|
|
@@ -9,6 +9,10 @@ interface ScopedSessionsOptions {
|
|
|
9
9
|
view?: 'organized';
|
|
10
10
|
group?: string;
|
|
11
11
|
pollIntervalMs?: number;
|
|
12
|
+
/** `null` queries every source type; omitted keeps the sidebar default. */
|
|
13
|
+
sourceType?: string | null;
|
|
14
|
+
/** List live bridge sessions only, so closed history cannot hide them. */
|
|
15
|
+
liveOnly?: boolean;
|
|
12
16
|
}
|
|
13
17
|
export declare function useScopedSessions(workspaceCwd: string | undefined, options?: ScopedSessionsOptions): {
|
|
14
18
|
data: import("@qwen-code/sdk/daemon").DaemonSessionSummary[] | undefined;
|
|
@@ -15,6 +15,7 @@ export interface WebShellSessionsOptions extends SessionCatalogHookOptions {
|
|
|
15
15
|
sourceType?: string;
|
|
16
16
|
sourceId?: string;
|
|
17
17
|
parentSessionId?: string;
|
|
18
|
+
liveOnly?: boolean;
|
|
18
19
|
}
|
|
19
20
|
export declare function useSessionCatalogQuery(client: DaemonClient, query: SessionCatalogQuery | undefined, options?: SessionCatalogHookOptions): {
|
|
20
21
|
sessions: DaemonSessionSummary[];
|
|
@@ -11,3 +11,10 @@ import type { PermissionRequest } from '../adapters/types.js';
|
|
|
11
11
|
* the split-view ChatPane so the two never drift.
|
|
12
12
|
*/
|
|
13
13
|
export declare function isAskUserPermission(request: PermissionRequest | null): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Language-neutral snapshot of a pending AskUserQuestion payload — numbered
|
|
16
|
+
* questions with their option labels and descriptions — for embedding in the
|
|
17
|
+
* side-task details prompt. Malformed entries are skipped rather than throwing:
|
|
18
|
+
* the payload crosses the daemon wire and is not schema-validated here.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatAskUserQuestions(rawInput: Record<string, unknown> | undefined): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const WAITING_ACTIVITY_WEEKS = 44;
|
|
7
|
+
export declare const WAITING_ACTIVITY_DAYS = 7;
|
|
8
|
+
export declare const WAITING_ACTIVITY_CELLS: number;
|
|
9
|
+
export interface WaitingActivityDay {
|
|
10
|
+
/** Local midnight at the start of the day. */
|
|
11
|
+
startAt: number;
|
|
12
|
+
/** Local midnight at the start of the next day. */
|
|
13
|
+
endAt: number;
|
|
14
|
+
count: number;
|
|
15
|
+
/** First message that day, preferring the user question. */
|
|
16
|
+
messageId?: string;
|
|
17
|
+
/** Calendar placeholders after today, rendered without interaction. */
|
|
18
|
+
future?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface WaitingActivityMessage {
|
|
21
|
+
id?: string;
|
|
22
|
+
role?: string;
|
|
23
|
+
timestamp?: number;
|
|
24
|
+
usage?: {
|
|
25
|
+
inputTokens?: number;
|
|
26
|
+
outputTokens?: number;
|
|
27
|
+
cachedTokens?: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface WaitingActivityOptions {
|
|
31
|
+
weeks?: number;
|
|
32
|
+
/** Test seam for the local "today" anchor. */
|
|
33
|
+
now?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface WaitingTokenUsage {
|
|
36
|
+
input: number;
|
|
37
|
+
output: number;
|
|
38
|
+
cached: number;
|
|
39
|
+
context?: number;
|
|
40
|
+
contextLimit?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface WaitingTokenUsageFallback {
|
|
43
|
+
inputTokens?: number;
|
|
44
|
+
outputTokens?: number;
|
|
45
|
+
cachedTokens?: number;
|
|
46
|
+
/** The connection-level usage object keeps the daemon's wire field name. */
|
|
47
|
+
cachedReadTokens?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Groups user and assistant messages into a fixed 44-week calendar. Each cell
|
|
51
|
+
* is one local day and columns are Monday-to-Sunday weeks.
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildWaitingActivity(messages: readonly WaitingActivityMessage[], options?: WaitingActivityOptions): WaitingActivityDay[];
|
|
54
|
+
/** Sums assistant usage across the task; falls back to the latest usage event. */
|
|
55
|
+
export declare function buildWaitingTokenUsage(messages: readonly WaitingActivityMessage[], fallback?: WaitingTokenUsageFallback, context?: number, contextLimit?: number): WaitingTokenUsage;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const WAITING_MINIGAME_ROWS = 7;
|
|
7
|
+
export declare const WAITING_MINIGAME_COLS = 44;
|
|
8
|
+
export declare const WAITING_MINIGAME_CLEAR_SCORE = 50;
|
|
9
|
+
export type WaitingMinigamePieceType = 'I' | 'O' | 'T' | 'S' | 'Z' | 'J' | 'L';
|
|
10
|
+
export interface WaitingMinigamePiece {
|
|
11
|
+
type: WaitingMinigamePieceType;
|
|
12
|
+
row: number;
|
|
13
|
+
col: number;
|
|
14
|
+
rotation: number;
|
|
15
|
+
}
|
|
16
|
+
export interface WaitingMinigameState {
|
|
17
|
+
rows: number;
|
|
18
|
+
cols: number;
|
|
19
|
+
board: Uint8Array;
|
|
20
|
+
piece: WaitingMinigamePiece | null;
|
|
21
|
+
score: number;
|
|
22
|
+
cleared: number;
|
|
23
|
+
over: boolean;
|
|
24
|
+
paused: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface WaitingMinigameOptions {
|
|
27
|
+
rows?: number;
|
|
28
|
+
cols?: number;
|
|
29
|
+
random?: () => number;
|
|
30
|
+
/** Board indices that start settled, e.g. the random right-side cluster. */
|
|
31
|
+
initialSettled?: readonly number[];
|
|
32
|
+
}
|
|
33
|
+
type Offset = readonly [number, number];
|
|
34
|
+
export declare function waitingMinigameShape(type: WaitingMinigamePieceType, rotation: number): readonly Offset[];
|
|
35
|
+
export declare function createWaitingMinigame(options?: WaitingMinigameOptions): WaitingMinigameState;
|
|
36
|
+
/**
|
|
37
|
+
* A sparse settled cluster in the rightmost columns. The intro blocks fly to
|
|
38
|
+
* these cells, then the game starts with the same cluster on the board.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildWaitingMinigameStartCluster(random?: () => number, rows?: number, cols?: number): number[];
|
|
41
|
+
export declare function waitingMinigameTickMs(cleared: number): number;
|
|
42
|
+
export declare function moveWaitingMinigamePiece(state: WaitingMinigameState, deltaRow: number): WaitingMinigameState;
|
|
43
|
+
export declare function rotateWaitingMinigamePiece(state: WaitingMinigameState): WaitingMinigameState;
|
|
44
|
+
/** One gravity step: move right, or lock and clear. */
|
|
45
|
+
export declare function tickWaitingMinigame(state: WaitingMinigameState, random?: () => number): WaitingMinigameState;
|
|
46
|
+
/** Manual speed-up (ArrowRight); same lock rule as gravity. */
|
|
47
|
+
export declare function dropWaitingMinigamePiece(state: WaitingMinigameState, random?: () => number): WaitingMinigameState;
|
|
48
|
+
export declare function setWaitingMinigamePaused(state: WaitingMinigameState, paused: boolean): WaitingMinigameState;
|
|
49
|
+
export declare function toggleWaitingMinigamePause(state: WaitingMinigameState): WaitingMinigameState;
|
|
50
|
+
export declare function restartWaitingMinigame(state: WaitingMinigameState, random?: () => number): WaitingMinigameState;
|
|
51
|
+
/** 0 empty, 1 settled, 2 active piece. */
|
|
52
|
+
export declare function waitingMinigameRenderGrid(state: WaitingMinigameState): Uint8Array;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const WAITING_SNAKE_ROWS = 7;
|
|
7
|
+
export declare const WAITING_SNAKE_COLS = 44;
|
|
8
|
+
export declare const WAITING_SNAKE_LENGTH = 3;
|
|
9
|
+
export type WaitingSnakeDirection = 'up' | 'down' | 'left' | 'right';
|
|
10
|
+
export interface WaitingSnakeCell {
|
|
11
|
+
row: number;
|
|
12
|
+
col: number;
|
|
13
|
+
}
|
|
14
|
+
export interface WaitingSnakeState {
|
|
15
|
+
rows: number;
|
|
16
|
+
cols: number;
|
|
17
|
+
/** Head first. */
|
|
18
|
+
snake: readonly WaitingSnakeCell[];
|
|
19
|
+
direction: WaitingSnakeDirection;
|
|
20
|
+
/** Directions applied one per tick; at most two are queued. */
|
|
21
|
+
pending: readonly WaitingSnakeDirection[];
|
|
22
|
+
food: WaitingSnakeCell | null;
|
|
23
|
+
score: number;
|
|
24
|
+
over: boolean;
|
|
25
|
+
paused: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface WaitingSnakeOptions {
|
|
28
|
+
rows?: number;
|
|
29
|
+
cols?: number;
|
|
30
|
+
random?: () => number;
|
|
31
|
+
}
|
|
32
|
+
export declare function createWaitingSnake(options?: WaitingSnakeOptions): WaitingSnakeState;
|
|
33
|
+
export declare function turnWaitingSnake(state: WaitingSnakeState, direction: WaitingSnakeDirection): WaitingSnakeState;
|
|
34
|
+
export declare function waitingSnakeTickMs(score: number): number;
|
|
35
|
+
export declare function tickWaitingSnake(state: WaitingSnakeState, random?: () => number): WaitingSnakeState;
|
|
36
|
+
export declare function setWaitingSnakePaused(state: WaitingSnakeState, paused: boolean): WaitingSnakeState;
|
|
37
|
+
export declare function toggleWaitingSnakePause(state: WaitingSnakeState): WaitingSnakeState;
|
|
38
|
+
export declare function restartWaitingSnake(state: WaitingSnakeState, random?: () => number): WaitingSnakeState;
|
|
39
|
+
/** 0 empty, 1 body, 2 head, 3 food. */
|
|
40
|
+
export declare function waitingSnakeRenderGrid(state: WaitingSnakeState): Uint8Array;
|