@chatu-ai/builder-sdk 0.8.2 → 0.8.4

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/client.d.ts CHANGED
@@ -127,6 +127,10 @@ export interface SandboxMeta {
127
127
  createdAt?: string | null;
128
128
  lastActivity?: string | null;
129
129
  lastAgentActivity?: string | null;
130
+ /** 空闲多久自动休眠(秒,按机型) */
131
+ idleTtlSeconds?: number;
132
+ /** 预计自动休眠时间(最近活跃 + TTL);生成中不会被回收,仅为预计值 */
133
+ hibernateAt?: string | null;
130
134
  hasSnapshot?: boolean;
131
135
  snapshotKey?: string | null;
132
136
  };
@@ -153,6 +157,28 @@ export interface SandboxMeta {
153
157
  };
154
158
  } | null;
155
159
  }
160
+ /** 沙箱启动进度:step 0 调度 1 网络 2 拉镜像 3 启动容器 4 健康检查 5 就绪 */
161
+ export interface SandboxStartup {
162
+ ok: boolean;
163
+ state?: string;
164
+ exists?: boolean;
165
+ phase?: string | null;
166
+ ready?: boolean;
167
+ containerState?: string | null;
168
+ startedAt?: string | null;
169
+ elapsedMs?: number;
170
+ step?: number;
171
+ percent?: number;
172
+ etaSeconds?: number;
173
+ detail?: string | null;
174
+ events?: Array<{
175
+ type: string;
176
+ reason: string;
177
+ message: string;
178
+ time?: string | null;
179
+ count?: number;
180
+ }>;
181
+ }
156
182
  export type FunctionProvider = 'aliyun-fc' | 'tencent-scf' | 'volc-vefaas';
157
183
  /** 函数计算部署(技术方案 17):凭据二选一 credentialId(凭据库 aliyun/tencent/volcengine)或 accessKeyId+accessKeySecret */
158
184
  export interface FunctionDeployInput {
@@ -290,6 +316,8 @@ export interface BuilderClient {
290
316
  }>;
291
317
  /** 沙箱诊断信息:编排侧(状态/Pod/机型/时间/快照)+ runtime(版本/Node/Skills/CLI)+ 平台配置镜像 */
292
318
  meta(conversationId: string): Promise<SandboxMeta>;
319
+ /** 启动进度(Pod 事件推导):沙箱创建/恢复期间轮询展示 */
320
+ startup(conversationId: string): Promise<SandboxStartup>;
293
321
  };
294
322
  versions: {
295
323
  list(conversationId: string, opts?: {
package/dist/client.js CHANGED
@@ -64,6 +64,7 @@ export function createBuilderClient(options) {
64
64
  hibernate: id => req(`/sandbox/${id}/hibernate`, { method: 'POST' }),
65
65
  terminate: id => req(`/sandbox/${id}/terminate`, { method: 'POST' }),
66
66
  meta: id => req(`/sandbox/${id}/meta`),
67
+ startup: id => req(`/sandbox/${id}/startup`),
67
68
  },
68
69
  versions: {
69
70
  // 服务端形状:{ versions: VersionInfo[] }(runtime 透传)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",