portable-agent-layer 0.104.1 → 0.104.2
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/package.json
CHANGED
package/src/cli/usage-render.ts
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
fmt,
|
|
5
5
|
fmtCost,
|
|
6
6
|
grandBucket,
|
|
7
|
-
inferenceLabel,
|
|
8
7
|
modelLabel,
|
|
9
8
|
modelsByCost,
|
|
10
9
|
projectsByCost,
|
|
@@ -100,7 +99,7 @@ function projectSection(style: Style, agents: AgentReport[]): string[] {
|
|
|
100
99
|
|
|
101
100
|
function inferenceSections(style: Style, data: UsageData): string[] {
|
|
102
101
|
return usedInferenceModels(data.pal).flatMap(([model, buckets]) => [
|
|
103
|
-
subtle(style, "PAL inference",
|
|
102
|
+
subtle(style, "PAL inference", modelLabel(model)),
|
|
104
103
|
...windowRows(style, buckets),
|
|
105
104
|
"",
|
|
106
105
|
]);
|
|
@@ -105,9 +105,9 @@ function byCost<T>(entries: [string, T][], costOf: (value: T) => number): [strin
|
|
|
105
105
|
return entries.sort((a, b) => costOf(b[1]) - costOf(a[1]));
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
/** Drops the vendor's prefix
|
|
108
|
+
/** Drops the vendor's prefix, any provider path and a release date, so `accounts/x/models/kimi` reads `kimi`. */
|
|
109
109
|
export function modelLabel(model: string): string {
|
|
110
|
-
return (model.split("/").at(-1) ?? model).replace("claude-", "");
|
|
110
|
+
return (model.split("/").at(-1) ?? model).replace("claude-", "").replace(/-\d{8}$/, "");
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export const usedAgents = (agents: AgentReport[]) =>
|
|
@@ -160,18 +160,12 @@ function byProjectLines(agents: AgentReport[]): string[] {
|
|
|
160
160
|
];
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
export function inferenceLabel(model: string): string {
|
|
164
|
-
if (model.includes("haiku")) return "Haiku";
|
|
165
|
-
if (model.includes("sonnet")) return "Sonnet";
|
|
166
|
-
return model.replace("claude-", "");
|
|
167
|
-
}
|
|
168
|
-
|
|
169
163
|
export const usedInferenceModels = (pal: PalInferenceUsage) =>
|
|
170
164
|
Object.entries(pal.byModel).filter(([, buckets]) => buckets.total.calls > 0);
|
|
171
165
|
|
|
172
166
|
function palInferenceLines(pal: PalInferenceUsage): string[] {
|
|
173
167
|
return usedInferenceModels(pal).flatMap(([model, buckets]) => [
|
|
174
|
-
`\n PAL Inference (${
|
|
168
|
+
`\n PAL Inference (${modelLabel(model)})\n`,
|
|
175
169
|
...windowLines(buckets),
|
|
176
170
|
]);
|
|
177
171
|
}
|