@fgv/ts-extras 5.1.0-45 → 5.1.0-47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +90 -0
  2. package/dist/index.browser.js +3 -1
  3. package/dist/index.browser.js.map +1 -1
  4. package/dist/index.js +2 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/packlets/ai-assist/index.js +1 -1
  7. package/dist/packlets/ai-assist/index.js.map +1 -1
  8. package/dist/packlets/ai-assist/jsonResponse.js +270 -7
  9. package/dist/packlets/ai-assist/jsonResponse.js.map +1 -1
  10. package/dist/packlets/ai-assist/model.js +14 -0
  11. package/dist/packlets/ai-assist/model.js.map +1 -1
  12. package/dist/packlets/ai-assist/registry.js +57 -14
  13. package/dist/packlets/ai-assist/registry.js.map +1 -1
  14. package/dist/packlets/safer-fetch/addressClassification.js +438 -0
  15. package/dist/packlets/safer-fetch/addressClassification.js.map +1 -0
  16. package/dist/packlets/safer-fetch/addressPolicy.js +119 -0
  17. package/dist/packlets/safer-fetch/addressPolicy.js.map +1 -0
  18. package/dist/packlets/safer-fetch/contentType.js +120 -0
  19. package/dist/packlets/safer-fetch/contentType.js.map +1 -0
  20. package/dist/packlets/safer-fetch/deadline.js +254 -0
  21. package/dist/packlets/safer-fetch/deadline.js.map +1 -0
  22. package/dist/packlets/safer-fetch/defaults.js +131 -0
  23. package/dist/packlets/safer-fetch/defaults.js.map +1 -0
  24. package/dist/packlets/safer-fetch/failureReason.js +21 -0
  25. package/dist/packlets/safer-fetch/failureReason.js.map +1 -0
  26. package/dist/packlets/safer-fetch/guards.js +148 -0
  27. package/dist/packlets/safer-fetch/guards.js.map +1 -0
  28. package/dist/packlets/safer-fetch/index.browser.js +58 -0
  29. package/dist/packlets/safer-fetch/index.browser.js.map +1 -0
  30. package/dist/packlets/safer-fetch/index.js +52 -0
  31. package/dist/packlets/safer-fetch/index.js.map +1 -0
  32. package/dist/packlets/safer-fetch/model.js +21 -0
  33. package/dist/packlets/safer-fetch/model.js.map +1 -0
  34. package/dist/packlets/safer-fetch/nodeAddressGuard.js +191 -0
  35. package/dist/packlets/safer-fetch/nodeAddressGuard.js.map +1 -0
  36. package/dist/packlets/safer-fetch/redirect.js +93 -0
  37. package/dist/packlets/safer-fetch/redirect.js.map +1 -0
  38. package/dist/packlets/safer-fetch/retry.js +188 -0
  39. package/dist/packlets/safer-fetch/retry.js.map +1 -0
  40. package/dist/packlets/safer-fetch/saferFetch.js +755 -0
  41. package/dist/packlets/safer-fetch/saferFetch.js.map +1 -0
  42. package/dist/packlets/safer-fetch/transport.js +50 -0
  43. package/dist/packlets/safer-fetch/transport.js.map +1 -0
  44. package/dist/packlets/zip-file-tree/zipFileTreeAccessors.js +65 -7
  45. package/dist/packlets/zip-file-tree/zipFileTreeAccessors.js.map +1 -1
  46. package/dist/packlets/zip-file-tree/zipFileTreeWriter.js +16 -1
  47. package/dist/packlets/zip-file-tree/zipFileTreeWriter.js.map +1 -1
  48. package/dist/ts-extras.d.ts +1590 -13
  49. package/lib/index.browser.d.ts +2 -1
  50. package/lib/index.browser.d.ts.map +1 -1
  51. package/lib/index.browser.js +4 -1
  52. package/lib/index.browser.js.map +1 -1
  53. package/lib/index.d.ts +2 -1
  54. package/lib/index.d.ts.map +1 -1
  55. package/lib/index.js +3 -1
  56. package/lib/index.js.map +1 -1
  57. package/lib/packlets/ai-assist/index.d.ts +1 -1
  58. package/lib/packlets/ai-assist/index.d.ts.map +1 -1
  59. package/lib/packlets/ai-assist/index.js +3 -2
  60. package/lib/packlets/ai-assist/index.js.map +1 -1
  61. package/lib/packlets/ai-assist/jsonResponse.d.ts +96 -0
  62. package/lib/packlets/ai-assist/jsonResponse.d.ts.map +1 -1
  63. package/lib/packlets/ai-assist/jsonResponse.js +271 -7
  64. package/lib/packlets/ai-assist/jsonResponse.js.map +1 -1
  65. package/lib/packlets/ai-assist/model.d.ts +43 -0
  66. package/lib/packlets/ai-assist/model.d.ts.map +1 -1
  67. package/lib/packlets/ai-assist/model.js +14 -0
  68. package/lib/packlets/ai-assist/model.js.map +1 -1
  69. package/lib/packlets/ai-assist/registry.d.ts +26 -6
  70. package/lib/packlets/ai-assist/registry.d.ts.map +1 -1
  71. package/lib/packlets/ai-assist/registry.js +57 -14
  72. package/lib/packlets/ai-assist/registry.js.map +1 -1
  73. package/lib/packlets/safer-fetch/addressClassification.d.ts +144 -0
  74. package/lib/packlets/safer-fetch/addressClassification.d.ts.map +1 -0
  75. package/lib/packlets/safer-fetch/addressClassification.js +441 -0
  76. package/lib/packlets/safer-fetch/addressClassification.js.map +1 -0
  77. package/lib/packlets/safer-fetch/addressPolicy.d.ts +113 -0
  78. package/lib/packlets/safer-fetch/addressPolicy.d.ts.map +1 -0
  79. package/lib/packlets/safer-fetch/addressPolicy.js +123 -0
  80. package/lib/packlets/safer-fetch/addressPolicy.js.map +1 -0
  81. package/lib/packlets/safer-fetch/contentType.d.ts +51 -0
  82. package/lib/packlets/safer-fetch/contentType.d.ts.map +1 -0
  83. package/lib/packlets/safer-fetch/contentType.js +127 -0
  84. package/lib/packlets/safer-fetch/contentType.js.map +1 -0
  85. package/lib/packlets/safer-fetch/deadline.d.ts +138 -0
  86. package/lib/packlets/safer-fetch/deadline.d.ts.map +1 -0
  87. package/lib/packlets/safer-fetch/deadline.js +258 -0
  88. package/lib/packlets/safer-fetch/deadline.js.map +1 -0
  89. package/lib/packlets/safer-fetch/defaults.d.ts +108 -0
  90. package/lib/packlets/safer-fetch/defaults.d.ts.map +1 -0
  91. package/lib/packlets/safer-fetch/defaults.js +134 -0
  92. package/lib/packlets/safer-fetch/defaults.js.map +1 -0
  93. package/lib/packlets/safer-fetch/failureReason.d.ts +148 -0
  94. package/lib/packlets/safer-fetch/failureReason.d.ts.map +1 -0
  95. package/lib/packlets/safer-fetch/failureReason.js +22 -0
  96. package/lib/packlets/safer-fetch/failureReason.js.map +1 -0
  97. package/lib/packlets/safer-fetch/guards.d.ts +62 -0
  98. package/lib/packlets/safer-fetch/guards.d.ts.map +1 -0
  99. package/lib/packlets/safer-fetch/guards.js +153 -0
  100. package/lib/packlets/safer-fetch/guards.js.map +1 -0
  101. package/lib/packlets/safer-fetch/index.browser.d.ts +33 -0
  102. package/lib/packlets/safer-fetch/index.browser.d.ts.map +1 -0
  103. package/lib/packlets/safer-fetch/index.browser.js +82 -0
  104. package/lib/packlets/safer-fetch/index.browser.js.map +1 -0
  105. package/lib/packlets/safer-fetch/index.d.ts +27 -0
  106. package/lib/packlets/safer-fetch/index.d.ts.map +1 -0
  107. package/lib/packlets/safer-fetch/index.js +78 -0
  108. package/lib/packlets/safer-fetch/index.js.map +1 -0
  109. package/lib/packlets/safer-fetch/model.d.ts +373 -0
  110. package/lib/packlets/safer-fetch/model.d.ts.map +1 -0
  111. package/lib/packlets/safer-fetch/model.js +22 -0
  112. package/lib/packlets/safer-fetch/model.js.map +1 -0
  113. package/lib/packlets/safer-fetch/nodeAddressGuard.d.ts +129 -0
  114. package/lib/packlets/safer-fetch/nodeAddressGuard.d.ts.map +1 -0
  115. package/lib/packlets/safer-fetch/nodeAddressGuard.js +196 -0
  116. package/lib/packlets/safer-fetch/nodeAddressGuard.js.map +1 -0
  117. package/lib/packlets/safer-fetch/redirect.d.ts +62 -0
  118. package/lib/packlets/safer-fetch/redirect.d.ts.map +1 -0
  119. package/lib/packlets/safer-fetch/redirect.js +98 -0
  120. package/lib/packlets/safer-fetch/redirect.js.map +1 -0
  121. package/lib/packlets/safer-fetch/retry.d.ts +162 -0
  122. package/lib/packlets/safer-fetch/retry.d.ts.map +1 -0
  123. package/lib/packlets/safer-fetch/retry.js +197 -0
  124. package/lib/packlets/safer-fetch/retry.js.map +1 -0
  125. package/lib/packlets/safer-fetch/saferFetch.d.ts +108 -0
  126. package/lib/packlets/safer-fetch/saferFetch.d.ts.map +1 -0
  127. package/lib/packlets/safer-fetch/saferFetch.js +760 -0
  128. package/lib/packlets/safer-fetch/saferFetch.js.map +1 -0
  129. package/lib/packlets/safer-fetch/transport.d.ts +18 -0
  130. package/lib/packlets/safer-fetch/transport.d.ts.map +1 -0
  131. package/lib/packlets/safer-fetch/transport.js +53 -0
  132. package/lib/packlets/safer-fetch/transport.js.map +1 -0
  133. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.d.ts +54 -6
  134. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.d.ts.map +1 -1
  135. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.js +65 -7
  136. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.js.map +1 -1
  137. package/lib/packlets/zip-file-tree/zipFileTreeWriter.d.ts +26 -1
  138. package/lib/packlets/zip-file-tree/zipFileTreeWriter.d.ts.map +1 -1
  139. package/lib/packlets/zip-file-tree/zipFileTreeWriter.js +17 -1
  140. package/lib/packlets/zip-file-tree/zipFileTreeWriter.js.map +1 -1
  141. package/package.json +17 -7
