@chatu-ai/builder-sdk 0.7.4 → 0.7.5
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 +14 -0
- package/dist/client.js +1 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ export interface SandboxStatus {
|
|
|
39
39
|
startingForMs?: number | null;
|
|
40
40
|
lastError?: string | null;
|
|
41
41
|
} | null;
|
|
42
|
+
/** runtime 内是否仍有生成在跑(上一轮连接中断后后台继续):xid 可用于取消 */
|
|
43
|
+
agent?: {
|
|
44
|
+
executing: boolean;
|
|
45
|
+
xid?: string | null;
|
|
46
|
+
sinceMs?: number | null;
|
|
47
|
+
} | null;
|
|
42
48
|
}
|
|
43
49
|
export interface VersionInfo {
|
|
44
50
|
sha: string;
|
|
@@ -183,6 +189,14 @@ export interface BuilderClient {
|
|
|
183
189
|
revokeShare(conversationId: string, token: string): Promise<{
|
|
184
190
|
ok: boolean;
|
|
185
191
|
}>;
|
|
192
|
+
/** 重启 dev server(clean=true 先清 .next/.turbo 构建缓存);服务端立即返回,就绪状态用 status().devServer.ready 轮询 */
|
|
193
|
+
restartDevServer(conversationId: string, opts?: {
|
|
194
|
+
clean?: boolean;
|
|
195
|
+
}): Promise<{
|
|
196
|
+
ok: boolean;
|
|
197
|
+
ready?: boolean;
|
|
198
|
+
cleaned?: boolean;
|
|
199
|
+
}>;
|
|
186
200
|
};
|
|
187
201
|
versions: {
|
|
188
202
|
list(conversationId: string, opts?: {
|
package/dist/client.js
CHANGED
|
@@ -60,6 +60,7 @@ export function createBuilderClient(options) {
|
|
|
60
60
|
wake: id => req(`/sandbox/${id}/wake`, { method: 'POST' }),
|
|
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
|
+
restartDevServer: (id, opts) => req(`/${id}/devserver/restart?clean=${opts?.clean ? 'true' : 'false'}`, { method: 'POST' }),
|
|
63
64
|
},
|
|
64
65
|
versions: {
|
|
65
66
|
// 服务端形状:{ versions: VersionInfo[] }(runtime 透传)
|