WIP: Output tool via Arc<Mutex<Subconscious>>, ToolHandler to Arc<dyn Fn>
- ToolHandler changed to Arc<dyn Fn(...)> (supports closures) - Subconscious wrapped in Arc<Mutex<>> on Mind - init_output_tool() pushes output tool closure capturing the Arc - Output removed from static memory_tools() - Most tool handlers wrapped in Arc::new() but some have paren issues Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
d167b11283
commit
12798eeae2
15 changed files with 74 additions and 51 deletions
|
|
@ -663,31 +663,31 @@ pub fn digest_tools() -> [super::super::agent::tools::Tool; 5] {
|
|||
name: "digest_daily",
|
||||
description: "Generate a daily digest from journal entries.",
|
||||
parameters_json: r#"{"type":"object","properties":{"date":{"type":"string","description":"Date in YYYY-MM-DD format"}}, "required":["date"]}"#,
|
||||
handler: |_a, v| Box::pin(async move { handle_digest_daily(_a, v).await }),
|
||||
handler: Arc::new(|_a, v| Box::pin(async move { handle_digest_daily(_a, v).await }),
|
||||
},
|
||||
Tool {
|
||||
name: "digest_weekly",
|
||||
description: "Generate a weekly digest from daily digests.",
|
||||
parameters_json: r#"{"type":"object","properties":{"week":{"type":"string","description":"Week label (YYYY-W##) or date (YYYY-MM-DD)"}}, "required":["week"]}"#,
|
||||
handler: |_a, v| Box::pin(async move { handle_digest_weekly(_a, v).await }),
|
||||
handler: Arc::new(|_a, v| Box::pin(async move { handle_digest_weekly(_a, v).await }),
|
||||
},
|
||||
Tool {
|
||||
name: "digest_monthly",
|
||||
description: "Generate a monthly digest from weekly digests.",
|
||||
parameters_json: r#"{"type":"object","properties":{"month":{"type":"string","description":"Month label (YYYY-MM) or date (YYYY-MM-DD)"}}, "required":["month"]}"#,
|
||||
handler: |_a, v| Box::pin(async move { handle_digest_monthly(_a, v).await }),
|
||||
handler: Arc::new(|_a, v| Box::pin(async move { handle_digest_monthly(_a, v).await }),
|
||||
},
|
||||
Tool {
|
||||
name: "digest_auto",
|
||||
description: "Auto-generate all missing digests (daily, weekly, monthly) for past dates that have content but no digest yet.",
|
||||
parameters_json: r#"{"type":"object","properties":{}}"#,
|
||||
handler: |_a, v| Box::pin(async move { handle_digest_auto(_a, v).await }),
|
||||
handler: Arc::new(|_a, v| Box::pin(async move { handle_digest_auto(_a, v).await }),
|
||||
},
|
||||
Tool {
|
||||
name: "digest_links",
|
||||
description: "Parse and apply structural links from digest nodes to the memory graph.",
|
||||
parameters_json: r#"{"type":"object","properties":{}}"#,
|
||||
handler: |_a, v| Box::pin(async move { handle_digest_links(_a, v).await }),
|
||||
handler: Arc::new(|_a, v| Box::pin(async move { handle_digest_links(_a, v).await }),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue