import { type ProjectStore } from "../store/project-store.js"; import { type Agent, type JsonObject, type Workspace, type WorkspaceEvent, type WorkspaceIntegrations } from "../types/workspace.js"; export declare const DEFAULT_WORKSPACE_AGENT_MODEL = "openai/gpt-4o-mini"; export declare const PROJECT_AGENT_READ_TOOLS: readonly ["projects_roots_list", "projects_roots_match", "projects_recipes_list", "projects_recipes_show", "projects_agents_list", "projects_list", "projects_show", "projects_locations_list", "projects_events_list", "projects_doctor", "projects_tmux_status", "projects_tmux_profiles_list", "projects_plan_create"]; export declare const PROJECT_AGENT_MUTATION_TOOLS: readonly ["projects_create", "projects_roots_add", "projects_recipes_add", "projects_agents_add", "projects_agents_assign", "projects_locations_add", "projects_tmux_profiles_add", "projects_update", "projects_tag", "projects_untag", "projects_archive", "projects_unarchive", "projects_delete", "projects_cleanup_create", "projects_import", "projects_scan_roots", "projects_tmux_profiles_apply", "projects_github_publish", "projects_import_github", "projects_github_unpublish", "projects_link", "projects_unlink", "projects_channel", "projects_event_record", "projects_start"]; export declare const PROJECT_AGENT_DESTRUCTIVE_TOOLS: readonly ["projects_delete", "projects_cleanup_create", "projects_github_unpublish"]; export interface ProjectAgentMutationAudit { writes_allowed: boolean; approved: boolean; dry_run: boolean; mutating_tool_calls: string[]; destructive_tool_calls: string[]; planned_without_approval: string[]; violations: string[]; } export interface WorkspaceAgentPromptOptions { prompt: string; model?: string; maxSteps?: number; dryRun?: boolean; approve?: boolean; mock?: boolean; agent?: string; root?: string; recipe?: string; tmux?: boolean; budgetProject?: string; runBudget?: { maxUsd?: number; maxInputTokens?: number; maxOutputTokens?: number; maxTotalTokens?: number; }; } export interface WorkspaceAgentPromptResult { mode: "ai" | "mock"; run_id: string; agent_id: string; provider: "openrouter"; model: string; actor_agent_id: string; approved: boolean; dry_run: boolean; text: string; projects: Workspace[]; tool_calls: JsonObject[]; mutation_audit?: ProjectAgentMutationAudit; usage?: JsonObject; budget_statuses?: JsonObject[]; } export declare function resolveOpenRouterApiKey(): string | null; export declare function buildWorkspaceInventoryContext(limit?: number): JsonObject; export declare function buildProjectAgentToolCatalog(): JsonObject; export declare function buildWorkspaceAgentSystemPrompt(input: { actorAgentId: string; forcedRootId?: string; forcedRecipeId?: string; tmuxAllowed: boolean; projectInventory?: JsonObject; workspaceInventory?: JsonObject; }): string; export declare function auditProjectAgentToolCalls(toolCalls: JsonObject[], options: { approve: boolean; dryRun: boolean; }): ProjectAgentMutationAudit; export declare function shouldRunWorkspaceCreateFallback(toolCalls: JsonObject[], prompt: string): boolean; export declare const shouldRunProjectCreateFallback: typeof shouldRunWorkspaceCreateFallback; interface WorkspaceAgentToolContext { store: ProjectStore; actorAgent: Agent; approve: boolean; options: WorkspaceAgentPromptOptions; command: string; forcedRootId?: string; forcedRecipeId?: string; tmuxAllowed: boolean; createdWorkspaces: Workspace[]; } /** * Build the prompt-agent tool set bound to the active ProjectStore. Extracted * from runWorkspaceAgentPrompt so the mutation handlers can be unit-tested * against a fake Store. In the hosted backend every shared-registry mutation * (create/update/archive/unarchive/delete/tag/untag/unlink/event/agent/location) * routes through the Store (hosted HTTP), never local sqlite; local transport is * byte-for-byte unchanged. */ export declare function buildWorkspaceAgentTools(ctx: WorkspaceAgentToolContext): { projects_roots_list: import("ai").Tool, JsonObject[]>; projects_roots_match: import("ai").Tool<{ path?: string | undefined; kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; tags?: string[] | undefined; github_org?: string | undefined; }, { root: JsonObject; score: number; reasons: string[]; }[]>; projects_roots_add: import("ai").Tool<{ name: string; path: string; slug?: string | undefined; tags?: string[] | undefined; kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; github_org?: string | undefined; repo_visibility?: "public" | "private" | undefined; path_template?: string | undefined; name_template?: string | undefined; metadata?: Record | undefined; }, { status: string; root: { name: string; slug: string | undefined; base_path: string; tags: string[] | undefined; default_kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; github_org: string | undefined; repo_visibility: "public" | "private" | undefined; path_template: string | undefined; name_template: string | undefined; metadata: JsonObject | undefined; }; note: string; } | { status: string; root: JsonObject; note?: undefined; }>; projects_recipes_list: import("ai").Tool, { id: string; slug: string; name: string; kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | null; default_tags: string[]; steps: JsonObject[]; }[]>; projects_recipes_show: import("ai").Tool<{ id_or_slug: string; }, import("../index.js").Recipe | { error: string; }>; projects_recipes_add: import("ai").Tool<{ name: string; slug?: string | undefined; description?: string | undefined; kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; default_tags?: string[] | undefined; steps?: Record[] | undefined; variables?: Record | undefined; metadata?: Record | undefined; }, { status: string; recipe: { name: string; slug: string | undefined; description: string | undefined; kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; default_tags: string[] | undefined; steps: JsonObject[] | undefined; variables: JsonObject | undefined; metadata: JsonObject | undefined; }; note: string; } | { status: string; recipe: { id: string; slug: string; name: string; kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | null; default_tags: string[]; steps: JsonObject[]; }; note?: undefined; }>; projects_agents_list: import("ai").Tool<{ project?: string | undefined; }, { id: string; slug: string; name: string; kind: "human" | "ai" | "service" | "cli"; provider: string | null; model: string | null; role: string | null; }[] | { error: string; project?: undefined; agents?: undefined; } | { project: JsonObject; agents: import("../index.js").ProjectAgentAssignment[]; error?: undefined; }>; projects_agents_add: import("ai").Tool<{ name: string; slug?: string | undefined; kind?: "human" | "ai" | "service" | "cli" | undefined; provider?: string | undefined; model?: string | undefined; role?: string | undefined; permissions?: string[] | undefined; metadata?: Record | undefined; }, { status: string; agent: { name: string; slug: string | undefined; kind: "human" | "ai" | "service" | "cli"; provider: string | undefined; model: string | undefined; role: string | undefined; permissions: string[] | undefined; metadata: JsonObject | undefined; }; note: string; } | { status: string; agent: { id: string; slug: string; name: string; kind: "human" | "ai" | "service" | "cli"; provider: string | null; model: string | null; role: string | null; permissions: string[]; }; note?: undefined; }>; projects_agents_assign: import("ai").Tool<{ project: string; agent: string; role?: "service" | "owner" | "maintainer" | "contributor" | "prompt-agent" | "creator" | undefined; metadata?: Record | undefined; }, { error: string; status?: undefined; project?: undefined; agent?: undefined; role?: undefined; metadata?: undefined; note?: undefined; assignment?: undefined; } | { status: string; project: JsonObject; agent: { id: string; slug: string; name: string; kind: "human" | "ai" | "service" | "cli"; }; role: "service" | "owner" | "maintainer" | "contributor" | "prompt-agent" | "creator"; metadata: Record | undefined; note: string; error?: undefined; assignment?: undefined; } | { status: string; project: JsonObject; assignment: import("../index.js").ProjectAgentAssignment; error?: undefined; agent?: undefined; role?: undefined; metadata?: undefined; note?: undefined; }>; projects_list: import("ai").Tool<{ kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; status?: "active" | "archived" | "deleted" | undefined; query?: string | undefined; tags?: string[] | undefined; include_evals?: boolean | undefined; include_fixtures?: boolean | undefined; limit?: number | undefined; verbose?: boolean | undefined; }, { projects: JsonObject[]; count: number; limit: number; has_more: boolean; next_steps: string; }>; projects_show: import("ai").Tool<{ id_or_slug: string; verbose?: boolean | undefined; events_limit?: number | undefined; }, { error: string; project?: undefined; agents?: undefined; locations?: undefined; events?: undefined; events_limit?: undefined; total_events?: undefined; counts?: undefined; recent_events?: undefined; next_steps?: undefined; } | { project: JsonObject; agents: import("../index.js").ProjectAgentAssignment[]; locations: import("../index.js").ProjectLocation[]; events: WorkspaceEvent[]; events_limit: number; total_events: number; error?: undefined; counts?: undefined; recent_events?: undefined; next_steps?: undefined; } | { project: JsonObject; counts: { agents: number; locations: number; events: number; }; agents: JsonObject[]; recent_events: JsonObject[]; next_steps: string; error?: undefined; locations?: undefined; events?: undefined; events_limit?: undefined; total_events?: undefined; }>; projects_locations_list: import("ai").Tool<{ project: string; limit?: number | undefined; verbose?: boolean | undefined; }, { error: string; project?: undefined; locations?: undefined; count?: undefined; total?: undefined; limit?: undefined; has_more?: undefined; next_steps?: undefined; } | { project: JsonObject; locations: JsonObject[] | import("../index.js").ProjectLocation[]; count: number; total: number; limit: number; has_more: boolean; next_steps: string; error?: undefined; }>; projects_locations_add: import("ai").Tool<{ project: string; path: string; label?: string | undefined; kind?: string | undefined; primary?: boolean | undefined; metadata?: Record | undefined; }, unknown>; projects_events_list: import("ai").Tool<{ project: string; limit?: number | undefined; verbose?: boolean | undefined; }, { error: string; project?: undefined; events?: undefined; count?: undefined; total?: undefined; limit?: undefined; has_more?: undefined; next_steps?: undefined; } | { project: JsonObject; events: JsonObject[] | WorkspaceEvent[]; count: number; total: number; limit: number; has_more: boolean; next_steps: string; error?: undefined; }>; projects_event_record: import("ai").Tool<{ event_type: string; project?: string | undefined; metadata?: Record | undefined; after?: Record | undefined; }, unknown>; projects_doctor: import("ai").Tool<{ project: string; fix?: boolean | undefined; }, unknown>; projects_update: import("ai").Tool<{ project: string; name?: string | undefined; slug?: string | undefined; description?: string | null | undefined; kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; status?: "active" | "archived" | "deleted" | undefined; root?: string | null | undefined; recipe?: string | null | undefined; path?: string | null | undefined; tags?: string[] | undefined; git_remote?: string | null | undefined; integrations?: Record | undefined; metadata?: Record | undefined; stage?: "active" | "planned" | "idea" | "paused" | "shipped" | "maintenance" | null | undefined; priority?: "low" | "medium" | "high" | "critical" | null | undefined; owner?: string | null | undefined; launch_profile?: string | null | undefined; start_agent?: "codewith" | "claude" | "opencode" | "cursor" | "none" | null | undefined; start_command?: string | null | undefined; start_session_policy?: "reuse" | "new" | "error-if-running" | null | undefined; start_windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | null | undefined; todos_project_id?: string | null | undefined; todos_task_list_id?: string | null | undefined; brief_id?: string | null | undefined; brief_path?: string | null | undefined; }, unknown>; projects_archive: import("ai").Tool<{ project: string; }, { error: string; status?: undefined; project?: undefined; next_status?: undefined; } | { status: string; project: JsonObject; next_status: string; error?: undefined; } | { status: string; project: JsonObject; error?: undefined; next_status?: undefined; }>; projects_unarchive: import("ai").Tool<{ project: string; }, { error: string; status?: undefined; project?: undefined; next_status?: undefined; } | { status: string; project: JsonObject; next_status: string; error?: undefined; } | { status: string; project: JsonObject; error?: undefined; next_status?: undefined; }>; projects_delete: import("ai").Tool<{ project: string; hard?: boolean | undefined; }, { error: string; status?: undefined; project?: undefined; hard?: undefined; next_status?: undefined; } | { status: string; project: JsonObject; hard: boolean; next_status: string; error?: undefined; } | { status: string; hard: boolean; project: JsonObject; error?: undefined; next_status?: undefined; }>; projects_cleanup_create: import("ai").Tool<{ project: string; rollback_actions?: { type: "rollback"; action: string; target: string; status: "planned"; metadata?: Record | undefined; }[] | undefined; }, { error: string; status?: undefined; project?: undefined; cleanup?: undefined; note?: undefined; } | { status: string; project: JsonObject; cleanup: import("./workspace-plan.js").WorkspaceCreationCleanup; note: string; error?: undefined; } | { status: string; cleanup: unknown; error?: undefined; project?: undefined; note?: undefined; }>; projects_import: import("ai").Tool<{ path: string; bulk?: boolean | undefined; tags?: string[] | undefined; metadata?: Record | undefined; }, unknown>; projects_scan_roots: import("ai").Tool<{ root?: string | undefined; repo_prefix?: string | undefined; limit?: number | undefined; clone?: boolean | undefined; tags?: string[] | undefined; remote_protocol?: "https" | "ssh" | undefined; }, unknown>; projects_sync_roots: import("ai").Tool<{ root?: string | undefined; repo_prefix?: string | undefined; limit?: number | undefined; clone?: boolean | undefined; tags?: string[] | undefined; remote_protocol?: "https" | "ssh" | undefined; }, unknown>; projects_scan_local_roots: import("ai").Tool<{ tags?: string[] | undefined; }, unknown>; projects_github_publish: import("ai").Tool<{ project: string; org?: string | undefined; repo?: string | undefined; visibility?: "public" | "private" | undefined; description?: string | undefined; remote_protocol?: "https" | "ssh" | undefined; push?: boolean | undefined; }, unknown>; projects_github_unpublish: import("ai").Tool<{ project: string; clear_integrations?: boolean | undefined; }, unknown>; projects_import_github: import("ai").Tool<{ repo: string; root?: string | undefined; path?: string | undefined; clone?: boolean | undefined; remote_only?: boolean | undefined; kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; tags?: string[] | undefined; metadata?: Record | undefined; remote_protocol?: "https" | "ssh" | undefined; }, unknown>; projects_channel: import("ai").Tool<{ target?: string | undefined; ensure?: boolean | undefined; }, import("./project-channel.js").ProjectChannelResolution | { error: string; } | { note?: string | undefined; project: JsonObject; status: "created" | "exists" | "planned" | "error"; created: boolean; linked: boolean; message?: string; warnings: string[]; side_effects: import("./project-channel.js").ProjectChannelSideEffects; channel: string; channel_class: import("./project-channel.js").ProjectChannelClass | null; source: "integration" | "derived"; error?: undefined; }>; projects_link: import("ai").Tool<{ project: string; integrations: Record; }, { error: string; status?: undefined; project?: undefined; integrations?: undefined; note?: undefined; } | { status: string; project: JsonObject; integrations: { [x: string]: string | undefined; github_repo?: string; github_url?: string; todos_project_id?: string; todos_task_list_id?: string; brief_id?: string; brief_path?: string; canvases_project_id?: string; canvases_default_canvas_id?: string; mementos_project_id?: string; orgs_org_id?: string; orgs_project_id?: string; conversations_space?: string; conversations_channel?: string; conversations_channel_class?: string; files_index_id?: string; }; note: string; error?: undefined; } | { status: string; project: JsonObject; error?: undefined; integrations?: undefined; note?: undefined; }>; projects_unlink: import("ai").Tool<{ project: string; keys: string[]; }, { error: string; status?: undefined; project?: undefined; unlinked?: undefined; integrations?: undefined; note?: undefined; } | { status: string; project: JsonObject; unlinked: string[]; integrations: WorkspaceIntegrations; note: string; error?: undefined; } | { status: string; project: JsonObject; unlinked: string[]; error?: undefined; integrations?: undefined; note?: undefined; }>; projects_tag: import("ai").Tool<{ project: string; tags: string[]; }, { error: string; status?: undefined; project?: undefined; tags?: undefined; note?: undefined; } | { status: string; project: JsonObject; tags: string[]; note: string; error?: undefined; } | { status: string; project: JsonObject; error?: undefined; tags?: undefined; note?: undefined; }>; projects_untag: import("ai").Tool<{ project: string; tags: string[]; }, { error: string; status?: undefined; project?: undefined; tags?: undefined; note?: undefined; } | { status: string; project: JsonObject; tags: string[]; note: string; error?: undefined; } | { status: string; project: JsonObject; error?: undefined; tags?: undefined; note?: undefined; }>; projects_plan_create: import("ai").Tool<{ name: string; git_remote?: string | undefined; create_directory?: boolean | undefined; git_init?: boolean | undefined; write_marker?: boolean | undefined; tmux?: { session?: string | undefined; windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; } | undefined; tmux_profile?: string | undefined; stage?: "active" | "planned" | "idea" | "paused" | "shipped" | "maintenance" | undefined; priority?: "low" | "medium" | "high" | "critical" | undefined; owner?: string | undefined; launch_profile?: string | undefined; start_agent?: "codewith" | "claude" | "opencode" | "cursor" | "none" | undefined; start_command?: string | undefined; start_session_policy?: "reuse" | "new" | "error-if-running" | undefined; start_windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; todos_project_id?: string | undefined; todos_task_list_id?: string | undefined; brief_id?: string | undefined; brief_path?: string | undefined; integrations?: Record | undefined; metadata?: Record | undefined; slug?: string | undefined; description?: string | undefined; kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; root?: string | undefined; recipe?: string | undefined; path?: string | undefined; tags?: string[] | undefined; }, unknown>; projects_create: import("ai").Tool<{ name: string; git_remote?: string | undefined; create_directory?: boolean | undefined; git_init?: boolean | undefined; write_marker?: boolean | undefined; tmux?: { session?: string | undefined; windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; } | undefined; tmux_profile?: string | undefined; stage?: "active" | "planned" | "idea" | "paused" | "shipped" | "maintenance" | undefined; priority?: "low" | "medium" | "high" | "critical" | undefined; owner?: string | undefined; launch_profile?: string | undefined; start_agent?: "codewith" | "claude" | "opencode" | "cursor" | "none" | undefined; start_command?: string | undefined; start_session_policy?: "reuse" | "new" | "error-if-running" | undefined; start_windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; todos_project_id?: string | undefined; todos_task_list_id?: string | undefined; brief_id?: string | undefined; brief_path?: string | undefined; integrations?: Record | undefined; metadata?: Record | undefined; slug?: string | undefined; description?: string | undefined; kind?: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic" | undefined; root?: string | undefined; recipe?: string | undefined; path?: string | undefined; tags?: string[] | undefined; }, unknown>; projects_start: import("ai").Tool<{ target?: string | undefined; agent_tool?: "codewith" | "claude" | "opencode" | "cursor" | "none" | undefined; command?: string | undefined; profile?: string | undefined; session?: string | undefined; session_policy?: "reuse" | "new" | "error-if-running" | undefined; window_name?: string | undefined; windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; register?: boolean | undefined; tags?: string[] | undefined; metadata?: Record | undefined; }, unknown>; projects_tmux_status: import("ai").Tool<{ target?: string | undefined; profile?: string | undefined; session?: string | undefined; agent_tool?: "codewith" | "claude" | "opencode" | "cursor" | "none" | undefined; command?: string | undefined; window_name?: string | undefined; windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; }, unknown>; projects_tmux_profiles_add: import("ai").Tool<{ name: string; slug?: string | undefined; description?: string | undefined; session_template?: string | undefined; attach?: boolean | undefined; windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; metadata?: Record | undefined; }, { status: string; profile: { name: string; slug: string | undefined; description: string | undefined; session_template: string | undefined; attach: boolean | undefined; metadata: JsonObject | undefined; windows: { window_name_template: string; path_template: string | undefined; command: string | undefined; window_index: number | undefined; detached: boolean | undefined; }[] | undefined; }; note: string; } | { status: string; profile: { id: string; slug: string; name: string; session_template: string; windows: import("../index.js").TmuxProfileWindow[]; }; note?: undefined; }>; projects_tmux_profiles_list: import("ai").Tool, { id: string; slug: string; name: string; session_template: string; windows: import("../index.js").TmuxProfileWindow[]; }[]>; projects_tmux_profiles_apply: import("ai").Tool<{ project: string; session?: string | undefined; windows?: { name: string; path?: string | undefined; command?: string | undefined; index?: number | undefined; detached?: boolean | undefined; }[] | undefined; profile?: string | undefined; }, import("./workspace-runtime.js").WorkspaceTmuxResult | { error: string; status?: undefined; result?: undefined; } | { status: string; result: import("./workspace-runtime.js").WorkspaceTmuxResult; error?: undefined; }>; }; export declare function runWorkspaceAgentPrompt(options: WorkspaceAgentPromptOptions): Promise; export {}; //# sourceMappingURL=workspace-agent.d.ts.map