@inkeep/agents-cli 0.8.6 → 0.9.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.
Files changed (3) hide show
  1. package/README.md +5 -2
  2. package/dist/index.js +104 -8
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -188,7 +188,7 @@ inkeep pull --project my-project-id --config ./my-config.ts
188
188
 
189
189
  ### `inkeep dev`
190
190
 
191
- Start the Inkeep dashboard server or build for production.
191
+ Start the Inkeep dashboard server, build for production, or export the Next.js project.
192
192
 
193
193
  ```bash
194
194
  # Start development server
@@ -197,9 +197,12 @@ inkeep dev
197
197
  # Start on custom port and host
198
198
  inkeep dev --port 3001 --host 0.0.0.0
199
199
 
200
- # Build for production
200
+ # Build for production (packages standalone build)
201
201
  inkeep dev --build --output-dir ./build
202
202
 
203
+ # Export Next.js project source files
204
+ inkeep dev --export --output-dir ./my-dashboard
205
+
203
206
  # Get dashboard path for deployment
204
207
  DASHBOARD_PATH=$(inkeep dev --path)
205
208
  echo "Dashboard built at: $DASHBOARD_PATH"
package/dist/index.js CHANGED
@@ -2778,6 +2778,7 @@ var init_schemas = __esm({
2778
2778
  statusComponents: z.array(StatusComponentSchema).optional()
2779
2779
  });
2780
2780
  CanUseItemSchema = z.object({
2781
+ agentToolRelationId: z.string().optional(),
2781
2782
  toolId: z.string(),
2782
2783
  toolSelection: z.array(z.string()).nullish(),
2783
2784
  headers: z.record(z.string(), z.string()).nullish()
@@ -13658,7 +13659,7 @@ var init_tools = __esm({
13658
13659
  });
13659
13660
 
13660
13661
  // ../packages/agents-core/src/data-access/graphFull.ts
13661
- import { and as and13, eq as eq13 } from "drizzle-orm";
13662
+ import { and as and13, eq as eq13, inArray as inArray3, not } from "drizzle-orm";
13662
13663
  var init_graphFull2 = __esm({
13663
13664
  "../packages/agents-core/src/data-access/graphFull.ts"() {
13664
13665
  "use strict";
@@ -13687,7 +13688,7 @@ var init_ledgerArtifacts = __esm({
13687
13688
  });
13688
13689
 
13689
13690
  // ../packages/agents-core/src/data-access/messages.ts
13690
- import { and as and15, asc as asc2, count as count13, desc as desc12, eq as eq15, inArray as inArray3 } from "drizzle-orm";
13691
+ import { and as and15, asc as asc2, count as count13, desc as desc12, eq as eq15, inArray as inArray4 } from "drizzle-orm";
13691
13692
  var init_messages = __esm({
13692
13693
  "../packages/agents-core/src/data-access/messages.ts"() {
13693
13694
  "use strict";
@@ -14319,7 +14320,7 @@ var require_codegen = __commonJS({
14319
14320
  return e2 instanceof _If ? e2 : e2.nodes;
14320
14321
  if (this.nodes.length)
14321
14322
  return this;
14322
- return new _If(not(cond), e2 instanceof _If ? [e2] : e2.nodes);
14323
+ return new _If(not2(cond), e2 instanceof _If ? [e2] : e2.nodes);
14323
14324
  }
14324
14325
  if (cond === false || !this.nodes.length)
14325
14326
  return void 0;
@@ -14771,10 +14772,10 @@ var require_codegen = __commonJS({
14771
14772
  for (const n2 in from)
14772
14773
  names[n2] = (names[n2] || 0) - (from[n2] || 0);
14773
14774
  }
14774
- function not(x2) {
14775
+ function not2(x2) {
14775
14776
  return typeof x2 == "boolean" || typeof x2 == "number" || x2 === null ? !x2 : (0, code_1._)`!${par(x2)}`;
14776
14777
  }
14777
- exports.not = not;
14778
+ exports.not = not2;
14778
14779
  var andCode = mappend(exports.operators.AND);
14779
14780
  function and18(...args) {
14780
14781
  return args.reduce(andCode);
@@ -21641,13 +21642,107 @@ Make sure to set these in your Vercel project settings:
21641
21642
  throw error;
21642
21643
  }
21643
21644
  }
21645
+ async function exportNextApp({ outputDir }) {
21646
+ console.log("");
21647
+ const spinner = ora2("Exporting Next.js project...").start();
21648
+ try {
21649
+ const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
21650
+ const root = dirname(pkg);
21651
+ if (!existsSync2(root)) {
21652
+ spinner.fail("Source project not found");
21653
+ console.error(chalk3.red("The @inkeep/agents-manage-ui package was not found."));
21654
+ process.exit(1);
21655
+ }
21656
+ if (existsSync2(outputDir)) {
21657
+ await fs4.remove(outputDir);
21658
+ }
21659
+ await fs4.ensureDir(outputDir);
21660
+ const items = await fs4.readdir(root);
21661
+ for (const item of items) {
21662
+ const srcPath = join2(root, item);
21663
+ const destPath = join2(outputDir, item);
21664
+ if (item === ".next" || item === "node_modules" || item === "dist") {
21665
+ continue;
21666
+ }
21667
+ const stat = await fs4.stat(srcPath);
21668
+ if (stat.isDirectory()) {
21669
+ await fs4.copy(srcPath, destPath);
21670
+ } else {
21671
+ await fs4.copy(srcPath, destPath);
21672
+ }
21673
+ }
21674
+ const readme = `# Inkeep Dashboard
21675
+
21676
+ This is an exported copy of the Inkeep Dashboard UI.
21677
+
21678
+ ## Getting Started
21679
+
21680
+ 1. Install dependencies:
21681
+ \`\`\`bash
21682
+ npm install
21683
+ # or
21684
+ pnpm install
21685
+ \`\`\`
21686
+
21687
+ 2. Start the development server:
21688
+ \`\`\`bash
21689
+ npm run dev
21690
+ # or
21691
+ pnpm dev
21692
+ \`\`\`
21693
+
21694
+ 3. Build for production:
21695
+ \`\`\`bash
21696
+ npm run build
21697
+ # or
21698
+ pnpm build
21699
+ \`\`\`
21700
+
21701
+ ## Environment Variables
21702
+
21703
+ Make sure to set these environment variables:
21704
+ - \`INKEEP_API_URL\` - Your Inkeep API URL
21705
+ - \`INKEEP_TENANT_ID\` - Your tenant ID
21706
+ - Any other variables from your .env file
21707
+
21708
+ ## Deployment
21709
+
21710
+ This project can be deployed to any platform that supports Next.js:
21711
+ - Vercel
21712
+ - Netlify
21713
+ - AWS Amplify
21714
+ - Railway
21715
+ - And more...
21716
+ `;
21717
+ await fs4.writeFile(join2(outputDir, "README.md"), readme);
21718
+ spinner.succeed(`Project exported to ${outputDir}/`);
21719
+ console.log("");
21720
+ console.log(chalk3.green("\u2705 Export completed successfully!"));
21721
+ console.log("");
21722
+ console.log(chalk3.blue("\u{1F4C1} To get started:"));
21723
+ console.log(chalk3.gray(" cd"), chalk3.white(outputDir));
21724
+ console.log(chalk3.gray(" npm install"));
21725
+ console.log(chalk3.gray(" npm run dev"));
21726
+ console.log("");
21727
+ console.log(chalk3.yellow("\u{1F4D6} See README.md for more instructions"));
21728
+ console.log("");
21729
+ } catch (error) {
21730
+ spinner.fail("Failed to export project");
21731
+ console.error(chalk3.red("Error:"), error instanceof Error ? error.message : "Unknown error");
21732
+ throw error;
21733
+ }
21734
+ }
21644
21735
  async function devCommand(options) {
21645
- const { port, host, build, outputDir, path: path3 } = options;
21736
+ const { port, host, build, outputDir, path: path3, export: exportFlag } = options;
21646
21737
  if (path3) {
21647
21738
  const rt = resolveWebRuntime(true);
21648
21739
  console.log(rt);
21649
21740
  return;
21650
21741
  }
21742
+ if (exportFlag) {
21743
+ await exportNextApp({ outputDir });
21744
+ return;
21745
+ }
21651
21746
  if (build) {
21652
21747
  await buildNextApp({ outputDir });
21653
21748
  return;
@@ -23501,13 +23596,14 @@ program.command("list-graphs").description("List all available graphs for a spec
23501
23596
  const config = options.config || options.configFilePath;
23502
23597
  await listGraphsCommand({ ...options, config });
23503
23598
  });
23504
- 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) => {
23599
+ 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("--export", "Export the Next.js project source files", false).option("--output-dir <dir>", "Output directory for build files", "./inkeep-dev").option("--path", "Output the path to the Dashboard UI", false).action(async (options) => {
23505
23600
  await devCommand({
23506
23601
  port: parseInt(options.port, 10),
23507
23602
  host: options.host,
23508
23603
  build: options.build,
23509
23604
  outputDir: options.outputDir,
23510
- path: options.path
23605
+ path: options.path,
23606
+ export: options.export
23511
23607
  });
23512
23608
  });
23513
23609
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.8.6",
3
+ "version": "0.9.0",
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-manage-ui": "^0.8.6",
49
- "@inkeep/agents-core": "^0.8.6"
48
+ "@inkeep/agents-core": "^0.9.0",
49
+ "@inkeep/agents-manage-ui": "^0.9.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/degit": "^2.8.6",