dal-code 1.0.60 → 1.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/bundle/chunks/account-REEBP4XX.js +1 -0
- package/dist/bundle/chunks/{anthropic-messages-XQHIW2F5.js → anthropic-messages-FFHN77YO.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-2STR7FU2.js → azure-openai-responses-XMVXFFRW.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-HZWPNFQO.js → chunk-3UVUVPDJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-O5BJV54H.js → chunk-46A3CZG4.js} +1 -1
- package/dist/bundle/chunks/{chunk-THJSXCE4.js → chunk-4PE5FX77.js} +1 -1
- package/dist/bundle/chunks/{chunk-425HIJ4E.js → chunk-5DM5CSLU.js} +1 -1
- package/dist/bundle/chunks/{chunk-EXWCUM6H.js → chunk-5VVKJ7N6.js} +1 -1
- package/dist/bundle/chunks/chunk-7FEAO2PW.js +2 -0
- package/dist/bundle/chunks/chunk-CVSK7HIR.js +1 -0
- package/dist/bundle/chunks/{chunk-4KCKRVPN.js → chunk-DM37LCOU.js} +1 -1
- package/dist/bundle/chunks/{chunk-SI4QX273.js → chunk-HDE7XZW5.js} +1 -1
- package/dist/bundle/chunks/{chunk-RRLI6IMC.js → chunk-KV7HXJIS.js} +1 -1
- package/dist/bundle/chunks/{chunk-2SQ577MS.js → chunk-LBVJMXG6.js} +1 -1
- package/dist/bundle/chunks/{chunk-P3KSBU23.js → chunk-M4QINYHM.js} +8 -8
- package/dist/bundle/chunks/{chunk-RNSD5PAD.js → chunk-MOBJIVPU.js} +1 -1
- package/dist/bundle/chunks/{chunk-2TJCPBNY.js → chunk-NBRVYUIG.js} +1 -1
- package/dist/bundle/chunks/{chunk-KMTIPRJ5.js → chunk-O4KJ5UE4.js} +1 -1
- package/dist/bundle/chunks/{chunk-X2O23QIN.js → chunk-OLTY5TDX.js} +1 -1
- package/dist/bundle/chunks/{chunk-XQ6Z77K4.js → chunk-RRAXQWE3.js} +2 -2
- package/dist/bundle/chunks/{chunk-E6RWRE6C.js → chunk-TLYT7KXA.js} +1 -1
- package/dist/bundle/chunks/{chunk-3KEFLXX2.js → chunk-XIF7O6UG.js} +1 -1
- package/dist/bundle/chunks/{chunk-CIJDL6I3.js → chunk-XKOYUKPQ.js} +1 -1
- package/dist/bundle/chunks/{chunk-4TEICWYC.js → chunk-ZLZHK7BO.js} +274 -274
- package/dist/bundle/chunks/{chunk-H3KG4L7I.js → chunk-ZVMXRMIH.js} +1 -1
- package/dist/bundle/chunks/{cli-OEEFOWRC.js → cli-4VML7NOW.js} +1 -1
- package/dist/bundle/chunks/cli-RJETLDQ5.js +30 -0
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-55VRUHTE.js → cloudflare-workers-ai-system-one-63ASD4MS.js} +1 -1
- package/dist/bundle/chunks/{execute-DAF3F222.js → execute-ZIFT667Q.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-BQMG6OLH.js → google-generative-ai-4T6TSKGZ.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-WUZF5EYV.js → google-vertex-Z2AJIOKJ.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-MADWJYHP.js → llama-cpp-classify-UD7L3OEZ.js} +1 -1
- package/dist/bundle/chunks/{mcp-GYBI424O.js → mcp-7W2PZMFF.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-GSSWAQLZ.js → mistral-conversations-W4M2WAFU.js} +1 -1
- package/dist/bundle/chunks/{office-OKOPPNJS.js → office-FIY2WQ2K.js} +1 -1
- package/dist/bundle/chunks/oidc-WQ64R7RE.js +1 -0
- package/dist/bundle/chunks/{openai-codex-responses-LJCENL64.js → openai-codex-responses-NYZACUJQ.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-MT4XYSLH.js → openai-completions-GOZT4TOU.js} +1 -1
- package/dist/bundle/chunks/{openai-decisions-Y3TPPQUQ.js → openai-decisions-ZJSAGWHI.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-5EXHN2JI.js → openai-responses-ZVECOLDP.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-4YZGO774.js → openrouter-images-BOGEFLXU.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-EGKKYUGE.js → pi-messages-XDGHAFKO.js} +1 -1
- package/dist/bundle/chunks/{review-GXC4JNBH.js → review-ESZWG3ID.js} +1 -1
- package/dist/bundle/chunks/{router-6IBMTBKX.js → router-ZQ7UPIHA.js} +1 -1
- package/dist/bundle/chunks/{runtime-MD23I2NI.js → runtime-KHMBKDP7.js} +1 -1
- package/dist/bundle/chunks/{sdk-Z2BPQBYQ.js → sdk-6F6YIKOL.js} +1 -1
- package/dist/bundle/chunks/src-TVUSERYE.js +3 -0
- package/dist/bundle/chunks/{sync-Q7ZHP4AB.js → sync-F7N6C6RF.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-ZIS4YIPV.js → typesafe-system-one-NSQNXICI.js} +1 -1
- package/dist/bundle/chunks/{usage-WQOCA772.js → usage-5VHK66HK.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-SEIIF76E.js → virtual-modules-ABFE2KKD.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/main.js +4 -4
- package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-awake/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-codeindex/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-learn/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lsp/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-mcp/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +2 -2
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-remote/package.json +3 -2
- package/dist/node_modules/@dalcode/dal-remote/src/account.js +2 -0
- package/dist/node_modules/@dalcode/dal-remote/src/cli.js +13 -13
- package/dist/node_modules/@dalcode/dal-remote/src/install.js +2 -2
- package/dist/node_modules/@dalcode/dal-remote/src/spec.js +1 -1
- package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-router/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-sync/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-schema/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/bundle/chunks/cli-H3PJUN3W.js +0 -30
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Yt=Object.defineProperty;var o=(e,t)=>Yt(e,"name",{value:t,configurable:!0});import{createRequire as Vt}from"node:module";const ks=Vt(import.meta.url);import{getProviderEnvValue as qt}from"./chunk-7DDKXS2Q.js";import{ToolCallArgumentsStream as Ht}from"./chunk-FFMDRXC4.js";import{calculateCost as Kt,createProvider as Jt}from"./chunk-
|
|
1
|
+
var Yt=Object.defineProperty;var o=(e,t)=>Yt(e,"name",{value:t,configurable:!0});import{createRequire as Vt}from"node:module";const ks=Vt(import.meta.url);import{getProviderEnvValue as qt}from"./chunk-7DDKXS2Q.js";import{ToolCallArgumentsStream as Ht}from"./chunk-FFMDRXC4.js";import{calculateCost as Kt,createProvider as Jt}from"./chunk-DM37LCOU.js";import{createAssistantMessageEventStream as be}from"./chunk-4LDEEFCY.js";import{getSystemMessageText as Xt}from"./chunk-XKOYUKPQ.js";function Zt(e,t){return{name:e,login:o(async r=>{r.signal.throwIfAborted();let n=await r.prompt({type:"secret",message:`Enter ${e}`});return r.signal.throwIfAborted(),{type:"api_key",key:n}},"login"),resolve:o(async({ctx:r,credential:n,signal:i})=>{if(i.throwIfAborted(),n?.key)return{auth:{apiKey:n.key},env:n.env,source:"stored credential"};for(let s of t){let a=await r.env(s);if(i.throwIfAborted(),a)return{auth:{apiKey:a},source:s}}},"resolve")}}o(Zt,"envApiKeyAuth");function Qt(e){let t,r=o(()=>(t??=e.load(),t),"loaded");return{name:e.name,isSubscription:e.isSubscription,loginLabel:e.loginLabel,login:o(async(n,i)=>(await r()).login(n,i),"login"),refresh:o(async(n,i)=>(await r()).refresh(n,i),"refresh"),toAuth:o(async n=>(await r()).toAuth(n),"toAuth")}}o(Qt,"lazyOAuth");var er=60*6e4,tr=30*6e4,Oe=.05,ke=.15;function rr(e){if(!(e<=1e4))return Math.max(1,Math.floor(Math.min(e*.9,e-1e4)))}o(rr,"getCacheWarmingDelayMs");function nr(e,t){let r=t?.cacheRetention??(qt("PI_CACHE_RETENTION",t?.env)==="long"?"long":"short");if(r==="none")return;let n=e.promptCache?.[r];return n===void 0?void 0:n*1e3}o(nr,"getPromptCacheTtlMs");function ir(e,t){return!t?.reasoning||e.api!=="anthropic-messages"?!0:e.compat?.forceAdaptiveThinking===!0}o(ir,"isCacheWarmingReplayable");function sr(e,t){return{...e,maxTokens:1,disableContinuation:!0,maxRetries:0,signal:t}}o(sr,"getCacheWarmingRequestOptions");function or(e,t,r){let n=ie(e,{cacheRead:t}),i=ie(e,e.cost.cacheWrite>0?{cacheWrite:t}:{input:t}),s=ie(e,{cacheRead:t,output:1}),a=Math.max(0,i-n),f=r==="idle"?ke:1,u=t>0&&(n>0||i>0),c=f*a-s;return{phase:r,warmCost:s,missCost:a,continuationProbability:f,expectedSavings:c,economicsAvailable:u,action:c>=Oe?"warm":"stop"}}o(or,"evaluateCacheWarming");function ie(e,t){let r={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},...t};return Kt(e,r).total}o(ie,"price");var Ee="faux",xe="faux",we="faux-1",ar="Faux Model",fr="http://localhost:0",ur=3,Re=5,V={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};function _e(e){return{type:"text",text:e}}o(_e,"fauxText");function cr(e){return{type:"thinking",thinking:e}}o(cr,"fauxThinking");function lr(e,t,r={}){return{type:"toolCall",id:r.id??se("tool"),name:e,arguments:t}}o(lr,"fauxToolCall");function dr(e){return typeof e=="string"?[_e(e)]:Array.isArray(e)?e:[e]}o(dr,"normalizeFauxAssistantContent");function hr(e,t={}){return{role:"assistant",content:dr(e),api:Ee,provider:xe,model:we,usage:V,stopReason:t.stopReason??"stop",...t.deferred===void 0?{}:{deferred:t.deferred},...t.errorMessage===void 0?{}:{errorMessage:t.errorMessage},...t.responseId===void 0?{}:{responseId:t.responseId},timestamp:t.timestamp??Date.now()}}o(hr,"fauxAssistantMessage");function Ne(e){return Math.ceil(e.length/4)}o(Ne,"estimateTokens");function se(e){return`${e}:${Date.now()}:${Math.random().toString(36).slice(2)}`}o(se,"randomId");function $e(e){return typeof e=="string"?e:e.map(t=>t.type==="text"?t.text:`[image:${t.mimeType}:${t.data.length}]`).join(`
|
|
2
2
|
`)}o($e,"contentToText");function Se(e){return e.map(t=>t.type==="text"?t.text:t.type==="thinking"?t.thinking:`${t.name}:${JSON.stringify(t.arguments)}`).join(`
|
|
3
3
|
`)}o(Se,"assistantContentToText");function pr(e){return[e.toolName,...e.content.map(t=>$e([t]))].join(`
|
|
4
4
|
`)}o(pr,"toolResultToText");function mr(e){return e.role==="system"?[Xt(e),...e.toolsRemoved?.map(t=>`tool-:${JSON.stringify(t)}`)??[],...e.toolsAdded?.map(t=>`tool+:${JSON.stringify(t)}`)??[]].filter(t=>t.length>0).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ha=Object.defineProperty;var p=(e,t)=>Ha(e,"name",{value:t,configurable:!0});import{createRequire as Va}from"node:module";const Fy=Va(import.meta.url);import{require_safe_buffer as Bt}from"./chunk-567OJLS7.js";import{getJsonSchemaToolParameters as $a,resolveJsonSchemaStrictSampling as tn,transformMessages as Ja}from"./chunk-HZWPNFQO.js";import{sanitizeSurrogates as St}from"./chunk-L2ZPNLYD.js";import{retryProviderRequest as Wa}from"./chunk-ML5DIOWR.js";import{clampThinkingLevel as Xa,collapseSystemMessages as Ka,withoutInitialSystemMessage as Ya}from"./chunk-4KCKRVPN.js";import{__commonJS as z,__require as te,__toESM as ze}from"./chunk-JXWJOIH4.js";var za=z({"node_modules/retry/lib/retry_operation.js"(e,t){function r(n,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}p(r,"RetryOperation"),t.exports=r,r.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},r.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},r.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var i=new Date().getTime();if(n&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var o=this._timeouts.shift();if(o===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),o=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},o),this._options.unref&&this._timer.unref(),!0},r.prototype.attempt=function(n,i){this._fn=n,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var o=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){o._operationTimeoutCb()},o._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},r.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)},r.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)},r.prototype.start=r.prototype.try,r.prototype.errors=function(){return this._errors},r.prototype.attempts=function(){return this._attempts},r.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},i=null,o=0,a=0;a<this._errors.length;a++){var c=this._errors[a],u=c.message,d=(n[u]||0)+1;n[u]=d,d>=o&&(i=c,o=d)}return i}}}),Qa=z({"node_modules/retry/lib/retry.js"(e){var t=za();e.operation=function(r){var n=e.timeouts(r);return new t(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in r)n[i]=r[i];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],a=0;a<n.retries;a++)o.push(this.createTimeout(a,n));return r&&r.forever&&!o.length&&o.push(this.createTimeout(a,n)),o.sort(function(c,u){return c-u}),o},e.createTimeout=function(r,n){var i=n.randomize?Math.random()+1:1,o=Math.round(i*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return o=Math.min(o,n.maxTimeout),o},e.wrap=function(r,n,i){if(n instanceof Array&&(i=n,n=null),!i){i=[];for(var o in r)typeof r[o]=="function"&&i.push(o)}for(var a=0;a<i.length;a++){var c=i[a],u=r[c];r[c]=function(d){var h=e.operation(n),m=Array.prototype.slice.call(arguments,1),g=m.pop();m.push(function(_){h.retry(_)||(_&&(arguments[0]=h.mainError()),g.apply(this,arguments))}),h.attempt(function(){d.apply(r,m)})}.bind(r,u),r[c].options=n}}}}),Za=z({"node_modules/retry/index.js"(e,t){t.exports=Qa()}}),ja=z({"node_modules/p-retry/index.js"(e,t){"use strict";var r=Za(),n=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],i=class extends Error{static{p(this,"AbortError")}constructor(u){super(),u instanceof Error?(this.originalError=u,{message:u}=u):(this.originalError=new Error(u),this.originalError.stack=this.stack),this.name="AbortError",this.message=u}},o=p((u,d,h)=>{let m=h.retries-(d-1);return u.attemptNumber=d,u.retriesLeft=m,u},"decorateErrorWithCounts"),a=p(u=>n.includes(u),"isNetworkError"),c=p((u,d)=>new Promise((h,m)=>{d={onFailedAttempt:p(()=>{},"onFailedAttempt"),retries:10,...d};let g=r.operation(d);g.attempt(async _=>{try{h(await u(_))}catch(f){if(!(f instanceof Error)){m(new TypeError(`Non-error was thrown: "${f}". You should only throw errors.`));return}if(f instanceof i)g.stop(),m(f.originalError);else if(f instanceof TypeError&&!a(f.message))g.stop(),m(f);else{o(f,_,d);try{await d.onFailedAttempt(f)}catch(y){m(y);return}g.retry(f)||m(g.mainError())}}})}),"pRetry2");t.exports=c,t.exports.default=c,t.exports.AbortError=i}}),rn=z({"node_modules/extend/index.js"(e,t){"use strict";var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=p(function(h){return typeof Array.isArray=="function"?Array.isArray(h):n.call(h)==="[object Array]"},"isArray"),c=p(function(h){if(!h||n.call(h)!=="[object Object]")return!1;var m=r.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&r.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!g)return!1;var _;for(_ in h);return typeof _>"u"||r.call(h,_)},"isPlainObject2"),u=p(function(h,m){i&&m.name==="__proto__"?i(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},"setProperty"),d=p(function(h,m){if(m==="__proto__")if(r.call(h,m)){if(o)return o(h,m).value}else return;return h[m]},"getProperty");t.exports=p(function h(){var m,g,_,f,y,E,C=arguments[0],S=1,A=arguments.length,v=!1;for(typeof C=="boolean"&&(v=C,C=arguments[1]||{},S=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});S<A;++S)if(m=arguments[S],m!=null)for(g in m)_=d(C,g),f=d(m,g),C!==f&&(v&&f&&(c(f)||(y=a(f)))?(y?(y=!1,E=_&&a(_)?_:[]):E=_&&c(_)?_:{},u(C,{name:g,newValue:h(v,E,f)})):typeof f<"u"&&u(C,{name:g,newValue:f}));return C},"extend")}}),el=z({"node_modules/gaxios/package.json"(e,t){t.exports={name:"gaxios",version:"7.1.4",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^22.13.1","@types/sinon":"^17.0.3","@types/tmp":"^0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.1.3",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}}}),tl=z({"node_modules/gaxios/build/cjs/src/util.cjs"(e,t){"use strict";var r=el();t.exports={pkg:r}}}),nn=z({"node_modules/gaxios/build/cjs/src/common.js"(e){"use strict";var t=e&&e.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=c;var r=t(rn()),n=t(tl()),i=n.default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${i.name}-gaxios-error`);var o=class wa extends Error{static{p(this,"_GaxiosError")}config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=i.version;static[Symbol.hasInstance](d){return d&&typeof d=="object"&&e.GAXIOS_ERROR_SYMBOL in d&&d[e.GAXIOS_ERROR_SYMBOL]===i.version?!0:Function.prototype[Symbol.hasInstance].call(wa,d)}constructor(d,h,m,g){if(super(d,{cause:g}),this.config=h,this.response=m,this.error=g instanceof Error?g:void 0,this.config=(0,r.default)(!0,{},h),this.response&&(this.response.config=(0,r.default)(!0,{},this.response.config)),this.response){try{this.response.data=a(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}g instanceof DOMException?this.code=g.name:g&&typeof g=="object"&&"code"in g&&(typeof g.code=="string"||typeof g.code=="number")&&(this.code=g.code)}static extractAPIErrorFromResponse(d,h="The request failed"){let m=h;if(typeof d.data=="string"&&(m=d.data),d.data&&typeof d.data=="object"&&"error"in d.data&&d.data.error&&!d.ok){if(typeof d.data.error=="string")return{message:d.data.error,code:d.status,status:d.statusText};if(typeof d.data.error=="object"){m="message"in d.data.error&&typeof d.data.error.message=="string"?d.data.error.message:m;let g="status"in d.data.error&&typeof d.data.error.status=="string"?d.data.error.status:d.statusText,_="code"in d.data.error&&typeof d.data.error.code=="number"?d.data.error.code:d.status;if("errors"in d.data.error&&Array.isArray(d.data.error.errors)){let f=[];for(let y of d.data.error.errors)typeof y=="object"&&"message"in y&&typeof y.message=="string"&&f.push(y.message);return Object.assign({message:f.join(`
|
|
1
|
+
var Ha=Object.defineProperty;var p=(e,t)=>Ha(e,"name",{value:t,configurable:!0});import{createRequire as Va}from"node:module";const Fy=Va(import.meta.url);import{require_safe_buffer as Bt}from"./chunk-567OJLS7.js";import{getJsonSchemaToolParameters as $a,resolveJsonSchemaStrictSampling as tn,transformMessages as Ja}from"./chunk-3UVUVPDJ.js";import{sanitizeSurrogates as St}from"./chunk-L2ZPNLYD.js";import{retryProviderRequest as Wa}from"./chunk-ML5DIOWR.js";import{clampThinkingLevel as Xa,collapseSystemMessages as Ka,withoutInitialSystemMessage as Ya}from"./chunk-DM37LCOU.js";import{__commonJS as z,__require as te,__toESM as ze}from"./chunk-JXWJOIH4.js";var za=z({"node_modules/retry/lib/retry_operation.js"(e,t){function r(n,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}p(r,"RetryOperation"),t.exports=r,r.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},r.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},r.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var i=new Date().getTime();if(n&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var o=this._timeouts.shift();if(o===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),o=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},o),this._options.unref&&this._timer.unref(),!0},r.prototype.attempt=function(n,i){this._fn=n,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var o=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){o._operationTimeoutCb()},o._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},r.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)},r.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)},r.prototype.start=r.prototype.try,r.prototype.errors=function(){return this._errors},r.prototype.attempts=function(){return this._attempts},r.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},i=null,o=0,a=0;a<this._errors.length;a++){var c=this._errors[a],u=c.message,d=(n[u]||0)+1;n[u]=d,d>=o&&(i=c,o=d)}return i}}}),Qa=z({"node_modules/retry/lib/retry.js"(e){var t=za();e.operation=function(r){var n=e.timeouts(r);return new t(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in r)n[i]=r[i];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],a=0;a<n.retries;a++)o.push(this.createTimeout(a,n));return r&&r.forever&&!o.length&&o.push(this.createTimeout(a,n)),o.sort(function(c,u){return c-u}),o},e.createTimeout=function(r,n){var i=n.randomize?Math.random()+1:1,o=Math.round(i*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return o=Math.min(o,n.maxTimeout),o},e.wrap=function(r,n,i){if(n instanceof Array&&(i=n,n=null),!i){i=[];for(var o in r)typeof r[o]=="function"&&i.push(o)}for(var a=0;a<i.length;a++){var c=i[a],u=r[c];r[c]=function(d){var h=e.operation(n),m=Array.prototype.slice.call(arguments,1),g=m.pop();m.push(function(_){h.retry(_)||(_&&(arguments[0]=h.mainError()),g.apply(this,arguments))}),h.attempt(function(){d.apply(r,m)})}.bind(r,u),r[c].options=n}}}}),Za=z({"node_modules/retry/index.js"(e,t){t.exports=Qa()}}),ja=z({"node_modules/p-retry/index.js"(e,t){"use strict";var r=Za(),n=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],i=class extends Error{static{p(this,"AbortError")}constructor(u){super(),u instanceof Error?(this.originalError=u,{message:u}=u):(this.originalError=new Error(u),this.originalError.stack=this.stack),this.name="AbortError",this.message=u}},o=p((u,d,h)=>{let m=h.retries-(d-1);return u.attemptNumber=d,u.retriesLeft=m,u},"decorateErrorWithCounts"),a=p(u=>n.includes(u),"isNetworkError"),c=p((u,d)=>new Promise((h,m)=>{d={onFailedAttempt:p(()=>{},"onFailedAttempt"),retries:10,...d};let g=r.operation(d);g.attempt(async _=>{try{h(await u(_))}catch(f){if(!(f instanceof Error)){m(new TypeError(`Non-error was thrown: "${f}". You should only throw errors.`));return}if(f instanceof i)g.stop(),m(f.originalError);else if(f instanceof TypeError&&!a(f.message))g.stop(),m(f);else{o(f,_,d);try{await d.onFailedAttempt(f)}catch(y){m(y);return}g.retry(f)||m(g.mainError())}}})}),"pRetry2");t.exports=c,t.exports.default=c,t.exports.AbortError=i}}),rn=z({"node_modules/extend/index.js"(e,t){"use strict";var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=p(function(h){return typeof Array.isArray=="function"?Array.isArray(h):n.call(h)==="[object Array]"},"isArray"),c=p(function(h){if(!h||n.call(h)!=="[object Object]")return!1;var m=r.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&r.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!g)return!1;var _;for(_ in h);return typeof _>"u"||r.call(h,_)},"isPlainObject2"),u=p(function(h,m){i&&m.name==="__proto__"?i(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},"setProperty"),d=p(function(h,m){if(m==="__proto__")if(r.call(h,m)){if(o)return o(h,m).value}else return;return h[m]},"getProperty");t.exports=p(function h(){var m,g,_,f,y,E,C=arguments[0],S=1,A=arguments.length,v=!1;for(typeof C=="boolean"&&(v=C,C=arguments[1]||{},S=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});S<A;++S)if(m=arguments[S],m!=null)for(g in m)_=d(C,g),f=d(m,g),C!==f&&(v&&f&&(c(f)||(y=a(f)))?(y?(y=!1,E=_&&a(_)?_:[]):E=_&&c(_)?_:{},u(C,{name:g,newValue:h(v,E,f)})):typeof f<"u"&&u(C,{name:g,newValue:f}));return C},"extend")}}),el=z({"node_modules/gaxios/package.json"(e,t){t.exports={name:"gaxios",version:"7.1.4",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/node":"^22.13.1","@types/sinon":"^17.0.3","@types/tmp":"^0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.1.3",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.2","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}}}),tl=z({"node_modules/gaxios/build/cjs/src/util.cjs"(e,t){"use strict";var r=el();t.exports={pkg:r}}}),nn=z({"node_modules/gaxios/build/cjs/src/common.js"(e){"use strict";var t=e&&e.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=c;var r=t(rn()),n=t(tl()),i=n.default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${i.name}-gaxios-error`);var o=class wa extends Error{static{p(this,"_GaxiosError")}config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=i.version;static[Symbol.hasInstance](d){return d&&typeof d=="object"&&e.GAXIOS_ERROR_SYMBOL in d&&d[e.GAXIOS_ERROR_SYMBOL]===i.version?!0:Function.prototype[Symbol.hasInstance].call(wa,d)}constructor(d,h,m,g){if(super(d,{cause:g}),this.config=h,this.response=m,this.error=g instanceof Error?g:void 0,this.config=(0,r.default)(!0,{},h),this.response&&(this.response.config=(0,r.default)(!0,{},this.response.config)),this.response){try{this.response.data=a(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}g instanceof DOMException?this.code=g.name:g&&typeof g=="object"&&"code"in g&&(typeof g.code=="string"||typeof g.code=="number")&&(this.code=g.code)}static extractAPIErrorFromResponse(d,h="The request failed"){let m=h;if(typeof d.data=="string"&&(m=d.data),d.data&&typeof d.data=="object"&&"error"in d.data&&d.data.error&&!d.ok){if(typeof d.data.error=="string")return{message:d.data.error,code:d.status,status:d.statusText};if(typeof d.data.error=="object"){m="message"in d.data.error&&typeof d.data.error.message=="string"?d.data.error.message:m;let g="status"in d.data.error&&typeof d.data.error.status=="string"?d.data.error.status:d.statusText,_="code"in d.data.error&&typeof d.data.error.code=="number"?d.data.error.code:d.status;if("errors"in d.data.error&&Array.isArray(d.data.error.errors)){let f=[];for(let y of d.data.error.errors)typeof y=="object"&&"message"in y&&typeof y.message=="string"&&f.push(y.message);return Object.assign({message:f.join(`
|
|
2
2
|
`)||m,code:_,status:g},d.data.error)}return Object.assign({message:m,code:_,status:g},d.data.error)}}return{message:m,code:d.status,status:d.statusText}}};e.GaxiosError=o;function a(u,d){switch(u){case"stream":return d;case"json":return JSON.parse(JSON.stringify(d));case"arraybuffer":return JSON.parse(Buffer.from(d).toString("utf8"));case"blob":return JSON.parse(d.text());default:return d}}p(a,"translateData");function c(u){let d="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function h(_){_&&_.forEach((f,y)=>{(/^authentication$/i.test(y)||/^authorization$/i.test(y)||/secret/i.test(y))&&_.set(y,d)})}p(h,"redactHeaders");function m(_,f){if(typeof _=="object"&&_!==null&&typeof _[f]=="string"){let y=_[f];(/grant_type=/i.test(y)||/assertion=/i.test(y)||/secret/i.test(y))&&(_[f]=d)}}p(m,"redactString");function g(_){!_||typeof _!="object"||(_ instanceof FormData||_ instanceof URLSearchParams||"forEach"in _&&"set"in _?_.forEach((f,y)=>{(["grant_type","assertion"].includes(y)||/secret/.test(y))&&_.set(y,d)}):("grant_type"in _&&(_.grant_type=d),"assertion"in _&&(_.assertion=d),"client_secret"in _&&(_.client_secret=d)))}return p(g,"redactObject"),u.config&&(h(u.config.headers),m(u.config,"data"),g(u.config.data),m(u.config,"body"),g(u.config.body),u.config.url.searchParams.has("token")&&u.config.url.searchParams.set("token",d),u.config.url.searchParams.has("client_secret")&&u.config.url.searchParams.set("client_secret",d)),u.response&&(c({config:u.response.config}),h(u.response.headers),u.response.bodyUsed&&(m(u.response,"data"),g(u.response.data))),u}p(c,"defaultErrorRedactor")}}),rl=z({"node_modules/gaxios/build/cjs/src/retry.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRetryConfig=t;async function t(o){let a=n(o);if(!o||!o.config||!a&&!o.config.retry)return{shouldRetry:!1};a=a||{},a.currentRetryAttempt=a.currentRetryAttempt||0,a.retry=a.retry===void 0||a.retry===null?3:a.retry,a.httpMethodsToRetry=a.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],a.noResponseRetries=a.noResponseRetries===void 0||a.noResponseRetries===null?2:a.noResponseRetries,a.retryDelayMultiplier=a.retryDelayMultiplier?a.retryDelayMultiplier:2,a.timeOfFirstRequest=a.timeOfFirstRequest?a.timeOfFirstRequest:Date.now(),a.totalTimeout=a.totalTimeout?a.totalTimeout:Number.MAX_SAFE_INTEGER,a.maxRetryDelay=a.maxRetryDelay?a.maxRetryDelay:Number.MAX_SAFE_INTEGER;let c=[[100,199],[408,408],[429,429],[500,599]];if(a.statusCodesToRetry=a.statusCodesToRetry||c,o.config.retryConfig=a,!await(a.shouldRetry||r)(o))return{shouldRetry:!1,config:o.config};let u=i(a);o.config.retryConfig.currentRetryAttempt+=1;let d=a.retryBackoff?a.retryBackoff(o,u):new Promise(h=>{setTimeout(h,u)});return a.onRetryAttempt&&await a.onRetryAttempt(o),await d,{shouldRetry:!0,config:o.config}}p(t,"getRetryConfig");function r(o){let a=n(o);if(o.config.signal?.aborted&&o.code!=="TimeoutError"||o.code==="AbortError"||!a||a.retry===0||!o.response&&(a.currentRetryAttempt||0)>=a.noResponseRetries||!a.httpMethodsToRetry||!a.httpMethodsToRetry.includes(o.config.method?.toUpperCase()||"GET"))return!1;if(o.response&&o.response.status){let c=!1;for(let[u,d]of a.statusCodesToRetry){let h=o.response.status;if(h>=u&&h<=d){c=!0;break}}if(!c)return!1}return a.currentRetryAttempt=a.currentRetryAttempt||0,!(a.currentRetryAttempt>=a.retry)}p(r,"shouldRetryRequest");function n(o){if(o&&o.config&&o.config.retryConfig)return o.config.retryConfig}p(n,"getConfig");function i(o){let a=(o.currentRetryAttempt?0:o.retryDelay??100)+(Math.pow(o.retryDelayMultiplier,o.currentRetryAttempt)-1)/2*1e3,c=o.totalTimeout-(Date.now()-o.timeOfFirstRequest);return Math.min(a,c,o.maxRetryDelay)}p(i,"getNextRetryDelay")}}),on=z({"node_modules/gaxios/build/cjs/src/interceptor.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosInterceptorManager=void 0;var t=class extends Set{static{p(this,"GaxiosInterceptorManager")}};e.GaxiosInterceptorManager=t}}),nl=z({"node_modules/gaxios/build/cjs/src/gaxios.js"(e){"use strict";var t=e&&e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}},r;Object.defineProperty(e,"__esModule",{value:!0}),e.Gaxios=void 0;var n=t(rn()),i=te("https"),o=nn(),a=rl(),c=te("stream"),u=on(),d=p(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),h=204,m=class{static{p(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(g){this.defaults=g||{},this.interceptors={request:new u.GaxiosInterceptorManager,response:new u.GaxiosInterceptorManager}}fetch(...g){let _=g[0],f=g[1],y,E=new Headers;return typeof _=="string"?y=new URL(_):_ instanceof URL?y=_:_&&_.url&&(y=new URL(_.url)),_&&typeof _=="object"&&"headers"in _&&r.mergeHeaders(E,_.headers),f&&r.mergeHeaders(E,new Headers(f.headers)),typeof _=="object"&&!(_ instanceof URL)?this.request({...f,..._,headers:E,url:y}):this.request({...f,headers:E,url:y})}async request(g={}){let _=await this.#n(g);return _=await this.#t(_),this.#r(this._request(_))}async _defaultAdapter(g){let _=g.fetchImplementation||this.defaults.fetchImplementation||await r.#l(),f={...g};delete f.data;let y=await _(g.url,f),E=await this.getResponseData(g,y);return Object.getOwnPropertyDescriptor(y,"data")?.configurable||Object.defineProperties(y,{data:{configurable:!0,writable:!0,enumerable:!0,value:E}}),Object.assign(y,{config:g,data:E})}async _request(g){try{let _;if(g.adapter?_=await g.adapter(g,this._defaultAdapter.bind(this)):_=await this._defaultAdapter(g),!g.validateStatus(_.status)){if(g.responseType==="stream"){let y=[];for await(let E of _.data)y.push(E);_.data=y.toString()}let f=o.GaxiosError.extractAPIErrorFromResponse(_,`Request failed with status code ${_.status}`);throw new o.GaxiosError(f?.message,g,_,f)}return _}catch(_){let f;_ instanceof o.GaxiosError?f=_:_ instanceof Error?f=new o.GaxiosError(_.message,g,void 0,_):f=new o.GaxiosError("Unexpected Gaxios Error",g,void 0,_);let{shouldRetry:y,config:E}=await(0,a.getRetryConfig)(f);if(y&&E)return f.config.retryConfig.currentRetryAttempt=E.retryConfig.currentRetryAttempt,g.retryConfig=f.config?.retryConfig,this.#i(g),this._request(g);throw g.errorRedactor&&g.errorRedactor(f),f}}async getResponseData(g,_){if(_.status===h)return"";if(g.maxContentLength&&_.headers.has("content-length")&&g.maxContentLength<Number.parseInt(_.headers?.get("content-length")||""))throw new o.GaxiosError("Response's `Content-Length` is over the limit.",g,Object.assign(_,{config:g}));switch(g.responseType){case"stream":return _.body;case"json":{let f=await _.text();try{return JSON.parse(f)}catch{return f}}case"arraybuffer":return _.arrayBuffer();case"blob":return _.blob();case"text":return _.text();default:return this.getResponseDataFromContentType(_)}}#e(g,_=[]){let f=new URL(g),y=[..._],E=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let C of E)y.push(C.trim());for(let C of y)if(C instanceof RegExp){if(C.test(f.toString()))return!1}else if(C instanceof URL){if(C.origin===f.origin)return!1}else if(C.startsWith("*.")||C.startsWith(".")){let S=C.replace(/^\*\./,".");if(f.hostname.endsWith(S))return!1}else if(C===f.origin||C===f.hostname||C===f.href)return!1;return!0}async#t(g){let _=Promise.resolve(g);for(let f of this.interceptors.request.values())f&&(_=_.then(f.resolved,f.rejected));return _}async#r(g){let _=Promise.resolve(g);for(let f of this.interceptors.response.values())f&&(_=_.then(f.resolved,f.rejected));return _}async#n(g){let _=new Headers(this.defaults.headers);r.mergeHeaders(_,g.headers);let f=(0,n.default)(!0,{},this.defaults,g);if(!f.url)throw new Error("URL is required.");if(f.baseURL&&(f.url=new URL(f.url,f.baseURL)),f.url=new URL(f.url),f.params)if(f.paramsSerializer){let C=f.paramsSerializer(f.params);C.startsWith("?")&&(C=C.slice(1));let S=f.url.toString().includes("?")?"&":"?";f.url=f.url+S+C}else{let C=f.url instanceof URL?f.url:new URL(f.url);for(let[S,A]of new URLSearchParams(f.params))C.searchParams.append(S,A);f.url=C}typeof g.maxContentLength=="number"&&(f.size=g.maxContentLength),typeof g.maxRedirects=="number"&&(f.follow=g.maxRedirects);let y=typeof f.data=="string"||f.data instanceof ArrayBuffer||f.data instanceof Blob||globalThis.File&&f.data instanceof File||f.data instanceof FormData||f.data instanceof c.Readable||f.data instanceof ReadableStream||f.data instanceof String||f.data instanceof URLSearchParams||ArrayBuffer.isView(f.data)||["Blob","File","FormData"].includes(f.data?.constructor?.name||"");if(f.multipart?.length){let C=await d();_.set("content-type",`multipart/related; boundary=${C}`),f.body=c.Readable.from(this.getMultipartRequest(f.multipart,C))}else y?f.body=f.data:typeof f.data=="object"?_.get("Content-Type")==="application/x-www-form-urlencoded"?f.body=f.paramsSerializer?f.paramsSerializer(f.data):new URLSearchParams(f.data):(_.has("content-type")||_.set("content-type","application/json"),f.body=JSON.stringify(f.data)):f.data&&(f.body=f.data);f.validateStatus=f.validateStatus||this.validateStatus,f.responseType=f.responseType||"unknown",!_.has("accept")&&f.responseType==="json"&&_.set("accept","application/json");let E=f.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!f.agent)if(E&&this.#e(f.url,f.noProxy)){let C=await r.#a();this.agentCache.has(E)?f.agent=this.agentCache.get(E):(f.agent=new C(E,{cert:f.cert,key:f.key}),this.agentCache.set(E,f.agent))}else f.cert&&f.key&&(this.agentCache.has(f.key)?f.agent=this.agentCache.get(f.key):(f.agent=new i.Agent({cert:f.cert,key:f.key}),this.agentCache.set(f.key,f.agent)));return typeof f.errorRedactor!="function"&&f.errorRedactor!==!1&&(f.errorRedactor=o.defaultErrorRedactor),f.body&&!("duplex"in f)&&(f.duplex="half"),this.#i(f),Object.assign(f,{headers:_,url:f.url instanceof URL?f.url:new URL(f.url)})}#i(g){if(g.timeout){let _=AbortSignal.timeout(g.timeout);g.signal&&!g.signal.aborted?g.signal=AbortSignal.any([g.signal,_]):g.signal=_}}validateStatus(g){return g>=200&&g<300}async getResponseDataFromContentType(g){let _=g.headers.get("Content-Type");if(_===null)return g.text();if(_=_.toLowerCase(),_.includes("application/json")){let f=await g.text();try{f=JSON.parse(f)}catch{}return f}else return _.match(/^text\//)?g.text():g.blob()}async*getMultipartRequest(g,_){let f=`--${_}--`;for(let y of g){let E=y.headers.get("Content-Type")||"application/octet-stream";yield`--${_}\r
|
|
3
3
|
Content-Type: ${E}\r
|
|
4
4
|
\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var L=Object.defineProperty;var c=(a,n)=>L(a,"name",{value:n,configurable:!0});import{createRequire as F}from"node:module";const _e=F(import.meta.url);import{shortHash as N}from"./chunk-PJACZCIR.js";import{appendGrammarToolInputJsonDelta as D,closeGrammarToolInputJson as H,getGrammarToolInput as V,getJsonSchemaToolParameters as Z,resolveGrammarConstrainedSampling as K,resolveJsonSchemaStrictSampling as Q,transformMessages as X}from"./chunk-
|
|
1
|
+
var L=Object.defineProperty;var c=(a,n)=>L(a,"name",{value:n,configurable:!0});import{createRequire as F}from"node:module";const _e=F(import.meta.url);import{shortHash as N}from"./chunk-PJACZCIR.js";import{appendGrammarToolInputJsonDelta as D,closeGrammarToolInputJson as H,getGrammarToolInput as V,getJsonSchemaToolParameters as Z,resolveGrammarConstrainedSampling as K,resolveJsonSchemaStrictSampling as Q,transformMessages as X}from"./chunk-3UVUVPDJ.js";import{sanitizeSurrogates as w}from"./chunk-L2ZPNLYD.js";import{ToolCallArgumentsStream as Y}from"./chunk-FFMDRXC4.js";import{calculateCost as ee,resolveTranscript as te,resolveTranscriptTools as ne}from"./chunk-DM37LCOU.js";import{getSystemMessageText as oe,renderSystemMessageUpdate as ae}from"./chunk-XKOYUKPQ.js";function se(a,n){let s={v:1,id:a};return n&&(s.phase=n),JSON.stringify(s)}c(se,"encodeTextSignatureV1");function le(a){if(a){if(a.startsWith("{"))try{let n=JSON.parse(a);if(n.v===1&&typeof n.id=="string")return n.phase==="commentary"||n.phase==="final_answer"?{id:n.id,phase:n.phase}:{id:n.id}}catch{}return{id:a}}}c(le,"parseTextSignature");function ie(a,n){let s=n.filter(p=>p.type==="text").map(p=>p.text).join(`
|
|
2
2
|
`),u=n.filter(p=>p.type==="image"),f=s.trim().length>0;if(u.length===0||!a.input.includes("image"))return w(f?s:u.length>0?"(see attached image)":"(no tool output)");let r=[];f&&r.push({type:"input_text",text:w(s)});for(let p of u)r.push({type:"input_image",detail:"auto",image_url:`data:${p.mimeType};base64,${p.data}`});return r}c(ie,"convertToolResultOutput");function G(a){return a.supportsMidConvoSystemMessages&&a.supportsAdditionalTools?"changes":a.supportsToolSearch?"additions":"none"}c(G,"getResponsesToolSupport");function re(a){let n="This is an incremental tools update. Previously declared tools remain available unless explicitly marked unavailable. A tool declared again here is available again, and its latest definition replaces the earlier one.";return a.size>0?`${n}
|
|
3
3
|
Still unavailable: ${[...a].join(", ")}.`:n}c(re,"renderIncrementalToolsNotice");function pe(a){return`The following tools are no longer available. Do not call them:
|
|
4
4
|
${a.map(n=>`- ${n}`).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var R=Object.defineProperty;var o=(e,r)=>R(e,"name",{value:r,configurable:!0});import{createRequire as b}from"node:module";const S=b(import.meta.url);import{retryProviderRequest as w}from"./chunk-ML5DIOWR.js";import{headersToRecord as q,providerHeadersToRecord as k}from"./chunk-UTB4DTYQ.js";import{calculateCost as x}from"./chunk-
|
|
1
|
+
var R=Object.defineProperty;var o=(e,r)=>R(e,"name",{value:r,configurable:!0});import{createRequire as b}from"node:module";const S=b(import.meta.url);import{retryProviderRequest as w}from"./chunk-ML5DIOWR.js";import{headersToRecord as q,providerHeadersToRecord as k}from"./chunk-UTB4DTYQ.js";import{calculateCost as x}from"./chunk-DM37LCOU.js";import{getIdentityHeaders as E}from"./chunk-XKOYUKPQ.js";function $(e,r,a){let i=new Error(`${e} returned ${r.status}`);return i.status=r.status,i.headers=r.headers,i.body=a,i}o($,"httpError");function T(e){let r=new Error(`Request timed out after ${e}ms`);return r.name="TimeoutError",r.status=void 0,r.headers=void 0,r.body="",r}o(T,"timeoutError");function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(m,"isRecord");function _(e,r,a){if(typeof r!="number"||!Number.isFinite(r))throw new Error(`${e} returned an invalid ${a}`);return r}o(_,"requiredNumber");function j(e,r,a,i){return k(E(e,i),{authorization:`Bearer ${r}`,"content-type":"application/json"},e.headers,a)??{}}o(j,"requestHeaders");async function A(e,r,a,i,t,y){if(!t?.apiKey)throw new Error(`No API key for provider: ${a.provider}`);let h=t.apiKey,u=i,d=await t.onPayload?.(u,a);d!==void 0&&(u=d);let l=t.fetch??globalThis.fetch,{response:c,json:p}=await w(async()=>{let s=t.timeoutMs!==void 0?AbortSignal.timeout(t.timeoutMs):void 0,g=t.signal&&s?AbortSignal.any([t.signal,s]):t.signal??s;try{let n=await l(r,{method:"POST",headers:j(a,h,t.headers,t.identity),body:JSON.stringify(u),signal:g});if(!n.ok)throw $(e,n,await n.text());return{response:n,json:await n.json()}}catch(n){throw s?.aborted&&!t.signal?.aborted?T(t.timeoutMs):n}},{maxRetries:t.maxRetries??2,maxRetryDelayMs:t.maxRetryDelayMs,signal:t.signal,noRetryStatuses:y});return await t.onResponse?.({status:c.status,headers:q(c.headers)},a),p}o(A,"postClassifierRequest");function f(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:0}o(f,"tokenCount");function C(e,r){if(!m(e)||e.input_tokens===void 0&&e.output_tokens===void 0)return;let a=f(e.input_tokens),i=f(e.output_tokens),t={input:a,output:i,cacheRead:0,cacheWrite:0,totalTokens:a+i,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};return x(r,t),t}o(C,"parseClassifierUsage");export{m as isRecord,C as parseClassifierUsage,A as postClassifierRequest,_ as requiredNumber};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Le=Object.defineProperty;var a=(e,t)=>Le(e,"name",{value:t,configurable:!0});import{createRequire as Ie}from"node:module";const Dr=Ie(import.meta.url);import{typebox_exports as T}from"./chunk-JUUJCOIR.js";import{DEFAULT_MAX_AGENT_RETRY_DELAY_MS as De}from"./chunk-NJDCSLWK.js";import{sanitizeBinaryOutput as Pe}from"./chunk-B66W54NL.js";import{fill as E}from"./chunk-G5AMLGXC.js";import{CodeHighlighter as Fe,Container as V,Spacer as I,Text as $,getCapabilities as Y,getImageDimensions as je,hyperlink as We,imageFallback as Be,keyHint as K,truncateToWidth as Ue}from"./chunk-NRQYSXAU.js";import{getDocsPath as He,resolvePath as Ge,shortenHomePath as Je}from"./chunk-QM5JU2GS.js";import{t as g}from"./chunk-
|
|
1
|
+
var Le=Object.defineProperty;var a=(e,t)=>Le(e,"name",{value:t,configurable:!0});import{createRequire as Ie}from"node:module";const Dr=Ie(import.meta.url);import{typebox_exports as T}from"./chunk-JUUJCOIR.js";import{DEFAULT_MAX_AGENT_RETRY_DELAY_MS as De}from"./chunk-NJDCSLWK.js";import{sanitizeBinaryOutput as Pe}from"./chunk-B66W54NL.js";import{fill as E}from"./chunk-G5AMLGXC.js";import{CodeHighlighter as Fe,Container as V,Spacer as I,Text as $,getCapabilities as Y,getImageDimensions as je,hyperlink as We,imageFallback as Be,keyHint as K,truncateToWidth as Ue}from"./chunk-NRQYSXAU.js";import{getDocsPath as He,resolvePath as Ge,shortenHomePath as Je}from"./chunk-QM5JU2GS.js";import{t as g}from"./chunk-XIF7O6UG.js";import{createWriteStream as ze}from"node:fs";import{writeFile as qe}from"node:fs/promises";import{randomBytes as Xe}from"node:crypto";import{lstatSync as Ze,mkdtempSync as Ve,readdirSync as Ye,rmSync as Q}from"node:fs";import{tmpdir as D}from"node:os";import{join as P}from"node:path";var Ke=1440*60*1e3,Qe=10080*60*1e3,et=/^(?:dal-(?:sandbox|bg|bash|powershell|output|mxc)|pi-codemode|pi-mcp)-(\d+)-/,tt=/^(?:dal-(?:sandbox|mxc)-[A-Za-z0-9]{6}|(?:dal-(?:bash|powershell|output)|pi-codemode|pi-mcp)-[0-9a-f]{16}(?:\.[A-Za-z0-9]+)?)$/,O=new Set,ee=!1;function te(e){try{Q(e,{recursive:!0,force:!0})}catch{}}a(te,"removePath");function rt(){for(let e of O)te(e);O.clear()}a(rt,"cleanupOwnedTempFiles");function nt(){ee||(ee=!0,process.on("exit",rt))}a(nt,"installExitHook");function F(e){nt(),O.add(e)}a(F,"registerTempPath");function it(e){O.delete(e),te(e)}a(it,"removeTempPath");function ot(e){let t=Ve(P(D(),`dal-${e}-${process.pid}-`));return F(t),t}a(ot,"createTempDir");function at(e,t,r=D()){return P(r,`${e}-${process.pid}-${Xe(8).toString("hex")}${t}`)}a(at,"tempFilePath");function st(e){if(e===process.pid)return!0;try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}a(st,"processExists");function lt(e={}){let t=e.dir??D(),r=e.now??Date.now(),n=e.maxAgeMs??Ke,i=e.legacyMaxAgeMs??Qe,o=e.exists??st,s=process.getuid?.(),c={removed:[],kept:0},l;try{l=Ye(t)}catch{return c}for(let p of l){let d=et.exec(p),u=!d&&tt.test(p);if(!d&&!u)continue;let m=P(t,p);try{let f=Ze(m);if(s!==void 0&&f.uid!==s)continue;if(!(r-f.mtimeMs>=(d?n:i))||d&&o(Number(d[1]))){c.kept++;continue}Q(m,{recursive:!0,force:!0}),c.removed.push(m)}catch{}}return c}a(lt,"sweepStaleTempFiles");var re=384,C;function ut(e){return C=e,()=>{C===e&&(C=void 0)}}a(ut,"setOutputFileDirectory");function ne(e,t){let r=C?.(),n=at(e,t,r);return r||F(n),n}a(ne,"createOutputFilePath");async function ct(e,t,r){let n=ne(e,t);return await qe(n,r,{mode:re,flag:"wx"}),n}a(ct,"writeOutputFile");function dt(e,t){let r=ne(e,t);return{path:r,stream:ze(r,{mode:re,flags:"wx"})}}a(dt,"createOutputFileStream");function ie(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cost:0}}a(ie,"createUsageTotals");function oe(e,t){e.input+=t.input,e.output+=t.output,e.cacheRead+=t.cacheRead,e.cacheWrite+=t.cacheWrite,e.cost+=t.cost.total}a(oe,"addUsageToTotals");function pt(e,t){return{input:e.input+t.input,output:e.output+t.output,cacheRead:e.cacheRead+t.cacheRead,cacheWrite:e.cacheWrite+t.cacheWrite,...e.cacheWrite1h!==void 0||t.cacheWrite1h!==void 0?{cacheWrite1h:(e.cacheWrite1h??0)+(t.cacheWrite1h??0)}:{},...e.reasoning!==void 0||t.reasoning!==void 0?{reasoning:(e.reasoning??0)+(t.reasoning??0)}:{},totalTokens:e.totalTokens+t.totalTokens,cost:{input:e.cost.input+t.cost.input,output:e.cost.output+t.cost.output,cacheRead:e.cost.cacheRead+t.cost.cacheRead,cacheWrite:e.cost.cacheWrite+t.cost.cacheWrite,total:e.cost.total+t.cost.total,totalFromProvider:e.cost.totalFromProvider===!0&&t.cost.totalFromProvider===!0}}}a(pt,"combineUsage");function mt(e){let t=new Map;for(let r of e){let n,i;if(r.type==="message"&&r.message.role==="assistant"?(n=`${r.message.provider}/${r.message.responseModel??r.message.model}`,i=r.message.usage):r.type==="usage"?(n=`${r.provider}/${r.model}`,i=r.usage):r.type==="message"&&r.message.role==="toolResult"&&r.message.usage?(n="Tools/summaries",i=r.message.usage):(r.type==="branch_summary"||r.type==="compaction")&&r.usage&&(n="Tools/summaries",i=r.usage),!n||!i)continue;let o=t.get(n);o||(o=ie(),t.set(n,o)),oe(o,i)}return Array.from(t,([r,n])=>({key:r,cost:n.cost,tokens:n.input+n.output+n.cacheRead+n.cacheWrite})).filter(r=>r.cost>0||r.tokens>0).sort((r,n)=>n.cost-r.cost)}a(mt,"getUsageCostBreakdown");function ae(e,t,r,n=0,i="end"){if(!e)return{visualLines:[],skippedCount:0};let o=new $(e,n,0).render(r);if(o.length<=t)return{visualLines:o,skippedCount:0};let s=i==="start"?o.slice(0,t):o.slice(-t),c=o.length-t;return{visualLines:s,skippedCount:c}}a(ae,"truncateToVisualLines");var j=class{static{a(this,"VisualLinePreview")}options;cachedWidth;cachedLines;constructor(e){this.options=e}render(e){if(this.cachedLines===void 0||this.cachedWidth!==e){let{text:t,maxVisualLines:r,keep:n,formatHint:i}=this.options,o=ae(t,r,e,0,n),s=o.visualLines;if(o.skippedCount>0){let c=Ue(i(o.skippedCount),e,"...");this.cachedLines=n==="start"?[...s,c]:[c,...s]}else this.cachedLines=s;this.cachedWidth=e}return this.cachedLines}invalidate(){this.cachedWidth=void 0,this.cachedLines=void 0}};import{pathToFileURL as ft}from"node:url";var gt="(?:\\u0007|\\u001B\\u005C|\\u009C)",se="\\u001B\\]",le="(?:(?:\\u001B\\[|\\u009B)[<=>]|[\\u001B\\u009B][[\\]()#;?]*)(?:\\d{1,4}(?:[;:]\\d{0,4})*)?",ht="[\\dA-PR-TZcf-nq-uy=><~]",yt=new RegExp(`(?:${se}[\\s\\S]*?${gt})|${le}${ht}`,"g"),St=new RegExp(`(?:${se}(?:[^\\u0007\\u009C\\u001B]|\\u001B(?!\\\\))*|${le})$`),At=256;function $t(e){if(!e.includes("\x1B")&&!e.includes("\x9B"))return{complete:e,pending:""};let t=Math.max(0,e.length-At),r=St.exec(e.slice(t));if(!r)return{complete:e,pending:""};let n=t+r.index;return{complete:e.slice(0,n),pending:e.slice(n)}}a($t,"splitIncompleteAnsiSuffix");function ue(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(yt,"")}a(ue,"stripAnsi");function ce(e){return typeof e!="string"?"":Je(e)}a(ce,"shortenPath");function Tt(e,t,r){if(!Y().hyperlinks)return e;let n=Ge(t,r);return We(e,ft(n).href)}a(Tt,"linkPath");function de(e){return typeof e=="string"?e:e==null?"":null}a(de,"str");function pe(e){return typeof e=="string"&&e.trim()!==""&&(e=Number(e)),typeof e=="number"&&Number.isFinite(e)?e:void 0}a(pe,"parseLineNumber");function wt(e,t){if(e==null&&t==null)return"";let r=e==null?1:pe(e);if(r===void 0)return"";if(t==null)return`:${r}`;let n=pe(t);if(n===void 0)return"";let i=r+n-1;return`:${r}${i?`-${i}`:""}`}a(wt,"formatReadLineRange");function k(e){return e.replace(/\t/g," ")}a(k,"replaceTabs");function vt(e){return e.replace(/\r/g,"")}a(vt,"normalizeDisplayText");function me(e,t){if(!e)return"";let r=e.content.filter(s=>s.type==="text"),n=e.content.filter(s=>s.type==="image"),i=r.map(s=>Pe(ue(s.text||"")).replace(/\r/g,"")).join(`
|
|
2
2
|
`),o=Y();if(n.length>0&&(!o.images||!t)){let s=n.map(c=>{let l=c.mimeType??"image/unknown",p=c.data&&c.mimeType?je(c.data,c.mimeType)??void 0:void 0;return Be(l,p)}).join(`
|
|
3
3
|
`);i=i?`${i}
|
|
4
4
|
${s}`:s}return i}a(me,"getTextOutput");var fe=100;function _t(e,t,r,n){let i=r.fg("toolTitle",r.bold(e));if(t==null)return i;let o=typeof t=="object"&&!Array.isArray(t)?Object.entries(t):[["args",t]];if(o.length===0)return i;if(n){let l=o.map(([p,d])=>{let u=typeof d=="string"?d:JSON.stringify(d,null,2)??String(d);return` ${p}: ${k(u).replace(/\r/g,"").split(`
|
|
@@ -31,7 +31,7 @@ Searches over deferred tool metadata with BM25 and exposes matching tools for th
|
|
|
31
31
|
|
|
32
32
|
Some of the tools, such as tools of MCP servers, may not have been provided to you upfront, and you should use this tool (\`${w}\`) to search for the required tools. For MCP tool discovery, always use \`${w}\`.`;function or(e={}){return{name:w,label:w,description:ir,promptSnippet:"Search for tools that are not loaded yet and load the matches",parameters:tr,exposure:"model-only",reachesTools:a(()=>"all","reachesTools"),async execute(t,{query:r,limit:n}){if(r.trim()==="")throw new Error("query must not be empty");let i=n??U;if(!Number.isInteger(i)||i<=0)throw new Error("limit must be a positive integer");let o=e.tools?nr(e.tools,r,i):[];return{content:[{type:"text",text:o.length===0?"No matching tools found.":`Loaded ${o.length} tool${o.length===1?"":"s"}. They are available from your next call:
|
|
33
33
|
${o.map(s=>`- ${s.name}: ${s.description.trim().split(/\r?\n/)[0]}`).join(`
|
|
34
|
-
`)}`}],details:{loaded:o.map(s=>s.name)}}}}}a(or,"createToolSearchToolDefinition");import{join as ar}from"node:path";var G={transport:"auto",sessionShareDestination:"auto",steeringMode:"one-at-a-time",followUpMode:"one-at-a-time",compaction:{enabled:!0,reserveTokens:16384,keepRecentTokens:2e4},branchSummary:{reserveTokens:16384,skipPrompt:!1},retry:{enabled:!0,maxRetries:3,baseDelayMs:2e3,maxAgentDelayMs:De,provider:{maxRetryDelayMs:6e4}},hideThinkingBlock:!1,showCacheMissNotices:!1,quietStartup:!1,defaultProjectTrust:"ask",collapseChangelog:!1,enableInstallTelemetry:!0,enableAnalytics:!1,enableSkillCommands:!0,terminal:{showImages:!0,imageWidthCells:60,clearOnShrink:!1,showTerminalProgress:!1},images:{autoResize:!0,blockImages:!1},doubleEscapeAction:"tree",treeFilterMode:"default",editorPaddingX:0,outputPad:1,autocompleteMaxVisible:5,markdown:{codeBlockIndent:" ",mermaid:"streaming"},warnings:{anthropicExtraUsage:!0},codemode:{mode:"on",inlineBudget:3e3},cacheWarming:"idle",tuiMode:"fullscreen",fullscreenExitOutput:"transcript",fullscreenScrollbar:"auto",fullscreenCopyOnSelect:!0,fullscreenWheelScrollLines:"auto"};function sr(e,t){return{name:e.name,label:e.label,description:e.description,parameters:e.parameters,outputSchema:e.outputSchema,constrainedSampling:e.constrainedSampling,prepareArguments:e.prepareArguments,executionMode:e.executionMode,executionModeFor:e.executionModeFor,execute:a((r,n,i,o,s)=>e.execute(r,n,i,o,s??t?.(r,i)),"execute")}}a(sr,"wrapToolDefinition");function lr(e){return{name:e.name,label:e.label,description:e.description,parameters:e.parameters,outputSchema:e.outputSchema,constrainedSampling:e.constrainedSampling,prepareArguments:e.prepareArguments,executionMode:e.executionMode,executionModeFor:e.executionModeFor,execute:a(async(t,r,n,i)=>e.execute(t,r,n,i),"execute")}}a(lr,"createToolDefinitionFromAgentTool");var ur=a(()=>import("./execute-
|
|
34
|
+
`)}`}],details:{loaded:o.map(s=>s.name)}}}}}a(or,"createToolSearchToolDefinition");import{join as ar}from"node:path";var G={transport:"auto",sessionShareDestination:"auto",steeringMode:"one-at-a-time",followUpMode:"one-at-a-time",compaction:{enabled:!0,reserveTokens:16384,keepRecentTokens:2e4},branchSummary:{reserveTokens:16384,skipPrompt:!1},retry:{enabled:!0,maxRetries:3,baseDelayMs:2e3,maxAgentDelayMs:De,provider:{maxRetryDelayMs:6e4}},hideThinkingBlock:!1,showCacheMissNotices:!1,quietStartup:!1,defaultProjectTrust:"ask",collapseChangelog:!1,enableInstallTelemetry:!0,enableAnalytics:!1,enableSkillCommands:!0,terminal:{showImages:!0,imageWidthCells:60,clearOnShrink:!1,showTerminalProgress:!1},images:{autoResize:!0,blockImages:!1},doubleEscapeAction:"tree",treeFilterMode:"default",editorPaddingX:0,outputPad:1,autocompleteMaxVisible:5,markdown:{codeBlockIndent:" ",mermaid:"streaming"},warnings:{anthropicExtraUsage:!0},codemode:{mode:"on",inlineBudget:3e3},cacheWarming:"idle",tuiMode:"fullscreen",fullscreenExitOutput:"transcript",fullscreenScrollbar:"auto",fullscreenCopyOnSelect:!0,fullscreenWheelScrollLines:"auto"};function sr(e,t){return{name:e.name,label:e.label,description:e.description,parameters:e.parameters,outputSchema:e.outputSchema,constrainedSampling:e.constrainedSampling,prepareArguments:e.prepareArguments,executionMode:e.executionMode,executionModeFor:e.executionModeFor,execute:a((r,n,i,o,s)=>e.execute(r,n,i,o,s??t?.(r,i)),"execute")}}a(sr,"wrapToolDefinition");function lr(e){return{name:e.name,label:e.label,description:e.description,parameters:e.parameters,outputSchema:e.outputSchema,constrainedSampling:e.constrainedSampling,prepareArguments:e.prepareArguments,executionMode:e.executionMode,executionModeFor:e.executionModeFor,execute:a(async(t,r,n,i)=>e.execute(t,r,n,i),"execute")}}a(lr,"createToolDefinitionFromAgentTool");var ur=a(()=>import("./execute-ZIFT667Q.js"),"loadCodemodeExecutor"),cr=10,dr=8,pr=5,Oe=80,mr=/^Script (completed|failed)\nWall time [\d.]+ seconds\nOutput:\n$/;function Ce(e,t){return`${e.fg("muted",E(g("\u2026\uFF08\u8FD8\u6709 {count} \u884C\uFF0C"),{count:t}))}${K("app.tools.expand",g("\u5C55\u5F00"))}${e.fg("muted",g("\uFF09"))}`}a(Ce,"expandHint");function fr(e){return e===void 0?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}a(fr,"formatDuration");function ke(e){return`$${e>=.01?e.toFixed(2):e.toPrecision(2)}`}a(ke,"formatCost");function gr(e,t){switch(e.status){case"running":return t.fg("warning","\u2026");case"ok":return t.fg("success","\u2713");case"error":return t.fg("error","\u2717");case"cancelled":return t.fg("muted","\u2298")}}a(gr,"statusIcon");function hr(e,t,r){let n=!r&&e.args.length>Oe?`${e.args.slice(0,Oe-3)}...`:e.args,i=fr(e.durationMs),o=`${gr(e,t)} ${t.fg("toolTitle",e.name)}`;return n&&(o+=` ${t.fg("muted",n)}`),i&&(o+=` ${t.fg("dim",i)}`),e.cost&&(o+=` ${t.fg("dim",ke(e.cost))}`),r&&e.error&&(o+=`
|
|
35
35
|
${t.fg("error",e.error.split(`
|
|
36
36
|
`).join(`
|
|
37
37
|
`))}`),o}a(hr,"formatCall");var yr={renderCall(e,t,r){bt(r);let n=de(e?.code),i=t.fg("toolTitle",t.bold("codemode")),o=r.lastComponent??new V;if(o.clear(),n===null)return o.addChild(new $(`${i} ${t.fg("error",g("[\u53C2\u6570\u65E0\u6548]"))}`,0,0)),o;if(o.addChild(new $(i,0,0)),n){let s=r.state;s.scriptHighlighter??=new Fe;let c=s.scriptHighlighter.highlight(k(n.replace(/\r/g,"").trimEnd()),"javascript").join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Te=Object.defineProperty;var d=(s,e)=>Te(s,"name",{value:e,configurable:!0});import{createRequire as Fe}from"node:module";const It=Fe(import.meta.url);import{fill as De}from"./chunk-G5AMLGXC.js";import{APP_NAME as Me,APP_TITLE as Ne,getAgentDir as $,getSessionsDir as Ae,normalizePath as b,pathsEqual as Re,resolvePath as S}from"./chunk-QM5JU2GS.js";import{reportNewerDataFormat as Be,t as Oe,writeFileAtomicSync as Le}from"./chunk-
|
|
1
|
+
var Te=Object.defineProperty;var d=(s,e)=>Te(s,"name",{value:e,configurable:!0});import{createRequire as Fe}from"node:module";const It=Fe(import.meta.url);import{fill as De}from"./chunk-G5AMLGXC.js";import{APP_NAME as Me,APP_TITLE as Ne,getAgentDir as $,getSessionsDir as Ae,normalizePath as b,pathsEqual as Re,resolvePath as S}from"./chunk-QM5JU2GS.js";import{reportNewerDataFormat as Be,t as Oe,writeFileAtomicSync as Le}from"./chunk-XIF7O6UG.js";import{uuidv7 as $e}from"./chunk-IEBK4HQA.js";import{getCurrentSystemMessage as Pe}from"./chunk-DM37LCOU.js";var je=`The conversation history before this point was compacted into the following summary:
|
|
2
2
|
|
|
3
3
|
<summary>
|
|
4
4
|
`,ke=`
|