@trops/dash-core 0.1.854 → 0.1.855

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.
package/dist/index.esm.js CHANGED
@@ -14372,12 +14372,29 @@ function normalizeType(name) {
14372
14372
  return ALIASES[dashed.replace(/-/g, "")] || dashed;
14373
14373
  }
14374
14374
 
14375
- /** The provider types the user has (from AppContext.providers). */
14375
+ /**
14376
+ * What the user has, as the plan names it (from AppContext.providers): each
14377
+ * provider's type and its name — a plan that names one of the user's
14378
+ * providers ("Work Mail") has it, whatever its type ("custom").
14379
+ */
14376
14380
  function providerTypesOf(providers) {
14377
14381
  var list = Array.isArray(providers) ? providers : Object.values(providers || {});
14378
- return new Set(list.map(function (p) {
14379
- return normalizeType(p && p.type);
14380
- }).filter(Boolean));
14382
+ var out = new Set();
14383
+ var _iterator = _createForOfIteratorHelper$1c(list),
14384
+ _step;
14385
+ try {
14386
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
14387
+ var p = _step.value;
14388
+ if (!p) continue;
14389
+ if (normalizeType(p.type)) out.add(normalizeType(p.type));
14390
+ if (normalizeType(p.name)) out.add(normalizeType(p.name));
14391
+ }
14392
+ } catch (err) {
14393
+ _iterator.e(err);
14394
+ } finally {
14395
+ _iterator.f();
14396
+ }
14397
+ return out;
14381
14398
  }
