@chatu-ai/builder-sdk 0.8.1 → 0.8.3

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
@@ -116,6 +116,47 @@ export interface DataUsage {
116
116
  rates?: Record<string, number>;
117
117
  error?: string;
118
118
  }
119
+ /** 沙箱诊断信息(技术方案 08):用于判断 Pod 是否已使用最新镜像、是否加载了预期能力 */
120
+ export interface SandboxMeta {
121
+ ok: boolean;
122
+ sandbox?: {
123
+ sandboxId?: string;
124
+ state?: string;
125
+ podName?: string | null;
126
+ machineType?: string | null;
127
+ createdAt?: string | null;
128
+ lastActivity?: string | null;
129
+ lastAgentActivity?: string | null;
130
+ /** 空闲多久自动休眠(秒,按机型) */
131
+ idleTtlSeconds?: number;
132
+ /** 预计自动休眠时间(最近活跃 + TTL);生成中不会被回收,仅为预计值 */
133
+ hibernateAt?: string | null;
134
+ hasSnapshot?: boolean;
135
+ snapshotKey?: string | null;
136
+ };
137
+ /** 平台当前配置的 Builder 镜像(与 runtime.version 对照可判断 Pod 是否为最新) */
138
+ configuredImage?: string | null;
139
+ runtime?: {
140
+ ok?: boolean;
141
+ error?: string;
142
+ message?: string;
143
+ version?: string | null;
144
+ image?: string | null;
145
+ node?: string;
146
+ startedAt?: string;
147
+ uptimeMs?: number;
148
+ workspaceDir?: string;
149
+ appSdkVersion?: string | null;
150
+ skills?: string[];
151
+ clis?: Record<string, string | null>;
152
+ devServer?: Record<string, unknown>;
153
+ agent?: {
154
+ executing?: boolean;
155
+ xid?: string | null;
156
+ sinceMs?: number | null;
157
+ };
158
+ } | null;
159
+ }
119
160
  export type FunctionProvider = 'aliyun-fc' | 'tencent-scf' | 'volc-vefaas';
120
161
  /** 函数计算部署(技术方案 17):凭据二选一 credentialId(凭据库 aliyun/tencent/volcengine)或 accessKeyId+accessKeySecret */
121
162
  export interface FunctionDeployInput {
@@ -251,6 +292,8 @@ export interface BuilderClient {
251
292
  ok: boolean;
252
293
  state?: string;
253
294
  }>;
295
+ /** 沙箱诊断信息:编排侧(状态/Pod/机型/时间/快照)+ runtime(版本/Node/Skills/CLI)+ 平台配置镜像 */
296
+ meta(conversationId: string): Promise<SandboxMeta>;
254
297
  };
255
298
  versions: {
256
299
  list(conversationId: string, opts?: {
package/dist/client.js CHANGED
@@ -63,6 +63,7 @@ export function createBuilderClient(options) {
63
63
  restartDevServer: (id, opts) => req(`/${id}/devserver/restart?clean=${opts?.clean ? 'true' : 'false'}`, { method: 'POST' }),
64
64
  hibernate: id => req(`/sandbox/${id}/hibernate`, { method: 'POST' }),
65
65
  terminate: id => req(`/sandbox/${id}/terminate`, { method: 'POST' }),
66
+ meta: id => req(`/sandbox/${id}/meta`),
66
67
  },
67
68
  versions: {
68
69
  // 服务端形状:{ versions: VersionInfo[] }(runtime 透传)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",