opencode-collaboration 0.4.0 → 0.4.1

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
@@ -22,6 +22,7 @@
22
22
  import type { Plugin, PluginModule } from "@opencode-ai/plugin";
23
23
  import type { QueueInstance } from "./queue.js";
24
24
  import type { DeliveryInstance } from "./delivery.js";
25
+ export declare const PLUGIN_VERSION: string;
25
26
  export declare function runReliabilitySweep(queue: QueueInstance, delivery: Pick<DeliveryInstance, "flush">): Promise<void>;
26
27
  export declare const PeersPlugin: Plugin;
27
28
  export declare const plugin: PluginModule;
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@
19
19
  * listener; the receiving instance injects into its own session via the
20
20
  * opencode SDK immediately, including while the target session is busy.
21
21
  */
22
+ import { readFileSync } from "node:fs";
22
23
  import { resolveConfig, defaultPeerName } from "./config.js";
23
24
  import { Registry, newInboxToken, newInstanceId } from "./registry.js";
24
25
  import { InboxListener } from "./listener.js";
@@ -31,7 +32,18 @@ import { PeerPermissions } from "./permissions.js";
31
32
  import { buildPeerTools } from "./tools/peers-tools.js";
32
33
  import { handlePeersCommand } from "./commands.js";
33
34
  import { consumeCommand, createLogger, errorMessage } from "./feedback.js";
34
- const PLUGIN_VERSION = "0.2.2";
35
+ // Read the real package version at runtime so registry entries never report a
36
+ // stale hardcoded number. Falls back to "0.0.0" if package.json is unavailable.
37
+ function readPluginVersion() {
38
+ try {
39
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
40
+ return typeof pkg.version === "string" ? pkg.version : "0.0.0";
41
+ }
42
+ catch {
43
+ return "0.0.0";
44
+ }
45
+ }
46
+ export const PLUGIN_VERSION = readPluginVersion();
35
47
  const COMMAND_NAMES = new Set(["peers", "list-agents", "peers-name", "peers-inbox", "peers-outbox"]);
36
48
  /**
37
49
  * Command definitions injected through the `config` hook. opencode 1.18 does
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-collaboration",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Cross-session messaging for opencode — let independent sessions discover and text each other, modeled after Claude Code's cross-session messaging",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",