refactor(shared): remove unused elapsed-time adapter (#10046)
This commit is contained in:
1 parent
df370c31d2
commit
62e74cdd9a
3 files changed
+2
-18
No files matched your search
@@ -35,7 +35,7 @@ import {
|
||||
type TurnDiffSummary,
|
||||
} from "./types";
|
||||
|
||||
export { formatDuration, formatElapsed } from "@t3tools/shared/orchestrationTiming";
|
||||
export { formatDuration } from "@t3tools/shared/orchestrationTiming";
|
||||
|
||||
export type WorkLogToolLifecycleStatus =
|
||||
| "inProgress"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vite-plus/test";
|
||||
|
||||
import { formatDuration, formatElapsed } from "./orchestrationTiming.ts";
|
||||
import { formatDuration } from "./orchestrationTiming.ts";
|
||||
|
||||
describe("formatDuration", () => {
|
||||
it.each([
|
||||
@@ -29,9 +29,3 @@ describe("formatDuration", () => {
|
||||
expect(formatDuration(durationMs)).toBe("0ms");
|
||||
});
|
||||
});
|
||||
|
||||
describe("formatElapsed", () => {
|
||||
it("formats a long run across midnight", () => {
|
||||
expect(formatElapsed("2026-09-03T22:00:00Z", "2026-09-04T04:59:50Z")).toBe("6h 59m 50s");
|
||||
});
|
||||
});
|
||||
@@ -28,16 +28,6 @@ export function formatDuration(durationMs: number): string {
|
||||
return parts.join(" ");
|
||||
}
|
||||
|
||||
export function formatElapsed(startIso: string, endIso: string | undefined): string | null {
|
||||
if (!endIso) return null;
|
||||
const startedAt = Date.parse(startIso);
|
||||
const endedAt = Date.parse(endIso);
|
||||
if (Number.isNaN(startedAt) || Number.isNaN(endedAt) || endedAt < startedAt) {
|
||||
return null;
|
||||
}
|
||||
return formatDuration(endedAt - startedAt);
|
||||
}
|
||||
|
||||
export function isLatestTurnSettled(
|
||||
latestTurn: LatestTurnTiming | null,
|
||||
session: SessionActivityState | null,
|
||||
|
||||
Reference in new issue
Block a user