14382
14399
  var titleCase$2 = function titleCase(t) {
14383
14400
  return String(t).split("-").map(function (w) {
@@ -14392,6 +14409,102 @@ var PROVIDER_NAMES$1 = {
14392
14409
  hubspot: "HubSpot",
14393
14410
  websocket: "WebSocket"
14394
14411
  };
14412
+ var providerList = function providerList(providers) {
14413
+ return (Array.isArray(providers) ? providers : Object.values(providers || {})).filter(function (p) {
14414
+ return p && p.name;
14415
+ });
14416
+ };
14417
+
14418
+ /**
14419
+ * The user's providers to offer for a needed type, closest first: the
14420
+ * same type, then MCP servers (most plans' tools are MCP), then the rest.
14421
+ * @returns {Array<{ name, type, providerClass }>}
14422
+ */
14423
+ function providerChoices(providers, providerType) {
14424
+ var want = normalizeType(providerType);
14425
+ var rank = function rank(p) {
14426
+ return normalizeType(p.type) === want || normalizeType(p.name) === want ? 0 : p.providerClass === "mcp" ? 1 : 2;
14427
+ };
14428
+ return providerList(providers).map(function (p) {
14429
+ return {
14430
+ name: p.name,
14431
+ type: p.type || "",
14432
+ providerClass: p.providerClass || null
14433
+ };
14434
+ }).sort(function (a, b) {
14435
+ return rank(a) - rank(b) || a.name.localeCompare(b.name);
14436
+ });
14437
+ }
14438
+
14439
+ /**
14440
+ * Which of the providers made in the Connect window stands in for a needed
14441
+ * type: one of that type (or name); else the only one made; else none —
14442
+ * the user picks (adding Slack while there never replaces Gmail).
14443
+ */
14444
+ function createdFor(created, providerType) {
14445
+ var list = (created || []).filter(function (p) {
14446
+ return p && p.name;
14447
+ });
14448
+ var want = normalizeType(providerType);
14449
+ var same = list.filter(function (p) {
14450
+ return normalizeType(p.type) === want || normalizeType(p.name) === want;
14451
+ });
14452
+ if (same.length) return same[same.length - 1];
14453
+ return list.length === 1 ? list[0] : null;
14454
+ }
14455
+
14456
+ /**
14457
+ * The plan using one of the user's providers wherever it needed
14458
+ * `providerType`: widgets name provider types, so they take its type; bots
14459
+ * name providers, so they take its name. The checklist, the Builder and
14460
+ * the bot's setup then all see the provider the user chose.
14461
+ */
14462
+ function choosePlanProvider(plan, providerType, provider) {
14463
+ if (!plan || !provider || !provider.name) return plan;
14464
+ var want = normalizeType(providerType);
14465
+ var matches = function matches(t) {
14466
+ return normalizeType(t) === want;
14467
+ };
14468
+ var type = provider.type || provider.name;
14469
+ var pieces = (plan.pieces || []).map(function (p) {
14470
+ if (!p) return p;
14471
+ var next = p;
14472
+ if (Array.isArray(p.providers) && p.providers.some(matches)) {
14473
+ // Its type, and that exact provider pinned (`provider: { type: name }`)
14474
+ // — a custom MCP server's type is just "custom", and the user may have
14475
+ // two of a type.
14476
+ var pinned = {};
14477
+ for (var _i = 0, _Object$entries = Object.entries(p.provider && _typeof(p.provider) === "object" ? p.provider : {}); _i < _Object$entries.length; _i++) {
14478
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
14479
+ k = _Object$entries$_i[0],
14480
+ v = _Object$entries$_i[1];
14481
+ if (!matches(k)) pinned[k] = v;
14482
+ }
14483
+ pinned[type] = provider.name;
14484
+ next = _objectSpread$1N(_objectSpread$1N({}, next), {}, {
14485
+ providers: _toConsumableArray(new Set(p.providers.map(function (t) {
14486
+ return matches(t) ? type : t;
14487
+ }))),
14488
+ provider: pinned
14489
+ });
14490
+ }
14491
+ if (Array.isArray(p.tools) && p.tools.some(function (t) {
14492
+ return t && matches(t.provider);
14493
+ })) {
14494
+ next = _objectSpread$1N(_objectSpread$1N({}, next), {}, {
14495
+ tools: p.tools.map(function (t) {
14496
+ return t && matches(t.provider) ? _objectSpread$1N(_objectSpread$1N({}, t), {}, {
14497
+ provider: provider.name
14498
+ }) : t;
14499
+ })
14500
+ });
14501
+ }
14502
+ return next;
14503
+ });
14504
+ return _objectSpread$1N(_objectSpread$1N({}, plan), {}, {
14505
+ pieces: pieces
14506
+ });
14507
+ }
14395
14508
 
14396
14509
  /** "gmail" / "Google Calendar" / "github" → "Gmail" / "Google Calendar" / "GitHub". */
14397
14510
  function providerLabel(name) {
@@ -14425,16 +14538,16 @@ function buildChecklist(plan) {
14425
14538
  }
14426
14539
  });
14427
14540
  var seenType = new Set();
14428
- var _iterator = _createForOfIteratorHelper$1c(pieces),
14429
- _step;
14541
+ var _iterator2 = _createForOfIteratorHelper$1c(pieces),
14542
+ _step2;
14430
14543
  try {
14431
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
14432
- var p = _step.value;
14433
- var _iterator3 = _createForOfIteratorHelper$1c(p && p.providers || []),
14434
- _step3;
14544
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
14545
+ var p = _step2.value;
14546
+ var _iterator4 = _createForOfIteratorHelper$1c(p && p.providers || []),
14547
+ _step4;
14435
14548
  try {
14436
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
14437
- var t = _step3.value;
14549
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
14550
+ var t = _step4.value;
14438
14551
  var type = normalizeType(t);
14439
14552
  if (!type || have.has(type) || seenType.has(type)) continue;
14440
14553
  seenType.add(type);
@@ -14446,22 +14559,22 @@ function buildChecklist(plan) {
14446
14559
  });
14447
14560
  }
14448
14561
  } catch (err) {
14449
- _iterator3.e(err);
14562
+ _iterator4.e(err);
14450
14563
  } finally {
14451
- _iterator3.f();
14564
+ _iterator4.f();
14452
14565
  }
14453
14566
  }
14454
14567
  // Planner steps that aren't an install or a connect above.
14455
14568
  } catch (err) {
14456
- _iterator.e(err);
14569
+ _iterator2.e(err);
14457
14570
  } finally {
14458
- _iterator.f();
14571
+ _iterator2.f();
14459
14572
  }
14460
- var _iterator2 = _createForOfIteratorHelper$1c(plan && plan.beforeBuilding || []),
14461
- _step2;
14573
+ var _iterator3 = _createForOfIteratorHelper$1c(plan && plan.beforeBuilding || []),
14574
+ _step3;
14462
14575
  try {
14463
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
14464
- var b = _step2.value;
14576
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
14577
+ var b = _step3.value;
14465
14578
  if (!b || b.kind !== "approve" || !b.what) continue;
14466
14579
  items.push({
14467
14580
  id: "approve:".concat(b.what),
@@ -14470,9 +14583,9 @@ function buildChecklist(plan) {
14470
14583
  });
14471
14584
  }
14472
14585
  } catch (err) {
14473
- _iterator2.e(err);
14586
+ _iterator3.e(err);
14474
14587
  } finally {
14475
- _iterator2.f();
14588
+ _iterator3.f();
14476
14589
  }
