@vymalo/opencode-browser 0.12.0 → 0.14.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.
Files changed (44) hide show
  1. package/dist/agent-client.d.ts +36 -36
  2. package/dist/agent-client.js +201 -189
  3. package/dist/agent-client.js.map +1 -1
  4. package/dist/broker.d.ts +85 -87
  5. package/dist/broker.js +614 -599
  6. package/dist/broker.js.map +1 -1
  7. package/dist/catalog.d.ts +76 -76
  8. package/dist/catalog.js +826 -596
  9. package/dist/catalog.js.map +1 -1
  10. package/dist/endpoint.d.ts +42 -42
  11. package/dist/endpoint.js +132 -131
  12. package/dist/endpoint.js.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib.js +1 -0
  16. package/dist/lib.js.map +1 -1
  17. package/dist/logging.d.ts +6 -6
  18. package/dist/logging.js +60 -63
  19. package/dist/logging.js.map +1 -1
  20. package/dist/node-transport.d.ts +6 -6
  21. package/dist/node-transport.js +48 -44
  22. package/dist/node-transport.js.map +1 -1
  23. package/dist/opencode.d.ts +10 -10
  24. package/dist/opencode.js +143 -146
  25. package/dist/opencode.js.map +1 -1
  26. package/dist/protocol.d.ts +127 -127
  27. package/dist/protocol.js +148 -128
  28. package/dist/protocol.js.map +1 -1
  29. package/dist/schema.d.ts +32 -32
  30. package/dist/schema.js +39 -44
  31. package/dist/schema.js.map +1 -1
  32. package/dist/token-file.d.ts +4 -4
  33. package/dist/token-file.js +68 -60
  34. package/dist/token-file.js.map +1 -1
  35. package/dist/tools.d.ts +11 -11
  36. package/dist/tools.js +128 -123
  37. package/dist/tools.js.map +1 -1
  38. package/dist/transport.d.ts +17 -17
  39. package/dist/transport.js +3 -9
  40. package/dist/transport.js.map +1 -1
  41. package/dist/types.d.ts +61 -61
  42. package/dist/types.js +1 -0
  43. package/dist/types.js.map +1 -1
  44. package/package.json +3 -3
@@ -3,52 +3,52 @@ import type { Logger } from "./logging.js";
3
3
  import { type BrowserAction } from "./protocol.js";
4
4
  /** Minimal socket the agent-client drives — provided per runtime by the endpoint. */
5
5
  export interface AgentSocket {
6
- send(data: string): void;
7
- close(): void;
6
+ send(data: string): void;
7
+ close(): void;
8
8
  }
9
9
  export interface AgentSocketHandlers {
10
- onOpen(): void;
11
- onMessage(data: string): void;
12
- onClose(): void;
10
+ onOpen(): void;
11
+ onMessage(data: string): void;
12
+ onClose(): void;
13
13
  }
14
14
  export type AgentSocketFactory = (url: string, handlers: AgentSocketHandlers) => AgentSocket;
15
15
  export interface AgentClientOptions {
16
- url: string;
17
- token: string;
18
- label?: string;
19
- timeoutMs: number;
16
+ url: string;
17
+ token: string;
18
+ label?: string;
19
+ timeoutMs: number;
20
20
  }
21
21
  export interface AgentClientDeps {
22
- logger: Logger;
23
- createSocket: AgentSocketFactory;
24
- /** Called when the connection drops (host gone) — the endpoint re-elects. */
25
- onClose?: () => void;
22
+ logger: Logger;
23
+ createSocket: AgentSocketFactory;
24
+ /** Called when the connection drops (host gone) — the endpoint re-elects. */
25
+ onClose?: () => void;
26
26
  }
27
27
  export declare class AgentClientError extends Error {
28
- readonly code?: string;
29
- constructor(message: string, code?: string);
28
+ readonly code?: string;
29
+ constructor(message: string, code?: string);
30
30
  }
