@pipelab/core-node 1.0.0-beta.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/CHANGELOG.md +13 -0
- package/LICENSE +110 -0
- package/README.md +10 -0
- package/dist/index.d.mts +416 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +52612 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +64 -0
- package/src/api.ts +115 -0
- package/src/config.ts +105 -0
- package/src/context.ts +68 -0
- package/src/handler-func.ts +234 -0
- package/src/handlers/agents.ts +32 -0
- package/src/handlers/auth.ts +95 -0
- package/src/handlers/build-history.ts +381 -0
- package/src/handlers/config.ts +109 -0
- package/src/handlers/engine.ts +229 -0
- package/src/handlers/fs.ts +97 -0
- package/src/handlers/history.ts +329 -0
- package/src/handlers/index.ts +41 -0
- package/src/handlers/shell.ts +57 -0
- package/src/handlers/system.ts +18 -0
- package/src/handlers.ts +2 -0
- package/src/heavy.ts +4 -0
- package/src/index.ts +16 -0
- package/src/ipc-core.ts +77 -0
- package/src/migrations.ts +72 -0
- package/src/paths.ts +1 -0
- package/src/plugins-registry.ts +78 -0
- package/src/presets/c3toSteam.ts +272 -0
- package/src/presets/demo.ts +123 -0
- package/src/presets/if.ts +69 -0
- package/src/presets/list.ts +30 -0
- package/src/presets/loop.ts +65 -0
- package/src/presets/moreToCome.ts +32 -0
- package/src/presets/newProject.ts +31 -0
- package/src/presets/preset.model.ts +0 -0
- package/src/presets/test-c3-offline.ts +78 -0
- package/src/presets/test-c3-unzip.ts +124 -0
- package/src/runner.ts +160 -0
- package/src/server.ts +99 -0
- package/src/types/runner.ts +101 -0
- package/src/utils/fs-extras.ts +211 -0
- package/src/utils/remote.ts +497 -0
- package/src/utils/storage.ts +99 -0
- package/src/utils.ts +268 -0
- package/src/websocket-server.ts +288 -0
- package/tsconfig.json +19 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 CynToolkit
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the MIT license that is effective on the second anniversary of the date we make
|
|
91
|
+
the Software available. On or after that date, you may use the Software under
|
|
92
|
+
the MIT license, in which case the following will apply:
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
95
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
96
|
+
the Software without restriction, including without limitation the rights to
|
|
97
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
98
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
99
|
+
so, subject to the following conditions:
|
|
100
|
+
|
|
101
|
+
The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
copies or substantial portions of the Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# @pipelab/core-node
|
|
2
|
+
|
|
3
|
+
The backend execution engine for Pipelab.
|
|
4
|
+
|
|
5
|
+
## Responsibilities
|
|
6
|
+
|
|
7
|
+
- **Graph Execution**: Handles the logic for running automation pipelines.
|
|
8
|
+
- **WebSocket Server**: Real-time communication between UI and backend.
|
|
9
|
+
- **Environment Management**: Ensures required runtimes (like Node.js) are available.
|
|
10
|
+
- **System Integration**: File system utilities, terminal emulation (PTY), and build history management.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { WebSocket } from "ws";
|
|
3
|
+
import { Action, Agent, BlockCondition, BuildHistoryEntry, Channels, Condition, End, Event as Event$1, Events, Expression, ExtractInputsFromAction, ExtractInputsFromCondition, ExtractInputsFromEvent, ExtractInputsFromExpression, ExtractInputsFromLoop, HandleListenerRendererSendFn, IBuildHistoryStorage, IpcMessage, Loop, Migrator, RendererChannels, RendererData, RendererEnd, RendererEvents, RendererMessage, RequestId, SetOutputActionFn, SetOutputExpressionFn, SetOutputLoopFn, UpdateStatus, Variable, WebSocketConnectionState, WebSocketEvent, WebSocketHandler, WebSocketSendFunction } from "@pipelab/shared";
|
|
4
|
+
import * as execa$1 from "execa";
|
|
5
|
+
import { Options as Options$1, Subprocess } from "execa";
|
|
6
|
+
import * as http$1 from "http";
|
|
7
|
+
import http from "http";
|
|
8
|
+
|
|
9
|
+
//#region src/context.d.ts
|
|
10
|
+
declare const isDev: boolean;
|
|
11
|
+
declare const getDefaultUserDataPath: () => string;
|
|
12
|
+
declare const projectRoot: string | null;
|
|
13
|
+
interface PipelabContextOptions {
|
|
14
|
+
userDataPath: string;
|
|
15
|
+
}
|
|
16
|
+
declare class PipelabContext {
|
|
17
|
+
readonly userDataPath: string;
|
|
18
|
+
constructor(options: PipelabContextOptions);
|
|
19
|
+
getPackagesPath(...subpaths: string[]): string;
|
|
20
|
+
getThirdPartyPath(...subpaths: string[]): string;
|
|
21
|
+
getConfigPath(...subpaths: string[]): string;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/websocket-server.d.ts
|
|
25
|
+
interface ConnectedClient {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
ws: WebSocket;
|
|
29
|
+
connectedAt: number;
|
|
30
|
+
}
|
|
31
|
+
declare class WebSocketServer {
|
|
32
|
+
private wss;
|
|
33
|
+
private server;
|
|
34
|
+
private isReady;
|
|
35
|
+
private readyResolve;
|
|
36
|
+
private connectionState;
|
|
37
|
+
private clients;
|
|
38
|
+
private lastBroadcasts;
|
|
39
|
+
start(port?: number, existingServer?: http$1.Server): Promise<void>;
|
|
40
|
+
private handleWebSocketMessage;
|
|
41
|
+
private sendError;
|
|
42
|
+
stop(): Promise<void>;
|
|
43
|
+
waitForReady(): Promise<void>;
|
|
44
|
+
isServerReady(): boolean;
|
|
45
|
+
getConnectionState(): WebSocketConnectionState;
|
|
46
|
+
getAgents(): Agent[];
|
|
47
|
+
getClient(ws: WebSocket): ConnectedClient | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Broadcasts a message to all connected clients.
|
|
50
|
+
* Useful for push notifications like auth state changes.
|
|
51
|
+
*/
|
|
52
|
+
broadcast<KEY extends Channels>(channel: KEY, data: Events<KEY>): void;
|
|
53
|
+
}
|
|
54
|
+
declare const webSocketServer: WebSocketServer;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/ipc-core.d.ts
|
|
57
|
+
type HandleListenerSendFn<KEY extends Channels> = WebSocketSendFunction<KEY>;
|
|
58
|
+
type WsEvent = WebSocketEvent;
|
|
59
|
+
type HandleListener<KEY extends Channels> = WebSocketHandler<KEY>;
|
|
60
|
+
declare const useAPI: () => {
|
|
61
|
+
handle: <KEY extends Channels>(channel: KEY, listener: WebSocketHandler<KEY>) => {
|
|
62
|
+
channel: KEY;
|
|
63
|
+
listener: WebSocketHandler<KEY>;
|
|
64
|
+
};
|
|
65
|
+
processWebSocketMessage: (ws: WebSocket, channel: string, message: IpcMessage) => any;
|
|
66
|
+
handlers: Record<string, WebSocketHandler<any>>;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/handlers/shell.d.ts
|
|
70
|
+
declare const registerShellHandlers: (_context: PipelabContext) => void;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/handlers/fs.d.ts
|
|
73
|
+
declare const registerFsHandlers: (_context: PipelabContext) => void;
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/handlers/config.d.ts
|
|
76
|
+
declare const registerConfigHandlers: (context: PipelabContext) => void;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/handlers/history.d.ts
|
|
79
|
+
declare const registerHistoryHandlers: (context: PipelabContext) => void;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/handlers/engine.d.ts
|
|
82
|
+
declare const registerEngineHandlers: (context: PipelabContext) => void;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/handlers/agents.d.ts
|
|
85
|
+
declare const registerAgentsHandlers: (_context: PipelabContext) => void;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/handlers/build-history.d.ts
|
|
88
|
+
declare class BuildHistoryStorage implements IBuildHistoryStorage {
|
|
89
|
+
private context;
|
|
90
|
+
private logger;
|
|
91
|
+
constructor(context: PipelabContext);
|
|
92
|
+
private getStoragePath;
|
|
93
|
+
private getPipelinePath;
|
|
94
|
+
private ensureStoragePath;
|
|
95
|
+
private loadPipelineHistory;
|
|
96
|
+
private savePipelineHistory;
|
|
97
|
+
applyRetentionPolicy(): Promise<void>;
|
|
98
|
+
save(entry: BuildHistoryEntry): Promise<void>;
|
|
99
|
+
get(id: string, pipelineId?: string): Promise<BuildHistoryEntry | undefined>;
|
|
100
|
+
getAll(): Promise<BuildHistoryEntry[]>;
|
|
101
|
+
getByPipeline(pipelineId: string): Promise<BuildHistoryEntry[]>;
|
|
102
|
+
update(id: string, updates: Partial<BuildHistoryEntry>, pipelineId?: string): Promise<void>;
|
|
103
|
+
delete(id: string, pipelineId?: string): Promise<void>;
|
|
104
|
+
clear(): Promise<void>;
|
|
105
|
+
clearByPipeline(pipelineId: string): Promise<void>;
|
|
106
|
+
getStorageInfo(): Promise<{
|
|
107
|
+
totalEntries: number;
|
|
108
|
+
totalSize: number;
|
|
109
|
+
oldestEntry?: number;
|
|
110
|
+
newestEntry?: number;
|
|
111
|
+
numberOfPipelines: number;
|
|
112
|
+
userDataPath: string;
|
|
113
|
+
retentionPolicy: {
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
maxEntries: number;
|
|
116
|
+
maxAge: number;
|
|
117
|
+
};
|
|
118
|
+
disk: {
|
|
119
|
+
total: number;
|
|
120
|
+
free: number;
|
|
121
|
+
pipelab: number;
|
|
122
|
+
};
|
|
123
|
+
}>;
|
|
124
|
+
private getAllPipelineFiles;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/handlers/index.d.ts
|
|
128
|
+
declare const registerAllHandlers: (options: {
|
|
129
|
+
version: string;
|
|
130
|
+
context: PipelabContext;
|
|
131
|
+
}) => Promise<void>;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/config.d.ts
|
|
134
|
+
declare const getMigrator: <T>(name: string) => any;
|
|
135
|
+
declare const setupConfigFile: <T>(name: string, options: {
|
|
136
|
+
context: PipelabContext;
|
|
137
|
+
migrator?: Migrator<T>;
|
|
138
|
+
}) => Promise<{
|
|
139
|
+
setConfig: (config: T) => Promise<boolean>;
|
|
140
|
+
getConfig: () => Promise<T>;
|
|
141
|
+
}>;
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/api.d.ts
|
|
144
|
+
type HandleListenerRenderer<KEY extends RendererChannels> = (event: Electron.IpcMainInvokeEvent, data: {
|
|
145
|
+
value: RendererData<KEY>;
|
|
146
|
+
send: HandleListenerRendererSendFn<KEY>;
|
|
147
|
+
}) => Promise<void>;
|
|
148
|
+
type ListenerMain<KEY extends RendererChannels> = (event: Electron.IpcMainEvent, data: RendererEvents<KEY>) => Promise<void>;
|
|
149
|
+
declare const usePluginAPI: (browserWindow: any) => {
|
|
150
|
+
send: <KEY extends RendererChannels>(channel: KEY, args?: RendererData<KEY>) => void;
|
|
151
|
+
on: <KEY extends RendererChannels>(channel: KEY | string, listener: (event: any, data: RendererEvents<KEY>) => void) => () => void;
|
|
152
|
+
execute: <KEY extends RendererChannels>(channel: KEY, data?: RendererData<KEY>, listener?: ListenerMain<KEY>) => Promise<RendererEnd<KEY>>;
|
|
153
|
+
};
|
|
154
|
+
type UseMainAPI = ReturnType<typeof usePluginAPI>;
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/handler-func.d.ts
|
|
157
|
+
declare const handleConditionExecute: (nodeId: string, pluginId: string, params: BlockCondition["params"], cwd: string, context: PipelabContext) => Promise<End<"condition:execute">>;
|
|
158
|
+
declare const handleActionExecute: (nodeId: string, pluginId: string, params: Record<string, string>, mainWindow: any | undefined, send: HandleListenerSendFn<"action:execute">, abortSignal: AbortSignal, cwd: string, cachePath: string, context: PipelabContext) => Promise<End<"action:execute">>;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/utils.d.ts
|
|
161
|
+
declare const getFinalPlugins: () => RendererPluginDefinition[];
|
|
162
|
+
declare const executeGraphWithHistory: ({
|
|
163
|
+
graph,
|
|
164
|
+
variables,
|
|
165
|
+
projectName,
|
|
166
|
+
projectPath,
|
|
167
|
+
pipelineId,
|
|
168
|
+
onNodeEnter,
|
|
169
|
+
onNodeExit,
|
|
170
|
+
onLog,
|
|
171
|
+
abortSignal,
|
|
172
|
+
mainWindow,
|
|
173
|
+
cachePath,
|
|
174
|
+
context
|
|
175
|
+
}: {
|
|
176
|
+
graph: any;
|
|
177
|
+
variables: Variable[];
|
|
178
|
+
projectName: string;
|
|
179
|
+
projectPath: string;
|
|
180
|
+
pipelineId: string;
|
|
181
|
+
onNodeEnter?: (node: any) => void;
|
|
182
|
+
onNodeExit?: (node: any) => void;
|
|
183
|
+
onLog?: (data: any, node?: any) => void;
|
|
184
|
+
abortSignal: AbortSignal;
|
|
185
|
+
mainWindow?: any;
|
|
186
|
+
cachePath: string;
|
|
187
|
+
context: PipelabContext;
|
|
188
|
+
}) => Promise<{
|
|
189
|
+
result: any;
|
|
190
|
+
buildId: string;
|
|
191
|
+
}>;
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/plugins-registry.d.ts
|
|
194
|
+
declare const loadPipelabPlugin: (id: string, options: {
|
|
195
|
+
context: PipelabContext;
|
|
196
|
+
}) => Promise<any>;
|
|
197
|
+
declare const builtInPlugins: (options: {
|
|
198
|
+
context: PipelabContext;
|
|
199
|
+
}) => Promise<any[]>;
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/utils/remote.d.ts
|
|
202
|
+
declare const DEFAULT_NODE_VERSION = "24.14.1";
|
|
203
|
+
declare const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
204
|
+
type FetchOptions = {
|
|
205
|
+
installDeps?: boolean;
|
|
206
|
+
signal?: AbortSignal;
|
|
207
|
+
context: PipelabContext;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Robust utility to fetch, cache, and resolve an NPM package.
|
|
211
|
+
* Centralized in core-node to avoid circular dependencies.
|
|
212
|
+
*/
|
|
213
|
+
declare function fetchPackage(packageName: string, versionOrRange: string, options: FetchOptions): Promise<{
|
|
214
|
+
packageDir: string;
|
|
215
|
+
resolvedVersion: string;
|
|
216
|
+
isLocal?: boolean;
|
|
217
|
+
entryPoint?: string;
|
|
218
|
+
}>;
|
|
219
|
+
/**
|
|
220
|
+
* Executes a pnpm install in a specific directory with a portable environment.
|
|
221
|
+
*/
|
|
222
|
+
declare function runPnpm(cwd: string, options: {
|
|
223
|
+
args?: string[];
|
|
224
|
+
extraEnv?: Record<string, string>;
|
|
225
|
+
signal?: AbortSignal;
|
|
226
|
+
context: PipelabContext;
|
|
227
|
+
}): Promise<execa$1.Result<{
|
|
228
|
+
cwd: string;
|
|
229
|
+
all: true;
|
|
230
|
+
cancelSignal: AbortSignal | undefined;
|
|
231
|
+
env: {
|
|
232
|
+
NODE_ENV: string;
|
|
233
|
+
PATH: string | undefined;
|
|
234
|
+
PNPM_HOME: string;
|
|
235
|
+
PNPM_ONLY_ALLOW_TRUSTED_DEPENDENCIES: string;
|
|
236
|
+
};
|
|
237
|
+
}>>;
|
|
238
|
+
/**
|
|
239
|
+
* Installs a specific version of Node.js if not already present.
|
|
240
|
+
*/
|
|
241
|
+
declare function ensureNodeJS(context: PipelabContext, version?: string): Promise<string>;
|
|
242
|
+
/**
|
|
243
|
+
* Installs the PNPM package from npm if not already present.
|
|
244
|
+
*/
|
|
245
|
+
declare function ensurePNPM(context: PipelabContext, version?: string): Promise<string>;
|
|
246
|
+
declare function fetchPipelabAsset(packageName: string, versionOrRange: string, options: FetchOptions): Promise<string>;
|
|
247
|
+
declare function fetchPipelabPlugin(pluginName: string, versionOrRange: string, options: FetchOptions): Promise<{
|
|
248
|
+
packageDir: string;
|
|
249
|
+
entryPoint: string;
|
|
250
|
+
isLocal: boolean;
|
|
251
|
+
}>;
|
|
252
|
+
declare function fetchPipelabCli(versionOrRange: string, options: FetchOptions): Promise<{
|
|
253
|
+
packageDir: string;
|
|
254
|
+
entryPoint: string;
|
|
255
|
+
isLocal: boolean;
|
|
256
|
+
}>;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/utils/fs-extras.d.ts
|
|
259
|
+
/**
|
|
260
|
+
* Ensures a directory exists and a file is created with default content if missing.
|
|
261
|
+
*/
|
|
262
|
+
declare const ensure: (filesPath: string, defaultContent?: string) => Promise<void>;
|
|
263
|
+
/**
|
|
264
|
+
* Generates a unique temporary folder.
|
|
265
|
+
*/
|
|
266
|
+
declare const generateTempFolder: (base?: string) => Promise<string>;
|
|
267
|
+
/**
|
|
268
|
+
* Extracts a .tar.gz archive.
|
|
269
|
+
*/
|
|
270
|
+
declare function extractTarGz(archivePath: string, destinationDir: string): Promise<void>;
|
|
271
|
+
/**
|
|
272
|
+
* Extracts a .zip archive.
|
|
273
|
+
*/
|
|
274
|
+
declare function extractZip(archivePath: string, destinationDir: string): Promise<void>;
|
|
275
|
+
/**
|
|
276
|
+
* Zips a folder.
|
|
277
|
+
*/
|
|
278
|
+
declare const zipFolder: (from: string, to: string, log?: typeof console.log) => Promise<string>;
|
|
279
|
+
/**
|
|
280
|
+
* Downloads a file with progress tracking.
|
|
281
|
+
*/
|
|
282
|
+
interface DownloadHooks {
|
|
283
|
+
onProgress?: (data: {
|
|
284
|
+
progress: number;
|
|
285
|
+
downloadedSize: number;
|
|
286
|
+
}) => void;
|
|
287
|
+
}
|
|
288
|
+
declare const downloadFile: (url: string, localPath: string, hooks?: DownloadHooks, abortSignal?: AbortSignal) => Promise<void>;
|
|
289
|
+
declare const runWithLiveLogs: (command: string, args: string[], execaOptions: Options$1, log: typeof console.log, hooks?: {
|
|
290
|
+
onStdout?: (data: string, subprocess: Subprocess) => void;
|
|
291
|
+
onStderr?: (data: string, subprocess: Subprocess) => void;
|
|
292
|
+
onExit?: (code: number) => void;
|
|
293
|
+
onCreated?: (subprocess: Subprocess) => void;
|
|
294
|
+
}, abortSignal?: AbortSignal) => Promise<void>;
|
|
295
|
+
/**
|
|
296
|
+
* Calculates the total size of a directory recursively.
|
|
297
|
+
*/
|
|
298
|
+
declare function getFolderSize(dirPath: string): Promise<number>;
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region ../../node_modules/electron/electron.d.ts
|
|
301
|
+
declare module 'electron' {
|
|
302
|
+
export = Electron.CrossProcessExports;
|
|
303
|
+
}
|
|
304
|
+
declare module 'electron/main' {
|
|
305
|
+
export = Electron.Main;
|
|
306
|
+
}
|
|
307
|
+
declare module 'electron/common' {
|
|
308
|
+
export = Electron.Common;
|
|
309
|
+
}
|
|
310
|
+
declare module 'electron/renderer' {
|
|
311
|
+
export = Electron.Renderer;
|
|
312
|
+
}
|
|
313
|
+
declare module 'electron/utility' {
|
|
314
|
+
export = Electron.Utility;
|
|
315
|
+
}
|
|
316
|
+
declare module 'original-fs' {
|
|
317
|
+
import * as fs from 'fs';
|
|
318
|
+
export = fs;
|
|
319
|
+
}
|
|
320
|
+
declare module 'node:original-fs' {
|
|
321
|
+
import * as fs from 'fs';
|
|
322
|
+
export = fs;
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/types/runner.d.ts
|
|
326
|
+
type RunnerCallbackFnArgument = {
|
|
327
|
+
done: () => void;
|
|
328
|
+
id: string;
|
|
329
|
+
log: (...args: Parameters<(typeof console)["log"]>) => void;
|
|
330
|
+
};
|
|
331
|
+
type ActionRunnerData<ACTION extends Action> = {
|
|
332
|
+
log: typeof console.log;
|
|
333
|
+
setOutput: SetOutputActionFn<ACTION>;
|
|
334
|
+
inputs: ExtractInputsFromAction<ACTION>;
|
|
335
|
+
setMeta: (callback: (data: ACTION["meta"]) => ACTION["meta"]) => void;
|
|
336
|
+
meta: ACTION["meta"];
|
|
337
|
+
cwd: string;
|
|
338
|
+
paths: {
|
|
339
|
+
cache: string;
|
|
340
|
+
pnpm: string;
|
|
341
|
+
node: string;
|
|
342
|
+
userData: string;
|
|
343
|
+
modules: string;
|
|
344
|
+
thirdparty: string;
|
|
345
|
+
};
|
|
346
|
+
browserWindow: BrowserWindow$1;
|
|
347
|
+
abortSignal: AbortSignal;
|
|
348
|
+
context: PipelabContext;
|
|
349
|
+
};
|
|
350
|
+
type ActionRunner<ACTION extends Action> = (data: ActionRunnerData<ACTION>) => Promise<void>;
|
|
351
|
+
type ConditionRunner<CONDITION extends Condition> = (data: {
|
|
352
|
+
log: typeof console.log;
|
|
353
|
+
inputs: ExtractInputsFromCondition<CONDITION>;
|
|
354
|
+
setMeta: (callback: (data: CONDITION["meta"]) => CONDITION["meta"]) => void;
|
|
355
|
+
meta: CONDITION["meta"];
|
|
356
|
+
cwd: string;
|
|
357
|
+
context: PipelabContext;
|
|
358
|
+
}) => Promise<boolean>;
|
|
359
|
+
type LoopRunner<LOOP extends Loop> = (data: {
|
|
360
|
+
log: typeof console.log;
|
|
361
|
+
setOutput: SetOutputLoopFn<LOOP>;
|
|
362
|
+
inputs: ExtractInputsFromLoop<LOOP>;
|
|
363
|
+
setMeta: (callback: (data: LOOP["meta"]) => LOOP["meta"]) => void;
|
|
364
|
+
meta: LOOP["meta"];
|
|
365
|
+
cwd: string;
|
|
366
|
+
context: PipelabContext;
|
|
367
|
+
}) => Promise<"step" | "exit">;
|
|
368
|
+
type ExpressionRunner<EXPRESSION extends Expression> = (data: {
|
|
369
|
+
log: typeof console.log;
|
|
370
|
+
setOutput: SetOutputExpressionFn<EXPRESSION>;
|
|
371
|
+
inputs: ExtractInputsFromExpression<EXPRESSION>;
|
|
372
|
+
setMeta: (callback: (data: EXPRESSION["meta"]) => EXPRESSION["meta"]) => void;
|
|
373
|
+
meta: EXPRESSION["meta"];
|
|
374
|
+
cwd: string;
|
|
375
|
+
context: PipelabContext;
|
|
376
|
+
}) => Promise<string>;
|
|
377
|
+
type EventRunner<EVENT extends Event$1> = (data: {
|
|
378
|
+
log: typeof console.log;
|
|
379
|
+
inputs: ExtractInputsFromEvent<EVENT>;
|
|
380
|
+
setMeta: (callback: (data: EVENT["meta"]) => EVENT["meta"]) => void;
|
|
381
|
+
meta: EVENT["meta"];
|
|
382
|
+
cwd: string;
|
|
383
|
+
context: PipelabContext;
|
|
384
|
+
}) => Promise<void>;
|
|
385
|
+
type Runner = ActionRunner<any> | LoopRunner<any> | EventRunner<any> | ConditionRunner<any>;
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/runner.d.ts
|
|
388
|
+
interface RunOptions {
|
|
389
|
+
userData?: string;
|
|
390
|
+
variables?: string;
|
|
391
|
+
output?: string;
|
|
392
|
+
cloud?: boolean;
|
|
393
|
+
}
|
|
394
|
+
declare function runPipelineCommand(file: string, options: RunOptions, version: string): Promise<any>;
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/migrations.d.ts
|
|
397
|
+
/**
|
|
398
|
+
* Registers migration handlers for the CLI/Standalone server.
|
|
399
|
+
* This overrides the default handlers from @pipelab/core-node to include
|
|
400
|
+
* pipeline and file repo migrations directly in the backend.
|
|
401
|
+
*/
|
|
402
|
+
declare function registerMigrationHandlers(context: PipelabContext): void;
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/server.d.ts
|
|
405
|
+
interface ServeOptions {
|
|
406
|
+
port: string | number;
|
|
407
|
+
userData?: string;
|
|
408
|
+
nodePath?: string;
|
|
409
|
+
pnpmPath?: string;
|
|
410
|
+
}
|
|
411
|
+
declare const sendStartupProgress: (message: string) => void;
|
|
412
|
+
declare const sendStartupReady: () => void;
|
|
413
|
+
declare function serveCommand(options: ServeOptions, version: string, _dirname: string): Promise<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>>;
|
|
414
|
+
//#endregion
|
|
415
|
+
export { type Action, ActionRunner, ActionRunnerData, BuildHistoryStorage, type Condition, ConditionRunner, ConnectedClient, DEFAULT_NODE_VERSION, DEFAULT_PNPM_VERSION, DownloadHooks, type Event$1 as Event, EventRunner, type Expression, ExpressionRunner, type ExtractInputsFromAction, type ExtractInputsFromCondition, type ExtractInputsFromEvent, type ExtractInputsFromExpression, type ExtractInputsFromLoop, FetchOptions, HandleListener, HandleListenerRenderer, type HandleListenerRendererSendFn, HandleListenerSendFn, ListenerMain, type Loop, LoopRunner, PipelabContext, PipelabContextOptions, type RendererChannels, type RendererData, type RendererEnd, type RendererEvents, type RendererMessage, type RequestId, RunOptions, Runner, RunnerCallbackFnArgument, ServeOptions, type SetOutputActionFn, type SetOutputExpressionFn, type SetOutputLoopFn, type UpdateStatus, UseMainAPI, WebSocketServer, WsEvent, builtInPlugins, downloadFile, ensure, ensureNodeJS, ensurePNPM, executeGraphWithHistory, extractTarGz, extractZip, fetchPackage, fetchPipelabAsset, fetchPipelabCli, fetchPipelabPlugin, generateTempFolder, getDefaultUserDataPath, getFinalPlugins, getFolderSize, getMigrator, handleActionExecute, handleConditionExecute, isDev, loadPipelabPlugin, projectRoot, registerAgentsHandlers, registerAllHandlers, registerConfigHandlers, registerEngineHandlers, registerFsHandlers, registerHistoryHandlers, registerMigrationHandlers, registerShellHandlers, runPipelineCommand, runPnpm, runWithLiveLogs, sendStartupProgress, sendStartupReady, serveCommand, setupConfigFile, useAPI, usePluginAPI, webSocketServer, zipFolder };
|
|
416
|
+
//# sourceMappingURL=index.d.mts.map
|