@firefunc-agent/runner 0.7.1 → 0.9.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.
Files changed (78) hide show
  1. package/LICENSE +7 -3
  2. package/README.md +233 -3
  3. package/dist/activity.d.ts +29 -0
  4. package/dist/activity.js +209 -0
  5. package/dist/api.d.ts +45 -1
  6. package/dist/api.js +44 -2
  7. package/dist/brief.d.ts +6 -0
  8. package/dist/brief.js +257 -0
  9. package/dist/build-info.json +4 -0
  10. package/dist/cli.js +49 -0
  11. package/dist/config.d.ts +5 -0
  12. package/dist/config.js +3 -0
  13. package/dist/daemon.js +70 -2
  14. package/dist/engines/antigravity.d.ts +2 -0
  15. package/dist/engines/antigravity.js +102 -0
  16. package/dist/engines/claude-budget.d.ts +1 -1
  17. package/dist/engines/claude-budget.js +2 -72
  18. package/dist/engines/claude.js +10 -1
  19. package/dist/engines/codex.js +10 -3
  20. package/dist/engines/copilot.d.ts +2 -0
  21. package/dist/engines/copilot.js +117 -0
  22. package/dist/engines/cursor.js +4 -0
  23. package/dist/engines/gemini.js +6 -1
  24. package/dist/engines/index.d.ts +2 -0
  25. package/dist/engines/index.js +22 -4
  26. package/dist/engines/types.d.ts +2 -1
  27. package/dist/firefunc/agents.d.ts +2 -0
  28. package/dist/firefunc/agents.js +291 -0
  29. package/dist/firefunc/args.d.ts +18 -0
  30. package/dist/firefunc/args.js +82 -0
  31. package/dist/firefunc/auth.d.ts +21 -0
  32. package/dist/firefunc/auth.js +129 -0
  33. package/dist/firefunc/catalog.d.ts +10 -0
  34. package/dist/firefunc/catalog.js +201 -0
  35. package/dist/firefunc/cli.d.ts +2 -0
  36. package/dist/firefunc/cli.js +24 -0
  37. package/dist/firefunc/client.d.ts +35 -0
  38. package/dist/firefunc/client.js +174 -0
  39. package/dist/firefunc/command.d.ts +28 -0
  40. package/dist/firefunc/command.js +35 -0
  41. package/dist/firefunc/config.d.ts +29 -0
  42. package/dist/firefunc/config.js +111 -0
  43. package/dist/firefunc/io.d.ts +25 -0
  44. package/dist/firefunc/io.js +14 -0
  45. package/dist/firefunc/main.d.ts +4 -0
  46. package/dist/firefunc/main.js +221 -0
  47. package/dist/firefunc/output.d.ts +29 -0
  48. package/dist/firefunc/output.js +128 -0
  49. package/dist/firefunc/prompt.d.ts +14 -0
  50. package/dist/firefunc/prompt.js +58 -0
  51. package/dist/firefunc/skill.d.ts +3 -0
  52. package/dist/firefunc/skill.js +80 -0
  53. package/dist/firefunc/tasks.d.ts +2 -0
  54. package/dist/firefunc/tasks.js +279 -0
  55. package/dist/firefunc/version.d.ts +2 -0
  56. package/dist/firefunc/version.js +23 -0
  57. package/dist/git-auth.d.ts +4 -1
  58. package/dist/git-auth.js +6 -2
  59. package/dist/job.js +439 -84
  60. package/dist/keep-local.d.ts +7 -0
  61. package/dist/keep-local.js +484 -0
  62. package/dist/machine-logins.d.ts +19 -0
  63. package/dist/machine-logins.js +187 -0
  64. package/dist/mcp-login.d.ts +24 -0
  65. package/dist/mcp-login.js +993 -0
  66. package/dist/mcp.d.ts +60 -0
  67. package/dist/mcp.js +582 -0
  68. package/dist/network.d.ts +20 -0
  69. package/dist/network.js +76 -0
  70. package/dist/pending.d.ts +14 -0
  71. package/dist/pending.js +56 -0
  72. package/dist/secret-scan.d.ts +19 -0
  73. package/dist/secret-scan.js +161 -0
  74. package/dist/session-stream.d.ts +1 -0
  75. package/dist/session-stream.js +11 -1
  76. package/dist/viewer.js +7 -1
  77. package/package.json +8 -5
  78. package/skill/firefunc/SKILL.md +173 -0
