@halcyonlabs/app 0.47.0-halcyon.607 → 0.47.0-halcyon.615

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.
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 1,
3
+ "changes": [
4
+ {
5
+ "path": "plugins/orbit/front/CLAUDE.md",
6
+ "before": "A one-off chat with no loop is the same: once its answer is relayed and {{owner}} hasn't replied\nfor a while, archive it and journal it. The guard in Upkeep holds.\n\n**Without bb Tasks** (`bb tasks list --project ORB` says there's no ORB project, or bb has no\nTasks), keep each loop in full in the file instead, one entry each after `## Index`, newest\nfirst, and close it by moving it under `## Done` with a one-line outcome; everything else here\nholds:\n\n```md\n## L-0042 Insurance renewal quote\n- owner: @thread:thr_… (agent | chat)\n- opened: 2026-10-12 · next check: 2026-10-14 09:00\n- done when: I have compared the quotes and saved my choice\n- status: comparing the quotes\n```\n\nClose loops as soon as they're done, so only what's still open stays open:\n\n- **On news:** anything that might settle a loop (a child's result, {{owner}}'s answer, a merge\n notice, a \"deployed\" message, a notice from the plugin, in a message or your journal, a\n check's hit) is checked against the open loops right away. If a loop's done-when is met, close it there and then.\n- **Daily sweep:** once a day, list the open loops (`bb tasks list --project ORB --active\n --sort due`), review every one against its done-when, read the latest comments of those\n due (a check's results among them), close what's met, and bring the rest up to date (task,\n description and index line). It comes as a `Tell:` when it's due (to your background thread\n when that's on): do it then, saying nothing about it to {{owner}}. It's a routine you keep yourself: if `bb orbit schedule list`\n has no `Loop sweep`, add it with\n `bb orbit schedule add --title 'Loop sweep' --every '30 6 * * *' --text 'Daily loop sweep: list the open loop tasks in ORB (bb tasks list --project ORB --active --sort due), review each against its done-when, read the latest comments of those due, close what is met (task done, threads archived, index line under Done) and bring the rest up to date (Continuity).'`\n If it has one whose text doesn't mention ORB, cancel it and add this one.{{mail_check}}\n- **Self-improvement:**",
7
+ "after": "- **Self-improvement:**"
8
+ }
9
+ ]
10
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
- "commit": "9e6bed7d340aa8cb95288a597222570ec4050305",
2
+ "commit": "3007b86451f0b64b6bb049e2d2b290caf28ef6fa",
3
3
  "file": "orbit-deploy",
4
4
  "platform": "linux-x64",
5
5
  "provenance": {
6
- "artifactId": 15362233570,
7
- "artifactName": "linux-bundle-9e6bed7d340aa8cb95288a597222570ec4050305",
6
+ "artifactId": 15372524446,
7
+ "artifactName": "linux-bundle-3007b86451f0b64b6bb049e2d2b290caf28ef6fa",
8
8
  "repository": "matt0x6F/personalassistant",
9
- "runId": 46383750854,
9
+ "runId": 46395967203,
10
10
  "workflow": ".github/workflows/moonlet-linux-bundle.yml"
11
11
  },
12
12
  "schema": 1,
@@ -1 +1 @@
1
- 9e6bed7d340aa8cb95288a597222570ec4050305
1
+ 3007b86451f0b64b6bb049e2d2b290caf28ef6fa
@@ -1 +1 @@
1
- {"repository":"matt0x6F/personalassistant","revision":"9e6bed7d340aa8cb95288a597222570ec4050305"}
1
+ {"repository":"matt0x6F/personalassistant","revision":"3007b86451f0b64b6bb049e2d2b290caf28ef6fa"}
@@ -71,7 +71,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
71
71
  `))}return o}var E,Tt=I(()=>{s(uk,"getLineColFromPtr");s(lk,"makeCodeBlock");E=class e extends Error{static{s(this,"TomlError")}line;column;codeblock;constructor(t,r){let[n,o]=uk(r.toml,r.ptr),i=lk(r.toml,n,o);super(`Invalid TOML document: ${t}
72
72
 
73
73
  ${i}`,r),this.line=n,this.column=o,this.codeblock=i}static x(t,r,n){throw new e(t,{toml:r.s,ptr:n??r.p})}}});function ys(e){let t=e.p,r=e.s.charCodeAt(e.p++),n=r,o=r===39,i=r===e.s.charCodeAt(e.p)&&r===e.s.charCodeAt(e.p+1);i&&((r=e.s.charCodeAt(e.p+=2))===10?e.p++:r===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let a="",c=e.p,u=0;for(;e.p<e.s.length;e.p++)if(r=e.s.charCodeAt(e.p),i&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10))u=u&&3;else if(r<32&&r!==9||r===127)E.x("control characters are not allowed in strings",e);else if((!u||u===3)&&r===n&&(!i||e.s.charCodeAt(e.p+1)===n&&e.s.charCodeAt(e.p+2)===n)){if(i&&(e.s.charCodeAt(e.p+3)===n&&e.p++,e.s.charCodeAt(e.p+3)===n&&e.p++),!u){let l=e.s.slice(c,e.p);a=a?a+l:l}return e.p+=i?3:1,a}else if(!u)!o&&r===92&&(a+=e.s.slice(c,c=e.p),u=1);else if(u===1)if(r===120||r===117||r===85){let l=e.p++-1,f=0,p=r===120?2:r===117?4:8;for(let d=0;d<p;d++,e.p++){let m=e.s.charCodeAt(e.p),g=m>=48&&m<=57?m-48:m>=65&&m<=70?m-65+10:m>=97&&m<=102?m-97+10:-1;g<0&&E.x("invalid non-hex character in unicode escape",e),f=f<<4|g}(f<0||f>1114111||f>=55296&&f<=57343)&&E.x("invalid unicode escape",e,l),a+=String.fromCodePoint(f),c=e.p--,u=0}else i&&(r===32||r===9)?u=2:(r===98?a+="\b":r===116?a+=" ":r===110?a+=`
