{
  "name": "forge-flowers",
  "language": "rust",
  "version": "0.2.0",
  "description": "Bridge connecting Forge agents and Brew plans to the Flowers durable execution runtime",
  "manifest": "forge-rs/crates/forge-flowers/Cargo.toml",
  "manifestSha256": "48a4d44de735e0b03529c22309d9778545d1c43a442d733ff3818b9d4377c315",
  "status": "source-reference",
  "registryPublicationVerified": false,
  "route": "/libraries/rust/forge-flowers",
  "features": {},
  "files": [
    {
      "path": "forge-rs/crates/forge-flowers/src/client.rs",
      "sha256": "95bc233d0c0fc59ac36301af75a835fad6bdbff2d24be9b0b66f3c4f0705efaf",
      "artifactSha256": "22c8e24468687734cec95dc65b2628a354ba09a3fba31ecbdad269e57f9eb7f5",
      "url": "/reference/source/forge-rs/crates/forge-flowers/src/client.rs.txt",
      "declarations": [
        {
          "name": "::FlowersClient",
          "line": 53,
          "signature": "pub struct FlowersClient {\n\n}",
          "documentation": "Flowers client for Rust embedded mode.\n\nWraps [`FlowersRuntime`] and provides a Forge-friendly API for submitting\nand managing durable executions of Forge agents and Brew plans.\n\n# Thread Safety\n\nThe client is `Send + Sync` and can be shared across threads via `Arc`.\n\n# Examples\n\n```no_run\nuse forge_flowers::client::FlowersClient;\nuse flowers::{FlowersConfig, FlowersRuntime};\nuse flowers::journal::memory::MemoryJournalStore;\nuse std::sync::Arc;\n\nlet store = Arc::new(MemoryJournalStore::new());\nlet runtime = FlowersRuntime::new(FlowersConfig::testing_direct(), store);\nlet client = FlowersClient::new(runtime);\n```"
        },
        {
          "name": "::FlowersClient::new",
          "line": 68,
          "signature": "pub fn new(runtime: FlowersRuntime) -> Self;",
          "documentation": "Creates a new `FlowersClient` wrapping the given runtime.\n\n# Arguments\n\n* `runtime` - The Flowers runtime to wrap.\n\n# Returns\n\nA client ready to submit and manage executions."
        },
        {
          "name": "::FlowersClient::submit_agent_run",
          "line": 92,
          "signature": "pub async fn submit_agent_run(\n        &self,\n        config: AgentConfig,\n        prompt: impl Into<String>,\n        factory: Arc<dyn ForgeAgentFactory>,\n    ) -> ForgeBridgeResult<ExecutionId>;",
          "documentation": "Submits a Forge agent for durable execution.\n\nThe agent is wrapped in a [`ForgeWorkflowHandler`] and submitted to\nthe Flowers runtime. The execution runs asynchronously; the returned\n[`ExecutionId`] can be used to query status, cancel, or signal.\n\n# Arguments\n\n* `config` - The agent configuration.\n* `prompt` - The text prompt to run the agent with.\n* `factory` - Factory that builds agents with journaled dependencies.\n\n# Returns\n\nThe execution ID assigned by the Flowers runtime.\n\n# Errors\n\nReturns [`ForgeBridgeError::Flowers`] if the runtime rejects the\nexecution (e.g., concurrent limit reached)."
        },
        {
          "name": "::FlowersClient::submit_brew_run",
          "line": 129,
          "signature": "pub async fn submit_brew_run(\n        &self,\n        plan: ResolvedBrewPlan,\n        provider: Arc<dyn LanguageModel>,\n    ) -> ForgeBridgeResult<ExecutionId>;",
          "documentation": "Submits a resolved Brew plan for durable execution.\n\nEach node in the plan is executed as a journaled call, providing\nnode-level replay granularity.\n\n# Arguments\n\n* `plan` - The resolved brew plan to execute.\n* `provider` - The language model provider for agent step nodes.\n\n# Returns\n\nThe execution ID assigned by the Flowers runtime.\n\n# Errors\n\nReturns [`ForgeBridgeError::PlanMappingFailed`] if the plan has\nstructural problems, or [`ForgeBridgeError::Flowers`] if the runtime\nrejects the execution."
        },
        {
          "name": "::FlowersClient::get_execution",
          "line": 163,
          "signature": "pub async fn get_execution(\n        &self,\n        id: &ExecutionId,\n    ) -> ForgeBridgeResult<Option<ExecutionInfo>>;",
          "documentation": "Queries the status of an execution.\n\n# Arguments\n\n* `id` - The execution ID to query.\n\n# Returns\n\nThe execution info if found, or `None` if the execution does not exist.\n\n# Errors\n\nReturns [`ForgeBridgeError::Flowers`] if the underlying store fails."
        },
        {
          "name": "::FlowersClient::cancel_execution",
          "line": 187,
          "signature": "pub async fn cancel_execution(&self, id: &ExecutionId) -> ForgeBridgeResult<()>;",
          "documentation": "Cancels a running execution.\n\nThe execution transitions to the `Cancelled` state. If the execution\nis already in a terminal state, the cancel is a no-op (Flowers will\nreturn an error that is propagated).\n\n# Arguments\n\n* `id` - The execution ID to cancel.\n\n# Errors\n\nReturns [`ForgeBridgeError::Flowers`] if the execution cannot be\ncancelled (e.g., not found, already terminal)."
        },
        {
          "name": "::FlowersClient::signal_execution",
          "line": 210,
          "signature": "pub async fn signal_execution(\n        &self,\n        id: &ExecutionId,\n        name: &str,\n        payload: serde_json::Value,\n    ) -> ForgeBridgeResult<()>;",
          "documentation": "Sends a signal to a running or suspended execution.\n\nSignals are the mechanism for external events (human approval,\nwebhook callbacks, timer expirations) to reach a durable execution.\nThe signal is persisted in the journal store and delivered to the\nexecution when it polls for signals.\n\n# Arguments\n\n* `id` - The execution ID to signal.\n* `name` - The signal name (e.g., `\"approval\"`, `\"webhook_response\"`).\n* `payload` - The signal payload as a JSON value.\n\n# Errors\n\nReturns [`ForgeBridgeError::Flowers`] if the signal cannot be written."
        },
        {
          "name": "::FlowersClient::list_executions",
          "line": 231,
          "signature": "pub async fn list_executions(&self) -> ForgeBridgeResult<Vec<ExecutionInfo>>;",
          "documentation": "Lists all active (non-terminal) executions.\n\n# Returns\n\nA vector of execution info for all active executions.\n\n# Errors\n\nReturns [`ForgeBridgeError::Flowers`] if the underlying store fails."
        },
        {
          "name": "::FlowersClient::runtime",
          "line": 243,
          "signature": "#[must_use]\npub fn runtime(&self) -> &FlowersRuntime;",
          "documentation": "Returns a reference to the underlying Flowers runtime.\n\nThis provides escape-hatch access to the full Flowers API for\nadvanced use cases (resume, recovery, direct journal access)."
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-flowers/src/error.rs",
      "sha256": "8a0824146ba62f3b4a11865223ec855e0b6b90657285c6d0a6d4284301b23f30",
      "artifactSha256": "d3927d47da4eb3f85710b26254776e29713bb9ddd8cae20dc68635acf5c5e287",
      "url": "/reference/source/forge-rs/crates/forge-flowers/src/error.rs.txt",
      "declarations": [
        {
          "name": "::ForgeBridgeError",
          "line": 18,
          "signature": "#[derive(Debug, Error)]\npub enum ForgeBridgeError {\n    /// The bridge failed to create a Forge agent via the factory.\n    ///\n    /// This typically indicates a misconfiguration: the factory could not\n    /// construct an agent with the given journaled provider and tool registry.\n    #[error(\"handler creation failed for agent '{agent_name}': {reason}\")]\n    HandlerCreationFailed {\n        /// The agent name that was being constructed.\n        agent_name: String,\n        /// Why construction failed.\n        reason: String,\n    },\n\n    /// A Brew node failed during execution within the workflow handler.\n    ///\n    /// Contains the node ID so the caller can identify which step in the\n    /// Brew plan caused the failure.\n    #[error(\"node '{node_id}' execution failed: {reason}\")]\n    NodeExecutionFailed {\n        /// The node that failed.\n        node_id: String,\n        /// Why execution failed.\n        reason: String,\n    },\n\n    /// The bridge could not map a `ResolvedBrewPlan` to a Flowers workflow.\n    ///\n    /// This indicates a structural problem with the plan: missing entry nodes,\n    /// empty execution order, or an invalid graph topology.\n    #[error(\"plan mapping failed for brew '{brew_id}': {reason}\")]\n    PlanMappingFailed {\n        /// The brew ID of the plan that could not be mapped.\n        brew_id: String,\n        /// Why the mapping failed.\n        reason: String,\n    },\n\n    /// During replay, the bridge detected that the input to a journaled call\n    /// does not match the cached input from the original execution.\n    ///\n    /// This is a hard error by default (fail closed). The execution must be\n    /// cancelled and restarted if the agent's inputs have changed.\n    #[error(\"replay input mismatch at interface '{interface}' method '{method}': {reason}\")]\n    ReplayInputMismatch {\n        /// The WIT interface of the mismatched call.\n        interface: String,\n        /// The method of the mismatched call.\n        method: String,\n        /// Description of what differed.\n        reason: String,\n    },\n\n    /// The bridge encountered a `ResolvedNodeKind` that it does not know how\n    /// to execute in the current version.\n    #[error(\"unsupported node kind '{kind}' in node '{node_id}': {reason}\")]\n    UnsupportedNodeKind {\n        /// The node ID containing the unsupported kind.\n        node_id: String,\n        /// The kind name that is not supported.\n        kind: String,\n        /// Additional context.\n        reason: String,\n    },\n\n    /// An error propagated from the Flowers runtime.\n    #[cfg(not(target_arch = \"wasm32\"))]\n    #[error(\"flowers runtime error: {0}\")]\n    Flowers(#[from] flowers::FlowersError),\n\n    /// A serialization or deserialization error during bridging.\n    #[error(\"serialization error in bridge: {0}\")]\n    Serialization(#[from] serde_json::Error),\n\n    /// An error propagated from the Forge agent layer.\n    #[error(\"forge agent error: {0}\")]\n    ForgeAgent(String),\n}",
          "documentation": "Errors produced by the Forge-Flowers bridge.\n\nThese errors cover the bridge-specific failure modes that do not originate\nin either Flowers or Forge independently, but arise from the interaction\nbetween the two systems."
        },
        {
          "name": "::ForgeBridgeResult",
          "line": 97,
          "signature": "pub type ForgeBridgeResult<T> = Result<T, ForgeBridgeError>;",
          "documentation": "Result alias for the Forge-Flowers bridge."
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-flowers/src/handler.rs",
      "sha256": "58f5c133b108a7556c9c311f0b5c5c0ca7c52268fd78f0db2103a7aed73a30b7",
      "artifactSha256": "fe5c7d69acbce497893f83114dbb397d416ed6b47555e03f0ad05f4c72b93566",
      "url": "/reference/source/forge-rs/crates/forge-flowers/src/handler.rs.txt",
      "declarations": [
        {
          "name": "::ForgeAgentFactory",
          "line": 70,
          "signature": "pub trait ForgeAgentFactory: Send + Sync {\n    /// Creates a Forge agent whose LLM calls and tool invocations are\n    /// routed through the Flowers execution context for journaling.\n    ///\n    /// # Arguments\n    ///\n    /// * `ctx` - The Flowers execution context for this workflow execution.\n    ///\n    /// # Returns\n    ///\n    /// A boxed [`Agent`] ready for execution within a Flowers workflow.\n    ///\n    /// # Errors\n    ///\n    /// Returns [`ForgeBridgeError::HandlerCreationFailed`] if agent\n    /// construction fails (e.g., missing configuration, provider not found).\n    fn build(&self, ctx: &ExecutionContext) -> Result<Box<dyn Agent>, ForgeBridgeError>;\n}",
          "documentation": "Factory trait for constructing Forge agents with journaled dependencies.\n\nImplementations create a [`Agent`] where all side-effects (LLM calls,\ntool invocations) are routed through the Flowers [`ExecutionContext`]\nfor journaling and replay.\n\n# Why This Exists\n\nThe agent cannot be pre-built because the [`ExecutionContext`] is only\navailable inside `WorkflowHandler::execute()`. The factory pattern\ndefers agent construction until the context is available, then injects\nthe journaled wrappers.\n\n# Implementors\n\nA typical implementation wraps the real `LanguageModel` in a\n[`JournaledProvider`](crate::interceptor::JournaledProvider) and creates a tool executor backed by a\n[`JournaledToolExecutor`](crate::interceptor::JournaledToolExecutor),\nthen constructs the agent with these journaled dependencies.\n\n# Lifetime\n\nThe `build` method receives the `ExecutionContext` by reference. The\nreturned agent must not borrow from the context -- instead, the factory\nshould use the [`JournaledProvider`](crate::interceptor::JournaledProvider) pattern to capture the context's\n`call()` behavior through owned closures or channels."
        },
        {
          "name": "::ForgeWorkflowHandler",
          "line": 110,
          "signature": "pub struct ForgeWorkflowHandler {\n\n}",
          "documentation": "Flowers workflow handler that wraps a single Forge agent.\n\nWhen Flowers calls `execute()`, the handler:\n1. Uses the [`ForgeAgentFactory`] to build an agent with journaled deps.\n2. Runs the agent via [`Agent::run()`] with the configured prompt.\n3. Returns the serialized [`AgentOutput`](forge_agent::agent::AgentOutput).\n\nDuring replay, all LLM and tool calls return cached results from the\njournal. The agent code runs unmodified.\n\n# Example Flow\n\n```text\nFlowersRuntime::start()\n  -> ForgeWorkflowHandler::execute(ctx)\n    -> factory.build(ctx)       // creates agent with JournaledProvider\n    -> agent.run(prompt)         // runs the tool loop\n      -> model.generate(...)     // routed through ctx.call(\"forge.llm\", \"generate\", ...)\n      -> tool.execute(...)       // routed through ctx.call(\"forge.tool\", \"execute:X\", ...)\n    -> serialize AgentOutput\n```"
        },
        {
          "name": "::ForgeWorkflowHandler::new",
          "line": 131,
          "signature": "pub fn new(\n        factory: Arc<dyn ForgeAgentFactory>,\n        config: AgentConfig,\n        prompt: impl Into<String>,\n    ) -> Self;",
          "documentation": "Creates a new `ForgeWorkflowHandler`.\n\n# Arguments\n\n* `factory` - Factory that builds agents with journaled dependencies.\n* `config` - The agent configuration.\n* `prompt` - The text prompt to run the agent with.\n\n# Returns\n\nA handler ready to be submitted to the Flowers runtime."
        },
        {
          "name": "::ForgeWorkflowHandler::config",
          "line": 145,
          "signature": "#[must_use]\npub fn config(&self) -> &AgentConfig;",
          "documentation": "Returns the agent configuration."
        },
        {
          "name": "::ForgeWorkflowHandler::prompt",
          "line": 151,
          "signature": "#[must_use]\npub fn prompt(&self) -> &str;",
          "documentation": "Returns the prompt."
        },
        {
          "name": "::BrewWorkflowHandler",
          "line": 203,
          "signature": "pub struct BrewWorkflowHandler {\n\n}",
          "documentation": "Flowers workflow handler that executes a [`ResolvedBrewPlan`] node by node.\n\nEach node in the plan's `execution_order` is executed as a journaled call\nthrough `ctx.call(\"brew\", &node_id, input, live_fn)`. This provides\nnode-level replay granularity: if the process crashes between nodes, only\nthe incomplete node is re-executed on resume.\n\nNode outputs are collected in a [`BTreeMap`] keyed by [`NodeId`]. The\nfinal result is the combined outputs of all exit nodes.\n\n# Execution Surface\n\nAgent steps are executed through a `ToolLoopAgent`, direct tool/web/MCP\nnodes execute through a registered [`ToolRegistry`], and `SubBrewRef` nodes\nrecursively execute registered child plans under a namespaced Flowers\njournal path. Missing executors fail closed instead of returning structural\noutput.\n\n# Execution Model\n\n```text\nfor node_id in plan.execution_order:\n    output = ctx.call(\"brew\", node_id, input, |input| execute_node(node))\n    node_outputs[node_id] = output\n\nreturn { exit_node_id: node_outputs[exit_node_id] for each exit node }\n```"
        },
        {
          "name": "::BrewWorkflowHandler::new",
          "line": 227,
          "signature": "pub fn new(plan: ResolvedBrewPlan, provider: Arc<dyn LanguageModel>) -> Self;",
          "documentation": "Creates a new `BrewWorkflowHandler`.\n\n# Arguments\n\n* `plan` - The resolved brew plan to execute.\n* `provider` - The language model provider for agent step nodes.\n\n# Returns\n\nA handler ready to be submitted to the Flowers runtime."
        },
        {
          "name": "::BrewWorkflowHandler::plan",
          "line": 239,
          "signature": "#[must_use]\npub fn plan(&self) -> &ResolvedBrewPlan;",
          "documentation": "Returns the brew plan."
        },
        {
          "name": "::BrewWorkflowHandler::with_tool_registry",
          "line": 245,
          "signature": "#[must_use]\npub fn with_tool_registry(mut self, tool_registry: ToolRegistry) -> Self;",
          "documentation": "Sets the tool registry used by tool, web, MCP, and agent-step nodes."
        },
        {
          "name": "::BrewWorkflowHandler::with_approval_handler",
          "line": 252,
          "signature": "#[must_use]\npub fn with_approval_handler(mut self, approval: Arc<dyn ApprovalHandler>) -> Self;",
          "documentation": "Sets the approval handler used before direct tool execution."
        },
        {
          "name": "::BrewWorkflowHandler::with_sub_plan",
          "line": 259,
          "signature": "#[must_use]\npub fn with_sub_plan(mut self, plan: ResolvedBrewPlan) -> Self;",
          "documentation": "Registers a resolved child plan for `SubBrewRef` execution."
        },
        {
          "name": "::BrewWorkflowHandler::with_sub_plans",
          "line": 266,
          "signature": "#[must_use]\npub fn with_sub_plans(mut self, plans: Vec<ResolvedBrewPlan>) -> Self;",
          "documentation": "Registers multiple resolved child plans for `SubBrewRef` execution."
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-flowers/src/interceptor.rs",
      "sha256": "933ac699c415348b87ecf052664ec09097734e89d884294e39763ef915a48cad",
      "artifactSha256": "310ad70b304d90fb792177a4dccb44097e26e4e3488e6ef1a5316b58e5ffee70",
      "url": "/reference/source/forge-rs/crates/forge-flowers/src/interceptor.rs.txt",
      "declarations": [
        {
          "name": "::JournaledProvider",
          "line": 62,
          "signature": "pub struct JournaledProvider<'ctx> {\n\n}",
          "documentation": "A journaled wrapper around a [`LanguageModel`] that routes all inference\ncalls through the Flowers [`ExecutionContext`].\n\nDuring replay, cached LLM responses are returned without calling the\nunderlying provider. During live execution, the real provider is called\nand the result is journaled for future replay.\n\n# Journal Event Format\n\n- **Interface**: `\"forge.llm\"`\n- **Method**: `\"generate\"` for buffered calls, `\"stream\"` for streaming\n- **Input**: serialized `{model_id, messages, tools, options}`\n- **Output**: serialized `GenerateResult` or `Vec<StreamChunk>`\n\n# Lifetime\n\nThe `JournaledProvider` borrows the [`ExecutionContext`] for the duration\nof the workflow execution. It is constructed inside\n`WorkflowHandler::execute()` and must not outlive the context reference."
        },
        {
          "name": "::JournaledProvider<'ctx>::new",
          "line": 80,
          "signature": "pub fn new(inner: Arc<dyn LanguageModel>, ctx: &'ctx ExecutionContext) -> Self;",
          "documentation": "Creates a new journaled provider wrapping the given model.\n\n# Arguments\n\n* `inner` - The real language model to wrap.\n* `ctx` - The Flowers execution context for journaling calls.\n\n# Returns\n\nA `JournaledProvider` that routes all calls through the context."
        },
        {
          "name": "::JournaledProvider<'ctx>::model_id",
          "line": 85,
          "signature": "pub fn model_id(&self) -> &str;",
          "documentation": "Returns the inner model's ID."
        },
        {
          "name": "::JournaledProvider<'ctx>::provider",
          "line": 90,
          "signature": "pub fn provider(&self) -> &str;",
          "documentation": "Returns the inner model's provider namespace."
        },
        {
          "name": "::JournaledProvider<'ctx>::generate",
          "line": 113,
          "signature": "pub async fn generate(\n        &self,\n        messages: &[ModelMessage],\n        tools: &[ToolDefinition],\n        options: &GenerateOptions,\n    ) -> Result<GenerateResult, FlowersError>;",
          "documentation": "Executes a buffered generate call through the Flowers journal.\n\nDuring replay, the cached LLM response is returned without calling\nthe provider. During live execution, the real provider is called and\nthe result is journaled.\n\n# Arguments\n\n* `messages` - The conversation history.\n* `tools` - Available tool definitions.\n* `options` - Generation options.\n\n# Returns\n\nThe `GenerateResult` from either the journal cache or the live provider.\n\n# Errors\n\nReturns [`FlowersError`] if replay diverges or the live call fails."
        },
        {
          "name": "::JournaledProvider<'ctx>::stream",
          "line": 174,
          "signature": "pub async fn stream(\n        &self,\n        messages: &[ModelMessage],\n        tools: &[ToolDefinition],\n        options: &GenerateOptions,\n    ) -> Result<Vec<StreamChunk>, FlowersError>;",
          "documentation": "Executes a streaming call through the Flowers journal.\n\nStreaming calls are collected into a complete response and journaled\nas a single event. See module-level docs for the rationale.\n\n# Arguments\n\n* `messages` - The conversation history.\n* `tools` - Available tool definitions.\n* `options` - Generation options.\n\n# Returns\n\nThe complete stream chunks from either the journal cache or the live\nprovider.\n\n# Errors\n\nReturns [`FlowersError`] if replay diverges or the live call fails."
        },
        {
          "name": "::JournaledToolExecutor",
          "line": 241,
          "signature": "pub struct JournaledToolExecutor<'ctx> {\n\n}",
          "documentation": "A journaled wrapper for tool execution that routes calls through the\nFlowers [`ExecutionContext`].\n\nDuring replay, cached tool results are returned without executing the\nreal tool. During live execution, the real tool is executed and the\nresult is journaled.\n\n# Journal Event Format\n\n- **Interface**: `\"forge.tool\"`\n- **Method**: `\"execute:{tool_id}\"` (includes the tool name for\n  divergence diagnostics)\n- **Input**: serialized `{tool_id, parameters}`\n- **Output**: serialized tool result\n\n# Lifetime\n\nBorrows the [`ExecutionContext`] for the duration of the workflow\nexecution. Must not outlive the `execute()` scope."
        },
        {
          "name": "::JournaledToolExecutor<'ctx>::new",
          "line": 252,
          "signature": "pub fn new(ctx: &'ctx ExecutionContext) -> Self;",
          "documentation": "Creates a new journaled tool executor.\n\n# Arguments\n\n* `ctx` - The Flowers execution context for journaling calls."
        },
        {
          "name": "::JournaledToolExecutor<'ctx>::execute",
          "line": 274,
          "signature": "pub async fn execute<F, Fut>(\n        &self,\n        tool_id: &str,\n        parameters: serde_json::Value,\n        execute_fn: F,\n    ) -> Result<serde_json::Value, FlowersError>\n    where\n        F: FnOnce(serde_json::Value) -> Fut + Send,\n        Fut: std::future::Future<Output = Result<serde_json::Value, FlowersError>> + Send,;",
          "documentation": "Executes a tool call through the Flowers journal.\n\nDuring replay, the cached result is returned. During live execution,\nthe provided `execute_fn` is called and its result is journaled.\n\n# Arguments\n\n* `tool_id` - The identifier of the tool being executed.\n* `parameters` - The tool call parameters as a JSON value.\n* `execute_fn` - The function that performs the real tool execution.\n\n# Returns\n\nThe tool execution result as a JSON value.\n\n# Errors\n\nReturns [`FlowersError`] if replay diverges or the live function fails."
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-flowers/src/lib.rs",
      "sha256": "1358caacc8dd7f9b607e1e1c99e64500d4aa789c1b90945503d1de1a5023feb5",
      "artifactSha256": "caaa9f75ada6fa5535da7c9fbb9cd401991ddf22844a48d2d01a8f59f3a4d217",
      "url": "/reference/source/forge-rs/crates/forge-flowers/src/lib.rs.txt",
      "declarations": [
        {
          "name": "client",
          "line": 74,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub mod client;",
          "documentation": "Forge-Flowers Bridge -- durable execution for Forge agents and Brew plans.\n\nThis crate bridges Forge agents and resolved brew plans to the Flowers\ndurable execution runtime. It implements Flowers'\n[`WorkflowHandler`](flowers::WorkflowHandler) trait, wrapping Forge\noperations in journaled calls that survive process crashes.\n\n# Architecture\n\n```text\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Forge Agent  \u2502     \u2502  forge-flowers    \u2502     \u2502 Flowers Runtime  \u2502\n\u2502 (unmodified) \u2502\u2500\u2500\u2500\u2500>\u2502  (this crate)     \u2502\u2500\u2500\u2500\u2500>\u2502 (journaling,     \u2502\n\u2502              \u2502     \u2502                   \u2502     \u2502  replay, crash   \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518     \u2502  recovery)       \u2502\n                             \u2502                 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                             \u2502\n                    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n                    \u2502                 \u2502\n             JournaledProvider  JournaledToolExecutor\n             (routes LLM calls  (routes tool calls\n              through journal)   through journal)\n```\n\n# Key Components\n\n- [`handler::ForgeWorkflowHandler`] -- wraps a single Forge agent as a\n  Flowers workflow. The agent's LLM and tool calls are journaled.\n\n- [`handler::BrewWorkflowHandler`] -- wraps a\n  [`ResolvedBrewPlan`](forge_core::brew_resolver::ResolvedBrewPlan) as a\n  Flowers workflow. Each node is executed as a journaled call.\n\n- [`interceptor::JournaledProvider`] -- wraps a\n  [`LanguageModel`](forge_core::model::LanguageModel), routing\n  `generate()` and `stream()` calls through\n  [`ExecutionContext::call()`](flowers::ExecutionContext::call).\n\n- [`interceptor::JournaledToolExecutor`] -- wraps tool execution,\n  routing each tool call through the Flowers journal.\n\n- [`client::FlowersClient`] -- Rust-native client surface wrapping\n  [`FlowersRuntime`](flowers::FlowersRuntime) for submitting, querying,\n  cancelling, and signaling executions.\n\n- [`state`] -- bidirectional mapping between Forge's 6-state ANVIL\n  lifecycle and Flowers' 7-state execution model.\n\n- [`plan`] -- maps [`ResolvedBrewPlan`](forge_core::brew_resolver::ResolvedBrewPlan)\n  to Flowers [`WorkflowId`](flowers::WorkflowId) and\n  [`ExecutionInfo`](flowers::ExecutionInfo).\n\n# Replay Safety\n\nThe bridge guarantees deterministic replay when the agent's control flow\ndepends only on journaled call outputs. Ambient non-determinism (system\nclock, random numbers, environment variables) must be routed through the\njournal by the agent author.\n\nReplay input mismatches are hard errors by default (fail closed). This\nprevents unsound cached results from being returned for different inputs.\n\n# What This Crate Does NOT Do\n\n- **HTTP wire protocol**: Non-Rust SDKs connect to a Flowers host over\n  HTTP. That protocol layer is a separate service crate.\n- **Modify Flowers**: This crate adapts to Flowers as-is. It does not\n  add, change, or remove any Flowers API.\n- **Implement agent logic**: The agent runs unmodified. This crate only\n  wraps the side-effect boundary."
        },
        {
          "name": "error",
          "line": 75,
          "signature": "pub mod error;",
          "documentation": ""
        },
        {
          "name": "handler",
          "line": 77,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub mod handler;",
          "documentation": ""
        },
        {
          "name": "interceptor",
          "line": 79,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub mod interceptor;",
          "documentation": ""
        },
        {
          "name": "plan",
          "line": 81,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub mod plan;",
          "documentation": ""
        },
        {
          "name": "state",
          "line": 83,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub mod state;",
          "documentation": ""
        },
        {
          "name": "pub use client::FlowersClient;",
          "line": 87,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub use client::FlowersClient;",
          "documentation": ""
        },
        {
          "name": "pub use error::{ForgeBridgeError, ForgeBridgeResult};",
          "line": 88,
          "signature": "pub use error::{ForgeBridgeError, ForgeBridgeResult};",
          "documentation": ""
        },
        {
          "name": "pub use handler::{BrewWorkflowHandler, ForgeAgentFactory, ForgeWorkflowHandler};",
          "line": 90,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub use handler::{BrewWorkflowHandler, ForgeAgentFactory, ForgeWorkflowHandler};",
          "documentation": ""
        },
        {
          "name": "pub use interceptor::{JournaledProvider, JournaledToolExecutor};",
          "line": 92,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub use interceptor::{JournaledProvider, JournaledToolExecutor};",
          "documentation": ""
        },
        {
          "name": "pub use plan::{execution_info_from_plan, plan_to_workflow_id};",
          "line": 94,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub use plan::{execution_info_from_plan, plan_to_workflow_id};",
          "documentation": ""
        },
        {
          "name": "pub use state::{flowers_state_to_forge, forge_state_to_flowers};",
          "line": 96,
          "signature": "#[cfg(not(target_arch = \"wasm32\"))]\npub use state::{flowers_state_to_forge, forge_state_to_flowers};",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-flowers/src/plan.rs",
      "sha256": "d6fbbac08ec72f9aa52f5a81d49d5aaa47e5d61818bd1862e1e62836daddf09c",
      "artifactSha256": "0d441d13586b0a01c6acc2dc3ef9edc4ec3ec650dc4b139d8d5a665f3e6915f1",
      "url": "/reference/source/forge-rs/crates/forge-flowers/src/plan.rs.txt",
      "declarations": [
        {
          "name": "::plan_to_workflow_id",
          "line": 40,
          "signature": "#[must_use]\npub fn plan_to_workflow_id(plan: &ResolvedBrewPlan) -> WorkflowId;",
          "documentation": "Maps a [`ResolvedBrewPlan`] to a Flowers [`WorkflowId`].\n\nThe plan's deterministic `plan_id` (a BLAKE3 hash of\n`brew_id || brew_version || environment_hash`) is used directly as the\nFlowers workflow identifier. This ensures that the same brew resolved\nagainst the same environment always maps to the same workflow ID.\n\n# Arguments\n\n* `plan` - The resolved brew plan to map.\n\n# Returns\n\nA Flowers `WorkflowId` derived from the plan ID.\n\n# Examples\n\n```\n# use forge_core::brew_resolver::ResolvedBrewPlan;\n# use forge_flowers::plan::plan_to_workflow_id;\n// Given a plan with plan_id \"abc123...\", the workflow ID is \"forge-brew:abc123...\"\n```"
        },
        {
          "name": "::execution_info_from_plan",
          "line": 63,
          "signature": "pub fn execution_info_from_plan(plan: &ResolvedBrewPlan) -> ForgeBridgeResult<ExecutionInfo>;",
          "documentation": "Creates initial Flowers [`ExecutionInfo`] metadata from a\n[`ResolvedBrewPlan`].\n\nThis is used when submitting a new Brew execution to the Flowers runtime.\nThe execution starts in `Pending` state with no journal events.\n\n# Arguments\n\n* `plan` - The resolved brew plan to create execution info for.\n\n# Returns\n\nA `ForgeBridgeResult` containing the initial execution info, or an error\nif the plan has structural problems (e.g., empty execution order).\n\n# Errors\n\nReturns [`ForgeBridgeError::PlanMappingFailed`] if the plan has no\nexecution order entries."
        }
      ]
    },
    {
      "path": "forge-rs/crates/forge-flowers/src/state.rs",
      "sha256": "517ddd81ccf9a44e3718fbd952af13a656f8f895b354d197825ff240fbf38ac5",
      "artifactSha256": "509c198398f9b0d9690a9aed0f4486e88bd0a4fc259f68b4a175b32ebb663170",
      "url": "/reference/source/forge-rs/crates/forge-flowers/src/state.rs.txt",
      "declarations": [
        {
          "name": "::forge_state_to_flowers",
          "line": 60,
          "signature": "#[must_use]\npub fn forge_state_to_flowers(forge_state: LifecycleState) -> ExecutionState;",
          "documentation": "Maps a Forge [`LifecycleState`] to the closest Flowers [`ExecutionState`].\n\nThis mapping is used when reporting Forge agent state to the Flowers\nruntime. The mapping is intentionally conservative: ambiguous cases\nmap to the safer state.\n\n# Mapping\n\n| Input | Output |\n|-------|--------|\n| `Initializing` | `Pending` |\n| `Ready` | `Pending` |\n| `Running` | `Running` |\n| `Paused` | `Suspended` |\n| `Error` | `Failed` |\n| `Terminated` | `Completed` |\n\n# Arguments\n\n* `forge_state` - The Forge lifecycle state to map.\n\n# Returns\n\nThe corresponding Flowers execution state."
        },
        {
          "name": "::flowers_state_to_forge",
          "line": 97,
          "signature": "#[must_use]\npub fn flowers_state_to_forge(flowers_state: ExecutionState) -> LifecycleState;",
          "documentation": "Maps a Flowers [`ExecutionState`] to the closest Forge [`LifecycleState`].\n\nThis mapping is used when translating Flowers execution status back to\nthe Forge ANVIL lifecycle model. The `Replaying` state (Flowers-only)\nmaps to `Running` because the agent is actively executing.\n\n# Mapping\n\n| Input | Output |\n|-------|--------|\n| `Pending` | `Initializing` |\n| `Running` | `Running` |\n| `Suspended` | `Paused` |\n| `Completed` | `Terminated` |\n| `Failed` | `Error` |\n| `Cancelled` | `Terminated` |\n| `Replaying` | `Running` |\n\n# Arguments\n\n* `flowers_state` - The Flowers execution state to map.\n\n# Returns\n\nThe corresponding Forge lifecycle state."
        }
      ]
    }
  ]
}
