Skip to content

Commit b8c14b5

Browse files
committed
Merge branch 'dev' into adjust-perm-array-logic
2 parents a301c5c + baef5cd commit b8c14b5

164 files changed

Lines changed: 8773 additions & 5716 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.opencode/opencode.jsonc‎

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
1-
{
2-
"$schema": "https://opencode.ai/config.json",
3-
"provider": {},
4-
"permission": {
5-
"edit": {
6-
"packages/opencode/migration/*": "ask",
7-
},
8-
},
9-
"mcp": {},
10-
"tools": {
11-
"github-triage": false,
12-
"github-pr-search": false,
13-
},
14-
}
1+
// {
2+
// "$schema": "https://opencode.ai/config.json",
3+
// "provider": {},
4+
// // Array form: each entry is its own permission layer; later layers override earlier rules.
5+
// "permission": [
6+
// // Layer 1: safety defaults.
7+
// {
8+
// "bash": {
9+
// "rm -rf *": "deny",
10+
// },
11+
// },
12+
// // Layer 2: project-specific rules — uses per-field shorthand and object forms.
13+
// {
14+
// "edit": {
15+
// "packages/opencode/migration/*": "ask",
16+
// },
17+
// "webfetch": "allow",
18+
// },
19+
// // Layer 3: deny everything that runs through bash. Shorthand for bash: { "*": "deny" }.
20+
// {
21+
// "bash": "deny",
22+
// },
23+
// // Layer 4: relax layer 3 for a specific pattern. Later layer wins for matching commands,
24+
// // so `echo foo` is allowed while everything else stays denied.
25+
// {
26+
// "bash": {
27+
// "echo *": "allow",
28+
// },
29+
// },
30+
// ],
31+
// "mcp": {},
32+
// "tools": {
33+
// "github-triage": false,
34+
// "github-pr-search": false,
35+
// },
36+
// }
37+
{}
38+

‎bun.lock‎

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bunfig.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[install]
22
exact = true
3+
# Only install newly resolved package versions published at least 3 days ago.
4+
minimumReleaseAge = 259200
35

46
[test]
57
root = "./do-not-run-tests-from-root"
6-

‎nix/hashes.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"nodeModules": {
3-
"x86_64-linux": "sha256-Q9r1S15YL9LQK7DRhuOpw3Fxi24BPovEM995GZJayKw=",
4-
"aarch64-linux": "sha256-C0rRTLnxxuuEkCBc3JZbkR66TUVwpcPFif3BU9GRAuA=",
5-
"aarch64-darwin": "sha256-1HvalOO/pOkRlYH8CZ93psapt90C+pYzui1JCadBE1Q=",
6-
"x86_64-darwin": "sha256-RrndyLWfhWm4mZ88XytFF2NI+ly8la550Z5LBN/g5u4="
3+
"x86_64-linux": "sha256-MUHog06sZEi6bXR1m8exdkjSNW9bHEv9bPQXACJ7SFw=",
4+
"aarch64-linux": "sha256-3dwdZ3It++OsdGT8xMOQ10Arz8eeODp/LXOrI4DLEhY=",
5+
"aarch64-darwin": "sha256-TmUPGDCewjsrT13npVH6B55J43NKKut67p/HgPJpQNM=",
6+
"x86_64-darwin": "sha256-j8I7t3MZoUQUMFRWyaFO75TRbAw5TauSZAa4yKOHFMA="
77
}
88
}

‎packages/app/package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"solid-js": "catalog:",
7474
"solid-list": "catalog:",
7575
"tailwindcss": "catalog:",
76-
"virtua": "catalog:",
77-
"zod": "catalog:"
76+
"virtua": "catalog:"
7877
}
7978
}

