@mastra/dane 0.0.4 → 0.0.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/dist/commands/changelog.d.ts +0 -2
- package/dist/commands/changelog.d.ts.map +0 -1
- package/dist/commands/changelog.js +0 -15
- package/dist/commands/commit-message.d.ts +0 -2
- package/dist/commands/commit-message.d.ts.map +0 -1
- package/dist/commands/commit-message.js +0 -32
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -40
- package/dist/commands/issue-labeler.d.ts +0 -2
- package/dist/commands/issue-labeler.d.ts.map +0 -1
- package/dist/commands/issue-labeler.js +0 -35
- package/dist/commands/link-checker.d.ts +0 -4
- package/dist/commands/link-checker.d.ts.map +0 -1
- package/dist/commands/link-checker.js +0 -16
- package/dist/commands/message.d.ts +0 -2
- package/dist/commands/message.d.ts.map +0 -1
- package/dist/commands/message.js +0 -14
- package/dist/commands/new-contributor-message.d.ts +0 -2
- package/dist/commands/new-contributor-message.d.ts.map +0 -1
- package/dist/commands/new-contributor-message.js +0 -43
- package/dist/commands/publish-packages.d.ts +0 -2
- package/dist/commands/publish-packages.d.ts.map +0 -1
- package/dist/commands/publish-packages.js +0 -11
- package/dist/commands/telephone-game.d.ts +0 -2
- package/dist/commands/telephone-game.d.ts.map +0 -1
- package/dist/commands/telephone-game.js +0 -30
- package/dist/config/index.d.ts +0 -12
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -75
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -37
- package/dist/mastra/agents/index.d.ts +0 -165
- package/dist/mastra/agents/index.d.ts.map +0 -1
- package/dist/mastra/agents/index.js +0 -111
- package/dist/mastra/agents/memory.d.ts +0 -3
- package/dist/mastra/agents/memory.d.ts.map +0 -1
- package/dist/mastra/agents/memory.js +0 -10
- package/dist/mastra/agents/model.d.ts +0 -2
- package/dist/mastra/agents/model.d.ts.map +0 -1
- package/dist/mastra/agents/model.js +0 -8
- package/dist/mastra/agents/new-contributor.d.ts +0 -3
- package/dist/mastra/agents/new-contributor.d.ts.map +0 -1
- package/dist/mastra/agents/new-contributor.js +0 -14
- package/dist/mastra/agents/package-publisher.d.ts +0 -65
- package/dist/mastra/agents/package-publisher.d.ts.map +0 -1
- package/dist/mastra/agents/package-publisher.js +0 -170
- package/dist/mastra/index.d.ts +0 -291
- package/dist/mastra/index.d.ts.map +0 -1
- package/dist/mastra/index.js +0 -37
- package/dist/mastra/integrations/index.d.ts +0 -5
- package/dist/mastra/integrations/index.d.ts.map +0 -1
- package/dist/mastra/integrations/index.js +0 -23
- package/dist/mastra/tools/browser.d.ts +0 -40
- package/dist/mastra/tools/browser.d.ts.map +0 -1
- package/dist/mastra/tools/browser.js +0 -116
- package/dist/mastra/tools/calendar.d.ts +0 -21
- package/dist/mastra/tools/calendar.d.ts.map +0 -1
- package/dist/mastra/tools/calendar.js +0 -134
- package/dist/mastra/tools/crawl.d.ts +0 -36
- package/dist/mastra/tools/crawl.d.ts.map +0 -1
- package/dist/mastra/tools/crawl.js +0 -27
- package/dist/mastra/tools/execa.d.ts +0 -27
- package/dist/mastra/tools/execa.d.ts.map +0 -1
- package/dist/mastra/tools/execa.js +0 -43
- package/dist/mastra/tools/fs.d.ts +0 -33
- package/dist/mastra/tools/fs.d.ts.map +0 -1
- package/dist/mastra/tools/fs.js +0 -36
- package/dist/mastra/tools/image.d.ts +0 -27
- package/dist/mastra/tools/image.d.ts.map +0 -1
- package/dist/mastra/tools/image.js +0 -37
- package/dist/mastra/tools/mcp.d.ts +0 -3
- package/dist/mastra/tools/mcp.d.ts.map +0 -1
- package/dist/mastra/tools/mcp.js +0 -12
- package/dist/mastra/tools/pdf.d.ts +0 -21
- package/dist/mastra/tools/pdf.d.ts.map +0 -1
- package/dist/mastra/tools/pdf.js +0 -42
- package/dist/mastra/tools/pnpm.d.ts +0 -60
- package/dist/mastra/tools/pnpm.d.ts.map +0 -1
- package/dist/mastra/tools/pnpm.js +0 -127
- package/dist/mastra/workflows/changelog.d.ts +0 -10
- package/dist/mastra/workflows/changelog.d.ts.map +0 -1
- package/dist/mastra/workflows/changelog.js +0 -239
- package/dist/mastra/workflows/chat.d.ts +0 -13
- package/dist/mastra/workflows/chat.d.ts.map +0 -1
- package/dist/mastra/workflows/chat.js +0 -90
- package/dist/mastra/workflows/commit-message.d.ts +0 -10
- package/dist/mastra/workflows/commit-message.d.ts.map +0 -1
- package/dist/mastra/workflows/commit-message.js +0 -141
- package/dist/mastra/workflows/first-contributor.d.ts +0 -16
- package/dist/mastra/workflows/first-contributor.d.ts.map +0 -1
- package/dist/mastra/workflows/first-contributor.js +0 -124
- package/dist/mastra/workflows/index.d.ts +0 -4
- package/dist/mastra/workflows/index.d.ts.map +0 -1
- package/dist/mastra/workflows/index.js +0 -3
- package/dist/mastra/workflows/issue-labeler.d.ts +0 -16
- package/dist/mastra/workflows/issue-labeler.d.ts.map +0 -1
- package/dist/mastra/workflows/issue-labeler.js +0 -85
- package/dist/mastra/workflows/link-checker.d.ts +0 -13
- package/dist/mastra/workflows/link-checker.d.ts.map +0 -1
- package/dist/mastra/workflows/link-checker.js +0 -102
- package/dist/mastra/workflows/publish-packages.d.ts +0 -3
- package/dist/mastra/workflows/publish-packages.d.ts.map +0 -1
- package/dist/mastra/workflows/publish-packages.js +0 -252
- package/dist/mastra/workflows/telephone-game.d.ts +0 -3
- package/dist/mastra/workflows/telephone-game.d.ts.map +0 -1
- package/dist/mastra/workflows/telephone-game.js +0 -97
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/dane",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5-alpha.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@types/node": "^22.10.2",
|
|
21
21
|
"@types/pdf-parse": "^1.1.4",
|
|
22
22
|
"tsx": "^4.19.2",
|
|
23
|
-
"mastra": "0.2.
|
|
23
|
+
"mastra": "0.2.9-alpha.1"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@ai-sdk/anthropic": "^1.1.6",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"sqlite3": "^5.1.7",
|
|
43
43
|
"typescript": "^5.7.3",
|
|
44
44
|
"zod": "^3.24.0",
|
|
45
|
-
"@mastra/core": "0.
|
|
46
|
-
"@mastra/
|
|
47
|
-
"@mastra/
|
|
48
|
-
"@mastra/
|
|
49
|
-
"@mastra/
|
|
50
|
-
"@mastra/
|
|
51
|
-
"@mastra/
|
|
45
|
+
"@mastra/core": "0.5.0-alpha.1",
|
|
46
|
+
"@mastra/github": "1.1.8-alpha.1",
|
|
47
|
+
"@mastra/mcp": "0.2.7-alpha.1",
|
|
48
|
+
"@mastra/memory": "0.2.0-alpha.1",
|
|
49
|
+
"@mastra/stabilityai": "1.1.8-alpha.1",
|
|
50
|
+
"@mastra/upstash": "0.1.8-alpha.1",
|
|
51
|
+
"@mastra/rag": "0.1.8-alpha.1"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "npx tsc",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/commands/changelog.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,kBAiB9B"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { mastra } from '../mastra/index.js';
|
|
3
|
-
export async function changelog() {
|
|
4
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
5
|
-
console.log(chalk.green('Lets make the changelog..\n'));
|
|
6
|
-
const workflow = mastra.getWorkflow('changelog');
|
|
7
|
-
const { start } = workflow.createRun();
|
|
8
|
-
const res = await start({
|
|
9
|
-
triggerData: {
|
|
10
|
-
channelId: process.env.CHANNEL_ID,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
console.log(res);
|
|
14
|
-
process.exit(0);
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commit-message.d.ts","sourceRoot":"","sources":["../../src/commands/commit-message.ts"],"names":[],"mappings":"AAKA,wBAAsB,oBAAoB,kBAkCzC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { execSync } from 'child_process';
|
|
3
|
-
import { mastra } from '../mastra/index.js';
|
|
4
|
-
export async function commitMessageCommand() {
|
|
5
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
6
|
-
console.log(chalk.green('Let me generate a commit message for you..\n'));
|
|
7
|
-
try {
|
|
8
|
-
const workflow = mastra.getWorkflow('commitMessage');
|
|
9
|
-
if (!workflow) {
|
|
10
|
-
console.error(chalk.red('Commit message workflow not found. Make sure it is properly set up.'));
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
// Get the current path
|
|
14
|
-
const currentPath = execSync('pwd', { encoding: 'utf-8' }).trim();
|
|
15
|
-
const { start } = workflow.createRun();
|
|
16
|
-
const result = await start({
|
|
17
|
-
triggerData: {
|
|
18
|
-
repoPath: currentPath,
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
const errorMessage = Object.values(result.results).find(result => result.status === 'failed')?.error;
|
|
22
|
-
if (result.results?.commit?.status !== 'success') {
|
|
23
|
-
console.error(chalk.red(`\n${errorMessage}`));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
console.log(chalk.green('\nCommit message generated and committed successfully'));
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
console.error(chalk.red('Error:', error?.message || 'An unknown error occurred'));
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,aAAa,SAiCtB,CAAC"}
|
package/dist/commands/config.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { ConfigManager } from '../config/index.js';
|
|
3
|
-
export const configCommand = new Command('config')
|
|
4
|
-
.description('Manage Dane configuration')
|
|
5
|
-
.option('--set <key=value>', 'Set a configuration value')
|
|
6
|
-
.option('--get <key>', 'Get a configuration value')
|
|
7
|
-
.option('--list', 'List all configuration values')
|
|
8
|
-
.option('--del <key>', 'Delete a configuration value')
|
|
9
|
-
.action(options => {
|
|
10
|
-
const configManager = new ConfigManager();
|
|
11
|
-
if (options.set) {
|
|
12
|
-
const [key, value] = options.set.split('=');
|
|
13
|
-
if (!key || !value) {
|
|
14
|
-
console.error('Invalid format. Use --set KEY=VALUE');
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
configManager.set(key, value);
|
|
18
|
-
console.log(`Set ${key} successfully`);
|
|
19
|
-
}
|
|
20
|
-
else if (options.get) {
|
|
21
|
-
const value = configManager.get(options.get);
|
|
22
|
-
if (value === undefined) {
|
|
23
|
-
console.log(`No value set for ${options.get}`);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
console.log(value);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
else if (options.del) {
|
|
30
|
-
configManager.delete(options.del);
|
|
31
|
-
console.log(`Deleted ${options.del} successfully`);
|
|
32
|
-
}
|
|
33
|
-
else if (options.list) {
|
|
34
|
-
const config = configManager.list();
|
|
35
|
-
console.log(JSON.stringify(config, null, 2));
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
console.log('No action specified. Use --help to see available options.');
|
|
39
|
-
}
|
|
40
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"issue-labeler.d.ts","sourceRoot":"","sources":["../../src/commands/issue-labeler.ts"],"names":[],"mappings":"AAIA,wBAAsB,mBAAmB,kBA8BxC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { mastra } from '../mastra/index.js';
|
|
3
|
-
export async function issueLabelerCommand() {
|
|
4
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
5
|
-
console.log(chalk.green('Let me label this for you..\n'));
|
|
6
|
-
const { start } = mastra.getWorkflow('githubIssueLabeler').createRun();
|
|
7
|
-
const result = await start({
|
|
8
|
-
triggerData: {
|
|
9
|
-
issue_number: parseInt(process.env.ISSUE_NUMBER, 10),
|
|
10
|
-
owner: process.env.OWNER,
|
|
11
|
-
repo: normalizeRepo(process.env.REPO),
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
if (result.results?.labelIssue?.status === 'failed') {
|
|
15
|
-
console.error(chalk.red(`Error applying labels for issue: ${result.triggerData?.issue_number}`));
|
|
16
|
-
console.error({ error: result.results?.labelIssue?.error });
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (result.results?.labelIssue?.status !== 'success') {
|
|
20
|
-
console.error(chalk.red(`Failed to apply labels for issue: ${result.triggerData?.issue_number}`));
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
console.log(chalk.green(`Issue: ${result.triggerData?.issue_number} has been labeled with: ${result.results?.labelIssue?.output?.labels.join(', ')}`));
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Extracts the repo name from owner/repo format provided by github
|
|
27
|
-
* @param repo - The repo name to normalize
|
|
28
|
-
* @returns The normalized repo name
|
|
29
|
-
*/
|
|
30
|
-
function normalizeRepo(repo) {
|
|
31
|
-
if (repo.includes('/')) {
|
|
32
|
-
return repo.split('/')[1] || repo;
|
|
33
|
-
}
|
|
34
|
-
return repo;
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-checker.d.ts","sourceRoot":"","sources":["../../src/commands/link-checker.ts"],"names":[],"mappings":"AAIA,wBAAsB,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,iBAiBzD"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { mastra } from '../mastra/index.js';
|
|
3
|
-
export async function linkChecker({ url }) {
|
|
4
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
5
|
-
console.log(chalk.green('Lets check the links...\n'));
|
|
6
|
-
const workflow = mastra.getWorkflow('linkChecker');
|
|
7
|
-
const { start } = workflow.createRun();
|
|
8
|
-
const res = await start({
|
|
9
|
-
triggerData: {
|
|
10
|
-
channelId: process.env.LINK_CHECKER_CHANNEL_ID,
|
|
11
|
-
targetUrl: url,
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
console.log(res);
|
|
15
|
-
process.exit(0);
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/commands/message.ts"],"names":[],"mappings":"AAIA,wBAAsB,OAAO,kBAgB5B"}
|
package/dist/commands/message.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { mastra } from '../mastra/index.js';
|
|
3
|
-
export async function message() {
|
|
4
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
5
|
-
console.log(chalk.green('What would you like to do today?\n'));
|
|
6
|
-
const { runId, start } = mastra.getWorkflow('message').createRun();
|
|
7
|
-
console.log(runId);
|
|
8
|
-
console.log(await start({
|
|
9
|
-
triggerData: {
|
|
10
|
-
resourceId: 'f8b5c3a1-d6e7-4f9c-b2a3-1d8e4c7f9b5a',
|
|
11
|
-
threadId: '2d9e8c7f-6b5a-4d3c-8f1e-9b7d5c3a2e8h',
|
|
12
|
-
},
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-contributor-message.d.ts","sourceRoot":"","sources":["../../src/commands/new-contributor-message.ts"],"names":[],"mappings":"AAIA,wBAAsB,qBAAqB,kBAkC1C"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { mastra } from '../mastra/index.js';
|
|
3
|
-
export async function newContributorMessage() {
|
|
4
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
5
|
-
console.log(chalk.green('Let me create a welcoming message..\n'));
|
|
6
|
-
try {
|
|
7
|
-
const workflow = mastra.getWorkflow('githubFirstContributorMessage');
|
|
8
|
-
if (!workflow) {
|
|
9
|
-
console.error(chalk.red('First contributor workflow not found. Make sure it is properly set up.'));
|
|
10
|
-
process.exit(1);
|
|
11
|
-
}
|
|
12
|
-
const { start } = workflow.createRun();
|
|
13
|
-
const result = await start({
|
|
14
|
-
triggerData: {
|
|
15
|
-
pr_number: parseInt(process.env.PR_NUMBER, 10),
|
|
16
|
-
owner: process.env.OWNER,
|
|
17
|
-
repo: normalizeRepo(process.env.REPO),
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
console.log(result);
|
|
21
|
-
const errorMessage = Object.values(result.results).find(result => result.status === 'failed')?.error;
|
|
22
|
-
if (result.results?.commit?.status !== 'success') {
|
|
23
|
-
console.error(chalk.red(`\n${errorMessage}`));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
console.log(chalk.green('\New contributor message generated and published successfully'));
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
console.error(chalk.red('Error:', error?.message || 'An unknown error occurred'));
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Extracts the repo name from owner/repo format provided by github
|
|
35
|
-
* @param repo - The repo name to normalize
|
|
36
|
-
* @returns The normalized repo name
|
|
37
|
-
*/
|
|
38
|
-
function normalizeRepo(repo) {
|
|
39
|
-
if (repo.includes('/')) {
|
|
40
|
-
return repo.split('/')[1] || repo;
|
|
41
|
-
}
|
|
42
|
-
return repo;
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish-packages.d.ts","sourceRoot":"","sources":["../../src/commands/publish-packages.ts"],"names":[],"mappings":"AAIA,wBAAsB,eAAe,kBAapC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { mastra } from '../mastra/index.js';
|
|
3
|
-
export async function publishPackages() {
|
|
4
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
5
|
-
console.log(chalk.green('Let me publish your packages..\n'));
|
|
6
|
-
const workflow = mastra.getWorkflow('packagePublisher');
|
|
7
|
-
const { start } = workflow.createRun();
|
|
8
|
-
const result = await start();
|
|
9
|
-
console.log(result);
|
|
10
|
-
process.exit(0);
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telephone-game.d.ts","sourceRoot":"","sources":["../../src/commands/telephone-game.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,kBA6B9B"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { confirm } from '@inquirer/prompts';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { mastra } from '../mastra/index.js';
|
|
4
|
-
export async function telephone() {
|
|
5
|
-
console.log(chalk.green("Hi! I'm Dane!"));
|
|
6
|
-
console.log(chalk.green('Lets play telephone..\n'));
|
|
7
|
-
const workflow = mastra.getWorkflow('telephoneGame');
|
|
8
|
-
const { runId, start } = workflow.createRun();
|
|
9
|
-
workflow.watch(async ({ activePaths, context }) => {
|
|
10
|
-
for (const path of activePaths) {
|
|
11
|
-
const ctx = context.steps?.[path.stepId]?.status;
|
|
12
|
-
if (ctx === 'suspended') {
|
|
13
|
-
// Handle suspension
|
|
14
|
-
if (path.stepId === 'stepC2' && ctx === 'suspended') {
|
|
15
|
-
const confirmed = await confirm({ message: 'Do you want to change the message?' });
|
|
16
|
-
if (confirmed) {
|
|
17
|
-
await workflow.resume({
|
|
18
|
-
stepId: path.stepId,
|
|
19
|
-
runId,
|
|
20
|
-
context: {
|
|
21
|
-
confirm: true,
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
await start();
|
|
30
|
-
}
|
package/dist/config/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class ConfigManager {
|
|
2
|
-
private configPath;
|
|
3
|
-
constructor();
|
|
4
|
-
private ensureConfigExists;
|
|
5
|
-
get(key: string): string | undefined;
|
|
6
|
-
set(key: string, value: string): void;
|
|
7
|
-
delete(key: string): void;
|
|
8
|
-
list(): Record<string, string>;
|
|
9
|
-
getAnthropicApiKey(): string;
|
|
10
|
-
}
|
|
11
|
-
export declare const config: ConfigManager;
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAS;;IAS3B,OAAO,CAAC,kBAAkB;IAUnB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IASpC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAUrC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAYzB,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQ9B,kBAAkB,IAAI,MAAM;CAiBpC;AAGD,eAAO,MAAM,MAAM,eAAsB,CAAC"}
|
package/dist/config/index.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as os from 'os';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
export class ConfigManager {
|
|
5
|
-
constructor() {
|
|
6
|
-
const homeDir = os.homedir();
|
|
7
|
-
const configDir = path.join(homeDir, '.dane');
|
|
8
|
-
this.configPath = path.join(configDir, 'config.json');
|
|
9
|
-
this.ensureConfigExists();
|
|
10
|
-
}
|
|
11
|
-
ensureConfigExists() {
|
|
12
|
-
const configDir = path.dirname(this.configPath);
|
|
13
|
-
if (!fs.existsSync(configDir)) {
|
|
14
|
-
fs.mkdirSync(configDir, { recursive: true });
|
|
15
|
-
}
|
|
16
|
-
if (!fs.existsSync(this.configPath)) {
|
|
17
|
-
fs.writeFileSync(this.configPath, JSON.stringify({}, null, 2));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
get(key) {
|
|
21
|
-
try {
|
|
22
|
-
const config = JSON.parse(fs.readFileSync(this.configPath, 'utf-8'));
|
|
23
|
-
return config[key];
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
set(key, value) {
|
|
30
|
-
try {
|
|
31
|
-
const config = fs.existsSync(this.configPath) ? JSON.parse(fs.readFileSync(this.configPath, 'utf-8')) : {};
|
|
32
|
-
config[key] = value;
|
|
33
|
-
fs.writeFileSync(this.configPath, JSON.stringify(config, null, 2));
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
throw new Error(`Failed to set config value: ${error}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
delete(key) {
|
|
40
|
-
try {
|
|
41
|
-
const config = fs.existsSync(this.configPath) ? JSON.parse(fs.readFileSync(this.configPath, 'utf-8')) : {};
|
|
42
|
-
if (key in config) {
|
|
43
|
-
delete config[key];
|
|
44
|
-
fs.writeFileSync(this.configPath, JSON.stringify(config, null, 2));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
throw new Error(`Failed to delete config value: ${error}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
list() {
|
|
52
|
-
try {
|
|
53
|
-
return JSON.parse(fs.readFileSync(this.configPath, 'utf-8'));
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return {};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
getAnthropicApiKey() {
|
|
60
|
-
const key = this.get('ANTHROPIC_API_KEY') || process.env.ANTHROPIC_API_KEY;
|
|
61
|
-
if (!key) {
|
|
62
|
-
// Check if we're in a command that requires the API key
|
|
63
|
-
const command = process.argv[2] || '';
|
|
64
|
-
const configCommands = ['config', '--help', '-h'];
|
|
65
|
-
// Only throw if we're not in a config-related command
|
|
66
|
-
if (!configCommands.includes(command)) {
|
|
67
|
-
throw new Error('ANTHROPIC_API_KEY not found in config. Please set it using: dane config --set ANTHROPIC_API_KEY=your_key_here');
|
|
68
|
-
}
|
|
69
|
-
return '';
|
|
70
|
-
}
|
|
71
|
-
return key;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Create a singleton instance for easy access
|
|
75
|
-
export const config = new ConfigManager();
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#! /usr/bin/env node
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
import { changelog } from './commands/changelog.js';
|
|
5
|
-
import { commitMessageCommand } from './commands/commit-message.js';
|
|
6
|
-
import { configCommand } from './commands/config.js';
|
|
7
|
-
import { issueLabelerCommand } from './commands/issue-labeler.js';
|
|
8
|
-
import { linkChecker } from './commands/link-checker.js';
|
|
9
|
-
import { message } from './commands/message.js';
|
|
10
|
-
import { newContributorMessage } from './commands/new-contributor-message.js';
|
|
11
|
-
import { publishPackages } from './commands/publish-packages.js';
|
|
12
|
-
import { telephone } from './commands/telephone-game.js';
|
|
13
|
-
dotenv.config();
|
|
14
|
-
process.env.NODE_NO_WARNINGS = '1';
|
|
15
|
-
const program = new Command();
|
|
16
|
-
program.command('chat').action(message);
|
|
17
|
-
program
|
|
18
|
-
.command('issue-labeler')
|
|
19
|
-
.description('Automatically label GitHub issues based on their content and context')
|
|
20
|
-
.action(issueLabelerCommand);
|
|
21
|
-
program
|
|
22
|
-
.command('commit')
|
|
23
|
-
.description('Create a sensible commit message based on the changes made')
|
|
24
|
-
.action(commitMessageCommand);
|
|
25
|
-
program.addCommand(configCommand);
|
|
26
|
-
program.command('publish').description('Publish packages to the registry').action(publishPackages);
|
|
27
|
-
program.command('telephone-game').description('Play a classic game of telephone').action(telephone);
|
|
28
|
-
program.command('changelog').description('Mastra Changelog').action(changelog);
|
|
29
|
-
program.command('new-contributor').description('Create a new contributor message').action(newContributorMessage);
|
|
30
|
-
program
|
|
31
|
-
.command('link-checker')
|
|
32
|
-
.description('Check for broken links')
|
|
33
|
-
.option('-u, --url <url>', 'URL to check')
|
|
34
|
-
.action(args => {
|
|
35
|
-
linkChecker({ url: args.url });
|
|
36
|
-
});
|
|
37
|
-
program.parse(process.argv);
|