CLI perf: reduce deps (#22652)

This commit is contained in:
Dax
2026-04-16 02:03:03 -04:00
committed by GitHub
parent 150ab07a83
commit 675a46e23e
84 changed files with 1415 additions and 1011 deletions

View File

@@ -47,8 +47,10 @@ import { Pty } from "@/pty"
import { Installation } from "@/installation"
import { ShareNext } from "@/share"
import { SessionShare } from "@/share"
import { Npm } from "@opencode-ai/shared/npm"
export const AppLayer = Layer.mergeAll(
Npm.defaultLayer,
AppFileSystem.defaultLayer,
Bus.defaultLayer,
Auth.defaultLayer,

View File

@@ -3,7 +3,7 @@ import { FetchHttpClient } from "effect/unstable/http"
import { OtlpLogger, OtlpSerialization } from "effect/unstable/observability"
import * as EffectLogger from "./logger"
import { Flag } from "@/flag/flag"
import { CHANNEL, VERSION } from "@/installation/meta"
import { InstallationChannel, InstallationVersion } from "@/installation/version"
const base = Flag.OTEL_EXPORTER_OTLP_ENDPOINT
export const enabled = !!base
@@ -21,9 +21,9 @@ const headers = Flag.OTEL_EXPORTER_OTLP_HEADERS
const resource = {
serviceName: "opencode",
serviceVersion: VERSION,
serviceVersion: InstallationVersion,
attributes: {
"deployment.environment.name": CHANNEL === "local" ? "local" : CHANNEL,
"deployment.environment.name": InstallationChannel,
"opencode.client": Flag.OPENCODE_CLIENT,
},
}
@@ -76,3 +76,5 @@ export const layer = !base
return Layer.mergeAll(trace, logs)
}),
)
export const Observability = { enabled, layer }