hub-import-zip-shim.mjs
39 lines 1.1 KB
Raw
sha256:c2dbf04d56308f3bbf2d06e6d2eb022b8948b1e827195fe525a44e5e18d5f9c0 feat(auth): Phase B Connect cloud agent (RFC 8628) + Hermes… Human minor ⚠ breaking 12 days ago
1 /**
2 * Loads with Hub UI after global JSZip (UMD). Exposes one namespace for `hub.js`.
3 */
4 import {
5 buildImportZipBlobWithJsZip,
6 DEFAULT_HUB_IMPORT_ZIP_LIMITS,
7 getHubImportFileMode,
8 HUB_IMPORT_SEQUENTIAL_MULTI_SOURCE_TYPES,
9 HUB_IMPORT_ZIP_BULK_SOURCE_TYPES,
10 assertSingleFileWithinLimit,
11 } from './hub-client-import-zip.mjs';
12
13 function getJSZipCtor() {
14 const C = globalThis.JSZip;
15 if (typeof C !== 'function') {
16 throw new Error('JSZip is not loaded. Expected script before hub-import-zip-shim.mjs.');
17 }
18 return C;
19 }
20
21 const knowtationHubImportZip = {
22 get limits() {
23 return DEFAULT_HUB_IMPORT_ZIP_LIMITS;
24 },
25 HUB_IMPORT_SEQUENTIAL_MULTI_SOURCE_TYPES,
26 HUB_IMPORT_ZIP_BULK_SOURCE_TYPES,
27 getHubImportFileMode,
28 buildImportZipBlob: (fileList, opts) =>
29 buildImportZipBlobWithJsZip(getJSZipCtor(), fileList, DEFAULT_HUB_IMPORT_ZIP_LIMITS, opts),
30 assertSingleFileWithinLimit: (f) => assertSingleFileWithinLimit(f, DEFAULT_HUB_IMPORT_ZIP_LIMITS),
31 };
32
33 Object.defineProperty(globalThis, 'knowtationHubImportZip', {
34 value: knowtationHubImportZip,
35 enumerable: true,
36 configurable: true,
37 });
38
39 export { knowtationHubImportZip };
File History 1 commit
sha256:93bcf8f9bd56d8c5b9339f4ec73b9ebd66571398d56262d38eedc2cfa9db9882 fix(test): align Band B landing assertion with desktop MCP … Human 12 days ago