import type { Database } from "bun:sqlite"; import type { EventSource, JsonObject, Workspace, WorkspaceLocation } from "../types/workspace.js"; import type { GuardedProjectMutationResult } from "../types/workspace.js"; import type { ProjectStore } from "../store/project-store.js"; import { type ProjectStoreSummary } from "../db/project-store.js"; import { type WorkspaceRuntimeAction, type WorkspaceTmuxResult, type WorkspaceTmuxWindowSpec } from "./workspace-runtime.js"; import { PROJECTS_HOME_ENV } from "./project-store-paths.js"; export interface ProjectStorePaths { home: string; workspace_path: string; data_path: string; project_db_path: string; assets_path: string; logs_path: string; artifacts_path: string; context_path: string; } export interface ProjectStoreInspection { project: Workspace; env: { projects_home_env: typeof PROJECTS_HOME_ENV; projects_home: string; }; paths: ProjectStorePaths; primary_path: string | null; primary_is_canonical: boolean; exists: { workspace: boolean; data: boolean; logs: boolean; artifacts: boolean; context: boolean; }; migration_recommended: boolean; } export interface ProjectStoreEnsureResult { project: Workspace; paths: ProjectStorePaths; created: string[]; primary_updated: boolean; dry_run: boolean; app_store: ProjectStoreSummary; registry_mutation: GuardedProjectMutationResult | null; } export declare const PROJECT_STORE_ENSURE_RESPONSE_BYTE_LIMIT: 65536; export declare const PROJECT_STORE_ENSURE_TIME_BUDGET_MS: 10000; export interface ProjectStoreMigrationAction { type: "file" | "db" | "verification"; action: string; source?: string; target: string; status: "planned" | "completed" | "skipped"; metadata?: JsonObject; } export interface ProjectStoreMigrationPlan { project: Workspace; paths: ProjectStorePaths; source_path: string | null; target_path: string; dry_run: boolean; can_apply: boolean; no_op: boolean; warnings: string[]; actions: ProjectStoreMigrationAction[]; } export interface ProjectStoreMigrationResult extends ProjectStoreMigrationPlan { project: Workspace; plan_artifact_path: string | null; verified: boolean; previous_location: WorkspaceLocation | null; primary_location: WorkspaceLocation | null; } export declare function projectStorePaths(workspaceId: string): ProjectStorePaths; export declare function inspectProjectStore(project: Workspace): ProjectStoreInspection; export declare function ensureProjectStore(project: Workspace, options?: { db?: Database; dryRun?: boolean; setPrimaryIfMissing?: boolean; recordRegistryEvent?: boolean; agentId?: string; source?: EventSource; command?: string; }): ProjectStoreEnsureResult; export declare function ensureProjectStoreForTarget(store: ProjectStore, target: string, options?: { dryRun?: boolean; setPrimaryIfMissing?: boolean; agentId?: string; source?: EventSource; command?: string; responseByteLimit?: number; timeBudgetMs?: number; }): Promise; export declare function planProjectStoreMigration(project: Workspace, options?: { dryRun?: boolean; }): ProjectStoreMigrationPlan; export declare function migrateProjectToStore(project: Workspace, options?: { db?: Database; apply?: boolean; agentId?: string; source?: EventSource; command?: string; }): ProjectStoreMigrationResult; /** * Store-routed migration for the hosted backend. The file half (moving the * machine-local primary directory into the canonical workspace store) runs on * the invoking machine — the server cannot move files on a client box — while * the registry half (previous + canonical locations, migration event) routes * through the Store so it lands on the hosted project. Mirrors the local * `migrateProjectToStore` semantics: same plan, same verification, same * file-move rollback with a primary-location restore. */ export declare function migrateProjectToStoreViaStore(store: ProjectStore, project: Workspace, options?: { apply?: boolean; agentId?: string; source?: EventSource; command?: string; }): Promise; /** * Machine-local runtime half of a hosted create (the hosted backend). The registry row is * created through the Store by the caller; this applies the on-invoking-box * effects — directory, git init, marker, tmux session — with events routed to * the hosted project through `store.recordEvent`. Tmux profiles resolve through * the machine-local store methods (the established hosted-backend precedent: tmux is * a runtime resource of THIS box even when the registry is cloud). */ export declare function applyMachineLocalCreationRuntime(store: ProjectStore, project: Workspace, input?: { createDirectory?: boolean; gitInit?: boolean; writeMarker?: boolean; tmux?: { session?: string; windows?: WorkspaceTmuxWindowSpec[]; }; tmuxProfile?: string; agentId?: string; source?: EventSource; command?: string; }): Promise<{ actions: WorkspaceRuntimeAction[]; tmux: WorkspaceTmuxResult | null; }>; //# sourceMappingURL=project-store.d.ts.map