opencode-orchestrator 0.6.3 → 0.6.4

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.
@@ -1,13 +1,20 @@
1
1
  /**
2
2
  * Toast Core - Core notification functions
3
+ * Uses OpenCode TUI's showToast API for actual UI display
3
4
  */
4
5
  import type { ToastMessage, ToastOptions } from "./types.js";
6
+ import type { PluginInput } from "@opencode-ai/plugin";
7
+ type OpencodeClient = PluginInput["client"];
8
+ /**
9
+ * Initialize the toast system with the OpenCode client
10
+ */
11
+ export declare function initToastClient(client: OpencodeClient): void;
5
12
  /**
6
13
  * Register a notification handler
7
14
  */
8
15
  export declare function onToast(handler: (toast: ToastMessage) => void): () => void;
9
16
  /**
10
- * Show a toast notification
17
+ * Show a toast notification (both in TUI and internal storage)
11
18
  */
12
19
  export declare function show(options: ToastOptions): ToastMessage;
13
20
  /**
@@ -26,3 +33,4 @@ export declare function getHistory(limit?: number): ToastMessage[];
26
33
  * Clear all toasts
27
34
  */
28
35
  export declare function clear(): void;
36
+ export {};
@@ -4,6 +4,6 @@
4
4
  * Provides notifications for task events, completions, errors
5
5
  */
6
6
  export type { ToastVariant, ToastMessage, ToastOptions } from "./types.js";
7
- export { show, dismiss, getActive, getHistory, clear, onToast } from "./toast-core.js";
7
+ export { show, dismiss, getActive, getHistory, clear, onToast, initToastClient } from "./toast-core.js";
8
8
  export { presets } from "./presets.js";
9
9
  export { enableAutoToasts } from "./event-integration.js";
package/dist/index.js CHANGED
@@ -16137,6 +16137,10 @@ ${r.content}
16137
16137
  });
16138
16138
 
16139
16139
  // src/core/notification/toast-core.ts
16140
+ var tuiClient = null;
16141
+ function initToastClient(client) {
16142
+ tuiClient = client;
16143
+ }
16140
16144
  var toasts = [];
16141
16145
  var MAX_HISTORY = 50;
16142
16146
  var handlers = [];
@@ -16158,11 +16162,22 @@ function show(options) {
16158
16162
  try {
16159
16163
  handler(toast);
16160
16164
  } catch (error45) {
16161
- console.error("[Toast] Handler error:", error45);
16162
16165
  }
16163
16166
  }
16164
- const icons = { info: "\u2139\uFE0F", success: "\u2705", warning: "\u26A0\uFE0F", error: "\u274C" };
16165
- console.log(`${icons[toast.variant]} [${toast.title}] ${toast.message}`);
16167
+ if (tuiClient) {
16168
+ const client = tuiClient;
16169
+ if (client.tui?.showToast) {
16170
+ client.tui.showToast({
16171
+ body: {
16172
+ title: toast.title,
16173
+ message: toast.message,
16174
+ variant: toast.variant,
16175
+ duration: toast.duration
16176
+ }
16177
+ }).catch(() => {
16178
+ });
16179
+ }
16180
+ }
16166
16181
  return toast;
16167
16182
  }
16168
16183
 
@@ -16379,8 +16394,9 @@ var OrchestratorPlugin = async (input) => {
16379
16394
  console.log(`[orchestrator] v${PLUGIN_VERSION} loaded`);
16380
16395
  console.log(`[orchestrator] Log file: ${getLogPath()}`);
16381
16396
  log2("[index.ts] Plugin initialized", { version: PLUGIN_VERSION, directory });
16397
+ initToastClient(client);
16382
16398
  const disableAutoToasts = enableAutoToasts();
16383
- log2("[index.ts] Toast notifications enabled");
16399
+ log2("[index.ts] Toast notifications enabled with TUI");
16384
16400
  const sessions = /* @__PURE__ */ new Map();
16385
16401
  const parallelAgentManager2 = ParallelAgentManager.getInstance(client, directory);
16386
16402
  const asyncAgentTools = createAsyncAgentTools(parallelAgentManager2, client);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "opencode-orchestrator",
3
3
  "displayName": "OpenCode Orchestrator",
4
4
  "description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
5
- "version": "0.6.3",
5
+ "version": "0.6.4",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {