@chatu-ai/builder-sdk 0.8.3 → 0.8.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 +27 -0
- package/dist/client.js +1 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -157,6 +157,31 @@ export interface SandboxMeta {
|
|
|
157
157
|
};
|
|
158
158
|
} | null;
|
|
159
159
|
}
|
|
160
|
+
/** 沙箱启动进度:step 0 调度 1 网络 2 拉镜像 3 启动容器 4 配置环境 5 恢复数据 6 启动应用 7 就绪 */
|
|
161
|
+
export interface SandboxStartup {
|
|
162
|
+
ok: boolean;
|
|
163
|
+
state?: string;
|
|
164
|
+
exists?: boolean;
|
|
165
|
+
phase?: string | null;
|
|
166
|
+
ready?: boolean;
|
|
167
|
+
containerState?: string | null;
|
|
168
|
+
/** 编排阶段(Pod Running 之后):assigning | restoring | starting-devserver | ready | failed */
|
|
169
|
+
orchestrationPhase?: string | null;
|
|
170
|
+
phaseMessage?: string | null;
|
|
171
|
+
startedAt?: string | null;
|
|
172
|
+
elapsedMs?: number;
|
|
173
|
+
step?: number;
|
|
174
|
+
percent?: number;
|
|
175
|
+
etaSeconds?: number;
|
|
176
|
+
detail?: string | null;
|
|
177
|
+
events?: Array<{
|
|
178
|
+
type: string;
|
|
179
|
+
reason: string;
|
|
180
|
+
message: string;
|
|
181
|
+
time?: string | null;
|
|
182
|
+
count?: number;
|
|
183
|
+
}>;
|
|
184
|
+
}
|
|
160
185
|
export type FunctionProvider = 'aliyun-fc' | 'tencent-scf' | 'volc-vefaas';
|
|
161
186
|
/** 函数计算部署(技术方案 17):凭据二选一 credentialId(凭据库 aliyun/tencent/volcengine)或 accessKeyId+accessKeySecret */
|
|
162
187
|
export interface FunctionDeployInput {
|
|
@@ -294,6 +319,8 @@ export interface BuilderClient {
|
|
|
294
319
|
}>;
|
|
295
320
|
/** 沙箱诊断信息:编排侧(状态/Pod/机型/时间/快照)+ runtime(版本/Node/Skills/CLI)+ 平台配置镜像 */
|
|
296
321
|
meta(conversationId: string): Promise<SandboxMeta>;
|
|
322
|
+
/** 启动进度(Pod 事件推导):沙箱创建/恢复期间轮询展示 */
|
|
323
|
+
startup(conversationId: string): Promise<SandboxStartup>;
|
|
297
324
|
};
|
|
298
325
|
versions: {
|
|
299
326
|
list(conversationId: string, opts?: {
|
package/dist/client.js
CHANGED
|
@@ -64,6 +64,7 @@ export function createBuilderClient(options) {
|
|
|
64
64
|
hibernate: id => req(`/sandbox/${id}/hibernate`, { method: 'POST' }),
|
|
65
65
|
terminate: id => req(`/sandbox/${id}/terminate`, { method: 'POST' }),
|
|
66
66
|
meta: id => req(`/sandbox/${id}/meta`),
|
|
67
|
+
startup: id => req(`/sandbox/${id}/startup`),
|
|
67
68
|
},
|
|
68
69
|
versions: {
|
|
69
70
|
// 服务端形状:{ versions: VersionInfo[] }(runtime 透传)
|