@opencode-ai/plugin 0.0.0-next-15534 → 0.0.0-next-15537

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,28 +66,37 @@ export interface Data {
66
66
  readonly skill: LocationCollection<SkillInfo>;
67
67
  };
68
68
  }
69
- export interface RouteDefinition {
69
+ export type Route = {
70
+ readonly type: "home";
71
+ } | {
72
+ readonly type: "session";
73
+ readonly sessionID: string;
74
+ } | {
75
+ readonly type: "plugin";
76
+ readonly id: string;
77
+ readonly name: string;
78
+ readonly data?: Record<string, any>;
79
+ };
80
+ export type Destination = Route | Omit<Extract<Route, {
81
+ readonly type: "plugin";
82
+ }>, "id">;
83
+ export interface Page {
70
84
  readonly name: string;
71
85
  readonly render: (input: {
72
- readonly params: any;
86
+ readonly data?: Record<string, any>;
73
87
  }) => JSX.Element;
74
88
  }
75
- export interface Route {
76
- register(definition: RouteDefinition): () => void;
77
- navigate(input: {
78
- readonly name: string;
79
- readonly params?: any;
80
- }): void;
81
- current(): {
82
- readonly name: string;
83
- readonly params: any;
84
- };
85
- }
89
+ export type Slot = (props: Record<string, any>) => JSX.Element;
86
90
  export interface UI {
87
- readonly route: Route;
91
+ readonly router: {
92
+ register(page: Page): () => void;
93
+ navigate(destination: Destination): void;
94
+ current(): Route;
95
+ };
96
+ readonly slot: (name: string, render: Slot) => () => void;
88
97
  }
89
98
  export interface Context {
90
- readonly options: Readonly<Record<string, unknown>>;
99
+ readonly options: Readonly<Record<string, any>>;
91
100
  readonly client: OpenCodeClient;
92
101
  readonly data: Data;
93
102
  readonly ui: UI;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/plugin",
4
- "version": "0.0.0-next-15534",
4
+ "version": "0.0.0-next-15537",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -34,6 +34,10 @@
34
34
  "import": "./dist/v2/tui/index.js",
35
35
  "types": "./dist/v2/tui/index.d.ts"
36
36
  },
37
+ "./v2/tui/*": {
38
+ "import": "./dist/v2/tui/*.js",
39
+ "types": "./dist/v2/tui/*.d.ts"
40
+ },
37
41
  "./v2": {
38
42
  "import": "./dist/v2/promise/index.js",
39
43
  "types": "./dist/v2/promise/index.d.ts"
@@ -48,9 +52,9 @@
48
52
  ],
49
53
  "dependencies": {
50
54
  "@ai-sdk/provider": "3.0.8",
51
- "@opencode-ai/client": "0.0.0-next-15534",
52
- "@opencode-ai/schema": "0.0.0-next-15534",
53
- "@opencode-ai/sdk": "0.0.0-next-15534",
55
+ "@opencode-ai/client": "0.0.0-next-15537",
56
+ "@opencode-ai/schema": "0.0.0-next-15537",
57
+ "@opencode-ai/sdk": "0.0.0-next-15537",
54
58
  "effect": "4.0.0-beta.83",
55
59
  "zod": "4.1.8"
56
60
  },