@mastra/dane 0.0.2-alpha.117 → 0.0.2-alpha.118

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 (106) hide show
  1. package/package.json +10 -9
  2. package/dist/commands/changelog.d.ts +0 -2
  3. package/dist/commands/changelog.d.ts.map +0 -1
  4. package/dist/commands/changelog.js +0 -15
  5. package/dist/commands/commit-message.d.ts +0 -2
  6. package/dist/commands/commit-message.d.ts.map +0 -1
  7. package/dist/commands/commit-message.js +0 -32
  8. package/dist/commands/config.d.ts +0 -3
  9. package/dist/commands/config.d.ts.map +0 -1
  10. package/dist/commands/config.js +0 -40
  11. package/dist/commands/issue-labeler.d.ts +0 -2
  12. package/dist/commands/issue-labeler.d.ts.map +0 -1
  13. package/dist/commands/issue-labeler.js +0 -35
  14. package/dist/commands/link-checker.d.ts +0 -4
  15. package/dist/commands/link-checker.d.ts.map +0 -1
  16. package/dist/commands/link-checker.js +0 -16
  17. package/dist/commands/message.d.ts +0 -2
  18. package/dist/commands/message.d.ts.map +0 -1
  19. package/dist/commands/message.js +0 -14
  20. package/dist/commands/new-contributor-message.d.ts +0 -2
  21. package/dist/commands/new-contributor-message.d.ts.map +0 -1
  22. package/dist/commands/new-contributor-message.js +0 -43
  23. package/dist/commands/publish-packages.d.ts +0 -2
  24. package/dist/commands/publish-packages.d.ts.map +0 -1
  25. package/dist/commands/publish-packages.js +0 -11
  26. package/dist/commands/telephone-game.d.ts +0 -2
  27. package/dist/commands/telephone-game.d.ts.map +0 -1
  28. package/dist/commands/telephone-game.js +0 -32
  29. package/dist/config/index.d.ts +0 -12
  30. package/dist/config/index.d.ts.map +0 -1
  31. package/dist/config/index.js +0 -75
  32. package/dist/index.d.ts +0 -3
  33. package/dist/index.d.ts.map +0 -1
  34. package/dist/index.js +0 -37
  35. package/dist/mastra/agents/index.d.ts +0 -165
  36. package/dist/mastra/agents/index.d.ts.map +0 -1
  37. package/dist/mastra/agents/index.js +0 -105
  38. package/dist/mastra/agents/model.d.ts +0 -7
  39. package/dist/mastra/agents/model.d.ts.map +0 -1
  40. package/dist/mastra/agents/model.js +0 -7
  41. package/dist/mastra/agents/new-contributor.d.ts +0 -3
  42. package/dist/mastra/agents/new-contributor.d.ts.map +0 -1
  43. package/dist/mastra/agents/new-contributor.js +0 -12
  44. package/dist/mastra/agents/package-publisher.d.ts +0 -65
  45. package/dist/mastra/agents/package-publisher.d.ts.map +0 -1
  46. package/dist/mastra/agents/package-publisher.js +0 -188
  47. package/dist/mastra/index.d.ts +0 -291
  48. package/dist/mastra/index.d.ts.map +0 -1
  49. package/dist/mastra/index.js +0 -47
  50. package/dist/mastra/integrations/index.d.ts +0 -5
  51. package/dist/mastra/integrations/index.d.ts.map +0 -1
  52. package/dist/mastra/integrations/index.js +0 -23
  53. package/dist/mastra/tools/browser.d.ts +0 -40
  54. package/dist/mastra/tools/browser.d.ts.map +0 -1
  55. package/dist/mastra/tools/browser.js +0 -116
  56. package/dist/mastra/tools/calendar.d.ts +0 -21
  57. package/dist/mastra/tools/calendar.d.ts.map +0 -1
  58. package/dist/mastra/tools/calendar.js +0 -134
  59. package/dist/mastra/tools/crawl.d.ts +0 -36
  60. package/dist/mastra/tools/crawl.d.ts.map +0 -1
  61. package/dist/mastra/tools/crawl.js +0 -27
  62. package/dist/mastra/tools/execa.d.ts +0 -27
  63. package/dist/mastra/tools/execa.d.ts.map +0 -1
  64. package/dist/mastra/tools/execa.js +0 -43
  65. package/dist/mastra/tools/fs.d.ts +0 -33
  66. package/dist/mastra/tools/fs.d.ts.map +0 -1
  67. package/dist/mastra/tools/fs.js +0 -36
  68. package/dist/mastra/tools/image.d.ts +0 -27
  69. package/dist/mastra/tools/image.d.ts.map +0 -1
  70. package/dist/mastra/tools/image.js +0 -37
  71. package/dist/mastra/tools/mcp.d.ts +0 -3
  72. package/dist/mastra/tools/mcp.d.ts.map +0 -1
  73. package/dist/mastra/tools/mcp.js +0 -12
  74. package/dist/mastra/tools/pdf.d.ts +0 -21
  75. package/dist/mastra/tools/pdf.d.ts.map +0 -1
  76. package/dist/mastra/tools/pdf.js +0 -42
  77. package/dist/mastra/tools/pnpm.d.ts +0 -60
  78. package/dist/mastra/tools/pnpm.d.ts.map +0 -1
  79. package/dist/mastra/tools/pnpm.js +0 -127
  80. package/dist/mastra/workflows/changelog.d.ts +0 -10
  81. package/dist/mastra/workflows/changelog.d.ts.map +0 -1
  82. package/dist/mastra/workflows/changelog.js +0 -149
  83. package/dist/mastra/workflows/chat.d.ts +0 -13
  84. package/dist/mastra/workflows/chat.d.ts.map +0 -1
  85. package/dist/mastra/workflows/chat.js +0 -90
  86. package/dist/mastra/workflows/commit-message.d.ts +0 -10
  87. package/dist/mastra/workflows/commit-message.d.ts.map +0 -1
  88. package/dist/mastra/workflows/commit-message.js +0 -138
  89. package/dist/mastra/workflows/first-contributor.d.ts +0 -16
  90. package/dist/mastra/workflows/first-contributor.d.ts.map +0 -1
  91. package/dist/mastra/workflows/first-contributor.js +0 -122
  92. package/dist/mastra/workflows/index.d.ts +0 -4
  93. package/dist/mastra/workflows/index.d.ts.map +0 -1
  94. package/dist/mastra/workflows/index.js +0 -3
  95. package/dist/mastra/workflows/issue-labeler.d.ts +0 -16
  96. package/dist/mastra/workflows/issue-labeler.d.ts.map +0 -1
  97. package/dist/mastra/workflows/issue-labeler.js +0 -85
  98. package/dist/mastra/workflows/link-checker.d.ts +0 -13
  99. package/dist/mastra/workflows/link-checker.d.ts.map +0 -1
  100. package/dist/mastra/workflows/link-checker.js +0 -102
  101. package/dist/mastra/workflows/publish-packages.d.ts +0 -3
  102. package/dist/mastra/workflows/publish-packages.d.ts.map +0 -1
  103. package/dist/mastra/workflows/publish-packages.js +0 -299
  104. package/dist/mastra/workflows/telephone-game.d.ts +0 -3
  105. package/dist/mastra/workflows/telephone-game.d.ts.map +0 -1
  106. package/dist/mastra/workflows/telephone-game.js +0 -95
