@qwen-code/web-shell 0.24.7 → 0.25.1-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 (79) hide show
  1. package/README.md +65 -2
  2. package/dist/ThreadsRoute-CXAiD3t_.js +2407 -0
  3. package/dist/daemon-react-sdk.js +1 -1
  4. package/dist/index-D9Bc2Hcz.js +123543 -0
  5. package/dist/index.js +69 -120254
  6. package/dist/sw.js +1 -1
  7. package/dist/{toolNames-B0O1UjKB.js → toolNames-CDhDlFnq.js} +5415 -4628
  8. package/dist/transcript.js +8980 -8737
  9. package/dist/types/App.d.ts +2 -2
  10. package/dist/types/ManagedAgentWebShell.d.ts +1 -0
  11. package/dist/types/adapters/messageTypes.d.ts +15 -0
  12. package/dist/types/adapters/transcriptAdapter.d.ts +1 -0
  13. package/dist/types/components/ChatEditor.d.ts +1 -0
  14. package/dist/types/components/DesktopRelayControl.d.ts +2 -1
  15. package/dist/types/components/LocalFilesControl.d.ts +3 -1
  16. package/dist/types/components/MessageItem.d.ts +1 -0
  17. package/dist/types/components/MessageList.d.ts +1 -0
  18. package/dist/types/components/agents/AgentCreatePage.d.ts +29 -1
  19. package/dist/types/components/agents/AgentsManagerPage.d.ts +6 -1
  20. package/dist/types/components/artifacts/ArtifactPanel.d.ts +8 -1
  21. package/dist/types/components/artifacts/TrajectoryInspector.d.ts +3 -1
  22. package/dist/types/components/artifacts/TrajectoryOverview.d.ts +3 -1
  23. package/dist/types/components/artifacts/TrajectoryWaterfallCell.d.ts +15 -0
  24. package/dist/types/components/channels/ChannelsManagerPage.d.ts +1 -1
  25. package/dist/types/components/extensions/extensions-manager-logic.d.ts +3 -3
  26. package/dist/types/components/managed/ManagedToolResultPanel.d.ts +9 -0
  27. package/dist/types/components/managed/ManagedToolResultSummary.d.ts +5 -0
  28. package/dist/types/components/managed/generated/managed-agent-api.d.ts +911 -16
  29. package/dist/types/components/managed/java-managed-agent-client.d.ts +27 -1
  30. package/dist/types/components/managed/java-managed-agent-provider.d.ts +4 -0
  31. package/dist/types/components/managed/managed-agent-provider.d.ts +43 -1
  32. package/dist/types/components/managed/managed-agent-sse.test-fixtures.d.ts +8 -0
  33. package/dist/types/components/managed/managed-approval.d.ts +10 -0
  34. package/dist/types/components/managed/managed-artifact-download.d.ts +2 -0
  35. package/dist/types/components/managed/managed-request-error.d.ts +14 -0
  36. package/dist/types/components/managed/managed-tool-result-types.d.ts +24 -0
  37. package/dist/types/components/managed/managed-tool-result.test-fixtures.d.ts +6 -0
  38. package/dist/types/components/managed/use-managed-actions.d.ts +33 -0
  39. package/dist/types/components/messages/AssistantMessage.d.ts +3 -0
  40. package/dist/types/components/messages/AuthorAvatar.d.ts +16 -0
  41. package/dist/types/components/messages/ContextUsageMessage.d.ts +5 -1
  42. package/dist/types/components/messages/StatsMessage.d.ts +6 -1
  43. package/dist/types/components/messages/ToolApproval.d.ts +9 -1
  44. package/dist/types/components/messages/ToolGroup.d.ts +2 -0
  45. package/dist/types/components/sidebar/UpdateControl.d.ts +3 -1
  46. package/dist/types/components/sidebar/WebShellSidebar.d.ts +18 -5
  47. package/dist/types/components/sidebar/WorkspaceSection.d.ts +3 -1
  48. package/dist/types/components/sidebar/sessionSearch.d.ts +2 -1
  49. package/dist/types/components/workspace-agents/LazyThreadsRoute.d.ts +7 -0
  50. package/dist/types/components/workspace-agents/ThreadChat.d.ts +35 -0
  51. package/dist/types/components/workspace-agents/ThreadView.d.ts +72 -0
  52. package/dist/types/components/workspace-agents/ThreadsPage.d.ts +146 -0
  53. package/dist/types/components/workspace-agents/ThreadsRoute.d.ts +23 -0
  54. package/dist/types/components/workspace-agents/add-runtime-dialog.d.ts +50 -0
  55. package/dist/types/components/workspace-agents/agent-events.d.ts +50 -0
  56. package/dist/types/components/workspace-agents/agents-view-logic.d.ts +180 -0
  57. package/dist/types/components/workspace-agents/messages.d.ts +16 -0
  58. package/dist/types/components/workspace-agents/messages.transcript-stub.d.ts +12 -0
  59. package/dist/types/components/workspace-agents/share-agent-dialog.d.ts +33 -0
  60. package/dist/types/components/workspace-agents/threads-api.d.ts +63 -0
  61. package/dist/types/components/workspace-agents/useAgentChatEntry.d.ts +36 -0
  62. package/dist/types/components/workspace-agents/useProjectConversations.d.ts +10 -0
  63. package/dist/types/customization.d.ts +10 -0
  64. package/dist/types/daemon/session/types.d.ts +19 -3
  65. package/dist/types/daemon/workspace/hooks/useDaemonMemory.d.ts +4 -0
  66. package/dist/types/daemon/workspace/types.d.ts +6 -2
  67. package/dist/types/index.d.ts +2 -1
  68. package/dist/types/live/LiveVoiceButton.d.ts +2 -1
  69. package/dist/types/navigation.d.ts +1 -0
  70. package/dist/types/settings.d.ts +1 -0
  71. package/dist/types/trajectory/buildTrajectoryLayout.d.ts +27 -0
  72. package/dist/types/trajectory/types.d.ts +2 -1
  73. package/dist/types/trajectory/useTimelineViewport.d.ts +19 -0
  74. package/dist/types/utils/cancelledTurn.d.ts +17 -0
  75. package/dist/types/utils/composerTag.d.ts +6 -1
  76. package/dist/types/utils/modelEncoding.d.ts +6 -0
  77. package/dist/types/utils/navigationUrl.d.ts +1 -1
  78. package/dist/types/utils/workspace.d.ts +1 -0
  79. package/package.json +1 -1
