@iyulab/mloop-mcp 0.2.1 → 0.4.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 +3 -0
- package/build/server.d.ts.map +1 -1
- package/build/server.js +8 -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 +110 -0
- package/build/tools/analyze.js.map +1 -0
- package/build/tools/features-select.d.ts +68 -0
- package/build/tools/features-select.d.ts.map +1 -0
- package/build/tools/features-select.js +85 -0
- package/build/tools/features-select.js.map +1 -0
- package/build/tools/index.d.ts +12 -0
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +6 -0
- package/build/tools/index.js.map +1 -1
- package/build/tools/prep-plan.d.ts +69 -0
- package/build/tools/prep-plan.d.ts.map +1 -0
- package/build/tools/prep-plan.js +90 -0
- package/build/tools/prep-plan.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,6 +75,9 @@ plugins:
|
|
|
75
75
|
| `mloop_list` | List experiments and their metrics |
|
|
76
76
|
| `mloop_promote` | Promote an experiment to production |
|
|
77
77
|
| `mloop_info` | Analyze and profile datasets |
|
|
78
|
+
| `mloop_analyze` | Run one read-only EDA aspect (profile/correlation/importance/outliers/distribution) as structured JSON |
|
|
79
|
+
| `mloop_prep_plan` | Declare a preprocessing step in mloop.yaml (policy only, no data change) as structured JSON |
|
|
80
|
+
| `mloop_features_select` | Declare feature include/exclude in mloop.yaml (policy only, no data change) as structured JSON |
|
|
78
81
|
| `mloop_status` | Show project status |
|
|
79
82
|
| `mloop_compare` | Compare multiple experiments |
|
|
80
83
|
| `mloop_evaluate` | Evaluate model performance |
|
package/build/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA6BpE;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CA6LxC"}
|
package/build/server.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
// Existing tools
|
|
7
7
|
trainTool, train, trainSchema, predictTool, predict, predictSchema, listTool, list, listSchema, promoteTool, promote, promoteSchema, infoTool, info, infoSchema, statusTool, status, statusSchema, compareTool, compare, compareSchema, evaluateTool, evaluate, evaluateSchema, serveTool, serve, serveSchema,
|
|
8
8
|
// New basic tools
|
|
9
|
-
initTool, init, initSchema, validateTool, validate, validateSchema, prepTool, prep, prepSchema, logsTool, logs, logsSchema, feedbackTool, feedback, feedbackSchema, sampleTool, sample, sampleSchema, triggerTool, trigger, triggerSchema,
|
|
9
|
+
initTool, init, initSchema, validateTool, validate, validateSchema, prepTool, prep, prepSchema, logsTool, logs, logsSchema, feedbackTool, feedback, feedbackSchema, sampleTool, sample, sampleSchema, triggerTool, trigger, triggerSchema, analyzeTool, analyze, analyzeSchema, prepPlanTool, prepPlan, prepPlanSchema, featuresSelectTool, featuresSelect, featuresSelectSchema,
|
|
10
10
|
// Composite workflow tools
|
|
11
11
|
quickStartTool, quickStart, quickStartSchema, autoTrainTool, autoTrain, autoTrainSchema, projectOverviewTool, projectOverview, projectOverviewSchema, } from './tools/index.js';
|
|
12
12
|
/**
|
|
@@ -15,7 +15,7 @@ quickStartTool, quickStart, quickStartSchema, autoTrainTool, autoTrain, autoTrai
|
|
|
15
15
|
export function createServer() {
|
|
16
16
|
const server = new McpServer({
|
|
17
17
|
name: 'mloop-mcp',
|
|
18
|
-
version: '0.
|
|
18
|
+
version: '0.4.0',
|
|
19
19
|
});
|
|
20
20
|
// === Existing tools ===
|
|
21
21
|
// Register mloop_train
|
|
@@ -51,6 +51,12 @@ export function createServer() {
|
|
|
51
51
|
server.tool(sampleTool.name, sampleTool.description, sampleSchema.shape, async (params) => sample(params));
|
|
52
52
|
// Register mloop_trigger
|
|
53
53
|
server.tool(triggerTool.name, triggerTool.description, triggerSchema.shape, async (params) => trigger(params));
|
|
54
|
+
// Register mloop_analyze
|
|
55
|
+
server.tool(analyzeTool.name, analyzeTool.description, analyzeSchema.shape, async (params) => analyze(params));
|
|
56
|
+
// Register mloop_prep_plan
|
|
57
|
+
server.tool(prepPlanTool.name, prepPlanTool.description, prepPlanSchema.shape, async (params) => prepPlan(params));
|
|
58
|
+
// Register mloop_features_select
|
|
59
|
+
server.tool(featuresSelectTool.name, featuresSelectTool.description, featuresSelectSchema.shape, async (params) => featuresSelect(params));
|
|
54
60
|
// === Composite workflow tools ===
|
|
55
61
|
// Register mloop_quick_start
|
|
56
62
|
server.tool(quickStartTool.name, quickStartTool.description, quickStartSchema.shape, async (params) => quickStart(params));
|
package/build/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO;AACL,iBAAiB;AACjB,SAAS,EAAE,KAAK,EAAE,WAAW,EAC7B,WAAW,EAAE,OAAO,EAAE,aAAa,EACnC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAC1B,WAAW,EAAE,OAAO,EAAE,aAAa,EACnC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAC1B,UAAU,EAAE,MAAM,EAAE,YAAY,EAChC,WAAW,EAAE,OAAO,EAAE,aAAa,EACnC,YAAY,EAAE,QAAQ,EAAE,cAAc,EACtC,SAAS,EAAE,KAAK,EAAE,WAAW;AAC7B,kBAAkB;AAClB,QAAQ,EAAE,IAAI,EAAE,UAAU,EAC1B,YAAY,EAAE,QAAQ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AW,EAC9B,oBAAoB,CAAC,KAAK,EAC1B,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAA8C,CAAC,CACjF,CAAC;IAEF,mCAAmC;IAEnC,6BAA6B;IAC7B,MAAM,CAAC,IAAI,CACT,cAAc,CAAC,IAAI,EACnB,cAAc,CAAC,WAAW,EAC1B,gBAAgB,CAAC,KAAK,EACtB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAA0C,CAAC,CACzE,CAAC;IAEF,4BAA4B;IAC5B,MAAM,CAAC,IAAI,CACT,aAAa,CAAC,IAAI,EAClB,aAAa,CAAC,WAAW,EACzB,eAAe,CAAC,KAAK,EACrB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,MAAyC,CAAC,CACvE,CAAC;IAEF,kCAAkC;IAClC,MAAM,CAAC,IAAI,CACT,mBAAmB,CAAC,IAAI,EACxB,mBAAmB,CAAC,WAAW,EAC/B,qBAAqB,CAAC,KAAK,EAC3B,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAA+C,CAAC,CACnF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_analyze tool - Granular, read-only EDA aspects for feature-engineering decisions.
|
|
3
|
+
*
|
|
4
|
+
* 1:1 bridge to the `mloop analyze <aspect>` CLI command group. Each aspect is computed
|
|
5
|
+
* in isolation and returned as a structured JSON envelope ({aspect, available, summary,
|
|
6
|
+
* data, flags}) so an agent/LLM can read one analysis dimension at a time. Read-only:
|
|
7
|
+
* never mutates the data file or mloop.yaml.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export declare const analyzeSchema: z.ZodObject<{
|
|
11
|
+
aspect: z.ZodEnum<["profile", "correlation", "importance", "outliers", "distribution"]>;
|
|
12
|
+
dataFile: z.ZodOptional<z.ZodString>;
|
|
13
|
+
projectPath: z.ZodOptional<z.ZodString>;
|
|
14
|
+
label: z.ZodOptional<z.ZodString>;
|
|
15
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
aspect: "profile" | "correlation" | "importance" | "outliers" | "distribution";
|
|
18
|
+
projectPath?: string | undefined;
|
|
19
|
+
dataFile?: string | undefined;
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
modelName?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
aspect: "profile" | "correlation" | "importance" | "outliers" | "distribution";
|
|
24
|
+
projectPath?: string | undefined;
|
|
25
|
+
dataFile?: string | undefined;
|
|
26
|
+
label?: string | undefined;
|
|
27
|
+
modelName?: string | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export type AnalyzeParams = z.infer<typeof analyzeSchema>;
|
|
30
|
+
export declare function analyze(params: AnalyzeParams): Promise<{
|
|
31
|
+
content: Array<{
|
|
32
|
+
type: 'text';
|
|
33
|
+
text: string;
|
|
34
|
+
}>;
|
|
35
|
+
isError?: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const analyzeTool: {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: string;
|
|
42
|
+
properties: {
|
|
43
|
+
aspect: {
|
|
44
|
+
type: string;
|
|
45
|
+
enum: string[];
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
dataFile: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
projectPath: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
label: {
|
|
57
|
+
type: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
modelName: {
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
required: string[];
|
|
66
|
+
};
|
|
67
|
+
handler: typeof analyze;
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=analyze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/tools/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EA2BxB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,wBAAsB,OAAO,CAC3B,MAAM,EAAE,aAAa,GACpB,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,CAwChF;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCvB,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_analyze tool - Granular, read-only EDA aspects for feature-engineering decisions.
|
|
3
|
+
*
|
|
4
|
+
* 1:1 bridge to the `mloop analyze <aspect>` CLI command group. Each aspect is computed
|
|
5
|
+
* in isolation and returned as a structured JSON envelope ({aspect, available, summary,
|
|
6
|
+
* data, flags}) so an agent/LLM can read one analysis dimension at a time. Read-only:
|
|
7
|
+
* never mutates the data file or mloop.yaml.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { executeMloop, buildArgsWithPositional } from '../executor.js';
|
|
11
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
12
|
+
import { formatError } from '../utils/errors.js';
|
|
13
|
+
export const analyzeSchema = z.object({
|
|
14
|
+
aspect: z
|
|
15
|
+
.enum(['profile', 'correlation', 'importance', 'outliers', 'distribution'])
|
|
16
|
+
.describe('EDA aspect to compute: "profile" (column types, null %, cardinality, constant columns), ' +
|
|
17
|
+
'"correlation" (high-correlation pairs + multicollinearity), ' +
|
|
18
|
+
'"importance" (feature-importance ranking, requires a label), ' +
|
|
19
|
+
'"outliers" (count/rate/isolation-forest threshold), ' +
|
|
20
|
+
'"distribution" (skewness/kurtosis/normality tests)'),
|
|
21
|
+
dataFile: z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Path to the CSV dataset to analyze. Optional: when omitted, defaults to the project's " +
|
|
25
|
+
'configured train data (data.train in mloop.yaml, else datasets/train.csv). Pass projectPath ' +
|
|
26
|
+
'so the default can be resolved.'),
|
|
27
|
+
projectPath: z.string().optional().describe('MLoop project path (for resolving relative paths and the default data file)'),
|
|
28
|
+
label: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Label/target column name (overrides mloop.yaml; required for the "importance" aspect)'),
|
|
32
|
+
modelName: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe('Model name to read label configuration from mloop.yaml (default: "default")'),
|
|
36
|
+
});
|
|
37
|
+
export async function analyze(params) {
|
|
38
|
+
try {
|
|
39
|
+
const { aspect, dataFile, projectPath, label, modelName } = params;
|
|
40
|
+
const cliParams = {};
|
|
41
|
+
if (label)
|
|
42
|
+
cliParams['label'] = label;
|
|
43
|
+
if (modelName)
|
|
44
|
+
cliParams['name'] = modelName;
|
|
45
|
+
// Always emit the structured JSON envelope for LLM consumption.
|
|
46
|
+
cliParams['json'] = true;
|
|
47
|
+
// dataFile is optional: when omitted, the CLI defaults to the project's configured train data.
|
|
48
|
+
const positional = dataFile ? [aspect, dataFile] : [aspect];
|
|
49
|
+
const args = buildArgsWithPositional('analyze', positional, cliParams);
|
|
50
|
+
const result = await executeMloop(args, {
|
|
51
|
+
cwd: projectPath,
|
|
52
|
+
timeout: 600_000, // 10 minutes: importance/distribution can run statistical analysis
|
|
53
|
+
});
|
|
54
|
+
const output = parseCliOutput(result.stdout);
|
|
55
|
+
return {
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: 'text',
|
|
59
|
+
text: output || `No ${aspect} analysis available.`,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
return {
|
|
66
|
+
content: [
|
|
67
|
+
{
|
|
68
|
+
type: 'text',
|
|
69
|
+
text: formatError(error),
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
isError: true,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export const analyzeTool = {
|
|
77
|
+
name: 'mloop_analyze',
|
|
78
|
+
description: 'Run a single, read-only exploratory-data-analysis (EDA) aspect on a dataset and return a ' +
|
|
79
|
+
'structured JSON envelope for feature-engineering decisions. Aspects: profile, correlation, ' +
|
|
80
|
+
'importance (needs a label), outliers, distribution. Never mutates the data file or mloop.yaml.',
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
aspect: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
enum: ['profile', 'correlation', 'importance', 'outliers', 'distribution'],
|
|
87
|
+
description: 'EDA aspect: "profile" (types/null%/cardinality/constant), "correlation" (high-correlation pairs + multicollinearity), "importance" (feature ranking, requires a label), "outliers" (count/rate/isolation-forest threshold), "distribution" (skewness/kurtosis/normality).',
|
|
88
|
+
},
|
|
89
|
+
dataFile: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: "Path to the CSV dataset to analyze. Optional: when omitted, defaults to the project's configured train data (data.train in mloop.yaml, else datasets/train.csv). Pass projectPath so the default can be resolved.",
|
|
92
|
+
},
|
|
93
|
+
projectPath: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
description: 'MLoop project path for resolving relative paths and the default data file',
|
|
96
|
+
},
|
|
97
|
+
label: {
|
|
98
|
+
type: 'string',
|
|
99
|
+
description: 'Label/target column name (overrides mloop.yaml; required for the "importance" aspect)',
|
|
100
|
+
},
|
|
101
|
+
modelName: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
description: 'Model name to read label configuration from mloop.yaml (default: "default")',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
required: ['aspect'],
|
|
107
|
+
},
|
|
108
|
+
handler: analyze,
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=analyze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/tools/analyze.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;SAC1E,QAAQ,CACP,0FAA0F;QACxF,8DAA8D;QAC9D,+DAA+D;QAC/D,sDAAsD;QACtD,oDAAoD,CACvD;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,wFAAwF;QACtF,8FAA8F;QAC9F,iCAAiC,CACpC;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IAC1H,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uFAA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F;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,2FAA2F;QAC3F,6FAA6F;QAC7F,gGAAgG;IAClG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC;gBAC1E,WAAW,EACT,2QAA2Q;aAC9Q;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mNAAmN;aACtN;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2EAA2E;aACzF;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uFAAuF;aACrG;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6EAA6E;aAC3F;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;IACD,OAAO,EAAE,OAAO;CACjB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_features_select tool - Declare feature include/exclude in mloop.yaml (policy only).
|
|
3
|
+
*
|
|
4
|
+
* 1:1 bridge to the `mloop features select` CLI command. Edits column include/exclude via
|
|
5
|
+
* ColumnOverride (Type:"ignore") without touching data. `keep` computes the complement
|
|
6
|
+
* against the train-data header (the label is always kept). Returns a structured JSON
|
|
7
|
+
* envelope ({command, model, applied, ignored, warnings}).
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export declare const featuresSelectSchema: z.ZodObject<{
|
|
11
|
+
projectPath: z.ZodString;
|
|
12
|
+
drop: z.ZodOptional<z.ZodString>;
|
|
13
|
+
keep: z.ZodOptional<z.ZodString>;
|
|
14
|
+
reset: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
projectPath: string;
|
|
18
|
+
modelName?: string | undefined;
|
|
19
|
+
drop?: string | undefined;
|
|
20
|
+
keep?: string | undefined;
|
|
21
|
+
reset?: boolean | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
projectPath: string;
|
|
24
|
+
modelName?: string | undefined;
|
|
25
|
+
drop?: string | undefined;
|
|
26
|
+
keep?: string | undefined;
|
|
27
|
+
reset?: boolean | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export type FeaturesSelectParams = z.infer<typeof featuresSelectSchema>;
|
|
30
|
+
export declare function featuresSelect(params: FeaturesSelectParams): Promise<{
|
|
31
|
+
content: Array<{
|
|
32
|
+
type: 'text';
|
|
33
|
+
text: string;
|
|
34
|
+
}>;
|
|
35
|
+
isError?: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const featuresSelectTool: {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: string;
|
|
42
|
+
properties: {
|
|
43
|
+
projectPath: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
drop: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
keep: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
reset: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
modelName: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
required: string[];
|
|
65
|
+
};
|
|
66
|
+
handler: typeof featuresSelect;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=features-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features-select.d.ts","sourceRoot":"","sources":["../../src/tools/features-select.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAS/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,GAC3B,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,CAyBhF;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC9B,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_features_select tool - Declare feature include/exclude in mloop.yaml (policy only).
|
|
3
|
+
*
|
|
4
|
+
* 1:1 bridge to the `mloop features select` CLI command. Edits column include/exclude via
|
|
5
|
+
* ColumnOverride (Type:"ignore") without touching data. `keep` computes the complement
|
|
6
|
+
* against the train-data header (the label is always kept). Returns a structured JSON
|
|
7
|
+
* envelope ({command, model, applied, ignored, warnings}).
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { executeMloop, buildArgsWithPositional } from '../executor.js';
|
|
11
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
12
|
+
import { formatError } from '../utils/errors.js';
|
|
13
|
+
export const featuresSelectSchema = z.object({
|
|
14
|
+
projectPath: z.string().describe('Path to the MLoop project directory'),
|
|
15
|
+
drop: z.string().optional().describe('Comma-separated columns to exclude from features (e.g. "id,ts")'),
|
|
16
|
+
keep: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Comma-separated columns to keep; all other columns are excluded (label always kept)'),
|
|
20
|
+
reset: z.boolean().optional().describe('Remove all "ignore" overrides (clears feature exclusions)'),
|
|
21
|
+
modelName: z.string().optional().describe('Model name in mloop.yaml (default: "default")'),
|
|
22
|
+
});
|
|
23
|
+
export async function featuresSelect(params) {
|
|
24
|
+
try {
|
|
25
|
+
const { projectPath, drop, keep, reset, modelName } = params;
|
|
26
|
+
const cliParams = {};
|
|
27
|
+
if (drop)
|
|
28
|
+
cliParams['drop'] = drop;
|
|
29
|
+
if (keep)
|
|
30
|
+
cliParams['keep'] = keep;
|
|
31
|
+
if (reset)
|
|
32
|
+
cliParams['reset'] = true;
|
|
33
|
+
if (modelName)
|
|
34
|
+
cliParams['name'] = modelName;
|
|
35
|
+
// Always emit the structured JSON envelope for LLM consumption.
|
|
36
|
+
cliParams['json'] = true;
|
|
37
|
+
const args = buildArgsWithPositional('features', ['select'], cliParams);
|
|
38
|
+
const result = await executeMloop(args, { cwd: projectPath });
|
|
39
|
+
const output = parseCliOutput(result.stdout);
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: 'text', text: output || 'Feature selection updated.' }],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return {
|
|
46
|
+
content: [{ type: 'text', text: formatError(error) }],
|
|
47
|
+
isError: true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export const featuresSelectTool = {
|
|
52
|
+
name: 'mloop_features_select',
|
|
53
|
+
description: 'Declare which columns are features in mloop.yaml (policy only — never changes data). ' +
|
|
54
|
+
"Exclude columns with drop='a,b', keep only certain columns with keep='a,b' (all others " +
|
|
55
|
+
'excluded, label always kept), or clear all exclusions with reset=true. Returns a JSON ' +
|
|
56
|
+
'envelope listing the excluded (ignored) columns.',
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
projectPath: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'Path to the MLoop project directory',
|
|
63
|
+
},
|
|
64
|
+
drop: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
description: 'Comma-separated columns to exclude from features (e.g. "id,ts")',
|
|
67
|
+
},
|
|
68
|
+
keep: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'Comma-separated columns to keep; all others excluded (label always kept)',
|
|
71
|
+
},
|
|
72
|
+
reset: {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
description: 'Remove all "ignore" overrides (clears feature exclusions)',
|
|
75
|
+
},
|
|
76
|
+
modelName: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
description: 'Model name in mloop.yaml (default: "default")',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
required: ['projectPath'],
|
|
82
|
+
},
|
|
83
|
+
handler: featuresSelect,
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=features-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features-select.js","sourceRoot":"","sources":["../../src/tools/features-select.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACvE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iEAAiE,CAAC;IACvG,IAAI,EAAE,C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,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACrD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,uFAAuF;QACvF,yFAAyF;QACzF,wFAAwF;QACxF,kDAAkD;IACpD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;aACnD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iEAAiE;aAC/E;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0EAA0E;aACxF;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,2DAA2D;aACzE;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+CAA+C;aAC7D;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;IACD,OAAO,EAAE,cAAc;CACxB,CAAC"}
|
package/build/tools/index.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ export { logsTool, logs, logsSchema, type LogsParams } from './logs.js';
|
|
|
17
17
|
export { feedbackTool, feedback, feedbackSchema, type FeedbackParams } from './feedback.js';
|
|
18
18
|
export { sampleTool, sample, sampleSchema, type SampleParams } from './sample.js';
|
|
19
19
|
export { triggerTool, trigger, triggerSchema, type TriggerParams } from './trigger.js';
|
|
20
|
+
export { analyzeTool, analyze, analyzeSchema, type AnalyzeParams } from './analyze.js';
|
|
21
|
+
export { prepPlanTool, prepPlan, prepPlanSchema, type PrepPlanParams } from './prep-plan.js';
|
|
22
|
+
export { featuresSelectTool, featuresSelect, featuresSelectSchema, type FeaturesSelectParams } from './features-select.js';
|
|
20
23
|
export { quickStartTool, quickStart, quickStartSchema, type QuickStartParams } from './quick-start.js';
|
|
21
24
|
export { autoTrainTool, autoTrain, autoTrainSchema, type AutoTrainParams } from './auto-train.js';
|
|
22
25
|
export { projectOverviewTool, projectOverview, projectOverviewSchema, type ProjectOverviewParams } from './project-overview.js';
|
|
@@ -71,6 +74,15 @@ export declare const allTools: readonly [{
|
|
|
71
74
|
}, {
|
|
72
75
|
readonly name: "mloop_trigger";
|
|
73
76
|
readonly module: () => Promise<typeof import("./trigger.js")>;
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "mloop_analyze";
|
|
79
|
+
readonly module: () => Promise<typeof import("./analyze.js")>;
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "mloop_prep_plan";
|
|
82
|
+
readonly module: () => Promise<typeof import("./prep-plan.js")>;
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "mloop_features_select";
|
|
85
|
+
readonly module: () => Promise<typeof import("./features-select.js")>;
|
|
74
86
|
}, {
|
|
75
87
|
readonly name: "mloop_quick_start";
|
|
76
88
|
readonly module: () => Promise<typeof import("./quick-start.js")>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACvF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5F,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG3H,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEhI;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BX,CAAC"}
|
package/build/tools/index.js
CHANGED
|
@@ -19,6 +19,9 @@ export { logsTool, logs, logsSchema } from './logs.js';
|
|
|
19
19
|
export { feedbackTool, feedback, feedbackSchema } from './feedback.js';
|
|
20
20
|
export { sampleTool, sample, sampleSchema } from './sample.js';
|
|
21
21
|
export { triggerTool, trigger, triggerSchema } from './trigger.js';
|
|
22
|
+
export { analyzeTool, analyze, analyzeSchema } from './analyze.js';
|
|
23
|
+
export { prepPlanTool, prepPlan, prepPlanSchema } from './prep-plan.js';
|
|
24
|
+
export { featuresSelectTool, featuresSelect, featuresSelectSchema } from './features-select.js';
|
|
22
25
|
// Composite workflow tools
|
|
23
26
|
export { quickStartTool, quickStart, quickStartSchema } from './quick-start.js';
|
|
24
27
|
export { autoTrainTool, autoTrain, autoTrainSchema } from './auto-train.js';
|
|
@@ -45,6 +48,9 @@ export const allTools = [
|
|
|
45
48
|
{ name: 'mloop_feedback', module: () => import('./feedback.js') },
|
|
46
49
|
{ name: 'mloop_sample', module: () => import('./sample.js') },
|
|
47
50
|
{ name: 'mloop_trigger', module: () => import('./trigger.js') },
|
|
51
|
+
{ name: 'mloop_analyze', module: () => import('./analyze.js') },
|
|
52
|
+
{ name: 'mloop_prep_plan', module: () => import('./prep-plan.js') },
|
|
53
|
+
{ name: 'mloop_features_select', module: () => import('./features-select.js') },
|
|
48
54
|
// Composite workflow tools
|
|
49
55
|
{ name: 'mloop_quick_start', module: () => import('./quick-start.js') },
|
|
50
56
|
{ name: 'mloop_auto_train', module: () => import('./auto-train.js') },
|
package/build/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAqB,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,a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CLI command. Records preprocessing decisions in
|
|
5
|
+
* mloop.yaml without touching data — statistical fit still happens fold-internally at
|
|
6
|
+
* train time. Returns a structured JSON envelope ({command, model, task, applied, prep,
|
|
7
|
+
* warnings}) where each prep step reports its leakage category and fold-safety, so an
|
|
8
|
+
* agent can decide whether a transform is safe before training.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export declare const prepPlanSchema: z.ZodObject<{
|
|
12
|
+
projectPath: z.ZodString;
|
|
13
|
+
set: z.ZodOptional<z.ZodString>;
|
|
14
|
+
columns: z.ZodOptional<z.ZodString>;
|
|
15
|
+
remove: z.ZodOptional<z.ZodString>;
|
|
16
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
projectPath: string;
|
|
19
|
+
modelName?: string | undefined;
|
|
20
|
+
set?: string | undefined;
|
|
21
|
+
columns?: string | undefined;
|
|
22
|
+
remove?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
projectPath: string;
|
|
25
|
+
modelName?: string | undefined;
|
|
26
|
+
set?: string | undefined;
|
|
27
|
+
columns?: string | undefined;
|
|
28
|
+
remove?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type PrepPlanParams = z.infer<typeof prepPlanSchema>;
|
|
31
|
+
export declare function prepPlan(params: PrepPlanParams): Promise<{
|
|
32
|
+
content: Array<{
|
|
33
|
+
type: 'text';
|
|
34
|
+
text: string;
|
|
35
|
+
}>;
|
|
36
|
+
isError?: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const prepPlanTool: {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: string;
|
|
43
|
+
properties: {
|
|
44
|
+
projectPath: {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
set: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
columns: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
remove: {
|
|
57
|
+
type: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
modelName: {
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
required: string[];
|
|
66
|
+
};
|
|
67
|
+
handler: typeof prepPlan;
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=prep-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prep-plan.d.ts","sourceRoot":"","sources":["../../src/tools/prep-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAYzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,cAAc,GACrB,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,CAyBhF;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCxB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mloop_prep_plan tool - Declaratively edit prep steps in mloop.yaml (policy only).
|
|
3
|
+
*
|
|
4
|
+
* 1:1 bridge to the `mloop prep plan` CLI command. Records preprocessing decisions in
|
|
5
|
+
* mloop.yaml without touching data — statistical fit still happens fold-internally at
|
|
6
|
+
* train time. Returns a structured JSON envelope ({command, model, task, applied, prep,
|
|
7
|
+
* warnings}) where each prep step reports its leakage category and fold-safety, so an
|
|
8
|
+
* agent can decide whether a transform is safe before training.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import { executeMloop, buildArgsWithPositional } from '../executor.js';
|
|
12
|
+
import { parseCliOutput } from '../utils/parser.js';
|
|
13
|
+
import { formatError } from '../utils/errors.js';
|
|
14
|
+
export const prepPlanSchema = z.object({
|
|
15
|
+
projectPath: z.string().describe('Path to the MLoop project directory'),
|
|
16
|
+
set: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Add/replace a prep step: "type[:method]" (e.g. "normalize:z-score", "drop-duplicates")'),
|
|
20
|
+
columns: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Comma-separated target columns for the --set/--remove step (e.g. "a,b")'),
|
|
24
|
+
remove: z.string().optional().describe('Remove prep step(s) of this type'),
|
|
25
|
+
modelName: z.string().optional().describe('Model name in mloop.yaml (default: "default")'),
|
|
26
|
+
});
|
|
27
|
+
export async function prepPlan(params) {
|
|
28
|
+
try {
|
|
29
|
+
const { projectPath, set, columns, remove, modelName } = params;
|
|
30
|
+
const cliParams = {};
|
|
31
|
+
if (set)
|
|
32
|
+
cliParams['set'] = set;
|
|
33
|
+
if (columns)
|
|
34
|
+
cliParams['columns'] = columns;
|
|
35
|
+
if (remove)
|
|
36
|
+
cliParams['remove'] = remove;
|
|
37
|
+
if (modelName)
|
|
38
|
+
cliParams['name'] = modelName;
|
|
39
|
+
// Always emit the structured JSON envelope for LLM consumption.
|
|
40
|
+
cliParams['json'] = true;
|
|
41
|
+
const args = buildArgsWithPositional('prep', ['plan'], cliParams);
|
|
42
|
+
const result = await executeMloop(args, { cwd: projectPath });
|
|
43
|
+
const output = parseCliOutput(result.stdout);
|
|
44
|
+
return {
|
|
45
|
+
content: [{ type: 'text', text: output || 'Prep plan updated.' }],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
content: [{ type: 'text', text: formatError(error) }],
|
|
51
|
+
isError: true,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export const prepPlanTool = {
|
|
56
|
+
name: 'mloop_prep_plan',
|
|
57
|
+
description: 'Declare a preprocessing step in mloop.yaml (policy only — never changes data). ' +
|
|
58
|
+
"Add/replace with set='type[:method]' (+ optional columns), remove with remove='type', " +
|
|
59
|
+
'or omit both to list the current plan. Returns a JSON envelope where each step reports its ' +
|
|
60
|
+
'leakage category (preFeaturizer/csvStage/unsupportedLeakageWarn) and fold-safety. ' +
|
|
61
|
+
'Statistical fit happens fold-internally at train time.',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
projectPath: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'Path to the MLoop project directory',
|
|
68
|
+
},
|
|
69
|
+
set: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
description: 'Add/replace a prep step: "type[:method]" (e.g. "normalize:z-score", "drop-duplicates")',
|
|
72
|
+
},
|
|
73
|
+
columns: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'Comma-separated target columns for the set/remove step (e.g. "a,b")',
|
|
76
|
+
},
|
|
77
|
+
remove: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: 'Remove prep step(s) of this type',
|
|
80
|
+
},
|
|
81
|
+
modelName: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
description: 'Model name in mloop.yaml (default: "default")',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ['projectPath'],
|
|
87
|
+
},
|
|
88
|
+
handler: prepPlan,
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=prep-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prep-plan.js","sourceRoot":"","sources":["../../src/tools/prep-plan.ts"],"names":[],"mappings":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