@elizaos/capacitor-desktop 1.0.0 → 2.0.0-beta.1
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/esm/definitions.d.ts +28 -0
- package/dist/esm/definitions.d.ts.map +1 -1
- package/dist/esm/web.d.ts +8 -1
- package/dist/esm/web.d.ts.map +1 -1
- package/dist/esm/web.js +176 -51
- package/dist/plugin.cjs.js +176 -32
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +176 -32
- package/dist/plugin.js.map +1 -1
- package/package.json +7 -7
- package/electrobun/src/index.ts +0 -708
- package/electrobun/tsconfig.json +0 -16
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nconst loadWeb = () => import(\"./web\").then((m) => new m.DesktopWeb());\nexport const Desktop = registerPlugin(\"Desktop\", {\n web: loadWeb,\n});\n","import { WebPlugin } from \"@capacitor/core\";\n// No-op for features unavailable on web; callers should check return values.\nconst webUnavailable = (_feature) => { };\nexport class DesktopWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pluginListeners = [];\n }\n // System Tray - Not available in browser\n async createTray(_options) {\n webUnavailable(\"System tray\");\n }\n async updateTray(_options) {\n webUnavailable(\"System tray\");\n }\n async destroyTray() {\n webUnavailable(\"System tray\");\n }\n async setTrayMenu(_options) {\n webUnavailable(\"System tray\");\n }\n // Global Shortcuts - Not available in browser\n async registerShortcut(_options) {\n webUnavailable(\"Global shortcuts\");\n return { success: false };\n }\n async unregisterShortcut(_options) {\n webUnavailable(\"Global shortcuts\");\n }\n async unregisterAllShortcuts() {\n webUnavailable(\"Global shortcuts\");\n }\n async isShortcutRegistered(_options) {\n return { registered: false };\n }\n // Auto Launch - Not available in browser\n async setAutoLaunch(_options) {\n webUnavailable(\"Auto launch\");\n }\n async getAutoLaunchStatus() {\n return { enabled: false, openAsHidden: false };\n }\n // Window Management - Limited in browser\n async setWindowOptions(_options) {\n webUnavailable(\"Window options\");\n }\n async getWindowBounds() {\n return {\n x: window.screenX,\n y: window.screenY,\n width: window.outerWidth,\n height: window.outerHeight,\n };\n }\n async setWindowBounds(_options) {\n webUnavailable(\"Setting window bounds\");\n }\n async minimizeWindow() {\n webUnavailable(\"Window minimize\");\n }\n async maximizeWindow() {\n webUnavailable(\"Window maximize\");\n }\n async unmaximizeWindow() {\n webUnavailable(\"Window unmaximize\");\n }\n async closeWindow() {\n window.close();\n }\n async showWindow() {\n window.focus();\n }\n async hideWindow() {\n webUnavailable(\"Window hide\");\n }\n async focusWindow() {\n window.focus();\n }\n async isWindowMaximized() {\n return { maximized: false };\n }\n async isWindowMinimized() {\n return { minimized: document.hidden };\n }\n async isWindowVisible() {\n return { visible: !document.hidden };\n }\n async isWindowFocused() {\n return { focused: document.hasFocus() };\n }\n async setAlwaysOnTop(_options) {\n webUnavailable(\"Always on top\");\n }\n async setFullscreen(options) {\n options.flag\n ? document.documentElement.requestFullscreen()\n : document.exitFullscreen();\n }\n async setOpacity(_options) {\n webUnavailable(\"Window opacity\");\n }\n // Notifications - Using Web Notification API\n async showNotification(options) {\n const id = `notification_${Date.now()}`;\n if (!(\"Notification\" in window)) {\n return {\n id,\n shown: false,\n error: \"Notification API not available in this browser\",\n };\n }\n if (Notification.permission === \"denied\") {\n return { id, shown: false, error: \"Notification permission denied\" };\n }\n if (Notification.permission !== \"granted\") {\n const permission = await Notification.requestPermission();\n if (permission !== \"granted\") {\n return {\n id,\n shown: false,\n error: \"Notification permission not granted\",\n };\n }\n }\n const notification = new Notification(options.title, {\n body: options.body,\n icon: options.icon,\n silent: options.silent,\n });\n notification.onclick = () => this.notifyListeners(\"notificationClick\", {});\n return { id, shown: true };\n }\n async closeNotification(_options) {\n // Web Notification API doesn't provide a way to close notifications by ID.\n // Notifications auto-close or the user dismisses them.\n }\n // Power Monitor\n async getPowerState() {\n const getBattery = navigator.getBattery;\n if (getBattery) {\n try {\n const battery = await getBattery.call(navigator);\n return {\n onBattery: !battery.charging,\n batteryLevel: battery.level * 100,\n isCharging: battery.charging,\n idleState: \"active\", // Idle detection not available on web\n idleTime: 0,\n };\n }\n catch (err) {\n console.debug(\"[Desktop] Battery API access failed:\", err);\n }\n }\n return {\n onBattery: false, // Unknown, defaulting to false\n idleState: \"unknown\",\n idleTime: 0,\n };\n }\n // App\n async quit() {\n window.close();\n }\n async relaunch() {\n window.location.reload();\n }\n async getVersion() {\n // On web platform, version info is limited. Return actual browser info where available.\n // Note: \"version\" and \"name\" would need to come from app config - returning \"unknown\" to indicate unavailability\n return {\n version: \"unknown\", // App version not available on web - would need to be injected at build time\n name: \"unknown\", // App name not available on web - would need to be injected at build time\n runtime: \"N/A\", // Not running in the desktop runtime\n chrome: navigator.userAgent.match(/Chrome\\/([0-9.]+)/)?.[1] ?? \"unknown\",\n node: \"N/A\", // Not running in Node\n };\n }\n async isPackaged() {\n return { packaged: false };\n }\n async getPath(_options) {\n throw new Error(\"File system paths are not available in browser environment\");\n }\n // Clipboard\n async writeToClipboard(options) {\n if (options.text) {\n await navigator.clipboard.writeText(options.text);\n return;\n }\n if (options.html) {\n await navigator.clipboard.write([\n new ClipboardItem({\n \"text/html\": new Blob([options.html], { type: \"text/html\" }),\n }),\n ]);\n }\n }\n async readFromClipboard() {\n return { text: await navigator.clipboard.readText(), hasImage: false };\n }\n async clearClipboard() {\n await navigator.clipboard.writeText(\"\");\n }\n // Shell\n async openExternal(options) {\n window.open(options.url, \"_blank\");\n }\n async showItemInFolder(_options) {\n webUnavailable(\"Show in folder\");\n }\n async beep() {\n const ctx = new AudioContext();\n const osc = ctx.createOscillator();\n const gain = ctx.createGain();\n osc.connect(gain).connect(ctx.destination);\n osc.frequency.value = 800;\n osc.type = \"sine\";\n gain.gain.setValueAtTime(0.3, ctx.currentTime);\n gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.1);\n osc.start(ctx.currentTime);\n osc.stop(ctx.currentTime + 0.1);\n }\n // Events\n async addListener(eventName, listenerFunc) {\n const entry = { eventName, callback: listenerFunc };\n // Create and track window event listeners to avoid memory leaks\n if (eventName === \"windowFocus\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"focus\", entry.windowListener);\n }\n else if (eventName === \"windowBlur\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.push(entry);\n return {\n remove: async () => {\n const i = this.pluginListeners.indexOf(entry);\n if (i >= 0) {\n // Remove window event listener if it exists\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.splice(i, 1);\n }\n },\n };\n }\n async removeAllListeners() {\n // Clean up all window event listeners before clearing\n for (const entry of this.pluginListeners) {\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n }\n this.pluginListeners = [];\n }\n notifyListeners(eventName, data) {\n this.pluginListeners\n .filter((l) => l.eventName === eventName)\n .forEach((l) => {\n l.callback(data);\n });\n }\n}\n"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AACzD,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AACjD,IAAI,GAAG,EAAE,OAAO;AAChB,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC;AAC3B,QAAQ,IAAI,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index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nconst loadWeb = () => import(\"./web\").then((m) => new m.DesktopWeb());\nexport const Desktop = registerPlugin(\"Desktop\", {\n web: loadWeb,\n});\n","import { WebPlugin } from \"@capacitor/core\";\nconst BROWSER_PERMISSION_IDS = new Set([\n \"camera\",\n \"microphone\",\n \"location\",\n \"notifications\",\n]);\nfunction getDesktopRpc() {\n const g = globalThis;\n if (typeof window !== \"undefined\") {\n return window.__ELIZA_ELECTROBUN_RPC__;\n }\n return g.window?.__ELIZA_ELECTROBUN_RPC__ ?? g.__ELIZA_ELECTROBUN_RPC__;\n}\nfunction currentPlatform() {\n const proc = globalThis.process;\n const p = proc?.platform;\n if (p === \"darwin\" || p === \"win32\" || p === \"linux\")\n return p;\n if (typeof navigator !== \"undefined\") {\n const platform = navigator.platform.toLowerCase();\n if (platform.includes(\"mac\"))\n return \"darwin\";\n if (platform.includes(\"win\"))\n return \"win32\";\n }\n return \"linux\";\n}\nfunction isRecord(value) {\n return Boolean(value) && typeof value === \"object\";\n}\nfunction isDesktopPermissionState(value, id) {\n return (isRecord(value) &&\n value.id === id &&\n typeof value.status === \"string\" &&\n typeof value.canRequest === \"boolean\" &&\n typeof value.lastChecked === \"number\");\n}\nfunction stateFromStatus(id, status, options = {}) {\n const state = {\n id,\n status,\n lastChecked: options.lastChecked ?? Date.now(),\n canRequest: options.canRequest ?? status === \"not-determined\",\n platform: options.platform ?? currentPlatform(),\n };\n if (options.lastRequested !== undefined) {\n state.lastRequested = options.lastRequested;\n }\n if (options.restrictedReason !== undefined) {\n state.restrictedReason = options.restrictedReason;\n }\n return state;\n}\nfunction mapBrowserPermissionState(state) {\n if (state === \"granted\")\n return \"granted\";\n if (state === \"denied\")\n return \"denied\";\n if (state === \"prompt\" || state === \"default\")\n return \"not-determined\";\n return null;\n}\nasync function queryBrowserPermission(id) {\n if (!BROWSER_PERMISSION_IDS.has(id) || typeof navigator === \"undefined\") {\n return null;\n }\n if (id === \"notifications\" && typeof Notification !== \"undefined\") {\n const status = mapBrowserPermissionState(Notification.permission);\n return status ? stateFromStatus(id, status) : null;\n }\n if (!navigator.permissions?.query) {\n return null;\n }\n const permissionName = id === \"location\" ? \"geolocation\" : id;\n try {\n const result = await navigator.permissions.query({\n name: permissionName,\n });\n const status = mapBrowserPermissionState(result.state);\n return status ? stateFromStatus(id, status) : null;\n }\n catch {\n return null;\n }\n}\nasync function requestBrowserPermission(id) {\n if (!BROWSER_PERMISSION_IDS.has(id) || typeof navigator === \"undefined\") {\n return null;\n }\n if (id === \"camera\" || id === \"microphone\") {\n try {\n const stream = await navigator.mediaDevices?.getUserMedia?.({\n video: id === \"camera\",\n audio: id === \"microphone\",\n });\n for (const track of stream?.getTracks?.() ?? []) {\n track.stop();\n }\n }\n catch {\n // Query below returns denied when the browser recorded a denial.\n }\n const checked = await queryBrowserPermission(id);\n return checked ? { ...checked, lastRequested: Date.now() } : null;\n }\n if (id === \"location\" && navigator.geolocation) {\n const requestedStatus = await new Promise((resolve) => {\n navigator.geolocation.getCurrentPosition(() => resolve(\"granted\"), (err) => resolve(err.code === err.PERMISSION_DENIED ? \"denied\" : null), { maximumAge: 0, timeout: 10000 });\n });\n const checked = await queryBrowserPermission(id);\n if (checked)\n return { ...checked, lastRequested: Date.now() };\n return requestedStatus\n ? stateFromStatus(id, requestedStatus, { lastRequested: Date.now() })\n : null;\n }\n if (id === \"notifications\" && typeof Notification !== \"undefined\") {\n const status = mapBrowserPermissionState(await Notification.requestPermission());\n return status\n ? stateFromStatus(id, status, { lastRequested: Date.now() })\n : null;\n }\n return queryBrowserPermission(id);\n}\nexport class DesktopWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pluginListeners = [];\n }\n // System Tray - Not available in browser\n async createTray(_options) { }\n async updateTray(_options) { }\n async destroyTray() { }\n async setTrayMenu(_options) { }\n // Global Shortcuts - Not available in browser\n async registerShortcut(_options) {\n return { success: false };\n }\n async unregisterShortcut(_options) { }\n async unregisterAllShortcuts() { }\n async isShortcutRegistered(_options) {\n return { registered: false };\n }\n // Auto Launch - Not available in browser\n async setAutoLaunch(_options) { }\n async getAutoLaunchStatus() {\n return { enabled: false, openAsHidden: false };\n }\n // Window Management - Limited in browser\n async setWindowOptions(_options) { }\n async getWindowBounds() {\n return {\n x: window.screenX,\n y: window.screenY,\n width: window.outerWidth,\n height: window.outerHeight,\n };\n }\n async setWindowBounds(_options) { }\n async minimizeWindow() { }\n async maximizeWindow() { }\n async unmaximizeWindow() { }\n async closeWindow() {\n window.close();\n }\n async showWindow() {\n window.focus();\n }\n async hideWindow() { }\n async focusWindow() {\n window.focus();\n }\n async isWindowMaximized() {\n return { maximized: false };\n }\n async isWindowMinimized() {\n return { minimized: document.hidden };\n }\n async isWindowVisible() {\n return { visible: !document.hidden };\n }\n async isWindowFocused() {\n return { focused: document.hasFocus() };\n }\n async setAlwaysOnTop(_options) { }\n async setFullscreen(options) {\n options.flag\n ? document.documentElement.requestFullscreen()\n : document.exitFullscreen();\n }\n async setOpacity(_options) { }\n // Notifications - Using Web Notification API\n async showNotification(options) {\n const id = `notification_${Date.now()}`;\n if (!(\"Notification\" in window)) {\n return {\n id,\n shown: false,\n error: \"Notification API not available in this browser\",\n };\n }\n if (Notification.permission === \"denied\") {\n return { id, shown: false, error: \"Notification permission denied\" };\n }\n if (Notification.permission !== \"granted\") {\n const permission = await Notification.requestPermission();\n if (permission !== \"granted\") {\n return {\n id,\n shown: false,\n error: \"Notification permission not granted\",\n };\n }\n }\n const notification = new Notification(options.title, {\n body: options.body,\n icon: options.icon,\n silent: options.silent,\n });\n notification.onclick = () => this.notifyListeners(\"notificationClick\", {});\n return { id, shown: true };\n }\n async closeNotification(_options) {\n // Web Notification API doesn't provide a way to close notifications by ID.\n // Notifications auto-close or the user dismisses them.\n }\n // Power Monitor\n async getPowerState() {\n const getBattery = navigator.getBattery;\n if (getBattery) {\n try {\n const battery = await getBattery.call(navigator);\n return {\n onBattery: !battery.charging,\n batteryLevel: battery.level * 100,\n isCharging: battery.charging,\n idleState: \"active\", // Idle detection not available on web\n idleTime: 0,\n };\n }\n catch (err) {\n console.debug(\"[Desktop] Battery API access failed:\", err);\n }\n }\n return {\n onBattery: false, // Unknown, defaulting to false\n idleState: \"unknown\",\n idleTime: 0,\n };\n }\n // App\n async quit() {\n window.close();\n }\n async relaunch() {\n window.location.reload();\n }\n async getVersion() {\n // On web platform, version info is limited. Return actual browser info where available.\n // Note: \"version\" and \"name\" would need to come from app config - returning \"unknown\" to indicate unavailability\n return {\n version: \"unknown\", // App version not available on web - would need to be injected at build time\n name: \"unknown\", // App name not available on web - would need to be injected at build time\n runtime: \"N/A\", // Not running in the desktop runtime\n chrome: navigator.userAgent.match(/Chrome\\/([0-9.]+)/)?.[1] ?? \"unknown\",\n node: \"N/A\", // Not running in Node\n };\n }\n async isPackaged() {\n return { packaged: false };\n }\n async getPath(_options) {\n throw new Error(\"File system paths are not available in browser environment\");\n }\n // Clipboard\n async writeToClipboard(options) {\n if (options.text) {\n await navigator.clipboard.writeText(options.text);\n return;\n }\n if (options.html) {\n await navigator.clipboard.write([\n new ClipboardItem({\n \"text/html\": new Blob([options.html], { type: \"text/html\" }),\n }),\n ]);\n }\n }\n async readFromClipboard() {\n return { text: await navigator.clipboard.readText(), hasImage: false };\n }\n async clearClipboard() {\n await navigator.clipboard.writeText(\"\");\n }\n // Shell\n async openExternal(options) {\n window.open(options.url, \"_blank\");\n }\n async showItemInFolder(_options) { }\n async beep() {\n const ctx = new AudioContext();\n const osc = ctx.createOscillator();\n const gain = ctx.createGain();\n osc.connect(gain).connect(ctx.destination);\n osc.frequency.value = 800;\n osc.type = \"sine\";\n gain.gain.setValueAtTime(0.3, ctx.currentTime);\n gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.1);\n osc.start(ctx.currentTime);\n osc.stop(ctx.currentTime + 0.1);\n }\n // Events\n async addListener(eventName, listenerFunc) {\n const entry = { eventName, callback: listenerFunc };\n // Create and track window event listeners to avoid memory leaks\n if (eventName === \"windowFocus\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"focus\", entry.windowListener);\n }\n else if (eventName === \"windowBlur\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.push(entry);\n return {\n remove: async () => {\n const i = this.pluginListeners.indexOf(entry);\n if (i >= 0) {\n // Remove window event listener if it exists\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.splice(i, 1);\n }\n },\n };\n }\n async removeAllListeners() {\n // Clean up all window event listeners before clearing\n for (const entry of this.pluginListeners) {\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n }\n this.pluginListeners = [];\n }\n notifyListeners(eventName, data) {\n this.pluginListeners\n .filter((l) => l.eventName === eventName)\n .forEach((l) => {\n l.callback(data);\n });\n }\n async checkPermission(options) {\n const rpc = getDesktopRpc();\n const request = rpc?.request?.permissionsCheck;\n if (request) {\n const bridged = await request.call(rpc.request, { id: options.id });\n if (isDesktopPermissionState(bridged, options.id))\n return bridged;\n }\n const browserState = await queryBrowserPermission(options.id);\n if (browserState)\n return browserState;\n return {\n id: options.id,\n status: \"not-applicable\",\n restrictedReason: \"platform_unsupported\",\n lastChecked: Date.now(),\n canRequest: false,\n platform: currentPlatform(),\n };\n }\n async requestPermission(options) {\n const rpc = getDesktopRpc();\n const request = rpc?.request?.permissionsRequest;\n if (request) {\n const bridged = await request.call(rpc.request, { id: options.id });\n if (isDesktopPermissionState(bridged, options.id)) {\n if (bridged.status === \"not-determined\" &&\n BROWSER_PERMISSION_IDS.has(options.id)) {\n return (await requestBrowserPermission(options.id)) ?? bridged;\n }\n return bridged;\n }\n }\n return ((await requestBrowserPermission(options.id)) ??\n this.checkPermission({ id: options.id }));\n }\n}\n"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AACzD,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AACjD,IAAI,GAAG,EAAE,OAAO;AAChB,CAAC;;ACJD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;AACvC,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,UAAU;AACd,IAAI,eAAe;AACnB,CAAC,CAAC;AACF,SAAS,aAAa,GAAG;AACzB,IAAI,MAAM,CAAC,GAAG,UAAU;AACxB,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM,CAAC,wBAAwB;AAC9C,IAAI;AACJ,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,wBAAwB,IAAI,CAAC,CAAC,wBAAwB;AAC3E;AACA,SAAS,eAAe,GAAG;AAC3B,IAAI,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO;AACnC,IAAI,MAAM,CAAC,GAAG,IAAI,EAAE,QAAQ;AAC5B,IAAI,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,OAAO;AACxD,QAAQ,OAAO,CAAC;AAChB,IAAI,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;AAC1C,QAAQ,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE;AACzD,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;AACpC,YAAY,OAAO,QAAQ;AAC3B,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;AACpC,YAAY,OAAO,OAAO;AAC1B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7B,YAAY,QAAQ,EAAE,eAAe,EAAE;AACvC,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,iBAAiB,CAAC,OAAO,EAAE;AACrC,QAAQ,MAAM,GAAG,GAAG,aAAa,EAAE;AACnC,QAAQ,MAAM,OAAO,GAAG,GAAG,EAAE,OAAO,EAAE,kBAAkB;AACxD,QAAQ,IAAI,OAAO,EAAE;AACrB,YAAY,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;AAC/E,YAAY,IAAI,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE;AAC/D,gBAAgB,IAAI,OAAO,CAAC,MAAM,KAAK,gBAAgB;AACvD,oBAAoB,sBAAsB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;AAC5D,oBAAoB,OAAO,CAAC,MAAM,wBAAwB,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,OAAO;AAClF,gBAAgB;AAChB,gBAAgB,OAAO,OAAO;AAC9B,YAAY;AACZ,QAAQ;AACR,QAAQ,QAAQ,CAAC,MAAM,wBAAwB,CAAC,OAAO,CAAC,EAAE,CAAC;AAC3D,YAAY,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;AACpD,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -6,40 +6,156 @@ var capacitorDesktop = (function (exports, core) {
|
|
|
6
6
|
web: loadWeb,
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
+
const BROWSER_PERMISSION_IDS = new Set([
|
|
10
|
+
"camera",
|
|
11
|
+
"microphone",
|
|
12
|
+
"location",
|
|
13
|
+
"notifications",
|
|
14
|
+
]);
|
|
15
|
+
function getDesktopRpc() {
|
|
16
|
+
const g = globalThis;
|
|
17
|
+
if (typeof window !== "undefined") {
|
|
18
|
+
return window.__ELIZA_ELECTROBUN_RPC__;
|
|
19
|
+
}
|
|
20
|
+
return g.window?.__ELIZA_ELECTROBUN_RPC__ ?? g.__ELIZA_ELECTROBUN_RPC__;
|
|
21
|
+
}
|
|
22
|
+
function currentPlatform() {
|
|
23
|
+
const proc = globalThis.process;
|
|
24
|
+
const p = proc?.platform;
|
|
25
|
+
if (p === "darwin" || p === "win32" || p === "linux")
|
|
26
|
+
return p;
|
|
27
|
+
if (typeof navigator !== "undefined") {
|
|
28
|
+
const platform = navigator.platform.toLowerCase();
|
|
29
|
+
if (platform.includes("mac"))
|
|
30
|
+
return "darwin";
|
|
31
|
+
if (platform.includes("win"))
|
|
32
|
+
return "win32";
|
|
33
|
+
}
|
|
34
|
+
return "linux";
|
|
35
|
+
}
|
|
36
|
+
function isRecord(value) {
|
|
37
|
+
return Boolean(value) && typeof value === "object";
|
|
38
|
+
}
|
|
39
|
+
function isDesktopPermissionState(value, id) {
|
|
40
|
+
return (isRecord(value) &&
|
|
41
|
+
value.id === id &&
|
|
42
|
+
typeof value.status === "string" &&
|
|
43
|
+
typeof value.canRequest === "boolean" &&
|
|
44
|
+
typeof value.lastChecked === "number");
|
|
45
|
+
}
|
|
46
|
+
function stateFromStatus(id, status, options = {}) {
|
|
47
|
+
const state = {
|
|
48
|
+
id,
|
|
49
|
+
status,
|
|
50
|
+
lastChecked: options.lastChecked ?? Date.now(),
|
|
51
|
+
canRequest: options.canRequest ?? status === "not-determined",
|
|
52
|
+
platform: options.platform ?? currentPlatform(),
|
|
53
|
+
};
|
|
54
|
+
if (options.lastRequested !== undefined) {
|
|
55
|
+
state.lastRequested = options.lastRequested;
|
|
56
|
+
}
|
|
57
|
+
if (options.restrictedReason !== undefined) {
|
|
58
|
+
state.restrictedReason = options.restrictedReason;
|
|
59
|
+
}
|
|
60
|
+
return state;
|
|
61
|
+
}
|
|
62
|
+
function mapBrowserPermissionState(state) {
|
|
63
|
+
if (state === "granted")
|
|
64
|
+
return "granted";
|
|
65
|
+
if (state === "denied")
|
|
66
|
+
return "denied";
|
|
67
|
+
if (state === "prompt" || state === "default")
|
|
68
|
+
return "not-determined";
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
async function queryBrowserPermission(id) {
|
|
72
|
+
if (!BROWSER_PERMISSION_IDS.has(id) || typeof navigator === "undefined") {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
if (id === "notifications" && typeof Notification !== "undefined") {
|
|
76
|
+
const status = mapBrowserPermissionState(Notification.permission);
|
|
77
|
+
return status ? stateFromStatus(id, status) : null;
|
|
78
|
+
}
|
|
79
|
+
if (!navigator.permissions?.query) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const permissionName = id === "location" ? "geolocation" : id;
|
|
83
|
+
try {
|
|
84
|
+
const result = await navigator.permissions.query({
|
|
85
|
+
name: permissionName,
|
|
86
|
+
});
|
|
87
|
+
const status = mapBrowserPermissionState(result.state);
|
|
88
|
+
return status ? stateFromStatus(id, status) : null;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async function requestBrowserPermission(id) {
|
|
95
|
+
if (!BROWSER_PERMISSION_IDS.has(id) || typeof navigator === "undefined") {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
if (id === "camera" || id === "microphone") {
|
|
99
|
+
try {
|
|
100
|
+
const stream = await navigator.mediaDevices?.getUserMedia?.({
|
|
101
|
+
video: id === "camera",
|
|
102
|
+
audio: id === "microphone",
|
|
103
|
+
});
|
|
104
|
+
for (const track of stream?.getTracks?.() ?? []) {
|
|
105
|
+
track.stop();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// Query below returns denied when the browser recorded a denial.
|
|
110
|
+
}
|
|
111
|
+
const checked = await queryBrowserPermission(id);
|
|
112
|
+
return checked ? { ...checked, lastRequested: Date.now() } : null;
|
|
113
|
+
}
|
|
114
|
+
if (id === "location" && navigator.geolocation) {
|
|
115
|
+
const requestedStatus = await new Promise((resolve) => {
|
|
116
|
+
navigator.geolocation.getCurrentPosition(() => resolve("granted"), (err) => resolve(err.code === err.PERMISSION_DENIED ? "denied" : null), { maximumAge: 0, timeout: 10000 });
|
|
117
|
+
});
|
|
118
|
+
const checked = await queryBrowserPermission(id);
|
|
119
|
+
if (checked)
|
|
120
|
+
return { ...checked, lastRequested: Date.now() };
|
|
121
|
+
return requestedStatus
|
|
122
|
+
? stateFromStatus(id, requestedStatus, { lastRequested: Date.now() })
|
|
123
|
+
: null;
|
|
124
|
+
}
|
|
125
|
+
if (id === "notifications" && typeof Notification !== "undefined") {
|
|
126
|
+
const status = mapBrowserPermissionState(await Notification.requestPermission());
|
|
127
|
+
return status
|
|
128
|
+
? stateFromStatus(id, status, { lastRequested: Date.now() })
|
|
129
|
+
: null;
|
|
130
|
+
}
|
|
131
|
+
return queryBrowserPermission(id);
|
|
132
|
+
}
|
|
9
133
|
class DesktopWeb extends core.WebPlugin {
|
|
10
134
|
constructor() {
|
|
11
135
|
super(...arguments);
|
|
12
136
|
this.pluginListeners = [];
|
|
13
137
|
}
|
|
14
138
|
// System Tray - Not available in browser
|
|
15
|
-
async createTray(_options) {
|
|
16
|
-
}
|
|
17
|
-
async
|
|
18
|
-
}
|
|
19
|
-
async destroyTray() {
|
|
20
|
-
}
|
|
21
|
-
async setTrayMenu(_options) {
|
|
22
|
-
}
|
|
139
|
+
async createTray(_options) { }
|
|
140
|
+
async updateTray(_options) { }
|
|
141
|
+
async destroyTray() { }
|
|
142
|
+
async setTrayMenu(_options) { }
|
|
23
143
|
// Global Shortcuts - Not available in browser
|
|
24
144
|
async registerShortcut(_options) {
|
|
25
145
|
return { success: false };
|
|
26
146
|
}
|
|
27
|
-
async unregisterShortcut(_options) {
|
|
28
|
-
}
|
|
29
|
-
async unregisterAllShortcuts() {
|
|
30
|
-
}
|
|
147
|
+
async unregisterShortcut(_options) { }
|
|
148
|
+
async unregisterAllShortcuts() { }
|
|
31
149
|
async isShortcutRegistered(_options) {
|
|
32
150
|
return { registered: false };
|
|
33
151
|
}
|
|
34
152
|
// Auto Launch - Not available in browser
|
|
35
|
-
async setAutoLaunch(_options) {
|
|
36
|
-
}
|
|
153
|
+
async setAutoLaunch(_options) { }
|
|
37
154
|
async getAutoLaunchStatus() {
|
|
38
155
|
return { enabled: false, openAsHidden: false };
|
|
39
156
|
}
|
|
40
157
|
// Window Management - Limited in browser
|
|
41
|
-
async setWindowOptions(_options) {
|
|
42
|
-
}
|
|
158
|
+
async setWindowOptions(_options) { }
|
|
43
159
|
async getWindowBounds() {
|
|
44
160
|
return {
|
|
45
161
|
x: window.screenX,
|
|
@@ -48,22 +164,17 @@ var capacitorDesktop = (function (exports, core) {
|
|
|
48
164
|
height: window.outerHeight,
|
|
49
165
|
};
|
|
50
166
|
}
|
|
51
|
-
async setWindowBounds(_options) {
|
|
52
|
-
}
|
|
53
|
-
async
|
|
54
|
-
}
|
|
55
|
-
async maximizeWindow() {
|
|
56
|
-
}
|
|
57
|
-
async unmaximizeWindow() {
|
|
58
|
-
}
|
|
167
|
+
async setWindowBounds(_options) { }
|
|
168
|
+
async minimizeWindow() { }
|
|
169
|
+
async maximizeWindow() { }
|
|
170
|
+
async unmaximizeWindow() { }
|
|
59
171
|
async closeWindow() {
|
|
60
172
|
window.close();
|
|
61
173
|
}
|
|
62
174
|
async showWindow() {
|
|
63
175
|
window.focus();
|
|
64
176
|
}
|
|
65
|
-
async hideWindow() {
|
|
66
|
-
}
|
|
177
|
+
async hideWindow() { }
|
|
67
178
|
async focusWindow() {
|
|
68
179
|
window.focus();
|
|
69
180
|
}
|
|
@@ -79,15 +190,13 @@ var capacitorDesktop = (function (exports, core) {
|
|
|
79
190
|
async isWindowFocused() {
|
|
80
191
|
return { focused: document.hasFocus() };
|
|
81
192
|
}
|
|
82
|
-
async setAlwaysOnTop(_options) {
|
|
83
|
-
}
|
|
193
|
+
async setAlwaysOnTop(_options) { }
|
|
84
194
|
async setFullscreen(options) {
|
|
85
195
|
options.flag
|
|
86
196
|
? document.documentElement.requestFullscreen()
|
|
87
197
|
: document.exitFullscreen();
|
|
88
198
|
}
|
|
89
|
-
async setOpacity(_options) {
|
|
90
|
-
}
|
|
199
|
+
async setOpacity(_options) { }
|
|
91
200
|
// Notifications - Using Web Notification API
|
|
92
201
|
async showNotification(options) {
|
|
93
202
|
const id = `notification_${Date.now()}`;
|
|
@@ -195,8 +304,7 @@ var capacitorDesktop = (function (exports, core) {
|
|
|
195
304
|
async openExternal(options) {
|
|
196
305
|
window.open(options.url, "_blank");
|
|
197
306
|
}
|
|
198
|
-
async showItemInFolder(_options) {
|
|
199
|
-
}
|
|
307
|
+
async showItemInFolder(_options) { }
|
|
200
308
|
async beep() {
|
|
201
309
|
const ctx = new AudioContext();
|
|
202
310
|
const osc = ctx.createOscillator();
|
|
@@ -257,6 +365,42 @@ var capacitorDesktop = (function (exports, core) {
|
|
|
257
365
|
l.callback(data);
|
|
258
366
|
});
|
|
259
367
|
}
|
|
368
|
+
async checkPermission(options) {
|
|
369
|
+
const rpc = getDesktopRpc();
|
|
370
|
+
const request = rpc?.request?.permissionsCheck;
|
|
371
|
+
if (request) {
|
|
372
|
+
const bridged = await request.call(rpc.request, { id: options.id });
|
|
373
|
+
if (isDesktopPermissionState(bridged, options.id))
|
|
374
|
+
return bridged;
|
|
375
|
+
}
|
|
376
|
+
const browserState = await queryBrowserPermission(options.id);
|
|
377
|
+
if (browserState)
|
|
378
|
+
return browserState;
|
|
379
|
+
return {
|
|
380
|
+
id: options.id,
|
|
381
|
+
status: "not-applicable",
|
|
382
|
+
restrictedReason: "platform_unsupported",
|
|
383
|
+
lastChecked: Date.now(),
|
|
384
|
+
canRequest: false,
|
|
385
|
+
platform: currentPlatform(),
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
async requestPermission(options) {
|
|
389
|
+
const rpc = getDesktopRpc();
|
|
390
|
+
const request = rpc?.request?.permissionsRequest;
|
|
391
|
+
if (request) {
|
|
392
|
+
const bridged = await request.call(rpc.request, { id: options.id });
|
|
393
|
+
if (isDesktopPermissionState(bridged, options.id)) {
|
|
394
|
+
if (bridged.status === "not-determined" &&
|
|
395
|
+
BROWSER_PERMISSION_IDS.has(options.id)) {
|
|
396
|
+
return (await requestBrowserPermission(options.id)) ?? bridged;
|
|
397
|
+
}
|
|
398
|
+
return bridged;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return ((await requestBrowserPermission(options.id)) ??
|
|
402
|
+
this.checkPermission({ id: options.id }));
|
|
403
|
+
}
|
|
260
404
|
}
|
|
261
405
|
|
|
262
406
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nconst loadWeb = () => import(\"./web\").then((m) => new m.DesktopWeb());\nexport const Desktop = registerPlugin(\"Desktop\", {\n web: loadWeb,\n});\n","import { WebPlugin } from \"@capacitor/core\";\n// No-op for features unavailable on web; callers should check return values.\nconst webUnavailable = (_feature) => { };\nexport class DesktopWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pluginListeners = [];\n }\n // System Tray - Not available in browser\n async createTray(_options) {\n webUnavailable(\"System tray\");\n }\n async updateTray(_options) {\n webUnavailable(\"System tray\");\n }\n async destroyTray() {\n webUnavailable(\"System tray\");\n }\n async setTrayMenu(_options) {\n webUnavailable(\"System tray\");\n }\n // Global Shortcuts - Not available in browser\n async registerShortcut(_options) {\n webUnavailable(\"Global shortcuts\");\n return { success: false };\n }\n async unregisterShortcut(_options) {\n webUnavailable(\"Global shortcuts\");\n }\n async unregisterAllShortcuts() {\n webUnavailable(\"Global shortcuts\");\n }\n async isShortcutRegistered(_options) {\n return { registered: false };\n }\n // Auto Launch - Not available in browser\n async setAutoLaunch(_options) {\n webUnavailable(\"Auto launch\");\n }\n async getAutoLaunchStatus() {\n return { enabled: false, openAsHidden: false };\n }\n // Window Management - Limited in browser\n async setWindowOptions(_options) {\n webUnavailable(\"Window options\");\n }\n async getWindowBounds() {\n return {\n x: window.screenX,\n y: window.screenY,\n width: window.outerWidth,\n height: window.outerHeight,\n };\n }\n async setWindowBounds(_options) {\n webUnavailable(\"Setting window bounds\");\n }\n async minimizeWindow() {\n webUnavailable(\"Window minimize\");\n }\n async maximizeWindow() {\n webUnavailable(\"Window maximize\");\n }\n async unmaximizeWindow() {\n webUnavailable(\"Window unmaximize\");\n }\n async closeWindow() {\n window.close();\n }\n async showWindow() {\n window.focus();\n }\n async hideWindow() {\n webUnavailable(\"Window hide\");\n }\n async focusWindow() {\n window.focus();\n }\n async isWindowMaximized() {\n return { maximized: false };\n }\n async isWindowMinimized() {\n return { minimized: document.hidden };\n }\n async isWindowVisible() {\n return { visible: !document.hidden };\n }\n async isWindowFocused() {\n return { focused: document.hasFocus() };\n }\n async setAlwaysOnTop(_options) {\n webUnavailable(\"Always on top\");\n }\n async setFullscreen(options) {\n options.flag\n ? document.documentElement.requestFullscreen()\n : document.exitFullscreen();\n }\n async setOpacity(_options) {\n webUnavailable(\"Window opacity\");\n }\n // Notifications - Using Web Notification API\n async showNotification(options) {\n const id = `notification_${Date.now()}`;\n if (!(\"Notification\" in window)) {\n return {\n id,\n shown: false,\n error: \"Notification API not available in this browser\",\n };\n }\n if (Notification.permission === \"denied\") {\n return { id, shown: false, error: \"Notification permission denied\" };\n }\n if (Notification.permission !== \"granted\") {\n const permission = await Notification.requestPermission();\n if (permission !== \"granted\") {\n return {\n id,\n shown: false,\n error: \"Notification permission not granted\",\n };\n }\n }\n const notification = new Notification(options.title, {\n body: options.body,\n icon: options.icon,\n silent: options.silent,\n });\n notification.onclick = () => this.notifyListeners(\"notificationClick\", {});\n return { id, shown: true };\n }\n async closeNotification(_options) {\n // Web Notification API doesn't provide a way to close notifications by ID.\n // Notifications auto-close or the user dismisses them.\n }\n // Power Monitor\n async getPowerState() {\n const getBattery = navigator.getBattery;\n if (getBattery) {\n try {\n const battery = await getBattery.call(navigator);\n return {\n onBattery: !battery.charging,\n batteryLevel: battery.level * 100,\n isCharging: battery.charging,\n idleState: \"active\", // Idle detection not available on web\n idleTime: 0,\n };\n }\n catch (err) {\n console.debug(\"[Desktop] Battery API access failed:\", err);\n }\n }\n return {\n onBattery: false, // Unknown, defaulting to false\n idleState: \"unknown\",\n idleTime: 0,\n };\n }\n // App\n async quit() {\n window.close();\n }\n async relaunch() {\n window.location.reload();\n }\n async getVersion() {\n // On web platform, version info is limited. Return actual browser info where available.\n // Note: \"version\" and \"name\" would need to come from app config - returning \"unknown\" to indicate unavailability\n return {\n version: \"unknown\", // App version not available on web - would need to be injected at build time\n name: \"unknown\", // App name not available on web - would need to be injected at build time\n runtime: \"N/A\", // Not running in the desktop runtime\n chrome: navigator.userAgent.match(/Chrome\\/([0-9.]+)/)?.[1] ?? \"unknown\",\n node: \"N/A\", // Not running in Node\n };\n }\n async isPackaged() {\n return { packaged: false };\n }\n async getPath(_options) {\n throw new Error(\"File system paths are not available in browser environment\");\n }\n // Clipboard\n async writeToClipboard(options) {\n if (options.text) {\n await navigator.clipboard.writeText(options.text);\n return;\n }\n if (options.html) {\n await navigator.clipboard.write([\n new ClipboardItem({\n \"text/html\": new Blob([options.html], { type: \"text/html\" }),\n }),\n ]);\n }\n }\n async readFromClipboard() {\n return { text: await navigator.clipboard.readText(), hasImage: false };\n }\n async clearClipboard() {\n await navigator.clipboard.writeText(\"\");\n }\n // Shell\n async openExternal(options) {\n window.open(options.url, \"_blank\");\n }\n async showItemInFolder(_options) {\n webUnavailable(\"Show in folder\");\n }\n async beep() {\n const ctx = new AudioContext();\n const osc = ctx.createOscillator();\n const gain = ctx.createGain();\n osc.connect(gain).connect(ctx.destination);\n osc.frequency.value = 800;\n osc.type = \"sine\";\n gain.gain.setValueAtTime(0.3, ctx.currentTime);\n gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.1);\n osc.start(ctx.currentTime);\n osc.stop(ctx.currentTime + 0.1);\n }\n // Events\n async addListener(eventName, listenerFunc) {\n const entry = { eventName, callback: listenerFunc };\n // Create and track window event listeners to avoid memory leaks\n if (eventName === \"windowFocus\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"focus\", entry.windowListener);\n }\n else if (eventName === \"windowBlur\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.push(entry);\n return {\n remove: async () => {\n const i = this.pluginListeners.indexOf(entry);\n if (i >= 0) {\n // Remove window event listener if it exists\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.splice(i, 1);\n }\n },\n };\n }\n async removeAllListeners() {\n // Clean up all window event listeners before clearing\n for (const entry of this.pluginListeners) {\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n }\n this.pluginListeners = [];\n }\n notifyListeners(eventName, data) {\n this.pluginListeners\n .filter((l) => l.eventName === eventName)\n .forEach((l) => {\n l.callback(data);\n });\n }\n}\n"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AACzD,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IACjD,IAAI,GAAG,EAAE,OAAO;IAChB,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG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
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nconst loadWeb = () => import(\"./web\").then((m) => new m.DesktopWeb());\nexport const Desktop = registerPlugin(\"Desktop\", {\n web: loadWeb,\n});\n","import { WebPlugin } from \"@capacitor/core\";\nconst BROWSER_PERMISSION_IDS = new Set([\n \"camera\",\n \"microphone\",\n \"location\",\n \"notifications\",\n]);\nfunction getDesktopRpc() {\n const g = globalThis;\n if (typeof window !== \"undefined\") {\n return window.__ELIZA_ELECTROBUN_RPC__;\n }\n return g.window?.__ELIZA_ELECTROBUN_RPC__ ?? g.__ELIZA_ELECTROBUN_RPC__;\n}\nfunction currentPlatform() {\n const proc = globalThis.process;\n const p = proc?.platform;\n if (p === \"darwin\" || p === \"win32\" || p === \"linux\")\n return p;\n if (typeof navigator !== \"undefined\") {\n const platform = navigator.platform.toLowerCase();\n if (platform.includes(\"mac\"))\n return \"darwin\";\n if (platform.includes(\"win\"))\n return \"win32\";\n }\n return \"linux\";\n}\nfunction isRecord(value) {\n return Boolean(value) && typeof value === \"object\";\n}\nfunction isDesktopPermissionState(value, id) {\n return (isRecord(value) &&\n value.id === id &&\n typeof value.status === \"string\" &&\n typeof value.canRequest === \"boolean\" &&\n typeof value.lastChecked === \"number\");\n}\nfunction stateFromStatus(id, status, options = {}) {\n const state = {\n id,\n status,\n lastChecked: options.lastChecked ?? Date.now(),\n canRequest: options.canRequest ?? status === \"not-determined\",\n platform: options.platform ?? currentPlatform(),\n };\n if (options.lastRequested !== undefined) {\n state.lastRequested = options.lastRequested;\n }\n if (options.restrictedReason !== undefined) {\n state.restrictedReason = options.restrictedReason;\n }\n return state;\n}\nfunction mapBrowserPermissionState(state) {\n if (state === \"granted\")\n return \"granted\";\n if (state === \"denied\")\n return \"denied\";\n if (state === \"prompt\" || state === \"default\")\n return \"not-determined\";\n return null;\n}\nasync function queryBrowserPermission(id) {\n if (!BROWSER_PERMISSION_IDS.has(id) || typeof navigator === \"undefined\") {\n return null;\n }\n if (id === \"notifications\" && typeof Notification !== \"undefined\") {\n const status = mapBrowserPermissionState(Notification.permission);\n return status ? stateFromStatus(id, status) : null;\n }\n if (!navigator.permissions?.query) {\n return null;\n }\n const permissionName = id === \"location\" ? \"geolocation\" : id;\n try {\n const result = await navigator.permissions.query({\n name: permissionName,\n });\n const status = mapBrowserPermissionState(result.state);\n return status ? stateFromStatus(id, status) : null;\n }\n catch {\n return null;\n }\n}\nasync function requestBrowserPermission(id) {\n if (!BROWSER_PERMISSION_IDS.has(id) || typeof navigator === \"undefined\") {\n return null;\n }\n if (id === \"camera\" || id === \"microphone\") {\n try {\n const stream = await navigator.mediaDevices?.getUserMedia?.({\n video: id === \"camera\",\n audio: id === \"microphone\",\n });\n for (const track of stream?.getTracks?.() ?? []) {\n track.stop();\n }\n }\n catch {\n // Query below returns denied when the browser recorded a denial.\n }\n const checked = await queryBrowserPermission(id);\n return checked ? { ...checked, lastRequested: Date.now() } : null;\n }\n if (id === \"location\" && navigator.geolocation) {\n const requestedStatus = await new Promise((resolve) => {\n navigator.geolocation.getCurrentPosition(() => resolve(\"granted\"), (err) => resolve(err.code === err.PERMISSION_DENIED ? \"denied\" : null), { maximumAge: 0, timeout: 10000 });\n });\n const checked = await queryBrowserPermission(id);\n if (checked)\n return { ...checked, lastRequested: Date.now() };\n return requestedStatus\n ? stateFromStatus(id, requestedStatus, { lastRequested: Date.now() })\n : null;\n }\n if (id === \"notifications\" && typeof Notification !== \"undefined\") {\n const status = mapBrowserPermissionState(await Notification.requestPermission());\n return status\n ? stateFromStatus(id, status, { lastRequested: Date.now() })\n : null;\n }\n return queryBrowserPermission(id);\n}\nexport class DesktopWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.pluginListeners = [];\n }\n // System Tray - Not available in browser\n async createTray(_options) { }\n async updateTray(_options) { }\n async destroyTray() { }\n async setTrayMenu(_options) { }\n // Global Shortcuts - Not available in browser\n async registerShortcut(_options) {\n return { success: false };\n }\n async unregisterShortcut(_options) { }\n async unregisterAllShortcuts() { }\n async isShortcutRegistered(_options) {\n return { registered: false };\n }\n // Auto Launch - Not available in browser\n async setAutoLaunch(_options) { }\n async getAutoLaunchStatus() {\n return { enabled: false, openAsHidden: false };\n }\n // Window Management - Limited in browser\n async setWindowOptions(_options) { }\n async getWindowBounds() {\n return {\n x: window.screenX,\n y: window.screenY,\n width: window.outerWidth,\n height: window.outerHeight,\n };\n }\n async setWindowBounds(_options) { }\n async minimizeWindow() { }\n async maximizeWindow() { }\n async unmaximizeWindow() { }\n async closeWindow() {\n window.close();\n }\n async showWindow() {\n window.focus();\n }\n async hideWindow() { }\n async focusWindow() {\n window.focus();\n }\n async isWindowMaximized() {\n return { maximized: false };\n }\n async isWindowMinimized() {\n return { minimized: document.hidden };\n }\n async isWindowVisible() {\n return { visible: !document.hidden };\n }\n async isWindowFocused() {\n return { focused: document.hasFocus() };\n }\n async setAlwaysOnTop(_options) { }\n async setFullscreen(options) {\n options.flag\n ? document.documentElement.requestFullscreen()\n : document.exitFullscreen();\n }\n async setOpacity(_options) { }\n // Notifications - Using Web Notification API\n async showNotification(options) {\n const id = `notification_${Date.now()}`;\n if (!(\"Notification\" in window)) {\n return {\n id,\n shown: false,\n error: \"Notification API not available in this browser\",\n };\n }\n if (Notification.permission === \"denied\") {\n return { id, shown: false, error: \"Notification permission denied\" };\n }\n if (Notification.permission !== \"granted\") {\n const permission = await Notification.requestPermission();\n if (permission !== \"granted\") {\n return {\n id,\n shown: false,\n error: \"Notification permission not granted\",\n };\n }\n }\n const notification = new Notification(options.title, {\n body: options.body,\n icon: options.icon,\n silent: options.silent,\n });\n notification.onclick = () => this.notifyListeners(\"notificationClick\", {});\n return { id, shown: true };\n }\n async closeNotification(_options) {\n // Web Notification API doesn't provide a way to close notifications by ID.\n // Notifications auto-close or the user dismisses them.\n }\n // Power Monitor\n async getPowerState() {\n const getBattery = navigator.getBattery;\n if (getBattery) {\n try {\n const battery = await getBattery.call(navigator);\n return {\n onBattery: !battery.charging,\n batteryLevel: battery.level * 100,\n isCharging: battery.charging,\n idleState: \"active\", // Idle detection not available on web\n idleTime: 0,\n };\n }\n catch (err) {\n console.debug(\"[Desktop] Battery API access failed:\", err);\n }\n }\n return {\n onBattery: false, // Unknown, defaulting to false\n idleState: \"unknown\",\n idleTime: 0,\n };\n }\n // App\n async quit() {\n window.close();\n }\n async relaunch() {\n window.location.reload();\n }\n async getVersion() {\n // On web platform, version info is limited. Return actual browser info where available.\n // Note: \"version\" and \"name\" would need to come from app config - returning \"unknown\" to indicate unavailability\n return {\n version: \"unknown\", // App version not available on web - would need to be injected at build time\n name: \"unknown\", // App name not available on web - would need to be injected at build time\n runtime: \"N/A\", // Not running in the desktop runtime\n chrome: navigator.userAgent.match(/Chrome\\/([0-9.]+)/)?.[1] ?? \"unknown\",\n node: \"N/A\", // Not running in Node\n };\n }\n async isPackaged() {\n return { packaged: false };\n }\n async getPath(_options) {\n throw new Error(\"File system paths are not available in browser environment\");\n }\n // Clipboard\n async writeToClipboard(options) {\n if (options.text) {\n await navigator.clipboard.writeText(options.text);\n return;\n }\n if (options.html) {\n await navigator.clipboard.write([\n new ClipboardItem({\n \"text/html\": new Blob([options.html], { type: \"text/html\" }),\n }),\n ]);\n }\n }\n async readFromClipboard() {\n return { text: await navigator.clipboard.readText(), hasImage: false };\n }\n async clearClipboard() {\n await navigator.clipboard.writeText(\"\");\n }\n // Shell\n async openExternal(options) {\n window.open(options.url, \"_blank\");\n }\n async showItemInFolder(_options) { }\n async beep() {\n const ctx = new AudioContext();\n const osc = ctx.createOscillator();\n const gain = ctx.createGain();\n osc.connect(gain).connect(ctx.destination);\n osc.frequency.value = 800;\n osc.type = \"sine\";\n gain.gain.setValueAtTime(0.3, ctx.currentTime);\n gain.gain.exponentialRampToValueAtTime(0.01, ctx.currentTime + 0.1);\n osc.start(ctx.currentTime);\n osc.stop(ctx.currentTime + 0.1);\n }\n // Events\n async addListener(eventName, listenerFunc) {\n const entry = { eventName, callback: listenerFunc };\n // Create and track window event listeners to avoid memory leaks\n if (eventName === \"windowFocus\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"focus\", entry.windowListener);\n }\n else if (eventName === \"windowBlur\") {\n entry.windowListener = () => listenerFunc(undefined);\n window.addEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.push(entry);\n return {\n remove: async () => {\n const i = this.pluginListeners.indexOf(entry);\n if (i >= 0) {\n // Remove window event listener if it exists\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n this.pluginListeners.splice(i, 1);\n }\n },\n };\n }\n async removeAllListeners() {\n // Clean up all window event listeners before clearing\n for (const entry of this.pluginListeners) {\n if (entry.windowListener) {\n if (entry.eventName === \"windowFocus\")\n window.removeEventListener(\"focus\", entry.windowListener);\n else if (entry.eventName === \"windowBlur\")\n window.removeEventListener(\"blur\", entry.windowListener);\n }\n }\n this.pluginListeners = [];\n }\n notifyListeners(eventName, data) {\n this.pluginListeners\n .filter((l) => l.eventName === eventName)\n .forEach((l) => {\n l.callback(data);\n });\n }\n async checkPermission(options) {\n const rpc = getDesktopRpc();\n const request = rpc?.request?.permissionsCheck;\n if (request) {\n const bridged = await request.call(rpc.request, { id: options.id });\n if (isDesktopPermissionState(bridged, options.id))\n return bridged;\n }\n const browserState = await queryBrowserPermission(options.id);\n if (browserState)\n return browserState;\n return {\n id: options.id,\n status: \"not-applicable\",\n restrictedReason: \"platform_unsupported\",\n lastChecked: Date.now(),\n canRequest: false,\n platform: currentPlatform(),\n };\n }\n async requestPermission(options) {\n const rpc = getDesktopRpc();\n const request = rpc?.request?.permissionsRequest;\n if (request) {\n const bridged = await request.call(rpc.request, { id: options.id });\n if (isDesktopPermissionState(bridged, options.id)) {\n if (bridged.status === \"not-determined\" &&\n BROWSER_PERMISSION_IDS.has(options.id)) {\n return (await requestBrowserPermission(options.id)) ?? bridged;\n }\n return bridged;\n }\n }\n return ((await requestBrowserPermission(options.id)) ??\n this.checkPermission({ id: options.id }));\n }\n}\n"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AACzD,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IACjD,IAAI,GAAG,EAAE,OAAO;IAChB,CAAC;;ICJD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACvC,IAAI,QAAQ;IACZ,IAAI,YAAY;IAChB,IAAI,UAAU;IACd,IAAI,eAAe;IACnB,CAAC,CAAC;IACF,SAAS,aAAa,GAAG;IACzB,IAAI,MAAM,CAAC,GAAG,UAAU;IACxB,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACvC,QAAQ,OAAO,MAAM,CAAC,wBAAwB;IAC9C,IAAI;IACJ,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,wBAAwB,IAAI,CAAC,CAAC,wBAAwB;IAC3E;IACA,SAAS,eAAe,GAAG;IAC3B,IAAI,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO;IACnC,IAAI,MAAM,CAAC,GAAG,IAAI,EAAE,QAAQ;IAC5B,IAAI,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,OAAO;IACxD,QAAQ,OAAO,CAAC;IAChB,IAAI,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IAC1C,QAAQ,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE;IACzD,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;IACpC,YAAY,OAAO,QAAQ;IAC3B,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,C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;IACnC,YAAY,UAAU,EAAE,KAAK;IAC7B,YAAY,QAAQ,EAAE,eAAe,EAAE;IACvC,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,iBAAiB,CAAC,OAAO,EAAE;IACrC,QAAQ,MAAM,GAAG,GAAG,aAAa,EAAE;IACnC,QAAQ,MAAM,OAAO,GAAG,GAAG,EAAE,OAAO,EAAE,kBAAkB;IACxD,QAAQ,IAAI,OAAO,EAAE;IACrB,YAAY,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;IAC/E,YAAY,IAAI,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE;IAC/D,gBAAgB,IAAI,OAAO,CAAC,MAAM,KAAK,gBAAgB;IACvD,oBAAoB,sBAAsB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;IAC5D,oBAAoB,OAAO,CAAC,MAAM,wBAAwB,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,OAAO;IAClF,gBAAgB;IAChB,gBAAgB,OAAO,OAAO;IAC9B,YAAY;IACZ,QAAQ;IACR,QAAQ,QAAQ,CAAC,MAAM,wBAAwB,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3D,YAAY,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;IACpD,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/capacitor-desktop",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"description": "Adds tray icons, global shortcuts, notifications, and other desktop-only controls.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"desktop",
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
"unpkg": "dist/plugin.js",
|
|
23
23
|
"files": [
|
|
24
24
|
"dist/",
|
|
25
|
-
"
|
|
25
|
+
"dist"
|
|
26
26
|
],
|
|
27
27
|
"author": "elizaOS",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@elizaos/app-core": "2.0.0-
|
|
30
|
+
"@elizaos/app-core": "2.0.0-beta.1"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "https://github.com/elizaOS/eliza"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "
|
|
38
|
-
"clean": "
|
|
39
|
-
"prepublishOnly": "
|
|
37
|
+
"build": "bun run clean && tsc && bun --bun rollup -c rollup.config.mjs",
|
|
38
|
+
"clean": "node ../../../scripts/rm-path-recursive.mjs dist",
|
|
39
|
+
"prepublishOnly": "bun run build",
|
|
40
40
|
"watch": "tsc --watch"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
45
45
|
"rimraf": "^6.0.0",
|
|
46
46
|
"rollup": "^4.60.2",
|
|
47
|
-
"typescript": "^6.0.
|
|
47
|
+
"typescript": "^6.0.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@capacitor/core": "^8.3.1"
|