@burdenoff/microfe-cosmicintersection 2026.1101.1 → 2026.1101.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 (53) hide show
  1. package/dist/cosmicintersection/api/tagsApi.d.ts +100 -0
  2. package/dist/cosmicintersection/api/tagsApi.d.ts.map +1 -0
  3. package/dist/cosmicintersection/api/tagsApi.js +110 -0
  4. package/dist/cosmicintersection/api/tagsApi.js.map +1 -0
  5. package/dist/cosmicintersection/components/EntityTagsField.d.ts +5 -5
  6. package/dist/cosmicintersection/components/EntityTagsField.js.map +1 -1
  7. package/dist/cosmicintersection/components/ScienceCanvas.d.ts +17 -0
  8. package/dist/cosmicintersection/components/ScienceCanvas.d.ts.map +1 -0
  9. package/dist/cosmicintersection/components/ScienceCanvas.js +791 -0
  10. package/dist/cosmicintersection/components/ScienceCanvas.js.map +1 -0
  11. package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts +27 -0
  12. package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts.map +1 -0
  13. package/dist/cosmicintersection/components/WorkspaceTagsPicker.js +141 -0
  14. package/dist/cosmicintersection/components/WorkspaceTagsPicker.js.map +1 -0
  15. package/dist/cosmicintersection/components/index.d.ts +3 -0
  16. package/dist/cosmicintersection/components/index.d.ts.map +1 -1
  17. package/dist/cosmicintersection/components/index.js +8 -5
  18. package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts +49 -0
  19. package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts.map +1 -0
  20. package/dist/cosmicintersection/hooks/useEntityTagSync.js +86 -0
  21. package/dist/cosmicintersection/hooks/useEntityTagSync.js.map +1 -0
  22. package/dist/cosmicintersection/lib/visualization.d.ts +189 -0
  23. package/dist/cosmicintersection/lib/visualization.d.ts.map +1 -0
  24. package/dist/cosmicintersection/lib/visualization.js +298 -0
  25. package/dist/cosmicintersection/lib/visualization.js.map +1 -0
  26. package/dist/cosmicintersection/lib/visualizationSamples.d.ts +80 -0
  27. package/dist/cosmicintersection/lib/visualizationSamples.d.ts.map +1 -0
  28. package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +1 -1
  29. package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +11 -11
  30. package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
  31. package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts.map +1 -1
  32. package/dist/cosmicintersection/pages/collections/CollectionFormPage.js +75 -74
  33. package/dist/cosmicintersection/pages/collections/CollectionFormPage.js.map +1 -1
  34. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +1 -1
  35. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +115 -106
  36. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
  37. package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts.map +1 -1
  38. package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js +103 -101
  39. package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js.map +1 -1
  40. package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts.map +1 -1
  41. package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js +141 -139
  42. package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js.map +1 -1
  43. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts.map +1 -1
  44. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js +213 -211
  45. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js.map +1 -1
  46. package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts.map +1 -1
  47. package/dist/cosmicintersection/pages/sources/SourceFormPage.js +110 -107
  48. package/dist/cosmicintersection/pages/sources/SourceFormPage.js.map +1 -1
  49. package/dist/stories/ScienceCanvas.stories.d.ts +21 -0
  50. package/dist/stories/ScienceCanvas.stories.d.ts.map +1 -0
  51. package/dist/stories/WorkspaceTagsPicker.stories.d.ts +12 -0
  52. package/dist/stories/WorkspaceTagsPicker.stories.d.ts.map +1 -0
  53. package/package.json +1 -1
@@ -2,22 +2,23 @@ import { useCosmicIntersection as e } from "../../context/CosmicIntersectionCont
2
2
  import { notify as t } from "../../lib/toast.js";
3
3
  import { useCosCreatePipelineMutation as n, useCosPipelineQuery as r, useCosUpdatePipelineMutation as i } from "../../api/cosmicApi.js";
4
4
  import { EntityFormShell as a } from "../../components/EntityFormShell.js";
