@chatu-ai/builder-sdk-mock 0.9.5 → 0.9.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/index.js +3 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -49,6 +49,8 @@ export function createMockBuilderClient(script) {
|
|
|
49
49
|
status: async () => status,
|
|
50
50
|
heartbeat: async () => { },
|
|
51
51
|
previewToken: async () => ({ token: 'mock-token', previewUrl: `${status.previewUrl ?? ''}/?t=mock-token` }),
|
|
52
|
+
snapshots: async () => ({ ok: true, snapshots: [{ key: 'sbx-1/1700000000000.tar.gz', bytes: 1024 * 512, createdAt: Date.now() - 3600_000 }] }),
|
|
53
|
+
restoreSnapshot: async (_id, key) => ({ ok: true, key }),
|
|
52
54
|
wake: async () => { status = { ...status, state: 'ready' }; return status; },
|
|
53
55
|
share: async () => ({ url: 'https://sbx-mock.test/?s=mock', token: 'mock', expiresAt: new Date(Date.now() + 86400000).toISOString() }),
|
|
54
56
|
revokeShare: async () => ({ ok: true }),
|
|
@@ -108,6 +110,7 @@ export function createMockBuilderClient(script) {
|
|
|
108
110
|
yield { type: 'result', result: { ok: true, remoteUrl: input.remoteUrl, branch: input.branch ?? 'main', sha: 'deadbeefcafe', output: 'mock push ok', webUrl: input.remoteUrl.replace(/\.git$/, '') } };
|
|
109
111
|
},
|
|
110
112
|
},
|
|
113
|
+
runMessage: async (_id, _xid, seq) => ({ ok: true, message: { sequenceNumber: seq, content: 'mock full tool result' } }),
|
|
111
114
|
exec: async function* (_id, command) {
|
|
112
115
|
yield { type: 'log', line: `$ ${command}` };
|
|
113
116
|
yield { type: 'log', line: 'mock output' };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatu-ai/builder-sdk-mock",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "Mock BuilderClient for @chatu-ai/builder-sdk: scripted event replay with latency & disconnect injection",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"node": ">=18"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@chatu-ai/builder-sdk": "0.9.
|
|
44
|
+
"@chatu-ai/builder-sdk": "0.9.7"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"typescript": "^5.7.0",
|