@mate-academy/llm-gateway 8.11.1 → 8.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +20 -9
  2. package/dist/LLMService.constants.d.ts +54 -54
  3. package/dist/LLMService.typedefs.d.ts +7 -0
  4. package/dist/LLMService.typedefs.js.map +1 -1
  5. package/dist/client/agentRun.typedefs.d.ts +12 -1
  6. package/dist/client/agentRun.typedefs.js +2 -0
  7. package/dist/client/agentRun.typedefs.js.map +1 -1
  8. package/dist/client/agentRunner.js +17 -0
  9. package/dist/client/agentRunner.js.map +1 -1
  10. package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js +15 -5
  11. package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js.map +1 -1
  12. package/dist/providers/LLMAPI/LLMAPI.constants.d.ts +81 -81
  13. package/dist/providers/LLMAPI/LLMAPI.constants.js +27 -27
  14. package/dist/providers/LLMAPI/LLMAPI.constants.js.map +1 -1
  15. package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js +41 -7
  16. package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js.map +1 -1
  17. package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js +10 -1
  18. package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js.map +1 -1
  19. package/dist/providers/OpenAI/services/OpenAIAssistance.service.js +40 -5
  20. package/dist/providers/OpenAI/services/OpenAIAssistance.service.js.map +1 -1
  21. package/dist/services/LLMBaseService.abstract.d.ts +3 -1
  22. package/dist/services/LLMBaseService.abstract.js +11 -1
  23. package/dist/services/LLMBaseService.abstract.js.map +1 -1
  24. package/dist/services/agentRounds/LLMAgentRounds.d.ts +4 -2
  25. package/dist/services/agentRounds/LLMAgentRounds.js +12 -1
  26. package/dist/services/agentRounds/LLMAgentRounds.js.map +1 -1
  27. package/dist/services/agentRounds/agentRounds.typedefs.d.ts +1 -0
  28. package/dist/utilities/audio.js +11 -2
  29. package/dist/utilities/audio.js.map +1 -1
  30. package/dist/utilities/parseToolArguments.d.ts +3 -0
  31. package/dist/utilities/parseToolArguments.js +31 -0
  32. package/dist/utilities/parseToolArguments.js.map +1 -0
  33. package/dist/utilities/parseToolArguments.typedefs.d.ts +11 -0
  34. package/dist/utilities/parseToolArguments.typedefs.js +9 -0
  35. package/dist/utilities/parseToolArguments.typedefs.js.map +1 -0
  36. package/package.json +4 -4
package/README.md CHANGED
@@ -330,14 +330,22 @@ if (turn.stopReason === LLMToolLoopStopReasons.TerminalTool) {
330
330
  ```
331
331
 
332
332
  - **Structured progress events.** Every step emits an `LLMAgentEvent`
333
- (`agent_started/message/completed/failed`, `tool_call_started/completed/failed`,
333
+ (`agent_started/step_started/message/completed/failed`,
334
+ `tool_call_started/completed/failed/rejected`,
334
335
  `subagent_started/completed/failed`) through `onEvent`, for live subscription
335
336
  updates and durable run persistence. Events carry correlation ids from one
336
- sequence per root run — `runId` on every event, `invocationId` on tool and
337
- subagent events, `subagentRunId` linking a delegation to the nested run's
338
- events — so parallel tool calls and repeated delegations reconstruct into an
339
- unambiguous run tree. Listeners may be async; a throw or rejection is logged
340
- and never affects the run.
337
+ sequence per root run — `runId` on every event, `invocationId` on started,
338
+ completed and failed tool and subagent events, and `subagentRunId` linking a
339
+ delegation to the nested run's events — so parallel tool calls and repeated
340
+ delegations reconstruct into an unambiguous run tree. A
341
+ `tool_call_rejected` event is the explicit exception: it has no
342
+ `invocationId`, because the provider call never entered the wrapped tool
343
+ lifecycle and not every provider exposes a stable call identifier. Listeners
344
+ may be async; a throw or rejection is logged and never affects the run.
345
+ `agent_step_started` is emitted immediately before every provider model call,
346
+ including failed calls and nested subagent rounds. `tool_call_rejected`
347
+ preserves the provider's ordered call when its name is unknown or its JSON
348
+ arguments cannot be parsed, even though no wrapped tool invocation starts.
341
349
  - **Full-fidelity history.** `history` restores the conversation as it happened,
342
350
  not a prose retelling of it. An entry is a plain message
343
351
  (`{ role, text }`), a past tool round
@@ -1048,14 +1056,17 @@ if (!('error' in result) && result.usage) {
1048
1056
  }
1049
1057
  ```
1050
1058
 
1051
- For the LLMAPI provider, the structured-output result's `usage` (and the `cost`
1052
- derived from it) includes the JSON-fix call's tokens (summed into the primary
1053
- call's usage) when a fix was required.
1054
1059
 
