mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
fix(plugin-sdk): align speech runtime packaging (#89899)
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
parent
5537bc9c4d
commit
de152b1f65
9 changed files with 109 additions and 14 deletions
|
|
@ -25,6 +25,7 @@ import {
|
|||
} from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { formatErrorMessage } from "../src/infra/errors.ts";
|
||||
import { ALWAYS_ALLOWED_RUNTIME_DIR_NAMES } from "../src/plugin-sdk/facade-activation-contract.ts";
|
||||
import { BUNDLED_RUNTIME_SIDECAR_PATHS } from "../src/plugins/runtime-sidecar-paths.ts";
|
||||
import { readBoundedResponseText } from "./lib/bounded-response.ts";
|
||||
import { listBundledPluginPackArtifacts } from "./lib/bundled-plugin-build-entries.mjs";
|
||||
|
|
@ -409,6 +410,7 @@ export function collectInstalledPackageErrors(params: {
|
|||
}
|
||||
|
||||
errors.push(...collectInstalledBundledExtensionManifestErrors(params.packageRoot));
|
||||
errors.push(...collectInstalledAlwaysAllowedRuntimeFacadeErrors(params.packageRoot));
|
||||
errors.push(...collectInstalledContextEngineRuntimeErrors(params.packageRoot));
|
||||
errors.push(...collectInstalledPluginSdkZodArtifactErrors(params.packageRoot));
|
||||
errors.push(...collectInstalledPluginSdkDeclarationErrors(params.packageRoot));
|
||||
|
|
@ -417,6 +419,25 @@ export function collectInstalledPackageErrors(params: {
|
|||
return errors;
|
||||
}
|
||||
|
||||
export function collectInstalledAlwaysAllowedRuntimeFacadeErrors(packageRoot: string): string[] {
|
||||
const errors: string[] = [];
|
||||
const activationRuntimePath = "dist/facade-activation-check.runtime.js";
|
||||
if (!existsSync(join(packageRoot, activationRuntimePath))) {
|
||||
errors.push(
|
||||
`installed package is missing required facade activation runtime: ${activationRuntimePath}`,
|
||||
);
|
||||
}
|
||||
for (const dirName of ALWAYS_ALLOWED_RUNTIME_DIR_NAMES) {
|
||||
const relativePath = `dist/extensions/${dirName}/runtime-api.js`;
|
||||
if (!existsSync(join(packageRoot, relativePath))) {
|
||||
errors.push(
|
||||
`installed package allows bundled runtime facade ${dirName}/runtime-api.js but is missing required runtime sidecar: ${relativePath}.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
function collectInstalledBundledExtensionIds(packageRoot: string): Set<string> {
|
||||
const extensionsDir = join(packageRoot, "dist", "extensions");
|
||||
if (!existsSync(extensionsDir)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue