UNPKG

@anthropic-ai/claude-agent-sdk

Version:

SDK for building AI agents with Claude Code's capabilities. Programmatically interact with Claude to build autonomous agents that can understand codebases, edit files, and execute workflows.

19 lines (16 loc) • 1.69 kB
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance. // Version: 0.3.333 //! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`. if (typeof Symbol.dispose !== 'symbol') { try { Symbol.dispose = Symbol.for('Symbol.dispose') } catch {} } if (typeof Symbol.asyncDispose !== 'symbol') { try { Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose') } catch {} } import{_}from"./core-7ryne2zb.mjs";import{Wn}from"./core-kczvrs8s.mjs";import{execFile as u}from"child_process";import{promisify as h}from"util";import{existsSync as l,lstatSync as a,readdirSync as c,statSync as p}from"fs";import{isAbsolute as f,join as m}from"path";function i(o,e){if(process.platform!=="darwin"||Boolean(e.DEVELOPER_DIR))return!1;try{return(o.includes("/")?o:(e.PATH??"").split(":").filter((t)=>f(t)).map((t)=>m(t,o)).find((t)=>l(t)))==="/usr/bin/git"&&p("/Library/Developer/CommandLineTools",{throwIfNoEntry:!1})===void 0&&a("/var/db/xcode_select_link",{throwIfNoEntry:!1})===void 0&&!c("/Applications").some((t)=>/^Xcode.*\.app$/i.test(t))}catch{return!1}}var d=!1;function n(){return d}var s={GIT_REFERENCE_BACKEND:"files"};var E=h(u);async function It(o){if(n())return[];let e=Wn("git");if(e===null||i(e,process.env))return[];try{let{stdout:r}=await E(e,["-c","core.hooksPath=/dev/null","-c","core.fsmonitor=","worktree","list","--porcelain"],{cwd:o,env:{...process.env,...s},timeout:5000,windowsHide:!0});if(!r)return[];return r.split(` `).filter((t)=>t.startsWith("worktree ")).map((t)=>_(t.slice(9)))}catch{return[]}} export{It};