Skip to content

Commit da6dbeb

Browse files
authored
remove unused exports and imports (#59673)
1 parent bbad8f3 commit da6dbeb

37 files changed

Lines changed: 18 additions & 84 deletions

‎packages/opencode/src/account/account.ts‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ import { LayerNode } from "@opencode-ai/core/effect/layer-node"
22
import { httpClient } from "@opencode-ai/core/effect/app-node-platform"
33
import { Cache, Clock, Duration, Effect, Layer, Option, Schema, SchemaGetter, Context } from "effect"
44
import { serviceUse } from "@opencode-ai/core/effect/service-use"
5-
import {
6-
FetchHttpClient,
7-
HttpClient,
8-
HttpClientError,
9-
HttpClientRequest,
10-
HttpClientResponse,
11-
} from "effect/unstable/http"
5+
import { HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"
126

137
import { withTransientReadRetry } from "@/util/effect-http-client"
148
import { AccountRepo, type AccountRow } from "./repo"

‎packages/opencode/src/cli/cmd/debug/agent.handler.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Cause, Effect } from "effect"
66
import { Agent } from "../../../agent/agent"
77
import { Provider } from "@/provider/provider"
88
import { Session } from "@/session/session"
9-
import type { MessageV2 } from "../../../session/message-v2"
109
import { MessageID, PartID } from "../../../session/schema"
1110
import { ToolRegistry } from "@/tool/registry"
1211
import { Permission } from "../../../permission"

‎packages/opencode/src/cli/network.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Argv, InferredOptionTypes } from "yargs"
22
import { ConfigV1 } from "@opencode-ai/core/v1/config/config"
3-
import type { Config } from "@/config/config"
43
import { Effect } from "effect"
54

65
const options = {

‎packages/opencode/src/config/config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type { ConsoleState } from "@opencode-ai/core/v1/config/console-state"
1919
import { FSUtil } from "@opencode-ai/core/fs-util"
2020
import { InstanceState } from "@/effect/instance-state"
2121
import { Context, Duration, Effect, Exit, Fiber, Layer, Option, Schema } from "effect"
22-
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http"
22+
import { HttpClient, HttpClientRequest } from "effect/unstable/http"
2323
import { EffectFlock } from "@opencode-ai/core/util/effect-flock"
2424
import { containsPath, type InstanceContext } from "../project/instance-context"
2525
import { ConfigV1 } from "@opencode-ai/core/v1/config/config"

‎packages/opencode/src/config/markdown.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ export function shell(template: string) {
1313
return Array.from(template.matchAll(SHELL_REGEX))
1414
}
1515

16-
// other coding agents like claude code allow invalid yaml in their
17-
// frontmatter, we need to fallback to a more permissive parser for those cases
18-
export const fallbackSanitization = ConfigMarkdownCore.sanitize
19-
2016
export async function parse(filePath: string) {
2117
const template = await Filesystem.readText(filePath)
2218

‎packages/opencode/src/control-plane/workspace.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { LayerNode } from "@opencode-ai/core/effect/layer-node"
22
import { httpClient } from "@opencode-ai/core/effect/app-node-platform"
33
import { Context, Effect, FiberMap, Iterable, Layer, Schema, Stream } from "effect"
44
import { serviceUse } from "@opencode-ai/core/effect/service-use"
5-
import { FetchHttpClient, HttpBody, HttpClient, HttpClientError, HttpClientRequest } from "effect/unstable/http"
5+
import { HttpBody, HttpClient, HttpClientError, HttpClientRequest } from "effect/unstable/http"
66
import { Database } from "@opencode-ai/core/database/database"
77
import { asc } from "drizzle-orm"
88
import { eq } from "drizzle-orm"

‎packages/opencode/src/image/image.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
22
import { Config } from "@/config/config"
33
import { SessionV1 } from "@opencode-ai/core/v1/session"
4-
import type { MessageV2 } from "@/session/message-v2"
54
import photonWasm from "@silvia-odwyer/photon-node/photon_rs_bg.wasm" with { type: "file" }
65
import { Context, Effect, Layer, Schema } from "effect"
76
import path from "node:path"

‎packages/opencode/src/installation/index.ts‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,8 @@ import { InstallationEvent } from "@opencode-ai/schema/installation-event"
1717

1818
export type Method = "curl" | "npm" | "yarn" | "pnpm" | "bun" | "brew" | "scoop" | "choco" | "unknown"
1919

20-
export type ReleaseType = "patch" | "minor" | "major"
21-
2220
export const Event = InstallationEvent
2321

24-
export function getReleaseType(current: string, latest: string): ReleaseType {
25-
const currMajor = semver.major(current)
26-
const currMinor = semver.minor(current)
27-
const newMajor = semver.major(latest)
28-
const newMinor = semver.minor(latest)
29-
30-
if (newMajor > currMajor) return "major"
31-
if (newMinor > currMinor) return "minor"
32-
return "patch"
33-
}
34-
3522
export const Info = Schema.Struct({
3623
version: Schema.String,
3724
latest: Schema.String,
@@ -44,10 +31,6 @@ export function userAgent(client = "cli") {
4431

4532
export const USER_AGENT = userAgent()
4633

47-
export function isPreview() {
48-
return InstallationChannel !== "latest"
49-
}
50-
5134
export function isLocal() {
5235
return InstallationChannel === "local"
5336
}

‎packages/opencode/src/lsp/client.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createMessageConnection, StreamMessageReader, StreamMessageWriter } fro
44
import type { Diagnostic as VSCodeDiagnostic } from "vscode-languageserver-types"
55
import { Process } from "@/util/process"
66
import { LANGUAGE_EXTENSIONS } from "./language"
7-
import { Effect, Schema } from "effect"
7+
import { Schema } from "effect"
88
import type * as LSPServer from "./server"
99
import { withTimeout } from "../util/timeout"
1010
import { Filesystem } from "@/util/filesystem"

‎packages/opencode/src/server/shared/ui.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const UI_UPSTREAM = new URL("https://app.opencode.ai")
1010

1111
export const csp = (hash = "") =>
1212
`default-src 'self'; script-src 'self' 'wasm-unsafe-eval'${hash ? ` 'sha256-${hash}'` : ""}; style-src 'self' 'unsafe-inline'; img-src 'self' data: https: blob:; font-src 'self' data:; media-src 'self' data:; connect-src * data: blob:`
13-
export const DEFAULT_CSP = csp()
1413

1514
export function themePreloadHash(body: string) {
1615
return body.match(/<script\b(?![^>]*\bsrc\s*=)[^>]*\bid=(['"])oc-theme-preload-script\1[^>]*>([\s\S]*?)<\/script>/i)

0 commit comments

Comments
 (0)