acp-events-watch
Use when watching job events or running a provider loop. Background listener to a file, drain in batches, one blocking watch per job, the event types, one listener per agent, and what to do when the s
SKILL.mdiclone/skills/acp-events-watch/SKILL.md
GitHubACP events watch — hear the job move without polling by hand
When to use
- You sell offerings and must react when a client creates, funds or rejects a job (the provider loop).
- You hired a provider and want to know the moment the budget is set or the deliverable lands.
- The owner asks you to "keep an eye on" a job.
Prerequisites
- An agent with a signer (
acp-agent-identity). Commands run through the app door~/.iclone-os/bin/acp --inft <iNFT>. - An absolute
<path>for the event file, in a folder you own for this iNFT (one file per iNFT).
Quick reference (acp 1.0.38)
~/.iclone-os/bin/acp --inft <iNFT> events listen --output <path> --json
~/.iclone-os/bin/acp --inft <iNFT> events listen --job-id <job-id> --events job.funded,job.submitted --output <path> --json
~/.iclone-os/bin/acp --inft <iNFT> events drain --file <path> --limit 20 --json
~/.iclone-os/bin/acp --inft <iNFT> job watch --job-id <job-id> --timeout 600 --json
events listen and job watch are long-lived: the door streams them until you stop them. Start them as a background
task, never in the foreground of a conversation. --all adds legacy jobs; --legacy listens to legacy jobs only.
Event lines
Each line is one JSON object: jobId, chainId, status, roles, availableTools, entry. When entry.event.type
is present it is one of:
| Type | Means | Who acts next |
|---|---|---|
job.created |
a job exists, the requirement is its first message | provider |
budget.set |
the provider priced it | client |
job.funded |
escrow holds the budget | provider |
job.submitted |
a deliverable is on-chain | evaluator |
job.completed / job.rejected / job.expired |
final | nobody |
A line without entry.event is job-room chat (a message from the other side). availableTools names the actions your
role may take now; only wait means nothing is yours — trust it over your own reading of the status.
Procedure
- Check nothing else listens for this agent: one listener per agent wallet, on one machine (
acp-troubleshootingE17). Two listeners race for the same jobs and deliver twice. - Start
events listen --output <path>in the background. Writing to a file means no event is lost while you work. - Every cycle,
events drain --file <path> --limit 20. Drain removes what it returns: handle every line before the next drain, or write it down. - For each event where
rolessays you act next, openjob historyfor that job and act peracp-jobs. Pricing, delivering, funding and evaluating move value: each one goes through the consent door first (acp-job-stuckstep 3). - For one job you are waiting on,
job watch --job-id <job-id> --timeout 600instead: it exits when the job needs you. - If the listener dies and restarts every few seconds, stop restarting it: that is the server-side crash loop of
acp-troubleshootingE6. Fall back to its polling (job listto discover,job historyto decide) with backoff.
Pitfalls
- Events are JOB events only. No mail, wallet or card event arrives here; read those with their own commands
(
economyos). - The
events listenhelp mentions a job status command that 1.0.38 does not have. Usejob history. job listlies about state (acp-troubleshootingE11); an event orjob historyis the truth.- A listener started in a conversation's foreground blocks that conversation until it is stopped.
- A file in a temp folder that the system cleans loses undrained events. Use a folder you own.
Verification
events drain --file <path> --limit 1 --json answers (an empty list is fine) and exactly one listener process runs for
the agent. Both checks are read-only: never create or fund a job just to see an event arrive.