From cd79db8a8da3010bb03effca930089d6602ecb8f Mon Sep 17 00:00:00 2001 From: Imanol Maiztegui Date: Tue, 14 Apr 2026 10:52:25 +0200 Subject: [PATCH] refactor: update sdk imports and fix type signatures for v1.3.17 compat - Update `@kilocode/sdk` imports to use `@kilocode/sdk/v2` path - Replace `@opencode-ai/sdk/v2` import with `@kilocode/sdk/v2` - Change theme color types from `string` to `RGBA` in renderApiDescription - Fix `build` return type in KiloToolRegistry to `Effect.Effect` --- bun.lock | 2 ++ .../opencode/src/cli/cmd/tui/component/dialog-provider.tsx | 2 +- .../src/kilocode/cli/cmd/tui/component/dialog-provider.tsx | 5 +++-- packages/opencode/src/kilocode/tool/registry.ts | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bun.lock b/bun.lock index 8e7efd9ccc..13e1c9a9ef 100644 --- a/bun.lock +++ b/bun.lock @@ -413,6 +413,7 @@ "jsonc-parser": "3.3.1", "mime-types": "3.0.2", "minimatch": "10.2.5", + "npm-package-arg": "13.0.2", "open": "10.1.2", "opencode-gitlab-auth": "2.0.1", "opencode-poe-auth": "0.0.1", @@ -457,6 +458,7 @@ "@types/bun": "catalog:", "@types/cross-spawn": "catalog:", "@types/mime-types": "3.0.1", + "@types/npm-package-arg": "6.1.4", "@types/npmcli__arborist": "6.3.3", "@types/semver": "^7.5.8", "@types/turndown": "5.0.5", diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx index 84effbbd9f..711f88a153 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx @@ -8,7 +8,7 @@ import { DialogPrompt } from "../ui/dialog-prompt" import { Link } from "../ui/link" import { useTheme } from "../context/theme" import { TextAttributes } from "@opentui/core" -import type { ProviderAuthAuthorization, ProviderAuthMethod } from "@kilocode/sdk" +import type { ProviderAuthAuthorization, ProviderAuthMethod } from "@kilocode/sdk/v2" import { DialogModel } from "./dialog-model" import { useKeyboard } from "@opentui/solid" import { Clipboard } from "@tui/util/clipboard" diff --git a/packages/opencode/src/kilocode/cli/cmd/tui/component/dialog-provider.tsx b/packages/opencode/src/kilocode/cli/cmd/tui/component/dialog-provider.tsx index 7c57109342..7f26418a12 100644 --- a/packages/opencode/src/kilocode/cli/cmd/tui/component/dialog-provider.tsx +++ b/packages/opencode/src/kilocode/cli/cmd/tui/component/dialog-provider.tsx @@ -7,7 +7,8 @@ */ import type { JSX } from "solid-js" -import type { ProviderAuthAuthorization } from "@opencode-ai/sdk/v2" +import type { RGBA } from "@opentui/core" +import type { ProviderAuthAuthorization } from "@kilocode/sdk/v2" import { KiloAutoMethod } from "@/kilocode/components/dialog-kilo-auto-method" // --------------------------------------------------------------------------- @@ -76,7 +77,7 @@ export function renderAutoMethod(opts: { */ export function renderApiDescription( providerID: string, - theme: { textMuted: string; text: string; primary: string }, + theme: { textMuted: RGBA; text: RGBA; primary: RGBA }, ): (() => JSX.Element) | undefined { if (providerID !== "kilo") return undefined return () => ( diff --git a/packages/opencode/src/kilocode/tool/registry.ts b/packages/opencode/src/kilocode/tool/registry.ts index 74368df535..5c70fdf41c 100644 --- a/packages/opencode/src/kilocode/tool/registry.ts +++ b/packages/opencode/src/kilocode/tool/registry.ts @@ -9,7 +9,9 @@ import { Effect } from "effect" export namespace KiloToolRegistry { /** Build Kilo-specific tools (CodebaseSearch, Recall) */ - export function build(fn: (tool: T | Effect.Effect) => Effect.Effect) { + export function build( + fn: (tool: T | Effect.Effect) => Effect.Effect, + ) { return Effect.gen(function* () { const codebase = yield* fn(CodebaseSearchTool) const recall = yield* fn(RecallTool)