@a5c-ai/triggers 5.0.1-staging.cb49e9d7a6db → 5.0.1-staging.ceeaa92b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -24
- package/action.yml +160 -21
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,49 +1,183 @@
|
|
|
1
1
|
# @a5c-ai/triggers
|
|
2
2
|
|
|
3
|
-
Trigger glue for running
|
|
3
|
+
Trigger glue for running any coding agent from CI. Normalizes GitHub, GitLab, Bitbucket, and generic webhook payloads into one event shape, enriches GitHub events with changed files and optional diffs, and evaluates compact trigger queries before launching agent-mux.
|
|
4
4
|
|
|
5
5
|
## CLI
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
triggers evaluate --backend github --query "event:issue_comment text:@develop-this path:packages/agent-mux/**"
|
|
9
|
+
triggers enrich --backend github --include-diff --output event.json
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## GitHub Action
|
|
13
13
|
|
|
14
|
-
The reusable action
|
|
14
|
+
The reusable action at `packages/triggers/action.yml` supports all harnesses, providers, and invocation modes.
|
|
15
15
|
|
|
16
|
-
###
|
|
16
|
+
### Quick Start
|
|
17
17
|
|
|
18
18
|
```yaml
|
|
19
|
-
- uses:
|
|
19
|
+
- uses: a5c-ai/babysitter/packages/triggers@main
|
|
20
20
|
with:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
prompt:
|
|
21
|
+
harness: claude
|
|
22
|
+
provider: foundry
|
|
23
|
+
model: gpt-5.5
|
|
24
|
+
prompt: Review this PR for bugs and style issues
|
|
25
|
+
env:
|
|
26
|
+
AZURE_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
27
|
+
AMUX_API_BASE: ${{ vars.AZURE_OPENAI_ENDPOINT }}
|
|
25
28
|
```
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
## Supported Harnesses
|
|
31
|
+
|
|
32
|
+
| Harness | `harness:` value | Provider examples | Notes |
|
|
33
|
+
|---------|-----------------|-------------------|-------|
|
|
34
|
+
| Claude Code | `claude` | foundry, google, anthropic | Full bridge support |
|
|
35
|
+
| Codex | `codex` | foundry | Native OpenAI support |
|
|
36
|
+
| Pi | `pi` | foundry | Proxy via models.json |
|
|
37
|
+
| Gemini CLI | `gemini` | google, foundry | Needs `GEMINI_CLI_TRUST_WORKSPACE` (auto-set) |
|
|
38
|
+
| Copilot CLI | `copilot` | foundry | Via `gh extension` |
|
|
39
|
+
| Cursor | `cursor` | foundry | Manual install |
|
|
40
|
+
| OpenCode | `opencode` | foundry, anthropic | Multiple install methods |
|
|
41
|
+
| Hermes | `hermes` | foundry | NousResearch agent |
|
|
42
|
+
|
|
43
|
+
## Invocation Modes
|
|
44
|
+
|
|
45
|
+
Set `interaction-mode` to control how the harness runs in CI:
|
|
46
|
+
|
|
47
|
+
| Mode | Flag | Description | Use case |
|
|
48
|
+
|------|------|-------------|----------|
|
|
49
|
+
| `non-interactive` | `--no-interactive` | Plain NI — harness runs with `-p` / `exec` | Simple one-shot tasks |
|
|
50
|
+
| `bridged-hooks` | `--no-interactive --bridge-hooks` | NI + emulated babysitter lifecycle hooks | Babysitter-plugin orchestrated tasks |
|
|
51
|
+
| `bridged-interactive` | `--no-interactive --bridge-interactive` | NI externally, interactive via PTY internally | Tool-heavy tasks needing full harness capabilities |
|
|
52
|
+
|
|
53
|
+
### When to use each mode
|
|
54
|
+
|
|
55
|
+
- **`non-interactive`** (default) — fastest, simplest. The harness gets a prompt, does the work, exits. Good for single-task automation.
|
|
56
|
+
- **`bridged-hooks`** — use with `babysitter-plugin: true`. The BridgeHookEmulator wraps the harness execution with session-start/stop/end hooks, enabling the babysitter orchestration lifecycle.
|
|
57
|
+
- **`bridged-interactive`** — spawns the harness via PTY for full interactive capabilities (tool use, multi-turn) while presenting structured NDJSON output externally. Use when the harness needs TTY features but you want machine-readable output.
|
|
58
|
+
|
|
59
|
+
## Babysitter Plugin
|
|
60
|
+
|
|
61
|
+
Set `babysitter-plugin: true` to install the babysitter plugin before running:
|
|
28
62
|
|
|
29
63
|
```yaml
|
|
30
|
-
- uses:
|
|
64
|
+
- uses: a5c-ai/babysitter/packages/triggers@main
|
|
31
65
|
with:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
66
|
+
harness: claude
|
|
67
|
+
provider: foundry
|
|
68
|
+
model: gpt-5.5
|
|
69
|
+
interaction-mode: bridged-hooks
|
|
70
|
+
babysitter-plugin: 'true'
|
|
71
|
+
babysitter-prompt-prefix: '/babysitter:yolo'
|
|
72
|
+
prompt: Implement the feature described in the issue
|
|
73
|
+
process-file: .a5c/processes/feature-impl.mjs
|
|
36
74
|
```
|
|
37
75
|
|
|
38
|
-
|
|
76
|
+
The action will:
|
|
77
|
+
1. Install the harness CLI
|
|
78
|
+
2. Generate per-harness plugins (`npm run generate:plugins`)
|
|
79
|
+
3. Install the babysitter SDK globally
|
|
80
|
+
4. Install the babysitter plugin into the harness (`babysitter harness:install-plugin`)
|
|
81
|
+
5. Copy the process file to `.a5c/processes/` (if provided)
|
|
82
|
+
6. Launch with the appropriate bridge flags
|
|
83
|
+
|
|
84
|
+
### Babysitter prompt prefixes
|
|
39
85
|
|
|
86
|
+
Each harness uses a different prefix to invoke the babysitter skill:
|
|
87
|
+
|
|
88
|
+
| Harness | Prefix |
|
|
89
|
+
|---------|--------|
|
|
90
|
+
| Claude Code | `/babysitter:yolo` |
|
|
91
|
+
| Codex | `$babysitter:yolo` |
|
|
92
|
+
| Others | `Invoke the babysitter:yolo command to:` |
|
|
93
|
+
|
|
94
|
+
## Provider Configuration
|
|
95
|
+
|
|
96
|
+
The action uses `amux launch` which handles provider resolution and proxy setup automatically. Set credentials via environment variables:
|
|
97
|
+
|
|
98
|
+
### Azure Foundry (OpenAI)
|
|
40
99
|
```yaml
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
100
|
+
env:
|
|
101
|
+
AZURE_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
102
|
+
AMUX_API_BASE: https://your-resource.services.ai.azure.com
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Google / Vertex AI
|
|
106
|
+
```yaml
|
|
107
|
+
env:
|
|
108
|
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
109
|
+
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
|
|
110
|
+
GOOGLE_GENAI_USE_VERTEXAI: 'true'
|
|
47
111
|
```
|
|
48
112
|
|
|
49
|
-
|
|
113
|
+
### Anthropic (direct)
|
|
114
|
+
```yaml
|
|
115
|
+
env:
|
|
116
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Trigger Queries
|
|
120
|
+
|
|
121
|
+
Filter which events trigger the agent using `trigger-query`:
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
trigger-query: |
|
|
125
|
+
event: pull_request
|
|
126
|
+
action: [opened, synchronize]
|
|
127
|
+
paths: src/**/*.ts
|
|
128
|
+
labels: needs-review
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Query fields
|
|
132
|
+
|
|
133
|
+
| Field | Description | Example |
|
|
134
|
+
|-------|-------------|---------|
|
|
135
|
+
| `event` | GitHub event name | `push`, `pull_request`, `issues` |
|
|
136
|
+
| `action` | Event action | `opened`, `synchronize`, `created` |
|
|
137
|
+
| `text` | Match text in title/body | `@develop-this`, `fix:` |
|
|
138
|
+
| `diff` | Match text in diff patches | `TODO`, `FIXME` |
|
|
139
|
+
| `paths` | Match changed file paths | `src/**/*.ts`, `packages/sdk/**` |
|
|
140
|
+
| `branch` | Match target branch | `main`, `release/*` |
|
|
141
|
+
| `labels` | Match issue/PR labels | `bug`, `needs-review` |
|
|
142
|
+
|
|
143
|
+
## Inputs Reference
|
|
144
|
+
|
|
145
|
+
| Input | Required | Default | Description |
|
|
146
|
+
|-------|----------|---------|-------------|
|
|
147
|
+
| `harness` | **yes** | — | Coding agent to use |
|
|
148
|
+
| `provider` | no | — | Model provider |
|
|
149
|
+
| `model` | no | — | Model name |
|
|
150
|
+
| `prompt` | no | — | Task prompt |
|
|
151
|
+
| `interaction-mode` | no | `non-interactive` | NI mode variant |
|
|
152
|
+
| `max-turns` | no | `15` | Max model turns |
|
|
153
|
+
| `with-proxy` | no | `true` | Start proxy if needed |
|
|
154
|
+
| `babysitter-plugin` | no | `false` | Install babysitter plugin |
|
|
155
|
+
| `process-file` | no | — | Babysitter process definition |
|
|
156
|
+
| `babysitter-prompt-prefix` | no | — | Skill invocation prefix |
|
|
157
|
+
| `trigger-backend` | no | `github` | Event backend |
|
|
158
|
+
| `trigger-query` | no | — | Event filter query |
|
|
159
|
+
| `include-diff` | no | `true` | Include diffs in enrichment |
|
|
160
|
+
| `github-token` | no | `${{ github.token }}` | GitHub API token |
|
|
161
|
+
| `pre-run` | no | — | Shell commands before agent |
|
|
162
|
+
| `post-run` | no | — | Shell commands after agent |
|
|
163
|
+
| `working-directory` | no | `${{ github.workspace }}` | Working directory |
|
|
164
|
+
| `node-version` | no | `22` | Node.js version |
|
|
165
|
+
|
|
166
|
+
## Example Workflows
|
|
167
|
+
|
|
168
|
+
See [`.github/workflows/`](./.github/workflows/) for complete examples:
|
|
169
|
+
|
|
170
|
+
- **[claude-code-pr-review.yml](./.github/workflows/claude-code-pr-review.yml)** — Claude Code + Foundry + babysitter-plugin + bridged-hooks for PR review
|
|
171
|
+
- **[codex-issue-triage.yml](./.github/workflows/codex-issue-triage.yml)** — Codex + Foundry + vanilla NI for issue classification
|
|
172
|
+
- **[gemini-scheduled-audit.yml](./.github/workflows/gemini-scheduled-audit.yml)** — Gemini CLI + Google/Vertex + scheduled docs audit
|
|
173
|
+
- **[multi-harness-quality-gates.yml](./.github/workflows/multi-harness-quality-gates.yml)** — Matrix of claude + codex + pi with babysitter-plugin
|
|
174
|
+
- **[copilot-webhook-dispatch.yml](./.github/workflows/copilot-webhook-dispatch.yml)** — Copilot CLI + bridged-interactive for repository_dispatch
|
|
175
|
+
- **[pi-comment-command.yml](./.github/workflows/pi-comment-command.yml)** — Pi + NI triggered by `/agent` comment commands
|
|
176
|
+
|
|
177
|
+
## Outputs
|
|
178
|
+
|
|
179
|
+
| Output | Description |
|
|
180
|
+
|--------|-------------|
|
|
181
|
+
| `matched` | Whether the trigger query matched (`true`/`false`) |
|
|
182
|
+
| `event` | Path to the enriched event JSON file |
|
|
183
|
+
| `exit-code` | Agent-mux exit code (empty if trigger didn't match) |
|
package/action.yml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: Agent Mux
|
|
2
|
-
description: Run
|
|
2
|
+
description: Run any coding agent from GitHub Actions — supports all harnesses (Claude Code, Codex, Pi, Gemini CLI, Copilot CLI, etc.) with trigger evaluation, provider proxy, babysitter plugin, and bridge modes.
|
|
3
3
|
author: a5c-ai
|
|
4
4
|
|
|
5
5
|
branding:
|
|
@@ -7,10 +7,65 @@ branding:
|
|
|
7
7
|
color: purple
|
|
8
8
|
|
|
9
9
|
inputs:
|
|
10
|
+
# ── Core inputs ──────────────────────────────────────────────────────
|
|
10
11
|
command:
|
|
11
12
|
description: agent-mux command to execute after trigger evaluation.
|
|
12
13
|
required: false
|
|
13
|
-
default:
|
|
14
|
+
default: launch
|
|
15
|
+
harness:
|
|
16
|
+
description: Coding agent harness to use (claude, codex, pi, gemini, copilot, cursor, opencode, hermes).
|
|
17
|
+
required: true
|
|
18
|
+
provider:
|
|
19
|
+
description: Model provider (foundry, google, anthropic, bedrock, openai).
|
|
20
|
+
required: false
|
|
21
|
+
model:
|
|
22
|
+
description: Model name to use (e.g. gpt-5.5, gemini-3.1-pro-preview, claude-sonnet-4).
|
|
23
|
+
required: false
|
|
24
|
+
prompt:
|
|
25
|
+
description: Prompt or task to send to the agent.
|
|
26
|
+
required: false
|
|
27
|
+
|
|
28
|
+
# ── Invocation mode ──────────────────────────────────────────────────
|
|
29
|
+
interaction-mode:
|
|
30
|
+
description: |
|
|
31
|
+
How to launch the harness in CI:
|
|
32
|
+
non-interactive — plain NI mode (-p / exec)
|
|
33
|
+
bridged-hooks — NI + emulated babysitter lifecycle hooks (--bridge-hooks)
|
|
34
|
+
bridged-interactive — NI externally, interactive internally via PTY (--bridge-interactive)
|
|
35
|
+
required: false
|
|
36
|
+
default: non-interactive
|
|
37
|
+
max-turns:
|
|
38
|
+
description: Maximum model turns before the agent exits.
|
|
39
|
+
required: false
|
|
40
|
+
default: '15'
|
|
41
|
+
|
|
42
|
+
# ── Provider / proxy ─────────────────────────────────────────────────
|
|
43
|
+
with-proxy:
|
|
44
|
+
description: Start transport-mux proxy if the harness doesn't support the provider natively.
|
|
45
|
+
required: false
|
|
46
|
+
default: 'true'
|
|
47
|
+
proxy-log-level:
|
|
48
|
+
description: Proxy log level (error, warn, info, debug).
|
|
49
|
+
required: false
|
|
50
|
+
default: error
|
|
51
|
+
|
|
52
|
+
# ── Babysitter plugin ────────────────────────────────────────────────
|
|
53
|
+
babysitter-plugin:
|
|
54
|
+
description: Install the babysitter plugin into the harness before running.
|
|
55
|
+
required: false
|
|
56
|
+
default: 'false'
|
|
57
|
+
process-file:
|
|
58
|
+
description: Path to a babysitter process definition (.mjs) to copy into .a5c/processes/.
|
|
59
|
+
required: false
|
|
60
|
+
babysitter-prompt-prefix:
|
|
61
|
+
description: |
|
|
62
|
+
Slash command prefix for babysitter invocation. Harness-specific:
|
|
63
|
+
claude → /babysitter:yolo
|
|
64
|
+
codex → $babysitter:yolo
|
|
65
|
+
other → Invoke the babysitter:yolo command to:
|
|
66
|
+
required: false
|
|
67
|
+
|
|
68
|
+
# ── Legacy / compatibility ───────────────────────────────────────────
|
|
14
69
|
args:
|
|
15
70
|
description: Space-delimited fallback arguments passed to amux after the command.
|
|
16
71
|
required: false
|
|
@@ -18,17 +73,13 @@ inputs:
|
|
|
18
73
|
description: JSON string array of additional arguments passed to amux after the command. Prefer this for values containing spaces or shell-sensitive characters.
|
|
19
74
|
required: false
|
|
20
75
|
adapter:
|
|
21
|
-
description:
|
|
22
|
-
required: false
|
|
23
|
-
prompt:
|
|
24
|
-
description: Prompt passed to amux run via --prompt when set.
|
|
25
|
-
required: false
|
|
26
|
-
harness:
|
|
27
|
-
description: Harness to install before plugin installation.
|
|
76
|
+
description: Alias for harness (backward compatibility).
|
|
28
77
|
required: false
|
|
29
78
|
plugins:
|
|
30
79
|
description: Newline-delimited plugin specs installed after harness setup. Each line is passed to amux plugin install <adapter> <plugin>.
|
|
31
80
|
required: false
|
|
81
|
+
|
|
82
|
+
# ── Trigger evaluation ───────────────────────────────────────────────
|
|
32
83
|
trigger-backend:
|
|
33
84
|
description: Trigger backend to normalize. Supports github, gitlab, bitbucket, generic-webhook.
|
|
34
85
|
required: false
|
|
@@ -40,6 +91,8 @@ inputs:
|
|
|
40
91
|
description: Include local git diff patches in trigger enrichment.
|
|
41
92
|
required: false
|
|
42
93
|
default: 'true'
|
|
94
|
+
|
|
95
|
+
# ── Auth / tokens ────────────────────────────────────────────────────
|
|
43
96
|
use-a5c-token-exchange:
|
|
44
97
|
description: Use a5c-ai/generate-token-action@main before running trigger enrichment and agent-mux.
|
|
45
98
|
required: false
|
|
@@ -48,6 +101,8 @@ inputs:
|
|
|
48
101
|
description: GitHub token fallback for API enrichment.
|
|
49
102
|
required: false
|
|
50
103
|
default: ${{ github.token }}
|
|
104
|
+
|
|
105
|
+
# ── Environment ──────────────────────────────────────────────────────
|
|
51
106
|
node-version:
|
|
52
107
|
description: Node.js version.
|
|
53
108
|
required: false
|
|
@@ -101,19 +156,49 @@ runs:
|
|
|
101
156
|
npm run build --workspace=@a5c-ai/triggers
|
|
102
157
|
|
|
103
158
|
- name: Install harness
|
|
104
|
-
if: ${{ inputs.harness != '' }}
|
|
159
|
+
if: ${{ inputs.harness != '' || inputs.adapter != '' }}
|
|
160
|
+
shell: bash
|
|
161
|
+
env:
|
|
162
|
+
ACTION_ROOT: ${{ github.action_path }}
|
|
163
|
+
INPUT_HARNESS: ${{ inputs.harness || inputs.adapter }}
|
|
164
|
+
INPUT_WORKING_DIRECTORY: ${{ inputs.working-directory }}
|
|
165
|
+
run: |
|
|
166
|
+
set -euo pipefail
|
|
167
|
+
REPO_ROOT=$(cd "$ACTION_ROOT/../.." && pwd)
|
|
168
|
+
cd "$INPUT_WORKING_DIRECTORY"
|
|
169
|
+
node "$REPO_ROOT/packages/agent-mux/cli/dist/index.js" install "$INPUT_HARNESS" || true
|
|
170
|
+
|
|
171
|
+
- name: Install babysitter plugin
|
|
172
|
+
if: ${{ inputs.babysitter-plugin == 'true' }}
|
|
105
173
|
shell: bash
|
|
106
174
|
env:
|
|
107
175
|
ACTION_ROOT: ${{ github.action_path }}
|
|
108
|
-
INPUT_HARNESS: ${{ inputs.harness }}
|
|
176
|
+
INPUT_HARNESS: ${{ inputs.harness || inputs.adapter }}
|
|
109
177
|
INPUT_WORKING_DIRECTORY: ${{ inputs.working-directory }}
|
|
178
|
+
INPUT_PROCESS_FILE: ${{ inputs.process-file }}
|
|
110
179
|
run: |
|
|
111
180
|
set -euo pipefail
|
|
112
181
|
REPO_ROOT=$(cd "$ACTION_ROOT/../.." && pwd)
|
|
113
182
|
cd "$INPUT_WORKING_DIRECTORY"
|
|
114
|
-
node "$REPO_ROOT/packages/agent-mux/sdk/dist/bin/amux.js" install "$INPUT_HARNESS"
|
|
115
183
|
|
|
116
|
-
|
|
184
|
+
# Generate plugins if in monorepo with generator script
|
|
185
|
+
if [ -f "$REPO_ROOT/package.json" ] && node -e "process.exit(JSON.parse(require('fs').readFileSync('$REPO_ROOT/package.json','utf8')).scripts?.['generate:plugins'] ? 0 : 1)" 2>/dev/null; then
|
|
186
|
+
cd "$REPO_ROOT" && npm run generate:plugins && cd "$INPUT_WORKING_DIRECTORY"
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
# Install SDK globally
|
|
190
|
+
npm install -g @a5c-ai/babysitter-sdk || npm install -g "$REPO_ROOT/packages/sdk"
|
|
191
|
+
|
|
192
|
+
# Install babysitter plugin into harness
|
|
193
|
+
babysitter harness:install-plugin "$INPUT_HARNESS" --workspace "$INPUT_WORKING_DIRECTORY"
|
|
194
|
+
|
|
195
|
+
# Copy process file if provided
|
|
196
|
+
if [ -n "$INPUT_PROCESS_FILE" ]; then
|
|
197
|
+
mkdir -p .a5c/processes
|
|
198
|
+
cp "$INPUT_PROCESS_FILE" .a5c/processes/
|
|
199
|
+
fi
|
|
200
|
+
|
|
201
|
+
- name: Install plugins (legacy)
|
|
117
202
|
if: ${{ inputs.plugins != '' }}
|
|
118
203
|
shell: bash
|
|
119
204
|
env:
|
|
@@ -125,7 +210,7 @@ runs:
|
|
|
125
210
|
REPO_ROOT=$(cd "$ACTION_ROOT/../.." && pwd)
|
|
126
211
|
while IFS= read -r plugin; do
|
|
127
212
|
[ -z "$plugin" ] && continue
|
|
128
|
-
node "$REPO_ROOT/packages/agent-mux/
|
|
213
|
+
node "$REPO_ROOT/packages/agent-mux/cli/dist/index.js" plugin install "$INPUT_ADAPTER" "$plugin"
|
|
129
214
|
done <<< "$INPUT_PLUGINS"
|
|
130
215
|
|
|
131
216
|
- name: Evaluate trigger
|
|
@@ -190,21 +275,72 @@ runs:
|
|
|
190
275
|
env:
|
|
191
276
|
ACTION_ROOT: ${{ github.action_path }}
|
|
192
277
|
INPUT_COMMAND: ${{ inputs.command }}
|
|
278
|
+
INPUT_HARNESS: ${{ inputs.harness || inputs.adapter }}
|
|
279
|
+
INPUT_PROVIDER: ${{ inputs.provider }}
|
|
280
|
+
INPUT_MODEL: ${{ inputs.model }}
|
|
281
|
+
INPUT_PROMPT: ${{ inputs.prompt }}
|
|
282
|
+
INPUT_INTERACTION_MODE: ${{ inputs.interaction-mode }}
|
|
283
|
+
INPUT_MAX_TURNS: ${{ inputs.max-turns }}
|
|
284
|
+
INPUT_WITH_PROXY: ${{ inputs.with-proxy }}
|
|
285
|
+
INPUT_PROXY_LOG_LEVEL: ${{ inputs.proxy-log-level }}
|
|
286
|
+
INPUT_BABYSITTER_PLUGIN: ${{ inputs.babysitter-plugin }}
|
|
287
|
+
INPUT_BABYSITTER_PREFIX: ${{ inputs.babysitter-prompt-prefix }}
|
|
193
288
|
INPUT_ARGS: ${{ inputs.args }}
|
|
194
289
|
INPUT_ARGS_JSON: ${{ inputs.args-json }}
|
|
195
|
-
INPUT_ADAPTER: ${{ inputs.adapter }}
|
|
196
|
-
INPUT_PROMPT: ${{ inputs.prompt }}
|
|
197
290
|
AMUX_TRIGGER_EVENT_PATH: ${{ steps.trigger.outputs.event }}
|
|
198
291
|
run: |
|
|
199
292
|
set -euo pipefail
|
|
200
293
|
REPO_ROOT=$(cd "$ACTION_ROOT/../.." && pwd)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
294
|
+
AMUX="node $REPO_ROOT/packages/agent-mux/cli/dist/index.js"
|
|
295
|
+
|
|
296
|
+
# Build command args
|
|
297
|
+
ARGS=()
|
|
298
|
+
if [ "$INPUT_COMMAND" = "launch" ] || [ "$INPUT_COMMAND" = "run" ]; then
|
|
299
|
+
ARGS+=("$INPUT_COMMAND")
|
|
300
|
+
[ -n "$INPUT_HARNESS" ] && ARGS+=("$INPUT_HARNESS")
|
|
301
|
+
[ -n "$INPUT_PROVIDER" ] && ARGS+=("$INPUT_PROVIDER")
|
|
302
|
+
else
|
|
303
|
+
ARGS+=("$INPUT_COMMAND")
|
|
204
304
|
fi
|
|
305
|
+
|
|
306
|
+
# Model
|
|
307
|
+
[ -n "$INPUT_MODEL" ] && ARGS+=(--model "$INPUT_MODEL")
|
|
308
|
+
|
|
309
|
+
# Prompt — with optional babysitter prefix
|
|
205
310
|
if [ -n "$INPUT_PROMPT" ]; then
|
|
206
|
-
|
|
311
|
+
EFFECTIVE_PROMPT="$INPUT_PROMPT"
|
|
312
|
+
if [ "$INPUT_BABYSITTER_PLUGIN" = "true" ] && [ -n "$INPUT_BABYSITTER_PREFIX" ]; then
|
|
313
|
+
EFFECTIVE_PROMPT="$INPUT_BABYSITTER_PREFIX $INPUT_PROMPT"
|
|
314
|
+
fi
|
|
315
|
+
ARGS+=(--prompt "$EFFECTIVE_PROMPT")
|
|
207
316
|
fi
|
|
317
|
+
|
|
318
|
+
# Interaction mode flags
|
|
319
|
+
case "$INPUT_INTERACTION_MODE" in
|
|
320
|
+
non-interactive)
|
|
321
|
+
ARGS+=(--no-interactive)
|
|
322
|
+
;;
|
|
323
|
+
bridged-hooks)
|
|
324
|
+
ARGS+=(--no-interactive --bridge-hooks)
|
|
325
|
+
;;
|
|
326
|
+
bridged-interactive)
|
|
327
|
+
ARGS+=(--no-interactive --bridge-interactive)
|
|
328
|
+
;;
|
|
329
|
+
esac
|
|
330
|
+
|
|
331
|
+
# Max turns
|
|
332
|
+
[ -n "$INPUT_MAX_TURNS" ] && ARGS+=(--max-turns "$INPUT_MAX_TURNS")
|
|
333
|
+
|
|
334
|
+
# Proxy
|
|
335
|
+
if [ "$INPUT_WITH_PROXY" = "true" ]; then
|
|
336
|
+
ARGS+=(--with-proxy-if-needed)
|
|
337
|
+
[ -n "$INPUT_PROXY_LOG_LEVEL" ] && ARGS+=(--proxy-log-level "$INPUT_PROXY_LOG_LEVEL")
|
|
338
|
+
fi
|
|
339
|
+
|
|
340
|
+
# Auto-approve permissions
|
|
341
|
+
ARGS+=(--yolo)
|
|
342
|
+
|
|
343
|
+
# Extra args
|
|
208
344
|
if [ -n "$INPUT_ARGS_JSON" ]; then
|
|
209
345
|
mapfile -t EXTRA_ARGS < <(node -e "const value = JSON.parse(process.env.INPUT_ARGS_JSON || '[]'); if (!Array.isArray(value)) throw new Error('args-json must be a JSON array'); for (const item of value) console.log(String(item));")
|
|
210
346
|
ARGS+=("${EXTRA_ARGS[@]}")
|
|
@@ -212,13 +348,16 @@ runs:
|
|
|
212
348
|
read -r -a EXTRA_ARGS <<< "$INPUT_ARGS"
|
|
213
349
|
ARGS+=("${EXTRA_ARGS[@]}")
|
|
214
350
|
fi
|
|
215
|
-
|
|
351
|
+
|
|
352
|
+
echo "::group::amux ${ARGS[*]}"
|
|
353
|
+
if $AMUX "${ARGS[@]}"; then
|
|
216
354
|
echo "exit-code=0" >> "$GITHUB_OUTPUT"
|
|
217
355
|
else
|
|
218
356
|
status=$?
|
|
219
357
|
echo "exit-code=$status" >> "$GITHUB_OUTPUT"
|
|
220
358
|
exit "$status"
|
|
221
359
|
fi
|
|
360
|
+
echo "::endgroup::"
|
|
222
361
|
|
|
223
362
|
- name: Post-run pipeline commands
|
|
224
363
|
if: ${{ steps.trigger.outputs.matched == 'true' && inputs.post-run != '' }}
|
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
17
17
|
const command = argv[0];
|
|
18
18
|
if (!command || has(argv, '--help') || has(argv, '-h')) {
|
|
19
19
|
process.stdout.write([
|
|
20
|
-
'Usage:
|
|
20
|
+
'Usage: triggers <evaluate|enrich> [flags]',
|
|
21
21
|
'',
|
|
22
22
|
'Flags:',
|
|
23
23
|
' --backend <github|gitlab|bitbucket|generic-webhook>',
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,SAAS,IAAI,CAAC,IAAc,EAAE,IAAY;IACxC,MAAM,KAAK,GAA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a,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExG,IAAI,WAAW,EAAE,CAAC;IAChB,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/triggers",
|
|
3
|
-
"version": "5.0.1-staging.
|
|
3
|
+
"version": "5.0.1-staging.ceeaa92b2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Event trigger normalization, enrichment, and filtering helpers for automation actions",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"node": ">=20.9.0"
|
|
27
27
|
},
|
|
28
28
|
"bin": {
|
|
29
|
-
"
|
|
29
|
+
"triggers": "./dist/cli.js"
|
|
30
30
|
},
|
|
31
31
|
"main": "./dist/index.js",
|
|
32
32
|
"module": "./dist/index.js",
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsc --build && tsc --emitDeclarationOnly --declarationMap false -p tsconfig.json",
|
|
59
59
|
"test": "npm run test:unit && npm run test:e2e",
|
|
60
|
-
"prepublishOnly": "npm run
|
|
60
|
+
"prepublishOnly": "npm run verify:release",
|
|
61
|
+
"verify:release": "npm run build && npm run test:unit && npm run test:e2e && npm run test:coverage",
|
|
61
62
|
"test:unit": "vitest run --root ../.. --config vitest.config.ts packages/triggers/tests/action-helpers.test.ts packages/triggers/tests/action-metadata.test.ts packages/triggers/tests/backend-modules.test.ts packages/triggers/tests/backends.test.ts packages/triggers/tests/cli.test.ts packages/triggers/tests/enrich.test.ts packages/triggers/tests/query.test.ts packages/triggers/tests/readme-examples.test.ts packages/triggers/src",
|
|
62
63
|
"test:e2e": "npm run build && vitest run --root ../.. --config vitest.config.ts packages/triggers/tests/action.test.ts packages/triggers/tests/dist-cli.smoke.test.ts",
|
|
63
64
|
"test:coverage": "vitest run --root ../.. --config vitest.config.ts --coverage --coverage.include=packages/triggers/src/**/*.ts packages/triggers/tests/action-helpers.test.ts packages/triggers/tests/action-metadata.test.ts packages/triggers/tests/action.test.ts packages/triggers/tests/backend-modules.test.ts packages/triggers/tests/backends.test.ts packages/triggers/tests/cli.test.ts packages/triggers/tests/enrich.test.ts packages/triggers/tests/query.test.ts packages/triggers/tests/readme-examples.test.ts packages/triggers/src"
|