@probelabs/probe 0.6.0-rc314 → 0.6.0-rc316
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/bin/binaries/{probe-v0.6.0-rc314-aarch64-apple-darwin.tar.gz → probe-v0.6.0-rc316-aarch64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc314-aarch64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc316-aarch64-unknown-linux-musl.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc314-x86_64-apple-darwin.tar.gz → probe-v0.6.0-rc316-x86_64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc314-x86_64-pc-windows-msvc.zip → probe-v0.6.0-rc316-x86_64-pc-windows-msvc.zip} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc314-x86_64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc316-x86_64-unknown-linux-musl.tar.gz} +0 -0
- package/build/query.js +3 -1
- package/build/tools/common.js +2 -1
- package/build/tools/vercel.js +27 -8
- package/cjs/agent/ProbeAgent.cjs +252 -98
- package/cjs/index.cjs +252 -98
- package/package.json +1 -1
- package/src/query.js +3 -1
- package/src/tools/common.js +2 -1
- package/src/tools/vercel.js +27 -8
package/cjs/agent/ProbeAgent.cjs
CHANGED
|
@@ -16575,7 +16575,7 @@ function loadSetting({
|
|
|
16575
16575
|
}
|
|
16576
16576
|
if (typeof process === "undefined") {
|
|
16577
16577
|
throw new LoadSettingError({
|
|
16578
|
-
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables
|
|
16578
|
+
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables are not supported in this environment.`
|
|
16579
16579
|
});
|
|
16580
16580
|
}
|
|
16581
16581
|
settingValue = process.env[environmentVariableName];
|
|
@@ -17714,7 +17714,7 @@ var init_dist2 = __esm({
|
|
|
17714
17714
|
"ETIMEDOUT",
|
|
17715
17715
|
"EPIPE"
|
|
17716
17716
|
];
|
|
17717
|
-
VERSION = true ? "4.0.
|
|
17717
|
+
VERSION = true ? "4.0.26" : "0.0.0-test";
|
|
17718
17718
|
suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
17719
17719
|
suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
17720
17720
|
ignoreOverride = /* @__PURE__ */ Symbol(
|
|
@@ -19582,6 +19582,19 @@ var require_dist_cjs5 = __commonJS({
|
|
|
19582
19582
|
return out;
|
|
19583
19583
|
}
|
|
19584
19584
|
};
|
|
19585
|
+
var HEADER_VALUE_TYPE;
|
|
19586
|
+
(function(HEADER_VALUE_TYPE2) {
|
|
19587
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolTrue"] = 0] = "boolTrue";
|
|
19588
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolFalse"] = 1] = "boolFalse";
|
|
19589
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byte"] = 2] = "byte";
|
|
19590
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["short"] = 3] = "short";
|
|
19591
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["integer"] = 4] = "integer";
|
|
19592
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["long"] = 5] = "long";
|
|
19593
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byteArray"] = 6] = "byteArray";
|
|
19594
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["string"] = 7] = "string";
|
|
19595
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["timestamp"] = 8] = "timestamp";
|
|
19596
|
+
HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["uuid"] = 9] = "uuid";
|
|
19597
|
+
})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));
|
|
19585
19598
|
var BOOLEAN_TAG = "boolean";
|
|
19586
19599
|
var BYTE_TAG = "byte";
|
|
19587
19600
|
var SHORT_TAG = "short";
|
|
@@ -20453,12 +20466,15 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
|
|
|
20453
20466
|
const message = block.messages[j];
|
|
20454
20467
|
const isLastMessage = j === block.messages.length - 1;
|
|
20455
20468
|
const { content } = message;
|
|
20469
|
+
const hasReasoningBlocks = content.some(
|
|
20470
|
+
(part) => part.type === "reasoning"
|
|
20471
|
+
);
|
|
20456
20472
|
for (let k = 0; k < content.length; k++) {
|
|
20457
20473
|
const part = content[k];
|
|
20458
20474
|
const isLastContentPart = k === content.length - 1;
|
|
20459
20475
|
switch (part.type) {
|
|
20460
20476
|
case "text": {
|
|
20461
|
-
if (!part.text.trim()) {
|
|
20477
|
+
if (!part.text.trim() && !hasReasoningBlocks) {
|
|
20462
20478
|
break;
|
|
20463
20479
|
}
|
|
20464
20480
|
bedrockContent.push({
|
|
@@ -20499,7 +20515,9 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
|
|
|
20499
20515
|
}
|
|
20500
20516
|
}
|
|
20501
20517
|
});
|
|
20502
|
-
} else
|
|
20518
|
+
} else if (part.providerOptions == null || Object.keys(part.providerOptions).every(
|
|
20519
|
+
(k2) => k2 === "bedrock" || k2 === "amazonBedrock"
|
|
20520
|
+
)) {
|
|
20503
20521
|
bedrockContent.push({
|
|
20504
20522
|
reasoningContent: {
|
|
20505
20523
|
reasoningText: {
|
|
@@ -20645,9 +20663,10 @@ function getBase64Data(file2) {
|
|
|
20645
20663
|
}
|
|
20646
20664
|
return file2.data;
|
|
20647
20665
|
}
|
|
20648
|
-
function createSigV4FetchFunction(getCredentials, fetch2
|
|
20666
|
+
function createSigV4FetchFunction(getCredentials, fetch2) {
|
|
20649
20667
|
return async (input, init) => {
|
|
20650
20668
|
var _a17, _b16;
|
|
20669
|
+
const effectiveFetch = fetch2 != null ? fetch2 : globalThis.fetch;
|
|
20651
20670
|
const request = input instanceof Request ? input : void 0;
|
|
20652
20671
|
const originalHeaders = combineHeaders(
|
|
20653
20672
|
normalizeHeaders(request == null ? void 0 : request.headers),
|
|
@@ -20667,7 +20686,7 @@ function createSigV4FetchFunction(getCredentials, fetch2 = globalThis.fetch) {
|
|
|
20667
20686
|
}
|
|
20668
20687
|
const effectiveMethod = (_b16 = init == null ? void 0 : init.method) != null ? _b16 : request == null ? void 0 : request.method;
|
|
20669
20688
|
if ((effectiveMethod == null ? void 0 : effectiveMethod.toUpperCase()) !== "POST" || !effectiveBody) {
|
|
20670
|
-
return
|
|
20689
|
+
return effectiveFetch(input, {
|
|
20671
20690
|
...init,
|
|
20672
20691
|
headers: headersWithUserAgent
|
|
20673
20692
|
});
|
|
@@ -20689,7 +20708,7 @@ function createSigV4FetchFunction(getCredentials, fetch2 = globalThis.fetch) {
|
|
|
20689
20708
|
const signingResult = await signer.sign();
|
|
20690
20709
|
const signedHeaders = normalizeHeaders(signingResult.headers);
|
|
20691
20710
|
const combinedHeaders = combineHeaders(headersWithUserAgent, signedHeaders);
|
|
20692
|
-
return
|
|
20711
|
+
return effectiveFetch(input, {
|
|
20693
20712
|
...init,
|
|
20694
20713
|
body,
|
|
20695
20714
|
headers: combinedHeaders
|
|
@@ -20707,8 +20726,9 @@ function prepareBodyString(body) {
|
|
|
20707
20726
|
return JSON.stringify(body);
|
|
20708
20727
|
}
|
|
20709
20728
|
}
|
|
20710
|
-
function createApiKeyFetchFunction(apiKey, fetch2
|
|
20729
|
+
function createApiKeyFetchFunction(apiKey, fetch2) {
|
|
20711
20730
|
return async (input, init) => {
|
|
20731
|
+
const effectiveFetch = fetch2 != null ? fetch2 : globalThis.fetch;
|
|
20712
20732
|
const originalHeaders = normalizeHeaders(init == null ? void 0 : init.headers);
|
|
20713
20733
|
const headersWithUserAgent = withUserAgentSuffix(
|
|
20714
20734
|
originalHeaders,
|
|
@@ -20718,7 +20738,7 @@ function createApiKeyFetchFunction(apiKey, fetch2 = globalThis.fetch) {
|
|
|
20718
20738
|
const finalHeaders = combineHeaders(headersWithUserAgent, {
|
|
20719
20739
|
Authorization: `Bearer ${apiKey}`
|
|
20720
20740
|
});
|
|
20721
|
-
return
|
|
20741
|
+
return effectiveFetch(input, {
|
|
20722
20742
|
...init,
|
|
20723
20743
|
headers: finalHeaders
|
|
20724
20744
|
});
|
|
@@ -20765,7 +20785,7 @@ function createAmazonBedrock(options = {}) {
|
|
|
20765
20785
|
environmentVariableName: "AWS_SECRET_ACCESS_KEY",
|
|
20766
20786
|
description: "AWS secret access key"
|
|
20767
20787
|
}),
|
|
20768
|
-
sessionToken: loadOptionalSetting({
|
|
20788
|
+
sessionToken: options.accessKeyId != null && options.secretAccessKey != null ? options.sessionToken : loadOptionalSetting({
|
|
20769
20789
|
settingValue: options.sessionToken,
|
|
20770
20790
|
environmentVariableName: "AWS_SESSION_TOKEN"
|
|
20771
20791
|
})
|
|
@@ -20866,7 +20886,7 @@ Original error: ${errorMessage}`
|
|
|
20866
20886
|
provider.tools = import_internal.anthropicTools;
|
|
20867
20887
|
return provider;
|
|
20868
20888
|
}
|
|
20869
|
-
var import_internal, import_eventstream_codec, import_util_utf8, import_internal2, BEDROCK_STOP_REASONS, BEDROCK_IMAGE_MIME_TYPES, BEDROCK_DOCUMENT_MIME_TYPES, bedrockFilePartProviderOptions, amazonBedrockLanguageModelOptions, BedrockErrorSchema, createBedrockEventStreamResponseHandler, BedrockChatLanguageModel, BedrockStopReasonSchema, BedrockAdditionalModelResponseFieldsSchema, BedrockToolUseSchema, BedrockReasoningTextSchema, BedrockRedactedReasoningSchema, BedrockResponseSchema, BedrockStreamSchema,
|
|
20889
|
+
var import_internal, import_eventstream_codec, import_util_utf8, import_internal2, BEDROCK_STOP_REASONS, BEDROCK_IMAGE_MIME_TYPES, BEDROCK_DOCUMENT_MIME_TYPES, bedrockFilePartProviderOptions, amazonBedrockLanguageModelOptions, BedrockErrorSchema, createBedrockEventStreamResponseHandler, bedrockReasoningMetadataSchema, BedrockChatLanguageModel, BedrockStopReasonSchema, BedrockAdditionalModelResponseFieldsSchema, BedrockToolUseSchema, BedrockReasoningTextSchema, BedrockRedactedReasoningSchema, BedrockResponseSchema, BedrockStreamSchema, amazonBedrockEmbeddingModelOptionsSchema, BedrockEmbeddingModel, BedrockEmbeddingResponseSchema, modelMaxImagesPerCall, BedrockImageModel, bedrockImageResponseSchema, VERSION2, bedrockRerankingResponseSchema, amazonBedrockRerankingModelOptionsSchema, BedrockRerankingModel, bedrock;
|
|
20870
20890
|
var init_dist3 = __esm({
|
|
20871
20891
|
"node_modules/@ai-sdk/amazon-bedrock/dist/index.mjs"() {
|
|
20872
20892
|
import_internal = require("@ai-sdk/anthropic/internal");
|
|
@@ -20884,6 +20904,7 @@ var init_dist3 = __esm({
|
|
|
20884
20904
|
import_internal2 = require("@ai-sdk/anthropic/internal");
|
|
20885
20905
|
init_dist();
|
|
20886
20906
|
init_dist2();
|
|
20907
|
+
init_v4();
|
|
20887
20908
|
init_dist();
|
|
20888
20909
|
init_dist2();
|
|
20889
20910
|
init_v4();
|
|
@@ -20952,7 +20973,8 @@ var init_dist3 = __esm({
|
|
|
20952
20973
|
external_exports.literal("adaptive")
|
|
20953
20974
|
]).optional(),
|
|
20954
20975
|
budgetTokens: external_exports.number().optional(),
|
|
20955
|
-
maxReasoningEffort: external_exports.enum(["low", "medium", "high", "max"]).optional()
|
|
20976
|
+
maxReasoningEffort: external_exports.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
20977
|
+
display: external_exports.enum(["omitted", "summarized"]).optional()
|
|
20956
20978
|
}).optional(),
|
|
20957
20979
|
/**
|
|
20958
20980
|
* Anthropic beta features to enable
|
|
@@ -21011,6 +21033,10 @@ var init_dist3 = __esm({
|
|
|
21011
21033
|
)
|
|
21012
21034
|
};
|
|
21013
21035
|
};
|
|
21036
|
+
bedrockReasoningMetadataSchema = external_exports.object({
|
|
21037
|
+
signature: external_exports.string().optional(),
|
|
21038
|
+
redactedData: external_exports.string().optional()
|
|
21039
|
+
});
|
|
21014
21040
|
BedrockChatLanguageModel = class {
|
|
21015
21041
|
constructor(modelId, config2) {
|
|
21016
21042
|
this.modelId = modelId;
|
|
@@ -21036,7 +21062,7 @@ var init_dist3 = __esm({
|
|
|
21036
21062
|
toolChoice,
|
|
21037
21063
|
providerOptions
|
|
21038
21064
|
}) {
|
|
21039
|
-
var _a17, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
21065
|
+
var _a17, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
21040
21066
|
const bedrockOptions = (_a17 = await parseProviderOptions({
|
|
21041
21067
|
provider: "bedrock",
|
|
21042
21068
|
providerOptions,
|
|
@@ -21114,6 +21140,7 @@ var init_dist3 = __esm({
|
|
|
21114
21140
|
}
|
|
21115
21141
|
const thinkingType = (_e = bedrockOptions.reasoningConfig) == null ? void 0 : _e.type;
|
|
21116
21142
|
const thinkingBudget = thinkingType === "enabled" ? (_f = bedrockOptions.reasoningConfig) == null ? void 0 : _f.budgetTokens : void 0;
|
|
21143
|
+
const thinkingDisplay = thinkingType === "adaptive" ? (_g = bedrockOptions.reasoningConfig) == null ? void 0 : _g.display : void 0;
|
|
21117
21144
|
const isAnthropicThinkingEnabled = isAnthropicModel && isThinkingEnabled;
|
|
21118
21145
|
const inferenceConfig = {
|
|
21119
21146
|
...maxOutputTokens != null && { maxTokens: maxOutputTokens },
|
|
@@ -21140,12 +21167,13 @@ var init_dist3 = __esm({
|
|
|
21140
21167
|
bedrockOptions.additionalModelRequestFields = {
|
|
21141
21168
|
...bedrockOptions.additionalModelRequestFields,
|
|
21142
21169
|
thinking: {
|
|
21143
|
-
type: "adaptive"
|
|
21170
|
+
type: "adaptive",
|
|
21171
|
+
...thinkingDisplay != null && { display: thinkingDisplay }
|
|
21144
21172
|
}
|
|
21145
21173
|
};
|
|
21146
21174
|
}
|
|
21147
21175
|
} else if (!isAnthropicModel) {
|
|
21148
|
-
if (((
|
|
21176
|
+
if (((_h = bedrockOptions.reasoningConfig) == null ? void 0 : _h.budgetTokens) != null) {
|
|
21149
21177
|
warnings.push({
|
|
21150
21178
|
type: "unsupported",
|
|
21151
21179
|
feature: "budgetTokens",
|
|
@@ -21160,14 +21188,14 @@ var init_dist3 = __esm({
|
|
|
21160
21188
|
});
|
|
21161
21189
|
}
|
|
21162
21190
|
}
|
|
21163
|
-
const maxReasoningEffort = (
|
|
21191
|
+
const maxReasoningEffort = (_i = bedrockOptions.reasoningConfig) == null ? void 0 : _i.maxReasoningEffort;
|
|
21164
21192
|
const isOpenAIModel = this.modelId.startsWith("openai.");
|
|
21165
21193
|
if (maxReasoningEffort != null) {
|
|
21166
21194
|
if (isAnthropicModel) {
|
|
21167
21195
|
bedrockOptions.additionalModelRequestFields = {
|
|
21168
21196
|
...bedrockOptions.additionalModelRequestFields,
|
|
21169
21197
|
output_config: {
|
|
21170
|
-
...(
|
|
21198
|
+
...(_j = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _j.output_config,
|
|
21171
21199
|
effort: maxReasoningEffort
|
|
21172
21200
|
}
|
|
21173
21201
|
};
|
|
@@ -21191,7 +21219,7 @@ var init_dist3 = __esm({
|
|
|
21191
21219
|
bedrockOptions.additionalModelRequestFields = {
|
|
21192
21220
|
...bedrockOptions.additionalModelRequestFields,
|
|
21193
21221
|
output_config: {
|
|
21194
|
-
...(
|
|
21222
|
+
...(_k = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _k.output_config,
|
|
21195
21223
|
format: {
|
|
21196
21224
|
type: "json_schema",
|
|
21197
21225
|
schema: responseFormat.schema
|
|
@@ -21223,7 +21251,7 @@ var init_dist3 = __esm({
|
|
|
21223
21251
|
details: "topK is not supported when thinking is enabled"
|
|
21224
21252
|
});
|
|
21225
21253
|
}
|
|
21226
|
-
const hasAnyTools = ((
|
|
21254
|
+
const hasAnyTools = ((_m = (_l = toolConfig.tools) == null ? void 0 : _l.length) != null ? _m : 0) > 0 || additionalTools;
|
|
21227
21255
|
let filteredPrompt = prompt;
|
|
21228
21256
|
if (!hasAnyTools) {
|
|
21229
21257
|
const hasToolContent = prompt.some(
|
|
@@ -21318,7 +21346,7 @@ var init_dist3 = __esm({
|
|
|
21318
21346
|
const content = [];
|
|
21319
21347
|
let isJsonResponseFromTool = false;
|
|
21320
21348
|
for (const part of response.output.message.content) {
|
|
21321
|
-
if (part.text) {
|
|
21349
|
+
if (part.text != null) {
|
|
21322
21350
|
content.push({ type: "text", text: part.text });
|
|
21323
21351
|
}
|
|
21324
21352
|
if (part.reasoningContent) {
|
|
@@ -21612,6 +21640,13 @@ var init_dist3 = __esm({
|
|
|
21612
21640
|
delta: reasoningContent.text
|
|
21613
21641
|
});
|
|
21614
21642
|
} else if ("signature" in reasoningContent && reasoningContent.signature) {
|
|
21643
|
+
if (contentBlocks[blockIndex] == null) {
|
|
21644
|
+
contentBlocks[blockIndex] = { type: "reasoning" };
|
|
21645
|
+
controller.enqueue({
|
|
21646
|
+
type: "reasoning-start",
|
|
21647
|
+
id: String(blockIndex)
|
|
21648
|
+
});
|
|
21649
|
+
}
|
|
21615
21650
|
controller.enqueue({
|
|
21616
21651
|
type: "reasoning-delta",
|
|
21617
21652
|
id: String(blockIndex),
|
|
@@ -21623,6 +21658,13 @@ var init_dist3 = __esm({
|
|
|
21623
21658
|
}
|
|
21624
21659
|
});
|
|
21625
21660
|
} else if ("data" in reasoningContent && reasoningContent.data) {
|
|
21661
|
+
if (contentBlocks[blockIndex] == null) {
|
|
21662
|
+
contentBlocks[blockIndex] = { type: "reasoning" };
|
|
21663
|
+
controller.enqueue({
|
|
21664
|
+
type: "reasoning-start",
|
|
21665
|
+
id: String(blockIndex)
|
|
21666
|
+
});
|
|
21667
|
+
}
|
|
21626
21668
|
controller.enqueue({
|
|
21627
21669
|
type: "reasoning-delta",
|
|
21628
21670
|
id: String(blockIndex),
|
|
@@ -21727,7 +21769,7 @@ var init_dist3 = __esm({
|
|
|
21727
21769
|
BedrockToolUseSchema = external_exports.object({
|
|
21728
21770
|
toolUseId: external_exports.string(),
|
|
21729
21771
|
name: external_exports.string(),
|
|
21730
|
-
input: external_exports.unknown()
|
|
21772
|
+
input: external_exports.unknown().optional()
|
|
21731
21773
|
});
|
|
21732
21774
|
BedrockReasoningTextSchema = external_exports.object({
|
|
21733
21775
|
signature: external_exports.string().nullish(),
|
|
@@ -21822,10 +21864,6 @@ var init_dist3 = __esm({
|
|
|
21822
21864
|
throttlingException: external_exports.record(external_exports.string(), external_exports.unknown()).nullish(),
|
|
21823
21865
|
validationException: external_exports.record(external_exports.string(), external_exports.unknown()).nullish()
|
|
21824
21866
|
});
|
|
21825
|
-
bedrockReasoningMetadataSchema = external_exports.object({
|
|
21826
|
-
signature: external_exports.string().optional(),
|
|
21827
|
-
redactedData: external_exports.string().optional()
|
|
21828
|
-
});
|
|
21829
21867
|
amazonBedrockEmbeddingModelOptionsSchema = external_exports.object({
|
|
21830
21868
|
/**
|
|
21831
21869
|
* The number of dimensions the resulting output embeddings should have (defaults to 1024).
|
|
@@ -22185,7 +22223,7 @@ var init_dist3 = __esm({
|
|
|
22185
22223
|
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
22186
22224
|
preview: external_exports.unknown().optional()
|
|
22187
22225
|
});
|
|
22188
|
-
VERSION2 = true ? "4.0.
|
|
22226
|
+
VERSION2 = true ? "4.0.101" : "0.0.0-test";
|
|
22189
22227
|
bedrockRerankingResponseSchema = lazySchema(
|
|
22190
22228
|
() => zodSchema(
|
|
22191
22229
|
external_exports.object({
|
|
@@ -26603,6 +26641,7 @@ var init_query = __esm({
|
|
|
26603
26641
|
language: "--language",
|
|
26604
26642
|
ignore: "--ignore",
|
|
26605
26643
|
allowTests: "--allow-tests",
|
|
26644
|
+
withContext: "--with-context",
|
|
26606
26645
|
maxResults: "--max-results",
|
|
26607
26646
|
format: "--format"
|
|
26608
26647
|
};
|
|
@@ -28037,7 +28076,8 @@ var init_common = __esm({
|
|
|
28037
28076
|
pattern: external_exports2.string().describe("AST pattern to search for. Use $NAME for variable names, $$$PARAMS for parameter lists, etc."),
|
|
28038
28077
|
path: external_exports2.string().optional().default(".").describe("Path to search in"),
|
|
28039
28078
|
language: external_exports2.string().optional().default("rust").describe("Programming language to use for parsing"),
|
|
28040
|
-
allow_tests: external_exports2.boolean().optional().default(true).describe("Allow test files in search results")
|
|
28079
|
+
allow_tests: external_exports2.boolean().optional().default(true).describe("Allow test files in search results"),
|
|
28080
|
+
with_context: external_exports2.boolean().optional().default(false).describe("Include owning source-block context in JSON output")
|
|
28041
28081
|
});
|
|
28042
28082
|
extractSchema = external_exports2.object({
|
|
28043
28083
|
targets: external_exports2.string().optional().describe('File paths or symbols to extract from. Formats: "file.js" (whole file), "file.js:42" (line 42), "file.js:10-20" (lines 10-20), "file.js#funcName" (symbol). Multiple targets separated by spaces.'),
|
|
@@ -28224,9 +28264,16 @@ function autoQuoteSearchTerms(query2) {
|
|
|
28224
28264
|
return result.join(" ");
|
|
28225
28265
|
}
|
|
28226
28266
|
async function checkDelegateDedup(newQuery, previousQueries, model, debug) {
|
|
28227
|
-
if (
|
|
28267
|
+
if (previousQueries.length === 0) {
|
|
28228
28268
|
return { action: "allow", reason: "no previous queries" };
|
|
28229
28269
|
}
|
|
28270
|
+
if (!model) {
|
|
28271
|
+
return {
|
|
28272
|
+
action: "allow",
|
|
28273
|
+
reason: "dedup model unavailable",
|
|
28274
|
+
error: "dedup_model_unavailable"
|
|
28275
|
+
};
|
|
28276
|
+
}
|
|
28230
28277
|
const previousList = previousQueries.map((q, i) => {
|
|
28231
28278
|
let line = `${i + 1}. "${q.query}" (path: ${q.path}, found results: ${q.hadResults})`;
|
|
28232
28279
|
if (q.reason) line += `
|
|
@@ -28282,11 +28329,18 @@ Examples:
|
|
|
28282
28329
|
return { action: "block", reason: parts[1]?.trim() || "duplicate query" };
|
|
28283
28330
|
} else if (action === "rewrite" && parts[2]) {
|
|
28284
28331
|
return { action: "rewrite", reason: parts[1]?.trim() || "refined query", rewritten: parts[2].trim() };
|
|
28332
|
+
} else if (action === "allow") {
|
|
28333
|
+
return { action: "allow", reason: parts[1]?.trim() || "new concept" };
|
|
28285
28334
|
}
|
|
28286
|
-
return {
|
|
28335
|
+
return {
|
|
28336
|
+
action: "allow",
|
|
28337
|
+
reason: "dedup returned unparseable response",
|
|
28338
|
+
error: `unexpected_response:${line.slice(0, 200)}`
|
|
28339
|
+
};
|
|
28287
28340
|
} catch (err) {
|
|
28288
|
-
|
|
28289
|
-
|
|
28341
|
+
const errorMessage = err instanceof Error ? `${err.name}: ${err.message}` : String(err);
|
|
28342
|
+
if (debug) console.error("[DEDUP-LLM] Error:", errorMessage);
|
|
28343
|
+
return { action: "allow", reason: "dedup check failed", error: errorMessage };
|
|
28290
28344
|
}
|
|
28291
28345
|
}
|
|
28292
28346
|
function normalizeTargets(targets) {
|
|
@@ -28728,9 +28782,9 @@ Change your strategy:${scopeHint}
|
|
|
28728
28782
|
const delegatePath = searchPath || "";
|
|
28729
28783
|
let effectiveQuery = searchQuery;
|
|
28730
28784
|
if (previousDelegations.length > 0) {
|
|
28785
|
+
const dedupProvider = options.searchDelegateProvider || process.env.PROBE_SEARCH_DELEGATE_PROVIDER || options.provider || process.env.FORCE_PROVIDER || null;
|
|
28786
|
+
const dedupModelName = options.searchDelegateModel || process.env.PROBE_SEARCH_DELEGATE_MODEL || options.model || process.env.MODEL_NAME || null;
|
|
28731
28787
|
if (cachedDedupModel === void 0) {
|
|
28732
|
-
const dedupProvider = options.searchDelegateProvider || process.env.PROBE_SEARCH_DELEGATE_PROVIDER || options.provider || process.env.FORCE_PROVIDER || null;
|
|
28733
|
-
const dedupModelName = options.searchDelegateModel || process.env.PROBE_SEARCH_DELEGATE_MODEL || options.model || process.env.MODEL_NAME || null;
|
|
28734
28788
|
if (debug) {
|
|
28735
28789
|
console.error(`[DEDUP-LLM] Creating model: provider=${dedupProvider}, model=${dedupModelName}`);
|
|
28736
28790
|
}
|
|
@@ -28742,7 +28796,10 @@ Change your strategy:${scopeHint}
|
|
|
28742
28796
|
const dedupSpanAttrs = {
|
|
28743
28797
|
"dedup.query": searchQuery,
|
|
28744
28798
|
"dedup.previous_count": String(previousDelegations.length),
|
|
28745
|
-
"dedup.previous_queries": previousDelegations.map((d) => d.query).join(" | ")
|
|
28799
|
+
"dedup.previous_queries": previousDelegations.map((d) => d.query).join(" | "),
|
|
28800
|
+
"dedup.provider": dedupProvider || "",
|
|
28801
|
+
"dedup.model": dedupModelName || "",
|
|
28802
|
+
"dedup.model_available": cachedDedupModel ? "true" : "false"
|
|
28746
28803
|
};
|
|
28747
28804
|
const dedup = options.tracer?.withSpan ? await options.tracer.withSpan("search.delegate.dedup", async () => {
|
|
28748
28805
|
return await checkDelegateDedup(searchQuery, previousDelegations, cachedDedupModel, debug);
|
|
@@ -28750,7 +28807,8 @@ Change your strategy:${scopeHint}
|
|
|
28750
28807
|
span.setAttributes({
|
|
28751
28808
|
"dedup.action": result.action,
|
|
28752
28809
|
"dedup.reason": result.reason || "",
|
|
28753
|
-
"dedup.rewritten": result.rewritten || ""
|
|
28810
|
+
"dedup.rewritten": result.rewritten || "",
|
|
28811
|
+
"dedup.error": result.error || ""
|
|
28754
28812
|
});
|
|
28755
28813
|
}) : await checkDelegateDedup(searchQuery, previousDelegations, cachedDedupModel, debug);
|
|
28756
28814
|
if (debug) {
|
|
@@ -28892,7 +28950,7 @@ Do NOT search for analogies or loosely related concepts. If the feature does not
|
|
|
28892
28950
|
name: "query",
|
|
28893
28951
|
description: queryDescription,
|
|
28894
28952
|
inputSchema: querySchema,
|
|
28895
|
-
execute: async ({ pattern, path: path9, language, allow_tests }) => {
|
|
28953
|
+
execute: async ({ pattern, path: path9, language, allow_tests, with_context }) => {
|
|
28896
28954
|
try {
|
|
28897
28955
|
let queryPaths;
|
|
28898
28956
|
if (path9) {
|
|
@@ -28912,6 +28970,7 @@ Do NOT search for analogies or loosely related concepts. If the feature does not
|
|
|
28912
28970
|
// Working directory for resolving relative paths
|
|
28913
28971
|
language,
|
|
28914
28972
|
allowTests: allow_tests ?? true,
|
|
28973
|
+
withContext: with_context ?? false,
|
|
28915
28974
|
json: false
|
|
28916
28975
|
});
|
|
28917
28976
|
return results;
|
|
@@ -42325,13 +42384,15 @@ var require_brace_expansion = __commonJS({
|
|
|
42325
42384
|
parts.push.apply(parts, p);
|
|
42326
42385
|
return parts;
|
|
42327
42386
|
}
|
|
42328
|
-
function expandTop(str) {
|
|
42387
|
+
function expandTop(str, options) {
|
|
42329
42388
|
if (!str)
|
|
42330
42389
|
return [];
|
|
42390
|
+
options = options || {};
|
|
42391
|
+
var max = options.max == null ? Infinity : options.max;
|
|
42331
42392
|
if (str.substr(0, 2) === "{}") {
|
|
42332
42393
|
str = "\\{\\}" + str.substr(2);
|
|
42333
42394
|
}
|
|
42334
|
-
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
42395
|
+
return expand2(escapeBraces(str), max, true).map(unescapeBraces);
|
|
42335
42396
|
}
|
|
42336
42397
|
function embrace(str) {
|
|
42337
42398
|
return "{" + str + "}";
|
|
@@ -42345,14 +42406,14 @@ var require_brace_expansion = __commonJS({
|
|
|
42345
42406
|
function gte(i, y) {
|
|
42346
42407
|
return i >= y;
|
|
42347
42408
|
}
|
|
42348
|
-
function expand2(str, isTop) {
|
|
42409
|
+
function expand2(str, max, isTop) {
|
|
42349
42410
|
var expansions = [];
|
|
42350
42411
|
var m = balanced("{", "}", str);
|
|
42351
42412
|
if (!m) return [str];
|
|
42352
42413
|
var pre = m.pre;
|
|
42353
|
-
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
42414
|
+
var post = m.post.length ? expand2(m.post, max, false) : [""];
|
|
42354
42415
|
if (/\$$/.test(m.pre)) {
|
|
42355
|
-
for (var k = 0; k < post.length; k++) {
|
|
42416
|
+
for (var k = 0; k < post.length && k < max; k++) {
|
|
42356
42417
|
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
42357
42418
|
expansions.push(expansion);
|
|
42358
42419
|
}
|
|
@@ -42364,7 +42425,7 @@ var require_brace_expansion = __commonJS({
|
|
|
42364
42425
|
if (!isSequence && !isOptions) {
|
|
42365
42426
|
if (m.post.match(/,(?!,).*\}/)) {
|
|
42366
42427
|
str = m.pre + "{" + m.body + escClose + m.post;
|
|
42367
|
-
return expand2(str);
|
|
42428
|
+
return expand2(str, max, true);
|
|
42368
42429
|
}
|
|
42369
42430
|
return [str];
|
|
42370
42431
|
}
|
|
@@ -42374,7 +42435,7 @@ var require_brace_expansion = __commonJS({
|
|
|
42374
42435
|
} else {
|
|
42375
42436
|
n = parseCommaParts(m.body);
|
|
42376
42437
|
if (n.length === 1) {
|
|
42377
|
-
n = expand2(n[0], false).map(embrace);
|
|
42438
|
+
n = expand2(n[0], max, false).map(embrace);
|
|
42378
42439
|
if (n.length === 1) {
|
|
42379
42440
|
return post.map(function(p) {
|
|
42380
42441
|
return m.pre + n[0] + p;
|
|
@@ -42420,11 +42481,11 @@ var require_brace_expansion = __commonJS({
|
|
|
42420
42481
|
} else {
|
|
42421
42482
|
N = [];
|
|
42422
42483
|
for (var j = 0; j < n.length; j++) {
|
|
42423
|
-
N.push.apply(N, expand2(n[j], false));
|
|
42484
|
+
N.push.apply(N, expand2(n[j], max, false));
|
|
42424
42485
|
}
|
|
42425
42486
|
}
|
|
42426
42487
|
for (var j = 0; j < N.length; j++) {
|
|
42427
|
-
for (var k = 0; k < post.length; k++) {
|
|
42488
|
+
for (var k = 0; k < post.length && expansions.length < max; k++) {
|
|
42428
42489
|
var expansion = pre + N[j] + post[k];
|
|
42429
42490
|
if (!isTop || isSequence || expansion)
|
|
42430
42491
|
expansions.push(expansion);
|
|
@@ -85239,6 +85300,9 @@ var require_utils2 = __commonJS({
|
|
|
85239
85300
|
"use strict";
|
|
85240
85301
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
85241
85302
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
85303
|
+
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
85304
|
+
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
85305
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
85242
85306
|
function stringArrayToHexStripped(input) {
|
|
85243
85307
|
let acc = "";
|
|
85244
85308
|
let code = 0;
|
|
@@ -85431,27 +85495,77 @@ var require_utils2 = __commonJS({
|
|
|
85431
85495
|
}
|
|
85432
85496
|
return output.join("");
|
|
85433
85497
|
}
|
|
85434
|
-
|
|
85435
|
-
|
|
85436
|
-
|
|
85437
|
-
|
|
85438
|
-
|
|
85439
|
-
|
|
85440
|
-
|
|
85441
|
-
|
|
85442
|
-
|
|
85443
|
-
|
|
85498
|
+
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
85499
|
+
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
85500
|
+
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
85501
|
+
function reescapeHostDelimiters(host, isIP) {
|
|
85502
|
+
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
85503
|
+
re.lastIndex = 0;
|
|
85504
|
+
return host.replace(re, (ch) => HOST_DELIMS[ch]);
|
|
85505
|
+
}
|
|
85506
|
+
function normalizePercentEncoding(input, decodeUnreserved = false) {
|
|
85507
|
+
if (input.indexOf("%") === -1) {
|
|
85508
|
+
return input;
|
|
85444
85509
|
}
|
|
85445
|
-
|
|
85446
|
-
|
|
85510
|
+
let output = "";
|
|
85511
|
+
for (let i = 0; i < input.length; i++) {
|
|
85512
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
85513
|
+
const hex = input.slice(i + 1, i + 3);
|
|
85514
|
+
if (isHexPair(hex)) {
|
|
85515
|
+
const normalizedHex = hex.toUpperCase();
|
|
85516
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
85517
|
+
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
85518
|
+
output += decoded;
|
|
85519
|
+
} else {
|
|
85520
|
+
output += "%" + normalizedHex;
|
|
85521
|
+
}
|
|
85522
|
+
i += 2;
|
|
85523
|
+
continue;
|
|
85524
|
+
}
|
|
85525
|
+
}
|
|
85526
|
+
output += input[i];
|
|
85447
85527
|
}
|
|
85448
|
-
|
|
85449
|
-
|
|
85528
|
+
return output;
|
|
85529
|
+
}
|
|
85530
|
+
function normalizePathEncoding(input) {
|
|
85531
|
+
let output = "";
|
|
85532
|
+
for (let i = 0; i < input.length; i++) {
|
|
85533
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
85534
|
+
const hex = input.slice(i + 1, i + 3);
|
|
85535
|
+
if (isHexPair(hex)) {
|
|
85536
|
+
const normalizedHex = hex.toUpperCase();
|
|
85537
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
85538
|
+
if (decoded !== "." && isUnreserved(decoded)) {
|
|
85539
|
+
output += decoded;
|
|
85540
|
+
} else {
|
|
85541
|
+
output += "%" + normalizedHex;
|
|
85542
|
+
}
|
|
85543
|
+
i += 2;
|
|
85544
|
+
continue;
|
|
85545
|
+
}
|
|
85546
|
+
}
|
|
85547
|
+
if (isPathCharacter(input[i])) {
|
|
85548
|
+
output += input[i];
|
|
85549
|
+
} else {
|
|
85550
|
+
output += escape(input[i]);
|
|
85551
|
+
}
|
|
85450
85552
|
}
|
|
85451
|
-
|
|
85452
|
-
|
|
85553
|
+
return output;
|
|
85554
|
+
}
|
|
85555
|
+
function escapePreservingEscapes(input) {
|
|
85556
|
+
let output = "";
|
|
85557
|
+
for (let i = 0; i < input.length; i++) {
|
|
85558
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
85559
|
+
const hex = input.slice(i + 1, i + 3);
|
|
85560
|
+
if (isHexPair(hex)) {
|
|
85561
|
+
output += "%" + hex.toUpperCase();
|
|
85562
|
+
i += 2;
|
|
85563
|
+
continue;
|
|
85564
|
+
}
|
|
85565
|
+
}
|
|
85566
|
+
output += escape(input[i]);
|
|
85453
85567
|
}
|
|
85454
|
-
return
|
|
85568
|
+
return output;
|
|
85455
85569
|
}
|
|
85456
85570
|
function recomposeAuthority(component) {
|
|
85457
85571
|
const uriTokens = [];
|
|
@@ -85466,7 +85580,7 @@ var require_utils2 = __commonJS({
|
|
|
85466
85580
|
if (ipV6res.isIPV6 === true) {
|
|
85467
85581
|
host = `[${ipV6res.escapedHost}]`;
|
|
85468
85582
|
} else {
|
|
85469
|
-
host =
|
|
85583
|
+
host = reescapeHostDelimiters(host, false);
|
|
85470
85584
|
}
|
|
85471
85585
|
}
|
|
85472
85586
|
uriTokens.push(host);
|
|
@@ -85480,7 +85594,10 @@ var require_utils2 = __commonJS({
|
|
|
85480
85594
|
module2.exports = {
|
|
85481
85595
|
nonSimpleDomain,
|
|
85482
85596
|
recomposeAuthority,
|
|
85483
|
-
|
|
85597
|
+
reescapeHostDelimiters,
|
|
85598
|
+
normalizePercentEncoding,
|
|
85599
|
+
normalizePathEncoding,
|
|
85600
|
+
escapePreservingEscapes,
|
|
85484
85601
|
removeDotSegments,
|
|
85485
85602
|
isIPv4,
|
|
85486
85603
|
isUUID,
|
|
@@ -85704,12 +85821,12 @@ var require_schemes = __commonJS({
|
|
|
85704
85821
|
var require_fast_uri = __commonJS({
|
|
85705
85822
|
"node_modules/fast-uri/index.js"(exports2, module2) {
|
|
85706
85823
|
"use strict";
|
|
85707
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority,
|
|
85824
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils2();
|
|
85708
85825
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
85709
85826
|
function normalize4(uri, options) {
|
|
85710
85827
|
if (typeof uri === "string") {
|
|
85711
85828
|
uri = /** @type {T} */
|
|
85712
|
-
|
|
85829
|
+
normalizeString(uri, options);
|
|
85713
85830
|
} else if (typeof uri === "object") {
|
|
85714
85831
|
uri = /** @type {T} */
|
|
85715
85832
|
parse11(serialize(uri, options), options);
|
|
@@ -85776,19 +85893,9 @@ var require_fast_uri = __commonJS({
|
|
|
85776
85893
|
return target;
|
|
85777
85894
|
}
|
|
85778
85895
|
function equal(uriA, uriB, options) {
|
|
85779
|
-
|
|
85780
|
-
|
|
85781
|
-
|
|
85782
|
-
} else if (typeof uriA === "object") {
|
|
85783
|
-
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
85784
|
-
}
|
|
85785
|
-
if (typeof uriB === "string") {
|
|
85786
|
-
uriB = unescape(uriB);
|
|
85787
|
-
uriB = serialize(normalizeComponentEncoding(parse11(uriB, options), true), { ...options, skipEscape: true });
|
|
85788
|
-
} else if (typeof uriB === "object") {
|
|
85789
|
-
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
85790
|
-
}
|
|
85791
|
-
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
85896
|
+
const normalizedA = normalizeComparableURI(uriA, options);
|
|
85897
|
+
const normalizedB = normalizeComparableURI(uriB, options);
|
|
85898
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
85792
85899
|
}
|
|
85793
85900
|
function serialize(cmpts, opts) {
|
|
85794
85901
|
const component = {
|
|
@@ -85813,12 +85920,12 @@ var require_fast_uri = __commonJS({
|
|
|
85813
85920
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
85814
85921
|
if (component.path !== void 0) {
|
|
85815
85922
|
if (!options.skipEscape) {
|
|
85816
|
-
component.path =
|
|
85923
|
+
component.path = escapePreservingEscapes(component.path);
|
|
85817
85924
|
if (component.scheme !== void 0) {
|
|
85818
85925
|
component.path = component.path.split("%3A").join(":");
|
|
85819
85926
|
}
|
|
85820
85927
|
} else {
|
|
85821
|
-
component.path =
|
|
85928
|
+
component.path = normalizePercentEncoding(component.path);
|
|
85822
85929
|
}
|
|
85823
85930
|
}
|
|
85824
85931
|
if (options.reference !== "suffix" && component.scheme) {
|
|
@@ -85853,7 +85960,16 @@ var require_fast_uri = __commonJS({
|
|
|
85853
85960
|
return uriTokens.join("");
|
|
85854
85961
|
}
|
|
85855
85962
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
85856
|
-
function
|
|
85963
|
+
function getParseError(parsed, matches) {
|
|
85964
|
+
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
85965
|
+
return 'URI path must start with "/" when authority is present.';
|
|
85966
|
+
}
|
|
85967
|
+
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
85968
|
+
return "URI port is malformed.";
|
|
85969
|
+
}
|
|
85970
|
+
return void 0;
|
|
85971
|
+
}
|
|
85972
|
+
function parseWithStatus(uri, opts) {
|
|
85857
85973
|
const options = Object.assign({}, opts);
|
|
85858
85974
|
const parsed = {
|
|
85859
85975
|
scheme: void 0,
|
|
@@ -85864,6 +85980,7 @@ var require_fast_uri = __commonJS({
|
|
|
85864
85980
|
query: void 0,
|
|
85865
85981
|
fragment: void 0
|
|
85866
85982
|
};
|
|
85983
|
+
let malformedAuthorityOrPort = false;
|
|
85867
85984
|
let isIP = false;
|
|
85868
85985
|
if (options.reference === "suffix") {
|
|
85869
85986
|
if (options.scheme) {
|
|
@@ -85884,6 +86001,11 @@ var require_fast_uri = __commonJS({
|
|
|
85884
86001
|
if (isNaN(parsed.port)) {
|
|
85885
86002
|
parsed.port = matches[5];
|
|
85886
86003
|
}
|
|
86004
|
+
const parseError = getParseError(parsed, matches);
|
|
86005
|
+
if (parseError !== void 0) {
|
|
86006
|
+
parsed.error = parsed.error || parseError;
|
|
86007
|
+
malformedAuthorityOrPort = true;
|
|
86008
|
+
}
|
|
85887
86009
|
if (parsed.host) {
|
|
85888
86010
|
const ipv4result = isIPv4(parsed.host);
|
|
85889
86011
|
if (ipv4result === false) {
|
|
@@ -85922,14 +86044,18 @@ var require_fast_uri = __commonJS({
|
|
|
85922
86044
|
parsed.scheme = unescape(parsed.scheme);
|
|
85923
86045
|
}
|
|
85924
86046
|
if (parsed.host !== void 0) {
|
|
85925
|
-
parsed.host = unescape(parsed.host);
|
|
86047
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
85926
86048
|
}
|
|
85927
86049
|
}
|
|
85928
86050
|
if (parsed.path) {
|
|
85929
|
-
parsed.path =
|
|
86051
|
+
parsed.path = normalizePathEncoding(parsed.path);
|
|
85930
86052
|
}
|
|
85931
86053
|
if (parsed.fragment) {
|
|
85932
|
-
|
|
86054
|
+
try {
|
|
86055
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
86056
|
+
} catch {
|
|
86057
|
+
parsed.error = parsed.error || "URI malformed";
|
|
86058
|
+
}
|
|
85933
86059
|
}
|
|
85934
86060
|
}
|
|
85935
86061
|
if (schemeHandler && schemeHandler.parse) {
|
|
@@ -85938,7 +86064,29 @@ var require_fast_uri = __commonJS({
|
|
|
85938
86064
|
} else {
|
|
85939
86065
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
85940
86066
|
}
|
|
85941
|
-
return parsed;
|
|
86067
|
+
return { parsed, malformedAuthorityOrPort };
|
|
86068
|
+
}
|
|
86069
|
+
function parse11(uri, opts) {
|
|
86070
|
+
return parseWithStatus(uri, opts).parsed;
|
|
86071
|
+
}
|
|
86072
|
+
function normalizeString(uri, opts) {
|
|
86073
|
+
return normalizeStringWithStatus(uri, opts).normalized;
|
|
86074
|
+
}
|
|
86075
|
+
function normalizeStringWithStatus(uri, opts) {
|
|
86076
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
86077
|
+
return {
|
|
86078
|
+
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
86079
|
+
malformedAuthorityOrPort
|
|
86080
|
+
};
|
|
86081
|
+
}
|
|
86082
|
+
function normalizeComparableURI(uri, opts) {
|
|
86083
|
+
if (typeof uri === "string") {
|
|
86084
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
86085
|
+
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
86086
|
+
}
|
|
86087
|
+
if (typeof uri === "object") {
|
|
86088
|
+
return serialize(uri, opts);
|
|
86089
|
+
}
|
|
85942
86090
|
}
|
|
85943
86091
|
var fastUri = {
|
|
85944
86092
|
SCHEMES,
|
|
@@ -86078,7 +86226,7 @@ var require_core = __commonJS({
|
|
|
86078
86226
|
constructor(opts = {}) {
|
|
86079
86227
|
this.schemas = {};
|
|
86080
86228
|
this.refs = {};
|
|
86081
|
-
this.formats =
|
|
86229
|
+
this.formats = /* @__PURE__ */ Object.create(null);
|
|
86082
86230
|
this._compilations = /* @__PURE__ */ new Set();
|
|
86083
86231
|
this._loading = {};
|
|
86084
86232
|
this._cache = /* @__PURE__ */ new Map();
|
|
@@ -91845,6 +91993,8 @@ var require_Alias = __commonJS({
|
|
|
91845
91993
|
* instance of the `source` anchor before this node.
|
|
91846
91994
|
*/
|
|
91847
91995
|
resolve(doc, ctx) {
|
|
91996
|
+
if (ctx?.maxAliasCount === 0)
|
|
91997
|
+
throw new ReferenceError("Alias resolution is disabled");
|
|
91848
91998
|
let nodes;
|
|
91849
91999
|
if (ctx?.aliasResolveCache) {
|
|
91850
92000
|
nodes = ctx.aliasResolveCache;
|
|
@@ -92917,18 +93067,18 @@ var require_merge2 = __commonJS({
|
|
|
92917
93067
|
};
|
|
92918
93068
|
var isMergeKey = (ctx, key) => (merge2.identify(key) || identity2.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge2.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge2.tag && tag.default);
|
|
92919
93069
|
function addMergeToJSMap(ctx, map3, value) {
|
|
92920
|
-
|
|
92921
|
-
if (identity2.isSeq(
|
|
92922
|
-
for (const it of
|
|
93070
|
+
const source = resolveAliasValue(ctx, value);
|
|
93071
|
+
if (identity2.isSeq(source))
|
|
93072
|
+
for (const it of source.items)
|
|
92923
93073
|
mergeValue(ctx, map3, it);
|
|
92924
|
-
else if (Array.isArray(
|
|
92925
|
-
for (const it of
|
|
93074
|
+
else if (Array.isArray(source))
|
|
93075
|
+
for (const it of source)
|
|
92926
93076
|
mergeValue(ctx, map3, it);
|
|
92927
93077
|
else
|
|
92928
|
-
mergeValue(ctx, map3,
|
|
93078
|
+
mergeValue(ctx, map3, source);
|
|
92929
93079
|
}
|
|
92930
93080
|
function mergeValue(ctx, map3, value) {
|
|
92931
|
-
const source = ctx
|
|
93081
|
+
const source = resolveAliasValue(ctx, value);
|
|
92932
93082
|
if (!identity2.isMap(source))
|
|
92933
93083
|
throw new Error("Merge sources must be maps or map aliases");
|
|
92934
93084
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
@@ -92949,6 +93099,9 @@ var require_merge2 = __commonJS({
|
|
|
92949
93099
|
}
|
|
92950
93100
|
return map3;
|
|
92951
93101
|
}
|
|
93102
|
+
function resolveAliasValue(ctx, value) {
|
|
93103
|
+
return ctx && identity2.isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
|
|
93104
|
+
}
|
|
92952
93105
|
exports2.addMergeToJSMap = addMergeToJSMap;
|
|
92953
93106
|
exports2.isMergeKey = isMergeKey;
|
|
92954
93107
|
exports2.merge = merge2;
|
|
@@ -93586,7 +93739,7 @@ var require_stringifyNumber = __commonJS({
|
|
|
93586
93739
|
if (!isFinite(num))
|
|
93587
93740
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
93588
93741
|
let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
93589
|
-
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") &&
|
|
93742
|
+
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) {
|
|
93590
93743
|
let i = n.indexOf(".");
|
|
93591
93744
|
if (i < 0) {
|
|
93592
93745
|
i = n.length;
|
|
@@ -95958,7 +96111,7 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
95958
96111
|
while (next === " " || next === " ")
|
|
95959
96112
|
next = source[++i + 1];
|
|
95960
96113
|
} else if (next === "x" || next === "u" || next === "U") {
|
|
95961
|
-
const length =
|
|
96114
|
+
const length = next === "x" ? 2 : next === "u" ? 4 : 8;
|
|
95962
96115
|
res += parseCharCode(source, i + 1, length, onError);
|
|
95963
96116
|
i += length;
|
|
95964
96117
|
} else {
|
|
@@ -96033,12 +96186,13 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
96033
96186
|
const cc2 = source.substr(offset2, length);
|
|
96034
96187
|
const ok = cc2.length === length && /^[0-9a-fA-F]+$/.test(cc2);
|
|
96035
96188
|
const code = ok ? parseInt(cc2, 16) : NaN;
|
|
96036
|
-
|
|
96189
|
+
try {
|
|
96190
|
+
return String.fromCodePoint(code);
|
|
96191
|
+
} catch {
|
|
96037
96192
|
const raw = source.substr(offset2 - 2, length + 2);
|
|
96038
96193
|
onError(offset2 - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
|
|
96039
96194
|
return raw;
|
|
96040
96195
|
}
|
|
96041
|
-
return String.fromCodePoint(code);
|
|
96042
96196
|
}
|
|
96043
96197
|
exports2.resolveFlowScalar = resolveFlowScalar;
|
|
96044
96198
|
}
|