/** * The four writes Connect performs, each through the seam that owns it. * * Two rules shape every one of them. A secret is written through * `ctx.credentials` and never through `ctx.settings`, so the settings document * keeps carrying references rather than values and stays safe to sync and to * render. And a settings write is a path op carrying the revision the row was * read at, so a concurrent edit — a second terminal, the web Models page, or a * hand-edited `settings.yaml` — is refused instead of being overwritten. * * Nothing here decides whether an action should be OFFERED; {@link rowActions} * does, from the same facts. These functions assume the offer was made and * report what Harness answered. * @module dshline/connect/actions */ import type { ConnectSeams } from './harness.ts'; import type { ConnectProviderRow, ConnectSignInRow } from './model.ts'; /** How one action ended, in words the transcript can carry. */ export interface ConnectActionOutcome { /** Whether Harness accepted the change. */ readonly kind: 'done' | 'failed'; /** What happened, already worded for a reader. */ readonly message: string; } /** * Store an API key for one route, recording its reference when there is none. * * Two writes in a fixed order, and the order is the point. The settings write * lands first because a stored secret whose reference nothing records is a * secret no adapter will ever read; if the credential write then fails, the * route is left naming a reference that is merely unset, which the browser * reports and the reader can retry. The reverse order would leave a stored key * that looks like nothing happened. * @param seams - the Harness seams. * @param row - the route being configured. * @param raw - the key exactly as typed. * @returns what Harness answered. */ export declare function setApiKey(seams: ConnectSeams, row: ConnectProviderRow, raw: string, signal?: AbortSignal): Promise; /** * Forget the value behind one route's credential reference. * * The reference itself stays in the profile. Removing it too would change how * the route authenticates — a profile naming no reference defers to the * provider's own ambient discovery — and that is a different decision from * clearing a key. * @param seams - the Harness seams. * @param row - the route whose key is being forgotten. * @returns what Harness answered. */ export declare function clearApiKey(seams: ConnectSeams, row: ConnectProviderRow, signal?: AbortSignal): Promise; /** * Write a minimal profile so the owning adapter registers the route. * * An empty profile is the whole activation for a route the adapter already * describes: it inherits that route's endpoint, protocol, and catalog, and the * adapter registers it on the next settings commit. A route the adapter ships * nothing about needs fields this browser does not edit, and its own settings * document remains the place to declare it. * @param seams - the Harness seams. * @param row - the dormant route being activated. * @returns what Harness answered. */ export declare function activateRoute(seams: ConnectSeams, row: ConnectProviderRow, signal?: AbortSignal): Promise; /** * Remove the user layer's profile for one route. * * Only the user layer. A composition-declared route survives this and reverts * to what `cordis.yml` says, which is the whole reason the settings seam * separates the layers. * @param seams - the Harness seams. * @param row - the route being removed. * @returns what Harness answered. */ export declare function deactivateRoute(seams: ConnectSeams, row: ConnectProviderRow, signal?: AbortSignal): Promise; /** * Delete the credential record one authorization flow wrote. * * Local only. Harness has no place for a provider to declare a server-side * revoke, so this forgets the grant here and the issuer is never told — which * the offered action says, because a reader who believes they revoked access * has been misinformed by the word "sign out". * @param seams - the Harness seams. * @param row - the sign-in being forgotten. * @returns what Harness answered. */ export declare function forgetSignIn(seams: ConnectSeams, row: ConnectSignInRow, signal?: AbortSignal): Promise; //# sourceMappingURL=actions.d.ts.map