@ikalogic/at1000 0.8.0 → 0.9.0

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 (79) hide show
  1. package/README.md +77 -0
  2. package/build/at1000-CavzXbSt.cjs +3 -0
  3. package/build/at1000-CavzXbSt.cjs.map +1 -0
  4. package/build/at1000-Cps1W5WB.mjs +3 -0
  5. package/build/at1000-Cps1W5WB.mjs.map +1 -0
  6. package/build/browser.cjs +1 -1
  7. package/build/browser.cjs.map +1 -1
  8. package/build/browser.d.cts +2 -2
  9. package/build/browser.d.mts +2 -2
  10. package/build/browser.mjs +1 -1
  11. package/build/browser.mjs.map +1 -1
  12. package/build/{events-RRtuVpdW.d.cts → events-BVDWI2tr.d.cts} +10 -1
  13. package/build/events-BVDWI2tr.d.cts.map +1 -0
  14. package/build/{events-RRtuVpdW.d.mts → events-BVDWI2tr.d.mts} +10 -1
  15. package/build/events-BVDWI2tr.d.mts.map +1 -0
  16. package/build/events.cjs +1 -1
  17. package/build/events.d.cts +1 -1
  18. package/build/events.d.mts +1 -1
  19. package/build/events.mjs +1 -1
  20. package/build/hmi-Chid1Vvo.d.mts +236 -0
  21. package/build/hmi-Chid1Vvo.d.mts.map +1 -0
  22. package/build/hmi-OyVDyqU-.d.cts +236 -0
  23. package/build/hmi-OyVDyqU-.d.cts.map +1 -0
  24. package/build/hmi.cjs +1 -1
  25. package/build/hmi.cjs.map +1 -1
  26. package/build/hmi.d.cts +2 -2
  27. package/build/hmi.d.mts +2 -2
  28. package/build/hmi.mjs +1 -1
  29. package/build/hmi.mjs.map +1 -1
  30. package/build/{host-TBM8TT7q.d.cts → host-C1Zl1RyR.d.cts} +27 -5
  31. package/build/host-C1Zl1RyR.d.cts.map +1 -0
  32. package/build/{host-BjLI2rbR.d.mts → host-DCfMkBnq.d.mts} +27 -5
  33. package/build/host-DCfMkBnq.d.mts.map +1 -0
  34. package/build/{management-CEL202P0.mjs → management-B-3r1o-0.mjs} +2 -2
  35. package/build/management-B-3r1o-0.mjs.map +1 -0
  36. package/build/{management-hyOL3JnM.cjs → management-BvnwMqhr.cjs} +2 -2
  37. package/build/management-BvnwMqhr.cjs.map +1 -0
  38. package/build/management.cjs +1 -1
  39. package/build/management.d.cts +4 -0
  40. package/build/management.d.cts.map +1 -1
  41. package/build/management.d.mts +4 -0
  42. package/build/management.d.mts.map +1 -1
  43. package/build/management.mjs +1 -1
  44. package/build/node.cjs +1 -1
  45. package/build/node.cjs.map +1 -1
  46. package/build/node.d.cts +2 -2
  47. package/build/node.d.mts +2 -2
  48. package/build/node.mjs +1 -1
  49. package/build/node.mjs.map +1 -1
  50. package/build/{package-BMXokpna.cjs → package-B0uA2_oI.cjs} +2 -2
  51. package/build/package-B0uA2_oI.cjs.map +1 -0
  52. package/build/package-Nl6cPHDx.mjs +2 -0
  53. package/build/package-Nl6cPHDx.mjs.map +1 -0
  54. package/build/{session-qWW9mqWH.d.cts → session-DbV_F9Wz.d.cts} +2 -2
  55. package/build/{session-qWW9mqWH.d.cts.map → session-DbV_F9Wz.d.cts.map} +1 -1
  56. package/build/{session-qWW9mqWH.d.mts → session-DbV_F9Wz.d.mts} +2 -2
  57. package/build/{session-qWW9mqWH.d.mts.map → session-DbV_F9Wz.d.mts.map} +1 -1
  58. package/build/session.cjs +1 -1
  59. package/build/session.d.cts +1 -1
  60. package/build/session.d.mts +1 -1
  61. package/build/session.mjs +1 -1
  62. package/package.json +1 -1
  63. package/build/at1000-CoQUADtx.mjs +0 -3
  64. package/build/at1000-CoQUADtx.mjs.map +0 -1
  65. package/build/at1000-CyFs4TGI.cjs +0 -3
  66. package/build/at1000-CyFs4TGI.cjs.map +0 -1
  67. package/build/events-RRtuVpdW.d.cts.map +0 -1
  68. package/build/events-RRtuVpdW.d.mts.map +0 -1
  69. package/build/hmi-BEMiVKDF.d.cts +0 -151
  70. package/build/hmi-BEMiVKDF.d.cts.map +0 -1
  71. package/build/hmi-BEMiVKDF.d.mts +0 -151
  72. package/build/hmi-BEMiVKDF.d.mts.map +0 -1
  73. package/build/host-BjLI2rbR.d.mts.map +0 -1
  74. package/build/host-TBM8TT7q.d.cts.map +0 -1
  75. package/build/management-CEL202P0.mjs.map +0 -1
  76. package/build/management-hyOL3JnM.cjs.map +0 -1
  77. package/build/package-BMXokpna.cjs.map +0 -1
  78. package/build/package-D7Y23M8-.mjs +0 -2
  79. package/build/package-D7Y23M8-.mjs.map +0 -1