74
- `:r===102?a+="\f":r===114?a+="\r":r===101?a+="\x1B":r===34?a+='"':r===92?a+="\\":E.x("unrecognised escape sequence",e),c=e.p+1,u=0);else r!==32&&r!==9&&(u===2&&E.x("invalid escape: only line-ending whitespace may be escaped",e,c),u=!o&&r===92?1:0,c=e.p);E.x("unfinished string",e,t)}var Tp=I(()=>{Tt();s(ys,"parseString")});var fk,jn,Np=I(()=>{fk=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,jn=class e extends Date{static{s(this,"TomlDate")}#t=!1;#r=!1;#e=null;constructor(t,r,n){let o=!0,i=!0,a="Z",c;if(typeof t=="string")if(r)e:{if(r<3){if(+t.slice(11,13)>23){t="";break e}r===2?(a=null,t+="Z"):(c=t.charCodeAt(t.length-1))!==90&&c!==122&&(a=t.slice(t.length-6)),n&&(t=t.slice(0,10)+"T"+t.slice(11))}else r===4&&(t=+t.slice(0,2)>23?"":`0000-01-01T${t}Z`);o=r!==4,i=r!==3}else{let u=t.match(fk);u?(u[1]||(o=!1,t=`0000-01-01T${t}`),i=!!u[2],i&&t[10]===" "&&(t=t.replace(" ","T")),u[2]&&+u[2]>23?t="":(a=u[3]||null,!a&&i&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=o,this.#r=i,this.#e=a)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z"||this.#e==="z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let n=new e(t);return n.#e=r,n}static wrapAsLocalDateTime(t){let r=new e(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new e(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new e(t);return r.#t=!1,r.#e=null,r}}});function ve(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function Zp(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function Fn(e,t){let r=e.p,n=e.s.charCodeAt(e.p);if(n===91||n===123){e.d--||E.x("document contains excessively nested structures. aborting.",e);let o=n===91?Zy(e):Ry(e);return e.d++,o}return n===34||n===39?ys(e):n===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&E.x("invalid value",e,r),e.p++,!0):n===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&E.x("invalid value",e,r),e.p++,!1):n===43||n===45?$s(e,e.p,e.s.charCodeAt(++e.p),44-n,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?pk(e,n,t):e.s.charCodeAt(e.p+2)===58?dk(e,n,t):$s(e,e.p,n,0,t)}function $s(e,t,r,n,o){let i=r,a=0,c=!1;if(i===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&E.x("invalid value",e,t),e.p++,(n||1)/0;if(i===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&E.x("invalid value",e,t),e.p++,NaN;if(i===48){if(++e.p>=e.s.length||Zp(i=e.s.charCodeAt(e.p),o))return e.bi===!0?0n:0;if(!n){if(i===120)return Rp(e,t,16,o);if(i===98)return Rp(e,t,2,o);if(i===111)return Rp(e,t,8,o)}i===46?a=2:i===101||i===69?a=4:E.x("illegal leading zero",e,t)}else ve(i)||E.x("invalid value",e,t);for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!Zp(i,o));)a||(a=1),i===95?(a&1||E.x("illegal underscore",e),a+=11,c=!0):a===1&&i===46?a=2:(a===1||a===3)&&(i===101||i===69)?a=4:a===4&&(i===43||i===45)?a=6:ve(i)?a>9?a-=11:a&1||a++:E.x("illegal character in numeric literal",e);if(!a){let l=(r-48)*(n||1);return e.bi===!0?BigInt(l):l}a&1||E.x("unfinished numeric value",e,t);let u=e.s.slice(t,e.p);return c&&(u=u.replaceAll("_","")),a>1?parseFloat(u):Ny(e,u,10,t)}function Rp(e,t,r,n){let o,i=1;for(;++e.p<e.s.length&&(o=e.s.charCodeAt(e.p),!Zp(o,n));)o===95?(i&1&&E.x("illegal underscore",e),i=3):ve(o,r)?i&1&&i--:E.x("illegal character in numeric literal",e);i&1&&E.x("unfinished numeric value",e);let a=e.s.slice(t+2,e.p);return i&&(a=a.replaceAll("_","")),Ny(e,a,r,t)}function Ny(e,t,r,n){if(e.bi!==!0)e:{let o=parseInt(t,r);if(!Number.isSafeInteger(o)){if(e.bi)break e;E.x("integer value cannot be represented losslessly",e,n)}return o}return BigInt(r===10?t:(r===2?"0b":r===8?"0o":"0x")+t)}function pk(e,t,r){let n=e.p++,o;if(!ve(t)||!ve(e.s.charCodeAt(e.p++))||!ve(e.s.charCodeAt(e.p++))||!ve(e.s.charCodeAt(e.p++)))return $s(e,e.p=n,t,0,r);if(e.p+=5,ve(e.s.charCodeAt(e.p++))||E.x("invalid date-time: date part is malformed",e,n),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(o=!0,!ve(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116){let a=e.s.slice(n,e.p);return Mn(e,a,3,!1,n)}if(e.s.charCodeAt(e.p+=3)!==58&&E.x("invalid date-time: time part is malformed",e,n),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;ve(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122){let a=e.s.slice(n,++e.p);return Mn(e,a,1,o,n,"[+00:00]")}if(t===43||t===45){let a=e.s.slice(n,e.p+=6);return Mn(e,a,1,o,n,!e.ld&&"["+e.s.slice(e.p-6,e.p)+"]")}}let i=e.s.slice(n,e.p);return Mn(e,i,2,o,n)}function dk(e,t,r){let n=e.p;if(!ve(t)||!ve(e.s.charCodeAt(++e.p)))return $s(e,--e.p,t,0,r);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;ve(e.s.charCodeAt(++e.p)););let o=e.s.slice(n,e.p);return Mn(e,o,4,!1,n)}function Mn(e,t,r,n,o,i){if(e.ld){let a=new jn(t,r,n);return a.isValid()||E.x("invalid date",e,o),a}try{switch(i&&(t+=i),r){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(a){E.x(a instanceof Error?a.message:""+a,e,o)}}var Dp=I(()=>{Tp();Lp();Tt();Np();s(ve,"isDigit");s(Zp,"isEndOfValue");s(Fn,"extractValue");s($s,"parseNumber");s(Rp,"parseIntegerBaseN");s(Ny,"parseInteger");s(pk,"parseDate");s(dk,"parseTime");s(Mn,"readDate")});function mk(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&E.x("control characters are not allowed in comments",e)}}function Ae(e,t,r){let n;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((n=e.s.charCodeAt(e.p))===32||n===9||!t&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(r||n!==35)break;mk(e)}}var jp=I(()=>{Tt();s(mk,"skipComment");s(Ae,"skipVoid")});function bs(e,t=61){let r,n=0,o=[],i,a=e.s.charCodeAt(r=e.p);do{if(a===t)return n||E.x("unexpected end of key",e),n===1&&o.push(e.s.slice(i,e.p)),e.p++,o;a===46?(n||E.x("illegal empty bare key",e),n===1&&o.push(e.s.slice(i,e.p)),n=0):!n&&(a===34||a===39)?(a===e.s.charCodeAt(e.p+1)&&a===e.s.charCodeAt(e.p+2)&&E.x("illegal quoted key: multiline strings are not allowed",e),o.push(ys(e)),n=2,e.p--):a===32||a===9?n===1&&(o.push(e.s.slice(i,e.p)),n=2):n===2||a<48&&a!==45||a>57&&a<65||a>90&&a<97&&a!==95||a>122?E.x("illegal character in key",e):n||(n=1,i=e.p)}while(a=e.s.charCodeAt(++e.p));E.x("incomplete key-value: cannot find end of key",e,r)}function Ry(e){let t=e.p++,r=Object.create(null),n=new Set,o;for(;e.p<e.s.length;){if(Ae(e),(o=e.s.charCodeAt(e.p))===125)return e.p++,r;let i,a=r,c=!1,u=e.p,l=bs(e);for(let p=0;p<l.length;p++){p&&(a=c?a[i]:a[i]=Object.create(null)),i=l[p],(c=Object.hasOwn(a,i))&&(typeof a[i]!="object"||n.has(a[i]))&&E.x("trying to redefine an already defined value",e,u);let d=i==="__proto__";if(e.uk&&(d||i==="constructor")){a=e.uk!==1&&E.x("document contains an unsafe property",e,u);break}!c&&d&&Object.defineProperty(a,i,{enumerable:!0,configurable:!0,writable:!0})}c&&E.x("trying to redefine an already defined value",e,u),Ae(e,!0,!0);let f=Fn(e,125);if(a&&typeof(a[i]=f)=="object"&&n.add(f),Ae(e),(o=e.s.charCodeAt(e.p++))===125)return r;o!==44&&E.x("expected comma or end of structure",e,e.p-1)}E.x("unfinished table",e,t)}function Zy(e){let t=e.p++,r=[],n;for(;e.p<e.s.length;){if(Ae(e),(n=e.s.charCodeAt(e.p))===93)return e.p++,r;if(r.push(Fn(e,93)),Ae(e),(n=e.s.charCodeAt(e.p++))===93)return r;n!==44&&E.x("expected comma or end of structure",e,e.p-1)}E.x("unfinished array",e,t)}var Lp=I(()=>{Tp();Dp();jp();Tt();s(bs,"parseKey");s(Ry,"parseInlineTable");s(Zy,"parseArray")});function Dy(e,t,r,n,o){let i=r,a=n,c,u=!1,l;for(let f=0;f<t.length;f++){if(f){if(i=u?i[c]:i[c]=Object.create(null),a=(l=a[c]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let p=i.length-1;i=i[p],a=a[p].c}}if(c=t[f],(u=Object.hasOwn(i,c))&&a[c]?.t===0&&a[c]?.d)return null;if(!u){let p=c==="__proto__";if(e.uk&&(p||c==="constructor"))return!1;p&&(Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,c,{enumerable:!0,configurable:!0,writable:!0})),a[c]={t:f<t.length-1&&o===2?3:o,d:!1,i:0,c:Object.create(null)}}}if(l=a[c],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[c]=[]),i[c].push(i=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,o===1)i=u?i[c]:i[c]=Object.create(null);else if(o===0&&u)return null;return[c,i,l.c]}function Ly(e,t,r){(t===null||e.uk===2)&&E.x(t===null?"trying to redefine an already defined table or value":"document contains an unsafe property",e,r)}function Mp(e,t={}){let r={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour==="throw"?2:t.unsafeKeyBehaviour==="drop"?1:0},n=Object.create(null),o=Object.create(null),i,a=!1,c=n,u=o;for(e.charCodeAt(0)===65279&&r.p++,Ae(r);r.p<e.length;){if(e.charCodeAt(r.p)===91){let l=e.charCodeAt(++r.p)===91;i=r.p+=+l,a=!1;let f=bs(r,93);l&&(e.charCodeAt(r.p)!==93&&E.x("expected end of table array declaration",r),r.p++);let p=Dy(r,f,n,o,l?2:1);p?(u=p[2],c=p[1]):(Ly(r,p,i),a=!0)}else{i=r.p;let l=bs(r),f=Dy(r,l,c,u,0);!f&&!a&&Ly(r,f,i),Ae(r,!0,!0);let p=Fn(r,void 0);f&&!a&&(f[1][f[0]]=p)}Ae(r,!0),r.p<e.length&&(i=e.charCodeAt(r.p))!==10&&(i!==13||e.charCodeAt(r.p+1)!==10)&&E.x("each key-value declaration must be followed by an end-of-line",r),Ae(r)}return n}var jy=I(()=>{Lp();Dp();jp();Tt();s(Dy,"peekTable");s(Ly,"validateTablePeek");s(Mp,"parse")});var $P,My=I(()=>{$P=!!"".isWellFormed});var Fy=I(()=>{jy();My();Np();Tt();});import{readFile as Vy}from"node:fs/promises";import{dirname as gk,join as Vn,relative as yk,resolve as $k}from"node:path";function Up(e,t){if(!e||typeof e!="object"||Array.isArray(e))return e;let{os:r,...n}=e;return(r!==void 0&&r!=="linux"||n.driver==="lume")&&t.addIssue({code:"custom",message:_k}),n}function xk(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{containers:t,...r}=e,n=t===!0?{vms:!0,...r}:r;return n.driver==="container"?{...n,driver:"libvirt"}:n}function Gy(){return{station:{name:"station",admin_user:"orbitadm",desktop_user:"orbit"},user:[],script:[]}}function Sk(e){return e.mail!==!1}function Ik(e){return e.vms===!0}function zk(e){return e.codex===!0}function Wy(e){let t=new Set([...Sk(e.station)?[]:["mail"],...Ik(e.station)?[]:["vms"],...zk(e.station)?[]:["codex"]]);if(t.size===0)return e;let r=s(n=>n.filter(o=>!o.needs||!t.has(o.needs)),"kept");return{...e,user:r(e.user),script:r(e.script)}}function Ky(e,t,r){let n=[...e];for(let o of t){let i=n.findIndex(a=>r(a)===r(o));i>=0?n[i]=o:n.push(o)}return n}function Pk(e,t,r){return{station:{...e.station,...t.station},user:Ky(e.user,t.user??[],n=>n.name),script:Ky(e.script,r,n=>n.path)}}function Ak(e,t){let r;try{r=Mp(e)}catch{throw new Oe(`${t}: invalid recipe TOML (file contents withheld)`)}let n=kk.safeParse(r);if(!n.success){let o=n.error.issues.map(i=>` ${i.path.join(".")||"(top)"}: ${i.message}`);throw new Oe(`${t}:
74
+ `:r===102?a+="\f":r===114?a+="\r":r===101?a+="\x1B":r===34?a+='"':r===92?a+="\\":E.x("unrecognised escape sequence",e),c=e.p+1,u=0);else r!==32&&r!==9&&(u===2&&E.x("invalid escape: only line-ending whitespace may be escaped",e,c),u=!o&&r===92?1:0,c=e.p);E.x("unfinished string",e,t)}var Tp=I(()=>{Tt();s(ys,"parseString")});var fk,jn,Np=I(()=>{fk=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,jn=class e extends Date{static{s(this,"TomlDate")}#t=!1;#r=!1;#e=null;constructor(t,r,n){let o=!0,i=!0,a="Z",c;if(typeof t=="string")if(r)e:{if(r<3){if(+t.slice(11,13)>23){t="";break e}r===2?(a=null,t+="Z"):(c=t.charCodeAt(t.length-1))!==90&&c!==122&&(a=t.slice(t.length-6)),n&&(t=t.slice(0,10)+"T"+t.slice(11))}else r===4&&(t=+t.slice(0,2)>23?"":`0000-01-01T${t}Z`);o=r!==4,i=r!==3}else{let u=t.match(fk);u?(u[1]||(o=!1,t=`0000-01-01T${t}`),i=!!u[2],i&&t[10]===" "&&(t=t.replace(" ","T")),u[2]&&+u[2]>23?t="":(a=u[3]||null,!a&&i&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=o,this.#r=i,this.#e=a)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z"||this.#e==="z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let n=new e(t);return n.#e=r,n}static wrapAsLocalDateTime(t){let r=new e(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new e(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new e(t);return r.#t=!1,r.#e=null,r}}});function ve(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function Zp(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function Fn(e,t){let r=e.p,n=e.s.charCodeAt(e.p);if(n===91||n===123){e.d--||E.x("document contains excessively nested structures. aborting.",e);let o=n===91?Zy(e):Ry(e);return e.d++,o}return n===34||n===39?ys(e):n===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&E.x("invalid value",e,r),e.p++,!0):n===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&E.x("invalid value",e,r),e.p++,!1):n===43||n===45?$s(e,e.p,e.s.charCodeAt(++e.p),44-n,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?pk(e,n,t):e.s.charCodeAt(e.p+2)===58?dk(e,n,t):$s(e,e.p,n,0,t)}function $s(e,t,r,n,o){let i=r,a=0,c=!1;if(i===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&E.x("invalid value",e,t),e.p++,(n||1)/0;if(i===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&E.x("invalid value",e,t),e.p++,NaN;if(i===48){if(++e.p>=e.s.length||Zp(i=e.s.charCodeAt(e.p),o))return e.bi===!0?0n:0;if(!n){if(i===120)return Rp(e,t,16,o);if(i===98)return Rp(e,t,2,o);if(i===111)return Rp(e,t,8,o)}i===46?a=2:i===101||i===69?a=4:E.x("illegal leading zero",e,t)}else ve(i)||E.x("invalid value",e,t);for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!Zp(i,o));)a||(a=1),i===95?(a&1||E.x("illegal underscore",e),a+=11,c=!0):a===1&&i===46?a=2:(a===1||a===3)&&(i===101||i===69)?a=4:a===4&&(i===43||i===45)?a=6:ve(i)?a>9?a-=11:a&1||a++:E.x("illegal character in numeric literal",e);if(!a){let l=(r-48)*(n||1);return e.bi===!0?BigInt(l):l}a&1||E.x("unfinished numeric value",e,t);let u=e.s.slice(t,e.p);return c&&(u=u.replaceAll("_","")),a>1?parseFloat(u):Ny(e,u,10,t)}function Rp(e,t,r,n){let o,i=1;for(;++e.p<e.s.length&&(o=e.s.charCodeAt(e.p),!Zp(o,n));)o===95?(i&1&&E.x("illegal underscore",e),i=3):ve(o,r)?i&1&&i--:E.x("illegal character in numeric literal",e);i&1&&E.x("unfinished numeric value",e);let a=e.s.slice(t+2,e.p);return i&&(a=a.replaceAll("_","")),Ny(e,a,r,t)}function Ny(e,t,r,n){if(e.bi!==!0)e:{let o=parseInt(t,r);if(!Number.isSafeInteger(o)){if(e.bi)break e;E.x("integer value cannot be represented losslessly",e,n)}return o}return BigInt(r===10?t:(r===2?"0b":r===8?"0o":"0x")+t)}function pk(e,t,r){let n=e.p++,o;if(!ve(t)||!ve(e.s.charCodeAt(e.p++))||!ve(e.s.charCodeAt(e.p++))||!ve(e.s.charCodeAt(e.p++)))return $s(e,e.p=n,t,0,r);if(e.p+=5,ve(e.s.charCodeAt(e.p++))||E.x("invalid date-time: date part is malformed",e,n),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(o=!0,!ve(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116){let a=e.s.slice(n,e.p);return Mn(e,a,3,!1,n)}if(e.s.charCodeAt(e.p+=3)!==58&&E.x("invalid date-time: time part is malformed",e,n),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;ve(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122){let a=e.s.slice(n,++e.p);return Mn(e,a,1,o,n,"[+00:00]")}if(t===43||t===45){let a=e.s.slice(n,e.p+=6);return Mn(e,a,1,o,n,!e.ld&&"["+e.s.slice(e.p-6,e.p)+"]")}}let i=e.s.slice(n,e.p);return Mn(e,i,2,o,n)}function dk(e,t,r){let n=e.p;if(!ve(t)||!ve(e.s.charCodeAt(++e.p)))return $s(e,--e.p,t,0,r);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;ve(e.s.charCodeAt(++e.p)););let o=e.s.slice(n,e.p);return Mn(e,o,4,!1,n)}function Mn(e,t,r,n,o,i){if(e.ld){let a=new jn(t,r,n);return a.isValid()||E.x("invalid date",e,o),a}try{switch(i&&(t+=i),r){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(a){E.x(a instanceof Error?a.message:""+a,e,o)}}var Dp=I(()=>{Tp();Lp();Tt();Np();s(ve,"isDigit");s(Zp,"isEndOfValue");s(Fn,"extractValue");s($s,"parseNumber");s(Rp,"parseIntegerBaseN");s(Ny,"parseInteger");s(pk,"parseDate");s(dk,"parseTime");s(Mn,"readDate")});function mk(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&E.x("control characters are not allowed in comments",e)}}function Ae(e,t,r){let n;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((n=e.s.charCodeAt(e.p))===32||n===9||!t&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(r||n!==35)break;mk(e)}}var jp=I(()=>{Tt();s(mk,"skipComment");s(Ae,"skipVoid")});function bs(e,t=61){let r,n=0,o=[],i,a=e.s.charCodeAt(r=e.p);do{if(a===t)return n||E.x("unexpected end of key",e),n===1&&o.push(e.s.slice(i,e.p)),e.p++,o;a===46?(n||E.x("illegal empty bare key",e),n===1&&o.push(e.s.slice(i,e.p)),n=0):!n&&(a===34||a===39)?(a===e.s.charCodeAt(e.p+1)&&a===e.s.charCodeAt(e.p+2)&&E.x("illegal quoted key: multiline strings are not allowed",e),o.push(ys(e)),n=2,e.p--):a===32||a===9?n===1&&(o.push(e.s.slice(i,e.p)),n=2):n===2||a<48&&a!==45||a>57&&a<65||a>90&&a<97&&a!==95||a>122?E.x("illegal character in key",e):n||(n=1,i=e.p)}while(a=e.s.charCodeAt(++e.p));E.x("incomplete key-value: cannot find end of key",e,r)}function Ry(e){let t=e.p++,r=Object.create(null),n=new Set,o;for(;e.p<e.s.length;){if(Ae(e),(o=e.s.charCodeAt(e.p))===125)return e.p++,r;let i,a=r,c=!1,u=e.p,l=bs(e);for(let p=0;p<l.length;p++){p&&(a=c?a[i]:a[i]=Object.create(null)),i=l[p],(c=Object.hasOwn(a,i))&&(typeof a[i]!="object"||n.has(a[i]))&&E.x("trying to redefine an already defined value",e,u);let d=i==="__proto__";if(e.uk&&(d||i==="constructor")){a=e.uk!==1&&E.x("document contains an unsafe property",e,u);break}!c&&d&&Object.defineProperty(a,i,{enumerable:!0,configurable:!0,writable:!0})}c&&E.x("trying to redefine an already defined value",e,u),Ae(e,!0,!0);let f=Fn(e,125);if(a&&typeof(a[i]=f)=="object"&&n.add(f),Ae(e),(o=e.s.charCodeAt(e.p++))===125)return r;o!==44&&E.x("expected comma or end of structure",e,e.p-1)}E.x("unfinished table",e,t)}function Zy(e){let t=e.p++,r=[],n;for(;e.p<e.s.length;){if(Ae(e),(n=e.s.charCodeAt(e.p))===93)return e.p++,r;if(r.push(Fn(e,93)),Ae(e),(n=e.s.charCodeAt(e.p++))===93)return r;n!==44&&E.x("expected comma or end of structure",e,e.p-1)}E.x("unfinished array",e,t)}var Lp=I(()=>{Tp();Dp();jp();Tt();s(bs,"parseKey");s(Ry,"parseInlineTable");s(Zy,"parseArray")});function Dy(e,t,r,n,o){let i=r,a=n,c,u=!1,l;for(let f=0;f<t.length;f++){if(f){if(i=u?i[c]:i[c]=Object.create(null),a=(l=a[c]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let p=i.length-1;i=i[p],a=a[p].c}}if(c=t[f],(u=Object.hasOwn(i,c))&&a[c]?.t===0&&a[c]?.d)return null;if(!u){let p=c==="__proto__";if(e.uk&&(p||c==="constructor"))return!1;p&&(Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,c,{enumerable:!0,configurable:!0,writable:!0})),a[c]={t:f<t.length-1&&o===2?3:o,d:!1,i:0,c:Object.create(null)}}}if(l=a[c],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[c]=[]),i[c].push(i=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,o===1)i=u?i[c]:i[c]=Object.create(null);else if(o===0&&u)return null;return[c,i,l.c]}function Ly(e,t,r){(t===null||e.uk===2)&&E.x(t===null?"trying to redefine an already defined table or value":"document contains an unsafe property",e,r)}function Mp(e,t={}){let r={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour==="throw"?2:t.unsafeKeyBehaviour==="drop"?1:0},n=Object.create(null),o=Object.create(null),i,a=!1,c=n,u=o;for(e.charCodeAt(0)===65279&&r.p++,Ae(r);r.p<e.length;){if(e.charCodeAt(r.p)===91){let l=e.charCodeAt(++r.p)===91;i=r.p+=+l,a=!1;let f=bs(r,93);l&&(e.charCodeAt(r.p)!==93&&E.x("expected end of table array declaration",r),r.p++);let p=Dy(r,f,n,o,l?2:1);p?(u=p[2],c=p[1]):(Ly(r,p,i),a=!0)}else{i=r.p;let l=bs(r),f=Dy(r,l,c,u,0);!f&&!a&&Ly(r,f,i),Ae(r,!0,!0);let p=Fn(r,void 0);f&&!a&&(f[1][f[0]]=p)}Ae(r,!0),r.p<e.length&&(i=e.charCodeAt(r.p))!==10&&(i!==13||e.charCodeAt(r.p+1)!==10)&&E.x("each key-value declaration must be followed by an end-of-line",r),Ae(r)}return n}var jy=I(()=>{Lp();Dp();jp();Tt();s(Dy,"peekTable");s(Ly,"validateTablePeek");s(Mp,"parse")});var $P,My=I(()=>{$P=!!"".isWellFormed});var Fy=I(()=>{jy();My();Np();Tt();});import{readFile as Vy}from"node:fs/promises";import{dirname as gk,join as Vn,relative as yk,resolve as $k}from"node:path";function Up(e,t){if(!e||typeof e!="object"||Array.isArray(e))return e;let{os:r,...n}=e;return r==="macos"||n.driver==="lume"?t.addIssue({code:"custom",message:_k}):r!==void 0&&r!=="linux"&&t.addIssue({code:"custom",message:'os must be "linux"'}),n}function xk(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{containers:t,...r}=e,n=t===!0?{vms:!0,...r}:r;return n.driver==="container"?{...n,driver:"libvirt"}:n}function Gy(){return{station:{name:"station",admin_user:"orbitadm",desktop_user:"orbit"},user:[],script:[]}}function Sk(e){return e.mail!==!1}function Ik(e){return e.vms===!0}function zk(e){return e.codex===!0}function Wy(e){let t=new Set([...Sk(e.station)?[]:["mail"],...Ik(e.station)?[]:["vms"],...zk(e.station)?[]:["codex"]]);if(t.size===0)return e;let r=s(n=>n.filter(o=>!o.needs||!t.has(o.needs)),"kept");return{...e,user:r(e.user),script:r(e.script)}}function Ky(e,t,r){let n=[...e];for(let o of t){let i=n.findIndex(a=>r(a)===r(o));i>=0?n[i]=o:n.push(o)}return n}function Pk(e,t,r){return{station:{...e.station,...t.station},user:Ky(e.user,t.user??[],n=>n.name),script:Ky(e.script,r,n=>n.path)}}function Ak(e,t){let r;try{r=Mp(e)}catch{throw new Oe(`${t}: invalid recipe TOML (file contents withheld)`)}let n=kk.safeParse(r);if(!n.success){let o=n.error.issues.map(i=>` ${i.path.join(".")||"(top)"}: ${i.message}`);throw new Oe(`${t}:
75
75
  ${o.join(`
76
76
  `)}`)}return n.data}async function Fp(e,t=Gy()){let r=t;for(let n of e){let o=Ak(await Vy(n,"utf8"),n),i=[];for(let a of o.script??[]){let c=$k(gk(n),a.path),u=await Vy(c,"utf8").catch(()=>{throw new Oe(`${n}: script ${a.path} not found at ${c}`)});i.push({...a,path:c,content:u})}r=Pk(r,o,i)}return r}async function Bp(e,t,r=[],n,o){let i=n&&!o?Vn(e,"moonlet","config","stations",`${n}.toml`):void 0,a=i&&gs(i)?[i]:[],c=o?Nt.parse(o):void 0,u=t==="base"?"base-linux.toml":"default-linux.toml",l=Vn(e,"moonlet","config","station",t==="base"?"base.toml":"recipe.toml"),f=Gy();t==="custom"&&(f.station=(await Bp(e,"base",[],n,c)).station);let p=await Fp([Vn(e,"moonlet","recipes",u),...gs(l)?[l]:[],...a],f);return c&&(p={...p,station:{...p.station,...c}}),p=await Fp(r,p),n&&(p.station.name=n),p.station.tunnel&&(p.station.gate=`127.0.0.1:${p.station.tunnel.slice(p.station.tunnel.lastIndexOf(":")+1)}`),Wy({...p,script:p.script.map(d=>({...d,recordName:yk(e,d.path)}))})}async function ws(e,t="bb-server",r){let n=Vn(e,"moonlet","config","servers",`${t}.toml`);if(!r&&!gs(n))throw new Oe(`no record of the server ${t}: Moonlet's server record says where its VM runs (moonlet station show ${t} --server)`);let o=await Fp([Vn(e,"moonlet","recipes","server-linux.toml"),...r?[]:[n]]);return r&&(o={...o,station:{...o.station,...Nt.parse(r)}}),o.station.name=t,o.station.role="server",Wy(o)}var bk,Jy,wk,vk,Uy,By,Vp,_k,Nt,kk,Pr,Oe,Rt=I(()=>{"use strict";Ty();Fy();Ue();bk=y.enum(["root","admin","orbit"]),Jy=y.enum(["mail","vms","codex"]),wk=y.object({path:y.string().min(1),as:bk.default("root"),needs:Jy.optional()}).strict(),vk=y.object({name:y.string().regex(/^[a-z_][a-z0-9_-]*$/,"a lowercase short name"),login:y.boolean().default(!0),needs:Jy.optional()}).strict(),Uy=y.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,62}$/,"letters, digits, . _ -, starting with a letter or digit"),By=y.string().regex(/^[a-z_][a-z0-9_-]{0,31}$/,"a lowercase account name"),Vp=y.object({name:Uy.optional(),admin_user:By.optional(),desktop_user:By.optional(),driver:y.enum(["libvirt","aws","e2b"]).optional(),hypervisor:y.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]*@[A-Za-z0-9][A-Za-z0-9.-]*$/,"user@host").optional(),server:Uy.optional(),role:y.enum(["station","server"]).optional(),region:y.string().regex(/^[a-z]{2}(-[a-z]+)+-\d$/,"an AWS region, like us-west-2").optional(),profile:y.string().regex(/^[A-Za-z0-9_.-]+$/,"a profile name").optional(),instance_type:y.string().regex(/^[a-z0-9-]+\.[a-z0-9]+$/,"an instance type, like t3.large").optional(),template:y.string().regex(/^[a-z0-9][a-z0-9_-]{0,62}$/,"an E2B template name, like station").optional(),cpus:y.number().int().min(1).max(64).optional(),memory_gb:y.number().int().min(2).max(256).optional(),disk_gb:y.number().int().min(20).max(2e3).optional(),gate:y.string().regex(/^[0-9.]+:\d+$/,"address:port").optional(),tunnel:y.string().regex(/^[0-9.]+:\d+$/,"address:port").optional(),orbit_thread:y.boolean().optional(),mail:y.boolean().optional(),vms:y.boolean().optional(),codex:y.boolean().optional(),events:y.object({owner_label:y.string().min(1).optional(),reviewers:y.array(y.string().min(1)).optional(),owner_email:y.string().min(3).optional(),never_email:y.array(y.string().min(3)).optional()}).strict().optional()}).strict(),_k='macOS stations are no longer supported: a station runs Linux, as a libvirt VM (driver = "libvirt") or in AWS (driver = "aws")';s(Up,"withoutEarlierOs");s(xk,"fromContainers");Nt=y.preprocess((e,t)=>xk(Up(e,t)),Vp),kk=y.object({station:y.preprocess(Up,Vp).optional(),user:y.array(vk).optional(),script:y.array(wk).optional()}).strict(),Pr=y.preprocess(Up,Vp.required({name:!0,admin_user:!0,desktop_user:!0}).strict());s(Gy,"emptyRecipe");s(Sk,"mailOn");s(Ik,"vmsOn");s(zk,"codexOn");s(Wy,"withoutUnneeded");s(Ky,"upsert");s(Pk,"layer");Oe=class extends Error{static{s(this,"RecipeError")}};s(Ak,"parseRecipe");s(Fp,"loadRecipe");s(Bp,"stationRecipe");s(ws,"serverRecipe")});import{StringDecoder as Ok}from"node:string_decoder";import{format as qy}from"node:util";function Xy(e){if(!e)return e;for(let t of[e,e.trim(),JSON.stringify(e).slice(1,-1),e.replaceAll("'","'\\''"),encodeURIComponent(e),Buffer.from(e).toString("base64")])t&&_s.add(t);for(let t of e.split(/\r?\n/))e.includes(`
