@inkeep/agents-cli 0.24.1 → 0.24.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.
- package/dist/index.js +101 -21
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4824,6 +4824,7 @@ var init_contextConfigs = __esm({
|
|
|
4824
4824
|
"../packages/agents-core/src/data-access/contextConfigs.ts"() {
|
|
4825
4825
|
"use strict";
|
|
4826
4826
|
init_esm_shims();
|
|
4827
|
+
init_conversations();
|
|
4827
4828
|
init_schema();
|
|
4828
4829
|
}
|
|
4829
4830
|
});
|
|
@@ -217908,6 +217909,7 @@ var init_functionTools = __esm({
|
|
|
217908
217909
|
"../packages/agents-core/src/data-access/functionTools.ts"() {
|
|
217909
217910
|
"use strict";
|
|
217910
217911
|
init_esm_shims();
|
|
217912
|
+
init_conversations();
|
|
217911
217913
|
init_schema();
|
|
217912
217914
|
init_logger();
|
|
217913
217915
|
logger4 = getLogger("functionTools");
|
|
@@ -217920,6 +217922,7 @@ var init_subAgentRelations = __esm({
|
|
|
217920
217922
|
"../packages/agents-core/src/data-access/subAgentRelations.ts"() {
|
|
217921
217923
|
"use strict";
|
|
217922
217924
|
init_esm_shims();
|
|
217925
|
+
init_conversations();
|
|
217923
217926
|
init_schema();
|
|
217924
217927
|
}
|
|
217925
217928
|
});
|
|
@@ -217953,6 +217956,7 @@ var init_apiKeys = __esm({
|
|
|
217953
217956
|
init_esm_shims();
|
|
217954
217957
|
init_nanoid();
|
|
217955
217958
|
init_logger();
|
|
217959
|
+
init_conversations();
|
|
217956
217960
|
scryptAsync = promisify(scrypt);
|
|
217957
217961
|
logger5 = getLogger("api-key");
|
|
217958
217962
|
PUBLIC_ID_LENGTH = 12;
|
|
@@ -226841,6 +226845,7 @@ var init_tools = __esm({
|
|
|
226841
226845
|
"use strict";
|
|
226842
226846
|
init_esm_shims();
|
|
226843
226847
|
init_context5();
|
|
226848
|
+
init_conversations();
|
|
226844
226849
|
init_credential_stuffer();
|
|
226845
226850
|
init_schema();
|
|
226846
226851
|
init_types();
|
|
@@ -226859,6 +226864,7 @@ var init_agents = __esm({
|
|
|
226859
226864
|
"../packages/agents-core/src/data-access/agents.ts"() {
|
|
226860
226865
|
"use strict";
|
|
226861
226866
|
init_esm_shims();
|
|
226867
|
+
init_conversations();
|
|
226862
226868
|
init_schema();
|
|
226863
226869
|
init_contextConfigs();
|
|
226864
226870
|
init_externalAgents();
|
|
@@ -233370,6 +233376,7 @@ var init_artifactComponents = __esm({
|
|
|
233370
233376
|
"../packages/agents-core/src/data-access/artifactComponents.ts"() {
|
|
233371
233377
|
"use strict";
|
|
233372
233378
|
init_esm_shims();
|
|
233379
|
+
init_conversations();
|
|
233373
233380
|
init_schema();
|
|
233374
233381
|
init_props_validation();
|
|
233375
233382
|
}
|
|
@@ -233381,6 +233388,7 @@ var init_contextCache = __esm({
|
|
|
233381
233388
|
"../packages/agents-core/src/data-access/contextCache.ts"() {
|
|
233382
233389
|
"use strict";
|
|
233383
233390
|
init_esm_shims();
|
|
233391
|
+
init_conversations();
|
|
233384
233392
|
init_schema();
|
|
233385
233393
|
}
|
|
233386
233394
|
});
|
|
@@ -233410,6 +233418,7 @@ var init_dataComponents = __esm({
|
|
|
233410
233418
|
"../packages/agents-core/src/data-access/dataComponents.ts"() {
|
|
233411
233419
|
"use strict";
|
|
233412
233420
|
init_esm_shims();
|
|
233421
|
+
init_conversations();
|
|
233413
233422
|
init_schema();
|
|
233414
233423
|
init_preview_validation();
|
|
233415
233424
|
init_props_validation();
|
|
@@ -233431,6 +233440,7 @@ var init_agentFull2 = __esm({
|
|
|
233431
233440
|
"../packages/agents-core/src/data-access/agentFull.ts"() {
|
|
233432
233441
|
"use strict";
|
|
233433
233442
|
init_esm_shims();
|
|
233443
|
+
init_conversations();
|
|
233434
233444
|
init_schema();
|
|
233435
233445
|
init_agentFull();
|
|
233436
233446
|
init_agents();
|
|
@@ -233452,6 +233462,7 @@ var init_ledgerArtifacts = __esm({
|
|
|
233452
233462
|
"../packages/agents-core/src/data-access/ledgerArtifacts.ts"() {
|
|
233453
233463
|
"use strict";
|
|
233454
233464
|
init_esm_shims();
|
|
233465
|
+
init_conversations();
|
|
233455
233466
|
init_schema();
|
|
233456
233467
|
}
|
|
233457
233468
|
});
|
|
@@ -233563,6 +233574,7 @@ var init_contextCache2 = __esm({
|
|
|
233563
233574
|
"use strict";
|
|
233564
233575
|
init_esm_shims();
|
|
233565
233576
|
init_data_access();
|
|
233577
|
+
init_conversations();
|
|
233566
233578
|
init_logger();
|
|
233567
233579
|
logger8 = getLogger("context-cache");
|
|
233568
233580
|
}
|
|
@@ -237825,9 +237837,10 @@ import { Command } from "commander";
|
|
|
237825
237837
|
// src/commands/add.ts
|
|
237826
237838
|
init_esm_shims();
|
|
237827
237839
|
init_src();
|
|
237840
|
+
import * as p2 from "@clack/prompts";
|
|
237828
237841
|
import chalk from "chalk";
|
|
237842
|
+
import { findUp } from "find-up";
|
|
237829
237843
|
import fs3 from "fs-extra";
|
|
237830
|
-
import * as p2 from "@clack/prompts";
|
|
237831
237844
|
|
|
237832
237845
|
// src/utils/templates.ts
|
|
237833
237846
|
init_esm_shims();
|
|
@@ -237844,6 +237857,7 @@ async function cloneTemplate(templatePath, targetPath, replacements) {
|
|
|
237844
237857
|
await replaceContentInFiles(targetPath, replacements);
|
|
237845
237858
|
}
|
|
237846
237859
|
} catch (_error) {
|
|
237860
|
+
console.log(`\u274C Error cloning template: ${_error}`);
|
|
237847
237861
|
process.exit(1);
|
|
237848
237862
|
}
|
|
237849
237863
|
}
|
|
@@ -238001,9 +238015,9 @@ function injectPropertyIntoObject(content, propertyPath, replacement) {
|
|
|
238001
238015
|
console.warn(`Could not inject property "${propertyPath}" - no suitable object found in content`);
|
|
238002
238016
|
return content;
|
|
238003
238017
|
}
|
|
238004
|
-
async function getAvailableTemplates() {
|
|
238018
|
+
async function getAvailableTemplates(templatePath = "template-projects") {
|
|
238005
238019
|
const response = await fetch(
|
|
238006
|
-
|
|
238020
|
+
`https://api.github.com/repos/inkeep/agents-cookbook/contents/${templatePath}`
|
|
238007
238021
|
);
|
|
238008
238022
|
const contents = await response.json();
|
|
238009
238023
|
return contents.filter((item) => item.type === "dir").map((item) => item.name);
|
|
@@ -238044,21 +238058,55 @@ var defaultAnthropicModelConfigurations = {
|
|
|
238044
238058
|
}
|
|
238045
238059
|
};
|
|
238046
238060
|
async function addCommand(options) {
|
|
238061
|
+
const projectTemplates = await getAvailableTemplates("template-projects");
|
|
238062
|
+
const mcpTemplates = await getAvailableTemplates("template-mcps");
|
|
238063
|
+
if (!options.project && !options.mcp) {
|
|
238064
|
+
console.log(chalk.yellow("Available project templates:"));
|
|
238065
|
+
for (const template of projectTemplates) {
|
|
238066
|
+
console.log(chalk.gray(` \u2022 ${template}`));
|
|
238067
|
+
}
|
|
238068
|
+
console.log(chalk.yellow("Available MCP templates:"));
|
|
238069
|
+
for (const template of mcpTemplates) {
|
|
238070
|
+
console.log(chalk.gray(` \u2022 ${template}`));
|
|
238071
|
+
}
|
|
238072
|
+
process.exit(0);
|
|
238073
|
+
} else {
|
|
238074
|
+
if (options.project && !projectTemplates.includes(options.project)) {
|
|
238075
|
+
console.error(`\u274C Project template "${options.project}" not found`);
|
|
238076
|
+
process.exit(1);
|
|
238077
|
+
}
|
|
238078
|
+
if (options.mcp && !mcpTemplates.includes(options.mcp)) {
|
|
238079
|
+
console.error(`\u274C MCP template "${options.mcp}" not found`);
|
|
238080
|
+
process.exit(1);
|
|
238081
|
+
}
|
|
238082
|
+
const s2 = p2.spinner();
|
|
238083
|
+
s2.start("Adding template...");
|
|
238084
|
+
if (options.project) {
|
|
238085
|
+
await addProjectTemplate(options.project, options.targetPath);
|
|
238086
|
+
s2.stop(`Project template "${options.project}" added to ${options.targetPath}`);
|
|
238087
|
+
}
|
|
238088
|
+
if (options.mcp) {
|
|
238089
|
+
await addMcpTemplate(options.mcp, options.targetPath, s2);
|
|
238090
|
+
}
|
|
238091
|
+
return;
|
|
238092
|
+
}
|
|
238093
|
+
}
|
|
238094
|
+
async function addProjectTemplate(template, targetPath) {
|
|
238047
238095
|
const templates = await getAvailableTemplates();
|
|
238048
|
-
if (!
|
|
238096
|
+
if (!template) {
|
|
238049
238097
|
console.log(chalk.yellow("Available templates:"));
|
|
238050
|
-
for (const
|
|
238051
|
-
console.log(chalk.gray(` \u2022 ${
|
|
238098
|
+
for (const template2 of templates) {
|
|
238099
|
+
console.log(chalk.gray(` \u2022 ${template2}`));
|
|
238052
238100
|
}
|
|
238053
238101
|
process.exit(0);
|
|
238054
238102
|
} else {
|
|
238055
|
-
if (!templates.includes(
|
|
238056
|
-
console.error(`\u274C Template "${
|
|
238103
|
+
if (!templates.includes(template)) {
|
|
238104
|
+
console.error(`\u274C Template "${template}" not found`);
|
|
238057
238105
|
process.exit(1);
|
|
238058
238106
|
}
|
|
238059
238107
|
const anthropicKey = process.env.ANTHROPIC_API_KEY;
|
|
238060
238108
|
const openAiKey = process.env.OPENAI_API_KEY;
|
|
238061
|
-
const googleKey = process.env.
|
|
238109
|
+
const googleKey = process.env.GOOGLE_GENERATIVE_AI_API_KEY;
|
|
238062
238110
|
let defaultModelSettings = {};
|
|
238063
238111
|
if (anthropicKey) {
|
|
238064
238112
|
defaultModelSettings = defaultAnthropicModelConfigurations;
|
|
@@ -238080,13 +238128,13 @@ async function addCommand(options) {
|
|
|
238080
238128
|
"\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"
|
|
238081
238129
|
);
|
|
238082
238130
|
}
|
|
238083
|
-
const baseDir =
|
|
238084
|
-
const templateDir = `${baseDir}/${
|
|
238131
|
+
const baseDir = targetPath || process.cwd();
|
|
238132
|
+
const templateDir = `${baseDir}/${template}`;
|
|
238085
238133
|
if (await fs3.pathExists(templateDir)) {
|
|
238086
238134
|
console.error(`\u274C Directory "${templateDir}" already exists`);
|
|
238087
238135
|
process.exit(1);
|
|
238088
238136
|
}
|
|
238089
|
-
if (
|
|
238137
|
+
if (targetPath && !await fs3.pathExists(baseDir)) {
|
|
238090
238138
|
try {
|
|
238091
238139
|
await fs3.mkdir(baseDir, { recursive: true });
|
|
238092
238140
|
} catch (error) {
|
|
@@ -238098,12 +238146,44 @@ async function addCommand(options) {
|
|
|
238098
238146
|
}
|
|
238099
238147
|
const s2 = p2.spinner();
|
|
238100
238148
|
s2.start("Adding template...");
|
|
238101
|
-
const fullTemplatePath = `https://github.com/inkeep/agents-cookbook/template-projects/${
|
|
238149
|
+
const fullTemplatePath = `https://github.com/inkeep/agents-cookbook/template-projects/${template}`;
|
|
238102
238150
|
await cloneTemplate(fullTemplatePath, templateDir, contentReplacements);
|
|
238103
|
-
s2.stop(`Template "${
|
|
238151
|
+
s2.stop(`Template "${template}" added to ${templateDir}`);
|
|
238104
238152
|
return;
|
|
238105
238153
|
}
|
|
238106
238154
|
}
|
|
238155
|
+
async function addMcpTemplate(template, targetPath, s2) {
|
|
238156
|
+
const templates = await getAvailableTemplates("template-mcps");
|
|
238157
|
+
if (!template) {
|
|
238158
|
+
console.log(chalk.yellow("Available templates:"));
|
|
238159
|
+
for (const template2 of templates) {
|
|
238160
|
+
console.log(chalk.gray(` \u2022 ${template2}`));
|
|
238161
|
+
}
|
|
238162
|
+
process.exit(0);
|
|
238163
|
+
}
|
|
238164
|
+
if (!targetPath) {
|
|
238165
|
+
const foundPath = await findAppDirectory();
|
|
238166
|
+
targetPath = `${foundPath}/${template}`;
|
|
238167
|
+
}
|
|
238168
|
+
const fullTemplatePath = `https://github.com/inkeep/agents-cookbook/template-mcps/${template}`;
|
|
238169
|
+
await cloneTemplate(fullTemplatePath, targetPath);
|
|
238170
|
+
s2.stop(`MCP template "${template}" added to ${targetPath}`);
|
|
238171
|
+
}
|
|
238172
|
+
async function findAppDirectory() {
|
|
238173
|
+
const appDirectory = await findUp("apps/mcp/app", { type: "directory" });
|
|
238174
|
+
if (!appDirectory || !appDirectory.includes("apps/mcp/app")) {
|
|
238175
|
+
console.log(chalk.yellow(`\u26A0\uFE0F No app directory found.`));
|
|
238176
|
+
const continueAnyway = await p2.confirm({
|
|
238177
|
+
message: `Do you want to add to ${process.cwd()} instead?`
|
|
238178
|
+
});
|
|
238179
|
+
if (!continueAnyway) {
|
|
238180
|
+
p2.cancel("Operation cancelled");
|
|
238181
|
+
process.exit(0);
|
|
238182
|
+
}
|
|
238183
|
+
return process.cwd();
|
|
238184
|
+
}
|
|
238185
|
+
return appDirectory;
|
|
238186
|
+
}
|
|
238107
238187
|
|
|
238108
238188
|
// src/commands/config.ts
|
|
238109
238189
|
init_esm_shims();
|
|
@@ -238874,7 +238954,7 @@ init_config();
|
|
|
238874
238954
|
init_esm_shims();
|
|
238875
238955
|
import { existsSync as existsSync5 } from "fs";
|
|
238876
238956
|
import { join as join5, resolve as resolve3 } from "path";
|
|
238877
|
-
import { findUp } from "find-up";
|
|
238957
|
+
import { findUp as findUp2 } from "find-up";
|
|
238878
238958
|
async function findProjectDirectory(projectId, configPath) {
|
|
238879
238959
|
if (configPath) {
|
|
238880
238960
|
const absoluteConfigPath = resolve3(process.cwd(), configPath);
|
|
@@ -238896,7 +238976,7 @@ async function findProjectDirectory(projectId, configPath) {
|
|
|
238896
238976
|
}
|
|
238897
238977
|
return null;
|
|
238898
238978
|
}
|
|
238899
|
-
const foundConfigPath = await
|
|
238979
|
+
const foundConfigPath = await findUp2("inkeep.config.ts");
|
|
238900
238980
|
if (foundConfigPath) {
|
|
238901
238981
|
return resolve3(foundConfigPath, "..");
|
|
238902
238982
|
}
|
|
@@ -239309,8 +239389,8 @@ async function pullProjectCommand(options) {
|
|
|
239309
239389
|
}
|
|
239310
239390
|
}
|
|
239311
239391
|
if (!configFound) {
|
|
239312
|
-
const { findUp:
|
|
239313
|
-
const foundConfigPath = await
|
|
239392
|
+
const { findUp: findUp3 } = await import("find-up");
|
|
239393
|
+
const foundConfigPath = await findUp3("inkeep.config.ts", { cwd: searchDir });
|
|
239314
239394
|
if (foundConfigPath) {
|
|
239315
239395
|
try {
|
|
239316
239396
|
config = await loadProjectConfig(dirname5(foundConfigPath));
|
|
@@ -239990,11 +240070,11 @@ async function updateCommand(options = {}) {
|
|
|
239990
240070
|
\u{1F50D} Detected package manager: ${chalk11.cyan(packageManager)}`));
|
|
239991
240071
|
}
|
|
239992
240072
|
if (!options.force) {
|
|
239993
|
-
const
|
|
240073
|
+
const confirm4 = await p9.confirm({
|
|
239994
240074
|
message: `Update @inkeep/agents-cli from ${versionInfo.current} to ${versionInfo.latest}?`,
|
|
239995
240075
|
initialValue: true
|
|
239996
240076
|
});
|
|
239997
|
-
if (p9.isCancel(
|
|
240077
|
+
if (p9.isCancel(confirm4) || !confirm4) {
|
|
239998
240078
|
p9.cancel("Update cancelled");
|
|
239999
240079
|
process.exit(1);
|
|
240000
240080
|
}
|
|
@@ -240023,7 +240103,7 @@ var packageJsonPath = join13(__dirname3, "..", "package.json");
|
|
|
240023
240103
|
var packageJson = JSON.parse(readFileSync7(packageJsonPath, "utf-8"));
|
|
240024
240104
|
var program = new Command();
|
|
240025
240105
|
program.name("inkeep").description("CLI tool for Inkeep Agent Framework").version(packageJson.version);
|
|
240026
|
-
program.command("add [template]").description("Add a new template to the project").option("--target-path <path>", "Target path to add the template to").option("--config <path>", "Path to configuration file").action(async (template, options) => {
|
|
240106
|
+
program.command("add [template]").description("Add a new template to the project").option("--project <template>", "Project template to add").option("--mcp <template>", "MCP template to add").option("--target-path <path>", "Target path to add the template to").option("--config <path>", "Path to configuration file").action(async (template, options) => {
|
|
240027
240107
|
await addCommand({ template, ...options });
|
|
240028
240108
|
});
|
|
240029
240109
|
program.command("init [path]").description("Initialize a new Inkeep configuration file").option("--no-interactive", "Skip interactive path selection").option("--config <path>", "Path to use as template for new configuration").action(async (path4, options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"recast": "^0.23.0",
|
|
49
49
|
"ts-morph": "^26.0.0",
|
|
50
50
|
"tsx": "^4.20.5",
|
|
51
|
-
"@inkeep/agents-core": "^0.24.
|
|
52
|
-
"@inkeep/agents-sdk": "^0.24.
|
|
51
|
+
"@inkeep/agents-core": "^0.24.2",
|
|
52
|
+
"@inkeep/agents-sdk": "^0.24.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/degit": "^2.8.6",
|