@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.js CHANGED
@@ -14390,12 +14390,29 @@ function normalizeType(name) {
14390
14390
  return ALIASES[dashed.replace(/-/g, "")] || dashed;
14391
14391
  }
14392
14392
 
14393
- /** The provider types the user has (from AppContext.providers). */
14393
+ /**
14394
+ * What the user has, as the plan names it (from AppContext.providers): each
14395
+ * provider's type and its name — a plan that names one of the user's
14396
+ * providers ("Work Mail") has it, whatever its type ("custom").
14397
+ */
14394
14398
  function providerTypesOf(providers) {
14395
14399
  var list = Array.isArray(providers) ? providers : Object.values(providers || {});
14396
- return new Set(list.map(function (p) {
14397
- return normalizeType(p && p.type);
14398
- }).filter(Boolean));
14400
+ var out = new Set();
14401
+ var _iterator = _createForOfIteratorHelper$1c(list),
14402
+ _step;
14403
+ try {
14404
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
14405
+ var p = _step.value;
14406
+ if (!p) continue;
14407
+ if (normalizeType(p.type)) out.add(normalizeType(p.type));
14408
+ if (normalizeType(p.name)) out.add(normalizeType(p.name));
14409
+ }
14410
+ } catch (err) {
14411
+ _iterator.e(err);
14412
+ } finally {
14413
+ _iterator.f();
14414
+ }
14415
+ return out;
14399
14416
  }