31
31
  /**
32
- * Connects to a running broker as an `agent` and brokers request/response for the
33
- * host adapter's tools (the guest path). One connection attempt + lifecycle; the
34
- * endpoint orchestrates re-election/reconnect via `onClose`.
35
- */
32
+ * Connects to a running broker as an `agent` and brokers request/response for the
33
+ * host adapter's tools (the guest path). One connection attempt + lifecycle; the
34
+ * endpoint orchestrates re-election/reconnect via `onClose`.
35
+ */
36
36
  export declare class AgentClient implements AgentEndpoint {
37
- private readonly opts;
38
- private readonly deps;
39
- private socket;
40
- private ready;
41
- private closed;
42
- private readonly pending;
43
- private readyWaiters;
44
- constructor(opts: AgentClientOptions, deps: AgentClientDeps);
45
- connect(): Promise<void>;
46
- stop(): void;
47
- release(): void;
48
- send(action: BrowserAction, group: string, params: Record<string, unknown>, signal?: AbortSignal, target?: string, timeoutMs?: number): Promise<unknown>;
49
- private waitReady;
50
- private handleResult;
51
- private clearPending;
52
- private settleReject;
53
- private rejectAllPending;
37
+ private readonly opts;
38
+ private readonly deps;
39
+ private socket;
40
+ private ready;
41
+ private closed;
42
+ private readonly pending;
43
+ private readyWaiters;
44
+ constructor(opts: AgentClientOptions, deps: AgentClientDeps);
45
+ connect(): Promise<void>;
46
+ stop(): void;
47
+ release(): void;
48
+ send(action: BrowserAction, group: string, params: Record<string, unknown>, signal?: AbortSignal, target?: string, timeoutMs?: number): Promise<unknown>;
49
+ private waitReady;
50
+ private handleResult;
51
+ private clearPending;
52
+ private settleReject;
53
+ private rejectAllPending;
54
54
  }
@@ -1,197 +1,209 @@
1
1
  import { decodeFrame, encodeFrame, helloFrame, nextId, PROTOCOL_VERSION } from "./protocol.js";
2
2
  /**
3
- * Grace added to the guest's local per-command timer over the requested
4
- * deadline. The host broker enforces the real timeout and can tell the executor
5
- * to tear down (a `cancel` frame); the guest's timer is only a backstop for a
6
- * silently unresponsive broker, so it must fire *after* the broker's, never
7
- * before — otherwise the guest rejects locally while the executor keeps running.
8
- */
9
- const AGENT_TIMEOUT_GRACE_MS = 5_000;
3
+ * Grace added to the guest's local per-command timer over the requested
4
+ * deadline. The host broker enforces the real timeout and can tell the executor
5
+ * to tear down (a `cancel` frame); the guest's timer is only a backstop for a
6
+ * silently unresponsive broker, so it must fire *after* the broker's, never
7
+ * before — otherwise the guest rejects locally while the executor keeps running.
8
+ */
9
+ const AGENT_TIMEOUT_GRACE_MS = 5e3;
10
10
  export class AgentClientError extends Error {
11
- code;
12
- constructor(message, code) {
13
- super(message);
14
- this.name = "AgentClientError";
15
- this.code = code;
16
- }
11
+ code;
12
+ constructor(message, code) {
13
+ super(message);
14
+ this.name = "AgentClientError";
15
+ this.code = code;
16
+ }
17
17
  }
