@blade-hq/agent-client 2612.0.0-beta.97 → 2612.0.0-beta.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -11
- package/dist/blade-client.d.ts +2 -1
- package/dist/{chunk-3XQ7HYKA.js → chunk-W2OSMFBN.js} +754 -1679
- package/dist/chunk-W2OSMFBN.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +7 -2
- package/dist/internal.js +18 -7
- package/dist/internal.js.map +1 -1
- package/dist/resources/profile.d.ts +76 -0
- package/dist/resources/sessions.d.ts +18 -3
- package/dist/schemas/board.d.ts +6 -0
- package/dist/schemas/message.d.ts +1 -0
- package/dist/schemas/plan.d.ts +29 -0
- package/dist/schemas/projection.d.ts +2 -1
- package/dist/schemas/session.d.ts +25 -1
- package/dist/session/agent-session.d.ts +26 -15
- package/dist/session/events.d.ts +1 -1
- package/dist/session/hub.d.ts +1 -0
- package/dist/session/log-cursor.d.ts +2 -0
- package/dist/session/state.d.ts +10 -3
- package/dist/shared/completion-notices.d.ts +26 -0
- package/dist/shared/oom.d.ts +8 -3
- package/dist/shared/projection/builder.d.ts +0 -25
- package/dist/shared/projection/helpers.d.ts +0 -35
- package/dist/shared/projection/index.d.ts +1 -3
- package/dist/tool-provider.d.ts +1 -0
- package/dist/types/socket-events.d.ts +14 -6
- package/package.json +1 -1
- package/public-api.md +177 -3
- package/dist/chunk-3XQ7HYKA.js.map +0 -1
- package/dist/shared/projection/context.d.ts +0 -3
- package/dist/shared/projection/history.d.ts +0 -13
|
@@ -2,8 +2,9 @@ import type { ContextAttachment, ContextSource } from "../schemas/context-attach
|
|
|
2
2
|
import type { TopicAssetRef } from "../schemas/topic-assets";
|
|
3
3
|
import { type RawEvent } from "../shared/projection";
|
|
4
4
|
import type { MessageContent } from "../schemas/message";
|
|
5
|
-
import type
|
|
6
|
-
import type {
|
|
5
|
+
import { type ApprovePlanInput, type PlanDocument } from "../schemas/plan";
|
|
6
|
+
import type { TurnProjection } from "../schemas/projection";
|
|
7
|
+
import type { ReplaySettings, ReplaySpeed, ReplayState, ReplayToolAction, SessionStatus } from "../schemas/session";
|
|
7
8
|
import { type CommandHandler } from "../commands/registry";
|
|
8
9
|
import { type AgentSessionEvents } from "./events";
|
|
9
10
|
import type { AppCliAttachment, AppCliDefinition, FileEntry, HistoricalCommand, SessionRunResult, SessionTurnIndex, SessionTurnIndexItem, SessionTurnsPage, SessionTurnsQuery } from "../resources/sessions";
|
|
@@ -25,9 +26,10 @@ export interface SessionRuntime {
|
|
|
25
26
|
fetchSessionInfo(sessionId: string, options?: {
|
|
26
27
|
fresh?: boolean;
|
|
27
28
|
}): Promise<SessionDetailSnapshot>;
|
|
28
|
-
updateReplay(sessionId: string, payload: {
|
|
29
|
+
updateReplay(sessionId: string, payload: ReplaySettings & {
|
|
29
30
|
speed?: ReplaySpeed;
|
|
30
31
|
status?: "autonomous";
|
|
32
|
+
tool_action?: ReplayToolAction;
|
|
31
33
|
}): Promise<ReplayState | null>;
|
|
32
34
|
listDir(sessionId: string, dirPath: string): Promise<FileEntry[]>;
|
|
33
35
|
countFiles(sessionId: string, dirPath?: string): Promise<number>;
|
|
@@ -40,10 +42,15 @@ export interface SessionRuntime {
|
|
|
40
42
|
onDispose(session: AgentSession): boolean;
|
|
41
43
|
}
|
|
42
44
|
export interface SessionDetailSnapshot {
|
|
45
|
+
active_plan?: PlanDocument | null;
|
|
46
|
+
active_branch_tip?: string;
|
|
43
47
|
history_busy?: boolean;
|
|
44
48
|
status?: SessionStatus;
|
|
45
49
|
replay_state?: ReplayState | null;
|
|
46
50
|
viewer_role?: "owner" | "viewer";
|
|
51
|
+
parent_session_id?: string | null;
|
|
52
|
+
subagent_name?: string | null;
|
|
53
|
+
subagent_readonly?: boolean | null;
|
|
47
54
|
}
|
|
48
55
|
/** 服务端 chat:end 载荷里 AgentSession 关心的字段。 */
|
|
49
56
|
export interface ChatEndPayload {
|
|
@@ -77,6 +84,10 @@ export interface SendOptions {
|
|
|
77
84
|
contextAttachments?: ContextAttachment[];
|
|
78
85
|
/** planning / executing 模式。 */
|
|
79
86
|
mode?: string;
|
|
87
|
+
/** Explicit mode change for this input. */
|
|
88
|
+
modeOverride?: "planning" | "executing";
|
|
89
|
+
/** Approve the selected draft on the expected branch. */
|
|
90
|
+
approvePlan?: ApprovePlanInput;
|
|
80
91
|
/** AskUserQuestion 的作答(tool_call_id + 选项)。 */
|
|
81
92
|
askUserAnswer?: Record<string, unknown>;
|
|
82
93
|
/** 本次运行的模型覆盖。 */
|
|
@@ -136,6 +147,7 @@ export declare class AgentSession {
|
|
|
136
147
|
readonly sessionId: string;
|
|
137
148
|
private state;
|
|
138
149
|
private statusRevision;
|
|
150
|
+
private planRevision;
|
|
139
151
|
private noteLiveStatus;
|
|
140
152
|
private readonly listeners;
|
|
141
153
|
private readonly emitter;
|
|
@@ -143,9 +155,6 @@ export declare class AgentSession {
|
|
|
143
155
|
private readonly runtime;
|
|
144
156
|
private activeReplayPlaybackId;
|
|
145
157
|
private readonly projectionBuilder;
|
|
146
|
-
private readonly pendingTurnPatches;
|
|
147
|
-
private patchFlushHandle;
|
|
148
|
-
private patchFlushCancel;
|
|
149
158
|
private joined;
|
|
150
159
|
private joinPending;
|
|
151
160
|
private subscriptionQueue;
|
|
@@ -173,13 +182,10 @@ export declare class AgentSession {
|
|
|
173
182
|
private disposed;
|
|
174
183
|
private getAppContext;
|
|
175
184
|
private readonly submissionWaits;
|
|
176
|
-
private
|
|
185
|
+
private compactionAck;
|
|
177
186
|
private epochReloadRequested;
|
|
178
187
|
private epochReloadDone;
|
|
179
188
|
private epochReloadRunning;
|
|
180
|
-
private reconcileManualCompaction;
|
|
181
|
-
private setManualCompactionRequest;
|
|
182
|
-
private handleManualCompactionFinished;
|
|
183
189
|
private readonly workflowRunToolCalls;
|
|
184
190
|
private desiredStreamTokens;
|
|
185
191
|
private joinedStreamTokens;
|
|
@@ -249,6 +255,13 @@ export declare class AgentSession {
|
|
|
249
255
|
* 缓存只会让旧条目在 rewind 之后继续可点。
|
|
250
256
|
*/
|
|
251
257
|
loadTurnIndex(): Promise<SessionTurnIndexItem[]>;
|
|
258
|
+
/**
|
|
259
|
+
* Read the current branch tip for the displayed draft, then submit an explicit
|
|
260
|
+
* approval. The runner checks the same draft and tip again under its write lock.
|
|
261
|
+
* The durable send path preserves one request ID across transport retries.
|
|
262
|
+
*/
|
|
263
|
+
approvePlan(draft: PlanDocument): Promise<DeliveryReceipt>;
|
|
264
|
+
private applyPlanSnapshot;
|
|
252
265
|
/** 订阅状态变化。返回取消订阅函数。 */
|
|
253
266
|
subscribe(listener: () => void): () => void;
|
|
254
267
|
private setState;
|
|
@@ -336,11 +349,11 @@ export declare class AgentSession {
|
|
|
336
349
|
private applySessionDetail;
|
|
337
350
|
/** 调整回放倍速;不是回放会话、或只读身份时什么都不做。 */
|
|
338
351
|
setReplaySpeed(speed: ReplaySpeed): Promise<void>;
|
|
352
|
+
setReplaySettings(settings: ReplaySettings): Promise<void>;
|
|
353
|
+
resolveReplayToolFailure(action: ReplayToolAction): Promise<void>;
|
|
339
354
|
/** 退出回放,之后的对话交给真实模型运行;不是回放会话、或只读身份时什么都不做。 */
|
|
340
355
|
exitReplay(): Promise<void>;
|
|
341
356
|
private applyReplayControl;
|
|
342
|
-
_handleTurnStart(turn: TurnProjection): void;
|
|
343
|
-
_handleTurnPatch(patch: PatchEnvelope): void;
|
|
344
357
|
_handleTurnEnd(turn: TurnProjection): void;
|
|
345
358
|
private runEpochReload;
|
|
346
359
|
_handleTurnEvents(incoming: RawEvent[], replayed?: boolean): void;
|
|
@@ -363,6 +376,7 @@ export declare class AgentSession {
|
|
|
363
376
|
_handleSystemNotification(loopId: string, notification: Record<string, unknown>): void;
|
|
364
377
|
_handleBackgroundTask(task: AgentSessionEvents["backgroundTask"]): void;
|
|
365
378
|
_handleArtifact(data: Record<string, unknown>, kind: "created" | "updated", replayed?: boolean): void;
|
|
379
|
+
private hasPendingQuestion;
|
|
366
380
|
_applyRunningState(isRunning: boolean, liveRevisionAtJoin?: number): void;
|
|
367
381
|
private markRunningIfIdle;
|
|
368
382
|
private finishStreaming;
|
|
@@ -374,9 +388,6 @@ export declare class AgentSession {
|
|
|
374
388
|
private markOptimisticTurnPending;
|
|
375
389
|
private pruneOptimisticLiveRevisions;
|
|
376
390
|
private applyTurn;
|
|
377
|
-
private schedulePatchFlush;
|
|
378
|
-
private cancelPatchFlush;
|
|
379
|
-
private flushPatches;
|
|
380
391
|
private emitTurnDerivedEvents;
|
|
381
392
|
private dispatchCommand;
|
|
382
393
|
private dispatchRawCommands;
|
package/dist/session/events.d.ts
CHANGED
package/dist/session/hub.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ export declare class LogCursor {
|
|
|
4
4
|
private started;
|
|
5
5
|
private sequence;
|
|
6
6
|
private epoch;
|
|
7
|
+
private contiguous;
|
|
7
8
|
private readonly deltas;
|
|
8
9
|
/** Seed only a fresh instance; reconnect/live delivery always owns its cursor. */
|
|
9
10
|
seed(snapshot?: {
|
|
10
11
|
afterLogSeq: number;
|
|
11
12
|
epoch: number;
|
|
12
13
|
}): void;
|
|
14
|
+
get isContiguous(): boolean;
|
|
13
15
|
subscription(): {
|
|
14
16
|
after_log_seq?: number;
|
|
15
17
|
};
|
package/dist/session/state.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TopicAssetRef } from "../schemas/topic-assets";
|
|
2
2
|
import type { ChatMessage, CompactionInfo, MessageContent } from "../schemas/message";
|
|
3
|
-
import type { ContentBlock,
|
|
4
|
-
import type { ReplaySpeed, ReplayState, SessionStatus } from "../schemas/session";
|
|
3
|
+
import type { ContentBlock, TurnProjection } from "../schemas/projection";
|
|
4
|
+
import type { ReplaySpeed, ReplayState, SessionInfo, SessionStatus } from "../schemas/session";
|
|
5
5
|
import { type SessionQueueSnapshot } from "./queue";
|
|
6
6
|
import { type WorkflowRunState } from "./workflow";
|
|
7
7
|
/** 一次 AskUserQuestion 的用户作答(选项选择 + 自定义输入 + 可选补充)。 */
|
|
@@ -31,6 +31,8 @@ export type ConnectionStatus = "connecting" | "connected" | "reconnecting" | "di
|
|
|
31
31
|
* 满足 React `useSyncExternalStore` / Vue `shallowRef` 的订阅契约。
|
|
32
32
|
*/
|
|
33
33
|
export interface SessionState {
|
|
34
|
+
activePlan?: import("../schemas/plan").PlanDocument | null;
|
|
35
|
+
activeBranchTip?: string | null;
|
|
34
36
|
sessionId: string;
|
|
35
37
|
/** 服务端投影的原始 turn 列表(按 sequence 有序)。 */
|
|
36
38
|
turns: TurnProjection[];
|
|
@@ -73,6 +75,9 @@ export interface SessionState {
|
|
|
73
75
|
queue: SessionQueueSnapshot;
|
|
74
76
|
/** 当前身份对这个会话的权限;"viewer" 表示只读(分享链接打开的)。 */
|
|
75
77
|
viewerRole: "owner" | "viewer" | null;
|
|
78
|
+
parentSessionId?: string | null;
|
|
79
|
+
subagentName?: string | null;
|
|
80
|
+
subagentReadonly?: boolean;
|
|
76
81
|
/** 工作流运行时间线,按触发它的 workflow:run 工具调用 id 索引(见 workflow.ts)。 */
|
|
77
82
|
workflowRuns: Record<string, WorkflowRunState>;
|
|
78
83
|
/** Stable anchor for the next older projected page. */
|
|
@@ -92,9 +97,12 @@ export interface ReplaySnapshot {
|
|
|
92
97
|
isReplay: boolean;
|
|
93
98
|
speed: ReplaySpeed;
|
|
94
99
|
sourceSessionId: string | null;
|
|
100
|
+
settings?: ReplayState;
|
|
95
101
|
}
|
|
96
102
|
/** 把服务端的 replay_state 归一化成快照;不是回放会话时返回 null。 */
|
|
97
103
|
export declare function toReplaySnapshot(raw: ReplayState | null | undefined): ReplaySnapshot | null;
|
|
104
|
+
/** Session ownership and the child session's write permission are independent. */
|
|
105
|
+
export declare function isReadOnlySession(state?: Pick<SessionState, "viewerRole" | "subagentReadonly"> | null, detail?: Pick<SessionInfo, "viewer_role" | "subagent_readonly"> | null): boolean;
|
|
98
106
|
export declare function createInitialSessionState(sessionId: string): SessionState;
|
|
99
107
|
export declare function parentForkToolCallIdFromTurn(turn: TurnProjection): string | null;
|
|
100
108
|
export declare function messageContentFromTurn(turn: Pick<TurnProjection, "blocks">): MessageContent;
|
|
@@ -123,7 +131,6 @@ export declare function withTurns(state: SessionState, turns: TurnProjection[]):
|
|
|
123
131
|
export declare function withQueue(state: SessionState, snapshot: SessionQueueSnapshot): SessionState;
|
|
124
132
|
export declare function addUserMessage(state: SessionState, content: MessageContent, clientRequestId?: string, topicAssetRefs?: TopicAssetRef[], refs?: import("../schemas/plugin-refs").MessageRef[], contextAttachments?: import("../schemas/context-attachments").ContextAttachment[]): SessionState;
|
|
125
133
|
export declare function upsertTurn(state: SessionState, turn: TurnProjection): SessionState;
|
|
126
|
-
export declare function applyTurnPatch(state: SessionState, patch: PatchEnvelope): SessionState;
|
|
127
134
|
export declare function addErrorMessage(state: SessionState, content: string): SessionState;
|
|
128
135
|
export declare function markInterrupted(state: SessionState): SessionState;
|
|
129
136
|
export declare function markFailed(state: SessionState): SessionState;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ContentBlock } from "../schemas/projection";
|
|
2
|
+
export type CompletionSource = {
|
|
3
|
+
source_kind: "subagent" | "board" | "bg_bash";
|
|
4
|
+
event_id: string;
|
|
5
|
+
source_session_id?: string;
|
|
6
|
+
source_execution_id?: string;
|
|
7
|
+
source_request_id?: string;
|
|
8
|
+
project_id?: number;
|
|
9
|
+
task_id?: string;
|
|
10
|
+
};
|
|
11
|
+
export interface CompletionNotice {
|
|
12
|
+
source: CompletionSource;
|
|
13
|
+
title: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function completionSource(value: unknown): CompletionSource | null;
|
|
16
|
+
export declare function completionNotice(blocks: readonly ContentBlock[] | undefined): CompletionNotice | null;
|
|
17
|
+
export interface NamedSubagent {
|
|
18
|
+
name: string;
|
|
19
|
+
sessionId?: string;
|
|
20
|
+
requestId?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function namedSubagent(tool: {
|
|
23
|
+
name: string;
|
|
24
|
+
arguments: string;
|
|
25
|
+
result?: unknown;
|
|
26
|
+
}): NamedSubagent | null;
|
package/dist/shared/oom.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { ContentBlock, ToolCallProjection, TurnProjection } from "../schemas/projection";
|
|
2
|
+
/** 平台确认沙盒发生内存超限时展示给用户的说明。实时与历史恢复共用。 */
|
|
3
|
+
export declare const OOM_MESSAGE = "\u6C99\u76D2\u5185\u5B58\u4F7F\u7528\u8D85\u51FA\u9650\u5236\u3002\u5982\u679C\u7ECF\u5E38\u89E6\u53D1\uFF0C\u53EF\u4EE5\u8054\u7CFB\u7BA1\u7406\u5458\u8C03\u6574\u989D\u5EA6\u3002";
|
|
3
4
|
export declare function isOomText(value: unknown): boolean;
|
|
4
|
-
|
|
5
|
+
export declare function isOomResult(value: unknown): boolean;
|
|
6
|
+
export declare function isSandboxOomToolCall(toolCall: Pick<ToolCallProjection, "status" | "result">): boolean;
|
|
7
|
+
export declare function isSandboxOomToolBlock(turn: Pick<TurnProjection, "tool_calls">, block: ContentBlock): boolean;
|
|
8
|
+
export declare function hasTurnSandboxOom(turn: Pick<TurnProjection, "blocks" | "tool_calls">): boolean;
|
|
9
|
+
/** 错误说明的展示文案:确认内存超限时换成友好说明,其余原样。实时与历史两条路径都要经过它,才能对得上。 */
|
|
5
10
|
export declare function userFacingErrorText(message: string): string;
|
|
@@ -22,21 +22,12 @@ export type ProjectionUpdate = {
|
|
|
22
22
|
};
|
|
23
23
|
/** 是否包含会改变聊天运行生命周期的事件。纯观测/整理事件不启动新一轮。 */
|
|
24
24
|
export declare function hasChatRunEvent(events: RawEvent[]): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 缺失 chat:end 时的终态兜底。只有被投影接受到当前 assistant turn 的 followup
|
|
27
|
-
* 才能结束流式态;陈旧 followup 或其后已有新轮事件时均返回 false。
|
|
28
|
-
*/
|
|
29
|
-
export declare function acceptedPostChatFollowupCompletesLatestRun(events: RawEvent[], updates: ProjectionUpdate[]): boolean;
|
|
30
25
|
export declare class ClientProjectionBuilder {
|
|
31
26
|
private activeTurns;
|
|
32
27
|
private lastTurnIds;
|
|
33
28
|
private latestTurns;
|
|
34
29
|
private turnsById;
|
|
35
30
|
private loopDescriptions;
|
|
36
|
-
private activeSubagentRuns;
|
|
37
|
-
private pendingChildPauses;
|
|
38
|
-
private answeredChildParents;
|
|
39
|
-
private pendingMemoryRefs;
|
|
40
31
|
private activeCompactions;
|
|
41
32
|
private failedCompactions;
|
|
42
33
|
private seq;
|
|
@@ -50,18 +41,9 @@ export declare class ClientProjectionBuilder {
|
|
|
50
41
|
acceptDurableTurn(turn: TurnProjection): void;
|
|
51
42
|
seedSequence(maxSeq: number): void;
|
|
52
43
|
_seedTurns(turns: TurnProjection[]): void;
|
|
53
|
-
private onMemoryInject;
|
|
54
|
-
private onContextEntry;
|
|
55
44
|
private onLoopTurn;
|
|
56
|
-
private onModeChange;
|
|
57
|
-
private onPlanStatusUpdate;
|
|
58
45
|
private onWorkspaceChanged;
|
|
59
|
-
private onAgentStart;
|
|
60
46
|
private onBgStarted;
|
|
61
|
-
private onBgTasksCompleted;
|
|
62
|
-
private onAskUserAnswer;
|
|
63
|
-
private onUserMessage;
|
|
64
|
-
private onPostChatFollowup;
|
|
65
47
|
private onDelta;
|
|
66
48
|
private onToolCallCreated;
|
|
67
49
|
private onToolCallArgumentsDelta;
|
|
@@ -70,19 +52,12 @@ export declare class ClientProjectionBuilder {
|
|
|
70
52
|
private applyStreamTiming;
|
|
71
53
|
private onToolResultDone;
|
|
72
54
|
private onToolResultDelta;
|
|
73
|
-
private onToolUi;
|
|
74
|
-
private onToolBridge;
|
|
75
|
-
private onToolApprovalRequired;
|
|
76
|
-
private onChildPause;
|
|
77
55
|
private onChatEnd;
|
|
78
|
-
private onAgentEnd;
|
|
79
|
-
private settleSubagentRun;
|
|
80
56
|
private dropIncompleteToolCalls;
|
|
81
57
|
private onCompaction;
|
|
82
58
|
private syncPatch;
|
|
83
59
|
private finalize;
|
|
84
60
|
private shouldFinalizeAfterToolResults;
|
|
85
|
-
private collectLoopUpdates;
|
|
86
61
|
private nextSeq;
|
|
87
62
|
private nextTurnId;
|
|
88
63
|
}
|
|
@@ -10,49 +10,14 @@ export declare function appendTextBlock(state: TurnState, blockType: ContentBloc
|
|
|
10
10
|
export declare function appendToolCallArguments(state: TurnState, toolCallId: string, delta: string): void;
|
|
11
11
|
export declare function buildSystemNotificationTurn(sequence: number, turnId: string, loopId: string, notificationType: string, status: string, title: string, detail: string | null, metadata: Record<string, unknown>): TurnProjection;
|
|
12
12
|
export declare function buildSystemNotificationBlock(notificationType: string, status: string, title: string, detail: string | null, metadata: Record<string, unknown>): ContentBlock;
|
|
13
|
-
export declare function buildMarkerTurn(sequence: number, turnId: string, loopId: string, blockType: ContentBlock["type"], content: unknown): TurnProjection;
|
|
14
13
|
export declare function buildCompactionTurn(sequence: number, compactionId: string, loopId: string, status: TurnProjection["status"], data: Record<string, unknown>): TurnProjection;
|
|
15
|
-
export interface ChildPauseInfo {
|
|
16
|
-
parentLoopName: string;
|
|
17
|
-
parentToolCallId: string;
|
|
18
|
-
childLoopName: string;
|
|
19
|
-
childToolCallId: string;
|
|
20
|
-
description: string;
|
|
21
|
-
}
|
|
22
14
|
export declare function setToolCallStatus(turn: TurnState | TurnProjection | null | undefined, toolCallId: string, status: ToolCallProjection["status"], result: unknown, pendingQuestionRef: PendingQuestionRef | null): void;
|
|
23
15
|
export declare function applyAskUserPauseToTurn(turn: TurnState | TurnProjection | null | undefined, pauseToolData: Record<string, unknown>, toolCallId: string, childLoopName: string, description: string, displayNameResolver: (name: string) => string): void;
|
|
24
16
|
/** Answered questions use the model's compact JSON again in persisted history. */
|
|
25
|
-
export declare function restoreAnsweredAskUserJson(turn: TurnState | TurnProjection | null | undefined, toolCallId: string): void;
|
|
26
17
|
export declare function applyChildPauseToParent(parentTurn: TurnState | TurnProjection | null | undefined, parentToolCallId: string, childLoopName: string, childToolCallId: string, description: string, displayNameResolver: (name: string) => string): void;
|
|
27
|
-
export declare function applyChildResultToParent(parentTurn: TurnState | TurnProjection | null | undefined, parentToolCallId: string, result: string): void;
|
|
28
18
|
export declare function sourceLoopFor(loopId: string, loopDescriptions: Map<string, string>): {
|
|
29
19
|
loop_name: string;
|
|
30
20
|
description: string;
|
|
31
21
|
} | null;
|
|
32
22
|
/** 本轮交付给用户的成果:工作区里的文件,或可以打开的网址。 */
|
|
33
|
-
export interface FinalArtifact {
|
|
34
|
-
kind: "file" | "link";
|
|
35
|
-
/** file 是文件路径(相对工作目录或容器内绝对路径);link 是 http/https 网址。 */
|
|
36
|
-
target: string;
|
|
37
|
-
label: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Shared by the streaming and history channels — both must decide "is this
|
|
41
|
-
* follow-up showable" identically. Returns null when there is nothing to show.
|
|
42
|
-
*/
|
|
43
|
-
export declare function normalizePostChatFollowup(data: Record<string, unknown>, assistantEntryId: string): {
|
|
44
|
-
assistant_entry_id: string;
|
|
45
|
-
recaption: string;
|
|
46
|
-
suggestions: string[];
|
|
47
|
-
final_artifacts: FinalArtifact[];
|
|
48
|
-
feedback_eligible: boolean;
|
|
49
|
-
feedback_scope: "latest_result";
|
|
50
|
-
} | null;
|
|
51
|
-
export declare function normalizeChildPause(pausePayload: Record<string, unknown>): {
|
|
52
|
-
pauseToolData: Record<string, unknown>;
|
|
53
|
-
childLoopName: string;
|
|
54
|
-
childToolCallId: string;
|
|
55
|
-
description: string;
|
|
56
|
-
};
|
|
57
|
-
/** Copy only the trusted protocol field, never evidence embedded in output. */
|
|
58
23
|
export declare function attachToolEvidence(call: ToolCallProjection | undefined, evidence: unknown): void;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { acknowledgeTurnEvents, ClientProjectionBuilder, hasChatRunEvent, type RawEvent, type ProjectionUpdate, } from "./builder";
|
|
2
2
|
export { type TurnState, createTurnState, snapshot, PAUSE_TOOL_NAMES } from "./state";
|
|
3
|
-
export { projectHistory, type RawHistoryEntry } from "./history";
|
|
4
3
|
export { workflowEntriesFromSteps, workflowRunCancelled, type WorkflowTimelineEntry, } from "./workflow";
|
|
5
|
-
export { buildContextTurn } from "./context";
|
package/dist/tool-provider.d.ts
CHANGED
|
@@ -559,12 +559,18 @@ export declare namespace ChatQueueUpdatedPayloadSchema {
|
|
|
559
559
|
export type ChatQueueUpdatedPayload = ChatQueueUpdatedPayloadSchema.ChatQueueUpdatedPayload;
|
|
560
560
|
export declare namespace SessionCreatedPayloadSchema {
|
|
561
561
|
type SessionId = string;
|
|
562
|
-
type
|
|
563
|
-
|
|
564
|
-
|
|
562
|
+
type ParentSessionId = (string | null);
|
|
563
|
+
type SubagentName = (string | null);
|
|
564
|
+
type SubagentReadonly = (boolean | null);
|
|
565
565
|
interface SessionCreatedPayload {
|
|
566
566
|
session_id: SessionId;
|
|
567
|
-
session?:
|
|
567
|
+
session?: (CreatedSessionSnapshot | null);
|
|
568
|
+
[k: string]: unknown;
|
|
569
|
+
}
|
|
570
|
+
interface CreatedSessionSnapshot {
|
|
571
|
+
parent_session_id?: ParentSessionId;
|
|
572
|
+
subagent_name?: SubagentName;
|
|
573
|
+
subagent_readonly?: SubagentReadonly;
|
|
568
574
|
[k: string]: unknown;
|
|
569
575
|
}
|
|
570
576
|
}
|
|
@@ -755,13 +761,15 @@ export type AsrErrorPayload = AsrErrorPayloadSchema.AsrErrorPayload;
|
|
|
755
761
|
export declare namespace AgentBoardBoardTaskChangedPayloadSchema {
|
|
756
762
|
type ProjectId = number;
|
|
757
763
|
type Action = ("created" | "updated" | "deleted");
|
|
764
|
+
type Status = ("todo" | "running" | "ended" | "archive");
|
|
758
765
|
interface AgentBoardBoardTaskChangedPayload {
|
|
759
766
|
project_id: ProjectId;
|
|
760
767
|
action: Action;
|
|
761
|
-
task:
|
|
768
|
+
task: BoardTaskSnapshot;
|
|
762
769
|
[k: string]: unknown;
|
|
763
770
|
}
|
|
764
|
-
interface
|
|
771
|
+
interface BoardTaskSnapshot {
|
|
772
|
+
status: Status;
|
|
765
773
|
[k: string]: unknown;
|
|
766
774
|
}
|
|
767
775
|
}
|