@loopstack/loopstack-studio 0.25.2 → 0.26.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 (96) hide show
  1. package/dist/api/environments.js +4 -0
  2. package/dist/api/index.js +13 -9
  3. package/dist/app/EnvironmentEmbedRoot.js +29 -19
  4. package/dist/components/data-table/DataList.js +93 -91
  5. package/dist/components/data-table/DataTable.js +128 -126
  6. package/dist/components/feedback/Snackbar.js +1 -1
  7. package/dist/components/layout/StudioSidebar.js +124 -131
  8. package/dist/components/ui/sidebar.js +2 -2
  9. package/dist/components/ui/slider.js +37 -26
  10. package/dist/components/ui-widgets/widgets/SandboxRun.js +16 -14
  11. package/dist/features/code-explorer/components/CodeExplorerTree.js +1 -0
  12. package/dist/features/code-explorer/components/FileContentViewer.js +1 -1
  13. package/dist/features/dashboard/RunItem.js +39 -37
  14. package/dist/features/debug/lib/flow-utils.js +1 -1
  15. package/dist/features/documents/DocumentRenderer.js +59 -58
  16. package/dist/features/documents/renderers/useDocumentTransition.js +29 -24
  17. package/dist/features/feature-registry/FeatureRegistryProvider.js +17 -0
  18. package/dist/features/feature-registry/index.js +1 -0
  19. package/dist/features/file-explorer/api/files.js +7 -0
  20. package/dist/features/file-explorer/components/FileExplorerPanel.js +95 -0
  21. package/dist/features/{workbench/components/RemoteFileTabsBar.js → file-explorer/components/FileTabsBar.js} +4 -4
  22. package/dist/features/{workbench/components/RemoteFileTree.js → file-explorer/components/FileTree.js} +6 -6
  23. package/dist/features/file-explorer/file-explorer-feature.js +12 -0
  24. package/dist/features/file-explorer/hooks/useFileExplorer.js +44 -0
  25. package/dist/features/file-explorer/index.js +2 -0
  26. package/dist/features/file-explorer/providers/FileExplorerProvider.js +112 -0
  27. package/dist/features/oauth/OAuthPromptRenderer.js +162 -132
  28. package/dist/features/runs/Runs.js +1 -1
  29. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +178 -0
  30. package/dist/features/secrets/index.js +1 -0
  31. package/dist/features/{documents → secrets}/renderers/SecretInputRenderer.js +17 -17
  32. package/dist/features/secrets/secrets-feature.js +14 -0
  33. package/dist/features/workbench/Workbench.js +32 -82
  34. package/dist/features/workbench/WorkflowList.js +109 -46
  35. package/dist/features/workbench/components/SidebarPanel.js +155 -0
  36. package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +82 -0
  37. package/dist/features/workbench/components/WorkbenchIconSidebar.js +128 -60
  38. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +127 -114
  39. package/dist/features/workbench/components/WorkbenchRunsPanel.js +32 -0
  40. package/dist/features/workbench/components/WorkbenchSidebarShell.js +80 -0
  41. package/dist/features/workbench/hooks/useWorkflowData.js +3 -3
  42. package/dist/features/workbench/index.js +3 -2
  43. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +60 -62
  44. package/dist/features/workspaces/Workspaces.js +1 -1
  45. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +68 -51
  46. package/dist/features/workspaces/components/WorkflowRunForm.js +1 -1
  47. package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
  48. package/dist/hooks/useEnvironmentPreviewUrl.js +13 -0
  49. package/dist/hooks/useEnvironments.js +8 -0
  50. package/dist/hooks/useWorkflows.js +28 -26
  51. package/dist/hooks/useWorkspaces.js +28 -26
  52. package/dist/index.d.ts +98 -7
  53. package/dist/index.js +8 -1
  54. package/dist/loopstack-studio.css +1 -1
  55. package/dist/node_modules/@shikijs/core/dist/index.js +105 -643
  56. package/dist/node_modules/@shikijs/engine-oniguruma/dist/index.js +135 -122
  57. package/dist/node_modules/@shikijs/langs/dist/bird2.js +1 -1
  58. package/dist/node_modules/@shikijs/langs/dist/cobol.js +1 -1
  59. package/dist/node_modules/@shikijs/langs/dist/css.js +1 -1
  60. package/dist/node_modules/@shikijs/langs/dist/dart.js +1 -1
  61. package/dist/node_modules/@shikijs/langs/dist/emacs-lisp.js +1 -1
  62. package/dist/node_modules/@shikijs/langs/dist/es-tag-sql.js +1 -1
  63. package/dist/node_modules/@shikijs/langs/dist/go.js +1 -1
  64. package/dist/node_modules/@shikijs/langs/dist/kusto.js +1 -1
  65. package/dist/node_modules/@shikijs/langs/dist/nextflow-groovy.js +1 -1
  66. package/dist/node_modules/@shikijs/langs/dist/php.js +1 -1
  67. package/dist/node_modules/@shikijs/langs/dist/ruby.js +1 -1
  68. package/dist/node_modules/@shikijs/langs/dist/typespec.js +1 -1
  69. package/dist/node_modules/@shikijs/primitive/dist/index.js +538 -0
  70. package/dist/node_modules/@shikijs/themes/dist/horizon-bright.js +1 -1
  71. package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
  72. package/dist/node_modules/shiki/dist/bundle-full.js +6 -5
  73. package/dist/node_modules/shiki/dist/chunk-CtajNgzt.js +15 -0
  74. package/dist/node_modules/shiki/dist/engine-oniguruma.js +5 -0
  75. package/dist/node_modules/shiki/dist/{langs.js → langs-bundle-full-DfKZStlK.js} +1 -1
  76. package/dist/node_modules/shiki/dist/themes.js +1 -1
  77. package/dist/pages/DashboardPage.js +54 -79
  78. package/dist/pages/DebugWorkflowDetailsPage.js +41 -55
  79. package/dist/pages/DebugWorkflowsPage.js +151 -112
  80. package/dist/pages/EmbedWorkbenchPage.js +2 -1
  81. package/dist/pages/PreviewWorkbenchPage.js +77 -59
  82. package/dist/pages/RunsListPage.js +27 -41
  83. package/dist/pages/RunsPage.js +21 -36
  84. package/dist/pages/WorkbenchPage.js +48 -70
  85. package/dist/pages/WorkflowDebugPage.js +65 -79
  86. package/dist/pages/WorkspacePage.js +59 -86
  87. package/dist/pages/WorkspaceRunsPage.js +59 -54
  88. package/dist/pages/WorkspacesPage.js +11 -27
  89. package/dist/providers/StudioPreferencesProvider.js +54 -0
  90. package/package.json +29 -29
  91. package/dist/features/workbench/components/WorkbenchFilesPanel.js +0 -67
  92. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +0 -57
  93. package/dist/features/workbench/components/WorkbenchFlowPanel.js +0 -47
  94. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +0 -182
  95. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +0 -160
  96. /package/dist/{node_modules → frontend/studio/node_modules}/@dagrejs/dagre/dist/dagre.esm.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopstack/loopstack-studio",
