@inkeep/agents-cli 0.31.1 → 0.31.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 +152 -148
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -234538,6 +234538,62 @@ ${errorText}` : ""}`
|
|
|
234538
234538
|
}
|
|
234539
234539
|
});
|
|
234540
234540
|
|
|
234541
|
+
// src/utils/cli-pipeline.ts
|
|
234542
|
+
import * as p4 from "@clack/prompts";
|
|
234543
|
+
import chalk5 from "chalk";
|
|
234544
|
+
async function initializeCommand(options = {}) {
|
|
234545
|
+
const {
|
|
234546
|
+
configPath,
|
|
234547
|
+
showSpinner = false,
|
|
234548
|
+
spinnerText = "Loading configuration...",
|
|
234549
|
+
logConfig = true
|
|
234550
|
+
} = options;
|
|
234551
|
+
const s = showSpinner ? p4.spinner() : void 0;
|
|
234552
|
+
if (s) {
|
|
234553
|
+
s.start(spinnerText);
|
|
234554
|
+
}
|
|
234555
|
+
try {
|
|
234556
|
+
const config = await validateConfiguration(configPath);
|
|
234557
|
+
if (s) {
|
|
234558
|
+
s.stop("Configuration loaded");
|
|
234559
|
+
}
|
|
234560
|
+
if (logConfig) {
|
|
234561
|
+
console.log(chalk5.gray("Configuration:"));
|
|
234562
|
+
console.log(chalk5.gray(` \u2022 Tenant ID: ${config.tenantId}`));
|
|
234563
|
+
console.log(chalk5.gray(` \u2022 Manage API URL: ${config.agentsManageApiUrl}`));
|
|
234564
|
+
console.log(chalk5.gray(` \u2022 Run API URL: ${config.agentsRunApiUrl}`));
|
|
234565
|
+
if (config.sources.configFile) {
|
|
234566
|
+
console.log(chalk5.gray(` \u2022 Config file: ${config.sources.configFile}`));
|
|
234567
|
+
}
|
|
234568
|
+
}
|
|
234569
|
+
return { config };
|
|
234570
|
+
} catch (error) {
|
|
234571
|
+
if (s) {
|
|
234572
|
+
s.stop("Configuration failed");
|
|
234573
|
+
}
|
|
234574
|
+
console.error(chalk5.red("Error:"), error.message);
|
|
234575
|
+
if (error.message.includes("No configuration found")) {
|
|
234576
|
+
console.log(chalk5.yellow("\nHint: Create a configuration file by running:"));
|
|
234577
|
+
console.log(chalk5.gray(" inkeep init"));
|
|
234578
|
+
} else if (error.message.includes("Config file not found")) {
|
|
234579
|
+
console.log(chalk5.yellow("\nHint: Check that your config file path is correct"));
|
|
234580
|
+
} else if (error.message.includes("tenantId") || error.message.includes("API URL")) {
|
|
234581
|
+
console.log(chalk5.yellow("\nHint: Ensure your inkeep.config.ts has all required fields:"));
|
|
234582
|
+
console.log(chalk5.gray(" - tenantId"));
|
|
234583
|
+
console.log(chalk5.gray(" - agentsManageApiUrl (or agentsManageApi.url)"));
|
|
234584
|
+
console.log(chalk5.gray(" - agentsRunApiUrl (or agentsRunApi.url)"));
|
|
234585
|
+
}
|
|
234586
|
+
process.exit(1);
|
|
234587
|
+
}
|
|
234588
|
+
}
|
|
234589
|
+
var init_cli_pipeline = __esm({
|
|
234590
|
+
"src/utils/cli-pipeline.ts"() {
|
|
234591
|
+
"use strict";
|
|
234592
|
+
init_esm_shims();
|
|
234593
|
+
init_config();
|
|
234594
|
+
}
|
|
234595
|
+
});
|
|
234596
|
+
|
|
234541
234597
|
// src/utils/version-check.ts
|
|
234542
234598
|
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
|
|
234543
234599
|
import { dirname as dirname4, join as join5 } from "path";
|
|
@@ -234634,6 +234690,38 @@ var init_background_version_check = __esm({
|
|
|
234634
234690
|
}
|
|
234635
234691
|
});
|
|
234636
234692
|
|
|
234693
|
+
// src/utils/project-loader.ts
|
|
234694
|
+
var project_loader_exports = {};
|
|
234695
|
+
__export(project_loader_exports, {
|
|
234696
|
+
loadProject: () => loadProject
|
|
234697
|
+
});
|
|
234698
|
+
import { existsSync as existsSync6 } from "fs";
|
|
234699
|
+
import { join as join6 } from "path";
|
|
234700
|
+
async function loadProject(projectDir) {
|
|
234701
|
+
const indexPath = join6(projectDir, "index.ts");
|
|
234702
|
+
if (!existsSync6(indexPath)) {
|
|
234703
|
+
throw new Error(`index.ts not found in project directory: ${projectDir}`);
|
|
234704
|
+
}
|
|
234705
|
+
const module = await importWithTypeScriptSupport(indexPath);
|
|
234706
|
+
const exports = Object.keys(module);
|
|
234707
|
+
for (const exportKey of exports) {
|
|
234708
|
+
const value = module[exportKey];
|
|
234709
|
+
if (value && typeof value === "object" && value.__type === "project") {
|
|
234710
|
+
return value;
|
|
234711
|
+
}
|
|
234712
|
+
}
|
|
234713
|
+
throw new Error(
|
|
234714
|
+
'No project export found in index.ts. Expected an export with __type = "project"'
|
|
234715
|
+
);
|
|
234716
|
+
}
|
|
234717
|
+
var init_project_loader = __esm({
|
|
234718
|
+
"src/utils/project-loader.ts"() {
|
|
234719
|
+
"use strict";
|
|
234720
|
+
init_esm_shims();
|
|
234721
|
+
init_tsx_loader();
|
|
234722
|
+
}
|
|
234723
|
+
});
|
|
234724
|
+
|
|
234637
234725
|
// src/commands/pull-v3/utils/generator-utils.ts
|
|
234638
234726
|
function toCamelCase(str) {
|
|
234639
234727
|
const result = str.replace(/[-_](.)/g, (_, char) => char.toUpperCase()).replace(/[^a-zA-Z0-9]/g, "").replace(/^[0-9]/, "_$&");
|
|
@@ -237265,7 +237353,7 @@ var init_component_registry = __esm({
|
|
|
237265
237353
|
|
|
237266
237354
|
// src/commands/pull-v3/introspect-generator.ts
|
|
237267
237355
|
import { mkdirSync, writeFileSync as writeFileSync3 } from "fs";
|
|
237268
|
-
import { dirname as dirname5, join as
|
|
237356
|
+
import { dirname as dirname5, join as join7 } from "path";
|
|
237269
237357
|
import chalk8 from "chalk";
|
|
237270
237358
|
function ensureDir(filePath) {
|
|
237271
237359
|
const dir = dirname5(filePath);
|
|
@@ -237282,14 +237370,14 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237282
237370
|
registerAllComponents(project, registry2);
|
|
237283
237371
|
if (project.credentialReferences) {
|
|
237284
237372
|
for (const [credId, credData] of Object.entries(project.credentialReferences)) {
|
|
237285
|
-
const credentialFile =
|
|
237373
|
+
const credentialFile = join7(paths.credentialsDir, `${credId}.ts`);
|
|
237286
237374
|
const credentialContent = generateCredentialFile(credId, credData, style);
|
|
237287
237375
|
ensureDir(credentialFile);
|
|
237288
237376
|
writeFileSync3(credentialFile, credentialContent, "utf-8");
|
|
237289
237377
|
generatedFiles.push(credentialFile);
|
|
237290
237378
|
}
|
|
237291
237379
|
}
|
|
237292
|
-
const envFile =
|
|
237380
|
+
const envFile = join7(paths.environmentsDir, `${environment}.env.ts`);
|
|
237293
237381
|
const envData = {
|
|
237294
237382
|
name: `${environment} Environment`,
|
|
237295
237383
|
description: `Environment configuration for ${environment}`,
|
|
@@ -237300,7 +237388,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237300
237388
|
ensureDir(envFile);
|
|
237301
237389
|
writeFileSync3(envFile, envContent, "utf-8");
|
|
237302
237390
|
generatedFiles.push(envFile);
|
|
237303
|
-
const envIndexFile =
|
|
237391
|
+
const envIndexFile = join7(paths.environmentsDir, "index.ts");
|
|
237304
237392
|
const environments = [environment];
|
|
237305
237393
|
const envIndexContent = generateEnvironmentIndexFile(environments, style);
|
|
237306
237394
|
ensureDir(envIndexFile);
|
|
@@ -237308,7 +237396,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237308
237396
|
generatedFiles.push(envIndexFile);
|
|
237309
237397
|
if (project.functions) {
|
|
237310
237398
|
for (const [funcId, funcData] of Object.entries(project.functions)) {
|
|
237311
|
-
const functionFile =
|
|
237399
|
+
const functionFile = join7(paths.toolsDir, "functions", `${funcId}.ts`);
|
|
237312
237400
|
const functionContent = generateFunctionToolFile(funcId, funcData, style);
|
|
237313
237401
|
ensureDir(functionFile);
|
|
237314
237402
|
writeFileSync3(functionFile, functionContent, "utf-8");
|
|
@@ -237317,7 +237405,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237317
237405
|
}
|
|
237318
237406
|
if (project.tools) {
|
|
237319
237407
|
for (const [toolId, toolData] of Object.entries(project.tools)) {
|
|
237320
|
-
const toolFile =
|
|
237408
|
+
const toolFile = join7(paths.toolsDir, `${toolId}.ts`);
|
|
237321
237409
|
const toolContent = generateMcpToolFile(toolId, toolData, style, registry2);
|
|
237322
237410
|
ensureDir(toolFile);
|
|
237323
237411
|
writeFileSync3(toolFile, toolContent, "utf-8");
|
|
@@ -237326,7 +237414,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237326
237414
|
}
|
|
237327
237415
|
if (project.dataComponents) {
|
|
237328
237416
|
for (const [dataId, dataData] of Object.entries(project.dataComponents)) {
|
|
237329
|
-
const dataFile =
|
|
237417
|
+
const dataFile = join7(paths.dataComponentsDir, `${dataId}.ts`);
|
|
237330
237418
|
const dataContent = generateDataComponentFile(dataId, dataData, style);
|
|
237331
237419
|
ensureDir(dataFile);
|
|
237332
237420
|
writeFileSync3(dataFile, dataContent, "utf-8");
|
|
@@ -237335,7 +237423,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237335
237423
|
}
|
|
237336
237424
|
if (project.artifactComponents) {
|
|
237337
237425
|
for (const [artifactId, artifactData] of Object.entries(project.artifactComponents)) {
|
|
237338
|
-
const artifactFile =
|
|
237426
|
+
const artifactFile = join7(paths.artifactComponentsDir, `${artifactId}.ts`);
|
|
237339
237427
|
const artifactContent = generateArtifactComponentFile(artifactId, artifactData, style);
|
|
237340
237428
|
ensureDir(artifactFile);
|
|
237341
237429
|
writeFileSync3(artifactFile, artifactContent, "utf-8");
|
|
@@ -237347,7 +237435,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237347
237435
|
for (const statusComp of registeredStatusComponents) {
|
|
237348
237436
|
const statusData = findStatusComponentData(project, statusComp.id);
|
|
237349
237437
|
if (statusData) {
|
|
237350
|
-
const statusFile =
|
|
237438
|
+
const statusFile = join7(paths.statusComponentsDir, `${statusComp.id}.ts`);
|
|
237351
237439
|
const statusContent = generateStatusComponentFile(statusComp.id, statusData, style);
|
|
237352
237440
|
ensureDir(statusFile);
|
|
237353
237441
|
writeFileSync3(statusFile, statusContent, "utf-8");
|
|
@@ -237357,7 +237445,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237357
237445
|
}
|
|
237358
237446
|
if (project.externalAgents) {
|
|
237359
237447
|
for (const [extAgentId, extAgentData] of Object.entries(project.externalAgents)) {
|
|
237360
|
-
const extAgentFile =
|
|
237448
|
+
const extAgentFile = join7(paths.externalAgentsDir, `${extAgentId}.ts`);
|
|
237361
237449
|
const extAgentContent = generateExternalAgentFile(
|
|
237362
237450
|
extAgentId,
|
|
237363
237451
|
extAgentData,
|
|
@@ -237374,7 +237462,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237374
237462
|
for (const contextComp of registeredContextConfigs) {
|
|
237375
237463
|
const contextData = findContextConfigData(project, contextComp.id);
|
|
237376
237464
|
if (contextData) {
|
|
237377
|
-
const contextFile =
|
|
237465
|
+
const contextFile = join7(paths.contextConfigsDir, `${contextComp.id}.ts`);
|
|
237378
237466
|
const contextContent = generateContextConfigFile(
|
|
237379
237467
|
contextComp.id,
|
|
237380
237468
|
contextData,
|
|
@@ -237401,7 +237489,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237401
237489
|
if (agentData.subAgents) {
|
|
237402
237490
|
const contextConfigData = agentData.contextConfig?.id ? findContextConfigData(project, agentData.contextConfig.id) : void 0;
|
|
237403
237491
|
for (const [subAgentId, subAgentData] of Object.entries(agentData.subAgents)) {
|
|
237404
|
-
const subAgentFile =
|
|
237492
|
+
const subAgentFile = join7(paths.agentsDir, "sub-agents", `${subAgentId}.ts`);
|
|
237405
237493
|
const parentModels = agentData.models || project.models;
|
|
237406
237494
|
const subAgentContent = generateSubAgentFile(
|
|
237407
237495
|
subAgentId,
|
|
@@ -237422,7 +237510,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237422
237510
|
}
|
|
237423
237511
|
if (project.agents) {
|
|
237424
237512
|
for (const [agentId, agentData] of Object.entries(project.agents)) {
|
|
237425
|
-
const agentFile =
|
|
237513
|
+
const agentFile = join7(paths.agentsDir, `${agentId}.ts`);
|
|
237426
237514
|
const contextConfigData = agentData.contextConfig?.id ? findContextConfigData(project, agentData.contextConfig.id) : void 0;
|
|
237427
237515
|
const agentContent = generateAgentFile(
|
|
237428
237516
|
agentId,
|
|
@@ -237447,7 +237535,7 @@ async function introspectGenerate(project, paths, environment, debug, options =
|
|
|
237447
237535
|
artifactComponents: project.artifactComponents ? Object.keys(project.artifactComponents) : [],
|
|
237448
237536
|
credentialReferences: project.credentialReferences ? Object.keys(project.credentialReferences) : []
|
|
237449
237537
|
};
|
|
237450
|
-
const projectFile =
|
|
237538
|
+
const projectFile = join7(paths.projectRoot, "index.ts");
|
|
237451
237539
|
const projectContent = generateProjectFile(
|
|
237452
237540
|
project.id,
|
|
237453
237541
|
projectDataForGenerator,
|
|
@@ -238451,38 +238539,6 @@ var init_project_comparator = __esm({
|
|
|
238451
238539
|
}
|
|
238452
238540
|
});
|
|
238453
238541
|
|
|
238454
|
-
// src/utils/project-loader.ts
|
|
238455
|
-
var project_loader_exports = {};
|
|
238456
|
-
__export(project_loader_exports, {
|
|
238457
|
-
loadProject: () => loadProject
|
|
238458
|
-
});
|
|
238459
|
-
import { existsSync as existsSync6 } from "fs";
|
|
238460
|
-
import { join as join7 } from "path";
|
|
238461
|
-
async function loadProject(projectDir) {
|
|
238462
|
-
const indexPath = join7(projectDir, "index.ts");
|
|
238463
|
-
if (!existsSync6(indexPath)) {
|
|
238464
|
-
throw new Error(`index.ts not found in project directory: ${projectDir}`);
|
|
238465
|
-
}
|
|
238466
|
-
const module = await importWithTypeScriptSupport(indexPath);
|
|
238467
|
-
const exports = Object.keys(module);
|
|
238468
|
-
for (const exportKey of exports) {
|
|
238469
|
-
const value = module[exportKey];
|
|
238470
|
-
if (value && typeof value === "object" && value.__type === "project") {
|
|
238471
|
-
return value;
|
|
238472
|
-
}
|
|
238473
|
-
}
|
|
238474
|
-
throw new Error(
|
|
238475
|
-
'No project export found in index.ts. Expected an export with __type = "project"'
|
|
238476
|
-
);
|
|
238477
|
-
}
|
|
238478
|
-
var init_project_loader = __esm({
|
|
238479
|
-
"src/utils/project-loader.ts"() {
|
|
238480
|
-
"use strict";
|
|
238481
|
-
init_esm_shims();
|
|
238482
|
-
init_tsx_loader();
|
|
238483
|
-
}
|
|
238484
|
-
});
|
|
238485
|
-
|
|
238486
238542
|
// src/commands/pull-v3/component-parser.ts
|
|
238487
238543
|
var component_parser_exports = {};
|
|
238488
238544
|
__export(component_parser_exports, {
|
|
@@ -240262,35 +240318,9 @@ var init_project_index_generator = __esm({
|
|
|
240262
240318
|
|
|
240263
240319
|
// src/commands/pull-v3/index.ts
|
|
240264
240320
|
import { existsSync as existsSync11, mkdirSync as mkdirSync5 } from "fs";
|
|
240265
|
-
import {
|
|
240321
|
+
import { join as join13, resolve as resolve3 } from "path";
|
|
240266
240322
|
import * as p6 from "@clack/prompts";
|
|
240267
240323
|
import chalk14 from "chalk";
|
|
240268
|
-
async function loadProjectConfig(projectDir, configPathOverride) {
|
|
240269
|
-
const configPath = configPathOverride ? resolve3(process.cwd(), configPathOverride) : join13(projectDir, "inkeep.config.ts");
|
|
240270
|
-
if (!existsSync11(configPath)) {
|
|
240271
|
-
throw new Error(`Configuration file not found: ${configPath}`);
|
|
240272
|
-
}
|
|
240273
|
-
try {
|
|
240274
|
-
const config = await loadConfig(configPath);
|
|
240275
|
-
if (!config.tenantId) {
|
|
240276
|
-
throw new Error("tenantId is required in inkeep.config.ts");
|
|
240277
|
-
}
|
|
240278
|
-
return {
|
|
240279
|
-
tenantId: config.tenantId,
|
|
240280
|
-
agentsManageApi: {
|
|
240281
|
-
url: config.agentsManageApiUrl || "http://localhost:3002",
|
|
240282
|
-
...config.agentsManageApiKey && { apiKey: config.agentsManageApiKey }
|
|
240283
|
-
},
|
|
240284
|
-
agentsRunApi: {
|
|
240285
|
-
url: config.agentsRunApiUrl || "http://localhost:3003",
|
|
240286
|
-
...config.agentsRunApiKey && { apiKey: config.agentsRunApiKey }
|
|
240287
|
-
},
|
|
240288
|
-
outputDirectory: config.outputDirectory
|
|
240289
|
-
};
|
|
240290
|
-
} catch (error) {
|
|
240291
|
-
throw new Error(`Failed to load configuration: ${error.message}`);
|
|
240292
|
-
}
|
|
240293
|
-
}
|
|
240294
240324
|
function createProjectStructure(projectDir, projectId) {
|
|
240295
240325
|
const projectRoot = projectDir;
|
|
240296
240326
|
const paths = {
|
|
@@ -240437,31 +240467,54 @@ async function pullV3Command(options) {
|
|
|
240437
240467
|
}
|
|
240438
240468
|
const s = p6.spinner();
|
|
240439
240469
|
try {
|
|
240440
|
-
|
|
240441
|
-
|
|
240442
|
-
|
|
240443
|
-
|
|
240444
|
-
|
|
240445
|
-
|
|
240446
|
-
|
|
240447
|
-
|
|
240448
|
-
|
|
240470
|
+
const { config } = await initializeCommand({
|
|
240471
|
+
configPath: options.config,
|
|
240472
|
+
showSpinner: true,
|
|
240473
|
+
spinnerText: "Loading configuration...",
|
|
240474
|
+
logConfig: true
|
|
240475
|
+
});
|
|
240476
|
+
s.start("Detecting project...");
|
|
240477
|
+
let projectDir;
|
|
240478
|
+
if (options.project) {
|
|
240479
|
+
projectDir = resolve3(process.cwd(), options.project);
|
|
240480
|
+
if (!existsSync11(join13(projectDir, "index.ts"))) {
|
|
240481
|
+
s.stop(`No index.ts found in specified project directory: ${projectDir}`);
|
|
240482
|
+
console.error(
|
|
240483
|
+
chalk14.yellow("The specified project directory must contain an index.ts file")
|
|
240484
|
+
);
|
|
240485
|
+
process.exit(1);
|
|
240449
240486
|
}
|
|
240450
240487
|
} else {
|
|
240451
|
-
const
|
|
240452
|
-
if (existsSync11(
|
|
240453
|
-
|
|
240488
|
+
const currentDir = process.cwd();
|
|
240489
|
+
if (existsSync11(join13(currentDir, "index.ts"))) {
|
|
240490
|
+
projectDir = currentDir;
|
|
240454
240491
|
} else {
|
|
240455
|
-
|
|
240492
|
+
s.stop("No index.ts found in current directory");
|
|
240493
|
+
console.error(
|
|
240494
|
+
chalk14.yellow(
|
|
240495
|
+
"Please run this command from a directory containing index.ts or use --project <path>"
|
|
240496
|
+
)
|
|
240497
|
+
);
|
|
240498
|
+
process.exit(1);
|
|
240456
240499
|
}
|
|
240457
240500
|
}
|
|
240458
|
-
|
|
240459
|
-
|
|
240460
|
-
|
|
240501
|
+
s.stop(`Project found: ${projectDir}`);
|
|
240502
|
+
s.start("Loading local project to get project ID...");
|
|
240503
|
+
let localProjectForId;
|
|
240504
|
+
let projectId;
|
|
240505
|
+
try {
|
|
240506
|
+
localProjectForId = await loadProject(projectDir);
|
|
240507
|
+
projectId = localProjectForId.getId();
|
|
240508
|
+
s.stop(`Project ID: ${projectId}`);
|
|
240509
|
+
} catch (error) {
|
|
240510
|
+
s.stop("Failed to load local project");
|
|
240511
|
+
throw new Error(
|
|
240512
|
+
`Could not determine project ID. Local project failed to load: ${error instanceof Error ? error.message : String(error)}`
|
|
240513
|
+
);
|
|
240461
240514
|
}
|
|
240462
|
-
s.
|
|
240515
|
+
s.start(`Fetching project: ${projectId}`);
|
|
240463
240516
|
const apiClient = await ManagementApiClient.create(
|
|
240464
|
-
config.
|
|
240517
|
+
config.agentsManageApiUrl,
|
|
240465
240518
|
options.config,
|
|
240466
240519
|
config.tenantId,
|
|
240467
240520
|
projectId
|
|
@@ -240547,8 +240600,6 @@ async function pullV3Command(options) {
|
|
|
240547
240600
|
restoreLogLevel();
|
|
240548
240601
|
return;
|
|
240549
240602
|
}
|
|
240550
|
-
const outputDir = config.outputDirectory && config.outputDirectory !== "default" ? config.outputDirectory : process.cwd();
|
|
240551
|
-
const projectDir = resolve3(outputDir, projectId);
|
|
240552
240603
|
const paths = createProjectStructure(projectDir, projectId);
|
|
240553
240604
|
if (options.introspect) {
|
|
240554
240605
|
console.log(chalk14.yellow("\n\u{1F50D} Introspect mode: Regenerating all files from scratch"));
|
|
@@ -240722,7 +240773,8 @@ var init_pull_v3 = __esm({
|
|
|
240722
240773
|
init_esm_shims();
|
|
240723
240774
|
init_api();
|
|
240724
240775
|
init_background_version_check();
|
|
240725
|
-
|
|
240776
|
+
init_cli_pipeline();
|
|
240777
|
+
init_project_loader();
|
|
240726
240778
|
init_introspect_generator();
|
|
240727
240779
|
init_project_comparator();
|
|
240728
240780
|
init_component_registry();
|
|
@@ -241752,62 +241804,10 @@ Note: Config file created in ${configDir}`));
|
|
|
241752
241804
|
// src/commands/list-agents.ts
|
|
241753
241805
|
init_esm_shims();
|
|
241754
241806
|
init_api();
|
|
241807
|
+
init_cli_pipeline();
|
|
241755
241808
|
import * as p5 from "@clack/prompts";
|
|
241756
241809
|
import chalk6 from "chalk";
|
|
241757
241810
|
import Table from "cli-table3";
|
|
241758
|
-
|
|
241759
|
-
// src/utils/cli-pipeline.ts
|
|
241760
|
-
init_esm_shims();
|
|
241761
|
-
init_config();
|
|
241762
|
-
import * as p4 from "@clack/prompts";
|
|
241763
|
-
import chalk5 from "chalk";
|
|
241764
|
-
async function initializeCommand(options = {}) {
|
|
241765
|
-
const {
|
|
241766
|
-
configPath,
|
|
241767
|
-
showSpinner = false,
|
|
241768
|
-
spinnerText = "Loading configuration...",
|
|
241769
|
-
logConfig = true
|
|
241770
|
-
} = options;
|
|
241771
|
-
const s = showSpinner ? p4.spinner() : void 0;
|
|
241772
|
-
if (s) {
|
|
241773
|
-
s.start(spinnerText);
|
|
241774
|
-
}
|
|
241775
|
-
try {
|
|
241776
|
-
const config = await validateConfiguration(configPath);
|
|
241777
|
-
if (s) {
|
|
241778
|
-
s.stop("Configuration loaded");
|
|
241779
|
-
}
|
|
241780
|
-
if (logConfig) {
|
|
241781
|
-
console.log(chalk5.gray("Configuration:"));
|
|
241782
|
-
console.log(chalk5.gray(` \u2022 Tenant ID: ${config.tenantId}`));
|
|
241783
|
-
console.log(chalk5.gray(` \u2022 Manage API URL: ${config.agentsManageApiUrl}`));
|
|
241784
|
-
console.log(chalk5.gray(` \u2022 Run API URL: ${config.agentsRunApiUrl}`));
|
|
241785
|
-
if (config.sources.configFile) {
|
|
241786
|
-
console.log(chalk5.gray(` \u2022 Config file: ${config.sources.configFile}`));
|
|
241787
|
-
}
|
|
241788
|
-
}
|
|
241789
|
-
return { config };
|
|
241790
|
-
} catch (error) {
|
|
241791
|
-
if (s) {
|
|
241792
|
-
s.stop("Configuration failed");
|
|
241793
|
-
}
|
|
241794
|
-
console.error(chalk5.red("Error:"), error.message);
|
|
241795
|
-
if (error.message.includes("No configuration found")) {
|
|
241796
|
-
console.log(chalk5.yellow("\nHint: Create a configuration file by running:"));
|
|
241797
|
-
console.log(chalk5.gray(" inkeep init"));
|
|
241798
|
-
} else if (error.message.includes("Config file not found")) {
|
|
241799
|
-
console.log(chalk5.yellow("\nHint: Check that your config file path is correct"));
|
|
241800
|
-
} else if (error.message.includes("tenantId") || error.message.includes("API URL")) {
|
|
241801
|
-
console.log(chalk5.yellow("\nHint: Ensure your inkeep.config.ts has all required fields:"));
|
|
241802
|
-
console.log(chalk5.gray(" - tenantId"));
|
|
241803
|
-
console.log(chalk5.gray(" - agentsManageApiUrl (or agentsManageApi.url)"));
|
|
241804
|
-
console.log(chalk5.gray(" - agentsRunApiUrl (or agentsRunApi.url)"));
|
|
241805
|
-
}
|
|
241806
|
-
process.exit(1);
|
|
241807
|
-
}
|
|
241808
|
-
}
|
|
241809
|
-
|
|
241810
|
-
// src/commands/list-agents.ts
|
|
241811
241811
|
async function listAgentsCommand(options) {
|
|
241812
241812
|
const configPath = options.config || options.configFilePath;
|
|
241813
241813
|
const { config } = await initializeCommand({
|
|
@@ -241876,6 +241876,7 @@ import { join as join15, resolve as resolve4 } from "path";
|
|
|
241876
241876
|
import * as p7 from "@clack/prompts";
|
|
241877
241877
|
import chalk15 from "chalk";
|
|
241878
241878
|
init_background_version_check();
|
|
241879
|
+
init_cli_pipeline();
|
|
241879
241880
|
|
|
241880
241881
|
// src/utils/environment-loader.ts
|
|
241881
241882
|
init_esm_shims();
|
|
@@ -242262,7 +242263,10 @@ program.command("push").description("Push a project configuration to the backend
|
|
|
242262
242263
|
).option("--json", "Generate project data JSON file instead of pushing to backend").action(async (options) => {
|
|
242263
242264
|
await pushCommand(options);
|
|
242264
242265
|
});
|
|
242265
|
-
program.command("pull").description("Pull project configuration with clean, efficient code generation").option(
|
|
242266
|
+
program.command("pull").description("Pull project configuration with clean, efficient code generation").option(
|
|
242267
|
+
"--project <project-id>",
|
|
242268
|
+
"Override project ID (defaults to local project ID from index.ts)"
|
|
242269
|
+
).option("--config <path>", "Path to configuration file").option(
|
|
242266
242270
|
"--env <environment>",
|
|
242267
242271
|
"Environment file to generate (development, staging, production). Defaults to development"
|
|
242268
242272
|
).option("--json", "Output project data as JSON instead of generating files").option("--debug", "Enable debug logging").option("--verbose", "Enable verbose logging").option("--force", "Force regeneration even if no changes detected").option("--introspect", "Completely regenerate all files from scratch (no comparison needed)").action(async (options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.2",
|
|
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.31.
|
|
53
|
-
"@inkeep/agents-sdk": "^0.31.
|
|
52
|
+
"@inkeep/agents-core": "^0.31.2",
|
|
53
|
+
"@inkeep/agents-sdk": "^0.31.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/degit": "^2.8.6",
|