@warlock.js/ai-cli 5.53.1 → 5.54.0
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/CHANGELOG.md +14 -0
- package/cjs/index.cjs +42 -3
- package/cjs/index.cjs.map +1 -1
- package/esm/adapters/aider.d.mts.map +1 -1
- package/esm/adapters/aider.mjs +8 -0
- package/esm/adapters/aider.mjs.map +1 -1
- package/esm/adapters/amp.mjs +1 -0
- package/esm/adapters/amp.mjs.map +1 -1
- package/esm/adapters/antigravity.d.mts.map +1 -1
- package/esm/adapters/antigravity.mjs +1 -0
- package/esm/adapters/antigravity.mjs.map +1 -1
- package/esm/adapters/claude-code.mjs +5 -0
- package/esm/adapters/claude-code.mjs.map +1 -1
- package/esm/adapters/codex.d.mts.map +1 -1
- package/esm/adapters/codex.mjs +1 -0
- package/esm/adapters/codex.mjs.map +1 -1
- package/esm/adapters/copilot.d.mts.map +1 -1
- package/esm/adapters/copilot.mjs +1 -0
- package/esm/adapters/copilot.mjs.map +1 -1
- package/esm/adapters/cursor.d.mts.map +1 -1
- package/esm/adapters/cursor.mjs +1 -0
- package/esm/adapters/cursor.mjs.map +1 -1
- package/esm/adapters/droid.d.mts.map +1 -1
- package/esm/adapters/droid.mjs +1 -0
- package/esm/adapters/droid.mjs.map +1 -1
- package/esm/adapters/grok.d.mts.map +1 -1
- package/esm/adapters/grok.mjs +1 -0
- package/esm/adapters/grok.mjs.map +1 -1
- package/esm/adapters/kimi.d.mts.map +1 -1
- package/esm/adapters/kimi.mjs +5 -0
- package/esm/adapters/kimi.mjs.map +1 -1
- package/esm/adapters/mistral-vibe.d.mts.map +1 -1
- package/esm/adapters/mistral-vibe.mjs +1 -0
- package/esm/adapters/mistral-vibe.mjs.map +1 -1
- package/esm/adapters/opencode.d.mts.map +1 -1
- package/esm/adapters/opencode.mjs +6 -0
- package/esm/adapters/opencode.mjs.map +1 -1
- package/esm/adapters/qwen-code.mjs +6 -0
- package/esm/adapters/qwen-code.mjs.map +1 -1
- package/esm/adapters/reasonix.d.mts.map +1 -1
- package/esm/adapters/reasonix.mjs +1 -0
- package/esm/adapters/reasonix.mjs.map +1 -1
- package/esm/cli-agent.mjs +2 -2
- package/esm/cli-agent.mjs.map +1 -1
- package/esm/contracts/adapter.contract.d.mts +6 -0
- package/esm/contracts/adapter.contract.d.mts.map +1 -1
- package/esm/contracts/options.type.d.mts +2 -1
- package/esm/contracts/options.type.d.mts.map +1 -1
- package/esm/session/environment.mjs +1 -1
- package/esm/session/environment.mjs.map +1 -1
- package/llms-full.txt +2 -1
- package/package.json +2 -2
- package/skills/run-cli-agents/SKILL.md +1 -1
- package/skills/write-a-cli-adapter/SKILL.md +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.contract.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/adapter.contract.ts"],"mappings":";;;;;;;;;;;;YAYY;;;;;;YAOA;;;;;YAMA;EACV;;EAEA,WAAW;;EAEX;EACA;;EAEA,SAAS;EACT,YAAY;;EAEZ;EACA,MAAM;;;;;;EAMN;;;;;EAKA;;;;;;EAMA;;EAEA;EACA,UAAU,OAAO;;;YAIP;;EAEV;EACA;;;YAIU;;EAEV;;;;;EAKA;;EAEA;;EAEA,MAAM;;EAEN,QAAQ;;;;;;EAMR;;;YAIU;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;EAEA;;EAEA;;;;;;YAOU;EACV,KAAK,eAAe;EACpB,OAAO;;;;;;EAMP;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BU;;WAED;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;WAEA,qBAAqB;;WAErB;;WAEA;WACA,OAAO;WACP,cAAc;EACvB,KAAK,SAAS,mBAAmB;;;;;;EAMjC,OAAO,SAAS,mBAAmB"}
|
|
1
|
+
{"version":3,"file":"adapter.contract.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/adapter.contract.ts"],"mappings":";;;;;;;;;;;;YAYY;;;;;;YAOA;;;;;YAMA;EACV;;EAEA,WAAW;;EAEX;EACA;;EAEA,SAAS;EACT,YAAY;;EAEZ;EACA,MAAM;;;;;;EAMN;;;;;EAKA;;;;;;EAMA;;EAEA;EACA,UAAU,OAAO;;;YAIP;;EAEV;EACA;;;YAIU;;EAEV;;;;;EAKA;;EAEA;;EAEA,MAAM;;EAEN,QAAQ;;;;;;EAMR;;;YAIU;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;EAEA;;EAEA;;;;;;YAOU;EACV,KAAK,eAAe;EACpB,OAAO;;;;;;EAMP;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BU;;WAED;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;;;;;WAMA;;WAEA,qBAAqB;;WAErB;;WAEA;WACA,OAAO;WACP,cAAc;EACvB,KAAK,SAAS,mBAAmB;;;;;;EAMjC,OAAO,SAAS,mBAAmB"}
|
|
@@ -51,7 +51,7 @@ export type CliAgentOptions = CliRunOptions & {
|
|
|
51
51
|
* Which of the current process's environment variables the CLI inherits.
|
|
52
52
|
* `true` (default) inherits everything except the adapter's own home
|
|
53
53
|
* variables; `"curated"` passes the minimal system set plus the adapter's
|
|
54
|
-
* own API key variables (`apiKeyEnv`); `false` passes only the minimal
|
|
54
|
+
* own API key and extra variables (`apiKeyEnv`, `passEnv`); `false` passes only the minimal
|
|
55
55
|
* system set (PATH, HOME, TEMP, locale, proxy and Windows system
|
|
56
56
|
* variables); a list passes the minimal set plus those names.
|
|
57
57
|
*
|
|
@@ -59,6 +59,7 @@ export type CliAgentOptions = CliRunOptions & {
|
|
|
59
59
|
* signing keys, other providers' keys). Prefer `"curated"` and add what
|
|
60
60
|
* the CLI needs through `env`. In production, leaving this unset logs a
|
|
61
61
|
* one-time warning; set `true` explicitly to keep it and silence the warning.
|
|
62
|
+
* The default changes to `"curated"` in 6.0.
|
|
62
63
|
*/
|
|
63
64
|
inheritEnv?: boolean | "curated" | string[];
|
|
64
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/options.type.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAGA;;EAEV;;EAEA;;EAEA,SAAS;;EAET;;EAEA;;EAEA,SAAS;;EAET,aAAa;;EAEb,MAAM;;EAEN,MAAM;;EAEN;;EAEA;;;YAIU,kBAAkB;;EAE5B;;EAEA,OAAO
|
|
1
|
+
{"version":3,"file":"options.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/options.type.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAGA;;EAEV;;EAEA;;EAEA,SAAS;;EAET;;EAEA;;EAEA,SAAS;;EAET,aAAa;;EAEb,MAAM;;EAEN,MAAM;;EAEN;;EAEA;;;YAIU,kBAAkB;;EAE5B;;EAEA,OAAO;;;;;;;;;;;;;;;EAeP;;;;;;EAMA;;EAEA;;;YAIU;EACV,QAAQ;;EAER;;EAEA;;EAEA,QAAQ;;EAER;EACA;EACA;;EAEA;;EAEA;EACA;;;YAIU;;WAED;;WAEA;;;;;WAKA,QAAQ,cAAc;;EAE/B,QAAQ,QAAQ;;EAEhB;;;YAIU;;EAEV;;EAEA;;EAEA"}
|
|
@@ -76,7 +76,7 @@ let warnedInheritedEnvironment = false;
|
|
|
76
76
|
function warnInheritedEnvironment(title, inheritEnv, env) {
|
|
77
77
|
if (warnedInheritedEnvironment || inheritEnv !== void 0 || env.NODE_ENV !== "production") return;
|
|
78
78
|
warnedInheritedEnvironment = true;
|
|
79
|
-
console.warn(`[warlock-ai-cli] ${title} receives the whole server environment because \`inheritEnv\` is not set (default \`true\`). Set \`inheritEnv: "curated"\` to pass only the system variables and the CLI's own API key variable, or \`inheritEnv: true\` to keep the current behaviour and silence this warning.`);
|
|
79
|
+
console.warn(`[warlock-ai-cli] ${title} receives the whole server environment because \`inheritEnv\` is not set (default \`true\`; the default changes to \`"curated"\` in 6.0). Set \`inheritEnv: "curated"\` to pass only the system variables and the CLI's own API key variable, or \`inheritEnv: true\` to keep the current behaviour and silence this warning.`);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.mjs","names":[],"sources":["../../../../../../../../packages/ai-cli/src/session/environment.ts"],"sourcesContent":["/**\n * Variables a CLI needs to start at all: executable lookup, home and temp\n * directories, locale, TLS/proxy settings and the Windows system set.\n * Passed through even with `inheritEnv: false`.\n */\nexport const MINIMAL_ENV = [\n \"PATH\",\n \"PATHEXT\",\n \"HOME\",\n \"USERPROFILE\",\n \"HOMEDRIVE\",\n \"HOMEPATH\",\n \"APPDATA\",\n \"LOCALAPPDATA\",\n \"SYSTEMROOT\",\n \"SYSTEMDRIVE\",\n \"WINDIR\",\n \"COMSPEC\",\n \"TEMP\",\n \"TMP\",\n \"TMPDIR\",\n \"LANG\",\n \"LC_ALL\",\n \"LC_CTYPE\",\n \"TERM\",\n \"SHELL\",\n \"USER\",\n \"LOGNAME\",\n \"XDG_RUNTIME_DIR\",\n \"HTTP_PROXY\",\n \"HTTPS_PROXY\",\n \"NO_PROXY\",\n \"http_proxy\",\n \"https_proxy\",\n \"no_proxy\",\n \"NODE_EXTRA_CA_CERTS\",\n \"SSL_CERT_FILE\",\n \"SSL_CERT_DIR\",\n] as const;\n\nexport type BuildEnvironmentInput = {\n source: Record<string, string | undefined>;\n /**\n * `true` — everything; `false` — the minimal set; `\"curated\"` — the minimal\n * set plus `credentials`; a list — the minimal set plus those names.\n */\n inherit: boolean | \"curated\" | readonly string[];\n /** The adapter's own credential variables (`apiKeyEnv`), passed by `\"curated\"`. */\n credentials?: readonly string[];\n /** Variables the adapter manages (config home); never inherited from `source`. */\n managed: readonly string[];\n /** Adapter plan variables (config home, …). */\n plan?: Record<string, string>;\n /** Caller variables; win over everything else. */\n user?: Record<string, string>;\n /** API key and the variable it goes to. */\n apiKey?: { name: string; value: string };\n platform: NodeJS.Platform;\n};\n\n/**\n * Build a CLI's environment. Precedence, lowest first: inherited variables\n * (minus the adapter's managed home variables), the adapter plan, the API\n * key, then the caller's `env`. Windows variable names compare\n * case-insensitively.\n */\nexport function buildEnvironment(input: BuildEnvironmentInput): Record<string, string> {\n const normalize = (name: string): string =>\n input.platform === \"win32\" ? name.toUpperCase() : name;\n const managed = new Set(input.managed.map(normalize));\n const extra =\n input.inherit === false\n ? []\n : input.inherit === \"curated\"\n ? (input.credentials ?? [])\n : input.inherit === true\n ? []\n : input.inherit;\n const allowed =\n input.inherit === true ? undefined : new Set([...MINIMAL_ENV, ...extra].map(normalize));\n\n const environment: Record<string, string> = {};\n\n for (const [name, value] of Object.entries(input.source)) {\n if (value === undefined || managed.has(normalize(name))) {\n continue;\n }\n\n if (allowed !== undefined && !allowed.has(normalize(name))) {\n continue;\n }\n\n environment[name] = value;\n }\n\n const assign = (name: string, value: string): void => {\n if (input.platform === \"win32\") {\n for (const existing of Object.keys(environment)) {\n if (existing.toUpperCase() === name.toUpperCase()) {\n delete environment[existing];\n }\n }\n }\n\n environment[name] = value;\n };\n\n for (const [name, value] of Object.entries(input.plan ?? {})) {\n assign(name, value);\n }\n\n if (input.apiKey !== undefined) {\n assign(input.apiKey.name, input.apiKey.value);\n }\n\n for (const [name, value] of Object.entries(input.user ?? {})) {\n assign(name, value);\n }\n\n return environment;\n}\n\nlet warnedInheritedEnvironment = false;\n\n/**\n * One console warning per process when a CLI agent runs in production with\n * `inheritEnv` left at its default (`true`), which hands every server\n * variable — database URLs, signing keys, other providers' keys — to a\n * model-driven CLI.\n */\nexport function warnInheritedEnvironment(\n title: string,\n inheritEnv: boolean | \"curated\" | readonly string[] | undefined,\n env: Record<string, string | undefined>,\n): void {\n if (warnedInheritedEnvironment || inheritEnv !== undefined || env.NODE_ENV !== \"production\") {\n return;\n }\n\n warnedInheritedEnvironment = true;\n console.warn(\n `[warlock-ai-cli] ${title} receives the whole server environment because \\`inheritEnv\\` is not set (default \\`true\\`). ` +\n 'Set `inheritEnv: \"curated\"` to pass only the system variables and the CLI\\'s own API key variable, ' +\n \"or `inheritEnv: true` to keep the current behaviour and silence this warning.\",\n );\n}\n\n/** Re-arm the one-time `inheritEnv` warning. For tests. */\nexport function resetInheritedEnvironmentWarning(): void {\n warnedInheritedEnvironment = false;\n}\n"],"mappings":";;;;;;AAKA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;AA4BA,SAAgB,iBAAiB,OAAsD;CACrF,MAAM,aAAa,SACjB,MAAM,aAAa,UAAU,KAAK,YAAY,IAAI;CACpD,MAAM,UAAU,IAAI,IAAI,MAAM,QAAQ,IAAI,SAAS,CAAC;CACpD,MAAM,QACJ,MAAM,YAAY,QACd,CAAC,IACD,MAAM,YAAY,YACf,MAAM,eAAe,CAAC,IACvB,MAAM,YAAY,OAChB,CAAC,IACD,MAAM;CAChB,MAAM,UACJ,MAAM,YAAY,OAAO,SAAY,IAAI,IAAI,CAAC,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;CAExF,MAAM,cAAsC,CAAC;CAE7C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,MAAM,GAAG;EACxD,IAAI,UAAU,UAAa,QAAQ,IAAI,UAAU,IAAI,CAAC,GACpD;EAGF,IAAI,YAAY,UAAa,CAAC,QAAQ,IAAI,UAAU,IAAI,CAAC,GACvD;EAGF,YAAY,QAAQ;CACtB;CAEA,MAAM,UAAU,MAAc,UAAwB;EACpD,IAAI,MAAM,aAAa,SACrB;QAAK,MAAM,YAAY,OAAO,KAAK,WAAW,GAC5C,IAAI,SAAS,YAAY,MAAM,KAAK,YAAY,GAC9C,OAAO,YAAY;EAEvB;EAGF,YAAY,QAAQ;CACtB;CAEA,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,QAAQ,CAAC,CAAC,GACzD,OAAO,MAAM,KAAK;CAGpB,IAAI,MAAM,WAAW,QACnB,OAAO,MAAM,OAAO,MAAM,MAAM,OAAO,KAAK;CAG9C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,QAAQ,CAAC,CAAC,GACzD,OAAO,MAAM,KAAK;CAGpB,OAAO;AACT;AAEA,IAAI,6BAA6B;;;;;;;AAQjC,SAAgB,yBACd,OACA,YACA,KACM;CACN,IAAI,8BAA8B,eAAe,UAAa,IAAI,aAAa,cAC7E;CAGF,6BAA6B;CAC7B,QAAQ,KACN,oBAAoB,MAAM,
|
|
1
|
+
{"version":3,"file":"environment.mjs","names":[],"sources":["../../../../../../../../packages/ai-cli/src/session/environment.ts"],"sourcesContent":["/**\n * Variables a CLI needs to start at all: executable lookup, home and temp\n * directories, locale, TLS/proxy settings and the Windows system set.\n * Passed through even with `inheritEnv: false`.\n */\nexport const MINIMAL_ENV = [\n \"PATH\",\n \"PATHEXT\",\n \"HOME\",\n \"USERPROFILE\",\n \"HOMEDRIVE\",\n \"HOMEPATH\",\n \"APPDATA\",\n \"LOCALAPPDATA\",\n \"SYSTEMROOT\",\n \"SYSTEMDRIVE\",\n \"WINDIR\",\n \"COMSPEC\",\n \"TEMP\",\n \"TMP\",\n \"TMPDIR\",\n \"LANG\",\n \"LC_ALL\",\n \"LC_CTYPE\",\n \"TERM\",\n \"SHELL\",\n \"USER\",\n \"LOGNAME\",\n \"XDG_RUNTIME_DIR\",\n \"HTTP_PROXY\",\n \"HTTPS_PROXY\",\n \"NO_PROXY\",\n \"http_proxy\",\n \"https_proxy\",\n \"no_proxy\",\n \"NODE_EXTRA_CA_CERTS\",\n \"SSL_CERT_FILE\",\n \"SSL_CERT_DIR\",\n] as const;\n\nexport type BuildEnvironmentInput = {\n source: Record<string, string | undefined>;\n /**\n * `true` — everything; `false` — the minimal set; `\"curated\"` — the minimal\n * set plus `credentials`; a list — the minimal set plus those names.\n */\n inherit: boolean | \"curated\" | readonly string[];\n /** The adapter's own credential variables (`apiKeyEnv`, `passEnv`), passed by `\"curated\"`. */\n credentials?: readonly string[];\n /** Variables the adapter manages (config home); never inherited from `source`. */\n managed: readonly string[];\n /** Adapter plan variables (config home, …). */\n plan?: Record<string, string>;\n /** Caller variables; win over everything else. */\n user?: Record<string, string>;\n /** API key and the variable it goes to. */\n apiKey?: { name: string; value: string };\n platform: NodeJS.Platform;\n};\n\n/**\n * Build a CLI's environment. Precedence, lowest first: inherited variables\n * (minus the adapter's managed home variables), the adapter plan, the API\n * key, then the caller's `env`. Windows variable names compare\n * case-insensitively.\n */\nexport function buildEnvironment(input: BuildEnvironmentInput): Record<string, string> {\n const normalize = (name: string): string =>\n input.platform === \"win32\" ? name.toUpperCase() : name;\n const managed = new Set(input.managed.map(normalize));\n const extra =\n input.inherit === false\n ? []\n : input.inherit === \"curated\"\n ? (input.credentials ?? [])\n : input.inherit === true\n ? []\n : input.inherit;\n const allowed =\n input.inherit === true ? undefined : new Set([...MINIMAL_ENV, ...extra].map(normalize));\n\n const environment: Record<string, string> = {};\n\n for (const [name, value] of Object.entries(input.source)) {\n if (value === undefined || managed.has(normalize(name))) {\n continue;\n }\n\n if (allowed !== undefined && !allowed.has(normalize(name))) {\n continue;\n }\n\n environment[name] = value;\n }\n\n const assign = (name: string, value: string): void => {\n if (input.platform === \"win32\") {\n for (const existing of Object.keys(environment)) {\n if (existing.toUpperCase() === name.toUpperCase()) {\n delete environment[existing];\n }\n }\n }\n\n environment[name] = value;\n };\n\n for (const [name, value] of Object.entries(input.plan ?? {})) {\n assign(name, value);\n }\n\n if (input.apiKey !== undefined) {\n assign(input.apiKey.name, input.apiKey.value);\n }\n\n for (const [name, value] of Object.entries(input.user ?? {})) {\n assign(name, value);\n }\n\n return environment;\n}\n\nlet warnedInheritedEnvironment = false;\n\n/**\n * One console warning per process when a CLI agent runs in production with\n * `inheritEnv` left at its default (`true`), which hands every server\n * variable — database URLs, signing keys, other providers' keys — to a\n * model-driven CLI.\n */\nexport function warnInheritedEnvironment(\n title: string,\n inheritEnv: boolean | \"curated\" | readonly string[] | undefined,\n env: Record<string, string | undefined>,\n): void {\n if (warnedInheritedEnvironment || inheritEnv !== undefined || env.NODE_ENV !== \"production\") {\n return;\n }\n\n warnedInheritedEnvironment = true;\n console.warn(\n `[warlock-ai-cli] ${title} receives the whole server environment because \\`inheritEnv\\` is not set (default \\`true\\`; the default changes to \\`\"curated\"\\` in 6.0). ` +\n 'Set `inheritEnv: \"curated\"` to pass only the system variables and the CLI\\'s own API key variable, ' +\n \"or `inheritEnv: true` to keep the current behaviour and silence this warning.\",\n );\n}\n\n/** Re-arm the one-time `inheritEnv` warning. For tests. */\nexport function resetInheritedEnvironmentWarning(): void {\n warnedInheritedEnvironment = false;\n}\n"],"mappings":";;;;;;AAKA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;AA4BA,SAAgB,iBAAiB,OAAsD;CACrF,MAAM,aAAa,SACjB,MAAM,aAAa,UAAU,KAAK,YAAY,IAAI;CACpD,MAAM,UAAU,IAAI,IAAI,MAAM,QAAQ,IAAI,SAAS,CAAC;CACpD,MAAM,QACJ,MAAM,YAAY,QACd,CAAC,IACD,MAAM,YAAY,YACf,MAAM,eAAe,CAAC,IACvB,MAAM,YAAY,OAChB,CAAC,IACD,MAAM;CAChB,MAAM,UACJ,MAAM,YAAY,OAAO,SAAY,IAAI,IAAI,CAAC,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;CAExF,MAAM,cAAsC,CAAC;CAE7C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,MAAM,GAAG;EACxD,IAAI,UAAU,UAAa,QAAQ,IAAI,UAAU,IAAI,CAAC,GACpD;EAGF,IAAI,YAAY,UAAa,CAAC,QAAQ,IAAI,UAAU,IAAI,CAAC,GACvD;EAGF,YAAY,QAAQ;CACtB;CAEA,MAAM,UAAU,MAAc,UAAwB;EACpD,IAAI,MAAM,aAAa,SACrB;QAAK,MAAM,YAAY,OAAO,KAAK,WAAW,GAC5C,IAAI,SAAS,YAAY,MAAM,KAAK,YAAY,GAC9C,OAAO,YAAY;EAEvB;EAGF,YAAY,QAAQ;CACtB;CAEA,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,QAAQ,CAAC,CAAC,GACzD,OAAO,MAAM,KAAK;CAGpB,IAAI,MAAM,WAAW,QACnB,OAAO,MAAM,OAAO,MAAM,MAAM,OAAO,KAAK;CAG9C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,QAAQ,CAAC,CAAC,GACzD,OAAO,MAAM,KAAK;CAGpB,OAAO;AACT;AAEA,IAAI,6BAA6B;;;;;;;AAQjC,SAAgB,yBACd,OACA,YACA,KACM;CACN,IAAI,8BAA8B,eAAe,UAAa,IAAI,aAAa,cAC7E;CAGF,6BAA6B;CAC7B,QAAQ,KACN,oBAAoB,MAAM,8TAG5B;AACF"}
|
package/llms-full.txt
CHANGED
|
@@ -186,7 +186,7 @@ console.log((await session.done()).text);
|
|
|
186
186
|
|
|
187
187
|
The adapter's home variable (`CLAUDE_CONFIG_DIR`, `CODEX_HOME`, `COPILOT_HOME`, `GROK_HOME`, …) is pointed at it.
|
|
188
188
|
|
|
189
|
-
**Environment.** `inheritEnv` decides which server variables the CLI sees. `true` (default) passes everything, so a model-driven CLI can read database URLs and signing keys. `"curated"` passes the minimal system set plus the adapter's own API key variables (`apiKeyEnv`); `false` passes the minimal set only; a list passes the minimal set plus those names. Prefer `"curated"` and add anything else through `env`. In production an unset `inheritEnv` logs a one-time warning; set `true` explicitly to keep the old behaviour without it.
|
|
189
|
+
**Environment.** `inheritEnv` decides which server variables the CLI sees. `true` (default) passes everything, so a model-driven CLI can read database URLs and signing keys. `"curated"` passes the minimal system set plus the adapter's own API key variables (`apiKeyEnv`) and the extra variables it declares in `passEnv` (base URLs, provider keys); `false` passes the minimal set only; a list passes the minimal set plus those names. Prefer `"curated"` and add anything else through `env`. In production an unset `inheritEnv` logs a one-time warning; set `true` explicitly to keep the old behaviour without it. The default changes to `"curated"` in 6.0, so set it explicitly now.
|
|
190
190
|
|
|
191
191
|
## Use a CLI as an `ai.agent` model
|
|
192
192
|
|
|
@@ -252,6 +252,7 @@ export const acmeAdapter: CliAdapter = {
|
|
|
252
252
|
title: "Acme Agent",
|
|
253
253
|
command: "acme",
|
|
254
254
|
apiKeyEnv: ["ACME_API_KEY"],
|
|
255
|
+
passEnv: ["ACME_BASE_URL"], // extra variables "curated" passes from the host
|
|
255
256
|
homeEnv: ["ACME_HOME"],
|
|
256
257
|
transports: ["argv", "stdin"],
|
|
257
258
|
effort: false,
|
package/package.json
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"directory": "packages/ai-cli"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@warlock.js/ai": "5.
|
|
23
|
+
"@warlock.js/ai": "5.54.0"
|
|
24
24
|
},
|
|
25
|
-
"version": "5.
|
|
25
|
+
"version": "5.54.0",
|
|
26
26
|
"main": "./cjs/index.cjs",
|
|
27
27
|
"module": "./esm/index.mjs",
|
|
28
28
|
"types": "./esm/index.d.mts",
|
|
@@ -152,7 +152,7 @@ console.log((await session.done()).text);
|
|
|
152
152
|
|
|
153
153
|
The adapter's home variable (`CLAUDE_CONFIG_DIR`, `CODEX_HOME`, `COPILOT_HOME`, `GROK_HOME`, …) is pointed at it.
|
|
154
154
|
|
|
155
|
-
**Environment.** `inheritEnv` decides which server variables the CLI sees. `true` (default) passes everything, so a model-driven CLI can read database URLs and signing keys. `"curated"` passes the minimal system set plus the adapter's own API key variables (`apiKeyEnv`); `false` passes the minimal set only; a list passes the minimal set plus those names. Prefer `"curated"` and add anything else through `env`. In production an unset `inheritEnv` logs a one-time warning; set `true` explicitly to keep the old behaviour without it.
|
|
155
|
+
**Environment.** `inheritEnv` decides which server variables the CLI sees. `true` (default) passes everything, so a model-driven CLI can read database URLs and signing keys. `"curated"` passes the minimal system set plus the adapter's own API key variables (`apiKeyEnv`) and the extra variables it declares in `passEnv` (base URLs, provider keys); `false` passes the minimal set only; a list passes the minimal set plus those names. Prefer `"curated"` and add anything else through `env`. In production an unset `inheritEnv` logs a one-time warning; set `true` explicitly to keep the old behaviour without it. The default changes to `"curated"` in 6.0, so set it explicitly now.
|
|
156
156
|
|
|
157
157
|
## Use a CLI as an `ai.agent` model
|
|
158
158
|
|
|
@@ -26,6 +26,7 @@ export const acmeAdapter: CliAdapter = {
|
|
|
26
26
|
title: "Acme Agent",
|
|
27
27
|
command: "acme",
|
|
28
28
|
apiKeyEnv: ["ACME_API_KEY"],
|
|
29
|
+
passEnv: ["ACME_BASE_URL"], // extra variables "curated" passes from the host
|
|
29
30
|
homeEnv: ["ACME_HOME"],
|
|
30
31
|
transports: ["argv", "stdin"],
|
|
31
32
|
effort: false,
|