@chatu-ai/builder-sdk 0.8.5 → 0.8.6

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
@@ -539,9 +539,17 @@ export interface BuilderClient {
539
539
  }>;
540
540
  };
541
541
  logs: {
542
- /** dev server 最近日志(沙箱未运行返回空) */
543
- tail(conversationId: string, lines?: number): Promise<{
542
+ /**
543
+ * dev server 日志(沙箱未运行时读落盘快照)。
544
+ * 传 `since`(上次返回的 nextSeq)只取新增行;`truncated=true` 表示需整体替换(首次/缓冲区已滚动/来自快照)。
545
+ */
546
+ tail(conversationId: string, lines?: number, opts?: {
547
+ since?: number | null;
548
+ }): Promise<{
544
549
  lines: string[];
550
+ nextSeq?: number | null;
551
+ truncated?: boolean;
552
+ source?: string;
545
553
  }>;
546
554
  };
547
555
  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.6",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",