@openbkn/workshop 0.2.2-rc.6 → 0.2.3

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 (89) hide show
  1. package/README.md +5 -6
  2. package/dist/{ActionConfirm-DJ91X3ml.js → ActionConfirm-ITBip2Ic.js} +5 -5
  3. package/dist/{ActionFailure-ZgPt_3B-.js → ActionFailure-CWifUJ2j.js} +2 -2
  4. package/dist/{AgentChat-CRYai8ge.js → AgentChat-C1uyzwuA.js} +6 -6
  5. package/dist/{AppFormModal-D73ucaHK.js → AppFormModal-ByNEloW-.js} +2 -2
  6. package/dist/AppListPage-D2NVBJs7.js +1465 -0
  7. package/dist/{AskDrawer-BUMYsRnt.js → AskDrawer-Bw1NM5v_.js} +4 -4
  8. package/dist/{ComputedView-CgYrDbx1.js → ComputedView-_CaPjqhY.js} +4 -4
  9. package/dist/{ConclusionApply-sjGfoEBY.js → ConclusionApply-CG5wSeVp.js} +4 -4
  10. package/dist/{CypherEditor-lus6FA5L.js → CypherEditor-DbLHQoJJ.js} +5 -5
  11. package/dist/{LandingList-6JI6864C.js → LandingList-BMPCXj6K.js} +5 -5
  12. package/dist/{MenuUnfoldOutlined-Cdg24l2h.js → MenuUnfoldOutlined-BoARCVho.js} +1 -1
  13. package/dist/{ModelTrial-ClHFGTpQ.js → ModelTrial-DZjC0E8E.js} +4 -4
  14. package/dist/{PageRenderer-DBd_g6mN.js → PageRenderer-Debi-U0v.js} +637 -637
  15. package/dist/{ScenarioApply-DtW_hh47.js → ScenarioApply-BNFfjIwR.js} +6 -6
  16. package/dist/{SimulateForm-C-i08Jjd.js → SimulateForm-CEqqMjks.js} +4 -4
  17. package/dist/{Subgraph-CnrkH9AN.js → Subgraph-C0VjOnZf.js} +3 -3
  18. package/dist/{WorkshopLabPage-DiVXQL9e.js → WorkshopLabPage-C7hssyUo.js} +9 -9
  19. package/dist/{WorkshopRunPage-6hjRUf64.js → WorkshopRunPage-BlyM18id.js} +4 -4
  20. package/dist/{abnfDiagram-WEYOIA3C-beRNhN3c.js → abnfDiagram-WEYOIA3C-wqYhe75a.js} +3 -3
  21. package/dist/{action-type-tool.service-B2B74fKC.js → action-type-tool.service-CtCfESYq.js} +1 -1
  22. package/dist/{architectureDiagram-ZHVYKT53-DY2l1qxx.js → architectureDiagram-ZHVYKT53-BYJ2H7bS.js} +3 -3
  23. package/dist/{bkn-agent-execution.service-DVh-SHyl.js → bkn-agent-execution.service-ogW6NIAz.js} +1 -1
  24. package/dist/{blockDiagram-RJAE7QA3-DR0mjN2h.js → blockDiagram-RJAE7QA3-DZfrfHRw.js} +3 -3
  25. package/dist/{c4Diagram-XDPPPE54-DH5zsGug.js → c4Diagram-XDPPPE54--S7sRxgd.js} +2 -2
  26. package/dist/{channel-B034hcOF.js → channel-Ca2_7Xkz.js} +1 -1
  27. package/dist/{chunk-2E7WHVMD-Ba3svxgx.js → chunk-2E7WHVMD-BMnl6-jy.js} +1 -1
  28. package/dist/{chunk-2Q5K7J3B-rT4eU6_y.js → chunk-2Q5K7J3B-BNVTYluA.js} +1 -1
  29. package/dist/{chunk-4EMNKR2T-C1kQZYHK.js → chunk-4EMNKR2T-CKorQf5z.js} +1 -1
  30. package/dist/{chunk-55XCU76K-dcpLOktb.js → chunk-55XCU76K-C4xutPQ4.js} +1 -1
  31. package/dist/{chunk-5VM5RSS4-BdpQuzmO.js → chunk-5VM5RSS4-BM5F2WnL.js} +1 -1
  32. package/dist/{chunk-JWPE2WC7-CDBrSjU7.js → chunk-JWPE2WC7-CSU5SIs8.js} +1 -1
  33. package/dist/{chunk-VQ5W62QI-BiVKc40w.js → chunk-VQ5W62QI-Dtk59D_l.js} +1 -1
  34. package/dist/{chunk-XXDRQBXY-CPYrcdVW.js → chunk-XXDRQBXY-DzVLFl9c.js} +1 -1
  35. package/dist/{chunk-ZCHMQSOR-BG8OLpvb.js → chunk-ZCHMQSOR-cdQdJeDJ.js} +2 -2
  36. package/dist/{classDiagram-v2-4MYWR3UA-DqbpQpwI.js → classDiagram-v2-4MYWR3UA-CABAzYlW.js} +5 -5
  37. package/dist/{cose-bilkent-JH36ORCC-CdXk4sPf.js → cose-bilkent-JH36ORCC-Ca8GJbqv.js} +2 -2
  38. package/dist/customComponents-DasaZ6pq.js +1 -1
  39. package/dist/customComponents.en-US-CkabuCXg.js +1 -1
  40. package/dist/{customParseFormat-C0uLEpdq.js → customParseFormat-H00Ur3YB.js} +1 -1
  41. package/dist/{cynefinDiagram-WF24UDRP-BYT_KpDL.js → cynefinDiagram-WF24UDRP-iIy_O6OH.js} +2 -2
  42. package/dist/{dagre-NK4GIZVX-l-ghPdM8.js → dagre-NK4GIZVX-lW5Hra0G.js} +2 -2
  43. package/dist/{dayjs.min-DZ-YV8Mv.js → dayjs.min-C8_4Wqpb.js} +1 -1
  44. package/dist/{diagram-CBK3MWTC-Bt3HiwvA.js → diagram-CBK3MWTC-l5LVSm6X.js} +3 -3
  45. package/dist/{diagram-I5XIIV2D-DcbqfBjx.js → diagram-I5XIIV2D-ChpwB8Wz.js} +2 -2
  46. package/dist/{diagram-ODIL2UCW-9PC1n3n5.js → diagram-ODIL2UCW-DBavGl7R.js} +3 -3
  47. package/dist/{diagram-PFBEJUXE-DGhr2kc7.js → diagram-PFBEJUXE-B3fNIQm9.js} +2 -2
  48. package/dist/{diagram-RJA3I4VV-DwzpOjZ_.js → diagram-RJA3I4VV-Dmj0Shdh.js} +2 -2
  49. package/dist/{diagram-TYUNFSNR-B3Bd3TDU.js → diagram-TYUNFSNR-D98rsKpY.js} +6 -6
  50. package/dist/{ebnfDiagram-V4P3TTPT-E5NN2oKc.js → ebnfDiagram-V4P3TTPT-Bxr2oP9U.js} +3 -3
  51. package/dist/{elk-QONTBCTQ-dFjcujl_.js → elk-QONTBCTQ-CvFT6Pst.js} +5 -5
  52. package/dist/{erDiagram-KYQIGQAA-BMrasBzB.js → erDiagram-KYQIGQAA-dgeEoLzk.js} +4 -4
  53. package/dist/{flowDiagram-IUGLLWBU-BGIBH0q0.js → flowDiagram-IUGLLWBU-ChsJgBPn.js} +7 -7
  54. package/dist/{ganttDiagram-R7GPNTJY-C0tb1Lpp.js → ganttDiagram-R7GPNTJY-C9WcR8Tf.js} +4 -4
  55. package/dist/{generateCypher-Ch9_lQa6.js → generateCypher-kvNYDLY4.js} +4 -4
  56. package/dist/{gitGraphDiagram-PDYL7XHY-DBqcOa-c.js → gitGraphDiagram-PDYL7XHY-CeZTDs7V.js} +3 -3
  57. package/dist/{infoDiagram-MVDRKAX5-Bwuki4JA.js → infoDiagram-MVDRKAX5-CzfcVWVf.js} +1 -1
  58. package/dist/{ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js → ishikawaDiagram-HPEHV2GE-BK4ExPHB.js} +2 -2
  59. package/dist/{journeyDiagram-BOSHW7O7-C99m34Bb.js → journeyDiagram-BOSHW7O7-DXJ-ihrY.js} +4 -4
  60. package/dist/{kanban-definition-FNSA4HC5-mdqjODsT.js → kanban-definition-FNSA4HC5-C9rAkIZN.js} +2 -2
  61. package/dist/{mermaid.core-yQghUlIz.js → mermaid.core-uROF3Ult.js} +43 -43
  62. package/dist/{mindmap-definition-6OY57UG3-BZhO2wX4.js → mindmap-definition-6OY57UG3-DC9FfvxT.js} +3 -3
  63. package/dist/{models-DekiCOuZ.js → models-D5Mffixi.js} +1 -1
  64. package/dist/{object-metric-numeric-vs3BeDkH.js → object-metric-numeric-DIgqXqB5.js} +1 -1
  65. package/dist/{object-metric.service-flZgBMRX.js → object-metric.service-B3PtIPEA.js} +2 -2
  66. package/dist/{pegDiagram-ECIUJNBX-BDa5RfZt.js → pegDiagram-ECIUJNBX-CUCvcOc0.js} +3 -3
  67. package/dist/{pieDiagram-GNMPY74T-DNVtzXPv.js → pieDiagram-GNMPY74T-DprBId-p.js} +2 -2
  68. package/dist/{prompt-DYrjlEFr.js → prompt-D9VtVs5i.js} +3 -3
  69. package/dist/{quadrantDiagram-D57K4MC3-vK0f2OvQ.js → quadrantDiagram-D57K4MC3-CcvW9eIV.js} +1 -1
  70. package/dist/{railroadDiagram-Y72NRBL7-j6ZrTmRp.js → railroadDiagram-Y72NRBL7-DH43paGB.js} +3 -3
  71. package/dist/{requirementDiagram-EQYSW5RA-DgfEyljA.js → requirementDiagram-EQYSW5RA-CBY8WT39.js} +3 -3
  72. package/dist/{sankeyDiagram-SY24JHO5-CImx-IX0.js → sankeyDiagram-SY24JHO5-DD80tYLM.js} +2 -2
  73. package/dist/{sequenceDiagram-BLEHNHQU-nWmjd1ci.js → sequenceDiagram-BLEHNHQU-Bo9dDD6b.js} +3 -3
  74. package/dist/{sizeCapture-INFHLROL-D3jlbt7h.js → sizeCapture-INFHLROL-BQTwKEEH.js} +1 -1
  75. package/dist/{stateDiagram-v2-A6IESKWZ-DG1ZetEu.js → stateDiagram-v2-A6IESKWZ-um_LWxkE.js} +4 -4
  76. package/dist/{swimlanes-B3ENRKFQ-cCmJE8AU.js → swimlanes-B3ENRKFQ-DyYkLRSQ.js} +3 -3
  77. package/dist/{swimlanesDiagram-AYQRV4AK-CtuhyguU.js → swimlanesDiagram-AYQRV4AK-DlAG_Vwl.js} +3 -3
  78. package/dist/{timeline-definition-JXYKGLGB-Cc-INsOv.js → timeline-definition-JXYKGLGB-DVH8Jsv4.js} +1 -1
  79. package/dist/{useLabData-Df-jEHKs.js → useLabData-fKy_tVvS.js} +2 -1
  80. package/dist/{usecaseDiagram-WPOLBNNX-r8wVjopm.js → usecaseDiagram-WPOLBNNX-DvsgvjCb.js} +3 -3
  81. package/dist/{vennDiagram-Q3Y3IDCW-BZiOcgrj.js → vennDiagram-Q3Y3IDCW-BQcWfjtm.js} +2 -2
  82. package/dist/{wardleyDiagram-IVAIDKWA-16jd07C_.js → wardleyDiagram-IVAIDKWA-M_Wv4tRx.js} +2 -2
  83. package/dist/{workshop-app-DnHNjBqy.js → workshop-app-wZ37Phc-.js} +60 -22
  84. package/dist/workshop-app.css +1 -1
  85. package/dist/workshop-app.js +1 -1
  86. package/dist/{xychartDiagram-4URNHDU4-C8DwWQNh.js → xychartDiagram-4URNHDU4-DBviJ7Ux.js} +1 -1
  87. package/dist-cli/workshop.js +2 -2
  88. package/package.json +1 -1
  89. package/dist/AppListPage-D87piiOw.js +0 -1364
