@anthropic-ai/claude-agent-sdk 0.3.322 → 0.3.324
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.
- package/README.md +1 -1
- package/bridge.mjs +104 -84
- package/browser-sdk.js +78 -67
- package/core-4tdxk2rb.mjs +16 -0
- package/core-7sc5aw3j.mjs +17 -0
- package/core-de9edyhn.mjs +19 -0
- package/core-dtdat34e.mjs +45 -0
- package/core-hjrk2537.mjs +16 -0
- package/core-mjr5v0tc.mjs +17 -0
- package/core-nbx2rjdx.mjs +18 -0
- package/core-qe0dk8na.mjs +16 -0
- package/core-qkncpzfw.mjs +42 -0
- package/core-s4as5f4b.mjs +18 -0
- package/core-ttsjec9g.mjs +17 -0
- package/core.d.ts +3 -0
- package/core.mjs +11 -11
- package/manifest.json +22 -22
- package/manifest.zst.json +26 -26
- package/package.json +21 -14
- package/sdk-tools.d.ts +182 -12
- package/sdk.d.ts +298 -73
- package/sdk.mjs +96 -85
- package/core-8zdh6hy9.mjs +0 -45
- package/core-b5da77cd.mjs +0 -34
- package/core-f2yzhw4m.mjs +0 -18
- package/core-j29a9c1a.mjs +0 -17
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
|
+
|
|
3
|
+
// Version: 0.3.324
|
|
4
|
+
|
|
5
|
+
//! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
|
|
6
|
+
if (typeof Symbol.dispose !== 'symbol') {
|
|
7
|
+
try {
|
|
8
|
+
Symbol.dispose = Symbol.for('Symbol.dispose')
|
|
9
|
+
} catch {}
|
|
10
|
+
}
|
|
11
|
+
if (typeof Symbol.asyncDispose !== 'symbol') {
|
|
12
|
+
try {
|
|
13
|
+
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
|
|
14
|
+
} catch {}
|
|
15
|
+
}
|
|
16
|
+
import{qe}from"./core-nbx2rjdx.mjs";import"./core-ttsjec9g.mjs";import"./core-qkncpzfw.mjs";export{qe as getWorktreePathsPortable};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
|
+
|
|
3
|
+
// Version: 0.3.324
|
|
4
|
+
|
|
5
|
+
//! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
|
|
6
|
+
if (typeof Symbol.dispose !== 'symbol') {
|
|
7
|
+
try {
|
|
8
|
+
Symbol.dispose = Symbol.for('Symbol.dispose')
|
|
9
|
+
} catch {}
|
|
10
|
+
}
|
|
11
|
+
if (typeof Symbol.asyncDispose !== 'symbol') {
|
|
12
|
+
try {
|
|
13
|
+
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
|
|
14
|
+
} catch {}
|
|
15
|
+
}
|
|
16
|
+
import{u}from"./core-qkncpzfw.mjs";var h=["us","eu","apac","jp","au","us-gov","global"],Rn=["us","eu","apac","jp","au","global"];function b(e,n,t){if(e===n)return 0;let i=e.length,o=n.length,r=t+1;if(Math.abs(i-o)>t)return r;let s=new Int32Array(o+2).fill(r),a=new Int32Array(o+2).fill(r),d=new Int32Array(o+2).fill(r);for(let l=0;l<=Math.min(o,t);l++)a[l]=l;for(let l=1;l<=i;l++){let f=Math.max(1,l-t),M=Math.min(o,l+t);d[f-1]=f===1?Math.min(l,r):r;let g=d[f-1];for(let c=f;c<=M;c++){let m=Math.min(a[c]+1,d[c-1]+1,a[c-1]+(e[l-1]===n[c-1]?0:1),r);if(l>1&&c>1&&e[l-1]===n[c-2]&&e[l-2]===n[c-1])m=Math.min(m,s[c-2]+1);d[c]=m,g=Math.min(g,m)}if(d[M+1]=r,g>t)return r;[s,a,d]=[a,d,s]}return a[o]}var On=["claude-3-5-haiku","claude-3-5-sonnet","claude-3-7-sonnet","claude-fable-5","claude-fable-5-1","claude-fable-5-2","claude-haiku-4-5","claude-haiku-5-5","claude-mythos-5","claude-mythos-5-1","claude-mythos-5-2","claude-opus-4-0","claude-opus-4-1","claude-opus-4-5","claude-opus-4-6","claude-opus-4-7","claude-opus-4-8","claude-opus-5","claude-opus-5-5","claude-sonnet-4-0","claude-sonnet-4-5","claude-sonnet-4-6","claude-sonnet-5","claude-sonnet-5-5"],x=["sonnet","opus","haiku","fable","best","sonnet[1m]","opus[1m]","fable[1m]","opusplan"],ge=["sonnet","opus","haiku","fable"];function ft(e){return x.includes(e)}function Bt(e){return e.replace(/\[1m\]$/i,"")}function y(e){return e.replace(/\[(1|2)m\]/gi,"")}function be(e){return ge.includes(e)}function V(e){let n=e.trim().toLowerCase();if(n===""||/\s/.test(n))return null;n=n.replace(/\[[12]m\]$/,"");let t=n.lastIndexOf("/");if(t!==-1)n=n.slice(t+1);let i=/^(?:([a-z-]+)\.)?anthropic\.(claude-.*)$/.exec(n);if(i){let[,a,d=""]=i;if(a!==void 0&&!h.includes(a))return null;n=d}let o=I(n);if(!o)return null;let r=n.slice(o.base.length);if(r!==""&&!/^[-@]/.test(r))return null;let s={family:o.family,major:o.major,legacyVersionFirst:o.legacyVersionFirst,base:o.base};if(o.minor!==void 0)s.minor=o.minor;if(!E(r))s.trailer=r;else{let a=/(?:-v\d+@|[-@])(\d{8})/.exec(r)?.[1];if(a!==void 0)s.date=a}return s}function E(e){return/^(?:-fast|-latest)?(?:-v\d{1,3}@\d{8}|[-@]\d{8})?(?:-v\d{1,3}(?::\d{1,3})?)?$/.test(e)}function Tn(e,n){return e.major-n.major||(e.minor??0)-(n.minor??0)}function I(e){let n=/^claude-([a-z]+)-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?/.exec(e);if(n){let[i,o="",r="",s]=n;return{family:o,major:Number(r),minor:s===void 0?void 0:Number(s),legacyVersionFirst:!1,base:i}}let t=/^claude-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?-([a-z]+)/.exec(e);if(t){let[i,o="",r,s=""]=t;return{family:s,major:Number(o),minor:r===void 0?void 0:Number(r),legacyVersionFirst:!0,base:i}}return null}function D(e){let n=e.replace(/[\u0000-\u001f\u007f-\u009f]/g,"?");return n.length>128?`${n.slice(0,128)}…`:n}function A(){let e=[...ge],n=e.pop();return e.length===0?n??"":`${e.join(", ")} or ${n}`}function p(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ye(e){let n=e.trim().toLowerCase(),t=y(n).trim(),i=t!==n?" Context-size tags such as [1m] are ignored: the entry blocks the model at every context size.":"";if(t==="")return{entry:null,warning:"An empty deniedModels entry was ignored."};if(be(t))return{entry:{kind:"family",family:t},...i!==""&&{warning:`"${D(e)}" blocks every ${p(t)} model.${i}`}};if(ft(t)||t==="default")return{entry:null,warning:`"${D(e)}" was ignored: it names a different model depending on the release and settings. Name the model instead, for example "claude-opus-5-5".`};let o=V(t),r=o!==null||t.startsWith("claude-")?t:`claude-${t}`,s=o??(r!==t?V(r):null);if(s){let a=r.lastIndexOf(s.base),d=a===-1?"":r.slice(a+s.base.length),l=s.trailer===void 0&&d!==""?` "${D(d)}" is ignored.`:"";return{entry:{kind:"model",id:s},...(i!==""||l!=="")&&{warning:`"${D(e)}" blocks ${w(s)}.${l}${i}`}}}return{entry:{kind:"literal",value:t},warning:_(e,t)}}function w(e){let n=p(e.family);return e.minor===void 0?`every ${n} ${e.major}.x model`:`${n} ${e.major}.${e.minor} in every spelling and snapshot`}function _(e,n){let t=`"${D(e)}" blocks only the exact model name "${D(n)}"; other spellings of the same model are not blocked.`,i=n.replace(/(\d)\.(\d)/g,"$1-$2");if(i!==n){let r=i.startsWith("claude-")?i:`claude-${i}`;if(V(r)!==null)return`${t} To block a version, write it with a hyphen: "${D(r)}".`}let o=new RegExp(`^(${ge.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(n);if(o){let[,r,s,a]=o;return a!==void 0?`${t} To block a version, write its model ID, for example "claude-${r}-${s}-${a}".`:`${t} To block only version ${s}, write "claude-${r}-${s}-0"; "claude-${r}-${s}" blocks every ${p(r)} ${s}.x model.`}if(/^[a-z]+$/.test(n)){let r=ge.find((s)=>b(n,s,1)===1);return r!==void 0?`${t} If you meant the ${p(r)} family, write "${r}".`:`${t} To block a model family other than ${A()}, list its versioned IDs.`}return t}function S(e,n){if(e.family!==n.family||e.major!==n.major)return!1;if(e.minor!==void 0&&(n.minor??0)!==e.minor)return!1;if(e.trailer===void 0)return!0;let t=n.trailer??"";return t===e.trailer||t.startsWith(`${e.trailer}-`)}function k(e,n){for(let t=e.indexOf(n);t!==-1;t=e.indexOf(n,t+1)){let i=t===0||!/[a-z0-9]/i.test(e[t-1]),o=t+n.length,r=o===e.length||!/[a-z0-9]/i.test(e[o]);if(i&&r)return!0}return!1}function O(e,n,t){switch(e.kind){case"literal":return n===e.value;case"family":return t?.family===e.family||k(n,e.family);case"model":return t!==null&&S(e.id,t)}}function L(e,n){let t=y(e.trim()).toLowerCase(),i=V(t);return n.some((o)=>{let{entry:r}=Ye(o);return r!==null&&O(r,t,i)})}var gt='"deniedModels" was present but is not a list of model names, so it was ignored and blocks no models until it is fixed.';function mt(e){let n=[],t=[];for(let i of e)if(typeof i==="string")n.push(i);else t.push(`"deniedModels" contained a non-string entry (${i===null?"null":typeof i}); the entry was ignored.`);return{entries:n,notes:t}}function xn(e,n){let t=Array.isArray(e)?e:[],i=Array.isArray(e)?t.flatMap((a)=>typeof a==="string"?[]:`"models" contained a non-string entry (${a===null?"null":typeof a}), which is not a model name, so it cannot be matched.`):['"models" is not a list of model names, so nothing was matched.'],o=n??[];if(!Array.isArray(o))return{denied:t.map(()=>!1),warnings:u([gt,...i])};let{entries:r,notes:s}=mt(o);return{denied:t.map((a)=>typeof a==="string"&&L(a,r)),warnings:u([...s,...r.flatMap((a)=>Ye(a).warning??[]),...i])}}
|
|
17
|
+
export{Rn,On,ge,ft,Bt,be,V,Tn,D,Ye,gt,mt,xn};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
|
+
|
|
3
|
+
// Version: 0.3.324
|
|
4
|
+
|
|
5
|
+
//! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
|
|
6
|
+
if (typeof Symbol.dispose !== 'symbol') {
|
|
7
|
+
try {
|
|
8
|
+
Symbol.dispose = Symbol.for('Symbol.dispose')
|
|
9
|
+
} catch {}
|
|
10
|
+
}
|
|
11
|
+
if (typeof Symbol.asyncDispose !== 'symbol') {
|
|
12
|
+
try {
|
|
13
|
+
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
|
|
14
|
+
} catch {}
|
|
15
|
+
}
|
|
16
|
+
import{_}from"./core-qkncpzfw.mjs";import{jt}from"./core-ttsjec9g.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(`
|
|
17
|
+
`).filter((t)=>t.startsWith("worktree ")).map((t)=>_(t.slice(9)))}catch{return[]}}
|
|
18
|
+
export{qe};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
|
+
|
|
3
|
+
// Version: 0.3.324
|
|
4
|
+
|
|
5
|
+
//! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
|
|
6
|
+
if (typeof Symbol.dispose !== 'symbol') {
|
|
7
|
+
try {
|
|
8
|
+
Symbol.dispose = Symbol.for('Symbol.dispose')
|
|
9
|
+
} catch {}
|
|
10
|
+
}
|
|
11
|
+
if (typeof Symbol.asyncDispose !== 'symbol') {
|
|
12
|
+
try {
|
|
13
|
+
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
|
|
14
|
+
} catch {}
|
|
15
|
+
}
|
|
16
|
+
import{D,Ye,gt,mt,xn}from"./core-mjr5v0tc.mjs";export{gt as DENIED_MODELS_NOT_A_LIST_NOTE,xn as matchDeniedModelsForSdk,Ye as parseDeniedModelsEntry,D as quoted,mt as stringDeniedModelsEntries};
|