orcheo-studio 0.24.2 → 0.24.4

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 (62) hide show
  1. package/.bumpversion.cfg +1 -1
  2. package/dist/assets/{arc-B5ofENSG.js → arc-99TH-Koz.js} +1 -1
  3. package/dist/assets/{architectureDiagram-VXUJARFQ-DxYHdW7c.js → architectureDiagram-VXUJARFQ-DugaTSY2.js} +1 -1
  4. package/dist/assets/{blockDiagram-VD42YOAC-DJFNLztP.js → blockDiagram-VD42YOAC-BH68wVtD.js} +1 -1
  5. package/dist/assets/{c4Diagram-YG6GDRKO-i42OpjrQ.js → c4Diagram-YG6GDRKO-V6Vqtp7B.js} +1 -1
  6. package/dist/assets/channel-D562bZxL.js +1 -0
  7. package/dist/assets/{chunk-4BX2VUAB-BP38Jeu1.js → chunk-4BX2VUAB-CvbCAMNv.js} +1 -1
  8. package/dist/assets/{chunk-55IACEB6-DgOteLeo.js → chunk-55IACEB6-h_T3kQh7.js} +1 -1
  9. package/dist/assets/{chunk-B4BG7PRW-DSFMHhnv.js → chunk-B4BG7PRW-Dm6dgbGh.js} +1 -1
  10. package/dist/assets/{chunk-DI55MBZ5-houO_rDU.js → chunk-DI55MBZ5-DSXFA4Fi.js} +1 -1
  11. package/dist/assets/{chunk-FMBD7UC4-2uWxVMuK.js → chunk-FMBD7UC4-DJDlfjt1.js} +1 -1
  12. package/dist/assets/{chunk-QN33PNHL-CNE7iDzV.js → chunk-QN33PNHL-BnjUGeBL.js} +1 -1
  13. package/dist/assets/{chunk-QZHKN3VN-CuJasZjZ.js → chunk-QZHKN3VN-BRudOghZ.js} +1 -1
  14. package/dist/assets/{chunk-TZMSLE5B-DdOfh1YS.js → chunk-TZMSLE5B-CpxSpvqK.js} +1 -1
  15. package/dist/assets/classDiagram-2ON5EDUG-Dix_KnuM.js +1 -0
  16. package/dist/assets/classDiagram-v2-WZHVMYZB-Dix_KnuM.js +1 -0
  17. package/dist/assets/clone-0c2Tu-SH.js +1 -0
  18. package/dist/assets/{cose-bilkent-S5V4N54A-n5L5u7aX.js → cose-bilkent-S5V4N54A-Dl80WZ_a.js} +1 -1
  19. package/dist/assets/{dagre-6UL2VRFP-DA0iPKXN.js → dagre-6UL2VRFP-vw-vkw78.js} +1 -1
  20. package/dist/assets/{diagram-PSM6KHXK-3FRZnvw9.js → diagram-PSM6KHXK-B4MT5Nvf.js} +1 -1
  21. package/dist/assets/{diagram-QEK2KX5R-ePGkAGnY.js → diagram-QEK2KX5R-CMioZnRI.js} +1 -1
  22. package/dist/assets/{diagram-S2PKOQOG-FYWv9iIE.js → diagram-S2PKOQOG-PJAE8YS0.js} +1 -1
  23. package/dist/assets/{erDiagram-Q2GNP2WA-2la-V9DA.js → erDiagram-Q2GNP2WA-DCd-WouG.js} +1 -1
  24. package/dist/assets/{flowDiagram-NV44I4VS-Cv-HCQV2.js → flowDiagram-NV44I4VS-DS__-WT4.js} +1 -1
  25. package/dist/assets/{ganttDiagram-JELNMOA3-DZhWBmY1.js → ganttDiagram-JELNMOA3-Btifh-31.js} +1 -1
  26. package/dist/assets/{gitGraphDiagram-V2S2FVAM-CBfpN1uw.js → gitGraphDiagram-V2S2FVAM-BCyjopey.js} +1 -1
  27. package/dist/assets/{graph-D6aI-bPq.js → graph-6YBx8iQ0.js} +1 -1
  28. package/dist/assets/{index-D8PZ9Puu.js → index-lkycEDHM.js} +120 -120
  29. package/dist/assets/{infoDiagram-HS3SLOUP-Lvd-vDDU.js → infoDiagram-HS3SLOUP-CAsJ2eU1.js} +1 -1
  30. package/dist/assets/{isUndefined-DLcwy6eJ.js → isUndefined-CcAlyXn3.js} +1 -1
  31. package/dist/assets/{journeyDiagram-XKPGCS4Q-rVvUlw1X.js → journeyDiagram-XKPGCS4Q-Bi8XsX15.js} +1 -1
  32. package/dist/assets/{kanban-definition-3W4ZIXB7-Dg-tIUSI.js → kanban-definition-3W4ZIXB7-PTAFVsDn.js} +1 -1
  33. package/dist/assets/{layout-CYgJ9n1K.js → layout-Do-GOFdW.js} +1 -1
  34. package/dist/assets/{linear-CfAw1dgz.js → linear-CZlgolw0.js} +1 -1
  35. package/dist/assets/{min-BBMETs6R.js → min-N15IYW1Y.js} +1 -1
  36. package/dist/assets/{mindmap-definition-VGOIOE7T-DY__eUNT.js → mindmap-definition-VGOIOE7T-Dlgxv6Jo.js} +1 -1
  37. package/dist/assets/{pieDiagram-ADFJNKIX-Nr7ukKrm.js → pieDiagram-ADFJNKIX-Dr2AfIw5.js} +1 -1
  38. package/dist/assets/{quadrantDiagram-AYHSOK5B-Bb54Oaa_.js → quadrantDiagram-AYHSOK5B-B8TPuvW6.js} +1 -1
  39. package/dist/assets/{requirementDiagram-UZGBJVZJ-BtLViRZC.js → requirementDiagram-UZGBJVZJ-CdD2oP1N.js} +1 -1
  40. package/dist/assets/{sankeyDiagram-TZEHDZUN-COqbhL3I.js → sankeyDiagram-TZEHDZUN-XEMX6l5k.js} +1 -1
  41. package/dist/assets/{sequenceDiagram-WL72ISMW-DHKy94Yw.js → sequenceDiagram-WL72ISMW-BlIKpBev.js} +1 -1
  42. package/dist/assets/{stateDiagram-FKZM4ZOC-8dJVXo1X.js → stateDiagram-FKZM4ZOC-D3KGQY6v.js} +1 -1
  43. package/dist/assets/stateDiagram-v2-4FDKWEC3-Di3Nkv2n.js +1 -0
  44. package/dist/assets/{timeline-definition-IT6M3QCI-CyS6rBy_.js → timeline-definition-IT6M3QCI-TkL4mz_f.js} +1 -1
  45. package/dist/assets/{treemap-GDKQZRPO-CUM9baT2.js → treemap-GDKQZRPO-BDp_c1Vc.js} +1 -1
  46. package/dist/assets/{xychartDiagram-PRI3JC2R-BztiRmM1.js → xychartDiagram-PRI3JC2R-D0dNQImL.js} +1 -1
  47. package/dist/index.html +1 -1
  48. package/dist/orcheo.png +0 -0
  49. package/package.json +1 -1
  50. package/public/orcheo.png +0 -0
  51. package/src/features/workflow/components/dialogs/add-credential-dialog.tsx +6 -2
  52. package/src/features/workflow/components/dialogs/credentials-vault.tsx +9 -3
  53. package/src/features/workflow/components/dialogs/upload-workflow-dialog.tsx +5 -0
  54. package/src/features/workflow/components/panels/rjsf-input-widgets.tsx +27 -1
  55. package/src/features/workflow/lib/workflow-frontmatter.ts +110 -0
  56. package/src/features/workflow/lib/workflow-storage.ts +5 -2
  57. package/src/lib/config.ts +25 -3
  58. package/dist/assets/channel-D4idvlBv.js +0 -1
  59. package/dist/assets/classDiagram-2ON5EDUG-BbsIqyB3.js +0 -1
  60. package/dist/assets/classDiagram-v2-WZHVMYZB-BbsIqyB3.js +0 -1
  61. package/dist/assets/clone-BtsJ7Mgy.js +0 -1
  62. package/dist/assets/stateDiagram-v2-4FDKWEC3-_96AsFOw.js +0 -1
