@chatu-ai/builder-sdk 0.8.5 → 0.8.7

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
@@ -45,6 +45,11 @@ export interface SandboxStatus {
45
45
  xid?: string | null;
46
46
  sinceMs?: number | null;
47
47
  } | null;
48
+ /** 关闭过程中(休眠/强制关闭,Pod 尚未真正释放):此时不应唤醒,前端显示"关闭中" */
49
+ closing?: boolean;
50
+ /** 编排阶段:creating-pod|assigning|restoring|starting-devserver|ready|hibernating|releasing|terminating|hibernated|recycled|failed */
51
+ phase?: string | null;
52
+ phaseMessage?: string | null;
48
53
  }
49
54
  export interface VersionInfo {
50
55
  sha: string;
@@ -539,9 +544,17 @@ export interface BuilderClient {
539
544
  }>;
540
545
  };
541
546
  logs: {
542
- /** dev server 最近日志(沙箱未运行返回空) */
543
- tail(conversationId: string, lines?: number): Promise<{
547
+ /**
548
+ * dev server 日志(沙箱未运行时读落盘快照)。
549
+ * 传 `since`(上次返回的 nextSeq)只取新增行;`truncated=true` 表示需整体替换(首次/缓冲区已滚动/来自快照)。
550
+ */
551
+ tail(conversationId: string, lines?: number, opts?: {
552
+ since?: number | null;
553
+ }): Promise<{
544
554
  lines: string[];
555
+ nextSeq?: number | null;
556
+ truncated?: boolean;
557
+ source?: string;
545
558
  }>;
546
559
  };
547
560
  export: {
package/dist/client.js CHANGED
@@ -129,9 +129,13 @@ export function createBuilderClient(options) {
129
129
  export: (id, env) => req(`/${id}/data/export?env=${env ?? 'prod'}`),
130
130
  },
131
131
  logs: {
132
- tail: async (id, lines) => {
133
- const r = await req(`/${id}/logs?tail=${lines ?? 200}`);
134
- return { lines: Array.isArray(r) ? r : (r.lines ?? []) };
132
+ tail: async (id, lines, opts) => {
133
+ const since = opts?.since;
134
+ const q = `tail=${lines ?? 200}${since === undefined || since === null ? '' : `&since=${since}`}`;
135
+ const r = await req(`/${id}/logs?${q}`);
136
+ if (Array.isArray(r))
137
+ return { lines: r, truncated: true };
138
+ return { lines: r.lines ?? [], nextSeq: r.nextSeq ?? null, truncated: r.truncated ?? since === undefined, source: r.source };
135
139
  },
136
140
  },
137
141
  export: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",