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.58 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.325 //! 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-msnqqcc2.mjs";import{jt}from"./core-gbbw9cgm.mjs";import{execFile as f}from"child_process";import{promisify as m}from"util";import{existsSync as n,lstatSync as s,readdirSync as l,statSync as a}from"fs";import{isAbsolute as c,join as p}from"path";function i(r,e){if(process.platform!=="darwin"||Boolean(e.DEVELOPER_DIR))return!1;try{return(r.includes("/")?r:(e.PATH??"").split(":").filter((t)=>c(t)).map((t)=>p(t,r)).find((t)=>n(t)))==="/usr/bin/git"&&a("/Library/Developer/CommandLineTools",{throwIfNoEntry:!1})===void 0&&s("/var/db/xcode_select_link",{throwIfNoEntry:!1})===void 0&&!l("/Applications").some((t)=>/^Xcode.*\.app$/i.test(t))}catch{return!1}}var d=m(f);async function qe(r){let e=jt("git");if(e===null||i(e,process.env))return[];try{let{stdout:o}=await d(e,["-c","core.hooksPath=/dev/null","-c","core.fsmonitor=","worktree","list","--porcelain"],{cwd:r,timeout:5000,windowsHide:!0});if(!o)return[];return o.split(` `).filter((t)=>t.startsWith("worktree ")).map((t)=>_(t.slice(9)))}catch{return[]}} export{qe};