opencode-ahp 0.1.4 → 0.1.6

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/src/transport.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * AHP transport (plan §6.1 transport.ts).
2
+ * AHP transport.
3
3
  *
4
4
  * Two layers:
5
5
  *
@@ -7,8 +7,8 @@
7
7
  * policy, path routing, loopback check. Unit-tested without a runtime.
8
8
  * 2. **A thin listener** behind the `Listener` interface. The reference
9
9
  * implementation uses `Bun.serve` (opencode v2 is Bun-based, so the
10
- * in-process plugin runtime has it — verified by the Phase 0 spike,
11
- * R6). If the plugin context ever forbids raw listeners, a `ws`-
10
+ * in-process plugin runtime has it). If the plugin context ever
11
+ * forbids raw listeners, a `ws`-
12
12
  * package implementation drops in here with no changes to the
13
13
  * protocol layer.
14
14
  *
@@ -71,7 +71,7 @@ export function tokenValid(expected: string, presented: string | null): boolean
71
71
  }
72
72
 
73
73
  /**
74
- * Origin policy (plan R5). The token is the only credential; this only
74
+ * Origin policy. The token is the only credential; this only
75
75
  * filters *which* browser origins may attempt a connection. A null Origin
76
76
  * (non-browser clients: VS Code's own connection, CLI clients) always
77
77
  * passes — browser-origin filtering is the real attack surface.
@@ -183,7 +183,7 @@ const textDecoder = new TextDecoder();
183
183
  /**
184
184
  * Start the AHP listener. Throws before binding when a non-loopback
185
185
  * address is given without a token (R4) or when the runtime lacks
186
- * `Bun.serve` (R6 — the fallback implementation would be added here).
186
+ * `Bun.serve` (the fallback implementation would be added here).
187
187
  */
188
188
  export function createListener(opts: ListenerOptions, callbacks: TransportCallbacks): Listener {
189
189
  if (!isLoopback(opts.host) && !opts.token) {
@@ -194,7 +194,7 @@ export function createListener(opts: ListenerOptions, callbacks: TransportCallba
194
194
  const bun = bunOf();
195
195
  if (!bun) {
196
196
  throw new Error(
197
- "Bun.serve is not available in this runtime (R6); expected inside the " +
197
+ "Bun.serve is not available in this runtime; expected inside the " +
198
198
  "Bun-based opencode v2 server — a `ws`-package fallback would go here",
199
199
  );
200
200
  }