@qwen-code/web-shell 0.25.0 → 0.25.1-preview.1

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 (52) hide show
  1. package/dist/agents-route-DAa1HKQE.js +1546 -0
  2. package/dist/daemon-react-sdk.js +1 -1
  3. package/dist/{index-tVJkU24-.js → index-zUj3SlrB.js} +45814 -44258
  4. package/dist/index.js +22 -22
  5. package/dist/sw.js +1 -1
  6. package/dist/{toolNames-CAeFJ9L9.js → toolNames-B_KiYcXs.js} +3679 -3764
  7. package/dist/transcript.js +9608 -9312
  8. package/dist/types/adapters/messageTypes.d.ts +8 -1
  9. package/dist/types/adapters/transcriptAdapter.d.ts +1 -0
  10. package/dist/types/components/ChatContextHeader.d.ts +3 -1
  11. package/dist/types/components/agents/AgentCreatePage.d.ts +7 -1
  12. package/dist/types/components/agents/AgentsManagerPage.d.ts +4 -5
  13. package/dist/types/components/artifacts/ArtifactPanel.d.ts +1 -8
  14. package/dist/types/components/artifacts/TrajectoryFilters.d.ts +15 -0
  15. package/dist/types/components/artifacts/TrajectoryInspector.d.ts +3 -1
  16. package/dist/types/components/managed/generated/managed-agent-api.d.ts +191 -9
  17. package/dist/types/components/managed/java-managed-agent-client.d.ts +3 -1
  18. package/dist/types/components/managed/managed-agent-provider.d.ts +9 -0
  19. package/dist/types/components/messages/AssistantMessage.d.ts +3 -1
  20. package/dist/types/components/messages/UserMessage.d.ts +3 -1
  21. package/dist/types/components/messages/agent-message-details.d.ts +36 -0
  22. package/dist/types/components/messages/squad-tag.d.ts +16 -0
  23. package/dist/types/components/sidebar/WebShellSidebar.d.ts +2 -4
  24. package/dist/types/components/sidebar/WorkspaceSection.d.ts +1 -2
  25. package/dist/types/components/workspace-agents/ThreadsPage.d.ts +31 -55
  26. package/dist/types/components/workspace-agents/add-runtime-dialog.d.ts +34 -5
  27. package/dist/types/components/workspace-agents/agent-events.d.ts +4 -34
  28. package/dist/types/components/workspace-agents/agents-route.d.ts +19 -0
  29. package/dist/types/components/workspace-agents/agents-view-logic.d.ts +14 -163
  30. package/dist/types/components/workspace-agents/lazy-agents-route.d.ts +7 -0
  31. package/dist/types/components/workspace-agents/messages.d.ts +2 -2
  32. package/dist/types/components/workspace-agents/session-agent-live-runs.d.ts +96 -0
  33. package/dist/types/components/workspace-agents/session-agents-api.d.ts +39 -0
  34. package/dist/types/components/workspace-agents/squads-section.d.ts +28 -0
  35. package/dist/types/components/workspace-agents/threads-api.d.ts +25 -36
  36. package/dist/types/components/workspace-agents/use-session-agent-runs.d.ts +66 -0
  37. package/dist/types/components/workspace-agents/useAgentChatEntry.d.ts +74 -10
  38. package/dist/types/components/workspaces/WorkspaceHostProjects.d.ts +11 -0
  39. package/dist/types/components/workspaces/WorkspaceLocation.d.ts +7 -0
  40. package/dist/types/config/workspace-hosts.d.ts +11 -0
  41. package/dist/types/daemon/session/types.d.ts +19 -3
  42. package/dist/types/trajectory/filter-messages.d.ts +9 -0
  43. package/dist/types/trajectory/filter-messages.transcript-stub.d.ts +7 -0
  44. package/dist/types/trajectory/filterTrajectory.d.ts +22 -0
  45. package/dist/types/utils/cancelledTurn.d.ts +17 -0
  46. package/package.json +2 -1
  47. package/dist/ThreadsRoute-CtecWS_K.js +0 -2358
  48. package/dist/types/components/workspace-agents/LazyThreadsRoute.d.ts +0 -7
  49. package/dist/types/components/workspace-agents/ThreadChat.d.ts +0 -35
  50. package/dist/types/components/workspace-agents/ThreadView.d.ts +0 -72
  51. package/dist/types/components/workspace-agents/ThreadsRoute.d.ts +0 -23
  52. package/dist/types/components/workspace-agents/useProjectConversations.d.ts +0 -10
@@ -3,7 +3,7 @@
3
3
  * Copyright 2025 Qwen Team
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { DaemonBackgroundTurn, DaemonSessionArtifactInput, DaemonInputAnnotation } from '@qwen-code/sdk/daemon';
6
+ import type { DaemonBackgroundTurn, DaemonSessionArtifactInput, DaemonInputAnnotation, QwenAgentMessageMeta } from '@qwen-code/sdk/daemon';
7
7
  import type { components } from '../components/managed/generated/managed-agent-api.js';
8
8
  export interface AttachmentPreviewRequest {
9
9
  name: string;
@@ -119,6 +119,8 @@ export interface DaemonUserMessage extends DaemonMessageMeta {
119
119
  }>;
120
120
  inputAnnotations?: DaemonInputAnnotation[];
121
121
  source?: string;
122
+ /** `_meta.qwenAgentMessage` of an @-mention (`kind: 'agent_mention'`). */
123
+ agentMessage?: QwenAgentMessageMeta;
122
124
  }
