@chatu-ai/builder-sdk 0.7.5 → 0.7.7

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
@@ -142,6 +142,8 @@ export interface DeployInput {
142
142
  env?: 'production' | 'preview';
143
143
  includeAppEnv?: boolean;
144
144
  includeDataAccess?: boolean;
145
+ /** 线上数据驱动:platform(默认,平台托管 Data API)| edgeone(EdgeOne Pages Blob,写 CHATU_DATA_DRIVER=edgeone) */
146
+ dataDriver?: 'platform' | 'edgeone';
145
147
  }
146
148
  export interface DeployResult {
147
149
  ok: boolean;
@@ -197,6 +199,17 @@ export interface BuilderClient {
197
199
  ready?: boolean;
198
200
  cleaned?: boolean;
199
201
  }>;
202
+ /** 休眠:保存快照后关闭 Pod(下次进入/发消息自动唤醒) */
203
+ hibernate(conversationId: string): Promise<{
204
+ ok: boolean;
205
+ state?: string;
206
+ skipped?: boolean;
207
+ }>;
208
+ /** 强制关闭 Pod:不做新快照,立即删除(沙箱卡死时用;保留已有快照) */
209
+ terminate(conversationId: string): Promise<{
210
+ ok: boolean;
211
+ state?: string;
212
+ }>;
200
213
  };
201
214
  versions: {
202
215
  list(conversationId: string, opts?: {
package/dist/client.js CHANGED
@@ -61,6 +61,8 @@ export function createBuilderClient(options) {
61
61
  share: (id, ttlHours) => req(`/${id}/preview-share`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ ttlHours }) }),
62
62
  revokeShare: (id, token) => req(`/${id}/preview-share/revoke`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ token }) }),
63
63
  restartDevServer: (id, opts) => req(`/${id}/devserver/restart?clean=${opts?.clean ? 'true' : 'false'}`, { method: 'POST' }),
64
+ hibernate: id => req(`/sandbox/${id}/hibernate`, { method: 'POST' }),
65
+ terminate: id => req(`/sandbox/${id}/terminate`, { method: 'POST' }),
64
66
  },
65
67
  versions: {
66
68
  // 服务端形状:{ versions: VersionInfo[] }(runtime 透传)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",