# Agent

AgentService creates, reads and changes agents, with their mail, transcripts, documents and reviews.

`komrad.agent.v1.AgentService`

-   [`list_agents`](https://komrad.dev/latest/api/agent/list-agents.md)
    
    List the agents komrad tracks, most recently updated first.
    
-   [`get_agent`](https://komrad.dev/latest/api/agent/get-agent.md)
    
    Get one agent by id, archived or not, with its prompt in full.
    
-   [`create_agent`](https://komrad.dev/latest/api/agent/create-agent.md)
    
    Create an agent and launch it with a prompt.
    
-   [`request_review`](https://komrad.dev/latest/api/agent/request-review.md)
    
    Create a reviewer for the caller's committed work, on the caller's task and in the caller's checkout.
    
-   [`adopt`](https://komrad.dev/latest/api/agent/adopt.md)
    
    Create an agent on a branch that already exists, such as one the person pushed.
    
-   [`log`](https://komrad.dev/latest/api/agent/log.md)
    
    Write one line to komrad's log, under the caller unless \`id\` names another agent.
    
-   [`send_mail`](https://komrad.dev/latest/api/agent/send-mail.md)
    
    Send mail to another agent by \`to\_agent\_id\` or \`to\_agent\_name\`, setting \`reply\_to\` when answering.
    
-   [`forward_last_turns`](https://komrad.dev/latest/api/agent/forward-last-turns.md)
    
    Send an agent's latest turns to another agent as mail, without the text passing through the caller.
    
-   [`read_mail`](https://komrad.dev/latest/api/agent/read-mail.md)
    
    Read the caller's waiting mail, oldest first.
    
-   [`list_mail`](https://komrad.dev/latest/api/agent/list-mail.md)
    
    List an agent's mail without claiming it, most recent first.
    
-   [`get_mail`](https://komrad.dev/latest/api/agent/get-mail.md)
    
    Get one mail by id with its body whole, read or not, without claiming it.
    
-   [`delete_mail`](https://komrad.dev/latest/api/agent/delete-mail.md)
    
    Delete mail for good by id, read or not.
    
-   [`archive_agents`](https://komrad.dev/latest/api/agent/archive-agents.md)
    
    Archive agents, stopping each and keeping its record and transcript for \`restore\_agents\`.
    
-   [`restore_agents`](https://komrad.dev/latest/api/agent/restore-agents.md)
    
    Restore archived agents, dormant, with their workflows.
    
-   [`resume_agent`](https://komrad.dev/latest/api/agent/resume-agent.md)
    
    Resume an agent on its existing conversation, such as when its pane died.
    
-   [`restart_agent`](https://komrad.dev/latest/api/agent/restart-agent.md)
    
    Restart a task's writer or a workflow's orchestrator on a new conversation.
    
-   [`retry_agent`](https://komrad.dev/latest/api/agent/retry-agent.md)
    
    Retry an agent whose create failed, with new flags, prompt or harness if given.
    
-   [`rename_agent`](https://komrad.dev/latest/api/agent/rename-agent.md)
    
    Rename an agent by id.
    
-   [`search_transcripts`](https://komrad.dev/latest/api/agent/search-transcripts.md)
    
    Search transcripts by full text, archived agents included.
    
-   [`get_transcript`](https://komrad.dev/latest/api/agent/get-transcript.md)
    
    Read an agent's whole transcript, one window at a time, passing the returned cursor back to read on.
    
-   [`get_last_turns`](https://komrad.dev/latest/api/agent/get-last-turns.md)
    
    Read the newest turns of an agent's transcript.
    
-   [`write_document`](https://komrad.dev/latest/api/agent/write-document.md)
    
    Write a markdown document for the person, as a type from \`list\_document\_types\` and following its context.
    
-   [`list_documents`](https://komrad.dev/latest/api/agent/list-documents.md)
    
    List the documents agents have written, without their bodies.
    
-   [`search_documents`](https://komrad.dev/latest/api/agent/search-documents.md)
    
    Search documents by full text, reading each as it is now and never an earlier version.
    
-   [`get_document`](https://komrad.dev/latest/api/agent/get-document.md)
    
    Read one document in full, or an earlier version of it.
    
-   [`list_document_versions`](https://komrad.dev/latest/api/agent/list-document-versions.md)
    
    List every write of a document, newest first, saying which the person made.
    
-   [`list_document_types`](https://komrad.dev/latest/api/agent/list-document-types.md)
    
    List the document types with their contexts.
    
-   [`get_document_type`](https://komrad.dev/latest/api/agent/get-document-type.md)
    
    Read one document type and its context by name.
    
-   [`list_document_type_versions`](https://komrad.dev/latest/api/agent/list-document-type-versions.md)
    
    List every write of a document type, newest first.
    
-   [`write_document_type`](https://komrad.dev/latest/api/agent/write-document-type.md)
    
    Create a document type, or rewrite the one \`id\` names, passing the version last read.
    
-   [`delete_documents`](https://komrad.dev/latest/api/agent/delete-documents.md)
    
    Delete documents and every earlier version of each.
    
-   [`delete_document_type`](https://komrad.dev/latest/api/agent/delete-document-type.md)
    
    Delete a document type.
    
-   [`list_review_threads`](https://komrad.dev/latest/api/agent/list-review-threads.md)
    
    List the threads on a task's diff, the caller's task by default.
    
-   [`get_review_thread`](https://komrad.dev/latest/api/agent/get-review-thread.md)
    
    Get one thread on a task's diff by id, with its quoted lines and every comment whole.
    
-   [`create_review_thread`](https://komrad.dev/latest/api/agent/create-review-thread.md)
    
    Start a thread on a line range of the diff under review, with the diff lines as \`quoted\_lines\` and the snapshot's \`sha\` as \`snapshot\_sha\`, or on the change as a whole without a file or lines.
    
-   [`add_review_message`](https://komrad.dev/latest/api/agent/add-review-message.md)
    
    Reply in a thread on the caller's own diff.
    
-   [`plan_rebase`](https://komrad.dev/latest/api/agent/plan-rebase.md)
    
    Preview a rebase of a task's branch onto its base branch without moving anything: what would be replayed, dropped and flattened, and which paths may conflict.
    
-   [`rebase_worktree`](https://komrad.dev/latest/api/agent/rebase-worktree.md)
    
    Rebase a task's branch onto the newest commit of its base branch.
    
-   [`plan_push`](https://komrad.dev/latest/api/agent/plan-push.md)
    
    Preview a push of a task's branch to origin without pushing anything.
    
-   [`push_worktree`](https://komrad.dev/latest/api/agent/push-worktree.md)
    
    Push a task's branch to origin under its own name.
    
-   [`pick_fork_point`](https://komrad.dev/latest/api/agent/pick-fork-point.md)
    
    Record the fork point of an orphaned child, the commit its own commits sit on.
    
-   [`abort_sequence`](https://komrad.dev/latest/api/agent/abort-sequence.md)
    
    Abort the sequence in a task's checkout.
    
-   [`start_orchestrator`](https://komrad.dev/latest/api/agent/start-orchestrator.md)
    
    Resume a workflow's orchestrator, or create one when the workflow has none.
    
-   [`resolve_review_thread`](https://komrad.dev/latest/api/agent/resolve-review-thread.md)
    
    Resolve a thread, or reopen one.
    
-   [`take_review_snapshot`](https://komrad.dev/latest/api/agent/take-review-snapshot.md)
    
    Take a snapshot of a task's checkout to review, the caller's task by default.
    
-   [`list_review_snapshots`](https://komrad.dev/latest/api/agent/list-review-snapshots.md)
    
    List the snapshots of a task, the caller's task by default, oldest first.
    
-   [`list_reviews`](https://komrad.dev/latest/api/agent/list-reviews.md)
    
    List the reviews released on a task, the caller's task by default, in snapshot order, each with its verdict.
    
-   [`get_review`](https://komrad.dev/latest/api/agent/get-review.md)
    
    Read one released review in full: the verdict, the note on the work, then each thread with the code it is pinned to.
    
-   [`release_review`](https://komrad.dev/latest/api/agent/release-review.md)
    
    Release the caller's review with a verdict: approved only when the caller started no thread on the snapshot, changes requested when it started any.
