@thegpvc/gp-foundry 0.2.9 → 0.2.10

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.
@@ -38,7 +38,8 @@ Rationale: the agent reads *who it is* and *what to do* before it reads the
38
38
  | `scope-path` | no | `.github/agents/scope.yaml` | Scope config file, included verbatim if it exists. |
39
39
  | `model` | yes | — | Value for `claude --model`. |
40
40
  | `allowed-tools` | yes | — | Value for `claude --allowedTools` (comma-separated). |
41
- | `claude-code-oauth-token` | yes | — | OAuth token; passed explicitly (composites have no `secrets`). |
41
+ | `claude-code-oauth-token` | one of | `""` | OAuth token (one subscription seat); passed explicitly (composites have no `secrets`). |
42
+ | `anthropic-api-key` | one of | `""` | Anthropic API key (usage-billed, no seat). Pass exactly one of the two credentials; both or neither fails the step. |
42
43
  | `github-token` | no | `""` | Token for the agent's own `gh`/git calls (`GH_TOKEN`/`GITHUB_TOKEN`). |
43
44
  | `comms-file` | no | `.github/agents/communication.md` | Team communication guide, included verbatim if it exists. |
44
45
  | `extra-args` | no | `""` | Extra args appended verbatim to the `claude` invocation. |
@@ -57,9 +57,17 @@ inputs:
57
57
  default: ""
58
58
  claude-code-oauth-token:
59
59
  description: >-
60
- Claude Code OAuth token. Composites have no secrets context, so this must
61
- be passed in explicitly by the caller.
62
- required: true
60
+ Claude Code OAuth token — authenticates as one subscription seat. Pass
61
+ this OR `anthropic-api-key`, never both. Composites have no secrets
62
+ context, so the credential must be passed in explicitly by the caller.
63
+ required: false
64
+ default: ""
65
+ anthropic-api-key:
66
+ description: >-
67
+ Anthropic API key — usage-billed and not tied to a person's seat, the
68
+ alternative to `claude-code-oauth-token`. Pass exactly one of the two.
69
+ required: false
70
+ default: ""
63
71
  github-token:
64
72
  description: >-
65
73
  Token for the agent's own `gh`/git operations (labels, comments, PRs).
@@ -180,6 +188,7 @@ runs:
180
188
  shell: bash
181
189
  env:
182
190
  CLAUDE_CODE_OAUTH_TOKEN: ${{ inputs.claude-code-oauth-token }}
191
+ ANTHROPIC_API_KEY: ${{ inputs.anthropic-api-key }}
183
192
  GH_TOKEN: ${{ inputs.github-token }}
184
193
  GITHUB_TOKEN: ${{ inputs.github-token }}
185
194
  PROMPT_FILE: ${{ steps.assemble.outputs.prompt-file }}
@@ -193,8 +202,19 @@ runs:
193
202
  run: |
194
203
  set -uo pipefail
195
204
 
196
- if [ -z "${CLAUDE_CODE_OAUTH_TOKEN}" ]; then
197
- echo "::error::claude-code-oauth-token is empty"
205
+ # Exactly one credential. Which one the CLI prefers when it sees both is
206
+ # its business, not something a billing decision should rest on — so two
207
+ # is an error, and the unused variable is removed rather than left empty
208
+ # in the agent's environment.
209
+ if [ -n "${ANTHROPIC_API_KEY:-}" ] && [ -n "${CLAUDE_CODE_OAUTH_TOKEN:-}" ]; then
210
+ echo "::error::both anthropic-api-key and claude-code-oauth-token are set — pass exactly one"
211
+ exit 1
212
+ elif [ -n "${ANTHROPIC_API_KEY:-}" ]; then
213
+ unset CLAUDE_CODE_OAUTH_TOKEN
214
+ elif [ -n "${CLAUDE_CODE_OAUTH_TOKEN:-}" ]; then
215
+ unset ANTHROPIC_API_KEY
216
+ else
217
+ echo "::error::no agent credential: both claude-code-oauth-token and anthropic-api-key are empty"
198
218
  exit 1
199
219
  fi
200
220