@leverege/imaginarium-ui 1.2.2 → 1.3.0

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 (110) hide show
  1. package/lib/ImaginariumApp-D7jCl_VH.js +514 -0
  2. package/lib/ImaginariumApp-D7jCl_VH.js.map +1 -0
  3. package/lib/ImaginariumApp-DeLr4nad.cjs +2 -0
  4. package/lib/ImaginariumApp-DeLr4nad.cjs.map +1 -0
  5. package/lib/MarkdownPageDoc-BZF02iL5.cjs +2 -0
  6. package/lib/MarkdownPageDoc-BZF02iL5.cjs.map +1 -0
  7. package/lib/MarkdownPageDoc-DR1FmNpF.js +157 -0
  8. package/lib/MarkdownPageDoc-DR1FmNpF.js.map +1 -0
  9. package/lib/{PluginSetup-NL8jYfpN.js → PluginSetup-CTRJO5hU.js} +164 -118
  10. package/lib/PluginSetup-CTRJO5hU.js.map +1 -0
  11. package/lib/PluginSetup-CuLezaDw.cjs +45 -0
  12. package/lib/PluginSetup-CuLezaDw.cjs.map +1 -0
  13. package/lib/{PluginSetup-Co-WnS3V.js → PluginSetup-DNKri9P1.js} +2 -2
  14. package/lib/{PluginSetup-Co-WnS3V.js.map → PluginSetup-DNKri9P1.js.map} +1 -1
  15. package/lib/{PluginSetup-BQk4FFh9.js → PluginSetup-DaNNHmql.js} +782 -671
  16. package/lib/PluginSetup-DaNNHmql.js.map +1 -0
  17. package/lib/{PluginSetup-CQPpS_Js.cjs → PluginSetup-De9E1hRC.cjs} +2 -2
  18. package/lib/{PluginSetup-CQPpS_Js.cjs.map → PluginSetup-De9E1hRC.cjs.map} +1 -1
  19. package/lib/PluginSetup-o9elzgOQ.cjs +112 -0
  20. package/lib/PluginSetup-o9elzgOQ.cjs.map +1 -0
  21. package/lib/PluginTypes-BmYA5_B9.cjs +2 -0
  22. package/lib/PluginTypes-BmYA5_B9.cjs.map +1 -0
  23. package/lib/PluginTypes-mZ4TjxPV.js +9 -0
  24. package/lib/PluginTypes-mZ4TjxPV.js.map +1 -0
  25. package/lib/docs/DocsPanel.d.ts +15 -0
  26. package/lib/docs/DocsPanel.d.ts.map +1 -0
  27. package/lib/docs/MarkdownPageDoc.d.ts +8 -0
  28. package/lib/docs/MarkdownPageDoc.d.ts.map +1 -0
  29. package/lib/docs/PageDoc.d.ts +9 -0
  30. package/lib/docs/PageDoc.d.ts.map +1 -0
  31. package/lib/docs/PageDocsContext.d.ts +12 -0
  32. package/lib/docs/PageDocsContext.d.ts.map +1 -0
  33. package/lib/docs/index.d.ts +5 -0
  34. package/lib/docs/index.d.ts.map +1 -0
  35. package/lib/docs/mdComponents.d.ts +21 -0
  36. package/lib/docs/mdComponents.d.ts.map +1 -0
  37. package/lib/imp/release/ImpPageDoc.d.ts +3 -0
  38. package/lib/imp/release/ImpPageDoc.d.ts.map +1 -0
  39. package/lib/imp/release/PluginSetup.d.ts.map +1 -1
  40. package/lib/index.cjs +1 -1
  41. package/lib/index.cjs.map +1 -1
  42. package/lib/index.d.ts +4 -1
  43. package/lib/index.d.ts.map +1 -1
  44. package/lib/index.js +75 -72
  45. package/lib/mdComponents-BiOJ7Epf.cjs +16 -0
  46. package/lib/mdComponents-BiOJ7Epf.cjs.map +1 -0
  47. package/lib/mdComponents-kPa8Rxqz.js +6792 -0
  48. package/lib/mdComponents-kPa8Rxqz.js.map +1 -0
  49. package/lib/plugins/PluginTypes.d.ts +1 -0
  50. package/lib/plugins/PluginTypes.d.ts.map +1 -1
  51. package/lib/plugins/registry.d.ts +3 -1
  52. package/lib/plugins/registry.d.ts.map +1 -1
  53. package/lib/plugins/types.d.ts +5 -0
  54. package/lib/plugins/types.d.ts.map +1 -1
  55. package/lib/plugins.cjs +1 -1
  56. package/lib/plugins.js +2 -2
  57. package/lib/registry-Bq42i86Q.cjs +2 -0
  58. package/lib/registry-Bq42i86Q.cjs.map +1 -0
  59. package/lib/registry-CMZCG8pH.js +44 -0
  60. package/lib/registry-CMZCG8pH.js.map +1 -0
  61. package/lib/release.cjs +1 -1
  62. package/lib/release.js +1 -1
  63. package/lib/secret.cjs +1 -1
  64. package/lib/secret.js +1 -1
  65. package/lib/shell/Shell.d.ts.map +1 -1
  66. package/lib/shell.cjs +1 -1
  67. package/lib/shell.js +1 -1
  68. package/lib/system/PluginSetup.d.ts.map +1 -1
  69. package/lib/system/SystemPageDoc.d.ts +3 -0
  70. package/lib/system/SystemPageDoc.d.ts.map +1 -0
  71. package/lib/system.cjs +1 -1
  72. package/lib/system.js +2 -2
  73. package/package.json +3 -2
  74. package/src/docs/DocsPanel.tsx +80 -0
  75. package/src/docs/MarkdownPageDoc.tsx +35 -0
  76. package/src/docs/PageDoc.ts +12 -0
  77. package/src/docs/PageDocsContext.tsx +37 -0
  78. package/src/docs/index.ts +4 -0
  79. package/src/docs/mdComponents.tsx +75 -0
  80. package/src/imp/release/ImpPageDoc.ts +113 -0
  81. package/src/imp/release/PluginSetup.ts +3 -0
  82. package/src/index.ts +4 -0
  83. package/src/plugins/PluginTypes.ts +1 -0
  84. package/src/plugins/registry.ts +13 -2
  85. package/src/plugins/types.ts +6 -0
  86. package/src/shell/Shell.tsx +48 -14
  87. package/src/system/PluginSetup.ts +4 -0
  88. package/src/system/SystemPageDoc.ts +49 -0
  89. package/lib/ImaginariumApp-Bp1toCAd.js +0 -437
  90. package/lib/ImaginariumApp-Bp1toCAd.js.map +0 -1
  91. package/lib/ImaginariumApp-DpQNMjG_.cjs +0 -2
  92. package/lib/ImaginariumApp-DpQNMjG_.cjs.map +0 -1
  93. package/lib/PluginSetup-3m6kjRze.cjs +0 -2
  94. package/lib/PluginSetup-3m6kjRze.cjs.map +0 -1
  95. package/lib/PluginSetup-BQk4FFh9.js.map +0 -1
  96. package/lib/PluginSetup-DoIf-dYR.cjs +0 -5
  97. package/lib/PluginSetup-DoIf-dYR.cjs.map +0 -1
  98. package/lib/PluginSetup-NL8jYfpN.js.map +0 -1
  99. package/lib/PluginTypes-C4a2lmPj.cjs +0 -2
  100. package/lib/PluginTypes-C4a2lmPj.cjs.map +0 -1
  101. package/lib/PluginTypes-DsLT43Y8.js +0 -8
  102. package/lib/PluginTypes-DsLT43Y8.js.map +0 -1
  103. package/lib/SystemConfigsContext-D0hXRSH-.js +0 -128
  104. package/lib/SystemConfigsContext-D0hXRSH-.js.map +0 -1
  105. package/lib/SystemConfigsContext-yOuS10VO.cjs +0 -2
  106. package/lib/SystemConfigsContext-yOuS10VO.cjs.map +0 -1
  107. package/lib/registry-8kQ494RA.js +0 -36
  108. package/lib/registry-8kQ494RA.js.map +0 -1
  109. package/lib/registry-CHzOVHAg.cjs +0 -2
  110. package/lib/registry-CHzOVHAg.cjs.map +0 -1
