mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 16:00:58 +00:00
feat(coding-agent): support shell commands and env vars in auth.json API keys
API keys in auth.json now support the same resolution as models.json: - Shell command: "\!command" executes and uses stdout (cached) - Environment variable: uses the value of the named variable - Literal value: used directly Extracted shared resolveConfigValue() to new resolve-config-value.ts module.
This commit is contained in:
parent
7c39a12a28
commit
9cf5758b68
6 changed files with 408 additions and 58 deletions
|
|
@ -19,6 +19,7 @@ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "f
|
|||
import { dirname, join } from "path";
|
||||
import lockfile from "proper-lockfile";
|
||||
import { getAgentDir } from "../config.js";
|
||||
import { resolveConfigValue } from "./resolve-config-value.js";
|
||||
|
||||
export type ApiKeyCredential = {
|
||||
type: "api_key";
|
||||
|
|
@ -273,7 +274,7 @@ export class AuthStorage {
|
|||
const cred = this.data[providerId];
|
||||
|
||||
if (cred?.type === "api_key") {
|
||||
return cred.key;
|
||||
return resolveConfigValue(cred.key);
|
||||
}
|
||||
|
||||
if (cred?.type === "oauth") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue