@ikalogic/at1000 0.5.2 → 0.7.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 (109) hide show
  1. package/build/at1000-Bav5xUM1.mjs +3 -0
  2. package/build/at1000-Bav5xUM1.mjs.map +1 -0
  3. package/build/at1000-DjoKZEha.cjs +3 -0
  4. package/build/at1000-DjoKZEha.cjs.map +1 -0
  5. package/build/browser.cjs +1 -1
  6. package/build/browser.cjs.map +1 -1
  7. package/build/browser.d.cts +3 -3
  8. package/build/browser.d.cts.map +1 -1
  9. package/build/browser.d.mts +3 -3
  10. package/build/browser.d.mts.map +1 -1
  11. package/build/browser.mjs +1 -1
  12. package/build/browser.mjs.map +1 -1
  13. package/build/{com-DN1l6xqC.d.cts → com-Bkkgrsep.d.cts} +177 -177
  14. package/build/{com-DN1l6xqC.d.cts.map → com-Bkkgrsep.d.cts.map} +1 -1
  15. package/build/{com-DN1l6xqC.d.mts → com-Bkkgrsep.d.mts} +177 -177
  16. package/build/{com-DN1l6xqC.d.mts.map → com-Bkkgrsep.d.mts.map} +1 -1
  17. package/build/com.cjs +1 -1
  18. package/build/com.d.cts +1 -1
  19. package/build/com.d.mts +1 -1
  20. package/build/{common-BSrNhbq_.cjs → common-BUohXSqz.cjs} +2 -2
  21. package/build/{common-BSrNhbq_.cjs.map → common-BUohXSqz.cjs.map} +1 -1
  22. package/build/{events-Cf7iAMZP.d.cts → events-8aTmwMUi.d.cts} +6 -6
  23. package/build/events-8aTmwMUi.d.cts.map +1 -0
  24. package/build/{events-Cf7iAMZP.d.mts → events-8aTmwMUi.d.mts} +6 -6
  25. package/build/events-8aTmwMUi.d.mts.map +1 -0
  26. package/build/events.cjs +1 -1
  27. package/build/events.d.cts +1 -1
  28. package/build/events.d.mts +1 -1
  29. package/build/events.mjs +1 -1
  30. package/build/gpio-5-tRkdTW.d.mts +712 -0
  31. package/build/gpio-5-tRkdTW.d.mts.map +1 -0
  32. package/build/gpio-D3QEeLKh.d.cts +712 -0
  33. package/build/gpio-D3QEeLKh.d.cts.map +1 -0
  34. package/build/gpio.cjs +1 -1
  35. package/build/gpio.cjs.map +1 -1
  36. package/build/gpio.d.cts +2 -2
  37. package/build/gpio.d.mts +2 -2
  38. package/build/gpio.mjs +1 -1
  39. package/build/gpio.mjs.map +1 -1
  40. package/build/{hmi-B-potLdl.d.cts → hmi-BEMiVKDF.d.cts} +2 -2
  41. package/build/hmi-BEMiVKDF.d.cts.map +1 -0
  42. package/build/{hmi-B-potLdl.d.mts → hmi-BEMiVKDF.d.mts} +2 -2
  43. package/build/hmi-BEMiVKDF.d.mts.map +1 -0
  44. package/build/hmi.cjs +1 -1
  45. package/build/hmi.d.cts +1 -1
  46. package/build/hmi.d.mts +1 -1
  47. package/build/{at1000-gm586Tc9.d.mts → host-BBjSKRqs.d.mts} +18 -16
  48. package/build/host-BBjSKRqs.d.mts.map +1 -0
  49. package/build/{at1000-tUTVczQa.d.cts → host-DlP73amZ.d.cts} +18 -16
  50. package/build/host-DlP73amZ.d.cts.map +1 -0
  51. package/build/management-DqBsC1HB.cjs +7 -0
  52. package/build/management-DqBsC1HB.cjs.map +1 -0
  53. package/build/management-StKcAkgo.mjs +7 -0
  54. package/build/management-StKcAkgo.mjs.map +1 -0
  55. package/build/management.cjs +1 -1
  56. package/build/management.d.cts +75 -70
  57. package/build/management.d.cts.map +1 -1
  58. package/build/management.d.mts +75 -70
  59. package/build/management.d.mts.map +1 -1
  60. package/build/management.mjs +1 -1
  61. package/build/node.cjs +1 -1
  62. package/build/node.cjs.map +1 -1
  63. package/build/node.d.cts +3 -3
  64. package/build/node.d.cts.map +1 -1
  65. package/build/node.d.mts +3 -3
  66. package/build/node.d.mts.map +1 -1
  67. package/build/node.mjs +1 -1
  68. package/build/node.mjs.map +1 -1
  69. package/build/package-DNfLRnEC.mjs +2 -0
  70. package/build/package-DNfLRnEC.mjs.map +1 -0
  71. package/build/{package-0hAwYBa1.cjs → package-iERj9NJ6.cjs} +2 -2
  72. package/build/package-iERj9NJ6.cjs.map +1 -0
  73. package/build/{power-B8QFbKdP.d.cts → power-B3oUS0wU.d.cts} +18 -18
  74. package/build/power-B3oUS0wU.d.cts.map +1 -0
  75. package/build/{power-BZmXOJyK.d.mts → power-D08VFff6.d.mts} +18 -18
  76. package/build/power-D08VFff6.d.mts.map +1 -0
  77. package/build/power.cjs +1 -1
  78. package/build/power.cjs.map +1 -1
  79. package/build/power.d.cts +1 -1
  80. package/build/power.d.mts +1 -1
  81. package/build/power.mjs.map +1 -1
  82. package/build/relays-TADiLsPk.d.cts.map +1 -1
  83. package/build/relays-TADiLsPk.d.mts.map +1 -1
  84. package/build/relays.cjs +1 -1
  85. package/build/{rolldown-runtime-CMqjfN_6.cjs → rolldown-runtime-BocRIvOZ.cjs} +1 -1
  86. package/build/session-qWW9mqWH.d.cts.map +1 -1
  87. package/build/session-qWW9mqWH.d.mts.map +1 -1
  88. package/build/session.cjs +1 -1
  89. package/build/session.mjs +1 -1
  90. package/package.json +12 -22
  91. package/build/at1000-DbIvMQUc.cjs +0 -8
  92. package/build/at1000-DbIvMQUc.cjs.map +0 -1
  93. package/build/at1000-Zs18VzlP.mjs +0 -8
  94. package/build/at1000-Zs18VzlP.mjs.map +0 -1
  95. package/build/at1000-gm586Tc9.d.mts.map +0 -1
  96. package/build/at1000-tUTVczQa.d.cts.map +0 -1
  97. package/build/events-Cf7iAMZP.d.cts.map +0 -1
  98. package/build/events-Cf7iAMZP.d.mts.map +0 -1
  99. package/build/gpio-CsxbjhA_.d.cts +0 -406
  100. package/build/gpio-CsxbjhA_.d.cts.map +0 -1
  101. package/build/gpio-Dk-s_yMc.d.mts +0 -406
  102. package/build/gpio-Dk-s_yMc.d.mts.map +0 -1
  103. package/build/hmi-B-potLdl.d.cts.map +0 -1
  104. package/build/hmi-B-potLdl.d.mts.map +0 -1
  105. package/build/package-0hAwYBa1.cjs.map +0 -1
  106. package/build/package-CU5MagIg.mjs +0 -2
  107. package/build/package-CU5MagIg.mjs.map +0 -1
  108. package/build/power-B8QFbKdP.d.cts.map +0 -1
  109. package/build/power-BZmXOJyK.d.mts.map +0 -1
@@ -0,0 +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`,`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(`
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
+
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
+
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-DqBsC1HB.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"management-DqBsC1HB.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', 'stopped', 'removed', '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 * @returns The device information.\n */\n info() {\n return this.fetch('/management/info', { schema: info });\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,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,EAAyBA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AAS,EAAK,CACZ,GAAI,EAAW,OAAO,QACpB,OAEF,EAAS,UAAU,CAAG,CACxB,CACF,EAAA,CAAG,EAEI,CAAE,UAAa,EAAW,MAAM,CAAE,CAC3C,CACF"}
@@ -0,0 +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`,`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(`
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
+
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
+
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-StKcAkgo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"management-StKcAkgo.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', 'stopped', 'removed', '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 * @returns The device information.\n */\n info() {\n return this.fetch('/management/info', { schema: info });\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 }\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AEZ,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 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./at1000-DbIvMQUc.cjs");exports.CommunicationInterfaceType=e.u,exports.ManagementApi=e.d,exports.calibrationData=e.f,exports.calibrationState=e.p,exports.portMapping=e.m,exports.project=e.h,exports.projectEvent=e.g,exports.runMode=e._,exports.updateStatus=e.v;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./management-DqBsC1HB.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;