lendctl-ai 0.1.2 → 0.1.4

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/bin/lendctl-ai CHANGED
@@ -1,2 +1,10 @@
1
- #!/bin/sh
2
- exec node "$(dirname "$0")/../dist/index.js" "$@"
1
+ #!/usr/bin/env sh
2
+ # Find the real location of this script
3
+ SELF=$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")
4
+ while [ -h "$SELF" ]; do
5
+ DIR=$(dirname "$SELF")
6
+ SELF=$(readlink "$SELF")
7
+ case "$SELF" in /*) ;; *) SELF="$DIR/$SELF" ;; esac
8
+ done
9
+ DIR=$(dirname "$SELF")
10
+ exec node "$DIR/../dist/index.js" "$@"
package/dist/index.js CHANGED
@@ -21284,7 +21284,21 @@ var init_registry = __esm(() => {
21284
21284
  });
21285
21285
 
21286
21286
  // src/agent/planner.ts
21287
+ function checkApiKey() {
21288
+ if (!process.env.OPENAI_API_KEY) {
21289
+ console.error(`
21290
+ ❌ OPENAI_API_KEY not set!
21291
+ `);
21292
+ console.error("To use lendctl-ai, set your OpenAI API key:");
21293
+ console.error(` export OPENAI_API_KEY=sk-...
21294
+ `);
21295
+ console.error(`Get an API key at: https://platform.openai.com/api-keys
21296
+ `);
21297
+ process.exit(1);
21298
+ }
21299
+ }
21287
21300
  async function createPlan(query, context, model = "gpt-4o") {
21301
+ checkApiKey();
21288
21302
  const { object: plan } = await generateObject({
21289
21303
  model: openai(model),
21290
21304
  schema: PlanSchema,
@@ -21299,6 +21313,7 @@ Include all necessary calculations and compliance checks.`
21299
21313
  return plan;
21300
21314
  }
21301
21315
  async function replan(originalQuery, previousPlan, validationIssues, model = "gpt-4o") {
21316
+ checkApiKey();
21302
21317
  const { object: plan } = await generateObject({
21303
21318
  model: openai(model),
21304
21319
  schema: PlanSchema,
@@ -25629,7 +25644,7 @@ ${source_default.cyan("║")} ${source_default.bold.white("LendCtl AI")} - Auto
25629
25644
  ${source_default.cyan("║")} ${source_default.gray("Powered by LendCtl CLI Suite")} ${source_default.cyan("║")}
25630
25645
  ${source_default.cyan("╚═══════════════════════════════════════════════════════════╝")}
25631
25646
  `;
25632
- program2.name("lendctl-ai").description("Autonomous lending decision agent powered by LendCtl CLI suite").version("0.1.2");
25647
+ program2.name("lendctl-ai").description("Autonomous lending decision agent powered by LendCtl CLI suite").version("0.1.4");
25633
25648
  program2.command("ask").description("Ask a lending question").argument("<question>", "Your lending question").option("-m, --model <model>", "LLM model to use", "gpt-4o").option("-i, --iterations <n>", "Max planning iterations", "3").option("-v, --verbose", "Show detailed output").option("--quick", "Quick mode (skip LLM report generation)").action(async (question, options) => {
25634
25649
  console.log(banner);
25635
25650
  const agent = new LendCtlAgent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lendctl-ai",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Autonomous lending decision agent powered by LendCtl CLI suite",
5
5
  "author": "Satyan Avatara <rsatyan@gmail.com>",
6
6
  "license": "Apache-2.0",