@inkeep/agents-cli 0.0.0-dev-20250925023031 → 0.0.0-dev-20250925033557

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -32,11 +32,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  mod
33
33
  ));
34
34
 
35
- // ../node_modules/.pnpm/tsup@8.5.0_jiti@2.5.1_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js
35
+ // ../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js
36
36
  import path from "path";
37
37
  import { fileURLToPath } from "url";
38
38
  var init_esm_shims = __esm({
39
- "../node_modules/.pnpm/tsup@8.5.0_jiti@2.5.1_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js"() {
39
+ "../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js"() {
40
40
  "use strict";
41
41
  }
42
42
  });
@@ -206,7 +206,7 @@ var init_logger = __esm({
206
206
  }
207
207
  });
208
208
 
209
- // ../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.1.8/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs
209
+ // ../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.1.11/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs
210
210
  function __rest(s2, e2) {
211
211
  var t2 = {};
212
212
  for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0)
@@ -338,7 +338,7 @@ function getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {
338
338
  }
339
339
  var ZodTypeKeys, $ZodRegistry, zodToOpenAPIRegistry, Metadata;
340
340
  var init_dist = __esm({
341
- "../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.1.8/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs"() {
341
+ "../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.1.0_zod@4.1.11/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs"() {
342
342
  "use strict";
343
343
  init_esm_shims();
344
344
  ZodTypeKeys = {
@@ -531,10 +531,10 @@ var init_dist = __esm({
531
531
  }
532
532
  });
533
533
 
534
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/url.js
534
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/url.js
535
535
  var tryDecode, _decodeURI, _getQueryParam, getQueryParam, getQueryParams, decodeURIComponent_;
536
536
  var init_url = __esm({
537
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/url.js"() {
537
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/url.js"() {
538
538
  "use strict";
539
539
  init_esm_shims();
540
540
  tryDecode = (str, decoder) => {
@@ -631,52 +631,52 @@ var init_url = __esm({
631
631
  }
632
632
  });
633
633
 
634
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/cookie.js
634
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/cookie.js
635
635
  var init_cookie = __esm({
636
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/cookie.js"() {
636
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/cookie.js"() {
637
637
  "use strict";
638
638
  init_esm_shims();
639
639
  init_url();
640
640
  }
641
641
  });
642
642
 
643
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/helper/cookie/index.js
643
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/helper/cookie/index.js
644
644
  var init_cookie2 = __esm({
645
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/helper/cookie/index.js"() {
645
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/helper/cookie/index.js"() {
646
646
  "use strict";
647
647
  init_esm_shims();
648
648
  init_cookie();
649
649
  }
650
650
  });
651
651
 
652
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/http-exception.js
652
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/http-exception.js
653
653
  var init_http_exception = __esm({
654
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/http-exception.js"() {
654
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/http-exception.js"() {
655
655
  "use strict";
656
656
  init_esm_shims();
657
657
  }
658
658
  });
659
659
 
660
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/crypto.js
660
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/crypto.js
661
661
  var init_crypto = __esm({
662
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/crypto.js"() {
662
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/crypto.js"() {
663
663
  "use strict";
664
664
  init_esm_shims();
665
665
  }
666
666
  });
667
667
 
668
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/buffer.js
668
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/buffer.js
669
669
  var init_buffer = __esm({
670
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/buffer.js"() {
670
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/buffer.js"() {
671
671
  "use strict";
672
672
  init_esm_shims();
673
673
  init_crypto();
674
674
  }
675
675
  });
676
676
 
677
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/validator/validator.js
677
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/validator/validator.js
678
678
  var init_validator = __esm({
679
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/validator/validator.js"() {
679
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/validator/validator.js"() {
680
680
  "use strict";
681
681
  init_esm_shims();
682
682
  init_cookie2();
@@ -685,43 +685,43 @@ var init_validator = __esm({
685
685
  }
686
686
  });
687
687
 
688
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/validator/index.js
688
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/validator/index.js
689
689
  var init_validator2 = __esm({
690
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/validator/index.js"() {
690
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/validator/index.js"() {
691
691
  "use strict";
692
692
  init_esm_shims();
693
693
  init_validator();
694
694
  }
695
695
  });
696
696
 
697
- // ../node_modules/.pnpm/@hono+zod-validator@0.7.2_hono@4.9.7_zod@4.1.8/node_modules/@hono/zod-validator/dist/index.js
697
+ // ../node_modules/.pnpm/@hono+zod-validator@0.7.3_hono@4.9.8_zod@4.1.11/node_modules/@hono/zod-validator/dist/index.js
698
698
  var init_dist2 = __esm({
699
- "../node_modules/.pnpm/@hono+zod-validator@0.7.2_hono@4.9.7_zod@4.1.8/node_modules/@hono/zod-validator/dist/index.js"() {
699
+ "../node_modules/.pnpm/@hono+zod-validator@0.7.3_hono@4.9.8_zod@4.1.11/node_modules/@hono/zod-validator/dist/index.js"() {
700
700
  "use strict";
701
701
  init_esm_shims();
702
702
  init_validator2();
703
703
  }
704
704
  });
705
705
 
706
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/compose.js
706
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/compose.js
707
707
  var init_compose = __esm({
708
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/compose.js"() {
708
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/compose.js"() {
709
709
  "use strict";
710
710
  init_esm_shims();
711
711
  }
712
712
  });
713
713
 
714
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/request/constants.js
714
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/request/constants.js
715
715
  var GET_MATCH_RESULT;
716
716
  var init_constants = __esm({
717
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/request/constants.js"() {
717
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/request/constants.js"() {
718
718
  "use strict";
719
719
  init_esm_shims();
720
720
  GET_MATCH_RESULT = Symbol();
721
721
  }
722
722
  });
723
723
 
724
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/body.js
724
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/body.js
725
725
  async function parseFormData(request, options) {
726
726
  const formData = await request.formData();
727
727
  if (formData) {
@@ -752,7 +752,7 @@ function convertFormDataToBodyData(formData, options) {
752
752
  }
753
753
  var parseBody, handleParsingAllValues, handleParsingNestedValues;
754
754
  var init_body = __esm({
755
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/body.js"() {
755
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/body.js"() {
756
756
  "use strict";
757
757
  init_esm_shims();
758
758
  init_request();
@@ -798,10 +798,10 @@ var init_body = __esm({
798
798
  }
799
799
  });
800
800
 
801
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/request.js
801
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/request.js
802
802
  var tryDecodeURIComponent, HonoRequest;
803
803
  var init_request = __esm({
804
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/request.js"() {
804
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/request.js"() {
805
805
  "use strict";
806
806
  init_esm_shims();
807
807
  init_constants();
@@ -827,14 +827,14 @@ var init_request = __esm({
827
827
  #getDecodedParam(key) {
828
828
  const paramKey = this.#matchResult[0][this.routeIndex][1][key];
829
829
  const param = this.#getParamValue(paramKey);
830
- return param ? /\%/.test(param) ? tryDecodeURIComponent(param) : param : void 0;
830
+ return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param;
831
831
  }
832
832
  #getAllDecodedParams() {
833
833
  const decoded = {};
834
834
  const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]);
835
835
  for (const key of keys) {
836
836
  const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]);
837
- if (value && typeof value === "string") {
837
+ if (value !== void 0) {
838
838
  decoded[key] = /\%/.test(value) ? tryDecodeURIComponent(value) : value;
839
839
  }
840
840
  }
@@ -919,17 +919,17 @@ var init_request = __esm({
919
919
  }
920
920
  });
921
921
 
922
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/html.js
922
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/html.js
923
923
  var init_html = __esm({
924
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/html.js"() {
924
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/html.js"() {
925
925
  "use strict";
926
926
  init_esm_shims();
927
927
  }
928
928
  });
929
929
 
930
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/context.js
930
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/context.js
931
931
  var init_context = __esm({
932
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/context.js"() {
932
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/context.js"() {
933
933
  "use strict";
934
934
  init_esm_shims();
935
935
  init_request();
@@ -937,25 +937,25 @@ var init_context = __esm({
937
937
  }
938
938
  });
939
939
 
940
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router.js
940
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router.js
941
941
  var init_router = __esm({
942
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router.js"() {
942
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router.js"() {
943
943
  "use strict";
944
944
  init_esm_shims();
945
945
  }
946
946
  });
947
947
 
948
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/constants.js
948
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/constants.js
949
949
  var init_constants2 = __esm({
950
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/utils/constants.js"() {
950
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/utils/constants.js"() {
951
951
  "use strict";
952
952
  init_esm_shims();
953
953
  }
954
954
  });
955
955
 
956
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/hono-base.js
956
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/hono-base.js
957
957
  var init_hono_base = __esm({
958
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/hono-base.js"() {
958
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/hono-base.js"() {
959
959
  "use strict";
960
960
  init_esm_shims();
961
961
  init_compose();
@@ -966,10 +966,10 @@ var init_hono_base = __esm({
966
966
  }
967
967
  });
968
968
 
969
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/node.js
969
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/node.js
970
970
  var PATH_ERROR, regExpMetaChars;
971
971
  var init_node = __esm({
972
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/node.js"() {
972
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/node.js"() {
973
973
  "use strict";
974
974
  init_esm_shims();
975
975
  PATH_ERROR = Symbol();
@@ -977,18 +977,18 @@ var init_node = __esm({
977
977
  }
978
978
  });
979
979
 
980
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/trie.js
980
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/trie.js
981
981
  var init_trie = __esm({
982
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/trie.js"() {
982
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/trie.js"() {
983
983
  "use strict";
984
984
  init_esm_shims();
985
985
  init_node();
986
986
  }
987
987
  });
988
988
 
989
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/router.js
989
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/router.js
990
990
  var init_router2 = __esm({
991
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/router.js"() {
991
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/router.js"() {
992
992
  "use strict";
993
993
  init_esm_shims();
994
994
  init_router();
@@ -998,36 +998,36 @@ var init_router2 = __esm({
998
998
  }
999
999
  });
1000
1000
 
1001
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/index.js
1001
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/index.js
1002
1002
  var init_reg_exp_router = __esm({
1003
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/reg-exp-router/index.js"() {
1003
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/reg-exp-router/index.js"() {
1004
1004
  "use strict";
1005
1005
  init_esm_shims();
1006
1006
  init_router2();
1007
1007
  }
1008
1008
  });
1009
1009
 
1010
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/smart-router/router.js
1010
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/smart-router/router.js
1011
1011
  var init_router3 = __esm({
1012
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/smart-router/router.js"() {
1012
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/smart-router/router.js"() {
1013
1013
  "use strict";
1014
1014
  init_esm_shims();
1015
1015
  init_router();
1016
1016
  }
1017
1017
  });
1018
1018
 
1019
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/smart-router/index.js
1019
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/smart-router/index.js
1020
1020
  var init_smart_router = __esm({
1021
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/smart-router/index.js"() {
1021
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/smart-router/index.js"() {
1022
1022
  "use strict";
1023
1023
  init_esm_shims();
1024
1024
  init_router3();
1025
1025
  }
1026
1026
  });
1027
1027
 