14477
14590
  return items;
14478
14591
  }
@@ -14599,7 +14712,7 @@ function countsLine(plan) {
14599
14712
  }
14600
14713
  var parts = [];
14601
14714
  var _loop = function _loop() {
14602
- var _arr$_i = _slicedToArray(_arr[_i], 3),
14715
+ var _arr$_i = _slicedToArray(_arr[_i2], 3),
14603
14716
  kind = _arr$_i[0],
14604
14717
  one = _arr$_i[1],
14605
14718
  many = _arr$_i[2];
@@ -14610,18 +14723,18 @@ function countsLine(plan) {
14610
14723
  // A piece with no source (a plan's layout often has none) is one the
14611
14724
  // plan makes: new — not "1 undefined layout" (QA 2026-10-22).
14612
14725
  var bySource = {};
14613
- var _iterator4 = _createForOfIteratorHelper$1c(group),
14614
- _step4;
14726
+ var _iterator5 = _createForOfIteratorHelper$1c(group),
14727
+ _step5;
14615
14728
  try {
14616
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
14617
- var p = _step4.value;
14729
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
14730
+ var p = _step5.value;
14618
14731
  var _src = pieceSource(p);
14619
14732
  bySource[_src] = (bySource[_src] || 0) + 1;
14620
14733
  }
14621
14734
  } catch (err) {
14622
- _iterator4.e(err);
14735
+ _iterator5.e(err);
14623
14736
  } finally {
14624
- _iterator4.f();
14737
+ _iterator5.f();
14625
14738
  }
14626
14739
  var detail = Object.entries(bySource).map(function (_ref4) {
14627
14740
  var _ref5 = _slicedToArray(_ref4, 2),
@@ -14636,7 +14749,7 @@ function countsLine(plan) {
14636
14749
  parts.push("".concat(group.length, " ").concat(group.length === 1 ? one : many, ": ").concat(detail));
14637
14750
  }
14638
14751
  };
14639
- for (var _i = 0, _arr = [["bot", "bot", "bots"], ["widget", "widget", "widgets"], ["layout", "layout", "layouts"]]; _i < _arr.length; _i++) {
14752
+ for (var _i2 = 0, _arr = [["bot", "bot", "bots"], ["widget", "widget", "widgets"], ["layout", "layout", "layouts"]]; _i2 < _arr.length; _i2++) {
14640
14753
  if (_loop()) continue;
14641
14754
  }
14642
14755
  if (theme) parts.push("the ".concat(theme.name, " theme"));
@@ -14732,17 +14845,17 @@ function botDetails(piece) {
14732
14845
  return s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
14733
14846
  };
14734
14847
  var starts = [];
14735
- var _iterator6 = _createForOfIteratorHelper$1c(Array.isArray(p.on) ? p.on : []),
14736
- _step6;
14848
+ var _iterator7 = _createForOfIteratorHelper$1c(Array.isArray(p.on) ? p.on : []),
14849
+ _step7;
14737
14850
  try {
14738
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
14739
- var o = _step6.value;
14851
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
14852
+ var o = _step7.value;
14740
14853
  if (o && o.widget && o.event) starts.push("when ".concat(o.widget, " sends ").concat(o.event));
14741
14854
  }
14742
14855
  } catch (err) {
14743
- _iterator6.e(err);
14856
+ _iterator7.e(err);
14744
14857
  } finally {
14745
- _iterator6.f();
14858
+ _iterator7.f();
14746
14859
  }
14747
14860
  var sched = p.schedule && p.schedule.cron;
14748
14861
  if (sched) starts.push(scheduleLabel(sched));
@@ -57664,9 +57777,14 @@ var ProvidersSection = function ProvidersSection(_ref) {
57664
57777
  setIsAddingMcp(false);
57665
57778
  setIsCreating(false);
57666
57779
  setIsAddingWs(false);
57780
+ // A deep link that named a type but not its kind (a plan's "Connect
57781
+ // Home Assistant"): the type fills the credential form if that's
57782
+ // what's chosen.
57783
+ chooserType.current = providerType || null;
57667
57784
  setIsShowingClassChooser(true);
57668
57785
  }
57669
57786
  }
57787
+ var chooserType = useRef(null);
57670
57788
  var prevCreateRequested = useRef(false);
57671
57789
  useEffect(function () {
57672
57790
  // The header's New Provider always starts at the class chooser — the
@@ -57838,6 +57956,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
57838
57956
  setIsAddingWs(true);
57839
57957
  } else {
57840
57958
  setIsCreating(true);
57959
+ if (chooserType.current) setFormType(chooserType.current);
57841
57960
  }
57842
57961
  }
57843
57962
  });
