@fgv/ts-extras 5.1.0-44 → 5.1.0-46

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 (88) hide show
  1. package/dist/packlets/ai-assist/apiClient.js +38 -14
  2. package/dist/packlets/ai-assist/apiClient.js.map +1 -1
  3. package/dist/packlets/ai-assist/index.js +2 -2
  4. package/dist/packlets/ai-assist/index.js.map +1 -1
  5. package/dist/packlets/ai-assist/jsonResponse.js +284 -10
  6. package/dist/packlets/ai-assist/jsonResponse.js.map +1 -1
  7. package/dist/packlets/ai-assist/model.js +108 -0
  8. package/dist/packlets/ai-assist/model.js.map +1 -1
  9. package/dist/packlets/ai-assist/registry.js +75 -17
  10. package/dist/packlets/ai-assist/registry.js.map +1 -1
  11. package/dist/packlets/ai-assist/streamingAdapters/anthropic.js +17 -6
  12. package/dist/packlets/ai-assist/streamingAdapters/anthropic.js.map +1 -1
  13. package/dist/packlets/ai-assist/streamingAdapters/clientToolContinuationBuilder.js +5 -5
  14. package/dist/packlets/ai-assist/streamingAdapters/clientToolContinuationBuilder.js.map +1 -1
  15. package/dist/packlets/ai-assist/streamingAdapters/common.js.map +1 -1
  16. package/dist/packlets/ai-assist/streamingAdapters/gemini.js +4 -1
  17. package/dist/packlets/ai-assist/streamingAdapters/gemini.js.map +1 -1
  18. package/dist/packlets/ai-assist/streamingAdapters/openaiChat.js +6 -1
  19. package/dist/packlets/ai-assist/streamingAdapters/openaiChat.js.map +1 -1
  20. package/dist/packlets/ai-assist/streamingAdapters/openaiResponses.js +5 -1
  21. package/dist/packlets/ai-assist/streamingAdapters/openaiResponses.js.map +1 -1
  22. package/dist/packlets/ai-assist/streamingAdapters/proxy.js +6 -1
  23. package/dist/packlets/ai-assist/streamingAdapters/proxy.js.map +1 -1
  24. package/dist/packlets/ai-assist/streamingClient.js +6 -6
  25. package/dist/packlets/ai-assist/streamingClient.js.map +1 -1
  26. package/dist/packlets/zip-file-tree/zipFileTreeAccessors.js +65 -7
  27. package/dist/packlets/zip-file-tree/zipFileTreeAccessors.js.map +1 -1
  28. package/dist/packlets/zip-file-tree/zipFileTreeWriter.js +16 -1
  29. package/dist/packlets/zip-file-tree/zipFileTreeWriter.js.map +1 -1
  30. package/dist/ts-extras.d.ts +396 -14
  31. package/lib/packlets/ai-assist/apiClient.d.ts +9 -0
  32. package/lib/packlets/ai-assist/apiClient.d.ts.map +1 -1
  33. package/lib/packlets/ai-assist/apiClient.js +37 -13
  34. package/lib/packlets/ai-assist/apiClient.js.map +1 -1
  35. package/lib/packlets/ai-assist/index.d.ts +2 -2
  36. package/lib/packlets/ai-assist/index.d.ts.map +1 -1
  37. package/lib/packlets/ai-assist/index.js +7 -1
  38. package/lib/packlets/ai-assist/index.js.map +1 -1
  39. package/lib/packlets/ai-assist/jsonResponse.d.ts +103 -0
  40. package/lib/packlets/ai-assist/jsonResponse.d.ts.map +1 -1
  41. package/lib/packlets/ai-assist/jsonResponse.js +285 -10
  42. package/lib/packlets/ai-assist/jsonResponse.js.map +1 -1
  43. package/lib/packlets/ai-assist/model.d.ts +144 -1
  44. package/lib/packlets/ai-assist/model.d.ts.map +1 -1
  45. package/lib/packlets/ai-assist/model.js +112 -1
  46. package/lib/packlets/ai-assist/model.js.map +1 -1
  47. package/lib/packlets/ai-assist/registry.d.ts +26 -6
  48. package/lib/packlets/ai-assist/registry.d.ts.map +1 -1
  49. package/lib/packlets/ai-assist/registry.js +75 -17
  50. package/lib/packlets/ai-assist/registry.js.map +1 -1
  51. package/lib/packlets/ai-assist/streamingAdapters/anthropic.d.ts +1 -1
  52. package/lib/packlets/ai-assist/streamingAdapters/anthropic.d.ts.map +1 -1
  53. package/lib/packlets/ai-assist/streamingAdapters/anthropic.js +17 -6
  54. package/lib/packlets/ai-assist/streamingAdapters/anthropic.js.map +1 -1
  55. package/lib/packlets/ai-assist/streamingAdapters/clientToolContinuationBuilder.d.ts +9 -0
  56. package/lib/packlets/ai-assist/streamingAdapters/clientToolContinuationBuilder.d.ts.map +1 -1
  57. package/lib/packlets/ai-assist/streamingAdapters/clientToolContinuationBuilder.js +4 -4
  58. package/lib/packlets/ai-assist/streamingAdapters/clientToolContinuationBuilder.js.map +1 -1
  59. package/lib/packlets/ai-assist/streamingAdapters/common.d.ts +9 -0
  60. package/lib/packlets/ai-assist/streamingAdapters/common.d.ts.map +1 -1
  61. package/lib/packlets/ai-assist/streamingAdapters/common.js.map +1 -1
  62. package/lib/packlets/ai-assist/streamingAdapters/gemini.d.ts +1 -1
  63. package/lib/packlets/ai-assist/streamingAdapters/gemini.d.ts.map +1 -1
  64. package/lib/packlets/ai-assist/streamingAdapters/gemini.js +4 -1
  65. package/lib/packlets/ai-assist/streamingAdapters/gemini.js.map +1 -1
  66. package/lib/packlets/ai-assist/streamingAdapters/openaiChat.d.ts +1 -1
  67. package/lib/packlets/ai-assist/streamingAdapters/openaiChat.d.ts.map +1 -1
  68. package/lib/packlets/ai-assist/streamingAdapters/openaiChat.js +6 -1
  69. package/lib/packlets/ai-assist/streamingAdapters/openaiChat.js.map +1 -1
  70. package/lib/packlets/ai-assist/streamingAdapters/openaiResponses.d.ts +1 -1
  71. package/lib/packlets/ai-assist/streamingAdapters/openaiResponses.d.ts.map +1 -1
  72. package/lib/packlets/ai-assist/streamingAdapters/openaiResponses.js +5 -1
  73. package/lib/packlets/ai-assist/streamingAdapters/openaiResponses.js.map +1 -1
  74. package/lib/packlets/ai-assist/streamingAdapters/proxy.d.ts.map +1 -1
  75. package/lib/packlets/ai-assist/streamingAdapters/proxy.js +6 -1
  76. package/lib/packlets/ai-assist/streamingAdapters/proxy.js.map +1 -1
  77. package/lib/packlets/ai-assist/streamingClient.d.ts.map +1 -1
  78. package/lib/packlets/ai-assist/streamingClient.js +5 -5
  79. package/lib/packlets/ai-assist/streamingClient.js.map +1 -1
  80. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.d.ts +54 -6
  81. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.d.ts.map +1 -1
  82. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.js +65 -7
  83. package/lib/packlets/zip-file-tree/zipFileTreeAccessors.js.map +1 -1
  84. package/lib/packlets/zip-file-tree/zipFileTreeWriter.d.ts +26 -1
  85. package/lib/packlets/zip-file-tree/zipFileTreeWriter.d.ts.map +1 -1
  86. package/lib/packlets/zip-file-tree/zipFileTreeWriter.js +17 -1
  87. package/lib/packlets/zip-file-tree/zipFileTreeWriter.js.map +1 -1
  88. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"jsonResponse.js","sourceRoot":"","sources":["../../../src/packlets/ai-assist/jsonResponse.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;AA4LZ,sDAcC;AAxMD;;;;;;;;;;;;;GAaG;AAEH,4CAAkG;AAClG,oDAAqF;AAUrF,MAAM,YAAY,GAAW,8CAA8C,CAAC;AAC5E,MAAM,GAAG,GAAW,SAAS,CAAC;AAC9B,uEAAuE;AACvE,4EAA4E;AAC5E,MAAM,WAAW,GAAW,+CAA+C,CAAC;AAC5E,4CAA4C;AAC5C,MAAM,WAAW,GAAW,gEAAgE,CAAC;AAC7F,MAAM,YAAY,GAAW,uBAAuB,CAAC;AAErD,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAY;IAC7C,yEAAyE;IACzE,sEAAsE;IACtE,yEAAyE;IACzE,WAAW;IACX,IAAI,QAAQ,GAAG,KAAK,CAAC;IAC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,EAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,IAAA,eAAI,EAAC,kDAAkD,CAAC,CAAC;AAClE,CAAC,CAAC;AA7BW,QAAA,eAAe,mBA6B1B;AAuDF,SAAgB,qBAAqB,CACnC,OAAmF;;IAEnF,MAAM,SAAS,GAAsB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,mCAAI,uBAAe,CAAC;IAC3E,MAAM,KAAK,GAAI,OAAwD,aAAxD,OAAO,uBAAP,OAAO,CAAmD,KAAK,CAAC;IAC/E,MAAM,MAAM,GACV,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,yBAAkB,CAAC,eAAe,CAAI,KAAK,CAAC,CAAC,CAAC,CAAC,yBAAkB,CAAC,eAAe,EAAE,CAAC;IAE5G,OAAO,IAAI,qBAAU,CAAC,aAAa,CAAgB,CAAC,IAAa,EAAyB,EAAE;QAC1F,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,IAAA,eAAI,EAAC,gDAAgD,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) 2026 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 * JSON-tolerant extraction and converters for LLM responses.\n *\n * Models commonly wrap JSON output in Markdown code fences, add a\n * \"Sure, here's the JSON:\" preamble, or trail off with prose after the\n * closing brace. These helpers normalize that quirk on the read side so every\n * AiAssist consumer can reach a validated `T` from raw model text without\n * reimplementing the same fence-stripping logic.\n *\n * Scope: strip wrappers (fences, prose, BOM, whitespace). Out of scope: repair\n * malformed JSON (missing commas, unquoted keys, smart quotes, etc.).\n *\n * @packageDocumentation\n */\n\nimport { Conversion, type Converter, fail, Result, succeed, type Validator } from '@fgv/ts-utils';\nimport { Converters as JsonBaseConverters, type JsonValue } from '@fgv/ts-json-base';\n\n/**\n * A function that pulls a JSON-shaped substring out of arbitrary model text.\n * Implementations strip whatever wrappers the model added (fences, preamble,\n * trailing prose) and return the JSON-shaped substring ready for `JSON.parse`.\n * @public\n */\nexport type JsonTextExtractor = (text: string) => Result<string>;\n\nconst FENCED_BLOCK: RegExp = /```[A-Za-z0-9_-]*\\s*\\r?\\n([\\s\\S]*?)\\r?\\n?```/;\nconst BOM: RegExp = /^\\uFEFF/;\n// Full RFC 8259 grammar so the extractor only succeeds when the entire\n// candidate parses as a JSON primitive (instead of just starting like one).\nconst JSON_NUMBER: RegExp = /^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$/;\n// eslint-disable-next-line no-control-regex\nconst JSON_STRING: RegExp = /^\"(?:[^\"\\\\\\u0000-\\u001F]|\\\\(?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"$/;\nconst JSON_KEYWORD: RegExp = /^(?:true|false|null)$/;\n\nfunction stripBom(text: string): string {\n return text.replace(BOM, '');\n}\n\nfunction findBalancedJsonSubstring(text: string): string | undefined {\n // Walk the text once tracking string state. The first '{' or '[' that is\n // *outside* a quoted string is the candidate start; from there, count\n // matching close characters while ignoring delimiters that appear inside\n // strings.\n let inString = false;\n let escape = false;\n let start = -1;\n let open = '';\n let close = '';\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const ch = text.charAt(i);\n if (inString) {\n if (escape) {\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === '\"') {\n inString = false;\n }\n continue;\n }\n if (ch === '\"') {\n inString = true;\n continue;\n }\n if (start < 0) {\n if (ch === '{' || ch === '[') {\n start = i;\n open = ch;\n close = ch === '{' ? '}' : ']';\n depth = 1;\n }\n continue;\n }\n if (ch === open) {\n depth++;\n } else if (ch === close) {\n depth--;\n if (depth === 0) {\n return text.slice(start, i + 1);\n }\n }\n }\n return undefined;\n}\n\n/**\n * Default {@link AiAssist.JsonTextExtractor | extractor} for LLM responses. Tolerates:\n *\n * - Leading/trailing whitespace and a leading byte-order mark.\n * - Markdown code fences (with or without a language tag).\n * - Conversational preamble before the first `{` or `[`.\n * - Trailing prose after the matched closing `}` or `]`.\n *\n * Out of scope: repairing malformed JSON, handling smart quotes, etc.\n *\n * @param text - Raw model output.\n * @returns A `Result<string>` containing the JSON-shaped substring, or a\n * `Failure` if no JSON-shaped substring was found.\n * @public\n */\nexport const extractJsonText: JsonTextExtractor = (text: string): Result<string> => {\n if (typeof text !== 'string') {\n return fail('extractJsonText: input must be a string.');\n }\n const stripped = stripBom(text).trim();\n if (stripped.length === 0) {\n return fail('extractJsonText: input is empty.');\n }\n\n const fenced = FENCED_BLOCK.exec(stripped);\n const candidate = fenced ? fenced[1].trim() : stripped;\n\n if (candidate.length === 0) {\n return fail('extractJsonText: no JSON content found.');\n }\n\n // Whole-candidate primitive check runs before the brace scan so that a\n // valid JSON string containing braces (e.g. `\"text with { }\"`) is returned\n // intact instead of being mangled into the first balanced `{ }` match.\n if (JSON_KEYWORD.test(candidate) || JSON_NUMBER.test(candidate) || JSON_STRING.test(candidate)) {\n return succeed(candidate);\n }\n\n const balanced = findBalancedJsonSubstring(candidate);\n if (balanced !== undefined) {\n return succeed(balanced);\n }\n\n return fail('extractJsonText: no JSON-shaped substring found.');\n};\n\n/**\n * Options shared by every {@link AiAssist.fencedStringifiedJson} call.\n * @public\n */\nexport interface IFencedStringifiedJsonExtractorOptions {\n /**\n * Optional pre-parse extractor. Defaults to {@link AiAssist.extractJsonText}.\n * Provide a custom extractor to handle response shapes the default does not\n * understand.\n */\n readonly extractor?: JsonTextExtractor;\n}\n\n/**\n * Options for the validating overload of {@link AiAssist.fencedStringifiedJson}.\n * `inner` is required so the typed `Converter<T>` return value can never lie\n * about the runtime shape.\n * @public\n */\nexport interface IFencedStringifiedJsonOptions<T> extends IFencedStringifiedJsonExtractorOptions {\n /** Inner converter or validator applied to the parsed JSON value. */\n readonly inner: Converter<T> | Validator<T>;\n}\n\n/**\n * Creates a `Converter` that accepts raw LLM response text, runs it through a\n * tolerant extractor (default: {@link AiAssist.extractJsonText}), parses the\n * extracted substring as JSON, and applies an optional inner converter or\n * validator.\n *\n * @example\n * ```ts\n * const converter = fencedStringifiedJson({ inner: myShapeConverter });\n * const result = converter.convert(llmText); // Result<MyShape>\n * ```\n *\n * @param options - Optional extractor; omit to keep the default. Without an\n * `inner` step, the converter resolves to the parsed `JsonValue`.\n * @returns A `Converter<JsonValue>`.\n * @public\n */\nexport function fencedStringifiedJson(options?: IFencedStringifiedJsonExtractorOptions): Converter<JsonValue>;\n/**\n * Creates a `Converter` that accepts raw LLM response text, runs it through a\n * tolerant extractor (default: {@link AiAssist.extractJsonText}), parses the\n * extracted substring as JSON, and applies the supplied inner converter or\n * validator.\n *\n * @param options - Required `inner` converter/validator and optional extractor.\n * @returns A `Converter<T>`.\n * @public\n */\nexport function fencedStringifiedJson<T>(options: IFencedStringifiedJsonOptions<T>): Converter<T>;\nexport function fencedStringifiedJson<T>(\n options?: IFencedStringifiedJsonExtractorOptions | IFencedStringifiedJsonOptions<T>\n): Converter<T | JsonValue> {\n const extractor: JsonTextExtractor = options?.extractor ?? extractJsonText;\n const inner = (options as IFencedStringifiedJsonOptions<T> | undefined)?.inner;\n const parser: Converter<T | JsonValue> =\n inner !== undefined ? JsonBaseConverters.stringifiedJson<T>(inner) : JsonBaseConverters.stringifiedJson();\n\n return new Conversion.BaseConverter<T | JsonValue>((from: unknown): Result<T | JsonValue> => {\n if (typeof from !== 'string') {\n return fail('fencedStringifiedJson: input must be a string.');\n }\n return extractor(from).onSuccess((extracted) => parser.convert(extracted));\n });\n}\n"]}
1
+ {"version":3,"file":"jsonResponse.js","sourceRoot":"","sources":["../../../src/packlets/ai-assist/jsonResponse.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;AA6eZ,4DAgBC;AAuDD,sDAcC;AAhkBD;;;;;;;;;;;;;GAaG;AAEH,4CAAkG;AAClG,oDAAqF;AAUrF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,8DAA8D;AAC9D,MAAM,YAAY,GAAW,gDAAgD,CAAC;AAC9E,MAAM,GAAG,GAAW,SAAS,CAAC;AAC9B,uEAAuE;AACvE,4EAA4E;AAC5E,MAAM,WAAW,GAAW,+CAA+C,CAAC;AAC5E,4CAA4C;AAC5C,MAAM,WAAW,GAAW,gEAAgE,CAAC;AAC7F,MAAM,YAAY,GAAW,uBAAuB,CAAC;AAErD,SAAS,QAAQ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,CAAE,SAAS,mCAAI,uBAAe,CAAC;IAC3E,MAAM,KAAK,GAAI,OAAwD,aAAxD,OAAO,uBAAP,OAAO,CAAmD,KAAK,CAAC;IAC/E,MAAM,MAAM,GACV,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,yBAAkB,CAAC,eAAe,CAAI,KAAK,CAAC,CAAC,CAAC,CAAC,yBAAkB,CAAC,eAAe,EAAE,CAAC;IAE5G,OAAO,IAAI,qBAAU,CAAC,aAAa,CAAgB,CAAC,IAAa,EAAyB,EAAE;QAC1F,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,IAAA,eAAI,EAAC,gDAAgD,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) 2026 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 * JSON-tolerant extraction and converters for LLM responses.\n *\n * Models commonly wrap JSON output in Markdown code fences, add a\n * \"Sure, here's the JSON:\" preamble, or trail off with prose after the\n * closing brace. These helpers normalize that quirk on the read side so every\n * AiAssist consumer can reach a validated `T` from raw model text without\n * reimplementing the same fence-stripping logic.\n *\n * Scope: strip wrappers (fences, prose, BOM, whitespace). Out of scope: repair\n * malformed JSON (missing commas, unquoted keys, smart quotes, etc.).\n *\n * @packageDocumentation\n */\n\nimport { Conversion, type Converter, fail, Result, succeed, type Validator } from '@fgv/ts-utils';\nimport { Converters as JsonBaseConverters, type JsonValue } from '@fgv/ts-json-base';\n\n/**\n * A function that pulls a JSON-shaped substring out of arbitrary model text.\n * Implementations strip whatever wrappers the model added (fences, preamble,\n * trailing prose) and return the JSON-shaped substring ready for `JSON.parse`.\n * @public\n */\nexport type JsonTextExtractor = (text: string) => Result<string>;\n\n// Group 1 is the opening fence (marker, optional language tag, newline) and\n// group 2 is the fenced body. Group 1 is captured only so a caller that needs\n// to map a position inside the body back onto an offset in the original text\n// can add its length instead of re-deriving the fence header.\nconst FENCED_BLOCK: RegExp = /(```[A-Za-z0-9_-]*\\s*\\r?\\n)([\\s\\S]*?)\\r?\\n?```/;\nconst BOM: RegExp = /^\\uFEFF/;\n// Full RFC 8259 grammar so the extractor only succeeds when the entire\n// candidate parses as a JSON primitive (instead of just starting like one).\nconst JSON_NUMBER: RegExp = /^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$/;\n// eslint-disable-next-line no-control-regex\nconst JSON_STRING: RegExp = /^\"(?:[^\"\\\\\\u0000-\\u001F]|\\\\(?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))*\"$/;\nconst JSON_KEYWORD: RegExp = /^(?:true|false|null)$/;\n\nfunction stripBom(text: string): string {\n return text.replace(BOM, '');\n}\n\n/**\n * Outcome of a {@link findBalancedJsonSubstring} scan.\n *\n * - `'found'`: a balanced JSON-shaped substring was located; `value` is it.\n * - `'unclosed'`: an object or array opened but the matching close never\n * arrived before the end of input — the classic truncated-response shape;\n * `depth` is the unresolved depth at end of input, counting only the\n * opening delimiter's type (the scan tracks the candidate's own `{`/`}`\n * or `[`/`]` pair, not total mixed-delimiter nesting).\n * - `'none'`: no `{` or `[` was ever seen outside a quoted string.\n *\n * `start` (present on `'found'` and `'unclosed'`) is the index of the opening\n * `{` or `[` within the scanned text.\n * @internal\n */\ntype BalancedJsonScanResult =\n | { readonly kind: 'found'; readonly value: string; readonly start: number }\n | { readonly kind: 'unclosed'; readonly depth: number; readonly start: number }\n | { readonly kind: 'none' };\n\nfunction findBalancedJsonSubstring(text: string): BalancedJsonScanResult {\n // Walk the text once tracking string state. The first '{' or '[' that is\n // *outside* a quoted string is the candidate start; from there, count\n // matching close characters while ignoring delimiters that appear inside\n // strings.\n let inString = false;\n let escape = false;\n let start = -1;\n let open = '';\n let close = '';\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const ch = text.charAt(i);\n if (inString) {\n if (escape) {\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === '\"') {\n inString = false;\n }\n continue;\n }\n if (ch === '\"') {\n inString = true;\n continue;\n }\n if (start < 0) {\n if (ch === '{' || ch === '[') {\n start = i;\n open = ch;\n close = ch === '{' ? '}' : ']';\n depth = 1;\n }\n continue;\n }\n if (ch === open) {\n depth++;\n } else if (ch === close) {\n depth--;\n if (depth === 0) {\n return { kind: 'found', value: text.slice(start, i + 1), start };\n }\n }\n }\n return start >= 0 ? { kind: 'unclosed', depth, start } : { kind: 'none' };\n}\n\n/**\n * The JSON-shaped candidate located within raw model text, plus where it\n * starts in that text.\n * @internal\n */\ninterface IJsonCandidate {\n /** The whole input after BOM strip and trim, before any fence unwrap. */\n readonly stripped: string;\n /** The candidate itself: the trimmed fenced body when fenced, else `stripped`. */\n readonly text: string;\n /** Index of `text`'s first character within the original input. */\n readonly base: number;\n}\n\n/**\n * Strips the wrappers a model adds around JSON — byte-order mark, surrounding\n * whitespace, Markdown code fence — and reports where what is left starts in\n * the original text.\n *\n * Single source of truth for that step: {@link extractJsonText} and\n * {@link classifyJsonParseFailure} must agree on what the candidate is, or a\n * classified `offset` would point into text the extractor never parsed.\n * @internal\n */\nfunction locateJsonCandidate(text: string): IJsonCandidate {\n const noBom = stripBom(text);\n const stripped = noBom.trim();\n const strippedBase = text.length - noBom.length + (noBom.length - noBom.trimStart().length);\n\n const fenced = FENCED_BLOCK.exec(stripped);\n if (fenced === null) {\n return { stripped, text: stripped, base: strippedBase };\n }\n const body = fenced[2];\n return {\n stripped,\n text: body.trim(),\n base: strippedBase + fenced.index + fenced[1].length + (body.length - body.trimStart().length)\n };\n}\n\n/**\n * Default {@link AiAssist.JsonTextExtractor | extractor} for LLM responses. Tolerates:\n *\n * - Leading/trailing whitespace and a leading byte-order mark.\n * - Markdown code fences (with or without a language tag).\n * - Conversational preamble before the first `{` or `[`.\n * - Trailing prose after the matched closing `}` or `]`.\n *\n * Out of scope: repairing malformed JSON, handling smart quotes, etc.\n *\n * When an object or array opens but never closes before the end of input —\n * the shape a response truncated by a token cap leaves behind — the failure\n * names that specifically (distinct from the generic \"no JSON-shaped\n * substring found\" for input that never looked like JSON at all) and points\n * at `IAiCompletionResponse.truncated` and the `maxTokens` request option as\n * the likely cause and fix.\n *\n * @param text - Raw model output.\n * @returns A `Result<string>` containing the JSON-shaped substring, or a\n * `Failure` if no JSON-shaped substring was found.\n * @public\n */\nexport const extractJsonText: JsonTextExtractor = (text: string): Result<string> => {\n if (typeof text !== 'string') {\n return fail('extractJsonText: input must be a string.');\n }\n const located = locateJsonCandidate(text);\n if (located.stripped.length === 0) {\n return fail('extractJsonText: input is empty.');\n }\n\n const candidate = located.text;\n if (candidate.length === 0) {\n return fail('extractJsonText: no JSON content found.');\n }\n\n // Whole-candidate primitive check runs before the brace scan so that a\n // valid JSON string containing braces (e.g. `\"text with { }\"`) is returned\n // intact instead of being mangled into the first balanced `{ }` match.\n if (JSON_KEYWORD.test(candidate) || JSON_NUMBER.test(candidate) || JSON_STRING.test(candidate)) {\n return succeed(candidate);\n }\n\n const scan = findBalancedJsonSubstring(candidate);\n if (scan.kind === 'found') {\n return succeed(scan.value);\n }\n if (scan.kind === 'unclosed') {\n return fail(\n `extractJsonText: JSON structure opened but never closed (depth ${scan.depth} at end of input) — ` +\n 'response may have been truncated (check IAiCompletionResponse.truncated / raise maxTokens).'\n );\n }\n\n return fail('extractJsonText: no JSON-shaped substring found.');\n};\n\n/**\n * Typed reason a JSON-shaped LLM response failed to parse, so a caller can\n * branch on the failure class instead of regex-matching the engine's\n * `JSON.parse` message (whose wording varies across V8 / Node versions).\n *\n * Every classified arm describes a fault at an **object property-name\n * position** — the position an LLM most often gets wrong, and the one whose\n * repair strategy differs most by case:\n *\n * - `'unquoted-property-name'`: a bare identifier where a quoted name belongs\n * (`{ key: 1 }`). `token` is the identifier run, `offset` its first\n * character. Identifier recognition is ASCII-only, so a non-ASCII bare name\n * (`{ ключ: 1 }`) reports `'unknown'` rather than being named.\n * - `'single-quoted-property-name'`: a single-quoted name (`{ 'key': 1 }`).\n * `token` is the quoted literal (or just `'` if it never closes), `offset`\n * the opening quote.\n * - `'unterminated-property-name'`: a name whose closing `\"` is missing, and\n * whose body swallowed structural text (`{ \"key: 1 }`). `token` is the\n * unterminated fragment, `offset` the opening quote.\n * - `'elided-member'`: a `,` where a member is expected — a leading or doubled\n * comma in an object (`{ , \"a\": 1 }`, `{ \"a\":1, , \"b\":2 }`) or an array\n * (`[1, , 2]`). `token` is `','`, `offset` its position.\n * - `'unknown'`: the catch-all. The scan reached the end of the text, or hit a\n * fault it cannot name with confidence, and reports nothing rather than\n * guessing. Truncated responses, missing colons, trailing commas, bad number\n * literals, and anything else not listed above land here.\n *\n * `offset` is a 0-based index into the `text` passed to\n * {@link AiAssist.classifyJsonParseFailure}, not into the extracted substring.\n * @public\n */\nexport type JsonParseFailureReason =\n | { readonly kind: 'unquoted-property-name'; readonly token: string; readonly offset: number }\n | { readonly kind: 'single-quoted-property-name'; readonly token: string; readonly offset: number }\n | { readonly kind: 'unterminated-property-name'; readonly token: string; readonly offset: number }\n | { readonly kind: 'elided-member'; readonly token: string; readonly offset: number }\n | { readonly kind: 'unknown' };\n\nconst UNKNOWN_PARSE_FAILURE: JsonParseFailureReason = { kind: 'unknown' };\n\nconst JSON_WHITESPACE: RegExp = /[ \\t\\n\\r]/;\nconst IDENTIFIER_START: RegExp = /[A-Za-z0-9_$]/;\nconst IDENTIFIER_PART: RegExp = /[A-Za-z0-9_$.-]/;\n// Characters that end an unquoted value run (`true`, `null`, a number, or\n// garbage). Includes ':' so a stray colon at a value position produces an\n// empty run — reported as 'unknown' — instead of being swallowed by a literal.\nconst VALUE_RUN_TERMINATOR: RegExp = /[\\s,}\\]:\"'{[]/;\n\n/** Where the parse scan currently is within the JSON grammar. @internal */\ntype JsonScanExpectation = 'value' | 'name' | 'colon' | 'comma';\n\n/** Result of scanning a quoted run starting at a given opening quote. @internal */\ninterface IQuotedRunScan {\n readonly terminated: boolean;\n /** Index just past the closing quote, or end of text when unterminated. */\n readonly end: number;\n /** Content between the quotes, exclusive. */\n readonly body: string;\n}\n\nfunction scanQuotedRun(text: string, start: number, quote: string): IQuotedRunScan {\n let escape = false;\n for (let i = start + 1; i < text.length; i++) {\n const ch = text.charAt(i);\n if (escape) {\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === quote) {\n return { terminated: true, end: i + 1, body: text.slice(start + 1, i) };\n }\n }\n return { terminated: false, end: text.length, body: text.slice(start + 1) };\n}\n\nfunction skipJsonWhitespace(text: string, from: number): number {\n let i = from;\n while (i < text.length && JSON_WHITESPACE.test(text.charAt(i))) {\n i++;\n }\n return i;\n}\n\nfunction scanRun(text: string, from: number, isPart: (ch: string) => boolean): string {\n let i = from;\n while (i < text.length && isPart(text.charAt(i))) {\n i++;\n }\n return text.slice(from, i);\n}\n\nfunction classifyAtPropertyName(\n text: string,\n i: number,\n base: number\n): { readonly reason: JsonParseFailureReason } | { readonly next: number } {\n const ch = text.charAt(i);\n if (ch === '\"') {\n const scan = scanQuotedRun(text, i, '\"');\n if (scan.terminated) {\n return { next: scan.end };\n }\n // An unterminated name is only distinguishable from a mid-name truncation\n // when the swallowed body contains structural text — a ':' the author\n // plainly meant as the name/value separator. Without that, stay honest.\n return scan.body.includes(':')\n ? { reason: { kind: 'unterminated-property-name', token: text.slice(i), offset: base + i } }\n : { reason: UNKNOWN_PARSE_FAILURE };\n }\n if (ch === \"'\") {\n const scan = scanQuotedRun(text, i, \"'\");\n return {\n reason: {\n kind: 'single-quoted-property-name',\n token: scan.terminated ? text.slice(i, scan.end) : \"'\",\n offset: base + i\n }\n };\n }\n if (ch === ',') {\n return { reason: { kind: 'elided-member', token: ',', offset: base + i } };\n }\n if (IDENTIFIER_START.test(ch)) {\n return {\n reason: {\n kind: 'unquoted-property-name',\n token: scanRun(text, i, (c) => IDENTIFIER_PART.test(c)),\n offset: base + i\n }\n };\n }\n return { reason: UNKNOWN_PARSE_FAILURE };\n}\n\n/**\n * Walks `text` from `from` (the opening `{` or `[`) as a permissive JSON\n * scanner, reporting the first fault it can name with confidence. Anything it\n * cannot name — including a document that scans clean — yields `'unknown'`.\n *\n * The scan is structural: it never reads the engine's `JSON.parse` message, so\n * its verdicts do not drift with the Node version.\n * @internal\n */\nfunction scanForParseFailure(text: string, from: number, base: number): JsonParseFailureReason {\n const stack: Array<'object' | 'array'> = [];\n let expect: JsonScanExpectation = 'value';\n let i = from;\n\n for (;;) {\n i = skipJsonWhitespace(text, i);\n if (i >= text.length) {\n return UNKNOWN_PARSE_FAILURE;\n }\n const ch = text.charAt(i);\n const top = stack[stack.length - 1];\n\n if (expect === 'name') {\n if (ch === '}') {\n stack.pop();\n i++;\n expect = 'comma';\n continue;\n }\n const outcome = classifyAtPropertyName(text, i, base);\n if ('reason' in outcome) {\n return outcome.reason;\n }\n i = outcome.next;\n expect = 'colon';\n continue;\n }\n\n if (expect === 'colon') {\n if (ch !== ':') {\n return UNKNOWN_PARSE_FAILURE;\n }\n i++;\n expect = 'value';\n continue;\n }\n\n if (expect === 'value') {\n if (ch === '{' || ch === '[') {\n stack.push(ch === '{' ? 'object' : 'array');\n i++;\n expect = ch === '{' ? 'name' : 'value';\n continue;\n }\n if (ch === ']' && top === 'array') {\n stack.pop();\n i++;\n expect = 'comma';\n continue;\n }\n if (ch === ',') {\n return top === 'array'\n ? { kind: 'elided-member', token: ',', offset: base + i }\n : UNKNOWN_PARSE_FAILURE;\n }\n if (ch === '\"') {\n const scan = scanQuotedRun(text, i, '\"');\n if (!scan.terminated) {\n // Could equally be a truncated value; the extractor already names\n // truncation, so do not compete with it here.\n return UNKNOWN_PARSE_FAILURE;\n }\n i = scan.end;\n expect = 'comma';\n continue;\n }\n const literal = scanRun(text, i, (c) => !VALUE_RUN_TERMINATOR.test(c));\n if (literal.length === 0) {\n return UNKNOWN_PARSE_FAILURE;\n }\n i += literal.length;\n expect = 'comma';\n continue;\n }\n\n // expect === 'comma': a complete value just closed.\n if (top === undefined) {\n return UNKNOWN_PARSE_FAILURE;\n }\n if (ch === ',') {\n i++;\n expect = top === 'object' ? 'name' : 'value';\n continue;\n }\n if ((ch === '}' && top === 'object') || (ch === ']' && top === 'array')) {\n stack.pop();\n i++;\n continue;\n }\n return UNKNOWN_PARSE_FAILURE;\n }\n}\n\n/**\n * Classifies why a JSON-shaped LLM response would not parse, returning a\n * {@link AiAssist.JsonParseFailureReason} a caller can branch on — repair the\n * cheap cases, re-prompt the expensive ones, fail outright on the rest —\n * instead of regex-matching an engine-specific `JSON.parse` message.\n *\n * Pass the same raw model text you handed\n * {@link AiAssist.fencedStringifiedJson} or {@link AiAssist.extractJsonText};\n * this applies the same BOM / whitespace / fence / preamble handling before\n * scanning, and reports `offset` against that original text.\n *\n * Classification is **structural and deliberately conservative**. The scan\n * walks the JSON grammar itself rather than reading the engine's error string,\n * so its verdicts are stable across Node versions — and any fault it cannot\n * name with confidence comes back as `'unknown'` rather than a guess. In\n * particular an input that opened a structure and never closed it (the\n * truncated-response shape {@link AiAssist.extractJsonText} already diagnoses)\n * classifies as `'unknown'` here; the two diagnostics are complementary, not\n * competing.\n *\n * This never fails and never repairs — it only names the fault. It is a\n * diagnostic on the failure path, so calling it on text that parses fine is\n * harmless but pointless: it returns `'unknown'`.\n *\n * @example\n * ```ts\n * const parsed = fencedStringifiedJson({ inner }).convert(raw);\n * if (parsed.isFailure()) {\n * const reason = classifyJsonParseFailure(raw);\n * switch (reason.kind) {\n * case 'unquoted-property-name': // cheap to repair\n * case 'single-quoted-property-name':\n * break;\n * case 'elided-member':\n * case 'unterminated-property-name': // worth a re-prompt\n * break;\n * default: // 'unknown' — fail outright\n * }\n * }\n * ```\n *\n * @param text - Raw model output (the same string handed to the extractor).\n * @returns A {@link AiAssist.JsonParseFailureReason}.\n * @public\n */\nexport function classifyJsonParseFailure(text: string): JsonParseFailureReason {\n // Defensive, and load-bearing for the documented totality: the signature says\n // `string`, but a JS consumer — or a TS caller coming through an `unknown` /\n // `any` escape hatch — can still hand us a non-string, and `locateJsonCandidate`\n // would throw on it. `extractJsonText` already guards the same way; this keeps\n // the pair consistent and keeps \"never fails\" true in practice rather than only\n // under a well-typed caller.\n if (typeof text !== 'string') {\n return UNKNOWN_PARSE_FAILURE;\n }\n const candidate = locateJsonCandidate(text);\n const scan = findBalancedJsonSubstring(candidate.text);\n if (scan.kind === 'none') {\n return UNKNOWN_PARSE_FAILURE;\n }\n return scanForParseFailure(candidate.text, scan.start, candidate.base);\n}\n\n/**\n * Options shared by every {@link AiAssist.fencedStringifiedJson} call.\n * @public\n */\nexport interface IFencedStringifiedJsonExtractorOptions {\n /**\n * Optional pre-parse extractor. Defaults to {@link AiAssist.extractJsonText}.\n * Provide a custom extractor to handle response shapes the default does not\n * understand.\n */\n readonly extractor?: JsonTextExtractor;\n}\n\n/**\n * Options for the validating overload of {@link AiAssist.fencedStringifiedJson}.\n * `inner` is required so the typed `Converter<T>` return value can never lie\n * about the runtime shape.\n * @public\n */\nexport interface IFencedStringifiedJsonOptions<T> extends IFencedStringifiedJsonExtractorOptions {\n /** Inner converter or validator applied to the parsed JSON value. */\n readonly inner: Converter<T> | Validator<T>;\n}\n\n/**\n * Creates a `Converter` that accepts raw LLM response text, runs it through a\n * tolerant extractor (default: {@link AiAssist.extractJsonText}), parses the\n * extracted substring as JSON, and applies an optional inner converter or\n * validator.\n *\n * @example\n * ```ts\n * const converter = fencedStringifiedJson({ inner: myShapeConverter });\n * const result = converter.convert(llmText); // Result<MyShape>\n * ```\n *\n * @param options - Optional extractor; omit to keep the default. Without an\n * `inner` step, the converter resolves to the parsed `JsonValue`.\n * @returns A `Converter<JsonValue>`.\n * @public\n */\nexport function fencedStringifiedJson(options?: IFencedStringifiedJsonExtractorOptions): Converter<JsonValue>;\n/**\n * Creates a `Converter` that accepts raw LLM response text, runs it through a\n * tolerant extractor (default: {@link AiAssist.extractJsonText}), parses the\n * extracted substring as JSON, and applies the supplied inner converter or\n * validator.\n *\n * @param options - Required `inner` converter/validator and optional extractor.\n * @returns A `Converter<T>`.\n * @public\n */\nexport function fencedStringifiedJson<T>(options: IFencedStringifiedJsonOptions<T>): Converter<T>;\nexport function fencedStringifiedJson<T>(\n options?: IFencedStringifiedJsonExtractorOptions | IFencedStringifiedJsonOptions<T>\n): Converter<T | JsonValue> {\n const extractor: JsonTextExtractor = options?.extractor ?? extractJsonText;\n const inner = (options as IFencedStringifiedJsonOptions<T> | undefined)?.inner;\n const parser: Converter<T | JsonValue> =\n inner !== undefined ? JsonBaseConverters.stringifiedJson<T>(inner) : JsonBaseConverters.stringifiedJson();\n\n return new Conversion.BaseConverter<T | JsonValue>((from: unknown): Result<T | JsonValue> => {\n if (typeof from !== 'string') {\n return fail('fencedStringifiedJson: input must be a string.');\n }\n return extractor(from).onSuccess((extracted) => parser.convert(extracted));\n });\n}\n"]}
@@ -387,6 +387,35 @@ export interface IAiClientToolTurnResult {
387
387
  }
388
388
  /**
389
389
  * Known context keys for model specification maps.
390
+ *
391
+ * @remarks
392
+ * Two axes live here and nothing else: the **quality tier** (`base` / `advanced`
393
+ * / `frontier`) selects the *completion* model, and `image` / `embedding` select
394
+ * the non-completion modalities.
395
+ *
396
+ * There is deliberately **no `tools` or `thinking` key**. Both existed before the
397
+ * quality-tier axis landed and were removed with it: server-side tools and
398
+ * reasoning effort are orthogonal *request* params that ride on top of whatever
399
+ * model the tier already selected — they never select a model. A tool-using or
400
+ * thinking-enabled call passes a tier like any other call (omit → `base`, or
401
+ * `'advanced'` / `'frontier'`) and sets the tools / thinking request params
402
+ * independently. Thinking composes with any tier without a tier-level capability
403
+ * check — but that is a statement about the tier axis, not a claim that every
404
+ * provider supports thinking: several descriptors declare
405
+ * `thinkingMode: 'unsupported'` (e.g. `copy-paste`, `groq`, `mistral`, `ollama`,
406
+ * `openai-compat`).
407
+ *
408
+ * Thinking availability is declared **per provider**, on the descriptor's
409
+ * `thinkingMode`; the descriptor does not encode per-model thinking availability at
410
+ * all, so a provider that declares support may still have individual models its own
411
+ * API rejects thinking on. (`adaptiveThinkingModelPrefixes` is per-model but selects
412
+ * a wire *shape*, not availability.) What the tier axis guarantees is therefore
413
+ * narrow and exact: a tier selects a model within one provider and never changes the
414
+ * provider, so it never changes `thinkingMode`.
415
+ *
416
+ * Do not add a `'tools'` or `'thinking'` key here, and do not hand-roll a
417
+ * `resolveModel` + `resolveModelAlias` walk to emulate one — call
418
+ * `resolveProviderModel` with the tier you want.
390
419
  * @public
391
420
  */
392
421
  export type ModelSpecKey = 'base' | 'advanced' | 'frontier' | 'image' | 'embedding';
@@ -506,6 +535,20 @@ export declare function resolveModelAlias(descriptor: IAiProviderDescriptor, mod
506
535
  * `ModelSpec` branch is selected first; the resulting string — which may itself
507
536
  * be an fgv alias — is then resolved to a concrete id.
508
537
  *
538
+ * **This is the whole model-selection surface — do not hand-roll the walk.**
539
+ * Callers should pass the `ModelSpecKey` they want and use the concrete id
540
+ * this returns; a manual `resolveModel` + `resolveModelAlias` sequence is
541
+ * both redundant and easy to get wrong (it is how alias-form ids leak into
542
+ * capability lookups such as `resolveImageCapability`).
543
+ *
544
+ * **`context` carries the quality tier and the modality — never tools or
545
+ * thinking.** `ModelSpecKey` has no `tools` / `thinking` key: server-side
546
+ * tools and reasoning effort are orthogonal request params that ride on top of
547
+ * whatever model the tier selected, and never select a model. A tool-path caller
548
+ * passes a tier like any other caller — omit `context` for `base`, or pass
549
+ * `'advanced'` / `'frontier'` — and sets the tools / thinking request params
550
+ * separately.
551
+ *
509
552
  * @param descriptor - The provider descriptor (supplies `defaultModel` and `aliases`).
510
553
  * @param modelOverride - An optional caller-supplied `ModelSpec` that takes precedence
511
554
  * over `descriptor.defaultModel`. May itself contain or be an alias.
@@ -532,6 +575,53 @@ export declare function resolveProviderModel(descriptor: IAiProviderDescriptor,
532
575
  * @public
533
576
  */
534
577
  export declare function isResponsesOnlyModel(descriptor: IAiProviderDescriptor, modelId: string): boolean;
578
+ /**
579
+ * Determines whether a concrete (already-resolved) Anthropic model id uses the adaptive
580
+ * thinking wire shape (`thinking: { type: 'adaptive' }` + top-level `output_config.effort`)
581
+ * rather than the legacy manual-budget shape (`thinking: { type: 'enabled', budget_tokens }`).
582
+ *
583
+ * @remarks
584
+ * Matches `modelId` against the descriptor's
585
+ * {@link IAiProviderDescriptor.adaptiveThinkingModelPrefixes} using the same
586
+ * exact-or-dash-bounded matcher semantics as the model-specific blocks in
587
+ * `mergeThinkingConfig` (an entry matches when it equals the resolved model or when the
588
+ * resolved model starts with the entry followed by a `-`) — a plain prefix match would risk a
589
+ * false positive against an unrelated model sharing the same leading characters. A provider
590
+ * that declares no list (the common case — this is Anthropic-specific) always returns `false`.
591
+ * Consulted by the completion (`callProviderCompletion`), streaming
592
+ * (`callProviderCompletionStream`), and client-tool (`executeClientToolTurn`) Anthropic
593
+ * dispatch sites so every Anthropic wire-request path picks the correct thinking shape for the
594
+ * resolved model.
595
+ *
596
+ * @param descriptor - The provider descriptor supplying the prefix list.
597
+ * @param modelId - The resolved concrete model id to test.
598
+ * @returns `true` when `modelId` exactly matches or is dash-bounded-prefixed by any declared
599
+ * adaptive-thinking prefix.
600
+ * @public
601
+ */
602
+ export declare function isAdaptiveThinkingModel(descriptor: IAiProviderDescriptor, modelId: string): boolean;
603
+ /**
604
+ * Determines whether a provider's OpenAI-compatible Chat Completions request
605
+ * should use the modern `max_completion_tokens` field instead of the legacy
606
+ * `max_tokens` field for capping output length.
607
+ *
608
+ * @remarks
609
+ * OpenAI's Chat Completions API deprecated `max_tokens` in favor of
610
+ * `max_completion_tokens`. Every other provider routed through the shared
611
+ * OpenAI-compatible chat-completions adapter (xAI Grok, Groq, Mistral, Ollama,
612
+ * self-hosted `openai-compat` servers) still expects the legacy `max_tokens`
613
+ * field, so this returns `true` only for the `'openai'` provider id. Consulted
614
+ * by both the completion (`callProviderCompletion`) and streaming
615
+ * (`callProviderCompletionStream`) chat-completions dispatch branches. Not
616
+ * consulted on the Responses API path — `max_output_tokens` applies uniformly
617
+ * there for both OpenAI and xAI (see `isResponsesOnlyModel`) —
618
+ * nor by any non-`'openai'`-format provider (Anthropic, Gemini).
619
+ *
620
+ * @param descriptor - The provider descriptor.
621
+ * @returns `true` only for the `'openai'` provider id.
622
+ * @public
623
+ */
624
+ export declare function usesMaxCompletionTokensField(descriptor: IAiProviderDescriptor): boolean;
535
625
  /**
536
626
  * All known AI provider identifiers.
537
627
  * @public
@@ -586,6 +676,27 @@ export interface IAiCompletionResponse {
586
676
  /** Whether the response was truncated due to token limits */
587
677
  readonly truncated: boolean;
588
678
  }
679
+ /**
680
+ * Default `max_tokens` sent to the Anthropic Messages API when the caller does
681
+ * not supply an explicit `maxTokens` override.
682
+ *
683
+ * @remarks
684
+ * Anthropic's Messages API requires `max_tokens` on every request — there is
685
+ * no provider-side default the way there is for OpenAI Chat/Responses,
686
+ * Gemini, or xAI, all of which accept a request with no cap and apply their
687
+ * own default. Anthropic is therefore the only provider that needs — or
688
+ * gets — a library-supplied fallback; every other provider omits the field
689
+ * entirely when the caller doesn't set `maxTokens` (see
690
+ * `IProviderCompletionParams.maxTokens`).
691
+ *
692
+ * Callers whose structured/JSON output scales with input size and hits this
693
+ * ceiling see a silent truncation that often surfaces downstream as a
694
+ * confusing `extractJsonText` parse failure rather than an obvious "too
695
+ * short" error — pass `maxTokens` explicitly to raise the cap for those
696
+ * requests.
697
+ * @public
698
+ */
699
+ export declare const DEFAULT_ANTHROPIC_MAX_TOKENS: number;
589
700
  /**
590
701
  * A text-content delta arriving during a streaming completion.
591
702
  * @public
@@ -780,6 +891,27 @@ export interface IAiProviderDescriptor {
780
891
  * Responses-only.
781
892
  */
782
893
  readonly responsesOnlyModelPrefixes?: ReadonlyArray<string>;
894
+ /**
895
+ * Concrete Anthropic model ids (exact-or-dash-bounded-prefix-matched) that require the
896
+ * adaptive thinking wire shape (`thinking: { type: 'adaptive' }` + top-level
897
+ * `output_config: { effort }`) rather than the legacy manual-budget shape
898
+ * (`thinking: { type: 'enabled', budget_tokens }`). Non-Anthropic `apiFormat`s ignore this.
899
+ *
900
+ * @remarks
901
+ * The Claude 5 family (`claude-sonnet-5`, `claude-opus-5`, `claude-fable-5`, including their
902
+ * dated snapshots) rejects `thinking.type: 'enabled'` with an HTTP 400 and requires the
903
+ * adaptive shape; older models (`claude-sonnet-4-6`, `claude-opus-4-8`, `claude-haiku-4-5`,
904
+ * etc.) keep the legacy shape. The completion (`callProviderCompletion`), streaming
905
+ * (`callProviderCompletionStream`), and client-tool (`executeClientToolTurn`) Anthropic
906
+ * dispatch sites consult this list (via the sibling predicate
907
+ * `isAdaptiveThinkingModel`) to pick the correct wire shape for the resolved
908
+ * model. Mirrors the prefix-matching shape of `responsesOnlyModelPrefixes`, but with
909
+ * exact-or-dash-bounded matching (an entry matches a resolved model that equals it or starts
910
+ * with it followed by `-`) rather than a plain prefix, since Anthropic model families share
911
+ * numeric leading characters (`claude-sonnet-5` vs. a hypothetical `claude-sonnet-50`).
912
+ * Empty or undefined means no model uses the adaptive shape.
913
+ */
914
+ readonly adaptiveThinkingModelPrefixes?: ReadonlyArray<string>;
783
915
  }
784
916
  /**
785
917
  * Image-generation capability for a model family within a provider. Used as
@@ -1207,7 +1339,7 @@ export type GeminiThinkingModelNames = 'gemini-3.1-pro-preview' | 'gemini-3.5-fl
1207
1339
  * Model IDs for xAI thinking-capable models.
1208
1340
  * @public
1209
1341
  */
1210
- export type XAiThinkingModelNames = 'grok-3-mini' | 'grok-4.3' | 'grok-4';
1342
+ export type XAiThinkingModelNames = 'grok-3-mini' | 'grok-4.3' | 'grok-4' | 'grok-4.5';
1211
1343
  /**
1212
1344
  * Anthropic-specific thinking configuration.
1213
1345
  * @public
@@ -1410,4 +1542,15 @@ export interface IAiAssistKeyStore {
1410
1542
  /** Get an API key by secret name */
1411
1543
  getApiKey(name: string): Result<string>;
1412
1544
  }
1545
+ /**
1546
+ * Returns the canonical `CryptoUtils.KeyStore.KeyStore` secret name for a provider's API key,
1547
+ * of the form `provider:<providerId>`. Apps that store provider API keys in a `KeyStore`
1548
+ * should use this name (rather than inventing their own) so that a single keystore vault
1549
+ * works consistently across every fgv app.
1550
+ *
1551
+ * @param providerId - The provider whose API key secret name is requested.
1552
+ * @returns The canonical keystore secret name, e.g. `'provider:openai'`.
1553
+ * @public
1554
+ */
1555
+ export declare function providerApiKeySecretName(providerId: AiProviderId): string;
1413
1556
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/packlets/ai-assist/model.ts"],"names":[],"mappings":"AAoBA;;;GAGG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAW,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMrE;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,QAAQ,CAA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AAC;IACxC,2GAA2G;IAC3G,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,4HAA4H;IAC5H,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAE/B,CAAC;AAMF;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,qCAAqC;IACrC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACzC,oCAAoC;IACpC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,YAAY,GAAG,MAAM,CAEzE"}
@@ -19,12 +19,15 @@
19
19
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
  // SOFTWARE.
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.DEFAULT_AI_ASSIST = exports.allModelCapabilities = exports.MODEL_ALIAS_SIGIL = exports.MODEL_SPEC_BASE_KEY = exports.allModelSpecKeys = exports.AiPrompt = void 0;
22
+ exports.DEFAULT_AI_ASSIST = exports.allModelCapabilities = exports.DEFAULT_ANTHROPIC_MAX_TOKENS = exports.MODEL_ALIAS_SIGIL = exports.MODEL_SPEC_BASE_KEY = exports.allModelSpecKeys = exports.AiPrompt = void 0;
23
23
  exports.toDataUrl = toDataUrl;
24
24
  exports.resolveModel = resolveModel;
25
25
  exports.resolveModelAlias = resolveModelAlias;
26
26
  exports.resolveProviderModel = resolveProviderModel;
27
27
  exports.isResponsesOnlyModel = isResponsesOnlyModel;
28
+ exports.isAdaptiveThinkingModel = isAdaptiveThinkingModel;
29
+ exports.usesMaxCompletionTokensField = usesMaxCompletionTokensField;
30
+ exports.providerApiKeySecretName = providerApiKeySecretName;
28
31
  /**
29
32
  * Core types for AI assist: prompt class, provider descriptors, settings, and chat messages.
30
33
  * @packageDocumentation
@@ -225,6 +228,20 @@ function resolveModelAlias(descriptor, model) {
225
228
  * `ModelSpec` branch is selected first; the resulting string — which may itself
226
229
  * be an fgv alias — is then resolved to a concrete id.
227
230
  *
231
+ * **This is the whole model-selection surface — do not hand-roll the walk.**
232
+ * Callers should pass the `ModelSpecKey` they want and use the concrete id
233
+ * this returns; a manual `resolveModel` + `resolveModelAlias` sequence is
234
+ * both redundant and easy to get wrong (it is how alias-form ids leak into
235
+ * capability lookups such as `resolveImageCapability`).
236
+ *
237
+ * **`context` carries the quality tier and the modality — never tools or
238
+ * thinking.** `ModelSpecKey` has no `tools` / `thinking` key: server-side
239
+ * tools and reasoning effort are orthogonal request params that ride on top of
240
+ * whatever model the tier selected, and never select a model. A tool-path caller
241
+ * passes a tier like any other caller — omit `context` for `base`, or pass
242
+ * `'advanced'` / `'frontier'` — and sets the tools / thinking request params
243
+ * separately.
244
+ *
228
245
  * @param descriptor - The provider descriptor (supplies `defaultModel` and `aliases`).
229
246
  * @param modelOverride - An optional caller-supplied `ModelSpec` that takes precedence
230
247
  * over `descriptor.defaultModel`. May itself contain or be an alias.
@@ -260,6 +277,87 @@ function isResponsesOnlyModel(descriptor, modelId) {
260
277
  var _a, _b;
261
278
  return (_b = (_a = descriptor.responsesOnlyModelPrefixes) === null || _a === void 0 ? void 0 : _a.some((p) => modelId.startsWith(p))) !== null && _b !== void 0 ? _b : false;
262
279
  }
280
+ /**
281
+ * Returns true when `modelId` equals `prefix` or starts with `prefix` followed by a `-`
282
+ * (versioned/dated-snapshot ids, e.g. `'claude-sonnet-5'` matches `'claude-sonnet-5-20260115'`
283
+ * but not `'claude-sonnet-50'`). @internal
284
+ */
285
+ function isExactOrDashBoundedPrefix(modelId, prefix) {
286
+ return modelId === prefix || modelId.startsWith(`${prefix}-`);
287
+ }
288
+ /**
289
+ * Determines whether a concrete (already-resolved) Anthropic model id uses the adaptive
290
+ * thinking wire shape (`thinking: { type: 'adaptive' }` + top-level `output_config.effort`)
291
+ * rather than the legacy manual-budget shape (`thinking: { type: 'enabled', budget_tokens }`).
292
+ *
293
+ * @remarks
294
+ * Matches `modelId` against the descriptor's
295
+ * {@link IAiProviderDescriptor.adaptiveThinkingModelPrefixes} using the same
296
+ * exact-or-dash-bounded matcher semantics as the model-specific blocks in
297
+ * `mergeThinkingConfig` (an entry matches when it equals the resolved model or when the
298
+ * resolved model starts with the entry followed by a `-`) — a plain prefix match would risk a
299
+ * false positive against an unrelated model sharing the same leading characters. A provider
300
+ * that declares no list (the common case — this is Anthropic-specific) always returns `false`.
301
+ * Consulted by the completion (`callProviderCompletion`), streaming
302
+ * (`callProviderCompletionStream`), and client-tool (`executeClientToolTurn`) Anthropic
303
+ * dispatch sites so every Anthropic wire-request path picks the correct thinking shape for the
304
+ * resolved model.
305
+ *
306
+ * @param descriptor - The provider descriptor supplying the prefix list.
307
+ * @param modelId - The resolved concrete model id to test.
308
+ * @returns `true` when `modelId` exactly matches or is dash-bounded-prefixed by any declared
309
+ * adaptive-thinking prefix.
310
+ * @public
311
+ */
312
+ function isAdaptiveThinkingModel(descriptor, modelId) {
313
+ var _a, _b;
314
+ return ((_b = (_a = descriptor.adaptiveThinkingModelPrefixes) === null || _a === void 0 ? void 0 : _a.some((p) => isExactOrDashBoundedPrefix(modelId, p))) !== null && _b !== void 0 ? _b : false);
315
+ }
316
+ /**
317
+ * Determines whether a provider's OpenAI-compatible Chat Completions request
318
+ * should use the modern `max_completion_tokens` field instead of the legacy
319
+ * `max_tokens` field for capping output length.
320
+ *
321
+ * @remarks
322
+ * OpenAI's Chat Completions API deprecated `max_tokens` in favor of
323
+ * `max_completion_tokens`. Every other provider routed through the shared
324
+ * OpenAI-compatible chat-completions adapter (xAI Grok, Groq, Mistral, Ollama,
325
+ * self-hosted `openai-compat` servers) still expects the legacy `max_tokens`
326
+ * field, so this returns `true` only for the `'openai'` provider id. Consulted
327
+ * by both the completion (`callProviderCompletion`) and streaming
328
+ * (`callProviderCompletionStream`) chat-completions dispatch branches. Not
329
+ * consulted on the Responses API path — `max_output_tokens` applies uniformly
330
+ * there for both OpenAI and xAI (see `isResponsesOnlyModel`) —
331
+ * nor by any non-`'openai'`-format provider (Anthropic, Gemini).
332
+ *
333
+ * @param descriptor - The provider descriptor.
334
+ * @returns `true` only for the `'openai'` provider id.
335
+ * @public
336
+ */
337
+ function usesMaxCompletionTokensField(descriptor) {
338
+ return descriptor.id === 'openai';
339
+ }
340
+ /**
341
+ * Default `max_tokens` sent to the Anthropic Messages API when the caller does
342
+ * not supply an explicit `maxTokens` override.
343
+ *
344
+ * @remarks
345
+ * Anthropic's Messages API requires `max_tokens` on every request — there is
346
+ * no provider-side default the way there is for OpenAI Chat/Responses,
347
+ * Gemini, or xAI, all of which accept a request with no cap and apply their
348
+ * own default. Anthropic is therefore the only provider that needs — or
349
+ * gets — a library-supplied fallback; every other provider omits the field
350
+ * entirely when the caller doesn't set `maxTokens` (see
351
+ * `IProviderCompletionParams.maxTokens`).
352
+ *
353
+ * Callers whose structured/JSON output scales with input size and hits this
354
+ * ceiling see a silent truncation that often surfaces downstream as a
355
+ * confusing `extractJsonText` parse failure rather than an obvious "too
356
+ * short" error — pass `maxTokens` explicitly to raise the cap for those
357
+ * requests.
358
+ * @public
359
+ */
360
+ exports.DEFAULT_ANTHROPIC_MAX_TOKENS = 4096;
263
361
  /**
264
362
  * All valid `AiModelCapability` values — the single source of truth for
265
363
  * the capability vocabulary (used by validators and capability filters).
@@ -280,4 +378,17 @@ exports.allModelCapabilities = [
280
378
  exports.DEFAULT_AI_ASSIST = {
281
379
  providers: [{ provider: 'copy-paste' }]
282
380
  };
381
+ /**
382
+ * Returns the canonical `CryptoUtils.KeyStore.KeyStore` secret name for a provider's API key,
383
+ * of the form `provider:<providerId>`. Apps that store provider API keys in a `KeyStore`
384
+ * should use this name (rather than inventing their own) so that a single keystore vault
385
+ * works consistently across every fgv app.
386
+ *
387
+ * @param providerId - The provider whose API key secret name is requested.
388
+ * @returns The canonical keystore secret name, e.g. `'provider:openai'`.
389
+ * @public
390
+ */
391
+ function providerApiKeySecretName(providerId) {
392
+ return `provider:${providerId}`;
393
+ }
283
394
  //# sourceMappingURL=model.js.map