@inkeep/agents-cli 0.29.9 → 0.29.11

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 (2) hide show
  1. package/dist/index.js +77 -26
  2. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -44193,8 +44193,8 @@ ${lanes.join("\n")}
44193
44193
  function isMissingList(arr) {
44194
44194
  return !!arr.isMissingList;
44195
44195
  }
44196
- function parseBracketedList(kind, parseElement, open, close) {
44197
- if (parseExpected(open)) {
44196
+ function parseBracketedList(kind, parseElement, open2, close) {
44197
+ if (parseExpected(open2)) {
44198
44198
  const result = parseDelimitedList(kind, parseElement);
44199
44199
  parseExpected(close);
44200
44200
  return result;
@@ -46629,7 +46629,7 @@ ${lanes.join("\n")}
46629
46629
  );
46630
46630
  return finishNode(factory2.createJsxSpreadAttribute(expression), pos);
46631
46631
  }
46632
- function parseJsxClosingElement(open, inExpressionContext) {
46632
+ function parseJsxClosingElement(open2, inExpressionContext) {
46633
46633
  const pos = getNodePos();
46634
46634
  parseExpected(
46635
46635
  31
@@ -46643,7 +46643,7 @@ ${lanes.join("\n")}
46643
46643
  /*shouldAdvance*/
46644
46644
  false
46645
46645
  )) {
46646
- if (inExpressionContext || !tagNamesAreEquivalent(open.tagName, tagName)) {
46646
+ if (inExpressionContext || !tagNamesAreEquivalent(open2.tagName, tagName)) {
46647
46647
  nextToken();
46648
46648
  } else {
46649
46649
  scanJsxText();
@@ -195439,18 +195439,18 @@ ${content}
195439
195439
  /* Code */
195440
195440
  );
195441
195441
  }
195442
- function spanForObjectOrArrayLiteral(node, open = 19) {
195442
+ function spanForObjectOrArrayLiteral(node, open2 = 19) {
195443
195443
  return spanForNode(
195444
195444
  node,
195445
195445
  /*autoCollapse*/
195446
195446
  false,
195447
195447
  /*useFullStart*/
195448
195448
  !isArrayLiteralExpression(node.parent) && !isCallExpression(node.parent),
195449
- open
195449
+ open2
195450
195450
  );
195451
195451
  }
195452
- function spanForNode(hintSpanNode, autoCollapse = false, useFullStart = true, open = 19, close = open === 19 ? 20 : 24) {
195453
- const openToken = findChildOfKind(n, open, sourceFile);
195452
+ function spanForNode(hintSpanNode, autoCollapse = false, useFullStart = true, open2 = 19, close = open2 === 19 ? 20 : 24) {
195453
+ const openToken = findChildOfKind(n, open2, sourceFile);
195454
195454
  const closeToken = findChildOfKind(n, close, sourceFile);
195455
195455
  return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart);
195456
195456
  }
@@ -198241,9 +198241,9 @@ ${options.prefix}` : "\n" : options.prefix
198241
198241
  return end;
198242
198242
  }
198243
198243
  function getClassOrObjectBraceEnds(cls, sourceFile) {
198244
- const open = findChildOfKind(cls, 19, sourceFile);
198244
+ const open2 = findChildOfKind(cls, 19, sourceFile);
198245
198245
  const close = findChildOfKind(cls, 20, sourceFile);
198246
- return [open == null ? void 0 : open.end, close == null ? void 0 : close.end];
198246
+ return [open2 == null ? void 0 : open2.end, close == null ? void 0 : close.end];
198247
198247
  }
198248
198248
  function getMembersOrProperties(node) {
198249
198249
  return isObjectLiteralExpression(node) ? node.properties : node.members;
@@ -238776,10 +238776,31 @@ import { fork } from "child_process";
238776
238776
  import { existsSync as existsSync2 } from "fs";
238777
238777
  import { createRequire } from "module";
238778
238778
  import { dirname, join as join2 } from "path";
238779
+ import * as p2 from "@clack/prompts";
238779
238780
  import chalk3 from "chalk";
238780
238781
  import fs4 from "fs-extra";
238781
- import * as p2 from "@clack/prompts";
238782
+ import open from "open";
238782
238783
  var require2 = createRequire(import.meta.url);
238784
+ async function waitForServer(host, port, maxAttempts = 60) {
238785
+ for (let i = 0; i < maxAttempts; i++) {
238786
+ try {
238787
+ const response = await fetch(`http://${host}:${port}`, {
238788
+ method: "GET",
238789
+ signal: AbortSignal.timeout(2e3)
238790
+ });
238791
+ if (response.ok) {
238792
+ const text4 = await response.text();
238793
+ if (text4 && text4.length > 0 && text4.includes("<!DOCTYPE html>")) {
238794
+ await new Promise((resolve6) => setTimeout(resolve6, 1e3));
238795
+ return true;
238796
+ }
238797
+ }
238798
+ } catch {
238799
+ }
238800
+ await new Promise((resolve6) => setTimeout(resolve6, 500));
238801
+ }
238802
+ return false;
238803
+ }
238783
238804
  function resolveWebRuntime(isRoot = false) {
238784
238805
  try {
238785
238806
  const pkg = require2.resolve("@inkeep/agents-manage-ui/package.json");
@@ -238800,7 +238821,11 @@ Error: ${err instanceof Error ? err.message : "Unknown error"}`
238800
238821
  );
238801
238822
  }
238802
238823
  }
238803
- function startWebApp({ port, host }) {
238824
+ async function startWebApp({
238825
+ port,
238826
+ host,
238827
+ openBrowser
238828
+ }) {
238804
238829
  console.log("");
238805
238830
  const s = p2.spinner();
238806
238831
  s.start("Starting dashboard server...");
@@ -238828,6 +238853,16 @@ function startWebApp({ port, host }) {
238828
238853
  console.log("");
238829
238854
  console.log(chalk3.gray("Press Ctrl+C to stop the server"));
238830
238855
  console.log("");
238856
+ if (openBrowser) {
238857
+ console.log(chalk3.gray("Waiting for server to be ready..."));
238858
+ const isReady = await waitForServer(host, port);
238859
+ if (isReady) {
238860
+ await open(`http://${host}:${port}`);
238861
+ } else {
238862
+ console.log(chalk3.yellow("\u26A0\uFE0F Server did not respond in time, skipping browser open"));
238863
+ console.log(chalk3.gray(` You can manually open: http://${host}:${port}`));
238864
+ }
238865
+ }
238831
238866
  process.on("SIGINT", () => {
238832
238867
  console.log("");
238833
238868
  console.log(chalk3.yellow("\n\u{1F6D1} Stopping dashboard server..."));
@@ -239003,7 +239038,7 @@ This project can be deployed to any platform that supports Next.js:
239003
239038
  }
239004
239039
  }