@@ -58265,11 +58384,28 @@ var InstallReviewDialog = function InstallReviewDialog(_ref2) {
58265
58384
  });
58266
58385
  };
58267
58386
 
58387
+ /**
58388
+ * The MCP catalog entry for a plan's provider type — by id, type or name
58389
+ * ("google-calendar", "Google Calendar") — or null.
58390
+ */
58391
+ function catalogMatch(servers, providerType) {
58392
+ var want = normalizeType(providerType);
58393
+ if (!want) return null;
58394
+ return (servers || []).find(function (sv) {
58395
+ return sv && [sv.id, sv.type, sv.name].some(function (v) {
58396
+ return v && normalizeType(v) === want;
58397
+ });
58398
+ }) || null;
58399
+ }
58400
+
58268
58401
  /**
58269
58402
  * Connect a provider without leaving the plan: the Providers screen, opened
58270
- * on "add <type>", in a window over Create. Types in the MCP catalog open
58271
- * the catalog with that server picked; anything else opens the credential
58272
- * form with the type filled in.
58403
+ * on "add <type>", in a window over Create. A type in the MCP catalog opens
58404
+ * that catalog entry, picked; anything else asks which kind it is (an MCP
58405
+ * server, an API key, a WebSocket) — never a guess.
58406
+ *
58407
+ * `onClose(created)`: the providers made while it was open (the plan uses
58408
+ * the newest for this item).
58273
58409
  */