14400
14417
  var titleCase$2 = function titleCase(t) {
14401
14418
  return String(t).split("-").map(function (w) {
@@ -14410,6 +14427,102 @@ var PROVIDER_NAMES$1 = {
14410
14427
  hubspot: "HubSpot",
14411
14428
  websocket: "WebSocket"
14412
14429
  };
14430
+ var providerList = function providerList(providers) {
14431
+ return (Array.isArray(providers) ? providers : Object.values(providers || {})).filter(function (p) {
14432
+ return p && p.name;
14433
+ });
14434
+ };
14435
+
14436
+ /**
14437
+ * The user's providers to offer for a needed type, closest first: the
14438
+ * same type, then MCP servers (most plans' tools are MCP), then the rest.
14439
+ * @returns {Array<{ name, type, providerClass }>}
14440
+ */
14441
+ function providerChoices(providers, providerType) {
14442
+ var want = normalizeType(providerType);
14443
+ var rank = function rank(p) {
14444
+ return normalizeType(p.type) === want || normalizeType(p.name) === want ? 0 : p.providerClass === "mcp" ? 1 : 2;
14445
+ };
14446
+ return providerList(providers).map(function (p) {
14447
+ return {
14448
+ name: p.name,
14449
+ type: p.type || "",
14450
+ providerClass: p.providerClass || null
14451
+ };
14452
+ }).sort(function (a, b) {
14453
+ return rank(a) - rank(b) || a.name.localeCompare(b.name);
14454
+ });
14455
+ }
14456
+
14457
+ /**
14458
+ * Which of the providers made in the Connect window stands in for a needed
14459
+ * type: one of that type (or name); else the only one made; else none —
14460
+ * the user picks (adding Slack while there never replaces Gmail).
14461
+ */
14462
+ function createdFor(created, providerType) {
14463
+ var list = (created || []).filter(function (p) {
14464
+ return p && p.name;
14465
+ });
14466
+ var want = normalizeType(providerType);
14467
+ var same = list.filter(function (p) {
14468
+ return normalizeType(p.type) === want || normalizeType(p.name) === want;
14469
+ });
14470
+ if (same.length) return same[same.length - 1];
14471
+ return list.length === 1 ? list[0] : null;
14472
+ }
14473
+
14474
+ /**
14475
+ * The plan using one of the user's providers wherever it needed
14476
+ * `providerType`: widgets name provider types, so they take its type; bots
14477
+ * name providers, so they take its name. The checklist, the Builder and
14478
+ * the bot's setup then all see the provider the user chose.
14479
+ */
14480
+ function choosePlanProvider(plan, providerType, provider) {
14481
+ if (!plan || !provider || !provider.name) return plan;
14482
+ var want = normalizeType(providerType);
14483
+ var matches = function matches(t) {
14484
+ return normalizeType(t) === want;
14485
+ };
14486
+ var type = provider.type || provider.name;
14487
+ var pieces = (plan.pieces || []).map(function (p) {
14488
+ if (!p) return p;
14489
+ var next = p;
14490
+ if (Array.isArray(p.providers) && p.providers.some(matches)) {
14491
+ // Its type, and that exact provider pinned (`provider: { type: name }`)
14492
+ // — a custom MCP server's type is just "custom", and the user may have
14493
+ // two of a type.
14494
+ var pinned = {};
14495
+ for (var _i = 0, _Object$entries = Object.entries(p.provider && _typeof(p.provider) === "object" ? p.provider : {}); _i < _Object$entries.length; _i++) {
14496
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
14497
+ k = _Object$entries$_i[0],
14498
+ v = _Object$entries$_i[1];
14499
+ if (!matches(k)) pinned[k] = v;
14500
+ }
14501
+ pinned[type] = provider.name;
14502
+ next = _objectSpread$1N(_objectSpread$1N({}, next), {}, {
14503
+ providers: _toConsumableArray(new Set(p.providers.map(function (t) {
14504
+ return matches(t) ? type : t;
14505
+ }))),
14506
+ provider: pinned
14507
+ });
14508
+ }
14509
+ if (Array.isArray(p.tools) && p.tools.some(function (t) {
14510
+ return t && matches(t.provider);
14511
+ })) {
14512
+ next = _objectSpread$1N(_objectSpread$1N({}, next), {}, {
14513
+ tools: p.tools.map(function (t) {
14514
+ return t && matches(t.provider) ? _objectSpread$1N(_objectSpread$1N({}, t), {}, {
14515
+ provider: provider.name
14516
+ }) : t;
14517
+ })
14518
+ });
14519
+ }
14520
+ return next;
14521
+ });
14522
+ return _objectSpread$1N(_objectSpread$1N({}, plan), {}, {
14523
+ pieces: pieces
14524
+ });
14525
+ }
14413
14526
 
14414
14527
  /** "gmail" / "Google Calendar" / "github" → "Gmail" / "Google Calendar" / "GitHub". */
14415
14528
  function providerLabel(name) {
@@ -14443,16 +14556,16 @@ function buildChecklist(plan) {
14443
14556
  }
14444
14557
  });
14445
14558
  var seenType = new Set();
14446
- var _iterator = _createForOfIteratorHelper$1c(pieces),
14447
- _step;
14559
+ var _iterator2 = _createForOfIteratorHelper$1c(pieces),
14560
+ _step2;
14448
14561
  try {
14449
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
14450
- var p = _step.value;
14451
- var _iterator3 = _createForOfIteratorHelper$1c(p && p.providers || []),
14452
- _step3;
14562
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
14563
+ var p = _step2.value;
14564
+ var _iterator4 = _createForOfIteratorHelper$1c(p && p.providers || []),
14565
+ _step4;
14453
14566
  try {
14454
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
14455
- var t = _step3.value;
14567
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
14568
+ var t = _step4.value;
14456
14569
  var type = normalizeType(t);
14457
14570
  if (!type || have.has(type) || seenType.has(type)) continue;
14458
14571
  seenType.add(type);
@@ -14464,22 +14577,22 @@ function buildChecklist(plan) {
14464
14577
  });
14465
14578
  }
14466
14579
  } catch (err) {
14467
- _iterator3.e(err);
14580
+ _iterator4.e(err);
14468
14581
  } finally {
14469
- _iterator3.f();
14582
+ _iterator4.f();
14470
14583
  }
14471
14584
  }
14472
14585
  // Planner steps that aren't an install or a connect above.
14473
14586
  } catch (err) {
14474
- _iterator.e(err);
14587
+ _iterator2.e(err);
14475
14588
  } finally {
14476
- _iterator.f();
14589
+ _iterator2.f();
14477
14590
  }
