anthropic legal requests · anomalyco/opencode@973715f

1 min read Original article ↗

@@ -16,8 +16,6 @@ import { gitlabAuthPlugin as GitlabAuthPlugin } from "@gitlab/opencode-gitlab-au

1616

export namespace Plugin {

1717

const log = Log.create({ service: "plugin" })

181819-

const BUILTIN = ["opencode-anthropic-auth@0.0.13"]

20-2119

// Built-in plugins that are directly imported (not installed from npm)

2220

const INTERNAL_PLUGINS: PluginInstance[] = [CodexAuthPlugin, CopilotAuthPlugin, GitlabAuthPlugin]

2321

@@ -47,9 +45,6 @@ export namespace Plugin {

47454846

let plugins = config.plugin ?? []

4947

if (plugins.length) await Config.waitForDependencies()

50-

if (!Flag.OPENCODE_DISABLE_DEFAULT_PLUGINS) {

51-

plugins = [...BUILTIN, ...plugins]

52-

}

53485449

for (let plugin of plugins) {

5550

// ignore old codex plugin since it is supported first party now

@@ -59,24 +54,7 @@ export namespace Plugin {

5954

const lastAtIndex = plugin.lastIndexOf("@")

6055

const pkg = lastAtIndex > 0 ? plugin.substring(0, lastAtIndex) : plugin

6156

const version = lastAtIndex > 0 ? plugin.substring(lastAtIndex + 1) : "latest"

62-

const builtin = BUILTIN.some((x) => x.startsWith(pkg + "@"))

63-

plugin = await BunProc.install(pkg, version).catch((err) => {

64-

if (!builtin) throw err

65-66-

const message = err instanceof Error ? err.message : String(err)

67-

log.error("failed to install builtin plugin", {

68-

pkg,

69-

version,

70-

error: message,

71-

})

72-

Bus.publish(Session.Event.Error, {

73-

error: new NamedError.Unknown({

74-

message: `Failed to install built-in plugin ${pkg}@${version}: ${message}`,

75-

}).toObject(),

76-

})

77-78-

return ""

79-

})

57+

plugin = await BunProc.install(pkg, version)

8058

if (!plugin) continue

8159

}

8260

const mod = await import(plugin)