| 1169 | ]; |
| 1170 | |
| 1171 | function initDeploy(host) { |
| 1172 | if (!host) return; |
| 1173 | host.innerHTML = ""; |
| 1174 | host.classList.add("lc-deploy"); |
| 1175 | |
| 1176 | let active = 0; |
| 1177 | |
| 1178 | // Three target picker cards |
| 1179 | const grid = htmlEl("div", { class: "lc-deploy__grid" }); |
| 1180 | const cards = DEPLOY_TARGETS.map((t, i) => { |
| 1181 | const card = htmlEl("button", { type: "button", class: "lc-deploy__card", "data-i": i }); |
| 1182 | card.appendChild(htmlEl("div", { class: "lc-deploy__flag lc-mono" }, "--deployment-target " + t.id)); |
| 1183 | card.appendChild(htmlEl("div", { class: "lc-deploy__label" }, t.label)); |
| 1184 | card.appendChild(htmlEl("div", { class: "lc-deploy__blurb" }, t.blurb)); |
| 1185 | card.addEventListener("click", () => { active = i; render(); }); |
| 1186 | grid.appendChild(card); |
| 1187 | return card; |
| 1188 | }); |
| 1189 | host.appendChild(grid); |
| 1190 | |
| 1191 | // Dry-run output |
| 1192 | const cmdBlock = htmlEl("pre", { class: "lc-deploy__cmd" }); |
| 1193 | const cmdCode = htmlEl("code"); |
| 1194 | cmdBlock.appendChild(cmdCode); |
| 1195 | host.appendChild(cmdBlock); |
| 1196 | |
| 1197 | // Per-target pipeline |
| 1198 | const pipelineWrap = htmlEl("div", { class: "lc-deploy__pipeline" }); |
| 1199 | const pipelineHead = htmlEl("p", { class: "lc-mono lc-muted" }, ""); |
| 1200 | const pipelineList = htmlEl("ol", { class: "lc-deploy__steps" }); |
| 1201 | pipelineWrap.appendChild(pipelineHead); |
| 1202 | pipelineWrap.appendChild(pipelineList); |
| 1203 | host.appendChild(pipelineWrap); |
| 1204 | |
| 1205 | function render() { |
| 1206 | cards.forEach((c, i) => c.classList.toggle("lc-deploy__card--on", i === active)); |
| 1207 | const t = DEPLOY_TARGETS[active]; |
| 1208 | cmdCode.textContent = "$ " + t.cmd; |
| 1209 | pipelineHead.textContent = "what `agents-cli deploy` runs · target = " + t.id; |
| 1210 | pipelineList.innerHTML = ""; |
| 1211 | t.pipeline.forEach((p, i) => { |
| 1212 | const li = htmlEl("li"); |
| 1213 | li.appendChild(htmlEl("span", { class: "lc-deploy__num lc-mono" }, String(i + 1))); |
| 1214 | const detail = htmlEl("div"); |
| 1215 | detail.appendChild(htmlEl("code", { class: "lc-deploy__tool" }, p.tool)); |
| 1216 | detail.appendChild(htmlEl("span", { class: "lc-deploy__what" }, " — " + p.what)); |
| 1217 | li.appendChild(detail); |
| 1218 | pipelineList.appendChild(li); |
| 1219 | }); |
| 1220 | } |
| 1221 | render(); |
| 1222 | } |
| 1223 | |
| 1224 | // ─────────────────────────────────────────── 10. PUBLISH CARD ─────────── |
| 1225 | |