diff --git a/README.md b/README.md index 573c1e3..113c7a1 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,61 @@ while (page["cursor"] != null) --- -## Approvals +## Human-in-the-Loop (8 Task Types) + +AXME supports 8 human task types. Each pauses the workflow and notifies a human via email with a link to a web task page. + +| Task type | Use case | Default outcomes | +|-----------|----------|-----------------| +| `approval` | Approve or reject a request | approved, rejected | +| `confirmation` | Confirm a real-world action completed | confirmed, denied | +| `review` | Review content with multiple outcomes | approved, changes_requested, rejected | +| `assignment` | Assign work to a person or team | assigned, declined | +| `form` | Collect structured data via form fields | submitted | +| `clarification` | Request clarification (comment required) | provided, declined | +| `manual_action` | Physical task completion (evidence required) | completed, failed | +| `override` | Override a policy gate (comment required) | override_approved, rejected | + +```csharp +// Create an intent with a human task step +var result = await client.CreateIntentAsync(new CreateIntentParams +{ + IntentType = "intent.budget.approval.v1", + ToAgent = "agent://agent_core", + Payload = new Dictionary { ["amount"] = 32000, ["department"] = "engineering" }, + HumanTask = new HumanTask + { + Title = "Approve Q3 budget", + Description = "Review and approve the Q3 infrastructure budget.", + TaskType = "approval", + NotifyEmail = "approver@example.com", + AllowedOutcomes = new[] { "approved", "rejected" }, + }, +}); +``` + +Task types with forms use `form_schema` to define required fields: + +```csharp +HumanTask = new HumanTask +{ + Title = "Assign incident commander", + TaskType = "assignment", + NotifyEmail = "oncall@example.com", + FormSchema = new JsonObject + { + ["type"] = "object", + ["required"] = new JsonArray("assignee"), + ["properties"] = new JsonObject + { + ["assignee"] = new JsonObject { ["type"] = "string", ["title"] = "Commander name" }, + ["priority"] = new JsonObject { ["type"] = "string", ["enum"] = new JsonArray("P1", "P2", "P3") }, + }, + }, +}, +``` + +### Programmatic approvals (inbox API) ```csharp var inbox = await client.ListInboxAsync(