@@ -0,0 +1,102 @@
1
+ import { makeStreamJsonParser } from '../session-stream.js';
2
+ function clampEffort(effort) {
3
+ if (effort === 'none' || effort === 'minimal' || effort === 'low')
4
+ return 'low';
5
+ if (effort === 'medium')
6
+ return 'medium';
7
+ return 'high';
8
+ }
9
+ function antigravitySummary(stdout) {
10
+ const lines = stdout.trim().split('\n');
11
+ for (let i = lines.length - 1; i >= 0; i--) {
12
+ try {
13
+ const ev = JSON.parse(lines[i]);
14
+ if (ev.type === 'result' && typeof ev.result === 'string' && ev.result.trim()) {
15
+ return ev.result.trim();
16
+ }
17
+ if (typeof ev.response === 'string' && ev.response.trim())
18
+ return ev.response.trim();
19
+ if (ev.type === 'assistant' && ev.message?.content) {
20
+ const text = ev.message.content
21
+ .filter((c) => c.type === 'text' && c.text)
22
+ .map((c) => c.text)
23
+ .join('')
24
+ .trim();
25
+ if (text)
26
+ return text;
27
+ }
28
+ }
29
+ catch {
30
+ }
31
+ }
32
+ try {
33
+ const j = JSON.parse(stdout.trim());
34
+ const t = (j.response ?? j.result ?? '').trim();
35
+ if (t)
36
+ return t;
37
+ }
38
+ catch {
39
+ }
40
+ return '';
41
+ }
42
+ const SOFT_DENY = /(soft[- ]denied|requires approval|not permitted by policy|permissions\.allow)/i;
43
+ export const antigravityAdapter = {
44
+ id: 'antigravity',
45
+ displayName: 'Google Antigravity',
46
+ branchPrefix: 'antigravity',
47
+ bin(cfg) {
48
+ return cfg.antigravityBin ?? 'agy';
49
+ },
50
+ buildInvocation(ctx) {
51
+ const { cfg } = ctx;
52
+ const args = [
53
+ ...(ctx.isWin ? [] : ['-p', ctx.prompt]),
54
+ '--output-format',
55
+ 'stream-json',
56
+ '--dangerously-skip-permissions',
57
+ ];
58
+ if (ctx.model)
59
+ args.push('--model', ctx.model);
60
+ if (ctx.effort)
61
+ args.push('--effort', clampEffort(ctx.effort));
62
+ args.push('--print-timeout', `${cfg.jobTimeoutMinutes ?? 20}m`);
63
+ args.push('--disable-slash-commands');
64
+ args.push(...(cfg.antigravityArgs ?? []));
65
+ return {
66
+ bin: this.bin(cfg),
67
+ args,
68
+ env: ctx.runEnv,
69
+ stdinInput: ctx.isWin ? ctx.prompt : undefined,
70
+ shell: ctx.isWin,
71
+ authLogLine: 'your machine’s `agy` sign-in (Google subscription — no API-key path exists)',
72
+ };
73
+ },
74
+ makeStreamPrinter() {
75
+ return makeStreamJsonParser(() => { });
76
+ },
77
+ summarize(stdout) {
78
+ return antigravitySummary(stdout);
79
+ },
80
+ authFailureHint(text) {
81
+ const t = text.toLowerCase();
82
+ if (SOFT_DENY.test(text)) {
83
+ return 'Antigravity refused its own tool calls rather than running them, and exits 0 when it does — so this looked like "no change needed" and was not. Every tool the run needed was denied by policy. Check that `--dangerously-skip-permissions` reached the process, or add `permissions.allow` rules in ~/.gemini/antigravity-cli/settings.json on the runner machine, then retry.';
84
+ }
85
+ if (t.includes('sign in') ||
86
+ t.includes('no active session') ||
87
+ t.includes('authentication failed') ||
88
+ t.includes('unauthorized') ||
89
+ /\b401\b/.test(t)) {
90
+ return 'Antigravity could not authenticate. It signs in through the system keyring and has no API-key path, so the fix is on the runner machine: run `agy` once, complete Google Sign-In with the account holding your AI Pro or Ultra plan, then retry. Over SSH it prints a URL to finish the login locally.';
91
+ }
92
+ return null;
93
+ },
94
+ rateLimitHint(text) {
95
+ const t = text.toLowerCase();
96
+ if (/rate limit|resource_exhausted|too many requests|\b429\b|quota exceeded/.test(t)) {
97
+ return 'Antigravity hit a usage limit on your Google plan. This run was throttled, not failed: retry shortly, or lower "max parallel". Google states the allowance refreshes every five hours but publishes no figure, so FireFunc cannot show a remaining count.';
98
+ }
99
+ return null;
100
+ },
101
+ };
102
+ //# sourceMappingURL=antigravity.js.map
@@ -1,4 +1,4 @@
1
1
  import type { RunnerConfig } from '../config.js';