58274
58410
  var ConnectDialog = function ConnectDialog(_ref4) {
58275
58411
  var item = _ref4.item,
@@ -58284,29 +58420,49 @@ var ConnectDialog = function ConnectDialog(_ref4) {
58284
58420
  // null while looking the type up in the MCP catalog.
58285
58421
  var _useState3 = useState(null),
58286
58422
  _useState4 = _slicedToArray(_useState3, 2),
58287
- providerClass = _useState4[0],
58288
- setProviderClass = _useState4[1];
58423
+ link = _useState4[0],
58424
+ setLink = _useState4[1];
58425
+ // The providers there were when it opened: what's new was made here.
58426
+ var before = useRef(null);
58427
+ if (before.current === null) {
58428
+ before.current = new Set(Object.values(app.providers || {}).map(function (p) {
58429
+ return p && p.name;
58430
+ }).filter(Boolean));
58431
+ }
58289
58432
  useEffect(function () {
58290
58433
  var _window$mainApi2;
58291
58434
  var alive = true;
58292
58435
  var getCatalog = (_window$mainApi2 = window.mainApi) === null || _window$mainApi2 === void 0 || (_window$mainApi2 = _window$mainApi2.mcp) === null || _window$mainApi2 === void 0 ? void 0 : _window$mainApi2.getCatalog;
58293
58436
  Promise.resolve(getCatalog ? getCatalog() : null).then(function (res) {
58294
- var servers = res && res.catalog || [];
58295
- var inCatalog = servers.some(function (sv) {
58296
- return sv && (sv.id === item.providerType || sv.type === item.providerType);
58437
+ var match = catalogMatch(res && res.catalog, item.providerType);
58438
+ if (!alive) return;
58439
+ setLink(match ? {
58440
+ providerClass: "mcp",
58441
+ providerType: match.id
58442
+ } : {
58443
+ providerClass: null,
58444
+ providerType: item.providerType
58297
58445
  });
58298
- if (alive) setProviderClass(inCatalog ? "mcp" : "credential");
58299
58446
  })["catch"](function () {
58300
- return alive && setProviderClass("credential");
58447
+ return alive && setLink({
58448
+ providerClass: null,
58449
+ providerType: item.providerType
58450
+ });
58301
58451
  });
58302
58452
  return function () {
58303
58453
  alive = false;
58304
58454
  };
58305
58455
  }, [item.providerType]);
58456
+ var close = function close() {
58457
+ var created = Object.values(app.providers || {}).filter(function (p) {
58458
+ return p && p.name && !before.current.has(p.name);
58459
+ });
58460
+ onClose(created);
58461
+ };
58306
58462
  return /*#__PURE__*/jsx(Modal, {
58307
58463
  isOpen: true,
58308
58464
  setIsOpen: function setIsOpen(v) {
58309
- return !v && onClose();
58465
+ return !v && close();
58310
58466
  },
58311
58467
  width: "w-11/12",
58312
58468
  height: "h-5/6",
@@ -58325,17 +58481,17 @@ var ConnectDialog = function ConnectDialog(_ref4) {
58325
58481
  onClick: onSkip
58326
58482
  }) : null, /*#__PURE__*/jsx(Button3, {
58327
58483
  title: "Done",
58328
- onClick: onClose
58484
+ onClick: close
58329
58485
  })]
58330
58486
  })]
58331
58487
  }), /*#__PURE__*/jsx("div", {
58332
58488
  className: "flex-1 min-h-0 flex flex-col",
58333
- children: providerClass ? /*#__PURE__*/jsx(ProvidersSection, {
58489
+ children: link ? /*#__PURE__*/jsx(ProvidersSection, {
58334
58490
  dashApi: app.dashApi || null,
58335
58491
  credentials: app.credentials || null,
58336
58492
  initialCreateRequested: true,
58337
- initialProviderType: item.providerType,
58338
- initialProviderClass: providerClass
58493
+ initialProviderType: link.providerType,
58494
+ initialProviderClass: link.providerClass
58339
58495
  }) : /*#__PURE__*/jsx("span", {
58340
58496
  className: "p-6 text-sm ".concat(muted),
58341
58497
  children: "Opening\u2026"
@@ -62167,6 +62323,13 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62167
62323
  });
62168
62324
  setReady(false);
62169
62325
  };
62326
+ // One of the user's providers for what the plan needs: the plan uses it
62327
+ // (widgets by its type, bots by its name), so the item is done and the
62328
+ // build wires it up.
62329
+ var pickProvider = function pickProvider(item, provider) {
62330
+ if (!item || !provider) return;
62331
+ editPlan(choosePlanProvider(plan, item.providerType, provider), "use my provider \"".concat(provider.name, "\" (type ").concat(provider.type || "unknown", ") wherever the plan needs ").concat(providerLabel(item.providerType)));
62332
+ };
62170
62333
 
62171
62334
  // The chat follows the conversation to its latest message (its own column
62172
62335
  // full size; the one column in the dock).
@@ -62512,8 +62675,10 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62512
62675
  children: checklist.map(function (it) {
62513
62676
  var skipped = isSkipped(it, checks, have);
62514
62677
  var done = isDone(it, checks, have) && !skipped;
62678
+ // The user's providers that could stand in, closest first.
62679
+ var choices = it.kind === "connect" ? providerChoices(app.providers, it.providerType) : [];
62515
62680
  return /*#__PURE__*/jsxs("div", {
62516
- className: "flex flex-row items-center gap-3 text-sm py-1",
62681
+ className: "flex ".concat(compact ? "flex-col items-stretch" : "flex-row items-center", " gap-3 text-sm py-1"),
62517
62682
  "data-testid": "checklist-item",
62518
62683
  children: [/*#__PURE__*/jsxs("span", {
62519
62684
  className: "flex-1 min-w-0 flex flex-col items-start gap-1",
@@ -62531,17 +62696,49 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62531
62696
  "data-testid": "checklist-skipped",
62532
62697
  children: [" ", "\xB7 skipped \u2014 what needs it waits"]
62533
62698
  }) : null]
62534
- }), done ? null : /*#__PURE__*/jsx(Button2, {
62535
- title: it.kind === "install" ? "Review & approve" : it.kind === "connect" ? "Connect" : "OK",
62536
- size: "sm",
62537
- onClick: function onClick() {
62538
- return it.kind === "approve" ? finish(it, "done") : openItem(it);
62539
- }
62699
+ }), done ? null : /*#__PURE__*/jsxs("div", {
62700
+ className: "flex flex-col gap-2 ".concat(compact ? "items-start" : "items-end"),
62701
+ children: [/*#__PURE__*/jsx(Button2, {
62702
+ title: it.kind === "install" ? "Review & approve" : it.kind === "connect" ? "Connect new" : "OK",
62703
+ size: "sm",
62704
+ onClick: function onClick() {
62705
+ return it.kind === "approve" ? finish(it, "done") : openItem(it);
62706
+ }
62707
+ }), choices.length ? /*#__PURE__*/jsx("div", {
62708
+ className: compact ? "w-full" : "w-56",
62709
+ "data-testid": "checklist-use-provider",
62710
+ children: /*#__PURE__*/jsx(SelectInput, {
62711
+ label: "Or use one you have",
62712
+ value: "",
62713
+ onChange: function onChange(name) {
62714
+ var p = choices.find(function (x) {
62715
+ return x.name === name;
62716
+ });
62717
+ if (p) pickProvider(it, p);
62718
+ },
62719
+ options: [{
62720
+ value: "",
62721
+ label: "Pick a provider…"
62722
+ }].concat(_toConsumableArray(choices.map(function (p) {
62723
+ return {
62724
+ value: p.name,
62725
+ label: p.type ? "".concat(p.name, " \xB7 ").concat(p.type) : p.name
62726
+ };
62727
+ })))
62728
+ })
62729
+ }) : null]
62540
62730
  })]
62541
62731
  }, it.id);
62542
62732
  })
