Skip to main content
readonly tasks: AgentHarnessTaskPort

On the Agent Runtime

The runtime adapter builds the port from host, which carries the protected members of the Agent class.
  • queue() calls queue(), for a task due at once.
  • schedule() calls schedule(), for a task due after a delay.
  • every() calls every(), for a task that recurs at an interval.
  • cancel() calls cancelSchedule(), which removes a pending task.
  • list() calls listSchedules(), which returns a TaskRecord for every pending task.
  • With a stable id in its ScheduleOptions, a call to queue(), schedule() or every() replaces the pending task with that id.
  • delivery declares the scheduler’s own guarantee. A task survives crashes and restarts. It can be delivered more than once.
  • The harness’s task names begin with __telnyx_agent_harness_ and name no method of the class, so they reach onTask(). Its default does nothing and counts the task as delivered.

AgentHarnessTaskPort

Existing Agent task scheduler semantics. Stable ids are pending-task upserts only. This is deliberately not a run admission ledger: there are no run statuses, terminal records, or persistent idempotency history in this contract. Properties delivery
readonly delivery: "at-least-once"
Methods cancel()
cancel(id): Promise<boolean>
Parameters Returns Promise<boolean> every()
every(intervalSeconds, method, payload?, options?): Promise<string>
Parameters Returns Promise<string> list()
list(): Promise<TaskRecord[]>
Returns Promise<TaskRecord[]> queue()
queue(method, payload?, options?): Promise<string>
Parameters Returns Promise<string> schedule()
schedule(delaySeconds, method, payload?, options?): Promise<string>
Parameters Returns Promise<string>