mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
Merge pull request #10717 from Kilo-Org/effect-vcs-facade-10712
refactor(cli): remove legacy Vcs facade
This commit is contained in:
@@ -354,7 +354,7 @@ export namespace KiloSessions {
|
||||
const getSessions = async () => {
|
||||
const [gitUrl, gitBranch] = await Promise.all([
|
||||
getGitUrl().catch(() => undefined),
|
||||
Vcs.branch().catch(() => undefined),
|
||||
branch().catch(() => undefined),
|
||||
])
|
||||
const { AppRuntime } = await import("@/effect/app-runtime")
|
||||
const statusMap = await AppRuntime.runPromise(SessionStatus.Service.use((svc) => svc.list()))
|
||||
@@ -723,11 +723,16 @@ export namespace KiloSessions {
|
||||
})
|
||||
}
|
||||
|
||||
async function branch() {
|
||||
const { AppRuntime } = await import("@/effect/app-runtime")
|
||||
return AppRuntime.runPromise(Vcs.Service.use((svc) => svc.branch()))
|
||||
}
|
||||
|
||||
async function meta(sessionId?: string) {
|
||||
const override = sessionId ? KiloSession.resolvePlatform(sessionId) : undefined
|
||||
const platform = override || process.env["KILO_PLATFORM"] || "cli"
|
||||
const orgId = await getOrgId()
|
||||
const gitBranch = await Vcs.branch().catch(() => undefined)
|
||||
const gitBranch = await branch().catch(() => undefined)
|
||||
const gitUrl = await getGitUrl().catch(() => undefined)
|
||||
|
||||
return {
|
||||
|
||||
@@ -7,7 +7,6 @@ import { FileWatcher } from "@/file/watcher"
|
||||
import { Git } from "@/git"
|
||||
import * as Log from "@opencode-ai/core/util/log"
|
||||
import { zod, zodObject } from "@/util/effect-zod"
|
||||
import { makeRuntime } from "@/effect/run-service" // kilocode_change
|
||||
import { NonNegativeInt, withStatics } from "@/util/schema"
|
||||
|
||||
const log = Log.create({ service: "vcs" })
|
||||
@@ -408,10 +407,4 @@ export const layer: Layer.Layer<Service, never, Git.Service | Bus.Service> = Lay
|
||||
|
||||
export const defaultLayer = layer.pipe(Layer.provide(Git.defaultLayer), Layer.provide(Bus.layer))
|
||||
|
||||
// kilocode_change start - legacy promise helpers for Kilo callsites
|
||||
const { runPromise } = makeRuntime(Service, defaultLayer)
|
||||
export const branch = () => runPromise((svc) => svc.branch())
|
||||
export const defaultBranch = () => runPromise((svc) => svc.defaultBranch())
|
||||
// kilocode_change end
|
||||
|
||||
export * as Vcs from "./vcs"
|
||||
|
||||
@@ -20,7 +20,6 @@ const allow: Record<string, string> = {
|
||||
"cli/cmd/tui/config/tui.ts": "separately tracked TUI config facade",
|
||||
"installation/index.ts": "existing installation facade outside #10655",
|
||||
"permission/index.ts": "transitional facade removed by #10620",
|
||||
"project/vcs.ts": "transitional facade removed by #10620",
|
||||
"question/index.ts": "transitional facade deferred for upstream reconciliation in #10655",
|
||||
"session/compaction.ts": "existing compaction facade outside #10655",
|
||||
"session/prompt.ts": "transitional facade tracked by #10655",
|
||||
|
||||
Reference in New Issue
Block a user