Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/effect-4-modernize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"opencode-drive": minor
---

Upgrade Effect to 4.0.1, `@opencode/client` to `0.0.0-dev-20807`, Bun to 1.4.2, and runtime/typecheck dependencies; resolve directory-index `effect/*` subpaths during script typechecking.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.0"
bun-version: "1.4.2"

- run: sudo apt-get update && sudo apt-get install -y ffmpeg
- run: bun install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.0"
bun-version: "1.4.2"

- run: sudo apt-get update && sudo apt-get install --yes ffmpeg
- run: bun install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.0"
bun-version: "1.4.2"

- run: sudo apt-get update && sudo apt-get install -y ffmpeg
- run: bun install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion apps/catalog/catalog/lifecycle-flows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe("catalog lifecycle scenarios", () => {
"src/ledger.ts": expect.stringContaining("total"),
})
expect(runtime.tools).toBeFunction()
expect(runtime.setup).toBeFunction()
expect(runtime.tuiConfig).toEqual({ theme: { name: "rosepine" } })
expect(catalogScenarioRuntime({ opencode: "/tmp/opencode", git: true }).project).toMatchObject({
git: true,
files: { ".gitignore": ".opencode/\n" },
Expand Down
26 changes: 13 additions & 13 deletions apps/catalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@opencode-drive/catalog",
"private": true,
"type": "module",
"packageManager": "bun@1.4.0",
"packageManager": "bun@1.4.2",
"scripts": {
"generate": "bun ./scripts/generate-catalog.ts",
"capture": "bun ./scripts/capture-opencode-drive.ts",
Expand All @@ -20,22 +20,22 @@
"drive:capture": "bun run capture"
},
"dependencies": {
"@fontsource/commit-mono": "5.2.5",
"@fontsource/commit-mono": "5.3.0",
"@fontsource/noto-sans-math": "5.2.8",
"@fontsource/noto-sans-symbols": "5.2.8",
"@fontsource/noto-sans-symbols-2": "5.2.8",
"react": "^19.2.7",
"react-dom": "^19.2.7"
"@fontsource/noto-sans-symbols": "5.3.0",
"@fontsource/noto-sans-symbols-2": "5.3.0",
"react": "^19.3.0",
"react-dom": "^19.3.0"
},
"devDependencies": {
"@napi-rs/canvas": "1.0.8",
"@types/bun": "^1.4.0",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"effect": "4.0.0-rc.112",
"@napi-rs/canvas": "1.0.11",
"@types/bun": "^1.4.2",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"effect": "4.0.1",
"opencode-drive": "workspace:*",
"oxlint": "1.60.0",
"oxlint": "1.87.0",
"typescript": "^7.0.2",
"wrangler": "4.110.0"
"wrangler": "4.149.0"
}
}
9 changes: 1 addition & 8 deletions apps/catalog/scenarios/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ export function catalogScenarioRuntime(options: {
)
tools.handle("websearch", () => Effect.fail(new Tool.Failure({ message: "catalog web search provider failure" })))
},
setup:
options.theme === undefined
? undefined
: ({ fs }) =>
fs.writeFile(
".opencode/tui.json",
`${JSON.stringify({ $schema: "https://opencode.ai/tui.json", theme: options.theme }, undefined, 2)}\n`,
),
tuiConfig: options.theme === undefined ? undefined : { theme: { name: options.theme } },
tui: { viewport: catalogViewport },
opencode: { dev: options.opencode },
}
Expand Down
2 changes: 1 addition & 1 deletion apps/catalog/scenarios/tools/question-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const questionLifecycleFlow = defineExecutableFlow(
yield* checkpoint(awaiting)
yield* driver.ui.enter()
yield* driver.ui.enter()
yield* driver.ui.waitFor("Review", { timeout: 5_000 })
yield* driver.ui.waitFor("Validation: Focused", { timeout: 5_000 })
yield* checkpoint(review)
yield* driver.ui.enter()
yield* driver.ui.waitFor("The catalog answers were submitted.", { timeout: 15_000 })
Expand Down
2 changes: 1 addition & 1 deletion apps/catalog/scenarios/tools/shell-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const shellLifecycleFlow = defineExecutableFlow(
yield* driver.ui.submit("Run one successful foreground shell command.")
yield* Effect.sleep(250)
yield* checkpoint(thinkingStreaming)
yield* driver.ui.waitFor("Writing command...", { timeout: 15_000 })
yield* driver.ui.waitFor("Writing command", { timeout: 15_000 })
yield* checkpoint(inputStreaming)
yield* driver.ui.waitFor("printf catalog-shell-success", { timeout: 15_000 })
yield* checkpoint(outputStreaming)
Expand Down
4 changes: 2 additions & 2 deletions apps/catalog/scenarios/tools/web-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ export const webLifecycleFlow = defineExecutableFlow(
)

yield* driver.ui.submit("Fetch the Example Domain.")
yield* driver.ui.waitFor("Fetching from the web...", { timeout: 30_000 })
yield* driver.ui.waitFor(() => driver.ui.matches("1 fetch").pipe(Effect.flatMap((matched) => matched ? Effect.succeed(true) : driver.ui.matches("Fetching from the web"))), { timeout: 30_000 })
yield* checkpoint(webfetchStreaming)
yield* driver.ui.waitFor("Permission required", { timeout: 15_000 })
yield* driver.ui.enter()
yield* driver.ui.waitFor("The web fetch is complete.", { timeout: 30_000 })
yield* checkpoint(webfetchSuccess)

yield* driver.ui.submit("Search the web for the OpenCode terminal interface.")
yield* driver.ui.waitFor("Searching web...", { timeout: 30_000 })
yield* driver.ui.waitFor(() => driver.ui.matches("1 search").pipe(Effect.flatMap((matched) => matched ? Effect.succeed(true) : driver.ui.matches("Searching web"))), { timeout: 30_000 })
yield* checkpoint(websearchRunning)
yield* Effect.sleep(1_000)
yield* checkpoint(websearchFailure)
Expand Down
19 changes: 16 additions & 3 deletions apps/catalog/scripts/capture-opencode-drive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ const openNewSession = Effect.fn("Catalog.openNewSession")(function* (ui: OpenCo
yield* ui.type("New session")
yield* ui.waitFor("New session", { timeout: 15_000 })
yield* ui.enter()
yield* ui.waitFor("Ask anything...", { timeout: 15_000 })
yield* ui.waitFor((state) => state.focused.editor, { timeout: 15_000 })
yield* ui.waitFor("Ask anything", { timeout: 15_000 })
})

const captureBaseline = (driver: OpenCodeDriver.Driver, variant: Variant) =>
Expand Down Expand Up @@ -336,6 +337,18 @@ function isCaptureId(value: string): value is CaptureId {
return value in screens
}

function toCaptureSet(variant: Variant): CaptureSet {
return {
id: variant.id,
label: variant.label,
source: variant.source,
revision: variant.revision,
ref: variant.ref,
committedAt: variant.committedAt,
...(variant.theme === undefined ? {} : { theme: variant.theme }),
}
}

try {
const captured =
options.workerOutput === undefined && options.flow === undefined && variants.length > 1 && options.jobs > 1
Expand Down Expand Up @@ -374,7 +387,7 @@ try {
await rename(join(stagingRoot, variant.id), target)
await Bun.write(
join(options.workerOutput, `${variant.id}.json`),
`${JSON.stringify({ variant: (({ path: _, ...value }) => value)(variant), captures: captured[0] ?? [] })}\n`,
`${JSON.stringify({ variant: toCaptureSet(variant), captures: captured[0] ?? [] })}\n`,
)
} else {
for (const variant of variants) {
Expand All @@ -384,7 +397,7 @@ try {
await rename(join(stagingRoot, variant.id), target)
}
const manifestFile = new URL("../public/drive-captures.json", import.meta.url)
const captureSets = variants.map(({ path: _, ...variant }) => variant satisfies CaptureSet)
const captureSets = variants.map(toCaptureSet)
const manifest = captureMatrixManifest(captureSets, captures)
await Bun.write(manifestFile, `${JSON.stringify(manifest, undefined, 2)}\n`)
}
Expand Down
Loading
Loading