@chatu-ai/builder-sdk 0.4.0 → 0.5.0

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
@@ -207,6 +207,41 @@ export interface BuilderClient {
207
207
  }>;
208
208
  /** 本月用量:dev/prod 原始计量与折算点数估算、只读状态、单价 */
209
209
  usage(conversationId: string): Promise<DataUsage>;
210
+ /** 复制命名空间(默认 dev→prod) */
211
+ promote(conversationId: string, input?: {
212
+ from?: 'dev' | 'prod';
213
+ to?: 'dev' | 'prod';
214
+ overwrite?: boolean;
215
+ kv?: boolean;
216
+ storage?: boolean;
217
+ }): Promise<{
218
+ ok: boolean;
219
+ error?: string;
220
+ kv?: {
221
+ copied: number;
222
+ skipped: number;
223
+ } | null;
224
+ storage?: {
225
+ copied: number;
226
+ skipped: number;
227
+ bytes: number;
228
+ } | null;
229
+ }>;
230
+ /** 导出数据:KV 键值 + 对象清单(1 小时下载地址) */
231
+ export(conversationId: string, env?: 'dev' | 'prod'): Promise<{
232
+ ok: boolean;
233
+ env: string;
234
+ kv: Array<{
235
+ key: string;
236
+ value: unknown;
237
+ ttl?: number | null;
238
+ }>;
239
+ storage: Array<{
240
+ key: string;
241
+ size: number;
242
+ url?: string | null;
243
+ }>;
244
+ }>;
210
245
  };
211
246
  export: {
212
247
  /**
package/dist/client.js CHANGED
@@ -90,6 +90,8 @@ export function createBuilderClient(options) {
90
90
  data: {
91
91
  access: id => req(`/${id}/data-access`),
92
92
  usage: id => req(`/${id}/data-usage`),
93
+ promote: (id, input) => req(`/${id}/data/promote`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(input ?? {}) }),
94
+ export: (id, env) => req(`/${id}/data/export?env=${env ?? 'prod'}`),
93
95
  },
94
96
  export: {
95
97
  zip: async (id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",