2
2
  import type { EngineBudgetReport, EngineBudgetWindow } from './types.js';
3
3
  export declare function parseClaudeUsage(json: unknown): EngineBudgetWindow[];
4
- export declare function readClaudeBudget(cfg: RunnerConfig): Promise<EngineBudgetReport | null>;
4
+ export declare function readClaudeBudget(_cfg: RunnerConfig): Promise<EngineBudgetReport | null>;
@@ -1,12 +1,3 @@
1
- import { execFile } from 'node:child_process';
2
- import { readFile } from 'node:fs/promises';
3
- import { homedir } from 'node:os';
4
- import { join } from 'node:path';
5
- import { promisify } from 'node:util';
6
- const execFileAsync = promisify(execFile);
7
- const USAGE_URL = 'https://api.anthropic.com/api/oauth/usage';
8
- const USAGE_BETA = 'oauth-2025-04-20';
9
- const FETCH_TIMEOUT_MS = 5_000;
10
1
  function toPct(v) {
11
2
  if (typeof v !== 'number' || !Number.isFinite(v))
12
3
  return null;
@@ -55,68 +46,7 @@ export function parseClaudeUsage(json) {
55
46
  push('weekly', 'Weekly · all models', o.seven_day ?? o.weekly);
56
47
  return out;
57
48
  }
58
- function accessTokenFromBlob(raw) {
59
- try {
60
- const j = JSON.parse(raw);
61
- const tok = j?.claudeAiOauth?.accessToken;
62
- return typeof tok === 'string' && tok.length > 0 ? tok : null;
63
- }
64
- catch {
65
- return null;
66
- }
67
- }
68
- async function readMacKeychainToken() {
69
- if (process.platform !== 'darwin')
70
- return null;
71
- try {
72
- const { stdout } = await execFileAsync('security', ['find-generic-password', '-s', 'Claude Code-credentials', '-w'], { timeout: 5_000 });
73
- return accessTokenFromBlob(stdout.trim());
74
- }
75
- catch {
76
- return null;
77
- }
78
- }
79
- async function resolveOAuthToken(cfg) {
80
- if (cfg.claudeCodeOAuthToken)
81
- return cfg.claudeCodeOAuthToken;
82
- try {
83
- const raw = await readFile(join(homedir(), '.claude', '.credentials.json'), 'utf8');
84
- const tok = accessTokenFromBlob(raw);
85
- if (tok)
86
- return tok;
87
- }
88
- catch {
89
- }
90
- return readMacKeychainToken();
91
- }
92
- export async function readClaudeBudget(cfg) {
93
- if (cfg.claudeUseApiKey)
94
- return null;
95
- const token = await resolveOAuthToken(cfg);
96
- if (!token)
97
- return null;
98
- try {
99
- const ctl = new AbortController();
100
- const timer = setTimeout(() => ctl.abort(), FETCH_TIMEOUT_MS);
101
- let res;
102
- try {
103
- res = await fetch(USAGE_URL, {
104
- headers: { authorization: `Bearer ${token}`, 'anthropic-beta': USAGE_BETA },
105
- signal: ctl.signal,
106
- });
107
- }
108
- finally {
109
- clearTimeout(timer);
110
- }
111
- if (!res.ok)
112
- return null;
113
- const windows = parseClaudeUsage(await res.json());
114
- if (windows.length === 0)
115
- return null;
116
- return { engine: 'claude_code', planLabel: 'Claude subscription', windows };
117
- }
118
- catch {
119
- return null;
120
- }
49
+ export async function readClaudeBudget(_cfg) {
50
+ return null;
121
51
  }
122
52
  //# sourceMappingURL=claude-budget.js.map
@@ -1,5 +1,6 @@
1
1
  import { makeStreamJsonParser } from '../session-stream.js';
2
2
  import { readClaudeBudget } from './claude-budget.js';
3
+ import { mcpFromContext } from '../mcp.js';
3
4
  function claudeSummary(streamJson) {
4
5
  const lines = streamJson.trim().split('\n');
5
6
  for (let i = lines.length - 1; i >= 0; i--) {
@@ -34,8 +35,10 @@ export const claudeAdapter = {
34
35
  const { cfg } = ctx;
35
36
  const model = ctx.model ?? 'opus';
36
37
  const effortFlag = ctx.ultracode ? 'xhigh' : ctx.effort;
37
- const tools = ctx.allowedTools ??
38
+ const baseTools = ctx.allowedTools ??
38
39
  'Read Edit Write Bash Glob Grep WebFetch WebSearch Task TodoWrite NotebookEdit';
40
+ const mcp = mcpFromContext(ctx, 'claude');
41
+ const tools = mcp?.toolNames.length ? `${baseTools} ${mcp.toolNames.join(' ')}` : baseTools;
39
42
  const args = [
40
43
  '-p',
41
44
  ...(ctx.isWin ? [] : [ctx.prompt]),
@@ -47,6 +50,9 @@ export const claudeAdapter = {
47
50
  '--allowedTools',
48
51
  tools,
49
52
  ];
53
+ if (mcp?.deniedToolNames.length) {
54
+ args.push('--disallowedTools', mcp.deniedToolNames.join(' '));
55
+ }
50
56
  if (model)
51
57
  args.push('--model', model);
52
58
  if (effortFlag)
@@ -55,6 +61,9 @@ export const claudeAdapter = {
55
61
  args.push('--add-dir', ctx.attachDir);
56
62
  if (ctx.maxBudgetUsd)
57
63
  args.push('--max-budget-usd', String(ctx.maxBudgetUsd));
64
+ if (mcp?.configPath) {
65
+ args.push('--mcp-config', mcp.configPath, '--strict-mcp-config');
66
+ }
58
67
  args.push(...(cfg.claudeArgs ?? []));
59
68
  const env = cfg.claudeUseApiKey
60
69
  ? ctx.runEnv
@@ -1,3 +1,4 @@
1
+ import { mcpFromContext } from '../mcp.js';
1
2
  function codexSummary(stdout) {
2
3
  const lines = stdout.trim().split('\n');
3
4
  for (let i = lines.length - 1; i >= 0; i--) {
@@ -38,10 +39,16 @@ export const codexAdapter = {
38
39
  if (effort && ['minimal', 'low', 'medium', 'high', 'xhigh'].includes(effort)) {
39
40
  args.push('-c', `model_reasoning_effort="${effort}"`);
40
41
  }
42
+ const mcp = mcpFromContext(ctx, 'codex');
43
+ for (const override of mcp?.inlineOverrides ?? [])
44
+ args.push('-c', override);
41
45
  args.push(...(cfg.codexArgs ?? []));
42
- const env = cfg.codexUseApiKey
43
- ? ctx.runEnv
44
- : { ...ctx.runEnv, OPENAI_API_KEY: undefined, CODEX_API_KEY: undefined };
46
+ const env = {
47
+ ...(cfg.codexUseApiKey
48
+ ? ctx.runEnv
49
+ : { ...ctx.runEnv, OPENAI_API_KEY: undefined, CODEX_API_KEY: undefined }),
50
+ ...mcp?.env,
51
+ };
45
52
  const authLogLine = cfg.codexUseApiKey
46
53
  ? 'OPENAI_API_KEY / CODEX_API_KEY (API billing — opted in)'
47
54
  : 'your machine `codex login` (API keys hidden — ChatGPT-plan billing)';
@@ -0,0 +1,2 @@
1
+ import type { AgentAdapter } from './types.js';
2
+ export declare const copilotCliAdapter: AgentAdapter;
@@ -0,0 +1,117 @@
1
+ import { mcpFromContext } from '../mcp.js';
2
+ function copilotSummary(stdout) {
3
+ const lines = stdout.trim().split('\n');
4
+ for (let i = lines.length - 1; i >= 0; i--) {
5
+ try {
6
+ const ev = JSON.parse(lines[i]);
7
+ if (typeof ev.result === 'string' && ev.result.trim())
8
+ return ev.result.trim();
9
+ const content = ev.message?.content ?? ev.content;
10
+ if (typeof content === 'string' && content.trim())
11
+ return content.trim();
12
+ if (Array.isArray(content)) {
13
+ const text = content
14
+ .filter((c) => c.text)
15
+ .map((c) => c.text)
16
+ .join('')
17
+ .trim();
18
+ if (text)
19
+ return text;
20
+ }
21
+ if (typeof ev.text === 'string' && ev.text.trim() && ev.role !== 'user') {
22
+ return ev.text.trim();
23
+ }
24
+ }
25
+ catch {
26
+ }
27
+ }
28
+ return '';
29
+ }
30
+ const REDACT_VARS = [
31
+ 'GIT_ASKPASS_PASSWORD',
32
+ 'GITHUB_TOKEN',
33
+ 'GH_TOKEN',
34
+ 'ANTHROPIC_API_KEY',
35
+ 'OPENAI_API_KEY',
36
+ 'GEMINI_API_KEY',
37
+ 'CURSOR_API_KEY',
38
+ ];
39
+ export const copilotCliAdapter = {
40
+ id: 'copilot_cli',
41
+ displayName: 'GitHub Copilot CLI',
42
+ branchPrefix: 'copilot',
43
+ bin(cfg) {
44
+ return cfg.copilotBin ?? 'copilot';
45
+ },
46
+ buildInvocation(ctx) {
47
+ const { cfg } = ctx;
48
+ const args = [
49
+ ...(ctx.isWin ? [] : ['-p', ctx.prompt]),
50
+ '--allow-all-tools',
51
+ '--output-format',
52
+ 'json',
53
+ '--no-ask-user',
54
+ '--no-remote',
55
+ '--no-remote-export',
56
+ '--no-auto-update',
57
+ '--log-level',
58
+ 'none',
59
+ '--secret-env-vars',
60
+ REDACT_VARS.join(','),
61
+ ];
62
+ if (ctx.model)
63
+ args.push('--model', ctx.model);
64
+ if (ctx.effort)
65
+ args.push('--effort', ctx.effort);
66
+ if (ctx.maxBudgetUsd)
67
+ args.push('--max-ai-credits', String(ctx.maxBudgetUsd));
68
+ if (ctx.attachDir && ctx.attachPaths.length)
69
+ args.push('--add-dir', ctx.attachDir);
70
+ const mcp = mcpFromContext(ctx, 'copilot');
71
+ if (mcp?.configPath)
72
+ args.push('--additional-mcp-config', `@${mcp.configPath}`);
73
+ if (!mcp?.serverIds.length)
74
+ args.push('--disable-builtin-mcps');
75
+ if (mcp?.deniedToolNames.length) {
76
+ args.push('--deny-tool', ...mcp.deniedToolNames);
77
+ }
78
+ if (ctx.allowedTools)
79
+ args.push('--available-tools', ctx.allowedTools);
80
+ args.push(...(cfg.copilotArgs ?? []));
81
+ return {
82
+ bin: this.bin(cfg),
83
+ args,
84
+ env: ctx.runEnv,
85
+ stdinInput: ctx.isWin ? ctx.prompt : undefined,
86
+ shell: ctx.isWin,
87
+ authLogLine: 'your machine’s `copilot login` (GitHub Copilot plan — Free tier included)',
88
+ };
89
+ },
90
+ makeStreamPrinter() {
91
+ return undefined;
92
+ },
93
+ summarize(stdout) {
94
+ return copilotSummary(stdout);
95
+ },
96
+ authFailureHint(text) {
97
+ const t = text.toLowerCase();
98
+ if (t.includes('not signed in') ||
99
+ t.includes('please log in') ||
100
+ t.includes('/login') ||
101
+ t.includes('authentication required') ||
102
+ t.includes('no copilot subscription') ||
103
+ t.includes('copilot access') ||
104
+ /\b401\b/.test(t)) {
105
+ return 'GitHub Copilot CLI is not signed in on this machine, or the account has no Copilot access. Run `copilot` there once and use `/login`, then retry. Copilot CLI is included in every Copilot plan including Free — but an organization can disable it by policy, so if sign-in succeeds and runs still fail, check with whoever administers your GitHub org.';
106
+ }
107
+ return null;
108
+ },
109
+ rateLimitHint(text) {
110
+ const t = text.toLowerCase();
111
+ if (/rate limit|too many requests|\b429\b|quota exceeded|credit limit|ai credits? (exhausted|limit)/.test(t)) {
112
+ return 'GitHub Copilot hit a usage limit on your plan — its AI-credit ceiling is a soft cap and the Free tier reaches it quickly under unattended runs. This run was throttled, not failed: retry shortly, lower "max parallel", or move this agent to a paid Copilot plan.';
113
+ }
114
+ return null;
115
+ },
116
+ };
117
+ //# sourceMappingURL=copilot.js.map
@@ -1,3 +1,4 @@
1
+ import { mcpFromContext } from '../mcp.js';
1
2
  function cursorSummary(stdout) {
2
3
  const lines = stdout.trim().split('\n');
3
4
  for (let i = lines.length - 1; i >= 0; i--) {
@@ -38,6 +39,9 @@ export const cursorAdapter = {
38
39
  throw new Error('The Cursor CLI engine is not supported on native Windows runners (Cursor supports Windows via WSL only). Run the firefunc-runner inside WSL, or pick another engine for this project.');
39
40
  }
40
41
  const args = ['-p', ctx.prompt, '--force', '--output-format', 'stream-json', '--trust'];
42
+ const mcp = mcpFromContext(ctx, 'cursor');
43
+ if (mcp?.configPath)
44
+ args.push('--approve-mcps');
41
45
  if (ctx.model)
42
46
  args.push('--model', ctx.model);
43
47
  args.push(...(cfg.cursorArgs ?? []));
@@ -1,3 +1,4 @@
1
+ import { mcpFromContext } from '../mcp.js';
1
2
  function geminiSummary(stdout) {
2
3
  const trimmed = stdout.trim();
3
4
  try {
@@ -25,7 +26,7 @@ function geminiSummary(stdout) {
25
26
  catch {
26
27
  }
27
28
  }
28
- return trimmed.split('\n').slice(-8).join(' ').replace(/\s+/g, ' ').trim().slice(0, 800);
29
+ return trimmed.split('\n').slice(-8).join('\n').trim().slice(0, 800);
29
30
  }
30
31
  export const geminiAdapter = {
31
32
  id: 'gemini_cli',
@@ -46,6 +47,10 @@ export const geminiAdapter = {
46
47
  ];
47
48
  if (ctx.model)
48
49
  args.push('--model', ctx.model);
50
+ const mcp = mcpFromContext(ctx, 'gemini');
51
+ if (mcp?.serverIds.length) {
52
+ args.push('--allowed-mcp-server-names', mcp.serverIds.join(','));
53
+ }
49
54
  args.push(...(cfg.geminiArgs ?? []));
50
55
  const env = cfg.geminiApiKey
51
56
  ? { ...ctx.runEnv, GEMINI_API_KEY: cfg.geminiApiKey }
@@ -5,6 +5,8 @@ export { claudeAdapter } from './claude.js';
5
5
  export { codexAdapter } from './codex.js';
6
6
  export { geminiAdapter } from './gemini.js';
7
7
  export { cursorAdapter } from './cursor.js';
8
+ export { antigravityAdapter } from './antigravity.js';
9
+ export { copilotCliAdapter } from './copilot.js';
8
10
  export declare function getAdapter(engine: string | null | undefined): AgentAdapter;
9
11
  export declare function supportedEngines(): EngineId[];
10
12
  export declare function binaryOnPath(bin: string): boolean;
@@ -4,15 +4,21 @@ import { claudeAdapter } from './claude.js';
4
4
  import { codexAdapter } from './codex.js';
5
5
  import { geminiAdapter } from './gemini.js';
6
6
  import { cursorAdapter } from './cursor.js';
7
+ import { antigravityAdapter } from './antigravity.js';
8
+ import { copilotCliAdapter } from './copilot.js';
7
9
  export { claudeAdapter } from './claude.js';
8
10
  export { codexAdapter } from './codex.js';
9
11
  export { geminiAdapter } from './gemini.js';
10
12
  export { cursorAdapter } from './cursor.js';
13
+ export { antigravityAdapter } from './antigravity.js';
14
+ export { copilotCliAdapter } from './copilot.js';
11
15
  const REGISTRY = {
12
16
  claude_code: claudeAdapter,
13
17
  codex_cli: codexAdapter,
14
18
  gemini_cli: geminiAdapter,
15
19
  cursor_cli: cursorAdapter,
20
+ antigravity: antigravityAdapter,
21
+ copilot_cli: copilotCliAdapter,
16
22
  };
17
23
  export function getAdapter(engine) {
18
24
  if (engine && engine in REGISTRY)
@@ -50,10 +56,22 @@ export function availableEngines(cfg) {
50
56
  return supportedEngines().filter((id) => binaryOnPath(REGISTRY[id].bin(cfg)));
51
57
  }
52
58
  const ENGINE_CRED_VARS = {
53
- claude_code: ['ANTHROPIC_API_KEY', 'CLAUDE_CODE_OAUTH_TOKEN'],
54
- codex_cli: ['OPENAI_API_KEY', 'CODEX_API_KEY'],
55
- gemini_cli: ['GEMINI_API_KEY', 'GOOGLE_API_KEY'],
59
+ claude_code: [
60
+ 'ANTHROPIC_API_KEY',
61
+ 'CLAUDE_CODE_OAUTH_TOKEN',
62
+ 'ANTHROPIC_AUTH_TOKEN',
63
+ 'ANTHROPIC_BASE_URL',
64
+ ],
65
+ codex_cli: ['OPENAI_API_KEY', 'CODEX_API_KEY', 'OPENAI_BASE_URL'],
66
+ gemini_cli: [
67
+ 'GEMINI_API_KEY',
68
+ 'GOOGLE_API_KEY',
69
+ 'GOOGLE_APPLICATION_CREDENTIALS',
70
+ 'GOOGLE_GENAI_USE_GCA',
71
+ ],
56
72
  cursor_cli: ['CURSOR_API_KEY'],
73
+ antigravity: [],
74
+ copilot_cli: [],
57
75
  };
58
76
  export function stripForeignEngineCreds(env, engine) {
59
77
  const out = { ...env };
@@ -61,7 +79,7 @@ export function stripForeignEngineCreds(env, engine) {
61
79
  if (id === engine)
62
80
  continue;
63
81
  for (const v of vars)
64
- delete out[v];
82
+ out[v] = undefined;
65
83
  }
66
84
  return out;
67
85
  }
@@ -1,5 +1,5 @@
1
1
  import type { RunnerConfig } from '../config.js';
2
- export type EngineId = 'claude_code' | 'codex_cli' | 'gemini_cli' | 'cursor_cli';
2
+ export type EngineId = 'claude_code' | 'codex_cli' | 'gemini_cli' | 'cursor_cli' | 'antigravity' | 'copilot_cli';
3
3
  export type InvocationContext = {
4
4
  prompt: string;
5
5
  model: string | null;
@@ -7,6 +7,7 @@ export type InvocationContext = {
7
7
  ultracode: boolean;
8
8
  permissionMode: string;
9
9
  allowedTools?: string;
10
+ deniedToolNames?: string[];
10
11
  maxBudgetUsd?: number;
11
12
  attachDir?: string;
12
13
  attachPaths: string[];
@@ -0,0 +1,2 @@
1
+ import { type Command } from './command.js';
2
+ export declare const agentCommands: Command[];