@chatu-ai/builder-sdk 0.6.0 → 0.6.2

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
@@ -32,10 +32,13 @@ export interface BuilderClientOptions {
32
32
  export interface SandboxStatus {
33
33
  state: SandboxState;
34
34
  previewUrl?: string;
35
+ /** dev server:running 且 !ready = 首屏编译中(1c 机型冷启动可能 1–2 分钟) */
35
36
  devServer?: {
36
37
  running: boolean;
37
- lastError?: string;
38
- };
38
+ ready?: boolean;
39
+ startingForMs?: number | null;
40
+ lastError?: string | null;
41
+ } | null;
39
42
  }
40
43
  export interface VersionInfo {
41
44
  sha: string;
@@ -162,9 +165,11 @@ export interface BuilderClient {
162
165
  restore(conversationId: string, sha: string): Promise<void>;
163
166
  };
164
167
  files: {
168
+ /** 文件树:默认只返回 path 的直接子项(depth=0),按需逐层展开;depth 最多 3 */
165
169
  tree(conversationId: string, opts?: {
166
170
  path?: string;
167
171
  ref?: string;
172
+ depth?: number;
168
173
  }): Promise<FileNode[]>;
169
174
  read(conversationId: string, path: string, opts?: {
170
175
  ref?: string;
package/dist/client.js CHANGED
@@ -70,7 +70,7 @@ export function createBuilderClient(options) {
70
70
  files: {
71
71
  // 服务端形状:{ tree: FileNode[] }
72
72
  tree: async (id, opts) => {
73
- const r = await req(`/${id}/files?${qs(opts)}`);
73
+ const r = await req(`/${id}/files?${qs({ path: opts?.path, ref: opts?.ref, depth: opts?.depth })}`);
74
74
  return Array.isArray(r) ? r : (r.tree ?? []);
75
75
  },
76
76
  read: (id, path, opts) => req(`/${id}/files/read?${qs({ path, ...opts })}`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",