mastra 1.23.0 → 1.24.0-alpha.3

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/dist/analytics/index.js +1 -1
  3. package/dist/{analytics-CzFlN5Uy.js → analytics-BYD-0skL.js} +18 -47
  4. package/dist/analytics-BYD-0skL.js.map +1 -0
  5. package/dist/commands/api/index.d.ts +16 -4
  6. package/dist/commands/api/index.d.ts.map +1 -1
  7. package/dist/commands/api/route-metadata.generated.d.ts +16 -4
  8. package/dist/commands/api/route-metadata.generated.d.ts.map +1 -1
  9. package/dist/commands/api/target.d.ts +7 -0
  10. package/dist/commands/api/target.d.ts.map +1 -1
  11. package/dist/commands/create/create.js +2 -2
  12. package/dist/commands/dev/DevBundler.d.ts.map +1 -1
  13. package/dist/commands/experiment/ExperimentBundler.d.ts +8 -1
  14. package/dist/commands/experiment/ExperimentBundler.d.ts.map +1 -1
  15. package/dist/commands/experiment/runtime.d.ts +6 -1
  16. package/dist/commands/experiment/runtime.d.ts.map +1 -1
  17. package/dist/commands/experiment/runtime.js +1 -1
  18. package/dist/commands/utils.d.ts.map +1 -1
  19. package/dist/{create-fMweiYxb.js → create-BtEOXKIV.js} +2 -2
  20. package/dist/{create-fMweiYxb.js.map → create-BtEOXKIV.js.map} +1 -1
  21. package/dist/docs/SKILL.md +1 -1
  22. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  23. package/dist/factory/assets/{engine-javascript-BNgVJebg.js → engine-javascript-C9tvPsYZ.js} +1 -1
  24. package/dist/factory/assets/{index-DK8o7iXh.js → index-BnYPYL8U.js} +511 -330
  25. package/dist/factory/assets/{index-BDZM2jVu.css → index-Dg3txWx6.css} +1 -1
  26. package/dist/factory/index.html +2 -2
  27. package/dist/factory/routes-manifest.json +7 -0
  28. package/dist/index.js +158 -29
  29. package/dist/index.js.map +1 -1
  30. package/dist/{runtime-HAbtsZz-.js → runtime-Dak4Uahw.js} +9 -5
  31. package/dist/runtime-Dak4Uahw.js.map +1 -0
  32. package/dist/studio/assets/{core-CbvhbAyq.js → core-DVz2-Wsn.js} +1 -1
  33. package/dist/studio/assets/{index-DUdZoPvJ.js → index-DIljPW-E.js} +2 -2
  34. package/dist/studio/assets/{main-tYRi5VOV.js → main-Bjv_qCgm.js} +231 -233
  35. package/dist/studio/assets/{style-CUsRHh-q.css → style-Dxd-2Gjn.css} +1 -1
  36. package/dist/studio/index.html +2 -2
  37. package/package.json +5 -5
  38. package/dist/analytics-CzFlN5Uy.js.map +0 -1
  39. package/dist/runtime-HAbtsZz-.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,121 @@
1
1
  # mastra
2
2
 
