Skip to main content

Module tasks

Module tasks 

Source
Expand description

Task MCP - the project’s live task list (mcp__forge__tasks__*).

forge owns the task list its sessions work from: a task is a declared piece of work in flight, stored in the machine-local redb store (see crate::store::tasks) and rendered by the Inspector’s TASKS section. The CLI’s own task tools are gated per model and do not survive a session, so forge does not use them.

The tools (tasks__create / tasks__update / tasks__list / tasks__delete / tasks__claim / tasks__wait) are ANY-CALLER, scoped to the caller’s own project - a worker creating its own subtasks is the normal case, and any session may move any task in its project; tasks__approve is the lead’s own door and is not offered to a worker. Task-list mutations are direct Workspace methods (state writes), not Command-bus dispatches.

  • facade - the TasksFacade seam (prod over Weak<Workspace> + a mock for tool tests).

Re-exports§

use std::sync::Arc; 🔒
use std::time::SystemTime; 🔒
use forge_sdk::mcp::server::McpServerBuilder; 🔒
use forge_sdk::mcp::tool::Tool; 🔒
use forge_sdk::mcp::tool::ToolInput; 🔒
use forge_sdk::mcp::tool::ToolOutput; 🔒
use forge_primitives::tasks::LinkKind; 🔒
use forge_primitives::tasks::Task; 🔒
use forge_primitives::tasks::TaskId; 🔒
use forge_primitives::tasks::TaskStatus; 🔒
use forge_primitives::tasks::WaitingKind; 🔒
use crate::SessionSlot; 🔒
use crate::mcp::tasks::facade::TaskDraft; 🔒
use crate::mcp::tasks::facade::TaskPatch; 🔒
use crate::mcp::tasks::facade::TasksError; 🔒
use crate::mcp::tasks::facade::TasksFacade; 🔒

Modules§

facade 🔒
TasksFacade - the seam between the task MCP tools and workspace state. The production impl (ProdTasksFacade) resolves the caller’s project and drives the direct Workspace task methods; the mock records calls for tool tests.

Structs§

Approve 🔒
ApproveArgs 🔒
Claim 🔒
ClaimArgs 🔒
Create 🔒
Delete 🔒
DeleteArgs 🔒
List 🔒
ListArgs 🔒
Update 🔒
UpdateArgs 🔒
Wait 🔒
WaitArgs 🔒

Functions§

add_tools 🔒
Attach the task tools to an existing McpServerBuilder. Called for BOTH lead and worker sessions (tasks are any-caller), so build_forge_server invokes this unconditionally.
board_row_to_json 🔒
One board row as the tool output reads it: the record, what the board derived, and the wait it is sitting on.
fmt_rfc3339 🔒
Format a SystemTime as a UTC RFC3339 string for tool output.
format_tasks_error 🔒
status_str 🔒
The status as the schema spells it.
task_to_json 🔒
Readable JSON for one task (the tool-output shape the LLM sees). Absent optional fields are omitted rather than sent as null.
tool_error 🔒
verify_str 🔒
The gate as the tool schema spells it.
waiting_kind_str 🔒