1055
1060
  #### Provider Support
1056
1061
 
1057
1062
  - **OpenAI**: Uses native `response_format` with `json_schema` for optimal performance
1058
1063
  - **Google Generative AI**: Uses native `responseSchema` parameter for structured output
1064
+ - **LLMAPI**: Uses native `response_format` for the models that accept it. Anthropic-backed
1065
+ `claude-*` models are not among them — LLMAPI forwards `response_format` verbatim and
1066
+ Anthropic only honours its own `output_config`, so those entries declare
1067
+ `structuredOutputs: false` and `jsonOutput: false`. The gateway then injects the JSON
1068
+ schema into the system message and validates the response, rather than sending a
1069
+ parameter the upstream provider discards.
1059
1070
  - **Backward Compatibility**: All existing code continues to work unchanged
1060
1071
 
1061
1072
  #### Provider Compatibility Notes
@@ -2991,7 +2991,7 @@ export declare const LLM_SERVICE_MODELS: {
2991
2991
  readonly reasoning: true;
2992
2992
  readonly webSearch: true;
2993
2993
  readonly jsonOutput: false;
2994
- readonly structuredOutputs: true;
2994
+ readonly structuredOutputs: false;
2995
2995
  };
2996
2996
  };
2997
2997
  readonly "claude-sonnet-4-5-20250929": {
@@ -3017,7 +3017,7 @@ export declare const LLM_SERVICE_MODELS: {
3017
3017
  readonly reasoning: true;
3018
3018
  readonly webSearch: true;
3019
3019
  readonly jsonOutput: false;
3020
- readonly structuredOutputs: true;
3020
+ readonly structuredOutputs: false;
3021
3021
  };
3022
3022
  };
3023
3023
  readonly "claude-sonnet-4-6": {
@@ -3043,7 +3043,7 @@ export declare const LLM_SERVICE_MODELS: {
3043
3043
  readonly reasoning: true;
3044
3044
  readonly webSearch: true;
3045
3045
  readonly jsonOutput: false;
3046
- readonly structuredOutputs: true;
3046
+ readonly structuredOutputs: false;
3047
3047
  };
3048
3048
  };
3049
3049
  readonly "claude-haiku-4-5": {
@@ -3069,7 +3069,7 @@ export declare const LLM_SERVICE_MODELS: {
3069
3069
  readonly reasoning: false;
3070
3070
  readonly webSearch: true;
3071
3071
  readonly jsonOutput: false;
3072
- readonly structuredOutputs: true;
3072
+ readonly structuredOutputs: false;
3073
3073
  };
3074
3074
  };
3075
3075
  readonly "claude-haiku-4-5-20251001": {
@@ -3095,7 +3095,7 @@ export declare const LLM_SERVICE_MODELS: {
3095
3095
  readonly reasoning: false;
3096
3096
  readonly webSearch: true;
3097
3097
  readonly jsonOutput: false;
3098
- readonly structuredOutputs: true;
3098
+ readonly structuredOutputs: false;
3099
3099
  };
3100
3100
  };
3101
3101
  readonly "claude-opus-4-20250514": {
@@ -3147,7 +3147,7 @@ export declare const LLM_SERVICE_MODELS: {
3147
3147
  readonly reasoning: true;
3148
3148
  readonly webSearch: true;
3149
3149
  readonly jsonOutput: false;
3150
- readonly structuredOutputs: true;
3150
+ readonly structuredOutputs: false;
3151
3151
  };
3152
3152
  };
3153
3153
  readonly "claude-opus-4-5-20251101": {
@@ -3173,7 +3173,7 @@ export declare const LLM_SERVICE_MODELS: {
3173
3173
  readonly reasoning: true;
3174
3174
  readonly webSearch: true;
3175
3175
  readonly jsonOutput: false;
3176
- readonly structuredOutputs: true;
3176
+ readonly structuredOutputs: false;
3177
3177
  };
3178
3178
  };
3179
3179
  readonly "claude-opus-4-6": {
@@ -3198,8 +3198,8 @@ export declare const LLM_SERVICE_MODELS: {
3198
3198
  readonly tools: true;
3199
3199
  readonly reasoning: true;
3200
3200
  readonly webSearch: true;
3201
- readonly jsonOutput: true;
3202
- readonly structuredOutputs: true;
3201
+ readonly jsonOutput: false;
3202
+ readonly structuredOutputs: false;
3203
3203
  };
3204
3204
  };
3205
3205
  readonly "gemini-2.5-pro": {
@@ -6702,7 +6702,7 @@ export declare const LLM_SERVICE_MODELS: {
6702
6702
  readonly reasoning: true;
6703
6703
  readonly webSearch: true;
6704
6704
  readonly jsonOutput: false;
6705
- readonly structuredOutputs: true;
6705
+ readonly structuredOutputs: false;
6706
6706
  };
6707
6707
  };
