mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 17:54:04 +00:00
perf(onboarding): split ClawHub install error codes
This commit is contained in:
@@ -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,
|
||||
|
||||
18
src/plugins/clawhub-error-codes.ts
Normal file
18
src/plugins/clawhub-error-codes.ts
Normal 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];
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user