‎packages/app/src/components/dialog-select-file.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ function createCommandEntries(props: {
107107
const allowed = createMemo(() => {
108108
if (props.filesOnly()) return []
109109
return props.command.options.filter(
110-
(option) => !option.disabled && !option.id.startsWith("suggested.") && option.id !== "file.open",
110+
(option) =>
111+
!option.disabled && !option.hidden && !option.id.startsWith("suggested.") && option.id !== "file.open",
111112
)
112113
})
113114

‎packages/app/src/components/dialog-select-mcp.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { Dialog } from "@opencode-ai/ui/dialog"
66
import { List } from "@opencode-ai/ui/list"
77
import { Switch } from "@opencode-ai/ui/switch"
88
import { useLanguage } from "@/context/language"
9-
import { mcpQueryKey } from "@/context/global-sync"
9+
import { useQueryOptions } from "@/context/global-sync"
10+
import { pathKey } from "@/utils/path-key"
1011

1112
const statusLabels = {
1213
connected: "mcp.status.connected",
@@ -20,6 +21,7 @@ export const DialogSelectMcp: Component = () => {
2021
const sdk = useSDK()
2122
const language = useLanguage()
2223
const queryClient = useQueryClient()
24+
const queryOptions = useQueryOptions()
2325

2426
const items = createMemo(() =>
2527
Object.entries(sync.data.mcp ?? {})
@@ -32,7 +34,7 @@ export const DialogSelectMcp: Component = () => {
3234
if (sync.data.mcp[name]?.status === "connected") await sdk.client.mcp.disconnect({ name })
3335
else await sdk.client.mcp.connect({ name })
3436
},
35-
onSuccess: () => queryClient.refetchQueries({ queryKey: mcpQueryKey(sync.directory) }),
37+
onSuccess: () => queryClient.refetchQueries(queryOptions.mcp(pathKey(sync.directory))),
3638
}))
3739

3840
const enabledCount = createMemo(() => items().filter((i) => i.status === "connected").length)

‎packages/app/src/components/prompt-input.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
} from "@/context/prompt"
1717
import { useLayout } from "@/context/layout"
1818
import { useSDK } from "@/context/sdk"
19-
import { useGlobalSDK } from "@/context/global-sdk"
2019
import { useSync } from "@/context/sync"
2120
import { useComments } from "@/context/comments"
2221
import { Button } from "@opencode-ai/ui/button"
@@ -56,7 +55,8 @@ import { PromptDragOverlay } from "./prompt-input/drag-overlay"
5655
import { promptPlaceholder } from "./prompt-input/placeholder"
5756
import { ImagePreview } from "@opencode-ai/ui/image-preview"
5857
import { useQueries } from "@tanstack/solid-query"
59-
import { loadAgentsQuery, loadProvidersQuery } from "@/context/global-sync/bootstrap"
58+
import { useQueryOptions } from "@/context/global-sync"
59+
import { pathKey } from "@/utils/path-key"
6060

6161
interface PromptInputProps {
6262
class?: string
@@ -103,7 +103,7 @@ const NON_EMPTY_TEXT = /[^\s\u200B]/
103103

104104
export const PromptInput: Component<PromptInputProps> = (props) => {
105105
const sdk = useSDK()
106-
const globalSDK = useGlobalSDK()
106+
const queryOptions = useQueryOptions()
107107

108108
const sync = useSync()
109109
const local = useLocal()
@@ -1256,9 +1256,9 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
12561256

12571257
const [agentsQuery, globalProvidersQuery, providersQuery] = useQueries(() => ({
12581258
queries: [
1259-
loadAgentsQuery(sdk.directory, sdk.client),
1260-
loadProvidersQuery(null, globalSDK.client),
1261-
loadProvidersQuery(sdk.directory, sdk.client),
1259+
queryOptions.agents(pathKey(sdk.directory)),
1260+
queryOptions.providers(null),
1261+
queryOptions.providers(pathKey(sdk.directory)),
12621262
],
12631263
}))
12641264

‎packages/app/src/components/settings-keybinds.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ function listFor(command: CommandContext, map: KeybindMap, palette: string) {
123123

124124
for (const opt of command.catalog) {
125125
if (opt.id.startsWith("suggested.")) continue
126+
if (opt.hidden) continue
126127
out.set(opt.id, { title: opt.title, group: groupFor(opt.id) })
127128
}
128129

129130
for (const opt of command.options) {
130131
if (opt.id.startsWith("suggested.")) continue
132+
if (opt.hidden) continue
131133
out.set(opt.id, { title: opt.title, group: groupFor(opt.id) })
132134
}
133135

‎packages/app/src/components/status-popover-body.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import { useSDK } from "@/context/sdk"
1515
import { normalizeServerUrl, ServerConnection, useServer } from "@/context/server"
1616
import { useSync } from "@/context/sync"
1717
import { useCheckServerHealth, type ServerHealth } from "@/utils/server-health"
18-
import { mcpQueryKey } from "@/context/global-sync"
18+
import { useQueryOptions } from "@/context/global-sync"
19+
import { pathKey } from "@/utils/path-key"
1920

2021
const pollMs = 10_000
2122

@@ -139,13 +140,14 @@ const useMcpToggleMutation = () => {
139140
const sdk = useSDK()
140141
const language = useLanguage()
141142
const queryClient = useQueryClient()
143+
const queryOptions = useQueryOptions()
142144

143145
return useMutation(() => ({
144146
mutationFn: async (name: string) => {
145147
const status = sync.data.mcp[name]
146148
await (status?.status === "connected" ? sdk.client.mcp.disconnect({ name }) : sdk.client.mcp.connect({ name }))
147149
},
148-
onSuccess: () => queryClient.refetchQueries({ queryKey: mcpQueryKey(sync.directory) }),
150+
onSuccess: () => queryClient.refetchQueries(queryOptions.mcp(pathKey(sync.directory))),
149151
onError: (err) => {
150152
showToast({
151153
variant: "error",

0 commit comments

Comments
 (0)