}>()
+
+ for (const conflict of conflicts) {
+ const file = conflict.file?.trim()
+ const key = file && file.length > 0 ? file : "__unknown__"
+ const row = map.get(key)
+ if (!row) {
+ map.set(key, { file, reasons: new Set([conflict.reason]) })
+ continue
+ }
+ row.reasons.add(conflict.reason)
+ }
+
+ return Array.from(map.values()).map((row) => ({ file: row.file, reasons: Array.from(row.reasons) }))
+}
+
+export function mapApplyConflictReason(reason: string): "index" | "patch" | "contents" | undefined {
+ const text = reason.toLowerCase()
+ if (text.includes("does not match index")) return "index"
+ if (text.includes("patch does not apply") || text.includes("patch failed")) return "patch"
+ if (text.includes("cannot read the current contents")) return "contents"
+ return undefined
+}
diff --git a/packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx b/packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
index 96a12d0556e..e69c9d0bbd2 100644
--- a/packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
+++ b/packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
@@ -3,7 +3,7 @@
* Text input with send/abort buttons, ghost-text autocomplete, and @ file mention support
*/
-import { Component, createSignal, createEffect, on, For, Index, onCleanup, Show, untrack } from "solid-js"
+import { Component, createSignal, createEffect, on, For, Index, onCleanup, onMount, Show, untrack } from "solid-js"
import { Button } from "@kilocode/kilo-ui/button"
import { Tooltip } from "@kilocode/kilo-ui/tooltip"
import { FileIcon } from "@kilocode/kilo-ui/file-icon"
@@ -16,6 +16,7 @@ import { ModeSwitcher } from "../shared/ModeSwitcher"
import { ThinkingSelector } from "../shared/ThinkingSelector"
import { useFileMention } from "../../hooks/useFileMention"
import { useImageAttachments } from "../../hooks/useImageAttachments"
+import { WandSparkles } from "@kilocode/kilo-ui/lucide"
import { fileName, dirName, buildHighlightSegments } from "./prompt-input-utils"
const AUTOCOMPLETE_DEBOUNCE_MS = 500
@@ -36,6 +37,10 @@ export const PromptInput: Component = () => {
const [text, setText] = createSignal("")
const [ghostText, setGhostText] = createSignal("")
+ const [chatAutocompleteEnabled, setChatAutocompleteEnabled] = createSignal(false)
+ const [enhancing, setEnhancing] = createSignal(false)
+ let enhanceCounter = 0
+ let preEnhanceText: string | null = null
let textareaRef: HTMLTextAreaElement | undefined
let highlightRef: HTMLDivElement | undefined
@@ -79,6 +84,10 @@ export const PromptInput: Component = () => {
}
}
+ if (message.type === "autocompleteSettingsLoaded") {
+ setChatAutocompleteEnabled(message.settings.enableChatAutocomplete)
+ }
+
if (message.type === "setChatBoxMessage") {
setText(message.text)
setGhostText("")
@@ -111,6 +120,31 @@ export const PromptInput: Component = () => {
if (message.type === "action" && message.action === "focusInput") {
textareaRef?.focus()
}
+
+ if (message.type === "enhancePromptResult") {
+ const result = message as import("../../types/messages").EnhancePromptResultMessage
+ if (result.requestId === `enhance-${enhanceCounter}`) {
+ setText(result.text)
+ setGhostText("")
+ setEnhancing(false)
+ if (textareaRef) {
+ textareaRef.value = result.text
+ adjustHeight()
+ textareaRef.focus()
+ }
+ }
+ }
+
+ if (message.type === "enhancePromptError") {
+ const result = message as import("../../types/messages").EnhancePromptErrorMessage
+ if (result.requestId === `enhance-${enhanceCounter}`) {
+ setEnhancing(false)
+ }
+ }
+ })
+
+ onMount(() => {
+ vscode.postMessage({ type: "requestAutocompleteSettings" })
})
onCleanup(() => {
@@ -122,7 +156,7 @@ export const PromptInput: Component = () => {
})
const requestAutocomplete = (val: string) => {
- if (val.length < MIN_TEXT_LENGTH || isDisabled()) {
+ if (val.length < MIN_TEXT_LENGTH || isDisabled() || !chatAutocompleteEnabled()) {
setGhostText("")
return
}
@@ -181,6 +215,7 @@ export const PromptInput: Component = () => {
const target = e.target as HTMLTextAreaElement
const val = target.value
setText(val)
+ preEnhanceText = null
adjustHeight()
setGhostText("")
syncHighlightScroll()
@@ -198,6 +233,20 @@ export const PromptInput: Component = () => {
}
const handleKeyDown = (e: KeyboardEvent) => {
+ // Undo enhanced prompt with Ctrl+Z / ⌘Z
+ if (e.key === "z" && (e.metaKey || e.ctrlKey) && !e.shiftKey && preEnhanceText !== null) {
+ e.preventDefault()
+ const restored = preEnhanceText
+ preEnhanceText = null
+ setText(restored)
+ setGhostText("")
+ if (textareaRef) {
+ textareaRef.value = restored
+ adjustHeight()
+ }
+ return
+ }
+
if (mention.onKeyDown(e, textareaRef, setText, adjustHeight)) {
setGhostText("")
queueMicrotask(scrollToActiveItem)
@@ -228,6 +277,28 @@ export const PromptInput: Component = () => {
}
}
+ const canEnhance = () => !isBusy() && !isDisabled() && !enhancing()
+
+ const handleEnhance = () => {
+ if (isDisabled() || enhancing() || isBusy()) return
+ const draft = text().trim()
+ if (!draft) {
+ const description = language.t("prompt.action.enhanceDescription")
+ setText(description)
+ setGhostText("")
+ if (textareaRef) {
+ textareaRef.value = description
+ adjustHeight()
+ textareaRef.focus()
+ }
+ return
+ }
+ preEnhanceText = text()
+ enhanceCounter++
+ setEnhancing(true)
+ vscode.postMessage({ type: "enhancePrompt", text: draft, requestId: `enhance-${enhanceCounter}` })
+ }
+
const handleSend = () => {
const message = text().trim()
const imgs = imageAttach.images()
@@ -343,6 +414,17 @@ export const PromptInput: Component = () => {
+
+
+
+
+
}
+// Enhance prompt result (extension → webview)
+export interface EnhancePromptResultMessage {
+ type: "enhancePromptResult"
+ text: string
+ requestId: string
+}
+
+// Enhance prompt error (extension → webview)
+export interface EnhancePromptErrorMessage {
+ type: "enhancePromptError"
+ error: string
+ requestId: string
+}
+
export type ExtensionMessage =
| ReadyMessage
| ConnectionStateMessage
@@ -830,8 +863,11 @@ export type ExtensionMessage =
| WorkspaceDirectoryChangedMessage
| AgentManagerWorktreeDiffMessage
| AgentManagerWorktreeDiffLoadingMessage
+ | AgentManagerApplyWorktreeDiffResultMessage
| AgentManagerWorktreeStatsMessage
| AgentManagerLocalStatsMessage
+ | EnhancePromptResultMessage
+ | EnhancePromptErrorMessage
// ============================================
// Messages FROM webview TO extension
@@ -1232,6 +1268,12 @@ export interface StopDiffWatchMessage {
type: "agentManager.stopDiffWatch"
}
+export interface ApplyWorktreeDiffMessage {
+ type: "agentManager.applyWorktreeDiff"
+ worktreeId: string
+ selectedFiles?: string[]
+}
+
// Variant persistence (webview → extension)
export interface PersistVariantRequest {
type: "persistVariant"
@@ -1244,6 +1286,13 @@ export interface RequestVariantsMessage {
type: "requestVariants"
}
+// Enhance prompt request (webview → extension)
+export interface EnhancePromptRequest {
+ type: "enhancePrompt"
+ text: string
+ requestId: string
+}
+
export type WebviewMessage =
| SendMessageRequest
| AbortRequest
@@ -1315,6 +1364,8 @@ export type WebviewMessage =
| RequestWorktreeDiffMessage
| StartDiffWatchMessage
| StopDiffWatchMessage
+ | ApplyWorktreeDiffMessage
+ | EnhancePromptRequest
// ============================================
// VS Code API type
diff --git a/packages/opencode/package.json b/packages/opencode/package.json
index bf3b34d654a..efdcb0a4234 100644
--- a/packages/opencode/package.json
+++ b/packages/opencode/package.json
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
- "version": "7.0.33",
+ "version": "7.0.35",
"name": "@kilocode/cli",
"type": "module",
"license": "MIT",
diff --git a/packages/opencode/src/cli/cmd/import.ts b/packages/opencode/src/cli/cmd/import.ts
index 9696d17add9..99976e1185a 100644
--- a/packages/opencode/src/cli/cmd/import.ts
+++ b/packages/opencode/src/cli/cmd/import.ts
@@ -1,7 +1,6 @@
import type { Argv } from "yargs"
import type { Session as SDKSession, Message, Part } from "@kilocode/sdk/v2"
import { Session } from "../../session"
-import { Bus } from "../../bus"
import { cmd } from "./cmd"
import { bootstrap } from "../bootstrap"
import { Database } from "../../storage/db"
@@ -10,6 +9,9 @@ import { Instance } from "../../project/instance"
import { ShareNext } from "../../share/share-next"
import { EOL } from "os"
import { Filesystem } from "../../util/filesystem"
+import { Log } from "../../util/log"
+
+const log = Log.create({ service: "import-command" })
/** Discriminated union returned by the ShareNext API (GET /api/share/:id/data) */
export type ShareData =
@@ -65,6 +67,44 @@ export function transformShareData(shareData: ShareData[]): {
}
}
+// kilocode_change start
+export function ingestBootstrapWarning(sessionId: string, error: unknown) {
+ const details = error instanceof Error ? error.message : String(error)
+ return `Warning: imported session ${sessionId} locally, but ingest bootstrap failed: ${details}`
+}
+
+async function ingestBootstrap(sessionId: string) {
+ const { KiloSessions } = await import("../../kilo-sessions/kilo-sessions")
+ return KiloSessions.bootstrap(sessionId)
+}
+
+export async function bootstrapImportedSessionIngest(
+ sessionId: string,
+ input?: {
+ bootstrap?: (sessionId: string) => Promise
+ warn?: (message: string) => void
+ },
+) {
+ const run = input?.bootstrap ?? ingestBootstrap
+ const warn =
+ input?.warn ??
+ ((message: string) => {
+ process.stderr.write(message)
+ process.stderr.write(EOL)
+ })
+
+ log.info("ingest bootstrap started", { sessionId })
+ await run(sessionId)
+ .then(() => {
+ log.info("ingest bootstrap completed", { sessionId })
+ })
+ .catch((error) => {
+ log.error("ingest bootstrap failed", { sessionId, error })
+ warn(ingestBootstrapWarning(sessionId, error))
+ })
+}
+// kilocode_change end
+
export const ImportCommand = cmd({
command: "import ",
describe: "import session data from JSON file or URL",
@@ -134,7 +174,6 @@ export const ImportCommand = cmd({
Database.use((db) => {
db.insert(SessionTable).values(Session.toRow(exportData.info)).onConflictDoNothing().run()
- Database.effect(() => Bus.publish(Session.Event.Created, { info: exportData.info }))
})
for (const msg of exportData.messages) {
@@ -167,6 +206,10 @@ export const ImportCommand = cmd({
}
}
+ // kilocode_change start
+ await bootstrapImportedSessionIngest(exportData.info.id)
+ // kilocode_change end
+
process.stdout.write(`Imported session: ${exportData.info.id}`)
process.stdout.write(EOL)
})
diff --git a/packages/opencode/src/kilo-sessions/kilo-sessions.ts b/packages/opencode/src/kilo-sessions/kilo-sessions.ts
index 7a22b3e78ce..62288eba6f8 100644
--- a/packages/opencode/src/kilo-sessions/kilo-sessions.ts
+++ b/packages/opencode/src/kilo-sessions/kilo-sessions.ts
@@ -198,8 +198,25 @@ export namespace KiloSessions {
}
export async function create(sessionId: string) {
+ const result = await bootstrap(sessionId)
+ if (!result) return { id: "", ingestPath: "" }
+
+ void fullSync(sessionId).catch((error) => log.error("share full sync failed", { sessionId, error }))
+
+ return result
+ }
+
+ export async function bootstrap(sessionId: string) {
+ if (ingestDisabled) {
+ log.info("session bootstrap skipped: ingest disabled", { sessionId })
+ return
+ }
+
const client = await getClient()
- if (!client) return { id: "", ingestPath: "" }
+ if (!client) {
+ log.info("session bootstrap skipped: no client", { sessionId })
+ return
+ }
log.info("creating session", { sessionId })
@@ -216,7 +233,7 @@ export namespace KiloSessions {
await Storage.write(["session_share", sessionId], result)
- void fullSync(sessionId).catch((error) => log.error("share full sync failed", { sessionId, error }))
+ log.info("session bootstrap completed", { sessionId })
return result
}
diff --git a/packages/opencode/src/kilocode/enhance-prompt.ts b/packages/opencode/src/kilocode/enhance-prompt.ts
new file mode 100644
index 00000000000..72fd1a47d03
--- /dev/null
+++ b/packages/opencode/src/kilocode/enhance-prompt.ts
@@ -0,0 +1,60 @@
+// kilocode_change - new file
+import { Provider } from "@/provider/provider"
+import { LLM } from "@/session/llm"
+import { Agent } from "@/agent/agent"
+import { Log } from "@/util/log"
+
+const log = Log.create({ service: "enhance-prompt" })
+
+export function clean(text: string) {
+ const stripped = text.replace(/^```\w*\n?|```$/g, "").trim()
+ return stripped.replace(/^(['"])([\s\S]*)\1$/, "$2").trim()
+}
+
+export async function enhancePrompt(text: string): Promise {
+ log.info("enhancing", { length: text.length })
+
+ const defaultModel = await Provider.defaultModel()
+ const model =
+ (await Provider.getSmallModel(defaultModel.providerID)) ??
+ (await Provider.getModel(defaultModel.providerID, defaultModel.modelID))
+
+ const agent: Agent.Info = {
+ name: "enhance-prompt",
+ mode: "primary",
+ hidden: true,
+ options: {},
+ permission: [],
+ prompt: "Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):",
+ temperature: 0.7,
+ }
+
+ const stream = await LLM.stream({
+ agent,
+ user: {
+ id: "enhance-prompt",
+ sessionID: "enhance-prompt",
+ role: "user",
+ model: {
+ providerID: model.providerID,
+ modelID: model.id,
+ },
+ time: {
+ created: Date.now(),
+ completed: Date.now(),
+ },
+ } as any,
+ tools: {},
+ model,
+ small: true,
+ messages: [{ role: "user" as const, content: text }],
+ abort: new AbortController().signal,
+ sessionID: "enhance-prompt",
+ system: [],
+ retries: 3,
+ })
+
+ const result = await stream.text
+ log.info("enhanced", { length: result.length })
+ return clean(result)
+}
diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts
index a30c670a43c..862eba4a07d 100644
--- a/packages/opencode/src/provider/transform.ts
+++ b/packages/opencode/src/provider/transform.ts
@@ -252,25 +252,39 @@ export namespace ProviderTransform {
}
// kilocode_change - function added
- function fixDuplicateReasoning(msgs: ModelMessage[]) {
+ function fixDuplicateReasoning(msgs: ModelMessage[], model: Provider.Model) {
for (const msg of msgs) {
- if (!Array.isArray(msg.content)) {
+ if (msg.role !== "assistant" || !Array.isArray(msg.content)) {
continue
}
- let isFirstToolCall = true
+ const set = new Set()
for (const part of msg.content) {
- if (part.type === "reasoning") {
- // this entry is corrupt
- delete part.providerOptions?.openrouter?.reasoning_details
- }
- if (part.type === "tool-call" && isFirstToolCall) {
- isFirstToolCall = false
+ const openrouterProviderOptions = part.providerOptions?.openrouter as
+ | {
+ reasoning_details?: { data?: string; text?: string; signature?: string }[]
+ }
+ | undefined
+ if (!openrouterProviderOptions || !openrouterProviderOptions.reasoning_details) {
continue
}
- if (part.type === "tool-call") {
- // this is a duplicate entry
- delete part.providerOptions?.openrouter?.reasoning_details
- }
+ openrouterProviderOptions.reasoning_details = openrouterProviderOptions.reasoning_details.filter((rd) => {
+ if (rd.data) {
+ if (!set.has(rd.data)) {
+ set.add(rd.data)
+ return true
+ }
+ return false
+ }
+ if (rd.text) {
+ if ((model.family === "claude" || model.id.includes("claude")) && !rd.signature) return false
+ if (!set.has(rd.text)) {
+ set.add(rd.text)
+ return true
+ }
+ return false
+ }
+ return true
+ })
}
}
}
@@ -282,7 +296,7 @@ export namespace ProviderTransform {
// kilocode_change - workaround for @openrouter/ai-sdk-provider v1 duplicating reasoning
// fixed in https://github.com/OpenRouterTeam/ai-sdk-provider/pull/344/
if (model.api.npm === "@kilocode/kilo-gateway") {
- fixDuplicateReasoning(msgs)
+ fixDuplicateReasoning(msgs, model)
}
if (
diff --git a/packages/opencode/src/server/routes/enhance-prompt.ts b/packages/opencode/src/server/routes/enhance-prompt.ts
new file mode 100644
index 00000000000..8fd49e1ece0
--- /dev/null
+++ b/packages/opencode/src/server/routes/enhance-prompt.ts
@@ -0,0 +1,40 @@
+// kilocode_change - new file
+import { Hono } from "hono"
+import { describeRoute, resolver, validator } from "hono-openapi"
+import z from "zod"
+import { enhancePrompt } from "../../kilocode/enhance-prompt"
+import { lazy } from "../../util/lazy"
+import { errors } from "../error"
+
+export const EnhancePromptRoutes = lazy(() =>
+ new Hono().post(
+ "/",
+ describeRoute({
+ summary: "Enhance prompt",
+ description: "Rewrite a user's draft prompt into a clearer, more specific, and more effective prompt.",
+ operationId: "enhancePrompt.enhance",
+ responses: {
+ 200: {
+ description: "Enhanced prompt text",
+ content: {
+ "application/json": {
+ schema: resolver(z.object({ text: z.string() })),
+ },
+ },
+ },
+ ...errors(400),
+ },
+ }),
+ validator(
+ "json",
+ z.object({
+ text: z.string().min(1).meta({ description: "The user's draft prompt to enhance" }),
+ }),
+ ),
+ async (c) => {
+ const body = c.req.valid("json")
+ const result = await enhancePrompt(body.text)
+ return c.json({ text: result })
+ },
+ ),
+)
diff --git a/packages/opencode/src/server/routes/experimental.ts b/packages/opencode/src/server/routes/experimental.ts
index bd9f2294a79..da7fe3c8bfe 100644
--- a/packages/opencode/src/server/routes/experimental.ts
+++ b/packages/opencode/src/server/routes/experimental.ts
@@ -209,9 +209,18 @@ export const ExperimentalRoutes = lazy(() =>
...errors(400),
},
}),
+ // kilocode_change start
+ validator(
+ "query",
+ z.object({
+ base: z.string().optional().meta({ description: "Base branch or ref to diff against" }),
+ }),
+ ),
async (c) => {
const log = Log.create({ service: "worktree-diff" })
- const base = c.req.query("base") || (await Review.getBaseBranch())
+ const query = c.req.valid("query")
+ const base = query.base || (await Review.getBaseBranch())
+ // kilocode_change end
const dir = Instance.directory
log.info("computing diff", { dir, base })
diff --git a/packages/opencode/src/server/server.ts b/packages/opencode/src/server/server.ts
index c6a374a5461..c882207a8ee 100644
--- a/packages/opencode/src/server/server.ts
+++ b/packages/opencode/src/server/server.ts
@@ -43,6 +43,7 @@ import { websocket } from "hono/bun"
import { HTTPException } from "hono/http-exception"
import { errors } from "./error"
import { CommitMessageRoutes } from "./routes/commit-message"
+import { EnhancePromptRoutes } from "./routes/enhance-prompt" // kilocode_change
import { QuestionRoutes } from "./routes/question"
import { PermissionRoutes } from "./routes/permission"
import { GlobalRoutes } from "./routes/global"
@@ -241,6 +242,7 @@ export namespace Server {
.route("/provider", ProviderRoutes())
.route("/telemetry", TelemetryRoutes()) // kilocode_change
.route("/commit-message", CommitMessageRoutes()) // kilocode_change
+ .route("/enhance-prompt", EnhancePromptRoutes()) // kilocode_change
// kilocode_change start - Kilo Gateway routes
.route(
"/kilo",
diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts
index b3dbde6f37c..17606be6ff1 100644
--- a/packages/opencode/src/session/prompt.ts
+++ b/packages/opencode/src/session/prompt.ts
@@ -768,8 +768,7 @@ export namespace SessionPrompt {
SessionCompaction.prune({ sessionID })
// kilocode_change start
finished = true
- abort.throwIfAborted()
- // kilocode_change end
+ // Return the stored interrupted assistant turn before surfacing AbortError.
for await (const item of MessageV2.stream(sessionID)) {
if (item.info.role === "user") continue
const queued = state()[sessionID]?.callbacks ?? []
@@ -778,6 +777,8 @@ export namespace SessionPrompt {
}
return item
}
+ if (abort.aborted) abort.throwIfAborted()
+ // kilocode_change end
throw new Error("Impossible")
})
diff --git a/packages/opencode/test/cli/import.test.ts b/packages/opencode/test/cli/import.test.ts
index a1a69dc0941..e32de1342e4 100644
--- a/packages/opencode/test/cli/import.test.ts
+++ b/packages/opencode/test/cli/import.test.ts
@@ -1,5 +1,11 @@
import { test, expect } from "bun:test"
-import { parseShareUrl, transformShareData, type ShareData } from "../../src/cli/cmd/import"
+import {
+ parseShareUrl,
+ transformShareData,
+ bootstrapImportedSessionIngest,
+ ingestBootstrapWarning,
+ type ShareData,
+} from "../../src/cli/cmd/import"
// parseShareUrl tests
test("parses valid share URLs", () => {
@@ -36,3 +42,41 @@ test("returns null for invalid share data", () => {
expect(transformShareData([{ type: "message", data: {} as any }])).toBeNull()
expect(transformShareData([{ type: "session", data: { id: "s" } as any }])).toBeNull() // no messages
})
+
+test("formats ingest bootstrap warning", () => {
+ expect(ingestBootstrapWarning("session-123", new Error("network failed"))).toContain("session-123")
+ expect(ingestBootstrapWarning("session-123", new Error("network failed"))).toContain("network failed")
+ expect(ingestBootstrapWarning("session-123", "oops")).toContain("oops")
+})
+
+test("bootstrapImportedSessionIngest runs bootstrap and does not warn on success", async () => {
+ const calls: string[] = []
+ const warnings: string[] = []
+
+ await bootstrapImportedSessionIngest("session-success", {
+ bootstrap: async (sessionId) => {
+ calls.push(sessionId)
+ },
+ warn: (message) => warnings.push(message),
+ })
+
+ expect(calls).toEqual(["session-success"])
+ expect(warnings).toHaveLength(0)
+})
+
+test("bootstrapImportedSessionIngest warns and continues on failure", async () => {
+ const warnings: string[] = []
+
+ await expect(
+ bootstrapImportedSessionIngest("session-fail", {
+ bootstrap: async () => {
+ throw new Error("boom")
+ },
+ warn: (message) => warnings.push(message),
+ }),
+ ).resolves.toBeUndefined()
+
+ expect(warnings).toHaveLength(1)
+ expect(warnings[0]).toContain("session-fail")
+ expect(warnings[0]).toContain("boom")
+})
diff --git a/packages/opencode/test/kilocode/enhance-prompt.test.ts b/packages/opencode/test/kilocode/enhance-prompt.test.ts
new file mode 100644
index 00000000000..2bd0422ffd1
--- /dev/null
+++ b/packages/opencode/test/kilocode/enhance-prompt.test.ts
@@ -0,0 +1,52 @@
+import { describe, it, expect } from "bun:test"
+import { clean } from "../../src/kilocode/enhance-prompt"
+
+describe("enhance-prompt", () => {
+ describe("clean", () => {
+ it("trims whitespace", () => {
+ expect(clean(" hello world ")).toBe("hello world")
+ })
+
+ it("strips code block markers", () => {
+ expect(clean("```\nhello world\n```")).toBe("hello world")
+ })
+
+ it("strips code block with language tag", () => {
+ expect(clean("```text\nhello world\n```")).toBe("hello world")
+ })
+
+ it("strips surrounding double quotes", () => {
+ expect(clean('"hello world"')).toBe("hello world")
+ })
+
+ it("strips surrounding single quotes", () => {
+ expect(clean("'hello world'")).toBe("hello world")
+ })
+
+ it("strips code blocks and quotes together", () => {
+ expect(clean('```\n"hello world"\n```')).toBe("hello world")
+ })
+
+ it("returns plain text unchanged", () => {
+ expect(clean("hello world")).toBe("hello world")
+ })
+
+ it("handles empty string", () => {
+ expect(clean("")).toBe("")
+ })
+
+ it("handles whitespace-only string", () => {
+ expect(clean(" ")).toBe("")
+ })
+
+ it("does not strip internal quotes", () => {
+ expect(clean('say "hello" to the world')).toBe('say "hello" to the world')
+ })
+
+ it("does not strip mismatched quotes", () => {
+ expect(clean("\"hello world'")).toBe("\"hello world'")
+ })
+ })
+
+
+})
diff --git a/packages/opencode/test/session/prompt.test.ts b/packages/opencode/test/session/prompt.test.ts
index e8a8c65b03d..9e0ac582e7c 100644
--- a/packages/opencode/test/session/prompt.test.ts
+++ b/packages/opencode/test/session/prompt.test.ts
@@ -1,4 +1,5 @@
import path from "path"
+import fs from "fs/promises"
import { describe, expect, test } from "bun:test"
import { fileURLToPath } from "url"
import { Instance } from "../../src/project/instance"
@@ -209,3 +210,123 @@ describe("session.prompt agent variant", () => {
}
})
})
+
+// kilocode_change start
+function deferred() {
+ const result = {} as { promise: Promise; resolve: (value: T) => void }
+ result.promise = new Promise((resolve) => {
+ result.resolve = resolve
+ })
+ return result
+}
+
+describe("session.prompt abort", () => {
+ test("returns the interrupted assistant turn when the current prompt is cancelled", async () => {
+ const dir = path.dirname(fileURLToPath(import.meta.url))
+ const fixtures = (await Bun.file(path.join(dir, "../tool/fixtures/models-api.json")).json()) as Record<
+ string,
+ { models: Record } & Record
+ >
+ const model = fixtures.openai.models["gpt-5.2"]
+ const started = deferred()
+ const payload = new TextEncoder().encode(
+ [
+ `data: ${JSON.stringify({
+ type: "response.created",
+ response: {
+ id: "resp-1",
+ created_at: Math.floor(Date.now() / 1000),
+ model: model.id,
+ service_tier: null,
+ },
+ })}`,
+ "",
+ ].join("\n\n"),
+ )
+ const server = Bun.serve({
+ port: 0,
+ fetch(req: Request) {
+ const url = new URL(req.url)
+ if (!url.pathname.endsWith("/responses")) {
+ return new Response("unexpected request", { status: 404 })
+ }
+ started.resolve()
+ return new Response(
+ new ReadableStream({
+ start(controller) {
+ controller.enqueue(payload)
+ },
+ }),
+ {
+ status: 200,
+ headers: { "Content-Type": "text/event-stream" },
+ },
+ )
+ },
+ })
+
+ try {
+ await using tmp = await tmpdir({
+ git: true,
+ init: async (root) => {
+ const dir = path.join(root, ".opencode")
+ await fs.mkdir(dir, { recursive: true })
+ await Bun.write(
+ path.join(dir, "opencode.json"),
+ JSON.stringify({
+ $schema: "https://app.kilo.ai/config.json",
+ enabled_providers: ["openai"],
+ provider: {
+ openai: {
+ name: "OpenAI",
+ env: ["OPENAI_API_KEY"],
+ npm: "@ai-sdk/openai",
+ api: "https://api.openai.com/v1",
+ models: {
+ [model.id]: model,
+ },
+ options: {
+ apiKey: "test-openai-key",
+ baseURL: `${server.url.origin}/v1`,
+ },
+ },
+ },
+ }),
+ )
+ },
+ })
+
+ await Instance.provide({
+ directory: tmp.path,
+ fn: async () => {
+ const session = await Session.create({})
+ const run = SessionPrompt.prompt({
+ sessionID: session.id,
+ model: {
+ providerID: "openai",
+ modelID: model.id,
+ },
+ parts: [{ type: "text", text: "say hello" }],
+ })
+
+ await started.promise
+ SessionPrompt.cancel(session.id)
+
+ const result = await run
+ expect(result.info.role).toBe("assistant")
+ if (result.info.role !== "assistant") throw new Error("expected assistant message")
+ expect(result.info.error?.name).toBe("MessageAbortedError")
+
+ const messages = await Session.messages({ sessionID: session.id })
+ const assistant = messages.find((item) => item.info.role === "assistant")
+ expect(assistant?.info.id).toBe(result.info.id)
+
+ await Session.remove(session.id)
+ },
+ })
+ } finally {
+ server.stop(true)
+ }
+ }, 15000)
+})
+// kilocode_change end
diff --git a/packages/plugin/package.json b/packages/plugin/package.json
index 7aaff4c43c7..b6b6b3d21bf 100644
--- a/packages/plugin/package.json
+++ b/packages/plugin/package.json
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@kilocode/plugin",
- "version": "7.0.33",
+ "version": "7.0.35",
"type": "module",
"license": "MIT",
"repository": {
diff --git a/packages/script/package.json b/packages/script/package.json
index a0600588c77..4c16ba1ea98 100644
--- a/packages/script/package.json
+++ b/packages/script/package.json
@@ -8,7 +8,7 @@
"exports": {
".": "./src/index.ts"
},
- "version": "7.0.33",
+ "version": "7.0.35",
"dependencies": {},
"peerDependencies": {}
}
diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json
index f8eae8592e8..8abcc4902ef 100644
--- a/packages/sdk/js/package.json
+++ b/packages/sdk/js/package.json
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@kilocode/sdk",
- "version": "7.0.33",
+ "version": "7.0.35",
"type": "module",
"license": "MIT",
"repository": {
diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts
index 7aaaca41ff9..076d4e208a1 100644
--- a/packages/sdk/js/src/v2/gen/sdk.gen.ts
+++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts
@@ -21,6 +21,8 @@ import type {
ConfigProvidersResponses,
ConfigUpdateErrors,
ConfigUpdateResponses,
+ EnhancePromptEnhanceErrors,
+ EnhancePromptEnhanceResponses,
EventSubscribeResponses,
EventTuiCommandExecute,
EventTuiPromptAppend,
@@ -928,10 +930,21 @@ export class Worktree extends HeyApiClient {
public diff(
parameters?: {
directory?: string
+ base?: string
},
options?: Options,
) {
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }] }])
+ const params = buildClientParams(
+ [parameters],
+ [
+ {
+ args: [
+ { in: "query", key: "directory" },
+ { in: "query", key: "base" },
+ ],
+ },
+ ],
+ )
return (options?.client ?? this.client).get({
url: "/experimental/worktree/diff",
...options,
@@ -2395,6 +2408,47 @@ export class CommitMessage extends HeyApiClient {
}
}
+export class EnhancePrompt extends HeyApiClient {
+ /**
+ * Enhance prompt
+ *
+ * Rewrite a user's draft prompt into a clearer, more specific, and more effective prompt.
+ */
+ public enhance(
+ parameters?: {
+ directory?: string
+ text?: string
+ },
+ options?: Options,
+ ) {
+ const params = buildClientParams(
+ [parameters],
+ [
+ {
+ args: [
+ { in: "query", key: "directory" },
+ { in: "body", key: "text" },
+ ],
+ },
+ ],
+ )
+ return (options?.client ?? this.client).post<
+ EnhancePromptEnhanceResponses,
+ EnhancePromptEnhanceErrors,
+ ThrowOnError
+ >({
+ url: "/enhance-prompt",
+ ...options,
+ ...params,
+ headers: {
+ "Content-Type": "application/json",
+ ...options?.headers,
+ ...params.headers,
+ },
+ })
+ }
+}
+
export class Organization extends HeyApiClient {
/**
* Update Kilo Gateway organization
@@ -3739,6 +3793,11 @@ export class KiloClient extends HeyApiClient {
return (this._commitMessage ??= new CommitMessage({ client: this.client }))
}
+ private _enhancePrompt?: EnhancePrompt
+ get enhancePrompt(): EnhancePrompt {
+ return (this._enhancePrompt ??= new EnhancePrompt({ client: this.client }))
+ }
+
private _kilo?: Kilo
get kilo(): Kilo {
return (this._kilo ??= new Kilo({ client: this.client }))
diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts
index 03b02cd9efc..47b9b58eff4 100644
--- a/packages/sdk/js/src/v2/gen/types.gen.ts
+++ b/packages/sdk/js/src/v2/gen/types.gen.ts
@@ -2540,6 +2540,10 @@ export type WorktreeDiffData = {
path?: never
query?: {
directory?: string
+ /**
+ * Base branch or ref to diff against
+ */
+ base?: string
}
url: "/experimental/worktree/diff"
}
@@ -4067,6 +4071,40 @@ export type CommitMessageGenerateResponses = {
export type CommitMessageGenerateResponse = CommitMessageGenerateResponses[keyof CommitMessageGenerateResponses]
+export type EnhancePromptEnhanceData = {
+ body?: {
+ /**
+ * The user's draft prompt to enhance
+ */
+ text: string
+ }
+ path?: never
+ query?: {
+ directory?: string
+ }
+ url: "/enhance-prompt"
+}
+
+export type EnhancePromptEnhanceErrors = {
+ /**
+ * Bad request
+ */
+ 400: BadRequestError
+}
+
+export type EnhancePromptEnhanceError = EnhancePromptEnhanceErrors[keyof EnhancePromptEnhanceErrors]
+
+export type EnhancePromptEnhanceResponses = {
+ /**
+ * Enhanced prompt text
+ */
+ 200: {
+ text: string
+ }
+}
+
+export type EnhancePromptEnhanceResponse = EnhancePromptEnhanceResponses[keyof EnhancePromptEnhanceResponses]
+
export type KiloProfileData = {
body?: never
path?: never
diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json
index 114034fc2aa..2281da94483 100644
--- a/packages/sdk/openapi.json
+++ b/packages/sdk/openapi.json
@@ -36,7 +36,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.global.health({\n ...\n})"
}
]
}
@@ -61,7 +61,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.global.event({\n ...\n})"
}
]
}
@@ -86,7 +86,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.global.config.get({\n ...\n})"
}
]
},
@@ -128,7 +128,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.global.config.update({\n ...\n})"
}
]
}
@@ -153,7 +153,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.global.dispose({\n ...\n})"
}
]
}
@@ -207,7 +207,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.auth.set({\n ...\n})"
}
]
},
@@ -250,7 +250,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.auth.remove({\n ...\n})"
}
]
}
@@ -287,7 +287,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.project.list({\n ...\n})"
}
]
}
@@ -321,7 +321,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.project.current({\n ...\n})"
}
]
}
@@ -420,7 +420,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.project.update({\n ...\n})"
}
]
}
@@ -457,7 +457,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.pty.list({\n ...\n})"
}
]
},
@@ -534,7 +534,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.pty.create({\n ...\n})"
}
]
}
@@ -586,7 +586,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.pty.get({\n ...\n})"
}
]
},
@@ -662,7 +662,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.pty.update({\n ...\n})"
}
]
},
@@ -712,7 +712,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.pty.remove({\n ...\n})"
}
]
}
@@ -764,7 +764,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.pty.connect({\n ...\n})"
}
]
}
@@ -798,7 +798,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.config.get({\n ...\n})"
}
]
},
@@ -849,7 +849,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.config.update({\n ...\n})"
}
]
}
@@ -901,7 +901,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.config.providers({\n ...\n})"
}
]
}
@@ -945,7 +945,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tool.ids({\n ...\n})"
}
]
}
@@ -1005,7 +1005,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tool.list({\n ...\n})"
}
]
}
@@ -1058,7 +1058,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.worktree.create({\n ...\n})"
}
]
},
@@ -1093,7 +1093,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.worktree.list({\n ...\n})"
}
]
},
@@ -1144,7 +1144,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.worktree.remove({\n ...\n})"
}
]
}
@@ -1197,7 +1197,62 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.worktree.reset({\n ...\n})"
+ }
+ ]
+ }
+ },
+ "/experimental/worktree/diff": {
+ "get": {
+ "operationId": "worktree.diff",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "directory",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "base",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Base branch or ref to diff against"
+ }
+ ],
+ "summary": "Get worktree diff",
+ "description": "Get file diffs for a worktree compared to its base branch. Includes uncommitted changes.",
+ "responses": {
+ "200": {
+ "description": "File diffs",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/FileDiff"
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/BadRequestError"
+ }
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "js",
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.worktree.diff({\n ...\n})"
}
]
}
@@ -1283,7 +1338,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.experimental.session.list({\n ...\n})"
}
]
}
@@ -1323,7 +1378,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.experimental.resource.list({\n ...\n})"
}
]
}
@@ -1393,7 +1448,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.list({\n ...\n})"
}
]
},
@@ -1459,7 +1514,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.create({\n ...\n})"
}
]
}
@@ -1509,7 +1564,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.status({\n ...\n})"
}
]
}
@@ -1573,7 +1628,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.get({\n ...\n})"
}
]
},
@@ -1634,7 +1689,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.delete({\n ...\n})"
}
]
},
@@ -1716,7 +1771,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.update({\n ...\n})"
}
]
}
@@ -1783,7 +1838,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.children({\n ...\n})"
}
]
}
@@ -1849,7 +1904,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.todo({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.todo({\n ...\n})"
}
]
}
@@ -1934,7 +1989,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.init({\n ...\n})"
}
]
}
@@ -1992,7 +2047,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.fork({\n ...\n})"
}
]
}
@@ -2054,7 +2109,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.abort({\n ...\n})"
}
]
}
@@ -2116,7 +2171,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.share({\n ...\n})"
}
]
},
@@ -2177,7 +2232,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.unshare({\n ...\n})"
}
]
}
@@ -2231,7 +2286,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.diff({\n ...\n})"
}
]
}
@@ -2316,7 +2371,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.summarize({\n ...\n})"
}
]
}
@@ -2401,7 +2456,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.messages({\n ...\n})"
}
]
},
@@ -2572,7 +2627,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.prompt({\n ...\n})"
}
]
}
@@ -2656,7 +2711,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.message({\n ...\n})"
}
]
},
@@ -2726,7 +2781,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.deleteMessage({\n ...\n})"
}
]
}
@@ -2806,7 +2861,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.part.delete({\n ...\n})"
}
]
},
@@ -2893,7 +2948,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.part.update({\n ...\n})"
}
]
}
@@ -3047,7 +3102,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.prompt_async({\n ...\n})"
}
]
}
@@ -3185,7 +3240,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.command({\n ...\n})"
}
]
}
@@ -3278,7 +3333,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.shell({\n ...\n})"
}
]
}
@@ -3360,7 +3415,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.revert({\n ...\n})"
}
]
}
@@ -3422,7 +3477,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.session.unrevert({\n ...\n})"
}
]
}
@@ -3509,7 +3564,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.permission.respond({\n ...\n})"
}
]
}
@@ -3590,7 +3645,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.permission.reply({\n ...\n})"
}
]
}
@@ -3627,7 +3682,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.permission.list({\n ...\n})"
}
]
}
@@ -3664,7 +3719,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.question.list({\n ...\n})"
}
]
}
@@ -3745,7 +3800,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.question.reply({\n ...\n})"
}
]
}
@@ -3807,7 +3862,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.question.reject({\n ...\n})"
}
]
}
@@ -3979,12 +4034,13 @@
},
"required": ["input", "output"]
},
- "recommended": {
- "type": "boolean"
- },
"recommendedIndex": {
"type": "number"
},
+ "prompt": {
+ "type": "string",
+ "enum": ["codex", "gemini", "beast", "anthropic", "trinity", "anthropic_without_todo"]
+ },
"experimental": {
"type": "boolean"
},
@@ -4075,7 +4131,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.provider.list({\n ...\n})"
}
]
}
@@ -4118,7 +4174,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.provider.auth({\n ...\n})"
}
]
}
@@ -4187,7 +4243,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.provider.oauth.authorize({\n ...\n})"
}
]
}
@@ -4260,7 +4316,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.provider.oauth.callback({\n ...\n})"
}
]
}
@@ -4328,7 +4384,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.telemetry.capture({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.telemetry.capture({\n ...\n})"
}
]
}
@@ -4405,7 +4461,74 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.commitMessage.generate({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.commitMessage.generate({\n ...\n})"
+ }
+ ]
+ }
+ },
+ "/enhance-prompt": {
+ "post": {
+ "operationId": "enhancePrompt.enhance",
+ "parameters": [
+ {
+ "in": "query",
+ "name": "directory",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "summary": "Enhance prompt",
+ "description": "Rewrite a user's draft prompt into a clearer, more specific, and more effective prompt.",
+ "responses": {
+ "200": {
+ "description": "Enhanced prompt text",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "text": {
+ "type": "string"
+ }
+ },
+ "required": ["text"]
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/BadRequestError"
+ }
+ }
+ }
+ }
+ },
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "text": {
+ "description": "The user's draft prompt to enhance",
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "required": ["text"]
+ }
+ }
+ }
+ },
+ "x-codeSamples": [
+ {
+ "lang": "js",
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.enhancePrompt.enhance({\n ...\n})"
}
]
}
@@ -4508,7 +4631,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.kilo.profile({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.kilo.profile({\n ...\n})"
}
]
}
@@ -4574,7 +4697,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.kilo.organization.set({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.kilo.organization.set({\n ...\n})"
}
]
}
@@ -4598,7 +4721,41 @@
"description": "Streaming FIM completion response",
"content": {
"text/event-stream": {
- "schema": {}
+ "schema": {
+ "type": "object",
+ "properties": {
+ "choices": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "delta": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "usage": {
+ "type": "object",
+ "properties": {
+ "prompt_tokens": {
+ "type": "number"
+ },
+ "completion_tokens": {
+ "type": "number"
+ }
+ }
+ },
+ "cost": {
+ "type": "number"
+ }
+ }
+ }
}
}
},
@@ -4643,7 +4800,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.kilo.fim({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.kilo.fim({\n ...\n})"
}
]
}
@@ -4720,7 +4877,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.kilo.notifications({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.kilo.notifications({\n ...\n})"
}
]
}
@@ -4770,7 +4927,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.kilo.cloud.session.get({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.kilo.cloud.session.get({\n ...\n})"
}
]
}
@@ -4837,7 +4994,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.kilo.cloud.session.import({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.kilo.cloud.session.import({\n ...\n})"
}
]
}
@@ -4946,7 +5103,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.kilo.cloudSessions({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.kilo.cloudSessions({\n ...\n})"
}
]
}
@@ -5042,7 +5199,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.find.text({\n ...\n})"
}
]
}
@@ -5112,7 +5269,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.find.files({\n ...\n})"
}
]
}
@@ -5157,7 +5314,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.find.symbols({\n ...\n})"
}
]
}
@@ -5202,7 +5359,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.file.list({\n ...\n})"
}
]
}
@@ -5244,7 +5401,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.file.read({\n ...\n})"
}
]
}
@@ -5281,7 +5438,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.file.status({\n ...\n})"
}
]
}
@@ -5321,7 +5478,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.status({\n ...\n})"
}
]
},
@@ -5394,7 +5551,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.add({\n ...\n})"
}
]
}
@@ -5463,7 +5620,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.auth.start({\n ...\n})"
}
]
},
@@ -5520,7 +5677,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.auth.remove({\n ...\n})"
}
]
}
@@ -5598,7 +5755,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.auth.callback({\n ...\n})"
}
]
}
@@ -5660,7 +5817,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.auth.authenticate({\n ...\n})"
}
]
}
@@ -5701,7 +5858,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.connect({\n ...\n})"
}
]
}
@@ -5742,7 +5899,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.mcp.disconnect({\n ...\n})"
}
]
}
@@ -5801,7 +5958,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.appendPrompt({\n ...\n})"
}
]
}
@@ -5835,7 +5992,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.openHelp({\n ...\n})"
}
]
}
@@ -5869,7 +6026,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.openSessions({\n ...\n})"
}
]
}
@@ -5903,7 +6060,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.openThemes({\n ...\n})"
}
]
}
@@ -5937,7 +6094,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.openModels({\n ...\n})"
}
]
}
@@ -5971,7 +6128,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.submitPrompt({\n ...\n})"
}
]
}
@@ -6005,7 +6162,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.clearPrompt({\n ...\n})"
}
]
}
@@ -6064,7 +6221,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.executeCommand({\n ...\n})"
}
]
}
@@ -6125,7 +6282,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.showToast({\n ...\n})"
}
]
}
@@ -6191,7 +6348,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.publish({\n ...\n})"
}
]
}
@@ -6262,7 +6419,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.selectSession({\n ...\n})"
}
]
}
@@ -6303,7 +6460,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.control.next({\n ...\n})"
}
]
}
@@ -6344,7 +6501,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.tui.control.response({\n ...\n})"
}
]
}
@@ -6378,7 +6535,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.instance.dispose({\n ...\n})"
}
]
}
@@ -6412,7 +6569,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.path.get({\n ...\n})"
}
]
}
@@ -6446,7 +6603,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.vcs.get({\n ...\n})"
}
]
}
@@ -6483,7 +6640,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.command.list({\n ...\n})"
}
]
}
@@ -6560,7 +6717,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.app.log({\n ...\n})"
}
]
}
@@ -6597,7 +6754,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.app.agents({\n ...\n})"
}
]
}
@@ -6649,7 +6806,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.app.skills({\n ...\n})"
}
]
}
@@ -6686,7 +6843,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.lsp.status({\n ...\n})"
}
]
}
@@ -6723,7 +6880,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.formatter.status({\n ...\n})"
}
]
}
@@ -6757,7 +6914,7 @@
"x-codeSamples": [
{
"lang": "js",
- "source": "import { createOpencodeClient } from \"@kilocode/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})"
+ "source": "import { createKiloClient } from \"@kilocode/sdk\"\n\nconst client = createKiloClient()\nawait client.event.subscribe({\n ...\n})"
}
]
}
@@ -9903,12 +10060,13 @@
},
"required": ["input", "output"]
},
- "recommended": {
- "type": "boolean"
- },
"recommendedIndex": {
"type": "number"
},
+ "prompt": {
+ "type": "string",
+ "enum": ["codex", "gemini", "beast", "anthropic", "trinity", "anthropic_without_todo"]
+ },
"experimental": {
"type": "boolean"
},
@@ -10859,11 +11017,12 @@
"additionalProperties": {}
}
},
- "recommended": {
- "type": "boolean"
- },
"recommendedIndex": {
"type": "number"
+ },
+ "prompt": {
+ "type": "string",
+ "enum": ["codex", "gemini", "beast", "anthropic", "trinity", "anthropic_without_todo"]
}
},
"required": [
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 8107fa4e6c0..137d8682c34 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/ui",
- "version": "7.0.33",
+ "version": "7.0.35",
"type": "module",
"license": "MIT",
"exports": {
diff --git a/packages/util/package.json b/packages/util/package.json
index 31d79e01838..5c89bc1d4e8 100644
--- a/packages/util/package.json
+++ b/packages/util/package.json
@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/util",
- "version": "7.0.33",
+ "version": "7.0.35",
"private": true,
"type": "module",
"license": "MIT",
diff --git a/script/upstream/package.json b/script/upstream/package.json
index 152b6f1e332..e964a7cee38 100644
--- a/script/upstream/package.json
+++ b/script/upstream/package.json
@@ -1,6 +1,6 @@
{
"name": "@kilocode/upstream-merge",
- "version": "7.0.33",
+ "version": "7.0.35",
"private": true,
"type": "module",
"description": "Scripts for automating upstream opencode merges into Kilo",
diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json
index b2b6130fe20..6bb71c245bc 100644
--- a/sdks/vscode/package.json
+++ b/sdks/vscode/package.json
@@ -2,7 +2,7 @@
"name": "opencode",
"displayName": "opencode",
"description": "opencode for VS Code",
- "version": "7.0.33",
+ "version": "7.0.35",
"publisher": "sst-dev",
"repository": {
"type": "git",