@mastra/codemod 0.0.0-playground-studio-again-20251114102707 → 0.0.0-remove-ai-peer-dep-from-evals-20260105220639
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -1
- package/README.md +1 -0
- package/dist/codemods/v1/mcp-get-tools.js +3 -1
- package/dist/codemods/v1/mcp-get-tools.js.map +1 -1
- package/dist/codemods/v1/mcp-get-toolsets.js +3 -1
- package/dist/codemods/v1/mcp-get-toolsets.js.map +1 -1
- package/dist/codemods/v1/memory-readonly-to-options.js +48 -0
- package/dist/codemods/v1/memory-readonly-to-options.js.map +1 -0
- package/dist/codemods/v1/not-implemented/mastra-required-id.js +50 -66
- package/dist/codemods/v1/not-implemented/mastra-required-id.js.map +1 -1
- package/dist/codemods/v1/workflow-stream-vnext.js +36 -0
- package/dist/codemods/v1/workflow-stream-vnext.js.map +1 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mastra/codemod
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-remove-ai-peer-dep-from-evals-20260105220639
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -8,10 +8,72 @@
|
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
+
- Fixed a bug where `[native code]` was incorrectly added to the output ([#10971](https://github.com/mastra-ai/mastra/pull/10971))
|
|
12
|
+
|
|
13
|
+
- **Breaking Change:** `memory.readOnly` has been moved to `memory.options.readOnly` ([#11523](https://github.com/mastra-ai/mastra/pull/11523))
|
|
14
|
+
|
|
15
|
+
The `readOnly` option now lives inside `memory.options` alongside other memory configuration like `lastMessages` and `semanticRecall`.
|
|
16
|
+
|
|
17
|
+
**Before:**
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
agent.stream('Hello', {
|
|
21
|
+
memory: {
|
|
22
|
+
thread: threadId,
|
|
23
|
+
resource: resourceId,
|
|
24
|
+
readOnly: true,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**After:**
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
agent.stream('Hello', {
|
|
33
|
+
memory: {
|
|
34
|
+
thread: threadId,
|
|
35
|
+
resource: resourceId,
|
|
36
|
+
options: {
|
|
37
|
+
readOnly: true,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Migration:** Run the codemod to update your code automatically:
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
npx @mastra/codemod@beta v1/memory-readonly-to-options .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This also fixes issue #11519 where `readOnly: true` was being ignored and messages were saved to memory anyway.
|
|
50
|
+
|
|
51
|
+
- Add `v1/workflow-stream-vnext` codemod. This codemod renames `streamVNext()`, `resumeStreamVNext()`, and `observeStreamVNext()` to their "non-VNext" counterparts. ([#10802](https://github.com/mastra-ai/mastra/pull/10802))
|
|
52
|
+
|
|
53
|
+
- Fix `mastra-required-id`, `mcp-get-toolsets`, and `mcp-get-tools` codemods to add missing imports and instances. ([#10221](https://github.com/mastra-ai/mastra/pull/10221))
|
|
54
|
+
|
|
11
55
|
- - Improve existing codemods ([#9959](https://github.com/mastra-ai/mastra/pull/9959))
|
|
12
56
|
- Make package ESM-only
|
|
13
57
|
- Add new codemods
|
|
14
58
|
|
|
59
|
+
## 0.1.0-beta.4
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Fixed a bug where `[native code]` was incorrectly added to the output ([#10971](https://github.com/mastra-ai/mastra/pull/10971))
|
|
64
|
+
|
|
65
|
+
## 0.1.0-beta.3
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Add `v1/workflow-stream-vnext` codemod. This codemod renames `streamVNext()`, `resumeStreamVNext()`, and `observeStreamVNext()` to their "non-VNext" counterparts. ([#10802](https://github.com/mastra-ai/mastra/pull/10802))
|
|
70
|
+
|
|
71
|
+
## 0.1.0-beta.2
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Fix `mastra-required-id`, `mcp-get-toolsets`, and `mcp-get-tools` codemods to add missing imports and instances. ([#10221](https://github.com/mastra-ai/mastra/pull/10221))
|
|
76
|
+
|
|
15
77
|
## 0.1.0-beta.1
|
|
16
78
|
|
|
17
79
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ npx @mastra/codemod@beta v1/mastra-core-imports .
|
|
|
70
70
|
| `v1/workflow-create-run-async` | Renames `workflow.createRunAsync()` → `workflow.createRun()` |
|
|
71
71
|
| `v1/workflow-list-runs` | Renames `workflow.getWorkflowRuns()` → `workflow.listWorkflowRuns()` |
|
|
72
72
|
| `v1/workflow-run-count` | Renames `context.runCount` → `context.retryCount` in step execution functions |
|
|
73
|
+
| `v1/workflow-stream-vnext` | Renames `streamVNext()`, `resumeStreamVNext()`, and `observeStreamVNext()` |
|
|
73
74
|
|
|
74
75
|
## CLI Options
|
|
75
76
|
|
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
// src/codemods/v1/mcp-get-tools.ts
|
|
10
10
|
var mcp_get_tools_default = createTransformer((_fileInfo, _api, _options, context) => {
|
|
11
11
|
const { j, root } = context;
|
|
12
|
-
const
|
|
12
|
+
const mcpServerInstances = trackClassInstances(j, root, "MCPServer");
|
|
13
|
+
const mcpClientInstances = trackClassInstances(j, root, "MCPClient");
|
|
14
|
+
const mcpInstances = /* @__PURE__ */ new Set([...mcpServerInstances, ...mcpClientInstances]);
|
|
13
15
|
const count = renameMethod(j, root, mcpInstances, "getTools", "listTools");
|
|
14
16
|
if (count > 0) {
|
|
15
17
|
context.hasChanges = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/codemods/v1/mcp-get-tools.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\nimport { trackClassInstances, renameMethod } from '../lib/utils';\n\n/**\n * Transforms MCPServer getTools method to listTools:\n * - mcp.getTools() → mcp.listTools()\n *\n * Only transforms methods on variables that were instantiated with `new MCPServer(...)`\n */\nexport default createTransformer((_fileInfo, _api, _options, context) => {\n const { j, root } = context;\n\n // Track MCPServer instances and rename method in a single optimized pass\n const
|
|
1
|
+
{"version":3,"sources":["../../../src/codemods/v1/mcp-get-tools.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\nimport { trackClassInstances, renameMethod } from '../lib/utils';\n\n/**\n * Transforms MCPServer and MCPClient getTools method to listTools:\n * - mcp.getTools() → mcp.listTools()\n *\n * Only transforms methods on variables that were instantiated with `new MCPServer(...)` or `new MCPClient(...)`\n */\nexport default createTransformer((_fileInfo, _api, _options, context) => {\n const { j, root } = context;\n\n // Track MCPServer and MCPClient instances and rename method in a single optimized pass\n const mcpServerInstances = trackClassInstances(j, root, 'MCPServer');\n const mcpClientInstances = trackClassInstances(j, root, 'MCPClient');\n const mcpInstances = new Set([...mcpServerInstances, ...mcpClientInstances]);\n const count = renameMethod(j, root, mcpInstances, 'getTools', 'listTools');\n\n if (count > 0) {\n context.hasChanges = true;\n context.messages.push(`Transformed MCPServer method: getTools → listTools`);\n }\n});\n"],"mappings":";;;;;;;;;AASA,IAAO,wBAAQ,kBAAkB,CAAC,WAAW,MAAM,UAAU,YAAY;AACvE,QAAM,EAAE,GAAG,KAAK,IAAI;AAGpB,QAAM,qBAAqB,oBAAoB,GAAG,MAAM,WAAW;AACnE,QAAM,qBAAqB,oBAAoB,GAAG,MAAM,WAAW;AACnE,QAAM,eAAe,oBAAI,IAAI,CAAC,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AAC3E,QAAM,QAAQ,aAAa,GAAG,MAAM,cAAc,YAAY,WAAW;AAEzE,MAAI,QAAQ,GAAG;AACb,YAAQ,aAAa;AACrB,YAAQ,SAAS,KAAK,yDAAoD;AAAA,EAC5E;AACF,CAAC;","names":[]}
|
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
// src/codemods/v1/mcp-get-toolsets.ts
|
|
10
10
|
var mcp_get_toolsets_default = createTransformer((_fileInfo, _api, _options, context) => {
|
|
11
11
|
const { j, root } = context;
|
|
12
|
-
const
|
|
12
|
+
const mcpServerInstances = trackClassInstances(j, root, "MCPServer");
|
|
13
|
+
const mcpClientInstances = trackClassInstances(j, root, "MCPClient");
|
|
14
|
+
const mcpInstances = /* @__PURE__ */ new Set([...mcpServerInstances, ...mcpClientInstances]);
|
|
13
15
|
const count = renameMethod(j, root, mcpInstances, "getToolsets", "listToolsets");
|
|
14
16
|
if (count > 0) {
|
|
15
17
|
context.hasChanges = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/codemods/v1/mcp-get-toolsets.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\nimport { trackClassInstances, renameMethod } from '../lib/utils';\n\n/**\n * Transforms MCPServer getToolsets method to listToolsets:\n * - mcp.getToolsets() → mcp.listToolsets()\n *\n * Only transforms methods on variables that were instantiated with `new MCPServer(...)`\n */\nexport default createTransformer((_fileInfo, _api, _options, context) => {\n const { j, root } = context;\n\n // Track MCPServer instances and rename method in a single optimized pass\n const
|
|
1
|
+
{"version":3,"sources":["../../../src/codemods/v1/mcp-get-toolsets.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\nimport { trackClassInstances, renameMethod } from '../lib/utils';\n\n/**\n * Transforms MCPServer and MCPClient getToolsets method to listToolsets:\n * - mcp.getToolsets() → mcp.listToolsets()\n *\n * Only transforms methods on variables that were instantiated with `new MCPServer(...)` or `new MCPClient(...)`\n */\nexport default createTransformer((_fileInfo, _api, _options, context) => {\n const { j, root } = context;\n\n // Track MCPServer and MCPClient instances and rename method in a single optimized pass\n const mcpServerInstances = trackClassInstances(j, root, 'MCPServer');\n const mcpClientInstances = trackClassInstances(j, root, 'MCPClient');\n const mcpInstances = new Set([...mcpServerInstances, ...mcpClientInstances]);\n const count = renameMethod(j, root, mcpInstances, 'getToolsets', 'listToolsets');\n\n if (count > 0) {\n context.hasChanges = true;\n context.messages.push(`Transformed MCPServer method: getToolsets → listToolsets`);\n }\n});\n"],"mappings":";;;;;;;;;AASA,IAAO,2BAAQ,kBAAkB,CAAC,WAAW,MAAM,UAAU,YAAY;AACvE,QAAM,EAAE,GAAG,KAAK,IAAI;AAGpB,QAAM,qBAAqB,oBAAoB,GAAG,MAAM,WAAW;AACnE,QAAM,qBAAqB,oBAAoB,GAAG,MAAM,WAAW;AACnE,QAAM,eAAe,oBAAI,IAAI,CAAC,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AAC3E,QAAM,QAAQ,aAAa,GAAG,MAAM,cAAc,eAAe,cAAc;AAE/E,MAAI,QAAQ,GAAG;AACb,YAAQ,aAAa;AACrB,YAAQ,SAAS,KAAK,+DAA0D;AAAA,EAClF;AACF,CAAC;","names":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createTransformer
|
|
3
|
+
} from "../chunk-JNFQ6J6B.js";
|
|
4
|
+
|
|
5
|
+
// src/codemods/v1/memory-readonly-to-options.ts
|
|
6
|
+
var memory_readonly_to_options_default = createTransformer((_fileInfo, _api, _options, context) => {
|
|
7
|
+
const { j, root } = context;
|
|
8
|
+
root.find(j.ObjectExpression).forEach((path) => {
|
|
9
|
+
const memoryProp = path.value.properties.find(
|
|
10
|
+
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key && prop.key.type === "Identifier" && prop.key.name === "memory"
|
|
11
|
+
);
|
|
12
|
+
if (!memoryProp || !memoryProp.value || memoryProp.value.type !== "ObjectExpression") {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const memoryObj = memoryProp.value;
|
|
16
|
+
const properties = memoryObj.properties;
|
|
17
|
+
const readOnlyPropIndex = properties.findIndex(
|
|
18
|
+
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key && prop.key.type === "Identifier" && prop.key.name === "readOnly"
|
|
19
|
+
);
|
|
20
|
+
if (readOnlyPropIndex === -1) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const readOnlyProp = properties[readOnlyPropIndex];
|
|
24
|
+
const readOnlyValue = readOnlyProp.value;
|
|
25
|
+
properties.splice(readOnlyPropIndex, 1);
|
|
26
|
+
let optionsProp = properties.find(
|
|
27
|
+
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key && prop.key.type === "Identifier" && prop.key.name === "options"
|
|
28
|
+
);
|
|
29
|
+
if (optionsProp && optionsProp.value && optionsProp.value.type === "ObjectExpression") {
|
|
30
|
+
optionsProp.value.properties.push(j.property("init", j.identifier("readOnly"), readOnlyValue));
|
|
31
|
+
} else {
|
|
32
|
+
const newOptionsProp = j.property(
|
|
33
|
+
"init",
|
|
34
|
+
j.identifier("options"),
|
|
35
|
+
j.objectExpression([j.property("init", j.identifier("readOnly"), readOnlyValue)])
|
|
36
|
+
);
|
|
37
|
+
properties.push(newOptionsProp);
|
|
38
|
+
}
|
|
39
|
+
context.hasChanges = true;
|
|
40
|
+
});
|
|
41
|
+
if (context.hasChanges) {
|
|
42
|
+
context.messages.push("Moved memory.readOnly to memory.options.readOnly");
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
memory_readonly_to_options_default as default
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=memory-readonly-to-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/codemods/v1/memory-readonly-to-options.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\n\n/**\n * Moves memory.readOnly to memory.options.readOnly in agent.stream() and agent.generate() calls.\n * The top-level readOnly property has been removed in favor of options.readOnly.\n *\n * Before:\n * agent.stream('Hello', {\n * memory: {\n * thread: threadId,\n * resource: resourceId,\n * readOnly: true,\n * },\n * });\n *\n * After:\n * agent.stream('Hello', {\n * memory: {\n * thread: threadId,\n * resource: resourceId,\n * options: {\n * readOnly: true,\n * },\n * },\n * });\n */\nexport default createTransformer((_fileInfo, _api, _options, context) => {\n const { j, root } = context;\n\n // Find all object expressions that have a 'memory' property\n root.find(j.ObjectExpression).forEach(path => {\n const memoryProp = path.value.properties.find(\n (prop: any) =>\n (prop.type === 'Property' || prop.type === 'ObjectProperty') &&\n prop.key &&\n prop.key.type === 'Identifier' &&\n prop.key.name === 'memory',\n ) as any;\n\n if (!memoryProp || !memoryProp.value || memoryProp.value.type !== 'ObjectExpression') {\n return;\n }\n\n const memoryObj = memoryProp.value;\n const properties = memoryObj.properties;\n\n // Find readOnly property\n const readOnlyPropIndex = properties.findIndex(\n (prop: any) =>\n (prop.type === 'Property' || prop.type === 'ObjectProperty') &&\n prop.key &&\n prop.key.type === 'Identifier' &&\n prop.key.name === 'readOnly',\n );\n\n if (readOnlyPropIndex === -1) {\n return;\n }\n\n const readOnlyProp = properties[readOnlyPropIndex] as any;\n const readOnlyValue = readOnlyProp.value;\n\n // Remove readOnly from top level\n properties.splice(readOnlyPropIndex, 1);\n\n // Find or create options property\n let optionsProp = properties.find(\n (prop: any) =>\n (prop.type === 'Property' || prop.type === 'ObjectProperty') &&\n prop.key &&\n prop.key.type === 'Identifier' &&\n prop.key.name === 'options',\n ) as any;\n\n if (optionsProp && optionsProp.value && optionsProp.value.type === 'ObjectExpression') {\n // Add readOnly to existing options\n optionsProp.value.properties.push(j.property('init', j.identifier('readOnly'), readOnlyValue));\n } else {\n // Create new options object with readOnly\n const newOptionsProp = j.property(\n 'init',\n j.identifier('options'),\n j.objectExpression([j.property('init', j.identifier('readOnly'), readOnlyValue)]),\n );\n properties.push(newOptionsProp);\n }\n\n context.hasChanges = true;\n });\n\n if (context.hasChanges) {\n context.messages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AAE,WAAW,UAAU,GAAG,aAAa,CAAC,CAAC;AAAA,MAClF;AACA,iBAAW,KAAK,cAAc;AAAA,IAChC;AAEA,YAAQ,aAAa;AAAA,EACvB,CAAC;AAED,MAAI,QAAQ,YAAY;AACtB,YAAQ,SAAS,KAAK,kDAAkD;AAAA,EAC1E;AACF,CAAC;","names":[]}
|
|
@@ -9,12 +9,21 @@ import {
|
|
|
9
9
|
var mastra_required_id_default = createTransformer((fileInfo, api, options, context) => {
|
|
10
10
|
const { j, root } = context;
|
|
11
11
|
const COMMENT_MESSAGE = "FIXME(mastra): Add a unique `id` parameter. See: https://mastra.ai/guides/v1/migrations/upgrade-to-v1/mastra#required-id-parameter-for-all-mastra-primitives";
|
|
12
|
+
const STATEMENT_TYPES = /* @__PURE__ */ new Set([
|
|
13
|
+
"VariableDeclaration",
|
|
14
|
+
"ExpressionStatement",
|
|
15
|
+
"ReturnStatement",
|
|
16
|
+
"ExportDefaultDeclaration",
|
|
17
|
+
"ExportNamedDeclaration",
|
|
18
|
+
"Program"
|
|
19
|
+
]);
|
|
12
20
|
const storageClasses = [
|
|
13
21
|
"LibSQLStore",
|
|
14
22
|
"PostgresStore",
|
|
15
23
|
"D1Store",
|
|
16
24
|
"MongoDBStore",
|
|
17
25
|
"DynamoDBStore",
|
|
26
|
+
"LibSQLVector",
|
|
18
27
|
"PgVector",
|
|
19
28
|
"ChromaVector",
|
|
20
29
|
"PineconeVector",
|
|
@@ -24,81 +33,56 @@ var mastra_required_id_default = createTransformer((fileInfo, api, options, cont
|
|
|
24
33
|
"MCPServer"
|
|
25
34
|
];
|
|
26
35
|
const createFunctions = ["createWorkflow", "createTool", "createScorer"];
|
|
36
|
+
function hasIdProperty(args) {
|
|
37
|
+
return args.some((arg) => {
|
|
38
|
+
if (arg.type === "ObjectExpression") {
|
|
39
|
+
return arg.properties?.some(
|
|
40
|
+
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key?.type === "Identifier" && prop.key.name === "id"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function addCommentToAppropriateNode(path) {
|
|
47
|
+
let parent = path.parent;
|
|
48
|
+
if (parent?.value && (parent.value.type === "Property" || parent.value.type === "ObjectProperty")) {
|
|
49
|
+
if (insertCommentOnce(parent.value, j, COMMENT_MESSAGE)) {
|
|
50
|
+
context.hasChanges = true;
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (parent?.value?.type === "ArrayExpression") {
|
|
55
|
+
if (insertCommentOnce(path.value, j, COMMENT_MESSAGE)) {
|
|
56
|
+
context.hasChanges = true;
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
while (parent && !STATEMENT_TYPES.has(parent.value.type)) {
|
|
61
|
+
parent = parent.parent;
|
|
62
|
+
}
|
|
63
|
+
if (parent?.value) {
|
|
64
|
+
let targetNode = parent.value;
|
|
65
|
+
if (targetNode.type !== "ExportDefaultDeclaration" && targetNode.type !== "ExportNamedDeclaration" && parent.parent && (parent.parent.value.type === "ExportDefaultDeclaration" || parent.parent.value.type === "ExportNamedDeclaration")) {
|
|
66
|
+
targetNode = parent.parent.value;
|
|
67
|
+
}
|
|
68
|
+
if (insertCommentOnce(targetNode, j, COMMENT_MESSAGE)) {
|
|
69
|
+
context.hasChanges = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
27
73
|
root.find(j.NewExpression).forEach((path) => {
|
|
28
74
|
if (path.value.callee.type === "Identifier") {
|
|
29
75
|
const className = path.value.callee.name;
|
|
30
|
-
if (storageClasses.includes(className)) {
|
|
31
|
-
|
|
32
|
-
if (arg.type === "ObjectExpression") {
|
|
33
|
-
return arg.properties?.some(
|
|
34
|
-
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key?.type === "Identifier" && prop.key.name === "id"
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
return false;
|
|
38
|
-
});
|
|
39
|
-
if (!hasId) {
|
|
40
|
-
let parent = path.parent;
|
|
41
|
-
const statementTypes = /* @__PURE__ */ new Set([
|
|
42
|
-
"VariableDeclaration",
|
|
43
|
-
"ExpressionStatement",
|
|
44
|
-
"ReturnStatement",
|
|
45
|
-
"ExportDefaultDeclaration",
|
|
46
|
-
"ExportNamedDeclaration",
|
|
47
|
-
"Program"
|
|
48
|
-
]);
|
|
49
|
-
while (parent && !statementTypes.has(parent.value.type)) {
|
|
50
|
-
parent = parent.parent;
|
|
51
|
-
}
|
|
52
|
-
if (parent && parent.value) {
|
|
53
|
-
let targetNode = parent.value;
|
|
54
|
-
if (targetNode.type !== "ExportDefaultDeclaration" && targetNode.type !== "ExportNamedDeclaration" && parent.parent && (parent.parent.value.type === "ExportDefaultDeclaration" || parent.parent.value.type === "ExportNamedDeclaration")) {
|
|
55
|
-
targetNode = parent.parent.value;
|
|
56
|
-
}
|
|
57
|
-
const added = insertCommentOnce(targetNode, j, COMMENT_MESSAGE);
|
|
58
|
-
if (added) {
|
|
59
|
-
context.hasChanges = true;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
76
|
+
if (storageClasses.includes(className) && !hasIdProperty(path.value.arguments)) {
|
|
77
|
+
addCommentToAppropriateNode(path);
|
|
63
78
|
}
|
|
64
79
|
}
|
|
65
80
|
});
|
|
66
81
|
root.find(j.CallExpression).forEach((path) => {
|
|
67
82
|
if (path.value.callee.type === "Identifier") {
|
|
68
83
|
const functionName = path.value.callee.name;
|
|
69
|
-
if (createFunctions.includes(functionName)) {
|
|
70
|
-
|
|
71
|
-
if (arg.type === "ObjectExpression") {
|
|
72
|
-
return arg.properties?.some(
|
|
73
|
-
(prop) => (prop.type === "Property" || prop.type === "ObjectProperty") && prop.key?.type === "Identifier" && prop.key.name === "id"
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
return false;
|
|
77
|
-
});
|
|
78
|
-
if (!hasId) {
|
|
79
|
-
let parent = path.parent;
|
|
80
|
-
const statementTypes = /* @__PURE__ */ new Set([
|
|
81
|
-
"VariableDeclaration",
|
|
82
|
-
"ExpressionStatement",
|
|
83
|
-
"ReturnStatement",
|
|
84
|
-
"ExportDefaultDeclaration",
|
|
85
|
-
"ExportNamedDeclaration",
|
|
86
|
-
"Program"
|
|
87
|
-
]);
|
|
88
|
-
while (parent && !statementTypes.has(parent.value.type)) {
|
|
89
|
-
parent = parent.parent;
|
|
90
|
-
}
|
|
91
|
-
if (parent && parent.value) {
|
|
92
|
-
let targetNode = parent.value;
|
|
93
|
-
if (targetNode.type !== "ExportDefaultDeclaration" && targetNode.type !== "ExportNamedDeclaration" && parent.parent && (parent.parent.value.type === "ExportDefaultDeclaration" || parent.parent.value.type === "ExportNamedDeclaration")) {
|
|
94
|
-
targetNode = parent.parent.value;
|
|
95
|
-
}
|
|
96
|
-
const added = insertCommentOnce(targetNode, j, COMMENT_MESSAGE);
|
|
97
|
-
if (added) {
|
|
98
|
-
context.hasChanges = true;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
84
|
+
if (createFunctions.includes(functionName) && !hasIdProperty(path.value.arguments)) {
|
|
85
|
+
addCommentToAppropriateNode(path);
|
|
102
86
|
}
|
|
103
87
|
}
|
|
104
88
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/codemods/v1/not-implemented/mastra-required-id.ts"],"sourcesContent":["/* eslint-disable no-warning-comments */\nimport { insertCommentOnce } from '../../lib/add-comment';\nimport { createTransformer } from '../../lib/create-transformer';\n\n/**\n * Adds FIXME comments to Mastra primitives that now require an `id` parameter.\n * This includes storages, vector stores, agents, workflows, tools, scorers, and MCP servers.\n *\n * Before:\n * const agent = new Agent({ name: 'Support Agent' });\n * const tool = createTool({ description: 'Get weather' });\n *\n * After:\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const agent = new Agent({ name: 'Support Agent' });\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const tool = createTool({ description: 'Get weather' });\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n const { j, root } = context;\n\n const COMMENT_MESSAGE =\n 'FIXME(mastra): Add a unique `id` parameter. See: https://mastra.ai/guides/v1/migrations/upgrade-to-v1/mastra#required-id-parameter-for-all-mastra-primitives';\n\n // List of class names that require id\n const storageClasses = [\n 'LibSQLStore',\n 'PostgresStore',\n 'D1Store',\n 'MongoDBStore',\n 'DynamoDBStore',\n 'PgVector',\n 'ChromaVector',\n 'PineconeVector',\n 'QdrantVector',\n 'LanceVector',\n 'Agent',\n 'MCPServer',\n ];\n\n // List of function names that require id\n const createFunctions = ['createWorkflow', 'createTool', 'createScorer'];\n\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/codemods/v1/not-implemented/mastra-required-id.ts"],"sourcesContent":["/* eslint-disable no-warning-comments */\nimport type { ASTPath } from 'jscodeshift';\n\nimport { insertCommentOnce } from '../../lib/add-comment';\nimport { createTransformer } from '../../lib/create-transformer';\n\n/**\n * Adds FIXME comments to Mastra primitives that now require an `id` parameter.\n * This includes storages, vector stores, agents, workflows, tools, scorers, and MCP servers.\n *\n * Before:\n * const agent = new Agent({ name: 'Support Agent' });\n * const tool = createTool({ description: 'Get weather' });\n *\n * After:\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const agent = new Agent({ name: 'Support Agent' });\n * /* FIXME(mastra): Add a unique `id` parameter. See: ... *\\/\n * const tool = createTool({ description: 'Get weather' });\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n const { j, root } = context;\n\n const COMMENT_MESSAGE =\n 'FIXME(mastra): Add a unique `id` parameter. See: https://mastra.ai/guides/v1/migrations/upgrade-to-v1/mastra#required-id-parameter-for-all-mastra-primitives';\n\n const STATEMENT_TYPES = new Set([\n 'VariableDeclaration',\n 'ExpressionStatement',\n 'ReturnStatement',\n 'ExportDefaultDeclaration',\n 'ExportNamedDeclaration',\n 'Program',\n ]);\n\n // List of class names that require id\n const storageClasses = [\n 'LibSQLStore',\n 'PostgresStore',\n 'D1Store',\n 'MongoDBStore',\n 'DynamoDBStore',\n 'LibSQLVector',\n 'PgVector',\n 'ChromaVector',\n 'PineconeVector',\n 'QdrantVector',\n 'LanceVector',\n 'Agent',\n 'MCPServer',\n ];\n\n // List of function names that require id\n const createFunctions = ['createWorkflow', 'createTool', 'createScorer'];\n\n /**\n * Checks if an expression's arguments contain an object with an 'id' property\n */\n function hasIdProperty(args: ASTPath<any>['value']['arguments']): boolean {\n return args.some((arg: ASTPath<any>['value']) => {\n if (arg.type === 'ObjectExpression') {\n return arg.properties?.some(\n (prop: ASTPath<any>['value']) =>\n (prop.type === 'Property' || prop.type === 'ObjectProperty') &&\n prop.key?.type === 'Identifier' &&\n prop.key.name === 'id',\n );\n }\n return false;\n });\n }\n\n /**\n * Adds a FIXME comment to the appropriate node based on the expression's context.\n * - If nested in an object property, adds comment to the property\n * - If nested in an array, adds comment to the expression itself\n * - Otherwise, walks up to find the parent statement and adds comment there\n */\n function addCommentToAppropriateNode(path: ASTPath<any>): void {\n let parent = path.parent;\n\n // If the direct parent is an object property, add comment to that property\n if (parent?.value && (parent.value.type === 'Property' || parent.value.type === 'ObjectProperty')) {\n if (insertCommentOnce(parent.value, j, COMMENT_MESSAGE)) {\n context.hasChanges = true;\n }\n return;\n }\n\n // If the parent is an array, add comment directly to the expression\n if (parent?.value?.type === 'ArrayExpression') {\n if (insertCommentOnce(path.value, j, COMMENT_MESSAGE)) {\n context.hasChanges = true;\n }\n return;\n }\n\n // Find the parent statement to add comment\n while (parent && !STATEMENT_TYPES.has(parent.value.type)) {\n parent = parent.parent;\n }\n\n if (parent?.value) {\n // For export declarations, add comment to the export itself\n let targetNode = parent.value;\n if (\n targetNode.type !== 'ExportDefaultDeclaration' &&\n targetNode.type !== 'ExportNamedDeclaration' &&\n parent.parent &&\n (parent.parent.value.type === 'ExportDefaultDeclaration' ||\n parent.parent.value.type === 'ExportNamedDeclaration')\n ) {\n targetNode = parent.parent.value;\n }\n\n if (insertCommentOnce(targetNode, j, COMMENT_MESSAGE)) {\n context.hasChanges = true;\n }\n }\n }\n\n // Find NewExpression for classes\n root.find(j.NewExpression).forEach(path => {\n if (path.value.callee.type === 'Identifier') {\n const className = path.value.callee.name;\n\n if (storageClasses.includes(className) && !hasIdProperty(path.value.arguments)) {\n addCommentToAppropriateNode(path);\n }\n }\n });\n\n // Find CallExpression for create functions\n root.find(j.CallExpression).forEach(path => {\n if (path.value.callee.type === 'Identifier') {\n const functionName = path.value.callee.name;\n\n if (createFunctions.includes(functionName) && !hasIdProperty(path.value.arguments)) {\n addCommentToAppropriateNode(path);\n }\n }\n });\n\n if (context.hasChanges) {\n context.messages.push(`Not Implemented ${fileInfo.path}: Mastra primitives now require a unique id parameter.`);\n }\n});\n"],"mappings":";;;;;;;;AAoBA,IAAO,6BAAQ,kBAAkB,CAAC,UAAU,KAAK,SAAS,YAAY;AACpE,QAAM,EAAE,GAAG,KAAK,IAAI;AAEpB,QAAM,kBACJ;AAEF,QAAM,kBAAkB,oBAAI,IAAI;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAGD,QAAM,iBAAiB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGA,QAAM,kBAAkB,CAAC,kBAAkB,cAAc,cAAc;AAKvE,WAAS,cAAc,MAAmD;AACxE,WAAO,KAAK,KAAK,CAAC,QAA+B;AAC/C,UAAI,IAAI,SAAS,oBAAoB;AACnC,eAAO,IAAI,YAAY;AAAA,UACrB,CAAC,UACE,KAAK,SAAS,cAAc,KAAK,SAAS,qBAC3C,KAAK,KAAK,SAAS,gBACnB,KAAK,IAAI,SAAS;AAAA,QACtB;AAAA,MACF;A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,YAAY,KAAK,CAAC,cAAc,KAAK,MAAM,SAAS,GAAG;AAClF,oCAA4B,IAAI;AAAA,MAClC;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,QAAQ,YAAY;AACtB,YAAQ,SAAS,KAAK,mBAAmB,SAAS,IAAI,wDAAwD;AAAA,EAChH;AACF,CAAC;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createTransformer
|
|
3
|
+
} from "../chunk-JNFQ6J6B.js";
|
|
4
|
+
|
|
5
|
+
// src/codemods/v1/workflow-stream-vnext.ts
|
|
6
|
+
var workflow_stream_vnext_default = createTransformer((fileInfo, api, options, context) => {
|
|
7
|
+
const { j, root } = context;
|
|
8
|
+
const methodRenames = {
|
|
9
|
+
streamVNext: "stream",
|
|
10
|
+
resumeStreamVNext: "resumeStream",
|
|
11
|
+
observeStreamVNext: "observeStream"
|
|
12
|
+
};
|
|
13
|
+
let count = 0;
|
|
14
|
+
root.find(j.CallExpression).forEach((path) => {
|
|
15
|
+
const { callee } = path.value;
|
|
16
|
+
if (callee.type !== "MemberExpression") return;
|
|
17
|
+
if (callee.property.type !== "Identifier") return;
|
|
18
|
+
const oldName = callee.property.name;
|
|
19
|
+
if (!Object.hasOwn(methodRenames, oldName)) return;
|
|
20
|
+
const newName = methodRenames[oldName];
|
|
21
|
+
if (newName) {
|
|
22
|
+
callee.property.name = newName;
|
|
23
|
+
count++;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
if (count > 0) {
|
|
27
|
+
context.hasChanges = true;
|
|
28
|
+
context.messages.push(
|
|
29
|
+
`Renamed workflow run VNext methods: streamVNext/resumeStreamVNext/observeStreamVNext \u2192 stream/resumeStream/observeStream`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
workflow_stream_vnext_default as default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=workflow-stream-vnext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/codemods/v1/workflow-stream-vnext.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\n\n/**\n * Transforms workflow run VNext methods to their standard names:\n * - run.streamVNext() → run.stream()\n * - run.resumeStreamVNext() → run.resumeStream()\n * - run.observeStreamVNext() → run.observeStream()\n *\n * These methods are called on the result of workflow.createRun().\n */\nexport default createTransformer((fileInfo, api, options, context) => {\n const { j, root } = context;\n\n // Map of old method names to new method names\n const methodRenames: Record<string, string> = {\n streamVNext: 'stream',\n resumeStreamVNext: 'resumeStream',\n observeStreamVNext: 'observeStream',\n };\n\n let count = 0;\n\n // Find all call expressions and rename VNext methods\n // These method names are unique enough to Mastra workflow runs\n // that we can safely rename them globally\n root.find(j.CallExpression).forEach(path => {\n const { callee } = path.value;\n if (callee.type !== 'MemberExpression') return;\n if (callee.property.type !== 'Identifier') return;\n\n const oldName = callee.property.name;\n if (!Object.hasOwn(methodRenames, oldName)) return;\n\n const newName = methodRenames[oldName];\n if (newName) {\n callee.property.name = newName;\n count++;\n }\n });\n\n if (count > 0) {\n context.hasChanges = true;\n context.messages.push(\n `Renamed workflow run VNext methods: streamVNext/resumeStreamVNext/observeStreamVNext → stream/resumeStream/observeStream`,\n );\n }\n});\n"],"mappings":";;;;;AAUA,IAAO,gCAAQ,kBAAkB,CAAC,UAAU,KAAK,SAAS,YAAY;AACpE,QAAM,EAAE,GAAG,KAAK,IAAI;AAGpB,QAAM,gBAAwC;AAAA,IAC5C,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,EACtB;AAEA,MAAI,QAAQ;AAKZ,OAAK,KAAK,EAAE,cAAc,EAAE,QAAQ,UAAQ;AAC1C,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,QAAI,OAAO,SAAS,mBAAoB;AACxC,QAAI,OAAO,SAAS,SAAS,aAAc;AAE3C,UAAM,UAAU,OAAO,SAAS;AAChC,QAAI,CAAC,OAAO,OAAO,eAAe,OAAO,EAAG;AAE5C,UAAM,UAAU,cAAc,OAAO;AACrC,QAAI,SAAS;AACX,aAAO,SAAS,OAAO;AACvB;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,QAAQ,GAAG;AACb,YAAQ,aAAa;AACrB,YAAQ,SAAS;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,CAAC;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import debug from 'debug';
|
|
4
|
-
import fs from 'fs';
|
|
5
4
|
import child_process from 'child_process';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
6
7
|
import { fileURLToPath } from 'url';
|
|
7
8
|
import util from 'util';
|
|
8
|
-
import path from 'path';
|
|
9
9
|
import { intro, spinner, outro } from '@clack/prompts';
|
|
10
10
|
|
|
11
11
|
var exec = util.promisify(child_process.exec);
|
|
@@ -116,9 +116,11 @@ var BUNDLE = [
|
|
|
116
116
|
"v1/workflow-create-run-async",
|
|
117
117
|
"v1/workflow-run-count",
|
|
118
118
|
"v1/workflow-list-runs",
|
|
119
|
+
"v1/workflow-stream-vnext",
|
|
119
120
|
"v1/memory-query-to-recall",
|
|
120
121
|
"v1/memory-vector-search-param",
|
|
121
122
|
"v1/memory-message-v2-type",
|
|
123
|
+
"v1/memory-readonly-to-options",
|
|
122
124
|
"v1/storage-get-threads-by-resource",
|
|
123
125
|
"v1/storage-list-messages-by-id",
|
|
124
126
|
"v1/storage-postgres-schema-name",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/transform.ts","../src/lib/bundle.ts","../src/lib/upgrade.ts","../src/index.ts"],"names":["transform","log","debug","error"],"mappings":";;;;;;;;;;AAOA,IAAM,IAAA,GAAO,IAAA,CAAK,SAAA,CAAU,aAAA,CAAc,IAAI,CAAA;A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C,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF,CAAC,CAAA;AAEH,OAAA,CAAQ,KAAA,CAAM,QAAQ,IAAI,CAAA","file":"index.js","sourcesContent":["import fs from 'fs';\nimport child_process from 'node:child_process';\nimport { fileURLToPath } from 'node:url';\nimport util from 'node:util';\nimport path from 'path';\nimport debug from 'debug';\n\nconst exec = util.promisify(child_process.exec);\n\ninterface TransformOptions {\n dry?: boolean;\n print?: boolean;\n verbose?: boolean;\n jscodeshift?: string;\n}\n\nconst log = debug('codemod:transform');\nconst error = debug('codemod:transform:error');\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nfunction getJscodeshift(): string {\n const localJscodeshift = path.resolve(__dirname, '../node_modules/.bin/jscodeshift');\n return fs.existsSync(localJscodeshift) ? localJscodeshift : 'jscodeshift';\n}\n\nfunction buildCommand(codemodPath: string, targetPath: string, jscodeshift: string, options: TransformOptions): string {\n // Ignoring everything under `.*/` covers `.mastra/` along with any other\n // framework build related or otherwise intended-to-be-hidden directories.\n let command = `${jscodeshift} -t ${codemodPath} ${targetPath} \\\n --parser tsx \\\n --ignore-pattern=\"**/node_modules/**\" \\\n --ignore-pattern=\"**/.*/**\" \\\n --ignore-pattern=\"**/dist/**\" \\\n --ignore-pattern=\"**/build/**\" \\\n --ignore-pattern=\"**/*.min.js\" \\\n --ignore-pattern=\"**/*.bundle.js\"`;\n\n if (options.dry) {\n command += ' --dry';\n }\n\n if (options.print) {\n command += ' --print';\n }\n\n if (options.verbose) {\n command += ' --verbose';\n }\n\n if (options.jscodeshift) {\n command += ` ${options.jscodeshift}`;\n }\n\n return command;\n}\n\nexport type TransformErrors = {\n transform: string;\n filename: string;\n summary: string;\n}[];\n\nfunction parseErrors(transform: string, output: string): TransformErrors {\n const errors: TransformErrors = [];\n const errorRegex = /ERR (.+) Transformation error/g;\n const syntaxErrorRegex = /SyntaxError: .+/g;\n\n let match;\n while ((match = errorRegex.exec(output)) !== null) {\n const filename = match[1]!;\n const syntaxErrorMatch = syntaxErrorRegex.exec(output);\n if (syntaxErrorMatch) {\n const summary = syntaxErrorMatch[0];\n errors.push({ transform, filename, summary });\n }\n }\n\n return errors;\n}\n\nfunction parseNotImplementedErrors(transform: string, output: string): TransformErrors {\n const notImplementedErrors: TransformErrors = [];\n const notImplementedRegex = /Not Implemented (.+): (.+)/g;\n\n let match;\n while ((match = notImplementedRegex.exec(output)) !== null) {\n const filename = match[1]!;\n const summary = match[2]!;\n notImplementedErrors.push({ transform, filename, summary });\n }\n\n return notImplementedErrors;\n}\n\nexport async function transform(\n codemod: string,\n source: string,\n transformOptions: TransformOptions,\n options: { logStatus: boolean } = { logStatus: true },\n): Promise<{ errors: TransformErrors; notImplementedErrors: TransformErrors }> {\n if (options.logStatus) {\n log(`Applying codemod '${codemod}': ${source}`);\n }\n const codemodPath = path.resolve(__dirname, `./codemods/${codemod}.js`);\n const targetPath = path.resolve(source);\n const jscodeshift = getJscodeshift();\n const command = buildCommand(codemodPath, targetPath, jscodeshift, transformOptions);\n const { stdout } = await exec(command, { encoding: 'utf8' });\n const errors = parseErrors(codemod, stdout);\n const notImplementedErrors = parseNotImplementedErrors(codemod, stdout);\n if (options.logStatus) {\n if (errors.length > 0) {\n errors.forEach(({ transform, filename, summary }) => {\n error(`Error applying codemod [codemod=${transform}, path=${filename}, summary=${summary}]`);\n });\n }\n\n if (notImplementedErrors.length > 0) {\n log(\n `Some files require manual changes. Please search your codebase for \\`FIXME(mastra): \\` comments and follow the instructions to complete the upgrade.`,\n );\n notImplementedErrors.forEach(({ transform, filename, summary }) => {\n log(`Not Implemented [codemod=${transform}, path=${filename}, summary=${summary}]`);\n });\n }\n }\n\n return { errors, notImplementedErrors };\n}\n","// List of all codemods\nexport const BUNDLE = [\n 'v1/mastra-core-imports',\n 'v1/runtime-context',\n 'v1/not-implemented/mastra-memory',\n 'v1/mastra-plural-apis',\n 'v1/not-implemented/mastra-required-id',\n 'v1/agent-property-access',\n 'v1/agent-voice',\n 'v1/agent-processor-methods',\n 'v1/agent-generate-stream-v-next',\n 'v1/agent-abort-signal',\n 'v1/not-implemented/agent-format-parameter',\n 'v1/not-implemented/agent-to-step',\n 'v1/voice-property-names',\n 'v1/mcp-get-tools',\n 'v1/mcp-get-toolsets',\n 'v1/client-sdk-types',\n 'v1/client-to-ai-sdk-format',\n 'v1/client-offset-limit',\n 'v1/client-get-memory-thread',\n 'v1/experimental-auth',\n 'v1/evals-run-experiment',\n 'v1/evals-scorer-by-name',\n 'v1/evals-prebuilt-imports',\n 'v1/workflow-create-run-async',\n 'v1/workflow-run-count',\n 'v1/workflow-list-runs',\n 'v1/memory-query-to-recall',\n 'v1/memory-vector-search-param',\n 'v1/memory-message-v2-type',\n 'v1/storage-get-threads-by-resource',\n 'v1/storage-list-messages-by-id',\n 'v1/storage-postgres-schema-name',\n 'v1/storage-get-messages-paginated',\n 'v1/storage-list-workflow-runs',\n 'v1/vector-pg-constructor',\n];\n","import { spinner, intro, outro } from '@clack/prompts';\nimport debug from 'debug';\nimport { BUNDLE } from './bundle';\nimport type { TransformErrors } from './transform';\nimport { transform } from './transform';\n\ninterface TransformOptions {\n dry?: true;\n print?: true;\n verbose?: true;\n jscodeshift?: string;\n}\n\nconst log = debug('codemod:upgrade');\nconst error = debug('codemod:upgrade:error');\n\n// Extract v1 codemods from the bundle\nconst v1Bundle = BUNDLE.filter(codemod => codemod.startsWith('v1/'));\n\nasync function runCodemods(codemods: string[], options: TransformOptions, versionLabel: string) {\n const cwd = process.cwd();\n intro(`Starting ${versionLabel} codemods`);\n const modCount = codemods.length;\n const s = spinner();\n\n s.start(`Running ${modCount} ${versionLabel} codemods`);\n\n const allErrors: TransformErrors = [];\n let notImplementedAvailable = false;\n let count = 0;\n for (const [_, codemod] of codemods.entries()) {\n const { errors, notImplementedErrors } = await transform(codemod, cwd, options, {\n logStatus: false,\n });\n allErrors.push(...errors);\n if (notImplementedErrors.length > 0) {\n notImplementedAvailable = true;\n }\n count++;\n s.message(`Codemod ${count}/${modCount} (${codemod})`);\n }\n s.stop(`Ran ${count}/${modCount} codemods.`);\n\n if (allErrors.length > 0) {\n log(`Some ${versionLabel} codemods did not apply successfully to all files. Details:`);\n allErrors.forEach(({ transform, filename, summary }) => {\n error(`codemod=${transform}, path=${filename}, summary=${summary}`);\n });\n }\n\n if (notImplementedAvailable) {\n log(\n `Some ${versionLabel} codemods require manual changes. Please search your codebase for \\`FIXME(mastra): \\` comments and follow the instructions to complete the upgrade.`,\n );\n }\n\n outro(`${versionLabel} codemods complete.`);\n}\n\nexport async function upgradeV1(options: TransformOptions) {\n await runCodemods(v1Bundle, options, 'v1');\n}\n","#! /usr/bin/env node\n\nimport { Command } from 'commander';\nimport debug from 'debug';\nimport { transform } from './lib/transform';\nimport { upgradeV1 } from './lib/upgrade';\n\nconst error = debug('codemod:error');\ndebug.enable('codemod:*');\n\nconst program = new Command();\n\nprogram\n .name('codemod')\n .description('CLI for running Mastra codemods')\n .argument('<codemod>', 'Codemod to run')\n .argument('<source>', 'Path to source files or directory')\n .option('-d, --dry', 'Dry run (no changes are made to files)')\n .option('-p, --print', 'Print transformed files to stdout')\n .option('--verbose', 'Show more information about the transform process')\n .option('-j, --jscodeshift <options>', 'Pass options directly to jscodeshift')\n .action(async (codemod, source, options) => {\n try {\n await transform(codemod, source, options);\n } catch (err: any) {\n error(`Error transforming: ${err}`);\n process.exit(1);\n }\n });\n\nprogram\n .command('v1')\n .description('Apply all v1 codemods (v0.x to v1)')\n .option('-d, --dry', 'Dry run (no changes are made to files)')\n .option('-p, --print', 'Print transformed files to stdout')\n .option('--verbose', 'Show more information about the transform process')\n .option('-j, --jscodeshift <options>', 'Pass options directly to jscodeshift')\n .action(async options => {\n try {\n await upgradeV1(options);\n } catch (err: any) {\n error(`Error transforming: ${err}`);\n process.exit(1);\n }\n });\n\nprogram.parse(process.argv);\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/transform.ts","../src/lib/bundle.ts","../src/lib/upg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KAAW;AACvB,EAAA,IAAI;AACF,IAAA,MAAM,UAAU,OAAO,CAAA;AAAA,EACzB,SAAS,GAAA,EAAU;AACjB,IAAAA,MAAAA,CAAM,CAAA,oBAAA,EAAuB,GAAG,CAAA,CAAE,CAAA;AAClC,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF,CAAC,CAAA;AAEH,OAAA,CAAQ,KAAA,CAAM,QAAQ,IAAI,CAAA","file":"index.js","sourcesContent":["import child_process from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport util from 'node:util';\nimport debug from 'debug';\n\nconst exec = util.promisify(child_process.exec);\n\ninterface TransformOptions {\n dry?: boolean;\n print?: boolean;\n verbose?: boolean;\n jscodeshift?: string;\n}\n\nconst log = debug('codemod:transform');\nconst error = debug('codemod:transform:error');\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nfunction getJscodeshift(): string {\n const localJscodeshift = path.resolve(__dirname, '../node_modules/.bin/jscodeshift');\n return fs.existsSync(localJscodeshift) ? localJscodeshift : 'jscodeshift';\n}\n\nfunction buildCommand(codemodPath: string, targetPath: string, jscodeshift: string, options: TransformOptions): string {\n // Ignoring everything under `.*/` covers `.mastra/` along with any other\n // framework build related or otherwise intended-to-be-hidden directories.\n let command = `${jscodeshift} -t ${codemodPath} ${targetPath} \\\n --parser tsx \\\n --ignore-pattern=\"**/node_modules/**\" \\\n --ignore-pattern=\"**/.*/**\" \\\n --ignore-pattern=\"**/dist/**\" \\\n --ignore-pattern=\"**/build/**\" \\\n --ignore-pattern=\"**/*.min.js\" \\\n --ignore-pattern=\"**/*.bundle.js\"`;\n\n if (options.dry) {\n command += ' --dry';\n }\n\n if (options.print) {\n command += ' --print';\n }\n\n if (options.verbose) {\n command += ' --verbose';\n }\n\n if (options.jscodeshift) {\n command += ` ${options.jscodeshift}`;\n }\n\n return command;\n}\n\nexport type TransformErrors = {\n transform: string;\n filename: string;\n summary: string;\n}[];\n\nfunction parseErrors(transform: string, output: string): TransformErrors {\n const errors: TransformErrors = [];\n const errorRegex = /ERR (.+) Transformation error/g;\n const syntaxErrorRegex = /SyntaxError: .+/g;\n\n let match;\n while ((match = errorRegex.exec(output)) !== null) {\n const filename = match[1]!;\n const syntaxErrorMatch = syntaxErrorRegex.exec(output);\n if (syntaxErrorMatch) {\n const summary = syntaxErrorMatch[0];\n errors.push({ transform, filename, summary });\n }\n }\n\n return errors;\n}\n\nfunction parseNotImplementedErrors(transform: string, output: string): TransformErrors {\n const notImplementedErrors: TransformErrors = [];\n const notImplementedRegex = /Not Implemented (.+): (.+)/g;\n\n let match;\n while ((match = notImplementedRegex.exec(output)) !== null) {\n const filename = match[1]!;\n const summary = match[2]!;\n notImplementedErrors.push({ transform, filename, summary });\n }\n\n return notImplementedErrors;\n}\n\nexport async function transform(\n codemod: string,\n source: string,\n transformOptions: TransformOptions,\n options: { logStatus: boolean } = { logStatus: true },\n): Promise<{ errors: TransformErrors; notImplementedErrors: TransformErrors }> {\n if (options.logStatus) {\n log(`Applying codemod '${codemod}': ${source}`);\n }\n const codemodPath = path.resolve(__dirname, `./codemods/${codemod}.js`);\n const targetPath = path.resolve(source);\n const jscodeshift = getJscodeshift();\n const command = buildCommand(codemodPath, targetPath, jscodeshift, transformOptions);\n const { stdout } = await exec(command, { encoding: 'utf8' });\n const errors = parseErrors(codemod, stdout);\n const notImplementedErrors = parseNotImplementedErrors(codemod, stdout);\n if (options.logStatus) {\n if (errors.length > 0) {\n errors.forEach(({ transform, filename, summary }) => {\n error(`Error applying codemod [codemod=${transform}, path=${filename}, summary=${summary}]`);\n });\n }\n\n if (notImplementedErrors.length > 0) {\n log(\n `Some files require manual changes. Please search your codebase for \\`FIXME(mastra): \\` comments and follow the instructions to complete the upgrade.`,\n );\n notImplementedErrors.forEach(({ transform, filename, summary }) => {\n log(`Not Implemented [codemod=${transform}, path=${filename}, summary=${summary}]`);\n });\n }\n }\n\n return { errors, notImplementedErrors };\n}\n","// List of all codemods\nexport const BUNDLE = [\n 'v1/mastra-core-imports',\n 'v1/runtime-context',\n 'v1/not-implemented/mastra-memory',\n 'v1/mastra-plural-apis',\n 'v1/not-implemented/mastra-required-id',\n 'v1/agent-property-access',\n 'v1/agent-voice',\n 'v1/agent-processor-methods',\n 'v1/agent-generate-stream-v-next',\n 'v1/agent-abort-signal',\n 'v1/not-implemented/agent-format-parameter',\n 'v1/not-implemented/agent-to-step',\n 'v1/voice-property-names',\n 'v1/mcp-get-tools',\n 'v1/mcp-get-toolsets',\n 'v1/client-sdk-types',\n 'v1/client-to-ai-sdk-format',\n 'v1/client-offset-limit',\n 'v1/client-get-memory-thread',\n 'v1/experimental-auth',\n 'v1/evals-run-experiment',\n 'v1/evals-scorer-by-name',\n 'v1/evals-prebuilt-imports',\n 'v1/workflow-create-run-async',\n 'v1/workflow-run-count',\n 'v1/workflow-list-runs',\n 'v1/workflow-stream-vnext',\n 'v1/memory-query-to-recall',\n 'v1/memory-vector-search-param',\n 'v1/memory-message-v2-type',\n 'v1/memory-readonly-to-options',\n 'v1/storage-get-threads-by-resource',\n 'v1/storage-list-messages-by-id',\n 'v1/storage-postgres-schema-name',\n 'v1/storage-get-messages-paginated',\n 'v1/storage-list-workflow-runs',\n 'v1/vector-pg-constructor',\n];\n","import { spinner, intro, outro } from '@clack/prompts';\nimport debug from 'debug';\nimport { BUNDLE } from './bundle';\nimport type { TransformErrors } from './transform';\nimport { transform } from './transform';\n\ninterface TransformOptions {\n dry?: true;\n print?: true;\n verbose?: true;\n jscodeshift?: string;\n}\n\nconst log = debug('codemod:upgrade');\nconst error = debug('codemod:upgrade:error');\n\n// Extract v1 codemods from the bundle\nconst v1Bundle = BUNDLE.filter(codemod => codemod.startsWith('v1/'));\n\nasync function runCodemods(codemods: string[], options: TransformOptions, versionLabel: string) {\n const cwd = process.cwd();\n intro(`Starting ${versionLabel} codemods`);\n const modCount = codemods.length;\n const s = spinner();\n\n s.start(`Running ${modCount} ${versionLabel} codemods`);\n\n const allErrors: TransformErrors = [];\n let notImplementedAvailable = false;\n let count = 0;\n for (const [_, codemod] of codemods.entries()) {\n const { errors, notImplementedErrors } = await transform(codemod, cwd, options, {\n logStatus: false,\n });\n allErrors.push(...errors);\n if (notImplementedErrors.length > 0) {\n notImplementedAvailable = true;\n }\n count++;\n s.message(`Codemod ${count}/${modCount} (${codemod})`);\n }\n s.stop(`Ran ${count}/${modCount} codemods.`);\n\n if (allErrors.length > 0) {\n log(`Some ${versionLabel} codemods did not apply successfully to all files. Details:`);\n allErrors.forEach(({ transform, filename, summary }) => {\n error(`codemod=${transform}, path=${filename}, summary=${summary}`);\n });\n }\n\n if (notImplementedAvailable) {\n log(\n `Some ${versionLabel} codemods require manual changes. Please search your codebase for \\`FIXME(mastra): \\` comments and follow the instructions to complete the upgrade.`,\n );\n }\n\n outro(`${versionLabel} codemods complete.`);\n}\n\nexport async function upgradeV1(options: TransformOptions) {\n await runCodemods(v1Bundle, options, 'v1');\n}\n","#! /usr/bin/env node\n\nimport { Command } from 'commander';\nimport debug from 'debug';\nimport { transform } from './lib/transform';\nimport { upgradeV1 } from './lib/upgrade';\n\nconst error = debug('codemod:error');\ndebug.enable('codemod:*');\n\nconst program = new Command();\n\nprogram\n .name('codemod')\n .description('CLI for running Mastra codemods')\n .argument('<codemod>', 'Codemod to run')\n .argument('<source>', 'Path to source files or directory')\n .option('-d, --dry', 'Dry run (no changes are made to files)')\n .option('-p, --print', 'Print transformed files to stdout')\n .option('--verbose', 'Show more information about the transform process')\n .option('-j, --jscodeshift <options>', 'Pass options directly to jscodeshift')\n .action(async (codemod, source, options) => {\n try {\n await transform(codemod, source, options);\n } catch (err: any) {\n error(`Error transforming: ${err}`);\n process.exit(1);\n }\n });\n\nprogram\n .command('v1')\n .description('Apply all v1 codemods (v0.x to v1)')\n .option('-d, --dry', 'Dry run (no changes are made to files)')\n .option('-p, --print', 'Print transformed files to stdout')\n .option('--verbose', 'Show more information about the transform process')\n .option('-j, --jscodeshift <options>', 'Pass options directly to jscodeshift')\n .action(async options => {\n try {\n await upgradeV1(options);\n } catch (err: any) {\n error(`Error transforming: ${err}`);\n process.exit(1);\n }\n });\n\nprogram.parse(process.argv);\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/codemod",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-remove-ai-peer-dep-from-evals-20260105220639",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Codemod CLI for Mastra",
|
|
7
7
|
"bin": {
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"@types/debug": "^4.1.12",
|
|
29
29
|
"@types/jscodeshift": "^17.3.0",
|
|
30
30
|
"@types/node": "22.13.17",
|
|
31
|
-
"@vitest/coverage-v8": "4.0.
|
|
32
|
-
"@vitest/ui": "4.0.
|
|
31
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
32
|
+
"@vitest/ui": "4.0.12",
|
|
33
33
|
"eslint": "^9.37.0",
|
|
34
34
|
"tsup": "^8.5.0",
|
|
35
|
-
"typescript": "^5.
|
|
36
|
-
"vitest": "
|
|
37
|
-
"@internal/lint": "0.0.0-
|
|
35
|
+
"typescript": "^5.9.3",
|
|
36
|
+
"vitest": "4.0.16",
|
|
37
|
+
"@internal/lint": "0.0.0-remove-ai-peer-dep-from-evals-20260105220639"
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://mastra.ai",
|
|
40
40
|
"repository": {
|