@tangle-network/sandbox 0.2.1 → 0.3.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/README.md +71 -0
- package/dist/agent/index.d.ts +435 -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/{errors-BI75IXOM.d.ts → client-BuPZLOxS.d.ts} +2 -129
- package/dist/client-BwRV2Zun.js +1 -0
- 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-2gFsmmQs.d.ts} +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +1 -825
- package/dist/openai/index.d.ts +4 -5
- package/dist/openai/index.js +1 -1721
- package/dist/platform-integrations.js +1 -2
- package/dist/{sandbox-aBpWqler.d.ts → sandbox-CpK8etqP.d.ts} +291 -84
- 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 +23 -2
- package/dist/client-Uve6A5C6.js +0 -2280
- 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,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
|
+
function a0_0x335d(_0x5c15e9,_0x1bf5ce){_0x5c15e9=_0x5c15e9-0x161;const _0x265a7c=a0_0x265a();let _0x335dc4=_0x265a7c[_0x5c15e9];if(a0_0x335d['\x4c\x71\x4f\x43\x57\x58']===undefined){var _0x25163f=function(_0x217846){const _0x1a4d0c='\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 _0x264d22='',_0x77c921='';for(let _0x3a4d9d=0x0,_0x50a71c,_0x548464,_0x2cb0cb=0x0;_0x548464=_0x217846['\x63\x68\x61\x72\x41\x74'](_0x2cb0cb++);~_0x548464&&(_0x50a71c=_0x3a4d9d%0x4?_0x50a71c*0x40+_0x548464:_0x548464,_0x3a4d9d++%0x4)?_0x264d22+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x50a71c>>(-0x2*_0x3a4d9d&0x6)):0x0){_0x548464=_0x1a4d0c['\x69\x6e\x64\x65\x78\x4f\x66'](_0x548464);}for(let _0x1b3373=0x0,_0x3c50af=_0x264d22['\x6c\x65\x6e\x67\x74\x68'];_0x1b3373<_0x3c50af;_0x1b3373++){_0x77c921+='\x25'+('\x30\x30'+_0x264d22['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x1b3373)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x77c921);};a0_0x335d['\x51\x52\x61\x6d\x6e\x74']=_0x25163f,a0_0x335d['\x4b\x49\x76\x75\x51\x6a']={},a0_0x335d['\x4c\x71\x4f\x43\x57\x58']=!![];}const _0x5a2a70=_0x265a7c[0x0],_0x5cc2f5=_0x5c15e9+_0x5a2a70,_0x4441a3=a0_0x335d['\x4b\x49\x76\x75\x51\x6a'][_0x5cc2f5];return!_0x4441a3?(_0x335dc4=a0_0x335d['\x51\x52\x61\x6d\x6e\x74'](_0x335dc4),a0_0x335d['\x4b\x49\x76\x75\x51\x6a'][_0x5cc2f5]=_0x335dc4):_0x335dc4=_0x4441a3,_0x335dc4;}const a0_0x4fe72b=a0_0x335d;(function(_0x5e6c38,_0x31b620){const _0x17c17d=a0_0x335d,_0x2b6916=_0x5e6c38();while(!![]){try{const _0x1a9d6b=-parseInt(_0x17c17d(0x187))/0x1+parseInt(_0x17c17d(0x19f))/0x2*(-parseInt(_0x17c17d(0x1a0))/0x3)+parseInt(_0x17c17d(0x169))/0x4+parseInt(_0x17c17d(0x167))/0x5*(-parseInt(_0x17c17d(0x17b))/0x6)+parseInt(_0x17c17d(0x1b2))/0x7+-parseInt(_0x17c17d(0x161))/0x8+parseInt(_0x17c17d(0x17d))/0x9;if(_0x1a9d6b===_0x31b620)break;else _0x2b6916['push'](_0x2b6916['shift']());}catch(_0xf4b83e){_0x2b6916['push'](_0x2b6916['shift']());}}}(a0_0x265a,0x96fff));import{f as a0_0x59eb86,r as a0_0x4dbfca,u as a0_0x596bfc}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(_0x39f2ed){const _0x5c06c9=a0_0x335d;return _0x39f2ed[_0x5c06c9(0x168)](/\/+$/,'');}var CollaborationClient=class{[a0_0x4fe72b(0x165)];[a0_0x4fe72b(0x19a)];[a0_0x4fe72b(0x1bc)];[a0_0x4fe72b(0x1a8)];constructor(_0xb150e6){const _0x2ee219=a0_0x4fe72b;this[_0x2ee219(0x165)]=normalizeBaseUrl(_0xb150e6['\x62\x61\x73\x65\x55\x72\x6c']),this[_0x2ee219(0x19a)]=_0xb150e6[_0x2ee219(0x19a)]??DEFAULT_TIMEOUT_MS,this[_0x2ee219(0x1bc)]=_0xb150e6[_0x2ee219(0x18c)]??globalThis[_0x2ee219(0x18c)][_0x2ee219(0x191)](globalThis),this['\x68\x65\x61\x64\x65\x72\x73']=_0xb150e6[_0x2ee219(0x1a8)];}async[a0_0x4fe72b(0x1af)](_0x3d448b){const _0x5bea29=a0_0x4fe72b,_0x2bd254={'\x72\x74\x67\x47\x48':_0x5bea29(0x19d)};return this[_0x5bea29(0x180)](_0x2bd254[_0x5bea29(0x198)],{'\x6d\x65\x74\x68\x6f\x64':_0x5bea29(0x18d),'\x62\x6f\x64\x79':JSON['\x73\x74\x72\x69\x6e\x67\x69\x66\x79'](_0x3d448b)});}async[a0_0x4fe72b(0x1a1)](_0x383ba5){const _0x338f22=a0_0x4fe72b,_0x250eb6={'\x47\x46\x4f\x78\x75':_0x338f22(0x18d)};return this[_0x338f22(0x180)](_0x338f22(0x1ad),{'\x6d\x65\x74\x68\x6f\x64':_0x250eb6[_0x338f22(0x16f)],'\x62\x6f\x64\x79':JSON['\x73\x74\x72\x69\x6e\x67\x69\x66\x79'](_0x383ba5)});}async[a0_0x4fe72b(0x1be)](_0x202c0f){const _0x214ddb=a0_0x4fe72b,_0x2ad070={'\x57\x63\x66\x58\x67':_0x214ddb(0x190)};return this[_0x214ddb(0x180)](_0x2ad070[_0x214ddb(0x196)],{'\x6d\x65\x74\x68\x6f\x64':_0x214ddb(0x18d),'\x62\x6f\x64\x79':JSON[_0x214ddb(0x176)](_0x202c0f)});}async[a0_0x4fe72b(0x180)](_0x30ee5a,_0x4f4f67){const _0x5c75d5=a0_0x4fe72b,_0x3ac466={'\x51\x68\x78\x69\x72':function(_0x517b94,_0x1ef7d3,_0x1c1d12){return _0x517b94(_0x1ef7d3,_0x1c1d12);},'\x46\x47\x79\x68\x5a':_0x5c75d5(0x18b),'\x75\x74\x46\x4b\x53':'\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e','\x63\x6d\x4c\x42\x78':function(_0x30b0e5,_0x285771,_0x54140f,_0xe5df82,_0x47c9a9){return _0x30b0e5(_0x285771,_0x54140f,_0xe5df82,_0x47c9a9);},'\x72\x53\x6a\x4e\x52':function(_0x1823db,_0x1cea6e){return _0x1823db===_0x1cea6e;},'\x62\x4e\x66\x70\x75':function(_0x28668a,_0x421dba){return _0x28668a in _0x421dba;},'\x72\x53\x66\x66\x71':function(_0x3e75ad,_0x442076){return _0x3e75ad instanceof _0x442076;},'\x51\x4b\x64\x7a\x56':function(_0x298427,_0x5a7c2f){return _0x298427(_0x5a7c2f);},'\x54\x58\x56\x4b\x47':function(_0xa3ff81,_0xf811ba){return _0xa3ff81(_0xf811ba);}},_0x45f050=new AbortController(),_0x5ff282=_0x3ac466[_0x5c75d5(0x1b7)](setTimeout,()=>_0x45f050[_0x5c75d5(0x17e)](),this[_0x5c75d5(0x19a)]);try{const _0x5e192f=new Headers(await this[_0x5c75d5(0x16a)]());if(!_0x5e192f[_0x5c75d5(0x175)](_0x3ac466[_0x5c75d5(0x1ba)]))_0x5e192f[_0x5c75d5(0x1c9)]('\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65',_0x3ac466[_0x5c75d5(0x189)]);const _0x1fdd14=await this[_0x5c75d5(0x1bc)](''+this[_0x5c75d5(0x165)]+_0x30ee5a,{..._0x4f4f67,'\x68\x65\x61\x64\x65\x72\x73':_0x5e192f,'\x73\x69\x67\x6e\x61\x6c':_0x4f4f67['\x73\x69\x67\x6e\x61\x6c']??_0x45f050[_0x5c75d5(0x1b4)]});if(!_0x1fdd14['\x6f\x6b']){const _0x558a3f=await _0x1fdd14['\x74\x65\x78\x74']();throw _0x3ac466[_0x5c75d5(0x1a5)](a0_0x59eb86,_0x1fdd14[_0x5c75d5(0x166)],_0x558a3f,{'\x6d\x65\x74\x68\x6f\x64':_0x4f4f67['\x6d\x65\x74\x68\x6f\x64'],'\x70\x61\x74\x68':_0x30ee5a},_0x1fdd14[_0x5c75d5(0x1a8)]);}return _0x1fdd14[_0x5c75d5(0x178)]();}catch(_0x51dad0){if(_0x51dad0 instanceof Error&&_0x3ac466[_0x5c75d5(0x16b)](_0x51dad0[_0x5c75d5(0x17f)],'\x41\x62\x6f\x72\x74\x45\x72\x72\x6f\x72'))throw new a0_0x596bfc(this[_0x5c75d5(0x19a)]);if(_0x51dad0 instanceof Error&&_0x3ac466[_0x5c75d5(0x1b5)](_0x5c75d5(0x1c0),_0x51dad0))throw _0x51dad0;throw new a0_0x4dbfca(_0x5c75d5(0x195)+(_0x3ac466[_0x5c75d5(0x1c2)](_0x51dad0,Error)?_0x51dad0[_0x5c75d5(0x1a7)]:_0x3ac466[_0x5c75d5(0x1c5)](String,_0x51dad0)),_0x51dad0 instanceof Error?_0x51dad0:void 0x0);}finally{_0x3ac466[_0x5c75d5(0x174)](clearTimeout,_0x5ff282);}}async['\x72\x65\x73\x6f\x6c\x76\x65\x48\x65\x61\x64\x65\x72\x73'](){const _0xcf842=a0_0x4fe72b,_0x2b070a={'\x4b\x48\x4b\x47\x65':function(_0x3879be,_0x153ce3){return _0x3879be===_0x153ce3;}};if(_0x2b070a[_0xcf842(0x184)](typeof this['\x68\x65\x61\x64\x65\x72\x73'],_0xcf842(0x1b8)))return this['\x68\x65\x61\x64\x65\x72\x73']();return this[_0xcf842(0x1a8)];}};const DOCUMENT_PREFIX='\x77\x6f\x72\x6b\x73\x70\x61\x63\x65\x3a',FILE_SEGMENT=a0_0x4fe72b(0x1a2);function assertValidWorkspaceId(_0x3150c1){const _0x3e8dea=a0_0x4fe72b,_0x18785c={'\x4e\x68\x41\x4a\x66':_0x3e8dea(0x1c8)};if(!_0x3150c1)throw new Error(_0x18785c[_0x3e8dea(0x1bf)]);if(_0x3150c1[_0x3e8dea(0x1b9)]('\x2f')||_0x3150c1[_0x3e8dea(0x1b9)]('\x5c')||_0x3150c1['\x69\x6e\x63\x6c\x75\x64\x65\x73']('\x00'))throw new Error(_0x3e8dea(0x17c));}function a0_0x265a(){const _0x4833c4=['\x41\x67\x76\x48\x7a\x67\x76\x59\x43\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\x6a\x4c\x69\x67\x76\x54\x43\x68\x72\x35','\x42\x4d\x76\x34\x44\x66\x62\x48\x44\x67\x47','\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\x72\x56\x41\x32\x76\x55','\x41\x67\x66\x55\x7a\x67\x58\x4c\x72\x4d\x4c\x53\x7a\x75\x76\x32\x7a\x77\x35\x30','\x79\x4d\x39\x56\x44\x68\x6e\x30\x43\x4d\x66\x57','\x7a\x67\x76\x5a\x44\x68\x6a\x56\x45\x71','\x79\x4d\x39\x31\x42\x4d\x72\x71\x79\x78\x72\x4f','\x6e\x4a\x79\x30\x6e\x74\x75\x59\x6e\x30\x6e\x6d\x76\x33\x4c\x74\x75\x61','\x42\x33\x62\x30\x41\x77\x39\x55\x43\x57','\x43\x32\x4c\x4e\x42\x4d\x66\x53','\x79\x4b\x35\x4d\x43\x68\x75','\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','\x75\x77\x48\x34\x41\x78\x69','\x7a\x4e\x76\x55\x79\x33\x72\x50\x42\x32\x34','\x41\x77\x35\x4a\x42\x68\x76\x4b\x7a\x78\x6d','\x72\x4b\x44\x35\x41\x66\x4f','\x7a\x67\x76\x49\x42\x33\x76\x55\x79\x32\x76\x6e\x43\x57','\x7a\x4d\x76\x30\x79\x32\x48\x6a\x42\x78\x62\x53','\x7a\x4d\x58\x31\x43\x32\x47','\x43\x32\x66\x32\x7a\x76\x6e\x55\x79\x78\x62\x5a\x41\x67\x39\x30','\x74\x4d\x48\x62\x73\x4d\x79','\x79\x32\x39\x4b\x7a\x71','\x43\x32\x6e\x4f\x7a\x77\x72\x31\x42\x67\x76\x78\x43\x4d\x4c\x30\x7a\x71','\x43\x4c\x6e\x4d\x7a\x4e\x65','\x44\x32\x39\x59\x41\x33\x6e\x57\x79\x77\x6e\x4c\x73\x77\x71','\x42\x33\x6a\x50\x7a\x32\x4c\x55','\x75\x75\x54\x4b\x45\x4c\x79','\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','\x7a\x32\x76\x30\x75\x67\x66\x30\x41\x61','\x44\x32\x39\x59\x41\x33\x6e\x57\x79\x77\x6e\x4c\x73\x77\x71\x47\x41\x78\x6d\x47\x43\x4d\x76\x58\x44\x77\x4c\x59\x7a\x77\x71','\x43\x32\x76\x30','\x6e\x64\x69\x35\x6d\x4a\x75\x35\x6d\x4d\x66\x65\x76\x4b\x72\x4c\x7a\x47','\x7a\x4d\x4c\x53\x44\x67\x76\x59','\x75\x4e\x62\x78\x72\x32\x79','\x6d\x68\x57\x32\x46\x64\x76\x38\x6d\x78\x57\x30\x46\x64\x6e\x38\x6d\x47','\x79\x4d\x66\x5a\x7a\x76\x76\x59\x42\x61','\x43\x33\x72\x48\x44\x68\x76\x5a','\x6e\x74\x65\x35\x6d\x4a\x79\x35\x6e\x78\x50\x6c\x43\x78\x66\x30\x72\x71','\x43\x4d\x76\x57\x42\x67\x66\x4a\x7a\x71','\x6d\x5a\x47\x32\x6d\x5a\x43\x59\x6f\x67\x48\x76\x74\x4e\x50\x75\x73\x47','\x43\x4d\x76\x5a\x42\x32\x58\x32\x7a\x75\x48\x4c\x79\x77\x72\x4c\x43\x4e\x6d','\x43\x4c\x6e\x51\x74\x4c\x69','\x77\x75\x44\x50\x76\x68\x65','\x71\x76\x72\x69\x43\x30\x30','\x42\x66\x72\x4a\x74\x77\x75','\x72\x30\x7a\x70\x45\x68\x75','\x44\x33\x6a\x50\x44\x67\x76\x67\x41\x77\x58\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','\x7a\x32\x76\x30\x71\x32\x39\x55\x44\x67\x76\x55\x44\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','\x76\x66\x48\x77\x73\x30\x43','\x41\x67\x66\x5a','\x43\x33\x72\x59\x41\x77\x35\x4e\x41\x77\x7a\x35','\x42\x32\x35\x67\x41\x77\x58\x4c\x72\x67\x76\x53\x7a\x78\x72\x4c\x7a\x61','\x41\x4e\x6e\x56\x42\x47','\x7a\x30\x76\x72\x77\x68\x79','\x44\x33\x6a\x50\x44\x67\x75','\x6e\x4b\x7a\x54\x76\x66\x50\x65\x72\x57','\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','\x6f\x64\x6d\x5a\x6d\x64\x79\x35\x6e\x32\x66\x4d\x43\x78\x44\x4a\x73\x71','\x79\x77\x6a\x56\x43\x4e\x71','\x42\x4d\x66\x54\x7a\x71','\x43\x4d\x76\x58\x44\x77\x76\x5a\x44\x65\x50\x5a\x42\x32\x34','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x71\x79\x78\x72\x4f','\x79\x77\x72\x48\x43\x68\x72\x4c\x43\x47','\x43\x33\x76\x49\x43\x32\x6e\x59\x41\x77\x6a\x4c','\x73\x30\x48\x6c\x72\x32\x75','\x7a\x67\x76\x5a\x44\x68\x6a\x56\x45\x77\x76\x4b','\x44\x4d\x76\x59\x43\x32\x4c\x56\x42\x47','\x6d\x74\x69\x58\x6e\x74\x4b\x57\x7a\x30\x35\x33\x74\x4d\x72\x31','\x43\x4d\x76\x53\x79\x78\x72\x50\x44\x4d\x76\x71\x79\x78\x72\x4f\x69\x67\x4c\x5a\x69\x68\x6a\x4c\x43\x78\x76\x50\x43\x4d\x76\x4b','\x44\x78\x72\x67\x73\x31\x6d','\x43\x33\x72\x59\x41\x77\x35\x4e','\x71\x32\x39\x55\x44\x67\x76\x55\x44\x63\x31\x75\x45\x78\x62\x4c','\x7a\x4d\x76\x30\x79\x32\x47','\x75\x65\x39\x74\x76\x61','\x44\x68\x4c\x57\x7a\x71','\x41\x77\x35\x4b\x7a\x78\x48\x70\x7a\x47','\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','\x79\x4d\x4c\x55\x7a\x61','\x42\x67\x76\x55\x7a\x33\x72\x4f','\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\x32\x35\x67\x41\x77\x58\x4c\x75\x4d\x76\x55\x79\x77\x31\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','\x76\x32\x6e\x4d\x77\x67\x43','\x44\x78\x62\x4b\x79\x78\x72\x4c\x7a\x61','\x43\x4e\x72\x4e\x72\x30\x47','\x6d\x78\x57\x57\x46\x64\x7a\x38\x6d\x33\x57\x59\x46\x64\x76\x38\x6e\x61','\x44\x67\x4c\x54\x7a\x77\x39\x31\x44\x65\x31\x5a','\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\x32\x39\x55\x44\x67\x76\x55\x44\x61','\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\x32\x6a\x56\x42\x33\x72\x5a\x44\x68\x6a\x48\x43\x61','\x7a\x67\x76\x53\x7a\x78\x72\x4c\x7a\x61','\x6d\x4a\x48\x59\x74\x67\x7a\x79\x71\x76\x79','\x6d\x74\x65\x59\x6e\x4a\x75\x32\x42\x76\x62\x66\x72\x77\x6e\x73','\x43\x4d\x76\x4d\x43\x4d\x76\x5a\x41\x66\x72\x56\x41\x32\x76\x55','\x6f\x4d\x7a\x50\x42\x67\x75\x36','\x75\x30\x35\x62\x73\x66\x4b','\x43\x33\x62\x53\x41\x78\x71','\x79\x32\x31\x6d\x71\x4e\x47','\x41\x4d\x39\x50\x42\x47','\x42\x77\x76\x5a\x43\x32\x66\x4e\x7a\x71'];a0_0x265a=function(){return _0x4833c4;};return a0_0x265a();}function normalizeCollaborationPath(_0x38adef){const _0x300042=a0_0x4fe72b,_0x447339={'\x76\x63\x4a\x7a\x71':_0x300042(0x193)};if(!_0x38adef)throw new Error(_0x300042(0x188));const _0x262a74=_0x38adef[_0x300042(0x168)](/\\/g,'\x2f')[_0x300042(0x1a4)]('\x2f')[_0x300042(0x162)](_0x38ec09=>_0x38ec09[_0x300042(0x192)]>0x0&&_0x38ec09!=='\x2e');if(_0x262a74[_0x300042(0x192)]===0x0)throw new Error(_0x300042(0x1a9));for(const _0x4fc3eb of _0x262a74){if(_0x4fc3eb==='\x2e\x2e')throw new Error(_0x447339['\x76\x63\x4a\x7a\x71']);if(_0x4fc3eb[_0x300042(0x1b9)]('\x00'))throw new Error(_0x300042(0x173));}return _0x262a74[_0x300042(0x1a6)]('\x2f');}function buildCollaborationDocumentId(_0x48daea){const _0x40aa3e=a0_0x4fe72b;assertValidWorkspaceId(_0x48daea[_0x40aa3e(0x1c3)]);const _0x50eb49=normalizeCollaborationPath(_0x48daea[_0x40aa3e(0x181)]);return''+DOCUMENT_PREFIX+_0x48daea['\x77\x6f\x72\x6b\x73\x70\x61\x63\x65\x49\x64']+FILE_SEGMENT+_0x50eb49;}function parseCollaborationDocumentId(_0x1d0ec3){const _0x10fe4e=a0_0x4fe72b,_0x27adfe={'\x52\x70\x57\x47\x66':function(_0x4965e9,_0x499e39){return _0x4965e9===_0x499e39;},'\x59\x47\x69\x54\x71':function(_0x1d59e7,_0xee4e20){return _0x1d59e7+_0xee4e20;}};if(!_0x1d0ec3['\x73\x74\x61\x72\x74\x73\x57\x69\x74\x68'](DOCUMENT_PREFIX))return null;const _0x485b64=_0x1d0ec3[_0x10fe4e(0x18f)](FILE_SEGMENT,0xa);if(_0x27adfe[_0x10fe4e(0x163)](_0x485b64,-0x1))return null;const _0x150f5b=_0x1d0ec3['\x73\x6c\x69\x63\x65'](0xa,_0x485b64),_0x4a4df3=_0x1d0ec3['\x73\x6c\x69\x63\x65'](_0x27adfe[_0x10fe4e(0x16c)](_0x485b64,0x6));try{return assertValidWorkspaceId(_0x150f5b),{'\x77\x6f\x72\x6b\x73\x70\x61\x63\x65\x49\x64':_0x150f5b,'\x72\x65\x6c\x61\x74\x69\x76\x65\x50\x61\x74\x68':normalizeCollaborationPath(_0x4a4df3)};}catch{return null;}}const DEFAULT_DEBOUNCE_MS=0x1f4,FILE_ORIGIN=a0_0x4fe72b(0x1ab);var CollaborationFileBridge=class{[a0_0x4fe72b(0x1bb)];['\x6f\x70\x74\x69\x6f\x6e\x73'];['\x61\x64\x61\x70\x74\x65\x72']=null;[a0_0x4fe72b(0x1c6)]=null;[a0_0x4fe72b(0x1b6)]=null;['\x70\x65\x6e\x64\x69\x6e\x67\x57\x72\x69\x74\x65\x54\x69\x6d\x65\x72']=null;[a0_0x4fe72b(0x185)]=![];[a0_0x4fe72b(0x1b1)];['\x6c\x61\x73\x74\x57\x72\x69\x74\x74\x65\x6e\x43\x6f\x6e\x74\x65\x6e\x74']=null;constructor(_0x4f5ce7){const _0x3a33b0=a0_0x4fe72b;this[_0x3a33b0(0x1b3)]=_0x4f5ce7,this['\x62\x6f\x75\x6e\x64\x50\x61\x74\x68']=_0x4f5ce7[_0x3a33b0(0x181)],this[_0x3a33b0(0x1bb)]=_0x4f5ce7[_0x3a33b0(0x1bb)]??DEFAULT_DEBOUNCE_MS;}[a0_0x4fe72b(0x191)](_0x6a3fef){const _0x2b563a=a0_0x4fe72b,_0x1d87f3={'\x6c\x54\x63\x4d\x65':function(_0xb1d67c,_0x472aa6){return _0xb1d67c===_0x472aa6;}};this[_0x2b563a(0x1b0)](),this[_0x2b563a(0x185)]=![],this[_0x2b563a(0x182)]=_0x6a3fef,this['\x62\x6f\x75\x6e\x64\x50\x61\x74\x68']=this[_0x2b563a(0x1b3)][_0x2b563a(0x181)],this[_0x2b563a(0x1c6)]=_0x6a3fef[_0x2b563a(0x183)](_0xe3f2b2=>{const _0x51c6c8=_0x2b563a;if(_0x1d87f3[_0x51c6c8(0x16e)](_0xe3f2b2[_0x51c6c8(0x1c4)],FILE_ORIGIN))return;if(this[_0x51c6c8(0x19b)]!==null&&_0x1d87f3[_0x51c6c8(0x16e)](_0xe3f2b2[_0x51c6c8(0x19c)],this[_0x51c6c8(0x19b)]))return;this[_0x51c6c8(0x1c1)](_0xe3f2b2['\x63\x6f\x6e\x74\x65\x6e\x74']);}),this[_0x2b563a(0x1b6)]=this[_0x2b563a(0x1b3)][_0x2b563a(0x171)](this[_0x2b563a(0x1b1)],_0x38db46=>{this['\x68\x61\x6e\x64\x6c\x65\x46\x69\x6c\x65\x45\x76\x65\x6e\x74'](_0x38db46);});}async[a0_0x4fe72b(0x1bd)](){const _0x157c0a=a0_0x4fe72b;if(!this['\x61\x64\x61\x70\x74\x65\x72'])return;this[_0x157c0a(0x1ac)]&&(clearTimeout(this[_0x157c0a(0x1ac)]),this['\x70\x65\x6e\x64\x69\x6e\x67\x57\x72\x69\x74\x65\x54\x69\x6d\x65\x72']=null);const _0x1256f0=this[_0x157c0a(0x182)][_0x157c0a(0x172)]();await this[_0x157c0a(0x17a)](_0x1256f0);}[a0_0x4fe72b(0x1c7)](){const _0x33065a=a0_0x4fe72b;return this[_0x33065a(0x1b1)];}[a0_0x4fe72b(0x1b0)](){const _0xc6b46f=a0_0x4fe72b,_0x2fcbb2=_0xc6b46f(0x199)[_0xc6b46f(0x1a4)]('\x7c');let _0x48a70a=0x0;while(!![]){switch(_0x2fcbb2[_0x48a70a++]){case'\x30':this[_0xc6b46f(0x1ac)]&&(clearTimeout(this[_0xc6b46f(0x1ac)]),this['\x70\x65\x6e\x64\x69\x6e\x67\x57\x72\x69\x74\x65\x54\x69\x6d\x65\x72']=null);continue;case'\x31':this[_0xc6b46f(0x185)]=!![];continue;case'\x32':this[_0xc6b46f(0x1b6)]?.();continue;case'\x33':this[_0xc6b46f(0x1c6)]=null;continue;case'\x34':this['\x61\x64\x61\x70\x74\x65\x72']=null;continue;case'\x35':this['\x75\x6e\x73\x75\x62\x73\x63\x72\x69\x62\x65\x46\x69\x6c\x65\x45\x76\x65\x6e\x74\x73']=null;continue;case'\x36':this[_0xc6b46f(0x1c6)]?.();continue;}break;}}['\x73\x63\x68\x65\x64\x75\x6c\x65\x57\x72\x69\x74\x65'](_0x398054){const _0x53a47c=a0_0x4fe72b;if(this[_0x53a47c(0x1ac)])clearTimeout(this['\x70\x65\x6e\x64\x69\x6e\x67\x57\x72\x69\x74\x65\x54\x69\x6d\x65\x72']);this[_0x53a47c(0x1ac)]=setTimeout(()=>{const _0x1ac8c8=_0x53a47c;this[_0x1ac8c8(0x1ac)]=null,this[_0x1ac8c8(0x17a)](_0x398054);},this[_0x53a47c(0x1bb)]);}async[a0_0x4fe72b(0x17a)](_0x4e2bcc){const _0x3d5e8e=a0_0x4fe72b;if(this[_0x3d5e8e(0x185)])return;this['\x6c\x61\x73\x74\x57\x72\x69\x74\x74\x65\x6e\x43\x6f\x6e\x74\x65\x6e\x74']=_0x4e2bcc,await this[_0x3d5e8e(0x1b3)][_0x3d5e8e(0x170)](this['\x62\x6f\x75\x6e\x64\x50\x61\x74\x68'],_0x4e2bcc);}[a0_0x4fe72b(0x1ae)](_0x104cc5){const _0x18aed8=a0_0x4fe72b,_0xc6996b={'\x53\x4e\x41\x48\x59':function(_0xa223fa,_0x1e9a34){return _0xa223fa!==_0x1e9a34;},'\x61\x55\x42\x70\x57':function(_0x5063c6,_0x343406){return _0x5063c6!==_0x343406;},'\x67\x45\x51\x58\x76':function(_0x45b41e,_0x2f171b){return _0x45b41e!==_0x2f171b;},'\x41\x54\x48\x73\x4d':function(_0x961e62,_0x5beb4e){return _0x961e62===_0x5beb4e;},'\x4b\x61\x62\x4a\x43':function(_0x19c14a,_0x4cf11c){return _0x19c14a===_0x4cf11c;}},_0x4c8670=_0x18aed8(0x164)[_0x18aed8(0x1a4)]('\x7c');let _0x40a6b0=0x0;while(!![]){switch(_0x4c8670[_0x40a6b0++]){case'\x30':if(!this[_0x18aed8(0x182)]||this[_0x18aed8(0x185)])return;continue;case'\x31':if(_0xc6996b[_0x18aed8(0x1a3)](_0x104cc5[_0x18aed8(0x18e)],_0x18aed8(0x197))||_0xc6996b['\x61\x55\x42\x70\x57'](typeof _0x104cc5[_0x18aed8(0x19c)],_0x18aed8(0x18a)))return;continue;case'\x32':this[_0x18aed8(0x182)]['\x72\x65\x70\x6c\x61\x63\x65\x43\x6f\x6e\x74\x65\x6e\x74'](_0x104cc5['\x63\x6f\x6e\x74\x65\x6e\x74'],{'\x6f\x72\x69\x67\x69\x6e':FILE_ORIGIN,'\x76\x65\x72\x73\x69\x6f\x6e':_0x104cc5[_0x18aed8(0x186)]});continue;case'\x33':if(_0xc6996b[_0x18aed8(0x179)](this['\x6c\x61\x73\x74\x57\x72\x69\x74\x74\x65\x6e\x43\x6f\x6e\x74\x65\x6e\x74'],null)&&_0xc6996b[_0x18aed8(0x16d)](_0x104cc5[_0x18aed8(0x19c)],this[_0x18aed8(0x19b)]))return;continue;case'\x34':if(_0xc6996b['\x4b\x61\x62\x4a\x43'](_0x104cc5[_0x18aed8(0x19c)],this[_0x18aed8(0x182)][_0x18aed8(0x172)]()))return;continue;case'\x35':if(_0x104cc5[_0x18aed8(0x18e)]===_0x18aed8(0x19e)){this[_0x18aed8(0x1b3)][_0x18aed8(0x177)]?.(_0x104cc5);return;}continue;case'\x36':if(_0xc6996b[_0x18aed8(0x16d)](_0x104cc5[_0x18aed8(0x18e)],'\x72\x65\x6e\x61\x6d\x65\x64')&&_0x104cc5[_0x18aed8(0x1aa)]){this[_0x18aed8(0x1b1)]=_0x104cc5[_0x18aed8(0x1aa)],this[_0x18aed8(0x1b3)][_0x18aed8(0x194)]?.(_0x104cc5);return;}continue;}break;}}};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-CpK8etqP.js";
|
|
2
|
+
import { i as SandboxClient } from "./client-BuPZLOxS.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(_0x2ece7b,_0x5602e2){var _0xdf376e=a0_0x4f4d,_0x1b12bc=_0x2ece7b();while(!![]){try{var _0x175d7f=parseInt(_0xdf376e(0xeb))/0x1+parseInt(_0xdf376e(0xe7))/0x2+-parseInt(_0xdf376e(0xea))/0x3+-parseInt(_0xdf376e(0xed))/0x4*(-parseInt(_0xdf376e(0xec))/0x5)+-parseInt(_0xdf376e(0xe6))/0x6+parseInt(_0xdf376e(0xe9))/0x7*(-parseInt(_0xdf376e(0xe8))/0x8)+-parseInt(_0xdf376e(0xe5))/0x9;if(_0x175d7f===_0x5602e2)break;else _0x1b12bc['push'](_0x1b12bc['shift']());}catch(_0x5daa33){_0x1b12bc['push'](_0x1b12bc['shift']());}}}(a0_0x55e7,0xc63ff));function a0_0x55e7(){var _0x41c9e0=['\x6d\x74\x47\x31\x6e\x74\x47\x34\x6e\x30\x48\x74\x73\x78\x7a\x77\x74\x47','\x6d\x74\x69\x33\x6d\x64\x79\x30\x6f\x78\x62\x72\x77\x76\x7a\x77\x43\x57','\x6d\x74\x47\x5a\x6e\x77\x7a\x6a\x76\x32\x6e\x79\x76\x61','\x6f\x74\x47\x34\x6e\x65\x50\x7a\x77\x78\x48\x50\x43\x57','\x6e\x74\x6d\x34\x6f\x74\x43\x58\x6d\x33\x48\x34\x41\x33\x50\x4b\x77\x61','\x6d\x4a\x4b\x59\x6d\x5a\x4b\x30\x6e\x65\x54\x6e\x72\x78\x62\x34\x42\x47','\x6d\x74\x6d\x33\x6e\x74\x4b\x59\x6d\x65\x58\x73\x76\x33\x44\x56\x74\x47','\x6d\x74\x65\x58\x6e\x74\x79\x57\x44\x4d\x58\x6b\x77\x75\x58\x62','\x6d\x74\x43\x31\x72\x30\x48\x73\x74\x4d\x6a\x74'];a0_0x55e7=function(){return _0x41c9e0;};return a0_0x55e7();}import{a as a0_0x5aa0b9,c as a0_0x293922,d as a0_0x19e977,i as a0_0x3f436a,l as a0_0x3754a3,n as a0_0x536e22,o as a0_0x355263,r as a0_0x4eec82,s as a0_0x5754ed,t as a0_0xe1c7fb,u as a0_0x4f34ae}from'\x2e\x2f\x65\x72\x72\x6f\x72\x73\x2d\x43\x6c\x6a\x69\x47\x52\x5f\x5f\x2e\x6a\x73';function a0_0x4f4d(_0x2a7aab,_0x31b43b){_0x2a7aab=_0x2a7aab-0xe5;var _0x55e705=a0_0x55e7();var _0x4f4d3e=_0x55e705[_0x2a7aab];if(a0_0x4f4d['\x4d\x79\x4e\x58\x54\x74']===undefined){var _0x409f5c=function(_0x2e8e39){var _0xa432b8='\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 _0x5aa0b9='',_0x293922='';for(var _0x19e977=0x0,_0x3f436a,_0x3754a3,_0x536e22=0x0;_0x3754a3=_0x2e8e39['\x63\x68\x61\x72\x41\x74'](_0x536e22++);~_0x3754a3&&(_0x3f436a=_0x19e977%0x4?_0x3f436a*0x40+_0x3754a3:_0x3754a3,_0x19e977++%0x4)?_0x5aa0b9+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x3f436a>>(-0x2*_0x19e977&0x6)):0x0){_0x3754a3=_0xa432b8['\x69\x6e\x64\x65\x78\x4f\x66'](_0x3754a3);}for(var _0x355263=0x0,_0x4eec82=_0x5aa0b9['\x6c\x65\x6e\x67\x74\x68'];_0x355263<_0x4eec82;_0x355263++){_0x293922+='\x25'+('\x30\x30'+_0x5aa0b9['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x355263)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x293922);};a0_0x4f4d['\x62\x4d\x5a\x64\x5a\x66']=_0x409f5c,a0_0x4f4d['\x79\x65\x46\x5a\x57\x67']={},a0_0x4f4d['\x4d\x79\x4e\x58\x54\x74']=!![];}var _0x35f018=_0x55e705[0x0],_0x37db9d=_0x2a7aab+_0x35f018,_0x257b6f=a0_0x4f4d['\x79\x65\x46\x5a\x57\x67'][_0x37db9d];return!_0x257b6f?(_0x4f4d3e=a0_0x4f4d['\x62\x4d\x5a\x64\x5a\x66'](_0x4f4d3e),a0_0x4f4d['\x79\x65\x46\x5a\x57\x67'][_0x37db9d]=_0x4f4d3e):_0x4f4d3e=_0x257b6f,_0x4f4d3e;}import{t as a0_0x46fa31}from'\x2e\x2f\x73\x61\x6e\x64\x62\x6f\x78\x2d\x44\x54\x75\x70\x32\x6a\x7a\x7a\x2e\x6a\x73';import{n as a0_0x3e5b40}from'\x2e\x2f\x63\x6c\x69\x65\x6e\x74\x2d\x42\x77\x52\x56\x32\x5a\x75\x6e\x2e\x6a\x73';export{a0_0xe1c7fb as AuthError,a0_0x536e22 as CapabilityError,a0_0x4eec82 as NetworkError,a0_0x3f436a as NotFoundError,a0_0x5aa0b9 as PartialFailureError,a0_0x355263 as QuotaError,a0_0x3e5b40 as Sandbox,a0_0x3e5b40 as SandboxClient,a0_0x5754ed as SandboxError,a0_0x46fa31 as SandboxInstance,a0_0x293922 as ServerError,a0_0x3754a3 as StateError,a0_0x4f34ae as TimeoutError,a0_0x19e977 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 };
|