@iyulab/mloop-mcp 0.1.0 → 0.3.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/README.md +179 -178
- package/build/executor.d.ts.map +1 -1
- package/build/executor.js +6 -2
- package/build/executor.js.map +1 -1
- package/build/server.d.ts.map +1 -1
- package/build/server.js +33 -2
- package/build/server.js.map +1 -1
- package/build/tools/analyze.d.ts +69 -0
- package/build/tools/analyze.d.ts.map +1 -0
- package/build/tools/analyze.js +103 -0
- package/build/tools/analyze.js.map +1 -0
- package/build/tools/auto-train.d.ts +63 -0
- package/build/tools/auto-train.d.ts.map +1 -0
- package/build/tools/auto-train.js +108 -0
- package/build/tools/auto-train.js.map +1 -0
- package/build/tools/evaluate.d.ts.map +1 -1
- package/build/tools/evaluate.js +8 -9
- package/build/tools/evaluate.js.map +1 -1
- package/build/tools/feedback.d.ts +64 -0
- package/build/tools/feedback.d.ts.map +1 -0
- package/build/tools/feedback.js +76 -0
- package/build/tools/feedback.js.map +1 -0
- package/build/tools/index.d.ts +44 -0
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +28 -0
- package/build/tools/index.js.map +1 -1
- package/build/tools/info.d.ts +28 -0
- package/build/tools/info.d.ts.map +1 -1
- package/build/tools/info.js +35 -2
- package/build/tools/info.js.map +1 -1
- package/build/tools/init.d.ts +43 -0
- package/build/tools/init.d.ts.map +1 -0
- package/build/tools/init.js +58 -0
- package/build/tools/init.js.map +1 -0
- package/build/tools/logs.d.ts +49 -0
- package/build/tools/logs.d.ts.map +1 -0
- package/build/tools/logs.js +63 -0
- package/build/tools/logs.js.map +1 -0
- package/build/tools/predict.d.ts +8 -0
- package/build/tools/predict.d.ts.map +1 -1
- package/build/tools/predict.js +10 -1
- package/build/tools/predict.js.map +1 -1
- package/build/tools/prep.d.ts +42 -0
- package/build/tools/prep.d.ts.map +1 -0
- package/build/tools/prep.js +56 -0
- package/build/tools/prep.js.map +1 -0
- package/build/tools/project-overview.d.ts +42 -0
- package/build/tools/project-overview.d.ts.map +1 -0
- package/build/tools/project-overview.js +65 -0
- package/build/tools/project-overview.js.map +1 -0
- package/build/tools/quick-start.d.ts +64 -0
- package/build/tools/quick-start.d.ts.map +1 -0
- package/build/tools/quick-start.js +103 -0
- package/build/tools/quick-start.js.map +1 -0
- package/build/tools/sample.d.ts +64 -0
- package/build/tools/sample.d.ts.map +1 -0
- package/build/tools/sample.js +77 -0
- package/build/tools/sample.js.map +1 -0
- package/build/tools/train.d.ts +28 -0
- package/build/tools/train.d.ts.map +1 -1
- package/build/tools/train.js +30 -2
- package/build/tools/train.js.map +1 -1
- package/build/tools/trigger.d.ts +42 -0
- package/build/tools/trigger.d.ts.map +1 -0
- package/build/tools/trigger.js +56 -0
- package/build/tools/trigger.js.map +1 -0
- package/build/tools/validate.d.ts +35 -0
- package/build/tools/validate.d.ts.map +1 -0
- package/build/tools/validate.js +48 -0
- package/build/tools/validate.js.map +1 -0
- package/package.json +6 -1
package/build/tools/info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/tools/info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC7D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../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gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6EAA6E;aAC3F;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,qGAAqG;aACnH;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qEAAqE;aACnF;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;IACD,OAAO,EAAE,IAAI;CACd,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_init tool - Initialize a new MLoop project
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const initSchema: z.ZodObject<{
|
|
6
|
+
projectPath: z.ZodString;
|
|
7
|
+
task: z.ZodEnum<["binary-classification", "multiclass-classification", "regression"]>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
projectPath: string;
|
|
10
|
+
task: "binary-classification" | "multiclass-classification" | "regression";
|
|
11
|
+
}, {
|
|
12
|
+
projectPath: string;
|
|
13
|
+
task: "binary-classification" | "multiclass-classification" | "regression";
|
|
14
|
+
}>;
|
|
15
|
+
export type InitParams = z.infer<typeof initSchema>;
|
|
16
|
+
export declare function init(params: InitParams): Promise<{
|
|
17
|
+
content: Array<{
|
|
18
|
+
type: 'text';
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
isError?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const initTool: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
projectPath: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
task: {
|
|
34
|
+
type: string;
|
|
35
|
+
enum: string[];
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
required: string[];
|
|
40
|
+
};
|
|
41
|
+
handler: typeof init;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/tools/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,UAAU;;;;;;;;;EAIrB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,wBAAsB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAwB7H;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;CAmBpB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_init tool - Initialize a new MLoop project
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { mkdirSync } from 'fs';
|
|
6
|
+
import { executeMloop, buildArgsWithPositional } from '../executor.js';
|
|
7
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
8
|
+
import { formatError } from '../utils/errors.js';
|
|
9
|
+
export const initSchema = z.object({
|
|
10
|
+
projectPath: z.string().describe('Path to create/initialize the MLoop project'),
|
|
11
|
+
task: z.enum(['binary-classification', 'multiclass-classification', 'regression'])
|
|
12
|
+
.describe('ML task type for this project'),
|
|
13
|
+
});
|
|
14
|
+
export async function init(params) {
|
|
15
|
+
try {
|
|
16
|
+
// Ensure project directory exists
|
|
17
|
+
mkdirSync(params.projectPath, { recursive: true });
|
|
18
|
+
const args = buildArgsWithPositional('init', ['.'], { task: params.task });
|
|
19
|
+
const result = await executeMloop(args, { cwd: params.projectPath });
|
|
20
|
+
const output = parseCliOutput(result.stdout);
|
|
21
|
+
return {
|
|
22
|
+
content: [{
|
|
23
|
+
type: 'text',
|
|
24
|
+
text: output || 'Project initialized successfully.',
|
|
25
|
+
}],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{
|
|
31
|
+
type: 'text',
|
|
32
|
+
text: formatError(error),
|
|
33
|
+
}],
|
|
34
|
+
isError: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export const initTool = {
|
|
39
|
+
name: 'mloop_init',
|
|
40
|
+
description: 'Initialize a new MLoop project. Creates mloop.yaml, datasets/, models/ directories.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
projectPath: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'Path to create/initialize the MLoop project',
|
|
47
|
+
},
|
|
48
|
+
task: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
enum: ['binary-classification', 'multiclass-classification', 'regression'],
|
|
51
|
+
description: 'ML task type for this project',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
required: ['projectPath', 'task'],
|
|
55
|
+
},
|
|
56
|
+
handler: init,
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/tools/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MA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MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,qFAAqF;IAClG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6CAA6C;aAC3D;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,uBAAuB,EAAE,2BAA2B,EAAE,YAAY,CAAC;gBAC1E,WAAW,EAAE,+BAA+B;aAC7C;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC;KAClC;IACD,OAAO,EAAE,IAAI;CACd,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_logs tool - View prediction logs
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const logsSchema: z.ZodObject<{
|
|
6
|
+
projectPath: z.ZodString;
|
|
7
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
8
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
projectPath: string;
|
|
11
|
+
modelName?: string | undefined;
|
|
12
|
+
limit?: number | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
projectPath: string;
|
|
15
|
+
modelName?: string | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export type LogsParams = z.infer<typeof logsSchema>;
|
|
19
|
+
export declare function logs(params: LogsParams): Promise<{
|
|
20
|
+
content: Array<{
|
|
21
|
+
type: 'text';
|
|
22
|
+
text: string;
|
|
23
|
+
}>;
|
|
24
|
+
isError?: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const logsTool: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: string;
|
|
31
|
+
properties: {
|
|
32
|
+
projectPath: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
modelName: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
limit: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
};
|
|
47
|
+
handler: typeof logs;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/tools/logs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,UAAU;;;;;;;;;;;;EAIrB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,wBAAsB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAyB7H;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;CAsBpB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_logs tool - View prediction logs
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { executeMloop, buildArgs } from '../executor.js';
|
|
6
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
7
|
+
import { formatError } from '../utils/errors.js';
|
|
8
|
+
export const logsSchema = z.object({
|
|
9
|
+
projectPath: z.string().describe('Path to MLoop project directory'),
|
|
10
|
+
modelName: z.string().optional().describe('Model name (default: "default")'),
|
|
11
|
+
limit: z.number().positive().optional().describe('Maximum number of log entries to show'),
|
|
12
|
+
});
|
|
13
|
+
export async function logs(params) {
|
|
14
|
+
try {
|
|
15
|
+
const cliParams = {};
|
|
16
|
+
if (params.modelName)
|
|
17
|
+
cliParams['name'] = params.modelName;
|
|
18
|
+
if (params.limit)
|
|
19
|
+
cliParams['limit'] = params.limit;
|
|
20
|
+
const args = buildArgs('logs', cliParams);
|
|
21
|
+
const result = await executeMloop(args, { cwd: params.projectPath });
|
|
22
|
+
const output = parseCliOutput(result.stdout);
|
|
23
|
+
return {
|
|
24
|
+
content: [{
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: output || 'No prediction logs found.',
|
|
27
|
+
}],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return {
|
|
32
|
+
content: [{
|
|
33
|
+
type: 'text',
|
|
34
|
+
text: formatError(error),
|
|
35
|
+
}],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export const logsTool = {
|
|
41
|
+
name: 'mloop_logs',
|
|
42
|
+
description: 'View prediction logs for a model. Shows recent predictions with timestamps and results.',
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
projectPath: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Path to MLoop project directory',
|
|
49
|
+
},
|
|
50
|
+
modelName: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'Model name (default: "default")',
|
|
53
|
+
},
|
|
54
|
+
limit: {
|
|
55
|
+
type: 'number',
|
|
56
|
+
description: 'Maximum number of log entries to show',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
required: ['projectPath'],
|
|
60
|
+
},
|
|
61
|
+
handler: logs,
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1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AE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,IAAI,2BAA2B;iBAC5C,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;iBACzB,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,yFAAyF;IACtG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,IAAI;CACd,CAAC"}
|
package/build/tools/predict.d.ts
CHANGED
|
@@ -8,18 +8,21 @@ export declare const predictSchema: z.ZodObject<{
|
|
|
8
8
|
modelName: z.ZodOptional<z.ZodString>;
|
|
9
9
|
output: z.ZodOptional<z.ZodString>;
|
|
10
10
|
log: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
unknownStrategy: z.ZodOptional<z.ZodEnum<["auto", "error", "use-most-frequent", "use-missing"]>>;
|
|
11
12
|
}, "strip", z.ZodTypeAny, {
|
|
12
13
|
projectPath: string;
|
|
13
14
|
dataFile?: string | undefined;
|
|
14
15
|
modelName?: string | undefined;
|
|
15
16
|
output?: string | undefined;
|
|
16
17
|
log?: boolean | undefined;
|
|
18
|
+
unknownStrategy?: "error" | "auto" | "use-most-frequent" | "use-missing" | undefined;
|
|
17
19
|
}, {
|
|
18
20
|
projectPath: string;
|
|
19
21
|
dataFile?: string | undefined;
|
|
20
22
|
modelName?: string | undefined;
|
|
21
23
|
output?: string | undefined;
|
|
22
24
|
log?: boolean | undefined;
|
|
25
|
+
unknownStrategy?: "error" | "auto" | "use-most-frequent" | "use-missing" | undefined;
|
|
23
26
|
}>;
|
|
24
27
|
export type PredictParams = z.infer<typeof predictSchema>;
|
|
25
28
|
export declare function predict(params: PredictParams): Promise<{
|
|
@@ -55,6 +58,11 @@ export declare const predictTool: {
|
|
|
55
58
|
type: string;
|
|
56
59
|
description: string;
|
|
57
60
|
};
|
|
61
|
+
unknownStrategy: {
|
|
62
|
+
type: string;
|
|
63
|
+
enum: string[];
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
58
66
|
};
|
|
59
67
|
required: string[];
|
|
60
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict.d.ts","sourceRoot":"","sources":["../../src/tools/predict.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"predict.d.ts","sourceRoot":"","sources":["../../src/tools/predict.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EAQxB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,wBAAsB,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAqCnI;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCvB,CAAC"}
|
package/build/tools/predict.js
CHANGED
|
@@ -11,10 +11,12 @@ export const predictSchema = z.object({
|
|
|
11
11
|
modelName: z.string().optional().describe('Model name'),
|
|
12
12
|
output: z.string().optional().describe('Output file path'),
|
|
13
13
|
log: z.boolean().optional().describe('Enable prediction logging'),
|
|
14
|
+
unknownStrategy: z.enum(['auto', 'error', 'use-most-frequent', 'use-missing']).optional()
|
|
15
|
+
.describe('Strategy for handling unknown categorical values in prediction data'),
|
|
14
16
|
});
|
|
15
17
|
export async function predict(params) {
|
|
16
18
|
try {
|
|
17
|
-
const { projectPath, dataFile, modelName, output, log } = params;
|
|
19
|
+
const { projectPath, dataFile, modelName, output, log, unknownStrategy } = params;
|
|
18
20
|
// dataFile is a positional argument
|
|
19
21
|
const positional = [];
|
|
20
22
|
if (dataFile)
|
|
@@ -26,6 +28,8 @@ export async function predict(params) {
|
|
|
26
28
|
cliParams['output'] = output;
|
|
27
29
|
if (log)
|
|
28
30
|
cliParams['log'] = true;
|
|
31
|
+
if (unknownStrategy)
|
|
32
|
+
cliParams['unknown-strategy'] = unknownStrategy;
|
|
29
33
|
const args = buildArgsWithPositional('predict', positional, cliParams);
|
|
30
34
|
const result = await executeMloop(args, {
|
|
31
35
|
cwd: projectPath,
|
|
@@ -74,6 +78,11 @@ export const predictTool = {
|
|
|
74
78
|
type: 'boolean',
|
|
75
79
|
description: 'Enable prediction logging to DataStore',
|
|
76
80
|
},
|
|
81
|
+
unknownStrategy: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
enum: ['auto', 'error', 'use-most-frequent', 'use-missing'],
|
|
84
|
+
description: 'Strategy for handling unknown categorical values: "auto" (auto-select based on ratio, default), "error" (fail on unknowns), "use-most-frequent" (replace with most common value), "use-missing" (replace with empty)',
|
|
85
|
+
},
|
|
77
86
|
},
|
|
78
87
|
required: ['projectPath'],
|
|
79
88
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predict.js","sourceRoot":"","sources":["../../src/tools/predict.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACnE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IAChG,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;IACvD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAC1D,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"predict.js","sourceRoot":"","sources":["../../src/tools/predict.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC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AE,sNAAsN;aACpO;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,OAAO;CACjB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_prep tool - Run preprocessing pipeline
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const prepSchema: z.ZodObject<{
|
|
6
|
+
projectPath: z.ZodString;
|
|
7
|
+
config: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
projectPath: string;
|
|
10
|
+
config?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
projectPath: string;
|
|
13
|
+
config?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export type PrepParams = z.infer<typeof prepSchema>;
|
|
16
|
+
export declare function prep(params: PrepParams): Promise<{
|
|
17
|
+
content: Array<{
|
|
18
|
+
type: 'text';
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
isError?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const prepTool: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
projectPath: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
config: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
required: string[];
|
|
39
|
+
};
|
|
40
|
+
handler: typeof prep;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=prep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prep.d.ts","sourceRoot":"","sources":["../../src/tools/prep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,UAAU;;;;;;;;;EAGrB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,wBAAsB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAwB7H;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;CAkBpB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_prep tool - Run preprocessing pipeline
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { executeMloop, buildArgsWithPositional } from '../executor.js';
|
|
6
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
7
|
+
import { formatError } from '../utils/errors.js';
|
|
8
|
+
export const prepSchema = z.object({
|
|
9
|
+
projectPath: z.string().describe('Path to MLoop project directory'),
|
|
10
|
+
config: z.string().optional().describe('Preprocessing config file path'),
|
|
11
|
+
});
|
|
12
|
+
export async function prep(params) {
|
|
13
|
+
try {
|
|
14
|
+
const cliParams = {};
|
|
15
|
+
if (params.config)
|
|
16
|
+
cliParams['config'] = params.config;
|
|
17
|
+
const args = buildArgsWithPositional('prep', ['run'], cliParams);
|
|
18
|
+
const result = await executeMloop(args, { cwd: params.projectPath });
|
|
19
|
+
const output = parseCliOutput(result.stdout);
|
|
20
|
+
return {
|
|
21
|
+
content: [{
|
|
22
|
+
type: 'text',
|
|
23
|
+
text: output || 'Preprocessing completed successfully.',
|
|
24
|
+
}],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: formatError(error),
|
|
32
|
+
}],
|
|
33
|
+
isError: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const prepTool = {
|
|
38
|
+
name: 'mloop_prep',
|
|
39
|
+
description: 'Run the data preprocessing pipeline. Executes preprocessing scripts defined in the project configuration.',
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
projectPath: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Path to MLoop project directory',
|
|
46
|
+
},
|
|
47
|
+
config: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Preprocessing config file path',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ['projectPath'],
|
|
53
|
+
},
|
|
54
|
+
handler: prep,
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=prep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prep.js","sourceRoot":"","sources":["../../src/tools/prep.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACnE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CACzE,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAkB;IAC3C,IAAI,CAAC;QACH,MAAM,SAAS,GAA4B,EAAE,CAAC;QAC9C,IAAI,MAAM,CAAC,MAAM;YAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QAEvD,MAAM,IAAI,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE7C,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,IAAI,uCAAuC;iBACxD,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;iBACzB,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,2GAA2G;IACxH,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAC9C;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,IAAI;CACd,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_project_overview tool - Comprehensive project status in a single call
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const projectOverviewSchema: z.ZodObject<{
|
|
6
|
+
projectPath: z.ZodString;
|
|
7
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
projectPath: string;
|
|
10
|
+
modelName?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
projectPath: string;
|
|
13
|
+
modelName?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export type ProjectOverviewParams = z.infer<typeof projectOverviewSchema>;
|
|
16
|
+
export declare function projectOverview(params: ProjectOverviewParams): Promise<{
|
|
17
|
+
content: Array<{
|
|
18
|
+
type: 'text';
|
|
19
|
+
text: string;
|
|
20
|
+
}>;
|
|
21
|
+
isError?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const projectOverviewTool: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
projectPath: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
modelName: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
required: string[];
|
|
39
|
+
};
|
|
40
|
+
handler: typeof projectOverview;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=project-overview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-overview.d.ts","sourceRoot":"","sources":["../../src/tools/project-overview.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAiCnJ;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;CAkB/B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_project_overview tool - Comprehensive project status in a single call
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { executeMloop, buildArgs } from '../executor.js';
|
|
6
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
7
|
+
import { formatError } from '../utils/errors.js';
|
|
8
|
+
export const projectOverviewSchema = z.object({
|
|
9
|
+
projectPath: z.string().describe('Project directory path'),
|
|
10
|
+
modelName: z.string().optional().describe('Model name (default: "default")'),
|
|
11
|
+
});
|
|
12
|
+
export async function projectOverview(params) {
|
|
13
|
+
try {
|
|
14
|
+
const nameOpts = {};
|
|
15
|
+
if (params.modelName)
|
|
16
|
+
nameOpts['name'] = params.modelName;
|
|
17
|
+
// Run status and list in parallel
|
|
18
|
+
const [statusResult, listResult] = await Promise.all([
|
|
19
|
+
executeMloop(['status'], { cwd: params.projectPath })
|
|
20
|
+
.catch(e => ({ stdout: formatError(e), stderr: '', exitCode: 1 })),
|
|
21
|
+
executeMloop(buildArgs('list', nameOpts), { cwd: params.projectPath })
|
|
22
|
+
.catch(e => ({ stdout: formatError(e), stderr: '', exitCode: 1 })),
|
|
23
|
+
]);
|
|
24
|
+
return {
|
|
25
|
+
content: [{
|
|
26
|
+
type: 'text',
|
|
27
|
+
text: JSON.stringify({
|
|
28
|
+
success: true,
|
|
29
|
+
summary: 'Project overview',
|
|
30
|
+
status: parseCliOutput(statusResult.stdout),
|
|
31
|
+
experiments: parseCliOutput(listResult.stdout),
|
|
32
|
+
}, null, 2),
|
|
33
|
+
}],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
content: [{
|
|
39
|
+
type: 'text',
|
|
40
|
+
text: formatError(error),
|
|
41
|
+
}],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export const projectOverviewTool = {
|
|
47
|
+
name: 'mloop_project_overview',
|
|
48
|
+
description: 'Get a comprehensive overview of the MLoop project: status, all experiments, and production model metrics in a single call.',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
projectPath: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Project directory path',
|
|
55
|
+
},
|
|
56
|
+
modelName: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'Model name (default: "default")',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
required: ['projectPath'],
|
|
62
|
+
},
|
|
63
|
+
handler: projectOverview,
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=project-overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-overview.js","sourceRoot":"","sources":["../../src/tools/project-overview.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IAC1D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;CAC7E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O,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;iBACzB,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,4HAA4H;IACzI,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wBAAwB;aACtC;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,eAAe;CACzB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_quick_start tool - One-step project setup: init -> train -> auto-promote
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const quickStartSchema: z.ZodObject<{
|
|
6
|
+
projectPath: z.ZodString;
|
|
7
|
+
dataFile: z.ZodString;
|
|
8
|
+
label: z.ZodString;
|
|
9
|
+
task: z.ZodEnum<["binary-classification", "multiclass-classification", "regression"]>;
|
|
10
|
+
time: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
projectPath: string;
|
|
13
|
+
dataFile: string;
|
|
14
|
+
label: string;
|
|
15
|
+
task: "binary-classification" | "multiclass-classification" | "regression";
|
|
16
|
+
time?: number | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
projectPath: string;
|
|
19
|
+
dataFile: string;
|
|
20
|
+
label: string;
|
|
21
|
+
task: "binary-classification" | "multiclass-classification" | "regression";
|
|
22
|
+
time?: number | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export type QuickStartParams = z.infer<typeof quickStartSchema>;
|
|
25
|
+
export declare function quickStart(params: QuickStartParams): Promise<{
|
|
26
|
+
content: Array<{
|
|
27
|
+
type: 'text';
|
|
28
|
+
text: string;
|
|
29
|
+
}>;
|
|
30
|
+
isError?: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const quickStartTool: {
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: string;
|
|
37
|
+
properties: {
|
|
38
|
+
projectPath: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
dataFile: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
label: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
task: {
|
|
51
|
+
type: string;
|
|
52
|
+
enum: string[];
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
time: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
required: string[];
|
|
61
|
+
};
|
|
62
|
+
handler: typeof quickStart;
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=quick-start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-start.d.ts","sourceRoot":"","sources":["../../src/tools/quick-start.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAQ3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,wBAAsB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAsDzI;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B1B,CAAC"}
|