import { type Server } from "node:http"; declare const BRIDGE_OPERATIONS: readonly ["select", "resolveNodeToFile", "readFile", "applyEdit", "writeFile", "captureSnapshot", "captureState", "listFiles"]; type BridgeOperation = (typeof BRIDGE_OPERATIONS)[number]; declare const MANIFEST_CAPABILITIES: { readonly listFiles: true; readonly readTextFiles: true; readonly writeTextFiles: true; }; export interface DesignConnectArgs { url?: string; port: number; root: string; routeManifest?: string; appUrl?: string; bridgeToken?: string; previewToken?: string; json: boolean; once: boolean; dryRun: boolean; daemon: boolean; help: boolean; } export interface DesignConnectRoute { id: string; path: string; title: string; sourceFile?: string; sourceKind: "react-router" | "html" | "manual"; screenshotUrl?: string; metadata?: Record; } export interface DesignConnectManifest { version: 1; source: "agent-native-design-connect"; sourceType: "localhost"; localOnly: true; devServerUrl: string; bridgeUrl: string; rootPath: string; routeManifestPath: string; routeManifestCreated: boolean; routes: DesignConnectRoute[]; routeCount: number; generatedAt: string; capabilities: Array<{ operation: BridgeOperation; status: "available" | "planned" | "disabled"; reason?: string; }>; manifestCapabilities: typeof MANIFEST_CAPABILITIES; } export interface DesignConnectBridge { server: Server; close: () => Promise; manifest: DesignConnectManifest; /** Per-rootPath bridge token. Kept in-process only; never serialised into * the manifest JSON so it is not exposed over the network via GET /manifest. * The server-side grant action reads it from the running bridge instance. */ bridgeToken: string; /** Read-only token accepted by manifest, route, snapshot, proxy, and editor * bridge-registration endpoints. Safe to hand to the Design browser, but * never accepted by filesystem endpoints. */ previewToken: string; bridgeInstanceId: string; } export interface DesignConnectBridgeOptions { bridgeToken?: string; previewToken?: string; persistBridgeToken?: boolean; allowedOrigins?: string[]; } /** * Derive a read-only preview credential from the stronger filesystem token. * The one-way hash keeps old `--bridge-token` launch commands compatible while * ensuring a leaked preview credential cannot be promoted into write access. */ export declare function deriveDesignPreviewToken(bridgeToken: string): string; export declare function deriveDesignScopedReadOnlyPreviewToken(bridgeToken: string, designId: string): string; export declare function deriveDesignScopedLiveEditCapability(bridgeToken: string, designId: string): string; export declare function deriveDesignScopedLiveEditRegistrationCapability(bridgeToken: string, designId: string): string; export declare function deriveDesignPreviewAttestationSignature(bridgeToken: string, challenge: string): string; export declare function parseDesignConnectArgs(argv: string[]): DesignConnectArgs; export declare function discoverDesignRoutes(root: string): DesignConnectRoute[]; export declare function designConnectManifestsTargetSameApp(running: Pick, requested: Pick): boolean; export declare function designConnectAppFingerprint(manifest: Pick): string; export declare function prepareDesignConnectManifest(options?: Partial & { root?: string; }): Promise; /** Static project-rooted import graph used only to authorize a Motion source module. */ export declare function isMotionModuleReachableFromRoute(args: { rootPath: string; routePath: string; modulePath: string; }): Promise; export interface GitignoreRule { pattern: string; anchored: boolean; dirOnly: boolean; } export declare function parseGitignore(contents: string): GitignoreRule[]; export declare function isIgnoredByGitignore(rules: GitignoreRule[], relPath: string, isDir: boolean): boolean; export declare function shouldExcludeFromListing(relPath: string, options: { gitignore: GitignoreRule[]; sizeBytes?: number; }): boolean; export interface ListedBridgeFile { path: string; size: number; } export interface ListFilesResult { files: ListedBridgeFile[]; truncated: boolean; } export declare function startDesignConnectBridge(manifest: DesignConnectManifest, seedOrOptions?: string | DesignConnectBridgeOptions): Promise; export declare function resolveAppUrl(explicit?: string): string | undefined; /** * POST to the design app's `connect-localhost` action endpoint to register * (or refresh) the bridge connection and persist the real bridge token on the * server row. This is a best-effort call: failures are logged but do not * abort the bridge process. * * @param appUrl - Deployed design app base URL (e.g. https://design.agent-native.com) * @param bridge - The running bridge returned by startDesignConnectBridge * @param authToken - Optional bearer token for the authenticated action route */ export declare function registerConnectionWithServer(appUrl: string, bridge: DesignConnectBridge, authToken?: string): Promise; export declare function runDesign(argv: string[]): Promise; export {};