@inkeep/agents-cli 0.6.0 → 0.6.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/README.md +220 -57
- package/dist/commands/create.d.ts +12 -0
- package/dist/commands/create.js +869 -0
- package/dist/index.js +44 -95
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -21520,16 +21520,19 @@ import chalk3 from "chalk";
|
|
|
21520
21520
|
import fs4 from "fs-extra";
|
|
21521
21521
|
import ora2 from "ora";
|
|
21522
21522
|
var require2 = createRequire(import.meta.url);
|
|
21523
|
-
function resolveWebRuntime() {
|
|
21523
|
+
function resolveWebRuntime(isRoot = false) {
|
|
21524
21524
|
try {
|
|
21525
21525
|
const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
|
|
21526
21526
|
const root = dirname(pkg);
|
|
21527
|
+
if (isRoot) {
|
|
21528
|
+
return root;
|
|
21529
|
+
}
|
|
21527
21530
|
return join2(root, ".next/standalone/agents-manage-ui");
|
|
21528
21531
|
} catch (err) {
|
|
21529
21532
|
throw new Error(`Could not find @inkeep/agents-manage-ui package. ${err}`);
|
|
21530
21533
|
}
|
|
21531
21534
|
}
|
|
21532
|
-
function startWebApp({ port
|
|
21535
|
+
function startWebApp({ port, host }) {
|
|
21533
21536
|
console.log("");
|
|
21534
21537
|
const spinner = ora2("Starting dashboard server...").start();
|
|
21535
21538
|
try {
|
|
@@ -21573,37 +21576,9 @@ function startWebApp({ port = 3e3, host = "localhost" }) {
|
|
|
21573
21576
|
process.exit(1);
|
|
21574
21577
|
}
|
|
21575
21578
|
}
|
|
21576
|
-
async function
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
|
|
21580
|
-
const root = dirname(pkg);
|
|
21581
|
-
const sourceOutputPath = join2(root, ".vercel", "output");
|
|
21582
|
-
if (!existsSync2(sourceOutputPath)) {
|
|
21583
|
-
spinner.fail("Vercel output not found");
|
|
21584
|
-
console.error(chalk3.red("The Vercel output has not been built yet in the package."));
|
|
21585
|
-
process.exit(1);
|
|
21586
|
-
}
|
|
21587
|
-
const destVercelDir = join2(process.cwd(), ".vercel");
|
|
21588
|
-
const destOutputPath = join2(destVercelDir, "output");
|
|
21589
|
-
await fs4.ensureDir(destVercelDir);
|
|
21590
|
-
if (existsSync2(destOutputPath)) {
|
|
21591
|
-
await fs4.remove(destOutputPath);
|
|
21592
|
-
}
|
|
21593
|
-
await fs4.copy(sourceOutputPath, destOutputPath);
|
|
21594
|
-
spinner.succeed(`Vercel output copied to .vercel/output/`);
|
|
21595
|
-
console.log("");
|
|
21596
|
-
console.log(chalk3.blue("\u{1F680} Ready for Vercel deployment"));
|
|
21597
|
-
console.log(chalk3.gray("Run: vercel deploy --prebuilt --prod"));
|
|
21598
|
-
console.log("");
|
|
21599
|
-
} catch (error) {
|
|
21600
|
-
spinner.fail("Failed to copy Vercel output");
|
|
21601
|
-
console.error(chalk3.red("Error:"), error instanceof Error ? error.message : "Unknown error");
|
|
21602
|
-
throw error;
|
|
21603
|
-
}
|
|
21604
|
-
}
|
|
21605
|
-
async function buildForVercel({ outputDir = "./vercel-build" }) {
|
|
21606
|
-
const spinner = ora2("Creating Vercel-ready build...").start();
|
|
21579
|
+
async function buildNextApp({ outputDir }) {
|
|
21580
|
+
console.log("");
|
|
21581
|
+
const spinner = ora2("Building Standalone build...").start();
|
|
21607
21582
|
try {
|
|
21608
21583
|
const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
|
|
21609
21584
|
const root = dirname(pkg);
|
|
@@ -21616,6 +21591,9 @@ async function buildForVercel({ outputDir = "./vercel-build" }) {
|
|
|
21616
21591
|
if (existsSync2(outputDir)) {
|
|
21617
21592
|
await fs4.remove(outputDir);
|
|
21618
21593
|
}
|
|
21594
|
+
if (existsSync2(outputDir)) {
|
|
21595
|
+
await fs4.remove(outputDir);
|
|
21596
|
+
}
|
|
21619
21597
|
await fs4.ensureDir(outputDir);
|
|
21620
21598
|
await fs4.copy(standalonePath, outputDir);
|
|
21621
21599
|
const packageJson2 = {
|
|
@@ -21629,42 +21607,7 @@ async function buildForVercel({ outputDir = "./vercel-build" }) {
|
|
|
21629
21607
|
}
|
|
21630
21608
|
};
|
|
21631
21609
|
await fs4.writeJson(join2(outputDir, "package.json"), packageJson2, { spaces: 2 });
|
|
21632
|
-
const
|
|
21633
|
-
version: 2,
|
|
21634
|
-
builds: [
|
|
21635
|
-
{
|
|
21636
|
-
src: "server.js",
|
|
21637
|
-
use: "@vercel/node"
|
|
21638
|
-
}
|
|
21639
|
-
],
|
|
21640
|
-
routes: [
|
|
21641
|
-
{
|
|
21642
|
-
src: "/(.*)",
|
|
21643
|
-
dest: "server.js"
|
|
21644
|
-
}
|
|
21645
|
-
]
|
|
21646
|
-
};
|
|
21647
|
-
await fs4.writeJson(join2(outputDir, "vercel.json"), vercelConfig, { spaces: 2 });
|
|
21648
|
-
const instructions = `# Inkeep Dashboard - Vercel Deployment
|
|
21649
|
-
|
|
21650
|
-
## Quick Deploy
|
|
21651
|
-
|
|
21652
|
-
1. Go to https://vercel.com/dashboard
|
|
21653
|
-
2. Click "New Project"
|
|
21654
|
-
3. Upload this folder or connect to GitHub
|
|
21655
|
-
4. Set environment variables:
|
|
21656
|
-
- INKEEP_API_URL=your-api-url
|
|
21657
|
-
- INKEEP_TENANT_ID=your-tenant-id
|
|
21658
|
-
- NODE_ENV=production
|
|
21659
|
-
5. Deploy!
|
|
21660
|
-
|
|
21661
|
-
## Using Vercel CLI
|
|
21662
|
-
|
|
21663
|
-
\`\`\`bash
|
|
21664
|
-
cd ${outputDir}
|
|
21665
|
-
vercel --prod
|
|
21666
|
-
\`\`\`
|
|
21667
|
-
|
|
21610
|
+
const instructions = `
|
|
21668
21611
|
## Environment Variables
|
|
21669
21612
|
|
|
21670
21613
|
Make sure to set these in your Vercel project settings:
|
|
@@ -21672,37 +21615,39 @@ Make sure to set these in your Vercel project settings:
|
|
|
21672
21615
|
- INKEEP_TENANT_ID
|
|
21673
21616
|
- Any other variables from your .env file
|
|
21674
21617
|
`;
|
|
21675
|
-
await fs4.writeFile(join2(outputDir, "README
|
|
21676
|
-
spinner.succeed(`
|
|
21618
|
+
await fs4.writeFile(join2(outputDir, "README.md"), instructions);
|
|
21619
|
+
spinner.succeed(`Build created at ${outputDir}/`);
|
|
21620
|
+
console.log("");
|
|
21621
|
+
console.log(chalk3.green("\u2705 Build completed successfully!"));
|
|
21622
|
+
console.log("");
|
|
21623
|
+
console.log(chalk3.blue("\u{1F4C1} To run your dashboard:"));
|
|
21624
|
+
console.log(chalk3.gray(" cd"), chalk3.white(outputDir));
|
|
21625
|
+
console.log(chalk3.gray(" npm start"));
|
|
21677
21626
|
console.log("");
|
|
21678
|
-
console.log(chalk3.blue("\u{
|
|
21627
|
+
console.log(chalk3.blue("\u{1F310} Or with pnpm:"));
|
|
21628
|
+
console.log(chalk3.gray(" cd"), chalk3.white(outputDir));
|
|
21629
|
+
console.log(chalk3.gray(" pnpm start"));
|
|
21630
|
+
console.log("");
|
|
21631
|
+
console.log(chalk3.yellow("\u{1F4D6} See README.md for deployment instructions"));
|
|
21679
21632
|
console.log("");
|
|
21680
|
-
console.log(chalk3.yellow("\u{1F4D6} See README-VERCEL.md for deployment instructions"));
|
|
21681
21633
|
} catch (error) {
|
|
21682
|
-
spinner.fail("Failed to
|
|
21634
|
+
spinner.fail("Failed to build dashboard");
|
|
21683
21635
|
console.error(chalk3.red("Error:"), error instanceof Error ? error.message : "Unknown error");
|
|
21684
21636
|
throw error;
|
|
21685
21637
|
}
|
|
21686
21638
|
}
|
|
21687
21639
|
async function devCommand(options) {
|
|
21688
|
-
const {
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
outputDir = "./vercel-build",
|
|
21693
|
-
vercel = false
|
|
21694
|
-
} = options;
|
|
21695
|
-
if (vercel) {
|
|
21696
|
-
await copyVercelOutput();
|
|
21640
|
+
const { port, host, build, outputDir, path: path3 } = options;
|
|
21641
|
+
if (path3) {
|
|
21642
|
+
const rt = resolveWebRuntime(true);
|
|
21643
|
+
console.log(rt);
|
|
21697
21644
|
return;
|
|
21698
21645
|
}
|
|
21699
21646
|
if (build) {
|
|
21700
|
-
await
|
|
21701
|
-
console.log("");
|
|
21702
|
-
console.log(chalk3.blue("Next steps: Deploy the build folder to Vercel"));
|
|
21647
|
+
await buildNextApp({ outputDir });
|
|
21703
21648
|
return;
|
|
21704
21649
|
}
|
|
21705
|
-
startWebApp({ port, host });
|
|
21650
|
+
await startWebApp({ port, host });
|
|
21706
21651
|
}
|
|
21707
21652
|
|
|
21708
21653
|
// src/commands/init.ts
|
|
@@ -21872,15 +21817,17 @@ async function listGraphsCommand(options) {
|
|
|
21872
21817
|
const api = await ManagementApiClient.create(
|
|
21873
21818
|
config.agentsManageApiUrl,
|
|
21874
21819
|
configPath,
|
|
21875
|
-
config.tenantId
|
|
21820
|
+
config.tenantId,
|
|
21821
|
+
options.project
|
|
21822
|
+
// pass project ID as projectIdOverride
|
|
21876
21823
|
);
|
|
21877
21824
|
const spinner = ora3("Fetching graphs...").start();
|
|
21878
21825
|
try {
|
|
21879
21826
|
const graphs = await api.listGraphs();
|
|
21880
|
-
spinner.succeed(`Found ${graphs.length} graph(s)`);
|
|
21827
|
+
spinner.succeed(`Found ${graphs.length} graph(s) in project "${options.project}"`);
|
|
21881
21828
|
if (graphs.length === 0) {
|
|
21882
21829
|
console.log(
|
|
21883
|
-
chalk5.gray(
|
|
21830
|
+
chalk5.gray(`No graphs found in project "${options.project}". Define graphs in your project and run: inkeep push`)
|
|
21884
21831
|
);
|
|
21885
21832
|
return;
|
|
21886
21833
|
}
|
|
@@ -23532,7 +23479,10 @@ program.command("push").description("Push a project configuration to the backend
|
|
|
23532
23479
|
).option("--json", "Generate project data JSON file instead of pushing to backend").action(async (options) => {
|
|
23533
23480
|
await pushCommand(options);
|
|
23534
23481
|
});
|
|
23535
|
-
program.command("pull").description("Pull entire project configuration from backend and update local files").option("--project <project-id>", "Project ID or path to project directory").option("--config <path>", "Path to configuration file").option("--agents-manage-api-url <url>", "Override agents manage API URL").option(
|
|
23482
|
+
program.command("pull").description("Pull entire project configuration from backend and update local files").option("--project <project-id>", "Project ID or path to project directory").option("--config <path>", "Path to configuration file").option("--agents-manage-api-url <url>", "Override agents manage API URL").option(
|
|
23483
|
+
"--env <environment>",
|
|
23484
|
+
"Environment file to generate (development, staging, production). Defaults to development"
|
|
23485
|
+
).option("--json", "Generate project data JSON file instead of updating files").option("--debug", "Enable debug logging for LLM generation").action(async (options) => {
|
|
23536
23486
|
await pullProjectCommand(options);
|
|
23537
23487
|
});
|
|
23538
23488
|
program.command("chat [graph-id]").description(
|
|
@@ -23542,18 +23492,17 @@ program.command("chat [graph-id]").description(
|
|
|
23542
23492
|
const config = options.config || options.configFilePath;
|
|
23543
23493
|
await chatCommandEnhanced2(graphId, { ...options, config });
|
|
23544
23494
|
});
|
|
23545
|
-
program.command("list-graphs").description("List all available graphs for
|
|
23495
|
+
program.command("list-graphs").description("List all available graphs for a specific project").requiredOption("--project <project-id>", "Project ID to list graphs for").option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-manage-api-url <url>", "Agents manage API URL").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (options) => {
|
|
23546
23496
|
const config = options.config || options.configFilePath;
|
|
23547
23497
|
await listGraphsCommand({ ...options, config });
|
|
23548
23498
|
});
|
|
23549
|
-
program.command("dev").description("Start the Inkeep dashboard server").option("--port <port>", "Port to run the server on", "3000").option("--host <host>", "Host to bind the server to", "localhost").option("--build", "
|
|
23499
|
+
program.command("dev").description("Start the Inkeep dashboard server").option("--port <port>", "Port to run the server on", "3000").option("--host <host>", "Host to bind the server to", "localhost").option("--build", "Build the Dashboard UI for production", false).option("--output-dir <dir>", "Output directory for build files", "./vercel-build").option("--path", "Output the path to the Dashboard UI", false).action(async (options) => {
|
|
23550
23500
|
await devCommand({
|
|
23551
23501
|
port: parseInt(options.port, 10),
|
|
23552
23502
|
host: options.host,
|
|
23553
23503
|
build: options.build,
|
|
23554
23504
|
outputDir: options.outputDir,
|
|
23555
|
-
|
|
23556
|
-
config: options.config
|
|
23505
|
+
path: options.path
|
|
23557
23506
|
});
|
|
23558
23507
|
});
|
|
23559
23508
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"recast": "^0.23.0",
|
|
46
46
|
"ts-morph": "^26.0.0",
|
|
47
47
|
"tsx": "^4.20.5",
|
|
48
|
-
"@inkeep/agents-core": "^0.6.
|
|
49
|
-
"@inkeep/agents-manage-ui": "^0.6.
|
|
48
|
+
"@inkeep/agents-core": "^0.6.4",
|
|
49
|
+
"@inkeep/agents-manage-ui": "^0.6.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/degit": "^2.8.6",
|