@blade-hq/agent-client 2610.0.1 → 2612.0.0-beta.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.
- package/README.md +38 -142
- package/dist/chunk-U2VELZGU.js +7607 -0
- package/dist/chunk-U2VELZGU.js.map +1 -0
- package/dist/embed/mount-renderer.d.ts +50 -0
- package/dist/index.d.ts +16 -59
- package/dist/index.js +22 -7115
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +55 -0
- package/dist/internal.js +340 -0
- package/dist/internal.js.map +1 -0
- package/dist/schemas/projection.d.ts +3 -0
- package/dist/schemas/solution.d.ts +0 -4
- package/dist/session/agent-session.d.ts +82 -12
- package/dist/session/events.d.ts +15 -1
- package/dist/session/hub.d.ts +88 -2
- package/dist/session/state.d.ts +37 -0
- package/dist/session/workflow.d.ts +57 -0
- package/dist/shared/oom.d.ts +5 -0
- package/dist/shared/projection/builder.d.ts +4 -0
- package/dist/shared/projection/helpers.d.ts +3 -0
- package/dist/types/socket-events.d.ts +6 -0
- package/package.json +5 -1
- package/public-api.md +163 -1494
- package/dist/commands/embedded.d.ts +0 -32
package/dist/session/hub.d.ts
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
import type { BladeClient } from "../blade-client";
|
|
2
|
-
import { AgentSession } from "./agent-session";
|
|
2
|
+
import { AgentSession, type SessionDetailSnapshot } from "./agent-session";
|
|
3
3
|
import type { ConnectionStatus } from "./state";
|
|
4
|
+
/**
|
|
5
|
+
* Hub 级事件:服务端推送的会话运行状态,**不论这个会话有没有 AgentSession 实例**都会触发
|
|
6
|
+
* (完整订阅的会话,以及 `watchStatus` 登记的状态订阅会话)。适合维护会话列表、发任务通知;
|
|
7
|
+
* 会话内部的状态请用 AgentSession。
|
|
8
|
+
*/
|
|
9
|
+
export interface SessionHubEvents {
|
|
10
|
+
/** 一轮运行开始(chat:start)。 */
|
|
11
|
+
runStarted: {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
};
|
|
14
|
+
/** 一轮运行结束(chat:end)。`replayed` 为 true 表示订阅时服务端重发的旧终态,不是新完成。 */
|
|
15
|
+
runEnded: {
|
|
16
|
+
sessionId: string;
|
|
17
|
+
/** 服务端给的终态原文;缺省时按 completed 处理会话状态,但不要当作「新完成」。 */
|
|
18
|
+
status?: string;
|
|
19
|
+
queued: boolean;
|
|
20
|
+
replayed: boolean;
|
|
21
|
+
chatRunId?: string;
|
|
22
|
+
};
|
|
23
|
+
/** 运行错误(system:error)。 */
|
|
24
|
+
runError: {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
message: string;
|
|
27
|
+
code?: string;
|
|
28
|
+
};
|
|
29
|
+
/** 会话属性被服务端更新(session:updated),`data` 是载荷原文。 */
|
|
30
|
+
sessionUpdated: {
|
|
31
|
+
sessionId: string;
|
|
32
|
+
data: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface SessionHubOptions {
|
|
36
|
+
/**
|
|
37
|
+
* 进入会话 / 重连时是否拉取历史指令(`GET /turns/commands`)补投给 onCommand。默认 true。
|
|
38
|
+
* 不消费历史指令的宿主可以关掉,省一次请求。
|
|
39
|
+
*/
|
|
40
|
+
restoreHistoricalCommands: boolean;
|
|
41
|
+
/** 覆盖会话详情的取数(宿主用自己的缓存去重)。缺省调 `client.sessions.getSession`。 */
|
|
42
|
+
fetchSessionInfo?: (sessionId: string, options: {
|
|
43
|
+
fresh: boolean;
|
|
44
|
+
}) => Promise<SessionDetailSnapshot>;
|
|
45
|
+
}
|
|
4
46
|
export interface SessionConnectOptions {
|
|
5
47
|
/**
|
|
6
48
|
* 在会话进入事件路由后、历史加载与房间订阅开始前同步执行。
|
|
@@ -23,7 +65,50 @@ export declare class SessionHub {
|
|
|
23
65
|
private bound;
|
|
24
66
|
private hasConnected;
|
|
25
67
|
private readonly authBusyReconnect;
|
|
68
|
+
private readonly hubEmitter;
|
|
69
|
+
private options;
|
|
70
|
+
/** token 订阅偏好(第一方 Web 精简模式);null 表示不设置,订阅时不带字段。 */
|
|
71
|
+
private streamTokens;
|
|
72
|
+
/** 状态订阅(mode: "status")的持有计数。 */
|
|
73
|
+
private readonly statusWatchCounts;
|
|
74
|
+
/** 启动连接门控:扣住期间只登记「需要连接」,放开后连一次。 */
|
|
75
|
+
private connectionHeld;
|
|
76
|
+
private connectDeferred;
|
|
77
|
+
/**
|
|
78
|
+
* 宿主显式要过连接(ensureConnected / reconnect,例如只收产品事件的页面)。有会话、状态订阅或这个需求时,
|
|
79
|
+
* 鉴权忙碌的临时拒绝都要按服务端建议重试,否则连接会一直停在断开,直到别的动作碰巧重连。
|
|
80
|
+
*/
|
|
81
|
+
private connectionDemanded;
|
|
26
82
|
constructor(client: BladeClient);
|
|
83
|
+
/** 调整 Hub 行为(见 SessionHubOptions)。只影响之后创建的会话实例。 */
|
|
84
|
+
configure(options: Partial<SessionHubOptions>): void;
|
|
85
|
+
/** 监听 Hub 级事件(见 SessionHubEvents)。返回取消函数。 */
|
|
86
|
+
on<K extends keyof SessionHubEvents>(name: K, handler: (event: SessionHubEvents[K]) => void): () => void;
|
|
87
|
+
/**
|
|
88
|
+
* @internal 第一方 Web 的精简模式传输优化:订阅时是否要 token 级事件。
|
|
89
|
+
* 空闲会话立即重订阅,运行中的会话等这一轮结束。
|
|
90
|
+
*/
|
|
91
|
+
setStreamTokens(enabled: boolean): void;
|
|
92
|
+
/**
|
|
93
|
+
* 只订阅一个会话的运行状态(chat:start / chat:end / session:updated / system:error),
|
|
94
|
+
* 不加载历史、不收回合内容。用于后台会话的列表状态与完成通知。引用计数:返回的函数归还一份。
|
|
95
|
+
* 事件经 Hub 级事件(`on("runEnded")` 等)送达。
|
|
96
|
+
*/
|
|
97
|
+
watchStatus(sessionId: string): () => void;
|
|
98
|
+
/**
|
|
99
|
+
* 启动连接门控:身份确认前扣住连接,`ensureConnected` 只登记需求;`releaseConnection` 后连一次。
|
|
100
|
+
* 避免用旧凭证连一次、身份确认后又重连一次。不调用则不受影响。
|
|
101
|
+
*/
|
|
102
|
+
holdConnection(): void;
|
|
103
|
+
/**
|
|
104
|
+
* 放开门控。扣住期间登记过连接需求时连一次;`connect: false`(例如身份确认后发现没有登录)只放开、
|
|
105
|
+
* 丢掉登记的需求,之后的 ensureConnected / reconnect 照常生效。
|
|
106
|
+
*/
|
|
107
|
+
releaseConnection(options?: {
|
|
108
|
+
connect?: boolean;
|
|
109
|
+
}): void;
|
|
110
|
+
/** 需要实时连接(例如只订阅产品事件、还没有会话时)。已连接或连接中时什么都不做。 */
|
|
111
|
+
ensureConnected(): void;
|
|
27
112
|
/** 当前 Socket.IO 连接状态。 */
|
|
28
113
|
getConnection(): ConnectionStatus;
|
|
29
114
|
/** 订阅连接状态变化。 */
|
|
@@ -58,9 +143,10 @@ export declare class SessionHub {
|
|
|
58
143
|
* 归零才退订房间并从路由表移除。
|
|
59
144
|
*/
|
|
60
145
|
private release;
|
|
146
|
+
private emitStatusSubscribe;
|
|
61
147
|
/** 不管还有几方持有都立即释放(启动失败、切换身份)。 */
|
|
62
148
|
private forceRelease;
|
|
63
|
-
private
|
|
149
|
+
private needsConnection;
|
|
64
150
|
private setConnection;
|
|
65
151
|
/** 事件带 session_id 时精确路由;缺省时按当前唯一活跃会话兜底。 */
|
|
66
152
|
private route;
|
package/dist/session/state.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ChatMessage, CompactionInfo, MessageContent } from "../schemas/mes
|
|
|
2
2
|
import type { ContentBlock, PatchEnvelope, TurnProjection } from "../schemas/projection";
|
|
3
3
|
import type { ReplaySpeed, ReplayState, SessionStatus } from "../schemas/session";
|
|
4
4
|
import { type SessionQueueSnapshot } from "./queue";
|
|
5
|
+
import { type WorkflowRunState } from "./workflow";
|
|
5
6
|
/** 一次 AskUserQuestion 的用户作答(选项选择 + 自定义输入 + 可选补充)。 */
|
|
6
7
|
export interface AskUserAnswerData {
|
|
7
8
|
selections: Record<number, number[]>;
|
|
@@ -13,6 +14,11 @@ export interface AgentLoopInfo {
|
|
|
13
14
|
toolCallId: string;
|
|
14
15
|
description: string;
|
|
15
16
|
status: "running" | "done" | "error" | "cancelled" | "awaiting_answer";
|
|
17
|
+
/**
|
|
18
|
+
* 工作流步骤 fork 出来的子回路:触发它的 workflow:run 工具调用 id。这类回路没有可解析参数的
|
|
19
|
+
* 父 Agent 工具调用,toolCallId 用回路名合成。普通子智能体没有此字段。
|
|
20
|
+
*/
|
|
21
|
+
workflowRunId?: string;
|
|
16
22
|
}
|
|
17
23
|
export interface ActiveCompactionState extends CompactionInfo {
|
|
18
24
|
turn_id: string;
|
|
@@ -42,15 +48,29 @@ export interface SessionState {
|
|
|
42
48
|
askAnswers: Record<string, AskUserAnswerData>;
|
|
43
49
|
agentLoops: Record<string, AgentLoopInfo>;
|
|
44
50
|
activeCompaction: ActiveCompactionState | null;
|
|
51
|
+
/**
|
|
52
|
+
* 手动整理已被服务端接受、还没收到结束事件。接受应答与真正的开始事件之间有一段准备时间,
|
|
53
|
+
* 这期间输入框也要保持「正在整理」。
|
|
54
|
+
*/
|
|
55
|
+
compactionPending: boolean;
|
|
45
56
|
/** 回放(演示 / 彩排)状态;不是回放会话时为 null。 */
|
|
46
57
|
replay: ReplaySnapshot | null;
|
|
47
58
|
/** 服务端持久化的等待消息队列快照;只在 revision 更新时替换。 */
|
|
48
59
|
queue: SessionQueueSnapshot;
|
|
49
60
|
/** 当前身份对这个会话的权限;"viewer" 表示只读(分享链接打开的)。 */
|
|
50
61
|
viewerRole: "owner" | "viewer" | null;
|
|
62
|
+
/** 工作流运行时间线,按触发它的 workflow:run 工具调用 id 索引(见 workflow.ts)。 */
|
|
63
|
+
workflowRuns: Record<string, WorkflowRunState>;
|
|
51
64
|
/** Stable anchor for the next older projected page. */
|
|
52
65
|
nextBefore: string | null;
|
|
53
66
|
loadingOlder: boolean;
|
|
67
|
+
/** 权威历史窗口每提交一次加一(首屏、运行结束 / 重连对账、定位)。向上翻页不算。 */
|
|
68
|
+
historyRevision: number;
|
|
69
|
+
/**
|
|
70
|
+
* timeline 被外部整体改写的次数(rewind、游标失效后的整窗修复、显式重载)。消息导航目录据此
|
|
71
|
+
* 当场作废:旧条目的 entry id 可能已经不在新的 timeline 上。定位换窗口不算改写。
|
|
72
|
+
*/
|
|
73
|
+
timelineRevision: number;
|
|
54
74
|
}
|
|
55
75
|
/** 回放会话的快照视图,由服务端的 replay_state 归一化而来。 */
|
|
56
76
|
export interface ReplaySnapshot {
|
|
@@ -62,11 +82,18 @@ export interface ReplaySnapshot {
|
|
|
62
82
|
/** 把服务端的 replay_state 归一化成快照;不是回放会话时返回 null。 */
|
|
63
83
|
export declare function toReplaySnapshot(raw: ReplayState | null | undefined): ReplaySnapshot | null;
|
|
64
84
|
export declare function createInitialSessionState(sessionId: string): SessionState;
|
|
85
|
+
export declare function parentForkToolCallIdFromTurn(turn: TurnProjection): string | null;
|
|
65
86
|
export declare function extractModeFromBlocks(blocks: ContentBlock[]): "planning" | "executing" | null;
|
|
66
87
|
export declare function reconcileOptimisticUserTurns(currentTurns: TurnProjection[], incomingTurns: TurnProjection[]): TurnProjection[];
|
|
67
88
|
/** Reconcile a bulk authoritative window only by an echoed request identity.
|
|
68
89
|
* Positional fallback is reserved for a single live turn from an older server. */
|
|
69
90
|
export declare function reconcileHistoricalUserTurns(currentTurns: TurnProjection[], incomingTurns: TurnProjection[]): TurnProjection[];
|
|
91
|
+
/**
|
|
92
|
+
* 同一条回合换成新版本时保留本地已知、新版本却缺失的字段:
|
|
93
|
+
* - client_render_id:乐观发言确认后的稳定渲染标识;
|
|
94
|
+
* - memory_refs:完成投影与历史同步有时不带经验引用(引用只在流式过程中下发一次)。
|
|
95
|
+
*/
|
|
96
|
+
export declare function preserveLocalTurnMetadata(next: TurnProjection, previous: TurnProjection | undefined): TurnProjection;
|
|
70
97
|
/**
|
|
71
98
|
* 用一份新的 turn 列表重建会话状态。
|
|
72
99
|
* addErrorMessage 注入的 role==="error" 消息不在 turns 里,默认会被物化过程抹掉;
|
|
@@ -85,3 +112,13 @@ export declare function applyTurnPatch(state: SessionState, patch: PatchEnvelope
|
|
|
85
112
|
export declare function addErrorMessage(state: SessionState, content: string): SessionState;
|
|
86
113
|
export declare function markInterrupted(state: SessionState): SessionState;
|
|
87
114
|
export declare function markFailed(state: SessionState): SessionState;
|
|
115
|
+
/**
|
|
116
|
+
* 叠加一条实时 workflow 事件。工具调用已经结束(时间线以工具结果为准)或不在当前 turn 列表里时
|
|
117
|
+
* 忽略;工作流名固定取工具参数,与历史同源。
|
|
118
|
+
*/
|
|
119
|
+
export declare function withWorkflowEvent(state: SessionState, toolCallId: string, type: string, payload: Record<string, unknown>): SessionState;
|
|
120
|
+
/**
|
|
121
|
+
* 撤回还没被服务端确认的乐观发言:`clientRequestIds` 给出时只撤回这些请求,否则撤回全部。
|
|
122
|
+
* 用于排队中断的 chat:end(服务端取消了排队中的发送)。
|
|
123
|
+
*/
|
|
124
|
+
export declare function withoutOptimisticUserTurns(state: SessionState, clientRequestIds?: readonly string[]): SessionState;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { TurnProjection } from "../schemas/projection";
|
|
2
|
+
/**
|
|
3
|
+
* 「工作流运行」的时间线:一次 workflow:run 工具调用执行过程中的步骤与日志。
|
|
4
|
+
*
|
|
5
|
+
* 两个来源,规则固定:
|
|
6
|
+
* - 运行中:服务端流式解析工作流 stdout 后推送的 `workflow:run:start` / `workflow:step` /
|
|
7
|
+
* `workflow:log` / `workflow:run:end` 原始事件(不落盘);
|
|
8
|
+
* - 工具调用结束后:一律用工具结果里留存的 `[workflow] …` 行重建(落盘,历史也只有这一份)。
|
|
9
|
+
* 这样实时、历史、重连、回放在运行结束后得到同一份时间线。
|
|
10
|
+
*/
|
|
11
|
+
export type WorkflowRunEntry = {
|
|
12
|
+
kind: "step";
|
|
13
|
+
stepId: string;
|
|
14
|
+
desc: string;
|
|
15
|
+
stepKind: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "log";
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
export interface WorkflowRunState {
|
|
21
|
+
/** 触发它的 workflow:run 工具调用 id。 */
|
|
22
|
+
toolCallId: string;
|
|
23
|
+
/** 工作流名(工具参数里的 name);拿不到时为空串,由界面兜底。 */
|
|
24
|
+
name: string;
|
|
25
|
+
status: "running" | "done" | "error" | "cancelled";
|
|
26
|
+
entries: WorkflowRunEntry[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* workflow:run 工具在 LLM 线上的名字是 `workflow__run`(provider 名与工具名过 LLM 层时用双下划线
|
|
30
|
+
* 拼接),内部锚点是 `workflow:run`。两种都认;不要先归一化工具名,归一化会把两种都变成 `run`。
|
|
31
|
+
*/
|
|
32
|
+
export declare function isWorkflowRunToolName(name: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 从工具结果里的 `[workflow] …` 行重建步骤时间线,与后端 parse_workflow_log_line 同词表。
|
|
35
|
+
* 非前缀行(最终输出 / traceback)不参与,由界面在外层展示。
|
|
36
|
+
*/
|
|
37
|
+
export declare function workflowEntriesFromOutput(output: string): WorkflowRunEntry[];
|
|
38
|
+
/** 工作流名只从工具参数取:历史没有实时事件,两条路径都用这一个来源。 */
|
|
39
|
+
export declare function workflowNameFromArguments(argumentsJson: string): string;
|
|
40
|
+
export declare function isWorkflowEvent(type: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 把一条实时 workflow 事件叠加到这次运行的时间线上。`current` 为 undefined 表示还没有这次运行。
|
|
43
|
+
* 返回 null 表示事件不改变时间线。
|
|
44
|
+
*
|
|
45
|
+
* `workflow:run:start` 到达 = 事件流从头开始:重连回放会把整个缓冲(含 start 与全部 step/log)
|
|
46
|
+
* 原样重发,保留旧条目再逐条追加会让时间线每次重连翻一倍;清空重建天然幂等。
|
|
47
|
+
*/
|
|
48
|
+
export declare function applyWorkflowEvent(current: WorkflowRunState | undefined, toolCallId: string, type: string, payload: Record<string, unknown>): WorkflowRunState | null;
|
|
49
|
+
/**
|
|
50
|
+
* 按当前 turn 列表重建全部工作流运行。
|
|
51
|
+
* - 工具调用已结束:时间线取工具结果,状态取工具状态(与历史同源);
|
|
52
|
+
* - 仍在运行:保留实时事件累积的时间线(没有时为空)。
|
|
53
|
+
* 只保留当前 turn 列表里还存在的工具调用(rewind 之后旧运行随之消失)。
|
|
54
|
+
*/
|
|
55
|
+
export declare function rebuildWorkflowRuns(turns: readonly TurnProjection[], previous: Readonly<Record<string, WorkflowRunState>>): Record<string, WorkflowRunState>;
|
|
56
|
+
/** 同一次运行里第 n 个子智能体步骤的描述(历史没有 agent:start 通知时给子回路起标题)。 */
|
|
57
|
+
export declare function workflowAgentStepDescription(run: WorkflowRunState | undefined, index: number): string | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** 沙盒因内存超限被杀(退出码 137)时展示给用户的说明。实时 system:error 与历史恢复共用。 */
|
|
2
|
+
export declare const OOM_MESSAGE = "\u6C99\u76D2\u5185\u5B58\u4F7F\u7528\u8D85\u51FA\u9650\u5236\uFF0C\u5DF2\u81EA\u52A8\u91CD\u542F\u3002\u5982\u679C\u7ECF\u5E38\u89E6\u53D1\uFF0C\u53EF\u4EE5\u8054\u7CFB\u7BA1\u7406\u5458\u8C03\u6574\u989D\u5EA6\u3002";
|
|
3
|
+
export declare function isOomText(value: unknown): boolean;
|
|
4
|
+
/** 错误说明的展示文案:内存超限换成友好说明,其余原样。实时与历史两条路径都要经过它,才能对得上。 */
|
|
5
|
+
export declare function userFacingErrorText(message: string): string;
|
|
@@ -14,6 +14,8 @@ export type ProjectionUpdate = {
|
|
|
14
14
|
toolCallId?: string;
|
|
15
15
|
toolName?: string;
|
|
16
16
|
workspacePath?: string;
|
|
17
|
+
/** 本次工具改动的文件(相对工作区)。缺省表示不知道具体文件,按整体变化处理。 */
|
|
18
|
+
paths?: string[];
|
|
17
19
|
};
|
|
18
20
|
/** 是否包含会改变聊天运行生命周期的事件。纯观测/整理事件不启动新一轮。 */
|
|
19
21
|
export declare function hasChatRunEvent(events: RawEvent[]): boolean;
|
|
@@ -31,6 +33,8 @@ export declare class ClientProjectionBuilder {
|
|
|
31
33
|
/** loop_name → 正在运行的子智能体起点,agent:end 结算并挂到父工具调用上。 */
|
|
32
34
|
private activeSubagentRuns;
|
|
33
35
|
private pendingChildPauses;
|
|
36
|
+
/** 作答后子回路续跑,最终回复就是随后落盘的父 Agent 工具结果。 */
|
|
37
|
+
private answeredChildParents;
|
|
34
38
|
private pendingMemoryRefs;
|
|
35
39
|
private activeCompactions;
|
|
36
40
|
private failedCompactions;
|
|
@@ -21,7 +21,10 @@ export interface ChildPauseInfo {
|
|
|
21
21
|
}
|
|
22
22
|
export declare function setToolCallStatus(turn: TurnState | TurnProjection | null | undefined, toolCallId: string, status: ToolCallProjection["status"], result: unknown, pendingQuestionRef: PendingQuestionRef | null): void;
|
|
23
23
|
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
|
+
/** 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;
|
|
24
26
|
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;
|
|
25
28
|
export declare function sourceLoopFor(loopId: string, loopDescriptions: Map<string, string>): {
|
|
26
29
|
loop_name: string;
|
|
27
30
|
description: string;
|
|
@@ -292,8 +292,12 @@ export declare namespace ChatQueueUpdatedPayloadSchema {
|
|
|
292
292
|
export type ChatQueueUpdatedPayload = ChatQueueUpdatedPayloadSchema.ChatQueueUpdatedPayload;
|
|
293
293
|
export declare namespace SessionCreatedPayloadSchema {
|
|
294
294
|
type SessionId = string;
|
|
295
|
+
type Session = ({
|
|
296
|
+
[k: string]: unknown;
|
|
297
|
+
} | null);
|
|
295
298
|
interface SessionCreatedPayload {
|
|
296
299
|
session_id: SessionId;
|
|
300
|
+
session?: Session;
|
|
297
301
|
[k: string]: unknown;
|
|
298
302
|
}
|
|
299
303
|
}
|
|
@@ -325,9 +329,11 @@ export type SessionUpdatedPayload = SessionUpdatedPayloadSchema.SessionUpdatedPa
|
|
|
325
329
|
export declare namespace WorkspaceFilesChangedPayloadSchema {
|
|
326
330
|
type SessionId = string;
|
|
327
331
|
type FilePath = (string | null);
|
|
332
|
+
type FilePaths = (string[] | null);
|
|
328
333
|
interface WorkspaceFilesChangedPayload {
|
|
329
334
|
session_id: SessionId;
|
|
330
335
|
file_path?: FilePath;
|
|
336
|
+
file_paths?: FilePaths;
|
|
331
337
|
[k: string]: unknown;
|
|
332
338
|
}
|
|
333
339
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blade-hq/agent-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2612.0.0-beta.1",
|
|
4
4
|
"description": "Blade Agent 框架无关客户端:会话实时状态机、REST 通道、弹窗登录、页面协作。浏览器与 Node.js 通用。",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./internal": {
|
|
18
|
+
"types": "./dist/internal.d.ts",
|
|
19
|
+
"import": "./dist/internal.js"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"files": [
|