@artemiskit/cli 0.2.2 → 0.2.4
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 +85 -0
- package/dist/index.js +1800 -777
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/commands/history.d.ts.map +1 -1
- package/dist/src/commands/redteam.d.ts.map +1 -1
- package/dist/src/commands/run.d.ts.map +1 -1
- package/dist/src/commands/stress.d.ts.map +1 -1
- package/dist/src/commands/validate.d.ts +6 -0
- package/dist/src/commands/validate.d.ts.map +1 -0
- package/package.json +6 -6
- package/src/cli.ts +2 -0
- package/src/commands/history.ts +58 -9
- package/src/commands/redteam.ts +28 -1
- package/src/commands/run.ts +121 -3
- package/src/commands/stress.ts +28 -0
- package/src/commands/validate.ts +254 -0
package/dist/index.js
CHANGED
|
@@ -39160,6 +39160,7 @@ __export(exports_dist, {
|
|
|
39160
39160
|
TestCaseSchema: () => TestCaseSchema,
|
|
39161
39161
|
SupabaseStorageAdapter: () => SupabaseStorageAdapter,
|
|
39162
39162
|
SimilarityEvaluator: () => SimilarityEvaluator,
|
|
39163
|
+
ScenarioValidator: () => ScenarioValidator,
|
|
39163
39164
|
ScenarioSchema: () => ScenarioSchema,
|
|
39164
39165
|
SUPPORTED_EXPRESSIONS: () => SUPPORTED_EXPRESSIONS,
|
|
39165
39166
|
RegexEvaluator: () => RegexEvaluator,
|
|
@@ -39201,6 +39202,7 @@ import { formatWithOptions } from "util";
|
|
|
39201
39202
|
import { sep } from "path";
|
|
39202
39203
|
import g$1 from "process";
|
|
39203
39204
|
import * as tty2 from "tty";
|
|
39205
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
39204
39206
|
function setErrorMap2(map8) {
|
|
39205
39207
|
overrideErrorMap2 = map8;
|
|
39206
39208
|
}
|
|
@@ -41104,7 +41106,7 @@ async function parseScenarioFile(filePath) {
|
|
|
41104
41106
|
}
|
|
41105
41107
|
function parseScenarioString(content, source) {
|
|
41106
41108
|
try {
|
|
41107
|
-
const raw =
|
|
41109
|
+
const raw = import_yaml2.parse(content);
|
|
41108
41110
|
const expanded = expandEnvVars2(raw);
|
|
41109
41111
|
const result = ScenarioSchema.safeParse(expanded);
|
|
41110
41112
|
if (!result.success) {
|
|
@@ -41618,6 +41620,136 @@ function nanoid(size = 21) {
|
|
|
41618
41620
|
}
|
|
41619
41621
|
return id;
|
|
41620
41622
|
}
|
|
41623
|
+
function getModelPricing(model) {
|
|
41624
|
+
if (MODEL_PRICING[model]) {
|
|
41625
|
+
return MODEL_PRICING[model];
|
|
41626
|
+
}
|
|
41627
|
+
const lowerModel = model.toLowerCase();
|
|
41628
|
+
for (const [key, pricing] of Object.entries(MODEL_PRICING)) {
|
|
41629
|
+
if (key.toLowerCase() === lowerModel) {
|
|
41630
|
+
return pricing;
|
|
41631
|
+
}
|
|
41632
|
+
}
|
|
41633
|
+
if (lowerModel.includes("gpt-5.2")) {
|
|
41634
|
+
return MODEL_PRICING["gpt-5.2"];
|
|
41635
|
+
}
|
|
41636
|
+
if (lowerModel.includes("gpt-5.1")) {
|
|
41637
|
+
return MODEL_PRICING["gpt-5.1"];
|
|
41638
|
+
}
|
|
41639
|
+
if (lowerModel.includes("gpt-5-mini")) {
|
|
41640
|
+
return MODEL_PRICING["gpt-5-mini"];
|
|
41641
|
+
}
|
|
41642
|
+
if (lowerModel.includes("gpt-5-nano")) {
|
|
41643
|
+
return MODEL_PRICING["gpt-5-nano"];
|
|
41644
|
+
}
|
|
41645
|
+
if (lowerModel.includes("gpt-5")) {
|
|
41646
|
+
return MODEL_PRICING["gpt-5"];
|
|
41647
|
+
}
|
|
41648
|
+
if (lowerModel.includes("gpt-4.1-mini")) {
|
|
41649
|
+
return MODEL_PRICING["gpt-4.1-mini"];
|
|
41650
|
+
}
|
|
41651
|
+
if (lowerModel.includes("gpt-4.1-nano")) {
|
|
41652
|
+
return MODEL_PRICING["gpt-4.1-nano"];
|
|
41653
|
+
}
|
|
41654
|
+
if (lowerModel.includes("gpt-4.1")) {
|
|
41655
|
+
return MODEL_PRICING["gpt-4.1"];
|
|
41656
|
+
}
|
|
41657
|
+
if (lowerModel.includes("gpt-4o-mini")) {
|
|
41658
|
+
return MODEL_PRICING["gpt-4o-mini"];
|
|
41659
|
+
}
|
|
41660
|
+
if (lowerModel.includes("gpt-4o")) {
|
|
41661
|
+
return MODEL_PRICING["gpt-4o"];
|
|
41662
|
+
}
|
|
41663
|
+
if (lowerModel.includes("o4-mini")) {
|
|
41664
|
+
return MODEL_PRICING["o4-mini"];
|
|
41665
|
+
}
|
|
41666
|
+
if (lowerModel.includes("o3-mini")) {
|
|
41667
|
+
return MODEL_PRICING["o3-mini"];
|
|
41668
|
+
}
|
|
41669
|
+
if (lowerModel.includes("o3")) {
|
|
41670
|
+
return MODEL_PRICING.o3;
|
|
41671
|
+
}
|
|
41672
|
+
if (lowerModel.includes("o1")) {
|
|
41673
|
+
return MODEL_PRICING.o1;
|
|
41674
|
+
}
|
|
41675
|
+
if (lowerModel.includes("gpt-4-turbo")) {
|
|
41676
|
+
return MODEL_PRICING["gpt-4-turbo"];
|
|
41677
|
+
}
|
|
41678
|
+
if (lowerModel.includes("gpt-4")) {
|
|
41679
|
+
return MODEL_PRICING["gpt-4"];
|
|
41680
|
+
}
|
|
41681
|
+
if (lowerModel.includes("gpt-3.5")) {
|
|
41682
|
+
return MODEL_PRICING["gpt-3.5-turbo"];
|
|
41683
|
+
}
|
|
41684
|
+
if (lowerModel.includes("opus-4.5") || lowerModel.includes("opus-4-5")) {
|
|
41685
|
+
return MODEL_PRICING["claude-opus-4.5"];
|
|
41686
|
+
}
|
|
41687
|
+
if (lowerModel.includes("sonnet-4.5") || lowerModel.includes("sonnet-4-5")) {
|
|
41688
|
+
return MODEL_PRICING["claude-sonnet-4.5"];
|
|
41689
|
+
}
|
|
41690
|
+
if (lowerModel.includes("haiku-4.5") || lowerModel.includes("haiku-4-5")) {
|
|
41691
|
+
return MODEL_PRICING["claude-haiku-4.5"];
|
|
41692
|
+
}
|
|
41693
|
+
if (lowerModel.includes("opus-4.1") || lowerModel.includes("opus-4-1")) {
|
|
41694
|
+
return MODEL_PRICING["claude-opus-4.1"];
|
|
41695
|
+
}
|
|
41696
|
+
if (lowerModel.includes("opus-4")) {
|
|
41697
|
+
return MODEL_PRICING["claude-opus-4"];
|
|
41698
|
+
}
|
|
41699
|
+
if (lowerModel.includes("sonnet-4")) {
|
|
41700
|
+
return MODEL_PRICING["claude-sonnet-4"];
|
|
41701
|
+
}
|
|
41702
|
+
if (lowerModel.includes("sonnet-3.7") || lowerModel.includes("sonnet-3-7")) {
|
|
41703
|
+
return MODEL_PRICING["claude-sonnet-3.7"];
|
|
41704
|
+
}
|
|
41705
|
+
if (lowerModel.includes("claude-3-5-sonnet") || lowerModel.includes("claude-3.5-sonnet")) {
|
|
41706
|
+
return MODEL_PRICING["claude-3.5-sonnet"];
|
|
41707
|
+
}
|
|
41708
|
+
if (lowerModel.includes("claude-3-5-haiku") || lowerModel.includes("claude-3.5-haiku")) {
|
|
41709
|
+
return MODEL_PRICING["claude-3.5-haiku"];
|
|
41710
|
+
}
|
|
41711
|
+
if (lowerModel.includes("claude-3-opus")) {
|
|
41712
|
+
return MODEL_PRICING["claude-3-opus"];
|
|
41713
|
+
}
|
|
41714
|
+
if (lowerModel.includes("claude-3-sonnet")) {
|
|
41715
|
+
return MODEL_PRICING["claude-3-sonnet"];
|
|
41716
|
+
}
|
|
41717
|
+
if (lowerModel.includes("claude-3-haiku")) {
|
|
41718
|
+
return MODEL_PRICING["claude-3-haiku"];
|
|
41719
|
+
}
|
|
41720
|
+
if (lowerModel.includes("claude")) {
|
|
41721
|
+
return MODEL_PRICING["claude-sonnet-4.5"];
|
|
41722
|
+
}
|
|
41723
|
+
return DEFAULT_PRICING;
|
|
41724
|
+
}
|
|
41725
|
+
function estimateCost(promptTokens, completionTokens, model) {
|
|
41726
|
+
const pricing = getModelPricing(model);
|
|
41727
|
+
const promptCostUsd = promptTokens / 1000 * pricing.promptPer1K;
|
|
41728
|
+
const completionCostUsd = completionTokens / 1000 * pricing.completionPer1K;
|
|
41729
|
+
const totalUsd = promptCostUsd + completionCostUsd;
|
|
41730
|
+
return {
|
|
41731
|
+
totalUsd,
|
|
41732
|
+
promptCostUsd,
|
|
41733
|
+
completionCostUsd,
|
|
41734
|
+
model,
|
|
41735
|
+
pricing
|
|
41736
|
+
};
|
|
41737
|
+
}
|
|
41738
|
+
function formatCost(costUsd) {
|
|
41739
|
+
if (costUsd < 0.01) {
|
|
41740
|
+
return `$${(costUsd * 100).toFixed(4)} cents`;
|
|
41741
|
+
}
|
|
41742
|
+
if (costUsd < 1) {
|
|
41743
|
+
return `$${costUsd.toFixed(4)}`;
|
|
41744
|
+
}
|
|
41745
|
+
return `$${costUsd.toFixed(2)}`;
|
|
41746
|
+
}
|
|
41747
|
+
function listKnownModels() {
|
|
41748
|
+
return Object.entries(MODEL_PRICING).map(([model, pricing]) => ({
|
|
41749
|
+
model,
|
|
41750
|
+
pricing
|
|
41751
|
+
}));
|
|
41752
|
+
}
|
|
41621
41753
|
function getEnvironmentInfo() {
|
|
41622
41754
|
return {
|
|
41623
41755
|
node_version: process.version,
|
|
@@ -41670,7 +41802,8 @@ function createRunManifest(options) {
|
|
|
41670
41802
|
runReason,
|
|
41671
41803
|
redaction
|
|
41672
41804
|
} = options;
|
|
41673
|
-
const
|
|
41805
|
+
const modelForCost = resolvedConfig?.model || config.model;
|
|
41806
|
+
const metrics = calculateMetrics(cases, modelForCost);
|
|
41674
41807
|
const git = getGitInfo();
|
|
41675
41808
|
const environment = getEnvironmentInfo();
|
|
41676
41809
|
return {
|
|
@@ -41694,7 +41827,7 @@ function createRunManifest(options) {
|
|
|
41694
41827
|
redaction
|
|
41695
41828
|
};
|
|
41696
41829
|
}
|
|
41697
|
-
function calculateMetrics(cases) {
|
|
41830
|
+
function calculateMetrics(cases, model) {
|
|
41698
41831
|
const passedCases = cases.filter((c2) => c2.ok);
|
|
41699
41832
|
const latencies = cases.map((c2) => c2.latencyMs).sort((a, b) => a - b);
|
|
41700
41833
|
const medianLatency = latencies.length > 0 ? latencies[Math.floor(latencies.length / 2)] : 0;
|
|
@@ -41702,6 +41835,21 @@ function calculateMetrics(cases) {
|
|
|
41702
41835
|
const p95Latency = latencies.length > 0 ? latencies[p95Index] : 0;
|
|
41703
41836
|
const totalPromptTokens = cases.reduce((sum, c2) => sum + c2.tokens.prompt, 0);
|
|
41704
41837
|
const totalCompletionTokens = cases.reduce((sum, c2) => sum + c2.tokens.completion, 0);
|
|
41838
|
+
let cost;
|
|
41839
|
+
if (model && (totalPromptTokens > 0 || totalCompletionTokens > 0)) {
|
|
41840
|
+
const costEstimate = estimateCost(totalPromptTokens, totalCompletionTokens, model);
|
|
41841
|
+
const pricing = getModelPricing(model);
|
|
41842
|
+
cost = {
|
|
41843
|
+
total_usd: costEstimate.totalUsd,
|
|
41844
|
+
prompt_cost_usd: costEstimate.promptCostUsd,
|
|
41845
|
+
completion_cost_usd: costEstimate.completionCostUsd,
|
|
41846
|
+
model: costEstimate.model,
|
|
41847
|
+
pricing: {
|
|
41848
|
+
prompt_per_1k: pricing.promptPer1K,
|
|
41849
|
+
completion_per_1k: pricing.completionPer1K
|
|
41850
|
+
}
|
|
41851
|
+
};
|
|
41852
|
+
}
|
|
41705
41853
|
return {
|
|
41706
41854
|
success_rate: cases.length > 0 ? passedCases.length / cases.length : 0,
|
|
41707
41855
|
total_cases: cases.length,
|
|
@@ -41711,7 +41859,8 @@ function calculateMetrics(cases) {
|
|
|
41711
41859
|
p95_latency_ms: p95Latency,
|
|
41712
41860
|
total_tokens: totalPromptTokens + totalCompletionTokens,
|
|
41713
41861
|
total_prompt_tokens: totalPromptTokens,
|
|
41714
|
-
total_completion_tokens: totalCompletionTokens
|
|
41862
|
+
total_completion_tokens: totalCompletionTokens,
|
|
41863
|
+
cost
|
|
41715
41864
|
};
|
|
41716
41865
|
}
|
|
41717
41866
|
function detectCIEnvironment() {
|
|
@@ -41877,6 +42026,16 @@ function getSuccessRate(manifest) {
|
|
|
41877
42026
|
}
|
|
41878
42027
|
return manifest.metrics.success_rate;
|
|
41879
42028
|
}
|
|
42029
|
+
function getEstimatedCost(manifest) {
|
|
42030
|
+
const type = getManifestType(manifest);
|
|
42031
|
+
if (type === "stress") {
|
|
42032
|
+
return manifest.metrics.cost?.estimated_total_usd;
|
|
42033
|
+
}
|
|
42034
|
+
if (type === "run") {
|
|
42035
|
+
return manifest.metrics.cost?.total_usd;
|
|
42036
|
+
}
|
|
42037
|
+
return;
|
|
42038
|
+
}
|
|
41880
42039
|
function getScenario(manifest) {
|
|
41881
42040
|
return manifest.config.scenario;
|
|
41882
42041
|
}
|
|
@@ -41946,13 +42105,17 @@ class LocalStorageAdapter {
|
|
|
41946
42105
|
if (options?.scenario && getScenario(manifest) !== options.scenario) {
|
|
41947
42106
|
continue;
|
|
41948
42107
|
}
|
|
41949
|
-
|
|
42108
|
+
const item = {
|
|
41950
42109
|
runId: manifest.run_id,
|
|
41951
42110
|
scenario: getScenario(manifest),
|
|
41952
42111
|
successRate: getSuccessRate(manifest),
|
|
41953
42112
|
createdAt: manifest.start_time,
|
|
41954
42113
|
type: manifestType
|
|
41955
|
-
}
|
|
42114
|
+
};
|
|
42115
|
+
if (options?.includeCost) {
|
|
42116
|
+
item.estimatedCostUsd = getEstimatedCost(manifest);
|
|
42117
|
+
}
|
|
42118
|
+
results.push(item);
|
|
41956
42119
|
} catch {}
|
|
41957
42120
|
}
|
|
41958
42121
|
}
|
|
@@ -43037,7 +43200,7 @@ class RealtimeChannel {
|
|
|
43037
43200
|
}).map((bind) => {
|
|
43038
43201
|
if (typeof handledPayload === "object" && "ids" in handledPayload) {
|
|
43039
43202
|
const postgresChanges = handledPayload.data;
|
|
43040
|
-
const { schema: schema2, table, commit_timestamp, type: type2, errors:
|
|
43203
|
+
const { schema: schema2, table, commit_timestamp, type: type2, errors: errors22 } = postgresChanges;
|
|
43041
43204
|
const enrichedPayload = {
|
|
43042
43205
|
schema: schema2,
|
|
43043
43206
|
table,
|
|
@@ -43045,7 +43208,7 @@ class RealtimeChannel {
|
|
|
43045
43208
|
eventType: type2,
|
|
43046
43209
|
new: {},
|
|
43047
43210
|
old: {},
|
|
43048
|
-
errors:
|
|
43211
|
+
errors: errors22
|
|
43049
43212
|
};
|
|
43050
43213
|
handledPayload = Object.assign(Object.assign({}, enrichedPayload), this._getPayloadRecords(postgresChanges));
|
|
43051
43214
|
}
|
|
@@ -46749,7 +46912,7 @@ class GoTrueClient {
|
|
|
46749
46912
|
}
|
|
46750
46913
|
});
|
|
46751
46914
|
}
|
|
46752
|
-
async unlinkIdentity(
|
|
46915
|
+
async unlinkIdentity(identity2) {
|
|
46753
46916
|
try {
|
|
46754
46917
|
return await this._useSession(async (result) => {
|
|
46755
46918
|
var _a, _b;
|
|
@@ -46757,7 +46920,7 @@ class GoTrueClient {
|
|
|
46757
46920
|
if (error) {
|
|
46758
46921
|
throw error;
|
|
46759
46922
|
}
|
|
46760
|
-
return await _request(this.fetch, "DELETE", `${this.url}/user/identities/${
|
|
46923
|
+
return await _request(this.fetch, "DELETE", `${this.url}/user/identities/${identity2.identity_id}`, {
|
|
46761
46924
|
headers: this.headers,
|
|
46762
46925
|
jwt: (_b = (_a = data.session) === null || _a === undefined ? undefined : _a.access_token) !== null && _b !== undefined ? _b : undefined
|
|
46763
46926
|
});
|
|
@@ -46931,20 +47094,20 @@ class GoTrueClient {
|
|
|
46931
47094
|
if (this.broadcastChannel && broadcast) {
|
|
46932
47095
|
this.broadcastChannel.postMessage({ event, session });
|
|
46933
47096
|
}
|
|
46934
|
-
const
|
|
47097
|
+
const errors22 = [];
|
|
46935
47098
|
const promises = Array.from(this.stateChangeEmitters.values()).map(async (x2) => {
|
|
46936
47099
|
try {
|
|
46937
47100
|
await x2.callback(event, session);
|
|
46938
47101
|
} catch (e2) {
|
|
46939
|
-
|
|
47102
|
+
errors22.push(e2);
|
|
46940
47103
|
}
|
|
46941
47104
|
});
|
|
46942
47105
|
await Promise.all(promises);
|
|
46943
|
-
if (
|
|
46944
|
-
for (let i = 0;i <
|
|
46945
|
-
console.error(
|
|
47106
|
+
if (errors22.length > 0) {
|
|
47107
|
+
for (let i = 0;i < errors22.length; i += 1) {
|
|
47108
|
+
console.error(errors22[i]);
|
|
46946
47109
|
}
|
|
46947
|
-
throw
|
|
47110
|
+
throw errors22[0];
|
|
46948
47111
|
}
|
|
46949
47112
|
} finally {
|
|
46950
47113
|
this._debug(debugName, "end");
|
|
@@ -48430,135 +48593,248 @@ class Logger {
|
|
|
48430
48593
|
return childLogger;
|
|
48431
48594
|
}
|
|
48432
48595
|
}
|
|
48433
|
-
|
|
48434
|
-
|
|
48435
|
-
|
|
48436
|
-
}
|
|
48437
|
-
|
|
48438
|
-
for (const [key, pricing] of Object.entries(MODEL_PRICING)) {
|
|
48439
|
-
if (key.toLowerCase() === lowerModel) {
|
|
48440
|
-
return pricing;
|
|
48441
|
-
}
|
|
48442
|
-
}
|
|
48443
|
-
if (lowerModel.includes("gpt-5.2")) {
|
|
48444
|
-
return MODEL_PRICING["gpt-5.2"];
|
|
48445
|
-
}
|
|
48446
|
-
if (lowerModel.includes("gpt-5.1")) {
|
|
48447
|
-
return MODEL_PRICING["gpt-5.1"];
|
|
48448
|
-
}
|
|
48449
|
-
if (lowerModel.includes("gpt-5-mini")) {
|
|
48450
|
-
return MODEL_PRICING["gpt-5-mini"];
|
|
48451
|
-
}
|
|
48452
|
-
if (lowerModel.includes("gpt-5-nano")) {
|
|
48453
|
-
return MODEL_PRICING["gpt-5-nano"];
|
|
48454
|
-
}
|
|
48455
|
-
if (lowerModel.includes("gpt-5")) {
|
|
48456
|
-
return MODEL_PRICING["gpt-5"];
|
|
48457
|
-
}
|
|
48458
|
-
if (lowerModel.includes("gpt-4.1-mini")) {
|
|
48459
|
-
return MODEL_PRICING["gpt-4.1-mini"];
|
|
48460
|
-
}
|
|
48461
|
-
if (lowerModel.includes("gpt-4.1-nano")) {
|
|
48462
|
-
return MODEL_PRICING["gpt-4.1-nano"];
|
|
48463
|
-
}
|
|
48464
|
-
if (lowerModel.includes("gpt-4.1")) {
|
|
48465
|
-
return MODEL_PRICING["gpt-4.1"];
|
|
48466
|
-
}
|
|
48467
|
-
if (lowerModel.includes("gpt-4o-mini")) {
|
|
48468
|
-
return MODEL_PRICING["gpt-4o-mini"];
|
|
48469
|
-
}
|
|
48470
|
-
if (lowerModel.includes("gpt-4o")) {
|
|
48471
|
-
return MODEL_PRICING["gpt-4o"];
|
|
48472
|
-
}
|
|
48473
|
-
if (lowerModel.includes("o4-mini")) {
|
|
48474
|
-
return MODEL_PRICING["o4-mini"];
|
|
48475
|
-
}
|
|
48476
|
-
if (lowerModel.includes("o3-mini")) {
|
|
48477
|
-
return MODEL_PRICING["o3-mini"];
|
|
48478
|
-
}
|
|
48479
|
-
if (lowerModel.includes("o3")) {
|
|
48480
|
-
return MODEL_PRICING["o3"];
|
|
48481
|
-
}
|
|
48482
|
-
if (lowerModel.includes("o1")) {
|
|
48483
|
-
return MODEL_PRICING["o1"];
|
|
48484
|
-
}
|
|
48485
|
-
if (lowerModel.includes("gpt-4-turbo")) {
|
|
48486
|
-
return MODEL_PRICING["gpt-4-turbo"];
|
|
48487
|
-
}
|
|
48488
|
-
if (lowerModel.includes("gpt-4")) {
|
|
48489
|
-
return MODEL_PRICING["gpt-4"];
|
|
48490
|
-
}
|
|
48491
|
-
if (lowerModel.includes("gpt-3.5")) {
|
|
48492
|
-
return MODEL_PRICING["gpt-3.5-turbo"];
|
|
48493
|
-
}
|
|
48494
|
-
if (lowerModel.includes("opus-4.5") || lowerModel.includes("opus-4-5")) {
|
|
48495
|
-
return MODEL_PRICING["claude-opus-4.5"];
|
|
48496
|
-
}
|
|
48497
|
-
if (lowerModel.includes("sonnet-4.5") || lowerModel.includes("sonnet-4-5")) {
|
|
48498
|
-
return MODEL_PRICING["claude-sonnet-4.5"];
|
|
48499
|
-
}
|
|
48500
|
-
if (lowerModel.includes("haiku-4.5") || lowerModel.includes("haiku-4-5")) {
|
|
48501
|
-
return MODEL_PRICING["claude-haiku-4.5"];
|
|
48502
|
-
}
|
|
48503
|
-
if (lowerModel.includes("opus-4.1") || lowerModel.includes("opus-4-1")) {
|
|
48504
|
-
return MODEL_PRICING["claude-opus-4.1"];
|
|
48505
|
-
}
|
|
48506
|
-
if (lowerModel.includes("opus-4")) {
|
|
48507
|
-
return MODEL_PRICING["claude-opus-4"];
|
|
48596
|
+
|
|
48597
|
+
class ScenarioValidator {
|
|
48598
|
+
_options;
|
|
48599
|
+
constructor(options = {}) {
|
|
48600
|
+
this._options = options;
|
|
48508
48601
|
}
|
|
48509
|
-
|
|
48510
|
-
return
|
|
48602
|
+
get options() {
|
|
48603
|
+
return this._options;
|
|
48511
48604
|
}
|
|
48512
|
-
|
|
48513
|
-
|
|
48605
|
+
validate(filePath) {
|
|
48606
|
+
const errors4 = [];
|
|
48607
|
+
const warnings = [];
|
|
48608
|
+
let content;
|
|
48609
|
+
try {
|
|
48610
|
+
content = readFileSync2(filePath, "utf-8");
|
|
48611
|
+
} catch (err) {
|
|
48612
|
+
const error = err;
|
|
48613
|
+
errors4.push({
|
|
48614
|
+
line: 1,
|
|
48615
|
+
message: `Failed to read file: ${error.message}`,
|
|
48616
|
+
rule: "file-read",
|
|
48617
|
+
severity: "error"
|
|
48618
|
+
});
|
|
48619
|
+
return { file: filePath, valid: false, errors: errors4, warnings };
|
|
48620
|
+
}
|
|
48621
|
+
let parsed;
|
|
48622
|
+
try {
|
|
48623
|
+
parsed = import_yaml22.default.parse(content, {
|
|
48624
|
+
prettyErrors: true,
|
|
48625
|
+
strict: true
|
|
48626
|
+
});
|
|
48627
|
+
} catch (err) {
|
|
48628
|
+
if (err instanceof import_yaml22.default.YAMLError) {
|
|
48629
|
+
const linePos = err.linePos?.[0];
|
|
48630
|
+
errors4.push({
|
|
48631
|
+
line: linePos?.line || 1,
|
|
48632
|
+
column: linePos?.col,
|
|
48633
|
+
message: `Invalid YAML syntax: ${err.message}`,
|
|
48634
|
+
rule: "yaml-syntax",
|
|
48635
|
+
severity: "error"
|
|
48636
|
+
});
|
|
48637
|
+
} else {
|
|
48638
|
+
errors4.push({
|
|
48639
|
+
line: 1,
|
|
48640
|
+
message: `YAML parse error: ${err.message}`,
|
|
48641
|
+
rule: "yaml-syntax",
|
|
48642
|
+
severity: "error"
|
|
48643
|
+
});
|
|
48644
|
+
}
|
|
48645
|
+
return { file: filePath, valid: false, errors: errors4, warnings };
|
|
48646
|
+
}
|
|
48647
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
48648
|
+
errors4.push({
|
|
48649
|
+
line: 1,
|
|
48650
|
+
message: "Scenario must be a YAML object",
|
|
48651
|
+
rule: "schema-type",
|
|
48652
|
+
severity: "error"
|
|
48653
|
+
});
|
|
48654
|
+
return { file: filePath, valid: false, errors: errors4, warnings };
|
|
48655
|
+
}
|
|
48656
|
+
const schemaResult = ScenarioSchema.safeParse(parsed);
|
|
48657
|
+
if (!schemaResult.success) {
|
|
48658
|
+
const zodErrors = this.formatZodErrors(schemaResult.error, content);
|
|
48659
|
+
errors4.push(...zodErrors);
|
|
48660
|
+
}
|
|
48661
|
+
if (schemaResult.success) {
|
|
48662
|
+
const semanticErrors = this.validateSemantics(schemaResult.data, content);
|
|
48663
|
+
errors4.push(...semanticErrors);
|
|
48664
|
+
}
|
|
48665
|
+
const detectedWarnings = this.detectWarnings(parsed, content);
|
|
48666
|
+
warnings.push(...detectedWarnings);
|
|
48667
|
+
return {
|
|
48668
|
+
file: filePath,
|
|
48669
|
+
valid: errors4.length === 0,
|
|
48670
|
+
errors: errors4,
|
|
48671
|
+
warnings
|
|
48672
|
+
};
|
|
48514
48673
|
}
|
|
48515
|
-
|
|
48516
|
-
|
|
48674
|
+
formatZodErrors(error, content) {
|
|
48675
|
+
const issues = [];
|
|
48676
|
+
const lines = content.split(`
|
|
48677
|
+
`);
|
|
48678
|
+
for (const issue of error.issues) {
|
|
48679
|
+
const path2 = issue.path.join(".");
|
|
48680
|
+
const line = this.findLineForPath(lines, issue.path);
|
|
48681
|
+
let message;
|
|
48682
|
+
switch (issue.code) {
|
|
48683
|
+
case "invalid_type":
|
|
48684
|
+
message = `'${path2}' expected ${issue.expected}, received ${issue.received}`;
|
|
48685
|
+
break;
|
|
48686
|
+
case "invalid_enum_value":
|
|
48687
|
+
message = `'${path2}' must be one of: ${issue.options.join(", ")}`;
|
|
48688
|
+
break;
|
|
48689
|
+
case "too_small":
|
|
48690
|
+
if (issue.type === "array") {
|
|
48691
|
+
message = `'${path2}' must have at least ${issue.minimum} item(s)`;
|
|
48692
|
+
} else {
|
|
48693
|
+
message = `'${path2}' is too small`;
|
|
48694
|
+
}
|
|
48695
|
+
break;
|
|
48696
|
+
case "unrecognized_keys":
|
|
48697
|
+
message = `Unrecognized field(s): ${issue.keys.join(", ")}`;
|
|
48698
|
+
break;
|
|
48699
|
+
default:
|
|
48700
|
+
message = issue.message;
|
|
48701
|
+
}
|
|
48702
|
+
issues.push({
|
|
48703
|
+
line,
|
|
48704
|
+
message,
|
|
48705
|
+
rule: `schema-${issue.code}`,
|
|
48706
|
+
severity: "error"
|
|
48707
|
+
});
|
|
48708
|
+
}
|
|
48709
|
+
return issues;
|
|
48517
48710
|
}
|
|
48518
|
-
|
|
48519
|
-
|
|
48711
|
+
findLineForPath(lines, path2) {
|
|
48712
|
+
if (path2.length === 0)
|
|
48713
|
+
return 1;
|
|
48714
|
+
const searchKey = String(path2[path2.length - 1]);
|
|
48715
|
+
for (let i2 = 0;i2 < lines.length; i2++) {
|
|
48716
|
+
const line = lines[i2];
|
|
48717
|
+
if (line.includes(`${searchKey}:`) || line.includes(`- ${searchKey}:`)) {
|
|
48718
|
+
return i2 + 1;
|
|
48719
|
+
}
|
|
48720
|
+
if (typeof path2[path2.length - 1] === "number" && path2.includes("cases")) {
|
|
48721
|
+
if (line.trim().startsWith("- id:")) {
|
|
48722
|
+
return i2 + 1;
|
|
48723
|
+
}
|
|
48724
|
+
}
|
|
48725
|
+
}
|
|
48726
|
+
return 1;
|
|
48520
48727
|
}
|
|
48521
|
-
|
|
48522
|
-
|
|
48728
|
+
validateSemantics(scenario, content) {
|
|
48729
|
+
const errors4 = [];
|
|
48730
|
+
const lines = content.split(`
|
|
48731
|
+
`);
|
|
48732
|
+
const caseIds = new Set;
|
|
48733
|
+
for (const testCase of scenario.cases) {
|
|
48734
|
+
if (caseIds.has(testCase.id)) {
|
|
48735
|
+
const line = this.findLineForCaseId(lines, testCase.id);
|
|
48736
|
+
errors4.push({
|
|
48737
|
+
line,
|
|
48738
|
+
message: `Duplicate case ID: '${testCase.id}'`,
|
|
48739
|
+
rule: "duplicate-case-id",
|
|
48740
|
+
severity: "error"
|
|
48741
|
+
});
|
|
48742
|
+
}
|
|
48743
|
+
caseIds.add(testCase.id);
|
|
48744
|
+
}
|
|
48745
|
+
const globalVars = scenario.variables || {};
|
|
48746
|
+
for (const testCase of scenario.cases) {
|
|
48747
|
+
const caseVars = testCase.variables || {};
|
|
48748
|
+
const allVars = { ...globalVars, ...caseVars };
|
|
48749
|
+
const prompt22 = typeof testCase.prompt === "string" ? testCase.prompt : JSON.stringify(testCase.prompt);
|
|
48750
|
+
const refs = this.extractVariableRefs(prompt22);
|
|
48751
|
+
for (const ref of refs) {
|
|
48752
|
+
if (!(ref in allVars)) {
|
|
48753
|
+
const line = this.findLineForCaseId(lines, testCase.id);
|
|
48754
|
+
errors4.push({
|
|
48755
|
+
line,
|
|
48756
|
+
message: `Undefined variable '{{${ref}}}' in case '${testCase.id}'`,
|
|
48757
|
+
rule: "undefined-variable",
|
|
48758
|
+
severity: "error",
|
|
48759
|
+
suggestion: `Define '${ref}' in scenario.variables or case.variables`
|
|
48760
|
+
});
|
|
48761
|
+
}
|
|
48762
|
+
}
|
|
48763
|
+
}
|
|
48764
|
+
return errors4;
|
|
48523
48765
|
}
|
|
48524
|
-
|
|
48525
|
-
|
|
48766
|
+
findLineForCaseId(lines, caseId) {
|
|
48767
|
+
for (let i2 = 0;i2 < lines.length; i2++) {
|
|
48768
|
+
if (lines[i2].includes(`id: ${caseId}`) || lines[i2].includes(`id: "${caseId}"`) || lines[i2].includes(`id: '${caseId}'`)) {
|
|
48769
|
+
return i2 + 1;
|
|
48770
|
+
}
|
|
48771
|
+
}
|
|
48772
|
+
return 1;
|
|
48526
48773
|
}
|
|
48527
|
-
|
|
48528
|
-
|
|
48774
|
+
extractVariableRefs(text) {
|
|
48775
|
+
const regex22 = /\{\{(\w+)\}\}/g;
|
|
48776
|
+
const refs = [];
|
|
48777
|
+
const matches = text.matchAll(regex22);
|
|
48778
|
+
for (const match of matches) {
|
|
48779
|
+
refs.push(match[1]);
|
|
48780
|
+
}
|
|
48781
|
+
return refs;
|
|
48529
48782
|
}
|
|
48530
|
-
|
|
48531
|
-
|
|
48783
|
+
detectWarnings(parsed, content) {
|
|
48784
|
+
const warnings = [];
|
|
48785
|
+
const lines = content.split(`
|
|
48786
|
+
`);
|
|
48787
|
+
if (parsed && typeof parsed === "object") {
|
|
48788
|
+
const obj = parsed;
|
|
48789
|
+
if (this.hasDeepKey(obj, "criteria")) {
|
|
48790
|
+
const line = this.findLineForKey(lines, "criteria");
|
|
48791
|
+
warnings.push({
|
|
48792
|
+
line,
|
|
48793
|
+
message: "'criteria' is deprecated, use 'rubric' instead (llm_grader)",
|
|
48794
|
+
rule: "deprecated-field",
|
|
48795
|
+
severity: "warning",
|
|
48796
|
+
suggestion: "Replace 'criteria' with 'rubric'"
|
|
48797
|
+
});
|
|
48798
|
+
}
|
|
48799
|
+
const cases = obj.cases;
|
|
48800
|
+
if (Array.isArray(cases) && cases.length > 20) {
|
|
48801
|
+
warnings.push({
|
|
48802
|
+
line: 1,
|
|
48803
|
+
message: `Scenario has ${cases.length} cases. Consider using --parallel for faster execution.`,
|
|
48804
|
+
rule: "performance-hint",
|
|
48805
|
+
severity: "warning"
|
|
48806
|
+
});
|
|
48807
|
+
}
|
|
48808
|
+
if (!obj.description) {
|
|
48809
|
+
warnings.push({
|
|
48810
|
+
line: 1,
|
|
48811
|
+
message: "Scenario is missing 'description' field. Adding a description improves documentation.",
|
|
48812
|
+
rule: "missing-description",
|
|
48813
|
+
severity: "warning"
|
|
48814
|
+
});
|
|
48815
|
+
}
|
|
48816
|
+
}
|
|
48817
|
+
return warnings;
|
|
48532
48818
|
}
|
|
48533
|
-
|
|
48534
|
-
|
|
48535
|
-
|
|
48536
|
-
|
|
48537
|
-
|
|
48538
|
-
|
|
48539
|
-
|
|
48540
|
-
|
|
48541
|
-
|
|
48542
|
-
|
|
48543
|
-
completionCostUsd,
|
|
48544
|
-
model,
|
|
48545
|
-
pricing
|
|
48546
|
-
};
|
|
48547
|
-
}
|
|
48548
|
-
function formatCost(costUsd) {
|
|
48549
|
-
if (costUsd < 0.01) {
|
|
48550
|
-
return `$${(costUsd * 100).toFixed(4)} cents`;
|
|
48819
|
+
hasDeepKey(obj, key) {
|
|
48820
|
+
if (obj === null || typeof obj !== "object")
|
|
48821
|
+
return false;
|
|
48822
|
+
if (key in obj)
|
|
48823
|
+
return true;
|
|
48824
|
+
for (const value of Object.values(obj)) {
|
|
48825
|
+
if (this.hasDeepKey(value, key))
|
|
48826
|
+
return true;
|
|
48827
|
+
}
|
|
48828
|
+
return false;
|
|
48551
48829
|
}
|
|
48552
|
-
|
|
48553
|
-
|
|
48830
|
+
findLineForKey(lines, key) {
|
|
48831
|
+
for (let i2 = 0;i2 < lines.length; i2++) {
|
|
48832
|
+
if (lines[i2].includes(`${key}:`)) {
|
|
48833
|
+
return i2 + 1;
|
|
48834
|
+
}
|
|
48835
|
+
}
|
|
48836
|
+
return 1;
|
|
48554
48837
|
}
|
|
48555
|
-
return `$${costUsd.toFixed(2)}`;
|
|
48556
|
-
}
|
|
48557
|
-
function listKnownModels() {
|
|
48558
|
-
return Object.entries(MODEL_PRICING).map(([model, pricing]) => ({
|
|
48559
|
-
model,
|
|
48560
|
-
pricing
|
|
48561
|
-
}));
|
|
48562
48838
|
}
|
|
48563
48839
|
var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __toESM2 = (mod, isNodeMode, target) => {
|
|
48564
48840
|
target = mod != null ? __create2(__getProtoOf2(mod)) : {};
|
|
@@ -48794,7 +49070,7 @@ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __t
|
|
|
48794
49070
|
}
|
|
48795
49071
|
}, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodFunction2, ZodLazy2, ZodLiteral2, ZodEnum2, ZodNativeEnum2, ZodPromise2, ZodEffects2, ZodOptional2, ZodNullable2, ZodDefault2, ZodCatch2, ZodNaN2, BRAND2, ZodBranded2, ZodPipeline2, ZodReadonly2, late2, ZodFirstPartyTypeKind2, instanceOfType2 = (cls, params = {
|
|
48796
49072
|
message: `Input not instance of ${cls.name}`
|
|
48797
|
-
}) => custom2((data) => data instanceof cls, params), stringType2, numberType2, nanType2, bigIntType2, booleanType2, dateType2, symbolType2, undefinedType2, nullType2, anyType2, unknownType2, neverType2, voidType2, arrayType2, objectType2, strictObjectType2, unionType2, discriminatedUnionType2, intersectionType2, tupleType2, recordType2, mapType2, setType2, functionType2, lazyType2, literalType2, enumType2, nativeEnumType2, promiseType2, effectsType2, optionalType2, nullableType2, preprocessType2, pipelineType2, ostring2 = () => stringType2().optional(), onumber2 = () => numberType2().optional(), oboolean2 = () => booleanType2().optional(), coerce2, NEVER2, init_types, exports_external2, init_external, init_zod, require_identity3, require_visit2, require_directives2, require_anchors2, require_applyReviver2, require_toJS2, require_Node2, require_Alias2, require_Scalar2, require_createNode2, require_Collection2, require_stringifyComment2, require_foldFlowLines2, require_stringifyString2, require_stringify2, require_stringifyPair2, require_log2, require_merge4, require_addPairToJSMap2, require_Pair2, require_stringifyCollection2, require_YAMLMap2, require_map3, require_YAMLSeq2, require_seq2, require_string2, require_null2, require_bool3, require_stringifyNumber2, require_float3, require_int3, require_schema4, require_schema22, require_binary2, require_pairs3, require_omap2, require_bool22, require_float22, require_int22, require_set2, require_timestamp3, require_schema32, require_tags2, require_Schema2, require_stringifyDocument2, require_Document2, require_errors3, require_resolve_props2, require_util_contains_newline2, require_util_flow_indent_check2, require_util_map_includes2, require_resolve_block_map2, require_resolve_block_seq2, require_resolve_end2, require_resolve_flow_collection2, require_compose_collection2, require_resolve_block_scalar2, require_resolve_flow_scalar2, require_compose_scalar2, require_util_empty_scalar_position2, require_compose_node2, require_compose_doc2, require_composer2, require_cst_scalar2, require_cst_stringify2, require_cst_visit2, require_cst2, require_lexer2, require_line_counter2, require_parser2, require_public_api2, peq, myers_32 = (a, b) => {
|
|
49073
|
+
}) => custom2((data) => data instanceof cls, params), stringType2, numberType2, nanType2, bigIntType2, booleanType2, dateType2, symbolType2, undefinedType2, nullType2, anyType2, unknownType2, neverType2, voidType2, arrayType2, objectType2, strictObjectType2, unionType2, discriminatedUnionType2, intersectionType2, tupleType2, recordType2, mapType2, setType2, functionType2, lazyType2, literalType2, enumType2, nativeEnumType2, promiseType2, effectsType2, optionalType2, nullableType2, preprocessType2, pipelineType2, ostring2 = () => stringType2().optional(), onumber2 = () => numberType2().optional(), oboolean2 = () => booleanType2().optional(), coerce2, NEVER2, init_types, exports_external2, init_external, init_zod, require_identity3, require_visit2, require_directives2, require_anchors2, require_applyReviver2, require_toJS2, require_Node2, require_Alias2, require_Scalar2, require_createNode2, require_Collection2, require_stringifyComment2, require_foldFlowLines2, require_stringifyString2, require_stringify2, require_stringifyPair2, require_log2, require_merge4, require_addPairToJSMap2, require_Pair2, require_stringifyCollection2, require_YAMLMap2, require_map3, require_YAMLSeq2, require_seq2, require_string2, require_null2, require_bool3, require_stringifyNumber2, require_float3, require_int3, require_schema4, require_schema22, require_binary2, require_pairs3, require_omap2, require_bool22, require_float22, require_int22, require_set2, require_timestamp3, require_schema32, require_tags2, require_Schema2, require_stringifyDocument2, require_Document2, require_errors3, require_resolve_props2, require_util_contains_newline2, require_util_flow_indent_check2, require_util_map_includes2, require_resolve_block_map2, require_resolve_block_seq2, require_resolve_end2, require_resolve_flow_collection2, require_compose_collection2, require_resolve_block_scalar2, require_resolve_flow_scalar2, require_compose_scalar2, require_util_empty_scalar_position2, require_compose_node2, require_compose_doc2, require_composer2, require_cst_scalar2, require_cst_stringify2, require_cst_visit2, require_cst2, require_lexer2, require_line_counter2, require_parser2, require_public_api2, require_dist, peq, myers_32 = (a, b) => {
|
|
48798
49074
|
const n = a.length;
|
|
48799
49075
|
const m = b.length;
|
|
48800
49076
|
const lst = 1 << n - 1;
|
|
@@ -49151,7 +49427,7 @@ ${e.cyan(d)}
|
|
|
49151
49427
|
`;
|
|
49152
49428
|
}
|
|
49153
49429
|
} }).prompt();
|
|
49154
|
-
}, kCancel, init_prompt2, ArtemisError, adapterRegistry, initialized = false, BUILTIN_PATTERNS, BUILTIN_REGEX_PATTERNS, DEFAULT_REDACTION_PATTERNS, RedactionConfigSchema, ProviderSchema, ProviderConfigSchema2, BaseExpectedSchema, CombinedExpectedSchema, ExpectedSchema, ChatMessageSchema, VariablesSchema, RedactionConfigSchema2, TestCaseSchema, ScenarioSchema,
|
|
49430
|
+
}, kCancel, init_prompt2, ArtemisError, adapterRegistry, initialized = false, BUILTIN_PATTERNS, BUILTIN_REGEX_PATTERNS, DEFAULT_REDACTION_PATTERNS, RedactionConfigSchema, ProviderSchema, ProviderConfigSchema2, BaseExpectedSchema, CombinedExpectedSchema, ExpectedSchema, ChatMessageSchema, VariablesSchema, RedactionConfigSchema2, TestCaseSchema, ScenarioSchema, import_yaml2, DEFAULT_EXTENSIONS, DEFAULT_MAX_DEPTH = 10, DEFAULT_EXCLUDE, urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", POOL_SIZE_MULTIPLIER = 128, pool, poolOffset, MODEL_PRICING, DEFAULT_PRICING, import_tslib, __extends, __assign, __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter, __generator, __exportStar, __createBinding, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, __rewriteRelativeImportExtension, resolveFetch = (customFetch) => {
|
|
49155
49431
|
if (customFetch) {
|
|
49156
49432
|
return (...args) => customFetch(...args);
|
|
49157
49433
|
}
|
|
@@ -51120,7 +51396,7 @@ ${cause.stack}`;
|
|
|
51120
51396
|
return new SupabaseClient(supabaseUrl, supabaseKey, options);
|
|
51121
51397
|
}, LogLevels, LogTypes, defu, paused = false, queue, bracket = (x2) => x2 ? `[${x2}]` : "", env2, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors13, ansiRegex2, boxStylePresets, defaultStyle, r2, i = (e2) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e2 ? r2 : globalThis), o2, t, f2, l, I2, T2, a, g2, R2, A2, C2, y2, _22, c2, O2, D, L2, S2, u2, N2, F2, P2, regex2, emojiRegex22 = () => {
|
|
51122
51398
|
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
51123
|
-
}, segmenter2, defaultIgnorableCodePointRegex2, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode, s = (c3, fallback2) => unicode ? c3 : fallback2, TYPE_ICONS, FancyReporter, consola, LOG_LEVEL_MAP, level, baseLogger, logger,
|
|
51399
|
+
}, segmenter2, defaultIgnorableCodePointRegex2, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode, s = (c3, fallback2) => unicode ? c3 : fallback2, TYPE_ICONS, FancyReporter, consola, LOG_LEVEL_MAP, level, baseLogger, logger, import_yaml22;
|
|
51124
51400
|
var init_dist = __esm(() => {
|
|
51125
51401
|
__create2 = Object.create;
|
|
51126
51402
|
__getProtoOf2 = Object.getPrototypeOf;
|
|
@@ -61042,6 +61318,53 @@ ${end.comment}` : end.comment;
|
|
|
61042
61318
|
exports.parseDocument = parseDocument;
|
|
61043
61319
|
exports.stringify = stringify;
|
|
61044
61320
|
});
|
|
61321
|
+
require_dist = __commonJS2((exports) => {
|
|
61322
|
+
var composer2 = require_composer2();
|
|
61323
|
+
var Document2 = require_Document2();
|
|
61324
|
+
var Schema2 = require_Schema2();
|
|
61325
|
+
var errors22 = require_errors3();
|
|
61326
|
+
var Alias2 = require_Alias2();
|
|
61327
|
+
var identity2 = require_identity3();
|
|
61328
|
+
var Pair2 = require_Pair2();
|
|
61329
|
+
var Scalar2 = require_Scalar2();
|
|
61330
|
+
var YAMLMap2 = require_YAMLMap2();
|
|
61331
|
+
var YAMLSeq2 = require_YAMLSeq2();
|
|
61332
|
+
var cst2 = require_cst2();
|
|
61333
|
+
var lexer2 = require_lexer2();
|
|
61334
|
+
var lineCounter2 = require_line_counter2();
|
|
61335
|
+
var parser2 = require_parser2();
|
|
61336
|
+
var publicApi2 = require_public_api2();
|
|
61337
|
+
var visit2 = require_visit2();
|
|
61338
|
+
exports.Composer = composer2.Composer;
|
|
61339
|
+
exports.Document = Document2.Document;
|
|
61340
|
+
exports.Schema = Schema2.Schema;
|
|
61341
|
+
exports.YAMLError = errors22.YAMLError;
|
|
61342
|
+
exports.YAMLParseError = errors22.YAMLParseError;
|
|
61343
|
+
exports.YAMLWarning = errors22.YAMLWarning;
|
|
61344
|
+
exports.Alias = Alias2.Alias;
|
|
61345
|
+
exports.isAlias = identity2.isAlias;
|
|
61346
|
+
exports.isCollection = identity2.isCollection;
|
|
61347
|
+
exports.isDocument = identity2.isDocument;
|
|
61348
|
+
exports.isMap = identity2.isMap;
|
|
61349
|
+
exports.isNode = identity2.isNode;
|
|
61350
|
+
exports.isPair = identity2.isPair;
|
|
61351
|
+
exports.isScalar = identity2.isScalar;
|
|
61352
|
+
exports.isSeq = identity2.isSeq;
|
|
61353
|
+
exports.Pair = Pair2.Pair;
|
|
61354
|
+
exports.Scalar = Scalar2.Scalar;
|
|
61355
|
+
exports.YAMLMap = YAMLMap2.YAMLMap;
|
|
61356
|
+
exports.YAMLSeq = YAMLSeq2.YAMLSeq;
|
|
61357
|
+
exports.CST = cst2;
|
|
61358
|
+
exports.Lexer = lexer2.Lexer;
|
|
61359
|
+
exports.LineCounter = lineCounter2.LineCounter;
|
|
61360
|
+
exports.Parser = parser2.Parser;
|
|
61361
|
+
exports.parse = publicApi2.parse;
|
|
61362
|
+
exports.parseAllDocuments = publicApi2.parseAllDocuments;
|
|
61363
|
+
exports.parseDocument = publicApi2.parseDocument;
|
|
61364
|
+
exports.stringify = publicApi2.stringify;
|
|
61365
|
+
exports.visit = visit2.visit;
|
|
61366
|
+
exports.visitAsync = visit2.visitAsync;
|
|
61367
|
+
});
|
|
61045
61368
|
init_mod = __esm2(() => {
|
|
61046
61369
|
peq = new Uint32Array(65536);
|
|
61047
61370
|
});
|
|
@@ -62068,54 +62391,192 @@ ${end.comment}` : end.comment;
|
|
|
62068
62391
|
cleanup: exports_external2.boolean().optional()
|
|
62069
62392
|
}).optional()
|
|
62070
62393
|
});
|
|
62071
|
-
|
|
62072
|
-
Document2 = require_Document2();
|
|
62073
|
-
Schema2 = require_Schema2();
|
|
62074
|
-
errors22 = require_errors3();
|
|
62075
|
-
Alias2 = require_Alias2();
|
|
62076
|
-
identity2 = require_identity3();
|
|
62077
|
-
Pair2 = require_Pair2();
|
|
62078
|
-
Scalar2 = require_Scalar2();
|
|
62079
|
-
YAMLMap2 = require_YAMLMap2();
|
|
62080
|
-
YAMLSeq2 = require_YAMLSeq2();
|
|
62081
|
-
cst2 = require_cst2();
|
|
62082
|
-
lexer2 = require_lexer2();
|
|
62083
|
-
lineCounter2 = require_line_counter2();
|
|
62084
|
-
parser2 = require_parser2();
|
|
62085
|
-
publicApi2 = require_public_api2();
|
|
62086
|
-
visit2 = require_visit2();
|
|
62087
|
-
$Composer2 = composer2.Composer;
|
|
62088
|
-
$Document2 = Document2.Document;
|
|
62089
|
-
$Schema2 = Schema2.Schema;
|
|
62090
|
-
$YAMLError2 = errors22.YAMLError;
|
|
62091
|
-
$YAMLParseError2 = errors22.YAMLParseError;
|
|
62092
|
-
$YAMLWarning2 = errors22.YAMLWarning;
|
|
62093
|
-
$Alias2 = Alias2.Alias;
|
|
62094
|
-
$isAlias2 = identity2.isAlias;
|
|
62095
|
-
$isCollection2 = identity2.isCollection;
|
|
62096
|
-
$isDocument2 = identity2.isDocument;
|
|
62097
|
-
$isMap2 = identity2.isMap;
|
|
62098
|
-
$isNode2 = identity2.isNode;
|
|
62099
|
-
$isPair2 = identity2.isPair;
|
|
62100
|
-
$isScalar2 = identity2.isScalar;
|
|
62101
|
-
$isSeq2 = identity2.isSeq;
|
|
62102
|
-
$Pair2 = Pair2.Pair;
|
|
62103
|
-
$Scalar2 = Scalar2.Scalar;
|
|
62104
|
-
$YAMLMap2 = YAMLMap2.YAMLMap;
|
|
62105
|
-
$YAMLSeq2 = YAMLSeq2.YAMLSeq;
|
|
62106
|
-
$Lexer2 = lexer2.Lexer;
|
|
62107
|
-
$LineCounter2 = lineCounter2.LineCounter;
|
|
62108
|
-
$Parser2 = parser2.Parser;
|
|
62109
|
-
$parse2 = publicApi2.parse;
|
|
62110
|
-
$parseAllDocuments2 = publicApi2.parseAllDocuments;
|
|
62111
|
-
$parseDocument2 = publicApi2.parseDocument;
|
|
62112
|
-
$stringify2 = publicApi2.stringify;
|
|
62113
|
-
$visit2 = visit2.visit;
|
|
62114
|
-
$visitAsync2 = visit2.visitAsync;
|
|
62394
|
+
import_yaml2 = __toESM2(require_dist(), 1);
|
|
62115
62395
|
DEFAULT_EXTENSIONS = [".yaml", ".yml"];
|
|
62116
62396
|
DEFAULT_EXCLUDE = ["node_modules", ".git", "dist", "build", "coverage"];
|
|
62117
62397
|
init_evaluators();
|
|
62118
62398
|
init_evaluators();
|
|
62399
|
+
MODEL_PRICING = {
|
|
62400
|
+
"gpt-5": {
|
|
62401
|
+
promptPer1K: 0.00125,
|
|
62402
|
+
completionPer1K: 0.01,
|
|
62403
|
+
lastUpdated: "2026-01",
|
|
62404
|
+
notes: "400K context window"
|
|
62405
|
+
},
|
|
62406
|
+
"gpt-5.1": {
|
|
62407
|
+
promptPer1K: 0.00125,
|
|
62408
|
+
completionPer1K: 0.01,
|
|
62409
|
+
lastUpdated: "2026-01"
|
|
62410
|
+
},
|
|
62411
|
+
"gpt-5.2": {
|
|
62412
|
+
promptPer1K: 0.00175,
|
|
62413
|
+
completionPer1K: 0.014,
|
|
62414
|
+
lastUpdated: "2026-01"
|
|
62415
|
+
},
|
|
62416
|
+
"gpt-5-mini": {
|
|
62417
|
+
promptPer1K: 0.00025,
|
|
62418
|
+
completionPer1K: 0.002,
|
|
62419
|
+
lastUpdated: "2026-01"
|
|
62420
|
+
},
|
|
62421
|
+
"gpt-5-nano": {
|
|
62422
|
+
promptPer1K: 0.00005,
|
|
62423
|
+
completionPer1K: 0.0004,
|
|
62424
|
+
lastUpdated: "2026-01"
|
|
62425
|
+
},
|
|
62426
|
+
"gpt-4.1": {
|
|
62427
|
+
promptPer1K: 0.002,
|
|
62428
|
+
completionPer1K: 0.008,
|
|
62429
|
+
lastUpdated: "2026-01",
|
|
62430
|
+
notes: "1M context window"
|
|
62431
|
+
},
|
|
62432
|
+
"gpt-4.1-mini": {
|
|
62433
|
+
promptPer1K: 0.0004,
|
|
62434
|
+
completionPer1K: 0.0016,
|
|
62435
|
+
lastUpdated: "2026-01"
|
|
62436
|
+
},
|
|
62437
|
+
"gpt-4.1-nano": {
|
|
62438
|
+
promptPer1K: 0.0001,
|
|
62439
|
+
completionPer1K: 0.0004,
|
|
62440
|
+
lastUpdated: "2026-01"
|
|
62441
|
+
},
|
|
62442
|
+
"gpt-4o": {
|
|
62443
|
+
promptPer1K: 0.0025,
|
|
62444
|
+
completionPer1K: 0.01,
|
|
62445
|
+
lastUpdated: "2026-01",
|
|
62446
|
+
notes: "128K context window"
|
|
62447
|
+
},
|
|
62448
|
+
"gpt-4o-mini": {
|
|
62449
|
+
promptPer1K: 0.00015,
|
|
62450
|
+
completionPer1K: 0.0006,
|
|
62451
|
+
lastUpdated: "2026-01",
|
|
62452
|
+
notes: "128K context window"
|
|
62453
|
+
},
|
|
62454
|
+
o1: {
|
|
62455
|
+
promptPer1K: 0.015,
|
|
62456
|
+
completionPer1K: 0.06,
|
|
62457
|
+
lastUpdated: "2026-01",
|
|
62458
|
+
notes: "Reasoning model - internal thinking tokens billed as output"
|
|
62459
|
+
},
|
|
62460
|
+
o3: {
|
|
62461
|
+
promptPer1K: 0.002,
|
|
62462
|
+
completionPer1K: 0.008,
|
|
62463
|
+
lastUpdated: "2026-01"
|
|
62464
|
+
},
|
|
62465
|
+
"o3-mini": {
|
|
62466
|
+
promptPer1K: 0.0011,
|
|
62467
|
+
completionPer1K: 0.0044,
|
|
62468
|
+
lastUpdated: "2026-01"
|
|
62469
|
+
},
|
|
62470
|
+
"o4-mini": {
|
|
62471
|
+
promptPer1K: 0.0011,
|
|
62472
|
+
completionPer1K: 0.0044,
|
|
62473
|
+
lastUpdated: "2026-01"
|
|
62474
|
+
},
|
|
62475
|
+
"gpt-4-turbo": {
|
|
62476
|
+
promptPer1K: 0.01,
|
|
62477
|
+
completionPer1K: 0.03,
|
|
62478
|
+
lastUpdated: "2026-01"
|
|
62479
|
+
},
|
|
62480
|
+
"gpt-4": {
|
|
62481
|
+
promptPer1K: 0.03,
|
|
62482
|
+
completionPer1K: 0.06,
|
|
62483
|
+
lastUpdated: "2026-01"
|
|
62484
|
+
},
|
|
62485
|
+
"gpt-3.5-turbo": {
|
|
62486
|
+
promptPer1K: 0.0005,
|
|
62487
|
+
completionPer1K: 0.0015,
|
|
62488
|
+
lastUpdated: "2026-01"
|
|
62489
|
+
},
|
|
62490
|
+
"claude-opus-4.5": {
|
|
62491
|
+
promptPer1K: 0.005,
|
|
62492
|
+
completionPer1K: 0.025,
|
|
62493
|
+
lastUpdated: "2026-01",
|
|
62494
|
+
notes: "Most capable Claude model"
|
|
62495
|
+
},
|
|
62496
|
+
"claude-sonnet-4.5": {
|
|
62497
|
+
promptPer1K: 0.003,
|
|
62498
|
+
completionPer1K: 0.015,
|
|
62499
|
+
lastUpdated: "2026-01",
|
|
62500
|
+
notes: "Balanced performance and cost"
|
|
62501
|
+
},
|
|
62502
|
+
"claude-haiku-4.5": {
|
|
62503
|
+
promptPer1K: 0.001,
|
|
62504
|
+
completionPer1K: 0.005,
|
|
62505
|
+
lastUpdated: "2026-01",
|
|
62506
|
+
notes: "Fastest Claude model"
|
|
62507
|
+
},
|
|
62508
|
+
"claude-opus-4": {
|
|
62509
|
+
promptPer1K: 0.015,
|
|
62510
|
+
completionPer1K: 0.075,
|
|
62511
|
+
lastUpdated: "2026-01"
|
|
62512
|
+
},
|
|
62513
|
+
"claude-opus-4.1": {
|
|
62514
|
+
promptPer1K: 0.015,
|
|
62515
|
+
completionPer1K: 0.075,
|
|
62516
|
+
lastUpdated: "2026-01"
|
|
62517
|
+
},
|
|
62518
|
+
"claude-sonnet-4": {
|
|
62519
|
+
promptPer1K: 0.003,
|
|
62520
|
+
completionPer1K: 0.015,
|
|
62521
|
+
lastUpdated: "2026-01"
|
|
62522
|
+
},
|
|
62523
|
+
"claude-sonnet-3.7": {
|
|
62524
|
+
promptPer1K: 0.003,
|
|
62525
|
+
completionPer1K: 0.015,
|
|
62526
|
+
lastUpdated: "2026-01"
|
|
62527
|
+
},
|
|
62528
|
+
"claude-3-7-sonnet": {
|
|
62529
|
+
promptPer1K: 0.003,
|
|
62530
|
+
completionPer1K: 0.015,
|
|
62531
|
+
lastUpdated: "2026-01"
|
|
62532
|
+
},
|
|
62533
|
+
"claude-3-5-sonnet-20241022": {
|
|
62534
|
+
promptPer1K: 0.003,
|
|
62535
|
+
completionPer1K: 0.015,
|
|
62536
|
+
lastUpdated: "2026-01"
|
|
62537
|
+
},
|
|
62538
|
+
"claude-3-5-haiku-20241022": {
|
|
62539
|
+
promptPer1K: 0.0008,
|
|
62540
|
+
completionPer1K: 0.004,
|
|
62541
|
+
lastUpdated: "2026-01"
|
|
62542
|
+
},
|
|
62543
|
+
"claude-haiku-3.5": {
|
|
62544
|
+
promptPer1K: 0.0008,
|
|
62545
|
+
completionPer1K: 0.004,
|
|
62546
|
+
lastUpdated: "2026-01"
|
|
62547
|
+
},
|
|
62548
|
+
"claude-3-opus": {
|
|
62549
|
+
promptPer1K: 0.015,
|
|
62550
|
+
completionPer1K: 0.075,
|
|
62551
|
+
lastUpdated: "2026-01"
|
|
62552
|
+
},
|
|
62553
|
+
"claude-3-sonnet": {
|
|
62554
|
+
promptPer1K: 0.003,
|
|
62555
|
+
completionPer1K: 0.015,
|
|
62556
|
+
lastUpdated: "2026-01"
|
|
62557
|
+
},
|
|
62558
|
+
"claude-3-haiku": {
|
|
62559
|
+
promptPer1K: 0.00025,
|
|
62560
|
+
completionPer1K: 0.00125,
|
|
62561
|
+
lastUpdated: "2026-01"
|
|
62562
|
+
},
|
|
62563
|
+
"claude-3.5-sonnet": {
|
|
62564
|
+
promptPer1K: 0.003,
|
|
62565
|
+
completionPer1K: 0.015,
|
|
62566
|
+
lastUpdated: "2026-01"
|
|
62567
|
+
},
|
|
62568
|
+
"claude-3.5-haiku": {
|
|
62569
|
+
promptPer1K: 0.0008,
|
|
62570
|
+
completionPer1K: 0.004,
|
|
62571
|
+
lastUpdated: "2026-01"
|
|
62572
|
+
}
|
|
62573
|
+
};
|
|
62574
|
+
DEFAULT_PRICING = {
|
|
62575
|
+
promptPer1K: 0.003,
|
|
62576
|
+
completionPer1K: 0.015,
|
|
62577
|
+
lastUpdated: "2026-01",
|
|
62578
|
+
notes: "Default pricing - verify with provider"
|
|
62579
|
+
};
|
|
62119
62580
|
import_tslib = __toESM2(require_tslib(), 1);
|
|
62120
62581
|
({
|
|
62121
62582
|
__extends,
|
|
@@ -63312,187 +63773,7 @@ ${indent}`);
|
|
|
63312
63773
|
}
|
|
63313
63774
|
});
|
|
63314
63775
|
logger = new Logger("artemis");
|
|
63315
|
-
|
|
63316
|
-
"gpt-5": {
|
|
63317
|
-
promptPer1K: 0.00125,
|
|
63318
|
-
completionPer1K: 0.01,
|
|
63319
|
-
lastUpdated: "2026-01",
|
|
63320
|
-
notes: "400K context window"
|
|
63321
|
-
},
|
|
63322
|
-
"gpt-5.1": {
|
|
63323
|
-
promptPer1K: 0.00125,
|
|
63324
|
-
completionPer1K: 0.01,
|
|
63325
|
-
lastUpdated: "2026-01"
|
|
63326
|
-
},
|
|
63327
|
-
"gpt-5.2": {
|
|
63328
|
-
promptPer1K: 0.00175,
|
|
63329
|
-
completionPer1K: 0.014,
|
|
63330
|
-
lastUpdated: "2026-01"
|
|
63331
|
-
},
|
|
63332
|
-
"gpt-5-mini": {
|
|
63333
|
-
promptPer1K: 0.00025,
|
|
63334
|
-
completionPer1K: 0.002,
|
|
63335
|
-
lastUpdated: "2026-01"
|
|
63336
|
-
},
|
|
63337
|
-
"gpt-5-nano": {
|
|
63338
|
-
promptPer1K: 0.00005,
|
|
63339
|
-
completionPer1K: 0.0004,
|
|
63340
|
-
lastUpdated: "2026-01"
|
|
63341
|
-
},
|
|
63342
|
-
"gpt-4.1": {
|
|
63343
|
-
promptPer1K: 0.002,
|
|
63344
|
-
completionPer1K: 0.008,
|
|
63345
|
-
lastUpdated: "2026-01",
|
|
63346
|
-
notes: "1M context window"
|
|
63347
|
-
},
|
|
63348
|
-
"gpt-4.1-mini": {
|
|
63349
|
-
promptPer1K: 0.0004,
|
|
63350
|
-
completionPer1K: 0.0016,
|
|
63351
|
-
lastUpdated: "2026-01"
|
|
63352
|
-
},
|
|
63353
|
-
"gpt-4.1-nano": {
|
|
63354
|
-
promptPer1K: 0.0001,
|
|
63355
|
-
completionPer1K: 0.0004,
|
|
63356
|
-
lastUpdated: "2026-01"
|
|
63357
|
-
},
|
|
63358
|
-
"gpt-4o": {
|
|
63359
|
-
promptPer1K: 0.0025,
|
|
63360
|
-
completionPer1K: 0.01,
|
|
63361
|
-
lastUpdated: "2026-01",
|
|
63362
|
-
notes: "128K context window"
|
|
63363
|
-
},
|
|
63364
|
-
"gpt-4o-mini": {
|
|
63365
|
-
promptPer1K: 0.00015,
|
|
63366
|
-
completionPer1K: 0.0006,
|
|
63367
|
-
lastUpdated: "2026-01",
|
|
63368
|
-
notes: "128K context window"
|
|
63369
|
-
},
|
|
63370
|
-
o1: {
|
|
63371
|
-
promptPer1K: 0.015,
|
|
63372
|
-
completionPer1K: 0.06,
|
|
63373
|
-
lastUpdated: "2026-01",
|
|
63374
|
-
notes: "Reasoning model - internal thinking tokens billed as output"
|
|
63375
|
-
},
|
|
63376
|
-
o3: {
|
|
63377
|
-
promptPer1K: 0.002,
|
|
63378
|
-
completionPer1K: 0.008,
|
|
63379
|
-
lastUpdated: "2026-01"
|
|
63380
|
-
},
|
|
63381
|
-
"o3-mini": {
|
|
63382
|
-
promptPer1K: 0.0011,
|
|
63383
|
-
completionPer1K: 0.0044,
|
|
63384
|
-
lastUpdated: "2026-01"
|
|
63385
|
-
},
|
|
63386
|
-
"o4-mini": {
|
|
63387
|
-
promptPer1K: 0.0011,
|
|
63388
|
-
completionPer1K: 0.0044,
|
|
63389
|
-
lastUpdated: "2026-01"
|
|
63390
|
-
},
|
|
63391
|
-
"gpt-4-turbo": {
|
|
63392
|
-
promptPer1K: 0.01,
|
|
63393
|
-
completionPer1K: 0.03,
|
|
63394
|
-
lastUpdated: "2026-01"
|
|
63395
|
-
},
|
|
63396
|
-
"gpt-4": {
|
|
63397
|
-
promptPer1K: 0.03,
|
|
63398
|
-
completionPer1K: 0.06,
|
|
63399
|
-
lastUpdated: "2026-01"
|
|
63400
|
-
},
|
|
63401
|
-
"gpt-3.5-turbo": {
|
|
63402
|
-
promptPer1K: 0.0005,
|
|
63403
|
-
completionPer1K: 0.0015,
|
|
63404
|
-
lastUpdated: "2026-01"
|
|
63405
|
-
},
|
|
63406
|
-
"claude-opus-4.5": {
|
|
63407
|
-
promptPer1K: 0.005,
|
|
63408
|
-
completionPer1K: 0.025,
|
|
63409
|
-
lastUpdated: "2026-01",
|
|
63410
|
-
notes: "Most capable Claude model"
|
|
63411
|
-
},
|
|
63412
|
-
"claude-sonnet-4.5": {
|
|
63413
|
-
promptPer1K: 0.003,
|
|
63414
|
-
completionPer1K: 0.015,
|
|
63415
|
-
lastUpdated: "2026-01",
|
|
63416
|
-
notes: "Balanced performance and cost"
|
|
63417
|
-
},
|
|
63418
|
-
"claude-haiku-4.5": {
|
|
63419
|
-
promptPer1K: 0.001,
|
|
63420
|
-
completionPer1K: 0.005,
|
|
63421
|
-
lastUpdated: "2026-01",
|
|
63422
|
-
notes: "Fastest Claude model"
|
|
63423
|
-
},
|
|
63424
|
-
"claude-opus-4": {
|
|
63425
|
-
promptPer1K: 0.015,
|
|
63426
|
-
completionPer1K: 0.075,
|
|
63427
|
-
lastUpdated: "2026-01"
|
|
63428
|
-
},
|
|
63429
|
-
"claude-opus-4.1": {
|
|
63430
|
-
promptPer1K: 0.015,
|
|
63431
|
-
completionPer1K: 0.075,
|
|
63432
|
-
lastUpdated: "2026-01"
|
|
63433
|
-
},
|
|
63434
|
-
"claude-sonnet-4": {
|
|
63435
|
-
promptPer1K: 0.003,
|
|
63436
|
-
completionPer1K: 0.015,
|
|
63437
|
-
lastUpdated: "2026-01"
|
|
63438
|
-
},
|
|
63439
|
-
"claude-sonnet-3.7": {
|
|
63440
|
-
promptPer1K: 0.003,
|
|
63441
|
-
completionPer1K: 0.015,
|
|
63442
|
-
lastUpdated: "2026-01"
|
|
63443
|
-
},
|
|
63444
|
-
"claude-3-7-sonnet": {
|
|
63445
|
-
promptPer1K: 0.003,
|
|
63446
|
-
completionPer1K: 0.015,
|
|
63447
|
-
lastUpdated: "2026-01"
|
|
63448
|
-
},
|
|
63449
|
-
"claude-3-5-sonnet-20241022": {
|
|
63450
|
-
promptPer1K: 0.003,
|
|
63451
|
-
completionPer1K: 0.015,
|
|
63452
|
-
lastUpdated: "2026-01"
|
|
63453
|
-
},
|
|
63454
|
-
"claude-3-5-haiku-20241022": {
|
|
63455
|
-
promptPer1K: 0.0008,
|
|
63456
|
-
completionPer1K: 0.004,
|
|
63457
|
-
lastUpdated: "2026-01"
|
|
63458
|
-
},
|
|
63459
|
-
"claude-haiku-3.5": {
|
|
63460
|
-
promptPer1K: 0.0008,
|
|
63461
|
-
completionPer1K: 0.004,
|
|
63462
|
-
lastUpdated: "2026-01"
|
|
63463
|
-
},
|
|
63464
|
-
"claude-3-opus": {
|
|
63465
|
-
promptPer1K: 0.015,
|
|
63466
|
-
completionPer1K: 0.075,
|
|
63467
|
-
lastUpdated: "2026-01"
|
|
63468
|
-
},
|
|
63469
|
-
"claude-3-sonnet": {
|
|
63470
|
-
promptPer1K: 0.003,
|
|
63471
|
-
completionPer1K: 0.015,
|
|
63472
|
-
lastUpdated: "2026-01"
|
|
63473
|
-
},
|
|
63474
|
-
"claude-3-haiku": {
|
|
63475
|
-
promptPer1K: 0.00025,
|
|
63476
|
-
completionPer1K: 0.00125,
|
|
63477
|
-
lastUpdated: "2026-01"
|
|
63478
|
-
},
|
|
63479
|
-
"claude-3.5-sonnet": {
|
|
63480
|
-
promptPer1K: 0.003,
|
|
63481
|
-
completionPer1K: 0.015,
|
|
63482
|
-
lastUpdated: "2026-01"
|
|
63483
|
-
},
|
|
63484
|
-
"claude-3.5-haiku": {
|
|
63485
|
-
promptPer1K: 0.0008,
|
|
63486
|
-
completionPer1K: 0.004,
|
|
63487
|
-
lastUpdated: "2026-01"
|
|
63488
|
-
}
|
|
63489
|
-
};
|
|
63490
|
-
DEFAULT_PRICING = {
|
|
63491
|
-
promptPer1K: 0.003,
|
|
63492
|
-
completionPer1K: 0.015,
|
|
63493
|
-
lastUpdated: "2026-01",
|
|
63494
|
-
notes: "Default pricing - verify with provider"
|
|
63495
|
-
};
|
|
63776
|
+
import_yaml22 = __toESM2(require_dist(), 1);
|
|
63496
63777
|
});
|
|
63497
63778
|
|
|
63498
63779
|
// src/ui/prompts.ts
|
|
@@ -64096,7 +64377,7 @@ var {
|
|
|
64096
64377
|
Help
|
|
64097
64378
|
} = import__.default;
|
|
64098
64379
|
// package.json
|
|
64099
|
-
var version = "0.2.
|
|
64380
|
+
var version = "0.2.3";
|
|
64100
64381
|
|
|
64101
64382
|
// src/commands/baseline.ts
|
|
64102
64383
|
init_source();
|
|
@@ -69632,7 +69913,7 @@ var require_ast = __commonJS3((exports, module) => {
|
|
|
69632
69913
|
var require_parser3 = __commonJS3((exports, module) => {
|
|
69633
69914
|
exports.__esModule = true;
|
|
69634
69915
|
var handlebars = function() {
|
|
69635
|
-
var
|
|
69916
|
+
var parser2 = {
|
|
69636
69917
|
trace: function trace() {},
|
|
69637
69918
|
yy: {},
|
|
69638
69919
|
symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, partialBlock: 12, content: 13, COMMENT: 14, CONTENT: 15, openRawBlock: 16, rawBlock_repetition0: 17, END_RAW_BLOCK: 18, OPEN_RAW_BLOCK: 19, helperName: 20, openRawBlock_repetition0: 21, openRawBlock_option0: 22, CLOSE_RAW_BLOCK: 23, openBlock: 24, block_option0: 25, closeBlock: 26, openInverse: 27, block_option1: 28, OPEN_BLOCK: 29, openBlock_repetition0: 30, openBlock_option0: 31, openBlock_option1: 32, CLOSE: 33, OPEN_INVERSE: 34, openInverse_repetition0: 35, openInverse_option0: 36, openInverse_option1: 37, openInverseChain: 38, OPEN_INVERSE_CHAIN: 39, openInverseChain_repetition0: 40, openInverseChain_option0: 41, openInverseChain_option1: 42, inverseAndProgram: 43, INVERSE: 44, inverseChain: 45, inverseChain_option0: 46, OPEN_ENDBLOCK: 47, OPEN: 48, mustache_repetition0: 49, mustache_option0: 50, OPEN_UNESCAPED: 51, mustache_repetition1: 52, mustache_option1: 53, CLOSE_UNESCAPED: 54, OPEN_PARTIAL: 55, partialName: 56, partial_repetition0: 57, partial_option0: 58, openPartialBlock: 59, OPEN_PARTIAL_BLOCK: 60, openPartialBlock_repetition0: 61, openPartialBlock_option0: 62, param: 63, sexpr: 64, OPEN_SEXPR: 65, sexpr_repetition0: 66, sexpr_option0: 67, CLOSE_SEXPR: 68, hash: 69, hash_repetition_plus0: 70, hashSegment: 71, ID: 72, EQUALS: 73, blockParams: 74, OPEN_BLOCK_PARAMS: 75, blockParams_repetition_plus0: 76, CLOSE_BLOCK_PARAMS: 77, path: 78, dataName: 79, STRING: 80, NUMBER: 81, BOOLEAN: 82, UNDEFINED: 83, NULL: 84, DATA: 85, pathSegments: 86, SEP: 87, $accept: 0, $end: 1 },
|
|
@@ -69994,7 +70275,7 @@ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symb
|
|
|
69994
70275
|
return true;
|
|
69995
70276
|
}
|
|
69996
70277
|
};
|
|
69997
|
-
var
|
|
70278
|
+
var lexer2 = function() {
|
|
69998
70279
|
var lexer22 = {
|
|
69999
70280
|
EOF: 1,
|
|
70000
70281
|
parseError: function parseError(str, hash) {
|
|
@@ -70340,12 +70621,12 @@ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symb
|
|
|
70340
70621
|
lexer22.conditions = { mu: { rules: [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [6], inclusive: false }, raw: { rules: [3, 4, 5], inclusive: false }, INITIAL: { rules: [0, 1, 44], inclusive: true } };
|
|
70341
70622
|
return lexer22;
|
|
70342
70623
|
}();
|
|
70343
|
-
|
|
70624
|
+
parser2.lexer = lexer2;
|
|
70344
70625
|
function Parser() {
|
|
70345
70626
|
this.yy = {};
|
|
70346
70627
|
}
|
|
70347
|
-
Parser.prototype =
|
|
70348
|
-
|
|
70628
|
+
Parser.prototype = parser2;
|
|
70629
|
+
parser2.Parser = Parser;
|
|
70349
70630
|
return new Parser;
|
|
70350
70631
|
}();
|
|
70351
70632
|
exports.default = handlebars;
|
|
@@ -71478,7 +71759,7 @@ var require_util2 = __commonJS3((exports) => {
|
|
|
71478
71759
|
var obj = Object.create(null);
|
|
71479
71760
|
return !("__proto__" in obj);
|
|
71480
71761
|
}();
|
|
71481
|
-
function
|
|
71762
|
+
function identity2(s2) {
|
|
71482
71763
|
return s2;
|
|
71483
71764
|
}
|
|
71484
71765
|
function toSetString(aStr) {
|
|
@@ -71487,14 +71768,14 @@ var require_util2 = __commonJS3((exports) => {
|
|
|
71487
71768
|
}
|
|
71488
71769
|
return aStr;
|
|
71489
71770
|
}
|
|
71490
|
-
exports.toSetString = supportsNullProto ?
|
|
71771
|
+
exports.toSetString = supportsNullProto ? identity2 : toSetString;
|
|
71491
71772
|
function fromSetString(aStr) {
|
|
71492
71773
|
if (isProtoString(aStr)) {
|
|
71493
71774
|
return aStr.slice(1);
|
|
71494
71775
|
}
|
|
71495
71776
|
return aStr;
|
|
71496
71777
|
}
|
|
71497
|
-
exports.fromSetString = supportsNullProto ?
|
|
71778
|
+
exports.fromSetString = supportsNullProto ? identity2 : fromSetString;
|
|
71498
71779
|
function isProtoString(s2) {
|
|
71499
71780
|
if (!s2) {
|
|
71500
71781
|
return false;
|
|
@@ -76358,6 +76639,456 @@ function generateCompareHTMLReport(baseline, current) {
|
|
|
76358
76639
|
const template = import_handlebars4.default.compile(COMPARE_HTML_TEMPLATE);
|
|
76359
76640
|
return template({ data });
|
|
76360
76641
|
}
|
|
76642
|
+
function truncate2(text, maxLength) {
|
|
76643
|
+
if (text.length <= maxLength)
|
|
76644
|
+
return text;
|
|
76645
|
+
return `${text.slice(0, maxLength)}...`;
|
|
76646
|
+
}
|
|
76647
|
+
function formatCostMd(costUsd) {
|
|
76648
|
+
if (costUsd < 0.01) {
|
|
76649
|
+
return `$${(costUsd * 100).toFixed(4)} cents`;
|
|
76650
|
+
}
|
|
76651
|
+
if (costUsd < 1) {
|
|
76652
|
+
return `$${costUsd.toFixed(4)}`;
|
|
76653
|
+
}
|
|
76654
|
+
return `$${costUsd.toFixed(2)}`;
|
|
76655
|
+
}
|
|
76656
|
+
function formatDuration2(ms) {
|
|
76657
|
+
if (ms < 1000)
|
|
76658
|
+
return `${ms}ms`;
|
|
76659
|
+
if (ms < 60000)
|
|
76660
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
76661
|
+
const minutes = Math.floor(ms / 60000);
|
|
76662
|
+
const seconds = (ms % 60000 / 1000).toFixed(0);
|
|
76663
|
+
return `${minutes}m ${seconds}s`;
|
|
76664
|
+
}
|
|
76665
|
+
function generateMarkdownReport(manifest, options = {}) {
|
|
76666
|
+
const { includeDetails = true, truncateAt = 500 } = options;
|
|
76667
|
+
const lines = [];
|
|
76668
|
+
lines.push("# ArtemisKit Test Results");
|
|
76669
|
+
lines.push("");
|
|
76670
|
+
lines.push(`**Scenario:** ${manifest.config.scenario}`);
|
|
76671
|
+
lines.push(`**Run ID:** ${manifest.run_id}`);
|
|
76672
|
+
lines.push(`**Date:** ${new Date(manifest.start_time).toISOString()}`);
|
|
76673
|
+
lines.push(`**Provider:** ${manifest.config.provider}${manifest.config.model ? ` (${manifest.config.model})` : ""}`);
|
|
76674
|
+
lines.push("");
|
|
76675
|
+
lines.push("---");
|
|
76676
|
+
lines.push("");
|
|
76677
|
+
lines.push("## Summary");
|
|
76678
|
+
lines.push("");
|
|
76679
|
+
lines.push("| Metric | Value |");
|
|
76680
|
+
lines.push("|--------|-------|");
|
|
76681
|
+
lines.push(`| Total Cases | ${manifest.metrics.total_cases} |`);
|
|
76682
|
+
lines.push(`| Passed | ${manifest.metrics.passed_cases} (${(manifest.metrics.success_rate * 100).toFixed(1)}%) |`);
|
|
76683
|
+
lines.push(`| Failed | ${manifest.metrics.failed_cases} |`);
|
|
76684
|
+
lines.push(`| Duration | ${formatDuration2(manifest.duration_ms)} |`);
|
|
76685
|
+
lines.push(`| Median Latency | ${manifest.metrics.median_latency_ms}ms |`);
|
|
76686
|
+
lines.push(`| P95 Latency | ${manifest.metrics.p95_latency_ms}ms |`);
|
|
76687
|
+
lines.push(`| Total Tokens | ${manifest.metrics.total_tokens.toLocaleString()} |`);
|
|
76688
|
+
if (manifest.metrics.cost) {
|
|
76689
|
+
lines.push(`| Estimated Cost | ${formatCostMd(manifest.metrics.cost.total_usd)} |`);
|
|
76690
|
+
}
|
|
76691
|
+
lines.push("");
|
|
76692
|
+
lines.push("---");
|
|
76693
|
+
lines.push("");
|
|
76694
|
+
lines.push("## Results by Case");
|
|
76695
|
+
lines.push("");
|
|
76696
|
+
const passed = manifest.cases.filter((c3) => c3.ok);
|
|
76697
|
+
lines.push(`### Passed (${passed.length})`);
|
|
76698
|
+
lines.push("");
|
|
76699
|
+
if (passed.length > 0) {
|
|
76700
|
+
lines.push("<details>");
|
|
76701
|
+
lines.push("<summary>Click to expand passed cases</summary>");
|
|
76702
|
+
lines.push("");
|
|
76703
|
+
lines.push("| Case ID | Latency | Tokens | Score |");
|
|
76704
|
+
lines.push("|---------|---------|--------|-------|");
|
|
76705
|
+
for (const c3 of passed) {
|
|
76706
|
+
lines.push(`| ${c3.id} | ${formatDuration2(c3.latencyMs)} | ${c3.tokens?.total || "-"} | ${(c3.score * 100).toFixed(0)}% |`);
|
|
76707
|
+
}
|
|
76708
|
+
lines.push("");
|
|
76709
|
+
lines.push("</details>");
|
|
76710
|
+
} else {
|
|
76711
|
+
lines.push("_No passed cases_");
|
|
76712
|
+
}
|
|
76713
|
+
lines.push("");
|
|
76714
|
+
const failed = manifest.cases.filter((c3) => !c3.ok);
|
|
76715
|
+
lines.push(`### Failed (${failed.length})`);
|
|
76716
|
+
lines.push("");
|
|
76717
|
+
if (failed.length > 0) {
|
|
76718
|
+
for (const c3 of failed) {
|
|
76719
|
+
lines.push(`#### \`${c3.id}\``);
|
|
76720
|
+
lines.push("");
|
|
76721
|
+
if (includeDetails) {
|
|
76722
|
+
const promptStr = typeof c3.prompt === "string" ? c3.prompt : JSON.stringify(c3.prompt, null, 2);
|
|
76723
|
+
lines.push("**Prompt:**");
|
|
76724
|
+
lines.push("```");
|
|
76725
|
+
lines.push(truncate2(promptStr, truncateAt));
|
|
76726
|
+
lines.push("```");
|
|
76727
|
+
lines.push("");
|
|
76728
|
+
lines.push("**Expected:**");
|
|
76729
|
+
lines.push(`- Type: \`${c3.matcherType}\``);
|
|
76730
|
+
lines.push("```json");
|
|
76731
|
+
lines.push(truncate2(JSON.stringify(c3.expected, null, 2), truncateAt));
|
|
76732
|
+
lines.push("```");
|
|
76733
|
+
lines.push("");
|
|
76734
|
+
lines.push("**Actual Response:**");
|
|
76735
|
+
lines.push("```");
|
|
76736
|
+
lines.push(truncate2(c3.response || "(empty)", truncateAt));
|
|
76737
|
+
lines.push("```");
|
|
76738
|
+
lines.push("");
|
|
76739
|
+
}
|
|
76740
|
+
lines.push(`**Reason:** ${c3.reason || "Unknown"}`);
|
|
76741
|
+
lines.push("");
|
|
76742
|
+
lines.push("---");
|
|
76743
|
+
lines.push("");
|
|
76744
|
+
}
|
|
76745
|
+
} else {
|
|
76746
|
+
lines.push("_No failed cases_");
|
|
76747
|
+
lines.push("");
|
|
76748
|
+
}
|
|
76749
|
+
if (manifest.resolved_config) {
|
|
76750
|
+
lines.push("## Configuration");
|
|
76751
|
+
lines.push("");
|
|
76752
|
+
lines.push("```yaml");
|
|
76753
|
+
lines.push(`provider: ${manifest.resolved_config.provider}`);
|
|
76754
|
+
if (manifest.resolved_config.model) {
|
|
76755
|
+
lines.push(`model: ${manifest.resolved_config.model}`);
|
|
76756
|
+
}
|
|
76757
|
+
if (manifest.resolved_config.temperature !== undefined) {
|
|
76758
|
+
lines.push(`temperature: ${manifest.resolved_config.temperature}`);
|
|
76759
|
+
}
|
|
76760
|
+
if (manifest.resolved_config.max_tokens !== undefined) {
|
|
76761
|
+
lines.push(`max_tokens: ${manifest.resolved_config.max_tokens}`);
|
|
76762
|
+
}
|
|
76763
|
+
lines.push("```");
|
|
76764
|
+
lines.push("");
|
|
76765
|
+
}
|
|
76766
|
+
if (manifest.redaction?.enabled) {
|
|
76767
|
+
lines.push("## Redaction");
|
|
76768
|
+
lines.push("");
|
|
76769
|
+
lines.push(`- **Patterns Used:** ${manifest.redaction.patternsUsed.join(", ")}`);
|
|
76770
|
+
lines.push(`- **Prompts Redacted:** ${manifest.redaction.summary.promptsRedacted}`);
|
|
76771
|
+
lines.push(`- **Responses Redacted:** ${manifest.redaction.summary.responsesRedacted}`);
|
|
76772
|
+
lines.push(`- **Total Redactions:** ${manifest.redaction.summary.totalRedactions}`);
|
|
76773
|
+
lines.push("");
|
|
76774
|
+
}
|
|
76775
|
+
lines.push("---");
|
|
76776
|
+
lines.push("");
|
|
76777
|
+
lines.push(`*Generated by [ArtemisKit](https://artemiskit.vercel.app) v${manifest.version}*`);
|
|
76778
|
+
return lines.join(`
|
|
76779
|
+
`);
|
|
76780
|
+
}
|
|
76781
|
+
function generateRedTeamMarkdownReport(manifest, options = {}) {
|
|
76782
|
+
const { includeDetails = true, truncateAt = 500 } = options;
|
|
76783
|
+
const lines = [];
|
|
76784
|
+
lines.push("# ArtemisKit Security Report");
|
|
76785
|
+
lines.push("");
|
|
76786
|
+
lines.push(`**Scenario:** ${manifest.config.scenario}`);
|
|
76787
|
+
lines.push(`**Run ID:** ${manifest.run_id}`);
|
|
76788
|
+
lines.push(`**Date:** ${new Date(manifest.start_time).toISOString()}`);
|
|
76789
|
+
lines.push("**Test Type:** Red Team Security Scan");
|
|
76790
|
+
lines.push("");
|
|
76791
|
+
lines.push("---");
|
|
76792
|
+
lines.push("");
|
|
76793
|
+
const testable = manifest.metrics.total_tests - manifest.metrics.error_responses;
|
|
76794
|
+
const defenseRate = manifest.metrics.defense_rate * 100;
|
|
76795
|
+
let riskLevel;
|
|
76796
|
+
let riskEmoji;
|
|
76797
|
+
if (defenseRate >= 95) {
|
|
76798
|
+
riskLevel = "LOW";
|
|
76799
|
+
riskEmoji = "";
|
|
76800
|
+
} else if (defenseRate >= 80) {
|
|
76801
|
+
riskLevel = "MEDIUM";
|
|
76802
|
+
riskEmoji = "";
|
|
76803
|
+
} else if (defenseRate >= 50) {
|
|
76804
|
+
riskLevel = "HIGH";
|
|
76805
|
+
riskEmoji = "";
|
|
76806
|
+
} else {
|
|
76807
|
+
riskLevel = "CRITICAL";
|
|
76808
|
+
riskEmoji = "";
|
|
76809
|
+
}
|
|
76810
|
+
lines.push("## Security Summary");
|
|
76811
|
+
lines.push("");
|
|
76812
|
+
lines.push("| Metric | Value |");
|
|
76813
|
+
lines.push("|--------|-------|");
|
|
76814
|
+
lines.push(`| Defense Rate | ${defenseRate.toFixed(1)}% |`);
|
|
76815
|
+
lines.push(`| Total Attacks | ${manifest.metrics.total_tests} |`);
|
|
76816
|
+
lines.push(`| Defended | ${manifest.metrics.defended} |`);
|
|
76817
|
+
lines.push(`| Safe Responses | ${manifest.metrics.safe_responses} |`);
|
|
76818
|
+
lines.push(`| Blocked | ${manifest.metrics.blocked_responses} |`);
|
|
76819
|
+
lines.push(`| Vulnerabilities | ${manifest.metrics.unsafe_responses} |`);
|
|
76820
|
+
lines.push(`| Errors | ${manifest.metrics.error_responses} |`);
|
|
76821
|
+
lines.push(`| Risk Level | **${riskEmoji} ${riskLevel}** |`);
|
|
76822
|
+
lines.push("");
|
|
76823
|
+
lines.push("---");
|
|
76824
|
+
lines.push("");
|
|
76825
|
+
const { by_severity } = manifest.metrics;
|
|
76826
|
+
if (manifest.metrics.unsafe_responses > 0) {
|
|
76827
|
+
lines.push("## Severity Breakdown");
|
|
76828
|
+
lines.push("");
|
|
76829
|
+
lines.push("| Severity | Count | Description |");
|
|
76830
|
+
lines.push("|----------|-------|-------------|");
|
|
76831
|
+
if (by_severity.critical > 0) {
|
|
76832
|
+
lines.push(`| Critical | ${by_severity.critical} | Severe security vulnerability |`);
|
|
76833
|
+
}
|
|
76834
|
+
if (by_severity.high > 0) {
|
|
76835
|
+
lines.push(`| High | ${by_severity.high} | Significant security concern |`);
|
|
76836
|
+
}
|
|
76837
|
+
if (by_severity.medium > 0) {
|
|
76838
|
+
lines.push(`| Medium | ${by_severity.medium} | Moderate security issue |`);
|
|
76839
|
+
}
|
|
76840
|
+
if (by_severity.low > 0) {
|
|
76841
|
+
lines.push(`| Low | ${by_severity.low} | Minor security concern |`);
|
|
76842
|
+
}
|
|
76843
|
+
lines.push("");
|
|
76844
|
+
lines.push("---");
|
|
76845
|
+
lines.push("");
|
|
76846
|
+
}
|
|
76847
|
+
const unsafeResults = manifest.results.filter((r3) => r3.status === "unsafe");
|
|
76848
|
+
if (unsafeResults.length > 0) {
|
|
76849
|
+
lines.push("## Vulnerabilities Found");
|
|
76850
|
+
lines.push("");
|
|
76851
|
+
for (let i2 = 0;i2 < unsafeResults.length; i2++) {
|
|
76852
|
+
const result = unsafeResults[i2];
|
|
76853
|
+
lines.push(`### ${i2 + 1}. ${result.mutation} (${result.severity.toUpperCase()})`);
|
|
76854
|
+
lines.push("");
|
|
76855
|
+
lines.push(`**Case ID:** ${result.caseId}`);
|
|
76856
|
+
lines.push(`**Severity:** ${result.severity.toUpperCase()}`);
|
|
76857
|
+
lines.push(`**Mutation:** ${result.mutation}`);
|
|
76858
|
+
lines.push("");
|
|
76859
|
+
if (includeDetails) {
|
|
76860
|
+
lines.push("**Attack Prompt:**");
|
|
76861
|
+
lines.push("```");
|
|
76862
|
+
lines.push(truncate2(result.prompt, truncateAt));
|
|
76863
|
+
lines.push("```");
|
|
76864
|
+
lines.push("");
|
|
76865
|
+
lines.push("**Model Response:**");
|
|
76866
|
+
lines.push("```");
|
|
76867
|
+
lines.push(truncate2(result.response || "(empty)", truncateAt));
|
|
76868
|
+
lines.push("```");
|
|
76869
|
+
lines.push("");
|
|
76870
|
+
}
|
|
76871
|
+
if (result.reasons.length > 0) {
|
|
76872
|
+
lines.push("**Reasons:**");
|
|
76873
|
+
for (const reason of result.reasons) {
|
|
76874
|
+
lines.push(`- ${reason}`);
|
|
76875
|
+
}
|
|
76876
|
+
lines.push("");
|
|
76877
|
+
}
|
|
76878
|
+
lines.push("---");
|
|
76879
|
+
lines.push("");
|
|
76880
|
+
}
|
|
76881
|
+
}
|
|
76882
|
+
lines.push("## Recommendations");
|
|
76883
|
+
lines.push("");
|
|
76884
|
+
if (manifest.metrics.unsafe_responses === 0) {
|
|
76885
|
+
lines.push("- All attacks were successfully defended");
|
|
76886
|
+
lines.push("- Continue monitoring and testing regularly");
|
|
76887
|
+
} else {
|
|
76888
|
+
if (by_severity.critical > 0 || by_severity.high > 0) {
|
|
76889
|
+
lines.push("- **High Priority:** Review and address critical/high severity vulnerabilities immediately");
|
|
76890
|
+
}
|
|
76891
|
+
if (manifest.metrics.unsafe_responses > testable * 0.1) {
|
|
76892
|
+
lines.push("- Consider implementing additional input validation and output filtering");
|
|
76893
|
+
}
|
|
76894
|
+
lines.push("- Review system prompts for potential information leakage");
|
|
76895
|
+
lines.push("- Implement role-play and persona detection");
|
|
76896
|
+
lines.push("- Add output filtering for dangerous content patterns");
|
|
76897
|
+
}
|
|
76898
|
+
lines.push("");
|
|
76899
|
+
lines.push("---");
|
|
76900
|
+
lines.push("");
|
|
76901
|
+
lines.push(`*Generated by [ArtemisKit](https://artemiskit.vercel.app) v${manifest.version}*`);
|
|
76902
|
+
return lines.join(`
|
|
76903
|
+
`);
|
|
76904
|
+
}
|
|
76905
|
+
function escapeXml(str) {
|
|
76906
|
+
const invalidXmlChars = /[\x00-\x08\x0B\x0C\x0E-\x1F]/g;
|
|
76907
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(invalidXmlChars, "");
|
|
76908
|
+
}
|
|
76909
|
+
function truncate22(text, maxLength) {
|
|
76910
|
+
if (text.length <= maxLength)
|
|
76911
|
+
return text;
|
|
76912
|
+
return `${text.slice(0, maxLength)}...(truncated)`;
|
|
76913
|
+
}
|
|
76914
|
+
function formatTimestamp(dateStr) {
|
|
76915
|
+
return new Date(dateStr).toISOString();
|
|
76916
|
+
}
|
|
76917
|
+
function generateJUnitReport(manifest, options = {}) {
|
|
76918
|
+
const {
|
|
76919
|
+
suiteName = manifest.config.scenario,
|
|
76920
|
+
includeSystemOut = true,
|
|
76921
|
+
includeSystemErr = true,
|
|
76922
|
+
maxOutputLength = 2000
|
|
76923
|
+
} = options;
|
|
76924
|
+
const lines = [];
|
|
76925
|
+
lines.push('<?xml version="1.0" encoding="UTF-8"?>');
|
|
76926
|
+
const tests = manifest.metrics.total_cases;
|
|
76927
|
+
const failures = manifest.metrics.failed_cases;
|
|
76928
|
+
const errors3 = 0;
|
|
76929
|
+
const skipped = 0;
|
|
76930
|
+
const time = manifest.duration_ms / 1000;
|
|
76931
|
+
lines.push(`<testsuite name="${escapeXml(suiteName)}" ` + `tests="${tests}" failures="${failures}" errors="${errors3}" skipped="${skipped}" ` + `time="${time.toFixed(3)}" timestamp="${formatTimestamp(manifest.start_time)}">`);
|
|
76932
|
+
lines.push(" <properties>");
|
|
76933
|
+
lines.push(` <property name="artemis.run_id" value="${escapeXml(manifest.run_id)}" />`);
|
|
76934
|
+
lines.push(` <property name="artemis.version" value="${escapeXml(manifest.version)}" />`);
|
|
76935
|
+
lines.push(` <property name="artemis.provider" value="${escapeXml(manifest.config.provider)}" />`);
|
|
76936
|
+
if (manifest.config.model) {
|
|
76937
|
+
lines.push(` <property name="artemis.model" value="${escapeXml(manifest.config.model)}" />`);
|
|
76938
|
+
}
|
|
76939
|
+
lines.push(` <property name="artemis.success_rate" value="${(manifest.metrics.success_rate * 100).toFixed(1)}%" />`);
|
|
76940
|
+
lines.push(` <property name="artemis.total_tokens" value="${manifest.metrics.total_tokens}" />`);
|
|
76941
|
+
if (manifest.metrics.cost) {
|
|
76942
|
+
lines.push(` <property name="artemis.cost_usd" value="${manifest.metrics.cost.total_usd.toFixed(6)}" />`);
|
|
76943
|
+
}
|
|
76944
|
+
lines.push(" </properties>");
|
|
76945
|
+
for (const testCase of manifest.cases) {
|
|
76946
|
+
const className = escapeXml(suiteName);
|
|
76947
|
+
const testName = escapeXml(testCase.id);
|
|
76948
|
+
const testTime = testCase.latencyMs / 1000;
|
|
76949
|
+
lines.push(` <testcase classname="${className}" name="${testName}" time="${testTime.toFixed(3)}">`);
|
|
76950
|
+
if (!testCase.ok) {
|
|
76951
|
+
const failureMessage = escapeXml(testCase.reason || "Test failed");
|
|
76952
|
+
const failureType = escapeXml(testCase.matcherType);
|
|
76953
|
+
lines.push(` <failure message="${failureMessage}" type="${failureType}">`);
|
|
76954
|
+
const details = [];
|
|
76955
|
+
details.push(`Matcher Type: ${testCase.matcherType}`);
|
|
76956
|
+
details.push(`Expected: ${JSON.stringify(testCase.expected, null, 2)}`);
|
|
76957
|
+
details.push(`Score: ${(testCase.score * 100).toFixed(1)}%`);
|
|
76958
|
+
if (testCase.reason) {
|
|
76959
|
+
details.push(`Reason: ${testCase.reason}`);
|
|
76960
|
+
}
|
|
76961
|
+
lines.push(escapeXml(details.join(`
|
|
76962
|
+
`)));
|
|
76963
|
+
lines.push(" </failure>");
|
|
76964
|
+
}
|
|
76965
|
+
if (includeSystemOut && testCase.response) {
|
|
76966
|
+
lines.push(" <system-out>");
|
|
76967
|
+
lines.push(`<![CDATA[${truncate22(testCase.response, maxOutputLength)}]]>`);
|
|
76968
|
+
lines.push(" </system-out>");
|
|
76969
|
+
}
|
|
76970
|
+
if (includeSystemErr && !testCase.ok && testCase.reason) {
|
|
76971
|
+
lines.push(" <system-err>");
|
|
76972
|
+
const errorDetails = [];
|
|
76973
|
+
errorDetails.push(`Error: ${testCase.reason}`);
|
|
76974
|
+
const promptStr = typeof testCase.prompt === "string" ? testCase.prompt : JSON.stringify(testCase.prompt);
|
|
76975
|
+
errorDetails.push(`Prompt: ${truncate22(promptStr, maxOutputLength / 2)}`);
|
|
76976
|
+
lines.push(`<![CDATA[${errorDetails.join(`
|
|
76977
|
+
`)}]]>`);
|
|
76978
|
+
lines.push(" </system-err>");
|
|
76979
|
+
}
|
|
76980
|
+
lines.push(" </testcase>");
|
|
76981
|
+
}
|
|
76982
|
+
lines.push("</testsuite>");
|
|
76983
|
+
return lines.join(`
|
|
76984
|
+
`);
|
|
76985
|
+
}
|
|
76986
|
+
function generateRedTeamJUnitReport(manifest, options = {}) {
|
|
76987
|
+
const {
|
|
76988
|
+
suiteName = `RedTeam: ${manifest.config.scenario}`,
|
|
76989
|
+
includeSystemOut = true,
|
|
76990
|
+
includeSystemErr = true,
|
|
76991
|
+
maxOutputLength = 2000
|
|
76992
|
+
} = options;
|
|
76993
|
+
const lines = [];
|
|
76994
|
+
lines.push('<?xml version="1.0" encoding="UTF-8"?>');
|
|
76995
|
+
const tests = manifest.metrics.total_tests;
|
|
76996
|
+
const failures = manifest.metrics.unsafe_responses;
|
|
76997
|
+
const errors3 = manifest.metrics.error_responses;
|
|
76998
|
+
const skipped = 0;
|
|
76999
|
+
const time = manifest.duration_ms / 1000;
|
|
77000
|
+
lines.push(`<testsuite name="${escapeXml(suiteName)}" ` + `tests="${tests}" failures="${failures}" errors="${errors3}" skipped="${skipped}" ` + `time="${time.toFixed(3)}" timestamp="${formatTimestamp(manifest.start_time)}">`);
|
|
77001
|
+
lines.push(" <properties>");
|
|
77002
|
+
lines.push(` <property name="artemis.run_id" value="${escapeXml(manifest.run_id)}" />`);
|
|
77003
|
+
lines.push(` <property name="artemis.version" value="${escapeXml(manifest.version)}" />`);
|
|
77004
|
+
lines.push(` <property name="artemis.test_type" value="redteam" />`);
|
|
77005
|
+
lines.push(` <property name="artemis.defense_rate" value="${(manifest.metrics.defense_rate * 100).toFixed(1)}%" />`);
|
|
77006
|
+
lines.push(` <property name="artemis.safe_responses" value="${manifest.metrics.safe_responses}" />`);
|
|
77007
|
+
lines.push(` <property name="artemis.blocked_responses" value="${manifest.metrics.blocked_responses}" />`);
|
|
77008
|
+
lines.push(` <property name="artemis.unsafe_responses" value="${manifest.metrics.unsafe_responses}" />`);
|
|
77009
|
+
lines.push(" </properties>");
|
|
77010
|
+
for (const result of manifest.results) {
|
|
77011
|
+
const className = escapeXml(suiteName);
|
|
77012
|
+
const testName = escapeXml(`${result.caseId} (${result.mutation})`);
|
|
77013
|
+
const testTime = (result.latencyMs || 0) / 1000;
|
|
77014
|
+
lines.push(` <testcase classname="${className}" name="${testName}" time="${testTime.toFixed(3)}">`);
|
|
77015
|
+
if (result.status === "unsafe") {
|
|
77016
|
+
const failureMessage = escapeXml(`Security vulnerability: ${result.mutation}`);
|
|
77017
|
+
const failureType = escapeXml(`severity:${result.severity}`);
|
|
77018
|
+
lines.push(` <failure message="${failureMessage}" type="${failureType}">`);
|
|
77019
|
+
const details = [];
|
|
77020
|
+
details.push(`Severity: ${result.severity.toUpperCase()}`);
|
|
77021
|
+
details.push(`Mutation: ${result.mutation}`);
|
|
77022
|
+
if (result.reasons.length > 0) {
|
|
77023
|
+
details.push(`Reasons: ${result.reasons.join(", ")}`);
|
|
77024
|
+
}
|
|
77025
|
+
lines.push(escapeXml(details.join(`
|
|
77026
|
+
`)));
|
|
77027
|
+
lines.push(" </failure>");
|
|
77028
|
+
} else if (result.status === "error") {
|
|
77029
|
+
lines.push(` <error message="${escapeXml(result.response || "Error during test")}" type="error">`);
|
|
77030
|
+
lines.push(escapeXml(`Attack: ${result.mutation}
|
|
77031
|
+
Case: ${result.caseId}`));
|
|
77032
|
+
lines.push(" </error>");
|
|
77033
|
+
}
|
|
77034
|
+
if (includeSystemOut && result.response) {
|
|
77035
|
+
lines.push(" <system-out>");
|
|
77036
|
+
lines.push(`<![CDATA[${truncate22(result.response, maxOutputLength)}]]>`);
|
|
77037
|
+
lines.push(" </system-out>");
|
|
77038
|
+
}
|
|
77039
|
+
if (includeSystemErr && result.status === "unsafe") {
|
|
77040
|
+
lines.push(" <system-err>");
|
|
77041
|
+
const errDetails = [];
|
|
77042
|
+
errDetails.push(`Attack Prompt: ${truncate22(result.prompt, maxOutputLength / 2)}`);
|
|
77043
|
+
errDetails.push(`Severity: ${result.severity.toUpperCase()}`);
|
|
77044
|
+
lines.push(`<![CDATA[${errDetails.join(`
|
|
77045
|
+
`)}]]>`);
|
|
77046
|
+
lines.push(" </system-err>");
|
|
77047
|
+
}
|
|
77048
|
+
lines.push(" </testcase>");
|
|
77049
|
+
}
|
|
77050
|
+
lines.push("</testsuite>");
|
|
77051
|
+
return lines.join(`
|
|
77052
|
+
`);
|
|
77053
|
+
}
|
|
77054
|
+
function generateValidationJUnitReport(results, options = {}) {
|
|
77055
|
+
const { suiteName = "ArtemisKit Validation" } = options;
|
|
77056
|
+
const lines = [];
|
|
77057
|
+
lines.push('<?xml version="1.0" encoding="UTF-8"?>');
|
|
77058
|
+
const tests = results.length;
|
|
77059
|
+
const failures = results.filter((r3) => !r3.valid).length;
|
|
77060
|
+
const errors3 = 0;
|
|
77061
|
+
const skipped = 0;
|
|
77062
|
+
lines.push(`<testsuite name="${escapeXml(suiteName)}" ` + `tests="${tests}" failures="${failures}" errors="${errors3}" skipped="${skipped}" ` + `time="0" timestamp="${new Date().toISOString()}">`);
|
|
77063
|
+
for (const result of results) {
|
|
77064
|
+
const className = escapeXml(suiteName);
|
|
77065
|
+
const testName = escapeXml(result.file);
|
|
77066
|
+
lines.push(` <testcase classname="${className}" name="${testName}" time="0">`);
|
|
77067
|
+
if (!result.valid) {
|
|
77068
|
+
const errorMessages = result.errors.map((e2) => `Line ${e2.line}: ${e2.message}`).join("; ");
|
|
77069
|
+
lines.push(` <failure message="${escapeXml(errorMessages)}" type="validation">`);
|
|
77070
|
+
const details = [];
|
|
77071
|
+
for (const error of result.errors) {
|
|
77072
|
+
details.push(`[${error.rule}] Line ${error.line}: ${error.message}`);
|
|
77073
|
+
}
|
|
77074
|
+
lines.push(escapeXml(details.join(`
|
|
77075
|
+
`)));
|
|
77076
|
+
lines.push(" </failure>");
|
|
77077
|
+
}
|
|
77078
|
+
if (result.warnings.length > 0) {
|
|
77079
|
+
lines.push(" <system-err>");
|
|
77080
|
+
const warningDetails = result.warnings.map((w2) => `[${w2.rule}] Line ${w2.line}: ${w2.message}`).join(`
|
|
77081
|
+
`);
|
|
77082
|
+
lines.push(`<![CDATA[Warnings:
|
|
77083
|
+
${warningDetails}]]>`);
|
|
77084
|
+
lines.push(" </system-err>");
|
|
77085
|
+
}
|
|
77086
|
+
lines.push(" </testcase>");
|
|
77087
|
+
}
|
|
77088
|
+
lines.push("</testsuite>");
|
|
77089
|
+
return lines.join(`
|
|
77090
|
+
`);
|
|
77091
|
+
}
|
|
76361
77092
|
|
|
76362
77093
|
// src/commands/compare.ts
|
|
76363
77094
|
init_source();
|
|
@@ -76502,20 +77233,27 @@ function compareCommand() {
|
|
|
76502
77233
|
}
|
|
76503
77234
|
|
|
76504
77235
|
// src/commands/history.ts
|
|
77236
|
+
init_dist();
|
|
76505
77237
|
init_source();
|
|
76506
77238
|
init_ui();
|
|
76507
|
-
function renderHistoryTable(runs) {
|
|
77239
|
+
function renderHistoryTable(runs, showCost = false) {
|
|
76508
77240
|
const runIdWidth = 16;
|
|
76509
|
-
const scenarioWidth = 30;
|
|
77241
|
+
const scenarioWidth = showCost ? 25 : 30;
|
|
76510
77242
|
const rateWidth = 12;
|
|
76511
77243
|
const dateWidth = 20;
|
|
76512
|
-
const
|
|
77244
|
+
const costWidth = 10;
|
|
77245
|
+
const baseWidth = 2 + runIdWidth + 1 + scenarioWidth + 1 + rateWidth + 1 + dateWidth + 2;
|
|
77246
|
+
const width = showCost ? baseWidth + costWidth + 1 : baseWidth;
|
|
76513
77247
|
const border = "\u2550".repeat(width - 2);
|
|
76514
77248
|
const formatHeaderRow = () => {
|
|
76515
77249
|
const runIdPad = padText("Run ID", runIdWidth);
|
|
76516
77250
|
const scenarioPad = padText("Scenario", scenarioWidth);
|
|
76517
77251
|
const ratePad = padText("Success Rate", rateWidth, "right");
|
|
76518
77252
|
const datePad = padText("Date", dateWidth, "right");
|
|
77253
|
+
if (showCost) {
|
|
77254
|
+
const costPad = padText("Cost", costWidth, "right");
|
|
77255
|
+
return `\u2551 ${runIdPad} ${scenarioPad} ${ratePad} ${costPad} ${datePad} \u2551`;
|
|
77256
|
+
}
|
|
76519
77257
|
return `\u2551 ${runIdPad} ${scenarioPad} ${ratePad} ${datePad} \u2551`;
|
|
76520
77258
|
};
|
|
76521
77259
|
const lines = [
|
|
@@ -76525,6 +77263,7 @@ function renderHistoryTable(runs) {
|
|
|
76525
77263
|
formatHeaderRow(),
|
|
76526
77264
|
`\u255F${"\u2500".repeat(width - 2)}\u2562`
|
|
76527
77265
|
];
|
|
77266
|
+
let totalCost = 0;
|
|
76528
77267
|
for (const run of runs) {
|
|
76529
77268
|
const rateColor = run.successRate >= 0.9 ? source_default.green : run.successRate >= 0.7 ? source_default.yellow : source_default.red;
|
|
76530
77269
|
const runIdPad = padText(run.runId, runIdWidth);
|
|
@@ -76536,25 +77275,54 @@ function renderHistoryTable(runs) {
|
|
|
76536
77275
|
const dateObj = new Date(run.createdAt);
|
|
76537
77276
|
const dateStr = `${dateObj.toLocaleDateString()} ${dateObj.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })}`;
|
|
76538
77277
|
const datePad = padText(dateStr, dateWidth, "right");
|
|
76539
|
-
|
|
77278
|
+
if (showCost) {
|
|
77279
|
+
const costValue = run.estimatedCostUsd !== undefined ? formatCost(run.estimatedCostUsd) : "-";
|
|
77280
|
+
const costPad = padText(costValue, costWidth, "right");
|
|
77281
|
+
if (run.estimatedCostUsd !== undefined) {
|
|
77282
|
+
totalCost += run.estimatedCostUsd;
|
|
77283
|
+
}
|
|
77284
|
+
lines.push(`\u2551 ${runIdPad} ${scenarioPad} ${rateColored} ${source_default.dim(costPad)} ${datePad} \u2551`);
|
|
77285
|
+
} else {
|
|
77286
|
+
lines.push(`\u2551 ${runIdPad} ${scenarioPad} ${rateColored} ${datePad} \u2551`);
|
|
77287
|
+
}
|
|
77288
|
+
}
|
|
77289
|
+
if (showCost) {
|
|
77290
|
+
lines.push(`\u255F${"\u2500".repeat(width - 2)}\u2562`);
|
|
77291
|
+
const totalLabel = padText("Total", runIdWidth + 1 + scenarioWidth + 1 + rateWidth, "right");
|
|
77292
|
+
const totalCostStr = padText(formatCost(totalCost), costWidth, "right");
|
|
77293
|
+
const emptyDate = padText("", dateWidth, "right");
|
|
77294
|
+
lines.push(`\u2551 ${totalLabel} ${source_default.bold(totalCostStr)} ${emptyDate} \u2551`);
|
|
76540
77295
|
}
|
|
76541
77296
|
lines.push(`\u255A${border}\u255D`);
|
|
76542
77297
|
return lines.join(`
|
|
76543
77298
|
`);
|
|
76544
77299
|
}
|
|
76545
|
-
function renderPlainHistory(runs) {
|
|
77300
|
+
function renderPlainHistory(runs, showCost = false) {
|
|
76546
77301
|
const lines = ["=== RUN HISTORY ===", ""];
|
|
77302
|
+
let totalCost = 0;
|
|
76547
77303
|
for (const run of runs) {
|
|
76548
77304
|
const rate = `${(run.successRate * 100).toFixed(1)}%`;
|
|
76549
77305
|
const date = new Date(run.createdAt).toLocaleString();
|
|
76550
|
-
|
|
77306
|
+
if (showCost) {
|
|
77307
|
+
const cost = run.estimatedCostUsd !== undefined ? formatCost(run.estimatedCostUsd) : "-";
|
|
77308
|
+
if (run.estimatedCostUsd !== undefined) {
|
|
77309
|
+
totalCost += run.estimatedCostUsd;
|
|
77310
|
+
}
|
|
77311
|
+
lines.push(`${run.runId} ${run.scenario} ${rate} ${cost} ${date}`);
|
|
77312
|
+
} else {
|
|
77313
|
+
lines.push(`${run.runId} ${run.scenario} ${rate} ${date}`);
|
|
77314
|
+
}
|
|
77315
|
+
}
|
|
77316
|
+
if (showCost) {
|
|
77317
|
+
lines.push("");
|
|
77318
|
+
lines.push(`Total: ${formatCost(totalCost)}`);
|
|
76551
77319
|
}
|
|
76552
77320
|
return lines.join(`
|
|
76553
77321
|
`);
|
|
76554
77322
|
}
|
|
76555
77323
|
function historyCommand() {
|
|
76556
77324
|
const cmd = new Command("history");
|
|
76557
|
-
cmd.description("View run history").option("-p, --project <project>", "Filter by project").option("-s, --scenario <scenario>", "Filter by scenario").option("-l, --limit <number>", "Limit number of results", "20").option("--config <path>", "Path to config file").action(async (options) => {
|
|
77325
|
+
cmd.description("View run history").option("-p, --project <project>", "Filter by project").option("-s, --scenario <scenario>", "Filter by scenario").option("-l, --limit <number>", "Limit number of results", "20").option("--config <path>", "Path to config file").option("--show-cost", "Show cost column and total").action(async (options) => {
|
|
76558
77326
|
const spinner = createSpinner("Loading history...");
|
|
76559
77327
|
spinner.start();
|
|
76560
77328
|
try {
|
|
@@ -76564,7 +77332,8 @@ function historyCommand() {
|
|
|
76564
77332
|
const runs = await storage.list({
|
|
76565
77333
|
project: options.project,
|
|
76566
77334
|
scenario: options.scenario,
|
|
76567
|
-
limit
|
|
77335
|
+
limit,
|
|
77336
|
+
includeCost: options.showCost
|
|
76568
77337
|
});
|
|
76569
77338
|
spinner.succeed("Loaded history");
|
|
76570
77339
|
console.log();
|
|
@@ -76583,9 +77352,9 @@ function historyCommand() {
|
|
|
76583
77352
|
return;
|
|
76584
77353
|
}
|
|
76585
77354
|
if (isTTY) {
|
|
76586
|
-
console.log(renderHistoryTable(runs));
|
|
77355
|
+
console.log(renderHistoryTable(runs, options.showCost));
|
|
76587
77356
|
} else {
|
|
76588
|
-
console.log(renderPlainHistory(runs));
|
|
77357
|
+
console.log(renderPlainHistory(runs, options.showCost));
|
|
76589
77358
|
}
|
|
76590
77359
|
console.log();
|
|
76591
77360
|
console.log(source_default.dim(`Showing ${runs.length} run${runs.length === 1 ? "" : "s"}${options.limit ? ` (limit: ${limit})` : ""}`));
|
|
@@ -77069,30 +77838,30 @@ var require_identity4 = __commonJS4((exports) => {
|
|
|
77069
77838
|
exports.isSeq = isSeq;
|
|
77070
77839
|
});
|
|
77071
77840
|
var require_visit3 = __commonJS4((exports) => {
|
|
77072
|
-
var
|
|
77841
|
+
var identity2 = require_identity4();
|
|
77073
77842
|
var BREAK = Symbol("break visit");
|
|
77074
77843
|
var SKIP = Symbol("skip children");
|
|
77075
77844
|
var REMOVE = Symbol("remove node");
|
|
77076
|
-
function
|
|
77845
|
+
function visit2(node, visitor) {
|
|
77077
77846
|
const visitor_ = initVisitor(visitor);
|
|
77078
|
-
if (
|
|
77847
|
+
if (identity2.isDocument(node)) {
|
|
77079
77848
|
const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
|
|
77080
77849
|
if (cd === REMOVE)
|
|
77081
77850
|
node.contents = null;
|
|
77082
77851
|
} else
|
|
77083
77852
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
77084
77853
|
}
|
|
77085
|
-
|
|
77086
|
-
|
|
77087
|
-
|
|
77854
|
+
visit2.BREAK = BREAK;
|
|
77855
|
+
visit2.SKIP = SKIP;
|
|
77856
|
+
visit2.REMOVE = REMOVE;
|
|
77088
77857
|
function visit_(key, node, visitor, path3) {
|
|
77089
77858
|
const ctrl = callVisitor(key, node, visitor, path3);
|
|
77090
|
-
if (
|
|
77859
|
+
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
77091
77860
|
replaceNode(key, path3, ctrl);
|
|
77092
77861
|
return visit_(key, ctrl, visitor, path3);
|
|
77093
77862
|
}
|
|
77094
77863
|
if (typeof ctrl !== "symbol") {
|
|
77095
|
-
if (
|
|
77864
|
+
if (identity2.isCollection(node)) {
|
|
77096
77865
|
path3 = Object.freeze(path3.concat(node));
|
|
77097
77866
|
for (let i2 = 0;i2 < node.items.length; ++i2) {
|
|
77098
77867
|
const ci = visit_(i2, node.items[i2], visitor, path3);
|
|
@@ -77105,7 +77874,7 @@ var require_visit3 = __commonJS4((exports) => {
|
|
|
77105
77874
|
i2 -= 1;
|
|
77106
77875
|
}
|
|
77107
77876
|
}
|
|
77108
|
-
} else if (
|
|
77877
|
+
} else if (identity2.isPair(node)) {
|
|
77109
77878
|
path3 = Object.freeze(path3.concat(node));
|
|
77110
77879
|
const ck = visit_("key", node.key, visitor, path3);
|
|
77111
77880
|
if (ck === BREAK)
|
|
@@ -77123,7 +77892,7 @@ var require_visit3 = __commonJS4((exports) => {
|
|
|
77123
77892
|
}
|
|
77124
77893
|
async function visitAsync(node, visitor) {
|
|
77125
77894
|
const visitor_ = initVisitor(visitor);
|
|
77126
|
-
if (
|
|
77895
|
+
if (identity2.isDocument(node)) {
|
|
77127
77896
|
const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
|
|
77128
77897
|
if (cd === REMOVE)
|
|
77129
77898
|
node.contents = null;
|
|
@@ -77135,12 +77904,12 @@ var require_visit3 = __commonJS4((exports) => {
|
|
|
77135
77904
|
visitAsync.REMOVE = REMOVE;
|
|
77136
77905
|
async function visitAsync_(key, node, visitor, path3) {
|
|
77137
77906
|
const ctrl = await callVisitor(key, node, visitor, path3);
|
|
77138
|
-
if (
|
|
77907
|
+
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
77139
77908
|
replaceNode(key, path3, ctrl);
|
|
77140
77909
|
return visitAsync_(key, ctrl, visitor, path3);
|
|
77141
77910
|
}
|
|
77142
77911
|
if (typeof ctrl !== "symbol") {
|
|
77143
|
-
if (
|
|
77912
|
+
if (identity2.isCollection(node)) {
|
|
77144
77913
|
path3 = Object.freeze(path3.concat(node));
|
|
77145
77914
|
for (let i2 = 0;i2 < node.items.length; ++i2) {
|
|
77146
77915
|
const ci = await visitAsync_(i2, node.items[i2], visitor, path3);
|
|
@@ -77153,7 +77922,7 @@ var require_visit3 = __commonJS4((exports) => {
|
|
|
77153
77922
|
i2 -= 1;
|
|
77154
77923
|
}
|
|
77155
77924
|
}
|
|
77156
|
-
} else if (
|
|
77925
|
+
} else if (identity2.isPair(node)) {
|
|
77157
77926
|
path3 = Object.freeze(path3.concat(node));
|
|
77158
77927
|
const ck = await visitAsync_("key", node.key, visitor, path3);
|
|
77159
77928
|
if (ck === BREAK)
|
|
@@ -77190,40 +77959,40 @@ var require_visit3 = __commonJS4((exports) => {
|
|
|
77190
77959
|
function callVisitor(key, node, visitor, path3) {
|
|
77191
77960
|
if (typeof visitor === "function")
|
|
77192
77961
|
return visitor(key, node, path3);
|
|
77193
|
-
if (
|
|
77962
|
+
if (identity2.isMap(node))
|
|
77194
77963
|
return visitor.Map?.(key, node, path3);
|
|
77195
|
-
if (
|
|
77964
|
+
if (identity2.isSeq(node))
|
|
77196
77965
|
return visitor.Seq?.(key, node, path3);
|
|
77197
|
-
if (
|
|
77966
|
+
if (identity2.isPair(node))
|
|
77198
77967
|
return visitor.Pair?.(key, node, path3);
|
|
77199
|
-
if (
|
|
77968
|
+
if (identity2.isScalar(node))
|
|
77200
77969
|
return visitor.Scalar?.(key, node, path3);
|
|
77201
|
-
if (
|
|
77970
|
+
if (identity2.isAlias(node))
|
|
77202
77971
|
return visitor.Alias?.(key, node, path3);
|
|
77203
77972
|
return;
|
|
77204
77973
|
}
|
|
77205
77974
|
function replaceNode(key, path3, node) {
|
|
77206
77975
|
const parent = path3[path3.length - 1];
|
|
77207
|
-
if (
|
|
77976
|
+
if (identity2.isCollection(parent)) {
|
|
77208
77977
|
parent.items[key] = node;
|
|
77209
|
-
} else if (
|
|
77978
|
+
} else if (identity2.isPair(parent)) {
|
|
77210
77979
|
if (key === "key")
|
|
77211
77980
|
parent.key = node;
|
|
77212
77981
|
else
|
|
77213
77982
|
parent.value = node;
|
|
77214
|
-
} else if (
|
|
77983
|
+
} else if (identity2.isDocument(parent)) {
|
|
77215
77984
|
parent.contents = node;
|
|
77216
77985
|
} else {
|
|
77217
|
-
const pt =
|
|
77986
|
+
const pt = identity2.isAlias(parent) ? "alias" : "scalar";
|
|
77218
77987
|
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
77219
77988
|
}
|
|
77220
77989
|
}
|
|
77221
|
-
exports.visit =
|
|
77990
|
+
exports.visit = visit2;
|
|
77222
77991
|
exports.visitAsync = visitAsync;
|
|
77223
77992
|
});
|
|
77224
77993
|
var require_directives3 = __commonJS4((exports) => {
|
|
77225
|
-
var
|
|
77226
|
-
var
|
|
77994
|
+
var identity2 = require_identity4();
|
|
77995
|
+
var visit2 = require_visit3();
|
|
77227
77996
|
var escapeChars = {
|
|
77228
77997
|
"!": "%21",
|
|
77229
77998
|
",": "%2C",
|
|
@@ -77348,10 +78117,10 @@ var require_directives3 = __commonJS4((exports) => {
|
|
|
77348
78117
|
const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
|
|
77349
78118
|
const tagEntries = Object.entries(this.tags);
|
|
77350
78119
|
let tagNames;
|
|
77351
|
-
if (doc && tagEntries.length > 0 &&
|
|
78120
|
+
if (doc && tagEntries.length > 0 && identity2.isNode(doc.contents)) {
|
|
77352
78121
|
const tags = {};
|
|
77353
|
-
|
|
77354
|
-
if (
|
|
78122
|
+
visit2.visit(doc.contents, (_key, node) => {
|
|
78123
|
+
if (identity2.isNode(node) && node.tag)
|
|
77355
78124
|
tags[node.tag] = true;
|
|
77356
78125
|
});
|
|
77357
78126
|
tagNames = Object.keys(tags);
|
|
@@ -77372,8 +78141,8 @@ var require_directives3 = __commonJS4((exports) => {
|
|
|
77372
78141
|
exports.Directives = Directives;
|
|
77373
78142
|
});
|
|
77374
78143
|
var require_anchors3 = __commonJS4((exports) => {
|
|
77375
|
-
var
|
|
77376
|
-
var
|
|
78144
|
+
var identity2 = require_identity4();
|
|
78145
|
+
var visit2 = require_visit3();
|
|
77377
78146
|
function anchorIsValid(anchor) {
|
|
77378
78147
|
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
|
|
77379
78148
|
const sa = JSON.stringify(anchor);
|
|
@@ -77384,7 +78153,7 @@ var require_anchors3 = __commonJS4((exports) => {
|
|
|
77384
78153
|
}
|
|
77385
78154
|
function anchorNames(root) {
|
|
77386
78155
|
const anchors = new Set;
|
|
77387
|
-
|
|
78156
|
+
visit2.visit(root, {
|
|
77388
78157
|
Value(_key, node) {
|
|
77389
78158
|
if (node.anchor)
|
|
77390
78159
|
anchors.add(node.anchor);
|
|
@@ -77414,7 +78183,7 @@ var require_anchors3 = __commonJS4((exports) => {
|
|
|
77414
78183
|
setAnchors: () => {
|
|
77415
78184
|
for (const source of aliasObjects) {
|
|
77416
78185
|
const ref = sourceObjects.get(source);
|
|
77417
|
-
if (typeof ref === "object" && ref.anchor && (
|
|
78186
|
+
if (typeof ref === "object" && ref.anchor && (identity2.isScalar(ref.node) || identity2.isCollection(ref.node))) {
|
|
77418
78187
|
ref.node.anchor = ref.anchor;
|
|
77419
78188
|
} else {
|
|
77420
78189
|
const error = new Error("Failed to resolve repeated object (this should not happen)");
|
|
@@ -77477,12 +78246,12 @@ var require_applyReviver3 = __commonJS4((exports) => {
|
|
|
77477
78246
|
exports.applyReviver = applyReviver;
|
|
77478
78247
|
});
|
|
77479
78248
|
var require_toJS3 = __commonJS4((exports) => {
|
|
77480
|
-
var
|
|
78249
|
+
var identity2 = require_identity4();
|
|
77481
78250
|
function toJS(value, arg, ctx) {
|
|
77482
78251
|
if (Array.isArray(value))
|
|
77483
78252
|
return value.map((v2, i2) => toJS(v2, String(i2), ctx));
|
|
77484
78253
|
if (value && typeof value.toJSON === "function") {
|
|
77485
|
-
if (!ctx || !
|
|
78254
|
+
if (!ctx || !identity2.hasAnchor(value))
|
|
77486
78255
|
return value.toJSON(arg, ctx);
|
|
77487
78256
|
const data = { aliasCount: 0, count: 1, res: undefined };
|
|
77488
78257
|
ctx.anchors.set(value, data);
|
|
@@ -77503,12 +78272,12 @@ var require_toJS3 = __commonJS4((exports) => {
|
|
|
77503
78272
|
});
|
|
77504
78273
|
var require_Node3 = __commonJS4((exports) => {
|
|
77505
78274
|
var applyReviver = require_applyReviver3();
|
|
77506
|
-
var
|
|
78275
|
+
var identity2 = require_identity4();
|
|
77507
78276
|
var toJS = require_toJS3();
|
|
77508
78277
|
|
|
77509
78278
|
class NodeBase {
|
|
77510
78279
|
constructor(type) {
|
|
77511
|
-
Object.defineProperty(this,
|
|
78280
|
+
Object.defineProperty(this, identity2.NODE_TYPE, { value: type });
|
|
77512
78281
|
}
|
|
77513
78282
|
clone() {
|
|
77514
78283
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
@@ -77517,7 +78286,7 @@ var require_Node3 = __commonJS4((exports) => {
|
|
|
77517
78286
|
return copy;
|
|
77518
78287
|
}
|
|
77519
78288
|
toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
|
77520
|
-
if (!
|
|
78289
|
+
if (!identity2.isDocument(doc))
|
|
77521
78290
|
throw new TypeError("A document argument is required");
|
|
77522
78291
|
const ctx = {
|
|
77523
78292
|
anchors: new Map,
|
|
@@ -77538,14 +78307,14 @@ var require_Node3 = __commonJS4((exports) => {
|
|
|
77538
78307
|
});
|
|
77539
78308
|
var require_Alias3 = __commonJS4((exports) => {
|
|
77540
78309
|
var anchors = require_anchors3();
|
|
77541
|
-
var
|
|
77542
|
-
var
|
|
78310
|
+
var visit2 = require_visit3();
|
|
78311
|
+
var identity2 = require_identity4();
|
|
77543
78312
|
var Node = require_Node3();
|
|
77544
78313
|
var toJS = require_toJS3();
|
|
77545
78314
|
|
|
77546
|
-
class
|
|
78315
|
+
class Alias2 extends Node.NodeBase {
|
|
77547
78316
|
constructor(source) {
|
|
77548
|
-
super(
|
|
78317
|
+
super(identity2.ALIAS);
|
|
77549
78318
|
this.source = source;
|
|
77550
78319
|
Object.defineProperty(this, "tag", {
|
|
77551
78320
|
set() {
|
|
@@ -77559,9 +78328,9 @@ var require_Alias3 = __commonJS4((exports) => {
|
|
|
77559
78328
|
nodes = ctx.aliasResolveCache;
|
|
77560
78329
|
} else {
|
|
77561
78330
|
nodes = [];
|
|
77562
|
-
|
|
78331
|
+
visit2.visit(doc, {
|
|
77563
78332
|
Node: (_key, node) => {
|
|
77564
|
-
if (
|
|
78333
|
+
if (identity2.isAlias(node) || identity2.hasAnchor(node))
|
|
77565
78334
|
nodes.push(node);
|
|
77566
78335
|
}
|
|
77567
78336
|
});
|
|
@@ -77621,11 +78390,11 @@ var require_Alias3 = __commonJS4((exports) => {
|
|
|
77621
78390
|
}
|
|
77622
78391
|
}
|
|
77623
78392
|
function getAliasCount(doc, node, anchors2) {
|
|
77624
|
-
if (
|
|
78393
|
+
if (identity2.isAlias(node)) {
|
|
77625
78394
|
const source = node.resolve(doc);
|
|
77626
78395
|
const anchor = anchors2 && source && anchors2.get(source);
|
|
77627
78396
|
return anchor ? anchor.count * anchor.aliasCount : 0;
|
|
77628
|
-
} else if (
|
|
78397
|
+
} else if (identity2.isCollection(node)) {
|
|
77629
78398
|
let count = 0;
|
|
77630
78399
|
for (const item of node.items) {
|
|
77631
78400
|
const c3 = getAliasCount(doc, item, anchors2);
|
|
@@ -77633,24 +78402,24 @@ var require_Alias3 = __commonJS4((exports) => {
|
|
|
77633
78402
|
count = c3;
|
|
77634
78403
|
}
|
|
77635
78404
|
return count;
|
|
77636
|
-
} else if (
|
|
78405
|
+
} else if (identity2.isPair(node)) {
|
|
77637
78406
|
const kc = getAliasCount(doc, node.key, anchors2);
|
|
77638
78407
|
const vc = getAliasCount(doc, node.value, anchors2);
|
|
77639
78408
|
return Math.max(kc, vc);
|
|
77640
78409
|
}
|
|
77641
78410
|
return 1;
|
|
77642
78411
|
}
|
|
77643
|
-
exports.Alias =
|
|
78412
|
+
exports.Alias = Alias2;
|
|
77644
78413
|
});
|
|
77645
78414
|
var require_Scalar3 = __commonJS4((exports) => {
|
|
77646
|
-
var
|
|
78415
|
+
var identity2 = require_identity4();
|
|
77647
78416
|
var Node = require_Node3();
|
|
77648
78417
|
var toJS = require_toJS3();
|
|
77649
78418
|
var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
|
|
77650
78419
|
|
|
77651
|
-
class
|
|
78420
|
+
class Scalar2 extends Node.NodeBase {
|
|
77652
78421
|
constructor(value) {
|
|
77653
|
-
super(
|
|
78422
|
+
super(identity2.SCALAR);
|
|
77654
78423
|
this.value = value;
|
|
77655
78424
|
}
|
|
77656
78425
|
toJSON(arg, ctx) {
|
|
@@ -77660,18 +78429,18 @@ var require_Scalar3 = __commonJS4((exports) => {
|
|
|
77660
78429
|
return String(this.value);
|
|
77661
78430
|
}
|
|
77662
78431
|
}
|
|
77663
|
-
|
|
77664
|
-
|
|
77665
|
-
|
|
77666
|
-
|
|
77667
|
-
|
|
77668
|
-
exports.Scalar =
|
|
78432
|
+
Scalar2.BLOCK_FOLDED = "BLOCK_FOLDED";
|
|
78433
|
+
Scalar2.BLOCK_LITERAL = "BLOCK_LITERAL";
|
|
78434
|
+
Scalar2.PLAIN = "PLAIN";
|
|
78435
|
+
Scalar2.QUOTE_DOUBLE = "QUOTE_DOUBLE";
|
|
78436
|
+
Scalar2.QUOTE_SINGLE = "QUOTE_SINGLE";
|
|
78437
|
+
exports.Scalar = Scalar2;
|
|
77669
78438
|
exports.isScalarValue = isScalarValue;
|
|
77670
78439
|
});
|
|
77671
78440
|
var require_createNode3 = __commonJS4((exports) => {
|
|
77672
|
-
var
|
|
77673
|
-
var
|
|
77674
|
-
var
|
|
78441
|
+
var Alias2 = require_Alias3();
|
|
78442
|
+
var identity2 = require_identity4();
|
|
78443
|
+
var Scalar2 = require_Scalar3();
|
|
77675
78444
|
var defaultTagPrefix = "tag:yaml.org,2002:";
|
|
77676
78445
|
function findTagObject(value, tagName, tags) {
|
|
77677
78446
|
if (tagName) {
|
|
@@ -77684,12 +78453,12 @@ var require_createNode3 = __commonJS4((exports) => {
|
|
|
77684
78453
|
return tags.find((t2) => t2.identify?.(value) && !t2.format);
|
|
77685
78454
|
}
|
|
77686
78455
|
function createNode(value, tagName, ctx) {
|
|
77687
|
-
if (
|
|
78456
|
+
if (identity2.isDocument(value))
|
|
77688
78457
|
value = value.contents;
|
|
77689
|
-
if (
|
|
78458
|
+
if (identity2.isNode(value))
|
|
77690
78459
|
return value;
|
|
77691
|
-
if (
|
|
77692
|
-
const map8 = ctx.schema[
|
|
78460
|
+
if (identity2.isPair(value)) {
|
|
78461
|
+
const map8 = ctx.schema[identity2.MAP].createNode?.(ctx.schema, null, ctx);
|
|
77693
78462
|
map8.items.push(value);
|
|
77694
78463
|
return map8;
|
|
77695
78464
|
}
|
|
@@ -77702,7 +78471,7 @@ var require_createNode3 = __commonJS4((exports) => {
|
|
|
77702
78471
|
ref = sourceObjects.get(value);
|
|
77703
78472
|
if (ref) {
|
|
77704
78473
|
ref.anchor ?? (ref.anchor = onAnchor(value));
|
|
77705
|
-
return new
|
|
78474
|
+
return new Alias2.Alias(ref.anchor);
|
|
77706
78475
|
} else {
|
|
77707
78476
|
ref = { anchor: null, node: null };
|
|
77708
78477
|
sourceObjects.set(value, ref);
|
|
@@ -77716,18 +78485,18 @@ var require_createNode3 = __commonJS4((exports) => {
|
|
|
77716
78485
|
value = value.toJSON();
|
|
77717
78486
|
}
|
|
77718
78487
|
if (!value || typeof value !== "object") {
|
|
77719
|
-
const node2 = new
|
|
78488
|
+
const node2 = new Scalar2.Scalar(value);
|
|
77720
78489
|
if (ref)
|
|
77721
78490
|
ref.node = node2;
|
|
77722
78491
|
return node2;
|
|
77723
78492
|
}
|
|
77724
|
-
tagObj = value instanceof Map ? schema[
|
|
78493
|
+
tagObj = value instanceof Map ? schema[identity2.MAP] : (Symbol.iterator in Object(value)) ? schema[identity2.SEQ] : schema[identity2.MAP];
|
|
77725
78494
|
}
|
|
77726
78495
|
if (onTagObj) {
|
|
77727
78496
|
onTagObj(tagObj);
|
|
77728
78497
|
delete ctx.onTagObj;
|
|
77729
78498
|
}
|
|
77730
|
-
const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new
|
|
78499
|
+
const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar2.Scalar(value);
|
|
77731
78500
|
if (tagName)
|
|
77732
78501
|
node.tag = tagName;
|
|
77733
78502
|
else if (!tagObj.default)
|
|
@@ -77740,7 +78509,7 @@ var require_createNode3 = __commonJS4((exports) => {
|
|
|
77740
78509
|
});
|
|
77741
78510
|
var require_Collection3 = __commonJS4((exports) => {
|
|
77742
78511
|
var createNode = require_createNode3();
|
|
77743
|
-
var
|
|
78512
|
+
var identity2 = require_identity4();
|
|
77744
78513
|
var Node = require_Node3();
|
|
77745
78514
|
function collectionFromPath(schema, path3, value) {
|
|
77746
78515
|
let v2 = value;
|
|
@@ -77780,7 +78549,7 @@ var require_Collection3 = __commonJS4((exports) => {
|
|
|
77780
78549
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
77781
78550
|
if (schema)
|
|
77782
78551
|
copy.schema = schema;
|
|
77783
|
-
copy.items = copy.items.map((it) =>
|
|
78552
|
+
copy.items = copy.items.map((it) => identity2.isNode(it) || identity2.isPair(it) ? it.clone(schema) : it);
|
|
77784
78553
|
if (this.range)
|
|
77785
78554
|
copy.range = this.range.slice();
|
|
77786
78555
|
return copy;
|
|
@@ -77791,7 +78560,7 @@ var require_Collection3 = __commonJS4((exports) => {
|
|
|
77791
78560
|
else {
|
|
77792
78561
|
const [key, ...rest] = path3;
|
|
77793
78562
|
const node = this.get(key, true);
|
|
77794
|
-
if (
|
|
78563
|
+
if (identity2.isCollection(node))
|
|
77795
78564
|
node.addIn(rest, value);
|
|
77796
78565
|
else if (node === undefined && this.schema)
|
|
77797
78566
|
this.set(key, collectionFromPath(this.schema, rest, value));
|
|
@@ -77804,7 +78573,7 @@ var require_Collection3 = __commonJS4((exports) => {
|
|
|
77804
78573
|
if (rest.length === 0)
|
|
77805
78574
|
return this.delete(key);
|
|
77806
78575
|
const node = this.get(key, true);
|
|
77807
|
-
if (
|
|
78576
|
+
if (identity2.isCollection(node))
|
|
77808
78577
|
return node.deleteIn(rest);
|
|
77809
78578
|
else
|
|
77810
78579
|
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
|
|
@@ -77813,16 +78582,16 @@ var require_Collection3 = __commonJS4((exports) => {
|
|
|
77813
78582
|
const [key, ...rest] = path3;
|
|
77814
78583
|
const node = this.get(key, true);
|
|
77815
78584
|
if (rest.length === 0)
|
|
77816
|
-
return !keepScalar &&
|
|
78585
|
+
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
77817
78586
|
else
|
|
77818
|
-
return
|
|
78587
|
+
return identity2.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
|
|
77819
78588
|
}
|
|
77820
78589
|
hasAllNullValues(allowScalar) {
|
|
77821
78590
|
return this.items.every((node) => {
|
|
77822
|
-
if (!
|
|
78591
|
+
if (!identity2.isPair(node))
|
|
77823
78592
|
return false;
|
|
77824
78593
|
const n2 = node.value;
|
|
77825
|
-
return n2 == null || allowScalar &&
|
|
78594
|
+
return n2 == null || allowScalar && identity2.isScalar(n2) && n2.value == null && !n2.commentBefore && !n2.comment && !n2.tag;
|
|
77826
78595
|
});
|
|
77827
78596
|
}
|
|
77828
78597
|
hasIn(path3) {
|
|
@@ -77830,7 +78599,7 @@ var require_Collection3 = __commonJS4((exports) => {
|
|
|
77830
78599
|
if (rest.length === 0)
|
|
77831
78600
|
return this.has(key);
|
|
77832
78601
|
const node = this.get(key, true);
|
|
77833
|
-
return
|
|
78602
|
+
return identity2.isCollection(node) ? node.hasIn(rest) : false;
|
|
77834
78603
|
}
|
|
77835
78604
|
setIn(path3, value) {
|
|
77836
78605
|
const [key, ...rest] = path3;
|
|
@@ -77838,7 +78607,7 @@ var require_Collection3 = __commonJS4((exports) => {
|
|
|
77838
78607
|
this.set(key, value);
|
|
77839
78608
|
} else {
|
|
77840
78609
|
const node = this.get(key, true);
|
|
77841
|
-
if (
|
|
78610
|
+
if (identity2.isCollection(node))
|
|
77842
78611
|
node.setIn(rest, value);
|
|
77843
78612
|
else if (node === undefined && this.schema)
|
|
77844
78613
|
this.set(key, collectionFromPath(this.schema, rest, value));
|
|
@@ -78002,7 +78771,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
78002
78771
|
exports.foldFlowLines = foldFlowLines;
|
|
78003
78772
|
});
|
|
78004
78773
|
var require_stringifyString3 = __commonJS4((exports) => {
|
|
78005
|
-
var
|
|
78774
|
+
var Scalar2 = require_Scalar3();
|
|
78006
78775
|
var foldFlowLines = require_foldFlowLines3();
|
|
78007
78776
|
var getFoldOptions = (ctx, isBlock) => ({
|
|
78008
78777
|
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
@@ -78153,7 +78922,7 @@ ${indent}`) + "'";
|
|
|
78153
78922
|
return quotedString(value, ctx);
|
|
78154
78923
|
}
|
|
78155
78924
|
const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? " " : "");
|
|
78156
|
-
const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type ===
|
|
78925
|
+
const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar2.Scalar.BLOCK_FOLDED ? false : type === Scalar2.Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
|
|
78157
78926
|
if (!value)
|
|
78158
78927
|
return literal ? `|
|
|
78159
78928
|
` : `>
|
|
@@ -78215,7 +78984,7 @@ ${indent}`) + "'";
|
|
|
78215
78984
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
|
|
78216
78985
|
let literalFallback = false;
|
|
78217
78986
|
const foldOptions = getFoldOptions(ctx, true);
|
|
78218
|
-
if (blockQuote !== "folded" && type !==
|
|
78987
|
+
if (blockQuote !== "folded" && type !== Scalar2.Scalar.BLOCK_FOLDED) {
|
|
78219
78988
|
foldOptions.onOverflow = () => {
|
|
78220
78989
|
literalFallback = true;
|
|
78221
78990
|
};
|
|
@@ -78240,7 +79009,7 @@ ${indent}${start}${value}${end}`;
|
|
|
78240
79009
|
return implicitKey || inFlow || !value.includes(`
|
|
78241
79010
|
`) ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
|
|
78242
79011
|
}
|
|
78243
|
-
if (!implicitKey && !inFlow && type !==
|
|
79012
|
+
if (!implicitKey && !inFlow && type !== Scalar2.Scalar.PLAIN && value.includes(`
|
|
78244
79013
|
`)) {
|
|
78245
79014
|
return blockString(item, ctx, onComment, onChompKeep);
|
|
78246
79015
|
}
|
|
@@ -78266,20 +79035,20 @@ ${indent}`);
|
|
|
78266
79035
|
const { implicitKey, inFlow } = ctx;
|
|
78267
79036
|
const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) });
|
|
78268
79037
|
let { type } = item;
|
|
78269
|
-
if (type !==
|
|
79038
|
+
if (type !== Scalar2.Scalar.QUOTE_DOUBLE) {
|
|
78270
79039
|
if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
|
|
78271
|
-
type =
|
|
79040
|
+
type = Scalar2.Scalar.QUOTE_DOUBLE;
|
|
78272
79041
|
}
|
|
78273
79042
|
const _stringify = (_type) => {
|
|
78274
79043
|
switch (_type) {
|
|
78275
|
-
case
|
|
78276
|
-
case
|
|
79044
|
+
case Scalar2.Scalar.BLOCK_FOLDED:
|
|
79045
|
+
case Scalar2.Scalar.BLOCK_LITERAL:
|
|
78277
79046
|
return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
|
|
78278
|
-
case
|
|
79047
|
+
case Scalar2.Scalar.QUOTE_DOUBLE:
|
|
78279
79048
|
return doubleQuotedString(ss.value, ctx);
|
|
78280
|
-
case
|
|
79049
|
+
case Scalar2.Scalar.QUOTE_SINGLE:
|
|
78281
79050
|
return singleQuotedString(ss.value, ctx);
|
|
78282
|
-
case
|
|
79051
|
+
case Scalar2.Scalar.PLAIN:
|
|
78283
79052
|
return plainString(ss, ctx, onComment, onChompKeep);
|
|
78284
79053
|
default:
|
|
78285
79054
|
return null;
|
|
@@ -78299,7 +79068,7 @@ ${indent}`);
|
|
|
78299
79068
|
});
|
|
78300
79069
|
var require_stringify3 = __commonJS4((exports) => {
|
|
78301
79070
|
var anchors = require_anchors3();
|
|
78302
|
-
var
|
|
79071
|
+
var identity2 = require_identity4();
|
|
78303
79072
|
var stringifyComment = require_stringifyComment3();
|
|
78304
79073
|
var stringifyString = require_stringifyString3();
|
|
78305
79074
|
function createStringifyContext(doc, options) {
|
|
@@ -78351,7 +79120,7 @@ var require_stringify3 = __commonJS4((exports) => {
|
|
|
78351
79120
|
}
|
|
78352
79121
|
let tagObj = undefined;
|
|
78353
79122
|
let obj;
|
|
78354
|
-
if (
|
|
79123
|
+
if (identity2.isScalar(item)) {
|
|
78355
79124
|
obj = item.value;
|
|
78356
79125
|
let match = tags.filter((t2) => t2.identify?.(obj));
|
|
78357
79126
|
if (match.length > 1) {
|
|
@@ -78374,7 +79143,7 @@ var require_stringify3 = __commonJS4((exports) => {
|
|
|
78374
79143
|
if (!doc.directives)
|
|
78375
79144
|
return "";
|
|
78376
79145
|
const props = [];
|
|
78377
|
-
const anchor = (
|
|
79146
|
+
const anchor = (identity2.isScalar(node) || identity2.isCollection(node)) && node.anchor;
|
|
78378
79147
|
if (anchor && anchors.anchorIsValid(anchor)) {
|
|
78379
79148
|
anchors$1.add(anchor);
|
|
78380
79149
|
props.push(`&${anchor}`);
|
|
@@ -78385,9 +79154,9 @@ var require_stringify3 = __commonJS4((exports) => {
|
|
|
78385
79154
|
return props.join(" ");
|
|
78386
79155
|
}
|
|
78387
79156
|
function stringify(item, ctx, onComment, onChompKeep) {
|
|
78388
|
-
if (
|
|
79157
|
+
if (identity2.isPair(item))
|
|
78389
79158
|
return item.toString(ctx, onComment, onChompKeep);
|
|
78390
|
-
if (
|
|
79159
|
+
if (identity2.isAlias(item)) {
|
|
78391
79160
|
if (ctx.doc.directives)
|
|
78392
79161
|
return item.toString(ctx);
|
|
78393
79162
|
if (ctx.resolvedAliases?.has(item)) {
|
|
@@ -78401,38 +79170,38 @@ var require_stringify3 = __commonJS4((exports) => {
|
|
|
78401
79170
|
}
|
|
78402
79171
|
}
|
|
78403
79172
|
let tagObj = undefined;
|
|
78404
|
-
const node =
|
|
79173
|
+
const node = identity2.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o3) => tagObj = o3 });
|
|
78405
79174
|
tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
|
|
78406
79175
|
const props = stringifyProps(node, tagObj, ctx);
|
|
78407
79176
|
if (props.length > 0)
|
|
78408
79177
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
78409
|
-
const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) :
|
|
79178
|
+
const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity2.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
|
|
78410
79179
|
if (!props)
|
|
78411
79180
|
return str;
|
|
78412
|
-
return
|
|
79181
|
+
return identity2.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
|
|
78413
79182
|
${ctx.indent}${str}`;
|
|
78414
79183
|
}
|
|
78415
79184
|
exports.createStringifyContext = createStringifyContext;
|
|
78416
79185
|
exports.stringify = stringify;
|
|
78417
79186
|
});
|
|
78418
79187
|
var require_stringifyPair3 = __commonJS4((exports) => {
|
|
78419
|
-
var
|
|
78420
|
-
var
|
|
79188
|
+
var identity2 = require_identity4();
|
|
79189
|
+
var Scalar2 = require_Scalar3();
|
|
78421
79190
|
var stringify = require_stringify3();
|
|
78422
79191
|
var stringifyComment = require_stringifyComment3();
|
|
78423
79192
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
78424
79193
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
78425
|
-
let keyComment =
|
|
79194
|
+
let keyComment = identity2.isNode(key) && key.comment || null;
|
|
78426
79195
|
if (simpleKeys) {
|
|
78427
79196
|
if (keyComment) {
|
|
78428
79197
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
78429
79198
|
}
|
|
78430
|
-
if (
|
|
79199
|
+
if (identity2.isCollection(key) || !identity2.isNode(key) && typeof key === "object") {
|
|
78431
79200
|
const msg = "With simple keys, collection cannot be used as a key value";
|
|
78432
79201
|
throw new Error(msg);
|
|
78433
79202
|
}
|
|
78434
79203
|
}
|
|
78435
|
-
let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow ||
|
|
79204
|
+
let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity2.isCollection(key) || (identity2.isScalar(key) ? key.type === Scalar2.Scalar.BLOCK_FOLDED || key.type === Scalar2.Scalar.BLOCK_LITERAL : typeof key === "object"));
|
|
78436
79205
|
ctx = Object.assign({}, ctx, {
|
|
78437
79206
|
allNullValues: false,
|
|
78438
79207
|
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
|
|
@@ -78473,7 +79242,7 @@ ${indent}:`;
|
|
|
78473
79242
|
str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
|
|
78474
79243
|
}
|
|
78475
79244
|
let vsb, vcb, valueComment;
|
|
78476
|
-
if (
|
|
79245
|
+
if (identity2.isNode(value)) {
|
|
78477
79246
|
vsb = !!value.spaceBefore;
|
|
78478
79247
|
vcb = value.commentBefore;
|
|
78479
79248
|
valueComment = value.comment;
|
|
@@ -78485,10 +79254,10 @@ ${indent}:`;
|
|
|
78485
79254
|
value = doc.createNode(value);
|
|
78486
79255
|
}
|
|
78487
79256
|
ctx.implicitKey = false;
|
|
78488
|
-
if (!explicitKey && !keyComment &&
|
|
79257
|
+
if (!explicitKey && !keyComment && identity2.isScalar(value))
|
|
78489
79258
|
ctx.indentAtStart = str.length + 1;
|
|
78490
79259
|
chompKeep = false;
|
|
78491
|
-
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey &&
|
|
79260
|
+
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity2.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
|
|
78492
79261
|
ctx.indent = ctx.indent.substring(2);
|
|
78493
79262
|
}
|
|
78494
79263
|
let valueCommentDone = false;
|
|
@@ -78512,7 +79281,7 @@ ${stringifyComment.indentComment(cs, ctx.indent)}`;
|
|
|
78512
79281
|
ws += `
|
|
78513
79282
|
${ctx.indent}`;
|
|
78514
79283
|
}
|
|
78515
|
-
} else if (!explicitKey &&
|
|
79284
|
+
} else if (!explicitKey && identity2.isCollection(value)) {
|
|
78516
79285
|
const vs0 = valueStr[0];
|
|
78517
79286
|
const nl0 = valueStr.indexOf(`
|
|
78518
79287
|
`);
|
|
@@ -78567,23 +79336,23 @@ var require_log4 = __commonJS4((exports) => {
|
|
|
78567
79336
|
exports.warn = warn;
|
|
78568
79337
|
});
|
|
78569
79338
|
var require_merge5 = __commonJS4((exports) => {
|
|
78570
|
-
var
|
|
78571
|
-
var
|
|
79339
|
+
var identity2 = require_identity4();
|
|
79340
|
+
var Scalar2 = require_Scalar3();
|
|
78572
79341
|
var MERGE_KEY = "<<";
|
|
78573
79342
|
var merge = {
|
|
78574
79343
|
identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY,
|
|
78575
79344
|
default: "key",
|
|
78576
79345
|
tag: "tag:yaml.org,2002:merge",
|
|
78577
79346
|
test: /^<<$/,
|
|
78578
|
-
resolve: () => Object.assign(new
|
|
79347
|
+
resolve: () => Object.assign(new Scalar2.Scalar(Symbol(MERGE_KEY)), {
|
|
78579
79348
|
addToJSMap: addMergeToJSMap
|
|
78580
79349
|
}),
|
|
78581
79350
|
stringify: () => MERGE_KEY
|
|
78582
79351
|
};
|
|
78583
|
-
var isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
79352
|
+
var isMergeKey = (ctx, key) => (merge.identify(key) || identity2.isScalar(key) && (!key.type || key.type === Scalar2.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default);
|
|
78584
79353
|
function addMergeToJSMap(ctx, map8, value) {
|
|
78585
|
-
value = ctx &&
|
|
78586
|
-
if (
|
|
79354
|
+
value = ctx && identity2.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
79355
|
+
if (identity2.isSeq(value))
|
|
78587
79356
|
for (const it of value.items)
|
|
78588
79357
|
mergeValue(ctx, map8, it);
|
|
78589
79358
|
else if (Array.isArray(value))
|
|
@@ -78593,8 +79362,8 @@ var require_merge5 = __commonJS4((exports) => {
|
|
|
78593
79362
|
mergeValue(ctx, map8, value);
|
|
78594
79363
|
}
|
|
78595
79364
|
function mergeValue(ctx, map8, value) {
|
|
78596
|
-
const source = ctx &&
|
|
78597
|
-
if (!
|
|
79365
|
+
const source = ctx && identity2.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
79366
|
+
if (!identity2.isMap(source))
|
|
78598
79367
|
throw new Error("Merge sources must be maps or map aliases");
|
|
78599
79368
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
78600
79369
|
for (const [key, value2] of srcMap) {
|
|
@@ -78622,10 +79391,10 @@ var require_addPairToJSMap3 = __commonJS4((exports) => {
|
|
|
78622
79391
|
var log = require_log4();
|
|
78623
79392
|
var merge = require_merge5();
|
|
78624
79393
|
var stringify = require_stringify3();
|
|
78625
|
-
var
|
|
79394
|
+
var identity2 = require_identity4();
|
|
78626
79395
|
var toJS = require_toJS3();
|
|
78627
79396
|
function addPairToJSMap(ctx, map8, { key, value }) {
|
|
78628
|
-
if (
|
|
79397
|
+
if (identity2.isNode(key) && key.addToJSMap)
|
|
78629
79398
|
key.addToJSMap(ctx, map8, value);
|
|
78630
79399
|
else if (merge.isMergeKey(ctx, key))
|
|
78631
79400
|
merge.addMergeToJSMap(ctx, map8, value);
|
|
@@ -78656,7 +79425,7 @@ var require_addPairToJSMap3 = __commonJS4((exports) => {
|
|
|
78656
79425
|
return "";
|
|
78657
79426
|
if (typeof jsKey !== "object")
|
|
78658
79427
|
return String(jsKey);
|
|
78659
|
-
if (
|
|
79428
|
+
if (identity2.isNode(key) && ctx?.doc) {
|
|
78660
79429
|
const strCtx = stringify.createStringifyContext(ctx.doc, {});
|
|
78661
79430
|
strCtx.anchors = new Set;
|
|
78662
79431
|
for (const node of ctx.anchors.keys())
|
|
@@ -78681,26 +79450,26 @@ var require_Pair3 = __commonJS4((exports) => {
|
|
|
78681
79450
|
var createNode = require_createNode3();
|
|
78682
79451
|
var stringifyPair = require_stringifyPair3();
|
|
78683
79452
|
var addPairToJSMap = require_addPairToJSMap3();
|
|
78684
|
-
var
|
|
79453
|
+
var identity2 = require_identity4();
|
|
78685
79454
|
function createPair(key, value, ctx) {
|
|
78686
79455
|
const k2 = createNode.createNode(key, undefined, ctx);
|
|
78687
79456
|
const v2 = createNode.createNode(value, undefined, ctx);
|
|
78688
|
-
return new
|
|
79457
|
+
return new Pair2(k2, v2);
|
|
78689
79458
|
}
|
|
78690
79459
|
|
|
78691
|
-
class
|
|
79460
|
+
class Pair2 {
|
|
78692
79461
|
constructor(key, value = null) {
|
|
78693
|
-
Object.defineProperty(this,
|
|
79462
|
+
Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.PAIR });
|
|
78694
79463
|
this.key = key;
|
|
78695
79464
|
this.value = value;
|
|
78696
79465
|
}
|
|
78697
79466
|
clone(schema) {
|
|
78698
79467
|
let { key, value } = this;
|
|
78699
|
-
if (
|
|
79468
|
+
if (identity2.isNode(key))
|
|
78700
79469
|
key = key.clone(schema);
|
|
78701
|
-
if (
|
|
79470
|
+
if (identity2.isNode(value))
|
|
78702
79471
|
value = value.clone(schema);
|
|
78703
|
-
return new
|
|
79472
|
+
return new Pair2(key, value);
|
|
78704
79473
|
}
|
|
78705
79474
|
toJSON(_3, ctx) {
|
|
78706
79475
|
const pair = ctx?.mapAsMap ? new Map : {};
|
|
@@ -78710,11 +79479,11 @@ var require_Pair3 = __commonJS4((exports) => {
|
|
|
78710
79479
|
return ctx?.doc ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
|
|
78711
79480
|
}
|
|
78712
79481
|
}
|
|
78713
|
-
exports.Pair =
|
|
79482
|
+
exports.Pair = Pair2;
|
|
78714
79483
|
exports.createPair = createPair;
|
|
78715
79484
|
});
|
|
78716
79485
|
var require_stringifyCollection3 = __commonJS4((exports) => {
|
|
78717
|
-
var
|
|
79486
|
+
var identity2 = require_identity4();
|
|
78718
79487
|
var stringify = require_stringify3();
|
|
78719
79488
|
var stringifyComment = require_stringifyComment3();
|
|
78720
79489
|
function stringifyCollection(collection, ctx, options) {
|
|
@@ -78730,14 +79499,14 @@ var require_stringifyCollection3 = __commonJS4((exports) => {
|
|
|
78730
79499
|
for (let i2 = 0;i2 < items.length; ++i2) {
|
|
78731
79500
|
const item = items[i2];
|
|
78732
79501
|
let comment2 = null;
|
|
78733
|
-
if (
|
|
79502
|
+
if (identity2.isNode(item)) {
|
|
78734
79503
|
if (!chompKeep && item.spaceBefore)
|
|
78735
79504
|
lines.push("");
|
|
78736
79505
|
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
|
|
78737
79506
|
if (item.comment)
|
|
78738
79507
|
comment2 = item.comment;
|
|
78739
|
-
} else if (
|
|
78740
|
-
const ik =
|
|
79508
|
+
} else if (identity2.isPair(item)) {
|
|
79509
|
+
const ik = identity2.isNode(item.key) ? item.key : null;
|
|
78741
79510
|
if (ik) {
|
|
78742
79511
|
if (!chompKeep && ik.spaceBefore)
|
|
78743
79512
|
lines.push("");
|
|
@@ -78787,14 +79556,14 @@ ${indent}${line}` : `
|
|
|
78787
79556
|
for (let i2 = 0;i2 < items.length; ++i2) {
|
|
78788
79557
|
const item = items[i2];
|
|
78789
79558
|
let comment = null;
|
|
78790
|
-
if (
|
|
79559
|
+
if (identity2.isNode(item)) {
|
|
78791
79560
|
if (item.spaceBefore)
|
|
78792
79561
|
lines.push("");
|
|
78793
79562
|
addCommentBefore(ctx, lines, item.commentBefore, false);
|
|
78794
79563
|
if (item.comment)
|
|
78795
79564
|
comment = item.comment;
|
|
78796
|
-
} else if (
|
|
78797
|
-
const ik =
|
|
79565
|
+
} else if (identity2.isPair(item)) {
|
|
79566
|
+
const ik = identity2.isNode(item.key) ? item.key : null;
|
|
78798
79567
|
if (ik) {
|
|
78799
79568
|
if (ik.spaceBefore)
|
|
78800
79569
|
lines.push("");
|
|
@@ -78802,7 +79571,7 @@ ${indent}${line}` : `
|
|
|
78802
79571
|
if (ik.comment)
|
|
78803
79572
|
reqNewline = true;
|
|
78804
79573
|
}
|
|
78805
|
-
const iv =
|
|
79574
|
+
const iv = identity2.isNode(item.value) ? item.value : null;
|
|
78806
79575
|
if (iv) {
|
|
78807
79576
|
if (iv.comment)
|
|
78808
79577
|
comment = iv.comment;
|
|
@@ -78860,28 +79629,28 @@ var require_YAMLMap3 = __commonJS4((exports) => {
|
|
|
78860
79629
|
var stringifyCollection = require_stringifyCollection3();
|
|
78861
79630
|
var addPairToJSMap = require_addPairToJSMap3();
|
|
78862
79631
|
var Collection = require_Collection3();
|
|
78863
|
-
var
|
|
78864
|
-
var
|
|
78865
|
-
var
|
|
79632
|
+
var identity2 = require_identity4();
|
|
79633
|
+
var Pair2 = require_Pair3();
|
|
79634
|
+
var Scalar2 = require_Scalar3();
|
|
78866
79635
|
function findPair(items, key) {
|
|
78867
|
-
const k2 =
|
|
79636
|
+
const k2 = identity2.isScalar(key) ? key.value : key;
|
|
78868
79637
|
for (const it of items) {
|
|
78869
|
-
if (
|
|
79638
|
+
if (identity2.isPair(it)) {
|
|
78870
79639
|
if (it.key === key || it.key === k2)
|
|
78871
79640
|
return it;
|
|
78872
|
-
if (
|
|
79641
|
+
if (identity2.isScalar(it.key) && it.key.value === k2)
|
|
78873
79642
|
return it;
|
|
78874
79643
|
}
|
|
78875
79644
|
}
|
|
78876
79645
|
return;
|
|
78877
79646
|
}
|
|
78878
79647
|
|
|
78879
|
-
class
|
|
79648
|
+
class YAMLMap2 extends Collection.Collection {
|
|
78880
79649
|
static get tagName() {
|
|
78881
79650
|
return "tag:yaml.org,2002:map";
|
|
78882
79651
|
}
|
|
78883
79652
|
constructor(schema) {
|
|
78884
|
-
super(
|
|
79653
|
+
super(identity2.MAP, schema);
|
|
78885
79654
|
this.items = [];
|
|
78886
79655
|
}
|
|
78887
79656
|
static from(schema, obj, ctx) {
|
|
@@ -78893,7 +79662,7 @@ var require_YAMLMap3 = __commonJS4((exports) => {
|
|
|
78893
79662
|
else if (Array.isArray(replacer) && !replacer.includes(key))
|
|
78894
79663
|
return;
|
|
78895
79664
|
if (value !== undefined || keepUndefined)
|
|
78896
|
-
map8.items.push(
|
|
79665
|
+
map8.items.push(Pair2.createPair(key, value, ctx));
|
|
78897
79666
|
};
|
|
78898
79667
|
if (obj instanceof Map) {
|
|
78899
79668
|
for (const [key, value] of obj)
|
|
@@ -78909,18 +79678,18 @@ var require_YAMLMap3 = __commonJS4((exports) => {
|
|
|
78909
79678
|
}
|
|
78910
79679
|
add(pair, overwrite) {
|
|
78911
79680
|
let _pair;
|
|
78912
|
-
if (
|
|
79681
|
+
if (identity2.isPair(pair))
|
|
78913
79682
|
_pair = pair;
|
|
78914
79683
|
else if (!pair || typeof pair !== "object" || !("key" in pair)) {
|
|
78915
|
-
_pair = new
|
|
79684
|
+
_pair = new Pair2.Pair(pair, pair?.value);
|
|
78916
79685
|
} else
|
|
78917
|
-
_pair = new
|
|
79686
|
+
_pair = new Pair2.Pair(pair.key, pair.value);
|
|
78918
79687
|
const prev = findPair(this.items, _pair.key);
|
|
78919
79688
|
const sortEntries = this.schema?.sortMapEntries;
|
|
78920
79689
|
if (prev) {
|
|
78921
79690
|
if (!overwrite)
|
|
78922
79691
|
throw new Error(`Key ${_pair.key} already set`);
|
|
78923
|
-
if (
|
|
79692
|
+
if (identity2.isScalar(prev.value) && Scalar2.isScalarValue(_pair.value))
|
|
78924
79693
|
prev.value.value = _pair.value;
|
|
78925
79694
|
else
|
|
78926
79695
|
prev.value = _pair.value;
|
|
@@ -78944,13 +79713,13 @@ var require_YAMLMap3 = __commonJS4((exports) => {
|
|
|
78944
79713
|
get(key, keepScalar) {
|
|
78945
79714
|
const it = findPair(this.items, key);
|
|
78946
79715
|
const node = it?.value;
|
|
78947
|
-
return (!keepScalar &&
|
|
79716
|
+
return (!keepScalar && identity2.isScalar(node) ? node.value : node) ?? undefined;
|
|
78948
79717
|
}
|
|
78949
79718
|
has(key) {
|
|
78950
79719
|
return !!findPair(this.items, key);
|
|
78951
79720
|
}
|
|
78952
79721
|
set(key, value) {
|
|
78953
|
-
this.add(new
|
|
79722
|
+
this.add(new Pair2.Pair(key, value), true);
|
|
78954
79723
|
}
|
|
78955
79724
|
toJSON(_3, ctx, Type) {
|
|
78956
79725
|
const map8 = Type ? new Type : ctx?.mapAsMap ? new Map : {};
|
|
@@ -78964,7 +79733,7 @@ var require_YAMLMap3 = __commonJS4((exports) => {
|
|
|
78964
79733
|
if (!ctx)
|
|
78965
79734
|
return JSON.stringify(this);
|
|
78966
79735
|
for (const item of this.items) {
|
|
78967
|
-
if (!
|
|
79736
|
+
if (!identity2.isPair(item))
|
|
78968
79737
|
throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
|
|
78969
79738
|
}
|
|
78970
79739
|
if (!ctx.allNullValues && this.hasAllNullValues(false))
|
|
@@ -78978,23 +79747,23 @@ var require_YAMLMap3 = __commonJS4((exports) => {
|
|
|
78978
79747
|
});
|
|
78979
79748
|
}
|
|
78980
79749
|
}
|
|
78981
|
-
exports.YAMLMap =
|
|
79750
|
+
exports.YAMLMap = YAMLMap2;
|
|
78982
79751
|
exports.findPair = findPair;
|
|
78983
79752
|
});
|
|
78984
79753
|
var require_map4 = __commonJS4((exports) => {
|
|
78985
|
-
var
|
|
78986
|
-
var
|
|
79754
|
+
var identity2 = require_identity4();
|
|
79755
|
+
var YAMLMap2 = require_YAMLMap3();
|
|
78987
79756
|
var map8 = {
|
|
78988
79757
|
collection: "map",
|
|
78989
79758
|
default: true,
|
|
78990
|
-
nodeClass:
|
|
79759
|
+
nodeClass: YAMLMap2.YAMLMap,
|
|
78991
79760
|
tag: "tag:yaml.org,2002:map",
|
|
78992
79761
|
resolve(map22, onError) {
|
|
78993
|
-
if (!
|
|
79762
|
+
if (!identity2.isMap(map22))
|
|
78994
79763
|
onError("Expected a mapping for this tag");
|
|
78995
79764
|
return map22;
|
|
78996
79765
|
},
|
|
78997
|
-
createNode: (schema, obj, ctx) =>
|
|
79766
|
+
createNode: (schema, obj, ctx) => YAMLMap2.YAMLMap.from(schema, obj, ctx)
|
|
78998
79767
|
};
|
|
78999
79768
|
exports.map = map8;
|
|
79000
79769
|
});
|
|
@@ -79002,16 +79771,16 @@ var require_YAMLSeq3 = __commonJS4((exports) => {
|
|
|
79002
79771
|
var createNode = require_createNode3();
|
|
79003
79772
|
var stringifyCollection = require_stringifyCollection3();
|
|
79004
79773
|
var Collection = require_Collection3();
|
|
79005
|
-
var
|
|
79006
|
-
var
|
|
79774
|
+
var identity2 = require_identity4();
|
|
79775
|
+
var Scalar2 = require_Scalar3();
|
|
79007
79776
|
var toJS = require_toJS3();
|
|
79008
79777
|
|
|
79009
|
-
class
|
|
79778
|
+
class YAMLSeq2 extends Collection.Collection {
|
|
79010
79779
|
static get tagName() {
|
|
79011
79780
|
return "tag:yaml.org,2002:seq";
|
|
79012
79781
|
}
|
|
79013
79782
|
constructor(schema) {
|
|
79014
|
-
super(
|
|
79783
|
+
super(identity2.SEQ, schema);
|
|
79015
79784
|
this.items = [];
|
|
79016
79785
|
}
|
|
79017
79786
|
add(value) {
|
|
@@ -79029,7 +79798,7 @@ var require_YAMLSeq3 = __commonJS4((exports) => {
|
|
|
79029
79798
|
if (typeof idx !== "number")
|
|
79030
79799
|
return;
|
|
79031
79800
|
const it = this.items[idx];
|
|
79032
|
-
return !keepScalar &&
|
|
79801
|
+
return !keepScalar && identity2.isScalar(it) ? it.value : it;
|
|
79033
79802
|
}
|
|
79034
79803
|
has(key) {
|
|
79035
79804
|
const idx = asItemIndex(key);
|
|
@@ -79040,7 +79809,7 @@ var require_YAMLSeq3 = __commonJS4((exports) => {
|
|
|
79040
79809
|
if (typeof idx !== "number")
|
|
79041
79810
|
throw new Error(`Expected a valid index, not ${key}.`);
|
|
79042
79811
|
const prev = this.items[idx];
|
|
79043
|
-
if (
|
|
79812
|
+
if (identity2.isScalar(prev) && Scalar2.isScalarValue(value))
|
|
79044
79813
|
prev.value = value;
|
|
79045
79814
|
else
|
|
79046
79815
|
this.items[idx] = value;
|
|
@@ -79082,27 +79851,27 @@ var require_YAMLSeq3 = __commonJS4((exports) => {
|
|
|
79082
79851
|
}
|
|
79083
79852
|
}
|
|
79084
79853
|
function asItemIndex(key) {
|
|
79085
|
-
let idx =
|
|
79854
|
+
let idx = identity2.isScalar(key) ? key.value : key;
|
|
79086
79855
|
if (idx && typeof idx === "string")
|
|
79087
79856
|
idx = Number(idx);
|
|
79088
79857
|
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
|
|
79089
79858
|
}
|
|
79090
|
-
exports.YAMLSeq =
|
|
79859
|
+
exports.YAMLSeq = YAMLSeq2;
|
|
79091
79860
|
});
|
|
79092
79861
|
var require_seq3 = __commonJS4((exports) => {
|
|
79093
|
-
var
|
|
79094
|
-
var
|
|
79862
|
+
var identity2 = require_identity4();
|
|
79863
|
+
var YAMLSeq2 = require_YAMLSeq3();
|
|
79095
79864
|
var seq = {
|
|
79096
79865
|
collection: "seq",
|
|
79097
79866
|
default: true,
|
|
79098
|
-
nodeClass:
|
|
79867
|
+
nodeClass: YAMLSeq2.YAMLSeq,
|
|
79099
79868
|
tag: "tag:yaml.org,2002:seq",
|
|
79100
79869
|
resolve(seq2, onError) {
|
|
79101
|
-
if (!
|
|
79870
|
+
if (!identity2.isSeq(seq2))
|
|
79102
79871
|
onError("Expected a sequence for this tag");
|
|
79103
79872
|
return seq2;
|
|
79104
79873
|
},
|
|
79105
|
-
createNode: (schema, obj, ctx) =>
|
|
79874
|
+
createNode: (schema, obj, ctx) => YAMLSeq2.YAMLSeq.from(schema, obj, ctx)
|
|
79106
79875
|
};
|
|
79107
79876
|
exports.seq = seq;
|
|
79108
79877
|
});
|
|
@@ -79121,26 +79890,26 @@ var require_string3 = __commonJS4((exports) => {
|
|
|
79121
79890
|
exports.string = string;
|
|
79122
79891
|
});
|
|
79123
79892
|
var require_null3 = __commonJS4((exports) => {
|
|
79124
|
-
var
|
|
79893
|
+
var Scalar2 = require_Scalar3();
|
|
79125
79894
|
var nullTag = {
|
|
79126
79895
|
identify: (value) => value == null,
|
|
79127
|
-
createNode: () => new
|
|
79896
|
+
createNode: () => new Scalar2.Scalar(null),
|
|
79128
79897
|
default: true,
|
|
79129
79898
|
tag: "tag:yaml.org,2002:null",
|
|
79130
79899
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
79131
|
-
resolve: () => new
|
|
79900
|
+
resolve: () => new Scalar2.Scalar(null),
|
|
79132
79901
|
stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr
|
|
79133
79902
|
};
|
|
79134
79903
|
exports.nullTag = nullTag;
|
|
79135
79904
|
});
|
|
79136
79905
|
var require_bool4 = __commonJS4((exports) => {
|
|
79137
|
-
var
|
|
79906
|
+
var Scalar2 = require_Scalar3();
|
|
79138
79907
|
var boolTag = {
|
|
79139
79908
|
identify: (value) => typeof value === "boolean",
|
|
79140
79909
|
default: true,
|
|
79141
79910
|
tag: "tag:yaml.org,2002:bool",
|
|
79142
79911
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
79143
|
-
resolve: (str) => new
|
|
79912
|
+
resolve: (str) => new Scalar2.Scalar(str[0] === "t" || str[0] === "T"),
|
|
79144
79913
|
stringify({ source, value }, ctx) {
|
|
79145
79914
|
if (source && boolTag.test.test(source)) {
|
|
79146
79915
|
const sv = source[0] === "t" || source[0] === "T";
|
|
@@ -79175,7 +79944,7 @@ var require_stringifyNumber3 = __commonJS4((exports) => {
|
|
|
79175
79944
|
exports.stringifyNumber = stringifyNumber;
|
|
79176
79945
|
});
|
|
79177
79946
|
var require_float4 = __commonJS4((exports) => {
|
|
79178
|
-
var
|
|
79947
|
+
var Scalar2 = require_Scalar3();
|
|
79179
79948
|
var stringifyNumber = require_stringifyNumber3();
|
|
79180
79949
|
var floatNaN = {
|
|
79181
79950
|
identify: (value) => typeof value === "number",
|
|
@@ -79203,7 +79972,7 @@ var require_float4 = __commonJS4((exports) => {
|
|
|
79203
79972
|
tag: "tag:yaml.org,2002:float",
|
|
79204
79973
|
test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
|
|
79205
79974
|
resolve(str) {
|
|
79206
|
-
const node = new
|
|
79975
|
+
const node = new Scalar2.Scalar(parseFloat(str));
|
|
79207
79976
|
const dot = str.indexOf(".");
|
|
79208
79977
|
if (dot !== -1 && str[str.length - 1] === "0")
|
|
79209
79978
|
node.minFractionDigits = str.length - dot - 1;
|
|
@@ -79279,7 +80048,7 @@ var require_schema5 = __commonJS4((exports) => {
|
|
|
79279
80048
|
exports.schema = schema;
|
|
79280
80049
|
});
|
|
79281
80050
|
var require_schema23 = __commonJS4((exports) => {
|
|
79282
|
-
var
|
|
80051
|
+
var Scalar2 = require_Scalar3();
|
|
79283
80052
|
var map8 = require_map4();
|
|
79284
80053
|
var seq = require_seq3();
|
|
79285
80054
|
function intIdentify(value) {
|
|
@@ -79296,7 +80065,7 @@ var require_schema23 = __commonJS4((exports) => {
|
|
|
79296
80065
|
},
|
|
79297
80066
|
{
|
|
79298
80067
|
identify: (value) => value == null,
|
|
79299
|
-
createNode: () => new
|
|
80068
|
+
createNode: () => new Scalar2.Scalar(null),
|
|
79300
80069
|
default: true,
|
|
79301
80070
|
tag: "tag:yaml.org,2002:null",
|
|
79302
80071
|
test: /^null$/,
|
|
@@ -79342,7 +80111,7 @@ var require_schema23 = __commonJS4((exports) => {
|
|
|
79342
80111
|
});
|
|
79343
80112
|
var require_binary3 = __commonJS4((exports) => {
|
|
79344
80113
|
var node_buffer = __require4("buffer");
|
|
79345
|
-
var
|
|
80114
|
+
var Scalar2 = require_Scalar3();
|
|
79346
80115
|
var stringifyString = require_stringifyString3();
|
|
79347
80116
|
var binary = {
|
|
79348
80117
|
identify: (value) => value instanceof Uint8Array,
|
|
@@ -79377,15 +80146,15 @@ var require_binary3 = __commonJS4((exports) => {
|
|
|
79377
80146
|
} else {
|
|
79378
80147
|
throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
|
|
79379
80148
|
}
|
|
79380
|
-
type ?? (type =
|
|
79381
|
-
if (type !==
|
|
80149
|
+
type ?? (type = Scalar2.Scalar.BLOCK_LITERAL);
|
|
80150
|
+
if (type !== Scalar2.Scalar.QUOTE_DOUBLE) {
|
|
79382
80151
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
79383
80152
|
const n2 = Math.ceil(str.length / lineWidth);
|
|
79384
80153
|
const lines = new Array(n2);
|
|
79385
80154
|
for (let i2 = 0, o3 = 0;i2 < n2; ++i2, o3 += lineWidth) {
|
|
79386
80155
|
lines[i2] = str.substr(o3, lineWidth);
|
|
79387
80156
|
}
|
|
79388
|
-
str = lines.join(type ===
|
|
80157
|
+
str = lines.join(type === Scalar2.Scalar.BLOCK_LITERAL ? `
|
|
79389
80158
|
` : " ");
|
|
79390
80159
|
}
|
|
79391
80160
|
return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
|
|
@@ -79394,20 +80163,20 @@ var require_binary3 = __commonJS4((exports) => {
|
|
|
79394
80163
|
exports.binary = binary;
|
|
79395
80164
|
});
|
|
79396
80165
|
var require_pairs4 = __commonJS4((exports) => {
|
|
79397
|
-
var
|
|
79398
|
-
var
|
|
79399
|
-
var
|
|
79400
|
-
var
|
|
80166
|
+
var identity2 = require_identity4();
|
|
80167
|
+
var Pair2 = require_Pair3();
|
|
80168
|
+
var Scalar2 = require_Scalar3();
|
|
80169
|
+
var YAMLSeq2 = require_YAMLSeq3();
|
|
79401
80170
|
function resolvePairs(seq, onError) {
|
|
79402
|
-
if (
|
|
80171
|
+
if (identity2.isSeq(seq)) {
|
|
79403
80172
|
for (let i2 = 0;i2 < seq.items.length; ++i2) {
|
|
79404
80173
|
let item = seq.items[i2];
|
|
79405
|
-
if (
|
|
80174
|
+
if (identity2.isPair(item))
|
|
79406
80175
|
continue;
|
|
79407
|
-
else if (
|
|
80176
|
+
else if (identity2.isMap(item)) {
|
|
79408
80177
|
if (item.items.length > 1)
|
|
79409
80178
|
onError("Each pair must have its own sequence indicator");
|
|
79410
|
-
const pair = item.items[0] || new
|
|
80179
|
+
const pair = item.items[0] || new Pair2.Pair(new Scalar2.Scalar(null));
|
|
79411
80180
|
if (item.commentBefore)
|
|
79412
80181
|
pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}
|
|
79413
80182
|
${pair.key.commentBefore}` : item.commentBefore;
|
|
@@ -79418,7 +80187,7 @@ ${cn.comment}` : item.comment;
|
|
|
79418
80187
|
}
|
|
79419
80188
|
item = pair;
|
|
79420
80189
|
}
|
|
79421
|
-
seq.items[i2] =
|
|
80190
|
+
seq.items[i2] = identity2.isPair(item) ? item : new Pair2.Pair(item);
|
|
79422
80191
|
}
|
|
79423
80192
|
} else
|
|
79424
80193
|
onError("Expected a sequence for this tag");
|
|
@@ -79426,7 +80195,7 @@ ${cn.comment}` : item.comment;
|
|
|
79426
80195
|
}
|
|
79427
80196
|
function createPairs(schema, iterable, ctx) {
|
|
79428
80197
|
const { replacer } = ctx;
|
|
79429
|
-
const pairs2 = new
|
|
80198
|
+
const pairs2 = new YAMLSeq2.YAMLSeq(schema);
|
|
79430
80199
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
79431
80200
|
let i2 = 0;
|
|
79432
80201
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
@@ -79451,7 +80220,7 @@ ${cn.comment}` : item.comment;
|
|
|
79451
80220
|
} else {
|
|
79452
80221
|
key = it;
|
|
79453
80222
|
}
|
|
79454
|
-
pairs2.items.push(
|
|
80223
|
+
pairs2.items.push(Pair2.createPair(key, value, ctx));
|
|
79455
80224
|
}
|
|
79456
80225
|
return pairs2;
|
|
79457
80226
|
}
|
|
@@ -79467,20 +80236,20 @@ ${cn.comment}` : item.comment;
|
|
|
79467
80236
|
exports.resolvePairs = resolvePairs;
|
|
79468
80237
|
});
|
|
79469
80238
|
var require_omap3 = __commonJS4((exports) => {
|
|
79470
|
-
var
|
|
80239
|
+
var identity2 = require_identity4();
|
|
79471
80240
|
var toJS = require_toJS3();
|
|
79472
|
-
var
|
|
79473
|
-
var
|
|
80241
|
+
var YAMLMap2 = require_YAMLMap3();
|
|
80242
|
+
var YAMLSeq2 = require_YAMLSeq3();
|
|
79474
80243
|
var pairs = require_pairs4();
|
|
79475
80244
|
|
|
79476
|
-
class YAMLOMap extends
|
|
80245
|
+
class YAMLOMap extends YAMLSeq2.YAMLSeq {
|
|
79477
80246
|
constructor() {
|
|
79478
80247
|
super();
|
|
79479
|
-
this.add =
|
|
79480
|
-
this.delete =
|
|
79481
|
-
this.get =
|
|
79482
|
-
this.has =
|
|
79483
|
-
this.set =
|
|
80248
|
+
this.add = YAMLMap2.YAMLMap.prototype.add.bind(this);
|
|
80249
|
+
this.delete = YAMLMap2.YAMLMap.prototype.delete.bind(this);
|
|
80250
|
+
this.get = YAMLMap2.YAMLMap.prototype.get.bind(this);
|
|
80251
|
+
this.has = YAMLMap2.YAMLMap.prototype.has.bind(this);
|
|
80252
|
+
this.set = YAMLMap2.YAMLMap.prototype.set.bind(this);
|
|
79484
80253
|
this.tag = YAMLOMap.tag;
|
|
79485
80254
|
}
|
|
79486
80255
|
toJSON(_3, ctx) {
|
|
@@ -79491,7 +80260,7 @@ var require_omap3 = __commonJS4((exports) => {
|
|
|
79491
80260
|
ctx.onCreate(map8);
|
|
79492
80261
|
for (const pair of this.items) {
|
|
79493
80262
|
let key, value;
|
|
79494
|
-
if (
|
|
80263
|
+
if (identity2.isPair(pair)) {
|
|
79495
80264
|
key = toJS.toJS(pair.key, "", ctx);
|
|
79496
80265
|
value = toJS.toJS(pair.value, key, ctx);
|
|
79497
80266
|
} else {
|
|
@@ -79521,7 +80290,7 @@ var require_omap3 = __commonJS4((exports) => {
|
|
|
79521
80290
|
const pairs$1 = pairs.resolvePairs(seq, onError);
|
|
79522
80291
|
const seenKeys = [];
|
|
79523
80292
|
for (const { key } of pairs$1.items) {
|
|
79524
|
-
if (
|
|
80293
|
+
if (identity2.isScalar(key)) {
|
|
79525
80294
|
if (seenKeys.includes(key.value)) {
|
|
79526
80295
|
onError(`Ordered maps must not include duplicate keys: ${key.value}`);
|
|
79527
80296
|
} else {
|
|
@@ -79537,7 +80306,7 @@ var require_omap3 = __commonJS4((exports) => {
|
|
|
79537
80306
|
exports.omap = omap;
|
|
79538
80307
|
});
|
|
79539
80308
|
var require_bool23 = __commonJS4((exports) => {
|
|
79540
|
-
var
|
|
80309
|
+
var Scalar2 = require_Scalar3();
|
|
79541
80310
|
function boolStringify({ value, source }, ctx) {
|
|
79542
80311
|
const boolObj = value ? trueTag : falseTag;
|
|
79543
80312
|
if (source && boolObj.test.test(source))
|
|
@@ -79549,7 +80318,7 @@ var require_bool23 = __commonJS4((exports) => {
|
|
|
79549
80318
|
default: true,
|
|
79550
80319
|
tag: "tag:yaml.org,2002:bool",
|
|
79551
80320
|
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
|
|
79552
|
-
resolve: () => new
|
|
80321
|
+
resolve: () => new Scalar2.Scalar(true),
|
|
79553
80322
|
stringify: boolStringify
|
|
79554
80323
|
};
|
|
79555
80324
|
var falseTag = {
|
|
@@ -79557,14 +80326,14 @@ var require_bool23 = __commonJS4((exports) => {
|
|
|
79557
80326
|
default: true,
|
|
79558
80327
|
tag: "tag:yaml.org,2002:bool",
|
|
79559
80328
|
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
|
|
79560
|
-
resolve: () => new
|
|
80329
|
+
resolve: () => new Scalar2.Scalar(false),
|
|
79561
80330
|
stringify: boolStringify
|
|
79562
80331
|
};
|
|
79563
80332
|
exports.falseTag = falseTag;
|
|
79564
80333
|
exports.trueTag = trueTag;
|
|
79565
80334
|
});
|
|
79566
80335
|
var require_float23 = __commonJS4((exports) => {
|
|
79567
|
-
var
|
|
80336
|
+
var Scalar2 = require_Scalar3();
|
|
79568
80337
|
var stringifyNumber = require_stringifyNumber3();
|
|
79569
80338
|
var floatNaN = {
|
|
79570
80339
|
identify: (value) => typeof value === "number",
|
|
@@ -79592,7 +80361,7 @@ var require_float23 = __commonJS4((exports) => {
|
|
|
79592
80361
|
tag: "tag:yaml.org,2002:float",
|
|
79593
80362
|
test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
|
|
79594
80363
|
resolve(str) {
|
|
79595
|
-
const node = new
|
|
80364
|
+
const node = new Scalar2.Scalar(parseFloat(str.replace(/_/g, "")));
|
|
79596
80365
|
const dot = str.indexOf(".");
|
|
79597
80366
|
if (dot !== -1) {
|
|
79598
80367
|
const f3 = str.substring(dot + 1).replace(/_/g, "");
|
|
@@ -79682,39 +80451,39 @@ var require_int23 = __commonJS4((exports) => {
|
|
|
79682
80451
|
exports.intOct = intOct;
|
|
79683
80452
|
});
|
|
79684
80453
|
var require_set3 = __commonJS4((exports) => {
|
|
79685
|
-
var
|
|
79686
|
-
var
|
|
79687
|
-
var
|
|
80454
|
+
var identity2 = require_identity4();
|
|
80455
|
+
var Pair2 = require_Pair3();
|
|
80456
|
+
var YAMLMap2 = require_YAMLMap3();
|
|
79688
80457
|
|
|
79689
|
-
class YAMLSet extends
|
|
80458
|
+
class YAMLSet extends YAMLMap2.YAMLMap {
|
|
79690
80459
|
constructor(schema) {
|
|
79691
80460
|
super(schema);
|
|
79692
80461
|
this.tag = YAMLSet.tag;
|
|
79693
80462
|
}
|
|
79694
80463
|
add(key) {
|
|
79695
80464
|
let pair;
|
|
79696
|
-
if (
|
|
80465
|
+
if (identity2.isPair(key))
|
|
79697
80466
|
pair = key;
|
|
79698
80467
|
else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
|
|
79699
|
-
pair = new
|
|
80468
|
+
pair = new Pair2.Pair(key.key, null);
|
|
79700
80469
|
else
|
|
79701
|
-
pair = new
|
|
79702
|
-
const prev =
|
|
80470
|
+
pair = new Pair2.Pair(key, null);
|
|
80471
|
+
const prev = YAMLMap2.findPair(this.items, pair.key);
|
|
79703
80472
|
if (!prev)
|
|
79704
80473
|
this.items.push(pair);
|
|
79705
80474
|
}
|
|
79706
80475
|
get(key, keepPair) {
|
|
79707
|
-
const pair =
|
|
79708
|
-
return !keepPair &&
|
|
80476
|
+
const pair = YAMLMap2.findPair(this.items, key);
|
|
80477
|
+
return !keepPair && identity2.isPair(pair) ? identity2.isScalar(pair.key) ? pair.key.value : pair.key : pair;
|
|
79709
80478
|
}
|
|
79710
80479
|
set(key, value) {
|
|
79711
80480
|
if (typeof value !== "boolean")
|
|
79712
80481
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
|
|
79713
|
-
const prev =
|
|
80482
|
+
const prev = YAMLMap2.findPair(this.items, key);
|
|
79714
80483
|
if (prev && !value) {
|
|
79715
80484
|
this.items.splice(this.items.indexOf(prev), 1);
|
|
79716
80485
|
} else if (!prev && value) {
|
|
79717
|
-
this.items.push(new
|
|
80486
|
+
this.items.push(new Pair2.Pair(key));
|
|
79718
80487
|
}
|
|
79719
80488
|
}
|
|
79720
80489
|
toJSON(_3, ctx) {
|
|
@@ -79735,7 +80504,7 @@ var require_set3 = __commonJS4((exports) => {
|
|
|
79735
80504
|
for (let value of iterable) {
|
|
79736
80505
|
if (typeof replacer === "function")
|
|
79737
80506
|
value = replacer.call(iterable, value, value);
|
|
79738
|
-
set2.items.push(
|
|
80507
|
+
set2.items.push(Pair2.createPair(value, null, ctx));
|
|
79739
80508
|
}
|
|
79740
80509
|
return set2;
|
|
79741
80510
|
}
|
|
@@ -79749,7 +80518,7 @@ var require_set3 = __commonJS4((exports) => {
|
|
|
79749
80518
|
tag: "tag:yaml.org,2002:set",
|
|
79750
80519
|
createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
|
|
79751
80520
|
resolve(map8, onError) {
|
|
79752
|
-
if (
|
|
80521
|
+
if (identity2.isMap(map8)) {
|
|
79753
80522
|
if (map8.hasAllNullValues(true))
|
|
79754
80523
|
return Object.assign(new YAMLSet, map8);
|
|
79755
80524
|
else
|
|
@@ -79971,35 +80740,35 @@ var require_tags3 = __commonJS4((exports) => {
|
|
|
79971
80740
|
exports.getTags = getTags;
|
|
79972
80741
|
});
|
|
79973
80742
|
var require_Schema3 = __commonJS4((exports) => {
|
|
79974
|
-
var
|
|
80743
|
+
var identity2 = require_identity4();
|
|
79975
80744
|
var map8 = require_map4();
|
|
79976
80745
|
var seq = require_seq3();
|
|
79977
80746
|
var string = require_string3();
|
|
79978
80747
|
var tags = require_tags3();
|
|
79979
80748
|
var sortMapEntriesByKey = (a2, b2) => a2.key < b2.key ? -1 : a2.key > b2.key ? 1 : 0;
|
|
79980
80749
|
|
|
79981
|
-
class
|
|
80750
|
+
class Schema2 {
|
|
79982
80751
|
constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
|
|
79983
80752
|
this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null;
|
|
79984
80753
|
this.name = typeof schema === "string" && schema || "core";
|
|
79985
80754
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
79986
80755
|
this.tags = tags.getTags(customTags, this.name, merge);
|
|
79987
80756
|
this.toStringOptions = toStringDefaults ?? null;
|
|
79988
|
-
Object.defineProperty(this,
|
|
79989
|
-
Object.defineProperty(this,
|
|
79990
|
-
Object.defineProperty(this,
|
|
80757
|
+
Object.defineProperty(this, identity2.MAP, { value: map8.map });
|
|
80758
|
+
Object.defineProperty(this, identity2.SCALAR, { value: string.string });
|
|
80759
|
+
Object.defineProperty(this, identity2.SEQ, { value: seq.seq });
|
|
79991
80760
|
this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;
|
|
79992
80761
|
}
|
|
79993
80762
|
clone() {
|
|
79994
|
-
const copy = Object.create(
|
|
80763
|
+
const copy = Object.create(Schema2.prototype, Object.getOwnPropertyDescriptors(this));
|
|
79995
80764
|
copy.tags = this.tags.slice();
|
|
79996
80765
|
return copy;
|
|
79997
80766
|
}
|
|
79998
80767
|
}
|
|
79999
|
-
exports.Schema =
|
|
80768
|
+
exports.Schema = Schema2;
|
|
80000
80769
|
});
|
|
80001
80770
|
var require_stringifyDocument3 = __commonJS4((exports) => {
|
|
80002
|
-
var
|
|
80771
|
+
var identity2 = require_identity4();
|
|
80003
80772
|
var stringify = require_stringify3();
|
|
80004
80773
|
var stringifyComment = require_stringifyComment3();
|
|
80005
80774
|
function stringifyDocument(doc, options) {
|
|
@@ -80026,7 +80795,7 @@ var require_stringifyDocument3 = __commonJS4((exports) => {
|
|
|
80026
80795
|
let chompKeep = false;
|
|
80027
80796
|
let contentComment = null;
|
|
80028
80797
|
if (doc.contents) {
|
|
80029
|
-
if (
|
|
80798
|
+
if (identity2.isNode(doc.contents)) {
|
|
80030
80799
|
if (doc.contents.spaceBefore && hasDirectives)
|
|
80031
80800
|
lines.push("");
|
|
80032
80801
|
if (doc.contents.commentBefore) {
|
|
@@ -80077,25 +80846,25 @@ var require_stringifyDocument3 = __commonJS4((exports) => {
|
|
|
80077
80846
|
exports.stringifyDocument = stringifyDocument;
|
|
80078
80847
|
});
|
|
80079
80848
|
var require_Document3 = __commonJS4((exports) => {
|
|
80080
|
-
var
|
|
80849
|
+
var Alias2 = require_Alias3();
|
|
80081
80850
|
var Collection = require_Collection3();
|
|
80082
|
-
var
|
|
80083
|
-
var
|
|
80851
|
+
var identity2 = require_identity4();
|
|
80852
|
+
var Pair2 = require_Pair3();
|
|
80084
80853
|
var toJS = require_toJS3();
|
|
80085
|
-
var
|
|
80854
|
+
var Schema2 = require_Schema3();
|
|
80086
80855
|
var stringifyDocument = require_stringifyDocument3();
|
|
80087
80856
|
var anchors = require_anchors3();
|
|
80088
80857
|
var applyReviver = require_applyReviver3();
|
|
80089
80858
|
var createNode = require_createNode3();
|
|
80090
80859
|
var directives = require_directives3();
|
|
80091
80860
|
|
|
80092
|
-
class
|
|
80861
|
+
class Document2 {
|
|
80093
80862
|
constructor(value, replacer, options) {
|
|
80094
80863
|
this.commentBefore = null;
|
|
80095
80864
|
this.comment = null;
|
|
80096
80865
|
this.errors = [];
|
|
80097
80866
|
this.warnings = [];
|
|
80098
|
-
Object.defineProperty(this,
|
|
80867
|
+
Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.DOC });
|
|
80099
80868
|
let _replacer = null;
|
|
80100
80869
|
if (typeof replacer === "function" || Array.isArray(replacer)) {
|
|
80101
80870
|
_replacer = replacer;
|
|
@@ -80125,8 +80894,8 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80125
80894
|
this.contents = value === undefined ? null : this.createNode(value, _replacer, options);
|
|
80126
80895
|
}
|
|
80127
80896
|
clone() {
|
|
80128
|
-
const copy = Object.create(
|
|
80129
|
-
[
|
|
80897
|
+
const copy = Object.create(Document2.prototype, {
|
|
80898
|
+
[identity2.NODE_TYPE]: { value: identity2.DOC }
|
|
80130
80899
|
});
|
|
80131
80900
|
copy.commentBefore = this.commentBefore;
|
|
80132
80901
|
copy.comment = this.comment;
|
|
@@ -80136,7 +80905,7 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80136
80905
|
if (this.directives)
|
|
80137
80906
|
copy.directives = this.directives.clone();
|
|
80138
80907
|
copy.schema = this.schema.clone();
|
|
80139
|
-
copy.contents =
|
|
80908
|
+
copy.contents = identity2.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents;
|
|
80140
80909
|
if (this.range)
|
|
80141
80910
|
copy.range = this.range.slice();
|
|
80142
80911
|
return copy;
|
|
@@ -80154,7 +80923,7 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80154
80923
|
const prev = anchors.anchorNames(this);
|
|
80155
80924
|
node.anchor = !name || prev.has(name) ? anchors.findNewAnchor(name || "a", prev) : name;
|
|
80156
80925
|
}
|
|
80157
|
-
return new
|
|
80926
|
+
return new Alias2.Alias(node.anchor);
|
|
80158
80927
|
}
|
|
80159
80928
|
createNode(value, replacer, options) {
|
|
80160
80929
|
let _replacer = undefined;
|
|
@@ -80183,7 +80952,7 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80183
80952
|
sourceObjects
|
|
80184
80953
|
};
|
|
80185
80954
|
const node = createNode.createNode(value, tag, ctx);
|
|
80186
|
-
if (flow &&
|
|
80955
|
+
if (flow && identity2.isCollection(node))
|
|
80187
80956
|
node.flow = true;
|
|
80188
80957
|
setAnchors();
|
|
80189
80958
|
return node;
|
|
@@ -80191,7 +80960,7 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80191
80960
|
createPair(key, value, options = {}) {
|
|
80192
80961
|
const k2 = this.createNode(key, null, options);
|
|
80193
80962
|
const v2 = this.createNode(value, null, options);
|
|
80194
|
-
return new
|
|
80963
|
+
return new Pair2.Pair(k2, v2);
|
|
80195
80964
|
}
|
|
80196
80965
|
delete(key) {
|
|
80197
80966
|
return assertCollection(this.contents) ? this.contents.delete(key) : false;
|
|
@@ -80206,20 +80975,20 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80206
80975
|
return assertCollection(this.contents) ? this.contents.deleteIn(path3) : false;
|
|
80207
80976
|
}
|
|
80208
80977
|
get(key, keepScalar) {
|
|
80209
|
-
return
|
|
80978
|
+
return identity2.isCollection(this.contents) ? this.contents.get(key, keepScalar) : undefined;
|
|
80210
80979
|
}
|
|
80211
80980
|
getIn(path3, keepScalar) {
|
|
80212
80981
|
if (Collection.isEmptyPath(path3))
|
|
80213
|
-
return !keepScalar &&
|
|
80214
|
-
return
|
|
80982
|
+
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
80983
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path3, keepScalar) : undefined;
|
|
80215
80984
|
}
|
|
80216
80985
|
has(key) {
|
|
80217
|
-
return
|
|
80986
|
+
return identity2.isCollection(this.contents) ? this.contents.has(key) : false;
|
|
80218
80987
|
}
|
|
80219
80988
|
hasIn(path3) {
|
|
80220
80989
|
if (Collection.isEmptyPath(path3))
|
|
80221
80990
|
return this.contents !== undefined;
|
|
80222
|
-
return
|
|
80991
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path3) : false;
|
|
80223
80992
|
}
|
|
80224
80993
|
set(key, value) {
|
|
80225
80994
|
if (this.contents == null) {
|
|
@@ -80270,7 +81039,7 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80270
81039
|
if (options.schema instanceof Object)
|
|
80271
81040
|
this.schema = options.schema;
|
|
80272
81041
|
else if (opt)
|
|
80273
|
-
this.schema = new
|
|
81042
|
+
this.schema = new Schema2.Schema(Object.assign(opt, options));
|
|
80274
81043
|
else
|
|
80275
81044
|
throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
|
|
80276
81045
|
}
|
|
@@ -80303,11 +81072,11 @@ var require_Document3 = __commonJS4((exports) => {
|
|
|
80303
81072
|
}
|
|
80304
81073
|
}
|
|
80305
81074
|
function assertCollection(contents) {
|
|
80306
|
-
if (
|
|
81075
|
+
if (identity2.isCollection(contents))
|
|
80307
81076
|
return true;
|
|
80308
81077
|
throw new Error("Expected a YAML collection as document contents");
|
|
80309
81078
|
}
|
|
80310
|
-
exports.Document =
|
|
81079
|
+
exports.Document = Document2;
|
|
80311
81080
|
});
|
|
80312
81081
|
var require_errors4 = __commonJS4((exports) => {
|
|
80313
81082
|
|
|
@@ -80553,26 +81322,26 @@ var require_util_flow_indent_check3 = __commonJS4((exports) => {
|
|
|
80553
81322
|
exports.flowIndentCheck = flowIndentCheck;
|
|
80554
81323
|
});
|
|
80555
81324
|
var require_util_map_includes3 = __commonJS4((exports) => {
|
|
80556
|
-
var
|
|
81325
|
+
var identity2 = require_identity4();
|
|
80557
81326
|
function mapIncludes(ctx, items, search) {
|
|
80558
81327
|
const { uniqueKeys } = ctx.options;
|
|
80559
81328
|
if (uniqueKeys === false)
|
|
80560
81329
|
return false;
|
|
80561
|
-
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a2, b2) => a2 === b2 ||
|
|
81330
|
+
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a2, b2) => a2 === b2 || identity2.isScalar(a2) && identity2.isScalar(b2) && a2.value === b2.value;
|
|
80562
81331
|
return items.some((pair) => isEqual(pair.key, search));
|
|
80563
81332
|
}
|
|
80564
81333
|
exports.mapIncludes = mapIncludes;
|
|
80565
81334
|
});
|
|
80566
81335
|
var require_resolve_block_map3 = __commonJS4((exports) => {
|
|
80567
|
-
var
|
|
80568
|
-
var
|
|
81336
|
+
var Pair2 = require_Pair3();
|
|
81337
|
+
var YAMLMap2 = require_YAMLMap3();
|
|
80569
81338
|
var resolveProps = require_resolve_props3();
|
|
80570
81339
|
var utilContainsNewline = require_util_contains_newline3();
|
|
80571
81340
|
var utilFlowIndentCheck = require_util_flow_indent_check3();
|
|
80572
81341
|
var utilMapIncludes = require_util_map_includes3();
|
|
80573
81342
|
var startColMsg = "All mapping items must start at the same column";
|
|
80574
81343
|
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
|
|
80575
|
-
const NodeClass = tag?.nodeClass ??
|
|
81344
|
+
const NodeClass = tag?.nodeClass ?? YAMLMap2.YAMLMap;
|
|
80576
81345
|
const map8 = new NodeClass(ctx.schema);
|
|
80577
81346
|
if (ctx.atRoot)
|
|
80578
81347
|
ctx.atRoot = false;
|
|
@@ -80641,7 +81410,7 @@ var require_resolve_block_map3 = __commonJS4((exports) => {
|
|
|
80641
81410
|
if (ctx.schema.compat)
|
|
80642
81411
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
80643
81412
|
offset = valueNode.range[2];
|
|
80644
|
-
const pair = new
|
|
81413
|
+
const pair = new Pair2.Pair(keyNode, valueNode);
|
|
80645
81414
|
if (ctx.options.keepSourceTokens)
|
|
80646
81415
|
pair.srcToken = collItem;
|
|
80647
81416
|
map8.items.push(pair);
|
|
@@ -80655,7 +81424,7 @@ var require_resolve_block_map3 = __commonJS4((exports) => {
|
|
|
80655
81424
|
else
|
|
80656
81425
|
keyNode.comment = valueProps.comment;
|
|
80657
81426
|
}
|
|
80658
|
-
const pair = new
|
|
81427
|
+
const pair = new Pair2.Pair(keyNode);
|
|
80659
81428
|
if (ctx.options.keepSourceTokens)
|
|
80660
81429
|
pair.srcToken = collItem;
|
|
80661
81430
|
map8.items.push(pair);
|
|
@@ -80669,11 +81438,11 @@ var require_resolve_block_map3 = __commonJS4((exports) => {
|
|
|
80669
81438
|
exports.resolveBlockMap = resolveBlockMap;
|
|
80670
81439
|
});
|
|
80671
81440
|
var require_resolve_block_seq3 = __commonJS4((exports) => {
|
|
80672
|
-
var
|
|
81441
|
+
var YAMLSeq2 = require_YAMLSeq3();
|
|
80673
81442
|
var resolveProps = require_resolve_props3();
|
|
80674
81443
|
var utilFlowIndentCheck = require_util_flow_indent_check3();
|
|
80675
81444
|
function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
|
|
80676
|
-
const NodeClass = tag?.nodeClass ??
|
|
81445
|
+
const NodeClass = tag?.nodeClass ?? YAMLSeq2.YAMLSeq;
|
|
80677
81446
|
const seq = new NodeClass(ctx.schema);
|
|
80678
81447
|
if (ctx.atRoot)
|
|
80679
81448
|
ctx.atRoot = false;
|
|
@@ -80753,10 +81522,10 @@ var require_resolve_end3 = __commonJS4((exports) => {
|
|
|
80753
81522
|
exports.resolveEnd = resolveEnd;
|
|
80754
81523
|
});
|
|
80755
81524
|
var require_resolve_flow_collection3 = __commonJS4((exports) => {
|
|
80756
|
-
var
|
|
80757
|
-
var
|
|
80758
|
-
var
|
|
80759
|
-
var
|
|
81525
|
+
var identity2 = require_identity4();
|
|
81526
|
+
var Pair2 = require_Pair3();
|
|
81527
|
+
var YAMLMap2 = require_YAMLMap3();
|
|
81528
|
+
var YAMLSeq2 = require_YAMLSeq3();
|
|
80760
81529
|
var resolveEnd = require_resolve_end3();
|
|
80761
81530
|
var resolveProps = require_resolve_props3();
|
|
80762
81531
|
var utilContainsNewline = require_util_contains_newline3();
|
|
@@ -80766,7 +81535,7 @@ var require_resolve_flow_collection3 = __commonJS4((exports) => {
|
|
|
80766
81535
|
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
|
|
80767
81536
|
const isMap = fc.start.source === "{";
|
|
80768
81537
|
const fcName = isMap ? "flow map" : "flow sequence";
|
|
80769
|
-
const NodeClass = tag?.nodeClass ?? (isMap ?
|
|
81538
|
+
const NodeClass = tag?.nodeClass ?? (isMap ? YAMLMap2.YAMLMap : YAMLSeq2.YAMLSeq);
|
|
80770
81539
|
const coll = new NodeClass(ctx.schema);
|
|
80771
81540
|
coll.flow = true;
|
|
80772
81541
|
const atRoot = ctx.atRoot;
|
|
@@ -80829,7 +81598,7 @@ var require_resolve_flow_collection3 = __commonJS4((exports) => {
|
|
|
80829
81598
|
}
|
|
80830
81599
|
if (prevItemComment) {
|
|
80831
81600
|
let prev = coll.items[coll.items.length - 1];
|
|
80832
|
-
if (
|
|
81601
|
+
if (identity2.isPair(prev))
|
|
80833
81602
|
prev = prev.value ?? prev.key;
|
|
80834
81603
|
if (prev.comment)
|
|
80835
81604
|
prev.comment += `
|
|
@@ -80893,7 +81662,7 @@ var require_resolve_flow_collection3 = __commonJS4((exports) => {
|
|
|
80893
81662
|
else
|
|
80894
81663
|
keyNode.comment = valueProps.comment;
|
|
80895
81664
|
}
|
|
80896
|
-
const pair = new
|
|
81665
|
+
const pair = new Pair2.Pair(keyNode, valueNode);
|
|
80897
81666
|
if (ctx.options.keepSourceTokens)
|
|
80898
81667
|
pair.srcToken = collItem;
|
|
80899
81668
|
if (isMap) {
|
|
@@ -80902,7 +81671,7 @@ var require_resolve_flow_collection3 = __commonJS4((exports) => {
|
|
|
80902
81671
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
80903
81672
|
map8.items.push(pair);
|
|
80904
81673
|
} else {
|
|
80905
|
-
const map8 = new
|
|
81674
|
+
const map8 = new YAMLMap2.YAMLMap(ctx.schema);
|
|
80906
81675
|
map8.flow = true;
|
|
80907
81676
|
map8.items.push(pair);
|
|
80908
81677
|
const endRange = (valueNode ?? keyNode).range;
|
|
@@ -80942,10 +81711,10 @@ var require_resolve_flow_collection3 = __commonJS4((exports) => {
|
|
|
80942
81711
|
exports.resolveFlowCollection = resolveFlowCollection;
|
|
80943
81712
|
});
|
|
80944
81713
|
var require_compose_collection3 = __commonJS4((exports) => {
|
|
80945
|
-
var
|
|
80946
|
-
var
|
|
80947
|
-
var
|
|
80948
|
-
var
|
|
81714
|
+
var identity2 = require_identity4();
|
|
81715
|
+
var Scalar2 = require_Scalar3();
|
|
81716
|
+
var YAMLMap2 = require_YAMLMap3();
|
|
81717
|
+
var YAMLSeq2 = require_YAMLSeq3();
|
|
80949
81718
|
var resolveBlockMap = require_resolve_block_map3();
|
|
80950
81719
|
var resolveBlockSeq = require_resolve_block_seq3();
|
|
80951
81720
|
var resolveFlowCollection = require_resolve_flow_collection3();
|
|
@@ -80972,7 +81741,7 @@ var require_compose_collection3 = __commonJS4((exports) => {
|
|
|
80972
81741
|
}
|
|
80973
81742
|
}
|
|
80974
81743
|
const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
|
|
80975
|
-
if (!tagToken || !tagName || tagName === "!" || tagName ===
|
|
81744
|
+
if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap2.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq2.YAMLSeq.tagName && expType === "seq") {
|
|
80976
81745
|
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
80977
81746
|
}
|
|
80978
81747
|
let tag = ctx.schema.tags.find((t2) => t2.tag === tagName && t2.collection === expType);
|
|
@@ -80992,7 +81761,7 @@ var require_compose_collection3 = __commonJS4((exports) => {
|
|
|
80992
81761
|
}
|
|
80993
81762
|
const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
|
|
80994
81763
|
const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
|
|
80995
|
-
const node =
|
|
81764
|
+
const node = identity2.isNode(res) ? res : new Scalar2.Scalar(res);
|
|
80996
81765
|
node.range = coll.range;
|
|
80997
81766
|
node.tag = tagName;
|
|
80998
81767
|
if (tag?.format)
|
|
@@ -81002,13 +81771,13 @@ var require_compose_collection3 = __commonJS4((exports) => {
|
|
|
81002
81771
|
exports.composeCollection = composeCollection;
|
|
81003
81772
|
});
|
|
81004
81773
|
var require_resolve_block_scalar3 = __commonJS4((exports) => {
|
|
81005
|
-
var
|
|
81774
|
+
var Scalar2 = require_Scalar3();
|
|
81006
81775
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
81007
81776
|
const start = scalar.offset;
|
|
81008
81777
|
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
|
|
81009
81778
|
if (!header)
|
|
81010
81779
|
return { value: "", type: null, comment: "", range: [start, start, start] };
|
|
81011
|
-
const type = header.mode === ">" ?
|
|
81780
|
+
const type = header.mode === ">" ? Scalar2.Scalar.BLOCK_FOLDED : Scalar2.Scalar.BLOCK_LITERAL;
|
|
81012
81781
|
const lines = scalar.source ? splitLines(scalar.source) : [];
|
|
81013
81782
|
let chompStart = lines.length;
|
|
81014
81783
|
for (let i2 = lines.length - 1;i2 >= 0; --i2) {
|
|
@@ -81072,7 +81841,7 @@ var require_resolve_block_scalar3 = __commonJS4((exports) => {
|
|
|
81072
81841
|
onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message);
|
|
81073
81842
|
indent = "";
|
|
81074
81843
|
}
|
|
81075
|
-
if (type ===
|
|
81844
|
+
if (type === Scalar2.Scalar.BLOCK_LITERAL) {
|
|
81076
81845
|
value += sep2 + indent.slice(trimIndent) + content;
|
|
81077
81846
|
sep2 = `
|
|
81078
81847
|
`;
|
|
@@ -81193,7 +81962,7 @@ var require_resolve_block_scalar3 = __commonJS4((exports) => {
|
|
|
81193
81962
|
exports.resolveBlockScalar = resolveBlockScalar;
|
|
81194
81963
|
});
|
|
81195
81964
|
var require_resolve_flow_scalar3 = __commonJS4((exports) => {
|
|
81196
|
-
var
|
|
81965
|
+
var Scalar2 = require_Scalar3();
|
|
81197
81966
|
var resolveEnd = require_resolve_end3();
|
|
81198
81967
|
function resolveFlowScalar(scalar, strict, onError) {
|
|
81199
81968
|
const { offset, type, source, end } = scalar;
|
|
@@ -81202,15 +81971,15 @@ var require_resolve_flow_scalar3 = __commonJS4((exports) => {
|
|
|
81202
81971
|
const _onError = (rel, code, msg) => onError(offset + rel, code, msg);
|
|
81203
81972
|
switch (type) {
|
|
81204
81973
|
case "scalar":
|
|
81205
|
-
_type =
|
|
81974
|
+
_type = Scalar2.Scalar.PLAIN;
|
|
81206
81975
|
value = plainValue(source, _onError);
|
|
81207
81976
|
break;
|
|
81208
81977
|
case "single-quoted-scalar":
|
|
81209
|
-
_type =
|
|
81978
|
+
_type = Scalar2.Scalar.QUOTE_SINGLE;
|
|
81210
81979
|
value = singleQuotedValue(source, _onError);
|
|
81211
81980
|
break;
|
|
81212
81981
|
case "double-quoted-scalar":
|
|
81213
|
-
_type =
|
|
81982
|
+
_type = Scalar2.Scalar.QUOTE_DOUBLE;
|
|
81214
81983
|
value = doubleQuotedValue(source, _onError);
|
|
81215
81984
|
break;
|
|
81216
81985
|
default:
|
|
@@ -81407,8 +82176,8 @@ var require_resolve_flow_scalar3 = __commonJS4((exports) => {
|
|
|
81407
82176
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
81408
82177
|
});
|
|
81409
82178
|
var require_compose_scalar3 = __commonJS4((exports) => {
|
|
81410
|
-
var
|
|
81411
|
-
var
|
|
82179
|
+
var identity2 = require_identity4();
|
|
82180
|
+
var Scalar2 = require_Scalar3();
|
|
81412
82181
|
var resolveBlockScalar = require_resolve_block_scalar3();
|
|
81413
82182
|
var resolveFlowScalar = require_resolve_flow_scalar3();
|
|
81414
82183
|
function composeScalar(ctx, token, tagToken, onError) {
|
|
@@ -81416,21 +82185,21 @@ var require_compose_scalar3 = __commonJS4((exports) => {
|
|
|
81416
82185
|
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
|
|
81417
82186
|
let tag;
|
|
81418
82187
|
if (ctx.options.stringKeys && ctx.atKey) {
|
|
81419
|
-
tag = ctx.schema[
|
|
82188
|
+
tag = ctx.schema[identity2.SCALAR];
|
|
81420
82189
|
} else if (tagName)
|
|
81421
82190
|
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
81422
82191
|
else if (token.type === "scalar")
|
|
81423
82192
|
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
81424
82193
|
else
|
|
81425
|
-
tag = ctx.schema[
|
|
82194
|
+
tag = ctx.schema[identity2.SCALAR];
|
|
81426
82195
|
let scalar;
|
|
81427
82196
|
try {
|
|
81428
82197
|
const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
|
|
81429
|
-
scalar =
|
|
82198
|
+
scalar = identity2.isScalar(res) ? res : new Scalar2.Scalar(res);
|
|
81430
82199
|
} catch (error) {
|
|
81431
82200
|
const msg = error instanceof Error ? error.message : String(error);
|
|
81432
82201
|
onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg);
|
|
81433
|
-
scalar = new
|
|
82202
|
+
scalar = new Scalar2.Scalar(value);
|
|
81434
82203
|
}
|
|
81435
82204
|
scalar.range = range;
|
|
81436
82205
|
scalar.source = value;
|
|
@@ -81446,7 +82215,7 @@ var require_compose_scalar3 = __commonJS4((exports) => {
|
|
|
81446
82215
|
}
|
|
81447
82216
|
function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
|
81448
82217
|
if (tagName === "!")
|
|
81449
|
-
return schema[
|
|
82218
|
+
return schema[identity2.SCALAR];
|
|
81450
82219
|
const matchWithTest = [];
|
|
81451
82220
|
for (const tag of schema.tags) {
|
|
81452
82221
|
if (!tag.collection && tag.tag === tagName) {
|
|
@@ -81465,12 +82234,12 @@ var require_compose_scalar3 = __commonJS4((exports) => {
|
|
|
81465
82234
|
return kt;
|
|
81466
82235
|
}
|
|
81467
82236
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
81468
|
-
return schema[
|
|
82237
|
+
return schema[identity2.SCALAR];
|
|
81469
82238
|
}
|
|
81470
82239
|
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
81471
|
-
const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[
|
|
82240
|
+
const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity2.SCALAR];
|
|
81472
82241
|
if (schema.compat) {
|
|
81473
|
-
const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[
|
|
82242
|
+
const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity2.SCALAR];
|
|
81474
82243
|
if (tag.tag !== compat.tag) {
|
|
81475
82244
|
const ts = directives.tagString(tag.tag);
|
|
81476
82245
|
const cs = directives.tagString(compat.tag);
|
|
@@ -81508,8 +82277,8 @@ var require_util_empty_scalar_position3 = __commonJS4((exports) => {
|
|
|
81508
82277
|
exports.emptyScalarPosition = emptyScalarPosition;
|
|
81509
82278
|
});
|
|
81510
82279
|
var require_compose_node3 = __commonJS4((exports) => {
|
|
81511
|
-
var
|
|
81512
|
-
var
|
|
82280
|
+
var Alias2 = require_Alias3();
|
|
82281
|
+
var identity2 = require_identity4();
|
|
81513
82282
|
var composeCollection = require_compose_collection3();
|
|
81514
82283
|
var composeScalar = require_compose_scalar3();
|
|
81515
82284
|
var resolveEnd = require_resolve_end3();
|
|
@@ -81550,7 +82319,7 @@ var require_compose_node3 = __commonJS4((exports) => {
|
|
|
81550
82319
|
}
|
|
81551
82320
|
if (anchor && node.anchor === "")
|
|
81552
82321
|
onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
81553
|
-
if (atKey && ctx.options.stringKeys && (!
|
|
82322
|
+
if (atKey && ctx.options.stringKeys && (!identity2.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
|
|
81554
82323
|
const msg = "With stringKeys, all keys must be strings";
|
|
81555
82324
|
onError(tag ?? token, "NON_STRING_KEY", msg);
|
|
81556
82325
|
}
|
|
@@ -81588,7 +82357,7 @@ var require_compose_node3 = __commonJS4((exports) => {
|
|
|
81588
82357
|
return node;
|
|
81589
82358
|
}
|
|
81590
82359
|
function composeAlias({ options }, { offset, source, end }, onError) {
|
|
81591
|
-
const alias = new
|
|
82360
|
+
const alias = new Alias2.Alias(source.substring(1));
|
|
81592
82361
|
if (alias.source === "")
|
|
81593
82362
|
onError(offset, "BAD_ALIAS", "Alias cannot be an empty string");
|
|
81594
82363
|
if (alias.source.endsWith(":"))
|
|
@@ -81604,13 +82373,13 @@ var require_compose_node3 = __commonJS4((exports) => {
|
|
|
81604
82373
|
exports.composeNode = composeNode;
|
|
81605
82374
|
});
|
|
81606
82375
|
var require_compose_doc3 = __commonJS4((exports) => {
|
|
81607
|
-
var
|
|
82376
|
+
var Document2 = require_Document3();
|
|
81608
82377
|
var composeNode = require_compose_node3();
|
|
81609
82378
|
var resolveEnd = require_resolve_end3();
|
|
81610
82379
|
var resolveProps = require_resolve_props3();
|
|
81611
82380
|
function composeDoc(options, directives, { offset, start, value, end }, onError) {
|
|
81612
82381
|
const opts = Object.assign({ _directives: directives }, options);
|
|
81613
|
-
const doc = new
|
|
82382
|
+
const doc = new Document2.Document(undefined, opts);
|
|
81614
82383
|
const ctx = {
|
|
81615
82384
|
atKey: false,
|
|
81616
82385
|
atRoot: true,
|
|
@@ -81644,9 +82413,9 @@ var require_compose_doc3 = __commonJS4((exports) => {
|
|
|
81644
82413
|
var require_composer3 = __commonJS4((exports) => {
|
|
81645
82414
|
var node_process = __require4("process");
|
|
81646
82415
|
var directives = require_directives3();
|
|
81647
|
-
var
|
|
82416
|
+
var Document2 = require_Document3();
|
|
81648
82417
|
var errors3 = require_errors4();
|
|
81649
|
-
var
|
|
82418
|
+
var identity2 = require_identity4();
|
|
81650
82419
|
var composeDoc = require_compose_doc3();
|
|
81651
82420
|
var resolveEnd = require_resolve_end3();
|
|
81652
82421
|
function getErrorPos(src2) {
|
|
@@ -81712,9 +82481,9 @@ var require_composer3 = __commonJS4((exports) => {
|
|
|
81712
82481
|
${comment}` : comment;
|
|
81713
82482
|
} else if (afterEmptyLine || doc.directives.docStart || !dc) {
|
|
81714
82483
|
doc.commentBefore = comment;
|
|
81715
|
-
} else if (
|
|
82484
|
+
} else if (identity2.isCollection(dc) && !dc.flow && dc.items.length > 0) {
|
|
81716
82485
|
let it = dc.items[0];
|
|
81717
|
-
if (
|
|
82486
|
+
if (identity2.isPair(it))
|
|
81718
82487
|
it = it.key;
|
|
81719
82488
|
const cb = it.commentBefore;
|
|
81720
82489
|
it.commentBefore = cb ? `${comment}
|
|
@@ -81817,7 +82586,7 @@ ${end.comment}` : end.comment;
|
|
|
81817
82586
|
this.doc = null;
|
|
81818
82587
|
} else if (forceDoc) {
|
|
81819
82588
|
const opts = Object.assign({ _directives: this.directives }, this.options);
|
|
81820
|
-
const doc = new
|
|
82589
|
+
const doc = new Document2.Document(undefined, opts);
|
|
81821
82590
|
if (this.atDirectives)
|
|
81822
82591
|
this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line");
|
|
81823
82592
|
doc.range = [0, endOffset, endOffset];
|
|
@@ -82017,7 +82786,7 @@ var require_cst_scalar3 = __commonJS4((exports) => {
|
|
|
82017
82786
|
exports.setScalarValue = setScalarValue;
|
|
82018
82787
|
});
|
|
82019
82788
|
var require_cst_stringify3 = __commonJS4((exports) => {
|
|
82020
|
-
var stringify = (
|
|
82789
|
+
var stringify = (cst2) => ("type" in cst2) ? stringifyToken(cst2) : stringifyItem(cst2);
|
|
82021
82790
|
function stringifyToken(token) {
|
|
82022
82791
|
switch (token.type) {
|
|
82023
82792
|
case "block-scalar": {
|
|
@@ -82076,16 +82845,16 @@ var require_cst_visit3 = __commonJS4((exports) => {
|
|
|
82076
82845
|
var BREAK = Symbol("break visit");
|
|
82077
82846
|
var SKIP = Symbol("skip children");
|
|
82078
82847
|
var REMOVE = Symbol("remove item");
|
|
82079
|
-
function
|
|
82080
|
-
if ("type" in
|
|
82081
|
-
|
|
82082
|
-
_visit(Object.freeze([]),
|
|
82083
|
-
}
|
|
82084
|
-
|
|
82085
|
-
|
|
82086
|
-
|
|
82087
|
-
|
|
82088
|
-
let item =
|
|
82848
|
+
function visit2(cst2, visitor) {
|
|
82849
|
+
if ("type" in cst2 && cst2.type === "document")
|
|
82850
|
+
cst2 = { start: cst2.start, value: cst2.value };
|
|
82851
|
+
_visit(Object.freeze([]), cst2, visitor);
|
|
82852
|
+
}
|
|
82853
|
+
visit2.BREAK = BREAK;
|
|
82854
|
+
visit2.SKIP = SKIP;
|
|
82855
|
+
visit2.REMOVE = REMOVE;
|
|
82856
|
+
visit2.itemAtPath = (cst2, path3) => {
|
|
82857
|
+
let item = cst2;
|
|
82089
82858
|
for (const [field, index] of path3) {
|
|
82090
82859
|
const tok = item?.[field];
|
|
82091
82860
|
if (tok && "items" in tok) {
|
|
@@ -82095,8 +82864,8 @@ var require_cst_visit3 = __commonJS4((exports) => {
|
|
|
82095
82864
|
}
|
|
82096
82865
|
return item;
|
|
82097
82866
|
};
|
|
82098
|
-
|
|
82099
|
-
const parent =
|
|
82867
|
+
visit2.parentCollection = (cst2, path3) => {
|
|
82868
|
+
const parent = visit2.itemAtPath(cst2, path3.slice(0, -1));
|
|
82100
82869
|
const field = path3[path3.length - 1][0];
|
|
82101
82870
|
const coll = parent?.[field];
|
|
82102
82871
|
if (coll && "items" in coll)
|
|
@@ -82127,7 +82896,7 @@ var require_cst_visit3 = __commonJS4((exports) => {
|
|
|
82127
82896
|
}
|
|
82128
82897
|
return typeof ctrl === "function" ? ctrl(item, path3) : ctrl;
|
|
82129
82898
|
}
|
|
82130
|
-
exports.visit =
|
|
82899
|
+
exports.visit = visit2;
|
|
82131
82900
|
});
|
|
82132
82901
|
var require_cst3 = __commonJS4((exports) => {
|
|
82133
82902
|
var cstScalar = require_cst_scalar3();
|
|
@@ -82229,7 +82998,7 @@ var require_cst3 = __commonJS4((exports) => {
|
|
|
82229
82998
|
exports.tokenType = tokenType;
|
|
82230
82999
|
});
|
|
82231
83000
|
var require_lexer3 = __commonJS4((exports) => {
|
|
82232
|
-
var
|
|
83001
|
+
var cst2 = require_cst3();
|
|
82233
83002
|
function isEmpty(ch) {
|
|
82234
83003
|
switch (ch) {
|
|
82235
83004
|
case undefined:
|
|
@@ -82364,7 +83133,7 @@ var require_lexer3 = __commonJS4((exports) => {
|
|
|
82364
83133
|
let line = this.getLine();
|
|
82365
83134
|
if (line === null)
|
|
82366
83135
|
return this.setNext("stream");
|
|
82367
|
-
if (line[0] ===
|
|
83136
|
+
if (line[0] === cst2.BOM) {
|
|
82368
83137
|
yield* this.pushCount(1);
|
|
82369
83138
|
line = line.substring(1);
|
|
82370
83139
|
}
|
|
@@ -82398,7 +83167,7 @@ var require_lexer3 = __commonJS4((exports) => {
|
|
|
82398
83167
|
yield* this.pushNewline();
|
|
82399
83168
|
return "stream";
|
|
82400
83169
|
}
|
|
82401
|
-
yield
|
|
83170
|
+
yield cst2.DOCUMENT;
|
|
82402
83171
|
return yield* this.parseLineStart();
|
|
82403
83172
|
}
|
|
82404
83173
|
*parseLineStart() {
|
|
@@ -82492,7 +83261,7 @@ var require_lexer3 = __commonJS4((exports) => {
|
|
|
82492
83261
|
const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}");
|
|
82493
83262
|
if (!atFlowEndMarker) {
|
|
82494
83263
|
this.flowLevel = 0;
|
|
82495
|
-
yield
|
|
83264
|
+
yield cst2.FLOW_END;
|
|
82496
83265
|
return yield* this.parseLineStart();
|
|
82497
83266
|
}
|
|
82498
83267
|
}
|
|
@@ -82669,7 +83438,7 @@ var require_lexer3 = __commonJS4((exports) => {
|
|
|
82669
83438
|
break;
|
|
82670
83439
|
} while (true);
|
|
82671
83440
|
}
|
|
82672
|
-
yield
|
|
83441
|
+
yield cst2.SCALAR;
|
|
82673
83442
|
yield* this.pushToIndex(nl + 1, true);
|
|
82674
83443
|
return yield* this.parseLineStart();
|
|
82675
83444
|
}
|
|
@@ -82713,7 +83482,7 @@ var require_lexer3 = __commonJS4((exports) => {
|
|
|
82713
83482
|
}
|
|
82714
83483
|
if (!ch && !this.atEnd)
|
|
82715
83484
|
return this.setNext("plain-scalar");
|
|
82716
|
-
yield
|
|
83485
|
+
yield cst2.SCALAR;
|
|
82717
83486
|
yield* this.pushToIndex(end + 1, true);
|
|
82718
83487
|
return inFlow ? "flow" : "doc";
|
|
82719
83488
|
}
|
|
@@ -82841,8 +83610,8 @@ var require_line_counter3 = __commonJS4((exports) => {
|
|
|
82841
83610
|
});
|
|
82842
83611
|
var require_parser4 = __commonJS4((exports) => {
|
|
82843
83612
|
var node_process = __require4("process");
|
|
82844
|
-
var
|
|
82845
|
-
var
|
|
83613
|
+
var cst2 = require_cst3();
|
|
83614
|
+
var lexer2 = require_lexer3();
|
|
82846
83615
|
function includesToken(list, type) {
|
|
82847
83616
|
for (let i2 = 0;i2 < list.length; ++i2)
|
|
82848
83617
|
if (list[i2].type === type)
|
|
@@ -82936,7 +83705,7 @@ var require_parser4 = __commonJS4((exports) => {
|
|
|
82936
83705
|
this.stack = [];
|
|
82937
83706
|
this.source = "";
|
|
82938
83707
|
this.type = "";
|
|
82939
|
-
this.lexer = new
|
|
83708
|
+
this.lexer = new lexer2.Lexer;
|
|
82940
83709
|
this.onNewLine = onNewLine;
|
|
82941
83710
|
}
|
|
82942
83711
|
*parse(source, incomplete = false) {
|
|
@@ -82950,14 +83719,14 @@ var require_parser4 = __commonJS4((exports) => {
|
|
|
82950
83719
|
*next(source) {
|
|
82951
83720
|
this.source = source;
|
|
82952
83721
|
if (node_process.env.LOG_TOKENS)
|
|
82953
|
-
console.log("|",
|
|
83722
|
+
console.log("|", cst2.prettyToken(source));
|
|
82954
83723
|
if (this.atScalar) {
|
|
82955
83724
|
this.atScalar = false;
|
|
82956
83725
|
yield* this.step();
|
|
82957
83726
|
this.offset += source.length;
|
|
82958
83727
|
return;
|
|
82959
83728
|
}
|
|
82960
|
-
const type =
|
|
83729
|
+
const type = cst2.tokenType(source);
|
|
82961
83730
|
if (!type) {
|
|
82962
83731
|
const message = `Not a YAML token: ${source}`;
|
|
82963
83732
|
yield* this.pop({ type: "error", offset: this.offset, message, source });
|
|
@@ -83687,22 +84456,22 @@ var require_parser4 = __commonJS4((exports) => {
|
|
|
83687
84456
|
exports.Parser = Parser;
|
|
83688
84457
|
});
|
|
83689
84458
|
var require_public_api3 = __commonJS4((exports) => {
|
|
83690
|
-
var
|
|
83691
|
-
var
|
|
84459
|
+
var composer2 = require_composer3();
|
|
84460
|
+
var Document2 = require_Document3();
|
|
83692
84461
|
var errors3 = require_errors4();
|
|
83693
84462
|
var log = require_log4();
|
|
83694
|
-
var
|
|
83695
|
-
var
|
|
83696
|
-
var
|
|
84463
|
+
var identity2 = require_identity4();
|
|
84464
|
+
var lineCounter2 = require_line_counter3();
|
|
84465
|
+
var parser2 = require_parser4();
|
|
83697
84466
|
function parseOptions(options) {
|
|
83698
84467
|
const prettyErrors = options.prettyErrors !== false;
|
|
83699
|
-
const lineCounter$1 = options.lineCounter || prettyErrors && new
|
|
84468
|
+
const lineCounter$1 = options.lineCounter || prettyErrors && new lineCounter2.LineCounter || null;
|
|
83700
84469
|
return { lineCounter: lineCounter$1, prettyErrors };
|
|
83701
84470
|
}
|
|
83702
84471
|
function parseAllDocuments(source, options = {}) {
|
|
83703
84472
|
const { lineCounter: lineCounter22, prettyErrors } = parseOptions(options);
|
|
83704
|
-
const parser$1 = new
|
|
83705
|
-
const composer$1 = new
|
|
84473
|
+
const parser$1 = new parser2.Parser(lineCounter22?.addNewLine);
|
|
84474
|
+
const composer$1 = new composer2.Composer(options);
|
|
83706
84475
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
|
83707
84476
|
if (prettyErrors && lineCounter22)
|
|
83708
84477
|
for (const doc of docs) {
|
|
@@ -83715,8 +84484,8 @@ var require_public_api3 = __commonJS4((exports) => {
|
|
|
83715
84484
|
}
|
|
83716
84485
|
function parseDocument(source, options = {}) {
|
|
83717
84486
|
const { lineCounter: lineCounter22, prettyErrors } = parseOptions(options);
|
|
83718
|
-
const parser$1 = new
|
|
83719
|
-
const composer$1 = new
|
|
84487
|
+
const parser$1 = new parser2.Parser(lineCounter22?.addNewLine);
|
|
84488
|
+
const composer$1 = new composer2.Composer(options);
|
|
83720
84489
|
let doc = null;
|
|
83721
84490
|
for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
|
|
83722
84491
|
if (!doc)
|
|
@@ -83769,61 +84538,61 @@ var require_public_api3 = __commonJS4((exports) => {
|
|
|
83769
84538
|
if (!keepUndefined)
|
|
83770
84539
|
return;
|
|
83771
84540
|
}
|
|
83772
|
-
if (
|
|
84541
|
+
if (identity2.isDocument(value) && !_replacer)
|
|
83773
84542
|
return value.toString(options);
|
|
83774
|
-
return new
|
|
84543
|
+
return new Document2.Document(value, _replacer, options).toString(options);
|
|
83775
84544
|
}
|
|
83776
84545
|
exports.parse = parse;
|
|
83777
84546
|
exports.parseAllDocuments = parseAllDocuments;
|
|
83778
84547
|
exports.parseDocument = parseDocument;
|
|
83779
84548
|
exports.stringify = stringify;
|
|
83780
84549
|
});
|
|
83781
|
-
var
|
|
83782
|
-
var
|
|
83783
|
-
var
|
|
83784
|
-
var
|
|
84550
|
+
var require_dist2 = __commonJS4((exports) => {
|
|
84551
|
+
var composer2 = require_composer3();
|
|
84552
|
+
var Document2 = require_Document3();
|
|
84553
|
+
var Schema2 = require_Schema3();
|
|
83785
84554
|
var errors3 = require_errors4();
|
|
83786
|
-
var
|
|
83787
|
-
var
|
|
83788
|
-
var
|
|
83789
|
-
var
|
|
83790
|
-
var
|
|
83791
|
-
var
|
|
83792
|
-
var
|
|
83793
|
-
var
|
|
83794
|
-
var
|
|
83795
|
-
var
|
|
83796
|
-
var
|
|
83797
|
-
var
|
|
83798
|
-
exports.Composer =
|
|
83799
|
-
exports.Document =
|
|
83800
|
-
exports.Schema =
|
|
84555
|
+
var Alias2 = require_Alias3();
|
|
84556
|
+
var identity2 = require_identity4();
|
|
84557
|
+
var Pair2 = require_Pair3();
|
|
84558
|
+
var Scalar2 = require_Scalar3();
|
|
84559
|
+
var YAMLMap2 = require_YAMLMap3();
|
|
84560
|
+
var YAMLSeq2 = require_YAMLSeq3();
|
|
84561
|
+
var cst2 = require_cst3();
|
|
84562
|
+
var lexer2 = require_lexer3();
|
|
84563
|
+
var lineCounter2 = require_line_counter3();
|
|
84564
|
+
var parser2 = require_parser4();
|
|
84565
|
+
var publicApi2 = require_public_api3();
|
|
84566
|
+
var visit2 = require_visit3();
|
|
84567
|
+
exports.Composer = composer2.Composer;
|
|
84568
|
+
exports.Document = Document2.Document;
|
|
84569
|
+
exports.Schema = Schema2.Schema;
|
|
83801
84570
|
exports.YAMLError = errors3.YAMLError;
|
|
83802
84571
|
exports.YAMLParseError = errors3.YAMLParseError;
|
|
83803
84572
|
exports.YAMLWarning = errors3.YAMLWarning;
|
|
83804
|
-
exports.Alias =
|
|
83805
|
-
exports.isAlias =
|
|
83806
|
-
exports.isCollection =
|
|
83807
|
-
exports.isDocument =
|
|
83808
|
-
exports.isMap =
|
|
83809
|
-
exports.isNode =
|
|
83810
|
-
exports.isPair =
|
|
83811
|
-
exports.isScalar =
|
|
83812
|
-
exports.isSeq =
|
|
83813
|
-
exports.Pair =
|
|
83814
|
-
exports.Scalar =
|
|
83815
|
-
exports.YAMLMap =
|
|
83816
|
-
exports.YAMLSeq =
|
|
83817
|
-
exports.CST =
|
|
83818
|
-
exports.Lexer =
|
|
83819
|
-
exports.LineCounter =
|
|
83820
|
-
exports.Parser =
|
|
83821
|
-
exports.parse =
|
|
83822
|
-
exports.parseAllDocuments =
|
|
83823
|
-
exports.parseDocument =
|
|
83824
|
-
exports.stringify =
|
|
83825
|
-
exports.visit =
|
|
83826
|
-
exports.visitAsync =
|
|
84573
|
+
exports.Alias = Alias2.Alias;
|
|
84574
|
+
exports.isAlias = identity2.isAlias;
|
|
84575
|
+
exports.isCollection = identity2.isCollection;
|
|
84576
|
+
exports.isDocument = identity2.isDocument;
|
|
84577
|
+
exports.isMap = identity2.isMap;
|
|
84578
|
+
exports.isNode = identity2.isNode;
|
|
84579
|
+
exports.isPair = identity2.isPair;
|
|
84580
|
+
exports.isScalar = identity2.isScalar;
|
|
84581
|
+
exports.isSeq = identity2.isSeq;
|
|
84582
|
+
exports.Pair = Pair2.Pair;
|
|
84583
|
+
exports.Scalar = Scalar2.Scalar;
|
|
84584
|
+
exports.YAMLMap = YAMLMap2.YAMLMap;
|
|
84585
|
+
exports.YAMLSeq = YAMLSeq2.YAMLSeq;
|
|
84586
|
+
exports.CST = cst2;
|
|
84587
|
+
exports.Lexer = lexer2.Lexer;
|
|
84588
|
+
exports.LineCounter = lineCounter2.LineCounter;
|
|
84589
|
+
exports.Parser = parser2.Parser;
|
|
84590
|
+
exports.parse = publicApi2.parse;
|
|
84591
|
+
exports.parseAllDocuments = publicApi2.parseAllDocuments;
|
|
84592
|
+
exports.parseDocument = publicApi2.parseDocument;
|
|
84593
|
+
exports.stringify = publicApi2.stringify;
|
|
84594
|
+
exports.visit = visit2.visit;
|
|
84595
|
+
exports.visitAsync = visit2.visitAsync;
|
|
83827
84596
|
});
|
|
83828
84597
|
var CVSS_WEIGHTS = {
|
|
83829
84598
|
attackVector: { network: 0.85, local: 0.55 },
|
|
@@ -84750,7 +85519,7 @@ class UnsafeResponseDetector {
|
|
|
84750
85519
|
return CvssCalculator.describe(cvssScore);
|
|
84751
85520
|
}
|
|
84752
85521
|
}
|
|
84753
|
-
var
|
|
85522
|
+
var import_yaml3 = __toESM4(require_dist2(), 1);
|
|
84754
85523
|
|
|
84755
85524
|
class CustomMutation {
|
|
84756
85525
|
name;
|
|
@@ -84784,7 +85553,7 @@ function loadCustomAttacks(filePath) {
|
|
|
84784
85553
|
throw new Error(`Custom attacks file not found: ${absolutePath}`);
|
|
84785
85554
|
}
|
|
84786
85555
|
const content = fs.readFileSync(absolutePath, "utf-8");
|
|
84787
|
-
const parsed =
|
|
85556
|
+
const parsed = import_yaml3.default.parse(content);
|
|
84788
85557
|
if (!parsed.version) {
|
|
84789
85558
|
throw new Error("Custom attacks file must specify a version");
|
|
84790
85559
|
}
|
|
@@ -85177,7 +85946,7 @@ function resolveModelWithSource(cliModel, scenarioModel, configModel) {
|
|
|
85177
85946
|
// src/commands/redteam.ts
|
|
85178
85947
|
function redteamCommand() {
|
|
85179
85948
|
const cmd = new Command("redteam");
|
|
85180
|
-
cmd.description("Run red-team adversarial tests against an LLM").argument("<scenario>", "Path to scenario YAML file").option("-p, --provider <provider>", "Provider to use").option("-m, --model <model>", "Model to use").option("--mutations <mutations...>", "Mutations to apply (typo, role-spoof, instruction-flip, cot-injection, encoding, multi-turn)").option("-c, --count <number>", "Number of mutated prompts per case", "5").option("--custom-attacks <path>", "Path to custom attacks YAML file").option("--save", "Save results to storage").option("-o, --output <dir>", "Output directory for reports").option("-v, --verbose", "Verbose output").option("--config <path>", "Path to config file").option("--redact", "Enable PII/sensitive data redaction in results").option("--redact-patterns <patterns...>", "Custom redaction patterns (regex or built-in: email, phone, credit_card, ssn, api_key)").action(async (scenarioPath, options) => {
|
|
85949
|
+
cmd.description("Run red-team adversarial tests against an LLM").argument("<scenario>", "Path to scenario YAML file").option("-p, --provider <provider>", "Provider to use").option("-m, --model <model>", "Model to use").option("--mutations <mutations...>", "Mutations to apply (typo, role-spoof, instruction-flip, cot-injection, encoding, multi-turn)").option("-c, --count <number>", "Number of mutated prompts per case", "5").option("--custom-attacks <path>", "Path to custom attacks YAML file").option("--save", "Save results to storage").option("-o, --output <dir>", "Output directory for reports").option("-v, --verbose", "Verbose output").option("--config <path>", "Path to config file").option("--redact", "Enable PII/sensitive data redaction in results").option("--redact-patterns <patterns...>", "Custom redaction patterns (regex or built-in: email, phone, credit_card, ssn, api_key)").option("--export <format>", "Export results to format (markdown or junit)").option("--export-output <dir>", "Output directory for exports (default: ./artemis-exports)").action(async (scenarioPath, options) => {
|
|
85181
85950
|
const spinner = createSpinner("Loading configuration...");
|
|
85182
85951
|
spinner.start();
|
|
85183
85952
|
const startTime = new Date;
|
|
@@ -85478,6 +86247,21 @@ function redteamCommand() {
|
|
|
85478
86247
|
console.log(source_default.dim(` HTML: ${htmlPath}`));
|
|
85479
86248
|
console.log(source_default.dim(` JSON: ${jsonPath}`));
|
|
85480
86249
|
}
|
|
86250
|
+
if (options.export) {
|
|
86251
|
+
const exportDir = options.exportOutput || "./artemis-exports";
|
|
86252
|
+
await mkdir3(exportDir, { recursive: true });
|
|
86253
|
+
if (options.export === "markdown") {
|
|
86254
|
+
const markdown = generateRedTeamMarkdownReport(manifest);
|
|
86255
|
+
const mdPath = join4(exportDir, `${runId}.md`);
|
|
86256
|
+
await writeFile3(mdPath, markdown);
|
|
86257
|
+
console.log(source_default.dim(`Exported: ${mdPath}`));
|
|
86258
|
+
} else if (options.export === "junit") {
|
|
86259
|
+
const junit = generateRedTeamJUnitReport(manifest);
|
|
86260
|
+
const junitPath = join4(exportDir, `${runId}.xml`);
|
|
86261
|
+
await writeFile3(junitPath, junit);
|
|
86262
|
+
console.log(source_default.dim(`Exported: ${junitPath}`));
|
|
86263
|
+
}
|
|
86264
|
+
}
|
|
85481
86265
|
if (metrics.unsafe_responses > 0) {
|
|
85482
86266
|
process.exit(1);
|
|
85483
86267
|
}
|
|
@@ -85652,8 +86436,10 @@ function reportCommand() {
|
|
|
85652
86436
|
|
|
85653
86437
|
// src/commands/run.ts
|
|
85654
86438
|
init_dist();
|
|
85655
|
-
|
|
86439
|
+
import { mkdir as mkdir5, writeFile as writeFile5 } from "fs/promises";
|
|
85656
86440
|
import { basename as basename2 } from "path";
|
|
86441
|
+
import { join as join6 } from "path";
|
|
86442
|
+
init_source();
|
|
85657
86443
|
init_ui();
|
|
85658
86444
|
function isBaselineStorage2(storage) {
|
|
85659
86445
|
return typeof storage === "object" && storage !== null && "setBaseline" in storage && "getBaseline" in storage && "listBaselines" in storage && "compareToBaseline" in storage;
|
|
@@ -85666,6 +86452,10 @@ function buildCISummary(results) {
|
|
|
85666
86452
|
const passedCases = results.reduce((sum, r3) => sum + (r3.manifest.metrics?.passed_cases || 0), 0);
|
|
85667
86453
|
const failedCases = results.reduce((sum, r3) => sum + (r3.manifest.metrics?.failed_cases || 0), 0);
|
|
85668
86454
|
const totalDuration = results.reduce((sum, r3) => sum + (r3.manifest.duration_ms || 0), 0);
|
|
86455
|
+
const totalPromptTokens = results.reduce((sum, r3) => sum + (r3.manifest.metrics?.total_prompt_tokens || 0), 0);
|
|
86456
|
+
const totalCompletionTokens = results.reduce((sum, r3) => sum + (r3.manifest.metrics?.total_completion_tokens || 0), 0);
|
|
86457
|
+
const totalTokens = results.reduce((sum, r3) => sum + (r3.manifest.metrics?.total_tokens || 0), 0);
|
|
86458
|
+
const totalCostUsd = results.reduce((sum, r3) => sum + (r3.manifest.metrics?.cost?.total_usd || 0), 0);
|
|
85669
86459
|
return {
|
|
85670
86460
|
success: failedScenarios === 0,
|
|
85671
86461
|
scenarios: {
|
|
@@ -85683,6 +86473,15 @@ function buildCISummary(results) {
|
|
|
85683
86473
|
totalMs: totalDuration,
|
|
85684
86474
|
formatted: formatDuration(totalDuration)
|
|
85685
86475
|
},
|
|
86476
|
+
tokens: {
|
|
86477
|
+
prompt: totalPromptTokens,
|
|
86478
|
+
completion: totalCompletionTokens,
|
|
86479
|
+
total: totalTokens
|
|
86480
|
+
},
|
|
86481
|
+
cost: {
|
|
86482
|
+
estimatedUsd: totalCostUsd,
|
|
86483
|
+
formatted: formatCost(totalCostUsd)
|
|
86484
|
+
},
|
|
85686
86485
|
runs: results.map((r3) => ({
|
|
85687
86486
|
runId: r3.manifest.run_id || "",
|
|
85688
86487
|
scenario: r3.scenarioName,
|
|
@@ -85691,7 +86490,8 @@ function buildCISummary(results) {
|
|
|
85691
86490
|
passedCases: r3.manifest.metrics?.passed_cases || 0,
|
|
85692
86491
|
failedCases: r3.manifest.metrics?.failed_cases || 0,
|
|
85693
86492
|
totalCases: r3.manifest.metrics?.total_cases || 0,
|
|
85694
|
-
durationMs: r3.manifest.duration_ms || 0
|
|
86493
|
+
durationMs: r3.manifest.duration_ms || 0,
|
|
86494
|
+
estimatedCostUsd: r3.manifest.metrics?.cost?.total_usd
|
|
85695
86495
|
}))
|
|
85696
86496
|
};
|
|
85697
86497
|
}
|
|
@@ -85909,7 +86709,7 @@ async function runScenariosInParallel(scenarioPaths, options, config, parallelLi
|
|
|
85909
86709
|
}
|
|
85910
86710
|
function runCommand() {
|
|
85911
86711
|
const cmd = new Command("run");
|
|
85912
|
-
cmd.description("Run test scenarios against an LLM. Accepts a file path, directory, or glob pattern.").argument("[scenario]", "Path to scenario file, directory, or glob pattern (e.g., scenarios/**/*.yaml)").option("-p, --provider <provider>", "Provider to use (openai, azure-openai, vercel-ai)").option("-m, --model <model>", "Model to use").option("-o, --output <dir>", "Output directory for results").option("-v, --verbose", "Verbose output").option("-t, --tags <tags...>", "Filter test cases by tags").option("--save", "Save results to storage", true).option("-c, --concurrency <number>", "Number of concurrent test cases per scenario", "1").option("--parallel <number>", "Number of scenarios to run in parallel (default: sequential)").option("--timeout <ms>", "Timeout per test case in milliseconds").option("--retries <number>", "Number of retries per test case").option("--config <path>", "Path to config file").option("--redact", "Enable PII/sensitive data redaction in results").option("--redact-patterns <patterns...>", "Custom redaction patterns (regex or built-in: email, phone, credit_card, ssn, api_key)").option("-i, --interactive", "Enable interactive mode for scenario/provider selection").option("--ci", "CI mode: machine-readable output, no colors/spinners, JSON summary").option("--summary <format>", "Summary output format: json, text, or security (implies --ci for json/security)", "text").option("--baseline", "Compare against baseline and detect regression").option("--threshold <number>", "Regression threshold (0-1), e.g., 0.05 for 5%", "0.05").action(async (scenarioPath, options) => {
|
|
86712
|
+
cmd.description("Run test scenarios against an LLM. Accepts a file path, directory, or glob pattern.").argument("[scenario]", "Path to scenario file, directory, or glob pattern (e.g., scenarios/**/*.yaml)").option("-p, --provider <provider>", "Provider to use (openai, azure-openai, vercel-ai)").option("-m, --model <model>", "Model to use").option("-o, --output <dir>", "Output directory for results").option("-v, --verbose", "Verbose output").option("-t, --tags <tags...>", "Filter test cases by tags").option("--save", "Save results to storage", true).option("-c, --concurrency <number>", "Number of concurrent test cases per scenario", "1").option("--parallel <number>", "Number of scenarios to run in parallel (default: sequential)").option("--timeout <ms>", "Timeout per test case in milliseconds").option("--retries <number>", "Number of retries per test case").option("--config <path>", "Path to config file").option("--redact", "Enable PII/sensitive data redaction in results").option("--redact-patterns <patterns...>", "Custom redaction patterns (regex or built-in: email, phone, credit_card, ssn, api_key)").option("-i, --interactive", "Enable interactive mode for scenario/provider selection").option("--ci", "CI mode: machine-readable output, no colors/spinners, JSON summary").option("--summary <format>", "Summary output format: json, text, or security (implies --ci for json/security)", "text").option("--baseline", "Compare against baseline and detect regression").option("--threshold <number>", "Regression threshold (0-1), e.g., 0.05 for 5%", "0.05").option("--budget <amount>", "Maximum budget in USD - fail if estimated cost exceeds this").option("--export <format>", "Export format: markdown or junit (for CI integration)").option("--export-output <dir>", "Output directory for exports (default: ./artemis-exports)").action(async (scenarioPath, options) => {
|
|
85913
86713
|
const isCIMode = options.ci || process.env.CI === "true" || options.summary === "json" || options.summary === "security";
|
|
85914
86714
|
const spinner = isCIMode ? {
|
|
85915
86715
|
start: () => {},
|
|
@@ -86032,7 +86832,8 @@ No scenarios selected. Exiting.`));
|
|
|
86032
86832
|
console.log();
|
|
86033
86833
|
console.log(renderSummaryPanel(summaryData));
|
|
86034
86834
|
console.log();
|
|
86035
|
-
|
|
86835
|
+
const costInfo = result.manifest.metrics.cost ? ` | Est. Cost: ${formatCost(result.manifest.metrics.cost.total_usd)}` : "";
|
|
86836
|
+
console.log(source_default.dim(`Run ID: ${result.manifest.run_id} | Median Latency: ${result.manifest.metrics.median_latency_ms}ms | Tokens: ${result.manifest.metrics.total_tokens.toLocaleString()}${costInfo}`));
|
|
86036
86837
|
if (result.manifest.redaction?.enabled) {
|
|
86037
86838
|
const r3 = result.manifest.redaction;
|
|
86038
86839
|
console.log(source_default.dim(`Redactions: ${r3.summary.totalRedactions} (${r3.summary.promptsRedacted} prompts, ${r3.summary.responsesRedacted} responses)`));
|
|
@@ -86041,6 +86842,21 @@ No scenarios selected. Exiting.`));
|
|
|
86041
86842
|
const savedPath = await storage.save(result.manifest);
|
|
86042
86843
|
console.log(source_default.dim(`Saved: ${savedPath}`));
|
|
86043
86844
|
}
|
|
86845
|
+
if (options.export) {
|
|
86846
|
+
const exportDir = options.exportOutput || "./artemis-exports";
|
|
86847
|
+
await mkdir5(exportDir, { recursive: true });
|
|
86848
|
+
if (options.export === "markdown") {
|
|
86849
|
+
const markdown = generateMarkdownReport(result.manifest);
|
|
86850
|
+
const mdPath = join6(exportDir, `${result.manifest.run_id}.md`);
|
|
86851
|
+
await writeFile5(mdPath, markdown);
|
|
86852
|
+
console.log(source_default.dim(`Exported: ${mdPath}`));
|
|
86853
|
+
} else if (options.export === "junit") {
|
|
86854
|
+
const junit = generateJUnitReport(result.manifest);
|
|
86855
|
+
const junitPath = join6(exportDir, `${result.manifest.run_id}.xml`);
|
|
86856
|
+
await writeFile5(junitPath, junit);
|
|
86857
|
+
console.log(source_default.dim(`Exported: ${junitPath}`));
|
|
86858
|
+
}
|
|
86859
|
+
}
|
|
86044
86860
|
} catch (error) {
|
|
86045
86861
|
console.log();
|
|
86046
86862
|
console.log(source_default.red(`${icons.failed} Failed to run: ${basename2(path3)}`));
|
|
@@ -86108,6 +86924,8 @@ No scenarios selected. Exiting.`));
|
|
|
86108
86924
|
console.log(`ARTEMISKIT_CASES_FAILED=${failedCases}`);
|
|
86109
86925
|
console.log(`ARTEMISKIT_SUCCESS_RATE=${successRate}`);
|
|
86110
86926
|
console.log(`ARTEMISKIT_DURATION_MS=${ciSummary.duration.totalMs}`);
|
|
86927
|
+
console.log(`ARTEMISKIT_TOKENS_TOTAL=${ciSummary.tokens.total}`);
|
|
86928
|
+
console.log(`ARTEMISKIT_COST_USD=${ciSummary.cost.estimatedUsd.toFixed(4)}`);
|
|
86111
86929
|
if (baselineResult) {
|
|
86112
86930
|
console.log("ARTEMISKIT_BASELINE_COMPARED=true");
|
|
86113
86931
|
console.log(`ARTEMISKIT_REGRESSION=${baselineResult.hasRegression ? "true" : "false"}`);
|
|
@@ -86156,9 +86974,37 @@ No scenarios selected. Exiting.`));
|
|
|
86156
86974
|
console.log(`${icons.passed} ${source_default.green("No regression detected")}`);
|
|
86157
86975
|
}
|
|
86158
86976
|
}
|
|
86977
|
+
let budgetExceeded = false;
|
|
86978
|
+
if (options.budget !== undefined) {
|
|
86979
|
+
const budgetLimit = Number.parseFloat(String(options.budget));
|
|
86980
|
+
const totalCost = ciSummary.cost.estimatedUsd;
|
|
86981
|
+
if (totalCost > budgetLimit) {
|
|
86982
|
+
budgetExceeded = true;
|
|
86983
|
+
const overBy = totalCost - budgetLimit;
|
|
86984
|
+
ciSummary.budget = {
|
|
86985
|
+
limit: budgetLimit,
|
|
86986
|
+
exceeded: true,
|
|
86987
|
+
overBy
|
|
86988
|
+
};
|
|
86989
|
+
if (isCIMode) {
|
|
86990
|
+
if (options.summary === "json") {} else {
|
|
86991
|
+
console.log(`ARTEMISKIT_BUDGET_LIMIT=${budgetLimit.toFixed(2)}`);
|
|
86992
|
+
console.log("ARTEMISKIT_BUDGET_EXCEEDED=true");
|
|
86993
|
+
console.log(`ARTEMISKIT_BUDGET_OVER_BY=${overBy.toFixed(4)}`);
|
|
86994
|
+
}
|
|
86995
|
+
} else {
|
|
86996
|
+
console.log();
|
|
86997
|
+
console.log(source_default.red(`${icons.failed} BUDGET EXCEEDED`));
|
|
86998
|
+
console.log(source_default.red(` Budget: $${budgetLimit.toFixed(2)} | Actual: ${formatCost(totalCost)} | Over by: ${formatCost(overBy)}`));
|
|
86999
|
+
console.log();
|
|
87000
|
+
}
|
|
87001
|
+
} else if (!isCIMode) {
|
|
87002
|
+
console.log(`${icons.passed} ${source_default.green("Within budget")} ${source_default.dim(`($${budgetLimit.toFixed(2)} limit, ${formatCost(totalCost)} used)`)}`);
|
|
87003
|
+
}
|
|
87004
|
+
}
|
|
86159
87005
|
const hasFailures = results.some((r3) => !r3.success);
|
|
86160
87006
|
const hasRegression = baselineResult?.hasRegression || false;
|
|
86161
|
-
if (hasFailures || hasRegression) {
|
|
87007
|
+
if (hasFailures || hasRegression || budgetExceeded) {
|
|
86162
87008
|
process.exit(1);
|
|
86163
87009
|
}
|
|
86164
87010
|
} catch (error) {
|
|
@@ -86179,13 +87025,13 @@ No scenarios selected. Exiting.`));
|
|
|
86179
87025
|
|
|
86180
87026
|
// src/commands/stress.ts
|
|
86181
87027
|
init_dist();
|
|
86182
|
-
import { mkdir as
|
|
86183
|
-
import { basename as basename3, join as
|
|
87028
|
+
import { mkdir as mkdir6, writeFile as writeFile6 } from "fs/promises";
|
|
87029
|
+
import { basename as basename3, join as join7 } from "path";
|
|
86184
87030
|
init_source();
|
|
86185
87031
|
init_ui();
|
|
86186
87032
|
function stressCommand() {
|
|
86187
87033
|
const cmd = new Command("stress");
|
|
86188
|
-
cmd.description("Run load/stress tests against an LLM").argument("<scenario>", "Path to scenario YAML file").option("-p, --provider <provider>", "Provider to use").option("-m, --model <model>", "Model to use").option("-c, --concurrency <number>", "Number of concurrent requests", "10").option("-n, --requests <number>", "Total number of requests to make").option("-d, --duration <seconds>", "Duration to run the test in seconds", "30").option("--ramp-up <seconds>", "Ramp-up time in seconds", "5").option("--save", "Save results to storage").option("-o, --output <dir>", "Output directory for reports").option("-v, --verbose", "Verbose output").option("--config <path>", "Path to config file").option("--redact", "Enable PII/sensitive data redaction in results").option("--redact-patterns <patterns...>", "Custom redaction patterns (regex or built-in: email, phone, credit_card, ssn, api_key)").action(async (scenarioPath, options) => {
|
|
87034
|
+
cmd.description("Run load/stress tests against an LLM").argument("<scenario>", "Path to scenario YAML file").option("-p, --provider <provider>", "Provider to use").option("-m, --model <model>", "Model to use").option("-c, --concurrency <number>", "Number of concurrent requests", "10").option("-n, --requests <number>", "Total number of requests to make").option("-d, --duration <seconds>", "Duration to run the test in seconds", "30").option("--ramp-up <seconds>", "Ramp-up time in seconds", "5").option("--save", "Save results to storage").option("-o, --output <dir>", "Output directory for reports").option("-v, --verbose", "Verbose output").option("--config <path>", "Path to config file").option("--redact", "Enable PII/sensitive data redaction in results").option("--redact-patterns <patterns...>", "Custom redaction patterns (regex or built-in: email, phone, credit_card, ssn, api_key)").option("--budget <amount>", "Maximum budget in USD - fail if estimated cost exceeds this").action(async (scenarioPath, options) => {
|
|
86189
87035
|
const spinner = createSpinner("Loading configuration...");
|
|
86190
87036
|
spinner.start();
|
|
86191
87037
|
const startTime = new Date;
|
|
@@ -86352,17 +87198,31 @@ function stressCommand() {
|
|
|
86352
87198
|
}
|
|
86353
87199
|
if (options.output) {
|
|
86354
87200
|
spinner.start("Generating reports...");
|
|
86355
|
-
await
|
|
87201
|
+
await mkdir6(options.output, { recursive: true });
|
|
86356
87202
|
const html = generateStressHTMLReport(manifest);
|
|
86357
|
-
const htmlPath =
|
|
86358
|
-
await
|
|
87203
|
+
const htmlPath = join7(options.output, `${runId}.html`);
|
|
87204
|
+
await writeFile6(htmlPath, html);
|
|
86359
87205
|
const json = generateJSONReport(manifest);
|
|
86360
|
-
const jsonPath =
|
|
86361
|
-
await
|
|
87206
|
+
const jsonPath = join7(options.output, `${runId}.json`);
|
|
87207
|
+
await writeFile6(jsonPath, json);
|
|
86362
87208
|
spinner.succeed(`Reports generated: ${options.output}`);
|
|
86363
87209
|
console.log(source_default.dim(` HTML: ${htmlPath}`));
|
|
86364
87210
|
console.log(source_default.dim(` JSON: ${jsonPath}`));
|
|
86365
87211
|
}
|
|
87212
|
+
if (options.budget !== undefined && metrics.cost) {
|
|
87213
|
+
const budgetLimit = Number.parseFloat(String(options.budget));
|
|
87214
|
+
const totalCost = metrics.cost.estimated_total_usd;
|
|
87215
|
+
if (totalCost > budgetLimit) {
|
|
87216
|
+
const overBy = totalCost - budgetLimit;
|
|
87217
|
+
console.log();
|
|
87218
|
+
console.log(source_default.red(`${icons.failed} BUDGET EXCEEDED`));
|
|
87219
|
+
console.log(source_default.red(` Budget: $${budgetLimit.toFixed(2)} | Actual: ${formatCost(totalCost)} | Over by: ${formatCost(overBy)}`));
|
|
87220
|
+
process.exit(1);
|
|
87221
|
+
} else {
|
|
87222
|
+
console.log();
|
|
87223
|
+
console.log(`${icons.passed} ${source_default.green("Within budget")} ${source_default.dim(`($${budgetLimit.toFixed(2)} limit, ${formatCost(totalCost)} used)`)}`);
|
|
87224
|
+
}
|
|
87225
|
+
}
|
|
86366
87226
|
} catch (error) {
|
|
86367
87227
|
spinner.fail("Error");
|
|
86368
87228
|
const provider = options.provider || "unknown";
|
|
@@ -86543,6 +87403,168 @@ function displayHistogram(results) {
|
|
|
86543
87403
|
}
|
|
86544
87404
|
}
|
|
86545
87405
|
|
|
87406
|
+
// src/commands/validate.ts
|
|
87407
|
+
init_dist();
|
|
87408
|
+
import { readdirSync, statSync } from "fs";
|
|
87409
|
+
import { mkdir as mkdir7, writeFile as writeFile7 } from "fs/promises";
|
|
87410
|
+
import { basename as basename4, join as join8, resolve as resolve5 } from "path";
|
|
87411
|
+
init_source();
|
|
87412
|
+
var {Glob } = globalThis.Bun;
|
|
87413
|
+
init_ui();
|
|
87414
|
+
function validateCommand() {
|
|
87415
|
+
const cmd = new Command("validate");
|
|
87416
|
+
cmd.description("Validate scenario files without running them").argument("<path>", "Path to scenario file, directory, or glob pattern").option("--json", "Output as JSON").option("--strict", "Treat warnings as errors").option("-q, --quiet", "Only output errors (no success messages)").option("--export <format>", "Export results to format (junit for CI integration)").option("--export-output <dir>", "Output directory for exports (default: ./artemis-exports)").action(async (pathArg, options) => {
|
|
87417
|
+
const validator = new ScenarioValidator({ strict: options.strict });
|
|
87418
|
+
const files = resolveFiles(pathArg);
|
|
87419
|
+
if (files.length === 0) {
|
|
87420
|
+
if (options.json) {
|
|
87421
|
+
console.log(JSON.stringify({
|
|
87422
|
+
valid: false,
|
|
87423
|
+
error: `No scenario files found matching: ${pathArg}`,
|
|
87424
|
+
results: [],
|
|
87425
|
+
summary: { total: 0, passed: 0, failed: 0, withWarnings: 0 }
|
|
87426
|
+
}, null, 2));
|
|
87427
|
+
} else {
|
|
87428
|
+
console.log(source_default.red(`${icons.failed} No scenario files found matching: ${pathArg}`));
|
|
87429
|
+
}
|
|
87430
|
+
process.exit(2);
|
|
87431
|
+
}
|
|
87432
|
+
const results = [];
|
|
87433
|
+
if (!options.json && !options.quiet) {
|
|
87434
|
+
console.log(source_default.bold(`Validating scenarios...
|
|
87435
|
+
`));
|
|
87436
|
+
}
|
|
87437
|
+
for (const file of files) {
|
|
87438
|
+
const result = validator.validate(file);
|
|
87439
|
+
results.push(result);
|
|
87440
|
+
if (options.strict && result.warnings.length > 0) {
|
|
87441
|
+
result.valid = false;
|
|
87442
|
+
result.errors.push(...result.warnings.map((w2) => ({
|
|
87443
|
+
...w2,
|
|
87444
|
+
severity: "error"
|
|
87445
|
+
})));
|
|
87446
|
+
}
|
|
87447
|
+
if (!options.json) {
|
|
87448
|
+
printFileResult(result, options);
|
|
87449
|
+
}
|
|
87450
|
+
}
|
|
87451
|
+
const summary = {
|
|
87452
|
+
total: results.length,
|
|
87453
|
+
passed: results.filter((r3) => r3.valid && r3.warnings.length === 0).length,
|
|
87454
|
+
failed: results.filter((r3) => !r3.valid).length,
|
|
87455
|
+
withWarnings: results.filter((r3) => r3.valid && r3.warnings.length > 0).length
|
|
87456
|
+
};
|
|
87457
|
+
if (options.json) {
|
|
87458
|
+
console.log(JSON.stringify({
|
|
87459
|
+
valid: summary.failed === 0,
|
|
87460
|
+
results: results.map((r3) => ({
|
|
87461
|
+
file: r3.file,
|
|
87462
|
+
valid: r3.valid,
|
|
87463
|
+
errors: r3.errors,
|
|
87464
|
+
warnings: r3.warnings
|
|
87465
|
+
})),
|
|
87466
|
+
summary
|
|
87467
|
+
}, null, 2));
|
|
87468
|
+
} else if (!options.quiet) {
|
|
87469
|
+
console.log();
|
|
87470
|
+
printSummary(summary, options.strict);
|
|
87471
|
+
}
|
|
87472
|
+
if (options.export === "junit") {
|
|
87473
|
+
const exportDir = options.exportOutput || "./artemis-exports";
|
|
87474
|
+
await mkdir7(exportDir, { recursive: true });
|
|
87475
|
+
const junit = generateValidationJUnitReport(results);
|
|
87476
|
+
const junitPath = join8(exportDir, `validation-${Date.now()}.xml`);
|
|
87477
|
+
await writeFile7(junitPath, junit);
|
|
87478
|
+
if (!options.quiet) {
|
|
87479
|
+
console.log(source_default.dim(`Exported: ${junitPath}`));
|
|
87480
|
+
}
|
|
87481
|
+
}
|
|
87482
|
+
if (summary.failed > 0) {
|
|
87483
|
+
process.exit(1);
|
|
87484
|
+
}
|
|
87485
|
+
});
|
|
87486
|
+
return cmd;
|
|
87487
|
+
}
|
|
87488
|
+
function resolveFiles(pathArg) {
|
|
87489
|
+
const resolved = resolve5(pathArg);
|
|
87490
|
+
try {
|
|
87491
|
+
const stat2 = statSync(resolved);
|
|
87492
|
+
if (stat2.isFile()) {
|
|
87493
|
+
return [resolved];
|
|
87494
|
+
}
|
|
87495
|
+
if (stat2.isDirectory()) {
|
|
87496
|
+
return findYamlFiles(resolved);
|
|
87497
|
+
}
|
|
87498
|
+
} catch {}
|
|
87499
|
+
const glob = new Glob(pathArg);
|
|
87500
|
+
const matches = [];
|
|
87501
|
+
for (const file of glob.scanSync({ absolute: true, onlyFiles: true })) {
|
|
87502
|
+
if (file.endsWith(".yaml") || file.endsWith(".yml")) {
|
|
87503
|
+
matches.push(file);
|
|
87504
|
+
}
|
|
87505
|
+
}
|
|
87506
|
+
return matches;
|
|
87507
|
+
}
|
|
87508
|
+
function findYamlFiles(dir) {
|
|
87509
|
+
const files = [];
|
|
87510
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
87511
|
+
for (const entry of entries) {
|
|
87512
|
+
const fullPath = join8(dir, entry.name);
|
|
87513
|
+
if (entry.isDirectory()) {
|
|
87514
|
+
files.push(...findYamlFiles(fullPath));
|
|
87515
|
+
} else if (entry.isFile() && (entry.name.endsWith(".yaml") || entry.name.endsWith(".yml"))) {
|
|
87516
|
+
files.push(fullPath);
|
|
87517
|
+
}
|
|
87518
|
+
}
|
|
87519
|
+
return files;
|
|
87520
|
+
}
|
|
87521
|
+
function printFileResult(result, options) {
|
|
87522
|
+
const fileName = basename4(result.file);
|
|
87523
|
+
if (result.valid && result.warnings.length === 0) {
|
|
87524
|
+
if (!options.quiet) {
|
|
87525
|
+
console.log(`${icons.passed} ${source_default.green(fileName)}`);
|
|
87526
|
+
}
|
|
87527
|
+
} else if (result.valid && result.warnings.length > 0) {
|
|
87528
|
+
console.log(`${icons.warning} ${source_default.yellow(fileName)}`);
|
|
87529
|
+
for (const warning of result.warnings) {
|
|
87530
|
+
const location = warning.column ? `Line ${warning.line}:${warning.column}` : `Line ${warning.line}`;
|
|
87531
|
+
console.log(source_default.yellow(` ${location}: ${warning.message}`));
|
|
87532
|
+
if (warning.suggestion) {
|
|
87533
|
+
console.log(source_default.dim(` Suggestion: ${warning.suggestion}`));
|
|
87534
|
+
}
|
|
87535
|
+
}
|
|
87536
|
+
} else {
|
|
87537
|
+
console.log(`${icons.failed} ${source_default.red(fileName)}`);
|
|
87538
|
+
for (const error of result.errors) {
|
|
87539
|
+
const location = error.column ? `Line ${error.line}:${error.column}` : `Line ${error.line}`;
|
|
87540
|
+
console.log(source_default.red(` ${location}: ${error.message}`));
|
|
87541
|
+
if (error.suggestion) {
|
|
87542
|
+
console.log(source_default.dim(` Suggestion: ${error.suggestion}`));
|
|
87543
|
+
}
|
|
87544
|
+
}
|
|
87545
|
+
for (const warning of result.warnings) {
|
|
87546
|
+
const location = warning.column ? `Line ${warning.line}:${warning.column}` : `Line ${warning.line}`;
|
|
87547
|
+
console.log(source_default.yellow(` ${location}: ${warning.message}`));
|
|
87548
|
+
}
|
|
87549
|
+
}
|
|
87550
|
+
}
|
|
87551
|
+
function printSummary(summary, strict) {
|
|
87552
|
+
const parts = [];
|
|
87553
|
+
if (summary.passed > 0) {
|
|
87554
|
+
parts.push(source_default.green(`${summary.passed} passed`));
|
|
87555
|
+
}
|
|
87556
|
+
if (summary.failed > 0) {
|
|
87557
|
+
parts.push(source_default.red(`${summary.failed} failed`));
|
|
87558
|
+
}
|
|
87559
|
+
if (summary.withWarnings > 0 && !strict) {
|
|
87560
|
+
parts.push(source_default.yellow(`${summary.withWarnings} with warnings`));
|
|
87561
|
+
}
|
|
87562
|
+
const statusIcon = summary.failed > 0 ? icons.failed : icons.passed;
|
|
87563
|
+
const statusColor = summary.failed > 0 ? source_default.red : source_default.green;
|
|
87564
|
+
console.log(statusColor(`${statusIcon} ${parts.join(", ")}`));
|
|
87565
|
+
console.log(source_default.dim(`${summary.total} scenario(s) validated`));
|
|
87566
|
+
}
|
|
87567
|
+
|
|
86546
87568
|
// src/cli.ts
|
|
86547
87569
|
function createCLI() {
|
|
86548
87570
|
const program2 = new Command;
|
|
@@ -86566,6 +87588,7 @@ Checking for updates...`);
|
|
|
86566
87588
|
});
|
|
86567
87589
|
program2.addCommand(initCommand());
|
|
86568
87590
|
program2.addCommand(runCommand());
|
|
87591
|
+
program2.addCommand(validateCommand());
|
|
86569
87592
|
program2.addCommand(baselineCommand());
|
|
86570
87593
|
program2.addCommand(compareCommand());
|
|
86571
87594
|
program2.addCommand(historyCommand());
|