tines 0.0.80 → 0.0.81
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 +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -126,6 +126,14 @@ function runDurationLabel(run, now = Date.now()) {
|
|
|
126
126
|
const seconds = Math.max(0, Math.round(((run.ended_at ?? now) - run.started_at) / 1e3));
|
|
127
127
|
return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m`;
|
|
128
128
|
}
|
|
129
|
+
function runCostLabel(run) {
|
|
130
|
+
const usage = run.usage;
|
|
131
|
+
if (!usage) return null;
|
|
132
|
+
if (usage.cost_usd !== void 0) return `$${usage.cost_usd.toFixed(2)}`;
|
|
133
|
+
if (usage.cost_source === "none") return "unreported";
|
|
134
|
+
const tokens = (usage.input_tokens ?? 0) + (usage.output_tokens ?? 0);
|
|
135
|
+
return tokens > 0 ? `${tokens.toLocaleString()} tok` : null;
|
|
136
|
+
}
|
|
129
137
|
function utilizationLabel(quota2, activeRuns, stateName = (id) => id) {
|
|
130
138
|
if (quota2.type === "global_cap") {
|
|
131
139
|
return `${activeRuns.length}/${quota2.limit} global slot${quota2.limit === 1 ? "" : "s"} in use`;
|
|
@@ -2899,14 +2907,6 @@ withCommon(
|
|
|
2899
2907
|
}
|
|
2900
2908
|
);
|
|
2901
2909
|
var runsCmd = program.command("runs").description("Agent runs: attempts at issues by runners");
|
|
2902
|
-
function runCostLabel(run) {
|
|
2903
|
-
const usage = run.usage;
|
|
2904
|
-
if (!usage) return "\u2014";
|
|
2905
|
-
if (usage.cost_usd !== void 0) return `$${usage.cost_usd.toFixed(2)}`;
|
|
2906
|
-
if (usage.cost_source === "none") return "unreported";
|
|
2907
|
-
const tokens = (usage.input_tokens ?? 0) + (usage.output_tokens ?? 0);
|
|
2908
|
-
return tokens > 0 ? `${tokens.toLocaleString()} tok` : "\u2014";
|
|
2909
|
-
}
|
|
2910
2910
|
function runRow(run) {
|
|
2911
2911
|
return [
|
|
2912
2912
|
run.id,
|
|
@@ -2915,7 +2915,7 @@ function runRow(run) {
|
|
|
2915
2915
|
`${run.tier}${run.model ? ` (${run.model})` : ""}`,
|
|
2916
2916
|
run.status,
|
|
2917
2917
|
runDurationLabel(run),
|
|
2918
|
-
runCostLabel(run),
|
|
2918
|
+
runCostLabel(run) ?? "\u2014",
|
|
2919
2919
|
timestamp(run.created_at)
|
|
2920
2920
|
];
|
|
2921
2921
|
}
|