5
- import { EntityTagsField as ee } from "../../components/EntityTagsField.js";
6
- import { formatEnumLabel as o } from "../../components/StatusBadge.js";
5
+ import { WorkspaceTagsPicker as o } from "../../components/WorkspaceTagsPicker.js";
6
+ import { formatEnumLabel as s } from "../../components/StatusBadge.js";
7
7
  import "../../components/index.js";
8
- import { describeError as s, mutationSucceeded as c } from "../../lib/mutationResult.js";
9
- import { useMemo as l, useState as u } from "react";
10
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
- import { useParams as p } from "react-router";
12
- import { ArrowDown as m, ArrowUp as te, GripVertical as h, Plus as g, Trash2 as _ } from "lucide-react";
13
- import { Button as v, Input as y, Label as b, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as E } from "@burdenoff/fe-libs/ui";
8
+ import { useEntityTagSync as c } from "../../hooks/useEntityTagSync.js";
9
+ import { describeError as l, mutationSucceeded as u } from "../../lib/mutationResult.js";
10
+ import { useMemo as d, useState as f } from "react";
11
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
12
+ import { useParams as ee } from "react-router";
13
+ import { ArrowDown as te, ArrowUp as h, GripVertical as g, Plus as ne, Trash2 as re } from "lucide-react";
14
+ import { Button as _, Input as v, Label as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w, Textarea as T } from "@burdenoff/fe-libs/ui";
14
15
  //#region src/cosmicintersection/pages/pipelines/PipelineFormPage.tsx
