Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export const userRequest =
npm run dev
```

> 또는 다음과 같이 커맨드라인에서 prompt를 붙일 수도 있습니다.

```
npm run dev 여러가지 순열들을 제공해주는 Typescript 라이브러리를 제공해 줘
```

> 모든 결과파일은 result 폴더 안에 생성됩니다.

<br />
Expand Down
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
{
"name": "friday",
"name": "friday-gpt",
"description": "A.I 에게 R&R을 부여해서 프로그래밍 업무를 진행시킵니다.",
"private": true,
"version": "0.0.1",
"main": "index.js",
"type": "module",
"scripts": {
"start": "tsc && node -r dotenv/config dist/dev.js",
"dev": "tsc && node -r dotenv/config dist/dev.js",
"architect": "tsc && node -r dotenv/config dist/architect.js",
"evangelist": "tsc && node -r dotenv/config dist/evangelist.js",
"programmer": "tsc && node -r dotenv/config dist/programmer.js",
"reviewer": "tsc && node -r dotenv/config dist/reviewer.js",
"new-tts": "tsc && node -r dotenv/config dist/azureSpeak.js"
"new-tts": "tsc && node -r dotenv/config dist/azureSpeak.js",
"lint:fix": "prettier --write . && eslint --fix",
"lint": "prettier --check . && eslint",
"typecheck": "tsc",
"release:patch": "npm run build && npm version patch && npm run build && npm publish && git push --follow-tags"
},
"repository": {
"type": "git",
"url": "https://github.com/hmmhmmhm/friday-gpt"
},
"devDependencies": {
"@types/node": "^18.15.11",
"chalk": "^5.2.0",
"cleye": "^1.3.2",
"dotenv": "^16.0.3",
"typescript": "^5.0.4"
},
Expand All @@ -26,3 +36,4 @@
"sound-play": "^1.1.0"
}
}

10 changes: 5 additions & 5 deletions src/architect/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { config } from "../input.js";
import { countConfig } from "../input.js";
import { userRequest } from "../input.js";
import { logger } from "../utils/logger.js";
import { findIsGoodToGo, findWhatIdo } from "../utils/match.js";
Expand All @@ -11,14 +11,14 @@ import fs from "node:fs";

export const doArchitect = async () => {
logger(
`요청사항에 따른 ${config.architect.draftCount}가지 각기 다른 기획 시안을 생성 중입니다.\n`
`요청사항에 따른 ${countConfig.architect.draftCount}가지 각기 다른 기획 시안을 생성 중입니다.\n`
);
speak(
`요청사항에 따른 ${config.architect.draftCount}가지 각기 다른 기획 시안을 생성 중입니다.`
`요청사항에 따른 ${countConfig.architect.draftCount}가지 각기 다른 기획 시안을 생성 중입니다.`
);

const drafts: string[] = [];
for (let i = 1; i <= config.architect.draftCount; i++) {
for (let i = 1; i <= countConfig.architect.draftCount; i++) {
const draft = await doArchitectThese(userRequest);
drafts.push(draft);

Expand All @@ -36,7 +36,7 @@ export const doArchitect = async () => {

let bestDraftNumber = 1;

if (config.architect.draftCount !== 1) {
if (countConfig.architect.draftCount !== 1) {
const bestDraftSelection = await doArchitectSelection(drafts);
console.log(bestDraftSelection);

Expand Down
28 changes: 25 additions & 3 deletions src/input.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
export const userRequest =
"키워드를 하나 입력받은다음 youtube.com 에서 해당 키워드의 영상 5개를 다운받는 프로그램을 Typescript 로 작성해줘";
import { cli } from 'cleye';
import { version } from '../package.json';
import { commandName } from './helpers/constants';

export const config = {
const argv = cli({
name: commandName,
version: version,
flags: {
prompt: {
type: String,
description: 'Prompt to run',
alias: 'p',
},
}
})

let userRequest = argv._.join(' ');

// If userRequest is empty, use the provided default value
if (userRequest === "") {
userRequest = "키워드를 하나 입력받은다음 youtube.com 에서 해당 키워드의 영상 5개를 다운받는 프로그램을 Typescript 로 작성해줘";
}

export { userRequest };

export const countConfig = {
architect: {
// * 초기 기획서를 몇 개까지 만들고 고민할지 설정합니다.
draftCount: 3,
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "resolveJsonModule": true, /* Enable importing .json files */
"resolveJsonModule": true, /* Enable importing .json files */
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
Expand Down Expand Up @@ -90,4 +90,4 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}
}