ignore: rm spoof and bump plugin version
This commit is contained in:
@@ -17,6 +17,7 @@ import { PermissionNext } from "@/permission/next"
|
|||||||
import { mergeDeep, pipe, sortBy, values } from "remeda"
|
import { mergeDeep, pipe, sortBy, values } from "remeda"
|
||||||
import { Global } from "@/global"
|
import { Global } from "@/global"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
|
import { Plugin } from "@/plugin"
|
||||||
|
|
||||||
export namespace Agent {
|
export namespace Agent {
|
||||||
export const Info = z
|
export const Info = z
|
||||||
@@ -279,8 +280,8 @@ export namespace Agent {
|
|||||||
const model = await Provider.getModel(defaultModel.providerID, defaultModel.modelID)
|
const model = await Provider.getModel(defaultModel.providerID, defaultModel.modelID)
|
||||||
const language = await Provider.getLanguage(model)
|
const language = await Provider.getLanguage(model)
|
||||||
|
|
||||||
const system = SystemPrompt.header(defaultModel.providerID)
|
const system = [PROMPT_GENERATE]
|
||||||
system.push(PROMPT_GENERATE)
|
await Plugin.trigger("experimental.chat.system.transform", { model }, { system })
|
||||||
const existing = await list()
|
const existing = await list()
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ await Promise.all([
|
|||||||
fs.mkdir(Global.Path.bin, { recursive: true }),
|
fs.mkdir(Global.Path.bin, { recursive: true }),
|
||||||
])
|
])
|
||||||
|
|
||||||
const CACHE_VERSION = "18"
|
const CACHE_VERSION = "19"
|
||||||
|
|
||||||
const version = await Bun.file(path.join(Global.Path.cache, "version"))
|
const version = await Bun.file(path.join(Global.Path.cache, "version"))
|
||||||
.text()
|
.text()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { CopilotAuthPlugin } from "./copilot"
|
|||||||
export namespace Plugin {
|
export namespace Plugin {
|
||||||
const log = Log.create({ service: "plugin" })
|
const log = Log.create({ service: "plugin" })
|
||||||
|
|
||||||
const BUILTIN = ["opencode-anthropic-auth@0.0.9", "@gitlab/opencode-gitlab-auth@1.3.2"]
|
const BUILTIN = ["opencode-anthropic-auth@0.0.10", "@gitlab/opencode-gitlab-auth@1.3.2"]
|
||||||
|
|
||||||
// Built-in plugins that are directly imported (not installed from npm)
|
// Built-in plugins that are directly imported (not installed from npm)
|
||||||
const INTERNAL_PLUGINS: PluginInstance[] = [CodexAuthPlugin, CopilotAuthPlugin]
|
const INTERNAL_PLUGINS: PluginInstance[] = [CodexAuthPlugin, CopilotAuthPlugin]
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export namespace LLM {
|
|||||||
])
|
])
|
||||||
const isCodex = provider.id === "openai" && auth?.type === "oauth"
|
const isCodex = provider.id === "openai" && auth?.type === "oauth"
|
||||||
|
|
||||||
const system = SystemPrompt.header(input.model.providerID)
|
const system = []
|
||||||
system.push(
|
system.push(
|
||||||
[
|
[
|
||||||
// use agent prompt otherwise provider prompt
|
// use agent prompt otherwise provider prompt
|
||||||
@@ -83,7 +83,11 @@ export namespace LLM {
|
|||||||
|
|
||||||
const header = system[0]
|
const header = system[0]
|
||||||
const original = clone(system)
|
const original = clone(system)
|
||||||
await Plugin.trigger("experimental.chat.system.transform", { sessionID: input.sessionID }, { system })
|
await Plugin.trigger(
|
||||||
|
"experimental.chat.system.transform",
|
||||||
|
{ sessionID: input.sessionID, model: input.model },
|
||||||
|
{ system },
|
||||||
|
)
|
||||||
if (system.length === 0) {
|
if (system.length === 0) {
|
||||||
system.push(...original)
|
system.push(...original)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
You are Claude Code, Anthropic's official CLI for Claude.
|
|
||||||
@@ -34,11 +34,6 @@ async function resolveRelativeInstruction(instruction: string): Promise<string[]
|
|||||||
}
|
}
|
||||||
|
|
||||||
export namespace SystemPrompt {
|
export namespace SystemPrompt {
|
||||||
export function header(providerID: string) {
|
|
||||||
if (providerID.includes("anthropic")) return [PROMPT_ANTHROPIC_SPOOF.trim()]
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
export function instructions() {
|
export function instructions() {
|
||||||
return PROMPT_CODEX.trim()
|
return PROMPT_CODEX.trim()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export interface Hooks {
|
|||||||
},
|
},
|
||||||
) => Promise<void>
|
) => Promise<void>
|
||||||
"experimental.chat.system.transform"?: (
|
"experimental.chat.system.transform"?: (
|
||||||
input: { sessionID: string },
|
input: { sessionID?: string; model: Model },
|
||||||
output: {
|
output: {
|
||||||
system: string[]
|
system: string[]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user