14478
- var _iterator2 = _createForOfIteratorHelper$1c(plan && plan.beforeBuilding || []),
14479
- _step2;
14591
+ var _iterator3 = _createForOfIteratorHelper$1c(plan && plan.beforeBuilding || []),
14592
+ _step3;
14480
14593
  try {
14481
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
14482
- var b = _step2.value;
14594
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
14595
+ var b = _step3.value;
14483
14596
  if (!b || b.kind !== "approve" || !b.what) continue;
14484
14597
  items.push({
14485
14598
  id: "approve:".concat(b.what),
@@ -14488,9 +14601,9 @@ function buildChecklist(plan) {
14488
14601
  });
14489
14602
  }
14490
14603
  } catch (err) {
14491
- _iterator2.e(err);
14604
+ _iterator3.e(err);
14492
14605
  } finally {
14493
- _iterator2.f();
14606
+ _iterator3.f();
14494
14607
  }
14495
14608
  return items;
14496
14609
  }
@@ -14617,7 +14730,7 @@ function countsLine(plan) {
14617
14730
  }
14618
14731
  var parts = [];
14619
14732
  var _loop = function _loop() {
14620
- var _arr$_i = _slicedToArray(_arr[_i], 3),
14733
+ var _arr$_i = _slicedToArray(_arr[_i2], 3),
14621
14734
  kind = _arr$_i[0],
14622
14735
  one = _arr$_i[1],
14623
14736
  many = _arr$_i[2];
@@ -14628,18 +14741,18 @@ function countsLine(plan) {
14628
14741
  // A piece with no source (a plan's layout often has none) is one the
14629
14742
  // plan makes: new — not "1 undefined layout" (QA 2026-10-22).
14630
14743
  var bySource = {};
14631
- var _iterator4 = _createForOfIteratorHelper$1c(group),
14632
- _step4;
14744
+ var _iterator5 = _createForOfIteratorHelper$1c(group),
14745
+ _step5;
14633
14746
  try {
14634
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
14635
- var p = _step4.value;
14747
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
14748
+ var p = _step5.value;
14636
14749
  var _src = pieceSource(p);
14637
14750
  bySource[_src] = (bySource[_src] || 0) + 1;
14638
14751
  }
14639
14752
  } catch (err) {
14640
- _iterator4.e(err);
14753
+ _iterator5.e(err);
14641
14754
  } finally {
14642
- _iterator4.f();
14755
+ _iterator5.f();
14643
14756
  }
14644
14757
  var detail = Object.entries(bySource).map(function (_ref4) {
14645
14758
  var _ref5 = _slicedToArray(_ref4, 2),
@@ -14654,7 +14767,7 @@ function countsLine(plan) {
14654
14767
  parts.push("".concat(group.length, " ").concat(group.length === 1 ? one : many, ": ").concat(detail));
14655
14768
  }
14656
14769
  };
14657
- for (var _i = 0, _arr = [["bot", "bot", "bots"], ["widget", "widget", "widgets"], ["layout", "layout", "layouts"]]; _i < _arr.length; _i++) {
14770
+ for (var _i2 = 0, _arr = [["bot", "bot", "bots"], ["widget", "widget", "widgets"], ["layout", "layout", "layouts"]]; _i2 < _arr.length; _i2++) {
14658
14771
  if (_loop()) continue;
14659
14772
  }
14660
14773
  if (theme) parts.push("the ".concat(theme.name, " theme"));
@@ -14750,17 +14863,17 @@ function botDetails(piece) {
14750
14863
  return s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
14751
14864
  };
14752
14865
  var starts = [];
14753
- var _iterator6 = _createForOfIteratorHelper$1c(Array.isArray(p.on) ? p.on : []),
14754
- _step6;
14866
+ var _iterator7 = _createForOfIteratorHelper$1c(Array.isArray(p.on) ? p.on : []),
14867
+ _step7;
14755
14868
  try {
14756
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
14757
- var o = _step6.value;
14869
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
14870
+ var o = _step7.value;
14758
14871
  if (o && o.widget && o.event) starts.push("when ".concat(o.widget, " sends ").concat(o.event));
14759
14872
  }
14760
14873
  } catch (err) {
14761
- _iterator6.e(err);
14874
+ _iterator7.e(err);
14762
14875
  } finally {
14763
- _iterator6.f();
14876
+ _iterator7.f();
14764
14877
  }
14765
14878
  var sched = p.schedule && p.schedule.cron;
14766
14879
  if (sched) starts.push(scheduleLabel(sched));
@@ -57682,9 +57795,14 @@ var ProvidersSection = function ProvidersSection(_ref) {
57682
57795
  setIsAddingMcp(false);
57683
57796
  setIsCreating(false);
57684
57797
  setIsAddingWs(false);
57798
+ // A deep link that named a type but not its kind (a plan's "Connect
57799
+ // Home Assistant"): the type fills the credential form if that's
57800
+ // what's chosen.
57801
+ chooserType.current = providerType || null;
57685
57802
  setIsShowingClassChooser(true);
57686
57803
  }
57687
57804
  }
57805
+ var chooserType = React.useRef(null);
57688
57806
  var prevCreateRequested = React.useRef(false);
57689
57807
  React.useEffect(function () {
57690
57808
  // The header's New Provider always starts at the class chooser — the
@@ -57856,6 +57974,7 @@ var ProvidersSection = function ProvidersSection(_ref) {
57856
57974
  setIsAddingWs(true);
57857
57975
  } else {
57858
57976
  setIsCreating(true);
57977
+ if (chooserType.current) setFormType(chooserType.current);
57859
57978
  }
57860
57979
  }
57861
57980
  });
