@tangle-network/sandbox 0.2.1 → 0.4.0
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/LICENSE +11 -0
- package/README.md +71 -0
- package/dist/agent/index.d.ts +433 -0
- package/dist/agent/index.js +1 -0
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -271
- package/dist/client-CygjzF3v.js +1 -0
- package/dist/{errors-BI75IXOM.d.ts → client-DM2pIli7.d.ts} +2 -129
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -2
- package/dist/collaboration-CRyb5e8F.js +1 -201
- package/dist/core.d.ts +3 -2
- package/dist/core.js +1 -4
- package/dist/errors-1Se5ATyZ.d.ts +128 -0
- package/dist/errors-CljiGR__.js +1 -262
- package/dist/{index-DhNGZ0h4.d.ts → index-CTj81tF9.d.ts} +1 -1
- package/dist/index.d.ts +256 -7
- package/dist/index.js +1 -825
- package/dist/openai/index.d.ts +21 -6
- package/dist/openai/index.js +1 -1721
- package/dist/{sandbox-aBpWqler.d.ts → sandbox-CBmfYqMQ.d.ts} +291 -117
- package/dist/sandbox-DTup2jzz.js +1 -0
- package/dist/session-gateway/index.js +1 -667
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -2
- package/dist/tangle-CnYnTRi6.js +1 -0
- package/package.json +50 -78
- package/dist/client-Uve6A5C6.js +0 -2280
- package/dist/platform-integrations.d.ts +0 -2
- package/dist/platform-integrations.js +0 -2
- package/dist/sandbox-ksXTNlo-.js +0 -3394
- package/dist/tangle-DQ05paN7.js +0 -826
- /package/dist/{index-Dpj1oB5i.d.ts → index-D-2pH_70.d.ts} +0 -0
- /package/dist/{index-CCsA3S0D.d.ts → index-D7bwmNs8.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "../index-
|
|
1
|
+
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "../index-D7bwmNs8.js";
|
|
2
2
|
export { CollaborationBootstrapRequest, CollaborationBootstrapResponse, CollaborationClient, CollaborationClientConfig, CollaborationDocumentAdapter, CollaborationDocumentChange, CollaborationDocumentRef, CollaborationFileBridge, CollaborationFileBridgeOptions, CollaborationFileEvent, CollaborationPermissions, CollaborationTokenRefreshRequest, CollaborationTokenRefreshResponse, CollaborationTransportConfig, SaveCollaborationSnapshotRequest, SaveCollaborationSnapshotResponse, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
1
|
+
(function(_0x221cdb,_0x56921d){var _0x8cc704=a0_0x23d9,_0xa822c=_0x221cdb();while(!![]){try{var _0x2e16c2=parseInt(_0x8cc704(0x1b4))/0x1+-parseInt(_0x8cc704(0x1b8))/0x2+parseInt(_0x8cc704(0x1b1))/0x3+-parseInt(_0x8cc704(0x1b5))/0x4+parseInt(_0x8cc704(0x1b3))/0x5*(-parseInt(_0x8cc704(0x1b7))/0x6)+parseInt(_0x8cc704(0x1b2))/0x7*(-parseInt(_0x8cc704(0x1b0))/0x8)+-parseInt(_0x8cc704(0x1b9))/0x9*(-parseInt(_0x8cc704(0x1b6))/0xa);if(_0x2e16c2===_0x56921d)break;else _0xa822c['push'](_0xa822c['shift']());}catch(_0x18355c){_0xa822c['push'](_0xa822c['shift']());}}}(a0_0xb3b2,0xbb102));function a0_0x23d9(_0x3e7424,_0x78af7d){_0x3e7424=_0x3e7424-0x1b0;var _0xb3b2da=a0_0xb3b2();var _0x23d919=_0xb3b2da[_0x3e7424];if(a0_0x23d9['\x41\x4b\x73\x69\x63\x6f']===undefined){var _0x594410=function(_0x3c8579){var _0x213dbe='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';var _0x3d7e2b='',_0x3a28e9='';for(var _0x46a29c=0x0,_0x27e81d,_0x354957,_0x4698bb=0x0;_0x354957=_0x3c8579['\x63\x68\x61\x72\x41\x74'](_0x4698bb++);~_0x354957&&(_0x27e81d=_0x46a29c%0x4?_0x27e81d*0x40+_0x354957:_0x354957,_0x46a29c++%0x4)?_0x3d7e2b+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x27e81d>>(-0x2*_0x46a29c&0x6)):0x0){_0x354957=_0x213dbe['\x69\x6e\x64\x65\x78\x4f\x66'](_0x354957);}for(var _0x557516=0x0,_0x2859c5=_0x3d7e2b['\x6c\x65\x6e\x67\x74\x68'];_0x557516<_0x2859c5;_0x557516++){_0x3a28e9+='\x25'+('\x30\x30'+_0x3d7e2b['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x557516)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x3a28e9);};a0_0x23d9['\x79\x67\x6d\x65\x44\x6d']=_0x594410,a0_0x23d9['\x6c\x77\x51\x57\x45\x4a']={},a0_0x23d9['\x41\x4b\x73\x69\x63\x6f']=!![];}var _0x388e21=_0xb3b2da[0x0],_0x1b1768=_0x3e7424+_0x388e21,_0x5073ab=a0_0x23d9['\x6c\x77\x51\x57\x45\x4a'][_0x1b1768];return!_0x5073ab?(_0x23d919=a0_0x23d9['\x79\x67\x6d\x65\x44\x6d'](_0x23d919),a0_0x23d9['\x6c\x77\x51\x57\x45\x4a'][_0x1b1768]=_0x23d919):_0x23d919=_0x5073ab,_0x23d919;}function a0_0xb3b2(){var _0x74fd35=['\x6d\x4a\x4b\x35\x6d\x74\x66\x64\x41\x32\x50\x54\x44\x33\x75','\x6e\x5a\x62\x4f\x7a\x76\x72\x67\x74\x77\x6d','\x6d\x74\x69\x58\x6d\x5a\x4b\x57\x6e\x32\x6a\x30\x79\x32\x35\x48\x45\x47','\x6e\x64\x65\x59\x6e\x64\x47\x34\x6d\x67\x6a\x53\x75\x66\x72\x6c\x72\x71','\x6d\x74\x65\x57\x79\x33\x7a\x68\x45\x77\x4c\x62','\x6d\x74\x69\x30\x6d\x74\x4b\x30\x74\x31\x4c\x4d\x75\x4e\x72\x31','\x6e\x64\x43\x58\x6e\x4a\x47\x57\x76\x78\x44\x36\x76\x33\x72\x4a','\x6f\x74\x47\x59\x6d\x4a\x79\x35\x73\x77\x66\x75\x76\x4c\x6e\x73','\x6d\x4a\x43\x59\x6f\x65\x6a\x58\x71\x76\x50\x74\x44\x61','\x6e\x64\x61\x35\x6e\x5a\x61\x33\x6d\x32\x31\x73\x42\x31\x4c\x79\x73\x47'];a0_0xb3b2=function(){return _0x74fd35;};return a0_0xb3b2();}import{a as a0_0x3d7e2b,i as a0_0x3a28e9,n as a0_0x46a29c,r as a0_0x27e81d,t as a0_0x354957}from'\x2e\x2e\x2f\x63\x6f\x6c\x6c\x61\x62\x6f\x72\x61\x74\x69\x6f\x6e\x2d\x43\x52\x79\x62\x35\x65\x38\x46\x2e\x6a\x73';export{a0_0x3d7e2b as CollaborationClient,a0_0x354957 as CollaborationFileBridge,a0_0x46a29c as buildCollaborationDocumentId,a0_0x27e81d as normalizeCollaborationPath,a0_0x3a28e9 as parseCollaborationDocumentId};
|
|
@@ -1,201 +1 @@
|
|
|
1
|
-
import { f as parseErrorResponse, r as NetworkError, u as TimeoutError } from "./errors-CljiGR__.js";
|
|
2
|
-
//#region src/collaboration/client.ts
|
|
3
|
-
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
4
|
-
function normalizeBaseUrl(url) {
|
|
5
|
-
return url.replace(/\/+$/, "");
|
|
6
|
-
}
|
|
7
|
-
var CollaborationClient = class {
|
|
8
|
-
baseUrl;
|
|
9
|
-
timeoutMs;
|
|
10
|
-
fetchImpl;
|
|
11
|
-
headers;
|
|
12
|
-
constructor(config) {
|
|
13
|
-
this.baseUrl = normalizeBaseUrl(config.baseUrl);
|
|
14
|
-
this.timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
15
|
-
this.fetchImpl = config.fetch ?? globalThis.fetch.bind(globalThis);
|
|
16
|
-
this.headers = config.headers;
|
|
17
|
-
}
|
|
18
|
-
async bootstrap(request) {
|
|
19
|
-
return this.requestJson("/api/collaboration/bootstrap", {
|
|
20
|
-
method: "POST",
|
|
21
|
-
body: JSON.stringify(request)
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
async refreshToken(request) {
|
|
25
|
-
return this.requestJson("/api/collaboration/token", {
|
|
26
|
-
method: "POST",
|
|
27
|
-
body: JSON.stringify(request)
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
async saveSnapshot(request) {
|
|
31
|
-
return this.requestJson("/api/collaboration/snapshot", {
|
|
32
|
-
method: "POST",
|
|
33
|
-
body: JSON.stringify(request)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
async requestJson(path, init) {
|
|
37
|
-
const controller = new AbortController();
|
|
38
|
-
const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
39
|
-
try {
|
|
40
|
-
const headers = new Headers(await this.resolveHeaders());
|
|
41
|
-
if (!headers.has("Content-Type")) headers.set("Content-Type", "application/json");
|
|
42
|
-
const response = await this.fetchImpl(`${this.baseUrl}${path}`, {
|
|
43
|
-
...init,
|
|
44
|
-
headers,
|
|
45
|
-
signal: init.signal ?? controller.signal
|
|
46
|
-
});
|
|
47
|
-
if (!response.ok) {
|
|
48
|
-
const body = await response.text();
|
|
49
|
-
throw parseErrorResponse(response.status, body, {
|
|
50
|
-
method: init.method,
|
|
51
|
-
path
|
|
52
|
-
}, response.headers);
|
|
53
|
-
}
|
|
54
|
-
return response.json();
|
|
55
|
-
} catch (error) {
|
|
56
|
-
if (error instanceof Error && error.name === "AbortError") throw new TimeoutError(this.timeoutMs);
|
|
57
|
-
if (error instanceof Error && "code" in error) throw error;
|
|
58
|
-
throw new NetworkError(`Failed to connect to collaboration API: ${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? error : void 0);
|
|
59
|
-
} finally {
|
|
60
|
-
clearTimeout(timeoutId);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
async resolveHeaders() {
|
|
64
|
-
if (typeof this.headers === "function") return this.headers();
|
|
65
|
-
return this.headers;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/collaboration/document-id.ts
|
|
70
|
-
const DOCUMENT_PREFIX = "workspace:";
|
|
71
|
-
const FILE_SEGMENT = ":file:";
|
|
72
|
-
function assertValidWorkspaceId(workspaceId) {
|
|
73
|
-
if (!workspaceId) throw new Error("workspaceId is required");
|
|
74
|
-
if (workspaceId.includes("/") || workspaceId.includes("\\") || workspaceId.includes("\0")) throw new Error("workspaceId must not contain path separators or null bytes");
|
|
75
|
-
}
|
|
76
|
-
function normalizeCollaborationPath(path) {
|
|
77
|
-
if (!path) throw new Error("relativePath is required");
|
|
78
|
-
const normalized = path.replace(/\\/g, "/").split("/").filter((segment) => segment.length > 0 && segment !== ".");
|
|
79
|
-
if (normalized.length === 0) throw new Error("relativePath must not be empty");
|
|
80
|
-
for (const segment of normalized) {
|
|
81
|
-
if (segment === "..") throw new Error("relativePath must not contain \"..\"");
|
|
82
|
-
if (segment.includes("\0")) throw new Error("relativePath must not contain null bytes");
|
|
83
|
-
}
|
|
84
|
-
return normalized.join("/");
|
|
85
|
-
}
|
|
86
|
-
function buildCollaborationDocumentId(ref) {
|
|
87
|
-
assertValidWorkspaceId(ref.workspaceId);
|
|
88
|
-
const relativePath = normalizeCollaborationPath(ref.relativePath);
|
|
89
|
-
return `${DOCUMENT_PREFIX}${ref.workspaceId}${FILE_SEGMENT}${relativePath}`;
|
|
90
|
-
}
|
|
91
|
-
function parseCollaborationDocumentId(documentId) {
|
|
92
|
-
if (!documentId.startsWith(DOCUMENT_PREFIX)) return null;
|
|
93
|
-
const separatorIndex = documentId.indexOf(FILE_SEGMENT, 10);
|
|
94
|
-
if (separatorIndex === -1) return null;
|
|
95
|
-
const workspaceId = documentId.slice(10, separatorIndex);
|
|
96
|
-
const relativePath = documentId.slice(separatorIndex + 6);
|
|
97
|
-
try {
|
|
98
|
-
assertValidWorkspaceId(workspaceId);
|
|
99
|
-
return {
|
|
100
|
-
workspaceId,
|
|
101
|
-
relativePath: normalizeCollaborationPath(relativePath)
|
|
102
|
-
};
|
|
103
|
-
} catch {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/collaboration/file-bridge.ts
|
|
109
|
-
const DEFAULT_DEBOUNCE_MS = 500;
|
|
110
|
-
const FILE_ORIGIN = "bridge:file";
|
|
111
|
-
/**
|
|
112
|
-
* Headless bridge between a collaborative document adapter and the sandbox
|
|
113
|
-
* filesystem. Keeps this package free of direct Yjs assumptions.
|
|
114
|
-
*/
|
|
115
|
-
var CollaborationFileBridge = class {
|
|
116
|
-
debounceMs;
|
|
117
|
-
options;
|
|
118
|
-
adapter = null;
|
|
119
|
-
unsubscribeDocument = null;
|
|
120
|
-
unsubscribeFileEvents = null;
|
|
121
|
-
pendingWriteTimer = null;
|
|
122
|
-
destroyed = false;
|
|
123
|
-
boundPath;
|
|
124
|
-
lastWrittenContent = null;
|
|
125
|
-
constructor(options) {
|
|
126
|
-
this.options = options;
|
|
127
|
-
this.boundPath = options.relativePath;
|
|
128
|
-
this.debounceMs = options.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
129
|
-
}
|
|
130
|
-
bind(adapter) {
|
|
131
|
-
this.destroy();
|
|
132
|
-
this.destroyed = false;
|
|
133
|
-
this.adapter = adapter;
|
|
134
|
-
this.boundPath = this.options.relativePath;
|
|
135
|
-
this.unsubscribeDocument = adapter.subscribe((change) => {
|
|
136
|
-
if (change.origin === FILE_ORIGIN) return;
|
|
137
|
-
if (this.lastWrittenContent !== null && change.content === this.lastWrittenContent) return;
|
|
138
|
-
this.scheduleWrite(change.content);
|
|
139
|
-
});
|
|
140
|
-
this.unsubscribeFileEvents = this.options.subscribeToFileEvents(this.boundPath, (event) => {
|
|
141
|
-
this.handleFileEvent(event);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
async flush() {
|
|
145
|
-
if (!this.adapter) return;
|
|
146
|
-
if (this.pendingWriteTimer) {
|
|
147
|
-
clearTimeout(this.pendingWriteTimer);
|
|
148
|
-
this.pendingWriteTimer = null;
|
|
149
|
-
}
|
|
150
|
-
const content = this.adapter.getContent();
|
|
151
|
-
await this.write(content);
|
|
152
|
-
}
|
|
153
|
-
getPath() {
|
|
154
|
-
return this.boundPath;
|
|
155
|
-
}
|
|
156
|
-
destroy() {
|
|
157
|
-
this.destroyed = true;
|
|
158
|
-
if (this.pendingWriteTimer) {
|
|
159
|
-
clearTimeout(this.pendingWriteTimer);
|
|
160
|
-
this.pendingWriteTimer = null;
|
|
161
|
-
}
|
|
162
|
-
this.unsubscribeDocument?.();
|
|
163
|
-
this.unsubscribeDocument = null;
|
|
164
|
-
this.unsubscribeFileEvents?.();
|
|
165
|
-
this.unsubscribeFileEvents = null;
|
|
166
|
-
this.adapter = null;
|
|
167
|
-
}
|
|
168
|
-
scheduleWrite(content) {
|
|
169
|
-
if (this.pendingWriteTimer) clearTimeout(this.pendingWriteTimer);
|
|
170
|
-
this.pendingWriteTimer = setTimeout(() => {
|
|
171
|
-
this.pendingWriteTimer = null;
|
|
172
|
-
this.write(content);
|
|
173
|
-
}, this.debounceMs);
|
|
174
|
-
}
|
|
175
|
-
async write(content) {
|
|
176
|
-
if (this.destroyed) return;
|
|
177
|
-
this.lastWrittenContent = content;
|
|
178
|
-
await this.options.writeFile(this.boundPath, content);
|
|
179
|
-
}
|
|
180
|
-
handleFileEvent(event) {
|
|
181
|
-
if (!this.adapter || this.destroyed) return;
|
|
182
|
-
if (event.type === "renamed" && event.nextPath) {
|
|
183
|
-
this.boundPath = event.nextPath;
|
|
184
|
-
this.options.onFileRenamed?.(event);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (event.type === "deleted") {
|
|
188
|
-
this.options.onFileDeleted?.(event);
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (event.type !== "updated" || typeof event.content !== "string") return;
|
|
192
|
-
if (event.content === this.adapter.getContent()) return;
|
|
193
|
-
if (this.lastWrittenContent !== null && event.content === this.lastWrittenContent) return;
|
|
194
|
-
this.adapter.replaceContent(event.content, {
|
|
195
|
-
origin: FILE_ORIGIN,
|
|
196
|
-
version: event.version
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
//#endregion
|
|
201
|
-
export { CollaborationClient as a, parseCollaborationDocumentId as i, buildCollaborationDocumentId as n, normalizeCollaborationPath as r, CollaborationFileBridge as t };
|
|
1
|
+
const a0_0x479a5e=a0_0x388a;function a0_0x2b8c(){const _0x4656f1=['\x44\x32\x39\x59\x41\x33\x6e\x57\x79\x77\x6e\x4c\x73\x77\x71\x47\x42\x78\x76\x5a\x44\x63\x62\x55\x42\x33\x71\x47\x79\x32\x39\x55\x44\x67\x66\x50\x42\x49\x62\x57\x79\x78\x72\x4f\x69\x68\x6e\x4c\x43\x67\x66\x59\x79\x78\x72\x56\x43\x4e\x6d\x47\x42\x33\x69\x47\x42\x4e\x76\x53\x42\x63\x62\x49\x45\x78\x72\x4c\x43\x57','\x74\x75\x72\x49\x79\x76\x65','\x42\x67\x66\x5a\x44\x66\x44\x59\x41\x78\x72\x30\x7a\x77\x35\x64\x42\x32\x35\x30\x7a\x77\x35\x30','\x79\x77\x6a\x56\x43\x4e\x71','\x43\x4b\x6a\x48\x72\x31\x4b','\x43\x33\x72\x59\x41\x77\x35\x4e','\x75\x65\x39\x74\x76\x61','\x7a\x4d\x4c\x53\x44\x67\x76\x59','\x44\x67\x4c\x54\x7a\x77\x39\x31\x44\x65\x31\x5a','\x71\x32\x39\x55\x44\x67\x76\x55\x44\x63\x31\x75\x45\x78\x62\x4c','\x44\x65\x39\x4c\x72\x30\x71','\x43\x33\x76\x49\x43\x32\x6e\x59\x41\x77\x6a\x4c','\x43\x33\x76\x49\x43\x32\x6e\x59\x41\x77\x6a\x4c\x76\x67\x39\x67\x41\x77\x58\x4c\x72\x78\x7a\x4c\x42\x4e\x72\x5a','\x41\x77\x35\x4a\x42\x68\x76\x4b\x7a\x78\x6d','\x79\x32\x39\x55\x44\x67\x76\x55\x44\x61','\x41\x67\x76\x48\x7a\x67\x76\x59\x43\x57','\x6f\x4d\x7a\x50\x42\x67\x75\x36','\x44\x67\x76\x34\x44\x61','\x79\x4e\x6a\x50\x7a\x67\x44\x4c\x6f\x4d\x7a\x50\x42\x67\x75','\x43\x67\x76\x55\x7a\x67\x4c\x55\x7a\x31\x44\x59\x41\x78\x72\x4c\x76\x67\x4c\x54\x7a\x78\x69','\x6c\x32\x66\x57\x41\x73\x39\x4a\x42\x32\x58\x53\x79\x77\x6a\x56\x43\x4d\x66\x30\x41\x77\x39\x55\x6c\x33\x6e\x55\x79\x78\x62\x5a\x41\x67\x39\x30','\x6d\x74\x6d\x32\x6f\x64\x6d\x34\x6f\x68\x6e\x58\x76\x4c\x6e\x59\x77\x47','\x6d\x74\x79\x32\x6d\x74\x4b\x32\x6e\x75\x50\x79\x73\x76\x44\x66\x76\x57','\x6c\x32\x66\x57\x41\x73\x39\x4a\x42\x32\x58\x53\x79\x77\x6a\x56\x43\x4d\x66\x30\x41\x77\x39\x55\x6c\x33\x72\x56\x41\x32\x76\x55','\x79\x4d\x66\x5a\x7a\x76\x76\x59\x42\x61','\x43\x4d\x76\x57\x42\x67\x66\x4a\x7a\x75\x6e\x56\x42\x4e\x72\x4c\x42\x4e\x71','\x43\x32\x76\x30','\x7a\x67\x76\x5a\x44\x68\x6a\x56\x45\x71','\x43\x33\x72\x48\x44\x68\x76\x5a','\x41\x67\x66\x55\x7a\x67\x58\x4c\x72\x4d\x4c\x53\x7a\x75\x76\x32\x7a\x77\x35\x30','\x43\x32\x66\x32\x7a\x76\x6e\x55\x79\x78\x62\x5a\x41\x67\x39\x30','\x44\x78\x62\x4b\x79\x78\x72\x4c\x7a\x61','\x42\x33\x62\x30\x41\x77\x39\x55\x43\x57','\x73\x75\x31\x78\x75\x66\x75','\x42\x75\x58\x56\x44\x78\x4f','\x71\x77\x6a\x56\x43\x4e\x72\x66\x43\x4e\x6a\x56\x43\x47','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x71\x79\x78\x72\x4f','\x75\x4e\x72\x71\x73\x30\x79','\x45\x4c\x62\x64\x71\x4b\x38','\x43\x32\x58\x50\x79\x32\x75','\x43\x32\x4c\x4e\x42\x4d\x66\x53','\x43\x33\x62\x53\x41\x78\x71','\x44\x33\x6a\x50\x44\x67\x75','\x41\x4b\x72\x4d\x77\x67\x6d','\x7a\x4d\x58\x31\x43\x32\x47','\x44\x4d\x76\x59\x43\x32\x4c\x56\x42\x47','\x7a\x4d\x76\x30\x79\x32\x48\x6a\x42\x78\x62\x53','\x7a\x4d\x76\x30\x79\x32\x47','\x7a\x67\x76\x49\x42\x33\x76\x55\x79\x32\x76\x6e\x43\x57','\x41\x4e\x6e\x56\x42\x47','\x42\x33\x6a\x50\x7a\x32\x4c\x55','\x7a\x67\x76\x53\x7a\x78\x72\x4c\x7a\x61','\x72\x4d\x66\x50\x42\x67\x76\x4b\x69\x68\x72\x56\x69\x67\x6e\x56\x42\x4d\x35\x4c\x79\x33\x71\x47\x44\x67\x38\x47\x79\x32\x39\x53\x42\x67\x66\x49\x42\x33\x6a\x48\x44\x67\x4c\x56\x42\x49\x62\x62\x75\x65\x4b\x36\x69\x61','\x43\x4d\x76\x57\x42\x67\x66\x4a\x7a\x71','\x44\x77\x35\x5a\x44\x77\x6a\x5a\x79\x33\x6a\x50\x79\x4d\x76\x65\x42\x32\x6e\x31\x42\x77\x76\x55\x44\x61','\x6f\x67\x50\x49\x7a\x30\x58\x4e\x41\x57','\x41\x4d\x39\x50\x42\x47','\x6d\x4a\x6d\x30\x73\x4c\x48\x6e\x75\x4c\x50\x6c','\x74\x75\x31\x6e\x72\x30\x53','\x44\x32\x39\x59\x41\x33\x6e\x57\x79\x77\x6e\x4c\x6f\x47','\x7a\x32\x76\x30\x75\x67\x66\x30\x41\x61','\x6d\x4a\x43\x57\x6d\x74\x69\x30\x6d\x74\x62\x63\x7a\x32\x66\x41\x7a\x4b\x4b','\x73\x4c\x72\x77\x43\x4d\x6d','\x43\x4d\x76\x4d\x43\x4d\x76\x5a\x41\x66\x72\x56\x41\x32\x76\x55','\x7a\x32\x76\x30\x71\x32\x39\x55\x44\x67\x76\x55\x44\x61','\x6e\x74\x6d\x5a\x6e\x5a\x79\x32\x76\x78\x62\x34\x44\x68\x72\x4a','\x6d\x5a\x43\x57\x6d\x64\x75\x31\x6e\x65\x39\x59\x41\x75\x72\x59\x73\x71','\x42\x32\x35\x67\x41\x77\x58\x4c\x75\x4d\x76\x55\x79\x77\x31\x4c\x7a\x61','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x71\x79\x78\x72\x4f\x69\x67\x31\x31\x43\x33\x71\x47\x42\x4d\x39\x30\x69\x67\x6e\x56\x42\x4e\x72\x48\x41\x77\x34\x47\x42\x4e\x76\x53\x42\x63\x62\x49\x45\x78\x72\x4c\x43\x57','\x44\x77\x35\x5a\x44\x77\x6a\x5a\x79\x33\x6a\x50\x79\x4d\x76\x67\x41\x77\x58\x4c\x72\x78\x7a\x4c\x42\x4e\x72\x5a','\x44\x68\x4c\x57\x7a\x71','\x6e\x4a\x79\x35\x6e\x74\x71\x59\x76\x75\x48\x48\x41\x77\x72\x66','\x43\x4d\x6e\x76\x76\x66\x6d','\x79\x77\x72\x48\x43\x68\x72\x4c\x43\x47','\x6d\x74\x65\x35\x6e\x74\x79\x34\x76\x33\x44\x6a\x76\x4d\x39\x49','\x44\x33\x6a\x50\x44\x67\x76\x67\x41\x77\x58\x4c','\x43\x4d\x76\x55\x79\x77\x31\x4c\x7a\x61','\x79\x4d\x39\x31\x42\x4d\x72\x71\x79\x78\x72\x4f','\x42\x65\x39\x65\x74\x65\x71','\x43\x32\x6e\x4f\x7a\x77\x72\x31\x42\x67\x76\x78\x43\x4d\x4c\x30\x7a\x71','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x71\x79\x78\x72\x4f\x69\x67\x31\x31\x43\x33\x71\x47\x42\x4d\x39\x30\x69\x67\x6a\x4c\x69\x67\x76\x54\x43\x68\x72\x35','\x43\x33\x72\x48\x43\x4e\x72\x5a\x76\x32\x4c\x30\x41\x61','\x43\x4d\x76\x5a\x42\x32\x58\x32\x7a\x75\x48\x4c\x79\x77\x72\x4c\x43\x4e\x6d','\x43\x4d\x76\x58\x44\x77\x76\x5a\x44\x65\x50\x5a\x42\x32\x34','\x43\x33\x72\x59\x41\x77\x35\x4e\x41\x77\x7a\x35','\x42\x4d\x76\x34\x44\x66\x62\x48\x44\x67\x47','\x7a\x67\x76\x5a\x44\x68\x6a\x56\x45\x77\x76\x4b','\x6d\x74\x66\x79\x45\x78\x48\x31\x76\x30\x53','\x6d\x4d\x72\x4d\x79\x4d\x39\x41\x7a\x57','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x71\x79\x78\x72\x4f\x69\x67\x31\x31\x43\x33\x71\x47\x42\x4d\x39\x30\x69\x67\x6e\x56\x42\x4e\x72\x48\x41\x77\x34\x47\x69\x49\x34\x55\x69\x47','\x42\x77\x76\x30\x41\x67\x39\x4b','\x41\x67\x66\x5a'];a0_0x2b8c=function(){return _0x4656f1;};return a0_0x2b8c();}(function(_0x4e94de,_0x299c84){const _0x3c1f76=a0_0x388a,_0x5c340d=_0x4e94de();while(!![]){try{const _0x1f75c4=parseInt(_0x3c1f76(0x18f))/0x1*(-parseInt(_0x3c1f76(0x1da))/0x2)+parseInt(_0x3c1f76(0x1d4))/0x3+-parseInt(_0x3c1f76(0x1ca))/0x4*(parseInt(_0x3c1f76(0x1a9))/0x5)+-parseInt(_0x3c1f76(0x1d5))/0x6+-parseInt(_0x3c1f76(0x1a8))/0x7+parseInt(_0x3c1f76(0x1dd))/0x8*(-parseInt(_0x3c1f76(0x1cc))/0x9)+parseInt(_0x3c1f76(0x1d0))/0xa*(parseInt(_0x3c1f76(0x18e))/0xb);if(_0x1f75c4===_0x299c84)break;else _0x5c340d['push'](_0x5c340d['shift']());}catch(_0x3a17d5){_0x5c340d['push'](_0x5c340d['shift']());}}}(a0_0x2b8c,0x53fbc));import{f as a0_0x345d9c,r as a0_0x549773,u as a0_0x510c37}from'\x2e\x2f\x65\x72\x72\x6f\x72\x73\x2d\x43\x6c\x6a\x69\x47\x52\x5f\x5f\x2e\x6a\x73';const DEFAULT_TIMEOUT_MS=0x7530;function normalizeBaseUrl(_0x221655){const _0x40bae3=a0_0x388a;return _0x221655[_0x40bae3(0x1c8)](/\/+$/,'');}var CollaborationClient=class{[a0_0x479a5e(0x1ab)];[a0_0x479a5e(0x19b)];[a0_0x479a5e(0x1c1)];[a0_0x479a5e(0x1a2)];constructor(_0x103f8f){const _0x4af24d=a0_0x479a5e;this['\x62\x61\x73\x65\x55\x72\x6c']=normalizeBaseUrl(_0x103f8f[_0x4af24d(0x1ab)]),this[_0x4af24d(0x19b)]=_0x103f8f[_0x4af24d(0x19b)]??DEFAULT_TIMEOUT_MS,this[_0x4af24d(0x1c1)]=_0x103f8f[_0x4af24d(0x1c2)]??globalThis[_0x4af24d(0x1c2)]['\x62\x69\x6e\x64'](globalThis),this[_0x4af24d(0x1a2)]=_0x103f8f['\x68\x65\x61\x64\x65\x72\x73'];}async['\x62\x6f\x6f\x74\x73\x74\x72\x61\x70'](_0x34633f){const _0x3909b1=a0_0x479a5e,_0x223b82={'\x4d\x63\x55\x4e\x4b':'\x2f\x61\x70\x69\x2f\x63\x6f\x6c\x6c\x61\x62\x6f\x72\x61\x74\x69\x6f\x6e\x2f\x62\x6f\x6f\x74\x73\x74\x72\x61\x70','\x57\x48\x6e\x78\x59':_0x3909b1(0x199)};return this[_0x3909b1(0x1e6)](_0x223b82['\x4d\x63\x55\x4e\x4b'],{'\x6d\x65\x74\x68\x6f\x64':_0x223b82['\x57\x48\x6e\x78\x59'],'\x62\x6f\x64\x79':JSON[_0x3909b1(0x1e7)](_0x34633f)});}async[a0_0x479a5e(0x1d2)](_0x2ef7ae){const _0x28c6af=a0_0x479a5e,_0x446c75={'\x53\x45\x79\x48\x44':_0x28c6af(0x1aa),'\x4a\x54\x56\x72\x63':_0x28c6af(0x199)};return this[_0x28c6af(0x1e6)](_0x446c75['\x53\x45\x79\x48\x44'],{'\x6d\x65\x74\x68\x6f\x64':_0x446c75[_0x28c6af(0x1d1)],'\x62\x6f\x64\x79':JSON[_0x28c6af(0x1e7)](_0x2ef7ae)});}async[a0_0x479a5e(0x1b1)](_0x5986a2){const _0x3ce9c1=a0_0x479a5e;return this['\x72\x65\x71\x75\x65\x73\x74\x4a\x73\x6f\x6e'](_0x3ce9c1(0x1a7),{'\x6d\x65\x74\x68\x6f\x64':_0x3ce9c1(0x199),'\x62\x6f\x64\x79':JSON[_0x3ce9c1(0x1e7)](_0x5986a2)});}async[a0_0x479a5e(0x1e6)](_0xe13578,_0x25aebd){const _0x3f0628=a0_0x479a5e,_0x4d7936={'\x6a\x44\x66\x58\x63':'\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e','\x49\x4d\x57\x50\x55':function(_0x5c5e57,_0x114faa){return _0x5c5e57===_0x114faa;},'\x48\x52\x6d\x61\x4f':function(_0x36bab6,_0x2775fe){return _0x36bab6 instanceof _0x2775fe;},'\x7a\x50\x43\x42\x4f':'\x63\x6f\x64\x65','\x4d\x4d\x4d\x47\x4b':function(_0x4d27c5,_0xfef8d7){return _0x4d27c5 instanceof _0xfef8d7;},'\x4d\x44\x62\x61\x51':function(_0x1d006b,_0x29776f){return _0x1d006b(_0x29776f);}},_0xf3c312=new AbortController(),_0x140b3b=setTimeout(()=>_0xf3c312[_0x3f0628(0x196)](),this[_0x3f0628(0x19b)]);try{const _0x49c384=new Headers(await this['\x72\x65\x73\x6f\x6c\x76\x65\x48\x65\x61\x64\x65\x72\x73']());if(!_0x49c384[_0x3f0628(0x192)](_0x3f0628(0x19c)))_0x49c384[_0x3f0628(0x1ad)]('\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65',_0x4d7936[_0x3f0628(0x1be)]);const _0x12fc09=await this[_0x3f0628(0x1c1)](''+this[_0x3f0628(0x1ab)]+_0xe13578,{..._0x25aebd,'\x68\x65\x61\x64\x65\x72\x73':_0x49c384,'\x73\x69\x67\x6e\x61\x6c':_0x25aebd[_0x3f0628(0x1bb)]??_0xf3c312[_0x3f0628(0x1bb)]});if(!_0x12fc09['\x6f\x6b']){const _0x2f26e0=await _0x12fc09[_0x3f0628(0x1a4)]();throw a0_0x345d9c(_0x12fc09[_0x3f0628(0x1af)],_0x2f26e0,{'\x6d\x65\x74\x68\x6f\x64':_0x25aebd[_0x3f0628(0x191)],'\x70\x61\x74\x68':_0xe13578},_0x12fc09['\x68\x65\x61\x64\x65\x72\x73']);}return _0x12fc09[_0x3f0628(0x1c4)]();}catch(_0x1928a7){if(_0x1928a7 instanceof Error&&_0x4d7936[_0x3f0628(0x1b4)](_0x1928a7['\x6e\x61\x6d\x65'],_0x3f0628(0x1b6)))throw new a0_0x510c37(this[_0x3f0628(0x19b)]);if(_0x4d7936['\x48\x52\x6d\x61\x4f'](_0x1928a7,Error)&&_0x4d7936[_0x3f0628(0x1b9)]in _0x1928a7)throw _0x1928a7;throw new a0_0x549773(_0x3f0628(0x1c7)+(_0x4d7936[_0x3f0628(0x1cd)](_0x1928a7,Error)?_0x1928a7['\x6d\x65\x73\x73\x61\x67\x65']:String(_0x1928a7)),_0x1928a7 instanceof Error?_0x1928a7:void 0x0);}finally{_0x4d7936[_0x3f0628(0x194)](clearTimeout,_0x140b3b);}}async[a0_0x479a5e(0x1e5)](){const _0x42eccb=a0_0x479a5e,_0x270e4c={'\x74\x4f\x65\x47\x44':function(_0x180a56,_0x48642a){return _0x180a56===_0x48642a;}};if(_0x270e4c[_0x42eccb(0x19d)](typeof this['\x68\x65\x61\x64\x65\x72\x73'],'\x66\x75\x6e\x63\x74\x69\x6f\x6e'))return this[_0x42eccb(0x1a2)]();return this['\x68\x65\x61\x64\x65\x72\x73'];}};const DOCUMENT_PREFIX=a0_0x479a5e(0x1ce),FILE_SEGMENT=a0_0x479a5e(0x1a3);function assertValidWorkspaceId(_0x57d4f2){const _0x6c5650=a0_0x479a5e;if(!_0x57d4f2)throw new Error('\x77\x6f\x72\x6b\x73\x70\x61\x63\x65\x49\x64\x20\x69\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64');if(_0x57d4f2[_0x6c5650(0x1a0)]('\x2f')||_0x57d4f2[_0x6c5650(0x1a0)]('\x5c')||_0x57d4f2[_0x6c5650(0x1a0)]('\x00'))throw new Error(_0x6c5650(0x193));}function normalizeCollaborationPath(_0x173d71){const _0x4cc326=a0_0x479a5e,_0x2b6f72={'\x6d\x4c\x6f\x75\x7a':function(_0x27c5a8,_0x2991a7){return _0x27c5a8===_0x2991a7;}};if(!_0x173d71)throw new Error('\x72\x65\x6c\x61\x74\x69\x76\x65\x50\x61\x74\x68\x20\x69\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64');const _0x49f47e=_0x173d71[_0x4cc326(0x1c8)](/\\/g,'\x2f')[_0x4cc326(0x1bc)]('\x2f')[_0x4cc326(0x19a)](_0x481c1a=>_0x481c1a['\x6c\x65\x6e\x67\x74\x68']>0x0&&_0x481c1a!=='\x2e');if(_0x49f47e['\x6c\x65\x6e\x67\x74\x68']===0x0)throw new Error(_0x4cc326(0x1e3));for(const _0x369de2 of _0x49f47e){if(_0x2b6f72[_0x4cc326(0x1b5)](_0x369de2,'\x2e\x2e'))throw new Error(_0x4cc326(0x190));if(_0x369de2[_0x4cc326(0x1a0)]('\x00'))throw new Error(_0x4cc326(0x1d7));}return _0x49f47e[_0x4cc326(0x1cb)]('\x2f');}function buildCollaborationDocumentId(_0x171096){const _0x15f787=a0_0x479a5e;assertValidWorkspaceId(_0x171096['\x77\x6f\x72\x6b\x73\x70\x61\x63\x65\x49\x64']);const _0x251728=normalizeCollaborationPath(_0x171096[_0x15f787(0x1b7)]);return''+DOCUMENT_PREFIX+_0x171096['\x77\x6f\x72\x6b\x73\x70\x61\x63\x65\x49\x64']+FILE_SEGMENT+_0x251728;}function parseCollaborationDocumentId(_0x4b318d){const _0x588972=a0_0x479a5e,_0x1e5343={'\x6c\x4f\x44\x4c\x44':function(_0xe4e50b,_0x1a49bd){return _0xe4e50b+_0x1a49bd;}};if(!_0x4b318d[_0x588972(0x1e4)](DOCUMENT_PREFIX))return null;const _0x17412f=_0x4b318d['\x69\x6e\x64\x65\x78\x4f\x66'](FILE_SEGMENT,0xa);if(_0x17412f===-0x1)return null;const _0x5326fd=_0x4b318d[_0x588972(0x1ba)](0xa,_0x17412f),_0x856c9c=_0x4b318d[_0x588972(0x1ba)](_0x1e5343[_0x588972(0x1e1)](_0x17412f,0x6));try{return assertValidWorkspaceId(_0x5326fd),{'\x77\x6f\x72\x6b\x73\x70\x61\x63\x65\x49\x64':_0x5326fd,'\x72\x65\x6c\x61\x74\x69\x76\x65\x50\x61\x74\x68':normalizeCollaborationPath(_0x856c9c)};}catch{return null;}}function a0_0x388a(_0x4dde41,_0xdbf2ee){_0x4dde41=_0x4dde41-0x18d;const _0x2b8ce6=a0_0x2b8c();let _0x388a26=_0x2b8ce6[_0x4dde41];if(a0_0x388a['\x42\x5a\x48\x74\x50\x4f']===undefined){var _0x478f4c=function(_0x48f1f0){const _0x2f2497='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x56636e='',_0x15ddb4='';for(let _0x1a4022=0x0,_0x1a4944,_0xd84754,_0x446bf6=0x0;_0xd84754=_0x48f1f0['\x63\x68\x61\x72\x41\x74'](_0x446bf6++);~_0xd84754&&(_0x1a4944=_0x1a4022%0x4?_0x1a4944*0x40+_0xd84754:_0xd84754,_0x1a4022++%0x4)?_0x56636e+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x1a4944>>(-0x2*_0x1a4022&0x6)):0x0){_0xd84754=_0x2f2497['\x69\x6e\x64\x65\x78\x4f\x66'](_0xd84754);}for(let _0xcff1ca=0x0,_0xe538db=_0x56636e['\x6c\x65\x6e\x67\x74\x68'];_0xcff1ca<_0xe538db;_0xcff1ca++){_0x15ddb4+='\x25'+('\x30\x30'+_0x56636e['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0xcff1ca)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x15ddb4);};a0_0x388a['\x4f\x5a\x45\x6a\x76\x44']=_0x478f4c,a0_0x388a['\x73\x4a\x7a\x6b\x46\x76']={},a0_0x388a['\x42\x5a\x48\x74\x50\x4f']=!![];}const _0x1d2595=_0x2b8ce6[0x0],_0x334ab7=_0x4dde41+_0x1d2595,_0x3854cf=a0_0x388a['\x73\x4a\x7a\x6b\x46\x76'][_0x334ab7];return!_0x3854cf?(_0x388a26=a0_0x388a['\x4f\x5a\x45\x6a\x76\x44'](_0x388a26),a0_0x388a['\x73\x4a\x7a\x6b\x46\x76'][_0x334ab7]=_0x388a26):_0x388a26=_0x3854cf,_0x388a26;}const DEFAULT_DEBOUNCE_MS=0x1f4,FILE_ORIGIN=a0_0x479a5e(0x1a5);var CollaborationFileBridge=class{['\x64\x65\x62\x6f\x75\x6e\x63\x65\x4d\x73'];['\x6f\x70\x74\x69\x6f\x6e\x73'];[a0_0x479a5e(0x1dc)]=null;[a0_0x479a5e(0x1c9)]=null;[a0_0x479a5e(0x1d8)]=null;['\x70\x65\x6e\x64\x69\x6e\x67\x57\x72\x69\x74\x65\x54\x69\x6d\x65\x72']=null;['\x64\x65\x73\x74\x72\x6f\x79\x65\x64']=![];[a0_0x479a5e(0x1e0)];[a0_0x479a5e(0x195)]=null;constructor(_0x243721){const _0x119200=a0_0x479a5e;this[_0x119200(0x1b3)]=_0x243721,this[_0x119200(0x1e0)]=_0x243721[_0x119200(0x1b7)],this[_0x119200(0x1c3)]=_0x243721[_0x119200(0x1c3)]??DEFAULT_DEBOUNCE_MS;}['\x62\x69\x6e\x64'](_0x546f72){const _0x5f5940=a0_0x479a5e,_0x1a0cae={'\x58\x67\x47\x6b\x63':function(_0x397249,_0xfdbed3){return _0x397249!==_0xfdbed3;}};this['\x64\x65\x73\x74\x72\x6f\x79'](),this[_0x5f5940(0x18d)]=![],this[_0x5f5940(0x1dc)]=_0x546f72,this[_0x5f5940(0x1e0)]=this[_0x5f5940(0x1b3)][_0x5f5940(0x1b7)],this[_0x5f5940(0x1c9)]=_0x546f72[_0x5f5940(0x19e)](_0x188158=>{const _0x490b4d=_0x5f5940;if(_0x188158[_0x490b4d(0x1c5)]===FILE_ORIGIN)return;if(_0x1a0cae['\x58\x67\x47\x6b\x63'](this['\x6c\x61\x73\x74\x57\x72\x69\x74\x74\x65\x6e\x43\x6f\x6e\x74\x65\x6e\x74'],null)&&_0x188158['\x63\x6f\x6e\x74\x65\x6e\x74']===this['\x6c\x61\x73\x74\x57\x72\x69\x74\x74\x65\x6e\x43\x6f\x6e\x74\x65\x6e\x74'])return;this[_0x490b4d(0x1e2)](_0x188158[_0x490b4d(0x1a1)]);}),this[_0x5f5940(0x1d8)]=this['\x6f\x70\x74\x69\x6f\x6e\x73'][_0x5f5940(0x19f)](this[_0x5f5940(0x1e0)],_0x450ac5=>{const _0x29c6df=_0x5f5940;this[_0x29c6df(0x1b0)](_0x450ac5);});}async[a0_0x479a5e(0x1bf)](){const _0x2c9141=a0_0x479a5e;if(!this['\x61\x64\x61\x70\x74\x65\x72'])return;this['\x70\x65\x6e\x64\x69\x6e\x67\x57\x72\x69\x74\x65\x54\x69\x6d\x65\x72']&&(clearTimeout(this[_0x2c9141(0x1a6)]),this[_0x2c9141(0x1a6)]=null);const _0x5c4f75=this[_0x2c9141(0x1dc)][_0x2c9141(0x1d3)]();await this[_0x2c9141(0x1bd)](_0x5c4f75);}[a0_0x479a5e(0x1cf)](){const _0x2bb990=a0_0x479a5e;return this[_0x2bb990(0x1e0)];}[a0_0x479a5e(0x1ae)](){const _0x553149=a0_0x479a5e,_0xb9b832={'\x52\x74\x50\x4b\x46':function(_0x4a7740,_0x5b855e){return _0x4a7740(_0x5b855e);}};this[_0x553149(0x18d)]=!![],this[_0x553149(0x1a6)]&&(_0xb9b832[_0x553149(0x1b8)](clearTimeout,this[_0x553149(0x1a6)]),this[_0x553149(0x1a6)]=null),this[_0x553149(0x1c9)]?.(),this[_0x553149(0x1c9)]=null,this['\x75\x6e\x73\x75\x62\x73\x63\x72\x69\x62\x65\x46\x69\x6c\x65\x45\x76\x65\x6e\x74\x73']?.(),this[_0x553149(0x1d8)]=null,this[_0x553149(0x1dc)]=null;}[a0_0x479a5e(0x1e2)](_0x3af024){const _0x2d7cfd=a0_0x479a5e;if(this[_0x2d7cfd(0x1a6)])clearTimeout(this[_0x2d7cfd(0x1a6)]);this['\x70\x65\x6e\x64\x69\x6e\x67\x57\x72\x69\x74\x65\x54\x69\x6d\x65\x72']=setTimeout(()=>{const _0x38e61b=_0x2d7cfd;this[_0x38e61b(0x1a6)]=null,this[_0x38e61b(0x1bd)](_0x3af024);},this['\x64\x65\x62\x6f\x75\x6e\x63\x65\x4d\x73']);}async[a0_0x479a5e(0x1bd)](_0x23a1e7){const _0x487321=a0_0x479a5e;if(this[_0x487321(0x18d)])return;this[_0x487321(0x195)]=_0x23a1e7,await this[_0x487321(0x1b3)][_0x487321(0x1de)](this[_0x487321(0x1e0)],_0x23a1e7);}[a0_0x479a5e(0x1b0)](_0x24823d){const _0x1377f3=a0_0x479a5e,_0x28e3f2={'\x72\x63\x55\x54\x53':function(_0x45e32d,_0xb967c7){return _0x45e32d===_0xb967c7;},'\x72\x42\x61\x47\x59':_0x1377f3(0x1df),'\x63\x42\x53\x69\x57':_0x1377f3(0x1b2)};if(!this[_0x1377f3(0x1dc)]||this['\x64\x65\x73\x74\x72\x6f\x79\x65\x64'])return;if(_0x28e3f2[_0x1377f3(0x1db)](_0x24823d[_0x1377f3(0x1d9)],_0x28e3f2[_0x1377f3(0x197)])&&_0x24823d[_0x1377f3(0x1e8)]){this['\x62\x6f\x75\x6e\x64\x50\x61\x74\x68']=_0x24823d['\x6e\x65\x78\x74\x50\x61\x74\x68'],this['\x6f\x70\x74\x69\x6f\x6e\x73'][_0x1377f3(0x1d6)]?.(_0x24823d);return;}if(_0x24823d[_0x1377f3(0x1d9)]===_0x1377f3(0x1c6)){this['\x6f\x70\x74\x69\x6f\x6e\x73']['\x6f\x6e\x46\x69\x6c\x65\x44\x65\x6c\x65\x74\x65\x64']?.(_0x24823d);return;}if(_0x24823d[_0x1377f3(0x1d9)]!==_0x28e3f2['\x63\x42\x53\x69\x57']||typeof _0x24823d['\x63\x6f\x6e\x74\x65\x6e\x74']!==_0x1377f3(0x198))return;if(_0x24823d[_0x1377f3(0x1a1)]===this['\x61\x64\x61\x70\x74\x65\x72']['\x67\x65\x74\x43\x6f\x6e\x74\x65\x6e\x74']())return;if(this[_0x1377f3(0x195)]!==null&&_0x24823d[_0x1377f3(0x1a1)]===this[_0x1377f3(0x195)])return;this[_0x1377f3(0x1dc)][_0x1377f3(0x1ac)](_0x24823d[_0x1377f3(0x1a1)],{'\x6f\x72\x69\x67\x69\x6e':FILE_ORIGIN,'\x76\x65\x72\x73\x69\x6f\x6e':_0x24823d[_0x1377f3(0x1c0)]});}};export{CollaborationClient as a,parseCollaborationDocumentId as i,buildCollaborationDocumentId as n,normalizeCollaborationPath as r,CollaborationFileBridge as t};
|
package/dist/core.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { G as CreateSandboxOptions, Gn as SandboxInfo, Ht as PreviewLinkManager, Lt as NetworkConfig, Vt as PreviewLinkInfo, Yn as SandboxStatus, mn as SandboxClientConfig, n as SandboxInstance, nt as ExecOptions, rt as ExecResult } from "./sandbox-CBmfYqMQ.js";
|
|
2
|
+
import { i as SandboxClient } from "./client-DM2pIli7.js";
|
|
3
|
+
import { a as PartialFailureError, c as SandboxErrorJson, d as StateError, f as TimeoutError, i as NotFoundError, l as SandboxFailureDetail, n as CapabilityError, o as QuotaError, p as ValidationError, r as NetworkError, s as SandboxError, t as AuthError, u as ServerError } from "./errors-1Se5ATyZ.js";
|
|
3
4
|
export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, QuotaError, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { t as SandboxInstance } from "./sandbox-ksXTNlo-.js";
|
|
3
|
-
import { n as SandboxClient } from "./client-Uve6A5C6.js";
|
|
4
|
-
export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError };
|
|
1
|
+
(function(_0x541160,_0x16c009){var _0x248798=a0_0x1ba3,_0x154475=_0x541160();while(!![]){try{var _0x5be4f5=-parseInt(_0x248798(0x13f))/0x1*(-parseInt(_0x248798(0x143))/0x2)+parseInt(_0x248798(0x142))/0x3+parseInt(_0x248798(0x141))/0x4+-parseInt(_0x248798(0x13e))/0x5*(-parseInt(_0x248798(0x145))/0x6)+parseInt(_0x248798(0x13c))/0x7+-parseInt(_0x248798(0x140))/0x8+parseInt(_0x248798(0x13d))/0x9*(-parseInt(_0x248798(0x144))/0xa);if(_0x5be4f5===_0x16c009)break;else _0x154475['push'](_0x154475['shift']());}catch(_0x4f5c75){_0x154475['push'](_0x154475['shift']());}}}(a0_0x5b9c,0x1f7d8));import{a as a0_0x216cda,c as a0_0x272c66,d as a0_0xcc9576,i as a0_0x5ba9f6,l as a0_0x9c7238,n as a0_0xe9238b,o as a0_0x18e8b0,r as a0_0x331a77,s as a0_0x5af79a,t as a0_0x1f92f3,u as a0_0x2095ef}from'\x2e\x2f\x65\x72\x72\x6f\x72\x73\x2d\x43\x6c\x6a\x69\x47\x52\x5f\x5f\x2e\x6a\x73';import{t as a0_0x197699}from'\x2e\x2f\x73\x61\x6e\x64\x62\x6f\x78\x2d\x44\x54\x75\x70\x32\x6a\x7a\x7a\x2e\x6a\x73';function a0_0x5b9c(){var _0x644f83=['\x6d\x74\x69\x34\x6d\x4a\x43\x30\x6e\x65\x4c\x32\x7a\x66\x7a\x4d\x7a\x47','\x6f\x74\x75\x32\x6e\x5a\x65\x32\x41\x78\x6e\x57\x72\x30\x54\x63','\x6d\x74\x75\x5a\x6d\x4a\x75\x34\x75\x4b\x50\x64\x41\x4c\x6a\x70','\x6d\x74\x47\x59\x6e\x67\x7a\x50\x71\x30\x58\x72\x77\x71','\x6d\x4a\x79\x32\x6d\x4a\x61\x5a\x6d\x66\x72\x35\x71\x77\x72\x73\x7a\x71','\x6d\x5a\x61\x30\x6d\x5a\x6d\x34\x72\x4e\x76\x34\x41\x66\x76\x4c','\x6d\x74\x61\x32\x6d\x74\x75\x5a\x6e\x4d\x39\x65\x45\x75\x31\x6a\x42\x57','\x6d\x74\x48\x53\x76\x32\x58\x53\x45\x78\x69','\x6d\x4a\x62\x64\x75\x65\x66\x71\x45\x4c\x79','\x6d\x74\x4b\x30\x44\x75\x48\x68\x75\x77\x48\x4d'];a0_0x5b9c=function(){return _0x644f83;};return a0_0x5b9c();}function a0_0x1ba3(_0x3486e0,_0x4a1507){_0x3486e0=_0x3486e0-0x13c;var _0x5b9c04=a0_0x5b9c();var _0x1ba3e5=_0x5b9c04[_0x3486e0];if(a0_0x1ba3['\x71\x4b\x41\x77\x56\x70']===undefined){var _0x493e39=function(_0x5f43c7){var _0x151cb4='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';var _0x216cda='',_0x272c66='';for(var _0xcc9576=0x0,_0x5ba9f6,_0x9c7238,_0xe9238b=0x0;_0x9c7238=_0x5f43c7['\x63\x68\x61\x72\x41\x74'](_0xe9238b++);~_0x9c7238&&(_0x5ba9f6=_0xcc9576%0x4?_0x5ba9f6*0x40+_0x9c7238:_0x9c7238,_0xcc9576++%0x4)?_0x216cda+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x5ba9f6>>(-0x2*_0xcc9576&0x6)):0x0){_0x9c7238=_0x151cb4['\x69\x6e\x64\x65\x78\x4f\x66'](_0x9c7238);}for(var _0x18e8b0=0x0,_0x331a77=_0x216cda['\x6c\x65\x6e\x67\x74\x68'];_0x18e8b0<_0x331a77;_0x18e8b0++){_0x272c66+='\x25'+('\x30\x30'+_0x216cda['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x18e8b0)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x272c66);};a0_0x1ba3['\x78\x4c\x6a\x77\x6f\x53']=_0x493e39,a0_0x1ba3['\x45\x62\x6b\x78\x62\x7a']={},a0_0x1ba3['\x71\x4b\x41\x77\x56\x70']=!![];}var _0x2d6fdb=_0x5b9c04[0x0],_0x217803=_0x3486e0+_0x2d6fdb,_0x40d499=a0_0x1ba3['\x45\x62\x6b\x78\x62\x7a'][_0x217803];return!_0x40d499?(_0x1ba3e5=a0_0x1ba3['\x78\x4c\x6a\x77\x6f\x53'](_0x1ba3e5),a0_0x1ba3['\x45\x62\x6b\x78\x62\x7a'][_0x217803]=_0x1ba3e5):_0x1ba3e5=_0x40d499,_0x1ba3e5;}import{n as a0_0x1dcb89}from'\x2e\x2f\x63\x6c\x69\x65\x6e\x74\x2d\x43\x79\x67\x6a\x7a\x46\x33\x76\x2e\x6a\x73';export{a0_0x1f92f3 as AuthError,a0_0xe9238b as CapabilityError,a0_0x331a77 as NetworkError,a0_0x5ba9f6 as NotFoundError,a0_0x216cda as PartialFailureError,a0_0x18e8b0 as QuotaError,a0_0x1dcb89 as Sandbox,a0_0x1dcb89 as SandboxClient,a0_0x5af79a as SandboxError,a0_0x197699 as SandboxInstance,a0_0x272c66 as ServerError,a0_0x9c7238 as StateError,a0_0x2095ef as TimeoutError,a0_0xcc9576 as ValidationError};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
//#region src/errors.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Sandbox SDK Errors
|
|
4
|
+
*
|
|
5
|
+
* Error classes for the Sandbox client SDK.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base error class for all Sandbox SDK errors.
|
|
9
|
+
*/
|
|
10
|
+
declare class SandboxError extends Error {
|
|
11
|
+
/** HTTP status code if applicable */
|
|
12
|
+
readonly status?: number;
|
|
13
|
+
/** Error code for programmatic handling */
|
|
14
|
+
readonly code: string;
|
|
15
|
+
/** Best-effort origin of the failing request */
|
|
16
|
+
readonly origin?: SandboxErrorOrigin;
|
|
17
|
+
/** Request path or endpoint when known */
|
|
18
|
+
readonly endpoint?: string;
|
|
19
|
+
/** Retry-after duration in ms when surfaced by the upstream */
|
|
20
|
+
readonly retryAfterMs?: number;
|
|
21
|
+
/** Sidecar version when the runtime emitted it */
|
|
22
|
+
readonly sidecarVersion?: string;
|
|
23
|
+
/** Sidecar image/tag/sha when the runtime emitted it */
|
|
24
|
+
readonly containerImage?: string;
|
|
25
|
+
constructor(message: string, code: string, status?: number, metadata?: SandboxErrorMetadata);
|
|
26
|
+
}
|
|
27
|
+
type SandboxErrorOrigin = "sidecar" | "sandbox-api" | "control-plane" | "runtime" | "unknown";
|
|
28
|
+
interface SandboxErrorMetadata {
|
|
29
|
+
origin?: SandboxErrorOrigin;
|
|
30
|
+
endpoint?: string;
|
|
31
|
+
retryAfterMs?: number;
|
|
32
|
+
sidecarVersion?: string;
|
|
33
|
+
containerImage?: string;
|
|
34
|
+
}
|
|
35
|
+
type SandboxErrorJson = string | number | boolean | null | {
|
|
36
|
+
[key: string]: SandboxErrorJson;
|
|
37
|
+
} | SandboxErrorJson[];
|
|
38
|
+
type SandboxFailureDetail = {
|
|
39
|
+
[key: string]: SandboxErrorJson;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Authentication failed or API key is invalid.
|
|
43
|
+
*/
|
|
44
|
+
declare class AuthError extends SandboxError {
|
|
45
|
+
constructor(message?: string, metadata?: SandboxErrorMetadata);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The requested resource was not found.
|
|
49
|
+
*/
|
|
50
|
+
declare class NotFoundError extends SandboxError {
|
|
51
|
+
/** The resource type that was not found */
|
|
52
|
+
readonly resourceType: string;
|
|
53
|
+
/** The resource ID that was not found */
|
|
54
|
+
readonly resourceId: string;
|
|
55
|
+
constructor(resourceType: string, resourceId: string, metadata?: SandboxErrorMetadata);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Account quota or rate limit exceeded.
|
|
59
|
+
*/
|
|
60
|
+
declare class QuotaError extends SandboxError {
|
|
61
|
+
/** The type of quota that was exceeded */
|
|
62
|
+
readonly quotaType: string;
|
|
63
|
+
/** Current usage */
|
|
64
|
+
readonly current?: number;
|
|
65
|
+
/** Maximum allowed */
|
|
66
|
+
readonly limit?: number;
|
|
67
|
+
/** Suggested retry-after duration in ms */
|
|
68
|
+
readonly retryAfterMs?: number;
|
|
69
|
+
constructor(quotaType: string, message?: string, current?: number, limit?: number, metadata?: SandboxErrorMetadata, status?: number);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The requested capability is unavailable for the account, driver, or sandbox.
|
|
73
|
+
*/
|
|
74
|
+
declare class CapabilityError extends SandboxError {
|
|
75
|
+
/** Capability or feature that was rejected when known */
|
|
76
|
+
readonly capability?: string;
|
|
77
|
+
constructor(message: string, code?: string, status?: number, metadata?: SandboxErrorMetadata, capability?: string);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A multi-resource operation failed for one or more branches.
|
|
81
|
+
*/
|
|
82
|
+
declare class PartialFailureError extends SandboxError {
|
|
83
|
+
/** Per-resource failures returned by the API when available */
|
|
84
|
+
readonly failures?: SandboxFailureDetail[];
|
|
85
|
+
constructor(message: string, code?: string, status?: number, metadata?: SandboxErrorMetadata, failures?: SandboxFailureDetail[]);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The request was invalid or malformed.
|
|
89
|
+
*/
|
|
90
|
+
declare class ValidationError extends SandboxError {
|
|
91
|
+
/** Field-level validation errors */
|
|
92
|
+
readonly fields?: Record<string, string>;
|
|
93
|
+
constructor(message: string, fields?: Record<string, string>, metadata?: SandboxErrorMetadata);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The sandbox is not in a valid state for the requested operation.
|
|
97
|
+
*/
|
|
98
|
+
declare class StateError extends SandboxError {
|
|
99
|
+
/** Current state of the sandbox */
|
|
100
|
+
readonly currentState: string;
|
|
101
|
+
/** Required state for the operation */
|
|
102
|
+
readonly requiredState?: string;
|
|
103
|
+
constructor(message: string, currentState: string, requiredState?: string, metadata?: SandboxErrorMetadata);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The request timed out.
|
|
107
|
+
*/
|
|
108
|
+
declare class TimeoutError extends SandboxError {
|
|
109
|
+
/** Timeout duration in milliseconds */
|
|
110
|
+
readonly timeoutMs: number;
|
|
111
|
+
constructor(timeoutMs: number, message?: string, metadata?: SandboxErrorMetadata);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A network or connection error occurred.
|
|
115
|
+
*/
|
|
116
|
+
declare class NetworkError extends SandboxError {
|
|
117
|
+
/** The underlying error */
|
|
118
|
+
readonly cause?: Error;
|
|
119
|
+
constructor(message: string, causeOrMetadata?: Error | SandboxErrorMetadata, metadata?: SandboxErrorMetadata);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The server returned an unexpected error.
|
|
123
|
+
*/
|
|
124
|
+
declare class ServerError extends SandboxError {
|
|
125
|
+
constructor(message: string, status?: number, metadata?: SandboxErrorMetadata);
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
export { PartialFailureError as a, SandboxErrorJson as c, StateError as d, TimeoutError as f, NotFoundError as i, SandboxFailureDetail as l, CapabilityError as n, QuotaError as o, ValidationError as p, NetworkError as r, SandboxError as s, AuthError as t, ServerError as u };
|