6708
6708
  readonly "anthropic/claude-opus-4-20250514": {
@@ -6754,7 +6754,7 @@ export declare const LLM_SERVICE_MODELS: {
6754
6754
  readonly reasoning: true;
6755
6755
  readonly webSearch: true;
6756
6756
  readonly jsonOutput: false;
6757
- readonly structuredOutputs: true;
6757
+ readonly structuredOutputs: false;
6758
6758
  };
6759
6759
  };
6760
6760
  readonly "anthropic/claude-opus-4-6": {
@@ -6779,8 +6779,8 @@ export declare const LLM_SERVICE_MODELS: {
6779
6779
  readonly tools: true;
6780
6780
  readonly reasoning: true;
6781
6781
  readonly webSearch: true;
6782
- readonly jsonOutput: true;
6783
- readonly structuredOutputs: true;
6782
+ readonly jsonOutput: false;
6783
+ readonly structuredOutputs: false;
6784
6784
  };
6785
6785
  };
6786
6786
  readonly "anthropic/claude-sonnet-4-5": {
@@ -6806,7 +6806,7 @@ export declare const LLM_SERVICE_MODELS: {
6806
6806
  readonly reasoning: true;
6807
6807
  readonly webSearch: true;
6808
6808
  readonly jsonOutput: false;
6809
- readonly structuredOutputs: true;
6809
+ readonly structuredOutputs: false;
6810
6810
  };
6811
6811
  };
6812
6812
  readonly "anthropic/claude-sonnet-4-5-20250929": {
@@ -6832,7 +6832,7 @@ export declare const LLM_SERVICE_MODELS: {
6832
6832
  readonly reasoning: true;
6833
6833
  readonly webSearch: true;
6834
6834
  readonly jsonOutput: false;
6835
- readonly structuredOutputs: true;
6835
+ readonly structuredOutputs: false;
6836
6836
  };
6837
6837
  };
6838
6838
  readonly "anthropic/claude-sonnet-4-6": {
@@ -6858,7 +6858,7 @@ export declare const LLM_SERVICE_MODELS: {
6858
6858
  readonly reasoning: true;
6859
6859
  readonly webSearch: true;
6860
6860
  readonly jsonOutput: false;
6861
- readonly structuredOutputs: true;
6861
+ readonly structuredOutputs: false;
6862
6862
  };
6863
6863
  };
6864
6864
  readonly auto: {
@@ -6909,7 +6909,7 @@ export declare const LLM_SERVICE_MODELS: {
6909
6909
  readonly reasoning: true;
6910
6910
  readonly webSearch: true;
6911
6911
  readonly jsonOutput: false;
6912
- readonly structuredOutputs: true;
6912
+ readonly structuredOutputs: false;
6913
6913
  };
6914
6914
  };
6915
6915
  readonly "aws-bedrock/anthropic.claude-opus-4-20250514-v1:0": {
@@ -6961,7 +6961,7 @@ export declare const LLM_SERVICE_MODELS: {
6961
6961
  readonly reasoning: true;
6962
6962
  readonly webSearch: true;
6963
6963
  readonly jsonOutput: false;
6964
- readonly structuredOutputs: true;
6964
+ readonly structuredOutputs: false;
6965
6965
  };
6966
6966
  };
6967
6967
  readonly "aws-bedrock/anthropic.claude-opus-4-6-v1": {
@@ -6986,8 +6986,8 @@ export declare const LLM_SERVICE_MODELS: {
6986
6986
  readonly tools: true;
6987
6987
  readonly reasoning: true;
6988
6988
  readonly webSearch: true;
6989
- readonly jsonOutput: true;
6990
- readonly structuredOutputs: true;
6989
+ readonly jsonOutput: false;
6990
+ readonly structuredOutputs: false;
6991
6991
  };
6992
6992
  };
6993
6993
  readonly "aws-bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0": {
@@ -7013,7 +7013,7 @@ export declare const LLM_SERVICE_MODELS: {
7013
7013
  readonly reasoning: true;
7014
7014
  readonly webSearch: true;
7015
7015
  readonly jsonOutput: false;
7016
- readonly structuredOutputs: true;
7016
+ readonly structuredOutputs: false;
7017
7017
  };
7018
7018
  };
7019
7019
  readonly "aws-bedrock/anthropic.claude-sonnet-4-6": {
@@ -7039,7 +7039,7 @@ export declare const LLM_SERVICE_MODELS: {
7039
7039
  readonly reasoning: true;
7040
7040
  readonly webSearch: true;
7041
7041
  readonly jsonOutput: false;
7042
- readonly structuredOutputs: true;
7042
+ readonly structuredOutputs: false;
7043
7043
  };
7044
7044
  };