@@ -5,8 +5,9 @@ import * as Experimental from './packlets/experimental';
5
5
  import * as Hash from './packlets/hash/index.browser';
6
6
  import * as Mustache from './packlets/mustache';
7
7
  import * as RecordJar from './packlets/record-jar/index.browser';
8
+ import * as SaferFetch from './packlets/safer-fetch/index.browser';
8
9
  import * as Yaml from './packlets/yaml';
9
10
  import * as ZipFileTree from './packlets/zip-file-tree';
10
11
  import { Converters } from './packlets/conversion';
11
- export { AiAssist, Converters, CryptoUtils, CryptoUtils as Crypto, Csv, Experimental, Hash, Mustache, RecordJar, Yaml, ZipFileTree };
12
+ export { AiAssist, Converters, CryptoUtils, CryptoUtils as Crypto, Csv, Experimental, Hash, Mustache, RecordJar, SaferFetch, Yaml, ZipFileTree };
12
13
  //# sourceMappingURL=index.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,WAAW,MAAM,uCAAuC,CAAC;AAErE,OAAO,KAAK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AAI,EACJ,WAAW,EACZ,CAAC"}
@@ -54,7 +54,7 @@ var __importStar = (this && this.__importStar) || (function () {
54
54
  };
55
55
  })();
56
56
  Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.ZipFileTree = exports.Yaml = exports.RecordJar = exports.Mustache = exports.Hash = exports.Experimental = exports.Csv = exports.Crypto = exports.CryptoUtils = exports.Converters = exports.AiAssist = void 0;
57
+ exports.ZipFileTree = exports.Yaml = exports.SaferFetch = exports.RecordJar = exports.Mustache = exports.Hash = exports.Experimental = exports.Csv = exports.Crypto = exports.CryptoUtils = exports.Converters = exports.AiAssist = void 0;
58
58
  /* c8 ignore start - Browser-specific export used conditionally in package.json */
59
59
  const AiAssist = __importStar(require("./packlets/ai-assist"));
60
60
  exports.AiAssist = AiAssist;
@@ -75,6 +75,9 @@ exports.Mustache = Mustache;
75
75
  // eslint-disable-next-line @rushstack/packlets/mechanics
76
76
  const RecordJar = __importStar(require("./packlets/record-jar/index.browser"));
77
77
  exports.RecordJar = RecordJar;
78
+ // eslint-disable-next-line @rushstack/packlets/mechanics
79
+ const SaferFetch = __importStar(require("./packlets/safer-fetch/index.browser"));
80
+ exports.SaferFetch = SaferFetch;
78
81
  const Yaml = __importStar(require("./packlets/yaml"));
79
82
  exports.Yaml = Yaml;
