@plune-ai/cli 0.39.3 → 0.39.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.
@@ -878,7 +878,13 @@ function textRefusal(bytes) {
878
878
  }
879
879
  return void 0;
880
880
  }
881
- function onDisk(result) {
881
+ function withoutTargets(result) {
882
+ if (result.targets === void 0) return result;
883
+ const { targets: _targets, ...rest } = result;
884
+ return rest;
885
+ }
886
+ function onDisk(deferred) {
887
+ const result = withoutTargets(deferred);
882
888
  if (!("files" in result) || result.files === void 0) return result;
883
889
  const { files, ...rest } = result;
884
890
  const kept = files.filter((f) => f.path !== void 0).map(({ body: _body, ...file }) => file);
@@ -1430,6 +1436,7 @@ async function startRun(passed, declared) {
1430
1436
  let runId = null;
1431
1437
  let joined = false;
1432
1438
  let offline = token === "";
1439
+ let targetsRefused = false;
1433
1440
  let done = false;
1434
1441
  const shortened = /* @__PURE__ */ new Set();
1435
1442
  const specFiles = /* @__PURE__ */ new Map();
@@ -1699,16 +1706,24 @@ async function startRun(passed, declared) {
1699
1706
  await send(submissions, filesByKey);
1700
1707
  }
1701
1708
  async function send(submissions, filesByKey) {
1702
- for (const part of packed(submissions)) {
1709
+ for (const packedPart of packed(submissions)) {
1710
+ let part = targetsRefused ? packedPart.map(withoutTargets) : packedPart;
1703
1711
  if (offline) {
1704
1712
  defer(part);
1705
1713
  continue;
1706
1714
  }
1707
- const out = await client.post(
1715
+ const post = (results) => client.post(
1708
1716
  `/v1/runs/${runId}/results`,
1709
1717
  // The job's combination on every batch; a refusal of it is a 422 said below as it came.
1710
- { results: part, ...configuration !== void 0 ? { configuration } : {} }
1718
+ { results, ...configuration !== void 0 ? { configuration } : {} }
1711
1719
  );
1720
+ let out = await post(part);
1721
+ if (!out.ok && out.kind === "invalid" && out.status === 400 && part.some((r) => r.targets !== void 0)) {
1722
+ if (!targetsRefused) log("plune: the platform does not take targets on a result yet \u2014 the results are sent without them.");
1723
+ targetsRefused = true;
1724
+ part = part.map(withoutTargets);
1725
+ out = await post(part);
1726
+ }
1712
1727
  const counts = out.ok ? out.body?.counts : void 0;
1713
1728
  const told = COUNTED.filter((k) => typeof counts?.[k] === "number");
1714
1729
  if (told.length > 0) {
@@ -222,6 +222,12 @@ interface PendingResult {
222
222
  * fallback file either, which keeps a file by its path and leaves the bytes out.
223
223
  */
224
224
  files?: ResultFile[];
225
+ /**
226
+ * What the test is about, beside who it is (a tool of an MCP server): stored with the result, never part of its
227
+ * identity. Absent rather than empty. A platform older than the field refuses the batch; the session then sends it
228
+ * again without them (see `send`).
229
+ */
230
+ targets?: string[];
225
231
  }
226
232
  /**
227
233
  * What a failed attempt says about itself on the run page: every field
@@ -222,6 +222,12 @@ interface PendingResult {
222
222
  * fallback file either, which keeps a file by its path and leaves the bytes out.
223
223
  */
224
224
  files?: ResultFile[];
225
+ /**
226
+ * What the test is about, beside who it is (a tool of an MCP server): stored with the result, never part of its
227
+ * identity. Absent rather than empty. A platform older than the field refuses the batch; the session then sends it
228
+ * again without them (see `send`).
229
+ */
230
+ targets?: string[];
225
231
  }
226
232
  /**
227
233
  * What a failed attempt says about itself on the run page: every field
@@ -828,7 +828,13 @@ function textRefusal(bytes) {
828
828
  }
829
829
  return void 0;
830
830
  }
831
- function onDisk(result) {
831
+ function withoutTargets(result) {
832
+ if (result.targets === void 0) return result;
833
+ const { targets: _targets, ...rest } = result;
834
+ return rest;
835
+ }
836
+ function onDisk(deferred) {
837
+ const result = withoutTargets(deferred);
832
838
  if (!("files" in result) || result.files === void 0) return result;
833
839
  const { files, ...rest } = result;
834
840
  const kept = files.filter((f) => f.path !== void 0).map(({ body: _body, ...file }) => file);
@@ -1380,6 +1386,7 @@ async function startRun(passed, declared) {
1380
1386
  let runId = null;
1381
1387
  let joined = false;
1382
1388
  let offline = token === "";
1389
+ let targetsRefused = false;
1383
1390
  let done = false;
1384
1391
  const shortened = /* @__PURE__ */ new Set();
1385
1392
  const specFiles = /* @__PURE__ */ new Map();
@@ -1649,16 +1656,24 @@ async function startRun(passed, declared) {
1649
1656
  await send(submissions, filesByKey);
1650
1657
  }
1651
1658
  async function send(submissions, filesByKey) {
1652
- for (const part of packed(submissions)) {
1659
+ for (const packedPart of packed(submissions)) {
1660
+ let part = targetsRefused ? packedPart.map(withoutTargets) : packedPart;
1653
1661
  if (offline) {
1654
1662
  defer(part);
1655
1663
  continue;
1656
1664
  }
1657
- const out = await client.post(
1665
+ const post = (results) => client.post(
1658
1666
  `/v1/runs/${runId}/results`,
1659
1667
  // The job's combination on every batch; a refusal of it is a 422 said below as it came.
1660
- { results: part, ...configuration !== void 0 ? { configuration } : {} }
1668
+ { results, ...configuration !== void 0 ? { configuration } : {} }
1661
1669
  );
1670
+ let out = await post(part);
1671
+ if (!out.ok && out.kind === "invalid" && out.status === 400 && part.some((r) => r.targets !== void 0)) {
1672
+ if (!targetsRefused) log("plune: the platform does not take targets on a result yet \u2014 the results are sent without them.");
1673
+ targetsRefused = true;
1674
+ part = part.map(withoutTargets);
1675
+ out = await post(part);
1676
+ }
1662
1677
  const counts = out.ok ? out.body?.counts : void 0;
1663
1678
  const told = COUNTED.filter((k) => typeof counts?.[k] === "number");
1664
1679
  if (told.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plune-ai/cli",
3
- "version": "0.39.3",
3
+ "version": "0.39.4",
4
4
  "description": "AI-powered assertion testing for LLM apps — write assertions, run them against any provider, get a pass/fail report (local, CI, or diff).",
5
5
  "keywords": [
6
6
  "ai",