@inkeep/agents-cli 0.33.1 → 0.34.0
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 +24 -0
- package/dist/index.js +116 -49
- package/package.json +3 -3
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
|
@@ -238,7 +238,8 @@ var init_defaults = __esm({
|
|
|
238
238
|
// CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: Maximum number of tokens from previous conversation messages
|
|
239
239
|
// to include in the LLM prompt. Prevents excessive token usage while maintaining relevant conversation context.
|
|
240
240
|
// Messages exceeding this limit are truncated from the beginning of the conversation.
|
|
241
|
-
|
|
241
|
+
// Increased from 4,000 to 8,000 to accommodate tool results in conversation history.
|
|
242
|
+
CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: 8e3
|
|
242
243
|
};
|
|
243
244
|
}
|
|
244
245
|
});
|
|
@@ -303,6 +304,7 @@ var init_models = __esm({
|
|
|
303
304
|
CLAUDE_3_5_HAIKU_20241022: "anthropic/claude-3-5-haiku-20241022"
|
|
304
305
|
};
|
|
305
306
|
OPENAI_MODELS = {
|
|
307
|
+
GPT_5_1: "openai/gpt-5.1",
|
|
306
308
|
GPT_5: "openai/gpt-5",
|
|
307
309
|
GPT_5_20250807: "openai/gpt-5-2025-08-07",
|
|
308
310
|
GPT_5_MINI: "openai/gpt-5-mini",
|
|
@@ -317,6 +319,7 @@ var init_models = __esm({
|
|
|
317
319
|
GPT_4_1_NANO_20250414: "openai/gpt-4.1-nano-2025-04-14"
|
|
318
320
|
};
|
|
319
321
|
GOOGLE_MODELS = {
|
|
322
|
+
GEMINI_3_PRO_PREVIEW: "google/gemini-3-pro-preview",
|
|
320
323
|
GEMINI_2_5_PRO: "google/gemini-2.5-pro",
|
|
321
324
|
GEMINI_2_5_FLASH: "google/gemini-2.5-flash",
|
|
322
325
|
GEMINI_2_5_FLASH_LITE: "google/gemini-2.5-flash-lite"
|
|
@@ -1693,9 +1696,13 @@ var init_schema = __esm({
|
|
|
1693
1696
|
...agentScoped,
|
|
1694
1697
|
...uiProperties,
|
|
1695
1698
|
prompt: text("prompt").notNull(),
|
|
1696
|
-
conversationHistoryConfig: jsonb(
|
|
1697
|
-
"
|
|
1698
|
-
|
|
1699
|
+
conversationHistoryConfig: jsonb("conversation_history_config").$type().default({
|
|
1700
|
+
mode: "full",
|
|
1701
|
+
limit: 50,
|
|
1702
|
+
maxOutputTokens: 4e3,
|
|
1703
|
+
includeInternal: false,
|
|
1704
|
+
messageTypes: ["chat", "tool-result"]
|
|
1705
|
+
}),
|
|
1699
1706
|
models: jsonb("models").$type(),
|
|
1700
1707
|
stopWhen: jsonb("stop_when").$type(),
|
|
1701
1708
|
...timestamps
|
|
@@ -3420,7 +3427,8 @@ var init_schemas = __esm({
|
|
|
3420
3427
|
version: z5.string().optional(),
|
|
3421
3428
|
createdAt: z5.date(),
|
|
3422
3429
|
updatedAt: z5.date(),
|
|
3423
|
-
expiresAt: z5.date().optional()
|
|
3430
|
+
expiresAt: z5.date().optional(),
|
|
3431
|
+
relationshipId: z5.string().optional()
|
|
3424
3432
|
}).openapi("McpTool");
|
|
3425
3433
|
MCPToolConfigSchema = McpToolSchema.omit({
|
|
3426
3434
|
config: true,
|
|
@@ -226103,7 +226111,7 @@ var init_error = __esm({
|
|
|
226103
226111
|
// description: "A URI reference that identifies the problem type.",
|
|
226104
226112
|
// example: `${ERROR_DOCS_BASE_URL}#${code}`,
|
|
226105
226113
|
// }),
|
|
226106
|
-
status: z5.
|
|
226114
|
+
status: z5.number().int().openapi({
|
|
226107
226115
|
description: "The HTTP status code.",
|
|
226108
226116
|
example: errorCodeToHttpStatus[code]
|
|
226109
226117
|
}),
|
|
@@ -234174,6 +234182,7 @@ var init_dataComponents = __esm({
|
|
|
234174
234182
|
"use strict";
|
|
234175
234183
|
init_esm_shims();
|
|
234176
234184
|
init_schema();
|
|
234185
|
+
init_utils();
|
|
234177
234186
|
init_conversations();
|
|
234178
234187
|
init_props_validation();
|
|
234179
234188
|
init_render_validation();
|
|
@@ -234226,7 +234235,7 @@ var init_contextCache = __esm({
|
|
|
234226
234235
|
});
|
|
234227
234236
|
|
|
234228
234237
|
// ../packages/agents-core/src/data-access/conversations.ts
|
|
234229
|
-
import { and as and17, count as count14, desc as desc14, eq as eq17 } from "drizzle-orm";
|
|
234238
|
+
import { and as and17, count as count14, desc as desc14, eq as eq17, inArray as inArray4 } from "drizzle-orm";
|
|
234230
234239
|
var init_conversations2 = __esm({
|
|
234231
234240
|
"../packages/agents-core/src/data-access/conversations.ts"() {
|
|
234232
234241
|
"use strict";
|
|
@@ -234248,7 +234257,7 @@ var init_ledgerArtifacts = __esm({
|
|
|
234248
234257
|
});
|
|
234249
234258
|
|
|
234250
234259
|
// ../packages/agents-core/src/data-access/messages.ts
|
|
234251
|
-
import { and as and19, asc as asc2, count as count16, desc as desc15, eq as eq19, inArray as
|
|
234260
|
+
import { and as and19, asc as asc2, count as count16, desc as desc15, eq as eq19, inArray as inArray5 } from "drizzle-orm";
|
|
234252
234261
|
var init_messages = __esm({
|
|
234253
234262
|
"../packages/agents-core/src/data-access/messages.ts"() {
|
|
234254
234263
|
"use strict";
|
|
@@ -239991,7 +240000,7 @@ function getAvailableModel() {
|
|
|
239991
240000
|
}
|
|
239992
240001
|
}
|
|
239993
240002
|
throw new Error(
|
|
239994
|
-
"No API keys detected. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or
|
|
240003
|
+
"No API keys detected. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_GENERATIVE_AI_API_KEY"
|
|
239995
240004
|
);
|
|
239996
240005
|
}
|
|
239997
240006
|
var PROVIDER_CONFIGS;
|
|
@@ -240008,11 +240017,11 @@ var init_model_provider_detector = __esm({
|
|
|
240008
240017
|
{
|
|
240009
240018
|
name: "openai",
|
|
240010
240019
|
envVars: ["OPENAI_API_KEY"],
|
|
240011
|
-
model: "gpt-
|
|
240020
|
+
model: "gpt-5.1"
|
|
240012
240021
|
},
|
|
240013
240022
|
{
|
|
240014
240023
|
name: "google",
|
|
240015
|
-
envVars: ["
|
|
240024
|
+
envVars: ["GOOGLE_GENERATIVE_AI_API_KEY"],
|
|
240016
240025
|
model: "gemini-2.5-flash"
|
|
240017
240026
|
}
|
|
240018
240027
|
];
|
|
@@ -240489,15 +240498,26 @@ async function validateTempDirectory(originalProjectRoot, tempDirName, remotePro
|
|
|
240489
240498
|
console.log(chalk11.green(` [Y] Yes - Replace files and clean up temp directory`));
|
|
240490
240499
|
console.log(chalk11.red(` [N] No - Keep temp directory for manual review`));
|
|
240491
240500
|
return new Promise((resolve6) => {
|
|
240501
|
+
if (isWaitingForInput && currentKeypressHandler) {
|
|
240502
|
+
process.stdin.removeListener("data", currentKeypressHandler);
|
|
240503
|
+
}
|
|
240492
240504
|
process.stdin.removeAllListeners("data");
|
|
240493
|
-
process.stdin.
|
|
240494
|
-
|
|
240495
|
-
|
|
240505
|
+
if (!process.stdin.isRaw) {
|
|
240506
|
+
process.stdin.setRawMode(true);
|
|
240507
|
+
}
|
|
240508
|
+
if (process.stdin.isPaused()) {
|
|
240509
|
+
process.stdin.resume();
|
|
240510
|
+
}
|
|
240496
240511
|
process.stdin.setEncoding("utf8");
|
|
240497
240512
|
const onKeypress = (key) => {
|
|
240513
|
+
if (!isWaitingForInput) {
|
|
240514
|
+
return;
|
|
240515
|
+
}
|
|
240516
|
+
isWaitingForInput = false;
|
|
240517
|
+
currentKeypressHandler = null;
|
|
240518
|
+
process.stdin.removeAllListeners("data");
|
|
240498
240519
|
process.stdin.setRawMode(false);
|
|
240499
240520
|
process.stdin.pause();
|
|
240500
|
-
process.stdin.removeAllListeners("data");
|
|
240501
240521
|
const normalizedKey = key.toLowerCase();
|
|
240502
240522
|
if (normalizedKey === "y") {
|
|
240503
240523
|
console.log(chalk11.green(`
|
|
@@ -240527,7 +240547,9 @@ async function validateTempDirectory(originalProjectRoot, tempDirName, remotePro
|
|
|
240527
240547
|
process.exit(0);
|
|
240528
240548
|
}
|
|
240529
240549
|
};
|
|
240530
|
-
|
|
240550
|
+
currentKeypressHandler = onKeypress;
|
|
240551
|
+
isWaitingForInput = true;
|
|
240552
|
+
process.stdin.once("data", onKeypress);
|
|
240531
240553
|
process.stdout.write(chalk11.cyan("\nPress [Y] for Yes or [N] for No: "));
|
|
240532
240554
|
});
|
|
240533
240555
|
} else {
|
|
@@ -240595,6 +240617,7 @@ function overwriteProjectFiles(originalProjectRoot, tempDirName, tempDir) {
|
|
|
240595
240617
|
console.log(chalk11.yellow(` Generated files remain in: ${tempDirName} for manual review`));
|
|
240596
240618
|
}
|
|
240597
240619
|
}
|
|
240620
|
+
var isWaitingForInput, currentKeypressHandler;
|
|
240598
240621
|
var init_project_validator = __esm({
|
|
240599
240622
|
"src/commands/pull-v3/project-validator.ts"() {
|
|
240600
240623
|
"use strict";
|
|
@@ -240602,6 +240625,8 @@ var init_project_validator = __esm({
|
|
|
240602
240625
|
init_pull_v3();
|
|
240603
240626
|
init_project_comparator();
|
|
240604
240627
|
init_component_registry();
|
|
240628
|
+
isWaitingForInput = false;
|
|
240629
|
+
currentKeypressHandler = null;
|
|
240605
240630
|
}
|
|
240606
240631
|
});
|
|
240607
240632
|
|
|
@@ -241708,42 +241733,68 @@ async function pullV3Command(options) {
|
|
|
241708
241733
|
});
|
|
241709
241734
|
s4.start("Detecting project...");
|
|
241710
241735
|
let projectDir;
|
|
241711
|
-
|
|
241712
|
-
|
|
241713
|
-
|
|
241714
|
-
|
|
241715
|
-
|
|
241716
|
-
|
|
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)}`
|
|
241717
241766
|
);
|
|
241718
|
-
process.exit(1);
|
|
241719
241767
|
}
|
|
241720
241768
|
} else {
|
|
241721
|
-
|
|
241722
|
-
if (existsSync12(join15(currentDir, "index.ts"))) {
|
|
241723
|
-
projectDir = currentDir;
|
|
241724
|
-
} else {
|
|
241769
|
+
if (!options.project) {
|
|
241725
241770
|
s4.stop("No index.ts found in current directory");
|
|
241726
241771
|
console.error(
|
|
241727
241772
|
chalk14.yellow(
|
|
241728
|
-
"Please run this command from a directory containing index.ts or use --project <
|
|
241773
|
+
"Please run this command from a directory containing index.ts or use --project <project-id>"
|
|
241729
241774
|
)
|
|
241730
241775
|
);
|
|
241731
241776
|
process.exit(1);
|
|
241732
241777
|
}
|
|
241733
|
-
|
|
241734
|
-
|
|
241735
|
-
|
|
241736
|
-
|
|
241737
|
-
|
|
241738
|
-
|
|
241739
|
-
|
|
241740
|
-
|
|
241741
|
-
|
|
241742
|
-
|
|
241743
|
-
|
|
241744
|
-
|
|
241745
|
-
|
|
241746
|
-
|
|
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
|
+
}
|
|
241747
241798
|
}
|
|
241748
241799
|
s4.start(`Fetching project: ${projectId}`);
|
|
241749
241800
|
const apiClient = await ManagementApiClient.create(
|
|
@@ -242017,7 +242068,7 @@ var envSchema2 = z15.object({
|
|
|
242017
242068
|
// Secrets loaded from .env files (relative to where CLI is executed)
|
|
242018
242069
|
ANTHROPIC_API_KEY: z15.string().optional(),
|
|
242019
242070
|
OPENAI_API_KEY: z15.string().optional(),
|
|
242020
|
-
|
|
242071
|
+
GOOGLE_GENERATIVE_AI_API_KEY: z15.string().optional(),
|
|
242021
242072
|
// Langfuse configuration for LLM observability
|
|
242022
242073
|
LANGFUSE_SECRET_KEY: z15.string().optional(),
|
|
242023
242074
|
LANGFUSE_PUBLIC_KEY: z15.string().optional(),
|
|
@@ -242292,13 +242343,29 @@ async function getAvailableTemplates(templatePath = "template-projects", local)
|
|
|
242292
242343
|
}
|
|
242293
242344
|
}
|
|
242294
242345
|
return directories;
|
|
242295
|
-
}
|
|
242296
|
-
|
|
242297
|
-
|
|
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.`
|
|
242353
|
+
);
|
|
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"
|
|
242298
242366
|
);
|
|
242299
|
-
const contents = await response.json();
|
|
242300
|
-
return contents.filter((item) => item.type === "dir" && item.name !== "weather-project").map((item) => item.name);
|
|
242301
242367
|
}
|
|
242368
|
+
return contents.filter((item) => item.type === "dir" && item.name !== "weather-project").map((item) => item.name);
|
|
242302
242369
|
}
|
|
242303
242370
|
|
|
242304
242371
|
// src/commands/add.ts
|
|
@@ -243488,7 +243555,7 @@ program.command("push").description("Push a project configuration to the backend
|
|
|
243488
243555
|
});
|
|
243489
243556
|
program.command("pull").description("Pull project configuration with clean, efficient code generation").option(
|
|
243490
243557
|
"--project <project-id>",
|
|
243491
|
-
"
|
|
243558
|
+
"Project ID to pull (or path to project directory). If in project directory, validates against local project ID."
|
|
243492
243559
|
).option("--config <path>", "Path to configuration file").option(
|
|
243493
243560
|
"--env <environment>",
|
|
243494
243561
|
"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.
|
|
3
|
+
"version": "0.34.0",
|
|
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.
|
|
53
|
-
"@inkeep/agents-sdk": "^0.
|
|
52
|
+
"@inkeep/agents-core": "^0.34.0",
|
|
53
|
+
"@inkeep/agents-sdk": "^0.34.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/degit": "^2.8.6",
|