From 57f9a558e4e9ac19cdcb41fff51193be0d8e47ab Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 4 May 2026 03:36:36 -0700 Subject: [PATCH] fix(types): wire plugin package metadata --- src/commands/models/auth-list.ts | 17 +++++++---------- src/plugins/loader-records.ts | 2 ++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/commands/models/auth-list.ts b/src/commands/models/auth-list.ts index 11ef187fea9..907dd5a90d9 100644 --- a/src/commands/models/auth-list.ts +++ b/src/commands/models/auth-list.ts @@ -39,7 +39,7 @@ function resolveTargetAgent( } function formatTimestamp(value: number | undefined): string | undefined { - if (!Number.isFinite(value)) { + if (typeof value !== "number" || !Number.isFinite(value)) { return undefined; } return new Date(value).toISOString(); @@ -56,6 +56,9 @@ function summarizeProfile(params: { profile: AuthProfileCredential; usage?: ProfileUsageStats; }): AuthProfileSummary { + const expiresAt = resolveProfileExpiry(params.profile); + const cooldownUntil = formatTimestamp(params.usage?.cooldownUntil); + const disabledUntil = formatTimestamp(params.usage?.disabledUntil); return { id: params.profileId, provider: normalizeProviderId(params.profile.provider), @@ -67,15 +70,9 @@ function summarizeProfile(params: { }), ...(params.profile.email ? { email: params.profile.email } : {}), ...(params.profile.displayName ? { displayName: params.profile.displayName } : {}), - ...(resolveProfileExpiry(params.profile) - ? { expiresAt: resolveProfileExpiry(params.profile) } - : {}), - ...(formatTimestamp(params.usage?.cooldownUntil) - ? { cooldownUntil: formatTimestamp(params.usage?.cooldownUntil) } - : {}), - ...(formatTimestamp(params.usage?.disabledUntil) - ? { disabledUntil: formatTimestamp(params.usage?.disabledUntil) } - : {}), + ...(expiresAt ? { expiresAt } : {}), + ...(cooldownUntil ? { cooldownUntil } : {}), + ...(disabledUntil ? { disabledUntil } : {}), }; } diff --git a/src/plugins/loader-records.ts b/src/plugins/loader-records.ts index 8b98665276a..373981ec8bd 100644 --- a/src/plugins/loader-records.ts +++ b/src/plugins/loader-records.ts @@ -11,6 +11,7 @@ export function createPluginRecord(params: { name?: string; description?: string; version?: string; + packageName?: string; format?: PluginFormat; bundleFormat?: PluginBundleFormat; bundleCapabilities?: string[]; @@ -32,6 +33,7 @@ export function createPluginRecord(params: { name: params.name ?? params.id, description: params.description, version: params.version, + packageName: params.packageName, format: params.format ?? "openclaw", bundleFormat: params.bundleFormat, bundleCapabilities: params.bundleCapabilities,