@blade-hq/agent-client 2612.0.0-beta.7 → 2612.0.0-beta.71

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 (95) hide show
  1. package/README.md +352 -34
  2. package/dist/application-client.d.ts +19 -0
  3. package/dist/blade-client.d.ts +25 -9
  4. package/dist/{chunk-E7J2JBML.js → chunk-DMVWOTJB.js} +1588 -391
  5. package/dist/chunk-DMVWOTJB.js.map +1 -0
  6. package/dist/index.d.ts +18 -5
  7. package/dist/index.js +15 -1
  8. package/dist/internal.d.ts +12 -4
  9. package/dist/internal.js +29 -3
  10. package/dist/internal.js.map +1 -1
  11. package/dist/resources/auth.d.ts +9 -1
  12. package/dist/resources/computers.d.ts +2 -7
  13. package/dist/resources/connectors.d.ts +323 -0
  14. package/dist/resources/headless.d.ts +1 -1
  15. package/dist/resources/llm.d.ts +64 -0
  16. package/dist/resources/models.d.ts +6 -1
  17. package/dist/resources/phones.d.ts +109 -0
  18. package/dist/resources/plugins.d.ts +22 -0
  19. package/dist/resources/sandbox.d.ts +22 -0
  20. package/dist/resources/sessions.d.ts +105 -10
  21. package/dist/schemas/ask-user-question.d.ts +21 -0
  22. package/dist/schemas/context-attachments.d.ts +18 -0
  23. package/dist/schemas/message-utils.d.ts +3 -9
  24. package/dist/schemas/message.d.ts +16 -2
  25. package/dist/schemas/plugin-refs.d.ts +7 -0
  26. package/dist/schemas/projection.d.ts +14 -1
  27. package/dist/schemas/session.d.ts +2 -48
  28. package/dist/server-clock.d.ts +2 -0
  29. package/dist/session/agent-session.d.ts +44 -95
  30. package/dist/session/definition.d.ts +3 -0
  31. package/dist/session/events.d.ts +0 -1
  32. package/dist/session/hub.d.ts +0 -24
  33. package/dist/session/state.d.ts +8 -1
  34. package/dist/session/workflow.d.ts +10 -3
  35. package/dist/shared/projection/builder.d.ts +0 -2
  36. package/dist/shared/projection/index.d.ts +1 -0
  37. package/dist/shared/projection/workflow.d.ts +24 -0
  38. package/dist/tool-provider.d.ts +60 -0
  39. package/dist/types/socket-events.d.ts +167 -11
  40. package/dist/version.d.ts +0 -1
  41. package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +2 -3
  42. package/node_modules/engine.io-client/build/cjs/index.d.ts +3 -3
  43. package/node_modules/engine.io-client/build/cjs/index.js +1 -4
  44. package/node_modules/engine.io-client/build/cjs/socket.d.ts +39 -82
  45. package/node_modules/engine.io-client/build/cjs/socket.js +151 -218
  46. package/node_modules/engine.io-client/build/cjs/transport.d.ts +1 -1
  47. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +4 -4
  48. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +2 -2
  49. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +17 -7
  50. package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +17 -7
  51. package/node_modules/engine.io-client/build/esm/globals.node.d.ts +2 -3
  52. package/node_modules/engine.io-client/build/esm/index.d.ts +3 -3
  53. package/node_modules/engine.io-client/build/esm/index.js +1 -2
  54. package/node_modules/engine.io-client/build/esm/socket.d.ts +39 -82
  55. package/node_modules/engine.io-client/build/esm/socket.js +141 -206
  56. package/node_modules/engine.io-client/build/esm/transport.d.ts +1 -1
  57. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +4 -4
  58. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +2 -2
  59. package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +2 -3
  60. package/node_modules/engine.io-client/build/esm-debug/index.d.ts +3 -3
  61. package/node_modules/engine.io-client/build/esm-debug/index.js +1 -2
  62. package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +39 -82
  63. package/node_modules/engine.io-client/build/esm-debug/socket.js +150 -215
  64. package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +1 -1
  65. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +4 -4
  66. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +2 -2
  67. package/node_modules/engine.io-client/dist/engine.io.esm.min.js +3 -3
  68. package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -1
  69. package/node_modules/engine.io-client/dist/engine.io.js +164 -239
  70. package/node_modules/engine.io-client/dist/engine.io.js.map +1 -1
  71. package/node_modules/engine.io-client/dist/engine.io.min.js +3 -3
  72. package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -1
  73. package/node_modules/engine.io-client/package.json +2 -2
  74. package/node_modules/socket.io-parser/build/cjs/binary.js +4 -1
  75. package/node_modules/socket.io-parser/build/cjs/index.d.ts +14 -4
  76. package/node_modules/socket.io-parser/build/cjs/index.js +18 -11
  77. package/node_modules/socket.io-parser/build/esm/binary.js +4 -1
  78. package/node_modules/socket.io-parser/build/esm/index.d.ts +14 -4
  79. package/node_modules/socket.io-parser/build/esm/index.js +14 -10
  80. package/node_modules/socket.io-parser/build/esm-debug/binary.js +4 -1
  81. package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +14 -4
  82. package/node_modules/socket.io-parser/build/esm-debug/index.js +14 -10
  83. package/node_modules/socket.io-parser/package.json +1 -1
  84. package/node_modules/ws/index.js +15 -6
  85. package/node_modules/ws/lib/constants.js +1 -0
  86. package/node_modules/ws/lib/permessage-deflate.js +9 -7
  87. package/node_modules/ws/lib/receiver.js +37 -0
  88. package/node_modules/ws/lib/sender.js +6 -1
  89. package/node_modules/ws/lib/websocket-server.js +18 -6
  90. package/node_modules/ws/lib/websocket.js +50 -17
  91. package/node_modules/ws/package.json +8 -3
  92. package/node_modules/ws/wrapper.mjs +14 -1
  93. package/package.json +4 -4
  94. package/public-api.md +662 -36
  95. package/dist/chunk-E7J2JBML.js.map +0 -1
