Add OpenCode provider integration and strict model selection

This commit is contained in:
Konan69
2026-03-05 15:24:20 +01:00
parent c7c96feef7
commit 6a101e0da1
55 changed files with 2225 additions and 104 deletions

View File

@@ -1154,8 +1154,12 @@ function ConfigurationTab({
const queryClient = useQueryClient();
const { data: adapterModels } = useQuery({
queryKey: ["adapter-models", agent.adapterType],
queryFn: () => agentsApi.adapterModels(agent.adapterType),
queryKey:
companyId
? queryKeys.agents.adapterModels(companyId, agent.adapterType)
: ["agents", "none", "adapter-models", agent.adapterType],
queryFn: () => agentsApi.adapterModels(companyId!, agent.adapterType),
enabled: Boolean(companyId),
});
const updateAgent = useMutation({

View File

@@ -23,6 +23,7 @@ import type { Agent } from "@paperclipai/shared";
const adapterLabels: Record<string, string> = {
claude_local: "Claude",
codex_local: "Codex",
opencode_local: "OpenCode",
openclaw: "OpenClaw",
process: "Process",
http: "HTTP",

View File

@@ -18,13 +18,14 @@ const joinAdapterOptions: AgentAdapterType[] = [
const adapterLabels: Record<string, string> = {
claude_local: "Claude (local)",
codex_local: "Codex (local)",
opencode_local: "OpenCode (local)",
openclaw: "OpenClaw",
cursor: "Cursor",
process: "Process",
http: "HTTP",
};
const ENABLED_INVITE_ADAPTERS = new Set(["claude_local", "codex_local"]);
const ENABLED_INVITE_ADAPTERS = new Set(["claude_local", "codex_local", "opencode_local"]);
function dateTime(value: string) {
return new Date(value).toLocaleString();

View File

@@ -118,6 +118,7 @@ function collectEdges(nodes: LayoutNode[]): Array<{ parent: LayoutNode; child: L
const adapterLabels: Record<string, string> = {
claude_local: "Claude",
codex_local: "Codex",
opencode_local: "OpenCode",
openclaw: "OpenClaw",
process: "Process",
http: "HTTP",