feat(plugin): add v2 tui entrypoint · argszero/opencode@9b8282a · GitHub
Skip to content

Commit 9b8282a

Browse files
committed
feat(plugin): add v2 tui entrypoint
1 parent 2a08cd3 commit 9b8282a

5 files changed

Lines changed: 23 additions & 2 deletions

File tree

packages/plugin/package.json

Lines changed: 1 addition & 1 deletion

packages/plugin/src/v2/tui/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export interface UI {
105105
}
106106

107107
export interface Context {
108-
readonly options: Record<string, any>
108+
readonly options: Readonly<Record<string, unknown>>
109109
readonly client: OpenCodeClient
110110
readonly data: Data
111111
readonly ui: UI
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * as Plugin from "./plugin.js"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Context } from "./context.js"
2+
3+
export type { Context }
4+
5+
export type Cleanup = () => Promise<void> | void
6+
7+
export interface Definition {
8+
readonly id: string
9+
readonly setup: (context: Context) => Promise<Cleanup | void> | Cleanup | void
10+
}
11+
12+
export function define(plugin: Definition) {
13+
return plugin
14+
}

packages/plugin/test/contract-identity.test.ts

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)