Skip to content

Commit c16a0e0

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into refactor-shells
2 parents 70ca572 + 91bd295 commit c16a0e0

420 files changed

Lines changed: 9269 additions & 2310 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.

.github/VOUCHED.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ rubdos
3333
shantur
3434
simonklee
3535
-spider-yamet clawdbot/llm psychosis, spam pinging the team
36+
-terisuke
3637
thdxr
3738
-toastythebot

bun.lock

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

infra/console.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,27 @@ const zenLiteCouponFirstMonth100 = new stripe.Coupon("ZenLiteCouponFirstMonth100
115115
appliesToProducts: [zenLiteProduct.id],
116116
duration: "once",
117117
})
118+
const zenLiteCouponThreeMonths100 = new stripe.Coupon("ZenLiteCoupon3Months100", {
119+
name: "3 months 100% off",
120+
percentOff: 100,
121+
appliesToProducts: [zenLiteProduct.id],
122+
duration: "repeating",
123+
durationInMonths: 3,
124+
})
125+
const zenLiteCouponSixMonths100 = new stripe.Coupon("ZenLiteCoupon6Months100", {
126+
name: "6 months 100% off",
127+
percentOff: 100,
128+
appliesToProducts: [zenLiteProduct.id],
129+
duration: "repeating",
130+
durationInMonths: 6,
131+
})
132+
const zenLiteCouponTwelveMonths100 = new stripe.Coupon("ZenLiteCoupon12Months100", {
133+
name: "12 months 100% off",
134+
percentOff: 100,
135+
appliesToProducts: [zenLiteProduct.id],
136+
duration: "repeating",
137+
durationInMonths: 12,
138+
})
118139
const zenLitePrice = new stripe.Price("ZenLitePrice", {
119140
product: zenLiteProduct.id,
120141
currency: "usd",
@@ -131,6 +152,9 @@ const ZEN_LITE_PRICE = new sst.Linkable("ZEN_LITE_PRICE", {
131152
priceInr: 92900,
132153
firstMonth50Coupon: zenLiteCouponFirstMonth50.id,
133154
firstMonth100Coupon: zenLiteCouponFirstMonth100.id,
155+
threeMonths100Coupon: zenLiteCouponThreeMonths100.id,
156+
sixMonths100Coupon: zenLiteCouponSixMonths100.id,
157+
twelveMonths100Coupon: zenLiteCouponTwelveMonths100.id,
134158
},
135159
})
136160

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-U/LZx/D+5JTT1LHSyZkEuqXP/ky7LkHrEYBW5pcVArk=",
4-
"aarch64-linux": "sha256-nGZa04h4y3jbdmf87IRrlQm/E5qYR8lj5OxKgQSR2XU=",
5-
"aarch64-darwin": "sha256-GD8pCHWMBppDaIfRKxhY2m4xWo1OrY3wOmGw+EC71mw=",
6-
"x86_64-darwin": "sha256-KOH1ZB8pdpF7Xer6QIH7rrr9fwF/BZkCTJndPe0wypg="
3+
"x86_64-linux": "sha256-h2T/LnUnISZZDn9ZQkZ/A59P+6+QdfOlrgl4RXK/vgM=",
4+
"aarch64-linux": "sha256-+DRohG1ZEB/2LtZU90GWoqJkeyu/sW8A8oKT3f/TtQ0=",
5+
"aarch64-darwin": "sha256-k4nsk/WduuxY8HgjRuqzGT9EjEo7V/2mAzBTYee0fZ0=",
6+
"x86_64-darwin": "sha256-3dSvfN2+5lXwOx57x8NSIWbEZ1fp6+1T6bJpAuUNPyk="
77
}
88
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"packages/slack"
2828
],
2929
"catalog": {
30-
"@effect/opentelemetry": "4.0.0-beta.48",
31-
"@effect/platform-node": "4.0.0-beta.48",
30+
"@effect/opentelemetry": "4.0.0-beta.57",
31+
"@effect/platform-node": "4.0.0-beta.57",
3232
"@npmcli/arborist": "9.4.0",
3333
"@types/bun": "1.3.12",
3434
"@types/cross-spawn": "6.0.6",
@@ -53,7 +53,7 @@
5353
"dompurify": "3.3.1",
5454
"drizzle-kit": "1.0.0-beta.19-d95b7a4",
5555
"drizzle-orm": "1.0.0-beta.19-d95b7a4",
56-
"effect": "4.0.0-beta.48",
56+
"effect": "4.0.0-beta.57",
5757
"ai": "6.0.168",
5858
"cross-spawn": "7.0.6",
5959
"hono": "4.10.7",

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/app",
3-
"version": "1.14.27",
3+
"version": "1.14.29",
44
"description": "",
55
"type": "module",
66
"exports": {

packages/app/src/app.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ declare global {
8282
}
8383

8484
function QueryProvider(props: ParentProps) {
85-
const client = new QueryClient()
85+
const client = new QueryClient({
86+
defaultOptions: {
87+
queries: {
88+
refetchOnReconnect: false,
89+
refetchOnMount: false,
90+
refetchOnWindowFocus: false,
91+
},
92+
},
93+
})
8694
return <QueryClientProvider client={client}>{props.children}</QueryClientProvider>
8795
}
8896

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

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { useMutation } from "@tanstack/solid-query"
2-
import { Component, createEffect, createMemo, on, Show } from "solid-js"
3-
import { createStore } from "solid-js/store"
1+
import { useMutation, useQueryClient } from "@tanstack/solid-query"
2+
import { Component, createMemo, Show } from "solid-js"
43
import { useSync } from "@/context/sync"
54
import { useSDK } from "@/context/sdk"
65
import { Dialog } from "@opencode-ai/ui/dialog"
76
import { List } from "@opencode-ai/ui/list"
87
import { Switch } from "@opencode-ai/ui/switch"
9-
import { showToast } from "@opencode-ai/ui/toast"
108
import { useLanguage } from "@/context/language"
9+
import { loadMcpQuery } from "@/context/global-sync"
1110

1211
const statusLabels = {
1312
connected: "mcp.status.connected",
@@ -20,48 +19,7 @@ export const DialogSelectMcp: Component = () => {
2019
const sync = useSync()
2120
const sdk = useSDK()
2221
const language = useLanguage()
23-
const [state, setState] = createStore({
24-
done: false,
25-
loading: false,
26-
})
27-
28-
createEffect(
29-
on(
30-
() => sync.data.mcp_ready,
31-
(ready, prev) => {
32-
if (!ready && prev) setState("done", false)
33-
},
34-
{ defer: true },
35-
),
36-
)
37-
38-
createEffect(() => {
39-
if (state.done || state.loading) return
40-
if (sync.data.mcp_ready) {
41-
setState("done", true)
42-
return
43-
}
44-
45-
setState("loading", true)
46-
void sdk.client.mcp
47-
.status()
48-
.then((result) => {
49-
sync.set("mcp", result.data ?? {})
50-
sync.set("mcp_ready", true)
51-
setState("done", true)
52-
})
53-
.catch((err) => {
54-
setState("done", true)
55-
showToast({
56-
variant: "error",
57-
title: language.t("common.requestFailed"),
58-
description: err instanceof Error ? err.message : String(err),
59-
})
60-
})
61-
.finally(() => {
62-
setState("loading", false)
63-
})
64-
})
22+
const queryClient = useQueryClient()
6523

6624
const items = createMemo(() =>
6725
Object.entries(sync.data.mcp ?? {})
@@ -71,16 +29,10 @@ export const DialogSelectMcp: Component = () => {
7129

7230
const toggle = useMutation(() => ({
7331
mutationFn: async (name: string) => {
74-
const status = sync.data.mcp[name]
75-
if (status?.status === "connected") {
76-
await sdk.client.mcp.disconnect({ name })
77-
} else {
78-
await sdk.client.mcp.connect({ name })
79-
}
80-
81-
const result = await sdk.client.mcp.status()
82-
if (result.data) sync.set("mcp", result.data)
32+
if (sync.data.mcp[name]?.status === "connected") await sdk.client.mcp.disconnect({ name })
33+
else await sdk.client.mcp.connect({ name })
8334
},
35+
onSuccess: () => queryClient.refetchQueries({ queryKey: loadMcpQuery(sync.directory).queryKey }),
8436
}))
8537

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

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

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useDialog } from "@opencode-ai/ui/context/dialog"
33
import { Icon } from "@opencode-ai/ui/icon"
44
import { Switch } from "@opencode-ai/ui/switch"
55
import { Tabs } from "@opencode-ai/ui/tabs"
6-
import { useMutation } from "@tanstack/solid-query"
6+
import { useMutation, useQueryClient } from "@tanstack/solid-query"
77
import { showToast } from "@opencode-ai/ui/toast"
88
import { useNavigate } from "@solidjs/router"
99
import { type Accessor, createEffect, createMemo, For, type JSXElement, onCleanup, Show } from "solid-js"
@@ -15,6 +15,7 @@ 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 { loadMcpQuery } from "@/context/global-sync"
1819

1920
const pollMs = 10_000
2021

@@ -137,14 +138,14 @@ const useMcpToggleMutation = () => {
137138
const sync = useSync()
138139
const sdk = useSDK()
139140
const language = useLanguage()
141+
const queryClient = useQueryClient()
140142

141143
return useMutation(() => ({
142144
mutationFn: async (name: string) => {
143145
const status = sync.data.mcp[name]
144146
await (status?.status === "connected" ? sdk.client.mcp.disconnect({ name }) : sdk.client.mcp.connect({ name }))
145-
const result = await sdk.client.mcp.status()
146-
if (result.data) sync.set("mcp", result.data)
147147
},
148+
onSuccess: () => queryClient.refetchQueries({ queryKey: loadMcpQuery(sync.directory).queryKey }),
148149
onError: (err) => {
149150
showToast({
150151
variant: "error",
@@ -162,14 +163,6 @@ export function StatusPopoverBody(props: { shown: Accessor<boolean> }) {
162163
const dialog = useDialog()
163164
const language = useLanguage()
164165
const navigate = useNavigate()
165-
const sdk = useSDK()
166-
167-
const [load, setLoad] = createStore({
168-
lspDone: false,
169-
lspLoading: false,
170-
mcpDone: false,
171-
mcpLoading: false,
172-
})
173166

174167
const fail = (err: unknown) => {
175168
showToast({
@@ -181,40 +174,6 @@ export function StatusPopoverBody(props: { shown: Accessor<boolean> }) {
181174

182175
createEffect(() => {
183176
if (!props.shown()) return
184-
185-
if (!sync.data.mcp_ready && !load.mcpDone && !load.mcpLoading) {
186-
setLoad("mcpLoading", true)
187-
void sdk.client.mcp
188-
.status()
189-
.then((result) => {
190-
sync.set("mcp", result.data ?? {})
191-
sync.set("mcp_ready", true)
192-
})
193-
.catch((err) => {
194-
setLoad("mcpDone", true)
195-
fail(err)
196-
})
197-
.finally(() => {
198-
setLoad("mcpLoading", false)
199-
})
200-
}
201-
202-
if (!sync.data.lsp_ready && !load.lspDone && !load.lspLoading) {
203-
setLoad("lspLoading", true)
204-
void sdk.client.lsp
205-
.status()
206-
.then((result) => {
207-
sync.set("lsp", result.data ?? [])
208-
sync.set("lsp_ready", true)
209-
})
210-
.catch((err) => {
211-
setLoad("lspDone", true)
212-
fail(err)
213-
})
214-
.finally(() => {
215-
setLoad("lspLoading", false)
216-
})
217-
}
218177
})
219178

220179
let dialogRun = 0

0 commit comments

Comments
 (0)