Compare commits

...

1 Commits

Author SHA1 Message Date
Kit Langton 1170776f8c feat: unwrap project namespaces to flat exports + barrel 2026-04-15 23:14:54 -04:00
18 changed files with 655 additions and 657 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { EOL } from "os" import { EOL } from "os"
import { Project } from "../../../project/project" import { Project } from "../../../project"
import { Log } from "../../../util/log" import { Log } from "../../../util/log"
import { cmd } from "../cmd" import { cmd } from "../cmd"
+1 -1
View File
@@ -4,7 +4,7 @@ import { Session } from "../../session"
import { bootstrap } from "../bootstrap" import { bootstrap } from "../bootstrap"
import { Database } from "../../storage/db" import { Database } from "../../storage/db"
import { SessionTable } from "../../session/session.sql" import { SessionTable } from "../../session/session.sql"
import { Project } from "../../project/project" import { Project } from "../../project"
import { Instance } from "../../project/instance" import { Instance } from "../../project/instance"
import { AppRuntime } from "@/effect/app-runtime" import { AppRuntime } from "@/effect/app-runtime"
@@ -2,7 +2,7 @@ import z from "zod"
import { setTimeout as sleep } from "node:timers/promises" import { setTimeout as sleep } from "node:timers/promises"
import { fn } from "@/util/fn" import { fn } from "@/util/fn"
import { Database, asc, eq, inArray } from "@/storage/db" import { Database, asc, eq, inArray } from "@/storage/db"
import { Project } from "@/project/project" import { Project } from "@/project"
import { BusEvent } from "@/bus/bus-event" import { BusEvent } from "@/bus/bus-event"
import { GlobalBus } from "@/bus/global" import { GlobalBus } from "@/bus/global"
import { SyncEvent } from "@/sync" import { SyncEvent } from "@/sync"
+2 -2
View File
@@ -40,8 +40,8 @@ import { Command } from "@/command"
import { Truncate } from "@/tool/truncate" import { Truncate } from "@/tool/truncate"
import { ToolRegistry } from "@/tool/registry" import { ToolRegistry } from "@/tool/registry"
import { Format } from "@/format" import { Format } from "@/format"
import { Project } from "@/project/project" import { Project } from "@/project"
import { Vcs } from "@/project/vcs" import { Vcs } from "@/project"
import { Worktree } from "@/worktree" import { Worktree } from "@/worktree"
import { Pty } from "@/pty" import { Pty } from "@/pty"
import { Installation } from "@/installation" import { Installation } from "@/installation"
@@ -7,7 +7,7 @@ import { FileWatcher } from "@/file/watcher"
import { Format } from "@/format" import { Format } from "@/format"
import { ShareNext } from "@/share/share-next" import { ShareNext } from "@/share/share-next"
import { File } from "@/file" import { File } from "@/file"
import { Vcs } from "@/project/vcs" import { Vcs } from "@/project"
import { Snapshot } from "@/snapshot" import { Snapshot } from "@/snapshot"
import { Bus } from "@/bus" import { Bus } from "@/bus"
import { Observability } from "./observability" import { Observability } from "./observability"
+2 -2
View File
@@ -3,8 +3,8 @@ import { Format } from "../format"
import { LSP } from "../lsp" import { LSP } from "../lsp"
import { File } from "../file" import { File } from "../file"
import { Snapshot } from "../snapshot" import { Snapshot } from "../snapshot"
import { Project } from "./project" import { Project } from "."
import { Vcs } from "./vcs" import { Vcs } from "."
import { Bus } from "../bus" import { Bus } from "../bus"
import { Command } from "../command" import { Command } from "../command"
import { Instance } from "./instance" import { Instance } from "./instance"
+2
View File
@@ -0,0 +1,2 @@
export * as Vcs from "./vcs"
export * as Project from "./project"
+1 -1
View File
@@ -5,7 +5,7 @@ import { AppFileSystem } from "@opencode-ai/shared/filesystem"
import { iife } from "@/util/iife" import { iife } from "@/util/iife"
import { Log } from "@/util/log" import { Log } from "@/util/log"
import { LocalContext } from "../util/local-context" import { LocalContext } from "../util/local-context"
import { Project } from "./project" import { Project } from "."
import { WorkspaceContext } from "@/control-plane/workspace-context" import { WorkspaceContext } from "@/control-plane/workspace-context"
export interface InstanceContext { export interface InstanceContext {
-2
View File
@@ -14,7 +14,6 @@ import { NodePath } from "@effect/platform-node"
import { AppFileSystem } from "@opencode-ai/shared/filesystem" import { AppFileSystem } from "@opencode-ai/shared/filesystem"
import * as CrossSpawnSpawner from "@/effect/cross-spawn-spawner" import * as CrossSpawnSpawner from "@/effect/cross-spawn-spawner"
export namespace Project {
const log = Log.create({ service: "project" }) const log = Log.create({ service: "project" })
export const Info = z export const Info = z
@@ -484,4 +483,3 @@ export namespace Project {
db.update(ProjectTable).set({ time_initialized: Date.now() }).where(eq(ProjectTable.id, id)).run(), db.update(ProjectTable).set({ time_initialized: Date.now() }).where(eq(ProjectTable.id, id)).run(),
) )
} }
}
-2
View File
@@ -11,7 +11,6 @@ import { Log } from "@/util/log"
import { Instance } from "./instance" import { Instance } from "./instance"
import z from "zod" import z from "zod"
export namespace Vcs {
const log = Log.create({ service: "vcs" }) const log = Log.create({ service: "vcs" })
const count = (text: string) => { const count = (text: string) => {
@@ -230,4 +229,3 @@ export namespace Vcs {
Layer.provide(AppFileSystem.defaultLayer), Layer.provide(AppFileSystem.defaultLayer),
Layer.provide(Bus.layer), Layer.provide(Bus.layer),
) )
}
@@ -5,7 +5,7 @@ import { ProviderID, ModelID } from "../../provider/schema"
import { ToolRegistry } from "../../tool/registry" import { ToolRegistry } from "../../tool/registry"
import { Worktree } from "../../worktree" import { Worktree } from "../../worktree"
import { Instance } from "../../project/instance" import { Instance } from "../../project/instance"
import { Project } from "../../project/project" import { Project } from "../../project"
import { MCP } from "../../mcp" import { MCP } from "../../mcp"
import { Session } from "../../session" import { Session } from "../../session"
import { Config } from "../../config" import { Config } from "../../config"
@@ -6,7 +6,7 @@ import z from "zod"
import { Format } from "../../format" import { Format } from "../../format"
import { TuiRoutes } from "./tui" import { TuiRoutes } from "./tui"
import { Instance } from "../../project/instance" import { Instance } from "../../project/instance"
import { Vcs } from "../../project/vcs" import { Vcs } from "../../project"
import { Agent } from "../../agent/agent" import { Agent } from "../../agent/agent"
import { Skill } from "../../skill" import { Skill } from "../../skill"
import { Global } from "../../global" import { Global } from "../../global"
@@ -2,7 +2,7 @@ import { Hono } from "hono"
import { describeRoute, validator } from "hono-openapi" import { describeRoute, validator } from "hono-openapi"
import { resolver } from "hono-openapi" import { resolver } from "hono-openapi"
import { Instance } from "../../project/instance" import { Instance } from "../../project/instance"
import { Project } from "../../project/project" import { Project } from "../../project"
import z from "zod" import z from "zod"
import { ProjectID } from "../../project/schema" import { ProjectID } from "../../project/schema"
import { errors } from "../error" import { errors } from "../error"
+1 -1
View File
@@ -3,7 +3,7 @@ import { NamedError } from "@opencode-ai/shared/util/error"
import { Global } from "../global" import { Global } from "../global"
import { Instance } from "../project/instance" import { Instance } from "../project/instance"
import { InstanceBootstrap } from "../project/bootstrap" import { InstanceBootstrap } from "../project/bootstrap"
import { Project } from "../project/project" import { Project } from "../project"
import { Database, eq } from "../storage/db" import { Database, eq } from "../storage/db"
import { ProjectTable } from "../project/project.sql" import { ProjectTable } from "../project/project.sql"
import type { ProjectID } from "../project/schema" import type { ProjectID } from "../project/schema"
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test" import { describe, expect, test } from "bun:test"
import { Project } from "../../src/project/project" import { Project } from "../../src/project"
import { Database, eq } from "../../src/storage/db" import { Database, eq } from "../../src/storage/db"
import { SessionTable } from "../../src/session/session.sql" import { SessionTable } from "../../src/session/session.sql"
import { ProjectTable } from "../../src/project/project.sql" import { ProjectTable } from "../../src/project/project.sql"
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test" import { describe, expect, test } from "bun:test"
import { Project } from "../../src/project/project" import { Project } from "../../src/project"
import { Log } from "../../src/util/log" import { Log } from "../../src/util/log"
import { $ } from "bun" import { $ } from "bun"
import path from "path" import path from "path"
+1 -1
View File
@@ -8,7 +8,7 @@ import { AppRuntime } from "../../src/effect/app-runtime"
import { FileWatcher } from "../../src/file/watcher" import { FileWatcher } from "../../src/file/watcher"
import { Instance } from "../../src/project/instance" import { Instance } from "../../src/project/instance"
import { GlobalBus } from "../../src/bus/global" import { GlobalBus } from "../../src/bus/global"
import { Vcs } from "../../src/project/vcs" import { Vcs } from "../../src/project"
// Skip in CI — native @parcel/watcher binding needed // Skip in CI — native @parcel/watcher binding needed
const describeVcs = FileWatcher.hasNativeBinding() && !process.env.CI ? describe : describe.skip const describeVcs = FileWatcher.hasNativeBinding() && !process.env.CI ? describe : describe.skip
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test"
import { Effect } from "effect" import { Effect } from "effect"
import z from "zod" import z from "zod"
import { Instance } from "../../src/project/instance" import { Instance } from "../../src/project/instance"
import { Project } from "../../src/project/project" import { Project } from "../../src/project"
import { Session as SessionNs } from "../../src/session" import { Session as SessionNs } from "../../src/session"
import { Log } from "../../src/util/log" import { Log } from "../../src/util/log"
import { tmpdir } from "../fixture/fixture" import { tmpdir } from "../fixture/fixture"