77
77
  `)&&/[A-Za-z0-9]/.test(t)&&_s.add(t);return e}function Un(e,t=!1){if(typeof e=="string"&&t)Xy(e);else if(Array.isArray(e))for(let r of e)Un(r,t);else if(e&&typeof e=="object")for(let[r,n]of Object.entries(e))Un(n,t||Hy.test(r)&&!/(?:file|path|dir)$/i.test(r))}function ce(e){e=e.replace(/\x1b\[[0-9;?]*[ -/]*[@-~]/g,""),Un(process.env);try{Un(JSON.parse(e))}catch{}for(let t of e.split(/\r?\n/)){let r=t.match(/^\s*(?:export\s+)?([\w.-]+)\s*=\s*(.*?)\s*$/);if(!r||!Hy.test(r[1])||/(?:file|path|dir)$/i.test(r[1]))continue;let n=r[2].replace(/^(["'])(.*)\1$/,"$2");/^[A-Za-z0-9_./+=:@-]+$/.test(n)&&Xy(n)}e=e.replace(/-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY-----[\s\S]*?-----END (?:[A-Z0-9]+ )*PRIVATE KEY-----/g,vs).replace(/\b(?:tskey-|sk-ant-|gh[pousr]_|github_pat_)[A-Za-z0-9_?=&.-]+/g,vs);for(let t of[..._s].sort((r,n)=>n.length-r.length))e=e.split(t).join(vs);return e}function Bn(e){let t=new Ok("utf8"),r="",n=!1,o=s(i=>{/-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY-----/.test(i)&&(n=!0),n?(/-----END (?:[A-Z0-9]+ )*PRIVATE KEY-----/.test(i)&&(n=!1),e(`${vs}
@@ -8,5 +8,5 @@
8
8
  "bbVersion": "0.47.0",
9
9
  "pluginSdkVersion": "0.6.82"
10
10
  },
11
- "artifactDigest": "f769e9931aee4b75d17b99f19442a4404065c9be64bac161e51a6e11919f2697"
11
+ "artifactDigest": "399c7db7fb4751242cbf81cb983bf1b636d7e27fc047b3352b8188cca3c68975"
12
12
  }