package/build/hmi.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hmi.mjs","names":[],"sources":["../src/api/hmi.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nconst screenText = v.pipe(v.string(), v.maxLength(1024));\nexport type ScreenText = v.InferOutput<typeof screenText>;\n\nexport const text = v.object({ text: screenText });\ntype Text = v.InferOutput<typeof text>;\n\nconst optionalHexColor = v.optional(v.pipe(v.string(), v.length(7), v.hexColor()));\nexport const color = v.object({\n text: optionalHexColor,\n progress: optionalHexColor,\n background: optionalHexColor,\n});\nexport type Color = v.InferOutput<typeof color>;\n\nconst progressValue = v.pipe(v.number(), v.minValue(0), v.maxValue(100));\nexport type ProgressValue = v.InferOutput<typeof progressValue>;\nexport const progress = v.object({ progress: progressValue });\nexport type Progress = v.InferOutput<typeof progress>;\n\nexport const playbackConfiguration = v.object({\n sound_id: v.picklist(\n ['success', 'warning', 'failure', 'notification_1', 'notification_2',\n 'imperial_march'] as const,\n ),\n volume: v.pipe(v.number(), v.minValue(0), v.maxValue(100)),\n});\nexport type PlaybackConfiguration = v.InferOutput<typeof playbackConfiguration>;\n\nexport const internalKnobEvent = v.object({\n button_pressed: v.boolean(),\n button_held: v.boolean(),\n rotation_delta: v.number(),\n});\nconst knobEvent = v.omit(internalKnobEvent, ['button_held']);\nexport type KnobEvent = v.InferOutput<typeof knobEvent>;\n\n/** @hideconstructor */\nexport class HmiApi {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Resets the HMI.\n */\n reset(): Promise<void> {\n return this.fetch('/hmi/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access the screen API.\n * @returns The screen instance.\n */\n screen(): Screen {\n return new Screen(this.fetch);\n }\n\n /**\n * Access the audio API.\n * @returns The audio instance.\n */\n audio(): Audio {\n return new Audio(this.fetch);\n }\n\n /**\n * Access the knob API.\n * @returns The knob instance.\n */\n knob(): Knob {\n return new Knob(this.fetch);\n }\n}\n\n/** @hideconstructor */\nexport class Screen {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Prints text to the screen.\n * @param data The text to print.\n * @returns The printed text.\n */\n async print(data: ScreenText): Promise<string> {\n return (await this.fetch('/hmi/screen/text', {\n method: 'POST',\n body: v.parse(text, { text: data } satisfies Text),\n schema: text,\n }))\n .text;\n }\n\n /**\n * Sets the screen colors.\n * @param colors The colors to set.\n * @returns The updated colors.\n */\n colors(colors: Color): Promise<Color> {\n return this.fetch('/hmi/screen/colors', {\n method: 'PATCH',\n body: v.parse(color, colors satisfies Color),\n schema: color,\n });\n }\n\n /**\n * Sets the screen progress.\n * @param data The progress value to set.\n * @returns The updated progress.\n */\n async progress(data: ProgressValue): Promise<Progress> {\n if (data == 0) {\n return await this.fetch('/hmi/screen/progress', {\n method: 'DELETE',\n parseResponse: () => ({ progress: 0 }),\n });\n }\n\n return this.fetch('/hmi/screen/progress', {\n method: 'PUT',\n body: v.parse(progress, { progress: data } satisfies Progress),\n schema: progress,\n });\n }\n\n /**\n * Clears the screen.\n */\n clear(): Promise<void> {\n return this.fetch('/hmi/screen/clear', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Clears the text on the screen.\n */\n clear_text(): Promise<void> {\n return this.fetch('/hmi/screen/text', { method: 'DELETE', parseResponse: () => {} });\n }\n}\n\n/** @hideconstructor */\nexport class Audio {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Plays a sound.\n * @param config The configuration (sound_id, volume).\n * @returns The play configuration.\n */\n async play(config: PlaybackConfiguration): Promise<PlaybackConfiguration> {\n return this.fetch('/hmi/speaker/play', {\n method: 'POST',\n body: v.parse(playbackConfiguration, config),\n schema: playbackConfiguration,\n });\n }\n}\n\n/** @hideconstructor */\nexport class Knob {\n constructor(private readonly fetch: UpFetch) {}\n\n read_event = () => this.fetch('/hmi/knob/get_knob_event', { schema: internalKnobEvent });\n\n is_button_held = async () => (await this.read_event()).button_held;\n is_knob_turned = async () => Math.abs((await this.read_event()).rotation_delta) >= 4;\n\n /**\n * Waits for a knob event and returns it.\n * @param timeout_ms The timeout in milliseconds.\n * @returns The knob event or null if the timeout was reached.\n */\n async wait_event(timeout_ms?: number): Promise<KnobEvent | null> {\n await this.read_event(); // Discard any previous events\n let delta = 0;\n\n const interval = Math.min(50, (timeout_ms ?? 500) / 10);\n\n const startTime = Date.now();\n while (timeout_ms !== undefined ? Date.now() - startTime < timeout_ms : true) {\n const knobEvent = await this.read_event();\n delta += knobEvent.rotation_delta;\n\n if (knobEvent.button_pressed || Math.abs(delta) >= 4) {\n return { button_pressed: knobEvent.button_pressed, rotation_delta: Math.sign(delta) };\n }\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n\n return null;\n }\n}\n"],"mappings":"0BAGA,MAAM,EAAa,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,UAAU,IAAI,CAAC,EAG1C,EAAO,EAAE,OAAO,CAAE,KAAM,CAAW,CAAC,EAG3C,EAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,OAAO,CAAC,EAAG,EAAE,SAAS,CAAC,CAAC,EACpE,EAAQ,EAAE,OAAO,CAC5B,KAAM,EACN,SAAU,EACV,WAAY,CACd,CAAC,EAGK,EAAgB,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,SAAS,CAAC,EAAG,EAAE,SAAS,GAAG,CAAC,EAE1D,EAAW,EAAE,OAAO,CAAE,SAAU,CAAc,CAAC,EAG/C,EAAwB,EAAE,OAAO,CAC5C,SAAU,EAAE,SACV,CAAC,UAAW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"sources":["../src/api/hmi.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nimport type { EventsApi } from './events';\n\nconst screenText = v.pipe(v.string(), v.maxLength(1024));\nexport type ScreenText = v.InferOutput<typeof screenText>;\n\nexport const text = v.object({ text: screenText });\ntype Text = v.InferOutput<typeof text>;\n\nconst optionalHexColor = v.optional(v.pipe(v.string(), v.length(7), v.hexColor()));\nexport const color = v.object({\n text: optionalHexColor,\n progress: optionalHexColor,\n background: optionalHexColor,\n});\nexport type Color = v.InferOutput<typeof color>;\n\nconst progressValue = v.pipe(v.number(), v.minValue(0), v.maxValue(100));\nexport type ProgressValue = v.InferOutput<typeof progressValue>;\nexport const progress = v.object({ progress: progressValue });\nexport type Progress = v.InferOutput<typeof progress>;\n\nexport const playbackConfiguration = v.object({\n sound_id: v.picklist(\n ['success', 'warning', 'failure', 'notification_1', 'notification_2',\n 'imperial_march'] as const,\n ),\n volume: v.pipe(v.number(), v.minValue(0), v.maxValue(100)),\n});\nexport type PlaybackConfiguration = v.InferOutput<typeof playbackConfiguration>;\n\nexport const internalKnobEvent = v.object({\n button_pressed: v.boolean(),\n button_held: v.boolean(),\n rotation_delta: v.number(),\n});\nconst knobEvent = v.omit(internalKnobEvent, ['button_held']);\nexport type KnobEvent = v.InferOutput<typeof knobEvent>;\n\nconst promptLabel = v.pipe(\n v.string(),\n v.maxBytes(64),\n v.regex(/\\S/u, 'Choice labels must not be blank'),\n v.check((value) => !/\\p{Cc}/u.test(value), 'Choice labels must not contain control characters'),\n);\nconst promptIndex = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(31));\nconst promptChoice = v.object({ label: promptLabel, color: optionalHexColor });\nexport type PromptChoice = v.InferOutput<typeof promptChoice>;\n\n// A choice may be written as a bare label. Position identifies a choice, so two\n// choices may carry the same label.\nconst promptChoiceInput = v.pipe(\n v.union([promptLabel, promptChoice]),\n v.transform((choice): PromptChoice => (typeof choice === 'string' ? { label: choice } : choice)),\n);\n\nconst promptRequest = v.pipe(\n v.object({\n text: v.pipe(\n v.string(),\n v.maxBytes(256),\n v.regex(/\\S/u, 'Prompt text must not be blank'),\n v.check(\n (value) => !/[^\\P{Cc}\\n]/u.test(value),\n 'Prompt text permits line feeds but no other control characters',\n ),\n ),\n choices: v.pipe(v.array(promptChoiceInput), v.minLength(1), v.maxLength(32)),\n default_index: v.optional(promptIndex),\n timeout_ms: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1000), v.maxValue(1800000))),\n }),\n v.check(\n (request) =>\n request.default_index === undefined || request.default_index < request.choices.length,\n 'default_index must be below the number of choices',\n ),\n);\n/** Wire shape, where every choice is an object. */\nexport type PromptRequest = v.InferOutput<typeof promptRequest>;\n/** Accepted shape, where a choice may be a bare label string. */\nexport type PromptRequestInput = v.InferInput<typeof promptRequest>;\n\nconst promptSelection = v.object({ label: promptLabel, index: promptIndex });\nexport type PromptSelection = v.InferOutput<typeof promptSelection>;\n\n/**\n * `selection` is always present: the choice under the knob while pending, the\n * confirmed choice when selected, and the last highlighted choice when the prompt\n * was cancelled or timed out.\n */\nexport const promptState = v.object({\n id: v.pipe(v.string(), v.minLength(1)),\n status: v.picklist(['pending', 'selected', 'cancelled', 'timed_out']),\n selection: promptSelection,\n reason: v.optional(\n v.picklist(['client_cancelled', 'session_ended', 'panel_exit', 'display_replaced']),\n ),\n});\nexport type PromptState = v.InferOutput<typeof promptState>;\nexport type PromptStatus = PromptState['status'];\n\n// The device deadline applied when `timeout_ms` is omitted, and the slack the local\n// event window adds on top of it.\nconst defaultPromptTimeoutMs = 60_000;\nconst promptEventGraceMs = 2_000;\n\n/** @hideconstructor */\nexport class HmiApi {\n constructor(private readonly fetch: UpFetch, private readonly events: EventsApi) {}\n\n /**\n * Resets the HMI.\n */\n reset(): Promise<void> {\n return this.fetch('/hmi/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Shows a single-choice prompt on the LCD and waits for the operator to answer.\n *\n * A choice may be a bare label string. `default_index` selects the initially\n * highlighted choice and defaults to 0. Screen changes, resets, knob reads, and\n * other prompts conflict while the prompt is pending.\n *\n * The wait rides the `hmi.prompt` event. Every event re-arms a\n * `timeout_ms + 2000 ms` window, and a window that expires costs one read before\n * the wait resumes: the device deadline stops as soon as the operator turns the\n * knob, so a prompt somebody is answering is never abandoned locally.\n *\n * Cancellation and timeout are results. HTTP errors and local aborts reject the\n * promise. On failure, cancellation is attempted without replacing the original\n * error.\n */\n async prompt(\n request: PromptRequestInput,\n options?: { signal?: AbortSignal },\n ): Promise<PromptState> {\n const signal = options?.signal;\n signal?.throwIfAborted();\n const windowMs = (request.timeout_ms ?? defaultPromptTimeoutMs) + promptEventGraceMs;\n\n let id: string | undefined;\n let unsubscribe: (() => void) | undefined;\n let openedEvents = false;\n try {\n // Do not abort creation: its response supplies the ID needed for cancellation.\n const created = await this.createPrompt(request);\n id = created.id;\n signal?.throwIfAborted();\n\n // Subscribing after creation cannot lose anything, because the read below\n // covers the gap. That is cheaper than ordering the socket before the POST.\n const inbox: PromptState[] = [];\n let wake: (() => void) | undefined;\n unsubscribe = this.events.on('hmi.prompt', (event) => {\n if (event.data.id !== created.id) return;\n inbox.push(event.data);\n wake?.();\n });\n openedEvents = !this.events.connected;\n await this.events.connect();\n\n // Resolves the next state for this prompt, or undefined once the window expires.\n // The inbox, not the resolution value, carries the events, so a second event\n // arriving before the waiter resumes cannot be dropped.\n const nextEvent = async (): Promise<PromptState | undefined> => {\n if (inbox.length === 0) {\n const { promise, resolve } = Promise.withResolvers<void>();\n const timer = setTimeout(resolve, windowMs);\n wake = resolve;\n try {\n await this.untilAborted(promise, signal);\n } finally {\n clearTimeout(timer);\n wake = undefined;\n }\n }\n return inbox.shift();\n };\n\n let state = await this.untilAborted(this.getPrompt(created.id), signal);\n while (state.status === 'pending') {\n // An empty window means a stalled or reconnecting socket, never a reason to\n // cancel: read once, then wait again.\n const delivered = await nextEvent();\n state = delivered ?? await this.untilAborted(this.getPrompt(created.id), signal);\n }\n return state;\n } catch (error) {\n if (id !== undefined) {\n try {\n await this.cancelPrompt(id);\n } catch {\n // The server deadline still applies if cancellation cannot reach the device.\n }\n }\n throw error;\n } finally {\n unsubscribe?.();\n // A socket the application opened stays open; it may still be listening.\n if (openedEvents) this.events.close();\n }\n }\n\n private createPrompt(request: PromptRequestInput): Promise<PromptState> {\n return this.fetch('/hmi/prompts', {\n method: 'POST',\n body: v.parse(promptRequest, request),\n schema: promptState,\n });\n }\n\n private getPrompt(id: string): Promise<PromptState> {\n return this.fetch(`/hmi/prompts/${encodeURIComponent(id)}`, { schema: promptState });\n }\n\n private cancelPrompt(id: string): Promise<PromptState> {\n return this.fetch(`/hmi/prompts/${encodeURIComponent(id)}`, {\n method: 'DELETE',\n schema: promptState,\n });\n }\n\n /** Settles with `work`, or rejects as soon as `signal` aborts. */\n private async untilAborted<T>(work: Promise<T>, signal?: AbortSignal): Promise<T> {\n if (!signal) return await work;\n let onAbort: (() => void) | undefined;\n try {\n const aborted = new Promise<never>((_, reject) => {\n onAbort = () => reject(signal.reason);\n signal.addEventListener('abort', onAbort, { once: true });\n });\n return await Promise.race([work, aborted]);\n } finally {\n if (onAbort) signal.removeEventListener('abort', onAbort);\n }\n }\n\n /**\n * Access the screen API.\n * @returns The screen instance.\n */\n screen(): Screen {\n return new Screen(this.fetch);\n }\n\n /**\n * Access the audio API.\n * @returns The audio instance.\n */\n audio(): Audio {\n return new Audio(this.fetch);\n }\n\n /**\n * Access the knob API.\n * @returns The knob instance.\n */\n knob(): Knob {\n return new Knob(this.fetch);\n }\n}\n\n/** @hideconstructor */\nexport class Screen {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Prints text to the screen.\n * @param data The text to print.\n * @returns The printed text.\n */\n async print(data: ScreenText): Promise<string> {\n return (await this.fetch('/hmi/screen/text', {\n method: 'POST',\n body: v.parse(text, { text: data } satisfies Text),\n schema: text,\n }))\n .text;\n }\n\n /**\n * Sets the screen colors.\n * @param colors The colors to set.\n * @returns The updated colors.\n */\n colors(colors: Color): Promise<Color> {\n return this.fetch('/hmi/screen/colors', {\n method: 'PATCH',\n body: v.parse(color, colors satisfies Color),\n schema: color,\n });\n }\n\n /**\n * Sets the screen progress.\n * @param data The progress value to set.\n * @returns The updated progress.\n */\n async progress(data: ProgressValue): Promise<Progress> {\n if (data == 0) {\n return await this.fetch('/hmi/screen/progress', {\n method: 'DELETE',\n parseResponse: () => ({ progress: 0 }),\n });\n }\n\n return this.fetch('/hmi/screen/progress', {\n method: 'PUT',\n body: v.parse(progress, { progress: data } satisfies Progress),\n schema: progress,\n });\n }\n\n /**\n * Clears the screen.\n */\n clear(): Promise<void> {\n return this.fetch('/hmi/screen/clear', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Clears the text on the screen.\n */\n clear_text(): Promise<void> {\n return this.fetch('/hmi/screen/text', { method: 'DELETE', parseResponse: () => {} });\n }\n}\n\n/** @hideconstructor */\nexport class Audio {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Plays a sound.\n * @param config The configuration (sound_id, volume).\n * @returns The play configuration.\n */\n async play(config: PlaybackConfiguration): Promise<PlaybackConfiguration> {\n return this.fetch('/hmi/speaker/play', {\n method: 'POST',\n body: v.parse(playbackConfiguration, config),\n schema: playbackConfiguration,\n });\n }\n}\n\n/** @hideconstructor */\nexport class Knob {\n constructor(private readonly fetch: UpFetch) {}\n\n read_event = () => this.fetch('/hmi/knob/get_knob_event', { schema: internalKnobEvent });\n\n is_button_held = async () => (await this.read_event()).button_held;\n is_knob_turned = async () => Math.abs((await this.read_event()).rotation_delta) >= 4;\n\n /**\n * Waits for a knob event and returns it.\n * @param timeout_ms The timeout in milliseconds.\n * @returns The knob event or null if the timeout was reached.\n */\n async wait_event(timeout_ms?: number): Promise<KnobEvent | null> {\n await this.read_event(); // Discard any previous events\n let delta = 0;\n\n const interval = Math.min(50, (timeout_ms ?? 500) / 10);\n\n const startTime = Date.now();\n while (timeout_ms !== undefined ? Date.now() - startTime < timeout_ms : true) {\n const knobEvent = await this.read_event();\n delta += knobEvent.rotation_delta;\n\n if (knobEvent.button_pressed || Math.abs(delta) >= 4) {\n return { button_pressed: knobEvent.button_pressed, rotation_delta: Math.sign(delta) };\n }\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n\n return null;\n }\n}\n"],"mappings":"0BAKA,MAAM,EAAa,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,UAAU,IAAI,CAAC,EAG1C,EAAO,EAAE,OAAO,CAAE,KAAM,CAAW,CAAC,EAG3C,EAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,OAAO,CAAC,EAAG,EAAE,SAAS,CAAC,CAAC,EACpE,EAAQ,EAAE,OAAO,CAC5B,KAAM,EACN,SAAU,EACV,WAAY,CACd,CAAC,EAGK,EAAgB,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,SAAS,CAAC,EAAG,EAAE,SAAS,GAAG,CAAC,EAE1D,EAAW,EAAE,OAAO,CAAE,SAAU,CAAc,CAAC,EAG/C,EAAwB,EAAE,OAAO,CAC5C,SAAU,EAAE,SACV,CAAC,UAAW,UAAW,UAAW,iBAAkB,iBAClD,gBAAgB,CACpB,EACA,OAAQ,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,SAAS,CAAC,EAAG,EAAE,SAAS,GAAG,CAAC,CAC3D,CAAC,EAGY,EAAoB,EAAE,OAAO,CACxC,eAAgB,EAAE,QAAQ,EAC1B,YAAa,EAAE,QAAQ,EACvB,eAAgB,EAAE,OAAO,CAC3B,CAAC,EACiB,EAAE,KAAK,EAAmB,CAAC,aAAa,CAAC,EAG3D,MAAM,EAAc,EAAE,KACpB,EAAE,OAAO,EACT,EAAE,SAAS,EAAE,EACb,EAAE,MAAM,MAAO,iCAAiC,EAChD,EAAE,MAAO,GAAU,CAAC,UAAU,KAAK,CAAK,EAAG,mDAAmD,CAChG,EACM,EAAc,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,QAAQ,EAAG,EAAE,SA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AO,CAAE,eAAgB,EAAU,eAAgB,eAAgB,KAAK,KAAK,CAAK,CAAE,EAEtF,MAAM,IAAI,QAAS,GAAY,WAAW,EAAS,CAAQ,CAAC,CAC9D,CAEA,OAAO,IACT,CACF"}
@@ -1,11 +1,11 @@
1
1
  import { s as ComApi } from "./com-Bkkgrsep.cjs";
2
- import { i as EventsApi } from "./events-RRtuVpdW.cjs";
2
+ import { i as EventsApi } from "./events-BVDWI2tr.cjs";
3
3
  import { Information, ManagementApi } from "./management.cjs";
4
4
  import { s as GpioApi } from "./gpio-D3QEeLKh.cjs";
5
- import { r as HmiApi } from "./hmi-BEMiVKDF.cjs";
5
+ import { r as HmiApi } from "./hmi-OyVDyqU-.cjs";
6
6
  import { i as PowerApi } from "./power-B3oUS0wU.cjs";
7
7
  import { n as RelaysApi } from "./relays-TADiLsPk.cjs";
8
- import { t as SessionApi } from "./session-qWW9mqWH.cjs";
8
+ import { t as SessionApi } from "./session-DbV_F9Wz.cjs";
9
9
  //#region src/at1000.d.ts
10
10
  /** Structured error thrown for AT1000 API responses carrying `{ code, message, suggestion, path }`. */
11
11
  declare class ApiError extends Error {
@@ -21,6 +21,28 @@ declare class ApiError extends Error {
21
21
  path: string;
22
22
  });
23
23
  }
24
+ /** Where a failed request was headed. Attached to a transport error for logs and reports. */
25
+ interface RequestTarget {
26
+ /** Device authority, e.g. `192.168.1.23:8080`. */
27
+ host: string;
28
+ method: string;
29
+ /** Request path, e.g. `/v0/management/projects`. */
30
+ path: string;
31
+ }
32
+ /** Thrown when the device did not answer a request before the client timeout expired. */
33
+ declare class TimeoutError extends Error {
34
+ readonly host: string;
35
+ readonly method: string;
36
+ readonly path: string;
37
+ constructor(target: RequestTarget, cause: unknown);
38
+ }
39
+ /** Thrown when a request never reached the device: no route, refused socket, or unresolved name. */
40
+ declare class ConnectionError extends Error {
41
+ readonly host: string;
42
+ readonly method: string;
43
+ readonly path: string;
44
+ constructor(target: RequestTarget, cause: unknown);
45
+ }
24
46
  /** Options for opening a device. */
25
47
  interface OpenOptions {
26
48
  /** Open read-only: skip `session/open`, mint no token, send no session header. */
@@ -101,5 +123,5 @@ declare function format_host_for_url(host: string, fallbackPort?: number): strin
101
123
  /** Returns the bare host (IP or hostname) from a URL authority, dropping any port. */
102
124
  declare function host_without_port(host: string): string;
103
125
  //#endregion
104
- export { OpenOptions as a, ApiError as i, host_without_port as n, AT1000Base as r, format_host_for_url as t };
105
- //# sourceMappingURL=host-TBM8TT7q.d.cts.map
126
+ export { ConnectionError as a, ApiError as i, host_without_port as n, OpenOptions as o, AT1000Base as r, TimeoutError as s, format_host_for_url as t };
127
+ //# sourceMappingURL=host-C1Zl1RyR.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-C1Zl1RyR.d.cts","names":[],"sources":["../src/at1000.ts","../src/host.ts"],"mappings":";;;;;;;;;;cAaa,iBAAiB;WACnB;;WAEA;WACA;WACA;EAET,YAAY;IAAQ;IAAc;IAAiB;IAAoB;;;;UAoDxD;;EAEf;EACA;;EAEA;;;cAIW,qBAAqB;WACvB;WACA;WACA;EAET,YAAY,QAAQ,eAAe;;;cAUxB,wBAAwB;WAC1B;WACA;WACA;EAET,YAAY,QAAQ,eAAe;;;UAgDpB;;EAEf;;EAEA;;;cAIW;;;;WAIK;;;;WAIA,MAAM;;;;;WAKN;;;;;WAKA;UAER;;;;WAIQ,KAAK;;;;WAIL,KAAK;;;;WAIL,MAAM;;;;WAIN,YAAY;;;;WAIZ,OAAO;;;;WAIP,QAAQ;;;;WAIR,QAAQ;;;;WAIR,SAAS;EAEzB,YAAY,cAAc,MAAM,aAAa,gBAAgB;EA+BvD,SAAK;mBAQY,SACrB,cACA,UAAU,aACV;IAAY;IAA4B;IAAkB;MACzD,QAAQ;;;;;;;;;;iBCtPG,oBAAoB,cAAc;;iBAgBlC,kBAAkB"}
@@ -1,11 +1,11 @@
1
1
  import { s as ComApi } from "./com-Bkkgrsep.mjs";
2
- import { i as EventsApi } from "./events-RRtuVpdW.mjs";
2
+ import { i as EventsApi } from "./events-BVDWI2tr.mjs";
3
3
  import { Information, ManagementApi } from "./management.mjs";
4
4
  import { s as GpioApi } from "./gpio-5-tRkdTW.mjs";
5
- import { r as HmiApi } from "./hmi-BEMiVKDF.mjs";
5
+ import { r as HmiApi } from "./hmi-Chid1Vvo.mjs";
6
6
  import { i as PowerApi } from "./power-D08VFff6.mjs";
7
7
  import { n as RelaysApi } from "./relays-TADiLsPk.mjs";
8
- import { t as SessionApi } from "./session-qWW9mqWH.mjs";
8
+ import { t as SessionApi } from "./session-DbV_F9Wz.mjs";
9
9
  //#region src/at1000.d.ts
10
10
  /** Structured error thrown for AT1000 API responses carrying `{ code, message, suggestion, path }`. */
11
11
  declare class ApiError extends Error {
@@ -21,6 +21,28 @@ declare class ApiError extends Error {
21
21
  path: string;
22
22
  });
23
23
  }
24
+ /** Where a failed request was headed. Attached to a transport error for logs and reports. */
25
+ interface RequestTarget {
26
+ /** Device authority, e.g. `192.168.1.23:8080`. */
27
+ host: string;
28
+ method: string;
29
+ /** Request path, e.g. `/v0/management/projects`. */
30
+ path: string;
31
+ }
32
+ /** Thrown when the device did not answer a request before the client timeout expired. */
33
+ declare class TimeoutError extends Error {
34
+ readonly host: string;
35
+ readonly method: string;
36
+ readonly path: string;
37
+ constructor(target: RequestTarget, cause: unknown);
38
+ }
39
+ /** Thrown when a request never reached the device: no route, refused socket, or unresolved name. */
40
+ declare class ConnectionError extends Error {
41
+ readonly host: string;
42
+ readonly method: string;
43
+ readonly path: string;
44
+ constructor(target: RequestTarget, cause: unknown);
45
+ }
24
46
  /** Options for opening a device. */
25
47
  interface OpenOptions {
26
48
  /** Open read-only: skip `session/open`, mint no token, send no session header. */
@@ -101,5 +123,5 @@ declare function format_host_for_url(host: string, fallbackPort?: number): strin
101
123
  /** Returns the bare host (IP or hostname) from a URL authority, dropping any port. */
102
124
  declare function host_without_port(host: string): string;
103
125
  //#endregion
104
- export { OpenOptions as a, ApiError as i, host_without_port as n, AT1000Base as r, format_host_for_url as t };
105
- //# sourceMappingURL=host-BjLI2rbR.d.mts.map
126
+ export { ConnectionError as a, ApiError as i, host_without_port as n, OpenOptions as o, AT1000Base as r, TimeoutError as s, format_host_for_url as t };
127
+ //# sourceMappingURL=host-DCfMkBnq.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-DCfMkBnq.d.mts","names":[],"sources":["../src/at1000.ts","../src/host.ts"],"mappings":";;;;;;;;;;cAaa,iBAAiB;WACnB;;WAEA;WACA;WACA;EAET,YAAY;IAAQ;IAAc;IAAiB;IAAoB;;;;UAoDxD;;EAEf;EACA;;EAEA;;;cAIW,qBAAqB;WACvB;WACA;WACA;EAET,YAAY,QAAQ,eAAe;;;cAUxB,wBAAwB;WAC1B;WACA;WACA;EAET,YAAY,QAAQ,eAAe;;;UAgDpB;;EAEf;;EAEA;;;cAIW;;;;WAIK;;;;WAIA,MAAM;;;;;WAKN;;;;;WAKA;UAER;;;;WAIQ,KAAK;;;;WAIL,KAAK;;;;WAIL,MAAM;;;;WAIN,YAAY;;;;WAIZ,OAAO;;;;WAIP,QAAQ;;;;WAIR,QAAQ;;;;WAIR,SAAS;EAEzB,YAAY,cAAc,MAAM,aAAa,gBAAgB;EA+BvD,SAAK;mBAQY,SACrB,cACA,UAAU,aACV;IAAY;IAA4B;IAAkB;MACzD,QAAQ;;;;;;;;;;iBCtPG,oBAAoB,cAAc;;iBAgBlC,kBAAkB"}
@@ -1,7 +1,7 @@
1
- import{t as e}from"./common-Ce3FeF-Q.mjs";import"up-fetch";import*as t from"valibot";function n(e,t){let n=t||8080;if(e.startsWith(`[`))return e.includes(`]:`)?e:`${e}:${n}`;let r=e.indexOf(`:`);return r===-1?`${e}:${n}`:r===e.lastIndexOf(`:`)?e:`[${e}]:${n}`}function r(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);return t===-1?e:e.slice(1,t)}let t=e.indexOf(`:`);return t!==-1&&t===e.lastIndexOf(`:`)?e.slice(0,t):e}let i=function(e){return e.Can=`can`,e.Rs232=`rs232`,e.Rs485=`rs485`,e.I2c=`i2c`,e.Spi=`spi`,e.Uart=`uart`,e}({});const a=t.enum(i),o=t.object({min:t.pipe(t.number(),t.minValue(-24),t.maxValue(24)),max:t.pipe(t.number(),t.minValue(-24),t.maxValue(24))}),s=t.object({min:e,max:e}),c=t.object({max:t.number()}),l=t.object({count:t.pipe(t.number(),t.minValue(1)),input_voltage:s,output_voltage:o}),u=t.object({count:t.pipe(t.number(),t.minValue(0)),max_current:t.number(),max_voltage:t.number(),on_resistance:t.pipe(t.number(),t.minValue(0))}),d=t.object({type:t.picklist([`3.0`,`2.0`]),count:t.pipe(t.number(),t.minValue(1))}),f=t.object({type:t.picklist([`1000BASE-T`,`100BASE-T`,`10BASE-T`]),count:t.pipe(t.number(),t.minValue(1))}),p=t.object({type:a,count:t.pipe(t.number(),t.minValue(1))}),m=t.object({count:t.pipe(t.number(),t.minValue(1)),output_voltage:o,current:c}),h=t.object({type:t.picklist([`low_precision`,`high_precision`]),source:t.string(),resolution:t.pipe(t.number(),t.minValue(0))}),g=t.object({width:t.pipe(t.number(),t.minValue(1)),height:t.pipe(t.number(),t.minValue(1))}),_=t.object({type:t.string(),size:g}),v=t.object({count:t.pipe(t.number(),t.minValue(0)),type:t.string()}),y=t.object({count:t.pipe(t.number(),t.minValue(0)),type:t.string()}),b=t.object({display:_,input:v,speaker:y}),x=t.object({io:l,relays:u,usb_ports:t.array(d),ethernet:t.array(f),communication:t.array(p),power_supply:m,current_measurement:t.array(h),hmi:b}),S=t.object({model:t.string(),hostname:t.string(),serial_number:t.string(),firmware_version:t.string(),firmware_commit:t.string(),hardware_version:t.optional(t.number()),disk_used:t.number(),disk_total:t.number(),docker_used:t.number(),ram_used:t.optional(t.number()),ram_total:t.optional(t.number()),cpu_temperature:t.optional(t.number()),capabilities:x}),C=t.picklist([`idle`,`running`,`error`]),w=t.picklist([`created`,`started`,`stopping`,`stopped`,`removed`,`error`]),T=t.picklist([`tcp`,`udp`]),E=t.pipe(t.number(),t.integer(),t.minValue(1),t.maxValue(65535)),D=t.object({host:E,container:E,proto:T}),O=t.pipe(t.string(),t.trim(),t.regex(/^(ssh-|ecdsa-sha2-|sk-ssh-|sk-ecdsa-)/,`Not a recognized SSH public key`)),k=t.picklist([`normal`,`development`]),A=t.object({stream:t.picklist([`stdout`,`stderr`]),line:t.string()}),j=t.object({name:t.string(),path:t.string(),id:t.string(),image:t.string(),is_default:t.boolean(),ports:t.optional(t.array(D),[]),command:t.optional(t.string(),``),state:C,mode:t.optional(k),password_set:t.optional(t.boolean())}),M=t.variant(`change`,[t.object({change:t.literal(`state_changed`),id:t.string(),state:w}),t.object({change:t.literal(`renamed`),id:t.string(),name:t.string()}),t.object({change:t.literal(`default_changed`),id:t.string(),is_default:t.boolean()})]),N=t.partial(t.pick(j,[`name`,`is_default`,`command`])),P=t.picklist([`nodejs`,`python`]);t.object({name:t.string(),template:P,command:t.optional(t.string())});const F=t.object({bundle:t.string(),version:t.string(),compatible:t.string(),description:t.string()}),I=t.object({message:t.string(),bundle:t.string()}),L=t.object({state:t.picklist([`idle`,`installing`,`failed`]),progress:t.number(),message:t.string(),error:t.string(),boot:t.optional(t.picklist([`confirmed`,`pending`,`unknown`]))}),R=t.object({message:t.string()}),z=t.pipe(t.number(),t.finite()),B=t.pipe(t.number(),t.finite(),t.minValue(Number.MIN_VALUE)),V=t.pipe(t.number(),t.integer(),t.minValue(0),t.maxValue(31)),H=t.pipe(t.number(),t.integer(),t.minValue(0),t.maxValue(7)),U=t.pipe(t.number(),t.integer(),t.minValue(0),t.maxValue(1)),W=t.picklist([`pass`,`fail`]),G=t.object({set:z,measured:z,reading:t.optional(z)}),K=t.object({channel:V,points:t.array(G),max_error:z,avg_error:z}),q=t.object({voltage:t.object({points:t.array(G),max_error:z,avg_error:z}),current:t.object({load_ohms:B,points:t.array(G),max_error:z,avg_error:z})}),J=t.object({load_ohms:B,voltage_applied:z,measured_current:z,expected_current:z,error_percent:z}),Y=t.object({relay:H,status:W,test_voltage:z,closed_current:z,open_current:z,calibration:t.optional(K)}),X=t.object({port:U,status:W,voltage:z,current_tests:t.optional(t.array(J))}),Z=t.object({schema_version:t.literal(1),tool_version:t.string(),device_id:t.string(),timestamp:t.string(),firmware_version:t.string(),dac:t.array(K),adc_positive:t.array(K),adc_negative:t.optional(t.array(K)),dut_psu:q,relays:t.array(Y),usb:t.array(X)}),Q=t.object({enabled:t.boolean(),loaded:t.boolean(),last_error:t.optional(t.nullable(t.string())),calibrated_at:t.optional(t.nullable(t.string()))}),$=t.object({enabled:t.boolean()});var ee=class{fetch;host;constructor(e,t){this.fetch=e,this.host=t}info(){return this.fetch(`/management/info`,{schema:S})}get_calibration(){return this.fetch(`/management/calibration`,{schema:Z})}set_calibration(e){return this.fetch(`/management/calibration`,{method:`PUT`,body:t.parse(Z,e),schema:Z})}get_calibration_state(){return this.fetch(`/management/calibration/state`,{schema:Q})}set_calibration_enabled(e){return this.fetch(`/management/calibration/state`,{method:`PATCH`,body:t.parse($,{enabled:e}),schema:Q})}enable_calibration(){return this.set_calibration_enabled(!0)}disable_calibration(){return this.set_calibration_enabled(!1)}async datetime(){let e=await this.fetch(`/management/datetime`,{schema:t.object({epoch_seconds:t.number()})});return new Date(e.epoch_seconds*1e3)}set_datetime(e){return this.fetch(`/management/datetime`,{method:`POST`,body:{epoch_seconds:Math.floor(e.getTime()/1e3)},parseResponse:()=>{}})}get_projects(){return this.fetch(`/management/projects`,{schema:t.array(j)})}list_images(){return this.fetch(`/management/images`,{schema:t.array(t.string())})}get_project(e){return this.fetch(`/management/projects/${e}`,{schema:j})}create_project(e){return this.fetch(`/management/projects`,{method:`POST`,body:e,timeout:3e4,schema:j})}import_project(e,t){return this.fetch(`/management/projects/import`,{method:`POST`,body:e,headers:{"Content-Type":`application/x-tar`,"X-Project-Name":encodeURIComponent(t)},serializeBody:e=>e,timeout:6e5,schema:j})}update_project(e,n){return this.fetch(`/management/projects/${e}`,{method:`PATCH`,body:t.parse(N,n),schema:j})}run_project(e,t=`normal`){return this.fetch(`/management/projects/${e}/run`,{method:`POST`,body:{mode:t},timeout:3e4})}stop_project(e){return this.fetch(`/management/projects/${e}/stop`,{method:`POST`,timeout:3e4})}get_project_ports(e){return this.fetch(`/management/projects/${e}/ports`,{schema:t.array(D)})}set_project_ports(e,n){return this.fetch(`/management/projects/${e}/ports`,{method:`PUT`,body:t.parse(t.array(D),n),timeout:3e4,schema:t.array(D)})}add_project_port(e,n){return this.fetch(`/management/projects/${e}/ports`,{method:`POST`,body:t.parse(D,n),timeout:3e4,schema:t.array(D)})}delete_project_port(e,t){return this.fetch(`/management/projects/${e}/ports/${t}`,{method:`DELETE`,parseResponse:()=>{},timeout:3e4})}set_project_password(e,n){return this.fetch(`/management/projects/${e}/password`,{method:`POST`,body:t.parse(t.object({password:t.pipe(t.string(),t.minLength(1))}),{password:n}),parseResponse:()=>{},timeout:3e4})}get_project_authorized_keys(e){return this.fetch(`/management/projects/${e}/authorized_keys`,{schema:t.array(t.string())})}set_project_authorized_keys(e,n){return this.fetch(`/management/projects/${e}/authorized_keys`,{method:`PUT`,body:t.parse(t.array(O),n),timeout:3e4,schema:t.array(t.string())})}delete_project(e){return this.fetch(`/management/projects/${e}`,{method:`DELETE`,timeout:3e4})}upload_bundle(e,t=`bundle.raucb`){return this.fetch(`/management/update/upload`,{method:`POST`,body:e,headers:{"Content-Type":`application/octet-stream`,"X-Bundle-Filename":t},serializeBody:e=>e,timeout:6e5,schema:F})}bundle_info(){return this.fetch(`/management/update/bundle-info`,{schema:F})}install_update(){return this.fetch(`/management/update/install`,{method:`POST`,schema:I})}update_status(){return this.fetch(`/management/update/status`,{schema:L})}reboot(){return this.fetch(`/management/reboot`,{method:`POST`,schema:R})}get_project_logs(e,n){let r=n?.tail??1e3;return this.fetch(`/management/projects/${e}/logs?tail=${r}`,{schema:t.array(A)})}stream_project_logs(e,r,i){let a=i?.tail??1e3,o=new AbortController,s=`http://${n(this.host)}/v0/management/projects/${e}/logs/stream?tail=${a}`;return(async()=>{try{let e=await fetch(s,{signal:o.signal});if(!e.ok||e.body===null)throw Error(`Log stream failed: HTTP ${e.status}`);let n=e.body.getReader(),i=new TextDecoder,a=``,c=e=>{let n=`message`,i=``;for(let t of e.split(`
1
+ import{t as e}from"./common-Ce3FeF-Q.mjs";import"up-fetch";import*as t from"valibot";function n(e,t){let n=t||8080;if(e.startsWith(`[`))return e.includes(`]:`)?e:`${e}:${n}`;let r=e.indexOf(`:`);return r===-1?`${e}:${n}`:r===e.lastIndexOf(`:`)?e:`[${e}]:${n}`}function r(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);return t===-1?e:e.slice(1,t)}let t=e.indexOf(`:`);return t!==-1&&t===e.lastIndexOf(`:`)?e.slice(0,t):e}let i=function(e){return e.Can=`can`,e.Rs232=`rs232`,e.Rs485=`rs485`,e.I2c=`i2c`,e.Spi=`spi`,e.Uart=`uart`,e}({});const a=t.enum(i),o=t.object({min:t.pipe(t.number(),t.minValue(-24),t.maxValue(24)),max:t.pipe(t.number(),t.minValue(-24),t.maxValue(24))}),s=t.object({min:e,max:e}),c=t.object({max:t.number()}),l=t.object({count:t.pipe(t.number(),t.minValue(1)),input_voltage:s,output_voltage:o}),u=t.object({count:t.pipe(t.number(),t.minValue(0)),max_current:t.number(),max_voltage:t.number(),on_resistance:t.pipe(t.number(),t.minValue(0))}),d=t.object({type:t.picklist([`3.0`,`2.0`]),count:t.pipe(t.number(),t.minValue(1))}),f=t.object({type:t.picklist([`1000BASE-T`,`100BASE-T`,`10BASE-T`]),count:t.pipe(t.number(),t.minValue(1))}),p=t.object({type:a,count:t.pipe(t.number(),t.minValue(1))}),m=t.object({count:t.pipe(t.number(),t.minValue(1)),output_voltage:o,current:c}),h=t.object({type:t.picklist([`low_precision`,`high_precision`]),source:t.string(),resolution:t.pipe(t.number(),t.minValue(0))}),g=t.object({width:t.pipe(t.number(),t.minValue(1)),height:t.pipe(t.number(),t.minValue(1))}),_=t.object({type:t.string(),size:g}),v=t.object({count:t.pipe(t.number(),t.minValue(0)),type:t.string()}),y=t.object({count:t.pipe(t.number(),t.minValue(0)),type:t.string()}),b=t.object({display:_,input:v,speaker:y}),x=t.object({io:l,relays:u,usb_ports:t.array(d),ethernet:t.array(f),communication:t.array(p),power_supply:m,current_measurement:t.array(h),hmi:b}),S=t.object({model:t.string(),hostname:t.string(),serial_number:t.string(),firmware_version:t.string(),firmware_commit:t.string(),hardware_version:t.optional(t.number()),disk_used:t.number(),disk_total:t.number(),docker_used:t.number(),ram_used:t.optional(t.number()),ram_total:t.optional(t.number()),cpu_temperature:t.optional(t.number()),capabilities:x}),C=t.picklist([`idle`,`running`,`error`]),w=t.picklist([`created`,`started`,`stopping`,`stopped`,`removed`,`error`]),T=t.picklist([`tcp`,`udp`]),E=t.pipe(t.number(),t.integer(),t.minValue(1),t.maxValue(65535)),D=t.object({host:E,container:E,proto:T}),O=t.pipe(t.string(),t.trim(),t.regex(/^(ssh-|ecdsa-sha2-|sk-ssh-|sk-ecdsa-)/,`Not a recognized SSH public key`)),k=t.picklist([`normal`,`development`]),A=t.object({stream:t.picklist([`stdout`,`stderr`]),line:t.string()}),j=t.object({name:t.string(),path:t.string(),id:t.string(),image:t.string(),is_default:t.boolean(),ports:t.optional(t.array(D),[]),command:t.optional(t.string(),``),state:C,mode:t.optional(k),password_set:t.optional(t.boolean())}),M=t.variant(`change`,[t.object({change:t.literal(`state_changed`),id:t.string(),state:w}),t.object({change:t.literal(`renamed`),id:t.string(),name:t.string()}),t.object({change:t.literal(`default_changed`),id:t.string(),is_default:t.boolean()})]),N=t.partial(t.pick(j,[`name`,`is_default`,`command`])),P=t.picklist([`nodejs`,`python`]);t.object({name:t.string(),template:P,command:t.optional(t.string())});const F=t.object({bundle:t.string(),version:t.string(),compatible:t.string(),description:t.string()}),I=t.object({message:t.string(),bundle:t.string()}),L=t.object({state:t.picklist([`idle`,`installing`,`failed`]),progress:t.number(),message:t.string(),error:t.string(),boot:t.optional(t.picklist([`confirmed`,`pending`,`unknown`]))}),R=t.object({message:t.string()}),z=t.pipe(t.number(),t.finite()),B=t.pipe(t.number(),t.finite(),t.minValue(Number.MIN_VALUE)),V=t.pipe(t.number(),t.integer(),t.minValue(0),t.maxValue(31)),H=t.pipe(t.number(),t.integer(),t.minValue(0),t.maxValue(7)),U=t.pipe(t.number(),t.integer(),t.minValue(0),t.maxValue(1)),W=t.picklist([`pass`,`fail`]),G=t.object({set:z,measured:z,reading:t.optional(z)}),K=t.object({channel:V,points:t.array(G),max_error:z,avg_error:z}),q=t.object({voltage:t.object({points:t.array(G),max_error:z,avg_error:z}),current:t.object({load_ohms:B,points:t.array(G),max_error:z,avg_error:z})}),J=t.object({load_ohms:B,voltage_applied:z,measured_current:z,expected_current:z,error_percent:z}),Y=t.object({relay:H,status:W,test_voltage:z,closed_current:z,open_current:z,calibration:t.optional(K)}),X=t.object({port:U,status:W,voltage:z,current_tests:t.optional(t.array(J))}),Z=t.object({schema_version:t.literal(1),tool_version:t.string(),device_id:t.string(),timestamp:t.string(),firmware_version:t.string(),dac:t.array(K),adc_positive:t.array(K),adc_negative:t.optional(t.array(K)),dut_psu:q,relays:t.array(Y),usb:t.array(X)}),Q=t.object({enabled:t.boolean(),loaded:t.boolean(),last_error:t.optional(t.nullable(t.string())),calibrated_at:t.optional(t.nullable(t.string()))}),$=t.object({enabled:t.boolean()});var ee=class{fetch;host;constructor(e,t){this.fetch=e,this.host=t}info(){return this.fetch(`/management/info`,{schema:S,timeout:1e3})}get_calibration(){return this.fetch(`/management/calibration`,{schema:Z})}set_calibration(e){return this.fetch(`/management/calibration`,{method:`PUT`,body:t.parse(Z,e),schema:Z})}get_calibration_state(){return this.fetch(`/management/calibration/state`,{schema:Q})}set_calibration_enabled(e){return this.fetch(`/management/calibration/state`,{method:`PATCH`,body:t.parse($,{enabled:e}),schema:Q})}enable_calibration(){return this.set_calibration_enabled(!0)}disable_calibration(){return this.set_calibration_enabled(!1)}async datetime(){let e=await this.fetch(`/management/datetime`,{schema:t.object({epoch_seconds:t.number()})});return new Date(e.epoch_seconds*1e3)}set_datetime(e){return this.fetch(`/management/datetime`,{method:`POST`,body:{epoch_seconds:Math.floor(e.getTime()/1e3)},parseResponse:()=>{}})}get_projects(){return this.fetch(`/management/projects`,{schema:t.array(j)})}list_images(){return this.fetch(`/management/images`,{schema:t.array(t.string())})}get_project(e){return this.fetch(`/management/projects/${e}`,{schema:j})}create_project(e){return this.fetch(`/management/projects`,{method:`POST`,body:e,timeout:3e4,schema:j})}import_project(e,t){return this.fetch(`/management/projects/import`,{method:`POST`,body:e,headers:{"Content-Type":`application/x-tar`,"X-Project-Name":encodeURIComponent(t)},serializeBody:e=>e,timeout:6e5,schema:j})}update_project(e,n){return this.fetch(`/management/projects/${e}`,{method:`PATCH`,body:t.parse(N,n),schema:j})}run_project(e,t=`normal`){return this.fetch(`/management/projects/${e}/run`,{method:`POST`,body:{mode:t},timeout:3e4})}stop_project(e){return this.fetch(`/management/projects/${e}/stop`,{method:`POST`,timeout:3e4})}get_project_ports(e){return this.fetch(`/management/projects/${e}/ports`,{schema:t.array(D)})}set_project_ports(e,n){return this.fetch(`/management/projects/${e}/ports`,{method:`PUT`,body:t.parse(t.array(D),n),timeout:3e4,schema:t.array(D)})}add_project_port(e,n){return this.fetch(`/management/projects/${e}/ports`,{method:`POST`,body:t.parse(D,n),timeout:3e4,schema:t.array(D)})}delete_project_port(e,t){return this.fetch(`/management/projects/${e}/ports/${t}`,{method:`DELETE`,parseResponse:()=>{},timeout:3e4})}set_project_password(e,n){return this.fetch(`/management/projects/${e}/password`,{method:`POST`,body:t.parse(t.object({password:t.pipe(t.string(),t.minLength(1))}),{password:n}),parseResponse:()=>{},timeout:3e4})}get_project_authorized_keys(e){return this.fetch(`/management/projects/${e}/authorized_keys`,{schema:t.array(t.string())})}set_project_authorized_keys(e,n){return this.fetch(`/management/projects/${e}/authorized_keys`,{method:`PUT`,body:t.parse(t.array(O),n),timeout:3e4,schema:t.array(t.string())})}delete_project(e){return this.fetch(`/management/projects/${e}`,{method:`DELETE`,timeout:3e4})}upload_bundle(e,t=`bundle.raucb`){return this.fetch(`/management/update/upload`,{method:`POST`,body:e,headers:{"Content-Type":`application/octet-stream`,"X-Bundle-Filename":t},serializeBody:e=>e,timeout:6e5,schema:F})}bundle_info(){return this.fetch(`/management/update/bundle-info`,{schema:F})}install_update(){return this.fetch(`/management/update/install`,{method:`POST`,schema:I})}update_status(){return this.fetch(`/management/update/status`,{schema:L})}reboot(){return this.fetch(`/management/reboot`,{method:`POST`,schema:R})}get_project_logs(e,n){let r=n?.tail??1e3;return this.fetch(`/management/projects/${e}/logs?tail=${r}`,{schema:t.array(A)})}stream_project_logs(e,r,i){let a=i?.tail??1e3,o=new AbortController,s=`http://${n(this.host)}/v0/management/projects/${e}/logs/stream?tail=${a}`;return(async()=>{try{let e=await fetch(s,{signal:o.signal});if(!e.ok||e.body===null)throw Error(`Log stream failed: HTTP ${e.status}`);let n=e.body.getReader(),i=new TextDecoder,a=``,c=e=>{let n=`message`,i=``;for(let t of e.split(`
2
2
  `))t.startsWith(`event:`)?n=t.slice(6).trim():t.startsWith(`data:`)&&(i+=t.slice(5).trim());if(n===`end`)return r.onEnd?.(),!0;if(n===`log`&&i.length>0){let e=t.safeParse(A,JSON.parse(i));e.success&&r.onLine(e.output)}return!1};for(;;){let{done:e,value:t}=await n.read();if(e)break;a+=i.decode(t,{stream:!0});let r=a.indexOf(`
3
3
 
4
4
  `);for(;r!==-1;){let e=a.slice(0,r);if(a=a.slice(r+2),c(e)){o.abort();return}r=a.indexOf(`
5
5
 
6
6
  `)}}}catch(e){if(o.signal.aborted)return;r.onError?.(e)}})(),{close:()=>o.abort()}}};export{D as a,k as c,r as d,Q as i,L as l,ee as n,j as o,Z as r,M as s,i as t,n as u};
7
- //# sourceMappingURL=management-CEL202P0.mjs.map
7
+ //# sourceMappingURL=management-B-3r1o-0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"management-B-3r1o-0.mjs","names":[],"sources":["../src/host.ts","../src/api/management.ts"],"sourcesContent":["const DEFAULT_PORT = 8080;\n\n/**\n * Formats a host into a URL authority. Returns `host` unchanged when it already\n * carries an explicit port; otherwise appends `fallbackPort` (the device's\n * mDNS-advertised port when known, else the default 8080). Bare IPv6 literals\n * are bracketed. Idempotent: re-formatting an authority is a no-op.\n */\nexport function format_host_for_url(host: string, fallbackPort?: number): string {\n const port = fallbackPort || DEFAULT_PORT;\n if (host.startsWith('[')) {\n return host.includes(']:') ? host : `${host}:${port}`;\n }\n const firstColon = host.indexOf(':');\n if (firstColon === -1) {\n return `${host}:${port}`;\n }\n if (firstColon === host.lastIndexOf(':')) {\n return host; // exactly one colon: host:port already specified\n }\n return `[${host}]:${port}`; // bare IPv6 literal, no port\n}\n\n/** Returns the bare host (IP or hostname) from a URL authority, dropping any port. */\nexport function host_without_port(host: string): string {\n if (host.startsWith('[')) {\n const end = host.indexOf(']');\n return end === -1 ? host : host.slice(1, end); // [ipv6] / [ipv6]:port -> ipv6\n }\n const firstColon = host.indexOf(':');\n if (firstColon !== -1 && firstColon === host.lastIndexOf(':')) {\n return host.slice(0, firstColon); // host:port -> host\n }\n return host; // bare hostname/IPv4 or bare IPv6 literal\n}\n","import { type UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nimport { format_host_for_url } from '../host';\nimport { analogLevel } from './common';\n\nexport enum CommunicationInterfaceType {\n Can = 'can',\n Rs232 = 'rs232',\n Rs485 = 'rs485',\n I2c = 'i2c',\n Spi = 'spi',\n Uart = 'uart',\n}\nconst communicationInterface = v.enum(CommunicationInterfaceType);\n\nconst voltageRange = v.object({\n min: v.pipe(v.number(), v.minValue(-24), v.maxValue(24)),\n max: v.pipe(v.number(), v.minValue(-24), v.maxValue(24)),\n});\n\nconst inputVoltageRange = v.object({ min: analogLevel, max: analogLevel });\n\nconst currentRange = v.object({ max: v.number() });\n\nconst ioCapabilities = v.object({\n count: v.pipe(v.number(), v.minValue(1)),\n input_voltage: inputVoltageRange,\n output_voltage: voltageRange,\n});\n\nconst relaysCapabilities = v.object({\n count: v.pipe(v.number(), v.minValue(0)),\n max_current: v.number(),\n max_voltage: v.number(),\n on_resistance: v.pipe(v.number(), v.minValue(0)),\n});\n\nconst usbCapability = v.object({\n type: v.picklist(['3.0', '2.0']),\n count: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst ethernetCapability = v.object({\n type: v.picklist(['1000BASE-T', '100BASE-T', '10BASE-T']),\n count: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst communicationCapability = v.object({\n type: communicationInterface,\n count: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst powerSupplyCapabilities = v.object({\n count: v.pipe(v.number(), v.minValue(1)),\n output_voltage: voltageRange,\n current: currentRange,\n});\n\nconst currentMeasurementCapabilities = v.object({\n type: v.picklist(['low_precision', 'high_precision']),\n source: v.string(),\n resolution: v.pipe(v.number(), v.minValue(0)),\n});\n\nconst screenSize = v.object({\n width: v.pipe(v.number(), v.minValue(1)),\n height: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst displayCapabilities = v.object({ type: v.string(), size: screenSize });\n\nconst inputCapabilities = v.object({ count: v.pipe(v.number(), v.minValue(0)), type: v.string() });\n\nconst audioCapabilities = v.object({ count: v.pipe(v.number(), v.minValue(0)), type: v.string() });\n\nconst hmiCapabilities = v.object({\n display: displayCapabilities,\n input: inputCapabilities,\n speaker: audioCapabilities,\n});\n\nconst capabilities = v.object({\n io: ioCapabilities,\n relays: relaysCapabilities,\n usb_ports: v.array(usbCapability),\n ethernet: v.array(ethernetCapability),\n communication: v.array(communicationCapability),\n power_supply: powerSupplyCapabilities,\n current_measurement: v.array(currentMeasurementCapabilities),\n hmi: hmiCapabilities,\n});\n\nconst info = v.object({\n model: v.string(),\n hostname: v.string(),\n serial_number: v.string(),\n firmware_version: v.string(),\n firmware_commit: v.string(),\n hardware_version: v.optional(v.number()),\n disk_used: v.number(),\n disk_total: v.number(),\n docker_used: v.number(),\n // Added to the server after firmware 0.3.3 — optional so older devices stay discoverable.\n ram_used: v.optional(v.number()),\n ram_total: v.optional(v.number()),\n cpu_temperature: v.optional(v.number()),\n capabilities: capabilities,\n});\nexport type Information = v.InferOutput<typeof info>;\n\nconst projectStatus = v.picklist(['idle', 'running', 'error']);\nconst projectEventState = v.picklist(['created', 'started', 'stopping', 'stopped', 'removed',\n 'error']);\nconst portProtocol = v.picklist(['tcp', 'udp']);\nconst port = v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(65535));\nexport const portMapping = v.object({ host: port, container: port, proto: portProtocol });\nexport type PortMapping = v.InferOutput<typeof portMapping>;\nconst authorizedKey = v.pipe(\n v.string(),\n v.trim(),\n v.regex(/^(ssh-|ecdsa-sha2-|sk-ssh-|sk-ecdsa-)/, 'Not a recognized SSH public key'),\n);\nexport const runMode = v.picklist(['normal', 'development']);\nexport type RunMode = v.InferOutput<typeof runMode>;\n\nconst logLine = v.object({ stream: v.picklist(['stdout', 'stderr']), line: v.string() });\nexport type LogLine = v.InferOutput<typeof logLine>;\n\nexport const project = v.object({\n name: v.string(),\n path: v.string(),\n id: v.string(),\n image: v.string(),\n is_default: v.boolean(),\n ports: v.optional(v.array(portMapping), []),\n command: v.optional(v.string(), ''),\n state: projectStatus,\n mode: v.optional(runMode),\n password_set: v.optional(v.boolean()),\n});\nexport type Project = v.InferOutput<typeof project>;\n\n// Merged management.project realtime event, discriminated on `change`.\nexport const projectEvent = v.variant('change', [\n v.object({ change: v.literal('state_changed'), id: v.string(), state: projectEventState }),\n v.object({ change: v.literal('renamed'), id: v.string(), name: v.string() }),\n v.object({ change: v.literal('default_changed'), id: v.string(), is_default: v.boolean() }),\n]);\nexport type ProjectEvent = v.InferOutput<typeof projectEvent>;\n\nconst projectPatch = v.partial(v.pick(project, ['name', 'is_default', 'command']));\nexport type ProjectPatch = v.InferOutput<typeof projectPatch>;\n\nconst projectTemplate = v.picklist(['nodejs', 'python']);\nexport type ProjectTemplate = v.InferOutput<typeof projectTemplate>;\n\nconst createProject = v.object({\n name: v.string(),\n template: projectTemplate,\n command: v.optional(v.string()),\n});\nexport type CreateProject = v.InferOutput<typeof createProject>;\n\nconst bundleInfo = v.object({\n bundle: v.string(),\n version: v.string(),\n compatible: v.string(),\n description: v.string(),\n});\nexport type BundleInfo = v.InferOutput<typeof bundleInfo>;\n\nconst installResponse = v.object({ message: v.string(), bundle: v.string() });\nexport type InstallResponse = v.InferOutput<typeof installResponse>;\n\nexport const updateStatus = v.object({\n state: v.picklist(['idle', 'installing', 'failed']),\n progress: v.number(),\n message: v.string(),\n error: v.string(),\n boot: v.optional(v.picklist(['confirmed', 'pending', 'unknown'])),\n});\nexport type UpdateStatus = v.InferOutput<typeof updateStatus>;\n\nconst rebootResponse = v.object({ message: v.string() });\nexport type RebootResponse = v.InferOutput<typeof rebootResponse>;\n\nconst finiteNumber = v.pipe(v.number(), v.finite());\nconst positiveFiniteNumber = v.pipe(v.number(), v.finite(), v.minValue(Number.MIN_VALUE));\nconst channelId = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(31));\nconst relayId = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(7));\nconst usbPortId = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(1));\nconst calibrationStatus = v.picklist(['pass', 'fail']);\n\nconst calibrationPoint = v.object({\n set: finiteNumber,\n measured: finiteNumber,\n reading: v.optional(finiteNumber),\n});\nexport type CalibrationPoint = v.InferOutput<typeof calibrationPoint>;\n\nconst channelCalibration = v.object({\n channel: channelId,\n points: v.array(calibrationPoint),\n max_error: finiteNumber,\n avg_error: finiteNumber,\n});\nexport type ChannelCalibration = v.InferOutput<typeof channelCalibration>;\n\nconst dutPsuCalibration = v.object({\n voltage: v.object({\n points: v.array(calibrationPoint),\n max_error: finiteNumber,\n avg_error: finiteNumber,\n }),\n current: v.object({\n load_ohms: positiveFiniteNumber,\n points: v.array(calibrationPoint),\n max_error: finiteNumber,\n avg_error: finiteNumber,\n }),\n});\nexport type DutPsuCalibration = v.InferOutput<typeof dutPsuCalibration>;\n\nconst currentTestResult = v.object({\n load_ohms: positiveFiniteNumber,\n voltage_applied: finiteNumber,\n measured_current: finiteNumber,\n expected_current: finiteNumber,\n error_percent: finiteNumber,\n});\n/** @deprecated See {@link currentTestResult}. */\nexport type CurrentTestResult = v.InferOutput<typeof currentTestResult>;\n\nconst relayTestResult = v.object({\n relay: relayId,\n status: calibrationStatus,\n test_voltage: finiteNumber,\n closed_current: finiteNumber,\n open_current: finiteNumber,\n calibration: v.optional(channelCalibration),\n});\nexport type RelayTestResult = v.InferOutput<typeof relayTestResult>;\n\nconst usbTestResult = v.object({\n port: usbPortId,\n status: calibrationStatus,\n voltage: finiteNumber,\n /** @deprecated Legacy field; only present on calibrations from older devices. */\n current_tests: v.optional(v.array(currentTestResult)),\n});\nexport type UsbTestResult = v.InferOutput<typeof usbTestResult>;\n\nexport const calibrationData = v.object({\n schema_version: v.literal(1),\n tool_version: v.string(),\n device_id: v.string(),\n timestamp: v.string(),\n firmware_version: v.string(),\n dac: v.array(channelCalibration),\n adc_positive: v.array(channelCalibration),\n adc_negative: v.optional(v.array(channelCalibration)),\n dut_psu: dutPsuCalibration,\n relays: v.array(relayTestResult),\n usb: v.array(usbTestResult),\n});\nexport type CalibrationData = v.InferOutput<typeof calibrationData>;\n\nexport const calibrationState = v.object({\n enabled: v.boolean(),\n loaded: v.boolean(),\n last_error: v.optional(v.nullable(v.string())),\n calibrated_at: v.optional(v.nullable(v.string())),\n});\nexport type CalibrationState = v.InferOutput<typeof calibrationState>;\n\nconst calibrationStatePatch = v.object({ enabled: v.boolean() });\n\n/** @hideconstructor */\nexport class ManagementApi {\n constructor(private readonly fetch: UpFetch, private readonly host: string) {}\n\n /**\n * Gets device information and capabilities.\n *\n * Keeps the 1 s timeout every caller relies on for reachability: `open()` probes with\n * it, and clients poll it as a liveness check. Slower reads use the client default.\n *\n * @returns The device information.\n */\n info() {\n return this.fetch('/management/info', { schema: info, timeout: 1000 });\n }\n\n /**\n * Gets the loaded calibration data.\n * @returns The canonical calibration data stored on the device.\n */\n get_calibration(): Promise<CalibrationData> {\n return this.fetch('/management/calibration', { schema: calibrationData });\n }\n\n /**\n * Uploads and activates calibration data.\n * @param data The full calibration report to store on the device.\n */\n set_calibration(data: CalibrationData): Promise<CalibrationData> {\n return this.fetch('/management/calibration', {\n method: 'PUT',\n body: v.parse(calibrationData, data),\n schema: calibrationData,\n });\n }\n\n /**\n * Gets runtime calibration enable/load state.\n */\n get_calibration_state(): Promise<CalibrationState> {\n return this.fetch('/management/calibration/state', { schema: calibrationState });\n }\n\n /**\n * Enables or disables runtime calibration correction.\n * @param enabled Whether calibration correction should be applied.\n */\n set_calibration_enabled(enabled: boolean): Promise<CalibrationState> {\n return this.fetch('/management/calibration/state', {\n method: 'PATCH',\n body: v.parse(calibrationStatePatch, { enabled }),\n schema: calibrationState,\n });\n }\n\n /** Enables runtime calibration correction. */\n enable_calibration(): Promise<CalibrationState> {\n return this.set_calibration_enabled(true);\n }\n\n /** Disables runtime calibration correction. */\n disable_calibration(): Promise<CalibrationState> {\n return this.set_calibration_enabled(false);\n }\n\n /**\n * Gets the current date and time of the device.\n * @returns The current date and time.\n */\n async datetime(): Promise<Date> {\n const time = await this.fetch('/management/datetime', {\n schema: v.object({ epoch_seconds: v.number() }),\n });\n return new Date(time.epoch_seconds * 1000);\n }\n\n /**\n * Sets the date and time of the device.\n *\n * This will only work if the device is not connected to the internet.\n *\n * @param datetime The date and time to set.\n */\n set_datetime(datetime: Date): Promise<void> {\n return this.fetch('/management/datetime', {\n method: 'POST',\n body: { epoch_seconds: Math.floor(datetime.getTime() / 1000) },\n parseResponse: () => {},\n });\n }\n\n /**\n * Gets a list of all projects.\n * @returns An array of projects.\n */\n get_projects() {\n return this.fetch('/management/projects', { schema: v.array(project) });\n }\n\n /**\n * Lists the AT1000 base images present on the device.\n * @returns Repo tags of on-device base images (e.g. \"localhost/at1000-base:latest\").\n */\n list_images() {\n return this.fetch('/management/images', { schema: v.array(v.string()) });\n }\n\n /**\n * Gets a single project by id.\n * @param projectId The project slug id.\n * @returns The project info.\n */\n get_project(projectId: string) {\n return this.fetch(`/management/projects/${projectId}`, { schema: project });\n }\n\n /**\n * Creates a new project from a preinstalled template.\n * @param newProject The project creation data.\n */\n create_project(newProject: CreateProject) {\n return this.fetch('/management/projects', {\n method: 'POST',\n body: newProject,\n timeout: 30_000,\n schema: project,\n });\n }\n\n /**\n * Imports a project from a container image archive (.tar / .tar.gz). The archive streams\n * straight to the device, so pass a lazily file-backed Blob (`await fs.openAsBlob(path)` on\n * Node, a `File` from an input element in the browser): `new Blob([await readFile(path)])`\n * buffers the whole archive in the caller's heap.\n * @param file The image archive to import.\n * @param name The project name (sent percent-encoded; the server decodes it).\n * @returns The created project.\n */\n import_project(file: Blob, name: string) {\n return this.fetch('/management/projects/import', {\n method: 'POST',\n body: file,\n headers: { 'Content-Type': 'application/x-tar', 'X-Project-Name': encodeURIComponent(name) },\n serializeBody: (b) => b as any,\n timeout: 600_000,\n schema: project,\n });\n }\n\n /**\n * Patches an existing project (`name`, `is_default`, `command`). An empty `command` clears it (entrypoint autodetect).\n * @param projectId The project slug id.\n * @param data The data to patch the project with.\n */\n update_project(projectId: string, data: ProjectPatch) {\n return this.fetch(`/management/projects/${projectId}`, {\n method: 'PATCH',\n body: v.parse(projectPatch, data),\n schema: project,\n });\n }\n\n /**\n * Runs a project.\n * @param projectId The project slug id.\n * @param mode The run mode: 'normal' (default) or 'development' (starts sshd).\n */\n run_project(projectId: string, mode: RunMode = 'normal') {\n return this.fetch(`/management/projects/${projectId}/run`, {\n method: 'POST',\n body: { mode },\n timeout: 30_000,\n });\n }\n\n /**\n * Stops a running project.\n * @param projectId The project slug id.\n */\n stop_project(projectId: string) {\n return this.fetch(`/management/projects/${projectId}/stop`, {\n method: 'POST',\n timeout: 30_000,\n });\n }\n\n /**\n * Gets the port mappings for a project.\n * @param projectId The project slug id.\n * @returns The project's port mappings.\n */\n get_project_ports(projectId: string) {\n return this.fetch(`/management/projects/${projectId}/ports`, { schema: v.array(portMapping) });\n }\n\n /**\n * Replaces the full set of port mappings for a project.\n * @param projectId The project slug id.\n * @param ports The complete list of port mappings.\n * @returns The updated port mappings.\n */\n set_project_ports(projectId: string, ports: PortMapping[]) {\n return this.fetch(`/management/projects/${projectId}/ports`, {\n method: 'PUT',\n body: v.parse(v.array(portMapping), ports),\n timeout: 30_000,\n schema: v.array(portMapping),\n });\n }\n\n /**\n * Adds a single port mapping to a project.\n * @param projectId The project slug id.\n * @param mapping The port mapping to add.\n * @returns The updated port mappings.\n */\n add_project_port(projectId: string, mapping: PortMapping) {\n return this.fetch(`/management/projects/${projectId}/ports`, {\n method: 'POST',\n body: v.parse(portMapping, mapping),\n timeout: 30_000,\n schema: v.array(portMapping),\n });\n }\n\n /**\n * Removes the port mapping for a host port from a project.\n * @param projectId The project slug id.\n * @param hostPort The host port to unmap.\n */\n delete_project_port(projectId: string, hostPort: number) {\n return this.fetch(`/management/projects/${projectId}/ports/${hostPort}`, {\n method: 'DELETE',\n parseResponse: () => {},\n timeout: 30_000,\n });\n }\n\n /**\n * Sets the password of the project's dev user (used for SSH password login in\n * development mode).\n * @param projectId The project slug id.\n * @param password The new password.\n */\n set_project_password(projectId: string, password: string) {\n return this.fetch(`/management/projects/${projectId}/password`, {\n method: 'POST',\n body: v.parse(v.object({ password: v.pipe(v.string(), v.minLength(1)) }), { password }),\n parseResponse: () => {},\n timeout: 30_000,\n });\n }\n\n /**\n * Gets the SSH authorized_keys for the project's dev user.\n * @param projectId The project slug id.\n * @returns The list of authorized public keys.\n */\n get_project_authorized_keys(projectId: string) {\n return this.fetch(`/management/projects/${projectId}/authorized_keys`, {\n schema: v.array(v.string()),\n });\n }\n\n /**\n * Replaces the SSH authorized_keys for the project's dev user.\n * @param projectId The project slug id.\n * @param keys The complete list of authorized public keys.\n * @returns The updated list of authorized public keys.\n */\n set_project_authorized_keys(projectId: string, keys: string[]) {\n return this.fetch(`/management/projects/${projectId}/authorized_keys`, {\n method: 'PUT',\n body: v.parse(v.array(authorizedKey), keys),\n timeout: 30_000,\n schema: v.array(v.string()),\n });\n }\n\n /**\n * Deletes a project.\n * @param projectId The project slug id.\n */\n delete_project(projectId: string) {\n return this.fetch(`/management/projects/${projectId}`, { method: 'DELETE', timeout: 30_000 });\n }\n\n /**\n * Uploads a firmware bundle to the device and inspects it.\n * The bundle is staged for installation but not installed yet. The body streams straight to\n * the device, so pass a lazily file-backed Blob (`await fs.openAsBlob(path)` on Node, a `File`\n * from an input element in the browser): `new Blob([await readFile(path)])` buffers the whole\n * bundle in the caller's heap.\n * @param file The firmware bundle file (.raucb).\n * @param filename Optional filename for the bundle. Defaults to 'bundle.raucb'.\n * @returns Bundle metadata including version information.\n */\n upload_bundle(file: Blob, filename = 'bundle.raucb') {\n return this.fetch('/management/update/upload', {\n method: 'POST',\n body: file,\n headers: { 'Content-Type': 'application/octet-stream', 'X-Bundle-Filename': filename },\n serializeBody: (b) => b as any,\n timeout: 600_000,\n schema: bundleInfo,\n });\n }\n\n /**\n * Gets metadata for the currently staged firmware bundle.\n * @returns Bundle metadata including version information.\n */\n bundle_info() {\n return this.fetch('/management/update/bundle-info', { schema: bundleInfo });\n }\n\n /**\n * Installs a previously uploaded firmware bundle.\n * @returns The install response with message and bundle name.\n */\n install_update() {\n return this.fetch('/management/update/install', { method: 'POST', schema: installResponse });\n }\n\n /**\n * Gets the current firmware update status.\n * @returns The update status including state, progress, message and error.\n */\n update_status() {\n return this.fetch('/management/update/status', { schema: updateStatus });\n }\n\n /**\n * Reboots the device.\n * @returns The reboot response message.\n */\n reboot() {\n return this.fetch('/management/reboot', { method: 'POST', schema: rebootResponse });\n }\n\n /**\n * Gets the current run's container logs for a project (one-shot).\n *\n * Lines are scoped server-side to the container's most recent start: a running\n * project returns the live run so far, an idle/stopped project the last run.\n * stdout and stderr are merged into one chronological array; each entry's\n * `stream` field says which it came from.\n *\n * @param projectId The project slug id.\n * @param options.tail Max number of trailing lines (default 1000, clamped 1..10000).\n * @returns The current run's log lines, in order.\n */\n get_project_logs(projectId: string, options?: { tail?: number }) {\n const tail = options?.tail ?? 1000;\n return this.fetch(`/management/projects/${projectId}/logs?tail=${tail}`, {\n schema: v.array(logLine),\n });\n }\n\n /**\n * Streams the current run's container logs for a project over SSE.\n *\n * Replays the current run's recent lines (bounded by `tail`) then follows live\n * with zero gap. `onLine` fires once per line (stdout and stderr merged in\n * order); `onEnd` fires when the follow ends (the container stopped, or an\n * idle project's last-run replay completed). No auto-reconnect.\n *\n * @param projectId The project slug id.\n * @param handlers Line/end/error callbacks.\n * @param options.tail Max number of trailing lines (default 1000, clamped 1..10000).\n * @returns A handle whose `close()` aborts the stream.\n */\n stream_project_logs(\n projectId: string,\n handlers: {\n onLine: (line: LogLine) => void;\n onEnd?: () => void;\n onError?: (err: unknown) => void;\n },\n options?: { tail?: number },\n ): { close: () => void } {\n const tail = options?.tail ?? 1000;\n const controller = new AbortController();\n const url = `http://${format_host_for_url(this.host)}`\n + `/v0/management/projects/${projectId}/logs/stream?tail=${tail}`;\n\n void (async () => {\n try {\n const response = await fetch(url, { signal: controller.signal });\n if (!response.ok || response.body === null) {\n throw new Error(`Log stream failed: HTTP ${response.status}`);\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n\n const dispatch = (record: string): boolean => {\n let event = 'message';\n let data = '';\n for (const rawLine of record.split('\\n')) {\n if (rawLine.startsWith('event:')) {\n event = rawLine.slice('event:'.length).trim();\n } else if (rawLine.startsWith('data:')) {\n data += rawLine.slice('data:'.length).trim();\n }\n }\n if (event === 'end') {\n handlers.onEnd?.();\n return true; // terminal\n }\n if (event === 'log' && data.length > 0) {\n const parsed = v.safeParse(logLine, JSON.parse(data));\n if (parsed.success) {\n handlers.onLine(parsed.output);\n }\n }\n return false;\n };\n\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n buffer += decoder.decode(value, { stream: true });\n let separator = buffer.indexOf('\\n\\n');\n while (separator !== -1) {\n const record = buffer.slice(0, separator);\n buffer = buffer.slice(separator + 2);\n if (dispatch(record)) {\n controller.abort();\n return;\n }\n separator = buffer.indexOf('\\n\\n');\n }\n }\n } catch (err) {\n if (controller.signal.aborted) {\n return; // caller closed, or terminal end handled above\n }\n handlers.onError?.(err);\n }\n })();\n\n return { close: () => controller.abort() };\n }\n}\n"],"mappings":"qFAQA,SAAgB,EAAoB,EAAc,EAA+B,CAC/E,IAAM,EAAO,GAAgB,KAC7B,GAAI,EAAK,WAAW,GAAG,EACrB,OAAO,EAAK,SAAS,IAAI,EAAI,EAAO,GAAG,EAAK,GAAG,IAEjD,IAAM,EAAa,EAAK,QAAQ,GAAG,EAOnC,OANI,IAAe,GACV,GAAG,EAAK,GAAG,IAEhB,IAAe,EAAK,YAAY,GAAG,EAC9B,EAEF,IAAI,EAAK,IAAI,GACtB,CAGA,SAAgB,EAAkB,EAAsB,CACtD,GAAI,EAAK,WAAW,GAAG,EAAG,CACxB,IAAM,EAAM,EAAK,QAAQ,GAAG,EAC5B,OAAO,IAAQ,GAAK,EAAO,EAAK,MAAM,EAAG,CAAG,CAC9C,CACA,IAAM,EAAa,EAAK,QAAQ,GAAG,EAInC,OAHI,IAAe,IAAM,IAAe,EAAK,YAAY,GAAG,EACnD,EAAK,MAAM,EAAG,CAAU,EAE1B,CACT,CC5BA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,IAAA,MACA,EAAA,MAAA,QACA,EAAA,MAAA,QACA,EAAA,IAAA,MACA,EAAA,IAAA,MACA,EAAA,KAAA,QACF,EAAA,CAAA,CAAA,EACA,MAAM,EAAyB,EAAE,KAAK,CAA0B,EAE1D,EAAe,EAAE,OAAO,CAC5B,IAAK,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,SAAS,GAAG,EAAG,EAAE,SAAS,EAAE,CAAC,EACvD,IAAK,EAAE,KAAK,EAAE,OAAO,EAAG,EAAE,SAAS,GAAG,EAAG,EAAE,SAAS,EAAE,CAAC,CACzD,CAAC,EA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;CAAI,EACjC,EAAQ,WAAW,QAAQ,EAC7B,EAAQ,EAAQ,MAAM,CAAe,CAAC,CAAC,KAAK,EACnC,EAAQ,WAAW,OAAO,IACnC,GAAQ,EAAQ,MAAM,CAAc,CAAC,CAAC,KAAK,GAG/C,GAAI,IAAU,MAEZ,OADA,EAAS,QAAQ,EACV,GAET,GAAI,IAAU,OAAS,EAAK,OAAS,EAAG,CACtC,IAAM,EAAS,EAAE,UAAU,EAAS,KAAK,MAAM,CAAI,CAAC,EAChD,EAAO,SACT,EAAS,OAAO,EAAO,MAAM,CAEjC,CACA,MAAO,EACT,EAEA,OAAS,CACP,GAAM,CAAE,OAAM,SAAU,MAAM,EAAO,KAAK,EAC1C,GAAI,EACF,MAEF,GAAU,EAAQ,OAAO,EAAO,CAAE,OAAQ,EAAK,CAAC,EAChD,IAAI,EAAY,EAAO,QAAQ;;CAAM,EACrC,KAAO,IAAc,IAAI,CACvB,IAAM,EAAS,EAAO,MAAM,EAAG,CAAS,EAExC,GADA,EAAS,EAAO,MAAM,EAAY,CAAC,EAC/B,EAAS,CAAM,EAAG,CACpB,EAAW,MAAM,EACjB,MACF,CACA,EAAY,EAAO,QAAQ;;CAAM,CACnC,CACF,CACF,OAAS,EAAK,CACZ,GAAI,EAAW,OAAO,QACpB,OAEF,EAAS,UAAU,CAAG,CACxB,CACF,EAAA,CAAG,EAEI,CAAE,UAAa,EAAW,MAAM,CAAE,CAC3C,CACF"}
@@ -1,7 +1,7 @@
1
- const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./common-BUohXSqz.cjs");require("up-fetch");let n=require("valibot");n=e.t(n,1);function r(e,t){let n=t||8080;if(e.startsWith(`[`))return e.includes(`]:`)?e:`${e}:${n}`;let r=e.indexOf(`:`);return r===-1?`${e}:${n}`:r===e.lastIndexOf(`:`)?e:`[${e}]:${n}`}function i(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);return t===-1?e:e.slice(1,t)}let t=e.indexOf(`:`);return t!==-1&&t===e.lastIndexOf(`:`)?e.slice(0,t):e}let a=function(e){return e.Can=`can`,e.Rs232=`rs232`,e.Rs485=`rs485`,e.I2c=`i2c`,e.Spi=`spi`,e.Uart=`uart`,e}({});const o=n.enum(a),s=n.object({min:n.pipe(n.number(),n.minValue(-24),n.maxValue(24)),max:n.pipe(n.number(),n.minValue(-24),n.maxValue(24))}),c=n.object({min:t.t,max:t.t}),l=n.object({max:n.number()}),u=n.object({count:n.pipe(n.number(),n.minValue(1)),input_voltage:c,output_voltage:s}),d=n.object({count:n.pipe(n.number(),n.minValue(0)),max_current:n.number(),max_voltage:n.number(),on_resistance:n.pipe(n.number(),n.minValue(0))}),f=n.object({type:n.picklist([`3.0`,`2.0`]),count:n.pipe(n.number(),n.minValue(1))}),p=n.object({type:n.picklist([`1000BASE-T`,`100BASE-T`,`10BASE-T`]),count:n.pipe(n.number(),n.minValue(1))}),m=n.object({type:o,count:n.pipe(n.number(),n.minValue(1))}),h=n.object({count:n.pipe(n.number(),n.minValue(1)),output_voltage:s,current:l}),g=n.object({type:n.picklist([`low_precision`,`high_precision`]),source:n.string(),resolution:n.pipe(n.number(),n.minValue(0))}),_=n.object({width:n.pipe(n.number(),n.minValue(1)),height:n.pipe(n.number(),n.minValue(1))}),v=n.object({type:n.string(),size:_}),y=n.object({count:n.pipe(n.number(),n.minValue(0)),type:n.string()}),b=n.object({count:n.pipe(n.number(),n.minValue(0)),type:n.string()}),x=n.object({display:v,input:y,speaker:b}),S=n.object({io:u,relays:d,usb_ports:n.array(f),ethernet:n.array(p),communication:n.array(m),power_supply:h,current_measurement:n.array(g),hmi:x}),C=n.object({model:n.string(),hostname:n.string(),serial_number:n.string(),firmware_version:n.string(),firmware_commit:n.string(),hardware_version:n.optional(n.number()),disk_used:n.number(),disk_total:n.number(),docker_used:n.number(),ram_used:n.optional(n.number()),ram_total:n.optional(n.number()),cpu_temperature:n.optional(n.number()),capabilities:S}),w=n.picklist([`idle`,`running`,`error`]),T=n.picklist([`created`,`started`,`stopping`,`stopped`,`removed`,`error`]),E=n.picklist([`tcp`,`udp`]),D=n.pipe(n.number(),n.integer(),n.minValue(1),n.maxValue(65535)),O=n.object({host:D,container:D,proto:E}),k=n.pipe(n.string(),n.trim(),n.regex(/^(ssh-|ecdsa-sha2-|sk-ssh-|sk-ecdsa-)/,`Not a recognized SSH public key`)),A=n.picklist([`normal`,`development`]),j=n.object({stream:n.picklist([`stdout`,`stderr`]),line:n.string()}),M=n.object({name:n.string(),path:n.string(),id:n.string(),image:n.string(),is_default:n.boolean(),ports:n.optional(n.array(O),[]),command:n.optional(n.string(),``),state:w,mode:n.optional(A),password_set:n.optional(n.boolean())}),N=n.variant(`change`,[n.object({change:n.literal(`state_changed`),id:n.string(),state:T}),n.object({change:n.literal(`renamed`),id:n.string(),name:n.string()}),n.object({change:n.literal(`default_changed`),id:n.string(),is_default:n.boolean()})]),P=n.partial(n.pick(M,[`name`,`is_default`,`command`])),F=n.picklist([`nodejs`,`python`]);n.object({name:n.string(),template:F,command:n.optional(n.string())});const I=n.object({bundle:n.string(),version:n.string(),compatible:n.string(),description:n.string()}),L=n.object({message:n.string(),bundle:n.string()}),R=n.object({state:n.picklist([`idle`,`installing`,`failed`]),progress:n.number(),message:n.string(),error:n.string(),boot:n.optional(n.picklist([`confirmed`,`pending`,`unknown`]))}),z=n.object({message:n.string()}),B=n.pipe(n.number(),n.finite()),V=n.pipe(n.number(),n.finite(),n.minValue(Number.MIN_VALUE)),H=n.pipe(n.number(),n.integer(),n.minValue(0),n.maxValue(31)),U=n.pipe(n.number(),n.integer(),n.minValue(0),n.maxValue(7)),W=n.pipe(n.number(),n.integer(),n.minValue(0),n.maxValue(1)),G=n.picklist([`pass`,`fail`]),K=n.object({set:B,measured:B,reading:n.optional(B)}),q=n.object({channel:H,points:n.array(K),max_error:B,avg_error:B}),J=n.object({voltage:n.object({points:n.array(K),max_error:B,avg_error:B}),current:n.object({load_ohms:V,points:n.array(K),max_error:B,avg_error:B})}),Y=n.object({load_ohms:V,voltage_applied:B,measured_current:B,expected_current:B,error_percent:B}),X=n.object({relay:U,status:G,test_voltage:B,closed_current:B,open_current:B,calibration:n.optional(q)}),Z=n.object({port:W,status:G,voltage:B,current_tests:n.optional(n.array(Y))}),Q=n.object({schema_version:n.literal(1),tool_version:n.string(),device_id:n.string(),timestamp:n.string(),firmware_version:n.string(),dac:n.array(q),adc_positive:n.array(q),adc_negative:n.optional(n.array(q)),dut_psu:J,relays:n.array(X),usb:n.array(Z)}),$=n.object({enabled:n.boolean(),loaded:n.boolean(),last_error:n.optional(n.nullable(n.string())),calibrated_at:n.optional(n.nullable(n.string()))}),ee=n.object({enabled:n.boolean()});var te=class{fetch;host;constructor(e,t){this.fetch=e,this.host=t}info(){return this.fetch(`/management/info`,{schema:C})}get_calibration(){return this.fetch(`/management/calibration`,{schema:Q})}set_calibration(e){return this.fetch(`/management/calibration`,{method:`PUT`,body:n.parse(Q,e),schema:Q})}get_calibration_state(){return this.fetch(`/management/calibration/state`,{schema:$})}set_calibration_enabled(e){return this.fetch(`/management/calibration/state`,{method:`PATCH`,body:n.parse(ee,{enabled:e}),schema:$})}enable_calibration(){return this.set_calibration_enabled(!0)}disable_calibration(){return this.set_calibration_enabled(!1)}async datetime(){let e=await this.fetch(`/management/datetime`,{schema:n.object({epoch_seconds:n.number()})});return new Date(e.epoch_seconds*1e3)}set_datetime(e){return this.fetch(`/management/datetime`,{method:`POST`,body:{epoch_seconds:Math.floor(e.getTime()/1e3)},parseResponse:()=>{}})}get_projects(){return this.fetch(`/management/projects`,{schema:n.array(M)})}list_images(){return this.fetch(`/management/images`,{schema:n.array(n.string())})}get_project(e){return this.fetch(`/management/projects/${e}`,{schema:M})}create_project(e){return this.fetch(`/management/projects`,{method:`POST`,body:e,timeout:3e4,schema:M})}import_project(e,t){return this.fetch(`/management/projects/import`,{method:`POST`,body:e,headers:{"Content-Type":`application/x-tar`,"X-Project-Name":encodeURIComponent(t)},serializeBody:e=>e,timeout:6e5,schema:M})}update_project(e,t){return this.fetch(`/management/projects/${e}`,{method:`PATCH`,body:n.parse(P,t),schema:M})}run_project(e,t=`normal`){return this.fetch(`/management/projects/${e}/run`,{method:`POST`,body:{mode:t},timeout:3e4})}stop_project(e){return this.fetch(`/management/projects/${e}/stop`,{method:`POST`,timeout:3e4})}get_project_ports(e){return this.fetch(`/management/projects/${e}/ports`,{schema:n.array(O)})}set_project_ports(e,t){return this.fetch(`/management/projects/${e}/ports`,{method:`PUT`,body:n.parse(n.array(O),t),timeout:3e4,schema:n.array(O)})}add_project_port(e,t){return this.fetch(`/management/projects/${e}/ports`,{method:`POST`,body:n.parse(O,t),timeout:3e4,schema:n.array(O)})}delete_project_port(e,t){return this.fetch(`/management/projects/${e}/ports/${t}`,{method:`DELETE`,parseResponse:()=>{},timeout:3e4})}set_project_password(e,t){return this.fetch(`/management/projects/${e}/password`,{method:`POST`,body:n.parse(n.object({password:n.pipe(n.string(),n.minLength(1))}),{password:t}),parseResponse:()=>{},timeout:3e4})}get_project_authorized_keys(e){return this.fetch(`/management/projects/${e}/authorized_keys`,{schema:n.array(n.string())})}set_project_authorized_keys(e,t){return this.fetch(`/management/projects/${e}/authorized_keys`,{method:`PUT`,body:n.parse(n.array(k),t),timeout:3e4,schema:n.array(n.string())})}delete_project(e){return this.fetch(`/management/projects/${e}`,{method:`DELETE`,timeout:3e4})}upload_bundle(e,t=`bundle.raucb`){return this.fetch(`/management/update/upload`,{method:`POST`,body:e,headers:{"Content-Type":`application/octet-stream`,"X-Bundle-Filename":t},serializeBody:e=>e,timeout:6e5,schema:I})}bundle_info(){return this.fetch(`/management/update/bundle-info`,{schema:I})}install_update(){return this.fetch(`/management/update/install`,{method:`POST`,schema:L})}update_status(){return this.fetch(`/management/update/status`,{schema:R})}reboot(){return this.fetch(`/management/reboot`,{method:`POST`,schema:z})}get_project_logs(e,t){let r=t?.tail??1e3;return this.fetch(`/management/projects/${e}/logs?tail=${r}`,{schema:n.array(j)})}stream_project_logs(e,t,i){let a=i?.tail??1e3,o=new AbortController,s=`http://${r(this.host)}/v0/management/projects/${e}/logs/stream?tail=${a}`;return(async()=>{try{let e=await fetch(s,{signal:o.signal});if(!e.ok||e.body===null)throw Error(`Log stream failed: HTTP ${e.status}`);let r=e.body.getReader(),i=new TextDecoder,a=``,c=e=>{let r=`message`,i=``;for(let t of e.split(`
1
+ const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./common-BUohXSqz.cjs");require("up-fetch");let n=require("valibot");n=e.t(n,1);function r(e,t){let n=t||8080;if(e.startsWith(`[`))return e.includes(`]:`)?e:`${e}:${n}`;let r=e.indexOf(`:`);return r===-1?`${e}:${n}`:r===e.lastIndexOf(`:`)?e:`[${e}]:${n}`}function i(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);return t===-1?e:e.slice(1,t)}let t=e.indexOf(`:`);return t!==-1&&t===e.lastIndexOf(`:`)?e.slice(0,t):e}let a=function(e){return e.Can=`can`,e.Rs232=`rs232`,e.Rs485=`rs485`,e.I2c=`i2c`,e.Spi=`spi`,e.Uart=`uart`,e}({});const o=n.enum(a),s=n.object({min:n.pipe(n.number(),n.minValue(-24),n.maxValue(24)),max:n.pipe(n.number(),n.minValue(-24),n.maxValue(24))}),c=n.object({min:t.t,max:t.t}),l=n.object({max:n.number()}),u=n.object({count:n.pipe(n.number(),n.minValue(1)),input_voltage:c,output_voltage:s}),d=n.object({count:n.pipe(n.number(),n.minValue(0)),max_current:n.number(),max_voltage:n.number(),on_resistance:n.pipe(n.number(),n.minValue(0))}),f=n.object({type:n.picklist([`3.0`,`2.0`]),count:n.pipe(n.number(),n.minValue(1))}),p=n.object({type:n.picklist([`1000BASE-T`,`100BASE-T`,`10BASE-T`]),count:n.pipe(n.number(),n.minValue(1))}),m=n.object({type:o,count:n.pipe(n.number(),n.minValue(1))}),h=n.object({count:n.pipe(n.number(),n.minValue(1)),output_voltage:s,current:l}),g=n.object({type:n.picklist([`low_precision`,`high_precision`]),source:n.string(),resolution:n.pipe(n.number(),n.minValue(0))}),_=n.object({width:n.pipe(n.number(),n.minValue(1)),height:n.pipe(n.number(),n.minValue(1))}),v=n.object({type:n.string(),size:_}),y=n.object({count:n.pipe(n.number(),n.minValue(0)),type:n.string()}),b=n.object({count:n.pipe(n.number(),n.minValue(0)),type:n.string()}),x=n.object({display:v,input:y,speaker:b}),S=n.object({io:u,relays:d,usb_ports:n.array(f),ethernet:n.array(p),communication:n.array(m),power_supply:h,current_measurement:n.array(g),hmi:x}),C=n.object({model:n.string(),hostname:n.string(),serial_number:n.string(),firmware_version:n.string(),firmware_commit:n.string(),hardware_version:n.optional(n.number()),disk_used:n.number(),disk_total:n.number(),docker_used:n.number(),ram_used:n.optional(n.number()),ram_total:n.optional(n.number()),cpu_temperature:n.optional(n.number()),capabilities:S}),w=n.picklist([`idle`,`running`,`error`]),T=n.picklist([`created`,`started`,`stopping`,`stopped`,`removed`,`error`]),E=n.picklist([`tcp`,`udp`]),D=n.pipe(n.number(),n.integer(),n.minValue(1),n.maxValue(65535)),O=n.object({host:D,container:D,proto:E}),k=n.pipe(n.string(),n.trim(),n.regex(/^(ssh-|ecdsa-sha2-|sk-ssh-|sk-ecdsa-)/,`Not a recognized SSH public key`)),A=n.picklist([`normal`,`development`]),j=n.object({stream:n.picklist([`stdout`,`stderr`]),line:n.string()}),M=n.object({name:n.string(),path:n.string(),id:n.string(),image:n.string(),is_default:n.boolean(),ports:n.optional(n.array(O),[]),command:n.optional(n.string(),``),state:w,mode:n.optional(A),password_set:n.optional(n.boolean())}),N=n.variant(`change`,[n.object({change:n.literal(`state_changed`),id:n.string(),state:T}),n.object({change:n.literal(`renamed`),id:n.string(),name:n.string()}),n.object({change:n.literal(`default_changed`),id:n.string(),is_default:n.boolean()})]),P=n.partial(n.pick(M,[`name`,`is_default`,`command`])),F=n.picklist([`nodejs`,`python`]);n.object({name:n.string(),template:F,command:n.optional(n.string())});const I=n.object({bundle:n.string(),version:n.string(),compatible:n.string(),description:n.string()}),L=n.object({message:n.string(),bundle:n.string()}),R=n.object({state:n.picklist([`idle`,`installing`,`failed`]),progress:n.number(),message:n.string(),error:n.string(),boot:n.optional(n.picklist([`confirmed`,`pending`,`unknown`]))}),z=n.object({message:n.string()}),B=n.pipe(n.number(),n.finite()),V=n.pipe(n.number(),n.finite(),n.minValue(Number.MIN_VALUE)),H=n.pipe(n.number(),n.integer(),n.minValue(0),n.maxValue(31)),U=n.pipe(n.number(),n.integer(),n.minValue(0),n.maxValue(7)),W=n.pipe(n.number(),n.integer(),n.minValue(0),n.maxValue(1)),G=n.picklist([`pass`,`fail`]),K=n.object({set:B,measured:B,reading:n.optional(B)}),q=n.object({channel:H,points:n.array(K),max_error:B,avg_error:B}),J=n.object({voltage:n.object({points:n.array(K),max_error:B,avg_error:B}),current:n.object({load_ohms:V,points:n.array(K),max_error:B,avg_error:B})}),Y=n.object({load_ohms:V,voltage_applied:B,measured_current:B,expected_current:B,error_percent:B}),X=n.object({relay:U,status:G,test_voltage:B,closed_current:B,open_current:B,calibration:n.optional(q)}),Z=n.object({port:W,status:G,voltage:B,current_tests:n.optional(n.array(Y))}),Q=n.object({schema_version:n.literal(1),tool_version:n.string(),device_id:n.string(),timestamp:n.string(),firmware_version:n.string(),dac:n.array(q),adc_positive:n.array(q),adc_negative:n.optional(n.array(q)),dut_psu:J,relays:n.array(X),usb:n.array(Z)}),$=n.object({enabled:n.boolean(),loaded:n.boolean(),last_error:n.optional(n.nullable(n.string())),calibrated_at:n.optional(n.nullable(n.string()))}),ee=n.object({enabled:n.boolean()});var te=class{fetch;host;constructor(e,t){this.fetch=e,this.host=t}info(){return this.fetch(`/management/info`,{schema:C,timeout:1e3})}get_calibration(){return this.fetch(`/management/calibration`,{schema:Q})}set_calibration(e){return this.fetch(`/management/calibration`,{method:`PUT`,body:n.parse(Q,e),schema:Q})}get_calibration_state(){return this.fetch(`/management/calibration/state`,{schema:$})}set_calibration_enabled(e){return this.fetch(`/management/calibration/state`,{method:`PATCH`,body:n.parse(ee,{enabled:e}),schema:$})}enable_calibration(){return this.set_calibration_enabled(!0)}disable_calibration(){return this.set_calibration_enabled(!1)}async datetime(){let e=await this.fetch(`/management/datetime`,{schema:n.object({epoch_seconds:n.number()})});return new Date(e.epoch_seconds*1e3)}set_datetime(e){return this.fetch(`/management/datetime`,{method:`POST`,body:{epoch_seconds:Math.floor(e.getTime()/1e3)},parseResponse:()=>{}})}get_projects(){return this.fetch(`/management/projects`,{schema:n.array(M)})}list_images(){return this.fetch(`/management/images`,{schema:n.array(n.string())})}get_project(e){return this.fetch(`/management/projects/${e}`,{schema:M})}create_project(e){return this.fetch(`/management/projects`,{method:`POST`,body:e,timeout:3e4,schema:M})}import_project(e,t){return this.fetch(`/management/projects/import`,{method:`POST`,body:e,headers:{"Content-Type":`application/x-tar`,"X-Project-Name":encodeURIComponent(t)},serializeBody:e=>e,timeout:6e5,schema:M})}update_project(e,t){return this.fetch(`/management/projects/${e}`,{method:`PATCH`,body:n.parse(P,t),schema:M})}run_project(e,t=`normal`){return this.fetch(`/management/projects/${e}/run`,{method:`POST`,body:{mode:t},timeout:3e4})}stop_project(e){return this.fetch(`/management/projects/${e}/stop`,{method:`POST`,timeout:3e4})}get_project_ports(e){return this.fetch(`/management/projects/${e}/ports`,{schema:n.array(O)})}set_project_ports(e,t){return this.fetch(`/management/projects/${e}/ports`,{method:`PUT`,body:n.parse(n.array(O),t),timeout:3e4,schema:n.array(O)})}add_project_port(e,t){return this.fetch(`/management/projects/${e}/ports`,{method:`POST`,body:n.parse(O,t),timeout:3e4,schema:n.array(O)})}delete_project_port(e,t){return this.fetch(`/management/projects/${e}/ports/${t}`,{method:`DELETE`,parseResponse:()=>{},timeout:3e4})}set_project_password(e,t){return this.fetch(`/management/projects/${e}/password`,{method:`POST`,body:n.parse(n.object({password:n.pipe(n.string(),n.minLength(1))}),{password:t}),parseResponse:()=>{},timeout:3e4})}get_project_authorized_keys(e){return this.fetch(`/management/projects/${e}/authorized_keys`,{schema:n.array(n.string())})}set_project_authorized_keys(e,t){return this.fetch(`/management/projects/${e}/authorized_keys`,{method:`PUT`,body:n.parse(n.array(k),t),timeout:3e4,schema:n.array(n.string())})}delete_project(e){return this.fetch(`/management/projects/${e}`,{method:`DELETE`,timeout:3e4})}upload_bundle(e,t=`bundle.raucb`){return this.fetch(`/management/update/upload`,{method:`POST`,body:e,headers:{"Content-Type":`application/octet-stream`,"X-Bundle-Filename":t},serializeBody:e=>e,timeout:6e5,schema:I})}bundle_info(){return this.fetch(`/management/update/bundle-info`,{schema:I})}install_update(){return this.fetch(`/management/update/install`,{method:`POST`,schema:L})}update_status(){return this.fetch(`/management/update/status`,{schema:R})}reboot(){return this.fetch(`/management/reboot`,{method:`POST`,schema:z})}get_project_logs(e,t){let r=t?.tail??1e3;return this.fetch(`/management/projects/${e}/logs?tail=${r}`,{schema:n.array(j)})}stream_project_logs(e,t,i){let a=i?.tail??1e3,o=new AbortController,s=`http://${r(this.host)}/v0/management/projects/${e}/logs/stream?tail=${a}`;return(async()=>{try{let e=await fetch(s,{signal:o.signal});if(!e.ok||e.body===null)throw Error(`Log stream failed: HTTP ${e.status}`);let r=e.body.getReader(),i=new TextDecoder,a=``,c=e=>{let r=`message`,i=``;for(let t of e.split(`
2
2
  `))t.startsWith(`event:`)?r=t.slice(6).trim():t.startsWith(`data:`)&&(i+=t.slice(5).trim());if(r===`end`)return t.onEnd?.(),!0;if(r===`log`&&i.length>0){let e=n.safeParse(j,JSON.parse(i));e.success&&t.onLine(e.output)}return!1};for(;;){let{done:e,value:t}=await r.read();if(e)break;a+=i.decode(t,{stream:!0});let n=a.indexOf(`
3
3
 
4
4
  `);for(;n!==-1;){let e=a.slice(0,n);if(a=a.slice(n+2),c(e)){o.abort();return}n=a.indexOf(`
5
5
 
6
6
  `)}}}catch(e){if(o.signal.aborted)return;t.onError?.(e)}})(),{close:()=>o.abort()}}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}});
7
- //# sourceMappingURL=management-hyOL3JnM.cjs.map
7
+ //# sourceMappingURL=management-BvnwMqhr.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"management-BvnwMqhr.cjs","names":["v","analogLevel"],"sources":["../src/host.ts","../src/api/management.ts"],"sourcesContent":["const DEFAULT_PORT = 8080;\n\n/**\n * Formats a host into a URL authority. Returns `host` unchanged when it already\n * carries an explicit port; otherwise appends `fallbackPort` (the device's\n * mDNS-advertised port when known, else the default 8080). Bare IPv6 literals\n * are bracketed. Idempotent: re-formatting an authority is a no-op.\n */\nexport function format_host_for_url(host: string, fallbackPort?: number): string {\n const port = fallbackPort || DEFAULT_PORT;\n if (host.startsWith('[')) {\n return host.includes(']:') ? host : `${host}:${port}`;\n }\n const firstColon = host.indexOf(':');\n if (firstColon === -1) {\n return `${host}:${port}`;\n }\n if (firstColon === host.lastIndexOf(':')) {\n return host; // exactly one colon: host:port already specified\n }\n return `[${host}]:${port}`; // bare IPv6 literal, no port\n}\n\n/** Returns the bare host (IP or hostname) from a URL authority, dropping any port. */\nexport function host_without_port(host: string): string {\n if (host.startsWith('[')) {\n const end = host.indexOf(']');\n return end === -1 ? host : host.slice(1, end); // [ipv6] / [ipv6]:port -> ipv6\n }\n const firstColon = host.indexOf(':');\n if (firstColon !== -1 && firstColon === host.lastIndexOf(':')) {\n return host.slice(0, firstColon); // host:port -> host\n }\n return host; // bare hostname/IPv4 or bare IPv6 literal\n}\n","import { type UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nimport { format_host_for_url } from '../host';\nimport { analogLevel } from './common';\n\nexport enum CommunicationInterfaceType {\n Can = 'can',\n Rs232 = 'rs232',\n Rs485 = 'rs485',\n I2c = 'i2c',\n Spi = 'spi',\n Uart = 'uart',\n}\nconst communicationInterface = v.enum(CommunicationInterfaceType);\n\nconst voltageRange = v.object({\n min: v.pipe(v.number(), v.minValue(-24), v.maxValue(24)),\n max: v.pipe(v.number(), v.minValue(-24), v.maxValue(24)),\n});\n\nconst inputVoltageRange = v.object({ min: analogLevel, max: analogLevel });\n\nconst currentRange = v.object({ max: v.number() });\n\nconst ioCapabilities = v.object({\n count: v.pipe(v.number(), v.minValue(1)),\n input_voltage: inputVoltageRange,\n output_voltage: voltageRange,\n});\n\nconst relaysCapabilities = v.object({\n count: v.pipe(v.number(), v.minValue(0)),\n max_current: v.number(),\n max_voltage: v.number(),\n on_resistance: v.pipe(v.number(), v.minValue(0)),\n});\n\nconst usbCapability = v.object({\n type: v.picklist(['3.0', '2.0']),\n count: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst ethernetCapability = v.object({\n type: v.picklist(['1000BASE-T', '100BASE-T', '10BASE-T']),\n count: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst communicationCapability = v.object({\n type: communicationInterface,\n count: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst powerSupplyCapabilities = v.object({\n count: v.pipe(v.number(), v.minValue(1)),\n output_voltage: voltageRange,\n current: currentRange,\n});\n\nconst currentMeasurementCapabilities = v.object({\n type: v.picklist(['low_precision', 'high_precision']),\n source: v.string(),\n resolution: v.pipe(v.number(), v.minValue(0)),\n});\n\nconst screenSize = v.object({\n width: v.pipe(v.number(), v.minValue(1)),\n height: v.pipe(v.number(), v.minValue(1)),\n});\n\nconst displayCapabilities = v.object({ type: v.string(), size: screenSize });\n\nconst inputCapabilities = v.object({ count: v.pipe(v.number(), v.minValue(0)), type: v.string() });\n\nconst audioCapabilities = v.object({ count: v.pipe(v.number(), v.minValue(0)), type: v.string() });\n\nconst hmiCapabilities = v.object({\n display: displayCapabilities,\n input: inputCapabilities,\n speaker: audioCapabilities,\n});\n\nconst capabilities = v.object({\n io: ioCapabilities,\n relays: relaysCapabilities,\n usb_ports: v.array(usbCapability),\n ethernet: v.array(ethernetCapability),\n communication: v.array(communicationCapability),\n power_supply: powerSupplyCapabilities,\n current_measurement: v.array(currentMeasurementCapabilities),\n hmi: hmiCapabilities,\n});\n\nconst info = v.object({\n model: v.string(),\n hostname: v.string(),\n serial_number: v.string(),\n firmware_version: v.string(),\n firmware_commit: v.string(),\n hardware_version: v.optional(v.number()),\n disk_used: v.number(),\n disk_total: v.number(),\n docker_used: v.number(),\n // Added to the server after firmware 0.3.3 — optional so older devices stay discoverable.\n ram_used: v.optional(v.number()),\n ram_total: v.optional(v.number()),\n cpu_temperature: v.optional(v.number()),\n capabilities: capabilities,\n});\nexport type Information = v.InferOutput<typeof info>;\n\nconst projectStatus = v.picklist(['idle', 'running', 'error']);\nconst projectEventState = v.picklist(['created', 'started', 'stopping', 'stopped', 'removed',\n 'error']);\nconst portProtocol = v.picklist(['tcp', 'udp']);\nconst port = v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(65535));\nexport const portMapping = v.object({ host: port, container: port, proto: portProtocol });\nexport type PortMapping = v.InferOutput<typeof portMapping>;\nconst authorizedKey = v.pipe(\n v.string(),\n v.trim(),\n v.regex(/^(ssh-|ecdsa-sha2-|sk-ssh-|sk-ecdsa-)/, 'Not a recognized SSH public key'),\n);\nexport const runMode = v.picklist(['normal', 'development']);\nexport type RunMode = v.InferOutput<typeof runMode>;\n\nconst logLine = v.object({ stream: v.picklist(['stdout', 'stderr']), line: v.string() });\nexport type LogLine = v.InferOutput<typeof logLine>;\n\nexport const project = v.object({\n name: v.string(),\n path: v.string(),\n id: v.string(),\n image: v.string(),\n is_default: v.boolean(),\n ports: v.optional(v.array(portMapping), []),\n command: v.optional(v.string(), ''),\n state: projectStatus,\n mode: v.optional(runMode),\n password_set: v.optional(v.boolean()),\n});\nexport type Project = v.InferOutput<typeof project>;\n\n// Merged management.project realtime event, discriminated on `change`.\nexport const projectEvent = v.variant('change', [\n v.object({ change: v.literal('state_changed'), id: v.string(), state: projectEventState }),\n v.object({ change: v.literal('renamed'), id: v.string(), name: v.string() }),\n v.object({ change: v.literal('default_changed'), id: v.string(), is_default: v.boolean() }),\n]);\nexport type ProjectEvent = v.InferOutput<typeof projectEvent>;\n\nconst projectPatch = v.partial(v.pick(project, ['name', 'is_default', 'command']));\nexport type ProjectPatch = v.InferOutput<typeof projectPatch>;\n\nconst projectTemplate = v.picklist(['nodejs', 'python']);\nexport type ProjectTemplate = v.InferOutput<typeof projectTemplate>;\n\nconst createProject = v.object({\n name: v.string(),\n template: projectTemplate,\n command: v.optional(v.string()),\n});\nexport type CreateProject = v.InferOutput<typeof createProject>;\n\nconst bundleInfo = v.object({\n bundle: v.string(),\n version: v.string(),\n compatible: v.string(),\n description: v.string(),\n});\nexport type BundleInfo = v.InferOutput<typeof bundleInfo>;\n\nconst installResponse = v.object({ message: v.string(), bundle: v.string() });\nexport type InstallResponse = v.InferOutput<typeof installResponse>;\n\nexport const updateStatus = v.object({\n state: v.picklist(['idle', 'installing', 'failed']),\n progress: v.number(),\n message: v.string(),\n error: v.string(),\n boot: v.optional(v.picklist(['confirmed', 'pending', 'unknown'])),\n});\nexport type UpdateStatus = v.InferOutput<typeof updateStatus>;\n\nconst rebootResponse = v.object({ message: v.string() });\nexport type RebootResponse = v.InferOutput<typeof rebootResponse>;\n\nconst finiteNumber = v.pipe(v.number(), v.finite());\nconst positiveFiniteNumber = v.pipe(v.number(), v.finite(), v.minValue(Number.MIN_VALUE));\nconst channelId = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(31));\nconst relayId = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(7));\nconst usbPortId = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(1));\nconst calibrationStatus = v.picklist(['pass', 'fail']);\n\nconst calibrationPoint = v.object({\n set: finiteNumber,\n measured: finiteNumber,\n reading: v.optional(finiteNumber),\n});\nexport type CalibrationPoint = v.InferOutput<typeof calibrationPoint>;\n\nconst channelCalibration = v.object({\n channel: channelId,\n points: v.array(calibrationPoint),\n max_error: finiteNumber,\n avg_error: finiteNumber,\n});\nexport type ChannelCalibration = v.InferOutput<typeof channelCalibration>;\n\nconst dutPsuCalibration = v.object({\n voltage: v.object({\n points: v.array(calibrationPoint),\n max_error: finiteNumber,\n avg_error: finiteNumber,\n }),\n current: v.object({\n load_ohms: positiveFiniteNumber,\n points: v.array(calibrationPoint),\n max_error: finiteNumber,\n avg_error: finiteNumber,\n }),\n});\nexport type DutPsuCalibration = v.InferOutput<typeof dutPsuCalibration>;\n\nconst currentTestResult = v.object({\n load_ohms: positiveFiniteNumber,\n voltage_applied: finiteNumber,\n measured_current: finiteNumber,\n expected_current: finiteNumber,\n error_percent: finiteNumber,\n});\n/** @deprecated See {@link currentTestResult}. */\nexport type CurrentTestResult = v.InferOutput<typeof currentTestResult>;\n\nconst relayTestResult = v.object({\n relay: relayId,\n status: calibrationStatus,\n test_voltage: finiteNumber,\n closed_current: finiteNumber,\n open_current: finiteNumber,\n calibration: v.optional(channelCalibration),\n});\nexport type RelayTestResult = v.InferOutput<typeof relayTestResult>;\n\nconst usbTestResult = v.object({\n port: usbPortId,\n status: calibrationStatus,\n voltage: finiteNumber,\n /** @deprecated Legacy field; only present on calibrations from older devices. */\n current_tests: v.optional(v.array(currentTestResult)),\n});\nexport type UsbTestResult = v.InferOutput<typeof usbTestResult>;\n\nexport const calibrationData = v.object({\n schema_version: v.literal(1),\n tool_version: v.string(),\n device_id: v.string(),\n timestamp: v.string(),\n firmware_version: v.string(),\n dac: v.array(channelCalibration),\n adc_positive: v.array(channelCalibration),\n adc_negative: v.optional(v.array(channelCalibration)),\n dut_psu: dutPsuCalibration,\n relays: v.array(relayTestResult),\n usb: v.array(usbTestResult),\n});\nexport type CalibrationData = v.InferOutput<typeof calibrationData>;\n\nexport const calibrationState = v.object({\n enabled: v.boolean(),\n loaded: v.boolean(),\n last_error: v.optional(v.nullable(v.string())),\n calibrated_at: v.optional(v.nullable(v.string())),\n});\nexport type CalibrationState = v.InferOutput<typeof calibrationState>;\n\nconst calibrationStatePatch = v.object({ enabled: v.boolean() });\n\n/** @hideconstructor */\nexport class ManagementApi {\n constructor(private readonly fetch: UpFetch, private readonly host: string) {}\n\n /**\n * Gets device information and capabilities.\n *\n * Keeps the 1 s timeout every caller relies on for reachability: `open()` probes with\n * it, and clients poll it as a liveness check. Slower reads use the client default.\n *\n * @returns The device information.\n */\n info() {\n return this.fetch('/management/info', { schema: info, timeout: 1000 });\n }\n\n /**\n * Gets the loaded calibration data.\n * @returns The canonical calibration data stored on the device.\n */\n get_calibration(): Promise<CalibrationData> {\n return this.fetch('/management/calibration', { schema: calibrationData });\n }\n\n /**\n * Uploads and activates calibration data.\n * @param data The full calibration report to store on the device.\n */\n set_calibration(data: CalibrationData): Promise<CalibrationData> {\n return this.fetch('/management/calibration', {\n method: 'PUT',\n body: v.parse(calibrationData, data),\n schema: calibrationData,\n });\n }\n\n /**\n * Gets runtime calibration enable/load state.\n */\n get_calibration_state(): Promise<CalibrationState> {\n return this.fetch('/management/calibration/state', { schema: calibrationState });\n }\n\n /**\n * Enables or disables runtime calibration correction.\n * @param enabled Whether calibration correction should be applied.\n */\n set_calibration_enabled(enabled: boolean): Promise<CalibrationState> {\n return this.fetch('/management/calibration/state', {\n method: 'PATCH',\n body: v.parse(calibrationStatePatch, { enabled }),\n schema: calibrationState,\n });\n }\n\n /** Enables runtime calibration correction. */\n enable_calibration(): Promise<CalibrationState> {\n return this.set_calibration_enabled(true);\n }\n\n /** Disables runtime calibration correction. */\n disable_calibration(): Promise<CalibrationState> {\n return this.set_calibration_enabled(false);\n }\n\n /**\n * Gets the current date and time of the device.\n * @returns The current date and time.\n */\n async datetime(): Promise<Date> {\n const time = await this.fetch('/management/datetime', {\n schema: v.object({ epoch_seconds: v.number() }),\n });\n return new Date(time.epoch_seconds * 1000);\n }\n\n /**\n * Sets the date and time of the device.\n *\n * This will only work if the device is not connected to the internet.\n *\n * @param datetime The date and time to set.\n */\n set_datetime(datetime: Date): Promise<void> {\n return this.fetch('/management/datetime', {\n method: 'POST',\n body: { epoch_seconds: Math.floor(datetime.getTime() / 1000) },\n parseResponse: () => {},\n });\n }\n\n /**\n * Gets a list of all projects.\n * @returns An array of projects.\n */\n get_projects() {\n return this.fetch('/management/projects', { schema: v.array(project) });\n }\n\n /**\n * Lists the AT1000 base images present on the device.\n * @returns Repo tags of on-device base images (e.g. \"localhost/at1000-base:latest\").\n */\n list_images() {\n return this.fetch('/management/images', { schema: v.array(v.string()) });\n }\n\n /**\n * Gets a single project by id.\n * @param projectId The project slug id.\n * @returns The project info.\n */\n get_project(projectId: string) {\n return this.fetch(`/management/projects/${projectId}`, { schema: project });\n }\n\n /**\n * Creates a new project from a preinstalled template.\n * @param newProject The project creation data.\n */\n create_project(newProject: CreateProject) {\n return this.fetch('/management/projects', {\n method: 'POST',\n body: newProject,\n timeout: 30_000,\n schema: project,\n });\n }\n\n /**\n * Imports a project from a container image archive (.tar / .tar.gz). The archive streams\n * straight to the device, so pass a lazily file-backed Blob (`await fs.openAsBlob(path)` on\n * Node, a `File` from an input element in the browser): `new Blob([await readFile(path)])`\n * buffers the whole archive in the caller's heap.\n * @param file The image archive to import.\n * @param name The project name (sent percent-encoded; the server decodes it).\n * @returns The created project.\n */\n import_project(file: Blob, name: string) {\n return this.fetch('/management/projects/import', {\n method: 'POST',\n body: file,\n headers: { 'Content-Type': 'application/x-tar', 'X-Project-Name': encodeURIComponent(name) },\n serializeBody: (b) => b as any,\n timeout: 600_000,\n schema: project,\n });\n }\n\n /**\n * Patches an existing project (`name`, `is_default`, `command`). An empty `command` clears it (entrypoint autodetect).\n * @param projectId The project slug id.\n * @param data The data to patch the project with.\n */\n update_project(projectId: string, data: ProjectPatch) {\n return this.fetch(`/management/projects/${projectId}`, {\n method: 'PATCH',\n body: v.parse(projectPatch, data),\n schema: project,\n });\n }\n\n /**\n * Runs a project.\n * @param projectId The project slug id.\n * @param mode The run mode: 'normal' (default) or 'development' (starts sshd).\n */\n run_project(projectId: string, mode: RunMode = 'normal') {\n return this.fetch(`/management/projects/${projectId}/run`, {\n method: 'POST',\n body: { mode },\n timeout: 30_000,\n });\n }\n\n /**\n * Stops a running project.\n * @param projectId The project slug id.\n */\n stop_project(projectId: string) {\n return this.fetch(`/management/projects/${projectId}/stop`, {\n method: 'POST',\n timeout: 30_000,\n });\n }\n\n /**\n * Gets the port mappings for a project.\n * @param projectId The project slug id.\n * @returns The project's port mappings.\n */\n get_project_ports(projectId: string) {\n return this.fetch(`/management/projects/${projectId}/ports`, { schema: v.array(portMapping) });\n }\n\n /**\n * Replaces the full set of port mappings for a project.\n * @param projectId The project slug id.\n * @param ports The complete list of port mappings.\n * @returns The updated port mappings.\n */\n set_project_ports(projectId: string, ports: PortMapping[]) {\n return this.fetch(`/management/projects/${projectId}/ports`, {\n method: 'PUT',\n body: v.parse(v.array(portMapping), ports),\n timeout: 30_000,\n schema: v.array(portMapping),\n });\n }\n\n /**\n * Adds a single port mapping to a project.\n * @param projectId The project slug id.\n * @param mapping The port mapping to add.\n * @returns The updated port mappings.\n */\n add_project_port(projectId: string, mapping: PortMapping) {\n return this.fetch(`/management/projects/${projectId}/ports`, {\n method: 'POST',\n body: v.parse(portMapping, mapping),\n timeout: 30_000,\n schema: v.array(portMapping),\n });\n }\n\n /**\n * Removes the port mapping for a host port from a project.\n * @param projectId The project slug id.\n * @param hostPort The host port to unmap.\n */\n delete_project_port(projectId: string, hostPort: number) {\n return this.fetch(`/management/projects/${projectId}/ports/${hostPort}`, {\n method: 'DELETE',\n parseResponse: () => {},\n timeout: 30_000,\n });\n }\n\n /**\n * Sets the password of the project's dev user (used for SSH password login in\n * development mode).\n * @param projectId The project slug id.\n * @param password The new password.\n */\n set_project_password(projectId: string, password: string) {\n return this.fetch(`/management/projects/${projectId}/password`, {\n method: 'POST',\n body: v.parse(v.object({ password: v.pipe(v.string(), v.minLength(1)) }), { password }),\n parseResponse: () => {},\n timeout: 30_000,\n });\n }\n\n /**\n * Gets the SSH authorized_keys for the project's dev user.\n * @param projectId The project slug id.\n * @returns The list of authorized public keys.\n */\n get_project_authorized_keys(projectId: string) {\n return this.fetch(`/management/projects/${projectId}/authorized_keys`, {\n schema: v.array(v.string()),\n });\n }\n\n /**\n * Replaces the SSH authorized_keys for the project's dev user.\n * @param projectId The project slug id.\n * @param keys The complete list of authorized public keys.\n * @returns The updated list of authorized public keys.\n */\n set_project_authorized_keys(projectId: string, keys: string[]) {\n return this.fetch(`/management/projects/${projectId}/authorized_keys`, {\n method: 'PUT',\n body: v.parse(v.array(authorizedKey), keys),\n timeout: 30_000,\n schema: v.array(v.string()),\n });\n }\n\n /**\n * Deletes a project.\n * @param projectId The project slug id.\n */\n delete_project(projectId: string) {\n return this.fetch(`/management/projects/${projectId}`, { method: 'DELETE', timeout: 30_000 });\n }\n\n /**\n * Uploads a firmware bundle to the device and inspects it.\n * The bundle is staged for installation but not installed yet. The body streams straight to\n * the device, so pass a lazily file-backed Blob (`await fs.openAsBlob(path)` on Node, a `File`\n * from an input element in the browser): `new Blob([await readFile(path)])` buffers the whole\n * bundle in the caller's heap.\n * @param file The firmware bundle file (.raucb).\n * @param filename Optional filename for the bundle. Defaults to 'bundle.raucb'.\n * @returns Bundle metadata including version information.\n */\n upload_bundle(file: Blob, filename = 'bundle.raucb') {\n return this.fetch('/management/update/upload', {\n method: 'POST',\n body: file,\n headers: { 'Content-Type': 'application/octet-stream', 'X-Bundle-Filename': filename },\n serializeBody: (b) => b as any,\n timeout: 600_000,\n schema: bundleInfo,\n });\n }\n\n /**\n * Gets metadata for the currently staged firmware bundle.\n * @returns Bundle metadata including version information.\n */\n bundle_info() {\n return this.fetch('/management/update/bundle-info', { schema: bundleInfo });\n }\n\n /**\n * Installs a previously uploaded firmware bundle.\n * @returns The install response with message and bundle name.\n */\n install_update() {\n return this.fetch('/management/update/install', { method: 'POST', schema: installResponse });\n }\n\n /**\n * Gets the current firmware update status.\n * @returns The update status including state, progress, message and error.\n */\n update_status() {\n return this.fetch('/management/update/status', { schema: updateStatus });\n }\n\n /**\n * Reboots the device.\n * @returns The reboot response message.\n */\n reboot() {\n return this.fetch('/management/reboot', { method: 'POST', schema: rebootResponse });\n }\n\n /**\n * Gets the current run's container logs for a project (one-shot).\n *\n * Lines are scoped server-side to the container's most recent start: a running\n * project returns the live run so far, an idle/stopped project the last run.\n * stdout and stderr are merged into one chronological array; each entry's\n * `stream` field says which it came from.\n *\n * @param projectId The project slug id.\n * @param options.tail Max number of trailing lines (default 1000, clamped 1..10000).\n * @returns The current run's log lines, in order.\n */\n get_project_logs(projectId: string, options?: { tail?: number }) {\n const tail = options?.tail ?? 1000;\n return this.fetch(`/management/projects/${projectId}/logs?tail=${tail}`, {\n schema: v.array(logLine),\n });\n }\n\n /**\n * Streams the current run's container logs for a project over SSE.\n *\n * Replays the current run's recent lines (bounded by `tail`) then follows live\n * with zero gap. `onLine` fires once per line (stdout and stderr merged in\n * order); `onEnd` fires when the follow ends (the container stopped, or an\n * idle project's last-run replay completed). No auto-reconnect.\n *\n * @param projectId The project slug id.\n * @param handlers Line/end/error callbacks.\n * @param options.tail Max number of trailing lines (default 1000, clamped 1..10000).\n * @returns A handle whose `close()` aborts the stream.\n */\n stream_project_logs(\n projectId: string,\n handlers: {\n onLine: (line: LogLine) => void;\n onEnd?: () => void;\n onError?: (err: unknown) => void;\n },\n options?: { tail?: number },\n ): { close: () => void } {\n const tail = options?.tail ?? 1000;\n const controller = new AbortController();\n const url = `http://${format_host_for_url(this.host)}`\n + `/v0/management/projects/${projectId}/logs/stream?tail=${tail}`;\n\n void (async () => {\n try {\n const response = await fetch(url, { signal: controller.signal });\n if (!response.ok || response.body === null) {\n throw new Error(`Log stream failed: HTTP ${response.status}`);\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n\n const dispatch = (record: string): boolean => {\n let event = 'message';\n let data = '';\n for (const rawLine of record.split('\\n')) {\n if (rawLine.startsWith('event:')) {\n event = rawLine.slice('event:'.length).trim();\n } else if (rawLine.startsWith('data:')) {\n data += rawLine.slice('data:'.length).trim();\n }\n }\n if (event === 'end') {\n handlers.onEnd?.();\n return true; // terminal\n }\n if (event === 'log' && data.length > 0) {\n const parsed = v.safeParse(logLine, JSON.parse(data));\n if (parsed.success) {\n handlers.onLine(parsed.output);\n }\n }\n return false;\n };\n\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n buffer += decoder.decode(value, { stream: true });\n let separator = buffer.indexOf('\\n\\n');\n while (separator !== -1) {\n const record = buffer.slice(0, separator);\n buffer = buffer.slice(separator + 2);\n if (dispatch(record)) {\n controller.abort();\n return;\n }\n separator = buffer.indexOf('\\n\\n');\n }\n }\n } catch (err) {\n if (controller.signal.aborted) {\n return; // caller closed, or terminal end handled above\n }\n handlers.onError?.(err);\n }\n })();\n\n return { close: () => controller.abort() };\n }\n}\n"],"mappings":"8IAQA,SAAgB,EAAoB,EAAc,EAA+B,CAC/E,IAAM,EAAO,GAAgB,KAC7B,GAAI,EAAK,WAAW,GAAG,EACrB,OAAO,EAAK,SAAS,IAAI,EAAI,EAAO,GAAG,EAAK,GAAG,IAEjD,IAAM,EAAa,EAAK,QAAQ,GAAG,EAOnC,OANI,IAAe,GACV,GAAG,EAAK,GAAG,IAEhB,IAAe,EAAK,YAAY,GAAG,EAC9B,EAEF,IAAI,EAAK,IAAI,GACtB,CAGA,SAAgB,EAAkB,EAAsB,CACtD,GAAI,EAAK,WAAW,GAAG,EAAG,CACxB,IAAM,EAAM,EAAK,QAAQ,GAAG,EAC5B,OAAO,IAAQ,GAAK,EAAO,EAAK,MAAM,EAAG,CAAG,CAC9C,CACA,IAAM,EAAa,EAAK,QAAQ,GAAG,EAInC,OAH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AAE,OAAQ,EAAK,CAAC,EAChD,IAAI,EAAY,EAAO,QAAQ;;CAAM,EACrC,KAAO,IAAc,IAAI,CACvB,IAAM,EAAS,EAAO,MAAM,EAAG,CAAS,EAExC,GADA,EAAS,EAAO,MAAM,EAAY,CAAC,EAC/B,EAAS,CAAM,EAAG,CACpB,EAAW,MAAM,EACjB,MACF,CACA,EAAY,EAAO,QAAQ;;CAAM,CACnC,CACF,CACF,OAAS,EAAK,CACZ,GAAI,EAAW,OAAO,QACpB,OAEF,EAAS,UAAU,CAAG,CACxB,CACF,EAAA,CAAG,EAEI,CAAE,UAAa,EAAW,MAAM,CAAE,CAC3C,CACF"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./management-hyOL3JnM.cjs");exports.CommunicationInterfaceType=e.t,exports.ManagementApi=e.n,exports.calibrationData=e.r,exports.calibrationState=e.i,exports.portMapping=e.a,exports.project=e.o,exports.projectEvent=e.s,exports.runMode=e.c,exports.updateStatus=e.l;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./management-BvnwMqhr.cjs");exports.CommunicationInterfaceType=e.t,exports.ManagementApi=e.n,exports.calibrationData=e.r,exports.calibrationState=e.i,exports.portMapping=e.a,exports.project=e.o,exports.projectEvent=e.s,exports.runMode=e.c,exports.updateStatus=e.l;
@@ -440,6 +440,10 @@ export declare class ManagementApi {
440
440
  constructor(fetch: UpFetch, host: string);
441
441
  /**
442
442
  * Gets device information and capabilities.
443
+ *
444
+ * Keeps the 1 s timeout every caller relies on for reachability: `open()` probes with
445
+ * it, and clients poll it as a liveness check. Slower reads use the client default.
446
+ *
443
447
  * @returns The device information.
444
448
  */
445
449
  info(): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"management.d.cts","names":[],"sources":["../src/api/management.ts"],"mappings":";;;oBAMY;EACV;EACA;EACA;EACA;EACA;EACA;;cAiFI,MAAI,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;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;EAkBxC,eAAe,MAAM,MAAM,eAAY;;;;;;;;;;;;;;;;;;;;;EAgBvC,eAAe,mBAAmB,MAAM,eAAY;;;;;;;;;;;;;;;;;;;;;EAapD,YAAY,mBAAmB,OAAM,UAAkB;;;;;EAYvD,aAAa,oBAAiB;;;;;;EAY9B,kBAAkB,oBAAiB;;;;;;;;;;;EAUnC,kBAAkB,mBAAmB,OAAO,gBAAa;;;;;;;;;;;EAezD,iBAAiB,mBAAmB,SAAS,cAAW;;;;;;;;;;EAcxD,oBAAoB,mBAAmB,mBAAgB;;;;;;;EAcvD,qBAAqB,mBAAmB,mBAAgB;;;;;;EAcxD,4BAA4B,oBAAiB;;;;;;;EAY7C,4BAA4B,mBAAmB,iBAAc;;;;;EAa7D,eAAe,oBAAiB;;;;;;;;;;;EAchC,cAAc,MAAM,MAAM,oBAAyB;;;;;;;;;;EAenD,eAAW;;;;;;;;;;EAQX,kBAAc;;;;;;;;EAQd,iBAAa;;;;;;;;;;;EAQb,UAAM;;;;;;;;;;;;;;;EAgBN,iBAAiB,mBAAmB;IAAY;MAAe;;;;;;;;;;;;;;;;;EAoB/D,oBACE,mBACA;IACE,SAAS,MAAM;IACf;IACA,WAAW;KAEb;IAAY;;IACT"}
@@ -440,6 +440,10 @@ export declare class ManagementApi {
440
440
  constructor(fetch: UpFetch, host: string);
441
441
  /**
442
442
  * Gets device information and capabilities.
443
+ *
444
+ * Keeps the 1 s timeout every caller relies on for reachability: `open()` probes with
445
+ * it, and clients poll it as a liveness check. Slower reads use the client default.
446
+ *
443
447
  * @returns The device information.
444
448
  */
445
449
  info(): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"management.d.mts","names":[],"sources":["../src/api/management.ts"],"mappings":";;;oBAMY;EACV;EACA;EACA;EACA;EACA;EACA;;cAiFI,MAAI,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAgBE,cAAc,EAA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B,MAAM,eAAY;;;;;;;;;;;;;;;;;;;;;EAapD,YAAY,mBAAmB,OAAM,UAAkB;;;;;EAYvD,aAAa,oBAAiB;;;;;;EAY9B,kBAAkB,oBAAiB;;;;;;;;;;;EAUnC,kBAAkB,mBAAmB,OAAO,gBAAa;;;;;;;;;;;EAezD,iBAAiB,mBAAmB,SAAS,cAAW;;;;;;;;;;EAcxD,oBAAoB,mBAAmB,mBAAgB;;;;;;;EAcvD,qBAAqB,mBAAmB,mBAAgB;;;;;;EAcxD,4BAA4B,oBAAiB;;;;;;;EAY7C,4BAA4B,mBAAmB,iBAAc;;;;;EAa7D,eAAe,oBAAiB;;;;;;;;;;;EAchC,cAAc,MAAM,MAAM,oBAAyB;;;;;;;;;;EAenD,eAAW;;;;;;;;;;EAQX,kBAAc;;;;;;;;EAQd,iBAAa;;;;;;;;;;;EAQb,UAAM;;;;;;;;;;;;;;;EAgBN,iBAAiB,mBAAmB;IAAY;MAAe;;;;;;;;;;;;;;;;;EAoB/D,oBACE,mBACA;IACE,SAAS,MAAM;IACf;IACA,WAAW;KAEb;IAAY;;IACT"}
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./management-CEL202P0.mjs";export{c as CommunicationInterfaceType,i as ManagementApi,o as calibrationData,n as calibrationState,e as portMapping,a as project,s as projectEvent,t as runMode,r as updateStatus};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./management-B-3r1o-0.mjs";export{c as CommunicationInterfaceType,i as ManagementApi,o as calibrationData,n as calibrationState,e as portMapping,a as project,s as projectEvent,t as runMode,r as updateStatus};