@@ -58283,11 +58402,28 @@ var InstallReviewDialog = function InstallReviewDialog(_ref2) {
58283
58402
  });
58284
58403
  };
58285
58404
 
58405
+ /**
58406
+ * The MCP catalog entry for a plan's provider type — by id, type or name
58407
+ * ("google-calendar", "Google Calendar") — or null.
58408
+ */
58409
+ function catalogMatch(servers, providerType) {
58410
+ var want = normalizeType(providerType);
58411
+ if (!want) return null;
58412
+ return (servers || []).find(function (sv) {
58413
+ return sv && [sv.id, sv.type, sv.name].some(function (v) {
58414
+ return v && normalizeType(v) === want;
58415
+ });
58416
+ }) || null;
58417
+ }
58418
+
58286
58419
  /**
58287
58420
  * Connect a provider without leaving the plan: the Providers screen, opened
58288
- * on "add <type>", in a window over Create. Types in the MCP catalog open
58289
- * the catalog with that server picked; anything else opens the credential
58290
- * form with the type filled in.
58421
+ * on "add <type>", in a window over Create. A type in the MCP catalog opens
58422
+ * that catalog entry, picked; anything else asks which kind it is (an MCP
58423
+ * server, an API key, a WebSocket) — never a guess.
58424
+ *
58425
+ * `onClose(created)`: the providers made while it was open (the plan uses
58426
+ * the newest for this item).
58291
58427
  */