3
+ ## 1.24.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Added a manual "Re-review" action to Factory board cards for open pull requests in the Done lane, so PRs that received new commits after their review can be sent back through a fresh review run. ([#20883](https://github.com/mastra-ai/mastra/pull/20883))
8
+
9
+ - Updated dependencies [[`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`d7cf7fa`](https://github.com/mastra-ai/mastra/commit/d7cf7fafc1ae1b50bd8462dd0e6c671a8606db93), [`0f9a448`](https://github.com/mastra-ai/mastra/commit/0f9a448502157e59f7b76f24360ad497168f5ef8), [`289f4ce`](https://github.com/mastra-ai/mastra/commit/289f4ce16e3293370440172132c52ee787cbc09f), [`4f16ff8`](https://github.com/mastra-ai/mastra/commit/4f16ff824bf2f9b0ddc93f210477c10c8a4fb1ab), [`1c67d85`](https://github.com/mastra-ai/mastra/commit/1c67d85e9da8285662f4dbbf47e0378c3fee0747), [`ba24be6`](https://github.com/mastra-ai/mastra/commit/ba24be662439c331ab23a600041f93803c89eca8), [`842b5fe`](https://github.com/mastra-ai/mastra/commit/842b5fe22b6a7fa811bd14e48eb9af523ac989f2), [`80bdf3a`](https://github.com/mastra-ai/mastra/commit/80bdf3ae16ade6ff63bde0cb16fa2df8ab7dd4dd), [`9ba1247`](https://github.com/mastra-ai/mastra/commit/9ba12470c77f1c03642d720ce67e517e878f666e), [`fd96298`](https://github.com/mastra-ai/mastra/commit/fd96298a8367622f4ebfcaa97b5b6c1fbbd14564), [`6a84954`](https://github.com/mastra-ai/mastra/commit/6a84954a2667f85b6d59da652dab1bbff007ccb0), [`52d8ef0`](https://github.com/mastra-ai/mastra/commit/52d8ef03801f1deb7ee48532fc4190dd4a33916c), [`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`efd5c81`](https://github.com/mastra-ai/mastra/commit/efd5c81cc25fde3c2ddd86fc1178deb4ec176e19), [`0976933`](https://github.com/mastra-ai/mastra/commit/0976933142333ec78451feef265b68bcb45aa5e7), [`242b945`](https://github.com/mastra-ai/mastra/commit/242b94558777bfbdeb42cbfea84afff0b6ad0633), [`fea5cae`](https://github.com/mastra-ai/mastra/commit/fea5caedc7e2cfea51784a15e015952692027abf), [`4b59f78`](https://github.com/mastra-ai/mastra/commit/4b59f786cbc9a7d1ef07a07517dbd4b96865e99d), [`7010c5d`](https://github.com/mastra-ai/mastra/commit/7010c5d15728bf9c5dfe4fb6b1bf80ce23bf143a), [`7010c5d`](https://github.com/mastra-ai/mastra/commit/7010c5d15728bf9c5dfe4fb6b1bf80ce23bf143a)]:
10
+ - @mastra/core@1.58.0-alpha.3
11
+ - @mastra/deployer@1.58.0-alpha.3
12
+
13
+ ## 1.23.1-alpha.2
14
+
15
+ ### Patch Changes
16
+
17
+ - Fixed messages typed while a user session's workspace is still preparing. The composer stays usable and sends the message straight to the controller, which holds it until the workspace is ready — the browser no longer queues it in memory, so the message survives leaving the page. Image attachments work during preparation too, and a workspace that fails to come up reports the server's own error instead of a generic timeout. Chat requests are no longer silently retried on network failures, which could deliver the same message several times after a dropped connection. ([#20780](https://github.com/mastra-ai/mastra/pull/20780))
18
+
19
+ - Updated dependencies [[`b4c89b4`](https://github.com/mastra-ai/mastra/commit/b4c89b4371b0c86da57403ad1a3b3ef0681f3128), [`e44e8f3`](https://github.com/mastra-ai/mastra/commit/e44e8f370b66c339ddcaba946d33da6d3c3f06cd), [`c967a5e`](https://github.com/mastra-ai/mastra/commit/c967a5eec150c5dc5418c4a4388982d1fb7ad27c), [`b4c89b4`](https://github.com/mastra-ai/mastra/commit/b4c89b4371b0c86da57403ad1a3b3ef0681f3128), [`f53d5bd`](https://github.com/mastra-ai/mastra/commit/f53d5bd4885b29e4ac29a428a6044088ea8d6aa3), [`bda2235`](https://github.com/mastra-ai/mastra/commit/bda22353ee28f2df0eaea555f7cae1549f979c0b), [`a7eb4a1`](https://github.com/mastra-ai/mastra/commit/a7eb4a11450f6170274ed5141bffe821d4fdd5a6), [`2f9ef3f`](https://github.com/mastra-ai/mastra/commit/2f9ef3f4ca06fc2dcdd5088c26b7f4da6a016791), [`e7eefcb`](https://github.com/mastra-ai/mastra/commit/e7eefcb162cda7c493e8c3bf43050ead0efbcb2c), [`4d7aca2`](https://github.com/mastra-ai/mastra/commit/4d7aca2fe75f225c83d1502d63079568e6ec163f), [`c4ec889`](https://github.com/mastra-ai/mastra/commit/c4ec889561c0264c43f66d04d587bee4ce35e792), [`9be8878`](https://github.com/mastra-ai/mastra/commit/9be8878dcf0388e84fc4873e0eec27bd49b881a4)]:
20
+ - @mastra/core@1.58.0-alpha.2
21
+ - @mastra/deployer@1.58.0-alpha.2
22
+
23
+ ## 1.23.1-alpha.1
24
+
25
+ ### Patch Changes
26
+
27
+ - Preserve experiment name, description, and metadata from HTTP trigger requests. ([#20578](https://github.com/mastra-ai/mastra/pull/20578))
28
+
29
+ - Improved Factory board cards by replacing long inline rule errors with a compact error badge that reveals details on hover. ([#20841](https://github.com/mastra-ai/mastra/pull/20841))
30
+
31
+ - dependencies updates: ([#19783](https://github.com/mastra-ai/mastra/pull/19783))
32
+ - Updated dependency [`posthog-node@^5.46.1` ↗︎](https://www.npmjs.com/package/posthog-node/v/5.46.1) (from `^5.37.0`, in `dependencies`)
33
+
34
+ - Fixed `mastra api --url` returning 401 when pointed at a Mastra Cloud Studio or Factory instance. The CLI now uses your logged-in credentials to authenticate requests to `*.studio.mastra.cloud` and `*.factory.mastra.cloud` (and the corresponding staging domains). User-hosted `*.server.mastra.cloud` URLs and custom URLs are unchanged, and an explicit `--header Authorization: ...` always wins. ([#20828](https://github.com/mastra-ai/mastra/pull/20828))
35
+
36
+ - Fixed experiment workers to: ([#20719](https://github.com/mastra-ai/mastra/pull/20719))
37
+
38
+ - emit Platform-compatible protocol version metadata and accepted-event negotiation details
39
+ - report a deterministic error when the customer `#mastra` module does not export `mastra`
40
+ - install explicitly configured external dependencies that are loaded dynamically at runtime
41
+ - disable worker-side persistence and resolve relative project roots
42
+ - produce reproducible, relocatable manifests that exclude installed dependencies, temporary build metadata, and source-machine paths, and reject absolute or artifact-escaping symlinks
43
+
44
+ - Fixed Git initialization during project creation. Git now uses the user's global Git configuration. ([#20791](https://github.com/mastra-ai/mastra/pull/20791))
45
+
46
+ - Added the delta polling parameters (`mode`, `after`, `limit`) to the lightweight trace list route in `mastra api`'s route metadata, so a polling client can fetch only the traces recorded since its last request: ([#20677](https://github.com/mastra-ai/mastra/pull/20677))
47
+
48
+ ```bash
49
+ mastra api trace list '{"mode":"delta","after":"<deltaCursor>","limit":100}'
50
+ ```
51
+
52
+ Each response returns a `deltaCursor` to pass as `after` on the next poll.
53
+
54
+ - Included auto-triaged GitHub issues when building teammate options for the Factory board filter dropdown so triaged-only assignees are selectable. ([#20841](https://github.com/mastra-ai/mastra/pull/20841))
55
+
56
+ - Updated dependencies [[`e7109ee`](https://github.com/mastra-ai/mastra/commit/e7109ee6f731bacc79c885906f3c7dca8d8f013a), [`772c0c8`](https://github.com/mastra-ai/mastra/commit/772c0c897cec383258de2e6178147f8014767c7b), [`578bf2e`](https://github.com/mastra-ai/mastra/commit/578bf2e6a88e9d5b8bf502204e15a95dfbb679ae), [`06b2d87`](https://github.com/mastra-ai/mastra/commit/06b2d87e63bcdd0ed59215c6789692b9b12de376), [`ac01d63`](https://github.com/mastra-ai/mastra/commit/ac01d6355974aec73fdb8781449ed12bac582094), [`a810a05`](https://github.com/mastra-ai/mastra/commit/a810a058f62ad407cfc1701e0be36ae91145d7cf), [`f8da216`](https://github.com/mastra-ai/mastra/commit/f8da21633e7eb0e31c9ce0fc30567870d19416d3), [`180a953`](https://github.com/mastra-ai/mastra/commit/180a953efb4b9c1c74de4d387839860f94045fb2), [`6104347`](https://github.com/mastra-ai/mastra/commit/61043473ba6bfd0a25156824e853e13165562e6c), [`45bfb88`](https://github.com/mastra-ai/mastra/commit/45bfb88fd52f1dd3be20e2a38905777c96499c90), [`e3b9307`](https://github.com/mastra-ai/mastra/commit/e3b9307098daefbfae2a52ae2ef51bc9fc701190), [`d6834c5`](https://github.com/mastra-ai/mastra/commit/d6834c5a7866b16734d23900163c2414ed70d791), [`c52d346`](https://github.com/mastra-ai/mastra/commit/c52d3462ec831a5d95926ecd3d3373f5928ad2e5), [`f8da216`](https://github.com/mastra-ai/mastra/commit/f8da21633e7eb0e31c9ce0fc30567870d19416d3), [`5018d58`](https://github.com/mastra-ai/mastra/commit/5018d588799898f443c303d8bbd2dbcc4562fbb3), [`0023e79`](https://github.com/mastra-ai/mastra/commit/0023e7919431078280abd11c89d1edeae35fcc69), [`c2ad51e`](https://github.com/mastra-ai/mastra/commit/c2ad51e2467f901eecba8c9f4a45e22a50bd7c18), [`3dc97ea`](https://github.com/mastra-ai/mastra/commit/3dc97ea415fad353b48a13095fad1835933cc12a), [`3d01cd3`](https://github.com/mastra-ai/mastra/commit/3d01cd387321b6f9c5cac31d487c84bf51b19c78), [`7bf3086`](https://github.com/mastra-ai/mastra/commit/7bf308663f0115ca74ad20554ade740f06640859), [`a8dd139`](https://github.com/mastra-ai/mastra/commit/a8dd1391a9fe9a6632c25809ef236980afa9a020), [`e5786be`](https://github.com/mastra-ai/mastra/commit/e5786be02bb903073082bd9d6da880ebaacc343f), [`2093fbd`](https://github.com/mastra-ai/mastra/commit/2093fbd53bb744bae19ec89f6d73db9a66fbe8a7), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`7b4393d`](https://github.com/mastra-ai/mastra/commit/7b4393d557411fdcf07b0e30e5acaf7cc85154ae)]:
57
+ - @mastra/core@1.58.0-alpha.1
58
+ - @mastra/deployer@1.58.0-alpha.1
59
+
60
+ ## 1.23.1-alpha.0
61
+
62
+ ### Patch Changes
63
+
64
+ - **Added file-based schedules for agents** ([#20711](https://github.com/mastra-ai/mastra/pull/20711))
65
+
66
+ File-based agents can now declare recurring tasks in a `schedules/` directory next to their tools and skills. Mastra registers them into schedule storage at startup, so a scheduled agent no longer needs any runtime registration code.
67
+
68
+ Each file is one schedule: a cron expression plus exactly one execution mode. Prompt mode runs the owning agent with a fixed message.
69
+
70
+ ```typescript
71
+ // src/mastra/agents/support/schedules/heartbeat.ts
72
+ import { defineSchedule } from '@mastra/core/agent';
73
+
74
+ export default defineSchedule({
75
+ cron: '*/5 * * * *',
76
+ prompt: 'Check system health and report any failures.',
77
+ });
78
+ ```
79
+
80
+ Handler mode computes the fire when it triggers, and returning `null` skips it.
81
+
82
+ ```typescript
83
+ // src/mastra/agents/support/schedules/billing/sweep.ts
84
+ import { defineSchedule } from '@mastra/core/agent';
85
+
86
+ export default defineSchedule({
87
+ cron: '0 3 * * *',
88
+ handler: async () => {
89
+ const overdue = await findOverdueInvoices();
90
+ if (overdue.length === 0) return null;
91
+ return { prompt: `Chase ${overdue.length} overdue invoices.` };
92
+ },
93
+ });
94
+ ```
95
+
96
+ A schedule's id is its path under `schedules/` with the extension stripped, so `billing/sweep.ts` becomes `billing/sweep` and stays stable across builds. Editing a cron patches the stored schedule and recomputes its next fire time, deleting the file deletes the schedule, and pausing a schedule through the API survives a redeploy. Schedules created with `mastra.schedules.create(...)` are in a separate namespace and are never touched by this sync.
97
+
98
+ A schedule can also be a Markdown file, using cron frontmatter with the document body as the prompt.
99
+
100
+ ```text
101
+ // src/mastra/agents/support/schedules/cleanup.md
102
+ ---
103
+ cron: "0 3 * * *"
104
+ ---
105
+
106
+ Review tickets untouched for 30 days and close the ones that are resolved.
107
+ ```
108
+
109
+ Declaring a schedule is enough to start the scheduler. Schedules are supported on root agents only; a `schedules/` directory under `subagents/` fails the build, because the scheduler cannot resolve a subagent as a run target.
110
+
111
+ `defineSchedule` is exported from both `@mastra/core/agent` and `@mastra/core/schedules`, so authoring a file-based agent needs a single import path.
112
+
113
+ Build and dev support the same convention: schedules are discovered at build time, Markdown schedules fail the build with a message naming the file when the cron is missing, the body is empty, the frontmatter has an unknown field, or the YAML is unparseable. That last case has its own message because a leading `*` is a YAML alias, so `cron: */5 * * * *` needs quoting. The dev server rebuilds when a Markdown schedule changes.
114
+
115
+ - Updated dependencies [[`45a9147`](https://github.com/mastra-ai/mastra/commit/45a914741f578754d79d8b7de7b4e4f304d8e14a), [`990611b`](https://github.com/mastra-ai/mastra/commit/990611ba76eb876d86c9c594371ae5f02f94b432), [`ed5d606`](https://github.com/mastra-ai/mastra/commit/ed5d606739c5e3fbdfa9f272df7809aa5ab43b1d)]:
116
+ - @mastra/core@1.58.0-alpha.0
117
+ - @mastra/deployer@1.58.0-alpha.0
118
+
3
119
  ## 1.23.0
4
120
 
5
121
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- import { i as setAnalytics, n as bucketApiHost, r as getAnalytics, t as PosthogAnalytics } from "../analytics-CzFlN5Uy.js";
1
+ import { i as setAnalytics, n as bucketApiHost, r as getAnalytics, t as PosthogAnalytics } from "../analytics-BYD-0skL.js";
2
2
  export { PosthogAnalytics, bucketApiHost, getAnalytics, setAnalytics };
@@ -1534,52 +1534,23 @@ async function isGitInitialized({ cwd }) {
1534
1534
  * Initialize a git repository in the specified directory.
1535
1535
  */
1536
1536
  async function gitInit({ cwd }) {
1537
- const isolatedConfigDirectory = await fsPromises.mkdtemp(path.join(os.tmpdir(), "mastra-git-config-"));
1538
- const emptyHooksDirectory = path.join(isolatedConfigDirectory, "hooks");
1539
- const emptyGlobalConfig = path.join(isolatedConfigDirectory, "global.gitconfig");
1540
- await fsPromises.mkdir(emptyHooksDirectory);
1541
- await fsPromises.writeFile(emptyGlobalConfig, "");
1542
- const env = {
1543
- GIT_CONFIG_NOSYSTEM: "1",
1544
- GIT_CONFIG_GLOBAL: emptyGlobalConfig,
1545
- GIT_CONFIG_COUNT: "0"
1546
- };
1547
- try {
1548
- await execa("git", ["init"], {
1549
- cwd,
1550
- stdio: "ignore",
1551
- env
1552
- });
1553
- await fsPromises.appendFile(path.join(cwd, ".git", "info", "exclude"), "\n.env\n.env.*\n!.env.example\n!.env.*.example\n");
1554
- await execa("git", ["add", "-A"], {
1555
- cwd,
1556
- stdio: "ignore",
1557
- env
1558
- });
1559
- await execa("git", [
1560
- "-c",
1561
- "user.name=Mastra",
1562
- "-c",
1563
- "user.email=noreply@mastra.ai",
1564
- "-c",
1565
- "commit.gpgSign=false",
1566
- "-c",
1567
- `core.hooksPath=${emptyHooksDirectory}`,
1568
- "commit",
1569
- "--no-verify",
1570
- "-m",
1571
- "Initial commit from Mastra"
1572
- ], {
1573
- cwd,
1574
- stdio: "ignore",
1575
- env
1576
- });
1577
- } finally {
1578
- await fsPromises.rm(isolatedConfigDirectory, {
1579
- recursive: true,
1580
- force: true
1581
- });
1582
- }
1537
+ await execa("git", ["init"], {
1538
+ cwd,
1539
+ stdio: "ignore"
1540
+ });
1541
+ await execa("git", ["add", "-A"], {
1542
+ cwd,
1543
+ stdio: "ignore"
1544
+ });
1545
+ await execa("git", [
1546
+ "commit",
1547
+ "-m",
1548
+ "Initial commit from Mastra",
1549
+ "--author=\"dane-ai-mastra[bot] <dane-ai-mastra[bot]@users.noreply.github.com>\""
1550
+ ], {
1551
+ cwd,
1552
+ stdio: "ignore"
1553
+ });
1583
1554
  }
1584
1555
  //#endregion
1585
1556
  //#region src/analytics/index.ts
@@ -1778,4 +1749,4 @@ var PosthogAnalytics = class PosthogAnalytics {
1778
1749
  //#endregion
1779
1750
  export { DepsService as A, validateProjectName as B, writeAPIKey as C, writeIndexFile as D, writeCodeSample as E, normalizeCreateCommandOptions as F, parseCreateLLMProvider as I, parseCreateTimeout as L, CREATE_LLM_PROVIDERS as M, configureCreateCommand as N, writeObservabilityEnv as O, getCreateMode as P, selectMatchingDistTag as R, readPackageName as S, writeClaudeMarkdown as T, checkForPkgJson as _, getPackageManager as a, getAPIKey as b, isGitInitialized as c, parseMcp as d, shouldSkipDotenvLoading as f, checkAndInstallCoreDeps as g, LLMProvider as h, setAnalytics as i, installMastraDocsMCPServer as j, FileService as k, parseComponents as l, COMPONENTS as m, bucketApiHost as n, getVersionTag as o, wrapAction as p, getAnalytics as r, gitInit as s, PosthogAnalytics as t, parseLlmProvider as u, createComponentsDir as v, writeAgentsMarkdown as w, interactivePrompt as x, createMastraDir as y, validateCreateOptionConflicts as z };
1780
1751
 
1781
- //# sourceMappingURL=analytics-CzFlN5Uy.js.map
1752
+ //# sourceMappingURL=analytics-BYD-0skL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-BYD-0skL.js","names":["fs","fsExtra","fs","fsExtra"],"sources":["../src/commands/create/command.ts","../src/commands/init/mcp-docs-server-install.ts","../src/utils/package-manager.ts","../src/services/service.deps.ts","../src/services/service.env.ts","../src/services/service.file.ts","../src/commands/init/utils.ts","../src/commands/utils.ts","../src/analytics/index.ts"],"sourcesContent":["import path from 'node:path';\nimport type { Command } from 'commander';\nimport { InvalidArgumentError } from 'commander';\n\nexport const CREATE_LLM_PROVIDERS = [\n { value: 'openai', label: 'OpenAI' },\n { value: 'anthropic', label: 'Anthropic' },\n { value: 'google', label: 'Gemini' },\n { value: 'xai', label: 'xAI' },\n] as const;\n\nexport type CreateLLMProvider = (typeof CREATE_LLM_PROVIDERS)[number]['value'];\nexport type CreateMode = 'managed' | 'template' | 'empty';\n\nexport interface CreateCommandOptions {\n empty?: boolean;\n llm?: CreateLLMProvider;\n llmApiKey?: string;\n skills: boolean;\n git: boolean;\n template?: string | boolean;\n timeout: number;\n install: boolean;\n}\n\nexport interface NormalizedCreateOptions {\n projectName?: string;\n empty: boolean;\n llmProvider?: CreateLLMProvider;\n llmApiKey?: string;\n skills: boolean;\n git: boolean;\n template?: string | boolean;\n timeout: number;\n install: boolean;\n}\n\nexport function parseCreateLLMProvider(value: string): CreateLLMProvider {\n if (!CREATE_LLM_PROVIDERS.some(provider => provider.value === value)) {\n throw new InvalidArgumentError(\n `Choose a valid provider: ${CREATE_LLM_PROVIDERS.map(provider => provider.value).join(', ')}`,\n );\n }\n\n return value as CreateLLMProvider;\n}\n\nexport function parseCreateTimeout(value: string): number {\n if (!/^\\d+$/.test(value)) {\n throw new InvalidArgumentError('Timeout must be a positive integer');\n }\n\n const timeout = Number(value);\n if (!Number.isSafeInteger(timeout) || timeout <= 0) {\n throw new InvalidArgumentError('Timeout must be a positive integer');\n }\n\n return timeout;\n}\n\nexport function configureCreateCommand(command: Command) {\n return command\n .description('Create a new Mastra project')\n .argument('[project-name]', 'Directory name of the project')\n .option('--empty', 'Create an empty project')\n .option(\n '-l, --llm <provider>',\n `Model provider (${CREATE_LLM_PROVIDERS.map(provider => provider.value).join(', ')})`,\n parseCreateLLMProvider,\n )\n .option('-k, --llm-api-key <key>', 'API key for the model provider')\n .option('--no-skills', 'Do not install Mastra skills')\n .option('--no-git', 'Do not initialize a git repository')\n .option('--no-install', 'Skip installing dependencies')\n .option(\n '-t, --template [template]',\n 'Create from a template slug or public GitHub URL, or select interactively when omitted',\n )\n .option('--timeout <milliseconds>', 'Package installation timeout in milliseconds', parseCreateTimeout, 60_000);\n}\n\nexport function normalizeCreateCommandOptions(\n projectName: string | undefined,\n options: CreateCommandOptions,\n): NormalizedCreateOptions {\n return {\n projectName,\n empty: options.empty ?? false,\n llmProvider: options.llm,\n llmApiKey: options.llmApiKey,\n skills: options.skills,\n git: options.git,\n template: options.template,\n timeout: options.timeout,\n install: options.install,\n };\n}\n\nexport function getCreateMode(options: Pick<NormalizedCreateOptions, 'empty' | 'template'>): CreateMode {\n if (options.empty) return 'empty';\n if (options.template !== undefined) return 'template';\n return 'managed';\n}\n\nexport function validateCreateOptionConflicts(options: NormalizedCreateOptions): CreateMode {\n if (options.empty && options.template !== undefined) {\n throw new Error(`The --empty and --template options can't be used together`);\n }\n\n const mode = getCreateMode(options);\n if (mode !== 'managed' && options.llmProvider !== undefined) {\n throw new Error('The --llm option can only be used with the default template');\n }\n if (mode !== 'managed' && options.llmApiKey !== undefined) {\n throw new Error('The --llm-api-key option can only be used with the default template');\n }\n\n return mode;\n}\n\nconst WINDOWS_RESERVED_BASENAME = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/i;\nconst PROJECT_NAME_PATTERN = /^[a-z0-9][a-z0-9._-]*$/;\n\nexport function validateProjectName(value: string): string {\n const projectName = value.trim();\n\n if (\n projectName.length < 1 ||\n projectName.length > 214 ||\n path.isAbsolute(projectName) ||\n projectName.includes('/') ||\n projectName.includes('\\\\') ||\n projectName === '.' ||\n projectName === '..' ||\n projectName.endsWith('.') ||\n !PROJECT_NAME_PATTERN.test(projectName) ||\n WINDOWS_RESERVED_BASENAME.test(projectName)\n ) {\n throw new Error(\n 'Project name must be 1-214 lowercase characters, start with a letter or number, and contain only letters, numbers, dots, hyphens, or underscores',\n );\n }\n\n return projectName;\n}\n\nconst NUMERIC_IDENTIFIER_PATTERN = /^\\d+$/;\n\nfunction getPrereleaseChannel(version: string): string | undefined {\n const separator = version.indexOf('-');\n if (separator === -1) return undefined;\n return version\n .slice(separator + 1)\n .split('.')\n .find(identifier => !NUMERIC_IDENTIFIER_PATTERN.test(identifier));\n}\n\nexport function selectMatchingDistTag(version: string, output: string): string | undefined {\n const matchingTags = output\n .split('\\n')\n .map(line => line.trim())\n .filter(Boolean)\n .flatMap(line => {\n const separator = line.indexOf(':');\n if (separator === -1) return [];\n const tag = line.slice(0, separator).trim();\n const taggedVersion = line.slice(separator + 1).trim();\n return taggedVersion === version && tag ? [tag] : [];\n });\n\n if (matchingTags.length === 0) return undefined;\n\n const prereleaseChannel = getPrereleaseChannel(version);\n const matchingPrereleaseTag = prereleaseChannel\n ? matchingTags.find(tag => prereleaseChannel === tag || prereleaseChannel.startsWith(`${tag}-`))\n : undefined;\n if (matchingPrereleaseTag) return matchingPrereleaseTag;\n if (matchingTags.includes('latest')) return 'latest';\n if (matchingTags.includes('beta')) return 'beta';\n return matchingTags.sort((a, b) => a.localeCompare(b))[0];\n}\n","import { existsSync } from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { ensureFile, readJSON, writeJSON } from 'fs-extra/esm';\n\nconst createArgs = (versionTag?: string) => {\n const packageName = versionTag ? `@mastra/mcp-docs-server@${versionTag}` : '@mastra/mcp-docs-server';\n return ['-y', packageName];\n};\n\nconst createMcpConfig = (editor: Editor, versionTag?: string) => {\n const args = createArgs(versionTag);\n if (editor === 'vscode') {\n return {\n servers: {\n mastra:\n process.platform === `win32`\n ? {\n command: 'cmd',\n args: ['/c', 'npx', ...args],\n type: 'stdio',\n }\n : {\n command: 'npx',\n args,\n type: 'stdio',\n },\n },\n };\n }\n return {\n mcpServers: {\n mastra: {\n command: 'npx',\n args,\n },\n },\n };\n};\n\nfunction makeConfig(\n original: { mcpServers?: Record<string, unknown>; servers?: Record<string, unknown> },\n editor: Editor,\n versionTag?: string,\n) {\n if (editor === 'vscode') {\n return {\n ...original,\n servers: {\n ...(original?.servers || {}),\n ...createMcpConfig(editor, versionTag).servers,\n },\n };\n }\n return {\n ...original,\n mcpServers: {\n ...(original?.mcpServers || {}),\n ...createMcpConfig(editor, versionTag).mcpServers,\n },\n };\n}\n\nasync function writeMergedConfig(configPath: string, editor: Editor, versionTag?: string) {\n const configExists = existsSync(configPath);\n const config = makeConfig(configExists ? await readJSON(configPath) : {}, editor, versionTag);\n await ensureFile(configPath);\n await writeJSON(configPath, config, {\n spaces: 2,\n });\n}\n\nexport const windsurfGlobalMCPConfigPath = path.join(os.homedir(), '.codeium', 'windsurf', 'mcp_config.json');\nexport const antigravityGlobalMCPConfigPath = path.join(os.homedir(), '.gemini', 'antigravity', 'mcp_config.json');\nexport const cursorGlobalMCPConfigPath = path.join(os.homedir(), '.cursor', 'mcp.json');\nexport const vscodeMCPConfigPath = path.join(process.cwd(), '.vscode', 'mcp.json');\nexport const vscodeGlobalMCPConfigPath = path.join(\n os.homedir(),\n process.platform === 'win32'\n ? path.join('AppData', 'Roaming', 'Code', 'User', 'settings.json')\n : process.platform === 'darwin'\n ? path.join('Library', 'Application Support', 'Code', 'User', 'settings.json')\n : path.join('.config', 'Code', 'User', 'settings.json'),\n);\n\nexport const EDITOR = ['cursor', 'cursor-global', 'windsurf', 'vscode', 'antigravity'] as const;\nexport type Editor = (typeof EDITOR)[number];\n\nexport const MCP_SERVER = ['cursor', 'cursor-global', 'windsurf', 'antigravity'] as const;\nexport type MCPServer = (typeof MCP_SERVER)[number];\n\n/**\n * Type-guard to check if a string is a valid MCPServer\n */\nexport function isValidMCPServer(value: string): value is MCPServer {\n return MCP_SERVER.includes(value as MCPServer);\n}\n\n/**\n * Type-guard to check if a string is a valid Editor\n */\nexport function isValidEditor(value: string): value is Editor {\n return EDITOR.includes(value as Editor);\n}\n\nexport async function installMastraDocsMCPServer({\n editor,\n directory,\n versionTag,\n}: {\n editor?: Editor;\n directory: string;\n versionTag?: string;\n}) {\n if (editor === `cursor`) {\n await writeMergedConfig(path.join(directory, '.cursor', 'mcp.json'), 'cursor', versionTag);\n }\n if (editor === `vscode`) {\n await writeMergedConfig(path.join(directory, '.vscode', 'mcp.json'), 'vscode', versionTag);\n }\n if (editor === `cursor-global`) {\n const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);\n if (alreadyInstalled) {\n return;\n }\n await writeMergedConfig(cursorGlobalMCPConfigPath, 'cursor-global', versionTag);\n }\n\n if (editor === `windsurf`) {\n const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);\n if (alreadyInstalled) {\n return;\n }\n await writeMergedConfig(windsurfGlobalMCPConfigPath, editor, versionTag);\n }\n\n if (editor === `antigravity`) {\n const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor, versionTag);\n if (alreadyInstalled) {\n return;\n }\n await writeMergedConfig(antigravityGlobalMCPConfigPath, editor, versionTag);\n }\n}\n\nexport async function globalMCPIsAlreadyInstalled(editor: Editor, versionTag?: string) {\n let configPath: string = ``;\n\n if (editor === 'windsurf') {\n configPath = windsurfGlobalMCPConfigPath;\n } else if (editor === 'antigravity') {\n configPath = antigravityGlobalMCPConfigPath;\n } else if (editor === 'cursor-global') {\n configPath = cursorGlobalMCPConfigPath;\n } else if (editor === 'vscode') {\n configPath = vscodeGlobalMCPConfigPath;\n }\n\n if (!configPath || !existsSync(configPath)) {\n return false;\n }\n\n try {\n const configContents = await readJSON(configPath);\n\n if (!configContents) return false;\n\n // Construct the expected package string based on versionTag\n const expectedPackage = versionTag ? `@mastra/mcp-docs-server@${versionTag}` : '@mastra/mcp-docs-server';\n\n if (editor === 'vscode') {\n if (!configContents.servers) return false;\n const hasMastraMCP = Object.values(configContents.servers).some((server?: any) =>\n server?.args?.find((arg?: string) => arg === expectedPackage),\n );\n return hasMastraMCP;\n }\n\n if (!configContents?.mcpServers) return false;\n const hasMastraMCP = Object.values(configContents.mcpServers).some((server?: any) =>\n server?.args?.find((arg?: string) => arg === expectedPackage),\n );\n\n return hasMastraMCP;\n } catch {\n return false;\n }\n}\n","export type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun';\n\nexport function getPackageManagerAddCommand(pm: PackageManager): string {\n switch (pm) {\n case 'npm':\n return 'install --audit=false --fund=false --loglevel=error --progress=false --update-notifier=false';\n case 'yarn':\n return 'add';\n case 'pnpm':\n return 'add --loglevel=error';\n case 'bun':\n return 'add';\n default:\n return 'add';\n }\n}\n","import fs from 'node:fs';\nimport fsPromises from 'node:fs/promises';\nimport path from 'node:path';\nimport { execa } from 'execa';\nimport { getPackageManagerAddCommand } from '../utils/package-manager';\nimport type { PackageManager } from '../utils/package-manager';\n\nexport class DepsService {\n readonly packageManager: PackageManager;\n\n constructor() {\n this.packageManager = this.getPackageManager();\n }\n\n private findLockFile(dir: string): string | null {\n const lockFiles = ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock', 'bun.lockb'];\n for (const file of lockFiles) {\n if (fs.existsSync(path.join(dir, file))) {\n return file;\n }\n }\n const parentDir = path.resolve(dir, '..');\n if (parentDir !== dir) {\n return this.findLockFile(parentDir);\n }\n return null;\n }\n\n private getPackageManager(): PackageManager {\n const lockFile = this.findLockFile(process.cwd());\n switch (lockFile) {\n case 'pnpm-lock.yaml':\n return 'pnpm';\n case 'package-lock.json':\n return 'npm';\n case 'yarn.lock':\n return 'yarn';\n case 'bun.lock':\n case 'bun.lockb':\n return 'bun';\n default:\n return 'npm';\n }\n }\n\n public async installPackages(packages: string[]) {\n const pm = this.packageManager;\n const installCommand = getPackageManagerAddCommand(pm);\n\n // Pass arguments as an array (no shell) so package names can't be used\n // for command injection (CodeQL js/shell-command-constructed-from-input).\n return execa(pm, [...installCommand.split(' '), ...packages], {\n all: true,\n stdio: 'pipe',\n });\n }\n\n public async checkDependencies(dependencies: string[]): Promise<string> {\n try {\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n\n try {\n await fsPromises.access(packageJsonPath);\n } catch {\n return 'No package.json file found in the current directory';\n }\n\n const packageJson = JSON.parse(await fsPromises.readFile(packageJsonPath, 'utf-8'));\n for (const dependency of dependencies) {\n if (!packageJson.dependencies || !packageJson.dependencies[dependency]) {\n return `Please install ${dependency} before running this command (${this.packageManager} install ${dependency})`;\n }\n }\n\n return 'ok';\n } catch (err) {\n console.error(err);\n return 'Could not check dependencies';\n }\n }\n\n public async getProjectName() {\n try {\n const packageJsonPath = path.join(process.cwd(), 'package.json');\n const packageJson = await fsPromises.readFile(packageJsonPath, 'utf-8');\n const pkg = JSON.parse(packageJson);\n return pkg.name;\n } catch (err) {\n throw err;\n }\n }\n\n public async addScriptsToPackageJson(scripts: Record<string, string>) {\n const packageJson = JSON.parse(await fsPromises.readFile('package.json', 'utf-8'));\n packageJson.scripts = {\n ...packageJson.scripts,\n ...scripts,\n };\n await fsPromises.writeFile('package.json', JSON.stringify(packageJson, null, 2));\n }\n}\n","import * as fs from 'node:fs/promises';\n\nexport abstract class EnvService {\n abstract getEnvValue(key: string): Promise<string | null>;\n abstract setEnvValue(key: string, value: string): Promise<void>;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nexport class FileEnvService extends EnvService {\n private static readonly ENV_KEY_REGEX = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n private readonly filePath: string;\n\n private validateEnvEntry(key: string, value: string): void {\n if (!FileEnvService.ENV_KEY_REGEX.test(key)) {\n throw new Error(`Invalid ENV key: ${key}`);\n }\n if (/[\\r\\n]/.test(value)) {\n throw new Error(`Invalid ENV value for ${key}: multiline values are not supported.`);\n }\n }\n\n constructor(filePath: string) {\n super();\n this.filePath = filePath;\n }\n\n private envLineRegex(key: string, captureValue = false): RegExp {\n const pattern = captureValue ? `^${escapeRegExp(key)}=(.*)$` : `^${escapeRegExp(key)}=.*$`;\n return new RegExp(pattern, 'm');\n }\n\n private async updateEnvData({\n key,\n value,\n filePath = this.filePath,\n data,\n }: {\n key: string;\n value: string;\n filePath?: string;\n data: string;\n }): Promise<string> {\n this.validateEnvEntry(key, value);\n\n const lineRegex = this.envLineRegex(key);\n const updated = lineRegex.test(data)\n ? data.replace(lineRegex, () => `${key}=${value}`)\n : `${data}\\n${key}=${value}`;\n\n await fs.writeFile(filePath, updated, 'utf8');\n console.info(`${key} set in ENV file.`);\n return updated;\n }\n\n async getEnvValue(key: string): Promise<string | null> {\n try {\n const data = await fs.readFile(this.filePath, 'utf8');\n const match = data.match(this.envLineRegex(key, true));\n return match?.[1] ?? null;\n } catch (err) {\n console.error(`Error reading ENV value: ${err}`);\n return null;\n }\n }\n\n async setEnvValue(key: string, value: string): Promise<void> {\n try {\n const data = await fs.readFile(this.filePath, 'utf8');\n await this.updateEnvData({ key, value, data });\n } catch (err) {\n console.error(`Error writing ENV value: ${err}`);\n }\n }\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport fsExtra from 'fs-extra/esm';\n\nimport { FileEnvService } from './service.env';\n\nexport class FileService {\n /**\n *\n * @param inputFile the file in the starter files directory to copy\n * @param outputFilePath the destination path\n * @param replaceIfExists flag to replace if it exists\n * @returns\n */\n public async copyStarterFile(inputFile: string, outputFilePath: string, replaceIfExists?: boolean) {\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n const filePath = path.resolve(__dirname, 'starter-files', inputFile);\n const fileString = fs.readFileSync(filePath, 'utf8');\n\n if (fs.existsSync(outputFilePath) && !replaceIfExists) {\n console.info(`${outputFilePath} already exists`);\n return false;\n }\n\n await fsExtra.outputFile(outputFilePath, fileString);\n\n return true;\n }\n\n public async setupEnvFile({ dbUrl }: { dbUrl: string }) {\n const envPath = path.join(process.cwd(), '.env.development');\n\n await fsExtra.ensureFile(envPath);\n\n const fileEnvService = new FileEnvService(envPath);\n await fileEnvService.setEnvValue('DB_URL', dbUrl);\n }\n\n public getFirstExistingFile(files: string[]): string {\n for (const f of files) {\n if (fs.existsSync(f)) {\n return f;\n }\n }\n\n throw new Error('Missing required file, checked the following paths: ' + files.join(', '));\n }\n\n public replaceValuesInFile({\n filePath,\n replacements,\n }: {\n filePath: string;\n replacements: { search: string; replace: string }[];\n }) {\n let fileContent = fs.readFileSync(filePath, 'utf8');\n replacements.forEach(({ search, replace }) => {\n fileContent = fileContent.replaceAll(search, replace);\n });\n\n fs.writeFileSync(filePath, fileContent);\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport * as p from '@clack/prompts';\nimport type { ModelRouterModelId } from '@mastra/core/llm';\nimport fsExtra from 'fs-extra/esm';\nimport color from 'picocolors';\nimport yoctoSpinner from 'yocto-spinner';\n\nimport { DepsService } from '../../services/service.deps';\nimport { FileService } from '../../services/service.file';\nimport { getToken, loadCredentials } from '../auth/credentials.js';\nimport { resolveCurrentOrg } from '../auth/orgs.js';\nimport {\n cursorGlobalMCPConfigPath,\n windsurfGlobalMCPConfigPath,\n antigravityGlobalMCPConfigPath,\n} from './mcp-docs-server-install';\nimport type { Editor } from './mcp-docs-server-install';\n\nexport const LLMProvider = ['openai', 'anthropic', 'groq', 'google', 'cerebras', 'mistral'] as const;\nexport const COMPONENTS = ['agents', 'workflows', 'tools', 'scorers'] as const;\n\nexport type LLMProvider = (typeof LLMProvider)[number];\nexport type Component = (typeof COMPONENTS)[number];\n\nexport interface ObservabilityPromptResult {\n enabled?: boolean;\n token?: string;\n orgId?: string;\n orgName?: string;\n}\n\ninterface ObservabilitySelectionEvent {\n command?: 'create' | 'init';\n enabled: boolean;\n answer: 'yes' | 'no';\n selection_method: 'interactive';\n}\n\nexport async function promptForObservability(\n command?: 'create' | 'init',\n onObservabilitySelected?: (event: ObservabilitySelectionEvent) => void,\n): Promise<ObservabilityPromptResult> {\n // Loop so that if the browser-based auth flow fails (user closed the browser\n // tab, timed out, network error, …) we re-ask the same question instead of\n // leaving the user stuck. Picking \"No\" is always a clean escape hatch.\n while (true) {\n const choice = await p.select({\n message: 'Enable Mastra Observability? (will open auth flow)',\n options: [\n { value: 'yes', label: 'Yes' },\n { value: 'no', label: 'No' },\n ],\n initialValue: 'yes',\n showInstructions: false,\n });\n\n if (p.isCancel(choice)) return {};\n\n const answer = choice === 'yes' ? 'yes' : 'no';\n const enabled = answer === 'yes';\n onObservabilitySelected?.({\n command,\n enabled,\n answer,\n selection_method: 'interactive',\n });\n\n if (!enabled) return { enabled: false };\n\n // Only surface the logged-in user when creds already existed before getToken().\n // If they didn't, getToken() ran the browser login() flow which prints its own\n // \"Logged in as <email>\" message — printing again here would duplicate it.\n // Re-read creds after getToken() so the email reflects the actual logged-in\n // account, even when stale creds forced a browser re-login as a different user.\n const hadCachedCreds = (await loadCredentials()) !== null;\n try {\n const token = await getToken();\n if (hadCachedCreds) {\n const creds = await loadCredentials();\n if (creds) p.log.info(`Logged in as ${creds.user.email}`);\n }\n const org = await resolveCurrentOrg(token, { forcePrompt: true });\n return { enabled: true, token, orgId: org.orgId, orgName: org.orgName };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n p.log.warn(`Could not sign in to Mastra: ${message}`);\n // Fall through and re-prompt the same question so the user can retry\n // or pick \"No\" to continue without observability.\n }\n }\n}\n\n/**\n * Type-guard to check if a value is a valid LLMProvider\n */\nexport function isValidLLMProvider(value: string): value is LLMProvider {\n return LLMProvider.includes(value as LLMProvider);\n}\n\n/**\n * Type-guard to check if a value contains only valid Components\n */\nexport function areValidComponents(values: string[]): values is Component[] {\n return values.every(value => COMPONENTS.includes(value as Component));\n}\n\nexport const getModelIdentifier = (llmProvider: LLMProvider): ModelRouterModelId => {\n let model: ModelRouterModelId = 'openai/gpt-5-mini';\n\n if (llmProvider === 'anthropic') {\n model = 'anthropic/claude-sonnet-4-5';\n } else if (llmProvider === 'groq') {\n model = 'groq/llama-3.3-70b-versatile';\n } else if (llmProvider === 'google') {\n model = 'google/gemini-2.5-pro';\n } else if (llmProvider === 'cerebras') {\n model = 'cerebras/llama-3.3-70b';\n } else if (llmProvider === 'mistral') {\n model = 'mistral/mistral-medium-2508';\n }\n\n return model;\n};\n\nexport async function writeAgentSample(\n llmProvider: LLMProvider,\n destPath: string,\n addExampleTool: boolean,\n addScorers: boolean,\n) {\n const modelString = getModelIdentifier(llmProvider);\n\n const instructions = `You are a helpful weather assistant that provides accurate weather information and can help planning activities based on the weather.\n\nYour primary function is to help users get weather details for specific locations. When responding:\n- Always ask for a location if none is provided\n- If the location name isn't in English, please translate it\n- If giving a location with multiple parts (e.g. \"New York, NY\"), use the most relevant part (e.g. \"New York\")\n- Include relevant details like humidity, wind conditions, and precipitation\n- Keep responses concise but informative\n- If the user asks for activities and provides the weather forecast, suggest activities based on the weather forecast.\n- If the user asks for activities, respond in the format they request.${addExampleTool ? '\\n\\nUse the weatherTool to fetch current weather data.' : ''}`;\n const imports = [\n `import { Agent } from '@mastra/core/agent';`,\n `import { Memory } from '@mastra/memory';`,\n addExampleTool ? `import { weatherTool } from '../tools/weather-tool';` : undefined,\n addScorers ? `import { scorers } from '../scorers/weather-scorer';` : undefined,\n ]\n .filter(Boolean)\n .join('\\n');\n const toolsConfig = addExampleTool ? ` tools: { weatherTool },\\n` : '';\n const scorersConfig = addScorers\n ? ` scorers: {\n toolCallAppropriateness: {\n scorer: scorers.toolCallAppropriatenessScorer,\n sampling: {\n type: 'ratio',\n rate: 1,\n },\n },\n completeness: {\n scorer: scorers.completenessScorer,\n sampling: {\n type: 'ratio',\n rate: 1,\n },\n },\n translation: {\n scorer: scorers.translationScorer,\n sampling: {\n type: 'ratio',\n rate: 1,\n },\n },\n },\n`\n : '';\n const content = `${imports}\n\nexport const weatherAgent = new Agent({\n id: 'weather-agent',\n name: 'Weather Agent',\n instructions: \\`${instructions}\\`,\n model: '${modelString}',\n${toolsConfig}${scorersConfig} memory: new Memory(),\n});\n`;\n\n await fs.writeFile(destPath, content);\n}\n\nexport async function writeWorkflowSample(destPath: string) {\n const content = `import { createStep, createWorkflow } from '@mastra/core/workflows';\nimport { z } from 'zod';\n\nconst forecastSchema = z.object({\n date: z.string(),\n maxTemp: z.number(),\n minTemp: z.number(),\n precipitationChance: z.number(),\n condition: z.string(),\n location: z.string(),\n})\n\nfunction getWeatherCondition(code: number): string {\n const conditions: Record<number, string> = {\n 0: 'Clear sky',\n 1: 'Mainly clear',\n 2: 'Partly cloudy',\n 3: 'Overcast',\n 45: 'Foggy',\n 48: 'Depositing rime fog',\n 51: 'Light drizzle',\n 53: 'Moderate drizzle',\n 55: 'Dense drizzle',\n 61: 'Slight rain',\n 63: 'Moderate rain',\n 65: 'Heavy rain',\n 71: 'Slight snow fall',\n 73: 'Moderate snow fall',\n 75: 'Heavy snow fall',\n 95: 'Thunderstorm',\n }\n return conditions[code] || 'Unknown'\n}\n\nconst fetchWeather = createStep({\n id: 'fetch-weather',\n description: 'Fetches weather forecast for a given city',\n inputSchema: z.object({\n city: z.string().describe('The city to get the weather for'),\n }),\n outputSchema: forecastSchema,\n execute: async ({ inputData }) => {\n if (!inputData) {\n throw new Error('Input data not found');\n }\n\n const geocodingUrl = \\`https://geocoding-api.open-meteo.com/v1/search?name=\\${encodeURIComponent(inputData.city)}&count=1\\`;\n const geocodingResponse = await fetch(geocodingUrl);\n const geocodingData = (await geocodingResponse.json()) as {\n results: { latitude: number; longitude: number; name: string }[];\n };\n\n if (!geocodingData.results?.[0]) {\n throw new Error(\\`Location '\\${inputData.city}' not found\\`);\n }\n\n const { latitude, longitude, name } = geocodingData.results[0];\n\n const weatherUrl = \\`https://api.open-meteo.com/v1/forecast?latitude=\\${latitude}&longitude=\\${longitude}&current=precipitation,weathercode&timezone=auto,&hourly=precipitation_probability,temperature_2m\\`;\n const response = await fetch(weatherUrl);\n const data = (await response.json()) as {\n current: {\n time: string\n precipitation: number\n weathercode: number\n }\n hourly: {\n precipitation_probability: number[]\n temperature_2m: number[]\n }\n }\n\n const forecast = {\n date: new Date().toISOString(),\n maxTemp: Math.max(...data.hourly.temperature_2m),\n minTemp: Math.min(...data.hourly.temperature_2m),\n condition: getWeatherCondition(data.current.weathercode),\n precipitationChance: data.hourly.precipitation_probability.reduce(\n (acc, curr) => Math.max(acc, curr),\n 0\n ),\n location: name\n }\n\n return forecast;\n },\n});\n\n\nconst planActivities = createStep({\n id: 'plan-activities',\n description: 'Suggests activities based on weather conditions',\n inputSchema: forecastSchema,\n outputSchema: z.object({\n activities: z.string(),\n }),\n execute: async ({ inputData, mastra }) => {\n const forecast = inputData\n\n if (!forecast) {\n throw new Error('Forecast data not found')\n }\n\n const agent = mastra?.getAgent('weatherAgent');\n if (!agent) {\n throw new Error('Weather agent not found');\n }\n\n const prompt = \\`Based on the following weather forecast for \\${forecast.location}, suggest appropriate activities:\n \\${JSON.stringify(forecast, null, 2)}\n For each day in the forecast, structure your response exactly as follows:\n\n 📅 [Day, Month Date, Year]\n ═══════════════════════════\n\n 🌡️ WEATHER SUMMARY\n • Conditions: [brief description]\n • Temperature: [X°C/Y°F to A°C/B°F]\n • Precipitation: [X% chance]\n\n 🌅 MORNING ACTIVITIES\n Outdoor:\n • [Activity Name] - [Brief description including specific location/route]\n Best timing: [specific time range]\n Note: [relevant weather consideration]\n\n 🌞 AFTERNOON ACTIVITIES\n Outdoor:\n • [Activity Name] - [Brief description including specific location/route]\n Best timing: [specific time range]\n Note: [relevant weather consideration]\n\n 🏠 INDOOR ALTERNATIVES\n • [Activity Name] - [Brief description including specific venue]\n Ideal for: [weather condition that would trigger this alternative]\n\n ⚠️ SPECIAL CONSIDERATIONS\n • [Any relevant weather warnings, UV index, wind conditions, etc.]\n\n Guidelines:\n - Suggest 2-3 time-specific outdoor activities per day\n - Include 1-2 indoor backup options\n - For precipitation >50%, lead with indoor activities\n - All activities must be specific to the location\n - Include specific venues, trails, or locations\n - Consider activity intensity based on temperature\n - Keep descriptions concise but informative\n\n Maintain this exact formatting for consistency, using the emoji and section headers as shown.\\`;\n\n const response = await agent.stream([\n {\n role: 'user',\n content: prompt,\n },\n ]);\n\n let activitiesText = '';\n\n for await (const chunk of response.textStream) {\n process.stdout.write(chunk);\n activitiesText += chunk;\n }\n\n return {\n activities: activitiesText,\n };\n },\n});\n\nconst weatherWorkflow = createWorkflow({\n id: 'weather-workflow',\n inputSchema: z.object({\n city: z.string().describe('The city to get the weather for'),\n }),\n outputSchema: z.object({\n activities: z.string(),\n })\n})\n .then(fetchWeather)\n .then(planActivities);\n\nweatherWorkflow.commit();\n\nexport { weatherWorkflow };`;\n\n await fs.writeFile(destPath, content);\n}\n\nexport async function writeToolSample(destPath: string) {\n const fileService = new FileService();\n await fileService.copyStarterFile('tools.ts', destPath);\n}\n\nexport async function writeScorersSample(llmProvider: LLMProvider, destPath: string) {\n const modelString = getModelIdentifier(llmProvider);\n const content = `import { z } from 'zod';\nimport { createToolCallAccuracyScorerCode } from '@mastra/evals/scorers/prebuilt';\nimport { createCompletenessScorer } from '@mastra/evals/scorers/prebuilt';\nimport { getAssistantMessageFromRunOutput, getUserMessageFromRunInput } from '@mastra/evals/scorers/utils';\nimport { createScorer } from '@mastra/core/evals';\n\nexport const toolCallAppropriatenessScorer = createToolCallAccuracyScorerCode({\n expectedTool: 'weatherTool',\n strictMode: false,\n});\n\nexport const completenessScorer = createCompletenessScorer();\n\n// Custom LLM-judged scorer: evaluates if non-English locations are translated appropriately\nexport const translationScorer = createScorer({\n id: 'translation-quality-scorer',\n name: 'Translation Quality',\n description: 'Checks that non-English location names are translated and used correctly',\n type: 'agent',\n judge: {\n model: '${modelString}',\n instructions:\n 'You are an expert evaluator of translation quality for geographic locations. ' +\n 'Determine whether the user text mentions a non-English location and whether the assistant correctly uses an English translation of that location. ' +\n 'Be lenient with transliteration differences and diacritics. ' +\n 'Return only the structured JSON matching the provided schema.',\n },\n})\n .preprocess(({ run }) => {\n const userText = getUserMessageFromRunInput(run.input) || '';\n const assistantText = getAssistantMessageFromRunOutput(run.output) || '';\n return { userText, assistantText };\n })\n .analyze({\n description: 'Extract location names and detect language/translation adequacy',\n outputSchema: z.object({\n nonEnglish: z.boolean(),\n translated: z.boolean(),\n confidence: z.number().min(0).max(1).default(1),\n explanation: z.string().default(''),\n }),\n createPrompt: ({ results }) => \\`\n You are evaluating if a weather assistant correctly handled translation of a non-English location.\n User text:\n \"\"\"\n \\${results.preprocessStepResult.userText}\n \"\"\"\n Assistant response:\n \"\"\"\n \\${results.preprocessStepResult.assistantText}\n \"\"\"\n Tasks:\n 1) Identify if the user mentioned a location that appears non-English.\n 2) If non-English, check whether the assistant used a correct English translation of that location in its response.\n 3) Be lenient with transliteration differences (e.g., accents/diacritics).\n Return JSON with fields:\n {\n \"nonEnglish\": boolean,\n \"translated\": boolean,\n \"confidence\": number, // 0-1\n \"explanation\": string\n }\n \\`,\n })\n .generateScore(({ results }) => {\n const r = (results as any)?.analyzeStepResult || {};\n if (!r.nonEnglish) return 1; // If not applicable, full credit\n if (r.translated) return Math.max(0, Math.min(1, 0.7 + 0.3 * (r.confidence ?? 1)));\n return 0; // Non-English but not translated\n })\n .generateReason(({ results, score }) => {\n const r = (results as any)?.analyzeStepResult || {};\n return \\`Translation scoring: nonEnglish=\\${r.nonEnglish ?? false}, translated=\\${r.translated ?? false}, confidence=\\${r.confidence ?? 0}. Score=\\${score}. \\${r.explanation ?? ''}\\`;\n });\n\nexport const scorers = {\n toolCallAppropriatenessScorer,\n completenessScorer,\n translationScorer,\n};`;\n\n await fs.writeFile(destPath, content);\n}\n\nexport async function writeCodeSampleForComponents(\n llmprovider: LLMProvider,\n component: Component,\n destPath: string,\n importComponents: Component[],\n) {\n switch (component) {\n case 'agents':\n return writeAgentSample(\n llmprovider,\n destPath,\n importComponents.includes('tools'),\n importComponents.includes('scorers'),\n );\n case 'tools':\n return writeToolSample(destPath);\n case 'workflows':\n return writeWorkflowSample(destPath);\n case 'scorers':\n return writeScorersSample(llmprovider, destPath);\n default:\n return '';\n }\n}\n\nexport const createComponentsDir = async (dirPath: string, component: string) => {\n const componentPath = dirPath + `/${component}`;\n\n await fsExtra.ensureDir(componentPath);\n};\n\nexport const writeIndexFile = async ({\n dirPath,\n addAgent,\n addExample,\n addWorkflow,\n addScorers,\n}: {\n dirPath: string;\n addExample: boolean;\n addWorkflow: boolean;\n addAgent: boolean;\n addScorers: boolean;\n}) => {\n const indexPath = dirPath + '/index.ts';\n const destPath = path.join(indexPath);\n try {\n await fs.writeFile(destPath, '');\n const filteredExports = [\n addWorkflow ? `workflows: { weatherWorkflow },` : '',\n addAgent ? `agents: { weatherAgent },` : '',\n addScorers ? `scorers: { toolCallAppropriatenessScorer, completenessScorer, translationScorer },` : '',\n ].filter(Boolean);\n if (!addExample) {\n await fs.writeFile(\n destPath,\n `\nimport { Mastra } from '@mastra/core/mastra';\n\nexport const mastra = new Mastra()\n `,\n );\n\n return;\n }\n await fs.writeFile(\n destPath,\n `\nimport { Mastra } from '@mastra/core/mastra';\nimport { PinoLogger } from '@mastra/loggers';\nimport { LibSQLStore } from '@mastra/libsql';\nimport { DuckDBStore } from \"@mastra/duckdb\";\nimport { MastraCompositeStore } from '@mastra/core/storage';\nimport { Observability, MastraStorageExporter, MastraPlatformExporter, SensitiveDataFilter } from '@mastra/observability';\n${addWorkflow ? `import { weatherWorkflow } from './workflows/weather-workflow';` : ''}\n${addAgent ? `import { weatherAgent } from './agents/weather-agent';` : ''}\n${addScorers ? `import { toolCallAppropriatenessScorer, completenessScorer, translationScorer } from './scorers/weather-scorer';` : ''}\n\nexport const mastra = new Mastra({\n ${filteredExports.join('\\n ')}\n storage: new MastraCompositeStore({\n id: 'composite-storage',\n default: new LibSQLStore({\n id: \"mastra-storage\",\n // Uses a hosted database when deployed (mastra env db create --kind turso),\n // and a local file during development.\n url: process.env.TURSO_DATABASE_URL ?? \"file:./mastra.db\",\n authToken: process.env.TURSO_AUTH_TOKEN,\n }),\n domains: {\n observability: await new DuckDBStore().getStore('observability'),\n }\n }),\n logger: new PinoLogger({\n name: 'Mastra',\n level: 'info',\n }),\n observability: new Observability({\n configs: {\n default: {\n serviceName: 'mastra',\n exporters: [\n new MastraStorageExporter(), // Persists observability events to Mastra Storage\n new MastraPlatformExporter(), // Sends observability events to Mastra Platform (if MASTRA_PLATFORM_ACCESS_TOKEN is set)\n ],\n spanOutputProcessors: [\n new SensitiveDataFilter(), // Redacts sensitive data like passwords, tokens, keys\n ],\n },\n },\n }),\n});\n`,\n );\n } catch (err) {\n throw err;\n }\n};\n\nexport const checkInitialization = async (dirPath: string) => {\n try {\n await fs.access(dirPath);\n return true;\n } catch {\n return false;\n }\n};\n\nexport const checkAndInstallCoreDeps = async (addExample: boolean, versionTag?: string) => {\n const spinner = yoctoSpinner({ text: 'Installing Mastra core dependencies' });\n let packages: Array<{ name: string; version: string }> = [];\n const mastraVersionTag = versionTag || 'latest';\n\n try {\n const depService = new DepsService();\n\n spinner.start();\n\n const needsCore = (await depService.checkDependencies(['@mastra/core'])) !== `ok`;\n const needsCli = (await depService.checkDependencies(['mastra'])) !== `ok`;\n const needsZod = (await depService.checkDependencies(['zod'])) !== `ok`;\n\n if (needsCore) {\n packages.push({ name: '@mastra/core', version: mastraVersionTag });\n }\n\n if (needsCli) {\n packages.push({ name: 'mastra', version: mastraVersionTag });\n }\n\n if (needsZod) {\n packages.push({ name: 'zod', version: '^4' });\n }\n\n if (addExample) {\n const needsLibsql = (await depService.checkDependencies(['@mastra/libsql'])) !== `ok`;\n\n if (needsLibsql) {\n packages.push({ name: '@mastra/libsql', version: mastraVersionTag });\n }\n }\n\n if (packages.length > 0) {\n await depService.installPackages(packages.map(pkg => `${pkg.name}@${pkg.version}`));\n }\n\n spinner.success('Successfully installed Mastra core dependencies');\n } catch (err) {\n spinner.error(`Failed to install core dependencies: ${err instanceof Error ? err.message : 'Unknown error'}`);\n }\n};\n\nexport const getAPIKey = async (provider: LLMProvider) => {\n let key = 'OPENAI_API_KEY';\n switch (provider) {\n case 'anthropic':\n key = 'ANTHROPIC_API_KEY';\n return key;\n case 'groq':\n key = 'GROQ_API_KEY';\n return key;\n case 'google':\n key = 'GOOGLE_API_KEY';\n return key;\n case 'cerebras':\n key = 'CEREBRAS_API_KEY';\n return key;\n case 'mistral':\n key = 'MISTRAL_API_KEY';\n return key;\n default:\n return key;\n }\n};\n\nexport const writeAPIKey = async ({ provider, apiKey }: { provider: LLMProvider; apiKey?: string }) => {\n /**\n * If people skip entering an API key (because they e.g. have it in their environment already), we write to .env.example instead of .env so that they can immediately run Mastra without having to delete an .env file with an invalid key.\n */\n const envFileName = apiKey ? '.env' : '.env.example';\n\n const key = await getAPIKey(provider);\n await fs.appendFile(\n envFileName,\n `${key}=${apiKey || 'your-api-key'}\\n`,\n apiKey ? { encoding: 'utf8', mode: 0o600 } : 'utf8',\n );\n if (apiKey && process.platform !== 'win32') await fs.chmod(envFileName, 0o600);\n};\n\n/**\n * Append Mastra platform credentials to the project's `.env` file.\n *\n * The generated `src/mastra/index.ts` template already registers a\n * `MastraPlatformExporter` which no-ops unless `MASTRA_PLATFORM_ACCESS_TOKEN`\n * is set, so enabling platform is a pure env-var concern from the\n * scaffolder's side.\n *\n * When called with no token, writes empty placeholders so the user can paste\n * a key minted manually from the dashboard.\n */\nconst MASTRA_PLATFORM_ENV_KEYS = [\n 'MASTRA_PLATFORM_ACCESS_TOKEN',\n 'MASTRA_PROJECT_ID',\n 'MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT',\n] as const;\n\nfunction upsertEnvValue(content: string, key: string, value: string): string {\n const lines = content.split(/\\r?\\n/);\n const assignment = `${key}=${value}`;\n let updated = false;\n\n const nextLines = lines.filter(line => {\n if (!line.startsWith(`${key}=`)) return true;\n if (updated) return false;\n updated = true;\n return true;\n });\n\n if (updated) {\n const index = nextLines.findIndex(line => line.startsWith(`${key}=`));\n nextLines[index] = assignment;\n } else {\n if (nextLines.at(-1) === '') nextLines.pop();\n nextLines.push(assignment, '');\n }\n\n return nextLines.join('\\n');\n}\n\nexport const writeObservabilityEnv = async ({\n projectPath,\n token,\n projectId,\n endpoint,\n}: { projectPath?: string; token?: string; projectId?: string; endpoint?: string } = {}) => {\n const envFilePath = path.join(projectPath ?? process.cwd(), '.env');\n let content = '';\n try {\n content = await fs.readFile(envFilePath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n }\n\n const hasObservabilityValues = MASTRA_PLATFORM_ENV_KEYS.some(key =>\n content.split(/\\r?\\n/).some(line => line.startsWith(`${key}=`)),\n );\n\n if (!hasObservabilityValues) {\n if (content && !content.endsWith('\\n')) content += '\\n';\n content += [\n '',\n '# Mastra platform — https://projects.mastra.ai',\n '# Access token and project id wired up automatically when you ran',\n '# `mastra init` / `create-mastra` with Mastra platform enabled.',\n `MASTRA_PLATFORM_ACCESS_TOKEN=${token ?? ''}`,\n `MASTRA_PROJECT_ID=${projectId ?? ''}`,\n ...(endpoint ? [`MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT=${endpoint}`] : []),\n '',\n ].join('\\n');\n } else {\n content = upsertEnvValue(content, 'MASTRA_PLATFORM_ACCESS_TOKEN', token ?? '');\n content = upsertEnvValue(content, 'MASTRA_PROJECT_ID', projectId ?? '');\n if (endpoint) {\n content = upsertEnvValue(content, 'MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT', endpoint);\n }\n }\n\n await fs.writeFile(envFilePath, content, { encoding: 'utf8', mode: 0o600 });\n if (process.platform !== 'win32') await fs.chmod(envFilePath, 0o600);\n};\nexport const createMastraDir = async (directory: string): Promise<{ ok: true; dirPath: string } | { ok: false }> => {\n let dir = directory\n .trim()\n .split('/')\n .filter(item => item !== '');\n\n const dirPath = path.join(process.cwd(), ...dir, 'mastra');\n\n try {\n await fs.access(dirPath);\n return { ok: false };\n } catch {\n await fsExtra.ensureDir(dirPath);\n return { ok: true, dirPath };\n }\n};\n\nexport const writeCodeSample = async (\n dirPath: string,\n component: Component,\n llmProvider: LLMProvider,\n importComponents: Component[],\n) => {\n const destPath = dirPath + `/${component}/weather-${component.slice(0, -1)}.ts`;\n\n try {\n await writeCodeSampleForComponents(llmProvider, component, destPath, importComponents);\n } catch (err) {\n throw err;\n }\n};\n\nexport const LLM_PROVIDERS: { value: LLMProvider; label: string; hint?: string }[] = [\n { value: 'openai', label: 'OpenAI', hint: 'recommended' },\n { value: 'anthropic', label: 'Anthropic' },\n { value: 'groq', label: 'Groq' },\n { value: 'google', label: 'Google' },\n { value: 'cerebras', label: 'Cerebras' },\n { value: 'mistral', label: 'Mistral' },\n];\n\ninterface InteractivePromptArgs {\n options?: {\n command?: 'create' | 'init';\n showBanner?: boolean;\n onObservabilitySelected?: (event: ObservabilitySelectionEvent) => void;\n };\n skip?: {\n directory?: boolean;\n llmProvider?: boolean;\n llmApiKey?: boolean;\n gitInit?: boolean;\n skills?: boolean;\n mcpServer?: boolean;\n observability?: boolean;\n };\n}\n\nexport const interactivePrompt = async (args: InteractivePromptArgs = {}) => {\n const { skip = {}, options: { command, showBanner = true, onObservabilitySelected } = {} } = args;\n\n if (showBanner) {\n p.intro(color.inverse(' Mastra Init '));\n }\n const mastraProject = await p.group(\n {\n directory: () =>\n skip?.directory\n ? undefined\n : p.text({\n message: 'Where should we create the Mastra files? (default: src/)',\n placeholder: 'src/',\n defaultValue: 'src/',\n }),\n llmProvider: () =>\n skip?.llmProvider\n ? undefined\n : p.select({\n message: 'Select a default model provider:',\n options: LLM_PROVIDERS,\n showInstructions: false,\n }),\n llmApiKey: async ({ results: { llmProvider } }) => {\n if (skip?.llmApiKey) return undefined;\n\n const llmName = LLM_PROVIDERS.find(p => p.value === llmProvider)?.label || 'provider';\n const keyChoice = await p.select({\n message: `Enter your ${llmName} API key?`,\n options: [\n { value: 'skip', label: 'Skip for now', hint: 'default' },\n { value: 'enter', label: 'Enter API key' },\n ],\n initialValue: 'skip',\n showInstructions: false,\n });\n\n if (keyChoice === 'enter') {\n return p.password({\n message: 'Enter your API key:',\n mask: '*',\n clearOnError: true,\n validate: value => {\n if (!value || value.length === 0) return 'API key cannot be empty';\n },\n });\n }\n return undefined;\n },\n observability: async () => {\n if (skip?.observability) return undefined;\n return promptForObservability(command, onObservabilitySelected);\n },\n configureMastraToolingForAgents: async () => {\n if (skip?.skills && skip?.mcpServer) return { skills: undefined, mcpServer: undefined };\n\n const choice = await p.select({\n message: `Select tooling for your coding assistant:`,\n options: [\n { value: 'skills', label: 'Skills', hint: 'recommended' },\n { value: 'mcp', label: 'MCP Docs Server' },\n ],\n initialValue: 'skills',\n showInstructions: false,\n });\n\n if (p.isCancel(choice)) {\n return { skills: undefined, mcpServer: undefined };\n }\n\n if (choice === 'skills') {\n // Popular agents\n const POPULAR_AGENTS: { value: string; label: string }[] = [\n { value: 'universal', label: 'Universal (Codex, Cursor, Gemini, GitHub, OpenCode)' },\n { value: 'claude-code', label: 'Claude Code' },\n ];\n\n // All agents (alphabetically)\n const ALL_AGENTS: { value: string; label: string }[] = [\n ...POPULAR_AGENTS,\n { value: 'adal', label: 'AdaL' },\n { value: 'antigravity', label: 'Antigravity' },\n { value: 'augment', label: 'Augment' },\n { value: 'codebuddy', label: 'CodeBuddy' },\n { value: 'command-code', label: 'Command Code' },\n { value: 'crush', label: 'Crush' },\n { value: 'droid', label: 'Droid' },\n { value: 'goose', label: 'Goose' },\n { value: 'iflow-cli', label: 'iFlow CLI' },\n { value: 'junie', label: 'Junie' },\n { value: 'kilo', label: 'Kilo Code' },\n { value: 'kiro-cli', label: 'Kiro CLI' },\n { value: 'kode', label: 'Kode' },\n { value: 'mcpjam', label: 'MCPJam' },\n { value: 'mistral-vibe', label: 'Mistral Vibe' },\n { value: 'mux', label: 'Mux' },\n { value: 'neovate', label: 'Neovate' },\n { value: 'openclaude', label: 'OpenClaude IDE' },\n { value: 'openclaw', label: 'OpenClaw' },\n { value: 'openhands', label: 'OpenHands' },\n { value: 'pi', label: 'Pi' },\n { value: 'pochi', label: 'Pochi' },\n { value: 'qoder', label: 'Qoder' },\n { value: 'qwen-code', label: 'Qwen Code' },\n { value: 'replit', label: 'Replit' },\n { value: 'roo', label: 'Roo Code' },\n { value: 'trae', label: 'Trae' },\n { value: 'trae-cn', label: 'Trae CN' },\n { value: 'windsurf', label: 'Windsurf' },\n { value: 'zencoder', label: 'Zencoder' },\n ];\n\n // Show popular agents first with \"Show all\" option\n const initialSelection = await p.select({\n message: `Select your coding assistant:`,\n options: [...POPULAR_AGENTS, { value: '__show_all__', label: '+ Show all agents' }],\n initialValue: 'universal',\n });\n\n if (p.isCancel(initialSelection)) {\n return { skills: undefined, mcpServer: undefined };\n }\n\n let selectedAgents = new Set<string>();\n\n // If user selected \"Show all\", show full list\n if (initialSelection === '__show_all__') {\n const followUpSelection = await p.select({\n message: `Select your coding assistant:`,\n options: ALL_AGENTS,\n });\n\n if (p.isCancel(followUpSelection)) {\n return { skills: undefined, mcpServer: undefined };\n }\n\n selectedAgents.add(followUpSelection);\n } else {\n selectedAgents.add(initialSelection);\n }\n\n // Always add \"universal\" type so that the definition there gets symlinked to the proprietary agent folders\n selectedAgents.add('universal');\n\n return { skills: Array.from(selectedAgents), mcpServer: undefined };\n }\n\n // If MCP selected, show editor sub-selection\n if (choice === 'mcp') {\n const editor = await p.select({\n message: `Select your coding assistant:`,\n options: [\n {\n value: 'cursor',\n label: 'Cursor (project only)',\n },\n {\n value: 'cursor-global',\n label: 'Cursor (global, all projects)',\n },\n {\n value: 'windsurf',\n label: 'Windsurf',\n },\n {\n value: 'vscode',\n label: 'VSCode',\n },\n {\n value: 'antigravity',\n label: 'Antigravity',\n },\n ] satisfies { value: Editor; label: string }[],\n });\n\n if (p.isCancel(editor)) {\n return { skills: undefined, mcpServer: undefined };\n }\n\n // Handle MCP editor selections with confirmations\n if (editor === `cursor`) {\n p.log.message(\n `\\nNote: you will need to go into Cursor Settings -> MCP Settings and manually enable the installed Mastra MCP server.\\n`,\n );\n }\n\n if (editor === `cursor-global`) {\n const confirm = await p.select({\n message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,\n options: [\n { value: 'yes', label: 'Yes, I understand' },\n { value: 'no', label: 'No, cancel' },\n ],\n });\n if (confirm !== `yes`) {\n return { skills: undefined, mcpServer: undefined };\n }\n }\n\n if (editor === `windsurf`) {\n const confirm = await p.select({\n message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?\\nThis means the Mastra docs MCP server will be available in all your Windsurf projects.`,\n options: [\n { value: 'yes', label: 'Yes, I understand' },\n { value: 'no', label: 'No, cancel' },\n ],\n });\n if (confirm !== `yes`) {\n return { skills: undefined, mcpServer: undefined };\n }\n }\n\n if (editor === `antigravity`) {\n const confirm = await p.select({\n message: `Antigravity only supports a global MCP config (at ${antigravityGlobalMCPConfigPath}). Is it ok to add/update that global config?\\nThis will make the Mastra docs MCP server available in all Antigravity projects.`,\n options: [\n { value: 'yes', label: 'Yes, I understand' },\n { value: 'no', label: 'No, cancel' },\n ],\n });\n\n if (confirm !== `yes`) {\n return { skills: undefined, mcpServer: undefined };\n }\n }\n return { skills: undefined, mcpServer: editor };\n }\n\n return { skills: undefined, mcpServer: undefined };\n },\n initGit: async () => {\n if (skip?.gitInit) return false;\n\n return p.confirm({\n message: 'Initialize a new git repository?',\n initialValue: true,\n });\n },\n },\n {\n onCancel: () => {\n p.cancel('Operation cancelled.');\n process.exit(0);\n },\n },\n );\n\n // Flatten grouped prompt return values\n const { configureMastraToolingForAgents, observability, ...rest } = mastraProject;\n return {\n ...rest,\n observability: observability?.enabled,\n observabilityToken: observability?.token,\n observabilityOrgId: observability?.orgId,\n observabilityOrgName: observability?.orgName,\n skills: configureMastraToolingForAgents?.skills as string[] | undefined,\n mcpServer: configureMastraToolingForAgents?.mcpServer as Editor | undefined,\n };\n};\n\n/**\n * Check if the current directory has a package.json file. If not, we should alert the user to create one or run \"mastra create\" to create a new project. The package.json file is required to install dependencies in the next steps.\n */\nexport const checkForPkgJson = async () => {\n const cwd = process.cwd();\n const pkgJsonPath = path.join(cwd, 'package.json');\n\n try {\n await fs.access(pkgJsonPath);\n\n // Do nothing\n } catch {\n p.log.error(\n 'No package.json file found in the current directory. Please run \"npm init -y\" to create one, or run \"npx create-mastra@latest\" to create a new Mastra project.',\n );\n\n process.exit(1);\n }\n};\n\n/**\n * Read the `name` field from the project's `package.json`, returning `undefined`\n * if the file is missing or unparseable.\n */\nexport const readPackageName = async (): Promise<string | undefined> => {\n try {\n const raw = await fs.readFile(path.join(process.cwd(), 'package.json'), 'utf8');\n const parsed = JSON.parse(raw) as { name?: unknown };\n return typeof parsed.name === 'string' && parsed.name.trim().length > 0 ? parsed.name : undefined;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Generate content for AGENTS.md file\n */\nexport function generateAgentsMarkdown({ skills, mcpServer }: { skills?: string[]; mcpServer?: Editor }): string {\n const hasSkills = skills && skills.length > 0;\n const hasMcp = !!mcpServer;\n\n let content = `# AGENTS.md\n`;\n\n // Add critical Mastra skill section if skills were installed\n if (hasSkills) {\n content += `\n## CRITICAL: Load \\`mastra\\` skill first\n\nLoad the \\`mastra\\` skill BEFORE any Mastra work. Never rely on cached knowledge — APIs change between versions.\n`;\n }\n\n content += `\n## Rules\n\n- Register all agents, tools, workflows, and scorers in \\`src/mastra/index.ts\\`\n- Use the \\`dev\\` and \\`build\\` scripts from \\`package.json\\` instead of running \\`mastra dev\\` / \\`mastra build\\` directly\n`;\n\n // Add MCP section if MCP server was configured\n if (hasMcp) {\n const editorName =\n mcpServer === 'cursor-global' ? 'Cursor (global)' : mcpServer!.charAt(0).toUpperCase() + mcpServer!.slice(1);\n\n content += `## MCP Docs Server\n\nMastra MCP Docs Server is configured for ${editorName}. Restart your editor to load it.\n`;\n }\n\n // Add resources section\n content += `\n## Resources\n\n- [Mastra Documentation](https://mastra.ai/llms.txt)\n- [Skills Discovery](https://mastra.ai/.well-known/skills/index.json)\n`;\n\n return content;\n}\n\n/**\n * Write AGENTS.md file to project root\n */\nexport async function writeAgentsMarkdown(options: { skills?: string[]; mcpServer?: Editor }): Promise<void> {\n const content = generateAgentsMarkdown(options);\n const filePath = path.join(process.cwd(), 'AGENTS.md');\n await fs.writeFile(filePath, content);\n}\n\n/**\n * Write CLAUDE.md file to project root\n */\nexport async function writeClaudeMarkdown(): Promise<void> {\n const filePath = path.join(process.cwd(), 'CLAUDE.md');\n await fs.writeFile(filePath, '@AGENTS.md');\n}\n","import fs from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { InvalidArgumentError } from 'commander';\nimport { execa } from 'execa';\nimport fsExtra from 'fs-extra';\nimport type { PackageManager } from '../utils/package-manager';\nimport { selectMatchingDistTag } from './create/command';\nimport { EDITOR, isValidEditor } from './init/mcp-docs-server-install';\nimport { areValidComponents, COMPONENTS, isValidLLMProvider, LLMProvider } from './init/utils';\n\nexport function getPackageManager(): PackageManager {\n const userAgent = process.env.npm_config_user_agent || '';\n const execPath = process.env.npm_execpath || '';\n\n // Check user agent first\n if (userAgent.includes('bun')) {\n return 'bun';\n }\n if (userAgent.includes('yarn')) {\n return 'yarn';\n }\n if (userAgent.includes('pnpm')) {\n return 'pnpm';\n }\n if (userAgent.includes('npm')) {\n return 'npm';\n }\n\n // Fallback to execpath check\n if (execPath.includes('bun')) {\n return 'bun';\n }\n if (execPath.includes('yarn')) {\n return 'yarn';\n }\n if (execPath.includes('pnpm')) {\n return 'pnpm';\n }\n if (execPath.includes('npm')) {\n return 'npm';\n }\n\n return 'npm'; // Default fallback\n}\n\n/**\n * Wrap an async commander action so failures print a clean error message\n * (never a stack trace) and exit non-zero.\n */\nexport function wrapAction(fn: (...args: any[]) => Promise<void>): (...args: any[]) => void {\n return (...args: any[]) => {\n fn(...args).catch((err: Error) => {\n console.error(`Error: ${err.message}`);\n process.exit(1);\n });\n };\n}\n\nexport function parseMcp(value: string) {\n if (!isValidEditor(value)) {\n throw new InvalidArgumentError(`Choose a valid value: ${EDITOR.join(', ')}`);\n }\n return value;\n}\n\nexport function parseSkills(value: string) {\n // Skills flag accepts comma-separated agent names\n return value\n .split(',')\n .map(s => s.trim())\n .filter(Boolean);\n}\n\nexport function parseComponents(value: string) {\n const parsedValue = value.split(',');\n\n if (!areValidComponents(parsedValue)) {\n throw new InvalidArgumentError(`Choose valid components: ${COMPONENTS.join(', ')}`);\n }\n\n return parsedValue;\n}\n\nexport function parseLlmProvider(value: string) {\n if (!isValidLLMProvider(value)) {\n throw new InvalidArgumentError(`Choose a valid provider: ${LLMProvider.join(', ')}`);\n }\n return value;\n}\n\nexport function shouldSkipDotenvLoading(): boolean {\n return process.env.MASTRA_SKIP_DOTENV === 'true' || process.env.MASTRA_SKIP_DOTENV === '1';\n}\n\n/**\n * Get the version tag (e.g., 'beta', 'latest') for the currently running mastra CLI.\n * Create passes its known version to avoid resolving package metadata from an installed layout.\n * Init omits it and preserves the existing best-effort undefined fallback.\n */\nexport async function getVersionTag(version?: string): Promise<string | undefined> {\n try {\n let currentVersion = version;\n if (!currentVersion) {\n const pkgPath = fileURLToPath(import.meta.resolve('mastra/package.json'));\n const json = await fsExtra.readJSON(pkgPath);\n currentVersion = json.version;\n }\n if (!currentVersion) throw new Error('Missing mastra package version');\n\n const { stdout } = await execa('npm', ['dist-tag', 'ls', 'mastra'], {\n cwd: import.meta.dirname,\n });\n const tag = selectMatchingDistTag(currentVersion, stdout);\n if (tag) return tag;\n } catch {\n // The caller-specific fallback is handled below.\n }\n\n if (version) {\n console.error('We could not resolve the mastra version tag, falling back to \"latest\"');\n return 'latest';\n }\n\n return undefined;\n}\n\n/**\n * Check if the current directory already has git initialized.\n */\nexport async function isGitInitialized({ cwd }: { cwd: string }): Promise<boolean> {\n try {\n await execa('git', ['rev-parse', '--is-inside-work-tree'], { cwd, stdio: 'ignore' });\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Initialize a git repository in the specified directory.\n */\nexport async function gitInit({ cwd }: { cwd: string }) {\n await execa('git', ['init'], { cwd, stdio: 'ignore' });\n await execa('git', ['add', '-A'], { cwd, stdio: 'ignore' });\n await execa(\n 'git',\n [\n 'commit',\n '-m',\n 'Initial commit from Mastra',\n '--author=\"dane-ai-mastra[bot] <dane-ai-mastra[bot]@users.noreply.github.com>\"',\n ],\n { cwd, stdio: 'ignore' },\n );\n}\n","import { randomUUID } from 'node:crypto';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { PostHog } from 'posthog-node';\nimport { getPackageManager } from '../commands/utils.js';\n\nconst ANALYTICS_CONFIG_PATH = path.join(os.homedir(), '.mastra', 'analytics.json');\n\ninterface CommandData {\n command: string;\n args?: Record<string, unknown>;\n durationMs?: number;\n status: 'success' | 'error';\n error?: string;\n}\n\nexport type CLI_ORIGIN = 'mastra-cloud' | 'oss';\n\n/**\n * Bucket the Mastra platform API host into coarse labels for analytics.\n *\n * We report the *category* of API surface a deploy is talking to (cloud,\n * staging, localhost, custom, unknown) rather than the raw host, so\n * self-hosted or internal domains are never leaked to telemetry.\n */\nexport function bucketApiHost(apiUrl: string): 'cloud' | 'staging' | 'localhost' | 'custom' | 'unknown' {\n try {\n const { host, hostname } = new URL(apiUrl);\n if (hostname === 'localhost' || hostname === '127.0.0.1') return 'localhost';\n if (host === 'staging.mastra.cloud' || host.endsWith('.staging.mastra.cloud')) return 'staging';\n if (host === 'platform.mastra.ai' || host === 'mastra.cloud' || host.endsWith('.mastra.cloud')) return 'cloud';\n return 'custom';\n } catch {\n return 'unknown';\n }\n}\n\nlet analyticsInstance: PosthogAnalytics | null = null;\n\nexport function getAnalytics(): PosthogAnalytics | null {\n return analyticsInstance;\n}\n\nexport function setAnalytics(instance: PosthogAnalytics): void {\n analyticsInstance = instance;\n}\n\nexport class PosthogAnalytics {\n private sessionId: string = '';\n private client?: PostHog;\n private distinctId: string = '';\n private version: string;\n private packageManager: string = '';\n\n constructor({\n version,\n apiKey,\n host = 'https://app.posthog.com',\n }: {\n version: string;\n apiKey: string;\n host: string;\n }) {\n this.version = version;\n\n if (!PosthogAnalytics.isTelemetryEnabled()) {\n return;\n }\n\n this.packageManager = getPackageManager();\n const { distinctId, sessionId } = this.getOrCreateAnalyticsConfig();\n this.distinctId = distinctId;\n this.sessionId = sessionId;\n\n this.initializePostHog(apiKey, host);\n }\n\n private getOrCreateAnalyticsConfig(configPath = ANALYTICS_CONFIG_PATH): { distinctId: string; sessionId: string } {\n try {\n if (existsSync(configPath)) {\n const { distinctId, sessionId } = JSON.parse(readFileSync(configPath, 'utf-8')) as {\n distinctId?: string;\n sessionId?: string;\n };\n if (distinctId && !this.isHostnameDerivedDistinctId(distinctId)) {\n const config = {\n distinctId,\n sessionId: sessionId || randomUUID(),\n };\n if (config.sessionId !== sessionId) {\n this.writeCliConfig(config, configPath);\n }\n return config;\n }\n }\n } catch {\n // regenerate below\n }\n\n const config = {\n distinctId: this.createDistinctId(),\n sessionId: randomUUID(),\n };\n this.writeCliConfig(config, configPath);\n return config;\n }\n\n private writeCliConfig(\n { distinctId, sessionId }: { distinctId: string; sessionId: string },\n configPath = ANALYTICS_CONFIG_PATH,\n ): void {\n try {\n mkdirSync(path.dirname(configPath), { recursive: true });\n writeFileSync(configPath, JSON.stringify({ distinctId, sessionId }));\n } catch {\n //swallow\n }\n }\n\n private initializePostHog(apiKey: string, host: string): void {\n this.client = new PostHog(apiKey, {\n host,\n flushAt: 1,\n flushInterval: 0,\n disableGeoip: false,\n });\n\n this.captureSessionStart();\n\n process.on('exit', () => {\n this.client?.flush().catch(() => {});\n });\n }\n\n private static isTelemetryEnabled(): boolean {\n const value = process.env.MASTRA_TELEMETRY_DISABLED;\n if (value && ['1', 'true', 'yes'].includes(value.trim().toLowerCase())) {\n return false;\n }\n return true;\n }\n\n private createDistinctId(): string {\n return `mastra-${randomUUID()}`;\n }\n\n private isHostnameDerivedDistinctId(distinctId: string): boolean {\n return distinctId === `mastra-${os.hostname()}`;\n }\n\n private getSystemProperties(): Record<string, any> {\n return {\n os: process.platform,\n os_version: os.release(),\n node_version: process.version,\n platform: process.arch,\n session_id: this.sessionId,\n cli_version: this.version || 'unknown',\n machine_id: os.hostname(),\n package_manager: this.packageManager,\n };\n }\n private getDurationMs(startTime: [number, number]): number {\n const [seconds, nanoseconds] = process.hrtime(startTime);\n return seconds * 1000 + nanoseconds / 1_000_000;\n }\n\n private captureSessionStart(): void {\n if (!this.client) {\n return;\n }\n\n this.client.capture({\n distinctId: this.distinctId,\n event: 'cli_session_start',\n properties: {\n ...this.getSystemProperties(),\n },\n });\n }\n\n getDistinctId(): string {\n return this.distinctId;\n }\n\n trackEvent(eventName: string, properties?: Record<string, any>): void {\n try {\n if (!this.client) {\n return;\n }\n\n this.client.capture({\n distinctId: this.distinctId,\n event: eventName,\n properties: {\n ...this.getSystemProperties(),\n ...properties,\n },\n });\n } catch {\n //swallow\n }\n }\n\n trackCommand(options: {\n command: string;\n args?: Record<string, unknown>;\n durationMs?: number;\n status?: 'success' | 'error';\n error?: string;\n origin?: CLI_ORIGIN;\n }): void {\n try {\n if (!this.client) {\n return;\n }\n\n const commandData: CommandData = {\n command: options.command,\n status: options.status || 'success',\n };\n\n if (options.args) {\n commandData.args = options.args;\n }\n\n if (options.durationMs) {\n commandData.durationMs = options.durationMs;\n }\n\n if (options.error) {\n commandData.error = options.error;\n }\n\n this.client.capture({\n distinctId: this.distinctId,\n event: 'cli_command',\n properties: {\n ...this.getSystemProperties(),\n ...commandData,\n origin: options?.origin || 'oss',\n },\n });\n } catch {\n //swallow\n }\n }\n\n // Helper method to wrap command execution with timing\n async trackCommandExecution<T>({\n command,\n args,\n execution,\n origin,\n }: {\n command: string;\n args: Record<string, unknown>;\n execution: () => Promise<T>;\n origin?: CLI_ORIGIN;\n }): Promise<T> {\n const startTime = process.hrtime();\n\n try {\n const result = await execution();\n const durationMs = this.getDurationMs(startTime);\n this.trackCommand({\n command,\n args,\n durationMs,\n status: 'success',\n origin,\n });\n\n return result;\n } catch (error) {\n const durationMs = this.getDurationMs(startTime);\n this.trackCommand({\n command,\n args,\n durationMs,\n status: 'error',\n error: error instanceof Error ? error.message : String(error),\n origin,\n });\n\n throw error;\n }\n }\n\n // Ensure PostHog client is shutdown properly\n async shutdown(timeoutMs?: number): Promise<void> {\n if (!this.client) {\n return;\n }\n try {\n await this.client.shutdown(timeoutMs);\n } catch {\n //swallow\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,MAAa,uBAAuB;CAClC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAO,OAAO;CAAM;AAC/B;AA4BA,SAAgB,uBAAuB,OAAkC;CACvE,IAAI,CAAC,qBAAqB,MAAK,aAAY,SAAS,UAAU,KAAK,GACjE,MAAM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Q,YACV,YAAY,aAAa,QAAQ;GAGnC,IAAI,QAAQ,OACV,YAAY,QAAQ,QAAQ;GAG9B,KAAK,OAAO,QAAQ;IAClB,YAAY,KAAK;IACjB,OAAO;IACP,YAAY;KACV,GAAG,KAAK,oBAAoB;KAC5B,GAAG;KACH,QAAQ,SAAS,UAAU;IAC7B;GACF,CAAC;EACH,QAAQ,CAER;CACF;CAGA,MAAM,sBAAyB,EAC7B,SACA,MACA,WACA,UAMa;EACb,MAAM,YAAY,QAAQ,OAAO;EAEjC,IAAI;GACF,MAAM,SAAS,MAAM,UAAU;GAC/B,MAAM,aAAa,KAAK,cAAc,SAAS;GAC/C,KAAK,aAAa;IAChB;IACA;IACA;IACA,QAAQ;IACR;GACF,CAAC;GAED,OAAO;EACT,SAAS,OAAO;GACd,MAAM,aAAa,KAAK,cAAc,SAAS;GAC/C,KAAK,aAAa;IAChB;IACA;IACA;IACA,QAAQ;IACR,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC5D;GACF,CAAC;GAED,MAAM;EACR;CACF;CAGA,MAAM,SAAS,WAAmC;EAChD,IAAI,CAAC,KAAK,QACR;EAEF,IAAI;GACF,MAAM,KAAK,OAAO,SAAS,SAAS;EACtC,QAAQ,CAER;CACF;AACF"}
@@ -495,6 +495,18 @@ export declare const CLI_ROUTE_METADATA: {
495
495
  readonly kind: "record";
496
496
  };
497
497
  };
498
+ readonly "GET /workflows/run-counts": {
499
+ readonly method: "GET";
500
+ readonly path: "/workflows/run-counts";
501
+ readonly pathParams: readonly [];
502
+ readonly queryParams: readonly [];
503
+ readonly bodyParams: readonly [];
504
+ readonly hasQuery: false;
505
+ readonly hasBody: false;
506
+ readonly responseShape: {
507
+ readonly kind: "record";
508
+ };
509
+ };
498
510
  readonly "GET /workflows/:workflowId": {
499
511
  readonly method: "GET";
500
512
  readonly path: "/workflows/:workflowId";
@@ -1274,7 +1286,7 @@ export declare const CLI_ROUTE_METADATA: {
1274
1286
  readonly method: "GET";
1275
1287
  readonly path: "/observability/traces/light";
1276
1288
  readonly pathParams: readonly [];
1277
- readonly queryParams: readonly ["dateRange", "direction", "endedAt", "entityId", "entityName", "entityType", "entityVersionId", "environment", "experimentId", "field", "hasChildError", "metadata", "name", "organizationId", "page", "parentEntityId", "parentEntityName", "parentEntityType", "parentEntityVersionId", "perPage", "requestId", "resourceId", "rootEntityId", "rootEntityName", "rootEntityType", "rootEntityVersionId", "runId", "scope", "serviceName", "sessionId", "source", "spanType", "startedAt", "status", "tags", "threadId", "traceId", "userId"];
1289
+ readonly queryParams: readonly ["after", "dateRange", "direction", "endedAt", "entityId", "entityName", "entityType", "entityVersionId", "environment", "experimentId", "field", "hasChildError", "limit", "metadata", "mode", "name", "organizationId", "page", "parentEntityId", "parentEntityName", "parentEntityType", "parentEntityVersionId", "perPage", "requestId", "resourceId", "rootEntityId", "rootEntityName", "rootEntityType", "rootEntityVersionId", "runId", "scope", "serviceName", "sessionId", "source", "spanType", "startedAt", "status", "tags", "threadId", "traceId", "userId"];
1278
1290
  readonly bodyParams: readonly [];
1279
1291
  readonly hasQuery: true;
1280
1292
  readonly hasBody: false;
@@ -3526,7 +3538,7 @@ export declare const CLI_ROUTE_METADATA: {
3526
3538
  readonly method: "GET";
3527
3539
  readonly path: "/experiments";
3528
3540
  readonly pathParams: readonly [];
3529
- readonly queryParams: readonly ["page", "perPage"];
3541
+ readonly queryParams: readonly ["comparisonId", "experimentSetId", "page", "perPage", "trialIndex", "variantId"];
3530
3542
  readonly bodyParams: readonly [];
3531
3543
  readonly hasQuery: true;
3532
3544
  readonly hasBody: false;
@@ -3553,7 +3565,7 @@ export declare const CLI_ROUTE_METADATA: {
3553
3565
  readonly method: "GET";
3554
3566
  readonly path: "/datasets/:datasetId/experiments";
3555
3567
  readonly pathParams: readonly ["datasetId"];
3556
- readonly queryParams: readonly ["page", "perPage"];
3568
+ readonly queryParams: readonly ["comparisonId", "experimentSetId", "page", "perPage", "trialIndex", "variantId"];
3557
3569
  readonly bodyParams: readonly [];
3558
3570
  readonly hasQuery: true;
3559
3571
  readonly hasBody: false;
@@ -3568,7 +3580,7 @@ export declare const CLI_ROUTE_METADATA: {
3568
3580
  readonly path: "/datasets/:datasetId/experiments";
3569
3581
  readonly pathParams: readonly ["datasetId"];
3570
3582
  readonly queryParams: readonly [];
3571
- readonly bodyParams: readonly ["agentVersion", "maxConcurrency", "requestContext", "scorerIds", "targetId", "targetType", "version", "versions"];
3583
+ readonly bodyParams: readonly ["agentVersion", "description", "grouping", "maxConcurrency", "metadata", "name", "provenance", "requestContext", "scorerIds", "targetId", "targetType", "version", "versions"];
3572
3584
  readonly hasQuery: false;
3573
3585
  readonly hasBody: true;
3574
3586
  readonly responseShape: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAY7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAA2B,oBAAoB,EAAc,MAAM,YAAY,CAAC;AAI5F;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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gB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAsflE;AAsND;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,oBAAoB,EAChC,gBAAgB,EAAE,MAAM,EAAE,EAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,gBAAgB,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAChD,OAAO,CAAC,IAAI,CAAC,CAgEf"}
@@ -363,6 +363,18 @@ export declare const API_ROUTE_METADATA: {
363
363
  readonly kind: "record";
364
364
  };
365
365
  };
366
+ readonly "GET /workflows/run-counts": {
367
+ readonly method: "GET";
368
+ readonly path: "/workflows/run-counts";
369
+ readonly pathParams: readonly [];
370
+ readonly queryParams: readonly [];
371
+ readonly bodyParams: readonly [];
372
+ readonly hasQuery: false;
373
+ readonly hasBody: false;
374
+ readonly responseShape: {
375
+ readonly kind: "record";
376
+ };
377
+ };
366
378
  readonly "GET /workflows/:workflowId": {
367
379
  readonly method: "GET";
368
380
  readonly path: "/workflows/:workflowId";
@@ -1142,7 +1154,7 @@ export declare const API_ROUTE_METADATA: {
1142
1154
  readonly method: "GET";
1143
1155
  readonly path: "/observability/traces/light";
1144
1156
  readonly pathParams: readonly [];
1145
- readonly queryParams: readonly ["dateRange", "direction", "endedAt", "entityId", "entityName", "entityType", "entityVersionId", "environment", "experimentId", "field", "hasChildError", "metadata", "name", "organizationId", "page", "parentEntityId", "parentEntityName", "parentEntityType", "parentEntityVersionId", "perPage", "requestId", "resourceId", "rootEntityId", "rootEntityName", "rootEntityType", "rootEntityVersionId", "runId", "scope", "serviceName", "sessionId", "source", "spanType", "startedAt", "status", "tags", "threadId", "traceId", "userId"];
1157
+ readonly queryParams: readonly ["after", "dateRange", "direction", "endedAt", "entityId", "entityName", "entityType", "entityVersionId", "environment", "experimentId", "field", "hasChildError", "limit", "metadata", "mode", "name", "organizationId", "page", "parentEntityId", "parentEntityName", "parentEntityType", "parentEntityVersionId", "perPage", "requestId", "resourceId", "rootEntityId", "rootEntityName", "rootEntityType", "rootEntityVersionId", "runId", "scope", "serviceName", "sessionId", "source", "spanType", "startedAt", "status", "tags", "threadId", "traceId", "userId"];
1146
1158
  readonly bodyParams: readonly [];
1147
1159
  readonly hasQuery: true;
1148
1160
  readonly hasBody: false;
@@ -3394,7 +3406,7 @@ export declare const API_ROUTE_METADATA: {
3394
3406
  readonly method: "GET";
3395
3407
  readonly path: "/experiments";
3396
3408
  readonly pathParams: readonly [];
3397
- readonly queryParams: readonly ["page", "perPage"];
3409
+ readonly queryParams: readonly ["comparisonId", "experimentSetId", "page", "perPage", "trialIndex", "variantId"];
3398
3410
  readonly bodyParams: readonly [];
3399
3411
  readonly hasQuery: true;
3400
3412
  readonly hasBody: false;
@@ -3421,7 +3433,7 @@ export declare const API_ROUTE_METADATA: {
3421
3433
  readonly method: "GET";
3422
3434
  readonly path: "/datasets/:datasetId/experiments";
3423
3435
  readonly pathParams: readonly ["datasetId"];
3424
- readonly queryParams: readonly ["page", "perPage"];
3436
+ readonly queryParams: readonly ["comparisonId", "experimentSetId", "page", "perPage", "trialIndex", "variantId"];
3425
3437
  readonly bodyParams: readonly [];
3426
3438
  readonly hasQuery: true;
3427
3439
  readonly hasBody: false;
@@ -3436,7 +3448,7 @@ export declare const API_ROUTE_METADATA: {
3436
3448
  readonly path: "/datasets/:datasetId/experiments";
3437
3449
  readonly pathParams: readonly ["datasetId"];
3438
3450
  readonly queryParams: readonly [];
3439
- readonly bodyParams: readonly ["agentVersion", "maxConcurrency", "requestContext", "scorerIds", "targetId", "targetType", "version", "versions"];
3451
+ readonly bodyParams: readonly ["agentVersion", "description", "grouping", "maxConcurrency", "metadata", "name", "provenance", "requestContext", "scorerIds", "targetId", "targetType", "version", "versions"];
3440
3452
  readonly hasQuery: false;
3441
3453
  readonly hasBody: true;
3442
3454
  readonly responseShape: {