From 2fbdbe1dd14028887d24734103649335fb635881 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Fri, 12 Dec 2025 16:44:00 -0500 Subject: [PATCH] sync --- packages/opencode/src/agent/agent.ts | 19 ++++++++------- packages/opencode/src/cli/cmd/agent.ts | 4 ++-- .../cli/cmd/tui/component/dialog-agent.tsx | 2 +- .../cmd/tui/component/prompt/autocomplete.tsx | 2 +- .../src/cli/cmd/tui/context/local.tsx | 2 +- packages/sdk/js/src/v2/gen/sdk.gen.ts | 8 +++---- packages/sdk/js/src/v2/gen/types.gen.ts | 24 ++++++++++--------- 7 files changed, 33 insertions(+), 28 deletions(-) diff --git a/packages/opencode/src/agent/agent.ts b/packages/opencode/src/agent/agent.ts index 0739dd2ad6..8da8da7306 100644 --- a/packages/opencode/src/agent/agent.ts +++ b/packages/opencode/src/agent/agent.ts @@ -15,7 +15,8 @@ export namespace Agent { name: z.string(), description: z.string().optional(), mode: z.enum(["subagent", "primary", "all"]), - internal: z.boolean(), + native: z.boolean().optional(), + hidden: z.boolean().optional(), topP: z.number().optional(), temperature: z.number().optional(), color: z.string().optional(), @@ -114,7 +115,8 @@ export namespace Agent { options: {}, permission: agentPermission, mode: "subagent", - internal: true, + native: true, + hidden: true, }, explore: { name: "explore", @@ -149,12 +151,13 @@ export namespace Agent { options: {}, permission: agentPermission, mode: "subagent", - internal: true, + native: true, }, compaction: { name: "compaction", mode: "primary", - internal: true, + native: true, + hidden: true, prompt: PROMPT_COMPACTION, tools: { "*": false, @@ -168,13 +171,13 @@ export namespace Agent { options: {}, permission: agentPermission, mode: "primary", - internal: true, + native: true, }, summary: { name: "summary", mode: "subagent", options: {}, - internal: true, + native: true, permission: agentPermission, prompt: `You are a title generator. You output ONLY a thread title. Nothing else. @@ -223,7 +226,7 @@ Your output must be: ...defaultTools, }, mode: "primary", - internal: true, + native: true, }, } for (const [key, value] of Object.entries(cfg.agent ?? {})) { @@ -239,7 +242,7 @@ Your output must be: permission: agentPermission, options: {}, tools: {}, - internal: false, + native: false, } const { name, diff --git a/packages/opencode/src/cli/cmd/agent.ts b/packages/opencode/src/cli/cmd/agent.ts index a1b29f9e98..2cbcfbfe94 100644 --- a/packages/opencode/src/cli/cmd/agent.ts +++ b/packages/opencode/src/cli/cmd/agent.ts @@ -227,8 +227,8 @@ const AgentListCommand = cmd({ async fn() { const agents = await Agent.list() const sortedAgents = agents.sort((a, b) => { - if (a.internal !== b.internal) { - return a.internal ? -1 : 1 + if (a.native !== b.native) { + return a.native ? -1 : 1 } return a.name.localeCompare(b.name) }) diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx index 65aaeb22bf..97f0c0ad95 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx @@ -12,7 +12,7 @@ export function DialogAgent() { return { value: item.name, title: item.name, - description: item.builtIn ? "native" : item.description, + description: item.internal ? "native" : item.description, } }), ) diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx index c40aa114ac..37e6ccda5d 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx @@ -184,7 +184,7 @@ export function Autocomplete(props: { const agents = createMemo(() => { const agents = sync.data.agent return agents - .filter((agent) => !agent.builtIn && agent.mode !== "primary") + .filter((agent) => !agent.hidden && agent.mode !== "primary") .map( (agent): AutocompleteOption => ({ display: "@" + agent.name, diff --git a/packages/opencode/src/cli/cmd/tui/context/local.tsx b/packages/opencode/src/cli/cmd/tui/context/local.tsx index 6cc97e0416..f04b79685c 100644 --- a/packages/opencode/src/cli/cmd/tui/context/local.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/local.tsx @@ -52,7 +52,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ }) const agent = iife(() => { - const agents = createMemo(() => sync.data.agent.filter((x) => x.mode !== "subagent")) + const agents = createMemo(() => sync.data.agent.filter((x) => x.mode !== "subagent" && !x.hidden)) const [agentStore, setAgentStore] = createStore<{ current: string }>({ diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index 90df76c223..16fe07ae4a 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -1203,10 +1203,10 @@ export class Session extends HeyApiClient { } agent?: string noReply?: boolean - system?: string tools?: { [key: string]: boolean } + system?: string parts?: Array }, options?: Options, @@ -1222,8 +1222,8 @@ export class Session extends HeyApiClient { { in: "body", key: "model" }, { in: "body", key: "agent" }, { in: "body", key: "noReply" }, - { in: "body", key: "system" }, { in: "body", key: "tools" }, + { in: "body", key: "system" }, { in: "body", key: "parts" }, ], }, @@ -1289,10 +1289,10 @@ export class Session extends HeyApiClient { } agent?: string noReply?: boolean - system?: string tools?: { [key: string]: boolean } + system?: string parts?: Array }, options?: Options, @@ -1308,8 +1308,8 @@ export class Session extends HeyApiClient { { in: "body", key: "model" }, { in: "body", key: "agent" }, { in: "body", key: "noReply" }, - { in: "body", key: "system" }, { in: "body", key: "tools" }, + { in: "body", key: "system" }, { in: "body", key: "parts" }, ], }, diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index 9d0bbcc92c..148a7b62a0 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -147,6 +147,7 @@ export type AssistantMessage = { modelID: string providerID: string mode: string + agent: string path: { cwd: string root: string @@ -504,13 +505,6 @@ export type EventSessionIdle = { } } -export type EventSessionCompacted = { - type: "session.compacted" - properties: { - sessionID: string - } -} - export type EventFileEdited = { type: "file.edited" properties: { @@ -545,6 +539,13 @@ export type EventTodoUpdated = { } } +export type EventSessionCompacted = { + type: "session.compacted" + properties: { + sessionID: string + } +} + export type EventCommandExecuted = { type: "command.executed" properties: { @@ -747,9 +748,9 @@ export type Event = | EventPermissionReplied | EventSessionStatus | EventSessionIdle - | EventSessionCompacted | EventFileEdited | EventTodoUpdated + | EventSessionCompacted | EventCommandExecuted | EventSessionCreated | EventSessionUpdated @@ -1734,7 +1735,8 @@ export type Agent = { name: string description?: string mode: "subagent" | "primary" | "all" - builtIn: boolean + native?: boolean + hidden?: boolean topP?: number temperature?: number color?: string @@ -2797,10 +2799,10 @@ export type SessionPromptData = { } agent?: string noReply?: boolean - system?: string tools?: { [key: string]: boolean } + system?: string parts: Array } path: { @@ -2892,10 +2894,10 @@ export type SessionPromptAsyncData = { } agent?: string noReply?: boolean - system?: string tools?: { [key: string]: boolean } + system?: string parts: Array } path: {