@hearsay-tools/squawk 0.19.0-pr4562.9049 → 0.19.0-pr4564.9050

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 (178) hide show
  1. package/dist/built-in-cli-commands.js +1 -1
  2. package/dist/built-in-cli-commands.js.map +1 -1
  3. package/dist/cli-dispatch.d.ts +1 -1
  4. package/dist/cli-dispatch.js +19 -4
  5. package/dist/cli-dispatch.js.map +1 -1
  6. package/dist/config.d.ts +1 -1
  7. package/dist/config.js +3 -0
  8. package/dist/config.js.map +1 -1
  9. package/dist/contract/health.d.ts +2 -2
  10. package/dist/contract/index.d.ts +0 -1
  11. package/dist/contract/index.js +14 -134
  12. package/dist/contract/projects.d.ts +8 -2
  13. package/dist/contract/workspace.d.ts +0 -10
  14. package/dist/core/cli-registry.d.ts +1 -0
  15. package/dist/core/server-hook-registry.d.ts +4 -2
  16. package/dist/core/server-hook-registry.js.map +1 -1
  17. package/dist/delegation/routes.d.ts +4 -4
  18. package/dist/delegation/transport.d.ts +14 -14
  19. package/dist/features/automations/automations-routes.js +4 -3
  20. package/dist/features/automations/automations-routes.js.map +1 -1
  21. package/dist/features/automations/tools.d.ts +8 -8
  22. package/dist/home/entry-authorization.js +1 -1
  23. package/dist/home/entry-authorization.js.map +1 -1
  24. package/dist/home/home.d.ts +0 -2
  25. package/dist/home/home.js +0 -1
  26. package/dist/home/home.js.map +1 -1
  27. package/dist/home/migration-plan.js +1 -1
  28. package/dist/home/migration-plan.js.map +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/runs/run-decode.d.ts +72 -72
  32. package/dist/serve-boot.d.ts +1 -1
  33. package/dist/serve-boot.js +4 -2
  34. package/dist/serve-boot.js.map +1 -1
  35. package/dist/serve-command.d.ts +2 -2
  36. package/dist/serve-command.js +47 -31
  37. package/dist/serve-command.js.map +1 -1
  38. package/dist/server/activity-routes.js +1 -1
  39. package/dist/server/activity-routes.js.map +1 -1
  40. package/dist/server/activity-sources.d.ts +1 -1
  41. package/dist/server/activity-sources.js +6 -4
  42. package/dist/server/activity-sources.js.map +1 -1
  43. package/dist/server/activity-topic.js +5 -2
  44. package/dist/server/activity-topic.js.map +1 -1
  45. package/dist/server/live-routes.d.ts +8 -7
  46. package/dist/server/live-routes.js +2 -2
  47. package/dist/server/live-routes.js.map +1 -1
  48. package/dist/server/plugin-server-hooks.js +7 -4
  49. package/dist/server/plugin-server-hooks.js.map +1 -1
  50. package/dist/server/project-context.d.ts +3 -1
  51. package/dist/server/project-context.js +5 -1
  52. package/dist/server/project-context.js.map +1 -1
  53. package/dist/server/projects-routes.d.ts +64 -2
  54. package/dist/server/projects-routes.js +15 -8
  55. package/dist/server/projects-routes.js.map +1 -1
  56. package/dist/server/providers-routes.d.ts +16 -2
  57. package/dist/server/providers-routes.js +9 -4
  58. package/dist/server/providers-routes.js.map +1 -1
  59. package/dist/server/runs-routes.d.ts +4 -4
  60. package/dist/server/server-deps.d.ts +11 -4
  61. package/dist/server/server-deps.js +26 -9
  62. package/dist/server/server-deps.js.map +1 -1
  63. package/dist/server/server.d.ts +1871 -1808
  64. package/dist/server/server.js +23 -31
  65. package/dist/server/server.js.map +1 -1
  66. package/dist/server/start-server.js +22 -14
  67. package/dist/server/start-server.js.map +1 -1
  68. package/dist/server/workspace-live-routes.d.ts +7 -28
  69. package/dist/server/workspace-live-routes.js +1 -5
  70. package/dist/server/workspace-live-routes.js.map +1 -1
  71. package/dist/server/workspace-projects.d.ts +11 -8
  72. package/dist/server/workspace-projects.js +50 -12
  73. package/dist/server/workspace-projects.js.map +1 -1
  74. package/dist/server/workspace-routes.d.ts +1 -1
  75. package/dist/server/workspace-routes.js +2 -2
  76. package/dist/server/workspace-routes.js.map +1 -1
  77. package/dist/server/workspace-run-feed.d.ts +4 -4
  78. package/dist/server/workspace-run-feed.js +2 -0
  79. package/dist/server/workspace-run-feed.js.map +1 -1
  80. package/dist/task-cli/discovery.js +7 -0
  81. package/dist/task-cli/discovery.js.map +1 -1
  82. package/dist/workflows/continuation-admission.d.ts +72 -72
  83. package/dist/workflows/run/wait-engine.d.ts +72 -72
  84. package/dist/workspace/backups.d.ts +1 -1
  85. package/dist/workspace/backups.js +1 -1
  86. package/dist/workspace/backups.js.map +1 -1
  87. package/package.json +4 -4
  88. package/web/dist/assets/{accounts-section-COsAMTyo.js → accounts-section-6maSAsJt.js} +1 -1
  89. package/web/dist/assets/{activity-motion-76L1dElc.js → activity-motion-2ckGi01V.js} +1 -1
  90. package/web/dist/assets/{activity-route-DdwSinTQ.js → activity-route-2I944jwR.js} +1 -1
  91. package/web/dist/assets/{agent-config-section-DnlY8Xbm.js → agent-config-section--zfrJO8b.js} +1 -1
  92. package/web/dist/assets/{agent-defaults-section-CTqsSyJl.js → agent-defaults-section-Cu3gS_Jo.js} +1 -1
  93. package/web/dist/assets/{appearance-n_gwtyLp.js → appearance-DUefmqo9.js} +1 -1
  94. package/web/dist/assets/{archive-on-merge-field-DERpOUSW.js → archive-on-merge-field-Do2X4sBM.js} +1 -1
  95. package/web/dist/assets/attention-BHlvWUvR.js +1 -0
  96. package/web/dist/assets/{automations-route-0LAhg_x5.js → automations-route-BVFd7SeR.js} +1 -1
  97. package/web/dist/assets/{commit-list-CadGnHIA.js → commit-list-okUEljEG.js} +1 -1
  98. package/web/dist/assets/{diff-controls-xM4G82ba.js → diff-controls-CRJ2Qfbb.js} +1 -1
  99. package/web/dist/assets/{diff-CBzW3VnD.js → diff-o-UDJ2RE.js} +2 -2
  100. package/web/dist/assets/{diff-view-CsOtiJCz.js → diff-view-D4yGYS9C.js} +1 -1
  101. package/web/dist/assets/{discard-changes-dialog-CNqUNfUn.js → discard-changes-dialog-uHeDnRFZ.js} +1 -1
  102. package/web/dist/assets/{file-preview-19dGBVJX.js → file-preview-B37EVTqv.js} +1 -1
  103. package/web/dist/assets/{folder-browser-TThsZhk0.js → folder-browser-BF7yByS9.js} +1 -1
  104. package/web/dist/assets/{git-toolbar-DBujlKow.js → git-toolbar-DKZehSdA.js} +1 -1
  105. package/web/dist/assets/{github-ZwURT9M2.js → github-DmB9tnIb.js} +1 -1
  106. package/web/dist/assets/{global-activity-route-CIVosoix.js → global-activity-route-BkDu06si.js} +1 -1
  107. package/web/dist/assets/index-BI3glGOM.js +21 -0
  108. package/web/dist/assets/label-CR3x1nrW.js +1 -0
  109. package/web/dist/assets/{markdown-LhFEpE4H.js → markdown-DIvVclXt.js} +1 -1
  110. package/web/dist/assets/{open-in-menu-BMkr5oG0.js → open-in-menu-Bc0mf1Q8.js} +1 -1
  111. package/web/dist/assets/{option-select-Da93ehWa.js → option-select-jRSeVdmG.js} +1 -1
  112. package/web/dist/assets/{preferences-section-B61tMP9F.js → preferences-section-B8cufiat.js} +1 -1
  113. package/web/dist/assets/{preview-pane-connected-Ck1twV31.js → preview-pane-connected-ciRgTMV4.js} +1 -1
  114. package/web/dist/assets/{project-location-BxI-ZznW.js → project-location-BcmeWSjQ.js} +1 -1
  115. package/web/dist/assets/{project-router-C9kvPm0I.js → project-router-BmHj3sRY.js} +1 -1
  116. package/web/dist/assets/{projects-section-DmTebwNS.js → projects-section-B4JJuB75.js} +1 -1
  117. package/web/dist/assets/{prompt-templates-section-DEW2ZnZN.js → prompt-templates-section-bovd2ULK.js} +1 -1
  118. package/web/dist/assets/queries-C7Ps3qgO.js +1 -0
  119. package/web/dist/assets/{reference-chip-BKBFx58a.js → reference-chip-D0zVVSpi.js} +1 -1
  120. package/web/dist/assets/{remote-settings-notice-VMKnQhpL.js → remote-settings-notice-TR1fwO0C.js} +1 -1
  121. package/web/dist/assets/{repo-git-C5psU7Pd.js → repo-git-ER2cNas6.js} +1 -1
  122. package/web/dist/assets/{report-reader-8cCY5bW-.js → report-reader-BxBnRfHb.js} +1 -1
  123. package/web/dist/assets/{report-selection-Bh4oD7_H.js → report-selection-D73fe0ma.js} +1 -1
  124. package/web/dist/assets/{reports-Kg2iWyJ-.js → reports-jiSmLK1M.js} +1 -1
  125. package/web/dist/assets/{resources-section-C53gZAXt.js → resources-section-BHBw18Kd.js} +1 -1
  126. package/web/dist/assets/{review-panel-MYGp4HC0.js → review-panel-DA2YgxkG.js} +1 -1
  127. package/web/dist/assets/{run-detail-refresh-DunSTM2R.js → run-detail-refresh-B4MGFY0x.js} +1 -1
  128. package/web/dist/assets/{run-header-C4vK0P6B.js → run-header-BBsXrvF4.js} +1 -1
  129. package/web/dist/assets/{select-DXc-QPv8.js → select-SNjNDDvi.js} +1 -1
  130. package/web/dist/assets/{session-context-section-D3-UzL9i.js → session-context-section-DJpLtLRJ.js} +1 -1
  131. package/web/dist/assets/{settings-agent-picker-CoEypfgX.js → settings-agent-picker-CC0ojY-I.js} +1 -1
  132. package/web/dist/assets/{settings-save-bar-DcWNDjHM.js → settings-save-bar-DDH5LZnC.js} +1 -1
  133. package/web/dist/assets/{settings-shell-CgnhBNeW.js → settings-shell-DrBSckNn.js} +1 -1
  134. package/web/dist/assets/{sidebar-section-C2OqOS5F.js → sidebar-section-BTjcF-KU.js} +1 -1
  135. package/web/dist/assets/{skills-qgUk6jpv.js → skills-D7qOIuFK.js} +1 -1
  136. package/web/dist/assets/{tab-link-BAAxhYEU.js → tab-link-xESwYBsl.js} +1 -1
  137. package/web/dist/assets/{task-changes-DotOEkRZ.js → task-changes-CKfPnOaO.js} +1 -1
  138. package/web/dist/assets/{task-commits-567GPEpw.js → task-commits-BLiq1qsZ.js} +1 -1
  139. package/web/dist/assets/{task-file-scope-DuyZU3G4.js → task-file-scope-C277fbSR.js} +1 -1
  140. package/web/dist/assets/{task-files-BjW6TUBB.js → task-files-cOnEUKs3.js} +1 -1
  141. package/web/dist/assets/{task-github-item-Dhr5xFce.js → task-github-item-J7LFh_Kd.js} +1 -1
  142. package/web/dist/assets/{task-groups-DhYlsi5m.js → task-groups-B7v_DBPP.js} +1 -1
  143. package/web/dist/assets/{task-thread-rYoDnc1T.js → task-thread-BfLYIJZb.js} +1 -1
  144. package/web/dist/assets/{thread-state-B_k1TffK.js → thread-state-ClJxRWSd.js} +1 -1
  145. package/web/dist/assets/toaster-Dw5f80iU.js +4 -0
  146. package/web/dist/assets/{use-hand-to-agent-state-BCazCBg5.js → use-hand-to-agent-state-DBd7nKiU.js} +1 -1
  147. package/web/dist/assets/use-path-bases-BNMkgxOJ.js +1 -0
  148. package/web/dist/assets/use-workspace-config-save-DL2b0h2K.js +1 -0
  149. package/web/dist/assets/{workflows-DTT8SRqH.js → workflows-Clhyfufk.js} +1 -1
  150. package/web/dist/assets/{workspace-tools-C2UU3h3_.js → workspace-tools-ChfTGxIP.js} +1 -1
  151. package/web/dist/assets/{worktrees-section-6bEgqVh9.js → worktrees-section-w-A9RL4F.js} +1 -1
  152. package/web/dist/index.html +12 -12
  153. package/dist/contract/hosts.d.ts +0 -141
  154. package/dist/features/hosts/cli.d.ts +0 -8
  155. package/dist/features/hosts/cli.js +0 -172
  156. package/dist/features/hosts/cli.js.map +0 -1
  157. package/dist/features/hosts/index.d.ts +0 -12
  158. package/dist/features/hosts/index.js +0 -34
  159. package/dist/features/hosts/index.js.map +0 -1
  160. package/dist/features/hosts/registry.d.ts +0 -52
  161. package/dist/features/hosts/registry.js +0 -198
  162. package/dist/features/hosts/registry.js.map +0 -1
  163. package/dist/features/hosts/routes.d.ts +0 -348
  164. package/dist/features/hosts/routes.js +0 -113
  165. package/dist/features/hosts/routes.js.map +0 -1
  166. package/dist/features/hosts/ssh-config.d.ts +0 -9
  167. package/dist/features/hosts/ssh-config.js +0 -59
  168. package/dist/features/hosts/ssh-config.js.map +0 -1
  169. package/dist/server/workspace-identity-routes.d.ts +0 -29
  170. package/dist/server/workspace-identity-routes.js +0 -21
  171. package/dist/server/workspace-identity-routes.js.map +0 -1
  172. package/web/dist/assets/attention-W6-bv4kF.js +0 -1
  173. package/web/dist/assets/index-D103Um8l.js +0 -21
  174. package/web/dist/assets/label-BXrhRQd2.js +0 -1
  175. package/web/dist/assets/queries-DiD4Q1Wu.js +0 -1
  176. package/web/dist/assets/toaster-CVP6q4Vk.js +0 -4
  177. package/web/dist/assets/use-path-bases-Br5NgJFk.js +0 -1
  178. package/web/dist/assets/use-workspace-config-save-DBbFEKc0.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{O as i,Ut as a,k as o,qt as s,un as c}from"./queries-DiD4Q1Wu.js";import{M as l,Rn as u,j as d,n as f,p,u as m,vi as h}from"./toaster-CVP6q4Vk.js";import{h as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as _,K as v,Q as y,R as ee,W as te,X as ne,Z as re,a as b,ct as ie,dt as x,l as ae,lt as oe,mt as se,n as ce,ot as le,rt as S,st as ue,x as de,y as fe}from"./design-icons-QbNMZniQ.js";import{t as C}from"./button-C8jUIs8Q.js";import{i as w,o as pe,r as T,s as me,t as E}from"./dialog-DRZuXvul.js";import{c as D,f as he,u as ge}from"./page-shell-Dky5crRl.js";import{i as O,l as _e,o as ve}from"./skills-pM_PouEs.js";import{t as ye}from"./centered-state-BgSV4e79.js";import{$t as k,Jt as A,Qt as j,Xt as be,Yt as M,Zt as xe,ar as N,bn as Se,en as P,tn as F,w as Ce}from"./index-D103Um8l.js";import{_ as we,a as Te,c as Ee,f as De,g as Oe,h as ke,i as I,m as Ae,n as je,o as Me,p as Ne,r as Pe,t as L,u as Fe}from"./sortable.esm-CAVTYaA3.js";import{t as R}from"./textarea-vEsJAUAV.js";import{t as Ie}from"./option-select-Da93ehWa.js";import{t as Le}from"./discard-changes-dialog-CNqUNfUn.js";var z=e(t(),1);function B(e){let t=[];for(let n of e){if(n.kind===`plugin`||n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Re(e,t){return{id:V(e,t),name:e,skill:e,prompt:`{{task}}`}}function V(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return r}function ze(e,t,n){return{id:V(e,n),[e]:t.trim()}}function H(e){if(!(e.kind===`plugin`||e.skill))return e.command===void 0?e.prompt===void 0?void 0:`prompt`:`command`}function Be(e,t,n){let r=e[t],i=r&&H(r);return!r||!i?[...e]:e.map((e,r)=>r===t?{...e,[i]:n}:e)}function U(e){return e.some(e=>{let t=H(e);return t!==void 0&&!e[t]?.trim()})}function Ve(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function He(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Ue(e,t){return e.filter((e,n)=>n!==t)}function We(e){let t=e.map(e=>e.id),n=e.map(()=>({sources:[]}));return e.forEach((e,r)=>{if(!e.onFail)return;let i=e.onFail.retry,a=e.onFail.max??2,o=t.indexOf(i),s=n[r]?.sources??[];if(o===-1||o>=r){n[r]={link:{kind:o===-1?`missing`:`not-earlier`,target:i,max:a},sources:s};return}n[r]={link:{kind:`ok`,target:i,targetIndex:o,max:a},sources:s},n[o]?.sources.push(r)}),n}function W(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function G(e,t,n){let r=` `.repeat(n);return!t.includes(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{O as i,Ut as a,k as o,qt as s,un as c}from"./queries-C7Ps3qgO.js";import{M as l,Rn as u,j as d,n as f,p,u as m,vi as h}from"./toaster-Dw5f80iU.js";import{h as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as _,K as v,Q as y,R as ee,W as te,X as ne,Z as re,a as b,ct as ie,dt as x,l as ae,lt as oe,mt as se,n as ce,ot as le,rt as S,st as ue,x as de,y as fe}from"./design-icons-QbNMZniQ.js";import{t as C}from"./button-C8jUIs8Q.js";import{i as w,o as pe,r as T,s as me,t as E}from"./dialog-DRZuXvul.js";import{c as D,f as he,u as ge}from"./page-shell-Dky5crRl.js";import{i as O,l as _e,o as ve}from"./skills-pM_PouEs.js";import{t as ye}from"./centered-state-BgSV4e79.js";import{$t as k,Jt as A,Qt as j,Xt as be,Yt as M,Zt as xe,ar as N,bn as Se,en as P,tn as F,w as Ce}from"./index-BI3glGOM.js";import{_ as we,a as Te,c as Ee,f as De,g as Oe,h as ke,i as I,m as Ae,n as je,o as Me,p as Ne,r as Pe,t as L,u as Fe}from"./sortable.esm-CAVTYaA3.js";import{t as R}from"./textarea-vEsJAUAV.js";import{t as Ie}from"./option-select-jRSeVdmG.js";import{t as Le}from"./discard-changes-dialog-uHeDnRFZ.js";var z=e(t(),1);function B(e){let t=[];for(let n of e){if(n.kind===`plugin`||n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Re(e,t){return{id:V(e,t),name:e,skill:e,prompt:`{{task}}`}}function V(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return r}function ze(e,t,n){return{id:V(e,n),[e]:t.trim()}}function H(e){if(!(e.kind===`plugin`||e.skill))return e.command===void 0?e.prompt===void 0?void 0:`prompt`:`command`}function Be(e,t,n){let r=e[t],i=r&&H(r);return!r||!i?[...e]:e.map((e,r)=>r===t?{...e,[i]:n}:e)}function U(e){return e.some(e=>{let t=H(e);return t!==void 0&&!e[t]?.trim()})}function Ve(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function He(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Ue(e,t){return e.filter((e,n)=>n!==t)}function We(e){let t=e.map(e=>e.id),n=e.map(()=>({sources:[]}));return e.forEach((e,r)=>{if(!e.onFail)return;let i=e.onFail.retry,a=e.onFail.max??2,o=t.indexOf(i),s=n[r]?.sources??[];if(o===-1||o>=r){n[r]={link:{kind:o===-1?`missing`:`not-earlier`,target:i,max:a},sources:s};return}n[r]={link:{kind:`ok`,target:i,targetIndex:o,max:a},sources:s},n[o]?.sources.push(r)}),n}function W(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function G(e,t,n){let r=` `.repeat(n);return!t.includes(`
2
2
  `)||/^\s/.test(t)?[`${r}${e}: ${W(t)}`]:[`${r}${e}: |`,...t.split(`
3
3
  `).map(e=>`${r} ${e}`)]}function K(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${W(e.name)}`),e.skill&&t.push(` skill: ${W(e.skill)}`),t}function q(e){let t=[];return e.model&&t.push(` model: ${W(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${W(e.effort)}`),e.runner&&t.push(` runner: ${W(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${W(e.agentProfile)}`),t}function J(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(W).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(W).join(`, `)}]`),t}function Y(e){return e.onFail?[` onFail:`,` retry: ${W(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function Ge(e){return[` - id: ${W(e.id)}`,...K(e),...e.prompt?G(`prompt`,e.prompt,4):[],...e.kind===`plugin`?[` kind: plugin`,` pluginKind: ${W(e.pluginKind)}`,...e.config===void 0?[]:[` config: ${JSON.stringify(e.config)}`]]:[],...q(e),...J(e),...e.command?G(`command`,e.command,4):[],...Y(e)]}function Ke(e,t,n){let r=[`name: ${W(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...G(`description`,t.trim(),0));let i=B(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${W(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...Ge(e))}else r.push(`skills: []`);return`${r.join(`
4
4
  `)}\n`}function qe(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`chain`}function Je(e){let t=B(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Ye(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Xe(e,t,n){let r=B(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var X=n(),Z=[{value:`skill`,label:`Skill`,icon:S},{value:`prompt`,label:`Prompt`,icon:te},{value:`command`,label:`Command`,icon:le}],Q={prompt:{field:`Prompt the agent runs`,placeholder:`Review the change for {{task}}…`,add:`Add prompt step`,blank:`A prompt step needs text.`},command:{field:`Shell command`,placeholder:`npm test`,add:`Add command step`,blank:`A command step needs text.`}};function Ze({kind:e,onKindChange:t}){return(0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":`Step kind`,"data-slot":`wb-add-kind`,className:`grid grid-cols-3 gap-0.5 rounded-lg border border-border bg-muted/60 p-1 sm:inline-flex sm:w-fit`,children:Z.map(n=>(0,X.jsxs)(`label`,{className:r(`flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-md border border-transparent px-2 py-1.5 sm:px-3 text-[13px] font-medium transition-colors has-[:focus-visible]:outline-2`,e===n.value?`border-border bg-card text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(`input`,{type:`radio`,name:`workflow-add-kind`,className:`sr-only`,value:n.value,checked:e===n.value,onChange:()=>t(n.value)}),(0,X.jsx)(n.icon,{"aria-hidden":`true`,className:`size-3.5 max-sm:hidden`}),n.label]},n.value))})}function Qe({query:e,onQueryChange:t,matches:n,skillsCount:r,error:i,selectedSkill:a,onSelectSkill:o}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(N,{"aria-label":`Filter skills`,placeholder:`Filter skills…`,value:e,onChange:e=>t(e.target.value)}),i===null?(0,X.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Available skills`,className:`grid max-h-80 gap-2 overflow-y-auto`,children:[n.map(e=>(0,X.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-lg py-2 has-[:checked]:bg-accent-strong/10 has-[:focus-visible]:outline-2`,children:[(0,X.jsx)(`input`,{type:`radio`,name:`workflow-add-skill`,className:`sr-only`,value:e.id,checked:a===e.id,onChange:()=>o(e.id)}),(0,X.jsxs)(`span`,{className:`min-w-0 break-words text-sm`,children:[(0,X.jsx)(`span`,{className:`block`,children:e.name}),(0,X.jsx)(`span`,{className:`mt-2 block text-xs text-muted-foreground`,children:e.description}),e.path?(0,X.jsx)(`span`,{className:`block break-all text-xs`,children:e.path}):null]})]},JSON.stringify([e.id,e.path]))),n.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r===0?`No skills available in this project.`:`No matching skills.`}):null]}):(0,X.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not load skills: `,i]}),e.trim()&&!n.some(t=>t.id===e.trim())?(0,X.jsxs)(C,{onClick:()=>o(e.trim()),children:[`Use skill id “`,e.trim(),`” (unchecked)`]}):null]})}function $e({open:e,onOpenChange:t,kind:n,onKindChange:i,text:a,onTextChange:o,stepsCount:s,onCloseAutoFocus:c,onCancel:l,onAdd:u,onAddText:d,...f}){let p=s>=8,m=f.selectedSkill;return(0,X.jsx)(E,{open:e,onOpenChange:t,children:(0,X.jsxs)(T,{"data-slot":`wb-add-dialog`,onCloseAutoFocus:c,className:`max-h-[85dvh] overflow-y-auto sm:max-w-[660px] [&_button]:min-h-11`,children:[(0,X.jsxs)(pe,{children:[(0,X.jsx)(me,{className:`text-xl font-normal`,children:`Add step`}),(0,X.jsx)(w,{className:`sr-only`,children:`Choose a skill, write a prompt or a shell command to append to this workflow.`})]}),(0,X.jsx)(Ze,{kind:n,onKindChange:i}),n===`skill`?(0,X.jsx)(Qe,{...f}):(0,X.jsx)(R,{"aria-label":Q[n].field,placeholder:Q[n].placeholder,value:a,rows:4,className:r(n===`command`&&`font-mono`),onChange:e=>o(e.target.value)}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,X.jsx)(C,{variant:`outline`,onClick:l,children:`Cancel`}),n===`skill`?(0,X.jsx)(C,{variant:`primary`,disabled:!m||p,onClick:()=>{m&&u(m)},children:`Add selected skill`}):(0,X.jsx)(C,{variant:`primary`,disabled:!a.trim()||p,onClick:()=>d(n,a),children:Q[n].add})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Append the new step, then reorder it in the existing canvas.`}),p?(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[`A workflow can contain up to `,8,` steps. Remove a step before adding another.`]}):null]})})}function et({kind:e,text:t,index:n,editing:i,onTextChange:a}){let o=(0,z.useId)(),s=!t.trim();return(0,X.jsxs)(X.Fragment,{children:[i?(0,X.jsx)(R,{"data-slot":`wb-step-text`,"aria-label":`Step ${n+1} ${e}`,"aria-invalid":s||void 0,"aria-describedby":s?o:void 0,value:t,rows:3,className:r(`mt-2`,e===`command`&&`font-mono`),onChange:e=>a(e.target.value)}):null,s?(0,X.jsx)(`p`,{id:o,"data-slot":`wb-step-text-error`,className:`mt-1 text-xs text-danger`,children:Q[e].blank}):null]})}function tt({kind:e,index:t,editing:n,onEditingChange:r}){return(0,X.jsxs)(C,{variant:`outline`,size:`sm`,className:`min-h-11`,"data-slot":`wb-step-edit`,"aria-label":n?`Done editing step ${t+1}`:`Edit ${e} of step ${t+1}`,"aria-expanded":n,onClick:()=>r(!n),children:[n?(0,X.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}):(0,X.jsx)(v,{"aria-hidden":`true`,className:`size-4`}),n?`Done`:`Edit ${e}`]})}function nt({workflows:e,trimmedName:t,onLoadWorkflow:n}){return(0,X.jsx)(Ie,{id:`workflow-load`,"data-slot":`wb-load-picker`,"data-page-shell-action":``,"aria-label":`Workflow`,value:e.some(e=>e.name===t)?t:``,placeholder:`Choose a workflow`,onValueChange:t=>{let r=e.find(e=>e.name===t);r&&n(r)},options:e.map(e=>({value:e.name,label:e.name})),className:`w-56 max-w-full min-w-0 border-border bg-card font-medium text-foreground max-md:w-full`})}function rt({draft:e,trimmedName:t,nameRef:n,onDraft:r,renamedFrom:i}){return(0,X.jsxs)(`section`,{"data-slot":`wb-details`,"data-reports-dirty":``,className:`flex min-w-0 flex-col gap-3`,children:[(0,X.jsxs)(`div`,{"data-slot":`wb-details-line`,className:`grid min-w-0 gap-1.5 @xl:grid-cols-[96px_minmax(0,1fr)] @xl:items-center @xl:gap-x-3`,children:[(0,X.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-medium text-foreground`,children:`Name`}),(0,X.jsx)(N,{id:`workflow-name`,ref:n,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:e.name,"aria-describedby":i===void 0?void 0:`workflow-rename-note`,onChange:t=>r({...e,name:t.target.value}),className:`h-10 bg-card text-sm max-md:h-11 @xl:max-w-sm`}),(0,X.jsx)(`p`,{id:`workflow-rename-note`,"aria-live":`polite`,className:`text-xs text-muted-foreground empty:hidden @xl:col-start-2`,children:i===void 0?null:(0,X.jsxs)(`span`,{"data-slot":`wb-rename-note`,children:[`Saving creates a new workflow “`,t,`”. “`,i,`” stays as it is.`]})})]}),(0,X.jsxs)(`div`,{"data-slot":`wb-details-line`,className:`grid min-w-0 gap-1.5 @xl:grid-cols-[96px_minmax(0,1fr)] @xl:items-center @xl:gap-x-3`,children:[(0,X.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-medium text-foreground`,children:`Description`}),(0,X.jsx)(R,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,rows:1,placeholder:`What this workflow does`,value:e.description,onChange:t=>r({...e,description:t.target.value}),className:`min-h-10 w-full bg-card px-3 py-2 text-sm max-md:min-h-11`})]})]})}function it({savedFile:e,autoOpen:t,onImportToggle:n,onExport:r,onAutoToggle:i,onDeleteRequest:a}){return(0,X.jsxs)(`div`,{"data-slot":`wb-actions`,className:`contents`,children:[(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-import`,onClick:n,children:[(0,X.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),`Import`]}),(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-export`,title:`Download workflow.yaml`,onClick:r,children:[(0,X.jsx)(de,{"aria-hidden":`true`,className:`size-4`}),`Export`]}),(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-auto`,"aria-expanded":t,"aria-describedby":`wb-auto-hint`,title:`Auto-build: describe the chain in words and an agent drafts its steps for you to review`,onClick:i,children:[(0,X.jsx)(x,{"aria-hidden":`true`,className:`size-4`}),`Auto-build`]}),(0,X.jsx)(`span`,{id:`wb-auto-hint`,className:`sr-only`,children:`Describe the chain in words and an agent drafts its steps for you to review.`}),e?(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-delete`,className:`text-danger hover:text-danger`,title:`Delete the saved workflow file`,onClick:a,children:[(0,X.jsx)(ue,{"aria-hidden":`true`,className:`size-4`}),`Delete`]}):null]})}function at({text:e,onTextChange:t,pending:n,onRun:r,onCancel:i}){return(0,X.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,X.jsx)(`p`,{className:`mt-4 text-[13px] leading-relaxed text-muted-foreground`,children:`Describe the outcome. An agent proposes a title and ordered skill/check steps. Review the result, edit it, then Save.`}),(0,X.jsx)(R,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),r())},className:`mt-4 min-h-[108px] bg-background p-4 text-sm`}),(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,X.jsxs)(C,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:n||e.trim()===``,onClick:r,children:[(0,X.jsx)(x,{"aria-hidden":`true`,className:`size-3`}),n?`Building…`:`Build chain`]}),(0,X.jsxs)(C,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:i,children:[(0,X.jsx)(se,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,X.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function ot({open:e,onOpenChange:t,text:n,onTextChange:r,error:i,pending:a,onRun:o,onCancel:s}){return(0,X.jsx)(E,{open:e,onOpenChange:t,children:(0,X.jsxs)(T,{showCloseButton:!1,"data-slot":`wb-import-panel`,className:`max-md:translate-x-0 max-md:translate-y-0 sm:max-w-[660px] rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,X.jsx)(me,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,X.jsx)(w,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,X.jsx)(R,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,Zt as i,nn as a,vt as o,xt as s}from"./queries-DiD4Q1Wu.js";import{n as c}from"./toaster-CVP6q4Vk.js";import{n as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./external-link-BE6y205O.js";import{t as f}from"./button-C8jUIs8Q.js";import{t as p}from"./status-dot-BXf-Ubd0.js";import{f as m,o as h}from"./page-shell-Dky5crRl.js";import{t as g}from"./agents-settings-path-7X6_cvUg.js";import{In as _,Rn as v,ir as y,nn as b,nr as x,or as S,rn as C}from"./index-D103Um8l.js";var w=e(t(),1),T=n();function E(e){let t=e.replace(/\binstall\b/g,(e,t)=>t===0?`Install`:e),n=t.split(/(`[^`]+`)/g);if(n.length===1){let e=t.split(/(\bgh auth login\b)/g);return e.length===1?t:e.map((e,t)=>e===`gh auth login`?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e},t):(0,T.jsx)(`span`,{children:e},t))}return n.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.slice(1,-1)},t):e?(0,T.jsx)(`span`,{children:e},t):null)}function D(e,t){let n=i(t,e);return n?{label:n.displayName,isAgent:!0}:{label:e,isAgent:!1}}function O({mode:e,version:t,rawVersion:n}){return e?(0,T.jsx)(`span`,{"data-slot":`tool-dry-run`,title:n,className:`shrink-0 rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:e.label}):t?(0,T.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`· `,t]}):null}var k=`h-8 text-xs font-medium max-md:h-11 no-hover:h-11`;function A({projectsDir:e,home:t,onAction:n}){return(0,T.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-card-edge bg-card px-6 py-4 shadow-card max-md:px-4`,"aria-labelledby":`projects-heading`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h2`,{id:`projects-heading`,className:`text-sm font-semibold text-foreground`,children:`Projects`}),(0,T.jsx)(`p`,{className:`mt-0.5 text-[13px] leading-[1.5] text-muted-foreground`,children:`Start a repository, open a local folder, or clone from GitHub.`})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,"data-action":`new-project`,onClick:()=>n(`new`),children:`New project`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`local`),children:`Open local folder`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`clone`),children:`Clone from GitHub`})]})]}),e?(0,T.jsxs)(`p`,{"data-slot":`projects-checkout`,className:`flex min-w-0 items-baseline gap-1.5 text-xs text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:`New clones go to`}),(0,T.jsx)(v,{value:e,bases:{home:t,root:null},className:`text-foreground`})]}):null]})}function j({recovery:e}){let t=`${k} ml-auto`;return e.kind===`settings`?(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(l,{to:e.to,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})}):(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(d,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,T.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]})})}function M({health:e,runners:t,copying:n,onCopy:r,recheckStatus:i,onRecheck:a}){return(0,T.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-card-edge bg-card p-6 shadow-card max-md:p-4`,"aria-labelledby":`tools-heading`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{id:`tools-heading`,className:`text-base font-semibold text-foreground`,children:`Tools diagnostics`}),(0,T.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Check the tools available to this local workspace.`})]}),(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:k,children:(0,T.jsxs)(l,{to:g,"data-slot":`tools-settings`,children:[`Tool settings`,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),e.isError?(0,T.jsx)(`p`,{role:`alert`,className:`text-sm text-semantic-red`,children:`Could not refresh tool diagnostics. Recheck to retry.`}):null,!e.data&&!e.isError?(0,T.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Checking installed tools…`}):null,e.data?(0,T.jsx)(`dl`,{className:`divide-y divide-border border-y border-border text-[13px] leading-[1.5] text-muted-foreground`,children:e.data.checks.map(e=>{let n=b(e),r=D(e.name,t),i=_(e),a=C(e,t);return(0,T.jsxs)(`div`,{"data-slot":`tool-row`,"data-tool":e.name,"data-available":e.available,className:`grid grid-cols-1 gap-x-4 gap-y-1 py-3 sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center`,children:[(0,T.jsxs)(`dt`,{className:`flex items-center gap-2.5`,children:[(0,T.jsx)(p,{tone:i.availability.tone,shape:i.availability.shape}),(0,T.jsx)(`span`,{className:r.isAgent?`text-[14px] font-semibold text-foreground`:`font-mono text-[13px] font-semibold text-foreground`,children:r.label})]}),(0,T.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-x-1.5 text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:i.availability.label}),(0,T.jsx)(O,{mode:i.mode,version:i.version,rawVersion:i.rawVersion}),a?(0,T.jsx)(j,{recovery:a}):null]}),n?(0,T.jsx)(`dd`,{"data-slot":`tool-hint`,className:`min-w-0 break-words text-xs leading-relaxed text-muted-foreground sm:col-start-2`,children:E(n)}):null]},e.name)})}):null,e.data?.checks.length===0?(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tool diagnostics reported by this server.`}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:e.isFetching,onClick:()=>void a(),children:e.isFetching?`Checking tools…`:`Recheck tools`}),(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:!e.data||n,onClick:()=>void r(),children:n?`Copying…`:`Copy diagnostics`}),(0,T.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-xs text-muted-foreground`,children:i?(0,T.jsx)(`span`,{"data-slot":`recheck-status`,children:i}):null})]})]})}function N(e,t){let n=e.filter(e=>e.available).length;return`Rechecked at ${t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})} — ${n} of ${e.length} ${e.length===1?`tool`:`tools`} available.`}function P(){let e=o(),t=s().data?.projectsDir,n=r().data?.homeDir??null,i=a().data,[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(!1),[p,g]=(0,w.useState)(null),_=async()=>{g(null);let t=await e.refetch();t.isError||!t.data||g(N(t.data.checks,new Date))},v=async()=>{if(!(!e.data||d)){f(!0);try{await navigator.clipboard.writeText(JSON.stringify({version:e.data.version,checks:e.data.checks},null,2)),c(`Diagnostics copied`)}catch{c(`Could not copy diagnostics. Please try again.`,{tone:`danger`})}finally{f(!1)}}},b=e.data?.checks.length??4;return(0,T.jsxs)(h,{route:`workspace-tools`,density:e.data?m(b):`full`,bodyClassName:`gap-5`,header:{title:`Workspace tools`,subtitle:`Check local CLI tools, then add projects.`},children:[(0,T.jsx)(M,{health:e,runners:i,copying:d,onCopy:v,recheckStatus:p,onRecheck:_}),(0,T.jsx)(A,{projectsDir:t,home:n,onAction:u}),l===`new`?(0,T.jsx)(x,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`local`?(0,T.jsx)(S,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`clone`?(0,T.jsx)(y,{open:!0,onOpenChange:e=>{e||u(null)}}):null]})}export{P as WorkspaceToolsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,Zt as i,nn as a,vt as o,xt as s}from"./queries-C7Ps3qgO.js";import{n as c}from"./toaster-Dw5f80iU.js";import{n as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./external-link-BE6y205O.js";import{t as f}from"./button-C8jUIs8Q.js";import{t as p}from"./status-dot-BXf-Ubd0.js";import{f as m,o as h}from"./page-shell-Dky5crRl.js";import{t as g}from"./agents-settings-path-7X6_cvUg.js";import{In as _,Rn as v,ir as y,nn as b,nr as x,or as S,rn as C}from"./index-BI3glGOM.js";var w=e(t(),1),T=n();function E(e){let t=e.replace(/\binstall\b/g,(e,t)=>t===0?`Install`:e),n=t.split(/(`[^`]+`)/g);if(n.length===1){let e=t.split(/(\bgh auth login\b)/g);return e.length===1?t:e.map((e,t)=>e===`gh auth login`?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e},t):(0,T.jsx)(`span`,{children:e},t))}return n.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.slice(1,-1)},t):e?(0,T.jsx)(`span`,{children:e},t):null)}function D(e,t){let n=i(t,e);return n?{label:n.displayName,isAgent:!0}:{label:e,isAgent:!1}}function O({mode:e,version:t,rawVersion:n}){return e?(0,T.jsx)(`span`,{"data-slot":`tool-dry-run`,title:n,className:`shrink-0 rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:e.label}):t?(0,T.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`· `,t]}):null}var k=`h-8 text-xs font-medium max-md:h-11 no-hover:h-11`;function A({projectsDir:e,home:t,onAction:n}){return(0,T.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-card-edge bg-card px-6 py-4 shadow-card max-md:px-4`,"aria-labelledby":`projects-heading`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h2`,{id:`projects-heading`,className:`text-sm font-semibold text-foreground`,children:`Projects`}),(0,T.jsx)(`p`,{className:`mt-0.5 text-[13px] leading-[1.5] text-muted-foreground`,children:`Start a repository, open a local folder, or clone from GitHub.`})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,"data-action":`new-project`,onClick:()=>n(`new`),children:`New project`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`local`),children:`Open local folder`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`clone`),children:`Clone from GitHub`})]})]}),e?(0,T.jsxs)(`p`,{"data-slot":`projects-checkout`,className:`flex min-w-0 items-baseline gap-1.5 text-xs text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:`New clones go to`}),(0,T.jsx)(v,{value:e,bases:{home:t,root:null},className:`text-foreground`})]}):null]})}function j({recovery:e}){let t=`${k} ml-auto`;return e.kind===`settings`?(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(l,{to:e.to,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})}):(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(d,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,T.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]})})}function M({health:e,runners:t,copying:n,onCopy:r,recheckStatus:i,onRecheck:a}){return(0,T.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-card-edge bg-card p-6 shadow-card max-md:p-4`,"aria-labelledby":`tools-heading`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{id:`tools-heading`,className:`text-base font-semibold text-foreground`,children:`Tools diagnostics`}),(0,T.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Check the tools available to this local workspace.`})]}),(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:k,children:(0,T.jsxs)(l,{to:g,"data-slot":`tools-settings`,children:[`Tool settings`,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),e.isError?(0,T.jsx)(`p`,{role:`alert`,className:`text-sm text-semantic-red`,children:`Could not refresh tool diagnostics. Recheck to retry.`}):null,!e.data&&!e.isError?(0,T.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Checking installed tools…`}):null,e.data?(0,T.jsx)(`dl`,{className:`divide-y divide-border border-y border-border text-[13px] leading-[1.5] text-muted-foreground`,children:e.data.checks.map(e=>{let n=b(e),r=D(e.name,t),i=_(e),a=C(e,t);return(0,T.jsxs)(`div`,{"data-slot":`tool-row`,"data-tool":e.name,"data-available":e.available,className:`grid grid-cols-1 gap-x-4 gap-y-1 py-3 sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center`,children:[(0,T.jsxs)(`dt`,{className:`flex items-center gap-2.5`,children:[(0,T.jsx)(p,{tone:i.availability.tone,shape:i.availability.shape}),(0,T.jsx)(`span`,{className:r.isAgent?`text-[14px] font-semibold text-foreground`:`font-mono text-[13px] font-semibold text-foreground`,children:r.label})]}),(0,T.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-x-1.5 text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:i.availability.label}),(0,T.jsx)(O,{mode:i.mode,version:i.version,rawVersion:i.rawVersion}),a?(0,T.jsx)(j,{recovery:a}):null]}),n?(0,T.jsx)(`dd`,{"data-slot":`tool-hint`,className:`min-w-0 break-words text-xs leading-relaxed text-muted-foreground sm:col-start-2`,children:E(n)}):null]},e.name)})}):null,e.data?.checks.length===0?(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tool diagnostics reported by this server.`}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:e.isFetching,onClick:()=>void a(),children:e.isFetching?`Checking tools…`:`Recheck tools`}),(0,T.jsx)(f,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:!e.data||n,onClick:()=>void r(),children:n?`Copying…`:`Copy diagnostics`}),(0,T.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-xs text-muted-foreground`,children:i?(0,T.jsx)(`span`,{"data-slot":`recheck-status`,children:i}):null})]})]})}function N(e,t){let n=e.filter(e=>e.available).length;return`Rechecked at ${t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})} — ${n} of ${e.length} ${e.length===1?`tool`:`tools`} available.`}function P(){let e=o(),t=s().data?.projectsDir,n=r().data?.homeDir??null,i=a().data,[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(!1),[p,g]=(0,w.useState)(null),_=async()=>{g(null);let t=await e.refetch();t.isError||!t.data||g(N(t.data.checks,new Date))},v=async()=>{if(!(!e.data||d)){f(!0);try{await navigator.clipboard.writeText(JSON.stringify({version:e.data.version,checks:e.data.checks},null,2)),c(`Diagnostics copied`)}catch{c(`Could not copy diagnostics. Please try again.`,{tone:`danger`})}finally{f(!1)}}},b=e.data?.checks.length??4;return(0,T.jsxs)(h,{route:`workspace-tools`,density:e.data?m(b):`full`,bodyClassName:`gap-5`,header:{title:`Workspace tools`,subtitle:`Check local CLI tools, then add projects.`},children:[(0,T.jsx)(M,{health:e,runners:i,copying:d,onCopy:v,recheckStatus:p,onRecheck:_}),(0,T.jsx)(A,{projectsDir:t,home:n,onAction:u}),l===`new`?(0,T.jsx)(x,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`local`?(0,T.jsx)(S,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`clone`?(0,T.jsx)(y,{open:!0,onOpenChange:e=>{e||u(null)}}):null]})}export{P as WorkspaceToolsRoute};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ut as r,g as i,un as a,vt as o}from"./queries-DiD4Q1Wu.js";import{Br as s,I as c,Rn as l,n as u,vi as d,zr as f}from"./toaster-CVP6q4Vk.js";import{d as p}from"./design-icons-QbNMZniQ.js";import{t as m}from"./project-router-C9kvPm0I.js";import{t as h}from"./centered-state-BgSV4e79.js";import{pr as g}from"./index-D103Um8l.js";import{n as _,r as v,t as y}from"./remote-settings-notice-VMKnQhpL.js";import{n as b}from"./settings-field-Bhh8I9fJ.js";import{n as x}from"./project-location-BxI-ZznW.js";import{r as S}from"./settings-save-bar-DcWNDjHM.js";import{n as C}from"./saved-draft-BwzBc-_Y.js";var w=e(t(),1),T=n();function E({copy:e,savedCommandCount:t,settingsAdmin:n,configPath:r,issue:i,invalid:a,children:o}){let s=e.slot;return(0,T.jsxs)(T.Fragment,{children:[t===0&&i===null?(0,T.jsx)(`p`,{"data-slot":`${s}-empty`,className:`text-xs text-muted-foreground`,children:e.empty}):null,o,n===!1?(0,T.jsxs)(`p`,{"data-slot":`${s}-readonly`,className:`text-xs text-foreground`,children:[`Edit `,(0,T.jsxs)(`code`,{children:[e.key,`.commands`]}),` in`,` `,r===null?(0,T.jsxs)(T.Fragment,{children:[`the project’s `,(0,T.jsx)(`code`,{children:`.ai/cezar/config.json`})]}):(0,T.jsx)(`code`,{className:`break-all`,children:r}),` `,`on the machine running Squawk. `,e.fileEditApplies,` No restart is needed. To edit here, the host operator runs `,(0,T.jsx)(`code`,{children:y}),`.`]}):null,i===null?null:(0,T.jsxs)(`p`,{"data-slot":`${s}-issue`,className:`text-xs text-danger`,children:[`config.json has an invalid `,e.key,` (`,i,`) — saving replaces it.`]}),a===null?null:(0,T.jsx)(`p`,{"data-slot":`${s}-invalid`,className:`text-xs text-danger`,children:a})]})}function D(e,t){let n=e.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ut as r,g as i,un as a,vt as o}from"./queries-C7Ps3qgO.js";import{Br as s,I as c,Rn as l,n as u,vi as d,zr as f}from"./toaster-Dw5f80iU.js";import{d as p}from"./design-icons-QbNMZniQ.js";import{t as m}from"./project-router-BmHj3sRY.js";import{t as h}from"./centered-state-BgSV4e79.js";import{pr as g}from"./index-BI3glGOM.js";import{n as _,r as v,t as y}from"./remote-settings-notice-TR1fwO0C.js";import{n as b}from"./settings-field-Bhh8I9fJ.js";import{n as x}from"./project-location-BcmeWSjQ.js";import{r as S}from"./settings-save-bar-DDH5LZnC.js";import{n as C}from"./saved-draft-BwzBc-_Y.js";var w=e(t(),1),T=n();function E({copy:e,savedCommandCount:t,settingsAdmin:n,configPath:r,issue:i,invalid:a,children:o}){let s=e.slot;return(0,T.jsxs)(T.Fragment,{children:[t===0&&i===null?(0,T.jsx)(`p`,{"data-slot":`${s}-empty`,className:`text-xs text-muted-foreground`,children:e.empty}):null,o,n===!1?(0,T.jsxs)(`p`,{"data-slot":`${s}-readonly`,className:`text-xs text-foreground`,children:[`Edit `,(0,T.jsxs)(`code`,{children:[e.key,`.commands`]}),` in`,` `,r===null?(0,T.jsxs)(T.Fragment,{children:[`the project’s `,(0,T.jsx)(`code`,{children:`.ai/cezar/config.json`})]}):(0,T.jsx)(`code`,{className:`break-all`,children:r}),` `,`on the machine running Squawk. `,e.fileEditApplies,` No restart is needed. To edit here, the host operator runs `,(0,T.jsx)(`code`,{children:y}),`.`]}):null,i===null?null:(0,T.jsxs)(`p`,{"data-slot":`${s}-issue`,className:`text-xs text-danger`,children:[`config.json has an invalid `,e.key,` (`,i,`) — saving replaces it.`]}),a===null?null:(0,T.jsx)(`p`,{"data-slot":`${s}-invalid`,className:`text-xs text-danger`,children:a})]})}function D(e,t){let n=e.split(`
2
2
  `).map(e=>e.trim()).filter(e=>e!==``),r=Number(t);return{commands:n,timeoutSeconds:r,invalid:n.length>20?`Enter at most 20 commands.`:n.some(e=>e.length>4e3)?`Keep each command under ${f.toLocaleString(`en-US`)} characters.`:t.trim()===``||!Number.isInteger(r)||r<1||r>7200?`Enter a whole number of seconds from 1 to ${s}.`:null}}var O={setup:{key:`worktreeSetup`,issueKey:`worktreeSetupIssue`,slot:`worktree-setup`,title:`Prepare new worktrees`,hint:`Runs in order in every new task and worker worktree before the agent starts. The first failure stops setup.`,empty:`No setup commands configured. No commands will run in new worktrees.`,label:`Worktree setup commands, one per line`,example:`npm ci`,fileEditApplies:`Valid file edits apply to new worktrees.`},teardown:{key:`worktreeTeardown`,issueKey:`worktreeTeardownIssue`,slot:`worktree-teardown`,title:`Stop worker services before destroy`,hint:`Runs in order in a worker’s worktree when the worker is destroyed, before its processes stop. The first failure stops teardown; destroy goes on and records it on the worker.`,empty:`No teardown commands configured. Destroy runs no commands in worker worktrees.`,label:`Worktree teardown commands, one per line`,example:`docker compose down`,fileEditApplies:`Valid file edits apply to the next worker destroy.`}};function k(e,t){return t?`One command per line, for example: ${e.example}`:void 0}function A({config:e,copy:t}){let n=d(),i=o(),f=v(),p=x(),m=p===null?null:`${p.replace(/\/$/,``)}/.ai/cezar/config.json`,h=i.data?.capabilities?.settingsAdmin===!0,g=e[t.key],y=e[t.issueKey],O=g?.commands??[],A=g?.timeoutSeconds??900,[j,M]=C(O.join(`
3
3
  `)),[N,P]=C(String(A)),{commands:F,timeoutSeconds:I,invalid:L}=D(j,N),R=F.length===O.length&&F.every((e,t)=>e===O[t])&&(F.length===0||I===A),z=a({mutationFn:e=>c(e),onSuccess:e=>{n.setQueryData(r.config,e),M(F.join(`
4
4
  `))},onError:e=>{u(e.message,{tone:`danger`}),e instanceof l&&e.status===409&&f()}}),B=()=>z.mutateAsync({[t.key]:F.length===0?null:{commands:F,...I===900?{}:{timeoutSeconds:I}}}),[V,H]=(0,w.useState)(null);S({dirty:h&&(y!==null&&y!==V||!R),holdsReload:h&&!R,invalid:L!==null,save:B,discard:()=>{M(O.join(`
@@ -59,27 +59,27 @@
59
59
  }
60
60
  })()
61
61
  </script>
62
- <script type="module" crossorigin src="/assets/index-D103Um8l.js"></script>
62
+ <script type="module" crossorigin src="/assets/index-BI3glGOM.js"></script>
63
63
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
64
64
  <link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
65
65
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-rHxsej31.js">
66
66
  <link rel="modulepreload" crossorigin href="/assets/dist-C_rn70hE.js">
67
67
  <link rel="modulepreload" crossorigin href="/assets/live-protocol-DMhTnCmf.js">
68
- <link rel="modulepreload" crossorigin href="/assets/toaster-CVP6q4Vk.js">
69
- <link rel="modulepreload" crossorigin href="/assets/queries-DiD4Q1Wu.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/toaster-Dw5f80iU.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/queries-C7Ps3qgO.js">
70
70
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
71
71
  <link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-Cg8l-LDN.js">
72
72
  <link rel="modulepreload" crossorigin href="/assets/cez-idle-CdswdDRd.js">
73
- <link rel="modulepreload" crossorigin href="/assets/run-detail-refresh-DunSTM2R.js">
73
+ <link rel="modulepreload" crossorigin href="/assets/run-detail-refresh-B4MGFY0x.js">
74
74
  <link rel="modulepreload" crossorigin href="/assets/es2015-CUEfzDjB.js">
75
- <link rel="modulepreload" crossorigin href="/assets/label-BXrhRQd2.js">
75
+ <link rel="modulepreload" crossorigin href="/assets/label-CR3x1nrW.js">
76
76
  <link rel="modulepreload" crossorigin href="/assets/design-icons-QbNMZniQ.js">
77
77
  <link rel="modulepreload" crossorigin href="/assets/dist-BuF3mvCA.js">
78
78
  <link rel="modulepreload" crossorigin href="/assets/dist-DudPJH39.js">
79
79
  <link rel="modulepreload" crossorigin href="/assets/popover-CvL6hQ5c.js">
80
- <link rel="modulepreload" crossorigin href="/assets/attention-W6-bv4kF.js">
81
- <link rel="modulepreload" crossorigin href="/assets/task-groups-DhYlsi5m.js">
82
- <link rel="modulepreload" crossorigin href="/assets/reference-chip-BKBFx58a.js">
80
+ <link rel="modulepreload" crossorigin href="/assets/attention-BHlvWUvR.js">
81
+ <link rel="modulepreload" crossorigin href="/assets/task-groups-B7v_DBPP.js">
82
+ <link rel="modulepreload" crossorigin href="/assets/reference-chip-D0zVVSpi.js">
83
83
  <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BHp8sXmF.js">
84
84
  <link rel="modulepreload" crossorigin href="/assets/bot-TkDIw4y-.js">
85
85
  <link rel="modulepreload" crossorigin href="/assets/external-link-BE6y205O.js">
@@ -90,12 +90,12 @@
90
90
  <link rel="modulepreload" crossorigin href="/assets/dist-BSUJIXeE.js">
91
91
  <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-DjtKUK8F.js">
92
92
  <link rel="modulepreload" crossorigin href="/assets/own-lookup-DS54wXvD.js">
93
- <link rel="modulepreload" crossorigin href="/assets/open-in-menu-BMkr5oG0.js">
93
+ <link rel="modulepreload" crossorigin href="/assets/open-in-menu-Bc0mf1Q8.js">
94
94
  <link rel="modulepreload" crossorigin href="/assets/check-OP-CVgZG.js">
95
95
  <link rel="modulepreload" crossorigin href="/assets/chevron-down-CHGyCDBH.js">
96
96
  <link rel="modulepreload" crossorigin href="/assets/nav-row-styles-CgP5uNp4.js">
97
97
  <link rel="modulepreload" crossorigin href="/assets/chevron-right-BENZ-1ZN.js">
98
- <link rel="modulepreload" crossorigin href="/assets/folder-browser-TThsZhk0.js">
98
+ <link rel="modulepreload" crossorigin href="/assets/folder-browser-BF7yByS9.js">
99
99
  <link rel="modulepreload" crossorigin href="/assets/eye-B8okNWXU.js">
100
100
  <link rel="modulepreload" crossorigin href="/assets/loader-circle-CPBhhDbB.js">
101
101
  <link rel="modulepreload" crossorigin href="/assets/play-CmVAj_fu.js">
@@ -105,10 +105,10 @@
105
105
  <link rel="modulepreload" crossorigin href="/assets/switch-CAKeV99j.js">
106
106
  <link rel="modulepreload" crossorigin href="/assets/badge-B6B-xYQQ.js">
107
107
  <link rel="modulepreload" crossorigin href="/assets/dialog-DRZuXvul.js">
108
- <link rel="modulepreload" crossorigin href="/assets/project-router-C9kvPm0I.js">
108
+ <link rel="modulepreload" crossorigin href="/assets/project-router-BmHj3sRY.js">
109
109
  <link rel="modulepreload" crossorigin href="/assets/status-dot-BXf-Ubd0.js">
110
110
  <link rel="modulepreload" crossorigin href="/assets/use-search-params-writer-ClMScnNe.js">
111
- <link rel="modulepreload" crossorigin href="/assets/report-selection-Bh4oD7_H.js">
111
+ <link rel="modulepreload" crossorigin href="/assets/report-selection-D73fe0ma.js">
112
112
  <link rel="modulepreload" crossorigin href="/assets/page-shell-Dky5crRl.js">
113
113
  <link rel="modulepreload" crossorigin href="/assets/diff-stat-Dy4uLuyP.js">
114
114
  <link rel="modulepreload" crossorigin href="/assets/format-BU7D3IfE.js">
@@ -1,141 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Multi-host cockpit contract (`packages/contract/src/hosts.ts`, spec
4
- * `.ai/specs/2026-11-30-multi-host-cockpit.md`, epic hearsay-tools/squawk#4536).
5
- *
6
- * Node-free by construction — `zod` only. S3 widens `HOST_STATES` and `hostStateSchema`; S4 and
7
- * S5 add project and index schemas alongside these exports without rewriting them.
8
- */
9
- /** Host id grammar: 1–32 lowercase alphanumeric characters or hyphens, starting with `[a-z0-9]`. */
10
- export declare const HOST_ID_PATTERN: RegExp;
11
- /** Reserved id for the local server; never allowed as a saved remote host id. */
12
- export declare const LOCAL_HOST_ID = "local";
13
- export declare const hostIdSchema: z.ZodString;
14
- export type HostId = z.infer<typeof hostIdSchema>;
15
- export declare const hostLabelSchema: z.ZodString;
16
- export declare const hostSshAliasSchema: z.ZodString;
17
- export declare const hostPortSchema: z.ZodNumber;
18
- /** Derive the default host id from an SSH alias (lowercased, non-alphanumeric runs to `-`, max 32). */
19
- export declare function slugHostId(sshAlias: string): string;
20
- /**
21
- * Host states. Named schema so S3 can widen it to the full set in spec § 6
22
- * (`connecting`, `connected`, `unreachable`, `needs-node`, `version-mismatch`, `not-hosted`,
23
- * `identity-changed`, `several-servers`, `paused`, `cannot-persist`).
24
- */
25
- export declare const HOST_STATES: readonly ['unreachable'];
26
- export declare const hostStateSchema: z.ZodEnum<{
27
- unreachable: "unreachable";
28
- }>;
29
- export type HostState = z.infer<typeof hostStateSchema>;
30
- /** Default unreachable reason in S1 before SSH bootstrap (S3) exists. */
31
- export declare const HOST_NOT_CONNECTED_REASON = "not connected yet";
32
- /** Saved host entry in `<config>/hosts.json` (spec § Architecture 1). */
33
- export declare const hostEntrySchema: z.ZodObject<{
34
- id: z.ZodString;
35
- label: z.ZodString;
36
- kind: z.ZodLiteral<"ssh">;
37
- sshAlias: z.ZodString;
38
- installId: z.ZodOptional<z.ZodString>;
39
- port: z.ZodOptional<z.ZodNumber>;
40
- addedAt: z.ZodISODateTime;
41
- }, z.core.$strip>;
42
- export type HostEntry = z.infer<typeof hostEntrySchema>;
43
- /** On-disk `<config>/hosts.json` document. Rejects invalid entries and duplicate host ids. */
44
- export declare const hostsRegistryFileSchema: z.ZodObject<{
45
- hosts: z.ZodArray<z.ZodObject<{
46
- id: z.ZodString;
47
- label: z.ZodString;
48
- kind: z.ZodLiteral<"ssh">;
49
- sshAlias: z.ZodString;
50
- installId: z.ZodOptional<z.ZodString>;
51
- port: z.ZodOptional<z.ZodNumber>;
52
- addedAt: z.ZodISODateTime;
53
- }, z.core.$strip>>;
54
- }, z.core.$strip>;
55
- export type HostsRegistryFile = z.infer<typeof hostsRegistryFileSchema>;
56
- /**
57
- * Host item returned by `GET /api/v1/hosts` and host mutation responses.
58
- * Non-`settingsAdmin` sessions receive `id`, `label` and `state` ONLY; `reason`, `kind`,
59
- * `sshAlias`, `installId`, `port` and `addedAt` appear only for `settingsAdmin` (because `reason`
60
- * can carry the first line of `ssh` stderr in S3+, which can name the machine behind the alias).
61
- */
62
- export declare const hostSummarySchema: z.ZodObject<{
63
- id: z.ZodString;
64
- label: z.ZodString;
65
- state: z.ZodEnum<{
66
- unreachable: "unreachable";
67
- }>;
68
- reason: z.ZodOptional<z.ZodString>;
69
- kind: z.ZodOptional<z.ZodLiteral<"ssh">>;
70
- sshAlias: z.ZodOptional<z.ZodString>;
71
- installId: z.ZodOptional<z.ZodString>;
72
- port: z.ZodOptional<z.ZodNumber>;
73
- addedAt: z.ZodOptional<z.ZodISODateTime>;
74
- }, z.core.$strip>;
75
- export type HostSummary = z.infer<typeof hostSummarySchema>;
76
- /**
77
- * `GET /api/v1/hosts`.
78
- * `sshSuggestions` (read-only aliases from `~/.ssh/config`) is present ONLY when the session has
79
- * `settingsAdmin`. `warning` is present when `<config>/hosts.json` cannot be parsed.
80
- */
81
- export declare const hostsListResponseSchema: z.ZodObject<{
82
- hosts: z.ZodArray<z.ZodObject<{
83
- id: z.ZodString;
84
- label: z.ZodString;
85
- state: z.ZodEnum<{
86
- unreachable: "unreachable";
87
- }>;
88
- reason: z.ZodOptional<z.ZodString>;
89
- kind: z.ZodOptional<z.ZodLiteral<"ssh">>;
90
- sshAlias: z.ZodOptional<z.ZodString>;
91
- installId: z.ZodOptional<z.ZodString>;
92
- port: z.ZodOptional<z.ZodNumber>;
93
- addedAt: z.ZodOptional<z.ZodISODateTime>;
94
- }, z.core.$strip>>;
95
- warning: z.ZodOptional<z.ZodString>;
96
- sshSuggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
97
- }, z.core.$strip>;
98
- export type HostsListResponse = z.infer<typeof hostsListResponseSchema>;
99
- /** Path parameter schema for `/api/v1/hosts/:id`. */
100
- export declare const hostRouteParamsSchema: z.ZodObject<{
101
- id: z.ZodString;
102
- }, z.core.$strip>;
103
- export type HostRouteParams = z.infer<typeof hostRouteParamsSchema>;
104
- /** `POST /api/v1/hosts` request body (`settingsAdmin` required). */
105
- export declare const createHostInputSchema: z.ZodObject<{
106
- sshAlias: z.ZodString;
107
- id: z.ZodOptional<z.ZodString>;
108
- label: z.ZodOptional<z.ZodString>;
109
- port: z.ZodOptional<z.ZodNumber>;
110
- }, z.core.$strict>;
111
- export type CreateHostInput = z.infer<typeof createHostInputSchema>;
112
- /** `PATCH /api/v1/hosts/:id` request body (`settingsAdmin` required). `port: null` clears a pinned port. */
113
- export declare const updateHostInputSchema: z.ZodObject<{
114
- label: z.ZodOptional<z.ZodString>;
115
- sshAlias: z.ZodOptional<z.ZodString>;
116
- port: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
117
- }, z.core.$strict>;
118
- export type UpdateHostInput = z.infer<typeof updateHostInputSchema>;
119
- /** `POST /api/v1/hosts` (201) and `PATCH /api/v1/hosts/:id` (200) response. */
120
- export declare const hostResponseSchema: z.ZodObject<{
121
- host: z.ZodObject<{
122
- id: z.ZodString;
123
- label: z.ZodString;
124
- state: z.ZodEnum<{
125
- unreachable: "unreachable";
126
- }>;
127
- reason: z.ZodOptional<z.ZodString>;
128
- kind: z.ZodOptional<z.ZodLiteral<"ssh">>;
129
- sshAlias: z.ZodOptional<z.ZodString>;
130
- installId: z.ZodOptional<z.ZodString>;
131
- port: z.ZodOptional<z.ZodNumber>;
132
- addedAt: z.ZodOptional<z.ZodISODateTime>;
133
- }, z.core.$strip>;
134
- }, z.core.$strip>;
135
- export type HostResponse = z.infer<typeof hostResponseSchema>;
136
- /** `DELETE /api/v1/hosts/:id` (200) response. */
137
- export declare const removeHostResponseSchema: z.ZodObject<{
138
- removed: z.ZodLiteral<true>;
139
- id: z.ZodString;
140
- }, z.core.$strip>;
141
- export type RemoveHostResponse = z.infer<typeof removeHostResponseSchema>;
@@ -1,8 +0,0 @@
1
- import type { Home } from '../../home/home.ts';
2
- export declare const HOST_CLI_USAGE: string;
3
- export interface HostCliDeps {
4
- home?: () => Home;
5
- stdout?: (line: string) => void;
6
- stderr?: (line: string) => void;
7
- }
8
- export declare function runHostCommand(argv: string[], _env: NodeJS.ProcessEnv, deps?: HostCliDeps): Promise<number>;
@@ -1,172 +0,0 @@
1
- /**
2
- * `hsq host add | list | remove` (spec § Architecture 1, hearsay-tools/squawk#4537).
3
- *
4
- * Host-operator CLI for managing `<config>/hosts.json` directly through `HomeStore`.
5
- * Works with no cockpit running; running cockpits of the same home see updates on the next read.
6
- */
7
- import { parseArgs } from 'node:util';
8
- import { HOST_NOT_CONNECTED_REASON } from '../../contract/index.js';
9
- import { commandText } from '../../home/command.js';
10
- import { HostsRegistryError, addHost, readHostsRegistry, removeHost } from './registry.js';
11
- export const HOST_CLI_USAGE = commandText(`usage:
12
- cez host add <ssh-alias> [--id <id>] [--label <text>] [--port <n>] [--json]
13
- add a remote Squawk host to <config>/hosts.json
14
- cez host list [--json] list saved remote hosts
15
- cez host remove <id> [--json]
16
- remove a saved remote host`);
17
- class HostCliUsageError extends Error {
18
- }
19
- function parsePortFlag(value) {
20
- if (value === undefined)
21
- return undefined;
22
- if (!/^[1-9]\d{0,4}$/.test(value) || Number(value) > 65_535) {
23
- throw new HostCliUsageError(`--port must be an integer between 1 and 65535, not "${value}"`);
24
- }
25
- return Number(value);
26
- }
27
- function parseHostArgv(argv) {
28
- try {
29
- return parseArgs({
30
- args: argv,
31
- options: {
32
- id: { type: 'string' },
33
- label: { type: 'string' },
34
- port: { type: 'string' },
35
- json: { type: 'boolean', default: false },
36
- help: { type: 'boolean', short: 'h', default: false },
37
- },
38
- allowPositionals: true,
39
- strict: true,
40
- });
41
- }
42
- catch (error) {
43
- throw new HostCliUsageError(error instanceof Error ? error.message : 'invalid arguments');
44
- }
45
- }
46
- function formatHostRow(entry, idWidth, labelWidth) {
47
- const portSuffix = entry.port !== undefined ? ` port=${entry.port}` : '';
48
- return ` · ${entry.id.padEnd(idWidth)} ${entry.label.padEnd(labelWidth)} unreachable (${HOST_NOT_CONNECTED_REASON}) ssh=${entry.sshAlias}${portSuffix}`;
49
- }
50
- function runList(rest, values, home, io) {
51
- if (rest.length > 0)
52
- throw new HostCliUsageError(`unexpected argument "${rest[0]}"`);
53
- if (values.id !== undefined || values.label !== undefined || values.port !== undefined) {
54
- throw new HostCliUsageError('list accepts only --json');
55
- }
56
- const loaded = readHostsRegistry(home);
57
- if (values.json) {
58
- io.stdout(JSON.stringify({
59
- hosts: loaded.hosts.map((entry) => ({
60
- ...entry,
61
- state: 'unreachable',
62
- reason: HOST_NOT_CONNECTED_REASON,
63
- })),
64
- path: loaded.path,
65
- ...(loaded.warning !== undefined ? { warning: loaded.warning } : {}),
66
- }, null, 2));
67
- return 0;
68
- }
69
- if (loaded.warning !== undefined) {
70
- io.stderr(`Warning: ${loaded.warning}`);
71
- }
72
- if (loaded.hosts.length === 0) {
73
- io.stdout('no hosts saved');
74
- io.stdout(commandText('add one with: cez host add <ssh-alias>'));
75
- return 0;
76
- }
77
- const idWidth = Math.max(...loaded.hosts.map((entry) => entry.id.length));
78
- const labelWidth = Math.max(...loaded.hosts.map((entry) => entry.label.length));
79
- for (const entry of loaded.hosts) {
80
- io.stdout(formatHostRow(entry, idWidth, labelWidth));
81
- }
82
- io.stdout(`${loaded.hosts.length} host(s) — registry: ${loaded.path}`);
83
- return 0;
84
- }
85
- function runAdd(rest, values, home, io) {
86
- if (rest.length === 0)
87
- throw new HostCliUsageError('add requires <ssh-alias>');
88
- if (rest.length > 1)
89
- throw new HostCliUsageError(`unexpected argument "${rest[1]}"`);
90
- const port = parsePortFlag(values.port);
91
- const created = addHost(home, {
92
- sshAlias: rest[0],
93
- id: values.id,
94
- label: values.label,
95
- port,
96
- });
97
- if (values.json) {
98
- io.stdout(JSON.stringify({
99
- ok: true,
100
- host: { ...created, state: 'unreachable', reason: HOST_NOT_CONNECTED_REASON },
101
- path: home.hosts,
102
- }, null, 2));
103
- return 0;
104
- }
105
- const portText = created.port !== undefined ? ` (port ${created.port})` : '';
106
- io.stdout(`added host ${created.id} (${created.label}) → ssh ${created.sshAlias}${portText}`);
107
- return 0;
108
- }
109
- function runRemove(rest, values, home, io) {
110
- if (values.id !== undefined || values.label !== undefined || values.port !== undefined) {
111
- throw new HostCliUsageError('remove accepts only <id> and --json');
112
- }
113
- if (rest.length === 0)
114
- throw new HostCliUsageError('remove requires <id>');
115
- if (rest.length > 1)
116
- throw new HostCliUsageError(`unexpected argument "${rest[1]}"`);
117
- const removed = removeHost(home, rest[0]);
118
- if (values.json) {
119
- io.stdout(JSON.stringify({ ok: true, removed: true, id: removed.id, path: home.hosts }, null, 2));
120
- return 0;
121
- }
122
- io.stdout(`removed host ${removed.id}`);
123
- return 0;
124
- }
125
- function reportCliError(error, json, io) {
126
- const message = error instanceof Error ? error.message : String(error);
127
- const code = error instanceof HostsRegistryError ? error.code : error instanceof HostCliUsageError ? 'invalid_input' : 'error';
128
- const exitCode = error instanceof HostCliUsageError ? 64 : 1;
129
- if (json) {
130
- io.stdout(JSON.stringify({ ok: false, code, error: message }, null, 2));
131
- }
132
- else {
133
- io.stderr(message);
134
- if (error instanceof HostCliUsageError)
135
- io.stderr(`\n${HOST_CLI_USAGE}`);
136
- }
137
- return exitCode;
138
- }
139
- export async function runHostCommand(argv, _env, deps = {}) {
140
- const io = {
141
- stdout: deps.stdout ?? ((line) => console.log(line)),
142
- stderr: deps.stderr ?? ((line) => console.error(line)),
143
- };
144
- if (argv.length === 0 || argv[0] === 'help' || argv.includes('--help') || argv.includes('-h')) {
145
- io.stdout(HOST_CLI_USAGE);
146
- return 0;
147
- }
148
- const wantsJson = argv.includes('--json');
149
- try {
150
- const { positionals, values } = parseHostArgv(argv);
151
- const [action, ...rest] = positionals;
152
- if (!action) {
153
- io.stdout(HOST_CLI_USAGE);
154
- return 0;
155
- }
156
- if (!['add', 'list', 'remove'].includes(action)) {
157
- throw new HostCliUsageError(`unknown host subcommand: ${action}`);
158
- }
159
- if (!deps.home)
160
- throw new Error('host command requires an operator Home');
161
- const home = deps.home();
162
- if (action === 'list')
163
- return runList(rest, values, home, io);
164
- if (action === 'add')
165
- return runAdd(rest, values, home, io);
166
- return runRemove(rest, values, home, io);
167
- }
168
- catch (error) {
169
- return reportCliError(error, wantsJson, io);
170
- }
171
- }
172
- //# sourceMappingURL=cli.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/features/hosts/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAkB,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3F,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;;;;;uDAKa,CAAC,CAAC;AAazD,MAAM,iBAA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AC;QACX,CAAC;QACD,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,iBAAiB,CAAC,4BAA4B,MAAM,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,IAAI,MAAM,KAAK,MAAM;YAAE,OAAO,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * The bundled multi-host feature (`packages/cezar/src/features/hosts/`, spec
3
- * `.ai/specs/2026-11-30-multi-host-cockpit.md`, hearsay-tools/squawk#4537): registers `hsq host`
4
- * and workspace-scoped `/api/v1/hosts*` routes solely through `SquawkPluginApi`. Nothing outside
5
- * this folder imports it.
6
- */
7
- import type { CliCommandDefinition, HttpBundleRouteDefinition, SquawkPluginApi } from '../../plugin/index.ts';
8
- /** `hsq host`: operator CLI for `<config>/hosts.json`. */
9
- export declare const hostCliCommand: CliCommandDefinition;
10
- /** Workspace-scoped `/api/v1/hosts` and `/api/v1/hosts/:id` HTTP route bundle. */
11
- export declare const hostsHttpRoute: HttpBundleRouteDefinition;
12
- export default function setup(api: SquawkPluginApi): void;
@@ -1,34 +0,0 @@
1
- import { createHostsRoutes } from './routes.js';
2
- /** `hsq host`: operator CLI for `<config>/hosts.json`. */
3
- export const hostCliCommand = {
4
- name: 'host',
5
- usage: [
6
- ' cez host add <ssh-alias> [--id <id>] [--label <text>] [--port <n>] add a remote host',
7
- ' cez host list [--json] list saved remote hosts',
8
- ' cez host remove <id> remove a saved remote host',
9
- ],
10
- parseMode: 'subcommand',
11
- homeMode: 'conditional',
12
- runtimeMode: 'none',
13
- load: async (home) => async (argv, env) => (await import('./cli.js')).runHostCommand(argv, env, { home: () => home(env) }),
14
- };
15
- /** Workspace-scoped `/api/v1/hosts` and `/api/v1/hosts/:id` HTTP route bundle. */
16
- export const hostsHttpRoute = {
17
- kind: 'bundle',
18
- id: 'hosts',
19
- scope: 'workspace',
20
- createRoutes: (context) => {
21
- if (!context.server) {
22
- throw new Error('HTTP routes: hosts bundle requires server plugin context.');
23
- }
24
- return createHostsRoutes({
25
- home: context.home,
26
- capabilities: context.server.capabilities,
27
- });
28
- },
29
- };
30
- export default function setup(api) {
31
- api.registerCliCommand(hostCliCommand);
32
- api.registerHttpRoute(hostsHttpRoute);
33
- }
34
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/hosts/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACL,yFAAyF;QACzF,oEAAoE;QACpE,uEAAuE;KACxE;IACD,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CACxC,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;CAClF,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAA8B;IACvD,IAAI,EAAE,QAAQ;IACd,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,WAAW;IAClB,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,iBAAiB,CAAC;YACvB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY;SAC1C,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAoB;IAChD,GAAG,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACvC,GAAG,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;AACxC,CAAC"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Saved remote host registry (`<config>/hosts.json`, mode `0600` via `HomeStore`).
3
- *
4
- * Every read parses the file fresh so multiple cockpits sharing one home stay in sync without
5
- * restart. Every write parses the file inside the `HomeStore` write lock first and refuses to
6
- * overwrite a file that cannot be parsed (spec § Architecture 1, Lock and ownership cases).
7
- */
8
- import { type HostEntry } from '../../contract/index.js';
9
- import type { Home } from '../../home/home.ts';
10
- export type HostsRegistryErrorCode = 'corrupt' | 'duplicate' | 'not_found' | 'outside_write' | 'invalid_input';
11
- export declare class HostsRegistryError extends Error {
12
- readonly code: HostsRegistryErrorCode;
13
- constructor(code: HostsRegistryErrorCode, message: string);
14
- }
15
- export interface HostsRegistryReadResult {
16
- hosts: HostEntry[];
17
- path: string;
18
- /** Operator-facing warning (includes path details for CLI output). */
19
- warning?: string;
20
- /** Path-free warning safe for HTTP responses across local and hosted sessions. */
21
- httpWarning?: string;
22
- }
23
- export interface AddHostInput {
24
- sshAlias: string;
25
- id?: string | undefined;
26
- label?: string | undefined;
27
- port?: number | undefined;
28
- now?: Date | undefined;
29
- }
30
- export interface UpdateHostPatch {
31
- label?: string | undefined;
32
- sshAlias?: string | undefined;
33
- port?: number | null | undefined;
34
- }
35
- /**
36
- * Read `<config>/hosts.json` fresh from disk.
37
- * - Missing file: returns empty host list with no warning and writes nothing.
38
- * - Unreadable or unparseable file: returns empty host list with a warning; never modifies disk.
39
- */
40
- export declare function readHostsRegistry(home: Home): HostsRegistryReadResult;
41
- /** Read one host entry fresh from disk before acting on it. */
42
- export declare function getHostById(home: Home, id: string): {
43
- host?: HostEntry;
44
- warning?: string;
45
- httpWarning?: string;
46
- };
47
- /** Add a new SSH host entry to `<config>/hosts.json` via `HomeStore` (mode `0600`). */
48
- export declare function addHost(home: Home, input: AddHostInput): HostEntry;
49
- /** Update an existing host entry's label, SSH alias, or pinned port (`port: null` clears it). */
50
- export declare function updateHost(home: Home, id: string, patch: UpdateHostPatch): HostEntry;
51
- /** Remove a saved host entry by id. Refuses to overwrite a corrupt `hosts.json`. */
52
- export declare function removeHost(home: Home, id: string): HostEntry;