62543
- }) : null, single || botMode ? null : expectSection, broken ? /*#__PURE__*/jsxs("span", {
62544
- className: "text-xs text-red-500 whitespace-pre-wrap",
62733
+ }) : null, single || botMode ? null : expectSection, single || botMode ? expectSection : null]
62734
+ }) : null;
62735
+ // Build stays in view: pinned to the bottom of the plan, not at the end
62736
+ // of a long card (QA 2026-10-28).
62737
+ var buildBar = plan && pieces.length ? /*#__PURE__*/jsxs("div", {
62738
+ className: "flex flex-col gap-2",
62739
+ "data-testid": "plan-build-bar",
62740
+ children: [broken ? /*#__PURE__*/jsxs("span", {
62741
+ className: "text-xs text-red-500 whitespace-pre-wrap max-h-24 overflow-y-auto",
62545
62742
  "data-testid": "plan-errors",
62546
62743
  children: ["The plan isn't complete yet: ", check.errors.join(" ")]
62547
62744
  }) : null, /*#__PURE__*/jsxs("div", {
@@ -62563,7 +62760,7 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62563
62760
  "data-testid": "plan-ready",
62564
62761
  children: buildError ? buildError : unanswered ? "Answer the Planner's questions first." : broken ? "Ask the Planner to fix the plan first." : ready ? "Starting the build…" : resumeFrom ? "What's built is kept — only what's new or changed gets built." : edit ? "Nothing changes until you've seen it running and said OK." : cell ? "Nothing goes into ".concat(cell.label, " until you've seen it running.") : botMode && !removedNote ? "Nothing is saved until you press Build." : removedNote || (target ? "Saved \xB7 nothing on ".concat(target.name, " changes until you press this.") : "Saved · nothing has been built or installed yet.")
62565
62762
  })]
62566
- }), single || botMode ? expectSection : null]
62763
+ })]
62567
62764
  }) : null;
