@inkeep/agents-cli 0.33.2 → 0.34.1

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/dist/config.d.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  interface ApiConfig {
2
+ /**
3
+ * API endpoint URL
4
+ */
2
5
  url: string;
6
+ /**
7
+ * API key
8
+ */
3
9
  apiKey?: string;
4
10
  }
5
11
  interface FlatInkeepConfig {
@@ -16,10 +22,28 @@ interface FlatInkeepConfig {
16
22
  outputDirectory?: string;
17
23
  }
18
24
  interface NestedInkeepConfig {
25
+ /**
26
+ * Tenant identifier
27
+ */
19
28
  tenantId: string;
29
+ /**
30
+ * Management API configuration
31
+ * @default http://localhost:3002
32
+ */
20
33
  agentsManageApi: ApiConfig;
34
+ /**
35
+ * Runtime API configuration
36
+ * @default http://localhost:3002
37
+ */
21
38
  agentsRunApi: ApiConfig;
39
+ /**
40
+ * Management UI URL
41
+ * @default http://localhost:3000
42
+ */
22
43
  manageUiUrl?: string;
44
+ /**
45
+ * Output directory for generated files
46
+ */
23
47
  outputDirectory?: string;
24
48
  }
25
49
  type InkeepConfig = FlatInkeepConfig | NestedInkeepConfig;
package/dist/index.js CHANGED
@@ -304,6 +304,7 @@ var init_models = __esm({
304
304
  CLAUDE_3_5_HAIKU_20241022: "anthropic/claude-3-5-haiku-20241022"
305
305
  };
306
306
  OPENAI_MODELS = {
307
+ GPT_5_1: "openai/gpt-5.1",
307
308
  GPT_5: "openai/gpt-5",
308
309
  GPT_5_20250807: "openai/gpt-5-2025-08-07",
309
310
  GPT_5_MINI: "openai/gpt-5-mini",
@@ -318,6 +319,7 @@ var init_models = __esm({
318
319
  GPT_4_1_NANO_20250414: "openai/gpt-4.1-nano-2025-04-14"
319
320
  };
320
321
  GOOGLE_MODELS = {
322
+ GEMINI_3_PRO_PREVIEW: "google/gemini-3-pro-preview",
321
323
  GEMINI_2_5_PRO: "google/gemini-2.5-pro",
322
324
  GEMINI_2_5_FLASH: "google/gemini-2.5-flash",
323
325
  GEMINI_2_5_FLASH_LITE: "google/gemini-2.5-flash-lite"
@@ -1694,7 +1696,7 @@ var init_schema = __esm({
1694
1696
  ...agentScoped,
1695
1697
  ...uiProperties,
1696
1698
  prompt: text("prompt").notNull(),
1697
- conversationHistoryConfig: jsonb("conversation_history_config").$type().notNull().default({
1699
+ conversationHistoryConfig: jsonb("conversation_history_config").$type().default({
1698
1700
  mode: "full",
1699
1701
  limit: 50,
1700
1702
  maxOutputTokens: 4e3,
@@ -3425,7 +3427,8 @@ var init_schemas = __esm({
3425
3427
  version: z5.string().optional(),
3426
3428
  createdAt: z5.date(),
3427
3429
  updatedAt: z5.date(),
3428
- expiresAt: z5.date().optional()
3430
+ expiresAt: z5.date().optional(),
3431
+ relationshipId: z5.string().optional()
3429
3432
  }).openapi("McpTool");
3430
3433
  MCPToolConfigSchema = McpToolSchema.omit({
3431
3434
  config: true,
@@ -239997,7 +240000,7 @@ function getAvailableModel() {
239997
240000
  }
239998
240001
  }
239999
240002
  throw new Error(
240000
- "No API keys detected. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY"
240003
+ "No API keys detected. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_GENERATIVE_AI_API_KEY"
240001
240004
  );
240002
240005
  }
240003
240006
  var PROVIDER_CONFIGS;
@@ -240014,11 +240017,11 @@ var init_model_provider_detector = __esm({
240014
240017
  {
240015
240018
  name: "openai",
240016
240019
  envVars: ["OPENAI_API_KEY"],
240017
- model: "gpt-4.1"
240020
+ model: "gpt-5.1"
240018
240021
  },
240019
240022
  {
240020
240023
  name: "google",
240021
- envVars: ["GOOGLE_API_KEY", "GOOGLE_GENERATIVE_AI_API_KEY"],
240024
+ envVars: ["GOOGLE_GENERATIVE_AI_API_KEY"],
240022
240025
  model: "gemini-2.5-flash"
240023
240026
  }
240024
240027
  ];
@@ -241730,42 +241733,68 @@ async function pullV3Command(options) {
241730
241733
  });
241731
241734
  s4.start("Detecting project...");
241732
241735
  let projectDir;
241733
- if (options.project) {
241734
- projectDir = resolve4(process.cwd(), options.project);
241735
- if (!existsSync12(join15(projectDir, "index.ts"))) {
241736
- s4.stop(`No index.ts found in specified project directory: ${projectDir}`);
241737
- console.error(
241738
- chalk14.yellow("The specified project directory must contain an index.ts file")
241736
+ let projectId;
241737
+ let localProjectForId = null;
241738
+ const currentDir = process.cwd();
241739
+ const hasIndexInCurrent = existsSync12(join15(currentDir, "index.ts"));
241740
+ if (hasIndexInCurrent) {
241741
+ projectDir = currentDir;
241742
+ s4.start("Loading local project...");
241743
+ try {
241744
+ localProjectForId = await loadProject(projectDir);
241745
+ const localProjectId = localProjectForId.getId();
241746
+ if (options.project) {
241747
+ if (localProjectId !== options.project) {
241748
+ s4.stop("Project ID mismatch");
241749
+ console.error(
241750
+ chalk14.red(
241751
+ `Local project ID "${localProjectId}" doesn't match --project "${options.project}"`
241752
+ )
241753
+ );
241754
+ console.error(
241755
+ chalk14.yellow("Either remove --project flag or ensure it matches the local project ID")
241756
+ );
241757
+ process.exit(1);
241758
+ }
241759
+ }
241760
+ projectId = localProjectId;
241761
+ s4.stop(`Using local project: ${projectId}`);
241762
+ } catch (error) {
241763
+ s4.stop("Failed to load local project");
241764
+ throw new Error(
241765
+ `Could not load local project: ${error instanceof Error ? error.message : String(error)}`
241739
241766
  );
241740
- process.exit(1);
241741
241767
  }
241742
241768
  } else {
241743
- const currentDir = process.cwd();
241744
- if (existsSync12(join15(currentDir, "index.ts"))) {
241745
- projectDir = currentDir;
241746
- } else {
241769
+ if (!options.project) {
241747
241770
  s4.stop("No index.ts found in current directory");
241748
241771
  console.error(
241749
241772
  chalk14.yellow(
241750
- "Please run this command from a directory containing index.ts or use --project <path>"
241773
+ "Please run this command from a directory containing index.ts or use --project <project-id>"
241751
241774
  )
241752
241775
  );
241753
241776
  process.exit(1);
241754
241777
  }
241755
- }
241756
- s4.stop(`Project found: ${projectDir}`);
241757
- s4.start("Loading local project to get project ID...");
241758
- let localProjectForId;
241759
- let projectId;
241760
- try {
241761
- localProjectForId = await loadProject(projectDir);
241762
- projectId = localProjectForId.getId();
241763
- s4.stop(`Project ID: ${projectId}`);
241764
- } catch (error) {
241765
- s4.stop("Failed to load local project");
241766
- throw new Error(
241767
- `Could not determine project ID. Local project failed to load: ${error instanceof Error ? error.message : String(error)}`
241768
- );
241778
+ const projectPath = resolve4(currentDir, options.project);
241779
+ const hasIndexInPath = existsSync12(join15(projectPath, "index.ts"));
241780
+ if (hasIndexInPath) {
241781
+ projectDir = projectPath;
241782
+ s4.start("Loading project from specified path...");
241783
+ try {
241784
+ localProjectForId = await loadProject(projectDir);
241785
+ projectId = localProjectForId.getId();
241786
+ s4.stop(`Using project from path: ${projectId}`);
241787
+ } catch (error) {
241788
+ s4.stop("Failed to load project from path");
241789
+ throw new Error(
241790
+ `Could not load project from ${projectPath}: ${error instanceof Error ? error.message : String(error)}`
241791
+ );
241792
+ }
241793
+ } else {
241794
+ projectId = options.project;
241795
+ projectDir = join15(currentDir, projectId);
241796
+ s4.stop(`Creating new project directory: ${projectDir}`);
241797
+ }
241769
241798
  }
241770
241799
  s4.start(`Fetching project: ${projectId}`);
241771
241800
  const apiClient = await ManagementApiClient.create(
@@ -242039,7 +242068,7 @@ var envSchema2 = z15.object({
242039
242068
  // Secrets loaded from .env files (relative to where CLI is executed)
242040
242069
  ANTHROPIC_API_KEY: z15.string().optional(),
242041
242070
  OPENAI_API_KEY: z15.string().optional(),
242042
- GOOGLE_API_KEY: z15.string().optional(),
242071
+ GOOGLE_GENERATIVE_AI_API_KEY: z15.string().optional(),
242043
242072
  // Langfuse configuration for LLM observability
242044
242073
  LANGFUSE_SECRET_KEY: z15.string().optional(),
242045
242074
  LANGFUSE_PUBLIC_KEY: z15.string().optional(),
@@ -242314,13 +242343,29 @@ async function getAvailableTemplates(templatePath = "template-projects", local)
242314
242343
  }
242315
242344
  }
242316
242345
  return directories;
242317
- } else {
242318
- const response = await fetch(
242319
- `https://api.github.com/repos/inkeep/agents/contents/agents-cookbook/${templatePath}`
242346
+ }
242347
+ const response = await fetch(
242348
+ `https://api.github.com/repos/inkeep/agents/contents/agents-cookbook/${templatePath}`
242349
+ );
242350
+ if (!response.ok) {
242351
+ throw new Error(
242352
+ `Failed to fetch templates. Please check your internet connection and try again.`
242320
242353
  );
242321
- const contents = await response.json();
242322
- return contents.filter((item) => item.type === "dir" && item.name !== "weather-project").map((item) => item.name);
242323
242354
  }
242355
+ let contents;
242356
+ try {
242357
+ contents = await response.json();
242358
+ } catch (error) {
242359
+ throw new Error(
242360
+ `Failed to parse templates response. Please check your internet connection and try again. ${error}`
242361
+ );
242362
+ }
242363
+ if (!Array.isArray(contents)) {
242364
+ throw new Error(
242365
+ "Unexpected response format from templates. Please check your internet connection and try again"
242366
+ );
242367
+ }
242368
+ return contents.filter((item) => item.type === "dir" && item.name !== "weather-project").map((item) => item.name);
242324
242369
  }
242325
242370
 
242326
242371
  // src/commands/add.ts
@@ -242361,10 +242406,15 @@ async function addCommand(options) {
242361
242406
  const projectTemplates = await getAvailableTemplates("template-projects", options.localPrefix);
242362
242407
  const mcpTemplates = await getAvailableTemplates("template-mcps", options.localPrefix);
242363
242408
  if (!options.project && !options.mcp) {
242409
+ console.log(chalk.cyan("\nUsage:\n"));
242410
+ console.log(chalk.white("Add a project with: inkeep add --project <project-template>"));
242411
+ console.log(chalk.gray(" Example: inkeep add --project docs-assistant\n"));
242364
242412
  console.log(chalk.yellow("Available project templates:"));
242365
242413
  for (const template of projectTemplates) {
242366
242414
  console.log(chalk.gray(` \u2022 ${template}`));
242367
242415
  }
242416
+ console.log(chalk.white("\nAdd an MCP server with: inkeep add --mcp <mcp-template>"));
242417
+ console.log(chalk.gray(" Example: inkeep add --mcp slack\n"));
242368
242418
  console.log(chalk.yellow("Available MCP templates:"));
242369
242419
  for (const template of mcpTemplates) {
242370
242420
  console.log(chalk.gray(` \u2022 ${template}`));
@@ -242379,31 +242429,53 @@ async function addCommand(options) {
242379
242429
  console.error(`\u274C MCP template "${options.mcp}" not found`);
242380
242430
  process.exit(1);
242381
242431
  }
242382
- const s4 = p4.spinner();
242383
- s4.start("Adding template...");
242384
242432
  if (options.project) {
242385
- await addProjectTemplate(options.project, options.targetPath, options.localPrefix);
242386
- s4.stop();
242433
+ await addProjectTemplate(
242434
+ projectTemplates,
242435
+ options.project,
242436
+ options.targetPath,
242437
+ options.localPrefix
242438
+ );
242387
242439
  }
242388
242440
  if (options.mcp) {
242389
- await addMcpTemplate(options.mcp, options.targetPath, s4, options.localPrefix);
242441
+ await addMcpTemplate(mcpTemplates, options.mcp, options.targetPath, options.localPrefix);
242390
242442
  }
242391
242443
  return;
242392
242444
  }
242393
242445
  }
242394
- async function addProjectTemplate(template, targetPath, localPrefix) {
242395
- const templates = await getAvailableTemplates("template-projects", localPrefix);
242446
+ async function checkTemplateDir(templateDir, commandType) {
242447
+ const s4 = p4.spinner();
242448
+ if (await fs4.pathExists(templateDir)) {
242449
+ const overwrite = await p4.confirm({
242450
+ message: `Directory "${templateDir}" already exists. Do you want to overwrite it?`
242451
+ });
242452
+ if (!overwrite) {
242453
+ p4.cancel(
242454
+ `You can specify a different target path like: \`inkeep add --${commandType} <${commandType}-template> --target-path <path>\``
242455
+ );
242456
+ process.exit(0);
242457
+ }
242458
+ s4.start("Cleaning existing directory...");
242459
+ await fs4.emptyDir(templateDir);
242460
+ s4.stop();
242461
+ }
242462
+ }
242463
+ function buildTemplateUrl(templateType, templateName) {
242464
+ return `https://github.com/inkeep/agents/agents-cookbook/${templateType}/${templateName}`;
242465
+ }
242466
+ async function addProjectTemplate(availableTemplates, template, targetPath, localPrefix) {
242396
242467
  if (!template) {
242397
242468
  console.log(chalk.yellow("Available templates:"));
242398
- for (const template2 of templates) {
242469
+ for (const template2 of availableTemplates) {
242399
242470
  console.log(chalk.gray(` \u2022 ${template2}`));
242400
242471
  }
242401
242472
  process.exit(0);
242402
242473
  } else {
242403
- if (!templates.includes(template)) {
242474
+ if (!availableTemplates.includes(template)) {
242404
242475
  console.error(`\u274C Template "${template}" not found`);
242405
242476
  process.exit(1);
242406
242477
  }
242478
+ const s4 = p4.spinner();
242407
242479
  const anthropicKey = process.env.ANTHROPIC_API_KEY;
242408
242480
  const openAiKey = process.env.OPENAI_API_KEY;
242409
242481
  const googleKey = process.env.GOOGLE_GENERATIVE_AI_API_KEY;
@@ -242428,12 +242500,10 @@ async function addProjectTemplate(template, targetPath, localPrefix) {
242428
242500
  "\u274C No AI provider key found in environment variables. Please set one of: ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_GENERATIVE_AI_API_KEY"
242429
242501
  );
242430
242502
  }
242431
- const baseDir = targetPath || process.cwd();
242432
- const templateDir = `${baseDir}/${template}`;
242433
- if (await fs4.pathExists(templateDir)) {
242434
- console.error(`\u274C Directory "${templateDir}" already exists`);
242435
- process.exit(1);
242436
- }
242503
+ const projectDirectory = await findAppDirectory("project");
242504
+ const baseDir = targetPath || projectDirectory;
242505
+ const templateDir = path4.join(baseDir, template);
242506
+ await checkTemplateDir(templateDir, "project");
242437
242507
  if (targetPath && !await fs4.pathExists(baseDir)) {
242438
242508
  try {
242439
242509
  await fs4.mkdir(baseDir, { recursive: true });
@@ -242444,45 +242514,47 @@ async function addProjectTemplate(template, targetPath, localPrefix) {
242444
242514
  process.exit(1);
242445
242515
  }
242446
242516
  }
242447
- const s4 = p4.spinner();
242448
242517
  s4.start("Adding template...");
242449
242518
  if (localPrefix && localPrefix.length > 0) {
242450
242519
  const fullTemplatePath = path4.join(localPrefix, "template-projects", template);
242451
242520
  await cloneTemplateLocal(fullTemplatePath, templateDir, contentReplacements);
242452
242521
  } else {
242453
- const fullTemplatePath = `https://github.com/inkeep/agents/agents-cookbook/template-projects/${template}`;
242522
+ const fullTemplatePath = buildTemplateUrl("template-projects", template);
242454
242523
  await cloneTemplate(fullTemplatePath, templateDir, contentReplacements);
242455
242524
  }
242456
242525
  s4.stop(`Template "${template}" added to ${templateDir}`);
242457
242526
  return;
242458
242527
  }
242459
242528
  }
242460
- async function addMcpTemplate(template, targetPath, spinner8, localPrefix) {
242461
- const templates = await getAvailableTemplates("template-mcps", localPrefix);
242529
+ async function addMcpTemplate(availableTemplates, template, targetPath, localPrefix) {
242462
242530
  if (!template) {
242463
242531
  console.log(chalk.yellow("Available templates:"));
242464
- for (const template2 of templates) {
242532
+ for (const template2 of availableTemplates) {
242465
242533
  console.log(chalk.gray(` \u2022 ${template2}`));
242466
242534
  }
242467
242535
  process.exit(0);
242468
242536
  }
242469
242537
  if (!targetPath) {
242470
- const foundPath = await findAppDirectory();
242471
- targetPath = `${foundPath}/${template}`;
242538
+ const foundPath = await findAppDirectory("mcp");
242539
+ targetPath = path4.join(foundPath, template);
242472
242540
  }
242541
+ await checkTemplateDir(targetPath, "mcp");
242542
+ const s4 = p4.spinner();
242543
+ s4.start("Adding template...");
242473
242544
  if (localPrefix && localPrefix.length > 0) {
242474
242545
  const fullTemplatePath = path4.join(localPrefix, "template-mcps", template);
242475
242546
  await cloneTemplateLocal(fullTemplatePath, targetPath);
242476
242547
  } else {
242477
- const fullTemplatePath = `https://github.com/inkeep/agents/agents-cookbook/template-mcps/${template}`;
242548
+ const fullTemplatePath = buildTemplateUrl("template-mcps", template);
242478
242549
  await cloneTemplate(fullTemplatePath, targetPath);
242479
242550
  }
242480
- spinner8.stop(`MCP template "${template}" added to ${targetPath}`);
242551
+ s4.stop(`MCP template "${template}" added to ${targetPath}`);
242481
242552
  }
242482
- async function findAppDirectory() {
242483
- const appDirectory = await findUp("apps/mcp/app", { type: "directory" });
242484
- if (!appDirectory || !appDirectory.includes("apps/mcp/app")) {
242485
- console.log(chalk.yellow(`\u26A0\uFE0F No app directory found.`));
242553
+ async function findAppDirectory(type) {
242554
+ const searchPath = type === "project" ? "src/projects" : "apps/mcp/app";
242555
+ const directory = await findUp(searchPath, { type: "directory" });
242556
+ if (!directory || !directory.includes(searchPath)) {
242557
+ console.log(chalk.yellow(`\u26A0\uFE0F No ${type} directory found.`));
242486
242558
  const continueAnyway = await p4.confirm({
242487
242559
  message: `Do you want to add to ${process.cwd()} instead?`
242488
242560
  });
@@ -242490,9 +242562,8 @@ async function findAppDirectory() {
242490
242562
  p4.cancel("Operation cancelled");
242491
242563
  process.exit(0);
242492
242564
  }
242493
- return process.cwd();
242494
242565
  }
242495
- return appDirectory;
242566
+ return directory || process.cwd();
242496
242567
  }
242497
242568
 
242498
242569
  // src/commands/config.ts
@@ -243510,7 +243581,7 @@ program.command("push").description("Push a project configuration to the backend
243510
243581
  });
243511
243582
  program.command("pull").description("Pull project configuration with clean, efficient code generation").option(
243512
243583
  "--project <project-id>",
243513
- "Override project ID (defaults to local project ID from index.ts)"
243584
+ "Project ID to pull (or path to project directory). If in project directory, validates against local project ID."
243514
243585
  ).option("--config <path>", "Path to configuration file").option(
243515
243586
  "--env <environment>",
243516
243587
  "Environment file to generate (development, staging, production). Defaults to development"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.33.2",
3
+ "version": "0.34.1",
4
4
  "description": "Inkeep CLI tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,8 +49,8 @@
49
49
  "ts-morph": "^26.0.0",
50
50
  "tsx": "^4.20.5",
51
51
  "open": "^10.2.0",
52
- "@inkeep/agents-core": "^0.33.2",
53
- "@inkeep/agents-sdk": "^0.33.2"
52
+ "@inkeep/agents-core": "^0.34.1",
53
+ "@inkeep/agents-sdk": "^0.34.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/degit": "^2.8.6",