/** * App Link router — backs GET /api/workflows/:id/app-link, the session bar's * durable-link chip beside the localhost Preview (SAP-3255). * * The API key is held server-side and the read goes through * {@link createDefinitionAppLinkReader}, for the same reasons as account.ts: * the `sk_…` key must not reach the page, and core sends no CORS headers for * the harness's origin. * * WHY THE ID IS A PATH. As in secrets.ts: the SPA addresses an agent by its * project directory, and the cloud definition id is read from that project's * `sapiom.json` at request time rather than taken from the caller, so the page * cannot ask for another definition's link through this route. */ import { Router } from "express"; import { readConfig as coreReadConfig } from "@sapiom/agent-core"; import { type ApiKeyProvider } from "../core/api-key-provider.js"; import { type DefinitionAppLinkReader } from "../core/definition-app-link.js"; export interface AppLinkRouterOpts { /** The Sapiom API key (`sk_…`), NOT the local boot token. */ apiKey: string | null | ApiKeyProvider; /** Resolve a registered agent's project directory from the route id. */ resolveWorkflow: (id: string) => { path: string; } | null; /** Override the core base URL (resolved from env by default). Test seam. */ baseUrl?: string; /** Injectable fetch. Test seam. */ fetchImpl?: typeof fetch; /** Injectable reader. Test seam; defaults to the real one. */ reader?: DefinitionAppLinkReader; /** Injectable `sapiom.json` read. Test seam. */ readConfig?: typeof coreReadConfig; } export declare function createAppLinkRouter(opts: AppLinkRouterOpts): Router; //# sourceMappingURL=app-link.d.ts.map