Skip to content

Commit 47ef758

Browse files
iqdoctorevalstate
andauthored
REPL. New AgentCard in md fromat and CLI loading/lazy hot swap with --agent-cards | --watch | --reload options. New workflow-md samples (#585)
* Add AgentCard RFC and samples * Add AgentCard reload/watch and workflow dumps Implement incremental AgentCard reloads with mtime/size cache and registry_version tracking. Wire /reload into the TUI and expose refresh callbacks on AgentApp. Add lazy shared-instance hot-swap for MCP/ACP servers and dispose stale instances when idle. Export workflow examples as AgentCards under examples/workflows-md. Document reload/watch semantics and watchfiles fallback in plan/agent-card-rfc.md. * Add CLI agent-cards loading Introduce --agent-cards with --watch/--reload support in fast-agent go. Update AgentCard RFC examples for CLI usage and one-shot messages. Add workflows-md symlinks for local config and short_story examples. * Replace workflows-md symlinks with files * Fix typecheck issues in examples and Azure auth * Adjust Azure import ignore for typecheck * Skip null agent-as-tools fields in dumps * (unrelated to PR) fix uvloop tty blocking * tool example * example agent with functions agent card at url --card alias allow use from `serve` * lint * (markdown render change) improve error handling for Agent Cards * agent card default type "agent". update test signature * Update AgentCard and hook-tool specs * Make --card the primary AgentCard flag * Add --dump alias for AgentCard export * Merge hook-tool declarative specs * Refine hook-tool AgentCard example * Align hook-tool declarative spec examples * Update hook-tool examples plan * add /card and /card <foo> --tool * update rfc, add description to hf api tool * Docs: clarify history controls and next-stage work * Docs: simplify history controls * Docs: clarify orchestrator-owned history fields * Docs: reorder history options * Docs: describe history option semantics * Docs: note stateless /card --tool MVP * Docs: align history defaults and CLI order * ToolAgent: spawn stateless clones for agent tools * ToolAgent: tighten add_agent_tool type * ToolAgent: drop unused AgentProtocol import * Fix typing in elicitation example * Fix ruff typing.cast quoting * Add stateless add_agent_tool test * Refine AGENTS guidance and test override * add progress notifications; fix tool definitions for detached agents. * use model in card as precedent * typecheck/lint --------- Co-authored-by: evalstate <[email protected]>
1 parent b4ecb06 commit 47ef758

File tree

77 files changed

+4822
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4822
-31
lines changed

AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
Present links to images and other content in Markdown links -- for example: ![Image](https://link.to.image)
1+
## fast-agent contributor notes
22

3+
- Use `uv run` for repo scripts and examples.
4+
- Always run `uv run scripts/lint.py` and `uv run scripts/typecheck.py` after code changes.
5+
- Keep examples under `examples/` in sync with packaged resources when relevant.
6+
- Prefer small, focused diffs; avoid reformatting unrelated code.
7+
- Use Markdown links for images and other content (example: `![Image](https://link.to.image)`).

examples/mcp/elicitations/elicitation_forms_server.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import logging
99
import sys
10-
from typing import Optional, TypedDict
10+
from typing import Optional, TypedDict, cast
1111

1212
from mcp import ReadResourceResult
1313
from mcp.server.elicitation import (
@@ -51,7 +51,10 @@ def _create_enum_schema_options(data: dict[str, str]) -> list[TitledEnumOption]:
5151
>>> _create_enum_schema_options({"dark": "Dark Mode", "light": "Light Mode"})
5252
[{"const": "dark", "title": "Dark Mode"}, {"const": "light", "title": "Light Mode"}]
5353
"""
54-
return [{"const": k, "title": v} for k, v in data.items()]
54+
options: list[TitledEnumOption] = [
55+
cast("TitledEnumOption", {"const": k, "title": v}) for k, v in data.items()
56+
]
57+
return options
5558

5659

5760
@mcp.resource(uri="elicitation://event-registration")

examples/mcp/elicitations/game_character_handler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ async def game_character_elicitation_handler(
3333
"""Custom handler that creates an interactive character creation experience."""
3434
logger.info(f"Game character elicitation handler called: {params.message}")
3535

36-
if params.requestedSchema:
37-
properties = params.requestedSchema.get("properties", {})
36+
requested_schema = getattr(params, "requestedSchema", None)
37+
if requested_schema:
38+
properties = requested_schema.get("properties", {})
3839
content: dict[str, Any] = {}
3940

4041
console.print("\n[bold magenta]🎮 Character Creation Studio 🎮[/bold magenta]\n")

examples/tensorzero/simple_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def main():
1818
async with fast.run() as agent_app:
1919
agent_name = "default"
2020
print("\nStarting interactive session with template_vars set via decorator...")
21-
await agent_app.interactive(agent=agent_name)
21+
await agent_app.interactive(agent_name=agent_name)
2222

2323

2424
if __name__ == "__main__":
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
type: agent
3+
name: London-Project-Manager
4+
servers:
5+
- time
6+
- fetch
7+
---
8+
You are a London project manager. For each given topic, get the current local time in London and a brief, project-relevant news summary using the 'time' and 'fetch' MCP servers. If a source returns HTTP 403 or is blocked by robots.txt, try up to five alternative public sources before giving up and clearly state any remaining access limits. Hint: BBC: https://www.bbc.com/ and FT: https://www.ft.com/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
type: agent
3+
name: NY-Project-Manager
4+
servers:
5+
- time
6+
- fetch
7+
---
8+
You are a New York project manager. For each given topic, get the current local time in New York and a brief, project-relevant news summary using the 'time' and 'fetch' MCP servers. If a source returns HTTP 403 or is blocked by robots.txt, try up to five alternative public sources before giving up and clearly state any remaining access limits. Hint: Fast-Agent site: https://fast-agent.ai
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
type: agent
3+
name: PMO-orchestrator
4+
default: true
5+
agents:
6+
- NY-Project-Manager
7+
- London-Project-Manager
8+
history_mode: scratch
9+
max_parallel: 128
10+
child_timeout_sec: 120
11+
max_display_instances: 20
12+
---
13+
Get project updates from the New York and London project managers. Ask NY-Project-Manager three times about different projects: Anthropic, evalstate/fast-agent, and OpenAI, and London-Project-Manager for economics review. Return a brief, concise combined summary with clear city/time/topic labels.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
type: agent
3+
name: London-Project-Manager
4+
servers:
5+
- time
6+
---
7+
Return London time + timezone, plus a one-line news update.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
type: agent
3+
name: NY-Project-Manager
4+
servers:
5+
- time
6+
---
7+
Return NY time + timezone, plus a one-line project status.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
type: agent
3+
name: PMO-orchestrator
4+
default: true
5+
agents:
6+
- NY-Project-Manager
7+
- London-Project-Manager
8+
---
9+
Get reports. Always use one tool call per project/news. Responsibilities: NY projects: [OpenAI, Fast-Agent, Anthropic]. London news: [Economics, Art, Culture]. Aggregate results and add a one-line PMO summary.

0 commit comments

Comments
 (0)