fixate-on 0.1.0 → 0.2.0

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.
package/tui.d.ts CHANGED
@@ -1,18 +1,27 @@
1
1
  /**
2
2
  * Type declarations for the TUI companion entrypoint (`fixate-on/tui`).
3
3
  *
4
- * The TUI companion is a separate `TuiPluginModule` (has `tui`, no `server`),
5
- * mutually exclusive with the server `PluginModule` in `index.d.ts`. Register
6
- * both as separate plugin entries in `opencode.json`:
4
+ * The default export serves both host generations: OpenCode 1.x calls `tui`,
5
+ * OpenCode 2.x calls `setup`. Configure it by package name, never by subpath:
7
6
  *
8
- * ```json
9
- * "plugin": [
10
- * "fixate-on",
11
- * ["fixate-on/tui", { "logLevel": "info" }]
12
- * ]
13
- * ```
7
+ * - 1.x: `"plugin": ["fixate-on"]` in `tui.json`
8
+ * - 2.x: loaded automatically with the server plugin; `cli.json` is optional
14
9
  */
15
10
 
11
+ /** The v2 TUI plugin context supplied by the OpenCode host. */
12
+ export type GoalTuiPluginV2Context = unknown;
13
+
14
+ /** The v2 TUI plugin module's setup function. */
15
+ export type GoalTuiPluginV2Setup = (
16
+ context: GoalTuiPluginV2Context,
17
+ ) => Promise<void | (() => void)>;
18
+
19
+ /** Named v2 plugin export consumed by integrations. */
20
+ export declare const GoalTuiPluginV2: {
21
+ id: 'fixate-on-tui';
22
+ setup: GoalTuiPluginV2Setup;
23
+ };
24
+
16
25
  /**
17
26
  * Options for the TUI companion plugin. All fields are optional — the TUI
18
27
  * works with zero configuration.
@@ -30,11 +39,18 @@ export interface GoalTuiPluginOptions {
30
39
  * process working directory.
31
40
  */
32
41
  directory?: string;
42
+
43
+ /**
44
+ * Where goal state lives, relative to the workspace or absolute. On 1.x, set
45
+ * it to match the server plugin's `stateRoot`. On 2.x the companion asks the
46
+ * server plugin instead, and a value here overrides that answer.
47
+ */
48
+ stateRoot?: string;
33
49
  }
34
50
 
35
51
  /**
36
- * The TUI companion plugin function. Called by OpenCode's TUI plugin loader
37
- * when `fixate-on/tui` is registered. Subscribes to host events,
52
+ * The 1.x TUI companion function. Called by the OpenCode 1.x TUI plugin loader
53
+ * when `fixate-on` is registered in `tui.json`. Subscribes to host events,
38
54
  * feeds them into the shared TuiStateStore, and exposes the store for view
39
55
  * components and keymap handlers.
40
56
  */
@@ -45,13 +61,15 @@ export declare function GoalTuiPlugin(
45
61
  ): Promise<void>;
46
62
 
47
63
  /**
48
- * Default export consumed by OpenCode's TUI plugin loader:
49
- * `{ "fixate-on/tui": { ... } }` in `opencode.json` resolves `id`
50
- * and calls `tui` to initialize the TUI companion.
64
+ * Default export consumed by both TUI plugin loaders. Each host reads its own
65
+ * entrypoint and ignores the other.
51
66
  */
52
67
  declare const goalTuiPluginModule: {
53
68
  id: 'fixate-on-tui';
69
+ /** OpenCode 1.x entrypoint. */
54
70
  tui: typeof GoalTuiPlugin;
71
+ /** OpenCode 2.x entrypoint. */
72
+ setup: GoalTuiPluginV2Setup;
55
73
  };
56
74
 
57
75
  export default goalTuiPluginModule;