mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-25 15:03:46 +00:00
Rebuilt all 4 versions from scratch: - v0.2.x: 1,049 classes, 13,869 functions, 3,375 RVF vectors - v1.0.x: 1,390 classes, 16,593 functions, 4,669 RVF vectors - v2.0.x: 1,612 classes, 20,395 functions, 5,712 RVF vectors - v2.1.x: 1,632 classes, 19,906 functions, 9,058 RVF vectors Structure: source/ (17 JS modules in subfolders) + rvf/ (9 containers) - Zero mixing: no JS in rvf dirs, no RVF in source dirs - 100% code coverage: uncategorized/ catches everything - 17 modules: core/3, tools/3, permissions/1, config/3, telemetry/1, ui/2, types/1, uncategorized/1 - 9 RVF containers per version (1 master + 8 per-category) Co-Authored-By: claude-flow <ruv@ruv.net>
1388 lines
No EOL
331 KiB
JavaScript
1388 lines
No EOL
331 KiB
JavaScript
// ===================================================================
|
||
// Module: model-provider
|
||
// Source: @anthropic-ai/claude-code@2.1.91
|
||
// Confidence: 0.275
|
||
// Fragments: 165
|
||
// Extracted: 2026-04-03T03:17:17.994Z
|
||
// ===================================================================
|
||
|
||
#!/usr/bin/env node
|
||
// (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: 2.1.91
|
||
|
||
// Want to see the unminified source? We're hiring!
|
||
// https://job-boards.greenhouse.io/anthropic/jobs/4816199008
|
||
import{createRequire as O_5}from"node:module";var e95=Object.create;var{getPrototypeOf:q_5,defineProperty:hx6,getOwnPropertyNames:zj7,getOwnPropertyDescriptor:K_5}=Object,Yj7=Object.prototype.hasOwnProperty;function $j7(q){return this[q]}var __5,z_5,w6=(q,K,_)=>{var z=q!=null&&typeof q==="object";if(z){var Y=K?__5??=new WeakMap:z_5??=new WeakMap,$=Y.get(q);if($)return $}_=q!=null?e95(q_5(q)):{};let O=K||!q||!q.__esModule?hx6(_,"default",{value:q,enumerable:!0}):_;for(let A of zj7(q))if(!Yj7.call(O,A))hx6(O,A,{get:$j7.bind(q,A),enumerable:!0});if(z)Y.set(q,O);return O},hq=(q)=>{var K=(_j7??=new WeakMap).get(q),_;if(K)return K;if(K=hx6({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var z of zj7(q))if(!Yj7.call(K,z))hx6(K,z,{get:$j7.bind(q,z),enumerable:!(_=K_5(q,z))||_.enumerable})}return _j7.set(q,K),K},_j7,B=(q,K)=>()=>(K||q((K={exports:{}}).exports,K),K.exports);var Y_5=(q)=>q;function $_5(q,K){this[q]=Y_5.bind(null,K)}var v8=(q,K)=>{for(var _ in K)hx6(q,_,{get:K[_],enumerable:!0,configurable:!0,set:$_5.bind(K,_)})};var L=(q,K)=>()=>(q&&(K=q(q=0)),K);var U6=O_5(import.meta.url),A_5=Symbol.dispose||Symbol.for("Symbol.dispose"),w_5=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),lz=(q,K,_)=>{if(K!=null){if(typeof K!=="object"&&typeof K!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var z;if(_)z=K[w_5];if(z===void 0)z=K[A_5];if(typeof z!=="function")throw TypeError("Object not disposable");q.push([_,z,K])}else if(_)q.push([_]);
|
||
|
||
if(q==="aarch64"||q==="arm64")return"arm64";if(q)return`other:${q}`;return"unknown"},PM7=(q)=>{if(q=q.toLowerCase(),q.includes("ios"))return"iOS";if(q==="android")return"Android";if(q==="darwin")return"MacOS";if(q==="win32")return"Windows";if(q==="freebsd")return"FreeBSD";if(q==="openbsd")return"OpenBSD";if(q==="linux")return"Linux";if(q)return`Other:${q}`;return"Unknown"},WM7,fM7=()=>{return WM7??(WM7=FO5())};var ua8=()=>{};function ZM7(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ma8(...q){let K=globalThis.ReadableStream;if(typeof K>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new K(...q)}function $_8(q){let K=Symbol.asyncIterator in q?q[Symbol.asyncIterator]():q[Symbol.iterator]();return ma8({start(){},async pull(_){let{done:z,value:Y}=await K.next();if(z)_.close();else _.enqueue(Y)},async cancel(){await K.return?.()}})}function yI6(q){if(q[Symbol.asyncIterator])return q;let K=q.getReader();return{async next(){try{let _=await K.read();if(_?.done)K.releaseLock();return _}catch(_){throw K.releaseLock(),_}},async return(){let _=K.cancel();return K.releaseLock(),await _,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function GM7(q){if(q===null||typeof q!=="object")return;if(q[Symbol.asyncIterator]){await q[Symbol.asyncIterator]().return?.();return}let K=q.getReader(),_=K.cancel();K.releaseLock(),await _}var vM7=({headers:q,body:K})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(K)}};function TM7(q){return Object.entries(q).filter(([K,_])=>typeof _<"u").map(([K,_])=>{if(typeof _==="string"||typeof _==="number"||typeof _==="boolean")return`${encodeURIComponent(K)}=${encodeURIComponent(_)}`;if(_===null)return`${encodeURIComponent(K)}=`;throw new mq(`Cannot stringify type ${typeof _};
|
||
|
||
props: [${Object.getOwnPropertyNames(q).map((_)=>`"${_}"`).join(", ")}]`}var SM7=(q)=>q!=null&&typeof q==="object"&&typeof q.size==="number"&&typeof q.type==="string"&&typeof q.text==="function"&&typeof q.slice==="function"&&typeof q.arrayBuffer==="function",eO5=(q)=>q!=null&&typeof q==="object"&&typeof q.name==="string"&&typeof q.lastModified==="number"&&SM7(q),qA5=(q)=>q!=null&&typeof q==="object"&&typeof q.url==="string"&&typeof q.blob==="function";var CM7=L(()=>{TP6();TP6()});var ra8=L(()=>{CM7()});var bM7=()=>{};class AH{constructor(q){this._client=q}}function*zA5(q){if(!q)return;if(xM7 in q){let{values:z,nulls:Y}=q;yield*z.entries();for(let $ of Y)yield[$,null];return}let K=!1,_;if(q instanceof Headers)_=q.entries();else if(xa8(q))_=q;else K=!0,_=Object.entries(q??{});for(let z of _){let Y=z[0];if(typeof Y!=="string")throw TypeError("expected header name to be a string");let $=xa8(z[1])?z[1]:[z[1]],O=!1;for(let A of $){if(A===void 0)continue;if(K&&!O)O=!0,yield[Y,null];yield[Y,A]}}}var xM7,x3=(q)=>{let K=new Headers,_=new Set;for(let z of q){let Y=new Set;for(let[$,O]of zA5(z)){let A=$.toLowerCase();if(!Y.has(A))K.delete($),Y.add(A);if(O===null)K.delete($),_.add(A);else K.append($,O),_.delete(A)}}return{[xM7]:!0,values:K,nulls:_}};var NE=L(()=>{U96();xM7=Symbol.for("brand.privateNullableHeaders")});function P_8(q){return typeof q==="object"&&q!==null&&bI6 in q}function oa8(q,K){let _=new Set;if(q){for(let z of q)if(P_8(z))_.add(z[bI6])}if(K)for(let z of K){if(P_8(z))_.add(z[bI6]);if(Array.isArray(z.content)){for(let Y of z.content)if(P_8(Y))_.add(Y[bI6])}}return Array.from(_)}function W_8(q,K){let _=oa8(q,K);if(_.length===0)return{};return{"x-stainless-helper":_.join(", ")}}function IM7(q){if(P_8(q))return{"x-stainless-helper":q[bI6]};return{}}var bI6;var xI6=L(()=>{bI6=Symbol("anthropic.sdk.stainlessHelper")});function mM7(q){return q.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var uM7,YA5=(q=mM7)=>function(_,...z){if(_.length===1)return _[0];
|
||
|
||
let Y=!1,$=[],O=_.reduce((H,J,M)=>{if(/[?#]/.test(J))Y=!0;let X=z[M],P=(Y?encodeURIComponent:q)(""+X);if(M!==z.length&&(X==null||typeof X==="object"&&X.toString===Object.getPrototypeOf(Object.getPrototypeOf(X.hasOwnProperty??uM7)??uM7)?.toString))P=X+"",$.push({start:H.length+J.length,length:P.length,error:`Value of type ${Object.prototype.toString.call(X).slice(8,-1)} is not a valid path parameter`});return H+J+(M===z.length?"":P)},""),A=O.split(/[?#]/,1)[0],w=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,j;while((j=w.exec(A))!==null)$.push({start:j.index,length:j[0].length,error:`Value "${j[0]}" can't be safely passed as a path parameter`});if($.sort((H,J)=>H.start-J.start),$.length>0){let H=0,J=$.reduce((M,X)=>{let P=" ".repeat(X.start-H),W="^".repeat(X.length);return H=X.start+X.length,M+P+W},"");throw new mq(`Path parameters result in path with invalid segments:
|
||
${$.map((M)=>M.error).join(`
|
||
`)}
|
||
${O}
|
||
${J}`)}return O},jj;var Ge=L(()=>{FW();uM7=Object.freeze(Object.create(null)),jj=YA5(mM7)});var II6;var aa8=L(()=>{uB();NE();xI6();TP6();Ge();II6=class II6 extends AH{list(q={},K){let{betas:_,...z}=q??{};return this._client.getAPIList("/v1/files",qI,{query:z,...K,headers:x3([{"anthropic-beta":[..._??[],"files-api-2025-04-14"].toString()},K?.headers])})}delete(q,K={},_){let{betas:z}=K??{};return this._client.delete(jj`/v1/files/${q}`,{..._,headers:x3([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},_?.headers])})}download(q,K={},_){let{betas:z}=K??{};return this._client.get(jj`/v1/files/${q}/content`,{..._,headers:x3([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},_?.headers]),__binaryResponse:!0})}retrieveMetadata(q,K={},_){let{betas:z}=K??{};return this._client.get(jj`/v1/files/${q}`,{..._,headers:x3([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},_?.headers])})}upload(q,K){let{betas:_,...z}=q;
|
||
|
||
return this._client.post("/v1/files",vP6({body:z,...K,headers:x3([{"anthropic-beta":[..._??[],"files-api-2025-04-14"].toString()},IM7(z.file),K?.headers])},this._client))}}});var uI6;var sa8=L(()=>{uB();NE();Ge();uI6=class uI6 extends AH{retrieve(q,K={},_){let{betas:z}=K??{};return this._client.get(jj`/v1/models/${q}?beta=true`,{..._,headers:x3([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},_?.headers])})}list(q={},K){let{betas:_,...z}=q??{};return this._client.getAPIList("/v1/models?beta=true",qI,{query:z,...K,headers:x3([{..._?.toString()!=null?{"anthropic-beta":_?.toString()}:void 0},K?.headers])})}}});var ve=L(()=>{FW()});var D_8;var ta8=L(()=>{D_8={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function pM7(q){return q?.output_format??q?.output_config?.format}function ea8(q,K,_){let z=pM7(K);if(!K||!("parse"in(z??{})))return{...q,content:q.content.map((Y)=>{if(Y.type==="text"){let $=Object.defineProperty({...Y},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty($,"parsed",{get(){return _.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return Y}),parsed_output:null};return qs8(q,K,_)}function qs8(q,K,_){let z=null,Y=q.content.map(($)=>{if($.type==="text"){let O=AA5(K,$.text);if(z===null)z=O;let A=Object.defineProperty({...$},"parsed_output",{value:O,enumerable:!1});return Object.defineProperty(A,"parsed",{get(){return _.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),O},enumerable:!1})}return $});return{...q,content:Y,parsed_output:z}}function AA5(q,K){let _=pM7(q);if(_?.type!=="json_schema")return null;try{if("parse"in _)return _.parse(K);
|
||
|
||
EP6=class EP6{constructor(q,K){this.iterator=q,this.controller=K}async*decoder(){let q=new Ze;for await(let K of this.iterator)for(let _ of q.decode(K))yield JSON.parse(_);for(let K of q.flush())yield JSON.parse(K)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(q,K){if(!q.body){if(K.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new mq("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new mq("Attempted to iterate over a response with no body")}return new EP6(yI6(q.body),K)}}});var iI6;var Hs8=L(()=>{uB();NE();js8();ve();Ge();iI6=class iI6 extends AH{create(q,K){let{betas:_,...z}=q;return this._client.post("/v1/messages/batches?beta=true",{body:z,...K,headers:x3([{"anthropic-beta":[..._??[],"message-batches-2024-09-24"].toString()},K?.headers])})}retrieve(q,K={},_){let{betas:z}=K??{};return this._client.get(jj`/v1/messages/batches/${q}?beta=true`,{..._,headers:x3([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},_?.headers])})}list(q={},K){let{betas:_,...z}=q??{};return this._client.getAPIList("/v1/messages/batches?beta=true",qI,{query:z,...K,headers:x3([{"anthropic-beta":[..._??[],"message-batches-2024-09-24"].toString()},K?.headers])})}delete(q,K={},_){let{betas:z}=K??{};return this._client.delete(jj`/v1/messages/batches/${q}?beta=true`,{..._,headers:x3([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},_?.headers])})}cancel(q,K={},_){let{betas:z}=K??{};return this._client.post(jj`/v1/messages/batches/${q}/cancel?beta=true`,{..._,headers:x3([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},_?.headers])})}async results(q,K={},_){let z=await this.retrieve(q);if(!z.results_url)throw new mq(`No batch \`results_url\`; Has it finished processing? ${z.processing_status} - ${z.id}`);let{betas:Y}=K??{};
|
||
|
||
return this._client.get(z.results_url,{..._,headers:x3([{"anthropic-beta":[...Y??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},_?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap(($,O)=>EP6.fromResponse(O.response,O.controller))}}});function oM7(q){if(!q.output_format)return q;if(q.output_config?.format)throw new mq("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:K,..._}=q;return{..._,output_config:{...q.output_config,format:K}}}var rM7,XA5,Ve;var Js8=L(()=>{ve();ta8();NE();xI6();Ks8();dM7();ws8();E_8();Hs8();Hs8();ws8();E_8();rM7={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},XA5=["claude-opus-4-6"];Ve=class Ve extends AH{constructor(){super(...arguments);this.batches=new iI6(this._client)}create(q,K){let _=oM7(q),{betas:z,...Y}=_;if(Y.model in rM7)console.warn(`The model '${Y.model}' is deprecated and will reach end-of-life on ${rM7[Y.model]}
|
||
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(Y.model in XA5&&Y.thinking&&Y.thinking.type==="enabled")console.warn(`Using Claude with ${Y.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let $=this._client._options.timeout;if(!Y.stream&&$==null){let A=D_8[Y.model]??void 0;$=this._client.calculateNonstreamingTimeout(Y.max_tokens,A)}let O=W_8(Y.tools,Y.messages);
|
||
|
||
return this._client.post("/v1/messages?beta=true",{body:Y,timeout:$??600000,...K,headers:x3([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},O,K?.headers]),stream:_.stream??!1})}parse(q,K){return K={...K,headers:x3([{"anthropic-beta":[...q.betas??[],"structured-outputs-2025-12-15"].toString()},K?.headers])},this.create(q,K).then((_)=>qs8(_,q,{logger:this._client.logger??console}))}stream(q,K){return QI6.createMessage(this,q,K)}countTokens(q,K){let _=oM7(q),{betas:z,...Y}=_;return this._client.post("/v1/messages/count_tokens?beta=true",{body:Y,...K,headers:x3([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},K?.headers])})}toolRunner(q,K){return new nI6(this._client,q,K)}};Ve.Batches=iI6;Ve.BetaToolRunner=nI6;Ve.ToolError=NP6});var rI6;var Ms8=L(()=>{uB();NE();TP6();Ge();rI6=class rI6 extends AH{create(q,K={},_){let{betas:z,...Y}=K??{};return this._client.post(jj`/v1/skills/${q}/versions?beta=true`,vP6({body:Y,..._,headers:x3([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},_?.headers])},this._client))}retrieve(q,K,_){let{skill_id:z,betas:Y}=K;return this._client.get(jj`/v1/skills/${z}/versions/${q}?beta=true`,{..._,headers:x3([{"anthropic-beta":[...Y??[],"skills-2025-10-02"].toString()},_?.headers])})}list(q,K={},_){let{betas:z,...Y}=K??{};return this._client.getAPIList(jj`/v1/skills/${q}/versions?beta=true`,SI6,{query:Y,..._,headers:x3([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},_?.headers])})}delete(q,K,_){let{skill_id:z,betas:Y}=K;return this._client.delete(jj`/v1/skills/${z}/versions/${q}?beta=true`,{..._,headers:x3([{"anthropic-beta":[...Y??[],"skills-2025-10-02"].toString()},_?.headers])})}}});var LP6;var Xs8=L(()=>{Ms8();Ms8();uB();NE();TP6();Ge();LP6=class LP6 extends AH{constructor(){super(...arguments);this.versions=new rI6(this._client)}create(q={},K){let{betas:_,...z}=q??{};
|
||
|
||
return this._client.post("/v1/skills?beta=true",vP6({body:z,...K,headers:x3([{"anthropic-beta":[..._??[],"skills-2025-10-02"].toString()},K?.headers])},this._client,!1))}retrieve(q,K={},_){let{betas:z}=K??{};return this._client.get(jj`/v1/skills/${q}?beta=true`,{..._,headers:x3([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},_?.headers])})}list(q={},K){let{betas:_,...z}=q??{};return this._client.getAPIList("/v1/skills?beta=true",SI6,{query:z,...K,headers:x3([{"anthropic-beta":[..._??[],"skills-2025-10-02"].toString()},K?.headers])})}delete(q,K={},_){let{betas:z}=K??{};return this._client.delete(jj`/v1/skills/${q}?beta=true`,{..._,headers:x3([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},_?.headers])})}};LP6.Versions=rI6});var e0;var Ps8=L(()=>{aa8();aa8();sa8();sa8();Js8();Js8();Xs8();Xs8();e0=class e0 extends AH{constructor(){super(...arguments);this.models=new uI6(this._client),this.messages=new Ve(this._client),this.files=new II6(this._client),this.skills=new LP6(this._client)}};e0.Models=uI6;e0.Messages=Ve;e0.Files=II6;e0.Skills=LP6});var Ne;var Ws8=L(()=>{NE();Ne=class Ne extends AH{create(q,K){let{betas:_,...z}=q;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...K,headers:x3([{..._?.toString()!=null?{"anthropic-beta":_?.toString()}:void 0},K?.headers]),stream:q.stream??!1})}}});function aM7(q){return q?.output_config?.format}function Ds8(q,K,_){let z=aM7(K);if(!K||!("parse"in(z??{})))return{...q,content:q.content.map((Y)=>{if(Y.type==="text")return Object.defineProperty({...Y},"parsed_output",{value:null,enumerable:!1});return Y}),parsed_output:null};return fs8(q,K,_)}function fs8(q,K,_){let z=null,Y=q.content.map(($)=>{if($.type==="text"){let O=fA5(K,$.text);if(z===null)z=O;return Object.defineProperty({...$},"parsed_output",{value:O,enumerable:!1})}return $});return{...q,content:Y,parsed_output:z}}function fA5(q,K){let _=aM7(q);if(_?.type!=="json_schema")return null;try{if("parse"in _)return _.parse(K);
|
||
|
||
return this._client.get(_.results_url,{...K,headers:x3([{Accept:"application/binary"},K?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,Y)=>EP6.fromResponse(Y.response,Y.controller))}}});var EE,zX7,GA5;var ys8=L(()=>{NE();xI6();_X7();Zs8();Ns8();Ns8();ta8();EE=class EE extends AH{constructor(){super(...arguments);this.batches=new _u6(this._client)}create(q,K){if(q.model in zX7)console.warn(`The model '${q.model}' is deprecated and will reach end-of-life on ${zX7[q.model]}
|
||
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(q.model in GA5&&q.thinking&&q.thinking.type==="enabled")console.warn(`Using Claude with ${q.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let _=this._client._options.timeout;if(!q.stream&&_==null){let Y=D_8[q.model]??void 0;_=this._client.calculateNonstreamingTimeout(q.max_tokens,Y)}let z=W_8(q.tools,q.messages);return this._client.post("/v1/messages",{body:q,timeout:_??600000,...K,headers:x3([z,K?.headers]),stream:q.stream??!1})}parse(q,K){return this.create(q,K).then((_)=>fs8(_,q,{logger:this._client.logger??console}))}stream(q,K){return Ku6.createMessage(this,q,K,{logger:this._client.logger??console})}countTokens(q,K){return this._client.post("/v1/messages/count_tokens",{body:q,...K})}};
|
||
|
||
this.logLevel=$,this.logLevel=ga8(Y.logLevel,"ClientOptions.logLevel",this)??ga8(Yu6("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??$,this.fetchOptions=Y.fetchOptions,this.maxRetries=Y.maxRetries??2,this.fetch=Y.fetch??ZM7(),J4(this,I_8,vM7,"f"),this._options=Y,this.apiKey=typeof K==="string"?K:null,this.authToken=_}withOptions(q){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...q})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:q,nulls:K}){if(q.get("x-api-key")||q.get("authorization"))return;if(this.apiKey&&q.get("x-api-key"))return;if(K.has("x-api-key"))return;if(this.authToken&&q.get("authorization"))return;if(K.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(q){return x3([await this.apiKeyAuth(q),await this.bearerAuth(q)])}async apiKeyAuth(q){if(this.apiKey==null)return;return x3([{"X-Api-Key":this.apiKey}])}async bearerAuth(q){if(this.authToken==null)return;return x3([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(q){return TM7(q)}getUserAgent(){return`${this.constructor.name}/JS ${fe}`}defaultIdempotencyKey(){return`stainless-node-retry-${Ca8()}`}makeStatusError(q,K,_,z){return nq.generate(q,K,_,z)}buildURL(q,K,_){let z=!x1(this,Ls8,"m",YX7).call(this)&&_||this.baseURL,Y=jM7(q)?new URL(q):new URL(z+(z.endsWith("/")&&q.startsWith("/")?q.slice(1):q)),$=this.defaultQuery(),O=Object.fromEntries(Y.searchParams);if(!Ia8($)||!Ia8(O))K={...O,...$,...K};if(typeof K==="object"&&K&&!Array.isArray(K))Y.search=this.stringifyQuery(K);
|
||
|
||
return Y.toString()}_calculateNonstreamingTimeout(q){if(3600*q/128000>600)throw new mq("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(q){}async prepareRequest(q,{url:K,options:_}){}get(q,K){return this.methodRequest("get",q,K)}post(q,K){return this.methodRequest("post",q,K)}patch(q,K){return this.methodRequest("patch",q,K)}put(q,K){return this.methodRequest("put",q,K)}delete(q,K){return this.methodRequest("delete",q,K)}methodRequest(q,K,_){return this.request(Promise.resolve(_).then((z)=>{return{method:q,path:K,...z}}))}request(q,K=null){return new Q96(this,this.makeRequest(q,K,void 0))}async makeRequest(q,K,_){let z=await q,Y=z.maxRetries??this.maxRetries;if(K==null)K=Y;await this.prepareOptions(z);let{req:$,url:O,timeout:A}=await this.buildRequest(z,{retryCount:Y-K});await this.prepareRequest($,{url:O,options:z});let w="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),j=_===void 0?"":`, retryOf: ${_}`,H=Date.now();if(UW(this).debug(`[${w}] sending request`,Zl({retryOfRequestLogID:_,method:z.method,url:O,options:z,headers:$.headers})),z.signal?.aborted)throw new c_;let J=new AbortController,M=await this.fetchWithTimeout(O,$,A,J).catch(ZI6),X=Date.now();if(M instanceof globalThis.Error){let D=`retrying, ${K} attempts remaining`;if(z.signal?.aborted)throw new c_;let f=fl(M)||/timed? ?out/i.test(String(M)+("cause"in M?String(M.cause):""));if(K)return UW(this).info(`[${w}] connection ${f?"timed out":"failed"} - ${D}`),UW(this).debug(`[${w}] connection ${f?"timed out":"failed"} (${D})`,Zl({retryOfRequestLogID:_,url:O,durationMs:X-H,message:M.message})),this.retryRequest(z,K,_??w);if(UW(this).info(`[${w}] connection ${f?"timed out":"failed"} - error; no more retries left`),UW(this).debug(`[${w}] connection ${f?"timed out":"failed"} (error; no more retries left)`,Zl({retryOfRequestLogID:_,url:O,durationMs:X-H,message:M.message})),f)throw new IB;
|
||
|
||
return!1}async retryRequest(q,K,_,z){let Y,$=z?.get("retry-after-ms");if($){let A=parseFloat($);if(!Number.isNaN(A))Y=A}let O=z?.get("retry-after");if(O&&!Y){let A=parseFloat(O);if(!Number.isNaN(A))Y=A*1000;else Y=Date.parse(O)-Date.now()}if(Y===void 0){let A=q.maxRetries??this.maxRetries;Y=this.calculateDefaultRetryTimeoutMillis(K,A)}return await MM7(Y),this.makeRequest(q,K-1,_)}calculateDefaultRetryTimeoutMillis(q,K){let Y=K-q,$=Math.min(0.5*Math.pow(2,Y),8),O=1-Math.random()*0.25;return $*O*1000}calculateNonstreamingTimeout(q,K){if(3600000*q/128000>600000||K!=null&&q>K)throw new mq("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(q,{retryCount:K=0}={}){let _={...q},{method:z,path:Y,query:$,defaultBaseURL:O}=_,A=this.buildURL(Y,$,O);if("timeout"in _)JM7("timeout",_.timeout);_.timeout=_.timeout??this.timeout;let{bodyHeaders:w,body:j}=this.buildBody({options:_}),H=await this.buildHeaders({options:q,method:z,bodyHeaders:w,retryCount:K});return{req:{method:z,headers:H,..._.signal&&{signal:_.signal},...globalThis.ReadableStream&&j instanceof globalThis.ReadableStream&&{duplex:"half"},...j&&{body:j},...this.fetchOptions??{},..._.fetchOptions??{}},url:A,timeout:_.timeout}}async buildHeaders({options:q,method:K,bodyHeaders:_,retryCount:z}){let Y={};if(this.idempotencyHeader&&K!=="get"){if(!q.idempotencyKey)q.idempotencyKey=this.defaultIdempotencyKey();Y[this.idempotencyHeader]=q.idempotencyKey}let $=x3([Y,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...q.timeout?{"X-Stainless-Timeout":String(Math.trunc(q.timeout/1000))}:{},...fM7(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(q),this._options.defaultHeaders,_,q.headers]);
|
||
|
||
if(K.source==="github"){if(!(K.repo||"").toLowerCase().startsWith(`${$w8}/`))return`The name '${q}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${$w8}/' can use this name.`;return null}if(K.source==="git"&&K.url){let z=K.url.toLowerCase(),Y=z.includes("github.com/anthropics/"),$=z.includes("git@github.com:anthropics/");if(Y||$)return null;return`The name '${q}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${$w8}/' can use this name.`}return`The name '${q}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${$w8}' organization.`}function mB6(q){return typeof q==="string"&&q.startsWith("./")}function wg(q){return q.source==="file"||q.source==="directory"}var CI,bx5,xx5,Ix5,$w8="anthropics",On,uD6,Gb7,V31,N31,kb7,y31,mx5,Ow8,px5,Bx5,gx5,Fx5,Ux5,Qx5,vb7,dx5,cx5,Vb7,lx5,nx5,mD6,ix5,Nb7,rx5,Yz6,uB6,k31,yb7,ox5,E31,y66,pD6,ax5,sx5,aF$,tx5,pB6,ex5,qI5,BB6,sF$,KI5,BD6;var JG=L(()=>{u7();Yw8();zz6();CI=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),bx5=new Set(["knowledge-work-plugins"]);xx5=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,Ix5=/[^\u0020-\u007E]/;
|
||
|
||
diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),k31=p6(()=>h.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),yb7=p6(()=>h.union([On().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),h.object({source:h.literal("npm"),package:Nb7().or(h.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:h.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:h.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),h.object({source:h.literal("pip"),package:h.string().describe("Python package name as it appears on PyPI"),version:h.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:h.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),h.object({source:h.literal("url"),url:h.string().describe("Full git repository URL (https:// or git@)"),ref:h.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:k31().optional().describe("Specific commit SHA to use")}),h.object({source:h.literal("github"),repo:h.string().describe("GitHub repository in owner/repo format"),ref:h.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:k31().optional().describe("Specific commit SHA to use")}),h.object({source:h.literal("git-subdir"),url:h.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:h.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:h.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:k31().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized;
|
||
|
||
else if(!q.__aws_sdk_context.features)q.__aws_sdk_context.features={};q.__aws_sdk_context.features[K]=_}function Ya5(q,K,_){if(!q.$source)q.$source={};return q.$source[K]=_,q}$a5.emitWarningIfUnsupportedVersion=Ka5;$a5.setCredentialFeature=_a5;$a5.setFeature=za5;$a5.setTokenFeature=Ya5;$a5.state=hz1});var ZX=B((Pa5)=>{class lf6 extends Error{name="ProviderError";tryNextLink;constructor(q,K=!0){let _,z=!0;if(typeof K==="boolean")_=void 0,z=K;else if(K!=null&&typeof K==="object")_=K.logger,z=K.tryNextLink??!0;super(q);this.tryNextLink=z,Object.setPrototypeOf(this,lf6.prototype),_?.debug?.(`@smithy/property-provider ${z?"->":"(!)"} ${q}`)}static from(q,K=!0){return Object.assign(new this(q.message,K),q)}}class Rz1 extends lf6{name="CredentialsProviderError";constructor(q,K=!0){super(q,K);Object.setPrototypeOf(this,Rz1.prototype)}}class Sz1 extends lf6{name="TokenProviderError";constructor(q,K=!0){super(q,K);Object.setPrototypeOf(this,Sz1.prototype)}}var Ja5=(...q)=>async()=>{if(q.length===0)throw new lf6("No providers in chain");let K;for(let _ of q)try{return await _()}catch(z){if(K=z,z?.tryNextLink)continue;throw z}throw K},Ma5=(q)=>()=>Promise.resolve(q),Xa5=(q,K,_)=>{let z,Y,$,O=!1,A=async()=>{if(!Y)Y=q();try{z=await Y,$=!0,O=!1}finally{Y=void 0}return z};if(K===void 0)return async(w)=>{if(!$||w?.forceRefresh)z=await A();return z};return async(w)=>{if(!$||w?.forceRefresh)z=await A();if(O)return z;if(_&&!_(z))return O=!0,z;if(K(z))return await A(),z;return z}};Pa5.CredentialsProviderError=Rz1;Pa5.ProviderError=lf6;Pa5.TokenProviderError=Sz1;Pa5.chain=Ja5;Pa5.fromStatic=Ma5;Pa5.memoize=Xa5});var jj8=B((Na5)=>{var Ta5=mV(),ka5=ZX(),gd7="AWS_ACCESS_KEY_ID",Fd7="AWS_SECRET_ACCESS_KEY",Ud7="AWS_SESSION_TOKEN",Qd7="AWS_CREDENTIAL_EXPIRATION",dd7="AWS_CREDENTIAL_SCOPE",cd7="AWS_ACCOUNT_ID",Va5=(q)=>async()=>{q?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let K=process.env[gd7],_=process.env[Fd7],z=process.env[Ud7],Y=process.env[Qd7],$=process.env[dd7],O=process.env[cd7];
|
||
|
||
try{J=await At5(H,w,q)}catch(M){if(M.statusCode===401)K=!1;throw M}return J},A)};return async()=>{let A=await Gc7();if(K)return _?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),O($,{...A,timeout:Y});else{let w;try{w=(await $t5({...A,timeout:Y})).toString()}catch(j){if(j?.statusCode===400)throw Object.assign(j,{message:"EC2 Metadata token request returned error"});else if(j.message==="TimeoutError"||[403,404,405].includes(j.statusCode))K=!0;return _?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),O($,{...A,timeout:Y})}return O($,{...A,headers:{[Pc7]:w},timeout:Y})}}},$t5=async(q)=>tg6({...q,path:_t5,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Ot5=async(q)=>(await tg6({...q,path:vc7})).toString(),At5=async(q,K,_)=>{let z=JSON.parse((await tg6({...K,path:vc7+q})).toString());if(!Wc7(z))throw new Lg.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:_.logger});return Dc7(z)};wt5.DEFAULT_MAX_RETRIES=Zc7;wt5.DEFAULT_TIMEOUT=fc7;wt5.ENV_CMDS_AUTH_TOKEN=nz1;wt5.ENV_CMDS_FULL_URI=Xj8;wt5.ENV_CMDS_RELATIVE_URI=Pj8;wt5.fromContainerMetadata=Bs5;wt5.fromInstanceMetadata=zt5;wt5.getInstanceMetadataEndpoint=Gc7;wt5.httpRequest=tg6;wt5.providerConfigFromInit=rz1});var fT=B((ec$,fj8)=>{var Tc7,kc7,Vc7,Nc7,yc7,Ec7,Lc7,hc7,Rc7,Sc7,Cc7,bc7,xc7,Wj8,az1,Ic7,uc7,mc7,rf6,pc7,Bc7,gc7,Fc7,Uc7,Qc7,dc7,cc7,lc7,Dj8,nc7,ic7,rc7;(function(q){var K=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(z){q(_(K,_(z)))});else if(typeof fj8==="object"&&typeof ec$==="object")q(_(K,_(ec$)));else q(_(K));function _(z,Y){if(z!==K)if(typeof Object.create==="function")Object.defineProperty(z,"__esModule",{value:!0});else z.__esModule=!0;
|
||
|
||
let K,_=q.awsContainerCredentialsRelativeUri??process.env[$K3],z=q.awsContainerCredentialsFullUri??process.env[AK3],Y=q.awsContainerAuthorizationToken??process.env[jK3],$=q.awsContainerAuthorizationTokenFile??process.env[wK3],O=q.logger?.constructor?.name==="NoOpLogger"||!q.logger?.warn?console.warn:q.logger.warn.bind(q.logger);if(_&&z)O("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),O("awsContainerCredentialsFullUri will take precedence.");if(Y&&$)O("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),O("awsContainerAuthorizationToken will take precedence.");if(z)K=z;else if(_)K=`${OK3}${_}`;else throw new ii7.CredentialsProviderError(`No HTTP credential provider host provided.
|
||
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:q.logger});let A=new URL(K);(0,zK3.checkUrl)(A,q.logger);let w=KK3.NodeHttpHandler.create({requestTimeout:q.timeout??1000,connectionTimeout:q.timeout??1000});return(0,YK3.retryWrapper)(async()=>{let j=(0,ri7.createGetRequest)(A);if(Y)j.headers.Authorization=Y;else if($)j.headers.Authorization=(await _K3.default.readFile($)).toString();try{let H=await w.handle(j);return(0,ri7.getCredentials)(H.response).then((J)=>(0,qK3.setCredentialFeature)(J,"CREDENTIALS_HTTP","z"))}catch(H){throw new ii7.CredentialsProviderError(String(H),{logger:q.logger})}},q.maxRetries??3,q.timeout??1000)};oi7.fromHttp=HK3});var mj8=B((H$1)=>{Object.defineProperty(H$1,"__esModule",{value:!0});H$1.fromHttp=void 0;var JK3=si7();Object.defineProperty(H$1,"fromHttp",{enumerable:!0,get:function(){return JK3.fromHttp}})});var f$1=B((ZK3)=>{ZK3.HttpAuthLocation=void 0;(function(q){q.HEADER="header",q.QUERY="query"})(ZK3.HttpAuthLocation||(ZK3.HttpAuthLocation={}));ZK3.HttpApiKeyAuthLocation=void 0;(function(q){q.HEADER="header",q.QUERY="query"})(ZK3.HttpApiKeyAuthLocation||(ZK3.HttpApiKeyAuthLocation={}));ZK3.EndpointURLScheme=void 0;
|
||
|
||
return{response:$,output:O}}catch(O){if(Object.defineProperty(O,"$response",{value:$,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in O)){try{O.message+=`
|
||
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(w){if(!z.logger||z.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else z.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof O.$responseBodyText<"u"){if(O.$response)O.$response.body=O.$responseBodyText}try{if(z53.HttpResponse.isInstance($)){let{headers:w={}}=$,j=Object.entries(w);O.$metadata={httpStatusCode:$.statusCode,requestId:N$1(/^x-[\w-]+-request-?id$/,j),extendedRequestId:N$1(/^x-[\w-]+-id-2$/,j),cfId:N$1(/^x-[\w-]+-cf-id$/,j)}}}catch(w){}}throw O}},N$1=(q,K)=>{return(K.find(([_])=>{return _.match(q)})||[void 0,void 0])[1]},Ar7=(q,K)=>(_,z)=>async(Y)=>{let $=q,O=z.endpointV2?.url&&$.urlParser?async()=>$.urlParser(z.endpointV2.url):$.endpoint;if(!O)throw Error("No valid endpoint provider available.");let A=await K(Y.input,{...q,endpoint:O});return _({...Y,request:A})},wr7={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},jr7={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Y53(q,K,_){return{applyToStack:(z)=>{z.add(Or7(q,_),wr7),z.add(Ar7(q,K),jr7)}}}$53.deserializerMiddleware=Or7;$53.deserializerMiddlewareOption=wr7;$53.getSerdePlugin=Y53;$53.serializerMiddleware=Ar7;$53.serializerMiddlewareOption=jr7});var RO=B((kr7)=>{var Fj8=LY1(),Hr7=ZG(),J53=y$1(),E$1=OF6(),M53=FV(),X53=(q)=>q[Fj8.SMITHY_CONTEXT_KEY]||(q[Fj8.SMITHY_CONTEXT_KEY]={}),P53=(q,K)=>{if(!K||K.length===0)return q;let _=[];for(let z of K)for(let Y of q)if(Y.schemeId.split("#")[1]===z)_.push(Y);for(let z of q)if(!_.find(({schemeId:Y})=>Y===z.schemeId))_.push(z);return _};function W53(q){let K=new Map;
|
||
|
||
let{httpAuthOption:{signingProperties:O={}},identity:A,signer:w}=$,j=await K({...z,request:await w.sign(z.request,A,O)}).catch((w.errorHandler||Z53)(O));return(w.successHandler||G53)(j.response,O),j},Pr7={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},v53=(q)=>({applyToStack:(K)=>{K.addRelativeTo(Xr7(),Pr7)}}),T53=(q)=>{if(typeof q==="function")return q;let K=Promise.resolve(q);return()=>K},k53=async(q,K,_,z=($)=>$,...Y)=>{let $=new q(_);return $=z($)??$,await K.send($,...Y)};function V53(q,K,_,z,Y){return async function*(O,A,...w){let j=A,H=O.startingToken??j[_],J=!0,M;while(J){if(j[_]=H,Y)j[Y]=j[Y]??O.pageSize;if(O.client instanceof q)M=await k53(K,O.client,A,O.withCommand,...w);else throw Error(`Invalid client, expected instance of ${q.name}`);yield M;let X=H;H=N53(M,z),J=!!(H&&(!O.stopOnSameToken||H!==X))}return}}var N53=(q,K)=>{let _=q,z=K.split(".");for(let Y of z){if(!_||typeof _!=="object")return;_=_[Y]}return _};function y53(q,K,_){if(!q.__smithy_context)q.__smithy_context={features:{}};else if(!q.__smithy_context.features)q.__smithy_context.features={};q.__smithy_context.features[K]=_}class Wr7{authSchemes=new Map;constructor(q){for(let[K,_]of Object.entries(q))if(_!==void 0)this.authSchemes.set(K,_)}getIdentityProvider(q){return this.authSchemes.get(q)}}class Dr7{async sign(q,K,_){if(!_)throw Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!_.name)throw Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!_.in)throw Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!K.apiKey)throw Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let z=E$1.HttpRequest.clone(q);if(_.in===Fj8.HttpApiKeyAuthLocation.QUERY)z.query[_.name]=K.apiKey;
|
||
|
||
else if(_.in===Fj8.HttpApiKeyAuthLocation.HEADER)z.headers[_.name]=_.scheme?`${_.scheme} ${K.apiKey}`:K.apiKey;else throw Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+_.in+"`");return z}}class fr7{async sign(q,K,_){let z=E$1.HttpRequest.clone(q);if(!K.token)throw Error("request could not be signed with `token` since the `token` is not defined");return z.headers.Authorization=`Bearer ${K.token}`,z}}class Zr7{async sign(q,K,_){return q}}var Gr7=(q)=>function(_){return Tr7(_)&&_.expiration.getTime()-Date.now()<q},vr7=300000,E53=Gr7(vr7),Tr7=(q)=>q.expiration!==void 0,L53=(q,K,_)=>{if(q===void 0)return;let z=typeof q!=="function"?async()=>Promise.resolve(q):q,Y,$,O,A=!1,w=async(j)=>{if(!$)$=z(j);try{Y=await $,O=!0,A=!1}finally{$=void 0}return Y};if(K===void 0)return async(j)=>{if(!O||j?.forceRefresh)Y=await w(j);return Y};return async(j)=>{if(!O||j?.forceRefresh)Y=await w(j);if(A)return Y;if(!_(Y))return A=!0,Y;if(K(Y))return await w(j),Y;return Y}};Object.defineProperty(kr7,"requestBuilder",{enumerable:!0,get:function(){return M53.requestBuilder}});kr7.DefaultIdentityProviderConfig=Wr7;kr7.EXPIRATION_MS=vr7;kr7.HttpApiKeyAuthSigner=Dr7;kr7.HttpBearerAuthSigner=fr7;kr7.NoAuthSigner=Zr7;kr7.createIsIdentityExpiredFunction=Gr7;kr7.createPaginator=V53;kr7.doesIdentityRequireRefresh=Tr7;kr7.getHttpAuthSchemeEndpointRuleSetPlugin=D53;kr7.getHttpAuthSchemePlugin=f53;kr7.getHttpSigningPlugin=v53;kr7.getSmithyContext=X53;kr7.httpAuthSchemeEndpointRuleSetMiddlewareOptions=Jr7;kr7.httpAuthSchemeMiddleware=L$1;kr7.httpAuthSchemeMiddlewareOptions=Mr7;kr7.httpSigningMiddleware=Xr7;kr7.httpSigningMiddlewareOptions=Pr7;kr7.isIdentityExpired=E53;kr7.memoizeIdentityProvider=L53;kr7.normalizeProvider=T53;kr7.setFeature=y53});var Nr7=B((s53)=>{var Vr7={},h$1={};for(let q=0;q<256;q++){let K=q.toString(16).toLowerCase();if(K.length===1)K=`0${K}`;Vr7[q]=K,h$1[K]=q}function o53(q){if(q.length%2!==0)throw Error("Hex encoded strings must have an even number length");
|
||
|
||
return this.capacity-=O,qt7({retryDelay:$,retryCount:q.getRetryCount()+1,retryCost:O})}throw Error("No retry token available")}recordSuccess(q){this.capacity=Math.max(TA1,this.capacity+(q.getRetryCost()??Yt7))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(q){return console.warn(`Max attempts provider could not resolve. Using default of ${vA1}`),vA1}}shouldRetry(q,K,_){return q.getRetryCount()+1<_&&this.capacity>=this.getCapacityCost(K.errorType)&&this.isRetryableError(K.errorType)}getCapacityCost(q){return q==="TRANSIENT"?zt7:_t7}isRetryableError(q){return q==="THROTTLING"||q==="TRANSIENT"}}class $t7{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=S23.RETRY_MODES.ADAPTIVE;constructor(q,K){this.maxAttemptsProvider=q;let{rateLimiter:_}=K??{};this.rateLimiter=_??new PH8,this.standardRetryStrategy=new WH8(q)}async acquireInitialRetryToken(q){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(q)}async refreshRetryTokenForRetry(q,K){return this.rateLimiter.updateClientSendingRate(K),this.standardRetryStrategy.refreshRetryTokenForRetry(q,K)}recordSuccess(q){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(q)}}class Ot7 extends WH8{computeNextBackoffDelay;constructor(q,K=mF6){super(typeof q==="function"?q:async()=>q);if(typeof K==="number")this.computeNextBackoffDelay=()=>K;else this.computeNextBackoffDelay=K}async refreshRetryTokenForRetry(q,K){let _=await super.refreshRetryTokenForRetry(q,K);return _.getRetryDelay=()=>this.computeNextBackoffDelay(_.getRetryCount()),_}}S23.AdaptiveRetryStrategy=$t7;S23.ConfiguredRetryStrategy=Ot7;S23.DEFAULT_MAX_ATTEMPTS=vA1;S23.DEFAULT_RETRY_DELAY_BASE=mF6;S23.DEFAULT_RETRY_MODE=E23;S23.DefaultRateLimiter=PH8;S23.INITIAL_RETRY_TOKENS=TA1;S23.INVOCATION_ID_HEADER=L23;S23.MAXIMUM_RETRY_DELAY=kA1;S23.NO_RETRY_INCREMENT=Yt7;S23.REQUEST_HEADER=h23;S23.RETRY_COST=_t7;S23.StandardRetryStrategy=WH8;S23.THROTTLING_RETRY_DELAY_BASE=Kt7;
|
||
|
||
return fV3.setCredentialFeature(Y,"CREDENTIALS_PROCESS","w"),Y},GV3=async(q,K,_)=>{let z=K[q];if(K[q]){let Y=z.credential_process;if(Y!==void 0){let $=DV3.promisify(p21.externalDataInterceptor?.getTokenRecord?.().exec??WV3.exec);try{let{stdout:O}=await $(Y),A;try{A=JSON.parse(O.trim())}catch{throw Error(`Profile ${q} credential_process returned invalid JSON.`)}return ZV3(q,A,K)}catch(O){throw new m21.CredentialsProviderError(O.message,{logger:_})}}else throw new m21.CredentialsProviderError(`Profile ${q} did not contain credential_process.`,{logger:_})}else throw new m21.CredentialsProviderError(`Profile ${q} could not be found in shared credentials file.`,{logger:_})},vV3=(q={})=>async({callerClientConfig:K}={})=>{q.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let _=await p21.parseKnownFiles(q);return GV3(p21.getProfileName({profile:q.profile??K?.profile}),_,q.logger)};TV3.fromProcess=vV3});var B21=B((mg)=>{var VV3=mg&&mg.__createBinding||(Object.create?function(q,K,_,z){if(z===void 0)z=_;var Y=Object.getOwnPropertyDescriptor(K,_);if(!Y||("get"in Y?!K.__esModule:Y.writable||Y.configurable))Y={enumerable:!0,get:function(){return K[_]}};Object.defineProperty(q,z,Y)}:function(q,K,_,z){if(z===void 0)z=_;q[z]=K[_]}),NV3=mg&&mg.__setModuleDefault||(Object.create?function(q,K){Object.defineProperty(q,"default",{enumerable:!0,value:K})}:function(q,K){q.default=K}),yV3=mg&&mg.__importStar||function(){var q=function(K){return q=Object.getOwnPropertyNames||function(_){var z=[];for(var Y in _)if(Object.prototype.hasOwnProperty.call(_,Y))z[z.length]=Y;return z},q(K)};return function(K){if(K&&K.__esModule)return K;var _={};if(K!=null){for(var z=q(K),Y=0;Y<z.length;Y++)if(z[Y]!=="default")VV3(_,K,z[Y])}return NV3(_,K),_}}();Object.defineProperty(mg,"__esModule",{value:!0});mg.fromWebToken=void 0;var EV3=(q)=>async(K)=>{q.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
|
||
|
||
Object.keys(k4q).forEach(function(q){if(q!=="default"&&!Object.prototype.hasOwnProperty.call(CZ6,q))Object.defineProperty(CZ6,q,{enumerable:!0,get:function(){return k4q[q]}})})});var Oj1=B((I4q)=>{Object.defineProperty(I4q,"__esModule",{value:!0});I4q.resolveHttpAuthSchemeConfig=I4q.defaultBedrockHttpAuthSchemeProvider=I4q.defaultBedrockHttpAuthSchemeParametersProvider=void 0;var Hy3=aw(),Yj1=RO(),$j1=ZG(),Jy3=async(q,K,_)=>{return{operation:(0,$j1.getSmithyContext)(K).operation,region:await(0,$j1.normalizeProvider)(q.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};I4q.defaultBedrockHttpAuthSchemeParametersProvider=Jy3;function My3(q){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:q.region},propertiesExtractor:(K,_)=>({signingProperties:{config:K,context:_}})}}function Xy3(q){return{schemeId:"smithy.api#httpBearerAuth",propertiesExtractor:({profile:K,filepath:_,configFilepath:z,ignoreCache:Y},$)=>({identityProperties:{profile:K,filepath:_,configFilepath:z,ignoreCache:Y}})}}var Py3=(q)=>{let K=[];switch(q.operation){default:K.push(My3(q)),K.push(Xy3(q))}return K};I4q.defaultBedrockHttpAuthSchemeProvider=Py3;var Wy3=(q)=>{let K=(0,Yj1.memoizeIdentityProvider)(q.token,Yj1.isIdentityExpired,Yj1.doesIdentityRequireRefresh),_=(0,Hy3.resolveAwsSdkSigV4Config)(q);return Object.assign(_,{authSchemePreference:(0,$j1.normalizeProvider)(q.authSchemePreference??[]),token:K})};I4q.resolveHttpAuthSchemeConfig=Wy3});
|
||
|
||
var zKq="required",Bg="fn",gg="argv",xZ6="ref",i4q=!0,r4q="isSet",jU6="booleanEquals",bZ6="error",wU6="endpoint",kT="tree",jj1="PartitionResult",o4q={[zKq]:!1,type:"string"},a4q={[zKq]:!0,default:!1,type:"boolean"},s4q={[xZ6]:"Endpoint"},YKq={[Bg]:jU6,[gg]:[{[xZ6]:"UseFIPS"},!0]},$Kq={[Bg]:jU6,[gg]:[{[xZ6]:"UseDualStack"},!0]},pg={},t4q={[Bg]:"getAttr",[gg]:[{[xZ6]:jj1},"supportsFIPS"]},e4q={[Bg]:jU6,[gg]:[!0,{[Bg]:"getAttr",[gg]:[{[xZ6]:jj1},"supportsDualStack"]}]},qKq=[YKq],KKq=[$Kq],_Kq=[{[xZ6]:"Region"}],Iy3={version:"1.0",parameters:{Region:o4q,UseDualStack:a4q,UseFIPS:a4q,Endpoint:o4q},rules:[{conditions:[{[Bg]:r4q,[gg]:[s4q]}],rules:[{conditions:qKq,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:bZ6},{rules:[{conditions:KKq,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:bZ6},{endpoint:{url:s4q,properties:pg,headers:pg},type:wU6}],type:kT}],type:kT},{rules:[{conditions:[{[Bg]:r4q,[gg]:_Kq}],rules:[{conditions:[{[Bg]:"aws.partition",[gg]:_Kq,assign:jj1}],rules:[{conditions:[YKq,$Kq],rules:[{conditions:[{[Bg]:jU6,[gg]:[i4q,t4q]},e4q],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:pg,headers:pg},type:wU6}],type:kT}],type:kT},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:bZ6}],type:kT},{conditions:qKq,rules:[{conditions:[{[Bg]:jU6,[gg]:[t4q,i4q]}],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}",properties:pg,headers:pg},type:wU6}],type:kT}],type:kT},{error:"FIPS is enabled but this partition does not support FIPS",type:bZ6}],type:kT},{conditions:KKq,rules:[{conditions:[e4q],rules:[{rules:[{endpoint:{url:"https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:pg,headers:pg},type:wU6}],type:kT}],type:kT},{error:"DualStack is enabled but this partition does not support DualStack",type:bZ6}],type:kT},{rules:[{endpoint:{url:"https://bedrock.{Region}.{PartitionResult#dnsSuffix}",properties:pg,headers:pg},type:wU6}],type:kT}],type:kT}],type:kT},{error:"Invalid Configuration: Missing Region",type:bZ6}],type:kT}]};
|
||
|
||
OKq.ruleSet=Iy3});var JKq=B((jKq)=>{Object.defineProperty(jKq,"__esModule",{value:!0});jKq.defaultEndpointResolver=void 0;var uy3=Sg(),Hj1=cI(),my3=wKq(),py3=new Hj1.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),By3=(q,K={})=>{return py3.get(q,()=>(0,Hj1.resolveEndpoint)(my3.ruleSet,{endpointParams:q,logger:K.logger}))};jKq.defaultEndpointResolver=By3;Hj1.customEndpointFunctions.aws=uy3.awsEndpointFunctions});var DKq=B((PKq)=>{Object.defineProperty(PKq,"__esModule",{value:!0});PKq.getRuntimeConfig=void 0;var gy3=aw(),Fy3=Un(),Uy3=RO(),Qy3=OU6(),dy3=qS(),MKq=n4q(),XKq=jA(),cy3=Oj1(),ly3=JKq(),ny3=(q)=>{return{apiVersion:"2023-04-20",base64Decoder:q?.base64Decoder??MKq.fromBase64,base64Encoder:q?.base64Encoder??MKq.toBase64,disableHostPrefix:q?.disableHostPrefix??!1,endpointProvider:q?.endpointProvider??ly3.defaultEndpointResolver,extensions:q?.extensions??[],httpAuthSchemeProvider:q?.httpAuthSchemeProvider??cy3.defaultBedrockHttpAuthSchemeProvider,httpAuthSchemes:q?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(K)=>K.getIdentityProvider("aws.auth#sigv4"),signer:new gy3.AwsSdkSigV4Signer},{schemeId:"smithy.api#httpBearerAuth",identityProvider:(K)=>K.getIdentityProvider("smithy.api#httpBearerAuth"),signer:new Uy3.HttpBearerAuthSigner}],logger:q?.logger??new Qy3.NoOpLogger,protocol:q?.protocol??new Fy3.AwsRestJsonProtocol({defaultNamespace:"com.amazonaws.bedrock"}),serviceId:q?.serviceId??"Bedrock",urlParser:q?.urlParser??dy3.parseUrl,utf8Decoder:q?.utf8Decoder??XKq.fromUtf8,utf8Encoder:q?.utf8Encoder??XKq.toUtf8}};PKq.getRuntimeConfig=ny3});var VKq=B((TKq)=>{Object.defineProperty(TKq,"__esModule",{value:!0});TKq.getRuntimeConfig=void 0;var iy3=fT(),ry3=iy3.__importDefault(m4q()),Jj1=aw(),oy3=_Y6(),fKq=yH8(),ZKq=pn(),wJ8=YM(),ay3=RO(),sy3=Bn(),GKq=af(),YY6=pV(),vKq=uV(),ty3=gn(),ey3=xg(),qE3=DKq(),KE3=OU6(),_E3=dn(),zE3=OU6(),YE3=(q)=>{(0,zE3.emitWarningIfUnsupportedVersion)(process.version);
|
||
|
||
constructor(q){this.statusCode=q.statusCode,this.reason=q.reason,this.headers=q.headers||{},this.body=q.body}static isInstance(q){if(!q)return!1;let K=q;return typeof K.statusCode==="number"&&typeof K.headers==="object"}}function jE3(q){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(q)}HE3.Field=NKq;HE3.Fields=yKq;HE3.HttpRequest=jJ8;HE3.HttpResponse=EKq;HE3.getHttpHandlerExtensionConfiguration=OE3;HE3.isValidHostname=jE3;HE3.resolveHttpHandlerRuntimeConfig=AE3});var zM8=B((QJ1)=>{var hKq=hn(),ZE3=Rn(),GE3=Sn(),RKq=bg(),vE3=YM(),GX=RO(),MS=Zj(),TE3=mn(),Oq=lI(),SKq=af(),o7=OU6(),CKq=Oj1(),kE3=VKq(),bKq=nI(),xKq=LKq(),VE3=(q)=>{return Object.assign(q,{useDualstackEndpoint:q.useDualstackEndpoint??!1,useFipsEndpoint:q.useFipsEndpoint??!1,defaultSigningName:"bedrock"})},Jq={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},NE3=(q)=>{let{httpAuthSchemes:K,httpAuthSchemeProvider:_,credentials:z,token:Y}=q;return{setHttpAuthScheme($){let O=K.findIndex((A)=>A.schemeId===$.schemeId);if(O===-1)K.push($);else K.splice(O,1,$)},httpAuthSchemes(){return K},setHttpAuthSchemeProvider($){_=$},httpAuthSchemeProvider(){return _},setCredentials($){z=$},credentials(){return z},setToken($){Y=$},token(){return Y}}},yE3=(q)=>{return{httpAuthSchemes:q.httpAuthSchemes(),httpAuthSchemeProvider:q.httpAuthSchemeProvider(),credentials:q.credentials(),token:q.token()}},EE3=(q,K)=>{let _=Object.assign(bKq.getAwsRegionExtensionConfiguration(q),o7.getDefaultExtensionConfiguration(q),xKq.getHttpHandlerExtensionConfiguration(q),NE3(q));return K.forEach((z)=>z.configure(_)),Object.assign(q,bKq.resolveAwsRegionExtensionConfiguration(_),o7.resolveDefaultRuntimeConfig(_),xKq.resolveHttpHandlerRuntimeConfig(_),yE3(_))};class TX extends o7.Client{config;constructor(...[q]){let K=kE3.getRuntimeConfig(q||{});super(K);this.initConfig=K;
|
||
|
||
var la3=[1,y6,SE3,0,[()=>zt3,0]],na3=[1,y6,xE3,0,[()=>PJ8,0]],ia3=[1,y6,uE3,0,[()=>Yt3,0]],sKq=[1,y6,gE3,0,[()=>Dc3,0]],JH1=[1,y6,dE3,0,()=>Gc3],ra3=[1,y6,oE3,0,[()=>TU6,0]],oa3=[1,y6,sE3,0,[()=>Vc3,0]],JU6=[1,y6,KL3,0,[()=>yc3,0]],MH1=[1,y6,OL3,0,[()=>U9q,0]],aa3=[1,y6,TL3,0,[()=>uc3,0]],sa3=[1,y6,yL3,0,[()=>mc3,0]],ta3=[1,y6,LL3,0,()=>pc3],ea3=[1,y6,RL3,0,[()=>Bc3,0]],qs3=[1,y6,xL3,0,()=>Uc3],Ks3=[1,y6,UL3,0,[()=>IJ8,0]],_s3=[1,y6,rL3,0,[()=>uJ8,0]],zs3=[1,y6,sL3,0,[()=>Fg,0]],u9q=[1,y6,qh3,0,[()=>dc3,0]],Ys3=[1,y6,_h3,0,[()=>cc3,0]],$s3=[1,y6,Ah3,0,[()=>mJ8,0]],m9q=[1,y6,Hh3,0,[()=>$Y6,0]],Os3=[1,y6,cL3,0,[()=>tc3,0]],As3=[1,y6,Xh3,0,[()=>ec3,0]],ws3=[1,y6,Vh3,0,[()=>Yl3,0]],js3=[1,y6,yh3,0,[()=>OH1,0]],Hs3=[1,y6,Lh3,0,[()=>D9q,0]],Js3=[1,y6,Ch3,0,[()=>jt3,0]],Ms3=[1,y6,nh3,0,[()=>Pl3,0]],Xs3=[1,y6,rh3,0,[()=>Wl3,0]],Ps3=[1,y6,th3,0,()=>Zl3],Ws3=[1,y6,uR3,0,()=>Yn3],Ds3=[1,y6,cR3,0,()=>An3],fs3=[1,y6,_S3,0,()=>wn3],p9q=[1,y6,JC3,0,[()=>dn3,0]],Zs3=[1,y6,fC3,0,[()=>GU6,0]],Gs3=[1,y6,yC3,0,[()=>j9q,0]],vs3=[1,y6,ZC3,0,[()=>Mt3,0]],Ts3=[1,y6,uC3,0,()=>an3],ks3=[1,y6,pC3,0,[()=>en3,0]],tKq=[1,y6,FC3,8,()=>_i3],Vs3=[1,y6,cC3,0,()=>Yi3],Ns3=[1,y6,Vb3,0,[()=>Kr3,0]],ys3=[1,y6,Gb3,0,[()=>_r3,0]],Es3=[1,y6,hb3,0,[()=>Or3,0]],Ls3=[1,y6,Lb3,0,[()=>Ar3,0]],hs3=[1,y6,eb3,0,[()=>zc3,0]],Rs3=[1,y6,Sx3,0,[()=>jr3,0]],Ss3=[1,y6,Cx3,0,[()=>Hr3,0]],WJ8=[1,y6,bx3,0,[()=>Yc3,0]],Cs3=[1,y6,px3,0,()=>Jr3],bs3=[1,y6,mx3,0,()=>Mr3],xs3=[1,y6,ix3,0,()=>Xr3],Is3=[1,y6,nx3,0,()=>Pr3],us3=[1,y6,tx3,0,[()=>$c3,0]],ms3=[1,y6,ex3,0,[()=>Dr3,0]],B9q=[1,y6,OI3,0,[()=>Oc3,0]],ps3=[1,y6,XI3,0,[()=>fr3,0]],Bs3=[1,y6,zI3,0,[()=>Zr3,0]],gs3=[1,y6,VI3,0,[()=>kr3,0]],Fs3=[1,y6,vI3,0,[()=>Vr3,0]],Us3=[1,y6,EI3,0,[()=>Er3,0]],Qs3=[1,y6,II3,0,()=>Rr3],g9q=[1,y6,BI3,0,()=>Sr3],ds3=[1,y6,FI3,0,[()=>Cr3,0]],cs3=[1,y6,vm3,0,()=>Vo3],ls3=[1,y6,zm3,0,[()=>No3,0]],ns3=[1,y6,Am3,0,()=>Eo3],is3=[1,y6,wm3,0,()=>Lo3],rs3=[1,y6,Dm3,0,()=>ho3],os3=[1,y6,fm3,0,[()=>Co3,0]],as3=[1,y6,ym3,0,()=>bo3],ss3=[1,y6,Im3,0,[()=>mo3,0]],XH1=[1,y6,mm3,0,()=>BJ8],ts3=[1,y6,Cm3,0,()=>po3],es3=[1,y6,nm3,0,[()=>Zt3,0]],qt3=[1,y6,im3,0,()=>gn3],Kt3=[1,y6,Ap3,0,()=>do3],eKq=[1,y6,qp3,0,[()=>no3,0]],q5q=[1,y6,am3,0,[()=>c9q,0]],vX=[1,y6,gp3,0,()=>Xa3],F9q=[1,y6,vB3,0,()=>ga3],_t3=[1,y6,yB3,0,()=>Ba3],DJ8=[2,y6,Kp3,8,0,0],zt3=[3,y6,bE3,0,[Kg3],[[()=>$n3,0]]],Yt3=[3,y6,IE3,0,[Fd3,LF3,gQ3,yF3,dQ3,rQ3,GU3],[[()=>Nc3,0],[()=>fc3,0],[()=>vc3,0],[()=>Wc3,0],[()=>kc3,0],()=>Tc3,()=>Zc3]],U9q=[3,y6,zL3,0,[D5q,s3q,g5q,f5q,t3q,F5q,X5q,a3q,B5q,SB3,kd3,Vd3,jF3],[[()=>Rc3,0],[()=>jl3,0],[()=>ic3,0],[()=>bc3,0],[()=>Ml3,0],[()=>ac3,0],[()=>Ec3,0],[()=>Al3,0],()=>lc3,[()=>Lc3,0],[()=>$l3,0],[()=>Ol3,0],[()=>Kl3,0]]],$t3=[3,y6,kL3,0,[fU6,rU3,UB3,t5q],[[()=>kU6,0],[()=>Qc3,0],[()=>Ic3,0],[()=>ql3,0]]],Ot3=[3,y6,NL3,0,[nU3,WU3],[()=>_l3,[()=>wt3,0]]],At3=[3,y6,uL3,0,[IU3,xU3,bU3],[[()=>mJ8,0],[()=>uJ8,0],[()=>IJ8,0]]],wt3=[3,y6,Dh3,0,[D5q,s3q,g5q,f5q,t3q,F5q,X5q,a3q,B5q],[[()=>Sc3,0],[()=>Hl3,0],[()=>rc3,0],[()=>xc3,0],[()=>Xl3,0],[()=>sc3,0],[()=>hc3,0],[()=>wl3,0],()=>nc3]],jt3=[3,y6,Sh3,0,[mB3,hd3,Ng3],[[()=>Cc3,0],[()=>Jl3,0],()=>oc3]],Ht3=[3,y6,Uh3,0,[Rg3,UU3],[[()=>ea3,0],[()=>gc3,0]]],PH1=[3,y6,JR3,0,[fg3],[()=>Fn3]],WH1=[3,y6,OC3,0,[RQ3],[()=>eo3]],Q9q=[3,y6,AC3,0,[BB3,$F3],[[()=>Xc3,0],[()=>yr3,0]]],Jt3=[3,y6,jC3,0,[an],[0]],d9q=[3,y6,XC3,0,[gZ6,_Q3],[[()=>vs3,0],[()=>es3,0]]],Mt3=[3,y6,vC3,0,[QB3,BU3],[[()=>Un3,0],()=>nn3]],Xt3=[3,y6,SC3,0,[PQ3,sU3],[()=>rn3,()=>in3]],Pt3=[3,y6,TC3,0,[Z5q],[()=>Ps3]],Wt3=[3,y6,pI3,0,[aB3],[0]],Dt3=[3,y6,bI3,0,[an],[0]],ft3=[3,y6,QI3,0,[OQ3,aU3],[[()=>ao3,0],[()=>oo3,0]]],gJ8=[3,y6,jm3,0,[GQ3],[()=>so3]],DH1=[3,y6,Hm3,0,[NQ3],[()=>Ro3]],fH1=[3,y6,Jm3,0,[CQ3],[()=>So3]],Zt3=[3,y6,cm3,0,[bF3,dU3],[[()=>ft3,0],()=>Xt3]],Gt3=[3,y6,jp3,0,[pQ3,sg3],[0,1]],vt3=[3,y6,em3,0,[Vj1,Bj1,J5q,G3q],[[()=>DJ8,0],[()=>DJ8,0],[()=>eKq,0],[()=>eKq,0]]],Tt3=[3,y6,$p3,0,[ag3,og3],[[()=>tKq,0],[()=>tKq,0]]],c9q=[3,y6,om3,8,[Vj1,Bj1,zF3,YF3,QF3,UF3,EF3,DU3,BQ3,pF3,ZQ3,J5q,G3q],[()=>qu,()=>qu,()=>qu,()=>qu,()=>qu,()=>qu,()=>qu,()=>qu,()=>qu,()=>qu,()=>qu,[()=>q5q,0],[()=>q5q,0]]],kt3=[9,y6,ch3,{[Mq]:["POST","/evaluation-jobs/batch-delete",202]},()=>Dl3,()=>fl3],Vt3=[9,y6,qR3,{[Mq]:["POST","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/cancel",202]},()=>vl3,()=>Tl3],Nt3=[9,y6,eh3,{[Mq]:["POST","/automated-reasoning-policies",200]},()=>Nl3,()=>yl3],yt3=[9,y6,$R3,{[Mq]:["POST","/automated-reasoning-policies/{policyArn}/test-cases",200]},()=>El3,()=>Ll3],Et3=[9,y6,wR3,{[Mq]:["POST","/automated-reasoning-policies/{policyArn}/versions",200]},()=>hl3,()=>Rl3],Lt3=[9,y6,MR3,{[Mq]:["POST","/custom-models/create-custom-model",202]},()=>bl3,()=>xl3],ht3=[9,y6,XR3,{[Mq]:["POST","/model-customization/custom-model-deployments",202]},()=>Sl3,()=>Cl3],Rt3=[9,y6,GR3,{[Mq]:["POST","/evaluation-jobs",202]},()=>Il3,()=>ul3],St3=[9,y6,kR3,{[Mq]:["POST","/create-foundation-model-agreement",202]},()=>ml3,()=>pl3],Ct3=[9,y6,yR3,{[Mq]:["POST","/guardrails",202]},()=>Bl3,()=>gl3],bt3=[9,y6,hR3,{[Mq]:["POST","/guardrails/{guardrailIdentifier}",202]},()=>Fl3,()=>Ul3],xt3=[9,y6,CR3,{[Mq]:["POST","/inference-profiles",201]},()=>Ql3,()=>dl3],It3=[9,y6,tR3,{[Mq]:["POST","/marketplace-model/endpoints",200]},()=>cl3,()=>ll3],ut3=[9,y6,mR3,{[Mq]:["POST","/model-copy-jobs",201]},()=>nl3,()=>il3],mt3=[9,y6,UR3,{[Mq]:["POST","/model-customization-jobs",201]},()=>rl3,()=>ol3],pt3=[9,y6,nR3,{[Mq]:["POST","/model-import-jobs",201]},()=>al3,()=>sl3],Bt3=[9,y6,sR3,{[Mq]:["POST","/model-invocation-job",200]},()=>tl3,()=>el3],gt3=[9,y6,AS3,{[Mq]:["POST","/prompt-routers",200]},()=>qn3,()=>Kn3],Ft3=[9,y6,YS3,{[Mq]:["POST","/provisioned-model-throughput",201]},()=>_n3,()=>zn3],Ut3=[9,y6,JS3,{[Mq]:["DELETE","/automated-reasoning-policies/{policyArn}",202]},()=>Xn3,()=>Pn3],Qt3=[9,y6,MS3,{[Mq]:["DELETE","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}",202]},()=>Jn3,()=>Mn3],dt3=[9,y6,fS3,{[Mq]:["DELETE","/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}",202]},()=>Wn3,()=>Dn3],ct3=[9,y6,TS3,{[Mq]:["DELETE","/custom-models/{modelIdentifier}",200]},()=>Gn3,()=>vn3],lt3=[9,y6,kS3,{[Mq]:["DELETE","/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}",200]},()=>fn3,()=>Zn3],nt3=[9,y6,LS3,{[Mq]:["POST","/delete-foundation-model-agreement",202]},()=>Tn3,()=>kn3],it3=[9,y6,SS3,{[Mq]:["DELETE","/guardrails/{guardrailIdentifier}",202]},()=>Vn3,()=>Nn3],rt3=[9,y6,xS3,{[Mq]:["DELETE","/imported-models/{modelIdentifier}",200]},()=>yn3,()=>En3],ot3=[9,y6,mS3,{[Mq]:["DELETE","/inference-profiles/{inferenceProfileIdentifier}",200]},()=>Ln3,()=>hn3],at3=[9,y6,QS3,{[Mq]:["DELETE","/marketplace-model/endpoints/{endpointArn}",200]},()=>Rn3,()=>Sn3],st3=[9,y6,gS3,{[Mq]:["DELETE","/logging/modelinvocations",200]},()=>Cn3,()=>bn3],tt3=[9,y6,KC3,{[Mq]:["DELETE","/prompt-routers/{promptRouterArn}",200]},()=>xn3,()=>In3],et3=[9,y6,oS3,{[Mq]:["DELETE","/provisioned-model-throughput/{provisionedModelId}",200]},()=>un3,()=>mn3],qe3=[9,y6,iS3,{[Mq]:["DELETE","/marketplace-model/endpoints/{endpointArn}/registration",200]},()=>pn3,()=>Bn3],Ke3=[9,y6,_C3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/export",200]},()=>sn3,()=>tn3],_e3=[9,y6,Xb3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}",200]},()=>Pi3,()=>Wi3],ze3=[9,y6,nC3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations",200]},()=>Oi3,()=>Ai3],Ye3=[9,y6,oC3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}",200]},()=>wi3,()=>ji3],$e3=[9,y6,sC3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/result-assets",200]},()=>Hi3,()=>Ji3],Oe3=[9,y6,_b3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/scenarios",200]},()=>Mi3,()=>Xi3],Ae3=[9,y6,Ab3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}",200]},()=>Di3,()=>fi3],we3=[9,y6,Hb3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-cases/{testCaseId}/test-results",200]},()=>Zi3,()=>Gi3],je3=[9,y6,Cb3,{[Mq]:["GET","/custom-models/{modelIdentifier}",200]},()=>ki3,()=>Vi3],He3=[9,y6,bb3,{[Mq]:["GET","/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}",200]},()=>vi3,()=>Ti3],Je3=[9,y6,db3,{[Mq]:["GET","/evaluation-jobs/{jobIdentifier}",200]},()=>Ni3,()=>yi3],Me3=[9,y6,nb3,{[Mq]:["GET","/foundation-models/{modelIdentifier}",200]},()=>hi3,()=>Ri3],Xe3=[9,y6,ib3,{[Mq]:["GET","/foundation-model-availability/{modelId}",200]},()=>Ei3,()=>Li3],Pe3=[9,y6,qx3,{[Mq]:["GET","/guardrails/{guardrailIdentifier}",200]},()=>Si3,()=>Ci3],We3=[9,y6,zx3,{[Mq]:["GET","/imported-models/{modelIdentifier}",200]},()=>bi3,()=>xi3],De3=[9,y6,Ox3,{[Mq]:["GET","/inference-profiles/{inferenceProfileIdentifier}",200]},()=>Ii3,()=>ui3],fe3=[9,y6,yx3,{[Mq]:["GET","/marketplace-model/endpoints/{endpointArn}",200]},()=>mi3,()=>pi3],Ze3=[9,y6,Hx3,{[Mq]:["GET","/model-copy-jobs/{jobArn}",200]},()=>Bi3,()=>gi3],Ge3=[9,y6,Wx3,{[Mq]:["GET","/model-customization-jobs/{jobIdentifier}",200]},()=>Fi3,()=>Ui3],ve3=[9,y6,Dx3,{[Mq]:["GET","/model-import-jobs/{jobIdentifier}",200]},()=>Qi3,()=>di3],Te3=[9,y6,Tx3,{[Mq]:["GET","/model-invocation-job/{jobIdentifier}",200]},()=>ci3,()=>li3],ke3=[9,y6,kx3,{[Mq]:["GET","/logging/modelinvocations",200]},()=>ni3,()=>ii3],Ve3=[9,y6,Ux3,{[Mq]:["GET","/prompt-routers/{promptRouterArn}",200]},()=>ri3,()=>oi3],Ne3=[9,y6,Bx3,{[Mq]:["GET","/provisioned-model-throughput/{provisionedModelId}",200]},()=>ai3,()=>si3],ye3=[9,y6,PI3,{[Mq]:["GET","/use-case-for-model-access",200]},()=>ti3,()=>ei3],Ee3=[9,y6,iI3,{[Mq]:["GET","/automated-reasoning-policies",200]},()=>pr3,()=>Br3],Le3=[9,y6,rI3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/build-workflows",200]},()=>gr3,()=>Fr3],he3=[9,y6,eI3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/test-cases",200]},()=>Ur3,()=>Qr3],Re3=[9,y6,_u3,{[Mq]:["GET","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-results",200]},()=>dr3,()=>cr3],Se3=[9,y6,Au3,{[Mq]:["GET","/model-customization/custom-model-deployments",200]},()=>lr3,()=>nr3],Ce3=[9,y6,Ou3,{[Mq]:["GET","/custom-models",200]},()=>ir3,()=>rr3],be3=[9,y6,Mu3,{[Mq]:["GET","/evaluation-jobs",200]},()=>or3,()=>ar3],xe3=[9,y6,Du3,{[Mq]:["GET","/list-foundation-model-agreement-offers/{modelId}",200]},()=>sr3,()=>tr3],Ie3=[9,y6,Wu3,{[Mq]:["GET","/foundation-models",200]},()=>er3,()=>qo3],ue3=[9,y6,Tu3,{[Mq]:["GET","/guardrails",200]},()=>Ko3,()=>_o3],me3=[9,y6,Nu3,{[Mq]:["GET","/imported-models",200]},()=>zo3,()=>Yo3],pe3=[9,y6,Lu3,{[Mq]:["GET","/inference-profiles",200]},()=>$o3,()=>Oo3],Be3=[9,y6,Qu3,{[Mq]:["GET","/marketplace-model/endpoints",200]},()=>Ao3,()=>wo3],ge3=[9,y6,Su3,{[Mq]:["GET","/model-copy-jobs",200]},()=>jo3,()=>Ho3],Fe3=[9,y6,uu3,{[Mq]:["GET","/model-customization-jobs",200]},()=>Jo3,()=>Mo3],Ue3=[9,y6,mu3,{[Mq]:["GET","/model-import-jobs",200]},()=>Xo3,()=>Po3],Qe3=[9,y6,Uu3,{[Mq]:["GET","/model-invocation-jobs",200]},()=>Wo3,()=>Do3],de3=[9,y6,ru3,{[Mq]:["GET","/prompt-routers",200]},()=>fo3,()=>Zo3],ce3=[9,y6,lu3,{[Mq]:["GET","/provisioned-model-throughputs",200]},()=>Go3,()=>vo3],le3=[9,y6,tu3,{[Mq]:["POST","/listTagsForResource",200]},()=>To3,()=>ko3],ne3=[9,y6,Lm3,{[Mq]:["PUT","/logging/modelinvocations",200]},()=>Bo3,()=>go3],ie3=[9,y6,gm3,{[Mq]:["POST","/use-case-for-model-access",201]},()=>Fo3,()=>Uo3],re3=[9,y6,_p3,{[Mq]:["POST","/marketplace-model/endpoints/{endpointIdentifier}/registration",200]},()=>co3,()=>lo3],oe3=[9,y6,Hp3,{[Mq]:["POST","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowType}/start",200]},()=>_a3,()=>za3],ae3=[9,y6,Xp3,{[Mq]:["POST","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-workflows",200]},()=>Ya3,()=>$a3],se3=[9,y6,Gp3,{[Mq]:["POST","/evaluation-job/{jobIdentifier}/stop",200]},()=>Oa3,()=>Aa3],te3=[9,y6,kp3,{[Mq]:["POST","/model-customization-jobs/{jobIdentifier}/stop",200]},()=>wa3,()=>ja3],ee3=[9,y6,Ep3,{[Mq]:["POST","/model-invocation-job/{jobIdentifier}/stop",200]},()=>Ha3,()=>Ja3],q69=[9,y6,cp3,{[Mq]:["POST","/tagResource",200]},()=>Pa3,()=>Wa3],K69=[9,y6,JB3,{[Mq]:["POST","/untagResource",200]},()=>ka3,()=>Va3],_69=[9,y6,ip3,{[Mq]:["PATCH","/automated-reasoning-policies/{policyArn}",200]},()=>Ea3,()=>La3],z69=[9,y6,rp3,{[Mq]:["PATCH","/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations",200]},()=>Na3,()=>ya3],Y69=[9,y6,ep3,{[Mq]:["PATCH","/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}",200]},()=>ha3,()=>Ra3],$69=[9,y6,_B3,{[Mq]:["PUT","/guardrails/{guardrailIdentifier}",202]},()=>Sa3,()=>Ca3],O69=[9,y6,$B3,{[Mq]:["PATCH","/marketplace-model/endpoints/{endpointArn}",200]},()=>ba3,()=>xa3],A69=[9,y6,wB3,{[Mq]:["PATCH","/provisioned-model-throughput/{provisionedModelId}",200]},()=>Ia3,()=>ua3];
|
||
|
||
Object.keys(Azq).forEach(function(q){if(q!=="default"&&!Object.prototype.hasOwnProperty.call(cZ6,q))Object.defineProperty(cZ6,q,{enumerable:!0,get:function(){return Azq[q]}})})});var RM1=B((Gzq)=>{Object.defineProperty(Gzq,"__esModule",{value:!0});Gzq.resolveHttpAuthSchemeConfig=Gzq.defaultBedrockRuntimeHttpAuthSchemeProvider=Gzq.defaultBedrockRuntimeHttpAuthSchemeParametersProvider=void 0;var k99=aw(),LM1=RO(),hM1=ZG(),V99=async(q,K,_)=>{return{operation:(0,hM1.getSmithyContext)(K).operation,region:await(0,hM1.normalizeProvider)(q.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};Gzq.defaultBedrockRuntimeHttpAuthSchemeParametersProvider=V99;function N99(q){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:q.region},propertiesExtractor:(K,_)=>({signingProperties:{config:K,context:_}})}}function y99(q){return{schemeId:"smithy.api#httpBearerAuth",propertiesExtractor:({profile:K,filepath:_,configFilepath:z,ignoreCache:Y},$)=>({identityProperties:{profile:K,filepath:_,configFilepath:z,ignoreCache:Y}})}}var E99=(q)=>{let K=[];switch(q.operation){default:K.push(N99(q)),K.push(y99(q))}return K};Gzq.defaultBedrockRuntimeHttpAuthSchemeProvider=E99;var L99=(q)=>{let K=(0,LM1.memoizeIdentityProvider)(q.token,LM1.isIdentityExpired,LM1.doesIdentityRequireRefresh),_=(0,k99.resolveAwsSdkSigV4Config)(q);return Object.assign(_,{authSchemePreference:(0,hM1.normalizeProvider)(q.authSchemePreference??[]),token:K})};Gzq.resolveHttpAuthSchemeConfig=L99});
|
||
|
||
var izq="required",lg="fn",ng="argv",nZ6="ref",pzq=!0,Bzq="isSet",bU6="booleanEquals",lZ6="error",CU6="endpoint",VT="tree",IM1="PartitionResult",gzq={[izq]:!1,type:"string"},Fzq={[izq]:!0,default:!1,type:"boolean"},Uzq={[nZ6]:"Endpoint"},rzq={[lg]:bU6,[ng]:[{[nZ6]:"UseFIPS"},!0]},ozq={[lg]:bU6,[ng]:[{[nZ6]:"UseDualStack"},!0]},cg={},Qzq={[lg]:"getAttr",[ng]:[{[nZ6]:IM1},"supportsFIPS"]},dzq={[lg]:bU6,[ng]:[!0,{[lg]:"getAttr",[ng]:[{[nZ6]:IM1},"supportsDualStack"]}]},czq=[rzq],lzq=[ozq],nzq=[{[nZ6]:"Region"}],H_9={version:"1.0",parameters:{Region:gzq,UseDualStack:Fzq,UseFIPS:Fzq,Endpoint:gzq},rules:[{conditions:[{[lg]:Bzq,[ng]:[Uzq]}],rules:[{conditions:czq,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:lZ6},{rules:[{conditions:lzq,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:lZ6},{endpoint:{url:Uzq,properties:cg,headers:cg},type:CU6}],type:VT}],type:VT},{rules:[{conditions:[{[lg]:Bzq,[ng]:nzq}],rules:[{conditions:[{[lg]:"aws.partition",[ng]:nzq,assign:IM1}],rules:[{conditions:[rzq,ozq],rules:[{conditions:[{[lg]:bU6,[ng]:[pzq,Qzq]},dzq],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:cg,headers:cg},type:CU6}],type:VT}],type:VT},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:lZ6}],type:VT},{conditions:czq,rules:[{conditions:[{[lg]:bU6,[ng]:[Qzq,pzq]}],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",properties:cg,headers:cg},type:CU6}],type:VT}],type:VT},{error:"FIPS is enabled but this partition does not support FIPS",type:lZ6}],type:VT},{conditions:lzq,rules:[{conditions:[dzq],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:cg,headers:cg},type:CU6}],type:VT}],type:VT},{error:"DualStack is enabled but this partition does not support DualStack",type:lZ6}],type:VT},{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",properties:cg,headers:cg},type:CU6}],type:VT}],type:VT}],type:VT},{error:"Invalid Configuration: Missing Region",type:lZ6}],type:VT}]};
|
||
|
||
azq.ruleSet=H_9});var KYq=B((ezq)=>{Object.defineProperty(ezq,"__esModule",{value:!0});ezq.defaultEndpointResolver=void 0;var J_9=Sg(),uM1=cI(),M_9=tzq(),X_9=new uM1.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),P_9=(q,K={})=>{return X_9.get(q,()=>(0,uM1.resolveEndpoint)(M_9.ruleSet,{endpointParams:q,logger:K.logger}))};ezq.defaultEndpointResolver=P_9;uM1.customEndpointFunctions.aws=J_9.awsEndpointFunctions});var OYq=B((YYq)=>{Object.defineProperty(YYq,"__esModule",{value:!0});YYq.getRuntimeConfig=void 0;var W_9=aw(),D_9=Un(),f_9=RO(),Z_9=hU6(),G_9=qS(),_Yq=mzq(),zYq=jA(),v_9=RM1(),T_9=KYq(),k_9=(q)=>{return{apiVersion:"2023-09-30",base64Decoder:q?.base64Decoder??_Yq.fromBase64,base64Encoder:q?.base64Encoder??_Yq.toBase64,disableHostPrefix:q?.disableHostPrefix??!1,endpointProvider:q?.endpointProvider??T_9.defaultEndpointResolver,extensions:q?.extensions??[],httpAuthSchemeProvider:q?.httpAuthSchemeProvider??v_9.defaultBedrockRuntimeHttpAuthSchemeProvider,httpAuthSchemes:q?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(K)=>K.getIdentityProvider("aws.auth#sigv4"),signer:new W_9.AwsSdkSigV4Signer},{schemeId:"smithy.api#httpBearerAuth",identityProvider:(K)=>K.getIdentityProvider("smithy.api#httpBearerAuth"),signer:new f_9.HttpBearerAuthSigner}],logger:q?.logger??new Z_9.NoOpLogger,protocol:q?.protocol??new D_9.AwsRestJsonProtocol({defaultNamespace:"com.amazonaws.bedrockruntime"}),serviceId:q?.serviceId??"Bedrock Runtime",urlParser:q?.urlParser??G_9.parseUrl,utf8Decoder:q?.utf8Decoder??zYq.fromUtf8,utf8Encoder:q?.utf8Encoder??zYq.toUtf8}};YYq.getRuntimeConfig=k_9});var XYq=B((JYq)=>{Object.defineProperty(JYq,"__esModule",{value:!0});JYq.getRuntimeConfig=void 0;var V_9=fT(),N_9=V_9.__importDefault(Tzq()),mM1=aw(),y_9=_Y6(),E_9=Nzq(),AYq=yH8(),wYq=pn(),HM8=YM(),L_9=RO(),h_9=Ezq(),R_9=Bn(),jYq=af(),XY6=pV(),HYq=uV(),S_9=gn(),C_9=xg(),b_9=OYq(),x_9=hU6(),I_9=dn(),u_9=hU6(),m_9=(q)=>{(0,u_9.emitWarningIfUnsupportedVersion)(process.version);
|
||
|
||
constructor(q){this.statusCode=q.statusCode,this.reason=q.reason,this.headers=q.headers||{},this.body=q.body}static isInstance(q){if(!q)return!1;let K=q;return typeof K.statusCode==="number"&&typeof K.headers==="object"}}function U_9(q){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(q)}Q_9.Field=PYq;Q_9.Fields=WYq;Q_9.HttpRequest=JM8;Q_9.HttpResponse=DYq;Q_9.getHttpHandlerExtensionConfiguration=B_9;Q_9.isValidHostname=U_9;Q_9.resolveHttpHandlerRuntimeConfig=g_9});var FM8=B((yX1)=>{var CYq=K_q(),ZYq=hn(),a_9=Rn(),s_9=Sn(),GYq=bg(),bYq=$zq(),t_9=YM(),MM8=RO(),nV=Zj(),e_9=Ozq(),qz9=mn(),zu=lI(),vYq=af(),KZ=hU6(),TYq=RM1(),Kz9=XYq(),kYq=nI(),VYq=fYq(),_z9=(q)=>{return Object.assign(q,{useDualstackEndpoint:q.useDualstackEndpoint??!1,useFipsEndpoint:q.useFipsEndpoint??!1,defaultSigningName:"bedrock"})},ig={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},zz9=(q)=>{let{httpAuthSchemes:K,httpAuthSchemeProvider:_,credentials:z,token:Y}=q;return{setHttpAuthScheme($){let O=K.findIndex((A)=>A.schemeId===$.schemeId);if(O===-1)K.push($);else K.splice(O,1,$)},httpAuthSchemes(){return K},setHttpAuthSchemeProvider($){_=$},httpAuthSchemeProvider(){return _},setCredentials($){z=$},credentials(){return z},setToken($){Y=$},token(){return Y}}},Yz9=(q)=>{return{httpAuthSchemes:q.httpAuthSchemes(),httpAuthSchemeProvider:q.httpAuthSchemeProvider(),credentials:q.credentials(),token:q.token()}},$z9=(q,K)=>{let _=Object.assign(kYq.getAwsRegionExtensionConfiguration(q),KZ.getDefaultExtensionConfiguration(q),VYq.getHttpHandlerExtensionConfiguration(q),zz9(q));return K.forEach((z)=>z.configure(_)),Object.assign(q,kYq.resolveAwsRegionExtensionConfiguration(_),KZ.resolveDefaultRuntimeConfig(_),VYq.resolveHttpHandlerRuntimeConfig(_),Yz9(_))};class PM8 extends KZ.Client{config;constructor(...[q]){let K=Kz9.getRuntimeConfig(q||{});super(K);this.initConfig=K;
|
||
|
||
var aj9=[1,U8,Wz9,0,[()=>j29,0]],sj9=[1,U8,Iz9,0,()=>VH9],tj9=[1,U8,YY9,0,()=>X29],ej9=[1,U8,cz9,0,()=>NH9],qH9=[1,U8,lz9,0,()=>D29],KH9=[1,U8,kz9,0,[()=>yH9,0]],_H9=[1,U8,AY9,0,()=>CH9],qOq=[1,U8,fY9,0,[()=>d$q,0]],zH9=[1,U8,vY9,0,[()=>XM8,0]],YH9=[1,U8,kY9,0,[()=>xH9,0]],SYq=[1,U8,EY9,0,[()=>g29,0]],JX1=[1,U8,CY9,0,()=>d29],xU6=[1,U8,IY9,0,[()=>l29,0]],$H9=[1,U8,UY9,0,[()=>BU6,0]],OH9=[1,U8,dY9,0,[()=>r29,0]],AH9=[1,U8,iY9,0,[()=>IH9,0]],wH9=[1,U8,aY9,0,()=>s29],jH9=[1,U8,tY9,0,()=>e29],HH9=[1,U8,$$9,0,()=>zj9],JH9=[1,U8,M$9,0,()=>Aj9],MH9=[1,U8,P$9,0,()=>wj9],XH9=[1,U8,D$9,0,()=>jj9],PH9=[1,U8,Z$9,0,()=>Hj9],WH9=[1,U8,y$9,0,()=>Wj9],MX1=[1,U8,_O9,0,[()=>o$q,0]],DH9=[1,U8,NO9,0,()=>Ij9],XX1=[1,U8,ZO9,0,[()=>cH9,0]],fH9=[1,U8,uO9,0,()=>Uj9],ZH9=[1,U8,pO9,0,()=>rH9],GH9=[1,U8,FO9,0,()=>oH9],vH9=[1,U8,iO9,0,()=>lH9],TH9=[2,U8,ZY9,0,[0,0],[()=>qOq,0]],kH9=[2,U8,GY9,0,[0,0],[()=>d$q,0]],KOq=[2,U8,AO9,8,0,()=>FH9],_Oq=[2,U8,JO9,8,0,0],PX1=[3,U8,Mz9,0,[Gw9],[()=>w29]],VH9=[3,U8,xz9,0,[VX],[0]],zOq=[3,U8,uz9,0,[ew9,yA9,LA9,EA9,kw9],[()=>rj9,()=>x29,()=>u29,()=>I29,()=>uj9]],NH9=[3,U8,Qz9,0,[VX],[0]],yH9=[3,U8,hz9,0,[VX,vM8,z$q,B$q,zX1,_X1,H$q,UM1,E$q,JA9,b$q],[0,()=>i$q,()=>Q$q,()=>e$q,()=>lj9,()=>Qj9,[()=>YOq,0],()=>AX1,[()=>UH9,0],()=>P29,()=>s$q]],EH9=[3,U8,Vz9,0,[VX,zX1,_X1,E$q,TA9],[0,()=>nj9,()=>ZH9,[()=>QH9,0],()=>W29]],LH9=[3,U8,yz9,0,[zX1,_X1],[()=>ij9,()=>dj9]],hH9=[3,U8,pz9,0,[$L],[[()=>o$q,0]]],RH9=[3,U8,rz9,{[EM8]:1},[aA9,jA9,wA9,HA9,sA9,qw9,iM1,rM1,$X1,KX1,tM1],[()=>Lj9,()=>G29,[()=>Z29,0],()=>v29,()=>hj9,[()=>N29,0],[()=>bM8,0],[()=>xM8,0],[()=>BM8,0],[()=>pM8,0],[()=>mM8,0]]],SH9=[3,U8,ez9,0,[BA9,VA9],[[()=>vj9,0],[()=>R29,0]]],CH9=[3,U8,wY9,0,[VX],[0]],bH9=[3,U8,MY9,0,[V86,sM1,VX,iZ6],[21,()=>jX1,0,()=>_H9]],xH9=[3,U8,TY9,0,[tw9,dA9,Lw9,QA9,Cw9,Iw9,_w9],[[()=>o29,0],[()=>F29,0],[()=>c29,0],[()=>B29,0],[()=>i29,0],()=>n29,()=>U29]],IH9=[3,U8,nY9,0,[VX,vM8],[()=>Xj9,[()=>Yj9,0]]],YOq=[3,U8,rY9,0,[VX,vM8],[()=>_j9,[()=>Kj9,0]]],uH9=[3,U8,K$9,8,[V86],[21]],mH9=[3,U8,H$9,8,[V86],[21]],pH9=[3,U8,d$9,0,[V86,sM1],[21,()=>jX1]],BH9=[3,U8,m$9,{[EM8]:1},[dM1],[[()=>J29,0]]],gH9=[3,U8,p$9,{[EM8]:1},[dM1,iM1,rM1,$X1,KX1,G$q,tM1],[[()=>M29,0],[()=>bM8,0],[()=>xM8,0],[()=>BM8,0],[()=>pM8,0],[()=>wX1,0],[()=>mM8,0]]],FH9=[3,U8,wO9,0,[VX],[0]],UH9=[3,U8,jO9,8,[Pw9,L$q],[[()=>bj9,0],21]],QH9=[3,U8,HO9,8,[VX,L$q,u$q],[0,21,0]],dH9=[3,U8,XO9,{[EM8]:1},[dM1,iM1,rM1,$X1,KX1,G$q,tM1],[[()=>Cj9,0],[()=>bM8,0],[()=>xM8,0],[()=>BM8,0],[()=>pM8,0],[()=>wX1,0],[()=>mM8,0]]],cH9=[3,U8,GO9,0,[VX,H$q,UM1],[0,[()=>YOq,0],()=>AX1]],lH9=[3,U8,rO9,0,[Bw9,yw9,UM1],[()=>cj9,()=>Fj9,()=>AX1]],nH9=[3,U8,bO9,0,[AA9,$A9,cw9],[()=>H29,()=>$29,()=>pj9]],iH9=[3,U8,IO9,0,[P$q],[15]],rH9=[3,U8,BO9,0,[VX],[0]],oH9=[3,U8,UO9,0,[P$q,VX,vM8,z$q,B$q,b$q],[15,0,()=>i$q,()=>Q$q,()=>e$q,()=>s$q]],aH9=[3,U8,sO9,0,[V86,sM1],[21,()=>jX1]],sH9=[9,U8,wz9,{[og]:["POST","/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply",200]},()=>O29,()=>A29],tH9=[9,U8,$Y9,{[og]:["POST","/model/{modelId}/converse",200]},()=>k29,()=>V29],eH9=[9,U8,Uz9,{[og]:["POST","/model/{modelId}/converse-stream",200]},()=>E29,()=>L29],qJ9=[9,U8,zY9,{[og]:["POST","/model/{modelId}/count-tokens",200]},()=>C29,()=>b29],KJ9=[9,U8,PY9,{[og]:["GET","/async-invoke/{invocationArn}",200]},()=>m29,()=>p29],_J9=[9,U8,C$9,{[og]:["POST","/model/{modelId}/invoke",200]},()=>Zj9,()=>Gj9],zJ9=[9,U8,u$9,{[og]:["POST","/model/{modelId}/invoke-with-bidirectional-stream",200]},()=>Tj9,()=>kj9],YJ9=[9,U8,F$9,{[og]:["POST","/model/{modelId}/invoke-with-response-stream",200]},()=>Vj9,()=>Nj9],$J9=[9,U8,l$9,{[og]:["GET","/async-invoke",200]},()=>yj9,()=>Ej9],OJ9=[9,U8,WO9,{[og]:["POST","/async-invoke",200]},()=>Bj9,()=>gj9];
|
||
|
||
class WX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","ApplyGuardrail",{}).n("BedrockRuntimeClient","ApplyGuardrailCommand").sc(sH9).build(){}class DX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","Converse",{}).n("BedrockRuntimeClient","ConverseCommand").sc(tH9).build(){}class fX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","ConverseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","ConverseStreamCommand").sc(eH9).build(){}class ZX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","CountTokens",{}).n("BedrockRuntimeClient","CountTokensCommand").sc(qJ9).build(){}class GX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","GetAsyncInvoke",{}).n("BedrockRuntimeClient","GetAsyncInvokeCommand").sc(KJ9).build(){}class vX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").sc(_J9).build(){}class TX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions()),CYq.getEventStreamPlugin(_),bYq.getWebSocketPlugin(_,{headerPrefix:"x-amz-bedrock-"})]}).s("AmazonBedrockFrontendService","InvokeModelWithBidirectionalStream",{eventStream:{input:!0,output:!0}}).n("BedrockRuntimeClient","InvokeModelWithBidirectionalStreamCommand").sc(zJ9).build(){}class kX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").sc(YJ9).build(){}class gM8 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","ListAsyncInvokes",{}).n("BedrockRuntimeClient","ListAsyncInvokesCommand").sc($J9).build(){}class VX1 extends KZ.Command.classBuilder().ep(ig).m(function(q,K,_,z){return[zu.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","StartAsyncInvoke",{}).n("BedrockRuntimeClient","StartAsyncInvokeCommand").sc(OJ9).build(){}var AJ9={ApplyGuardrailCommand:WX1,ConverseCommand:DX1,ConverseStreamCommand:fX1,CountTokensCommand:ZX1,GetAsyncInvokeCommand:GX1,InvokeModelCommand:vX1,InvokeModelWithBidirectionalStreamCommand:TX1,InvokeModelWithResponseStreamCommand:kX1,ListAsyncInvokesCommand:gM8,StartAsyncInvokeCommand:VX1};
|
||
|
||
return q}var $Oq,UM8,eM9;var gU6=L(()=>{c4();T7();d8();h8();TT();$Oq=$1(async function(){let[q,{ListInferenceProfilesCommand:K}]=await Promise.all([AOq(),Promise.resolve().then(() => w6(zM8(),1))]),_=[],z;try{do{let Y=new K({...z&&{nextToken:z},typeEquals:"SYSTEM_DEFINED"}),$=await q.send(Y);if($.inferenceProfileSummaries)_.push(...$.inferenceProfileSummaries);z=$.nextToken}while(z);return _.filter((Y)=>Y.inferenceProfileId?.includes("anthropic")).map((Y)=>Y.inferenceProfileId).filter(Boolean)}catch(Y){throw j6(Y),Y}});UM8=$1(async function(q){try{let[K,{GetInferenceProfileCommand:_}]=await Promise.all([AOq(),Promise.resolve().then(() => w6(zM8(),1))]),z=new _({inferenceProfileIdentifier:q}),Y=await K.send(z);if(!Y.models||Y.models.length===0)return null;let $=Y.models[0];if(!$?.modelArn)return null;let O=$.modelArn.lastIndexOf("/");return O>=0?$.modelArn.substring(O+1):$.modelArn}catch(K){return j6(K),null}});eM9=["us","eu","apac","global"]});var LX1,hX1,RX1,SX1,CX1,bX1,xX1,IX1,uX1,oZ6,mX1,E86,Uo$,HOq;
|
||
|
||
var FU6=L(()=>{LX1={firstParty:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet",anthropicAws:"claude-3-7-sonnet-20250219"},hX1={firstParty:"claude-3-5-sonnet-20241022",bedrock:"anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet",anthropicAws:"claude-3-5-sonnet-20241022"},RX1={firstParty:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku",anthropicAws:"claude-3-5-haiku-20241022"},SX1={firstParty:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5",anthropicAws:"claude-haiku-4-5-20251001"},CX1={firstParty:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4",anthropicAws:"claude-sonnet-4-20250514"},bX1={firstParty:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5",anthropicAws:"claude-sonnet-4-5-20250929"},xX1={firstParty:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4",anthropicAws:"claude-opus-4-20250514"},IX1={firstParty:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1",anthropicAws:"claude-opus-4-1-20250805"},uX1={firstParty:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5",anthropicAws:"claude-opus-4-5-20251101"},oZ6={firstParty:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6",anthropicAws:"claude-opus-4-6"},mX1={firstParty:"claude-sonnet-4-6",bedrock:"us.anthropic.claude-sonnet-4-6",vertex:"claude-sonnet-4-6",foundry:"claude-sonnet-4-6",anthropicAws:"claude-sonnet-4-6"},E86={haiku35:RX1,haiku45:SX1,sonnet35:hX1,sonnet37:LX1,sonnet40:CX1,sonnet45:bX1,sonnet46:mX1,opus40:xX1,opus41:IX1,opus45:uX1,opus46:oZ6},Uo$=Object.values(E86).map((q)=>q.firstParty),HOq=Object.fromEntries(Object.entries(E86).map(([q,K])=>[K.firstParty,q]))});
|
||
|
||
Object.keys(iU6).forEach(function(q){if(q!=="default"&&!Object.prototype.hasOwnProperty.call(KX8,q))Object.defineProperty(KX8,q,{enumerable:!0,get:function(){return iU6[q]}})})});var uwq=B((Iwq)=>{Object.defineProperty(Iwq,"__esModule",{value:!0});Iwq.propertyProviderChain=Iwq.createCredentialChain=void 0;var nZ9=ZX(),iZ9=(...q)=>{let K=-1,z=Object.assign(async(Y)=>{let $=await Iwq.propertyProviderChain(...q)(Y);if(!$.expiration&&K!==-1)$.expiration=new Date(Date.now()+K);return $},{expireAfter(Y){if(Y<300000)throw Error("@aws-sdk/credential-providers - createCredentialChain(...).expireAfter(ms) may not be called with a duration lower than five minutes.");return K=Y,z}});return z};Iwq.createCredentialChain=iZ9;var rZ9=(...q)=>async(K)=>{if(q.length===0)throw new nZ9.ProviderError("No providers in chain",{tryNextLink:!1});let _;for(let z of q)try{return await z(K)}catch(Y){if(_=Y,Y?.tryNextLink)continue;throw Y}throw _};Iwq.propertyProviderChain=rZ9});var dP1=B((K09)=>{K09.HttpAuthLocation=void 0;(function(q){q.HEADER="header",q.QUERY="query"})(K09.HttpAuthLocation||(K09.HttpAuthLocation={}));K09.HttpApiKeyAuthLocation=void 0;(function(q){q.HEADER="header",q.QUERY="query"})(K09.HttpApiKeyAuthLocation||(K09.HttpApiKeyAuthLocation={}));K09.EndpointURLScheme=void 0;(function(q){q.HTTP="http",q.HTTPS="https"})(K09.EndpointURLScheme||(K09.EndpointURLScheme={}));K09.AlgorithmId=void 0;(function(q){q.MD5="md5",q.CRC32="crc32",q.CRC32C="crc32c",q.SHA1="sha1",q.SHA256="sha256"})(K09.AlgorithmId||(K09.AlgorithmId={}));var aZ9=(q)=>{let K=[];if(q.sha256!==void 0)K.push({algorithmId:()=>K09.AlgorithmId.SHA256,checksumConstructor:()=>q.sha256});if(q.md5!=null)K.push({algorithmId:()=>K09.AlgorithmId.MD5,checksumConstructor:()=>q.md5});return{addChecksumAlgorithm(_){K.push(_)},checksumAlgorithms(){return K}}},sZ9=(q)=>{let K={};return q.checksumAlgorithms().forEach((_)=>{K[_.algorithmId()]=_.checksumConstructor()}),K},tZ9=(q)=>{return aZ9(q)},eZ9=(q)=>{return sZ9(q)};K09.FieldPosition=void 0;
|
||
|
||
return new Promise((z)=>{_.onerror=()=>z(null),_.onsuccess=()=>z(_.result?_.result.value:null)})}).catch(()=>null)}removeItem(q){return this.withObjectStore("readwrite",(K)=>{let _=K.delete(q);return new Promise((z,Y)=>{_.onerror=()=>Y(_.error),_.onsuccess=()=>z()})})}setItem(q,K){return this.withObjectStore("readwrite",(_)=>{let z=_.put({id:q,value:K});return new Promise((Y,$)=>{z.onerror=()=>$(z.error),z.onsuccess=()=>Y()})})}getDb(){let q=self.indexedDB.open(this.dbName,1);return new Promise((K,_)=>{q.onsuccess=()=>{K(q.result)},q.onerror=()=>{_(q.error)},q.onblocked=()=>{_(Error("Unable to access DB"))},q.onupgradeneeded=()=>{let z=q.result;z.onerror=()=>{_(Error("Failed to create object store"))},z.createObjectStore(xW1,{keyPath:"id"})}})}withObjectStore(q,K){return this.getDb().then((_)=>{let z=_.transaction(xW1,q);return z.oncomplete=()=>_.close(),new Promise((Y,$)=>{z.onerror=()=>$(z.error),Y(K(z.objectStore(xW1)))}).catch((Y)=>{throw _.close(),Y})})}}class hjq{store;constructor(q={}){this.store=q}getItem(q){if(q in this.store)return this.store[q];return null}removeItem(q){delete this.store[q]}setItem(q,K){this.store[q]=K}}var tN9=new hjq;function eN9(){if(typeof self==="object"&&self.indexedDB)return new Ljq;if(typeof window==="object"&&window.localStorage)return window.localStorage;return tN9}function qy9({accountId:q,cache:K=eN9(),client:_,clientConfig:z,customRoleArn:Y,identityPoolId:$,logins:O,userIdentifier:A=!O||Object.keys(O).length===0?"ANONYMOUS":void 0,logger:w,parentClientConfig:j}){w?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");let H=A?`aws:cognito-identity-credentials:${$}:${A}`:void 0,J=async(M)=>{let{GetIdCommand:X,CognitoIdentityClient:P}=await Promise.resolve().then(function(){return bW1()}),W=(G)=>z?.[G]??j?.[G]??M?.callerClientConfig?.[G],D=_??new P(Object.assign({},z??{},{region:W("region"),profile:W("profile"),userAgentAppId:W("userAgentAppId")})),f=H&&await K.getItem(H);
|
||
|
||
if(!f){let{IdentityId:G=Ky9(w)}=await D.send(new X({AccountId:q,IdentityPoolId:$,Logins:O?await yjq(O):void 0}));if(f=G,H)Promise.resolve(K.setItem(H,f)).catch(()=>{})}return J=Ejq({client:D,customRoleArn:Y,logins:O,identityId:f}),J(M)};return(M)=>J(M).catch(async(X)=>{if(H)Promise.resolve(K.removeItem(H)).catch(()=>{});throw X})}function Ky9(q){throw new vX8.CredentialsProviderError("Response from Amazon Cognito contained no identity ID",{logger:q})}_y9.fromCognitoIdentity=Ejq;_y9.fromCognitoIdentityPool=qy9});var Cjq=B((Rjq)=>{Object.defineProperty(Rjq,"__esModule",{value:!0});Rjq.fromCognitoIdentity=void 0;var $y9=IW1(),Oy9=(q)=>(0,$y9.fromCognitoIdentity)({...q});Rjq.fromCognitoIdentity=Oy9});var Ijq=B((bjq)=>{Object.defineProperty(bjq,"__esModule",{value:!0});bjq.fromCognitoIdentityPool=void 0;var Ay9=IW1(),wy9=(q)=>(0,Ay9.fromCognitoIdentityPool)({...q});bjq.fromCognitoIdentityPool=wy9});var pjq=B((ujq)=>{Object.defineProperty(ujq,"__esModule",{value:!0});ujq.fromContainerMetadata=void 0;var jy9=mz6(),Hy9=(q)=>{return q?.logger?.debug("@smithy/credential-provider-imds","fromContainerMetadata"),(0,jy9.fromContainerMetadata)(q)};ujq.fromContainerMetadata=Hy9});var Fjq=B((Bjq)=>{Object.defineProperty(Bjq,"__esModule",{value:!0});Bjq.fromEnv=void 0;var Jy9=jj8(),My9=(q)=>(0,Jy9.fromEnv)(q);Bjq.fromEnv=My9});var djq=B((Ujq)=>{Object.defineProperty(Ujq,"__esModule",{value:!0});Ujq.fromIni=void 0;var Xy9=U21(),Py9=(q={})=>(0,Xy9.fromIni)({...q});Ujq.fromIni=Py9});var njq=B((cjq)=>{Object.defineProperty(cjq,"__esModule",{value:!0});cjq.fromInstanceMetadata=void 0;var Wy9=mV(),Dy9=mz6(),fy9=(q)=>{return q?.logger?.debug("@smithy/credential-provider-imds","fromInstanceMetadata"),async()=>(0,Dy9.fromInstanceMetadata)(q)().then((K)=>(0,Wy9.setCredentialFeature)(K,"CREDENTIALS_IMDS","0"))};cjq.fromInstanceMetadata=fy9});var ojq=B((ijq)=>{Object.defineProperty(ijq,"__esModule",{value:!0});ijq.fromLoginCredentials=void 0;var Zy9=G21(),Gy9=(q)=>(0,Zy9.fromLoginCredentials)({...q});ijq.fromLoginCredentials=Gy9});
|
||
|
||
var uW1=B((ajq)=>{Object.defineProperty(ajq,"__esModule",{value:!0});ajq.fromNodeProviderChain=void 0;var vy9=_Y6(),Ty9=(q={})=>(0,vy9.defaultProvider)({...q});ajq.fromNodeProviderChain=Ty9});var qHq=B((tjq)=>{Object.defineProperty(tjq,"__esModule",{value:!0});tjq.fromProcess=void 0;var ky9=YJ8(),Vy9=(q)=>(0,ky9.fromProcess)(q);tjq.fromProcess=Vy9});var zHq=B((KHq)=>{Object.defineProperty(KHq,"__esModule",{value:!0});KHq.fromSSO=void 0;var Ny9=cH8(),yy9=(q={})=>{return(0,Ny9.fromSSO)({...q})};KHq.fromSSO=yy9});var $Hq=B((TX8)=>{Object.defineProperty(TX8,"__esModule",{value:!0});TX8.STSClient=TX8.AssumeRoleCommand=void 0;var YHq=zJ8();Object.defineProperty(TX8,"AssumeRoleCommand",{enumerable:!0,get:function(){return YHq.AssumeRoleCommand}});Object.defineProperty(TX8,"STSClient",{enumerable:!0,get:function(){return YHq.STSClient}})});var wHq=B((zF)=>{var Ly9=zF&&zF.__createBinding||(Object.create?function(q,K,_,z){if(z===void 0)z=_;var Y=Object.getOwnPropertyDescriptor(K,_);if(!Y||("get"in Y?!K.__esModule:Y.writable||Y.configurable))Y={enumerable:!0,get:function(){return K[_]}};Object.defineProperty(q,z,Y)}:function(q,K,_,z){if(z===void 0)z=_;q[z]=K[_]}),hy9=zF&&zF.__setModuleDefault||(Object.create?function(q,K){Object.defineProperty(q,"default",{enumerable:!0,value:K})}:function(q,K){q.default=K}),Ry9=zF&&zF.__importStar||function(){var q=function(K){return q=Object.getOwnPropertyNames||function(_){var z=[];for(var Y in _)if(Object.prototype.hasOwnProperty.call(_,Y))z[z.length]=Y;return z},q(K)};return function(K){if(K&&K.__esModule)return K;var _={};if(K!=null){for(var z=q(K),Y=0;Y<z.length;Y++)if(z[Y]!=="default")Ly9(_,K,z[Y])}return hy9(_,K),_}}();Object.defineProperty(zF,"__esModule",{value:!0});zF.fromTemporaryCredentials=void 0;var Sy9=RO(),OHq=ZX(),Cy9="us-east-1",by9=(q,K,_)=>{let z;return async(Y={})=>{let{callerClientConfig:$}=Y,O=q.clientConfig?.profile??$?.profile,A=q.logger??$?.logger;A?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");
|
||
|
||
if(CS()==="opusplan"&&K==="plan"&&!z)return KN();if(CS()==="haiku"&&K==="plan")return LT();return _}function RG(){if(bS())return KN()+(vJ()?"[1m]":"");if(p86())return KN()+(vJ()?"[1m]":"");return LT()}function OZ(){return Y5(RG())}function ET(q){if(q=q.toLowerCase(),q.includes("claude-opus-4-6"))return"claude-opus-4-6";if(q.includes("claude-opus-4-5"))return"claude-opus-4-5";if(q.includes("claude-opus-4-1"))return"claude-opus-4-1";if(q.includes("claude-opus-4"))return"claude-opus-4";if(q.includes("claude-sonnet-4-6"))return"claude-sonnet-4-6";if(q.includes("claude-sonnet-4-5"))return"claude-sonnet-4-5";if(q.includes("claude-sonnet-4"))return"claude-sonnet-4";if(q.includes("claude-haiku-4-5"))return"claude-haiku-4-5";if(q.includes("claude-3-7-sonnet"))return"claude-3-7-sonnet";if(q.includes("claude-3-5-sonnet"))return"claude-3-5-sonnet";if(q.includes("claude-3-5-haiku"))return"claude-3-5-haiku";if(q.includes("claude-3-opus"))return"claude-3-opus";if(q.includes("claude-3-sonnet"))return"claude-3-sonnet";if(q.includes("claude-3-haiku"))return"claude-3-haiku";let K=q.match(/(claude-(\d+-\d+-)?\w+)/);if(K&&K[1])return K[1];return q}function cY(q){return ET(cM8(q))}function D06(q=!1){if(bS()||p86()){if(vJ())return`Opus 4.6 with 1M context · Most capable for complex work${q?Oi(!0):""}`;return`Opus 4.6 · Most capable for complex work${q?Oi(!0):""}`}return"Sonnet 4.6 · Best for everyday tasks"}function AQ6(q){if(q==="opusplan")return"Opus 4.6 in plan mode, else Sonnet 4.6";return GH(Y5(q))}function Oi(q){if(Dq()!=="firstParty")return"";let K=SS(M06(q));return` ·${q?` (${N66})`:""} ${K}`}function vJ(){if(m86()||xS()||Dq()!=="firstParty")return!1;if(i7()&&jK()===null)return!1;return!0}function wQ6(q){if(q==="opusplan")return"Opus Plan";if($i(q))return MG(q);return GH(q)}function u86(q){switch(q){case e9().opus46:return"Opus 4.6";case e9().opus46+"[1m]":return"Opus 4.6 (1M context)";case e9().opus45:return"Opus 4.5";case e9().opus41:return"Opus 4.1";case e9().opus40:return"Opus 4";
|
||
|
||
/*! @azure/msal-common v15.13.1 2025-10-29 */oGq=[_G1,zG1,YG1,H16,nW8],vp9=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],oW8={[j16]:"No refresh token found in the cache. Please sign-in.",[cd6]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[ld6]:"Refresh token has expired.",[H16]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[nW8]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve."},$G1={noTokensFoundError:{code:j16,desc:oW8[j16]},native_account_unavailable:{code:cd6,desc:oW8[cd6]},bad_token:{code:H16,desc:oW8[H16]}};XL=class XL extends _9{constructor(q,K,_,z,Y,$,O,A){super(q,K,_);Object.setPrototypeOf(this,XL.prototype),this.timestamp=z||Q1.EMPTY_STRING,this.traceId=Y||Q1.EMPTY_STRING,this.correlationId=$||Q1.EMPTY_STRING,this.claims=O||Q1.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=A}}});class tW8{static setRequestState(q,K,_){let z=tW8.generateLibraryState(q,_);return K?`${z}${Q1.RESOURCE_DELIM}${K}`:z}static generateLibraryState(q,K){if(!q)throw J7(q16);let _={id:q.createNewGuid()};if(K)_.meta=K;let z=JSON.stringify(_);return q.base64Encode(z)}static parseRequestState(q,K){if(!q)throw J7(q16);if(!K)throw J7(Pu);try{let _=K.split(Q1.RESOURCE_DELIM),z=_[0],Y=_.length>1?_.slice(1).join(Q1.RESOURCE_DELIM):Q1.EMPTY_STRING,$=q.base64Decode(z),O=JSON.parse($);return{userRequestState:Y||Q1.EMPTY_STRING,libraryState:O}}catch(_){throw J7(Pu)}}}var aGq=L(()=>{K2();hX();wM();/*! @azure/msal-common v15.13.1 2025-10-29 */});class k$6{constructor(q,K){this.cryptoUtils=q,this.performanceClient=K}async generateCnf(q,K){this.performanceClient?.addQueueMeasurement(R1.PopTokenGenerateCnf,q.correlationId);
|
||
|
||
this.identityClient=new WF(Object.assign(Object.assign({},Y),{additionalPolicies:[{policy:byq(this.msiRetryConfig),position:"perCall"}]})),this.managedIdentityApp=new yF({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:_f8(dP8()),piiLoggingEnabled:(z=Y.loggingOptions)===null||z===void 0?void 0:z.enableUnsafeSupportLogging,loggerCallback:Kf8(DL)}}}),this.isAvailableIdentityClient=new WF(Object.assign(Object.assign({},Y),{retryOptions:{maxRetries:0}}));let O=this.managedIdentityApp.getManagedIdentitySource();if(O==="CloudShell"){if(this.clientId||this.resourceId||this.objectId)throw DL.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new b4("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.")}if(O==="ServiceFabric"){if(this.clientId||this.resourceId||this.objectId)throw DL.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new b4(`ManagedIdentityCredential: ${DGq}`)}if(DL.info(`Using ${O} managed identity.`),$.length===1){let{key:A,value:w}=$[0];DL.info(`${O} with ${A}: ${w}`)}}async getToken(q,K={}){DL.getToken.info("Using the MSAL provider for Managed Identity.");let _=UQ6(q);if(!_)throw new b4(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(q)}`);return lY.withSpan("ManagedIdentityCredential.getToken",K,async()=>{var z;try{let Y=await Iv1.isAvailable(this.clientId),$=this.managedIdentityApp.getManagedIdentitySource(),O=$==="DefaultToImds"||$==="Imds";
|
||
|
||
return(z=Y[_])!==null&&z!==void 0?z:Y[oSq(_)]}return{get:K}}class aSq{constructor(q){IG6.add(this),Ui.set(this,new Map),this.capacity=q.capacity,this.maxAge=q.maxAge}set(q,K){hu(this,IG6,"m",wk1).call(this,q,K),hu(this,IG6,"m",jk1).call(this)}get(q){let K=hu(this,Ui,"f").get(q);if(!K)return;return hu(this,IG6,"m",wk1).call(this,q,K.value),hu(this,IG6,"m",jk1).call(this),K.value}}L16.LRUCache=aSq;Ui=new WeakMap,IG6=new WeakSet,wk1=function(K,_){hu(this,Ui,"f").delete(K),hu(this,Ui,"f").set(K,{value:_,lastAccessed:Date.now()})},jk1=function(){let K=this.maxAge?Date.now()-this.maxAge:0,_=hu(this,Ui,"f").entries().next();while(!_.done&&(hu(this,Ui,"f").size>this.capacity||_.value[1].lastAccessed<K))hu(this,Ui,"f").delete(_.value[0]),_=hu(this,Ui,"f").entries().next()}});var CF=B((qCq)=>{Object.defineProperty(qCq,"__esModule",{value:!0});qCq.AuthClient=qCq.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=qCq.DEFAULT_UNIVERSE=void 0;var Ee9=U6("events"),sSq=Eu(),tSq=ac6(),Le9=h16();qCq.DEFAULT_UNIVERSE="googleapis.com";qCq.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300000;class eSq extends Ee9.EventEmitter{constructor(q={}){var K,_,z,Y,$;super();this.credentials={},this.eagerRefreshThresholdMillis=qCq.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS,this.forceRefreshOnFailure=!1,this.universeDomain=qCq.DEFAULT_UNIVERSE;let O=(0,Le9.originalOrCamelOptions)(q);if(this.apiKey=q.apiKey,this.projectId=(K=O.get("project_id"))!==null&&K!==void 0?K:null,this.quotaProjectId=O.get("quota_project_id"),this.credentials=(_=O.get("credentials"))!==null&&_!==void 0?_:{},this.universeDomain=(z=O.get("universe_domain"))!==null&&z!==void 0?z:qCq.DEFAULT_UNIVERSE,this.transporter=(Y=q.transporter)!==null&&Y!==void 0?Y:new tSq.DefaultTransporter,q.transporterOptions)this.transporter.defaults=q.transporterOptions;if(q.eagerRefreshThresholdMillis)this.eagerRefreshThresholdMillis=q.eagerRefreshThresholdMillis;this.forceRefreshOnFailure=($=q.forceRefreshOnFailure)!==null&&$!==void 0?$:!1}get gaxios(){if(this.transporter instanceof sSq.Gaxios)return this.transporter;
|
||
|
||
return this.emit("tokens",$),{tokens:$,res:Y}}refreshAccessToken(q){if(q)this.refreshAccessTokenAsync().then((K)=>q(null,K.credentials,K.res),q);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let q=await this.refreshToken(this.credentials.refresh_token),K=q.tokens;return K.refresh_token=this.credentials.refresh_token,this.credentials=K,{credentials:this.credentials,res:q.res}}getAccessToken(q){if(q)this.getAccessTokenAsync().then((K)=>q(null,K.token,K.res),q);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let _=await this.processAndValidateRefreshHandler();if(_===null||_===void 0?void 0:_.access_token)return this.setCredentials(_),{token:this.credentials.access_token}}else throw Error("No refresh token or refresh handler callback is set.");let K=await this.refreshAccessTokenAsync();if(!K.credentials||K.credentials&&!K.credentials.access_token)throw Error("Could not refresh access token.");return{token:K.credentials.access_token,res:K.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(q){return(await this.getRequestMetadataAsync(q)).headers}async getRequestMetadataAsync(q){let K=this.credentials;if(!K.access_token&&!K.refresh_token&&!this.apiKey&&!this.refreshHandler)throw Error("No access, refresh token, API key or refresh handler callback is set.");if(K.access_token&&!this.isTokenExpiring()){K.token_type=K.token_type||"Bearer";let O={Authorization:K.token_type+" "+K.access_token};return{headers:this.addSharedMetadataHeaders(O)}}if(this.refreshHandler){let O=await this.processAndValidateRefreshHandler();if(O===null||O===void 0?void 0:O.access_token){this.setCredentials(O);let A={Authorization:"Bearer "+this.credentials.access_token};return{headers:this.addSharedMetadataHeaders(A)}}}if(this.apiKey)return{headers:{"X-Goog-Api-Key":this.apiKey}};let _=null,z=null;
|
||
|
||
try{_=await this.refreshToken(K.refresh_token),z=_.tokens}catch(O){let A=O;if(A.response&&(A.response.status===403||A.response.status===404))A.message=`Could not refresh access token: ${A.message}`;throw A}let Y=this.credentials;Y.token_type=Y.token_type||"Bearer",z.refresh_token=Y.refresh_token,this.credentials=z;let $={Authorization:Y.token_type+" "+z.access_token};return{headers:this.addSharedMetadataHeaders($),res:_.res}}static getRevokeTokenUrl(q){return new UT().getRevokeTokenURL(q).toString()}getRevokeTokenURL(q){let K=new URL(this.endpoints.oauth2RevokeUrl);return K.searchParams.append("token",q),K}revokeToken(q,K){let _={...UT.RETRY_CONFIG,url:this.getRevokeTokenURL(q).toString(),method:"POST"};if(K)this.transporter.request(_).then((z)=>K(null,z),K);else return this.transporter.request(_)}revokeCredentials(q){if(q)this.revokeCredentialsAsync().then((K)=>q(null,K),q);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let q=this.credentials.access_token;if(this.credentials={},q)return this.revokeToken(q);else throw Error("No access token to revoke.")}request(q,K){if(K)this.requestAsync(q).then((_)=>K(null,_),(_)=>{return K(_,_.response)});else return this.requestAsync(q)}async requestAsync(q,K=!1){let _;try{let z=await this.getRequestMetadataAsync(q.url);if(q.headers=q.headers||{},z.headers&&z.headers["x-goog-user-project"])q.headers["x-goog-user-project"]=z.headers["x-goog-user-project"];if(z.headers&&z.headers.Authorization)q.headers.Authorization=z.headers.Authorization;if(this.apiKey)q.headers["X-Goog-Api-Key"]=this.apiKey;_=await this.transporter.request(q)}catch(z){let Y=z.response;if(Y){let $=Y.status,O=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),A=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,w=Y.config.data instanceof Re9.Readable,j=$===401||$===403;
|
||
|
||
var S16=B((MD)=>{var Rk1=MD&&MD.__classPrivateFieldGet||function(q,K,_,z){if(_==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof K==="function"?q!==K||!z:!K.has(q))throw TypeError("Cannot read private member from an object whose class did not declare it");return _==="m"?z:_==="a"?z.call(q):z?z.value:K.get(q)},nCq=MD&&MD.__classPrivateFieldSet||function(q,K,_,z,Y){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!Y)throw TypeError("Private accessor was defined without a setter");if(typeof K==="function"?q!==K||!Y:!K.has(q))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?Y.call(q,_):Y?Y.value=_:K.set(q,_),_},Sk1,pG6,rCq;Object.defineProperty(MD,"__esModule",{value:!0});MD.BaseExternalAccountClient=MD.DEFAULT_UNIVERSE=MD.CLOUD_RESOURCE_MANAGER=MD.EXTERNAL_ACCOUNT_TYPE=MD.EXPIRATION_TIME_OFFSET=void 0;var f6_=U6("stream"),Z6_=CF(),G6_=hk1(),iCq=h16(),v6_="urn:ietf:params:oauth:grant-type:token-exchange",T6_="urn:ietf:params:oauth:token-type:access_token",Ck1="https://www.googleapis.com/auth/cloud-platform",k6_=3600;MD.EXPIRATION_TIME_OFFSET=300000;MD.EXTERNAL_ACCOUNT_TYPE="external_account";MD.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var V6_="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",N6_="https://sts.{universeDomain}/v1/token",y6_=Ak1(),E6_=CF();Object.defineProperty(MD,"DEFAULT_UNIVERSE",{enumerable:!0,get:function(){return E6_.DEFAULT_UNIVERSE}});class Ff8 extends Z6_.AuthClient{constructor(q,K){var _;super({...q,...K});Sk1.add(this),pG6.set(this,null);let z=(0,iCq.originalOrCamelOptions)(q),Y=z.get("type");if(Y&&Y!==MD.EXTERNAL_ACCOUNT_TYPE)throw Error(`Expected "${MD.EXTERNAL_ACCOUNT_TYPE}" type but received "${q.type}"`);
|
||
|
||
class $V1{get isGCE(){return this.checkIsGCE}constructor(q={}){if(b16.add(this),this.checkIsGCE=void 0,this.jsonContent=null,this.cachedCredential=null,QG6.set(this,null),this.clientOptions={},this._cachedProjectId=q.projectId||null,this.cachedCredential=q.authClient||null,this.keyFilename=q.keyFilename||q.keyFile,this.scopes=q.scopes,this.clientOptions=q.clientOptions||{},this.jsonContent=q.credentials||null,this.apiKey=q.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw RangeError(DZ.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);if(q.universeDomain)this.clientOptions.universeDomain=q.universeDomain}setGapicJWTValues(q){q.defaultServicePath=this.defaultServicePath,q.useJWTAccessWithScope=this.useJWTAccessWithScope,q.defaultScopes=this.defaultScopes}getProjectId(q){if(q)this.getProjectIdAsync().then((K)=>q(null,K),q);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(q){if(q instanceof Error&&q.message===DZ.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;else throw q}}async findAndCacheProjectId(){let q=null;if(q||(q=await this.getProductionProjectId()),q||(q=await this.getFileProjectId()),q||(q=await this.getDefaultServiceProjectId()),q||(q=await this.getGCEProjectId()),q||(q=await this.getExternalAccountClientProjectId()),q)return this._cachedProjectId=q,q;else throw Error(DZ.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){if(this._cachedProjectId)return this._cachedProjectId;if(!this._findProjectIdPromise)this._findProjectIdPromise=this.findAndCacheProjectId();return this._findProjectIdPromise}async getUniverseDomainFromMetadataServer(){var q;let K;try{K=await _l6.universe("universe-domain"),K||(K=zV1.DEFAULT_UNIVERSE)}catch(_){if(_&&((q=_===null||_===void 0?void 0:_.response)===null||q===void 0?void 0:q.status)===404)K=zV1.DEFAULT_UNIVERSE;
|
||
|
||
return q.headers=Object.assign(q.headers||{},z),q}async request(q){return(await this.getClient()).request(q)}getEnv(){return(0,Z8_.getEnv)()}async sign(q,K){let _=await this.getClient(),z=await this.getUniverseDomain();if(K=K||`https://iamcredentials.${z}/v1/projects/-/serviceAccounts/`,_ instanceof UG6.Impersonated)return(await _.sign(q)).signedBlob;let Y=(0,P8_.createCrypto)();if(_ instanceof FG6.JWT&&_.key)return await Y.sign(_.key,q);let $=await this.getCredentials();if(!$.client_email)throw Error("Cannot sign data without `client_email`.");return this.signBlob(Y,$.client_email,q,K)}async signBlob(q,K,_,z){let Y=new URL(z+`${K}:signBlob`);return(await this.request({method:"POST",url:Y.href,data:{payload:q.encodeBase64StringUtf8(_)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}}DZ.GoogleAuth=$V1;QG6=new WeakMap,b16=new WeakSet,dG6=async function(K,_=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let z=await this.getProjectIdOptional();if(_)K.quotaProjectId=_;return this.cachedCredential=K,{credential:K,projectId:z}},Ubq=async function(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);else if(this.keyFilename){let K=YV1.resolve(this.keyFilename),_=Yl6.createReadStream(K);return await this.fromStreamAsync(_,this.clientOptions)}else if(this.apiKey){let K=await this.fromAPIKey(this.apiKey,this.clientOptions);K.scopes=this.scopes;let{credential:_}=await C16(this,b16,"m",dG6).call(this,K);return _}else{let{credential:K}=await this.getApplicationDefaultAsync(this.clientOptions);return K}};$V1.DefaultTransporter=W8_.DefaultTransporter});var nbq=B((cbq)=>{Object.defineProperty(cbq,"__esModule",{value:!0});cbq.IAMAuth=void 0;class dbq{constructor(q,K){this.selector=q,this.token=K,this.selector=q,this.token=K}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}}cbq.IAMAuth=dbq});var abq=B((rbq)=>{Object.defineProperty(rbq,"__esModule",{value:!0});
|
||
|
||
return w8().clientDataCache?.coral_reef_sonnet==="true"}function af8(q,K){if(!q)return{used:null,remaining:null};let _=q.input_tokens+q.cache_creation_input_tokens+q.cache_read_input_tokens,z=Math.round(_/K*100),Y=Math.min(100,Math.max(0,z));return{used:Y,remaining:100-Y}}function x16(q){let K,_,z=cY(q);if(z.includes("opus-4-6"))K=64000,_=128000;else if(z.includes("sonnet-4-6"))K=32000,_=128000;else if(z.includes("opus-4-5")||z.includes("sonnet-4")||z.includes("haiku-4"))K=32000,_=64000;else if(z.includes("opus-4-1")||z.includes("opus-4"))K=32000,_=32000;else if(z.includes("claude-3-opus"))K=4096,_=4096;else if(z.includes("claude-3-sonnet"))K=8192,_=8192;else if(z.includes("claude-3-haiku"))K=4096,_=4096;else if(z.includes("3-5-sonnet")||z.includes("3-5-haiku"))K=8192,_=8192;else if(z.includes("3-7-sonnet"))K=32000,_=64000;else K=M1_,_=X1_;let Y=Wxq(q);if(Y?.max_tokens&&Y.max_tokens>=4096)_=Y.max_tokens,K=Math.min(K,_);return{default:K,upperLimit:_}}function Gxq(q){return x16(q).upperLimit-1}var J1_=200000,fxq=20000,M1_=32000,X1_=64000,Zxq=8000,DV1=64000;var jD=L(()=>{b86();k1();d8();dq();WV1()});var P1_,I16;var sf8=L(()=>{c4();P_();P1_=[{modelEnvVar:"ANTHROPIC_DEFAULT_OPUS_MODEL",capabilitiesEnvVar:"ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES"},{modelEnvVar:"ANTHROPIC_DEFAULT_SONNET_MODEL",capabilitiesEnvVar:"ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES"},{modelEnvVar:"ANTHROPIC_DEFAULT_HAIKU_MODEL",capabilitiesEnvVar:"ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES"}],I16=$1((q,K)=>{if(tw())return;let _=q.toLowerCase();for(let z of P1_){let Y=process.env[z.modelEnvVar],$=process.env[z.capabilitiesEnvVar];if(!Y||$===void 0)continue;if(_!==Y.toLowerCase())continue;return $.toLowerCase().split(",").map((O)=>O.trim()).includes(K)}return},(q,K)=>`${q.toLowerCase()}:${K}`)});function W1_(q){let K=[],_=[];for(let z of q)if(Txq.includes(z))K.push(z);else _.push(z);return{allowed:K,disallowed:_}}function kxq(q){if(!q||q.length===0)return;
|
||
|
||
return`claude-code/${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION}${K}`}function kIq(){return`Claude-User (${M$()}; +https://support.anthropic.com/)`}function EJ(){if(i7()){let K=t7();if(!K?.accessToken)return{headers:{},error:"No OAuth token available"};return{headers:{Authorization:`Bearer ${K.accessToken}`,"anthropic-beta":JJ}}}let q=NT();if(!q)return{headers:{},error:"No API key available"};return{headers:{"x-api-key":q}}}async function oi(q,K){try{return await q()}catch(_){if(!O1.isAxiosError(_))throw _;let z=_.response?.status;if(!(z===401||K?.also403Revoked&&z===403&&typeof _.response?.data==="string"&&_.response.data.includes("OAuth token has been revoked")))throw _;let $=t7()?.accessToken;if(!$)throw _;return await RS($),await q()}}var pG=L(()=>{VK();z3();T7();_O6()});async function VIq(){if(vl6===null&&!Gl6)Gl6=x7_(),vl6=await Gl6,Gl6=null,Av6.cache.clear?.()}function Ov6(){vl6=null,Gl6=null,Av6.cache.clear?.(),kZ8.cache.clear?.()}function NIq(){return Av6(!0)}function b7_(){if(vl6!==null)return vl6;let q=o_();if(q?.emailAddress)return q.emailAddress;return}async function x7_(){let q=o_();if(q?.emailAddress)return q.emailAddress;return}var vl6=null,Gl6=null,Av6,kZ8;var zO6=L(()=>{c4();T8();T7();k1();F7();R_();d8();AT();Av6=$1((q)=>{let K=qC(),_=w8(),z,Y,$;if(q){if(z=jK()??void 0,Y=xF()??void 0,z&&_.claudeCodeFirstTokenDate){let j=new Date(_.claudeCodeFirstTokenDate).getTime();if(!isNaN(j))$=j}}let O=o_(),A=O?.organizationUuid,w=O?.accountUuid;
|
||
|
||
var KC=qy1(),JBq="aws.lambda.invoked_arn",MBq="db.system",XBq="db.connection_string",PBq="db.user",WBq="db.jdbc.driver_classname",DBq="db.name",fBq="db.statement",ZBq="db.operation",GBq="db.mssql.instance_name",vBq="db.cassandra.keyspace",TBq="db.cassandra.page_size",kBq="db.cassandra.consistency_level",VBq="db.cassandra.table",NBq="db.cassandra.idempotence",yBq="db.cassandra.speculative_execution_count",EBq="db.cassandra.coordinator.id",LBq="db.cassandra.coordinator.dc",hBq="db.hbase.namespace",RBq="db.redis.database_index",SBq="db.mongodb.collection",CBq="db.sql.table",bBq="exception.type",xBq="exception.message",IBq="exception.stacktrace",uBq="exception.escaped",mBq="faas.trigger",pBq="faas.execution",BBq="faas.document.collection",gBq="faas.document.operation",FBq="faas.document.time",UBq="faas.document.name",QBq="faas.time",dBq="faas.cron",cBq="faas.coldstart",lBq="faas.invoked_name",nBq="faas.invoked_provider",iBq="faas.invoked_region",rBq="net.transport",oBq="net.peer.ip",aBq="net.peer.port",sBq="net.peer.name",tBq="net.host.ip",eBq="net.host.port",qgq="net.host.name",Kgq="net.host.connection.type",_gq="net.host.connection.subtype",zgq="net.host.carrier.name",Ygq="net.host.carrier.mcc",$gq="net.host.carrier.mnc",Ogq="net.host.carrier.icc",Agq="peer.service",wgq="enduser.id",jgq="enduser.role",Hgq="enduser.scope",Jgq="thread.id",Mgq="thread.name",Xgq="code.function",Pgq="code.namespace",Wgq="code.filepath",Dgq="code.lineno",fgq="http.method",Zgq="http.url",Ggq="http.target",vgq="http.host",Tgq="http.scheme",kgq="http.status_code",Vgq="http.flavor",Ngq="http.user_agent",ygq="http.request_content_length",Egq="http.request_content_length_uncompressed",Lgq="http.response_content_length",hgq="http.response_content_length_uncompressed",Rgq="http.server_name",Sgq="http.route",Cgq="http.client_ip",bgq="aws.dynamodb.table_names",xgq="aws.dynamodb.consumed_capacity",Igq="aws.dynamodb.item_collection_metrics",ugq="aws.dynamodb.provisioned_read_capacity",mgq="aws.dynamodb.provisioned_write_capacity",pgq="aws.dynamodb.consistent_read",Bgq="aws.dynamodb.projection",ggq="aws.dynamodb.limit",Fgq="aws.dynamodb.attributes_to_get",Ugq="aws.dynamodb.index_name",Qgq="aws.dynamodb.select",dgq="aws.dynamodb.global_secondary_indexes",cgq="aws.dynamodb.local_secondary_indexes",lgq="aws.dynamodb.exclusive_start_table",ngq="aws.dynamodb.table_count",igq="aws.dynamodb.scan_forward",rgq="aws.dynamodb.segment",ogq="aws.dynamodb.total_segments",agq="aws.dynamodb.count",sgq="aws.dynamodb.scanned_count",tgq="aws.dynamodb.attribute_definitions",egq="aws.dynamodb.global_secondary_index_updates",qFq="messaging.system",KFq="messaging.destination",_Fq="messaging.destination_kind",zFq="messaging.temp_destination",YFq="messaging.protocol",$Fq="messaging.protocol_version",OFq="messaging.url",AFq="messaging.message_id",wFq="messaging.conversation_id",jFq="messaging.message_payload_size_bytes",HFq="messaging.message_payload_compressed_size_bytes",JFq="messaging.operation",MFq="messaging.consumer_id",XFq="messaging.rabbitmq.routing_key",PFq="messaging.kafka.message_key",WFq="messaging.kafka.consumer_group",DFq="messaging.kafka.client_id",fFq="messaging.kafka.partition",ZFq="messaging.kafka.tombstone",GFq="rpc.system",vFq="rpc.service",TFq="rpc.method",kFq="rpc.grpc.status_code",VFq="rpc.jsonrpc.version",NFq="rpc.jsonrpc.request_id",yFq="rpc.jsonrpc.error_code",EFq="rpc.jsonrpc.error_message",LFq="message.type",hFq="message.id",RFq="message.compressed_size",SFq="message.uncompressed_size";
|
||
|
||
K[$]=decodeURIComponent(O)}return K}_isValid(q){return q.length<=this._MAX_LENGTH&&this._isBaggageOctetString(q)}_isBaggageOctetString(q){for(let K=0;K<q.length;K++){let _=q.charCodeAt(K);if(_<33||_===44||_===59||_===92||_>126)return!1}return!0}_isValidAndNotEmpty(q){return q.length>0&&this._isValid(q)}}Qiq.envDetector=new Uiq});var Il6=B((liq)=>{Object.defineProperty(liq,"__esModule",{value:!0});liq.ATTR_WEBENGINE_VERSION=liq.ATTR_WEBENGINE_NAME=liq.ATTR_WEBENGINE_DESCRIPTION=liq.ATTR_SERVICE_NAMESPACE=liq.ATTR_SERVICE_INSTANCE_ID=liq.ATTR_PROCESS_RUNTIME_VERSION=liq.ATTR_PROCESS_RUNTIME_NAME=liq.ATTR_PROCESS_RUNTIME_DESCRIPTION=liq.ATTR_PROCESS_PID=liq.ATTR_PROCESS_OWNER=liq.ATTR_PROCESS_EXECUTABLE_PATH=liq.ATTR_PROCESS_EXECUTABLE_NAME=liq.ATTR_PROCESS_COMMAND_ARGS=liq.ATTR_PROCESS_COMMAND=liq.ATTR_OS_VERSION=liq.ATTR_OS_TYPE=liq.ATTR_K8S_POD_NAME=liq.ATTR_K8S_NAMESPACE_NAME=liq.ATTR_K8S_DEPLOYMENT_NAME=liq.ATTR_K8S_CLUSTER_NAME=liq.ATTR_HOST_TYPE=liq.ATTR_HOST_NAME=liq.ATTR_HOST_IMAGE_VERSION=liq.ATTR_HOST_IMAGE_NAME=liq.ATTR_HOST_IMAGE_ID=liq.ATTR_HOST_ID=liq.ATTR_HOST_ARCH=liq.ATTR_CONTAINER_NAME=liq.ATTR_CONTAINER_IMAGE_TAGS=liq.ATTR_CONTAINER_IMAGE_NAME=liq.ATTR_CONTAINER_ID=liq.ATTR_CLOUD_REGION=liq.ATTR_CLOUD_PROVIDER=liq.ATTR_CLOUD_AVAILABILITY_ZONE=liq.ATTR_CLOUD_ACCOUNT_ID=void 0;liq.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";liq.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";liq.ATTR_CLOUD_PROVIDER="cloud.provider";liq.ATTR_CLOUD_REGION="cloud.region";liq.ATTR_CONTAINER_ID="container.id";liq.ATTR_CONTAINER_IMAGE_NAME="container.image.name";liq.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";liq.ATTR_CONTAINER_NAME="container.name";liq.ATTR_HOST_ARCH="host.arch";liq.ATTR_HOST_ID="host.id";liq.ATTR_HOST_IMAGE_ID="host.image.id";liq.ATTR_HOST_IMAGE_NAME="host.image.name";liq.ATTR_HOST_IMAGE_VERSION="host.image.version";liq.ATTR_HOST_NAME="host.name";liq.ATTR_HOST_TYPE="host.type";liq.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";liq.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";
|
||
|
||
(function(q){q[q.UNSPECIFIED=0]="UNSPECIFIED",q[q.TRACE=1]="TRACE",q[q.TRACE2=2]="TRACE2",q[q.TRACE3=3]="TRACE3",q[q.TRACE4=4]="TRACE4",q[q.DEBUG=5]="DEBUG",q[q.DEBUG2=6]="DEBUG2",q[q.DEBUG3=7]="DEBUG3",q[q.DEBUG4=8]="DEBUG4",q[q.INFO=9]="INFO",q[q.INFO2=10]="INFO2",q[q.INFO3=11]="INFO3",q[q.INFO4=12]="INFO4",q[q.WARN=13]="WARN",q[q.WARN2=14]="WARN2",q[q.WARN3=15]="WARN3",q[q.WARN4=16]="WARN4",q[q.ERROR=17]="ERROR",q[q.ERROR2=18]="ERROR2",q[q.ERROR3=19]="ERROR3",q[q.ERROR4=20]="ERROR4",q[q.FATAL=21]="FATAL",q[q.FATAL2=22]="FATAL2",q[q.FATAL3=23]="FATAL3",q[q.FATAL4=24]="FATAL4"})(qM_=Qrq.SeverityNumber||(Qrq.SeverityNumber={}))});var cZ8=B((crq)=>{Object.defineProperty(crq,"__esModule",{value:!0});crq.NOOP_LOGGER=crq.NoopLogger=void 0;class Ny1{emit(q){}}crq.NoopLogger=Ny1;crq.NOOP_LOGGER=new Ny1});var Ey1=B((nrq)=>{Object.defineProperty(nrq,"__esModule",{value:!0});nrq.NOOP_LOGGER_PROVIDER=nrq.NoopLoggerProvider=void 0;var _M_=cZ8();class yy1{getLogger(q,K,_){return new _M_.NoopLogger}}nrq.NoopLoggerProvider=yy1;nrq.NOOP_LOGGER_PROVIDER=new yy1});var srq=B((orq)=>{Object.defineProperty(orq,"__esModule",{value:!0});orq.ProxyLogger=void 0;var YM_=cZ8();class rrq{constructor(q,K,_,z){this._provider=q,this.name=K,this.version=_,this.options=z}emit(q){this._getLogger().emit(q)}_getLogger(){if(this._delegate)return this._delegate;let q=this._provider._getDelegateLogger(this.name,this.version,this.options);if(!q)return YM_.NOOP_LOGGER;return this._delegate=q,this._delegate}}orq.ProxyLogger=rrq});var Ly1=B((erq)=>{Object.defineProperty(erq,"__esModule",{value:!0});erq.ProxyLoggerProvider=void 0;var $M_=Ey1(),OM_=srq();class trq{getLogger(q,K,_){var z;return(z=this._getDelegateLogger(q,K,_))!==null&&z!==void 0?z:new OM_.ProxyLogger(this,q,K,_)}_getDelegate(){var q;return(q=this._delegate)!==null&&q!==void 0?q:$M_.NOOP_LOGGER_PROVIDER}_setDelegate(q){this._delegate=q}_getDelegateLogger(q,K,_){var z;return(z=this._delegate)===null||z===void 0?void 0:z.getLogger(q,K,_)}}erq.ProxyLoggerProvider=trq});
|
||
|
||
this.retryFileInBackground(z)}}catch(q){j6(q)}}async retryFileInBackground(q){if(this.attempts>=this.maxAttempts){await this.deleteFile(q);return}let K=await this.loadEventsFromFile(q);if(K.length===0){await this.deleteFile(q);return}let _=await this.sendEventsInBatches(K);if(_.length===0)await this.deleteFile(q);else await this.saveEventsToFile(q,_)}async export(q,K){if(this.isShutdown){K({code:o16.ExportResultCode.FAILED,error:Error("Exporter has been shutdown")});return}let _=this.doExport(q,K);this.pendingExports.push(_),_.finally(()=>{let z=this.pendingExports.indexOf(_);if(z>-1)this.pendingExports.splice(z,1)})}async doExport(q,K){try{let _=q.filter(($)=>$.instrumentationScope?.name==="com.anthropic.claude_code.events");if(_.length===0){K({code:o16.ExportResultCode.SUCCESS});return}let z=this.transformLogsToEvents(_).events;if(z.length===0){K({code:o16.ExportResultCode.SUCCESS});return}if(this.attempts>=this.maxAttempts){K({code:o16.ExportResultCode.FAILED,error:Error(`Dropped ${z.length} events: max attempts (${this.maxAttempts}) reached`)});return}let Y=await this.sendEventsInBatches(z);if(this.attempts++,Y.length>0){await this.queueFailedEvents(Y),this.scheduleBackoffRetry();let $=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:"";K({code:o16.ExportResultCode.FAILED,error:Error(`Failed to export ${Y.length} events${$}`)});return}if(this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying)this.retryFailedEvents();K({code:o16.ExportResultCode.SUCCESS})}catch(_){j6(_),K({code:o16.ExportResultCode.FAILED,error:m1(_)})}}async sendEventsInBatches(q){let K=[];for(let Y=0;Y<q.length;Y+=this.maxBatchSize)K.push(q.slice(Y,Y+this.maxBatchSize));let _=[],z;for(let Y=0;Y<K.length;Y++){let $=K[Y];try{await this.sendBatchWithRetry({events:$})}catch(O){z=bX_(O);for(let A=Y;A<K.length;A++)_.push(...K[A]);break}if(Y<K.length-1&&this.batchDelayMs>0)await C7(this.batchDelayMs)}if(_.length>0&&z)this.lastExportErrorContext=z;
|
||
|
||
return _}async queueFailedEvents(q){let K=this.getCurrentBatchFilePath();await this.appendEventsToFile(K,q);let _=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:"",z=`1P event logging: ${q.length} events failed to export${_}`;j6(Error(z))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let q=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},q)}async retryFailedEvents(){let q=this.getCurrentBatchFilePath();while(!this.isShutdown){let K=await this.loadEventsFromFile(q);if(K.length===0)break;if(this.attempts>=this.maxAttempts){await this.deleteFile(q),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(q);let _=await this.sendEventsInBatches(K);if(this.attempts++,this.isRetrying=!1,_.length>0){await this.saveEventsToFile(q,_),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){if(this.attempts=0,this.cancelBackoff)this.cancelBackoff(),this.cancelBackoff=null}async sendBatchWithRetry(q){if(this.isKilled())throw Error("firstParty sink killswitch active");let K={"Content-Type":"application/json","User-Agent":M$(),"x-service-name":"claude-code"},_=KO()||g7(),z=this.skipAuth||!_;if(!z&&i7()){let A=t7();if(!OD())z=!0;else if(A&&tg(A.expiresAt))z=!0}let Y=z?{headers:{},error:"trust not established or Oauth token expired"}:EJ(),$=!Y.error,O=$?{...K,...Y.headers}:K;try{let A=await O1.post(this.endpoint,q,{timeout:this.timeout,headers:O});this.logSuccess(q.events.length,$,A.data);return}catch(A){if($&&O1.isAxiosError(A)&&A.response?.status===401){let w=await O1.post(this.endpoint,q,{timeout:this.timeout,headers:K});this.logSuccess(q.events.length,!1,w.data);return}throw A}}logSuccess(q,K,_){}hrTimeToDate(q){let[K,_]=q;return new Date(K*1000+_/1e6)}transformLogsToEvents(q){let K=[];for(let _ of q){let z=_.attributes||{};
|
||
|
||
let $=z.cachedGrowthBookFeatures?.[q];if($!==void 0)return Boolean($);return!1}async function ZN(q){let K=Nv6();if(K&&q in K)return Boolean(K[q]);let _=yv6();if(_&&q in _)return Boolean(_[q]);if(!Or())return!1;if(w8().cachedGrowthBookFeatures?.[q]===!0){if(EO6.has(q))ll6(q);else kv6.add(q);return!0}return taq(q,!1,!0)}function LO6(){if(!Or())return;try{nl6(),Vv6.emit(),dl6=Ar().catch((q)=>{return j6(m1(q)),null}).finally(()=>{dl6=null})}catch(q){j6(m1(q))}}function nl6(){if(AE1(),Ul6)process.off("beforeExit",Ul6),Ul6=null;if(Ql6)process.off("exit",Ql6),Ql6=null;$r?.destroy(),$r=null,$E1=!1,dl6=null,EO6.clear(),kv6.clear(),_E1.clear(),wC.clear(),YE1.cache?.clear?.(),Ar.cache?.clear?.(),iaq=null,zE1=!1}async function eaq(){if(!Or())return;try{let q=await Ar();if(!q)return;if(await q.refreshFeatures(),q!==$r)return;let K=await raq(q);if(q!==$r)return;if(K)oaq(),Vv6.emit()}catch(q){j6(m1(q))}}function qsq(){if(!Or())return;if(yO6)clearInterval(yO6);if(yO6=setInterval(()=>{eaq()},iX_),yO6.unref?.(),!Tv6)Tv6=()=>{AE1()},process.once("beforeExit",Tv6)}function AE1(){if(yO6)clearInterval(yO6),yO6=null;if(Tv6)process.removeListener("beforeExit",Tv6),Tv6=null}async function jC(q,K){return w08(q,K)}function UG(q,K){return L8(q,K)}var $r=null,Ul6=null,Ql6=null,$E1=!1,EO6,wC,kv6,_E1,dl6=null,Vv6,iaq=null,zE1=!1,YE1,Ar,iX_=21600000,yO6=null,Tv6=null;var l1=L(()=>{JL7();KD6();T8();XL7();k1();_8();E8();pG();h8();r8();zO6();Yr();EO6=new Map,wC=new Map,kv6=new Set,_E1=new Set,Vv6=L_();YE1=$1(()=>{if(!Or())return null;let q=saq(),K=ML7(),_="https://api.anthropic.com/",Y=KO()||PP6()||g7()?EJ():{headers:{},error:"trust not established"},$=!Y.error;$E1=$;let O=new uO8({apiHost:_,clientKey:K,attributes:q,remoteEval:!0,cacheKeyAttributes:["id","organizationUUID"],...Y.error?{}:{apiHostRequestHeaders:Y.headers},...{}});if($r=O,!$)return{client:O,initialized:Promise.resolve()};let A=O.init({timeout:5000}).then(async(w)=>{if($r!==O)return;let j=await raq(O);if($r!==O)return;if(j){for(let H of kv6)ll6(H);
|
||
|
||
if(G!==Z&&Mk8(f,G)){j7(`[Sandbox Linux] Skipping symlink write path pointing outside expected location: ${D} -> ${G}`);continue}}catch{j7(`[Sandbox Linux] Skipping write path that could not be resolved: ${f}`);continue}O.push("--bind",f,f),A.push(f)}let P=[...K.denyWithinAllow||[],...await rI_(_,z,Y,$)],W=new Set;for(let D of P){let f=RN(D);if(W.has(f))continue;if(W.add(f),f.startsWith("/dev/"))continue;let G=lI_(f,A);if(G){w.push("--ro-bind","/dev/null",G),j7(`[Sandbox Linux] Mounted /dev/null at symlink ${G} to prevent symlink replacement attack`);continue}if(!BO.existsSync(f)){if(nI_(f)){j7(`[Sandbox Linux] Skipping deny path with file ancestor (cannot create paths under a file): ${f}`);continue}let v=pX.dirname(f);while(v!=="/"&&!BO.existsSync(v))v=pX.dirname(v);if(A.some((V)=>v.startsWith(V+"/")||v===V||f.startsWith(V+"/"))){let V=iI_(f);if(V!==f){let y=BO.mkdtempSync(pX.join(iC1(),"claude-empty-"));w.push("--ro-bind",y,V),Dk8.add(V),oC1(),j7(`[Sandbox Linux] Mounted empty dir at ${V} to block creation of ${f}`)}else w.push("--ro-bind","/dev/null",V),Dk8.add(V),oC1(),j7(`[Sandbox Linux] Mounted /dev/null at ${V} to block creation of ${f}`)}else j7(`[Sandbox Linux] Skipping non-existent deny path not within allowed paths: ${f}`);continue}if(A.some((v)=>f.startsWith(v+"/")||f===v))w.push("--ro-bind",f,f);else j7(`[Sandbox Linux] Skipping deny path not within allowed paths: ${f}`)}}else O.push("--bind","/","/");let j=[],H=(q?.allowWithinDeny||[]).map((P)=>RN(P)),J=new Set,M=new Set(["proc","dev","sys"]);for(let P of q?.denyOnly||[])if(RN(P)==="/"){for(let W of BO.readdirSync("/"))if(!M.has(W))j.push("/"+W)}else j.push(P);if(BO.existsSync("/etc/ssh/ssh_config.d"))j.push("/etc/ssh/ssh_config.d");let X=j.map((P)=>RN(P)).sort((P,W)=>P.split("/").length-W.split("/").length);for(let P of X){if(!BO.existsSync(P)){j7(`[Sandbox Linux] Skipping non-existent read deny path: ${P}`);continue}let W=P==="/"?"/":P+"/";if(BO.statSync(P).isDirectory()){O.push("--tmpfs",P);
|
||
|
||
cb1=IE({command:r7(),args:jJ(r7()).optional(),env:MI(r7(),r7()).optional()}),_Y4=IE({name:r7(),email:r7().email().optional(),url:r7().url().optional()}),zY4=IE({type:r7(),url:r7().url()}),YY4=cb1.partial(),$Y4=cb1.extend({platform_overrides:MI(r7(),YY4).optional()}),OY4=IE({type:XI(["python","node","binary"]),entry_point:r7(),mcp_config:$Y4}),AY4=IE({claude_desktop:r7().optional(),platforms:jJ(XI(["darwin","win32","linux"])).optional(),runtimes:IE({python:r7().optional(),node:r7().optional()}).optional()}).passthrough(),wY4=IE({name:r7(),description:r7().optional()}),jY4=IE({name:r7(),description:r7().optional(),arguments:jJ(r7()).optional(),text:r7()}),HY4=IE({type:XI(["string","number","boolean","directory","file"]),title:r7(),description:r7(),required:cW().optional(),default:A_6([r7(),VR(),cW(),jJ(r7())]).optional(),multiple:cW().optional(),sensitive:cW().optional(),min:VR().optional(),max:VR().optional()}),Kp_=MI(r7(),A_6([r7(),VR(),cW(),jJ(r7())])),Zr6=IE({$schema:r7().optional(),dxt_version:r7().optional().describe("@deprecated Use manifest_version instead"),manifest_version:r7().optional(),name:r7(),display_name:r7().optional(),version:r7(),description:r7(),long_description:r7().optional(),author:_Y4,repository:zY4.optional(),homepage:r7().url().optional(),documentation:r7().url().optional(),support:r7().url().optional(),icon:r7().optional(),screenshots:jJ(r7()).optional(),server:OY4,tools:jJ(wY4).optional(),tools_generated:cW().optional(),prompts:jJ(jY4).optional(),prompts_generated:cW().optional(),keywords:jJ(r7()).optional(),license:r7().optional(),privacy_policies:jJ(r7()).optional(),compatibility:AY4.optional(),user_config:MI(r7(),HY4).optional()}).refine((q)=>!!(q.dxt_version||q.manifest_version),{message:"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided"}),_p_=IE({status:XI(["signed","unsigned","self-signed"]),publisher:r7().optional(),issuer:r7().optional(),valid_from:r7().optional(),valid_to:r7().optional(),fingerprint:r7().optional()})});
|
||
|
||
oH4=xE({command:r7(),args:jJ(r7()).optional(),env:MI(r7(),r7()).optional()}),sl_=xE({name:r7(),email:r7().email().optional(),url:r7().url().optional()}),tl_=xE({type:r7(),url:r7().url()}),el_=oH4.partial(),qn_=oH4.extend({platform_overrides:MI(r7(),el_).optional()}),Kn_=xE({type:XI(["python","node","binary"]),entry_point:r7(),mcp_config:qn_}),_n_=xE({claude_desktop:r7().optional(),platforms:jJ(XI(["darwin","win32","linux"])).optional(),runtimes:xE({python:r7().optional(),node:r7().optional()}).optional()}).passthrough(),zn_=xE({name:r7(),description:r7().optional()}),Yn_=xE({name:r7(),description:r7().optional(),arguments:jJ(r7()).optional(),text:r7()}),$n_=xE({type:XI(["string","number","boolean","directory","file"]),title:r7(),description:r7(),required:cW().optional(),default:A_6([r7(),VR(),cW(),jJ(r7())]).optional(),multiple:cW().optional(),sensitive:cW().optional(),min:VR().optional(),max:VR().optional()}),htO=MI(r7(),A_6([r7(),VR(),cW(),jJ(r7())])),aH4=xE({$schema:r7().optional(),dxt_version:r7().optional().describe("@deprecated Use manifest_version instead"),manifest_version:r7().optional(),name:r7(),display_name:r7().optional(),version:r7(),description:r7(),long_description:r7().optional(),author:sl_,repository:tl_.optional(),homepage:r7().url().optional(),documentation:r7().url().optional(),support:r7().url().optional(),icon:r7().optional(),screenshots:jJ(r7()).optional(),server:Kn_,tools:jJ(zn_).optional(),tools_generated:cW().optional(),prompts:jJ(Yn_).optional(),prompts_generated:cW().optional(),keywords:jJ(r7()).optional(),license:r7().optional(),compatibility:_n_.optional(),user_config:MI(r7(),$n_).optional()}).refine((q)=>!!(q.dxt_version||q.manifest_version),{message:"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided"}),RtO=xE({status:XI(["signed","unsigned","self-signed"]),publisher:r7().optional(),issuer:r7().optional(),valid_from:r7().optional(),valid_to:r7().optional(),fingerprint:r7().optional()})});import{existsSync as Pu1,readFileSync as On_,statSync as tH4}from"fs";
|
||
|
||
return`You are a file search specialist for Claude Code, Anthropic's official CLI for Claude. You excel at thoroughly navigating and exploring codebases.
|
||
|
||
=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===
|
||
This is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:
|
||
- Creating new files (no Write, touch, or file creation of any kind)
|
||
- Modifying existing files (no Edit operations)
|
||
- Deleting files (no rm or deletion)
|
||
- Moving or copying files (no mv or cp)
|
||
- Creating temporary files anywhere, including /tmp
|
||
- Using redirect operators (>, >>, |) or heredocs to write to files
|
||
- Running ANY commands that change system state
|
||
|
||
Your role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.
|
||
|
||
Your strengths:
|
||
- Rapidly finding files using glob patterns
|
||
- Searching code and text with powerful regex patterns
|
||
- Reading and analyzing file contents
|
||
|
||
Guidelines:
|
||
${K}
|
||
${_}
|
||
- Use ${pq} when you know the specific file path you need to read
|
||
- Use ${Yq} ONLY for read-only operations (ls, git status, git log, git diff, find${q?", grep":""}, cat, head, tail)
|
||
- NEVER use ${Yq} for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
|
||
- Adapt your search approach based on the thoroughness level specified by the caller
|
||
- Communicate your final report directly as a regular message - do NOT attempt to create files
|
||
|
||
NOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:
|
||
- Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations
|
||
- Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files
|
||
|
||
Complete the user's search request efficiently and report your findings clearly.`}var EJ4=3,Bn_='Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.',LU;
|
||
|
||
else _($)})})}hD4.exports=(q)=>{Object.assign(q.prototype,{toFile:ve_,toBuffer:Te_,keepExif:ke_,withExif:Ve_,withExifMerge:Ne_,keepIccProfile:ye_,withIccProfile:Ee_,keepXmp:Le_,withXmp:he_,keepMetadata:Re_,withMetadata:Se_,toFormat:Ce_,jpeg:be_,jp2:me_,png:xe_,webp:Ie_,tiff:pe_,avif:Be_,heif:ge_,jxl:Fe_,gif:ue_,raw:Ue_,tile:Qe_,timeout:de_,_updateFormatOut:ce_,_setBooleanOption:le_,_read:ne_,_pipeline:ie_})}});var xD4=B((T5A,bD4)=>{/*!
|
||
Copyright 2013 Lovell Fuller and others.
|
||
SPDX-License-Identifier: Apache-2.0
|
||
*/var re_=U6("node:events"),hy8=Py8(),_b=BU(),{runtimePlatformArch:oe_}=Qm1(),Mk=qa6(),SD4=oe_(),qp1=Mk.libvipsVersion(),Bq6=Mk.format();Bq6.heif.output.alias=["avif","heic"];Bq6.jpeg.output.alias=["jpe","jpg"];Bq6.tiff.output.alias=["tif"];Bq6.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var ae_={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},lV6={vips:qp1.semver};if(!qp1.isGlobal)if(!qp1.isWasm)try{lV6=U6(`@img/sharp-${SD4}/versions`)}catch(q){try{lV6=U6(`@img/sharp-libvips-${SD4}/versions`)}catch(K){}}else try{lV6=(()=>{throw new Error("Cannot require module "+"@img/sharp-wasm32/versions");})()}catch(q){}lV6.sharp=Fm1().version;if(lV6.heif&&Bq6.heif)Bq6.heif.input.fileSuffix=[".avif"],Bq6.heif.output.alias=["avif"];function CD4(q){if(_b.bool(q))if(q)return Mk.cache(50,20,100);else return Mk.cache(0,0,0);else if(_b.object(q))return Mk.cache(q.memory,q.files,q.items);else return Mk.cache()}CD4(!0);function se_(q){return Mk.concurrency(_b.integer(q)?q:null)}if(hy8.familySync()===hy8.GLIBC&&!Mk._isUsingJemalloc())Mk.concurrency(1);else if(hy8.familySync()===hy8.MUSL&&Mk.concurrency()===1024)Mk.concurrency(U6("node:os").availableParallelism());var te_=new re_.EventEmitter;function ee_(){return Mk.counters()}function q6z(q){return Mk.simd(_b.bool(q)?q:null)}function K6z(q){if(_b.object(q))if(Array.isArray(q.operation)&&q.operation.every(_b.string))Mk.block(q.operation,!0);
|
||
|
||
var nk4=B((LYA,lk4)=>{function nKz(q){return{name:"Processing",keywords:{keyword:"BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color double float int long String Array FloatDict FloatList IntDict IntList JSONArray JSONObject Object StringDict StringList Table TableRow XML false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",literal:"P2D P3D HALF_PI PI QUARTER_PI TAU TWO_PI",title:"setup draw",built_in:"displayHeight displayWidth mouseY mouseX mousePressed pmouseX pmouseY key keyCode pixels focused frameCount frameRate height width size createGraphics beginDraw createShape loadShape PShape arc ellipse line point quad rect triangle bezier bezierDetail bezierPoint bezierTangent curve curveDetail curvePoint curveTangent curveTightness shape shapeMode beginContour beginShape bezierVertex curveVertex endContour endShape quadraticVertex vertex ellipseMode noSmooth rectMode smooth strokeCap strokeJoin strokeWeight mouseClicked mouseDragged mouseMoved mousePressed mouseReleased mouseWheel keyPressed keyPressedkeyReleased keyTyped print println save saveFrame day hour millis minute month second year background clear colorMode fill noFill noStroke stroke alpha blue brightness color green hue lerpColor red saturation modelX modelY modelZ screenX screenY screenZ ambient emissive shininess specular add createImage beginCamera camera endCamera frustum ortho perspective printCamera printProjection cursor frameRate noCursor exit loop noLoop popStyle pushStyle redraw binary boolean byte char float hex int str unbinary unhex join match matchAll nf nfc nfp nfs split splitTokens trim append arrayCopy concat expand reverse shorten sort splice subset box sphere sphereDetail createInput createReader loadBytes loadJSONArray loadJSONObject loadStrings loadTable loadXML open parseXML saveTable selectFolder selectInput beginRaw beginRecord createOutput createWriter endRaw endRecord PrintWritersaveBytes saveJSONArray saveJSONObject saveStream saveStrings saveXML selectOutput popMatrix printMatrix pushMatrix resetMatrix rotate rotateX rotateY rotateZ scale shearX shearY translate ambientLight directionalLight lightFalloff lights lightSpecular noLights normal pointLight spotLight image imageMode loadImage noTint requestImage tint texture textureMode textureWrap blend copy filter get loadPixels set updatePixels blendMode loadShader PShaderresetShader shader createFont loadFont text textFont textAlign textLeading textMode textSize textWidth textAscent textDescent abs ceil constrain dist exp floor lerp log mag map max min norm pow round sq sqrt acos asin atan atan2 cos degrees radians sin tan noise noiseDetail noiseSeed random randomGaussian randomSeed"},contains:[q.C_LINE_COMMENT_MODE,q.C_BLOCK_COMMENT_MODE,q.APOS_STRING_MODE,q.QUOTE_STRING_MODE,q.C_NUMBER_MODE]}}lk4.exports=nKz});
|
||
|
||
if(Y!==null){let $=q.get(`anthropic-ratelimit-unified-${_}-utilization`),O=q.get(`anthropic-ratelimit-unified-${_}-reset`),A=$?Number($):void 0;return{status:"allowed_warning",resetsAt:O?Number(O):void 0,rateLimitType:z,utilization:A,unifiedRateLimitFallbackAvailable:K,isUsingOverage:!1,surpassedThreshold:Number(Y)}}}return null}function DAz(q,K,_){let{rateLimitType:z,claimAbbrev:Y,windowSeconds:$,thresholds:O}=K,A=q.get(`anthropic-ratelimit-unified-${Y}-utilization`),w=q.get(`anthropic-ratelimit-unified-${Y}-reset`);if(A===null||w===null)return null;let j=Number(A),H=Number(w),J=XAz(H,$);if(!O.some((X)=>j>=X.utilization&&J<=X.timePct))return null;return{status:"allowed_warning",resetsAt:H,rateLimitType:z,utilization:j,unifiedRateLimitFallbackAvailable:_,isUsingOverage:!1}}function fAz(q,K){let _=WAz(q,K);if(_)return _;for(let z of JAz){let Y=DAz(q,z,K);if(Y)return Y}return null}function Wh4(q){let K=q.get("anthropic-ratelimit-unified-status")||"allowed",_=q.get("anthropic-ratelimit-unified-reset"),z=_?Number(_):void 0,Y=q.get("anthropic-ratelimit-unified-fallback")==="available",$=q.get("anthropic-ratelimit-unified-representative-claim"),O=q.get("anthropic-ratelimit-unified-overage-status"),A=q.get("anthropic-ratelimit-unified-overage-reset"),w=A?Number(A):void 0,j=q.get("anthropic-ratelimit-unified-overage-disabled-reason"),H=q.get("anthropic-ratelimit-unified-upgrade-paths"),J=H?H.split(",").map((P)=>P.trim()):void 0,M=K==="rejected"&&(O==="allowed"||O==="allowed_warning"),X=K;if(K==="allowed"||K==="allowed_warning"){let P=fAz(q,Y);if(P)return{...P,...J&&{upgradePaths:J}};X="allowed"}return{status:X,resetsAt:z,unifiedRateLimitFallbackAvailable:Y,...$&&{rateLimitType:$},...O&&{overageStatus:O},...w&&{overageResetsAt:w},...j&&{overageDisabledReason:j},...J&&{upgradePaths:J},isUsingOverage:M}}function Dh4(q){let K=q.get("anthropic-ratelimit-unified-overage-disabled-reason")??null;if(w8().cachedExtraUsageDisabledReason!==K)S8((z)=>({...z,cachedExtraUsageDisabledReason:K}))}function Jg1(q){let K=i7();
|
||
|
||
var Nh4=L(()=>{NAz=new Set(["package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lockb","bun.lock","composer.lock","gemfile.lock","cargo.lock","poetry.lock","pipfile.lock","shrinkwrap.json","npm-shrinkwrap.json"]),kh4=new Set([".lock",".min.js",".min.css",".min.html",".bundle.js",".bundle.css",".generated.ts",".generated.js",".d.ts"]),yAz=["/dist/","/build/","/out/","/output/","/node_modules/","/vendor/","/vendored/","/third_party/","/third-party/","/external/","/.next/","/.nuxt/","/.svelte-kit/","/coverage/","/__pycache__/","/.tox/","/venv/","/.venv/","/target/release/","/target/debug/"],EAz=[/^.*\.min\.[a-z]+$/i,/^.*-min\.[a-z]+$/i,/^.*\.bundle\.[a-z]+$/i,/^.*\.generated\.[a-z]+$/i,/^.*\.gen\.[a-z]+$/i,/^.*\.auto\.[a-z]+$/i,/^.*_generated\.[a-z]+$/i,/^.*_gen\.[a-z]+$/i,/^.*\.pb\.(go|js|ts|py|rb)$/i,/^.*_pb2?\.py$/i,/^.*\.pb\.h$/i,/^.*\.grpc\.[a-z]+$/i,/^.*\.swagger\.[a-z]+$/i,/^.*\.openapi\.[a-z]+$/i]});import{stat as LAz}from"fs/promises";import{isAbsolute as AwA,join as hAz,relative as wwA,sep as jwA}from"path";function KL8(){let q=Z8();return FY(q)??z7()}function Eh4(){return ia6==="internal"}function hh4(q){if(q.includes("opus-4-6"))return"claude-opus-4-6";if(q.includes("opus-4-5"))return"claude-opus-4-5";if(q.includes("opus-4-1"))return"claude-opus-4-1";if(q.includes("opus-4"))return"claude-opus-4";if(q.includes("sonnet-4-6"))return"claude-sonnet-4-6";if(q.includes("sonnet-4-5"))return"claude-sonnet-4-5";if(q.includes("sonnet-4"))return"claude-sonnet-4";if(q.includes("sonnet-3-7"))return"claude-sonnet-3-7";if(q.includes("haiku-4-5"))return"claude-haiku-4-5";if(q.includes("haiku-3-5"))return"claude-haiku-3-5";
|
||
|
||
RAz=["github.com:anthropics/claude-cli-internal","github.com/anthropics/claude-cli-internal","github.com:anthropics/anthropic","github.com/anthropics/anthropic","github.com:anthropics/apps","github.com/anthropics/apps","github.com:anthropics/casino","github.com/anthropics/casino","github.com:anthropics/dbt","github.com/anthropics/dbt","github.com:anthropics/dotfiles","github.com/anthropics/dotfiles","github.com:anthropics/terraform-config","github.com/anthropics/terraform-config","github.com:anthropics/hex-export","github.com/anthropics/hex-export","github.com:anthropics/feedback-v2","github.com/anthropics/feedback-v2","github.com:anthropics/labs","github.com/anthropics/labs","github.com:anthropics/argo-rollouts","github.com/anthropics/argo-rollouts","github.com:anthropics/starling-configs","github.com/anthropics/starling-configs","github.com:anthropics/ts-tools","github.com/anthropics/ts-tools","github.com:anthropics/ts-capsules","github.com/anthropics/ts-capsules","github.com:anthropics/feldspar-testing","github.com/anthropics/feldspar-testing","github.com:anthropics/trellis","github.com/anthropics/trellis","github.com:anthropics/claude-for-hiring","github.com/anthropics/claude-for-hiring","github.com:anthropics/forge-web","github.com/anthropics/forge-web","github.com:anthropics/infra-manifests","github.com/anthropics/infra-manifests","github.com:anthropics/mycro_manifests","github.com/anthropics/mycro_manifests","github.com:anthropics/mycro_configs","github.com/anthropics/mycro_configs","github.com:anthropics/mobile-apps","github.com/anthropics/mobile-apps"];Lh4=j66(async()=>{if(ia6!==null)return ia6==="internal";let q=KL8(),K=await pA8(q);if(!K)return ia6="none",!1;let _=RAz.some((z)=>K.includes(z));return ia6=_?"internal":"external",_})});function lw6(){let q=(fY(),hq(ry1)),K=q.isTeammate()&&q.isPlanModeRequired()?"plan":"default";
|
||
|
||
return JF1(q,{metadata:K,tokenRequestParams:j,clientInformation:_,addClientAuthentication:A,resource:O,fetchFn:w})}async function MF1(q,{metadata:K,clientInformation:_,refreshToken:z,resource:Y,addClientAuthentication:$,fetchFn:O}){let A=new URLSearchParams({grant_type:"refresh_token",refresh_token:z}),w=await JF1(q,{metadata:K,tokenRequestParams:A,clientInformation:_,addClientAuthentication:$,resource:Y,fetchFn:O});return{refresh_token:z,...w}}async function E2z(q,K,{metadata:_,resource:z,authorizationCode:Y,fetchFn:$}={}){let O=q.clientMetadata.scope,A;if(q.prepareTokenRequest)A=await q.prepareTokenRequest(O);if(!A){if(!Y)throw Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!q.redirectUrl)throw Error("redirectUrl is required for authorization_code flow");let j=await q.codeVerifier();A=bR4(Y,j,q.redirectUrl)}let w=await q.clientInformation();return JF1(K,{metadata:_,tokenRequestParams:A,clientInformation:w??void 0,addClientAuthentication:q.addClientAuthentication,resource:z,fetchFn:$})}async function L2z(q,{metadata:K,clientMetadata:_,fetchFn:z}){let Y;if(K){if(!K.registration_endpoint)throw Error("Incompatible auth server: does not support dynamic client registration");Y=new URL(K.registration_endpoint)}else Y=new URL("/register",q);let $=await(z??fetch)(Y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(!$.ok)throw await CR4($);return ER4.parse(await $.json())}var pD,YF1="code",$F1="S256";var q26=L(()=>{VR4();HX();Ds6();Ds6();zF1();pD=class pD extends Error{constructor(q){super(q??"Unauthorized")}}});class UL8{constructor(q,K){this._url=q,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=K?.eventSourceInit,this._requestInit=K?.requestInit,this._authProvider=K?.authProvider,this._fetch=K?.fetch,this._fetchWithInit=tw6(K?.fetch,K?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new pD("No auth provider");let q;
|
||
|
||
try{q=await Mb(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(K){throw this.onerror?.(K),K}if(q!=="AUTHORIZED")throw new pD;return await this._startOrAuth()}async _commonHeaders(){let q={};if(this._authProvider){let _=await this._authProvider.tokens();if(_)q.Authorization=`Bearer ${_.access_token}`}if(this._protocolVersion)q["mcp-protocol-version"]=this._protocolVersion;let K=FN6(this._requestInit?.headers);return new Headers({...q,...K})}_startOrAuth(){let q=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((K,_)=>{this._eventSource=new gN6(this._url.href,{...this._eventSourceInit,fetch:async(z,Y)=>{let $=await this._commonHeaders();$.set("Accept","text/event-stream");let O=await q(z,{...Y,headers:$});if(O.status===401&&O.headers.has("www-authenticate")){let{resourceMetadataUrl:A,scope:w}=nN6(O);this._resourceMetadataUrl=A,this._scope=w}return O}}),this._abortController=new AbortController,this._eventSource.onerror=(z)=>{if(z.code===401&&this._authProvider){this._authThenStart().then(K,_);return}let Y=new IR4(z.code,z.message,z);_(Y),this.onerror?.(Y)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",(z)=>{let Y=z;try{if(this._endpoint=new URL(Y.data,this._url),this._endpoint.origin!==this._url.origin)throw Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch($){_($),this.onerror?.($),this.close();return}K()}),this._eventSource.onmessage=(z)=>{let Y=z,$;try{$=PI.parse(JSON.parse(Y.data))}catch(O){this.onerror?.(O);return}this.onmessage?.($)}})}async start(){if(this._eventSource)throw Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(q){if(!this._authProvider)throw new pD("No auth provider");
|
||
|
||
let K=this._reconnectionOptions.initialReconnectionDelay,_=this._reconnectionOptions.reconnectionDelayGrowFactor,z=this._reconnectionOptions.maxReconnectionDelay;return Math.min(K*Math.pow(_,q),z)}_scheduleReconnection(q,K=0){let _=this._reconnectionOptions.maxRetries;if(K>=_){this.onerror?.(Error(`Maximum reconnection attempts (${_}) exceeded.`));return}let z=this._getNextReconnectionDelay(K);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(q).catch((Y)=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${Y instanceof Error?Y.message:String(Y)}`)),this._scheduleReconnection(q,K+1)})},z)}_handleSseStream(q,K,_){if(!q)return;let{onresumptiontoken:z,replayMessageId:Y}=K,$,O=!1,A=!1;(async()=>{try{let j=q.pipeThrough(new TextDecoderStream).pipeThrough(new PF1({onRetry:(M)=>{this._serverRetryMs=M}})).getReader();while(!0){let{value:M,done:X}=await j.read();if(X)break;if(M.id)$=M.id,O=!0,z?.(M.id);if(!M.data)continue;if(!M.event||M.event==="message")try{let P=PI.parse(JSON.parse(M.data));if(D_6(P)){if(A=!0,Y!==void 0)P.id=Y}this.onmessage?.(P)}catch(P){this.onerror?.(P)}}if((_||O)&&!A&&this._abortController&&!this._abortController.signal.aborted)this._scheduleReconnection({resumptionToken:$,onresumptiontoken:z,replayMessageId:Y},0)}catch(j){if(this.onerror?.(Error(`SSE stream disconnected: ${j}`)),(_||O)&&!A&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:$,onresumptiontoken:z,replayMessageId:Y},0)}catch(M){this.onerror?.(Error(`Failed to reconnect: ${M instanceof Error?M.message:String(M)}`))}}})()}async start(){if(this._abortController)throw Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(q){if(!this._authProvider)throw new pD("No auth provider");
|
||
|
||
_.push({browser:z,path:Db(O,...Y.windows.dataPath)})}continue}}if($&&$.length>0)_.push({browser:z,path:Db(K,...$)})}return _}function yC4(){let q=v1(),K=QF1(),_=[];for(let z of Eh8){let Y=Cs6[z];switch(q){case"macos":if(Y.macos.nativeMessagingPath.length>0)_.push({browser:z,path:Db(K,...Y.macos.nativeMessagingPath)});break;case"linux":case"wsl":if(Y.linux.nativeMessagingPath.length>0)_.push({browser:z,path:Db(K,...Y.linux.nativeMessagingPath)});break;case"windows":break}}return _}function EC4(){let q=[];for(let K of Eh8){let _=Cs6[K];if(_.windows.registryKey)q.push({browser:K,key:_.windows.registryKey})}return q}async function XJz(){let q=v1();for(let K of Eh8){let _=Cs6[K];switch(q){case"macos":{let z=`/Applications/${_.macos.appName}.app`;try{if((await kC4(z)).isDirectory())return N(`[Claude in Chrome] Detected browser: ${_.name}`),K}catch(Y){if(!S9(Y))throw Y}break}case"wsl":case"linux":{for(let z of _.linux.binaries)if(await uA(z).catch(()=>null))return N(`[Claude in Chrome] Detected browser: ${_.name}`),K;break}case"windows":{let z=QF1();if(_.windows.dataPath.length>0){let Y=_.windows.useRoaming?Db(z,"AppData","Roaming"):Db(z,"AppData","Local"),$=Db(Y,..._.windows.dataPath);try{if((await kC4($)).isDirectory())return N(`[Claude in Chrome] Detected browser: ${_.name}`),K}catch(O){if(!S9(O))throw O}}break}}}return null}function H26(q){return V2(q)===fb}function LC4(q){if(yh8.size>=PJz&&!yh8.has(q))yh8.clear();yh8.add(q)}async function Lh8(q){let K=v1(),_=await XJz();if(!_)return N("[Claude in Chrome] No compatible browser found"),!1;let z=Cs6[_];switch(K){case"macos":{let{code:Y}=await K1("open",["-a",z.macos.appName,q]);return Y===0}case"windows":{let{code:Y}=await K1("rundll32",["url,OpenURL",q]);return Y===0}case"wsl":case"linux":{for(let Y of z.linux.binaries){let{code:$}=await K1(Y,[q]);if($===0)return!0}return!1}default:return!1}}function bs6(){return`/tmp/claude-mcp-browser-bridge-${dF1()}`}function hh8(){if(VC4()==="win32")return`\\\\.\\pipe\\${RC4()}`;
|
||
|
||
return Db(bs6(),`${process.pid}.sock`)}function hC4(){if(VC4()==="win32")return[`\\\\.\\pipe\\${RC4()}`];let q=[],K=bs6();try{let $=HJz(K);for(let O of $)if(O.endsWith(".sock"))q.push(Db(K,O))}catch{}let _=`claude-mcp-browser-bridge-${dF1()}`,z=Db(JJz(),_),Y=`/tmp/${_}`;if(!q.includes(z))q.push(z);if(z!==Y&&!q.includes(Y))q.push(Y);return q}function RC4(){return`claude-mcp-browser-bridge-${dF1()}`}function dF1(){try{return MJz().username||"default"}catch{return process.env.USER||process.env.USERNAME||"default"}}var fb="claude-in-chrome",Cs6,Eh8,PJz=200,yh8;var Rm=L(()=>{_8();E8();PK();NK();VV();
|
||
|
||
var HU1=L(()=>{jU1={src:"sourcegraph",cody:"cody",aider:"aider",tabby:"tabby",tabnine:"tabnine",augment:"augment",pieces:"pieces",qodo:"qodo",aide:"aide",hound:"hound",seagoat:"seagoat",bloop:"bloop",gitloop:"gitloop",q:"amazon-q",gemini:"gemini"},FMz=[{pattern:/^sourcegraph$/i,tool:"sourcegraph"},{pattern:/^cody$/i,tool:"cody"},{pattern:/^openctx$/i,tool:"openctx"},{pattern:/^aider$/i,tool:"aider"},{pattern:/^continue$/i,tool:"continue"},{pattern:/^github[-_]?copilot$/i,tool:"github-copilot"},{pattern:/^copilot$/i,tool:"github-copilot"},{pattern:/^cursor$/i,tool:"cursor"},{pattern:/^tabby$/i,tool:"tabby"},{pattern:/^codeium$/i,tool:"codeium"},{pattern:/^tabnine$/i,tool:"tabnine"},{pattern:/^augment[-_]?code$/i,tool:"augment"},{pattern:/^augment$/i,tool:"augment"},{pattern:/^windsurf$/i,tool:"windsurf"},{pattern:/^aide$/i,tool:"aide"},{pattern:/^codestory$/i,tool:"aide"},{pattern:/^pieces$/i,tool:"pieces"},{pattern:/^qodo$/i,tool:"qodo"},{pattern:/^amazon[-_]?q$/i,tool:"amazon-q"},{pattern:/^gemini[-_]?code[-_]?assist$/i,tool:"gemini"},{pattern:/^gemini$/i,tool:"gemini"},{pattern:/^hound$/i,tool:"hound"},{pattern:/^seagoat$/i,tool:"seagoat"},{pattern:/^bloop$/i,tool:"bloop"},{pattern:/^gitloop$/i,tool:"gitloop"},{pattern:/^claude[-_]?context$/i,tool:"claude-context"},{pattern:/^code[-_]?index[-_]?mcp$/i,tool:"code-index-mcp"},{pattern:/^code[-_]?index$/i,tool:"code-index-mcp"},{pattern:/^local[-_]?code[-_]?search$/i,tool:"local-code-search"},{pattern:/^codebase$/i,tool:"autodev-codebase"},{pattern:/^autodev[-_]?codebase$/i,tool:"autodev-codebase"},{pattern:/^code[-_]?context$/i,tool:"claude-context"}]});function UMz(q,K,_){var z=-1,Y=q.length;if(K<0)K=-K>Y?0:Y+K;if(_=_>Y?Y:_,_<0)_+=Y;Y=K>_?0:_-K>>>0,K>>>=0;var $=Array(Y);while(++z<Y)$[z]=q[z+K];return $}var nh8;var JU1=L(()=>{nh8=UMz});function QMz(q,K,_){var z=q.length;return _=_===void 0?z:_,!K&&_>=z?q:nh8(q,K,_)}var hb4;var Rb4=L(()=>{JU1();hb4=QMz});
|
||
|
||
case"linux":_.push(zv(K,".config","JetBrains"),zv(K,".local","share","JetBrains"));for(let O of z)_.push(zv(K,"."+O));if(q.toLowerCase()==="androidstudio")_.push(zv(K,".config","Google"));break;default:break}return _}async function GXz(q){let K=[],_=M8(),z=ZXz(q),Y=ib4[q.toLowerCase()];if(!Y)return K;let $=Y.map((O)=>new RegExp("^"+O));for(let O of z)try{let A=await _.readdir(O);for(let w of $)for(let j of A){if(!w.test(j.name))continue;if(!j.isDirectory()&&!j.isSymbolicLink())continue;let H=zv(O,j.name);if(nb4()==="linux"){K.push(H);continue}let J=zv(H,"plugins");try{await _.stat(J),K.push(J)}catch{}}}catch{continue}return K.filter((O,A)=>K.indexOf(O)===A)}async function vXz(q){let K=await GXz(q);for(let _ of K){let z=zv(_,fXz);try{return await M8().stat(z),!0}catch{}}return!1}async function TXz(q,K=!1){if(!K){let z=WU1.get(q);if(z)return z}let _=vXz(q).then((z)=>{return DU1.set(q,z),z});return WU1.set(q,_),_}async function rb4(q,K=!1){if(K)DU1.delete(q),WU1.delete(q);return TXz(q,K)}function ob4(q){return DU1.get(q)??!1}var fXz="claude-code-jetbrains-plugin",ib4,DU1,WU1;var fU1=L(()=>{e7();ib4={pycharm:["PyCharm"],intellij:["IntelliJIdea","IdeaIC"],webstorm:["WebStorm"],phpstorm:["PhpStorm"],rubymine:["RubyMine"],clion:["CLion"],goland:["GoLand"],rider:["Rider"],datagrip:["DataGrip"],appcode:["AppCode"],dataspell:["DataSpell"],aqua:["Aqua"],gateway:["Gateway"],fleet:["Fleet"],androidstudio:["AndroidStudio"]};DU1=new Map,WU1=new Map});import{execFileSync as ab4}from"child_process";class fy6{wslDistroName;constructor(q){this.wslDistroName=q}toLocalPath(q){if(!q)return q;if(this.wslDistroName){let K=q.match(/^\\\\wsl(?:\.localhost|\$)\\([^\\]+)(.*)$/);if(K&&K[1]!==this.wslDistroName)return q}try{return ab4("wslpath",["-u",q],{encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim()}catch{return q.replace(/\\/g,"/").replace(/^([A-Z]):/i,(K,_)=>`/mnt/${_.toLowerCase()}`)}}toIDEPath(q){if(!q)return q;
|
||
|
||
_=Ax4()}return _}}return null}function EU1(){if(v1()==="linux")return{...process.env,DISPLAY:""};return}function Ax4(){return{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION}async function xXz(q){let{stdout:K}=await K1(q,["--list-extensions","--show-versions"],{env:EU1()}),_=K?.split(`
|
||
`)||[];for(let z of _){let[Y,$]=z.split("@");if(Y==="anthropic.claude-code"&&$)return $}return null}function IXz(){try{if(v1()!=="macos")return null;let K=process.ppid;for(let _=0;_<10;_++){if(!K||K===0||K===1)break;let z=pR(`ps -o command= -p ${K}`)?.trim();if(z){let $={"Visual Studio Code.app":"code","Cursor.app":"cursor","Windsurf.app":"windsurf","Visual Studio Code - Insiders.app":"code","VSCodium.app":"codium"},O="/Contents/MacOS/Electron";for(let[A,w]of Object.entries($)){let j=z.indexOf(A+"/Contents/MacOS/Electron");if(j!==-1){let H=j+A.length;return z.substring(0,H)+"/Contents/Resources/app/bin/"+w}}}let Y=pR(`ps -o ppid= -p ${K}`)?.trim();if(!Y)break;K=parseInt(Y.trim())}return null}catch{return null}}async function Mx4(q){let K=IXz();if(K)try{return await M8().stat(K),K}catch{}let _=v1()==="windows"?".cmd":"";switch(q){case"vscode":return"code"+_;case"cursor":return"cursor"+_;case"windsurf":return"windsurf"+_;default:break}return null}async function Xx4(){return(await K1("cursor",["--version"])).code===0}async function Px4(){return(await K1("windsurf",["--version"])).code===0}async function Wx4(){let q=await K1("code",["--help"]);return q.code===0&&Boolean(q.stdout?.includes("Visual Studio Code"))}async function uXz(){let q=[];try{let K=v1();
|
||
|
||
function RDz(q){return q instanceof Error}function IDz(){OS8(),Jy=null,d46=null,EQ=null}function mQ1(){if(d46)return;if(gm())d46=new Promise((q)=>{EQ=q,setTimeout(()=>{if(EQ)N("Policy limits: Loading promise timed out, resolving anyway"),EQ(),EQ=null},xDz)})}function YS8(){return hDz(q7(),SDz)}function uDz(){return`${m7().BASE_API_URL}/api/claude_code/policy_limits`}function uQ1(q){if(Array.isArray(q))return q.map(uQ1);if(q!==null&&typeof q==="object"){let K={};for(let[_,z]of Object.entries(q).sort(([Y],[$])=>Y.localeCompare($)))K[_]=uQ1(z);return K}return q}function mDz(q){let K=uQ1(q),_=g6(K);return`sha256:${yDz("sha256").update(_).digest("hex")}`}function gm(){if(Dq()!=="firstParty")return!1;if(!OM())return!1;try{let{key:K}=XA({skipRetrievingKeyFromApiKeyHelper:!0});if(K)return!0}catch{}let q=t7();if(!q?.accessToken)return!1;if(!q.scopes?.includes(bR))return!1;if(q.subscriptionType!=="enterprise"&&q.subscriptionType!=="team")return!1;return!0}async function Lt6(){if(d46)await d46}function pDz(){try{let{key:K}=XA({skipRetrievingKeyFromApiKeyHelper:!0});if(K)return{headers:{"x-api-key":K}}}catch{}let q=t7();if(q?.accessToken)return{headers:{Authorization:`Bearer ${q.accessToken}`,"anthropic-beta":JJ}};return{headers:{},error:"No authentication available"}}async function BDz(q){let K=null;for(let _=1;_<=IQ1+1;_++){if(K=await gDz(q),K.success)return K;if(K.skipRetry)return K;if(_>IQ1)return K;let z=qb(_);N(`Policy limits: Retry ${_}/${IQ1} after ${z}ms`),await C7(z)}return K}async function gDz(q){try{await PY();let K=pDz();if(K.error)return{success:!1,error:"Authentication required for policy limits",skipRetry:!0};let _=uDz(),z={...K.headers,"User-Agent":M$()};if(q)z["If-None-Match"]=`"${q}"`;let Y=await O1.get(_,{headers:z,timeout:CDz,validateStatus:(O)=>O===200||O===304||O===404});if(Y.status===304)return N("Policy limits: Using cached restrictions (304)"),{success:!0,restrictions:null,etag:q};if(Y.status===404)return N("Policy limits: No restrictions found (404)"),{success:!0,restrictions:{},etag:void 0};
|
||
|
||
return N(`Metrics opt-out API response: enabled=${q.metrics_logging_enabled}`),{enabled:q.metrics_logging_enabled,hasError:!1}}catch(q){return N(`Failed to check metrics opt-out status: ${F6(q)}`),j6(q),{enabled:!1,hasError:!0}}}async function DQ4(){let q=await Jvz();if(q.hasError)return q;let K=w8().metricsStatusCache;if(K!==void 0&&K.enabled===q.enabled&&Date.now()-K.timestamp<fQ4)return q;return S8((z)=>({...z,metricsStatusCache:{enabled:q.enabled,timestamp:Date.now()}})),q}async function ZQ4(){if(i7()&&!OD())return{enabled:!1,hasError:!1};let q=w8().metricsStatusCache;if(q){if(Date.now()-q.timestamp>fQ4)DQ4().catch(j6);return{enabled:q.enabled,hasError:!1}}return DQ4()}var wvz=3600000,fQ4=86400000,Jvz;var GQ4=L(()=>{VK();T7();k1();_8();E8();pG();h8();Kg();Jvz=jB6(Hvz,wvz)});class Sd1{endpoint;timeout;pendingExports=[];isShutdown=!1;constructor(q={}){this.endpoint="https://api.anthropic.com/api/claude_code/metrics",this.timeout=q.timeout||5000}async export(q,K){if(this.isShutdown){K({code:B26.ExportResultCode.FAILED,error:Error("Exporter has been shutdown")});return}let _=this.doExport(q,K);this.pendingExports.push(_),_.finally(()=>{let z=this.pendingExports.indexOf(_);if(z>-1)this.pendingExports.splice(z,1)})}async doExport(q,K){try{if(!(KO()||g7())){N("BigQuery metrics export: trust not established, skipping"),K({code:B26.ExportResultCode.SUCCESS});return}if(!(await ZQ4()).enabled){N("Metrics export disabled by organization setting"),K({code:B26.ExportResultCode.SUCCESS});return}let Y=this.transformMetricsForInternal(q),$=EJ();if($.error){N(`Metrics export failed: ${$.error}`),K({code:B26.ExportResultCode.FAILED,error:Error($.error)});return}let O={"Content-Type":"application/json","User-Agent":M$(),...$.headers},A=await O1.post(this.endpoint,Y,{timeout:this.timeout,headers:O});
|
||
|
||
N("BigQuery metrics exported successfully"),N(`BigQuery API Response: ${g6(A.data,null,2)}`),K({code:B26.ExportResultCode.SUCCESS})}catch(_){N(`BigQuery metrics export failed: ${F6(_)}`),j6(_),K({code:B26.ExportResultCode.FAILED,error:m1(_)})}}transformMetricsForInternal(q){let K=q.resource.attributes,_={"service.name":K["service.name"]||"claude-code","service.version":K["service.version"]||"unknown","os.type":K["os.type"]||"unknown","os.version":K["os.version"]||"unknown","host.arch":K["host.arch"]||"unknown","aggregation.temporality":this.selectAggregationTemporality()===Rd1.AggregationTemporality.DELTA?"delta":"cumulative"};if(K["wsl.version"])_["wsl.version"]=K["wsl.version"];if(i7()){_["user.customer_type"]="claude_ai";let Y=jK();if(Y)_["user.subscription_type"]=Y}else _["user.customer_type"]="api";return{resource_attributes:_,metrics:q.scopeMetrics.flatMap((Y)=>Y.metrics.map(($)=>({name:$.descriptor.name,description:$.descriptor.description,unit:$.descriptor.unit,data_points:this.extractDataPoints($)})))}}extractDataPoints(q){return(q.dataPoints||[]).filter((_)=>typeof _.value==="number").map((_)=>({attributes:this.convertAttributes(_.attributes),value:_.value,timestamp:this.hrTimeToISOString(_.endTime||_.startTime||[Date.now()/1000,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),N("BigQuery metrics exporter shutdown complete")}async forceFlush(){await Promise.all(this.pendingExports),N("BigQuery metrics exporter flush complete")}convertAttributes(q){let K={};if(q){for(let[_,z]of Object.entries(q))if(z!==void 0&&z!==null)K[_]=String(z)}return K}hrTimeToISOString(q){let[K,_]=q;return new Date(K*1000+_/1e6).toISOString()}selectAggregationTemporality(){return Rd1.AggregationTemporality.DELTA}}var B26,Rd1;var vQ4=L(()=>{VK();GQ4();T8();T7();k1();_8();E8();pG();h8();r8();B26=w6(jz(),1),Rd1=w6(m26(),1)});
|
||
|
||
let Y=!1,$={onReceiveMetadata:(z=(_=K===null||K===void 0?void 0:K.onReceiveMetadata)===null||_===void 0?void 0:_.bind(K))!==null&&z!==void 0?z:(O)=>{},onReceiveMessage:(O)=>{var A;Y=!0,(A=K===null||K===void 0?void 0:K.onReceiveMessage)===null||A===void 0||A.call(K,O)},onReceiveStatus:(O)=>{var A,w;if(!Y)(A=K===null||K===void 0?void 0:K.onReceiveMessage)===null||A===void 0||A.call(K,null);(w=K===null||K===void 0?void 0:K.onReceiveStatus)===null||w===void 0||w.call(K,O)}};super.start(q,$),this.call.startRead()}}class oi4 extends oc1{}function IEz(q,K,_){let z=xEz(q,_.path,K);if(_.responseStream)return new oi4(z,_);else return new ri4(z,_)}function uEz(q,K,_,z){if(q.clientInterceptors.length>0&&q.clientInterceptorProviders.length>0)throw new we6("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(q.callInterceptors.length>0&&q.callInterceptorProviders.length>0)throw new we6("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let Y=[];if(q.callInterceptors.length>0||q.callInterceptorProviders.length>0)Y=[].concat(q.callInterceptors,q.callInterceptorProviders.map((A)=>A(K))).filter((A)=>A);else Y=[].concat(q.clientInterceptors,q.clientInterceptorProviders.map((A)=>A(K))).filter((A)=>A);let $=Object.assign({},_,{method_definition:K});return Y.reduceRight((A,w)=>{return(j)=>w(j,A)},(A)=>IEz(z,A,K))($)}});var tc1=B((ei4)=>{Object.defineProperty(ei4,"__esModule",{value:!0});ei4.Client=void 0;var pQ=Bi4(),FEz=ec1(),UEz=yk(),YK6=e_(),PE6=nD(),DC8=ac1(),sm=Symbol(),WE6=Symbol(),DE6=Symbol(),Aa=Symbol();function sc1(q){return typeof q==="function"}function fE6(q){var K;return((K=q.stack)===null||K===void 0?void 0:K.split(`
|
||
`).slice(1).join(`
|
||
`))||"no stack trace available"}class ti4{constructor(q,K,_={}){var z,Y;
|
||
|
||
if(_=Object.assign({},_),this[WE6]=(z=_.interceptors)!==null&&z!==void 0?z:[],delete _.interceptors,this[DE6]=(Y=_.interceptor_providers)!==null&&Y!==void 0?Y:[],delete _.interceptor_providers,this[WE6].length>0&&this[DE6].length>0)throw Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[Aa]=_.callInvocationTransformer,delete _.callInvocationTransformer,_.channelOverride)this[sm]=_.channelOverride;else if(_.channelFactoryOverride){let $=_.channelFactoryOverride;delete _.channelFactoryOverride,this[sm]=$(q,K,_)}else this[sm]=new FEz.ChannelImplementation(q,K,_)}close(){this[sm].close()}getChannel(){return this[sm]}waitForReady(q,K){let _=(z)=>{if(z){K(Error("Failed to connect before the deadline"));return}let Y;try{Y=this[sm].getConnectivityState(!0)}catch($){K(Error("The channel has been closed"));return}if(Y===UEz.ConnectivityState.READY)K();else try{this[sm].watchConnectivityState(Y,q,_)}catch($){K(Error("The channel has been closed"))}};setImmediate(_)}checkOptionalUnaryResponseArguments(q,K,_){if(sc1(q))return{metadata:new PE6.Metadata,options:{},callback:q};else if(sc1(K))if(q instanceof PE6.Metadata)return{metadata:q,options:{},callback:K};else return{metadata:new PE6.Metadata,options:q,callback:K};else{if(!(q instanceof PE6.Metadata&&K instanceof Object&&sc1(_)))throw Error("Incorrect arguments passed");return{metadata:q,options:K,callback:_}}}makeUnaryRequest(q,K,_,z,Y,$,O){var A,w;let j=this.checkOptionalUnaryResponseArguments(Y,$,O),H={path:q,requestStream:!1,responseStream:!1,requestSerialize:K,responseDeserialize:_},J={argument:z,metadata:j.metadata,call:new pQ.ClientUnaryCallImpl,channel:this[sm],methodDefinition:H,callOptions:j.options,callback:j.callback};if(this[Aa])J=this[Aa](J);
|
||
|
||
let M=J.call,X={clientInterceptors:this[WE6],clientInterceptorProviders:this[DE6],callInterceptors:(A=J.callOptions.interceptors)!==null&&A!==void 0?A:[],callInterceptorProviders:(w=J.callOptions.interceptor_providers)!==null&&w!==void 0?w:[]},P=(0,DC8.getInterceptingCall)(X,J.methodDefinition,J.callOptions,J.channel);M.call=P;let W=null,D=!1,f=Error();return P.start(J.metadata,{onReceiveMetadata:(G)=>{M.emit("metadata",G)},onReceiveMessage(G){if(W!==null)P.cancelWithStatus(YK6.Status.UNIMPLEMENTED,"Too many responses received");W=G},onReceiveStatus(G){if(D)return;if(D=!0,G.code===YK6.Status.OK)if(W===null){let Z=fE6(f);J.callback((0,pQ.callErrorFromStatus)({code:YK6.Status.UNIMPLEMENTED,details:"No message received",metadata:G.metadata},Z))}else J.callback(null,W);else{let Z=fE6(f);J.callback((0,pQ.callErrorFromStatus)(G,Z))}f=null,M.emit("status",G)}}),P.sendMessage(z),P.halfClose(),M}makeClientStreamRequest(q,K,_,z,Y,$){var O,A;let w=this.checkOptionalUnaryResponseArguments(z,Y,$),j={path:q,requestStream:!0,responseStream:!1,requestSerialize:K,responseDeserialize:_},H={metadata:w.metadata,call:new pQ.ClientWritableStreamImpl(K),channel:this[sm],methodDefinition:j,callOptions:w.options,callback:w.callback};if(this[Aa])H=this[Aa](H);let J=H.call,M={clientInterceptors:this[WE6],clientInterceptorProviders:this[DE6],callInterceptors:(O=H.callOptions.interceptors)!==null&&O!==void 0?O:[],callInterceptorProviders:(A=H.callOptions.interceptor_providers)!==null&&A!==void 0?A:[]},X=(0,DC8.getInterceptingCall)(M,H.methodDefinition,H.callOptions,H.channel);J.call=X;let P=null,W=!1,D=Error();return X.start(H.metadata,{onReceiveMetadata:(f)=>{J.emit("metadata",f)},onReceiveMessage(f){if(P!==null)X.cancelWithStatus(YK6.Status.UNIMPLEMENTED,"Too many responses received");P=f,X.startRead()},onReceiveStatus(f){if(W)return;if(W=!0,f.code===YK6.Status.OK)if(P===null){let G=fE6(D);H.callback((0,pQ.callErrorFromStatus)({code:YK6.Status.UNIMPLEMENTED,details:"No message received",metadata:f.metadata},G))}else H.callback(null,P);
|
||
|
||
else{let G=fE6(D);H.callback((0,pQ.callErrorFromStatus)(f,G))}D=null,J.emit("status",f)}}),J}checkMetadataAndOptions(q,K){let _,z;if(q instanceof PE6.Metadata)if(_=q,K)z=K;else z={};else{if(q)z=q;else z={};_=new PE6.Metadata}return{metadata:_,options:z}}makeServerStreamRequest(q,K,_,z,Y,$){var O,A;let w=this.checkMetadataAndOptions(Y,$),j={path:q,requestStream:!1,responseStream:!0,requestSerialize:K,responseDeserialize:_},H={argument:z,metadata:w.metadata,call:new pQ.ClientReadableStreamImpl(_),channel:this[sm],methodDefinition:j,callOptions:w.options};if(this[Aa])H=this[Aa](H);let J=H.call,M={clientInterceptors:this[WE6],clientInterceptorProviders:this[DE6],callInterceptors:(O=H.callOptions.interceptors)!==null&&O!==void 0?O:[],callInterceptorProviders:(A=H.callOptions.interceptor_providers)!==null&&A!==void 0?A:[]},X=(0,DC8.getInterceptingCall)(M,H.methodDefinition,H.callOptions,H.channel);J.call=X;let P=!1,W=Error();return X.start(H.metadata,{onReceiveMetadata(D){J.emit("metadata",D)},onReceiveMessage(D){J.push(D)},onReceiveStatus(D){if(P)return;if(P=!0,J.push(null),D.code!==YK6.Status.OK){let f=fE6(W);J.emit("error",(0,pQ.callErrorFromStatus)(D,f))}W=null,J.emit("status",D)}}),X.sendMessage(z),X.halfClose(),J}makeBidiStreamRequest(q,K,_,z,Y){var $,O;let A=this.checkMetadataAndOptions(z,Y),w={path:q,requestStream:!0,responseStream:!0,requestSerialize:K,responseDeserialize:_},j={metadata:A.metadata,call:new pQ.ClientDuplexStreamImpl(K,_),channel:this[sm],methodDefinition:w,callOptions:A.options};if(this[Aa])j=this[Aa](j);let H=j.call,J={clientInterceptors:this[WE6],clientInterceptorProviders:this[DE6],callInterceptors:($=j.callOptions.interceptors)!==null&&$!==void 0?$:[],callInterceptorProviders:(O=j.callOptions.interceptor_providers)!==null&&O!==void 0?O:[]},M=(0,DC8.getInterceptingCall)(J,j.methodDefinition,j.callOptions,j.channel);H.call=M;let X=!1,P=Error();return M.start(j.metadata,{onReceiveMetadata(W){H.emit("metadata",W)},onReceiveMessage(W){H.push(W)},onReceiveStatus(W){if(X)return;
|
||
|
||
let Y=q.toDescriptor("proto3").file.map(($)=>Buffer.from(dl1.FileDescriptorProto.encode($).finish()));for(let[$,O]of ro4(q,""))_[$]=ERz(O,$,K,Y);return _}function oo4(q,K){K=K||{};let _=dQ.Root.fromDescriptor(q);return _.resolveAll(),UC8(_,K)}function LRz(q,K){return(0,cl1.loadProtosWithOptions)(q,K).then((_)=>{return UC8(_,K)})}ao4.load=LRz;function hRz(q,K){let _=(0,cl1.loadProtosWithOptionsSync)(q,K);return UC8(_,K)}ao4.loadSync=hRz;function RRz(q,K){K=K||{};let _=dQ.Root.fromJSON(q);return _.resolveAll(),UC8(_,K)}ao4.fromJSON=RRz;function SRz(q,K){let _=dl1.FileDescriptorSet.decode(q);return oo4(_,K)}ao4.loadFileDescriptorSetFromBuffer=SRz;function CRz(q,K){let _=dl1.FileDescriptorSet.fromObject(q);return oo4(_,K)}ao4.loadFileDescriptorSetFromObject=CRz;(0,cl1.addCommonProtos)()});var HK6=B((Ja4)=>{var __dirname="/home/runner/code/tmp/claude-cli-external-build-2185/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(Ja4,"__esModule",{value:!0});Ja4.registerChannelzSocket=Ja4.registerChannelzServer=Ja4.registerChannelzSubchannel=Ja4.registerChannelzChannel=Ja4.ChannelzCallTrackerStub=Ja4.ChannelzCallTracker=Ja4.ChannelzChildrenTrackerStub=Ja4.ChannelzChildrenTracker=Ja4.ChannelzTrace=Ja4.ChannelzTraceStub=void 0;Ja4.unregisterChannelzRef=QRz;Ja4.getChannelzHandlers=ja4;Ja4.getChannelzServiceDefinition=Ha4;Ja4.setup=eRz;var dC8=U6("net"),a26=Ri4(),Ve6=yk(),Ne6=e_(),BRz=fy(),gRz=WC8(),FRz=fC8();function nl1(q){return{channel_id:q.id,name:q.name}}function il1(q){return{subchannel_id:q.id,name:q.name}}function URz(q){return{server_id:q.id}}function cC8(q){return{socket_id:q.id,name:q.name}}var to4=32,rl1=100;class _a4{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:cQ(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}}Ja4.ChannelzTraceStub=_a4;class za4{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(q,K,_){let z=new Date;
|
||
|
||
let K;if(q.nanos%1e6===0)K=1e6;else if(q.nanos%1000===0)K=1000;else K=1;return`${q.seconds}.${q.nanos/K}s`}});var jb8=B((Xt4)=>{var __dirname="/home/runner/code/tmp/claude-cli-external-build-2185/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(Xt4,"__esModule",{value:!0});Xt4.OrcaOobMetricsSubchannelWrapper=Xt4.GRPC_METRICS_HEADER=Xt4.ServerMetricRecorder=Xt4.PerRequestMetricRecorder=void 0;Xt4.createOrcaClient=wt4;Xt4.createMetricsReader=$xz;var ebz=fC8(),hn1=ue6(),qxz=ME6(),Kxz=xe6(),zt4=e_(),_xz=XE6(),zxz=yk(),Yt4=null;function wb8(){if(Yt4)return Yt4;let q=ll1().loadSync,K=q("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,ebz.loadPackageDefinition)(K)}class Ot4{constructor(){this.message={}}recordRequestCostMetric(q,K){if(!this.message.request_cost)this.message.request_cost={};this.message.request_cost[q]=K}recordUtilizationMetric(q,K){if(!this.message.utilization)this.message.utilization={};this.message.utilization[q]=K}recordNamedMetric(q,K){if(!this.message.named_metrics)this.message.named_metrics={};this.message.named_metrics[q]=K}recordCPUUtilizationMetric(q){this.message.cpu_utilization=q}recordMemoryUtilizationMetric(q){this.message.mem_utilization=q}recordApplicationUtilizationMetric(q){this.message.application_utilization=q}recordQpsMetric(q){this.message.rps_fractional=q}recordEpsMetric(q){this.message.eps=q}serialize(){return wb8().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}}Xt4.PerRequestMetricRecorder=Ot4;var Yxz=30000;class At4{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:(q)=>{let K=q.request.report_interval?(0,hn1.durationToMs)((0,hn1.durationMessageToDuration)(q.request.report_interval)):Yxz,_=setInterval(()=>{q.write(this.message)},K);q.on("cancelled",()=>{clearInterval(_)})}}}putUtilizationMetric(q,K){if(!this.message.utilization)this.message.utilization={};
|
||
|
||
var oxz=U6("fs"),axz=Cw(),sxz=e_(),txz=U6("util"),exz="certificate_provider";function Pb8(q){axz.trace(sxz.LogVerbosity.DEBUG,exz,q)}var pn1=(0,txz.promisify)(oxz.readFile);class st4{constructor(q){if(this.config=q,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,q.certificateFile===void 0!==(q.privateKeyFile===void 0))throw Error("certificateFile and privateKeyFile must be set or unset together");if(q.certificateFile===void 0&&q.caCertificateFile===void 0)throw Error("At least one of certificateFile and caCertificateFile must be set");Pb8("File watcher constructed with config "+JSON.stringify(q))}updateCertificates(){if(this.fileResultPromise)return;this.fileResultPromise=Promise.allSettled([this.config.certificateFile?pn1(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?pn1(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?pn1(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([q,K,_])=>{if(!this.refreshTimer)return;if(Pb8("File watcher read certificates certificate "+q.status+", privateKey "+K.status+", CA certificate "+_.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,q.status==="fulfilled"&&K.status==="fulfilled")this.latestIdentityUpdate={certificate:q.value,privateKey:K.value};else this.latestIdentityUpdate=null;if(_.status==="fulfilled")this.latestCaUpdate={caCertificate:_.value};else this.latestCaUpdate=null;for(let z of this.identityListeners)z(this.latestIdentityUpdate);for(let z of this.caListeners)z(this.latestCaUpdate)}),Pb8("File watcher initiated certificate update")}maybeStartWatchingFiles(){if(!this.refreshTimer){let q=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;if(q>this.config.refreshIntervalMs)this.updateCertificates();if(q>this.config.refreshIntervalMs*2)this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0;
|
||
|
||
throw j}finally{this.authCodeListener?.close()}}async waitForAuthorizationCode(q,K){return new Promise((_,z)=>{this.manualAuthCodeResolver=_,this.authCodeListener?.waitForAuthorization(q,K).then((Y)=>{this.manualAuthCodeResolver=null,_(Y)}).catch((Y)=>{this.manualAuthCodeResolver=null,z(Y)})})}handleManualAuthCodeInput(q){if(this.manualAuthCodeResolver)this.manualAuthCodeResolver(q.authorizationCode),this.manualAuthCodeResolver=null,this.authCodeListener?.close()}formatTokens(q,K,_,z){return{accessToken:q.access_token,refreshToken:q.refresh_token,expiresAt:Date.now()+q.expires_in*1000,scopes:UU6(q.scope),subscriptionType:K,rateLimitTier:_,profile:z,tokenAccount:q.account?{uuid:q.account.uuid,emailAddress:q.account.email_address,organizationUuid:q.organization?.uuid}:void 0}}cleanup(){this.authCodeListener?.close(),this.manualAuthCodeResolver=null}}var se6=L(()=>{k8();xH();g8K();$D();c8K()});import{access as cpz,chmod as lpz,writeFile as npz}from"fs/promises";import{join as te6}from"path";function bb8(){return te6(q7(),"local")}function n8K(){return te6(bb8(),"claude")}function i8K(){return(process.argv[1]||"").includes("/.claude/local/node_modules/")}async function l8K(q,K,_){try{return await npz(q,K,{encoding:"utf8",flag:"wx",mode:_}),!0}catch(z){if(d1(z)==="EEXIST")return!1;throw z}}async function ipz(){try{let q=bb8();await M8().mkdir(q),await l8K(te6(q,"package.json"),g6({name:"claude-local",version:"0.0.1",private:!0},null,2));let K=te6(q,"claude");if(await l8K(K,`#!/bin/sh
|
||
exec "${q}/node_modules/.bin/claude" "$@"`,493))await lpz(K,493);return!0}catch(q){return j6(q),!1}}async function ee6(q,K){try{if(!await ipz())return"install_failed";
|
||
|
||
for(let[,K]of Object.entries(q))try{let _=await q68(K);if(!_)continue;let{filtered:z,hadAlias:Y}=xb8(_);if(Y)await Ib8(K,z),N(`Removed claude alias from ${K}`)}catch(_){N(`Failed to remove alias from ${K}: ${_}`,{level:"error"})}}var qBz="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases",K68,t8K=300000;var Za=L(()=>{VK();l1();k8();k1();_8();R_();d8();E8();PK();e7();AO();h8();i1();ub8();r8();K68=class K68 extends $u6{}});import{readFile as $Bz}from"fs/promises";function Bb8(q,K){return K.includes(q.id)||q.idLike.some((_)=>K.includes(_))}function di1(){let q=process.execPath||process.argv[0]||"";if(/[/\\]mise[/\\]installs[/\\]/i.test(q))return N(`Detected mise installation: ${q}`),!0;return!1}function ci1(){let q=process.execPath||process.argv[0]||"";if(/[/\\]\.?asdf[/\\]installs[/\\]/i.test(q))return N(`Detected asdf installation: ${q}`),!0;return!1}function gb8(){let q=v1();if(q!=="macos"&&q!=="linux"&&q!=="wsl")return!1;let K=process.execPath||process.argv[0]||"";if(K.includes("/Caskroom/"))return N(`Detected Homebrew cask installation: ${K}`),!0;return!1}function li1(){if(v1()!=="windows")return!1;let K=process.execPath||process.argv[0]||"",_=[/Microsoft[/\\]WinGet[/\\]Packages/i,/Microsoft[/\\]WinGet[/\\]Links/i];for(let z of _)if(z.test(K))return N(`Detected winget installation: ${K}`),!0;return!1}var pb8,ni1,ii1,ri1,oi1,dE6;var Fb8=L(()=>{c4();_8();PK();NK();pb8=$1(async()=>{try{let q=await $Bz("/etc/os-release","utf8"),K=q.match(/^ID=["']?(\S+?)["']?\s*$/m),_=q.match(/^ID_LIKE=["']?(.+?)["']?\s*$/m);return{id:K?.[1]??"",idLike:_?.[1]?.split(" ")??[]}}catch{return null}});ni1=$1(async()=>{if(v1()!=="linux")return!1;let K=await pb8();if(K&&!Bb8(K,["arch"]))return!1;let _=process.execPath||process.argv[0]||"",z=await K1("pacman",["-Qo",_],{timeout:5000,useCwd:!1});if(z.code===0&&z.stdout)return N(`Detected pacman installation: ${z.stdout.trim()}`),!0;return!1}),ii1=$1(async()=>{if(v1()!=="linux")return!1;let K=await pb8();if(K&&!Bb8(K,["debian"]))return!1;
|
||
|
||
return"unknown"}async function jBz(){if(Pj()){try{return await O1K(process.execPath)}catch{}try{let q=await uA("claude");if(q)return q}catch{}try{return await M8().stat(zp(Aj6(),".local/bin/claude")),zp(Aj6(),".local/bin/claude")}catch{}return"native"}try{return process.argv[0]||"unknown"}catch{return"unknown"}}function HBz(){try{if(Pj())return process.execPath||"unknown";return process.argv[1]||"unknown"}catch{return"unknown"}}async function JBz(){let q=M8(),K=[],_=zp(Aj6(),".claude","local");if(await Yj6())K.push({type:"npm-local",path:_});let z=["@anthropic-ai/claude-code"];if({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL&&{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL!=="@anthropic-ai/claude-code")z.push({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL);let Y=await K1("npm",["-g","config","get","prefix"]);if(Y.code===0&&Y.stdout){let A=Y.stdout.trim(),w=v1()==="windows",j=w?zp(A,"claude"):zp(A,"bin","claude"),H=!1;try{await q.stat(j),H=!0}catch{}if(H){let J=!1;try{if((await O1K(j)).includes("/Caskroom/"))J=gb8()}catch{}if(!J)K.push({type:"npm-global",path:j})}else for(let J of z){let M=w?zp(A,"node_modules",J):zp(A,"lib","node_modules",J);
|
||
|
||
let $=oQ().startsWith("win32")?sX(_,"node_modules",q):sX(_,"lib","node_modules",q);return{success:!0,warning:`${q} executables removed, but node_modules directory was left intact for safety. You may manually delete it later at: ${$}`}}else return{success:!1}}catch(K){return N(`Manual removal failed: ${K}`,{level:"error"}),{success:!1,error:`Manual removal failed: ${K}`}}}async function v1K(q){let{code:K,stderr:_}=await x7("npm",["uninstall","-g",q],{cwd:process.cwd()});if(K===0)return N(`Removed global npm installation of ${q}`),{success:!0};else if(_&&!_.includes("npm ERR! code E404")){if(_.includes("npm error code ENOTEMPTY")){N(`Failed to uninstall global npm package ${q}: ${_}`,{level:"error"}),N("Attempting manual removal due to ENOTEMPTY error");let z=await iBz(q);if(z.success)return{success:!0,warning:z.warning};else if(z.error)return{success:!1,error:`Failed to remove global npm installation of ${q}: ${_}. Manual removal also failed: ${z.error}`}}return N(`Failed to uninstall global npm package ${q}: ${_}`,{level:"error"}),{success:!1,error:`Failed to remove global npm installation of ${q}: ${_}`}}return{success:!1}}async function $r1(){let q=[],K=[],_=0,z=await v1K("@anthropic-ai/claude-code");if(z.success){if(_++,z.warning)K.push(z.warning)}else if(z.error)q.push(z.error);
|
||
|
||
return"/upgrade or /extra-usage to finish what you’re working on."}function m5K(q){let K=Y6(19),{text:_,onOpenRateLimitOptions:z}=q,Y;if(K[0]===Symbol.for("react.memo_cache_sentinel"))Y=jK(),K[0]=Y;else Y=K[0];let $=Y,O;if(K[1]===Symbol.for("react.memo_cache_sentinel"))O=xF(),K[1]=O;else O=K[1];let A=O,w=$==="team"||$==="enterprise",j=A==="default_claude_max_20x",H;if(K[2]===Symbol.for("react.memo_cache_sentinel"))H=aZ6()||i7(),K[2]=H;else H=K[2];let J=H,M=gK6(),X=M.upgradePaths,P;if(K[3]!==X)P=X!==void 0&&!X.includes("upgrade_plan"),K[3]=X,K[4]=P;else P=K[4];let W=P,D=J&&!j,[f,G]=pa.useState(!1),Z=M.status==="rejected"&&M.resetsAt!==void 0&&!M.isUsingOverage,v=D&&!f&&Z&&z,k,V;if(K[5]!==z||K[6]!==v)k=()=>{if(v)G(!0),z()},V=[v,z],K[5]=z,K[6]=v,K[7]=k,K[8]=V;else k=K[7],V=K[8];pa.useEffect(k,V);let y;q:{let m;if(K[9]!==W||K[10]!==v)m=idz({shouldShowUpsell:J,isMax20x:j,isExtraUsageCommandEnabled:BK6.isEnabled(),shouldAutoOpenRateLimitOptionsMenu:!!v,isTeamOrEnterprise:w,hasBillingAccess:ag(),serverHidesUpgrade:W}),K[9]=W,K[10]=v,K[11]=m;else m=K[11];let p=m;if(!p){y=null;break q}let C;if(K[12]!==p)C=pa.default.createElement(T,{dimColor:!0},p),K[12]=p,K[13]=C;else C=K[13];y=C}let E=y,R;if(K[14]!==_)R=pa.default.createElement(T,{color:"error"},_),K[14]=_,K[15]=R;else R=K[15];let b=f?null:E,I;if(K[16]!==R||K[17]!==b)I=pa.default.createElement(_1,null,pa.default.createElement(u,{flexDirection:"column"},R,b)),K[16]=R,K[17]=b,K[18]=I;else I=K[18];return I}var pa;var p5K=L(()=>{t6();M88();i6();X88();io6();T7();qi();FK();pa=w6(D6(),1)});function rdz(){let q=Y6(2),K;if(q[0]===Symbol.for("react.memo_cache_sentinel"))K=qIq(),q[0]=K;else K=q[0];let _=K,z;if(q[1]===Symbol.for("react.memo_cache_sentinel"))z=w9.default.createElement(_1,null,w9.default.createElement(u,{flexDirection:"column"},w9.default.createElement(T,{color:"error"},UI8),_&&w9.default.createElement(T,{dimColor:!0},"· Run in another terminal: security unlock-keychain"))),q[1]=z;else z=q[1];
|
||
|
||
if(K[40]===Symbol.for("react.memo_cache_sentinel"))j=(I3K(),hq(x3K)),K[40]=j;else j=K[40];let{UserChannelMessage:H}=j,J;if(K[41]!==_||K[42]!==z)J=uw.createElement(H,{addMargin:_,param:z}),K[41]=_,K[42]=z,K[43]=J;else J=K[43];return J}let w;if(K[44]!==_||K[45]!==O||K[46]!==z||K[47]!==A)w=uw.createElement(V3K,{addMargin:_,param:z,isTranscriptMode:O,timestamp:A}),K[44]=_,K[45]=O,K[46]=z,K[47]=A,K[48]=w;else w=K[48];return w}var uw;var _u8=L(()=>{t6();O$();_O();a1();my6();FK();Y3K();Aa1();A3K();j3K();M3K();P3K();ja1();N3K();E3K();Wa1();uw=w6(D6(),1)});class fp{static instance;baseline=new Map;initialized=!1;mcpClient;lastProcessedTimestamps=new Map;rightFileDiagnosticsState=new Map;static getInstance(){if(!fp.instance)fp.instance=new fp;return fp.instance}initialize(q){if(this.initialized)return;this.mcpClient=q,this.initialized=!0}async shutdown(){this.initialized=!1,this.baseline.clear(),this.rightFileDiagnosticsState.clear(),this.lastProcessedTimestamps.clear()}reset(){this.baseline.clear(),this.rightFileDiagnosticsState.clear(),this.lastProcessedTimestamps.clear()}normalizeFileUri(q){let K=["file://","_claude_fs_right:","_claude_fs_left:"],_=q;for(let z of K)if(q.startsWith(z)){_=q.slice(z.length);break}return XJ(_)}async ensureFileOpened(q){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return;try{await xm("openFile",{filePath:q,preview:!1,startText:"",endText:"",selectToEndOfLine:!1,makeFrontmost:!1},this.mcpClient)}catch(K){j6(K)}}async beforeFileEdited(q){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return;let K=Date.now();try{let _=await xm("getDiagnostics",{uri:`file://${q}`},this.mcpClient),z=this.parseDiagnosticResult(_)[0];if(z){if(!sh7(this.normalizeFileUri(q),this.normalizeFileUri(z.uri))){j6(new m3K(`Diagnostics file path mismatch: expected ${q}, got ${z.uri})`));return}let Y=this.normalizeFileUri(q);this.baseline.set(Y,z.diagnostics),this.lastProcessedTimestamps.set(Y,K)}else{let Y=this.normalizeFileUri(q);
|
||
|
||
this.baseline.set(Y,[]),this.lastProcessedTimestamps.set(Y,K)}}catch(_){}}async getNewDiagnostics(){if(!this.initialized||!this.mcpClient||this.mcpClient.type!=="connected")return[];let q=[];try{let Y=await xm("getDiagnostics",{},this.mcpClient);q=this.parseDiagnosticResult(Y)}catch(Y){return[]}let K=q.filter((Y)=>this.baseline.has(this.normalizeFileUri(Y.uri))).filter((Y)=>Y.uri.startsWith("file://")),_=new Map;q.filter((Y)=>this.baseline.has(this.normalizeFileUri(Y.uri))).filter((Y)=>Y.uri.startsWith("_claude_fs_right:")).forEach((Y)=>{_.set(this.normalizeFileUri(Y.uri),Y)});let z=[];for(let Y of K){let $=this.normalizeFileUri(Y.uri),O=this.baseline.get($)||[],A=_.get($),w=Y;if(A){let H=this.rightFileDiagnosticsState.get($);if(!H||!this.areDiagnosticArraysEqual(H,A.diagnostics))w=A;this.rightFileDiagnosticsState.set($,A.diagnostics)}let j=w.diagnostics.filter((H)=>!O.some((J)=>this.areDiagnosticsEqual(H,J)));if(j.length>0)z.push({uri:Y.uri,diagnostics:j});this.baseline.set($,w.diagnostics)}return z}parseDiagnosticResult(q){if(Array.isArray(q)){let K=q.find((_)=>_.type==="text");if(K&&"text"in K)return l8(K.text)}return[]}areDiagnosticsEqual(q,K){return q.message===K.message&&q.severity===K.severity&&q.source===K.source&&q.code===K.code&&q.range.start.line===K.range.start.line&&q.range.start.character===K.range.start.character&&q.range.end.line===K.range.end.line&&q.range.end.character===K.range.end.character}areDiagnosticArraysEqual(q,K){if(q.length!==K.length)return!1;return q.every((_)=>K.some((z)=>this.areDiagnosticsEqual(_,z)))&&K.every((_)=>q.some((z)=>this.areDiagnosticsEqual(z,_)))}async handleQueryStart(q){if(!this.initialized){let K=wy(q);if(K)this.initialize(K)}else this.reset()}static formatDiagnosticsSummary(q){let _=q.map((z)=>{let Y=z.uri.split("/").pop()||z.uri,$=z.diagnostics.map((O)=>{return` ${fp.getSeveritySymbol(O.severity)} [Line ${O.range.start.line+1}:${O.range.start.character+1}] ${O.message}${O.code?` [${O.code}]`:""}${O.source?` (${O.source})`:""}`}).join(`
|
||
`);
|
||
|
||
return J}}function hcz(q,K){return Ny.default.createElement(Ny.default.Fragment,{key:K},Ny.default.createElement(_1,null,Ny.default.createElement(T,{dimColor:!0,wrap:"wrap"},Ny.default.createElement(T,{bold:!0},Lcz(Z8(),q.uri.replace("file://","").replace("_claude_fs_right:","")))," ",Ny.default.createElement(T,{dimColor:!0},q.uri.startsWith("file://")?"(file://)":q.uri.startsWith("_claude_fs_right:")?"(claude_fs_right)":`(${q.uri.split(":")[0]})`),":")),q.diagnostics.map(Rcz))}function Rcz(q,K){return Ny.default.createElement(_1,{key:K},Ny.default.createElement(T,{dimColor:!0,wrap:"wrap"}," ",fp.getSeveritySymbol(q.severity)," [Line ",q.range.start.line+1,":",q.range.start.character+1,"] ",q.message,q.code?` [${q.code}]`:"",q.source?` (${q.source})`:""))}function Scz(q,K){return q+K.diagnostics.length}var Ny;var B3K=L(()=>{t6();i6();oj6();F7();vk();FK();Ny=w6(D6(),1)});import{pathToFileURL as Ccz}from"url";function zu8(q){let K=Y6(7),{imageId:_,addMargin:z}=q,Y=_?`[Image #${_}]`:"[Image]",$;if(K[0]!==_||K[1]!==Y){let w=_?jR8(_):null;$=w&&iT()?Zp.createElement(Sq,{url:Ccz(w).href},Zp.createElement(T,null,Y)):Zp.createElement(T,null,Y),K[0]=_,K[1]=Y,K[2]=$}else $=K[2];let O=$;if(z){let w;if(K[3]!==O)w=Zp.createElement(u,{marginTop:1},O),K[3]=O,K[4]=w;else w=K[4];return w}let A;if(K[5]!==O)A=Zp.createElement(_1,null,O),K[5]=O,K[6]=A;else A=K[6];return A}var Zp;var Da1=L(()=>{t6();kT6();br();i6();lo();FK();Zp=w6(D6(),1)});import{pathToFileURL as bcz}from"url";function O0(q){let K=Y6(5),{filePath:_,children:z}=q,Y;if(K[0]!==_)Y=bcz(_),K[0]=_,K[1]=Y;else Y=K[1];let $=z??_,O;if(K[2]!==Y.href||K[3]!==$)O=g3K.default.createElement(Sq,{url:Y.href},$),K[2]=Y.href,K[3]=$,K[4]=O;else O=K[4];return O}var g3K;var cK6=L(()=>{t6();kT6();g3K=w6(D6(),1)});import{basename as Icz,sep as ucz}from"path";function F3K({attachment:q,addMargin:K,verbose:_,isTranscriptMode:z}){let Y=cZ(),$=!1;if(oq()&&q.type==="teammate_mailbox"){let O=q.messages.filter((A)=>{if(Ek(A.text))return!1;try{let w=l8(A.text);
|
||
|
||
return ss1}function L$K(q){let K={aws:"AWS",gcp:"GCP",api:"API",pat:"PAT",ad:"AD",tf:"TF",oauth:"OAuth",npm:"NPM",pypi:"PyPI",jwt:"JWT",github:"GitHub",gitlab:"GitLab",openai:"OpenAI",digitalocean:"DigitalOcean",huggingface:"HuggingFace",hashicorp:"HashiCorp",sendgrid:"SendGrid"};return q.split("-").map((_)=>K[_]??MG(_)).join(" ")}function ts1(q){let K=[],_=new Set;for(let z of Soz()){if(_.has(z.id))continue;if(z.re.test(q))_.add(z.id),K.push({ruleId:z.id,label:L$K(z.id)})}return K}function Coz(q){return L$K(q)}function boz(q){y$K??=E$K.map((K)=>new RegExp(K.source,(K.flags??"").replace("g","")+"g"));for(let K of y$K)q=q.replace(K,(_,z)=>typeof z==="string"?_.replace(z,"[REDACTED]"):"[REDACTED]");return q}var Roz,E$K,ss1=null,y$K=null;var es1=L(()=>{Roz=["sk","ant","api"].join("-"),E$K=[{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b"},{id:"gcp-api-key",source:`\\b(AIza[\\w-]{35})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"anthropic-api-key",source:`\\b(${Roz}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;
|
||
|
||
]|\\\\[nr]|$)`},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i"}]});function Gm8(q,K){{let{isTeamMemPath:_}=(yL(),hq(wr)),{scanForSecrets:z}=(es1(),hq(h$K));if(!_(q))return null;let Y=z(K);if(Y.length===0)return null;return`Content contains potential secrets (${Y.map((O)=>O.label).join(", ")}) and cannot be written to team memory. Team memory is shared with all repository collaborators. Remove the sensitive content and try again.`}return null}function qt1(q){if(!q||!q.trim())return[];let K=TM(q);return K.length>0?K:q.split(/\s+/).filter(Boolean)}function vm8(q){if(!q)return[];let K=(_)=>typeof _==="string"&&_.trim()!==""&&!/^\d+$/.test(_);if(Array.isArray(q))return q.filter(K);if(typeof q==="string")return q.split(/\s+/).filter(K);return[]}function R$K(q,K){let _=q.slice(K.length);if(_.length===0)return;return _.map((z)=>`[${z}]`).join(" ")}function Ph6(q,K,_=!0,z=[]){if(K===void 0||K===null)return q;let Y=qt1(K),$=q;for(let O=0;O<z.length;O++){let A=z[O];if(!A)continue;q=q.replace(new RegExp(`\\$${A}(?![\\[\\w])`,"g"),Y[O]??"")}if(q=q.replace(/\$ARGUMENTS\[(\d+)\]/g,(O,A)=>{let w=parseInt(A,10);return Y[w]??""}),q=q.replace(/\$(\d+)(?!\w)/g,(O,A)=>{let w=parseInt(A,10);return Y[w]??""}),q=q.replaceAll("$ARGUMENTS",K),q===$&&_&&K)q=q+`
|
||
|
||
ARGUMENTS: ${K}`;return q}var $18=L(()=>{uD()});function O18(q,K){if(!q.includes("<claude-code-hint"))return{hints:[],stripped:q};let _=Boz(K),z=[],Y=q.replace(uoz,(O)=>{let A=poz(O),w=Number(A.v),j=A.type,H=A.value;if(!xoz.has(w))return N(`[claudeCodeHints] dropped hint with unsupported v=${A.v}`),"";if(!j||!Ioz.has(j))return N(`[claudeCodeHints] dropped hint with unsupported type=${j}`),"";if(!H)return N("[claudeCodeHints] dropped hint with empty value"),"";
|
||
|
||
if($.includes("$")||$.includes("%"))return{allowed:!1,resolvedPath:$,decisionReason:{type:"other",reason:"Variable expansion syntax in paths requires manual approval"}};if((v1()==="windows"?/^[a-z0-9]{2,}:/i:/^[a-z0-9]+:/i).test($))return{allowed:!1,resolvedPath:$,decisionReason:{type:"other",reason:`Path '${$}' uses a non-filesystem provider and requires manual approval`}};if(qAK.test($)){if(z==="write"||z==="create")return{allowed:!1,resolvedPath:$,decisionReason:{type:"other",reason:"Glob patterns are not allowed in write operations. Please specify an exact file path."}};if(_g($)){let D=T18($)?$:hh6(K,$),{resolvedPath:f,isCanonical:G}=$$(M8(),D),Z=tOK(f,_,z,G?[f]:void 0);return{allowed:Z.allowed,resolvedPath:f,decisionReason:Z.decisionReason}}let J=Fsz($),M=T18(J)?J:hh6(K,J),{resolvedPath:X}=$$(M8(),M),W=EH(X,_,z==="read"?"read":"edit","deny");if(W!==null)return{allowed:!1,resolvedPath:X,decisionReason:{type:"rule",rule:W}};return{allowed:!1,resolvedPath:X,decisionReason:{type:"other",reason:"Glob patterns in paths cannot be statically validated — symlinks inside the glob expansion are not examined. Requires manual approval."}}}let A=T18($)?$:hh6(K,$),{resolvedPath:w,isCanonical:j}=$$(M8(),A),H=tOK(w,_,z,j?[w]:void 0);return{allowed:H.allowed,resolvedPath:w,decisionReason:H.decisionReason}}function Fsz(q){let K=q.match(qAK);if(!K||K.index===void 0)return q;let _=q.substring(0,K.index),z=Math.max(_.lastIndexOf("/"),_.lastIndexOf("\\"));if(z===-1)return".";return _.substring(0,z+1)||"/"}function eOK(q){let K=LY(q.name),_=It1[K];if(!_)return{paths:[],operationType:"read",hasUnvalidatablePathArg:!1,optionalWrite:!1};let z=[..._.knownSwitches,...yt1],Y=[..._.knownValueParams,...Et1],$=[],O=q.args,A=q.elementTypes,w=!1,j=0,H=_.positionalSkip??0;function J(M){if(!A)return;let X=A[M+1];if(X&&!Usz.has(X))w=!0}for(let M=0;M<O.length;M++){let X=O[M];if(!X)continue;let P=A?A[M+1]:void 0;if(A56(X,P)){let W="-"+X.slice(1),D=W.indexOf(":",1),G=(D>0?W.substring(0,D):W).toLowerCase();if(nm8(G,_.pathParams)){let Z;
|
||
|
||
return{data:{new_source:K,cell_type:z??"code",language:"python",edit_mode:"replace",error:"Unknown error occurred while editing notebook",cell_id:_,notebook_path:j,original_file:"",updated_file:""}}}}})});function gp8(q,K){if(L8Y.has(q))return!0;let _=h8Y.get(q);if(_){for(let z of _)if(K===z||K.startsWith(z+"/"))return!0}return!1}var E8Y,L8Y,h8Y;var Ie1=L(()=>{E8Y=new Set(["platform.claude.com","code.claude.com","modelcontextprotocol.io","github.com/anthropics","agentskills.io","docs.python.org","en.cppreference.com","docs.oracle.com","learn.microsoft.com","developer.mozilla.org","go.dev","pkg.go.dev","www.php.net","docs.swift.org","kotlinlang.org","ruby-doc.org","doc.rust-lang.org","www.typescriptlang.org","react.dev","angular.io","vuejs.org","nextjs.org","expressjs.com","nodejs.org","bun.sh","jquery.com","getbootstrap.com","tailwindcss.com","d3js.org","threejs.org","redux.js.org","webpack.js.org","jestjs.io","reactrouter.com","docs.djangoproject.com","flask.palletsprojects.com","fastapi.tiangolo.com","pandas.pydata.org","numpy.org","www.tensorflow.org","pytorch.org","scikit-learn.org","matplotlib.org","requests.readthedocs.io","jupyter.org","laravel.com","symfony.com","wordpress.org","docs.spring.io","hibernate.org","tomcat.apache.org","gradle.org","maven.apache.org","asp.net","dotnet.microsoft.com","nuget.org","blazor.net","reactnative.dev","docs.flutter.dev","developer.apple.com","developer.android.com","keras.io","spark.apache.org","huggingface.co","www.kaggle.com","www.mongodb.com","redis.io","www.postgresql.org","dev.mysql.com","www.sqlite.org","graphql.org","prisma.io","docs.aws.amazon.com","cloud.google.com","learn.microsoft.com","kubernetes.io","www.docker.com","www.terraform.io","www.ansible.com","vercel.com/docs","docs.netlify.com","devcenter.heroku.com","cypress.io","selenium.dev","docs.unity.com","docs.unrealengine.com","git-scm.com","nginx.org","httpd.apache.org"]),{HOSTNAME_ONLY:L8Y,PATH_PREFIXES:h8Y}=(()=>{let q=new Set,K=new Map;for(let _ of E8Y){let z=_.indexOf("/");if(z===-1)q.add(_);
|
||
|
||
return $.push(zPK),$}if(tw()){let $=[dB8(q)];if(qa())$.push(eXK());if(vJ())$.push(F87(q));else if($.push(tXK(q)),eo())$.push(qPK(q));return $.push(YPK()),$}let K=[dB8(q)],_=f5Y();if(_!==void 0)K.push(_);else if(K.push(Z5Y()),qa())K.push(eXK());let z=G5Y();if(z!==void 0)K.push(z);else if(K.push(v5Y()),K.push(tXK(q)),eo())K.push(qPK(q));let Y=T5Y();if(Y!==void 0)K.push(Y);else K.push(V5Y());return K}function L5Y(q){let K=cY(q);if(K.includes("claude-sonnet-4-6")||K.includes("claude-sonnet-4-5")||K.includes("claude-sonnet-4-")||K.includes("claude-3-7-sonnet")||K.includes("claude-3-5-sonnet")){let _=Ai(LT());if(_)return{alias:"Sonnet",currentVersionName:_}}if(K.includes("claude-opus-4")){let _=Ai(KN());if(_)return{alias:"Opus",currentVersionName:_}}if(K.includes("claude-haiku")||K.includes("claude-3-5-haiku")){let _=Ai(W06());if(_)return{alias:"Haiku",currentVersionName:_}}return null}function h5Y(q){let K=Ai(q);if(!K)return null;let _=L5Y(q);if(!_)return{value:q,label:K,description:q};if(K!==_.currentVersionName)return{value:q,label:K,description:`Newer version available · select ${_.alias} for ${_.currentVersionName}`};return{value:q,label:K,description:q}}function V56(q=!1){let K=E5Y(q),_=process.env.ANTHROPIC_CUSTOM_MODEL_OPTION;if(_&&!K.some((O)=>O.value===_))K.push({value:_,label:process.env.ANTHROPIC_CUSTOM_MODEL_OPTION_NAME??_,description:process.env.ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION??`Custom model (${_})`});for(let O of w8().additionalModelOptionsCache??[])if(!K.some((A)=>A.value===O.value))K.push(O);let z=null,Y=CS(),$=AP6();if(Y!==void 0&&Y!==null)z=Y;else if($!==null)z=$;if(z===null||K.some((O)=>O.value===z))return A78(K);else if(z==="opusplan")return A78([...K,y5Y()]);else if(z==="opus"&&tw())return A78([...K,$PK(q)]);else if(z==="opus[1m]"&&tw())return A78([...K,F87(q)]);else{let O=h5Y(z);if(O)K.push(O);else K.push({value:z,label:z,description:"Custom model"});return A78(K)}}function A78(q){if(!(k7()||{}).availableModels)return q;
|
||
|
||
$_Y=p6(()=>h.object({entries:h.record(h.string(),h.string()),entryChecksums:h.record(h.string(),h.string()).optional()})),QDK=p6(()=>h.object({organizationId:h.string(),repo:h.string(),version:h.number(),lastModified:h.string(),checksum:h.string(),content:$_Y()})),dDK=p6(()=>h.object({error:h.object({details:h.object({error_code:h.literal("team_memory_too_many_entries"),max_entries:h.number().int().positive(),received_entries:h.number().int().positive()})})}))});import{createHash as O_Y}from"crypto";import{mkdir as A_Y,readdir as w_Y,readFile as lDK,stat as j_Y,writeFile as H_Y}from"fs/promises";import{join as J_Y,relative as M_Y,sep as X_Y}from"path";function nDK(){return{lastKnownChecksum:null,serverChecksums:new Map,serverMaxEntries:null}}function W_Y(q){return"sha256:"+O_Y("sha256").update(q,"utf8").digest("hex")}function h17(){if(Dq()!=="firstParty"||!OM())return!1;let q=t7();return Boolean(q?.accessToken&&q.scopes?.includes(bR)&&q.scopes.includes(g_6))}function R17(q){return`${process.env.TEAM_MEMORY_SYNC_URL||m7().BASE_API_URL}/api/claude_code/team_memory?repo=${encodeURIComponent(q)}`}function S17(){let q=t7();if(q?.accessToken)return{headers:{Authorization:`Bearer ${q.accessToken}`,"anthropic-beta":JJ,"User-Agent":M$()}};return{error:"No OAuth token available for team memory sync"}}async function D_Y(q,K,_){try{await PY();let z=S17();if(z.error)return{success:!1,error:z.error,skipRetry:!0,errorType:"auth"};let Y={...z.headers};if(_)Y["If-None-Match"]=`"${_.replace(/"/g,"")}"`;let $=R17(K),O=await O1.get($,{headers:Y,timeout:L17,validateStatus:(j)=>j===200||j===304||j===404});if(O.status===304)return N("team-memory-sync: not modified (304)",{level:"debug"}),{success:!0,notModified:!0,checksum:_??void 0};if(O.status===404)return N("team-memory-sync: no remote data (404)",{level:"debug"}),q.lastKnownChecksum=null,{success:!0,isEmpty:!0};let A=QDK().safeParse(O.data);
|
||
|
||
if a tier-"click" app is in front, \`type\` and \`right_click\` return errors. The error tells you what tier the app has and what to do instead. \`open_application\` works at any tier — bringing an app forward is a read-level operation.
|
||
|
||
**Link safety — treat links in emails and messages as suspicious by default.**
|
||
- **Never click web links with computer-use tools.** If you encounter a link in a native app (Mail, Messages, a PDF, etc.), do NOT \`left_click\` it. Open the URL via the claude-in-chrome MCP instead.
|
||
- **See the full URL before following any link.** Visible link text can be misleading — hover or inspect to get the real destination.
|
||
- **Links from emails, messages, or unknown-sender documents are suspicious by default.** If the destination URL is at all unfamiliar or looks off, ask the user for confirmation before proceeding.
|
||
- **Inside the Chrome extension** you can click links with the extension's tools, but the suspicion check still applies — verify unfamiliar URLs with the user.
|
||
|
||
**Financial actions - do not execute trades or move money.** Budgeting and accounting apps (Quicken, YNAB, QuickBooks, etc.) are granted at full tier so you can categorize transactions, generate reports, and help the user organize their finances. But never execute a trade, place an order, send money, or initiate a transfer on the user's behalf - always ask the user to perform those actions themselves.`;function JGK(q){if(Jq7=q,q&&r78.length>0)for(let K of r78.splice(0))q(K)}function Mq7(q){if(Jq7)Jq7(q);else if(r78.push(q),r78.length>GOY)r78.shift()}function JF8(q){if(ZOY.includes(q))return!0;return HGK&&UR.includes(q)}function Xq7(q,K,_){if(!JF8(_))return;Mq7({type:"started",hookId:q,hookName:K,hookEvent:_})}function vOY(q){if(!JF8(q.hookEvent))return;Mq7({type:"progress",...q})}function MF8(q){if(!JF8(q.hookEvent))return()=>{};let K="",_=setInterval(()=>{q.getOutput().then(({stdout:z,stderr:Y,output:$})=>{if($===K)return;
|
||
|
||
if(w){if(w.installPath=z,w.version=Y,w.lastUpdated=new Date().toISOString(),$!==void 0)w.gitCommitSha=$;let j=wq8();Hj(j,g6(O,null,2),{encoding:"utf-8",flush:!0}),Ud=null,N(`Updated ${q} on disk to version ${Y} at ${z}`)}else N(`Cannot update ${q} on disk: no installation for scope ${K}`)}async function dq7(){DwY();try{await nq7()}catch(K){j6(K)}let q=jq8();N(`Initialized versioned plugins system with ${Object.keys(q.plugins).length} plugins`)}function AvK(q){if(!q)return{orphanedPaths:[],removedPluginIds:[]};let K=Fp(),_=`@${q}`,z=new Set,Y=[];for(let $ of Object.keys(K.plugins)){if(!$.endsWith(_))continue;for(let O of K.plugins[$]??[])if(O.installPath)z.add(O.installPath);delete K.plugins[$],Y.push($),N(`Removed installed plugin for marketplace removal: ${$}`)}if(Y.length>0)bF8(K);return{orphanedPaths:Array.from(z),removedPluginIds:Y}}function cq7(q){return q.scope==="user"||q.scope==="managed"||q.projectPath===z7()}function nb(q){let _=jP().plugins[q];if(!_||_.length===0)return!1;if(!_.some(cq7))return!1;return k7().enabledPlugins?.[q]!==void 0}function XS6(q){let _=jP().plugins[q];if(!_||_.length===0)return!1;if(!_.some((Y)=>Y.scope==="user"||Y.scope==="managed"))return!1;return k7().enabledPlugins?.[q]!==void 0}function lq7(q,K,_="user",z){let Y=Fp(),$={scope:_,installPath:K.installPath,version:K.version,installedAt:K.installedAt,lastUpdated:K.lastUpdated,gitCommitSha:K.gitCommitSha,...z&&{projectPath:z}},O=Y.plugins[q]||[],A=O.findIndex((j)=>j.scope===_&&j.projectPath===z),w=A>=0;if(w)O[A]=$;else O.push($);Y.plugins[q]=O,bF8(Y),N(`${w?"Updated":"Added"} installed plugin: ${q} (scope: ${_})`)}async function CF8(q){return await mA8(q)??void 0}function jvK(q,K){let _=M8(),z=wJ6(q,".claude-plugin","plugin.json");try{let Y=_.readFileSync(z,{encoding:"utf-8"});return l8(Y).version||"unknown"}catch{return N(`Could not read version from manifest for ${K}`),"unknown"}}async function nq7(){let K=k7().enabledPlugins||{};if(Object.keys(K).length===0)return;let _=Uq7(),z=_!==null;
|
||
|
||
return _}async function Jq8(q,K,_="user",z,Y){let $=typeof K.source==="string"&&Y?Y:K.source,O=await Mq8($,{manifest:K}),A=Y||O.path,w=O.gitCommitSha??await CF8(A),j=MvK(),H=await ys(q,K.source,O.manifest,A,K.version,O.gitCommitSha),J=Qp(q,H),M=O.path;if(O.path!==J){await M8().mkdir(rq7(J)),await vwY(J,{recursive:!0,force:!0});let X=O.path.endsWith(aq7)?O.path:O.path+aq7;if(J.startsWith(X)){let W=TwY(rq7(O.path),`.claude-plugin-temp-${Date.now()}-${GwY(4).toString("hex")}`);await iq7(O.path,W),await M8().mkdir(rq7(J)),await iq7(W,J)}else await iq7(O.path,J);M=J}if(zx()){let X=PS6(q,H);await VF8(M,X),M=X}return lq7(q,{version:H,installedAt:j,lastUpdated:j,installPath:M,gitCommitSha:w},_,z),M}function XvK(q,K="user",_){let z=MvK();lq7(q.pluginId,{version:q.version||"unknown",installedAt:z,lastUpdated:z,installPath:q.installPath},K,_)}function sq7(q){switch(q.reason){case"cycle":return`Dependency cycle: ${q.chain.join(" → ")}`;case"cross-marketplace":{let K=T4(q.dependency).marketplace,_=K?`marketplace "${K}"`:"a different marketplace",z=K?` Add "${K}" to allowCrossMarketplaceDependenciesOn in the ROOT marketplace's marketplace.json (the marketplace of the plugin you're installing — only its allowlist applies; no transitive trust).`:"";return`Dependency "${q.dependency}" (required by ${q.requiredBy}) is in ${_}, which is not in the allowlist — cross-marketplace dependencies are blocked by default. Install it manually first.${z}`}case"not-found":{let{marketplace:K}=T4(q.missing);return K?`Dependency "${q.missing}" (required by ${q.requiredBy}) not found. Is the "${K}" marketplace added?`:`Dependency "${q.missing}" (required by ${q.requiredBy}) not found in any configured marketplace`}}}async function tq7({pluginId:q,entry:K,scope:_,marketplaceInstallLocation:z}){let Y=XU(_);if(Th(q))return{ok:!1,reason:"blocked-by-policy",pluginName:K.name};let $=new Map;if(mB6(K.source)&&!z)return{ok:!1,reason:"local-source-no-location",pluginName:K.name};if(z)$.set(q,{entry:K,marketplaceInstallLocation:z});
|
||
|
||
else switch(q.source){case"npm":await hwY(q.package,Y,{registry:q.registry,version:q.version});break;case"github":await SwY(q.repo,Y,q.ref,q.sha);break;case"url":await VvK(q.url,Y,q.ref,q.sha);break;case"git-subdir":O=await bwY(q.url,Y,q.path,q.ref,q.sha);break;case"pip":throw Error("Python package plugins are not yet supported");default:throw Error("Unsupported plugin source type")}}catch(M){if($&&await u5(Y)){N(`Cleaning up failed installation at ${Y}`);try{await jJ6(Y,{recursive:!0,force:!0})}catch(X){N(`Failed to clean up installation: ${X}`,{level:"error"})}}throw M}let A=Q9(Y,".claude-plugin","plugin.json"),w=Q9(Y,"plugin.json"),j;if(await u5(A))try{let M=await Xq8(A,{encoding:"utf-8"}),X=l8(M),P=Yz6().safeParse(X);if(P.success)j=P.data;else{let W=P.error.issues.map((D)=>`${D.path.join(".")}: ${D.message}`).join(", ");throw N(`Invalid manifest at ${A}: ${W}`,{level:"error"}),Error(`Plugin has an invalid manifest file at ${A}. Validation errors: ${W}`)}}catch(M){if(M instanceof Error&&M.message.includes("invalid manifest file"))throw M;let X=F6(M);throw N(`Failed to parse manifest at ${A}: ${X}`,{level:"error"}),Error(`Plugin has a corrupt manifest file at ${A}. JSON parse error: ${X}`)}else if(await u5(w))try{let M=await Xq8(w,{encoding:"utf-8"}),X=l8(M),P=Yz6().safeParse(X);if(P.success)j=P.data;else{let W=P.error.issues.map((D)=>`${D.path.join(".")}: ${D.message}`).join(", ");throw N(`Invalid legacy manifest at ${w}: ${W}`,{level:"error"}),Error(`Plugin has an invalid manifest file at ${w}. Validation errors: ${W}`)}}catch(M){if(M instanceof Error&&M.message.includes("invalid manifest file"))throw M;let X=F6(M);throw N(`Failed to parse legacy manifest at ${w}: ${X}`,{level:"error"}),Error(`Plugin has a corrupt manifest file at ${w}. JSON parse error: ${X}`)}else j=K?.manifest||{name:z,description:`Plugin cached from ${typeof q==="string"?q:q.source}`};let H=j.name.replace(/[^a-zA-Z0-9-_]/g,"-"),J=Q9(_,H);if(await u5(J))N(`Removing old cached version at ${J}`),await jJ6(J,{recursive:!0,force:!0});
|
||
|
||
return await GvK(Y,J),N(`Successfully cached plugin ${j.name} to ${J}`),{path:J,manifest:j,...O&&{gitCommitSha:O}}}async function pF8(q,K,_){if(!await u5(q))return{name:K,description:`Plugin from ${_}`};try{let z=await Xq8(q,{encoding:"utf-8"}),Y=l8(z),$=Yz6().safeParse(Y);if($.success)return $.data;let O=$.error.issues.map((A)=>A.path.length>0?`${A.path.join(".")}: ${A.message}`:A.message).join(", ");throw N(`Plugin ${K} has an invalid manifest file at ${q}. Validation errors: ${O}`,{level:"error"}),Error(`Plugin ${K} has an invalid manifest file at ${q}.
|
||
|
||
Validation errors: ${O}`)}catch(z){if(z instanceof Error&&z.message.includes("invalid manifest file"))throw z;let Y=F6(z);throw N(`Plugin ${K} has a corrupt manifest file at ${q}. Parse error: ${Y}`,{level:"error"}),Error(`Plugin ${K} has a corrupt manifest file at ${q}.
|
||
|
||
JSON parse error: ${Y}`)}}async function DvK(q,K){if(!await u5(q))throw Error(`Hooks file not found at ${q} for plugin ${K}. If the manifest declares hooks, the file must exist.`);let _=await Xq8(q,{encoding:"utf-8"}),z=l8(_);return Ow8().parse(z).hooks}async function c56(q,K,_,z,Y,$,O,A){let w=await Promise.all(q.map(async(H)=>{let J=Q9(K,H);return{relPath:H,fullPath:J,exists:await u5(J)}})),j=[];for(let{relPath:H,fullPath:J,exists:M}of w)if(M)j.push(J);else N(`${$} path ${H} ${O} not found at ${J} for ${_}`,{level:"warn"}),j6(Error(`Plugin component file not found: ${J} for ${_}`)),A.push({type:"path-not-found",source:z,plugin:_,path:J,component:Y});return j}async function NvK(q,K,_,z,Y=!0){let $=[],O=Q9(q,".claude-plugin","plugin.json"),A=await pF8(O,z,K),w={name:A.name,manifest:A,path:q,source:K,repository:K,enabled:_},[j,H,J,M]=await Promise.all([!A.commands?u5(Q9(q,"commands")):!1,!A.agents?u5(Q9(q,"agents")):!1,!A.skills?u5(Q9(q,"skills")):!1,!A.outputStyles?u5(Q9(q,"output-styles")):!1]),X=Q9(q,"commands");if(j)w.commandsPath=X;if(A.commands){let k=Object.values(A.commands)[0];
|
||
|
||
if(!Z)return Y.push({type:"plugin-not-found",source:P,pluginId:D,marketplace:f}),null;let k=M.plugins[P]?.[0];return q?pwY(Z.entry,Z.marketplaceInstallLocation,P,W===!0,Y,k?.installPath):BwY(Z.entry,Z.marketplaceInstallLocation,P,W===!0,Y,k?.version)}));for(let[P,W]of X.entries())if(W.status==="fulfilled"&&W.value)z.push(W.value);else if(W.status==="rejected"){let D=m1(W.reason);j6(D);let f=$[P][0];Y.push({type:"generic-error",source:f,plugin:FB6(f,"@"),error:D.message})}return{plugins:z,errors:Y}}async function pwY(q,K,_,z,Y,$){let O;if(typeof q.source==="string"){let A;try{A=(await vvK(K)).isDirectory()?K:Q9(K,"..")}catch{return Y.push({type:"plugin-cache-miss",source:_,plugin:q.name,installPath:K}),null}O=Q9(A,q.source)}else{if(!$||!await u5($))return Y.push({type:"plugin-cache-miss",source:_,plugin:q.name,installPath:$??"(not recorded)"}),null;O=$}if(zx()&&O.endsWith(".zip")){let A=await Lq7(),w=Q9(A,_.replace(/[^a-zA-Z0-9@\-_]/g,"-"));try{await hq7(O,w),O=w}catch(j){return N(`Failed to extract plugin ZIP ${O}: ${j}`,{level:"error"}),Y.push({type:"plugin-cache-miss",source:_,plugin:q.name,installPath:O}),null}}return EvK(q,_,z,Y,O)}async function BwY(q,K,_,z,Y,$){N(`Loading plugin ${q.name} from source: ${g6(q.source)}`);let O;if(typeof q.source==="string"){let A=(await vvK(K)).isDirectory()?K:Q9(K,".."),w=Q9(A,q.source);if(!await u5(w)){let j=Error(`Plugin path not found: ${w}`);return N(`Plugin path not found: ${w}`,{level:"error"}),j6(j),Y.push({type:"generic-error",source:_,error:`Plugin directory not found at path: ${w}. Check that the marketplace entry has the correct path.`}),null}try{let j=Q9(w,".claude-plugin","plugin.json"),H;try{H=await pF8(j,q.name,q.source)}catch{}let J=await ys(_,q.source,H,A,q.version);O=await mF8(w,_,J,q,A),N(`Resolved local plugin ${q.name} to versioned cache: ${O}`)}catch(j){let H=F6(j);
|
||
|
||
var oNK=L(()=>{x5();iNK();P57=Bs*kJ6,IMY=uMY();mMY=pMY();FMY={9617:0.25,9618:0.5,9619:0.75,9608:1};cMY=Buffer.from([137,80,78,71,13,10,26,10]),lMY=nMY()});import{mkdir as oMY,unlink as aMY,writeFile as sMY}from"fs/promises";import{tmpdir as tMY}from"os";import{join as aNK}from"path";async function sNK(q,K){try{let _=aNK(tMY(),"claude-code-screenshots");await oMY(_,{recursive:!0});let z=aNK(_,`screenshot-${Date.now()}.png`),Y=rNK(q,K);await sMY(z,Y);let $=await eMY(z);try{await aMY(z)}catch{}return $}catch(_){return j6(_),{success:!1,message:`Failed to copy screenshot: ${_ instanceof Error?_.message:"Unknown error"}`}}}async function eMY(q){let K=v1();if(K==="macos"){let z=`set the clipboard to (read (POSIX file "${q.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}") as «class PNGf»)`,Y=await x7("osascript",["-e",z],{timeout:5000});if(Y.code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:`Failed to copy to clipboard: ${Y.stderr}`}}if(K==="linux"){if((await x7("xclip",["-selection","clipboard","-t","image/png","-i",q],{timeout:5000})).code===0)return{success:!0,message:"Screenshot copied to clipboard"};if((await x7("xsel",["--clipboard","--input","--type","image/png"],{timeout:5000})).code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:"Failed to copy to clipboard. Please install xclip or xsel: sudo apt install xclip"}}if(K==="windows"){let _=`Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::SetImage([System.Drawing.Image]::FromFile('${q.replace(/'/g,"''")}'))`,z=await x7("powershell",["-NoProfile","-Command",_],{timeout:5000});if(z.code===0)return{success:!0,message:"Screenshot copied to clipboard"};return{success:!1,message:`Failed to copy to clipboard: ${z.stderr}`}}return{success:!1,message:`Screenshot to clipboard is not supported on ${K}`}}var tNK=L(()=>{oNK();PK();h8();NK()});import{open as qXY}from"fs/promises";import{basename as KXY,join as nU8,sep as eNK}from"path";
|
||
|
||
if(K[16]!==P||K[17]!==j||K[18]!==$||K[19]!==O)R=YY.createElement(hA,{key:"commands",title:"commands"},YY.createElement(S57,{commands:P,maxHeight:O,columns:$,title:"Browse default commands:",onCancel:j})),K[16]=P,K[17]=j,K[18]=$,K[19]=O,K[20]=R;else R=K[20];G.push(R);let b;if(K[21]!==j||K[22]!==$||K[23]!==D||K[24]!==O)b=YY.createElement(hA,{key:"custom",title:"custom-commands"},YY.createElement(S57,{commands:D,maxHeight:O,columns:$,title:"Browse custom commands:",emptyMessage:"No custom commands found",onCancel:j})),K[21]=j,K[22]=$,K[23]=D,K[24]=O,K[25]=b;else b=K[25];G.push(b),K[9]=X,K[10]=P,K[11]=j,K[12]=$,K[13]=D,K[14]=O,K[15]=G}else G=K[15];let Z=A?void 0:O,v;if(K[31]!==G)v=YY.createElement(Jx,{title:`Claude Code v${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION}`,color:"professionalBlue",defaultTab:"general"},G),K[31]=G,K[32]=v;else v=K[32];let k;if(K[33]===Symbol.for("react.memo_cache_sentinel"))k=YY.createElement(u,{marginTop:1},YY.createElement(T,null,"For more help:"," ",YY.createElement(Sq,{url:"https://code.claude.com/docs/en/overview"}))),K[33]=k;else k=K[33];let V;if(K[34]!==M||K[35]!==J.keyName||K[36]!==J.pending)V=YY.createElement(u,{marginTop:1},YY.createElement(T,{dimColor:!0},J.pending?YY.createElement(YY.Fragment,null,"Press ",J.keyName," again to exit"):YY.createElement(T,{italic:!0},M," to cancel"))),K[34]=M,K[35]=J.keyName,K[36]=J.pending,K[37]=V;else V=K[37];let y;if(K[38]!==v||K[39]!==V)y=YY.createElement(Y_,{color:"professionalBlue"},v,k,V),K[38]=v,K[39]=V,K[40]=y;else y=K[40];let E;if(K[41]!==Z||K[42]!==y)E=YY.createElement(u,{flexDirection:"column",height:Z},y),K[41]=Z,K[42]=y,K[43]=E;else E=K[43];return E}var YY;var cEK=L(()=>{t6();J2();NM();FO();Zb();u4();i6();Kq();lX();Mx();BEK();QEK();YY=w6(D6(),1)});var lEK={};
|
||
|
||
var tEK=L(()=>{t6();i6();k1();i2();b_();x4();dS6=w6(D6(),1)});var qLK={};v8(qLK,{formatWorkspaceFolders:()=>I57,call:()=>vDY});import*as eEK from"path";function HDY(q){let K=Y6(39),{availableIDEs:_,unavailableIDEs:z,selectedIDE:Y,onClose:$,onSelect:O}=q,A;if(K[0]!==Y?.port)A=Y?.port?.toString()??"None",K[0]=Y?.port,K[1]=A;else A=K[1];let[w,j]=V_.useState(A),[H,J]=V_.useState(!1),[M,X]=V_.useState(!1),P;if(K[2]!==_||K[3]!==O)P=(I)=>{if(I!=="None"&&oEK())J(!0);else if(I==="None"&&sEK())X(!0);else O(_.find((m)=>m.port===parseInt(I)))},K[2]=_,K[3]=O,K[4]=P;else P=K[4];let W=P,D;if(K[5]!==_)D=_.reduce(XDY,{}),K[5]=_,K[6]=D;else D=K[6];let f=D,G;if(K[7]!==_||K[8]!==f){let I;if(K[10]!==f)I=(m)=>{let C=(f[m.name]||0)>1&&m.workspaceFolders.length>0;return{label:m.name,value:m.port.toString(),description:C?I57(m.workspaceFolders):void 0}},K[10]=f,K[11]=I;else I=K[11];G=_.map(I).concat([{label:"None",value:"None",description:void 0}]),K[7]=_,K[8]=f,K[9]=G}else G=K[9];let Z=G;if(H){let I;if(K[12]!==W||K[13]!==w)I=V_.default.createElement(rEK,{onComplete:()=>W(w)}),K[12]=W,K[13]=w,K[14]=I;else I=K[14];return I}if(M){let I;if(K[15]!==O)I=V_.default.createElement(aEK,{onComplete:()=>{O(void 0)}}),K[15]=O,K[16]=I;else I=K[16];return I}let v;if(K[17]!==_.length)v=_.length===0&&V_.default.createElement(T,{dimColor:!0},Ty6()?`No available IDEs detected. Please install the plugin and restart your IDE:
|
||
https://docs.claude.com/s/claude-code-jetbrains`:"No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running."),K[17]=_.length,K[18]=v;else v=K[18];let k;if(K[19]!==_.length||K[20]!==W||K[21]!==Z||K[22]!==w)k=_.length!==0&&V_.default.createElement(j1,{defaultValue:w,defaultFocusValue:w,options:Z,onChange:(I)=>{j(I),W(I)}}),K[19]=_.length,K[20]=W,K[21]=Z,K[22]=w,K[23]=k;else k=K[23];let V;
|
||
|
||
return Cv.default.createElement(p1,null,Cv.default.createElement(e8,{shortcut:"↑↓",action:"navigate"}),Cv.default.createElement(e8,{shortcut:"Space",action:"toggle"}),Cv.default.createElement(e8,{shortcut:"Enter",action:"confirm"}),Cv.default.createElement(Z1,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}))}function fLK(q){let K=Y6(14),{onSubmit:_,defaultSelections:z}=q,[Y,$]=Cv.useState(!1),O;if(K[0]!==_)O=(f)=>{if(f.length===0){$(!0);return}$(!1),_(f)},K[0]=_,K[1]=O;else O=K[1];let A=O,w;if(K[2]===Symbol.for("react.memo_cache_sentinel"))w=()=>{$(!1)},K[2]=w;else w=K[2];let j=w,H;if(K[3]===Symbol.for("react.memo_cache_sentinel"))H=()=>{$(!0)},K[3]=H;else H=K[3];let J=H,M;if(K[4]===Symbol.for("react.memo_cache_sentinel"))M=Cv.default.createElement(u,null,Cv.default.createElement(T,{dimColor:!0},"More workflow examples (issue triage, CI fixes, etc.) at:"," ",Cv.default.createElement(Sq,{url:"https://github.com/anthropics/claude-code-action/blob/main/examples/"},"https://github.com/anthropics/claude-code-action/blob/main/examples/"))),K[4]=M;else M=K[4];let X;if(K[5]===Symbol.for("react.memo_cache_sentinel"))X=uDY.map(pDY),K[5]=X;else X=K[5];let P;if(K[6]!==z||K[7]!==A)P=Cv.default.createElement(l46,{options:X,defaultValue:z,onSubmit:A,onChange:j,onCancel:J,hideIndexes:!0}),K[6]=z,K[7]=A,K[8]=P;else P=K[8];let W;if(K[9]!==Y)W=Y&&Cv.default.createElement(u,null,Cv.default.createElement(T,{color:"error"},"You must select at least one workflow to continue")),K[9]=Y,K[10]=W;else W=K[10];let D;if(K[11]!==P||K[12]!==W)D=Cv.default.createElement(h1,{title:"Select GitHub workflows to install",subtitle:"We'll create a workflow file in your repository for each one you select.",onCancel:J,inputGuide:mDY},M,P,W),K[11]=P,K[12]=W,K[13]=D;else D=K[13];return D}function pDY(q){return{label:q.label,value:q.value}}var Cv,uDY;var ZLK=L(()=>{t6();i6();q3();Rt6();IK();x4();dK();
|
||
|
||
Cv=w6(D6(),1),uDY=[{value:"claude",label:"@Claude Code - Tag @claude in issues and PR comments"},{value:"claude-review",label:"Claude Code Review - Automated code review on new PRs"}]});
|
||
|
||
function VLK(q){let K=Y6(55),{existingApiKey:_,apiKeyOrOAuthToken:z,onApiKeyChange:Y,onSubmit:$,onToggleUseExistingKey:O,onCreateOAuthToken:A,selectedOption:w,onSelectOption:j}=q,H=w===void 0?_?"existing":A?"oauth":"new":w,[J,M]=Jf.useState(0),X=o1(),[P]=Aq(),W;if(K[0]!==_||K[1]!==A||K[2]!==j||K[3]!==O||K[4]!==H)W=()=>{if(H==="new"&&A)j?.("oauth");else if(H==="oauth"&&_)j?.("existing"),O(!0)},K[0]=_,K[1]=A,K[2]=j,K[3]=O,K[4]=H,K[5]=W;else W=K[5];let D=W,f;if(K[6]!==A||K[7]!==j||K[8]!==O||K[9]!==H)f=()=>{if(H==="existing")j?.(A?"oauth":"new"),O(!1);else if(H==="oauth")j?.("new")},K[6]=A,K[7]=j,K[8]=O,K[9]=H,K[10]=f;else f=K[10];let G=f,Z;if(K[11]!==A||K[12]!==$||K[13]!==H)Z=()=>{if(H==="oauth"&&A)A();else $()},K[11]=A,K[12]=$,K[13]=H,K[14]=Z;else Z=K[14];let v=Z,k=H==="new",V;if(K[15]!==v||K[16]!==G||K[17]!==D)V={"confirm:previous":D,"confirm:next":G,"confirm:yes":v},K[15]=v,K[16]=G,K[17]=D,K[18]=V;else V=K[18];let y=!k,E;if(K[19]!==y)E={context:"Confirmation",isActive:y},K[19]=y,K[20]=E;else E=K[20];p7(V,E);let R;if(K[21]!==G||K[22]!==D)R={"confirm:previous":D,"confirm:next":G},K[21]=G,K[22]=D,K[23]=R;else R=K[23];let b;if(K[24]!==k)b={context:"Confirmation",isActive:k},K[24]=k,K[25]=b;else b=K[25];p7(R,b);let I;if(K[26]===Symbol.for("react.memo_cache_sentinel"))I=Jf.default.createElement(u,{flexDirection:"column",marginBottom:1},Jf.default.createElement(T,{bold:!0},"Install GitHub App"),Jf.default.createElement(T,{dimColor:!0},"Choose API key")),K[26]=I;else I=K[26];let m;if(K[27]!==_||K[28]!==H||K[29]!==P)m=_&&Jf.default.createElement(u,{marginBottom:1},Jf.default.createElement(T,null,H==="existing"?b7("success",P)("> "):" ","Use your existing Claude Code API key")),K[27]=_,K[28]=H,K[29]=P,K[30]=m;else m=K[30];let p;if(K[31]!==A||K[32]!==H||K[33]!==P)p=A&&Jf.default.createElement(u,{marginBottom:1},Jf.default.createElement(T,null,H==="oauth"?b7("success",P)("> "):" ","Create a long-lived token with your Claude subscription")),K[31]=A,K[32]=H,K[33]=P,K[34]=p;else p=K[34];let C;
|
||
|
||
if(K[8]===Symbol.for("react.memo_cache_sentinel"))M=Qy.default.createElement(u,{flexDirection:"column",marginBottom:1},Qy.default.createElement(T,null,"A Claude workflow file already exists at"," ",Qy.default.createElement(T,{color:"claude"},".github/workflows/claude.yml")),Qy.default.createElement(T,{dimColor:!0},"What would you like to do?")),K[8]=M;else M=K[8];let X;if(K[9]!==j||K[10]!==A)X=Qy.default.createElement(u,{flexDirection:"column"},Qy.default.createElement(j1,{options:$,onChange:A,onCancel:j})),K[9]=j,K[10]=A,K[11]=X;else X=K[11];let P;if(K[12]===Symbol.for("react.memo_cache_sentinel"))P=Qy.default.createElement(u,{marginTop:1},Qy.default.createElement(T,{dimColor:!0},"View the latest workflow template at:"," ",Qy.default.createElement(T,{color:"claude"},"https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml"))),K[12]=P;else P=K[12];let W;if(K[13]!==J||K[14]!==X)W=Qy.default.createElement(u,{flexDirection:"column",borderStyle:"round",borderDimColor:!0,paddingX:1},J,M,X,P),K[13]=J,K[14]=X,K[15]=W;else W=K[15];return W}var Qy;var pLK=L(()=>{t6();b_();i6();Qy=w6(D6(),1)});function BLK(q){let K=Y6(12),{repoUrl:_,onSubmit:z}=q,Y;if(K[0]===Symbol.for("react.memo_cache_sentinel"))Y={context:"Confirmation"},K[0]=Y;else Y=K[0];f1("confirm:yes",z,Y);let $;if(K[1]===Symbol.for("react.memo_cache_sentinel"))$=MP.default.createElement(u,{flexDirection:"column",marginBottom:1},MP.default.createElement(T,{bold:!0},"Install the Claude GitHub App")),K[1]=$;else $=K[1];let O;if(K[2]===Symbol.for("react.memo_cache_sentinel"))O=MP.default.createElement(u,{marginBottom:1},MP.default.createElement(T,null,"Opening browser to install the Claude GitHub App…")),K[2]=O;else O=K[2];let A;if(K[3]===Symbol.for("react.memo_cache_sentinel"))A=MP.default.createElement(u,{marginBottom:1},MP.default.createElement(T,null,"If your browser doesn't open automatically, visit:")),K[3]=A;else A=K[3];let w;
|
||
|
||
q.onDone(_.step==="success"?"GitHub Actions setup complete!":_.error?`Couldn't install GitHub App: ${_.error}
|
||
For manual setup instructions, see: ${ed}`:`GitHub App installation failed
|
||
For manual setup instructions, see: ${ed}`)}switch(_.step){case"check-gh":return pw.default.createElement(hLK,null);case"warnings":return pw.default.createElement(iLK,{warnings:_.warnings,onContinue:H});case"choose-repo":return pw.default.createElement(SLK,{currentRepo:_.currentRepo,useCurrentRepo:_.useCurrentRepo,repoUrl:_.selectedRepoName,onRepoUrlChange:J,onToggleUseCurrentRepo:G,onSubmit:H});case"install-app":return pw.default.createElement(BLK,{repoUrl:_.selectedRepoName,onSubmit:H});case"check-existing-workflow":return pw.default.createElement(mLK,{repoName:_.selectedRepoName,onSelectAction:k});case"check-existing-secret":return pw.default.createElement(yLK,{useExistingSecret:_.useExistingSecret,secretName:_.secretName,onToggleUseExistingSecret:v,onSecretNameChange:f,onSubmit:H});case"api-key":return pw.default.createElement(VLK,{existingApiKey:K,useExistingKey:_.useExistingKey,apiKeyOrOAuthToken:_.apiKeyOrOAuthToken,onApiKeyChange:M,onToggleUseExistingKey:Z,onSubmit:H,onCreateOAuthToken:yJ()?P:void 0,selectedOption:_.selectedApiKeyOption,onSelectOption:X});case"creating":return pw.default.createElement(bLK,{currentWorkflowInstallStep:_.currentWorkflowInstallStep,secretExists:_.secretExists,useExistingSecret:_.useExistingSecret,secretName:_.secretName,skipWorkflow:_.workflowAction==="skip",selectedWorkflows:_.selectedWorkflows});case"success":return pw.default.createElement(u,{tabIndex:0,autoFocus:!0,onKeyDown:V},pw.default.createElement(dLK,{secretExists:_.secretExists,useExistingSecret:_.useExistingSecret,secretName:_.secretName,skipWorkflow:_.workflowAction==="skip"}));case"error":return pw.default.createElement(u,{tabIndex:0,autoFocus:!0,onKeyDown:V},pw.default.createElement(ILK,{error:_.error,errorReason:_.errorReason,errorInstructions:_.errorInstructions}));
|
||
|
||
if(q[0]===Symbol.for("react.memo_cache_sentinel"))K=cGK(),q[0]=K;else K=q[0];let _=K,z;if(q[1]===Symbol.for("react.memo_cache_sentinel"))z=SJ6.createElement(T,{color:"claude"},o6.warning," "),q[1]=z;else z=q[1];let Y;if(q[2]===Symbol.for("react.memo_cache_sentinel"))Y=SJ6.createElement(u,{marginBottom:1},z,SJ6.createElement(T,{dimColor:!0,italic:!0},"Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.",_?` ${_}`:"")),q[2]=Y;else Y=q[2];return Y}var SJ6;var t57=L(()=>{t6();Iq();i6();md();SJ6=w6(D6(),1)});function A36(q){if(q.entry.source&&typeof q.entry.source==="object"&&"source"in q.entry.source&&q.entry.source.source==="github"&&typeof q.entry.source==="object"&&"repo"in q.entry.source)return q.entry.source.repo;return null}function oS6(q,K){let _=[{label:"Install for you (user scope)",action:"install-user"},{label:"Install for all collaborators on this repository (project scope)",action:"install-project"},{label:"Install for you, in this repo only (local scope)",action:"install-local"}];if(q)_.push({label:"Open homepage",action:"homepage"});if(K)_.push({label:"View on GitHub",action:"github"});return _.push({label:"Back to plugin list",action:"back"}),_}function hhK(q){let K=Y6(7),{hasSelection:_}=q,z;if(K[0]!==_)z=_&&mk.createElement(Z1,{action:"plugin:install",context:"Plugin",fallback:"i",description:"install",bold:!0}),K[0]=_,K[1]=z;else z=K[1];let Y,$,O;if(K[2]===Symbol.for("react.memo_cache_sentinel"))Y=mk.createElement(Z1,{action:"plugin:toggle",context:"Plugin",fallback:"Space",description:"toggle"}),$=mk.createElement(Z1,{action:"select:accept",context:"Select",fallback:"Enter",description:"details"}),O=mk.createElement(Z1,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"back"}),K[2]=Y,K[3]=$,K[4]=O;else Y=K[2],$=K[3],O=K[4];let A;
|
||
|
||
f1("confirm:no",q6,{context:"Confirmation"}),yW.useEffect(()=>{async function J6(){try{let G6=await Kz(),{marketplaces:H6,failures:e}=await Up(G6),a=[];for(let{name:i,config:A6,data:O6}of H6)if(O6){let X6=w7(O6.plugins,(v6)=>nb(ud(v6.name,i)));a.push({name:i,totalPlugins:O6.plugins.length,installedCount:X6,source:e78(A6.source)})}a.sort((i,A6)=>{if(i.name==="claude-plugin-directory")return-1;if(A6.name==="claude-plugin-directory")return 1;return 0}),W(a);let _6=w7(H6,(i)=>i.data!==null),l=JS6(e,_6);if(l)if(l.type==="warning")o(l.message+". Showing available marketplaces.");else throw Error(l.message);if(a.length===1&&!O&&!A){let i=a[0];if(i)J(i.name),j("plugin-list")}if(A){let i=null,A6=null;for(let[O6]of Object.entries(G6)){let X6=await G0(O6);if(X6){let v6=X6.plugins.find((x6)=>x6.name===A);if(v6){let x6=ud(v6.name,O6);i={entry:v6,marketplaceName:O6,pluginId:x6,isInstalled:XS6(x6)},A6=O6;break}}}if(i&&A6){let O6=i.pluginId;if(XS6(O6))K(`Plugin '${O6}' is already installed globally. Use '/plugin' to manage existing plugins.`);else J(A6),X(i),j("plugin-details")}else K(`Plugin "${A}" not found in any marketplace`)}else if(O)if(a.some((A6)=>A6.name===O))J(O),j("plugin-list");else K(`Marketplace "${O}" not found`)}catch(G6){K(G6 instanceof Error?G6.message:"Failed to load marketplaces")}finally{Z(!1)}}J6()},[K,O,A]),yW.useEffect(()=>{if(!H)return;let J6=!1;async function G6(H6){Z(!0);try{let e=await G0(H6);if(J6)return;if(!e)throw Error(`Failed to load marketplace: ${H6}`);let a=[];for(let _6 of e.plugins){let l=ud(_6.name,H6);if(Th(l))continue;a.push({entry:_6,marketplaceName:H6,pluginId:l,isInstalled:XS6(l)})}try{let _6=await iS6();if(J6)return;if(k(_6),_6)a.sort((l,i)=>{let A6=_6.get(l.pluginId)??0,O6=_6.get(i.pluginId)??0;if(A6!==O6)return O6-A6;return l.entry.name.localeCompare(i.entry.name)});else a.sort((l,i)=>l.entry.name.localeCompare(i.entry.name))}catch(_6){if(J6)return;
|
||
|
||
try{X=await A.stat(z)}catch(f){if(K7(f))return{success:!1,message:`Marketplace directory not found at ${z}`,pluginId:q,scope:$};throw f}let P=X.isDirectory()?z:UfY(z);j=xhK(P,_.source);try{await A.stat(j)}catch(f){if(K7(f))return{success:!1,message:`Plugin source not found at ${j}`,pluginId:q,scope:$};throw f}let W,D=xhK(j,".claude-plugin","plugin.json");try{W=await pF8(D,_.name,_.source)}catch{}H=await ys(q,_.source,W,j,_.version)}try{let X=Qp(q,H),P=PS6(q,H);if(Y.version===H||Y.installPath===X||Y.installPath===P)return{success:!0,message:`${K} is already at the latest version (${H}).`,pluginId:q,newVersion:H,oldVersion:w,alreadyUpToDate:!0,scope:$};X=await mF8(j,q,H,_);let D=Y.installPath;if(JvK(q,$,O,X,H,M),D&&D!==X){let Z=Fp();if(!Object.values(Z.plugins).some((k)=>k.some((V)=>V.installPath===D)))await wS6(D)}let f=O?`${$} (${O})`:$;return{success:!0,message:`Plugin "${K}" updated from ${w||"unknown"} to ${H} for scope ${f}. Restart to apply changes.`,pluginId:q,newVersion:H,oldVersion:w,scope:$}}finally{if(J&&j!==Qp(q,H))await A.rm(j,{recursive:!0,force:!0})}}var N0,CJ6;var qC6=L(()=>{T8();Ui6();E8();e7();h8();By();Yk8();_P();mw();SN();oP();d56();g2();Hm();JH6();nS6();xF8();i1();N0=["user","project","local"],CJ6=["user","project","local","managed"]});function BhK(q){if(RQ8=q,M48!==null&&M48.length>0)q(M48),M48=null;return()=>{RQ8=null}}async function nfY(){let q=await Kz(),K=g56(),_=new Set;for(let[z,Y]of Object.entries(q)){let $=K[z]?.autoUpdate;if($!==void 0?$:IB6(z,Y))_.add(z.toLowerCase())}return _}async function ifY(q,K){let _=!1;for(let{scope:z}of K)try{let Y=await eS6(q,z);if(Y.success&&!Y.alreadyUpToDate)_=!0,N(`Plugin autoupdate: updated ${q} from ${Y.oldVersion} to ${Y.newVersion}`);else if(!Y.alreadyUpToDate)N(`Plugin autoupdate: failed to update ${q}: ${Y.message}`,{level:"warn"})}catch(Y){N(`Plugin autoupdate: error updating ${q}: ${F6(Y)}`,{level:"warn"})}return _?q:null}async function _37(q){let K=Fp(),_=Object.keys(K.plugins);if(_.length===0)return[];
|
||
|
||
return(await Promise.allSettled(_.map(async(Y)=>{let{marketplace:$}=T4(Y);if(!$||!q.has($.toLowerCase()))return null;let O=K.plugins[Y];if(!O||O.length===0)return null;let A=O.filter(cq7);if(A.length===0)return null;return ifY(Y,A)}))).filter((Y)=>Y.status==="fulfilled"&&Y.value!==null).map((Y)=>Y.value)}async function rfY(q){return _37(q)}function ghK(){return(async()=>{if(Ev6()){N("Plugin autoupdate: skipped (auto-updater disabled)");return}try{let q=await nfY();if(q.size===0)return;let _=(await Promise.allSettled(Array.from(q).map(async(Y)=>{try{await U56(Y,void 0,{disableCredentialHelper:!0})}catch($){N(`Plugin autoupdate: failed to refresh marketplace ${Y}: ${F6($)}`,{level:"warn"})}}))).filter((Y)=>Y.status==="rejected");if(_.length>0)N(`Plugin autoupdate: ${_.length} marketplace refresh(es) failed`,{level:"warn"});N("Plugin autoupdate: checking installed plugins");let z=await rfY(q);if(z.length>0)if(RQ8)RQ8(z);else M48=z}catch(q){j6(q)}})()}var RQ8=null,M48=null;var SQ8=L(()=>{qC6();k1();_8();E8();h8();_P();mw();oP();JG()});function FhK({setViewState:q,error:K,setError:_,setResult:z,exitState:Y,onManageComplete:$,targetMarketplace:O,action:A}){let[w,j]=pk.useState([]),[H,J]=pk.useState(!0),[M,X]=pk.useState(0),[P,W]=pk.useState(!1),[D,f]=pk.useState(null),[G,Z]=pk.useState(null),[v,k]=pk.useState(null),[V,y]=pk.useState("list"),[E,R]=pk.useState(null),[b,I]=pk.useState(0),m=pk.useRef(!1);pk.useEffect(()=>{async function q6(){try{let t=await Kz(),{enabled:n,disabled:z6}=await UM(),M6=[...n,...z6],{marketplaces:J6,failures:G6}=await Up(t),H6=[];for(let{name:_6,config:l,data:i}of J6){let A6=M6.filter((O6)=>O6.source.endsWith(`@${_6}`));H6.push({name:_6,source:e78(l.source),lastUpdated:l.lastUpdated,pluginCount:i?.plugins.length,installedPlugins:A6,pendingUpdate:!1,pendingRemove:!1,autoUpdate:IB6(_6,l)})}H6.sort((_6,l)=>{if(_6.name==="claude-plugin-directory")return-1;if(l.name==="claude-plugin-directory")return 1;return _6.name.localeCompare(l.name)}),j(H6);let e=w7(J6,(_6)=>_6.data!==null),a=JS6(G6,e);
|
||
|
||
return o8.createElement(u,{key:q6.name,flexDirection:"row",gap:1,marginBottom:1},o8.createElement(T,{color:n?"suggestion":void 0},n?o6.pointer:" "," ",q6.pendingRemove?o6.cross:o6.bullet),o8.createElement(u,{flexDirection:"column",flexGrow:1},o8.createElement(u,{flexDirection:"row",gap:1},o8.createElement(T,{bold:!0,strikethrough:q6.pendingRemove,dimColor:q6.pendingRemove},q6.name==="claude-plugins-official"&&o8.createElement(T,{color:"claude"},"✻ "),q6.name,q6.name==="claude-plugins-official"&&o8.createElement(T,{color:"claude"}," ✻")),z6.length>0&&o8.createElement(T,{color:"warning"},"[",z6.join(", "),"]")),o8.createElement(T,{dimColor:!0},q6.source),o8.createElement(T,{dimColor:!0},q6.pluginCount!==void 0&&o8.createElement(o8.Fragment,null,q6.pluginCount," available"),q6.installedPlugins&&q6.installedPlugins.length>0&&o8.createElement(o8.Fragment,null," • ",q6.installedPlugins.length," installed"),q6.lastUpdated&&o8.createElement(o8.Fragment,null," ","• Updated"," ",new Date(q6.lastUpdated).toLocaleDateString()))))})),p()&&o8.createElement(u,{marginTop:1,flexDirection:"column"},o8.createElement(T,null,o8.createElement(T,{bold:!0},"Pending changes:")," ",o8.createElement(T,{dimColor:!0},"Enter to apply")),K6>0&&o8.createElement(T,null,"• Update ",K6," ",H7(K6,"marketplace")),o>0&&o8.createElement(T,{color:"warning"},"• Remove ",o," ",H7(o,"marketplace"))),P&&o8.createElement(u,{marginTop:1},o8.createElement(T,{color:"claude"},"Processing changes…")),D&&o8.createElement(u,{marginTop:1},o8.createElement(T,{color:"error"},D)),o8.createElement(ofY,{exitState:Y,hasPendingActions:p()}))}function ofY(q){let K=Y6(18),{exitState:_,hasPendingActions:z}=q;if(_.pending){let J;if(K[0]!==_.keyName)J=o8.createElement(u,{marginTop:1},o8.createElement(T,{dimColor:!0,italic:!0},"Press ",_.keyName," again to go back")),K[0]=_.keyName,K[1]=J;else J=K[1];return J}let Y;if(K[2]!==z)Y=z&&o8.createElement(Z1,{action:"select:accept",context:"Select",fallback:"Enter",description:"apply changes"}),K[2]=z,K[3]=Y;else Y=K[3];let $;
|
||
|
||
S6.get(r6).push(e6)}for(let e6 of $6){let r6=e6.scope;if(!S6.has(r6))S6.set(r6,[]);S6.get(r6).push(e6)}for(let[e6,r6]of Object.entries(H)){let R8=T4(e6),C8=R8.name||e6,b8=R8.marketplace||"unknown";if(!S6.has("flagged"))S6.set("flagged",[]);S6.get("flagged").push({type:"flagged-plugin",id:e6,name:C8,marketplace:b8,scope:"flagged",reason:"delisted",text:"Removed from marketplace",flaggedAt:r6.flaggedAt})}let q8=[...S6.keys()].sort((e6,r6)=>(P6[e6]??99)-(P6[r6]??99));for(let e6 of q8){let r6=S6.get(e6),R8=[],C8=[],b8=0;while(b8<r6.length){let E1=r6[b8];if(E1.type==="plugin"||E1.type==="failed-plugin"||E1.type==="flagged-plugin"){let _7=[E1];b8++;let D1=r6[b8];while(D1?.type==="mcp"&&D1.indented)_7.push(D1),b8++,D1=r6[b8];R8.push(_7)}else if(E1.type==="mcp"&&!E1.indented)C8.push(E1),b8++;else b8++}R8.sort((E1,_7)=>E1[0].name.localeCompare(_7[0].name)),C8.sort((E1,_7)=>E1.name.localeCompare(_7.name));for(let E1 of R8)V6.push(...E1);V6.push(...C8)}return V6},[m,A,j,F,H]),z6=RY.useMemo(()=>n.filter((k6)=>k6.type==="flagged-plugin").map((k6)=>k6.id),[n]);RY.useEffect(()=>{if(z6.length>0)lhK(z6)},[z6]);let M6=RY.useMemo(()=>{if(!k)return n;let k6=k.toLowerCase();return n.filter((C6)=>C6.name.toLowerCase().includes(k6)||("description"in C6)&&C6.description?.toLowerCase().includes(k6))},[n,k]),[J6,G6]=RY.useState(0),H6=W?Math.max(8,G-10):8,e=aS6({totalItems:M6.length,selectedIndex:J6,maxVisible:H6}),[a,_6]=RY.useState(0),[l,i]=RY.useState(!1),[A6,O6]=RY.useState(null),[X6,v6]=RY.useState(null),[x6,R6]=RY.useState(!1),[W6,N6]=RY.useState(!1);RY.useEffect(()=>{if(!E){N6(!1);return}async function k6(){let C6=E.plugin.manifest.mcpServers,L6=!1;if(C6)L6=typeof C6==="string"&&nC(C6)||Array.isArray(C6)&&C6.some((m6)=>typeof m6==="string"&&nC(m6));if(!L6)try{let m6=zC6.join(E.plugin.path,".."),b6=zC6.join(m6,".claude-plugin","marketplace.json"),T6=await bJ6.readFile(b6,"utf-8"),$6=l8(T6).plugins?.find((h6)=>h6.name===E.plugin.name);if($6?.mcpServers){let h6=$6.mcpServers;
|
||
|
||
L6=typeof h6==="string"&&nC(h6)||Array.isArray(h6)&&h6.some((P6)=>typeof P6==="string"&&nC(P6))}}catch(m6){N(`Failed to read raw marketplace.json: ${m6}`)}N6(L6)}k6()},[E]),RY.useEffect(()=>{async function k6(){g(!0);try{let{enabled:C6,disabled:L6}=await UM(),m6=k7(),b6=wZY([...C6,...L6]),T6={};for(let h6 of b6){let P6=h6.source.split("@")[1]||"local";if(!T6[P6])T6[P6]=[];T6[P6].push(h6)}let s=[];for(let[h6,P6]of Object.entries(T6)){let V6=w7(P6,(q8)=>{let e6=`${q8.name}@${h6}`;return m6?.enabledPlugins?.[e6]!==!1}),S6=P6.length-V6;s.push({name:h6,installedPlugins:P6,enabledCount:V6,disabledCount:S6})}s.sort((h6,P6)=>{if(h6.name==="claude-plugin-directory")return-1;if(P6.name==="claude-plugin-directory")return 1;return h6.name.localeCompare(P6.name)}),I(s);let $6=[];for(let h6 of s)for(let P6 of h6.installedPlugins){let V6=`${P6.name}@${h6.name}`,S6=P6.isBuiltin?"builtin":hQ8(V6).scope;$6.push({plugin:P6,marketplace:h6.name,scope:S6,pendingEnable:void 0,pendingUpdate:!1})}p($6),G6(0)}finally{g(!1)}}k6()},[]),RY.useEffect(()=>{if(c.current)return;if(Y&&b.length>0&&!C){let{name:k6,marketplace:C6}=T4(Y),L6=$??C6,m6=L6?b.filter((T6)=>T6.name===L6):b;for(let T6 of m6){let s=T6.installedPlugins.find(($6)=>$6.name===k6);if(s){let $6=`${s.name}@${T6.name}`,{scope:h6}=hQ8($6),P6={plugin:s,marketplace:T6.name,scope:h6,pendingEnable:void 0,pendingUpdate:!1};R(P6),v("plugin-details"),K6.current=O,c.current=!0;return}}let b6=n.find((T6)=>T6.type==="failed-plugin"&&T6.name===k6);if(b6&&b6.type==="failed-plugin")v({type:"failed-plugin-details",plugin:{id:b6.id,name:b6.name,marketplace:b6.marketplace,errors:b6.errors,scope:b6.scope}}),c.current=!0;if(!c.current&&O)c.current=!0,K(`Plugin "${Y}" is not installed in this project`)}},[Y,$,b,C,n,O,K]);let Z6=async(k6)=>{if(!E)return;let C6=E.scope||"user",L6=C6==="builtin";if(L6&&(k6==="update"||k6==="uninstall")){O6("Built-in plugins cannot be updated or uninstalled.");
|
||
|
||
case"uninstall":return{type:"uninstall",plugin:K[1]};case"enable":return{type:"enable",plugin:K[1]};case"disable":return{type:"disable",plugin:K[1]};case"validate":return{type:"validate",path:K.slice(1).join(" ").trim()||void 0};case"marketplace":case"market":{let z=K[1]?.toLowerCase(),Y=K.slice(2).join(" ");switch(z){case"add":return{type:"marketplace",action:"add",target:Y};case"remove":case"rm":return{type:"marketplace",action:"remove",target:Y};case"update":return{type:"marketplace",action:"update",target:Y};case"list":return{type:"marketplace",action:"list"};default:return{type:"marketplace"}}}default:return{type:"menu"}}}import{readdir as jZY,readFile as YC6,stat as HZY}from"fs/promises";import*as dJ from"path";function MZY(q){let K=dJ.basename(q),_=dJ.basename(dJ.dirname(q));if(K==="plugin.json")return"plugin";if(K==="marketplace.json")return"marketplace";if(_===".claude-plugin")return"plugin";return"unknown"}function O37(q){return q.issues.map((K)=>({path:K.path.join(".")||"root",message:K.message,code:K.code}))}function X48(q,K,_,z){if(q.includes(".."))_.push({path:K,message:z?`Path contains "..": ${q}. ${z}`:`Path contains ".." which could be a path traversal attempt: ${q}`})}function XZY(q){let K=q.replace(/^(\.\.\/)+/,"");return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${K!==q?`./${K}`:"./plugins/my-plugin"}" instead of "${q}".`}async function Y37(q){let K=[],_=[],z=dJ.resolve(q),Y;try{Y=await YC6(z,{encoding:"utf-8"})}catch(w){let j=d1(w),H;if(j==="ENOENT")H=`File not found: ${z}`;else if(j==="EISDIR")H=`Path is not a file: ${z}`;else H=`Failed to read file: ${F6(w)}`;return{success:!1,errors:[{path:"file",message:H,code:j}],warnings:[],filePath:z,fileType:"plugin"}}let $;try{$=l8(Y)}catch(w){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${F6(w)}`}],warnings:[],filePath:z,fileType:"plugin"}}if($&&typeof $==="object"){let w=$;
|
||
|
||
try{$=l8(Y)}catch(w){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${F6(w)}`}],warnings:[],filePath:z,fileType:"marketplace"}}if($&&typeof $==="object"){let w=$;if(Array.isArray(w.plugins))w.plugins.forEach((j,H)=>{if(j&&typeof j==="object"&&"source"in j){let J=j.source;if(typeof J==="string")X48(J,`plugins[${H}].source`,K,XZY(J));if(J&&typeof J==="object"&&"path"in J&&typeof J.path==="string")X48(J.path,`plugins[${H}].source.path`,K)}})}let A=y66().extend({plugins:h.array(E31().strict())}).strict().safeParse($);if(!A.success)K.push(...O37(A.error));if(A.success){let w=A.data;if(!w.plugins||w.plugins.length===0)_.push({path:"plugins",message:"Marketplace has no plugins defined"});if(w.plugins){w.plugins.forEach((J,M)=>{if(w.plugins.filter((P)=>P.name===J.name).length>1)K.push({path:`plugins[${M}].name`,message:`Duplicate plugin name "${J.name}" found in marketplace`})});let j=dJ.dirname(z),H=dJ.basename(j)===".claude-plugin"?dJ.dirname(j):j;for(let[J,M]of w.plugins.entries()){if(!M.version||typeof M.source!=="string"||!M.source.startsWith("./"))continue;let X=dJ.join(H,M.source,".claude-plugin","plugin.json"),P;try{let W=await YC6(X,{encoding:"utf-8"}),D=l8(W);if(typeof D.version==="string")P=D.version}catch{continue}if(P&&P!==M.version)_.push({path:`plugins[${J}].version`,message:`Entry declares version "${M.version}" but ${M.source}/.claude-plugin/plugin.json says "${P}". `+"At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. "+`Update this entry to "${P}" to match.`})}}if(!w.metadata?.description)_.push({path:"metadata.description",message:"No marketplace description provided. Adding a description helps users understand what this marketplace offers"})}return{success:K.length===0,errors:K,warnings:_,filePath:z,fileType:"marketplace"}}function PZY(q,K,_){let z=[],Y=[],$=K.match(GC1);
|
||
|
||
if(J!=="bash"&&J!=="powershell")z.push({path:"shell",message:`shell must be 'bash' or 'powershell', got '${H}'.`})}return{success:z.length===0,errors:z,warnings:Y,filePath:q,fileType:_}}async function WZY(q){let K;try{K=await YC6(q,{encoding:"utf-8"})}catch(Y){if(d1(Y)==="ENOENT")return{success:!0,errors:[],warnings:[],filePath:q,fileType:"hooks"};return{success:!1,errors:[{path:"file",message:`Failed to read file: ${F6(Y)}`}],warnings:[],filePath:q,fileType:"hooks"}}let _;try{_=l8(K)}catch(Y){return{success:!1,errors:[{path:"json",message:`Invalid JSON syntax: ${F6(Y)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:q,fileType:"hooks"}}let z=Ow8().safeParse(_);if(!z.success)return{success:!1,errors:O37(z.error),warnings:[],filePath:q,fileType:"hooks"};return{success:!0,errors:[],warnings:[],filePath:q,fileType:"hooks"}}async function ehK(q,K){let _;try{_=await jZY(q,{withFileTypes:!0})}catch(Y){let $=d1(Y);if($==="ENOENT"||$==="ENOTDIR")return[];throw Y}if(K)return _.filter((Y)=>Y.isDirectory()).map((Y)=>dJ.join(q,Y.name,"SKILL.md"));let z=[];for(let Y of _){let $=dJ.join(q,Y.name);if(Y.isDirectory())z.push(...await ehK($,!1));else if(Y.isFile()&&Y.name.toLowerCase().endsWith(".md"))z.push($)}return z}async function qRK(q){let K=[],_=[["skill",dJ.join(q,"skills")],["agent",dJ.join(q,"agents")],["command",dJ.join(q,"commands")]];for(let[Y,$]of _){let O=await ehK($,Y==="skill");for(let A of O){let w;try{w=await YC6(A,{encoding:"utf-8"})}catch(H){if(K7(H))continue;K.push({success:!1,errors:[{path:"file",message:`Failed to read: ${F6(H)}`}],warnings:[],filePath:A,fileType:Y});continue}let j=PZY(A,w,Y);if(j.errors.length>0||j.warnings.length>0)K.push(j)}}let z=await WZY(dJ.join(q,"hooks","hooks.json"));if(z.errors.length>0||z.warnings.length>0)K.push(z);return K}async function IQ8(q){let K=dJ.resolve(q),_=null;try{_=await HZY(K)}catch(Y){if(!K7(Y))throw Y}if(_?.isDirectory()){let Y=dJ.join(K,".claude-plugin","marketplace.json"),$=await $37(Y);if($.errors[0]?.code!=="ENOENT")return $;
|
||
|
||
let O=dJ.join(K,".claude-plugin","plugin.json"),A=await Y37(O);if(A.errors[0]?.code!=="ENOENT")return A;return{success:!1,errors:[{path:"directory",message:"No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json"}],warnings:[],filePath:K,fileType:"plugin"}}switch(MZY(q)){case"plugin":return Y37(q);case"marketplace":return $37(q);case"unknown":{try{let Y=await YC6(K,{encoding:"utf-8"}),$=l8(Y);if(Array.isArray($.plugins))return $37(q)}catch(Y){if(d1(Y)==="ENOENT")return{success:!1,errors:[{path:"file",message:`File not found: ${K}`}],warnings:[],filePath:K,fileType:"plugin"}}return Y37(q)}}}var JZY;var A37=L(()=>{u7();E8();aT();r8();JG();JZY=new Set(["category","source","tags","strict","id"])});function _RK(q){let K=Y6(5),{onComplete:_,path:z}=q,Y,$;if(K[0]!==_||K[1]!==z)Y=()=>{(async function(){if(!z){_(`Usage: /plugin validate <path>
|
||
|
||
Validate a plugin or marketplace manifest file or directory.
|
||
|
||
Examples:
|
||
/plugin validate .claude-plugin/plugin.json
|
||
/plugin validate /path/to/plugin-directory
|
||
/plugin validate .
|
||
|
||
When given a directory, automatically validates .claude-plugin/marketplace.json
|
||
or .claude-plugin/plugin.json (prefers marketplace if both exist).
|
||
|
||
Or from the command line:
|
||
claude plugin validate <path>`);return}try{let j=await IQ8(z),H="";if(H=H+`Validating ${j.fileType} manifest: ${j.filePath}
|
||
|
||
`,j.errors.length>0)H=H+`${o6.cross} Found ${j.errors.length} ${H7(j.errors.length,"error")}:
|
||
|
||
`,j.errors.forEach((J)=>{H=H+` ${o6.pointer} ${J.path}: ${J.message}
|
||
`}),H=H+`
|
||
`;if(j.warnings.length>0)H=H+`${o6.warning} Found ${j.warnings.length} ${H7(j.warnings.length,"warning")}:
|
||
|
||
`,j.warnings.forEach((J)=>{H=H+` ${o6.pointer} ${J.path}: ${J.message}
|
||
`}),H=H+`
|
||
`;if(j.success){if(j.warnings.length>0)H=H+`${o6.tick} Validation passed with warnings
|
||
`;else H=H+`${o6.tick} Validation passed
|
||
`;process.exitCode=0}else H=H+`${o6.cross} Validation failed
|
||
`,process.exitCode=1;_(H)}catch(j){let H=j;
|
||
|
||
if(K[21]===Symbol.for("react.memo_cache_sentinel"))b=MO.createElement(T,null," "),I=MO.createElement(T,null," "),K[21]=b,K[22]=I;else b=K[21],I=K[22];let m=z==="ios",p=z==="ios",C;if(K[23]!==m||K[24]!==p)C=MO.createElement(T,{bold:m,underline:p},"iOS"),K[23]=m,K[24]=p,K[25]=C;else C=K[25];let g;if(K[26]===Symbol.for("react.memo_cache_sentinel"))g=MO.createElement(T,{dimColor:!0}," / "),K[26]=g;else g=K[26];let F=z==="android",U=z==="android",c;if(K[27]!==F||K[28]!==U)c=MO.createElement(T,{bold:F,underline:U},"Android"),K[27]=F,K[28]=U,K[29]=c;else c=K[29];let K6;if(K[30]!==C||K[31]!==c)K6=MO.createElement(T,null,C,g,c),K[30]=C,K[31]=c,K[32]=K6;else K6=K[32];let o;if(K[33]===Symbol.for("react.memo_cache_sentinel"))o=MO.createElement(T,{dimColor:!0},"(tab to switch, esc to close)"),K[33]=o;else o=K[33];let q6;if(K[34]!==K6)q6=MO.createElement(u,{flexDirection:"row",gap:2},K6,o),K[34]=K6,K[35]=q6;else q6=K[35];let t;if(K[36]!==w)t=MO.createElement(T,{dimColor:!0},w),K[36]=w,K[37]=t;else t=K[37];let n;if(K[38]!==f||K[39]!==Z||K[40]!==v||K[41]!==k||K[42]!==V||K[43]!==q6||K[44]!==t||K[45]!==y||K[46]!==E||K[47]!==R)n=MO.createElement(f,{flexDirection:y,tabIndex:E,autoFocus:R,onKeyDown:Z},v,k,V,b,I,q6,t),K[38]=f,K[39]=Z,K[40]=v,K[41]=k,K[42]=V,K[43]=q6,K[44]=t,K[45]=y,K[46]=E,K[47]=R,K[48]=n;else n=K[48];let z6;if(K[49]!==G||K[50]!==n)z6=MO.createElement(G,null,n),K[49]=G,K[50]=n,K[51]=z6;else z6=K[51];return z6}function dTY(q,K){return MO.createElement(T,{key:K},q)}function cTY(q){return q.length>0}function lTY(q){return q==="ios"?"android":"ios"}function nTY(){}async function iTY(q){return MO.createElement(QTY,{onDone:q})}var MO,V48,$97;var DCK=L(()=>{t6();MC6();lX();i6();Kq();MO=w6(D6(),1),V48=w6(D6(),1),$97={ios:{url:"https://apps.apple.com/app/claude-by-anthropic/id6473753684"},android:{url:"https://play.google.com/store/apps/details?id=com.anthropic.claude"}}});var rTY,O97;
|
||
|
||
if(!$||Y&&nT(Y.version,$.version))return Object.entries(z).filter(([O])=>!$||nT(O,$.version)).sort(([O],[A])=>nT(O,A)?-1:1).flatMap(([O,A])=>A).filter(Boolean).slice(0,MkY)}catch(z){return j6(m1(z)),[]}return[]}function X97(q=lQ8()){try{let K=nQ8(q);return Object.keys(K).sort((z,Y)=>nT(z,Y)?1:-1).map((z)=>{let Y=K[z];if(!Y||Y.length===0)return null;let $=Y.filter(Boolean);if($.length===0)return null;return[z,$]}).filter((z)=>z!==null)}catch(K){return j6(m1(K)),[]}}async function lCK(q,K={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION){let _=await cQ8();if(q!==K||!_)M97().catch(($)=>j6(m1($)));let z=cCK(K,q,_);return{hasReleaseNotes:z.length>0,releaseNotes:z}}function nCK(q,K={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION){let _=cCK(K,q);return{hasReleaseNotes:_.length>0,releaseNotes:_}}var H97,MkY=5,QCK="https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md",XkY="https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md",uJ6=null;var PC6=L(()=>{VK();T8();k1();d8();E8();h8();H97=w6(OT6(),1)});var rCK={};v8(rCK,{call:()=>PkY});function iCK(q){return q.map(([K,_])=>{let z=`Version ${K}:`,Y=_.map(($)=>`· ${$}`).join(`
|
||
`);return`${z}
|
||
${Y}`}).join(`
|
||
|
||
`)}async function PkY(){let q=[];try{let _=new Promise((z,Y)=>{setTimeout(($)=>$(Error("Timeout")),500,Y)});await Promise.race([M97(),_]),q=X97(await cQ8())}catch{}if(q.length>0)return{type:"text",value:iCK(q)};let K=X97(await cQ8());if(K.length>0)return{type:"text",value:iCK(K)};
|
||
|
||
return z||Y}).slice(0,3),L48}).catch(()=>{return L48=[],L48}),qd8}function kbK(){return L48}function _d8(){let q=process.env.DEMO_VERSION??{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION,K=Oo8(),_=process.env.DEMO_VERSION?"/code/claude":m5(Z8()),z=K?`${_} in ${K.replace(/^https?:\/\//,"")}`:_,Y=i7()?ZZ8():"API Usage Billing",$=v7().agent;return{version:q,cwd:z,billingType:Y,agentName:$}}function VbK(q,K,_){if(J1(q)+3+J1(K)>_)return{shouldSplit:!0,truncatedModel:i5(q,_),truncatedBilling:i5(K,_)};return{shouldSplit:!1,truncatedModel:i5(q,Math.max(_-J1(K)-3,10)),truncatedBilling:K}}function NbK(q){let K=lQ8();if(!K)return[];let _;try{_=nQ8(K)}catch{return[]}let z=[],Y=Object.keys(_).sort(($,O)=>nT($,O)?-1:1).slice(0,3);for(let $ of Y){let O=_[$];if(O)z.push(...O)}return z.slice(0,q)}var fbK=50,SkY=20,k97=4,tQ8=1,eQ8=2,L48,qd8=null;var zd8=L(()=>{T8();x5();T7();F7();yK();I7();PC6();t4();i1();L48=[]});function pJ6(q){let K=Y6(26),_;if(K[0]!==q)_=q===void 0?{}:q,K[0]=q,K[1]=_;else _=K[1];let{pose:z}=_,Y=z===void 0?"default":z;if(Y7.terminal==="Apple_Terminal"){let D;if(K[2]!==Y)D=Bz.createElement(xkY,{pose:Y}),K[2]=Y,K[3]=D;else D=K[3];return D}let $=CkY[Y],O;if(K[4]!==$.r1L)O=Bz.createElement(T,{color:"clawd_body"},$.r1L),K[4]=$.r1L,K[5]=O;else O=K[5];let A;if(K[6]!==$.r1E)A=Bz.createElement(T,{color:"clawd_body",backgroundColor:"clawd_background"},$.r1E),K[6]=$.r1E,K[7]=A;else A=K[7];let w;if(K[8]!==$.r1R)w=Bz.createElement(T,{color:"clawd_body"},$.r1R),K[8]=$.r1R,K[9]=w;else w=K[9];let j;if(K[10]!==O||K[11]!==A||K[12]!==w)j=Bz.createElement(T,null,O,A,w),K[10]=O,K[11]=A,K[12]=w,K[13]=j;else j=K[13];let H;if(K[14]!==$.r2L)H=Bz.createElement(T,{color:"clawd_body"},$.r2L),K[14]=$.r2L,K[15]=H;else H=K[15];let J;
|
||
|
||
async function mkY(q="claude_code_guest_pass"){let{accessToken:K,orgUUID:_}=await dH(),z={...eY(K),"x-organization-uuid":_},Y=`${m7().BASE_API_URL}/api/oauth/organizations/${_}/referral/eligibility`;return(await O1.get(Y,{headers:z,params:{campaign:q},timeout:5000})).data}async function bbK(q="claude_code_guest_pass"){let{accessToken:K,orgUUID:_}=await dH(),z={...eY(K),"x-organization-uuid":_},Y=`${m7().BASE_API_URL}/api/oauth/organizations/${_}/referral/redemptions`;return(await O1.get(Y,{headers:z,params:{campaign:q},timeout:1e4})).data}function xbK(){return!!(o_()?.organizationUuid&&i7()&&jK()==="max")}function ZC6(){if(!xbK())return{eligible:!1,needsRefresh:!1,hasCache:!1};let q=o_()?.organizationUuid;if(!q)return{eligible:!1,needsRefresh:!1,hasCache:!1};let _=w8().passesEligibilityCache?.[q];if(!_)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:z,timestamp:Y}=_,O=Date.now()-Y>CbK;return{eligible:z,needsRefresh:O,hasCache:!0}}function Z36(q){let K=pkY[q.currency]??`${q.currency} `,_=q.amount_minor_units/100,z=_%1===0?_.toString():_.toFixed(2);return`${K}${z}`}function G36(){let q=o_()?.organizationUuid;if(!q)return null;return w8().passesEligibilityCache?.[q]?.referrer_reward??null}function $d8(){let q=o_()?.organizationUuid;if(!q)return null;return w8().passesEligibilityCache?.[q]?.remaining_passes??null}async function SbK(){if(R48)return N("Passes: Reusing in-flight eligibility fetch"),R48;let q=o_()?.organizationUuid;if(!q)return null;return R48=(async()=>{try{let K=await mkY(),_={...K,timestamp:Date.now()};return S8((z)=>({...z,passesEligibilityCache:{...z.passesEligibilityCache,[q]:_}})),N(`Passes eligibility cached for org ${q}: ${K.eligible}`),K}catch(K){return N("Failed to fetch and cache passes eligibility"),j6(K),null}finally{R48=null}})(),R48}async function V97(){if(!xbK())return null;let q=o_()?.organizationUuid;if(!q)return null;let _=w8().passesEligibilityCache?.[q],z=Date.now();
|
||
|
||
return R8}function XVY(q){if(q.lastReleaseNotesSeen==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION)return q;return{...q,lastReleaseNotesSeen:{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION}}function PVY(q){return q.effortValue}function WVY(q){return q.agent}var X7,vC6,GC6,S97=50;var qxK=L(()=>{t6();i6();u4();x5();zd8();I7();yK();Yd8();RbK();BbK();k1();i1();_8();Tq8();nbK();lK6();PC6();Mo();d8();$I();ibK();obK();R97();W$();N97();cq8();E7();yD();Pp();dq();X7=w6(D6(),1),vC6=w6(D6(),1),GC6=(tbK(),hq(sbK))});function KxK(q){let K=Y6(5),{message:_,isTranscriptMode:z}=q;if(!(z&&_.type==="assistant"&&_.message.model&&_.message.content.some(DVY)))return null;let $=J1(_.message.model)+8,O;if(K[0]!==_.message.model)O=C97.default.createElement(T,{dimColor:!0},_.message.model),K[0]=_.message.model,K[1]=O;else O=K[1];let A;if(K[2]!==$||K[3]!==O)A=C97.default.createElement(u,{minWidth:$},O),K[2]=$,K[3]=O,K[4]=A;else A=K[4];return A}function DVY(q){return q.type==="text"}var C97;var _xK=L(()=>{t6();x5();i6();C97=w6(D6(),1)});function zxK(q){let K=Y6(10),{message:_,isTranscriptMode:z}=q;if(!(z&&_.timestamp&&_.type==="assistant"&&_.message.content.some(fVY)))return null;let $,O,A;if(K[0]!==_.timestamp)O=new Date(_.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),$=u,A=J1(O),K[0]=_.timestamp,K[1]=$,K[2]=O,K[3]=A;else $=K[1],O=K[2],A=K[3];let w;if(K[4]!==O)w=b97.default.createElement(T,{dimColor:!0},O),K[4]=O,K[5]=w;else w=K[5];let j;
|
||
|
||
var UNY="https://code.claude.com/docs/en/claude-code-on-the-web",QNY=(q)=>`
|
||
You are an expert code reviewer. Follow these steps:
|
||
|
||
1. If no PR number is provided in the args, run \`gh pr list\` to show open PRs
|
||
2. If a PR number is provided, run \`gh pr view <number>\` to get PR details
|
||
3. Run \`gh pr diff <number>\` to get the diff
|
||
4. Analyze the changes and provide a thorough code review that includes:
|
||
- Overview of what the PR does
|
||
- Analysis of code quality and style
|
||
- Specific suggestions for improvements
|
||
- Any potential issues or risks
|
||
|
||
Keep your review concise but thorough. Focus on:
|
||
- Code correctness
|
||
- Following project conventions
|
||
- Performance implications
|
||
- Test coverage
|
||
- Security considerations
|
||
|
||
Format your review with clear sections and bullet points.
|
||
|
||
PR number: ${q}
|
||
`,dNY,ZIK,vd8;var e97=L(()=>{t97();dNY={type:"prompt",name:"review",description:"Review a pull request",progressMessage:"reviewing pull request",contentLength:0,source:"builtin",async getPromptForCommand(q){return[{type:"text",text:QNY(q)}]}},ZIK={type:"local-jsx",name:"ultrareview",description:`~10–20 min · Finds and verifies bugs in your branch. Runs in Claude Code on the web. See ${UNY}`,isEnabled:()=>g48(),load:()=>Promise.resolve().then(() => (fIK(),DIK))},vd8=dNY});var GIK={};v8(GIK,{call:()=>oNY});function cNY(q){let K=Y6(19),{onDone:_}=q,z=H8(rNY),[Y,$]=Td8.useState(""),O,A;if(K[0]!==z)O=()=>{if(!z)return;let D=z;(async function(){let Z=await Dx(D,{type:"utf8",errorCorrectionLevel:"L"});$(Z)})().catch(iNY)},A=[z],K[0]=z,K[1]=O,K[2]=A;else O=K[1],A=K[2];Td8.useEffect(O,A);let w;if(K[3]===Symbol.for("react.memo_cache_sentinel"))w={context:"Confirmation"},K[3]=w;else w=K[3];if(f1("confirm:no",_,w),!z){let D;
|
||
|
||
else N("[Claude in Chrome] First-time install detected, but extension not installed, skipping reconnect")}).catch(($)=>N(`[Claude in Chrome] Failed to check extension installation during manifest install: ${$}`,{level:"error"}))}function CRY(q){let K=EC4();for(let{browser:_,key:z}of K){let Y=`${z}\\${wz7}`;x7("reg",["add",Y,"/ve","/t","REG_SZ","/d",q,"/f"]).then(($)=>{if($.code===0)N(`[Claude in Chrome] Registered native host for ${_} in Windows registry: ${Y}`);else N(`[Claude in Chrome] Failed to register native host for ${_} in Windows registry: ${$.stderr}`)})}}async function TgK(q){let K=v1(),_=_t(q7(),"chrome"),z=K==="windows"?_t(_,"chrome-native-host.bat"):_t(_,"chrome-native-host"),Y=K==="windows"?`@echo off
|
||
REM Chrome native host wrapper script
|
||
REM Generated by Claude Code - do not edit manually
|
||
${q}
|
||
`:`#!/bin/sh
|
||
# Chrome native host wrapper script
|
||
# Generated by Claude Code - do not edit manually
|
||
exec ${q}
|
||
`;if(await VgK(z,"utf-8").catch(()=>null)===Y)return z;if(await kgK(_,{recursive:!0}),await NgK(z,Y),K!=="windows")await ERY(z,493);return N(`[Claude in Chrome] Created Chrome native host wrapper script: ${z}`),z}function bRY(){return zt().then((K)=>{if(!K)return;if(w8().cachedChromeExtensionInstalled!==K)S8((z)=>({...z,cachedChromeExtensionInstalled:K}))}).catch((K)=>N(`[Claude in Chrome] Failed to check extension installation during cache refresh: ${K}`,{level:"error"})),w8().cachedChromeExtensionInstalled??!1}async function zt(){let q=NC4();if(q.length===0)return N(`[Claude in Chrome] Unsupported platform for extension detection: ${v1()}`),!1;return fgK(q,N)}var RRY="https://clau.de/chrome/reconnect",wz7="com.anthropic.claude_code_browser_extension",GgK,Oc8=void 0;var tJ6=L(()=>{Zp6();T8();l1();k1();_8();d8();PK();NK();r8();Rm();ZgK();GgK=`${wz7}.json`});var ygK={};v8(ygK,{call:()=>QRY});function mRY(q){let K=Y6(41),{onDone:_,isExtensionInstalled:z,configEnabled:Y,isClaudeAISubscriber:$,isWSL:O}=q,A=H8(URY),[w,j]=Xz.useState(0),[H,J]=Xz.useState(Y??!1),[M,X]=Xz.useState(!1),[P,W]=Xz.useState(z),D;
|
||
|
||
if(q.min_version&&Er({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION,q.min_version))return`Your version of Claude Code (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION}) is too old for Remote Control.
|
||
Version ${q.min_version} or higher is required. Run \`claude update\` to update.`;return null}async function JCY(){if(!DJ6())return!1;return(await $K8()).should_show_app_upgrade_message}var yz7,HCY;var AK8=L(()=>{u7();l1();ip();
|
||
|
||
color: #64748b; margin-bottom: 12px;">Just copy this into Claude Code to add it to your CLAUDE.md.</p>
|
||
<div class="claude-md-actions">
|
||
<button class="copy-all-btn" onclick="copyAllCheckedClaudeMd()">Copy All Checked</button>
|
||
</div>
|
||
${X.claude_md_additions.map((R,b)=>`
|
||
<div class="claude-md-item">
|
||
<input type="checkbox" id="cmd-${b}" class="cmd-checkbox" checked data-text="${z_(R.prompt_scaffold||R.where||"Add to CLAUDE.md")}\\n\\n${z_(R.addition)}">
|
||
<label for="cmd-${b}">
|
||
<code class="cmd-code">${z_(R.addition)}</code>
|
||
<button class="copy-btn" onclick="copyCmdItem(${b})">Copy</button>
|
||
</label>
|
||
<div class="cmd-why">${z_(R.why)}</div>
|
||
</div>
|
||
`).join("")}
|
||
</div>
|
||
`:""}
|
||
${X.features_to_try&&X.features_to_try.length>0?`
|
||
<p style="font-size: 13px; color: #64748b; margin-bottom: 12px;">Just copy this into Claude Code and it'll set it up for you.</p>
|
||
<div class="features-section">
|
||
${X.features_to_try.map((R)=>`
|
||
<div class="feature-card">
|
||
<div class="feature-title">${z_(R.feature||"")}</div>
|
||
<div class="feature-oneliner">${z_(R.one_liner||"")}</div>
|
||
<div class="feature-why"><strong>Why for you:</strong> ${z_(R.why_for_you||"")}</div>
|
||
${R.example_code?`
|
||
<div class="feature-examples">
|
||
<div class="feature-example">
|
||
<div class="example-code-row">
|
||
<code class="example-code">${z_(R.example_code)}</code>
|
||
<button class="copy-btn" onclick="copyText(this)">Copy</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`:""}
|
||
</div>
|
||
`).join("")}
|
||
</div>
|
||
`:""}
|
||
${X.usage_patterns&&X.usage_patterns.length>0?`
|
||
<h2 id="section-patterns">New Ways to Use Claude Code</h2>
|
||
<p style="font-size: 13px; color: #64748b; margin-bottom: 12px;
|
||
|
||
}
|
||
.area-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
|
||
.area-name { font-weight: 600; font-size: 15px; color: #0f172a; }
|
||
.area-count { font-size: 12px; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; }
|
||
.area-desc { font-size: 14px; color: #475569; line-height: 1.5; }
|
||
.narrative { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; margin-bottom: 24px; }
|
||
.narrative p { margin-bottom: 12px; font-size: 14px; color: #475569; line-height: 1.7; }
|
||
.key-insight { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 12px 16px; margin-top: 12px; font-size: 14px; color: #166534; }
|
||
.section-intro { font-size: 14px; color: #64748b; margin-bottom: 16px; }
|
||
.big-wins { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
|
||
.big-win { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 16px; }
|
||
.big-win-title { font-weight: 600; font-size: 15px; color: #166534; margin-bottom: 8px; }
|
||
.big-win-desc { font-size: 14px; color: #15803d; line-height: 1.5; }
|
||
.friction-categories { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
|
||
.friction-category { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; padding: 16px; }
|
||
.friction-title { font-weight: 600; font-size: 15px; color: #991b1b; margin-bottom: 6px; }
|
||
.friction-desc { font-size: 13px; color: #7f1d1d; margin-bottom: 10px; }
|
||
.friction-examples { margin: 0 0 0 20px; font-size: 13px; color: #334155; }
|
||
.friction-examples li { margin-bottom: 4px; }
|
||
.claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; }
|
||
.claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; }
|
||
.claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe;
|
||
|
||
}
|
||
.copy-all-btn { background: #2563eb; color: white; border: none; border-radius: 4px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-weight: 500; transition: all 0.2s; }
|
||
.copy-all-btn:hover { background: #1d4ed8; }
|
||
.copy-all-btn.copied { background: #16a34a; }
|
||
.claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; }
|
||
.claude-md-item:last-child { border-bottom: none; }
|
||
.cmd-checkbox { margin-top: 2px; }
|
||
.cmd-code { background: white; padding: 8px 12px; border-radius: 4px; font-size: 12px; color: #1e40af; border: 1px solid #bfdbfe; font-family: monospace; display: block; white-space: pre-wrap; word-break: break-word; flex: 1; }
|
||
.cmd-why { font-size: 12px; color: #64748b; width: 100%; padding-left: 24px; margin-top: 4px; }
|
||
.features-section, .patterns-section { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
|
||
.feature-card { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 16px; }
|
||
.pattern-card { background: #f0f9ff; border: 1px solid #7dd3fc; border-radius: 8px; padding: 16px; }
|
||
.feature-title, .pattern-title { font-weight: 600; font-size: 15px; color: #0f172a; margin-bottom: 6px; }
|
||
.feature-oneliner { font-size: 14px; color: #475569; margin-bottom: 8px; }
|
||
.pattern-summary { font-size: 14px; color: #475569; margin-bottom: 8px; }
|
||
.feature-why, .pattern-detail { font-size: 13px; color: #334155; line-height: 1.5; }
|
||
.feature-examples { margin-top: 12px; }
|
||
.feature-example { padding: 8px 0; border-top: 1px solid #d1fae5; }
|
||
.feature-example:first-child { border-top: none; }
|
||
.example-desc { font-size: 13px; color: #334155; margin-bottom: 6px; }
|
||
.example-code-row { display: flex; align-items: flex-start; gap: 8px; }
|
||
.example-code { flex: 1; background: #f1f5f9; padding: 8px 12px; border-radius: 4px; font-family: monospace; font-size: 12px; color: #334155; overflow-x: auto; white-space: pre-wrap;
|
||
|
||
flex-direction: column; gap: 16px; margin-bottom: 24px; }
|
||
.friction-category { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; padding: 16px; }
|
||
.friction-title { font-weight: 600; font-size: 15px; color: #991b1b; margin-bottom: 6px; }
|
||
.friction-desc { font-size: 13px; color: #7f1d1d; margin-bottom: 10px; }
|
||
.friction-examples { margin: 0 0 0 20px; font-size: 13px; color: #334155; }
|
||
.friction-examples li { margin-bottom: 4px; }
|
||
.claude-md-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 16px; margin-bottom: 20px; }
|
||
.claude-md-section h3 { font-size: 14px; font-weight: 600; color: #1e40af; margin: 0 0 12px 0; }
|
||
.claude-md-actions { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #dbeafe; }
|
||
.copy-all-btn { background: #2563eb; color: white; border: none; border-radius: 4px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-weight: 500; transition: all 0.2s; }
|
||
.copy-all-btn:hover { background: #1d4ed8; }
|
||
.copy-all-btn.copied { background: #16a34a; }
|
||
.claude-md-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dbeafe; }
|
||
.claude-md-item:last-child { border-bottom: none; }
|
||
.cmd-checkbox { margin-top: 2px; }
|
||
.cmd-code { background: white; padding: 8px 12px; border-radius: 4px; font-size: 12px; color: #1e40af; border: 1px solid #bfdbfe; font-family: monospace; display: block; white-space: pre-wrap; word-break: break-word; flex: 1; }
|
||
.cmd-why { font-size: 12px; color: #64748b; width: 100%; padding-left: 24px; margin-top: 4px; }
|
||
.features-section, .patterns-section { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
|
||
.feature-card { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 16px; }
|
||
.pattern-card { background: #f0f9ff; border: 1px solid #7dd3fc; border-radius: 8px; padding: 16px; }
|
||
.feature-title, .pattern-title { font-weight: 600;
|
||
|
||
LbY={".ts":"TypeScript",".tsx":"TypeScript",".js":"JavaScript",".jsx":"JavaScript",".py":"Python",".rb":"Ruby",".go":"Go",".rs":"Rust",".java":"Java",".md":"Markdown",".json":"JSON",".yaml":"YAML",".yml":"YAML",".sh":"Shell",".css":"CSS",".html":"HTML"},hbY={debug_investigate:"Debug/Investigate",implement_feature:"Implement Feature",fix_bug:"Fix Bug",write_script_tool:"Write Script/Tool",refactor_code:"Refactor Code",configure_system:"Configure System",create_pr_commit:"Create PR/Commit",analyze_data:"Analyze Data",understand_codebase:"Understand Codebase",write_tests:"Write Tests",write_docs:"Write Docs",deploy_infra:"Deploy/Infra",warmup_minimal:"Cache Warmup",fast_accurate_search:"Fast/Accurate Search",correct_code_edits:"Correct Code Edits",good_explanations:"Good Explanations",proactive_help:"Proactive Help",multi_file_changes:"Multi-file Changes",handled_complexity:"Multi-file Changes",good_debugging:"Good Debugging",misunderstood_request:"Misunderstood Request",wrong_approach:"Wrong Approach",buggy_code:"Buggy Code",user_rejected_action:"User Rejected Action",claude_got_blocked:"Claude Got Blocked",user_stopped_early:"User Stopped Early",wrong_file_or_location:"Wrong File/Location",excessive_changes:"Excessive Changes",slow_or_verbose:"Slow/Verbose",tool_failed:"Tool Failed",user_unclear:"User Unclear",external_issue:"External Issue",frustrated:"Frustrated",dissatisfied:"Dissatisfied",likely_satisfied:"Likely Satisfied",satisfied:"Satisfied",happy:"Happy",unsure:"Unsure",neutral:"Neutral",delighted:"Delighted",single_task:"Single Task",multi_task:"Multi Task",iterative_refinement:"Iterative Refinement",exploration:"Exploration",quick_question:"Quick Question",fully_achieved:"Fully Achieved",mostly_achieved:"Mostly Achieved",partially_achieved:"Partially Achieved",not_achieved:"Not Achieved",unclear_from_transcript:"Unclear",unhelpful:"Unhelpful",slightly_helpful:"Slightly Helpful",moderately_helpful:"Moderately Helpful",very_helpful:"Very Helpful",essential:"Essential"};
|
||
|
||
async function OxY(q){try{let[K,_]=await Promise.all([tt1(q).catch(($)=>{return j6(m1($)),N("Skill directory commands failed to load, continuing without them"),[]}),Vq7().catch(($)=>{return j6(m1($)),N("Plugin skills failed to load, continuing without them"),[]})]),z=mgK(),Y=i34();return N(`getSkills returning: ${K.length} skill dir commands, ${_.length} plugin skills, ${z.length} bundled skills, ${Y.length} builtin plugin skills`),{skillDirCommands:K,pluginSkills:_,bundledSkills:z,builtinPluginSkills:Y}}catch(K){return j6(m1(K)),N("Unexpected error in getSkills, returning empty"),{skillDirCommands:[],pluginSkills:[],bundledSkills:[],builtinPluginSkills:[]}}}function $QK(q){if(!q.availability)return!0;for(let K of q.availability)switch(K){case"claude-ai":if(i7())return!0;break;case"console":if(!i7()&&!U16()&&OM())return!0;break;default:{let _=K;break}}return!1}async function w0(q){let K=await OQK(q),_=BAK(),z=K.filter((w)=>$QK(w)&&$t(w));if(_.length===0)return z;let Y=new Set(z.map((w)=>w.name)),$=_.filter((w)=>!Y.has(w.name)&&$QK(w)&&$t(w));if($.length===0)return z;let O=new Set(lz7().map((w)=>w.name)),A=z.findIndex((w)=>O.has(w.name));if(A===-1)return[...z,...$];return[...z.slice(0,A),...$,...z.slice(A)]}function HK8(){OQK.cache?.clear?.(),rC.cache?.clear?.(),jw6.cache?.clear?.(),YxY?.()}function Id(){HK8(),vF8(),CGK(),Hp8()}function hGK(q){return[]}function hc8(q){if(q.type==="local-jsx")return!1;if(q.type==="prompt")return!0;return AxY.has(q)}function AQK(q){return q.filter((K)=>nz7.has(K))}function Md(q,K){return K.find((_)=>_.name===q||T_(_)===q||_.aliases?.includes(q))}function qH6(q,K){return Md(q,K)!==void 0}function lL6(q,K){let _=Md(q,K);if(!_)throw ReferenceError(`Command ${q} not found. Available commands: ${K.map((z)=>{let Y=T_(z);return z.aliases?`${Y} (aliases: ${z.aliases.join(", ")})`:Y}).sort((z,Y)=>z.localeCompare(Y)).join(", ")}`);return _}function NJ6(q){if(q.type!=="prompt")return q.description;if(q.kind==="workflow")return`${q.description} (workflow)`;
|
||
|
||
return B0.createElement(u,{flexDirection:"row",gap:1},$&&B0.createElement(T,{dimColor:!0,wrap:"truncate"},"current: ",O.current," · ",J,": ",O.latest),q?B0.createElement(u,null,B0.createElement(T,{dimColor:!0,wrap:"truncate"},"Checking for updates")):z?.status==="success"&&Y&&H&&B0.createElement(T,{color:"success",wrap:"truncate"},"✓ Update installed · Restart to update"),z?.status==="install_failed"&&B0.createElement(T,{color:"error",wrap:"truncate"},"✗ Auto-update failed · Try ",B0.createElement(T,{bold:!0},"/status")),w&&!1)}var B0,kM6;var srK=L(()=>{k8();_8();h8();NN();LO7();i6();Za();k1();tQ();i1();B0=w6(D6(),1),kM6=w6(D6(),1)});function trK(q){let K=Y6(10),{verbose:_}=q,[z,Y]=hO7.useState(!1),[$,O]=hO7.useState("unknown"),A;if(K[0]===Symbol.for("react.memo_cache_sentinel"))A=async()=>{if(UF())return;let[W,D]=await Promise.all([Promise.resolve(v7()?.autoUpdatesChannel??"latest"),dE6()]);O(D);let f=await mb8(W),G=await TK6();if(G&&f&&nT(f,G)){if(N(`PackageManagerAutoUpdater: maxVersion ${G} is set, capping update from ${f} to ${G}`),nP({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION,G)){N(`PackageManagerAutoUpdater: current version ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION} is already at or above maxVersion ${G}, skipping update`),Y(!1);
|
||
|
||
return}f=G}let Z=f&&!nP({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION,f)&&!QE6(f);if(Y(!!Z),Z)N(`PackageManagerAutoUpdater: Update available ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION} -> ${f}`)},K[0]=A;else A=K[0];let w=A,j,H;if(K[1]===Symbol.for("react.memo_cache_sentinel"))j=()=>{w()},H=[w],K[1]=j,K[2]=H;else j=K[1],H=K[2];if(qE.useEffect(j,H),kD(w,1800000),!z)return null;let J=$==="homebrew"?"brew upgrade claude-code":$==="winget"?"winget upgrade Anthropic.ClaudeCode":$==="apk"?"apk upgrade claude-code":"your package manager update command",M;if(K[3]!==_)M=_&&qE.createElement(T,{dimColor:!0,wrap:"truncate"},"currentVersion: ",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION),K[3]=_,K[4]=M;else M=K[4];let X;if(K[5]!==J)X=qE.createElement(T,{color:"warning",wrap:"truncate"},"Update available! Run: ",qE.createElement(T,{bold:!0},J)),K[5]=J,K[6]=X;else X=K[6];let P;if(K[7]!==M||K[8]!==X)P=qE.createElement(qE.Fragment,null,M,X),K[7]=M,K[8]=X,K[9]=P;else P=K[9];return P}var qE,hO7;var erK=L(()=>{t6();NN();i6();Za();k1();_8();Fb8();i1();qE=w6(D6(),1),hO7=w6(D6(),1)});
|
||
|
||
YaY={"claude-3-opus":{modelName:"Claude 3 Opus",retirementDates:{firstParty:"January 5, 2026",bedrock:"January 15, 2026",vertex:"January 5, 2026",foundry:"January 5, 2026",anthropicAws:null}},"claude-3-7-sonnet":{modelName:"Claude 3.7 Sonnet",retirementDates:{firstParty:"February 19, 2026",bedrock:"April 28, 2026",vertex:"May 11, 2026",foundry:"February 19, 2026",anthropicAws:null}},"claude-3-5-haiku":{modelName:"Claude 3.5 Haiku",retirementDates:{firstParty:"February 19, 2026",bedrock:null,vertex:null,foundry:null,anthropicAws:null}}}});function r85(q){let K=Y6(4),{addNotification:_}=JK(),z=vi8.useRef(null),Y,$;if(K[0]!==_||K[1]!==q)Y=()=>{if(_5())return;let O=Gi8(q);if(O&&O!==z.current)z.current=O,_({key:"model-deprecation-warning",text:O,color:"warning",priority:"high"});if(!O)z.current=null},$=[q,_],K[0]=_,K[1]=q,K[2]=Y,K[3]=$;else Y=K[2],$=K[3];vi8.useEffect(Y,$)}var vi8;var o85=L(()=>{t6();Z$();Rw7();T8();vi8=w6(D6(),1)});function a85(){Cx(AaY)}async function AaY(){if(Pj()||c6(process.env.DISABLE_INSTALLATION_CHECKS))return null;if(await Ga()==="development")return null;return{timeoutMs:15000,key:"npm-deprecation-warning",text:OaY,color:"warning",priority:"high"}}var OaY="Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.";var s85=L(()=>{kK6();d8();nM6()});function t85(q){let K=Y6(26),{ideSelection:_,mcpClients:z,ideInstallationStatus:Y}=q,{addNotification:$,removeNotification:O}=JK(),{status:A,ideName:w}=Vb6(z),j=Ic.useRef(!1),H;if(K[0]!==Y)H=Y?bm(Y?.ideType):!1,K[0]=Y,K[1]=H;else H=K[1];let J=H,M=Y?.error||J,X=A==="connected"&&(_?.filePath||_?.text&&_.lineCount>0),P=A==="connected"&&!X,W=M&&!J&&!P&&!X,D=M&&J&&!P&&!X,f,G;if(K[2]!==$||K[3]!==A||K[4]!==O||K[5]!==D)f=()=>{if(_5())return;if(OW()||A!==null||D){O("ide-status-hint");return}if(j.current||(w8().ideHintShownCount??0)>=waY)return;let R=setTimeout(jaY,3000,j,$);return()=>clearTimeout(R)},G=[$,O,A,D],K[2]=$,K[3]=A,K[4]=O,K[5]=D,K[6]=f,K[7]=G;
|
||
|
||
jeK();E8();h8();GeK();CH();TO7();WM();Nz();oy8();aN();k1();qi();k8();l1();a1();WC6();O$();AO();SeK();ueK();peK();iH6();KH6();FeK();fL8();U_7();ld8();QeK();neK();Aw7();I48();Fr1();reK();Fx8();Tq8();sK6();B$();aeK();Of();u46();Y17();lP();$u8();Pp();E7();lH();t4();eL6();qs6();aC();Q78();iZ();Ia();yy();No();t4();x58();GN();q56();Y65();_O();O65();i2();j65();Pz7();Mz7();D0();c2();Tb6();M65();P65();D65();NC6();eB8();Z65();oj6();cw6();TU1();T65();Ez7();br1();l2();$36();E65();h65();S65();x65();u65();B65();F65();c65();n65();e65();oo1();W$();Mi8();A85();w85();j85();N57();M85();P85();Dn8();D85();L85();R85();C85();x85();Dw7();m85();B85();d85();_u8();l85();i85();o85();s85();e85();_15();Y15();j15();P15();G15();k15();EO7();uz7();V15();FO();p97();mH();N15();b15();Yy();XM();qP();y8=w6(D6(),1),z1=w6(D6(),1),LsY=(xw7(),hq(bw7)).useVoiceIntegration,i15=(xw7(),hq(bw7)).VoiceKeybindingHandler,IsY=(n15(),hq(l15)).useScheduledTasks,Qw7=[],usY={maybeLoadOlder:(q)=>{}};t15=["⠂","⠐"]});async function a58(q,K,_,z){let{App:Y}=await Promise.resolve().then(() => (R$7(),h$7)),{REPL:$}=await Promise.resolve().then(() => (cw7(),e15));await z(q,lw7.default.createElement(Y,{...K},lw7.default.createElement($,{..._})))}var lw7;var q75=L(()=>{lw7=w6(D6(),1)});async function QsY(){if(XY())return N("[Bootstrap] Skipped: Nonessential traffic disabled"),null;if(Dq()!=="firstParty")return N("[Bootstrap] Skipped: 3P provider"),null;let q=NT();if(!(t7()?.accessToken&&OD())&&!q)return N("[Bootstrap] Skipped: no usable OAuth or API key"),null;let _=`${m7().BASE_API_URL}/api/claude_cli/bootstrap`;try{return await oi(async()=>{let z=t7()?.accessToken,Y;if(z&&OD())Y={Authorization:`Bearer ${z}`,"anthropic-beta":JJ};else if(q)Y={"x-api-key":q};else return N("[Bootstrap] No auth available on retry, aborting"),null;N("[Bootstrap] Fetching");let $=await O1.get(_,{headers:{"Content-Type":"application/json","User-Agent":M$(),...Y},timeout:5000}),O=UsY().safeParse($.data);if(!O.success)return N(`[Bootstrap] Response failed validation: ${O.error.message}`),null;
|
||
|
||
if(q[2]===Symbol.for("react.memo_cache_sentinel"))Z=e1.default.createElement(T,null,e1.default.createElement(T,{color:"claude"},"Welcome to Claude Code"," "),e1.default.createElement(T,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION," ")),v=e1.default.createElement(T,null,"…………………………………………………………………………………………………………………………………………………………"),k=e1.default.createElement(T,null," "),V=e1.default.createElement(T,null," "),y=e1.default.createElement(T,null," "),E=e1.default.createElement(T,null," ░░░░░░ "),R=e1.default.createElement(T,null," ░░░ ░░░░░░░░░░ "),b=e1.default.createElement(T,null," ░░░░░░░░░░░░░░░░░░░ "),I=e1.default.createElement(T,null," "),q[2]=Z,q[3]=v,q[4]=k,q[5]=V,q[6]=y,q[7]=E,q[8]=R,q[9]=b,q[10]=I;else Z=q[2],v=q[3],k=q[4],V=q[5],y=q[6],E=q[7],R=q[8],b=q[9],I=q[10];let m;if(q[11]===Symbol.for("react.memo_cache_sentinel"))m=e1.default.createElement(T,null,e1.default.createElement(T,{dimColor:!0}," ░░░░"),e1.default.createElement(T,null," ██ ")),q[11]=m;else m=q[11];let p,C;if(q[12]===Symbol.for("react.memo_cache_sentinel"))p=e1.default.createElement(T,null,e1.default.createElement(T,{dimColor:!0}," ░░░░░░░░░░"),e1.default.createElement(T,null," ██▒▒██ ")),C=e1.default.createElement(T,null," ▒▒ ██ ▒"),q[12]=p,q[13]=C;else p=q[12],C=q[13];let g;
|
||
|
||
if(q[18]===Symbol.for("react.memo_cache_sentinel"))_=e1.default.createElement(T,null,e1.default.createElement(T,{color:"claude"},"Welcome to Claude Code"," "),e1.default.createElement(T,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION," ")),z=e1.default.createElement(T,null,"…………………………………………………………………………………………………………………………………………………………"),Y=e1.default.createElement(T,null," "),$=e1.default.createElement(T,null," * █████▓▓░ "),O=e1.default.createElement(T,null," * ███▓░ ░░ "),A=e1.default.createElement(T,null," ░░░░░░ ███▓░ "),w=e1.default.createElement(T,null," ░░░ ░░░░░░░░░░ ███▓░ "),q[18]=_,q[19]=z,q[20]=Y,q[21]=$,q[22]=O,q[23]=A,q[24]=w;else _=q[18],z=q[19],Y=q[20],$=q[21],O=q[22],A=q[23],w=q[24];let j,H,J,M,X;if(q[25]===Symbol.for("react.memo_cache_sentinel"))J=e1.default.createElement(T,null,e1.default.createElement(T,null," ░░░░░░░░░░░░░░░░░░░ "),e1.default.createElement(T,{bold:!0},"*"),e1.default.createElement(T,null," ██▓░░ ▓ ")),M=e1.default.createElement(T,null," ░▓▓███▓▓░ "),X=e1.default.createElement(T,{dimColor:!0}," * ░░░░ "),j=e1.default.createElement(T,{dimColor:!0}," ░░░░░░░░ "),H=e1.default.createElement(T,{dimColor:!0}," ░░░░░░░░░░░░░░░░ "),q[25]=j,q[26]=H,q[27]=J,q[28]=M,q[29]=X;else j=q[25],H=q[26],J=q[27],M=q[28],X=q[29];let P;
|
||
|
||
if(q[30]===Symbol.for("react.memo_cache_sentinel"))P=e1.default.createElement(T,{color:"clawd_body"}," █████████ "),q[30]=P;else P=q[30];let W;if(q[31]===Symbol.for("react.memo_cache_sentinel"))W=e1.default.createElement(T,null," ",P," ",e1.default.createElement(T,{dimColor:!0},"*"),e1.default.createElement(T,null," ")),q[31]=W;else W=q[31];let D;if(q[32]===Symbol.for("react.memo_cache_sentinel"))D=e1.default.createElement(T,null," ",e1.default.createElement(T,{color:"clawd_body"},"██▄█████▄██"),e1.default.createElement(T,null," "),e1.default.createElement(T,{bold:!0},"*"),e1.default.createElement(T,null," ")),q[32]=D;else D=q[32];let f;if(q[33]===Symbol.for("react.memo_cache_sentinel"))f=e1.default.createElement(T,null," ",e1.default.createElement(T,{color:"clawd_body"}," █████████ ")," * "),q[33]=f;else f=q[33];let G;if(q[34]===Symbol.for("react.memo_cache_sentinel"))G=e1.default.createElement(u,{width:xi8},e1.default.createElement(T,null,_,z,Y,$,O,A,w,J,M,X,j,H,W,D,f,e1.default.createElement(T,null,"…………………",e1.default.createElement(T,{color:"clawd_body"},"█ █ █ █"),"………………………………………………………………………………………………………………"))),q[34]=G;else G=q[34];return G}function tsY(q){let K=Y6(44),{theme:_,welcomeMessage:z}=q;if(["light","light-daltonized","light-ansi"].includes(_)){let E;if(K[0]!==z)E=e1.default.createElement(T,{color:"claude"},z," "),K[0]=z,K[1]=E;else E=K[1];let R;if(K[2]===Symbol.for("react.memo_cache_sentinel"))R=e1.default.createElement(T,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION," "),K[2]=R;else R=K[2];let b;if(K[3]!==E)b=e1.default.createElement(T,null,E,R),K[3]=E,K[4]=b;else b=K[4];let I,m,p,C,g,F,U,c;
|
||
|
||
else n=K[17];let z6;if(K[18]===Symbol.for("react.memo_cache_sentinel"))z6=e1.default.createElement(T,null," ",e1.default.createElement(T,{backgroundColor:"clawd_body"}," ".repeat(9))," ░ ▒ "),K[18]=z6;else z6=K[18];let M6;if(K[19]===Symbol.for("react.memo_cache_sentinel"))M6=e1.default.createElement(T,null,"…………………",e1.default.createElement(T,{backgroundColor:"clawd_body"}," "),e1.default.createElement(T,null," "),e1.default.createElement(T,{backgroundColor:"clawd_body"}," "),e1.default.createElement(T,null," "),e1.default.createElement(T,{backgroundColor:"clawd_body"}," "),e1.default.createElement(T,null," "),e1.default.createElement(T,{backgroundColor:"clawd_body"}," "),"……………………………………………………………………░…………………………▒…………"),K[19]=M6;else M6=K[19];let J6;if(K[20]!==b)J6=e1.default.createElement(u,{width:xi8},e1.default.createElement(T,null,b,p,C,g,F,U,c,I,m,K6,o,q6,t,n,z6,M6)),K[20]=b,K[21]=J6;else J6=K[21];return J6}let $;if(K[22]!==z)$=e1.default.createElement(T,{color:"claude"},z," "),K[22]=z,K[23]=$;else $=K[23];let O;if(K[24]===Symbol.for("react.memo_cache_sentinel"))O=e1.default.createElement(T,{dimColor:!0},"v",{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION," "),K[24]=O;else O=K[24];let A;if(K[25]!==$)A=e1.default.createElement(T,null,$,O),K[25]=$,K[26]=A;else A=K[26];let w,j,H,J,M,X;
|
||
|
||
hundreds of files → closer to ${Rq5}. Prefer per-directory or per-module slicing over arbitrary file lists.
|
||
|
||
3. **Determine the e2e test recipe.** Figure out how a worker can verify its change actually works end-to-end — not just that unit tests pass. Look for:
|
||
- A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
|
||
- A \`tmux\` or CLI-verifier skill (for CLI changes: launch the app interactively, exercise the changed behavior)
|
||
- A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
|
||
- An existing e2e/integration test suite the worker can run
|
||
|
||
If you cannot find a concrete e2e path, use the \`${OO}\` tool to ask the user how to verify this change end-to-end. Offer 2–3 specific options based on what you found (e.g., "Screenshot via chrome extension", "Run \`bun run dev\` and curl the endpoint", "No e2e — unit tests are sufficient"). Do not skip this — the workers cannot ask the user themselves.
|
||
|
||
Write the recipe as a short, concrete set of steps that a worker can execute autonomously. Include any setup (start a dev server, build first) and the exact command/interaction to verify.
|
||
|
||
4. **Write the plan.** In your plan file, include:
|
||
- A summary of what you found during research
|
||
- A numbered list of work units — for each: a short title, the list of files/directories it covers, and a one-line description of the change
|
||
- The e2e test recipe (or "skip e2e because …" if the user chose that)
|
||
- The exact worker instructions you will give each agent (the shared template)
|
||
|
||
5. Call \`${FL}\` to present the plan for approval.
|
||
|
||
## Phase 2: Spawn Workers (After Plan Approval)
|
||
|
||
Once the plan is approved, spawn one background agent per work unit using the \`${H4}\` tool. **All agents must use \`isolation: "worktree"\` and \`run_in_background: true\`.** Launch them all in a single message block so they run in parallel.
|
||
|
||
For each agent, the prompt must be fully self-contained. Include:
|
||
- The overall goal (the user's instruction)
|
||
- This unit's specific task (title, file list, change description — copied verbatim from your plan)
|
||
- Any codebase conventions you discovered that the worker needs to follow
|
||
- The e2e test recipe from your plan (or "skip e2e because …")
|
||
- The worker instructions below, copied verbatim:
|
||
|
||
\`\`\`
|
||
${ptY}
|
||
\`\`\`
|
||
|
||
Use \`subagent_type: "general-purpose"\` unless a more specific agent type fits.
|
||
|
||
## Phase 3: Track Progress
|
||
|
||
After launching all workers, render an initial status table:
|
||
|
||
| # | Unit | Status | PR |
|
||
|---|------|--------|----|
|
||
| 1 | <title> | running | — |
|
||
| 2 | <title> | running | — |
|
||
|
||
As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
|
||
|
||
When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
|
||
`}function Sq5(){ww({name:"batch",description:"Research and plan a large-scale change, then execute it in parallel across 5–30 isolated worktree agents that each open a PR.",whenToUse:"Use when the user wants to make a sweeping, mechanical change across many files (migrations, refactors, bulk renames) that can be decomposed into independent parallel units.",argumentHint:"<instruction>",userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(q){let K=q.trim();
|
||
|
||
var parameters = new MessageCreateParams
|
||
{
|
||
Model = Model.ClaudeSonnet4_6,
|
||
MaxTokens = 16000,
|
||
Tools = [
|
||
new Tool {
|
||
Name = "get_weather",
|
||
Description = "Get the current weather in a given location",
|
||
InputSchema = new() {
|
||
Properties = new Dictionary<string, JsonElement> {
|
||
["location"] = JsonSerializer.SerializeToElement(
|
||
new { type = "string", description = "City name" }),
|
||
},
|
||
Required = ["location"],
|
||
},
|
||
},
|
||
],
|
||
Messages = [new() { Role = Role.User, Content = "Weather in Paris?" }],
|
||
};
|
||
\`\`\`
|
||
|
||
Derived from \`anthropic-sdk-csharp/src/Anthropic/Models/Messages/Tool.cs\` and \`ToolUnion.cs:799\` (implicit conversion).
|
||
|
||
See [shared tool use concepts](../shared/tool-use-concepts.md) for the loop pattern.
|
||
### Converting response content to the follow-up assistant message
|
||
|
||
When echoing Claude's response back in the assistant turn, **there is no \`.ToParam()\` helper** — manually reconstruct each \`ContentBlock\` variant as its \`*Param\` counterpart. Do NOT use \`new ContentBlockParam(block.Json)\`: it compiles and serializes, but \`.Value\` stays \`null\` so \`TryPick*\`/\`Validate()\` fail (degraded JSON pass-through, not the typed path).
|
||
|
||
\`\`\`csharp
|
||
using Anthropic.Models.Messages;
|
||
|
||
Message response = await client.Messages.Create(parameters);
|
||
|
||
// No .ToParam() — reconstruct per variant. Implicit conversions from each
|
||
// *Param type to ContentBlockParam mean no explicit wrapper.
|
||
List<ContentBlockParam> assistantContent = [];
|
||
List<ContentBlockParam> toolResults = [];
|
||
foreach (ContentBlock block in response.Content)
|
||
{
|
||
if (block.TryPickText(out TextBlock? text))
|
||
{
|
||
assistantContent.Add(new TextBlockParam { Text = text.Text });
|
||
|
||
var V45=`# Claude API — cURL / Raw HTTP
|
||
|
||
Use these examples when the user needs raw HTTP requests or is working in a language without an official SDK.
|
||
|
||
## Setup
|
||
|
||
\`\`\`bash
|
||
export ANTHROPIC_API_KEY="your-api-key"
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Basic Message Request
|
||
|
||
\`\`\`bash
|
||
curl https://api.anthropic.com/v1/messages \\
|
||
-H "Content-Type: application/json" \\
|
||
-H "x-api-key: $ANTHROPIC_API_KEY" \\
|
||
-H "anthropic-version: 2023-06-01" \\
|
||
-d '{
|
||
"model": "{{OPUS_ID}}",
|
||
"max_tokens": 16000,
|
||
"messages": [
|
||
{"role": "user", "content": "What is the capital of France?"}
|
||
]
|
||
}'
|
||
\`\`\`
|
||
|
||
### Parsing the response
|
||
|
||
Use \`jq\` to extract fields from the JSON response. Do not use \`grep\`/\`sed\` —
|
||
JSON strings can contain any character and regex parsing will break on quotes,
|
||
escapes, or multi-line content.
|
||
|
||
\`\`\`bash
|
||
# Capture the response, then extract fields
|
||
response=$(curl -s https://api.anthropic.com/v1/messages \\
|
||
-H "Content-Type: application/json" \\
|
||
-H "x-api-key: $ANTHROPIC_API_KEY" \\
|
||
-H "anthropic-version: 2023-06-01" \\
|
||
-d '{"model":"{{OPUS_ID}}","max_tokens":16000,"messages":[{"role":"user","content":"Hello"}]}')
|
||
|
||
# Print the first text block (-r strips the JSON quotes)
|
||
echo "$response" | jq -r '.content[0].text'
|
||
|
||
# Read usage fields
|
||
input_tokens=$(echo "$response" | jq -r '.usage.input_tokens')
|
||
output_tokens=$(echo "$response" | jq -r '.usage.output_tokens')
|
||
|
||
# Read stop reason (for tool-use loops)
|
||
stop_reason=$(echo "$response" | jq -r '.stop_reason')
|
||
|
||
# Extract all text blocks (content is an array;
|
||
|
||
var k45=()=>{};var y45=`# Claude API — Go
|
||
|
||
> **Note:** The Go SDK supports the Claude API and beta tool use with \`BetaToolRunner\`. Agent SDK is not yet available for Go.
|
||
|
||
## Installation
|
||
|
||
\`\`\`bash
|
||
go get github.com/anthropics/anthropic-sdk-go
|
||
\`\`\`
|
||
|
||
## Client Initialization
|
||
|
||
\`\`\`go
|
||
import (
|
||
"github.com/anthropics/anthropic-sdk-go"
|
||
"github.com/anthropics/anthropic-sdk-go/option"
|
||
)
|
||
|
||
// Default (uses ANTHROPIC_API_KEY env var)
|
||
client := anthropic.NewClient()
|
||
|
||
// Explicit API key
|
||
client := anthropic.NewClient(
|
||
option.WithAPIKey("your-api-key"),
|
||
)
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Basic Message Request
|
||
|
||
\`\`\`go
|
||
response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
|
||
Model: anthropic.ModelClaudeOpus4_6,
|
||
MaxTokens: 16000,
|
||
Messages: []anthropic.MessageParam{
|
||
anthropic.NewUserMessage(anthropic.NewTextBlock("What is the capital of France?")),
|
||
},
|
||
})
|
||
if err != nil {
|
||
log.Fatal(err)
|
||
}
|
||
for _, block := range response.Content {
|
||
switch variant := block.AsAny().(type) {
|
||
case anthropic.TextBlock:
|
||
fmt.Println(variant.Text)
|
||
}
|
||
}
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Streaming
|
||
|
||
\`\`\`go
|
||
stream := client.Messages.NewStreaming(context.Background(), anthropic.MessageNewParams{
|
||
Model: anthropic.ModelClaudeOpus4_6,
|
||
MaxTokens: 64000,
|
||
Messages: []anthropic.MessageParam{
|
||
anthropic.NewUserMessage(anthropic.NewTextBlock("Write a haiku")),
|
||
},
|
||
})
|
||
|
||
for stream.Next() {
|
||
event := stream.Current()
|
||
switch eventVariant := event.AsAny().(type) {
|
||
case anthropic.ContentBlockDeltaEvent:
|
||
switch deltaVariant := eventVariant.Delta.AsAny().(type) {
|
||
case anthropic.TextDelta:
|
||
fmt.Print(deltaVariant.Text)
|
||
}
|
||
}
|
||
}
|
||
if err := stream.Err();
|
||
|
||
err != nil {
|
||
log.Fatal(err)
|
||
}
|
||
\`\`\`
|
||
|
||
**Accumulating the final message** (there is no \`GetFinalMessage()\` on the stream):
|
||
|
||
\`\`\`go
|
||
stream := client.Messages.NewStreaming(ctx, params)
|
||
message := anthropic.Message{}
|
||
for stream.Next() {
|
||
message.Accumulate(stream.Current())
|
||
}
|
||
if err := stream.Err();
|
||
|
||
content used in messages is billed as input tokens
|
||
- Not available on Amazon Bedrock or Google Vertex AI
|
||
|
||
---
|
||
|
||
## Upload a File
|
||
|
||
\`\`\`python
|
||
import anthropic
|
||
|
||
client = anthropic.Anthropic()
|
||
|
||
uploaded = client.beta.files.upload(
|
||
file=("report.pdf", open("report.pdf", "rb"), "application/pdf"),
|
||
)
|
||
print(f"File ID: {uploaded.id}")
|
||
print(f"Size: {uploaded.size_bytes} bytes")
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Use a File in Messages
|
||
|
||
### PDF / Text Document
|
||
|
||
\`\`\`python
|
||
response = client.beta.messages.create(
|
||
model="{{OPUS_ID}}",
|
||
max_tokens=16000,
|
||
messages=[{
|
||
"role": "user",
|
||
"content": [
|
||
{"type": "text", "text": "Summarize the key findings in this report."},
|
||
{
|
||
"type": "document",
|
||
"source": {"type": "file", "file_id": uploaded.id},
|
||
"title": "Q4 Report", # optional
|
||
"citations": {"enabled": True} # optional, enables citations
|
||
}
|
||
]
|
||
}],
|
||
betas=["files-api-2025-04-14"],
|
||
)
|
||
for block in response.content:
|
||
if block.type == "text":
|
||
print(block.text)
|
||
\`\`\`
|
||
|
||
### Image
|
||
|
||
\`\`\`python
|
||
image_file = client.beta.files.upload(
|
||
file=("photo.png", open("photo.png", "rb"), "image/png"),
|
||
)
|
||
|
||
response = client.beta.messages.create(
|
||
model="{{OPUS_ID}}",
|
||
max_tokens=16000,
|
||
messages=[{
|
||
"role": "user",
|
||
"content": [
|
||
{"type": "text", "text": "What's in this image?"},
|
||
{
|
||
"type": "image",
|
||
"source": {"type": "file", "file_id": image_file.id}
|
||
}
|
||
]
|
||
}],
|
||
betas=["files-api-2025-04-14"],
|
||
)
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Manage Files
|
||
|
||
### List Files
|
||
|
||
\`\`\`python
|
||
files = client.beta.files.list()
|
||
for f in files.data:
|
||
print(f"{f.id}: {f.filename} ({f.size_bytes} bytes)")
|
||
\`\`\`
|
||
|
||
### Get File Metadata
|
||
|
||
\`\`\`python
|
||
file_info = client.beta.files.retrieve_metadata("file_011CNha8iCJcU1wXNR6q4V8w")
|
||
print(f"Filename: {file_info.filename}")
|
||
print(f"MIME type: {file_info.mime_type}")
|
||
\`\`\`
|
||
|
||
### Delete a File
|
||
|
||
\`\`\`python
|
||
client.beta.files.delete("file_011CNha8iCJcU1wXNR6q4V8w")
|
||
\`\`\`
|
||
|
||
### Download a File
|
||
|
||
Only files created by the code execution tool or skills can be downloaded (not user-uploaded files).
|
||
|
||
\`\`\`python
|
||
file_content = client.beta.files.download("file_011CNha8iCJcU1wXNR6q4V8w")
|
||
file_content.write_to_file("output.txt")
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Full End-to-End Example
|
||
|
||
Upload a document once, ask multiple questions about it:
|
||
|
||
\`\`\`python
|
||
import anthropic
|
||
|
||
client = anthropic.Anthropic()
|
||
|
||
# 1. Upload once
|
||
uploaded = client.beta.files.upload(
|
||
file=("contract.pdf", open("contract.pdf", "rb"), "application/pdf"),
|
||
)
|
||
print(f"Uploaded: {uploaded.id}")
|
||
|
||
# 2. Ask multiple questions using the same file_id
|
||
questions = [
|
||
"What are the key terms and conditions?",
|
||
"What is the termination clause?",
|
||
"Summarize the payment schedule.",
|
||
]
|
||
|
||
for question in questions:
|
||
response = client.beta.messages.create(
|
||
model="{{OPUS_ID}}",
|
||
max_tokens=16000,
|
||
messages=[{
|
||
"role": "user",
|
||
"content": [
|
||
{"type": "text", "text": question},
|
||
{
|
||
"type": "document",
|
||
"source": {"type": "file", "file_id": uploaded.id}
|
||
}
|
||
]
|
||
}],
|
||
betas=["files-api-2025-04-14"],
|
||
)
|
||
print(f"\\nQ: {question}")
|
||
text = next((b.text for b in response.content if b.type == "text"), "")
|
||
print(f"A: {text[:200]}")
|
||
|
||
# 3. Clean up when done
|
||
client.beta.files.delete(uploaded.id)
|
||
\`\`\`
|
||
`;
|
||
|
||
var F45=()=>{};var d45=`# Tool Use — Python
|
||
|
||
For conceptual overview (tool definitions, tool choice, tips), see [shared/tool-use-concepts.md](../../shared/tool-use-concepts.md).
|
||
|
||
## Tool Runner (Recommended)
|
||
|
||
**Beta:** The tool runner is in beta in the Python SDK.
|
||
|
||
Use the \`@beta_tool\` decorator to define tools as typed functions, then pass them to \`client.beta.messages.tool_runner()\`:
|
||
|
||
\`\`\`python
|
||
import anthropic
|
||
from anthropic import beta_tool
|
||
|
||
client = anthropic.Anthropic()
|
||
|
||
@beta_tool
|
||
def get_weather(location: str, unit: str = "celsius") -> str:
|
||
"""Get current weather for a location.
|
||
|
||
Args:
|
||
location: City and state, e.g., San Francisco, CA.
|
||
unit: Temperature unit, either "celsius" or "fahrenheit".
|
||
"""
|
||
# Your implementation here
|
||
return f"72°F and sunny in {location}"
|
||
|
||
# The tool runner handles the agentic loop automatically
|
||
runner = client.beta.messages.tool_runner(
|
||
model="{{OPUS_ID}}",
|
||
max_tokens=16000,
|
||
tools=[get_weather],
|
||
messages=[{"role": "user", "content": "What's the weather in Paris?"}],
|
||
)
|
||
|
||
# Each iteration yields a BetaMessage;
|
||
|
||
use \`output_config: {format: {...}}\` on \`messages.create()\`.
|
||
|
||
**Supporting endpoints** — Batches (\`POST /v1/messages/batches\`), Files (\`POST /v1/files\`), Token Counting, and Models (\`GET /v1/models\`, \`GET /v1/models/{id}\` — live capability/context-window discovery) feed into or support Messages API requests.
|
||
|
||
---
|
||
|
||
## Current Models (cached: 2026-02-17)
|
||
|
||
| Model | Model ID | Context | Input $/1M | Output $/1M |
|
||
| ----------------- | ------------------- | -------------- | ---------- | ----------- |
|
||
| Claude Opus 4.6 | \`claude-opus-4-6\` | 200K (1M beta) | $5.00 | $25.00 |
|
||
| Claude Sonnet 4.6 | \`claude-sonnet-4-6\` | 200K (1M beta) | $3.00 | $15.00 |
|
||
| Claude Haiku 4.5 | \`claude-haiku-4-5\` | 200K | $1.00 | $5.00 |
|
||
|
||
**ALWAYS use \`{{OPUS_ID}}\` unless the user explicitly names a different model.** This is non-negotiable. Do not use \`{{SONNET_ID}}\`, \`{{PREV_SONNET_ID}}\`, or any other model unless the user literally says "use sonnet" or "use haiku". Never downgrade for cost — that's the user's decision, not yours.
|
||
|
||
**CRITICAL: Use only the exact model ID strings from the table above — they are complete as-is. Do not append date suffixes.** For example, use \`claude-sonnet-4-5\`, never \`claude-sonnet-4-5-20250514\` or any other date-suffixed variant you might recall from training data. If the user requests an older model not in the table (e.g., "opus 4.5", "sonnet 3.7"), read \`shared/models.md\` for the exact ID — do not construct one yourself.
|
||
|
||
A note: if any of the model strings above look unfamiliar to you, that's to be expected — that just means they were released after your training data cutoff. Rest assured they are real models;
|
||
|
||
do NOT use .data
|
||
[m for m in client.models.list()
|
||
if m.capabilities["thinking"]["types"]["adaptive"]["supported"]
|
||
and m.max_input_tokens >= 200_000]
|
||
\`\`\`
|
||
|
||
Top-level fields (\`id\`, \`display_name\`, \`max_input_tokens\`, \`max_tokens\`) are typed attributes. \`capabilities\` is a dict — use bracket access, not attribute access. The API returns the full capability tree for every model with \`supported: true/false\` at each leaf, so bracket chains are safe without \`.get()\` guards. TypeScript SDK: same method names, also auto-paginates on iteration.
|
||
|
||
### Raw HTTP
|
||
|
||
\`\`\`bash
|
||
curl https://api.anthropic.com/v1/models/claude-opus-4-6 \\
|
||
-H "x-api-key: $ANTHROPIC_API_KEY" \\
|
||
-H "anthropic-version: 2023-06-01"
|
||
\`\`\`
|
||
|
||
\`\`\`json
|
||
{
|
||
"id": "claude-opus-4-6",
|
||
"display_name": "Claude Opus 4.6",
|
||
"max_input_tokens": 1000000,
|
||
"max_tokens": 128000,
|
||
"capabilities": {
|
||
"image_input": {"supported": true},
|
||
"structured_outputs": {"supported": true},
|
||
"thinking": {"supported": true, "types": {"enabled": {"supported": true}, "adaptive": {"supported": true}}},
|
||
"effort": {"supported": true, "low": {"supported": true}, …, "max": {"supported": true}},
|
||
…
|
||
}
|
||
}
|
||
\`\`\`
|
||
|
||
## Current Models (recommended)
|
||
|
||
| Friendly Name | Alias (use this) | Full ID | Context | Max Output | Status |
|
||
|-------------------|---------------------|-------------------------------|----------------|------------|--------|
|
||
| Claude Opus 4.6 | \`claude-opus-4-6\` | — | 200K (1M beta) | 128K | Active |
|
||
| Claude Sonnet 4.6 | \`claude-sonnet-4-6\` | - | 200K (1M beta) | 64K | Active |
|
||
| Claude Haiku 4.5 | \`claude-haiku-4-5\` | \`claude-haiku-4-5-20251001\` | 200K | 64K | Active |
|
||
|
||
### Model Descriptions
|
||
|
||
- **Claude Opus 4.6** — Our most intelligent model for building agents and coding. Supports adaptive thinking (recommended), 128K max output tokens (requires streaming for large outputs). 1M context window available in beta via \`context-1m-2025-08-07\` header.
|
||
- **Claude Sonnet 4.6** — Our best combination of speed and intelligence. Supports adaptive thinking (recommended). 1M context window available in beta via \`context-1m-2025-08-07\` header. 64K max output tokens.
|
||
- **Claude Haiku 4.5** — Fastest and most cost-effective model for simple tasks.
|
||
|
||
## Legacy Models (still active)
|
||
|
||
| Friendly Name | Alias (use this) | Full ID | Status |
|
||
|-------------------|---------------------|-------------------------------|--------|
|
||
| Claude Opus 4.5 | \`claude-opus-4-5\` | \`claude-opus-4-5-20251101\` | Active |
|
||
| Claude Opus 4.1 | \`claude-opus-4-1\` | \`claude-opus-4-1-20250805\` | Active |
|
||
| Claude Sonnet 4.5 | \`claude-sonnet-4-5\` | \`claude-sonnet-4-5-20250929\` | Active |
|
||
| Claude Sonnet 4 | \`claude-sonnet-4-0\` | \`claude-sonnet-4-20250514\` | Active |
|
||
| Claude Opus 4 | \`claude-opus-4-0\` | \`claude-opus-4-20250514\` | Active |
|
||
|
||
## Deprecated Models (retiring soon)
|
||
|
||
| Friendly Name | Alias (use this) | Full ID | Status | Retires |
|
||
|-------------------|---------------------|-------------------------------|------------|--------------|
|
||
| Claude Haiku 3 | — | \`claude-3-haiku-20240307\` | Deprecated | Apr 19, 2026 |
|
||
|
||
## Retired Models (no longer available)
|
||
|
||
| Friendly Name | Full ID | Retired |
|
||
|-------------------|-------------------------------|-------------|
|
||
| Claude Sonnet 3.7 | \`claude-3-7-sonnet-20250219\` | Feb 19, 2026 |
|
||
| Claude Haiku 3.5 | \`claude-3-5-haiku-20241022\` | Feb 19, 2026 |
|
||
| Claude Opus 3 | \`claude-3-opus-20240229\` | Jan 5, 2026 |
|
||
| Claude Sonnet 3.5 | \`claude-3-5-sonnet-20241022\` | Oct 28, 2025 |
|
||
| Claude Sonnet 3.5 | \`claude-3-5-sonnet-20240620\` | Oct 28, 2025 |
|
||
| Claude Sonnet 3 | \`claude-3-sonnet-20240229\` | Jul 21, 2025 |
|
||
| Claude 2.1 | \`claude-2.1\` | Jul 21, 2025 |
|
||
| Claude 2.0 | \`claude-2.0\` | Jul 21, 2025 |
|
||
|
||
## Resolving User Requests
|
||
|
||
When a user asks for a model by name, use this table to find the correct model ID:
|
||
|
||
| User says... | Use this model ID |
|
||
|-------------------------------------------|--------------------------------|
|
||
| "opus", "most powerful" | \`claude-opus-4-6\` |
|
||
| "opus 4.6" | \`claude-opus-4-6\` |
|
||
| "opus 4.5" | \`claude-opus-4-5\` |
|
||
| "opus 4.1" | \`claude-opus-4-1\` |
|
||
| "opus 4", "opus 4.0" | \`claude-opus-4-0\` |
|
||
| "sonnet", "balanced" | \`claude-sonnet-4-6\` |
|
||
| "sonnet 4.6" | \`claude-sonnet-4-6\` |
|
||
| "sonnet 4.5" | \`claude-sonnet-4-5\` |
|
||
| "sonnet 4", "sonnet 4.0" | \`claude-sonnet-4-0\` |
|
||
| "sonnet 3.7" | Retired — suggest \`claude-sonnet-4-5\` |
|
||
| "sonnet 3.5" | Retired — suggest \`claude-sonnet-4-5\` |
|
||
| "haiku", "fast", "cheap" | \`claude-haiku-4-5\` |
|
||
| "haiku 4.5" | \`claude-haiku-4-5\` |
|
||
| "haiku 3.5" | Retired — suggest \`claude-haiku-4-5\` |
|
||
| "haiku 3" | Deprecated — suggest \`claude-haiku-4-5\` |
|
||
`;
|
||
|
||
console.log(\`Status: \${cancelled.processing_status}\`); // "canceling"
|
||
\`\`\`
|
||
`;var HK5=()=>{};var XK5=`# Files API — TypeScript
|
||
|
||
The Files API uploads files for use in Messages API requests. Reference files via \`file_id\` in content blocks, avoiding re-uploads across multiple API calls.
|
||
|
||
**Beta:** Pass \`betas: ["files-api-2025-04-14"]\` in your API calls (the SDK sets the required header automatically).
|
||
|
||
## Key Facts
|
||
|
||
- Maximum file size: 500 MB
|
||
- Total storage: 100 GB per organization
|
||
- Files persist until deleted
|
||
- File operations (upload, list, delete) are free; content used in messages is billed as input tokens
|
||
- Not available on Amazon Bedrock or Google Vertex AI
|
||
|
||
---
|
||
|
||
## Upload a File
|
||
|
||
\`\`\`typescript
|
||
import Anthropic, { toFile } from "@anthropic-ai/sdk";
|
||
import fs from "fs";
|
||
|
||
const client = new Anthropic();
|
||
|
||
const uploaded = await client.beta.files.upload({
|
||
file: await toFile(fs.createReadStream("report.pdf"), undefined, {
|
||
type: "application/pdf",
|
||
}),
|
||
betas: ["files-api-2025-04-14"],
|
||
});
|
||
|
||
console.log(\`File ID: \${uploaded.id}\`);
|
||
console.log(\`Size: \${uploaded.size_bytes} bytes\`);
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Use a File in Messages
|
||
|
||
### PDF / Text Document
|
||
|
||
\`\`\`typescript
|
||
const response = await client.beta.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
messages: [
|
||
{
|
||
role: "user",
|
||
content: [
|
||
{ type: "text", text: "Summarize the key findings in this report." },
|
||
{
|
||
type: "document",
|
||
source: { type: "file", file_id: uploaded.id },
|
||
title: "Q4 Report",
|
||
citations: { enabled: true },
|
||
},
|
||
],
|
||
},
|
||
],
|
||
betas: ["files-api-2025-04-14"],
|
||
});
|
||
|
||
console.log(response.content[0].text);
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Manage Files
|
||
|
||
### List Files
|
||
|
||
\`\`\`typescript
|
||
const files = await client.beta.files.list({
|
||
betas: ["files-api-2025-04-14"],
|
||
});
|
||
for (const f of files.data) {
|
||
console.log(\`\${f.id}: \${f.filename} (\${f.size_bytes} bytes)\`);
|
||
|
||
}
|
||
\`\`\`
|
||
|
||
### Delete a File
|
||
|
||
\`\`\`typescript
|
||
await client.beta.files.delete("file_011CNha8iCJcU1wXNR6q4V8w", {
|
||
betas: ["files-api-2025-04-14"],
|
||
});
|
||
\`\`\`
|
||
|
||
### Download a File
|
||
|
||
\`\`\`typescript
|
||
const response = await client.beta.files.download(
|
||
"file_011CNha8iCJcU1wXNR6q4V8w",
|
||
{ betas: ["files-api-2025-04-14"] },
|
||
);
|
||
const content = Buffer.from(await response.arrayBuffer());
|
||
await fs.promises.writeFile("output.txt", content);
|
||
\`\`\`
|
||
`;var MK5=()=>{};var WK5=`# Claude API — TypeScript
|
||
|
||
## Installation
|
||
|
||
\`\`\`bash
|
||
npm install @anthropic-ai/sdk
|
||
\`\`\`
|
||
|
||
## Client Initialization
|
||
|
||
\`\`\`typescript
|
||
import Anthropic from "@anthropic-ai/sdk";
|
||
|
||
// Default (uses ANTHROPIC_API_KEY env var)
|
||
const client = new Anthropic();
|
||
|
||
// Explicit API key
|
||
const client = new Anthropic({ apiKey: "your-api-key" });
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Basic Message Request
|
||
|
||
\`\`\`typescript
|
||
const response = await client.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
messages: [{ role: "user", content: "What is the capital of France?" }],
|
||
});
|
||
// response.content is ContentBlock[] — a discriminated union. Narrow by .type
|
||
// before accessing .text (TypeScript will error on content[0].text without this).
|
||
for (const block of response.content) {
|
||
if (block.type === "text") {
|
||
console.log(block.text);
|
||
}
|
||
}
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## System Prompts
|
||
|
||
\`\`\`typescript
|
||
const response = await client.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
system:
|
||
"You are a helpful coding assistant. Always provide examples in Python.",
|
||
messages: [{ role: "user", content: "How do I read a JSON file?" }],
|
||
});
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Vision (Images)
|
||
|
||
### URL
|
||
|
||
\`\`\`typescript
|
||
const response = await client.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
messages: [
|
||
{
|
||
role: "user",
|
||
content: [
|
||
{
|
||
type: "image",
|
||
source: { type: "url", url: "https://example.com/image.png" },
|
||
},
|
||
{ type: "text", text: "Describe this image" },
|
||
],
|
||
},
|
||
],
|
||
});
|
||
|
||
// With explicit TTL (time-to-live)
|
||
const response2 = await client.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
system: [
|
||
{
|
||
type: "text",
|
||
text: "You are an expert on this large document...",
|
||
cache_control: { type: "ephemeral", ttl: "1h" }, // 1 hour TTL
|
||
},
|
||
],
|
||
messages: [{ role: "user", content: "Summarize the key points" }],
|
||
});
|
||
\`\`\`
|
||
|
||
### Verifying Cache Hits
|
||
|
||
\`\`\`typescript
|
||
console.log(response.usage.cache_creation_input_tokens); // tokens written to cache (~1.25x cost)
|
||
console.log(response.usage.cache_read_input_tokens); // tokens served from cache (~0.1x cost)
|
||
console.log(response.usage.input_tokens); // uncached tokens (full cost)
|
||
\`\`\`
|
||
|
||
If \`cache_read_input_tokens\` is zero across repeated identical-prefix requests, a silent invalidator is at work — \`Date.now()\` or a UUID in the system prompt, non-deterministic key ordering, or a varying tool set. See \`shared/prompt-caching.md\` for the full audit table.
|
||
|
||
---
|
||
|
||
## Extended Thinking
|
||
|
||
> **Opus 4.6 and Sonnet 4.6:** Use adaptive thinking. \`budget_tokens\` is deprecated on both Opus 4.6 and Sonnet 4.6.
|
||
> **Older models:** Use \`thinking: {type: "enabled", budget_tokens: N}\` (must be < \`max_tokens\`, min 1024).
|
||
|
||
\`\`\`typescript
|
||
// Opus 4.6: adaptive thinking (recommended)
|
||
const response = await client.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
thinking: { type: "adaptive" },
|
||
output_config: { effort: "high" }, // low | medium | high | max
|
||
messages: [
|
||
{ role: "user", content: "Solve this math problem step by step..." },
|
||
],
|
||
});
|
||
|
||
for (const block of response.content) {
|
||
if (block.type === "thinking") {
|
||
console.log("Thinking:", block.thinking);
|
||
} else if (block.type === "text") {
|
||
console.log("Response:", block.text);
|
||
}
|
||
}
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Error Handling
|
||
|
||
Use the SDK's typed exception classes — never check error messages with string matching:
|
||
|
||
\`\`\`typescript
|
||
import Anthropic from "@anthropic-ai/sdk";
|
||
|
||
h45();S45();b45();I45();m45();B45();F45();Q45();c45();n45();r45();a45();t45();qK5();_K5();YK5();OK5();wK5();HK5();MK5();PK5();DK5();ZK5();$6$={OPUS_ID:"claude-opus-4-6",OPUS_NAME:"Claude Opus 4.6",SONNET_ID:"claude-sonnet-4-6",SONNET_NAME:"Claude Sonnet 4.6",HAIKU_ID:"claude-haiku-4-5",HAIKU_NAME:"Claude Haiku 4.5",PREV_SONNET_ID:"claude-sonnet-4-5"},O6$=i45,A6$={"csharp/claude-api.md":T45,"curl/examples.md":V45,"go/claude-api.md":y45,"java/claude-api.md":L45,"php/claude-api.md":R45,"python/agent-sdk/README.md":x45,"python/agent-sdk/patterns.md":C45,"python/claude-api/README.md":g45,"python/claude-api/batches.md":u45,"python/claude-api/files-api.md":p45,"python/claude-api/streaming.md":U45,"python/claude-api/tool-use.md":d45,"ruby/claude-api.md":l45,"shared/agent-design.md":o45,"shared/error-codes.md":s45,"shared/live-sources.md":e45,"shared/models.md":KK5,"shared/prompt-caching.md":zK5,"shared/tool-use-concepts.md":$K5,"typescript/agent-sdk/README.md":jK5,"typescript/agent-sdk/patterns.md":AK5,"typescript/claude-api/README.md":WK5,"typescript/claude-api/batches.md":JK5,"typescript/claude-api/files-api.md":XK5,"typescript/claude-api/streaming.md":fK5,"typescript/claude-api/tool-use.md":GK5}});var NK5={};v8(NK5,{registerClaudeApiSkill:()=>W6$});import{readdir as j6$}from"fs/promises";async function J6$(){let q=Z8(),K;try{K=await j6$(q)}catch{return null}for(let[_,z]of Object.entries(H6$)){if(z.length===0)continue;for(let Y of z)if(Y.startsWith(".")){if(K.some(($)=>$.endsWith(Y)))return _}else if(K.includes(Y))return _}return null}function M6$(q,K,_){return Object.keys(K).filter((z)=>{if(z.startsWith(`${q}/`))return!0;if(_&&z.startsWith(_.SHARED_PREFIX))return _.hasDocsForLang(q);return z.startsWith("shared/")})}function VK5(q,K){let _=q,z;do z=_,_=_.replace(/<!--[\s\S]*?-->\n?/g,"");while(_!==z);return _=_.replace(/\{\{(\w+)\}\}/g,(Y,$)=>K.SKILL_MODEL_VARS[$]??Y),_}function kK5(q,K,_){let z=[];for(let Y of q.sort()){let $=K[Y];if(!$)continue;
|
||
|
||
if(H&&!nP({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION,H))S4(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION} → ${H}
|
||
`),S4(`
|
||
`),S4(`To update, run:
|
||
`),S4($8.bold(" brew upgrade claude-code")+`
|
||
`);else S4(`Claude is up to date!
|
||
`)}else if(j==="winget"){S4(`Claude is managed by winget.
|
||
`);let H=await Oj6(q);if(H&&!nP({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION,H))S4(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION} → ${H}
|
||
`),S4(`
|
||
`),S4(`To update, run:
|
||
`),S4($8.bold(" winget upgrade Anthropic.ClaudeCode")+`
|
||
`);else S4(`Claude is up to date!
|
||
`)}else if(j==="apk"){S4(`Claude is managed by apk.
|
||
`);let H=await Oj6(q);
|
||
|
||
if(H&&!nP({ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION,H))S4(`Update available: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION} → ${H}
|
||
`),S4(`
|
||
`),S4(`To update, run:
|
||
`),S4($8.bold(" apk upgrade claude-code")+`
|
||
`);else S4(`Claude is up to date!
|
||
`)}else S4(`Claude is managed by a package manager.
|
||
`),S4(`Please use your package manager to update.
|
||
`);await uK(0)}if(_.installMethod&&K.configInstallMethod!=="not set"&&K.installationType!=="package-manager"){let{installationType:j,configInstallMethod:H}=K,M={"npm-local":"local","npm-global":"global",native:"native",development:"development",unknown:"unknown"}[j]||j;if(M!==H&&H!=="unknown")S4(`
|
||
`),S4($8.yellow("Warning: Configuration mismatch")+`
|
||
`),S4(`Config expects: ${H} installation
|
||
`),S4(`Currently running: ${j}
|
||
`),S4($8.yellow(`Updating the ${j} installation you are currently using`)+`
|
||
`),S8((X)=>({...X,installMethod:M})),S4(`Config updated to reflect current installation method: ${M}
|
||
`)}if(K.installationType==="native"){N("update: Detected native installation, using native updater");try{let j=await Pj6(q,!0);if(j.lockFailed){let H=j.lockHolderPid?` (PID ${j.lockHolderPid})`:"";S4($8.yellow(`Another Claude process${H} is currently running. Please try again in a moment.`)+`
|
||
`),await uK(0)}if(!j.latestVersion)process.stderr.write(`Failed to check for updates
|
||
`),await uK(1);
|
||
|
||
if(j.latestVersion==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION)S4($8.green(`Claude Code is up to date (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION})`)+`
|
||
`);else S4($8.green(`Successfully updated from ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION} to version ${j.latestVersion}`)+`
|
||
`),await p47();await uK(0)}catch(j){process.stderr.write(`Error: Failed to install native update
|
||
`),process.stderr.write(String(j)+`
|
||
`),process.stderr.write(`Try running "claude doctor" for diagnostics
|
||
`),await uK(1)}}if(_.installMethod!=="native")await j68();N("update: Checking npm registry for latest version"),N(`update: Package URL: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL}`);
|
||
|
||
let z=q==="stable"?"stable":"latest",Y=`npm view ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL}@${z} version`;N(`update: Running: ${Y}`);let $=await Oj6(q);if(N(`update: Latest version from npm: ${$||"FAILED"}`),!$){if(N("update: Failed to get latest version from npm registry"),process.stderr.write($8.red("Failed to check for updates")+`
|
||
`),process.stderr.write(`Unable to fetch latest version from npm registry
|
||
`),process.stderr.write(`
|
||
`),process.stderr.write(`Possible causes:
|
||
`),process.stderr.write(` • Network connectivity issues
|
||
`),process.stderr.write(` • npm registry is unreachable
|
||
`),process.stderr.write(` • Corporate proxy/firewall blocking npm
|
||
`),{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL&&!{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL.startsWith("@anthropic"))process.stderr.write(` • Internal/development build not published to npm
|
||
`);process.stderr.write(`
|
||
`),process.stderr.write(`Try:
|
||
`),process.stderr.write(` • Check your internet connection
|
||
`),process.stderr.write(` • Run with --debug flag for more details
|
||
`);
|
||
|
||
let j={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL||"@anthropic-ai/claude-code";process.stderr.write(` • Manually check: npm view ${j} version
|
||
`),process.stderr.write(` • Check if you need to login: npm whoami
|
||
`),await uK(1)}if($==={ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION)S4($8.green(`Claude Code is up to date (${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION})`)+`
|
||
`),await uK(0);S4(`New version available: ${$} (current: ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.VERSION})
|
||
`),S4(`Installing update...
|
||
`);let O=!1,A="";switch(K.installationType){case"npm-local":O=!0,A="local";break;case"npm-global":O=!1,A="global";break;case"unknown":{let j=await Yj6();O=j,A=j?"local":"global",S4($8.yellow("Warning: Could not determine installation type")+`
|
||
`),S4(`Attempting ${A} update based on file detection...
|
||
`);
|
||
|
||
await M(j,H,J)}),Y.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async(j)=>{let{mcpAddFromDesktopHandler:H}=await Promise.resolve().then(() => (a36(),o36));await H(j)}),Y.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:j}=await Promise.resolve().then(() => (a36(),o36));await j()});let $=K.command("auth").description("Manage authentication").configureHelp(q());$.command("login").description("Sign in to your Anthropic account").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai","Use Claude subscription (default)").action(async({email:j,sso:H,console:J,claudeai:M})=>{let{authLogin:X}=await Promise.resolve().then(() => (cE6(),zx8));await X({email:j,sso:H,console:J,claudeai:M})}),$.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").action(async(j)=>{let{authStatus:H}=await Promise.resolve().then(() => (cE6(),zx8));await H(j)}),$.command("logout").description("Log out from your Anthropic account").action(async()=>{let{authLogout:j}=await Promise.resolve().then(() => (cE6(),zx8));await j()});let O=()=>new V3("--cowork","Use cowork_plugins directory").hideHelp(),A=K.command("plugin").alias("plugins").description("Manage Claude Code plugins").configureHelp(q());A.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(O()).action(async(j,H)=>{let{pluginValidateHandler:J}=await Promise.resolve().then(() => (Ix(),xx));
|
||
|
||
await J(j,H)}),A.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(O()).action(async(j)=>{let{pluginListHandler:H}=await Promise.resolve().then(() => (Ix(),xx));await H(j)});let w=A.command("marketplace").description("Manage Claude Code marketplaces").configureHelp(q());if(w.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(O()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .claude-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(j,H)=>{let{marketplaceAddHandler:J}=await Promise.resolve().then(() => (Ix(),xx));await J(j,H)}),w.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(O()).action(async(j)=>{let{marketplaceListHandler:H}=await Promise.resolve().then(() => (Ix(),xx));await H(j)}),w.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(O()).action(async(j,H)=>{let{marketplaceRemoveHandler:J}=await Promise.resolve().then(() => (Ix(),xx));await J(j,H)}),w.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(O()).action(async(j,H)=>{let{marketplaceUpdateHandler:J}=await Promise.resolve().then(() => (Ix(),xx));await J(j,H)}),A.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(O()).action(async(j,H)=>{let{pluginInstallHandler:J}=await Promise.resolve().then(() => (Ix(),xx))
|