7045
7045
  readonly "aws-bedrock/meta.llama3-1-8b-instruct-v1:0": {
@@ -11188,7 +11188,7 @@ export declare const LLM_SERVICE_MODELS: {
11188
11188
  readonly reasoning: false;
11189
11189
  readonly webSearch: true;
11190
11190
  readonly jsonOutput: false;
11191
- readonly structuredOutputs: true;
11191
+ readonly structuredOutputs: false;
11192
11192
  };
11193
11193
  };
11194
11194
  readonly "anthropic/claude-haiku-4-5-20251001": {
@@ -11214,7 +11214,7 @@ export declare const LLM_SERVICE_MODELS: {
11214
11214
  readonly reasoning: false;
11215
11215
  readonly webSearch: true;
11216
11216
  readonly jsonOutput: false;
11217
- readonly structuredOutputs: true;
11217
+ readonly structuredOutputs: false;
11218
11218
  };
11219
11219
  };
11220
11220
  readonly "anthropic/claude-opus-4-8": {
@@ -11318,7 +11318,7 @@ export declare const LLM_SERVICE_MODELS: {
11318
11318
  readonly reasoning: false;
11319
11319
  readonly webSearch: true;
11320
11320
  readonly jsonOutput: false;
11321
- readonly structuredOutputs: true;
11321
+ readonly structuredOutputs: false;
11322
11322
  };
11323
11323
  };
11324
11324
  readonly "aws-bedrock/anthropic.claude-opus-4-8": {
@@ -12181,7 +12181,7 @@ export declare const LLM_SERVICE_MODELS: {
12181
12181
  readonly reasoning: false;
12182
12182
  readonly webSearch: true;
12183
12183
  readonly jsonOutput: false;
12184
- readonly structuredOutputs: true;
12184
+ readonly structuredOutputs: false;
12185
12185
  };
12186
12186
  };
12187
12187
  readonly "llmapi-anthropic/claude-opus-4-8": {
@@ -12233,7 +12233,7 @@ export declare const LLM_SERVICE_MODELS: {
12233
12233
  readonly reasoning: true;
12234
12234
  readonly webSearch: true;
12235
12235
  readonly jsonOutput: false;
12236
- readonly structuredOutputs: true;
12236
+ readonly structuredOutputs: false;
12237
12237
  };
12238
12238
  };
12239
12239
  readonly "llmapi-openai/gpt-5-mini": {
@@ -18265,7 +18265,7 @@ export declare const LLM_SERVICE_MODELS: {
18265
18265
  readonly reasoning: true;
18266
18266
  readonly webSearch: true;
18267
18267
  readonly jsonOutput: false;
18268
- readonly structuredOutputs: true;
18268
+ readonly structuredOutputs: false;
18269
18269
  };
18270
18270
  };
18271
18271
  readonly "claude-sonnet-4-5-20250929": {
@@ -18291,7 +18291,7 @@ export declare const LLM_SERVICE_MODELS: {
18291
18291
  readonly reasoning: true;
18292
18292
  readonly webSearch: true;
18293
18293
  readonly jsonOutput: false;
18294
- readonly structuredOutputs: true;
18294
+ readonly structuredOutputs: false;
18295
18295
  };
18296
18296
  };
18297
18297
  readonly "claude-sonnet-4-6": {
@@ -18317,7 +18317,7 @@ export declare const LLM_SERVICE_MODELS: {
18317
18317
  readonly reasoning: true;
18318
18318
  readonly webSearch: true;
18319
18319
  readonly jsonOutput: false;
18320
- readonly structuredOutputs: true;
18320
+ readonly structuredOutputs: false;
18321
18321
  };
18322
18322
  };
18323
18323
  readonly "claude-haiku-4-5": {
@@ -18343,7 +18343,7 @@ export declare const LLM_SERVICE_MODELS: {
18343
18343
  readonly reasoning: false;
18344
18344
  readonly webSearch: true;
18345
18345
  readonly jsonOutput: false;
18346
- readonly structuredOutputs: true;
18346
+ readonly structuredOutputs: false;
18347
18347
  };
18348
18348
  };
18349
18349
  readonly "claude-haiku-4-5-20251001": {
@@ -18369,7 +18369,7 @@ export declare const LLM_SERVICE_MODELS: {
18369
18369
  readonly reasoning: false;
18370
18370
  readonly webSearch: true;
18371
18371
  readonly jsonOutput: false;
18372
- readonly structuredOutputs: true;
18372
+ readonly structuredOutputs: false;
18373
18373
  };
18374
18374
  };
18375
18375
  readonly "claude-opus-4-20250514": {
@@ -18421,7 +18421,7 @@ export declare const LLM_SERVICE_MODELS: {
18421
18421
  readonly reasoning: true;
18422
18422
  readonly webSearch: true;
18423
18423
  readonly jsonOutput: false;
18424
- readonly structuredOutputs: true;
18424
+ readonly structuredOutputs: false;
18425
18425
  };
18426
18426
  };
