Lazily creates and proxies platform ports (persistence, gateway, settings, notifications) for the web app, ensuring a single instance.
// Source: https://github.com/mperkins0155/ClawWork-Fleet | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import type { PlatformPorts } from '@clawwork/core';
import { createBrowserPersistence } from './persistence-adapter.js';
import { createBrowserGatewayTransport } from './gateway-adapter.js';
import type { BrowserGatewayTransportResult } from './gateway-adapter.js';
import { createBrowserSettings } from './settings-adapter.js';
import { createBrowserNotifications } from './notifications-adapter.js';
import { getAllClients, getClient } from '../gateway/client-registry.js';
import { getIdentity, getScopeId } from '../persistence/db.js';
let _ports: PlatformPorts | null = null;
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key