@loopstack/loopstack-studio 0.36.0 → 0.38.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.
- package/dist/features/documents/DocumentRenderer.js +46 -44
- package/dist/features/documents/renderers/DocumentMessageRenderer.js +23 -9
- package/dist/features/documents/renderers/LlmMessage.js +90 -50
- package/dist/features/documents/renderers/TerminalMessageRenderer.js +51 -0
- package/dist/features/documents/renderers/ansi.js +77 -0
- package/dist/features/file-explorer/components/FileExplorerPanel.js +66 -73
- package/dist/features/file-explorer/hooks/useFileExplorer.js +29 -25
- package/dist/features/file-explorer/providers/FileExplorerProvider.js +53 -53
- package/dist/features/git/components/WorkbenchGitPanel.js +36 -33
- package/dist/features/git/hooks/useGit.js +36 -33
- package/dist/features/run-view/RunView.js +1 -1
- package/dist/features/workbench/components/EnvironmentSelector.js +46 -0
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +1 -1
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +64 -55
- package/dist/hooks/useEnvironments.js +25 -31
- package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js +1 -1
- package/dist/node_modules/es-toolkit/dist/compat/object/clone.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +11 -11
- package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js +8 -8
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js +3 -3
- package/dist/node_modules/es-toolkit/dist/object/clone.js +2 -7
- package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +65 -65
- package/dist/packages/client/dist/queries/query-keys.js +5 -0
- package/dist/packages/client/dist/stream/invalidations.js +1 -0
- package/dist/packages/contracts/dist/events/client-message.schema.js +2 -1
- package/dist/packages/contracts/dist/events/index.js +1 -1
- package/dist/packages/contracts/dist/events/workspace-events.schema.js +2 -2
- package/dist/packages/contracts/dist/types/types/ui-message.type.js +15 -2
- package/package.json +4 -4
- /package/dist/features/run-view/{transcript.js → transcript-model.js} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select.js";
|
|
2
|
+
import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
function EnvironmentSelector() {
|
|
6
|
+
let u = c(11), { environments: d, selectedSlotId: f, setSelectedSlotId: p } = useWorkbenchLayout(), m;
|
|
7
|
+
u[0] === d ? m = u[1] : (m = d ?? [], u[0] = d, u[1] = m);
|
|
8
|
+
let h = m;
|
|
9
|
+
if (h.length <= 1) return null;
|
|
10
|
+
let g;
|
|
11
|
+
u[2] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(SelectTrigger, {
|
|
12
|
+
className: "h-7 text-xs",
|
|
13
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select environment" })
|
|
14
|
+
}), u[2] = g) : g = u[2];
|
|
15
|
+
let _;
|
|
16
|
+
u[3] === h ? _ = u[4] : (_ = h.map(_temp), u[3] = h, u[4] = _);
|
|
17
|
+
let v;
|
|
18
|
+
u[5] === _ ? v = u[6] : (v = /* @__PURE__ */ jsx(SelectContent, { children: _ }), u[5] = _, u[6] = v);
|
|
19
|
+
let y;
|
|
20
|
+
return u[7] !== f || u[8] !== p || u[9] !== v ? (y = /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "border-b px-3 py-2",
|
|
22
|
+
children: /* @__PURE__ */ jsxs(Select, {
|
|
23
|
+
value: f,
|
|
24
|
+
onValueChange: p,
|
|
25
|
+
children: [g, v]
|
|
26
|
+
})
|
|
27
|
+
}), u[7] = f, u[8] = p, u[9] = v, u[10] = y) : y = u[10], y;
|
|
28
|
+
}
|
|
29
|
+
function _temp(e) {
|
|
30
|
+
return /* @__PURE__ */ jsx(SelectItem, {
|
|
31
|
+
value: e.slotId,
|
|
32
|
+
className: "text-xs",
|
|
33
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
34
|
+
className: "flex items-center gap-2",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx("span", { className: `h-1.5 w-1.5 rounded-full ${e.status === "running" ? "bg-green-500" : "bg-muted-foreground/40"}` }),
|
|
37
|
+
e.envName || e.slotId,
|
|
38
|
+
e.status !== "running" && /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "text-muted-foreground",
|
|
40
|
+
children: "(stopped)"
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
})
|
|
44
|
+
}, e.slotId);
|
|
45
|
+
}
|
|
46
|
+
export { EnvironmentSelector };
|
|
@@ -136,6 +136,6 @@ function _temp2(e) {
|
|
|
136
136
|
}, e.slotId);
|
|
137
137
|
}
|
|
138
138
|
function _temp(e) {
|
|
139
|
-
return !!e.connectionUrl && (!!e.workerId || e.local);
|
|
139
|
+
return !!e.connectionUrl && (!!e.workerId || e.local) && e.status === "running";
|
|
140
140
|
}
|
|
141
141
|
export { WorkbenchPreviewPanel };
|
|
@@ -1,73 +1,82 @@
|
|
|
1
1
|
import { useWorkspaceEnvironments } from "../../../hooks/useEnvironments.js";
|
|
2
2
|
import { useOptionalStudioPreferences } from "../../../providers/StudioPreferencesProvider.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
4
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
var WorkbenchLayoutContext = createContext(null);
|
|
7
|
-
function WorkbenchLayoutProvider(
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
function WorkbenchLayoutProvider(u) {
|
|
8
|
+
let d = c(39), { children: f, workspaceId: p, workflow: m, getPreviewUrl: h, getEnvironmentPreviewUrl: g } = u, _ = useOptionalStudioPreferences(), { data: v } = useWorkspaceEnvironments(p), [y, b] = useState(null), x;
|
|
9
|
+
d[0] === Symbol.for("react.memo_cache_sentinel") ? (x = {}, d[0] = x) : x = d[0];
|
|
10
|
+
let [S, C] = useState(x), w = _ ? _.preferences.activePanel : y, T = _ ? _.preferences.panelSizes : S, [E, D] = useState(null), [O, k] = useState(""), A, j;
|
|
11
|
+
d[1] !== v || d[2] !== O ? (A = () => {
|
|
12
|
+
if (!v?.length) return;
|
|
13
|
+
let e = v.find((e) => e.slotId === O);
|
|
14
|
+
e?.status !== "running" && k((v.find(_temp) ?? e ?? v[0]).slotId);
|
|
15
|
+
}, j = [v, O], d[1] = v, d[2] = O, d[3] = A, d[4] = j) : (A = d[3], j = d[4]), useEffect(A, j);
|
|
16
|
+
let M;
|
|
17
|
+
d[5] === v ? M = d[6] : (M = v === void 0 || v.some(_temp2), d[5] = v, d[6] = M);
|
|
18
|
+
let N = M, P;
|
|
19
|
+
d[7] === Symbol.for("react.memo_cache_sentinel") ? (P = {
|
|
14
20
|
runs: "medium",
|
|
15
21
|
preview: "medium",
|
|
16
22
|
files: "medium",
|
|
17
23
|
environment: "small"
|
|
18
|
-
},
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
let P = N, F;
|
|
24
|
-
l[6] !== S || l[7] !== P ? (F = (e) => {
|
|
25
|
-
P(S === e ? null : e);
|
|
26
|
-
}, l[6] = S, l[7] = P, l[8] = F) : F = l[8];
|
|
27
|
-
let I = F, L;
|
|
28
|
-
l[9] === P ? L = l[10] : (L = () => {
|
|
29
|
-
P(null);
|
|
30
|
-
}, l[9] = P, l[10] = L);
|
|
24
|
+
}, d[7] = P) : P = d[7];
|
|
25
|
+
let F = P, I = w ? T[w] ?? F[w] ?? "small" : "small", L;
|
|
26
|
+
d[8] === _ ? L = d[9] : (L = (e) => {
|
|
27
|
+
_ ? _.setPreference("activePanel", e) : b(e);
|
|
28
|
+
}, d[8] = _, d[9] = L);
|
|
31
29
|
let R = L, z;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...C,
|
|
36
|
-
[S]: e
|
|
37
|
-
};
|
|
38
|
-
h ? h.setPreference("panelSizes", o) : x(o);
|
|
39
|
-
}, l[11] = S, l[12] = C, l[13] = h, l[14] = z) : z = l[14];
|
|
30
|
+
d[10] !== w || d[11] !== R ? (z = (e) => {
|
|
31
|
+
R(w === e ? null : e);
|
|
32
|
+
}, d[10] = w, d[11] = R, d[12] = z) : z = d[12];
|
|
40
33
|
let B = z, V;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
34
|
+
d[13] === R ? V = d[14] : (V = () => {
|
|
35
|
+
R(null);
|
|
36
|
+
}, d[13] = R, d[14] = V);
|
|
44
37
|
let H = V, U;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
panelSize: M,
|
|
54
|
-
togglePanel: I,
|
|
55
|
-
closePanel: R,
|
|
56
|
-
setPanelSize: B,
|
|
57
|
-
selectedSlotId: E,
|
|
58
|
-
setSelectedSlotId: D,
|
|
59
|
-
openPreviewWithEnvironment: H,
|
|
60
|
-
activeSectionId: w,
|
|
61
|
-
setActiveSectionId: T
|
|
62
|
-
}, l[17] = S, l[18] = w, l[19] = R, l[20] = g, l[21] = m, l[22] = p, l[23] = H, l[24] = M, l[25] = k, l[26] = E, l[27] = B, l[28] = I, l[29] = f, l[30] = d, l[31] = U) : U = l[31];
|
|
38
|
+
d[15] !== w || d[16] !== T || d[17] !== _ ? (U = (e) => {
|
|
39
|
+
if (!w) return;
|
|
40
|
+
let l = {
|
|
41
|
+
...T,
|
|
42
|
+
[w]: e
|
|
43
|
+
};
|
|
44
|
+
_ ? _.setPreference("panelSizes", l) : C(l);
|
|
45
|
+
}, d[15] = w, d[16] = T, d[17] = _, d[18] = U) : U = d[18];
|
|
63
46
|
let W = U, G;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
d[19] === R ? G = d[20] : (G = (e) => {
|
|
48
|
+
k(e), R("preview");
|
|
49
|
+
}, d[19] = R, d[20] = G);
|
|
50
|
+
let K = G, q;
|
|
51
|
+
d[21] !== w || d[22] !== E || d[23] !== H || d[24] !== v || d[25] !== g || d[26] !== h || d[27] !== K || d[28] !== I || d[29] !== N || d[30] !== O || d[31] !== W || d[32] !== B || d[33] !== m || d[34] !== p ? (q = {
|
|
52
|
+
workspaceId: p,
|
|
53
|
+
workflow: m,
|
|
54
|
+
previewPanelEnabled: N,
|
|
55
|
+
getPreviewUrl: h,
|
|
56
|
+
getEnvironmentPreviewUrl: g,
|
|
57
|
+
environments: v,
|
|
58
|
+
activePanel: w,
|
|
59
|
+
panelSize: I,
|
|
60
|
+
togglePanel: B,
|
|
61
|
+
closePanel: H,
|
|
62
|
+
setPanelSize: W,
|
|
63
|
+
selectedSlotId: O,
|
|
64
|
+
setSelectedSlotId: k,
|
|
65
|
+
openPreviewWithEnvironment: K,
|
|
66
|
+
activeSectionId: E,
|
|
67
|
+
setActiveSectionId: D
|
|
68
|
+
}, d[21] = w, d[22] = E, d[23] = H, d[24] = v, d[25] = g, d[26] = h, d[27] = K, d[28] = I, d[29] = N, d[30] = O, d[31] = W, d[32] = B, d[33] = m, d[34] = p, d[35] = q) : q = d[35];
|
|
69
|
+
let J = q, Y;
|
|
70
|
+
return d[36] !== f || d[37] !== J ? (Y = /* @__PURE__ */ jsx(WorkbenchLayoutContext.Provider, {
|
|
71
|
+
value: J,
|
|
72
|
+
children: f
|
|
73
|
+
}), d[36] = f, d[37] = J, d[38] = Y) : Y = d[38], Y;
|
|
74
|
+
}
|
|
75
|
+
function _temp2(e) {
|
|
76
|
+
return !!e.connectionUrl && (!!e.workerId || e.local) && e.status === "running";
|
|
68
77
|
}
|
|
69
78
|
function _temp(e) {
|
|
70
|
-
return
|
|
79
|
+
return e.status === "running";
|
|
71
80
|
}
|
|
72
81
|
function useWorkbenchLayout() {
|
|
73
82
|
let e = useContext(WorkbenchLayoutContext);
|
|
@@ -1,43 +1,37 @@
|
|
|
1
1
|
import { useLoopstackClient } from "../packages/react/dist/provider.js";
|
|
2
|
+
import { queryKeys } from "../packages/client/dist/queries/query-keys.js";
|
|
3
|
+
import "../packages/client/dist/index.js";
|
|
2
4
|
import "../packages/react/dist/index.js";
|
|
3
5
|
import { c } from "react/compiler-runtime";
|
|
4
6
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
7
|
var environmentsPath = (e) => `/api/v1/workspaces/${e}/environments`;
|
|
6
|
-
function useWorkspaceEnvironments(
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
queryKey: s,
|
|
18
|
-
queryFn: l,
|
|
19
|
-
enabled: u
|
|
20
|
-
}, a[6] = s, a[7] = l, a[8] = u, a[9] = d) : d = a[9], useQuery(d);
|
|
8
|
+
function useWorkspaceEnvironments(i) {
|
|
9
|
+
let o = c(10), s = useLoopstackClient(), l;
|
|
10
|
+
o[0] !== s.envKey || o[1] !== i ? (l = queryKeys.environments(s.envKey, i), o[0] = s.envKey, o[1] = i, o[2] = l) : l = o[2];
|
|
11
|
+
let u;
|
|
12
|
+
o[3] !== s.http || o[4] !== i ? (u = () => s.http.get(environmentsPath(i)), o[3] = s.http, o[4] = i, o[5] = u) : u = o[5];
|
|
13
|
+
let d = !!i, f;
|
|
14
|
+
return o[6] !== l || o[7] !== u || o[8] !== d ? (f = {
|
|
15
|
+
queryKey: l,
|
|
16
|
+
queryFn: u,
|
|
17
|
+
enabled: d
|
|
18
|
+
}, o[6] = l, o[7] = u, o[8] = d, o[9] = f) : f = o[9], useQuery(f);
|
|
21
19
|
}
|
|
22
20
|
function useReplaceEnvironments() {
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
let u;
|
|
26
|
-
i[2] !== o || i[3] !== s ? (u = (e, n) => {
|
|
27
|
-
s.invalidateQueries({ queryKey: [
|
|
28
|
-
"workspace-environments",
|
|
29
|
-
o.envKey,
|
|
30
|
-
n.workspaceId
|
|
31
|
-
] });
|
|
32
|
-
}, i[2] = o, i[3] = s, i[4] = u) : u = i[4];
|
|
21
|
+
let a = c(8), s = useLoopstackClient(), l = useQueryClient(), u;
|
|
22
|
+
a[0] === s ? u = a[1] : (u = (e) => s.http.put(environmentsPath(e.workspaceId), e.environments), a[0] = s, a[1] = u);
|
|
33
23
|
let d;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
a[2] !== s || a[3] !== l ? (d = (e, r) => {
|
|
25
|
+
l.invalidateQueries({ queryKey: queryKeys.environments(s.envKey, r.workspaceId) });
|
|
26
|
+
}, a[2] = s, a[3] = l, a[4] = d) : d = a[4];
|
|
27
|
+
let f;
|
|
28
|
+
return a[5] !== u || a[6] !== d ? (f = {
|
|
29
|
+
mutationFn: u,
|
|
30
|
+
onSuccess: d
|
|
31
|
+
}, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
|
|
38
32
|
}
|
|
39
33
|
function useResetEnvironment() {
|
|
40
|
-
let
|
|
41
|
-
return
|
|
34
|
+
let n = c(2), a = useLoopstackClient(), o;
|
|
35
|
+
return n[0] === a ? o = n[1] : (o = { mutationFn: (e) => a.http.post(`${environmentsPath(e.workspaceId)}/${e.slotId}/reset`) }, n[0] = a, n[1] = o), useMutation(o);
|
|
42
36
|
}
|
|
43
37
|
export { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var globalThis_ = typeof globalThis == "object" && globalThis || typeof window == "object" && window || typeof self == "object" && self || typeof global == "object" && global || (function() {
|
|
2
2
|
return this;
|
|
3
|
-
})()
|
|
3
|
+
})();
|
|
4
4
|
export { globalThis_ };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isArray } from "../predicate/isArray.js";
|
|
2
2
|
import { getTag } from "../_internal/getTag.js";
|
|
3
3
|
import { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from "../_internal/tags.js";
|
|
4
|
-
import {
|
|
4
|
+
import { isPrimitive } from "../../predicate/isPrimitive.js";
|
|
5
5
|
import { isTypedArray } from "../predicate/isTypedArray.js";
|
|
6
6
|
function clone(D) {
|
|
7
7
|
if (isPrimitive(D)) return D;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { getTag } from "../_internal/getTag.js";
|
|
2
|
-
import { argumentsTag, booleanTag, numberTag,
|
|
2
|
+
import { argumentsTag, booleanTag, numberTag, stringTag } from "../_internal/tags.js";
|
|
3
3
|
import { cloneDeepWith, copyProperties } from "../../object/cloneDeepWith.js";
|
|
4
|
-
function cloneDeepWith$1(
|
|
5
|
-
return cloneDeepWith(
|
|
6
|
-
let f = c?.(
|
|
4
|
+
function cloneDeepWith$1(s, c) {
|
|
5
|
+
return cloneDeepWith(s, (o, l, u, d) => {
|
|
6
|
+
let f = c?.(o, l, u, d);
|
|
7
7
|
if (f !== void 0) return f;
|
|
8
|
-
if (typeof
|
|
9
|
-
if (getTag(
|
|
8
|
+
if (typeof s == "object") {
|
|
9
|
+
if (getTag(s) === "[object Object]" && typeof s.constructor != "function") {
|
|
10
10
|
let e = {};
|
|
11
|
-
return d.set(
|
|
11
|
+
return d.set(s, e), copyProperties(e, s, u, d), e;
|
|
12
12
|
}
|
|
13
|
-
switch (Object.prototype.toString.call(
|
|
13
|
+
switch (Object.prototype.toString.call(s)) {
|
|
14
14
|
case numberTag:
|
|
15
15
|
case stringTag:
|
|
16
16
|
case booleanTag: {
|
|
17
|
-
let e = new
|
|
18
|
-
return copyProperties(e,
|
|
17
|
+
let e = new s.constructor(s?.valueOf());
|
|
18
|
+
return copyProperties(e, s), e;
|
|
19
19
|
}
|
|
20
20
|
case argumentsTag: {
|
|
21
21
|
let e = {};
|
|
22
|
-
return copyProperties(e,
|
|
22
|
+
return copyProperties(e, s), e.length = s.length, e[Symbol.iterator] = s[Symbol.iterator], e;
|
|
23
23
|
}
|
|
24
24
|
default: return;
|
|
25
25
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isPrimitive } from "../../predicate/isPrimitive.js";
|
|
1
|
+
import { isPlainObject } from "../predicate/isPlainObject.js";
|
|
3
2
|
import { getSymbols } from "../_internal/getSymbols.js";
|
|
4
3
|
import { isBuffer } from "../../predicate/isBuffer.js";
|
|
4
|
+
import { isUnsafeProperty } from "../../_internal/isUnsafeProperty.js";
|
|
5
|
+
import { isPrimitive } from "../../predicate/isPrimitive.js";
|
|
5
6
|
import { cloneDeep } from "./cloneDeep.js";
|
|
6
7
|
import { isArguments } from "../predicate/isArguments.js";
|
|
7
8
|
import { isObjectLike } from "../predicate/isObjectLike.js";
|
|
8
9
|
import { isArrayLikeObject } from "../predicate/isArrayLikeObject.js";
|
|
9
10
|
import { isTypedArray } from "../predicate/isTypedArray.js";
|
|
10
|
-
import { isPlainObject } from "../predicate/isPlainObject.js";
|
|
11
11
|
import { clone } from "../../object/clone.js";
|
|
12
12
|
function mergeWith(e, ...s) {
|
|
13
13
|
let c = s.slice(0, -1), l = s[s.length - 1], u = e;
|
|
@@ -26,9 +26,9 @@ function mergeWithDeep(f, p, m, h) {
|
|
|
26
26
|
}
|
|
27
27
|
let g = [...Object.keys(p), ...getSymbols(p)];
|
|
28
28
|
for (let s = 0; s < g.length; s++) {
|
|
29
|
-
let
|
|
30
|
-
if (isUnsafeProperty(
|
|
31
|
-
let d = p[
|
|
29
|
+
let u = g[s];
|
|
30
|
+
if (isUnsafeProperty(u)) continue;
|
|
31
|
+
let d = p[u], _ = f[u];
|
|
32
32
|
if (isArguments(d) && (d = { ...d }), isArguments(_) && (_ = { ..._ }), isBuffer(d) && (d = cloneDeep(d)), Array.isArray(d)) if (Array.isArray(_)) {
|
|
33
33
|
let e = [], s = Reflect.ownKeys(_);
|
|
34
34
|
for (let c = 0; c < s.length; c++) {
|
|
@@ -41,8 +41,8 @@ function mergeWithDeep(f, p, m, h) {
|
|
|
41
41
|
for (let s = 0; s < _.length; s++) e[s] = _[s];
|
|
42
42
|
_ = e;
|
|
43
43
|
} else _ = [];
|
|
44
|
-
let v = m(_, d,
|
|
45
|
-
v === void 0 ? Array.isArray(d) || isObjectLike(_) && isObjectLike(d) && (isPlainObject(_) || isPlainObject(d) || isTypedArray(_) || isTypedArray(d)) ? f[
|
|
44
|
+
let v = m(_, d, u, f, p, h);
|
|
45
|
+
v === void 0 ? Array.isArray(d) || isObjectLike(_) && isObjectLike(d) && (isPlainObject(_) || isPlainObject(d) || isTypedArray(_) || isTypedArray(d)) ? f[u] = mergeWithDeep(_, d, m, h) : _ == null && isPlainObject(d) ? f[u] = mergeWithDeep({}, d, m, h) : _ == null && isTypedArray(d) ? f[u] = cloneDeep(d) : (_ === void 0 || d !== void 0) && (f[u] = d) : f[u] = v;
|
|
46
46
|
}
|
|
47
47
|
return f;
|
|
48
48
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { isArrayLike } from "./isArrayLike.js";
|
|
2
1
|
import { isBuffer } from "../../predicate/isBuffer.js";
|
|
2
|
+
import { isArrayLike } from "./isArrayLike.js";
|
|
3
3
|
import { isArguments } from "./isArguments.js";
|
|
4
|
-
import { isPrototype } from "../_internal/isPrototype.js";
|
|
5
4
|
import { isTypedArray } from "./isTypedArray.js";
|
|
5
|
+
import { isPrototype } from "../_internal/isPrototype.js";
|
|
6
6
|
function isEmpty(a) {
|
|
7
7
|
if (a == null) return !0;
|
|
8
8
|
if (isArrayLike(a)) return typeof a.splice != "function" && typeof a != "string" && !isBuffer(a) && !isTypedArray(a) && !isArguments(a) ? !1 : a.length === 0;
|
|
9
|
-
if (typeof a == "object") {
|
|
9
|
+
if (typeof a == "object" || typeof a == "function") {
|
|
10
10
|
if (a instanceof Map || a instanceof Set) return a.size === 0;
|
|
11
11
|
let e = Object.keys(a);
|
|
12
12
|
return isPrototype(a) ? e.filter((e) => e !== "constructor").length === 0 : e.length === 0;
|
|
@@ -16,14 +16,9 @@ function clone(n) {
|
|
|
16
16
|
let e;
|
|
17
17
|
return e = n instanceof AggregateError ? new i(n.errors, n.message, { cause: n.cause }) : new i(n.message, { cause: n.cause }), e.stack = n.stack, Object.assign(e, n), e;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
return typeof File < "u" && n instanceof File ? new i([n], n.name, {
|
|
20
20
|
type: n.type,
|
|
21
21
|
lastModified: n.lastModified
|
|
22
|
-
});
|
|
23
|
-
if (typeof n == "object") {
|
|
24
|
-
let e = Object.create(r);
|
|
25
|
-
return Object.assign(e, n);
|
|
26
|
-
}
|
|
27
|
-
return n;
|
|
22
|
+
}) : typeof n == "object" ? Object.assign(Object.create(r), n) : n;
|
|
28
23
|
}
|
|
29
24
|
export { clone };
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { isPrimitive } from "../predicate/isPrimitive.js";
|
|
2
1
|
import { getSymbols } from "../compat/_internal/getSymbols.js";
|
|
3
2
|
import { getTag } from "../compat/_internal/getTag.js";
|
|
4
3
|
import { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from "../compat/_internal/tags.js";
|
|
5
4
|
import { isBuffer } from "../predicate/isBuffer.js";
|
|
5
|
+
import { isPrimitive } from "../predicate/isPrimitive.js";
|
|
6
6
|
import { isTypedArray } from "../predicate/isTypedArray.js";
|
|
7
|
-
function cloneDeepWith(
|
|
8
|
-
return cloneDeepWithImpl(
|
|
7
|
+
function cloneDeepWith(e, C) {
|
|
8
|
+
return cloneDeepWithImpl(e, void 0, e, /* @__PURE__ */ new Map(), C);
|
|
9
9
|
}
|
|
10
|
-
function cloneDeepWithImpl(C, w, T
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
13
|
-
if (isPrimitive(
|
|
14
|
-
if (
|
|
15
|
-
if (Array.isArray(
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
for (let
|
|
19
|
-
return Object.hasOwn(
|
|
10
|
+
function cloneDeepWithImpl(e, C, w, T = /* @__PURE__ */ new Map(), E = void 0) {
|
|
11
|
+
let D = E?.(e, C, w, T);
|
|
12
|
+
if (D !== void 0) return D;
|
|
13
|
+
if (isPrimitive(e)) return e;
|
|
14
|
+
if (T.has(e)) return T.get(e);
|
|
15
|
+
if (Array.isArray(e)) {
|
|
16
|
+
let C = Array(e.length);
|
|
17
|
+
T.set(e, C);
|
|
18
|
+
for (let D = 0; D < e.length; D++) C[D] = cloneDeepWithImpl(e[D], D, w, T, E);
|
|
19
|
+
return Object.hasOwn(e, "index") && (C.index = e.index), Object.hasOwn(e, "input") && (C.input = e.input), C;
|
|
20
20
|
}
|
|
21
|
-
if (
|
|
22
|
-
if (
|
|
23
|
-
let
|
|
24
|
-
return
|
|
21
|
+
if (e instanceof Date) return new Date(e.getTime());
|
|
22
|
+
if (e instanceof RegExp) {
|
|
23
|
+
let C = new RegExp(e.source, e.flags);
|
|
24
|
+
return C.lastIndex = e.lastIndex, C;
|
|
25
25
|
}
|
|
26
|
-
if (
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
for (let [
|
|
30
|
-
return
|
|
26
|
+
if (e instanceof Map) {
|
|
27
|
+
let C = /* @__PURE__ */ new Map();
|
|
28
|
+
T.set(e, C);
|
|
29
|
+
for (let [D, O] of e) C.set(D, cloneDeepWithImpl(O, D, w, T, E));
|
|
30
|
+
return C;
|
|
31
31
|
}
|
|
32
|
-
if (
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
for (let
|
|
36
|
-
return
|
|
32
|
+
if (e instanceof Set) {
|
|
33
|
+
let C = /* @__PURE__ */ new Set();
|
|
34
|
+
T.set(e, C);
|
|
35
|
+
for (let D of e) C.add(cloneDeepWithImpl(D, void 0, w, T, E));
|
|
36
|
+
return C;
|
|
37
37
|
}
|
|
38
|
-
if (isBuffer(
|
|
39
|
-
if (isTypedArray(
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
for (let
|
|
43
|
-
return
|
|
38
|
+
if (isBuffer(e)) return e.subarray();
|
|
39
|
+
if (isTypedArray(e)) {
|
|
40
|
+
let C = new (Object.getPrototypeOf(e)).constructor(e.length);
|
|
41
|
+
T.set(e, C);
|
|
42
|
+
for (let D = 0; D < e.length; D++) C[D] = cloneDeepWithImpl(e[D], D, w, T, E);
|
|
43
|
+
return C;
|
|
44
44
|
}
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
47
|
-
let
|
|
48
|
-
return
|
|
45
|
+
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return e.slice(0);
|
|
46
|
+
if (e instanceof DataView) {
|
|
47
|
+
let C = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
|
|
48
|
+
return T.set(e, C), copyProperties(C, e, w, T, E), C;
|
|
49
49
|
}
|
|
50
|
-
if (typeof File < "u" &&
|
|
51
|
-
let
|
|
52
|
-
return
|
|
50
|
+
if (typeof File < "u" && e instanceof File) {
|
|
51
|
+
let C = new File([e], e.name, { type: e.type });
|
|
52
|
+
return T.set(e, C), copyProperties(C, e, w, T, E), C;
|
|
53
53
|
}
|
|
54
|
-
if (typeof Blob < "u" &&
|
|
55
|
-
let
|
|
56
|
-
return
|
|
54
|
+
if (typeof Blob < "u" && e instanceof Blob) {
|
|
55
|
+
let C = new Blob([e], { type: e.type });
|
|
56
|
+
return T.set(e, C), copyProperties(C, e, w, T, E), C;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
let
|
|
60
|
-
return
|
|
58
|
+
if (e instanceof Error) {
|
|
59
|
+
let C = structuredClone(e);
|
|
60
|
+
return T.set(e, C), C.message = e.message, C.name = e.name, C.stack = e.stack, C.cause = e.cause, C.constructor = e.constructor, copyProperties(C, e, w, T, E), C;
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
63
|
-
let
|
|
64
|
-
return
|
|
62
|
+
if (e instanceof Boolean) {
|
|
63
|
+
let C = new Boolean(e.valueOf());
|
|
64
|
+
return T.set(e, C), copyProperties(C, e, w, T, E), C;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
let
|
|
68
|
-
return
|
|
66
|
+
if (e instanceof Number) {
|
|
67
|
+
let C = new Number(e.valueOf());
|
|
68
|
+
return T.set(e, C), copyProperties(C, e, w, T, E), C;
|
|
69
69
|
}
|
|
70
|
-
if (
|
|
71
|
-
let
|
|
72
|
-
return
|
|
70
|
+
if (e instanceof String) {
|
|
71
|
+
let C = new String(e.valueOf());
|
|
72
|
+
return T.set(e, C), copyProperties(C, e, w, T, E), C;
|
|
73
73
|
}
|
|
74
|
-
if (typeof
|
|
75
|
-
let
|
|
76
|
-
return
|
|
74
|
+
if (typeof e == "object" && isCloneableObject(e)) {
|
|
75
|
+
let C = Object.create(Object.getPrototypeOf(e));
|
|
76
|
+
return T.set(e, C), copyProperties(C, e, w, T, E), C;
|
|
77
77
|
}
|
|
78
|
-
return
|
|
78
|
+
return e;
|
|
79
79
|
}
|
|
80
|
-
function copyProperties(
|
|
80
|
+
function copyProperties(C, w, T = C, E, D) {
|
|
81
81
|
let O = [...Object.keys(w), ...getSymbols(w)];
|
|
82
|
-
for (let
|
|
83
|
-
let k = O[
|
|
84
|
-
(A == null || A.writable) && (
|
|
82
|
+
for (let e = 0; e < O.length; e++) {
|
|
83
|
+
let k = O[e], A = Object.getOwnPropertyDescriptor(C, k);
|
|
84
|
+
(A == null || A.writable) && (C[k] = cloneDeepWithImpl(w[k], k, T, E, D));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
function isCloneableObject(
|
|
88
|
-
switch (getTag(
|
|
87
|
+
function isCloneableObject(e) {
|
|
88
|
+
switch (getTag(e)) {
|
|
89
89
|
case argumentsTag:
|
|
90
90
|
case arrayTag:
|
|
91
91
|
case arrayBufferTag:
|
|
@@ -16,6 +16,7 @@ function resolveInvalidations(t, n) {
|
|
|
16
16
|
case "document.created": return [queryKeys.documents(n, t.workflowId)];
|
|
17
17
|
case "secret.upserted":
|
|
18
18
|
case "secret.deleted": return [queryKeys.secrets(n, t.workspaceId)];
|
|
19
|
+
case "environment.updated": return [queryKeys.environments(n, t.workspaceId)];
|
|
19
20
|
case "git.updated": return [
|
|
20
21
|
queryKeys.gitStatus(n, t.workspaceId),
|
|
21
22
|
queryKeys.gitLog(n, t.workspaceId),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentCreatedEventSchema, WorkflowCreatedEventSchema, WorkflowUpdatedEventSchema } from "./workflow-events.schema.js";
|
|
2
|
-
import { GitUpdatedEventSchema, SecretDeletedEventSchema, SecretUpsertedEventSchema } from "./workspace-events.schema.js";
|
|
2
|
+
import { EnvironmentUpdatedEventSchema, GitUpdatedEventSchema, SecretDeletedEventSchema, SecretUpsertedEventSchema } from "./workspace-events.schema.js";
|
|
3
3
|
import { LlmResponseDoneEventSchema, LlmResponseErrorEventSchema, LlmResponseStartEventSchema, LlmResponseTextDeltaEventSchema, LlmResponseThinkingDeltaEventSchema, LlmResponseToolCallEventSchema } from "./llm-events.schema.js";
|
|
4
4
|
import { StreamResetEventSchema } from "./stream-events.schema.js";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -10,6 +10,7 @@ const ClientMessageSchema = z.discriminatedUnion("type", [
|
|
|
10
10
|
SecretUpsertedEventSchema,
|
|
11
11
|
SecretDeletedEventSchema,
|
|
12
12
|
GitUpdatedEventSchema,
|
|
13
|
+
EnvironmentUpdatedEventSchema,
|
|
13
14
|
LlmResponseStartEventSchema,
|
|
14
15
|
LlmResponseTextDeltaEventSchema,
|
|
15
16
|
LlmResponseThinkingDeltaEventSchema,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClientMessageBaseSchema } from "./client-message-base.schema.js";
|
|
2
2
|
import { DocumentCreatedEventSchema, WorkflowCreatedEventSchema, WorkflowUpdatedEventSchema } from "./workflow-events.schema.js";
|
|
3
|
-
import { GitUpdatedEventSchema, SecretDeletedEventSchema, SecretUpsertedEventSchema } from "./workspace-events.schema.js";
|
|
3
|
+
import { EnvironmentUpdatedEventSchema, GitUpdatedEventSchema, SecretDeletedEventSchema, SecretUpsertedEventSchema } from "./workspace-events.schema.js";
|
|
4
4
|
import { LlmNormalizedMessageSchema, LlmResponseDoneEventSchema, LlmResponseErrorEventSchema, LlmResponseStartEventSchema, LlmResponseTextDeltaEventSchema, LlmResponseThinkingDeltaEventSchema, LlmResponseToolCallEventSchema } from "./llm-events.schema.js";
|
|
5
5
|
import { StreamResetEventSchema } from "./stream-events.schema.js";
|
|
6
6
|
import { ClientMessageSchema, isLlmResponseEvent } from "./client-message.schema.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClientMessageBaseSchema } from "./client-message-base.schema.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
var WorkspaceEventBaseSchema = ClientMessageBaseSchema.extend({ workspaceId: z.string() });
|
|
4
|
-
const SecretUpsertedEventSchema = WorkspaceEventBaseSchema.extend({ type: z.literal("secret.upserted") }), SecretDeletedEventSchema = WorkspaceEventBaseSchema.extend({ type: z.literal("secret.deleted") }), GitUpdatedEventSchema = WorkspaceEventBaseSchema.extend({ type: z.literal("git.updated") });
|
|
5
|
-
export { GitUpdatedEventSchema, SecretDeletedEventSchema, SecretUpsertedEventSchema };
|
|
4
|
+
const SecretUpsertedEventSchema = WorkspaceEventBaseSchema.extend({ type: z.literal("secret.upserted") }), SecretDeletedEventSchema = WorkspaceEventBaseSchema.extend({ type: z.literal("secret.deleted") }), GitUpdatedEventSchema = WorkspaceEventBaseSchema.extend({ type: z.literal("git.updated") }), EnvironmentUpdatedEventSchema = WorkspaceEventBaseSchema.extend({ type: z.literal("environment.updated") });
|
|
5
|
+
export { EnvironmentUpdatedEventSchema, GitUpdatedEventSchema, SecretDeletedEventSchema, SecretUpsertedEventSchema };
|