freestyle-sandboxes 0.0.45 → 0.0.47
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/ai/inde.d.cts +71 -0
- package/dist/ai/inde.d.mts +71 -0
- package/dist/ai/index.d.cts +1 -1
- package/dist/ai/index.d.mts +1 -1
- package/dist/expo/inde.d.cts +6 -0
- package/dist/expo/inde.d.mts +6 -0
- package/dist/inde.d.cts +192 -0
- package/dist/inde.d.mts +192 -0
- package/dist/index.cjs +160 -49
- package/dist/index.d.cts +83 -47
- package/dist/index.d.mts +83 -47
- package/dist/index.mjs +160 -49
- package/dist/langgraph/inde.d.cts +2162 -0
- package/dist/langgraph/inde.d.mts +2162 -0
- package/dist/langgraph/index.d.cts +1 -1
- package/dist/langgraph/index.d.mts +1 -1
- package/dist/mastra/inde.d.cts +2623 -0
- package/dist/mastra/inde.d.mts +2623 -0
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.mts +1 -1
- package/dist/react/dev-server/index..d.cts +28 -0
- package/dist/react/dev-server/index..d.mts +28 -0
- package/dist/react/dev-server/index.cjs +83 -0
- package/dist/react/dev-server/index.d.cts +28 -0
- package/dist/react/dev-server/index.d.mts +28 -0
- package/dist/react/dev-server/index.mjs +80 -0
- package/dist/types.gen-CIf3ciN7.d.ts +807 -0
- package/dist/utils/inde.d.cts +10 -0
- package/dist/utils/inde.d.mts +10 -0
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/openapi/types.gen.ts +27 -6
- package/openapi.json +4649 -1
- package/package.json +14 -2
- package/src/index.ts +222 -105
- package/src/react/dev-server/index.tsx +111 -0
- package/src/react/dev-server/types.ts +5 -0
- package/tsconfig.json +1 -1
package/dist/mastra/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { Transform } from 'stream';
|
|
|
5
5
|
import { EventEmitter } from 'events';
|
|
6
6
|
import { ServerResponse, IncomingMessage } from 'http';
|
|
7
7
|
import { WorkerOptions } from 'worker_threads';
|
|
8
|
-
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-
|
|
8
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-CIf3ciN7.js';
|
|
9
9
|
import 'node:http';
|
|
10
10
|
|
|
11
11
|
// Type definitions for pino-std-serializers 2.4
|
package/dist/mastra/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { Transform } from 'stream';
|
|
|
5
5
|
import { EventEmitter } from 'events';
|
|
6
6
|
import { ServerResponse, IncomingMessage } from 'http';
|
|
7
7
|
import { WorkerOptions } from 'worker_threads';
|
|
8
|
-
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-
|
|
8
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-CIf3ciN7.js';
|
|
9
9
|
import 'node:http';
|
|
10
10
|
|
|
11
11
|
// Type definitions for pino-std-serializers 2.4
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type RequestDevServerActions = {
|
|
4
|
+
requestDevServer: (args: {
|
|
5
|
+
repoUrl: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
ephemeralUrl: string;
|
|
8
|
+
devCommandRunning: boolean;
|
|
9
|
+
installCommandRunning: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare function DefaultLoadingComponent({ installCommandRunning, }: {
|
|
14
|
+
devCommandRunning: boolean;
|
|
15
|
+
installCommandRunning: boolean;
|
|
16
|
+
serverStarting: boolean;
|
|
17
|
+
}): any;
|
|
18
|
+
declare function FreestyleDevServer({ repoUrl, loadingComponent, actions, }: {
|
|
19
|
+
repoUrl: string;
|
|
20
|
+
loadingComponent?: (props: {
|
|
21
|
+
devCommandRunning: boolean;
|
|
22
|
+
installCommandRunning: boolean;
|
|
23
|
+
serverStarting: boolean;
|
|
24
|
+
}) => React.ReactNode;
|
|
25
|
+
actions: RequestDevServerActions;
|
|
26
|
+
}): any;
|
|
27
|
+
|
|
28
|
+
export { DefaultLoadingComponent, FreestyleDevServer };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type RequestDevServerActions = {
|
|
4
|
+
requestDevServer: (args: {
|
|
5
|
+
repoUrl: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
ephemeralUrl: string;
|
|
8
|
+
devCommandRunning: boolean;
|
|
9
|
+
installCommandRunning: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare function DefaultLoadingComponent({ installCommandRunning, }: {
|
|
14
|
+
devCommandRunning: boolean;
|
|
15
|
+
installCommandRunning: boolean;
|
|
16
|
+
serverStarting: boolean;
|
|
17
|
+
}): any;
|
|
18
|
+
declare function FreestyleDevServer({ repoUrl, loadingComponent, actions, }: {
|
|
19
|
+
repoUrl: string;
|
|
20
|
+
loadingComponent?: (props: {
|
|
21
|
+
devCommandRunning: boolean;
|
|
22
|
+
installCommandRunning: boolean;
|
|
23
|
+
serverStarting: boolean;
|
|
24
|
+
}) => React.ReactNode;
|
|
25
|
+
actions: RequestDevServerActions;
|
|
26
|
+
}): any;
|
|
27
|
+
|
|
28
|
+
export { DefaultLoadingComponent, FreestyleDevServer };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactQuery = require('@tanstack/react-query');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const queryClient = new reactQuery.QueryClient();
|
|
7
|
+
function DefaultLoadingComponent({
|
|
8
|
+
installCommandRunning
|
|
9
|
+
}) {
|
|
10
|
+
let loadingText = "Starting container...";
|
|
11
|
+
if (installCommandRunning) {
|
|
12
|
+
loadingText = "Installing dependencies...";
|
|
13
|
+
} else {
|
|
14
|
+
loadingText = "Starting dev server...";
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ React.createElement(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
style: {
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "column",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
justifyContent: "center",
|
|
24
|
+
height: "100%"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
loadingText
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function FreestyleDevServer({
|
|
31
|
+
repoUrl,
|
|
32
|
+
loadingComponent,
|
|
33
|
+
actions
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ React.createElement(reactQuery.QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React.createElement(
|
|
36
|
+
FreestyleDevServerInner,
|
|
37
|
+
{
|
|
38
|
+
loadingComponent: loadingComponent ?? DefaultLoadingComponent,
|
|
39
|
+
repoUrl,
|
|
40
|
+
actions
|
|
41
|
+
}
|
|
42
|
+
));
|
|
43
|
+
}
|
|
44
|
+
function FreestyleDevServerInner({
|
|
45
|
+
repoUrl,
|
|
46
|
+
loadingComponent,
|
|
47
|
+
actions: { requestDevServer }
|
|
48
|
+
}) {
|
|
49
|
+
const { data, isLoading } = reactQuery.useQuery({
|
|
50
|
+
queryKey: ["dev-server", repoUrl],
|
|
51
|
+
queryFn: async () => await requestDevServer({ repoUrl }),
|
|
52
|
+
refetchInterval: 1e3
|
|
53
|
+
});
|
|
54
|
+
if (isLoading) {
|
|
55
|
+
return loadingComponent({
|
|
56
|
+
devCommandRunning: false,
|
|
57
|
+
installCommandRunning: false,
|
|
58
|
+
serverStarting: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (!data?.devCommandRunning) {
|
|
62
|
+
return loadingComponent({
|
|
63
|
+
devCommandRunning: data?.devCommandRunning ?? false,
|
|
64
|
+
installCommandRunning: data?.installCommandRunning ?? false,
|
|
65
|
+
serverStarting: false
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ React.createElement(
|
|
69
|
+
"iframe",
|
|
70
|
+
{
|
|
71
|
+
sandbox: "allow-scripts allow-same-origin allow-forms",
|
|
72
|
+
src: data.ephemeralUrl,
|
|
73
|
+
style: {
|
|
74
|
+
width: "100%",
|
|
75
|
+
height: "100%",
|
|
76
|
+
border: "none"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
exports.DefaultLoadingComponent = DefaultLoadingComponent;
|
|
83
|
+
exports.FreestyleDevServer = FreestyleDevServer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type RequestDevServerActions = {
|
|
4
|
+
requestDevServer: (args: {
|
|
5
|
+
repoUrl: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
ephemeralUrl: string;
|
|
8
|
+
devCommandRunning: boolean;
|
|
9
|
+
installCommandRunning: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare function DefaultLoadingComponent({ installCommandRunning, }: {
|
|
14
|
+
devCommandRunning: boolean;
|
|
15
|
+
installCommandRunning: boolean;
|
|
16
|
+
serverStarting: boolean;
|
|
17
|
+
}): any;
|
|
18
|
+
declare function FreestyleDevServer({ repoUrl, loadingComponent, actions, }: {
|
|
19
|
+
repoUrl: string;
|
|
20
|
+
loadingComponent?: (props: {
|
|
21
|
+
devCommandRunning: boolean;
|
|
22
|
+
installCommandRunning: boolean;
|
|
23
|
+
serverStarting: boolean;
|
|
24
|
+
}) => React.ReactNode;
|
|
25
|
+
actions: RequestDevServerActions;
|
|
26
|
+
}): any;
|
|
27
|
+
|
|
28
|
+
export { DefaultLoadingComponent, FreestyleDevServer };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type RequestDevServerActions = {
|
|
4
|
+
requestDevServer: (args: {
|
|
5
|
+
repoUrl: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
ephemeralUrl: string;
|
|
8
|
+
devCommandRunning: boolean;
|
|
9
|
+
installCommandRunning: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
declare function DefaultLoadingComponent({ installCommandRunning, }: {
|
|
14
|
+
devCommandRunning: boolean;
|
|
15
|
+
installCommandRunning: boolean;
|
|
16
|
+
serverStarting: boolean;
|
|
17
|
+
}): any;
|
|
18
|
+
declare function FreestyleDevServer({ repoUrl, loadingComponent, actions, }: {
|
|
19
|
+
repoUrl: string;
|
|
20
|
+
loadingComponent?: (props: {
|
|
21
|
+
devCommandRunning: boolean;
|
|
22
|
+
installCommandRunning: boolean;
|
|
23
|
+
serverStarting: boolean;
|
|
24
|
+
}) => React.ReactNode;
|
|
25
|
+
actions: RequestDevServerActions;
|
|
26
|
+
}): any;
|
|
27
|
+
|
|
28
|
+
export { DefaultLoadingComponent, FreestyleDevServer };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
const queryClient = new QueryClient();
|
|
5
|
+
function DefaultLoadingComponent({
|
|
6
|
+
installCommandRunning
|
|
7
|
+
}) {
|
|
8
|
+
let loadingText = "Starting container...";
|
|
9
|
+
if (installCommandRunning) {
|
|
10
|
+
loadingText = "Installing dependencies...";
|
|
11
|
+
} else {
|
|
12
|
+
loadingText = "Starting dev server...";
|
|
13
|
+
}
|
|
14
|
+
return /* @__PURE__ */ React.createElement(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
style: {
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "column",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "center",
|
|
22
|
+
height: "100%"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
loadingText
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function FreestyleDevServer({
|
|
29
|
+
repoUrl,
|
|
30
|
+
loadingComponent,
|
|
31
|
+
actions
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ React.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React.createElement(
|
|
34
|
+
FreestyleDevServerInner,
|
|
35
|
+
{
|
|
36
|
+
loadingComponent: loadingComponent ?? DefaultLoadingComponent,
|
|
37
|
+
repoUrl,
|
|
38
|
+
actions
|
|
39
|
+
}
|
|
40
|
+
));
|
|
41
|
+
}
|
|
42
|
+
function FreestyleDevServerInner({
|
|
43
|
+
repoUrl,
|
|
44
|
+
loadingComponent,
|
|
45
|
+
actions: { requestDevServer }
|
|
46
|
+
}) {
|
|
47
|
+
const { data, isLoading } = useQuery({
|
|
48
|
+
queryKey: ["dev-server", repoUrl],
|
|
49
|
+
queryFn: async () => await requestDevServer({ repoUrl }),
|
|
50
|
+
refetchInterval: 1e3
|
|
51
|
+
});
|
|
52
|
+
if (isLoading) {
|
|
53
|
+
return loadingComponent({
|
|
54
|
+
devCommandRunning: false,
|
|
55
|
+
installCommandRunning: false,
|
|
56
|
+
serverStarting: true
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (!data?.devCommandRunning) {
|
|
60
|
+
return loadingComponent({
|
|
61
|
+
devCommandRunning: data?.devCommandRunning ?? false,
|
|
62
|
+
installCommandRunning: data?.installCommandRunning ?? false,
|
|
63
|
+
serverStarting: false
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ React.createElement(
|
|
67
|
+
"iframe",
|
|
68
|
+
{
|
|
69
|
+
sandbox: "allow-scripts allow-same-origin allow-forms",
|
|
70
|
+
src: data.ephemeralUrl,
|
|
71
|
+
style: {
|
|
72
|
+
width: "100%",
|
|
73
|
+
height: "100%",
|
|
74
|
+
border: "none"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { DefaultLoadingComponent, FreestyleDevServer };
|