18427
18427
  readonly "claude-opus-4-5-20251101": {
@@ -18447,7 +18447,7 @@ export declare const LLM_SERVICE_MODELS: {
18447
18447
  readonly reasoning: true;
18448
18448
  readonly webSearch: true;
18449
18449
  readonly jsonOutput: false;
18450
- readonly structuredOutputs: true;
18450
+ readonly structuredOutputs: false;
18451
18451
  };
18452
18452
  };
18453
18453
  readonly "claude-opus-4-6": {
@@ -18472,8 +18472,8 @@ export declare const LLM_SERVICE_MODELS: {
18472
18472
  readonly tools: true;
18473
18473
  readonly reasoning: true;
18474
18474
  readonly webSearch: true;
18475
- readonly jsonOutput: true;
18476
- readonly structuredOutputs: true;
18475
+ readonly jsonOutput: false;
18476
+ readonly structuredOutputs: false;
18477
18477
  };
18478
18478
  };
18479
18479
  readonly "gemini-2.5-pro": {
@@ -21976,7 +21976,7 @@ export declare const LLM_SERVICE_MODELS: {
21976
21976
  readonly reasoning: true;
21977
21977
  readonly webSearch: true;
21978
21978
  readonly jsonOutput: false;
21979
- readonly structuredOutputs: true;
21979
+ readonly structuredOutputs: false;
21980
21980
  };
21981
21981
  };
21982
21982
  readonly "anthropic/claude-opus-4-20250514": {
@@ -22028,7 +22028,7 @@ export declare const LLM_SERVICE_MODELS: {
22028
22028
  readonly reasoning: true;
22029
22029
  readonly webSearch: true;
22030
22030
  readonly jsonOutput: false;
22031
- readonly structuredOutputs: true;
22031
+ readonly structuredOutputs: false;
22032
22032
  };
22033
22033
  };
22034
22034
  readonly "anthropic/claude-opus-4-6": {
@@ -22053,8 +22053,8 @@ export declare const LLM_SERVICE_MODELS: {
22053
22053
  readonly tools: true;
22054
22054
  readonly reasoning: true;
22055
22055
  readonly webSearch: true;
22056
- readonly jsonOutput: true;
22057
- readonly structuredOutputs: true;
22056
+ readonly jsonOutput: false;
22057
+ readonly structuredOutputs: false;
22058
22058
  };
22059
22059
  };
22060
22060
  readonly "anthropic/claude-sonnet-4-5": {
@@ -22080,7 +22080,7 @@ export declare const LLM_SERVICE_MODELS: {
22080
22080
  readonly reasoning: true;
22081
22081
  readonly webSearch: true;
22082
22082
  readonly jsonOutput: false;
22083
- readonly structuredOutputs: true;
22083
+ readonly structuredOutputs: false;
22084
22084
  };
22085
22085
  };
22086
22086
  readonly "anthropic/claude-sonnet-4-5-20250929": {
@@ -22106,7 +22106,7 @@ export declare const LLM_SERVICE_MODELS: {
22106
22106
  readonly reasoning: true;
22107
22107
  readonly webSearch: true;
22108
22108
  readonly jsonOutput: false;
22109
- readonly structuredOutputs: true;
22109
+ readonly structuredOutputs: false;
22110
22110
  };
22111
22111
  };
22112
22112
  readonly "anthropic/claude-sonnet-4-6": {
@@ -22132,7 +22132,7 @@ export declare const LLM_SERVICE_MODELS: {
22132
22132
  readonly reasoning: true;
22133
22133
  readonly webSearch: true;
22134
22134
  readonly jsonOutput: false;
22135
- readonly structuredOutputs: true;
22135
+ readonly structuredOutputs: false;
22136
22136
  };
22137
22137
  };
22138
22138
  readonly auto: {
@@ -22183,7 +22183,7 @@ export declare const LLM_SERVICE_MODELS: {
22183
22183
  readonly reasoning: true;
22184
22184
  readonly webSearch: true;
22185
22185
  readonly jsonOutput: false;
22186
- readonly structuredOutputs: true;
22186
+ readonly structuredOutputs: false;
22187
22187
  };
22188
22188
  };
22189
22189
  readonly "aws-bedrock/anthropic.claude-opus-4-20250514-v1:0": {
@@ -22235,7 +22235,7 @@ export declare const LLM_SERVICE_MODELS: {
22235
22235
  readonly reasoning: true;
22236
22236
  readonly webSearch: true;
22237
22237
  readonly jsonOutput: false;
22238
- readonly structuredOutputs: true;
22238
+ readonly structuredOutputs: false;
22239
22239
  };
22240
22240
  };