3
- "version": "0.25.2",
3
+ "version": "0.26.0",
4
4
  "repository": "loopstack-ai/loopstack-studio",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -50,35 +50,35 @@
50
50
  "@radix-ui/react-tabs": "^1.1.13",
51
51
  "@radix-ui/react-tooltip": "^1.2.8",
52
52
  "@radix-ui/react-use-controllable-state": "^1.2.2",
53
- "@tailwindcss/vite": "^4.2.1",
54
- "@tanstack/react-query": "^5.90.21",
55
- "@xyflow/react": "^12.10.1",
56
- "axios": "^1.13.5",
53
+ "@tailwindcss/vite": "^4.2.2",
54
+ "@tanstack/react-query": "^5.99.0",
55
+ "@xyflow/react": "^12.10.2",
56
+ "axios": "^1.15.0",
57
57
  "class-variance-authority": "^0.7.1",
58
58
  "clsx": "^2.1.1",
59
59
  "cmdk": "^1.1.1",
60
60
  "date-fns": "^4.1.0",
61
61
  "embla-carousel-react": "^8.6.0",
62
- "katex": "^0.16.33",
63
- "lodash": "^4.17.23",
64
- "lucide-react": "^0.575.0",
65
- "mermaid": "^11.12.3",
66
- "motion": "^12.34.3",
67
- "nanoid": "^5.1.6",
68
- "react": "^19.2.4",
69
- "react-dom": "^19.2.4",
70
- "react-hook-form": "^7.71.2",
62
+ "katex": "^0.16.45",
63
+ "lodash": "^4.18.1",
64
+ "lucide-react": "^1.8.0",
65
+ "mermaid": "^11.14.0",
66
+ "motion": "^12.38.0",
67
+ "nanoid": "^5.1.7",
68
+ "react": "^19.2.5",
69
+ "react-dom": "^19.2.5",
70
+ "react-hook-form": "^7.72.1",
71
71
  "react-markdown": "^10.1.0",
72
- "react-router-dom": "^7.13.1",
73
- "react-syntax-highlighter": "^16.1.0",
72
+ "react-router-dom": "^7.14.1",
73
+ "react-syntax-highlighter": "^16.1.1",
74
74
  "rehype-katex": "^7.0.1",
75
75
  "remark-gfm": "^4.0.1",
76
76
  "remark-math": "^6.0.0",
77
- "shiki": "^3.22.0",
77
+ "shiki": "^4.0.2",
78
78
  "sonner": "^2.0.7",