80
83
  const ZipFileTree = __importStar(require("./packlets/zip-file-tree"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kFAAkF;AAClF,+DAAiD;AAmB/C,4BAAQ;AAlBV,yDAAyD;AACzD,mFAAqE;AAmBnE,kCAAW;AACI,6BAAM;AAnBvB,yDAAyD;AACzD,kEAAoD;AAmBlD,kBAAG;AAlBL,sEAAwD;AAmBtD,oCAAY;AAlBd,yDAAyD;AACzD,oEAAsD;AAkBpD,oBAAI;AAjBN,8DAAgD;AAkB9C,4BAAQ;AAjBV,yDAAyD;AACzD,+EAAiE;AAiB/D,8BAAS;AAhBX,sDAAwC;AAiBtC,oBAAI;AAhBN,sEAAwD;AAiBtD,kCAAW;AAfb,sDAAmD;AAMjD,2FANO,uBAAU,OAMP;AAWZ,oBAAoB","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* c8 ignore start - Browser-specific export used conditionally in package.json */\nimport * as AiAssist from './packlets/ai-assist';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as CryptoUtils from './packlets/crypto-utils/index.browser';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as Csv from './packlets/csv/index.browser';\nimport * as Experimental from './packlets/experimental';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as Hash from './packlets/hash/index.browser';\nimport * as Mustache from './packlets/mustache';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as RecordJar from './packlets/record-jar/index.browser';\nimport * as Yaml from './packlets/yaml';\nimport * as ZipFileTree from './packlets/zip-file-tree';\n\nimport { Converters } from './packlets/conversion';\n\n// Browser-safe exports - Node.js crypto-based providers excluded\n// Use BrowserCryptoProvider from @fgv/ts-web-extras for browser crypto\nexport {\n AiAssist,\n Converters,\n CryptoUtils,\n CryptoUtils as Crypto,\n Csv,\n Experimental,\n Hash,\n Mustache,\n RecordJar,\n Yaml,\n ZipFileTree\n};\n/* c8 ignore stop */\n"]}
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kFAAkF;AAClF,+DAAiD;AAqB/C,4BAAQ;AApBV,yDAAyD;AACzD,mFAAqE;AAqBnE,kCAAW;AACI,6BAAM;AArBvB,yDAAyD;AACzD,kEAAoD;AAqBlD,kBAAG;AApBL,sEAAwD;AAqBtD,oCAAY;AApBd,yDAAyD;AACzD,oEAAsD;AAoBpD,oBAAI;AAnBN,8DAAgD;AAoB9C,4BAAQ;AAnBV,yDAAyD;AACzD,+EAAiE;AAmB/D,8BAAS;AAlBX,yDAAyD;AACzD,iFAAmE;AAkBjE,gCAAU;AAjBZ,sDAAwC;AAkBtC,oBAAI;AAjBN,sEAAwD;AAkBtD,kCAAW;AAhBb,sDAAmD;AAMjD,2FANO,uBAAU,OAMP;AAYZ,oBAAoB","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* c8 ignore start - Browser-specific export used conditionally in package.json */\nimport * as AiAssist from './packlets/ai-assist';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as CryptoUtils from './packlets/crypto-utils/index.browser';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as Csv from './packlets/csv/index.browser';\nimport * as Experimental from './packlets/experimental';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as Hash from './packlets/hash/index.browser';\nimport * as Mustache from './packlets/mustache';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as RecordJar from './packlets/record-jar/index.browser';\n// eslint-disable-next-line @rushstack/packlets/mechanics\nimport * as SaferFetch from './packlets/safer-fetch/index.browser';\nimport * as Yaml from './packlets/yaml';\nimport * as ZipFileTree from './packlets/zip-file-tree';\n\nimport { Converters } from './packlets/conversion';\n\n// Browser-safe exports - Node.js crypto-based providers excluded\n// Use BrowserCryptoProvider from @fgv/ts-web-extras for browser crypto\nexport {\n AiAssist,\n Converters,\n CryptoUtils,\n CryptoUtils as Crypto,\n Csv,\n Experimental,\n Hash,\n Mustache,\n RecordJar,\n SaferFetch,\n Yaml,\n ZipFileTree\n};\n/* c8 ignore stop */\n"]}
package/lib/index.d.ts CHANGED
@@ -5,8 +5,9 @@ import * as Experimental from './packlets/experimental';
5
5
  import * as Hash from './packlets/hash';
6
6
  import * as Mustache from './packlets/mustache';
7
7
  import * as RecordJar from './packlets/record-jar';
8
+ import * as SaferFetch from './packlets/safer-fetch';
8
9
  import * as Yaml from './packlets/yaml';
9
10
  import * as ZipFileTree from './packlets/zip-file-tree';
10
11
  import { Converters } from './packlets/conversion';
11
- export { AiAssist, Converters, CryptoUtils, Csv, Experimental, Hash, Mustache, RecordJar, Yaml, ZipFileTree };
12
+ export { AiAssist, Converters, CryptoUtils, Csv, Experimental, Hash, Mustache, RecordJar, SaferFetch, Yaml, ZipFileTree };
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,QAAQ,EACR,UAAU,EACV,WAAW,EACX,GAAG,EACH,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,IAAI,EACJ,WAAW,EACZ,CAAC"}
package/lib/index.js CHANGED
@@ -54,7 +54,7 @@ var __importStar = (this && this.__importStar) || (function () {
54
54
  };
55
55
  })();
56
56
  Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.ZipFileTree = exports.Yaml = exports.RecordJar = exports.Mustache = exports.Hash = exports.Experimental = exports.Csv = exports.CryptoUtils = exports.Converters = exports.AiAssist = void 0;
57
+ exports.ZipFileTree = exports.Yaml = exports.SaferFetch = exports.RecordJar = exports.Mustache = exports.Hash = exports.Experimental = exports.Csv = exports.CryptoUtils = exports.Converters = exports.AiAssist = void 0;
58
58
  const AiAssist = __importStar(require("./packlets/ai-assist"));
59
59
  exports.AiAssist = AiAssist;
60
60
  const CryptoUtils = __importStar(require("./packlets/crypto-utils"));
@@ -69,6 +69,8 @@ const Mustache = __importStar(require("./packlets/mustache"));
69
69
  exports.Mustache = Mustache;
70
70
  const RecordJar = __importStar(require("./packlets/record-jar"));
71
71
  exports.RecordJar = RecordJar;
72
+ const SaferFetch = __importStar(require("./packlets/safer-fetch"));
73
+ exports.SaferFetch = SaferFetch;
72
74
  const Yaml = __importStar(require("./packlets/yaml"));
73
75
  exports.Yaml = Yaml;
74
76
  const ZipFileTree = __importStar(require("./packlets/zip-file-tree"));
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+DAAiD;AAYxC,4BAAQ;AAXjB,qEAAuD;AAWxB,kCAAW;AAV1C,oDAAsC;AAUM,kBAAG;AAT/C,sEAAwD;AASP,oCAAY;AAR7D,sDAAwC;AAQuB,oBAAI;AAPnE,8DAAgD;AAOqB,4BAAQ;AAN7E,iEAAmD;AAM4B,8BAAS;AALxF,sDAAwC;AAKkD,oBAAI;AAJ9F,sEAAwD;AAIwC,kCAAW;AAF3G,sDAAmD;AAEhC,2FAFV,uBAAU,OAEU","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as AiAssist from './packlets/ai-assist';\nimport * as CryptoUtils from './packlets/crypto-utils';\nimport * as Csv from './packlets/csv';\nimport * as Experimental from './packlets/experimental';\nimport * as Hash from './packlets/hash';\nimport * as Mustache from './packlets/mustache';\nimport * as RecordJar from './packlets/record-jar';\nimport * as Yaml from './packlets/yaml';\nimport * as ZipFileTree from './packlets/zip-file-tree';\n\nimport { Converters } from './packlets/conversion';\n\nexport { AiAssist, Converters, CryptoUtils, Csv, Experimental, Hash, Mustache, RecordJar, Yaml, ZipFileTree };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+DAAiD;AAc/C,4BAAQ;AAbV,qEAAuD;AAerD,kCAAW;AAdb,oDAAsC;AAepC,kBAAG;AAdL,sEAAwD;AAetD,oCAAY;AAdd,sDAAwC;AAetC,oBAAI;AAdN,8DAAgD;AAe9C,4BAAQ;AAdV,iEAAmD;AAejD,8BAAS;AAdX,mEAAqD;AAenD,gCAAU;AAdZ,sDAAwC;AAetC,oBAAI;AAdN,sEAAwD;AAetD,kCAAW;AAbb,sDAAmD;AAIjD,2FAJO,uBAAU,OAIP","sourcesContent":["/*\n * Copyright (c) 2020 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as AiAssist from './packlets/ai-assist';\nimport * as CryptoUtils from './packlets/crypto-utils';\nimport * as Csv from './packlets/csv';\nimport * as Experimental from './packlets/experimental';\nimport * as Hash from './packlets/hash';\nimport * as Mustache from './packlets/mustache';\nimport * as RecordJar from './packlets/record-jar';\nimport * as SaferFetch from './packlets/safer-fetch';\nimport * as Yaml from './packlets/yaml';\nimport * as ZipFileTree from './packlets/zip-file-tree';\n\nimport { Converters } from './packlets/conversion';\n\nexport {\n AiAssist,\n Converters,\n CryptoUtils,\n Csv,\n Experimental,\n Hash,\n Mustache,\n RecordJar,\n SaferFetch,\n Yaml,\n ZipFileTree\n};\n"]}
@@ -10,7 +10,7 @@ export { callProviderEmbedding, callProxiedEmbedding, type IProviderEmbeddingPar
10
10
  export { callProviderCompletionStream, callProxiedCompletionStream, type IProviderCompletionStreamParams, executeClientToolTurn, type IExecuteClientToolTurnParams, type IExecuteClientToolTurnResult, type IToolExecutionDecision } from './streamingClient';
11
11
  export { aiProviderId, aiServerToolType, aiWebSearchToolConfig, aiServerToolConfig, aiToolAnnotations, aiClientToolConfig, aiToolEnablement, aiAssistProviderConfig, aiAssistSettings, modelSpecKey, modelSpec } from './converters';
12
12
  export { resolveEffectiveTools } from './toolFormats';
13
- export { extractJsonText, fencedStringifiedJson, type IFencedStringifiedJsonExtractorOptions, type IFencedStringifiedJsonOptions, type JsonTextExtractor } from './jsonResponse';
13
+ export { classifyJsonParseFailure, extractJsonText, fencedStringifiedJson, type IFencedStringifiedJsonExtractorOptions, type IFencedStringifiedJsonOptions, type JsonParseFailureReason, type JsonTextExtractor } from './jsonResponse';
14
14
  export { generateJsonCompletion, SMART_JSON_PROMPT_HINT, type IGenerateJsonCompletionParams, type IGenerateJsonCompletionResult, type JsonPromptHint } from './jsonCompletion';
15
15
  export { anthropicEffortToBudgetTokens, type IResolvedThinkingConfig } from './thinkingOptionsResolver';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/ai-assist/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACtC,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,K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0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC/B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,KAAK,+BAA+B,EACpC,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,sCAAsC,EAC3C,KAAK,6BAA6B,EAClC,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/ai-assist/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,KAAK,iBAAiB,EACtB,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,k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ACjB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,KAAK,sCAAsC,EAC3C,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -4,8 +4,8 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.fencedStringifiedJson = exports.extractJsonText = exports.resolveEffectiveTools = exports.modelSpec = exports.modelSpecKey = exports.aiAssistSettings = exports.aiAssistProviderConfig = exports.aiToolEnablement = exports.aiClientToolConfig = exports.aiToolAnnotations = exports.aiServerToolConfig = exports.aiWebSearchToolConfig = exports.aiServerToolType = exports.aiProviderId = exports.executeClientToolTurn = exports.callProxiedCompletionStream = exports.callProviderCompletionStream = exports.callProxiedEmbedding = exports.callProviderEmbedding = exports.callProxiedListModels = exports.callProviderListModels = exports.callProxiedImageGeneration = exports.callProviderImageGeneration = exports.callProxiedCompletion = exports.callProviderCompletion = exports.DEFAULT_MODEL_CAPABILITY_CONFIG = exports.supportsEmbedding = exports.resolveEmbeddingCapability = exports.supportsImageGeneration = exports.resolveImageCapability = exports.getProviderDescriptor = exports.getProviderDescriptors = exports.allProviderIds = exports.validateResolvedOptions = exports.resolveImageOptions = exports.toDataUrl = exports.usesMaxCompletionTokensField = exports.isAdaptiveThinkingModel = exports.isResponsesOnlyModel = exports.resolveProviderModel = exports.resolveModelAlias = exports.MODEL_ALIAS_SIGIL = exports.resolveModel = exports.MODEL_SPEC_BASE_KEY = exports.allModelSpecKeys = exports.providerApiKeySecretName = exports.DEFAULT_AI_ASSIST = exports.DEFAULT_ANTHROPIC_MAX_TOKENS = exports.allModelCapabilities = exports.AiPrompt = void 0;
8
- exports.anthropicEffortToBudgetTokens = exports.SMART_JSON_PROMPT_HINT = exports.generateJsonCompletion = void 0;
7
+ exports.extractJsonText = exports.classifyJsonParseFailure = exports.resolveEffectiveTools = exports.modelSpec = exports.modelSpecKey = exports.aiAssistSettings = exports.aiAssistProviderConfig = exports.aiToolEnablement = exports.aiClientToolConfig = exports.aiToolAnnotations = exports.aiServerToolConfig = exports.aiWebSearchToolConfig = exports.aiServerToolType = exports.aiProviderId = exports.executeClientToolTurn = exports.callProxiedCompletionStream = exports.callProviderCompletionStream = exports.callProxiedEmbedding = exports.callProviderEmbedding = exports.callProxiedListModels = exports.callProviderListModels = exports.callProxiedImageGeneration = exports.callProviderImageGeneration = exports.callProxiedCompletion = exports.callProviderCompletion = exports.DEFAULT_MODEL_CAPABILITY_CONFIG = exports.supportsEmbedding = exports.resolveEmbeddingCapability = exports.supportsImageGeneration = exports.resolveImageCapability = exports.getProviderDescriptor = exports.getProviderDescriptors = exports.allProviderIds = exports.validateResolvedOptions = exports.resolveImageOptions = exports.toDataUrl = exports.usesMaxCompletionTokensField = exports.isAdaptiveThinkingModel = exports.isResponsesOnlyModel = exports.resolveProviderModel = exports.resolveModelAlias = exports.MODEL_ALIAS_SIGIL = exports.resolveModel = exports.MODEL_SPEC_BASE_KEY = exports.allModelSpecKeys = exports.providerApiKeySecretName = exports.DEFAULT_AI_ASSIST = exports.DEFAULT_ANTHROPIC_MAX_TOKENS = exports.allModelCapabilities = exports.AiPrompt = void 0;
8
+ exports.anthropicEffortToBudgetTokens = exports.SMART_JSON_PROMPT_HINT = exports.generateJsonCompletion = exports.fencedStringifiedJson = void 0;
9
9
  var model_1 = require("./model");
10
10
  Object.defineProperty(exports, "AiPrompt", { enumerable: true, get: function () { return model_1.AiPrompt; } });
11
11
  Object.defineProperty(exports, "allModelCapabilities", { enumerable: true, get: function () { return model_1.allModelCapabilities; } });
@@ -63,6 +63,7 @@ Object.defineProperty(exports, "modelSpec", { enumerable: true, get: function ()
63
63
  var toolFormats_1 = require("./toolFormats");
64
64
  Object.defineProperty(exports, "resolveEffectiveTools", { enumerable: true, get: function () { return toolFormats_1.resolveEffectiveTools; } });
65
65
  var jsonResponse_1 = require("./jsonResponse");
66
+ Object.defineProperty(exports, "classifyJsonParseFailure", { enumerable: true, get: function () { return jsonResponse_1.classifyJsonParseFailure; } });
66
67
  Object.defineProperty(exports, "extractJsonText", { enumerable: true, get: function () { return jsonResponse_1.extractJsonText; } });
67
68
  Object.defineProperty(exports, "fencedStringifiedJson", { enumerable: true, get: function () { return jsonResponse_1.fencedStringifiedJson; } });
68
69
  var jsonCompletion_1 = require("./jsonCompletion");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/ai-assist/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,iCAiGiB;AAhGf,iGAAA,QAAQ,OAAA;AAER,6GAAA,oBAAoB,OAAA;AAcpB,qHAAA,4BAA4B,OAAA;AAe5B,0GAAA,iBAAiB,OAAA;AAEjB,iHAAA,wBAAwB,OAAA;AAoCxB,yGAAA,gBAAgB,OAAA;AAChB,4GAAA,mBAAmB,OAAA;AACnB,qGAAA,YAAY,OAAA;AAEZ,0GAAA,iBAAiB,OAAA;AACjB,0GAAA,iBAAiB,OAAA;AACjB,6GAAA,oBAAoB,OAAA;AACpB,6GAAA,oBAAoB,OAAA;AACpB,gHAAA,uBAAuB,OAAA;AACvB,qHAAA,4BAA4B,OAAA;AAC5B,kGAAA,SAAS,OAAA;AAmBX,+DAIgC;AAF9B,2HAAA,mBAAmB,OAAA;AACnB,+HAAA,uBAAuB,OAAA;AAGzB,uCASoB;AARlB,0GAAA,cAAc,OAAA;AACd,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,qBAAqB,OAAA;AACrB,kHAAA,sBAAsB,OAAA;AACtB,mHAAA,uBAAuB,OAAA;AACvB,sHAAA,0BAA0B,OAAA;AAC1B,6GAAA,iBAAiB,OAAA;AACjB,2HAAA,+BAA+B,OAAA;AAGjC,yCAUqB;AATnB,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,OAAA;AACrB,wHAAA,2BAA2B,OAAA;AAC3B,uHAAA,0BAA0B,OAAA;AAC1B,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,OAAA;AAMvB,qDAI2B;AAHzB,wHAAA,qBAAqB,OAAA;AACrB,uHAAA,oBAAoB,OAAA;AAItB,qDAQ2B;AAPzB,+HAAA,4BAA4B,OAAA;AAC5B,8HAAA,2BAA2B,OAAA;AAE3B,wHAAA,qBAAqB,OAAA;AAMvB,2CAYsB;AAXpB,0GAAA,YAAY,OAAA;AACZ,8GAAA,gBAAgB,OAAA;AAChB,mHAAA,qBAAqB,OAAA;AACrB,gHAAA,kBAAkB,OAAA;AAClB,+GAAA,iBAAiB,OAAA;AACjB,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAChB,oHAAA,sBAAsB,OAAA;AACtB,8GAAA,gBAAgB,OAAA;AAChB,0GAAA,YAAY,OAAA;AACZ,uGAAA,SAAS,OAAA;AAGX,6CAAsD;AAA7C,oHAAA,qBAAqB,OAAA;AAE9B,+CAMwB;AALtB,+GAAA,eAAe,OAAA;AACf,qHAAA,qBAAqB,OAAA;AAMvB,mDAM0B;AALxB,wHAAA,sBAAsB,OAAA;AACtB,wHAAA,sBAAsB,OAAA;AAMxB,qEAAwG;AAA/F,wIAAA,6BAA6B,OAAA","sourcesContent":["/**\n * AI assist packlet - provider registry, prompt class, settings, and API client.\n * @packageDocumentation\n */\n\nexport {\n AiPrompt,\n type AiModelCapability,\n allModelCapabilities,\n type AiProviderId,\n type AiServerToolType,\n type AiServerToolConfig,\n type AiToolConfig,\n type IAiWebSearchToolConfig,\n type IAiClientToolConfig,\n type IAiToolAnnotations,\n type IAiClientTool,\n type IAiClientToolCallSummary,\n type IAiClientToolContinuation,\n type IAiClientToolTurnResult,\n type IAiToolEnablement,\n type IAiCompletionResponse,\n DEFAULT_ANTHROPIC_MAX_TOKENS,\n type IChatMessage,\n type IChatRequest,\n type AiApiFormat,\n type AiImageApiFormat,\n type AiEmbeddingApiFormat,\n type AiEmbeddingTaskType,\n type IAiEmbeddingModelCapability,\n type IAiEmbeddingParams,\n type IAiEmbeddingUsage,\n type IAiEmbeddingResult,\n type IAiImageModelCapability,\n type IAiProviderDescriptor,\n type IAiAssistProviderConfig,\n type IAiAssistSettings,\n DEFAULT_AI_ASSIST,\n type IAiAssistKeyStore,\n providerApiKeySecretName,\n type IAiImageAttachment,\n type IAiImageData,\n type AiImageSize,\n type AiImageQuality,\n type GptImageSize,\n type GptImageQuality,\n type GptImageModelNames,\n type GrokImagineModelNames,\n type GeminiFlashImageModelNames,\n type IGptImageGenerationConfig,\n type IGrokImagineImageGenerationConfig,\n type IGeminiFlashImageGenerationConfig,\n type IGptImageModelOptions,\n type IGrokImagineModelOptions,\n type IGeminiFlashImageModelOptions,\n type IOtherModelOptions,\n type IModelFamilyConfig,\n type IAiImageGenerationOptions,\n type IAiImageGenerationParams,\n type IAiGeneratedImage,\n type IAiImageGenerationResponse,\n type IAiModelCapabilityRule,\n type IAiModelCapabilityConfig,\n type IAiModelInfo,\n type IAiStreamEvent,\n type IAiStreamTextDelta,\n type IAiStreamToolEvent,\n type IAiStreamToolUseStart,\n type IAiStreamToolUseDelta,\n type IAiStreamToolUseComplete,\n type IAiStreamDone,\n type IAiStreamError,\n type ModelSpec,\n type ModelSpecKey,\n type IModelSpecMap,\n allModelSpecKeys,\n MODEL_SPEC_BASE_KEY,\n resolveModel,\n type IModelAliasMap,\n MODEL_ALIAS_SIGIL,\n resolveModelAlias,\n resolveProviderModel,\n isResponsesOnlyModel,\n isAdaptiveThinkingModel,\n usesMaxCompletionTokensField,\n toDataUrl,\n type AiThinkingMode,\n type IThinkingConfig,\n type IThinkingProviderConfig,\n type IAnthropicThinkingOptions,\n type IOpenAiThinkingOptions,\n type IGeminiThinkingOptions,\n type IXAiThinkingOptions,\n type IOtherThinkingOptions,\n type IAnthropicThinkingConfig,\n type IOpenAiThinkingConfig,\n type IGeminiThinkingConfig,\n type IXAiThinkingConfig,\n type AnthropicThinkingModelNames,\n type OpenAiThinkingModelNames,\n type GeminiThinkingModelNames,\n type XAiThinkingModelNames\n} from './model';\n\nexport {\n type IResolvedImageOptions,\n resolveImageOptions,\n validateResolvedOptions\n} from './imageOptionsResolver';\n\nexport {\n allProviderIds,\n getProviderDescriptors,\n getProviderDescriptor,\n resolveImageCapability,\n supportsImageGeneration,\n resolveEmbeddingCapability,\n supportsEmbedding,\n DEFAULT_MODEL_CAPABILITY_CONFIG\n} from './registry';\n\nexport {\n callProviderCompletion,\n callProxiedCompletion,\n callProviderImageGeneration,\n callProxiedImageGeneration,\n callProviderListModels,\n callProxiedListModels,\n type IProviderCompletionParams,\n type IProviderImageGenerationParams,\n type IProviderListModelsParams\n} from './apiClient';\n\nexport {\n callProviderEmbedding,\n callProxiedEmbedding,\n type IProviderEmbeddingParams\n} from './embeddingClient';\n\nexport {\n callProviderCompletionStream,\n callProxiedCompletionStream,\n type IProviderCompletionStreamParams,\n executeClientToolTurn,\n type IExecuteClientToolTurnParams,\n type IExecuteClientToolTurnResult,\n type IToolExecutionDecision\n} from './streamingClient';\n\nexport {\n aiProviderId,\n aiServerToolType,\n aiWebSearchToolConfig,\n aiServerToolConfig,\n aiToolAnnotations,\n aiClientToolConfig,\n aiToolEnablement,\n aiAssistProviderConfig,\n aiAssistSettings,\n modelSpecKey,\n modelSpec\n} from './converters';\n\nexport { resolveEffectiveTools } from './toolFormats';\n\nexport {\n extractJsonText,\n fencedStringifiedJson,\n type IFencedStringifiedJsonExtractorOptions,\n type IFencedStringifiedJsonOptions,\n type JsonTextExtractor\n} from './jsonResponse';\n\nexport {\n generateJsonCompletion,\n SMART_JSON_PROMPT_HINT,\n type IGenerateJsonCompletionParams,\n type IGenerateJsonCompletionResult,\n type JsonPromptHint\n} from './jsonCompletion';\n\nexport { anthropicEffortToBudgetTokens, type IResolvedThinkingConfig } from './thinkingOptionsResolver';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/ai-assist/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,iCAiGiB;AAhGf,iGAAA,QAAQ,OAAA;AAER,6GAAA,oBAAoB,OAAA;AAcpB,qHAAA,4BAA4B,OAAA;AAe5B,0GAAA,iBAAiB,OAAA;AAEjB,iHAAA,wBAAwB,OAAA;AAoCxB,yGAAA,gBAAgB,OAAA;AAChB,4GAAA,mBAAmB,OAAA;AACnB,qGAAA,YAAY,OAAA;AAEZ,0GAAA,iBAAiB,OAAA;AACjB,0GAAA,iBAAiB,OAAA;AACjB,6GAAA,oBAAoB,OAAA;AACpB,6GAAA,oBAAoB,OAAA;AACpB,gHAAA,uBAAuB,OAAA;AACvB,qHAAA,4BAA4B,OAAA;AAC5B,kGAAA,SAAS,OAAA;AAmBX,+DAIgC;AAF9B,2HAAA,mBAAmB,OAAA;AACnB,+HAAA,uBAAuB,OAAA;AAGzB,uCASoB;AARlB,0GAAA,cAAc,OAAA;AACd,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,qBAAqB,OAAA;AACrB,kHAAA,sBAAsB,OAAA;AACtB,mHAAA,uBAAuB,OAAA;AACvB,sHAAA,0BAA0B,OAAA;AAC1B,6GAAA,iBAAiB,OAAA;AACjB,2HAAA,+BAA+B,OAAA;AAGjC,yCAUqB;AATnB,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,OAAA;AACrB,wHAAA,2BAA2B,OAAA;AAC3B,uHAAA,0BAA0B,OAAA;AAC1B,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,OAAA;AAMvB,qDAI2B;AAHzB,wHAAA,qBAAqB,OAAA;AACrB,uHAAA,oBAAoB,OAAA;AAItB,qDAQ2B;AAPzB,+HAAA,4BAA4B,OAAA;AAC5B,8HAAA,2BAA2B,OAAA;AAE3B,wHAAA,qBAAqB,OAAA;AAMvB,2CAYsB;AAXpB,0GAAA,YAAY,OAAA;AACZ,8GAAA,gBAAgB,OAAA;AAChB,mHAAA,qBAAqB,OAAA;AACrB,gHAAA,kBAAkB,OAAA;AAClB,+GAAA,iBAAiB,OAAA;AACjB,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAChB,oHAAA,sBAAsB,OAAA;AACtB,8GAAA,gBAAgB,OAAA;AAChB,0GAAA,YAAY,OAAA;AACZ,uGAAA,SAAS,OAAA;AAGX,6CAAsD;AAA7C,oHAAA,qBAAqB,OAAA;AAE9B,+CAQwB;AAPtB,wHAAA,wBAAwB,OAAA;AACxB,+GAAA,eAAe,OAAA;AACf,qHAAA,qBAAqB,OAAA;AAOvB,mDAM0B;AALxB,wHAAA,sBAAsB,OAAA;AACtB,wHAAA,sBAAsB,OAAA;AAMxB,qEAAwG;AAA/F,wIAAA,6BAA6B,OAAA","sourcesContent":["/**\n * AI assist packlet - provider registry, prompt class, settings, and API client.\n * @packageDocumentation\n */\n\nexport {\n AiPrompt,\n type AiModelCapability,\n allModelCapabilities,\n type AiProviderId,\n type AiServerToolType,\n type AiServerToolConfig,\n type AiToolConfig,\n type IAiWebSearchToolConfig,\n type IAiClientToolConfig,\n type IAiToolAnnotations,\n type IAiClientTool,\n type IAiClientToolCallSummary,\n type IAiClientToolContinuation,\n type IAiClientToolTurnResult,\n type IAiToolEnablement,\n type IAiCompletionResponse,\n DEFAULT_ANTHROPIC_MAX_TOKENS,\n type IChatMessage,\n type IChatRequest,\n type AiApiFormat,\n type AiImageApiFormat,\n type AiEmbeddingApiFormat,\n type AiEmbeddingTaskType,\n type IAiEmbeddingModelCapability,\n type IAiEmbeddingParams,\n type IAiEmbeddingUsage,\n type IAiEmbeddingResult,\n type IAiImageModelCapability,\n type IAiProviderDescriptor,\n type IAiAssistProviderConfig,\n type IAiAssistSettings,\n DEFAULT_AI_ASSIST,\n type IAiAssistKeyStore,\n providerApiKeySecretName,\n type IAiImageAttachment,\n type IAiImageData,\n type AiImageSize,\n type AiImageQuality,\n type GptImageSize,\n type GptImageQuality,\n type GptImageModelNames,\n type GrokImagineModelNames,\n type GeminiFlashImageModelNames,\n type IGptImageGenerationConfig,\n type IGrokImagineImageGenerationConfig,\n type IGeminiFlashImageGenerationConfig,\n type IGptImageModelOptions,\n type IGrokImagineModelOptions,\n type IGeminiFlashImageModelOptions,\n type IOtherModelOptions,\n type IModelFamilyConfig,\n type IAiImageGenerationOptions,\n type IAiImageGenerationParams,\n type IAiGeneratedImage,\n type IAiImageGenerationResponse,\n type IAiModelCapabilityRule,\n type IAiModelCapabilityConfig,\n type IAiModelInfo,\n type IAiStreamEvent,\n type IAiStreamTextDelta,\n type IAiStreamToolEvent,\n type IAiStreamToolUseStart,\n type IAiStreamToolUseDelta,\n type IAiStreamToolUseComplete,\n type IAiStreamDone,\n type IAiStreamError,\n type ModelSpec,\n type ModelSpecKey,\n type IModelSpecMap,\n allModelSpecKeys,\n MODEL_SPEC_BASE_KEY,\n resolveModel,\n type IModelAliasMap,\n MODEL_ALIAS_SIGIL,\n resolveModelAlias,\n resolveProviderModel,\n isResponsesOnlyModel,\n isAdaptiveThinkingModel,\n usesMaxCompletionTokensField,\n toDataUrl,\n type AiThinkingMode,\n type IThinkingConfig,\n type IThinkingProviderConfig,\n type IAnthropicThinkingOptions,\n type IOpenAiThinkingOptions,\n type IGeminiThinkingOptions,\n type IXAiThinkingOptions,\n type IOtherThinkingOptions,\n type IAnthropicThinkingConfig,\n type IOpenAiThinkingConfig,\n type IGeminiThinkingConfig,\n type IXAiThinkingConfig,\n type AnthropicThinkingModelNames,\n type OpenAiThinkingModelNames,\n type GeminiThinkingModelNames,\n type XAiThinkingModelNames\n} from './model';\n\nexport {\n type IResolvedImageOptions,\n resolveImageOptions,\n validateResolvedOptions\n} from './imageOptionsResolver';\n\nexport {\n allProviderIds,\n getProviderDescriptors,\n getProviderDescriptor,\n resolveImageCapability,\n supportsImageGeneration,\n resolveEmbeddingCapability,\n supportsEmbedding,\n DEFAULT_MODEL_CAPABILITY_CONFIG\n} from './registry';\n\nexport {\n callProviderCompletion,\n callProxiedCompletion,\n callProviderImageGeneration,\n callProxiedImageGeneration,\n callProviderListModels,\n callProxiedListModels,\n type IProviderCompletionParams,\n type IProviderImageGenerationParams,\n type IProviderListModelsParams\n} from './apiClient';\n\nexport {\n callProviderEmbedding,\n callProxiedEmbedding,\n type IProviderEmbeddingParams\n} from './embeddingClient';\n\nexport {\n callProviderCompletionStream,\n callProxiedCompletionStream,\n type IProviderCompletionStreamParams,\n executeClientToolTurn,\n type IExecuteClientToolTurnParams,\n type IExecuteClientToolTurnResult,\n type IToolExecutionDecision\n} from './streamingClient';\n\nexport {\n aiProviderId,\n aiServerToolType,\n aiWebSearchToolConfig,\n aiServerToolConfig,\n aiToolAnnotations,\n aiClientToolConfig,\n aiToolEnablement,\n aiAssistProviderConfig,\n aiAssistSettings,\n modelSpecKey,\n modelSpec\n} from './converters';\n\nexport { resolveEffectiveTools } from './toolFormats';\n\nexport {\n classifyJsonParseFailure,\n extractJsonText,\n fencedStringifiedJson,\n type IFencedStringifiedJsonExtractorOptions,\n type IFencedStringifiedJsonOptions,\n type JsonParseFailureReason,\n type JsonTextExtractor\n} from './jsonResponse';\n\nexport {\n generateJsonCompletion,\n SMART_JSON_PROMPT_HINT,\n type IGenerateJsonCompletionParams,\n type IGenerateJsonCompletionResult,\n type JsonPromptHint\n} from './jsonCompletion';\n\nexport { anthropicEffortToBudgetTokens, type IResolvedThinkingConfig } from './thinkingOptionsResolver';\n"]}
@@ -44,6 +44,102 @@ export type JsonTextExtractor = (text: string) => Result<string>;
44
44
  * @public
45
45
  */
46
46
  export declare const extractJsonText: JsonTextExtractor;
47
+ /**
48
+ * Typed reason a JSON-shaped LLM response failed to parse, so a caller can
49
+ * branch on the failure class instead of regex-matching the engine's
50
+ * `JSON.parse` message (whose wording varies across V8 / Node versions).
51
+ *
52
+ * Every classified arm describes a fault at an **object property-name
53
+ * position** — the position an LLM most often gets wrong, and the one whose
54
+ * repair strategy differs most by case:
55
+ *
56
+ * - `'unquoted-property-name'`: a bare identifier where a quoted name belongs
57
+ * (`{ key: 1 }`). `token` is the identifier run, `offset` its first
58
+ * character. Identifier recognition is ASCII-only, so a non-ASCII bare name
59
+ * (`{ ключ: 1 }`) reports `'unknown'` rather than being named.
60
+ * - `'single-quoted-property-name'`: a single-quoted name (`{ 'key': 1 }`).
61
+ * `token` is the quoted literal (or just `'` if it never closes), `offset`
62
+ * the opening quote.
63
+ * - `'unterminated-property-name'`: a name whose closing `"` is missing, and
64
+ * whose body swallowed structural text (`{ "key: 1 }`). `token` is the
65
+ * unterminated fragment, `offset` the opening quote.
66
+ * - `'elided-member'`: a `,` where a member is expected — a leading or doubled
67
+ * comma in an object (`{ , "a": 1 }`, `{ "a":1, , "b":2 }`) or an array
68
+ * (`[1, , 2]`). `token` is `','`, `offset` its position.
69
+ * - `'unknown'`: the catch-all. The scan reached the end of the text, or hit a
70
+ * fault it cannot name with confidence, and reports nothing rather than
71
+ * guessing. Truncated responses, missing colons, trailing commas, bad number
72
+ * literals, and anything else not listed above land here.
73
+ *
74
+ * `offset` is a 0-based index into the `text` passed to
75
+ * {@link AiAssist.classifyJsonParseFailure}, not into the extracted substring.
76
+ * @public
77
+ */
78
+ export type JsonParseFailureReason = {
79
+ readonly kind: 'unquoted-property-name';
80
+ readonly token: string;
81
+ readonly offset: number;
82
+ } | {
83
+ readonly kind: 'single-quoted-property-name';
84
+ readonly token: string;
85
+ readonly offset: number;
86
+ } | {
87
+ readonly kind: 'unterminated-property-name';
88
+ readonly token: string;
89
+ readonly offset: number;
90
+ } | {
91
+ readonly kind: 'elided-member';
92
+ readonly token: string;
93
+ readonly offset: number;
94
+ } | {
95
+ readonly kind: 'unknown';
96
+ };
97
+ /**
98
+ * Classifies why a JSON-shaped LLM response would not parse, returning a
99
+ * {@link AiAssist.JsonParseFailureReason} a caller can branch on — repair the
100
+ * cheap cases, re-prompt the expensive ones, fail outright on the rest —
101
+ * instead of regex-matching an engine-specific `JSON.parse` message.
102
+ *
103
+ * Pass the same raw model text you handed
104
+ * {@link AiAssist.fencedStringifiedJson} or {@link AiAssist.extractJsonText};
105
+ * this applies the same BOM / whitespace / fence / preamble handling before
106
+ * scanning, and reports `offset` against that original text.
107
+ *
108
+ * Classification is **structural and deliberately conservative**. The scan
109
+ * walks the JSON grammar itself rather than reading the engine's error string,
110
+ * so its verdicts are stable across Node versions — and any fault it cannot
111
+ * name with confidence comes back as `'unknown'` rather than a guess. In
112
+ * particular an input that opened a structure and never closed it (the
113
+ * truncated-response shape {@link AiAssist.extractJsonText} already diagnoses)
114
+ * classifies as `'unknown'` here; the two diagnostics are complementary, not
115
+ * competing.
116
+ *
117
+ * This never fails and never repairs — it only names the fault. It is a
118
+ * diagnostic on the failure path, so calling it on text that parses fine is
119
+ * harmless but pointless: it returns `'unknown'`.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * const parsed = fencedStringifiedJson({ inner }).convert(raw);
124
+ * if (parsed.isFailure()) {
125
+ * const reason = classifyJsonParseFailure(raw);
126
+ * switch (reason.kind) {
127
+ * case 'unquoted-property-name': // cheap to repair
128
+ * case 'single-quoted-property-name':
129
+ * break;
130
+ * case 'elided-member':
131
+ * case 'unterminated-property-name': // worth a re-prompt
132
+ * break;
133
+ * default: // 'unknown' — fail outright
134
+ * }
135
+ * }
136
+ * ```
137
+ *
138
+ * @param text - Raw model output (the same string handed to the extractor).
139
+ * @returns A {@link AiAssist.JsonParseFailureReason}.
140
+ * @public
141
+ */
142
+ export declare function classifyJsonParseFailure(text: string): JsonParseFailureReason;
47
143
  /**
48
144
  * Options shared by every {@link AiAssist.fencedStringifiedJson} call.
49
145
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"jsonResponse.d.ts","sourceRoot":"","sources":["../../../src/packlets/ai-assist/jsonResponse.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAc,KAAK,SAAS,EAAQ,MAAM,EAAW,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAErF;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC;AAgFjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,eAAe,EAAE,iBAmC7B,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B,CAAC,CAAC,CAAE,SAAQ,sCAAsC;IAC9F,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,sCAAsC,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AAC9G;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"jsonResponse.d.ts","sourceRoot":"","sources":["../../../src/packlets/ai-assist/jsonResponse.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAc,KAAK,SAAS,EAAQ,MAAM,EA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AiB,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B,CAAC,CAAC,CAAE,SAAQ,sCAAsC;IAC9F,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,sCAAsC,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AAC9G;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC"}
@@ -20,6 +20,7 @@
20
20
  // SOFTWARE.
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.extractJsonText = void 0;
23
+ exports.classifyJsonParseFailure = classifyJsonParseFailure;
23
24
  exports.fencedStringifiedJson = fencedStringifiedJson;
24
25
  /**
25
26
  * JSON-tolerant extraction and converters for LLM responses.
@@ -37,7 +38,11 @@ exports.fencedStringifiedJson = fencedStringifiedJson;
37
38
  */
38
39
  const ts_utils_1 = require("@fgv/ts-utils");
39
40
  const ts_json_base_1 = require("@fgv/ts-json-base");
40
- const FENCED_BLOCK = /```[A-Za-z0-9_-]*\s*\r?\n([\s\S]*?)\r?\n?```/;
41
+ // Group 1 is the opening fence (marker, optional language tag, newline) and
42
+ // group 2 is the fenced body. Group 1 is captured only so a caller that needs
43
+ // to map a position inside the body back onto an offset in the original text
44
+ // can add its length instead of re-deriving the fence header.
45
+ const FENCED_BLOCK = /(```[A-Za-z0-9_-]*\s*\r?\n)([\s\S]*?)\r?\n?```/;
41
46
  const BOM = /^\uFEFF/;
42
47
  // Full RFC 8259 grammar so the extractor only succeeds when the entire
43
48
  // candidate parses as a JSON primitive (instead of just starting like one).
@@ -92,11 +97,36 @@ function findBalancedJsonSubstring(text) {
92
97
  else if (ch === close) {
93
98
  depth--;
94
99
  if (depth === 0) {
95
- return { kind: 'found', value: text.slice(start, i + 1) };
100
+ return { kind: 'found', value: text.slice(start, i + 1), start };
96
101
  }
97
102
  }
98
103
  }
99
- return start >= 0 ? { kind: 'unclosed', depth } : { kind: 'none' };
104
+ return start >= 0 ? { kind: 'unclosed', depth, start } : { kind: 'none' };
105
+ }
106
+ /**
107
+ * Strips the wrappers a model adds around JSON — byte-order mark, surrounding
108
+ * whitespace, Markdown code fence — and reports where what is left starts in
109
+ * the original text.
110
+ *
111
+ * Single source of truth for that step: {@link extractJsonText} and
112
+ * {@link classifyJsonParseFailure} must agree on what the candidate is, or a
113
+ * classified `offset` would point into text the extractor never parsed.
114
+ * @internal
115
+ */
116
+ function locateJsonCandidate(text) {
117
+ const noBom = stripBom(text);
118
+ const stripped = noBom.trim();
119
+ const strippedBase = text.length - noBom.length + (noBom.length - noBom.trimStart().length);
120
+ const fenced = FENCED_BLOCK.exec(stripped);
121
+ if (fenced === null) {
122
+ return { stripped, text: stripped, base: strippedBase };
123
+ }
124
+ const body = fenced[2];
125
+ return {
126
+ stripped,
127
+ text: body.trim(),
128
+ base: strippedBase + fenced.index + fenced[1].length + (body.length - body.trimStart().length)
129
+ };
100
130
  }
101
131
  /**
102
132
  * Default {@link AiAssist.JsonTextExtractor | extractor} for LLM responses. Tolerates:
@@ -124,12 +154,11 @@ const extractJsonText = (text) => {
124
154
  if (typeof text !== 'string') {
125
155
  return (0, ts_utils_1.fail)('extractJsonText: input must be a string.');
126
156
  }
127
- const stripped = stripBom(text).trim();
128
- if (stripped.length === 0) {
157
+ const located = locateJsonCandidate(text);
158
+ if (located.stripped.length === 0) {
129
159
  return (0, ts_utils_1.fail)('extractJsonText: input is empty.');
130
160
  }
131
- const fenced = FENCED_BLOCK.exec(stripped);
132
- const candidate = fenced ? fenced[1].trim() : stripped;
161
+ const candidate = located.text;
133
162
  if (candidate.length === 0) {
134
163
  return (0, ts_utils_1.fail)('extractJsonText: no JSON content found.');
135
164
  }
@@ -150,6 +179,241 @@ const extractJsonText = (text) => {
150
179
  return (0, ts_utils_1.fail)('extractJsonText: no JSON-shaped substring found.');
151
180
  };
152
181
  exports.extractJsonText = extractJsonText;
182
+ const UNKNOWN_PARSE_FAILURE = { kind: 'unknown' };
183
+ const JSON_WHITESPACE = /[ \t\n\r]/;
184
+ const IDENTIFIER_START = /[A-Za-z0-9_$]/;
185
+ const IDENTIFIER_PART = /[A-Za-z0-9_$.-]/;
186
+ // Characters that end an unquoted value run (`true`, `null`, a number, or
187
+ // garbage). Includes ':' so a stray colon at a value position produces an
188
+ // empty run — reported as 'unknown' — instead of being swallowed by a literal.
189
+ const VALUE_RUN_TERMINATOR = /[\s,}\]:"'{[]/;
190
+ function scanQuotedRun(text, start, quote) {
191
+ let escape = false;
192
+ for (let i = start + 1; i < text.length; i++) {
193
+ const ch = text.charAt(i);
194
+ if (escape) {
195
+ escape = false;
196
+ }
197
+ else if (ch === '\\') {
198
+ escape = true;
199
+ }
200
+ else if (ch === quote) {
201
+ return { terminated: true, end: i + 1, body: text.slice(start + 1, i) };
202
+ }
203
+ }
204
+ return { terminated: false, end: text.length, body: text.slice(start + 1) };
205
+ }
206
+ function skipJsonWhitespace(text, from) {
207
+ let i = from;
208
+ while (i < text.length && JSON_WHITESPACE.test(text.charAt(i))) {
209
+ i++;
210
+ }
211
+ return i;
212
+ }
213
+ function scanRun(text, from, isPart) {
214
+ let i = from;
215
+ while (i < text.length && isPart(text.charAt(i))) {
216
+ i++;
217
+ }
218
+ return text.slice(from, i);
219
+ }
220
+ function classifyAtPropertyName(text, i, base) {
221
+ const ch = text.charAt(i);
222
+ if (ch === '"') {
223
+ const scan = scanQuotedRun(text, i, '"');
224
+ if (scan.terminated) {
225
+ return { next: scan.end };
226
+ }
227
+ // An unterminated name is only distinguishable from a mid-name truncation
228
+ // when the swallowed body contains structural text — a ':' the author
229
+ // plainly meant as the name/value separator. Without that, stay honest.
230
+ return scan.body.includes(':')
231
+ ? { reason: { kind: 'unterminated-property-name', token: text.slice(i), offset: base + i } }
232
+ : { reason: UNKNOWN_PARSE_FAILURE };
233
+ }
234
+ if (ch === "'") {
235
+ const scan = scanQuotedRun(text, i, "'");
236
+ return {
237
+ reason: {
238
+ kind: 'single-quoted-property-name',
239
+ token: scan.terminated ? text.slice(i, scan.end) : "'",
240
+ offset: base + i
241
+ }
242
+ };
243
+ }
244
+ if (ch === ',') {
245
+ return { reason: { kind: 'elided-member', token: ',', offset: base + i } };
246
+ }
247
+ if (IDENTIFIER_START.test(ch)) {
248
+ return {
249
+ reason: {
250
+ kind: 'unquoted-property-name',
251
+ token: scanRun(text, i, (c) => IDENTIFIER_PART.test(c)),
252
+ offset: base + i
253
+ }
254
+ };
255
+ }
256
+ return { reason: UNKNOWN_PARSE_FAILURE };
257
+ }
258
+ /**
259
+ * Walks `text` from `from` (the opening `{` or `[`) as a permissive JSON
260
+ * scanner, reporting the first fault it can name with confidence. Anything it
261
+ * cannot name — including a document that scans clean — yields `'unknown'`.
262
+ *
263
+ * The scan is structural: it never reads the engine's `JSON.parse` message, so
264
+ * its verdicts do not drift with the Node version.
265
+ * @internal
266
+ */
267
+ function scanForParseFailure(text, from, base) {
268
+ const stack = [];
269
+ let expect = 'value';
270
+ let i = from;
271
+ for (;;) {
272
+ i = skipJsonWhitespace(text, i);
273
+ if (i >= text.length) {
274
+ return UNKNOWN_PARSE_FAILURE;
275
+ }
276
+ const ch = text.charAt(i);
277
+ const top = stack[stack.length - 1];
278
+ if (expect === 'name') {
279
+ if (ch === '}') {
280
+ stack.pop();
281
+ i++;
282
+ expect = 'comma';
283
+ continue;
284
+ }
285
+ const outcome = classifyAtPropertyName(text, i, base);
286
+ if ('reason' in outcome) {
287
+ return outcome.reason;
288
+ }
289
+ i = outcome.next;
290
+ expect = 'colon';
291
+ continue;
292
+ }
293
+ if (expect === 'colon') {
294
+ if (ch !== ':') {
295
+ return UNKNOWN_PARSE_FAILURE;
296
+ }
297
+ i++;
298
+ expect = 'value';
299
+ continue;
300
+ }
301
+ if (expect === 'value') {
302
+ if (ch === '{' || ch === '[') {
303
+ stack.push(ch === '{' ? 'object' : 'array');
304
+ i++;
305
+ expect = ch === '{' ? 'name' : 'value';
306
+ continue;
307
+ }
308
+ if (ch === ']' && top === 'array') {
309
+ stack.pop();
310
+ i++;
311
+ expect = 'comma';
312
+ continue;
313
+ }
314
+ if (ch === ',') {
315
+ return top === 'array'
316
+ ? { kind: 'elided-member', token: ',', offset: base + i }
317
+ : UNKNOWN_PARSE_FAILURE;
318
+ }
319
+ if (ch === '"') {
320
+ const scan = scanQuotedRun(text, i, '"');
321
+ if (!scan.terminated) {
322
+ // Could equally be a truncated value; the extractor already names
323
+ // truncation, so do not compete with it here.
324
+ return UNKNOWN_PARSE_FAILURE;
325
+ }
326
+ i = scan.end;
327
+ expect = 'comma';
328
+ continue;
329
+ }
330
+ const literal = scanRun(text, i, (c) => !VALUE_RUN_TERMINATOR.test(c));
331
+ if (literal.length === 0) {
332
+ return UNKNOWN_PARSE_FAILURE;
333
+ }
334
+ i += literal.length;
335
+ expect = 'comma';
336
+ continue;
337
+ }
338
+ // expect === 'comma': a complete value just closed.
339
+ if (top === undefined) {
340
+ return UNKNOWN_PARSE_FAILURE;
341
+ }
342
+ if (ch === ',') {
343
+ i++;
344
+ expect = top === 'object' ? 'name' : 'value';
345
+ continue;
346
+ }
347
+ if ((ch === '}' && top === 'object') || (ch === ']' && top === 'array')) {
348
+ stack.pop();
349
+ i++;
350
+ continue;
351
+ }
352
+ return UNKNOWN_PARSE_FAILURE;
353
+ }
354
+ }
355
+ /**
356
+ * Classifies why a JSON-shaped LLM response would not parse, returning a
357
+ * {@link AiAssist.JsonParseFailureReason} a caller can branch on — repair the
358
+ * cheap cases, re-prompt the expensive ones, fail outright on the rest —
359
+ * instead of regex-matching an engine-specific `JSON.parse` message.
360
+ *
361
+ * Pass the same raw model text you handed
362
+ * {@link AiAssist.fencedStringifiedJson} or {@link AiAssist.extractJsonText};
363
+ * this applies the same BOM / whitespace / fence / preamble handling before
364
+ * scanning, and reports `offset` against that original text.
365
+ *
366
+ * Classification is **structural and deliberately conservative**. The scan
367
+ * walks the JSON grammar itself rather than reading the engine's error string,
368
+ * so its verdicts are stable across Node versions — and any fault it cannot
369
+ * name with confidence comes back as `'unknown'` rather than a guess. In
370
+ * particular an input that opened a structure and never closed it (the
371
+ * truncated-response shape {@link AiAssist.extractJsonText} already diagnoses)
372
+ * classifies as `'unknown'` here; the two diagnostics are complementary, not
373
+ * competing.
374
+ *
375
+ * This never fails and never repairs — it only names the fault. It is a
376
+ * diagnostic on the failure path, so calling it on text that parses fine is
377
+ * harmless but pointless: it returns `'unknown'`.
378
+ *
379
+ * @example
380
+ * ```ts
381
+ * const parsed = fencedStringifiedJson({ inner }).convert(raw);
382
+ * if (parsed.isFailure()) {
383
+ * const reason = classifyJsonParseFailure(raw);
384
+ * switch (reason.kind) {
385
+ * case 'unquoted-property-name': // cheap to repair
386
+ * case 'single-quoted-property-name':
387
+ * break;
388
+ * case 'elided-member':
389
+ * case 'unterminated-property-name': // worth a re-prompt
390
+ * break;
391
+ * default: // 'unknown' — fail outright
392
+ * }
393
+ * }
394
+ * ```
395
+ *
396
+ * @param text - Raw model output (the same string handed to the extractor).
397
+ * @returns A {@link AiAssist.JsonParseFailureReason}.
398
+ * @public
399
+ */
400
+ function classifyJsonParseFailure(text) {
401
+ // Defensive, and load-bearing for the documented totality: the signature says
402
+ // `string`, but a JS consumer — or a TS caller coming through an `unknown` /
403
+ // `any` escape hatch — can still hand us a non-string, and `locateJsonCandidate`
404
+ // would throw on it. `extractJsonText` already guards the same way; this keeps
405
+ // the pair consistent and keeps "never fails" true in practice rather than only
406
+ // under a well-typed caller.
407
+ if (typeof text !== 'string') {
408
+ return UNKNOWN_PARSE_FAILURE;
409
+ }
410
+ const candidate = locateJsonCandidate(text);
411
+ const scan = findBalancedJsonSubstring(candidate.text);
412
+ if (scan.kind === 'none') {
413
+ return UNKNOWN_PARSE_FAILURE;
414
+ }
415
+ return scanForParseFailure(candidate.text, scan.start, candidate.base);
416
+ }
153
417
  function fencedStringifiedJson(options) {
154
418
  var _a;
155
419
  const extractor = (_a = options === null || options === void 0 ? void 0 : options.extractor) !== null && _a !== void 0 ? _a : exports.extractJsonText;