22241
22241
  readonly "aws-bedrock/anthropic.claude-opus-4-6-v1": {
@@ -22260,8 +22260,8 @@ export declare const LLM_SERVICE_MODELS: {
22260
22260
  readonly tools: true;
22261
22261
  readonly reasoning: true;
22262
22262
  readonly webSearch: true;
22263
- readonly jsonOutput: true;
22264
- readonly structuredOutputs: true;
22263
+ readonly jsonOutput: false;
22264
+ readonly structuredOutputs: false;
22265
22265
  };
22266
22266
  };
22267
22267
  readonly "aws-bedrock/anthropic.claude-sonnet-4-5-20250929-v1:0": {
@@ -22287,7 +22287,7 @@ export declare const LLM_SERVICE_MODELS: {
22287
22287
  readonly reasoning: true;
22288
22288
  readonly webSearch: true;
22289
22289
  readonly jsonOutput: false;
22290
- readonly structuredOutputs: true;
22290
+ readonly structuredOutputs: false;
22291
22291
  };
22292
22292
  };
22293
22293
  readonly "aws-bedrock/anthropic.claude-sonnet-4-6": {
@@ -22313,7 +22313,7 @@ export declare const LLM_SERVICE_MODELS: {
22313
22313
  readonly reasoning: true;
22314
22314
  readonly webSearch: true;
22315
22315
  readonly jsonOutput: false;
22316
- readonly structuredOutputs: true;
22316
+ readonly structuredOutputs: false;
22317
22317
  };
22318
22318
  };
22319
22319
  readonly "aws-bedrock/meta.llama3-1-8b-instruct-v1:0": {
@@ -26462,7 +26462,7 @@ export declare const LLM_SERVICE_MODELS: {
26462
26462
  readonly reasoning: false;
26463
26463
  readonly webSearch: true;
26464
26464
  readonly jsonOutput: false;
26465
- readonly structuredOutputs: true;
26465
+ readonly structuredOutputs: false;
26466
26466
  };
26467
26467
  };
26468
26468
  readonly "anthropic/claude-haiku-4-5-20251001": {
@@ -26488,7 +26488,7 @@ export declare const LLM_SERVICE_MODELS: {
26488
26488
  readonly reasoning: false;
26489
26489
  readonly webSearch: true;
26490
26490
  readonly jsonOutput: false;
26491
- readonly structuredOutputs: true;
26491
+ readonly structuredOutputs: false;
26492
26492
  };
26493
26493
  };
26494
26494
  readonly "anthropic/claude-opus-4-8": {
@@ -26592,7 +26592,7 @@ export declare const LLM_SERVICE_MODELS: {
26592
26592
  readonly reasoning: false;
26593
26593
  readonly webSearch: true;
26594
26594
  readonly jsonOutput: false;
26595
- readonly structuredOutputs: true;
26595
+ readonly structuredOutputs: false;
26596
26596
  };
26597
26597
  };
26598
26598
  readonly "aws-bedrock/anthropic.claude-opus-4-8": {
@@ -27455,7 +27455,7 @@ export declare const LLM_SERVICE_MODELS: {
27455
27455
  readonly reasoning: false;
27456
27456
  readonly webSearch: true;
27457
27457
  readonly jsonOutput: false;
27458
- readonly structuredOutputs: true;
27458
+ readonly structuredOutputs: false;
27459
27459
  };
27460
27460
  };
27461
27461
  readonly "llmapi-anthropic/claude-opus-4-8": {
@@ -27507,7 +27507,7 @@ export declare const LLM_SERVICE_MODELS: {
27507
27507
  readonly reasoning: true;
27508
27508
  readonly webSearch: true;
27509
27509
  readonly jsonOutput: false;
27510
- readonly structuredOutputs: true;
27510
+ readonly structuredOutputs: false;
27511
27511
  };
27512
27512
  };
27513
27513
  readonly "llmapi-openai/gpt-5-mini": {
@@ -528,7 +528,14 @@ export type LLMAssistanceOptions<Provider extends LLMProviders, Reporter extends
528
528
  * guard the call.
529
529
  */
530
530
  onAssistantNarration?: (text: string) => void;
531
+ onModelStepStarted?: () => void;
532
+ onToolCallRejected?: (call: LLMRejectedToolCall) => void;
531
533
  };
534
+ export interface LLMRejectedToolCall {
535
+ name: string;
536
+ input: Record<string, unknown>;
537
+ error: string;
538
+ }
532
539
  /**
533
540
  * Result type for assistance requests.
534
541
  */
