Download the PHP package whilesmart/eloquent-agent-actions without Composer

On this page you can find all versions of the php package whilesmart/eloquent-agent-actions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package eloquent-agent-actions

whilesmart/eloquent-agent-actions

A DB-tracked ledger for actions an AI agent proposes or performs. Each action is persisted with a lifecycle (proposed, confirmed, executed, rejected, expired, failed), scoped to an owner (a workspace, organization, user) through whilesmart/eloquent-owner-access, and executed by a handler resolved on its action_type. Actions can run immediately on confirm, or be scheduled for later with optional RRULE recurrence.

Install

Routes register automatically under the api prefix with auth:sanctum. Set AGENT_ACTIONS_REGISTER_ROUTES=false to mount them yourself.

Owning model

Add the trait to whatever owns actions:

payload is the execution input; metadata is a separate free-form column for an originating agent-run id, tags, or cost. An idempotency_key is generated per action when omitted.

An action can point back to whatever triggered it (a chat message, an inbound email, a webhook event) through the polymorphic source, alongside the owner it acts for and the executed_resource it produces:

source carries no database foreign key (like owner), so cleaning up an action when its source is deleted is the host's choice, e.g. a model observer.

Handlers

The package is host-agnostic: it does not know how to send mail or call a webhook. The host supplies that by registering handlers keyed on action_type.

Register handlers in config/agent-actions.php:

The package ships one built-in handler, NullActionHandler (type noop), which marks an action executed without side effects. Return an Eloquent model from execute() to record it as the action's executed_resource; throw to mark the action failed with the message. Each run fires AgentActionExecuted or AgentActionFailed for the host to bridge.

Endpoints

Method Path Purpose
GET /api/agent-actions List (filter by status, action_type, owner)
POST /api/agent-actions Create a proposed action
GET /api/agent-actions/{action} Show
POST /api/agent-actions/{action}/confirm Confirm, then execute now or arm for the scheduler
POST /api/agent-actions/{action}/reject Reject
GET /api/agent-actions/batches/{batch} Show a batch's members
POST /api/agent-actions/batches/{batch}/confirm Confirm every pending member
POST /api/agent-actions/batches/{batch}/reject Reject every pending member

Action batches

When an agent proposes several actions from one instruction (say the line items of a receipt, or a set of transfers), batch them so the user confirms or rejects the set in one call instead of one round-trip per action. Batch with the trait:

A batch is just a set of ordinary actions sharing a batch id. Confirming the batch applies the normal per-action rule to each member: an immediate one runs now, a future-scheduled one is armed. It is partial-safe and idempotent, one member failing does not block the rest, already-resolved members are skipped on a retry, and confirm returns a tally:

Scheduling

Set scheduled_at / next_trigger_at in the future and the confirm endpoint arms the action instead of running it. The host schedules the sweep command:

agent-actions:process-due runs every due action (AgentAction::query()->due()) through its handler. An action with a repeat_rule (RRULE, e.g. FREQ=DAILY) is rescheduled to its next occurrence after each run.

Status & risk

ActionStatus: proposed, confirmed, executed, rejected, expired, failed. ActionRisk: low, medium, high. Both are stored as plain strings and cast to enums on the model.


All versions of eloquent-agent-actions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0|^12.0
rlanvin/php-rrule Version ^2.6
whilesmart/eloquent-owner-access Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package whilesmart/eloquent-agent-actions contains the following files

Loading the files please wait ...