@@ -0,0 +1,146 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { type JoinToken } from './add-runtime-dialog';
7
+ import { type AgentShare, type AgentShareSummary } from './share-agent-dialog';
8
+ import { type AgentProgramView, type RoutingPreviewTarget, type ThreadSummaryView } from './agents-view-logic';
9
+ /**
10
+ * A change to one agent's configuration. Absent leaves a field alone; `null`
11
+ * clears the override and returns the agent to what its definition says.
12
+ */
13
+ export interface AgentConfigPatch {
14
+ description?: string | null;
15
+ color?: string | null;
16
+ model?: string | null;
17
+ instructions?: string | null;
18
+ agentType?: string | null;
19
+ maxConcurrentRuns?: number | null;
20
+ execution?: {
21
+ mode: 'local';
22
+ } | {
23
+ mode: 'managed-host';
24
+ hostIds: string[];
25
+ provider?: AgentProgramView;
26
+ };
27
+ }
28
+ /** What every agent in this workspace may do. A property of the subsystem. */
29
+ export interface AgentCapabilitiesView {
30
+ readOnly: boolean;
31
+ allowed: readonly string[];
32
+ threadTools: readonly string[];
33
+ }
34
+ export interface ThreadsPageProps {
35
+ onConnectRemoteHost?: (input: {
36
+ remoteUrl: string;
37
+ remoteToken: string;
38
+ remoteCwd: string;
39
+ serverUrl: string;
40
+ provider: 'qwen';
41
+ allowHttp: boolean;
42
+ }) => Promise<boolean>;
43
+ createError?: string;
44
+ agents: readonly WorkspaceAgentSummaryView[];
45
+ threads: readonly ThreadSummaryView[];
46
+ runtimes?: readonly WorkspaceAgentRuntimeView[];
47
+ view: AgentWorkspaceView;
48
+ onViewChange: (view: AgentWorkspaceView) => void;
49
+ onOpenThread: (threadId: string) => void;
50
+ onDeleteAgent: (agentId: string) => void;
51
+ onSetAgentEnabled: (agentId: string, enabled: boolean) => void;
52
+ onUpdateAgent?: (agentId: string, patch: AgentConfigPatch) => void;
53
+ onOpenAgentBuilder?: (hostId?: string) => void;
54
+ onOpenDefinitions?: () => void;
55
+ /** Issues a single-use join token for the Add runtime dialog. */
56
+ onCreateJoinToken?: (supersedesHostId?: string) => Promise<JoinToken>;
57
+ onRemoveRuntime?: (hostId: string) => void;
58
+ hostServerUrl?: string;
59
+ /** A2A shares of one agent; absent hides Share. */
60
+ shares?: {
61
+ create: (agentId: string) => Promise<AgentShare>;
62
+ list: (agentId: string) => Promise<AgentShareSummary[]>;
63
+ revoke: (agentId: string, callerId: string) => Promise<unknown>;
64
+ };
65
+ capabilities?: AgentCapabilitiesView;
66
+ onCreateThread: (input: NewThread) => Promise<boolean> | void;
67
+ workspaceCwd?: string;
68
+ workspaces?: readonly {
69
+ cwd: string;
70
+ }[];
71
+ onWorkspaceChange?: (cwd: string) => void;
72
+ onPreviewThread?: (assignee?: string) => void;
73
+ createPreview?: readonly RoutingPreviewTarget[];
74
+ pending?: boolean;
75
+ }
76
+ export interface WorkspaceAgentSummaryView {
77
+ id: string;
78
+ name: string;
79
+ description?: string;
80
+ color?: string;
81
+ /** Definition supplying the persona. Absent uses the workspace default. */
82
+ agentType?: string;
83
+ model?: string;
84
+ /** What this identity is told on top of its definition's prompt. */
85
+ instructions?: string;
86
+ maxConcurrentRuns?: number;
87
+ execution?: AgentConfigPatch['execution'];
88
+ enabled: boolean;
89
+ status: 'offline' | 'idle' | 'working' | 'blocked' | 'error';
90
+ /** Absent from a daemon older than runtimes; that agent runs here. */
91
+ runtime?: WorkspaceAgentRuntimeView;
92
+ /** Set once the identity is retired: it keeps its posts and takes no work. */
93
+ retiredAt?: number;
94
+ workingOn?: {
95
+ id: string;
96
+ title: string;
97
+ state: 'working' | 'finishing' | 'stopping';
98
+ };
99
+ waiting: number;
100
+ }
101
+ export interface WorkspaceAgentRuntimeView {
102
+ id: string;
103
+ kind: 'local' | 'external';
104
+ label: string;
105
+ provider: string;
106
+ /** Program ids the runtime reported it can run. */
107
+ programs?: readonly string[];
108
+ status: 'online' | 'offline';
109
+ workspaceId?: string;
110
+ workspaceCwd?: string;
111
+ hostSessionId?: string;
112
+ lastSeenAt?: number;
113
+ agentCount?: number;
114
+ sessionCount?: number;
115
+ runningTaskCount?: number;
116
+ queuedTaskCount?: number;
117
+ }
118
+ export type AgentWorkspaceView = 'agents' | 'tasks' | 'runtime';
119
+ export interface NewWorkspaceAgent {
120
+ name: string;
121
+ description?: string;
122
+ agentType?: string;
123
+ model?: string;
124
+ instructions?: string;
125
+ maxConcurrentRuns?: number;
126
+ execution?: AgentConfigPatch['execution'];
127
+ }
128
+ export type ThreadPriorityChoice = 'urgent' | 'high' | 'normal' | 'low';
129
+ export interface NewThread {
130
+ title: string;
131
+ body: string;
132
+ /** What "done" means. Sent only when written, so a blank stays absent. */
133
+ acceptanceCriteria?: string;
134
+ priority?: ThreadPriorityChoice;
135
+ assignee?: string;
136
+ /** The first post; the assignee starts from it. */
137
+ message?: string;
138
+ }
139
+ /**
140
+ * The thread list, grouped by what each thread needs.
141
+ *
142
+ * Recency sorting is the obvious default and it buries the two threads that
143
+ * need a person under twenty that do not. Grouping answers the question
144
+ * someone actually opens this page with.
145
+ */
146
+ export declare function ThreadsPage({ agents, threads, runtimes, view, onViewChange, onOpenThread, onDeleteAgent, onSetAgentEnabled, onUpdateAgent, onOpenAgentBuilder, onOpenDefinitions, onCreateJoinToken, onRemoveRuntime, onConnectRemoteHost, hostServerUrl, shares, capabilities, onCreateThread, workspaceCwd, workspaces, onWorkspaceChange, createError, onPreviewThread, createPreview, pending, }: ThreadsPageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { type AgentWorkspaceView } from './ThreadsPage';
7
+ export interface ThreadsRouteProps {
8
+ /** `new-agent` opens straight into the New agent page. */
9
+ initialView?: AgentWorkspaceView | 'new-agent';
10
+ initialThreadId?: string;
11
+ workspaceCwd?: string;
12
+ chat?: boolean;
13
+ activityOnly?: boolean;
14
+ onOpenActivity?: (threadId: string, workspaceCwd: string) => void;
15
+ headerActionsContainer?: HTMLElement | null;
16
+ onTitleChange?: (threadId: string, title: string) => void;
17
+ onOpenThreadChat?: (threadId: string, workspaceCwd: string) => void;
18
+ /** Switches the shell to an agent's own session. Absent when embedded
19
+ * somewhere with no session view to switch to. */
20
+ onOpenAgentSession?: (sessionId: string) => void;
21
+ onOpenDefinitions?: () => void;
22
+ }
23
+ export declare function ThreadsRoute({ initialView, initialThreadId, workspaceCwd: boundWorkspaceCwd, chat, activityOnly, onOpenActivity, headerActionsContainer, onTitleChange, onOpenThreadChat, onOpenAgentSession, onOpenDefinitions, }: ThreadsRouteProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export interface RuntimeSummary {
7
+ id: string;
8
+ kind: 'local' | 'external';
9
+ label: string;
10
+ provider: string;
11
+ providers?: readonly string[];
12
+ status: 'online' | 'offline';
13
+ }
14
+ export interface JoinToken {
15
+ token: string;
16
+ workspaceId: string;
17
+ expiresAt: number;
18
+ replacementHostId?: string;
19
+ }
20
+ export interface ConnectExistingInput {
21
+ remoteUrl: string;
22
+ remoteToken: string;
23
+ remoteCwd: string;
24
+ serverUrl: string;
25
+ provider: 'qwen';
26
+ allowHttp: boolean;
27
+ }
28
+ export declare function findReplacementRuntime(runtimes: readonly RuntimeSummary[], knownIds: ReadonlySet<string>, supersededHostId: string, replacementHostId?: string): RuntimeSummary | undefined;
29
+ export declare function joinCommands(address: string, join: JoinToken): {
30
+ qwen: string;
31
+ npx: string;
32
+ insecure: boolean;
33
+ };
34
+ /**
35
+ * "Add runtime": hand another machine a one-line command, then wait for it to
36
+ * show up. The dialog notices the new runtime through the same live stream
37
+ * that updates the Runtime tab, so it flips from waiting to connected by
38
+ * itself (the Tailscale/Vercel "add device" pattern).
39
+ */
40
+ export declare function AddRuntimeDialog({ open, onOpenChange, serverUrl, runtimes, onCreateJoinToken, onConnectExisting, onCreateAgentOn, replacementTarget, }: {
41
+ open: boolean;
42
+ onOpenChange: (open: boolean) => void;
43
+ /** The coordinator address this page talks to; the link's default. */
44
+ serverUrl: string;
45
+ runtimes: readonly RuntimeSummary[];
46
+ onCreateJoinToken: (supersedesHostId?: string) => Promise<JoinToken>;
47
+ onConnectExisting?: (input: ConnectExistingInput) => Promise<boolean>;
48
+ onCreateAgentOn?: (runtimeId: string) => void;
49
+ replacementTarget?: RuntimeSummary;
50
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Client for `GET /workspaces/:ws/agent/events`, the collaboration stream.
8
+ *
9
+ * `fetch` rather than `EventSource`: the daemon wants a bearer header, which
10
+ * `EventSource` cannot send. Frames are plain `event:` + one `data:` line.
11
+ */
12
+ export interface AgentPermissionPromptView {
13
+ requestId: string;
14
+ title: string;
15
+ options: Array<{
16
+ optionId: string;
17
+ name: string;
18
+ kind?: string;
19
+ }>;
20
+ }
21
+ export interface AgentRunStepView {
22
+ id: string;
23
+ title: string;
24
+ status: 'running' | 'done' | 'failed';
25
+ }
26
+ export interface AgentRunProgressEvent {
27
+ type: 'progress';
28
+ threadId: string;
29
+ runId: string;
30
+ attempt: number;
31
+ sessionId: string;
32
+ stage: string;
33
+ detail: string;
34
+ outputText: string;
35
+ thoughtText: string;
36
+ activityAt: number;
37
+ permission?: AgentPermissionPromptView;
38
+ steps?: AgentRunStepView[];
39
+ }
40
+ export type AgentLiveEvent = {
41
+ type: 'changed';
42
+ threadId?: string;
43
+ } | AgentRunProgressEvent;
44
+ export type AgentStreamState = 'open' | 'closed';
45
+ /**
46
+ * Subscribes to a workspace's stream. Subscribers of the same URL share one
47
+ * connection: browsers allow only a handful per origin, and the sidebar plus
48
+ * an open conversation would otherwise hold several for the same workspace.
49
+ */
50
+ export declare function subscribeAgentStream(url: string, token: string | undefined, onEvent: (event: AgentLiveEvent) => void, onState: (state: AgentStreamState) => void): () => void;
@@ -0,0 +1,180 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * @fileoverview Presentation logic for the agents-and-threads surface.
8
+ *
9
+ * Everything here is pure and testable without a browser, following the same
10
+ * split as `agents-manager-logic.ts`. Two rules it exists to enforce:
11
+ *
12
+ * 1. **The server decides a thread's state; this file only renders it.** The
13
+ * thread resolver already returns a status *and* the sentence explaining it.
14
+ * Deriving a second, shorter vocabulary here would give the product two
15
+ * answers to "why is this blocked", and the shorter one would win because it
16
+ * is the one on screen.
17
+ * 2. **A label never asserts a cause its reason code does not carry.** Copy
18
+ * that conflates two causes sends people to fix the wrong thing — Multica
19
+ * learned this when "runtime offline" wording sent users to reconnect a
20
+ * machine that was already connected. Each refusal below names its own fix.
21
+ */
22
+ import type { AgentPermissionPromptView, AgentRunStepView } from './agent-events';
23
+ /** The programs an agent can be bound to on a joined runtime. */
24
+ export declare const AGENT_PROGRAMS: readonly ["qwen"];
25
+ export type AgentProgramView = (typeof AGENT_PROGRAMS)[number];
26
+ export declare function programLabel(program: string | undefined): string;
27
+ /**
28
+ * Opens a thread body that carries the conversation it was started from. The
29
+ * agents read it as-is; the chat view shows it folded instead of as a message.
30
+ */
31
+ export declare const CONVERSATION_CONTEXT_PREFIX = "Context from the conversation this was sent from:\n\n";
32
+ /** Wire shape of a thread row, as the REST layer returns it. */
33
+ export interface ThreadSummaryView {
34
+ id: string;
35
+ title: string;
36
+ status: 'open' | 'in_progress' | 'blocked' | 'in_review' | 'done' | 'cancelled';
37
+ /** The resolver's own sentence. Rendered verbatim; never re-derived. */
38
+ reason: string;
39
+ updatedAt: number;
40
+ liveRunCount: number;
41
+ assigneeName?: string;
42
+ parentThreadId?: string;
43
+ }
44
+ export interface ThreadGroup {
45
+ key: 'needs_you' | 'running' | 'idle' | 'done';
46
+ threads: ThreadSummaryView[];
47
+ /** Finished work is evidence, not a task, so it starts collapsed. */
48
+ collapsedByDefault: boolean;
49
+ }
50
+ /**
51
+ * Groups threads by what they need, not by recency.
52
+ *
53
+ * Recency is the default sort and it buries the two threads that need a person
54
+ * under twenty that do not. `blocked` and `in_review` share one group because
55
+ * they are the same query for the reader — this is waiting on me — even though
56
+ * one is a question and the other is finished work. What tells them apart is
57
+ * each thread's own sentence, which is already on the row.
58
+ */
59
+ export declare function groupThreads(threads: readonly ThreadSummaryView[]): ThreadGroup[];
60
+ /** Which threads carry the single attention treatment. */
61
+ export declare function needsAttention(thread: ThreadSummaryView): boolean;
62
+ /** Wire shape of one run, as the REST layer returns it. */
63
+ export interface RunView {
64
+ progress?: {
65
+ attempt?: number;
66
+ receivedAt: number;
67
+ activityAt: number;
68
+ /** A code: starting, thinking, responding, tool, awaiting_approval, stream_lost. */
69
+ stage: string;
70
+ /** Raw text such as a tool title; never UI copy. */
71
+ detail: string;
72
+ outputText?: string;
73
+ thoughtText?: string;
74
+ permission?: AgentPermissionPromptView;
75
+ /** The turn's latest tool calls, oldest first. */
76
+ steps?: AgentRunStepView[];
77
+ };
78
+ id: string;
79
+ agentId: string;
80
+ agentName: string;
81
+ agentColor?: string;
82
+ status: 'queued' | 'running' | 'finishing' | 'cancelling' | 'completed' | 'failed' | 'cancelled';
83
+ closeKind?: 'waiting' | 'blocked' | 'review' | 'unclosed' | 'stranded';
84
+ closeAcknowledged: boolean;
85
+ failureStage?: string;
86
+ error?: string;
87
+ /** Why this run exists, e.g. "assigned by you", "mentioned by alice". */
88
+ trigger: string;
89
+ /** Queued runs of the same agent that start before this one. */
90
+ queueAhead?: number;
91
+ startedAt?: number;
92
+ endedAt?: number;
93
+ /** The agent session this run took its turn in, once one is bound. */
94
+ sessionId?: string;
95
+ }
96
+ export interface RunRow {
97
+ run: RunView;
98
+ /** What this run is doing or left behind, in the reader's words. */
99
+ state: string;
100
+ /** Live runs pin to the top; terminal runs collapse behind a count. */
101
+ live: boolean;
102
+ /** True when a person still owes this run an answer. */
103
+ outstanding: boolean;
104
+ }
105
+ /**
106
+ * Describes a run the way the reader asks about it.
107
+ *
108
+ * A failed run reports its failure whatever close it managed to record first,
109
+ * because the failure is the thing a person has to act on. A stranded run is
110
+ * the exception: nothing the agent did ended it.
111
+ */
112
+ export declare function describeRun(run: RunView, t: Translate): string;
113
+ /**
114
+ * Orders runs for the side panel: live first in start order, then terminal
115
+ * runs newest-first behind their count.
116
+ *
117
+ * The row carries no agent-availability indicator. Whether an agent is
118
+ * reachable is not this row's story — the run's own state is, and a second
119
+ * signal beside it competes for the same glance.
120
+ */
121
+ export declare function buildRunRows(runs: readonly RunView[], t: Translate): {
122
+ live: RunRow[];
123
+ past: RunRow[];
124
+ };
125
+ /**
126
+ * One line, not a bar. A budget is a limit you want to notice before it trips,
127
+ * not a goal you are filling, and a bar invites the second reading.
128
+ */
129
+ export declare function formatBudget(budget: {
130
+ turnsUsed: number;
131
+ turnLimit: number;
132
+ tokensUsed: number;
133
+ tokenLimit: number;
134
+ }, t: Translate): {
135
+ turns: string;
136
+ tokens: string;
137
+ scope: string;
138
+ };
139
+ /** One target's fate for a draft reply, as the server previews it. */
140
+ export interface RoutingPreviewTarget {
141
+ agentName: string;
142
+ willWake: boolean;
143
+ kind?: 'dispatch' | 'coalesce' | 'skip';
144
+ into?: 'queued' | 'running';
145
+ /** Present when `willWake` is false. A skip reason from the rules layer. */
146
+ reason?: string;
147
+ /** True when the name matched no agent, so it renders as a warning. */
148
+ unknown?: boolean;
149
+ }
150
+ /**
151
+ * What a refusal means, and what to do about it.
152
+ *
153
+ * Each entry names its own fix. Two reasons that look alike but need different
154
+ * fixes stay apart: a missing definition is repaired by pointing the agent at
155
+ * one that exists, while a disabled agent is repaired by enabling it, and copy
156
+ * that merged them would send the reader to the wrong screen.
157
+ */
158
+ export declare function explainSkip(reason: string, target: string, t: Translate): string;
159
+ /**
160
+ * A one-line summary of a preview, for the composer's collapsed state.
161
+ *
162
+ * Says who *will* run, because that is the consequence of pressing send. When
163
+ * nobody will, that is the headline, since it is the case the system used to
164
+ * swallow silently.
165
+ */
166
+ export declare function summarizePreview(targets: readonly RoutingPreviewTarget[], t: Translate): string;
167
+ type Translate = (key: string, vars?: Record<string, string | number>) => string;
168
+ /** "45 秒" or "6 分 45 秒": the one duration format the collaboration UI uses. */
169
+ export declare function formatElapsed(ms: number, t: Translate): string;
170
+ /**
171
+ * Why a run exists, in the reader's language. The server words this in
172
+ * English from a fixed set; anything outside it is shown as sent.
173
+ */
174
+ export declare function triggerLabel(trigger: string, t: Translate): string;
175
+ /**
176
+ * A thread's status reason in the reader's language. The server words it in
177
+ * English from a fixed set; anything outside it is shown as sent.
178
+ */
179
+ export declare function statusReasonLabel(reason: string, t: Translate): string;
180
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Agent collaboration strings (the Agent page, collaboration conversations,
8
+ * the @ picker's agent entries). Kept out of the main dictionary like Live
9
+ * Voice's: an exported transcript never renders these surfaces, so
10
+ * `vite.lib.config.ts` resolves this module to `messages.transcript-stub.ts`
11
+ * in `--mode transcript` and the transcript bundle stays within its budget.
12
+ */
13
+ type CollabMessage = string | ((vars?: Record<string, string | number>) => string);
14
+ export declare const COLLAB_MESSAGES_EN: Record<string, CollabMessage>;
15
+ export declare const COLLAB_MESSAGES_ZH: Record<string, CollabMessage>;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Stands in for `./messages` in the transcript build (`--mode transcript`).
8
+ * The transcript renderer has no collaboration surface, so its dictionary
9
+ * carries none of those strings.
10
+ */
11
+ export declare const COLLAB_MESSAGES_EN: {};
12
+ export declare const COLLAB_MESSAGES_ZH: {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /** What the daemon returns for a new share; the secret is shown once. */
7
+ export interface AgentShare {
8
+ endpoint: string;
9
+ workspaceId: string;
10
+ callerId: string;
11
+ agentId: string;
12
+ secret: string;
13
+ expiresAt?: number;
14
+ }
15
+ export interface AgentShareSummary {
16
+ callerId: string;
17
+ createdAt: number;
18
+ expiresAt?: number;
19
+ }
20
+ /**
21
+ * Share one agent with a caller outside this workspace over A2A. The agent
22
+ * runs under its live workspace configuration; the caller gets an endpoint,
23
+ * a token shown once and a one-line test. Each share is its own grant, so
24
+ * revoking one leaves the others working.
25
+ */
26
+ export declare function ShareAgentDialog({ agentName, open, onOpenChange, onCreate, onList, onRevoke, }: {
27
+ agentName: string;
28
+ open: boolean;
29
+ onOpenChange: (open: boolean) => void;
30
+ onCreate: () => Promise<AgentShare>;
31
+ onList: () => Promise<AgentShareSummary[]>;
32
+ onRevoke: (callerId: string) => Promise<unknown>;
33
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { AgentCapabilitiesView, AgentConfigPatch, NewThread, NewWorkspaceAgent, WorkspaceAgentRuntimeView, WorkspaceAgentSummaryView } from './ThreadsPage';
7
+ import type { ThreadDetailView } from './ThreadView';
8
+ import type { RoutingPreviewTarget, ThreadSummaryView } from './agents-view-logic';
9
+ import { type AgentLiveEvent, type AgentStreamState } from './agent-events';
10
+ import type { JoinToken } from './add-runtime-dialog';
11
+ import type { AgentShare, AgentShareSummary } from './share-agent-dialog';
12
+ interface CreateThreadResult {
13
+ id: string;
14
+ }
15
+ export interface ThreadsApi {
16
+ connectRemoteHost?(input: {
17
+ remoteUrl: string;
18
+ remoteToken: string;
19
+ remoteCwd: string;
20
+ serverUrl: string;
21
+ provider: 'qwen';
22
+ allowHttp: boolean;
23
+ }): Promise<unknown>;
24
+ listAgents(): Promise<{
25
+ agents: WorkspaceAgentSummaryView[];
26
+ runtime?: WorkspaceAgentRuntimeView;
27
+ runtimes?: WorkspaceAgentRuntimeView[];
28
+ capabilities?: AgentCapabilitiesView;
29
+ }>;
30
+ /** A single-use token for `qwen serve --join` on another machine. */
31
+ createJoinToken?(supersedesHostId?: string): Promise<JoinToken>;
32
+ removeHost?(hostId: string): Promise<unknown>;
33
+ createShare?(agentId: string): Promise<AgentShare>;
34
+ listShares?(agentId: string): Promise<{
35
+ shares: AgentShareSummary[];
36
+ }>;
37
+ revokeShare?(agentId: string, callerId: string): Promise<unknown>;
38
+ listThreads(): Promise<{
39
+ threads: ThreadSummaryView[];
40
+ }>;
41
+ getThread(id: string): Promise<ThreadDetailView>;
42
+ createAgent(input: NewWorkspaceAgent): Promise<unknown>;
43
+ deleteAgent(id: string): Promise<unknown>;
44
+ setAgentEnabled(id: string, enabled: boolean): Promise<unknown>;
45
+ updateAgent(id: string, patch: AgentConfigPatch): Promise<unknown>;
46
+ createThread(input: NewThread): Promise<CreateThreadResult>;
47
+ previewThread(assignee?: string): Promise<{
48
+ targets: RoutingPreviewTarget[];
49
+ }>;
50
+ assignThread(id: string, assignee?: string): Promise<unknown>;
51
+ previewReply(id: string, text: string): Promise<{
52
+ targets: RoutingPreviewTarget[];
53
+ }>;
54
+ postReply(id: string, text: string): Promise<unknown>;
55
+ markDone(id: string): Promise<unknown>;
56
+ cancelRun(threadId: string, runId: string): Promise<unknown>;
57
+ /** Live events; absent in tests and older daemons, which then poll. */
58
+ subscribe?(onEvent: (event: AgentLiveEvent) => void, onState: (state: AgentStreamState) => void): () => void;
59
+ /** Answers a tool approval an agent is waiting on. */
60
+ respondToPermission?(sessionId: string, requestId: string, optionId: string): Promise<unknown>;
61
+ }
62
+ export declare function createThreadsHttpApi(baseUrl: string, token: string | undefined, workspaceCwd: string): ThreadsApi;
63
+ export {};
@@ -0,0 +1,36 @@
1
+ import { type ComponentProps } from 'react';
2
+ import type { ChatEditor } from '../ChatEditor';
3
+ import type { WebShellAtProvider } from '../../customization';
4
+ import type { useI18n } from '../../i18n';
5
+ type Submit = ComponentProps<typeof ChatEditor>['onSubmit'];
6
+ /**
7
+ * The tail of the conversation an agent was mentioned from, so a thread
8
+ * started mid-conversation does not begin blind.
9
+ */
10
+ export declare function conversationContext(messages: readonly {
11
+ role: string;
12
+ content?: unknown;
13
+ }[]): string;
14
+ export declare function useAgentChatEntry({ enabled, cwd, baseUrl, token, onSubmit, onOpen, onError, getContext, onCreateAgent, t, }: {
15
+ enabled: boolean;
16
+ cwd?: string;
17
+ baseUrl: string;
18
+ token?: string;
19
+ onSubmit: Submit;
20
+ onOpen: (id: string, cwd: string) => void;
21
+ onError: (message: string) => void;
22
+ /** The conversation so far, when mentioning from a chat that has one. */
23
+ getContext?: () => string;
24
+ /** Offered as the picker's last item: open the New agent page. */
25
+ onCreateAgent?: () => void;
26
+ /**
27
+ * The caller's translator. App calls this hook above its I18nProvider, where
28
+ * useI18n() would hand back the default that echoes keys.
29
+ */
30
+ t: ReturnType<typeof useI18n>['t'];
31
+ }): {
32
+ providers: WebShellAtProvider[];
33
+ submit: (text: string, images?: import("../../adapters/promptTypes").PromptImage[], files?: import("../../adapters/promptTypes").PromptFile[], commitAccepted?: import("../../hooks/useComposerCore").ComposerSubmitCommit, metadata?: import("../../hooks/useComposerCore").ComposerSubmitMetadata) => boolean | void;
34
+ pending: boolean;
35
+ };
36
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { DaemonSessionSummary } from '@qwen-code/sdk/daemon';
2
+ export declare const COLLABORATION_SOURCE = "workspace_collaboration";
3
+ export declare function useProjectConversations(cwds: readonly string[]): {
4
+ scope: string;
5
+ sessions: DaemonSessionSummary[];
6
+ error?: string;
7
+ } | {
8
+ sessions: never[];
9
+ error: undefined;
10
+ };
@@ -362,6 +362,11 @@ export interface WebShellAtItem {
362
362
  iconTooltip?: string;
363
363
  insertText?: string;
364
364
  composerTag?: WebShellComposerTag;
365
+ /**
366
+ * Makes the item an action instead of a reference: choosing it removes the
367
+ * typed `@query` and calls this, inserting nothing.
368
+ */
369
+ onSelect?: () => void;
365
370
  }
366
371
  export type WebShellBuiltinAtProviderId = 'files' | 'extensions' | 'mcp-resources';
367
372
  export type WebShellBuiltinAtProvidersConfig = boolean | readonly WebShellBuiltinAtProviderId[] | {
@@ -389,6 +394,11 @@ export interface WebShellAtProvider {
389
394
  order?: number;
390
395
  tabs?: readonly WebShellAtProviderTab[];
391
396
  renderItem?: WebShellAtItemRenderer;
397
+ /**
398
+ * Claims a typed `@query` that names no category, so it searches this
399
+ * provider instead of falling back to files.
400
+ */
401
+ claimsTypedQuery?(query: string): boolean;
392
402
  search(params: {
393
403
  query: string;
394
404
  signal: AbortSignal;