perf(onboarding): split ClawHub install error codes

This commit is contained in:
Vincent Koc
2026-05-30 01:08:55 +02:00
parent c6b4daf426
commit 2cfae61743
3 changed files with 22 additions and 19 deletions

View File

@@ -11,8 +11,8 @@ import {
findBundledPluginSourceInMap,
resolveBundledPluginSources,
} from "../plugins/bundled-sources.js";
import { CLAWHUB_INSTALL_ERROR_CODE } from "../plugins/clawhub-error-codes.js";
import { buildClawHubPluginInstallRecordFields } from "../plugins/clawhub-install-records.js";
import { CLAWHUB_INSTALL_ERROR_CODE } from "../plugins/clawhub.js";
import { enablePluginInConfig, type PluginEnableResult } from "../plugins/enable.js";
import {
resolveClawHubInstallSpecsForUpdateChannel,

View File

@@ -0,0 +1,18 @@
export const CLAWHUB_INSTALL_ERROR_CODE = {
INVALID_SPEC: "invalid_spec",
PACKAGE_NOT_FOUND: "package_not_found",
VERSION_NOT_FOUND: "version_not_found",
NO_INSTALLABLE_VERSION: "no_installable_version",
SKILL_PACKAGE: "skill_package",
UNSUPPORTED_FAMILY: "unsupported_family",
PRIVATE_PACKAGE: "private_package",
INCOMPATIBLE_PLUGIN_API: "incompatible_plugin_api",
INCOMPATIBLE_GATEWAY: "incompatible_gateway",
ARTIFACT_UNAVAILABLE: "artifact_unavailable",
MISSING_ARCHIVE_INTEGRITY: "missing_archive_integrity",
ARTIFACT_DOWNLOAD_UNAVAILABLE: "artifact_download_unavailable",
ARCHIVE_INTEGRITY_MISMATCH: "archive_integrity_mismatch",
} as const;
export type ClawHubInstallErrorCode =
(typeof CLAWHUB_INSTALL_ERROR_CODE)[keyof typeof CLAWHUB_INSTALL_ERROR_CODE];

View File

@@ -34,28 +34,13 @@ import { formatErrorMessage } from "../infra/errors.js";
import { normalizeOptionalString } from "../shared/string-coerce.js";
import { resolveCompatibilityHostVersion } from "../version.js";
import type { RuntimeVersionEnv } from "../version.js";
import { CLAWHUB_INSTALL_ERROR_CODE, type ClawHubInstallErrorCode } from "./clawhub-error-codes.js";
import type { ClawHubPluginInstallRecordFields } from "./clawhub-install-records.js";
import type { InstallSafetyOverrides } from "./install-security-scan.js";
import { installPluginFromArchive, type InstallPluginResult } from "./install.js";
export const CLAWHUB_INSTALL_ERROR_CODE = {
INVALID_SPEC: "invalid_spec",
PACKAGE_NOT_FOUND: "package_not_found",
VERSION_NOT_FOUND: "version_not_found",
NO_INSTALLABLE_VERSION: "no_installable_version",
SKILL_PACKAGE: "skill_package",
UNSUPPORTED_FAMILY: "unsupported_family",
PRIVATE_PACKAGE: "private_package",
INCOMPATIBLE_PLUGIN_API: "incompatible_plugin_api",
INCOMPATIBLE_GATEWAY: "incompatible_gateway",
ARTIFACT_UNAVAILABLE: "artifact_unavailable",
MISSING_ARCHIVE_INTEGRITY: "missing_archive_integrity",
ARTIFACT_DOWNLOAD_UNAVAILABLE: "artifact_download_unavailable",
ARCHIVE_INTEGRITY_MISMATCH: "archive_integrity_mismatch",
} as const;
export type ClawHubInstallErrorCode =
(typeof CLAWHUB_INSTALL_ERROR_CODE)[keyof typeof CLAWHUB_INSTALL_ERROR_CODE];
export { CLAWHUB_INSTALL_ERROR_CODE };
export type { ClawHubInstallErrorCode };
type PluginInstallLogger = {
info?: (message: string) => void;