diff --git a/.github/TEAM_MEMBERS b/.github/TEAM_MEMBERS deleted file mode 100644 index 22c9a923d33..00000000000 --- a/.github/TEAM_MEMBERS +++ /dev/null @@ -1,15 +0,0 @@ -adamdotdevin -Brendonovich -fwang -Hona -iamdavidhill -jayair -jlongster -kitlangton -kommander -MrMushrooooom -nexxeln -R44VC0RP -rekram1-node -RhysSullivan -thdxr diff --git a/packages/app/src/components/question-dock.tsx b/packages/app/src/components/question-dock.tsx deleted file mode 100644 index 9f0d7b1fd17..00000000000 --- a/packages/app/src/components/question-dock.tsx +++ /dev/null @@ -1,314 +0,0 @@ -import { For, Show, createMemo, type Component } from "solid-js" -import { createStore } from "solid-js/store" -import { Button } from "@opencode-ai/ui/button" -import { Icon } from "@opencode-ai/ui/icon" -import { showToast } from "@opencode-ai/ui/toast" -import type { QuestionAnswer, QuestionRequest } from "@kilocode/sdk/v2" -import { useLanguage } from "@/context/language" -import { useSDK } from "@/context/sdk" - -// kilocode_change start - add onModeAction prop for mode-switching support -export const QuestionDock: Component<{ - request: QuestionRequest - onModeAction?: (input: { mode: string; text: string; description?: string }) => void -}> = (props) => { - // kilocode_change end - const sdk = useSDK() - const language = useLanguage() - - const questions = createMemo(() => props.request.questions) - const single = createMemo(() => questions().length === 1 && questions()[0]?.multiple !== true) - - const [store, setStore] = createStore({ - tab: 0, - answers: [] as QuestionAnswer[], - custom: [] as string[], - editing: false, - sending: false, - }) - - const question = createMemo(() => questions()[store.tab]) - const confirm = createMemo(() => !single() && store.tab === questions().length) - const options = createMemo(() => question()?.options ?? []) - const input = createMemo(() => store.custom[store.tab] ?? "") - const multi = createMemo(() => question()?.multiple === true) - const customPicked = createMemo(() => { - const value = input() - if (!value) return false - return store.answers[store.tab]?.includes(value) ?? false - }) - - const fail = (err: unknown) => { - const message = err instanceof Error ? err.message : String(err) - showToast({ title: language.t("common.requestFailed"), description: message }) - } - - const reply = async (answers: QuestionAnswer[]) => { - if (store.sending) return - - setStore("sending", true) - try { - await sdk.client.question.reply({ requestID: props.request.id, answers }) - } catch (err) { - fail(err) - } finally { - setStore("sending", false) - } - } - - const reject = async () => { - if (store.sending) return - - setStore("sending", true) - try { - await sdk.client.question.reject({ requestID: props.request.id }) - } catch (err) { - fail(err) - } finally { - setStore("sending", false) - } - } - - const submit = () => { - void reply(questions().map((_, i) => store.answers[i] ?? []))?.catch(fail) // kilocode_change - } - - const pick = (answer: string, custom: boolean = false) => { - // kilocode_change start - find option to check for mode - // Custom answers won't match a predefined option, so mode switching is intentionally skipped - const option = options().find((o) => o.label === answer) - // kilocode_change end - - setStore("answers", store.tab, [answer]) - - if (custom) { - setStore("custom", store.tab, answer) - } - - if (single()) { - // kilocode_change start - trigger mode switch after question reply completes - const pending = reply([[answer]]) - if (option?.mode && props.onModeAction) { - const action = props.onModeAction - const mode = option.mode - const description = option.description - pending?.then(() => action({ mode, text: answer, description }), fail).catch(fail) - } else { - pending?.catch(fail) - } - // kilocode_change end - return - } - - setStore("tab", store.tab + 1) - } - - const toggle = (answer: string) => { - setStore("answers", store.tab, (current = []) => { - if (current.includes(answer)) return current.filter((item) => item !== answer) - return [...current, answer] - }) - } - - const selectTab = (index: number) => { - setStore("tab", index) - setStore("editing", false) - } - - const selectOption = (optIndex: number) => { - if (store.sending) return - - if (optIndex === options().length) { - setStore("editing", true) - return - } - - const opt = options()[optIndex] - if (!opt) return - if (multi()) { - toggle(opt.label) - return - } - pick(opt.label) - } - - const handleCustomSubmit = (e: Event) => { - e.preventDefault() - if (store.sending) return - - const value = input().trim() - if (!value) { - setStore("editing", false) - return - } - - if (multi()) { - setStore("answers", store.tab, (current = []) => { - if (current.includes(value)) return current - return [...current, value] - }) - setStore("editing", false) - return - } - - pick(value, true) - setStore("editing", false) - } - - return ( -