15
- var D = [
16
+ var E = [
16
17
  "MANUAL",
17
18
  "SCHEDULED",
18
19
  "ON_INGEST",
19
20
  "WEBHOOK"
20
- ], O = [
21
+ ], D = [
21
22
  "INGEST",
22
23
  "CALIBRATE",
23
24
  "TRANSFORM",
@@ -25,10 +26,10 @@ var D = [
25
26
  "EXPORT",
26
27
  "NOTIFY"
27
28
  ];
28
- function k(e) {
29
- return typeof e == "string" && O.includes(e);
29
+ function O(e) {
30
+ return typeof e == "string" && D.includes(e);
30
31
  }
31
- var A = 0, j = () => `step-${A += 1}`, M = {
32
+ var k = 0, A = () => `step-${k += 1}`, j = {
32
33
  name: "",
33
34
  description: "",
34
35
  trigger: "MANUAL",
@@ -36,186 +37,223 @@ var A = 0, j = () => `step-${A += 1}`, M = {
36
37
  steps: [],
37
38
  tags: []
38
39
  };
39
- function N(e) {
40
+ function M(e) {
40
41
  if (!e) return [];
41
42
  let t = e.steps;
42
43
  if (!Array.isArray(t)) return [];
43
44
  let n = [];
44
45
  for (let e of t) if (e && typeof e == "object" && !Array.isArray(e)) {
45
46
  let t = e.kind, r = e.name;
46
- k(t) && n.push({
47
- id: j(),
47
+ O(t) && n.push({
48
+ id: A(),
48
49
  kind: t,
49
50
  name: typeof r == "string" ? r : ""
50
51
  });
51
52
  }
52
53
  return n;
53
54
  }
54
- function P(e) {
55
+ function N(e) {
55
56
  return e.map((e) => {
56
57
  let t = { kind: e.kind }, n = e.name.trim();
57
58
  return n && (t.name = n), t;
58
59
  });
59
60
  }
60
- function F() {
61
- let { id: A = "" } = p(), F = !!A, { navigate: I } = e(), { data: ne, loading: L } = r(A), [R, { loading: z }] = n(), [B, { loading: V }] = i(), [H, U] = u(M), [W, G] = u({}), [K, q] = u(""), [J, Y] = u(null), X = F ? ne?.cosPipeline : null, [re, ie] = u(null);
62
- if (X && X.id !== re) {
63
- ie(X.id), U({
64
- name: X.name ?? "",
65
- description: X.description ?? "",
66
- trigger: X.trigger ?? "MANUAL",
67
- schedule: X.schedule ?? "",
68
- steps: N(X.definition),
69
- tags: X.tags ?? []
61
+ function P() {
62
+ let { id: k = "" } = ee(), P = !!k, { navigate: F } = e(), { data: ie, loading: ae } = r(k), [oe, { loading: I }] = n(), [L, { loading: R }] = i(), [z, B] = f(j), { syncTags: V, syncing: H } = c("COSMICINTERSECTION_PIPELINE"), [U, W] = f({}), [G, K] = f(""), [q, J] = f(null), Y = P ? ie?.cosPipeline : null, [se, ce] = f(null);
63
+ if (Y && Y.id !== se) {
64
+ ce(Y.id), B({
65
+ name: Y.name ?? "",
66
+ description: Y.description ?? "",
67
+ trigger: Y.trigger ?? "MANUAL",
68
+ schedule: Y.schedule ?? "",
69
+ steps: M(Y.definition),
70
+ tags: Y.tags ?? []
70
71
  });
71
- let e = { ...X.definition ?? {} };
72
- delete e.steps, G(e);
72
+ let e = { ...Y.definition ?? {} };
73
+ delete e.steps, W(e);
73
74
  }
74
- let Z = (e, t) => {
75
- U((n) => ({
75
+ let X = (e, t) => {
76
+ B((n) => ({
76
77
  ...n,
77
78
  [e]: t
78
79
  }));
79
- }, ae = l(() => JSON.stringify({
80
- ...W,
81
- steps: P(H.steps)
82
- }, null, 2), [W, H.steps]), oe = () => {
83
- Z("steps", [...H.steps, {
84
- id: j(),
80
+ }, le = d(() => JSON.stringify({
81
+ ...U,
82
+ steps: N(z.steps)
83
+ }, null, 2), [U, z.steps]), ue = () => {
84
+ X("steps", [...z.steps, {
85
+ id: A(),
85
86
  kind: "INGEST",
86
87
  name: ""
87
88
  }]);
88
- }, se = (e) => {
89
- Z("steps", H.steps.filter((t) => t.id !== e));
90
- }, Q = (e, t) => {
91
- Z("steps", H.steps.map((n) => n.id === e ? {
89
+ }, de = (e) => {
90
+ X("steps", z.steps.filter((t) => t.id !== e));
91
+ }, Z = (e, t) => {
92
+ X("steps", z.steps.map((n) => n.id === e ? {
92
93
  ...n,
93
94
  ...t
94
95
  } : n));
95
- }, $ = (e, t) => {
96
+ }, Q = (e, t) => {
96
97
  let n = e + t;
97
- if (n < 0 || n >= H.steps.length) return;
98
- let r = [...H.steps], [i] = r.splice(e, 1);
99
- r.splice(n, 0, i), Z("steps", r);
100
- };
101
- return /* @__PURE__ */ f(a, {
102
- title: F ? "Edit pipeline" : "New pipeline",
103
- description: "Define how raw data is ingested, processed and released.",
104
- purpose: "A pipeline chains ordered steps (ingest, calibrate, transform, analyze, export) over your datasets. Choose how it is triggered, add an optional cron schedule, and build its steps below.",
105
- backLabel: F ? "Back to pipeline" : "Back to pipelines",
106
- onBack: () => I(F ? `pipelines/${A}` : "pipelines"),
107
- onSubmit: async (e) => {
108
- if (e.preventDefault(), !H.name.trim()) {
109
- t.error("Name is required", "Give the pipeline a name before saving.");
98
+ if (n < 0 || n >= z.steps.length) return;
99
+ let r = [...z.steps], [i] = r.splice(e, 1);
100
+ r.splice(n, 0, i), X("steps", r);
101
+ }, fe = () => {
102
+ let e;
103
+ try {
104
+ e = JSON.parse(G);
105
+ } catch (e) {
106
+ J(l(e) ?? "Invalid JSON.");
107
+ return;
108
+ }
109
+ if (!e || typeof e != "object" || Array.isArray(e)) {
110
+ J("Definition must be a JSON object with a \"steps\" array.");
111
+ return;
112
+ }
113
+ let n = e.steps;
114
+ if (!Array.isArray(n)) {
115
+ J("Definition must contain a \"steps\" array.");
116
+ return;
117
+ }
118
+ let r = [];
119
+ for (let e of n) {
120
+ if (!e || typeof e != "object" || Array.isArray(e)) {
121
+ J("Each step must be an object with a \"kind\".");
110
122
  return;
111
123
  }
112
- let n = P(H.steps), r = { ...W };
113
- delete r.steps;
114
- let i;
115
- i = n.length > 0 ? {
116
- ...r,
117
- steps: n
118
- } : Object.keys(r).length > 0 ? r : void 0;
119
- let a = H.trigger === "SCHEDULED" ? H.schedule.trim() : "";
120
- try {
121
- if (F) {
122
- let e = await B({ variables: {
123
- id: A,
124
- input: {
125
- name: H.name.trim(),
126
- description: H.description.trim() || void 0,
127
- trigger: H.trigger,
128
- schedule: a || void 0,
129
- definition: i,
130
- tags: H.tags
131
- }
132
- } });
133
- if (!c(e, e.data?.cosUpdatePipeline?.id, "Could not update pipeline")) return;
134
- t.success("Pipeline updated", `“${H.name.trim()}” was saved.`), I(`pipelines/${A}`);
135
- return;
136
- }
137
- let e = await R({ variables: { input: {
138
- name: H.name.trim(),
139
- description: H.description.trim() || void 0,
140
- trigger: H.trigger,
141
- schedule: a || void 0,
142
- definition: i,
143
- tags: H.tags
144
- } } }), n = e.data?.cosCreatePipeline?.id;
145
- if (!c(e, n, "Could not create pipeline")) return;
146
- t.success("Pipeline created", `“${H.name.trim()}” is ready.`), I(n ? `pipelines/${n}` : "pipelines");
147
- } catch (e) {
148
- t.error("Could not save pipeline", s(e));
124
+ let t = e.kind;
125
+ if (!O(t)) {
126
+ J(`Invalid step kind "${String(t)}". Allowed: ${D.join(", ")}.`);
127
+ return;
128
+ }
129
+ let n = e.name;
130
+ r.push({
131
+ id: A(),
132
+ kind: t,
133
+ name: typeof n == "string" ? n : ""
134
+ });
135
+ }
136
+ let i = { ...e };
137
+ delete i.steps, W(i), X("steps", r), J(null), t.success("Steps updated", "The builder now reflects your JSON.");
138
+ }, pe = async (e) => {
139
+ if (e.preventDefault(), !z.name.trim()) {
140
+ t.error("Name is required", "Give the pipeline a name before saving.");
141
+ return;
142
+ }
143
+ let n = N(z.steps), r = { ...U };
144
+ delete r.steps;
145
+ let i;
146
+ i = n.length > 0 ? {
147
+ ...r,
148
+ steps: n
149
+ } : Object.keys(r).length > 0 ? r : void 0;
150
+ let a = z.trigger === "SCHEDULED" ? z.schedule.trim() : "";
151
+ try {
152
+ if (P) {
153
+ let e = Y?.tags ?? [], n = await L({ variables: {
154
+ id: k,
155
+ input: {
156
+ name: z.name.trim(),
157
+ description: z.description.trim() || void 0,
158
+ trigger: z.trigger,
159
+ schedule: a || void 0,
160
+ definition: i,
161
+ tags: z.tags
162
+ }
163
+ } });
164
+ if (!u(n, n.data?.cosUpdatePipeline?.id, "Could not update pipeline")) return;
165
+ await V(k, z.tags, e) && t.success("Pipeline updated", `“${z.name.trim()}” was saved.`), F(`pipelines/${k}`);
166
+ return;
149
167
  }
150
- },
151
- submitLabel: F ? "Save changes" : "Create pipeline",
152
- saving: z || V,
153
- submitDisabled: F && L,
168
+ let e = await oe({ variables: { input: {
169
+ name: z.name.trim(),
170
+ description: z.description.trim() || void 0,
171
+ trigger: z.trigger,
172
+ schedule: a || void 0,
173
+ definition: i,
174
+ tags: z.tags
175
+ } } }), n = e.data?.cosCreatePipeline?.id;
176
+ if (!u(e, n, "Could not create pipeline")) return;
177
+ (!n || await V(n, z.tags)) && t.success("Pipeline created", `“${z.name.trim()}” is ready.`), F(n ? `pipelines/${n}` : "pipelines");
178
+ } catch (e) {
179
+ t.error("Could not save pipeline", l(e));
180
+ }
181
+ }, $ = I || R || H;
182
+ return /* @__PURE__ */ m(a, {
183
+ title: P ? "Edit pipeline" : "New pipeline",
184
+ description: "Define how raw data is ingested, processed and released.",
185
+ purpose: "A pipeline chains ordered steps (ingest, calibrate, transform, analyze, export) over your datasets. Choose how it is triggered, add an optional cron schedule, and build its steps below.",
186
+ backLabel: P ? "Back to pipeline" : "Back to pipelines",
187
+ onBack: () => F(P ? `pipelines/${k}` : "pipelines"),
188
+ onSubmit: pe,
189
+ submitLabel: P ? "Save changes" : "Create pipeline",
190
+ saving: $,
191
+ submitDisabled: P && ae,
154
192
  children: [
155
- /* @__PURE__ */ f("div", {
193
+ /* @__PURE__ */ m("div", {
156
194
  className: "space-y-1",
157
- children: [/* @__PURE__ */ d(b, {
195
+ children: [/* @__PURE__ */ p(y, {
158
196
  htmlFor: "pipeline-name",
159
197
  children: "Name"
160
- }), /* @__PURE__ */ d(y, {
198
+ }), /* @__PURE__ */ p(v, {
161
199
  id: "pipeline-name",
162
- value: H.name,
163
- onChange: (e) => Z("name", e.target.value),
200
+ value: z.name,
201
+ onChange: (e) => X("name", e.target.value),
164
202
  placeholder: "e.g. Kepler DR3 ingest",
165
203
  required: !0
166
204
  })]
167
205
  }),
168
- /* @__PURE__ */ f("div", {
206
+ /* @__PURE__ */ m("div", {
169
207
  className: "space-y-1",
170
- children: [/* @__PURE__ */ d(b, {
208
+ children: [/* @__PURE__ */ p(y, {
171
209
  htmlFor: "pipeline-description",
172
210
  children: "Description"
173
- }), /* @__PURE__ */ d(E, {
211
+ }), /* @__PURE__ */ p(T, {
174
212
  id: "pipeline-description",
175
- value: H.description,
176
- onChange: (e) => Z("description", e.target.value),
213
+ value: z.description,
214
+ onChange: (e) => X("description", e.target.value),
177
215
  rows: 3,
178
216
  placeholder: "What this pipeline does and when it runs."
179
217
  })]
180
218
  }),
181
- /* @__PURE__ */ f("div", {
219
+ /* @__PURE__ */ m("div", {
182
220
  className: "grid grid-cols-1 gap-4 md:grid-cols-2",
183
- children: [/* @__PURE__ */ f("div", {
221
+ children: [/* @__PURE__ */ m("div", {
184
222
  className: "space-y-1",
185
- children: [/* @__PURE__ */ d(b, {
223
+ children: [/* @__PURE__ */ p(y, {
186
224
  htmlFor: "pipeline-trigger",
187
225
  children: "Trigger"
188
- }), /* @__PURE__ */ f(x, {
189
- value: H.trigger,
190
- onValueChange: (e) => Z("trigger", e),
191
- children: [/* @__PURE__ */ d(w, {
226
+ }), /* @__PURE__ */ m(b, {
227
+ value: z.trigger,
228
+ onValueChange: (e) => X("trigger", e),
229
+ children: [/* @__PURE__ */ p(C, {
192
230
  id: "pipeline-trigger",
193
231
  "aria-label": "Trigger",
194
- children: /* @__PURE__ */ d(T, {})
195
- }), /* @__PURE__ */ d(S, { children: D.map((e) => /* @__PURE__ */ d(C, {
232
+ children: /* @__PURE__ */ p(w, {})
233
+ }), /* @__PURE__ */ p(x, { children: E.map((e) => /* @__PURE__ */ p(S, {
196
234
  value: e,
197
- children: o(e)
235
+ children: s(e)
198
236
  }, e)) })]
199
237
  })]
200
- }), H.trigger === "SCHEDULED" ? /* @__PURE__ */ f("div", {
238
+ }), z.trigger === "SCHEDULED" ? /* @__PURE__ */ m("div", {
201
239
  className: "space-y-1",
202
240
  children: [
203
- /* @__PURE__ */ d(b, {
241
+ /* @__PURE__ */ p(y, {
204
242
  htmlFor: "pipeline-schedule",
205
243
  children: "Schedule (cron)"
206
244
  }),
207
- /* @__PURE__ */ d(y, {
245
+ /* @__PURE__ */ p(v, {
208
246
  id: "pipeline-schedule",
209
- value: H.schedule,
210
- onChange: (e) => Z("schedule", e.target.value),
247
+ value: z.schedule,
248
+ onChange: (e) => X("schedule", e.target.value),
211
249
  placeholder: "0 2 * * *",
212
250
  className: "font-mono"
213
251
  }),
214
- /* @__PURE__ */ f("p", {
252
+ /* @__PURE__ */ m("p", {
215
253
  className: "text-xs text-text-secondary",
216
254
  children: [
217
255
  "Standard 5-field cron expression, e.g. ",
218
- /* @__PURE__ */ d("span", {
256
+ /* @__PURE__ */ p("span", {
219
257
  className: "font-mono",
220
258
  children: "0 2 * * *"
221
259
  }),
@@ -226,171 +264,134 @@ function F() {
226
264
  ]
227
265
  }) : null]
228
266
  }),
229
- /* @__PURE__ */ f("div", {
267
+ /* @__PURE__ */ m("div", {
230
268
  className: "space-y-2",
231
269
  children: [
232
- /* @__PURE__ */ d(b, { children: "Definition — steps" }),
233
- /* @__PURE__ */ d("p", {
270
+ /* @__PURE__ */ p(y, { children: "Definition — steps" }),
271
+ /* @__PURE__ */ p("p", {
234
272
  className: "text-xs text-text-secondary",
235
273
  children: "The ordered stages this pipeline runs. Add a step, pick its kind, optionally name it, and reorder with the arrows."
236
274
  }),
237
- H.steps.length === 0 ? /* @__PURE__ */ d("div", {
275
+ z.steps.length === 0 ? /* @__PURE__ */ p("div", {
238
276
  className: "rounded-card border border-dashed border-border-default bg-bg-sunken px-4 py-6 text-center",
239
- children: /* @__PURE__ */ d("p", {
277
+ children: /* @__PURE__ */ p("p", {
240
278
  className: "text-sm text-text-secondary",
241
279
  children: "No steps yet. Add the first stage to start building the flow."
242
280
  })
243
- }) : /* @__PURE__ */ d("ol", {
281
+ }) : /* @__PURE__ */ p("ol", {
244
282
  className: "space-y-2",
245
- children: H.steps.map((e, t) => /* @__PURE__ */ f("li", {
283
+ children: z.steps.map((e, t) => /* @__PURE__ */ m("li", {
246
284
  className: "flex items-center gap-2 rounded-card border border-border-default bg-bg-elevated p-2.5",
247
285
  children: [
248
- /* @__PURE__ */ f("span", {
286
+ /* @__PURE__ */ m("span", {
249
287
  className: "flex items-center gap-1.5 text-text-secondary",
250
- children: [/* @__PURE__ */ d(h, {
288
+ children: [/* @__PURE__ */ p(g, {
251
289
  className: "size-4 shrink-0",
252
290
  "aria-hidden": "true"
253
- }), /* @__PURE__ */ d("span", {
291
+ }), /* @__PURE__ */ p("span", {
254
292
  className: "w-4 text-xs font-semibold tabular-nums",
255
293
  children: t + 1
256
294
  })]
257
295
  }),
258
- /* @__PURE__ */ f("div", {
296
+ /* @__PURE__ */ m("div", {
259
297
  className: "grid min-w-0 flex-1 grid-cols-1 gap-2 sm:grid-cols-[10rem_1fr]",
260
- children: [/* @__PURE__ */ f(x, {
298
+ children: [/* @__PURE__ */ m(b, {
261
299
  value: e.kind,
262
- onValueChange: (t) => Q(e.id, { kind: t }),
263
- children: [/* @__PURE__ */ d(w, {
300
+ onValueChange: (t) => Z(e.id, { kind: t }),
301
+ children: [/* @__PURE__ */ p(C, {
264
302
  "aria-label": `Kind for step ${t + 1}`,
265
- children: /* @__PURE__ */ d(T, {})
266
- }), /* @__PURE__ */ d(S, { children: O.map((e) => /* @__PURE__ */ d(C, {
303
+ children: /* @__PURE__ */ p(w, {})
304
+ }), /* @__PURE__ */ p(x, { children: D.map((e) => /* @__PURE__ */ p(S, {
267
305
  value: e,
268
- children: o(e)
306
+ children: s(e)
269
307
  }, e)) })]
270
- }), /* @__PURE__ */ d(y, {
308
+ }), /* @__PURE__ */ p(v, {
271
309
  value: e.name,
272
- onChange: (t) => Q(e.id, { name: t.target.value }),
310
+ onChange: (t) => Z(e.id, { name: t.target.value }),
273
311
  placeholder: "Optional step name",
274
312
  "aria-label": `Name for step ${t + 1}`
275
313
  })]
276
314
  }),
277
- /* @__PURE__ */ f("div", {
315
+ /* @__PURE__ */ m("div", {
278
316
  className: "flex shrink-0 items-center gap-0.5",
279
317
  children: [
280
- /* @__PURE__ */ d(v, {
318
+ /* @__PURE__ */ p(_, {
281
319
  type: "button",
282
320
  variant: "ghost",
283
321
  size: "icon-sm",
284
- onClick: () => $(t, -1),
322
+ onClick: () => Q(t, -1),
285
323
  disabled: t === 0,
286
324
  "aria-label": `Move step ${t + 1} up`,
287
- children: /* @__PURE__ */ d(te, { className: "size-4" })
325
+ children: /* @__PURE__ */ p(h, { className: "size-4" })
288
326
  }),
289
- /* @__PURE__ */ d(v, {
327
+ /* @__PURE__ */ p(_, {
290
328
  type: "button",
291
329
  variant: "ghost",
292
330
  size: "icon-sm",
293
- onClick: () => $(t, 1),
294
- disabled: t === H.steps.length - 1,
331
+ onClick: () => Q(t, 1),
332
+ disabled: t === z.steps.length - 1,
295
333
  "aria-label": `Move step ${t + 1} down`,
296
- children: /* @__PURE__ */ d(m, { className: "size-4" })
334
+ children: /* @__PURE__ */ p(te, { className: "size-4" })
297
335
  }),
298
- /* @__PURE__ */ d(v, {
336
+ /* @__PURE__ */ p(_, {
299
337
  type: "button",
300
338
  variant: "ghost",
301
339
  size: "icon-sm",
302
- onClick: () => se(e.id),
340
+ onClick: () => de(e.id),
303
341
  "aria-label": `Remove step ${t + 1}`,
304
342
  className: "text-text-secondary hover:text-status-error-text",
305
- children: /* @__PURE__ */ d(_, { className: "size-4" })
343
+ children: /* @__PURE__ */ p(re, { className: "size-4" })
306
344
  })
307
345
  ]
308
346
  })
309
347
  ]
310
348
  }, e.id))
311
349
  }),
312
- /* @__PURE__ */ f(v, {
350
+ /* @__PURE__ */ m(_, {
313
351
  type: "button",
314
352
  variant: "outline",
315
353
  size: "sm",
316
- onClick: oe,
317
- children: [/* @__PURE__ */ d(g, { className: "size-4" }), "Add step"]
354
+ onClick: ue,
355
+ children: [/* @__PURE__ */ p(ne, { className: "size-4" }), "Add step"]
318
356
  }),
319
- /* @__PURE__ */ f("details", {
357
+ /* @__PURE__ */ m("details", {
320
358
  className: "group mt-2 rounded-card border border-border-default bg-bg-sunken",
321
359
  onToggle: (e) => {
322
- e.currentTarget.open && (q(ae), Y(null));
360
+ e.currentTarget.open && (K(le), J(null));
323
361
  },
324
- children: [/* @__PURE__ */ f("summary", {
362
+ children: [/* @__PURE__ */ m("summary", {
325
363
  className: "flex cursor-pointer list-none items-center justify-between px-4 py-2.5 text-sm font-medium text-text-secondary transition-colors hover:text-text-primary",
326
- children: ["Advanced — edit as JSON", /* @__PURE__ */ d("span", {
364
+ children: ["Advanced — edit as JSON", /* @__PURE__ */ p("span", {
327
365
  className: "text-xs transition-transform group-open:rotate-180",
328
366
  children: "▾"
329
367
  })]
330
- }), /* @__PURE__ */ f("div", {
368
+ }), /* @__PURE__ */ m("div", {
331
369
  className: "space-y-2 border-t border-border-seam p-4",
332
370
  children: [
333
- /* @__PURE__ */ d(E, {
334
- value: K,
371
+ /* @__PURE__ */ p(T, {
372
+ value: G,
335
373
  onChange: (e) => {
336
- q(e.target.value), Y(null);
374
+ K(e.target.value), J(null);
337
375
  },
338
376
  rows: 8,
339
377
  spellCheck: !1,
340
378
  className: "font-mono text-xs",
341
379
  "aria-label": "Definition JSON"
342
380
  }),
343
- J ? /* @__PURE__ */ d("p", {
381
+ q ? /* @__PURE__ */ p("p", {
344
382
  className: "text-xs text-status-error-text",
345
- children: J
383
+ children: q
346
384
  }) : null,
347
- /* @__PURE__ */ f("div", {
385
+ /* @__PURE__ */ m("div", {
348
386
  className: "flex items-center justify-between gap-2",
349
- children: [/* @__PURE__ */ d("p", {
387
+ children: [/* @__PURE__ */ p("p", {
350
388
  className: "text-xs text-text-secondary",
351
389
  children: "Edit the raw definition, then apply it back to the builder above."
352
- }), /* @__PURE__ */ d(v, {
390
+ }), /* @__PURE__ */ p(_, {
353
391
  type: "button",
354
392
  variant: "outline",
355
393
  size: "sm",
356
- onClick: () => {
357
- let e;
358
- try {
359
- e = JSON.parse(K);
360
- } catch (e) {
361
- Y(s(e) ?? "Invalid JSON.");
362
- return;
363
- }
364
- if (!e || typeof e != "object" || Array.isArray(e)) {
365
- Y("Definition must be a JSON object with a \"steps\" array.");
366
- return;
367
- }
368
- let n = e.steps;
369
- if (!Array.isArray(n)) {
370
- Y("Definition must contain a \"steps\" array.");
371
- return;
372
- }
373
- let r = [];
374
- for (let e of n) {
375
- if (!e || typeof e != "object" || Array.isArray(e)) {
376
- Y("Each step must be an object with a \"kind\".");
377
- return;
378
- }
379
- let t = e.kind;
380
- if (!k(t)) {
381
- Y(`Invalid step kind "${String(t)}". Allowed: ${O.join(", ")}.`);
382
- return;
383
- }
384
- let n = e.name;
385
- r.push({
386
- id: j(),
387
- kind: t,
388
- name: typeof n == "string" ? n : ""
389
- });
390
- }
391
- let i = { ...e };
392
- delete i.steps, G(i), Z("steps", r), Y(null), t.success("Steps updated", "The builder now reflects your JSON.");
393
- },
394
+ onClick: fe,
394
395
  children: "Apply to builder"
395
396
  })]
396
397
  })
@@ -399,14 +400,15 @@ function F() {
399
400
  })
400
401
  ]
401
402
  }),
402
- /* @__PURE__ */ d(ee, {
403
- value: H.tags,
404
- onChange: (e) => Z("tags", e)
403
+ /* @__PURE__ */ p(o, {
404
+ value: z.tags,
405
+ onChange: (e) => X("tags", e),
406
+ disabled: $
405
407
  })
406
408
  ]
407
409
  });
408
410
  }
409
411
  //#endregion
410
- export { F as default };
412
+ export { P as default };
411
413
 
412
414
  //# sourceMappingURL=PipelineFormPage.js.map