@jeffusion/bungee-llms 5.20.0 → 5.22.0

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 (32) hide show
  1. package/README.md +8 -31
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +2158 -5530
  4. package/dist/plugin-api.d.ts +1 -4
  5. package/dist/plugin-api.js +4069 -8408
  6. package/dist/protocol-session/index.d.ts +14 -0
  7. package/dist/protocol-session/request.d.ts +5 -0
  8. package/dist/protocol-session/response.d.ts +23 -0
  9. package/dist/protocol-session/schema.d.ts +5 -0
  10. package/dist/protocol-session/stream.d.ts +35 -0
  11. package/dist/protocol-session/types.d.ts +48 -0
  12. package/dist/protocol-session/validation.d.ts +5 -0
  13. package/dist/providers/openai/index.d.ts +0 -1
  14. package/dist/responses-codec/common.d.ts +17 -2
  15. package/dist/responses-codec/events.d.ts +7 -1
  16. package/dist/responses-codec/index.d.ts +1 -1
  17. package/dist/responses-codec/request-preferences.d.ts +3 -0
  18. package/dist/responses-codec/request.d.ts +3 -1
  19. package/dist/responses-codec/web-search.d.ts +3 -0
  20. package/package.json +3 -3
  21. package/dist/protocol-converters/anthropic-to-gemini.converter.d.ts +0 -62
  22. package/dist/protocol-converters/anthropic-to-openai.converter.d.ts +0 -110
  23. package/dist/protocol-converters/base.d.ts +0 -38
  24. package/dist/protocol-converters/default-registry.d.ts +0 -1
  25. package/dist/protocol-converters/gemini-to-anthropic.converter.d.ts +0 -57
  26. package/dist/protocol-converters/gemini-to-openai.converter.d.ts +0 -31
  27. package/dist/protocol-converters/index.d.ts +0 -10
  28. package/dist/protocol-converters/openai-to-anthropic.converter.d.ts +0 -27
  29. package/dist/protocol-converters/openai-to-gemini.converter.d.ts +0 -32
  30. package/dist/protocol-converters/registry.d.ts +0 -9
  31. package/dist/protocol-converters/utils.d.ts +0 -71
  32. package/dist/providers/openai/messages-compat-normalization.d.ts +0 -42
package/README.md CHANGED
@@ -1,38 +1,15 @@
1
1
  # @jeffusion/bungee-llms
2
2
 
3
- Independent LLM adapters and protocol conversion package for Bungee.
3
+ Pure protocol sessions, canonical messages/tools, streaming state machines and token accounting for Bungee.
4
4
 
5
- ## Scope
6
-
7
- - Provider-agnostic protocol conversion abstractions
8
- - Adapter registry and conversion service
9
- - Provider catalog and runtime container
10
- - OpenAI/Anthropic/Gemini protocol converters (request/response/stream) centralized in `src/protocol-converters`
11
- - Runtime registration helper `registerDefaultProtocolConverters()` for plugin/wrapper layers
12
-
13
- ## Usage
5
+ Gateway plugins consume `llm-protocol-adapter` public services. The adapter executes the codec locally in each worker; generation bodies never go through control RPC. Provider runtime abstractions remain available to other package consumers, but are not a second gateway conversion path.
14
6
 
15
7
  ```ts
16
- import {
17
- LLMProtocolAdapterRegistry,
18
- LLMProtocolConversionService,
19
- LLMSRuntime,
20
- registerDefaultProtocolConverters
21
- } from '@jeffusion/bungee-llms';
22
-
23
- registerDefaultProtocolConverters();
8
+ import {createProtocolSession, describeProtocolConversion} from '@jeffusion/bungee-llms/plugin-api';
9
+ const session = createProtocolSession({sourceProtocol: 'responses', targetProtocol: 'chat_completions', model: 'model'});
10
+ const request = session.convertRequest({input: 'Hello'});
11
+ // Feed the target JSON response or parsed SSE events into the same session.
12
+ session.dispose();
24
13
  ```
25
14
 
26
- ### Plugin/Wrapper Stable Facade
27
-
28
- For plugin and wrapper layers, prefer the dedicated stable entrypoint to reduce coupling to internal file layout:
29
-
30
- ```ts
31
- import {
32
- type AIConverter,
33
- ProtocolTransformerRegistry,
34
- registerDefaultProtocolConverters,
35
- OpenAIProtocolConversion,
36
- OpenAIMessagesCompatibilityNormalizer
37
- } from '@jeffusion/bungee-llms/plugin-api';
38
- ```
15
+ The matrix has four passthrough pairs, ten direct conversions and two rejected Responses/Gemini pairs. Explicit reasoning controls require a verified wire policy. Tools, history and output constraints fail with a safe reason and param when their semantics cannot be preserved. See [LLM Protocol Adapter](../../docs/reference/llm-protocol-adapter.md).
package/dist/index.d.ts CHANGED
@@ -7,6 +7,6 @@ export * from './registry';
7
7
  export * from './service';
8
8
  export * from './openai';
9
9
  export * from './openai-anthropic';
10
- export * from './protocol-converters';
11
10
  export * from './token-accounting';
12
11
  export * from './responses-codec';
12
+ export * from './protocol-session';