@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/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 RUN_RESULT_SCHEMA_VERSION = 1;
1504
- var binaryVerdictSchema = z2.object({
1505
- question: z2.string().min(1),
1506
- passed: z2.boolean()
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
- binaryVerdicts: z2.array(binaryVerdictSchema).optional()
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 = z2.object({
1516
- input_tokens: z2.number(),
1517
- output_tokens: z2.number(),
1518
- cost_usd: z2.number()
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 = z2.object({
1521
- code: z2.string(),
1522
- message: z2.string()
1575
+ var runErrorSchema = z3.object({
1576
+ code: z3.string(),
1577
+ message: z3.string()
1523
1578
  });
1524
- var rowResultSchema = z2.object({
1525
- vars: z2.record(z2.string(), z2.unknown()),
1526
- output: z2.string().nullable(),
1527
- cached: z2.boolean(),
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: z2.number().optional(),
1584
+ latency_ms: z3.number().optional(),
1530
1585
  error: runErrorSchema.optional(),
1531
- assertions: z2.array(assertionResultRecordSchema)
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 = z2.object({
1534
- total: z2.number(),
1535
- passed: z2.number(),
1536
- failed: z2.number(),
1537
- errored: z2.number(),
1538
- cost_usd: z2.number(),
1539
- duration_ms: z2.number()
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 = z2.object({
1542
- id: z2.string(),
1543
- tags: z2.array(z2.string()),
1544
- rows: z2.array(rowResultSchema),
1545
- passed: z2.boolean()
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 = z2.object({
1548
- schemaVersion: z2.literal(RUN_RESULT_SCHEMA_VERSION),
1549
- plune_version: z2.string(),
1550
- started_at: z2.string(),
1551
- finished_at: z2.string(),
1552
- config_hash: z2.string(),
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: z2.array(evalResultSchema)
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
  };