@bakers-build/addon-claude 0.10.1-next.11 → 0.10.1-next.12

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.
@@ -23,6 +23,7 @@ export interface ClaudeAgentOptions extends SecurityOptions {
23
23
  export declare class ClaudeAgent implements BbAgent {
24
24
  private readonly home;
25
25
  readonly id = "claude";
26
+ readonly secretEnv: readonly ["CLAUDE_CODE_OAUTH_TOKEN", "ANTHROPIC_API_KEY"];
26
27
  readonly installCommand = "npm install -g @anthropic-ai/claude-code@latest";
27
28
  readonly modelApi: import("@bakers-build/conductor/contract").AgentModelApi;
28
29
  private readonly args;
package/dist/src/index.js CHANGED
@@ -9,7 +9,7 @@ import { CONDUCTOR_TOKEN_ENV, CONDUCTOR_TOOL_TIMEOUT_MS, CONDUCTOR_TOOLS_SERVER,
9
9
  import { gitSandboxPaths, shellQuote, withoutGitDirs, } from '@bakers-build/core';
10
10
  import { shareLogin } from './credentials.js';
11
11
  import { parseClaudeTranscript } from './footprint.js';
12
- import { encodeClaudeProjectDir, prepareClaudeRun } from './run.js';
12
+ import { CLAUDE_SECRET_ENV, encodeClaudeProjectDir, prepareClaudeRun, } from './run.js';
13
13
  import { claudeInstallCommand, claudeModelApi } from './setup.js';
14
14
  export { parseClaudeTranscript } from './footprint.js';
15
15
  export { encodeClaudeProjectDir } from './run.js';
@@ -126,6 +126,7 @@ const CLAUDE_KNOWN = [
126
126
  export class ClaudeAgent {
127
127
  home;
128
128
  id = 'claude';
129
+ secretEnv = CLAUDE_SECRET_ENV;
129
130
  installCommand = claudeInstallCommand;
130
131
  modelApi = claudeModelApi;
131
132
  args;
@@ -455,6 +456,7 @@ export function claudeAgent(options = {}) {
455
456
  id: 'claude',
456
457
  requiredModules: [],
457
458
  permissions: agent.security.report,
459
+ secretEnv: agent.secretEnv,
458
460
  async createAgent(config) {
459
461
  agent.useMarketplaces(config.marketplaces ?? []);
460
462
  return agent;
package/dist/src/run.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import type { AgentRunContext, AgentRunPreparation } from '@bakers-build/conductor/contract';
2
+ /** The model credentials a Claude run may receive from the secrets file. */
3
+ export declare const CLAUDE_SECRET_ENV: readonly ["CLAUDE_CODE_OAUTH_TOKEN", "ANTHROPIC_API_KEY"];
2
4
  export declare function encodeClaudeProjectDir(cwd: string): string;
3
5
  /** Prepare Claude's files in the home supplied by any execution backend. */
4
6
  export declare function prepareClaudeRun(context: AgentRunContext, configDir: string, hostEnv?: Readonly<Record<string, string | undefined>>): AgentRunPreparation;
package/dist/src/run.js CHANGED
@@ -1,10 +1,16 @@
1
1
  import { existsSync, mkdirSync, readFileSync, realpathSync, symlinkSync, writeFileSync, } from 'node:fs';
2
2
  import { join } from 'node:path';
3
+ /** The model credentials a Claude run may receive from the secrets file. */
4
+ export const CLAUDE_SECRET_ENV = [
5
+ 'CLAUDE_CODE_OAUTH_TOKEN',
6
+ 'ANTHROPIC_API_KEY',
7
+ ];
3
8
  export function encodeClaudeProjectDir(cwd) {
4
9
  return cwd.replace(/[^a-zA-Z0-9]/g, '-');
5
10
  }
6
11
  /** Prepare Claude's files in the home supplied by any execution backend. */
7
- export function prepareClaudeRun(context, configDir, hostEnv = process.env) {
12
+ export function prepareClaudeRun(context, configDir, hostEnv = context.secrets ??
13
+ process.env) {
8
14
  const source = context.env.CLAUDE_CONFIG_DIR ?? configDir;
9
15
  const config = join(context.homePath, '.claude');
10
16
  mkdirSync(config, { recursive: true });
@@ -18,7 +24,7 @@ export function prepareClaudeRun(context, configDir, hostEnv = process.env) {
18
24
  ? JSON.parse(readFileSync(join(source, '.claude.json'), 'utf8'))
19
25
  : {};
20
26
  delete state.primaryApiKey;
21
- const keys = ['CLAUDE_CODE_OAUTH_TOKEN', 'ANTHROPIC_API_KEY'];
27
+ const keys = CLAUDE_SECRET_ENV;
22
28
  const env = { CLAUDE_CONFIG_DIR: config };
23
29
  const supplied = keys.some((key) => context.env[key]);
24
30
  const bindPaths = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-claude",
3
- "version": "0.10.1-next.11",
3
+ "version": "0.10.1-next.12",
4
4
  "description": "bakers.build agent plugin for the Claude CLI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,11 +26,11 @@
26
26
  "directory": "bakers-cli/addons/claude"
27
27
  },
28
28
  "peerDependencies": {
29
- "@bakers-build/conductor": "^0.10.1-next.11",
30
- "@bakers-build/core": "^0.10.1-next.11"
29
+ "@bakers-build/conductor": "^0.10.1-next.12",
30
+ "@bakers-build/core": "^0.10.1-next.12"
31
31
  },
32
32
  "bakersBuild": {
33
- "commit": "a17110983f32ae027848c103b31ddb07fbf21a8e",
33
+ "commit": "460f5570442a0b09af52a1d4450b879075302e57",
34
34
  "channel": "next"
35
35
  }
36
36
  }