/** * `apps` namespace — marketplace browse/fork and app version publishing. */ import type { Client } from "../kernel.js"; import type { ProjectTier } from "./projects.types.js"; export interface AppSummary { id: string; project_id: string; version: number; name: string; description: string | null; visibility: "public" | "unlisted" | "private"; fork_allowed: boolean; fork_pricing?: Record; min_tier: ProjectTier; derived_min_tier: ProjectTier; status: "published" | "draft" | "archived"; table_count: number; function_count: number; site_file_count: number; site_total_bytes: number; required_secrets: Array<{ key: string; description?: string; }>; required_actions: Array<{ action: string; description?: string; }>; tags: string[]; live_url: string | null; bootstrap_variables: unknown[] | null; created_at: string; compatibility_warnings: string[]; } export interface BrowseAppsResult { apps: AppSummary[]; total: number; } export interface ForkAppOptions { versionId: string; name: string; subdomain?: string; } export interface ForkAppResult { project_id: string; anon_key: string; service_key: string; schema_slot: string; site_url?: string; subdomain_url?: string; functions?: Array<{ name: string; url: string; }>; } export interface PublishAppOptions { description?: string; tags?: string[]; visibility?: "public" | "unlisted" | "private"; fork_allowed?: boolean; } export type PublishedVersion = AppSummary; export interface VersionSummary { id: string; description: string | null; tags: string[]; visibility: "public" | "unlisted" | "private"; fork_allowed: boolean; created_at: string; } export interface ListVersionsResult { versions: VersionSummary[]; } export interface UpdateVersionOptions { description?: string; tags?: string[]; visibility?: "public" | "unlisted" | "private"; fork_allowed?: boolean; } export type AppDetails = AppSummary; export type AppInstallStateStatus = "requested" | "planning" | "applying" | "active" | "failed"; export interface AppInstallStateInput { project_id: string; app_key: string; status?: AppInstallStateStatus; manifest_digest?: string | null; graph_digest?: string | null; source?: Record; manifest?: Record; resources?: Record; bindings?: Record; last_operation_id?: string | null; error?: Record | null; } export interface AppInstallState { id: string; project_id: string; app_key: string; status: AppInstallStateStatus; manifest_digest: string | null; graph_digest: string | null; source: Record; manifest: Record; resources: Record; bindings: Record; last_operation_id: string | null; error: Record | null; created_at: string; updated_at: string; } export declare class Apps { private readonly client; constructor(client: Client); /** Browse public forkable apps. Optional `tags` filter is OR-combined. */ browse(tags?: string[]): Promise; /** Upsert declarative app-install convergence state for `run402 up`. */ upsertInstallState(input: AppInstallStateInput): Promise; /** Read declarative app-install convergence state for diagnostics/resume. */ getInstallState(projectId: string, appKey: string): Promise; /** * Fork a published app into a new project. Payment flows through x402 * when the fork has a price. */ fork(opts: ForkAppOptions): Promise; /** Publish a project as a forkable app version. */ publish(projectId: string, opts?: PublishAppOptions): Promise; /** List all published versions of a project. */ listVersions(projectId: string): Promise; /** Update metadata (description/tags/visibility/fork_allowed) of a published version. */ updateVersion(projectId: string, versionId: string, opts: UpdateVersionOptions): Promise; /** Delete a published version. */ deleteVersion(projectId: string, versionId: string): Promise; /** Inspect a published app by version id. Public — no auth. */ getApp(versionId: string): Promise; } //# sourceMappingURL=apps.d.ts.map