18
18
  /**
19
- * Connects to a running broker as an `agent` and brokers request/response for the
20
- * host adapter's tools (the guest path). One connection attempt + lifecycle; the
21
- * endpoint orchestrates re-election/reconnect via `onClose`.
22
- */
19
+ * Connects to a running broker as an `agent` and brokers request/response for the
20
+ * host adapter's tools (the guest path). One connection attempt + lifecycle; the
21
+ * endpoint orchestrates re-election/reconnect via `onClose`.
22
+ */
23
23
  export class AgentClient {
24
- opts;
25
- deps;
26
- socket = null;
27
- ready = false;
28
- closed = false;
29
- pending = new Map();
30
- readyWaiters = [];
31
- constructor(opts, deps) {
32
- this.opts = opts;
33
- this.deps = deps;
34
- }
35
- connect() {
36
- return new Promise((resolve, reject) => {
37
- let settled = false;
38
- this.socket = this.deps.createSocket(this.opts.url, {
39
- onOpen: () => {
40
- this.socket?.send(encodeFrame(helloFrame(this.opts.token, { role: "agent", client: this.opts.label })));
41
- // Resolve only once the broker replies `ready`.
42
- },
43
- onMessage: (data) => {
44
- const frame = decodeFrame(data);
45
- if (!frame) {
46
- return;
47
- }
48
- if (frame.type === "ready") {
49
- this.ready = true;
50
- this.deps.logger.trace("browser_guest_ready", { label: this.opts.label });
51
- for (const w of this.readyWaiters.splice(0)) {
52
- w();
53
- }
54
- if (!settled) {
55
- settled = true;
56
- resolve();
57
- }
58
- }
59
- else if (frame.type === "result") {
60
- this.handleResult(frame);
61
- }
62
- },
63
- onClose: () => {
64
- this.ready = false;
65
- this.rejectAllPending(new AgentClientError("disconnected from bridge", "disconnected"));
66
- this.socket = null;
67
- if (!settled) {
68
- settled = true;
69
- reject(new AgentClientError("bridge connection closed before ready", "connect_failed"));
70
- }
71
- if (!this.closed) {
72
- this.deps.onClose?.();
73
- }
74
- }
75
- });
76
- });
77
- }
78
- stop() {
79
- this.closed = true;
80
- this.socket?.close();
81
- this.socket = null;
82
- this.rejectAllPending(new AgentClientError("agent stopped", "stopped"));
83
- }
84
- release() {
85
- // Best-effort: ask the broker to release this agent's browsers.
86
- void this.send("release", "", {}).catch(() => { });
87
- }
88
- async send(action, group, params, signal, target, timeoutMs) {
89
- if (signal?.aborted) {
90
- throw new AgentClientError("aborted", "aborted");
91
- }
92
- await this.waitReady(signal);
93
- const socket = this.socket;
94
- if (!socket) {
95
- throw new AgentClientError("not connected to the bridge", "disconnected");
96
- }
97
- const id = nextId();
98
- const frame = {
99
- v: PROTOCOL_VERSION,
100
- type: "command",
101
- id,
102
- action,
103
- group,
104
- params,
105
- target,
106
- // Forward the override so the host broker applies (and clamps) it.
107
- timeoutMs
108
- };
109
- this.deps.logger.trace("browser_guest_command_send", { id, action, group, target });
110
- // Backstop only — let the broker's deadline fire first (it can cancel the
111
- // executor); fall back to the global timeout when no override is given.
112
- const requested = timeoutMs !== undefined ? timeoutMs : this.opts.timeoutMs;
113
- const localTimeout = requested > 0 ? requested + AGENT_TIMEOUT_GRACE_MS : 0;
114
- return new Promise((resolve, reject) => {
115
- const timer = localTimeout > 0
116
- ? setTimeout(() => this.settleReject(id, new AgentClientError(`command '${action}' timed out`, "timeout")), localTimeout)
117
- : null;
118
- let detachAbort = null;
119
- if (signal) {
120
- const onAbort = () => this.settleReject(id, new AgentClientError("aborted", "aborted"));
121
- signal.addEventListener("abort", onAbort, { once: true });
122
- detachAbort = () => signal.removeEventListener("abort", onAbort);
123
- }
124
- this.pending.set(id, { resolve, reject, timer, detachAbort });
125
- try {
126
- socket.send(encodeFrame(frame));
127
- }
128
- catch (err) {
129
- this.settleReject(id, new AgentClientError(`failed to send '${action}': ${err instanceof Error ? err.message : String(err)}`, "send_failed"));
130
- }
131
- });
132
- }
133
- waitReady(signal) {
134
- if (this.ready) {
135
- return Promise.resolve();
136
- }
137
- if (this.closed || !this.socket) {
138
- return Promise.reject(new AgentClientError("not connected to the bridge", "disconnected"));
139
- }
140
- return new Promise((resolve, reject) => {
141
- const onAbort = () => reject(new AgentClientError("aborted", "aborted"));
142
- if (signal) {
143
- signal.addEventListener("abort", onAbort, { once: true });
144
- }
145
- this.readyWaiters.push(() => {
146
- if (signal) {
147
- signal.removeEventListener("abort", onAbort);
148
- }
149
- resolve();
150
- });
151
- });
152
- }
153
- handleResult(frame) {
154
- const p = this.pending.get(frame.id);
155
- if (!p) {
156
- return;
157
- }
158
- this.deps.logger.trace("browser_guest_result_received", { id: frame.id, ok: frame.ok });
159
- this.clearPending(frame.id);
160
- if (frame.ok) {
161
- p.resolve(frame.data);
162
- }
163
- else {
164
- p.reject(new AgentClientError(frame.error?.message ?? "bridge error", frame.error?.code));
165
- }
166
- }
167
- clearPending(id) {
168
- const p = this.pending.get(id);
169
- if (!p) {
170
- return;
171
- }
172
- if (p.timer) {
173
- clearTimeout(p.timer);
174
- }
175
- p.detachAbort?.();
176
- this.pending.delete(id);
177
- }
178
- settleReject(id, err) {
179
- const p = this.pending.get(id);
180
- if (!p) {
181
- return;
182
- }
183
- this.clearPending(id);
184
- p.reject(err);
185
- }
186
- rejectAllPending(err) {
187
- for (const [id, p] of this.pending) {
188
- if (p.timer) {
189
- clearTimeout(p.timer);
190
- }
191
- p.detachAbort?.();
192
- this.pending.delete(id);
193
- p.reject(err);
194
- }
195
- }
24
+ opts;
25
+ deps;
26
+ socket = null;
27
+ ready = false;
28
+ closed = false;
29
+ pending = new Map();
30
+ readyWaiters = [];
31
+ constructor(opts, deps) {
32
+ this.opts = opts;
33
+ this.deps = deps;
34
+ }
35
+ connect() {
36
+ return new Promise((resolve, reject) => {
37
+ let settled = false;
38
+ this.socket = this.deps.createSocket(this.opts.url, {
39
+ onOpen: () => {
40
+ this.socket?.send(encodeFrame(helloFrame(this.opts.token, {
41
+ role: "agent",
42
+ client: this.opts.label
43
+ })));
44
+ // Resolve only once the broker replies `ready`.
45
+ },
46
+ onMessage: (data) => {
47
+ const frame = decodeFrame(data);
48
+ if (!frame) {
49
+ return;
50
+ }
51
+ if (frame.type === "ready") {
52
+ this.ready = true;
53
+ this.deps.logger.trace("browser_guest_ready", { label: this.opts.label });
54
+ for (const w of this.readyWaiters.splice(0)) {
55
+ w();
56
+ }
57
+ if (!settled) {
58
+ settled = true;
59
+ resolve();
60
+ }
61
+ } else if (frame.type === "result") {
62
+ this.handleResult(frame);
63
+ }
64
+ },
65
+ onClose: () => {
66
+ this.ready = false;
67
+ this.rejectAllPending(new AgentClientError("disconnected from bridge", "disconnected"));
68
+ this.socket = null;
69
+ if (!settled) {
70
+ settled = true;
71
+ reject(new AgentClientError("bridge connection closed before ready", "connect_failed"));
72
+ }
73
+ if (!this.closed) {
74
+ this.deps.onClose?.();
75
+ }
76
+ }
77
+ });
78
+ });
79
+ }
80
+ stop() {
81
+ this.closed = true;
82
+ this.socket?.close();
83
+ this.socket = null;
84
+ this.rejectAllPending(new AgentClientError("agent stopped", "stopped"));
85
+ }
86
+ release() {
87
+ // Best-effort: ask the broker to release this agent's browsers.
88
+ void this.send("release", "", {}).catch(() => {});
89
+ }
90
+ async send(action, group, params, signal, target, timeoutMs) {
91
+ if (signal?.aborted) {
92
+ throw new AgentClientError("aborted", "aborted");
93
+ }
94
+ await this.waitReady(signal);
95
+ const socket = this.socket;
96
+ if (!socket) {
97
+ throw new AgentClientError("not connected to the bridge", "disconnected");
98
+ }
99
+ const id = nextId();
100
+ const frame = {
101
+ v: PROTOCOL_VERSION,
102
+ type: "command",
103
+ id,
104
+ action,
105
+ group,
106
+ params,
107
+ target,
108
+ // Forward the override so the host broker applies (and clamps) it.
109
+ timeoutMs
110
+ };
111
+ this.deps.logger.trace("browser_guest_command_send", {
112
+ id,
113
+ action,
114
+ group,
115
+ target
116
+ });
117
+ // Backstop only — let the broker's deadline fire first (it can cancel the
118
+ // executor); fall back to the global timeout when no override is given.
119
+ const requested = timeoutMs !== undefined ? timeoutMs : this.opts.timeoutMs;
120
+ const localTimeout = requested > 0 ? requested + AGENT_TIMEOUT_GRACE_MS : 0;
121
+ return new Promise((resolve, reject) => {
122
+ const timer = localTimeout > 0 ? setTimeout(() => this.settleReject(id, new AgentClientError(`command '${action}' timed out`, "timeout")), localTimeout) : null;
123
+ let detachAbort = null;
124
+ if (signal) {
125
+ const onAbort = () => this.settleReject(id, new AgentClientError("aborted", "aborted"));
126
+ signal.addEventListener("abort", onAbort, { once: true });
127
+ detachAbort = () => signal.removeEventListener("abort", onAbort);
128
+ }
129
+ this.pending.set(id, {
130
+ resolve,
131
+ reject,
132
+ timer,
133
+ detachAbort
134
+ });
135
+ try {
136
+ socket.send(encodeFrame(frame));
137
+ } catch (err) {
138
+ this.settleReject(id, new AgentClientError(`failed to send '${action}': ${err instanceof Error ? err.message : String(err)}`, "send_failed"));
139
+ }
140
+ });
141
+ }
142
+ waitReady(signal) {
143
+ if (this.ready) {
144
+ return Promise.resolve();
145
+ }
146
+ if (this.closed || !this.socket) {
147
+ return Promise.reject(new AgentClientError("not connected to the bridge", "disconnected"));
148
+ }
149
+ return new Promise((resolve, reject) => {
150
+ const onAbort = () => reject(new AgentClientError("aborted", "aborted"));
151
+ if (signal) {
152
+ signal.addEventListener("abort", onAbort, { once: true });
153
+ }
154
+ this.readyWaiters.push(() => {
155
+ if (signal) {
156
+ signal.removeEventListener("abort", onAbort);
157
+ }
158
+ resolve();
159
+ });
160
+ });
161
+ }
162
+ handleResult(frame) {
163
+ const p = this.pending.get(frame.id);
164
+ if (!p) {
165
+ return;
166
+ }
167
+ this.deps.logger.trace("browser_guest_result_received", {
168
+ id: frame.id,
169
+ ok: frame.ok
170
+ });
171
+ this.clearPending(frame.id);
172
+ if (frame.ok) {
173
+ p.resolve(frame.data);
174
+ } else {
175
+ p.reject(new AgentClientError(frame.error?.message ?? "bridge error", frame.error?.code));
176
+ }
177
+ }
178
+ clearPending(id) {
179
+ const p = this.pending.get(id);
180
+ if (!p) {
181
+ return;
182
+ }
183
+ if (p.timer) {
184
+ clearTimeout(p.timer);
185
+ }
186
+ p.detachAbort?.();
187
+ this.pending.delete(id);
188
+ }
189
+ settleReject(id, err) {
190
+ const p = this.pending.get(id);
191
+ if (!p) {
192
+ return;
193
+ }
194
+ this.clearPending(id);
195
+ p.reject(err);
196
+ }
197
+ rejectAllPending(err) {
198
+ for (const [id, p] of this.pending) {
199
+ if (p.timer) {
200
+ clearTimeout(p.timer);
201
+ }
202
+ p.detachAbort?.();
203
+ this.pending.delete(id);
204
+ p.reject(err);
205
+ }
206
+ }
196
207
  }
208
+
197
209
  //# sourceMappingURL=agent-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-client.js","sourceRoot":"","sources":["../src/agent-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,WAAW,EACX,WAAW,EACX,UAAU,EACV,MAAM,EACN,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAqBvB;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAgBrC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,IAAI,CAAU;IACvB,YAAY,OAAe,EAAE,IAAa;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAQH;IACA;IARX,MAAM,GAAuB,IAAI,CAAC;IAClC,KAAK,GAAG,KAAK,CAAC;IACd,MAAM,GAAG,KAAK,CAAC;IACN,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,YAAY,GAAsB,EAAE,CAAC;IAE7C,YACmB,IAAwB,EACxB,IAAqB;QADrB,SAAI,GAAJ,IAAI,CAAoB;QACxB,SAAI,GAAJ,IAAI,CAAiB;IACrC,CAAC;IAEJ,OAAO;QACL,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBAClD,MAAM,EAAE,GAAG,EAAE;oBACX,IAAI,CAAC,MAAM,EAAE,IAAI,CACf,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,C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