From ba3620da3e3405d60fc6720ecaf925c501b71de6 Mon Sep 17 00:00:00 2001 From: xm0onh Date: Thu, 16 Jan 2025 12:31:50 -0800 Subject: [PATCH 01/10] reading the existing chars --- src/utils/characterLoader.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/utils/characterLoader.ts diff --git a/src/utils/characterLoader.ts b/src/utils/characterLoader.ts new file mode 100644 index 00000000..0ee1d5fe --- /dev/null +++ b/src/utils/characterLoader.ts @@ -0,0 +1,31 @@ +import { readdir } from 'fs/promises'; +import { join } from 'path'; +import { loadCharacter } from '../config/characters.js'; + +export interface CharacterInfo { + id: string; + name: string; + description: string; + username: string; +} + +export async function listAvailableCharacters(): Promise { + const charactersPath = join(process.cwd(), 'config', 'characters'); + const files = await readdir(charactersPath); + const characterFiles = files.filter(file => file.endsWith('.yaml')); + + const characters = await Promise.all( + characterFiles.map(async file => { + const id = file.replace(/\.yaml$/, ''); + const character = loadCharacter(id); + return { + id, + name: character.name, + description: character.description, + username: character.username + }; + }) + ); + + return characters; +} \ No newline at end of file From 592c312eb43801795ad107619313aa3881d788ef Mon Sep 17 00:00:00 2001 From: Carlos Lostao Date: Thu, 16 Jan 2025 22:59:25 +0100 Subject: [PATCH 02/10] fix: some doc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52e0e045..77098004 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ The framework uses a YAML-based character system that allows you to create and r 2. Create new characters by copying the example: ```bash # Create a new character - cp config/characters/joy_builder.yaml config/characters/my-character.yaml + cp config/characters/character.example.yaml config/characters/my-character.yaml ``` ### Character Configuration From 52a4f39728c814f7812ee65f4de7380eae57c26a Mon Sep 17 00:00:00 2001 From: Jeremy Frank <37932802+jfrank-summit@users.noreply.github.com> Date: Thu, 16 Jan 2025 15:02:50 -0700 Subject: [PATCH 03/10] fix auto_drive typo in config.example.yaml --- config/config.example.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.example.yaml b/config/config.example.yaml index 164b8027..32a6c160 100644 --- a/config/config.example.yaml +++ b/config/config.example.yaml @@ -10,7 +10,7 @@ twitter: POST_INTERVAL_MINUTES: 90 POST_TWEETS: false -autodrive: +auto_drive: upload: false llm: From f40832822631682af26a9ac88c890d88fd8b016f Mon Sep 17 00:00:00 2001 From: Jeremy Frank Date: Thu, 16 Jan 2025 17:37:58 -0500 Subject: [PATCH 04/10] remove optional chaining operator from auto_drive.upload --- src/config/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/index.ts b/src/config/index.ts index 9073938d..7ba5ab26 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -78,7 +78,7 @@ export const config = (() => { autoDriveConfig: { AUTO_DRIVE_API_KEY: process.env.AUTO_DRIVE_API_KEY, AUTO_DRIVE_ENCRYPTION_PASSWORD: process.env.AUTO_DRIVE_ENCRYPTION_PASSWORD, - AUTO_DRIVE_UPLOAD: yamlConfig.auto_drive?.upload ?? false, + AUTO_DRIVE_UPLOAD: yamlConfig.auto_drive.upload ?? false, }, blockchainConfig: { RPC_URL: process.env.RPC_URL || undefined, From 3bbbf94e92bd09fd6b98793b232cf23a34f12bda Mon Sep 17 00:00:00 2001 From: xm0onh Date: Fri, 17 Jan 2025 14:39:19 -0800 Subject: [PATCH 05/10] Fix the cli error --- package.json | 6 +- src/index.ts | 65 ++++++++++- yarn.lock | 312 ++++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 348 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index e2b5f244..2a1b359c 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "auto-agents-framework", - "version": "0.0.1", + "version": "0.1.0", "description": "Auto Agents Framework", "main": "dist/index.js", "type": "module", "scripts": { "build": "tsc && yarn copy-characters", "start": "yarn build && node dist/index.js", - "dev": "tsx watch src/index.ts", + "dev": "NODE_ENV=development tsx --no-cache --watch src/index.ts", "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"", "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"", "example:twitter": "tsx examples/twitter.ts", @@ -33,6 +33,7 @@ "agent-twitter-client": "0.0.18", "dotenv": "^16.3.1", "ethers": "^6.13.4", + "inquirer": "^10.2.0", "winston": "^3.11.0", "zod": "^3.22.4", "zod-to-json-schema": "^3.24.1" @@ -40,6 +41,7 @@ "devDependencies": { "@eslint/js": "^9.18.0", "@tsconfig/node20": "^20.1.4", + "@types/inquirer": "^9.0.7", "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.9", "@types/node": "22.10.0", diff --git a/src/index.ts b/src/index.ts index f60782e6..00dd01be 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,61 @@ import { config } from './config/index.js'; import { createLogger } from './utils/logger.js'; import { runWorkflow } from './agents/workflows/kol/workflow.js'; +import inquirer from 'inquirer'; const logger = createLogger('app'); +// Add process ID and timestamp to track instances +const instanceId = `${process.pid}-${Date.now()}`; +logger.info(`Process instance started: ${instanceId}`); + +interface UserAnswers { + name: string; + projectType: string; + features: string[]; +} + +const onboarding = async () => { + const answers: UserAnswers = await inquirer.prompt([ + { + type: 'input', + name: 'name', + message: 'What is your project name?', + default: 'my-awesome-project' + }, + { + type: 'list', + name: 'projectType', + message: 'What type of project do you want to create?', + choices: [ + 'Frontend (React)', + 'Backend (Node.js)', + 'Full Stack', + 'Library' + ] + }, + { + type: 'checkbox', + name: 'features', + message: 'Select additional features:', + choices: [ + 'TypeScript Configuration', + 'ESLint', + 'Prettier', + 'Jest Testing', + 'GitHub Actions', + 'Docker Setup' + ] + } + ]); + + console.log('\nProject Configuration:'); + console.log('====================='); + console.log(`Project Name: ${answers.name}`); + console.log(`Project Type: ${answers.projectType}`); + console.log('Selected Features:', answers.features.join(', ')); +}; + // Get character name from command line args const characterId = process.argv[2]; if (!characterId) { @@ -25,13 +77,14 @@ const startWorkflowPolling = async () => { const main = async () => { try { - await startWorkflowPolling(); - setInterval(startWorkflowPolling, config.twitterConfig.RESPONSE_INTERVAL_MS); + await onboarding(); + // await startWorkflowPolling(); + // setInterval(startWorkflowPolling, config.twitterConfig.RESPONSE_INTERVAL_MS); - logger.info('Application started successfully', { - checkInterval: config.twitterConfig.RESPONSE_INTERVAL_MS / 1000 / 60, - username: config.twitterConfig.USERNAME, - }); + // logger.info('Application started successfully', { + // checkInterval: config.twitterConfig.RESPONSE_INTERVAL_MS / 1000 / 60, + // username: config.twitterConfig.USERNAME, + // }); } catch (error) { logger.error('Failed to start application:', error); process.exit(1); diff --git a/yarn.lock b/yarn.lock index 8b98445c..414661cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -547,6 +547,151 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.1.tgz#9a96ce501bc62df46c4031fbd970e3cc6b10f07b" integrity sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA== +"@inquirer/checkbox@^2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-2.5.0.tgz#41c5c9dd332c0a8fa159be23982ce080d0b199d4" + integrity sha512-sMgdETOfi2dUHT8r7TT1BTKOwNvdDGFDXYWtQ2J69SvlYNntk9I/gJe7r5yvMwwsuKnYbuRs3pNhx4tgNck5aA== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/figures" "^1.0.5" + "@inquirer/type" "^1.5.3" + ansi-escapes "^4.3.2" + yoctocolors-cjs "^2.1.2" + +"@inquirer/confirm@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-3.2.0.tgz#6af1284670ea7c7d95e3f1253684cfbd7228ad6a" + integrity sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/type" "^1.5.3" + +"@inquirer/core@^9.1.0": + version "9.2.1" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-9.2.1.tgz#677c49dee399c9063f31e0c93f0f37bddc67add1" + integrity sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg== + dependencies: + "@inquirer/figures" "^1.0.6" + "@inquirer/type" "^2.0.0" + "@types/mute-stream" "^0.0.4" + "@types/node" "^22.5.5" + "@types/wrap-ansi" "^3.0.0" + ansi-escapes "^4.3.2" + cli-width "^4.1.0" + mute-stream "^1.0.0" + signal-exit "^4.1.0" + strip-ansi "^6.0.1" + wrap-ansi "^6.2.0" + yoctocolors-cjs "^2.1.2" + +"@inquirer/editor@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-2.2.0.tgz#a41eb7b151bd9a6bc3c0b69219d02d82547bc387" + integrity sha512-9KHOpJ+dIL5SZli8lJ6xdaYLPPzB8xB9GZItg39MBybzhxA16vxmszmQFrRwbOA918WA2rvu8xhDEg/p6LXKbw== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/type" "^1.5.3" + external-editor "^3.1.0" + +"@inquirer/expand@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-2.3.0.tgz#afc44aee303315a85563e9d0275e658f0ee0e701" + integrity sha512-qnJsUcOGCSG1e5DTOErmv2BPQqrtT6uzqn1vI/aYGiPKq+FgslGZmtdnXbhuI7IlT7OByDoEEqdnhUnVR2hhLw== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/type" "^1.5.3" + yoctocolors-cjs "^2.1.2" + +"@inquirer/figures@^1.0.5", "@inquirer/figures@^1.0.6": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.9.tgz#9d8128f8274cde4ca009ca8547337cab3f37a4a3" + integrity sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ== + +"@inquirer/input@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-2.3.0.tgz#9b99022f53780fecc842908f3f319b52a5a16865" + integrity sha512-XfnpCStx2xgh1LIRqPXrTNEEByqQWoxsWYzNRSEUxJ5c6EQlhMogJ3vHKu8aXuTacebtaZzMAHwEL0kAflKOBw== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/type" "^1.5.3" + +"@inquirer/number@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@inquirer/number/-/number-1.1.0.tgz#4dac004021ea67c89552a261564f103a494cac96" + integrity sha512-ilUnia/GZUtfSZy3YEErXLJ2Sljo/mf9fiKc08n18DdwdmDbOzRcTv65H1jjDvlsAuvdFXf4Sa/aL7iw/NanVA== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/type" "^1.5.3" + +"@inquirer/password@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-2.2.0.tgz#0b6f26336c259c8a9e5f5a3f2e1a761564f764ba" + integrity sha512-5otqIpgsPYIshqhgtEwSspBQE40etouR8VIxzpJkv9i0dVHIpyhiivbkH9/dGiMLdyamT54YRdGJLfl8TFnLHg== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/type" "^1.5.3" + ansi-escapes "^4.3.2" + +"@inquirer/prompts@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-5.5.0.tgz#5805aa15a13180017829aa31d071fd37a43b735d" + integrity sha512-BHDeL0catgHdcHbSFFUddNzvx/imzJMft+tWDPwTm3hfu8/tApk1HrooNngB2Mb4qY+KaRWF+iZqoVUPeslEog== + dependencies: + "@inquirer/checkbox" "^2.5.0" + "@inquirer/confirm" "^3.2.0" + "@inquirer/editor" "^2.2.0" + "@inquirer/expand" "^2.3.0" + "@inquirer/input" "^2.3.0" + "@inquirer/number" "^1.1.0" + "@inquirer/password" "^2.2.0" + "@inquirer/rawlist" "^2.3.0" + "@inquirer/search" "^1.1.0" + "@inquirer/select" "^2.5.0" + +"@inquirer/rawlist@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-2.3.0.tgz#6b2c0da39c1cd855af5608b2d627681cdac7277d" + integrity sha512-zzfNuINhFF7OLAtGHfhwOW2TlYJyli7lOUoJUXw/uyklcwalV6WRXBXtFIicN8rTRK1XTiPWB4UY+YuW8dsnLQ== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/type" "^1.5.3" + yoctocolors-cjs "^2.1.2" + +"@inquirer/search@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@inquirer/search/-/search-1.1.0.tgz#665928cac2326b9501ddafbb8606ce4823b3106b" + integrity sha512-h+/5LSj51dx7hp5xOn4QFnUaKeARwUCLs6mIhtkJ0JYPBLmEYjdHSYh7I6GrLg9LwpJ3xeX0FZgAG1q0QdCpVQ== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/figures" "^1.0.5" + "@inquirer/type" "^1.5.3" + yoctocolors-cjs "^2.1.2" + +"@inquirer/select@^2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-2.5.0.tgz#345c6908ecfaeef3d84ddd2f9feb2f487c558efb" + integrity sha512-YmDobTItPP3WcEI86GvPo+T2sRHkxxOq/kXmsBjHS5BVXUgvgZ5AfJjkvQvZr03T81NnI3KrrRuMzeuYUQRFOA== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/figures" "^1.0.5" + "@inquirer/type" "^1.5.3" + ansi-escapes "^4.3.2" + yoctocolors-cjs "^2.1.2" + +"@inquirer/type@^1.5.3": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.5.5.tgz#303ea04ce7ad2e585b921b662b3be36ef7b4f09b" + integrity sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA== + dependencies: + mute-stream "^1.0.0" + +"@inquirer/type@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-2.0.0.tgz#08fa513dca2cb6264fe1b0a2fabade051444e3f6" + integrity sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag== + dependencies: + mute-stream "^1.0.0" + "@ipld/dag-pb@^4.1.2": version "4.1.3" resolved "https://registry.yarnpkg.com/@ipld/dag-pb/-/dag-pb-4.1.3.tgz#b572d7978fa548a3a9219f566a80884189261858" @@ -1178,6 +1323,14 @@ dependencies: "@types/node" "*" +"@types/inquirer@^9.0.7": + version "9.0.7" + resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-9.0.7.tgz#61bb8d0e42f038b9a1738b08fba7fa98ad9b4b24" + integrity sha512-Q0zyBupO6NxGRZut/JdmqYKOnN95Eg5V8Csg3PGKkP+FnvsUZx1jAyK7fztIszxxMuoBA6E3KXWvdZVXIpx60g== + dependencies: + "@types/through" "*" + rxjs "^7.2.0" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" @@ -1233,6 +1386,13 @@ resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd" integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg== +"@types/mute-stream@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478" + integrity sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow== + dependencies: + "@types/node" "*" + "@types/node-fetch@^2.6.4": version "2.6.12" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.12.tgz#8ab5c3ef8330f13100a7479e2cd56d3386830a03" @@ -1241,10 +1401,10 @@ "@types/node" "*" form-data "^4.0.0" -"@types/node@*", "@types/node@>=13.7.0": - version "22.10.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.6.tgz#5c6795e71635876039f853cbccd59f523d9e4239" - integrity sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ== +"@types/node@*", "@types/node@>=13.7.0", "@types/node@^22.5.5": + version "22.10.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.7.tgz#14a1ca33fd0ebdd9d63593ed8d3fbc882a6d28d7" + integrity sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg== dependencies: undici-types "~6.20.0" @@ -1263,9 +1423,9 @@ undici-types "~6.19.2" "@types/node@^18.11.18": - version "18.19.70" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.70.tgz#5a77508f5568d16fcd3b711c8102d7a430a04df7" - integrity sha512-RE+K0+KZoEpDUbGGctnGdkrLFwi1eYKTlIHNl2Um98mUkGsm1u2Ff6Ltd0e8DktTtC98uy7rSj+hO8t/QuLoVQ== + version "18.19.71" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.71.tgz#96d4f0a0be735ead6c8998c62a4b2c0012a5d09a" + integrity sha512-evXpcgtZm8FY4jqBSN8+DmOTcVkkvTmAayeo4Wf3m1xAruyVGzGuDh/Fb/WWX2yLItUiho42ozyJjB0dw//Tkw== dependencies: undici-types "~5.26.4" @@ -1286,6 +1446,13 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== +"@types/through@*": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.33.tgz#14ebf599320e1c7851e7d598149af183c6b9ea56" + integrity sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ== + dependencies: + "@types/node" "*" + "@types/triple-beam@^1.3.2": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c" @@ -1296,6 +1463,11 @@ resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== +"@types/wrap-ansi@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" + integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== + "@types/yargs-parser@*": version "21.0.3" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" @@ -1461,7 +1633,7 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-escapes@^4.2.1: +ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -1734,6 +1906,11 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + ci-info@^3.2.0: version "3.9.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" @@ -1744,6 +1921,11 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170" integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA== +cli-width@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5" + integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== + cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -1955,9 +2137,9 @@ ejs@^3.1.10: jake "^10.8.5" electron-to-chromium@^1.5.73: - version "1.5.82" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.82.tgz#b9116ac6d6b6346c2baa49f14c1272ba2ce1ccdb" - integrity sha512-Zq16uk1hfQhyGx5GpwPAYDwddJuSGhtRhgOA2mCxANYaDT79nAeGnaXogMGng4KqLaJUVnOnuL0+TDop9nLOiA== + version "1.5.83" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.83.tgz#3f74078f0c83e24bf7e692eaa855a998d1bec34f" + integrity sha512-LcUDPqSt+V0QmI47XLzZrz5OqILSMGsPFkDYus22rIbgorSvBYEFqq854ltTmUdHkY92FSdAAvsh4jWEULMdfQ== emittery@^0.13.1: version "0.13.1" @@ -2002,9 +2184,9 @@ es-errors@^1.3.0: integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-object-atoms@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.0.tgz#095de9ecceeb2ca79668212b60ead450ffd323bf" - integrity sha512-Ujz8Al/KfOVR7fkaghAB1WvnLsdYxHDWmfoi2vlA2jZWRg31XhIC1a4B+/I24muD8iSbHxJ1JkrfqmWb65P/Mw== + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== dependencies: es-errors "^1.3.0" @@ -2071,9 +2253,9 @@ eslint-config-prettier@^10.0.1: integrity sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw== eslint-plugin-prettier@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz#d1c8f972d8f60e414c25465c163d16f209411f95" - integrity sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw== + version "5.2.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.2.tgz#d1f068f65dc8490f102eda21d1f4cd150c205211" + integrity sha512-1yI3/hf35wmlq66C8yOyrujQnel+v5l1Vop5Cl2I6ylyNTT1JbuUUnV3/41PzwTzcyDp/oF0jWE3HXvcH5AQOQ== dependencies: prettier-linter-helpers "^1.0.0" synckit "^0.9.1" @@ -2247,6 +2429,15 @@ expr-eval@^2.0.2: resolved "https://registry.yarnpkg.com/expr-eval/-/expr-eval-2.0.2.tgz#fa6f044a7b0c93fde830954eb9c5b0f7fbc7e201" integrity sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg== +external-editor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2610,6 +2801,13 @@ hyperdyperid@^1.2.0: resolved "https://registry.yarnpkg.com/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b" integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A== +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + ignore@^5.2.0, ignore@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" @@ -2654,6 +2852,20 @@ inherits@2, inherits@^2.0.3, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inquirer@^10.2.0: + version "10.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-10.2.2.tgz#36b866443a9fb2747151766c01ef9c8ba2d585eb" + integrity sha512-tyao/4Vo36XnUItZ7DnUXX4f1jVao2mSrleV/5IPtW/XAEA26hRVsbc68nuTEKWcr5vMP/1mVoT2O7u8H4v1Vg== + dependencies: + "@inquirer/core" "^9.1.0" + "@inquirer/prompts" "^5.5.0" + "@inquirer/type" "^1.5.3" + "@types/mute-stream" "^0.0.4" + ansi-escapes "^4.3.2" + mute-stream "^1.0.0" + run-async "^3.0.0" + rxjs "^7.8.1" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -3568,6 +3780,11 @@ mustache@^4.2.0: resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.2.0.tgz#e5892324d60a12ec9c2a73359edca52972bf6f64" integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== +mute-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" + integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -3650,9 +3867,9 @@ onetime@^5.1.2: mimic-fn "^2.1.0" openai@^4.77.0: - version "4.78.1" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.78.1.tgz#44c3b195d239891be9c9c53722539ad8a1fcc5f2" - integrity sha512-drt0lHZBd2lMyORckOXFPQTmnGLWSLt8VK0W9BhOKWpMFBEoHMoz5gxMPmVq5icp+sOrsbMnsmZTVHUlKvD1Ow== + version "4.79.1" + resolved "https://registry.yarnpkg.com/openai/-/openai-4.79.1.tgz#2976f4d20d577cb5f9b7c6664de08745348d5461" + integrity sha512-M7P5/PKnT/S/B5v0D64giC9mjyxFYkqlCuQFzR5hkdzMdqUuHf8T1gHhPGPF5oAvu4+PO3TvJv/qhZoS2bqAkw== dependencies: "@types/node" "^18.11.18" "@types/node-fetch" "^2.6.4" @@ -3691,6 +3908,11 @@ optionator@^0.9.3: type-check "^0.4.0" word-wrap "^1.2.5" +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + otpauth@^9.2.2: version "9.3.6" resolved "https://registry.yarnpkg.com/otpauth/-/otpauth-9.3.6.tgz#d71df14dc0a2af0f31ff117aa0f94cb3360b1350" @@ -4071,6 +4293,11 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +run-async@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-3.0.0.tgz#42a432f6d76c689522058984384df28be379daad" + integrity sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q== + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -4078,6 +4305,13 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +rxjs@^7.2.0, rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -4093,6 +4327,11 @@ safe-stable-stringify@^2.3.1: resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz#4ca2f8e385f2831c432a719b108a3bf7af42a1dd" integrity sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA== +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" @@ -4142,7 +4381,7 @@ signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -signal-exit@^4.0.1: +signal-exit@^4.0.1, signal-exit@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== @@ -4210,7 +4449,6 @@ string-length@^4.0.1: strip-ansi "^6.0.0" "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - name string-width-cjs version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -4243,7 +4481,6 @@ string_decoder@~1.1.1: safe-buffer "~5.1.0" "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -4323,6 +4560,13 @@ thingies@^1.20.0: resolved "https://registry.yarnpkg.com/thingies/-/thingies-1.21.0.tgz#e80fbe58fd6fdaaab8fad9b67bd0a5c943c445c1" integrity sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g== +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + tmp@^0.2.1: version "0.2.3" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" @@ -4390,7 +4634,7 @@ tslib@2.7.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== -tslib@^2.0.0, tslib@^2.4.0, tslib@^2.5.2, tslib@^2.6.2, tslib@^2.7.0, tslib@^2.8.1: +tslib@^2.0.0, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.5.2, tslib@^2.6.2, tslib@^2.7.0, tslib@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -4501,9 +4745,9 @@ undici-types@~6.20.0: integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== undici@^7.1.1: - version "7.2.1" - resolved "https://registry.yarnpkg.com/undici/-/undici-7.2.1.tgz#897dc535f78bee62217efc0c5f50ea6b5f078b64" - integrity sha512-U2k0XHLJfaciARRxDcqTk2AZQsGXerHzdvfCZcy1hNhSf5KCAF4jIQQxL+apQviOekhRFPqED6Of5/+LcUSLzQ== + version "7.2.3" + resolved "https://registry.yarnpkg.com/undici/-/undici-7.2.3.tgz#e3e8ff2ddee1c3ab624b3a4f275093cff4b2fc77" + integrity sha512-2oSLHaDalSt2/O/wHA9M+/ZPAOcU2yrSP/cdBYJ+YxZskiPYDSqHbysLSlD7gq3JMqOoJI5O31RVU3BxX/MnAA== universalify@^0.2.0: version "0.2.0" @@ -4656,6 +4900,15 @@ word-wrap@^1.2.5, word-wrap@~1.2.3: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -4731,6 +4984,11 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== +yoctocolors-cjs@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz#f4b905a840a37506813a7acaa28febe97767a242" + integrity sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA== + zod-to-json-schema@^3.22.3, zod-to-json-schema@^3.22.4, zod-to-json-schema@^3.22.5, zod-to-json-schema@^3.24.1: version "3.24.1" resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.24.1.tgz#f08c6725091aadabffa820ba8d50c7ab527f227a" From e493934ec4788c8dddca6e41fca2a88068c9eb4d Mon Sep 17 00:00:00 2001 From: xm0onh Date: Fri, 17 Jan 2025 16:16:59 -0800 Subject: [PATCH 06/10] Add onboarding character --- src/cli/onboarding.ts | 28 +++++++++++ src/index.ts | 93 ++++++++++-------------------------- src/utils/characterLoader.ts | 17 +++---- 3 files changed, 62 insertions(+), 76 deletions(-) create mode 100644 src/cli/onboarding.ts diff --git a/src/cli/onboarding.ts b/src/cli/onboarding.ts new file mode 100644 index 00000000..8b56fe76 --- /dev/null +++ b/src/cli/onboarding.ts @@ -0,0 +1,28 @@ +import inquirer from 'inquirer'; +import { createLogger } from '../utils/logger.js'; +import { listAvailableCharacters } from '../utils/characterLoader.js'; + +const logger = createLogger('onboarding'); + +interface UserAnswers { + character: string; +} + +export const onboarding = async (): Promise => { + const characters = await listAvailableCharacters(); + + const answers: UserAnswers = await inquirer.prompt([ + { + type: 'list', + name: 'character', + message: 'Select a character to run the workflow:', + choices: characters.map(char => ({ + name: `${char.id} - ${char.description.split('.')[0]}`, + value: char.id, + })), + }, + ]); + logger.info(`Character: ${answers.character}`); + + return answers; +}; diff --git a/src/index.ts b/src/index.ts index 00dd01be..824bc258 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,91 +1,48 @@ import { config } from './config/index.js'; import { createLogger } from './utils/logger.js'; import { runWorkflow } from './agents/workflows/kol/workflow.js'; -import inquirer from 'inquirer'; +import { onboarding } from './cli/onboarding.js'; const logger = createLogger('app'); -// Add process ID and timestamp to track instances -const instanceId = `${process.pid}-${Date.now()}`; -logger.info(`Process instance started: ${instanceId}`); +process.on('SIGINT', () => { + logger.info('Received SIGINT. Gracefully shutting down...'); + process.exit(0); +}); -interface UserAnswers { - name: string; - projectType: string; - features: string[]; -} - -const onboarding = async () => { - const answers: UserAnswers = await inquirer.prompt([ - { - type: 'input', - name: 'name', - message: 'What is your project name?', - default: 'my-awesome-project' - }, - { - type: 'list', - name: 'projectType', - message: 'What type of project do you want to create?', - choices: [ - 'Frontend (React)', - 'Backend (Node.js)', - 'Full Stack', - 'Library' - ] - }, - { - type: 'checkbox', - name: 'features', - message: 'Select additional features:', - choices: [ - 'TypeScript Configuration', - 'ESLint', - 'Prettier', - 'Jest Testing', - 'GitHub Actions', - 'Docker Setup' - ] - } - ]); - - console.log('\nProject Configuration:'); - console.log('====================='); - console.log(`Project Name: ${answers.name}`); - console.log(`Project Type: ${answers.projectType}`); - console.log('Selected Features:', answers.features.join(', ')); -}; - -// Get character name from command line args -const characterId = process.argv[2]; -if (!characterId) { - logger.error('Please provide a character name as an argument (e.g., yarn dev argumint)'); - process.exit(1); -} - -// Strip any file extension -const cleanCharacterId = characterId.replace(/\.(ya?ml)$/, ''); +process.on('SIGTERM', () => { + logger.info('Received SIGTERM. Gracefully shutting down...'); + process.exit(0); +}); const startWorkflowPolling = async () => { try { - const _result = await runWorkflow(cleanCharacterId); + const character = await onboarding(); + const _result = await runWorkflow(character.character); logger.info('Workflow execution completed successfully'); } catch (error) { + if (error && typeof error === 'object' && 'name' in error && error.name === 'ExitPromptError') { + logger.info('Process terminated by user'); + process.exit(0); + } logger.error('Error running workflow:', error); } }; const main = async () => { try { - await onboarding(); - // await startWorkflowPolling(); - // setInterval(startWorkflowPolling, config.twitterConfig.RESPONSE_INTERVAL_MS); + await startWorkflowPolling(); + setInterval(startWorkflowPolling, config.twitterConfig.RESPONSE_INTERVAL_MS); - // logger.info('Application started successfully', { - // checkInterval: config.twitterConfig.RESPONSE_INTERVAL_MS / 1000 / 60, - // username: config.twitterConfig.USERNAME, - // }); + logger.info('Application started successfully', { + checkInterval: config.twitterConfig.RESPONSE_INTERVAL_MS / 1000 / 60, + username: config.twitterConfig.USERNAME, + }); } catch (error) { + if (error && typeof error === 'object' && 'name' in error && error.name === 'ExitPromptError') { + logger.info('Process terminated by user'); + process.exit(0); + } logger.error('Failed to start application:', error); process.exit(1); } diff --git a/src/utils/characterLoader.ts b/src/utils/characterLoader.ts index 0ee1d5fe..2e59927c 100644 --- a/src/utils/characterLoader.ts +++ b/src/utils/characterLoader.ts @@ -2,18 +2,20 @@ import { readdir } from 'fs/promises'; import { join } from 'path'; import { loadCharacter } from '../config/characters.js'; -export interface CharacterInfo { +interface CharacterInfo { id: string; name: string; description: string; username: string; } -export async function listAvailableCharacters(): Promise { +export const listAvailableCharacters = async (): Promise => { const charactersPath = join(process.cwd(), 'config', 'characters'); const files = await readdir(charactersPath); - const characterFiles = files.filter(file => file.endsWith('.yaml')); - + const characterFiles = files + .filter(file => file.endsWith('.yaml')) + .filter(file => !file.includes('.example.')); + const characters = await Promise.all( characterFiles.map(async file => { const id = file.replace(/\.yaml$/, ''); @@ -22,10 +24,9 @@ export async function listAvailableCharacters(): Promise { id, name: character.name, description: character.description, - username: character.username + username: character.username, }; - }) + }), ); - return characters; -} \ No newline at end of file +}; From 9711fc411c56c622068f2736377a67c2d8fa2ff7 Mon Sep 17 00:00:00 2001 From: xm0onh Date: Fri, 17 Jan 2025 16:23:21 -0800 Subject: [PATCH 07/10] reorg onboarding and lint fix --- README.md | 19 +++---------------- src/cli/onboarding.ts | 2 +- src/{ => cli}/utils/characterLoader.ts | 3 +-- 3 files changed, 5 insertions(+), 19 deletions(-) rename src/{ => cli}/utils/characterLoader.ts (88%) diff --git a/README.md b/README.md index 52e0e045..6ac851eb 100644 --- a/README.md +++ b/README.md @@ -158,18 +158,8 @@ Run the agent with a specific character: yarn dev # for development with auto-reload # or yarn start # for production build and run - -# Use a specific character (omit .yaml extension) -yarn dev my-agent # for development with auto-reload -# or -yarn start my-agent # for production build and run - -# Examples: -# If your character file is named 'techie.yaml': -yarn dev techie -# If your character file is named 'my-agent.yaml': -yarn dev my-agent ``` +Then, choose a character from the list of available characters. Note: When specifying a character file, omit the `.yaml` extension. The system will automatically look for the YAML file in the `config/characters/` directory. @@ -221,7 +211,7 @@ To use this feature: 1. Configure your AUTO_DRIVE_API_KEY in `.env` (obtain from https://ai3.storage) 2. Enable Auto Drive uploading in your `config.yaml`: ```yaml - autodrive: + auto_drive: upload: true ``` 3. Provide your Taurus EVM wallet details (PRIVATE_KEY) and Agent Memory Contract Address (CONTRACT_ADDRESS) in .env` @@ -246,11 +236,8 @@ The KOL workflow enables agents to: Start the agent with: ```bash -# Use default character +# Use example character yarn dev - -# Use a specific character (without .ts extension) -yarn dev my-agent ``` Monitor the agent's activity in the console and configured log files. diff --git a/src/cli/onboarding.ts b/src/cli/onboarding.ts index 8b56fe76..b83e6f35 100644 --- a/src/cli/onboarding.ts +++ b/src/cli/onboarding.ts @@ -1,6 +1,6 @@ import inquirer from 'inquirer'; import { createLogger } from '../utils/logger.js'; -import { listAvailableCharacters } from '../utils/characterLoader.js'; +import { listAvailableCharacters } from './utils/characterLoader.js'; const logger = createLogger('onboarding'); diff --git a/src/utils/characterLoader.ts b/src/cli/utils/characterLoader.ts similarity index 88% rename from src/utils/characterLoader.ts rename to src/cli/utils/characterLoader.ts index 2e59927c..92155ed5 100644 --- a/src/utils/characterLoader.ts +++ b/src/cli/utils/characterLoader.ts @@ -1,6 +1,6 @@ import { readdir } from 'fs/promises'; import { join } from 'path'; -import { loadCharacter } from '../config/characters.js'; +import { loadCharacter } from '../../config/characters.js'; interface CharacterInfo { id: string; @@ -14,7 +14,6 @@ export const listAvailableCharacters = async (): Promise => { const files = await readdir(charactersPath); const characterFiles = files .filter(file => file.endsWith('.yaml')) - .filter(file => !file.includes('.example.')); const characters = await Promise.all( characterFiles.map(async file => { From d407eb215ba48811782e247edfa392a267bf3d2e Mon Sep 17 00:00:00 2001 From: xm0onh Date: Fri, 17 Jan 2025 16:24:20 -0800 Subject: [PATCH 08/10] clean coding --- src/cli/utils/characterLoader.ts | 3 +-- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cli/utils/characterLoader.ts b/src/cli/utils/characterLoader.ts index 92155ed5..d235e1c6 100644 --- a/src/cli/utils/characterLoader.ts +++ b/src/cli/utils/characterLoader.ts @@ -12,8 +12,7 @@ interface CharacterInfo { export const listAvailableCharacters = async (): Promise => { const charactersPath = join(process.cwd(), 'config', 'characters'); const files = await readdir(charactersPath); - const characterFiles = files - .filter(file => file.endsWith('.yaml')) + const characterFiles = files.filter(file => file.endsWith('.yaml')); const characters = await Promise.all( characterFiles.map(async file => { diff --git a/src/index.ts b/src/index.ts index 824bc258..e39cd5d5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,7 @@ const startWorkflowPolling = async () => { try { const character = await onboarding(); const _result = await runWorkflow(character.character); - logger.info('Workflow execution completed successfully'); + logger.info('Workflow execution completed successfully for character:', character.character); } catch (error) { if (error && typeof error === 'object' && 'name' in error && error.name === 'ExitPromptError') { logger.info('Process terminated by user'); From e51ac5d55ff9ae02ff5326e0138971f31cae580e Mon Sep 17 00:00:00 2001 From: xm0onh Date: Fri, 17 Jan 2025 17:06:24 -0800 Subject: [PATCH 09/10] Bring back the automated run with character with command --- README.md | 24 ++++++++++++++++++++---- src/cli/onboarding.ts | 11 ++++++++++- src/index.ts | 9 ++++++++- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4fd595c1..fb64137c 100644 --- a/README.md +++ b/README.md @@ -153,13 +153,26 @@ engagement_criteria: Run the agent with a specific character: +You can run the agent with a specific character by providing the character name as an argument. + ```bash # Use default character (configured in config.yaml) -yarn dev # for development with auto-reload +yarn dev # for development with auto-reload - select from list of characters +# or +yarn start # for production build and run - select from list of characters + + +# Use a specific character (omit .yaml extension) +yarn dev my-agent # for development with auto-reload # or -yarn start # for production build and run +yarn start my-agent # for production build and run + +# Examples: +# If your character file is named 'techie.yaml': +yarn dev techie +# If your character file is named 'my-agent.yaml': +yarn dev my-agent ``` -Then, choose a character from the list of available characters. Note: When specifying a character file, omit the `.yaml` extension. The system will automatically look for the YAML file in the `config/characters/` directory. @@ -236,8 +249,11 @@ The KOL workflow enables agents to: Start the agent with: ```bash -# Use example character +# Use example character or select from list of characters yarn dev + +# Use specific character +yarn dev my-agent ``` Monitor the agent's activity in the console and configured log files. diff --git a/src/cli/onboarding.ts b/src/cli/onboarding.ts index b83e6f35..f37e1dda 100644 --- a/src/cli/onboarding.ts +++ b/src/cli/onboarding.ts @@ -8,9 +8,18 @@ interface UserAnswers { character: string; } -export const onboarding = async (): Promise => { +export const onboarding = async (preselectedCharacter?: string): Promise => { const characters = await listAvailableCharacters(); + if (preselectedCharacter) { + const character = characters.find(char => char.id === preselectedCharacter); + if (character) { + logger.info(`Using preselected character: ${character.id}`); + return { character: character.id }; + } + throw new Error(`Character "${preselectedCharacter}" not found`); + } + const answers: UserAnswers = await inquirer.prompt([ { type: 'list', diff --git a/src/index.ts b/src/index.ts index e39cd5d5..e1407ebb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,9 +15,15 @@ process.on('SIGTERM', () => { process.exit(0); }); +const characterId = process.argv[2]; +if (!characterId) { + logger.error('Please provide a character name as an argument (e.g., yarn dev argumint)'); + process.exit(1); +} + const startWorkflowPolling = async () => { try { - const character = await onboarding(); + const character = await onboarding(characterId); const _result = await runWorkflow(character.character); logger.info('Workflow execution completed successfully for character:', character.character); } catch (error) { @@ -26,6 +32,7 @@ const startWorkflowPolling = async () => { process.exit(0); } logger.error('Error running workflow:', error); + process.exit(1); } }; From f602cbfc878b86f9c9da1ffa6fbda7894688fe8e Mon Sep 17 00:00:00 2001 From: xm0onh Date: Fri, 17 Jan 2025 17:08:10 -0800 Subject: [PATCH 10/10] remove unnecessary check --- src/index.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index e1407ebb..79293738 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,10 +16,6 @@ process.on('SIGTERM', () => { }); const characterId = process.argv[2]; -if (!characterId) { - logger.error('Please provide a character name as an argument (e.g., yarn dev argumint)'); - process.exit(1); -} const startWorkflowPolling = async () => { try {