@samyx/preview-stacks-ui 0.7.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +29 -0
  2. package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DUQBVs8T.js → ActionButton.vue_vue_type_script_setup_true_lang-DxV7T6dV.js} +2 -2
  3. package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DUQBVs8T.js.map → ActionButton.vue_vue_type_script_setup_true_lang-DxV7T6dV.js.map} +1 -1
  4. package/dist/assets/{AxesTab-DU92FPX2.js → AxesTab-DkF15gUV.js} +2 -2
  5. package/dist/assets/{AxesTab-DU92FPX2.js.map → AxesTab-DkF15gUV.js.map} +1 -1
  6. package/dist/assets/{ConfigTab-CR9C6wOR.js → ConfigTab-DIfAtFKC.js} +2 -2
  7. package/dist/assets/{ConfigTab-CR9C6wOR.js.map → ConfigTab-DIfAtFKC.js.map} +1 -1
  8. package/dist/assets/DangerTab-BOrQMzL3.js +2 -0
  9. package/dist/assets/{DangerTab-BUfuJ0MC.js.map → DangerTab-BOrQMzL3.js.map} +1 -1
  10. package/dist/assets/DashboardView-Cr6Nnj3O.js +2 -0
  11. package/dist/assets/DashboardView-Cr6Nnj3O.js.map +1 -0
  12. package/dist/assets/DeploymentDetailView-D23-qn3Z.js +2 -0
  13. package/dist/assets/DeploymentDetailView-D23-qn3Z.js.map +1 -0
  14. package/dist/assets/DeploymentsView-BMD-3aeS.js +2 -0
  15. package/dist/assets/DeploymentsView-BMD-3aeS.js.map +1 -0
  16. package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BmqVrFXt.js → ErrorNote.vue_vue_type_script_setup_true_lang-BlepSrj0.js} +2 -2
  17. package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BmqVrFXt.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-BlepSrj0.js.map} +1 -1
  18. package/dist/assets/{JobDetailView-UehfrAMm.js → JobDetailView-ByaH2ylY.js} +2 -2
  19. package/dist/assets/{JobDetailView-UehfrAMm.js.map → JobDetailView-ByaH2ylY.js.map} +1 -1
  20. package/dist/assets/JobsView-h_BUWgIG.js +2 -0
  21. package/dist/assets/JobsView-h_BUWgIG.js.map +1 -0
  22. package/dist/assets/LoginView-BstzTLQc.js +5 -0
  23. package/dist/assets/LoginView-BstzTLQc.js.map +1 -0
  24. package/dist/assets/LoginView-CAyD1E0h.css +1 -0
  25. package/dist/assets/LogsTab-B_NVnnVo.js +4 -0
  26. package/dist/assets/LogsTab-B_NVnnVo.js.map +1 -0
  27. package/dist/assets/NotFoundView-BN-7ZNip.js +2 -0
  28. package/dist/assets/{NotFoundView-D4P7ej9y.js.map → NotFoundView-BN-7ZNip.js.map} +1 -1
  29. package/dist/assets/NotifiersView-CsAmv8wB.js +2 -0
  30. package/dist/assets/NotifiersView-CsAmv8wB.js.map +1 -0
  31. package/dist/assets/OverviewTab-BI1DZZxS.js +2 -0
  32. package/dist/assets/OverviewTab-BI1DZZxS.js.map +1 -0
  33. package/dist/assets/RegistriesView-CEE730kV.js +2 -0
  34. package/dist/assets/{RegistriesView-r-FHyu2l.js.map → RegistriesView-CEE730kV.js.map} +1 -1
  35. package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-lQaz4t05.js +2 -0
  36. package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-lQaz4t05.js.map +1 -0
  37. package/dist/assets/{RequiresTab-Ca5DAPqS.js → RequiresTab-B9YauFIz.js} +2 -2
  38. package/dist/assets/{RequiresTab-Ca5DAPqS.js.map → RequiresTab-B9YauFIz.js.map} +1 -1
  39. package/dist/assets/{RoutingView-6KgROiI7.js → RoutingView-DXCaRJek.js} +3 -3
  40. package/dist/assets/{RoutingView-6KgROiI7.js.map → RoutingView-DXCaRJek.js.map} +1 -1
  41. package/dist/assets/RuntimeTab-DvrQFekD.js +2 -0
  42. package/dist/assets/RuntimeTab-DvrQFekD.js.map +1 -0
  43. package/dist/assets/SettingsView-B7_zHjVP.js +2 -0
  44. package/dist/assets/SettingsView-B7_zHjVP.js.map +1 -0
  45. package/dist/assets/SkeletonList.vue_vue_type_script_setup_true_lang-SxitAmDb.js +2 -0
  46. package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-CrqRcqcf.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-SxitAmDb.js.map} +1 -1
  47. package/dist/assets/SpecDetailView-CViJ8WG_.js +2 -0
  48. package/dist/assets/{SpecDetailView-QKk7yCjK.js.map → SpecDetailView-CViJ8WG_.js.map} +1 -1
  49. package/dist/assets/SpecsView-BpG2OWMm.js +2 -0
  50. package/dist/assets/SpecsView-BpG2OWMm.js.map +1 -0
  51. package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-CgDXVhMF.js +2 -0
  52. package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-DGyF-Maq.js.map → StateBadge.vue_vue_type_script_setup_true_lang-CgDXVhMF.js.map} +1 -1
  53. package/dist/assets/SubmitView-CwdWrsVS.js +45 -0
  54. package/dist/assets/SubmitView-CwdWrsVS.js.map +1 -0
  55. package/dist/assets/TerminalTab-Bqulz6Eb.css +1 -0
  56. package/dist/assets/TerminalTab-C6gRXura.js +3 -0
  57. package/dist/assets/TerminalTab-C6gRXura.js.map +1 -0
  58. package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-D3_cdVoO.js → VarEditor.vue_vue_type_script_setup_true_lang-CZcKBdbw.js} +2 -2
  59. package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-D3_cdVoO.js.map → VarEditor.vue_vue_type_script_setup_true_lang-CZcKBdbw.js.map} +1 -1
  60. package/dist/assets/_commonjsHelpers-CqkleIqs.js +2 -0
  61. package/dist/assets/_commonjsHelpers-CqkleIqs.js.map +1 -0
  62. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +2 -0
  63. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js.map +1 -0
  64. package/dist/assets/addon-fit-CevVMrUA.js +2 -0
  65. package/dist/assets/addon-fit-CevVMrUA.js.map +1 -0
  66. package/dist/assets/index-Bygbts8t.js +129 -0
  67. package/dist/assets/index-Bygbts8t.js.map +1 -0
  68. package/dist/assets/index-DOv3m8-x.css +1 -0
  69. package/dist/assets/{useDeployment-B6jhAMSe.js → useDeployment-C4MdUG63.js} +2 -2
  70. package/dist/assets/{useDeployment-B6jhAMSe.js.map → useDeployment-C4MdUG63.js.map} +1 -1
  71. package/dist/assets/xterm-D6Mng-DB.js +10 -0
  72. package/dist/assets/xterm-D6Mng-DB.js.map +1 -0
  73. package/dist/assets/xterm-DYP7pi_n.css +32 -0
  74. package/dist/index.html +2 -2
  75. package/nginx.conf +17 -1
  76. package/package.json +3 -1
  77. package/dist/assets/DangerTab-BUfuJ0MC.js +0 -2
  78. package/dist/assets/DashboardView-DHYQn3Mi.js +0 -2
  79. package/dist/assets/DashboardView-DHYQn3Mi.js.map +0 -1
  80. package/dist/assets/DeploymentDetailView-DXvZu_pa.js +0 -2
  81. package/dist/assets/DeploymentDetailView-DXvZu_pa.js.map +0 -1
  82. package/dist/assets/DeploymentsView-C0Z2RIx1.js +0 -2
  83. package/dist/assets/DeploymentsView-C0Z2RIx1.js.map +0 -1
  84. package/dist/assets/JobsView-Dlv1T547.js +0 -2
  85. package/dist/assets/JobsView-Dlv1T547.js.map +0 -1
  86. package/dist/assets/LogsTab-CECPXx_O.js +0 -4
  87. package/dist/assets/LogsTab-CECPXx_O.js.map +0 -1
  88. package/dist/assets/NotFoundView-D4P7ej9y.js +0 -2
  89. package/dist/assets/OverviewTab-k0B5wCfH.js +0 -2
  90. package/dist/assets/OverviewTab-k0B5wCfH.js.map +0 -1
  91. package/dist/assets/RegistriesView-r-FHyu2l.js +0 -2
  92. package/dist/assets/RuntimeTab-z5tBtP5a.js +0 -2
  93. package/dist/assets/RuntimeTab-z5tBtP5a.js.map +0 -1
  94. package/dist/assets/SettingsView-DF18WFzT.js +0 -2
  95. package/dist/assets/SettingsView-DF18WFzT.js.map +0 -1
  96. package/dist/assets/SkeletonList.vue_vue_type_script_setup_true_lang-CrqRcqcf.js +0 -2
  97. package/dist/assets/SpecDetailView-QKk7yCjK.js +0 -2
  98. package/dist/assets/SpecsView-BIQkHWcI.js +0 -2
  99. package/dist/assets/SpecsView-BIQkHWcI.js.map +0 -1
  100. package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-DGyF-Maq.js +0 -2
  101. package/dist/assets/SubmitView-Cv_QCAe0.js +0 -45
  102. package/dist/assets/SubmitView-Cv_QCAe0.js.map +0 -1
  103. package/dist/assets/index-Ca3L5StC.css +0 -1
  104. package/dist/assets/index-DXW03q8i.js +0 -124
  105. package/dist/assets/index-DXW03q8i.js.map +0 -1
