@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
@@ -1,1364 +0,0 @@
1
- import { N as K, r as l, R as D, u as F, b as Te, j as e, a as E, I as Me, Y as Gt, ao as Jt, ap as Be, aq as xt, w as Xt, a7 as st, i as ve, Z as je, _ as at } from "./workshop-app-DnHNjBqy.js";
2
- import { d as Zt } from "./dayjs.min-DZ-YV8Mv.js";
3
- import { M as Qt, p as ne, bg as es, b2 as ts, bh as y, A as Pe, bi as ss, bj as as, bk as ns, bl as os, D as rs, bm as ze, ao as ls, bn as is, bo as We, a6 as cs, a7 as ds, bp as ps, bq as us, br as hs, bs as ms, bt as ft, aO as oe, af as nt, bu as gs, an as bs, bv as J, bw as ot, bx as rt, by as xs, R as fs, bz as ks, T as _e, ai as ws, bA as ys, bB as vs, bC as js, bD as _s } from "./useLabData-Df-jEHKs.js";
4
- import { R as Ns, p as Ls, s as Os, U as Cs, A as lt, a as Ss } from "./AppFormModal-D73ucaHK.js";
5
- var X = {}, it;
6
- function As() {
7
- if (it) return X;
8
- it = 1, Object.defineProperty(X, "__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 X.default = t, X;
11
- }
12
- var Is = /* @__PURE__ */ As();
13
- const Es = /* @__PURE__ */ K(Is);
14
- function Ne() {
15
- return Ne = Object.assign ? Object.assign.bind() : function(t) {
16
- for (var s = 1; s < arguments.length; s++) {
17
- var o = arguments[s];
18
- for (var a in o)
19
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
20
- }
21
- return t;
22
- }, Ne.apply(this, arguments);
23
- }
24
- const $s = (t, s) => /* @__PURE__ */ l.createElement(D, Ne({}, t, {
25
- ref: s,
26
- icon: Es
27
- })), Rs = /* @__PURE__ */ l.forwardRef($s);
28
- var Z = {}, ct;
29
- function Ts() {
30
- if (ct) return Z;
31
- ct = 1, Object.defineProperty(Z, "__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 Z.default = t, Z;
34
- }
35
- var Ms = /* @__PURE__ */ Ts();
36
- const Bs = /* @__PURE__ */ K(Ms);
37
- function Le() {
38
- return Le = Object.assign ? Object.assign.bind() : function(t) {
39
- for (var s = 1; s < arguments.length; s++) {
40
- var o = arguments[s];
41
- for (var a in o)
42
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
43
- }
44
- return t;
45
- }, Le.apply(this, arguments);
46
- }
47
- const Ps = (t, s) => /* @__PURE__ */ l.createElement(D, Le({}, t, {
48
- ref: s,
49
- icon: Bs
50
- })), zs = /* @__PURE__ */ l.forwardRef(Ps);
51
- var Q = {}, dt;
52
- function Ws() {
53
- if (dt) return Q;
54
- dt = 1, Object.defineProperty(Q, "__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 Q.default = t, Q;
57
- }
58
- var Fs = /* @__PURE__ */ Ws();
59
- const Hs = /* @__PURE__ */ K(Fs);
60
- function Oe() {
61
- return Oe = Object.assign ? Object.assign.bind() : function(t) {
62
- for (var s = 1; s < arguments.length; s++) {
63
- var o = arguments[s];
64
- for (var a in o)
65
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
66
- }
67
- return t;
68
- }, Oe.apply(this, arguments);
69
- }
70
- const Ks = (t, s) => /* @__PURE__ */ l.createElement(D, Oe({}, t, {
71
- ref: s,
72
- icon: Hs
73
- })), Ds = /* @__PURE__ */ l.forwardRef(Ks);
74
- var ee = {}, pt;
75
- function Us() {
76
- if (pt) return ee;
77
- pt = 1, Object.defineProperty(ee, "__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 ee.default = t, ee;
80
- }
81
- var qs = /* @__PURE__ */ Us();
82
- const Vs = /* @__PURE__ */ K(qs);
83
- function Ce() {
84
- return Ce = Object.assign ? Object.assign.bind() : function(t) {
85
- for (var s = 1; s < arguments.length; s++) {
86
- var o = arguments[s];
87
- for (var a in o)
88
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
89
- }
90
- return t;
91
- }, Ce.apply(this, arguments);
92
- }
93
- const Ys = (t, s) => /* @__PURE__ */ l.createElement(D, Ce({}, t, {
94
- ref: s,
95
- icon: Vs
96
- })), Gs = /* @__PURE__ */ l.forwardRef(Ys);
97
- var te = {}, ut;
98
- function Js() {
99
- if (ut) return te;
100
- ut = 1, Object.defineProperty(te, "__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 te.default = t, te;
103
- }
104
- var Xs = /* @__PURE__ */ Js();
105
- const Zs = /* @__PURE__ */ K(Xs);
106
- function Se() {
107
- return Se = Object.assign ? Object.assign.bind() : function(t) {
108
- for (var s = 1; s < arguments.length; s++) {
109
- var o = arguments[s];
110
- for (var a in o)
111
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
112
- }
113
- return t;
114
- }, Se.apply(this, arguments);
115
- }
116
- const Qs = (t, s) => /* @__PURE__ */ l.createElement(D, Se({}, t, {
117
- ref: s,
118
- icon: Zs
119
- })), kt = /* @__PURE__ */ l.forwardRef(Qs);
120
- var se = {}, ht;
121
- function ea() {
122
- if (ht) return se;
123
- ht = 1, Object.defineProperty(se, "__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 se.default = t, se;
126
- }
127
- var ta = /* @__PURE__ */ ea();
128
- const sa = /* @__PURE__ */ K(ta);
129
- function Ae() {
130
- return Ae = Object.assign ? Object.assign.bind() : function(t) {
131
- for (var s = 1; s < arguments.length; s++) {
132
- var o = arguments[s];
133
- for (var a in o)
134
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
135
- }
136
- return t;
137
- }, Ae.apply(this, arguments);
138
- }
139
- const aa = (t, s) => /* @__PURE__ */ l.createElement(D, Ae({}, t, {
140
- ref: s,
141
- icon: sa
142
- })), na = /* @__PURE__ */ l.forwardRef(aa);
143
- var ae = {}, mt;
144
- function oa() {
145
- if (mt) return ae;
146
- mt = 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: "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" };
148
- return ae.default = t, ae;
149
- }
150
- var ra = /* @__PURE__ */ oa();
151
- const la = /* @__PURE__ */ K(ra);
152
- function Ie() {
153
- return Ie = Object.assign ? Object.assign.bind() : function(t) {
154
- for (var s = 1; s < arguments.length; s++) {
155
- var o = arguments[s];
156
- for (var a in o)
157
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
158
- }
159
- return t;
160
- }, Ie.apply(this, arguments);
161
- }
162
- const ia = (t, s) => /* @__PURE__ */ l.createElement(D, Ie({}, t, {
163
- ref: s,
164
- icon: la
165
- })), ca = /* @__PURE__ */ l.forwardRef(ia), da = "_body_s2xam_6", pa = "_nav_s2xam_13", ua = "_note_s2xam_23", ha = "_footnote_s2xam_30", ma = "_item_s2xam_35", ga = "_itemName_s2xam_60", ba = "_itemNote_s2xam_68", xa = "_create_s2xam_75", fa = "_pane_s2xam_79", ka = "_field_s2xam_88", wa = "_label_s2xam_95", ya = "_hint_s2xam_100", va = "_agent_s2xam_107", ja = "_danger_s2xam_121", _a = "_dangerText_s2xam_131", w = {
166
- body: da,
167
- nav: pa,
168
- note: ua,
169
- footnote: ha,
170
- item: ma,
171
- itemName: ga,
172
- itemNote: ba,
173
- create: xa,
174
- pane: fa,
175
- field: ka,
176
- label: wa,
177
- hint: ya,
178
- agent: va,
179
- danger: ja,
180
- dangerText: _a
181
- }, H = "new", Na = 64, gt = (t) => t && {
182
- mcp: t.mcp,
183
- tool: t.tool,
184
- mcpName: t.mcpName,
185
- ...t.agentId ? { agentId: t.agentId } : {}
186
- }, La = (t) => ({
187
- mcp: t.mcp,
188
- mcpName: t.mcpName || t.mcp,
189
- tool: t.tool,
190
- ...t.agentId ? { agentId: t.agentId } : {}
191
- });
192
- function Ee(t, s) {
193
- return t instanceof ss && t.detail ? t.detail : s("workshopLab.workspace.failed");
194
- }
195
- function Oa({
196
- workspaces: t,
197
- initial: s,
198
- nameOf: o,
199
- onChanged: a,
200
- onClose: h
201
- }) {
202
- const { t: m } = F(), { message: k, modal: v } = Te(), i = (p, C) => m(`workshopLab.workspace.${p}`, C), $ = (p) => {
203
- const C = t.find((I) => I.id === p);
204
- return {
205
- id: C ? p : H,
206
- name: C ? C.name : "",
207
- agent: gt(C?.defaultAgent)
208
- };
209
- }, [g, c] = l.useState(() => $(s)), [L, b] = l.useState(!1), [R, j] = l.useState(null), A = t.find((p) => p.id === g.id), _ = A?.isDefault ?? !1, x = (p) => {
210
- j(null), c($(p));
211
- }, T = async () => {
212
- const p = g.name.trim();
213
- if (!_ && !p) return j("name");
214
- if (g.agent?.mcp && !g.agent.tool) return j("tool");
215
- j(null);
216
- const C = {
217
- name: _ ? "" : p,
218
- ...g.agent?.mcp ? { defaultAgent: La(g.agent) } : {}
219
- };
220
- b(!0);
221
- try {
222
- const I = g.id === H ? await ns(C) : await os(g.id, C);
223
- await a(), c({
224
- id: I.id,
225
- name: I.name,
226
- agent: gt(I.defaultAgent)
227
- }), k.success(i("saved"));
228
- } catch (I) {
229
- k.error(Ee(I, m));
230
- } finally {
231
- b(!1);
232
- }
233
- }, u = () => {
234
- !A || _ || v.confirm({
235
- title: i("deleteConfirm", { name: o(A) }),
236
- okText: i("delete"),
237
- okButtonProps: { danger: !0 },
238
- onOk: async () => {
239
- try {
240
- await as(A.id), await a(), x(t.find((p) => p.isDefault)?.id ?? H), k.success(i("deleted"));
241
- } catch (p) {
242
- k.error(Ee(p, m));
243
- }
244
- }
245
- });
246
- };
247
- return /* @__PURE__ */ e.jsx(
248
- Qt,
249
- {
250
- open: !0,
251
- width: 880,
252
- title: i("manageTitle"),
253
- onCancel: h,
254
- footer: [
255
- /* @__PURE__ */ e.jsx(E, { onClick: h, children: i("close") }, "close"),
256
- /* @__PURE__ */ e.jsx(E, { type: "primary", loading: L, onClick: () => {
257
- T();
258
- }, children: i("save") }, "save")
259
- ],
260
- children: /* @__PURE__ */ e.jsxs("div", { className: w.body, children: [
261
- /* @__PURE__ */ e.jsxs("nav", { className: w.nav, "aria-label": i("manageTitle"), children: [
262
- /* @__PURE__ */ e.jsx("p", { className: w.note, children: i("onlyYou") }),
263
- t.map((p) => /* @__PURE__ */ e.jsxs(
264
- "button",
265
- {
266
- type: "button",
267
- className: w.item,
268
- "aria-current": p.id === g.id ? "true" : void 0,
269
- onClick: () => x(p.id),
270
- children: [
271
- /* @__PURE__ */ e.jsx("span", { className: w.itemName, children: o(p) }),
272
- p.isDefault ? /* @__PURE__ */ e.jsx("span", { className: w.itemNote, children: i("defaultFixed") }) : p.defaultAgent ? /* @__PURE__ */ e.jsx("span", { className: w.itemNote, children: i("hasAgent") }) : null
273
- ]
274
- },
275
- p.id
276
- )),
277
- g.id === H ? /* @__PURE__ */ e.jsx("button", { type: "button", className: w.item, "aria-current": "true", children: /* @__PURE__ */ e.jsx("span", { className: w.itemName, children: g.name.trim() || i("newName") }) }) : null,
278
- /* @__PURE__ */ e.jsx(
279
- E,
280
- {
281
- className: w.create,
282
- type: "dashed",
283
- icon: /* @__PURE__ */ e.jsx(ne, {}),
284
- onClick: () => x(H),
285
- children: i("create")
286
- }
287
- ),
288
- /* @__PURE__ */ e.jsx("p", { className: `${w.note} ${w.footnote}`, children: i("footnote") })
289
- ] }),
290
- /* @__PURE__ */ e.jsxs("div", { className: w.pane, children: [
291
- /* @__PURE__ */ e.jsxs("label", { className: w.field, children: [
292
- /* @__PURE__ */ e.jsx("span", { className: w.label, children: i("nameLabel") }),
293
- /* @__PURE__ */ e.jsx(
294
- Me,
295
- {
296
- value: _ ? i("default") : g.name,
297
- disabled: _,
298
- maxLength: Na,
299
- placeholder: i("newName"),
300
- status: R === "name" ? "error" : void 0,
301
- onChange: (p) => c({ ...g, name: p.target.value })
302
- }
303
- ),
304
- /* @__PURE__ */ e.jsx("span", { className: w.hint, children: i(R === "name" ? "nameRequired" : _ ? "defaultFixed" : "nameHint") })
305
- ] }),
306
- /* @__PURE__ */ e.jsxs("fieldset", { className: w.agent, children: [
307
- /* @__PURE__ */ e.jsx("legend", { className: w.label, children: i("agentTitle") }),
308
- /* @__PURE__ */ e.jsx("p", { className: w.hint, children: i("agentIntro") }),
309
- /* @__PURE__ */ e.jsx(
310
- es,
311
- {
312
- value: g.agent,
313
- onChange: (p) => c({
314
- ...g,
315
- agent: ts(p) ? p : void 0
316
- })
317
- },
318
- g.id
319
- ),
320
- R === "tool" ? /* @__PURE__ */ e.jsx(y.Text, { type: "danger", children: i("agentToolRequired") }) : null,
321
- /* @__PURE__ */ e.jsx(Pe, { type: "warning", showIcon: !0, message: i("tokenNote") }),
322
- g.agent?.mcp ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(E, { size: "small", onClick: () => c({ ...g, agent: void 0 }), children: i("clearAgent") }) }) : null
323
- ] }),
324
- A && !_ ? /* @__PURE__ */ e.jsxs("div", { className: w.danger, children: [
325
- /* @__PURE__ */ e.jsxs("div", { className: w.dangerText, children: [
326
- /* @__PURE__ */ e.jsx("div", { className: w.label, children: i("deleteTitle") }),
327
- /* @__PURE__ */ e.jsx("div", { className: w.hint, children: i("deleteHint") })
328
- ] }),
329
- /* @__PURE__ */ e.jsx(E, { danger: !0, onClick: u, children: i("delete") })
330
- ] }) : null
331
- ] })
332
- ] })
333
- }
334
- );
335
- }
336
- const ie = "bkn-workshop", ce = "bkn-agent-retrieval", $e = ["claude", "cursor", "workbuddy", "generic"], Ca = ["oauth", "apiKey"];
337
- function Sa(t) {
338
- return t === "oauth" ? $e : $e.filter((s) => s !== "workbuddy");
339
- }
340
- const Aa = "bak_";
341
- function Ia(t) {
342
- const s = t.replace(/\/+$/, "");
343
- return {
344
- workshop: `${s}/api/workshop/v1/mcp`,
345
- network: `${s}/api/agent-retrieval/v1/mcp/`
346
- };
347
- }
348
- function Re(t) {
349
- return `Authorization: Bearer ${t}`;
350
- }
351
- function Ea(t, s) {
352
- const o = (a, h) => s === void 0 ? ["claude mcp add --transport http --scope user \\", ` ${a} ${h}`] : [
353
- "claude mcp add --transport http --scope user \\",
354
- ` ${a} ${h} \\`,
355
- ` --header "${Re(s)}"`
356
- ];
357
- return [
358
- ...o(ie, t.workshop),
359
- ...o(ce, t.network)
360
- ].join(`
361
- `);
362
- }
363
- function $a(t, s) {
364
- const o = (a) => s === void 0 ? { type: "http", url: a } : { type: "http", url: a, headers: { Authorization: `Bearer ${s}` } };
365
- return JSON.stringify(
366
- {
367
- mcpServers: {
368
- [ie]: o(t.workshop),
369
- [ce]: o(t.network)
370
- }
371
- },
372
- null,
373
- 2
374
- );
375
- }
376
- const Ra = /^\d{1,3}(\.\d{1,3}){3}$/;
377
- function Ta(t) {
378
- let s;
379
- try {
380
- s = new URL(t);
381
- } catch {
382
- return null;
383
- }
384
- if (s.protocol === "http:") return "http";
385
- if (s.protocol !== "https:") return null;
386
- const o = s.hostname.toLowerCase();
387
- return o.startsWith("[") || Ra.test(o) || /\.local\.?$/.test(o) ? "selfSigned" : null;
388
- }
389
- const wt = "workshop.connectAgent.client", yt = "workshop.connectAgent.auth";
390
- function Ma() {
391
- try {
392
- const t = localStorage.getItem(wt);
393
- return $e.find((s) => s === t) ?? "claude";
394
- } catch {
395
- return "claude";
396
- }
397
- }
398
- function Ba(t) {
399
- try {
400
- localStorage.setItem(wt, t);
401
- } catch {
402
- }
403
- }
404
- function Pa() {
405
- try {
406
- const t = localStorage.getItem(yt);
407
- return Ca.find((s) => s === t) ?? "oauth";
408
- } catch {
409
- return "oauth";
410
- }
411
- }
412
- function za(t) {
413
- try {
414
- localStorage.setItem(yt, t);
415
- } catch {
416
- }
417
- }
418
- const Wa = "_body_12ytx_6", Fa = "_scope_12ytx_14", Ha = "_can_12ytx_30", Ka = "_cannot_12ytx_34", Da = "_auth_12ytx_38", Ua = "_key_12ytx_46", qa = "_keyError_12ytx_57", Va = "_code_12ytx_62", Ya = "_codeHead_12ytx_68", Ga = "_addresses_12ytx_87", Ja = "_server_12ytx_91", Xa = "_steps_12ytx_107", Za = "_prompt_12ytx_116", Qa = "_foot_12ytx_120", en = "_sections_12ytx_127", tn = "_contract_12ytx_136", N = {
419
- body: Wa,
420
- scope: Fa,
421
- can: Ha,
422
- cannot: Ka,
423
- auth: Da,
424
- key: Ua,
425
- keyError: qa,
426
- code: Va,
427
- codeHead: Ya,
428
- addresses: Ga,
429
- server: Ja,
430
- steps: Xa,
431
- prompt: Za,
432
- foot: Qa,
433
- sections: en,
434
- contract: tn
435
- }, vt = () => null;
436
- function sn() {
437
- return (Be()?.useConnectedClients ?? vt)();
438
- }
439
- function an() {
440
- return (Be()?.useApiKeys ?? vt)();
441
- }
442
- const nn = {
443
- claude: "Claude Code",
444
- cursor: "Cursor",
445
- workbuddy: "WorkBuddy"
446
- }, on = ["use", "develop", "call"], jt = () => Be()?.gateway?.() ?? window.location.origin;
447
- function re({ label: t, code: s }) {
448
- return /* @__PURE__ */ e.jsxs("div", { className: N.code, children: [
449
- /* @__PURE__ */ e.jsxs("div", { className: N.codeHead, children: [
450
- /* @__PURE__ */ e.jsx("span", { children: t }),
451
- /* @__PURE__ */ e.jsx(y.Text, { copyable: { text: s } })
452
- ] }),
453
- /* @__PURE__ */ e.jsx("pre", { children: s })
454
- ] });
455
- }
456
- function _t({ texts: t }) {
457
- const { t: s } = F();
458
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: t.map((o) => /* @__PURE__ */ e.jsx(y.Paragraph, { className: N.prompt, copyable: { text: o }, children: s("workshopLab.agents.quoted", { text: o }) }, o)) });
459
- }
460
- function rn({
461
- open: t,
462
- section: s = "use",
463
- onClose: o
464
- }) {
465
- const { t: a } = F(), [h, m] = l.useState(s), { token: k } = Gt.useToken(), v = {
466
- "--agent-code-bg": k.colorFillTertiary,
467
- "--agent-mono": k.fontFamilyCode,
468
- "--agent-can": k.colorSuccess,
469
- "--agent-cannot": k.colorTextTertiary
470
- };
471
- return /* @__PURE__ */ e.jsx(
472
- rs,
473
- {
474
- open: t,
475
- onClose: o,
476
- width: 640,
477
- title: a(`workshopLab.agents.sections.${h}.title`),
478
- children: /* @__PURE__ */ e.jsxs("div", { className: N.body, style: v, children: [
479
- /* @__PURE__ */ e.jsx(
480
- ze,
481
- {
482
- className: N.sections,
483
- block: !0,
484
- value: h,
485
- onChange: m,
486
- options: on.map((i) => ({
487
- value: i,
488
- label: a(`workshopLab.agents.sections.${i}.tab`)
489
- }))
490
- }
491
- ),
492
- h === "use" ? /* @__PURE__ */ e.jsx(ln, {}) : h === "develop" ? /* @__PURE__ */ e.jsx(pn, {}) : /* @__PURE__ */ e.jsx(un, {})
493
- ] })
494
- }
495
- );
496
- }
497
- function ln() {
498
- const { t } = F(), s = Ia(jt()), [o, a] = l.useState(Pa), [h, m] = l.useState(Ma), [k, v] = l.useState(""), i = sn(), $ = an(), g = Sa(o), c = g.includes(h) ? h : "claude", L = o === "apiKey", b = L ? k.trim() || t("workshopLab.agents.apiKey.placeholder") : void 0, R = L && k.trim() !== "" && !k.trim().startsWith(Aa), j = Ta(s.workshop), A = (x) => x === "generic" ? t("workshopLab.agents.generic") : nn[x], _ = c === "claude" ? Ea(s, b) : $a(s, b);
499
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
500
- /* @__PURE__ */ e.jsx(y.Paragraph, { children: t("workshopLab.agents.intro") }),
501
- /* @__PURE__ */ e.jsxs("ul", { className: N.scope, children: [
502
- /* @__PURE__ */ e.jsxs("li", { children: [
503
- /* @__PURE__ */ e.jsx(Jt, { className: N.can }),
504
- /* @__PURE__ */ e.jsx("span", { children: t("workshopLab.agents.can") })
505
- ] }),
506
- /* @__PURE__ */ e.jsxs("li", { children: [
507
- /* @__PURE__ */ e.jsx(Ns, { className: N.cannot }),
508
- /* @__PURE__ */ e.jsx("span", { children: t("workshopLab.agents.cannot") })
509
- ] })
510
- ] }),
511
- /* @__PURE__ */ e.jsxs("div", { className: N.auth, children: [
512
- /* @__PURE__ */ e.jsx(
513
- ze,
514
- {
515
- value: o,
516
- onChange: (x) => {
517
- a(x), za(x);
518
- },
519
- options: [
520
- { value: "oauth", label: t("workshopLab.agents.auth.oauth") },
521
- { value: "apiKey", label: t("workshopLab.agents.auth.apiKey") }
522
- ]
523
- }
524
- ),
525
- /* @__PURE__ */ e.jsx(y.Text, { type: "secondary", children: t(`workshopLab.agents.auth.${o}Hint`) })
526
- ] }),
527
- L && /* @__PURE__ */ e.jsxs("div", { className: N.key, children: [
528
- /* @__PURE__ */ e.jsx(
529
- Me.Password,
530
- {
531
- value: k,
532
- onChange: (x) => v(x.target.value),
533
- placeholder: t("workshopLab.agents.apiKey.input"),
534
- "aria-label": t("workshopLab.agents.auth.apiKey"),
535
- status: R ? "error" : void 0,
536
- autoComplete: "off"
537
- }
538
- ),
539
- $ && /* @__PURE__ */ e.jsx(y.Link, { onClick: $, children: t("workshopLab.agents.apiKey.issue") })
540
- ] }),
541
- R && /* @__PURE__ */ e.jsx(y.Text, { type: "danger", className: N.keyError, children: t("workshopLab.agents.apiKey.invalid") }),
542
- /* @__PURE__ */ e.jsx(
543
- ls,
544
- {
545
- activeKey: c,
546
- onChange: (x) => {
547
- const T = g.find((u) => u === x) ?? "claude";
548
- m(T), Ba(T);
549
- },
550
- items: g.map((x) => ({ key: x, label: A(x) }))
551
- }
552
- ),
553
- /* @__PURE__ */ e.jsx(
554
- re,
555
- {
556
- label: t(c === "claude" ? "workshopLab.agents.terminal" : "workshopLab.agents.config"),
557
- code: _
558
- }
559
- ),
560
- c === "generic" && /* @__PURE__ */ e.jsxs("div", { className: N.addresses, children: [
561
- /* @__PURE__ */ e.jsx(y.Text, { type: "secondary", children: t("workshopLab.agents.addresses") }),
562
- [
563
- ["workshop", ie, s.workshop],
564
- ["network", ce, s.network]
565
- ].map(([x, T, u]) => /* @__PURE__ */ e.jsxs("div", { className: N.server, children: [
566
- /* @__PURE__ */ e.jsxs("div", { children: [
567
- /* @__PURE__ */ e.jsx(y.Text, { strong: !0, children: T }),
568
- /* @__PURE__ */ e.jsx(y.Text, { type: "secondary", children: t(`workshopLab.agents.serverRole.${x}`) })
569
- ] }),
570
- /* @__PURE__ */ e.jsx(y.Text, { code: !0, copyable: { text: u }, children: u })
571
- ] }, x)),
572
- b !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: N.server, children: [
573
- /* @__PURE__ */ e.jsx(y.Text, { type: "secondary", children: t("workshopLab.agents.header") }),
574
- /* @__PURE__ */ e.jsx(y.Text, { code: !0, copyable: { text: Re(b) }, children: Re(b) })
575
- ] })
576
- ] }),
577
- /* @__PURE__ */ e.jsx(y.Text, { strong: !0, children: c === "generic" ? t("workshopLab.agents.stepsHeadingGeneric") : t("workshopLab.agents.stepsHeading", { client: A(c) }) }),
578
- /* @__PURE__ */ e.jsxs("ol", { className: N.steps, children: [
579
- L && /* @__PURE__ */ e.jsx("li", { children: t("workshopLab.agents.apiKey.issueStep") }),
580
- /* @__PURE__ */ e.jsx("li", { children: t(`workshopLab.agents.steps.${c}.copy`) }),
581
- /* @__PURE__ */ e.jsx("li", { children: L ? t("workshopLab.agents.apiKey.noSignIn") : t(`workshopLab.agents.steps.${c}.signIn`, {
582
- workshop: ie,
583
- network: ce
584
- }) }),
585
- /* @__PURE__ */ e.jsxs("li", { children: [
586
- t("workshopLab.agents.try"),
587
- /* @__PURE__ */ e.jsx(
588
- _t,
589
- {
590
- texts: ["tasks", "analyze"].map(
591
- (x) => t(`workshopLab.agents.prompts.${x}`)
592
- )
593
- }
594
- )
595
- ] })
596
- ] }),
597
- j && /* @__PURE__ */ e.jsx(
598
- Pe,
599
- {
600
- type: "warning",
601
- showIcon: !0,
602
- message: t(
603
- `workshopLab.agents.concern.${j === "http" && L ? "httpKey" : j}`
604
- )
605
- }
606
- ),
607
- i && !L && /* @__PURE__ */ e.jsx("div", { className: N.foot, children: /* @__PURE__ */ e.jsx(y.Link, { onClick: i, children: t("workshopLab.agents.connectedClients") }) })
608
- ] });
609
- }
610
- const cn = "npm install -g @openbkn/workshop @openbkn/bkn-sdk", dn = ["workshop list", "workshop pull <app>", "workshop dev"];
611
- function pn() {
612
- const { t } = F(), s = (o, a) => t(`workshopLab.agents.develop.${o}`, a);
613
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
614
- /* @__PURE__ */ e.jsx(y.Paragraph, { children: s("intro") }),
615
- /* @__PURE__ */ e.jsxs("ol", { className: N.steps, children: [
616
- /* @__PURE__ */ e.jsxs("li", { children: [
617
- s("install"),
618
- /* @__PURE__ */ e.jsx(
619
- re,
620
- {
621
- label: t("workshopLab.agents.terminal"),
622
- code: `${cn}
623
- workshop skill add`
624
- }
625
- ),
626
- /* @__PURE__ */ e.jsx(y.Text, { type: "secondary", children: s("skill") })
627
- ] }),
628
- /* @__PURE__ */ e.jsxs("li", { children: [
629
- s("signIn"),
630
- /* @__PURE__ */ e.jsx(
631
- re,
632
- {
633
- label: t("workshopLab.agents.terminal"),
634
- code: `openbkn auth login ${jt()}`
635
- }
636
- )
637
- ] }),
638
- /* @__PURE__ */ e.jsxs("li", { children: [
639
- s("ask"),
640
- /* @__PURE__ */ e.jsx(_t, { texts: [s("prompts.create"), s("prompts.change")] })
641
- ] }),
642
- /* @__PURE__ */ e.jsxs("li", { children: [
643
- s("commands"),
644
- /* @__PURE__ */ e.jsx(
645
- re,
646
- {
647
- label: t("workshopLab.agents.terminal"),
648
- code: dn.map((o) => o.replace("<app>", s("appPlaceholder"))).join(
649
- `
650
- `
651
- )
652
- }
653
- ),
654
- /* @__PURE__ */ e.jsx(y.Text, { type: "secondary", children: s("publish") })
655
- ] })
656
- ] })
657
- ] });
658
- }
659
- function un() {
660
- const { t } = F(), s = (a) => t(`workshopLab.agents.call.${a}`), o = (a) => t(`workshopLab.config.mcpTool.${a}`);
661
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
662
- /* @__PURE__ */ e.jsx(y.Paragraph, { children: s("intro") }),
663
- /* @__PURE__ */ e.jsxs("ol", { className: N.steps, children: [
664
- /* @__PURE__ */ e.jsx("li", { children: s("register") }),
665
- /* @__PURE__ */ e.jsx("li", { children: s("pick") }),
666
- /* @__PURE__ */ e.jsxs("li", { children: [
667
- s("contract"),
668
- /* @__PURE__ */ e.jsxs("div", { className: N.contract, children: [
669
- /* @__PURE__ */ e.jsx(y.Text, { children: o("contractIntro") }),
670
- /* @__PURE__ */ e.jsx("ul", { children: is.map((a) => /* @__PURE__ */ e.jsxs("li", { children: [
671
- /* @__PURE__ */ e.jsx(y.Text, { code: !0, children: a }),
672
- " ",
673
- t(`workshopLab.config.mcpTool.params.${a}`)
674
- ] }, a)) }),
675
- /* @__PURE__ */ e.jsx(y.Text, { children: o("contractOutput") })
676
- ] })
677
- ] })
678
- ] }),
679
- /* @__PURE__ */ e.jsx(Pe, { type: "warning", showIcon: !0, message: s("passToken") })
680
- ] });
681
- }
682
- function hn(t, s, o, a = "all") {
683
- const h = s.trim().toLowerCase();
684
- return t.filter(
685
- (m) => (o === "all" || We(m).some((k) => k.id === o)) && (a === "all" || (m.tags ?? []).includes(a)) && (!h || `${m.name}
686
- ${m.description ?? ""}`.toLowerCase().includes(h))
687
- );
688
- }
689
- function Nt(t, s) {
690
- return s === "all" || t.workspaceId === s;
691
- }
692
- function le(t, s) {
693
- return t.creator !== "" && t.creator !== s;
694
- }
695
- const bt = (t, s, o) => t === "all" || t === "shared" === le(s, o);
696
- function mn(t, s, o, a, h) {
697
- const m = o.keyword.trim().toLowerCase(), k = o.kind === "analysis" ? [] : hn(t, o.keyword, o.network, o.tag).filter(
698
- (c) => bt(o.owner, c, o.me) && Nt(c, o.workspace ?? "all")
699
- ).map((c) => ({ kind: "app", id: c.id, app: c })), v = o.kind === "app" || o.tag !== "all" ? [] : s.filter(
700
- (c) => (o.network === "all" || c.knId === o.network) && bt(o.owner, c, o.me) && (!m || c.name.toLowerCase().includes(m))
701
- ).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;
702
- return [...k, ...v].sort(
703
- (c, L) => g * (a === "name" ? i(c).localeCompare(i(L)) : $(c) - $(L))
704
- );
705
- }
706
- function gn(t) {
707
- return t.draft ? { name: `${t.id}.app.yaml`, text: Os(t.draft, { lineWidth: 0 }) } : null;
708
- }
709
- function bn(t, s) {
710
- return s.find((o) => o.id === t.id) ?? s.find((o) => o.name === t.name);
711
- }
712
- async function xn(t, s, o) {
713
- let a;
714
- try {
715
- a = Ls(t);
716
- } catch (i) {
717
- return { ok: !1, errors: [`不是有效的 YAML 或 JSON:${i.message}`] };
718
- }
719
- const h = a?.dependencies?.knowledgeNetwork;
720
- if (!h?.id && !h?.name) return { ok: !1, errors: ["App Spec 没有写依赖的知识网络"] };
721
- const m = bn({ id: h.id ?? "", name: h.name ?? "" }, s);
722
- if (!m)
723
- return {
724
- ok: !1,
725
- errors: [`这里没有应用依赖的知识网络「${h.name ?? h.id}」,请先导入或创建它`]
726
- };
727
- const k = cs({
728
- ...a,
729
- dependencies: { ...a.dependencies, knowledgeNetwork: { ...m } }
730
- }), v = ds(k, await o(m), { allowEmpty: !0 });
731
- return v.ok ? { ok: !0, spec: v.app, network: m } : { ok: !1, errors: v.errors };
732
- }
733
- const fn = "_page_1y5di_10", kn = "_titleBar_1y5di_20", wn = "_title_1y5di_20", yn = "_switcher_1y5di_35", vn = "_switcherLabel_1y5di_42", jn = "_switcherName_1y5di_46", _n = "_toolbar_1y5di_53", Nn = "_hint_1y5di_62", Ln = "_toolbarSpacer_1y5di_68", On = "_toolbarRight_1y5di_72", Cn = "_searchInput_1y5di_79", Sn = "_searchIcon_1y5di_88", An = "_filterLabel_1y5di_92", In = "_filterSelect_1y5di_98", En = "_iconButton_1y5di_106", $n = "_toolbarButton_1y5di_125", Rn = "_grid_1y5di_130", Tn = "_empty_1y5di_138", Mn = "_card_1y5di_145", Bn = "_header_1y5di_177", Pn = "_titleRow_1y5di_185", zn = "_iconBox_1y5di_192", Wn = "_titleContent_1y5di_206", Fn = "_name_1y5di_213", Hn = "_meta_1y5di_223", Kn = "_description_1y5di_230", Dn = "_state_1y5di_245", Un = "_createItem_1y5di_254", qn = "_createIcon_1y5di_262", Vn = "_createHint_1y5di_277", Yn = "_moreButton_1y5di_282", Gn = "_footer_1y5di_302", Jn = "_metaItem_1y5di_315", Xn = "_footerLeft_1y5di_323", Zn = "_footerRight_1y5di_327", Qn = "_metaText_1y5di_331", r = {
734
- page: fn,
735
- titleBar: kn,
736
- title: wn,
737
- switcher: yn,
738
- switcherLabel: vn,
739
- switcherName: jn,
740
- toolbar: _n,
741
- hint: Nn,
742
- toolbarSpacer: Ln,
743
- toolbarRight: On,
744
- searchInput: Cn,
745
- searchIcon: Sn,
746
- filterLabel: An,
747
- filterSelect: In,
748
- iconButton: En,
749
- toolbarButton: $n,
750
- grid: Rn,
751
- empty: Tn,
752
- card: Mn,
753
- header: Bn,
754
- titleRow: Pn,
755
- iconBox: zn,
756
- titleContent: Wn,
757
- name: Fn,
758
- meta: Hn,
759
- description: Kn,
760
- state: Dn,
761
- createItem: Un,
762
- createIcon: qn,
763
- createHint: Vn,
764
- moreButton: Yn,
765
- footer: Gn,
766
- metaItem: Jn,
767
- footerLeft: Xn,
768
- footerRight: Zn,
769
- metaText: Qn
770
- }, eo = [], to = [
771
- { key: "use", icon: /* @__PURE__ */ e.jsx(xs, {}) },
772
- { key: "develop", icon: /* @__PURE__ */ e.jsx(zs, {}) },
773
- { key: "call", icon: /* @__PURE__ */ e.jsx(fs, {}) }
774
- ];
775
- async function so(t) {
776
- const s = await ws(t.id), o = s && gn(s);
777
- if (!o) return !1;
778
- const a = URL.createObjectURL(new Blob([o.text], { type: "application/yaml" })), h = document.createElement("a");
779
- return h.href = a, h.download = o.name, h.click(), URL.revokeObjectURL(a), !0;
780
- }
781
- const Lt = "workshop-lab.network";
782
- function ao() {
783
- try {
784
- return window.localStorage.getItem(Lt);
785
- } catch {
786
- return null;
787
- }
788
- }
789
- function no(t) {
790
- try {
791
- window.localStorage.setItem(Lt, t);
792
- } catch {
793
- }
794
- }
795
- const Ot = "workshop-lab.workspace";
796
- function oo() {
797
- try {
798
- return window.localStorage.getItem(Ot) ?? "all";
799
- } catch {
800
- return "all";
801
- }
802
- }
803
- function ro(t) {
804
- try {
805
- window.localStorage.setItem(Ot, t);
806
- } catch {
807
- }
808
- }
809
- function ho({
810
- analyses: t,
811
- samples: s,
812
- titled: o = !0
813
- }) {
814
- const { t: a } = F(), h = xt(), [m, k] = l.useState([]), [v, i] = l.useState("loading"), [$, g] = l.useState(!1), [c, L] = l.useState(!1), [b, R] = l.useState(null), { message: j, modal: A } = Te(), _ = _s() ?? "", { ShareDrawer: x } = Xt(), T = l.useRef(/* @__PURE__ */ new Set()), u = l.useCallback(async () => {
815
- try {
816
- const n = await ps();
817
- k(n.filter((d) => !T.current.has(d.id))), i("ready");
818
- } catch {
819
- i((n) => n === "ready" ? n : "error");
820
- }
821
- }, []);
822
- l.useEffect(() => {
823
- u();
824
- }, [u]);
825
- const [p, C] = l.useState(null), I = l.useCallback(async () => {
826
- try {
827
- C(await us());
828
- } catch {
829
- }
830
- }, []);
831
- l.useEffect(() => {
832
- I();
833
- }, [I]);
834
- const [Fe, Ct] = l.useState(oo), M = p?.some((n) => n.id === Fe) ? Fe : "all", St = (n) => {
835
- Ct(n), ro(n);
836
- }, q = p?.find((n) => n.id === M), U = (n) => n.isDefault ? a("workshopLab.workspace.default") : n.name, [He, Y] = l.useState(null), At = async (n, d) => {
837
- try {
838
- await ys(n.id, d.id), rt(n.id), k(
839
- (f) => f.map((S) => S.id === n.id ? { ...S, workspaceId: d.id } : S)
840
- ), j.success(a("workshopLab.workspace.moved", { name: U(d) }));
841
- } catch (f) {
842
- j.error(Ee(f, a)), await u();
843
- }
844
- }, Ke = M === "all" ? void 0 : M, De = async (n) => {
845
- try {
846
- await n();
847
- } catch (d) {
848
- j.error(J(d, a));
849
- }
850
- await u();
851
- }, It = async (n) => {
852
- await js(n), T.current.add(n), k((d) => d.filter((f) => f.id !== n));
853
- }, [de, Ue] = l.useState(null), V = t !== void 0, B = t?.items ?? eo, [pe, Et] = l.useState("all"), [ue, he] = l.useState(null), P = hs(), z = P.status === "ready" ? P.networks : [], qe = z.find((n) => n.id === ao())?.id ?? z[0]?.id, [$t, Ve] = l.useState(!1), Rt = async (n) => {
854
- Ve(!0);
855
- try {
856
- const d = await xn(
857
- await n.text(),
858
- z,
859
- (S) => ks(S.id, S.name)
860
- );
861
- if (!d.ok) {
862
- A.error({
863
- title: a("workshopLab.list.importFailed"),
864
- content: /* @__PURE__ */ e.jsx("ul", { children: d.errors.slice(0, 8).map((S) => /* @__PURE__ */ e.jsx("li", { children: S }, S)) })
865
- });
866
- return;
867
- }
868
- const f = await ot(
869
- d.spec.app.name,
870
- d.network,
871
- d.spec,
872
- { description: d.spec.app.description },
873
- Ke
874
- );
875
- await u(), j.success(a("workshopLab.list.imported", { name: f.name }));
876
- } catch (d) {
877
- j.error(J(d, a));
878
- } finally {
879
- Ve(!1);
880
- }
881
- }, me = ms(P, qe), { reload: ge } = P, Tt = () => {
882
- ge(), g(!0);
883
- }, Mt = () => {
884
- ge(), L(!0);
885
- }, Bt = (n) => {
886
- ge(), he(n);
887
- }, [Ye, Pt] = l.useState("all"), Ge = l.useMemo(() => [...new Set(m.flatMap((n) => n.tags ?? []))].sort(), [m]), [be, zt] = l.useState(""), [Je, Wt] = l.useState("all"), [G, Ft] = l.useState({
888
- by: "updatedAt",
889
- direction: "desc"
890
- }), xe = l.useMemo(() => {
891
- const n = new Map(
892
- m.flatMap(
893
- (f) => ft(We(f), z).map((S) => [S.id, S.name])
894
- )
895
- ), d = new Map(z.map((f) => [f.id, f.name]));
896
- for (const f of B)
897
- n.has(f.knId) || n.set(f.knId, d.get(f.knId) ?? f.knId);
898
- return [...n].map(([f, S]) => ({ id: f, name: S }));
899
- }, [B, m, z]), Ht = (n) => xe.find((d) => d.id === n)?.name ?? n, fe = Ge.includes(Ye) ? Ye : "all", ke = xe.some((n) => n.id === Je) ? Je : "all", Kt = v === "ready" && m.length === 0 && B.length === 0, [Xe, Ze] = l.useState(null), Dt = P.status === "ready" && z.length === 0, Ut = v !== "loading" && P.status !== "loading" && t?.status !== "loading";
900
- (s || V) && Xe === null && Ut && Ze(
901
- s && (Kt || Dt) ? "samples" : V && m.length === 0 && B.length > 0 ? "analyses" : "apps"
902
- );
903
- const W = Xe ?? (s ? null : "apps"), O = W === "analyses", Qe = l.useMemo(
904
- () => mn(
905
- m,
906
- B,
907
- {
908
- keyword: be,
909
- network: ke,
910
- // Tags belong to apps; the analyses tab hides the tag filter, so it must not narrow it.
911
- tag: O ? "all" : fe,
912
- kind: O ? "analysis" : "app",
913
- owner: pe,
914
- me: _,
915
- // Analyses go in no workspace.
916
- workspace: O ? "all" : M
917
- },
918
- G.by,
919
- G.direction
920
- ),
921
- [
922
- B,
923
- m,
924
- be,
925
- _,
926
- ke,
927
- O,
928
- pe,
929
- fe,
930
- G,
931
- M
932
- ]
933
- ), qt = !O && M !== "all" && !m.some((n) => Nt(n, M)), Vt = (n) => {
934
- if (M !== "all" || !p || p.length < 2) return;
935
- const d = p.find((f) => f.id === n.workspaceId);
936
- return d && U(d);
937
- }, we = (n) => O ? /* @__PURE__ */ e.jsx(
938
- E,
939
- {
940
- type: "primary",
941
- className: n,
942
- icon: /* @__PURE__ */ e.jsx(ne, {}),
943
- onClick: Mt,
944
- children: a("workshopLab.analysis.createAnalysis")
945
- }
946
- ) : /* @__PURE__ */ e.jsx(E, { type: "primary", className: n, icon: /* @__PURE__ */ e.jsx(ne, {}), onClick: Tt, children: a("workshopLab.list.create") }), Yt = {
947
- items: to.map(({ key: n, icon: d }) => ({
948
- key: n,
949
- label: /* @__PURE__ */ e.jsxs("div", { className: r.createItem, children: [
950
- /* @__PURE__ */ e.jsx("span", { className: r.createIcon, children: d }),
951
- /* @__PURE__ */ e.jsxs("div", { children: [
952
- /* @__PURE__ */ e.jsx("div", { children: a(`workshopLab.agents.sections.${n}.title`) }),
953
- /* @__PURE__ */ e.jsx("div", { className: r.createHint, children: a(`workshopLab.agents.sections.${n}.hint`) })
954
- ] })
955
- ] })
956
- })),
957
- onClick: ({ key: n }) => R(n)
958
- }, ye = [
959
- {
960
- value: "apps",
961
- label: a(V ? "workshopLab.analysis.tabApps" : "workshopLab.list.tabApps")
962
- },
963
- ...V ? [{ value: "analyses", label: a("workshopLab.analysis.kind") }] : [],
964
- ...s ? [{ value: "samples", label: a("workshopLab.list.tabSamples") }] : []
965
- ], et = W === "apps" && p ? /* @__PURE__ */ e.jsx(
966
- oe,
967
- {
968
- trigger: ["click"],
969
- menu: {
970
- selectable: !0,
971
- selectedKeys: [M],
972
- items: [
973
- { key: "all", label: a("workshopLab.workspace.all") },
974
- ...p.map((n) => ({ key: n.id, label: U(n) })),
975
- { type: "divider" },
976
- { key: "create", icon: /* @__PURE__ */ e.jsx(ne, {}), label: a("workshopLab.workspace.create") },
977
- { key: "manage", label: a("workshopLab.workspace.manage") }
978
- ],
979
- onClick: ({ key: n }) => {
980
- n === "create" ? Y(H) : n === "manage" ? Y(M === "all" ? p[0]?.id ?? H : M) : St(n);
981
- }
982
- },
983
- children: /* @__PURE__ */ e.jsxs(E, { className: r.switcher, icon: /* @__PURE__ */ e.jsx(kt, {}), children: [
984
- /* @__PURE__ */ e.jsx("span", { className: r.switcherLabel, children: a("workshopLab.workspace.label") }),
985
- /* @__PURE__ */ e.jsx("span", { className: r.switcherName, children: q ? U(q) : a("workshopLab.workspace.all") }),
986
- /* @__PURE__ */ e.jsx(st, {})
987
- ] })
988
- }
989
- ) : null, tt = o || ye.length > 1 && W || et ? /* @__PURE__ */ e.jsxs("div", { className: r.titleBar, children: [
990
- o ? /* @__PURE__ */ e.jsx("h2", { className: r.title, children: a("workshopLab.list.title") }) : null,
991
- et,
992
- ye.length > 1 && W ? /* @__PURE__ */ e.jsx(ze, { value: W, onChange: Ze, options: ye }) : null
993
- ] }) : null;
994
- return W === null || W === "samples" ? /* @__PURE__ */ e.jsxs("div", { className: r.page, children: [
995
- tt,
996
- W === "samples" ? s : /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(nt, {}) })
997
- ] }) : /* @__PURE__ */ e.jsxs("div", { className: r.page, children: [
998
- tt,
999
- /* @__PURE__ */ e.jsxs("div", { className: r.toolbar, children: [
1000
- we(r.toolbarButton),
1001
- O ? null : /* @__PURE__ */ e.jsx(
1002
- Cs,
1003
- {
1004
- accept: ".yaml,.yml,.json",
1005
- showUploadList: !1,
1006
- disabled: P.status !== "ready",
1007
- beforeUpload: (n) => (Rt(n), !1),
1008
- children: /* @__PURE__ */ e.jsx(
1009
- E,
1010
- {
1011
- className: r.toolbarButton,
1012
- icon: /* @__PURE__ */ e.jsx(na, {}),
1013
- loading: $t,
1014
- disabled: P.status !== "ready",
1015
- children: a("workshopLab.list.import")
1016
- }
1017
- )
1018
- }
1019
- ),
1020
- /* @__PURE__ */ e.jsx(oe, { trigger: ["click"], menu: Yt, children: /* @__PURE__ */ e.jsxs(E, { className: r.toolbarButton, icon: /* @__PURE__ */ e.jsx(gs, {}), children: [
1021
- a("workshopLab.agents.open"),
1022
- " ",
1023
- /* @__PURE__ */ e.jsx(st, {})
1024
- ] }) }),
1025
- /* @__PURE__ */ e.jsx("span", { className: r.toolbarSpacer }),
1026
- /* @__PURE__ */ e.jsxs("div", { className: r.toolbarRight, children: [
1027
- /* @__PURE__ */ e.jsx(
1028
- Me,
1029
- {
1030
- allowClear: !0,
1031
- className: r.searchInput,
1032
- placeholder: a("workshopLab.list.searchPlaceholder"),
1033
- prefix: /* @__PURE__ */ e.jsx(bs, { className: r.searchIcon }),
1034
- value: be,
1035
- onChange: (n) => zt(n.target.value)
1036
- }
1037
- ),
1038
- V ? /* @__PURE__ */ e.jsx(
1039
- ve,
1040
- {
1041
- className: r.filterSelect,
1042
- value: pe,
1043
- onChange: Et,
1044
- "aria-label": a("workshopLab.analysis.ownerFilter"),
1045
- options: [
1046
- { value: "all", label: a("workshopLab.analysis.ownerAll") },
1047
- { value: "mine", label: a("workshopLab.analysis.ownerMine") },
1048
- { value: "shared", label: a("workshopLab.analysis.ownerShared") }
1049
- ]
1050
- }
1051
- ) : null,
1052
- O ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1053
- /* @__PURE__ */ e.jsx("span", { className: r.filterLabel, children: a("workshopLab.list.tagsLabel") }),
1054
- /* @__PURE__ */ e.jsx(
1055
- ve,
1056
- {
1057
- className: r.filterSelect,
1058
- value: fe,
1059
- onChange: Pt,
1060
- options: [
1061
- { value: "all", label: a("workshopLab.list.allNetworks") },
1062
- ...Ge.map((n) => ({ value: n, label: n }))
1063
- ]
1064
- }
1065
- )
1066
- ] }),
1067
- /* @__PURE__ */ e.jsx("span", { className: r.filterLabel, children: a("workshopLab.list.networkFilter") }),
1068
- /* @__PURE__ */ e.jsx(
1069
- ve,
1070
- {
1071
- className: r.filterSelect,
1072
- value: ke,
1073
- onChange: Wt,
1074
- options: [
1075
- { value: "all", label: a("workshopLab.list.allNetworks") },
1076
- ...xe.map((n) => ({ value: n.id, label: n.name }))
1077
- ]
1078
- }
1079
- ),
1080
- /* @__PURE__ */ e.jsx(
1081
- oe,
1082
- {
1083
- trigger: ["click"],
1084
- menu: {
1085
- selectable: !0,
1086
- selectedKeys: [G.by],
1087
- items: [
1088
- { key: "updatedAt", label: a("workshopLab.list.sortByUpdated") },
1089
- { key: "name", label: a("workshopLab.list.sortByName") }
1090
- ],
1091
- onClick: ({ key: n }) => {
1092
- const d = n;
1093
- Ft((f) => ({
1094
- by: d,
1095
- direction: d === f.by && f.direction === "desc" ? "asc" : "desc"
1096
- }));
1097
- }
1098
- },
1099
- children: /* @__PURE__ */ e.jsx(
1100
- "button",
1101
- {
1102
- type: "button",
1103
- className: r.iconButton,
1104
- "aria-label": a("workshopLab.list.sort"),
1105
- children: /* @__PURE__ */ e.jsx(ca, {})
1106
- }
1107
- )
1108
- }
1109
- )
1110
- ] })
1111
- ] }),
1112
- /* @__PURE__ */ e.jsx("p", { className: r.hint, children: a(O ? "workshopLab.analysis.hint" : "workshopLab.list.hint") }),
1113
- !O && q?.defaultAgent ? /* @__PURE__ */ e.jsxs("p", { className: r.hint, children: [
1114
- a("workshopLab.workspace.agentHint", { name: q.defaultAgent.mcpName }),
1115
- " ",
1116
- /* @__PURE__ */ e.jsx(E, { type: "link", size: "small", onClick: () => Y(q.id), children: a("workshopLab.workspace.agentEdit") })
1117
- ] }) : null,
1118
- !O && v === "error" ? /* @__PURE__ */ e.jsxs("p", { className: r.hint, children: [
1119
- a("workshopLab.store.listFailed"),
1120
- " ",
1121
- /* @__PURE__ */ e.jsx(E, { type: "link", size: "small", onClick: () => {
1122
- u();
1123
- }, children: a("workshopLab.store.retry") })
1124
- ] }) : null,
1125
- O && t?.status === "error" ? /* @__PURE__ */ e.jsxs("p", { className: r.hint, children: [
1126
- a("workshopLab.analysis.loadFailed"),
1127
- " ",
1128
- /* @__PURE__ */ e.jsx(E, { type: "link", size: "small", onClick: () => {
1129
- t.reload();
1130
- }, children: a("workshopLab.analysis.retry") })
1131
- ] }) : null,
1132
- (O ? t?.status === "loading" : v === "loading") ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(nt, {}) }) : (O ? B.length === 0 : m.length === 0 && v === "ready") ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(
1133
- je,
1134
- {
1135
- description: a(O ? "workshopLab.analysis.empty" : "workshopLab.list.empty"),
1136
- children: we()
1137
- }
1138
- ) }) : qt ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(je, { description: a("workshopLab.workspace.empty"), children: we() }) }) : Qe.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: r.empty, children: /* @__PURE__ */ e.jsx(
1139
- je,
1140
- {
1141
- description: a(O ? "workshopLab.analysis.noMatch" : "workshopLab.list.noMatch")
1142
- }
1143
- ) }) : /* @__PURE__ */ e.jsx("div", { className: r.grid, children: Qe.map(
1144
- (n) => n.kind === "app" ? /* @__PURE__ */ e.jsx(
1145
- lo,
1146
- {
1147
- app: n.app,
1148
- networks: z,
1149
- sharedWithMe: le(n.app, _),
1150
- workspaceName: Vt(n.app),
1151
- workspaces: p ?? [],
1152
- nameOfWorkspace: U,
1153
- onMove: (d) => {
1154
- At(n.app, d);
1155
- },
1156
- onOpen: () => (
1157
- // Building it needs modify; one shared to use opens as its users see it.
1158
- h.go({
1159
- page: n.app.operations.includes("modify") ? "builder" : "run",
1160
- appId: n.app.id
1161
- })
1162
- ),
1163
- canShare: x !== void 0,
1164
- onEdit: () => Bt(n.app),
1165
- onShare: () => Ue(n.app),
1166
- onExport: () => {
1167
- so(n.app).then((d) => {
1168
- d || j.info(a("workshopLab.list.exportBlank"));
1169
- }).catch((d) => {
1170
- j.error(J(d, a));
1171
- });
1172
- },
1173
- onDelete: () => De(() => It(n.app.id))
1174
- },
1175
- n.id
1176
- ) : /* @__PURE__ */ e.jsx(l.Fragment, { children: t?.card(n.id, {
1177
- networkName: Ht(n.analysis.knId),
1178
- sharedWithMe: le(n.analysis, _)
1179
- }) }, n.id)
1180
- ) }),
1181
- $ && /* @__PURE__ */ e.jsx(
1182
- lt,
1183
- {
1184
- networks: me,
1185
- onCancel: () => g(!1),
1186
- onSubmit: (n, d) => {
1187
- d && (no(d.id), ot(n.name, d, null, n, Ke).then((f) => {
1188
- g(!1), h.go({ page: "builder", appId: f.id });
1189
- }).catch((f) => {
1190
- j.error(J(f, a));
1191
- }));
1192
- }
1193
- }
1194
- ),
1195
- c && t?.createDialog({
1196
- networks: me,
1197
- initial: qe,
1198
- count: B.filter((n) => !le(n, _)).length,
1199
- onCancel: () => L(!1)
1200
- }),
1201
- t?.dialogs,
1202
- b && /* @__PURE__ */ e.jsx(rn, { open: !0, section: b, onClose: () => R(null) }),
1203
- ue && /* @__PURE__ */ e.jsx(
1204
- lt,
1205
- {
1206
- app: ue,
1207
- networks: me,
1208
- onCancel: () => he(null),
1209
- onSubmit: (n) => {
1210
- const d = ue.id;
1211
- he(null), De(() => vs(d, n));
1212
- }
1213
- }
1214
- ),
1215
- He !== null && p ? /* @__PURE__ */ e.jsx(
1216
- Oa,
1217
- {
1218
- workspaces: p,
1219
- initial: He,
1220
- nameOf: U,
1221
- onChanged: async () => {
1222
- rt(), await I(), await u();
1223
- },
1224
- onClose: () => Y(null)
1225
- }
1226
- ) : null,
1227
- de && x ? /* @__PURE__ */ e.jsx(
1228
- x,
1229
- {
1230
- appId: de.id,
1231
- appName: de.name,
1232
- onClose: () => {
1233
- Ue(null), u();
1234
- }
1235
- }
1236
- ) : null
1237
- ] });
1238
- }
1239
- function lo({
1240
- app: t,
1241
- networks: s,
1242
- sharedWithMe: o,
1243
- workspaceName: a,
1244
- workspaces: h,
1245
- nameOfWorkspace: m,
1246
- onMove: k,
1247
- canShare: v,
1248
- onOpen: i,
1249
- onEdit: $,
1250
- onShare: g,
1251
- onExport: c,
1252
- onDelete: L
1253
- }) {
1254
- const { t: b } = F(), { modal: R } = Te(), j = xt().href({ page: "run", appId: t.id }), A = ft(We(t), s).map((u) => u.name).join("、"), _ = (u) => t.operations.includes(u), x = t.version === 0 ? { color: "warning", text: b("workshopLab.list.unpublished") } : { color: "success", text: b("workshopLab.top.published", { version: t.version }) }, T = () => R.confirm({
1255
- title: b("workshopLab.list.deleteConfirm"),
1256
- okText: b("workshopLab.list.delete"),
1257
- okButtonProps: { danger: !0 },
1258
- onOk: L
1259
- });
1260
- return /* @__PURE__ */ e.jsxs(
1261
- "article",
1262
- {
1263
- className: r.card,
1264
- style: t.color ? { "--app-accent": t.color } : void 0,
1265
- "aria-label": t.name,
1266
- role: "button",
1267
- tabIndex: 0,
1268
- onClick: i,
1269
- onKeyDown: (u) => {
1270
- u.target === u.currentTarget && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), i());
1271
- },
1272
- children: [
1273
- /* @__PURE__ */ e.jsxs("div", { className: r.header, children: [
1274
- /* @__PURE__ */ e.jsxs("div", { className: r.titleRow, children: [
1275
- /* @__PURE__ */ e.jsx("span", { className: r.iconBox, children: /* @__PURE__ */ e.jsx(Ss, { icon: t.icon, size: 18 }) }),
1276
- /* @__PURE__ */ e.jsxs("div", { className: r.titleContent, children: [
1277
- /* @__PURE__ */ e.jsx("div", { className: r.name, children: t.name }),
1278
- /* @__PURE__ */ e.jsxs("div", { className: r.meta, children: [
1279
- /* @__PURE__ */ e.jsx(_e, { className: r.state, color: x.color, children: x.text }),
1280
- o ? /* @__PURE__ */ e.jsx(_e, { className: r.state, children: b("workshopLab.list.shared") }) : null,
1281
- a ? /* @__PURE__ */ e.jsx(_e, { className: r.state, icon: /* @__PURE__ */ e.jsx(kt, {}), children: a }) : null
1282
- ] }),
1283
- /* @__PURE__ */ e.jsx("div", { className: r.description, children: t.description || b("workshopLab.list.noDescription") })
1284
- ] })
1285
- ] }),
1286
- /* @__PURE__ */ e.jsx(
1287
- oe,
1288
- {
1289
- trigger: ["click"],
1290
- menu: {
1291
- items: [
1292
- { key: "open", label: b("workshopLab.list.open") },
1293
- { key: "edit", label: b("workshopLab.list.edit"), disabled: !_("modify") },
1294
- { key: "run", label: b("workshopLab.top.run"), disabled: t.version === 0 },
1295
- { key: "export", label: b("workshopLab.list.export") },
1296
- // Its own and those shared with the user alike: a workspace is the user's own group.
1297
- ...h.length > 0 ? [
1298
- {
1299
- key: "move",
1300
- label: b("workshopLab.workspace.moveTo"),
1301
- children: h.map((u) => ({
1302
- key: `move:${u.id}`,
1303
- label: m(u),
1304
- disabled: u.id === t.workspaceId
1305
- }))
1306
- }
1307
- ] : [],
1308
- ...v ? [
1309
- // Shared in the outside system that manages it, not here.
1310
- {
1311
- key: "share",
1312
- label: t.managedBy ? b("workshopLab.list.shareManaged", { name: t.managedBy }) : b("workshopLab.list.share"),
1313
- disabled: !_("authorize") || !!t.managedBy
1314
- }
1315
- ] : [],
1316
- {
1317
- key: "delete",
1318
- label: b("workshopLab.list.delete"),
1319
- danger: !0,
1320
- disabled: !_("delete")
1321
- }
1322
- ],
1323
- onClick: ({ key: u, domEvent: p }) => {
1324
- if (p.stopPropagation(), u === "open") i();
1325
- else if (u === "edit") $();
1326
- else if (u === "run") window.open(j, "_blank", "noopener");
1327
- else if (u === "export") c();
1328
- else if (u === "share") g();
1329
- else if (u.startsWith("move:")) {
1330
- const C = h.find((I) => `move:${I.id}` === u);
1331
- C && k(C);
1332
- } else u === "delete" && T();
1333
- }
1334
- },
1335
- children: /* @__PURE__ */ e.jsx(
1336
- "button",
1337
- {
1338
- type: "button",
1339
- className: r.moreButton,
1340
- "aria-label": b("workshopLab.list.moreActions"),
1341
- onClick: (u) => u.stopPropagation(),
1342
- children: /* @__PURE__ */ e.jsx(Gs, {})
1343
- }
1344
- )
1345
- }
1346
- )
1347
- ] }),
1348
- /* @__PURE__ */ e.jsxs("div", { className: r.footer, children: [
1349
- /* @__PURE__ */ e.jsx(at, { title: A, children: /* @__PURE__ */ e.jsxs("span", { className: `${r.metaItem} ${r.footerLeft}`, children: [
1350
- /* @__PURE__ */ e.jsx(Ds, {}),
1351
- /* @__PURE__ */ e.jsx("span", { className: r.metaText, children: A })
1352
- ] }) }),
1353
- /* @__PURE__ */ e.jsx(at, { title: b("workshopLab.list.updatedAt"), children: /* @__PURE__ */ e.jsxs("span", { className: `${r.metaItem} ${r.footerRight}`, children: [
1354
- /* @__PURE__ */ e.jsx(Rs, {}),
1355
- /* @__PURE__ */ e.jsx("span", { children: Zt(t.updatedAt).format("YYYY-MM-DD HH:mm") })
1356
- ] }) })
1357
- ] })
1358
- ]
1359
- }
1360
- );
1361
- }
1362
- export {
1363
- ho as AppListPage
1364
- };