@@ -0,0 +1,1465 @@
1
+ import { N as K, r as l, R as D, u as B, b as Be, j as e, a as E, I as Pe, Y as Xt, ao as Zt, ap as ze, aq as wt, w as Qt, a7 as at, i as je, Z as _e, _ as ot } from "./workshop-app-wZ37Phc-.js";
2
+ import { d as es } from "./dayjs.min-C8_4Wqpb.js";
3
+ import { M as ts, p as re, bg as ss, b2 as ns, bh as k, bi as as, bj as os, bk as rs, bl as ls, D as is, bm as He, ao as cs, A as ds, bn as ps, bo as We, a6 as us, a7 as hs, bp as ms, bq as gs, br as xs, bs, bt as yt, aO as le, af as rt, bu as fs, an as ks, bv as X, bw as lt, bx as it, by as ws, R as ys, bz as vs, T as Le, ai as js, bA as _s, bB as Ls, bC as Ns, bD as Os } from "./useLabData-fKy_tVvS.js";
4
+ import { R as Cs, p as Ss, s as As, U as Is, A as ct, a as Es } from "./AppFormModal-ByNEloW-.js";
5
+ var Z = {}, dt;
6
+ function $s() {
7
+ if (dt) return Z;
8
+ dt = 1, Object.defineProperty(Z, "__esModule", { value: !0 });
9
+ var t = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z" } }] }, name: "clock-circle", theme: "outlined" };
10
+ return Z.default = t, Z;
11
+ }
12
+ var Ts = /* @__PURE__ */ $s();
13
+ const Rs = /* @__PURE__ */ K(Ts);
14
+ function Ne() {
15
+ return Ne = Object.assign ? Object.assign.bind() : function(t) {
16
+ for (var s = 1; s < arguments.length; s++) {
17
+ var a = arguments[s];
18
+ for (var n in a)
19
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
20
+ }
21
+ return t;
22
+ }, Ne.apply(this, arguments);
23
+ }
24
+ const Ms = (t, s) => /* @__PURE__ */ l.createElement(D, Ne({}, t, {
25
+ ref: s,
26
+ icon: Rs
27
+ })), Bs = /* @__PURE__ */ l.forwardRef(Ms);
28
+ var Q = {}, pt;
29
+ function Ps() {
30
+ if (pt) return Q;
31
+ pt = 1, Object.defineProperty(Q, "__esModule", { value: !0 });
32
+ var t = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, name: "code", theme: "outlined" };
33
+ return Q.default = t, Q;
34
+ }
35
+ var zs = /* @__PURE__ */ Ps();
36
+ const Hs = /* @__PURE__ */ K(zs);
37
+ function Oe() {
38
+ return Oe = Object.assign ? Object.assign.bind() : function(t) {
39
+ for (var s = 1; s < arguments.length; s++) {
40
+ var a = arguments[s];
41
+ for (var n in a)
42
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
43
+ }
44
+ return t;
45
+ }, Oe.apply(this, arguments);
46
+ }
47
+ const Ws = (t, s) => /* @__PURE__ */ l.createElement(D, Oe({}, t, {
48
+ ref: s,
49
+ icon: Hs
50
+ })), Fs = /* @__PURE__ */ l.forwardRef(Ws);
51
+ var ee = {}, ut;
52
+ function Ks() {
53
+ if (ut) return ee;
54
+ ut = 1, Object.defineProperty(ee, "__esModule", { value: !0 });
55
+ var t = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 01-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0165.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z" } }] }, name: "deployment-unit", theme: "outlined" };
56
+ return ee.default = t, ee;
57
+ }
58
+ var Ds = /* @__PURE__ */ Ks();
59
+ const Us = /* @__PURE__ */ K(Ds);
60
+ function Ce() {
61
+ return Ce = Object.assign ? Object.assign.bind() : function(t) {
62
+ for (var s = 1; s < arguments.length; s++) {
63
+ var a = arguments[s];
64
+ for (var n in a)
65
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
66
+ }
67
+ return t;
68
+ }, Ce.apply(this, arguments);
69
+ }
70
+ const qs = (t, s) => /* @__PURE__ */ l.createElement(D, Ce({}, t, {
71
+ ref: s,
72
+ icon: Us
73
+ })), Vs = /* @__PURE__ */ l.forwardRef(qs);
74
+ var te = {}, ht;
75
+ function Ys() {
76
+ if (ht) return te;
77
+ ht = 1, Object.defineProperty(te, "__esModule", { value: !0 });
78
+ var t = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "ellipsis", theme: "outlined" };
79
+ return te.default = t, te;
80
+ }
81
+ var Gs = /* @__PURE__ */ Ys();
82
+ const Js = /* @__PURE__ */ K(Gs);
83
+ function Se() {
84
+ return Se = Object.assign ? Object.assign.bind() : function(t) {
85
+ for (var s = 1; s < arguments.length; s++) {
86
+ var a = arguments[s];
87
+ for (var n in a)
88
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
89
+ }
90
+ return t;
91
+ }, Se.apply(this, arguments);
92
+ }
93
+ const Xs = (t, s) => /* @__PURE__ */ l.createElement(D, Se({}, t, {
94
+ ref: s,
95
+ icon: Js
96
+ })), Zs = /* @__PURE__ */ l.forwardRef(Xs);
97
+ var se = {}, mt;
98
+ function Qs() {
99
+ if (mt) return se;
100
+ mt = 1, Object.defineProperty(se, "__esModule", { value: !0 });
101
+ var t = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z" } }] }, name: "folder", theme: "outlined" };
102
+ return se.default = t, se;
103
+ }
104
+ var en = /* @__PURE__ */ Qs();
105
+ const tn = /* @__PURE__ */ K(en);
106
+ function Ae() {
107
+ return Ae = Object.assign ? Object.assign.bind() : function(t) {
108
+ for (var s = 1; s < arguments.length; s++) {
109
+ var a = arguments[s];
110
+ for (var n in a)
111
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
112
+ }
113
+ return t;
114
+ }, Ae.apply(this, arguments);
115
+ }
116
+ const sn = (t, s) => /* @__PURE__ */ l.createElement(D, Ae({}, t, {
117
+ ref: s,
118
+ icon: tn
119
+ })), vt = /* @__PURE__ */ l.forwardRef(sn);
120
+ var ne = {}, gt;
121
+ function nn() {
122
+ if (gt) return ne;
123
+ gt = 1, Object.defineProperty(ne, "__esModule", { value: !0 });
124
+ var t = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z" } }] }, name: "import", theme: "outlined" };
125
+ return ne.default = t, ne;
126
+ }
127
+ var an = /* @__PURE__ */ nn();
128
+ const on = /* @__PURE__ */ K(an);
129
+ function Ie() {
130
+ return Ie = Object.assign ? Object.assign.bind() : function(t) {
131
+ for (var s = 1; s < arguments.length; s++) {
132
+ var a = arguments[s];
133
+ for (var n in a)
134
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
135
+ }
136
+ return t;
137
+ }, Ie.apply(this, arguments);
138
+ }
139
+ const rn = (t, s) => /* @__PURE__ */ l.createElement(D, Ie({}, t, {
140
+ ref: s,
141
+ icon: on
142
+ })), ln = /* @__PURE__ */ l.forwardRef(rn);
143
+ var ae = {}, xt;
144
+ function cn() {
145
+ if (xt) return ae;
146
+ xt = 1, Object.defineProperty(ae, "__esModule", { value: !0 });
147
+ var t = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-696 72h136v656H184V184zm656 656H384V384h456v456zM384 320V184h456v136H384z" } }] }, name: "layout", theme: "outlined" };
148
+ return ae.default = t, ae;
149
+ }
150
+ var dn = /* @__PURE__ */ cn();
151
+ const pn = /* @__PURE__ */ K(dn);
152
+ function Ee() {
153
+ return Ee = Object.assign ? Object.assign.bind() : function(t) {
154
+ for (var s = 1; s < arguments.length; s++) {
155
+ var a = arguments[s];
156
+ for (var n in a)
157
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
158
+ }
159
+ return t;
160
+ }, Ee.apply(this, arguments);
161
+ }
162
+ const un = (t, s) => /* @__PURE__ */ l.createElement(D, Ee({}, t, {
163
+ ref: s,
164
+ icon: pn
165
+ })), hn = /* @__PURE__ */ l.forwardRef(un);
166
+ var oe = {}, bt;
167
+ function mn() {
168
+ if (bt) return oe;
169
+ bt = 1, Object.defineProperty(oe, "__esModule", { value: !0 });
170
+ var t = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0012.6 0l112-141.9c4.1-5.2.4-13-6.3-13z" } }] }, name: "sort-ascending", theme: "outlined" };
171
+ return oe.default = t, oe;
172
+ }
173
+ var gn = /* @__PURE__ */ mn();
174
+ const xn = /* @__PURE__ */ K(gn);
175
+ function $e() {
176
+ return $e = Object.assign ? Object.assign.bind() : function(t) {
177
+ for (var s = 1; s < arguments.length; s++) {
178
+ var a = arguments[s];
179
+ for (var n in a)
180
+ Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
181
+ }
182
+ return t;
183
+ }, $e.apply(this, arguments);
184
+ }
185
+ const bn = (t, s) => /* @__PURE__ */ l.createElement(D, $e({}, t, {
186
+ ref: s,
187
+ icon: xn
188
+ })), fn = /* @__PURE__ */ l.forwardRef(bn), kn = "_body_s2xam_6", wn = "_nav_s2xam_13", yn = "_note_s2xam_23", vn = "_footnote_s2xam_30", jn = "_item_s2xam_35", _n = "_itemName_s2xam_60", Ln = "_itemNote_s2xam_68", Nn = "_create_s2xam_75", On = "_pane_s2xam_79", Cn = "_field_s2xam_88", Sn = "_label_s2xam_95", An = "_hint_s2xam_100", In = "_agent_s2xam_107", En = "_danger_s2xam_121", $n = "_dangerText_s2xam_131", y = {
189
+ body: kn,
190
+ nav: wn,
191
+ note: yn,
192
+ footnote: vn,
193
+ item: jn,
194
+ itemName: _n,
195
+ itemNote: Ln,
196
+ create: Nn,
197
+ pane: On,
198
+ field: Cn,
199
+ label: Sn,
200
+ hint: An,
201
+ agent: In,
202
+ danger: En,
203
+ dangerText: $n
204
+ }, U = "new", Tn = 64, ft = (t) => t && {
205
+ mcp: t.mcp,
206
+ tool: t.tool,
207
+ mcpName: t.mcpName,
208
+ ...t.agentId ? { agentId: t.agentId } : {}
209
+ }, Rn = (t) => ({
210
+ mcp: t.mcp,
211
+ mcpName: t.mcpName || t.mcp,
212
+ tool: t.tool,
213
+ ...t.agentId ? { agentId: t.agentId } : {}
214
+ });
215
+ function Te(t, s) {
216
+ return t instanceof as && t.detail ? t.detail : s("workshopLab.workspace.failed");
217
+ }
218
+ function Mn({
219
+ workspaces: t,
220
+ initial: s,
221
+ nameOf: a,
222
+ onChanged: n,
223
+ onClose: h
224
+ }) {
225
+ const { t: m } = B(), { message: w, modal: j } = Be(), i = (p, C) => m(`workshopLab.workspace.${p}`, C), $ = (p) => {
226
+ const C = t.find((I) => I.id === p);
227
+ return {
228
+ id: C ? p : U,
229
+ name: C ? C.name : "",
230
+ agent: ft(C?.defaultAgent)
231
+ };
232
+ }, [g, c] = l.useState(() => $(s)), [N, x] = l.useState(!1), [T, _] = l.useState(null), A = t.find((p) => p.id === g.id), L = A?.isDefault ?? !1, b = (p) => {
233
+ _(null), c($(p));
234
+ }, R = async () => {
235
+ const p = g.name.trim();
236
+ if (!L && !p) return _("name");
237
+ if (g.agent?.mcp && !g.agent.tool) return _("tool");
238
+ _(null);
239
+ const C = {
240
+ name: L ? "" : p,
241
+ ...g.agent?.mcp ? { defaultAgent: Rn(g.agent) } : {}
242
+ };
243
+ x(!0);
244
+ try {
245
+ const I = g.id === U ? await rs(C) : await ls(g.id, C);
246
+ await n(), c({
247
+ id: I.id,
248
+ name: I.name,
249
+ agent: ft(I.defaultAgent)
250
+ }), w.success(i("saved"));
251
+ } catch (I) {
252
+ w.error(Te(I, m));
253
+ } finally {
254
+ x(!1);
255
+ }
256
+ }, u = () => {
257
+ !A || L || j.confirm({
258
+ title: i("deleteConfirm", { name: a(A) }),
259
+ okText: i("delete"),
260
+ okButtonProps: { danger: !0 },
261
+ onOk: async () => {
262
+ try {
263
+ await os(A.id), await n(), b(t.find((p) => p.isDefault)?.id ?? U), w.success(i("deleted"));
264
+ } catch (p) {
265
+ w.error(Te(p, m));
266
+ }
267
+ }
268
+ });
269
+ };
270
+ return /* @__PURE__ */ e.jsx(
271
+ ts,
272
+ {
273
+ open: !0,
274
+ width: 880,
275
+ title: i("manageTitle"),
276
+ onCancel: h,
277
+ footer: [
278
+ /* @__PURE__ */ e.jsx(E, { onClick: h, children: i("close") }, "close"),
279
+ /* @__PURE__ */ e.jsx(E, { type: "primary", loading: N, onClick: () => {
280
+ R();
281
+ }, children: i("save") }, "save")
282
+ ],
283
+ children: /* @__PURE__ */ e.jsxs("div", { className: y.body, children: [
284
+ /* @__PURE__ */ e.jsxs("nav", { className: y.nav, "aria-label": i("manageTitle"), children: [
285
+ /* @__PURE__ */ e.jsx("p", { className: y.note, children: i("onlyYou") }),
286
+ t.map((p) => /* @__PURE__ */ e.jsxs(
287
+ "button",
288
+ {
289
+ type: "button",
290
+ className: y.item,
291
+ "aria-current": p.id === g.id ? "true" : void 0,
292
+ onClick: () => b(p.id),
293
+ children: [
294
+ /* @__PURE__ */ e.jsx("span", { className: y.itemName, children: a(p) }),
295
+ p.isDefault ? /* @__PURE__ */ e.jsx("span", { className: y.itemNote, children: i("defaultFixed") }) : p.defaultAgent ? /* @__PURE__ */ e.jsx("span", { className: y.itemNote, children: i("hasAgent") }) : null
296
+ ]
297
+ },
298
+ p.id
299
+ )),
300
+ g.id === U ? /* @__PURE__ */ e.jsx("button", { type: "button", className: y.item, "aria-current": "true", children: /* @__PURE__ */ e.jsx("span", { className: y.itemName, children: g.name.trim() || i("newName") }) }) : null,
301
+ /* @__PURE__ */ e.jsx(
302
+ E,
303
+ {
304
+ className: y.create,
305
+ type: "dashed",
306
+ icon: /* @__PURE__ */ e.jsx(re, {}),
307
+ onClick: () => b(U),
308
+ children: i("create")
309
+ }
310
+ ),
311
+ /* @__PURE__ */ e.jsx("p", { className: `${y.note} ${y.footnote}`, children: i("footnote") })
312
+ ] }),
313
+ /* @__PURE__ */ e.jsxs("div", { className: y.pane, children: [
314
+ /* @__PURE__ */ e.jsxs("label", { className: y.field, children: [
315
+ /* @__PURE__ */ e.jsx("span", { className: y.label, children: i("nameLabel") }),
316
+ /* @__PURE__ */ e.jsx(
317
+ Pe,
318
+ {
319
+ value: L ? i("default") : g.name,
320
+ disabled: L,
321
+ maxLength: Tn,
322
+ placeholder: i("newName"),
323
+ status: T === "name" ? "error" : void 0,
324
+ onChange: (p) => c({ ...g, name: p.target.value })
325
+ }
326
+ ),
327
+ /* @__PURE__ */ e.jsx("span", { className: y.hint, children: i(T === "name" ? "nameRequired" : L ? "defaultFixed" : "nameHint") })
328
+ ] }),
329
+ /* @__PURE__ */ e.jsxs("fieldset", { className: y.agent, children: [
330
+ /* @__PURE__ */ e.jsx("legend", { className: y.label, children: i("agentTitle") }),
331
+ /* @__PURE__ */ e.jsx("p", { className: y.hint, children: i("agentIntro") }),
332
+ /* @__PURE__ */ e.jsx(
333
+ ss,
334
+ {
335
+ value: g.agent,
336
+ onChange: (p) => c({
337
+ ...g,
338
+ agent: ns(p) ? p : void 0
339
+ })
340
+ },
341
+ g.id
342
+ ),
343
+ T === "tool" ? /* @__PURE__ */ e.jsx(k.Text, { type: "danger", children: i("agentToolRequired") }) : null,
344
+ g.agent?.mcp ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(E, { size: "small", onClick: () => c({ ...g, agent: void 0 }), children: i("clearAgent") }) }) : null
345
+ ] }),
346
+ A && !L ? /* @__PURE__ */ e.jsxs("div", { className: y.danger, children: [
347
+ /* @__PURE__ */ e.jsxs("div", { className: y.dangerText, children: [
348
+ /* @__PURE__ */ e.jsx("div", { className: y.label, children: i("deleteTitle") }),
349
+ /* @__PURE__ */ e.jsx("div", { className: y.hint, children: i("deleteHint") })
350
+ ] }),
351
+ /* @__PURE__ */ e.jsx(E, { danger: !0, onClick: u, children: i("delete") })
352
+ ] }) : null
353
+ ] })
354
+ ] })
355
+ }
356
+ );
357
+ }
358
+ const ce = "bkn-workshop", de = "bkn-agent-retrieval", Re = ["claude", "cursor", "workbuddy", "generic"], Bn = ["oauth", "apiKey"];
359
+ function Pn(t) {
360
+ return t === "oauth" ? Re : Re.filter((s) => s !== "workbuddy");
361
+ }
362
+ const zn = "bak_";
363
+ function Hn(t) {
364
+ const s = t.replace(/\/+$/, "");
365
+ return {
366
+ workshop: `${s}/api/workshop/v1/mcp`,
367
+ network: `${s}/api/agent-retrieval/v1/mcp/`
368
+ };
369
+ }
370
+ function Me(t) {
371
+ return `Authorization: Bearer ${t}`;
372
+ }
373
+ function Wn(t, s) {
374
+ const a = (n, h) => s === void 0 ? ["claude mcp add --transport http --scope user \\", ` ${n} ${h}`] : [
375
+ "claude mcp add --transport http --scope user \\",
376
+ ` ${n} ${h} \\`,
377
+ ` --header "${Me(s)}"`
378
+ ];
379
+ return [
380
+ ...a(ce, t.workshop),
381
+ ...a(de, t.network)
382
+ ].join(`
383
+ `);
384
+ }
385
+ function Fn(t, s) {
386
+ const a = (n) => s === void 0 ? { type: "http", url: n } : { type: "http", url: n, headers: { Authorization: `Bearer ${s}` } };
387
+ return JSON.stringify(
388
+ {
389
+ mcpServers: {
390
+ [ce]: a(t.workshop),
391
+ [de]: a(t.network)
392
+ }
393
+ },
394
+ null,
395
+ 2
396
+ );
397
+ }
398
+ function Kn(t) {
399
+ const s = t.replace(/\/+$/, "");
400
+ let a = s;
401
+ try {
402
+ a = new URL(s).host;
403
+ } catch {
404
+ }
405
+ return [
406
+ "location /api/ {",
407
+ ` proxy_pass ${s}/api/;`,
408
+ " proxy_ssl_server_name on;",
409
+ ` proxy_set_header Host ${a};`,
410
+ ' proxy_set_header Cookie "";',
411
+ " proxy_buffering off;",
412
+ " proxy_read_timeout 300s;",
413
+ "}"
414
+ ].join(`
415
+ `);
416
+ }
417
+ const Dn = /^\d{1,3}(\.\d{1,3}){3}$/;
418
+ function Un(t) {
419
+ let s;
420
+ try {
421
+ s = new URL(t);
422
+ } catch {
423
+ return null;
424
+ }
425
+ if (s.protocol === "http:") return "http";
426
+ if (s.protocol !== "https:") return null;
427
+ const a = s.hostname.toLowerCase();
428
+ return a.startsWith("[") || Dn.test(a) || /\.local\.?$/.test(a) ? "selfSigned" : null;
429
+ }
430
+ const jt = "workshop.connectAgent.client", _t = "workshop.connectAgent.auth";
431
+ function qn() {
432
+ try {
433
+ const t = localStorage.getItem(jt);
434
+ return Re.find((s) => s === t) ?? "claude";
435
+ } catch {
436
+ return "claude";
437
+ }
438
+ }
439
+ function Vn(t) {
440
+ try {
441
+ localStorage.setItem(jt, t);
442
+ } catch {
443
+ }
444
+ }
445
+ function Yn() {
446
+ try {
447
+ const t = localStorage.getItem(_t);
448
+ return Bn.find((s) => s === t) ?? "oauth";
449
+ } catch {
450
+ return "oauth";
451
+ }
452
+ }
453
+ function Gn(t) {
454
+ try {
455
+ localStorage.setItem(_t, t);
456
+ } catch {
457
+ }
458
+ }
459
+ const Jn = "_body_1xxio_6", Xn = "_scope_1xxio_14", Zn = "_can_1xxio_30", Qn = "_cannot_1xxio_34", ea = "_auth_1xxio_38", ta = "_key_1xxio_46", sa = "_keyError_1xxio_57", na = "_code_1xxio_62", aa = "_codeHead_1xxio_68", oa = "_addresses_1xxio_87", ra = "_server_1xxio_91", la = "_steps_1xxio_107", ia = "_prompt_1xxio_116", ca = "_foot_1xxio_120", da = "_sections_1xxio_127", pa = "_contract_1xxio_136", ua = "_note_1xxio_147", v = {
460
+ body: Jn,
461
+ scope: Xn,
462
+ can: Zn,
463
+ cannot: Qn,
464
+ auth: ea,
465
+ key: ta,
466
+ keyError: sa,
467
+ code: na,
468
+ codeHead: aa,
469
+ addresses: oa,
470
+ server: ra,
471
+ steps: la,
472
+ prompt: ia,
473
+ foot: ca,
474
+ sections: da,
475
+ contract: pa,
476
+ note: ua
477
+ }, Lt = () => null;
478
+ function ha() {
479
+ return (ze()?.useConnectedClients ?? Lt)();
480
+ }
481
+ function ma() {
482
+ return (ze()?.useApiKeys ?? Lt)();
483
+ }
484
+ const ga = {
485
+ claude: "Claude Code",
486
+ cursor: "Cursor",
487
+ workbuddy: "WorkBuddy"
488
+ }, xa = ["use", "develop", "call", "embed"], Fe = () => ze()?.gateway?.() ?? window.location.origin;
489
+ function F({ label: t, code: s }) {
490
+ return /* @__PURE__ */ e.jsxs("div", { className: v.code, children: [
491
+ /* @__PURE__ */ e.jsxs("div", { className: v.codeHead, children: [
492
+ /* @__PURE__ */ e.jsx("span", { children: t }),
493
+ /* @__PURE__ */ e.jsx(k.Text, { copyable: { text: s } })
494
+ ] }),
495
+ /* @__PURE__ */ e.jsx("pre", { children: s })
496
+ ] });
497
+ }
498
+ function Nt({ texts: t }) {
499
+ const { t: s } = B();
500
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: t.map((a) => /* @__PURE__ */ e.jsx(k.Paragraph, { className: v.prompt, copyable: { text: a }, children: s("workshopLab.agents.quoted", { text: a }) }, a)) });
501
+ }
502
+ function ba({
503
+ open: t,
504
+ section: s = "use",
505
+ onClose: a
506
+ }) {
507
+ const { t: n } = B(), [h, m] = l.useState(s), { token: w } = Xt.useToken(), j = {
508
+ "--agent-code-bg": w.colorFillTertiary,
509
+ "--agent-mono": w.fontFamilyCode,
510
+ "--agent-can": w.colorSuccess,
511
+ "--agent-cannot": w.colorTextTertiary
512
+ };
513
+ return /* @__PURE__ */ e.jsx(
514
+ is,
515
+ {
516
+ open: t,
517
+ onClose: a,
518
+ width: 640,
519
+ title: n(`workshopLab.agents.sections.${h}.title`),
520
+ children: /* @__PURE__ */ e.jsxs("div", { className: v.body, style: j, children: [
521
+ /* @__PURE__ */ e.jsx(
522
+ He,
523
+ {
524
+ className: v.sections,
525
+ block: !0,
526
+ value: h,
527
+ onChange: m,
528
+ options: xa.map((i) => ({
529
+ value: i,
530
+ label: n(`workshopLab.agents.sections.${i}.tab`)
531
+ }))
532
+ }
533
+ ),
534
+ h === "use" ? /* @__PURE__ */ e.jsx(fa, {}) : h === "develop" ? /* @__PURE__ */ e.jsx(ya, {}) : h === "call" ? /* @__PURE__ */ e.jsx(va, {}) : /* @__PURE__ */ e.jsx(Na, {})
535
+ ] })
536
+ }
537
+ );
538
+ }
539
+ function fa() {
540
+ const { t } = B(), s = Hn(Fe()), [a, n] = l.useState(Yn), [h, m] = l.useState(qn), [w, j] = l.useState(""), i = ha(), $ = ma(), g = Pn(a), c = g.includes(h) ? h : "claude", N = a === "apiKey", x = N ? w.trim() || t("workshopLab.agents.apiKey.placeholder") : void 0, T = N && w.trim() !== "" && !w.trim().startsWith(zn), _ = Un(s.workshop), A = (b) => b === "generic" ? t("workshopLab.agents.generic") : ga[b], L = c === "claude" ? Wn(s, x) : Fn(s, x);
541
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
542
+ /* @__PURE__ */ e.jsx(k.Paragraph, { children: t("workshopLab.agents.intro") }),
543
+ /* @__PURE__ */ e.jsxs("ul", { className: v.scope, children: [
544
+ /* @__PURE__ */ e.jsxs("li", { children: [
545
+ /* @__PURE__ */ e.jsx(Zt, { className: v.can }),
546
+ /* @__PURE__ */ e.jsx("span", { children: t("workshopLab.agents.can") })
547
+ ] }),
548
+ /* @__PURE__ */ e.jsxs("li", { children: [
549
+ /* @__PURE__ */ e.jsx(Cs, { className: v.cannot }),
550
+ /* @__PURE__ */ e.jsx("span", { children: t("workshopLab.agents.cannot") })
551
+ ] })
552
+ ] }),
553
+ /* @__PURE__ */ e.jsxs("div", { className: v.auth, children: [
554
+ /* @__PURE__ */ e.jsx(
555
+ He,
556
+ {
557
+ value: a,
558
+ onChange: (b) => {
559
+ n(b), Gn(b);
560
+ },
561
+ options: [
562
+ { value: "oauth", label: t("workshopLab.agents.auth.oauth") },
563
+ { value: "apiKey", label: t("workshopLab.agents.auth.apiKey") }
564
+ ]
565
+ }
566
+ ),
567
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: t(`workshopLab.agents.auth.${a}Hint`) })
568
+ ] }),
569
+ N && /* @__PURE__ */ e.jsxs("div", { className: v.key, children: [
570
+ /* @__PURE__ */ e.jsx(
571
+ Pe.Password,
572
+ {
573
+ value: w,
574
+ onChange: (b) => j(b.target.value),
575
+ placeholder: t("workshopLab.agents.apiKey.input"),
576
+ "aria-label": t("workshopLab.agents.auth.apiKey"),
577
+ status: T ? "error" : void 0,
578
+ autoComplete: "off"
579
+ }
580
+ ),
581
+ $ && /* @__PURE__ */ e.jsx(k.Link, { onClick: $, children: t("workshopLab.agents.apiKey.issue") })
582
+ ] }),
583
+ T && /* @__PURE__ */ e.jsx(k.Text, { type: "danger", className: v.keyError, children: t("workshopLab.agents.apiKey.invalid") }),
584
+ /* @__PURE__ */ e.jsx(
585
+ cs,
586
+ {
587
+ activeKey: c,
588
+ onChange: (b) => {
589
+ const R = g.find((u) => u === b) ?? "claude";
590
+ m(R), Vn(R);
591
+ },
592
+ items: g.map((b) => ({ key: b, label: A(b) }))
593
+ }
594
+ ),
595
+ /* @__PURE__ */ e.jsx(
596
+ F,
597
+ {
598
+ label: t(c === "claude" ? "workshopLab.agents.terminal" : "workshopLab.agents.config"),
599
+ code: L
600
+ }
601
+ ),
602
+ c === "generic" && /* @__PURE__ */ e.jsxs("div", { className: v.addresses, children: [
603
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: t("workshopLab.agents.addresses") }),
604
+ [
605
+ ["workshop", ce, s.workshop],
606
+ ["network", de, s.network]
607
+ ].map(([b, R, u]) => /* @__PURE__ */ e.jsxs("div", { className: v.server, children: [
608
+ /* @__PURE__ */ e.jsxs("div", { children: [
609
+ /* @__PURE__ */ e.jsx(k.Text, { strong: !0, children: R }),
610
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: t(`workshopLab.agents.serverRole.${b}`) })
611
+ ] }),
612
+ /* @__PURE__ */ e.jsx(k.Text, { code: !0, copyable: { text: u }, children: u })
613
+ ] }, b)),
614
+ x !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: v.server, children: [
615
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: t("workshopLab.agents.header") }),
616
+ /* @__PURE__ */ e.jsx(k.Text, { code: !0, copyable: { text: Me(x) }, children: Me(x) })
617
+ ] })
618
+ ] }),
619
+ /* @__PURE__ */ e.jsx(k.Text, { strong: !0, children: c === "generic" ? t("workshopLab.agents.stepsHeadingGeneric") : t("workshopLab.agents.stepsHeading", { client: A(c) }) }),
620
+ /* @__PURE__ */ e.jsxs("ol", { className: v.steps, children: [
621
+ N && /* @__PURE__ */ e.jsx("li", { children: t("workshopLab.agents.apiKey.issueStep") }),
622
+ /* @__PURE__ */ e.jsx("li", { children: t(`workshopLab.agents.steps.${c}.copy`) }),
623
+ /* @__PURE__ */ e.jsx("li", { children: N ? t("workshopLab.agents.apiKey.noSignIn") : t(`workshopLab.agents.steps.${c}.signIn`, {
624
+ workshop: ce,
625
+ network: de
626
+ }) }),
627
+ /* @__PURE__ */ e.jsxs("li", { children: [
628
+ t("workshopLab.agents.try"),
629
+ /* @__PURE__ */ e.jsx(
630
+ Nt,
631
+ {
632
+ texts: ["tasks", "analyze"].map(
633
+ (b) => t(`workshopLab.agents.prompts.${b}`)
634
+ )
635
+ }
636
+ )
637
+ ] })
638
+ ] }),
639
+ _ && /* @__PURE__ */ e.jsx(
640
+ ds,
641
+ {
642
+ type: "warning",
643
+ showIcon: !0,
644
+ message: t(
645
+ `workshopLab.agents.concern.${_ === "http" && N ? "httpKey" : _}`
646
+ )
647
+ }
648
+ ),
649
+ i && !N && /* @__PURE__ */ e.jsx("div", { className: v.foot, children: /* @__PURE__ */ e.jsx(k.Link, { onClick: i, children: t("workshopLab.agents.connectedClients") }) })
650
+ ] });
651
+ }
652
+ const ka = "npm install -g @openbkn/workshop @openbkn/bkn-sdk", wa = ["workshop list", "workshop pull <app>", "workshop dev"];
653
+ function ya() {
654
+ const { t } = B(), s = (a, n) => t(`workshopLab.agents.develop.${a}`, n);
655
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
656
+ /* @__PURE__ */ e.jsx(k.Paragraph, { children: s("intro") }),
657
+ /* @__PURE__ */ e.jsxs("ol", { className: v.steps, children: [
658
+ /* @__PURE__ */ e.jsxs("li", { children: [
659
+ s("install"),
660
+ /* @__PURE__ */ e.jsx(
661
+ F,
662
+ {
663
+ label: t("workshopLab.agents.terminal"),
664
+ code: `${ka}
665
+ workshop skill add`
666
+ }
667
+ ),
668
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: s("skill") })
669
+ ] }),
670
+ /* @__PURE__ */ e.jsxs("li", { children: [
671
+ s("signIn"),
672
+ /* @__PURE__ */ e.jsx(
673
+ F,
674
+ {
675
+ label: t("workshopLab.agents.terminal"),
676
+ code: `openbkn auth login ${Fe()}`
677
+ }
678
+ )
679
+ ] }),
680
+ /* @__PURE__ */ e.jsxs("li", { children: [
681
+ s("ask"),
682
+ /* @__PURE__ */ e.jsx(Nt, { texts: [s("prompts.create"), s("prompts.change")] })
683
+ ] }),
684
+ /* @__PURE__ */ e.jsxs("li", { children: [
685
+ s("commands"),
686
+ /* @__PURE__ */ e.jsx(
687
+ F,
688
+ {
689
+ label: t("workshopLab.agents.terminal"),
690
+ code: wa.map((a) => a.replace("<app>", s("appPlaceholder"))).join(
691
+ `
692
+ `
693
+ )
694
+ }
695
+ ),
696
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: s("publish") })
697
+ ] })
698
+ ] })
699
+ ] });
700
+ }
701
+ function va() {
702
+ const { t } = B(), s = (n) => t(`workshopLab.agents.call.${n}`), a = (n) => t(`workshopLab.config.mcpTool.${n}`);
703
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
704
+ /* @__PURE__ */ e.jsx(k.Paragraph, { children: s("intro") }),
705
+ /* @__PURE__ */ e.jsxs("ol", { className: v.steps, children: [
706
+ /* @__PURE__ */ e.jsx("li", { children: s("register") }),
707
+ /* @__PURE__ */ e.jsxs("li", { children: [
708
+ s("pick"),
709
+ /* @__PURE__ */ e.jsx(k.Paragraph, { type: "secondary", className: v.note, children: s("passToken") })
710
+ ] }),
711
+ /* @__PURE__ */ e.jsxs("li", { children: [
712
+ s("contract"),
713
+ /* @__PURE__ */ e.jsxs("div", { className: v.contract, children: [
714
+ /* @__PURE__ */ e.jsx(k.Text, { children: a("contractIntro") }),
715
+ /* @__PURE__ */ e.jsx("ul", { children: ps.map((n) => /* @__PURE__ */ e.jsxs("li", { children: [
716
+ /* @__PURE__ */ e.jsx(k.Text, { code: !0, children: n }),
717
+ " ",
718
+ t(`workshopLab.config.mcpTool.params.${n}`)
719
+ ] }, n)) }),
720
+ /* @__PURE__ */ e.jsx(k.Text, { children: a("contractOutput") })
721
+ ] })
722
+ ] })
723
+ ] })
724
+ ] });
725
+ }
726
+ const ja = "npm install @openbkn/workshop", _a = "node node_modules/@openbkn/workshop/example/server.mjs", La = (t) => [
727
+ 'import { mountWorkshop } from "@openbkn/workshop";',
728
+ 'import "@openbkn/workshop/style.css";',
729
+ "",
730
+ 'const workshop = mountWorkshop(document.getElementById("workshop"), {',
731
+ ' apiBase: "/api",',
732
+ " getToken: () => currentToken(),",
733
+ " refreshToken: () => signIn(),",
734
+ ' locale: "zh-CN",',
735
+ ` place: { page: "run", appId: "${t}" },`,
736
+ " onNavigate: (place) => (location.hash = hashOf(place)),",
737
+ " href: (place) => hashOf(place),",
738
+ "});",
739
+ "",
740
+ 'addEventListener("hashchange", () => workshop.show(placeOf(location.hash)));'
741
+ ].join(`
742
+ `);
743
+ function Na() {
744
+ const { t } = B(), s = (n) => t(`workshopLab.agents.embed.${n}`), a = Fe();
745
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
746
+ /* @__PURE__ */ e.jsx(k.Paragraph, { children: s("intro") }),
747
+ /* @__PURE__ */ e.jsxs("ol", { className: v.steps, children: [
748
+ /* @__PURE__ */ e.jsxs("li", { children: [
749
+ s("install"),
750
+ /* @__PURE__ */ e.jsx(F, { label: t("workshopLab.agents.terminal"), code: ja })
751
+ ] }),
752
+ /* @__PURE__ */ e.jsxs("li", { children: [
753
+ s("mount"),
754
+ /* @__PURE__ */ e.jsx(F, { label: s("page"), code: La(s("appPlaceholder")) }),
755
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: s("mountNote") }),
756
+ /* @__PURE__ */ e.jsx(k.Paragraph, { type: "secondary", className: v.note, children: s("styles") })
757
+ ] }),
758
+ /* @__PURE__ */ e.jsxs("li", { children: [
759
+ s("proxy"),
760
+ /* @__PURE__ */ e.jsx(F, { label: "nginx", code: Kn(a) }),
761
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: s("proxyNote") })
762
+ ] }),
763
+ /* @__PURE__ */ e.jsx("li", { children: s("token") }),
764
+ /* @__PURE__ */ e.jsxs("li", { children: [
765
+ s("example"),
766
+ /* @__PURE__ */ e.jsx(
767
+ F,
768
+ {
769
+ label: t("workshopLab.agents.terminal"),
770
+ code: `openbkn auth login ${a}
771
+ ${_a}`
772
+ }
773
+ ),
774
+ /* @__PURE__ */ e.jsx(k.Text, { type: "secondary", children: s("exampleNote") })
775
+ ] })
776
+ ] })
777
+ ] });
778
+ }
779
+ function Oa(t, s, a, n = "all") {
780
+ const h = s.trim().toLowerCase();
781
+ return t.filter(
782
+ (m) => (a === "all" || We(m).some((w) => w.id === a)) && (n === "all" || (m.tags ?? []).includes(n)) && (!h || `${m.name}
783
+ ${m.description ?? ""}`.toLowerCase().includes(h))
784
+ );
785
+ }
786
+ function Ot(t, s) {
787
+ return s === "all" || t.workspaceId === s;
788
+ }
789
+ function ie(t, s) {
790
+ return t.creator !== "" && t.creator !== s;
791
+ }
792
+ const kt = (t, s, a) => t === "all" || t === "shared" === ie(s, a);
793
+ function Ca(t, s, a, n, h) {
794
+ const m = a.keyword.trim().toLowerCase(), w = a.kind === "analysis" ? [] : Oa(t, a.keyword, a.network, a.tag).filter(
795
+ (c) => kt(a.owner, c, a.me) && Ot(c, a.workspace ?? "all")
796
+ ).map((c) => ({ kind: "app", id: c.id, app: c })), j = a.kind === "app" || a.tag !== "all" ? [] : s.filter(
797
+ (c) => (a.network === "all" || c.knId === a.network) && kt(a.owner, c, a.me) && (!m || c.name.toLowerCase().includes(m))
798
+ ).map((c) => ({ kind: "analysis", id: c.id, analysis: c })), i = (c) => c.kind === "app" ? c.app.name : c.analysis.name, $ = (c) => c.kind === "app" ? c.app.updatedAt : c.analysis.updatedAt, g = h === "asc" ? 1 : -1;
799
+ return [...w, ...j].sort(
800
+ (c, N) => g * (n === "name" ? i(c).localeCompare(i(N)) : $(c) - $(N))
801
+ );
802
+ }
803
+ function Sa(t) {
804
+ return t.draft ? { name: `${t.id}.app.yaml`, text: As(t.draft, { lineWidth: 0 }) } : null;
805
+ }
806
+ function Aa(t, s) {
807
+ return s.find((a) => a.id === t.id) ?? s.find((a) => a.name === t.name);
808
+ }
809
+ async function Ia(t, s, a) {
810
+ let n;
811
+ try {
812
+ n = Ss(t);
813
+ } catch (i) {
814
+ return { ok: !1, errors: [`不是有效的 YAML 或 JSON:${i.message}`] };
815
+ }
816
+ const h = n?.dependencies?.knowledgeNetwork;
817
+ if (!h?.id && !h?.name) return { ok: !1, errors: ["App Spec 没有写依赖的知识网络"] };
818
+ const m = Aa({ id: h.id ?? "", name: h.name ?? "" }, s);
819
+ if (!m)
820
+ return {
821
+ ok: !1,
822
+ errors: [`这里没有应用依赖的知识网络「${h.name ?? h.id}」,请先导入或创建它`]
823
+ };
824
+ const w = us({
825
+ ...n,
826
+ dependencies: { ...n.dependencies, knowledgeNetwork: { ...m } }
827
+ }), j = hs(w, await a(m), { allowEmpty: !0 });
828
+ return j.ok ? { ok: !0, spec: j.app, network: m } : { ok: !1, errors: j.errors };
829
+ }
830
+ const Ea = "_page_1y5di_10", $a = "_titleBar_1y5di_20", Ta = "_title_1y5di_20", Ra = "_switcher_1y5di_35", Ma = "_switcherLabel_1y5di_42", Ba = "_switcherName_1y5di_46", Pa = "_toolbar_1y5di_53", za = "_hint_1y5di_62", Ha = "_toolbarSpacer_1y5di_68", Wa = "_toolbarRight_1y5di_72", Fa = "_searchInput_1y5di_79", Ka = "_searchIcon_1y5di_88", Da = "_filterLabel_1y5di_92", Ua = "_filterSelect_1y5di_98", qa = "_iconButton_1y5di_106", Va = "_toolbarButton_1y5di_125", Ya = "_grid_1y5di_130", Ga = "_empty_1y5di_138", Ja = "_card_1y5di_145", Xa = "_header_1y5di_177", Za = "_titleRow_1y5di_185", Qa = "_iconBox_1y5di_192", eo = "_titleContent_1y5di_206", to = "_name_1y5di_213", so = "_meta_1y5di_223", no = "_description_1y5di_230", ao = "_state_1y5di_245", oo = "_createItem_1y5di_254", ro = "_createIcon_1y5di_262", lo = "_createHint_1y5di_277", io = "_moreButton_1y5di_282", co = "_footer_1y5di_302", po = "_metaItem_1y5di_315", uo = "_footerLeft_1y5di_323", ho = "_footerRight_1y5di_327", mo = "_metaText_1y5di_331", r = {
831
+ page: Ea,
832
+ titleBar: $a,
833
+ title: Ta,
834
+ switcher: Ra,
835
+ switcherLabel: Ma,
836
+ switcherName: Ba,
837
+ toolbar: Pa,
838
+ hint: za,
839
+ toolbarSpacer: Ha,
840
+ toolbarRight: Wa,
841
+ searchInput: Fa,
842
+ searchIcon: Ka,
843
+ filterLabel: Da,
844
+ filterSelect: Ua,
845
+ iconButton: qa,
846
+ toolbarButton: Va,
847
+ grid: Ya,
848
+ empty: Ga,
849
+ card: Ja,
850
+ header: Xa,
851
+ titleRow: Za,
852
+ iconBox: Qa,
853
+ titleContent: eo,
854
+ name: to,
855
+ meta: so,
856
+ description: no,
857
+ state: ao,
858
+ createItem: oo,
859
+ createIcon: ro,
860
+ createHint: lo,
861
+ moreButton: io,
862
+ footer: co,
863
+ metaItem: po,
864
+ footerLeft: uo,
865
+ footerRight: ho,
866
+ metaText: mo
867
+ }, go = [], xo = [
868
+ { key: "use", icon: /* @__PURE__ */ e.jsx(ws, {}) },
869
+ { key: "develop", icon: /* @__PURE__ */ e.jsx(Fs, {}) },
870
+ { key: "call", icon: /* @__PURE__ */ e.jsx(ys, {}) },
871
+ { key: "embed", icon: /* @__PURE__ */ e.jsx(hn, {}) }
872
+ ];
873
+ async function bo(t) {
874
+ const s = await js(t.id), a = s && Sa(s);
875
+ if (!a) return !1;
876
+ const n = URL.createObjectURL(new Blob([a.text], { type: "application/yaml" })), h = document.createElement("a");
877
+ return h.href = n, h.download = a.name, h.click(), URL.revokeObjectURL(n), !0;
878
+ }
879
+ const Ct = "workshop-lab.network";
880
+ function fo() {
881
+ try {
882
+ return window.localStorage.getItem(Ct);
883
+ } catch {
884
+ return null;
885
+ }
886
+ }
887
+ function ko(t) {
888
+ try {
889
+ window.localStorage.setItem(Ct, t);
890
+ } catch {
891
+ }
892
+ }
893
+ const St = "workshop-lab.workspace";
894
+ function wo() {
895
+ try {
896
+ return window.localStorage.getItem(St) ?? "all";
897
+ } catch {
898
+ return "all";
899
+ }
900
+ }
901
+ function yo(t) {
902
+ try {
903
+ window.localStorage.setItem(St, t);
904
+ } catch {
905
+ }
906
+ }
907
+ function Oo({
908
+ analyses: t,
909
+ samples: s,
910
+ titled: a = !0
911
+ }) {
912
+ const { t: n } = B(), h = wt(), [m, w] = l.useState([]), [j, i] = l.useState("loading"), [$, g] = l.useState(!1), [c, N] = l.useState(!1), [x, T] = l.useState(null), { message: _, modal: A } = Be(), L = Os() ?? "", { ShareDrawer: b } = Qt(), R = l.useRef(/* @__PURE__ */ new Set()), u = l.useCallback(async () => {
913
+ try {
914
+ const o = await ms();
915
+ w(o.filter((d) => !R.current.has(d.id))), i("ready");
916
+ } catch {
917
+ i((o) => o === "ready" ? o : "error");
918
+ }
919
+ }, []);
920
+ l.useEffect(() => {
921
+ u();
922
+ }, [u]);
923
+ const [p, C] = l.useState(null), I = l.useCallback(async () => {
924
+ try {
925
+ C(await gs());
926
+ } catch {
927
+ }
928
+ }, []);
929
+ l.useEffect(() => {
930
+ I();
931
+ }, [I]);
932
+ const [Ke, At] = l.useState(wo), M = p?.some((o) => o.id === Ke) ? Ke : "all", It = (o) => {
933
+ At(o), yo(o);
934
+ }, V = p?.find((o) => o.id === M), q = (o) => o.isDefault ? n("workshopLab.workspace.default") : o.name, [De, G] = l.useState(null), Et = async (o, d) => {
935
+ try {
936
+ await _s(o.id, d.id), it(o.id), w(
937
+ (f) => f.map((S) => S.id === o.id ? { ...S, workspaceId: d.id } : S)
938
+ ), _.success(n("workshopLab.workspace.moved", { name: q(d) }));
939
+ } catch (f) {
940
+ _.error(Te(f, n)), await u();
941
+ }
942
+ }, Ue = M === "all" ? void 0 : M, qe = async (o) => {
943
+ try {
944
+ await o();
945
+ } catch (d) {
946
+ _.error(X(d, n));
947
+ }
948
+ await u();
949
+ }, $t = async (o) => {
950
+ await Ns(o), R.current.add(o), w((d) => d.filter((f) => f.id !== o));
951
+ }, [pe, Ve] = l.useState(null), Y = t !== void 0, P = t?.items ?? go, [ue, Tt] = l.useState("all"), [he, me] = l.useState(null), z = xs(), H = z.status === "ready" ? z.networks : [], Ye = H.find((o) => o.id === fo())?.id ?? H[0]?.id, [Rt, Ge] = l.useState(!1), Mt = async (o) => {
952
+ Ge(!0);
953
+ try {
954
+ const d = await Ia(
955
+ await o.text(),
956
+ H,
957
+ (S) => vs(S.id, S.name)
958
+ );
959
+ if (!d.ok) {
960
+ A.error({
961
+ title: n("workshopLab.list.importFailed"),
962
+ content: /* @__PURE__ */ e.jsx("ul", { children: d.errors.slice(0, 8).map((S) => /* @__PURE__ */ e.jsx("li", { children: S }, S)) })
963
+ });
964
+ return;
965
+ }
966
+ const f = await lt(
967
+ d.spec.app.name,
968
+ d.network,
969
+ d.spec,
970
+ { description: d.spec.app.description },
971
+ Ue
972
+ );
973
+ await u(), _.success(n("workshopLab.list.imported", { name: f.name }));
974
+ } catch (d) {
975
+ _.error(X(d, n));
976
+ } finally {
977
+ Ge(!1);
978
+ }
979
+ }, ge = bs(z, Ye), { reload: xe } = z, Bt = () => {
980
+ xe(), g(!0);
981
+ }, Pt = () => {
982
+ xe(), N(!0);
983
+ }, zt = (o) => {
984
+ xe(), me(o);
985
+ }, [Je, Ht] = l.useState("all"), Xe = l.useMemo(() => [...new Set(m.flatMap((o) => o.tags ?? []))].sort(), [m]), [be, Wt] = l.useState(""), [Ze, Ft] = l.useState("all"), [J, Kt] = l.useState({
986
+ by: "updatedAt",
987
+ direction: "desc"
988
+ }), fe = l.useMemo(() => {
989
+ const o = new Map(
990
+ m.flatMap(
991
+ (f) => yt(We(f), H).map((S) => [S.id, S.name])
992
+ )
993
+ ), d = new Map(H.map((f) => [f.id, f.name]));
994
+ for (const f of P)
995
+ o.has(f.knId) || o.set(f.knId, d.get(f.knId) ?? f.knId);
996
+ return [...o].map(([f, S]) => ({ id: f, name: S }));
997
+ }, [P, m, H]), Dt = (o) => fe.find((d) => d.id === o)?.name ?? o, ke = Xe.includes(Je) ? Je : "all", we = fe.some((o) => o.id === Ze) ? Ze : "all", Ut = j === "ready" && m.length === 0 && P.length === 0, [Qe, et] = l.useState(null), qt = z.status === "ready" && H.length === 0, Vt = j !== "loading" && z.status !== "loading" && t?.status !== "loading";
998
+ (s || Y) && Qe === null && Vt && et(
999
+ s && (Ut || qt) ? "samples" : Y && m.length === 0 && P.length > 0 ? "analyses" : "apps"
1000
+ );
1001
+ const W = Qe ?? (s ? null : "apps"), O = W === "analyses", tt = l.useMemo(
1002
+ () => Ca(
1003
+ m,
1004
+ P,
1005
+ {
1006
+ keyword: be,
1007
+ network: we,
1008
+ // Tags belong to apps; the analyses tab hides the tag filter, so it must not narrow it.
1009
+ tag: O ? "all" : ke,
1010
+ kind: O ? "analysis" : "app",
1011
+ owner: ue,
1012
+ me: L,
1013
+ // Analyses go in no workspace.
1014
+ workspace: O ? "all" : M
1015
+ },
1016
+ J.by,
1017
+ J.direction
1018
+ ),
1019
+ [
1020
+ P,
1021
+ m,
1022
+ be,
1023
+ L,
1024
+ we,
1025
+ O,
1026
+ ue,
1027
+ ke,
1028
+ J,
1029
+ M
1030
+ ]
1031
+ ), Yt = !O && M !== "all" && !m.some((o) => Ot(o, M)), Gt = (o) => {
1032
+ if (M !== "all" || !p || p.length < 2) return;
1033
+ const d = p.find((f) => f.id === o.workspaceId);
1034
+ return d && q(d);
1035
+ }, ye = (o) => O ? /* @__PURE__ */ e.jsx(
1036
+ E,
1037
+ {
1038
+ type: "primary",
1039
+ className: o,
1040
+ icon: /* @__PURE__ */ e.jsx(re, {}),
1041
+ onClick: Pt,
1042
+ children: n("workshopLab.analysis.createAnalysis")
1043
+ }
1044
+ ) : /* @__PURE__ */ e.jsx(E, { type: "primary", className: o, icon: /* @__PURE__ */ e.jsx(re, {}), onClick: Bt, children: n("workshopLab.list.create") }), Jt = {
1045
+ items: xo.flatMap(({ key: o, icon: d }) => [
1046
+ ...o === "embed" ? [{ type: "divider" }] : [],
1047
+ {
1048
+ key: o,
1049
+ label: /* @__PURE__ */ e.jsxs("div", { className: r.createItem, children: [
1050
+ /* @__PURE__ */ e.jsx("span", { className: r.createIcon, children: d }),
1051
+ /* @__PURE__ */ e.jsxs("div", { children: [
1052
+ /* @__PURE__ */ e.jsx("div", { children: n(`workshopLab.agents.sections.${o}.title`) }),
1053
+ /* @__PURE__ */ e.jsx("div", { className: r.createHint, children: n(`workshopLab.agents.sections.${o}.hint`) })
1054
+ ] })
1055
+ ] })
1056
+ }
1057
+ ]),
1058
+ onClick: ({ key: o }) => T(o)
1059
+ }, ve = [
1060
+ {
1061
+ value: "apps",
1062
+ label: n(Y ? "workshopLab.analysis.tabApps" : "workshopLab.list.tabApps")
1063
+ },
1064
+ ...Y ? [{ value: "analyses", label: n("workshopLab.analysis.kind") }] : [],
1065
+ ...s ? [{ value: "samples", label: n("workshopLab.list.tabSamples") }] : []
1066
+ ], st = W === "apps" && p ? /* @__PURE__ */ e.jsx(
1067
+ le,
1068
+ {
1069
+ trigger: ["click"],
1070
+ menu: {
1071
+ selectable: !0,
1072
+ selectedKeys: [M],
1073
+ items: [
1074
+ { key: "all", label: n("workshopLab.workspace.all") },
1075
+ ...p.map((o) => ({ key: o.id, label: q(o) })),
1076
+ { type: "divider" },
1077
+ { key: "create", icon: /* @__PURE__ */ e.jsx(re, {}), label: n("workshopLab.workspace.create") },
1078
+ { key: "manage", label: n("workshopLab.workspace.manage") }
1079
+ ],
1080
+ onClick: ({ key: o }) => {
1081
+ o === "create" ? G(U) : o === "manage" ? G(M === "all" ? p[0]?.id ?? U : M) : It(o);
1082
+ }
1083
+ },
1084
+ children: /* @__PURE__ */ e.jsxs(E, { className: r.switcher, icon: /* @__PURE__ */ e.jsx(vt, {}), children: [
1085
+ /* @__PURE__ */ e.jsx("span", { className: r.switcherLabel, children: n("workshopLab.workspace.label") }),
1086
+ /* @__PURE__ */ e.jsx("span", { className: r.switcherName, children: V ? q(V) : n("workshopLab.workspace.all") }),
1087
+ /* @__PURE__ */ e.jsx(at, {})
1088
+ ] })
1089
+ }
1090
+ ) : null, nt = a || ve.length > 1 && W || st ? /* @__PURE__ */ e.jsxs("div", { className: r.titleBar, children: [
1091
+ a ? /* @__PURE__ */ e.jsx("h2", { className: r.title, children: n("workshopLab.list.title") }) : null,
1092
+ st,
1093
+ ve.length > 1 && W ? /* @__PURE__ */ e.jsx(He, { value: W, onChange: et, options: ve }) : null
1094
+ ] }) : null;
1095
+ return W === null || W === "samples" ? /* @__PURE__ */ e.jsxs("div", { className: r.page, children: [
1096
+ nt,
1097
+ W === "samples" ? s : /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(rt, {}) })
1098
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: r.page, children: [
1099
+ nt,
1100
+ /* @__PURE__ */ e.jsxs("div", { className: r.toolbar, children: [
1101
+ ye(r.toolbarButton),
1102
+ O ? null : /* @__PURE__ */ e.jsx(
1103
+ Is,
1104
+ {
1105
+ accept: ".yaml,.yml,.json",
1106
+ showUploadList: !1,
1107
+ disabled: z.status !== "ready",
1108
+ beforeUpload: (o) => (Mt(o), !1),
1109
+ children: /* @__PURE__ */ e.jsx(
1110
+ E,
1111
+ {
1112
+ className: r.toolbarButton,
1113
+ icon: /* @__PURE__ */ e.jsx(ln, {}),
1114
+ loading: Rt,
1115
+ disabled: z.status !== "ready",
1116
+ children: n("workshopLab.list.import")
1117
+ }
1118
+ )
1119
+ }
1120
+ ),
1121
+ /* @__PURE__ */ e.jsx(le, { trigger: ["click"], menu: Jt, children: /* @__PURE__ */ e.jsxs(E, { className: r.toolbarButton, icon: /* @__PURE__ */ e.jsx(fs, {}), children: [
1122
+ n("workshopLab.agents.open"),
1123
+ " ",
1124
+ /* @__PURE__ */ e.jsx(at, {})
1125
+ ] }) }),
1126
+ /* @__PURE__ */ e.jsx("span", { className: r.toolbarSpacer }),
1127
+ /* @__PURE__ */ e.jsxs("div", { className: r.toolbarRight, children: [
1128
+ /* @__PURE__ */ e.jsx(
1129
+ Pe,
1130
+ {
1131
+ allowClear: !0,
1132
+ className: r.searchInput,
1133
+ placeholder: n("workshopLab.list.searchPlaceholder"),
1134
+ prefix: /* @__PURE__ */ e.jsx(ks, { className: r.searchIcon }),
1135
+ value: be,
1136
+ onChange: (o) => Wt(o.target.value)
1137
+ }
1138
+ ),
1139
+ Y ? /* @__PURE__ */ e.jsx(
1140
+ je,
1141
+ {
1142
+ className: r.filterSelect,
1143
+ value: ue,
1144
+ onChange: Tt,
1145
+ "aria-label": n("workshopLab.analysis.ownerFilter"),
1146
+ options: [
1147
+ { value: "all", label: n("workshopLab.analysis.ownerAll") },
1148
+ { value: "mine", label: n("workshopLab.analysis.ownerMine") },
1149
+ { value: "shared", label: n("workshopLab.analysis.ownerShared") }
1150
+ ]
1151
+ }
1152
+ ) : null,
1153
+ O ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1154
+ /* @__PURE__ */ e.jsx("span", { className: r.filterLabel, children: n("workshopLab.list.tagsLabel") }),
1155
+ /* @__PURE__ */ e.jsx(
1156
+ je,
1157
+ {
1158
+ className: r.filterSelect,
1159
+ value: ke,
1160
+ onChange: Ht,
1161
+ options: [
1162
+ { value: "all", label: n("workshopLab.list.allNetworks") },
1163
+ ...Xe.map((o) => ({ value: o, label: o }))
1164
+ ]
1165
+ }
1166
+ )
1167
+ ] }),
1168
+ /* @__PURE__ */ e.jsx("span", { className: r.filterLabel, children: n("workshopLab.list.networkFilter") }),
1169
+ /* @__PURE__ */ e.jsx(
1170
+ je,
1171
+ {
1172
+ className: r.filterSelect,
1173
+ value: we,
1174
+ onChange: Ft,
1175
+ options: [
1176
+ { value: "all", label: n("workshopLab.list.allNetworks") },
1177
+ ...fe.map((o) => ({ value: o.id, label: o.name }))
1178
+ ]
1179
+ }
1180
+ ),
1181
+ /* @__PURE__ */ e.jsx(
1182
+ le,
1183
+ {
1184
+ trigger: ["click"],
1185
+ menu: {
1186
+ selectable: !0,
1187
+ selectedKeys: [J.by],
1188
+ items: [
1189
+ { key: "updatedAt", label: n("workshopLab.list.sortByUpdated") },
1190
+ { key: "name", label: n("workshopLab.list.sortByName") }
1191
+ ],
1192
+ onClick: ({ key: o }) => {
1193
+ const d = o;
1194
+ Kt((f) => ({
1195
+ by: d,
1196
+ direction: d === f.by && f.direction === "desc" ? "asc" : "desc"
1197
+ }));
1198
+ }
1199
+ },
1200
+ children: /* @__PURE__ */ e.jsx(
1201
+ "button",
1202
+ {
1203
+ type: "button",
1204
+ className: r.iconButton,
1205
+ "aria-label": n("workshopLab.list.sort"),
1206
+ children: /* @__PURE__ */ e.jsx(fn, {})
1207
+ }
1208
+ )
1209
+ }
1210
+ )
1211
+ ] })
1212
+ ] }),
1213
+ /* @__PURE__ */ e.jsx("p", { className: r.hint, children: n(O ? "workshopLab.analysis.hint" : "workshopLab.list.hint") }),
1214
+ !O && V?.defaultAgent ? /* @__PURE__ */ e.jsxs("p", { className: r.hint, children: [
1215
+ n("workshopLab.workspace.agentHint", { name: V.defaultAgent.mcpName }),
1216
+ " ",
1217
+ /* @__PURE__ */ e.jsx(E, { type: "link", size: "small", onClick: () => G(V.id), children: n("workshopLab.workspace.agentEdit") })
1218
+ ] }) : null,
1219
+ !O && j === "error" ? /* @__PURE__ */ e.jsxs("p", { className: r.hint, children: [
1220
+ n("workshopLab.store.listFailed"),
1221
+ " ",
1222
+ /* @__PURE__ */ e.jsx(E, { type: "link", size: "small", onClick: () => {
1223
+ u();
1224
+ }, children: n("workshopLab.store.retry") })
1225
+ ] }) : null,
1226
+ O && t?.status === "error" ? /* @__PURE__ */ e.jsxs("p", { className: r.hint, children: [
1227
+ n("workshopLab.analysis.loadFailed"),
1228
+ " ",
1229
+ /* @__PURE__ */ e.jsx(E, { type: "link", size: "small", onClick: () => {
1230
+ t.reload();
1231
+ }, children: n("workshopLab.analysis.retry") })
1232
+ ] }) : null,
1233
+ (O ? t?.status === "loading" : j === "loading") ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(rt, {}) }) : (O ? P.length === 0 : m.length === 0 && j === "ready") ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(
1234
+ _e,
1235
+ {
1236
+ description: n(O ? "workshopLab.analysis.empty" : "workshopLab.list.empty"),
1237
+ children: ye()
1238
+ }
1239
+ ) }) : Yt ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(_e, { description: n("workshopLab.workspace.empty"), children: ye() }) }) : tt.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(
1240
+ _e,
1241
+ {
1242
+ description: n(O ? "workshopLab.analysis.noMatch" : "workshopLab.list.noMatch")
1243
+ }
1244
+ ) }) : /* @__PURE__ */ e.jsx("div", { className: r.grid, children: tt.map(
1245
+ (o) => o.kind === "app" ? /* @__PURE__ */ e.jsx(
1246
+ vo,
1247
+ {
1248
+ app: o.app,
1249
+ networks: H,
1250
+ sharedWithMe: ie(o.app, L),
1251
+ workspaceName: Gt(o.app),
1252
+ workspaces: p ?? [],
1253
+ nameOfWorkspace: q,
1254
+ onMove: (d) => {
1255
+ Et(o.app, d);
1256
+ },
1257
+ onOpen: () => (
1258
+ // Building it needs modify; one shared to use opens as its users see it.
1259
+ h.go({
1260
+ page: o.app.operations.includes("modify") ? "builder" : "run",
1261
+ appId: o.app.id
1262
+ })
1263
+ ),
1264
+ canShare: b !== void 0,
1265
+ onEdit: () => zt(o.app),
1266
+ onShare: () => Ve(o.app),
1267
+ onExport: () => {
1268
+ bo(o.app).then((d) => {
1269
+ d || _.info(n("workshopLab.list.exportBlank"));
1270
+ }).catch((d) => {
1271
+ _.error(X(d, n));
1272
+ });
1273
+ },
1274
+ onDelete: () => qe(() => $t(o.app.id))
1275
+ },
1276
+ o.id
1277
+ ) : /* @__PURE__ */ e.jsx(l.Fragment, { children: t?.card(o.id, {
1278
+ networkName: Dt(o.analysis.knId),
1279
+ sharedWithMe: ie(o.analysis, L)
1280
+ }) }, o.id)
1281
+ ) }),
1282
+ $ && /* @__PURE__ */ e.jsx(
1283
+ ct,
1284
+ {
1285
+ networks: ge,
1286
+ onCancel: () => g(!1),
1287
+ onSubmit: (o, d) => {
1288
+ d && (ko(d.id), lt(o.name, d, null, o, Ue).then((f) => {
1289
+ g(!1), h.go({ page: "builder", appId: f.id });
1290
+ }).catch((f) => {
1291
+ _.error(X(f, n));
1292
+ }));
1293
+ }
1294
+ }
1295
+ ),
1296
+ c && t?.createDialog({
1297
+ networks: ge,
1298
+ initial: Ye,
1299
+ count: P.filter((o) => !ie(o, L)).length,
1300
+ onCancel: () => N(!1)
1301
+ }),
1302
+ t?.dialogs,
1303
+ x && /* @__PURE__ */ e.jsx(ba, { open: !0, section: x, onClose: () => T(null) }),
1304
+ he && /* @__PURE__ */ e.jsx(
1305
+ ct,
1306
+ {
1307
+ app: he,
1308
+ networks: ge,
1309
+ onCancel: () => me(null),
1310
+ onSubmit: (o) => {
1311
+ const d = he.id;
1312
+ me(null), qe(() => Ls(d, o));
1313
+ }
1314
+ }
1315
+ ),
1316
+ De !== null && p ? /* @__PURE__ */ e.jsx(
1317
+ Mn,
1318
+ {
1319
+ workspaces: p,
1320
+ initial: De,
1321
+ nameOf: q,
1322
+ onChanged: async () => {
1323
+ it(), await I(), await u();
1324
+ },
1325
+ onClose: () => G(null)
1326
+ }
1327
+ ) : null,
1328
+ pe && b ? /* @__PURE__ */ e.jsx(
1329
+ b,
1330
+ {
1331
+ appId: pe.id,
1332
+ appName: pe.name,
1333
+ onClose: () => {
1334
+ Ve(null), u();
1335
+ }
1336
+ }
1337
+ ) : null
1338
+ ] });
1339
+ }
1340
+ function vo({
1341
+ app: t,
1342
+ networks: s,
1343
+ sharedWithMe: a,
1344
+ workspaceName: n,
1345
+ workspaces: h,
1346
+ nameOfWorkspace: m,
1347
+ onMove: w,
1348
+ canShare: j,
1349
+ onOpen: i,
1350
+ onEdit: $,
1351
+ onShare: g,
1352
+ onExport: c,
1353
+ onDelete: N
1354
+ }) {
1355
+ const { t: x } = B(), { modal: T } = Be(), _ = wt().href({ page: "run", appId: t.id }), A = yt(We(t), s).map((u) => u.name).join("、"), L = (u) => t.operations.includes(u), b = t.version === 0 ? { color: "warning", text: x("workshopLab.list.unpublished") } : { color: "success", text: x("workshopLab.top.published", { version: t.version }) }, R = () => T.confirm({
1356
+ title: x("workshopLab.list.deleteConfirm"),
1357
+ okText: x("workshopLab.list.delete"),
1358
+ okButtonProps: { danger: !0 },
1359
+ onOk: N
1360
+ });
1361
+ return /* @__PURE__ */ e.jsxs(
1362
+ "article",
1363
+ {
1364
+ className: r.card,
1365
+ style: t.color ? { "--app-accent": t.color } : void 0,
1366
+ "aria-label": t.name,
1367
+ role: "button",
1368
+ tabIndex: 0,
1369
+ onClick: i,
1370
+ onKeyDown: (u) => {
1371
+ u.target === u.currentTarget && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), i());
1372
+ },
1373
+ children: [
1374
+ /* @__PURE__ */ e.jsxs("div", { className: r.header, children: [
1375
+ /* @__PURE__ */ e.jsxs("div", { className: r.titleRow, children: [
1376
+ /* @__PURE__ */ e.jsx("span", { className: r.iconBox, children: /* @__PURE__ */ e.jsx(Es, { icon: t.icon, size: 18 }) }),
1377
+ /* @__PURE__ */ e.jsxs("div", { className: r.titleContent, children: [
1378
+ /* @__PURE__ */ e.jsx("div", { className: r.name, children: t.name }),
1379
+ /* @__PURE__ */ e.jsxs("div", { className: r.meta, children: [
1380
+ /* @__PURE__ */ e.jsx(Le, { className: r.state, color: b.color, children: b.text }),
1381
+ a ? /* @__PURE__ */ e.jsx(Le, { className: r.state, children: x("workshopLab.list.shared") }) : null,
1382
+ n ? /* @__PURE__ */ e.jsx(Le, { className: r.state, icon: /* @__PURE__ */ e.jsx(vt, {}), children: n }) : null
1383
+ ] }),
1384
+ /* @__PURE__ */ e.jsx("div", { className: r.description, children: t.description || x("workshopLab.list.noDescription") })
1385
+ ] })
1386
+ ] }),
1387
+ /* @__PURE__ */ e.jsx(
1388
+ le,
1389
+ {
1390
+ trigger: ["click"],
1391
+ menu: {
1392
+ items: [
1393
+ { key: "open", label: x("workshopLab.list.open") },
1394
+ { key: "edit", label: x("workshopLab.list.edit"), disabled: !L("modify") },
1395
+ { key: "run", label: x("workshopLab.top.run"), disabled: t.version === 0 },
1396
+ { key: "export", label: x("workshopLab.list.export") },
1397
+ // Its own and those shared with the user alike: a workspace is the user's own group.
1398
+ ...h.length > 0 ? [
1399
+ {
1400
+ key: "move",
1401
+ label: x("workshopLab.workspace.moveTo"),
1402
+ children: h.map((u) => ({
1403
+ key: `move:${u.id}`,
1404
+ label: m(u),
1405
+ disabled: u.id === t.workspaceId
1406
+ }))
1407
+ }
1408
+ ] : [],
1409
+ ...j ? [
1410
+ // Shared in the outside system that manages it, not here.
1411
+ {
1412
+ key: "share",
1413
+ label: t.managedBy ? x("workshopLab.list.shareManaged", { name: t.managedBy }) : x("workshopLab.list.share"),
1414
+ disabled: !L("authorize") || !!t.managedBy
1415
+ }
1416
+ ] : [],
1417
+ {
1418
+ key: "delete",
1419
+ label: x("workshopLab.list.delete"),
1420
+ danger: !0,
1421
+ disabled: !L("delete")
1422
+ }
1423
+ ],
1424
+ onClick: ({ key: u, domEvent: p }) => {
1425
+ if (p.stopPropagation(), u === "open") i();
1426
+ else if (u === "edit") $();
1427
+ else if (u === "run") window.open(_, "_blank", "noopener");
1428
+ else if (u === "export") c();
1429
+ else if (u === "share") g();
1430
+ else if (u.startsWith("move:")) {
1431
+ const C = h.find((I) => `move:${I.id}` === u);
1432
+ C && w(C);
1433
+ } else u === "delete" && R();
1434
+ }
1435
+ },
1436
+ children: /* @__PURE__ */ e.jsx(
1437
+ "button",
1438
+ {
1439
+ type: "button",
1440
+ className: r.moreButton,
1441
+ "aria-label": x("workshopLab.list.moreActions"),
1442
+ onClick: (u) => u.stopPropagation(),
1443
+ children: /* @__PURE__ */ e.jsx(Zs, {})
1444
+ }
1445
+ )
1446
+ }
1447
+ )
1448
+ ] }),
1449
+ /* @__PURE__ */ e.jsxs("div", { className: r.footer, children: [
1450
+ /* @__PURE__ */ e.jsx(ot, { title: A, children: /* @__PURE__ */ e.jsxs("span", { className: `${r.metaItem} ${r.footerLeft}`, children: [
1451
+ /* @__PURE__ */ e.jsx(Vs, {}),
1452
+ /* @__PURE__ */ e.jsx("span", { className: r.metaText, children: A })
1453
+ ] }) }),
1454
+ /* @__PURE__ */ e.jsx(ot, { title: x("workshopLab.list.updatedAt"), children: /* @__PURE__ */ e.jsxs("span", { className: `${r.metaItem} ${r.footerRight}`, children: [
1455
+ /* @__PURE__ */ e.jsx(Bs, {}),
1456
+ /* @__PURE__ */ e.jsx("span", { children: es(t.updatedAt).format("YYYY-MM-DD HH:mm") })
1457
+ ] }) })
1458
+ ] })
1459
+ ]
1460
+ }
1461
+ );
1462
+ }
1463
+ export {
1464
+ Oo as AppListPage
1465
+ };