@ulthon/ul-opencode-event 0.1.39 → 0.1.40

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/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@
3
3
  * Sends email notifications when session events occur
4
4
  */
5
5
  import type { Plugin } from '@opencode-ai/plugin';
6
- import type { EventPayload } from './types.js';
7
6
  /**
8
7
  * Notification Plugin for OpenCode
9
8
  * Listens for session events and sends notifications via configured channels
@@ -17,20 +16,3 @@ export declare const NotificationPlugin: Plugin;
17
16
  * falling through to getLegacyPlugins() which iterates all module exports.
18
17
  */
19
18
  export default NotificationPlugin;
20
- /**
21
- * Test-only: reset module-level flags so toast tests can run independently.
22
- */
23
- declare function __test_resetFlags(): void;
24
- /**
25
- * Test-only helpers namespace.
26
- * Includes a `server` property pointing to NotificationPlugin so that
27
- * OpenCode's getServerPlugin() correctly identifies it (returns the server fn)
28
- * instead of returning undefined and causing getLegacyPlugins to throw.
29
- * The `seen` Set in getLegacyPlugins deduplicates, so NotificationPlugin
30
- * is only called once despite appearing in both `default` and `__test.server`.
31
- */
32
- export declare const __test: {
33
- payloads: EventPayload[];
34
- resetFlags: typeof __test_resetFlags;
35
- server: Plugin;
36
- };
package/dist/index.js CHANGED
@@ -338,9 +338,22 @@ let hasCheckedUpdate = false;
338
338
  let hasShownStartupToast = false;
339
339
  /**
340
340
  * Test-only: captured payloads for verification in tests.
341
- * Cleared in __test_resetFlags().
341
+ * Exposed via globalThis (not module export) to avoid OpenCode's getLegacyPlugins
342
+ * iterating over non-plugin exports and causing duplicate plugin invocations.
342
343
  */
343
344
  const __test_payloads = [];
345
+ /**
346
+ * Test-only: reset module-level flags so toast tests can run independently.
347
+ */
348
+ function __test_resetFlags() {
349
+ hasCheckedUpdate = false;
350
+ hasShownStartupToast = false;
351
+ __test_payloads.length = 0;
352
+ }
353
+ globalThis.__ul_opencode_event_test = {
354
+ payloads: __test_payloads,
355
+ resetFlags: __test_resetFlags,
356
+ };
344
357
  /**
345
358
  * Notification Plugin for OpenCode
346
359
  * Listens for session events and sends notifications via configured channels
@@ -565,24 +578,3 @@ async function NotificationPluginImpl(ctx) {
565
578
  * falling through to getLegacyPlugins() which iterates all module exports.
566
579
  */
567
580
  export default NotificationPlugin;
568
- /**
569
- * Test-only: reset module-level flags so toast tests can run independently.
570
- */
571
- function __test_resetFlags() {
572
- hasCheckedUpdate = false;
573
- hasShownStartupToast = false;
574
- __test_payloads.length = 0;
575
- }
576
- /**
577
- * Test-only helpers namespace.
578
- * Includes a `server` property pointing to NotificationPlugin so that
579
- * OpenCode's getServerPlugin() correctly identifies it (returns the server fn)
580
- * instead of returning undefined and causing getLegacyPlugins to throw.
581
- * The `seen` Set in getLegacyPlugins deduplicates, so NotificationPlugin
582
- * is only called once despite appearing in both `default` and `__test.server`.
583
- */
584
- export const __test = {
585
- payloads: __test_payloads,
586
- resetFlags: __test_resetFlags,
587
- server: NotificationPlugin,
588
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulthon/ul-opencode-event",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "OpenCode notification plugin - sends notifications via email, DingTalk, or Feishu when session events occur",
5
5
  "author": "augushong",
6
6
  "license": "MIT",