chore: merge dev into v2 (#34788)
Co-authored-by: Brendan Allan <14191578+Brendonovich@users.noreply.github.com> Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Affan Ali <93028901+affanali2k3@users.noreply.github.com> Co-authored-by: affanali2k3 <affanalikhanxx@gmail.com> Co-authored-by: Frank <frank@anoma.ly> Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <little-frank@opencord.local> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Jay V <air@live.ca> Co-authored-by: Dax Raad <d@ironbay.co> Co-authored-by: Aarav Sareen <96787824+arvsrn@users.noreply.github.com> Co-authored-by: OpeOginni <107570612+OpeOginni@users.noreply.github.com> Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com> Co-authored-by: Ben Guthrie <benjee.012@gmail.com> Co-authored-by: Dax <mail@thdxr.com> Co-authored-by: Filip <34747899+neriousy@users.noreply.github.com> Co-authored-by: Max Anderson <max.a.anderson95@gmail.com> Co-authored-by: Brendan Allan <git@brendonovich.dev> Co-authored-by: Jack <jack@anoma.ly> Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com> Co-authored-by: Dustin Deus <deusdustin@gmail.com> Co-authored-by: starptech <starptech@starptechs-MBP.fritz.box> Co-authored-by: Aiden Cline <aidenpcline@gmail.com> Co-authored-by: usrnk1 <7547651+usrnk1@users.noreply.github.com> Co-authored-by: Jay <53023+jayair@users.noreply.github.com> Co-authored-by: runvip <164729189+runvip@users.noreply.github.com> Co-authored-by: opencode <opencode@sst.dev> Co-authored-by: Julian Coy <julian@ex-machina.co> Co-authored-by: Vladimir Glafirov <vglafirov@gitlab.com>
This commit is contained in:
parent
932a40cfd9
commit
8c94e9005f
590 changed files with 15772 additions and 5530 deletions
|
|
@ -7,6 +7,7 @@ export interface Args {
|
|||
continue?: boolean
|
||||
sessionID?: string
|
||||
fork?: boolean
|
||||
auto?: boolean
|
||||
}
|
||||
|
||||
export const { use: useArgs, provider: ArgsProvider } = createSimpleContext({
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { useTheme } from "./theme"
|
|||
import { useToast } from "../ui/toast"
|
||||
import { useRoute } from "./route"
|
||||
import { useData } from "./data"
|
||||
import { usePermission } from "./permission"
|
||||
|
||||
export type LocalTheme = {
|
||||
secondary: RGBA
|
||||
|
|
@ -58,6 +59,9 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||
const theme = useTheme().theme
|
||||
const route = useRoute()
|
||||
const paths = useTuiPaths()
|
||||
const args = useArgs()
|
||||
const event = useEvent()
|
||||
const permission = usePermission()
|
||||
|
||||
function isModelValid(model: { providerID: string; modelID: string }) {
|
||||
return !!data.location.model
|
||||
|
|
@ -195,7 +199,6 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||
if (state.pending) save()
|
||||
})
|
||||
|
||||
const args = useArgs()
|
||||
const fallbackModel = createMemo(() => {
|
||||
if (args.model) {
|
||||
const { providerID, modelID } = parseModel(args.model)
|
||||
|
|
@ -454,8 +457,6 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||
if (state.pending) save()
|
||||
})
|
||||
|
||||
const event = useEvent()
|
||||
|
||||
const slots = createMemo(() => {
|
||||
const existing = new Set(sync.data.session.filter((x) => x.parentID === undefined).map((x) => x.id))
|
||||
return sessionStore.pinned.filter((id) => existing.has(id)).slice(0, 9)
|
||||
|
|
@ -542,6 +543,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|||
agent,
|
||||
mcp,
|
||||
session,
|
||||
permission,
|
||||
}
|
||||
return result
|
||||
},
|
||||
|
|
|
|||
26
packages/tui/src/context/permission.tsx
Normal file
26
packages/tui/src/context/permission.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { createStore } from "solid-js/store"
|
||||
import { useArgs } from "./args"
|
||||
import { createSimpleContext } from "./helper"
|
||||
|
||||
export type PermissionMode = "auto" | "normal"
|
||||
|
||||
export const { use: usePermission, provider: PermissionProvider } = createSimpleContext({
|
||||
name: "Permission",
|
||||
init: () => {
|
||||
const args = useArgs()
|
||||
const [store, setStore] = createStore<{ mode: PermissionMode }>({
|
||||
mode: args.auto ? "auto" : "normal",
|
||||
})
|
||||
return {
|
||||
get mode() {
|
||||
return store.mode
|
||||
},
|
||||
set(mode: PermissionMode) {
|
||||
setStore("mode", mode)
|
||||
},
|
||||
toggle() {
|
||||
setStore("mode", (mode) => (mode === "auto" ? "normal" : "auto"))
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue