@capybara-hq/plugin-sdk 0.1.0-rc.60 → 0.1.0-rc.61

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.
@@ -143,10 +143,13 @@ export interface DeviceRef {
143
143
  /** The current instance, or null when the device has none. */
144
144
  handle: SandboxHandle | null;
145
145
  }
146
- /** One limit line of a {@link DeviceReport} (shown as is; the provider enforces it). */
146
+ /**
147
+ * One limit line of a {@link DeviceReport} (shown as is; the provider enforces it). `value` is
148
+ * text too: words in it get a Chinese form; pure data (a path, a size) may carry `en` only.
149
+ */
147
150
  export interface DeviceReportLimit {
148
151
  label: DeviceText;
149
- value: string;
152
+ value: DeviceText;
150
153
  }
151
154
  /**
152
155
  * What a provider tells about a device ({@link DeviceProvider.report}): shown to people, never
@@ -128,10 +128,10 @@ export function parseDeviceReport(value) {
128
128
  if (!isRecord(raw))
129
129
  throw new TypeError(`${what} must be an object`);
130
130
  exactKeys(raw, ["label", "value"], what);
131
- if (typeof raw.value !== "string" || raw.value === "" || raw.value.length > L.limitValueChars) {
132
- throw new TypeError(`${what}.value must be a non-empty string of at most ${L.limitValueChars} characters`);
133
- }
134
- return { label: parseText(raw.label, L.limitLabelChars, `${what}.label`), value: raw.value };
131
+ return {
132
+ label: parseText(raw.label, L.limitLabelChars, `${what}.label`),
133
+ value: parseText(raw.value, L.limitValueChars, `${what}.value`),
134
+ };
135
135
  });
136
136
  if (typeof reset !== "boolean")
137
137
  throw new TypeError("device report reset must be a boolean");
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "0.1.0-rc.60";
1
+ export declare const SDK_VERSION = "0.1.0-rc.61";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./avatar-presets.js";
4
4
  export * from "./bootstrap.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = "0.1.0-rc.60";
1
+ export const SDK_VERSION = "0.1.0-rc.61";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./avatar-presets.js";
4
4
  export * from "./bootstrap.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-sdk",
3
- "version": "0.1.0-rc.60",
3
+ "version": "0.1.0-rc.61",
4
4
  "description": "Capybara plugin SDK: the types and pure functions plugins are written against",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {