@vitest-agent/ui 1.0.3 → 1.0.5

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/index.js CHANGED
@@ -32,7 +32,7 @@ import { ActionSeverity, CoverageFile, CoverageGap, CoverageMetric, CoverageRend
32
32
  *
33
33
  * @public
34
34
  */
35
- const CURRENT_UI_VERSION = "1.0.3";
35
+ const CURRENT_UI_VERSION = "1.0.5";
36
36
 
37
37
  //#endregion
38
38
  export { ActionSeverity, CURRENT_UI_VERSION, CountColumns, CoverageBlock, CoverageFile, CoverageGap, CoverageMetric, CoverageRenderState, FailureRecord, FailureSection, FailuresSection, ModuleHeader, ModuleRecord, ProjectRow, RenderState, RenderTotals, RunEvent, RunEventChannel, RunEventChannelLive, SPINNER_FRAMES, SPINNER_FRAME_MS, StatusIcon, StreamApp, SuggestedActionRecord, SuggestedActions, TestRecord, TestRow, TrendLine, accumulateUntilFinished, buildFooter, classifyOutcome, classifyRunShape, dispatch, dispatchInk, dispatcherTable, dominantClassification, forEachRenderState, formatDisplayDuration, initialRenderState, publish, publishAll, reduceRenderState, reduceRenderStateAll, renderAgent, renderStateStream, spinnerFrame, spinnerFrameForTime, subscribeRaw, synthesizeFromAgentReport, synthesizeRunEvents };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/ui",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "private": false,
5
5
  "description": "Shared event-sourced renderer for vitest-agent. React Ink view for humans, plain-string view for agents, both fed by the same reducer over a RunEvent stream.",
6
6
  "keywords": [
@@ -38,7 +38,7 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "dependencies": {
41
- "@vitest-agent/sdk": "1.2.0",
41
+ "@vitest-agent/sdk": "1.3.1",
42
42
  "effect": "^3.21.4"
43
43
  },
44
44
  "peerDependencies": {
@@ -434,18 +434,19 @@ const liveRegion = (state, shape, nowMs, frame) => {
434
434
  const StreamApp = ({ state, frameIndex, nowMs }) => {
435
435
  const now = nowMs ?? Date.now();
436
436
  const frame = spinnerFrame(frameIndex);
437
+ const shape = classifyRunShape(state, groupByProject(state).map((g) => {
438
+ const c = sumCounts(g.modules);
439
+ return {
440
+ name: g.name,
441
+ passCount: c.passCount,
442
+ failCount: c.failCount,
443
+ skipCount: c.skipCount,
444
+ durationMs: 0
445
+ };
446
+ }));
437
447
  return /* @__PURE__ */ jsx(Box, {
438
448
  flexDirection: "column",
439
- children: liveRegion(state, classifyRunShape(state, groupByProject(state).map((g) => {
440
- const c = sumCounts(g.modules);
441
- return {
442
- name: g.name,
443
- passCount: c.passCount,
444
- failCount: c.failCount,
445
- skipCount: c.skipCount,
446
- durationMs: 0
447
- };
448
- })), now, frame)
449
+ children: liveRegion(state, shape, now, frame)
449
450
  });
450
451
  };
451
452
 
@@ -45,7 +45,8 @@ const SPINNER_FRAME_MS = 80;
45
45
  */
46
46
  const spinnerFrame = (index) => {
47
47
  const count = SPINNER_FRAMES.length;
48
- return SPINNER_FRAMES[(Math.trunc(index) % count + count) % count];
48
+ const wrapped = (Math.trunc(index) % count + count) % count;
49
+ return SPINNER_FRAMES[wrapped];
49
50
  };
50
51
  /**
51
52
  * Derive the spinner frame index from a wall-clock timestamp. Using the