@@ -1 +1 @@
1
- {"version":3,"file":"LLMService.typedefs.js","sourceRoot":"","sources":["../src/LLMService.typedefs.ts"],"names":[],"mappings":";;;AAmCA;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAoBD;;GAEG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;IAC/B,8CAA+B,CAAA;AACjC,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAkLD;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,mCAAuB,CAAA;AACzB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;GAEG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,gDAAuB,CAAA;IACvB,kDAAyB,CAAA;AAC3B,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AA4DD;;;;;GAKG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,8CAAsB,CAAA;IACtB,kDAA0B,CAAA;IAC1B,2CAAmB,CAAA;AACrB,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B;AAwMD;;GAEG;AACH,IAAY,sBAeX;AAfD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,yDAA+B,CAAA;IAC/B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,oDAA0B,CAAA;IAC1B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;AACzB,CAAC,EAfW,sBAAsB,sCAAtB,sBAAsB,QAejC;AAmPD;;;;;GAKG;AACH,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;IACvB,0DAAgC,CAAA;IAChC,wDAA8B,CAAA;AAChC,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC"}
1
+ {"version":3,"file":"LLMService.typedefs.js","sourceRoot":"","sources":["../src/LLMService.typedefs.ts"],"names":[],"mappings":";;;AAmCA;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yDAAyC,CAAA;IACzC,iCAAiB,CAAA;AACnB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAoBD;;GAEG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;IAC/B,8CAA+B,CAAA;AACjC,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAkLD;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,mCAAuB,CAAA;AACzB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;GAEG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,gDAAuB,CAAA;IACvB,kDAAyB,CAAA;AAC3B,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC;AA4DD;;;;;GAKG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,8CAAsB,CAAA;IACtB,kDAA0B,CAAA;IAC1B,2CAAmB,CAAA;AACrB,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B;AAwMD;;GAEG;AACH,IAAY,sBAeX;AAfD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,yDAA+B,CAAA;IAC/B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,oDAA0B,CAAA;IAC1B,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;IACvB,mDAAyB,CAAA;IACzB,iDAAuB,CAAA;AACzB,CAAC,EAfW,sBAAsB,sCAAtB,sBAAsB,QAejC;AA2PD;;;;;GAKG;AACH,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;IACvB,0DAAgC,CAAA;IAChC,wDAA8B,CAAA;AAChC,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC"}
@@ -12,6 +12,7 @@ import { type LLMAgentSubagent } from '../client/LLMAgent';
12
12
  */