58292
58428
  var ConnectDialog = function ConnectDialog(_ref4) {
58293
58429
  var item = _ref4.item,
@@ -58302,29 +58438,49 @@ var ConnectDialog = function ConnectDialog(_ref4) {
58302
58438
  // null while looking the type up in the MCP catalog.
58303
58439
  var _useState3 = React.useState(null),
58304
58440
  _useState4 = _slicedToArray(_useState3, 2),
58305
- providerClass = _useState4[0],
58306
- setProviderClass = _useState4[1];
58441
+ link = _useState4[0],
58442
+ setLink = _useState4[1];
58443
+ // The providers there were when it opened: what's new was made here.
58444
+ var before = React.useRef(null);
58445
+ if (before.current === null) {
58446
+ before.current = new Set(Object.values(app.providers || {}).map(function (p) {
58447
+ return p && p.name;
58448
+ }).filter(Boolean));
58449
+ }
58307
58450
  React.useEffect(function () {
58308
58451
  var _window$mainApi2;
58309
58452
  var alive = true;
58310
58453
  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;
58311
58454
  Promise.resolve(getCatalog ? getCatalog() : null).then(function (res) {
58312
- var servers = res && res.catalog || [];
58313
- var inCatalog = servers.some(function (sv) {
58314
- return sv && (sv.id === item.providerType || sv.type === item.providerType);
58455
+ var match = catalogMatch(res && res.catalog, item.providerType);
58456
+ if (!alive) return;
58457
+ setLink(match ? {
58458
+ providerClass: "mcp",
58459
+ providerType: match.id
58460
+ } : {
58461
+ providerClass: null,
58462
+ providerType: item.providerType
58315
58463
  });
58316
- if (alive) setProviderClass(inCatalog ? "mcp" : "credential");
58317
58464
  })["catch"](function () {
58318
- return alive && setProviderClass("credential");
58465
+ return alive && setLink({
58466
+ providerClass: null,
58467
+ providerType: item.providerType
58468
+ });
58319
58469
  });
58320
58470
  return function () {
58321
58471
  alive = false;
58322
58472
  };
58323
58473
  }, [item.providerType]);
58474
+ var close = function close() {
58475
+ var created = Object.values(app.providers || {}).filter(function (p) {
58476
+ return p && p.name && !before.current.has(p.name);
58477
+ });
58478
+ onClose(created);
58479
+ };
58324
58480
  return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal, {
58325
58481
  isOpen: true,
58326
58482
  setIsOpen: function setIsOpen(v) {
58327
- return !v && onClose();
58483
+ return !v && close();
58328
58484
  },
58329
58485
  width: "w-11/12",
58330
58486
  height: "h-5/6",
@@ -58343,17 +58499,17 @@ var ConnectDialog = function ConnectDialog(_ref4) {
58343
58499
  onClick: onSkip
58344
58500
  }) : null, /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
58345
58501
  title: "Done",
58346
- onClick: onClose
58502
+ onClick: close
58347
58503
  })]
58348
58504
  })]
58349
58505
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
58350
58506
  className: "flex-1 min-h-0 flex flex-col",
58351
- children: providerClass ? /*#__PURE__*/jsxRuntime.jsx(ProvidersSection, {
58507
+ children: link ? /*#__PURE__*/jsxRuntime.jsx(ProvidersSection, {
58352
58508
  dashApi: app.dashApi || null,
58353
58509
  credentials: app.credentials || null,
58354
58510
  initialCreateRequested: true,
58355
- initialProviderType: item.providerType,
58356
- initialProviderClass: providerClass
58511
+ initialProviderType: link.providerType,
58512
+ initialProviderClass: link.providerClass
58357
58513
  }) : /*#__PURE__*/jsxRuntime.jsx("span", {
58358
58514
  className: "p-6 text-sm ".concat(muted),
58359
58515
  children: "Opening\u2026"
@@ -62185,6 +62341,13 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62185
62341
  });
62186
62342
  setReady(false);
62187
62343
  };
62344
+ // One of the user's providers for what the plan needs: the plan uses it
62345
+ // (widgets by its type, bots by its name), so the item is done and the
62346
+ // build wires it up.
62347
+ var pickProvider = function pickProvider(item, provider) {
62348
+ if (!item || !provider) return;
62349
+ 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)));
62350
+ };
62188
62351
 
62189
62352
  // The chat follows the conversation to its latest message (its own column
62190
62353
  // full size; the one column in the dock).
@@ -62530,8 +62693,10 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62530
62693
  children: checklist.map(function (it) {
62531
62694
  var skipped = isSkipped(it, checks, have);
62532
62695
  var done = isDone(it, checks, have) && !skipped;
62696
+ // The user's providers that could stand in, closest first.
62697
+ var choices = it.kind === "connect" ? providerChoices(app.providers, it.providerType) : [];
62533
62698
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
62534
- className: "flex flex-row items-center gap-3 text-sm py-1",
62699
+ className: "flex ".concat(compact ? "flex-col items-stretch" : "flex-row items-center", " gap-3 text-sm py-1"),
62535
62700
  "data-testid": "checklist-item",
62536
62701
  children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
62537
62702
  className: "flex-1 min-w-0 flex flex-col items-start gap-1",
@@ -62549,17 +62714,49 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62549
62714
  "data-testid": "checklist-skipped",
62550
62715
  children: [" ", "\xB7 skipped \u2014 what needs it waits"]
62551
62716
  }) : null]
