@chatu-ai/builder-sdk 0.6.1 → 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 +2 -0
- package/dist/client.js +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -165,9 +165,11 @@ export interface BuilderClient {
|
|
|
165
165
|
restore(conversationId: string, sha: string): Promise<void>;
|
|
166
166
|
};
|
|
167
167
|
files: {
|
|
168
|
+
/** 文件树:默认只返回 path 的直接子项(depth=0),按需逐层展开;depth 最多 3 */
|
|
168
169
|
tree(conversationId: string, opts?: {
|
|
169
170
|
path?: string;
|
|
170
171
|
ref?: string;
|
|
172
|
+
depth?: number;
|
|
171
173
|
}): Promise<FileNode[]>;
|
|
172
174
|
read(conversationId: string, path: string, opts?: {
|
|
173
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 })}`),
|