@spendgraph/vigil
v0.15.0
Published
Call an agent that takes hours. The workflow parks, the process exits, the run picks up where it stopped.
Downloads
1,027
Maintainers
Readme
@spendgraph/vigil
Call an agent that takes hours. The workflow parks, the process exits, the run picks up where it stopped.
npm install @spendgraph/vigil workflow ──► agent.dispatch(brief) ──► ticket
│
▼
parks, stores itself, process exits ✗
·
· minutes │ hours │ days
·
watcher ──► settled ──► resume(runId, answer) ──► step n+1Zero dependencies. No fetch, no node: imports, no host. You supply the
transport, the store, the scheduler and the resume; the package owns the part
between them.
| port | you supply |
| --- | --- |
| Tickets | where a waiting ticket lives |
| Wake | how to be called back — setAlarm, a cron, a delayed job, setTimeout |
| Deliver | how to continue the run once an answer arrives |
Works with @spendgraph/harness and @spendgraph/graph without importing
either: a parked call returns { waitingOn, runId }, which graph's
pausedInside() already recognises.
import { conformsToAgent } from "@spendgraph/vigil/testing";
const verdict = await conformsToAgent(myAgent); // 16 rules, one probe task@spendgraph/vigil/peers is for two agents that work for each other: one peer
on each side, either can give or do, the doer asks, the giver replies or
approves, and every message arrives once, by push or by pull.
import { vigilPeer } from "@spendgraph/vigil/peers";
const peer = vigilPeer({ name: "fnmoa@acme", tenant: "t_acme", store, send, keys, on });
const id = await peer.give("envoy@acme", { text: "check the demo date" });@spendgraph/vigil/bogus is a scriptable fake agent on a virtual clock, with a
poll, a socket and a stream face over one desk — the reference a custom adapter
is measured against.
Docs
| | | | --- | --- | | Getting started | park a run, exit, pick it back up | | Writing an agent | the contract, and the field that costs money | | Into a workflow | a chain gate, a graph node, a loop hook | | Where it runs | alarms, crons, timers and queues | | When it goes wrong | cancels, deadlines, giving up, crashes | | Testing | a fake agent, and sixteen rules for yours | | Peers | two agents trading tasks, asks and proven approvals |
DESIGN.md is the full design — the ports, the transports, the crash ordering
that keeps a dispatch from orphaning a running agent, and the host matrix.
Status: dispatch, await, answer, the harness gate, the watcher and supervisor,
the memory, timer, alarm and sweep hosts, the poll/socket/stream
transports, cancel, three bogus agents, conformsToAgent and peers are built.
DESIGN.md has the design, and @todo/vigil-peers.md at the repo root has the
peers design.
