@chatu-ai/builder-sdk 0.6.3 → 0.7.1

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
@@ -157,6 +157,15 @@ export interface BuilderClient {
157
157
  }>;
158
158
  /** 唤醒/确保沙箱(休眠 → 恢复快照 → 起 dev server;不发起 agent 会话) */
159
159
  wake(conversationId: string): Promise<SandboxStatus>;
160
+ /** 生成预览分享链接(非所有者可看;沙箱需在运行);默认 24h,最长 7 天 */
161
+ share(conversationId: string, ttlHours?: number): Promise<{
162
+ url: string;
163
+ token: string;
164
+ expiresAt: string;
165
+ }>;
166
+ revokeShare(conversationId: string, token: string): Promise<{
167
+ ok: boolean;
168
+ }>;
160
169
  };
161
170
  versions: {
162
171
  list(conversationId: string, opts?: {
package/dist/client.js CHANGED
@@ -58,6 +58,8 @@ export function createBuilderClient(options) {
58
58
  }),
59
59
  previewToken: id => req(`/${id}/preview-token`),
60
60
  wake: id => req(`/sandbox/${id}/wake`, { method: 'POST' }),
61
+ share: (id, ttlHours) => req(`/${id}/preview-share`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ ttlHours }) }),
62
+ revokeShare: (id, token) => req(`/${id}/preview-share/revoke`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ token }) }),
61
63
  },
62
64
  versions: {
63
65
  // 服务端形状:{ versions: VersionInfo[] }(runtime 透传)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.6.3",
3
+ "version": "0.7.1",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",