osborn 0.8.2 → 0.8.4

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.
@@ -13,6 +13,7 @@
13
13
  * On Linux/Docker, credentials go to ~/.claude/.credentials.json (file-based, no keyring).
14
14
  * The Fly.io volume at /workspace/.claude is symlinked to ~/.claude for persistence.
15
15
  */
16
+ export declare function resolveClaudePath(): string;
16
17
  export interface ClaudeAuthCallbacks {
17
18
  onUrl: (url: string) => void;
18
19
  onWaitingForCode: () => void;
@@ -25,7 +25,7 @@ import { join } from 'path';
25
25
  * Also checks Docker/Linux global npm paths for Fly.io/container deployments.
26
26
  */
27
27
  let _cachedClaudePath = null;
28
- function resolveClaudePath() {
28
+ export function resolveClaudePath() {
29
29
  if (_cachedClaudePath)
30
30
  return _cachedClaudePath;
31
31
  // 1. Shell-based resolution — picks up nvm, homebrew, etc.
@@ -11,7 +11,8 @@ import { query } from '@anthropic-ai/claude-agent-sdk';
11
11
  import { EventEmitter } from 'events';
12
12
  import { saveSessionMetadata, getSessionWorkspace } from './config.js';
13
13
  import { getResearchSystemPrompt, getDirectModeResearchPrompt } from './prompts.js';
14
- import { existsSync, readdirSync, readFileSync } from 'node:fs';
14
+ import { resolveClaudePath } from './claude-auth.js';
15
+ import { existsSync, readdirSync, readFileSync, realpathSync } from 'node:fs';
15
16
  import { join } from 'node:path';
16
17
  /**
17
18
  * Strip markdown formatting for TTS (text-to-speech)
@@ -742,6 +743,27 @@ class ClaudeLLMStream extends llm.LLMStream {
742
743
  ? getSessionWorkspace(this.#opts.workingDirectory, sessionId)
743
744
  : null;
744
745
  const allowedTools = this.#opts.allowedTools || [];
746
+ // Resolve Claude Code CLI path. The SDK looks for cli.js in its OWN node_modules
747
+ // dir by default, but when osborn is installed as an npm dependency the bundled
748
+ // SDK's cli.js loses its executable bit (npm strips it). Use the standalone
749
+ // @anthropic-ai/claude-code package's cli.js — found via the same shell-based
750
+ // resolver that claude-auth.ts uses for the CLI binary, then resolved through
751
+ // the symlink to the actual cli.js path.
752
+ const resolvedClaudeCli = (() => {
753
+ try {
754
+ const claudeBin = resolveClaudePath(); // /usr/local/.../bin/claude (symlink) or /usr/local/.../bin/claude
755
+ if (!claudeBin || claudeBin === 'claude')
756
+ return undefined;
757
+ // claude binary is a symlink to cli.js — resolve it
758
+ const realPath = realpathSync(claudeBin);
759
+ if (realPath.endsWith('cli.js') && existsSync(realPath))
760
+ return realPath;
761
+ }
762
+ catch { }
763
+ return undefined;
764
+ })();
765
+ if (resolvedClaudeCli)
766
+ console.log(`🔧 Claude CLI: ${resolvedClaudeCli}`);
745
767
  const sdkOptions = {
746
768
  cwd: this.#opts.workingDirectory,
747
769
  permissionMode: this.#opts.permissionMode,
@@ -749,6 +771,7 @@ class ClaudeLLMStream extends llm.LLMStream {
749
771
  model: this.#opts.model || 'claude-sonnet-4-6', // Sonnet orchestrator with named sub-agents (Haiku tested but ignored delegation rules)
750
772
  enableFileCheckpointing: true,
751
773
  extraArgs: { 'replay-user-messages': null },
774
+ ...(resolvedClaudeCli && { pathToClaudeCodeExecutable: resolvedClaudeCli }),
752
775
  ...(this.#abortController && { abortController: this.#abortController }),
753
776
  ...(resumeSessionId && { resume: resumeSessionId }),
754
777
  ...(continueSession && !resumeSessionId && { continue: true }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {