@pulse-editor/cli 0.1.1-beta.9 → 0.1.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.
- package/dist/app.js +4 -1
- package/dist/components/commands/build.js +18 -33
- package/dist/components/commands/code.d.ts +5 -0
- package/dist/components/commands/code.js +342 -0
- package/dist/components/commands/create.js +38 -12
- package/dist/components/commands/dev.js +35 -8
- package/dist/components/commands/login.d.ts +2 -2
- package/dist/components/commands/login.js +110 -26
- package/dist/components/commands/preview.js +50 -11
- package/dist/components/commands/publish.js +23 -37
- package/dist/components/commands/{start copy.d.ts → skill.d.ts} +1 -1
- package/dist/components/commands/skill.js +230 -0
- package/dist/components/commands/{preview copy.d.ts → upgrade.d.ts} +1 -1
- package/dist/components/commands/upgrade.js +53 -0
- package/dist/lib/backend/publish-app.d.ts +1 -0
- package/dist/lib/backend/publish-app.js +26 -0
- package/dist/lib/backend-url.d.ts +1 -0
- package/dist/lib/backend-url.js +3 -0
- package/dist/lib/cli-flags.d.ts +22 -0
- package/dist/lib/cli-flags.js +22 -0
- package/dist/lib/manual.js +40 -0
- package/dist/lib/server/express.js +81 -41
- package/dist/lib/server/preview/backend/load-remote.cjs +28 -18
- package/dist/lib/server/utils.js +3 -3
- package/dist/lib/token.js +2 -3
- package/dist/lib/webpack/compile.d.ts +2 -0
- package/dist/lib/webpack/compile.js +30 -0
- package/dist/lib/webpack/configs/mf-client.d.ts +3 -0
- package/dist/lib/webpack/configs/mf-client.js +184 -0
- package/dist/lib/webpack/configs/mf-server.d.ts +2 -0
- package/dist/lib/webpack/configs/mf-server.js +463 -0
- package/dist/lib/webpack/configs/preview.d.ts +3 -0
- package/dist/lib/webpack/configs/preview.js +117 -0
- package/dist/lib/webpack/configs/utils.d.ts +10 -0
- package/dist/lib/webpack/configs/utils.js +172 -0
- package/dist/lib/webpack/dist/pregistered-actions.d.ts +2 -0
- package/dist/lib/webpack/dist/pulse.config.d.ts +7 -0
- package/dist/lib/webpack/dist/src/lib/agents/code-modifier-agent.d.ts +2 -0
- package/dist/lib/webpack/dist/src/lib/agents/vibe-coding-agent.d.ts +3 -0
- package/dist/lib/webpack/dist/src/lib/mcp/utils.d.ts +3 -0
- package/dist/lib/webpack/dist/src/lib/streaming/message-stream-controller.d.ts +10 -0
- package/dist/lib/webpack/dist/src/lib/types.d.ts +58 -0
- package/dist/lib/webpack/dist/src/server-function/generate-code/v1/generate.d.ts +5 -0
- package/dist/lib/webpack/dist/src/server-function/generate-code/v2/generate.d.ts +1 -0
- package/dist/lib/webpack/tsconfig.server.json +19 -0
- package/dist/lib/webpack/webpack-config.d.ts +1 -0
- package/dist/lib/webpack/webpack-config.js +24 -0
- package/dist/lib/webpack/webpack.config.d.ts +2 -0
- package/dist/lib/webpack/webpack.config.js +527 -0
- package/package.json +31 -20
- package/readme.md +7 -1
- package/dist/components/commands/preview copy.js +0 -14
- package/dist/components/commands/start copy.js +0 -14
- package/dist/lib/deps.d.ts +0 -1
- package/dist/lib/deps.js +0 -5
- package/dist/lib/node_module_bin.d.ts +0 -1
- package/dist/lib/node_module_bin.js +0 -7
- package/dist/lib/server/preview/backend/index.d.ts +0 -1
- package/dist/lib/server/preview/backend/index.js +0 -23
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
5
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { getLocalNetworkIP, loadPulseConfig } from "./utils.js";
|
|
8
|
+
class PreviewClientPlugin {
|
|
9
|
+
projectDirName;
|
|
10
|
+
pulseConfig;
|
|
11
|
+
origin;
|
|
12
|
+
constructor(pulseConfig) {
|
|
13
|
+
this.projectDirName = process.cwd();
|
|
14
|
+
this.pulseConfig = pulseConfig;
|
|
15
|
+
this.origin = getLocalNetworkIP();
|
|
16
|
+
}
|
|
17
|
+
apply(compiler) {
|
|
18
|
+
let isFirstRun = true;
|
|
19
|
+
// Before build starts
|
|
20
|
+
compiler.hooks.watchRun.tap("ReloadMessagePlugin", () => {
|
|
21
|
+
if (!isFirstRun) {
|
|
22
|
+
console.log("[client-preview] 🔄 Reloading app...");
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log("[client-preview] 🔄 Building app...");
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
// After build finishes
|
|
29
|
+
compiler.hooks.done.tap("ReloadMessagePlugin", () => {
|
|
30
|
+
if (isFirstRun) {
|
|
31
|
+
const previewStartupMessage = `
|
|
32
|
+
🎉 Your Pulse extension preview \x1b[1m${this.pulseConfig.displayName}\x1b[0m is LIVE!
|
|
33
|
+
|
|
34
|
+
⚡️ Local: http://localhost:3030
|
|
35
|
+
⚡️ Network: http://${this.origin}:3030
|
|
36
|
+
|
|
37
|
+
✨ Try it out in your browser and let the magic happen! 🚀
|
|
38
|
+
`;
|
|
39
|
+
console.log("[client-preview] ✅ Successfully built preview.");
|
|
40
|
+
const skillActions = this.pulseConfig?.actions || [];
|
|
41
|
+
const actionNames = skillActions.map((a) => a.name);
|
|
42
|
+
if (actionNames.length > 0) {
|
|
43
|
+
console.log("\n🎯 Skill action endpoints:\n" +
|
|
44
|
+
actionNames.map((n) => ` - /skill/${n}`).join("\n") +
|
|
45
|
+
"\n");
|
|
46
|
+
}
|
|
47
|
+
console.log(previewStartupMessage);
|
|
48
|
+
isFirstRun = false;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
console.log("[client-preview] ✅ Reload finished");
|
|
52
|
+
}
|
|
53
|
+
// Write pulse config to dist
|
|
54
|
+
fs.writeFileSync(path.resolve(this.projectDirName, "dist/pulse.config.json"), JSON.stringify(this.pulseConfig, null, 2));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export async function makePreviewClientConfig(mode) {
|
|
59
|
+
const projectDirName = process.cwd();
|
|
60
|
+
const pulseConfig = await loadPulseConfig();
|
|
61
|
+
return {
|
|
62
|
+
mode: mode,
|
|
63
|
+
entry: {
|
|
64
|
+
main: "./node_modules/.pulse/server/preview/frontend/index.js",
|
|
65
|
+
},
|
|
66
|
+
output: {
|
|
67
|
+
path: path.resolve(projectDirName, "dist/client"),
|
|
68
|
+
},
|
|
69
|
+
resolve: {
|
|
70
|
+
extensions: [".ts", ".tsx", ".js"],
|
|
71
|
+
},
|
|
72
|
+
plugins: [
|
|
73
|
+
new HtmlWebpackPlugin({
|
|
74
|
+
template: "./node_modules/.pulse/server/preview/frontend/index.html",
|
|
75
|
+
}),
|
|
76
|
+
new MiniCssExtractPlugin({
|
|
77
|
+
filename: "globals.css",
|
|
78
|
+
}),
|
|
79
|
+
new CopyWebpackPlugin({
|
|
80
|
+
patterns: [{ from: "src/assets", to: "assets" }],
|
|
81
|
+
}),
|
|
82
|
+
new PreviewClientPlugin(pulseConfig),
|
|
83
|
+
],
|
|
84
|
+
watchOptions: {
|
|
85
|
+
ignored: /src\/server-function/,
|
|
86
|
+
},
|
|
87
|
+
module: {
|
|
88
|
+
rules: [
|
|
89
|
+
{
|
|
90
|
+
test: /\.tsx?$/,
|
|
91
|
+
use: "ts-loader",
|
|
92
|
+
exclude: [/node_modules/, /dist/],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
test: /\.css$/i,
|
|
96
|
+
use: [
|
|
97
|
+
MiniCssExtractPlugin.loader,
|
|
98
|
+
"css-loader",
|
|
99
|
+
{
|
|
100
|
+
loader: "postcss-loader",
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
stats: {
|
|
107
|
+
all: false,
|
|
108
|
+
errors: true,
|
|
109
|
+
warnings: true,
|
|
110
|
+
logging: "warn",
|
|
111
|
+
colors: true,
|
|
112
|
+
},
|
|
113
|
+
infrastructureLogging: {
|
|
114
|
+
level: "warn",
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function loadPulseConfig(): Promise<any>;
|
|
2
|
+
export declare function getLocalNetworkIP(): string;
|
|
3
|
+
export declare function readConfigFile(): Promise<any>;
|
|
4
|
+
export declare function discoverServerFunctions(): {
|
|
5
|
+
[x: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function discoverAppSkillActions(): {
|
|
8
|
+
[x: string]: string;
|
|
9
|
+
} | null;
|
|
10
|
+
export declare function generateTempTsConfig(): void;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { existsSync, writeFileSync } from "fs";
|
|
3
|
+
import fs from "fs/promises";
|
|
4
|
+
import { globSync } from "glob";
|
|
5
|
+
import { networkInterfaces } from "os";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { Project, SyntaxKind } from "ts-morph";
|
|
8
|
+
import ts from "typescript";
|
|
9
|
+
import { pathToFileURL } from "url";
|
|
10
|
+
export async function loadPulseConfig() {
|
|
11
|
+
const projectDirName = process.cwd();
|
|
12
|
+
// compile to js file and import
|
|
13
|
+
const program = ts.createProgram({
|
|
14
|
+
rootNames: [path.join(projectDirName, "pulse.config.ts")],
|
|
15
|
+
options: {
|
|
16
|
+
module: ts.ModuleKind.ESNext,
|
|
17
|
+
target: ts.ScriptTarget.ES2020,
|
|
18
|
+
outDir: path.join(projectDirName, "node_modules/.pulse/config"),
|
|
19
|
+
esModuleInterop: true,
|
|
20
|
+
skipLibCheck: true,
|
|
21
|
+
forceConsistentCasingInFileNames: true,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
program.emit();
|
|
25
|
+
// Fix imports in the generated js file for all files in node_modules/.pulse/config
|
|
26
|
+
globSync("node_modules/.pulse/config/**/*.js", {
|
|
27
|
+
cwd: projectDirName,
|
|
28
|
+
absolute: true,
|
|
29
|
+
}).forEach(async (jsFile) => {
|
|
30
|
+
let content = await fs.readFile(jsFile, "utf-8");
|
|
31
|
+
content = content.replace(/(from\s+["']\.\/[^\s"']+)(["'])/g, (match, p1, p2) => {
|
|
32
|
+
// No change if the import already has any extension
|
|
33
|
+
if (p1.match(/\.(js|cjs|mjs|ts|tsx|json)$/)) {
|
|
34
|
+
return match; // No change needed
|
|
35
|
+
}
|
|
36
|
+
return `${p1}.js${p2}`;
|
|
37
|
+
});
|
|
38
|
+
await fs.writeFile(jsFile, content);
|
|
39
|
+
});
|
|
40
|
+
// Copy package.json if exists
|
|
41
|
+
const pkgPath = path.join(projectDirName, "package.json");
|
|
42
|
+
if (existsSync(pkgPath)) {
|
|
43
|
+
const destPath = path.join(projectDirName, "node_modules/.pulse/config/package.json");
|
|
44
|
+
await fs.copyFile(pkgPath, destPath);
|
|
45
|
+
}
|
|
46
|
+
const compiledConfig = path.join(projectDirName, "node_modules/.pulse/config/pulse.config.js");
|
|
47
|
+
const mod = await import(pathToFileURL(compiledConfig).href);
|
|
48
|
+
// delete the compiled config after importing
|
|
49
|
+
await fs.rm(path.join(projectDirName, "node_modules/.pulse/config"), {
|
|
50
|
+
recursive: true,
|
|
51
|
+
force: true,
|
|
52
|
+
});
|
|
53
|
+
return mod.default;
|
|
54
|
+
}
|
|
55
|
+
export function getLocalNetworkIP() {
|
|
56
|
+
const interfaces = networkInterfaces();
|
|
57
|
+
for (const iface of Object.values(interfaces)) {
|
|
58
|
+
if (!iface)
|
|
59
|
+
continue;
|
|
60
|
+
for (const config of iface) {
|
|
61
|
+
if (config.family === "IPv4" && !config.internal) {
|
|
62
|
+
return config.address; // Returns the first non-internal IPv4 address
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return "localhost"; // Fallback
|
|
67
|
+
}
|
|
68
|
+
export async function readConfigFile() {
|
|
69
|
+
// Read pulse.config.json from dist/client
|
|
70
|
+
// Wait until dist/pulse.config.json exists
|
|
71
|
+
while (true) {
|
|
72
|
+
try {
|
|
73
|
+
await fs.access("dist/pulse.config.json");
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
// Wait for 100ms before trying again
|
|
78
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const data = await fs.readFile("dist/pulse.config.json", "utf-8");
|
|
82
|
+
return JSON.parse(data);
|
|
83
|
+
}
|
|
84
|
+
export function discoverServerFunctions() {
|
|
85
|
+
// Get all .ts files under src/server-function and read use default exports as entry points
|
|
86
|
+
const files = globSync("./src/server-function/**/*.ts");
|
|
87
|
+
const entryPoints = files
|
|
88
|
+
.map((file) => file.replaceAll("\\", "/"))
|
|
89
|
+
.map((file) => {
|
|
90
|
+
return {
|
|
91
|
+
["./" + file.replace("src/server-function/", "").replace(/\.ts$/, "")]: "./" + file,
|
|
92
|
+
};
|
|
93
|
+
})
|
|
94
|
+
.reduce((acc, curr) => {
|
|
95
|
+
return { ...acc, ...curr };
|
|
96
|
+
}, {});
|
|
97
|
+
return entryPoints;
|
|
98
|
+
}
|
|
99
|
+
export function discoverAppSkillActions() {
|
|
100
|
+
// Get all .ts files under src/skill and read use default exports as entry points
|
|
101
|
+
const files = globSync("./src/skill/*/action.ts");
|
|
102
|
+
const entryPoints = files
|
|
103
|
+
.map((file) => file.replaceAll("\\", "/"))
|
|
104
|
+
.map((file) => {
|
|
105
|
+
// Read default export info in the file using ts-morph to get the function name, and use the function name as the entry point key instead of the file name
|
|
106
|
+
const project = new Project({
|
|
107
|
+
tsConfigFilePath: path.join(process.cwd(), "node_modules/.pulse/tsconfig.server.json"),
|
|
108
|
+
});
|
|
109
|
+
const sourceFile = project.addSourceFileAtPath(file);
|
|
110
|
+
const defaultExportSymbol = sourceFile.getDefaultExportSymbol();
|
|
111
|
+
if (!defaultExportSymbol) {
|
|
112
|
+
console.warn(`No default export found in action file ${file}. Skipping...`);
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const defaultExportDeclarations = defaultExportSymbol.getDeclarations();
|
|
116
|
+
if (defaultExportDeclarations.length === 0) {
|
|
117
|
+
console.warn(`No declarations found for default export in action file ${file}. Skipping...`);
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const funcDecl = defaultExportDeclarations[0]?.asKind(SyntaxKind.FunctionDeclaration);
|
|
121
|
+
if (!funcDecl) {
|
|
122
|
+
console.warn(`Default export in action file ${file} is not a function declaration. Skipping...`);
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
// Match `*/src/skill/{actionName}/action.ts` and extract {actionName}
|
|
126
|
+
const pattern = /src\/skill\/([^\/]+)\/action\.ts$/;
|
|
127
|
+
const match = file.replaceAll("\\", "/").match(pattern);
|
|
128
|
+
if (!match) {
|
|
129
|
+
console.warn(`File path ${file} does not match pattern ${pattern}. Skipping...`);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const actionName = match[1];
|
|
133
|
+
if (!actionName) {
|
|
134
|
+
console.warn(`Could not extract action name from file path ${file}. Skipping...`);
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
["./skill/" + actionName]: "./" + file,
|
|
139
|
+
};
|
|
140
|
+
})
|
|
141
|
+
.reduce((acc, curr) => {
|
|
142
|
+
return { ...acc, ...curr };
|
|
143
|
+
}, {});
|
|
144
|
+
return entryPoints;
|
|
145
|
+
}
|
|
146
|
+
// Generate tsconfig for server functions
|
|
147
|
+
export function generateTempTsConfig() {
|
|
148
|
+
const tempTsConfigPath = path.join(process.cwd(), "node_modules/.pulse/tsconfig.server.json");
|
|
149
|
+
if (existsSync(tempTsConfigPath)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const tsConfig = {
|
|
153
|
+
compilerOptions: {
|
|
154
|
+
target: "ES2020",
|
|
155
|
+
module: "esnext",
|
|
156
|
+
moduleResolution: "bundler",
|
|
157
|
+
strict: true,
|
|
158
|
+
declaration: true,
|
|
159
|
+
outDir: path.join(process.cwd(), "dist"),
|
|
160
|
+
},
|
|
161
|
+
include: [
|
|
162
|
+
path.join(process.cwd(), "src/server-function/**/*"),
|
|
163
|
+
path.join(process.cwd(), "pulse.config.ts"),
|
|
164
|
+
path.join(process.cwd(), "global.d.ts"),
|
|
165
|
+
],
|
|
166
|
+
exclude: [
|
|
167
|
+
path.join(process.cwd(), "node_modules"),
|
|
168
|
+
path.join(process.cwd(), "dist"),
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
writeFileSync(tempTsConfigPath, JSON.stringify(tsConfig, null, 2));
|
|
172
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
|
|
2
|
+
import { MessageStreamController } from "../streaming/message-stream-controller";
|
|
3
|
+
export declare function runVibeCoding(mcpClient: MultiServerMCPClient, userPrompt: string, controller: MessageStreamController): Promise<void>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
|
|
2
|
+
export declare function writeFileToFS(mcpClient: MultiServerMCPClient, uri: string, content: string): Promise<string>;
|
|
3
|
+
export declare function callTerminal(mcpClient: MultiServerMCPClient, command: string): Promise<string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AgentTaskMessageData } from "../types";
|
|
2
|
+
export declare class MessageStreamController {
|
|
3
|
+
private controller;
|
|
4
|
+
private msgCounter;
|
|
5
|
+
private messages;
|
|
6
|
+
private timeCountMap;
|
|
7
|
+
constructor(controller: ReadableStreamDefaultController);
|
|
8
|
+
enqueueNew(data: AgentTaskMessageData, isFinal: boolean): number;
|
|
9
|
+
enqueueUpdate(data: AgentTaskMessageData, isFinal: boolean): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type VibeDevFlowNode = {
|
|
2
|
+
id: string;
|
|
3
|
+
children: VibeDevFlowNode[];
|
|
4
|
+
};
|
|
5
|
+
export declare enum AgentTaskMessageType {
|
|
6
|
+
Creation = "creation",
|
|
7
|
+
Update = "update"
|
|
8
|
+
}
|
|
9
|
+
export declare enum AgentTaskMessageDataType {
|
|
10
|
+
Notification = "notification",
|
|
11
|
+
ToolCall = "toolCall",
|
|
12
|
+
ArtifactOutput = "artifactOutput"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Data associated with an AgentTaskItem.
|
|
16
|
+
* The fields included depend on the type of the task item.
|
|
17
|
+
*
|
|
18
|
+
* @property type - The type of the task item, defined by the AgentTaskItemType enum.
|
|
19
|
+
* @property title - (Optional) A brief title or summary of the task item.
|
|
20
|
+
* @property description - (Optional) A detailed description of the task item.
|
|
21
|
+
* @property toolName - (Optional) The name of the tool being called (if applicable).
|
|
22
|
+
* @property parameters - (Optional) A record of parameters associated with the tool call (if applicable).
|
|
23
|
+
* @property error - (Optional) An error message if the task item represents an error.
|
|
24
|
+
* @property result - (Optional) The result or output of the task item (if applicable).
|
|
25
|
+
*/
|
|
26
|
+
export type AgentTaskMessageData = {
|
|
27
|
+
type?: AgentTaskMessageDataType;
|
|
28
|
+
title?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
toolName?: string;
|
|
31
|
+
parameters?: Record<string, unknown>;
|
|
32
|
+
error?: string;
|
|
33
|
+
result?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Represents a single task item generated by the agent.
|
|
37
|
+
* Each task item can be of different types such as tool calls, notifications, or errors.
|
|
38
|
+
*
|
|
39
|
+
* @property type - The type of the task item, defined by the AgentTaskItemType enum.
|
|
40
|
+
* @property messageId - The unique identifier for the task item.
|
|
41
|
+
* This is an incremental number representing the n-th task item.
|
|
42
|
+
* @property data - The data associated with the task item, which varies based on the type.
|
|
43
|
+
* @property isFinal - (Optional) Indicates if the task item is final and no further updates are expected.
|
|
44
|
+
*/
|
|
45
|
+
export type AgentTaskMessage = {
|
|
46
|
+
type: AgentTaskMessageType;
|
|
47
|
+
messageId: number;
|
|
48
|
+
data: AgentTaskMessageData;
|
|
49
|
+
isFinal?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export type AgentTaskMessageUpdate = {
|
|
52
|
+
type: AgentTaskMessageType;
|
|
53
|
+
messageId: number;
|
|
54
|
+
updateType: "append";
|
|
55
|
+
delta: AgentTaskMessageData;
|
|
56
|
+
isFinal?: boolean;
|
|
57
|
+
timeUsedSec?: string;
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function handler(req: Request): Promise<Response>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"outDir": "dist",
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../../../../../../src/server-function/**/*",
|
|
12
|
+
"../../../../../../pulse.config.ts",
|
|
13
|
+
"../../../../../../global.d.ts",
|
|
14
|
+
],
|
|
15
|
+
"exclude": [
|
|
16
|
+
"../../../../../../node_modules",
|
|
17
|
+
"../../../../../../dist",
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createWebpackConfig(isPreview: boolean, buildTarget: "client" | "server" | "both", mode: "development" | "production"): Promise<import("webpack").Configuration[]>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { makeMFClientConfig } from "./configs/mf-client.js";
|
|
3
|
+
import { makeMFServerConfig } from "./configs/mf-server.js";
|
|
4
|
+
import { makePreviewClientConfig } from "./configs/preview.js";
|
|
5
|
+
export async function createWebpackConfig(isPreview, buildTarget, mode) {
|
|
6
|
+
if (isPreview) {
|
|
7
|
+
const previewClientConfig = await makePreviewClientConfig("development");
|
|
8
|
+
const mfServerConfig = await makeMFServerConfig("development");
|
|
9
|
+
return [previewClientConfig, mfServerConfig];
|
|
10
|
+
}
|
|
11
|
+
else if (buildTarget === "server") {
|
|
12
|
+
const mfServerConfig = await makeMFServerConfig(mode);
|
|
13
|
+
return [mfServerConfig];
|
|
14
|
+
}
|
|
15
|
+
else if (buildTarget === "client") {
|
|
16
|
+
const mfClientConfig = await makeMFClientConfig(mode);
|
|
17
|
+
return [mfClientConfig];
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const mfClientConfig = await makeMFClientConfig(mode);
|
|
21
|
+
const mfServerConfig = await makeMFServerConfig(mode);
|
|
22
|
+
return [mfClientConfig, mfServerConfig];
|
|
23
|
+
}
|
|
24
|
+
}
|