@unbound-app/debugger-protocol 0.10.0 → 0.11.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.
@@ -1,7 +1,8 @@
1
- import { l as EvalResult, o as DeviceInfo, p as PluginPushResult } from "./index-CDo0GkFG.mjs";
1
+ import { l as EvalResult, m as PushedAddonKind, o as DeviceInfo, p as PluginPushResult } from "./index-DdSiZNoR.mjs";
2
2
  import { PushedManifest } from "@unbound-app/types";
3
3
  type PluginPush = {
4
4
  addonId: string;
5
+ kind?: PushedAddonKind;
5
6
  bundle: string;
6
7
  manifest: PushedManifest;
7
8
  bytecode?: Record<string, string>;
@@ -33,7 +34,7 @@ export declare class ControllerClient {
33
34
  */
34
35
  evaluate(code: string, timeout?: number): Promise<EvalResult>;
35
36
  /**
36
- * @description Pushes a freshly built plugin to the device via the bridge and resolves with the
37
+ * @description Pushes a freshly built plugin or theme to the device via the bridge and resolves with the
37
38
  * device's reload outcome. Fails fast if the socket isn't open or the bridge doesn't answer in time.
38
39
  * @param push The addon id plus the built bundle and manifest to swap in.
39
40
  * @returns The device's {@link PluginPushResult}.
@@ -106,7 +106,7 @@ var ControllerClient = class {
106
106
  });
107
107
  }
108
108
  /**
109
- * @description Pushes a freshly built plugin to the device via the bridge and resolves with the
109
+ * @description Pushes a freshly built plugin or theme to the device via the bridge and resolves with the
110
110
  * device's reload outcome. Fails fast if the socket isn't open or the bridge doesn't answer in time.
111
111
  * @param push The addon id plus the built bundle and manifest to swap in.
112
112
  * @returns The device's {@link PluginPushResult}.
@@ -30,15 +30,19 @@ type EvalResult = {
30
30
  /** The inspected error. */
31
31
  error: string;
32
32
  });
33
+ /** The addon managers a push can reload into. */
34
+ type PushedAddonKind = 'plugin' | 'theme';
33
35
  /**
34
- * A request to hot-reload a plugin on the device, sent controller → bridge → device. Carries the
35
- * freshly built bundle and manifest so the device swaps them in without a re-fetch.
36
+ * A request to hot-reload a plugin or theme on the device, sent controller → bridge → device. Carries
37
+ * the freshly built bundle and manifest so the device swaps them in without a re-fetch.
36
38
  */
