@hasna/projects
Version:
High-level project management CLI, MCP server, SDK, and AI SDK agent loop for coding agents
83 lines • 3.26 kB
TypeScript
import type { Database } from "bun:sqlite";
import type { EventSource, JsonObject, TmuxProfile, TmuxProfileWindow, Workspace } from "../types/workspace.js";
export declare const PROJECT_MARKER_FILENAME = ".project.json";
export declare const LEGACY_WORKSPACE_MARKER_FILENAME = ".workspace.json";
export interface WorkspaceRuntimeAction {
type: string;
target: string;
status: "planned" | "completed" | "skipped" | "failed";
message?: string;
metadata?: JsonObject;
}
export interface PrepareWorkspaceOptions {
createDirectory?: boolean;
/**
* Refuse a pre-existing target directory. Used by all-or-nothing project
* registration so the attempt never adopts or writes into someone else's
* path. Ordinary create keeps its historical reuse behavior when unset.
*/
requireAbsentDirectory?: boolean;
gitInit?: boolean;
writeMarker?: boolean;
recordEvents?: boolean;
db?: Database;
dryRun?: boolean;
agentId?: string;
prompt?: string;
command?: string;
source?: EventSource;
}
export interface WorkspaceMarker {
schema_version: 1;
id: string;
slug: string;
name: string;
kind: string;
root_id: string | null;
recipe_id: string | null;
primary_path: string | null;
git_remote: string | null;
tags: string[];
integrations: JsonObject;
generated_at: string;
}
export interface WorkspaceTmuxWindowSpec {
name: string;
path?: string;
command?: string;
index?: number;
detached?: boolean;
}
export interface ApplyWorkspaceTmuxOptions {
session?: string;
sessionPolicy?: "reuse" | "new" | "error-if-running";
windows?: WorkspaceTmuxWindowSpec[];
runExistingWindowCommands?: boolean;
recordEvents?: boolean;
db?: Database;
dryRun?: boolean;
agentId?: string;
prompt?: string;
command?: string;
source?: EventSource;
}
export interface WorkspaceTmuxResult {
session_name: string;
dry_run: boolean;
session_action: "planned" | "created" | "reused" | "failed";
windows: WorkspaceRuntimeAction[];
errors: string[];
success: boolean;
}
export declare function workspaceMarkerPath(workspace: Pick<Workspace, "primary_path" | "slug">): string;
export declare function projectMarkerPath(workspace: Pick<Workspace, "primary_path" | "slug">): string;
export declare function buildWorkspaceMarker(workspace: Workspace): WorkspaceMarker;
export declare function writeWorkspaceMarker(workspace: Workspace, options?: PrepareWorkspaceOptions): WorkspaceRuntimeAction;
export declare function prepareWorkspaceDirectory(workspace: Workspace, options?: PrepareWorkspaceOptions): WorkspaceRuntimeAction[];
export declare function applyWorkspaceTmux(workspace: Workspace, options?: ApplyWorkspaceTmuxOptions): WorkspaceTmuxResult;
export declare function tmuxProfileToSpec(workspace: Workspace, profile: TmuxProfile, windows: TmuxProfileWindow[]): {
session: string;
windows: WorkspaceTmuxWindowSpec[];
};
export declare function applyWorkspaceTmuxProfile(workspace: Workspace, profile: TmuxProfile, windows: TmuxProfileWindow[], options?: Omit<ApplyWorkspaceTmuxOptions, "session" | "windows">): WorkspaceTmuxResult;
//# sourceMappingURL=workspace-runtime.d.ts.map