Skip to content

Commit d11f788

Browse files
committed
fix: add run succeeded to Actor card
1 parent 0d09c4d commit d11f788

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/types.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,6 @@ export interface ToolEntry {
157157
tool: ActorTool | HelperTool | ActorMcpTool;
158158
}
159159

160-
// ActorStoreList for actor-search tool
161-
export interface ActorStats {
162-
totalRuns: number;
163-
totalUsers30Days: number;
164-
publicActorRunStats30Days: unknown;
165-
}
166-
167160
/**
168161
* Price for a single event in a specific tier.
169162
*/

src/utils/actor-card.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ export function formatActorToActorCard(
6262
statsParts.push(`${stats.totalUsers.toLocaleString()} total users, ${stats.totalUsers30Days.toLocaleString()} monthly users`);
6363
}
6464

65+
// Add success rate for last 30 days if available
66+
if ('publicActorRunStats30Days' in stats && stats.publicActorRunStats30Days) {
67+
const runStats = stats.publicActorRunStats30Days as {
68+
SUCCEEDED: number;
69+
TOTAL: number;
70+
};
71+
if (runStats.TOTAL > 0) {
72+
const successRate = ((runStats.SUCCEEDED / runStats.TOTAL) * 100).toFixed(1);
73+
statsParts.push(`Runs succeeded: ${successRate}%`);
74+
}
75+
}
76+
6577
// Add bookmark count if available (ActorStoreList only)
6678
if ('bookmarkCount' in actor && actor.bookmarkCount) {
6779
statsParts.push(`${actor.bookmarkCount} bookmarks`);

0 commit comments

Comments
 (0)