Skip to content

Commit 57f9a55

Browse files
committed
fix(types): wire plugin package metadata
1 parent 97d35f4 commit 57f9a55

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/commands/models/auth-list.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function resolveTargetAgent(
3939
}
4040

4141
function formatTimestamp(value: number | undefined): string | undefined {
42-
if (!Number.isFinite(value)) {
42+
if (typeof value !== "number" || !Number.isFinite(value)) {
4343
return undefined;
4444
}
4545
return new Date(value).toISOString();
@@ -56,6 +56,9 @@ function summarizeProfile(params: {
5656
profile: AuthProfileCredential;
5757
usage?: ProfileUsageStats;
5858
}): AuthProfileSummary {
59+
const expiresAt = resolveProfileExpiry(params.profile);
60+
const cooldownUntil = formatTimestamp(params.usage?.cooldownUntil);
61+
const disabledUntil = formatTimestamp(params.usage?.disabledUntil);
5962
return {
6063
id: params.profileId,
6164
provider: normalizeProviderId(params.profile.provider),
@@ -67,15 +70,9 @@ function summarizeProfile(params: {
6770
}),
6871
...(params.profile.email ? { email: params.profile.email } : {}),
6972
...(params.profile.displayName ? { displayName: params.profile.displayName } : {}),
70-
...(resolveProfileExpiry(params.profile)
71-
? { expiresAt: resolveProfileExpiry(params.profile) }
72-
: {}),
73-
...(formatTimestamp(params.usage?.cooldownUntil)
74-
? { cooldownUntil: formatTimestamp(params.usage?.cooldownUntil) }
75-
: {}),
76-
...(formatTimestamp(params.usage?.disabledUntil)
77-
? { disabledUntil: formatTimestamp(params.usage?.disabledUntil) }
78-
: {}),
73+
...(expiresAt ? { expiresAt } : {}),
74+
...(cooldownUntil ? { cooldownUntil } : {}),
75+
...(disabledUntil ? { disabledUntil } : {}),
7976
};
8077
}
8178

src/plugins/loader-records.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export function createPluginRecord(params: {
1111
name?: string;
1212
description?: string;
1313
version?: string;
14+
packageName?: string;
1415
format?: PluginFormat;
1516
bundleFormat?: PluginBundleFormat;
1617
bundleCapabilities?: string[];
@@ -32,6 +33,7 @@ export function createPluginRecord(params: {
3233
name: params.name ?? params.id,
3334
description: params.description,
3435
version: params.version,
36+
packageName: params.packageName,
3537
format: params.format ?? "openclaw",
3638
bundleFormat: params.bundleFormat,
3739
bundleCapabilities: params.bundleCapabilities,

0 commit comments

Comments
 (0)