Skip to content

Commit 885bb25

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into dev
2 parents 987afa3 + 6706358 commit 885bb25

149 files changed

Lines changed: 7670 additions & 4084 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/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ plans
33
package.json
44
bun.lock
55
.gitignore
6-
package-lock.json
6+
package-lock.json
7+
references/

.opencode/skills/effect/SKILL.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: effect
3+
description: Answer questions about the Effect framework
4+
---
5+
6+
# Effect
7+
8+
This codebase uses Effect, a framework for writing typescript.
9+
10+
## How to Answer Effect Questions
11+
12+
1. Clone the Effect repository: `https://github.com/Effect-TS/effect-smol` to
13+
`.opencode/references/effect-smol` in this project NOT the skill folder.
14+
2. Use the explore agent to search the codebase for answers about Effect patterns, APIs, and concepts
15+
3. Provide responses based on the actual Effect source code and documentation
16+
17+
## Guidelines
18+
19+
- Always use the explore agent with the cloned repository when answering Effect-related questions
20+
- Reference specific files and patterns found in the Effect codebase
21+
- Do not answer from memory - always verify against the source

.opencode/themes/mytheme.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116
"light": "nord5"
117117
},
118118
"diffLineNumber": {
119-
"dark": "nord2",
120-
"light": "nord4"
119+
"dark": "#abafb7",
120+
"light": "textMuted"
121121
},
122122
"diffAddedLineNumberBg": {
123123
"dark": "#3B4252",

bun.lock

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

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-g29OM3dy+sZ3ioTs8zjQOK1N+KnNr9ptP9xtdPcdr64=",
4-
"aarch64-linux": "sha256-Iu91KwDcV5omkf4Ngny1aYpyCkPLjuoWOVUDOJUhW1k=",
5-
"aarch64-darwin": "sha256-bk3G6m+Yo60Ea3Kyglc37QZf5Vm7MLMFcxemjc7HnL0=",
6-
"x86_64-darwin": "sha256-y3hooQw13Z3Cu0KFfXYdpkTEeKTyuKd+a/jsXHQLdqA="
3+
"x86_64-linux": "sha256-1qeXIfqPCo5Px0ebdTvL09kav5Ib79E35Ed1FgiLnPY=",
4+
"aarch64-linux": "sha256-987XZxDqDf6gm0kjXg606BSEYvryrUD8vZopsADQIN8=",
5+
"aarch64-darwin": "sha256-RI3D3bPxotudTWmdQNIPZ/oBrmDl5PAdJGc93M4bKHs=",
6+
"x86_64-darwin": "sha256-LE6hrDPXWKjcePc1nv+O6tIN0ZXUrzWI1XBN6Fm/NKw="
77
}
88
}