239005
239040
  async function devCommand(options) {
239006
- const { port, host, build, outputDir, path: path4, export: exportFlag } = options;
239041
+ const { port, host, build, outputDir, path: path4, export: exportFlag, openBrowser } = options;
239007
239042
  if (path4) {
239008
239043
  const rt = resolveWebRuntime(true);
239009
239044
  console.log(rt);
@@ -239017,7 +239052,7 @@ async function devCommand(options) {
239017
239052
  await buildNextApp({ outputDir });
239018
239053
  return;
239019
239054
  }
239020
- await startWebApp({ port, host });
239055
+ await startWebApp({ port, host, openBrowser });
239021
239056
  }
239022
239057
 
239023
239058
  // src/commands/init.ts
@@ -239116,19 +239151,34 @@ async function initCommand(options) {
239116
239151
  p3.cancel("Operation cancelled");
239117
239152
  process.exit(0);
239118
239153
  }
239119
- const apiUrl = await p3.text({
239120
- message: "Enter the API URL:",
239121
- defaultValue: "http://localhost:3002",
239122
- validate: (input) => {
239123
- try {
239154
+ const validateUrl = (input) => {
239155
+ try {
239156
+ if (input && input.trim() !== "") {
239124
239157
  new URL(input);
239125
239158
  return void 0;
239126
- } catch {
239127
- return "Please enter a valid URL";
239128
239159
  }
239160
+ return void 0;
239161
+ } catch {
239162
+ return "Please enter a valid URL";
239129
239163
  }
239164
+ };
239165
+ const manageApiUrl = await p3.text({
239166
+ message: "Enter the Management API URL:",
239167
+ placeholder: "http://localhost:3002",
239168
+ defaultValue: "http://localhost:3002",
239169
+ validate: validateUrl
239170
+ });
239171
+ if (p3.isCancel(manageApiUrl)) {
239172
+ p3.cancel("Operation cancelled");
239173
+ process.exit(0);
239174
+ }
239175
+ const runApiUrl = await p3.text({
239176
+ message: "Enter the Run API URL:",
239177
+ placeholder: "http://localhost:3003",
239178
+ defaultValue: "http://localhost:3003",
239179
+ validate: validateUrl
239130
239180
  });
239131
- if (p3.isCancel(apiUrl)) {
239181
+ if (p3.isCancel(runApiUrl)) {
239132
239182
  p3.cancel("Operation cancelled");
239133
239183
  process.exit(0);
239134
239184
  }
@@ -239137,10 +239187,10 @@ async function initCommand(options) {
239137
239187
  export default defineConfig({
239138
239188
  tenantId: '${tenantId}',
239139
239189
  agentsManageApi: {
239140
- url: '${apiUrl}',
239190
+ url: '${manageApiUrl}',
239141
239191
  },
239142
239192
  agentsRunApi: {
239143
- url: '${apiUrl}',
239193
+ url: '${runApiUrl}',
239144
239194
  },
239145
239195
  });
239146
239196
  `;
@@ -240757,14 +240807,15 @@ program.command("list-agent").description("List all available agents for a speci
240757
240807
  const config = options.config || options.configFilePath;
240758
240808
  await listAgentsCommand({ ...options, config });
240759
240809
  });
240760
- 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) => {
240810
+ 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).option("--open-browser", "Open the browser", false).action(async (options) => {
240761
240811
  await devCommand({
240762
240812
  port: parseInt(options.port, 10),
240763
240813
  host: options.host,
240764
240814
  build: options.build,
240765
240815
  outputDir: options.outputDir,
240766
240816
  path: options.path,
240767
- export: options.export
240817
+ export: options.export,
240818
+ openBrowser: options.openBrowser
240768
240819
  });
240769
240820
  });
240770
240821
  program.command("update").description("Update @inkeep/agents-cli to the latest version").option("--check", "Check for updates without installing").option("--force", "Force update even if already on latest version").action(async (options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.29.9",
3
+ "version": "0.29.11",
4
4
  "description": "Inkeep CLI tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -48,8 +48,9 @@
48
48
  "recast": "^0.23.0",
49
49
  "ts-morph": "^26.0.0",
50
50
  "tsx": "^4.20.5",
51
- "@inkeep/agents-core": "^0.29.9",
52
- "@inkeep/agents-sdk": "^0.29.9"
51
+ "open": "^10.2.0",
52
+ "@inkeep/agents-core": "^0.29.11",
53
+ "@inkeep/agents-sdk": "^0.29.11"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@types/degit": "^2.8.6",