From d0e7d18f5fd4fad519a14fc9d0adbdd97489344e Mon Sep 17 00:00:00 2001 From: mikemolinet Date: Sun, 3 May 2026 12:38:42 -0700 Subject: [PATCH] feat: expose cueapi 0.2.0 fire + executions subgroup commands cueapi 0.2.0 (just published to PyPI 2026-05-03) adds the fire top-level command and the executions subgroup with seven subcommands. This action exposes them as new command values: Cue management additions: - fire (with payload-override + merge-strategy inputs) Worker-execution lifecycle (cueapi 0.2.0+): - executions-list (extends list with cue-id/offset filters) - executions-list-claimable (server-side task/agent filter) - executions-get (single-row by execution-id) - executions-claim (atomic claim, worker-id required) - executions-claim-next (with optional task filter) - executions-heartbeat (extend claim lease) - executions-report-outcome (write-once outcome with evidence) New inputs added (all optional, command-specific): payload-override, merge-strategy, execution-id, worker-id, task, agent, success, external-id, result-url, summary, offset. Composite step's case block updated with one branch per new command. Backwards-compatible: every existing command still works with its existing input shape. Mirrors the cueapi-cli 0.2.0 surface 1:1; same pattern that @cueapi/mcp 0.4.0 + cueapi-sdk shipped recently for ecosystem parity. Action invokes the CLI binary so this PR landing + the existing release tag triggers the Marketplace listing update on the next published release. Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 32 ++++++++++++-- action.yml | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 147 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 00531a1..b81deef 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ jobs: ## Supported commands +Cue management: + | Command | Purpose | |----------|----------------------------------------------| | `create` | Create a new cue (recurring or one-time) | @@ -50,9 +52,22 @@ jobs: | `delete` | Delete a cue | | `pause` | Pause a cue | | `resume` | Resume a paused cue | +| `fire` | Fire an existing cue immediately, optional `payload-override` | | `whoami` | Print authenticated identity | | `usage` | Show current usage stats | +Worker-execution lifecycle (cueapi 0.2.0+): + +| Command | Purpose | +|-------------------------------|------------------------------------------------------------------------| +| `executions-list` | List historical executions, filter by `cue-id` / `status` | +| `executions-list-claimable` | List unclaimed worker executions, filter by `task` / `agent` (server-side) | +| `executions-get` | Fetch one execution by ID | +| `executions-claim` | Atomically claim a specific execution (`worker-id` required) | +| `executions-claim-next` | Claim the next available execution (optional `task` filter) | +| `executions-heartbeat` | Extend the claim lease on an in-flight execution | +| `executions-report-outcome` | Report a write-once outcome (`success: true|false` + optional evidence) | + ## Inputs | Name | Required | Description | @@ -67,11 +82,22 @@ jobs: | `payload` | no | JSON payload string | | `description` | no | Human-readable cue description | | `worker` | no | Set `"true"` to use worker transport (no public URL) | -| `cue-id` | no | Target cue ID (get/update/delete/pause/resume) | -| `status` | no | Status filter for `list` (`active` / `paused`) | -| `limit` | no | Max results for `list` | +| `cue-id` | no | Target cue ID (get/update/delete/pause/resume/fire/executions-list) | +| `status` | no | Status filter for `list` (`active`/`paused`) or `executions-list` | +| `limit` | no | Max results for `list` / `executions-list` | +| `offset` | no | Pagination offset for `list` / `executions-list` | | `api-key` | no | Override API key (prefer `CUEAPI_API_KEY` env from a secret) | | `cli-version` | no | Pin a specific `cueapi` CLI version (default: latest) | +| `payload-override` | no | JSON payload override for `fire` | +| `merge-strategy` | no | `merge` (default) or `replace` for `fire` | +| `execution-id` | no | Target execution ID (executions-get/claim/heartbeat/report-outcome) | +| `worker-id` | no | Stable worker identifier (executions-claim/claim-next/heartbeat) | +| `task` | no | Task filter for executions-list-claimable / executions-claim-next | +| `agent` | no | Agent filter for executions-list-claimable | +| `success` | no | `true`/`false` for executions-report-outcome | +| `external-id` | no | External system ID for executions-report-outcome | +| `result-url` | no | Public URL evidence for executions-report-outcome | +| `summary` | no | Short human summary for executions-report-outcome (max 500 chars) | ## Outputs diff --git a/action.yml b/action.yml index d86e08f..56ff216 100644 --- a/action.yml +++ b/action.yml @@ -7,8 +7,17 @@ branding: inputs: command: - description: 'CueAPI CLI command to run (create, list, get, update, delete, pause, resume, whoami)' + description: | + CueAPI CLI command to run. Cue management: + create, list, get, update, delete, pause, resume, whoami, usage, + fire + Worker-execution lifecycle (introduced in cueapi 0.2.0): + executions-list, executions-list-claimable, executions-get, + executions-claim, executions-claim-next, executions-heartbeat, + executions-report-outcome required: true + + # Cue management inputs (existing). name: description: 'Cue name (for create/update)' required: false @@ -40,19 +49,56 @@ inputs: required: false default: 'false' cue-id: - description: 'Target cue ID (for get/update/delete/pause/resume)' + description: 'Target cue ID (for get/update/delete/pause/resume/fire/executions-list)' required: false status: - description: 'Filter by status for list command (active/paused)' + description: 'Filter by status (active/paused for list; execution status for executions-list)' required: false limit: - description: 'Max results for list command' + description: 'Max results for list / executions-list' + required: false + offset: + description: 'Offset for list / executions-list pagination' required: false api-key: description: 'CueAPI API key. Prefer passing via CUEAPI_API_KEY env var from a secret.' required: false cli-version: - description: 'Pin a specific cueapi CLI version (e.g. "0.1.0"). Default: latest.' + description: 'Pin a specific cueapi CLI version (e.g. "0.2.0"). Default: latest.' + required: false + + # Fire inputs (cueapi 0.2.0+). + payload-override: + description: 'JSON payload override for `fire` (overrides the cue stored payload for this fire only)' + required: false + merge-strategy: + description: 'How payload-override combines with the cue stored payload: merge (default, server-side) or replace' + required: false + + # Executions lifecycle inputs (cueapi 0.2.0+). + execution-id: + description: 'Target execution ID (for executions-get/claim/heartbeat/report-outcome)' + required: false + worker-id: + description: 'Stable worker identifier (required for executions-claim, executions-claim-next, executions-heartbeat)' + required: false + task: + description: 'Task filter for executions-list-claimable / executions-claim-next (server-side SQL filter)' + required: false + agent: + description: 'Agent filter for executions-list-claimable (server-side SQL filter)' + required: false + success: + description: 'Outcome success flag for executions-report-outcome: "true" or "false"' + required: false + external-id: + description: 'External system ID for executions-report-outcome (e.g. PR number, doc ID)' + required: false + result-url: + description: 'Public URL for executions-report-outcome evidence (e.g. tweet, PR, doc)' + required: false + summary: + description: 'Short human summary for executions-report-outcome (max 500 chars)' required: false outputs: @@ -110,6 +156,18 @@ runs: CUE_ID: ${{ inputs.cue-id }} STATUS: ${{ inputs.status }} LIMIT: ${{ inputs.limit }} + OFFSET: ${{ inputs.offset }} + # Fire + executions inputs (cueapi 0.2.0+). + PAYLOAD_OVERRIDE: ${{ inputs.payload-override }} + MERGE_STRATEGY: ${{ inputs.merge-strategy }} + EXECUTION_ID: ${{ inputs.execution-id }} + WORKER_ID: ${{ inputs.worker-id }} + TASK: ${{ inputs.task }} + AGENT: ${{ inputs.agent }} + SUCCESS: ${{ inputs.success }} + EXTERNAL_ID: ${{ inputs.external-id }} + RESULT_URL: ${{ inputs.result-url }} + SUMMARY: ${{ inputs.summary }} run: | set -euo pipefail cmd=(cueapi "$COMMAND") @@ -140,11 +198,65 @@ runs: list) [ -n "$STATUS" ] && cmd+=(--status "$STATUS") [ -n "$LIMIT" ] && cmd+=(--limit "$LIMIT") + [ -n "$OFFSET" ] && cmd+=(--offset "$OFFSET") ;; whoami|usage) ;; + fire) + [ -n "$CUE_ID" ] && cmd+=("$CUE_ID") + [ -n "$PAYLOAD_OVERRIDE" ] && cmd+=(--payload-override "$PAYLOAD_OVERRIDE") + [ -n "$MERGE_STRATEGY" ] && cmd+=(--merge-strategy "$MERGE_STRATEGY") + ;; + # Executions subgroup (cueapi 0.2.0+) — these commands map to + # ``cueapi executions `` (group + subcommand). Override + # the default ``cmd=(cueapi "$COMMAND")`` because COMMAND + # carries a hyphenated name (e.g. "executions-list") and the + # CLI expects the words separated. + executions-list) + cmd=(cueapi executions list) + [ -n "$CUE_ID" ] && cmd+=(--cue-id "$CUE_ID") + [ -n "$STATUS" ] && cmd+=(--status "$STATUS") + [ -n "$LIMIT" ] && cmd+=(--limit "$LIMIT") + [ -n "$OFFSET" ] && cmd+=(--offset "$OFFSET") + ;; + executions-list-claimable) + cmd=(cueapi executions list-claimable) + [ -n "$TASK" ] && cmd+=(--task "$TASK") + [ -n "$AGENT" ] && cmd+=(--agent "$AGENT") + ;; + executions-get) + cmd=(cueapi executions get) + [ -n "$EXECUTION_ID" ] && cmd+=("$EXECUTION_ID") + ;; + executions-claim) + cmd=(cueapi executions claim) + [ -n "$EXECUTION_ID" ] && cmd+=("$EXECUTION_ID") + [ -n "$WORKER_ID" ] && cmd+=(--worker-id "$WORKER_ID") + ;; + executions-claim-next) + cmd=(cueapi executions claim-next) + [ -n "$WORKER_ID" ] && cmd+=(--worker-id "$WORKER_ID") + [ -n "$TASK" ] && cmd+=(--task "$TASK") + ;; + executions-heartbeat) + cmd=(cueapi executions heartbeat) + [ -n "$EXECUTION_ID" ] && cmd+=("$EXECUTION_ID") + [ -n "$WORKER_ID" ] && cmd+=(--worker-id "$WORKER_ID") + ;; + executions-report-outcome) + cmd=(cueapi executions report-outcome) + [ -n "$EXECUTION_ID" ] && cmd+=("$EXECUTION_ID") + if [ "$SUCCESS" = "true" ]; then + cmd+=(--success) + elif [ "$SUCCESS" = "false" ]; then + cmd+=(--failure) + fi + [ -n "$EXTERNAL_ID" ] && cmd+=(--external-id "$EXTERNAL_ID") + [ -n "$RESULT_URL" ] && cmd+=(--result-url "$RESULT_URL") + [ -n "$SUMMARY" ] && cmd+=(--summary "$SUMMARY") + ;; *) - echo "::error::Unsupported command '$COMMAND'. Supported: create, list, get, update, delete, pause, resume, whoami, usage." + echo "::error::Unsupported command '$COMMAND'. Supported: create, list, get, update, delete, pause, resume, whoami, usage, fire, executions-list, executions-list-claimable, executions-get, executions-claim, executions-claim-next, executions-heartbeat, executions-report-outcome." exit 1 ;; esac