nix/opencode.nix

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
sysctl,
88
makeBinaryWrapper,
99
models-dev,
10-
ripgrep,
1110
installShellFiles,
1211
versionCheckHook,
1312
writableTmpDirAsHomeHook,
@@ -52,25 +51,25 @@ stdenvNoCC.mkDerivation (finalAttrs: {
5251
runHook postBuild
5352
'';
5453

55-
installPhase = ''
56-
runHook preInstall
57-
58-
install -Dm755 dist/opencode-*/bin/opencode $out/bin/opencode
59-
install -Dm644 schema.json $out/share/opencode/schema.json
60-
61-
wrapProgram $out/bin/opencode \
62-
--prefix PATH : ${
63-
lib.makeBinPath (
64-
[
65-
ripgrep
54+
installPhase =
55+
''
56+
runHook preInstall
57+
58+
install -Dm755 dist/opencode-*/bin/opencode $out/bin/opencode
59+
install -Dm644 schema.json $out/share/opencode/schema.json
60+
''
61+
# bun runs sysctl to detect if dunning on rosetta2
62+
+ lib.optionalString stdenvNoCC.hostPlatform.isDarwin ''
63+
wrapProgram $out/bin/opencode \
64+
--prefix PATH : ${
65+
lib.makeBinPath [
66+
sysctl
6667
]
67-
# bun runs sysctl to detect if dunning on rosetta2
68-
++ lib.optional stdenvNoCC.hostPlatform.isDarwin sysctl
69-
)
70-
}
71-
72-
runHook postInstall
73-
'';
68+
}
69+
''
70+
+ ''
71+
runHook postInstall
72+
'';
7473

7574
postInstall = lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
7675
# trick yargs into also generating zsh completions

packages/opencode/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
"@opencode-ai/sdk": "workspace:*",
116116
"@opencode-ai/util": "workspace:*",
117117
"@openrouter/ai-sdk-provider": "2.5.1",
118-
"@opentui/core": "0.1.97",
119-
"@opentui/solid": "0.1.97",
118+
"@opentui/core": "0.1.99",
119+
"@opentui/solid": "0.1.99",
120120
"@parcel/watcher": "2.5.1",
121121
"@pierre/diffs": "catalog:",
122122
"@solid-primitives/event-bus": "1.1.2",
@@ -143,6 +143,7 @@
143143
"hono": "catalog:",
144144
"hono-openapi": "catalog:",
145145
"ignore": "7.0.5",
146+
"immer": "11.1.4",
146147
"jsonc-parser": "3.3.1",
147148
"mime-types": "3.0.2",
148149
"minimatch": "10.0.3",
@@ -153,6 +154,7 @@
153154
"opentui-spinner": "0.0.6",
154155
"partial-json": "0.1.7",
155156
"remeda": "catalog:",
157+
"ripgrep": "0.3.1",
156158
"semver": "^7.6.3",
157159
"solid-js": "catalog:",
158160
"strip-ansi": "7.1.2",

packages/opencode/script/build.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ for (const item of targets) {
187187
const rootPath = path.resolve(dir, "../../node_modules/@opentui/core/parser.worker.js")
188188
const parserWorker = fs.realpathSync(fs.existsSync(localPath) ? localPath : rootPath)
189189
const workerPath = "./src/cli/cmd/tui/worker.ts"
190+
const rgPath = "./src/file/ripgrep.worker.ts"
190191

191192
// Use platform-specific bunfs root path based on target OS
192193
const bunfsRoot = item.os === "win32" ? "B:/~BUN/root/" : "/$bunfs/root/"
@@ -197,6 +198,9 @@ for (const item of targets) {
197198
tsconfig: "./tsconfig.json",
198199
plugins: [plugin],
199200
external: ["node-gyp"],
201+
format: "esm",
202+
minify: true,
203+
splitting: true,
200204
compile: {
201205
autoloadBunfig: false,
202206
autoloadDotenv: false,
@@ -210,12 +214,19 @@ for (const item of targets) {
210214
files: {
211215
...(embeddedFileMap ? { "opencode-web-ui.gen.ts": embeddedFileMap } : {}),
212216
},
213-
entrypoints: ["./src/index.ts", parserWorker, workerPath, ...(embeddedFileMap ? ["opencode-web-ui.gen.ts"] : [])],
217+
entrypoints: [
218+
"./src/index.ts",
219+
parserWorker,
220+
workerPath,
221+
rgPath,
222+
...(embeddedFileMap ? ["opencode-web-ui.gen.ts"] : []),
223+
],
214224
define: {
215225
OPENCODE_VERSION: `'${Script.version}'`,
216226
OPENCODE_MIGRATIONS: JSON.stringify(migrations),
217227
OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,
218228
OPENCODE_WORKER_PATH: workerPath,
229+
OPENCODE_RIPGREP_WORKER_PATH: rgPath,
219230
OPENCODE_CHANNEL: `'${Script.channel}'`,
220231
OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "",
221232
},

packages/opencode/script/seed-e2e.ts

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,38 @@ const seed = async () => {
3333
}),
3434
)
3535

36-
const session = await Session.create({ title })
37-
const messageID = MessageID.ascending()
38-
const partID = PartID.ascending()
39-
const message = {
40-
id: messageID,
41-
sessionID: session.id,
42-
role: "user" as const,
43-
time: { created: now },
44-
agent: "build",
45-
model: {
46-
providerID: ProviderID.make(providerID),
47-
modelID: ModelID.make(modelID),
48-
},
49-
}
50-
const part = {
51-
id: partID,
52-
sessionID: session.id,
53-
messageID,
54-
type: "text" as const,
55-
text,
56-
time: { start: now },
57-
}
58-
await Session.updateMessage(message)
59-
await Session.updatePart(part)
60-
await Project.update({ projectID: Instance.project.id, name: "E2E Project" })
36+
await AppRuntime.runPromise(
37+
Effect.gen(function* () {
38+
const session = yield* Session.Service
39+
const result = yield* session.create({ title })
40+
const messageID = MessageID.ascending()
41+
const partID = PartID.ascending()
42+
const message = {
43+
id: messageID,
44+
sessionID: result.id,
45+
role: "user" as const,
46+
time: { created: now },
47+
agent: "build",
48+
model: {
49+
providerID: ProviderID.make(providerID),
50+
modelID: ModelID.make(modelID),
51+
},
52+
}
53+
const part = {
54+
id: partID,
55+
sessionID: result.id,
56+
messageID,
57+
type: "text" as const,
58+
text,
59+
time: { start: now },
60+
}
61+
yield* session.updateMessage(message)
62+
yield* session.updatePart(part)
63+
}),
64+
)
65+
await AppRuntime.runPromise(
66+
Project.Service.use((svc) => svc.update({ projectID: Instance.project.id, name: "E2E Project" })),
67+
)
6168
},
6269
})
6370
} finally {

0 commit comments

Comments
 (0)