79
- "streamdown": "^2.3.0",
79
+ "streamdown": "^2.5.0",
80
80
  "tailwind-merge": "^3.5.0",
81
- "tailwindcss": "^4.2.1",
81
+ "tailwindcss": "^4.2.2",
82
82
  "tokenlens": "^1.3.1",
83
83
  "unique-names-generator": "^4.7.1",
84
84
  "use-stick-to-bottom": "^1.1.3",
@@ -92,29 +92,29 @@
92
92
  "@testing-library/react": "^16.3.2",
93
93
  "@testing-library/user-event": "^14.6.1",
94
94
  "@trivago/prettier-plugin-sort-imports": "^6.0.2",
95
- "@types/dagre": "^0.7.53",
95
+ "@types/dagre": "^0.7.54",
96
96
  "@types/lodash": "^4.17.24",
97
- "@types/node": "^25.3.0",
97
+ "@types/node": "^25.6.0",
98
98
  "@types/react": "^19.2.14",
99
99
  "@types/react-dom": "^19.2.3",
100
100
  "@types/react-syntax-highlighter": "^15.5.13",
101
- "@vitejs/plugin-react": "^5.1.4",
102
- "babel-plugin-react-compiler": "^19.1.0-rc.3",
103
- "eslint": "^10.0.2",
101
+ "@vitejs/plugin-react": "^5.2.0",
102
+ "babel-plugin-react-compiler": "^1.0.0",
103
+ "eslint": "^10.2.0",
104
104
  "eslint-config-prettier": "^10.1.8",
105
105
  "eslint-plugin-prettier": "^5.5.5",
106
106
  "eslint-plugin-react-refresh": "^0.5.2",
107
- "globals": "^17.3.0",
107
+ "globals": "^17.5.0",
108
108
  "husky": "^9.1.7",
109
- "lint-staged": "^16.2.7",
110
- "prettier": "^3.8.1",
109
+ "lint-staged": "^16.4.0",
110
+ "prettier": "^3.8.2",
111
111
  "prettier-plugin-tailwindcss": "^0.7.2",
112
112
  "tw-animate-css": "^1.4.0",
113
113
  "typescript": "^5.9.3",
114
- "typescript-eslint": "^8.56.1",
114
+ "typescript-eslint": "^8.58.2",
115
115
  "vite": "npm:rolldown-vite@7.3.1",
116
116
  "vite-plugin-dts": "^4.5.4",
117
- "vitest": "^4.0.18"
117
+ "vitest": "^4.1.4"
118
118
  },
