@botpress/adk-cli 1.5.4 → 1.5.7

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/cli.js +1059 -70
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -309325,6 +309325,7 @@ import util4 from "util";
309325
309325
  import { Readable as Readable5 } from "stream";
309326
309326
  import stream22 from "stream";
309327
309327
  import { createHash } from "crypto";
309328
+ import { AsyncResource } from "async_hooks";
309328
309329
  import { setTimeout as setTimeout22 } from "timers/promises";
309329
309330
  import assert from "assert";
309330
309331
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
@@ -314203,7 +314204,7 @@ var import_const, import_const2, __create4, __defProp6, __getOwnPropDesc3, __get
314203
314204
  } else {
314204
314205
  return { ...EMPTY_STATE };
314205
314206
  }
314206
- }, WorkflowCallbackEvent, WorkflowScheduleEvent, WorkflowContinueEvent, SubworkflowFinished, WorkflowDataRequestEvent2, HTML_TAGS, Message, dedent, Transcript, OutgoingMessages, AttachmentSchema, TranscriptItemSchema, TranscriptSchema, BaseConversationInstance = class {
314207
+ }, WorkflowCallbackEvent, WorkflowScheduleEvent, WorkflowContinueEvent, SubworkflowFinished, WorkflowDataRequestEvent2, HTML_TAGS, Message, dedent, Transcript, AttachmentSchema, TranscriptItemSchema, TranscriptSchema, BaseConversationInstance = class {
314207
314208
  id;
314208
314209
  channel;
314209
314210
  integration;
@@ -315654,7 +315655,6 @@ var init_internal = __esm(() => {
315654
315655
  init_dist8();
315655
315656
  init_dist7();
315656
315657
  init_dist8();
315657
- init_dist8();
315658
315658
  init_dist5();
315659
315659
  init_dist5();
315660
315660
  init_node4();
@@ -315684,7 +315684,7 @@ var init_internal = __esm(() => {
315684
315684
  });
315685
315685
  init_define_PACKAGE_VERSIONS = __esm2({
315686
315686
  "<define:__PACKAGE_VERSIONS__>"() {
315687
- define_PACKAGE_VERSIONS_default = { runtime: "1.3.4", adk: "not-installed", sdk: "4.17.0", llmz: "0.0.26", zai: "2.1.16", cognitive: "0.1.47" };
315687
+ define_PACKAGE_VERSIONS_default = { runtime: "1.3.7", adk: "not-installed", sdk: "4.17.0", llmz: "0.0.26", zai: "2.1.16", cognitive: "0.1.47" };
315688
315688
  }
315689
315689
  });
315690
315690
  init_globalThis = __esm2({
@@ -348245,6 +348245,12 @@ ${issues.join(`
348245
348245
  name: "autonomous.tool",
348246
348246
  importance: "high",
348247
348247
  attributes: {
348248
+ "autonomous.tool.object": {
348249
+ type: "string",
348250
+ title: "Object Name",
348251
+ description: "The name of the object being used",
348252
+ required: false
348253
+ },
348248
348254
  "autonomous.tool.name": {
348249
348255
  type: "string",
348250
348256
  title: "Tool Name",
@@ -350201,7 +350207,7 @@ If the question is not related to the knowledge bases, do NOT use this tool.`.tr
350201
350207
  options.interruption
350202
350208
  ]);
350203
350209
  const llmz_execute = (await Promise.resolve().then(() => (init_dist8(), exports_dist4))).execute;
350204
- const originalContext = context.getAll();
350210
+ const asyncResource = new AsyncResource("autonomous.execution");
350205
350211
  const getNewIteration = (index) => createSpan("autonomous.iteration", {
350206
350212
  "autonomous.iteration": index
350207
350213
  }, { parentContext: execSpan.ctx });
@@ -350246,25 +350252,20 @@ Always prefer information from the knowledge bases over general knowledge when a
350246
350252
  });
350247
350253
  return instructions;
350248
350254
  },
350249
- ...(props.tools || props.knowledge) && {
350250
- tools: async (ctx) => {
350251
- const tools = props.tools ? await getValue3(props.tools, ctx) : [];
350252
- const allTools = [...tools ?? []];
350253
- if (search_knowledge) {
350254
- allTools.push(search_knowledge);
350255
- }
350256
- iterationSpan?.setAttribute("autonomous.tools", allTools?.map((t5) => t5.name).join(", "));
350257
- return allTools.map((tool) => tool.clone({
350258
- handler: (args, ctx2) => {
350259
- context.enterWith(originalContext);
350260
- return context.run(originalContext, () => {
350255
+ ...props.objects && {
350256
+ objects: async (ctx) => {
350257
+ const objs = await getValue3(props.objects, ctx) ?? [];
350258
+ iterationSpan?.setAttribute("autonomous.objects", objs.map((o2) => o2.name).join(", "));
350259
+ for (const obj of objs) {
350260
+ obj.tools = obj.tools?.map((tool) => tool.clone({
350261
+ handler: asyncResource.bind((args, ctx2) => {
350261
350262
  let err = null;
350262
350263
  const result = span("autonomous.tool", {
350264
+ "autonomous.tool.object": obj.name,
350263
350265
  "autonomous.tool.name": tool.name,
350264
350266
  "autonomous.tool.input": args
350265
350267
  }, async (s2) => {
350266
- context.enterWith(originalContext);
350267
- const value2 = await tool.execute(args, ctx2).catch((e6) => {
350268
+ const value2 = tool.execute(args, ctx2).catch((e6) => {
350268
350269
  err = e6;
350269
350270
  if (err && err?.constructor && err?.constructor?.name && err?.constructor?.name === "ThinkSignal") {
350270
350271
  s2.setAttributes({
@@ -350299,24 +350300,80 @@ Always prefer information from the knowledge bases over general knowledge when a
350299
350300
  throw err;
350300
350301
  }
350301
350302
  return result;
350303
+ })
350304
+ })) ?? [];
350305
+ }
350306
+ return objs;
350307
+ }
350308
+ },
350309
+ ...(props.tools || props.knowledge) && {
350310
+ tools: async (ctx) => {
350311
+ const tools = props.tools ? await getValue3(props.tools, ctx) : [];
350312
+ const allTools = [...tools ?? []];
350313
+ if (search_knowledge) {
350314
+ allTools.push(search_knowledge);
350315
+ }
350316
+ iterationSpan?.setAttribute("autonomous.tools", allTools?.map((t5) => t5.name).join(", "));
350317
+ return allTools.map((tool) => tool.clone({
350318
+ handler: asyncResource.bind((args, ctx2) => {
350319
+ let err = null;
350320
+ const result = span("autonomous.tool", {
350321
+ "autonomous.tool.name": tool.name,
350322
+ "autonomous.tool.input": args
350323
+ }, async (s2) => {
350324
+ const value2 = tool.execute(args, ctx2).catch((e6) => {
350325
+ err = e6;
350326
+ if (err && err?.constructor && err?.constructor?.name && err?.constructor?.name === "ThinkSignal") {
350327
+ s2.setAttributes({
350328
+ "autonomous.tool.status": "think"
350329
+ });
350330
+ s2.setStatus({
350331
+ code: SpanStatusCode.UNSET,
350332
+ message: "ThinkSignal"
350333
+ });
350334
+ err[HandledErrorProp] = true;
350335
+ throw err;
350336
+ } else {
350337
+ s2.setAttributes({
350338
+ "autonomous.tool.status": "error",
350339
+ "autonomous.tool.error": err.message
350340
+ });
350341
+ s2.setStatus({
350342
+ code: SpanStatusCode.ERROR,
350343
+ message: err.message
350344
+ });
350345
+ s2.recordException(err);
350346
+ throw err;
350347
+ }
350348
+ });
350349
+ s2.setAttributes({
350350
+ "autonomous.tool.output": value2,
350351
+ "autonomous.tool.status": "success"
350352
+ });
350353
+ return value2;
350302
350354
  });
350303
- }
350355
+ if (err) {
350356
+ throw err;
350357
+ }
350358
+ return result;
350359
+ })
350304
350360
  }));
350305
350361
  }
350306
350362
  },
350307
- ...props.objects && { objects: props.objects },
350308
350363
  ...props.exits && { exits: props.exits },
350309
350364
  ...joinedSignal && { signal: joinedSignal },
350310
350365
  ...props.hooks?.onBeforeTool && {
350311
- onBeforeTool: props.hooks.onBeforeTool
350366
+ onBeforeTool: asyncResource.bind(props.hooks.onBeforeTool)
350312
350367
  },
350313
350368
  ...props.hooks?.onAfterTool && {
350314
- onAfterTool: props.hooks.onAfterTool
350369
+ onAfterTool: asyncResource.bind(props.hooks.onAfterTool)
350315
350370
  },
350316
350371
  ...props.hooks?.onBeforeExecution && {
350317
- onBeforeExecution: props.hooks.onBeforeExecution
350372
+ onBeforeExecution: asyncResource.bind(props.hooks.onBeforeExecution)
350373
+ },
350374
+ ...props.hooks?.onExit && {
350375
+ onExit: asyncResource.bind(props.hooks.onExit)
350318
350376
  },
350319
- ...props.hooks?.onExit && { onExit: props.hooks.onExit },
350320
350377
  onTrace: ({ trace: trace2, iteration }) => {
350321
350378
  if (trace2.type === "code_execution") {} else if (trace2.type === "llm_call_started") {} else if (trace2.type === "llm_call_success") {
350322
350379
  iterationSpan?.setAttribute("autonomous.code", trace2.code);
@@ -350328,7 +350385,9 @@ Always prefer information from the knowledge bases over general knowledge when a
350328
350385
  "property.value": trace2.value
350329
350386
  });
350330
350387
  }
350331
- props.hooks?.onTrace?.({ trace: trace2, iteration });
350388
+ if (props.hooks?.onTrace) {
350389
+ return asyncResource.runInAsyncScope(() => props.hooks.onTrace({ trace: trace2, iteration }));
350390
+ }
350332
350391
  },
350333
350392
  onIterationEnd: async (iteration, controller) => {
350334
350393
  iterationSpan?.setAttributes({
@@ -350372,8 +350431,9 @@ ${iteration.status.execution_error.stack}`;
350372
350431
  });
350373
350432
  }
350374
350433
  iterationSpan?.end();
350375
- contextManager.enterWith(execSpan.ctx);
350376
- await props.hooks?.onIterationEnd?.(iteration, controller);
350434
+ if (props.hooks?.onIterationEnd) {
350435
+ return await asyncResource.runInAsyncScope(() => props.hooks.onIterationEnd(iteration, controller));
350436
+ }
350377
350437
  }
350378
350438
  });
350379
350439
  execSpan.setAttribute("autonomous.execution_id", execution.context.id);
@@ -350904,6 +350964,8 @@ ${iteration.status.execution_error.stack}`;
350904
350964
  dedent = createDedent({});
350905
350965
  init_define_BUILD();
350906
350966
  init_define_PACKAGE_VERSIONS();
350967
+ init_define_BUILD();
350968
+ init_define_PACKAGE_VERSIONS();
350907
350969
  Transcript = {
350908
350970
  SUMMARY_MAX_MESSAGES: 50,
350909
350971
  SUMMARY_END_PADDING: 10,
@@ -350914,9 +350976,6 @@ ${iteration.status.execution_error.stack}`;
350914
350976
  init_define_PACKAGE_VERSIONS();
350915
350977
  init_define_BUILD();
350916
350978
  init_define_PACKAGE_VERSIONS();
350917
- OutgoingMessages = Object.values(DefaultComponents);
350918
- init_define_BUILD();
350919
- init_define_PACKAGE_VERSIONS();
350920
350979
  AttachmentSchema = X.object({
350921
350980
  type: X.literal("image"),
350922
350981
  url: X.string()
@@ -367691,7 +367750,7 @@ class AgentProjectGenerator {
367691
367750
  deploy: "adk deploy"
367692
367751
  },
367693
367752
  dependencies: {
367694
- "@botpress/runtime": "^1.0.0"
367753
+ "@botpress/runtime": "^1.3.7"
367695
367754
  },
367696
367755
  devDependencies: {
367697
367756
  typescript: "^5.0.0"
@@ -375586,7 +375645,7 @@ var init_Separator = __esm(async () => {
375586
375645
  var require_package3 = __commonJS((exports, module) => {
375587
375646
  module.exports = {
375588
375647
  name: "@botpress/adk",
375589
- version: "1.3.4",
375648
+ version: "1.3.7",
375590
375649
  description: "Core ADK library for building AI agents on Botpress",
375591
375650
  type: "module",
375592
375651
  main: "dist/index.js",
@@ -375633,7 +375692,7 @@ var require_package3 = __commonJS((exports, module) => {
375633
375692
  "@botpress/cli": "^4.20",
375634
375693
  "@botpress/client": "1.26.0",
375635
375694
  "@botpress/cognitive": "0.1.47",
375636
- "@botpress/runtime": "^1.3.4",
375695
+ "@botpress/runtime": "^1.3.6",
375637
375696
  "@botpress/sdk": "4.17.0",
375638
375697
  "@bpinternal/yargs-extra": "^0.0.21",
375639
375698
  "@parcel/watcher": "^2.5.1",
@@ -378838,7 +378897,7 @@ function checkRuntimeVersion(agentRoot) {
378838
378897
  `));
378839
378898
  }
378840
378899
  }
378841
- var semver, EXPECTED_RUNTIME_VERSION = "1.3.4";
378900
+ var semver, EXPECTED_RUNTIME_VERSION = "1.3.7";
378842
378901
  var init_runtime_version_check = __esm(() => {
378843
378902
  init_source();
378844
378903
  semver = __toESM(require_semver3(), 1);
@@ -385694,6 +385753,896 @@ var init_adk_remove = __esm(async () => {
385694
385753
  jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
385695
385754
  });
385696
385755
 
385756
+ // src/components/Table.tsx
385757
+ function Table({ columns, data, getKey }) {
385758
+ const totalWidth = columns.reduce((sum, col) => sum + col.width, 0);
385759
+ return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
385760
+ flexDirection: "column",
385761
+ children: [
385762
+ /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
385763
+ children: columns.map((col, idx) => /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
385764
+ width: col.width,
385765
+ children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
385766
+ bold: true,
385767
+ dimColor: true,
385768
+ children: col.header
385769
+ }, undefined, false, undefined, this)
385770
+ }, idx, false, undefined, this))
385771
+ }, undefined, false, undefined, this),
385772
+ /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
385773
+ dimColor: true,
385774
+ children: "\u2500".repeat(totalWidth)
385775
+ }, undefined, false, undefined, this),
385776
+ data.map((row, idx) => /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
385777
+ children: columns.map((col, colIdx) => /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
385778
+ width: col.width,
385779
+ children: col.render(row)
385780
+ }, colIdx, false, undefined, this))
385781
+ }, getKey(row, idx), false, undefined, this))
385782
+ ]
385783
+ }, undefined, true, undefined, this);
385784
+ }
385785
+ var jsx_dev_runtime25;
385786
+ var init_Table = __esm(async () => {
385787
+ await init_build2();
385788
+ jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
385789
+ });
385790
+
385791
+ // src/commands/adk-search.tsx
385792
+ var exports_adk_search = {};
385793
+ __export(exports_adk_search, {
385794
+ adkSearch: () => adkSearch
385795
+ });
385796
+ async function adkSearch(query, options = {}) {
385797
+ const { IntegrationOperations: IntegrationOperations2 } = await Promise.resolve().then(() => (init_dist11(), exports_dist6));
385798
+ const format4 = options.format || "table";
385799
+ const limit = options.limit || 20;
385800
+ const SearchIntegrations = () => {
385801
+ const [status, setStatus] = import_react43.default.useState("searching");
385802
+ const [results, setResults] = import_react43.default.useState([]);
385803
+ const [error, setError] = import_react43.default.useState("");
385804
+ import_react43.default.useEffect(() => {
385805
+ const runSearch = async () => {
385806
+ try {
385807
+ const operations = new IntegrationOperations2;
385808
+ const searchResults = await operations.searchIntegrations(query);
385809
+ const limitedResults = searchResults.slice(0, limit);
385810
+ setResults(limitedResults);
385811
+ setStatus("success");
385812
+ } catch (err) {
385813
+ setError(err instanceof Error ? err.message : String(err));
385814
+ setStatus("error");
385815
+ }
385816
+ };
385817
+ runSearch();
385818
+ }, []);
385819
+ if (status === "searching") {
385820
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385821
+ flexDirection: "column",
385822
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385823
+ children: [
385824
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385825
+ color: "cyan",
385826
+ children: "\u27A4"
385827
+ }, undefined, false, undefined, this),
385828
+ " Searching integrations for",
385829
+ " ",
385830
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385831
+ bold: true,
385832
+ children: [
385833
+ '"',
385834
+ query,
385835
+ '"'
385836
+ ]
385837
+ }, undefined, true, undefined, this),
385838
+ "..."
385839
+ ]
385840
+ }, undefined, true, undefined, this)
385841
+ }, undefined, false, undefined, this);
385842
+ }
385843
+ if (status === "error") {
385844
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385845
+ flexDirection: "column",
385846
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385847
+ color: "red",
385848
+ children: [
385849
+ "\u2717 Failed to search integrations: ",
385850
+ error
385851
+ ]
385852
+ }, undefined, true, undefined, this)
385853
+ }, undefined, false, undefined, this);
385854
+ }
385855
+ if (status === "success") {
385856
+ if (results.length === 0) {
385857
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385858
+ flexDirection: "column",
385859
+ children: [
385860
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385861
+ color: "yellow",
385862
+ children: [
385863
+ 'No integrations found matching "',
385864
+ query,
385865
+ '"'
385866
+ ]
385867
+ }, undefined, true, undefined, this),
385868
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385869
+ marginTop: 1,
385870
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385871
+ dimColor: true,
385872
+ children: [
385873
+ "Try a different search term or run",
385874
+ " ",
385875
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385876
+ color: "cyan",
385877
+ children: "adk list --available"
385878
+ }, undefined, false, undefined, this),
385879
+ " to see all integrations"
385880
+ ]
385881
+ }, undefined, true, undefined, this)
385882
+ }, undefined, false, undefined, this)
385883
+ ]
385884
+ }, undefined, true, undefined, this);
385885
+ }
385886
+ if (format4 === "json") {
385887
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385888
+ flexDirection: "column",
385889
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385890
+ children: JSON.stringify(results, null, 2)
385891
+ }, undefined, false, undefined, this)
385892
+ }, undefined, false, undefined, this);
385893
+ }
385894
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385895
+ flexDirection: "column",
385896
+ children: [
385897
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385898
+ bold: true,
385899
+ children: [
385900
+ "Found ",
385901
+ results.length,
385902
+ " integration",
385903
+ results.length !== 1 ? "s" : "",
385904
+ " ",
385905
+ 'matching "',
385906
+ query,
385907
+ '"'
385908
+ ]
385909
+ }, undefined, true, undefined, this),
385910
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385911
+ marginTop: 1,
385912
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Table, {
385913
+ columns: [
385914
+ {
385915
+ header: "Name",
385916
+ width: 25,
385917
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385918
+ color: "cyan",
385919
+ children: row.name
385920
+ }, undefined, false, undefined, this)
385921
+ },
385922
+ {
385923
+ header: "Version",
385924
+ width: 12,
385925
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385926
+ dimColor: true,
385927
+ children: row.version
385928
+ }, undefined, false, undefined, this)
385929
+ },
385930
+ {
385931
+ header: "Title",
385932
+ width: 25,
385933
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385934
+ children: row.title || "-"
385935
+ }, undefined, false, undefined, this)
385936
+ },
385937
+ {
385938
+ header: "Description",
385939
+ width: 40,
385940
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385941
+ dimColor: true,
385942
+ children: row.description ? row.description.length > 37 ? row.description.slice(0, 37) + "..." : row.description : "-"
385943
+ }, undefined, false, undefined, this)
385944
+ }
385945
+ ],
385946
+ data: results,
385947
+ getKey: (row) => row.name
385948
+ }, undefined, false, undefined, this)
385949
+ }, undefined, false, undefined, this),
385950
+ results.length >= limit && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385951
+ marginTop: 1,
385952
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385953
+ dimColor: true,
385954
+ children: [
385955
+ "Showing first ",
385956
+ limit,
385957
+ " results. Use",
385958
+ " ",
385959
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385960
+ color: "cyan",
385961
+ children: "--limit"
385962
+ }, undefined, false, undefined, this),
385963
+ " to see more."
385964
+ ]
385965
+ }, undefined, true, undefined, this)
385966
+ }, undefined, false, undefined, this),
385967
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
385968
+ marginTop: 1,
385969
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385970
+ dimColor: true,
385971
+ children: [
385972
+ "Run ",
385973
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
385974
+ color: "cyan",
385975
+ children: "adk info <name>"
385976
+ }, undefined, false, undefined, this),
385977
+ " to see integration details"
385978
+ ]
385979
+ }, undefined, true, undefined, this)
385980
+ }, undefined, false, undefined, this)
385981
+ ]
385982
+ }, undefined, true, undefined, this);
385983
+ }
385984
+ return null;
385985
+ };
385986
+ render_default(/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(SearchIntegrations, {}, undefined, false, undefined, this));
385987
+ }
385988
+ var import_react43, jsx_dev_runtime26;
385989
+ var init_adk_search = __esm(async () => {
385990
+ await __promiseAll([
385991
+ init_build2(),
385992
+ init_Table()
385993
+ ]);
385994
+ import_react43 = __toESM(require_react(), 1);
385995
+ jsx_dev_runtime26 = __toESM(require_jsx_dev_runtime(), 1);
385996
+ });
385997
+
385998
+ // src/commands/adk-list.tsx
385999
+ var exports_adk_list = {};
386000
+ __export(exports_adk_list, {
386001
+ adkList: () => adkList
386002
+ });
386003
+ async function adkList(options = {}) {
386004
+ const { IntegrationOperations: IntegrationOperations2 } = await Promise.resolve().then(() => (init_dist11(), exports_dist6));
386005
+ const format4 = options.format || "table";
386006
+ const limit = options.limit || 50;
386007
+ const ListIntegrations = () => {
386008
+ const [status, setStatus] = import_react44.default.useState("loading");
386009
+ const [integrations, setIntegrations] = import_react44.default.useState([]);
386010
+ const [error, setError] = import_react44.default.useState("");
386011
+ import_react44.default.useEffect(() => {
386012
+ const loadIntegrations = async () => {
386013
+ try {
386014
+ let projectPath;
386015
+ if (!options.available) {
386016
+ try {
386017
+ projectPath = await findAgentRootOrFail(process.cwd());
386018
+ } catch {
386019
+ setError("Not in an ADK agent directory. Run from an agent project or use --available to list all integrations.");
386020
+ setStatus("error");
386021
+ return;
386022
+ }
386023
+ }
386024
+ const operations = new IntegrationOperations2({
386025
+ projectPath
386026
+ });
386027
+ if (options.available) {
386028
+ const available = await operations.getAllAvailableIntegrations();
386029
+ const limitedResults = available.slice(0, limit);
386030
+ setIntegrations(limitedResults.map((i2) => ({
386031
+ name: i2.name,
386032
+ version: i2.version,
386033
+ title: i2.title,
386034
+ status: "available"
386035
+ })));
386036
+ } else {
386037
+ const installed = await operations.listIntegrations();
386038
+ const installedSet = new Set(installed.map((i2) => i2.name));
386039
+ setIntegrations(installed.map((i2) => ({
386040
+ alias: i2.alias,
386041
+ name: i2.name,
386042
+ version: i2.version,
386043
+ status: "installed"
386044
+ })));
386045
+ }
386046
+ setStatus("success");
386047
+ } catch (err) {
386048
+ setError(err instanceof Error ? err.message : String(err));
386049
+ setStatus("error");
386050
+ }
386051
+ };
386052
+ loadIntegrations();
386053
+ }, []);
386054
+ if (status === "loading") {
386055
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386056
+ flexDirection: "column",
386057
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386058
+ children: [
386059
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386060
+ color: "cyan",
386061
+ children: "\u27A4"
386062
+ }, undefined, false, undefined, this),
386063
+ " Loading integrations..."
386064
+ ]
386065
+ }, undefined, true, undefined, this)
386066
+ }, undefined, false, undefined, this);
386067
+ }
386068
+ if (status === "error") {
386069
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386070
+ flexDirection: "column",
386071
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386072
+ color: "red",
386073
+ children: [
386074
+ "\u2717 Failed to list integrations: ",
386075
+ error
386076
+ ]
386077
+ }, undefined, true, undefined, this)
386078
+ }, undefined, false, undefined, this);
386079
+ }
386080
+ if (status === "success") {
386081
+ if (integrations.length === 0) {
386082
+ if (options.available) {
386083
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386084
+ flexDirection: "column",
386085
+ children: [
386086
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386087
+ color: "yellow",
386088
+ children: "No integrations available"
386089
+ }, undefined, false, undefined, this),
386090
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386091
+ marginTop: 1,
386092
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386093
+ dimColor: true,
386094
+ children: [
386095
+ "Try running ",
386096
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386097
+ color: "cyan",
386098
+ children: "adk hub refresh"
386099
+ }, undefined, false, undefined, this),
386100
+ " to update the cache"
386101
+ ]
386102
+ }, undefined, true, undefined, this)
386103
+ }, undefined, false, undefined, this)
386104
+ ]
386105
+ }, undefined, true, undefined, this);
386106
+ } else {
386107
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386108
+ flexDirection: "column",
386109
+ children: [
386110
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386111
+ color: "yellow",
386112
+ children: "No integrations installed"
386113
+ }, undefined, false, undefined, this),
386114
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386115
+ marginTop: 1,
386116
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386117
+ dimColor: true,
386118
+ children: [
386119
+ "Run ",
386120
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386121
+ color: "cyan",
386122
+ children: "adk add <integration>"
386123
+ }, undefined, false, undefined, this),
386124
+ " to add integrations"
386125
+ ]
386126
+ }, undefined, true, undefined, this)
386127
+ }, undefined, false, undefined, this)
386128
+ ]
386129
+ }, undefined, true, undefined, this);
386130
+ }
386131
+ }
386132
+ if (format4 === "json") {
386133
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386134
+ flexDirection: "column",
386135
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386136
+ children: JSON.stringify(integrations, null, 2)
386137
+ }, undefined, false, undefined, this)
386138
+ }, undefined, false, undefined, this);
386139
+ }
386140
+ const title = options.available ? `Available Integrations (${integrations.length}${integrations.length >= limit ? `+` : ""})` : `Installed Integrations (${integrations.length})`;
386141
+ const columns = options.available ? [
386142
+ {
386143
+ header: "Name",
386144
+ width: 30,
386145
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386146
+ children: row.name
386147
+ }, undefined, false, undefined, this)
386148
+ },
386149
+ {
386150
+ header: "Version",
386151
+ width: 15,
386152
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386153
+ dimColor: true,
386154
+ children: row.version
386155
+ }, undefined, false, undefined, this)
386156
+ },
386157
+ {
386158
+ header: "Title",
386159
+ width: 35,
386160
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386161
+ dimColor: true,
386162
+ children: row.title || "-"
386163
+ }, undefined, false, undefined, this)
386164
+ }
386165
+ ] : [
386166
+ {
386167
+ header: "Alias",
386168
+ width: 20,
386169
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386170
+ color: "cyan",
386171
+ children: row.alias
386172
+ }, undefined, false, undefined, this)
386173
+ },
386174
+ {
386175
+ header: "Name",
386176
+ width: 30,
386177
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386178
+ children: row.name
386179
+ }, undefined, false, undefined, this)
386180
+ },
386181
+ {
386182
+ header: "Version",
386183
+ width: 15,
386184
+ render: (row) => /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386185
+ dimColor: true,
386186
+ children: row.version
386187
+ }, undefined, false, undefined, this)
386188
+ }
386189
+ ];
386190
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386191
+ flexDirection: "column",
386192
+ children: [
386193
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386194
+ bold: true,
386195
+ children: title
386196
+ }, undefined, false, undefined, this),
386197
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386198
+ marginTop: 1,
386199
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Table, {
386200
+ columns,
386201
+ data: integrations,
386202
+ getKey: (row) => row.alias || row.name
386203
+ }, undefined, false, undefined, this)
386204
+ }, undefined, false, undefined, this),
386205
+ integrations.length >= limit && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386206
+ marginTop: 1,
386207
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386208
+ dimColor: true,
386209
+ children: [
386210
+ "Showing first ",
386211
+ limit,
386212
+ " results. Use",
386213
+ " ",
386214
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386215
+ color: "cyan",
386216
+ children: "--limit"
386217
+ }, undefined, false, undefined, this),
386218
+ " to see more."
386219
+ ]
386220
+ }, undefined, true, undefined, this)
386221
+ }, undefined, false, undefined, this),
386222
+ !options.available && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386223
+ marginTop: 1,
386224
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386225
+ dimColor: true,
386226
+ children: [
386227
+ "Run ",
386228
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386229
+ color: "cyan",
386230
+ children: "adk list --available"
386231
+ }, undefined, false, undefined, this),
386232
+ " to see all available integrations"
386233
+ ]
386234
+ }, undefined, true, undefined, this)
386235
+ }, undefined, false, undefined, this),
386236
+ options.available && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
386237
+ marginTop: 1,
386238
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386239
+ dimColor: true,
386240
+ children: [
386241
+ "Run ",
386242
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
386243
+ color: "cyan",
386244
+ children: "adk add <name>"
386245
+ }, undefined, false, undefined, this),
386246
+ " to install an integration"
386247
+ ]
386248
+ }, undefined, true, undefined, this)
386249
+ }, undefined, false, undefined, this)
386250
+ ]
386251
+ }, undefined, true, undefined, this);
386252
+ }
386253
+ return null;
386254
+ };
386255
+ render_default(/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(ListIntegrations, {}, undefined, false, undefined, this));
386256
+ }
386257
+ var import_react44, jsx_dev_runtime27;
386258
+ var init_adk_list = __esm(async () => {
386259
+ init_agent_root();
386260
+ await __promiseAll([
386261
+ init_build2(),
386262
+ init_Table()
386263
+ ]);
386264
+ import_react44 = __toESM(require_react(), 1);
386265
+ jsx_dev_runtime27 = __toESM(require_jsx_dev_runtime(), 1);
386266
+ });
386267
+
386268
+ // src/commands/adk-integration.tsx
386269
+ var exports_adk_integration = {};
386270
+ __export(exports_adk_integration, {
386271
+ adkIntegrationInfo: () => adkIntegrationInfo
386272
+ });
386273
+ function renderSchema(schema) {
386274
+ try {
386275
+ if (schema.type === "object" && schema.properties) {
386276
+ const required2 = schema.required || [];
386277
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386278
+ marginLeft: 2,
386279
+ flexDirection: "column",
386280
+ children: Object.entries(schema.properties).map(([key, prop]) => {
386281
+ const isRequired = required2.includes(key);
386282
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386283
+ dimColor: true,
386284
+ children: [
386285
+ "\u2022 ",
386286
+ key,
386287
+ isRequired && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386288
+ color: "yellow",
386289
+ children: "*"
386290
+ }, undefined, false, undefined, this),
386291
+ ":",
386292
+ " ",
386293
+ prop.type || "any",
386294
+ prop.description && ` - ${prop.description}`
386295
+ ]
386296
+ }, key, true, undefined, this);
386297
+ })
386298
+ }, undefined, false, undefined, this);
386299
+ }
386300
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386301
+ marginLeft: 2,
386302
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386303
+ dimColor: true,
386304
+ children: [
386305
+ "Type: ",
386306
+ schema.type || "any"
386307
+ ]
386308
+ }, undefined, true, undefined, this)
386309
+ }, undefined, false, undefined, this);
386310
+ } catch {
386311
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386312
+ marginLeft: 2,
386313
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386314
+ dimColor: true,
386315
+ children: JSON.stringify(schema)
386316
+ }, undefined, false, undefined, this)
386317
+ }, undefined, false, undefined, this);
386318
+ }
386319
+ }
386320
+ async function adkIntegrationInfo(integrationName, options = {}) {
386321
+ const { IntegrationManager: IntegrationManager2 } = await Promise.resolve().then(() => (init_dist11(), exports_dist6));
386322
+ const format4 = options.format || "table";
386323
+ const showAll = options.full || !options.actions && !options.channels && !options.events;
386324
+ const IntegrationInfo = () => {
386325
+ const [status, setStatus] = import_react45.default.useState("loading");
386326
+ const [integration, setIntegration] = import_react45.default.useState(null);
386327
+ const [error, setError] = import_react45.default.useState("");
386328
+ import_react45.default.useEffect(() => {
386329
+ const loadIntegration = async () => {
386330
+ try {
386331
+ const manager = new IntegrationManager2;
386332
+ const definition = await manager.fetchIntegration({
386333
+ name: integrationName,
386334
+ version: "latest",
386335
+ fullName: integrationName
386336
+ });
386337
+ setIntegration(definition);
386338
+ setStatus("success");
386339
+ } catch (err) {
386340
+ setError(err instanceof Error ? err.message : String(err));
386341
+ setStatus("error");
386342
+ }
386343
+ };
386344
+ loadIntegration();
386345
+ }, []);
386346
+ if (status === "loading") {
386347
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386348
+ flexDirection: "column",
386349
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386350
+ children: [
386351
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386352
+ color: "cyan",
386353
+ children: "\u27A4"
386354
+ }, undefined, false, undefined, this),
386355
+ " Loading integration",
386356
+ " ",
386357
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386358
+ bold: true,
386359
+ children: integrationName
386360
+ }, undefined, false, undefined, this),
386361
+ "..."
386362
+ ]
386363
+ }, undefined, true, undefined, this)
386364
+ }, undefined, false, undefined, this);
386365
+ }
386366
+ if (status === "error") {
386367
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386368
+ flexDirection: "column",
386369
+ children: [
386370
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386371
+ color: "red",
386372
+ children: [
386373
+ "\u2717 Failed to load integration: ",
386374
+ error
386375
+ ]
386376
+ }, undefined, true, undefined, this),
386377
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386378
+ marginTop: 1,
386379
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386380
+ dimColor: true,
386381
+ children: [
386382
+ "Run ",
386383
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386384
+ color: "cyan",
386385
+ children: [
386386
+ "adk search ",
386387
+ integrationName
386388
+ ]
386389
+ }, undefined, true, undefined, this),
386390
+ " to find similar integrations"
386391
+ ]
386392
+ }, undefined, true, undefined, this)
386393
+ }, undefined, false, undefined, this)
386394
+ ]
386395
+ }, undefined, true, undefined, this);
386396
+ }
386397
+ if (status === "success" && integration) {
386398
+ if (format4 === "json") {
386399
+ const output = {
386400
+ name: integration.name,
386401
+ version: integration.version,
386402
+ title: integration.title,
386403
+ description: integration.description
386404
+ };
386405
+ if (options.actions || showAll) {
386406
+ output.actions = integration.actions;
386407
+ }
386408
+ if (options.channels || showAll) {
386409
+ output.channels = integration.channels;
386410
+ }
386411
+ if (options.events || showAll) {
386412
+ output.events = integration.events;
386413
+ }
386414
+ if (showAll) {
386415
+ output.configuration = integration.configuration;
386416
+ output.configurations = integration.configurations;
386417
+ }
386418
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386419
+ flexDirection: "column",
386420
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386421
+ children: JSON.stringify(output, null, 2)
386422
+ }, undefined, false, undefined, this)
386423
+ }, undefined, false, undefined, this);
386424
+ }
386425
+ const actionsCount = integration.actions ? Object.keys(integration.actions).length : 0;
386426
+ const channelsCount = integration.channels ? Object.keys(integration.channels).length : 0;
386427
+ const eventsCount = integration.events ? Object.keys(integration.events).length : 0;
386428
+ return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386429
+ flexDirection: "column",
386430
+ children: [
386431
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386432
+ bold: true,
386433
+ children: [
386434
+ integration.title || integration.name,
386435
+ " ",
386436
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386437
+ dimColor: true,
386438
+ children: [
386439
+ "v",
386440
+ integration.version
386441
+ ]
386442
+ }, undefined, true, undefined, this)
386443
+ ]
386444
+ }, undefined, true, undefined, this),
386445
+ integration.description && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386446
+ marginTop: 1,
386447
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386448
+ dimColor: true,
386449
+ children: integration.description
386450
+ }, undefined, false, undefined, this)
386451
+ }, undefined, false, undefined, this),
386452
+ showAll && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386453
+ marginTop: 1,
386454
+ flexDirection: "column",
386455
+ children: [
386456
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386457
+ dimColor: true,
386458
+ children: [
386459
+ "\u2022 ",
386460
+ actionsCount,
386461
+ " action",
386462
+ actionsCount !== 1 ? "s" : ""
386463
+ ]
386464
+ }, undefined, true, undefined, this),
386465
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386466
+ dimColor: true,
386467
+ children: [
386468
+ "\u2022 ",
386469
+ channelsCount,
386470
+ " channel",
386471
+ channelsCount !== 1 ? "s" : ""
386472
+ ]
386473
+ }, undefined, true, undefined, this),
386474
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386475
+ dimColor: true,
386476
+ children: [
386477
+ "\u2022 ",
386478
+ eventsCount,
386479
+ " event",
386480
+ eventsCount !== 1 ? "s" : ""
386481
+ ]
386482
+ }, undefined, true, undefined, this)
386483
+ ]
386484
+ }, undefined, true, undefined, this),
386485
+ (options.actions || showAll) && integration.actions && Object.keys(integration.actions).length > 0 && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386486
+ marginTop: 1,
386487
+ flexDirection: "column",
386488
+ children: [
386489
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386490
+ bold: true,
386491
+ children: "Actions"
386492
+ }, undefined, false, undefined, this),
386493
+ Object.entries(integration.actions).map(([actionName, action]) => /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386494
+ marginTop: 1,
386495
+ flexDirection: "column",
386496
+ children: [
386497
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386498
+ color: "cyan",
386499
+ children: [
386500
+ actionName,
386501
+ action.title && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386502
+ dimColor: true,
386503
+ children: [
386504
+ " - ",
386505
+ action.title
386506
+ ]
386507
+ }, undefined, true, undefined, this)
386508
+ ]
386509
+ }, undefined, true, undefined, this),
386510
+ action.description && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386511
+ dimColor: true,
386512
+ children: [
386513
+ " ",
386514
+ action.description
386515
+ ]
386516
+ }, undefined, true, undefined, this),
386517
+ action.input?.schema && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386518
+ marginLeft: 2,
386519
+ flexDirection: "column",
386520
+ children: [
386521
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386522
+ dimColor: true,
386523
+ children: "Input:"
386524
+ }, undefined, false, undefined, this),
386525
+ renderSchema(action.input.schema)
386526
+ ]
386527
+ }, undefined, true, undefined, this),
386528
+ action.output?.schema && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386529
+ marginLeft: 2,
386530
+ flexDirection: "column",
386531
+ children: [
386532
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386533
+ dimColor: true,
386534
+ children: "Output:"
386535
+ }, undefined, false, undefined, this),
386536
+ renderSchema(action.output.schema)
386537
+ ]
386538
+ }, undefined, true, undefined, this)
386539
+ ]
386540
+ }, actionName, true, undefined, this))
386541
+ ]
386542
+ }, undefined, true, undefined, this),
386543
+ (options.channels || showAll) && integration.channels && Object.keys(integration.channels).length > 0 && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386544
+ marginTop: 1,
386545
+ flexDirection: "column",
386546
+ children: [
386547
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386548
+ bold: true,
386549
+ children: "Channels"
386550
+ }, undefined, false, undefined, this),
386551
+ Object.entries(integration.channels).map(([channelName, channel]) => /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386552
+ marginTop: 1,
386553
+ flexDirection: "column",
386554
+ children: [
386555
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386556
+ color: "cyan",
386557
+ children: [
386558
+ channelName,
386559
+ channel.title && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386560
+ dimColor: true,
386561
+ children: [
386562
+ " - ",
386563
+ channel.title
386564
+ ]
386565
+ }, undefined, true, undefined, this)
386566
+ ]
386567
+ }, undefined, true, undefined, this),
386568
+ channel.description && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386569
+ dimColor: true,
386570
+ children: [
386571
+ " ",
386572
+ channel.description
386573
+ ]
386574
+ }, undefined, true, undefined, this)
386575
+ ]
386576
+ }, channelName, true, undefined, this))
386577
+ ]
386578
+ }, undefined, true, undefined, this),
386579
+ (options.events || showAll) && integration.events && Object.keys(integration.events).length > 0 && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386580
+ marginTop: 1,
386581
+ flexDirection: "column",
386582
+ children: [
386583
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386584
+ bold: true,
386585
+ children: "Events"
386586
+ }, undefined, false, undefined, this),
386587
+ Object.entries(integration.events).map(([eventName, event2]) => /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386588
+ marginTop: 1,
386589
+ flexDirection: "column",
386590
+ children: [
386591
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386592
+ color: "cyan",
386593
+ children: [
386594
+ eventName,
386595
+ event2.title && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386596
+ dimColor: true,
386597
+ children: [
386598
+ " - ",
386599
+ event2.title
386600
+ ]
386601
+ }, undefined, true, undefined, this)
386602
+ ]
386603
+ }, undefined, true, undefined, this),
386604
+ event2.description && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386605
+ dimColor: true,
386606
+ children: [
386607
+ " ",
386608
+ event2.description
386609
+ ]
386610
+ }, undefined, true, undefined, this)
386611
+ ]
386612
+ }, eventName, true, undefined, this))
386613
+ ]
386614
+ }, undefined, true, undefined, this),
386615
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
386616
+ marginTop: 1,
386617
+ children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386618
+ dimColor: true,
386619
+ children: [
386620
+ "Run ",
386621
+ /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
386622
+ color: "cyan",
386623
+ children: [
386624
+ "adk add ",
386625
+ integration.name
386626
+ ]
386627
+ }, undefined, true, undefined, this),
386628
+ " to install this integration"
386629
+ ]
386630
+ }, undefined, true, undefined, this)
386631
+ }, undefined, false, undefined, this)
386632
+ ]
386633
+ }, undefined, true, undefined, this);
386634
+ }
386635
+ return null;
386636
+ };
386637
+ render_default(/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(IntegrationInfo, {}, undefined, false, undefined, this));
386638
+ }
386639
+ var import_react45, jsx_dev_runtime28;
386640
+ var init_adk_integration = __esm(async () => {
386641
+ await init_build2();
386642
+ import_react45 = __toESM(require_react(), 1);
386643
+ jsx_dev_runtime28 = __toESM(require_jsx_dev_runtime(), 1);
386644
+ });
386645
+
385697
386646
  // ../../node_modules/.bun/minipass@7.1.2/node_modules/minipass/dist/esm/index.js
