/**
 * Shared server-side helpers for the artifact-asset capability flow: compute the
 * allowlist of assets a bundle references that actually live in a repo, and mint
 * a token from it. Used by the mint endpoint, PNG/PDF render, and HTML export so
 * they can't drift on what an artifact is allowed to load.
 */
import type { WorkspaceManager } from '../core/workspace-manager.js';
import type { AuthService, AuthUser } from '../services/auth-service.js';
import type { ArtifactBundle } from '../core/artifact-bundle.js';
import { type ArtifactAssetRef } from '../core/artifact-asset-urls.js';
/**
 * The asset refs in arbitrary artifact text (a bundle's file contents, or a raw
 * entity body — even a historical version) that resolve to an indexed asset the
 * artifact's `repo` is allowed to load: one OWNED BY `repo`, OR one in a
 * workspace-wide shared store (`workspace_wide` — e.g. the `workspace-assets`
 * folder, shared across every repo and readable by every member). Other
 * cross-repo / filename-mismatch / unknown refs are dropped — fail-closed.
 * Carries `size` for export byte-budgeting. The regex only matches
 * `/api/assets/...` URLs, so scanning a raw JSON body (refs inside escaped
 * strings) or a frontmatter+body file is safe.
 */
export declare function authorizedArtifactAssetsFromText(workspaceManager: WorkspaceManager, repo: string, text: string): Array<ArtifactAssetRef & {
    size: number | null;
}>;
/** Bundle-typed convenience over {@link authorizedArtifactAssetsFromText} (used
 *  by export, which always has the validated live bundle). */
export declare function authorizedArtifactAssets(workspaceManager: WorkspaceManager, repo: string, bundle: ArtifactBundle): Array<ArtifactAssetRef & {
    size: number | null;
}>;
/**
 * D11b export model: every asset ref in the bundle the EXPORTING USER can read
 * — the artifact's repo, workspace-wide stores, and any other repo the user has
 * access to (authz per asset via the same `hasRepoAccess` the serve route
 * uses). Wider than {@link authorizedArtifactAssets} (the render/canvas token
 * scope) by design: the self-contained HTML export transfers custody to the
 * authenticated exporter — the same trust model as a screenshot. Refs that
 * don't resolve (unknown id / filename mismatch / no access) are NOT returned;
 * the export renders them as labeled placeholders. Carries the owning `repo`
 * so the caller downloads through the right graph.
 */
export declare function exporterAccessibleArtifactAssets(workspaceManager: WorkspaceManager, authService: AuthService, user: AuthUser | undefined, bundle: ArtifactBundle): Array<ArtifactAssetRef & {
    size: number | null;
    repo: string;
}>;
/** Allowlist of `assetId/filename` keys a bundle authorizes (for tests + callers
 *  that want the keys without minting). */
export declare function artifactAssetAllowlist(workspaceManager: WorkspaceManager, repo: string, bundle: ArtifactBundle): string[];
/** Mint a 12h artifact-scoped token from artifact text. `userId` is re-checked
 *  at serve time, so a token never outlives the user's access. The allowlist is
 *  derived from THIS text (live body or a specific historical commit), so a
 *  preview token authorizes exactly the previewed version's assets. */
export declare function mintArtifactAssetTokenForText(workspaceManager: WorkspaceManager, authService: AuthService, repo: string, artifactId: string, text: string, userId: string): {
    token: string;
    expiresInSeconds: number;
};
export declare function mintArtifactAssetTokenForBundle(workspaceManager: WorkspaceManager, authService: AuthService, repo: string, artifactId: string, bundle: ArtifactBundle, userId: string): {
    token: string;
    expiresInSeconds: number;
};
