@qwen-code/web-shell 0.25.0 → 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.
- package/dist/ThreadsRoute-CXAiD3t_.js +2407 -0
- package/dist/daemon-react-sdk.js +1 -1
- package/dist/{index-tVJkU24-.js → index-D9Bc2Hcz.js} +32673 -32447
- package/dist/index.js +3 -3
- package/dist/sw.js +1 -1
- package/dist/{toolNames-CAeFJ9L9.js → toolNames-CDhDlFnq.js} +412 -384
- package/dist/transcript.js +9 -1
- package/dist/types/adapters/transcriptAdapter.d.ts +1 -0
- package/dist/types/components/managed/generated/managed-agent-api.d.ts +183 -3
- package/dist/types/components/managed/java-managed-agent-client.d.ts +1 -1
- package/dist/types/components/managed/managed-agent-provider.d.ts +9 -0
- package/dist/types/components/workspace-agents/ThreadsPage.d.ts +1 -1
- package/dist/types/components/workspace-agents/add-runtime-dialog.d.ts +5 -2
- package/dist/types/components/workspace-agents/threads-api.d.ts +1 -1
- package/dist/types/daemon/session/types.d.ts +19 -3
- package/dist/types/utils/cancelledTurn.d.ts +17 -0
- package/package.json +1 -1
- package/dist/ThreadsRoute-CtecWS_K.js +0 -2358
|
@@ -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;
|
|
@@ -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
|
|
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; controlled same-Workspace cwd changes ship through the durable cwd_change operations (v1.32). 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. */
|
|
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;
|
|
@@ -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;
|
|
@@ -619,6 +652,8 @@ export interface components {
|
|
|
619
652
|
* @example services/api
|
|
620
653
|
*/
|
|
621
654
|
WorkspaceRelativePath: string;
|
|
655
|
+
/** @enum {string} */
|
|
656
|
+
CwdOperationStatus: "pending" | "installing" | "completed" | "failed";
|
|
622
657
|
WebShellWorkspaceSelection: {
|
|
623
658
|
workspaceId: string;
|
|
624
659
|
/** @default . */
|
|
@@ -661,11 +696,36 @@ export interface components {
|
|
|
661
696
|
canCreateSession?: true;
|
|
662
697
|
}) | null;
|
|
663
698
|
};
|
|
699
|
+
WebShellChangeCwdRequest: {
|
|
700
|
+
/** Format: uuid */
|
|
701
|
+
sessionId: string;
|
|
702
|
+
idempotencyKey: string;
|
|
703
|
+
cwdRelative: components["schemas"]["WorkspaceRelativePath"];
|
|
704
|
+
/** Format: int64 */
|
|
705
|
+
expectedContextRevision: number;
|
|
706
|
+
requestId?: string | null;
|
|
707
|
+
};
|
|
664
708
|
WebShellOperationRequest: {
|
|
665
709
|
/** Format: uuid */
|
|
666
710
|
sessionId: string;
|
|
667
711
|
operationId: string;
|
|
668
712
|
};
|
|
713
|
+
/** @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. */
|
|
714
|
+
WebShellCwdOperation: {
|
|
715
|
+
operationId: string;
|
|
716
|
+
/** Format: uuid */
|
|
717
|
+
sessionId: string;
|
|
718
|
+
/** @constant */
|
|
719
|
+
type: "cwd_change";
|
|
720
|
+
status: components["schemas"]["CwdOperationStatus"];
|
|
721
|
+
/** Format: int64 */
|
|
722
|
+
expectedContextRevision: number;
|
|
723
|
+
targetCwdRelative: components["schemas"]["WorkspaceRelativePath"];
|
|
724
|
+
/** Format: int64 */
|
|
725
|
+
resultContextRevision?: number | null;
|
|
726
|
+
failureCode?: string | null;
|
|
727
|
+
replayed: boolean;
|
|
728
|
+
} & (unknown & unknown);
|
|
669
729
|
WebShellAction: components["schemas"]["WebShellPermissionAction"] | components["schemas"]["WebShellQuestionAction"];
|
|
670
730
|
WebShellActionResolution: {
|
|
671
731
|
actionId: string;
|
|
@@ -728,7 +788,7 @@ export interface components {
|
|
|
728
788
|
decisionReceiptId?: string;
|
|
729
789
|
questions: components["schemas"]["WebShellActionQuestion"][];
|
|
730
790
|
} & unknown;
|
|
731
|
-
/** @description At most one requested Hosted approval per Turn. allow and deny are stable option IDs.
|
|
791
|
+
/** @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
792
|
WebShellPermissionAction: {
|
|
733
793
|
actionId: string;
|
|
734
794
|
/** Format: uuid */
|
|
@@ -750,6 +810,7 @@ export interface components {
|
|
|
750
810
|
turnId?: string;
|
|
751
811
|
functionCallId: string;
|
|
752
812
|
toolName: string;
|
|
813
|
+
inputPreview?: components["schemas"]["WebShellActionInputPreview"];
|
|
753
814
|
} & unknown;
|
|
754
815
|
WebShellPermissionResponse: {
|
|
755
816
|
/** @constant */
|
|
@@ -784,7 +845,7 @@ export interface components {
|
|
|
784
845
|
policyRevision: string;
|
|
785
846
|
answers: components["schemas"]["WebShellQuestionAnswer"][];
|
|
786
847
|
};
|
|
787
|
-
WebShellOperation: components["schemas"]["WebShellCommandOperation"];
|
|
848
|
+
WebShellOperation: components["schemas"]["WebShellCwdOperation"] | components["schemas"]["WebShellCommandOperation"];
|
|
788
849
|
WebShellActionQueryRequest: {
|
|
789
850
|
/** Format: uuid */
|
|
790
851
|
sessionId: string;
|
|
@@ -863,6 +924,8 @@ export interface components {
|
|
|
863
924
|
* @description Unix epoch milliseconds.
|
|
864
925
|
*/
|
|
865
926
|
settledAt?: number;
|
|
927
|
+
/** @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. */
|
|
928
|
+
outputCursor?: string;
|
|
866
929
|
/** @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
930
|
artifactRefs: string[];
|
|
868
931
|
actionCapabilities: components["schemas"]["TaskActionCapability"][];
|
|
@@ -872,6 +935,31 @@ export interface components {
|
|
|
872
935
|
hasMore: boolean;
|
|
873
936
|
nextCursor?: string | null;
|
|
874
937
|
} & unknown;
|
|
938
|
+
/** @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. */
|
|
939
|
+
WebShellTaskEvent: {
|
|
940
|
+
schemaVersion: number;
|
|
941
|
+
projectionVersion: number;
|
|
942
|
+
taskId: string;
|
|
943
|
+
/** Format: uuid */
|
|
944
|
+
sessionId: string;
|
|
945
|
+
type: components["schemas"]["TaskEventType"];
|
|
946
|
+
/** @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. */
|
|
947
|
+
cursor: string;
|
|
948
|
+
/** Format: int64 */
|
|
949
|
+
createdAt: number;
|
|
950
|
+
state?: components["schemas"]["TaskState"];
|
|
951
|
+
runtimeState?: components["schemas"]["TaskRuntimeState"];
|
|
952
|
+
text?: string;
|
|
953
|
+
/** @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. */
|
|
954
|
+
truncated?: boolean;
|
|
955
|
+
artifactId?: string;
|
|
956
|
+
} & (unknown & unknown & unknown);
|
|
957
|
+
WebShellTaskEventPage: {
|
|
958
|
+
data: components["schemas"]["WebShellTaskEvent"][];
|
|
959
|
+
hasMore: boolean;
|
|
960
|
+
/** @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. */
|
|
961
|
+
nextCursor: string;
|
|
962
|
+
};
|
|
875
963
|
WebShellTaskQueryRequest: {
|
|
876
964
|
/** Format: uuid */
|
|
877
965
|
sessionId: string;
|
|
@@ -884,6 +972,17 @@ export interface components {
|
|
|
884
972
|
sessionId: string;
|
|
885
973
|
taskId: string;
|
|
886
974
|
};
|
|
975
|
+
WebShellTaskEventQueryRequest: {
|
|
976
|
+
/** Format: uuid */
|
|
977
|
+
sessionId: string;
|
|
978
|
+
taskId: string;
|
|
979
|
+
/** @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. */
|
|
980
|
+
after?: string;
|
|
981
|
+
/** @default 20 */
|
|
982
|
+
limit?: number;
|
|
983
|
+
};
|
|
984
|
+
/** @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. */
|
|
985
|
+
TaskEventType: string;
|
|
887
986
|
ToolResultPreview: {
|
|
888
987
|
text: string;
|
|
889
988
|
truncated: boolean;
|
|
@@ -948,6 +1047,18 @@ export interface components {
|
|
|
948
1047
|
/** @default 20 */
|
|
949
1048
|
limit?: number;
|
|
950
1049
|
};
|
|
1050
|
+
/** @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. */
|
|
1051
|
+
WebShellActionInputPreview: {
|
|
1052
|
+
/** @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. */
|
|
1053
|
+
text: string;
|
|
1054
|
+
/** @description True when text is shorter than the complete UTF-8 input. */
|
|
1055
|
+
truncated: boolean;
|
|
1056
|
+
/**
|
|
1057
|
+
* Format: int64
|
|
1058
|
+
* @description Byte length of the complete payloadJson in UTF-8, before truncation.
|
|
1059
|
+
*/
|
|
1060
|
+
byteLength: number;
|
|
1061
|
+
};
|
|
951
1062
|
};
|
|
952
1063
|
responses: {
|
|
953
1064
|
/** @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. */
|
|
@@ -1004,6 +1115,15 @@ export interface components {
|
|
|
1004
1115
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
1005
1116
|
};
|
|
1006
1117
|
};
|
|
1118
|
+
/** @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. */
|
|
1119
|
+
TaskCursorExpired: {
|
|
1120
|
+
headers: {
|
|
1121
|
+
[name: string]: unknown;
|
|
1122
|
+
};
|
|
1123
|
+
content: {
|
|
1124
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1007
1127
|
/** @description A dependency such as the Hosted Harness is unavailable; retry later. */
|
|
1008
1128
|
Unavailable: {
|
|
1009
1129
|
headers: {
|
|
@@ -1264,6 +1384,36 @@ export interface operations {
|
|
|
1264
1384
|
413: components["responses"]["PayloadTooLarge"];
|
|
1265
1385
|
};
|
|
1266
1386
|
};
|
|
1387
|
+
webShellChangeCwd: {
|
|
1388
|
+
parameters: {
|
|
1389
|
+
query?: never;
|
|
1390
|
+
header?: never;
|
|
1391
|
+
path?: never;
|
|
1392
|
+
cookie?: never;
|
|
1393
|
+
};
|
|
1394
|
+
requestBody: {
|
|
1395
|
+
content: {
|
|
1396
|
+
"application/json": components["schemas"]["WebShellChangeCwdRequest"];
|
|
1397
|
+
};
|
|
1398
|
+
};
|
|
1399
|
+
responses: {
|
|
1400
|
+
/** @description Durable cwd operation; acceptance does not mean the new cwd is active. */
|
|
1401
|
+
202: {
|
|
1402
|
+
headers: {
|
|
1403
|
+
[name: string]: unknown;
|
|
1404
|
+
};
|
|
1405
|
+
content: {
|
|
1406
|
+
"application/json": components["schemas"]["WebShellCwdOperation"];
|
|
1407
|
+
};
|
|
1408
|
+
};
|
|
1409
|
+
400: components["responses"]["BadRequest"];
|
|
1410
|
+
401: components["responses"]["Unauthorized"];
|
|
1411
|
+
403: components["responses"]["Forbidden"];
|
|
1412
|
+
404: components["responses"]["NotFound"];
|
|
1413
|
+
409: components["responses"]["Conflict"];
|
|
1414
|
+
413: components["responses"]["PayloadTooLarge"];
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1267
1417
|
webShellQueryCwdOperation: {
|
|
1268
1418
|
parameters: {
|
|
1269
1419
|
query?: never;
|
|
@@ -1566,6 +1716,36 @@ export interface operations {
|
|
|
1566
1716
|
413: components["responses"]["PayloadTooLarge"];
|
|
1567
1717
|
};
|
|
1568
1718
|
};
|
|
1719
|
+
queryWebShellTaskEvents: {
|
|
1720
|
+
parameters: {
|
|
1721
|
+
query?: never;
|
|
1722
|
+
header?: never;
|
|
1723
|
+
path?: never;
|
|
1724
|
+
cookie?: never;
|
|
1725
|
+
};
|
|
1726
|
+
requestBody: {
|
|
1727
|
+
content: {
|
|
1728
|
+
"application/json": components["schemas"]["WebShellTaskEventQueryRequest"];
|
|
1729
|
+
};
|
|
1730
|
+
};
|
|
1731
|
+
responses: {
|
|
1732
|
+
/** @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. */
|
|
1733
|
+
200: {
|
|
1734
|
+
headers: {
|
|
1735
|
+
[name: string]: unknown;
|
|
1736
|
+
};
|
|
1737
|
+
content: {
|
|
1738
|
+
"application/json": components["schemas"]["WebShellTaskEventPage"];
|
|
1739
|
+
};
|
|
1740
|
+
};
|
|
1741
|
+
400: components["responses"]["BadRequest"];
|
|
1742
|
+
401: components["responses"]["Unauthorized"];
|
|
1743
|
+
403: components["responses"]["Forbidden"];
|
|
1744
|
+
404: components["responses"]["NotFound"];
|
|
1745
|
+
409: components["responses"]["TaskCursorExpired"];
|
|
1746
|
+
413: components["responses"]["PayloadTooLarge"];
|
|
1747
|
+
};
|
|
1748
|
+
};
|
|
1569
1749
|
getWebShellToolResult: {
|
|
1570
1750
|
parameters: {
|
|
1571
1751
|
query?: never;
|
|
@@ -78,7 +78,7 @@ export declare class JavaManagedAgentClient {
|
|
|
78
78
|
readArtifactRange(artifact: ManagedArtifact, offset: number, length: number, signal?: AbortSignal): Promise<Uint8Array>;
|
|
79
79
|
openArtifactStream(artifact: ManagedArtifact, signal?: AbortSignal): Promise<ReadableStream<Uint8Array>>;
|
|
80
80
|
private artifactContent;
|
|
81
|
-
streamEvents(request: Schemas['WebShellStreamRequest'], signal?: AbortSignal): AsyncGenerator<JavaAgentEvent | JavaAgentResyncRequired>;
|
|
81
|
+
streamEvents(request: Schemas['WebShellStreamRequest'], signal?: AbortSignal, onOpen?: () => void): AsyncGenerator<JavaAgentEvent | JavaAgentResyncRequired>;
|
|
82
82
|
private post;
|
|
83
83
|
private request;
|
|
84
84
|
}
|
|
@@ -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 {
|
|
@@ -53,7 +53,7 @@ export interface ThreadsPageProps {
|
|
|
53
53
|
onOpenAgentBuilder?: (hostId?: string) => void;
|
|
54
54
|
onOpenDefinitions?: () => void;
|
|
55
55
|
/** Issues a single-use join token for the Add runtime dialog. */
|
|
56
|
-
onCreateJoinToken?: () => Promise<JoinToken>;
|
|
56
|
+
onCreateJoinToken?: (supersedesHostId?: string) => Promise<JoinToken>;
|
|
57
57
|
onRemoveRuntime?: (hostId: string) => void;
|
|
58
58
|
hostServerUrl?: string;
|
|
59
59
|
/** A2A shares of one agent; absent hides Share. */
|
|
@@ -15,6 +15,7 @@ export interface JoinToken {
|
|
|
15
15
|
token: string;
|
|
16
16
|
workspaceId: string;
|
|
17
17
|
expiresAt: number;
|
|
18
|
+
replacementHostId?: string;
|
|
18
19
|
}
|
|
19
20
|
export interface ConnectExistingInput {
|
|
20
21
|
remoteUrl: string;
|
|
@@ -24,6 +25,7 @@ export interface ConnectExistingInput {
|
|
|
24
25
|
provider: 'qwen';
|
|
25
26
|
allowHttp: boolean;
|
|
26
27
|
}
|
|
28
|
+
export declare function findReplacementRuntime(runtimes: readonly RuntimeSummary[], knownIds: ReadonlySet<string>, supersededHostId: string, replacementHostId?: string): RuntimeSummary | undefined;
|
|
27
29
|
export declare function joinCommands(address: string, join: JoinToken): {
|
|
28
30
|
qwen: string;
|
|
29
31
|
npx: string;
|
|
@@ -35,13 +37,14 @@ export declare function joinCommands(address: string, join: JoinToken): {
|
|
|
35
37
|
* that updates the Runtime tab, so it flips from waiting to connected by
|
|
36
38
|
* itself (the Tailscale/Vercel "add device" pattern).
|
|
37
39
|
*/
|
|
38
|
-
export declare function AddRuntimeDialog({ open, onOpenChange, serverUrl, runtimes, onCreateJoinToken, onConnectExisting, onCreateAgentOn, }: {
|
|
40
|
+
export declare function AddRuntimeDialog({ open, onOpenChange, serverUrl, runtimes, onCreateJoinToken, onConnectExisting, onCreateAgentOn, replacementTarget, }: {
|
|
39
41
|
open: boolean;
|
|
40
42
|
onOpenChange: (open: boolean) => void;
|
|
41
43
|
/** The coordinator address this page talks to; the link's default. */
|
|
42
44
|
serverUrl: string;
|
|
43
45
|
runtimes: readonly RuntimeSummary[];
|
|
44
|
-
onCreateJoinToken: () => Promise<JoinToken>;
|
|
46
|
+
onCreateJoinToken: (supersedesHostId?: string) => Promise<JoinToken>;
|
|
45
47
|
onConnectExisting?: (input: ConnectExistingInput) => Promise<boolean>;
|
|
46
48
|
onCreateAgentOn?: (runtimeId: string) => void;
|
|
49
|
+
replacementTarget?: RuntimeSummary;
|
|
47
50
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -28,7 +28,7 @@ export interface ThreadsApi {
|
|
|
28
28
|
capabilities?: AgentCapabilitiesView;
|
|
29
29
|
}>;
|
|
30
30
|
/** A single-use token for `qwen serve --join` on another machine. */
|
|
31
|
-
createJoinToken?(): Promise<JoinToken>;
|
|
31
|
+
createJoinToken?(supersedesHostId?: string): Promise<JoinToken>;
|
|
32
32
|
removeHost?(hostId: string): Promise<unknown>;
|
|
33
33
|
createShare?(agentId: string): Promise<AgentShare>;
|
|
34
34
|
listShares?(agentId: string): Promise<{
|
|
@@ -202,6 +202,12 @@ export interface DaemonPromptSettledEvent {
|
|
|
202
202
|
sessionId: string;
|
|
203
203
|
promptId: string;
|
|
204
204
|
outcome: DaemonPromptSettlementOutcome;
|
|
205
|
+
/**
|
|
206
|
+
* The client that submitted the prompt, from the terminal frame's
|
|
207
|
+
* envelope. Lets a submitter recognise its own turn when the admission
|
|
208
|
+
* response never reached it.
|
|
209
|
+
*/
|
|
210
|
+
originatorClientId?: string;
|
|
205
211
|
/** Daemon terminal reason. Present for completed and cancelled turns. */
|
|
206
212
|
stopReason?: string;
|
|
207
213
|
error?: {
|
|
@@ -277,9 +283,12 @@ export interface SendPromptOptions {
|
|
|
277
283
|
* runs to completion. Lets a caller act on "the prompt reached the session"
|
|
278
284
|
* without waiting for the whole turn — e.g. the scheduled-tasks "run now",
|
|
279
285
|
* which records the run at admission so a long/stalled turn or a closed tab
|
|
280
|
-
* can't lose the record.
|
|
286
|
+
* can't lose the record. Carries the daemon's id for the prompt, the key
|
|
287
|
+
* its terminal `turn_complete` / `turn_error` settles under.
|
|
281
288
|
*/
|
|
282
|
-
onAdmitted?: (
|
|
289
|
+
onAdmitted?: (admission: {
|
|
290
|
+
promptId: string;
|
|
291
|
+
}) => void;
|
|
283
292
|
}
|
|
284
293
|
export interface SubmitPromptOptions extends SendPromptOptions {
|
|
285
294
|
sessionId?: string;
|
|
@@ -440,11 +449,18 @@ export interface DaemonSessionActions {
|
|
|
440
449
|
generateSessionContent(prompt: string, opts?: {
|
|
441
450
|
signal?: AbortSignal;
|
|
442
451
|
}): AsyncGenerator<DaemonSessionGenerationEvent>;
|
|
443
|
-
getRewindSnapshots(
|
|
452
|
+
getRewindSnapshots(opts?: {
|
|
453
|
+
/** Rethrow failures raw instead of recording a notice; for best-effort
|
|
454
|
+
* callers that fall back on their own. */
|
|
455
|
+
silent?: boolean;
|
|
456
|
+
}): Promise<{
|
|
444
457
|
snapshots: DaemonRewindSnapshotInfo[];
|
|
445
458
|
}>;
|
|
446
459
|
rewindSession(promptId: string, opts?: {
|
|
447
460
|
rewindFiles?: boolean;
|
|
461
|
+
/** Rethrow failures raw instead of recording a notice; for best-effort
|
|
462
|
+
* callers that fall back on their own. */
|
|
463
|
+
silent?: boolean;
|
|
448
464
|
}): Promise<DaemonRewindResult>;
|
|
449
465
|
btwSession(question: string, opts?: {
|
|
450
466
|
signal?: AbortSignal;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { DaemonTranscriptBlock } from '@qwen-code/sdk/daemon';
|
|
7
|
+
/**
|
|
8
|
+
* Whether everything a cancelled turn left behind its prompt can go with it.
|
|
9
|
+
* Thoughts count as nothing: cancelling mid-reasoning is exactly when taking
|
|
10
|
+
* the prompt back matters, and the TUI's restore-on-cancel treats them the
|
|
11
|
+
* same way. An answer, a tool call, shell output, a permission request or a
|
|
12
|
+
* later user message all keep the turn.
|
|
13
|
+
*
|
|
14
|
+
* Only meaningful once the daemon has settled the turn: until its terminal
|
|
15
|
+
* event arrives, "nothing received yet" is not "nothing produced".
|
|
16
|
+
*/
|
|
17
|
+
export declare function cancelledTurnProducedNothing(blocksAfterPrompt: readonly DaemonTranscriptBlock[]): boolean;
|