385698
386647
  import { EventEmitter as EventEmitter8 } from "events";
385699
386648
  import Stream3 from "stream";
@@ -393759,7 +394708,7 @@ async function adkLink(options) {
393759
394708
  return;
393760
394709
  }
393761
394710
  } catch (_4) {}
393762
- render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(LinkSetup, {
394711
+ render_default(/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(LinkSetup, {
393763
394712
  initialWorkspaceId: options.workspace,
393764
394713
  initialBotId: options.bot,
393765
394714
  initialDevId: options.dev
@@ -393769,16 +394718,16 @@ async function adkLink(options) {
393769
394718
  process.exit(1);
393770
394719
  }
393771
394720
  }
393772
- var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSelect }) => {
394721
+ var import_react46, jsx_dev_runtime29, WorkspaceSelector = ({ workspaces, onSelect }) => {
393773
394722
  const dropdownOptions = workspaces.map((ws5) => ({
393774
394723
  id: ws5.id,
393775
394724
  label: `${ws5.name} (${ws5.handle}) - ${ws5.plan || "Free"}`,
393776
394725
  value: ws5.id,
393777
394726
  description: ws5.handle
393778
394727
  }));
393779
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
394728
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
393780
394729
  flexDirection: "column",
393781
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(UserInput, {
394730
+ children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(UserInput, {
393782
394731
  prompt: "\uD83D\uDCCB Select a workspace (type to search):",
393783
394732
  placeholder: "Start typing to search workspaces...",
393784
394733
  allowTextInput: true,
@@ -393816,9 +394765,9 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
393816
394765
  description: `ID: ${bot.id}`
393817
394766
  }))
393818
394767
  ];
393819
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
394768
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
393820
394769
  flexDirection: "column",
393821
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(UserInput, {
394770
+ children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(UserInput, {
393822
394771
  prompt: "\uD83E\uDD16 Select a bot or create a new one (type to search):",
393823
394772
  placeholder: "Start typing to search bots...",
393824
394773
  allowTextInput: true,
@@ -393848,9 +394797,9 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
393848
394797
  }, undefined, false, undefined, this)
393849
394798
  }, undefined, false, undefined, this);
393850
394799
  }, BotNameInput = ({ onSubmit }) => {
393851
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
394800
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
393852
394801
  flexDirection: "column",
393853
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(UserInput, {
394802
+ children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(UserInput, {
393854
394803
  prompt: "\uD83E\uDD16 Enter a name for your new bot:",
393855
394804
  placeholder: "My awesome bot",
393856
394805
  allowTextInput: true,
@@ -393871,15 +394820,15 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
393871
394820
  }, undefined, false, undefined, this)
393872
394821
  }, undefined, false, undefined, this);
393873
394822
  }, LinkSetup = ({ initialWorkspaceId, initialBotId, initialDevId }) => {
393874
- const [step2, setStep] = import_react43.useState(initialWorkspaceId ? "bots" : "workspaces");
393875
- const [workspaces, setWorkspaces] = import_react43.useState([]);
393876
- const [selectedWorkspace, setSelectedWorkspace] = import_react43.useState(null);
393877
- const [bots, setBots] = import_react43.useState([]);
393878
- const [selectedBot, setSelectedBot] = import_react43.useState(null);
393879
- const [devId] = import_react43.useState(initialDevId);
393880
- const [error, setError] = import_react43.useState(null);
393881
- const [loading, setLoading] = import_react43.useState(true);
393882
- import_react43.useEffect(() => {
394823
+ const [step2, setStep] = import_react46.useState(initialWorkspaceId ? "bots" : "workspaces");
394824
+ const [workspaces, setWorkspaces] = import_react46.useState([]);
394825
+ const [selectedWorkspace, setSelectedWorkspace] = import_react46.useState(null);
394826
+ const [bots, setBots] = import_react46.useState([]);
394827
+ const [selectedBot, setSelectedBot] = import_react46.useState(null);
394828
+ const [devId] = import_react46.useState(initialDevId);
394829
+ const [error, setError] = import_react46.useState(null);
394830
+ const [loading, setLoading] = import_react46.useState(true);
394831
+ import_react46.useEffect(() => {
393883
394832
  const initialize2 = async () => {
393884
394833
  try {
393885
394834
  if (initialBotId) {
@@ -393915,7 +394864,7 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
393915
394864
  };
393916
394865
  initialize2();
393917
394866
  }, []);
393918
- import_react43.useEffect(() => {
394867
+ import_react46.useEffect(() => {
393919
394868
  if (selectedWorkspace && step2 === "bots" && !initialBotId) {
393920
394869
  const loadBots = async () => {
393921
394870
  try {
@@ -393986,9 +394935,9 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
393986
394935
  }
393987
394936
  };
393988
394937
  if (error) {
393989
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
394938
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
393990
394939
  flexDirection: "column",
393991
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
394940
+ children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
393992
394941
  color: "red",
393993
394942
  children: [
393994
394943
  "\u274C Error: ",
@@ -393998,9 +394947,9 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
393998
394947
  }, undefined, false, undefined, this);
393999
394948
  }
394000
394949
  if (loading) {
394001
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
394950
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
394002
394951
  flexDirection: "column",
394003
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
394952
+ children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
394004
394953
  color: "blue",
394005
394954
  children: "\u23F3 Loading..."
394006
394955
  }, undefined, false, undefined, this)
@@ -394008,29 +394957,29 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
394008
394957
  }
394009
394958
  switch (step2) {
394010
394959
  case "workspaces":
394011
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(WorkspaceSelector, {
394960
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(WorkspaceSelector, {
394012
394961
  workspaces,
394013
394962
  onSelect: handleWorkspaceSelect
394014
394963
  }, undefined, false, undefined, this);
394015
394964
  case "bots":
394016
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(BotSelector, {
394965
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(BotSelector, {
394017
394966
  bots,
394018
394967
  onSelectBot: handleBotSelect,
394019
394968
  onCreateNew: handleCreateNewBot
394020
394969
  }, undefined, false, undefined, this);
394021
394970
  case "create-bot":
394022
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(BotNameInput, {
394971
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(BotNameInput, {
394023
394972
  onSubmit: handleBotNameSubmit
394024
394973
  }, undefined, false, undefined, this);
394025
394974
  case "done":
394026
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
394975
+ return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
394027
394976
  flexDirection: "column",
394028
394977
  children: [
394029
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
394978
+ /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
394030
394979
  color: "green",
394031
394980
  children: "\u2705 Successfully linked local agent to remote bot!"
394032
394981
  }, undefined, false, undefined, this),
394033
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
394982
+ /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
394034
394983
  color: "gray",
394035
394984
  children: [
394036
394985
  "Bot: ",
@@ -394040,22 +394989,22 @@ var import_react43, jsx_dev_runtime25, WorkspaceSelector = ({ workspaces, onSele
394040
394989
  ")"
394041
394990
  ]
394042
394991
  }, undefined, true, undefined, this),
394043
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
394992
+ /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
394044
394993
  color: "gray",
394045
394994
  children: [
394046
394995
  "Workspace: ",
394047
394996
  selectedWorkspace?.name
394048
394997
  ]
394049
394998
  }, undefined, true, undefined, this),
394050
- devId && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
394999
+ devId && /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
394051
395000
  color: "gray",
394052
395001
  children: [
394053
395002
  "Dev Bot ID: ",
394054
395003
  devId
394055
395004
  ]
394056
395005
  }, undefined, true, undefined, this),
394057
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Newline, {}, undefined, false, undefined, this),
394058
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
395006
+ /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Newline, {}, undefined, false, undefined, this),
395007
+ /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
394059
395008
  color: "blue",
394060
395009
  children: "\uD83C\uDF89 You can now use 'adk deploy' and other remote operations."
394061
395010
  }, undefined, false, undefined, this)
@@ -394075,8 +395024,8 @@ var init_adk_link = __esm(async () => {
394075
395024
  init_build2(),
394076
395025
  init_UserInput()
394077
395026
  ]);
394078
- import_react43 = __toESM(require_react(), 1);
394079
- jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
395027
+ import_react46 = __toESM(require_react(), 1);
395028
+ jsx_dev_runtime29 = __toESM(require_jsx_dev_runtime(), 1);
394080
395029
  });
394081
395030
 
394082
395031
  // src/commands/adk-chat.ts
@@ -394668,7 +395617,7 @@ function formatHelp(cmd, version) {
394668
395617
  const categories = {
394669
395618
  "Getting Started": ["init", "login", "link"],
394670
395619
  Development: ["dev", "build", "deploy", "chat"],
394671
- Dependencies: ["add", "remove", "upgrade"]
395620
+ Dependencies: ["add", "remove", "upgrade", "search", "list", "info"]
394672
395621
  };
394673
395622
  for (const [category, commandNames] of Object.entries(categories)) {
394674
395623
  const categoryCommands = commands.filter((c) => commandNames.includes(c.name()));
@@ -394711,7 +395660,7 @@ function formatHelp(cmd, version) {
394711
395660
  // src/cli.ts
394712
395661
  var __filename2 = fileURLToPath9(import.meta.url);
394713
395662
  var __dirname5 = dirname3(__filename2);
394714
- var CLI_VERSION = "1.5.4";
395663
+ var CLI_VERSION = "1.5.7";
394715
395664
  program.name("adk").description("Botpress Agent Development Kit (ADK) - CLI for building AI agents").version(CLI_VERSION).option("--no-cache", "Disable caching for integration lookups").configureHelp({
394716
395665
  formatHelp: () => formatHelp(program, CLI_VERSION)
394717
395666
  });
@@ -394812,6 +395761,46 @@ program.command("remove").alias("rm").description("Remove an integration from yo
394812
395761
  process.exit(1);
394813
395762
  }
394814
395763
  });
395764
+ program.command("search").description("Search for integrations in the Botpress hub").argument("<query>", "search query").option("--format <format>", "output format (table, json)", "table").option("--limit <number>", "limit number of results", "20").action(async (query, options) => {
395765
+ try {
395766
+ const { adkSearch: adkSearch2 } = await init_adk_search().then(() => exports_adk_search);
395767
+ await adkSearch2(query, {
395768
+ format: options.format,
395769
+ limit: options.limit ? parseInt(options.limit, 10) : 20
395770
+ });
395771
+ } catch (error) {
395772
+ console.error("Error:", error instanceof Error ? error.message : String(error));
395773
+ process.exit(1);
395774
+ }
395775
+ });
395776
+ program.command("list").description("List integrations (installed or available)").option("--available", "list all available integrations").option("--format <format>", "output format (table, json)", "table").option("--limit <number>", "limit number of results", "50").action(async (options) => {
395777
+ try {
395778
+ const { adkList: adkList2 } = await init_adk_list().then(() => exports_adk_list);
395779
+ await adkList2({
395780
+ available: options.available,
395781
+ format: options.format,
395782
+ limit: options.limit ? parseInt(options.limit, 10) : 50
395783
+ });
395784
+ } catch (error) {
395785
+ console.error("Error:", error instanceof Error ? error.message : String(error));
395786
+ process.exit(1);
395787
+ }
395788
+ });
395789
+ program.command("info").description("Show detailed information about an integration").argument("<name>", "integration name").option("--actions", "show only actions").option("--channels", "show only channels").option("--events", "show only events").option("--full", "show all details").option("--format <format>", "output format (table, json)", "table").action(async (name3, options) => {
395790
+ try {
395791
+ const { adkIntegrationInfo: adkIntegrationInfo2 } = await init_adk_integration().then(() => exports_adk_integration);
395792
+ await adkIntegrationInfo2(name3, {
395793
+ actions: options.actions,
395794
+ channels: options.channels,
395795
+ events: options.events,
395796
+ full: options.full,
395797
+ format: options.format
395798
+ });
395799
+ } catch (error) {
395800
+ console.error("Error:", error instanceof Error ? error.message : String(error));
395801
+ process.exit(1);
395802
+ }
395803
+ });
394815
395804
  program.command("self-upgrade").alias("self-update").description("Upgrade ADK CLI to the latest version").action(async () => {
394816
395805
  try {
394817
395806
  const { adkSelfUpgrade: adkSelfUpgrade2 } = await Promise.resolve().then(() => (init_upgrade(), exports_upgrade));