@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.
18 lines (15 loc) • 1.88 kB
JavaScript
// (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{c,n,ce,w}from"./core-msnqqcc2.mjs";import{lstat as a,rm as u,rmdir as m,unlink as T}from"fs/promises";var E=new Set(["EPERM","EACCES","EBUSY"]),f=50;async function Kt(t){for(let r=1;;r++){let s=!0;try{await u(t,{recursive:!0,force:!0})}catch(i){if(n(i)!=="ENOTEMPTY")throw i;s=!1}try{await a(t)}catch(i){if(ce(i)||s&&process.platform==="win32"&&E.has(n(i)))return;throw i}if(r===3)throw Object.assign(new c(`'${t}' is still on disk after three tries to delete it. A program may be writing to it, such as a running Claude Code session, or you may not have permission to change it. Stop that program or fix the permissions, then delete it yourself.`,"removeTree: still on disk after three tries"),{code:"ENOTEMPTY"});await w(r*f)}}class o{resetters=[];built=[];lazy(t){let r,s=()=>{r=void 0};return this.resetters.push(s),()=>{if(r===void 0)r=t(),this.built.push(s);return r}}builtCount(){return this.built.length}releaseBuiltSince(t){for(let r of this.built.splice(t))r()}reset(){for(let t of this.resetters)t();this.built.length=0}}var l=new o;function e(t){return l.lazy(t)}import{createHash as h}from"crypto";function Pe(t){if(typeof t!=="string"&&!ArrayBuffer.isView(t))throw Object.assign(TypeError("sha256Hex: the data is neither text nor bytes"),{code:"ERR_INVALID_ARG_TYPE"});return h("sha256").update(t).digest("hex")}
export{Kt,e,Pe};