@kasarlabs/scarb-mcp 0.1.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/LICENSE +21 -0
- package/README.md +34 -0
- package/bin/scarb-mcp.js +14 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +71 -0
- package/build/index.js.map +1 -0
- package/build/lib/types/index.d.ts +39 -0
- package/build/lib/types/index.js +2 -0
- package/build/lib/types/index.js.map +1 -0
- package/build/lib/utils/common.d.ts +3 -0
- package/build/lib/utils/common.js +33 -0
- package/build/lib/utils/common.js.map +1 -0
- package/build/lib/utils/index.d.ts +25 -0
- package/build/lib/utils/index.js +153 -0
- package/build/lib/utils/index.js.map +1 -0
- package/build/lib/utils/path.d.ts +2 -0
- package/build/lib/utils/path.js +44 -0
- package/build/lib/utils/path.js.map +1 -0
- package/build/lib/utils/preparation.d.ts +23 -0
- package/build/lib/utils/preparation.js +140 -0
- package/build/lib/utils/preparation.js.map +1 -0
- package/build/lib/utils/utils.d.ts +7 -0
- package/build/lib/utils/utils.js +55 -0
- package/build/lib/utils/utils.js.map +1 -0
- package/build/lib/utils/workspace.d.ts +48 -0
- package/build/lib/utils/workspace.js +121 -0
- package/build/lib/utils/workspace.js.map +1 -0
- package/build/schemas/index.d.ts +92 -0
- package/build/schemas/index.js +71 -0
- package/build/schemas/index.js.map +1 -0
- package/build/tools/build.d.ts +3 -0
- package/build/tools/build.js +22 -0
- package/build/tools/build.js.map +1 -0
- package/build/tools/execute.d.ts +23 -0
- package/build/tools/execute.js +34 -0
- package/build/tools/execute.js.map +1 -0
- package/build/tools/init.d.ts +15 -0
- package/build/tools/init.js +23 -0
- package/build/tools/init.js.map +1 -0
- package/build/tools/install.d.ts +19 -0
- package/build/tools/install.js +56 -0
- package/build/tools/install.js.map +1 -0
- package/build/tools/prove.d.ts +28 -0
- package/build/tools/prove.js +41 -0
- package/build/tools/prove.js.map +1 -0
- package/build/tools/verify.d.ts +20 -0
- package/build/tools/verify.js +25 -0
- package/build/tools/verify.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preparation.js","sourceRoot":"","sources":["../../../src/lib/utils/preparation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AASlC,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,eAAuB,EACvB,gBAAwB,EACxB,UAAkB;IAElB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC5C,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAE7D,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;QAEtD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACnD,IAAI,UAAU,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAEzD,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAC7D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,CAAC;YAC/C,UAAU,IAAI,SAAS,UAAU,KAAK,CAAC;QACzC,CAAC;QAED,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAE5C,OA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AAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getBootloaderTracePath(stdout: string): string | undefined;
|
|
2
|
+
export declare function getExecutionNumber(output: string): string | null;
|
|
3
|
+
export declare function extractProofJsonPath(output: string): string | null;
|
|
4
|
+
export declare function extractModuleName(modulePath: string): string;
|
|
5
|
+
export declare function extractModuleFromArtifact(artifactFile: string | any, contract_index?: number): Promise<string>;
|
|
6
|
+
export declare const writeJsonToFile: (data: any, outputDir: string, fileName?: string) => string;
|
|
7
|
+
export declare function formatCompilationError(error: any): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as fsp from 'fs/promises';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
export function getBootloaderTracePath(stdout) {
|
|
5
|
+
const match = stdout.match(/Saving output to: (.+\.zip)/);
|
|
6
|
+
return match ? match[1] : undefined;
|
|
7
|
+
}
|
|
8
|
+
export function getExecutionNumber(output) {
|
|
9
|
+
const match = output.match(/Saving output to:.*\/execution(\d+)/);
|
|
10
|
+
return match ? match[1] : null;
|
|
11
|
+
}
|
|
12
|
+
export function extractProofJsonPath(output) {
|
|
13
|
+
const match = output.match(/Saving proof to:\s*(.*proof\.json)/);
|
|
14
|
+
return match ? match[1].trim() : null;
|
|
15
|
+
}
|
|
16
|
+
export function extractModuleName(modulePath) {
|
|
17
|
+
if (!modulePath)
|
|
18
|
+
return '';
|
|
19
|
+
const parts = modulePath.split('::');
|
|
20
|
+
return parts[parts.length - 2];
|
|
21
|
+
}
|
|
22
|
+
export async function extractModuleFromArtifact(artifactFile, contract_index = 0) {
|
|
23
|
+
try {
|
|
24
|
+
const content = await fsp.readFile(artifactFile, 'utf-8');
|
|
25
|
+
const artifact = JSON.parse(content);
|
|
26
|
+
if (artifact.contracts && artifact.contracts.length > 0) {
|
|
27
|
+
const modulePath = artifact.contracts[contract_index].module_path;
|
|
28
|
+
return extractModuleName(modulePath);
|
|
29
|
+
}
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw new Error(`Failed to extract module from artifact: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export const writeJsonToFile = (data, outputDir, fileName = 'data') => {
|
|
37
|
+
try {
|
|
38
|
+
const filePath = path.join(outputDir, fileName);
|
|
39
|
+
const proofContent = typeof data === 'string' ? data : JSON.stringify(data, null, 2);
|
|
40
|
+
fs.writeFileSync(filePath, proofContent);
|
|
41
|
+
return filePath;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw new Error(`Failed to write JSON to file: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export function formatCompilationError(error) {
|
|
48
|
+
if (!error || !error.stdout) {
|
|
49
|
+
return error?.message || 'Unknown compilation error';
|
|
50
|
+
}
|
|
51
|
+
return `[EXACT_ERROR_BEGIN]
|
|
52
|
+
${error.stdout}
|
|
53
|
+
[EXACT_ERROR_END]`;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAO7B,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC;AAOD,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,KAAK,GAAG,MA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AO,CAAC,CAAC,CAAC,eAAe,EAAE,CACtG,CAAC;IACJ,CAAC;AACH,CAAC;AASD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAS,EACT,SAAiB,EACjB,WAAmB,MAAM,EACjB,EAAE;IACV,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAChD,MAAM,YAAY,GAChB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAElE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,iCAAiC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC5F,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAOF,MAAM,UAAU,sBAAsB,CAAC,KAAU;IAC/C,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAC5B,OAAO,KAAK,EAAE,OAAO,IAAI,2BAA2B,CAAC;IACvD,CAAC;IAED,OAAO;EACP,KAAK,CAAC,MAAM;kBACI,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ProveProjectParams, VerifyProjectParams } from '../types/index.js';
|
|
2
|
+
export declare const initProject: (params: {
|
|
3
|
+
name: string;
|
|
4
|
+
projectDir: string;
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
status: string;
|
|
7
|
+
message: string;
|
|
8
|
+
output: string;
|
|
9
|
+
errors: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const buildProject: (params: {
|
|
12
|
+
path: string;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
status: string;
|
|
15
|
+
message: string;
|
|
16
|
+
output: string;
|
|
17
|
+
errors: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const cleanProject: (params: {
|
|
20
|
+
path: string;
|
|
21
|
+
removeDirectory?: boolean;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
status: string;
|
|
24
|
+
message: string;
|
|
25
|
+
output: string;
|
|
26
|
+
errors: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const executeProject: (projectDir: string, mode?: string, executableName?: string, executableFunction?: string, args?: string) => Promise<{
|
|
29
|
+
status: string;
|
|
30
|
+
message: string;
|
|
31
|
+
executionId: string | null | undefined;
|
|
32
|
+
tracePath: string | undefined;
|
|
33
|
+
output: string;
|
|
34
|
+
error: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const proveProject: (params: ProveProjectParams) => Promise<{
|
|
37
|
+
status: string;
|
|
38
|
+
message: string;
|
|
39
|
+
proofPath: string;
|
|
40
|
+
output: string;
|
|
41
|
+
error: string | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const verifyProject: (params: VerifyProjectParams) => Promise<{
|
|
44
|
+
status: string;
|
|
45
|
+
message: string;
|
|
46
|
+
output: string;
|
|
47
|
+
error: string | undefined;
|
|
48
|
+
}>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { extractProofJsonPath, getExecutionNumber, getBootloaderTracePath, } from './utils.js';
|
|
2
|
+
import * as fs from 'fs/promises';
|
|
3
|
+
import { exec } from 'child_process';
|
|
4
|
+
import { promisify } from 'util';
|
|
5
|
+
const execAsync = promisify(exec);
|
|
6
|
+
export const initProject = async (params) => {
|
|
7
|
+
try {
|
|
8
|
+
const { stdout, stderr } = await execAsync(`scarb init --test-runner cairo-test`, { cwd: params.projectDir });
|
|
9
|
+
return {
|
|
10
|
+
status: 'success',
|
|
11
|
+
message: `Project ${params.name} initialized successfully`,
|
|
12
|
+
output: stdout,
|
|
13
|
+
errors: stderr || undefined,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
throw new Error(`${error.message}`);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export const buildProject = async (params) => {
|
|
21
|
+
try {
|
|
22
|
+
const { stdout, stderr } = await execAsync('scarb build', {
|
|
23
|
+
cwd: params.path,
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
status: 'success',
|
|
27
|
+
message: 'Project built successfully',
|
|
28
|
+
output: stdout,
|
|
29
|
+
errors: stderr || undefined,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export const cleanProject = async (params) => {
|
|
37
|
+
try {
|
|
38
|
+
const { stdout, stderr } = await execAsync('scarb clean', {
|
|
39
|
+
cwd: params.path,
|
|
40
|
+
});
|
|
41
|
+
if (params.removeDirectory) {
|
|
42
|
+
await fs.rm(params.path, { recursive: true, force: true });
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
status: 'success',
|
|
46
|
+
message: params.removeDirectory
|
|
47
|
+
? 'Project cleaned and directory removed successfully'
|
|
48
|
+
: 'Project cleaned successfully',
|
|
49
|
+
output: stdout,
|
|
50
|
+
errors: stderr || undefined,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export const executeProject = async (projectDir, mode = 'standalone', executableName, executableFunction, args) => {
|
|
58
|
+
try {
|
|
59
|
+
let command = `scarb execute --print-program-output --print-resource-usage --target ${mode}`;
|
|
60
|
+
if (executableName)
|
|
61
|
+
command += ` --executable-name ${executableName}`;
|
|
62
|
+
if (executableFunction)
|
|
63
|
+
command += ` --executable-function ${executableFunction}`;
|
|
64
|
+
if (args)
|
|
65
|
+
command += ` --arguments "${args}"`;
|
|
66
|
+
const { stdout, stderr } = await execAsync(command, { cwd: projectDir });
|
|
67
|
+
const executionId = mode === 'standalone' ? getExecutionNumber(stdout) : undefined;
|
|
68
|
+
const tracePath = mode === 'bootloader' ? getBootloaderTracePath(stdout) : undefined;
|
|
69
|
+
return {
|
|
70
|
+
status: 'success',
|
|
71
|
+
message: 'Program executed successfully',
|
|
72
|
+
executionId: executionId,
|
|
73
|
+
tracePath: tracePath,
|
|
74
|
+
output: stdout,
|
|
75
|
+
error: stderr || undefined,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
export const proveProject = async (params) => {
|
|
83
|
+
try {
|
|
84
|
+
const command = `scarb prove --execution-id ${params.executionId}`;
|
|
85
|
+
const { stdout, stderr } = await execAsync(command, {
|
|
86
|
+
cwd: params.projectDir,
|
|
87
|
+
});
|
|
88
|
+
const proofPath = extractProofJsonPath(stdout);
|
|
89
|
+
if (!proofPath) {
|
|
90
|
+
throw new Error('Could not locate proof.json file path in command output');
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
status: 'success',
|
|
94
|
+
message: 'Contract execution proved successfully',
|
|
95
|
+
proofPath: proofPath,
|
|
96
|
+
output: stdout,
|
|
97
|
+
error: stderr || undefined,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export const verifyProject = async (params) => {
|
|
105
|
+
try {
|
|
106
|
+
const command = `scarb verify --proof-file ${params.proofPath}`;
|
|
107
|
+
const { stdout, stderr } = await execAsync(command, {
|
|
108
|
+
cwd: params.projectDir,
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
status: 'success',
|
|
112
|
+
message: 'Proof verified successfully',
|
|
113
|
+
output: stdout,
|
|
114
|
+
error: stderr || undefined,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../src/lib/utils/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAMpB,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAOlC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,MAGjC,EAAE,EAAE;IACH,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CACxC,qCAAqC,EACrC,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,CAC3B,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,WAAW,MAAM,CAAC,IAAI,2BAA2B;YAC1D,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,MAAM,IAAI,SAAS;SAC5B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;AACH,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,MAAwB,EAAE,EAAE;IAC7D,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,aAAa,EAAE;YACxD,GAAG,EAAE,MAAM,CAAC,IAAI;SACjB,CAA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AAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM,IAAI,SAAS;SAC3B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAA2B,EAAE,EAAE;IACjE,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,6BAA6B,MAAM,CAAC,SAAS,EAAE,CAAC;QAChE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE;YAClD,GAAG,EAAE,MAAM,CAAC,UAAU;SACvB,CAAC,CAAC;QAEH,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,6BAA6B;YACtC,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM,IAAI,SAAS;SAC3B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const installScarbSchema: z.ZodObject<{
|
|
3
|
+
version: z.ZodOptional<z.ZodString>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
version?: string | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
version?: string | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const initProjectSchema: z.ZodObject<{
|
|
10
|
+
projectName: z.ZodString;
|
|
11
|
+
projectType: z.ZodDefault<z.ZodEnum<["lib", "bin"]>>;
|
|
12
|
+
path: z.ZodOptional<z.ZodString>;
|
|
13
|
+
vcs: z.ZodDefault<z.ZodEnum<["git", "none"]>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
projectName: string;
|
|
16
|
+
projectType: "lib" | "bin";
|
|
17
|
+
vcs: "git" | "none";
|
|
18
|
+
path?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
projectName: string;
|
|
21
|
+
path?: string | undefined;
|
|
22
|
+
projectType?: "lib" | "bin" | undefined;
|
|
23
|
+
vcs?: "git" | "none" | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const buildProjectSchema: z.ZodObject<{
|
|
26
|
+
path: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
path?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
path?: string | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const executableSchema: z.ZodObject<{
|
|
33
|
+
executableType: z.ZodOptional<z.ZodEnum<["TARGET", "FUNCTION"]>>;
|
|
34
|
+
executableValue: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
executableType?: "TARGET" | "FUNCTION" | undefined;
|
|
37
|
+
executableValue?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
executableType?: "TARGET" | "FUNCTION" | undefined;
|
|
40
|
+
executableValue?: string | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const executeProgramSchema: z.ZodObject<{
|
|
43
|
+
path: z.ZodOptional<z.ZodString>;
|
|
44
|
+
executable: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
executableType: z.ZodOptional<z.ZodEnum<["TARGET", "FUNCTION"]>>;
|
|
46
|
+
executableValue: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
executableType?: "TARGET" | "FUNCTION" | undefined;
|
|
49
|
+
executableValue?: string | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
executableType?: "TARGET" | "FUNCTION" | undefined;
|
|
52
|
+
executableValue?: string | undefined;
|
|
53
|
+
}>>;
|
|
54
|
+
arguments: z.ZodOptional<z.ZodString>;
|
|
55
|
+
mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["standalone", "bootloader"]>>>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
mode: "standalone" | "bootloader";
|
|
58
|
+
path?: string | undefined;
|
|
59
|
+
executable?: {
|
|
60
|
+
executableType?: "TARGET" | "FUNCTION" | undefined;
|
|
61
|
+
executableValue?: string | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
arguments?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
path?: string | undefined;
|
|
66
|
+
executable?: {
|
|
67
|
+
executableType?: "TARGET" | "FUNCTION" | undefined;
|
|
68
|
+
executableValue?: string | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
arguments?: string | undefined;
|
|
71
|
+
mode?: "standalone" | "bootloader" | undefined;
|
|
72
|
+
}>;
|
|
73
|
+
export declare const proveProgramSchema: z.ZodObject<{
|
|
74
|
+
path: z.ZodOptional<z.ZodString>;
|
|
75
|
+
executionId: z.ZodNumber;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
executionId: number;
|
|
78
|
+
path?: string | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
executionId: number;
|
|
81
|
+
path?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const verifyProgramSchema: z.ZodObject<{
|
|
84
|
+
path: z.ZodOptional<z.ZodString>;
|
|
85
|
+
proofFile: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
path?: string | undefined;
|
|
88
|
+
proofFile?: string | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
path?: string | undefined;
|
|
91
|
+
proofFile?: string | undefined;
|
|
92
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const installScarbSchema = z.object({
|
|
3
|
+
version: z
|
|
4
|
+
.string()
|
|
5
|
+
.optional()
|
|
6
|
+
.describe('OPTIONAL: Scarb version to install (e.g., "2.10.0", "2.12.1"). If not specified, installs latest version'),
|
|
7
|
+
});
|
|
8
|
+
export const initProjectSchema = z.object({
|
|
9
|
+
projectName: z.string().describe('Name of the project to initialize'),
|
|
10
|
+
projectType: z
|
|
11
|
+
.enum(['lib', 'bin'])
|
|
12
|
+
.default('lib')
|
|
13
|
+
.describe('Project type (lib or bin)'),
|
|
14
|
+
path: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Path where to initialize the project (defaults to current directory)'),
|
|
18
|
+
vcs: z
|
|
19
|
+
.enum(['git', 'none'])
|
|
20
|
+
.default('git')
|
|
21
|
+
.describe('Version control system to use'),
|
|
22
|
+
});
|
|
23
|
+
export const buildProjectSchema = z.object({
|
|
24
|
+
path: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Path to the project directory (defaults to current directory)'),
|
|
28
|
+
});
|
|
29
|
+
export const executableSchema = z.object({
|
|
30
|
+
executableType: z
|
|
31
|
+
.enum(['TARGET', 'FUNCTION'])
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('OPTIONAL: The type of the executable to run: "TARGET" for a target name from Scarb.toml or "FUNCTION" for a function path like "package::module::function"'),
|
|
34
|
+
executableValue: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('OPTIONAL: The executable value: target name (e.g., "my_executable") or function path (e.g., "my_package::my_module::main")'),
|
|
38
|
+
});
|
|
39
|
+
export const executeProgramSchema = z.object({
|
|
40
|
+
path: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Path to the project directory (defaults to current directory)'),
|
|
44
|
+
executable: executableSchema
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('OPTIONAL: The executable information (target or function name)'),
|
|
47
|
+
arguments: z
|
|
48
|
+
.string()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe('OPTIONAL: Comma-separated list of arguments'),
|
|
51
|
+
mode: z
|
|
52
|
+
.enum(['standalone', 'bootloader'])
|
|
53
|
+
.optional()
|
|
54
|
+
.default('bootloader')
|
|
55
|
+
.describe('OPTIONAL: The execution mode. Default: bootloader'),
|
|
56
|
+
});
|
|
57
|
+
export const proveProgramSchema = z.object({
|
|
58
|
+
path: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('Path to the project directory (defaults to current directory)'),
|
|
62
|
+
executionId: z.number().describe(''),
|
|
63
|
+
});
|
|
64
|
+
export const verifyProgramSchema = z.object({
|
|
65
|
+
path: z
|
|
66
|
+
.string()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Path to the project directory (defaults to current directory)'),
|
|
69
|
+
proofFile: z.string().optional().describe('Path to the proof file to verify'),
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,0GAA0G,CAC3G;CACJ,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACrE,WAAW,EAAE,CAAC;SACX,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACpB,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,2BAA2B,CAAC;IACxC,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,sEAAsE,CACvE;IACH,GAAG,EAAE,CAAC;SACH,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SACr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AAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;CACrC,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,+DAA+D,CAAC;IAC5E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;CAC9E,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { checkScarbInstalled, buildProject as buildScarbProject, } from '../lib/utils/index.js';
|
|
2
|
+
export const buildProject = async (params) => {
|
|
3
|
+
try {
|
|
4
|
+
await checkScarbInstalled();
|
|
5
|
+
const projectDir = params.path || process.cwd();
|
|
6
|
+
const result = await buildScarbProject(projectDir);
|
|
7
|
+
return {
|
|
8
|
+
status: 'success',
|
|
9
|
+
message: 'Project built successfully',
|
|
10
|
+
...JSON.parse(result),
|
|
11
|
+
buildPath: projectDir,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return {
|
|
16
|
+
status: 'failure',
|
|
17
|
+
message: `Build failed: ${error.message}`,
|
|
18
|
+
error: error.message,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/tools/build.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,YAAY,IAAI,iBAAiB,GAClC,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,MAA0C,EAC1C,EAAE;IACF,IAAI,CAAC;QACH,MAAM,mBAAmB,EAAE,CAAC;QAE5B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAEnD,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,4BAA4B;YACrC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACrB,SAAS,EAAE,UAAU;SACtB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,iBAAiB,KAAK,CAAC,OAAO,EAAE;YACzC,KAAK,EAAE,KAAK,CAAC,OAAO;SACrB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeProgramSchema } from '../schemas/index.js';
|
|
3
|
+
export declare const executeProgram: (params: z.infer<typeof executeProgramSchema>) => Promise<{
|
|
4
|
+
status: string;
|
|
5
|
+
message: string;
|
|
6
|
+
result: {
|
|
7
|
+
status: string;
|
|
8
|
+
message: string;
|
|
9
|
+
executionId: string | null | undefined;
|
|
10
|
+
tracePath: string | undefined;
|
|
11
|
+
output: string;
|
|
12
|
+
error: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
projectPath: string | undefined;
|
|
15
|
+
error?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
status: string;
|
|
18
|
+
message: string;
|
|
19
|
+
error: any;
|
|
20
|
+
result?: undefined;
|
|
21
|
+
projectPath?: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export { executeProgramSchema };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { checkScarbInstalled, } from '../lib/utils/index.js';
|
|
2
|
+
import { executeProject } from '../lib/utils/workspace.js';
|
|
3
|
+
import { executeProgramSchema } from '../schemas/index.js';
|
|
4
|
+
export const executeProgram = async (params) => {
|
|
5
|
+
try {
|
|
6
|
+
await checkScarbInstalled();
|
|
7
|
+
let executableName = undefined;
|
|
8
|
+
let executableFunction = undefined;
|
|
9
|
+
if (params.executable?.executableType === 'TARGET' &&
|
|
10
|
+
params.executable?.executableValue) {
|
|
11
|
+
executableName = params.executable.executableValue;
|
|
12
|
+
}
|
|
13
|
+
if (params.executable?.executableType === 'FUNCTION' &&
|
|
14
|
+
params.executable?.executableValue) {
|
|
15
|
+
executableFunction = params.executable.executableValue;
|
|
16
|
+
}
|
|
17
|
+
const result = await executeProject(params.path || process.cwd(), params.mode || undefined, executableName, executableFunction, params.arguments || undefined);
|
|
18
|
+
return {
|
|
19
|
+
status: 'success',
|
|
20
|
+
message: 'Program executed successfully',
|
|
21
|
+
result,
|
|
22
|
+
projectPath: params.path,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return {
|
|
27
|
+
status: 'failure',
|
|
28
|
+
message: `Execution failed: ${error.message}`,
|
|
29
|
+
error: error.message,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export { executeProgramSchema };
|
|
34
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/tools/execute.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAO3D,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,MAA4C,EAC5C,EAAE;IACF,IAAI,CAAC;QACH,MAAM,mBAAmB,EAAE,CAAC;QAE5B,IAAI,cAAc,GAAG,SAAS,CAAC;QAC/B,IAAI,kBAAkB,GAAG,SAAS,CAAC;QACnC,IACE,MAAM,CAAC,UAAU,EAAE,cAAc,KAAK,QAAQ;YAC9C,MAAM,CAAC,UAAU,EAAE,eAAe,EAClC,CAAC;YACD,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC;QACrD,CAAC;QACD,IACE,MAAM,CAAC,UAAU,EAAE,cAAc,KAAK,UAAU;YAChD,MAAM,CAAC,UAAU,EAAE,eAAe,EAClC,CAAC;YACD,kBAAkB,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC;QACzD,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,cAAc,CACjC,MAAM,CAAC,IAAI,IAAK,OAAO,CAAC,GAAG,EAAa,EACxC,MAAM,CAAC,IAAI,IAAI,SAAS,EACxB,cAAc,EACd,kBAAkB,EAClB,MAAM,CAAC,SAAS,IAAI,SAAS,CAC9B,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,+BAA+B;YACxC,MAAM;YACN,WAAW,EAAE,MAAM,CAAC,IAAI;SACzB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,qBAAqB,KAAK,CAAC,OAAO,EAAE;YAC7C,KAAK,EAAE,KAAK,CAAC,OAAO;SACrB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { initProjectSchema } from '../schemas/index.js';
|
|
3
|
+
export declare const initProject: (params: z.infer<typeof initProjectSchema>) => Promise<{
|
|
4
|
+
status: string;
|
|
5
|
+
message: string;
|
|
6
|
+
projectName: string;
|
|
7
|
+
path: string;
|
|
8
|
+
error?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
status: string;
|
|
11
|
+
message: string;
|
|
12
|
+
error: any;
|
|
13
|
+
projectName?: undefined;
|
|
14
|
+
path?: undefined;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { checkScarbInstalled } from '../lib/utils/index.js';
|
|
2
|
+
import { initProject as initScarbProject } from '../lib/utils/workspace.js';
|
|
3
|
+
export const initProject = async (params) => {
|
|
4
|
+
try {
|
|
5
|
+
await checkScarbInstalled();
|
|
6
|
+
const projectDir = params.path || process.cwd();
|
|
7
|
+
await initScarbProject({ name: params.projectName, projectDir });
|
|
8
|
+
return {
|
|
9
|
+
status: 'success',
|
|
10
|
+
message: `Project '${params.projectName}' initialized successfully`,
|
|
11
|
+
projectName: params.projectName,
|
|
12
|
+
path: projectDir,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
return {
|
|
17
|
+
status: 'failure',
|
|
18
|
+
message: `Failed to initialize project: ${error.message}`,
|
|
19
|
+
error: error.message,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/tools/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAU5E,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC9B,MAAyC,EACzC,EAAE;IACF,IAAI,CAAC;QACH,MAAM,mBAAmB,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAEhD,MAAM,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC;QAEjE,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,YAAY,MAAM,CAAC,WAAW,4BAA4B;YACnE,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,IAAI,EAAE,UAAU;SACjB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,iCAAiC,KAAK,CAAC,OAAO,EAAE;YACzD,KAAK,EAAE,KAAK,CAAC,OAAO;SACrB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { installScarbSchema } from '../schemas/index.js';
|
|
3
|
+
export declare const installScarb: (params: z.infer<typeof installScarbSchema>) => Promise<string | {
|
|
4
|
+
status: string;
|
|
5
|
+
message: string;
|
|
6
|
+
requestedVersion: string;
|
|
7
|
+
installedVersion: string;
|
|
8
|
+
output: string;
|
|
9
|
+
errors: string | undefined;
|
|
10
|
+
error?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
status: string;
|
|
13
|
+
error: string;
|
|
14
|
+
message: string;
|
|
15
|
+
requestedVersion?: undefined;
|
|
16
|
+
installedVersion?: undefined;
|
|
17
|
+
output?: undefined;
|
|
18
|
+
errors?: undefined;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { getScarbVersion, checkScarbInstalled } from '../lib/utils/index.js';
|
|
2
|
+
import { exec } from 'child_process';
|
|
3
|
+
import { promisify } from 'util';
|
|
4
|
+
const execAsync = promisify(exec);
|
|
5
|
+
export const installScarb = async (params) => {
|
|
6
|
+
try {
|
|
7
|
+
const currentVersion = await getScarbVersion();
|
|
8
|
+
if (currentVersion !== 'unknown') {
|
|
9
|
+
if (params.version && currentVersion.includes(params.version)) {
|
|
10
|
+
return JSON.stringify({
|
|
11
|
+
status: 'success',
|
|
12
|
+
message: `Scarb version ${params.version} is already installed`,
|
|
13
|
+
currentVersion: currentVersion,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
else if (!params.version) {
|
|
17
|
+
return JSON.stringify({
|
|
18
|
+
status: 'success',
|
|
19
|
+
message: `Scarb is already installed (version: ${currentVersion})`,
|
|
20
|
+
currentVersion: currentVersion,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
let installCommand = `curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s --`;
|
|
25
|
+
if (params.version) {
|
|
26
|
+
installCommand += ` -v ${params.version}`;
|
|
27
|
+
}
|
|
28
|
+
const { stdout, stderr } = await execAsync(installCommand, {
|
|
29
|
+
env: {
|
|
30
|
+
...process.env,
|
|
31
|
+
PATH: `${process.env.HOME}/.local/bin:${process.env.PATH}`,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
35
|
+
await checkScarbInstalled();
|
|
36
|
+
const installedVersion = await getScarbVersion();
|
|
37
|
+
return {
|
|
38
|
+
status: 'success',
|
|
39
|
+
message: params.version
|
|
40
|
+
? `Scarb version ${params.version} installed successfully`
|
|
41
|
+
: 'Scarb installed successfully (latest version)',
|
|
42
|
+
requestedVersion: params.version || 'latest',
|
|
43
|
+
installedVersion: installedVersion,
|
|
44
|
+
output: stdout,
|
|
45
|
+
errors: stderr || undefined,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
status: 'failure',
|
|
51
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
52
|
+
message: `Failed to install Scarb${params.version ? ` version ${params.version}` : ''}`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/tools/install.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAA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