@@ -1,13 +1,25 @@
1
1
  import type { BackgroundTask, BackgroundTaskStopResult } from "../schemas/background";
2
2
  import type { TurnProjection } from "../schemas/projection";
3
3
  import type { McpAppArchive } from "../schemas/mcp-app";
4
- import type { PublishedSolutionRef, ReplayPreview, ReplaySpeed, SessionDetail, SessionInfo, TemplateId } from "../schemas/session";
4
+ import type { PublishedSolutionRef, ReplayPreview, ReplaySpeed, SessionDetail, SessionInfo } from "../schemas/session";
5
5
  import type { McpAppContextState, McpAppContextUpdate } from "../schemas/mcp-app";
6
6
  import type { Task } from "../schemas/task";
7
7
  import type { BladeClient, UploadProgress } from "../blade-client";
8
8
  import type { AgentSession } from "../session/agent-session";
9
9
  import { type SessionDefinition } from "../session/definition";
10
10
  import type { SessionProfile } from "../types/sdk-profile";
11
+ export interface FileOpenerInstance {
12
+ token: string;
13
+ title: string;
14
+ html: string;
15
+ resourceMeta: Record<string, unknown>;
16
+ appToolNames: string[];
17
+ file: {
18
+ path: string;
19
+ name: string;
20
+ revision: string;
21
+ };
22
+ }
11
23
  export interface SessionPlugin {
12
24
  /** Technical ID: always used for paths, authorization, caching and calls. */
13
25
  name: string;
@@ -87,8 +99,11 @@ export interface SessionPluginConfigUpdate {
87
99
  remove?: string[];
88
100
  }
89
101
  export interface CreateSessionRequest {
102
+ /** Notification owner. Built-in Web declares ui; external applications default to sdk. */
103
+ initiator?: "ui" | "sdk";
104
+ /** 认证创建独立匿名沙盒;链接持有者可继续聊天,不继承个人资源。 */
105
+ anonymous?: boolean;
90
106
  intent?: string;
91
- template_id?: TemplateId;
92
107
  /** 正式 Solution 来源。Hub 使用 { source: "hub", org, name }。 */
93
108
  solution_ref?: PublishedSolutionRef;
94
109
  /** @deprecated 请使用结构化的 solution_ref;继续支持以保证现有 SDK 调用无感升级。 */
@@ -96,7 +111,6 @@ export interface CreateSessionRequest {
96
111
  /** 从已有会话复制其不可变 Solution 与 Skill 运行快照。 */
97
112
  solution_snapshot_session_id?: string;
98
113
  biz_role_id?: string | null;
99
- primary_skill_id?: string | null;
100
114
  model?: string | null;
101
115
  enable_thinking?: boolean | null;
102
116
  memory_enabled?: boolean | null;
@@ -105,15 +119,17 @@ export interface CreateSessionRequest {
105
119
  mcp_sources?: McpSourceConfig[];
106
120
  /** 此会话的所有普通轮次直接执行工具,不弹审批。 */
107
121
  skip_confirmations?: boolean;
122
+ session_solution_files?: {
123
+ path: string;
124
+ content: string;
125
+ }[];
108
126
  session_solution_asset_id?: string | null;
109
127
  compaction_ratio?: number | null;
110
- runtime_type?: "sandbox" | "daemon" | "native" | null;
111
- daemon_id?: string | null;
112
- /** runtime_type 为 "native" 时必填:daemon 上要用哪个原生智能体(如 rt_codex)。 */
113
- agent_runtime_id?: string | null;
114
128
  chat_group_id?: string | null;
115
129
  }
116
130
  export interface McpSourceConfig {
131
+ /** Source summary shown before lazy tool discovery. */
132
+ description?: string;
117
133
  id: string;
118
134
  url: string;
119
135
  bearer_token?: string | null;
@@ -121,6 +137,46 @@ export interface McpSourceConfig {
121
137
  include_tools?: string[] | null;
122
138
  eager_tools?: string[];
123
139
  }
140
+ /** Sandbox only. Omitted fields are retained; lists/maps replace their previous value. */
141
+ export interface UpdateSessionConfigurationRequest {
142
+ version: string;
143
+ expected_revision?: number;
144
+ solution_ref?: PublishedSolutionRef;
145
+ solution_id?: string;
146
+ session_solution_files?: {
147
+ path: string;
148
+ content: string;
149
+ }[];
150
+ session_solution_asset_id?: string;
151
+ biz_role_id?: string;
152
+ model?: string;
153
+ enable_thinking?: boolean | null;
154
+ memory_enabled?: boolean;
155
+ env?: Record<string, string>;
156
+ disable_tools?: string[];
157
+ mcp_sources?: McpSourceConfig[];
158
+ skip_confirmations?: boolean;
159
+ compaction_ratio?: number | null;
160
+ }
161
+ export interface SessionConfiguration {
162
+ session_id: string;
163
+ version: string | null;
164
+ revision: number;
165
+ configuration: {
166
+ solution_identity: Record<string, unknown> | null;
167
+ solution_version: string | null;
168
+ biz_role_id: string | null;
169
+ biz_role_version: string | null;
170
+ model: string | null;
171
+ enable_thinking: boolean | null;
172
+ memory_enabled: boolean;
173
+ env: Record<string, string>;
174
+ disable_tools: string[];
175
+ mcp_sources: Omit<McpSourceConfig, "bearer_token">[];
176
+ skip_confirmations: boolean;
177
+ compaction_ratio: number | null;
178
+ };
179
+ }
124
180
  export interface CheckpointNode {
125
181
  id: string;
126
182
  parent_id: string | null;
@@ -334,6 +390,24 @@ export declare class SessionsResource {
334
390
  fetchSharedImage(token: string, assetId: string, preview?: boolean): Promise<Blob>;
335
391
  private fetchImagePath;
336
392
  constructor(client: BladeClient);
393
+ openFileOpener(sessionId: string, body: {
394
+ plugin: string;
395
+ opener: string;
396
+ path: string;
397
+ }, init?: RequestInit): Promise<FileOpenerInstance>;
398
+ callFileOpener(sessionId: string, body: {
399
+ token: string;
400
+ request_id: string;
401
+ name: string;
402
+ arguments: Record<string, unknown>;
403
+ file?: "read" | "save";
404
+ base_revision?: string;
405
+ }, init?: RequestInit): Promise<{
406
+ response: Record<string, unknown>;
407
+ file?: {
408
+ revision: string;
409
+ };
410
+ }>;
337
411
  getMcpApp(sessionId: string, sourceId: string, init?: RequestInit): Promise<McpAppArchive>;
338
412
  onMcpAppChanged(sessionId: string, sourceId: string, listener: () => void): () => void;
339
413
  callMcpApp(sessionId: string, sourceId: string, request: {
@@ -409,11 +483,10 @@ export declare class SessionsResource {
409
483
  private prepareSolution;
410
484
  private cleanupSolutionAsset;
411
485
  private fetchSessionsPage;
412
- listSessions(template_id_prefix?: string, solution_id?: string): Promise<SessionInfo[]>;
486
+ listSessions(solution_id?: string): Promise<SessionInfo[]>;
413
487
  listSessionsPaginated(params: {
414
488
  limit: number;
415
489
  offset: number;
416
- template_id_prefix?: string;
417
490
  solution_id?: string;
418
491
  solution_registry_id?: string;
419
492
  q?: string;
@@ -424,7 +497,7 @@ export declare class SessionsResource {
424
497
  q: string;
425
498
  limit?: number;
426
499
  }): Promise<GlobalSearchResult>;
427
- createSession(intent?: string, template_id?: TemplateId, primary_skill_id?: string | null): Promise<{
500
+ createSession(intent?: string): Promise<{
428
501
  session_id: string;
429
502
  }>;
430
503
  createSessionWithRequest(request: CreateSessionRequest): Promise<{
@@ -441,6 +514,9 @@ export declare class SessionsResource {
441
514
  intent?: string;
442
515
  chat_group_id?: string | null;
443
516
  }): Promise<SessionDetail>;
517
+ getSessionConfiguration(sessionId: string, init?: RequestInit): Promise<SessionConfiguration>;
518
+ /** Updates atomically between turns. A running/handoff session returns HTTP 409. */
519
+ updateSessionConfiguration(sessionId: string, request: UpdateSessionConfigurationRequest): Promise<SessionConfiguration>;
444
520
  setSessionEnv(sessionId: string, env: Record<string, string>): Promise<SessionDetail>;
445
521
  pinSession(sessionId: string, pinned: boolean): Promise<SessionInfo>;
446
522
  startReplaySession(sourceSessionId: string, speed?: ReplaySpeed): Promise<{
@@ -466,6 +542,8 @@ export declare class SessionsResource {
466
542
  }>;
467
543
  getSharedSession(token: string): Promise<TurnProjection[]>;
468
544
  getSessionTasks(sessionId: string): Promise<Task[]>;
545
+ /** Durable result for this execution; null until its run_end is committed. Owner only. */
546
+ getRunResult<T = unknown>(sessionId: string, runId: string): Promise<SessionRunResult<T> | null>;
469
547
  getSessionTurns(sessionId: string): Promise<TurnProjection[]>;
470
548
  getSessionTurnsPage(sessionId: string, options?: SessionTurnsQuery, init?: RequestInit): Promise<SessionTurnsPage>;
471
549
  /**
@@ -521,6 +599,15 @@ export declare class SessionsResource {
521
599
  id: string;
522
600
  leaf_id: string;
523
601
  }>;
602
+ listAnonymousSessions(): Promise<Array<{
603
+ id: string;
604
+ intent: string;
605
+ created_at: string;
606
+ status: string;
607
+ }>>;
608
+ deleteAnonymousSession(sessionId: string): Promise<{
609
+ deleted: boolean;
610
+ }>;
524
611
  deleteSession(sessionId: string, options?: {
525
612
  deleteWorkspace?: boolean;
526
613
  }): Promise<{
@@ -570,3 +657,11 @@ export declare class SessionsResource {
570
657
  session_id: string;
571
658
  }>;
572
659
  }
660
+ export interface SessionRunResult<T = unknown> {
661
+ kind: "run_end";
662
+ run_id: string;
663
+ status: "completed" | "failed" | "interrupted" | "waiting_for_input";
664
+ output?: string;
665
+ error?: string;
666
+ structured_result?: T;
667
+ }
@@ -0,0 +1,21 @@
1
+ import type { AskUserAnswerData } from "../session/state";
2
+ export interface AskUserQuestionOption {
3
+ label: string;
4
+ description: string;
5
+ }
6
+ export interface AskUserQuestionItem {
7
+ question: string;
8
+ options: AskUserQuestionOption[];
9
+ multiSelect?: boolean;
10
+ }
11
+ export interface AskUserQuestionData {
12
+ questions: AskUserQuestionItem[];
13
+ source_loop?: {
14
+ loop_name: string;
15
+ description: string;
16
+ } | null;
17
+ }
18
+ /** Normalize the question payload returned by AskUserQuestion or stored in its arguments. */
19
+ export declare function parseAskUserQuestion(toolResult: string | null | undefined): AskUserQuestionData | null;
20
+ /** Build the user message accompanying a structured AskUserQuestion answer. */
21
+ export declare function formatAskUserAnswer(data: AskUserQuestionData, answer: AskUserAnswerData): string;
@@ -0,0 +1,18 @@
1
+ /** Frozen application data belonging to one message. The server does not interpret business types. */
2
+ export interface ContextAttachment {
3
+ id: string;
4
+ label: string;
5
+ content: string;
6
+ /** Project plain text as a named session Context; the producer supplies full state. */
7
+ update_format?: "snapshot" | "diff";
8
+ data?: Record<string, unknown> | null;
9
+ files?: Array<{
10
+ name: string;
11
+ session_id?: string;
12
+ path?: string;
13
+ }>;
14
+ }
15
+ /** Validate before persisting a reliable request. JSON cloning also rejects cycles. */
16
+ export declare function snapshotContextAttachments(value: ContextAttachment[]): ContextAttachment[];
17
+ /** Server-owned snapshots travel unchanged through stream and history projections. */
18
+ export declare function normalizeContextAttachments(value: unknown): ContextAttachment[];
@@ -24,21 +24,15 @@ export declare function buildMessageContent(text: string, attachments: Array<{
24
24
  mimeType?: string;
25
25
  }>): MessageContent;
26
26
  export declare function contentPreview(content: MessageContent, maxLen?: number): string;
27
- /** `/` 选中的技能当前处于什么状态,决定智能体要不要先装、先加载。 */
27
+ /** @deprecated 技能可用状态由运行时解析,发送身份请使用 SkillRef。 */
28
28
  export interface SkillMentionAvailability {
29
29
  /** 本地已有(内置 / 技能目录 / 会话已加载),直接可用。 */
30
30
  local?: boolean;
31
31
  /** Blade Hub 上该账号是否已安装。本地技能恒为 true。 */
32
32
  installed?: boolean;
33
33
  }
34
- /**
35
- * Transform a skill mention into a natural language skill invocation.
36
- * Strips the `<skill>name</skill>` tag from the raw input and prepends the instruction.
37
- *
38
- * Hub 技能装没装、加载没加载,用户不需要知道,但智能体需要——所以把状态翻译
39
- * 成它能直接照做的 CLI 步骤。不传 availability 时按本地技能处理,与旧行为一致。
40
- */
41
- export declare function transformSlashCommand(skillName: string, rawInput: string, { local, installed }?: SkillMentionAvailability): string;
34
+ /** Serialize a skill marker as user text. Send its identity separately in refs. */
35
+ export declare function transformSlashCommand(skillName: string, rawInput: string, _availability?: SkillMentionAvailability): string;
42
36
  export interface ParsedTextAttachment {
43
37
  name: string;
44
38
  uploadedPath?: string;
@@ -20,6 +20,17 @@ export interface FileContentPart {
20
20
  }
21
21
  export type MessageContentPart = TextContentPart | ImageUrlContentPart | FileContentPart;
22
22
  export type MessageContent = string | MessageContentPart[];
23
+ /** 固定流程解释执行落史的一步(workflow:run 专用):刷新后时间线从这里重建。 */
24
+ export interface WorkflowStepInfo {
25
+ step_id: string;
26
+ desc?: string;
27
+ step_kind?: string;
28
+ status?: string;
29
+ output?: string;
30
+ /** 直播时的先后:步骤宣告与它的输出/失败行(条目按终态落盘,重建按这两个值排回去) */
31
+ seq?: number;
32
+ log_seq?: number;
33
+ }
23
34
  export interface ToolCallInfo {
24
35
  evidence?: ToolEvidence[];
25
36
  id: string;
@@ -30,9 +41,10 @@ export interface ToolCallInfo {
30
41
  status?: "pending" | "done" | "error" | "cancelled" | "awaiting_answer";
31
42
  duration_ms?: number | null;
32
43
  pending_question_ref?: PendingQuestionRef | null;
44
+ workflow_steps?: WorkflowStepInfo[] | null;
33
45
  }
34
46
  export type { ToolBridgeContent };
35
- /** Derive tool status from the result content string. */
47
+ /** Only the cancellation marker is content-based; errors come from protocol fields. */
36
48
  export declare function inferToolStatus(resultStr: string): "done" | "error" | "cancelled";
37
49
  export interface MemoryRefInfo {
38
50
  id: number;
@@ -75,6 +87,7 @@ export interface ChatMessage {
75
87
  duration_ms?: number;
76
88
  timestamp?: string;
77
89
  entry_id?: string;
90
+ client_request_id?: string;
78
91
  /** Stable React key retained when an optimistic user message is confirmed. */
79
92
  render_id?: string;
80
93
  parent_id?: string | null;
@@ -82,7 +95,8 @@ export interface ChatMessage {
82
95
  /** Entry kind from backend -- present for non-message entries like mode changes. */
83
96
  kind?: string;
84
97
  /** Memory references injected into this turn's context */
85
- refs?: import("./plugin-refs").PluginRef[];
98
+ refs?: import("./plugin-refs").MessageRef[];
99
+ context_attachments?: import("./context-attachments").ContextAttachment[];
86
100
  topic_asset_refs?: import("./topic-assets").TopicAssetRef[];
87
101
  memory_refs?: MemoryRefInfo[];
88
102
  /** Raw projection blocks for block-level UI rendering. */
@@ -6,3 +6,10 @@ export interface PluginRef {
6
6
  label: string;
7
7
  }
8
8
  export declare function normalizePluginRefs(value: unknown): PluginRef[];
9
+ export interface SkillRef {
10
+ provider: "skill";
11
+ id: string;
12
+ label: string;
13
+ }
14
+ export type MessageRef = PluginRef | SkillRef;
15
+ export declare function normalizeMessageRefs(value: unknown): MessageRef[];
@@ -25,6 +25,17 @@ export interface RunTiming {
25
25
  duration_ms?: number | null;
26
26
  status: "completed" | "failed" | "cancelled" | "paused" | "incomplete";
27
27
  }
28
+ /** 固定流程解释执行时落史的一步:刷新/重启后时间线的真相源。 */
29
+ export interface WorkflowStepProjection {
30
+ step_id: string;
31
+ desc?: string;
32
+ step_kind?: string;
33
+ status?: string;
34
+ output?: string;
35
+ /** 直播时的先后:步骤宣告与它的输出/失败行(条目按终态落盘,重建按这两个值排回去) */
36
+ seq?: number;
37
+ log_seq?: number;
38
+ }
28
39
  export interface ToolEvidence {
29
40
  n: number;
30
41
  id: string;
@@ -55,6 +66,7 @@ export interface ToolCallProjection {
55
66
  /** 该工具派生的子智能体运行区间,仅作外层展示。 */
56
67
  subagent_runs?: RunTiming[];
57
68
  pending_question_ref?: PendingQuestionRef | null;
69
+ workflow_steps?: WorkflowStepProjection[] | null;
58
70
  }
59
71
  export interface MemoryRef {
60
72
  id: number;
@@ -96,7 +108,8 @@ export interface TurnProjection {
96
108
  /** started_at 是否来自生产者上报(而非旧会话的落盘回落)。瀑布只承认前者。 */
97
109
  has_reported_timing?: boolean;
98
110
  context_window?: number;
99
- refs?: import("./plugin-refs").PluginRef[] | null;
111
+ refs?: import("./plugin-refs").MessageRef[] | null;
112
+ context_attachments?: import("./context-attachments").ContextAttachment[];
100
113
  topic_asset_refs?: import("./topic-assets").TopicAssetRef[] | null;
101
114
  memory_refs?: MemoryRef[] | null;
102
115
  parent_fork_tool_call_id?: string | null;
@@ -1,8 +1,6 @@
1
1
  import type { Solution } from "./solution";
2
2
  export declare const SessionStatus: import("arktype/internal/variants/string.ts").StringType<"completed" | "created" | "failed" | "interrupted" | "running" | "waiting_for_input", {}>;
3
3
  export type SessionStatus = typeof SessionStatus.infer;
4
- export type TemplateId = "default" | "skill_editor" | "ship_attack";
5
- export type SkillEditorTemplateId = "skill_editor";
6
4
  export type ModeId = "planning" | "executing";
7
5
  export type PublishedSolutionRef = {
8
6
  source: "builtin";
@@ -60,12 +58,12 @@ export declare const SessionInfo: import("arktype/internal/variants/object.ts").
60
58
  created_at: string;
61
59
  updated_at: string;
62
60
  shared?: boolean | undefined;
61
+ anonymous?: boolean | undefined;
63
62
  memory_enabled?: boolean | undefined;
64
63
  is_persistent?: boolean | undefined;
65
64
  initiator?: "sdk" | "ui" | "unknown" | null | undefined;
66
65
  is_headless?: boolean | undefined;
67
66
  viewer_role?: "owner" | "viewer" | undefined;
68
- template_id?: string | null | undefined;
69
67
  model?: string | null | undefined;
70
68
  enable_thinking?: boolean | null | undefined;
71
69
  solution_id?: string | null | undefined;
@@ -73,47 +71,36 @@ export declare const SessionInfo: import("arktype/internal/variants/object.ts").
73
71
  biz_role_id?: string | null | undefined;
74
72
  solution?: unknown;
75
73
  plan_summary?: string | null | undefined;
76
- primary_skill_id?: string | null | undefined;
77
- bound_skill_id?: string | null | undefined;
78
74
  replay_state?: unknown;
79
75
  is_pinned?: boolean | undefined;
80
76
  pinned_at?: string | null | undefined;
81
77
  is_example?: boolean | undefined;
82
78
  ports?: unknown;
83
79
  disable_tools?: string[] | undefined;
84
- runtime_type?: string | null | undefined;
85
- daemon_id?: string | null | undefined;
86
- agent_runtime_id?: string | null | undefined;
87
80
  workspace_path?: string | null | undefined;
88
81
  ba_version?: string | null | undefined;
89
82
  sandbox_version?: string | null | undefined;
90
83
  chat_group_id?: string | null | undefined;
91
84
  match?: unknown;
92
85
  }, {}>;
93
- export type SessionInfo = Omit<typeof SessionInfo.infer, "template_id" | "solution" | "ports" | "match"> & {
86
+ export type SessionInfo = Omit<typeof SessionInfo.infer, "solution" | "ports" | "match"> & {
94
87
  shared?: boolean;
95
88
  memory_enabled?: boolean;
96
89
  is_persistent?: boolean;
97
90
  is_headless?: boolean;
98
91
  viewer_role?: "owner" | "viewer";
99
- template_id?: TemplateId | null;
100
92
  model?: string | null;
101
93
  enable_thinking?: boolean | null;
102
94
  solution_id?: string | null;
103
95
  solution_ref?: PublishedSolutionRef | null;
104
96
  biz_role_id?: string | null;
105
97
  solution?: Solution | null;
106
- primary_skill_id?: string | null;
107
- bound_skill_id?: string | null;
108
98
  replay_state?: ReplayState | null;
109
99
  is_pinned?: boolean;
110
100
  pinned_at?: string | null;
111
101
  is_example?: boolean;
112
102
  ports?: SessionPortMapping[];
113
103
  disable_tools?: string[];
114
- runtime_type?: "sandbox" | "daemon" | "native" | string | null;
115
- daemon_id?: string | null;
116
- agent_runtime_id?: string | null;
117
104
  workspace_path?: string | null;
118
105
  ba_version?: string | null;
119
106
  sandbox_version?: string | null;
@@ -121,40 +108,7 @@ export type SessionInfo = Omit<typeof SessionInfo.infer, "template_id" | "soluti
121
108
  /** 仅在带 q 搜索的列表响应中出现;普通列表里此字段缺省。 */
122
109
  match?: SessionSearchMatch | null;
123
110
  };
124
- /**
125
- * 主 skill 配置快照(v2)。创建 session 时从 SKILL.md frontmatter 抽出并
126
- * 固化到 session_root/.blade/primary-skill.json;ship-attack 页面骨架的唯
127
- * 一数据源。
128
- */
129
- export interface PrimarySkillStepSpec {
130
- n: number;
131
- label: string;
132
- }
133
- export interface PrimarySkillStageSpec {
134
- id: string;
135
- name: string;
136
- steps: PrimarySkillStepSpec[];
137
- }
138
- export interface PrimarySkillParallelMode {
139
- id: string;
140
- name: string;
141
- prompt_hint: string;
142
- }
143
- export interface PrimarySkillSnapshot {
144
- version: number;
145
- skill_id: string;
146
- title: string;
147
- description: string;
148
- stages: PrimarySkillStageSpec[];
149
- parallel_modes: PrimarySkillParallelMode[];
150
- captured_at: string;
151
- }
152
- /**
153
- * 单 session detail(GET /api/sessions/:id)。列表接口返回 SessionInfo,
154
- * detail 在此基础上附加 primary_skill_snapshot。
155
- */
156
111
  export interface SessionDetail extends SessionInfo {
157
- primary_skill_snapshot?: PrimarySkillSnapshot | null;
158
112
  preview_url?: string | null;
159
113
  /**
160
114
  * 会话级环境变量(owner-only)。后端仅在 GET detail 和 PUT /env 响应中返回,
@@ -0,0 +1,2 @@
1
+ export declare function syncServerTime(client: object, timestamp: unknown, receivedAt?: number): void;
2
+ export declare function getServerTime(client: object | null, now?: number): number | null;