@kamrankhan027/probe-ai 1.0.0 → 1.0.2

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 (2) hide show
  1. package/dist/index.js +19 -15
  2. package/package.json +5 -7
package/dist/index.js CHANGED
@@ -4508,11 +4508,11 @@ var GraphState = Annotation.Root({
4508
4508
  default: () => []
4509
4509
  })
4510
4510
  });
4511
- function createProbeAgent(apiKey2) {
4511
+ function createProbeAgent(apiKey) {
4512
4512
  const model = new ChatGoogleGenerativeAI({
4513
4513
  model: "gemini-3.6-flash",
4514
4514
  temperature: 0.2,
4515
- apiKey: apiKey2
4515
+ apiKey
4516
4516
  }).bindTools(tools);
4517
4517
  const callModel = async (state) => {
4518
4518
  const response = await model.invoke(state.messages);
@@ -4550,7 +4550,6 @@ marked.use(
4550
4550
  }
4551
4551
  })
4552
4552
  );
4553
- var apiKey = process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY;
4554
4553
  function printBanner() {
4555
4554
  console.log(
4556
4555
  boxen(
@@ -4573,29 +4572,34 @@ ${chalk6.yellow("Try prompts like:")}
4573
4572
  }
4574
4573
  async function main() {
4575
4574
  printBanner();
4576
- if (!apiKey) {
4577
- console.log(
4578
- chalk6.yellow(
4579
- "\n[WARNING] GEMINI_API_KEY not found. Please set GEMINI_API_KEY in your environment or .env file.\n"
4580
- )
4581
- );
4582
- }
4583
- const app = createProbeAgent(apiKey || "");
4584
- const messages = [PROBE_SYSTEM_MESSAGE];
4585
4575
  const rl = readline.createInterface({
4586
4576
  input: process.stdin,
4587
4577
  output: process.stdout
4588
4578
  });
4589
- const promptUser = () => {
4579
+ const promptUser = (questionText) => {
4590
4580
  return new Promise((resolve) => {
4591
- rl.question(chalk6.bold.green("\nYou: "), (answer) => {
4581
+ rl.question(questionText, (answer) => {
4592
4582
  resolve(answer.trim());
4593
4583
  });
4594
4584
  });
4595
4585
  };
4586
+ let apiKey = process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY;
4587
+ if (!apiKey) {
4588
+ console.log(chalk6.yellow("\u{1F511} No GEMINI_API_KEY found in your environment or .env file."));
4589
+ console.log(chalk6.dim("Get a free key from https://aistudio.google.com/\n"));
4590
+ apiKey = await promptUser(chalk6.bold.cyan("Enter your Gemini API Key: "));
4591
+ if (!apiKey) {
4592
+ console.log(chalk6.red("\nError: An API key is required to run ProbeAI. Exiting...\n"));
4593
+ rl.close();
4594
+ process.exit(1);
4595
+ }
4596
+ console.log(chalk6.green("\u2705 API Key registered for this session.\n"));
4597
+ }
4598
+ const app = createProbeAgent(apiKey);
4599
+ const messages = [PROBE_SYSTEM_MESSAGE];
4596
4600
  while (true) {
4597
4601
  try {
4598
- const input = await promptUser();
4602
+ const input = await promptUser(chalk6.bold.green("\nYou: "));
4599
4603
  if (!input) continue;
4600
4604
  if (input.toLowerCase() === "exit" || input.toLowerCase() === "quit") {
4601
4605
  console.log(chalk6.cyan("\nGoodbye! \u{1F44B}\n"));
package/package.json CHANGED
@@ -1,19 +1,17 @@
1
1
  {
2
2
  "name": "@kamrankhan027/probe-ai",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Autonomous API Schema & Reliability Inspector CLI. Probes OpenAPI specs, generates test suites, executes real-time HTTP calls, and exports Postman collections.",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "bin": {
8
- "probe-ai": "./dist/index.js"
9
- },
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": "dist/index.js",
10
8
  "files": [
11
9
  "dist"
12
10
  ],
13
11
  "scripts": {
14
12
  "build": "tsup",
15
13
  "dev": "tsup --watch",
16
- "start": "node ./dist/index.js"
14
+ "start": "node dist/index.js"
17
15
  },
18
16
  "keywords": [
19
17
  "ai",