@rulvar/cli 1.141.0 → 1.142.0

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.d.ts CHANGED
@@ -436,11 +436,13 @@ interface ToOtelOptions {
436
436
  patterns?: ReadonlyArray<RegExp | string>;
437
437
  }
438
438
  /**
439
- * Exports one settled run's event stream onto a tracer. The run's
440
- * events are consumed in seq order; span openers start spans, the
441
- * matching closers end them, and payload-only events attach as span
442
- * events on the innermost open span. Returns the number of spans
443
- * created.
439
+ * Exports one run's event stream onto a tracer. The run's events are
440
+ * consumed in seq order; span openers start spans, the matching
441
+ * closers end them, and payload-only events attach as span events on
442
+ * the innermost open span. Returns the number of spans created. Every
443
+ * terminal path exports, the unsettled ones included (RV1106): a
444
+ * rejecting `result` never fails an export the stream already
445
+ * completed, it only marks any leftover span with the refusal.
444
446
  */
445
447
  declare function toOtel(run: {
446
448
  runId: string;
package/dist/index.js CHANGED
@@ -928,11 +928,13 @@ function openAttributes(event, runId, maskText) {
928
928
  return attrs;
929
929
  }
930
930
  /**
931
- * Exports one settled run's event stream onto a tracer. The run's
932
- * events are consumed in seq order; span openers start spans, the
933
- * matching closers end them, and payload-only events attach as span
934
- * events on the innermost open span. Returns the number of spans
935
- * created.
931
+ * Exports one run's event stream onto a tracer. The run's events are
932
+ * consumed in seq order; span openers start spans, the matching
933
+ * closers end them, and payload-only events attach as span events on
934
+ * the innermost open span. Returns the number of spans created. Every
935
+ * terminal path exports, the unsettled ones included (RV1106): a
936
+ * rejecting `result` never fails an export the stream already
937
+ * completed, it only marks any leftover span with the refusal.
936
938
  */
937
939
  async function toOtel(run, tracer, options = {}) {
938
940
  const openBySpanId = /* @__PURE__ */ new Map();
@@ -1073,9 +1075,9 @@ async function toOtel(run, tracer, options = {}) {
1073
1075
  default: (openBySpanId.get(event.spanId) ?? stack[stack.length - 1])?.span.addEvent(event.type, { "rulvar.entry_seq": event.seq });
1074
1076
  }
1075
1077
  }
1076
- const outcome = await run.result;
1078
+ const settledOk = await run.result.then((outcome) => outcome.status === "ok", () => false);
1077
1079
  for (const open of [...openBySpanId.values()]) {
1078
- open.span.setStatus({ code: outcome.status === "ok" ? STATUS_OK : STATUS_ERROR });
1080
+ open.span.setStatus({ code: settledOk ? STATUS_OK : STATUS_ERROR });
1079
1081
  open.span.end();
1080
1082
  openBySpanId.delete(open.spanId);
1081
1083
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.141.0",
3
+ "version": "1.142.0",
4
4
  "description": "Rulvar shell: run/resume/runs/inspect/plan/kb commands, TUI progress, createServer, createWorker, OTel exporter.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,17 +22,17 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.141.0"
25
+ "@rulvar/core": "1.142.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.20.1",
29
29
  "tsdown": "^0.22.14",
30
30
  "typescript": "~6.0.3",
31
- "@rulvar/testing": "1.141.0",
32
- "@rulvar/store-sqlite": "1.141.0",
33
- "@rulvar/planner": "1.141.0",
34
- "@rulvar/evals": "1.141.0",
35
- "@rulvar/plan": "1.141.0"
31
+ "@rulvar/testing": "1.142.0",
32
+ "@rulvar/planner": "1.142.0",
33
+ "@rulvar/plan": "1.142.0",
34
+ "@rulvar/evals": "1.142.0",
35
+ "@rulvar/store-sqlite": "1.142.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"