@@ -0,0 +1,110 @@
1
+ const FRONTMATTER_START_RE = /^# \/\/\/ (?<type>[a-zA-Z0-9_-]+)[ \t]*$/;
2
+ const FRONTMATTER_END_RE = /^# \/\/\/[ \t]*$/;
3
+
4
+ const STRING_FIELDS = new Set([
5
+ "name",
6
+ "id",
7
+ "handle",
8
+ "description",
9
+ "entrypoint",
10
+ ]);
11
+
12
+ export interface WorkflowFrontmatter {
13
+ name?: string;
14
+ id?: string;
15
+ handle?: string;
16
+ description?: string;
17
+ entrypoint?: string;
18
+ }
19
+
20
+ const parseTomlString = (value: string): string | undefined => {
21
+ const trimmed = value.trim();
22
+ if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
23
+ try {
24
+ const parsed = JSON.parse(trimmed) as unknown;
25
+ return typeof parsed === "string" && parsed.trim() ? parsed.trim() : undefined;
26
+ } catch {
27
+ return undefined;
28
+ }
29
+ }
30
+ if (trimmed.startsWith("'") && trimmed.endsWith("'")) {
31
+ const parsed = trimmed.slice(1, -1);
32
+ return parsed.trim() ? parsed.trim() : undefined;
33
+ }
34
+ return undefined;
35
+ };
36
+
37
+ const collectOrcheoFrontmatter = (source: string): string[] | undefined => {
38
+ const blocks: string[][] = [];
39
+ let currentLines: string[] = [];
40
+ let currentType: string | undefined;
41
+ let inBlock = false;
42
+
43
+ for (const line of source.split(/\r?\n/)) {
44
+ if (inBlock) {
45
+ if (FRONTMATTER_END_RE.test(line)) {
46
+ if (currentType === "orcheo") {
47
+ blocks.push(currentLines);
48
+ }
49
+ currentLines = [];
50
+ currentType = undefined;
51
+ inBlock = false;
52
+ continue;
53
+ }
54
+ currentLines.push(line);
55
+ continue;
56
+ }
57
+
58
+ const match = line.match(FRONTMATTER_START_RE);
59
+ if (match?.groups?.type) {
60
+ currentType = match.groups.type;
61
+ currentLines = [];
62
+ inBlock = true;
63
+ }
64
+ }
65
+
66
+ if (blocks.length !== 1) {
67
+ return undefined;
68
+ }
69
+ return blocks[0];
70
+ };
71
+
72
+ const toTomlLines = (contentLines: string[]): string[] =>
73
+ contentLines.flatMap((line) => {
74
+ if (!line.startsWith("#")) {
75
+ return [];
76
+ }
77
+ let stripped = line.slice(1);
78
+ if (stripped.startsWith(" ") || stripped.startsWith("\t")) {
79
+ stripped = stripped.slice(1);
80
+ }
81
+ return [stripped];
82
+ });
83
+
84
+ export const parseWorkflowFrontmatter = (
85
+ source: string,
86
+ ): WorkflowFrontmatter => {
87
+ const contentLines = collectOrcheoFrontmatter(source);
88
+ if (!contentLines) {
89
+ return {};
90
+ }
91
+
92
+ const frontmatter: WorkflowFrontmatter = {};
93
+ for (const line of toTomlLines(contentLines)) {
94
+ const trimmed = line.trim();
95
+ if (!trimmed || trimmed.startsWith("#")) {
96
+ continue;
97
+ }
98
+ const match = trimmed.match(/^([A-Za-z0-9_-]+)\s*=\s*(.+)$/);
99
+ const key = match?.[1];
100
+ if (!key || !STRING_FIELDS.has(key)) {
101
+ continue;
102
+ }
103
+ const value = parseTomlString(match[2] ?? "");
104
+ if (!value) {
105
+ continue;
106
+ }
107
+ frontmatter[key as keyof WorkflowFrontmatter] = value;
108
+ }
109
+ return frontmatter;
110
+ };
@@ -29,6 +29,7 @@ import {
29
29
  clearWorkflowUploadError,
30
30
  saveWorkflowUploadError,
31
31
  } from "./workflow-upload-errors";