@@ -1,122 +0,0 @@
1
- import { Step, Workflow } from '@mastra/core/workflows';
2
- import { z } from 'zod';
3
- import { github } from '../integrations/index.js';
4
- export const githubFirstContributorMessage = new Workflow({
5
- name: 'github-first-contributor-message',
6
- triggerSchema: z.object({
7
- repo: z.string(),
8
- owner: z.string(),
9
- pr_number: z.number(),
10
- }),
11
- });
12
- const getPullRequest = new Step({
13
- id: 'getPullRequest',
14
- outputSchema: z.object({
15
- title: z.string(),
16
- body: z.string(),
17
- diff: z.string(),
18
- }),
19
- execute: async ({ context }) => {
20
- const client = await github.getApiClient();
21
- const pullRequest = await client.pullsGet({
22
- path: {
23
- owner: context?.machineContext?.triggerData?.owner,
24
- repo: context?.machineContext?.triggerData?.repo,
25
- pull_number: context?.machineContext?.triggerData?.pr_number,
26
- },
27
- });
28
- if (!pullRequest?.data) {
29
- throw new Error('Pull request not found');
30
- }
31
- const response = await fetch(pullRequest.data.diff_url);
32
- const diff = await response.text();
33
- return {
34
- title: pullRequest.data.title,
35
- body: pullRequest.data.body || '',
36
- diff,
37
- };
38
- },
39
- });
40
- const generateMessage = new Step({
41
- id: 'message-generator',
42
- outputSchema: z.object({
43
- message: z.array(z.string()),
44
- }),
45
- execute: async ({ context, mastra }) => {
46
- const parentStep = context?.machineContext?.stepResults?.getPullRequest;
47
- if (!parentStep || parentStep.status !== 'success') {
48
- return { message: [] };
49
- }
50
- const mastraDocsRes = await fetch('https://mastra.ai/llms.txt');
51
- const mastraDocs = await mastraDocsRes.text();
52
- const daneNewContributor = mastra?.agents?.daneNewContributor;
53
- const res = await daneNewContributor?.generate(`
54
- Hey Dane, given:
55
- START TITLE
56
- ${parentStep?.payload?.title}
57
- END TITLE
58
-
59
- START BODY
60
- ${parentStep?.payload?.body}
61
- END BODY
62
- START DIFF
63
- ${parentStep?.payload?.diff}
64
- END DIFF
65
-
66
- I'll give you some more context about Mastra:
67
- MASTRA DOCS
68
- ${mastraDocs}
69
- END MASTRA DOCS
70
-
71
- Write message to the contributor to thank them for their first contribution? And check if the following guidelines are followed, do not mention these checklist if they are actually checked:
72
- - Check if the body matches the diff and is not empty
73
- - Check if tests are added or updated
74
- - check if the code looks similar to what's already written
75
- - Ask if they have tested the changes on any of the examples
76
-
77
- VERY IMPORTANT:
78
- You should not summarize nor you should give advice on the code itself, only follow the guidelines.
79
-
80
- The message should bes strucutred like:
81
- an intro message to thank the user for their contribution
82
- the checklist
83
- and an outro that just says thank you again and that we will review it shortly. If there is no checklist we should skip thank you.
84
- `, {
85
- output: z.object({
86
- intro: z.string(),
87
- checklist: z.string().array(),
88
- outro: z.string(),
89
- }),
90
- });
91
- if (!res) {
92
- throw new Error(`We couldn't generate a message`);
93
- }
94
- return res.object;
95
- },
96
- });
97
- const createMessage = new Step({
98
- id: 'create-message',
99
- execute: async ({ context }) => {
100
- const parentStep = context?.machineContext?.stepResults?.['message-generator'];
101
- if (!parentStep || parentStep.status !== 'success') {
102
- return;
103
- }
104
- const client = await github.getApiClient();
105
- const res = await client.issuesCreateComment({
106
- path: {
107
- owner: context?.machineContext?.triggerData?.owner,
108
- repo: context?.machineContext?.triggerData?.repo,
109
- issue_number: context?.machineContext?.triggerData?.pr_number,
110
- },
111
- body: {
112
- body: `${parentStep.payload.intro}
113
-
114
- ${parentStep.payload.checklist.map((s) => `- [ ] ${s}`).join('\n')}
115
-
116
- ${parentStep.payload.outro}`,
117
- },
118
- });
119
- console.log(res);
120
- },
121
- });
122
- githubFirstContributorMessage.step(getPullRequest).then(generateMessage).then(createMessage).commit();
@@ -1,4 +0,0 @@
1
- export * from './chat.js';
2
- export * from './issue-labeler.js';
3
- export * from './commit-message.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './chat.js';
2
- export * from './issue-labeler.js';
3
- export * from './commit-message.js';
@@ -1,16 +0,0 @@
1
- import { Workflow } from '@mastra/core/workflows';
2
- import { z } from 'zod';
3
- export declare const githubIssueLabeler: Workflow<any, z.ZodObject<{
4
- repo: z.ZodString;
5
- owner: z.ZodString;
6
- issue_number: z.ZodNumber;
7
- }, "strip", z.ZodTypeAny, {
8
- repo: string;
9
- owner: string;
10
- issue_number: number;
11
- }, {
12
- repo: string;
13
- owner: string;
14
- issue_number: number;
15
- }>>;
16
- //# sourceMappingURL=issue-labeler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"issue-labeler.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/issue-labeler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;GAO7B,CAAC"}
@@ -1,85 +0,0 @@
1
- import { Step, Workflow } from '@mastra/core/workflows';
2
- import { z } from 'zod';
3
- import { github } from '../integrations/index.js';
4
- export const githubIssueLabeler = new Workflow({
5
- name: 'github-issue-labeler',
6
- triggerSchema: z.object({
7
- repo: z.string(),
8
- owner: z.string(),
9
- issue_number: z.number(),
10
- }),
11
- });
12
- const getIssue = new Step({
13
- id: 'getIssue',
14
- outputSchema: z.object({
15
- title: z.string(),
16
- body: z.string(),
17
- labelNames: z.array(z.string()),
18
- }),
19
- execute: async ({ context }) => {
20
- const client = await github.getApiClient();
21
- const issue = await client.issuesGet({
22
- path: {
23
- // TODO: Type triggerData in machineContext to the triggerSchema
24
- owner: context?.machineContext?.triggerData?.owner,
25
- repo: context?.machineContext?.triggerData?.repo,
26
- issue_number: context?.machineContext?.triggerData?.issue_number,
27
- },
28
- });
29
- const labels = await client.issuesListLabelsForRepo({
30
- path: {
31
- owner: context?.machineContext?.triggerData?.owner,
32
- repo: context?.machineContext?.triggerData?.repo,
33
- },
34
- });
35
- const labelNames = labels?.data?.map((label) => label.name);
36
- return { title: issue?.data?.title, body: issue?.data?.body, labelNames: labelNames };
37
- },
38
- });
39
- const labelIssue = new Step({
40
- id: 'labelIssue',
41
- outputSchema: z.object({
42
- labels: z.array(z.string()),
43
- }),
44
- execute: async ({ context, mastra }) => {
45
- const parentStep = context?.machineContext?.stepResults?.getIssue;
46
- if (!parentStep || parentStep.status !== 'success') {
47
- return { labels: [] };
48
- }
49
- const daneIssueLabeler = mastra?.agents?.daneIssueLabeler;
50
- const res = await daneIssueLabeler?.generate(`
51
- Hey Dane, given:
52
- * this issue title: ${parentStep?.payload?.title}
53
- * this issue body: ${parentStep?.payload?.body}
54
- * these labels: ${parentStep?.payload?.labelNames}
55
-
56
- What label or labels would you assign?
57
- `, {
58
- output: z.object({
59
- labels: z.array(z.string()),
60
- }),
61
- });
62
- return { labels: res?.object?.labels };
63
- },
64
- });
65
- const applyLabels = new Step({
66
- id: 'applyLabels',
67
- execute: async ({ context }) => {
68
- const parentStep = context?.machineContext?.stepResults?.labelIssue;
69
- if (!parentStep || parentStep.status !== 'success') {
70
- return;
71
- }
72
- const client = await github.getApiClient();
73
- await client.issuesAddLabels({
74
- path: {
75
- owner: context?.machineContext?.triggerData?.owner,
76
- repo: context?.machineContext?.triggerData?.repo,
77
- issue_number: context?.machineContext?.triggerData?.issue_number,
78
- },
79
- body: {
80
- labels: parentStep.payload.labels,
81
- },
82
- });
83
- },
84
- });
85
- githubIssueLabeler.step(getIssue).then(labelIssue).then(applyLabels).commit();
@@ -1,13 +0,0 @@
1
- import { Workflow } from '@mastra/core/workflows';
2
- import { z } from 'zod';
3
- export declare const linkCheckerWorkflow: Workflow<any, z.ZodObject<{
4
- channelId: z.ZodString;
5
- targetUrl: z.ZodString;
6
- }, "strip", z.ZodTypeAny, {
7
- channelId: string;
8
- targetUrl: string;
9
- }, {
10
- channelId: string;
11
- targetUrl: string;
12
- }>>;
13
- //# sourceMappingURL=link-checker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"link-checker.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/link-checker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,mBAAmB;;;;;;;;;GAM9B,CAAC"}
@@ -1,102 +0,0 @@
1
- import { Step, Workflow } from '@mastra/core/workflows';
2
- import chalk from 'chalk';
3
- import child_process from 'node:child_process';
4
- import util from 'node:util';
5
- import { z } from 'zod';
6
- import { slack } from '../tools/mcp.js';
7
- const exec = util.promisify(child_process.exec);
8
- export const linkCheckerWorkflow = new Workflow({
9
- name: 'link-checker',
10
- triggerSchema: z.object({
11
- channelId: z.string(),
12
- targetUrl: z.string(),
13
- }),
14
- });
15
- const linkSchema = z.object({
16
- url: z.string(),
17
- status: z.number(),
18
- state: z.enum(['OK', 'BROKEN']),
19
- parent: z.string().optional(),
20
- });
21
- const getBrokenLinks = new Step({
22
- id: 'get-broken-links',
23
- description: 'Get broken links',
24
- inputSchema: z.object({
25
- targetUrl: z.string(),
26
- }),
27
- outputSchema: z.object({
28
- brokenLinks: z.array(linkSchema),
29
- }),
30
- execute: async ({ context }) => {
31
- const targetUrl = context.targetUrl;
32
- const res = await exec(`npx linkinator ${targetUrl} --format json`, {
33
- encoding: 'utf-8',
34
- });
35
- if (res.stderr) {
36
- throw new Error(res.stderr);
37
- }
38
- const data = JSON.parse(res.stdout);
39
- const parsedData = linkSchema.array().parse(data.links);
40
- return {
41
- brokenLinks: parsedData.filter(link => link.state === 'BROKEN'),
42
- };
43
- },
44
- });
45
- const reportBrokenLinks = new Step({
46
- id: 'report-broken-links',
47
- description: 'Report broken links',
48
- outputSchema: z.object({
49
- message: z.string(),
50
- }),
51
- execute: async ({ context, mastra }) => {
52
- const brokenLinks = context.machineContext?.getStepPayload('get-broken-links');
53
- if (!brokenLinks) {
54
- return {
55
- message: 'No broken links found',
56
- };
57
- }
58
- if (brokenLinks.brokenLinks.length === 0) {
59
- return {
60
- message: 'No broken links found',
61
- };
62
- }
63
- try {
64
- await slack.connect();
65
- }
66
- catch (e) {
67
- console.error(e);
68
- }
69
- const triggerPayload = context.machineContext?.getStepPayload('trigger');
70
- if (!triggerPayload) {
71
- return {
72
- message: 'Trigger payload not found',
73
- };
74
- }
75
- const agent = mastra?.agents?.daneLinkChecker;
76
- if (!agent) {
77
- return {
78
- message: 'Agent not found',
79
- };
80
- }
81
- const tools = await slack.tools();
82
- console.log(`🤖Generating...`);
83
- const res = await agent.generate(`
84
- Send this ${JSON.stringify(brokenLinks, null, 2)} to this slack channel: "${triggerPayload.channelId}" with the tool slack_post_message.
85
- Format it in markdown so it displays nicely in slack.
86
- `, {
87
- toolsets: { slack: tools },
88
- });
89
- console.log(chalk.green(res.text));
90
- return {
91
- message: res.text,
92
- };
93
- },
94
- });
95
- linkCheckerWorkflow
96
- .step(getBrokenLinks, {
97
- variables: {
98
- targetUrl: { step: 'trigger', path: 'targetUrl' },
99
- },
100
- })
101
- .then(reportBrokenLinks)
102
- .commit();
@@ -1,3 +0,0 @@
1
- import { Workflow } from '@mastra/core/workflows';
2
- export declare const packagePublisher: Workflow<any, any>;
3
- //# sourceMappingURL=publish-packages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish-packages.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/publish-packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAYxD,eAAO,MAAM,gBAAgB,oBAE3B,CAAC"}
@@ -1,299 +0,0 @@
1
- import { Step, Workflow } from '@mastra/core/workflows';
2
- import chalk from 'chalk';
3
- import { execa } from 'execa';
4
- import { existsSync } from 'fs';
5
- import { readFileSync } from 'fs';
6
- import path from 'path';
7
- // import { z } from 'zod';
8
- // import { PACKAGES_LIST_PROMPT, /*PUBLISH_PACKAGES_PROMPT*/ } from '../agents/package-publisher.js';
9
- // import { pnpmBuild } from '../tools/pnpm.js';
10
- export const packagePublisher = new Workflow({
11
- name: 'pnpm-changset-publisher',
12
- });
13
- // const outputSchema = z.object({
14
- // packages: z.array(z.string()),
15
- // integrations: z.array(z.string()),
16
- // deployers: z.array(z.string()),
17
- // speech: z.array(z.string()),
18
- // // deprecated
19
- // vector_stores: z.array(z.string()),
20
- // stores: z.array(z.string()),
21
- // // combined deprecated stores
22
- // combined_stores: z.array(z.string()),
23
- // });
24
- // const defaultSet = {
25
- // packages: [],
26
- // deployers: [],
27
- // integrations: [],
28
- // speech: [],
29
- // // deprecated
30
- // vector_stores: [],
31
- // stores: [],
32
- // // combined vector + storage
33
- // combined_stores: [],
34
- // };
35
- // const getPacakgesToPublish = new Step({
36
- // id: 'getPacakgesToPublish',
37
- // outputSchema,
38
- // execute: async ({ mastra }) => {
39
- // const agent = mastra?.agents?.['danePackagePublisher'];
40
- // if (!agent) {
41
- // throw new Error('Agent not found');
42
- // }
43
- // const result = await agent.generate(PACKAGES_LIST_PROMPT);
44
- // console.log(chalk.green(`\n${result.text}`));
45
- // const resultObj = await agent.generate(
46
- // `
47
- // Please convert this into a structured object:
48
- // Input Text: ${result.text}
49
- // 1. Order Requirements:
50
- // - @mastra/core MUST be first within packages
51
- // - @mastra/deployer MUST be second within packages
52
- // - Group parallel builds by directory type
53
- // 2. Output Format:
54
- // - Group into: packages[], integrations[], deployers[], vector_stores[], stores[], combined_stores[]
55
- // - Place create-mastra in packages[] array
56
- // - Maintain correct order within each group
57
- // 3. Critical Rules:
58
- // - Never publish without building first
59
- // - Only include packages that need updates
60
- // - Follow dependency order strictly
61
- // `,
62
- // {
63
- // output: z.object({
64
- // packages: z.array(z.string()),
65
- // integrations: z.array(z.string()),
66
- // deployers: z.array(z.string()),
67
- // vector_stores: z.array(z.string()),
68
- // stores: z.array(z.string()),
69
- // combined_stores: z.array(z.string()),
70
- // speech: z.array(z.string()),
71
- // }),
72
- // },
73
- // );
74
- // return {
75
- // packages: resultObj?.object?.packages!,
76
- // integrations: resultObj?.object?.integrations!,
77
- // deployers: resultObj?.object?.deployers!,
78
- // vector_stores: resultObj?.object?.vector_stores!,
79
- // stores: resultObj?.object?.stores!,
80
- // combined_stores: resultObj?.object?.stores!,
81
- // speech: resultObj?.object?.speech!,
82
- // };
83
- // },
84
- // });
85
- // const assemblePackages = new Step({
86
- // id: 'assemblePackages',
87
- // outputSchema,
88
- // execute: async ({ context }) => {
89
- // if (context.machineContext?.stepResults.getPacakgesToPublish?.status !== 'success') {
90
- // return {
91
- // packages: [],
92
- // integrations: [],
93
- // deployers: [],
94
- // vector_stores: [],
95
- // stores: [],
96
- // combined_stores: [],
97
- // speech: [],
98
- // };
99
- // }
100
- // const payload = context.machineContext.stepResults.getPacakgesToPublish.payload;
101
- // const packagesToBuild: Set<string> = new Set();
102
- // const deployersToBuild: Set<string> = new Set();
103
- // const integrationsToBuild: Set<string> = new Set();
104
- // const vector_storesToBuild: Set<string> = new Set();
105
- // const storesToBuild: Set<string> = new Set();
106
- // const combined_storesToBuild: Set<string> = new Set();
107
- // const speechToBuild: Set<string> = new Set();
108
- // if (payload?.packages) {
109
- // payload.packages.forEach((pkg: string) => {
110
- // let pkgName = pkg.replace('@mastra/', '');
111
- // if (pkgName === 'mastra') {
112
- // pkgName = 'cli';
113
- // }
114
- // const pkgPath = path.join(process.cwd(), 'packages', pkgName);
115
- // packagesToBuild.add(pkgPath);
116
- // });
117
- // }
118
- // if (payload?.deployers) {
119
- // payload.deployers.forEach((pkg: string) => {
120
- // let pkgName = pkg.replace('@mastra/deployer-', '');
121
- // if (pkgName === 'mastra') {
122
- // pkgName = 'cli';
123
- // }
124
- // const pkgPath = path.join(process.cwd(), 'deployers', pkgName);
125
- // deployersToBuild.add(pkgPath);
126
- // });
127
- // }
128
- // if (payload?.vector_stores) {
129
- // payload.vector_stores.forEach((pkg: string) => {
130
- // let pkgName = pkg.replace('@mastra/vector-', '');
131
- // const pkgPath = path.join(process.cwd(), 'vector-stores', pkgName);
132
- // vector_storesToBuild.add(pkgPath);
133
- // });
134
- // }
135
- // if (payload?.stores) {
136
- // payload.stores.forEach((pkg: string) => {
137
- // let pkgName = pkg.replace('@mastra/store-', '');
138
- // const pkgPath = path.join(process.cwd(), 'storage', pkgName);
139
- // storesToBuild.add(pkgPath);
140
- // });
141
- // }
142
- // if (payload?.combined_stores) {
143
- // payload.combined_stores.forEach((pkg: string) => {
144
- // let pkgName = pkg.replace('@mastra/', '');
145
- // const pkgPath = path.join(process.cwd(), 'stores', pkgName);
146
- // combined_storesToBuild.add(pkgPath);
147
- // });
148
- // }
149
- // if (payload?.integrations) {
150
- // const integrations = payload.integrations;
151
- // integrations.forEach((integration: string) => {
152
- // let pkgName = integration.replace('@mastra/', '');
153
- // const integrationPath = path.join(process.cwd(), 'integrations', pkgName);
154
- // integrationsToBuild.add(integrationPath);
155
- // });
156
- // }
157
- // if (payload?.speech) {
158
- // const speecs = payload.speech;
159
- // speecs.forEach((speech: string) => {
160
- // let pkgName = speech.replace('@mastra/speech-', '');
161
- // const speechPath = path.join(process.cwd(), 'speech', pkgName);
162
- // speechToBuild.add(speechPath);
163
- // });
164
- // }
165
- // const pkgSet = Array.from(packagesToBuild.keys());
166
- // const deploySet = Array.from(deployersToBuild.keys());
167
- // const integrationSet = Array.from(integrationsToBuild.keys());
168
- // const vectorStoreSet = Array.from(vector_storesToBuild.keys());
169
- // const storeSet = Array.from(storesToBuild.keys());
170
- // const combinedStoreSet = Array.from(combined_storesToBuild.keys());
171
- // const speechSet = Array.from(speechToBuild.keys());
172
- // if (
173
- // !packagesToBuild.size &&
174
- // !deployersToBuild.size &&
175
- // !integrationsToBuild.size &&
176
- // !vector_storesToBuild.size &&
177
- // !storesToBuild.size &&
178
- // !combined_storesToBuild.size
179
- // ) {
180
- // console.error(chalk.red('No packages to build.'));
181
- // return defaultSet;
182
- // }
183
- // console.log(chalk.green(`\nBuilding packages:\n`));
184
- // pkgSet.forEach((pkg: string) => {
185
- // console.log(chalk.green(pkg));
186
- // });
187
- // if (deploySet.length > 0) {
188
- // console.log(chalk.green(`\nBuilding deployers:\n`));
189
- // deploySet.forEach((pkg: string) => {
190
- // console.log(chalk.green(pkg));
191
- // });
192
- // }
193
- // if (integrationSet.length > 0) {
194
- // console.log(chalk.green(`\nBuilding integrations:\n`));
195
- // integrationSet.forEach((pkg: string) => {
196
- // console.log(chalk.green(pkg));
197
- // });
198
- // }
199
- // if (vectorStoreSet.length > 0) {
200
- // console.log(chalk.green(`\nBuilding vector stores:\n`));
201
- // vectorStoreSet.forEach((pkg: string) => {
202
- // console.log(chalk.green(pkg));
203
- // });
204
- // }
205
- // if (storeSet.length > 0) {
206
- // console.log(chalk.green(`\nBuilding storage packages:\n`));
207
- // storeSet.forEach((pkg: string) => {
208
- // console.log(chalk.green(pkg));
209
- // });
210
- // }
211
- // if (combinedStoreSet.length > 0) {
212
- // console.log(chalk.green(`\nBuilding store packages:\n`));
213
- // combinedStoreSet.forEach((pkg: string) => {
214
- // console.log(chalk.green(pkg));
215
- // });
216
- // }
217
- // if (speechSet.length > 0) {
218
- // console.log(chalk.green(`\nBuilding speech:\n`));
219
- // speechSet.forEach((pkg: string) => {
220
- // console.log(chalk.green(pkg));
221
- // });
222
- // }
223
- // return {
224
- // packages: pkgSet!,
225
- // deployers: deploySet!,
226
- // integrations: integrationSet!,
227
- // vector_stores: vectorStoreSet!,
228
- // stores: storeSet!,
229
- // combined_stores: combinedStoreSet!,
230
- // speech: speechSet!,
231
- // };
232
- // },
233
- // });
234
- const buildAllPackages = new Step({
235
- id: 'buildPackages',
236
- execute: async () => {
237
- console.log(chalk.green('Building all packages'));
238
- await execa('pnpm', ['run', 'build'], {
239
- stdio: 'inherit',
240
- reject: false,
241
- cwd: process.cwd(),
242
- });
243
- },
244
- });
245
- const publishAllPackages = new Step({
246
- id: 'publishPackages',
247
- execute: async () => {
248
- console.log(chalk.green('Publishing all packages'));
249
- await execa('pnpm', ['changeset', 'publish'], {
250
- stdio: 'inherit',
251
- reject: false,
252
- cwd: process.cwd(),
253
- });
254
- },
255
- });
256
- const setAllDistTags = new Step({
257
- id: 'setAllDistTags',
258
- execute: async () => {
259
- console.log(chalk.green('Setting dist tags for all packages'));
260
- // Get all package.json files from relevant directories
261
- const packageDirs = ['packages', 'deployers', 'storage', 'vector-stores', 'stores', 'integrations', 'speech'];
262
- const packages = [];
263
- for (const dir of packageDirs) {
264
- const dirPath = path.join(process.cwd(), dir);
265
- if (!existsSync(dirPath))
266
- continue;
267
- const { stdout } = await execa('find', [dirPath, '-name', 'package.json'], {
268
- reject: false,
269
- });
270
- const packagePaths = stdout.split('\n').filter(Boolean);
271
- for (const packagePath of packagePaths) {
272
- const pkgJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
273
- if (pkgJson.name && pkgJson.version) {
274
- packages.push({
275
- name: pkgJson.name,
276
- version: pkgJson.version,
277
- path: path.dirname(packagePath),
278
- });
279
- }
280
- }
281
- }
282
- console.log(packages);
283
- // Set dist tags for each package
284
- for (const pkg of packages) {
285
- console.log(chalk.blue(`Setting dist tag for ${pkg.name}@${pkg.version}`));
286
- try {
287
- await execa('npm', ['dist-tag', 'add', `${pkg.name}@${pkg.version}`, 'latest'], {
288
- stdio: 'inherit',
289
- cwd: pkg.path,
290
- reject: false,
291
- });
292
- }
293
- catch (error) {
294
- console.error(chalk.red(`Failed to set dist tag for ${pkg.name}: ${error.message}`));
295
- }
296
- }
297
- },
298
- });
299
- packagePublisher.step(buildAllPackages).then(publishAllPackages).then(setAllDistTags).commit();
@@ -1,3 +0,0 @@
1
- import { Workflow } from '@mastra/core/workflows';
2
- export declare const telephoneGameWorkflow: Workflow<any, any>;
3
- //# sourceMappingURL=telephone-game.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"telephone-game.d.ts","sourceRoot":"","sources":["../../../src/mastra/workflows/telephone-game.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAiB,MAAM,wBAAwB,CAAC;AAGvE,eAAO,MAAM,qBAAqB,oBAEhC,CAAC"}