119
119
  "files": [
120
120
  "dist"
@@ -1,67 +0,0 @@
1
- import { cn } from "../../../lib/utils.js";
2
- import { Button } from "../../../components/ui/button.js";
3
- import { FileContentViewer } from "../../code-explorer/components/FileContentViewer.js";
4
- import "../../code-explorer/index.js";
5
- import { useOptionalRemoteFileExplorer } from "../providers/RemoteFileExplorerProvider.js";
6
- import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
7
- import { RemoteFileTabsBar } from "./RemoteFileTabsBar.js";
8
- import RemoteFileTree_default from "./RemoteFileTree.js";
9
- import { c } from "react/compiler-runtime";
10
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { X } from "lucide-react";
12
- function WorkbenchFilesPanel() {
13
- let p = c(10), { closeSidePanel: m, fileExplorerEnabled: h } = useWorkbenchLayout(), g = useOptionalRemoteFileExplorer();
14
- if (!h) return null;
15
- let _;
16
- p[0] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("span", {
17
- className: "text-sm font-medium",
18
- children: "Files"
19
- }), p[0] = _) : _ = p[0];
20
- let v;
21
- p[1] === Symbol.for("react.memo_cache_sentinel") ? (v = cn("h-5 w-5 shrink-0 rounded transition-opacity", "hover:bg-destructive/10 hover:text-destructive"), p[1] = v) : v = p[1];
22
- let y;
23
- p[2] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" }), p[2] = y) : y = p[2];
24
- let b;
25
- p[3] === m ? b = p[4] : (b = /* @__PURE__ */ jsxs("div", {
26
- className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
27
- children: [_, /* @__PURE__ */ jsx(Button, {
28
- variant: "ghost",
29
- size: "icon",
30
- className: v,
31
- onClick: m,
32
- "aria-label": "Close Files Panel",
33
- children: y
34
- })]
35
- }), p[3] = m, p[4] = b);
36
- let x;
37
- p[5] === g ? x = p[6] : (x = /* @__PURE__ */ jsx("div", {
38
- className: "flex-1 overflow-hidden flex",
39
- children: g ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
40
- className: "w-64 shrink-0 border-r bg-muted/40",
41
- children: /* @__PURE__ */ jsx(RemoteFileTree_default, {})
42
- }), /* @__PURE__ */ jsxs("div", {
43
- className: "flex-1 flex flex-col min-w-0",
44
- children: [/* @__PURE__ */ jsx(RemoteFileTabsBar, {}), /* @__PURE__ */ jsx("div", {
45
- className: "flex-1 overflow-hidden p-3 pt-2",
46
- children: /* @__PURE__ */ jsx(FileContentViewer, {
47
- selectedFile: g.selectedFile,
48
- content: g.fileContent,
49
- isLoading: g.isContentLoading,
50
- className: "h-full"
51
- })
52
- })]
53
- })] }) : /* @__PURE__ */ jsx("div", {
54
- className: "flex-1 flex items-center justify-center p-4",
55
- children: /* @__PURE__ */ jsx("p", {
56
- className: "text-sm text-muted-foreground",
57
- children: "Remote file explorer is not available for this workspace."
58
- })
59
- })
60
- }), p[5] = g, p[6] = x);
61
- let S;
62
- return p[7] !== b || p[8] !== x ? (S = /* @__PURE__ */ jsxs("div", {
63
- className: "border-l bg-background flex w-2/3 shrink-0 flex-col",
64
- children: [b, x]
65
- }), p[7] = b, p[8] = x, p[9] = S) : S = p[9], S;
66
- }
67
- export { WorkbenchFilesPanel };
@@ -1,57 +0,0 @@
1
- import { cn } from "../../../lib/utils.js";
2
- import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
3
- import { WorkbenchSecretsPanel } from "./WorkbenchSecretsPanel.js";
4
- import WorkflowHistoryList_default from "./WorkflowHistoryList.js";
5
- import { c } from "react/compiler-runtime";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import { X } from "lucide-react";
8
- var PANEL_TITLES = {
9
- history: "Run Log",
10
- secrets: "Secrets"
11
- };
12
- function HistoryContent() {
13
- let e = c(2), { workflow: s } = useWorkbenchLayout(), u;
14
- return e[0] === s ? u = e[1] : (u = /* @__PURE__ */ jsx("div", {
15
- className: "overflow-auto p-2",
16
- children: /* @__PURE__ */ jsx(WorkflowHistoryList_default, { workflow: s })
17
- }), e[0] = s, e[1] = u), u;
18
- }
19
- function WorkbenchFloatingPanel() {
20
- let l = c(19), { activeFloatingPanel: d, closeFloatingPanel: f } = useWorkbenchLayout();
21
- if (!d) return null;
22
- let p;
23
- l[0] === Symbol.for("react.memo_cache_sentinel") ? (p = cn("border-l bg-background absolute right-0 top-0 bottom-0 z-20 flex w-80 flex-col shadow-lg", "animate-in slide-in-from-right duration-200"), l[0] = p) : p = l[0];
24
- let m = PANEL_TITLES[d], h;
25
- l[1] === m ? h = l[2] : (h = /* @__PURE__ */ jsx("span", {
26
- className: "text-sm font-medium",
27
- children: m
28
- }), l[1] = m, l[2] = h);
29
- let g;
30
- l[3] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), l[3] = g) : g = l[3];
31
- let _;
32
- l[4] === f ? _ = l[5] : (_ = /* @__PURE__ */ jsx("button", {
33
- onClick: f,
34
- className: "text-muted-foreground hover:text-foreground flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:cursor-pointer",
35
- children: g
36
- }), l[4] = f, l[5] = _);
37
- let v;
38
- l[6] !== h || l[7] !== _ ? (v = /* @__PURE__ */ jsxs("div", {
39
- className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
40
- children: [h, _]
41
- }), l[6] = h, l[7] = _, l[8] = v) : v = l[8];
42
- let y;
43
- l[9] === d ? y = l[10] : (y = d === "history" && /* @__PURE__ */ jsx(HistoryContent, {}), l[9] = d, l[10] = y);
44
- let b;
45
- l[11] === d ? b = l[12] : (b = d === "secrets" && /* @__PURE__ */ jsx(WorkbenchSecretsPanel, {}), l[11] = d, l[12] = b);
46
- let x;
47
- l[13] !== y || l[14] !== b ? (x = /* @__PURE__ */ jsxs("div", {
48
- className: "flex-1 overflow-hidden",
49
- children: [y, b]
50
- }), l[13] = y, l[14] = b, l[15] = x) : x = l[15];
51
- let S;
52
- return l[16] !== v || l[17] !== x ? (S = /* @__PURE__ */ jsxs("div", {
53
- className: p,
54
- children: [v, x]
55
- }), l[16] = v, l[17] = x, l[18] = S) : S = l[18], S;
56
- }
57
- export { WorkbenchFloatingPanel };
@@ -1,47 +0,0 @@
1
- import { useChildWorkflows, useWorkflow, useWorkflowConfigByName } from "../../../hooks/useWorkflows.js";
2
- import { ReactFlowProvider } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
3
- import WorkflowFlowViewer_default from "../../debug/components/WorkflowFlowViewer.js";
4
- import "../../debug/index.js";
5
- import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
6
- import { c } from "react/compiler-runtime";
7
- import { useMemo } from "react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- import { X } from "lucide-react";
10
- function WorkbenchFlowPanel() {
11
- let d = c(13), { workflow: f, closeSidePanel: p } = useWorkbenchLayout(), m = useWorkflow(f.id), h = useChildWorkflows(f.id), g = useWorkflowConfigByName(m.data?.className ?? void 0), _;
12
- d[0] === h.data ? _ = d[1] : (_ = h.data ?? [], d[0] = h.data, d[1] = _);
13
- let v = _, y;
14
- d[2] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx("span", {
15
- className: "text-sm font-medium",
16
- children: "Graph"
17
- }), d[2] = y) : y = d[2];
18
- let b;
19
- d[3] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), d[3] = b) : b = d[3];
20
- let x;
21
- d[4] === p ? x = d[5] : (x = /* @__PURE__ */ jsxs("div", {
22
- className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
23
- children: [y, /* @__PURE__ */ jsx("button", {
24
- onClick: p,
25
- className: "text-muted-foreground hover:text-foreground flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:cursor-pointer",
26
- children: b
27
- })]
28
- }), d[4] = p, d[5] = x);
29
- let S;
30
- d[6] !== v || d[7] !== g || d[8] !== f.id ? (S = /* @__PURE__ */ jsx("div", {
31
- className: "flex-1 overflow-hidden",
32
- children: v.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(WorkflowFlowViewer_default, {
33
- workflowId: f.id,
34
- workflows: v,
35
- workflowConfig: g.data
36
- }) }) : /* @__PURE__ */ jsx("div", {
37
- className: "text-muted-foreground flex h-full items-center justify-center text-sm",
38
- children: "No workflows found"
39
- })
40
- }), d[6] = v, d[7] = g, d[8] = f.id, d[9] = S) : S = d[9];
41
- let C;
42
- return d[10] !== x || d[11] !== S ? (C = /* @__PURE__ */ jsxs("div", {
43
- className: "border-l bg-background flex w-1/2 shrink-0 flex-col",
44
- children: [x, S]
45
- }), d[10] = x, d[11] = S, d[12] = C) : C = d[12], C;
46
- }
47
- export { WorkbenchFlowPanel };
@@ -1,182 +0,0 @@
1
- import { Button } from "../../../components/ui/button.js";
2
- import { Input } from "../../../components/ui/input.js";
3
- import { Label } from "../../../components/ui/label.js";
4
- import { useCreateSecret, useDeleteSecret, useUpdateSecret, useWorkspaceSecrets } from "../../../hooks/useSecrets.js";
5
- import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
6
- import { c } from "react/compiler-runtime";
7
- import { useState } from "react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- import { KeyRound, Loader2, Plus, Trash2 } from "lucide-react";
10
- function WorkbenchSecretsPanel() {
11
- let _ = c(46), { workflow: v } = useWorkbenchLayout(), y = v?.workspaceId, { data: b, isLoading: x } = useWorkspaceSecrets(y), S = useCreateSecret(), C = useUpdateSecret(), w = useDeleteSecret(), [T, E] = useState(""), [D, O] = useState(""), [k, A] = useState(null), [j, M] = useState(""), N;
12
- _[0] !== S || _[1] !== T || _[2] !== D || _[3] !== y ? (N = async () => {
13
- !y || !T.trim() || !D.trim() || (await S.mutateAsync({
14
- workspaceId: y,
15
- key: T.trim(),
16
- value: D
17
- }), E(""), O(""));
18
- }, _[0] = S, _[1] = T, _[2] = D, _[3] = y, _[4] = N) : N = _[4];
19
- let P = N, F;
20
- _[5] !== j || _[6] !== C || _[7] !== y ? (F = async (n) => {
21
- !y || !j || (await C.mutateAsync({
22
- workspaceId: y,
23
- id: n,
24
- value: j
25
- }), A(null), M(""));
26
- }, _[5] = j, _[6] = C, _[7] = y, _[8] = F) : F = _[8];
27
- let I = F, L;
28
- _[9] !== w || _[10] !== y ? (L = async (n) => {
29
- y && await w.mutateAsync({
30
- workspaceId: y,
31
- id: n
32
- });
33
- }, _[9] = w, _[10] = y, _[11] = L) : L = _[11];
34
- let R = L, z;
35
- _[12] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ jsxs("div", {
36
- className: "border-b px-4 py-3",
37
- children: [/* @__PURE__ */ jsxs("div", {
38
- className: "flex items-center gap-2",
39
- children: [/* @__PURE__ */ jsx(KeyRound, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("h3", {
40
- className: "text-sm font-medium",
41
- children: "Secrets"
42
- })]
43
- }), /* @__PURE__ */ jsx("p", {
44
- className: "text-muted-foreground mt-1 text-xs",
45
- children: "Manage environment variables for this workspace."
46
- })]
47
- }), _[12] = z) : z = _[12];
48
- let B;
49
- _[13] !== j || _[14] !== k || _[15] !== R || _[16] !== I || _[17] !== x || _[18] !== b ? (B = /* @__PURE__ */ jsx("div", {
50
- className: "flex-1 overflow-y-auto px-4 py-3",
51
- children: x ? /* @__PURE__ */ jsxs("div", {
52
- className: "flex items-center gap-2 py-4",
53
- children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ jsx("span", {
54
- className: "text-muted-foreground text-sm",
55
- children: "Loading..."
56
- })]
57
- }) : /* @__PURE__ */ jsxs("div", {
58
- className: "space-y-2",
59
- children: [b?.map((g) => /* @__PURE__ */ jsxs("div", {
60
- className: "bg-muted/50 flex items-center gap-2 rounded-md px-3 py-2",
61
- children: [/* @__PURE__ */ jsxs("div", {
62
- className: "flex-1",
63
- children: [/* @__PURE__ */ jsx("div", {
64
- className: "font-mono text-sm",
65
- children: g.key
66
- }), /* @__PURE__ */ jsx("div", {
67
- className: "text-muted-foreground text-xs",
68
- children: g.hasValue ? "Value set" : "No value"
69
- })]
70
- }), k === g.id ? /* @__PURE__ */ jsxs("div", {
71
- className: "flex items-center gap-1",
72
- children: [
73
- /* @__PURE__ */ jsx(Input, {
74
- type: "password",
75
- value: j,
76
- onChange: (n) => M(n.target.value),
77
- placeholder: "New value",
78
- className: "h-7 w-32 text-xs"
79
- }),
80
- /* @__PURE__ */ jsx(Button, {
81
- size: "sm",
82
- variant: "outline",
83
- className: "h-7 text-xs",
84
- onClick: () => void I(g.id),
85
- children: "Save"
86
- }),
87
- /* @__PURE__ */ jsx(Button, {
88
- size: "sm",
89
- variant: "ghost",
90
- className: "h-7 text-xs",
91
- onClick: () => {
92
- A(null), M("");
93
- },
94
- children: "Cancel"
95
- })
96
- ]
97
- }) : /* @__PURE__ */ jsxs("div", {
98
- className: "flex items-center gap-1",
99
- children: [/* @__PURE__ */ jsx(Button, {
100
- size: "sm",
101
- variant: "ghost",
102
- className: "h-7 text-xs",
103
- onClick: () => {
104
- A(g.id), M("");
105
- },
106
- children: "Update"
107
- }), /* @__PURE__ */ jsx(Button, {
108
- size: "sm",
109
- variant: "ghost",
110
- className: "h-7",
111
- onClick: () => void R(g.id),
112
- children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
113
- })]
114
- })]
115
- }, g.id)), b?.length === 0 && /* @__PURE__ */ jsx("p", {
116
- className: "text-muted-foreground py-4 text-center text-sm",
117
- children: "No secrets yet."
118
- })]
119
- })
120
- }), _[13] = j, _[14] = k, _[15] = R, _[16] = I, _[17] = x, _[18] = b, _[19] = B) : B = _[19];
121
- let V;
122
- _[20] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(Label, {
123
- className: "text-xs",
124
- children: "Add Secret"
125
- }), _[20] = V) : V = _[20];
126
- let H;
127
- _[21] === Symbol.for("react.memo_cache_sentinel") ? (H = (n) => E(n.target.value), _[21] = H) : H = _[21];
128
- let U;
129
- _[22] === T ? U = _[23] : (U = /* @__PURE__ */ jsx(Input, {
130
- value: T,
131
- onChange: H,
132
- placeholder: "KEY_NAME",
133
- className: "font-mono text-sm"
134
- }), _[22] = T, _[23] = U);
135
- let W;
136
- _[24] === Symbol.for("react.memo_cache_sentinel") ? (W = (n) => O(n.target.value), _[24] = W) : W = _[24];
137
- let G;
138
- _[25] === D ? G = _[26] : (G = /* @__PURE__ */ jsx(Input, {
139
- type: "password",
140
- value: D,
141
- onChange: W,
142
- placeholder: "Value",
143
- className: "text-sm"
144
- }), _[25] = D, _[26] = G);
145
- let K;
146
- _[27] !== S.isPending || _[28] !== T || _[29] !== D ? (K = !T.trim() || !D.trim() || S.isPending, _[27] = S.isPending, _[28] = T, _[29] = D, _[30] = K) : K = _[30];
147
- let q;
148
- _[31] === P ? q = _[32] : (q = () => void P(), _[31] = P, _[32] = q);
149
- let J;
150
- _[33] === S.isPending ? J = _[34] : (J = S.isPending ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(Plus, { className: "mr-1 h-3 w-3" }), _[33] = S.isPending, _[34] = J);
151
- let Y;
152
- _[35] !== K || _[36] !== q || _[37] !== J ? (Y = /* @__PURE__ */ jsxs(Button, {
153
- size: "sm",
154
- className: "w-full",
155
- disabled: K,
156
- onClick: q,
157
- children: [J, "Add Secret"]
158
- }), _[35] = K, _[36] = q, _[37] = J, _[38] = Y) : Y = _[38];
159
- let X;
160
- _[39] !== Y || _[40] !== U || _[41] !== G ? (X = /* @__PURE__ */ jsx("div", {
161
- className: "border-t px-4 py-3",
162
- children: /* @__PURE__ */ jsxs("div", {
163
- className: "space-y-2",
164
- children: [
165
- V,
166
- U,
167
- G,
168
- Y
169
- ]
170
- })
171
- }), _[39] = Y, _[40] = U, _[41] = G, _[42] = X) : X = _[42];
172
- let Z;
173
- return _[43] !== X || _[44] !== B ? (Z = /* @__PURE__ */ jsxs("div", {
174
- className: "flex h-full flex-col",
175
- children: [
176
- z,
177
- B,
178
- X
179
- ]
180
- }), _[43] = X, _[44] = B, _[45] = Z) : Z = _[45], Z;
181
- }
182
- export { WorkbenchSecretsPanel };
@@ -1,160 +0,0 @@
1
- import { c } from "react/compiler-runtime";
2
- import { createContext, useCallback, useContext, useMemo, useState } from "react";
3
- import { jsx } from "react/jsx-runtime";
4
- import { useQuery, useQueryClient } from "@tanstack/react-query";
5
- function getBaseUrl() {
6
- return "http://localhost:8000";
7
- }
8
- async function refreshToken() {
9
- return (await fetch(`${getBaseUrl()}/api/v1/auth/refresh`, {
10
- method: "POST",
11
- credentials: "include"
12
- })).ok;
13
- }
14
- async function fetchWithRefresh(e, l) {
15
- let u = await fetch(e, l);
16
- return (u.status === 401 || u.status === 403) && await refreshToken() ? fetch(e, l) : u;
17
- }
18
- var RemoteFileExplorerContext = createContext(null);
19
- function RemoteFileExplorerProvider(l) {
20
- let u = c(45), { children: d } = l, f = useQueryClient(), p;
21
- u[0] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ new Set(), u[0] = p) : p = u[0];
22
- let [m, h] = useState(p), g;
23
- u[1] === Symbol.for("react.memo_cache_sentinel") ? (g = [], u[1] = g) : g = u[1];
24
- let [_, v] = useState(g), [y, b] = useState(null), x;
25
- u[2] === Symbol.for("react.memo_cache_sentinel") ? (x = {
26
- queryKey: ["remote-agent-file-tree"],
27
- queryFn: _temp,
28
- staleTime: 3e4,
29
- retry: !1
30
- }, u[2] = x) : x = u[2];
31
- let S = useQuery(x), C = y?.path, w;
32
- u[3] === C ? w = u[4] : (w = ["remote-agent-file-content", C], u[3] = C, u[4] = w);
33
- let T;
34
- u[5] === y ? T = u[6] : (T = async () => {
35
- let e = getBaseUrl(), l = new URL(`${e}/api/v1/files/read`);
36
- l.searchParams.set("path", y.path);
37
- let u = await fetchWithRefresh(l.toString(), { credentials: "include" });
38
- if (!u.ok) {
39
- let e = await u.text();
40
- throw Error(`Failed to read file (${u.status}): ${e}`);
41
- }
42
- return (await u.json()).content;
43
- }, u[5] = y, u[6] = T);
44
- let E = !!y && y.type === "file", D;
45
- u[7] !== w || u[8] !== T || u[9] !== E ? (D = {
46
- queryKey: w,
47
- queryFn: T,
48
- enabled: E,
49
- staleTime: 15e3,
50
- retry: !1
51
- }, u[7] = w, u[8] = T, u[9] = E, u[10] = D) : D = u[10];
52
- let O = useQuery(D), k;
53
- u[11] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => {
54
- h((l) => {
55
- let u = new Set(l);
56
- return u.has(e) ? u.delete(e) : u.add(e), u;
57
- });
58
- }, u[11] = k) : k = u[11];
59
- let A = k, j;
60
- u[12] === Symbol.for("react.memo_cache_sentinel") ? (j = (e) => {
61
- e.type === "file" && (b(e), v((l) => l.some((l) => l.path === e.path) ? l : [...l, e]));
62
- }, u[12] = j) : j = u[12];
63
- let M = j, N;
64
- u[13] === y?.path ? N = u[14] : (N = (e) => {
65
- v((l) => {
66
- let u = l.filter((l) => l.path !== e.path);
67
- if (y?.path === e.path) if (u.length > 0) {
68
- let d = l.findIndex((l) => l.path === e.path);
69
- b(u[Math.max(0, d - 1)]);
70
- } else b(null);
71
- return u;
72
- });
73
- }, u[13] = y?.path, u[14] = N);
74
- let P = N, F;
75
- u[15] === y ? F = u[16] : (F = () => {
76
- y && v((e) => {
77
- let l = e.filter((e) => e.path !== y.path);
78
- if (l.length > 0) {
79
- let u = e.findIndex((e) => e.path === y.path);
80
- b(l[Math.max(0, u - 1)]);
81
- } else b(null);
82
- return l;
83
- });
84
- }, u[15] = y, u[16] = F);
85
- let I = F, L;
86
- u[17] === Symbol.for("react.memo_cache_sentinel") ? (L = () => {
87
- v([]), b(null);
88
- }, u[17] = L) : L = u[17];
89
- let R = L, z;
90
- u[18] === Symbol.for("react.memo_cache_sentinel") ? (z = (e) => {
91
- v([e]), b(e);
92
- }, u[18] = z) : z = u[18];
93
- let B = z, V;
94
- u[19] === y ? V = u[20] : (V = (e) => {
95
- v((l) => {
96
- let u = l.findIndex((l) => l.path === e.path);
97
- if (u <= 0) return l;
98
- let d = l.slice(u);
99
- return y && l.findIndex((e) => e.path === y.path) < u && b(e), d;
100
- });
101
- }, u[19] = y, u[20] = V);
102
- let H = V, U;
103
- u[21] === y ? U = u[22] : (U = (e) => {
104
- v((l) => {
105
- let u = l.findIndex((l) => l.path === e.path);
106
- if (u < 0 || u >= l.length - 1) return l;
107
- let d = l.slice(0, u + 1);
108
- return y && l.findIndex((e) => e.path === y.path) > u && b(e), d;
109
- });
110
- }, u[21] = y, u[22] = U);
111
- let W = U, G;
112
- u[23] === f ? G = u[24] : (G = () => {
113
- f.invalidateQueries({ queryKey: ["remote-agent-file-tree"] });
114
- }, u[23] = f, u[24] = G);
115
- let K = G, q;
116
- u[25] === S.data ? q = u[26] : (q = S.data ?? [], u[25] = S.data, u[26] = q);
117
- let J = S.isLoading && !S.data, Y = O.data ?? null, X = O.isLoading && !!y, Z;
118
- u[27] !== I || u[28] !== P || u[29] !== H || u[30] !== W || u[31] !== m || u[32] !== _ || u[33] !== K || u[34] !== y || u[35] !== q || u[36] !== J || u[37] !== Y || u[38] !== X || u[39] !== S.error || u[40] !== S.isFetching ? (Z = {
119
- nodes: q,
120
- isTreeLoading: J,
121
- treeError: S.error,
122
- openFiles: _,
123
- selectedFile: y,
124
- fileContent: Y,
125
- isContentLoading: X,
126
- expandedFolders: m,
127
- toggleFolder: A,
128
- selectFile: M,
129
- closeFile: P,
130
- closeAll: R,
131
- closeOthers: B,
132
- closeToLeft: H,
133
- closeToRight: W,
134
- clearSelection: I,
135
- refreshTree: K,
136
- isFetchingTree: S.isFetching
137
- }, u[27] = I, u[28] = P, u[29] = H, u[30] = W, u[31] = m, u[32] = _, u[33] = K, u[34] = y, u[35] = q, u[36] = J, u[37] = Y, u[38] = X, u[39] = S.error, u[40] = S.isFetching, u[41] = Z) : Z = u[41];
138
- let Q = Z, $;
139
- return u[42] !== d || u[43] !== Q ? ($ = /* @__PURE__ */ jsx(RemoteFileExplorerContext.Provider, {
140
- value: Q,
141
- children: d
142
- }), u[42] = d, u[43] = Q, u[44] = $) : $ = u[44], $;
143
- }
144
- async function _temp() {
145
- let e = await fetchWithRefresh(`${getBaseUrl()}/api/v1/files/tree?path=./src`, { credentials: "include" });
146
- if (!e.ok) {
147
- let l = await e.text();
148
- throw Error(`Failed to load file tree (${e.status}): ${l}`);
149
- }
150
- return await e.json();
151
- }
152
- function useRemoteFileExplorer() {
153
- let e = useContext(RemoteFileExplorerContext);
154
- if (!e) throw Error("useRemoteFileExplorer must be used within RemoteFileExplorerProvider");
155
- return e;
156
- }
157
- function useOptionalRemoteFileExplorer() {
158
- return useContext(RemoteFileExplorerContext);
159
- }
160
- export { RemoteFileExplorerProvider, useOptionalRemoteFileExplorer, useRemoteFileExplorer };