feat(plugin): add namespaced hook API (#33416)
This commit is contained in:
parent
dc468bdcfd
commit
909a1a6d78
150 changed files with 3276 additions and 3906 deletions
43
packages/core/src/plugin/internal.ts
Normal file
43
packages/core/src/plugin/internal.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
export * as PluginInternal from "./internal"
|
||||
|
||||
import type { PluginContext } from "@opencode-ai/plugin/v2/effect"
|
||||
import type { Effect, Scope } from "effect"
|
||||
import type { AgentV2 } from "../agent"
|
||||
import type { Catalog } from "../catalog"
|
||||
import type { CommandV2 } from "../command"
|
||||
import type { Config } from "../config"
|
||||
import type { EventV2 } from "../event"
|
||||
import type { FileSystem } from "../filesystem"
|
||||
import type { FSUtil } from "../fs-util"
|
||||
import type { Global } from "../global"
|
||||
import type { Integration } from "../integration"
|
||||
import type { Location } from "../location"
|
||||
import type { ModelsDev } from "../models-dev"
|
||||
import type { Npm } from "../npm"
|
||||
import type { Reference } from "../reference"
|
||||
import type { SkillV2 } from "../skill"
|
||||
|
||||
export type Requirements =
|
||||
| AgentV2.Service
|
||||
| Catalog.Service
|
||||
| CommandV2.Service
|
||||
| Config.Service
|
||||
| EventV2.Service
|
||||
| FileSystem.Service
|
||||
| FSUtil.Service
|
||||
| Global.Service
|
||||
| Integration.Service
|
||||
| Location.Service
|
||||
| ModelsDev.Service
|
||||
| Npm.Service
|
||||
| Reference.Service
|
||||
| SkillV2.Service
|
||||
|
||||
export interface Plugin<R = never> {
|
||||
readonly id: string
|
||||
readonly effect: (context: PluginContext) => Effect.Effect<void, never, R | Scope.Scope>
|
||||
}
|
||||
|
||||
export function define<R>(plugin: Plugin<R>) {
|
||||
return plugin
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue