ccqa 0.13.0 → 0.13.1

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/dist/bin/ccqa.mjs CHANGED
@@ -1168,9 +1168,44 @@ function resolveModel(explicit) {
1168
1168
  const envModel = process.env["CCQA_MODEL"];
1169
1169
  return envModel && envModel.length > 0 ? envModel : void 0;
1170
1170
  }
1171
+ /**
1172
+ * Standard Claude Code environment variables that select the API endpoint and
1173
+ * credentials. ccqa forwards whichever of these are set to the underlying
1174
+ * Claude Code process; it does not read or interpret their values.
1175
+ *
1176
+ * - `ANTHROPIC_BASE_URL` — the API endpoint to send requests to.
1177
+ * - `ANTHROPIC_AUTH_TOKEN` — sent as `Authorization: Bearer <token>`.
1178
+ * - `ANTHROPIC_API_KEY` — API key, when used instead of a token.
1179
+ * - `ANTHROPIC_CUSTOM_HEADERS` — extra request headers.
1180
+ */
1181
+ const ENDPOINT_ENV_KEYS = [
1182
+ "ANTHROPIC_BASE_URL",
1183
+ "ANTHROPIC_AUTH_TOKEN",
1184
+ "ANTHROPIC_API_KEY",
1185
+ "ANTHROPIC_CUSTOM_HEADERS"
1186
+ ];
1187
+ /**
1188
+ * Collects the endpoint/auth variables set in the current process environment
1189
+ * so they can be forwarded, verbatim, to every Claude Code invocation. Returns
1190
+ * only the keys that are actually set (non-empty), so unset variables never
1191
+ * override the SDK's own defaults.
1192
+ */
1193
+ function resolveEndpointEnv() {
1194
+ const endpointEnv = {};
1195
+ for (const key of ENDPOINT_ENV_KEYS) {
1196
+ const value = process.env[key];
1197
+ if (value && value.length > 0) endpointEnv[key] = value;
1198
+ }
1199
+ return endpointEnv;
1200
+ }
1171
1201
  async function invokeClaudeStreaming(options, onEvent) {
1172
1202
  const { prompt, systemPrompt, allowedTools, disableBuiltinTools = false, maxTurns, env, model, cwd, onAbAction, onAbActionFailed, silenceBashLog = false, relaxAbConstraints = false } = options;
1173
1203
  const resolvedModel = resolveModel(model);
1204
+ const hasEndpointEnv = Object.keys(resolveEndpointEnv()).length > 0;
1205
+ const mergedEnv = env || hasEndpointEnv ? {
1206
+ ...process.env,
1207
+ ...env
1208
+ } : void 0;
1174
1209
  let lastAbToolUseId = null;
1175
1210
  const claimAbToolUse = (toolUseId) => {
1176
1211
  if (toolUseId !== lastAbToolUseId) return false;
@@ -1185,10 +1220,7 @@ async function invokeClaudeStreaming(options, onEvent) {
1185
1220
  allowDangerouslySkipPermissions: true,
1186
1221
  ...resolvedModel ? { model: resolvedModel } : {},
1187
1222
  ...cwd ? { cwd } : {},
1188
- ...env ? { env: {
1189
- ...process.env,
1190
- ...env
1191
- } } : {},
1223
+ ...mergedEnv ? { env: mergedEnv } : {},
1192
1224
  ...disableBuiltinTools ? { tools: [] } : {},
1193
1225
  hooks: onAbAction || onAbActionFailed ? {
1194
1226
  PreToolUse: [{ hooks: [async (input) => {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccqa",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "description": "Browser test recorder powered by Claude Code and agent-browser",
6
6
  "repository": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccqa",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "description": "Browser test recorder powered by Claude Code and agent-browser",
6
6
  "repository": {