37
39
  type PluginPushRequest = {
38
40
  type: 'plugin-push';
39
41
  /** Correlation id echoed back on the matching {@link PluginPushResult}. */
40
42
  id: string;
41
43
  addonId: string;
44
+ /** Which manager reloads the addon; a plugin when omitted, as pushes from older CLIs are. */
45
+ kind?: PushedAddonKind;
42
46
  bundle: string;
43
47
  /** The manifest as authored; the device validates it before swapping anything in. */
44
48
  manifest: PushedManifest;
@@ -117,4 +121,4 @@ declare const _default: {
117
121
  parseMessage: typeof parseMessage;
118
122
  serializeMessage: typeof serializeMessage;
119
123
  };
120
- export { DeviceHello as a, EvalRequest as c, MAX_EVAL_TIMEOUT_MS as d, PluginPushRequest as f, serializeMessage as g, parseMessage as h, DEFAULT_EVAL_TIMEOUT_MS as i, EvalResult as l, _default as m, CONTROLLER_ENDPOINT_MARKER as n, DeviceInfo as o, PluginPushResult as p, DEFAULT_BRIDGE_PORT as r, DeviceStatus as s, BridgeMessage as t, LogMessage as u };
124
+ export { serializeMessage as _, DeviceHello as a, EvalRequest as c, MAX_EVAL_TIMEOUT_MS as d, PluginPushRequest as f, parseMessage as g, _default as h, DEFAULT_EVAL_TIMEOUT_MS as i, EvalResult as l, PushedAddonKind as m, CONTROLLER_ENDPOINT_MARKER as n, DeviceInfo as o, PluginPushResult as p, DEFAULT_BRIDGE_PORT as r, DeviceStatus as s, BridgeMessage as t, LogMessage as u };
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as DeviceHello, c as EvalRequest, d as MAX_EVAL_TIMEOUT_MS, f as PluginPushRequest, g as serializeMessage, h as parseMessage, i as DEFAULT_EVAL_TIMEOUT_MS, l as EvalResult, m as _default, n as CONTROLLER_ENDPOINT_MARKER, o as DeviceInfo, p as PluginPushResult, r as DEFAULT_BRIDGE_PORT, s as DeviceStatus, t as BridgeMessage, u as LogMessage } from "./index-CDo0GkFG.mjs";
2
- export { BridgeMessage, CONTROLLER_ENDPOINT_MARKER, DEFAULT_BRIDGE_PORT, DEFAULT_EVAL_TIMEOUT_MS, DeviceHello, DeviceInfo, DeviceStatus, EvalRequest, EvalResult, LogMessage, MAX_EVAL_TIMEOUT_MS, PluginPushRequest, PluginPushResult, _default as default, parseMessage, serializeMessage };
1
+ import { _ as serializeMessage, a as DeviceHello, c as EvalRequest, d as MAX_EVAL_TIMEOUT_MS, f as PluginPushRequest, g as parseMessage, h as _default, i as DEFAULT_EVAL_TIMEOUT_MS, l as EvalResult, m as PushedAddonKind, n as CONTROLLER_ENDPOINT_MARKER, o as DeviceInfo, p as PluginPushResult, r as DEFAULT_BRIDGE_PORT, s as DeviceStatus, t as BridgeMessage, u as LogMessage } from "./index-DdSiZNoR.mjs";
2
+ export { BridgeMessage, CONTROLLER_ENDPOINT_MARKER, DEFAULT_BRIDGE_PORT, DEFAULT_EVAL_TIMEOUT_MS, DeviceHello, DeviceInfo, DeviceStatus, EvalRequest, EvalResult, LogMessage, MAX_EVAL_TIMEOUT_MS, PluginPushRequest, PluginPushResult, PushedAddonKind, _default as default, parseMessage, serializeMessage };
package/dist/index.mjs CHANGED
@@ -36,7 +36,7 @@ function hasRequiredFields(frame) {
36
36
  case "eval": return "id" in frame && typeof frame.id === "string" && "code" in frame && typeof frame.code === "string";
37
37
  case "eval-result": return "id" in frame && typeof frame.id === "string" && "ok" in frame && (frame.ok === true ? "value" in frame && typeof frame.value === "string" : frame.ok === false && hasError(frame));
38
38
  case "plugin-push-result": return "id" in frame && typeof frame.id === "string" && "ok" in frame && (frame.ok === true || frame.ok === false && hasError(frame));
39
- case "plugin-push": return "id" in frame && typeof frame.id === "string" && "addonId" in frame && typeof frame.addonId === "string" && "bundle" in frame && typeof frame.bundle === "string" && "manifest" in frame && typeof frame.manifest === "object" && frame.manifest !== null && (!("bytecode" in frame) || frame.bytecode === void 0 || isStringRecord(frame.bytecode)) && (!("files" in frame) || frame.files === void 0 || isStringRecord(frame.files));
39
+ case "plugin-push": return "id" in frame && typeof frame.id === "string" && "addonId" in frame && typeof frame.addonId === "string" && (!("kind" in frame) || frame.kind === void 0 || frame.kind === "plugin" || frame.kind === "theme") && "bundle" in frame && typeof frame.bundle === "string" && "manifest" in frame && typeof frame.manifest === "object" && frame.manifest !== null && (!("bytecode" in frame) || frame.bytecode === void 0 || isStringRecord(frame.bytecode)) && (!("files" in frame) || frame.files === void 0 || isStringRecord(frame.files));
40
40
  case "hello": return "device" in frame && isDeviceInfo(frame.device);
41
41
  case "device-status": return "connected" in frame && (frame.connected === false || frame.connected === true && (!("device" in frame) || frame.device === void 0 || isDeviceInfo(frame.device)));
42
42
  default: return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbound-app/debugger-protocol",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "description": "The wire protocol and controller client shared by the debugger bridge, the on-device client, and the CLI.",
5
5
  "author": {
6
6
  "name": "Mario P.",