62552
- }), done ? null : /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
62553
- title: it.kind === "install" ? "Review & approve" : it.kind === "connect" ? "Connect" : "OK",
62554
- size: "sm",
62555
- onClick: function onClick() {
62556
- return it.kind === "approve" ? finish(it, "done") : openItem(it);
62557
- }
62717
+ }), done ? null : /*#__PURE__*/jsxRuntime.jsxs("div", {
62718
+ className: "flex flex-col gap-2 ".concat(compact ? "items-start" : "items-end"),
62719
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
62720
+ title: it.kind === "install" ? "Review & approve" : it.kind === "connect" ? "Connect new" : "OK",
62721
+ size: "sm",
62722
+ onClick: function onClick() {
62723
+ return it.kind === "approve" ? finish(it, "done") : openItem(it);
62724
+ }
62725
+ }), choices.length ? /*#__PURE__*/jsxRuntime.jsx("div", {
62726
+ className: compact ? "w-full" : "w-56",
62727
+ "data-testid": "checklist-use-provider",
62728
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
62729
+ label: "Or use one you have",
62730
+ value: "",
62731
+ onChange: function onChange(name) {
62732
+ var p = choices.find(function (x) {
62733
+ return x.name === name;
62734
+ });
62735
+ if (p) pickProvider(it, p);
62736
+ },
62737
+ options: [{
62738
+ value: "",
62739
+ label: "Pick a provider…"
62740
+ }].concat(_toConsumableArray(choices.map(function (p) {
62741
+ return {
62742
+ value: p.name,
62743
+ label: p.type ? "".concat(p.name, " \xB7 ").concat(p.type) : p.name
62744
+ };
62745
+ })))
62746
+ })
62747
+ }) : null]
62558
62748
  })]
62559
62749
  }, it.id);
62560
62750
  })
62561
- }) : null, single || botMode ? null : expectSection, broken ? /*#__PURE__*/jsxRuntime.jsxs("span", {
62562
- className: "text-xs text-red-500 whitespace-pre-wrap",
62751
+ }) : null, single || botMode ? null : expectSection, single || botMode ? expectSection : null]
62752
+ }) : null;
62753
+ // Build stays in view: pinned to the bottom of the plan, not at the end
62754
+ // of a long card (QA 2026-10-28).
62755
+ var buildBar = plan && pieces.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
62756
+ className: "flex flex-col gap-2",
62757
+ "data-testid": "plan-build-bar",
62758
+ children: [broken ? /*#__PURE__*/jsxRuntime.jsxs("span", {
62759
+ className: "text-xs text-red-500 whitespace-pre-wrap max-h-24 overflow-y-auto",
62563
62760
  "data-testid": "plan-errors",
62564
62761
  children: ["The plan isn't complete yet: ", check.errors.join(" ")]
62565
62762
  }) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -62581,7 +62778,7 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62581
62778
  "data-testid": "plan-ready",
62582
62779
  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.")
62583
62780
  })]
62584
- }), single || botMode ? expectSection : null]
62781
+ })]
62585
62782
  }) : null;
62586
62783
  var dialogs = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
