Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
12
extensions/arcee/README.md
Normal file
12
extensions/arcee/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# OpenClaw Arcee AI Provider
|
||||
|
||||
Official OpenClaw provider plugin for Arcee AI.
|
||||
|
||||
Install from OpenClaw:
|
||||
|
||||
```bash
|
||||
openclaw plugins install @openclaw/arcee-provider
|
||||
openclaw gateway restart
|
||||
```
|
||||
|
||||
See <https://docs.openclaw.ai/providers/arcee> for setup and configuration.
|
||||
12
extensions/arcee/api.ts
Normal file
12
extensions/arcee/api.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Public Arcee API barrel. It exposes model catalogs, provider config builders,
|
||||
* and setup helpers without importing the plugin entry.
|
||||
*/
|
||||
export { buildArceeModelDefinition, ARCEE_BASE_URL, ARCEE_MODEL_CATALOG } from "./models.js";
|
||||
export { buildArceeProvider, buildArceeOpenRouterProvider } from "./provider-catalog.js";
|
||||
export {
|
||||
applyArceeConfig,
|
||||
applyArceeOpenRouterConfig,
|
||||
ARCEE_DEFAULT_MODEL_REF,
|
||||
ARCEE_OPENROUTER_DEFAULT_MODEL_REF,
|
||||
} from "./onboard.js";
|
||||
196
extensions/arcee/index.test.ts
Normal file
196
extensions/arcee/index.test.ts
Normal file
@@ -0,0 +1,196 @@
|
||||
// Arcee tests cover index plugin behavior.
|
||||
import {
|
||||
registerSingleProviderPlugin,
|
||||
resolveProviderPluginChoice,
|
||||
} from "openclaw/plugin-sdk/plugin-test-runtime";
|
||||
import { resolveProviderAuthEnvVarCandidates } from "openclaw/plugin-sdk/provider-env-vars";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { runSingleProviderCatalog } from "../test-support/provider-model-test-helpers.js";
|
||||
import arceePlugin from "./index.js";
|
||||
|
||||
describe("arcee provider plugin", () => {
|
||||
it("registers Arcee AI with direct and OpenRouter auth choices", async () => {
|
||||
const provider = await registerSingleProviderPlugin(arceePlugin);
|
||||
|
||||
expect(provider.id).toBe("arcee");
|
||||
expect(provider.label).toBe("Arcee AI");
|
||||
expect(provider.envVars).toEqual(["ARCEEAI_API_KEY", "OPENROUTER_API_KEY"]);
|
||||
expect(provider.auth).toHaveLength(2);
|
||||
|
||||
const directChoice = resolveProviderPluginChoice({
|
||||
providers: [provider],
|
||||
choice: "arceeai-api-key",
|
||||
});
|
||||
if (!directChoice) {
|
||||
throw new Error("expected direct Arcee auth choice");
|
||||
}
|
||||
expect(directChoice.provider.id).toBe("arcee");
|
||||
expect(directChoice.method.id).toBe("arcee-platform");
|
||||
|
||||
const orChoice = resolveProviderPluginChoice({
|
||||
providers: [provider],
|
||||
choice: "arceeai-openrouter",
|
||||
});
|
||||
if (!orChoice) {
|
||||
throw new Error("expected OpenRouter Arcee auth choice");
|
||||
}
|
||||
expect(orChoice.provider.id).toBe("arcee");
|
||||
expect(orChoice.method.id).toBe("openrouter");
|
||||
});
|
||||
|
||||
it("stores the OpenRouter onboarding path under the OpenRouter auth profile", async () => {
|
||||
const provider = await registerSingleProviderPlugin(arceePlugin);
|
||||
const openRouterMethod = provider.auth?.find((method) => method.id === "openrouter");
|
||||
if (!openRouterMethod?.runNonInteractive) {
|
||||
throw new Error("expected OpenRouter non-interactive auth");
|
||||
}
|
||||
|
||||
const config = await openRouterMethod.runNonInteractive({
|
||||
config: {},
|
||||
opts: {},
|
||||
env: {},
|
||||
runtime: {
|
||||
error: () => {},
|
||||
exit: () => {},
|
||||
log: () => {},
|
||||
},
|
||||
resolveApiKey: async () => ({
|
||||
key: "sk-or-test",
|
||||
source: "profile",
|
||||
}),
|
||||
toApiKeyCredential: () => null,
|
||||
} as never);
|
||||
|
||||
const openRouterProfile = config?.auth?.profiles?.["openrouter:default"];
|
||||
expect(openRouterProfile?.provider).toBe("openrouter");
|
||||
expect(openRouterProfile?.mode).toBe("api_key");
|
||||
const arceeConfig = config?.models?.providers?.arcee;
|
||||
expect(arceeConfig?.baseUrl).toBe("https://openrouter.ai/api/v1");
|
||||
expect(arceeConfig?.api).toBe("openai-completions");
|
||||
expect(config?.models?.providers?.arcee?.models?.map((model) => model.id)).toEqual([
|
||||
"arcee/trinity-mini",
|
||||
"arcee/trinity-large-preview",
|
||||
"arcee/trinity-large-thinking",
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps direct Arcee auth env candidates separate from OpenRouter", () => {
|
||||
const candidates = resolveProviderAuthEnvVarCandidates();
|
||||
|
||||
expect(candidates.arcee).toEqual(["ARCEEAI_API_KEY"]);
|
||||
expect(candidates.openrouter).toEqual(["OPENROUTER_API_KEY"]);
|
||||
});
|
||||
|
||||
it("builds the direct Arcee AI model catalog", async () => {
|
||||
const provider = await registerSingleProviderPlugin(arceePlugin);
|
||||
const catalogProvider = await runSingleProviderCatalog(provider, {
|
||||
resolveProviderApiKey: (id?: string) =>
|
||||
id === "arcee" ? { apiKey: "test-key" } : { apiKey: undefined },
|
||||
});
|
||||
|
||||
expect(catalogProvider.api).toBe("openai-completions");
|
||||
expect(catalogProvider.baseUrl).toBe("https://api.arcee.ai/api/v1");
|
||||
expect(catalogProvider.models?.map((model) => model.id)).toEqual([
|
||||
"trinity-mini",
|
||||
"trinity-large-preview",
|
||||
"trinity-large-thinking",
|
||||
]);
|
||||
const thinkingCompat = catalogProvider.models?.find(
|
||||
(model) => model.id === "trinity-large-thinking",
|
||||
)?.compat;
|
||||
expect(thinkingCompat?.supportsTools).toBe(false);
|
||||
expect(thinkingCompat?.supportsReasoningEffort).toBe(false);
|
||||
});
|
||||
|
||||
it("builds the OpenRouter-backed Arcee AI model catalog", async () => {
|
||||
const provider = await registerSingleProviderPlugin(arceePlugin);
|
||||
const catalogProvider = await runSingleProviderCatalog(provider, {
|
||||
resolveProviderApiKey: (id?: string) =>
|
||||
id === "openrouter" ? { apiKey: "sk-or-test" } : { apiKey: undefined },
|
||||
resolveProviderAuth: () => ({
|
||||
apiKey: "sk-or-test",
|
||||
mode: "api_key",
|
||||
source: "env",
|
||||
}),
|
||||
});
|
||||
|
||||
expect(catalogProvider.baseUrl).toBe("https://openrouter.ai/api/v1");
|
||||
expect(catalogProvider.models?.map((model) => model.id)).toEqual([
|
||||
"arcee/trinity-mini",
|
||||
"arcee/trinity-large-preview",
|
||||
"arcee/trinity-large-thinking",
|
||||
]);
|
||||
const thinkingCompat = catalogProvider.models?.find(
|
||||
(model) => model.id === "arcee/trinity-large-thinking",
|
||||
)?.compat;
|
||||
expect(thinkingCompat?.supportsTools).toBe(false);
|
||||
expect(thinkingCompat?.supportsReasoningEffort).toBe(false);
|
||||
});
|
||||
|
||||
it("normalizes Arcee OpenRouter models to vendor-prefixed runtime ids", async () => {
|
||||
const provider = await registerSingleProviderPlugin(arceePlugin);
|
||||
|
||||
const openRouterModel = provider.normalizeResolvedModel?.({
|
||||
modelId: "arcee/trinity-large-thinking",
|
||||
model: {
|
||||
provider: "arcee",
|
||||
id: "trinity-large-thinking",
|
||||
name: "Trinity Large Thinking",
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
},
|
||||
} as never);
|
||||
expect(openRouterModel?.id).toBe("arcee/trinity-large-thinking");
|
||||
|
||||
expect(
|
||||
provider.normalizeResolvedModel?.({
|
||||
modelId: "arcee/trinity-large-thinking",
|
||||
model: {
|
||||
provider: "arcee",
|
||||
id: "trinity-large-thinking",
|
||||
name: "Trinity Large Thinking",
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://api.arcee.ai/api/v1",
|
||||
},
|
||||
} as never),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("canonicalizes stale OpenRouter /v1 config and transport metadata", async () => {
|
||||
const provider = await registerSingleProviderPlugin(arceePlugin);
|
||||
|
||||
const normalizedConfig = provider.normalizeConfig?.({
|
||||
provider: "arcee",
|
||||
providerConfig: {
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://openrouter.ai/v1/",
|
||||
models: [],
|
||||
},
|
||||
} as never);
|
||||
expect(normalizedConfig?.baseUrl).toBe("https://openrouter.ai/api/v1");
|
||||
|
||||
const normalizedModel = provider.normalizeResolvedModel?.({
|
||||
modelId: "arcee/trinity-large-thinking",
|
||||
model: {
|
||||
provider: "arcee",
|
||||
id: "trinity-large-thinking",
|
||||
name: "Trinity Large Thinking",
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://openrouter.ai/v1",
|
||||
},
|
||||
} as never);
|
||||
expect(normalizedModel?.id).toBe("arcee/trinity-large-thinking");
|
||||
expect(normalizedModel?.baseUrl).toBe("https://openrouter.ai/api/v1");
|
||||
|
||||
expect(
|
||||
provider.normalizeTransport?.({
|
||||
provider: "arcee",
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://openrouter.ai/v1",
|
||||
} as never),
|
||||
).toEqual({
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://openrouter.ai/api/v1",
|
||||
});
|
||||
});
|
||||
});
|
||||
147
extensions/arcee/index.ts
Normal file
147
extensions/arcee/index.ts
Normal file
@@ -0,0 +1,147 @@
|
||||
/**
|
||||
* Arcee AI provider plugin entry. It supports direct Arcee auth and OpenRouter
|
||||
* routing while normalizing OpenRouter model ids and base URLs.
|
||||
*/
|
||||
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
||||
import {
|
||||
readConfiguredProviderCatalogEntries,
|
||||
type ProviderCatalogContext,
|
||||
} from "openclaw/plugin-sdk/provider-catalog-shared";
|
||||
import { OPENAI_COMPATIBLE_REPLAY_HOOKS } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import {
|
||||
applyArceeConfig,
|
||||
applyArceeOpenRouterConfig,
|
||||
ARCEE_DEFAULT_MODEL_REF,
|
||||
ARCEE_OPENROUTER_DEFAULT_MODEL_REF,
|
||||
} from "./onboard.js";
|
||||
import {
|
||||
buildArceeProvider,
|
||||
buildArceeOpenRouterProvider,
|
||||
normalizeArceeOpenRouterBaseUrl,
|
||||
toArceeOpenRouterModelId,
|
||||
} from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "arcee";
|
||||
const ARCEE_WIZARD_GROUP = {
|
||||
groupId: "arcee",
|
||||
groupLabel: "Arcee AI",
|
||||
groupHint: "Direct API or OpenRouter",
|
||||
} as const;
|
||||
|
||||
function buildArceeAuthMethods() {
|
||||
return [
|
||||
createProviderApiKeyAuthMethod({
|
||||
providerId: PROVIDER_ID,
|
||||
methodId: "arcee-platform",
|
||||
label: "Arcee AI API key",
|
||||
hint: "Direct access to Arcee platform",
|
||||
optionKey: "arceeaiApiKey",
|
||||
flagName: "--arceeai-api-key",
|
||||
envVar: "ARCEEAI_API_KEY",
|
||||
promptMessage: "Enter Arcee AI API key",
|
||||
defaultModel: ARCEE_DEFAULT_MODEL_REF,
|
||||
expectedProviders: [PROVIDER_ID],
|
||||
applyConfig: (cfg) => applyArceeConfig(cfg),
|
||||
wizard: {
|
||||
choiceId: "arceeai-api-key",
|
||||
choiceLabel: "Arcee AI API key",
|
||||
choiceHint: "Direct (chat.arcee.ai)",
|
||||
...ARCEE_WIZARD_GROUP,
|
||||
},
|
||||
}),
|
||||
createProviderApiKeyAuthMethod({
|
||||
providerId: PROVIDER_ID,
|
||||
methodId: "openrouter",
|
||||
label: "OpenRouter API key",
|
||||
hint: "Access Arcee models via OpenRouter",
|
||||
optionKey: "openrouterApiKey",
|
||||
flagName: "--openrouter-api-key",
|
||||
envVar: "OPENROUTER_API_KEY",
|
||||
promptMessage: "Enter OpenRouter API key",
|
||||
profileId: "openrouter:default",
|
||||
defaultModel: ARCEE_OPENROUTER_DEFAULT_MODEL_REF,
|
||||
expectedProviders: [PROVIDER_ID, "openrouter"],
|
||||
applyConfig: (cfg) => applyArceeOpenRouterConfig(cfg),
|
||||
wizard: {
|
||||
choiceId: "arceeai-openrouter",
|
||||
choiceLabel: "OpenRouter API key",
|
||||
choiceHint: "Via OpenRouter (openrouter.ai)",
|
||||
...ARCEE_WIZARD_GROUP,
|
||||
},
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
async function resolveArceeCatalog(ctx: ProviderCatalogContext) {
|
||||
const directKey = ctx.resolveProviderApiKey(PROVIDER_ID).apiKey;
|
||||
if (directKey) {
|
||||
return { provider: { ...buildArceeProvider(), apiKey: directKey } };
|
||||
}
|
||||
|
||||
const openRouterKey = ctx.resolveProviderApiKey("openrouter").apiKey;
|
||||
if (openRouterKey) {
|
||||
return { provider: { ...buildArceeOpenRouterProvider(), apiKey: openRouterKey } };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function normalizeArceeResolvedModel<T extends { baseUrl?: string; id: string }>(
|
||||
model: T,
|
||||
): T | undefined {
|
||||
const normalizedBaseUrl = normalizeArceeOpenRouterBaseUrl(model.baseUrl);
|
||||
if (!normalizedBaseUrl) {
|
||||
return undefined;
|
||||
}
|
||||
const normalizedId = toArceeOpenRouterModelId(model.id);
|
||||
if (normalizedId === model.id && normalizedBaseUrl === model.baseUrl) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
...model,
|
||||
id: normalizedId,
|
||||
baseUrl: normalizedBaseUrl,
|
||||
};
|
||||
}
|
||||
|
||||
/** Provider entry for Arcee direct and OpenRouter-backed models. */
|
||||
export default definePluginEntry({
|
||||
id: PROVIDER_ID,
|
||||
name: "Arcee AI Provider",
|
||||
description: "Bundled Arcee AI provider plugin",
|
||||
register(api) {
|
||||
api.registerProvider({
|
||||
id: PROVIDER_ID,
|
||||
label: "Arcee AI",
|
||||
docsPath: "/providers/arcee",
|
||||
envVars: ["ARCEEAI_API_KEY", "OPENROUTER_API_KEY"],
|
||||
auth: buildArceeAuthMethods(),
|
||||
catalog: {
|
||||
run: resolveArceeCatalog,
|
||||
},
|
||||
augmentModelCatalog: ({ config }) =>
|
||||
readConfiguredProviderCatalogEntries({
|
||||
config,
|
||||
providerId: PROVIDER_ID,
|
||||
}),
|
||||
normalizeConfig: ({ providerConfig }) => {
|
||||
const normalizedBaseUrl = normalizeArceeOpenRouterBaseUrl(providerConfig.baseUrl);
|
||||
return normalizedBaseUrl && normalizedBaseUrl !== providerConfig.baseUrl
|
||||
? { ...providerConfig, baseUrl: normalizedBaseUrl }
|
||||
: undefined;
|
||||
},
|
||||
normalizeResolvedModel: ({ model }) => normalizeArceeResolvedModel(model),
|
||||
normalizeTransport: ({ api: apiLocal, baseUrl }) => {
|
||||
const normalizedBaseUrl = normalizeArceeOpenRouterBaseUrl(baseUrl);
|
||||
return normalizedBaseUrl && normalizedBaseUrl !== baseUrl
|
||||
? {
|
||||
api: apiLocal,
|
||||
baseUrl: normalizedBaseUrl,
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
...OPENAI_COMPATIBLE_REPLAY_HOOKS,
|
||||
});
|
||||
},
|
||||
});
|
||||
75
extensions/arcee/models.ts
Normal file
75
extensions/arcee/models.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Arcee model catalog metadata. These definitions back both direct Arcee and
|
||||
* OpenRouter-routed provider catalogs.
|
||||
*/
|
||||
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
|
||||
/** Default direct Arcee API base URL. */
|
||||
export const ARCEE_BASE_URL = "https://api.arcee.ai/api/v1";
|
||||
|
||||
/** Static Arcee model catalog used for provider registration. */
|
||||
export const ARCEE_MODEL_CATALOG: ModelDefinitionConfig[] = [
|
||||
{
|
||||
id: "trinity-mini",
|
||||
name: "Trinity Mini 26B",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
contextWindow: 131072,
|
||||
maxTokens: 80000,
|
||||
cost: {
|
||||
input: 0.045,
|
||||
output: 0.15,
|
||||
cacheRead: 0.045,
|
||||
cacheWrite: 0.045,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "trinity-large-preview",
|
||||
name: "Trinity Large Preview",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
contextWindow: 131072,
|
||||
maxTokens: 16384,
|
||||
cost: {
|
||||
input: 0.25,
|
||||
output: 1,
|
||||
cacheRead: 0.25,
|
||||
cacheWrite: 0.25,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "trinity-large-thinking",
|
||||
name: "Trinity Large Thinking",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
contextWindow: 262144,
|
||||
maxTokens: 80000,
|
||||
cost: {
|
||||
input: 0.25,
|
||||
output: 0.9,
|
||||
cacheRead: 0.25,
|
||||
cacheWrite: 0.25,
|
||||
},
|
||||
compat: {
|
||||
supportsTools: false,
|
||||
supportsReasoningEffort: false,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
/** Build one OpenAI-compatible Arcee model definition. */
|
||||
export function buildArceeModelDefinition(
|
||||
model: (typeof ARCEE_MODEL_CATALOG)[number],
|
||||
): ModelDefinitionConfig {
|
||||
return {
|
||||
id: model.id,
|
||||
name: model.name,
|
||||
api: "openai-completions",
|
||||
reasoning: model.reasoning,
|
||||
input: model.input,
|
||||
cost: model.cost,
|
||||
contextWindow: model.contextWindow,
|
||||
maxTokens: model.maxTokens,
|
||||
...(model.compat ? { compat: model.compat } : {}),
|
||||
};
|
||||
}
|
||||
12
extensions/arcee/npm-shrinkwrap.json
generated
Normal file
12
extensions/arcee/npm-shrinkwrap.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@openclaw/arcee-provider",
|
||||
"version": "2026.6.11",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@openclaw/arcee-provider",
|
||||
"version": "2026.6.11"
|
||||
}
|
||||
}
|
||||
}
|
||||
51
extensions/arcee/onboard.ts
Normal file
51
extensions/arcee/onboard.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Arcee setup preset appliers. They seed model catalog defaults for direct
|
||||
* Arcee API usage and the OpenRouter-backed path.
|
||||
*/
|
||||
import {
|
||||
createModelCatalogPresetAppliers,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/provider-onboard";
|
||||
import { ARCEE_BASE_URL } from "./models.js";
|
||||
import {
|
||||
buildArceeCatalogModels,
|
||||
buildArceeOpenRouterCatalogModels,
|
||||
OPENROUTER_BASE_URL,
|
||||
} from "./provider-catalog.js";
|
||||
|
||||
/** Default Arcee model ref for direct API setup. */
|
||||
export const ARCEE_DEFAULT_MODEL_REF = "arcee/trinity-large-thinking";
|
||||
/** Default Arcee model ref for OpenRouter setup. */
|
||||
export const ARCEE_OPENROUTER_DEFAULT_MODEL_REF = "arcee/trinity-large-thinking";
|
||||
|
||||
const arceePresetAppliers = createModelCatalogPresetAppliers({
|
||||
primaryModelRef: ARCEE_DEFAULT_MODEL_REF,
|
||||
resolveParams: (_cfg: OpenClawConfig) => ({
|
||||
providerId: "arcee",
|
||||
api: "openai-completions",
|
||||
baseUrl: ARCEE_BASE_URL,
|
||||
catalogModels: buildArceeCatalogModels(),
|
||||
aliases: [{ modelRef: ARCEE_DEFAULT_MODEL_REF, alias: "Arcee AI" }],
|
||||
}),
|
||||
});
|
||||
|
||||
const arceeOpenRouterPresetAppliers = createModelCatalogPresetAppliers({
|
||||
primaryModelRef: ARCEE_OPENROUTER_DEFAULT_MODEL_REF,
|
||||
resolveParams: (_cfg: OpenClawConfig) => ({
|
||||
providerId: "arcee",
|
||||
api: "openai-completions",
|
||||
baseUrl: OPENROUTER_BASE_URL,
|
||||
catalogModels: buildArceeOpenRouterCatalogModels(),
|
||||
aliases: [{ modelRef: ARCEE_OPENROUTER_DEFAULT_MODEL_REF, alias: "Arcee AI (OpenRouter)" }],
|
||||
}),
|
||||
});
|
||||
|
||||
/** Apply direct Arcee provider defaults to config. */
|
||||
export function applyArceeConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
return arceePresetAppliers.applyConfig(cfg);
|
||||
}
|
||||
|
||||
/** Apply OpenRouter-backed Arcee provider defaults to config. */
|
||||
export function applyArceeOpenRouterConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
return arceeOpenRouterPresetAppliers.applyConfig(cfg);
|
||||
}
|
||||
51
extensions/arcee/openclaw.plugin.json
Normal file
51
extensions/arcee/openclaw.plugin.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"id": "arcee",
|
||||
"activation": {
|
||||
"onStartup": false
|
||||
},
|
||||
"enabledByDefault": true,
|
||||
"providers": ["arcee"],
|
||||
"setup": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "arcee",
|
||||
"envVars": ["ARCEEAI_API_KEY"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"providerAuthChoices": [
|
||||
{
|
||||
"provider": "arcee",
|
||||
"method": "arcee-platform",
|
||||
"choiceId": "arceeai-api-key",
|
||||
"choiceLabel": "Arcee AI API key",
|
||||
"choiceHint": "Direct (chat.arcee.ai)",
|
||||
"groupId": "arcee",
|
||||
"groupLabel": "Arcee AI",
|
||||
"groupHint": "Direct API or OpenRouter",
|
||||
"optionKey": "arceeaiApiKey",
|
||||
"cliFlag": "--arceeai-api-key",
|
||||
"cliOption": "--arceeai-api-key <key>",
|
||||
"cliDescription": "Arcee AI API key"
|
||||
},
|
||||
{
|
||||
"provider": "arcee",
|
||||
"method": "openrouter",
|
||||
"choiceId": "arceeai-openrouter",
|
||||
"choiceLabel": "OpenRouter API key",
|
||||
"choiceHint": "Via OpenRouter (openrouter.ai)",
|
||||
"groupId": "arcee",
|
||||
"groupLabel": "Arcee AI",
|
||||
"groupHint": "Direct API or OpenRouter",
|
||||
"optionKey": "openrouterApiKey",
|
||||
"cliFlag": "--openrouter-api-key",
|
||||
"cliOption": "--openrouter-api-key <key>",
|
||||
"cliDescription": "OpenRouter API key for Arcee AI models"
|
||||
}
|
||||
],
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {}
|
||||
}
|
||||
}
|
||||
35
extensions/arcee/package.json
Normal file
35
extensions/arcee/package.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@openclaw/arcee-provider",
|
||||
"version": "2026.6.11",
|
||||
"description": "OpenClaw Arcee provider plugin.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/openclaw/openclaw"
|
||||
},
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@openclaw/plugin-sdk": "workspace:*"
|
||||
},
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
"./index.ts"
|
||||
],
|
||||
"install": {
|
||||
"clawhubSpec": "clawhub:@openclaw/arcee-provider",
|
||||
"npmSpec": "@openclaw/arcee-provider",
|
||||
"defaultChoice": "npm",
|
||||
"minHostVersion": ">=2026.6.8"
|
||||
},
|
||||
"compat": {
|
||||
"pluginApi": ">=2026.6.11"
|
||||
},
|
||||
"build": {
|
||||
"openclawVersion": "2026.6.11",
|
||||
"bundledDist": false
|
||||
},
|
||||
"release": {
|
||||
"publishToClawHub": true,
|
||||
"publishToNpm": true
|
||||
}
|
||||
}
|
||||
}
|
||||
65
extensions/arcee/provider-catalog.ts
Normal file
65
extensions/arcee/provider-catalog.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Arcee provider catalog builders. Direct Arcee uses native ids; OpenRouter
|
||||
* catalogs normalize ids to the `arcee/*` namespace.
|
||||
*/
|
||||
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import { buildArceeModelDefinition, ARCEE_BASE_URL, ARCEE_MODEL_CATALOG } from "./models.js";
|
||||
|
||||
/** Canonical OpenRouter API base URL for Arcee-routed models. */
|
||||
export const OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
|
||||
const OPENROUTER_LEGACY_BASE_URL = "https://openrouter.ai/v1";
|
||||
|
||||
function normalizeBaseUrl(baseUrl: string | undefined): string {
|
||||
return (baseUrl ?? "").trim().replace(/\/+$/, "");
|
||||
}
|
||||
|
||||
/** Normalize OpenRouter base URLs accepted for Arcee model routing. */
|
||||
export function normalizeArceeOpenRouterBaseUrl(baseUrl: string | undefined): string | undefined {
|
||||
const normalized = normalizeBaseUrl(baseUrl);
|
||||
if (!normalized) {
|
||||
return undefined;
|
||||
}
|
||||
if (normalized === OPENROUTER_BASE_URL || normalized === OPENROUTER_LEGACY_BASE_URL) {
|
||||
return OPENROUTER_BASE_URL;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/** Convert a bare Arcee model id to the OpenRouter `arcee/*` id. */
|
||||
export function toArceeOpenRouterModelId(modelId: string): string {
|
||||
const normalized = modelId.trim();
|
||||
if (!normalized || normalized.startsWith("arcee/")) {
|
||||
return normalized;
|
||||
}
|
||||
return `arcee/${normalized}`;
|
||||
}
|
||||
|
||||
/** Build direct Arcee catalog models. */
|
||||
export function buildArceeCatalogModels(): NonNullable<ModelProviderConfig["models"]> {
|
||||
return ARCEE_MODEL_CATALOG.map(buildArceeModelDefinition);
|
||||
}
|
||||
|
||||
/** Build OpenRouter-routed Arcee catalog models. */
|
||||
export function buildArceeOpenRouterCatalogModels(): NonNullable<ModelProviderConfig["models"]> {
|
||||
return buildArceeCatalogModels().map((model) =>
|
||||
Object.assign({}, model, { id: toArceeOpenRouterModelId(model.id) }),
|
||||
);
|
||||
}
|
||||
|
||||
/** Build the direct Arcee provider config. */
|
||||
export function buildArceeProvider(): ModelProviderConfig {
|
||||
return {
|
||||
baseUrl: ARCEE_BASE_URL,
|
||||
api: "openai-completions",
|
||||
models: buildArceeCatalogModels(),
|
||||
};
|
||||
}
|
||||
|
||||
/** Build the OpenRouter-backed Arcee provider config. */
|
||||
export function buildArceeOpenRouterProvider(): ModelProviderConfig {
|
||||
return {
|
||||
baseUrl: OPENROUTER_BASE_URL,
|
||||
api: "openai-completions",
|
||||
models: buildArceeOpenRouterCatalogModels(),
|
||||
};
|
||||
}
|
||||
16
extensions/arcee/tsconfig.json
Normal file
16
extensions/arcee/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "../tsconfig.package-boundary.base.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": ["./*.ts", "./src/**/*.ts"],
|
||||
"exclude": [
|
||||
"./**/*.test.ts",
|
||||
"./dist/**",
|
||||
"./node_modules/**",
|
||||
"./src/test-support/**",
|
||||
"./src/**/*test-helpers.ts",
|
||||
"./src/**/*test-harness.ts",
|
||||
"./src/**/*test-support.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user