1028
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/trie-router/node.js
1028
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/trie-router/node.js
1029
1029
  var init_node2 = __esm({
1030
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/trie-router/node.js"() {
1030
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/trie-router/node.js"() {
1031
1031
  "use strict";
1032
1032
  init_esm_shims();
1033
1033
  init_router();
@@ -1035,9 +1035,9 @@ var init_node2 = __esm({
1035
1035
  }
1036
1036
  });
1037
1037
 
1038
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/trie-router/router.js
1038
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/trie-router/router.js
1039
1039
  var init_router4 = __esm({
1040
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/trie-router/router.js"() {
1040
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/trie-router/router.js"() {
1041
1041
  "use strict";
1042
1042
  init_esm_shims();
1043
1043
  init_url();
@@ -1045,18 +1045,18 @@ var init_router4 = __esm({
1045
1045
  }
1046
1046
  });
1047
1047
 
1048
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/trie-router/index.js
1048
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/trie-router/index.js
1049
1049
  var init_trie_router = __esm({
1050
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/router/trie-router/index.js"() {
1050
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/router/trie-router/index.js"() {
1051
1051
  "use strict";
1052
1052
  init_esm_shims();
1053
1053
  init_router4();
1054
1054
  }
1055
1055
  });
1056
1056
 
1057
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/hono.js
1057
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/hono.js
1058
1058
  var init_hono = __esm({
1059
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/hono.js"() {
1059
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/hono.js"() {
1060
1060
  "use strict";
1061
1061
  init_esm_shims();
1062
1062
  init_hono_base();
@@ -1066,19 +1066,19 @@ var init_hono = __esm({
1066
1066
  }
1067
1067
  });
1068
1068
 
1069
- // ../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/index.js
1069
+ // ../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/index.js
1070
1070
  var init_dist3 = __esm({
1071
- "../node_modules/.pnpm/hono@4.9.7/node_modules/hono/dist/index.js"() {
1071
+ "../node_modules/.pnpm/hono@4.9.8/node_modules/hono/dist/index.js"() {
1072
1072
  "use strict";
1073
1073
  init_esm_shims();
1074
1074
  init_hono();
1075
1075
  }
1076
1076
  });
1077
1077
 
1078
- // ../node_modules/.pnpm/@hono+zod-openapi@1.1.0_hono@4.9.7_zod@4.1.8/node_modules/@hono/zod-openapi/dist/index.js
1079
- import { ZodType, z } from "zod";
1078
+ // ../node_modules/.pnpm/@hono+zod-openapi@1.1.3_hono@4.9.8_zod@4.1.11/node_modules/@hono/zod-openapi/dist/index.js
1079
+ import { z } from "zod";
1080
1080
  var init_dist4 = __esm({
1081
- "../node_modules/.pnpm/@hono+zod-openapi@1.1.0_hono@4.9.7_zod@4.1.8/node_modules/@hono/zod-openapi/dist/index.js"() {
1081
+ "../node_modules/.pnpm/@hono+zod-openapi@1.1.3_hono@4.9.8_zod@4.1.11/node_modules/@hono/zod-openapi/dist/index.js"() {
1082
1082
  "use strict";
1083
1083
  init_esm_shims();
1084
1084
  init_dist();
@@ -1089,7 +1089,7 @@ var init_dist4 = __esm({
1089
1089
  }
1090
1090
  });
1091
1091
 
1092
- // ../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.5_@libsql+client@0.15.15_@opentelemetry+api@1.9.0_@types+pg@8.15.5__zod@4.1.8/node_modules/drizzle-zod/index.mjs
1092
+ // ../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.5_@libsql+client@0.15.15_@opentelemetry+api@1.9.0_@types+pg@8.15.5__zod@4.1.11/node_modules/drizzle-zod/index.mjs
1093
1093
  import { z as z2 } from "zod/v4";
1094
1094
  import { isTable, getTableColumns, getViewSelectedFields, is, Column, SQL, isView } from "drizzle-orm";
1095
1095
  function isColumnType(column, columnTypes) {
@@ -1307,7 +1307,7 @@ function handleEnum(enum_, factory) {
1307
1307
  }
1308
1308
  var CONSTANTS, isPgEnum, literalSchema, jsonSchema, bufferSchema, selectConditions, insertConditions, createSelectSchema, createInsertSchema;
1309
1309
  var init_drizzle_zod = __esm({
1310
- "../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.5_@libsql+client@0.15.15_@opentelemetry+api@1.9.0_@types+pg@8.15.5__zod@4.1.8/node_modules/drizzle-zod/index.mjs"() {
1310
+ "../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.5_@libsql+client@0.15.15_@opentelemetry+api@1.9.0_@types+pg@8.15.5__zod@4.1.11/node_modules/drizzle-zod/index.mjs"() {
1311
1311
  "use strict";
1312
1312
  init_esm_shims();
1313
1313
  CONSTANTS = {
@@ -2326,7 +2326,7 @@ var init_utility = __esm({
2326
2326
  });
2327
2327
 
2328
2328
  // ../packages/agents-core/src/validation/schemas.ts
2329
- var StopWhenSchema, GraphStopWhenSchema, AgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createGraphScopedApiSchema, createGraphScopedApiInsertSchema, createGraphScopedApiUpdateSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, AgentRelationSelectSchema, AgentRelationInsertSchema, AgentRelationUpdateSchema, AgentRelationApiSelectSchema, AgentRelationApiInsertSchema, AgentRelationApiUpdateSchema, AgentRelationQuerySchema, ExternalAgentRelationInsertSchema, ExternalAgentRelationApiInsertSchema, AgentGraphSelectSchema, AgentGraphInsertSchema, AgentGraphUpdateSchema, AgentGraphApiSelectSchema, AgentGraphApiInsertSchema, AgentGraphApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, AgentDataComponentSelectSchema, AgentDataComponentInsertSchema, AgentDataComponentUpdateSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentUpdateSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, AgentToolRelationSelectSchema, AgentToolRelationInsertSchema, AgentToolRelationUpdateSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, GraphWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, HeadersScopeSchema, TenantParamsSchema, TenantProjectParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectIdParamsSchema, TenantIdParamsSchema, IdParamsSchema, PaginationQueryParamsSchema;
2329
+ var StopWhenSchema, GraphStopWhenSchema, AgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createGraphScopedApiSchema, createGraphScopedApiInsertSchema, createGraphScopedApiUpdateSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, AgentRelationSelectSchema, AgentRelationInsertSchema, AgentRelationUpdateSchema, AgentRelationApiSelectSchema, AgentRelationApiInsertSchema, AgentRelationApiUpdateSchema, AgentRelationQuerySchema, ExternalAgentRelationInsertSchema, ExternalAgentRelationApiInsertSchema, AgentGraphSelectSchema, AgentGraphInsertSchema, AgentGraphUpdateSchema, AgentGraphApiSelectSchema, AgentGraphApiInsertSchema, AgentGraphApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, AgentDataComponentSelectSchema, AgentDataComponentInsertSchema, AgentDataComponentUpdateSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentUpdateSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, AgentToolRelationSelectSchema, AgentToolRelationInsertSchema, AgentToolRelationUpdateSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, GraphWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, HeadersScopeSchema, TenantParamsSchema, TenantProjectParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectIdParamsSchema, TenantIdParamsSchema, IdParamsSchema, PaginationQueryParamsSchema;
2330
2330
  var init_schemas = __esm({
2331
2331
  "../packages/agents-core/src/validation/schemas.ts"() {
2332
2332
  "use strict";
@@ -2565,8 +2565,6 @@ var init_schemas = __esm({
2565
2565
  projectId: true,
2566
2566
  createdAt: true,
2567
2567
  updatedAt: true
2568
- }).extend({
2569
- id: resourceIdSchema.optional()
2570
2568
  });
2571
2569
  ArtifactComponentApiUpdateSchema = createApiUpdateSchema(
2572
2570
  ArtifactComponentUpdateSchema
@@ -2785,10 +2783,13 @@ var init_schemas = __esm({
2785
2783
  prompt: z.string().max(2e3, "Custom prompt cannot exceed 2000 characters").optional(),
2786
2784
  statusComponents: z.array(StatusComponentSchema).optional()
2787
2785
  });
2786
+ CanUseItemSchema = z.object({
2787
+ toolId: z.string(),
2788
+ toolSelection: z.array(z.string()).nullable().optional()
2789
+ });
2788
2790
  FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
2789
2791
  type: z.literal("internal"),
2790
- tools: z.array(z.string()),
2791
- selectedTools: z.record(z.string(), z.array(z.string())).optional(),
2792
+ canUse: z.array(CanUseItemSchema),
2792
2793
  dataComponents: z.array(z.string()).optional(),
2793
2794
  artifactComponents: z.array(z.string()).optional(),
2794
2795
  canTransferTo: z.array(z.string()).optional(),
@@ -4549,7 +4550,7 @@ var init_client = __esm({
4549
4550
  }
4550
4551
  });
4551
4552
 
4552
- // ../node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/index.js
4553
+ // ../node_modules/.pnpm/nanoid@5.1.6/node_modules/nanoid/index.js
4553
4554
  import { webcrypto as crypto2 } from "crypto";
4554
4555
  function fillPool(bytes) {
4555
4556
  if (!pool || pool.length < bytes) {
@@ -4570,6 +4571,7 @@ function customRandom(alphabet, defaultSize, getRandom) {
4570
4571
  let mask = (2 << 31 - Math.clz32(alphabet.length - 1 | 1)) - 1;
4571
4572
  let step = Math.ceil(1.6 * mask * defaultSize / alphabet.length);
4572
4573
  return (size = defaultSize) => {
4574
+ if (!size) return "";
4573
4575
  let id = "";
4574
4576
  while (true) {
4575
4577
  let bytes = getRandom(step);
@@ -4586,7 +4588,7 @@ function customAlphabet(alphabet, size = 21) {
4586
4588
  }
4587
4589
  var POOL_SIZE_MULTIPLIER, pool, poolOffset;
4588
4590
  var init_nanoid = __esm({
4589
- "../node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/index.js"() {
4591
+ "../node_modules/.pnpm/nanoid@5.1.6/node_modules/nanoid/index.js"() {
4590
4592
  "use strict";
4591
4593
  init_esm_shims();
4592
4594
  POOL_SIZE_MULTIPLIER = 128;
@@ -7833,7 +7835,7 @@ var require_compile = __commonJS({
7833
7835
  const schOrFunc = root.refs[ref];
7834
7836
  if (schOrFunc)
7835
7837
  return schOrFunc;
7836
- let _sch = resolve4.call(this, root, ref);
7838
+ let _sch = resolve6.call(this, root, ref);
7837
7839
  if (_sch === void 0) {
7838
7840
  const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
7839
7841
  const { schemaId } = this.opts;
@@ -7860,7 +7862,7 @@ var require_compile = __commonJS({
7860
7862
  function sameSchemaEnv(s1, s2) {
7861
7863
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
7862
7864
  }
7863
- function resolve4(root, ref) {
7865
+ function resolve6(root, ref) {
7864
7866
  let sch;
7865
7867
  while (typeof (sch = this.refs[ref]) == "string")
7866
7868
  ref = sch;
@@ -8438,55 +8440,55 @@ var require_fast_uri = __commonJS({
8438
8440
  }
8439
8441
  return uri;
8440
8442
  }
8441
- function resolve4(baseURI, relativeURI, options) {
8443
+ function resolve6(baseURI, relativeURI, options) {
8442
8444
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
8443
8445
  const resolved = resolveComponent(parse2(baseURI, schemelessOptions), parse2(relativeURI, schemelessOptions), schemelessOptions, true);
8444
8446
  schemelessOptions.skipEscape = true;
8445
8447
  return serialize2(resolved, schemelessOptions);
8446
8448
  }
8447
- function resolveComponent(base, relative2, options, skipNormalization) {
8449
+ function resolveComponent(base, relative, options, skipNormalization) {
8448
8450
  const target = {};
8449
8451
  if (!skipNormalization) {
8450
8452
  base = parse2(serialize2(base, options), options);
8451
- relative2 = parse2(serialize2(relative2, options), options);
8453
+ relative = parse2(serialize2(relative, options), options);
8452
8454
  }
8453
8455
  options = options || {};
8454
- if (!options.tolerant && relative2.scheme) {
8455
- target.scheme = relative2.scheme;
8456
- target.userinfo = relative2.userinfo;
8457
- target.host = relative2.host;
8458
- target.port = relative2.port;
8459
- target.path = removeDotSegments(relative2.path || "");
8460
- target.query = relative2.query;
8456
+ if (!options.tolerant && relative.scheme) {
8457
+ target.scheme = relative.scheme;
8458
+ target.userinfo = relative.userinfo;
8459
+ target.host = relative.host;
8460
+ target.port = relative.port;
8461
+ target.path = removeDotSegments(relative.path || "");
8462
+ target.query = relative.query;
8461
8463
  } else {
8462
- if (relative2.userinfo !== void 0 || relative2.host !== void 0 || relative2.port !== void 0) {
8463
- target.userinfo = relative2.userinfo;
8464
- target.host = relative2.host;
8465
- target.port = relative2.port;
8466
- target.path = removeDotSegments(relative2.path || "");
8467
- target.query = relative2.query;
8464
+ if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
8465
+ target.userinfo = relative.userinfo;
8466
+ target.host = relative.host;
8467
+ target.port = relative.port;
8468
+ target.path = removeDotSegments(relative.path || "");
8469
+ target.query = relative.query;
8468
8470
  } else {
8469
- if (!relative2.path) {
8471
+ if (!relative.path) {
8470
8472
  target.path = base.path;
8471
- if (relative2.query !== void 0) {
8472
- target.query = relative2.query;
8473
+ if (relative.query !== void 0) {
8474
+ target.query = relative.query;
8473
8475
  } else {
8474
8476
  target.query = base.query;
8475
8477
  }
8476
8478
  } else {
8477
- if (relative2.path[0] === "/") {
8478
- target.path = removeDotSegments(relative2.path);
8479
+ if (relative.path[0] === "/") {
8480
+ target.path = removeDotSegments(relative.path);
8479
8481
  } else {
8480
8482
  if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
8481
- target.path = "/" + relative2.path;
8483
+ target.path = "/" + relative.path;
8482
8484
  } else if (!base.path) {
8483
- target.path = relative2.path;
8485
+ target.path = relative.path;
8484
8486
  } else {
8485
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative2.path;
8487
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
8486
8488
  }
8487
8489
  target.path = removeDotSegments(target.path);
8488
8490
  }
8489
- target.query = relative2.query;
8491
+ target.query = relative.query;
8490
8492
  }
8491
8493
  target.userinfo = base.userinfo;
8492
8494
  target.host = base.host;
@@ -8494,7 +8496,7 @@ var require_fast_uri = __commonJS({
8494
8496
  }
8495
8497
  target.scheme = base.scheme;
8496
8498
  }
8497
- target.fragment = relative2.fragment;
8499
+ target.fragment = relative.fragment;
8498
8500
  return target;
8499
8501
  }
8500
8502
  function equal(uriA, uriB, options) {
@@ -8665,7 +8667,7 @@ var require_fast_uri = __commonJS({
8665
8667
  var fastUri = {
8666
8668
  SCHEMES,
8667
8669
  normalize,
8668
- resolve: resolve4,
8670
+ resolve: resolve6,
8669
8671
  resolveComponent,
8670
8672
  equal,
8671
8673
  serialize: serialize2,
@@ -12485,11 +12487,11 @@ var init_execution = __esm({
12485
12487
  }
12486
12488
  });
12487
12489
 
12488
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
12490
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
12489
12491
  import { z as z4 } from "zod";
12490
12492
  var JSONRPC_VERSION, ProgressTokenSchema, CursorSchema, RequestMetaSchema, BaseRequestParamsSchema, RequestSchema, BaseNotificationParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, ErrorCode2, JSONRPCErrorSchema, JSONRPCMessageSchema, EmptyResultSchema, CancelledNotificationSchema, IconSchema, BaseMetadataSchema, ImplementationSchema, ClientCapabilitiesSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationSchema, PaginatedRequestSchema, PaginatedResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, LoggingLevelSchema, SetLevelRequestSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, SamplingMessageSchema, CreateMessageRequestSchema, CreateMessageResultSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema;
12491
12493
  var init_types3 = __esm({
12492
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"() {
12494
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"() {
12493
12495
  "use strict";
12494
12496
  init_esm_shims();
12495
12497
  JSONRPC_VERSION = "2.0";
@@ -13462,9 +13464,9 @@ var init_types3 = __esm({
13462
13464
  }
13463
13465
  });
13464
13466
 
13465
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
13467
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
13466
13468
  var init_protocol = __esm({
13467
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"() {
13469
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"() {
13468
13470
  "use strict";
13469
13471
  init_esm_shims();
13470
13472
  init_types3();
@@ -14160,51 +14162,51 @@ var require_uri_all = __commonJS({
14160
14162
  }
14161
14163
  return uriTokens.join("");
14162
14164
  }
14163
- function resolveComponents(base2, relative2) {
14165
+ function resolveComponents(base2, relative) {
14164
14166
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
14165
14167
  var skipNormalization = arguments[3];
14166
14168
  var target = {};
14167
14169
  if (!skipNormalization) {
14168
14170
  base2 = parse2(serialize2(base2, options), options);
14169
- relative2 = parse2(serialize2(relative2, options), options);
14171
+ relative = parse2(serialize2(relative, options), options);
14170
14172
  }
14171
14173
  options = options || {};
14172
- if (!options.tolerant && relative2.scheme) {
14173
- target.scheme = relative2.scheme;
14174
- target.userinfo = relative2.userinfo;
14175
- target.host = relative2.host;
14176
- target.port = relative2.port;
14177
- target.path = removeDotSegments(relative2.path || "");
14178
- target.query = relative2.query;
14174
+ if (!options.tolerant && relative.scheme) {
14175
+ target.scheme = relative.scheme;
14176
+ target.userinfo = relative.userinfo;
14177
+ target.host = relative.host;
14178
+ target.port = relative.port;
14179
+ target.path = removeDotSegments(relative.path || "");
14180
+ target.query = relative.query;
14179
14181
  } else {
14180
- if (relative2.userinfo !== void 0 || relative2.host !== void 0 || relative2.port !== void 0) {
14181
- target.userinfo = relative2.userinfo;
14182
- target.host = relative2.host;
14183
- target.port = relative2.port;
14184
- target.path = removeDotSegments(relative2.path || "");
14185
- target.query = relative2.query;
14182
+ if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
14183
+ target.userinfo = relative.userinfo;
14184
+ target.host = relative.host;
14185
+ target.port = relative.port;
14186
+ target.path = removeDotSegments(relative.path || "");
14187
+ target.query = relative.query;
14186
14188
  } else {
14187
- if (!relative2.path) {
14189
+ if (!relative.path) {
14188
14190
  target.path = base2.path;
14189
- if (relative2.query !== void 0) {
14190
- target.query = relative2.query;
14191
+ if (relative.query !== void 0) {
14192
+ target.query = relative.query;
14191
14193
  } else {
14192
14194
  target.query = base2.query;
14193
14195
  }
14194
14196
  } else {
14195
- if (relative2.path.charAt(0) === "/") {
14196
- target.path = removeDotSegments(relative2.path);
14197
+ if (relative.path.charAt(0) === "/") {
14198
+ target.path = removeDotSegments(relative.path);
14197
14199
  } else {
14198
14200
  if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
14199
- target.path = "/" + relative2.path;
14201
+ target.path = "/" + relative.path;
14200
14202
  } else if (!base2.path) {
14201
- target.path = relative2.path;
14203
+ target.path = relative.path;
14202
14204
  } else {
14203
- target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative2.path;
14205
+ target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative.path;
14204
14206
  }
14205
14207
  target.path = removeDotSegments(target.path);
14206
14208
  }
14207
- target.query = relative2.query;
14209
+ target.query = relative.query;
14208
14210
  }
14209
14211
  target.userinfo = base2.userinfo;
14210
14212
  target.host = base2.host;
@@ -14212,10 +14214,10 @@ var require_uri_all = __commonJS({
14212
14214
  }
14213
14215
  target.scheme = base2.scheme;
14214
14216
  }
14215
- target.fragment = relative2.fragment;
14217
+ target.fragment = relative.fragment;
14216
14218
  return target;
14217
14219
  }
14218
- function resolve4(baseURI, relativeURI, options) {
14220
+ function resolve6(baseURI, relativeURI, options) {
14219
14221
  var schemelessOptions = assign({ scheme: "null" }, options);
14220
14222
  return serialize2(resolveComponents(parse2(baseURI, schemelessOptions), parse2(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
14221
14223
  }
@@ -14480,7 +14482,7 @@ var require_uri_all = __commonJS({
14480
14482
  exports2.removeDotSegments = removeDotSegments;
14481
14483
  exports2.serialize = serialize2;
14482
14484
  exports2.resolveComponents = resolveComponents;
14483
- exports2.resolve = resolve4;
14485
+ exports2.resolve = resolve6;
14484
14486
  exports2.normalize = normalize;
14485
14487
  exports2.equal = equal;
14486
14488
  exports2.escapeComponent = escapeComponent;
@@ -14803,18 +14805,18 @@ var require_resolve2 = __commonJS({
14803
14805
  var util = require_util2();
14804
14806
  var SchemaObject = require_schema_obj();
14805
14807
  var traverse = require_json_schema_traverse2();
14806
- module.exports = resolve4;
14807
- resolve4.normalizeId = normalizeId;
14808
- resolve4.fullPath = getFullPath;
14809
- resolve4.url = resolveUrl;
14810
- resolve4.ids = resolveIds;
14811
- resolve4.inlineRef = inlineRef;
14812
- resolve4.schema = resolveSchema;
14813
- function resolve4(compile, root, ref) {
14808
+ module.exports = resolve6;
14809
+ resolve6.normalizeId = normalizeId;
14810
+ resolve6.fullPath = getFullPath;
14811
+ resolve6.url = resolveUrl;
14812
+ resolve6.ids = resolveIds;
14813
+ resolve6.inlineRef = inlineRef;
14814
+ resolve6.schema = resolveSchema;
14815
+ function resolve6(compile, root, ref) {
14814
14816
  var refVal = this._refs[ref];
14815
14817
  if (typeof refVal == "string") {
14816
14818
  if (this._refs[refVal]) refVal = this._refs[refVal];
14817
- else return resolve4.call(this, compile, root, refVal);
14819
+ else return resolve6.call(this, compile, root, refVal);
14818
14820
  }
14819
14821
  refVal = refVal || this._schemas[ref];
14820
14822
  if (refVal instanceof SchemaObject) {
@@ -15020,7 +15022,7 @@ var require_error_classes = __commonJS({
15020
15022
  "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js"(exports, module) {
15021
15023
  "use strict";
15022
15024
  init_esm_shims();
15023
- var resolve4 = require_resolve2();
15025
+ var resolve6 = require_resolve2();
15024
15026
  module.exports = {
15025
15027
  Validation: errorSubclass(ValidationError),
15026
15028
  MissingRef: errorSubclass(MissingRefError)
@@ -15035,8 +15037,8 @@ var require_error_classes = __commonJS({
15035
15037
  };
15036
15038
  function MissingRefError(baseId, ref, message) {
15037
15039
  this.message = message || MissingRefError.message(baseId, ref);
15038
- this.missingRef = resolve4.url(baseId, ref);
15039
- this.missingSchema = resolve4.normalizeId(resolve4.fullPath(this.missingRef));
15040
+ this.missingRef = resolve6.url(baseId, ref);
15041
+ this.missingSchema = resolve6.normalizeId(resolve6.fullPath(this.missingRef));
15040
15042
  }
15041
15043
  function errorSubclass(Subclass) {
15042
15044
  Subclass.prototype = Object.create(Error.prototype);
@@ -15567,7 +15569,7 @@ var require_compile2 = __commonJS({
15567
15569
  "../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js"(exports, module) {
15568
15570
  "use strict";
15569
15571
  init_esm_shims();
15570
- var resolve4 = require_resolve2();
15572
+ var resolve6 = require_resolve2();
15571
15573
  var util = require_util2();
15572
15574
  var errorClasses = require_error_classes();
15573
15575
  var stableStringify = require_fast_json_stable_stringify();
@@ -15625,7 +15627,7 @@ var require_compile2 = __commonJS({
15625
15627
  RULES,
15626
15628
  validate: validateGenerator,
15627
15629
  util,
15628
- resolve: resolve4,
15630
+ resolve: resolve6,
15629
15631
  resolveRef,
15630
15632
  usePattern,
15631
15633
  useDefault,
@@ -15685,7 +15687,7 @@ var require_compile2 = __commonJS({
15685
15687
  return validate;
15686
15688
  }
15687
15689
  function resolveRef(baseId2, ref, isRoot) {
15688
- ref = resolve4.url(baseId2, ref);
15690
+ ref = resolve6.url(baseId2, ref);
15689
15691
  var refIndex = refs[ref];
15690
15692
  var _refVal, refCode;
15691
15693
  if (refIndex !== void 0) {
@@ -15702,11 +15704,11 @@ var require_compile2 = __commonJS({
15702
15704
  }
15703
15705
  }
15704
15706
  refCode = addLocalRef(ref);
15705
- var v3 = resolve4.call(self, localCompile, root, ref);
15707
+ var v3 = resolve6.call(self, localCompile, root, ref);
15706
15708
  if (v3 === void 0) {
15707
15709
  var localSchema = localRefs && localRefs[ref];
15708
15710
  if (localSchema) {
15709
- v3 = resolve4.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId2);
15711
+ v3 = resolve6.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId2);
15710
15712
  }
15711
15713
  }
15712
15714
  if (v3 === void 0) {
@@ -19349,7 +19351,7 @@ var require_ajv2 = __commonJS({
19349
19351
  "use strict";
19350
19352
  init_esm_shims();
19351
19353
  var compileSchema = require_compile2();
19352
- var resolve4 = require_resolve2();
19354
+ var resolve6 = require_resolve2();
19353
19355
  var Cache = require_cache();
19354
19356
  var SchemaObject = require_schema_obj();
19355
19357
  var stableStringify = require_fast_json_stable_stringify();
@@ -19431,7 +19433,7 @@ var require_ajv2 = __commonJS({
19431
19433
  var id = this._getId(schema);
19432
19434
  if (id !== void 0 && typeof id != "string")
19433
19435
  throw new Error("schema id must be string");
19434
- key = resolve4.normalizeId(key || id);
19436
+ key = resolve6.normalizeId(key || id);
19435
19437
  checkUnique(this, key);
19436
19438
  this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
19437
19439
  return this;
@@ -19475,7 +19477,7 @@ var require_ajv2 = __commonJS({
19475
19477
  }
19476
19478
  }
19477
19479
  function _getSchemaFragment(self, ref) {
19478
- var res = resolve4.schema.call(self, { schema: {} }, ref);
19480
+ var res = resolve6.schema.call(self, { schema: {} }, ref);
19479
19481
  if (res) {
19480
19482
  var schema = res.schema, root = res.root, baseId = res.baseId;
19481
19483
  var v2 = compileSchema.call(self, schema, root, void 0, baseId);
@@ -19491,7 +19493,7 @@ var require_ajv2 = __commonJS({
19491
19493
  }
19492
19494
  }
19493
19495
  function _getSchemaObj(self, keyRef) {
19494
- keyRef = resolve4.normalizeId(keyRef);
19496
+ keyRef = resolve6.normalizeId(keyRef);
19495
19497
  return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
19496
19498
  }
19497
19499
  function removeSchema(schemaKeyRef) {
@@ -19518,7 +19520,7 @@ var require_ajv2 = __commonJS({
19518
19520
  this._cache.del(cacheKey);
19519
19521
  var id = this._getId(schemaKeyRef);
19520
19522
  if (id) {
19521
- id = resolve4.normalizeId(id);
19523
+ id = resolve6.normalizeId(id);
19522
19524
  delete this._schemas[id];
19523
19525
  delete this._refs[id];
19524
19526
  }
@@ -19542,13 +19544,13 @@ var require_ajv2 = __commonJS({
19542
19544
  var cached = this._cache.get(cacheKey);
19543
19545
  if (cached) return cached;
19544
19546
  shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
19545
- var id = resolve4.normalizeId(this._getId(schema));
19547
+ var id = resolve6.normalizeId(this._getId(schema));
19546
19548
  if (id && shouldAddSchema) checkUnique(this, id);
19547
19549
  var willValidate = this._opts.validateSchema !== false && !skipValidation;
19548
19550
  var recursiveMeta;
19549
- if (willValidate && !(recursiveMeta = id && id == resolve4.normalizeId(schema.$schema)))
19551
+ if (willValidate && !(recursiveMeta = id && id == resolve6.normalizeId(schema.$schema)))
19550
19552
  this.validateSchema(schema, true);
19551
- var localRefs = resolve4.ids.call(this, schema);
19553
+ var localRefs = resolve6.ids.call(this, schema);
19552
19554
  var schemaObj = new SchemaObject({
19553
19555
  id,
19554
19556
  schema,
@@ -19696,10 +19698,10 @@ var require_ajv2 = __commonJS({
19696
19698
  }
19697
19699
  });
19698
19700
 
19699
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
19701
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
19700
19702
  var import_ajv;
19701
19703
  var init_client2 = __esm({
19702
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js"() {
19704
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js"() {
19703
19705
  "use strict";
19704
19706
  init_esm_shims();
19705
19707
  init_protocol();
@@ -19720,11 +19722,11 @@ var init_index_node = __esm({
19720
19722
  }
19721
19723
  });
19722
19724
 
19723
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
19725
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
19724
19726
  import { z as z5 } from "zod";
19725
19727
  var SafeUrlSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, OAuthErrorResponseSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema, OAuthClientRegistrationErrorSchema, OAuthTokenRevocationRequestSchema;
19726
19728
  var init_auth = __esm({
19727
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js"() {
19729
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js"() {
19728
19730
  "use strict";
19729
19731
  init_esm_shims();
19730
19732
  SafeUrlSchema = z5.string().url().superRefine((val, ctx) => {
@@ -19866,18 +19868,18 @@ var init_auth = __esm({
19866
19868
  }
19867
19869
  });
19868
19870
 
19869
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
19871
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
19870
19872
  var init_auth_utils = __esm({
19871
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js"() {
19873
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js"() {
19872
19874
  "use strict";
19873
19875
  init_esm_shims();
19874
19876
  }
19875
19877
  });
19876
19878
 
19877
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
19879
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
19878
19880
  var OAuthError, InvalidRequestError, InvalidClientError, InvalidGrantError, UnauthorizedClientError, UnsupportedGrantTypeError, InvalidScopeError, AccessDeniedError, ServerError, TemporarilyUnavailableError, UnsupportedResponseTypeError, UnsupportedTokenTypeError, InvalidTokenError, MethodNotAllowedError, TooManyRequestsError, InvalidClientMetadataError, InsufficientScopeError, OAUTH_ERRORS;
19879
19881
  var init_errors = __esm({
19880
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js"() {
19882
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js"() {
19881
19883
  "use strict";
19882
19884
  init_esm_shims();
19883
19885
  OAuthError = class extends Error {
@@ -19972,9 +19974,9 @@ var init_errors = __esm({
19972
19974
  }
19973
19975
  });
19974
19976
 
19975
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
19977
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
19976
19978
  var init_auth2 = __esm({
19977
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js"() {
19979
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js"() {
19978
19980
  "use strict";
19979
19981
  init_esm_shims();
19980
19982
  init_index_node();
@@ -19986,9 +19988,9 @@ var init_auth2 = __esm({
19986
19988
  }
19987
19989
  });
19988
19990
 
19989
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
19991
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js
19990
19992
  var init_sse = __esm({
19991
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js"() {
19993
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js"() {
19992
19994
  "use strict";
19993
19995
  init_esm_shims();
19994
19996
  init_types3();
@@ -19996,9 +19998,9 @@ var init_sse = __esm({
19996
19998
  }
19997
19999
  });
19998
20000
 
19999
- // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
20001
+ // ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
20000
20002
  var init_streamableHttp = __esm({
20001
- "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js"() {
20003
+ "../node_modules/.pnpm/@modelcontextprotocol+sdk@1.18.1/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js"() {
20002
20004
  "use strict";
20003
20005
  init_esm_shims();
20004
20006
  init_types3();
@@ -20578,7 +20580,7 @@ var init_env = __esm({
20578
20580
  loadEnvironmentFiles();
20579
20581
  envSchema = z9.object({
20580
20582
  ENVIRONMENT: z9.enum(["development", "production", "pentest", "test"]).optional(),
20581
- DB_FILE_NAME: z9.string(),
20583
+ DB_FILE_NAME: z9.string().optional(),
20582
20584
  OTEL_TRACES_FORCE_FLUSH_ENABLED: z9.coerce.boolean().optional()
20583
20585
  });
20584
20586
  parseEnv = () => {
@@ -20781,9 +20783,8 @@ async function getTenantId(configPath) {
20781
20783
  const config = await loadConfig(configPath);
20782
20784
  return config.tenantId;
20783
20785
  }
20784
- async function getProjectId(configPath) {
20785
- const config = await loadConfig(configPath);
20786
- return config.projectId || "default";
20786
+ async function getProjectId(_configPath) {
20787
+ return "default";
20787
20788
  }
20788
20789
  async function getAgentsManageApiUrl(overrideUrl, configPath) {
20789
20790
  if (overrideUrl) {
@@ -20799,93 +20800,35 @@ async function getAgentsRunApiUrl(overrideUrl, configPath) {
20799
20800
  const config = await loadConfig(configPath);
20800
20801
  return config.agentsRunApiUrl || "http://localhost:3003";
20801
20802
  }
20802
- async function validateConfiguration(tenantIdFlag, agentsManageApiUrlFlag, agentsRunApiUrlFlag, configFilePath) {
20803
- if (configFilePath && tenantIdFlag) {
20804
- throw new Error(
20805
- "Invalid configuration combination:\nCannot use --config-file-path with --tenant-id.\nPlease use either:\n 1. --config-file-path alone\n 2. --tenant-id with --agents-manage-api-url and --agents-run-api-url\n 3. Default config file (inkeep.config.ts)"
20806
- );
20807
- }
20808
- if (configFilePath) {
20809
- const config2 = await loadConfig(configFilePath);
20810
- const tenantId2 = config2.tenantId;
20811
- const projectId2 = config2.projectId || "default";
20812
- const agentsManageApiUrl2 = agentsManageApiUrlFlag || config2.agentsManageApiUrl;
20813
- const agentsRunApiUrl2 = agentsRunApiUrlFlag || config2.agentsRunApiUrl;
20814
- if (!tenantId2) {
20815
- throw new Error(
20816
- `Tenant ID is missing from configuration file: ${configFilePath}
20817
- Please ensure your config file exports a valid configuration with tenantId.`
20818
- );
20819
- }
20820
- if (!agentsManageApiUrl2) {
20821
- throw new Error(
20822
- `Agents Manage API URL is missing from configuration file: ${configFilePath}
20823
- Please ensure your config file exports a valid configuration with agentsManageApiUrl.`
20824
- );
20825
- }
20826
- if (!agentsRunApiUrl2) {
20827
- throw new Error(
20828
- `Agents Run API URL is missing from configuration file: ${configFilePath}
20829
- Please ensure your config file exports a valid configuration with agentsRunApiUrl.`
20830
- );
20831
- }
20832
- const sources2 = {
20833
- tenantId: `config file (${configFilePath})`,
20834
- projectId: config2.projectId ? `config file (${configFilePath})` : "default",
20835
- agentsManageApiUrl: agentsManageApiUrlFlag ? "command-line flag (--agents-manage-api-url)" : `config file (${configFilePath})`,
20836
- agentsRunApiUrl: agentsRunApiUrlFlag ? "command-line flag (--agents-run-api-url)" : `config file (${configFilePath})`,
20837
- configFile: configFilePath
20838
- };
20839
- return {
20840
- tenantId: tenantId2,
20841
- projectId: projectId2,
20842
- agentsManageApiUrl: agentsManageApiUrl2,
20843
- agentsRunApiUrl: agentsRunApiUrl2,
20844
- manageUiUrl: config2.manageUiUrl,
20845
- modelSettings: config2.modelSettings || void 0,
20846
- sources: sources2
20847
- };
20848
- }
20803
+ async function validateConfiguration(tenantIdFlag, agentsManageApiUrlFlag, agentsRunApiUrlFlag, configPath) {
20804
+ const config = await loadConfig(configPath);
20805
+ const tenantId = tenantIdFlag || config.tenantId;
20806
+ const agentsManageApiUrl = agentsManageApiUrlFlag || config.agentsManageApiUrl;
20807
+ const agentsRunApiUrl = agentsRunApiUrlFlag || config.agentsRunApiUrl;
20808
+ const actualConfigFile = configPath || findConfigFile();
20849
20809
  if (tenantIdFlag && agentsManageApiUrlFlag && agentsRunApiUrlFlag) {
20850
20810
  const sources2 = {
20851
20811
  tenantId: "command-line flag (--tenant-id)",
20852
- projectId: "default",
20853
20812
  agentsManageApiUrl: "command-line flag (--agents-manage-api-url)",
20854
20813
  agentsRunApiUrl: "command-line flag (--agents-run-api-url)"
20855
20814
  };
20856
20815
  return {
20857
20816
  tenantId: tenantIdFlag,
20858
- projectId: "default",
20859
20817
  agentsManageApiUrl: agentsManageApiUrlFlag,
20860
20818
  agentsRunApiUrl: agentsRunApiUrlFlag,
20861
- manageUiUrl: void 0,
20862
- modelSettings: void 0,
20819
+ manageUiUrl: config.manageUiUrl,
20863
20820
  sources: sources2
20864
20821
  };
20865
20822
  }
20866
- if (tenantIdFlag && !agentsManageApiUrlFlag && !agentsRunApiUrlFlag) {
20867
- throw new Error(
20868
- "Invalid configuration:\n--tenant-id requires --agents-manage-api-url and --agents-run-api-url to be provided as well.\nPlease provide both --tenant-id and --agents-manage-api-url and --agents-run-api-url together."
20869
- );
20870
- }
20871
- const config = await loadConfig();
20872
- const tenantId = config.tenantId;
20873
- const projectId = config.projectId || "default";
20874
- const agentsManageApiUrl = agentsManageApiUrlFlag || config.agentsManageApiUrl;
20875
- const agentsRunApiUrl = agentsRunApiUrlFlag || config.agentsRunApiUrl;
20876
20823
  if (!tenantId) {
20877
- const configFile2 = findConfigFile();
20878
- if (!configFile2) {
20824
+ if (actualConfigFile) {
20879
20825
  throw new Error(
20880
- 'No configuration found. Please use one of:\n 1. Create "inkeep.config.ts" by running "inkeep init"\n 2. Provide --config-file-path to specify a config file\n 3. Provide both --tenant-id and --agents-manage-api-url and --agents-run-api-url flags\n 4. Set INKEEP_AGENTS_MANAGE_API_URL and INKEEP_AGENTS_RUN_API_URL environment variables'
20826
+ `Tenant ID is missing from configuration file: ${actualConfigFile}
20827
+ Please ensure your config file exports a valid configuration with tenantId.`
20881
20828
  );
20882
20829
  } else {
20883
20830
  throw new Error(
20884
- `Tenant ID is missing from configuration file: ${configFile2}
20885
- Please either:
20886
- 1. Update your configuration file with a tenantId
20887
- 2. Provide both --tenant-id and --agents-manage-api-url and --agents-run-api-url flags
20888
- `
20831
+ 'No configuration found. Please use one of:\n 1. Create "inkeep.config.ts" by running "inkeep init"\n 2. Provide --config to specify a config file\n 3. Provide --tenant-id, --agents-manage-api-url and --agents-run-api-url flags'
20889
20832
  );
20890
20833
  }
20891
20834
  }
@@ -20899,37 +20842,19 @@ Please either:
20899
20842
  "Agents Run API URL is missing. Please either:\n 1. Provide --agents-run-api-url flag\n 2. Set INKEEP_AGENTS_RUN_API_URL environment variable\n 3. Add agentsRunApiUrl to your configuration file"
20900
20843
  );
20901
20844
  }
20902
- const configFile = findConfigFile();
20903
- let agentsManageApiUrlSource = configFile ? `config file (${configFile})` : "default";
20904
- let agentsRunApiUrlSource = configFile ? `config file (${configFile})` : "default";
20905
- if (agentsManageApiUrlFlag) {
20906
- agentsManageApiUrlSource = "command-line flag (--agents-manage-api-url)";
20907
- } else if (process.env.INKEEP_AGENTS_MANAGE_API_URL === agentsManageApiUrl) {
20908
- agentsManageApiUrlSource = "environment variable (INKEEP_AGENTS_MANAGE_API_URL)";
20909
- } else if (agentsManageApiUrl === "http://localhost:3002" && !configFile) {
20910
- agentsManageApiUrlSource = "default value";
20911
- }
20912
- if (agentsRunApiUrlFlag) {
20913
- agentsRunApiUrlSource = "command-line flag (--agents-run-api-url)";
20914
- } else if (process.env.INKEEP_AGENTS_RUN_API_URL === agentsRunApiUrl) {
20915
- agentsRunApiUrlSource = "environment variable (INKEEP_AGENTS_RUN_API_URL)";
20916
- } else if (agentsRunApiUrl === "http://localhost:3003" && !configFile) {
20917
- agentsRunApiUrlSource = "default value";
20918
- }
20919
20845
  const sources = {
20920
- tenantId: `config file (${configFile})`,
20921
- projectId: config.projectId ? configFile ? `config file (${configFile})` : "config" : "default",
20922
- agentsManageApiUrl: agentsManageApiUrlSource,
20923
- agentsRunApiUrl: agentsRunApiUrlSource,
20924
- configFile: configFile || void 0
20846
+ tenantId: tenantIdFlag ? "command-line flag (--tenant-id)" : actualConfigFile ? `config file (${actualConfigFile})` : "default",
20847
+ agentsManageApiUrl: agentsManageApiUrlFlag ? "command-line flag (--agents-manage-api-url)" : process.env.INKEEP_AGENTS_MANAGE_API_URL === agentsManageApiUrl ? "environment variable (INKEEP_AGENTS_MANAGE_API_URL)" : actualConfigFile ? `config file (${actualConfigFile})` : "default value",
20848
+ agentsRunApiUrl: agentsRunApiUrlFlag ? "command-line flag (--agents-run-api-url)" : process.env.INKEEP_AGENTS_RUN_API_URL === agentsRunApiUrl ? "environment variable (INKEEP_AGENTS_RUN_API_URL)" : actualConfigFile ? `config file (${actualConfigFile})` : "default value"
20925
20849
  };
20850
+ if (actualConfigFile) {
20851
+ sources.configFile = actualConfigFile;
20852
+ }
20926
20853
  return {
20927
20854
  tenantId,
20928
- projectId,
20929
20855
  agentsManageApiUrl,
20930
20856
  agentsRunApiUrl,
20931
20857
  manageUiUrl: config.manageUiUrl,
20932
- modelSettings: config.modelSettings || void 0,
20933
20858
  sources
20934
20859
  };
20935
20860
  }
@@ -21098,16 +21023,17 @@ __export(chat_enhanced_exports, {
21098
21023
  });
21099
21024
  import * as readline from "readline";
21100
21025
  import chalk8 from "chalk";
21101
- import inquirer3 from "inquirer";
21026
+ import inquirer2 from "inquirer";
21102
21027
  import ora6 from "ora";
21103
21028
  async function chatCommandEnhanced(graphIdInput, options) {
21104
21029
  let config;
21105
21030
  try {
21031
+ const configPath2 = options?.config || options?.configFilePath;
21106
21032
  config = await validateConfiguration(
21107
21033
  options?.tenantId,
21108
21034
  options?.agentsManageApiUrl,
21109
21035
  options?.agentsRunApiUrl,
21110
- options?.configFilePath
21036
+ configPath2
21111
21037
  );
21112
21038
  } catch (error) {
21113
21039
  console.error(chalk8.red(error.message));
@@ -21118,14 +21044,15 @@ async function chatCommandEnhanced(graphIdInput, options) {
21118
21044
  console.log(chalk8.gray(` \u2022 Management API: ${config.sources.agentsManageApiUrl}`));
21119
21045
  console.log(chalk8.gray(` \u2022 Execution API: ${config.sources.agentsRunApiUrl}`));
21120
21046
  console.log();
21047
+ const configPath = options?.config || options?.configFilePath;
21121
21048
  const managementApi = await ManagementApiClient.create(
21122
21049
  config.agentsManageApiUrl,
21123
- options?.configFilePath,
21050
+ configPath,
21124
21051
  config.tenantId
21125
21052
  );
21126
21053
  const executionApi = await ExecutionApiClient.create(
21127
21054
  config.agentsRunApiUrl,
21128
- options?.configFilePath,
21055
+ configPath,
21129
21056
  config.tenantId
21130
21057
  );
21131
21058
  let graphId = graphIdInput;
@@ -21146,7 +21073,7 @@ async function chatCommandEnhanced(graphIdInput, options) {
21146
21073
  short: g.id,
21147
21074
  searchText: `${g.id} ${g.name || ""}`.toLowerCase()
21148
21075
  }));
21149
- const answer = await inquirer3.prompt([
21076
+ const answer = await inquirer2.prompt([
21150
21077
  {
21151
21078
  type: "list",
21152
21079
  name: "graphId",
@@ -21401,8 +21328,8 @@ var init_chat_enhanced = __esm({
21401
21328
  // src/index.ts
21402
21329
  init_esm_shims();
21403
21330
  init_env2();
21404
- import { readFileSync as readFileSync2 } from "fs";
21405
- import { dirname as dirname4, join as join10 } from "path";
21331
+ import { readFileSync as readFileSync3 } from "fs";
21332
+ import { dirname as dirname5, join as join10 } from "path";
21406
21333
  import { fileURLToPath as fileURLToPath2 } from "url";
21407
21334
  import { Command } from "commander";
21408
21335
 
@@ -21478,12 +21405,12 @@ import { existsSync, readFileSync, writeFileSync } from "fs";
21478
21405
  import { join } from "path";
21479
21406
  import chalk2 from "chalk";
21480
21407
  async function configGetCommand(key, options) {
21481
- const configPath = options?.configFilePath || join(process.cwd(), "inkeep.config.ts");
21408
+ const configPath = options?.config || options?.configFilePath || join(process.cwd(), "inkeep.config.ts");
21482
21409
  if (!existsSync(configPath)) {
21483
21410
  console.error(chalk2.red("No configuration file found."));
21484
21411
  console.log(
21485
21412
  chalk2.gray(
21486
- 'Run "inkeep init" to create one, or specify a config file with --config-file-path'
21413
+ 'Run "inkeep init" to create one, or specify a config file with --config'
21487
21414
  )
21488
21415
  );
21489
21416
  process.exit(1);
@@ -21517,7 +21444,7 @@ async function configGetCommand(key, options) {
21517
21444
  }
21518
21445
  }
21519
21446
  async function configSetCommand(key, value, options) {
21520
- const configPath = options?.configFilePath || join(process.cwd(), "inkeep.config.ts");
21447
+ const configPath = options?.config || options?.configFilePath || join(process.cwd(), "inkeep.config.ts");
21521
21448
  if (!["tenantId", "apiUrl"].includes(key)) {
21522
21449
  console.error(chalk2.red(`Invalid configuration key: ${key}`));
21523
21450
  console.log(chalk2.gray("Available keys: tenantId, apiUrl"));
@@ -21536,7 +21463,6 @@ async function configSetCommand(key, value, options) {
21536
21463
 
21537
21464
  export default defineConfig({
21538
21465
  tenantId: '${key === "tenantId" ? value : ""}',
21539
- projectId: '${key === "projectId" ? value : "default"}',
21540
21466
  apiUrl: '${key === "apiUrl" ? value : "http://localhost:3002"}',
21541
21467
  });
21542
21468
  `;
@@ -21560,16 +21486,6 @@ export default defineConfig({
21560
21486
  tenantId: '${value}',`
21561
21487
  );
21562
21488
  }
21563
- } else if (key === "projectId") {
21564
- if (content.includes("projectId:")) {
21565
- content = content.replace(/projectId:\s*['"][^'"]*['"]/, `projectId: '${value}'`);
21566
- } else {
21567
- content = content.replace(
21568
- /(tenantId:\s*['"][^'"]*['"]),?/,
21569
- `$1,
21570
- projectId: '${value}',`
21571
- );
21572
- }
21573
21489
  } else if (key === "apiUrl") {
21574
21490
  if (content.includes("apiUrl:")) {
21575
21491
  content = content.replace(/apiUrl:\s*['"][^'"]*['"]/, `apiUrl: '${value}'`);
@@ -21793,109 +21709,7 @@ init_esm_shims();
21793
21709
  import { existsSync as existsSync3, readdirSync, writeFileSync as writeFileSync2 } from "fs";
21794
21710
  import { basename, dirname as dirname2, join as join3, resolve } from "path";
21795
21711
  import chalk4 from "chalk";
21796
- import inquirer2 from "inquirer";
21797
-
21798
- // src/utils/model-config.ts
21799
- init_esm_shims();
21800
21712
  import inquirer from "inquirer";
21801
- async function promptForModelConfiguration() {
21802
- const { providers } = await inquirer.prompt([
21803
- {
21804
- type: "checkbox",
21805
- name: "providers",
21806
- message: "Which AI providers would you like to configure?",
21807
- choices: [
21808
- { name: "Anthropic (Claude)", value: "anthropic" },
21809
- { name: "OpenAI (GPT)", value: "openai" },
21810
- { name: "Google (Gemini)", value: "google" }
21811
- ],
21812
- validate: (input) => {
21813
- if (input.length === 0) {
21814
- return "Please select at least one provider";
21815
- }
21816
- return true;
21817
- }
21818
- }
21819
- ]);
21820
- const anthropicModels = [
21821
- { name: "Claude Opus 4.1", value: "anthropic/claude-opus-4-1-20250805" },
21822
- { name: "Claude Sonnet 4", value: "anthropic/claude-sonnet-4-20250514" },
21823
- { name: "Claude Haiku 3.5", value: "anthropic/claude-3-5-haiku-20241022" }
21824
- ];
21825
- const openaiModels = [
21826
- { name: "GPT-4.1", value: "openai/gpt-4.1-2025-04-14" },
21827
- { name: "GPT-4.1 Mini", value: "openai/gpt-4.1-mini-2025-04-14" },
21828
- { name: "GPT-4.1 Nano", value: "openai/gpt-4.1-nano-2025-04-14" },
21829
- { name: "GPT-5", value: "openai/gpt-5-2025-08-07" },
21830
- { name: "GPT-5 Mini", value: "openai/gpt-5-mini-2025-08-07" },
21831
- { name: "GPT-5 Nano", value: "openai/gpt-5-nano-2025-08-07" }
21832
- ];
21833
- const googleModels = [
21834
- { name: "Gemini 2.5 Pro", value: "google/gemini-2.5-pro" },
21835
- { name: "Gemini 2.5 Flash", value: "google/gemini-2.5-flash" },
21836
- { name: "Gemini 2.5 Flash Lite", value: "google/gemini-2.5-flash-lite" }
21837
- ];
21838
- const availableModels = [];
21839
- if (providers.includes("anthropic")) {
21840
- availableModels.push(...anthropicModels);
21841
- }
21842
- if (providers.includes("openai")) {
21843
- availableModels.push(...openaiModels);
21844
- }
21845
- if (providers.includes("google")) {
21846
- availableModels.push(...googleModels);
21847
- }
21848
- const modelAnswers = await inquirer.prompt([
21849
- {
21850
- type: "list",
21851
- name: "baseModel",
21852
- message: "Select your default model for general tasks (required):",
21853
- choices: availableModels
21854
- },
21855
- {
21856
- type: "confirm",
21857
- name: "configureOptionalModels",
21858
- message: "Would you like to configure optional models for structured output and summaries?",
21859
- default: false
21860
- }
21861
- ]);
21862
- let optionalModels = {};
21863
- if (modelAnswers.configureOptionalModels) {
21864
- const optionalChoices = [...availableModels, { name: "Use base model", value: null }];
21865
- optionalModels = await inquirer.prompt([
21866
- {
21867
- type: "list",
21868
- name: "structuredOutputModel",
21869
- message: "Select your model for structured output tasks (or use base model):",
21870
- choices: optionalChoices
21871
- },
21872
- {
21873
- type: "list",
21874
- name: "summarizerModel",
21875
- message: "Select your model for summaries and quick tasks (or use base model):",
21876
- choices: optionalChoices
21877
- }
21878
- ]);
21879
- }
21880
- const modelSettings = {
21881
- base: {
21882
- model: modelAnswers.baseModel
21883
- }
21884
- };
21885
- if (optionalModels.structuredOutputModel) {
21886
- modelSettings.structuredOutput = {
21887
- model: optionalModels.structuredOutputModel
21888
- };
21889
- }
21890
- if (optionalModels.summarizerModel) {
21891
- modelSettings.summarizer = {
21892
- model: optionalModels.summarizerModel
21893
- };
21894
- }
21895
- return { modelSettings };
21896
- }
21897
-
21898
- // src/commands/init.ts
21899
21713
  function findProjectRoot(startPath) {
21900
21714
  let currentPath = resolve(startPath);
21901
21715
  const root = dirname2(currentPath);
@@ -21936,7 +21750,7 @@ async function initCommand(options) {
21936
21750
  if (options?.interactive === false) {
21937
21751
  configPath = suggestedPath;
21938
21752
  } else {
21939
- const { confirmedPath } = await inquirer2.prompt([
21753
+ const { confirmedPath } = await inquirer.prompt([
21940
21754
  {
21941
21755
  type: "input",
21942
21756
  name: "confirmedPath",
@@ -21960,7 +21774,7 @@ async function initCommand(options) {
21960
21774
  }
21961
21775
  }
21962
21776
  if (existsSync3(configPath)) {
21963
- const { overwrite } = await inquirer2.prompt([
21777
+ const { overwrite } = await inquirer.prompt([
21964
21778
  {
21965
21779
  type: "confirm",
21966
21780
  name: "overwrite",
@@ -21973,7 +21787,7 @@ async function initCommand(options) {
21973
21787
  return;
21974
21788
  }
21975
21789
  }
21976
- const answers = await inquirer2.prompt([
21790
+ const answers = await inquirer.prompt([
21977
21791
  {
21978
21792
  type: "input",
21979
21793
  name: "tenantId",
@@ -21985,18 +21799,6 @@ async function initCommand(options) {
21985
21799
  return true;
21986
21800
  }
21987
21801
  },
21988
- {
21989
- type: "input",
21990
- name: "projectId",
21991
- message: "Enter your project ID:",
21992
- default: "default",
21993
- validate: (input) => {
21994
- if (!input || input.trim() === "") {
21995
- return "Project ID is required";
21996
- }
21997
- return true;
21998
- }
21999
- },
22000
21802
  {
22001
21803
  type: "input",
22002
21804
  name: "apiUrl",
@@ -22012,15 +21814,12 @@ async function initCommand(options) {
22012
21814
  }
22013
21815
  }
22014
21816
  ]);
22015
- const { modelSettings } = await promptForModelConfiguration();
22016
21817
  const configContent = `import { defineConfig } from '@inkeep/agents-cli/config';
22017
21818
 
22018
21819
  export default defineConfig({
22019
21820
  tenantId: '${answers.tenantId}',
22020
- projectId: '${answers.projectId}',
22021
21821
  agentsManageApiUrl: '${answers.apiUrl}',
22022
21822
  agentsRunApiUrl: '${answers.apiUrl}',
22023
- modelSettings: ${JSON.stringify(modelSettings, null, 2)},
22024
21823
  });
22025
21824
  `;
22026
21825
  try {
@@ -22052,12 +21851,13 @@ import ora3 from "ora";
22052
21851
  async function listGraphsCommand(options) {
22053
21852
  let config;
22054
21853
  try {
21854
+ const configPath2 = options.config || options.configFilePath;
22055
21855
  config = await validateConfiguration(
22056
21856
  options.tenantId,
22057
21857
  options.agentsManageApiUrl,
22058
21858
  void 0,
22059
21859
  // agentsRunApiUrl not needed for list-graphs
22060
- options.configFilePath
21860
+ configPath2
22061
21861
  );
22062
21862
  } catch (error) {
22063
21863
  console.error(chalk5.red(error.message));
@@ -22067,9 +21867,10 @@ async function listGraphsCommand(options) {
22067
21867
  console.log(chalk5.gray(` \u2022 Tenant ID: ${config.sources.tenantId}`));
22068
21868
  console.log(chalk5.gray(` \u2022 API URL: ${config.sources.agentsManageApiUrl}`));
22069
21869
  console.log();
21870
+ const configPath = options.config || options.configFilePath;
22070
21871
  const api = await ManagementApiClient.create(
22071
21872
  config.agentsManageApiUrl,
22072
- options.configFilePath,
21873
+ configPath,
22073
21874
  config.tenantId
22074
21875
  );
22075
21876
  const spinner = ora3("Fetching graphs...").start();
@@ -22115,112 +21916,150 @@ ${table.toString()}`);
22115
21916
  // src/commands/pull.ts
22116
21917
  init_esm_shims();
22117
21918
  init_env2();
22118
- import { existsSync as existsSync7, writeFileSync as writeFileSync3 } from "fs";
22119
- import { join as join7 } from "path";
21919
+ init_tsx_loader();
21920
+ import { existsSync as existsSync6, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync4 } from "fs";
21921
+ import { dirname as dirname4, join as join7, resolve as resolve4 } from "path";
22120
21922
  import chalk6 from "chalk";
22121
21923
  import ora4 from "ora";
22122
-
22123
- // src/utils/file-finder.ts
22124
- init_esm_shims();
22125
- import { existsSync as existsSync5, readdirSync as readdirSync2, statSync } from "fs";
22126
- import { join as join5, relative } from "path";
22127
- function findAllTypeScriptFiles(rootDir, excludeDirs = []) {
22128
- const tsFiles = [];
22129
- function scanDirectory(dir) {
22130
- if (!existsSync5(dir)) {
22131
- return;
22132
- }
22133
- const items = readdirSync2(dir);
22134
- for (const item of items) {
22135
- const fullPath = join5(dir, item);
22136
- const relativePath = relative(rootDir, fullPath);
22137
- const isExcludedDir = excludeDirs.some(
22138
- (excludeDir) => relativePath === excludeDir || relativePath.startsWith(`${excludeDir}/`)
22139
- );
22140
- if (isExcludedDir) {
22141
- continue;
22142
- }
22143
- const stat = statSync(fullPath);
22144
- if (stat.isDirectory()) {
22145
- scanDirectory(fullPath);
22146
- } else if (stat.isFile() && item.endsWith(".ts")) {
22147
- tsFiles.push(fullPath);
22148
- }
22149
- }
22150
- }
22151
- scanDirectory(rootDir);
22152
- return tsFiles.sort();
22153
- }
22154
- function categorizeTypeScriptFiles(files, rootDir) {
22155
- const indexFile = files.find((file) => file.endsWith("/index.ts") || file === join5(rootDir, "index.ts")) || null;
22156
- const configFiles = [];
22157
- const graphFiles = [];
22158
- const agentFiles = [];
22159
- const toolFiles = [];
22160
- const otherFiles = [];
22161
- for (const file of files) {
22162
- const fileName = file.split("/").pop() || "";
22163
- const relativePath = relative(rootDir, file);
22164
- if (file === indexFile) {
22165
- continue;
22166
- }
22167
- if (fileName.includes(".config.") || fileName.includes(".env.") || fileName === "inkeep.config.ts") {
22168
- configFiles.push(file);
22169
- } else if (fileName.includes(".graph.") || relativePath.includes("graphs/")) {
22170
- graphFiles.push(file);
22171
- } else if (fileName.includes("agent") || fileName.includes("Agent") || relativePath.includes("agents/")) {
22172
- agentFiles.push(file);
22173
- } else if (fileName.includes("tool") || fileName.includes("Tool") || relativePath.includes("tools/")) {
22174
- toolFiles.push(file);
22175
- } else {
22176
- otherFiles.push(file);
22177
- }
22178
- }
22179
- return {
22180
- indexFile,
22181
- configFiles,
22182
- graphFiles,
22183
- agentFiles,
22184
- toolFiles,
22185
- otherFiles
22186
- };
22187
- }
21924
+ import prompts from "prompts";
22188
21925
 
22189
21926
  // src/utils/project-directory.ts
22190
21927
  init_esm_shims();
22191
- import { existsSync as existsSync6 } from "fs";
22192
- import { join as join6, resolve as resolve3 } from "path";
21928
+ import { existsSync as existsSync5 } from "fs";
21929
+ import { join as join5, resolve as resolve3 } from "path";
22193
21930
  import { findUp } from "find-up";
22194
- async function findProjectDirectory(projectId) {
21931
+ async function findProjectDirectory(projectId, configPath) {
21932
+ if (configPath) {
21933
+ const absoluteConfigPath = resolve3(process.cwd(), configPath);
21934
+ if (existsSync5(absoluteConfigPath)) {
21935
+ return resolve3(absoluteConfigPath, "..");
21936
+ }
21937
+ }
22195
21938
  if (projectId) {
22196
21939
  if (projectId.includes("/") || projectId.includes("\\")) {
22197
21940
  const projectPath = resolve3(process.cwd(), projectId);
22198
- if (existsSync6(join6(projectPath, "inkeep.config.ts"))) {
21941
+ if (existsSync5(join5(projectPath, "inkeep.config.ts"))) {
22199
21942
  return projectPath;
22200
21943
  }
22201
21944
  } else {
22202
- const projectPath = join6(process.cwd(), projectId);
22203
- if (existsSync6(join6(projectPath, "inkeep.config.ts"))) {
21945
+ const projectPath = join5(process.cwd(), projectId);
21946
+ if (existsSync5(join5(projectPath, "inkeep.config.ts"))) {
22204
21947
  return projectPath;
22205
21948
  }
22206
21949
  }
22207
21950
  return null;
22208
21951
  }
22209
- const configPath = await findUp("inkeep.config.ts");
22210
- if (configPath) {
22211
- return resolve3(configPath, "..");
21952
+ const foundConfigPath = await findUp("inkeep.config.ts");
21953
+ if (foundConfigPath) {
21954
+ return resolve3(foundConfigPath, "..");
22212
21955
  }
22213
21956
  return null;
22214
21957
  }
22215
21958
 
22216
- // src/commands/pull.ts
22217
- init_tsx_loader();
22218
-
22219
21959
  // src/commands/pull.llm-generate.ts
22220
21960
  init_esm_shims();
21961
+ import { writeFileSync as writeFileSync3 } from "fs";
21962
+ import { join as join6 } from "path";
22221
21963
  import { anthropic, createAnthropic } from "@ai-sdk/anthropic";
22222
21964
  import { createOpenAI, openai } from "@ai-sdk/openai";
22223
21965
  import { generateText } from "ai";
21966
+
21967
+ // src/commands/pull.placeholder-system.ts
21968
+ init_esm_shims();
21969
+ import { randomBytes as randomBytes2 } from "crypto";
21970
+ var MIN_REPLACEMENT_LENGTH = 50;
21971
+ function generateShortId(length = 8) {
21972
+ return randomBytes2(Math.ceil(length / 2)).toString("hex").slice(0, length);
21973
+ }
21974
+ function generatePlaceholder(jsonPath) {
21975
+ const shortId = generateShortId(8);
21976
+ return `<{{${jsonPath}.${shortId}}}>`;
21977
+ }
21978
+ function shouldReplaceString(value, placeholder) {
21979
+ return value.length >= MIN_REPLACEMENT_LENGTH && placeholder.length < value.length;
21980
+ }
21981
+ function processObject(obj, tracker, path3 = "") {
21982
+ if (typeof obj === "string") {
21983
+ const existingPlaceholder = tracker.valueToPlaceholder.get(obj);
21984
+ if (existingPlaceholder) {
21985
+ return existingPlaceholder;
21986
+ }
21987
+ const placeholder = generatePlaceholder(path3);
21988
+ if (shouldReplaceString(obj, placeholder)) {
21989
+ const existingValue = tracker.placeholderToValue.get(placeholder);
21990
+ if (existingValue && existingValue !== obj) {
21991
+ throw new Error(
21992
+ `Placeholder collision detected: placeholder '${placeholder}' already exists with different value. Existing value length: ${existingValue.length}, New value length: ${obj.length}`
21993
+ );
21994
+ }
21995
+ tracker.placeholderToValue.set(placeholder, obj);
21996
+ tracker.valueToPlaceholder.set(obj, placeholder);
21997
+ return placeholder;
21998
+ }
21999
+ return obj;
22000
+ }
22001
+ if (Array.isArray(obj)) {
22002
+ return obj.map((item, index2) => processObject(item, tracker, `${path3}[${index2}]`));
22003
+ }
22004
+ if (obj && typeof obj === "object") {
22005
+ const result = {};
22006
+ for (const [key, value] of Object.entries(obj)) {
22007
+ const currentPath = path3 ? `${path3}.${key}` : key;
22008
+ result[key] = processObject(value, tracker, currentPath);
22009
+ }
22010
+ return result;
22011
+ }
22012
+ return obj;
22013
+ }
22014
+ function createPlaceholders(data) {
22015
+ const tracker = {
22016
+ placeholderToValue: /* @__PURE__ */ new Map(),
22017
+ valueToPlaceholder: /* @__PURE__ */ new Map()
22018
+ };
22019
+ try {
22020
+ const processedData = processObject(data, tracker);
22021
+ const replacements = {};
22022
+ for (const [placeholder, value] of tracker.placeholderToValue.entries()) {
22023
+ replacements[placeholder] = value;
22024
+ }
22025
+ return {
22026
+ processedData,
22027
+ replacements
22028
+ };
22029
+ } catch (error) {
22030
+ console.warn("Placeholder creation failed, using original data:", error);
22031
+ return {
22032
+ processedData: data,
22033
+ replacements: {}
22034
+ };
22035
+ }
22036
+ }
22037
+ function restorePlaceholders(generatedCode, replacements) {
22038
+ let restoredCode = generatedCode;
22039
+ const sortedPlaceholders = Object.keys(replacements).sort((a, b2) => b2.length - a.length);
22040
+ for (const placeholder of sortedPlaceholders) {
22041
+ let originalValue = replacements[placeholder];
22042
+ originalValue = originalValue.replace(/`/g, "\\`");
22043
+ const escapedPlaceholder = placeholder.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
22044
+ const regex = new RegExp(escapedPlaceholder, "g");
22045
+ restoredCode = restoredCode.replace(regex, originalValue);
22046
+ }
22047
+ return restoredCode;
22048
+ }
22049
+ function calculateTokenSavings(originalData, processedData) {
22050
+ const originalSize = JSON.stringify(originalData).length;
22051
+ const processedSize = JSON.stringify(processedData).length;
22052
+ const savings = originalSize - processedSize;
22053
+ const savingsPercentage = originalSize > 0 ? savings / originalSize * 100 : 0;
22054
+ return {
22055
+ originalSize,
22056
+ processedSize,
22057
+ savings,
22058
+ savingsPercentage
22059
+ };
22060
+ }
22061
+
22062
+ // src/commands/pull.llm-generate.ts
22224
22063
  function createModel(config) {
22225
22064
  if (!config.model) {
22226
22065
  throw new Error("Model configuration is required for pull command");
@@ -22245,6 +22084,79 @@ function createModel(config) {
22245
22084
  throw new Error(`Unsupported provider: ${provider}`);
22246
22085
  }
22247
22086
  }
22087
+ var NAMING_CONVENTION_RULES = `
22088
+ CRITICAL NAMING CONVENTION RULES (Apply to ALL imports/exports):
22089
+ - File paths ALWAYS use the exact original ID (e.g., '../tools/inkeep_facts', '../data-components/user-profile')
22090
+ - Import/export names MUST be camelCase versions of the ID
22091
+ - Conversion rules for import/export names:
22092
+ - IDs with underscores: 'inkeep_facts' \u2192 inkeepFacts
22093
+ - IDs with hyphens: 'weather-api' \u2192 weatherApi
22094
+ - IDs with both: 'my_weather-api' \u2192 myWeatherApi
22095
+ - Random/UUID IDs: Keep as-is (e.g., 'fUI2riwrBVJ6MepT8rjx0' \u2192 fUI2riwrBVJ6MepT8rjx0)
22096
+ - IDs starting with uppercase: Make first letter lowercase unless it's an acronym
22097
+ - The ID field in the exported object keeps the original format
22098
+ - Examples:
22099
+ - Tool: import { inkeepFacts } from '../tools/inkeep_facts'; export const inkeepFacts = mcpTool({ id: 'inkeep_facts', ... })
22100
+ - Component: import { userProfile } from '../data-components/user-profile'; export const userProfile = dataComponent({ id: 'user-profile', ... })
22101
+ - Graph: import { myGraph } from './graphs/my-graph'; export const myGraph = agentGraph({ id: 'my-graph', ... })
22102
+ `;
22103
+ var IMPORT_INSTRUCTIONS = `
22104
+ CRITICAL IMPORT PATTERNS:
22105
+ - Tools: Import from '../tools/{toolId}' (individual files)
22106
+ - Data components: Import from '../data-components/{componentId}' (individual files)
22107
+ - Artifact components: Import from '../artifact-components/{componentId}' (individual files)
22108
+ - Graphs: Import from './graphs/{graphId}' (individual files)
22109
+
22110
+ NEVER use barrel imports from directories:
22111
+ \u274C WRONG: import { ambiguity, fact } from '../data-components';
22112
+ \u2705 CORRECT:
22113
+ import { ambiguity } from '../data-components/ambiguity';
22114
+ import { fact } from '../data-components/fact';
22115
+
22116
+ EXAMPLES:
22117
+ // Multiple data components - each from individual file:
22118
+ import { ambiguity } from '../data-components/ambiguity';
22119
+ import { clarifyingquestion } from '../data-components/clarifyingquestion';
22120
+ import { fact } from '../data-components/fact';
22121
+
22122
+ // Tools - each from individual file:
22123
+ import { inkeepFacts } from '../tools/inkeep_facts';
22124
+ import { weatherApi } from '../tools/weather-api';
22125
+
22126
+ // Graphs - each from individual file:
22127
+ import { inkeepQaGraph } from './graphs/inkeep-qa-graph';
22128
+ import { weatherGraph } from './graphs/weather-graph';
22129
+ `;
22130
+ function cleanGeneratedCode(text2) {
22131
+ return text2.replace(/^```(?:typescript|ts)?\n?/, "").replace(/\n?```$/, "").trim();
22132
+ }
22133
+ async function generateTextWithPlaceholders(model, data, promptTemplate, options, debug = false) {
22134
+ const { processedData, replacements } = createPlaceholders(data);
22135
+ if (debug && Object.keys(replacements).length > 0) {
22136
+ const savings = calculateTokenSavings(data, processedData);
22137
+ console.log(`[DEBUG] Placeholder optimization:`);
22138
+ console.log(`[DEBUG] - Original data size: ${savings.originalSize} characters`);
22139
+ console.log(`[DEBUG] - Processed data size: ${savings.processedSize} characters`);
22140
+ console.log(
22141
+ `[DEBUG] - Token savings: ${savings.savings} characters (${savings.savingsPercentage.toFixed(1)}%)`
22142
+ );
22143
+ console.log(`[DEBUG] - Placeholders created: ${Object.keys(replacements).length}`);
22144
+ }
22145
+ const prompt = promptTemplate.replace("{{DATA}}", JSON.stringify(processedData, null, 2));
22146
+ if (debug) {
22147
+ console.log(`[DEBUG] Final prompt size: ${prompt.length} characters`);
22148
+ }
22149
+ const { text: text2 } = await generateText({
22150
+ model,
22151
+ prompt,
22152
+ ...options
22153
+ });
22154
+ const restoredText = restorePlaceholders(text2, replacements);
22155
+ if (debug && Object.keys(replacements).length > 0) {
22156
+ console.log(`[DEBUG] Placeholders restored successfully`);
22157
+ }
22158
+ return restoredText;
22159
+ }
22248
22160
  function parseModelString(modelString) {
22249
22161
  if (modelString.includes("/")) {
22250
22162
  const [provider, ...modelParts] = modelString.split("/");
@@ -22258,129 +22170,679 @@ function parseModelString(modelString) {
22258
22170
  modelName: modelString
22259
22171
  };
22260
22172
  }
22261
- async function generateTypeScriptFileWithLLM(graphData, graphId, outputFilePath, modelSettings, retryContext) {
22262
- const fs5 = await import("fs");
22263
- let existingContent = "";
22264
- let fileExists = false;
22265
- try {
22266
- existingContent = fs5.readFileSync(outputFilePath, "utf-8");
22267
- fileExists = true;
22268
- } catch {
22269
- fileExists = false;
22270
- }
22173
+ async function generateIndexFile(projectData, outputPath, modelSettings) {
22174
+ const model = createModel(modelSettings);
22175
+ const promptTemplate = `Generate a TypeScript index.ts file for an Inkeep project with the following data:
22176
+
22177
+ PROJECT DATA:
22178
+ {{DATA}}
22179
+
22180
+ ${NAMING_CONVENTION_RULES}
22181
+
22182
+ CRITICAL IMPORT PATTERNS FOR INDEX.TS:
22183
+ - Tools: Import from './tools/{toolId}' (individual files)
22184
+ - Data components: Import from './data-components/{componentId}' (individual files)
22185
+ - Artifact components: Import from './artifact-components/{componentId}' (individual files)
22186
+ - Graphs: Import from './graphs/{graphId}' (individual files)
22187
+
22188
+ NEVER use barrel imports from directories:
22189
+ \u274C WRONG: import { ambiguity, fact } from './data-components';
22190
+ \u2705 CORRECT:
22191
+ import { ambiguity } from './data-components/ambiguity';
22192
+ import { fact } from './data-components/fact';
22193
+
22194
+ EXAMPLES:
22195
+ // Multiple data components - each from individual file:
22196
+ import { ambiguity } from './data-components/ambiguity';
22197
+ import { clarifyingquestion } from './data-components/clarifyingquestion';
22198
+ import { fact } from './data-components/fact';
22199
+
22200
+ REQUIREMENTS:
22201
+ 1. Import the project function from '@inkeep/agents-sdk'
22202
+ 2. Import each graph from individual files in the graphs directory
22203
+ 3. Import each tool from individual files in the tools directory
22204
+ 4. Import each data component from individual files in the data-components directory
22205
+ 5. Import each artifact component from individual files in the artifact-components directory
22206
+ 6. CRITICAL: All imports MUST be alphabetically sorted (both named imports and path names)
22207
+ 7. Export a const named after the project ID (in camelCase) using the project() function
22208
+ 8. The project object should include:
22209
+ - id: project ID
22210
+ - name: project name
22211
+ - description: project description (if provided)
22212
+ - models: model configuration (if provided)
22213
+ - stopWhen: stop configuration (if provided)
22214
+ - graphs: arrow function returning array of imported graphs
22215
+ - tools: arrow function returning array of imported tools by their IDs (if any)
22216
+ - dataComponents: arrow function returning array of imported data components (if any)
22217
+ - artifactComponents: arrow function returning array of imported artifact components (if any)
22218
+
22219
+ EXAMPLE (note: tools are imported and referenced by ID, not name):
22220
+ import { project } from '@inkeep/agents-sdk';
22221
+ import { weatherForecast } from './data-components/weather-forecast';
22222
+ import { basicGraph } from './graphs/basic-graph'; // Note: 'basic-graph' becomes camelCase 'basicGraph'
22223
+ import { myGraphId } from './graphs/my-graph-id'; // Note: 'my-graph-id' becomes camelCase 'myGraphId'
22224
+ import { weatherGraph } from './graphs/weather-graph';
22225
+ import { fUI2riwrBVJ6MepT8rjx0 } from './tools/fUI2riwrBVJ6MepT8rjx0';
22226
+ import { fdxgfv9HL7SXlfynPx8hf } from './tools/fdxgfv9HL7SXlfynPx8hf';
22227
+
22228
+ export const weatherProject = project({
22229
+ id: 'weather-project',
22230
+ name: 'Weather Project',
22231
+ description: 'A weather information system',
22232
+ models: {
22233
+ base: { model: 'gpt-4o-mini' }
22234
+ },
22235
+ graphs: () => [basicGraph, myGraphId, weatherGraph],
22236
+ tools: () => [fUI2riwrBVJ6MepT8rjx0, fdxgfv9HL7SXlfynPx8hf],
22237
+ dataComponents: () => [weatherForecast]
22238
+ });
22239
+
22240
+ Generate ONLY the TypeScript code without any markdown or explanations.`;
22241
+ const text2 = await generateTextWithPlaceholders(model, projectData, promptTemplate, {
22242
+ temperature: 0.1,
22243
+ maxOutputTokens: 4e3,
22244
+ abortSignal: AbortSignal.timeout(6e4)
22245
+ // 60 second timeout
22246
+ });
22247
+ writeFileSync3(outputPath, cleanGeneratedCode(text2));
22248
+ }
22249
+ async function generateGraphFile(graphData, graphId, outputPath, modelSettings, debug = false) {
22271
22250
  const model = createModel(modelSettings);
22272
- const prompt = createPrompt(graphData, graphId, existingContent, fileExists, retryContext);
22251
+ const promptTemplate = `Generate a TypeScript file for an Inkeep agent graph.
22252
+
22253
+ GRAPH DATA:
22254
+ {{DATA}}
22255
+
22256
+ GRAPH ID: ${graphId}
22257
+
22258
+ IMPORTANT CONTEXT:
22259
+ - Tools are defined at the project level and imported from '../tools' directory
22260
+ - Data components are imported from individual files in '../data-components' directory
22261
+ - Artifact components are imported from individual files in '../artifact-components' directory
22262
+ - CRITICAL: Tool files are named by their IDs (e.g., '../tools/fUI2riwrBVJ6MepT8rjx0')
22263
+ - CRITICAL: Import tools using their IDs as both file name and variable name
22264
+ - Agents reference these resources by their imported variable names
22265
+ - The 'tools' field in agents contains tool IDs that must match the imported variable names
22266
+
22267
+ ${NAMING_CONVENTION_RULES}
22268
+
22269
+ REQUIREMENTS:
22270
+ 1. Import { agent, agentGraph } from '@inkeep/agents-sdk' - ALWAYS sort named imports alphabetically
22271
+ 2. Import tools from '../tools/{toolId}' following naming convention rules
22272
+ 3. Import data components from '../data-components/{componentId}' following naming convention rules
22273
+ 4. Import artifact components from '../artifact-components/{componentId}' following naming convention rules
22274
+ 5. Define each agent using the agent() function with:
22275
+ - id, name, description, prompt
22276
+ - canUse: arrow function returning array of imported tool variables (using their IDs)
22277
+ - selectedTools: if present, maps tool ID variable to selected tool names
22278
+ - dataComponents: arrow function returning array of imported component configs
22279
+ - artifactComponents: arrow function returning array of imported component configs
22280
+ - canTransferTo/canDelegateTo: arrow functions returning agent variables
22281
+ 6. Create the graph using agentGraph() with proper structure
22282
+ - IMPORTANT: If description is null, undefined, or empty string, omit the description field entirely
22283
+ - Only include description if it has a meaningful value
22284
+ 7. CRITICAL: Export the graph with proper camelCase naming:
22285
+ - Convert graph IDs with hyphens to camelCase (e.g., 'basic-graph' becomes 'basicGraph')
22286
+ - Remove hyphens and capitalize the letter after each hyphen
22287
+ - First letter should be lowercase
22288
+ 8. Ensure all imports are sorted alphabetically
22289
+ 9. CRITICAL: For multi-line strings (especially prompts), ALWAYS use template literals with backticks:
22290
+ - Single-line strings: use regular quotes 'short string'
22291
+ - Multi-line strings: MUST use template literals starting and ending with backticks
22292
+ - IMPORTANT: ANY placeholder that starts with < and ends with > MUST be wrapped in template literals (backticks)
22293
+ - Placeholders contain multi-line content and require template literals
22294
+ - This prevents TypeScript syntax errors with newlines and special characters
22295
+
22296
+ NAMING CONVENTION EXAMPLES:
22297
+ // Tool with underscore ID 'inkeep_facts':
22298
+ import { inkeepFacts } from '../tools/inkeep_facts'; // camelCase import, exact ID in path
22299
+
22300
+ // Tool with hyphen ID 'weather-api':
22301
+ import { weatherApi } from '../tools/weather-api'; // camelCase import, exact ID in path
22302
+
22303
+ // Data component with hyphen ID 'user-profile':
22304
+ import { userProfile } from '../data-components/user-profile'; // camelCase import, exact ID in path
22305
+
22306
+ // Random ID (no conversion needed):
22307
+ import { fUI2riwrBVJ6MepT8rjx0 } from '../tools/fUI2riwrBVJ6MepT8rjx0';
22308
+
22309
+ // PLACEHOLDER HANDLING EXAMPLES:
22310
+ // CORRECT - Placeholder wrapped in template literals:
22311
+ prompt: \`<{{agents.facts.prompt.abc12345}}>\`
22312
+
22313
+ // INCORRECT - Placeholder wrapped in single quotes (causes syntax errors):
22314
+ prompt: '<{{agents.facts.prompt.abc12345}}>'
22315
+
22316
+ ${IMPORT_INSTRUCTIONS}
22317
+
22318
+ FULL EXAMPLE:
22319
+ import { agent, agentGraph } from '@inkeep/agents-sdk';
22320
+ import { userProfile } from '../data-components/user-profile';
22321
+ import { inkeepFacts } from '../tools/inkeep_facts';
22322
+ import { weatherApi } from '../tools/weather-api';
22323
+
22324
+ const routerAgent = agent({
22325
+ id: 'router',
22326
+ name: 'Router Agent',
22327
+ prompt: 'Route requests to appropriate agents',
22328
+ canTransferTo: () => [qaAgent]
22329
+ });
22330
+
22331
+ const qaAgent = agent({
22332
+ id: 'qa',
22333
+ name: 'QA Agent',
22334
+ prompt: \`You are a helpful QA agent.
22335
+
22336
+ Follow these rules:
22337
+ - Always be helpful
22338
+ - Provide accurate answers
22339
+ - Use available tools\`,
22340
+ canUse: () => [searchTool, weatherTool],
22341
+ selectedTools: {
22342
+ [searchTool.id]: ['search_web', 'search_docs'],
22343
+ [weatherTool.id]: ['get_forecast']
22344
+ },
22345
+ dataComponents: () => [userProfile.config]
22346
+ });
22347
+
22348
+ // Example: Graph ID 'support-graph' becomes 'supportGraph'
22349
+ export const supportGraph = agentGraph({
22350
+ id: 'support-graph',
22351
+ name: 'Support Graph',
22352
+ description: 'Multi-agent support system', // Only include if description has a value
22353
+ defaultAgent: routerAgent,
22354
+ agents: () => [routerAgent, qaAgent]
22355
+ });
22356
+
22357
+ // Example without description (when null or undefined):
22358
+ export const weatherGraph = agentGraph({
22359
+ id: 'weather-graph',
22360
+ name: 'Weather Graph',
22361
+ // description is omitted when null, undefined, or empty
22362
+ defaultAgent: routerAgent,
22363
+ agents: () => [routerAgent, qaAgent]
22364
+ });
22365
+
22366
+ Generate ONLY the TypeScript code without any markdown or explanations.`;
22367
+ if (debug) {
22368
+ console.log(`
22369
+ [DEBUG] === Starting graph generation for: ${graphId} ===`);
22370
+ console.log(`[DEBUG] Output path: ${outputPath}`);
22371
+ console.log(`[DEBUG] Model: ${modelSettings.model || "default"}`);
22372
+ console.log(`[DEBUG] Graph data size: ${JSON.stringify(graphData).length} characters`);
22373
+ const agentCount = Object.keys(graphData.agents || {}).length;
22374
+ const toolIds = /* @__PURE__ */ new Set();
22375
+ const dataComponentIds = /* @__PURE__ */ new Set();
22376
+ const artifactComponentIds = /* @__PURE__ */ new Set();
22377
+ for (const agent of Object.values(graphData.agents || {})) {
22378
+ const agentData = agent;
22379
+ if (agentData.tools) {
22380
+ for (const toolId of Object.keys(agentData.tools)) {
22381
+ toolIds.add(toolId);
22382
+ }
22383
+ }
22384
+ if (agentData.dataComponents) {
22385
+ for (const id of Object.keys(agentData.dataComponents)) {
22386
+ dataComponentIds.add(id);
22387
+ }
22388
+ }
22389
+ if (agentData.artifactComponents) {
22390
+ for (const id of Object.keys(agentData.artifactComponents)) {
22391
+ artifactComponentIds.add(id);
22392
+ }
22393
+ }
22394
+ }
22395
+ console.log(`[DEBUG] Graph complexity:`);
22396
+ console.log(`[DEBUG] - Agents: ${agentCount}`);
22397
+ console.log(`[DEBUG] - Unique tools: ${toolIds.size}`);
22398
+ console.log(`[DEBUG] - Data components: ${dataComponentIds.size}`);
22399
+ console.log(`[DEBUG] - Artifact components: ${artifactComponentIds.size}`);
22400
+ console.log(
22401
+ `[DEBUG] - Has relations: ${graphData.relations ? Object.keys(graphData.relations).length : 0}`
22402
+ );
22403
+ }
22273
22404
  try {
22274
- const { text: text2 } = await generateText({
22405
+ const startTime = Date.now();
22406
+ if (debug) {
22407
+ console.log(`[DEBUG] Sending request to LLM API...`);
22408
+ }
22409
+ const text2 = await generateTextWithPlaceholders(
22275
22410
  model,
22276
- prompt,
22277
- temperature: 0.1,
22278
- // Low temperature for consistent code generation
22279
- maxOutputTokens: 16e3
22280
- // Increased to handle large TypeScript files
22281
- });
22282
- fs5.writeFileSync(outputFilePath, text2, "utf-8");
22283
- console.log(`\u2705 Successfully generated TypeScript file: ${outputFilePath}`);
22411
+ graphData,
22412
+ promptTemplate,
22413
+ {
22414
+ temperature: 0.1,
22415
+ maxOutputTokens: 16e3,
22416
+ abortSignal: AbortSignal.timeout(24e4)
22417
+ // 240 second timeout for complex graphs
22418
+ },
22419
+ debug
22420
+ // Pass debug flag to show placeholder optimization info
22421
+ );
22422
+ const duration = Date.now() - startTime;
22423
+ if (debug) {
22424
+ console.log(`[DEBUG] LLM response received in ${duration}ms`);
22425
+ console.log(`[DEBUG] Generated text length: ${text2.length} characters`);
22426
+ console.log(`[DEBUG] Writing to file: ${outputPath}`);
22427
+ }
22428
+ const cleanedCode = cleanGeneratedCode(text2);
22429
+ writeFileSync3(outputPath, cleanedCode);
22430
+ if (debug) {
22431
+ console.log(`[DEBUG] Graph file written successfully`);
22432
+ console.log(`[DEBUG] === Completed graph generation for: ${graphId} ===
22433
+ `);
22434
+ }
22284
22435
  } catch (error) {
22285
- console.error("\u274C Error generating TypeScript file with LLM:", error);
22436
+ if (debug) {
22437
+ console.error(`[DEBUG] === ERROR generating graph file ${graphId} ===`);
22438
+ console.error(`[DEBUG] Error name: ${error.name}`);
22439
+ console.error(`[DEBUG] Error message: ${error.message}`);
22440
+ if (error.name === "AbortError") {
22441
+ console.error(`[DEBUG] Request timed out after 240 seconds`);
22442
+ console.error(`[DEBUG] This might indicate the graph is too complex or the API is slow`);
22443
+ }
22444
+ if (error.response) {
22445
+ console.error(`[DEBUG] Response status: ${error.response.status}`);
22446
+ console.error(`[DEBUG] Response headers:`, error.response.headers);
22447
+ }
22448
+ console.error(`[DEBUG] Full error:`, error);
22449
+ }
22286
22450
  throw error;
22287
22451
  }
22288
22452
  }
22289
- function createPrompt(graphData, graphId, existingContent, fileExists, retryContext) {
22290
- const graphDataJson = JSON.stringify(graphData, null, 2);
22291
- const retryInstructions = retryContext && retryContext.attempt > 1 ? `
22292
- RETRY CONTEXT:
22293
- This is attempt ${retryContext.attempt} of ${retryContext.maxRetries}. Previous attempts had validation issues.
22453
+ async function generateToolFile(toolData, toolId, outputPath, modelSettings) {
22454
+ const model = createModel(modelSettings);
22455
+ const promptTemplate = `Generate a TypeScript file for an Inkeep tool.
22294
22456
 
22295
- ${retryContext.previousDifferences && retryContext.previousDifferences.length > 0 ? `
22296
- PREVIOUS VALIDATION ISSUES:
22297
- ${retryContext.previousDifferences.map((diff, index2) => `${index2 + 1}. ${diff}`).join("\n")}
22457
+ TOOL DATA:
22458
+ {{DATA}}
22298
22459
 
22299
- IMPORTANT: Pay special attention to these specific issues and ensure they are resolved in this attempt.
22300
- ` : ""}
22460
+ TOOL ID: ${toolId}
22301
22461
 
22302
- CRITICAL: This is a retry attempt. You must be extremely careful to match the exact structure and values from the graph data. Double-check all IDs, names, and configurations.
22303
- ` : "";
22304
- if (!fileExists) {
22305
- return `You are an expert TypeScript developer. Generate a complete TypeScript file for an Inkeep agent graph configuration.${retryInstructions}
22462
+ ${NAMING_CONVENTION_RULES}
22306
22463
 
22307
- GRAPH DATA (JSON):
22308
- ${graphDataJson}
22464
+ REQUIREMENTS:
22465
+ 1. Import mcpTool from '@inkeep/agents-sdk' - ensure imports are alphabetically sorted
22466
+ 2. CRITICAL: Always include serverUrl property (required by SDK) extracted from config.mcp.server.url
22467
+ 3. CRITICAL: Use individual properties supported by mcpTool - do NOT use nested config object
22468
+ 4. Extract configuration properties and map them to mcpTool's expected properties (serverUrl, transport, etc.)
22469
+ 5. Export the tool following naming convention rules (camelCase version of ID)
22470
+ 6. CRITICAL: If credentialReferenceId exists in tool data, add it as a credential property using envSettings.getEnvironmentSetting()
22471
+ 7. Convert credentialReferenceId to credential key format by replacing hyphens with underscores for the getEnvironmentSetting() call (e.g., 'inkeep-api-credential' becomes 'inkeep_api_credential')
22472
+ 8. CRITICAL: All imports must be alphabetically sorted to comply with Biome linting
22473
+ 9. TRANSPORT CONFIG: If config.mcp.transport exists, extract it as a transport property (not nested in config)
22474
+ 10. NO CONFIG OBJECT: mcpTool does not accept a 'config' property - use individual properties only
22475
+
22476
+ EXAMPLE FOR TOOL WITH UNDERSCORE ID:
22477
+ import { mcpTool } from '@inkeep/agents-sdk';
22478
+
22479
+ // Tool ID 'inkeep_facts' becomes export name 'inkeepFacts'
22480
+ export const inkeepFacts = mcpTool({
22481
+ id: 'inkeep_facts', // Keep original ID here
22482
+ name: 'Inkeep Facts',
22483
+ serverUrl: 'https://facts.inkeep.com/mcp'
22484
+ });
22485
+
22486
+ EXAMPLE FOR TOOL WITH CREDENTIAL REFERENCE:
22487
+ import { mcpTool } from '@inkeep/agents-sdk';
22488
+ import { envSettings } from '../environments';
22489
+
22490
+ // Tool with credential reference - note credentialReferenceId 'inkeep-api-credential' becomes 'inkeep_api_credential'
22491
+ // IMPORTANT: Use individual properties only, no nested config object
22492
+ export const inkeepFacts = mcpTool({
22493
+ id: 'inkeep_facts',
22494
+ name: 'inkeep_facts',
22495
+ serverUrl: 'https://mcp.inkeep.com/inkeep/mcp',
22496
+ credential: envSettings.getEnvironmentSetting('inkeep_api_credential')
22497
+ });
22498
+
22499
+ EXAMPLE FOR TOOL WITH TRANSPORT CONFIG:
22500
+ import { mcpTool } from '@inkeep/agents-sdk';
22501
+
22502
+ // Tool with transport config - extract transport from config.mcp.transport
22503
+ export const transportTool = mcpTool({
22504
+ id: 'transport_tool',
22505
+ name: 'Transport Tool',
22506
+ serverUrl: 'https://example.com/mcp',
22507
+ transport: {
22508
+ type: 'streamable_http'
22509
+ }
22510
+ });
22511
+
22512
+ EXAMPLE FOR TOOL WITH HYPHEN ID:
22513
+ import { mcpTool } from '@inkeep/agents-sdk';
22514
+
22515
+ // Tool ID 'weather-api' becomes export name 'weatherApi'
22516
+ export const weatherApi = mcpTool({
22517
+ id: 'weather-api', // Keep original ID here
22518
+ name: 'Weather API',
22519
+ serverUrl: 'npx',
22520
+ args: ['-y', '@modelcontextprotocol/server-weather']
22521
+ });
22522
+
22523
+ EXAMPLE FOR RANDOM ID:
22524
+ import { mcpTool } from '@inkeep/agents-sdk';
22525
+
22526
+ // If tool ID is 'fUI2riwrBVJ6MepT8rjx0', export name is 'fUI2riwrBVJ6MepT8rjx0'
22527
+ export const fUI2riwrBVJ6MepT8rjx0 = mcpTool({
22528
+ id: 'fUI2riwrBVJ6MepT8rjx0',
22529
+ name: 'Weather Forecast',
22530
+ serverUrl: 'https://weather-forecast-mcp.vercel.app/mcp'
22531
+ });
22532
+
22533
+ Generate ONLY the TypeScript code without any markdown or explanations.`;
22534
+ const text2 = await generateTextWithPlaceholders(model, toolData, promptTemplate, {
22535
+ temperature: 0.1,
22536
+ maxOutputTokens: 4e3,
22537
+ abortSignal: AbortSignal.timeout(6e4)
22538
+ // 60 second timeout
22539
+ });
22540
+ writeFileSync3(outputPath, cleanGeneratedCode(text2));
22541
+ }
22542
+ async function generateDataComponentFile(componentData, componentId, outputPath, modelSettings) {
22543
+ const model = createModel(modelSettings);
22544
+ const promptTemplate = `Generate a TypeScript file for an Inkeep data component.
22309
22545
 
22310
- GRAPH ID: ${graphId}
22546
+ DATA COMPONENT DATA:
22547
+ {{DATA}}
22548
+
22549
+ COMPONENT ID: ${componentId}
22550
+
22551
+ ${NAMING_CONVENTION_RULES}
22311
22552
 
22312
22553
  REQUIREMENTS:
22313
- 1. Create a complete TypeScript file that exports an agentGraph configuration
22314
- 2. Use the exact structure and patterns shown in the graph data
22315
- 3. For agents, use the \`agent()\` function with proper configuration
22316
- 4. For MCP tools, use the \`mcpTool()\` function with proper configuration
22317
- 5. For context configs, use the \`contextConfig()\` function
22318
- 6. For credential references, use the \`credentialReference()\` function
22319
- 7. Use proper TypeScript syntax with correct imports
22320
- 8. Handle multi-line strings with template literals (backticks) when needed
22321
- 9. Preserve the exact structure and relationships from the graph data
22322
- 10. Use descriptive variable names based on IDs (e.g., \`qaAgent\`, \`factsTool\`)
22323
- 11. Include helpful comments for complex configurations
22324
- 12. Preserve all configuration details exactly as provided in the graph data
22325
-
22326
- IMPORTANT:
22327
- - If tools array contains numeric indices, use the actual tool IDs instead
22328
- - Preserve all configuration details exactly as provided
22329
- - Use proper TypeScript formatting and indentation
22330
- - Include all necessary imports at the top
22331
- - Add comments for complex objects like GraphQL queries or multi-line instructions
22332
- - Keep the same structure and organization as typical Inkeep graph files
22333
-
22334
- CRITICAL: Generate ONLY the raw TypeScript code. Do NOT wrap it in markdown code blocks (no triple backticks with typescript). Do NOT include any explanations, comments, or markdown formatting. Return only the pure TypeScript code that can be written directly to a .ts file.`;
22335
- } else {
22336
- return `You are an expert TypeScript developer. You must make MINIMAL changes to an existing TypeScript file. Your job is to update ONLY the specific values that have changed, while preserving EVERYTHING else exactly as it is.${retryInstructions}
22554
+ 1. Import dataComponent from '@inkeep/agents-sdk'
22555
+ 2. Create the data component using dataComponent()
22556
+ 3. Include all properties from the component data INCLUDING the 'id' property
22557
+ 4. Export following naming convention rules (camelCase version of ID)
22558
+ 5. CRITICAL: All imports must be alphabetically sorted to comply with Biome linting
22559
+
22560
+ EXAMPLE WITH UNDERSCORE ID:
22561
+ import { dataComponent } from '@inkeep/agents-sdk';
22562
+
22563
+ // Component ID 'user_profile' becomes export name 'userProfile'
22564
+ export const userProfile = dataComponent({
22565
+ id: 'user_profile',
22566
+ name: 'User Profile',
22567
+ description: 'User profile information',
22568
+ props: {
22569
+ userId: { type: 'string', required: true },
22570
+ email: { type: 'string', required: true },
22571
+ preferences: { type: 'object' }
22572
+ }
22573
+ });
22574
+
22575
+ EXAMPLE WITH HYPHEN ID:
22576
+ import { dataComponent } from '@inkeep/agents-sdk';
22577
+
22578
+ // Component ID 'weather-data' becomes export name 'weatherData'
22579
+ export const weatherData = dataComponent({
22580
+ id: 'weather-data',
22581
+ name: 'Weather Data',
22582
+ description: 'Weather information',
22583
+ props: {
22584
+ temperature: { type: 'number', required: true },
22585
+ conditions: { type: 'string' }
22586
+ }
22587
+ });
22588
+
22589
+ Generate ONLY the TypeScript code without any markdown or explanations.`;
22590
+ const text2 = await generateTextWithPlaceholders(model, componentData, promptTemplate, {
22591
+ temperature: 0.1,
22592
+ maxOutputTokens: 4e3,
22593
+ abortSignal: AbortSignal.timeout(6e4)
22594
+ // 60 second timeout
22595
+ });
22596
+ writeFileSync3(outputPath, cleanGeneratedCode(text2));
22597
+ }
22598
+ async function generateArtifactComponentFile(componentData, componentId, outputPath, modelSettings) {
22599
+ const model = createModel(modelSettings);
22600
+ const promptTemplate = `Generate a TypeScript file for an Inkeep artifact component.
22337
22601
 
22338
- EXISTING FILE CONTENT:
22339
- \`\`\`typescript
22340
- ${existingContent}
22341
- \`\`\`
22602
+ ARTIFACT COMPONENT DATA:
22603
+ {{DATA}}
22342
22604
 
22343
- NEW GRAPH DATA (JSON):
22344
- ${graphDataJson}
22605
+ COMPONENT ID: ${componentId}
22345
22606
 
22346
- GRAPH ID: ${graphId}
22607
+ ${NAMING_CONVENTION_RULES}
22347
22608
 
22348
- CRITICAL RULES - FOLLOW THESE EXACTLY:
22349
- 1. PRESERVE ALL EXISTING CONTENT - Do not delete, rewrite, or restructure anything
22350
- 2. ONLY change property values that are actually different between the existing file and new graph data
22351
- 3. KEEP ALL COMMENTS - Do not remove any comments unless they are factually incorrect
22352
- 4. KEEP ALL FORMATTING - Preserve exact spacing, indentation, line breaks, and code style
22353
- 5. KEEP ALL IMPORTS - Do not change import statements
22354
- 6. KEEP ALL VARIABLE NAMES - Use the exact same variable names as in the existing file
22355
- 7. KEEP ALL STRUCTURE - Do not reorganize code blocks or change the order of definitions
22356
-
22357
- WHAT TO CHANGE:
22358
- - Only update property values (like id, name, description, instructions, etc.) that are different
22359
- - If a property value is the same, leave it exactly as it is
22360
- - If a new agent/tool/config is added in the graph data, add it following the existing patterns
22361
- - If an agent/tool/config is removed from the graph data, remove it from the file
22362
-
22363
- WHAT NOT TO CHANGE:
22364
- - Do not rewrite entire functions or objects
22365
- - Do not change the structure or organization
22366
- - Do not remove or modify comments
22367
- - Do not change formatting or style
22368
- - Do not reorganize code blocks
22369
- - Do not change variable names or function names
22370
-
22371
- EXAMPLES OF MINIMAL CHANGES:
22372
- - If only the description changed: update only that one line
22373
- - If only a tool was added: add only the new tool definition
22374
- - If only a property value changed: update only that specific property
22375
-
22376
- CRITICAL: Return ONLY the raw TypeScript code. Do NOT wrap it in markdown code blocks (no triple backticks with typescript). Do NOT include any explanations, comments, or markdown formatting. Return only the pure TypeScript code that can be written directly to a .ts file.`;
22609
+ REQUIREMENTS:
22610
+ 1. Import artifactComponent from '@inkeep/agents-sdk'
22611
+ 2. Create the artifact component using artifactComponent()
22612
+ 3. Include summaryProps and fullProps from the component data
22613
+ 4. Export following naming convention rules (camelCase version of ID)
22614
+ 5. Include the 'id' property to preserve the original component ID
22615
+ 6. CRITICAL: All imports must be alphabetically sorted to comply with Biome linting
22616
+
22617
+ EXAMPLE WITH UNDERSCORE ID:
22618
+ import { artifactComponent } from '@inkeep/agents-sdk';
22619
+
22620
+ // Component ID 'pdf_export' becomes export name 'pdfExport'
22621
+ export const pdfExport = artifactComponent({
22622
+ id: 'pdf_export',
22623
+ name: 'PDF Export',
22624
+ description: 'Export data as PDF',
22625
+ summaryProps: {
22626
+ filename: { type: 'string', required: true }
22627
+ },
22628
+ fullProps: {
22629
+ filename: { type: 'string', required: true },
22630
+ content: { type: 'object', required: true }
22631
+ }
22632
+ });
22633
+
22634
+ EXAMPLE WITH HYPHEN ID:
22635
+ import { artifactComponent } from '@inkeep/agents-sdk';
22636
+
22637
+ // Component ID 'order-summary' becomes export name 'orderSummary'
22638
+ export const orderSummary = artifactComponent({
22639
+ id: 'order-summary',
22640
+ name: 'Order Summary',
22641
+ description: 'Summary of customer order',
22642
+ summaryProps: {
22643
+ orderId: { type: 'string', required: true },
22644
+ total: { type: 'number', required: true }
22645
+ },
22646
+ fullProps: {
22647
+ orderId: { type: 'string', required: true },
22648
+ items: { type: 'array', required: true },
22649
+ total: { type: 'number', required: true },
22650
+ tax: { type: 'number' }
22651
+ }
22652
+ });
22653
+
22654
+ Generate ONLY the TypeScript code without any markdown or explanations.`;
22655
+ const text2 = await generateTextWithPlaceholders(model, componentData, promptTemplate, {
22656
+ temperature: 0.1,
22657
+ maxOutputTokens: 4e3,
22658
+ abortSignal: AbortSignal.timeout(6e4)
22659
+ // 60 second timeout
22660
+ });
22661
+ writeFileSync3(outputPath, cleanGeneratedCode(text2));
22662
+ }
22663
+ async function generateEnvironmentFiles(environmentsDir, credentials, environment = "development") {
22664
+ const generateCredentialCode = (cred) => {
22665
+ const params = [
22666
+ `id: '${cred.id}'`,
22667
+ `type: '${cred.type}'`,
22668
+ `credentialStoreId: '${cred.credentialStoreId}'`
22669
+ ];
22670
+ if (cred.retrievalParams) {
22671
+ params.push(
22672
+ `retrievalParams: ${JSON.stringify(cred.retrievalParams, null, 4).replace(/\n/g, "\n ")}`
22673
+ );
22674
+ }
22675
+ return `credential({
22676
+ ${params.join(",\n ")}
22677
+ })`;
22678
+ };
22679
+ const hasCredentials = credentials && Object.keys(credentials).length > 0;
22680
+ let credentialsCode = "";
22681
+ let imports = "import { registerEnvironmentSettings } from '@inkeep/agents-sdk';";
22682
+ if (hasCredentials) {
22683
+ imports = "import { credential, registerEnvironmentSettings } from '@inkeep/agents-sdk';";
22684
+ const credentialEntries = [];
22685
+ for (const [credId, cred] of Object.entries(credentials)) {
22686
+ const varName = credId.replace(/-/g, "_").replace(/[^a-zA-Z0-9_]/g, "");
22687
+ credentialEntries.push(` ${varName}: ${generateCredentialCode(cred)}`);
22688
+ }
22689
+ credentialsCode = `
22690
+ ${credentialEntries.join(",\n")}
22691
+ `;
22692
+ } else {
22693
+ credentialsCode = "\n ";
22377
22694
  }
22695
+ const envContent = `${imports}
22696
+
22697
+ export const ${environment} = registerEnvironmentSettings({
22698
+ credentials: {${credentialsCode}}
22699
+ });
22700
+ `;
22701
+ writeFileSync3(join6(environmentsDir, `${environment}.env.ts`), envContent);
22702
+ await updateEnvironmentIndex(environmentsDir, environment);
22703
+ }
22704
+ async function updateEnvironmentIndex(environmentsDir, environment) {
22705
+ const indexPath = join6(environmentsDir, "index.ts");
22706
+ const { readFileSync: readFileSync4, existsSync: existsSync9 } = await import("fs");
22707
+ const existingEnvironments = [];
22708
+ let existingContent = "";
22709
+ if (existsSync9(indexPath)) {
22710
+ existingContent = readFileSync4(indexPath, "utf-8");
22711
+ const importRegex = /import\s+{\s*(\w+)\s*}\s+from\s+['"]\.\/([\w-]+)\.env['"];?/g;
22712
+ let match;
22713
+ while ((match = importRegex.exec(existingContent)) !== null) {
22714
+ const envName = match[2];
22715
+ if (!existingEnvironments.includes(envName)) {
22716
+ existingEnvironments.push(envName);
22717
+ }
22718
+ }
22719
+ }
22720
+ if (!existingEnvironments.includes(environment)) {
22721
+ existingEnvironments.push(environment);
22722
+ }
22723
+ existingEnvironments.sort();
22724
+ const importStatements = existingEnvironments.map((env3) => `import { ${env3} } from './${env3}.env';`).join("\n");
22725
+ const environmentObject = existingEnvironments.map((env3) => ` ${env3},`).join("\n");
22726
+ const exportStatement = existingEnvironments.join(", ");
22727
+ const indexContent = `import { createEnvironmentSettings } from '@inkeep/agents-sdk';
22728
+ ${importStatements}
22729
+
22730
+ export const envSettings = createEnvironmentSettings({
22731
+ ${environmentObject}
22732
+ });
22733
+
22734
+ // Export individual environments for direct access if needed
22735
+ export { ${exportStatement} };
22736
+ `;
22737
+ writeFileSync3(indexPath, indexContent);
22378
22738
  }
22379
22739
 
22380
22740
  // src/commands/pull.ts
22381
- async function loadProjectConfig(projectDir) {
22382
- const configPath = join7(projectDir, "inkeep.config.ts");
22383
- if (!existsSync7(configPath)) {
22741
+ async function verifyGeneratedFiles(projectDir, originalProjectData, debug = false, config) {
22742
+ const errors = [];
22743
+ const warnings = [];
22744
+ try {
22745
+ const indexPath = join7(projectDir, "index.ts");
22746
+ if (!existsSync6(indexPath)) {
22747
+ errors.push("Generated index.ts file not found");
22748
+ return { success: false, errors, warnings };
22749
+ }
22750
+ const module = await importWithTypeScriptSupport(indexPath);
22751
+ const exports = Object.keys(module);
22752
+ let project = null;
22753
+ for (const exportKey of exports) {
22754
+ const value = module[exportKey];
22755
+ if (value && typeof value === "object" && value.__type === "project") {
22756
+ project = value;
22757
+ break;
22758
+ }
22759
+ }
22760
+ if (!project) {
22761
+ errors.push("No project export found in generated index.ts");
22762
+ return { success: false, errors, warnings };
22763
+ }
22764
+ const structuralErrors = [];
22765
+ const structuralWarnings = [];
22766
+ try {
22767
+ if (!project) {
22768
+ structuralErrors.push("Project object not found after import");
22769
+ }
22770
+ if (project && typeof project === "object" && project.__type !== "project") {
22771
+ structuralWarnings.push("Project object missing type marker");
22772
+ }
22773
+ if (project && typeof project.toFullProjectDefinition === "function") {
22774
+ try {
22775
+ const generatedProjectData = await project.toFullProjectDefinition();
22776
+ if (debug) {
22777
+ console.log(chalk6.gray("\n\u{1F4CB} Generated project successfully"));
22778
+ console.log(chalk6.gray(` \u2022 Has tools: ${!!generatedProjectData.tools}`));
22779
+ console.log(chalk6.gray(` \u2022 Tools count: ${Object.keys(generatedProjectData.tools || {}).length}`));
22780
+ console.log(chalk6.gray(` \u2022 Has credentials: ${!!generatedProjectData.credentialReferences}`));
22781
+ console.log(chalk6.gray(` \u2022 Credentials count: ${Object.keys(generatedProjectData.credentialReferences || {}).length}`));
22782
+ }
22783
+ if (!generatedProjectData) {
22784
+ structuralErrors.push("Generated project definition is empty");
22785
+ }
22786
+ } catch (projectDefError) {
22787
+ if (debug) {
22788
+ console.log(chalk6.yellow(` Project definition generation warning: ${projectDefError.message}`));
22789
+ }
22790
+ structuralWarnings.push(`Project definition generation had issues: ${projectDefError.message}`);
22791
+ }
22792
+ }
22793
+ const toolPath = join7(projectDir, "tools", "inkeep_facts.ts");
22794
+ const envPath = join7(projectDir, "environments", "development.env.ts");
22795
+ if (existsSync6(toolPath)) {
22796
+ const toolContent = readFileSync2(toolPath, "utf8");
22797
+ if (!toolContent.includes("credential:")) {
22798
+ structuralWarnings.push("Tool file may be missing credential reference");
22799
+ }
22800
+ if (!toolContent.includes("serverUrl:")) {
22801
+ structuralErrors.push("Tool file missing required serverUrl property");
22802
+ }
22803
+ if (toolContent.includes("config:")) {
22804
+ structuralWarnings.push("Tool file contains invalid config property (should use individual properties)");
22805
+ }
22806
+ if (debug) {
22807
+ console.log(chalk6.gray(` \u2022 Tool file has serverUrl: ${toolContent.includes("serverUrl:")}`));
22808
+ console.log(chalk6.gray(` \u2022 Tool file has credential: ${toolContent.includes("credential:")}`));
22809
+ console.log(chalk6.gray(` \u2022 Tool file has invalid config: ${toolContent.includes("config:")}`));
22810
+ }
22811
+ } else {
22812
+ structuralErrors.push("Tool file inkeep_facts.ts not found");
22813
+ }
22814
+ if (existsSync6(envPath)) {
22815
+ const envContent = readFileSync2(envPath, "utf8");
22816
+ if (!envContent.includes("inkeep_api_credential")) {
22817
+ structuralWarnings.push("Environment file may be missing credential definition");
22818
+ }
22819
+ if (debug) {
22820
+ console.log(chalk6.gray(` \u2022 Environment file has credential: ${envContent.includes("inkeep_api_credential")}`));
22821
+ }
22822
+ } else {
22823
+ structuralErrors.push("Environment file development.env.ts not found");
22824
+ }
22825
+ } catch (structuralError) {
22826
+ structuralErrors.push(`Structural validation failed: ${structuralError.message}`);
22827
+ }
22828
+ errors.push(...structuralErrors);
22829
+ warnings.push(...structuralWarnings);
22830
+ if (debug) {
22831
+ console.log(chalk6.gray("\n\u{1F50D} Structural Verification Summary:"));
22832
+ console.log(chalk6.gray(` \u2022 Project loaded successfully: ${!!project}`));
22833
+ console.log(chalk6.gray(` \u2022 Expected graphs: ${Object.keys(originalProjectData.graphs || {}).length}`));
22834
+ console.log(chalk6.gray(` \u2022 Expected tools: ${Object.keys(originalProjectData.tools || {}).length}`));
22835
+ console.log(chalk6.gray(` \u2022 Expected credentials: ${Object.keys(originalProjectData.credentialReferences || {}).length}`));
22836
+ }
22837
+ return { success: errors.length === 0, errors, warnings };
22838
+ } catch (error) {
22839
+ errors.push(`Verification failed: ${error.message}`);
22840
+ return { success: false, errors, warnings };
22841
+ }
22842
+ }
22843
+ async function loadProjectConfig(projectDir, configPathOverride) {
22844
+ const configPath = configPathOverride ? resolve4(process.cwd(), configPathOverride) : join7(projectDir, "inkeep.config.ts");
22845
+ if (!existsSync6(configPath)) {
22384
22846
  throw new Error(`Configuration file not found: ${configPath}`);
22385
22847
  }
22386
22848
  try {
@@ -22389,10 +22851,13 @@ async function loadProjectConfig(projectDir) {
22389
22851
  if (!config) {
22390
22852
  throw new Error("No configuration found in inkeep.config.ts");
22391
22853
  }
22854
+ if (!config.tenantId) {
22855
+ throw new Error("tenantId is required in inkeep.config.ts");
22856
+ }
22392
22857
  return {
22393
- tenantId: config.tenantId || "default",
22394
- projectId: config.projectId || "default",
22395
- agentsManageApiUrl: config.agentsManageApiUrl || "http://localhost:3002"
22858
+ tenantId: config.tenantId,
22859
+ agentsManageApiUrl: config.agentsManageApiUrl || "http://localhost:3002",
22860
+ outputDirectory: config.outputDirectory
22396
22861
  };
22397
22862
  } catch (error) {
22398
22863
  throw new Error(`Failed to load configuration: ${error.message}`);
@@ -22414,61 +22879,129 @@ async function fetchProjectData(tenantId, projectId, apiUrl) {
22414
22879
  const responseData = await response.json();
22415
22880
  return responseData.data;
22416
22881
  }
22417
- function findProjectFiles(projectDir) {
22418
- const allTsFiles = findAllTypeScriptFiles(projectDir, ["environments", "node_modules"]);
22419
- const categorized = categorizeTypeScriptFiles(allTsFiles, projectDir);
22882
+ function ensureDirectoryExists(dirPath) {
22883
+ if (!existsSync6(dirPath)) {
22884
+ mkdirSync(dirPath, { recursive: true });
22885
+ }
22886
+ }
22887
+ function createProjectStructure(projectDir, projectId) {
22888
+ const dirName = projectDir.split("/").pop() || projectDir;
22889
+ const projectRoot = dirName === projectId ? projectDir : join7(projectDir, projectId);
22890
+ const graphsDir = join7(projectRoot, "graphs");
22891
+ const toolsDir = join7(projectRoot, "tools");
22892
+ const dataComponentsDir = join7(projectRoot, "data-components");
22893
+ const artifactComponentsDir = join7(projectRoot, "artifact-components");
22894
+ const environmentsDir = join7(projectRoot, "environments");
22895
+ ensureDirectoryExists(projectRoot);
22896
+ ensureDirectoryExists(graphsDir);
22897
+ ensureDirectoryExists(toolsDir);
22898
+ ensureDirectoryExists(dataComponentsDir);
22899
+ ensureDirectoryExists(artifactComponentsDir);
22900
+ ensureDirectoryExists(environmentsDir);
22420
22901
  return {
22421
- indexFile: categorized.indexFile,
22422
- graphFiles: categorized.graphFiles,
22423
- agentFiles: categorized.agentFiles,
22424
- toolFiles: categorized.toolFiles,
22425
- otherFiles: categorized.otherFiles
22902
+ projectRoot,
22903
+ graphsDir,
22904
+ toolsDir,
22905
+ dataComponentsDir,
22906
+ artifactComponentsDir,
22907
+ environmentsDir
22426
22908
  };
22427
22909
  }
22428
- async function updateProjectFilesWithLLM(projectDir, projectData, modelSettings) {
22429
- const { graphs, tools: tools2 } = projectData;
22430
- const { indexFile, graphFiles, agentFiles, toolFiles, otherFiles } = findProjectFiles(projectDir);
22431
- if (indexFile && existsSync7(indexFile)) {
22432
- console.log(chalk6.gray(" \u2022 Updating index.ts..."));
22433
- await generateTypeScriptFileWithLLM(projectData, "project", indexFile, modelSettings);
22434
- }
22435
- for (const graphFilePath of graphFiles) {
22436
- const fileName = graphFilePath.split("/").pop()?.replace(".ts", "").replace(".graph", "");
22437
- if (fileName && graphs[fileName]) {
22438
- console.log(chalk6.gray(` \u2022 Updating graph: ${fileName}`));
22439
- await generateTypeScriptFileWithLLM(graphs[fileName], fileName, graphFilePath, modelSettings);
22440
- }
22441
- }
22442
- for (const agentFilePath of agentFiles) {
22443
- const fileName = agentFilePath.split("/").pop()?.replace(".ts", "");
22444
- if (fileName) {
22445
- let agentData = null;
22446
- for (const graph of Object.values(graphs)) {
22447
- const graphData = graph;
22448
- if (graphData.agents?.[fileName]) {
22449
- agentData = graphData.agents[fileName];
22450
- break;
22451
- }
22452
- }
22453
- if (agentData) {
22454
- console.log(chalk6.gray(` \u2022 Updating agent: ${fileName}`));
22455
- await generateTypeScriptFileWithLLM(agentData, fileName, agentFilePath, modelSettings);
22910
+ async function generateProjectFiles(dirs, projectData, modelSettings, environment = "development", debug = false) {
22911
+ const { graphs, tools: tools2, dataComponents: dataComponents2, artifactComponents: artifactComponents2, credentialReferences: credentialReferences2 } = projectData;
22912
+ const generationTasks = [];
22913
+ const fileInfo = [];
22914
+ const indexPath = join7(dirs.projectRoot, "index.ts");
22915
+ generationTasks.push(generateIndexFile(projectData, indexPath, modelSettings));
22916
+ fileInfo.push({ type: "config", name: "index.ts" });
22917
+ if (graphs && Object.keys(graphs).length > 0) {
22918
+ for (const [graphId, graphData] of Object.entries(graphs)) {
22919
+ const graphPath = join7(dirs.graphsDir, `${graphId}.ts`);
22920
+ generationTasks.push(generateGraphFile(graphData, graphId, graphPath, modelSettings));
22921
+ fileInfo.push({ type: "graph", name: `${graphId}.ts` });
22922
+ }
22923
+ }
22924
+ if (tools2 && Object.keys(tools2).length > 0) {
22925
+ for (const [toolId, toolData] of Object.entries(tools2)) {
22926
+ const toolPath = join7(dirs.toolsDir, `${toolId}.ts`);
22927
+ generationTasks.push(generateToolFile(toolData, toolId, toolPath, modelSettings));
22928
+ fileInfo.push({ type: "tool", name: `${toolId}.ts` });
22929
+ }
22930
+ }
22931
+ if (dataComponents2 && Object.keys(dataComponents2).length > 0) {
22932
+ for (const [componentId, componentData] of Object.entries(dataComponents2)) {
22933
+ const componentPath = join7(dirs.dataComponentsDir, `${componentId}.ts`);
22934
+ generationTasks.push(generateDataComponentFile(componentData, componentId, componentPath, modelSettings));
22935
+ fileInfo.push({ type: "dataComponent", name: `${componentId}.ts` });
22936
+ }
22937
+ }
22938
+ if (artifactComponents2 && Object.keys(artifactComponents2).length > 0) {
22939
+ for (const [componentId, componentData] of Object.entries(artifactComponents2)) {
22940
+ const componentPath = join7(dirs.artifactComponentsDir, `${componentId}.ts`);
22941
+ generationTasks.push(generateArtifactComponentFile(componentData, componentId, componentPath, modelSettings));
22942
+ fileInfo.push({ type: "artifactComponent", name: `${componentId}.ts` });
22943
+ }
22944
+ }
22945
+ const targetEnvironment = environment;
22946
+ generationTasks.push(generateEnvironmentFiles(dirs.environmentsDir, credentialReferences2, targetEnvironment));
22947
+ fileInfo.push({ type: "env", name: `index.ts, ${targetEnvironment}.env.ts` });
22948
+ console.log(chalk6.cyan(" \u{1F4DD} Generating files in parallel:"));
22949
+ const filesByType = fileInfo.reduce((acc, file) => {
22950
+ if (!acc[file.type]) acc[file.type] = [];
22951
+ acc[file.type].push(file.name);
22952
+ return acc;
22953
+ }, {});
22954
+ if (filesByType.config) {
22955
+ console.log(chalk6.gray(` \u2022 Config files: ${filesByType.config.join(", ")}`));
22956
+ }
22957
+ if (filesByType.graph) {
22958
+ console.log(chalk6.gray(` \u2022 Graphs: ${filesByType.graph.join(", ")}`));
22959
+ }
22960
+ if (filesByType.tool) {
22961
+ console.log(chalk6.gray(` \u2022 Tools: ${filesByType.tool.join(", ")}`));
22962
+ }
22963
+ if (filesByType.dataComponent) {
22964
+ console.log(chalk6.gray(` \u2022 Data components: ${filesByType.dataComponent.join(", ")}`));
22965
+ }
22966
+ if (filesByType.artifactComponent) {
22967
+ console.log(chalk6.gray(` \u2022 Artifact components: ${filesByType.artifactComponent.join(", ")}`));
22968
+ }
22969
+ if (filesByType.env) {
22970
+ console.log(chalk6.gray(` \u2022 Environment: ${filesByType.env.join(", ")}`));
22971
+ }
22972
+ console.log(chalk6.yellow(` \u26A1 Processing ${generationTasks.length} files in parallel...`));
22973
+ if (debug) {
22974
+ console.log(chalk6.gray("\n\u{1F4CD} Debug: Starting LLM file generation..."));
22975
+ console.log(chalk6.gray(` Model: ${modelSettings.model}`));
22976
+ console.log(chalk6.gray(` Total tasks: ${generationTasks.length}`));
22977
+ const startTime = Date.now();
22978
+ try {
22979
+ await Promise.all(
22980
+ generationTasks.map(async (task, index2) => {
22981
+ const taskStartTime = Date.now();
22982
+ if (debug) {
22983
+ const taskInfo = fileInfo[index2];
22984
+ console.log(chalk6.gray(` [${index2 + 1}/${generationTasks.length}] Starting ${taskInfo.type}: ${taskInfo.name}`));
22985
+ }
22986
+ await task;
22987
+ if (debug) {
22988
+ const taskInfo = fileInfo[index2];
22989
+ const taskDuration = Date.now() - taskStartTime;
22990
+ console.log(chalk6.gray(` [${index2 + 1}/${generationTasks.length}] \u2713 Completed ${taskInfo.type}: ${taskInfo.name} (${taskDuration}ms)`));
22991
+ }
22992
+ })
22993
+ );
22994
+ } catch (error) {
22995
+ if (debug) {
22996
+ console.error(chalk6.red("\u{1F4CD} Debug: LLM generation error:"), error);
22456
22997
  }
22998
+ throw error;
22457
22999
  }
22458
- }
22459
- for (const toolFilePath of toolFiles) {
22460
- const fileName = toolFilePath.split("/").pop()?.replace(".ts", "");
22461
- if (fileName && tools2[fileName]) {
22462
- console.log(chalk6.gray(` \u2022 Updating tool: ${fileName}`));
22463
- await generateTypeScriptFileWithLLM(tools2[fileName], fileName, toolFilePath, modelSettings);
22464
- }
22465
- }
22466
- for (const otherFilePath of otherFiles) {
22467
- const fileName = otherFilePath.split("/").pop()?.replace(".ts", "");
22468
- if (fileName) {
22469
- console.log(chalk6.gray(` \u2022 Updating file: ${fileName}.ts`));
22470
- await generateTypeScriptFileWithLLM(projectData, fileName, otherFilePath, modelSettings);
22471
- }
23000
+ const totalDuration = Date.now() - startTime;
23001
+ console.log(chalk6.gray(`
23002
+ \u{1F4CD} Debug: LLM generation completed in ${totalDuration}ms`));
23003
+ } else {
23004
+ await Promise.all(generationTasks);
22472
23005
  }
22473
23006
  }
22474
23007
  async function pullProjectCommand(options) {
@@ -22481,27 +23014,118 @@ async function pullProjectCommand(options) {
22481
23014
  console.error(chalk6.gray(" or add it to your .env file"));
22482
23015
  process.exit(1);
22483
23016
  }
22484
- const spinner = ora4("Finding project...").start();
23017
+ const spinner = ora4("Loading configuration...").start();
22485
23018
  try {
22486
- const projectDir = await findProjectDirectory(options.project);
22487
- if (!projectDir) {
22488
- spinner.fail("Project not found");
22489
- console.error(chalk6.red("Error: No project found."));
22490
- console.error(
22491
- chalk6.gray(
22492
- "Either run this command from within a project directory or specify --project <project-id>"
22493
- )
22494
- );
23019
+ let config = null;
23020
+ let configFound = false;
23021
+ let configLocation = "";
23022
+ const searchDir = process.cwd();
23023
+ if (options.config) {
23024
+ const configPath = resolve4(process.cwd(), options.config);
23025
+ if (existsSync6(configPath)) {
23026
+ try {
23027
+ config = await loadProjectConfig(dirname4(configPath), options.config);
23028
+ configFound = true;
23029
+ configLocation = configPath;
23030
+ } catch (error) {
23031
+ spinner.fail("Failed to load specified configuration file");
23032
+ console.error(chalk6.red(`Error: ${error instanceof Error ? error.message : String(error)}`));
23033
+ process.exit(1);
23034
+ }
23035
+ } else {
23036
+ spinner.fail(`Specified configuration file not found: ${configPath}`);
23037
+ process.exit(1);
23038
+ }
23039
+ }
23040
+ if (!configFound) {
23041
+ const currentConfigPath = join7(searchDir, "inkeep.config.ts");
23042
+ if (existsSync6(currentConfigPath)) {
23043
+ try {
23044
+ config = await loadProjectConfig(searchDir);
23045
+ configFound = true;
23046
+ configLocation = currentConfigPath;
23047
+ } catch (_error) {
23048
+ spinner.warn("Failed to load configuration from current directory");
23049
+ }
23050
+ }
23051
+ if (!configFound) {
23052
+ const parentConfigPath = join7(searchDir, "..", "inkeep.config.ts");
23053
+ if (existsSync6(parentConfigPath)) {
23054
+ try {
23055
+ config = await loadProjectConfig(join7(searchDir, ".."));
23056
+ configFound = true;
23057
+ configLocation = parentConfigPath;
23058
+ } catch (_error) {
23059
+ spinner.warn("Failed to load configuration from parent directory");
23060
+ }
23061
+ }
23062
+ }
23063
+ if (!configFound) {
23064
+ const { findUp: findUp2 } = await import("find-up");
23065
+ const foundConfigPath = await findUp2("inkeep.config.ts", { cwd: searchDir });
23066
+ if (foundConfigPath) {
23067
+ try {
23068
+ config = await loadProjectConfig(dirname4(foundConfigPath));
23069
+ configFound = true;
23070
+ configLocation = foundConfigPath;
23071
+ } catch (_error) {
23072
+ spinner.warn("Failed to load configuration from found path");
23073
+ }
23074
+ }
23075
+ }
23076
+ }
23077
+ if (!configFound || !config) {
23078
+ spinner.fail("No inkeep.config.ts found");
23079
+ console.error(chalk6.red("Configuration file is required for pull command"));
23080
+ console.log(chalk6.yellow("Please create an inkeep.config.ts file with your tenantId and API settings"));
23081
+ console.log(chalk6.gray("Searched in:"));
23082
+ console.log(chalk6.gray(` \u2022 Current directory: ${searchDir}`));
23083
+ console.log(chalk6.gray(` \u2022 Parent directory: ${join7(searchDir, "..")}`));
23084
+ console.log(chalk6.gray(` \u2022 Parent directories up to root`));
22495
23085
  process.exit(1);
22496
23086
  }
22497
- spinner.succeed(`Project found: ${projectDir}`);
22498
- spinner.start("Loading configuration...");
22499
- const config = await loadProjectConfig(projectDir);
23087
+ spinner.succeed(`Configuration loaded from ${configLocation}`);
23088
+ spinner.start("Determining output directory...");
23089
+ let baseDir;
23090
+ if (options.project) {
23091
+ baseDir = options.project;
23092
+ } else if (config.outputDirectory && config.outputDirectory !== "default") {
23093
+ baseDir = resolve4(process.cwd(), config.outputDirectory);
23094
+ } else {
23095
+ const projectRoot = await findProjectDirectory();
23096
+ if (projectRoot) {
23097
+ const srcPath = join7(projectRoot, "src");
23098
+ baseDir = existsSync6(srcPath) ? srcPath : projectRoot;
23099
+ } else {
23100
+ baseDir = process.cwd();
23101
+ }
23102
+ }
23103
+ spinner.succeed(`Output directory: ${baseDir}`);
22500
23104
  const finalConfig = {
22501
- tenantId: options.agentsManageApiUrl ? options.env || config.tenantId : config.tenantId,
22502
- projectId: config.projectId,
23105
+ tenantId: config.tenantId,
23106
+ // Tenant ID comes from config, not env flag
23107
+ projectId: "",
23108
+ // Will be determined from API response or user input
22503
23109
  agentsManageApiUrl: options.agentsManageApiUrl || config.agentsManageApiUrl
22504
23110
  };
23111
+ if (!options.project) {
23112
+ spinner.stop();
23113
+ const response = await prompts({
23114
+ type: "text",
23115
+ name: "projectId",
23116
+ message: "Enter the project ID to pull:",
23117
+ validate: (value) => value ? true : "Project ID is required"
23118
+ });
23119
+ if (!response.projectId) {
23120
+ console.error(chalk6.red("Project ID is required"));
23121
+ process.exit(1);
23122
+ }
23123
+ finalConfig.projectId = response.projectId;
23124
+ spinner.start("Configuration loaded");
23125
+ } else {
23126
+ const projectIdFromPath = options.project.split("/").pop() || options.project;
23127
+ finalConfig.projectId = projectIdFromPath;
23128
+ }
22505
23129
  spinner.succeed("Configuration loaded");
22506
23130
  console.log(chalk6.gray("Configuration:"));
22507
23131
  console.log(chalk6.gray(` \u2022 Tenant ID: ${finalConfig.tenantId}`));
@@ -22522,34 +23146,118 @@ async function pullProjectCommand(options) {
22522
23146
  },
22523
23147
  0
22524
23148
  );
23149
+ const dataComponentCount = Object.keys(projectData.dataComponents || {}).length;
23150
+ const artifactComponentCount = Object.keys(projectData.artifactComponents || {}).length;
22525
23151
  console.log(chalk6.cyan("\n\u{1F4CA} Project Summary:"));
22526
23152
  console.log(chalk6.gray(` \u2022 Name: ${projectData.name}`));
22527
23153
  console.log(chalk6.gray(` \u2022 Description: ${projectData.description || "No description"}`));
22528
23154
  console.log(chalk6.gray(` \u2022 Graphs: ${graphCount}`));
22529
23155
  console.log(chalk6.gray(` \u2022 Tools: ${toolCount}`));
22530
23156
  console.log(chalk6.gray(` \u2022 Agents: ${agentCount}`));
23157
+ if (dataComponentCount > 0) {
23158
+ console.log(chalk6.gray(` \u2022 Data Components: ${dataComponentCount}`));
23159
+ }
23160
+ if (artifactComponentCount > 0) {
23161
+ console.log(chalk6.gray(` \u2022 Artifact Components: ${artifactComponentCount}`));
23162
+ }
23163
+ const credentialReferences2 = projectData.credentialReferences || {};
23164
+ const credentialCount = Object.keys(credentialReferences2).length;
23165
+ if (credentialCount > 0) {
23166
+ console.log(chalk6.cyan("\n\u{1F510} Credentials Found:"));
23167
+ console.log(chalk6.gray(` \u2022 Total credentials: ${credentialCount}`));
23168
+ for (const [credId, credData] of Object.entries(credentialReferences2)) {
23169
+ const credType = credData.type || "unknown";
23170
+ const storeId = credData.credentialStoreId || "unknown";
23171
+ console.log(chalk6.gray(` \u2022 ${credId} (${credType}, store: ${storeId})`));
23172
+ const usageInfo = credData.usedBy;
23173
+ if (usageInfo && Array.isArray(usageInfo) && usageInfo.length > 0) {
23174
+ const usageByType = {};
23175
+ for (const usage of usageInfo) {
23176
+ usageByType[usage.type] = (usageByType[usage.type] || 0) + 1;
23177
+ }
23178
+ const usageSummary = Object.entries(usageByType).map(([type, count15]) => `${count15} ${type}${count15 > 1 ? "s" : ""}`).join(", ");
23179
+ console.log(chalk6.gray(` Used by: ${usageSummary}`));
23180
+ }
23181
+ }
23182
+ console.log(chalk6.yellow(` \u26A0\uFE0F Environment file (${options.env || "development"}.env.ts) will be generated with credential references`));
23183
+ }
23184
+ spinner.start("Creating project structure...");
23185
+ const dirs = createProjectStructure(baseDir, finalConfig.projectId);
23186
+ spinner.succeed("Project structure created");
22531
23187
  if (options.json) {
22532
- const jsonFilePath = join7(projectDir, `${finalConfig.projectId}.json`);
22533
- writeFileSync3(jsonFilePath, JSON.stringify(projectData, null, 2));
23188
+ const jsonFilePath = join7(dirs.projectRoot, `${finalConfig.projectId}.json`);
23189
+ writeFileSync4(jsonFilePath, JSON.stringify(projectData, null, 2));
22534
23190
  spinner.succeed(`Project data saved to ${jsonFilePath}`);
22535
23191
  console.log(chalk6.green(`\u2705 JSON file created: ${jsonFilePath}`));
22536
- } else {
22537
- spinner.start("Updating project files with LLM...");
22538
- const modelSettings = {
22539
- model: "anthropic/claude-sonnet-4-20250514"
22540
- };
22541
- const { indexFile, graphFiles, agentFiles, toolFiles, otherFiles } = findProjectFiles(projectDir);
22542
- const totalFiles = [indexFile].filter(Boolean).length + graphFiles.length + agentFiles.length + toolFiles.length + otherFiles.length;
22543
- await updateProjectFilesWithLLM(projectDir, projectData, modelSettings);
22544
- spinner.succeed(`Project files updated (${totalFiles} files processed)`);
22545
- console.log(chalk6.green("\n\u2728 Project pulled successfully!"));
22546
- console.log(chalk6.cyan("\n\u{1F4DD} Next steps:"));
22547
- console.log(chalk6.gray(" \u2022 Review the updated files"));
22548
- console.log(chalk6.gray(" \u2022 Test locally: npx inkeep push"));
22549
- console.log(
22550
- chalk6.gray(' \u2022 Commit changes: git add . && git commit -m "Pull project updates"')
22551
- );
22552
23192
  }
23193
+ spinner.start("Generating project files with LLM...");
23194
+ const modelSettings = {
23195
+ model: "anthropic/claude-sonnet-4-20250514"
23196
+ };
23197
+ await generateProjectFiles(dirs, projectData, modelSettings, options.env || "development", options.debug || false);
23198
+ const fileCount = {
23199
+ graphs: Object.keys(projectData.graphs || {}).length,
23200
+ tools: Object.keys(projectData.tools || {}).length,
23201
+ dataComponents: Object.keys(projectData.dataComponents || {}).length,
23202
+ artifactComponents: Object.keys(projectData.artifactComponents || {}).length
23203
+ };
23204
+ const totalFiles = fileCount.graphs + fileCount.tools + fileCount.dataComponents + fileCount.artifactComponents + 5;
23205
+ spinner.succeed(`Project files generated (${totalFiles} files created)`);
23206
+ spinner.start("Verifying generated files...");
23207
+ try {
23208
+ const verificationResult = await verifyGeneratedFiles(dirs.projectRoot, projectData, options.debug || false, config);
23209
+ if (verificationResult.success) {
23210
+ spinner.succeed("Generated files verified successfully");
23211
+ if (options.debug && verificationResult.warnings.length > 0) {
23212
+ console.log(chalk6.yellow("\n\u26A0\uFE0F Verification warnings:"));
23213
+ verificationResult.warnings.forEach((warning) => {
23214
+ console.log(chalk6.gray(` \u2022 ${warning}`));
23215
+ });
23216
+ }
23217
+ } else {
23218
+ spinner.fail("Generated files verification failed");
23219
+ console.error(chalk6.red("\n\u274C Verification errors:"));
23220
+ verificationResult.errors.forEach((error) => {
23221
+ console.error(chalk6.red(` \u2022 ${error}`));
23222
+ });
23223
+ if (verificationResult.warnings.length > 0) {
23224
+ console.log(chalk6.yellow("\n\u26A0\uFE0F Verification warnings:"));
23225
+ verificationResult.warnings.forEach((warning) => {
23226
+ console.log(chalk6.gray(` \u2022 ${warning}`));
23227
+ });
23228
+ }
23229
+ console.log(chalk6.gray("\nThe generated files may not accurately represent the pulled project."));
23230
+ console.log(chalk6.gray("This could indicate an issue with the LLM generation or schema mappings."));
23231
+ }
23232
+ } catch (error) {
23233
+ spinner.fail("Verification failed");
23234
+ console.error(chalk6.red("Verification error:"), error.message);
23235
+ console.log(chalk6.gray("Proceeding without verification..."));
23236
+ }
23237
+ console.log(chalk6.green("\n\u2728 Project pulled successfully!"));
23238
+ console.log(chalk6.cyan("\n\u{1F4C1} Generated structure:"));
23239
+ console.log(chalk6.gray(` ${dirs.projectRoot}/`));
23240
+ console.log(chalk6.gray(` \u251C\u2500\u2500 index.ts`));
23241
+ if (fileCount.graphs > 0) {
23242
+ console.log(chalk6.gray(` \u251C\u2500\u2500 graphs/ (${fileCount.graphs} files)`));
23243
+ }
23244
+ if (fileCount.tools > 0) {
23245
+ console.log(chalk6.gray(` \u251C\u2500\u2500 tools/ (${fileCount.tools} files)`));
23246
+ }
23247
+ if (fileCount.dataComponents > 0) {
23248
+ console.log(chalk6.gray(` \u251C\u2500\u2500 data-components/ (${fileCount.dataComponents} files)`));
23249
+ }
23250
+ if (fileCount.artifactComponents > 0) {
23251
+ console.log(chalk6.gray(` \u251C\u2500\u2500 artifact-components/ (${fileCount.artifactComponents} files)`));
23252
+ }
23253
+ console.log(chalk6.gray(" \u2514\u2500\u2500 environments/ (4 files)"));
23254
+ console.log(chalk6.cyan("\n\u{1F4DD} Next steps:"));
23255
+ console.log(chalk6.gray(` \u2022 cd ${dirs.projectRoot}`));
23256
+ console.log(chalk6.gray(" \u2022 Review the generated files"));
23257
+ console.log(chalk6.gray(" \u2022 Test locally: inkeep push"));
23258
+ console.log(
23259
+ chalk6.gray(' \u2022 Commit changes: git add . && git commit -m "Add project from pull"')
23260
+ );
22553
23261
  } catch (error) {
22554
23262
  spinner.fail("Failed to pull project");
22555
23263
  console.error(chalk6.red("Error:"), error.message);
@@ -22560,20 +23268,21 @@ async function pullProjectCommand(options) {
22560
23268
  // src/commands/push.ts
22561
23269
  init_esm_shims();
22562
23270
  init_env2();
22563
- import { existsSync as existsSync9 } from "fs";
22564
- import { join as join9 } from "path";
23271
+ init_config();
23272
+ import { existsSync as existsSync8 } from "fs";
23273
+ import { join as join9, resolve as resolve5 } from "path";
22565
23274
  import chalk7 from "chalk";
22566
23275
  import ora5 from "ora";
22567
23276
 
22568
23277
  // src/utils/environment-loader.ts
22569
23278
  init_esm_shims();
22570
23279
  init_tsx_loader();
22571
- import { existsSync as existsSync8 } from "fs";
23280
+ import { existsSync as existsSync7 } from "fs";
22572
23281
  import { join as join8 } from "path";
22573
23282
  async function loadEnvironmentCredentials(projectDir, env3) {
22574
23283
  const environmentsDir = join8(projectDir, "environments");
22575
23284
  const envFilePath = join8(environmentsDir, `${env3}.env.ts`);
22576
- if (!existsSync8(envFilePath)) {
23285
+ if (!existsSync7(envFilePath)) {
22577
23286
  throw new Error(
22578
23287
  `Environment file not found: ${envFilePath}
22579
23288
  Make sure you have a ${env3}.env.ts file in the environments directory.`
@@ -22602,7 +23311,7 @@ Make sure you have a ${env3}.env.ts file in the environments directory.`
22602
23311
  init_tsx_loader();
22603
23312
  async function loadProject(projectDir) {
22604
23313
  const indexPath = join9(projectDir, "index.ts");
22605
- if (!existsSync9(indexPath)) {
23314
+ if (!existsSync8(indexPath)) {
22606
23315
  throw new Error(`index.ts not found in project directory: ${projectDir}`);
22607
23316
  }
22608
23317
  const module = await importWithTypeScriptSupport(indexPath);
@@ -22618,58 +23327,69 @@ async function loadProject(projectDir) {
22618
23327
  );
22619
23328
  }
22620
23329
  async function pushCommand(options) {
22621
- const spinner = ora5("Detecting project...").start();
23330
+ const spinner = ora5("Loading configuration...").start();
22622
23331
  try {
22623
- const projectDir = await findProjectDirectory(options.project);
22624
- if (!projectDir) {
22625
- spinner.fail("Project not found");
22626
- if (options.project) {
22627
- console.error(chalk7.red(`Project directory not found: ${options.project}`));
22628
- console.error(
22629
- chalk7.yellow("Make sure the project directory contains an inkeep.config.ts file")
22630
- );
23332
+ const config = await validateConfiguration(
23333
+ options.tenantId,
23334
+ options.agentsManageApiUrl,
23335
+ options.agentsRunApiUrl,
23336
+ options.config
23337
+ );
23338
+ spinner.succeed("Configuration loaded");
23339
+ console.log(chalk7.gray("Configuration sources:"));
23340
+ console.log(chalk7.gray(` \u2022 Tenant ID: ${config.tenantId}`));
23341
+ console.log(chalk7.gray(` \u2022 Manage API URL: ${config.agentsManageApiUrl}`));
23342
+ console.log(chalk7.gray(` \u2022 Run API URL: ${config.agentsRunApiUrl}`));
23343
+ if (config.sources.configFile) {
23344
+ console.log(chalk7.gray(` \u2022 Config file: ${config.sources.configFile}`));
23345
+ }
23346
+ spinner.start("Detecting project...");
23347
+ let projectDir;
23348
+ if (options.project) {
23349
+ projectDir = resolve5(process.cwd(), options.project);
23350
+ if (!existsSync8(join9(projectDir, "index.ts"))) {
23351
+ spinner.fail(`No index.ts found in specified project directory: ${projectDir}`);
23352
+ process.exit(1);
23353
+ }
23354
+ } else {
23355
+ const currentDir = process.cwd();
23356
+ if (existsSync8(join9(currentDir, "index.ts"))) {
23357
+ projectDir = currentDir;
22631
23358
  } else {
22632
- console.error(chalk7.red("No project found in current directory or parent directories"));
23359
+ spinner.fail("No index.ts found in current directory");
22633
23360
  console.error(
22634
- chalk7.yellow(
22635
- "Either run this command from within a project directory or use --project <project-id>"
22636
- )
23361
+ chalk7.yellow("Please run this command from a directory containing index.ts or use --project <path>")
22637
23362
  );
23363
+ process.exit(1);
22638
23364
  }
22639
- process.exit(1);
22640
23365
  }
22641
23366
  spinner.succeed(`Project found: ${projectDir}`);
22642
23367
  if (options.env) {
22643
23368
  process.env.INKEEP_ENV = options.env;
22644
23369
  spinner.text = `Setting environment to '${options.env}'...`;
22645
23370
  }
23371
+ const originalTenantId = process.env.INKEEP_TENANT_ID;
23372
+ const originalApiUrl = process.env.INKEEP_API_URL;
23373
+ process.env.INKEEP_TENANT_ID = config.tenantId;
23374
+ process.env.INKEEP_API_URL = config.agentsManageApiUrl;
22646
23375
  spinner.text = "Loading project from index.ts...";
22647
23376
  const project = await loadProject(projectDir);
22648
- spinner.succeed("Project loaded successfully");
22649
- spinner.text = "Loading configuration...";
22650
- const configPath = join9(projectDir, "inkeep.config.ts");
22651
- const configModule = await importWithTypeScriptSupport(configPath);
22652
- const config = configModule.default;
22653
- if (!config) {
22654
- throw new Error("No default export found in inkeep.config.ts");
23377
+ if (originalTenantId !== void 0) {
23378
+ process.env.INKEEP_TENANT_ID = originalTenantId;
23379
+ } else {
23380
+ delete process.env.INKEEP_TENANT_ID;
22655
23381
  }
22656
- const finalConfig = {
22657
- ...config,
22658
- agentsManageApiUrl: options.agentsManageApiUrl || config.agentsManageApiUrl
22659
- };
22660
- if (!finalConfig.tenantId || !finalConfig.projectId || !finalConfig.agentsManageApiUrl) {
22661
- throw new Error("Missing required configuration: tenantId, projectId, or agentsManageApiUrl");
23382
+ if (originalApiUrl !== void 0) {
23383
+ process.env.INKEEP_API_URL = originalApiUrl;
23384
+ } else {
23385
+ delete process.env.INKEEP_API_URL;
22662
23386
  }
22663
- spinner.succeed("Configuration loaded");
22664
- console.log(chalk7.gray("Configuration sources:"));
22665
- console.log(chalk7.gray(` \u2022 Tenant ID: ${finalConfig.tenantId}`));
22666
- console.log(chalk7.gray(` \u2022 Project ID: ${finalConfig.projectId}`));
22667
- console.log(chalk7.gray(` \u2022 API URL: ${finalConfig.agentsManageApiUrl}`));
23387
+ spinner.succeed("Project loaded successfully");
22668
23388
  if (typeof project.setConfig === "function") {
22669
23389
  project.setConfig(
22670
- finalConfig.tenantId,
22671
- finalConfig.agentsManageApiUrl,
22672
- finalConfig.modelSettings
23390
+ config.tenantId,
23391
+ config.agentsManageApiUrl
23392
+ // Note: models should be passed here if needed, not agentsRunApiUrl
22673
23393
  );
22674
23394
  }
22675
23395
  if (options.env && typeof project.setCredentials === "function") {
@@ -22690,7 +23410,7 @@ async function pushCommand(options) {
22690
23410
  spinner.text = "Generating project data JSON...";
22691
23411
  try {
22692
23412
  const projectDefinition = await project.toFullProjectDefinition();
22693
- const jsonFilePath = join9(projectDir, `${finalConfig.projectId}.json`);
23413
+ const jsonFilePath = join9(projectDir, `project.json`);
22694
23414
  const fs5 = await import("fs/promises");
22695
23415
  await fs5.writeFile(jsonFilePath, JSON.stringify(projectDefinition, null, 2));
22696
23416
  spinner.succeed(`Project data saved to ${jsonFilePath}`);
@@ -22739,6 +23459,32 @@ async function pushCommand(options) {
22739
23459
  );
22740
23460
  }
22741
23461
  }
23462
+ try {
23463
+ const credentialTracking = await project.getCredentialTracking();
23464
+ const credentialCount = Object.keys(credentialTracking.credentials).length;
23465
+ if (credentialCount > 0) {
23466
+ console.log(chalk7.cyan("\n\u{1F510} Credentials:"));
23467
+ console.log(chalk7.gray(` \u2022 Total credentials: ${credentialCount}`));
23468
+ for (const [credId, credData] of Object.entries(credentialTracking.credentials)) {
23469
+ const usageInfo = credentialTracking.usage[credId] || [];
23470
+ const credType = credData.type || "unknown";
23471
+ const storeId = credData.credentialStoreId || "unknown";
23472
+ console.log(chalk7.gray(` \u2022 ${credId} (${credType}, store: ${storeId})`));
23473
+ if (usageInfo.length > 0) {
23474
+ const usageByType = {};
23475
+ for (const usage of usageInfo) {
23476
+ usageByType[usage.type] = (usageByType[usage.type] || 0) + 1;
23477
+ }
23478
+ const usageSummary = Object.entries(usageByType).map(([type, count15]) => `${count15} ${type}${count15 > 1 ? "s" : ""}`).join(", ");
23479
+ console.log(chalk7.gray(` Used by: ${usageSummary}`));
23480
+ }
23481
+ }
23482
+ }
23483
+ } catch (error) {
23484
+ if (env2.DEBUG) {
23485
+ console.error(chalk7.yellow("Could not retrieve credential tracking information"));
23486
+ }
23487
+ }
22742
23488
  console.log(chalk7.green("\n\u2728 Next steps:"));
22743
23489
  console.log(chalk7.gray(` \u2022 Test your project: inkeep chat`));
22744
23490
  console.log(chalk7.gray(` \u2022 View all graphs: inkeep list-graphs`));
@@ -22755,58 +23501,58 @@ async function pushCommand(options) {
22755
23501
 
22756
23502
  // src/index.ts
22757
23503
  var __filename2 = fileURLToPath2(import.meta.url);
22758
- var __dirname2 = dirname4(__filename2);
23504
+ var __dirname2 = dirname5(__filename2);
22759
23505
  var packageJsonPath = join10(__dirname2, "..", "package.json");
22760
- var packageJson = JSON.parse(readFileSync2(packageJsonPath, "utf-8"));
23506
+ var packageJson = JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
22761
23507
  var program = new Command();
22762
23508
  program.name("inkeep").description("CLI tool for Inkeep Agent Framework").version(packageJson.version);
22763
- program.command("add [template]").description("Add a new template to the project").option("--target-path <path>", "Target path to add the template to").action(async (template, options) => {
23509
+ program.command("add [template]").description("Add a new template to the project").option("--target-path <path>", "Target path to add the template to").option("--config <path>", "Path to configuration file").action(async (template, options) => {
22764
23510
  await addCommand({ template, ...options });
22765
23511
  });
22766
- program.command("init [path]").description("Initialize a new Inkeep configuration file").option("--no-interactive", "Skip interactive path selection").action(async (path3, options) => {
23512
+ program.command("init [path]").description("Initialize a new Inkeep configuration file").option("--no-interactive", "Skip interactive path selection").option("--config <path>", "Path to use as template for new configuration").action(async (path3, options) => {
22767
23513
  await initCommand({ path: path3, ...options });
22768
23514
  });
22769
23515
  var configCommand = program.command("config").description("Manage Inkeep configuration");
22770
- configCommand.command("get [key]").description("Get configuration value(s)").option("--config-file-path <path>", "Path to configuration file").action(async (key, options) => {
22771
- await configGetCommand(key, options);
23516
+ configCommand.command("get [key]").description("Get configuration value(s)").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (key, options) => {
23517
+ const config = options.config || options.configFilePath;
23518
+ await configGetCommand(key, { config });
22772
23519
  });
22773
- configCommand.command("set <key> <value>").description("Set a configuration value").option("--config-file-path <path>", "Path to configuration file").action(async (key, value, options) => {
22774
- await configSetCommand(key, value, options);
23520
+ configCommand.command("set <key> <value>").description("Set a configuration value").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (key, value, options) => {
23521
+ const config = options.config || options.configFilePath;
23522
+ await configSetCommand(key, value, { config });
22775
23523
  });
22776
- configCommand.command("list").description("List all configuration values").option("--config-file-path <path>", "Path to configuration file").action(async (options) => {
22777
- await configListCommand(options);
23524
+ configCommand.command("list").description("List all configuration values").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (options) => {
23525
+ const config = options.config || options.configFilePath;
23526
+ await configListCommand({ config });
22778
23527
  });
22779
- program.command("push").description("Push a project configuration to the backend").option("--project <project-id>", "Project ID or path to project directory").option("--agents-manage-api-url <url>", "Override agents manage API URL").option(
23528
+ program.command("push").description("Push a project configuration to the backend").option("--project <project-id>", "Project ID or path to project directory").option("--config <path>", "Path to configuration file").option("--tenant-id <id>", "Override tenant ID").option("--agents-manage-api-url <url>", "Override agents manage API URL").option("--agents-run-api-url <url>", "Override agents run API URL").option(
22780
23529
  "--env <environment>",
22781
23530
  "Environment to use for credential resolution (e.g., development, production)"
22782
23531
  ).option("--json", "Generate project data JSON file instead of pushing to backend").action(async (options) => {
22783
23532
  await pushCommand(options);
22784
23533
  });
22785
- 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("--agents-manage-api-url <url>", "Override agents manage API URL").option("--env <environment>", "Environment to use for credential resolution").option("--json", "Generate project data JSON file instead of updating files").action(async (options) => {
23534
+ 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("--env <environment>", "Environment file to generate (development, staging, production). Defaults to development").option("--json", "Generate project data JSON file instead of updating files").option("--debug", "Enable debug logging for LLM generation").action(async (options) => {
22786
23535
  await pullProjectCommand(options);
22787
23536
  });
22788
23537
  program.command("chat [graph-id]").description(
22789
23538
  "Start an interactive chat session with a graph (interactive selection if no ID provided)"
22790
- ).option("--tenant-id <tenant-id>", "Tenant ID (use with --api-url)").option("--api-url <api-url>", "API URL (use with --tenant-id or alone to override config)").option(
22791
- "--config-file-path <path>",
22792
- "Path to configuration file (alternative to --tenant-id/--api-url)"
22793
- ).action(async (graphId, options) => {
23539
+ ).option("--tenant-id <tenant-id>", "Tenant ID").option("--agents-manage-api-url <url>", "Agents manage API URL").option("--agents-run-api-url <url>", "Agents run API URL").option("--config <path>", "Path to configuration file").option("--config-file-path <path>", "Path to configuration file (deprecated, use --config)").action(async (graphId, options) => {
22794
23540
  const { chatCommandEnhanced: chatCommandEnhanced2 } = await Promise.resolve().then(() => (init_chat_enhanced(), chat_enhanced_exports));
22795
- await chatCommandEnhanced2(graphId, options);
23541
+ const config = options.config || options.configFilePath;
23542
+ await chatCommandEnhanced2(graphId, { ...options, config });
22796
23543
  });
22797
- program.command("list-graphs").description("List all available graphs for the current tenant").option("--tenant-id <tenant-id>", "Tenant ID (use with --api-url)").option("--api-url <api-url>", "API URL (use with --tenant-id or alone to override config)").option(
22798
- "--config-file-path <path>",
22799
- "Path to configuration file (alternative to --tenant-id/--api-url)"
22800
- ).action(async (options) => {
22801
- await listGraphsCommand(options);
23544
+ program.command("list-graphs").description("List all available graphs for the current tenant").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) => {
23545
+ const config = options.config || options.configFilePath;
23546
+ await listGraphsCommand({ ...options, config });
22802
23547
  });
22803
- 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", "Create a Vercel-ready build and exit").option("--output-dir <dir>", "Output directory for build files", "./vercel-build").option("--vercel", "Copy Vercel output to .vercel/output for deployment").action(async (options) => {
23548
+ 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", "Create a Vercel-ready build and exit").option("--output-dir <dir>", "Output directory for build files", "./vercel-build").option("--vercel", "Copy Vercel output to .vercel/output for deployment").option("--config <path>", "Path to configuration file").action(async (options) => {
22804
23549
  await devCommand({
22805
23550
  port: parseInt(options.port, 10),
22806
23551
  host: options.host,
22807
23552
  build: options.build,
22808
23553
  outputDir: options.outputDir,
22809
- vercel: options.vercel
23554
+ vercel: options.vercel,
23555
+ config: options.config
22810
23556
  });
22811
23557
  });
22812
23558
  program.parse();