123
125
  export interface DaemonAssistantMessage extends DaemonMessageMeta {
124
126
  reportedArtifacts?: DaemonSessionArtifactInput[];
@@ -138,6 +140,11 @@ export interface DaemonAssistantMessage extends DaemonMessageMeta {
138
140
  outputTokens: number;
139
141
  cachedTokens?: number;
140
142
  };
143
+ /**
144
+ * `_meta.qwenAgentMessage` of a workspace agent's reply in this session
145
+ * (`kind: 'agent_message'`): its run status, error, steps and tokens.
146
+ */
147
+ agentMessage?: QwenAgentMessageMeta;
141
148
  }
142
149
  export interface DaemonThinkingMessage extends DaemonMessageMeta {
143
150
  id: string;
@@ -1,3 +1,4 @@
1
1
  import type { DaemonTranscriptBlock } from '@qwen-code/web-shell/daemon-react-sdk';
2
2
  import type { PermissionRequest } from './types';
3
3
  export declare function extractPendingPermission(blocks: readonly DaemonTranscriptBlock[]): PermissionRequest | null;
4
+ export declare function escapePreviewText(text: string): string;
@@ -1,6 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
  interface ChatContextHeaderProps {
3
3
  content: ReactNode;
4
+ /** Names where the chat runs, beside the actions; hidden when omitted. */
5
+ location?: ReactNode;
4
6
  /**
5
7
  * Workspace shown as the header's leading icon. Omitting it means the shell
6
8
  * has no workspace: the icon stays the same folder and only its tooltip says
@@ -23,5 +25,5 @@ interface ChatContextHeaderProps {
23
25
  /** Shows the Local Control QR entry; hidden when omitted. */
24
26
  onOpenLocalControlSettings?: () => void;
25
27
  }
26
- export declare function ChatContextHeader({ content, workspaceName, workspacePath, environmentOpen, environmentAvailable, rightPanelOpen, rightPanelAvailable, onToggleEnvironment, onToggleRightPanel, onOpenTokenUsage, onOpenContextUsage, onOpenLocalControlSettings, }: ChatContextHeaderProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function ChatContextHeader({ content, location, workspaceName, workspacePath, environmentOpen, environmentAvailable, rightPanelOpen, rightPanelAvailable, onToggleEnvironment, onToggleRightPanel, onOpenTokenUsage, onOpenContextUsage, onOpenLocalControlSettings, }: ChatContextHeaderProps): import("react/jsx-runtime").JSX.Element;
27
29
  export {};
@@ -17,6 +17,11 @@ interface AgentCreatePageProps {
17
17
  }[];
18
18
  /** Preselects the runtime, e.g. right after it joined. */
19
19
  initialHostId?: string;
20
+ /**
21
+ * Program ids this computer's daemon reported it can run. Absent (an older
22
+ * daemon) means Qwen Code only.
23
+ */
24
+ localPrograms?: readonly string[];
20
25
  onSaveWorkspaceAgent?: (input: {
21
26
  name: string;
22
27
  description?: string;
@@ -26,6 +31,7 @@ interface AgentCreatePageProps {
26
31
  maxConcurrentRuns: number;
27
32
  execution?: {
28
33
  mode: 'local';
34
+ provider?: AgentProgramView;
29
35
  } | {
30
36
  mode: 'managed-host';
31
37
  hostIds: string[];
@@ -33,5 +39,5 @@ interface AgentCreatePageProps {
33
39
  };
34
40
  }) => Promise<void>;
35
41
  }
36
- export declare function AgentCreatePage({ initialScope, agent, onCancel, onCreated, executionHosts, workspaceCwd, initialHostId, onSaveWorkspaceAgent, }: AgentCreatePageProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function AgentCreatePage({ initialScope, agent, onCancel, onCreated, executionHosts, workspaceCwd, initialHostId, localPrograms, onSaveWorkspaceAgent, }: AgentCreatePageProps): import("react/jsx-runtime").JSX.Element;
37
43
  export {};
@@ -1,13 +1,12 @@
1
1
  import type { EmbeddedManagerPage } from '../plugins/manager-page';
2
2
  interface AgentsManagerPageProps {
3
- initialAgentView?: 'agents' | 'tasks' | 'runtime' | 'new-agent';
3
+ initialAgentView?: 'agents' | 'squads' | 'runtime' | 'new-agent';
4
4
  onClose: () => void;
5
5
  embedded?: EmbeddedManagerPage;
6
6
  initialCreateScope?: 'workspace' | 'global' | null;
7
7
  workspaceCwd?: string;
8
- /** Opens an agent's own session in the shell's session view. */
9
- onOpenAgentSession?: (sessionId: string) => void;
10
- onOpenThreadChat?: (threadId: string, workspaceCwd: string) => void;
8
+ /** Puts `@name ` into the chat composer, from an agent card. */
9
+ onMentionAgent?: (name: string) => void;
11
10
  }
12
- export declare function AgentsManagerPage({ initialAgentView, onClose, embedded, initialCreateScope, workspaceCwd, onOpenAgentSession, onOpenThreadChat, }: AgentsManagerPageProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function AgentsManagerPage({ initialAgentView, onClose, embedded, initialCreateScope, workspaceCwd, onMentionAgent, }: AgentsManagerPageProps): import("react/jsx-runtime").JSX.Element;
13
12
  export {};
@@ -171,12 +171,6 @@ export type ArtifactPanelTab = (WebPreviewState & {
171
171
  kind: 'workflow';
172
172
  title: string;
173
173
  sessionId?: string;
174
- } | {
175
- id: string;
176
- kind: 'agent_activity';
177
- title: string;
178
- threadId: string;
179
- workspaceCwd: string;
180
174
  } | {
181
175
  id: 'turn_calls';
182
176
  kind: 'turn_calls';
@@ -245,7 +239,6 @@ interface ArtifactPanelProps {
245
239
  agentTraceLoading?: boolean;
246
240
  agentTraceError?: string;
247
241
  onOpenWorkflowAgent?: (task: EnvironmentAgentTask) => void;
248
- onOpenCollaborationSession?: (sessionId: string, workspaceCwd: string) => void;
249
242
  onError?: (error: unknown, fallback: string) => void;
250
243
  sessionWorkflowEnabled?: boolean;
251
244
  modelManagement?: WebShellModelManagementOptions;
@@ -270,5 +263,5 @@ interface ArtifactPanelProps {
270
263
  fullscreen?: boolean;
271
264
  onToggleFullscreen?: () => void;
272
265
  }
273
- export declare function ArtifactPanel({ contextUsageControls, artifacts, tabs, activeTabId, reviewChanges, selectedReviewPath, panelWidth, workspaceCwd, loading, restoring, error, onSelectTab, onSelectTurnCallsPrompt, onCloseTab, onOpenFilePreview, latestReviewAvailable, onOpenLatestReview, onOpenTerminal, onOpenTrajectory, trajectoryTabId, onOpenWebPreview, onWebPreviewChange, items, sideTaskAvailable, sideTasks, sideTasksLoading, onCreateSideTask, onOpenSideTask, onCreateSideTaskSession, onSideTaskCreated, onSideTaskTitleChange, onSideTaskInitialPromptRefused, onNestedRightPanelOpen, onNestedArtifactsChange, onOpenNestedSubagent, agentTasks, agentTraceLoading, agentTraceError, onOpenWorkflowAgent, onOpenCollaborationSession, onError, sessionWorkflowEnabled, modelManagement, workflow, onImageIngestionNotice, deferSubagentMount, onClose, variant, fullscreen, onToggleFullscreen, }: ArtifactPanelProps): import("react/jsx-runtime").JSX.Element;
266
+ export declare function ArtifactPanel({ contextUsageControls, artifacts, tabs, activeTabId, reviewChanges, selectedReviewPath, panelWidth, workspaceCwd, loading, restoring, error, onSelectTab, onSelectTurnCallsPrompt, onCloseTab, onOpenFilePreview, latestReviewAvailable, onOpenLatestReview, onOpenTerminal, onOpenTrajectory, trajectoryTabId, onOpenWebPreview, onWebPreviewChange, items, sideTaskAvailable, sideTasks, sideTasksLoading, onCreateSideTask, onOpenSideTask, onCreateSideTaskSession, onSideTaskCreated, onSideTaskTitleChange, onSideTaskInitialPromptRefused, onNestedRightPanelOpen, onNestedArtifactsChange, onOpenNestedSubagent, agentTasks, agentTraceLoading, agentTraceError, onOpenWorkflowAgent, onError, sessionWorkflowEnabled, modelManagement, workflow, onImageIngestionNotice, deferSubagentMount, onClose, variant, fullscreen, onToggleFullscreen, }: ArtifactPanelProps): import("react/jsx-runtime").JSX.Element;
274
267
  export {};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { TrajectoryFilter } from '../../trajectory/filterTrajectory';
7
+ export declare function TrajectoryFilters({ value, onChange, onNavigate, onClear, count, position, truncatedCount, }: {
8
+ value: TrajectoryFilter;
9
+ onChange: (filter: TrajectoryFilter) => void;
10
+ onNavigate: (direction: 1 | -1, filter?: TrajectoryFilter) => void;
11
+ onClear: () => void;
12
+ count: number;
13
+ position: number;
14
+ truncatedCount: number;
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4,13 +4,15 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { TrajectoryRow } from '../../trajectory/types';
7
- export declare function TrajectoryInspector({ row, title, stale, turnSelected, hiddenByRange, hiddenByCollapse, onReveal, onClearRange, onClose, }: {
7
+ export declare function TrajectoryInspector({ row, title, stale, turnSelected, hiddenByRange, hiddenByCollapse, hiddenByFilter, onClearFilter, onReveal, onClearRange, onClose, }: {
8
8
  row?: TrajectoryRow;
9
9
  title?: string;
10
10
  stale?: boolean;
11
11
  turnSelected?: boolean;
12
12
  hiddenByRange: boolean;
13
13
  hiddenByCollapse: boolean;
14
+ hiddenByFilter?: boolean;
15
+ onClearFilter?: () => void;
14
16
  onReveal: () => void;
15
17
  onClearRange: () => void;
16
18
  onClose: () => void;
@@ -74,7 +74,7 @@ export interface paths {
74
74
  };
75
75
  get?: never;
76
76
  put?: never;
77
- /** @description Maps workspaceId/cwdRelative to public Workspace selection without using environmentId or absolute cwd. Shares G0's opt-in initial file-tool Turn admission and fixed server-owned profile with public Session creation. The Session creator may submit later Turns and cancel its running Turns under the same opt-in, and may rename the Session, while the creator currently holds Workspace read and create grants on a registry row whose state is ACTIVE and the Session is an active, undeleted qwen-code Session on the frozen execution profile; Workspace close follows its separate close capability and lifecycle admission; archive, delete and unarchive follow their separate retention capabilities after reliable Workspace close; cwd operations remain gated. The per-caller workspaceTurns capability on this surface advertises the same rule. Freeze selection with the original idempotency key; admission does not prove physical directory readiness. */
77
+ /** @description Maps workspaceId/cwdRelative to public Workspace selection without using environmentId or absolute cwd. Shares G0's opt-in initial file-tool Turn admission and fixed server-owned profile with public Session creation. The Session creator may submit later Turns under the same opt-in with current read and create grants on the bound ACTIVE Workspace generation and storage. Cancellation of running work requires the creator’s read grant and the opt-in, even after create authority is revoked (a live cancel reuses the owner's resident Harness attachment; a cold connector cache passively re-attaches for a persisted cancellation after frozen identity checks, independently of current creation grants, registry state or mount readiness; new work still rechecks execution authority); Workspace close follows its separate close capability and lifecycle admission; archive and unarchive follow retention capabilities after reliable Workspace close; delete supports either L3 idle ACTIVE files Sessions or L2 CLOSED/ARCHIVED Sessions; controlled same-Workspace cwd changes ship through the durable cwd_change operations (v1.32). The per-caller workspaceTurns capability on this surface advertises current submit and rename admission; it does not gate cancellation. Freeze selection with the original idempotency key; admission does not prove physical directory readiness. */
78
78
  post: operations["webShellCreateSession"];
79
79
  delete?: never;
80
80
  options?: never;
@@ -131,6 +131,23 @@ export interface paths {
131
131
  patch?: never;
132
132
  trace?: never;
133
133
  };
134
+ "/api/agent/web-shell/v1/sessions/cwd/change": {
135
+ parameters: {
136
+ query?: never;
137
+ header?: never;
138
+ path?: never;
139
+ cookie?: never;
140
+ };
141
+ get?: never;
142
+ put?: never;
143
+ /** @description W2, implemented: the camelCase twin of the public changeSessionCwd with the matched refusal order: 400 invalid_request for a missing or malformed field; 401 actor_required without a trusted actor; 400 invalid_idempotency_key for a malformed idempotencyKey — with two documented divergences: a key over 128 characters is refused during request validation with 400 invalid_request before the service's check, and a blank idempotencyKey is refused there too, while the public header answers 400 invalid_idempotency_key for both shapes; 400 invalid_cwd for a lexical violation and 400 invalid_request for an expectedContextRevision below 1; 404 session_not_found for an unknown Session id; 400 unsupported_feature for an unbound Session; 404 session_not_found for an unreadable Session and 403 session_operation_forbidden when a readable actor is not the creator; 409 idempotency_conflict when one key carries different content; 409 workspace_unavailable when execution is disabled; 404 session_not_found for a deleted Session — a completed change under the same key still replays instead; then 409 session_state_conflict, 409 workspace_unavailable from moved Registry facts, 409 context_revision_conflict and 409 session_context_busy exactly like the public surface. Poll the operation or await session.context.changed; do not treat 202 as activation. */
144
+ post: operations["webShellChangeCwd"];
145
+ delete?: never;
146
+ options?: never;
147
+ head?: never;
148
+ patch?: never;
149
+ trace?: never;
150
+ };
134
151
  "/api/agent/web-shell/v1/operations/query": {
135
152
  parameters: {
136
153
  query?: never;
@@ -207,7 +224,7 @@ export interface paths {
207
224
  };
208
225
  get?: never;
209
226
  put?: never;
210
- /** @description Uses the same close admission, creator authorization and durable cleanup semantics as the public close route. sessionClose describes deployment support; it does not grant actor authorization. */
227
+ /** @description Uses the same close admission, creator authorization and durable cleanup semantics as the public close route. sessionClose describes deployment support; it does not grant actor authorization. New L3 Workspace close operations run SessionEnd only, retain data, and finish after durable effects verification and original Runtime stop. SessionDelete is reserved for ACTIVE delete. Missing protocol support rejects new admission; previously admitted operations retain their saved protocol. Unknown outcomes remain recovery_blocked. */
211
228
  post: operations["closeWebShellSession"];
212
229
  delete?: never;
213
230
  options?: never;
@@ -241,7 +258,7 @@ export interface paths {
241
258
  };
242
259
  get?: never;
243
260
  put?: never;
244
- /** @description Workspace-bound delete accepts only closed or archived Sessions with completed reliable-close evidence and the creator with current read access. Active deletion returns 409 session_state_conflict. Completion atomically retires private recovery/publication access with the tombstone, operation receipt and terminal event; it calls neither Harness nor Runtime and erases no shared Workspace files or backup bytes. Operations remain readable under current read grants; the same authorized actor/key can replay after deletion. A readable non-creator returns 403; missing close evidence returns 409 workspace_unavailable. */
261
+ /** @description Workspace-bound ACTIVE deletion supports idle hosted-workspace-files/1 Sessions when L3 lifecycle protocol and reliable Runtime stop are available. Only the creator with current read access may admit it; accepted, running, cancelling or approval-waiting Turns return 409 turn_active. Admission persists a lifecycle-only execution fence and a versioned actor-scoped operation. SessionEnd settles before SessionDelete; committed Hook results are verified in Session Store and saved before permanent draining, attachment cleanup and original worker stop. Unknown outcomes or missing original stop evidence remain recovery_blocked and are never replayed on a replacement worker. CLOSED/ARCHIVED deletion retains L2: completed reliable-close evidence is required and no Harness or Hook is invoked. Completion atomically commits retirement, tombstone, receipt and terminal event, retaining shared Workspace files and neighboring holders. Authorized same-actor/key replays return the original operation, including after deletion; readable non-creators return 403. Missing lifecycle capability or close evidence returns 409 workspace_unavailable. */
245
262
  post: operations["deleteWebShellSession"];
246
263
  delete?: never;
247
264
  options?: never;
@@ -298,6 +315,22 @@ export interface paths {
298
315
  patch?: never;
299
316
  trace?: never;
300
317
  };
318
+ "/api/agent/web-shell/v1/tasks/events/query": {
319
+ parameters: {
320
+ query?: never;
321
+ header?: never;
322
+ path?: never;
323
+ cookie?: never;
324
+ };
325
+ get?: never;
326
+ put?: never;
327
+ post: operations["queryWebShellTaskEvents"];
328
+ delete?: never;
329
+ options?: never;
330
+ head?: never;
331
+ patch?: never;
332
+ trace?: never;
333
+ };
301
334
  "/api/agent/web-shell/v1/tool-results/get": {
302
335
  parameters: {
303
336
  query?: never;
@@ -495,10 +528,10 @@ export interface components {
495
528
  /** @default false */
496
529
  actions: boolean;
497
530
  /**
498
- * @description True when the caller may submit later Turns of this Workspace-bound Session, cancel its running Turns and rename it: the deployment enables Workspace files, the caller created the Session and currently holds Workspace read and create grants on a registry row whose state is ACTIVE, and the Session is an active qwen-code Session on the frozen execution profile. False for every other caller and for unbound Sessions, which do not use it.
531
+ * @description True when the caller may submit later Turns of this Workspace-bound Session: the deployment enables Workspace files, the caller created the Session and currently holds Workspace read and create grants on a registry row whose state is ACTIVE and still carries the Workspace generation and storage identity the Session was bound to, and the Session is an active, undeleted qwen-code Session on the frozen execution profile. Cancelling only aborts work that is already running, so the creator may cancel a running Turn even when this is false, as long as they can still read the Workspace and the deployment still enables Workspace files. False for every other caller and for unbound Sessions, which do not use it.
499
532
  * @default false
500
533
  */
501
- workspaceTurns?: boolean;
534
+ workspaceTurns: boolean;
502
535
  tasks: boolean;
503
536
  artifacts: boolean;
504
537
  /**
@@ -517,7 +550,7 @@ export interface components {
517
550
  */
518
551
  sessionUnarchive?: boolean;
519
552
  /**
520
- * @description Optional support for this retention operation. For a Workspace-bound Session requires completed reliable-close evidence; authorization and source-state validation still apply.
553
+ * @description Optional support capability. ACTIVE Workspace files Sessions require L3 lifecycle protocol and reliable original Runtime stop; CLOSED/ARCHIVED Sessions use independent L2 close evidence. Current creator/read authorization and idle/source-state admission checks still apply. The aggregate session lifecycle capability is unchanged.
521
554
  * @default false
522
555
  */
523
556
  sessionDelete?: boolean;
@@ -607,6 +640,8 @@ export interface components {
607
640
  code: string;
608
641
  message: string;
609
642
  request_id: string;
643
+ /** @description Present on Runtime Broker refusals; true permits retry, false is a definite refusal. Other errors may omit this field. */
644
+ retryable?: boolean;
610
645
  /** Format: int64 */
611
646
  replay_floor_sequence?: number | null;
612
647
  /** Format: int64 */
@@ -619,6 +654,8 @@ export interface components {
619
654
  * @example services/api
620
655
  */
621
656
  WorkspaceRelativePath: string;
657
+ /** @enum {string} */
658
+ CwdOperationStatus: "pending" | "installing" | "completed" | "failed";
622
659
  WebShellWorkspaceSelection: {
623
660
  workspaceId: string;
624
661
  /** @default . */
@@ -661,11 +698,36 @@ export interface components {
661
698
  canCreateSession?: true;
662
699
  }) | null;
663
700
  };
701
+ WebShellChangeCwdRequest: {
702
+ /** Format: uuid */
703
+ sessionId: string;
704
+ idempotencyKey: string;
705
+ cwdRelative: components["schemas"]["WorkspaceRelativePath"];
706
+ /** Format: int64 */
707
+ expectedContextRevision: number;
708
+ requestId?: string | null;
709
+ };
664
710
  WebShellOperationRequest: {
665
711
  /** Format: uuid */
666
712
  sessionId: string;
667
713
  operationId: string;
668
714
  };
715
+ /** @description A completed operation returns the committed target revision. A replay returns the same operation identity and latest durable status, with replayed=true; polling itself is not replay. */
716
+ WebShellCwdOperation: {
717
+ operationId: string;
718
+ /** Format: uuid */
719
+ sessionId: string;
720
+ /** @constant */
721
+ type: "cwd_change";
722
+ status: components["schemas"]["CwdOperationStatus"];
723
+ /** Format: int64 */
724
+ expectedContextRevision: number;
725
+ targetCwdRelative: components["schemas"]["WorkspaceRelativePath"];
726
+ /** Format: int64 */
727
+ resultContextRevision?: number | null;
728
+ failureCode?: string | null;
729
+ replayed: boolean;
730
+ } & (unknown & unknown);
669
731
  WebShellAction: components["schemas"]["WebShellPermissionAction"] | components["schemas"]["WebShellQuestionAction"];
670
732
  WebShellActionResolution: {
671
733
  actionId: string;
@@ -728,7 +790,7 @@ export interface components {
728
790
  decisionReceiptId?: string;
729
791
  questions: components["schemas"]["WebShellActionQuestion"][];
730
792
  } & unknown;
731
- /** @description At most one requested Hosted approval per Turn. allow and deny are stable option IDs. Tool arguments are read from Items by function_call_id (functionCallId in WebShell). Public timestamps are milliseconds, as recorded by the Harness. Decision receipts are opaque product IDs. */
793
+ /** @description At most one requested Hosted approval per Turn. allow and deny are stable option IDs. A requested native-tool Action may carry a bounded input preview when the producer supplies an input reference. Version 1 Actions and unavailable inputs omit it. Public timestamps are milliseconds, as recorded by the Harness. Decision receipts are opaque product IDs. */
732
794
  WebShellPermissionAction: {
733
795
  actionId: string;
734
796
  /** Format: uuid */
@@ -750,6 +812,7 @@ export interface components {
750
812
  turnId?: string;
751
813
  functionCallId: string;
752
814
  toolName: string;
815
+ inputPreview?: components["schemas"]["WebShellActionInputPreview"];
753
816
  } & unknown;
754
817
  WebShellPermissionResponse: {
755
818
  /** @constant */
@@ -784,7 +847,7 @@ export interface components {
784
847
  policyRevision: string;
785
848
  answers: components["schemas"]["WebShellQuestionAnswer"][];
786
849
  };
787
- WebShellOperation: components["schemas"]["WebShellCommandOperation"];
850
+ WebShellOperation: components["schemas"]["WebShellCwdOperation"] | components["schemas"]["WebShellCommandOperation"];
788
851
  WebShellActionQueryRequest: {
789
852
  /** Format: uuid */
790
853
  sessionId: string;
@@ -863,6 +926,8 @@ export interface components {
863
926
  * @description Unix epoch milliseconds.
864
927
  */
865
928
  settledAt?: number;
929
+ /** @description Stable task event cursor after the committed tail at view read time. No event can later appear at or before it. Pass it as after to follow only new events; recovery must instead keep its saved event page cursor so it does not skip intervening output. Normal retention may expire it. */
930
+ outputCursor?: string;
866
931
  /** @description The newest Artifacts that hold durable task output, at most 100, oldest first. Entries must not rotate out until older Artifacts can be enumerated and attributed to the task: an evicted Artifact stays readable by id through the Session artifact routes but is no longer discoverable from the task. */
867
932
  artifactRefs: string[];
868
933
  actionCapabilities: components["schemas"]["TaskActionCapability"][];
@@ -872,6 +937,31 @@ export interface components {
872
937
  hasMore: boolean;
873
938
  nextCursor?: string | null;
874
939
  } & unknown;
940
+ /** @description One task event: a logical state change, a bounded output chunk, or an Artifact reference. High-volume output goes to Artifacts or bounded chunks in this paged stream, never one Session event per raw line. The closed schema validates the server's own version; clients ignore unknown optional fields and unknown types and checkpoint their cursors. Strict response validation against an older minor version is not supported. Event identity, position, payload and accepted schema/projection versions are immutable across restart, projection rebuild and archival. */
941
+ WebShellTaskEvent: {
942
+ schemaVersion: number;
943
+ projectionVersion: number;
944
+ taskId: string;
945
+ /** Format: uuid */
946
+ sessionId: string;
947
+ type: components["schemas"]["TaskEventType"];
948
+ /** @description Stable opaque position after this event and its identity. Atomically apply the event and save this cursor to avoid duplicate application after a crash. It is never reassigned; normal retention can expire it. */
949
+ cursor: string;
950
+ /** Format: int64 */
951
+ createdAt: number;
952
+ state?: components["schemas"]["TaskState"];
953
+ runtimeState?: components["schemas"]["TaskRuntimeState"];
954
+ text?: string;
955
+ /** @description True when the chunk was cut to the event limit; its full output is already durably readable and discoverable in the task Artifacts when the event is published. */
956
+ truncated?: boolean;
957
+ artifactId?: string;
958
+ } & (unknown & unknown & unknown);
959
+ WebShellTaskEventPage: {
960
+ data: components["schemas"]["WebShellTaskEvent"][];
961
+ hasMore: boolean;
962
+ /** @description The last returned event cursor, never passing an event held back by limit. On an empty page, the requested position, or the durable retention floor if after was omitted. Required and never null, including when no events remain. No event may later become visible at or before this position. */
963
+ nextCursor: string;
964
+ };
875
965
  WebShellTaskQueryRequest: {
876
966
  /** Format: uuid */
877
967
  sessionId: string;
@@ -884,6 +974,17 @@ export interface components {
884
974
  sessionId: string;
885
975
  taskId: string;
886
976
  };
977
+ WebShellTaskEventQueryRequest: {
978
+ /** Format: uuid */
979
+ sessionId: string;
980
+ taskId: string;
981
+ /** @description Opaque task event cursor: an event cursor, a page nextCursor or a task outputCursor. Omit it to read from the durable retention floor. Strictly below the floor is 409 cursor_expired; equality is valid, including with no retained events. */
982
+ after?: string;
983
+ /** @default 20 */
984
+ limit?: number;
985
+ };
986
+ /** @description state_changed, output or artifact. The set is open: a later minor version may add types and optional fields. Clients ignore unknown optional fields and unknown types, while still checkpointing event cursors; strict validation against an older minor response schema is not supported. Existing fields forbidden for a known type cannot be repurposed on that type. */
987
+ TaskEventType: string;
887
988
  ToolResultPreview: {
888
989
  text: string;
889
990
  truncated: boolean;
@@ -948,6 +1049,18 @@ export interface components {
948
1049
  /** @default 20 */
949
1050
  limit?: number;
950
1051
  };
1052
+ /** @description Optional preview for requested native read_file, write_file, edit or run_shell_command approvals. Missing or invalid input, and internal MCP inputs, omit the preview. No general secret redaction is performed; visibility follows Session read permissions. Deploy the version 2 Java reader before a Harness producer starts writing version 2 options. */
1053
+ WebShellActionInputPreview: {
1054
+ /** @description Exact prefix of the stored payloadJson ({toolName,input}), at most 8192 UTF-8 bytes ending at a complete code point. Truncated text may not be valid JSON. */
1055
+ text: string;
1056
+ /** @description True when text is shorter than the complete UTF-8 input. */
1057
+ truncated: boolean;
1058
+ /**
1059
+ * Format: int64
1060
+ * @description Byte length of the complete payloadJson in UTF-8, before truncation.
1061
+ */
1062
+ byteLength: number;
1063
+ };
951
1064
  };
952
1065
  responses: {
953
1066
  /** @description The authenticated actor belongs to another tenant than X-Qwen-Tenant-Id or has an invalid ID (actor_scope_mismatch, which the tenant filter answers on every /v1/agents/ and WebShell route), or the resource is readable but the actor lacks this operation or the original Action responder permission. Artifact content reads may also return artifact_content_forbidden when the actor cannot read the original bytes. */
@@ -986,7 +1099,7 @@ export interface components {
986
1099
  "application/json": components["schemas"]["ErrorEnvelope"];
987
1100
  };
988
1101
  };
989
- /** @description State, idempotency, or recovery conflict. */
1102
+ /** @description State, idempotency, or recovery conflict. New Workspace-scoped admissions return workspace_unavailable with retryable=false while an offline Workspace migration holds the storage fence; authorized durable replays retain their existing behavior. */
990
1103
  Conflict: {
991
1104
  headers: {
992
1105
  [name: string]: unknown;
@@ -1004,6 +1117,15 @@ export interface components {
1004
1117
  "application/json": components["schemas"]["ErrorEnvelope"];
1005
1118
  };
1006
1119
  };
1120
+ /** @description Task event cursor is strictly below the task's durable retention floor, which survives an empty retained set; equality is valid. The envelope's replay_floor_sequence and snapshot_through_sequence stay absent because task cursors are opaque. */
1121
+ TaskCursorExpired: {
1122
+ headers: {
1123
+ [name: string]: unknown;
1124
+ };
1125
+ content: {
1126
+ "application/json": components["schemas"]["ErrorEnvelope"];
1127
+ };
1128
+ };
1007
1129
  /** @description A dependency such as the Hosted Harness is unavailable; retry later. */
1008
1130
  Unavailable: {
1009
1131
  headers: {
@@ -1264,6 +1386,36 @@ export interface operations {
1264
1386
  413: components["responses"]["PayloadTooLarge"];
1265
1387
  };
1266
1388
  };
1389
+ webShellChangeCwd: {
1390
+ parameters: {
1391
+ query?: never;
1392
+ header?: never;
1393
+ path?: never;
1394
+ cookie?: never;
1395
+ };
1396
+ requestBody: {
1397
+ content: {
1398
+ "application/json": components["schemas"]["WebShellChangeCwdRequest"];
1399
+ };
1400
+ };
1401
+ responses: {
1402
+ /** @description Durable cwd operation; acceptance does not mean the new cwd is active. */
1403
+ 202: {
1404
+ headers: {
1405
+ [name: string]: unknown;
1406
+ };
1407
+ content: {
1408
+ "application/json": components["schemas"]["WebShellCwdOperation"];
1409
+ };
1410
+ };
1411
+ 400: components["responses"]["BadRequest"];
1412
+ 401: components["responses"]["Unauthorized"];
1413
+ 403: components["responses"]["Forbidden"];
1414
+ 404: components["responses"]["NotFound"];
1415
+ 409: components["responses"]["Conflict"];
1416
+ 413: components["responses"]["PayloadTooLarge"];
1417
+ };
1418
+ };
1267
1419
  webShellQueryCwdOperation: {
1268
1420
  parameters: {
1269
1421
  query?: never;
@@ -1566,6 +1718,36 @@ export interface operations {
1566
1718
  413: components["responses"]["PayloadTooLarge"];
1567
1719
  };
1568
1720
  };
1721
+ queryWebShellTaskEvents: {
1722
+ parameters: {
1723
+ query?: never;
1724
+ header?: never;
1725
+ path?: never;
1726
+ cookie?: never;
1727
+ };
1728
+ requestBody: {
1729
+ content: {
1730
+ "application/json": components["schemas"]["WebShellTaskEventQueryRequest"];
1731
+ };
1732
+ };
1733
+ responses: {
1734
+ /** @description Same authorized task semantics as the public task events route, including the durable retention floor, committed-prefix publication, Artifact recovery order and client tolerance of unknown optional fields and event types. */
1735
+ 200: {
1736
+ headers: {
1737
+ [name: string]: unknown;
1738
+ };
1739
+ content: {
1740
+ "application/json": components["schemas"]["WebShellTaskEventPage"];
1741
+ };
1742
+ };
1743
+ 400: components["responses"]["BadRequest"];
1744
+ 401: components["responses"]["Unauthorized"];
1745
+ 403: components["responses"]["Forbidden"];
1746
+ 404: components["responses"]["NotFound"];
1747
+ 409: components["responses"]["TaskCursorExpired"];
1748
+ 413: components["responses"]["PayloadTooLarge"];
1749
+ };
1750
+ };
1569
1751
  getWebShellToolResult: {
1570
1752
  parameters: {
1571
1753
  query?: never;
@@ -58,6 +58,8 @@ export declare class JavaManagedAgentClient {
58
58
  cancelTurn(request: Schemas['WebShellCancelRequest'], signal?: AbortSignal): Promise<JavaAgentCommandAdmission>;
59
59
  queryActions(request: Schemas['WebShellActionQueryRequest'], signal?: AbortSignal): Promise<JavaAgentActionPage>;
60
60
  respondAction(request: Schemas['WebShellActionRespondRequest'], signal?: AbortSignal): Promise<Schemas['WebShellCommandOperation']>;
61
+ /** Reads an operation's latest durable status; polling is not a replay. */
62
+ queryOperation(request: Schemas['WebShellOperationRequest'], signal?: AbortSignal): Promise<Schemas['WebShellOperation']>;
61
63
  getToolResult(sessionId: string, itemId: string, signal?: AbortSignal): Promise<{
62
64
  result: components["schemas"]["PublicToolResult"];
63
65
  access: components["schemas"]["ArtifactAccess"];
@@ -78,7 +80,7 @@ export declare class JavaManagedAgentClient {
78
80
  readArtifactRange(artifact: ManagedArtifact, offset: number, length: number, signal?: AbortSignal): Promise<Uint8Array>;
79
81
  openArtifactStream(artifact: ManagedArtifact, signal?: AbortSignal): Promise<ReadableStream<Uint8Array>>;
80
82
  private artifactContent;
81
- streamEvents(request: Schemas['WebShellStreamRequest'], signal?: AbortSignal): AsyncGenerator<JavaAgentEvent | JavaAgentResyncRequired>;
83
+ streamEvents(request: Schemas['WebShellStreamRequest'], signal?: AbortSignal, onOpen?: () => void): AsyncGenerator<JavaAgentEvent | JavaAgentResyncRequired>;
82
84
  private post;
83
85
  private request;
84
86
  }
@@ -1,3 +1,4 @@
1
+ import type { components } from './generated/managed-agent-api';
1
2
  import type { ManagedToolResultReader } from './managed-tool-result-types';
2
3
  export type ManagedAgentSessionPhase = 'created' | 'admitted' | 'runtime_starting' | 'agent_running' | 'waiting_runtime' | 'tool_running' | 'cancelling' | 'completed' | 'failed' | 'cancelled';
3
4
  export type ManagedAgentRuntimeState = 'unknown' | 'starting' | 'ready' | 'failed';
@@ -75,6 +76,7 @@ export interface ManagedAgentPendingAction {
75
76
  id: string;
76
77
  label: string;
77
78
  }>;
79
+ inputPreview?: components['schemas']['WebShellActionInputPreview'];
78
80
  }
79
81
  export interface ManagedAgentProvider {
80
82
  readonly kind: 'daemon' | 'java';
@@ -130,6 +132,13 @@ export interface ManagedAgentProvider {
130
132
  cancel(sessionId: string, turnId: string, options: ManagedAgentCommandOptions): Promise<void>;
131
133
  subscribeEvents(sessionId: string, options: ManagedAgentRequestOptions & {
132
134
  lastEventId?: number;
135
+ /**
136
+ * Called once the stream connection has been (re-)established. An
137
+ * established stream can stay silent indefinitely — heartbeats are
138
+ * not events — so this is the only liveness signal that does not
139
+ * depend on stream activity.
140
+ */
141
+ onEstablished?(): void;
133
142
  }): AsyncIterable<ManagedAgentSessionEvent>;
134
143
  }
135
144
  export interface ManagedAgentWorkspace {
@@ -1,9 +1,11 @@
1
1
  import { type WebShellAssistantFeedbackRating, type WebShellAssistantTurnFooterRenderInfo, type WebShellSource } from '../../customization';
2
- import type { DaemonSessionGenerationEvent } from '@qwen-code/sdk/daemon';
2
+ import type { DaemonSessionGenerationEvent, QwenAgentMessageMeta } from '@qwen-code/sdk/daemon';
3
3
  import type { DaemonMessageAuthor } from '../../adapters/messageTypes';
4
4
  interface AssistantMessageProps {
5
5
  content: string;
6
6
  author?: DaemonMessageAuthor;
7
+ /** A workspace agent's reply: its run status, error, steps and tokens. */
8
+ agentMessage?: QwenAgentMessageMeta;
7
9
  isStreaming?: boolean;
8
10
  timestamp?: number;
9
11
  onBranchSession?: () => void | Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { DaemonInputAnnotation } from '@qwen-code/sdk/daemon';
2
2
  import type { ComposerTagClickHandler, ComposerTagRenderer, WebShellComposerTag, WebShellComposerTagIconMap } from '../../customization';
3
- import type { AttachmentPreviewRequest } from '../../adapters/messageTypes';
3
+ import type { AttachmentPreviewRequest, DaemonMessageAuthor } from '../../adapters/messageTypes';
4
4
  import type { ImageTabSource } from '../artifacts/ArtifactPanel';
5
5
  interface UserMessageImage {
6
6
  data: string;
@@ -32,6 +32,8 @@ interface UserMessageProps {
32
32
  /** Click an uploaded image to preview it in the right panel. */
33
33
  onImagePreview?: (src: string, alt?: string, source?: ImageTabSource) => void;
34
34
  onAttachmentPreview?: (file: AttachmentPreviewRequest) => void;
35
+ /** Set when a workspace agent, not the user, posted this message. */
36
+ author?: DaemonMessageAuthor;
35
37
  }
36
38
  export declare const UserMessage: import("react").NamedExoticComponent<UserMessageProps>;
37
39
  export declare function ReadonlyComposerTag({ tag, composerTagIcons, renderComposerTag, renderComposerTagTooltip, onComposerTagClick, title, preserveCustomKindLabel, }: {
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Qwen Team
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { QwenAgentMessageMeta, SessionAgentStep } from '@qwen-code/sdk/daemon';
7
+ /** True when an agent's text shows nothing: render it as no text at all. */
8
+ export declare function isBlankAgentText(text: string): boolean;
9
+ /**
10
+ * One line per tool call an agent made, like a CI job's step list. Shared by
11
+ * the live run card and the finished reply, so a run reads the same before
12
+ * and after its record lands.
13
+ *
14
+ * Renders in exported transcripts: only `agentMessage.*` strings (i18n.tsx),
15
+ * never the collaboration dictionary.
16
+ */
17
+ export declare function AgentStepList({ steps, label, settled, }: {
18
+ steps: readonly SessionAgentStep[];
19
+ label?: string;
20
+ /**
21
+ * The run has ended (completed, failed, stopped, offline). A step still
22
+ * marked running then never finished; show it as stopped, not spinning.
23
+ */
24
+ settled?: boolean;
25
+ }): import("react/jsx-runtime").JSX.Element | null;
26
+ /** "1,234 tokens", or nothing when the run reported no usage. */
27
+ export declare function AgentTokenUsage({ totalTokens }: {
28
+ totalTokens?: number;
29
+ }): import("react/jsx-runtime").JSX.Element | null;
30
+ /**
31
+ * Status, error, steps and token usage of a finished agent reply. A completed
32
+ * run shows no status word: its text is the result.
33
+ */
34
+ export declare function AgentMessageDetails({ meta }: {
35
+ meta: QwenAgentMessageMeta;
36
+ }): import("react/jsx-runtime").JSX.Element | null;