62568
62765
  var dialogs = /*#__PURE__*/jsxs(Fragment, {
62569
62766
  children: [dialog && dialog.kind === "install" ? /*#__PURE__*/jsx(InstallReviewDialog, {
@@ -62587,34 +62784,42 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62587
62784
  onSkip: function onSkip() {
62588
62785
  return finish(dialog.item, "skipped");
62589
62786
  },
62590
- onClose: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
62591
- return _regeneratorRuntime.wrap(function (_context3) {
62592
- while (1) switch (_context3.prev = _context3.next) {
62593
- case 0:
62594
- dialog.item;
62595
- setDialog(null);
62596
- if (!app.refreshProviders) {
62787
+ onClose: (/*#__PURE__*/function () {
62788
+ var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(created) {
62789
+ var it, made;
62790
+ return _regeneratorRuntime.wrap(function (_context3) {
62791
+ while (1) switch (_context3.prev = _context3.next) {
62792
+ case 0:
62793
+ it = dialog.item;
62794
+ setDialog(null);
62795
+ setWalking(false);
62796
+ // A provider made in the window is the one this needed — even
62797
+ // when its type isn't the plan's (a custom MCP server).
62798
+ made = createdFor(created, it.providerType);
62799
+ if (made) pickProvider(it, made);
62800
+ if (!app.refreshProviders) {
62801
+ _context3.next = 4;
62802
+ break;
62803
+ }
62804
+ _context3.prev = 1;
62805
+ _context3.next = 2;
62806
+ return app.refreshProviders();
62807
+ case 2:
62597
62808
  _context3.next = 4;
62598
62809
  break;
62599
- }
62600
- _context3.prev = 1;
62601
- _context3.next = 2;
62602
- return app.refreshProviders();
62603
- case 2:
62604
- _context3.next = 4;
62605
- break;
62606
- case 3:
62607
- _context3.prev = 3;
62608
- _context3["catch"](1);
62609
- case 4:
62610
- // Walk on only if it really got connected (no loop otherwise).
62611
- setWalking(false);
62612
- case 5:
62613
- case "end":
62614
- return _context3.stop();
62615
- }
62616
- }, _callee3, null, [[1, 3]]);
62617
- }))
62810
+ case 3:
62811
+ _context3.prev = 3;
62812
+ _context3["catch"](1);
62813
+ case 4:
62814
+ case "end":
62815
+ return _context3.stop();
62816
+ }
62817
+ }, _callee3, null, [[1, 3]]);
62818
+ }));
62819
+ return function (_x3) {
62820
+ return _ref11.apply(this, arguments);
62821
+ };
62822
+ }())
62618
62823
  }) : null, dialog && dialog.kind === "approve" ? /*#__PURE__*/jsx(ConfirmationModal, {
62619
62824
  isOpen: true,
62620
62825
  setIsOpen: function setIsOpen() {
@@ -62660,13 +62865,22 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62660
62865
  return /*#__PURE__*/jsxs("div", {
62661
62866
  className: "flex-1 min-h-0 flex flex-row",
62662
62867
  "data-testid": "create-plan",
62663
- children: [/*#__PURE__*/jsx("div", {
62664
- className: "flex-1 min-w-0 overflow-y-auto",
62868
+ children: [/*#__PURE__*/jsxs("div", {
62869
+ className: "flex-1 min-w-0 min-h-0 flex flex-col",
62665
62870
  "data-testid": "plan-column",
62666
- children: /*#__PURE__*/jsx("div", {
62667
- className: "mx-auto w-full max-w-3xl flex flex-col gap-4 px-6 py-8",
62668
- children: planCard
62669
- })
62871
+ children: [/*#__PURE__*/jsx("div", {
62872
+ className: "flex-1 min-h-0 overflow-y-auto",
62873
+ children: /*#__PURE__*/jsx("div", {
62874
+ className: "mx-auto w-full max-w-3xl flex flex-col gap-4 px-6 py-8",
62875
+ children: planCard
62876
+ })
62877
+ }), buildBar ? /*#__PURE__*/jsx("div", {
62878
+ className: "flex-shrink-0 border-t px-6 py-3 ".concat(hairline),
62879
+ children: /*#__PURE__*/jsx("div", {
62880
+ className: "mx-auto w-full max-w-3xl",
62881
+ children: buildBar
62882
+ })
62883
+ }) : null]
62670
62884
  }), /*#__PURE__*/jsxs("div", {
62671
62885
  className: "flex-1 min-w-0 min-h-0 flex flex-col border-l ".concat(hairline),
62672
62886
  "data-testid": "chat-column",
@@ -62693,7 +62907,13 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62693
62907
  className: "mx-auto w-full max-w-3xl flex flex-col ".concat(compact ? "gap-3 px-3 py-3" : "gap-4 px-6 py-8"),
62694
62908
  children: [chatMessages, planCard, questionsBlock]
62695
62909
  })
62696
- }), dialogs, foot]
62910
+ }), dialogs, buildBar ? /*#__PURE__*/jsx("div", {
62911
+ className: "flex-shrink-0 border-t ".concat(hairline, " ").concat(compact ? "px-3 py-2" : "px-6 py-3"),
62912
+ children: /*#__PURE__*/jsx("div", {
62913
+ className: compact ? "" : "mx-auto w-full max-w-3xl",
62914
+ children: buildBar
62915
+ })
62916
+ }) : null, foot]
62697
62917
  });
62698
62918
  };
62699
62919