@plune-ai/cli 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -1
- package/dist/cli.cjs +1073 -351
- package/dist/index.cjs +105 -42
- package/dist/index.d.cts +188 -1
- package/dist/index.d.ts +188 -1
- package/dist/index.js +101 -41
- package/dist/reporter-core.cjs +441 -176
- package/dist/reporter-core.d.cts +65 -6
- package/dist/reporter-core.d.ts +65 -6
- package/dist/reporter-core.js +438 -173
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1499,59 +1499,116 @@ import * as fs6 from "fs";
|
|
|
1499
1499
|
import * as path5 from "path";
|
|
1500
1500
|
|
|
1501
1501
|
// src/types/run-result-schema.ts
|
|
1502
|
+
import { z as z3 } from "zod";
|
|
1503
|
+
|
|
1504
|
+
// src/types/test-case-schema.ts
|
|
1502
1505
|
import { z as z2 } from "zod";
|
|
1503
|
-
var
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1506
|
-
|
|
1506
|
+
var TEST_CASE_SCHEMA_VERSION = 2;
|
|
1507
|
+
var externalKeySchema = z2.object({
|
|
1508
|
+
kind: z2.enum(["playwright-id", "path-title", "allure-history", "cairn-stable", "eval-id", "qase", "testrail"]),
|
|
1509
|
+
value: z2.string().min(1)
|
|
1510
|
+
});
|
|
1511
|
+
var manualStepSchema = z2.object({
|
|
1512
|
+
action: z2.string().min(1),
|
|
1513
|
+
expected: z2.string().min(1).optional()
|
|
1507
1514
|
});
|
|
1508
1515
|
var assertionResultRecordSchema = z2.object({
|
|
1509
|
-
type: z2.string(),
|
|
1516
|
+
type: z2.string().min(1),
|
|
1510
1517
|
passed: z2.boolean(),
|
|
1511
1518
|
score: z2.number().optional(),
|
|
1512
|
-
reason: z2.string().optional()
|
|
1513
|
-
|
|
1519
|
+
reason: z2.string().optional()
|
|
1520
|
+
});
|
|
1521
|
+
var manualCaseSchema = z2.object({
|
|
1522
|
+
type: z2.literal("manual"),
|
|
1523
|
+
steps: z2.array(manualStepSchema).min(1),
|
|
1524
|
+
expected: z2.string().min(1).optional()
|
|
1525
|
+
});
|
|
1526
|
+
var automatedCaseSchema = z2.object({
|
|
1527
|
+
type: z2.literal("automated"),
|
|
1528
|
+
specRef: z2.string().min(1)
|
|
1529
|
+
});
|
|
1530
|
+
var evalCaseSchema = z2.object({
|
|
1531
|
+
type: z2.literal("eval"),
|
|
1532
|
+
prompt: z2.string().min(1),
|
|
1533
|
+
goldenSetId: z2.string().min(1).optional(),
|
|
1534
|
+
assertions: z2.array(assertionResultRecordSchema).min(1)
|
|
1535
|
+
});
|
|
1536
|
+
var testCaseBaseSchema = z2.object({
|
|
1537
|
+
schemaVersion: z2.literal(TEST_CASE_SCHEMA_VERSION),
|
|
1538
|
+
id: z2.string().min(1),
|
|
1539
|
+
externalKeys: z2.array(externalKeySchema).optional(),
|
|
1540
|
+
/** ADR 0045 / plune#1246 — optional, purely additive; schemaVersion stays 2. */
|
|
1541
|
+
is_flaky: z2.boolean().optional(),
|
|
1542
|
+
/** ADR 0045 / plune#1246 — optional, purely additive; schemaVersion stays 2. */
|
|
1543
|
+
is_muted: z2.boolean().optional()
|
|
1544
|
+
});
|
|
1545
|
+
var testCaseSchema = z2.discriminatedUnion("type", [
|
|
1546
|
+
testCaseBaseSchema.merge(manualCaseSchema),
|
|
1547
|
+
testCaseBaseSchema.merge(automatedCaseSchema),
|
|
1548
|
+
testCaseBaseSchema.merge(evalCaseSchema)
|
|
1549
|
+
]);
|
|
1550
|
+
function parseTestCase(value) {
|
|
1551
|
+
return testCaseSchema.parse(value);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
// src/types/results.ts
|
|
1555
|
+
var ROW_INCONCLUSIVE = ["blocked", "skipped"];
|
|
1556
|
+
|
|
1557
|
+
// src/types/run-result-schema.ts
|
|
1558
|
+
var RUN_RESULT_SCHEMA_VERSION = 1;
|
|
1559
|
+
var binaryVerdictSchema = z3.object({
|
|
1560
|
+
question: z3.string().min(1),
|
|
1561
|
+
passed: z3.boolean()
|
|
1562
|
+
});
|
|
1563
|
+
var assertionResultRecordSchema2 = z3.object({
|
|
1564
|
+
type: z3.string(),
|
|
1565
|
+
passed: z3.boolean(),
|
|
1566
|
+
score: z3.number().optional(),
|
|
1567
|
+
reason: z3.string().optional(),
|
|
1568
|
+
binaryVerdicts: z3.array(binaryVerdictSchema).optional()
|
|
1514
1569
|
});
|
|
1515
|
-
var usageSchema =
|
|
1516
|
-
input_tokens:
|
|
1517
|
-
output_tokens:
|
|
1518
|
-
cost_usd:
|
|
1570
|
+
var usageSchema = z3.object({
|
|
1571
|
+
input_tokens: z3.number(),
|
|
1572
|
+
output_tokens: z3.number(),
|
|
1573
|
+
cost_usd: z3.number()
|
|
1519
1574
|
});
|
|
1520
|
-
var runErrorSchema =
|
|
1521
|
-
code:
|
|
1522
|
-
message:
|
|
1575
|
+
var runErrorSchema = z3.object({
|
|
1576
|
+
code: z3.string(),
|
|
1577
|
+
message: z3.string()
|
|
1523
1578
|
});
|
|
1524
|
-
var rowResultSchema =
|
|
1525
|
-
vars:
|
|
1526
|
-
output:
|
|
1527
|
-
cached:
|
|
1579
|
+
var rowResultSchema = z3.object({
|
|
1580
|
+
vars: z3.record(z3.string(), z3.unknown()),
|
|
1581
|
+
output: z3.string().nullable(),
|
|
1582
|
+
cached: z3.boolean(),
|
|
1528
1583
|
usage: usageSchema.optional(),
|
|
1529
|
-
latency_ms:
|
|
1584
|
+
latency_ms: z3.number().optional(),
|
|
1530
1585
|
error: runErrorSchema.optional(),
|
|
1531
|
-
assertions:
|
|
1586
|
+
assertions: z3.array(assertionResultRecordSchema2),
|
|
1587
|
+
/** ADR 0045. Optional and additive — the same enum the platform validates on `POST /v1/runs`. */
|
|
1588
|
+
inconclusive: z3.enum(ROW_INCONCLUSIVE).optional()
|
|
1532
1589
|
});
|
|
1533
|
-
var summarySchema =
|
|
1534
|
-
total:
|
|
1535
|
-
passed:
|
|
1536
|
-
failed:
|
|
1537
|
-
errored:
|
|
1538
|
-
cost_usd:
|
|
1539
|
-
duration_ms:
|
|
1590
|
+
var summarySchema = z3.object({
|
|
1591
|
+
total: z3.number(),
|
|
1592
|
+
passed: z3.number(),
|
|
1593
|
+
failed: z3.number(),
|
|
1594
|
+
errored: z3.number(),
|
|
1595
|
+
cost_usd: z3.number(),
|
|
1596
|
+
duration_ms: z3.number()
|
|
1540
1597
|
});
|
|
1541
|
-
var evalResultSchema =
|
|
1542
|
-
id:
|
|
1543
|
-
tags:
|
|
1544
|
-
rows:
|
|
1545
|
-
passed:
|
|
1598
|
+
var evalResultSchema = z3.object({
|
|
1599
|
+
id: z3.string(),
|
|
1600
|
+
tags: z3.array(z3.string()),
|
|
1601
|
+
rows: z3.array(rowResultSchema),
|
|
1602
|
+
passed: z3.boolean()
|
|
1546
1603
|
});
|
|
1547
|
-
var runResultSchema =
|
|
1548
|
-
schemaVersion:
|
|
1549
|
-
plune_version:
|
|
1550
|
-
started_at:
|
|
1551
|
-
finished_at:
|
|
1552
|
-
config_hash:
|
|
1604
|
+
var runResultSchema = z3.object({
|
|
1605
|
+
schemaVersion: z3.literal(RUN_RESULT_SCHEMA_VERSION),
|
|
1606
|
+
plune_version: z3.string(),
|
|
1607
|
+
started_at: z3.string(),
|
|
1608
|
+
finished_at: z3.string(),
|
|
1609
|
+
config_hash: z3.string(),
|
|
1553
1610
|
summary: summarySchema,
|
|
1554
|
-
evals:
|
|
1611
|
+
evals: z3.array(evalResultSchema)
|
|
1555
1612
|
});
|
|
1556
1613
|
function parseRunResult(value) {
|
|
1557
1614
|
return runResultSchema.parse(value);
|
|
@@ -1934,17 +1991,20 @@ export {
|
|
|
1934
1991
|
SyncFileError,
|
|
1935
1992
|
SyncHttpError,
|
|
1936
1993
|
SyncNetworkError,
|
|
1994
|
+
TEST_CASE_SCHEMA_VERSION,
|
|
1937
1995
|
TokenRejectedError,
|
|
1938
1996
|
assertionConfigSchema,
|
|
1939
|
-
assertionResultRecordSchema,
|
|
1997
|
+
assertionResultRecordSchema2 as assertionResultRecordSchema,
|
|
1940
1998
|
binaryVerdictSchema,
|
|
1941
1999
|
formatIngestResult,
|
|
1942
2000
|
handleIngest as ingest,
|
|
1943
2001
|
parseRunResult,
|
|
2002
|
+
parseTestCase,
|
|
1944
2003
|
readCairnRun,
|
|
1945
2004
|
reportIngestFailure,
|
|
1946
2005
|
reportSyncFailure,
|
|
1947
2006
|
handleRun as run,
|
|
1948
2007
|
runResultSchema,
|
|
1949
|
-
handleSync as sync
|
|
2008
|
+
handleSync as sync,
|
|
2009
|
+
testCaseSchema
|
|
1950
2010
|
};
|