openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
32 lines (31 loc) • 1.5 kB
JavaScript
//#region src/plugins/clawhub-error-codes.ts
/** Stable ClawHub install error codes used by plugin install policy and diagnostics. */
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",
INVALID_GATEWAY_VERSION: "invalid_gateway_version",
UNKNOWN_GATEWAY_VERSION: "unknown_gateway_version",
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",
CLAWHUB_SECURITY_UNAVAILABLE: "clawhub_security_unavailable",
CLAWHUB_DOWNLOAD_BLOCKED: "clawhub_download_blocked"
};
/**
* Detects ClawHub failures caused by a target that is not published, as opposed
* to a broken install. Channel-aware installs use this to widen the selector
* instead of failing when the requested release has no artifact.
*/
function isUnavailableClawHubTarget(result) {
return result.code === CLAWHUB_INSTALL_ERROR_CODE.PACKAGE_NOT_FOUND || result.code === CLAWHUB_INSTALL_ERROR_CODE.VERSION_NOT_FOUND;
}
//#endregion
export { isUnavailableClawHubTarget as n, CLAWHUB_INSTALL_ERROR_CODE as t };