@@ -1,25 +1,25 @@
1
- import { Config as x } from "@leverege/plugin";
2
- import { P as q, N as z } from "./PluginTypes-DsLT43Y8.js";
1
+ import { Config as b } from "@leverege/plugin";
2
+ import { P as Q, N as H } from "./PluginTypes-mZ4TjxPV.js";
3
+ import { u as z, M as V, P as Y } from "./MarkdownPageDoc-DR1FmNpF.js";
3
4
  import { jsxs as s, jsx as t } from "react/jsx-runtime";
4
- import { useState as b } from "react";
5
- import { useQueryClient as V, useMutation as D } from "@tanstack/react-query";
6
- import { X as K, Plus as F, Pencil as W, Trash2 as Y, Save as X, Settings as _ } from "lucide-react";
7
- import { c as G, u as Z, a as ee, B as g, C as j, b as te, d as ae, e as se, f as A } from "./Card-D2LdIJwJ.js";
8
- import { D as ne, a as ie, b as re, c as le, d as de, L as l, I as m, e as oe } from "./Label-v0wUXs4O.js";
9
- import { u as ce } from "./SystemConfigsContext-D0hXRSH-.js";
10
- function me({ value: i, onChange: u, placeholder: y, id: r, className: c }) {
11
- const [d, N] = b(""), p = () => {
12
- const a = d.trim();
13
- a && (i.includes(a) || u([...i, a]), N(""));
14
- }, o = (a) => u(i.filter((n) => n !== a)), f = (a) => {
15
- a.key === "Enter" || a.key === "," ? (a.preventDefault(), p()) : a.key === "Backspace" && d === "" && i.length > 0 && o(i[i.length - 1]);
5
+ import { useState as x } from "react";
6
+ import { useQueryClient as X, useMutation as T } from "@tanstack/react-query";
7
+ import { X as U, Plus as j, Pencil as _, Trash2 as G, Save as Z, Settings as ee } from "lucide-react";
8
+ import { c as te, u as ae, a as se, B as g, C as O, b as ie, d as ne, e as re, f as E } from "./Card-D2LdIJwJ.js";
9
+ import { D as oe, a as le, b as de, c as ce, d as me, L as o, I as u, e as ue } from "./Label-v0wUXs4O.js";
10
+ function he({ value: i, onChange: c, placeholder: y, id: r, className: m }) {
11
+ const [l, N] = x(""), h = () => {
12
+ const a = l.trim();
13
+ a && (i.includes(a) || c([...i, a]), N(""));
14
+ }, d = (a) => c(i.filter((n) => n !== a)), f = (a) => {
15
+ a.key === "Enter" || a.key === "," ? (a.preventDefault(), h()) : a.key === "Backspace" && l === "" && i.length > 0 && d(i[i.length - 1]);
16
16
  };
17
17
  return /* @__PURE__ */ s(
18
18
  "div",
19
19
  {
20
- className: G(
20
+ className: te(
21
21
  "flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 text-sm focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
22
- c
22
+ m
23
23
  ),
24
24
  children: [
25
25
  i.map((a) => /* @__PURE__ */ s(
@@ -32,10 +32,10 @@ function me({ value: i, onChange: u, placeholder: y, id: r, className: c }) {
32
32
  "button",
33
33
  {
34
34
  type: "button",
35
- onClick: () => o(a),
35
+ onClick: () => d(a),
36
36
  "aria-label": `Remove tag ${a}`,
37
37
  className: "text-muted-foreground hover:text-foreground",
38
- children: /* @__PURE__ */ t(K, { className: "h-3 w-3" })
38
+ children: /* @__PURE__ */ t(U, { className: "h-3 w-3" })
39
39
  }
40
40
  )
41
41
  ]
@@ -46,10 +46,10 @@ function me({ value: i, onChange: u, placeholder: y, id: r, className: c }) {
46
46
  "input",
47
47
  {
48
48
  id: r,
49
- value: d,
49
+ value: l,
50
50
  onChange: (a) => N(a.target.value),
51
51
  onKeyDown: f,
52
- onBlur: p,
52
+ onBlur: h,
53
53
  placeholder: i.length === 0 ? y ?? "Add a tag…" : "",
54
54
  className: "flex-1 min-w-32 bg-transparent outline-none placeholder:text-muted-foreground"
55
55
  }
@@ -58,7 +58,7 @@ function me({ value: i, onChange: u, placeholder: y, id: r, className: c }) {
58
58
  }
59
59
  );
60
60
  }
61
- const O = {
61
+ const F = {
62
62
  displayName: "",
63
63
  apiKey: "",
64
64
  secret: "",
@@ -70,38 +70,38 @@ const O = {
70
70
  tags: [],
71
71
  metadata: ""
72
72
  };
73
- function ue({
73
+ function pe({
74
74
  title: i = "Imagine Systems",
75
- subtitle: u = "Manage Imagine API configurations for different systems",
75
+ subtitle: c = "Manage Imagine API configurations for different systems",
76
76
  dialogDescription: y = "Configure your Imagine API credentials."
77
77
  } = {}) {
78
- const { toast: r } = Z(), { fetchJson: c } = ee(), d = V(), [N, p] = b(!1), [o, f] = b(null), [a, n] = b(O), { filtered: T, isLoading: L, apiPath: I, queryKey: S } = ce(), C = D({
79
- mutationFn: (e) => c(I, { method: "POST", body: JSON.stringify(e) }),
78
+ const { toast: r } = ae(), { fetchJson: m } = se(), l = X(), [N, h] = x(!1), [d, f] = x(null), [a, n] = x(F), { filtered: k, isLoading: L, apiPath: I, queryKey: S } = z(), w = T({
79
+ mutationFn: (e) => m(I, { method: "POST", body: JSON.stringify(e) }),
80
80
  onSuccess: () => {
81
- d.invalidateQueries({ queryKey: S }), r({ title: "Success", description: "System Configuration created successfully" }), P();
81
+ l.invalidateQueries({ queryKey: S }), r({ title: "Success", description: "System Configuration created successfully" }), P();
82
82
  },
83
83
  onError: (e) => {
84
84
  r({ title: "Error", description: e.message, variant: "destructive" });
85
85
  }
86
- }), w = D({
87
- mutationFn: ({ id: e, data: h }) => c(`${I}/${e}`, { method: "PATCH", body: JSON.stringify(h) }),
86
+ }), C = T({
87
+ mutationFn: ({ id: e, data: p }) => m(`${I}/${e}`, { method: "PATCH", body: JSON.stringify(p) }),
88
88
  onSuccess: () => {
89
- d.invalidateQueries({ queryKey: S }), r({ title: "Success", description: "System Configuration updated successfully" }), P();
89
+ l.invalidateQueries({ queryKey: S }), r({ title: "Success", description: "System Configuration updated successfully" }), P();
90
90
  },
91
91
  onError: (e) => {
92
92
  r({ title: "Error", description: e.message, variant: "destructive" });
93
93
  }
94
- }), J = D({
95
- mutationFn: (e) => c(`${I}/${e}`, { method: "DELETE" }),
94
+ }), J = T({
95
+ mutationFn: (e) => m(`${I}/${e}`, { method: "DELETE" }),
96
96
  onSuccess: () => {
97
- d.invalidateQueries({ queryKey: S }), r({ title: "Success", description: "System Configuration deleted successfully" });
97
+ l.invalidateQueries({ queryKey: S }), r({ title: "Success", description: "System Configuration deleted successfully" });
98
98
  },
99
99
  onError: (e) => {
100
100
  r({ title: "Error", description: e.message, variant: "destructive" });
101
101
  }
102
- }), E = () => {
103
- f(null), n(O), p(!0);
104
- }, M = (e) => {
102
+ }), A = () => {
103
+ f(null), n(F), h(!0);
104
+ }, K = (e) => {
105
105
  f(e), n({
106
106
  displayName: e.displayName,
107
107
  apiKey: e.apiKey,
@@ -113,21 +113,21 @@ function ue({
113
113
  type: e.type ?? "",
114
114
  tags: e.tags ?? [],
115
115
  metadata: e.metadata ? JSON.stringify(e.metadata, null, 2) : ""
116
- }), p(!0);
116
+ }), h(!0);
117
117
  }, P = () => {
118
- p(!1), f(null);
119
- }, U = () => {
120
- const { metadata: e, type: h, tags: Q, ...H } = a;
118
+ h(!1), f(null);
119
+ }, M = () => {
120
+ const { metadata: e, type: p, tags: W, ...$ } = a;
121
121
  return {
122
- ...H,
123
- type: h.trim() || null,
124
- tags: Q,
122
+ ...$,
123
+ type: p.trim() || null,
124
+ tags: W,
125
125
  metadata: e.trim() ? JSON.parse(e) : null
126
126
  };
127
- }, B = () => {
127
+ }, R = () => {
128
128
  let e;
129
129
  try {
130
- e = U();
130
+ e = M();
131
131
  } catch {
132
132
  r({
133
133
  title: "Invalid metadata",
@@ -136,26 +136,26 @@ function ue({
136
136
  });
137
137
  return;
138
138
  }
139
- o ? (a.secret.trim() || delete e.secret, w.mutate({ id: o.id, data: e })) : C.mutate(e);
140
- }, R = (e) => {
139
+ d ? (a.secret.trim() || delete e.secret, C.mutate({ id: d.id, data: e })) : w.mutate(e);
140
+ }, B = (e) => {
141
141
  window.confirm("Are you sure you want to delete this system configuration?") && J.mutate(e);
142
- }, $ = !!(a.displayName.trim() && a.apiKey.trim() && (o || a.secret.trim()) && a.projectId.trim() && a.systemId.trim() && a.baseUrl.trim());
142
+ }, q = !!(a.displayName.trim() && a.apiKey.trim() && (d || a.secret.trim()) && a.projectId.trim() && a.systemId.trim() && a.baseUrl.trim());
143
143
  return /* @__PURE__ */ s("div", { className: "space-y-6", children: [
144
144
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
145
145
  /* @__PURE__ */ s("div", { children: [
146
146
  /* @__PURE__ */ t("h2", { className: "text-2xl font-semibold", children: i }),
147
- /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: u })
147
+ /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: c })
148
148
  ] }),
149
- /* @__PURE__ */ s(g, { onClick: E, children: [
150
- /* @__PURE__ */ t(F, { className: "w-4 h-4 mr-2" }),
149
+ /* @__PURE__ */ s(g, { onClick: A, children: [
150
+ /* @__PURE__ */ t(j, { className: "w-4 h-4 mr-2" }),
151
151
  "Add System"
152
152
  ] })
153
153
  ] }),
154
- L ? /* @__PURE__ */ t("div", { className: "text-center text-muted-foreground", children: "Loading system configurations..." }) : T.length > 0 ? /* @__PURE__ */ t("div", { className: "grid gap-4", children: T.map((e) => /* @__PURE__ */ s(j, { children: [
155
- /* @__PURE__ */ t(te, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
154
+ L ? /* @__PURE__ */ t("div", { className: "text-center text-muted-foreground", children: "Loading system configurations..." }) : k.length > 0 ? /* @__PURE__ */ t("div", { className: "grid gap-4", children: k.map((e) => /* @__PURE__ */ s(O, { children: [
155
+ /* @__PURE__ */ t(ie, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
156
156
  /* @__PURE__ */ s("div", { children: [
157
- /* @__PURE__ */ t(ae, { children: e.displayName }),
158
- /* @__PURE__ */ s(se, { children: [
157
+ /* @__PURE__ */ t(ne, { children: e.displayName }),
158
+ /* @__PURE__ */ s(re, { children: [
159
159
  "Project: ",
160
160
  e.projectId,
161
161
  " | System: ",
@@ -163,11 +163,11 @@ function ue({
163
163
  ] })
164
164
  ] }),
165
165
  /* @__PURE__ */ s("div", { className: "flex gap-2", children: [
166
- /* @__PURE__ */ t(g, { variant: "ghost", size: "icon", onClick: () => M(e), children: /* @__PURE__ */ t(W, { className: "w-4 h-4" }) }),
167
- /* @__PURE__ */ t(g, { variant: "ghost", size: "icon", onClick: () => R(e.id), children: /* @__PURE__ */ t(Y, { className: "w-4 h-4" }) })
166
+ /* @__PURE__ */ t(g, { variant: "ghost", size: "icon", onClick: () => K(e), children: /* @__PURE__ */ t(_, { className: "w-4 h-4" }) }),
167
+ /* @__PURE__ */ t(g, { variant: "ghost", size: "icon", onClick: () => B(e.id), children: /* @__PURE__ */ t(G, { className: "w-4 h-4" }) })
168
168
  ] })
169
169
  ] }) }),
170
- /* @__PURE__ */ t(A, { className: "space-y-2", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
170
+ /* @__PURE__ */ t(E, { className: "space-y-2", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
171
171
  /* @__PURE__ */ s("div", { children: [
172
172
  /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "Base URL:" }),
173
173
  /* @__PURE__ */ t("div", { className: "font-mono text-xs mt-1", children: e.baseUrl })
@@ -186,13 +186,13 @@ function ue({
186
186
  ] }),
187
187
  e.tags && e.tags.length > 0 && /* @__PURE__ */ s("div", { className: "col-span-2", children: [
188
188
  /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "Tags:" }),
189
- /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1 mt-1", children: e.tags.map((h) => /* @__PURE__ */ t(
189
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1 mt-1", children: e.tags.map((p) => /* @__PURE__ */ t(
190
190
  "span",
191
191
  {
192
192
  className: "inline-flex items-center rounded-sm bg-secondary px-2 py-0.5 text-xs text-secondary-foreground",
193
- children: h
193
+ children: p
194
194
  },
195
- h
195
+ p
196
196
  )) })
197
197
  ] }),
198
198
  e.metadata && /* @__PURE__ */ s("div", { className: "col-span-2", children: [
@@ -200,23 +200,23 @@ function ue({
200
200
  /* @__PURE__ */ t("pre", { className: "font-mono text-xs mt-1 whitespace-pre-wrap", children: JSON.stringify(e.metadata, null, 2) })
201
201
  ] })
202
202
  ] }) })
203
- ] }, e.id)) }) : /* @__PURE__ */ t(j, { children: /* @__PURE__ */ s(A, { className: "py-12 text-center", children: [
203
+ ] }, e.id)) }) : /* @__PURE__ */ t(O, { children: /* @__PURE__ */ s(E, { className: "py-12 text-center", children: [
204
204
  /* @__PURE__ */ t("p", { className: "text-muted-foreground mb-4", children: "No systems yet" }),
205
- /* @__PURE__ */ s(g, { onClick: E, children: [
206
- /* @__PURE__ */ t(F, { className: "w-4 h-4 mr-2" }),
205
+ /* @__PURE__ */ s(g, { onClick: A, children: [
206
+ /* @__PURE__ */ t(j, { className: "w-4 h-4 mr-2" }),
207
207
  "Add Your First System"
208
208
  ] })
209
209
  ] }) }),
210
- /* @__PURE__ */ t(ne, { open: N, onOpenChange: p, children: /* @__PURE__ */ s(ie, { className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [
211
- /* @__PURE__ */ s(re, { children: [
212
- /* @__PURE__ */ t(le, { children: o ? "Edit System" : "New System" }),
213
- /* @__PURE__ */ t(de, { children: y })
210
+ /* @__PURE__ */ t(oe, { open: N, onOpenChange: h, children: /* @__PURE__ */ s(le, { className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [
211
+ /* @__PURE__ */ s(de, { children: [
212
+ /* @__PURE__ */ t(ce, { children: d ? "Edit System" : "New System" }),
213
+ /* @__PURE__ */ t(me, { children: y })
214
214
  ] }),
215
215
  /* @__PURE__ */ s("div", { className: "space-y-4 py-4", children: [
216
216
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
217
- /* @__PURE__ */ t(l, { htmlFor: "display-name", children: "Display Name" }),
217
+ /* @__PURE__ */ t(o, { htmlFor: "display-name", children: "Display Name" }),
218
218
  /* @__PURE__ */ t(
219
- m,
219
+ u,
220
220
  {
221
221
  id: "display-name",
222
222
  value: a.displayName,
@@ -226,9 +226,9 @@ function ue({
226
226
  )
227
227
  ] }),
228
228
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
229
- /* @__PURE__ */ t(l, { htmlFor: "base-url", children: "Base URL" }),
229
+ /* @__PURE__ */ t(o, { htmlFor: "base-url", children: "Base URL" }),
230
230
  /* @__PURE__ */ t(
231
- m,
231
+ u,
232
232
  {
233
233
  id: "base-url",
234
234
  type: "url",
@@ -241,9 +241,9 @@ function ue({
241
241
  ] }),
242
242
  /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-4", children: [
243
243
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
244
- /* @__PURE__ */ t(l, { htmlFor: "project-id", children: "Project ID" }),
244
+ /* @__PURE__ */ t(o, { htmlFor: "project-id", children: "Project ID" }),
245
245
  /* @__PURE__ */ t(
246
- m,
246
+ u,
247
247
  {
248
248
  id: "project-id",
249
249
  value: a.projectId,
@@ -254,9 +254,9 @@ function ue({
254
254
  )
255
255
  ] }),
256
256
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
257
- /* @__PURE__ */ t(l, { htmlFor: "system-id", children: "System ID" }),
257
+ /* @__PURE__ */ t(o, { htmlFor: "system-id", children: "System ID" }),
258
258
  /* @__PURE__ */ t(
259
- m,
259
+ u,
260
260
  {
261
261
  id: "system-id",
262
262
  value: a.systemId,
@@ -268,9 +268,9 @@ function ue({
268
268
  ] })
269
269
  ] }),
270
270
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
271
- /* @__PURE__ */ t(l, { htmlFor: "api-key", children: "API Key" }),
271
+ /* @__PURE__ */ t(o, { htmlFor: "api-key", children: "API Key" }),
272
272
  /* @__PURE__ */ t(
273
- m,
273
+ u,
274
274
  {
275
275
  id: "api-key",
276
276
  value: a.apiKey,
@@ -282,27 +282,27 @@ function ue({
282
282
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "This will be used as the JWT issuer (iss claim)" })
283
283
  ] }),
284
284
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
285
- /* @__PURE__ */ t(l, { htmlFor: "secret", children: "API Secret" }),
285
+ /* @__PURE__ */ t(o, { htmlFor: "secret", children: "API Secret" }),
286
286
  /* @__PURE__ */ t(
287
- m,
287
+ u,
288
288
  {
289
289
  id: "secret",
290
290
  type: "password",
291
291
  value: a.secret,
292
292
  onChange: (e) => n({ ...a, secret: e.target.value }),
293
- placeholder: o ? "Leave blank to keep current secret" : "Enter API secret",
293
+ placeholder: d ? "Leave blank to keep current secret" : "Enter API secret",
294
294
  className: "font-mono"
295
295
  }
296
296
  ),
297
297
  /* @__PURE__ */ s("p", { className: "text-xs text-muted-foreground", children: [
298
298
  "The Imagine API secret. It will be encrypted before storage.",
299
- o && " Leave blank to keep the existing secret."
299
+ d && " Leave blank to keep the existing secret."
300
300
  ] })
301
301
  ] }),
302
302
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
303
- /* @__PURE__ */ t(l, { htmlFor: "audience", children: "Audience (Optional)" }),
303
+ /* @__PURE__ */ t(o, { htmlFor: "audience", children: "Audience (Optional)" }),
304
304
  /* @__PURE__ */ t(
305
- m,
305
+ u,
306
306
  {
307
307
  id: "audience",
308
308
  value: a.audience,
@@ -313,9 +313,9 @@ function ue({
313
313
  )
314
314
  ] }),
315
315
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
316
- /* @__PURE__ */ t(l, { htmlFor: "type", children: "Type (Optional)" }),
316
+ /* @__PURE__ */ t(o, { htmlFor: "type", children: "Type (Optional)" }),
317
317
  /* @__PURE__ */ t(
318
- m,
318
+ u,
319
319
  {
320
320
  id: "type",
321
321
  value: a.type,
@@ -326,9 +326,9 @@ function ue({
326
326
  )
327
327
  ] }),
328
328
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
329
- /* @__PURE__ */ t(l, { htmlFor: "tags", children: "Tags (Optional)" }),
329
+ /* @__PURE__ */ t(o, { htmlFor: "tags", children: "Tags (Optional)" }),
330
330
  /* @__PURE__ */ t(
331
- me,
331
+ he,
332
332
  {
333
333
  id: "tags",
334
334
  value: a.tags,
@@ -339,7 +339,7 @@ function ue({
339
339
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Press Enter or comma to add. Backspace removes the last tag when the input is empty." })
340
340
  ] }),
341
341
  /* @__PURE__ */ s("div", { className: "space-y-2", children: [
342
- /* @__PURE__ */ t(l, { htmlFor: "metadata", children: "Metadata (Optional)" }),
342
+ /* @__PURE__ */ t(o, { htmlFor: "metadata", children: "Metadata (Optional)" }),
343
343
  /* @__PURE__ */ t(
344
344
  "textarea",
345
345
  {
@@ -354,19 +354,19 @@ function ue({
354
354
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "JSON object stored alongside the config. Leave empty to clear." })
355
355
  ] })
356
356
  ] }),
357
- /* @__PURE__ */ s(oe, { children: [
357
+ /* @__PURE__ */ s(ue, { children: [
358
358
  /* @__PURE__ */ s(g, { variant: "outline", onClick: P, children: [
359
- /* @__PURE__ */ t(K, { className: "w-4 h-4 mr-2" }),
359
+ /* @__PURE__ */ t(U, { className: "w-4 h-4 mr-2" }),
360
360
  "Cancel"
361
361
  ] }),
362
362
  /* @__PURE__ */ s(
363
363
  g,
364
364
  {
365
- onClick: B,
366
- disabled: !$ || C.isPending || w.isPending,
365
+ onClick: R,
366
+ disabled: !q || w.isPending || C.isPending,
367
367
  children: [
368
- /* @__PURE__ */ t(X, { className: "w-4 h-4 mr-2" }),
369
- C.isPending || w.isPending ? "Saving..." : "Save System"
368
+ /* @__PURE__ */ t(Z, { className: "w-4 h-4 mr-2" }),
369
+ w.isPending || C.isPending ? "Saving..." : "Save System"
370
370
  ]
371
371
  }
372
372
  )
@@ -374,56 +374,102 @@ function ue({
374
374
  ] }) })
375
375
  ] });
376
376
  }
377
- const k = {
377
+ const D = {
378
378
  id: "imaginarium.ImagineSystemPage",
379
379
  path: "/system-config",
380
- element: ue
380
+ element: pe
381
381
  }, v = {
382
382
  id: "imaginarium.ImagineSystemNavItem",
383
383
  path: "/system-config",
384
384
  label: "Imagine Systems",
385
385
  sort: 100,
386
- icon: _,
386
+ icon: ee,
387
387
  section: "Settings",
388
388
  sectionSort: 900
389
- }, Ie = k.id, Se = v.id, Ce = {
389
+ }, ge = V.create({
390
+ path: "/system-config",
391
+ markdown: `# Imagine Systems
392
+
393
+ Each entry connects this app to an Imagine cluster. The required fields are display name, base URL, project ID, system ID, API key, and secret.
394
+
395
+ ## Display Name
396
+
397
+ A human-readable label for this system entry. Used throughout the app to identify the cluster.
398
+
399
+ ## Base URL
400
+
401
+ The root address of the cluster's API, for example \`https://prd-customer-imagine-api.leverege.com\`. Do not include a trailing slash or any path segment.
402
+
403
+ If you are unsure of the URL, open the Architect UI for the cluster, open your browser's Network tab, and look at any outbound API request. The base URL is everything before the path.
404
+
405
+ ## Project ID and System ID
406
+
407
+ Both are found in Architect under the project and system settings. They identify which project and system within the cluster this entry targets.
408
+
409
+ ## API Key and Secret
410
+
411
+ The API key is used as the JWT issuer (the \`iss\` claim). The secret is the signing key. Together they authenticate requests from this app to the cluster. The secret is encrypted before storage and is not shown after saving.
412
+
413
+ ### Permissions
414
+
415
+ The key should only have the permissions the app actually needs. Start from minimum and add only what is missing.
416
+
417
+ ### New keys default to admin
418
+
419
+ When you create a new API key in Architect, it is granted admin permissions by default. Remove the admin role before saving and leave only the specific permissions the app requires.
420
+
421
+ ## Audience (Optional)
422
+
423
+ The JWT audience (\`aud\` claim). If left blank, the app derives it automatically from the base URL.
424
+
425
+ ## Tags (Optional)
426
+
427
+ Tags added here appear as filter options in the cluster filter throughout the app. Use them to group or label systems, for example by environment, region, or customer, so users can narrow down which clusters are visible.
428
+
429
+ Tags can also be read by custom plugins to drive conditional behavior.
430
+
431
+ ## Metadata (Optional)
432
+
433
+ A free-form JSON object stored alongside the system config. The app does not use it directly, but custom plugins can read it to drive logic specific to a cluster, for example storing a feature flag, a display preference, or an external reference ID.
434
+ `
435
+ }), Ce = D.id, Pe = v.id, Te = {
390
436
  install(i) {
391
- const u = x.get(
437
+ const c = b.get(
392
438
  "ImagineSystemConfig",
393
439
  "path",
394
- k.path
395
- ), y = x.get(
440
+ D.path
441
+ ), y = b.get(
396
442
  "ImagineSystemConfig",
397
443
  "navLabel",
398
444
  v.label
399
- ), r = x.get(
445
+ ), r = b.get(
400
446
  "ImagineSystemConfig",
401
447
  "navSort",
402
448
  v.sort
403
- ), c = x.get(
449
+ ), m = b.get(
404
450
  "ImagineSystemConfig",
405
451
  "navIcon",
406
452
  v.icon
407
- ), d = c === null ? void 0 : c;
408
- i.addPlugin(q, {
409
- ...k,
410
- path: u
411
- }), i.addPlugin(z, {
453
+ ), l = m === null ? void 0 : m;
454
+ i.addPlugin(Q, {
455
+ ...D,
456
+ path: c
457
+ }), i.addPlugin(H, {
412
458
  ...v,
413
- path: u,
459
+ path: c,
414
460
  label: y,
415
461
  sort: r,
416
- icon: d
417
- });
462
+ icon: l
463
+ }), Y.register(i, { ...ge, path: c });
418
464
  }
419
465
  };
420
466
  export {
421
467
  v as I,
422
- Ce as S,
423
- me as T,
424
- Se as a,
425
- k as b,
426
- Ie as c,
427
- ue as d
468
+ Te as S,
469
+ he as T,
470
+ Pe as a,
471
+ D as b,
472
+ Ce as c,
473
+ pe as d
428
474
  };
429
- //# sourceMappingURL=PluginSetup-NL8jYfpN.js.map
475
+ //# sourceMappingURL=PluginSetup-CTRJO5hU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginSetup-CTRJO5hU.js","sources":["../src/components/ui/TagInput.tsx","../src/system/ImagineSystemView.tsx","../src/system/ImagineSystemPage.tsx","../src/system/ImagineSystemNavItem.ts","../src/system/SystemPageDoc.ts","../src/system/PluginSetup.ts"],"sourcesContent":["import { useState, type KeyboardEvent } from 'react'\nimport { X } from 'lucide-react'\n\nimport { cn } from '../../lib/utils'\n\nexport interface TagInputProps {\n value : string[]\n onChange : ( next: string[] ) => void\n placeholder? : string\n id? : string\n className? : string\n}\n\nexport function TagInput( { value, onChange, placeholder, id, className }: TagInputProps ) {\n const [ draft, setDraft ] = useState( '' )\n\n const commit = () => {\n const t = draft.trim()\n if ( !t ) { return }\n if ( !value.includes( t ) ) { onChange( [ ...value, t ] ) }\n setDraft( '' )\n }\n\n const remove = ( tag: string ) => onChange( value.filter( ( t ) => t !== tag ) )\n\n const handleKeyDown = ( e: KeyboardEvent<HTMLInputElement> ) => {\n if ( e.key === 'Enter' || e.key === ',' ) {\n e.preventDefault()\n commit()\n } else if ( e.key === 'Backspace' && draft === '' && value.length > 0 ) {\n remove( value[value.length - 1] )\n }\n }\n\n return (\n <div\n className={cn(\n 'flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 text-sm focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2',\n className,\n )}\n >\n {value.map( ( tag ) => (\n <span\n key={tag}\n className=\"inline-flex items-center gap-1 rounded-sm bg-secondary px-2 py-0.5 text-secondary-foreground\"\n >\n {tag}\n <button\n type=\"button\"\n onClick={() => remove( tag )}\n aria-label={`Remove tag ${tag}`}\n className=\"text-muted-foreground hover:text-foreground\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </span>\n ) )}\n <input\n id={id}\n value={draft}\n onChange={( e ) => setDraft( e.target.value )}\n onKeyDown={handleKeyDown}\n onBlur={commit}\n placeholder={value.length === 0 ? ( placeholder ?? 'Add a tag…' ) : ''}\n className=\"flex-1 min-w-32 bg-transparent outline-none placeholder:text-muted-foreground\"\n />\n </div>\n )\n}\n","import { useState } from 'react'\nimport { useMutation, useQueryClient } from '@tanstack/react-query'\nimport { Plus, Pencil, Trash2, Save, X } from 'lucide-react'\n\nimport { Button } from '../components/ui/Button'\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../components/ui/Card'\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../components/ui/Dialog'\nimport { Input } from '../components/ui/Input'\nimport { Label } from '../components/ui/Label'\nimport { TagInput } from '../components/ui/TagInput'\nimport { useToast } from '../hooks/useToast'\nimport { useImaginariumApi } from '../api/ImaginariumApiContext'\nimport { useSystemConfigs } from './SystemConfigsContext'\nimport type { ImagineSystemConfig } from './types'\n\ninterface ConfigFormData {\n displayName: string\n apiKey: string\n secret: string\n projectId: string\n systemId: string\n baseUrl: string\n audience: string\n type: string\n tags: string[]\n metadata: string\n}\n\nconst EMPTY_FORM: ConfigFormData = {\n displayName: '',\n apiKey: '',\n secret: '',\n projectId: '',\n systemId: '',\n baseUrl: '',\n audience: '',\n type: '',\n tags: [],\n metadata: '',\n}\n\nexport interface ImagineSystemViewProps {\n title?: string\n subtitle?: string\n dialogDescription?: string\n}\n\nexport default function ImagineSystemView( {\n title = 'Imagine Systems',\n subtitle = 'Manage Imagine API configurations for different systems',\n dialogDescription = 'Configure your Imagine API credentials.',\n}: ImagineSystemViewProps = {} ) {\n const { toast } = useToast()\n const { fetchJson } = useImaginariumApi()\n const queryClient = useQueryClient()\n const [ isDialogOpen, setIsDialogOpen ] = useState( false )\n const [ editingConfig, setEditingConfig ] = useState<ImagineSystemConfig | null>( null )\n const [ formData, setFormData ] = useState<ConfigFormData>( EMPTY_FORM )\n\n const { filtered: filteredConfigs, isLoading, apiPath, queryKey } = useSystemConfigs()\n\n const createMutation = useMutation( {\n mutationFn: ( data: Record<string, unknown> ) =>\n fetchJson( apiPath, { method: 'POST', body: JSON.stringify( data ) } ),\n onSuccess: () => {\n queryClient.invalidateQueries( { queryKey } )\n toast( { title: 'Success', description: 'System Configuration created successfully' } )\n closeDialog()\n },\n onError: ( error: Error ) => {\n toast( { title: 'Error', description: error.message, variant: 'destructive' } )\n },\n } )\n\n const updateMutation = useMutation( {\n mutationFn: ( { id, data }: { id: string; data: Record<string, unknown> } ) =>\n fetchJson( `${apiPath}/${id}`, { method: 'PATCH', body: JSON.stringify( data ) } ),\n onSuccess: () => {\n queryClient.invalidateQueries( { queryKey } )\n toast( { title: 'Success', description: 'System Configuration updated successfully' } )\n closeDialog()\n },\n onError: ( error: Error ) => {\n toast( { title: 'Error', description: error.message, variant: 'destructive' } )\n },\n } )\n\n const deleteMutation = useMutation( {\n mutationFn: ( id: string ) => fetchJson( `${apiPath}/${id}`, { method: 'DELETE' } ),\n onSuccess: () => {\n queryClient.invalidateQueries( { queryKey } )\n toast( { title: 'Success', description: 'System Configuration deleted successfully' } )\n },\n onError: ( error: Error ) => {\n toast( { title: 'Error', description: error.message, variant: 'destructive' } )\n },\n } )\n\n const openCreateDialog = () => {\n setEditingConfig( null )\n setFormData( EMPTY_FORM )\n setIsDialogOpen( true )\n }\n\n const openEditDialog = ( config: ImagineSystemConfig ) => {\n setEditingConfig( config )\n setFormData( {\n displayName: config.displayName,\n apiKey: config.apiKey,\n secret: '',\n projectId: config.projectId,\n systemId: config.systemId,\n baseUrl: config.baseUrl,\n audience: config.audience ?? '',\n type: config.type ?? '',\n tags: config.tags ?? [],\n metadata: config.metadata ? JSON.stringify( config.metadata, null, 2 ) : '',\n } )\n setIsDialogOpen( true )\n }\n\n const closeDialog = () => {\n setIsDialogOpen( false )\n setEditingConfig( null )\n }\n\n const buildPayload = (): Record<string, unknown> => {\n const { metadata, type, tags, ...rest } = formData\n return {\n ...rest,\n type: type.trim() || null,\n tags,\n metadata: metadata.trim() ? JSON.parse( metadata ) : null,\n }\n }\n\n const handleSubmit = () => {\n let payload: Record<string, unknown>\n try {\n payload = buildPayload()\n } catch {\n toast( {\n title: 'Invalid metadata',\n description: 'Metadata must be valid JSON',\n variant: 'destructive',\n } )\n return\n }\n if ( editingConfig ) {\n if ( !formData.secret.trim() ) { delete payload.secret }\n updateMutation.mutate( { id: editingConfig.id, data: payload } )\n } else {\n createMutation.mutate( payload )\n }\n }\n\n const handleDelete = ( id: string ) => {\n if ( window.confirm( 'Are you sure you want to delete this system configuration?' ) ) {\n deleteMutation.mutate( id )\n }\n }\n\n const isFormValid = Boolean(\n formData.displayName.trim()\n && formData.apiKey.trim()\n && ( editingConfig || formData.secret.trim() )\n && formData.projectId.trim()\n && formData.systemId.trim()\n && formData.baseUrl.trim(),\n )\n\n return (\n <div className=\"space-y-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h2 className=\"text-2xl font-semibold\">{title}</h2>\n <p className=\"text-sm text-muted-foreground\">{subtitle}</p>\n </div>\n <Button onClick={openCreateDialog}>\n <Plus className=\"w-4 h-4 mr-2\" />\n Add System\n </Button>\n </div>\n\n {isLoading ? (\n <div className=\"text-center text-muted-foreground\">Loading system configurations...</div>\n ) : filteredConfigs.length > 0 ? (\n <div className=\"grid gap-4\">\n {filteredConfigs.map( ( config ) => (\n <Card key={config.id}>\n <CardHeader>\n <div className=\"flex items-center justify-between\">\n <div>\n <CardTitle>{config.displayName}</CardTitle>\n <CardDescription>\n Project: {config.projectId} | System: {config.systemId}\n </CardDescription>\n </div>\n <div className=\"flex gap-2\">\n <Button variant=\"ghost\" size=\"icon\" onClick={() => openEditDialog( config )}>\n <Pencil className=\"w-4 h-4\" />\n </Button>\n <Button variant=\"ghost\" size=\"icon\" onClick={() => handleDelete( config.id )}>\n <Trash2 className=\"w-4 h-4\" />\n </Button>\n </div>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <div className=\"grid grid-cols-2 gap-4 text-sm\">\n <div>\n <span className=\"text-muted-foreground\">Base URL:</span>\n <div className=\"font-mono text-xs mt-1\">{config.baseUrl}</div>\n </div>\n <div>\n <span className=\"text-muted-foreground\">API Key:</span>\n <div className=\"font-mono text-xs mt-1\">{config.apiKey}</div>\n </div>\n {config.audience && (\n <div>\n <span className=\"text-muted-foreground\">Audience:</span>\n <div className=\"font-mono text-xs mt-1\">{config.audience}</div>\n </div>\n )}\n {config.type && (\n <div>\n <span className=\"text-muted-foreground\">Type:</span>\n <div className=\"font-mono text-xs mt-1\">{config.type}</div>\n </div>\n )}\n {config.tags && config.tags.length > 0 && (\n <div className=\"col-span-2\">\n <span className=\"text-muted-foreground\">Tags:</span>\n <div className=\"flex flex-wrap gap-1 mt-1\">\n {config.tags.map( ( t ) => (\n <span\n key={t}\n className=\"inline-flex items-center rounded-sm bg-secondary px-2 py-0.5 text-xs text-secondary-foreground\"\n >\n {t}\n </span>\n ) )}\n </div>\n </div>\n )}\n {config.metadata && (\n <div className=\"col-span-2\">\n <span className=\"text-muted-foreground\">Metadata:</span>\n <pre className=\"font-mono text-xs mt-1 whitespace-pre-wrap\">\n {JSON.stringify( config.metadata, null, 2 )}\n </pre>\n </div>\n )}\n </div>\n </CardContent>\n </Card>\n ) )}\n </div>\n ) : (\n <Card>\n <CardContent className=\"py-12 text-center\">\n <p className=\"text-muted-foreground mb-4\">No systems yet</p>\n <Button onClick={openCreateDialog}>\n <Plus className=\"w-4 h-4 mr-2\" />\n Add Your First System\n </Button>\n </CardContent>\n </Card>\n )}\n\n <Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>\n <DialogContent className=\"max-w-2xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>\n {editingConfig ? 'Edit System' : 'New System'}\n </DialogTitle>\n <DialogDescription>{dialogDescription}</DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-4 py-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"display-name\">Display Name</Label>\n <Input\n id=\"display-name\"\n value={formData.displayName}\n onChange={( e ) => setFormData( { ...formData, displayName: e.target.value } )}\n placeholder=\"Production - Customer Name\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"base-url\">Base URL</Label>\n <Input\n id=\"base-url\"\n type=\"url\"\n value={formData.baseUrl}\n onChange={( e ) => setFormData( { ...formData, baseUrl: e.target.value } )}\n placeholder=\"https://prd-customer-imagine-api.leverege.com\"\n className=\"font-mono\"\n />\n </div>\n\n <div className=\"grid grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"project-id\">Project ID</Label>\n <Input\n id=\"project-id\"\n value={formData.projectId}\n onChange={( e ) => setFormData( { ...formData, projectId: e.target.value } )}\n placeholder=\"proj123\"\n className=\"font-mono\"\n />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"system-id\">System ID</Label>\n <Input\n id=\"system-id\"\n value={formData.systemId}\n onChange={( e ) => setFormData( { ...formData, systemId: e.target.value } )}\n placeholder=\"sys456\"\n className=\"font-mono\"\n />\n </div>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"api-key\">API Key</Label>\n <Input\n id=\"api-key\"\n value={formData.apiKey}\n onChange={( e ) => setFormData( { ...formData, apiKey: e.target.value } )}\n placeholder=\"Enter API key (JWT issuer)\"\n className=\"font-mono\"\n />\n <p className=\"text-xs text-muted-foreground\">\n This will be used as the JWT issuer (iss claim)\n </p>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"secret\">API Secret</Label>\n <Input\n id=\"secret\"\n type=\"password\"\n value={formData.secret}\n onChange={( e ) => setFormData( { ...formData, secret: e.target.value } )}\n placeholder={editingConfig ? 'Leave blank to keep current secret' : 'Enter API secret'}\n className=\"font-mono\"\n />\n <p className=\"text-xs text-muted-foreground\">\n The Imagine API secret. It will be encrypted before storage.\n {editingConfig && ' Leave blank to keep the existing secret.'}\n </p>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"audience\">Audience (Optional)</Label>\n <Input\n id=\"audience\"\n value={formData.audience}\n onChange={( e ) => setFormData( { ...formData, audience: e.target.value } )}\n placeholder=\"Auto-extracted from base URL if not provided\"\n className=\"font-mono\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"type\">Type (Optional)</Label>\n <Input\n id=\"type\"\n value={formData.type}\n onChange={( e ) => setFormData( { ...formData, type: e.target.value } )}\n placeholder=\"imagine\"\n className=\"font-mono\"\n />\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"tags\">Tags (Optional)</Label>\n <TagInput\n id=\"tags\"\n value={formData.tags}\n onChange={( tags ) => setFormData( { ...formData, tags } )}\n placeholder=\"Press Enter to add\"\n />\n <p className=\"text-xs text-muted-foreground\">\n Press Enter or comma to add. Backspace removes the last tag when the input is empty.\n </p>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"metadata\">Metadata (Optional)</Label>\n <textarea\n id=\"metadata\"\n value={formData.metadata}\n onChange={( e ) => setFormData( { ...formData, metadata: e.target.value } )}\n placeholder='{ \"region\": \"us-central1\" }'\n rows={5}\n className=\"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\"\n />\n <p className=\"text-xs text-muted-foreground\">\n JSON object stored alongside the config. Leave empty to clear.\n </p>\n </div>\n </div>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={closeDialog}>\n <X className=\"w-4 h-4 mr-2\" />\n Cancel\n </Button>\n <Button\n onClick={handleSubmit}\n disabled={!isFormValid || createMutation.isPending || updateMutation.isPending}\n >\n <Save className=\"w-4 h-4 mr-2\" />\n {createMutation.isPending || updateMutation.isPending ? 'Saving...' : 'Save System'}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n </div>\n )\n}\n","import ImagineSystemView from './ImagineSystemView'\n\nexport default {\n id : 'imaginarium.ImagineSystemPage',\n path : '/system-config',\n element : ImagineSystemView,\n}\n","import { Settings } from 'lucide-react'\n\nexport default {\n id : 'imaginarium.ImagineSystemNavItem',\n path : '/system-config',\n label : 'Imagine Systems',\n sort : 100,\n icon : Settings,\n section : 'Settings',\n sectionSort : 900,\n}\n","import { MarkdownPageDoc } from '../docs/MarkdownPageDoc'\n\nexport default MarkdownPageDoc.create( {\n path: '/system-config',\n markdown: `# Imagine Systems\n\nEach entry connects this app to an Imagine cluster. The required fields are display name, base URL, project ID, system ID, API key, and secret.\n\n## Display Name\n\nA human-readable label for this system entry. Used throughout the app to identify the cluster.\n\n## Base URL\n\nThe root address of the cluster's API, for example \\`https://prd-customer-imagine-api.leverege.com\\`. Do not include a trailing slash or any path segment.\n\nIf you are unsure of the URL, open the Architect UI for the cluster, open your browser's Network tab, and look at any outbound API request. The base URL is everything before the path.\n\n## Project ID and System ID\n\nBoth are found in Architect under the project and system settings. They identify which project and system within the cluster this entry targets.\n\n## API Key and Secret\n\nThe API key is used as the JWT issuer (the \\`iss\\` claim). The secret is the signing key. Together they authenticate requests from this app to the cluster. The secret is encrypted before storage and is not shown after saving.\n\n### Permissions\n\nThe key should only have the permissions the app actually needs. Start from minimum and add only what is missing.\n\n### New keys default to admin\n\nWhen you create a new API key in Architect, it is granted admin permissions by default. Remove the admin role before saving and leave only the specific permissions the app requires.\n\n## Audience (Optional)\n\nThe JWT audience (\\`aud\\` claim). If left blank, the app derives it automatically from the base URL.\n\n## Tags (Optional)\n\nTags added here appear as filter options in the cluster filter throughout the app. Use them to group or label systems, for example by environment, region, or customer, so users can narrow down which clusters are visible.\n\nTags can also be read by custom plugins to drive conditional behavior.\n\n## Metadata (Optional)\n\nA free-form JSON object stored alongside the system config. The app does not use it directly, but custom plugins can read it to drive logic specific to a cluster, for example storing a feature flag, a display preference, or an external reference ID.\n`,\n} )\n","import { Config } from '@leverege/plugin'\n\nimport { NavItemType, PageType } from '../plugins/PluginTypes'\nimport { PageDoc } from '../docs/PageDoc'\nimport SystemPageDoc from './SystemPageDoc'\nimport ImagineSystemPage from './ImagineSystemPage'\nimport ImagineSystemNavItem from './ImagineSystemNavItem'\n\nexport const ImagineSystemPageId = ImagineSystemPage.id\nexport const ImagineSystemNavItemId = ImagineSystemNavItem.id\n\ninterface RegistryLike {\n addPlugin( type: string, plugin: unknown ): unknown\n}\n\n/**\n * Self-installs the ImagineSystem CRUD page + nav item, layering in any values\n * set under the `'ImagineSystemConfig'` Config resource on top of the static\n * defaults declared in `ImagineSystemPage` and `ImagineSystemNavItem`.\n *\n * Recognized config keys:\n * - `path` route path for the page (default `/system-config`)\n * - `apiPath` API path the view hits (default `/configs`; consumed by the view)\n * - `navLabel` nav button label (default `'Imagine Systems'`)\n * - `navSort` nav ordering (default `100`)\n * - `navIcon` lucide-react icon component (default `Settings`); set to\n * `null` to render no icon\n */\nexport const SystemSetup = {\n install( plg: RegistryLike ) {\n const path = Config.get<string>(\n 'ImagineSystemConfig', 'path', ImagineSystemPage.path,\n )\n const label = Config.get<string>(\n 'ImagineSystemConfig', 'navLabel', ImagineSystemNavItem.label,\n )\n const sort = Config.get<number>(\n 'ImagineSystemConfig', 'navSort', ImagineSystemNavItem.sort,\n )\n const iconSetting = Config.get<typeof ImagineSystemNavItem.icon | null>(\n 'ImagineSystemConfig', 'navIcon', ImagineSystemNavItem.icon,\n )\n const icon = iconSetting === null ? undefined : iconSetting\n\n plg.addPlugin( PageType, {\n ...ImagineSystemPage,\n path,\n } )\n plg.addPlugin( NavItemType, {\n ...ImagineSystemNavItem,\n path,\n label,\n sort,\n icon,\n } )\n\n PageDoc.register( plg, { ...SystemPageDoc, path } )\n },\n}\n\nexport default SystemSetup\n"],"names":["TagInput","value","onChange","placeholder","id","className","draft","setDraft","useState","commit","t","remove","tag","handleKeyDown","e","jsxs","cn","jsx","X","EMPTY_FORM","ImagineSystemView","title","subtitle","dialogDescription","toast","useToast","fetchJson","useImaginariumApi","queryClient","useQueryClient","isDialogOpen","setIsDialogOpen","editingConfig","setEditingConfig","formData","setFormData","filteredConfigs","isLoading","apiPath","queryKey","useSystemConfigs","createMutation","useMutation","data","closeDialog","error","updateMutation","deleteMutation","openCreateDialog","openEditDialog","config","buildPayload","metadata","type","tags","rest","handleSubmit","payload","handleDelete","isFormValid","Button","Plus","Card","CardHeader","CardTitle","CardDescription","Pencil","Trash2","CardContent","Dialog","DialogContent","DialogHeader","DialogTitle","DialogDescription","Label","Input","DialogFooter","Save","ImagineSystemPage","ImagineSystemNavItem","Settings","SystemPageDoc","MarkdownPageDoc","ImagineSystemPageId","ImagineSystemNavItemId","SystemSetup","plg","path","Config","label","sort","iconSetting","icon","PageType","NavItemType","PageDoc"],"mappings":";;;;;;;;;AAaO,SAASA,GAAU,EAAE,OAAAC,GAAO,UAAAC,GAAU,aAAAC,GAAa,IAAAC,GAAI,WAAAC,KAA6B;AACzF,QAAM,CAAEC,GAAOC,CAAS,IAAIC,EAAU,EAAG,GAEnCC,IAAS,MAAM;AACnB,UAAMC,IAAIJ,EAAM,KAAA;AAChB,IAAMI,MACAT,EAAM,SAAUS,CAAE,KAAMR,EAAU,CAAE,GAAGD,GAAOS,CAAE,CAAE,GACxDH,EAAU,EAAG;AAAA,EACf,GAEMI,IAAS,CAAEC,MAAiBV,EAAUD,EAAM,OAAQ,CAAES,MAAOA,MAAME,CAAI,CAAE,GAEzEC,IAAgB,CAAEC,MAAwC;AAC9D,IAAKA,EAAE,QAAQ,WAAWA,EAAE,QAAQ,OAClCA,EAAE,eAAA,GACFL,EAAA,KACUK,EAAE,QAAQ,eAAeR,MAAU,MAAML,EAAM,SAAS,KAClEU,EAAQV,EAAMA,EAAM,SAAS,CAAC,CAAE;AAAA,EAEpC;AAEA,SACE,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAX;AAAA,MAAA;AAAA,MAGD,UAAA;AAAA,QAAAJ,EAAM,IAAK,CAAEW,MACZ,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YAET,UAAA;AAAA,cAAAH;AAAA,cACD,gBAAAK;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,MAAK;A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