@chatu-ai/builder-sdk 0.9.3 → 0.9.4

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
@@ -252,6 +252,23 @@ export type GitPushStreamEvent = {
252
252
  type: 'result';
253
253
  result: GitPushResult;
254
254
  };
255
+ /** 沙箱终端:一次一条命令的执行结果 */
256
+ export interface ExecResult {
257
+ ok: boolean;
258
+ code?: number | null;
259
+ signal?: string | null;
260
+ truncated?: boolean;
261
+ durationMs?: number;
262
+ error?: string | null;
263
+ message?: string | null;
264
+ }
265
+ export type ExecStreamEvent = {
266
+ type: 'log';
267
+ line: string;
268
+ } | {
269
+ type: 'result';
270
+ result: ExecResult;
271
+ };
255
272
  export interface DeployInput {
256
273
  provider: 'edgeone';
257
274
  projectName: string;
@@ -401,6 +418,11 @@ export interface BuilderClient {
401
418
  signal?: AbortSignal;
402
419
  }): AsyncIterable<FunctionDeployStreamEvent>;
403
420
  };
421
+ /** 沙箱终端(001/09 P2-A):执行一条命令并流式回输出;AI 生成中会被拒绝(409) */
422
+ exec(conversationId: string, command: string, opts?: {
423
+ timeoutMs?: number;
424
+ signal?: AbortSignal;
425
+ }): AsyncIterable<ExecStreamEvent>;
404
426
  /** 平台数据能力接入信息(技术方案 15):线上部署所需环境变量;apiKey 为服务端密钥 */
405
427
  data: {
406
428
  access(conversationId: string): Promise<{
package/dist/client.js CHANGED
@@ -103,6 +103,7 @@ export function createBuilderClient(options) {
103
103
  deployFunctionStream: (id, input, o) => readNamedSse(`${restBase}/${id}/export/deploy-function/stream`, auth.apply({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'text/event-stream' }, body: JSON.stringify(input), signal: o?.signal }), doFetch),
104
104
  deployStream: (id, input, o) => readNamedSse(`${restBase}/${id}/export/deploy/stream`, auth.apply({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'text/event-stream' }, body: JSON.stringify(input), signal: o?.signal }), doFetch),
105
105
  },
106
+ exec: (id, command, o) => readNamedSse(`${restBase}/${id}/exec/stream`, auth.apply({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'text/event-stream' }, body: JSON.stringify({ command, timeoutMs: o?.timeoutMs }), signal: o?.signal }), doFetch),
106
107
  data: {
107
108
  access: id => req(`/${id}/data-access`),
108
109
  usage: id => req(`/${id}/data-usage`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",