← Public packages
@hypercubed/handoff
Agent handoff queue via storage — any agent to any agent, use your own harness name
Files
Pickup
Continue work that another agent handed off through Kody @hypercubed/handoff. Approval comes first: read and show the task, and only claim it after the user says go.
Steps
- Read, do not claim. Call
getTask({ taskId })with the id from the user's message. If the task is missing or its status is notpending, stop and tell the user (include the status andclaimedByif it is already claimed). - Show it and wait. Present the title,
createdBy,forAgent, priority, tags, and the full prompt. Then stop. Do nothing else until the user approves. - Claim by id. After approval, call
claimTask({ taskId, agentId })whereagentIdis your own harness name. Keep thesessionNameit returns and send it on later calls. - Orient before acting. Open the references the prompt lists. Check the stated repo, branch, and commit against what you actually have. If the working state differs from what the prompt describes, tell the user before changing anything. Load any suggested skills.
- Do the work described in the prompt. Stay within its stated scope.
- Close it. Call
completeTask({ taskId, result })with a short result: what you did, what changed, and where to find it. If you could not finish, usestatus: "failed"and put the reason inresult.
Calling it
Run through Kody execute:
import getTask from 'kody:@hypercubed/handoff/getTask'
import claimTask from 'kody:@hypercubed/handoff/claimTask'
import completeTask from 'kody:@hypercubed/handoff/completeTask'
export default async function main(params: { taskId: string; harnessName: string; step: 'read' | 'claim' | 'complete'; result?: string; failed?: boolean }) {
if (params.step === 'read') return getTask({ taskId: params.taskId })
if (params.step === 'claim') return claimTask({ taskId: params.taskId, agentId: params.harnessName })
return completeTask({ taskId: params.taskId, result: params.result, status: params.failed ? 'failed' : 'completed' })
}