CLI perf: reduce deps (#22652)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Hooks, PluginInput } from "@opencode-ai/plugin"
|
||||
import type { Model } from "@opencode-ai/sdk/v2"
|
||||
import { Installation } from "@/installation"
|
||||
import { InstallationVersion } from "@/installation/version"
|
||||
import { iife } from "@/util/iife"
|
||||
import { Log } from "../../util"
|
||||
import { setTimeout as sleep } from "node:timers/promises"
|
||||
@@ -70,7 +71,7 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
|
||||
base(auth.enterpriseUrl),
|
||||
{
|
||||
Authorization: `Bearer ${auth.refresh}`,
|
||||
"User-Agent": `opencode/${Installation.VERSION}`,
|
||||
"User-Agent": `opencode/${InstallationVersion}`,
|
||||
},
|
||||
provider.models,
|
||||
).catch((error) => {
|
||||
@@ -150,7 +151,7 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
|
||||
const headers: Record<string, string> = {
|
||||
"x-initiator": isAgent ? "agent" : "user",
|
||||
...(init?.headers as Record<string, string>),
|
||||
"User-Agent": `opencode/${Installation.VERSION}`,
|
||||
"User-Agent": `opencode/${InstallationVersion}`,
|
||||
Authorization: `Bearer ${info.refresh}`,
|
||||
"Openai-Intent": "conversation-edits",
|
||||
}
|
||||
@@ -226,7 +227,7 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": `opencode/${Installation.VERSION}`,
|
||||
"User-Agent": `opencode/${InstallationVersion}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
client_id: CLIENT_ID,
|
||||
@@ -256,7 +257,7 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise<Hooks> {
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": `opencode/${Installation.VERSION}`,
|
||||
"User-Agent": `opencode/${InstallationVersion}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
client_id: CLIENT_ID,
|
||||
|
||||
Reference in New Issue
Block a user