62587
62784
  children: [dialog && dialog.kind === "install" ? /*#__PURE__*/jsxRuntime.jsx(InstallReviewDialog, {
@@ -62605,34 +62802,42 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62605
62802
  onSkip: function onSkip() {
62606
62803
  return finish(dialog.item, "skipped");
62607
62804
  },
62608
- onClose: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
62609
- return _regeneratorRuntime.wrap(function (_context3) {
62610
- while (1) switch (_context3.prev = _context3.next) {
62611
- case 0:
62612
- dialog.item;
62613
- setDialog(null);
62614
- if (!app.refreshProviders) {
62805
+ onClose: (/*#__PURE__*/function () {
62806
+ var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(created) {
62807
+ var it, made;
62808
+ return _regeneratorRuntime.wrap(function (_context3) {
62809
+ while (1) switch (_context3.prev = _context3.next) {
62810
+ case 0:
62811
+ it = dialog.item;
62812
+ setDialog(null);
62813
+ setWalking(false);
62814
+ // A provider made in the window is the one this needed — even
62815
+ // when its type isn't the plan's (a custom MCP server).
62816
+ made = createdFor(created, it.providerType);
62817
+ if (made) pickProvider(it, made);
62818
+ if (!app.refreshProviders) {
62819
+ _context3.next = 4;
62820
+ break;
62821
+ }
62822
+ _context3.prev = 1;
62823
+ _context3.next = 2;
62824
+ return app.refreshProviders();
62825
+ case 2:
62615
62826
  _context3.next = 4;
62616
62827
  break;
62617
- }
62618
- _context3.prev = 1;
62619
- _context3.next = 2;
62620
- return app.refreshProviders();
62621
- case 2:
62622
- _context3.next = 4;
62623
- break;
62624
- case 3:
62625
- _context3.prev = 3;
62626
- _context3["catch"](1);
62627
- case 4:
62628
- // Walk on only if it really got connected (no loop otherwise).
62629
- setWalking(false);
62630
- case 5:
62631
- case "end":
62632
- return _context3.stop();
62633
- }
62634
- }, _callee3, null, [[1, 3]]);
62635
- }))
62828
+ case 3:
62829
+ _context3.prev = 3;
62830
+ _context3["catch"](1);
62831
+ case 4:
62832
+ case "end":
62833
+ return _context3.stop();
62834
+ }
62835
+ }, _callee3, null, [[1, 3]]);
62836
+ }));
62837
+ return function (_x3) {
62838
+ return _ref11.apply(this, arguments);
62839
+ };
62840
+ }())
62636
62841
  }) : null, dialog && dialog.kind === "approve" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ConfirmationModal, {
62637
62842
  isOpen: true,
62638
62843
  setIsOpen: function setIsOpen() {
@@ -62678,13 +62883,22 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62678
62883
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
62679
62884
  className: "flex-1 min-h-0 flex flex-row",
62680
62885
  "data-testid": "create-plan",
62681
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
62682
- className: "flex-1 min-w-0 overflow-y-auto",
62886
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
62887
+ className: "flex-1 min-w-0 min-h-0 flex flex-col",
62683
62888
  "data-testid": "plan-column",
62684
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
62685
- className: "mx-auto w-full max-w-3xl flex flex-col gap-4 px-6 py-8",
62686
- children: planCard
62687
- })
62889
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
62890
+ className: "flex-1 min-h-0 overflow-y-auto",
62891
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
62892
+ className: "mx-auto w-full max-w-3xl flex flex-col gap-4 px-6 py-8",
62893
+ children: planCard
62894
+ })
62895
+ }), buildBar ? /*#__PURE__*/jsxRuntime.jsx("div", {
62896
+ className: "flex-shrink-0 border-t px-6 py-3 ".concat(hairline),
62897
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
62898
+ className: "mx-auto w-full max-w-3xl",
62899
+ children: buildBar
62900
+ })
62901
+ }) : null]
62688
62902
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
62689
62903
  className: "flex-1 min-w-0 min-h-0 flex flex-col border-l ".concat(hairline),
62690
62904
  "data-testid": "chat-column",
@@ -62711,7 +62925,13 @@ var CreatePlanStep = function CreatePlanStep(_ref8) {
62711
62925
  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"),
62712
62926
  children: [chatMessages, planCard, questionsBlock]
62713
62927
  })
62714
- }), dialogs, foot]
62928
+ }), dialogs, buildBar ? /*#__PURE__*/jsxRuntime.jsx("div", {
62929
+ className: "flex-shrink-0 border-t ".concat(hairline, " ").concat(compact ? "px-3 py-2" : "px-6 py-3"),
62930
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
62931
+ className: compact ? "" : "mx-auto w-full max-w-3xl",
62932
+ children: buildBar
62933
+ })
62934
+ }) : null, foot]
62715
62935
  });
62716
62936
  };
62717
62937