Skip to content

Commit 07e04c1

Browse files
refactor(provider-opencode): move OpenCode into its own provider package
OpenCode 1.x and 2.x move into @t3tools/provider-opencode with the same layout as Pi and Muse: - ./settings: the instance settings schema, moved out of contracts. - ./client: label, settings form, and a plain-data glyph. Web and mobile draw it from the package; the collapsed composer's monochrome icon now clears any package icon's per-path detail fill, not an OpenCode-only attribute. - ./server: the driver, the adapter driver, and the runtime and server ledger layers the server provides once. - ./testing: the 2.x client, server, adapter, and text generation that the server's replay testkits drive. The adapters, driver, and text generation reach the server only through ProviderHost (cwd and attachment paths); the server ledger takes its state directory as layer input. Helpers other providers share move with it: atomic file writes to @t3tools/shared, native protocol log summaries and subagent projection helpers to provider-core. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 54e1729 commit 07e04c1

92 files changed

Lines changed: 490 additions & 421 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.

‎apps/mobile/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"@t3tools/mobile-terminal-native": "file:./modules/t3-terminal",
7272
"@t3tools/provider-core": "workspace:*",
7373
"@t3tools/provider-muse": "workspace:*",
74+
"@t3tools/provider-opencode": "workspace:*",
7475
"@t3tools/provider-pi": "workspace:*",
7576
"@t3tools/shared": "workspace:*",
7677
"@tabler/icons-react-native": "^3.44.0",

‎apps/mobile/src/components/ProviderIcon.tsx‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ export function ProviderIcon(props: ProviderIconProps) {
138138
);
139139
}
140140

141-
if (props.provider === "opencode") {
142-
return (
143-
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
144-
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
145-
<Path d="M24 8H8V32H24V8ZM32 40H0V0H32V40Z" fill={isDarkMode ? "#F1ECEC" : "#211E1E"} />
146-
</Svg>
147-
);
148-
}
149-
150141
// codex (and unknown drivers)
151142
return (
152143
<Svg width={size} height={size} viewBox="100 100 411 411" fill="none">

‎apps/mobile/src/lib/providerClients.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { isProviderDriverKind } from "@t3tools/contracts";
22
import { makeProviderClientRegistry } from "@t3tools/provider-core/client";
33
import { museClient } from "@t3tools/provider-muse/client";
4+
import { openCodeClient } from "@t3tools/provider-opencode/client";
45
import { piClient } from "@t3tools/provider-pi/client";
56

67
/** The provider client definitions this mobile build ships. */
7-
const providerClients = makeProviderClientRegistry([museClient, piClient]);
8+
const providerClients = makeProviderClientRegistry([museClient, openCodeClient, piClient]);
89

910
/** The client definition for a driver kind, or `undefined` for drivers drawn by hand. */
1011
export function getProviderClient(driver: string | null | undefined) {

‎apps/server/package.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@
3838
"@napi-rs/keyring": "^1.3.0",
3939
"@noble/hashes": "catalog:",
4040
"@opencode-ai/sdk": "^1.3.15",
41-
"@opencode/client": "2.0.23",
42-
"@opencode/protocol": "2.0.23",
43-
"@opencode/schema": "2.0.23",
4441
"@t3tools/provider-core": "workspace:*",
4542
"@t3tools/provider-muse": "workspace:*",
43+
"@t3tools/provider-opencode": "workspace:*",
4644
"@t3tools/provider-pi": "workspace:*",
4745
"diff": "8.0.3",
4846
"effect": "catalog:",

‎apps/server/src/cli/theme.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import * as Path from "effect/Path";
3535
import * as Schema from "effect/Schema";
3636
import { Argument, Command, Flag } from "effect/cli";
3737

38-
import { writeFileStringAtomically } from "../atomicWrite.ts";
38+
import { writeFileStringAtomically } from "@t3tools/shared/atomicWrite";
3939
import * as ServerConfig from "../config.ts";
4040
import {
4141
MAX_THEME_FILE_BYTES,

‎apps/server/src/device/LocalDeviceHost.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import { HttpClient } from "effect/http";
4747
import * as ChildProcess from "effect/process/ChildProcess";
4848
import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
4949

50-
import { writeFileStringAtomically } from "../atomicWrite.ts";
50+
import { writeFileStringAtomically } from "@t3tools/shared/atomicWrite";
5151
import * as ServerConfig from "../config.ts";
5252
import * as ProcessRunner from "../processRunner.ts";
5353
import * as DeviceHost from "./DeviceHost.ts";

‎apps/server/src/keybindings.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import * as Scope from "effect/Scope";
4141
import * as Stream from "effect/Stream";
4242
import * as Semaphore from "effect/Semaphore";
4343
import * as ServerConfig from "./config.ts";
44-
import { writeFileStringAtomically } from "./atomicWrite.ts";
44+
import { writeFileStringAtomically } from "@t3tools/shared/atomicWrite";
4545
import { fromJsonStringPretty, fromLenientJson } from "@t3tools/shared/schemaJson";
4646
import {
4747
DEFAULT_KEYBINDINGS,

‎apps/server/src/mcp/OrchestratorMcpService.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ import * as ProviderAdapterRegistry from "../orchestration-v2/ProviderAdapterReg
7575
import {
7676
subagentResultForRun,
7777
delegatedTaskProgress,
78-
} from "../orchestration-v2/SubagentProjection.ts";
78+
} from "@t3tools/provider-core/server/subagentProjection";
7979
import {
8080
DispatchModeLimit,
8181
type DispatchModeRefusal,

‎apps/server/src/orchestration-v2/AcpRegistryOrchestratorV2.live.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
3030
import * as ModelManifest from "../provider/ModelManifest.ts";
3131
import * as ProviderInstanceRegistryHydration from "../provider/ProviderInstanceRegistryHydration.ts";
3232
import * as ProviderEventLoggers from "../provider/ProviderEventLoggers.ts";
33-
import * as OpenCodeRuntime from "../provider/opencodeRuntime.ts";
34-
import * as OpenCodeServerLedger from "../provider/OpenCodeServerLedger.ts";
33+
import { OpenCodeRuntime } from "@t3tools/provider-opencode/server";
34+
import { OpenCodeServerLedger } from "@t3tools/provider-opencode/server";
3535
import * as ServerSettings from "../serverSettings.ts";
3636
import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
3737
import * as VcsProcess from "../vcs/VcsProcess.ts";

‎apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ import {
119119
makeSubagentChildThread,
120120
makeSubagentConversationArtifacts,
121121
subagentThreadTitle,
122-
} from "../SubagentProjection.ts";
122+
} from "@t3tools/provider-core/server/subagentProjection";
123123
import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
124124

125125
export const ACP_PROTOCOL = "acp.ndjson-jsonrpc" as const;

0 commit comments

Comments
 (0)