mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 22:32:51 +00:00
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import { modelSelectionShouldEnsureCopilotRuntimePlugin } from "../agents/copilot-routing.js";
|
|
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
import {
|
|
createRuntimePluginModelSelectionHelpers,
|
|
type RuntimePluginInstallResult,
|
|
} from "./runtime-plugin-install.js";
|
|
|
|
export const COPILOT_RUNTIME_PLUGIN_ID = "copilot";
|
|
const COPILOT_RUNTIME_PLUGIN_LABEL = "GitHub Copilot agent runtime";
|
|
const COPILOT_RUNTIME_PLUGIN_NPM_SPEC = "@openclaw/copilot";
|
|
const COPILOT_RUNTIME_PLUGIN_DESCRIPTOR = {
|
|
pluginId: COPILOT_RUNTIME_PLUGIN_ID,
|
|
label: COPILOT_RUNTIME_PLUGIN_LABEL,
|
|
npmSpec: COPILOT_RUNTIME_PLUGIN_NPM_SPEC,
|
|
warningLabel: "GitHub Copilot",
|
|
};
|
|
|
|
export type CopilotRuntimePluginInstallResult = RuntimePluginInstallResult;
|
|
|
|
export function selectedModelShouldEnsureCopilotRuntimePlugin(params: {
|
|
cfg: OpenClawConfig;
|
|
model?: string;
|
|
}): boolean {
|
|
return modelSelectionShouldEnsureCopilotRuntimePlugin({
|
|
config: params.cfg,
|
|
model: params.model,
|
|
});
|
|
}
|
|
|
|
const copilotRuntimePluginInstall = createRuntimePluginModelSelectionHelpers({
|
|
descriptor: COPILOT_RUNTIME_PLUGIN_DESCRIPTOR,
|
|
shouldEnsure: selectedModelShouldEnsureCopilotRuntimePlugin,
|
|
});
|
|
|
|
export const ensureCopilotRuntimePluginForModelSelection = copilotRuntimePluginInstall.ensure;
|
|
export const repairCopilotRuntimePluginInstallForModelSelection =
|
|
copilotRuntimePluginInstall.repair;
|