GeezerVison is showing github.com — refactor(core): consolidate pty service (#30537) · argszero/opencode@932fb6c
File treeExpand file treeCollapse file tree Open diff view settings server/routes/instance/httpapi
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: bun.lock +2-2Lines changed: 2 additions & 2 deletions Collapse file Copy file name to clipboardExpand all lines: package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 | "lint": "oxlint", | 16 | 16 | "typecheck": "bun turbo typecheck", | 17 | 17 | "upgrade-opentui": "bun run script/upgrade-opentui.ts", | 18 | | - "postinstall": "bun run --cwd packages/opencode fix-node-pty", | | 18 | + "postinstall": "bun run --cwd packages/core fix-node-pty", | 19 | 19 | "prepare": "husky", | 20 | 20 | "random": "echo 'Random script'", | 21 | 21 | "sso": "aws sso login --sso-session=opencode --no-browser", | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/package.json +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | "scripts": { | 9 | 9 | "db": "bun drizzle-kit", | 10 | 10 | "migration": "bun run script/migration.ts", | | 11 | + "fix-node-pty": "bun run script/fix-node-pty.ts", | 11 | 12 | "test": "bun test", | 12 | 13 | "test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", | 13 | 14 | "typecheck": "tsgo --noEmit" | | 23 | 24 | "bun": "./src/database/sqlite.bun.ts", | 24 | 25 | "node": "./src/database/sqlite.node.ts", | 25 | 26 | "default": "./src/database/sqlite.bun.ts" | | 27 | + }, | | 28 | + "#pty": { | | 29 | + "bun": "./src/pty/pty.bun.ts", | | 30 | + "node": "./src/pty/pty.node.ts", | | 31 | + "default": "./src/pty/pty.bun.ts" | 26 | 32 | } | 27 | 33 | }, | 28 | 34 | "devDependencies": { | | 69 | 75 | "@effect/opentelemetry": "catalog:", | 70 | 76 | "@effect/platform-node": "catalog:", | 71 | 77 | "@effect/sql-sqlite-bun": "catalog:", | | 78 | + "@lydell/node-pty": "catalog:", | 72 | 79 | "@npmcli/arborist": "9.4.0", | 73 | 80 | "@npmcli/config": "10.8.1", | 74 | 81 | "@opencode-ai/effect-drizzle-sqlite": "workspace:*", | | 80 | 87 | "@parcel/watcher": "2.5.1", | 81 | 88 | "@openrouter/ai-sdk-provider": "2.8.1", | 82 | 89 | "ai-gateway-provider": "3.1.2", | | 90 | + "bun-pty": "0.4.8", | 83 | 91 | "cross-spawn": "catalog:", | 84 | 92 | "drizzle-orm": "catalog:", | 85 | 93 | "effect": "catalog:", | |
Collapse file Copy file name to clipboard File renamed without changes. Collapse file Copy file name to clipboardExpand all lines: packages/core/src/location-layer.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,6 +21,7 @@ import { FileSystem } from "./filesystem" | 21 | 21 | import { Watcher } from "./filesystem/watcher" | 22 | 22 | import { ProjectReference } from "./project-reference" | 23 | 23 | import { RepositoryCache } from "./repository-cache" | | 24 | +import { Pty } from "./pty" | 24 | 25 |
| 25 | 26 | export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()("@opencode/example/LocationServiceMap", { | 26 | 27 | lookup: (ref: Location.Ref) => { | @@ -37,6 +38,7 @@ export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()(" | 37 | 38 | PermissionV2.locationLayer, | 38 | 39 | FileSystem.locationLayer, | 39 | 40 | Watcher.locationLayer, | | 41 | + Pty.locationLayer, | 40 | 42 | ).pipe(Layer.provideMerge(location), Layer.fresh) | 41 | 43 | }, | 42 | 44 | idleTimeToLive: "60 minutes", | |
|