@punch-bot/cli 1.4.0 → 1.5.1
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 +60 -0
- package/README.md +1 -1
- package/dist/bundle/chunks/anthropic-messages-WAYXCPZL.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-LUIPKPFC.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +8 -8
- package/dist/bundle/chunks/chunk-275CIYA5.js +16 -0
- package/dist/bundle/chunks/chunk-2W2ATKZM.js +2 -0
- package/dist/bundle/chunks/{chunk-PYGXRV27.js → chunk-3V45WARH.js} +1 -1
- package/dist/bundle/chunks/chunk-4LBJE4YM.js +14 -0
- package/dist/bundle/chunks/{chunk-J7I2NFJ7.js → chunk-4NE64BTO.js} +1 -1
- package/dist/bundle/chunks/{chunk-S3GGRYIO.js → chunk-5AGIVGSV.js} +1 -1
- package/dist/bundle/chunks/{chunk-F5ZABL6Z.js → chunk-7CBJINYJ.js} +2 -2
- package/dist/bundle/chunks/{chunk-DRQDKNXA.js → chunk-7DDKXS2Q.js} +1 -1
- package/dist/bundle/chunks/{chunk-MCGQGCDS.js → chunk-7SFLP7ZK.js} +102 -93
- package/dist/bundle/chunks/{chunk-OO6DJ3CL.js → chunk-A3Y7H47A.js} +1 -1
- package/dist/bundle/chunks/{chunk-LP6WVVUV.js → chunk-BQU3RKDL.js} +1 -1
- package/dist/bundle/chunks/chunk-CRILLKNU.js +2 -0
- package/dist/bundle/chunks/chunk-HMPP4ECW.js +2 -0
- package/dist/bundle/chunks/chunk-HS7GCDEX.js +6 -0
- package/dist/bundle/chunks/{chunk-4L3WN2XY.js → chunk-JXWJOIH4.js} +1 -1
- package/dist/bundle/chunks/{chunk-6CYCI3EJ.js → chunk-LVVZS2NO.js} +1 -1
- package/dist/bundle/chunks/{chunk-6C5VKHGV.js → chunk-MYNHUMKE.js} +2 -2
- package/dist/bundle/chunks/{chunk-2M76JOVH.js → chunk-NJK3U3WK.js} +2 -2
- package/dist/bundle/chunks/chunk-NQWQE4BR.js +11 -0
- package/dist/bundle/chunks/{chunk-YGGF2ZM6.js → chunk-RROECCMX.js} +3 -3
- package/dist/bundle/chunks/{chunk-ZBURYEWF.js → chunk-TMTOQ7H7.js} +1 -1
- package/dist/bundle/chunks/chunk-TRN3ET6M.js +2 -0
- package/dist/bundle/chunks/{chunk-YWHGLBPB.js → chunk-UE7JCDFW.js} +1 -1
- package/dist/bundle/chunks/{chunk-22CYIUS4.js → chunk-UKVNB6C4.js} +1 -1
- package/dist/bundle/chunks/{cli-QAQLORRY.js → cli-W5KJM7YB.js} +1 -1
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-JWAAZATQ.js +2 -0
- package/dist/bundle/chunks/{execute-2Z6BN5R3.js → execute-HXULRBCI.js} +9 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-EHUU7JII.js +2 -0
- package/dist/bundle/chunks/google-vertex-AFMVUS5C.js +2 -0
- package/dist/bundle/chunks/{https-proxy-agent-US7JVRJG.js → https-proxy-agent-VTEOYAYG.js} +1 -1
- package/dist/bundle/chunks/{jiti-loader-C3NU2SDH.js → jiti-loader-GL4HJFAD.js} +1 -1
- package/dist/bundle/chunks/{jiti-static-loader-E6ANQD5T.js → jiti-static-loader-2RCDI6B4.js} +1 -1
- package/dist/bundle/chunks/{lib-TEDK3E5I.js → lib-4AVRLBHM.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-FYN623RH.js → llama-cpp-classify-YVA2UOJG.js} +2 -2
- package/dist/bundle/chunks/{mistral-conversations-VNJYBSRF.js → mistral-conversations-FEBYNTL2.js} +1 -1
- package/dist/bundle/chunks/{multipart-parser-SQ6GDJL7.js → multipart-parser-FMGQ7342.js} +1 -1
- package/dist/bundle/chunks/{node-TWVVAGPO.js → node-AUOGOBCN.js} +1 -1
- package/dist/bundle/chunks/{node-N5BSDOA5.js → node-KCMANYC2.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-MI7TTP3C.js +10 -0
- package/dist/bundle/chunks/openai-completions-BVORSTAM.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-WVPMQ4JD.js → openai-decisions-GNOLFL74.js} +1 -1
- package/dist/bundle/chunks/openai-responses-TLIV5OQA.js +4 -0
- package/dist/bundle/chunks/openrouter-images-ZTNVFSL2.js +2 -0
- package/dist/bundle/chunks/pi-messages-4MVQCGGY.js +8 -0
- package/dist/bundle/chunks/{runtime-R6O72Q4R.js → runtime-R5GXO4CV.js} +1 -1
- package/dist/bundle/chunks/{src-UK77SYZE.js → src-QKGKDFSU.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-I5AHLF6T.js +2 -0
- package/dist/bundle/chunks/virtual-modules-QK7S56IZ.js +2 -0
- 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/core/agent-session.d.ts +5 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +41 -12
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/client-identity.d.ts +8 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +15 -0
- package/dist/core/client-identity.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +20 -15
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +2 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +2 -1
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +30 -29
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +3 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +3 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/model-config.d.ts +915 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +48 -24
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +6 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +7 -3
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +8 -9
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +3 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +99 -24
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +3 -2
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/punch/a2a-listen.d.ts.map +1 -1
- package/dist/extensions/punch/a2a-listen.js +1 -0
- package/dist/extensions/punch/a2a-listen.js.map +1 -1
- package/dist/extensions/punch/a2a.d.ts.map +1 -1
- package/dist/extensions/punch/a2a.js +12 -5
- package/dist/extensions/punch/a2a.js.map +1 -1
- package/dist/extensions/punch/auth.d.ts +4 -1
- package/dist/extensions/punch/auth.d.ts.map +1 -1
- package/dist/extensions/punch/auth.js +17 -2
- package/dist/extensions/punch/auth.js.map +1 -1
- package/dist/extensions/punch/collabs.d.ts.map +1 -1
- package/dist/extensions/punch/collabs.js +46 -40
- package/dist/extensions/punch/collabs.js.map +1 -1
- package/dist/extensions/punch/index.d.ts.map +1 -1
- package/dist/extensions/punch/index.js +2 -0
- package/dist/extensions/punch/index.js.map +1 -1
- package/dist/extensions/punch/plan-gate.d.ts +34 -0
- package/dist/extensions/punch/plan-gate.d.ts.map +1 -0
- package/dist/extensions/punch/plan-gate.js +149 -0
- package/dist/extensions/punch/plan-gate.js.map +1 -0
- package/dist/extensions/webfetch/index.d.ts.map +1 -1
- package/dist/extensions/webfetch/index.js +2 -1
- package/dist/extensions/webfetch/index.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +2 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/server/a2a/run-server.d.ts +2 -0
- package/dist/server/a2a/run-server.d.ts.map +1 -1
- package/dist/server/a2a/run-server.js +2 -0
- package/dist/server/a2a/run-server.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +3 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +1 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.js +3 -2
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +45 -13
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +4 -3
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/codemode.md +2 -2
- package/docs/compaction.md +3 -3
- package/docs/custom-provider.md +53 -1
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +3 -0
- package/docs/extensions.md +129 -10
- package/docs/models-configuration.md +196 -0
- package/docs/models.md +21 -5
- package/docs/settings.md +1 -1
- package/docs/windows.md +16 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +8 -8
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +18 -44
- package/examples/extensions/sandbox/package.json +5 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +54 -43
- package/package.json +12 -11
- package/schemas/models.schema.json +83 -29
- package/dist/bundle/chunks/anthropic-messages-BUUFZMRE.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-WZ4GZHD2.js +0 -2
- package/dist/bundle/chunks/chunk-BYHXHV4K.js +0 -11
- package/dist/bundle/chunks/chunk-HACVPRBJ.js +0 -11
- package/dist/bundle/chunks/chunk-ITZNWD4K.js +0 -2
- package/dist/bundle/chunks/chunk-OWCYH5W2.js +0 -2
- package/dist/bundle/chunks/chunk-QQO2NSV6.js +0 -6
- package/dist/bundle/chunks/chunk-WUIPA42N.js +0 -14
- package/dist/bundle/chunks/chunk-XIX7LUWI.js +0 -2
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-S2KXX5PQ.js +0 -2
- package/dist/bundle/chunks/google-vertex-LQOUTFJN.js +0 -2
- package/dist/bundle/chunks/openai-codex-responses-E6BLZPYJ.js +0 -10
- package/dist/bundle/chunks/openai-completions-LUDIAWSG.js +0 -7
- package/dist/bundle/chunks/openai-responses-IOCBEIVC.js +0 -3
- package/dist/bundle/chunks/openrouter-images-YU24TD7D.js +0 -2
- package/dist/bundle/chunks/pi-messages-V27DSLVC.js +0 -8
- package/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +0 -2
- package/dist/bundle/chunks/virtual-modules-WOHWUS3S.js +0 -2
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -72
- package/dist/core/provider-attribution.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
import{GoogleGenAI,ResourceScope,convertMessages,convertTools,getDisabledGoogleThinkingConfig,isThinkingPart,mapStopReason,resolveGoogleFunctionCallingMode,resolveGoogleThinkingLevel,retainThoughtSignature,retryGoogleRequest,supportsGoogleStrictToolSampling,toGoogleSdkThinkingLevel,toGoogleThinkingLevel,usesGoogleThinkingLevel}from"./chunk-RROECCMX.js";import{formatProviderError,normalizeProviderError}from"./chunk-TEPMHNKQ.js";import"./chunk-PMRZO46Y.js";import{buildBaseOptions}from"./chunk-2W2ATKZM.js";import{sanitizeSurrogates}from"./chunk-L2ZPNLYD.js";import{providerHeadersToRecord}from"./chunk-UTB4DTYQ.js";import{getProviderEnvValue}from"./chunk-7DDKXS2Q.js";import{calculateCost,clampThinkingLevel,collapseSystemMessages,getCurrentTools,getInitialSystemMessage,getSystemMessageText}from"./chunk-NQWQE4BR.js";import{AssistantMessageEventStream}from"./chunk-LPXNMA2W.js";import{getIdentityHeaders}from"./chunk-TRN3ET6M.js";import"./chunk-JXWJOIH4.js";var API_VERSION="v1",GCP_VERTEX_CREDENTIALS_MARKER="gcp-vertex-credentials",toolCallCounter=0,stream=(model,context,options)=>{let stream2=new AssistantMessageEventStream,normalizedContext=collapseSystemMessages(context);return(async()=>{let output={role:"assistant",content:[],api:"google-vertex",provider:model.provider,model:model.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(options?.fetch&&options.fetch!==globalThis.fetch)throw new Error("Custom fetch is not supported by the Google Vertex adapter");let apiKey=resolveApiKey(options),client=apiKey?createClientWithApiKey(model,apiKey,options?.headers,options?.identity):createClient(model,resolveProject(options),resolveLocation(options),options?.headers,options?.env,options?.identity),params=buildParams(model,normalizedContext,options),nextParams=await options?.onPayload?.(params,model);nextParams!==void 0&&(params=nextParams);let googleStream=await retryGoogleRequest(()=>client.models.generateContentStream(params),options);stream2.push({type:"start",partial:output});let currentBlock=null,blocks=output.content,blockIndex=()=>blocks.length-1;for await(let chunk of googleStream){await options?.onProviderStreamEvent?.(chunk,model),output.responseId||=chunk.responseId;let candidate=chunk.candidates?.[0];if(candidate?.content?.parts)for(let part of candidate.content.parts){if(part.text!==void 0){let isThinking=isThinkingPart(part);(!currentBlock||isThinking&¤tBlock.type!=="thinking"||!isThinking&¤tBlock.type!=="text")&&(currentBlock&&(currentBlock.type==="text"?stream2.push({type:"text_end",contentIndex:blocks.length-1,content:currentBlock.text,partial:output}):stream2.push({type:"thinking_end",contentIndex:blockIndex(),content:currentBlock.thinking,partial:output})),isThinking?(currentBlock={type:"thinking",thinking:"",thinkingSignature:void 0},output.content.push(currentBlock),stream2.push({type:"thinking_start",contentIndex:blockIndex(),partial:output})):(currentBlock={type:"text",text:""},output.content.push(currentBlock),stream2.push({type:"text_start",contentIndex:blockIndex(),partial:output}))),currentBlock.type==="thinking"?(currentBlock.thinking+=part.text,currentBlock.thinkingSignature=retainThoughtSignature(currentBlock.thinkingSignature,part.thoughtSignature),stream2.push({type:"thinking_delta",contentIndex:blockIndex(),delta:part.text,partial:output})):(currentBlock.text+=part.text,currentBlock.textSignature=retainThoughtSignature(currentBlock.textSignature,part.thoughtSignature),stream2.push({type:"text_delta",contentIndex:blockIndex(),delta:part.text,partial:output}))}if(part.functionCall){currentBlock&&(currentBlock.type==="text"?stream2.push({type:"text_end",contentIndex:blockIndex(),content:currentBlock.text,partial:output}):stream2.push({type:"thinking_end",contentIndex:blockIndex(),content:currentBlock.thinking,partial:output}),currentBlock=null);let providedId=part.functionCall.id,toolCall={type:"toolCall",id:!providedId||output.content.some(b=>b.type==="toolCall"&&b.id===providedId)?`${part.functionCall.name}_${Date.now()}_${++toolCallCounter}`:providedId,name:part.functionCall.name||"",arguments:part.functionCall.args??{},...part.thoughtSignature&&{thoughtSignature:part.thoughtSignature}};output.content.push(toolCall),stream2.push({type:"toolcall_start",contentIndex:blockIndex(),partial:output}),stream2.push({type:"toolcall_delta",contentIndex:blockIndex(),delta:JSON.stringify(toolCall.arguments),partial:output}),stream2.push({type:"toolcall_end",contentIndex:blockIndex(),toolCall,partial:output})}}candidate?.finishReason&&(output.rawStopReason=candidate.finishReason,output.stopReason=mapStopReason(candidate.finishReason),output.content.some(b=>b.type==="toolCall")&&output.stopReason==="stop"&&(output.stopReason="toolUse")),chunk.usageMetadata&&(output.usage={input:(chunk.usageMetadata.promptTokenCount||0)-(chunk.usageMetadata.cachedContentTokenCount||0),output:(chunk.usageMetadata.candidatesTokenCount||0)+(chunk.usageMetadata.thoughtsTokenCount||0),cacheRead:chunk.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:chunk.usageMetadata.thoughtsTokenCount||0,totalTokens:chunk.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},calculateCost(model,output.usage))}if(currentBlock&&(currentBlock.type==="text"?stream2.push({type:"text_end",contentIndex:blockIndex(),content:currentBlock.text,partial:output}):stream2.push({type:"thinking_end",contentIndex:blockIndex(),content:currentBlock.thinking,partial:output})),options?.signal?.aborted)throw new Error("Request was aborted");if(output.stopReason==="pending")throw new Error("Google Vertex stream ended without a finish reason");if(output.stopReason==="aborted"||output.stopReason==="error"){let errorMessage=output.rawStopReason?`Provider stopped with: ${output.rawStopReason}`:"An unknown error occurred";throw new Error(errorMessage)}stream2.push({type:"done",reason:output.stopReason,message:output}),stream2.end()}catch(error){for(let block of output.content)"index"in block&&delete block.index;output.stopReason=options?.signal?.aborted?"aborted":"error",output.errorMessage=formatProviderError(normalizeProviderError(error)),stream2.push({type:"error",reason:output.stopReason,error:output}),stream2.end()}})(),stream2},streamSimple=(model,context,options)=>{let base={...buildBaseOptions(model,context,options,void 0),toolChoice:options?.toolChoice};if(!options?.reasoning)return stream(model,context,{...base,thinking:{enabled:!1}});let clampedReasoning=clampThinkingLevel(model,options.reasoning);if(clampedReasoning==="off")return stream(model,context,{...base,thinking:{enabled:!1}});let resolvedLevel=resolveGoogleThinkingLevel(model,clampedReasoning);return usesGoogleThinkingLevel(model)?stream(model,context,{...base,thinking:{enabled:!0,level:toGoogleThinkingLevel(resolvedLevel)}}):stream(model,context,{...base,thinking:{enabled:!0,budgetTokens:getGoogleBudget(model,resolvedLevel,options.thinkingBudgets)}})};function createClient(model,project,location,optionsHeaders,env,identity){let googleAuthOptions=buildGoogleAuthOptions(env);return new GoogleGenAI({vertexai:!0,project,location,apiVersion:API_VERSION,...googleAuthOptions?{googleAuthOptions}:{},httpOptions:buildHttpOptions(model,optionsHeaders,identity)})}function createClientWithApiKey(model,apiKey,optionsHeaders,identity){return new GoogleGenAI({vertexai:!0,apiKey,apiVersion:API_VERSION,httpOptions:buildHttpOptions(model,optionsHeaders,identity)})}function buildHttpOptions(model,optionsHeaders,identity){let httpOptions={},baseUrl=resolveCustomBaseUrl(model.baseUrl);baseUrl&&(httpOptions.baseUrl=baseUrl,httpOptions.baseUrlResourceScope=ResourceScope.COLLECTION,baseUrlIncludesApiVersion(baseUrl)&&(httpOptions.apiVersion=""));let headers=providerHeadersToRecord(getIdentityHeaders(model,identity),model.headers,optionsHeaders);return headers&&(httpOptions.headers=headers),Object.keys(httpOptions).length>0?httpOptions:void 0}function resolveCustomBaseUrl(baseUrl){let trimmed=baseUrl.trim();if(!(!trimmed||trimmed.includes("{location}")))return trimmed}function baseUrlIncludesApiVersion(baseUrl){try{return new URL(baseUrl).pathname.split("/").some(part=>/^v\d+(?:beta\d*)?$/.test(part))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(baseUrl)}}function buildGoogleAuthOptions(env){let keyFilename=getProviderEnvValue("GOOGLE_APPLICATION_CREDENTIALS",env);return keyFilename?{keyFilename}:void 0}function resolveApiKey(options){let apiKey=options?.apiKey?.trim();if(!(!apiKey||apiKey===GCP_VERTEX_CREDENTIALS_MARKER||isPlaceholderApiKey(apiKey)))return apiKey}function isPlaceholderApiKey(apiKey){return/^<[^>]+>$/.test(apiKey)}function resolveProject(options){let project=options?.project||getProviderEnvValue("GOOGLE_CLOUD_PROJECT",options?.env)||getProviderEnvValue("GCLOUD_PROJECT",options?.env);if(!project)throw new Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return project}function resolveLocation(options){let location=options?.location||getProviderEnvValue("GOOGLE_CLOUD_LOCATION",options?.env);if(!location)throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return location}function buildParams(model,context,options={}){let contents=convertMessages(model,context),initialSystemMessage=getInitialSystemMessage(context.messages),currentTools=getCurrentTools(context.messages),generationConfig={};options.temperature!==void 0&&(generationConfig.temperature=options.temperature),options.maxTokens!==void 0&&(generationConfig.maxOutputTokens=options.maxTokens);let supportsStrictMode=supportsGoogleStrictToolSampling(model.id),functionCallingMode=currentTools.length>0?resolveGoogleFunctionCallingMode(currentTools,options.toolChoice,supportsStrictMode):void 0,systemInstruction=initialSystemMessage?getSystemMessageText(initialSystemMessage):"",config={...Object.keys(generationConfig).length>0&&generationConfig,...systemInstruction&&{systemInstruction:sanitizeSurrogates(systemInstruction)},...currentTools.length>0&&{tools:convertTools(currentTools,!1,supportsStrictMode)},...functionCallingMode!==void 0&&{toolConfig:{functionCallingConfig:{mode:functionCallingMode}}}};if(options.thinking?.enabled&&model.reasoning){let thinkingConfig={includeThoughts:!0};options.thinking.level!==void 0?thinkingConfig.thinkingLevel=toGoogleSdkThinkingLevel(options.thinking.level):options.thinking.budgetTokens!==void 0&&(thinkingConfig.thinkingBudget=options.thinking.budgetTokens),config.thinkingConfig=thinkingConfig}else model.reasoning&&options.thinking&&!options.thinking.enabled&&(config.thinkingConfig=getDisabledGoogleThinkingConfig(model));if(options.signal){if(options.signal.aborted)throw new Error("Request aborted");config.abortSignal=options.signal}return{model:model.id,contents,config}}function getGoogleBudget(model,level,customBudgets){return customBudgets?.[level]!==void 0?customBudgets[level]:model.id.includes("2.5-pro")?{minimal:128,low:2048,medium:8192,high:32768}[level]:model.id.includes("2.5-flash")?{minimal:128,low:2048,medium:8192,high:24576}[level]:-1}export{stream,streamSimple};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{require_src}from"./chunk-
|
|
2
|
+
import{require_src}from"./chunk-HS7GCDEX.js";import{__commonJS,__esm,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_helpers=__commonJS({"node_modules/agent-base/dist/helpers.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?(function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}):function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.prototype.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.req=exports.json=exports.toBuffer=void 0;var http=__importStar(__require("http")),https=__importStar(__require("https"));async function toBuffer(stream){let length=0,chunks=[];for await(let chunk of stream)length+=chunk.length,chunks.push(chunk);return Buffer.concat(chunks,length)}exports.toBuffer=toBuffer;async function json(stream){let str=(await toBuffer(stream)).toString("utf8");try{return JSON.parse(str)}catch(_err){let err=_err;throw err.message+=` (input: ${str})`,err}}exports.json=json;function req(url,opts={}){let req2=((typeof url=="string"?url:url.href).startsWith("https:")?https:http).request(url,opts),promise=new Promise((resolve,reject)=>{req2.once("response",resolve).once("error",reject).end()});return req2.then=promise.then.bind(promise),req2}exports.req=req}});var require_dist=__commonJS({"node_modules/agent-base/dist/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?(function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}):function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.prototype.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});exports.Agent=void 0;var net=__importStar(__require("net")),http=__importStar(__require("http")),https_1=__require("https");__exportStar(require_helpers(),exports);var INTERNAL=Symbol("AgentBaseInternalState"),Agent=class extends http.Agent{constructor(opts){super(opts),this[INTERNAL]={}}isSecureEndpoint(options){if(options){if(typeof options.secureEndpoint=="boolean")return options.secureEndpoint;if(typeof options.protocol=="string")return options.protocol==="https:"}let{stack}=new Error;return typeof stack!="string"?!1:stack.split(`
|
|
3
3
|
`).some(l=>l.indexOf("(https.js:")!==-1||l.indexOf("node:https:")!==-1)}incrementSockets(name){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[name]||(this.sockets[name]=[]);let fakeSocket=new net.Socket({writable:!1});return this.sockets[name].push(fakeSocket),this.totalSocketCount++,fakeSocket}decrementSockets(name,socket){if(!this.sockets[name]||socket===null)return;let sockets=this.sockets[name],index=sockets.indexOf(socket);index!==-1&&(sockets.splice(index,1),this.totalSocketCount--,sockets.length===0&&delete this.sockets[name])}getName(options){return this.isSecureEndpoint(options)?https_1.Agent.prototype.getName.call(this,options):super.getName(options)}createSocket(req,options,cb){let connectOpts={...options,secureEndpoint:this.isSecureEndpoint(options)},name=this.getName(connectOpts),fakeSocket=this.incrementSockets(name);Promise.resolve().then(()=>this.connect(req,connectOpts)).then(socket=>{if(this.decrementSockets(name,fakeSocket),socket instanceof http.Agent)try{return socket.addRequest(req,connectOpts)}catch(err){return cb(err)}this[INTERNAL].currentSocket=socket,super.createSocket(req,options,cb)},err=>{this.decrementSockets(name,fakeSocket),cb(err)})}createConnection(){let socket=this[INTERNAL].currentSocket;if(this[INTERNAL].currentSocket=void 0,!socket)throw new Error("No socket was returned in the `connect()` function");return socket}get defaultPort(){return this[INTERNAL].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(v){this[INTERNAL]&&(this[INTERNAL].defaultPort=v)}get protocol(){return this[INTERNAL].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(v){this[INTERNAL]&&(this[INTERNAL].protocol=v)}};exports.Agent=Agent}});var require_parse_proxy_response=__commonJS({"node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports){"use strict";var __importDefault=exports&&exports.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});exports.parseProxyResponse=void 0;var debug_1=__importDefault(require_src()),debug=(0,debug_1.default)("https-proxy-agent:parse-proxy-response");function parseProxyResponse(socket){return new Promise((resolve,reject)=>{let buffersLength=0,buffers=[];function read(){let b=socket.read();b?ondata(b):socket.once("readable",read)}function cleanup(){socket.removeListener("end",onend),socket.removeListener("error",onerror),socket.removeListener("readable",read)}function onend(){cleanup(),debug("onend"),reject(new Error("Proxy connection ended before receiving CONNECT response"))}function onerror(err){cleanup(),debug("onerror %o",err),reject(err)}function ondata(b){buffers.push(b),buffersLength+=b.length;let buffered=Buffer.concat(buffers,buffersLength),endOfHeaders=buffered.indexOf(`\r
|
|
4
4
|
\r
|
|
5
5
|
`);if(endOfHeaders===-1){debug("have not received end of HTTP headers yet..."),read();return}let headerParts=buffered.slice(0,endOfHeaders).toString("ascii").split(`\r
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{__commonJS,__require,__toESM}from"./chunk-
|
|
2
|
+
import{__commonJS,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_jiti=__commonJS({"node_modules/jiti/dist/jiti.cjs"(exports,module){(()=>{var e={"./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive"(e2){function webpackEmptyAsyncContext(e3){return Promise.resolve().then(function(){var t2=new Error("Cannot find module '"+e3+"'");throw t2.code="MODULE_NOT_FOUND",t2})}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/mlly@1.8.2/node_modules/mlly/dist lazy recursive",e2.exports=webpackEmptyAsyncContext},fs(e2){"use strict";e2.exports=__require("fs")},"node:fs"(e2){"use strict";e2.exports=__require("node:fs")},"node:module"(e2){"use strict";e2.exports=__require("node:module")},"node:path"(e2){"use strict";e2.exports=__require("node:path")},os(e2){"use strict";e2.exports=__require("os")},path(e2){"use strict";e2.exports=__require("path")},"./node_modules/.pnpm/get-tsconfig@4.14.0/node_modules/get-tsconfig/dist/index.cjs"(e2,t2,i2){"use strict";var n=Object.defineProperty,r=(e3,t3)=>n(e3,"name",{value:t3,configurable:!0}),a=i2("node:path"),c=i2("node:fs"),l=i2("node:module"),y=i2("./node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.cjs"),E=i2("fs"),w=i2("os"),C=i2("path");function h(e3){return e3.startsWith("\\\\?\\")?e3:e3.replace(/\\/g,"/")}r(h,"slash");let S=r(e3=>{let t3=c[e3];return(i3,...n2)=>{let a2=`${e3}:${n2.join(":")}`,l2=i3?.get(a2);return l2===void 0&&(l2=Reflect.apply(t3,c,n2),i3?.set(a2,l2)),l2}},"cacheFs"),I=S("existsSync"),N=S("readFileSync"),O=S("statSync"),j=r((e3,t3,i3)=>{for(;;){let n2=a.posix.join(e3,t3);if(I(i3,n2))return n2;let c2=a.dirname(e3);if(c2===e3)return;e3=c2}},"findUp"),F=/^\.{1,2}(\/.*)?$/,B=r(e3=>{let t3=h(e3);return F.test(t3)?t3:`./${t3}`},"normalizeRelativePath");function Ne(e3,t3=!1){let i3=e3.length,n2=0,a2="",c2=0,l2=16,y2=0,E2=0,w2=0,C2=0,S2=0;function _(t4,i4){let a3=0,c3=0;for(;a3<t4;){let t5=e3.charCodeAt(n2);if(t5>=48&&t5<=57)c3=16*c3+t5-48;else if(t5>=65&&t5<=70)c3=16*c3+t5-65+10;else{if(!(t5>=97&&t5<=102))break;c3=16*c3+t5-97+10}n2++,a3++}return a3<t4&&(c3=-1),c3}function b(e4){n2=e4,a2="",c2=0,l2=16,S2=0}function p(){let t4=n2;if(e3.charCodeAt(n2)===48)n2++;else for(n2++;n2<e3.length&&R(e3.charCodeAt(n2));)n2++;if(n2<e3.length&&e3.charCodeAt(n2)===46){if(n2++,!(n2<e3.length&&R(e3.charCodeAt(n2))))return S2=3,e3.substring(t4,n2);for(n2++;n2<e3.length&&R(e3.charCodeAt(n2));)n2++}let i4=n2;if(n2<e3.length&&(e3.charCodeAt(n2)===69||e3.charCodeAt(n2)===101))if(n2++,(n2<e3.length&&e3.charCodeAt(n2)===43||e3.charCodeAt(n2)===45)&&n2++,n2<e3.length&&R(e3.charCodeAt(n2))){for(n2++;n2<e3.length&&R(e3.charCodeAt(n2));)n2++;i4=n2}else S2=3;return e3.substring(t4,i4)}function L(){let t4="",a3=n2;for(;;){if(n2>=i3){t4+=e3.substring(a3,n2),S2=2;break}let c3=e3.charCodeAt(n2);if(c3===34){t4+=e3.substring(a3,n2),n2++;break}if(c3!==92){if(c3>=0&&c3<=31){if(M(c3)){t4+=e3.substring(a3,n2),S2=2;break}S2=6}n2++}else{if(t4+=e3.substring(a3,n2),n2++,n2>=i3){S2=2;break}switch(e3.charCodeAt(n2++)){case 34:t4+='"';break;case 92:t4+="\\";break;case 47:t4+="/";break;case 98:t4+="\b";break;case 102:t4+="\f";break;case 110:t4+=`
|
|
3
3
|
`;break;case 114:t4+="\r";break;case 116:t4+=" ";break;case 117:let e4=_(4);e4>=0?t4+=String.fromCharCode(e4):S2=4;break;default:S2=5}a3=n2}}return t4}function A(){if(a2="",S2=0,c2=n2,E2=y2,C2=w2,n2>=i3)return c2=i3,l2=17;let t4=e3.charCodeAt(n2);if(ee(t4)){do n2++,a2+=String.fromCharCode(t4),t4=e3.charCodeAt(n2);while(ee(t4));return l2=15}if(M(t4))return n2++,a2+=String.fromCharCode(t4),t4===13&&e3.charCodeAt(n2)===10&&(n2++,a2+=`
|
|
4
4
|
`),y2++,w2=n2,l2=14;switch(t4){case 123:return n2++,l2=1;case 125:return n2++,l2=2;case 91:return n2++,l2=3;case 93:return n2++,l2=4;case 58:return n2++,l2=6;case 44:return n2++,l2=5;case 34:return n2++,a2=L(),l2=10;case 47:let E3=n2-1;if(e3.charCodeAt(n2+1)===47){for(n2+=2;n2<i3&&!M(e3.charCodeAt(n2));)n2++;return a2=e3.substring(E3,n2),l2=12}if(e3.charCodeAt(n2+1)===42){n2+=2;let t5=i3-1,c3=!1;for(;n2<t5;){let t6=e3.charCodeAt(n2);if(t6===42&&e3.charCodeAt(n2+1)===47){n2+=2,c3=!0;break}n2++,M(t6)&&(t6===13&&e3.charCodeAt(n2)===10&&n2++,y2++,w2=n2)}return c3||(n2++,S2=1),a2=e3.substring(E3,n2),l2=13}return a2+=String.fromCharCode(t4),n2++,l2=16;case 45:if(a2+=String.fromCharCode(t4),n2++,n2===i3||!R(e3.charCodeAt(n2)))return l2=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return a2+=p(),l2=11;default:for(;n2<i3&&D(t4);)n2++,t4=e3.charCodeAt(n2);if(c2!==n2){switch(a2=e3.substring(c2,n2),a2){case"true":return l2=8;case"false":return l2=9;case"null":return l2=7}return l2=16}return a2+=String.fromCharCode(t4),n2++,l2=16}}function D(e4){if(ee(e4)||M(e4))return!1;switch(e4){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function x(){let e4;do e4=A();while(e4>=12&&e4<=15);return e4}return r(_,"scanHexDigits"),r(b,"setPosition"),r(p,"scanNumber"),r(L,"scanString"),r(A,"scanNext"),r(D,"isUnknownContentCharacter"),r(x,"scanNextNonTrivia"),{setPosition:b,getPosition:r(()=>n2,"getPosition"),scan:t3?x:A,getToken:r(()=>l2,"getToken"),getTokenValue:r(()=>a2,"getTokenValue"),getTokenOffset:r(()=>c2,"getTokenOffset"),getTokenLength:r(()=>n2-c2,"getTokenLength"),getTokenStartLine:r(()=>E2,"getTokenStartLine"),getTokenStartCharacter:r(()=>c2-C2,"getTokenStartCharacter"),getTokenError:r(()=>S2,"getTokenError")}}function ee(e3){return e3===32||e3===9}function M(e3){return e3===10||e3===13}function R(e3){return e3>=48&&e3<=57}var $,q;r(Ne,"createScanner"),r(ee,"isWhiteSpace"),r(M,"isLineBreak"),r(R,"isDigit"),(q=$||($={}))[q.lineFeed=10]="lineFeed",q[q.carriageReturn=13]="carriageReturn",q[q.space=32]="space",q[q._0=48]="_0",q[q._1=49]="_1",q[q._2=50]="_2",q[q._3=51]="_3",q[q._4=52]="_4",q[q._5=53]="_5",q[q._6=54]="_6",q[q._7=55]="_7",q[q._8=56]="_8",q[q._9=57]="_9",q[q.a=97]="a",q[q.b=98]="b",q[q.c=99]="c",q[q.d=100]="d",q[q.e=101]="e",q[q.f=102]="f",q[q.g=103]="g",q[q.h=104]="h",q[q.i=105]="i",q[q.j=106]="j",q[q.k=107]="k",q[q.l=108]="l",q[q.m=109]="m",q[q.n=110]="n",q[q.o=111]="o",q[q.p=112]="p",q[q.q=113]="q",q[q.r=114]="r",q[q.s=115]="s",q[q.t=116]="t",q[q.u=117]="u",q[q.v=118]="v",q[q.w=119]="w",q[q.x=120]="x",q[q.y=121]="y",q[q.z=122]="z",q[q.A=65]="A",q[q.B=66]="B",q[q.C=67]="C",q[q.D=68]="D",q[q.E=69]="E",q[q.F=70]="F",q[q.G=71]="G",q[q.H=72]="H",q[q.I=73]="I",q[q.J=74]="J",q[q.K=75]="K",q[q.L=76]="L",q[q.M=77]="M",q[q.N=78]="N",q[q.O=79]="O",q[q.P=80]="P",q[q.Q=81]="Q",q[q.R=82]="R",q[q.S=83]="S",q[q.T=84]="T",q[q.U=85]="U",q[q.V=86]="V",q[q.W=87]="W",q[q.X=88]="X",q[q.Y=89]="Y",q[q.Z=90]="Z",q[q.asterisk=42]="asterisk",q[q.backslash=92]="backslash",q[q.closeBrace=125]="closeBrace",q[q.closeBracket=93]="closeBracket",q[q.colon=58]="colon",q[q.comma=44]="comma",q[q.dot=46]="dot",q[q.doubleQuote=34]="doubleQuote",q[q.minus=45]="minus",q[q.openBrace=123]="openBrace",q[q.openBracket=91]="openBracket",q[q.plus=43]="plus",q[q.slash=47]="slash",q[q.formFeed=12]="formFeed",q[q.tab=9]="tab",new Array(20).fill(0).map((e3,t3)=>" ".repeat(t3));let W=200;var K,H,Y;function Pe(e3,t3=[],i3=K.DEFAULT){let n2=null,a2=[],c2=[];function o(e4){Array.isArray(a2)?a2.push(e4):n2!==null&&(a2[n2]=e4)}return r(o,"onValue"),We(e3,{onObjectBegin:r(()=>{let e4={};o(e4),c2.push(a2),a2=e4,n2=null},"onObjectBegin"),onObjectProperty:r(e4=>{n2=e4},"onObjectProperty"),onObjectEnd:r(()=>{a2=c2.pop()},"onObjectEnd"),onArrayBegin:r(()=>{let e4=[];o(e4),c2.push(a2),a2=e4,n2=null},"onArrayBegin"),onArrayEnd:r(()=>{a2=c2.pop()},"onArrayEnd"),onLiteralValue:o,onError:r((e4,i4,n3)=>{t3.push({error:e4,offset:i4,length:n3})},"onError")},i3),a2[0]}function We(e3,t3,i3=K.DEFAULT){let n2=Ne(e3,!1),a2=[],c2=0;function o(e4){return e4?()=>c2===0&&e4(n2.getTokenOffset(),n2.getTokenLength(),n2.getTokenStartLine(),n2.getTokenStartCharacter()):()=>!0}function f(e4){return e4?t4=>c2===0&&e4(t4,n2.getTokenOffset(),n2.getTokenLength(),n2.getTokenStartLine(),n2.getTokenStartCharacter()):()=>!0}function u(e4){return e4?t4=>c2===0&&e4(t4,n2.getTokenOffset(),n2.getTokenLength(),n2.getTokenStartLine(),n2.getTokenStartCharacter(),()=>a2.slice()):()=>!0}function g(e4){return e4?()=>{c2>0?c2++:e4(n2.getTokenOffset(),n2.getTokenLength(),n2.getTokenStartLine(),n2.getTokenStartCharacter(),()=>a2.slice())===!1&&(c2=1)}:()=>!0}function m(e4){return e4?()=>{c2>0&&c2--,c2===0&&e4(n2.getTokenOffset(),n2.getTokenLength(),n2.getTokenStartLine(),n2.getTokenStartCharacter())}:()=>!0}r(o,"toNoArgVisit"),r(f,"toOneArgVisit"),r(u,"toOneArgVisitWithPath"),r(g,"toBeginVisit"),r(m,"toEndVisit");let l2=g(t3.onObjectBegin),y2=u(t3.onObjectProperty),E2=m(t3.onObjectEnd),w2=g(t3.onArrayBegin),C2=m(t3.onArrayEnd),S2=u(t3.onLiteralValue),I2=f(t3.onSeparator),N2=o(t3.onComment),O2=f(t3.onError),j2=i3&&i3.disallowComments,F2=i3&&i3.allowTrailingComma;function T(){for(;;){let e4=n2.scan();switch(n2.getTokenError()){case 4:k(14);break;case 5:k(15);break;case 3:k(13);break;case 1:j2||k(11);break;case 2:k(12);break;case 6:k(16)}switch(e4){case 12:case 13:j2?k(10):N2();break;case 16:k(1);break;case 15:case 14:break;default:return e4}}}function k(e4,t4=[],i4=[]){if(O2(e4),t4.length+i4.length>0){let e5=n2.getToken();for(;e5!==17;){if(t4.indexOf(e5)!==-1){T();break}if(i4.indexOf(e5)!==-1)break;e5=T()}}}function P(e4){let t4=n2.getTokenValue();return e4?S2(t4):(y2(t4),a2.push(t4)),T(),!0}function J(){switch(n2.getToken()){case 11:let e4=n2.getTokenValue(),t4=Number(e4);isNaN(t4)&&(k(2),t4=0),S2(t4);break;case 7:S2(null);break;case 8:S2(!0);break;case 9:S2(!1);break;default:return!1}return T(),!0}function V(){return n2.getToken()!==10?(k(3,[],[2,5]),!1):(P(!1),n2.getToken()===6?(I2(":"),T(),U()||k(4,[],[2,5])):k(5,[],[2,5]),a2.pop(),!0)}function z(){l2(),T();let e4=!1;for(;n2.getToken()!==2&&n2.getToken()!==17;){if(n2.getToken()===5){if(e4||k(4,[],[]),I2(","),T(),n2.getToken()===2&&F2)break}else e4&&k(6,[],[]);V()||k(4,[],[2,5]),e4=!0}return E2(),n2.getToken()!==2?k(7,[2],[]):T(),!0}function G(){w2(),T();let e4=!0,t4=!1;for(;n2.getToken()!==4&&n2.getToken()!==17;){if(n2.getToken()===5){if(t4||k(4,[],[]),I2(","),T(),n2.getToken()===4&&F2)break}else t4&&k(6,[],[]);e4?(a2.push(0),e4=!1):a2[a2.length-1]++,U()||k(4,[],[4,5]),t4=!0}return C2(),e4||a2.pop(),n2.getToken()!==4?k(8,[4],[]):T(),!0}function U(){switch(n2.getToken()){case 3:return G();case 1:return z();case 10:return P(!0);default:return J()}}return r(T,"scanNext"),r(k,"handleError"),r(P,"parseString"),r(J,"parseLiteral"),r(V,"parseProperty"),r(z,"parseObject"),r(G,"parseArray"),r(U,"parseValue"),T(),n2.getToken()===17?!!i3.allowEmptyContent||(k(4,[],[]),!1):U()?(n2.getToken()!==17&&k(9,[],[]),!0):(k(4,[],[]),!1)}new Array(W).fill(0).map((e3,t3)=>`
|
|
5
5
|
`+" ".repeat(t3)),new Array(W).fill(0).map((e3,t3)=>"\r"+" ".repeat(t3)),new Array(W).fill(0).map((e3,t3)=>`\r
|
package/dist/bundle/chunks/{jiti-static-loader-E6ANQD5T.js → jiti-static-loader-2RCDI6B4.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-JXWJOIH4.js";import{createRequire}from"node:module";var require2=createRequire(import.meta.url),createJitiImpl;function createJiti(...args){return createJitiImpl??=require2("jiti").createJiti,createJitiImpl(...args)}export{createJiti};
|