@powerhousedao/connect 6.2.3-dev.85 → 6.2.3-dev.87
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/{AddDriveModal-CFi-9FQU.js → AddDriveModal-zMepHdWt.js} +20 -7
- package/dist/AddDriveModal-zMepHdWt.js.map +1 -0
- package/dist/{ClearStorageModal-CmUiIi0T.js → ClearStorageModal-DgGxtQaQ.js} +4 -4
- package/dist/{ClearStorageModal-CmUiIi0T.js.map → ClearStorageModal-DgGxtQaQ.js.map} +1 -1
- package/dist/{DebugSettingsModal-El4JXWNs.js → DebugSettingsModal-DycU6WFC.js} +4 -4
- package/dist/{DebugSettingsModal-El4JXWNs.js.map → DebugSettingsModal-DycU6WFC.js.map} +1 -1
- package/dist/{InspectorModal-Bdb1KUkI.js → InspectorModal-CmMSRdJq.js} +8 -8
- package/dist/InspectorModal-CmMSRdJq.js.map +1 -0
- package/dist/{reactor-chat-BwR9R1ah.js → ai-tools-CSRAzPuU.js} +7 -12
- package/dist/ai-tools-CSRAzPuU.js.map +1 -0
- package/dist/ai-tools-FwcvsTEc.js +4 -0
- package/dist/app-loader-D9bDKQtj.js +4 -0
- package/dist/{app-loader-NtlPch5u.js → app-loader-DCXsLWK3.js} +8 -8
- package/dist/{app-loader-NtlPch5u.js.map → app-loader-DCXsLWK3.js.map} +1 -1
- package/dist/{boot-CMxnV_UI.js → boot-2vu8w50I.js} +4 -4
- package/dist/{boot-CMxnV_UI.js.map → boot-2vu8w50I.js.map} +1 -1
- package/dist/{build-info-DQu9_luk.js → build-info-D8mpFlVu.js} +5 -5
- package/dist/{build-info-DQu9_luk.js.map → build-info-D8mpFlVu.js.map} +1 -1
- package/dist/{components-BHGspJyA.js → components-D2xBHSmq.js} +4 -4
- package/dist/{components-BHGspJyA.js.map → components-D2xBHSmq.js.map} +1 -1
- package/dist/{connection-state-Bwm9Agwy.js → connection-state-B6YMctkg.js} +4 -4
- package/dist/{connection-state-Bwm9Agwy.js.map → connection-state-B6YMctkg.js.map} +1 -1
- package/dist/generic.js +1 -1
- package/dist/{load-N-VsYJ7V.js → load-Cy5EZy6w.js} +8 -8
- package/dist/{load-N-VsYJ7V.js.map → load-Cy5EZy6w.js.map} +1 -1
- package/dist/{load-runtime-config-DcayjaVq.js → load-runtime-config-Ca1WrxJ2.js} +4 -4
- package/dist/{load-runtime-config-DcayjaVq.js.map → load-runtime-config-Ca1WrxJ2.js.map} +1 -1
- package/dist/main.js +2 -2
- package/dist/{package-manager-3EogmuaC.js → package-manager-CwPe8C9C.js} +6 -6
- package/dist/{package-manager-3EogmuaC.js.map → package-manager-CwPe8C9C.js.map} +1 -1
- package/dist/{pglite-major-p4_YefAE.js → pglite-major-pao-ozRo.js} +5 -5
- package/dist/pglite-major-pao-ozRo.js.map +1 -0
- package/dist/{pglite-migrate-core-DBlU6HIc.js → pglite-migrate-core-B6FqmhH8.js} +4 -4
- package/dist/{pglite-migrate-core-DBlU6HIc.js.map → pglite-migrate-core-B6FqmhH8.js.map} +1 -1
- package/dist/{pglite-seed-QPbGbLB_.js → pglite-seed-Ben-06-w.js} +4 -4
- package/dist/{pglite-seed-QPbGbLB_.js.map → pglite-seed-Ben-06-w.js.map} +1 -1
- package/dist/{plugins-yBUPukgu.js → plugins-CoowJooW.js} +4 -4
- package/dist/{plugins-yBUPukgu.js.map → plugins-CoowJooW.js.map} +1 -1
- package/dist/prerender.js +1 -1
- package/dist/{reactor-DiiPKBfA.js → reactor-DIt5d6RH.js} +12 -8
- package/dist/{reactor-DiiPKBfA.js.map → reactor-DIt5d6RH.js.map} +1 -1
- package/dist/reactor-chat-B0IFAanh.js +15 -0
- package/dist/reactor-chat-B0IFAanh.js.map +1 -0
- package/dist/reactor.worker.js +2 -2
- package/dist/{settings-DuCPj6nj.js → settings-cfEqmujq.js} +7 -7
- package/dist/{settings-DuCPj6nj.js.map → settings-cfEqmujq.js.map} +1 -1
- package/dist/{settings-tabs-C9ca_GNg.js → settings-tabs-B4ejM9lL.js} +4 -4
- package/dist/{settings-tabs-C9ca_GNg.js.map → settings-tabs-B4ejM9lL.js.map} +1 -1
- package/dist/shell.html +1 -1
- package/dist/start-connect.js +2 -2
- package/dist/style.css +4 -0
- package/dist/{ui-C77v-T9h.js → ui-CyxG0yU5.js} +8 -8
- package/dist/{ui-C77v-T9h.js.map → ui-CyxG0yU5.js.map} +1 -1
- package/package.json +16 -16
- package/dist/AddDriveModal-CFi-9FQU.js.map +0 -1
- package/dist/InspectorModal-Bdb1KUkI.js.map +0 -1
- package/dist/app-loader-BG9-usoJ.js +0 -4
- package/dist/pglite-major-p4_YefAE.js.map +0 -1
- package/dist/reactor-chat-BwR9R1ah.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pglite-migrate-core-DBlU6HIc.js","sources":["../src/utils/pglite-migrate-core.ts"],"sourcesContent":["import {\n createFileDataStore,\n IDB_DB_VERSION,\n IDB_STORE_NAME,\n idbError,\n openIdb,\n readPgVersionFile,\n} from \"./pglite-idb.js\";\nimport { CURRENT_PG_MAJOR, isMigratableMajor } from \"./pglite-major.js\";\n\nexport type MigrationPhase = \"clone\" | \"dump\" | \"restore\";\n\nexport type FileDataValue = {\n contents: Uint8Array | number[];\n mode: number;\n timestamp: Date | number;\n};\n\nexport type FileDataEntry = { key: IDBValidKey; value: FileDataValue };\n\n// Snapshots a data dir before migration and restores/discards it after. The\n// flag-off path persists to an IDB backup (with retention); the worker keeps\n// the snapshot in memory for same-run rollback only.\nexport interface BackupStrategy {\n snapshot(idbName: string): Promise<unknown>;\n rollback(handle: unknown, idbName: string, cause: unknown): Promise<void>;\n discard(handle: unknown): Promise<void>;\n commit(handle: unknown): Promise<void>;\n}\n\ntype LegacyDumper = (idbName: string) => Promise<string>;\n\nconst LEGACY_DUMPERS: Partial<Record<number, () => Promise<LegacyDumper>>> = {\n 16: async () => {\n const [{ PGlite: LegacyPGlite }, { pgDump }] = await Promise.all([\n import(\"pglite-legacy-02\"),\n import(\"pglite-tools-legacy-02/pg_dump\"),\n ]);\n return async (idbName: string) => {\n const stripped = idbName.replace(/^\\/pglite\\//, \"\");\n const pg = new LegacyPGlite(`idb://${stripped}`);\n try {\n await pg.waitReady;\n const file = await pgDump({ pg });\n return await file.text();\n } finally {\n await pg.close();\n }\n };\n },\n};\n\nexport async function clearFileData(idbName: string): Promise<void> {\n const db = await openIdb(idbName, IDB_DB_VERSION, createFileDataStore);\n try {\n await new Promise<void>((resolve, reject) => {\n const tx = db.transaction(IDB_STORE_NAME, \"readwrite\");\n tx.oncomplete = () => resolve();\n tx.onerror = () =>\n reject(idbError(tx, `FILE_DATA clear failed for ${idbName}`));\n tx.onabort = () =>\n reject(idbError(tx, `FILE_DATA clear aborted for ${idbName}`));\n tx.objectStore(IDB_STORE_NAME).clear();\n });\n } finally {\n db.close();\n }\n}\n\nexport async function readFileData(idbName: string): Promise<FileDataEntry[]> {\n const db = await openIdb(idbName, IDB_DB_VERSION, createFileDataStore);\n try {\n return await new Promise<FileDataEntry[]>((resolve, reject) => {\n const out: FileDataEntry[] = [];\n const req = db\n .transaction(IDB_STORE_NAME, \"readonly\")\n .objectStore(IDB_STORE_NAME)\n .openCursor();\n req.onerror = () =>\n reject(idbError(req, `FILE_DATA read cursor failed for ${idbName}`));\n req.onsuccess = () => {\n const cursor = req.result;\n if (!cursor) return resolve(out);\n out.push({ key: cursor.key, value: cursor.value as FileDataValue });\n cursor.continue();\n };\n });\n } finally {\n db.close();\n }\n}\n\nexport async function writeFileData(\n idbName: string,\n entries: FileDataEntry[],\n): Promise<void> {\n const db = await openIdb(idbName, IDB_DB_VERSION, createFileDataStore);\n try {\n await new Promise<void>((resolve, reject) => {\n const tx = db.transaction(IDB_STORE_NAME, \"readwrite\");\n tx.oncomplete = () => resolve();\n tx.onerror = () =>\n reject(idbError(tx, `FILE_DATA write failed for ${idbName}`));\n tx.onabort = () =>\n reject(idbError(tx, `FILE_DATA write aborted for ${idbName}`));\n const store = tx.objectStore(IDB_STORE_NAME);\n store.clear();\n for (const { key, value } of entries) {\n store.put(value, key);\n }\n });\n } finally {\n db.close();\n }\n}\n\nexport async function cloneFileData(\n sourceName: string,\n destName: string,\n): Promise<void> {\n await writeFileData(destName, await readFileData(sourceName));\n}\n\nfunction logRestoreFailure(idbName: string, sql: string, err: unknown): void {\n const errObj = err as {\n message?: string;\n position?: string | number;\n severity?: string;\n code?: string;\n detail?: string;\n where?: string;\n };\n const position =\n typeof errObj.position === \"string\"\n ? parseInt(errObj.position, 10)\n : typeof errObj.position === \"number\"\n ? errObj.position\n : NaN;\n\n console.error(`[pglite-migration] Restore failed for ${idbName}`, {\n message: errObj.message,\n code: errObj.code,\n severity: errObj.severity,\n detail: errObj.detail,\n where: errObj.where,\n position: errObj.position,\n sqlLength: sql.length,\n });\n\n if (Number.isFinite(position) && position > 0) {\n const zeroBased = position - 1;\n const start = Math.max(0, zeroBased - 200);\n const end = Math.min(sql.length, zeroBased + 200);\n console.error(\n `[pglite-migration] SQL context around position ${position}:\\n${sql.slice(start, zeroBased)}»${sql.slice(zeroBased, zeroBased + 1)}«${sql.slice(zeroBased + 1, end)}`,\n );\n } else {\n console.error(\n `[pglite-migration] No position info. First 2000 chars of dump:\\n${sql.slice(0, 2000)}`,\n );\n }\n}\n\nasync function restoreDumpIntoIdb(idbName: string, sql: string): Promise<void> {\n const stripped = idbName.replace(/^\\/pglite\\//, \"\");\n // Dynamic: a static import puts PGlite (~350 KB) in the app-loader chunk.\n const { PGlite } = await import(\"@electric-sql/pglite\");\n const pg = new PGlite(`idb://${stripped}`, { relaxedDurability: false });\n try {\n await pg.waitReady;\n // PG16 pg_dump emits doubled backslashes (escape-string form) without the\n // matching SET; PG17 defaults standard_conforming_strings on, breaking JSONB.\n try {\n await pg.exec(\"SET standard_conforming_strings = off;\");\n } catch (gucErr) {\n console.warn(\n \"[pglite-migration] Could not force standard_conforming_strings=off\",\n gucErr,\n );\n }\n try {\n await pg.exec(sql);\n } catch (execErr) {\n logRestoreFailure(idbName, sql, execErr);\n throw execErr;\n }\n } finally {\n await pg.close();\n }\n}\n\nexport async function migrateIdb(\n idbName: string,\n publishPhase: (phase: MigrationPhase) => void,\n backup: BackupStrategy,\n): Promise<void> {\n const major = await readPgVersionFile(idbName);\n if (major === null || major === CURRENT_PG_MAJOR) return;\n\n if (!isMigratableMajor(major)) {\n console.warn(\n `[pglite-migration] Skipping ${idbName}: unsupported PG_VERSION=${major}; no migration path.`,\n );\n return;\n }\n\n const loader = LEGACY_DUMPERS[major];\n if (!loader) {\n throw new Error(\n `No legacy dumper for supported PG_VERSION=${major} (${idbName}); ` +\n `SUPPORTED_PG_MAJORS and LEGACY_DUMPERS are out of sync.`,\n );\n }\n\n publishPhase(\"clone\");\n const handle = await backup.snapshot(idbName);\n\n let sql: string;\n try {\n publishPhase(\"dump\");\n const dump = await loader();\n sql = await dump(idbName);\n } catch (err) {\n await backup.discard(handle);\n throw err;\n }\n\n try {\n await clearFileData(idbName);\n publishPhase(\"restore\");\n await restoreDumpIntoIdb(idbName, sql);\n } catch (err) {\n await backup.rollback(handle, idbName, err);\n throw err;\n }\n await backup.commit(handle);\n}\n"],"names":[],"mappings":";;;;AAgCA,MAAM,iBAAuE,EAC3E,IAAI,YAAY;CACd,MAAM,CAAC,EAAE,QAAQ,gBAAgB,EAAE,YAAY,MAAM,QAAQ,IAAI,CAC/D,OAAO,qBACP,OAAO,iCACT,CAAC;CACD,OAAO,OAAO,YAAoB;EAChC,MAAM,WAAW,QAAQ,QAAQ,eAAe,EAAE;EAClD,MAAM,KAAK,IAAI,aAAa,SAAS,UAAU;EAC/C,IAAI;GACF,MAAM,GAAG;GAET,OAAO,OAAM,MADM,OAAO,EAAE,GAAG,CAAC,EAAA,CACd,KAAK;EACzB,UAAU;GACR,MAAM,GAAG,MAAM;EACjB;CACF;AACF,EACF;AAEA,eAAsB,cAAc,SAAgC;CAClE,MAAM,KAAK,MAAM,QAAQ,SAAA,IAAyB,mBAAmB;CACrE,IAAI;EACF,MA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ACA,IAAI;GACF,MAAM,GAAG,KAAK,GAAG;EACnB,SAAS,SAAS;GAChB,kBAAkB,SAAS,KAAK,OAAO;GACvC,MAAM;EACR;CACF,UAAU;EACR,MAAM,GAAG,MAAM;CACjB;AACF;AAEA,eAAsB,WACpB,SACA,cACA,QACe;CACf,MAAM,QAAQ,MAAM,kBAAkB,OAAO;CAC7C,IAAI,UAAU,QAAQ,UAAA,IAA4B;CAElD,IAAI,CAAC,kBAAkB,KAAK,GAAG;EAC7B,QAAQ,KACN,+BAA+B,QAAQ,2BAA2B,MAAM,qBAC1E;EACA;CACF;CAEA,MAAM,SAAS,eAAe;CAC9B,IAAI,CAAC,QACH,MAAM,IAAI,MACR,6CAA6C,MAAM,IAAI,QAAQ,2DAEjE;CAGF,aAAa,OAAO;CACpB,MAAM,SAAS,MAAM,OAAO,SAAS,OAAO;CAE5C,IAAI;CACJ,IAAI;EACF,aAAa,MAAM;EAEnB,MAAM,OAAM,MADO,OAAO,EAAA,CACT,OAAO;CAC1B,SAAS,KAAK;EACZ,MAAM,OAAO,QAAQ,MAAM;EAC3B,MAAM;CACR;CAEA,IAAI;EACF,MAAM,cAAc,OAAO;EAC3B,aAAa,SAAS;EACtB,MAAM,mBAAmB,SAAS,GAAG;CACvC,SAAS,KAAK;EACZ,MAAM,OAAO,SAAS,QAAQ,SAAS,GAAG;EAC1C,MAAM;CACR;CACA,MAAM,OAAO,OAAO,MAAM;AAC5B","debug_id":"406e9432-1e2d-544e-a5e2-46358ba484d3"}
|
|
1
|
+
{"version":3,"file":"pglite-migrate-core-B6FqmhH8.js","sources":["../src/utils/pglite-migrate-core.ts"],"sourcesContent":["import {\n createFileDataStore,\n IDB_DB_VERSION,\n IDB_STORE_NAME,\n idbError,\n openIdb,\n readPgVersionFile,\n} from \"./pglite-idb.js\";\nimport { CURRENT_PG_MAJOR, isMigratableMajor } from \"./pglite-major.js\";\n\nexport type MigrationPhase = \"clone\" | \"dump\" | \"restore\";\n\nexport type FileDataValue = {\n contents: Uint8Array | number[];\n mode: number;\n timestamp: Date | number;\n};\n\nexport type FileDataEntry = { key: IDBValidKey; value: FileDataValue };\n\n// Snapshots a data dir before migration and restores/discards it after. The\n// flag-off path persists to an IDB backup (with retention); the worker keeps\n// the snapshot in memory for same-run rollback only.\nexport interface BackupStrategy {\n snapshot(idbName: string): Promise<unknown>;\n rollback(handle: unknown, idbName: string, cause: unknown): Promise<void>;\n discard(handle: unknown): Promise<void>;\n commit(handle: unknown): Promise<void>;\n}\n\ntype LegacyDumper = (idbName: string) => Promise<string>;\n\nconst LEGACY_DUMPERS: Partial<Record<number, () => Promise<LegacyDumper>>> = {\n 16: async () => {\n const [{ PGlite: LegacyPGlite }, { pgDump }] = await Promise.all([\n import(\"pglite-legacy-02\"),\n import(\"pglite-tools-legacy-02/pg_dump\"),\n ]);\n return async (idbName: string) => {\n const stripped = idbName.replace(/^\\/pglite\\//, \"\");\n const pg = new LegacyPGlite(`idb://${stripped}`);\n try {\n await pg.waitReady;\n const file = await pgDump({ pg });\n return await file.text();\n } finally {\n await pg.close();\n }\n };\n },\n};\n\nexport async function clearFileData(idbName: string): Promise<void> {\n const db = await openIdb(idbName, IDB_DB_VERSION, createFileDataStore);\n try {\n await new Promise<void>((resolve, reject) => {\n const tx = db.transaction(IDB_STORE_NAME, \"readwrite\");\n tx.oncomplete = () => resolve();\n tx.onerror = () =>\n reject(idbError(tx, `FILE_DATA clear failed for ${idbName}`));\n tx.onabort = () =>\n reject(idbError(tx, `FILE_DATA clear aborted for ${idbName}`));\n tx.objectStore(IDB_STORE_NAME).clear();\n });\n } finally {\n db.close();\n }\n}\n\nexport async function readFileData(idbName: string): Promise<FileDataEntry[]> {\n const db = await openIdb(idbName, IDB_DB_VERSION, createFileDataStore);\n try {\n return await new Promise<FileDataEntry[]>((resolve, reject) => {\n const out: FileDataEntry[] = [];\n const req = db\n .transaction(IDB_STORE_NAME, \"readonly\")\n .objectStore(IDB_STORE_NAME)\n .openCursor();\n req.onerror = () =>\n reject(idbError(req, `FILE_DATA read cursor failed for ${idbName}`));\n req.onsuccess = () => {\n const cursor = req.result;\n if (!cursor) return resolve(out);\n out.push({ key: cursor.key, value: cursor.value as FileDataValue });\n cursor.continue();\n };\n });\n } finally {\n db.close();\n }\n}\n\nexport async function writeFileData(\n idbName: string,\n entries: FileDataEntry[],\n): Promise<void> {\n const db = await openIdb(idbName, IDB_DB_VERSION, createFileDataStore);\n try {\n await new Promise<void>((resolve, reject) => {\n const tx = db.transaction(IDB_STORE_NAME, \"readwrite\");\n tx.oncomplete = () => resolve();\n tx.onerror = () =>\n reject(idbError(tx, `FILE_DATA write failed for ${idbName}`));\n tx.onabort = () =>\n reject(idbError(tx, `FILE_DATA write aborted for ${idbName}`));\n const store = tx.objectStore(IDB_STORE_NAME);\n store.clear();\n for (const { key, value } of entries) {\n store.put(value, key);\n }\n });\n } finally {\n db.close();\n }\n}\n\nexport async function cloneFileData(\n sourceName: string,\n destName: string,\n): Promise<void> {\n await writeFileData(destName, await readFileData(sourceName));\n}\n\nfunction logRestoreFailure(idbName: string, sql: string, err: unknown): void {\n const errObj = err as {\n message?: string;\n position?: string | number;\n severity?: string;\n code?: string;\n detail?: string;\n where?: string;\n };\n const position =\n typeof errObj.position === \"string\"\n ? parseInt(errObj.position, 10)\n : typeof errObj.position === \"number\"\n ? errObj.position\n : NaN;\n\n console.error(`[pglite-migration] Restore failed for ${idbName}`, {\n message: errObj.message,\n code: errObj.code,\n severity: errObj.severity,\n detail: errObj.detail,\n where: errObj.where,\n position: errObj.position,\n sqlLength: sql.length,\n });\n\n if (Number.isFinite(position) && position > 0) {\n const zeroBased = position - 1;\n const start = Math.max(0, zeroBased - 200);\n const end = Math.min(sql.length, zeroBased + 200);\n console.error(\n `[pglite-migration] SQL context around position ${position}:\\n${sql.slice(start, zeroBased)}»${sql.slice(zeroBased, zeroBased + 1)}«${sql.slice(zeroBased + 1, end)}`,\n );\n } else {\n console.error(\n `[pglite-migration] No position info. First 2000 chars of dump:\\n${sql.slice(0, 2000)}`,\n );\n }\n}\n\nasync function restoreDumpIntoIdb(idbName: string, sql: string): Promise<void> {\n const stripped = idbName.replace(/^\\/pglite\\//, \"\");\n // Dynamic: a static import puts PGlite (~350 KB) in the app-loader chunk.\n const { PGlite } = await import(\"@electric-sql/pglite\");\n const pg = new PGlite(`idb://${stripped}`, { relaxedDurability: false });\n try {\n await pg.waitReady;\n // PG16 pg_dump emits doubled backslashes (escape-string form) without the\n // matching SET; PG17 defaults standard_conforming_strings on, breaking JSONB.\n try {\n await pg.exec(\"SET standard_conforming_strings = off;\");\n } catch (gucErr) {\n console.warn(\n \"[pglite-migration] Could not force standard_conforming_strings=off\",\n gucErr,\n );\n }\n try {\n await pg.exec(sql);\n } catch (execErr) {\n logRestoreFailure(idbName, sql, execErr);\n throw execErr;\n }\n } finally {\n await pg.close();\n }\n}\n\nexport async function migrateIdb(\n idbName: string,\n publishPhase: (phase: MigrationPhase) => void,\n backup: BackupStrategy,\n): Promise<void> {\n const major = await readPgVersionFile(idbName);\n if (major === null || major === CURRENT_PG_MAJOR) return;\n\n if (!isMigratableMajor(major)) {\n console.warn(\n `[pglite-migration] Skipping ${idbName}: unsupported PG_VERSION=${major}; no migration path.`,\n );\n return;\n }\n\n const loader = LEGACY_DUMPERS[major];\n if (!loader) {\n throw new Error(\n `No legacy dumper for supported PG_VERSION=${major} (${idbName}); ` +\n `SUPPORTED_PG_MAJORS and LEGACY_DUMPERS are out of sync.`,\n );\n }\n\n publishPhase(\"clone\");\n const handle = await backup.snapshot(idbName);\n\n let sql: string;\n try {\n publishPhase(\"dump\");\n const dump = await loader();\n sql = await dump(idbName);\n } catch (err) {\n await backup.discard(handle);\n throw err;\n }\n\n try {\n await clearFileData(idbName);\n publishPhase(\"restore\");\n await restoreDumpIntoIdb(idbName, sql);\n } catch (err) {\n await backup.rollback(handle, idbName, err);\n throw err;\n }\n await backup.commit(handle);\n}\n"],"names":[],"mappings":";;;;AAgCA,MAAM,iBAAuE,EAC3E,IAAI,Y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AAS,GAAG;CACvC,SAAS,KAAK;EACZ,MAAM,OAAO,SAAS,QAAQ,SAAS,GAAG;EAC1C,MAAM;CACR;CACA,MAAM,OAAO,OAAO,MAAM;AAC5B","debug_id":"5da8cb7b-a620-5ce6-af3d-4ff9a1ee1105"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { h as REACTOR_PGLITE_NAME, u as invalidateReactorPgMajorCache } from "./connection-state-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a32e4470-87d3-5ef4-9a29-c29eb675fdee")}catch(e){}}();
|
|
3
|
+
import { h as REACTOR_PGLITE_NAME, u as invalidateReactorPgMajorCache } from "./connection-state-B6YMctkg.js";
|
|
4
4
|
//#region src/utils/pglite-seed.ts
|
|
5
5
|
const PENDING_PG_SEED_KEY = "ph:pending-pg-seed";
|
|
6
6
|
/**
|
|
@@ -45,5 +45,5 @@ async function seedPendingPgVersion() {
|
|
|
45
45
|
//#endregion
|
|
46
46
|
export { seedPendingPgVersion as n, PENDING_PG_SEED_KEY as t };
|
|
47
47
|
|
|
48
|
-
//# sourceMappingURL=pglite-seed-
|
|
49
|
-
//# debugId=
|
|
48
|
+
//# sourceMappingURL=pglite-seed-Ben-06-w.js.map
|
|
49
|
+
//# debugId=a32e4470-87d3-5ef4-9a29-c29eb675fdee
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pglite-seed-
|
|
1
|
+
{"version":3,"file":"pglite-seed-Ben-06-w.js","sources":["../src/utils/pglite-seed.ts"],"sourcesContent":["import { invalidateReactorPgMajorCache } from \"./pglite-runtime.js\";\nimport { REACTOR_PGLITE_NAME } from \"./storage-namespace.js\";\n\nexport const PENDING_PG_SEED_KEY = \"ph:pending-pg-seed\";\n\n/**\n * If the Debug Inspector requested a forced PG version reset, this runs\n * before the reactor is created on the subsequent page load: opens a fresh\n * PGlite of the requested major against the reactor data dir, lets `initdb`\n * populate `PG_VERSION`, then closes. The next step of app boot then\n * detects this fresh data dir and picks the matching runtime.\n */\nexport async function seedPendingPgVersion(): Promise<void> {\n const raw = localStorage.getItem(PENDING_PG_SEED_KEY);\n if (!raw) return;\n\n const major = parseInt(raw, 10);\n console.info(`[pglite-seed] Seeding fresh PG${major} data dir...`);\n\n try {\n if (major === 16) {\n const { PGlite } = await import(\"pglite-legacy-02\");\n const pg = new PGlite(`idb://${REACTOR_PGLITE_NAME}`);\n try {\n await pg.waitReady;\n } finally {\n await pg.close();\n }\n } else if (major === 17) {\n const { PGlite } = await import(\"@electric-sql/pglite\");\n const pg = new PGlite(`idb://${REACTOR_PGLITE_NAME}`);\n try {\n await pg.waitReady;\n } finally {\n await pg.close();\n }\n } else {\n console.warn(`[pglite-seed] Unsupported version ${raw}, skipping`);\n return;\n }\n console.info(`[pglite-seed] Seeded PG${major} data dir.`);\n } finally {\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n invalidateReactorPgMajorCache();\n }\n}\n"],"names":[],"mappings":";;;;AAGA,MAAa,sBAAsB;;;;;;;;AASnC,eAAsB,uBAAsC;CAC1D,MAAM,MAAM,aAAa,QAAQ,mBAAmB;CACpD,IAAI,CAAC,KAAK;CAEV,MAAM,QAAQ,SAAS,KAAK,EAAE;CAC9B,QAAQ,KAAK,iCAAiC,MAAM,aAAa;CAEjE,IAAI;EACF,IAAI,UAAU,IAAI;GAChB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,qBAAqB;GACpD,IAAI;IACF,MAAM,GAAG;GACX,UAAU;IACR,MAAM,GAAG,MAAM;GACjB;EACF,OAAO,IAAI,UAAU,IAAI;GACvB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,qBAAqB;GACpD,IAAI;IACF,MAAM,GAAG;GACX,UAAU;IACR,MAAM,GAAG,MAAM;GACjB;EACF,OAAO;GACL,QAAQ,KAAK,qCAAqC,IAAI,WAAW;GACjE;EACF;EACA,QAAQ,KAAK,0BAA0B,MAAM,WAAW;CAC1D,UAAU;EACR,aAAa,WAAW,mBAAmB;EAC3C,8BAA8B;CAChC;AACF","debug_id":"a32e4470-87d3-5ef4-9a29-c29eb675fdee"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9a66dc28-1780-53ef-9cf2-dfd2949d7f85")}catch(e){}}();
|
|
3
3
|
import { a as genericConfigSchema, i as openPanelConfigSchema, n as vetraStudioConfigSchema, o as assistantConfigSchema, r as sentryConfigSchema, t as workflowsConnectConfigSchema } from "./workflows-C3qEvx1R.js";
|
|
4
4
|
import { DEFAULT_CONNECT_CONFIG } from "@powerhousedao/shared/connect";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -182,7 +182,7 @@ const driveSectionOff = {
|
|
|
182
182
|
const connectPlugins = {
|
|
183
183
|
[GENERIC_PLUGIN]: {
|
|
184
184
|
create: createGenericPlugin,
|
|
185
|
-
ui: () => import("./ui-
|
|
185
|
+
ui: () => import("./ui-CyxG0yU5.js").then((m) => m.default),
|
|
186
186
|
shell: "generic",
|
|
187
187
|
whenAbsent: (config) => ({
|
|
188
188
|
...config,
|
|
@@ -260,5 +260,5 @@ const connectPlugins = {
|
|
|
260
260
|
//#endregion
|
|
261
261
|
export { connectPlugins };
|
|
262
262
|
|
|
263
|
-
//# sourceMappingURL=plugins-
|
|
264
|
-
//# debugId=
|
|
263
|
+
//# sourceMappingURL=plugins-CoowJooW.js.map
|
|
264
|
+
//# debugId=9a66dc28-1780-53ef-9cf2-dfd2949d7f85
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-yBUPukgu.js","sources":["../src/plugins/entry-config.ts","../src/plugins/assistant.ts","../src/plugins/generic.ts","../src/plugins/openpanel.ts","../src/plugins/sentry.ts","../src/plugins/ids.ts","../src/plugins/vetra-studio.ts","../src/plugins/workflows.ts","../src/plugins/index.ts"],"sourcesContent":["import { PluginError } from \"@powerhousedao/host-core/plugins\";\nimport { z } from \"zod\";\n\n/**\n * Validate a built-in plugin's entry config against its configSchema, the way\n * host-core's resolveHostPlugins does on the server: a failure names the\n * plugin and every offending key instead of surfacing a bare ZodError from\n * the runtime-config load.\n */\nexport function parseEntryConfig<S extends z.ZodType>(\n specifier: string,\n schema: S,\n rawConfig: unknown,\n): z.output<S> {\n const parsed = schema.safeParse(rawConfig);\n if (!parsed.success) {\n throw new PluginError(\n `config for Connect plugin \"${specifier}\" is invalid:\\n` +\n z.prettifyError(parsed.error),\n `Fix the entry's config in the host's runner.plugins.`,\n );\n }\n return parsed.data;\n}\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n assistantConfigSchema,\n type AssistantConfigInput,\n} from \"../plugin-configs/assistant.js\";\n\n/**\n * The Connect AI assistant (`@powerhousedao/connect/plugins/assistant`).\n * Presence flips `ai.assistantEnabled` on; absence forces it off. The\n * assistant FAB in app.tsx already renders on `ai.assistantEnabled`, so this\n * plugin's config shuffle is immediately visible in the UI.\n *\n * It takes no entry config: `ai.assistantEnabled` is the only key of the\n * `connect.ai` slice, and presence is that switch. The endpoint and agent are\n * user settings in the browser, not host config.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { assistantConfigSchema, type AssistantConfigInput };\n\nexport const createAssistantPlugin: ConnectPluginFactory = (rawConfig) => {\n parseEntryConfig(\n \"@powerhousedao/connect/plugins/assistant\",\n assistantConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-assistant\",\n appliesTo: \"connect\",\n configSchema: assistantConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n ai: { ...served.ai, assistantEnabled: true },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createAssistantPlugin;\n","import { DEFAULT_CONNECT_CONFIG } from \"@powerhousedao/shared/connect\";\nimport type {\n PHBackground,\n PHConnectExplorerIcons,\n PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n genericConfigSchema,\n type GenericConfig,\n type GenericConfigInput,\n} from \"../plugin-configs/generic.js\";\n\n/**\n * The generic Connect shell plugin (`@powerhousedao/connect/plugins/generic`).\n *\n * It OWNS the drive-chrome UI toggles — `allowAddDrive` and the per-section\n * `sections.{remote,local}` switches (enabled / allowAdd / allowDelete) —\n * the explorer's `icons` (local/remote drive fallbacks, folder, document and\n * per-type document icons, which override the icons a package ships) and the\n * home screen's `homeBackground` (its layers over a page colour). These\n * describe nothing outside the generic chrome (connect.config.ts reads the\n * toggles to decide whether the add-drive affordance and the drive sections\n * render; the explorer components read the icons; the home screen is the\n * chrome's landing page), so under uniform runners they are configured HERE,\n * through this plugin's entry config, not as free-standing top-level\n * connect.drives / connect.home values:\n *\n * - present + entry provides a value -> that value\n * - present + entry omits it -> inherit DEFAULT_CONNECT_CONFIG\n * - absent from the composition -> zeroed off (see its whenAbsent\n * in ./index.ts — no chrome, no\n * toggles)\n *\n * The top-level served value is deliberately NOT a fallback: ownership means a\n * single source. `branding` is intentionally NOT handled here — it has reach\n * beyond the chrome (e.g. document.title), so it stays a Connect-level config\n * value that survives this plugin's absence.\n *\n * Icons and background images are image refs; a project path in host.js is\n * resolved to a data URI by the Connect build before the composition reaches\n * the browser, a URL or data URI passes through (the only forms for config\n * applied after the build). `null` keeps the built-in icon / gradient.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { genericConfigSchema, type GenericConfig, type GenericConfigInput };\n\nconst DEFAULT_DRIVES = DEFAULT_CONNECT_CONFIG.drives;\nconst DEFAULT_HOME = DEFAULT_CONNECT_CONFIG.home;\n\nexport const createGenericPlugin: ConnectPluginFactory = (rawConfig) => {\n const config: GenericConfig = parseEntryConfig(\n \"@powerhousedao/connect/plugins/generic\",\n genericConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-generic\",\n appliesTo: \"connect\",\n configSchema: genericConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n const entrySections = config.sections ?? {};\n return {\n ...served,\n drives: {\n ...served.drives,\n // Owned: entry value, else the single-source default — never the\n // served top-level value.\n allowAddDrive:\n config.allowAddDrive ?? DEFAULT_DRIVES?.allowAddDrive,\n sections: {\n remote: {\n ...DEFAULT_DRIVES?.sections?.remote,\n ...entrySections.remote,\n },\n local: {\n ...DEFAULT_DRIVES?.sections?.local,\n ...entrySections.local,\n },\n },\n // Owned: the entry's icons (already resolved by the build), else\n // the default — the built-in icons.\n icons: (config.icons ?? null) as PHConnectExplorerIcons | null,\n } as never,\n home: {\n ...served.home,\n // Owned: the entry's background (images resolved by the build),\n // else the default — the bundled gradient.\n background: (config.homeBackground ??\n DEFAULT_HOME?.background ??\n null) as PHBackground | null,\n },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createGenericPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n openPanelConfigSchema,\n type OpenPanelConfigInput,\n} from \"../plugin-configs/openpanel.js\";\n\n/**\n * OpenPanel analytics (`@powerhousedao/connect/plugins/openpanel`). Presence\n * is activation: the entry config (clientId, trackUiEvents, trackOperations)\n * merges into the served `openPanel` block; absence clears the clientId and\n * turns tracking off. Config shuffle today; the Analytics/OpenPanel\n * components that consume it already live in the app tree.\n *\n * The entry config IS the `connect.openPanel` slice, so it is typed and\n * validated by that slice's single-source schema (a typo'd key fails).\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { openPanelConfigSchema, type OpenPanelConfigInput };\n\nexport const createOpenPanelPlugin: ConnectPluginFactory = (rawConfig) => {\n const config = parseEntryConfig(\n \"@powerhousedao/connect/plugins/openpanel\",\n openPanelConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-openpanel\",\n appliesTo: \"connect\",\n configSchema: openPanelConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n openPanel: { ...served.openPanel, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createOpenPanelPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n sentryConfigSchema,\n type SentryConfigInput,\n} from \"../plugin-configs/sentry.js\";\n\n/**\n * Sentry error reporting (`@powerhousedao/connect/plugins/sentry`). Presence\n * is activation: listing it merges the entry config (dsn, env, tracing) into\n * the served `sentry` block; omitting it nulls the dsn (see the absence\n * zeroing in plugin-host). A thin config shuffle today — the SentryProvider\n * that reads this slice already exists in the app.\n *\n * The entry config IS the `connect.sentry` slice, so it is typed and\n * validated by that slice's single-source schema (a typo'd key fails).\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { sentryConfigSchema, type SentryConfigInput };\n\nexport const createSentryPlugin: ConnectPluginFactory = (rawConfig) => {\n const config = parseEntryConfig(\n \"@powerhousedao/connect/plugins/sentry\",\n sentryConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-sentry\",\n appliesTo: \"connect\",\n configSchema: sentryConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n sentry: { ...served.sentry, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createSentryPlugin;\n","/** The generic shell: Connect's sidebar, home screen and settings tabs. */\nexport const GENERIC_PLUGIN = \"@powerhousedao/connect/plugins/generic\";\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n vetraStudioConfigSchema,\n type VetraStudioConfigInput,\n} from \"../plugin-configs/vetra-studio.js\";\n\n/**\n * Vetra Studio, browser side (`@powerhousedao/vetra-studio/connect`). Its\n * presence turns Connect's studio mode on; the classic `app.studioMode`\n * consumer paths run unchanged, and absence forces studio off (the zeroing in\n * plugin-host). Lives here, in Connect's own source, because the studio-mode\n * behaviour is Connect browser behaviour — the published vetra-studio/connect\n * module is only the server-resolvable identity of the same plugin.\n *\n * It takes no entry config: presence is the switch, and the rest of the\n * `connect.app` slice is Connect-level config, not this plugin's.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { vetraStudioConfigSchema, type VetraStudioConfigInput };\n\nexport const createVetraStudioPlugin: ConnectPluginFactory = (rawConfig) => {\n parseEntryConfig(\n \"@powerhousedao/vetra-studio/connect\",\n vetraStudioConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"vetra-studio-connect\",\n appliesTo: \"connect\",\n configSchema: vetraStudioConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n app: { ...served.app, studioMode: true },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createVetraStudioPlugin;\n","import { findToken } from \"@powerhousedao/host-core/schema\";\nimport type {\n PHConnectDefaultDrive,\n PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n workflowsConnectConfigSchema,\n type WorkflowsConnectConfig,\n type WorkflowsConnectConfigInput,\n} from \"../plugin-configs/workflows.js\";\n\n/**\n * The workflows plugin, browser side (`@powerhousedao/connect/plugins/\n * workflows`) — the Connect half of the link whose server half is\n * `@powerhousedao/switchboard/plugins/workflows` (workflow-plugins plan).\n *\n * Presence is activation: listed, Connect loads the workflow package (so\n * Workflow Studio, the drive app the Workflows drive names as its preferred\n * editor, exists) and attaches the configured drive as a remote default\n * drive. Absent from a declared composition, `app.workflowsEnabled` is zeroed\n * (its whenAbsent in ./index.ts) — the classic `workflows.enabled` /\n * `connect.app.workflowsEnabled` values stop being the switch.\n *\n * `drive` is the switchboard's drive URL (`http://host:port/d/<slug>`). The\n * drive has to be a REMOTE of the switchboard that runs the workflow runtime:\n * Workflow Studio reaches that runtime through the selected drive's\n * switchboard, so a local copy would render the studio against the wrong\n * endpoint. Host files write it as the output token\n * `switchboard.drives.workflows.url`; `ph run` resolves it (from the\n * compound's live member or the switchboard's run record) before this\n * config reaches the browser.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport {\n workflowsConnectConfigSchema,\n type WorkflowsConnectConfig,\n type WorkflowsConnectConfigInput,\n};\n\nconst LOG = \"[connect:plugins:workflows]\";\n\nfunction withDrive(\n drives: PHConnectDefaultDrive[] | undefined,\n url: string,\n name: string | undefined,\n): PHConnectDefaultDrive[] {\n const existing = drives ?? [];\n if (existing.some((drive) => \"url\" in drive && drive.url === url)) {\n return existing;\n }\n return [...existing, { url, name: name ?? null, icon: null }];\n}\n\nexport const createWorkflowsPlugin: ConnectPluginFactory = (rawConfig) => {\n const config: WorkflowsConnectConfig = parseEntryConfig(\n \"@powerhousedao/connect/plugins/workflows\",\n workflowsConnectConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-workflows\",\n appliesTo: \"connect\",\n configSchema: workflowsConnectConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n const out: PHConnectRuntimeConfig = {\n ...served,\n app: { ...served.app, workflowsEnabled: true } as never,\n };\n const drive = config.drive;\n if (typeof drive === \"string\") {\n out.drives = {\n ...served.drives,\n defaultDrives: withDrive(\n served.drives?.defaultDrives,\n drive,\n config.name,\n ),\n } as never;\n } else if (drive !== undefined) {\n console.warn(\n `${LOG} drive is an unresolved output token (${findToken(drive)?.key ?? \"unknown\"}); no Workflows drive attached.`,\n );\n }\n return out;\n },\n },\n };\n return plugin;\n};\n\nexport default createWorkflowsPlugin;\n","import type { ConnectPluginDefinition } from \"@powerhousedao/connect-core/plugins\";\nimport createAssistantPlugin from \"./assistant.js\";\nimport createGenericPlugin from \"./generic.js\";\nimport createOpenPanelPlugin from \"./openpanel.js\";\nimport createSentryPlugin from \"./sentry.js\";\nimport { GENERIC_PLUGIN } from \"./ids.js\";\nimport createVetraStudioPlugin from \"./vetra-studio.js\";\nimport createWorkflowsPlugin from \"./workflows.js\";\n\nexport { GENERIC_PLUGIN };\n\n// Sentry and OpenPanel start only once the viewer accepts analytics cookies.\nconst ANALYTICS_CONSENT = { consent: true };\n\n// Each built-in zeroes the config slice it owns when a composition leaves it out.\nconst driveSectionOff = { enabled: false, allowAdd: false, allowDelete: false };\n\n/** Connect's built-in plugins, by the specifier a composition names. */\nexport const connectPlugins: Record<string, ConnectPluginDefinition> = {\n [GENERIC_PLUGIN]: {\n create: createGenericPlugin,\n ui: () => import(\"../generic/ui.js\").then((m) => m.default),\n shell: \"generic\",\n // The drive-chrome toggles, explorer icons and home screen go: no\n // add-drive affordance, the sections off, built-in icons, no home\n // background. Branding is not zeroed: it is Connect-level and outlives\n // the plugin.\n whenAbsent: (config) => ({\n ...config,\n drives: {\n ...config.drives,\n allowAddDrive: false,\n sections: { remote: driveSectionOff, local: driveSectionOff },\n icons: null,\n } as never,\n home: { ...config.home, background: null } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/sentry\": {\n create: createSentryPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n sentry: { ...config.sentry, dsn: null } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/openpanel\": {\n create: createOpenPanelPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n openPanel: {\n ...config.openPanel,\n clientId: \"\",\n trackUiEvents: false,\n trackOperations: false,\n } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/assistant\": {\n create: createAssistantPlugin,\n whenAbsent: (config) => ({\n ...config,\n ai: { ...config.ai, assistantEnabled: false } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/workflows\": {\n create: createWorkflowsPlugin,\n // The workflow package (Workflow Studio) loads only when the plugin is\n // composed in; the classic workflows.enabled value is not the switch.\n whenAbsent: (config) => ({\n ...config,\n app: { ...config.app, workflowsEnabled: false } as never,\n }),\n },\n \"@powerhousedao/vetra-studio/connect\": {\n create: createVetraStudioPlugin,\n // Studio sign-in (#studio-sign-in=<bearer>), for agents.\n ui: () => import(\"./vetra-studio/ui.js\").then((m) => m.default),\n whenAbsent: (config) => ({\n ...config,\n app: { ...config.app, studioM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K;IAAE,GAAG,OAAO;IAAK,YAAY;GAAM;EAC1C;CACF;AACF","debug_id":"0cdd696f-d776-5689-ab08-1d436decf18b"}
|
|
1
|
+
{"version":3,"file":"plugins-CoowJooW.js","sources":["../src/plugins/entry-config.ts","../src/plugins/assistant.ts","../src/plugins/generic.ts","../src/plugins/openpanel.ts","../src/plugins/sentry.ts","../src/plugins/ids.ts","../src/plugins/vetra-studio.ts","../src/plugins/workflows.ts","../src/plugins/index.ts"],"sourcesContent":["import { PluginError } from \"@powerhousedao/host-core/plugins\";\nimport { z } from \"zod\";\n\n/**\n * Validate a built-in plugin's entry config against its configSchema, the way\n * host-core's resolveHostPlugins does on the server: a failure names the\n * plugin and every offending key instead of surfacing a bare ZodError from\n * the runtime-config load.\n */\nexport function parseEntryConfig<S extends z.ZodType>(\n specifier: string,\n schema: S,\n rawConfig: unknown,\n): z.output<S> {\n const parsed = schema.safeParse(rawConfig);\n if (!parsed.success) {\n throw new PluginError(\n `config for Connect plugin \"${specifier}\" is invalid:\\n` +\n z.prettifyError(parsed.error),\n `Fix the entry's config in the host's runner.plugins.`,\n );\n }\n return parsed.data;\n}\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n assistantConfigSchema,\n type AssistantConfigInput,\n} from \"../plugin-configs/assistant.js\";\n\n/**\n * The Connect AI assistant (`@powerhousedao/connect/plugins/assistant`).\n * Presence flips `ai.assistantEnabled` on; absence forces it off. The\n * assistant FAB in app.tsx already renders on `ai.assistantEnabled`, so this\n * plugin's config shuffle is immediately visible in the UI.\n *\n * It takes no entry config: `ai.assistantEnabled` is the only key of the\n * `connect.ai` slice, and presence is that switch. The endpoint and agent are\n * user settings in the browser, not host config.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { assistantConfigSchema, type AssistantConfigInput };\n\nexport const createAssistantPlugin: ConnectPluginFactory = (rawConfig) => {\n parseEntryConfig(\n \"@powerhousedao/connect/plugins/assistant\",\n assistantConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-assistant\",\n appliesTo: \"connect\",\n configSchema: assistantConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n ai: { ...served.ai, assistantEnabled: true },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createAssistantPlugin;\n","import { DEFAULT_CONNECT_CONFIG } from \"@powerhousedao/shared/connect\";\nimport type {\n PHBackground,\n PHConnectExplorerIcons,\n PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n genericConfigSchema,\n type GenericConfig,\n type GenericConfigInput,\n} from \"../plugin-configs/generic.js\";\n\n/**\n * The generic Connect shell plugin (`@powerhousedao/connect/plugins/generic`).\n *\n * It OWNS the drive-chrome UI toggles — `allowAddDrive` and the per-section\n * `sections.{remote,local}` switches (enabled / allowAdd / allowDelete) —\n * the explorer's `icons` (local/remote drive fallbacks, folder, document and\n * per-type document icons, which override the icons a package ships) and the\n * home screen's `homeBackground` (its layers over a page colour). These\n * describe nothing outside the generic chrome (connect.config.ts reads the\n * toggles to decide whether the add-drive affordance and the drive sections\n * render; the explorer components read the icons; the home screen is the\n * chrome's landing page), so under uniform runners they are configured HERE,\n * through this plugin's entry config, not as free-standing top-level\n * connect.drives / connect.home values:\n *\n * - present + entry provides a value -> that value\n * - present + entry omits it -> inherit DEFAULT_CONNECT_CONFIG\n * - absent from the composition -> zeroed off (see its whenAbsent\n * in ./index.ts — no chrome, no\n * toggles)\n *\n * The top-level served value is deliberately NOT a fallback: ownership means a\n * single source. `branding` is intentionally NOT handled here — it has reach\n * beyond the chrome (e.g. document.title), so it stays a Connect-level config\n * value that survives this plugin's absence.\n *\n * Icons and background images are image refs; a project path in host.js is\n * resolved to a data URI by the Connect build before the composition reaches\n * the browser, a URL or data URI passes through (the only forms for config\n * applied after the build). `null` keeps the built-in icon / gradient.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { genericConfigSchema, type GenericConfig, type GenericConfigInput };\n\nconst DEFAULT_DRIVES = DEFAULT_CONNECT_CONFIG.drives;\nconst DEFAULT_HOME = DEFAULT_CONNECT_CONFIG.home;\n\nexport const createGenericPlugin: ConnectPluginFactory = (rawConfig) => {\n const config: GenericConfig = parseEntryConfig(\n \"@powerhousedao/connect/plugins/generic\",\n genericConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-generic\",\n appliesTo: \"connect\",\n configSchema: genericConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n const entrySections = config.sections ?? {};\n return {\n ...served,\n drives: {\n ...served.drives,\n // Owned: entry value, else the single-source default — never the\n // served top-level value.\n allowAddDrive:\n config.allowAddDrive ?? DEFAULT_DRIVES?.allowAddDrive,\n sections: {\n remote: {\n ...DEFAULT_DRIVES?.sections?.remote,\n ...entrySections.remote,\n },\n local: {\n ...DEFAULT_DRIVES?.sections?.local,\n ...entrySections.local,\n },\n },\n // Owned: the entry's icons (already resolved by the build), else\n // the default — the built-in icons.\n icons: (config.icons ?? null) as PHConnectExplorerIcons | null,\n } as never,\n home: {\n ...served.home,\n // Owned: the entry's background (images resolved by the build),\n // else the default — the bundled gradient.\n background: (config.homeBackground ??\n DEFAULT_HOME?.background ??\n null) as PHBackground | null,\n },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createGenericPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n openPanelConfigSchema,\n type OpenPanelConfigInput,\n} from \"../plugin-configs/openpanel.js\";\n\n/**\n * OpenPanel analytics (`@powerhousedao/connect/plugins/openpanel`). Presence\n * is activation: the entry config (clientId, trackUiEvents, trackOperations)\n * merges into the served `openPanel` block; absence clears the clientId and\n * turns tracking off. Config shuffle today; the Analytics/OpenPanel\n * components that consume it already live in the app tree.\n *\n * The entry config IS the `connect.openPanel` slice, so it is typed and\n * validated by that slice's single-source schema (a typo'd key fails).\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { openPanelConfigSchema, type OpenPanelConfigInput };\n\nexport const createOpenPanelPlugin: ConnectPluginFactory = (rawConfig) => {\n const config = parseEntryConfig(\n \"@powerhousedao/connect/plugins/openpanel\",\n openPanelConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-openpanel\",\n appliesTo: \"connect\",\n configSchema: openPanelConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n openPanel: { ...served.openPanel, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createOpenPanelPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n sentryConfigSchema,\n type SentryConfigInput,\n} from \"../plugin-configs/sentry.js\";\n\n/**\n * Sentry error reporting (`@powerhousedao/connect/plugins/sentry`). Presence\n * is activation: listing it merges the entry config (dsn, env, tracing) into\n * the served `sentry` block; omitting it nulls the dsn (see the absence\n * zeroing in plugin-host). A thin config shuffle today — the SentryProvider\n * that reads this slice already exists in the app.\n *\n * The entry config IS the `connect.sentry` slice, so it is typed and\n * validated by that slice's single-source schema (a typo'd key fails).\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { sentryConfigSchema, type SentryConfigInput };\n\nexport const createSentryPlugin: ConnectPluginFactory = (rawConfig) => {\n const config = parseEntryConfig(\n \"@powerhousedao/connect/plugins/sentry\",\n sentryConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-sentry\",\n appliesTo: \"connect\",\n configSchema: sentryConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n sentry: { ...served.sentry, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createSentryPlugin;\n","/** The generic shell: Connect's sidebar, home screen and settings tabs. */\nexport const GENERIC_PLUGIN = \"@powerhousedao/connect/plugins/generic\";\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n vetraStudioConfigSchema,\n type VetraStudioConfigInput,\n} from \"../plugin-configs/vetra-studio.js\";\n\n/**\n * Vetra Studio, browser side (`@powerhousedao/vetra-studio/connect`). Its\n * presence turns Connect's studio mode on; the classic `app.studioMode`\n * consumer paths run unchanged, and absence forces studio off (the zeroing in\n * plugin-host). Lives here, in Connect's own source, because the studio-mode\n * behaviour is Connect browser behaviour — the published vetra-studio/connect\n * module is only the server-resolvable identity of the same plugin.\n *\n * It takes no entry config: presence is the switch, and the rest of the\n * `connect.app` slice is Connect-level config, not this plugin's.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport { vetraStudioConfigSchema, type VetraStudioConfigInput };\n\nexport const createVetraStudioPlugin: ConnectPluginFactory = (rawConfig) => {\n parseEntryConfig(\n \"@powerhousedao/vetra-studio/connect\",\n vetraStudioConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"vetra-studio-connect\",\n appliesTo: \"connect\",\n configSchema: vetraStudioConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n app: { ...served.app, studioMode: true },\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createVetraStudioPlugin;\n","import { findToken } from \"@powerhousedao/host-core/schema\";\nimport type {\n PHConnectDefaultDrive,\n PHConnectRuntimeConfig,\n} from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\nimport { parseEntryConfig } from \"./entry-config.js\";\nimport {\n workflowsConnectConfigSchema,\n type WorkflowsConnectConfig,\n type WorkflowsConnectConfigInput,\n} from \"../plugin-configs/workflows.js\";\n\n/**\n * The workflows plugin, browser side (`@powerhousedao/connect/plugins/\n * workflows`) — the Connect half of the link whose server half is\n * `@powerhousedao/switchboard/plugins/workflows` (workflow-plugins plan).\n *\n * Presence is activation: listed, Connect loads the workflow package (so\n * Workflow Studio, the drive app the Workflows drive names as its preferred\n * editor, exists) and attaches the configured drive as a remote default\n * drive. Absent from a declared composition, `app.workflowsEnabled` is zeroed\n * (its whenAbsent in ./index.ts) — the classic `workflows.enabled` /\n * `connect.app.workflowsEnabled` values stop being the switch.\n *\n * `drive` is the switchboard's drive URL (`http://host:port/d/<slug>`). The\n * drive has to be a REMOTE of the switchboard that runs the workflow runtime:\n * Workflow Studio reaches that runtime through the selected drive's\n * switchboard, so a local copy would render the studio against the wrong\n * endpoint. Host files write it as the output token\n * `switchboard.drives.workflows.url`; `ph run` resolves it (from the\n * compound's live member or the switchboard's run record) before this\n * config reaches the browser.\n */\n\n// Schema and PHPluginConfigs augmentation: ../plugin-configs (zod-only).\nexport {\n workflowsConnectConfigSchema,\n type WorkflowsConnectConfig,\n type WorkflowsConnectConfigInput,\n};\n\nconst LOG = \"[connect:plugins:workflows]\";\n\nfunction withDrive(\n drives: PHConnectDefaultDrive[] | undefined,\n url: string,\n name: string | undefined,\n): PHConnectDefaultDrive[] {\n const existing = drives ?? [];\n if (existing.some((drive) => \"url\" in drive && drive.url === url)) {\n return existing;\n }\n return [...existing, { url, name: name ?? null, icon: null }];\n}\n\nexport const createWorkflowsPlugin: ConnectPluginFactory = (rawConfig) => {\n const config: WorkflowsConnectConfig = parseEntryConfig(\n \"@powerhousedao/connect/plugins/workflows\",\n workflowsConnectConfigSchema,\n rawConfig,\n );\n const plugin: ConnectPlugin = {\n name: \"connect-workflows\",\n appliesTo: \"connect\",\n configSchema: workflowsConnectConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n const out: PHConnectRuntimeConfig = {\n ...served,\n app: { ...served.app, workflowsEnabled: true } as never,\n };\n const drive = config.drive;\n if (typeof drive === \"string\") {\n out.drives = {\n ...served.drives,\n defaultDrives: withDrive(\n served.drives?.defaultDrives,\n drive,\n config.name,\n ),\n } as never;\n } else if (drive !== undefined) {\n console.warn(\n `${LOG} drive is an unresolved output token (${findToken(drive)?.key ?? \"unknown\"}); no Workflows drive attached.`,\n );\n }\n return out;\n },\n },\n };\n return plugin;\n};\n\nexport default createWorkflowsPlugin;\n","import type { ConnectPluginDefinition } from \"@powerhousedao/connect-core/plugins\";\nimport createAssistantPlugin from \"./assistant.js\";\nimport createGenericPlugin from \"./generic.js\";\nimport createOpenPanelPlugin from \"./openpanel.js\";\nimport createSentryPlugin from \"./sentry.js\";\nimport { GENERIC_PLUGIN } from \"./ids.js\";\nimport createVetraStudioPlugin from \"./vetra-studio.js\";\nimport createWorkflowsPlugin from \"./workflows.js\";\n\nexport { GENERIC_PLUGIN };\n\n// Sentry and OpenPanel start only once the viewer accepts analytics cookies.\nconst ANALYTICS_CONSENT = { consent: true };\n\n// Each built-in zeroes the config slice it owns when a composition leaves it out.\nconst driveSectionOff = { enabled: false, allowAdd: false, allowDelete: false };\n\n/** Connect's built-in plugins, by the specifier a composition names. */\nexport const connectPlugins: Record<string, ConnectPluginDefinition> = {\n [GENERIC_PLUGIN]: {\n create: createGenericPlugin,\n ui: () => import(\"../generic/ui.js\").then((m) => m.default),\n shell: \"generic\",\n // The drive-chrome toggles, explorer icons and home screen go: no\n // add-drive affordance, the sections off, built-in icons, no home\n // background. Branding is not zeroed: it is Connect-level and outlives\n // the plugin.\n whenAbsent: (config) => ({\n ...config,\n drives: {\n ...config.drives,\n allowAddDrive: false,\n sections: { remote: driveSectionOff, local: driveSectionOff },\n icons: null,\n } as never,\n home: { ...config.home, background: null } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/sentry\": {\n create: createSentryPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n sentry: { ...config.sentry, dsn: null } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/openpanel\": {\n create: createOpenPanelPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n openPanel: {\n ...config.openPanel,\n clientId: \"\",\n trackUiEvents: false,\n trackOperations: false,\n } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/assistant\": {\n create: createAssistantPlugin,\n whenAbsent: (config) => ({\n ...config,\n ai: { ...config.ai, assistantEnabled: false } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/workflows\": {\n create: createWorkflowsPlugin,\n // The workflow package (Workflow Studio) loads only when the plugin is\n // composed in; the classic workflows.enabled value is not the switch.\n whenAbsent: (config) => ({\n ...config,\n app: { ...config.app, workflowsEnabled: false } as never,\n }),\n },\n \"@powerhousedao/vetra-studio/connect\": {\n create: createVetraStudioPlugin,\n // Studio sign-in (#studio-sign-in=<bearer>), for agents.\n ui: () => import(\"./vetra-studio/ui.js\").then((m) => m.default),\n whenAbsent: (config) => ({\n ...config,\n app: { ...config.app, studioMode: false } as never,\n }),\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,SAAgB,iBACd,WACA,QACA,WACa;CACb,MAAM,SAAS,OAAO,UAAU,SAAS;CACzC,IAAI,CAAC,OAAO,SACV,MAAM,IAAI,YACR,8BAA8B,UAAU,mBACtC,EAAE,cAAc,OAAO,KAAK,GAC9B,sDACF;CAEF,OAAO,OAAO;AAChB;;;ACEA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BAA0D;EACpE,iBAAiB;EAChB,QAAQ;EACR,UAAU,OAAO,mBAAmB,CAAC,MAAM,MAAM,EAAE,OAAO;EAC1D,OAAO;EAKP,aAAa,YAAY;GACvB,GAAG;GACH,QAAQ;IACN,GAAG,OAAO;IACV,eAAe;IACf,UAAU;KAAE,QAAQ;KAAiB,OAAO;IAAgB;IAC5D,OAAO;GACT;GACA,MAAM;IAAE,GAAG,OAAO;IAAM,YAAY;GAAK;EAC3C;CACF;CACA,yCAAyC;EACvC,QAAQ;EACR,UAAU,QAAQ,QAAQ,iBAAiB;EAC3C,aAAa,YAAY;GACvB,GAAG;GACH,QAAQ;IAAE,GAAG,OAAO;IAAQ,KAAK;GAAK;EACxC;CACF;CACA,4CAA4C;EAC1C,QAAQ;EACR,UAAU,QAAQ,QAAQ,iBAAiB;EAC3C,aAAa,YAAY;GACvB,GAAG;GACH,WAAW;IACT,GAAG,OAAO;IACV,UAAU;IACV,eAAe;IACf,iBAAiB;GACnB;EACF;CACF;CACA,4CAA4C;EAC1C,QAAQ;EACR,aAAa,YAAY;GACvB,GAAG;GACH,IAAI;IAAE,GAAG,OAAO;IAAI,kBAAkB;GAAM;EAC9C;CACF;CACA,4CAA4C;EAC1C,QAAQ;EAGR,aAAa,YAAY;GACvB,GAAG;GACH,KAAK;IAAE,GAAG,OAAO;IAAK,kBAAkB;GAAM;EAChD;CACF;CACA,uCAAuC;EACrC,QAAQ;EAER,UAAU,OAAO,mBAAuB,CAAC,MAAM,MAAM,EAAE,OAAO;EAC9D,aAAa,YAAY;GACvB,GAAG;GACH,KAAK;IAAE,GAAG,OAAO;IAAK,YAAY;GAAM;EAC1C;CACF;AACF","debug_id":"9a66dc28-1780-53ef-9cf2-dfd2949d7f85"}
|
package/dist/prerender.js
CHANGED
|
@@ -120,7 +120,7 @@ async function loadDefaultConfig(variant) {
|
|
|
120
120
|
const plugin = (await shellPlugins())[variant];
|
|
121
121
|
await loadConnectPluginUi(plugin ? [{ module: plugin }] : []);
|
|
122
122
|
}
|
|
123
|
-
const connectPlugins = () => import("./plugins-
|
|
123
|
+
const connectPlugins = () => import("./plugins-CoowJooW.js").then((m) => m.connectPlugins);
|
|
124
124
|
/** Each prerendered shell's plugin, whose presence in a composition picks it; core's has none. */
|
|
125
125
|
async function shellPlugins() {
|
|
126
126
|
return Object.fromEntries(Object.entries(await connectPlugins()).flatMap(([module, definition]) => definition.shell ? [[definition.shell, module]] : []));
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="67189da7-4410-53b5-aede-5ee867dc2049")}catch(e){}}();
|
|
3
3
|
import { n as buildPHGlobalConfig, o as phGlobalConfig, r as connectConfig } from "./connect.config-DL9nKtlW.js";
|
|
4
|
-
import { a as isPackagedConnectDist, i as getVersion, n as getGitSha } from "./build-info-
|
|
5
|
-
import { i as pageSharedImports, r as getSharedDeps, t as BrowserPackageManager } from "./package-manager-
|
|
4
|
+
import { a as isPackagedConnectDist, i as getVersion, n as getGitSha } from "./build-info-D8mpFlVu.js";
|
|
5
|
+
import { i as pageSharedImports, r as getSharedDeps, t as BrowserPackageManager } from "./package-manager-CwPe8C9C.js";
|
|
6
6
|
import { r as toast } from "./toast-C6WW-_O-.js";
|
|
7
7
|
import { a as closeWithin, n as watchStoreLockWait, o as configureConnectChannelScheme, s as createConnectSignerConfig } from "./store-lock-Bi3B9VJD.js";
|
|
8
|
-
import { a as resolvePgMajorForRuntime, f as toStoredDocumentsRefused, r as loadPGliteModule } from "./pglite-major-
|
|
9
|
-
import { g as RELATIONAL_PGLITE_NAME, h as REACTOR_PGLITE_NAME, m as REACTOR_INSTANCE_NAMESPACE, n as getWorkerConnectionStatus, o as detectReactorPgMajor, r as setWorkerConnectionStatus, s as detectRelationalPgMajor, t as clearStorageHeld } from "./connection-state-
|
|
8
|
+
import { a as resolvePgMajorForRuntime, f as toStoredDocumentsRefused, r as loadPGliteModule } from "./pglite-major-pao-ozRo.js";
|
|
9
|
+
import { g as RELATIONAL_PGLITE_NAME, h as REACTOR_PGLITE_NAME, m as REACTOR_INSTANCE_NAMESPACE, n as getWorkerConnectionStatus, o as detectReactorPgMajor, r as setWorkerConnectionStatus, s as detectRelationalPgMajor, t as clearStorageHeld } from "./connection-state-B6YMctkg.js";
|
|
10
10
|
import { n as setDrivePlacements } from "./drive-placements-DjeVpTTm.js";
|
|
11
11
|
import { holdConnectRoutes } from "@powerhousedao/connect-core/router";
|
|
12
12
|
import { BrowserLocalStorage, DRIVE_DOCUMENT_TYPES, DocumentCache, DocumentChangeType, ReactorBuilder, ReactorClientBuilder, RegistryClient, addDrive, addPHEventHandlers, addRemoteDrive, createAnalyticsStore, createDriveChangeHandler, fetchDriveInfo, getFullReactorClient, getPHStore, isDriveAuthError, login, setAttachmentService, setDefaultPHGlobalConfig, setDocumentCache, setDriveMetadata, setDrives, setFeatures, setPGliteDB, setPHToast, setPackageDiscoveryService, setReactorClient, setReactorClientModule, setRenown, setSelectedDrive, setSelectedNode, setVetraPackageManager, trackDriveArrival, untilDriveListed, waitForDocumentReady } from "@powerhousedao/reactor-browser";
|
|
13
13
|
import { ConsoleLogger, logger, setLogLevel as setLogLevel$1 } from "document-model";
|
|
14
14
|
import { getConnectPluginUi } from "@powerhousedao/connect-core/plugins";
|
|
15
|
-
import { DrivePlacements, caughtUp, createAppReactorClient, findServedDrive, getAppDrives, getRuntimeConfig, keepsLocalCopy, planReactorClient, refreshAppDrives, relistAppDrives, resolveSwitchboardDrives, servedUrl, switchboardDrives } from "@powerhousedao/connect-core/runtime";
|
|
15
|
+
import { DrivePlacements, caughtUp, createAppReactorClient, findServedDrive, getAppDrives, getRuntimeConfig, keepsLocalCopy, localDrivePlacements, planReactorClient, refreshAppDrives, relistAppDrives, resolveSwitchboardDrives, servedUrl, switchboardDrives } from "@powerhousedao/connect-core/runtime";
|
|
16
16
|
import { switchboardOfDrive } from "@powerhousedao/shared/host-tokens";
|
|
17
17
|
import { createRelationalDb } from "@powerhousedao/shared/processors";
|
|
18
18
|
import { DocumentModelRegistry, DocumentModelResolver, HardenedPGliteDialect, LocalChannelFactory, LocalChannelPortRegistry, PGLITE_IDB_STORAGE_FACTS, ReactorEventTypes, createReactorHostModuleBase } from "@powerhousedao/reactor";
|
|
@@ -1329,6 +1329,7 @@ async function createReactor(localPackage, store) {
|
|
|
1329
1329
|
store.loading = true;
|
|
1330
1330
|
addPHEventHandlers();
|
|
1331
1331
|
setPHToast(toast);
|
|
1332
|
+
store.aiTools = () => import("./ai-tools-FwcvsTEc.js").then((tools) => tools.getConnectReactorTools());
|
|
1332
1333
|
const features = await initFeatureFlags();
|
|
1333
1334
|
logger.info("Features: @features", JSON.stringify(Object.fromEntries(features), null, 2));
|
|
1334
1335
|
const renownChainId = getRuntimeConfig().connect.renown?.chainId;
|
|
@@ -1384,6 +1385,7 @@ async function createReactor(localPackage, store) {
|
|
|
1384
1385
|
return router ? findServedDrive(router, drive) : void 0;
|
|
1385
1386
|
} });
|
|
1386
1387
|
const remoteBackends = runtimeConfig.connect.instance?.remoteBackends ?? [];
|
|
1388
|
+
const routerSettings = runtimeConfig.connect.instance?.router;
|
|
1387
1389
|
const remoteDriveUrl = remoteBackends.at(0)?.url ?? phGlobalConfig.defaultDrivesUrl;
|
|
1388
1390
|
const localReactor = async ({ localAsWorker }) => {
|
|
1389
1391
|
if (!localAsWorker) return createBrowserReactor(documentModelModules, upgradeManifests, renown, reactorFeatureFlags, discoveryService, createSignaturePolicy, renownEndpoints, unsupportedStoredDocuments, multiReactor);
|
|
@@ -1470,6 +1472,8 @@ async function createReactor(localPackage, store) {
|
|
|
1470
1472
|
localReactor,
|
|
1471
1473
|
remoteDriveUrl,
|
|
1472
1474
|
remoteBackends,
|
|
1475
|
+
collections: routerSettings?.newDrives ? localDrivePlacements(getDefaultDrives(runtimeConfig)) : void 0,
|
|
1476
|
+
router: routerSettings,
|
|
1473
1477
|
signer: renown.signer,
|
|
1474
1478
|
documentModelModules: loadedDocumentModels
|
|
1475
1479
|
});
|
|
@@ -1598,5 +1602,5 @@ function attachmentsOrigin(remoteBackendUrl, defaultDrivesUrl) {
|
|
|
1598
1602
|
//#endregion
|
|
1599
1603
|
export { createReactor as n, clearReactorStorage as t };
|
|
1600
1604
|
|
|
1601
|
-
//# sourceMappingURL=reactor-
|
|
1602
|
-
//# debugId=
|
|
1605
|
+
//# sourceMappingURL=reactor-DIt5d6RH.js.map
|
|
1606
|
+
//# debugId=67189da7-4410-53b5-aede-5ee867dc2049
|