32
+ import { parseWorkflowFrontmatter } from "./workflow-frontmatter";
32
33
  import type {
33
34
  ApiWorkflow,
34
35
  SaveWorkflowInput,
@@ -372,11 +373,13 @@ export const uploadWorkflowFromFiles = async (
372
373
  options?: { actor?: string },
373
374
  ): Promise<StoredWorkflow> => {
374
375
  const actor = resolveActor(options?.actor);
376
+ const frontmatter = parseWorkflowFrontmatter(script);
375
377
  const created = await request<ApiWorkflow>(API_BASE, {
376
378
  method: "POST",
377
379
  body: JSON.stringify({
378
380
  name: workflowName,
379
- description: null,
381
+ handle: frontmatter.handle ?? undefined,
382
+ description: frontmatter.description ?? null,
380
383
  tags: [],
381
384
  actor,
382
385
  }),
@@ -387,7 +390,7 @@ export const uploadWorkflowFromFiles = async (
387
390
  method: "POST",
388
391
  body: JSON.stringify({
389
392
  script,
390
- entrypoint: null,
393
+ entrypoint: frontmatter.entrypoint ?? null,
391
394
  runnable_config: config ?? null,
392
395
  metadata: { source: "studio-upload" },
393
396
  notes: null,
package/src/lib/config.ts CHANGED
@@ -1,4 +1,25 @@
1
- const DEFAULT_BACKEND_URL = "http://localhost:2025";
1
+ const VITE_DEV_ORIGINS = new Set([
2
+ "http://localhost:2026",
3
+ "http://127.0.0.1:2026",
4
+ // `vite preview`'s default port. It serves the built SPA standalone (not
5
+ // colocated with the backend), so it must fall back to the dev backend
6
+ // default rather than treating itself as the backend's own origin.
7
+ "http://localhost:4173",
8
+ "http://127.0.0.1:4173",
9
+ ]);
10
+
11
+ const getDefaultBackendUrl = (): string => {
12
+ if (typeof window === "undefined") {
13
+ return "http://localhost:2025";
14
+ }
15
+
16
+ const origin = window.location.origin;
17
+ if (origin && !VITE_DEV_ORIGINS.has(origin)) {
18
+ return origin;
19
+ }
20
+
21
+ return "http://localhost:2025";
22
+ };
2
23
 
3
24
  const trimTrailingSlash = (value: string) => value.replace(/\/+$/, "");
4
25
 
@@ -33,14 +54,15 @@ const normaliseBaseUrl = (value: string): string => {
33
54
 
34
55
  export const getBackendBaseUrl = (): string => {
35
56
  const fromEnv = (import.meta.env?.VITE_ORCHEO_BACKEND_URL ?? "") as string;
36
- const candidate = fromEnv || DEFAULT_BACKEND_URL;
57
+ const defaultBackendUrl = getDefaultBackendUrl();
58
+ const candidate = fromEnv || defaultBackendUrl;
37
59
  const normalised = normaliseBaseUrl(candidate);
38
60
 
39
61
  if (fromEnv && !isValidUrl(normalised)) {
40
62
  console.warn(
41
63
  "Invalid VITE_ORCHEO_BACKEND_URL provided, falling back to default backend URL.",
42
64
  );
43
- return normaliseBaseUrl(DEFAULT_BACKEND_URL);
65
+ return normaliseBaseUrl(defaultBackendUrl);
44
66
  }
45
67
 
46
68
  return normalised;
@@ -1 +0,0 @@
1
- import{ap as o,aq as n}from"./index-D8PZ9Puu.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-DSFMHhnv.js";import{_ as i}from"./index-D8PZ9Puu.js";import"./chunk-FMBD7UC4-2uWxVMuK.js";import"./chunk-55IACEB6-DgOteLeo.js";import"./chunk-QN33PNHL-CNE7iDzV.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-DSFMHhnv.js";import{_ as i}from"./index-D8PZ9Puu.js";import"./chunk-FMBD7UC4-2uWxVMuK.js";import"./chunk-55IACEB6-DgOteLeo.js";import"./chunk-QN33PNHL-CNE7iDzV.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram};
@@ -1 +0,0 @@
1
- import{ay as r}from"./index-D8PZ9Puu.js";var a=4;function n(o){return r(o,a)}export{n as c};
@@ -1 +0,0 @@
1
- import{s as t,b as r,a,S as s}from"./chunk-DI55MBZ5-houO_rDU.js";import{_ as i}from"./index-D8PZ9Puu.js";import"./chunk-55IACEB6-DgOteLeo.js";import"./chunk-QN33PNHL-CNE7iDzV.js";var l={parser:a,get db(){return new s(2)},renderer:r,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{l as diagram};