13
13
  export declare enum LLMAgentEventTypes {
14
14
  AgentStarted = "agent_started",
15
+ AgentStepStarted = "agent_step_started",
15
16
  AgentMessage = "agent_message",
16
17
  AgentCompleted = "agent_completed",
17
18
  AgentFailed = "agent_failed",
@@ -19,6 +20,7 @@ export declare enum LLMAgentEventTypes {
19
20
  ToolCallCompleted = "tool_call_completed",
20
21
  ToolCallFailed = "tool_call_failed",
21
22
  ToolCallDenied = "tool_call_denied",
23
+ ToolCallRejected = "tool_call_rejected",
22
24
  SubagentStarted = "subagent_started",
23
25
  SubagentCompleted = "subagent_completed",
24
26
  SubagentFailed = "subagent_failed"
@@ -50,6 +52,9 @@ export interface LLMAgentStartedEvent extends LLMAgentEventBase {
50
52
  type: LLMAgentEventTypes.AgentStarted;
51
53
  input: string;
52
54
  }
55
+ export interface LLMAgentStepStartedEvent extends LLMAgentEventBase {
56
+ type: LLMAgentEventTypes.AgentStepStarted;
57
+ }
53
58
  /**
54
59
  * Visible assistant text the model produced in a tool-calling round that will
55
60
  * continue the loop — narration emitted alongside tool calls, before those
@@ -103,6 +108,12 @@ export interface LLMAgentToolCallDeniedEvent extends LLMAgentInvocationEventBase
103
108
  tool: string;
104
109
  reason: string;
105
110
  }
111
+ export interface LLMAgentToolCallRejectedEvent extends LLMAgentEventBase {
112
+ type: LLMAgentEventTypes.ToolCallRejected;
113
+ tool: string;
114
+ input: unknown;
115
+ error: string;
116
+ }
106
117
  export interface LLMAgentSubagentStartedEvent extends LLMAgentSubagentEventBase {
107
118
  type: LLMAgentEventTypes.SubagentStarted;
108
119
  input: string;
@@ -117,7 +128,7 @@ export interface LLMAgentSubagentFailedEvent extends LLMAgentSubagentEventBase {
117
128
  error: string;
118
129
  durationMs: number;
119
130
  }
120
- export type LLMAgentEvent = LLMAgentStartedEvent | LLMAgentMessageEvent | LLMAgentCompletedEvent | LLMAgentFailedEvent | LLMAgentToolCallStartedEvent | LLMAgentToolCallCompletedEvent | LLMAgentToolCallFailedEvent | LLMAgentToolCallDeniedEvent | LLMAgentSubagentStartedEvent | LLMAgentSubagentCompletedEvent | LLMAgentSubagentFailedEvent;
131
+ export type LLMAgentEvent = LLMAgentStartedEvent | LLMAgentStepStartedEvent | LLMAgentMessageEvent | LLMAgentCompletedEvent | LLMAgentFailedEvent | LLMAgentToolCallStartedEvent | LLMAgentToolCallCompletedEvent | LLMAgentToolCallFailedEvent | LLMAgentToolCallDeniedEvent | LLMAgentToolCallRejectedEvent | LLMAgentSubagentStartedEvent | LLMAgentSubagentCompletedEvent | LLMAgentSubagentFailedEvent;
121
132
  /**
122
133
  * May be async: a returned promise's rejection is caught and logged, so a
123
134
  * failing listener (WS publish, DB persist) never affects the agent run.
@@ -11,6 +11,7 @@ exports.LLMAgentEventTypes = void 0;
11
11
  var LLMAgentEventTypes;
12
12
  (function (LLMAgentEventTypes) {
13
13
  LLMAgentEventTypes["AgentStarted"] = "agent_started";
14
+ LLMAgentEventTypes["AgentStepStarted"] = "agent_step_started";
14
15
  LLMAgentEventTypes["AgentMessage"] = "agent_message";
15
16
  LLMAgentEventTypes["AgentCompleted"] = "agent_completed";
16
17
  LLMAgentEventTypes["AgentFailed"] = "agent_failed";
@@ -18,6 +19,7 @@ var LLMAgentEventTypes;
18
19
  LLMAgentEventTypes["ToolCallCompleted"] = "tool_call_completed";
19
20
  LLMAgentEventTypes["ToolCallFailed"] = "tool_call_failed";
20
21
  LLMAgentEventTypes["ToolCallDenied"] = "tool_call_denied";
22
+ LLMAgentEventTypes["ToolCallRejected"] = "tool_call_rejected";
21
23
  LLMAgentEventTypes["SubagentStarted"] = "subagent_started";
22
24
  LLMAgentEventTypes["SubagentCompleted"] = "subagent_completed";
23
25
  LLMAgentEventTypes["SubagentFailed"] = "subagent_failed";
@@ -1 +1 @@
1
- {"version":3,"file":"agentRun.typedefs.js","sourceRoot":"","sources":["../../src/client/agentRun.typedefs.ts"],"names":[],"mappings":";;;AAeA;;;;;;GAMG;AACH,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B,oDAA8B,CAAA;IAC9B,oDAA8B,CAAA;IAC9B,wDAAkC,CAAA;IAClC,kDAA4B,CAAA;IAC5B,2DAAqC,CAAA;IACrC,+DAAyC,CAAA;IACzC,yDAAmC,CAAA;IACnC,yDAAmC,CAAA;IACnC,0DAAoC,CAAA;IACpC,8DAAwC,CAAA;IACxC,wDAAkC,CAAA;AACpC,CAAC,EAZW,kBAAkB,kCAAlB,kBAAkB,QAY7B"}
1
+ {"version":3,"file":"agentRun.typedefs.js","sourceRoot":"","sources":["../../src/client/agentRun.typedefs.ts"],"names":[],"mappings":";;;AAeA;;;;;;GAMG;AACH,IAAY,kBAcX;AAdD,WAAY,kBAAkB;IAC5B,oDAA8B,CAAA;IAC9B,6DAAuC,CAAA;IACvC,oDAA8B,CAAA;IAC9B,wDAAkC,CAAA;IAClC,kDAA4B,CAAA;IAC5B,2DAAqC,CAAA;IACrC,+DAAyC,CAAA;IACzC,yDAAmC,CAAA;IACnC,yDAAmC,CAAA;IACnC,6DAAuC,CAAA;IACvC,0DAAoC,CAAA;IACpC,8DAAwC,CAAA;IACxC,wDAAkC,CAAA;AACpC,CAAC,EAdW,kBAAkB,kCAAlB,kBAAkB,QAc7B"}
@@ -187,6 +187,23 @@ class LLMAgentRunner {
187
187
  this.emitAgentMessage(run, session.runId, text);
188
188
  }
189
189
  : undefined,
190
+ onModelStepStarted: run.onEvent
191
+ ? () => this.emit(run.onEvent, {
192
+ type: agentRun_typedefs_1.LLMAgentEventTypes.AgentStepStarted,
193
+ agent: run.agentName,
194
+ runId: session.runId,
195
+ })
196
+ : undefined,
197
+ onToolCallRejected: run.onEvent
198
+ ? (call) => this.emit(run.onEvent, {
199
+ type: agentRun_typedefs_1.LLMAgentEventTypes.ToolCallRejected,
200
+ agent: run.agentName,
201
+ runId: session.runId,
202
+ tool: call.name,
203
+ input: call.input,
204
+ error: call.error,
205
+ })
206
+ : undefined,
190
207
  };
191
208
  try {
192
209
  const sendResult = await service.assistInChat(assistOptions);