@@ -0,0 +1,45 @@
1
+ import{d as X,r as c,B as I,J as j,c as n,a as t,t as p,m as s,h as v,i as m,_ as A,F as w,f as y,G,g as S,v as N,W as D,H as J,x as M,y as Q,D as E,j as Y,o as a,l as Z,Q as _,P as ee,C as te,V as F}from"./index-Bygbts8t.js";import{a as se,w as oe,p as q,r as le}from"./useVars-VN9gYdR6.js";import{_ as ae}from"./ActionButton.vue_vue_type_script_setup_true_lang-DxV7T6dV.js";import{_ as ne}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BlepSrj0.js";import{_ as ie}from"./VarEditor.vue_vue_type_script_setup_true_lang-CZcKBdbw.js";const re={class:"page-head"},de={class:"sub"},ue={class:"panel"},pe={class:"dim"},ve={key:0,class:"banner warn"},me={key:0},ye={key:1},fe={key:2},ce={key:3},he={key:2,class:"banner warn"},ke={class:"row",style:{"margin-bottom":"var(--s4)"}},be={class:"field",style:{"max-width":"280px"}},ge={class:"mute",style:{"align-self":"end","padding-bottom":"10px"}},we={key:3,class:"row",style:{"margin-bottom":"var(--s4)"}},Se={class:"check"},xe={class:"check"},Ce={class:"field",style:{"max-width":"340px"}},$e=["value"],Ve={key:0,class:"hint"},Re={key:0},Ae={key:1},Te={key:2},Le={class:"field"},Ue={class:"field",style:{"margin-top":"var(--s3)"}},Ee={class:"hint"},Ie={class:"hint"},Ne={class:"row",style:{"margin-top":"var(--s5)"}},Pe={key:0,class:"s-ok"},We={key:6,class:"banner warn"},je={key:0},De=`version: 1
2
+ kind: isolated
3
+
4
+ # The stack identity: the compose project name, and $STACK inside every hook.
5
+ # \${PR} is interpolated ONCE, at resolve time, from the variables sent with the request.
6
+ stack: pr-\${PR}
7
+
8
+ env:
9
+ PREVIEW_DOMAIN: preview.example.com
10
+
11
+ compose:
12
+ file: compose.yml
13
+ # Every service sits behind a profile so a bare \`up\` starts nothing.
14
+ # \`down\` always enables ALL of them — otherwise the unselected profiles' network leaks.
15
+ profiles: [app]
16
+
17
+ requires:
18
+ - name: traefik-network
19
+ assert: docker network inspect traefik >/dev/null 2>&1
20
+ hint: run \`pstack init\` on the host first
21
+
22
+ axes:
23
+ # Hooks run from the deployment directory, which holds only spec.yml and compose.yml —
24
+ # so use inline shell or absolute paths, never ./hooks/foo.sh.
25
+ - name: scratch
26
+ up: mkdir -p /tmp/$STACK
27
+ assert_live: test -d /tmp/$STACK
28
+ down: rm -rf /tmp/$STACK
29
+ # assert_gone MUST FAIL CLOSED. A bare \`! <probe>\` reports "gone" whenever the probe fails
30
+ # for any reason — a missing CLI, an expired token — turning "I could not tell" into
31
+ # "it is gone", a false negative on the one thing this tool exists to catch.
32
+ assert_gone: |
33
+ test -d /tmp || exit 1
34
+ ! test -d /tmp/$STACK
35
+ `,Me=`services:
36
+ app:
37
+ image: nginx:alpine
38
+ profiles: [app]
39
+ labels:
40
+ - traefik.enable=true
41
+ `,ze=X({__name:"SubmitView",props:{id:{}},setup(P){const T=P,l=c({id:T.id??"",spec:"",compose:""}),h=c([{k:"",v:""}]),k=c("inline"),x=c(""),C=c(!1),g=c(""),u=c(null),$=c([]);I.get("/api/specs").then(o=>{o.ok&&Array.isArray(o.body.specs)&&($.value=o.body.specs)});const V=E(()=>$.value.find(o=>o.name===x.value)),L=E(()=>!!T.id),O=Z(),R=E(()=>{const o=O.query.from;return typeof o=="string"&&o?o:null}),f=c("idle"),b=c(null);async function W(o){f.value="loading",b.value=null;const e=await I.getAuthed(`/api/deployments/${encodeURIComponent(o)}/source`);if(e.status===404||!e.ok){f.value="failed";return}if(e.body.sourceWithheld){f.value="withheld",e.body.specName&&(b.value=e.body.specName);return}l.value.spec||(l.value.spec=e.body.spec??""),l.value.compose||(l.value.compose=e.body.compose??""),e.body.specName&&(b.value=e.body.specName),f.value="loaded"}j(R,async o=>{var r;if(!o||T.id)return;g.value="",u.value=null,l.value.spec="",l.value.compose="";const e=(r=F(o))==null?void 0:r.vars;e&&(h.value=q(e)),await W(o),l.value.id=""},{immediate:!0}),j(()=>T.id,o=>{var d;if(g.value="",u.value=null,f.value="idle",b.value=null,!o)return;o!==l.value.id&&(l.value.spec="",l.value.compose=""),l.value.id=o;const e=(d=F(o))==null?void 0:d.vars,r=e?q(e):le(o);r.some(U=>U.k)&&(h.value=r),W(o)},{immediate:!0});const B=E(()=>!!l.value.id&&(k.value==="stored"?!!x.value:!!l.value.spec.trim())&&!C.value);async function K(){C.value=!0,g.value="",u.value=null;const o=l.value.id,e=se(h.value),r={vars:e,env:e};k.value==="stored"?r.specName=x.value:(r.spec=l.value.spec,l.value.compose.trim()&&(r.compose=l.value.compose));const d=await I.put(`/api/deployments/${encodeURIComponent(o)}`,r);if(C.value=!1,d.status===200||d.status===201){u.value={id:d.body.id??o,stack:d.body.stack??"?",created:d.status===201,stackSharedWith:d.body.stackSharedWith},oe(o,h.value),_(),ee("ok",`${d.status===201?"Created":"Replaced"} ${o} → ${u.value.stack}`,{to:`/deployments/${encodeURIComponent(o)}`,toLabel:"Open"});return}g.value=te(d,"save this deployment")}function z(){k.value="inline",l.value.spec=De,l.value.compose.trim()||(l.value.compose=Me),l.value.id||(l.value.id="pr-123"),h.value.some(o=>o.k)||(h.value=[{k:"PR",v:"123"}])}return(o,e)=>{var d,U;const r=Y("RouterLink");return a(),n("div",null,[t("div",re,[t("div",null,[t("h1",null,p(L.value?"Edit a deployment":R.value?"Duplicate a deployment":"Submit a deployment"),1),t("div",de,p(L.value?"Loaded from what is stored; saving replaces the record":R.value?`Copied from ${R.value} — give it a new id, then edit`:"Stores a spec so it can be deployed"),1)]),e[7]||(e[7]=t("span",{class:"grow"},null,-1)),t("button",{class:"ghost",onClick:z},"Load example spec")]),t("section",ue,[t("p",pe,[e[9]||(e[9]=s(" Nothing is saved until the spec is valid. ",-1)),v(A,{label:"what happens on a rejected submission"},{default:m(()=>[...e[8]||(e[8]=[s(" The spec is checked before anything is written, so a rejected submission leaves nothing behind — and a replace never destroys a good record over a typo. Whether the deployment is shared or isolated comes from the spec, not from this form. ",-1)])]),_:1})]),R.value&&!L.value?(a(),n("div",ve,[e[22]||(e[22]=t("b",null,"Change the stack, not just the id.",-1)),t("p",null,[e[13]||(e[13]=s(" Two deployments that resolve to the same ",-1)),e[14]||(e[14]=t("code",null,"stack",-1)),e[15]||(e[15]=s(" drive the same compose project — ",-1)),e[16]||(e[16]=t("code",null,"down",-1)),e[17]||(e[17]=s(" on either stops the other's containers. If the stack interpolates a variable (",-1)),e[18]||(e[18]=t("code",null,"pr-${PR}",-1)),e[19]||(e[19]=s(") give it a different value below; if it is a literal, edit the ",-1)),e[20]||(e[20]=t("code",null,"stack:",-1)),e[21]||(e[21]=s(" line. ",-1)),f.value==="withheld"?(a(),n(w,{key:0},[e[11]||(e[11]=s(" The spec could not be copied without an access token — ",-1)),v(r,{to:"/settings"},{default:m(()=>[...e[10]||(e[10]=[s("add yours",-1)])]),_:1}),e[12]||(e[12]=s(". ",-1))],64)):y("",!0)])])):y("",!0),L.value?(a(),n("div",{key:1,class:G(["banner",f.value==="loaded"?"info":"warn"])},[t("b",null,"Replacing "+p(P.id)+".",1),f.value==="loading"?(a(),n("p",me,"Loading what is stored…")):f.value==="loaded"?(a(),n("p",ye," Loaded from the stored record — edit it and save. Saving replaces the record outright, so anything you delete here stops being tracked while whatever it created keeps running. ")):f.value==="withheld"?(a(),n("p",fe,[e[24]||(e[24]=s(" The stored spec was not loaded: reading it needs an access token, because hooks routinely carry a credential inline. ",-1)),v(r,{to:"/settings"},{default:m(()=>[...e[23]||(e[23]=[s("Add your token",-1)])]),_:1}),e[25]||(e[25]=s(" to edit in place — otherwise paste the ",-1)),e[26]||(e[26]=t("b",null,"complete",-1)),e[27]||(e[27]=s(" spec, since anything you leave out stops being tracked. ",-1))])):(a(),n("p",ce,[...e[28]||(e[28]=[s(" The stored spec could not be loaded, so this form is empty. Paste the ",-1),t("b",null,"complete",-1),s(" spec you want stored — anything you leave out stops being tracked while whatever it created keeps running. ",-1)])]))],2)):y("",!0),b.value?(a(),n("div",he,[t("b",null,"This deployment tracks the stored spec “"+p(b.value)+"”.",1),t("p",null,[e[30]||(e[30]=s(" Saving here writes a private copy and stops it following that spec. To change every deployment using it, edit ",-1)),v(r,{to:`/specs/${encodeURIComponent(b.value)}`},{default:m(()=>[...e[29]||(e[29]=[s("the spec",-1)])]),_:1},8,["to"]),e[31]||(e[31]=s(" instead. ",-1))])])):y("",!0),t("div",ke,[t("div",be,[e[32]||(e[32]=t("label",{for:"did"},"Deployment id",-1)),S(t("input",{id:"did","onUpdate:modelValue":e[0]||(e[0]=i=>l.value.id=i),type:"text",placeholder:"pr-123",spellcheck:"false",autocomplete:"off"},null,512),[[N,l.value.id,void 0,{trim:!0}]])]),t("span",ge,[e[34]||(e[34]=s(" Lower case ",-1)),v(A,{label:"allowed characters in a deployment id"},{default:m(()=>[...e[33]||(e[33]=[s(" Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64 characters — ",-1),t("code",null,"[a-z0-9][a-z0-9._-]{0,63}",-1),s(". ",-1)])]),_:1})])]),$.value.length?(a(),n("div",we,[t("label",Se,[S(t("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>k.value=i),type:"radio",value:"inline"},null,512),[[D,k.value]]),e[35]||(e[35]=s(" inline spec ",-1))]),t("label",xe,[S(t("input",{"onUpdate:modelValue":e[2]||(e[2]=i=>k.value=i),type:"radio",value:"stored"},null,512),[[D,k.value]]),e[36]||(e[36]=s(" reference a stored spec ",-1))])])):y("",!0),k.value==="stored"&&$.value.length?(a(),n(w,{key:4},[t("div",Ce,[e[38]||(e[38]=t("label",{for:"sn"},"Stored spec",-1)),S(t("select",{id:"sn","onUpdate:modelValue":e[3]||(e[3]=i=>x.value=i)},[e[37]||(e[37]=t("option",{value:""},"— choose —",-1)),(a(!0),n(w,null,M($.value,i=>(a(),n("option",{key:i.name,value:i.name},p(i.name)+" ("+p(i.kind)+") ",9,$e))),128))],512),[[J,x.value]])]),V.value?(a(),n("p",Ve,[V.value.description?(a(),n("span",Re,p(V.value.description)+" — ",1)):y("",!0),e[40]||(e[40]=s(" needs ",-1)),V.value.requiredVars.length?(a(),n("b",Ae,p(V.value.requiredVars.join(", ")),1)):(a(),n("span",Te,"no variables")),e[41]||(e[41]=s(". ",-1)),v(A,{label:"why variables are required"},{default:m(()=>[...e[39]||(e[39]=[s(" A missing variable is refused by name. It is never filled in with a blank, which would silently give every deployment the same stack name. ",-1)])]),_:1})])):y("",!0)],64)):(a(),n(w,{key:5},[t("div",Le,[e[42]||(e[42]=t("label",{for:"spec"},"spec.yml",-1)),S(t("textarea",{id:"spec","onUpdate:modelValue":e[4]||(e[4]=i=>l.value.spec=i),rows:"18",spellcheck:"false",placeholder:`version: 1
42
+ kind: isolated
43
+ stack: pr-\${PR}
44
+ axes: []`},null,512),[[N,l.value.spec]])]),t("div",Ue,[e[43]||(e[43]=t("label",{for:"compose"},[s("compose.yml "),t("span",{class:"mute"},"(optional)")],-1)),S(t("textarea",{id:"compose","onUpdate:modelValue":e[5]||(e[5]=i=>l.value.compose=i),rows:"8",spellcheck:"false",placeholder:"Written next to spec.yml, so a compose file named compose.yml resolves"},null,512),[[N,l.value.compose]])]),t("p",Ee,[e[45]||(e[45]=s(" Hooks must be inline shell or an absolute path. ",-1)),v(A,{label:"why a relative script path does not work"},{default:m(()=>[...e[44]||(e[44]=[s(" A deployment directory only ever holds ",-1),t("code",null,"spec.yml",-1),s(" and ",-1),t("code",null,"compose.yml",-1),s(", and hooks run from there — so ",-1),t("code",null,"up: ./hooks/db.sh",-1),s(" has nothing to find. ",-1)])]),_:1})])],64)),e[56]||(e[56]=t("h2",{class:"section",style:{margin:"var(--s5) 0 var(--s3)"}},"Variables",-1)),v(ie,{modelValue:h.value,"onUpdate:modelValue":e[6]||(e[6]=i=>h.value=i)},null,8,["modelValue"]),t("p",Ie,[e[47]||(e[47]=s(" Saved with the deployment, so tearing it down later targets the same stack. ",-1)),v(A,{label:"how variables are remembered"},{default:m(()=>[...e[46]||(e[46]=[s(" They are stored on the server where it supports that, and in this browser either way — so the actions on the deployment page send exactly these values. ",-1)])]),_:1})]),t("div",Ne,[v(ae,{variant:"primary",pending:C.value,disabled:!B.value,onClick:K},{default:m(()=>[s(p(C.value?"submitting…":"Submit"),1)]),_:1},8,["pending","disabled"]),u.value?(a(),n("span",Pe,[s(p(u.value.created?"Created":"Replaced")+" — stack ",1),t("b",null,p(u.value.stack),1),v(r,{to:`/deployments/${encodeURIComponent(u.value.id)}`,style:{"margin-left":"8px"}},{default:m(()=>[...e[48]||(e[48]=[s(" open → ",-1)])]),_:1},8,["to"])])):y("",!0)]),(U=(d=u.value)==null?void 0:d.stackSharedWith)!=null&&U.length?(a(),n("div",We,[t("b",null,"Another deployment already resolves to stack “"+p(u.value.stack)+"”.",1),t("p",null,[(a(!0),n(w,null,M(u.value.stackSharedWith,(i,H)=>(a(),n(w,{key:i},[v(r,{to:`/deployments/${encodeURIComponent(i)}`},{default:m(()=>[s(p(i),1)]),_:2},1032,["to"]),H<u.value.stackSharedWith.length-1?(a(),n("span",je,", ")):y("",!0)],64))),128)),e[49]||(e[49]=s("— both records now drive the same compose project, so ",-1)),e[50]||(e[50]=t("code",null,"down",-1)),e[51]||(e[51]=s(" on either stops the other's containers and ",-1)),e[52]||(e[52]=t("code",null,"verify",-1)),e[53]||(e[53]=s(" on either reports the other's leaks. If that was not intended, change this one's ",-1)),e[54]||(e[54]=t("code",null,"stack",-1)),e[55]||(e[55]=s(" and save again. ",-1))])])):y("",!0),g.value?(a(),Q(ne,{key:7,text:g.value,title:"The server rejected this submission."},null,8,["text"])):y("",!0)])])}}});export{ze as default};
45
+ //# sourceMappingURL=SubmitView-CwdWrsVS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubmitView-CwdWrsVS.js","sources":["../../src/views/SubmitView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Submit or replace a deployment.\n *\n * The server's 400 is the whole point of this screen. It carries the SpecError verbatim — the key\n * or variable that is wrong, often the corrected form, and the assert-lint warnings about an\n * `assert_gone` that fails open. That text is the tool's main teaching surface, so it is rendered\n * whole, with newlines intact, and never summarised.\n *\n * The spec is parsed BEFORE anything touches disk, so a rejected submission leaves nothing behind\n * and, on a replace, a good record is never destroyed over a typo.\n */\nimport { computed, ref, watch } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { api, problem } from '../api/client';\nimport InfoHint from '../components/InfoHint.vue';\nimport type {\n DeploymentSourceResponse,\n SpecMeta,\n SpecsResponse,\n SubmitResponse,\n VarPair,\n} from '../api/types';\nimport { loadDeployments, rowFor } from '../composables/useControlPlane';\nimport { pairsFromRecord, readVars, recordFromPairs, writeVars } from '../composables/useVars';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport VarEditor from '../components/VarEditor.vue';\n\nconst props = defineProps<{ id?: string }>();\n\nconst form = ref({ id: props.id ?? '', spec: '', compose: '' });\nconst vars = ref<VarPair[]>([{ k: '', v: '' }]);\nconst source = ref<'inline' | 'stored'>('inline');\nconst specName = ref('');\n\nconst submitting = ref(false);\nconst error = ref('');\nconst result = ref<{\n id: string;\n stack: string;\n created: boolean;\n /** Other deployments resolving to the same stack — reported by the server on a new deployment. */\n stackSharedWith?: string[];\n} | null>(null);\n\n/**\n * Stored specs, when this server has them. A build without `/api/specs` answers 404, which is not\n * an error here — the picker simply is not offered and inline stays the only shape.\n */\nconst specs = ref<SpecMeta[]>([]);\nvoid api.get<SpecsResponse>('/api/specs').then((r) => {\n if (r.ok && Array.isArray(r.body.specs)) specs.value = r.body.specs;\n});\n\nconst chosenSpec = computed(() => specs.value.find((s) => s.name === specName.value));\n\nconst replacing = computed(() => !!props.id);\n\n/**\n * Duplicate mode: `/submit?from=<id>` copies an existing deployment's spec, compose and variables into\n * a NEW submission. Distinct from replacing — the id starts empty so you name the new one, and nothing\n * is written over.\n *\n * The `stack:` line is the thing to watch, which is why the banner says so: copy a spec whose stack is a\n * literal and both deployments drive the same compose project, so `down` on either stops the other's\n * containers. A spec whose stack interpolates a variable (`pr-${PR}`) just needs a different value. The\n * server independently reports a collision at submit time — see `stackSharedWith`.\n */\nconst route = useRoute();\nconst copyFrom = computed(() => {\n const v = route.query.from;\n return typeof v === 'string' && v ? v : null;\n});\n\n/**\n * Replacing now PRE-FILLS from what is stored.\n *\n * It used to start empty, because nothing could hand the source back. Replacing is whole-record, so\n * an operator retyping a spec from memory silently dropped whatever they forgot — and a dropped axis\n * stops being tracked while the resources it created keep running. Being unable to read your own\n * submission is what made that a likely mistake rather than a careless one.\n *\n * The body is still cleared FIRST, on every id change. A leftover body from another deployment is the\n * dangerous case: it is perfectly valid YAML, so the PUT would succeed and overwrite the wrong\n * deployment with nothing able to catch it. Clearing first means a failed or withheld fetch leaves the\n * form empty rather than holding someone else's spec.\n */\nconst sourceState = ref<'idle' | 'loading' | 'loaded' | 'withheld' | 'failed'>('idle');\n/** Set when this deployment tracks a stored spec — editing this copy forks it from the original. */\nconst forkWarning = ref<string | null>(null);\n\nasync function loadSource(id: string): Promise<void> {\n sourceState.value = 'loading';\n forkWarning.value = null;\n const r = await api.getAuthed<DeploymentSourceResponse>(\n `/api/deployments/${encodeURIComponent(id)}/source`,\n );\n // A build of the API without the route answers 404; that is a capability difference, not an error,\n // and it must land on the old empty-form behaviour rather than an alarming banner.\n if (r.status === 404 || !r.ok) {\n sourceState.value = 'failed';\n return;\n }\n if (r.body.sourceWithheld) {\n sourceState.value = 'withheld';\n if (r.body.specName) forkWarning.value = r.body.specName;\n return;\n }\n // Only fill if the user has not started typing — a slow fetch must never overwrite their edit.\n if (!form.value.spec) form.value.spec = r.body.spec ?? '';\n if (!form.value.compose) form.value.compose = r.body.compose ?? '';\n if (r.body.specName) forkWarning.value = r.body.specName;\n sourceState.value = 'loaded';\n}\n\n// Duplicate: same fetch, but the id stays empty and the variables come across too, since a copied\n// spec interpolates the same names.\nwatch(\n copyFrom,\n async (from) => {\n if (!from || props.id) return;\n error.value = '';\n result.value = null;\n form.value.spec = '';\n form.value.compose = '';\n const saved = rowFor(from)?.vars;\n if (saved) vars.value = pairsFromRecord(saved);\n await loadSource(from);\n // A copied record's own id is not a name for the new one; the operator picks that.\n form.value.id = '';\n },\n { immediate: true },\n);\n\nwatch(\n () => props.id,\n (id) => {\n error.value = '';\n result.value = null;\n sourceState.value = 'idle';\n forkWarning.value = null;\n if (!id) return;\n if (id !== form.value.id) {\n form.value.spec = '';\n form.value.compose = '';\n }\n form.value.id = id;\n // Seed the variables from what this deployment already uses: replacing a spec usually needs\n // the same ones that resolved it.\n const stored = rowFor(id)?.vars;\n const saved = stored ? pairsFromRecord(stored) : readVars(id);\n if (saved.some((e) => e.k)) vars.value = saved;\n void loadSource(id);\n },\n { immediate: true },\n);\n\nconst canSubmit = computed(\n () =>\n !!form.value.id &&\n (source.value === 'stored' ? !!specName.value : !!form.value.spec.trim()) &&\n !submitting.value,\n);\n\nasync function submit(): Promise<void> {\n submitting.value = true;\n error.value = '';\n result.value = null;\n\n const id = form.value.id;\n const record = recordFromPairs(vars.value);\n /**\n * `vars` are STORED with the deployment on servers that support it, which makes a later `down`\n * resolve the same stack `up` created with no query parameters at all. `env` validates this\n * submission on every server, new or old. Sending both is what keeps this form working against\n * either build — an older server ignores the key it does not know.\n */\n const body: Record<string, unknown> = { vars: record, env: record };\n if (source.value === 'stored') body.specName = specName.value;\n else {\n body.spec = form.value.spec;\n if (form.value.compose.trim()) body.compose = form.value.compose;\n }\n\n const r = await api.put<SubmitResponse>(`/api/deployments/${encodeURIComponent(id)}`, body);\n submitting.value = false;\n\n if (r.status === 200 || r.status === 201) {\n result.value = {\n id: r.body.id ?? id,\n stack: r.body.stack ?? '?',\n created: r.status === 201,\n stackSharedWith: r.body.stackSharedWith,\n };\n // Persist the variables that just validated this spec. On an older server this is the single\n // thing keeping a later `down` pointed at the stack the `up` created.\n writeVars(id, vars.value);\n void loadDeployments();\n toast('ok', `${r.status === 201 ? 'Created' : 'Replaced'} ${id} → ${result.value.stack}`, {\n to: `/deployments/${encodeURIComponent(id)}`,\n toLabel: 'Open',\n });\n return;\n }\n // 400 (SpecError), 409 (a job in flight over this stack), 401, 404 — all rendered verbatim.\n error.value = problem(r, 'save this deployment');\n}\n\nconst EXAMPLE_SPEC = `version: 1\nkind: isolated\n\n# The stack identity: the compose project name, and $STACK inside every hook.\n# \\${PR} is interpolated ONCE, at resolve time, from the variables sent with the request.\nstack: pr-\\${PR}\n\nenv:\n PREVIEW_DOMAIN: preview.example.com\n\ncompose:\n file: compose.yml\n # Every service sits behind a profile so a bare \\`up\\` starts nothing.\n # \\`down\\` always enables ALL of them — otherwise the unselected profiles' network leaks.\n profiles: [app]\n\nrequires:\n - name: traefik-network\n assert: docker network inspect traefik >/dev/null 2>&1\n hint: run \\`pstack init\\` on the host first\n\naxes:\n # Hooks run from the deployment directory, which holds only spec.yml and compose.yml —\n # so use inline shell or absolute paths, never ./hooks/foo.sh.\n - name: scratch\n up: mkdir -p /tmp/$STACK\n assert_live: test -d /tmp/$STACK\n down: rm -rf /tmp/$STACK\n # assert_gone MUST FAIL CLOSED. A bare \\`! <probe>\\` reports \"gone\" whenever the probe fails\n # for any reason — a missing CLI, an expired token — turning \"I could not tell\" into\n # \"it is gone\", a false negative on the one thing this tool exists to catch.\n assert_gone: |\n test -d /tmp || exit 1\n ! test -d /tmp/$STACK\n`;\n\nconst EXAMPLE_COMPOSE = `services:\n app:\n image: nginx:alpine\n profiles: [app]\n labels:\n - traefik.enable=true\n`;\n\nfunction loadExample(): void {\n source.value = 'inline';\n form.value.spec = EXAMPLE_SPEC;\n if (!form.value.compose.trim()) form.value.compose = EXAMPLE_COMPOSE;\n if (!form.value.id) form.value.id = 'pr-123';\n if (!vars.value.some((e) => e.k)) vars.value = [{ k: 'PR', v: '123' }];\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n {{ replacing ? 'Edit a deployment' : copyFrom ? 'Duplicate a deployment' : 'Submit a deployment' }}\n </h1>\n <div class=\"sub\">\n {{\n replacing\n ? 'Loaded from what is stored; saving replaces the record'\n : copyFrom\n ? `Copied from ${copyFrom} — give it a new id, then edit`\n : 'Stores a spec so it can be deployed'\n }}\n </div>\n </div>\n <span class=\"grow\" />\n <button class=\"ghost\" @click=\"loadExample\">Load example spec</button>\n </div>\n\n <section class=\"panel\">\n <p class=\"dim\">\n Nothing is saved until the spec is valid.\n <InfoHint label=\"what happens on a rejected submission\">\n The spec is checked before anything is written, so a rejected submission leaves nothing\n behind — and a replace never destroys a good record over a typo. Whether the deployment is\n shared or isolated comes from the spec, not from this form.\n </InfoHint>\n </p>\n\n <!--\n A `PUT` REPLACES the whole record, and this form cannot pre-fill it: the API has no route\n that returns a stored spec. Say that out loud, because a half-remembered spec pasted here\n is still valid YAML — the server will accept it, and the axes the original declared simply\n stop existing as far as the control plane knows, while whatever they created keeps running.\n -->\n <!--\n The one thing that makes duplicating dangerous, said before the form rather than after the\n submission: two records resolving to one stack drive the same compose project.\n -->\n <div v-if=\"copyFrom && !replacing\" class=\"banner warn\">\n <b>Change the stack, not just the id.</b>\n <p>\n Two deployments that resolve to the same <code>stack</code> drive the same compose project —\n <code>down</code> on either stops the other's containers. If the stack interpolates a variable\n (<code>pr-${PR}</code>) give it a different value below; if it is a literal, edit the\n <code>stack:</code> line.\n <template v-if=\"sourceState === 'withheld'\">\n The spec could not be copied without an access token —\n <RouterLink to=\"/settings\">add yours</RouterLink>.\n </template>\n </p>\n </div>\n\n <div v-if=\"replacing\" class=\"banner\" :class=\"sourceState === 'loaded' ? 'info' : 'warn'\">\n <b>Replacing {{ id }}.</b>\n <p v-if=\"sourceState === 'loading'\">Loading what is stored…</p>\n <p v-else-if=\"sourceState === 'loaded'\">\n Loaded from the stored record — edit it and save. Saving replaces the record outright, so\n anything you delete here stops being tracked while whatever it created keeps running.\n </p>\n <p v-else-if=\"sourceState === 'withheld'\">\n The stored spec was not loaded: reading it needs an access token, because hooks routinely\n carry a credential inline. <RouterLink to=\"/settings\">Add your token</RouterLink> to edit\n in place — otherwise paste the <b>complete</b> spec, since anything you leave out stops\n being tracked.\n </p>\n <p v-else>\n The stored spec could not be loaded, so this form is empty. Paste the <b>complete</b> spec\n you want stored — anything you leave out stops being tracked while whatever it created keeps\n running.\n </p>\n </div>\n\n <!--\n A deployment that references a stored spec keeps its own copy of the source. Editing that copy\n forks it: the stored spec every other deployment shares is untouched, and this one stops\n following it. Silent forks are the kind of thing discovered months later.\n -->\n <div v-if=\"forkWarning\" class=\"banner warn\">\n <b>This deployment tracks the stored spec “{{ forkWarning }}”.</b>\n <p>\n Saving here writes a private copy and stops it following that spec. To change every\n deployment using it, edit\n <RouterLink :to=\"`/specs/${encodeURIComponent(forkWarning)}`\">the spec</RouterLink> instead.\n </p>\n </div>\n\n <div class=\"row\" style=\"margin-bottom: var(--s4)\">\n <div class=\"field\" style=\"max-width: 280px\">\n <label for=\"did\">Deployment id</label>\n <input\n id=\"did\"\n v-model.trim=\"form.id\"\n type=\"text\"\n placeholder=\"pr-123\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <span class=\"mute\" style=\"align-self: end; padding-bottom: 10px\">\n Lower case\n <InfoHint label=\"allowed characters in a deployment id\">\n Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64\n characters — <code>[a-z0-9][a-z0-9._-]{0,63}</code>.\n </InfoHint>\n </span>\n </div>\n\n <!-- Offered only when this server actually has stored specs. -->\n <div v-if=\"specs.length\" class=\"row\" style=\"margin-bottom: var(--s4)\">\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"inline\" /> inline spec\n </label>\n <label class=\"check\">\n <input v-model=\"source\" type=\"radio\" value=\"stored\" /> reference a stored spec\n </label>\n </div>\n\n <template v-if=\"source === 'stored' && specs.length\">\n <div class=\"field\" style=\"max-width: 340px\">\n <label for=\"sn\">Stored spec</label>\n <select id=\"sn\" v-model=\"specName\">\n <option value=\"\">— choose —</option>\n <option v-for=\"s in specs\" :key=\"s.name\" :value=\"s.name\">\n {{ s.name }} ({{ s.kind }})\n </option>\n </select>\n </div>\n <p v-if=\"chosenSpec\" class=\"hint\">\n <span v-if=\"chosenSpec.description\">{{ chosenSpec.description }} — </span>\n needs\n <b v-if=\"chosenSpec.requiredVars.length\">{{ chosenSpec.requiredVars.join(', ') }}</b>\n <span v-else>no variables</span>.\n <InfoHint label=\"why variables are required\">\n A missing variable is refused by name. It is never filled in with a blank, which would\n silently give every deployment the same stack name.\n </InfoHint>\n </p>\n </template>\n\n <template v-else>\n <div class=\"field\">\n <label for=\"spec\">spec.yml</label>\n <textarea\n id=\"spec\"\n v-model=\"form.spec\"\n rows=\"18\"\n spellcheck=\"false\"\n placeholder=\"version: 1&#10;kind: isolated&#10;stack: pr-${PR}&#10;axes: []\"\n />\n </div>\n\n <div class=\"field\" style=\"margin-top: var(--s3)\">\n <label for=\"compose\">compose.yml <span class=\"mute\">(optional)</span></label>\n <textarea\n id=\"compose\"\n v-model=\"form.compose\"\n rows=\"8\"\n spellcheck=\"false\"\n placeholder=\"Written next to spec.yml, so a compose file named compose.yml resolves\"\n />\n </div>\n <p class=\"hint\">\n Hooks must be inline shell or an absolute path.\n <InfoHint label=\"why a relative script path does not work\">\n A deployment directory only ever holds <code>spec.yml</code> and\n <code>compose.yml</code>, and hooks run from there — so\n <code>up: ./hooks/db.sh</code> has nothing to find.\n </InfoHint>\n </p>\n </template>\n\n <h2 class=\"section\" style=\"margin: var(--s5) 0 var(--s3)\">Variables</h2>\n <VarEditor v-model=\"vars\" />\n <p class=\"hint\">\n Saved with the deployment, so tearing it down later targets the same stack.\n <InfoHint label=\"how variables are remembered\">\n They are stored on the server where it supports that, and in this browser either way — so\n the actions on the deployment page send exactly these values.\n </InfoHint>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s5)\">\n <ActionButton variant=\"primary\" :pending=\"submitting\" :disabled=\"!canSubmit\" @click=\"submit\">\n {{ submitting ? 'submitting…' : 'Submit' }}\n </ActionButton>\n <span v-if=\"result\" class=\"s-ok\">\n {{ result.created ? 'Created' : 'Replaced' }} — stack\n <b>{{ result.stack }}</b>\n <RouterLink :to=\"`/deployments/${encodeURIComponent(result.id)}`\" style=\"margin-left: 8px\">\n open →\n </RouterLink>\n </span>\n </div>\n\n <!--\n The server's rejection text IS the documentation: it names the key, the variable or the\n assert that is wrong, and often prints the corrected form. Rendered whole, newlines and\n indentation intact. Never truncate it, never collapse it, never say \"invalid spec\".\n -->\n <!--\n Reported by the server, which resolved every other deployment to check. Shown after the fact\n because it can only be known once the spec has resolved — and it is a warning, not a rejection:\n it can be deliberate, and refusing over a guess would be worse than saying so.\n -->\n <div v-if=\"result?.stackSharedWith?.length\" class=\"banner warn\">\n <b>Another deployment already resolves to stack “{{ result.stack }}”.</b>\n <p>\n <template v-for=\"(o, i) in result.stackSharedWith\" :key=\"o\">\n <RouterLink :to=\"`/deployments/${encodeURIComponent(o)}`\">{{ o }}</RouterLink\n ><span v-if=\"i < result.stackSharedWith.length - 1\">, </span> </template\n >— both records now drive the same compose project, so <code>down</code> on either stops the\n other's containers and <code>verify</code> on either reports the other's leaks. If that was not\n intended, change this one's <code>stack</code> and save again.\n </p>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"The server rejected this submission.\" />\n </section>\n </div>\n</template>\n"],"names":["EXAMPLE_SPEC","EXAMPLE_COMPOSE","props","__props","form","ref","vars","source","specName","submitting","error","result","specs","api","r","chosenSpec","computed","s","replacing","route","useRoute","copyFrom","v","sourceState","forkWarning","loadSource","id","watch","from","saved","_a","rowFor","pairsFromRecord","stored","readVars","e","canSubmit","submit","record","recordFromPairs","body","writeVars","loadDeployments","toast","problem","loadExample","_createElementBlock","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_createVNode","InfoHint","_cache","_openBlock","_hoisted_5","_Fragment","_component_RouterLink","_normalizeClass","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","$event","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_renderList","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_23","_vModelText","_hoisted_24","_hoisted_25","VarEditor","_hoisted_26","_hoisted_27","ActionButton","_hoisted_28","_b","_hoisted_29","o","i","_createBlock","ErrorNote"],"mappings":"ozCAkNMA,GAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoCfC,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mDAxNxB,MAAMC,EAAQC,EAERC,EAAOC,EAAI,CAAE,GAAIH,EAAM,IAAM,GAAI,KAAM,GAAI,QAAS,EAAA,CAAI,EACxDI,EAAOD,EAAe,CAAC,CAAE,EAAG,GAAI,EAAG,EAAA,CAAI,CAAC,EACxCE,EAASF,EAAyB,QAAQ,EAC1CG,EAAWH,EAAI,EAAE,EAEjBI,EAAaJ,EAAI,EAAK,EACtBK,EAAQL,EAAI,EAAE,EACdM,EAASN,EAML,IAAI,EAMRO,EAAQP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3F,EAAA,CAAA,mCAcO+B,GAAAxD,EAAAnB,EAAA,QAAA,YAAAmB,EAAQ,kBAAR,MAAAwD,EAAyB,QAApC9B,IAAAV,EAUM,MAVNyC,GAUM,CATJxC,EAAyE,SAAtE,iDAA8CE,EAAGtC,QAAO,KAAK,EAAG,KAAE,CAAA,EACrEoC,EAOI,IAAA,KAAA,EANFS,EAAA,EAAA,EAAAV,EAGCY,SAH0B/C,EAAA,MAAO,gBAAe,CAA/B6E,EAAGC,kBAAoCD,GAAC,CACxDnC,EACCM,EAAA,CADY,GAAE,gBAAkB,mBAAmB6B,CAAC,CAAA,EAAA,aAAK,IAAO,KAAJA,CAAC,EAAA,CAAA,CAAA,qBACjDC,EAAI9E,EAAA,MAAO,gBAAgB,OAAM,GAA7C6C,EAAA,EAAAV,EAA4D,UAAT,IAAE,yCACvD,yDAAsD,EAAA,GAAAS,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAR,EAAiB,YAAX,OAAI,EAAA,mBAAO,+CACjD,EAAA,GAAAQ,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAR,EAAmB,YAAb,SAAM,EAAA,mBAAO,qFACd,EAAA,GAAAQ,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAR,EAAkB,YAAZ,QAAK,EAAA,mBAAO,oBAChD,EAAA,EAAA,eAGerC,EAAA,WAAjBgF,EAAqFC,GAAA,OAA5D,KAAMjF,EAAA,MAAO,MAAM,sCAAA"}
@@ -0,0 +1 @@
1
+ .terminal-host[data-v-3c081c5e]{min-height:26rem;border:1px solid var(--border);border-radius:var(--r3);background:#0b0e14;padding:var(--s2);overflow:hidden}.terminal-host[data-state=idle][data-v-3c081c5e]{display:none}
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xterm-D6Mng-DB.js","assets/_commonjsHelpers-CqkleIqs.js","assets/addon-fit-CevVMrUA.js","assets/xterm-DYP7pi_n.css"])))=>i.map(i=>d[i]);
2
+ import{d as M,J as $,M as q,c as r,a as n,m as a,h as W,i as J,_ as Y,y as j,f as h,g as A,H as B,F as T,x as D,t as y,r as v,D as O,B as G,C as K,N as E,O as S,o as i,l as Q}from"./index-Bygbts8t.js";import{_ as X}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BlepSrj0.js";import{_ as Z}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ee={class:"stack"},ne={class:"banner warn"},oe={class:"row wrap",style:{gap:"var(--s3)","align-items":"end"}},te={class:"field"},se=["disabled"],le=["value"],ae={class:"field"},ie=["disabled"],re=["value"],ue=["disabled"],de={key:2,class:"badge ok"},ce={key:1,class:"hint"},ve={key:2,class:"hint"},pe=["data-state"],me=M({__name:"TerminalTab",setup(fe){const P=Q(),k=O(()=>String(P.params.id)),U=["sh","bash","ash","zsh","fish"],R=v(null),m=v(""),c=v(""),w=v("sh"),t=v("idle"),f=v(""),p=v(null),_=S(null),I=S(null),g=S(null);let u=null;const C=O(()=>{var s;return((s=R.value)==null?void 0:s.containers.filter(e=>e.state==="running"))??[]});async function x(){var e;const s=await G.get(`/api/deployments/${encodeURIComponent(k.value)}/runtime`);if(!s.ok){m.value=K(s,"list this deployment's containers");return}m.value="",R.value=s.body,c.value||(c.value=((e=C.value[0])==null?void 0:e.name)??"")}x();async function F(){var N;if(t.value==="connecting"||t.value==="open")return;f.value="",t.value="connecting";const[{Terminal:s},{FitAddon:e}]=await Promise.all([E(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([0,1])),E(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([2,1]))]);await E(()=>Promise.resolve({}),__vite__mapDeps([3])),(N=_.value)==null||N.dispose();const o=new s({convertEol:!0,fontSize:13,fontFamily:"var(--font-mono, ui-monospace, monospace)",cursorBlink:!0,theme:{background:"#0b0e14"}}),b=new e;o.loadAddon(b),p.value&&(p.value.innerHTML="",o.open(p.value),b.fit()),_.value=o,I.value=b,u==null||u.disconnect(),u=new ResizeObserver(()=>{try{b.fit()}catch{}}),p.value&&u.observe(p.value);const z=location.protocol==="https:"?"wss":"ws",H=new URLSearchParams({container:c.value,shell:w.value}),d=new WebSocket(`${z}://${location.host}/api/deployments/${encodeURIComponent(k.value)}/terminal?${H}`);d.binaryType="arraybuffer",g.value=d,d.onopen=()=>{t.value="open",o.focus()},d.onmessage=l=>o.write(typeof l.data=="string"?l.data:new Uint8Array(l.data)),d.onclose=l=>{t.value="closed",f.value=l.reason||(l.code===1006?"the connection dropped (the upgrade may have been refused)":`code ${l.code}`)},d.onerror=()=>{t.value==="connecting"&&(f.value="could not open the connection")},o.onData(l=>{d.readyState===WebSocket.OPEN&&d.send(l)})}function V(){var s;(s=g.value)==null||s.close(1e3,"closed by the operator")}function L(){var s,e;u==null||u.disconnect(),u=null,(s=g.value)==null||s.close(),g.value=null,(e=_.value)==null||e.dispose(),_.value=null}return $([c,w],()=>{(t.value==="open"||t.value==="connecting")&&V()}),$(k,()=>{L(),t.value="idle",x()}),q(L),(s,e)=>(i(),r("section",ee,[n("div",ne,[e[3]||(e[3]=n("b",null,"No TTY.",-1)),e[4]||(e[4]=a(" The shell runs without a terminal device, so there is no prompt, no ",-1)),e[5]||(e[5]=n("code",null,"Ctrl-C",-1)),e[6]||(e[6]=a(", and no full-screen programs (",-1)),e[7]||(e[7]=n("code",null,"top",-1)),e[8]||(e[8]=a(", ",-1)),e[9]||(e[9]=n("code",null,"vim",-1)),e[10]||(e[10]=a("). Type a command and press Enter. ",-1)),W(Y,{label:"why"},{default:J(()=>[...e[2]||(e[2]=[a(" A pseudo-terminal needs a wrapper (",-1),n("code",null,"script",-1),a(") whose flags differ across distributions, and it was never verified on a real host — so pstack ships the half it can stand behind. Everything an operator usually opens a shell for (",-1),n("code",null,"ls",-1),a(", ",-1),n("code",null,"cat",-1),a(", ",-1),n("code",null,"env",-1),a(", ",-1),n("code",null,"psql",-1),a(", a migration) works. ",-1)])]),_:1})]),m.value?(i(),j(X,{key:0,text:m.value,title:"Could not list this deployment's containers."},null,8,["text"])):h("",!0),n("div",oe,[n("label",te,[e[11]||(e[11]=n("span",null,"Container",-1)),A(n("select",{"onUpdate:modelValue":e[0]||(e[0]=o=>c.value=o),disabled:t.value==="open"||t.value==="connecting"},[(i(!0),r(T,null,D(C.value,o=>(i(),r("option",{key:o.id,value:o.name},[a(y(o.name),1),o.service?(i(),r(T,{key:0},[a(" — "+y(o.service),1)],64)):h("",!0)],8,le))),128))],8,se),[[B,c.value]])]),n("label",ae,[e[12]||(e[12]=n("span",null,"Shell",-1)),A(n("select",{"onUpdate:modelValue":e[1]||(e[1]=o=>w.value=o),disabled:t.value==="open"||t.value==="connecting"},[(i(),r(T,null,D(U,o=>n("option",{key:o,value:o},y(o),9,re)),64))],8,ie),[[B,w.value]])]),t.value!=="open"?(i(),r("button",{key:0,class:"primary",disabled:!c.value||t.value==="connecting",onClick:F},y(t.value==="connecting"?"Connecting…":"Open shell"),9,ue)):(i(),r("button",{key:1,onClick:V},"Close shell")),e[14]||(e[14]=n("span",{class:"grow"},null,-1)),t.value==="open"?(i(),r("span",de,[...e[13]||(e[13]=[n("span",{class:"dot pulse"},null,-1),a("connected",-1)])])):h("",!0)]),!C.value.length&&!m.value?(i(),r("p",ce," Nothing is running for this deployment, so there is nothing to open a shell in. ")):h("",!0),t.value==="closed"&&f.value?(i(),r("p",ve,"Session ended — "+y(f.value)+".",1)):h("",!0),n("div",{ref_key:"host",ref:p,class:"terminal-host","data-state":t.value},null,8,pe),e[15]||(e[15]=n("p",{class:"hint"}," Every session is recorded — who, which container, when — and the record is written when the shell opens, so a session that dies with the process still leaves one. ",-1))]))}}),_e=Z(me,[["__scopeId","data-v-3c081c5e"]]);export{_e as default};
3
+ //# sourceMappingURL=TerminalTab-C6gRXura.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";4rBAyBA,MAAMA,EAAQC,EAAA,EACRC,EAAKC,EAAS,IAAM,OAAOH,EAAM,OAAO,EAAE,CAAC,EA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B,aAAYF,EAAA,kBAEnDqC,EAAA,MAAAA,EAAA,IAAAF,EAGI,KAHD,MAAM,QAAO,uKAGhB","names":["route","useRoute","id","computed","SHELLS","rt","ref","loadError","container","shell","state","closeReason","host","term","shallowRef","fit","socket","observer","running","_a","c","loadContainers","r","api","problem","connect","Terminal","FitAddon","__vitePreload","n","t","f","proto","qs","ws","e","d","disconnect","teardown","_b","watch","onBeforeUnmount","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_cache","_createVNode","InfoHint","_createBlock","ErrorNote","_hoisted_3","_hoisted_4","$event","_Fragment","_renderList","_createTextVNode","_toDisplayString","_hoisted_7","s","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13"],"ignoreList":[],"sources":["../../src/views/tabs/TerminalTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A shell inside one of this deployment's containers.\n *\n * THE SERVER DECIDES WHICH CONTAINER. This picker is filled from `/runtime`, i.e. the containers the\n * deployment actually owns, and the server checks the name again on upgrade — a hand-typed\n * `?container=pstack-control` is a 404 there, not here. The picker is a convenience, never the\n * boundary.\n *\n * THE COOKIE IS THE CREDENTIAL. A browser cannot set an `Authorization` header on a WebSocket, which\n * is exactly why sessions are cookies (0.10.0) — the handshake is a same-origin GET and carries the\n * session automatically. There is no token in this URL and there must never be one: a URL lands in\n * proxy logs and browser history.\n *\n * NO PTY. The server runs `docker exec -i`, not `-it`, so there is no prompt, no ^C and no `top`.\n * That is stated on the page rather than left for the operator to discover as \"the terminal is\n * broken\" — see the banner below and the comment at the head of `terminal.ts`.\n */\nimport { computed, onBeforeUnmount, ref, shallowRef, watch } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { api, problem } from '../../api/client';\nimport type { RuntimeResponse } from '../../api/types';\nimport ErrorNote from '../../components/ErrorNote.vue';\nimport InfoHint from '../../components/InfoHint.vue';\n\nconst route = useRoute();\nconst id = computed(() => String(route.params.id));\n\nconst SHELLS = ['sh', 'bash', 'ash', 'zsh', 'fish'];\n\nconst rt = ref<RuntimeResponse | null>(null);\nconst loadError = ref('');\nconst container = ref('');\nconst shell = ref('sh');\nconst state = ref<'idle' | 'connecting' | 'open' | 'closed'>('idle');\nconst closeReason = ref('');\n\nconst host = ref<HTMLDivElement | null>(null);\n/** shallowRef: xterm's Terminal is a large mutable object and must not be made reactive. */\nconst term = shallowRef<import('@xterm/xterm').Terminal | null>(null);\nconst fit = shallowRef<import('@xterm/addon-fit').FitAddon | null>(null);\nconst socket = shallowRef<WebSocket | null>(null);\nlet observer: ResizeObserver | null = null;\n\nconst running = computed(() => rt.value?.containers.filter((c) => c.state === 'running') ?? []);\n\nasync function loadContainers() {\n const r = await api.get<RuntimeResponse>(\n `/api/deployments/${encodeURIComponent(id.value)}/runtime`,\n );\n if (!r.ok) {\n loadError.value = problem(r, \"list this deployment's containers\");\n return;\n }\n loadError.value = '';\n rt.value = r.body;\n if (!container.value) container.value = running.value[0]?.name ?? '';\n}\nvoid loadContainers();\n\nasync function connect() {\n if (state.value === 'connecting' || state.value === 'open') return;\n closeReason.value = '';\n state.value = 'connecting';\n\n // Loaded on demand, not in the app shell: xterm is ~250KB and only this tab needs it.\n const [{ Terminal }, { FitAddon }] = await Promise.all([\n import('@xterm/xterm'),\n import('@xterm/addon-fit'),\n ]);\n await import('@xterm/xterm/css/xterm.css');\n\n term.value?.dispose();\n const t = new Terminal({\n // The OUTPUT half of the line discipline the missing pty would have provided. A real terminal\n // converts NL to CR-NL on the way out (ONLCR); without it every `\\n` moves DOWN a row without\n // returning the carriage, and `ls` renders as a staircase marching off the right edge. The input\n // half — CR to NL — is done server-side; see `crToNl` in api.ts.\n convertEol: true,\n fontSize: 13,\n fontFamily: 'var(--font-mono, ui-monospace, monospace)',\n cursorBlink: true,\n theme: { background: '#0b0e14' },\n });\n const f = new FitAddon();\n t.loadAddon(f);\n if (host.value) {\n host.value.innerHTML = '';\n t.open(host.value);\n f.fit();\n }\n term.value = t;\n fit.value = f;\n\n observer?.disconnect();\n observer = new ResizeObserver(() => {\n try {\n f.fit();\n } catch {\n /* the element is detached mid-transition */\n }\n });\n if (host.value) observer.observe(host.value);\n\n const proto = location.protocol === 'https:' ? 'wss' : 'ws';\n const qs = new URLSearchParams({ container: container.value, shell: shell.value });\n const ws = new WebSocket(\n `${proto}://${location.host}/api/deployments/${encodeURIComponent(id.value)}/terminal?${qs}`,\n );\n ws.binaryType = 'arraybuffer';\n socket.value = ws;\n\n ws.onopen = () => {\n state.value = 'open';\n t.focus();\n };\n // Bytes, not text: decoding per frame would corrupt a multi-byte character split across two\n // reads. xterm takes a Uint8Array and handles the boundary itself.\n ws.onmessage = (e) =>\n t.write(typeof e.data === 'string' ? e.data : new Uint8Array(e.data as ArrayBuffer));\n ws.onclose = (e) => {\n state.value = 'closed';\n // A close CODE alone tells an operator nothing. 1006 in particular is the browser's \"it just\n // went away\", which here almost always means the upgrade was refused.\n closeReason.value =\n e.reason || (e.code === 1006 ? 'the connection dropped (the upgrade may have been refused)' : `code ${e.code}`);\n };\n ws.onerror = () => {\n if (state.value === 'connecting') closeReason.value = 'could not open the connection';\n };\n t.onData((d) => {\n if (ws.readyState === WebSocket.OPEN) ws.send(d);\n });\n}\n\nfunction disconnect() {\n socket.value?.close(1000, 'closed by the operator');\n}\n\nfunction teardown() {\n observer?.disconnect();\n observer = null;\n socket.value?.close();\n socket.value = null;\n term.value?.dispose();\n term.value = null;\n}\n\n// Switching container or shell must not leave the old shell running against a dead view.\nwatch([container, shell], () => {\n if (state.value === 'open' || state.value === 'connecting') disconnect();\n});\nwatch(id, () => {\n teardown();\n state.value = 'idle';\n void loadContainers();\n});\nonBeforeUnmount(teardown);\n</script>\n\n<template>\n <section class=\"stack\">\n <div class=\"banner warn\">\n <b>No TTY.</b> The shell runs without a terminal device, so there is no prompt, no\n <code>Ctrl-C</code>, and no full-screen programs (<code>top</code>, <code>vim</code>). Type a\n command and press Enter.\n <InfoHint label=\"why\">\n A pseudo-terminal needs a wrapper (<code>script</code>) whose flags differ across\n distributions, and it was never verified on a real host — so pstack ships the half it can\n stand behind. Everything an operator usually opens a shell for (<code>ls</code>,\n <code>cat</code>, <code>env</code>, <code>psql</code>, a migration) works.\n </InfoHint>\n </div>\n\n <ErrorNote v-if=\"loadError\" :text=\"loadError\" title=\"Could not list this deployment's containers.\" />\n\n <div class=\"row wrap\" style=\"gap: var(--s3); align-items: end\">\n <label class=\"field\">\n <span>Container</span>\n <select v-model=\"container\" :disabled=\"state === 'open' || state === 'connecting'\">\n <option v-for=\"c in running\" :key=\"c.id\" :value=\"c.name\">\n {{ c.name }}<template v-if=\"c.service\"> — {{ c.service }}</template>\n </option>\n </select>\n </label>\n <label class=\"field\">\n <span>Shell</span>\n <select v-model=\"shell\" :disabled=\"state === 'open' || state === 'connecting'\">\n <option v-for=\"s in SHELLS\" :key=\"s\" :value=\"s\">{{ s }}</option>\n </select>\n </label>\n <button\n v-if=\"state !== 'open'\"\n class=\"primary\"\n :disabled=\"!container || state === 'connecting'\"\n @click=\"connect\"\n >\n {{ state === 'connecting' ? 'Connecting…' : 'Open shell' }}\n </button>\n <button v-else @click=\"disconnect\">Close shell</button>\n <span class=\"grow\" />\n <span v-if=\"state === 'open'\" class=\"badge ok\"><span class=\"dot pulse\" />connected</span>\n </div>\n\n <p v-if=\"!running.length && !loadError\" class=\"hint\">\n Nothing is running for this deployment, so there is nothing to open a shell in.\n </p>\n\n <p v-if=\"state === 'closed' && closeReason\" class=\"hint\">Session ended — {{ closeReason }}.</p>\n\n <div ref=\"host\" class=\"terminal-host\" :data-state=\"state\" />\n\n <p class=\"hint\">\n Every session is recorded — who, which container, when — and the record is written when the\n shell opens, so a session that dies with the process still leaves one.\n </p>\n </section>\n</template>\n\n<style scoped>\n.terminal-host {\n min-height: 26rem;\n border: 1px solid var(--border);\n border-radius: var(--r3);\n background: #0b0e14;\n padding: var(--s2);\n overflow: hidden;\n}\n.terminal-host[data-state='idle'] {\n display: none;\n}\n</style>\n"],"file":"assets/TerminalTab-C6gRXura.js"}
@@ -1,2 +1,2 @@
1
- import{d as k,c as r,a,F as f,r as h,o as c}from"./index-DXW03q8i.js";const b=["value","aria-label","onInput"],V=["value","aria-label","onInput"],_=["aria-label","onClick"],x=k({__name:"VarEditor",props:{modelValue:{}},emits:["update:modelValue","change"],setup(d,{emit:p}){const s=d,t=p;function m(u,l){const o=s.modelValue.map((e,n)=>n===u?{...e,...l}:e);t("update:modelValue",o),t("change")}function i(){t("update:modelValue",[...s.modelValue,{k:"",v:""}]),t("change")}function v(u){const l=s.modelValue.filter((o,e)=>e!==u);t("update:modelValue",l.length?l:[{k:"",v:""}]),t("change")}return(u,l)=>(c(),r("div",null,[l[0]||(l[0]=a("div",{class:"kv head"},[a("span",null,"name"),a("span",null,"value"),a("span")],-1)),(c(!0),r(f,null,h(d.modelValue,(o,e)=>(c(),r("div",{key:e,class:"kv"},[a("input",{type:"text",value:o.k,"aria-label":`variable name ${e+1}`,placeholder:"PR",spellcheck:"false",autocomplete:"off",onInput:n=>m(e,{k:n.target.value.trim()})},null,40,b),a("input",{type:"text",value:o.v,"aria-label":`variable value ${e+1}`,placeholder:"7",spellcheck:"false",autocomplete:"off",onInput:n=>m(e,{v:n.target.value})},null,40,V),a("button",{class:"sm ghost","aria-label":`remove variable ${e+1}`,onClick:n=>v(e)},"−",8,_)]))),128)),a("button",{class:"sm",onClick:i},"+ variable")]))}});export{x as _};
2
- //# sourceMappingURL=VarEditor.vue_vue_type_script_setup_true_lang-D3_cdVoO.js.map
1
+ import{d as k,c as r,a,F as f,x as h,o as c}from"./index-Bygbts8t.js";const b=["value","aria-label","onInput"],V=["value","aria-label","onInput"],_=["aria-label","onClick"],x=k({__name:"VarEditor",props:{modelValue:{}},emits:["update:modelValue","change"],setup(d,{emit:p}){const s=d,t=p;function m(u,l){const o=s.modelValue.map((e,n)=>n===u?{...e,...l}:e);t("update:modelValue",o),t("change")}function i(){t("update:modelValue",[...s.modelValue,{k:"",v:""}]),t("change")}function v(u){const l=s.modelValue.filter((o,e)=>e!==u);t("update:modelValue",l.length?l:[{k:"",v:""}]),t("change")}return(u,l)=>(c(),r("div",null,[l[0]||(l[0]=a("div",{class:"kv head"},[a("span",null,"name"),a("span",null,"value"),a("span")],-1)),(c(!0),r(f,null,h(d.modelValue,(o,e)=>(c(),r("div",{key:e,class:"kv"},[a("input",{type:"text",value:o.k,"aria-label":`variable name ${e+1}`,placeholder:"PR",spellcheck:"false",autocomplete:"off",onInput:n=>m(e,{k:n.target.value.trim()})},null,40,b),a("input",{type:"text",value:o.v,"aria-label":`variable value ${e+1}`,placeholder:"7",spellcheck:"false",autocomplete:"off",onInput:n=>m(e,{v:n.target.value})},null,40,V),a("button",{class:"sm ghost","aria-label":`remove variable ${e+1}`,onClick:n=>v(e)},"−",8,_)]))),128)),a("button",{class:"sm",onClick:i},"+ variable")]))}});export{x as _};
2
+ //# sourceMappingURL=VarEditor.vue_vue_type_script_setup_true_lang-CZcKBdbw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VarEditor.vue_vue_type_script_setup_true_lang-D3_cdVoO.js","sources":["../../src/components/VarEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The free-form variable editor, shared by the Config tab and Submit.\n *\n * Free-form on purpose: the spec's `env:` block lists what it DECLARES, which is not the same as\n * what it NEEDS — `stack: pr-${PR}` consumes `PR` without declaring it anywhere. The authoritative\n * list of what is missing is the server's 400 text, not this form.\n */\nimport type { VarPair } from '../api/types';\n\nconst props = defineProps<{ modelValue: VarPair[] }>();\nconst emit = defineEmits<{ 'update:modelValue': [VarPair[]]; change: [] }>();\n\nfunction set(i: number, patch: Partial<VarPair>): void {\n const next = props.modelValue.map((e, n) => (n === i ? { ...e, ...patch } : e));\n emit('update:modelValue', next);\n emit('change');\n}\n\nfunction add(): void {\n emit('update:modelValue', [...props.modelValue, { k: '', v: '' }]);\n emit('change');\n}\n\nfunction remove(i: number): void {\n const next = props.modelValue.filter((_, n) => n !== i);\n // Never leave the editor with no rows: an empty list looks like a broken control.\n emit('update:modelValue', next.length ? next : [{ k: '', v: '' }]);\n emit('change');\n}\n</script>\n\n<template>\n <div>\n <div class=\"kv head\"><span>name</span><span>value</span><span /></div>\n <div v-for=\"(e, i) in modelValue\" :key=\"i\" class=\"kv\">\n <input\n type=\"text\"\n :value=\"e.k\"\n :aria-label=\"`variable name ${i + 1}`\"\n placeholder=\"PR\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"set(i, { k: ($event.target as HTMLInputElement).value.trim() })\"\n />\n <input\n type=\"text\"\n :value=\"e.v\"\n :aria-label=\"`variable value ${i + 1}`\"\n placeholder=\"7\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"set(i, { v: ($event.target as HTMLInputElement).value })\"\n />\n <button class=\"sm ghost\" :aria-label=\"`remove variable ${i + 1}`\" @click=\"remove(i)\">−</button>\n </div>\n <button class=\"sm\" @click=\"add\">+ variable</button>\n </div>\n</template>\n"],"names":["props","__props","emit","__emit","set","i","patch","next","add","remove","_","n","_createElementBlock","_createElementVNode","_openBlock","_Fragment","_renderList","e","$event","_hoisted_3"],"mappings":"kRAUA,MAAMA,EAAQC,EACRC,EAAOC,EAEb,SAASC,EAAIC,EAAWC,EAA+B,CACrD,MAAMC,EAAOP,EAAM,WAAW,IAAI,CAAC,EAAG,IAAO,IAAMK,EAAI,CAAE,GAAG,EAAG,GAAGC,CAAA,EAAU,CAAE,EAC9EJ,EAAK,oBAAqBK,CAAI,EAC9BL,EAAK,QAAQ,CACf,CAEA,SAASM,GAAY,CACnBN,EAAK,oBAAqB,CAAC,GAAGF,EAAM,WAAY,CAAE,EAAG,GAAI,EAAG,EAAA,CAAI,CAAC,EACjEE,EAAK,QAAQ,CACf,CAEA,SAASO,EAAOJ,EAAiB,CAC/B,MAAME,EAAOP,EAAM,WAAW,OAAO,CAACU,EAAGC,IAAMA,IAAMN,CAAC,EAEtDH,EAAK,oBAAqBK,EAAK,OAASA,EAAO,CAAC,CAAE,EAAG,GAAI,EAAG,EAAA,CAAI,CAAC,EACjEL,EAAK,QAAQ,CACf,mBAIEU,EAwBM,MAAA,KAAA,aAvBJC,EAAsE,MAAA,CAAjE,MAAM,WAAS,CAACA,EAAiB,YAAX,MAAI,EAAOA,EAAkB,YAAZ,OAAK,EAAOA,EAAQ,MAAA,CAAA,QAChEC,EAAA,EAAA,EAAAF,EAoBMG,EAAA,KAAAC,EApBgBf,EAAA,WAAU,CAAnBgB,EAAGZ,SAAhBO,EAoBM,MAAA,CApB6B,IAAKP,EAAG,MAAM,IAAA,GAC/CQ,EAQE,QAAA,CAPA,KAAK,OACJ,MAAOI,EAAE,EACT,8BAA6BZ,EAAC,CAAA,GAC/B,YAAY,KACZ,WAAW,QACX,aAAa,MACZ,QAAKa,GAAEd,EAAIC,EAAC,CAAA,EAAQa,EAAO,OAA4B,MAAM,MAAI,CAAA,CAAA,aAEpEL,EAQE,QAAA,CAPA,KAAK,OACJ,MAAOI,EAAE,EACT,+BAA8BZ,EAAC,CAAA,GAChC,YAAY,IACZ,WAAW,QACX,aAAa,MACZ,QAAKa,GAAEd,EAAIC,KAASa,EAAO,OAA4B,KAAA,CAAK,CAAA,aAE/DL,EAA+F,SAAA,CAAvF,MAAM,WAAY,gCAA+BR,EAAC,CAAA,GAAS,QAAKa,GAAET,EAAOJ,CAAC,CAAA,EAAG,IAAC,EAAAc,CAAA,CAAA,WAExFN,EAAmD,SAAA,CAA3C,MAAM,KAAM,QAAOL,CAAA,EAAK,YAAU,CAAA"}
1
+ {"version":3,"file":"VarEditor.vue_vue_type_script_setup_true_lang-CZcKBdbw.js","sources":["../../src/components/VarEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The free-form variable editor, shared by the Config tab and Submit.\n *\n * Free-form on purpose: the spec's `env:` block lists what it DECLARES, which is not the same as\n * what it NEEDS — `stack: pr-${PR}` consumes `PR` without declaring it anywhere. The authoritative\n * list of what is missing is the server's 400 text, not this form.\n */\nimport type { VarPair } from '../api/types';\n\nconst props = defineProps<{ modelValue: VarPair[] }>();\nconst emit = defineEmits<{ 'update:modelValue': [VarPair[]]; change: [] }>();\n\nfunction set(i: number, patch: Partial<VarPair>): void {\n const next = props.modelValue.map((e, n) => (n === i ? { ...e, ...patch } : e));\n emit('update:modelValue', next);\n emit('change');\n}\n\nfunction add(): void {\n emit('update:modelValue', [...props.modelValue, { k: '', v: '' }]);\n emit('change');\n}\n\nfunction remove(i: number): void {\n const next = props.modelValue.filter((_, n) => n !== i);\n // Never leave the editor with no rows: an empty list looks like a broken control.\n emit('update:modelValue', next.length ? next : [{ k: '', v: '' }]);\n emit('change');\n}\n</script>\n\n<template>\n <div>\n <div class=\"kv head\"><span>name</span><span>value</span><span /></div>\n <div v-for=\"(e, i) in modelValue\" :key=\"i\" class=\"kv\">\n <input\n type=\"text\"\n :value=\"e.k\"\n :aria-label=\"`variable name ${i + 1}`\"\n placeholder=\"PR\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"set(i, { k: ($event.target as HTMLInputElement).value.trim() })\"\n />\n <input\n type=\"text\"\n :value=\"e.v\"\n :aria-label=\"`variable value ${i + 1}`\"\n placeholder=\"7\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n @input=\"set(i, { v: ($event.target as HTMLInputElement).value })\"\n />\n <button class=\"sm ghost\" :aria-label=\"`remove variable ${i + 1}`\" @click=\"remove(i)\">−</button>\n </div>\n <button class=\"sm\" @click=\"add\">+ variable</button>\n </div>\n</template>\n"],"names":["props","__props","emit","__emit","set","i","patch","next","add","remove","_","n","_createElementBlock","_createElementVNode","_openBlock","_Fragment","_renderList","e","$event","_hoisted_3"],"mappings":"kRAUA,MAAMA,EAAQC,EACRC,EAAOC,EAEb,SAASC,EAAIC,EAAWC,EAA+B,CACrD,MAAMC,EAAOP,EAAM,WAAW,IAAI,CAAC,EAAG,IAAO,IAAMK,EAAI,CAAE,GAAG,EAAG,GAAGC,CAAA,EAAU,CAAE,EAC9EJ,EAAK,oBAAqBK,CAAI,EAC9BL,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,CAAA"}
@@ -0,0 +1,2 @@
1
+ function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}export{e as g};
2
+ //# sourceMappingURL=_commonjsHelpers-CqkleIqs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers-CqkleIqs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ const s=(t,r)=>{const o=t.__vccOpts||t;for(const[c,e]of r)o[c]=e;return o};export{s as _};
2
+ //# sourceMappingURL=_plugin-vue_export-helper-DlAUqK2U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_plugin-vue_export-helper-DlAUqK2U.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{g}from"./_commonjsHelpers-CqkleIqs.js";function _(i,s){for(var o=0;o<s.length;o++){const t=s[o];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in i)){const r=Object.getOwnPropertyDescriptor(t,e);r&&Object.defineProperty(i,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function y(){return d||(d=1,(function(i,s){(function(o,t){i.exports=t()})(self,(()=>(()=>{var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const r=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(r._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,r=e._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:e.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),m=parseInt(l.getPropertyValue("height")),u=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),h=m-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),f=u-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(f/r.css.cell.width)),rows:Math.max(1,Math.floor(h/r.css.cell.height))}}}})(),o})()))})(a)),a.exports}var p=y();const w=g(p),x=_({__proto__:null,default:w},[p]);export{x as a};
2
+ //# sourceMappingURL=addon-fit-CevVMrUA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addon-fit-CevVMrUA.js","sources":["../../../../node_modules/.bun/@xterm+addon-fit@0.10.0+c27fd418321dfbfb/node_modules/@xterm/addon-fit/lib/addon-fit.js"],"sourcesContent":["!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(self,(()=>(()=>{\"use strict\";var e={};return(()=>{var t=e;Object.defineProperty(t,\"__esModule\",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,t=e._renderService.dimensions;if(0===t.css.cell.width||0===t.css.cell.height)return;const r=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(i.getPropertyValue(\"height\")),s=Math.max(0,parseInt(i.getPropertyValue(\"width\"))),n=window.getComputedStyle(this._terminal.element),l=o-(parseInt(n.getPropertyValue(\"padding-top\"))+parseInt(n.getPropertyValue(\"padding-bottom\"))),a=s-(parseInt(n.getPropertyValue(\"padding-right\"))+parseInt(n.getPropertyValue(\"padding-left\")))-r;return{cols:Math.max(2,Math.floor(a/t.css.cell.width)),rows:Math.max(1,Math.floor(l/t.css.cell.height))}}}})(),e})()));\n//# sourceMappingURL=addon-fit.js.map"],"names":["e","module","t","r","i","o","s","l","a"],"mappings":"qcAAC,SAASA,EAAE,EAAE,CAAmDC,EAAA,QAAe,EAAC,CAAkH,GAAE,MAAM,KAAK,IAAI,CAAc,IAAID,EAAE,GAAG,OAAO,IAAI,CAAC,IAAI,EAAEA,EAAE,OAAO,eAAe,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,SAAS,OAAO,EAAE,SAAS,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,SAAS,CAAA,CAAE,KAAK,CAAC,MAAM,EAAE,KAAK,kBAAiB,EAAG,GAAG,CAAC,GAAG,CAAC,KAAK,WAAW,MAAM,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,OAAO,MAAME,EAAE,KAAK,UAAU,MAAM,KAAK,UAAU,OAAO,EAAE,MAAM,KAAK,UAAU,OAAO,EAAE,OAAOA,EAAE,eAAe,MAAK,EAAG,KAAK,UAAU,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAA2B,GAAvB,CAAC,KAAK,WAAoB,CAAC,KAAK,UAAU,SAAS,CAAC,KAAK,UAAU,QAAQ,cAAc,OAAO,MAAM,EAAE,KAAK,UAAU,MAAMA,EAAE,EAAE,eAAe,WAAW,GAAOA,EAAE,IAAI,KAAK,QAAf,GAA0BA,EAAE,IAAI,KAAK,SAAf,EAAsB,OAAO,MAAMC,EAAM,KAAK,UAAU,QAAQ,aAA3B,EAAsC,EAAE,EAAE,SAAS,eAAeC,EAAE,OAAO,iBAAiB,KAAK,UAAU,QAAQ,aAAa,EAAEC,EAAE,SA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