Comparing version 1.0.7 to 1.0.8
#!/usr/bin/env node | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const readline_1 = require("readline"); | ||
const chat_gpt_1 = require("./chat-gpt"); | ||
const fs_1 = __importDefault(require("fs")); | ||
const dotenv_1 = __importDefault(require("dotenv")); | ||
const path_1 = require("path"); | ||
dotenv_1.default.config({ path: (0, path_1.join)(__dirname, '..', '.env') }); | ||
let chatGPT; | ||
if (!process.env.API_KEY) { | ||
console.log('\x1b[90m%s\x1b[0m', 'Please enter your OpenAI API key:'); | ||
const readline = (0, readline_1.createInterface)({ input: process.stdin, output: process.stdout }); | ||
readline.setPrompt(''); | ||
readline.on('line', (line) => { | ||
process.env.API_KEY = line.replace(/\n/g, '').replace(/ /g, ''); | ||
readline.close(); | ||
}); | ||
readline.on('close', async () => { | ||
console.log('\x1b[90m%s\x1b[0m', 'API key set.\n'); | ||
fs_1.default.writeFileSync((0, path_1.join)(__dirname, '..', '.env'), `API_KEY=${process.env.API_KEY}`); | ||
chatGPT = new chat_gpt_1.ChatGPT(process.env.API_KEY); | ||
cycle(); | ||
}); | ||
} | ||
else { | ||
chatGPT = new chat_gpt_1.ChatGPT(process.env.API_KEY); | ||
cycle(); | ||
} | ||
function cycle() { | ||
const readline = (0, readline_1.createInterface)({ input: process.stdin, output: process.stdout }); | ||
readline.setPrompt(''); | ||
let input = ''; | ||
console.log('\x1b[33m%s\x1b[0m', 'You:'); | ||
readline.on('line', (line) => { | ||
input += line; | ||
readline.close(); | ||
}); | ||
readline.on('close', async () => { | ||
if (input.length === 0) | ||
process.exit(0); | ||
console.log(); | ||
console.log('\x1b[36m%s\x1b[0m', 'ChatGPT:'); | ||
await chatGPT.ask(input); | ||
console.log('\n'); | ||
cycle(); | ||
}); | ||
} | ||
const terminal_1 = require("./core/terminal"); | ||
const terminal = new terminal_1.Terminal(); | ||
terminal.listen(); |
{ | ||
"name": "chatgptk", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"author": "rhea-so <jeonghyeon.rhea@gmail.com>", | ||
@@ -14,5 +14,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@creatrip/env-safe": "0.2.4", | ||
"chatgptk": "1.0.0", | ||
"dotenv": "16.0.3", | ||
"eventsource-parser": "0.1.0", | ||
"langchain": "0.0.54", | ||
"lru-cache": "8.0.4", | ||
@@ -26,3 +28,8 @@ "openai": "3.2.1", | ||
"@types/node": "18.15.5" | ||
}, | ||
"prettier": { | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"printWidth": 150 | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
6630
2
10
152
2
0
1
+ Added@creatrip/env-safe@0.2.4
+ Addedlangchain@0.0.54
+ Added@anthropic-ai/sdk@0.4.4(transitive)
+ Added@creatrip/env-safe@0.2.4(transitive)
+ Added@dqbd/tiktoken@1.0.17(transitive)
+ Added@fortaine/fetch-event-source@3.0.6(transitive)
+ Added@types/node@22.9.0(transitive)
+ Added@types/retry@0.12.0(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbinary-search@1.3.6(transitive)
+ Addedbrowser-or-node@2.1.1(transitive)
+ Addedcross-fetch@3.1.8(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedexpr-eval@2.0.2(transitive)
+ Addedflat@5.0.2(transitive)
+ Addedis-any-array@2.0.1(transitive)
+ Addedjsonpointer@5.0.1(transitive)
+ Addedlangchain@0.0.54(transitive)
+ Addedml-array-mean@1.1.6(transitive)
+ Addedml-array-sum@1.1.6(transitive)
+ Addedml-distance@4.0.1(transitive)
+ Addedml-distance-euclidean@2.0.0(transitive)
+ Addedml-tree-similarity@1.0.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednum-sort@2.1.0(transitive)
+ Addedobject-hash@3.0.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-queue@6.6.2(transitive)
+ Addedp-retry@4.6.2(transitive)
+ Addedp-timeout@3.2.0(transitive)
+ Addedreflect-metadata@0.1.13(transitive)
+ Addedretry@0.13.1(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addeduuid@9.0.1(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedyaml@2.6.0(transitive)
+ Addedzod@3.23.8(transitive)
- Removed@types/node@22.9.3(transitive)