@plurnk/plurnk-providers 3.0.3 → 5.0.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 (75) hide show
  1. package/.env.defaults +2 -4
  2. package/README.md +2 -2
  3. package/SPEC.md +190 -82
  4. package/dist/AiSdkProvider.d.ts +1 -3
  5. package/dist/AiSdkProvider.d.ts.map +1 -1
  6. package/dist/AiSdkProvider.js +20 -41
  7. package/dist/AiSdkProvider.js.map +1 -1
  8. package/dist/AiSdkRequestBody.d.ts.map +1 -1
  9. package/dist/AiSdkRequestBody.js +3 -1
  10. package/dist/AiSdkRequestBody.js.map +1 -1
  11. package/dist/LeadingReasoning.js +3 -3
  12. package/dist/LeadingReasoning.js.map +1 -1
  13. package/dist/Mock.d.ts +3 -3
  14. package/dist/Mock.d.ts.map +1 -1
  15. package/dist/Mock.js.map +1 -1
  16. package/dist/Pool.d.ts +1 -2
  17. package/dist/Pool.d.ts.map +1 -1
  18. package/dist/Pool.js +7 -8
  19. package/dist/Pool.js.map +1 -1
  20. package/dist/ProviderRegistry.d.ts.map +1 -1
  21. package/dist/ProviderRegistry.js +8 -4
  22. package/dist/ProviderRegistry.js.map +1 -1
  23. package/dist/RequestFields.d.ts.map +1 -1
  24. package/dist/RequestFields.js +15 -7
  25. package/dist/RequestFields.js.map +1 -1
  26. package/dist/accounting.d.ts.map +1 -1
  27. package/dist/accounting.js +8 -5
  28. package/dist/accounting.js.map +1 -1
  29. package/dist/aiSdkTransport.d.ts.map +1 -1
  30. package/dist/aiSdkTransport.js +41 -61
  31. package/dist/aiSdkTransport.js.map +1 -1
  32. package/dist/catalogProvider.d.ts +2 -3
  33. package/dist/catalogProvider.d.ts.map +1 -1
  34. package/dist/catalogProvider.js +9 -9
  35. package/dist/catalogProvider.js.map +1 -1
  36. package/dist/compatibleProvider.d.ts +1 -1
  37. package/dist/compatibleProvider.d.ts.map +1 -1
  38. package/dist/compatibleProvider.js +22 -10
  39. package/dist/compatibleProvider.js.map +1 -1
  40. package/dist/cost.d.ts.map +1 -1
  41. package/dist/cost.js +18 -8
  42. package/dist/cost.js.map +1 -1
  43. package/dist/env.d.ts +9 -8
  44. package/dist/env.d.ts.map +1 -1
  45. package/dist/env.js +4 -4
  46. package/dist/env.js.map +1 -1
  47. package/dist/errors.d.ts.map +1 -1
  48. package/dist/errors.js +7 -7
  49. package/dist/errors.js.map +1 -1
  50. package/dist/model-options.d.ts.map +1 -1
  51. package/dist/model-options.js +1 -1
  52. package/dist/model-options.js.map +1 -1
  53. package/dist/native-tools.d.ts.map +1 -1
  54. package/dist/native-tools.js +3 -0
  55. package/dist/native-tools.js.map +1 -1
  56. package/dist/ollama.d.ts.map +1 -1
  57. package/dist/ollama.js +3 -1
  58. package/dist/ollama.js.map +1 -1
  59. package/dist/promptTokens.d.ts.map +1 -1
  60. package/dist/promptTokens.js +11 -5
  61. package/dist/promptTokens.js.map +1 -1
  62. package/dist/providerError.d.ts +1 -1
  63. package/dist/providerError.d.ts.map +1 -1
  64. package/dist/providerError.js +2 -3
  65. package/dist/providerError.js.map +1 -1
  66. package/dist/sdkModels.d.ts.map +1 -1
  67. package/dist/sdkModels.js +9 -3
  68. package/dist/sdkModels.js.map +1 -1
  69. package/dist/types.d.ts +1 -1
  70. package/dist/types.d.ts.map +1 -1
  71. package/dist/usage.d.ts +1 -1
  72. package/dist/usage.d.ts.map +1 -1
  73. package/dist/usage.js +18 -5
  74. package/dist/usage.js.map +1 -1
  75. package/package.json +6 -6
package/.env.defaults CHANGED
@@ -51,6 +51,8 @@ PLURNK_PROVIDERS_REASONING_RESPONSE_STYLE=verbatim
51
51
  # PLURNK_PROVIDERS_REASONING_ON_BODY='{"enable_thinking":true}'
52
52
  # PLURNK_PROVIDERS_REASONING_OFF_BODY='{"enable_thinking":false}'
53
53
  # PLURNK_PROVIDERS_REASONING_EFFORTS=low,medium,high
54
+ # A llama-server route admits off and adaptive; declare the fixed efforts its chat template
55
+ # distinguishes, e.g. PLURNK_PROVIDERS_REASONING_EFFORTS_<alias>=low,medium,xhigh.
54
56
  # PLURNK_PROVIDERS_REASONING_TRANSPORT_EFFORTS=none,low,medium,high
55
57
  # PLURNK_PROVIDERS_OPTIONS_NAMESPACE=openrouter
56
58
  # PLURNK_PROVIDERS_REASONING_ADAPTIVE_BODY='{}'
@@ -111,10 +113,6 @@ PLURNK_PROVIDERS_CACHE_WRITE_POLICY=stable-system
111
113
  PLURNK_PROVIDERS_OPERATION_TIMEOUT=2700000
112
114
  # Discovery and tokenizer HTTP requests only; never a generation deadline.
113
115
  PLURNK_PROVIDERS_FETCH_TIMEOUT=600000
114
- # A response billed for this many more output tokens than it streamed characters (text and reasoning)
115
- # never delivered its output; it fails as output_dropped. Native tool calls are retained with a
116
- # warning, not retried for this reason. Reasoning billed but not streamed is exempt. 0 = off.
117
- PLURNK_PROVIDERS_DROPPED_OUTPUT_TOKENS=32
118
116
  # Retries for 429, Retry-After, or X-Should-Retry:true; 0 = none. Other failures return immediately
119
117
  # to Core's separate recovery window. Retry-After takes precedence over backoff.
120
118
  PLURNK_PROVIDERS_RETRY_ATTEMPTS=3
package/README.md CHANGED
@@ -221,7 +221,7 @@ One specimen at a time, deterministically:
221
221
 
222
222
  ```sh
223
223
  cd plurnk-core
224
- npm run test:live:specimen -- "<test-name-pattern>"
224
+ npm run test:live -- --specimen "<exact specimen name>"
225
225
  ```
226
226
 
227
227
  The selector inserts `--test-name-pattern` before the expanded live file list in
@@ -256,5 +256,5 @@ npm run test:lint -w @plurnk/plurnk-providers
256
256
  npm run test:unit -w @plurnk/plurnk-providers
257
257
  ```
258
258
 
259
- `npm run test:providersPing` is an explicit paid diagnostic; it calls each
259
+ `npm run probe:providers` is an explicit paid diagnostic; it calls each
260
260
  keyed provider once and prints the retained sanitized evidence directory.
package/SPEC.md CHANGED
@@ -6,6 +6,14 @@ ordinary provider protocols.
6
6
 
7
7
  ## §1 Ownership
8
8
 
9
+ <!-- map -->
10
+ | Tag | Promise |
11
+ | --- | --- |
12
+ | {§provider-runtime-neutral-accounting} | `@plurnk/plurnk-providers/accounting` — Provider-request aggregation, Models.dev cost estimation, and their… |
13
+ | {§provider-runtime-neutral-errors} | `@plurnk/plurnk-providers/errors` — Normalized `ProviderError`, `ProviderErrorKind`, and the types of its… |
14
+ | {§provider-runtime-neutral-openai} | `@plurnk/plurnk-providers/openai` — The OpenAI-compatible provider: SDK transport, request capture,… |
15
+ <!-- /map -->
16
+
9
17
  The provider stack has four owners:
10
18
 
11
19
  1. Models.dev supplies a release-time snapshot of provider package, API
@@ -22,20 +30,39 @@ model prefix, context window, price, or vendor request shape into a PLURNK
22
30
  table. A missing or wrong catalog fact is fixed upstream, overridden through a
23
31
  provider declaration, or left explicitly unknown.
24
32
 
25
- The package exposes two runtime-neutral public surfaces:
33
+ The package exposes three runtime-neutral public surfaces:
26
34
 
27
35
  | Surface | Contract |
28
36
  | --- | --- |
29
37
  | §provider-runtime-neutral-accounting `@plurnk/plurnk-providers/accounting` | Provider-request aggregation, Models.dev cost estimation, and their wire types. |
30
38
  | §provider-runtime-neutral-errors `@plurnk/plurnk-providers/errors` | Normalized `ProviderError`, `ProviderErrorKind`, and the types of its attempt, accounting, and capacity evidence. |
39
+ | §provider-runtime-neutral-openai `@plurnk/plurnk-providers/openai` | The OpenAI-compatible provider: SDK transport, request capture, accounting, capacity and error normalization, reaching no Node built-in. |
31
40
 
32
- Both surfaces re-export the package's sole implementations without evaluating
41
+ All three re-export the package's sole implementations without evaluating
33
42
  Node-only provider discovery, filesystem defaults, or runtime construction.
34
43
  The package root remains the Node provider-runtime composition surface and is
35
44
  not a Worker entrypoint.
36
45
 
37
46
  ## §2 Provider interface
38
47
 
48
+ <!-- map -->
49
+ | Tag | Promise |
50
+ | --- | --- |
51
+ | {§provider-interface} | `Provider` exposes immutable model facts and one generation operation: |
52
+ | {§provider-prompt-measurement} | `PromptTokenMeasurement` is a discriminated request-level result: |
53
+ | {§provider-capacity-admission} | `assessRequestCapacity` intersects every known physical input constraint |
54
+ | {§provider-monetary-evidence} | One precedence path converts each physical provider request into {§provider-cost} evidence before the request… |
55
+ | {§provider-cache-identity} | `generate` requires a non-empty, stable, opaque `workerId`. |
56
+ | {§provider-call-kind} | `callKind` is either `emission` (the response is a PLURNK turn emission) or `bare` (the response is… |
57
+ | {§provider-native-tools-disabled} | Generation requests declare no native tools and select the SDK's portable `none` tool choice, for emissions… |
58
+ | {§provider-generation-completion} | Stream consumption follows the provider's completion boundary, subject to caller cancellation and configured… |
59
+ | {§provider-request-observer} | When a consumer supplies the request observer, the adapter opens one durable identity through it immediately… |
60
+ | {§provider-dispatched-request} | With `PLURNK_PROVIDERS_RAWBODY` enabled, installed SDK transports also retain the exact serialized generation… |
61
+ | {§provider-reasoning-observer} | When a consumer supplies `observeReasoning`, the provider synchronously delivers each exact, ordered,… |
62
+ | {§provider-finish-reason} | The finish reason is the AI SDK's unified classification |
63
+ | {§provider-tagged-reasoning} | Structured provider or SDK reasoning fields are authoritative. |
64
+ <!-- /map -->
65
+
39
66
  §provider-interface `Provider` exposes immutable model facts and one generation
40
67
  operation:
41
68
 
@@ -93,19 +120,20 @@ provided its detail names the cause; one unable to quantify anything returns
93
120
  `unavailable`. A malformed measurement is a provider contract violation and
94
121
  fails hard.
95
122
 
96
- §provider-capacity-admission `assessRequestCapacity` intersects every known
97
- physical input constraint: independent `maxInputTokens` and
98
- `contextWindow - outputFloor`, the input wall ({§provider-output-floor}). Its result is `admit`, `reject`, or `defer` and
99
- retains the complete limit and measurement evidence. Exact fit admits; exact
100
- overflow of the wall rejects; a prompt between the curation reservation and the wall is admitted with its grant flexed down. A proven upper bound admits only when it fits. Unknown limits,
101
- an upper bound above a limit, estimates, and unavailable measurements defer to
102
- the upstream provider as capacity oracle. The curation reservation's intersection, `maxInputTokens` and `contextWindow - outputBudget`, is
103
- exposed as `inputCapacity`, the line Core packs the room against; the wall's, as `inputWall`; `null` means the available limits cannot establish
104
- one. A known combined context and output budget must leave positive input
105
- capacity. Consumers may display or use that fact as policy, but MUST NOT
106
- substitute their own content heuristic for request-shaped admission. A consumer
107
- may assess a request before sending it; `generate` repeats the assessment as its
108
- own guard.
123
+ §provider-capacity-admission **`assessRequestCapacity` intersects every known physical input constraint** — independent `maxInputTokens` and `contextWindow - outputFloor`, the input wall ({§provider-output-floor}) — and answers `admit`, `reject`, or `defer`, retaining the complete limit and measurement evidence. A consumer may assess a request before sending it; `generate` repeats the assessment as its own guard. Consumers may display or use that fact as policy, but MUST NOT substitute their own content heuristic for request-shaped admission.
124
+
125
+ | Measurement | Verdict |
126
+ | --- | --- |
127
+ | Exact fit | admit |
128
+ | Exact overflow of the wall | reject |
129
+ | A prompt between the curation reservation and the wall | admitted with its grant flexed down |
130
+ | A proven upper bound | admits only when it fits |
131
+ | Unknown limits, an upper bound above a limit, estimates, and unavailable measurements | defer to the upstream provider as capacity oracle |
132
+
133
+ | Exposed | Meaning |
134
+ | --- | --- |
135
+ | `inputCapacity` | the curation reservation's intersection, `maxInputTokens` and `contextWindow - outputBudget`: the line Core packs the room against |
136
+ | `inputWall` | the wall's; `null` means the available limits cannot establish one; a known combined context and output budget must leave positive input capacity |
109
137
 
110
138
  `tokenize` is the separate content-token capability and exists only when the
111
139
  endpoint exposes its real vocabulary. Content tokenization does not substitute
@@ -258,10 +286,15 @@ cacheReadTokens, cacheWriteTokens ⊆ inputTokens
258
286
  reasoningTokens ⊆ outputTokens
259
287
  ```
260
288
 
261
- Unknown fields remain absent. Ordinary vendor finish reasons normalize to
262
- `stop`, `length`, `tool_calls`, or `content_filter`; an unknown value becomes
263
- `null` and emits a warning. `resource_interrupted` is the distinct failed-attempt
264
- disposition defined by {§provider-interrupted-attempt}.
289
+ Unknown fields remain absent.
290
+
291
+ §provider-finish-reason **The finish reason is the AI SDK's unified classification**, never a
292
+ second reading of the vendor's string: `stop`, `length`,
293
+ `tool-calls` → `tool_calls`, `content-filter` → `content_filter`; `error` fails the attempt
294
+ ({§provider-generation-failed}); `other` is `null`. The raw vendor value rides beside it as
295
+ `rawFinishReason`. One upstream semantic the SDK folds into `other` stays distinct: the exact
296
+ `insufficient_system_resource` is `resource_interrupted`, the failed-attempt disposition defined by
297
+ {§provider-interrupted-attempt}.
265
298
 
266
299
  ### Tagged reasoning responses
267
300
 
@@ -295,12 +328,28 @@ rail observed.
295
328
 
296
329
  ## §3 AI SDK boundary
297
330
 
331
+ <!-- map -->
332
+ | Tag | Promise |
333
+ | --- | --- |
334
+ | {§provider-sdk-boundary} | Cataloged providers instantiate their Models.dev-declared AI SDK package. |
335
+ | {§operator-cost-override} | Models.dev is the rate starting point; the operator may overlay it. |
336
+ | {§provider-effort} | The portable vocabulary comes from {§effort-wire}. |
337
+ | {§provider-readable-reasoning} | Route-owned options may request exposed reasoning text. |
338
+ | {§provider-sdk-warning} | AI SDK compatibility, unsupported-feature, deprecation, and other call warnings become source-attributed… |
339
+ | {§provider-cache-affinity} | Cache affinity is route-owned request projection. |
340
+ | {§provider-model-options} | A model family's native options are a provider declaration. |
341
+ | {§provider-cache-write-policy} | Cache-write policy is separate from affinity. |
342
+ | {§deepseek-reasoning-request} | Direct DeepSeek uses the panel's request-field declarations under {§provider-wire-declaration}. |
343
+ | {§provider-wire-declaration} | Request-field declarations |
344
+ <!-- /map -->
345
+
298
346
  §provider-sdk-boundary Cataloged providers instantiate their
299
347
  Models.dev-declared AI SDK package.
300
348
  Standard request shaping, streaming, usage, and vendor error parsing belong to
301
349
  the SDK. PLURNK supplies cancellation and deadline signals and owns the sole
302
350
  cross-attempt scheduler so every physical request remains observable and
303
- accountable.
351
+ accountable. The adapter hands the SDK the conversation as authored: a leading
352
+ system message reaches the wire as the request's system message.
304
353
 
305
354
  | Usage input | Normalization |
306
355
  | --- | --- |
@@ -485,7 +534,10 @@ openai-compatible (DeepInfra, Together) write `reasoning_effort` from their own
485
534
  §provider-configuration Every operational value is an environment knob
486
535
  documented in `.env.defaults`.
487
536
  There are no hidden tuning constants. Every `PLURNK_PROVIDERS_*` knob may be
488
- scoped to an alias by appending `_<alias>`; the scoped value wins.
537
+ scoped to an alias by appending `_<alias>`; the scoped value wins, and the alias
538
+ segment folds case. The scoping takes a closed list of knob names: a consumer
539
+ scopes its own knobs by passing its list, and neither list reaches the other's
540
+ knobs.
489
541
  Each projection reads one fresh environment snapshot without modifying its
490
542
  source; later projections observe later configuration, never a cached view.
491
543
 
@@ -511,6 +563,16 @@ defaults.
511
563
 
512
564
  ## §5 Resolution
513
565
 
566
+ <!-- map -->
567
+ | Tag | Promise |
568
+ | --- | --- |
569
+ | {§provider-resolution} | `PLURNK_MODEL_<alias>=<provider>/<model-id>` declares an alias. |
570
+ | {§model-catalog-readiness} | Catalog readiness and construction share one local configuration predicate. |
571
+ | {§provider-input-modalities} | Native input parts |
572
+ | {§model-fact-resolution} | Model fact precedence |
573
+ | {§provider-fact-authority} | Provider declarations configure facts, not credentials, and Models.dev is authoritative for cataloged… |
574
+ <!-- /map -->
575
+
514
576
  §provider-resolution `PLURNK_MODEL_<alias>=<provider>/<model-id>` declares an
515
577
  alias.
516
578
  `PLURNK_MODEL=<selector>` selects either a declared alias or an exact
@@ -532,21 +594,15 @@ model request.
532
594
 
533
595
  ### §provider-input-modalities Native input parts
534
596
 
535
- A provider declares `inputModalities`, the set of native non-text inputs its model
536
- accepts, from the catalog's input modalities (Models.dev `modalities.input` minus
537
- `text`, kept to the vocabulary `image`, `pdf`, `audio`, `video`; empty when the
538
- model is unknown). A user `ChatMessage` may then carry text beside the AI SDK's
539
- current `{ type: "file", data: bytes, mediaType }` part; `mediaType` distinguishes
540
- an image, PDF, audio, or future native input without a second internal part shape. The
541
- AI SDK transport forwards those parts as the model's native file inputs; it
542
- alone serializes the canonical model and messages before provider extension
543
- fields are merged. System and assistant messages stay text, and prompt-token estimates count text
544
- only, the provider's reported usage owning each part's cost. A pool declares a
545
- modality only when every backend does; the Mock declares them by option and
546
- records every request it receives. Which parts actually ride a request is the
547
- service's decision per attachment ({§packet-attachment-parts} in the core specification).
548
- An accepted modality does not imply every codec/container is supported: SDK or endpoint
549
- format rejections remain provider errors, never silent omission or a text-only substitute.
597
+ A provider declares `inputModalities`, the set of native non-text inputs its model accepts, from the catalog's input modalities (Models.dev `modalities.input` minus `text`, kept to the vocabulary `image`, `pdf`, `audio`, `video`; empty when the model is unknown). Which parts actually ride a request is the service's decision per attachment ({§packet-attachment-parts} in the core specification).
598
+
599
+ | Fact | Rule |
600
+ | --- | --- |
601
+ | The part | a user `ChatMessage` may carry text beside the AI SDK's current `{ type: "file", data: bytes, mediaType }` part; `mediaType` distinguishes an image, PDF, audio, or future native input without a second internal part shape |
602
+ | The transport | the AI SDK transport forwards those parts as the model's native file inputs; it alone serializes the canonical model and messages before provider extension fields are merged |
603
+ | Other messages | system and assistant messages stay text, and prompt-token estimates count text only, the provider's reported usage owning each part's cost |
604
+ | Pools and the Mock | a pool declares a modality only when every backend does; the Mock declares them by option and records every request it receives |
605
+ | Codecs | an accepted modality does not imply every codec/container is supported: SDK or endpoint format rejections remain provider errors, never silent omission or a text-only substitute |
550
606
 
551
607
  ### §model-fact-resolution Model fact precedence
552
608
 
@@ -655,6 +711,14 @@ model physics. `Discovery.packageAttributions` carries the canonical package map
655
711
 
656
712
  ## §7 Local capabilities
657
713
 
714
+ <!-- map -->
715
+ | Tag | Promise |
716
+ | --- | --- |
717
+ | {§provider-local-capabilities} | The `openai` local adapter probes `/v1/models`. |
718
+ | {§llama-template-effort} | A detected llama-server rail admits `off` and `adaptive`, and a fixed effort only where the operator declares… |
719
+ | {§llama-reasoning-request} | The allowance is cumulative across the complete response. |
720
+ <!-- /map -->
721
+
658
722
  §provider-local-capabilities The `openai` local adapter probes `/v1/models`. A
659
723
  llama-server fingerprint may
660
724
  also expose:
@@ -679,13 +743,17 @@ OpenAI-compatible generation endpoint through the SDK adapter.
679
743
  For a detected llama-server, PLURNK sends the complete reasoning contract on
680
744
  every request:
681
745
 
682
- | Posture | Template activation | `thinking_budget_tokens` |
683
- |---|---:|---:|
684
- | `off` | false | `0` |
685
- | `adaptive` | true | configured reasoning subset, otherwise omitted |
746
+ | Posture | Template activation | Template `reasoning_effort` | `thinking_budget_tokens` |
747
+ |---|---:|---|---:|
748
+ | `off` | false | none | `0` |
749
+ | `adaptive` | true | none | configured reasoning subset, otherwise omitted |
750
+ | A declared fixed effort | true | the effort's name | configured reasoning subset, otherwise omitted |
686
751
 
687
- The template control cannot express distinct fixed effort levels, so this
688
- adapter advertises only `off` and `adaptive`.
752
+ §llama-template-effort A detected llama-server rail admits `off` and `adaptive`, and a fixed
753
+ effort only where the operator declares it (`REASONING_EFFORTS`,
754
+ {§provider-wire-declaration}). The chat template decides what each level means and which
755
+ levels it accepts; PLURNK infers neither from the template nor from the model's name, and a
756
+ template that refuses a declared level answers on the first request.
689
757
 
690
758
  The allowance is contained by the request's total output budget. Template calls
691
759
  normally use `reasoning_format: "auto"` for a separate
@@ -700,8 +768,22 @@ later reasoning block does not replenish it. Template parsing, the reasoning
700
768
  sampler, normalized usage, and the returned reasoning channel MUST agree on that
701
769
  response boundary.
702
770
 
771
+ ## Probes
772
+
773
+ §provider-ping-probe **`npm run probe:providers` reaches every keyed provider once, by one cheapest declared route.** Planning selects, per provider that has a credential, its cheapest declared alias; a provider-named alias resolves that provider's own unpriced route without guessing another model, a catalog key with no declared route stays explicitly red, and several unpriced aliases of one provider are one ambiguous provider, never guessed routes. Execution invokes every selected route exactly once and preserves red outcomes. Each attempted provider leaves one safe JSON record: response evidence keeps its structure and no provider scalar values, retained diagnostics redact credentials, account identity and URL authority, and secret discovery never mistakes a token-limit control for a credential.
774
+
775
+ §token-envelope-probe **`npm run probe:tokens` measures output-token envelopes for the aliases named explicitly, and no other.** Its output-token modes distinguish the configured policy from the model's physics.
776
+
703
777
  ## §8 Request authority
704
778
 
779
+ <!-- map -->
780
+ | Tag | Promise |
781
+ | --- | --- |
782
+ | {§provider-request-authority} | The caller's `sampling` bag expresses sampling intent. |
783
+ | {§provider-request-controls} | A configured service tier or logprobs count reaches a native route only through the per-call option its SDK… |
784
+ | {§openrouter-app-attribution} | A route on the OpenRouter SDK identifies the calling application only as its provider declares. |
785
+ <!-- /map -->
786
+
705
787
  §provider-request-authority The caller's `sampling` bag expresses sampling
706
788
  intent. It cannot override:
707
789
 
@@ -750,6 +832,25 @@ both.
750
832
 
751
833
  ## §9 Failures, retries, and cancellation
752
834
 
835
+ <!-- map -->
836
+ | Tag | Promise |
837
+ | --- | --- |
838
+ | {§provider-failure-normalization} | Provider failures normalize to `ProviderError`. |
839
+ | {§provider-retryable-truth} | `retryable` states what happens next. |
840
+ | {§provider-failure-cause} | The wrapper's cause is evidence, bounded. |
841
+ | {§provider-capacity-failure} | A proven exact preflight overflow and an upstream context rejection normalize to… |
842
+ | {§provider-flexed-allowance} | The grant is the window's remainder, between the floor and the model's limit. |
843
+ | {§provider-output-floor} | The floor is the wall's other side. |
844
+ | {§provider-sampling-passthrough} | Unconfigured sampling retains endpoint defaults. |
845
+ | {§provider-connectivity} | The provider adapter owns one attempt scheduler around the complete generation exchange; SDK-internal retries… |
846
+ | {§provider-cancellation-evidence} | Received usage/charge evidence and available response identity survive cancellation and deadline… |
847
+ | {§provider-native-tool-calls} | A response with native tool-call data, or a `tool_calls` finish, preserves its text, reasoning, structured… |
848
+ | {§provider-completed-admission} | A completed exchange is admitted as the provider delivered it. |
849
+ | {§provider-request-rejection} | An HTTP 4xx rejection not classified as authorization, quota, capacity, grammar, rate limit, or transient… |
850
+ | {§provider-interrupted-attempt} | Provider-declared interruption |
851
+ | {§provider-generation-failed} | Provider-declared generation error |
852
+ <!-- /map -->
853
+
753
854
  §provider-failure-normalization Provider failures normalize to `ProviderError`.
754
855
  Its public contract is an RFC
755
856
  9457 Problem Details object with an exact status, stable type, occurrence
@@ -759,12 +860,15 @@ into an empty model turn or reduced to a message plus a generic status.
759
860
  Upstream diagnostic text is bounded by
760
861
  `PLURNK_PROVIDERS_ERROR_DETAIL_LIMIT`; the committed `.env.defaults` owns its
761
862
  normal value. Retry exhaustion is preserved as `attempts` and
762
- `retryExhausted`; it does not change the Problem's `retryable`.
863
+ `retryExhausted`; it does not change the Problem's `retryable`. A provider's
864
+ producer id is `provider:<name>`, the name folded to the `source` grammar of
865
+ `Notice.json` (lower-case words and hyphens; a leading digit is prefixed
866
+ `p-`); an empty name is refused.
763
867
 
764
868
  §provider-retryable-truth **`retryable` states what happens next.** A Problem's
765
869
  `retryable` is exactly membership of its kind in the exported
766
870
  `RETRYABLE_PROVIDER_KINDS` — `rate_limit`, `network_failure`, `deadline_exceeded`,
767
- `resource_interrupted`, `output_dropped` — and Core's provider recovery re-issues
871
+ `resource_interrupted` — and Core's provider recovery re-issues
768
872
  exactly those kinds by reading the same set. It never copies the transport's own
769
873
  retry policy: a 502 or 524 that the transport will not replay is still re-issued by
770
874
  the consumer, so it reports `retryable: true`. Every other kind reports `false`.
@@ -793,16 +897,12 @@ request-accounting row. Capacity failures are not connectivity failures and are
793
897
  never retried by the provider scheduler; bounded packet recovery belongs to the
794
898
  consumer.
795
899
 
796
- §provider-flexed-allowance **The grant is the window's remainder, between the floor and the model's limit.** The
797
- configured output budget is the reservation curation packs the input against
798
- (`window − outputBudget`), and it is the only allowance the model is ever
799
- shown — the packet's disclosed `tokensResponseMax` stays the configured reservation
800
- so the response discipline it teaches never varies. The wire grants the remainder: with an exact prompt count
801
- (llama-server's input-token endpoint) `window − promptTokens − 256`, clamped to no less than the
802
- output floor and no more than the model's own output limit, so a response overflowing the disclosed reservation
803
- completes whenever the window's unclaimed room can hold it, and a prompt that ate into the reservation still leaves the floor. Every other
804
- measurement kind — and any pool — grants the reservation, clamped by the same remainder taken from the prompt's estimate so the wire never asks the window for more than it has; an estimate proves
805
- nothing about the true remainder, so it never rejects.
900
+ §provider-flexed-allowance **The grant is the window's remainder, between the floor and the model's limit.** The configured output budget is the reservation curation packs the input against (`window − outputBudget`), and it is the only allowance the model is ever shown — the packet's disclosed `tokensResponseMax` stays the configured reservation so the response discipline it teaches never varies.
901
+
902
+ | Prompt measurement | The wire grants |
903
+ | --- | --- |
904
+ | An exact prompt count (llama-server's input-token endpoint) | `window − promptTokens − 256`, clamped to no less than the output floor and no more than the model's own output limit, so a response overflowing the disclosed reservation completes whenever the window's unclaimed room can hold it, and a prompt that ate into the reservation still leaves the floor |
905
+ | Every other measurement kind, and any pool | the reservation, clamped by the same remainder taken from the prompt's estimate so the wire never asks the window for more than it has; an estimate proves nothing about the true remainder, so it never rejects |
806
906
 
807
907
  §provider-output-floor **The floor is the wall's other side.** `PLURNK_PROVIDERS_OUTPUT_FLOOR`, shipped as `10%`, is the least response room any request keeps, capped by the output budget; `window − floor`, intersected with `maxInputTokens`, is the physical input wall exposed as `inputWall`. A request under the curation reservation is the ordinary case; a request between the reservation and the wall is admitted with its grant flexed down to the remainder; an exact prompt over the wall is rejected before I/O; an estimate over the wall defers to the upstream provider as capacity oracle with its grant at the floor. Core consults the wall, never the reservation, to end a loop ({§context-wall} in the core contract). A response exceeding even the grant is cut,
808
908
  and the notice names the true per-call grant (`capacity.responseMax` on the
@@ -890,22 +990,14 @@ transport failure and does not trigger provider recovery. The adapter executes
890
990
  no call and invents no textual operation; the consumer owns admission and
891
991
  no-operation handling. The normalized assistant exposes `nativeToolCalls: true`
892
992
  when either wire calls or a `tool_calls` finish is present, independently of the
893
- preserved finish reason; consumers need not mine wire evidence. Text-only missing-output checks do not apply because
894
- the billed output includes structured calls.
993
+ preserved finish reason; consumers need not mine wire evidence.
895
994
 
896
- §provider-output-dropped **A completed exchange whose own evidence proves its
897
- text never arrived is `output_dropped`**, a 502 carrying the complete response as
898
- `error.attempt` and `stage: "provider-response"`; it is never admitted as an empty or
899
- truncated turn, and the consumer re-issues it ({§provider-retryable-truth}):
900
-
901
- | Evidence | Detail | Facts |
902
- | --- | --- | --- |
903
- | Billed output tokens exceed the code points streamed across every channel — text and reasoning, before projection — by at least `PLURNK_PROVIDERS_DROPPED_OUTPUT_TOKENS` (`0` disables; an output token decodes to at least one character) | `The provider billed T output tokens but streamed C characters of text and reasoning; at least T−C tokens of output never arrived.` | `billedOutputTokens`, `streamedCharacters`, `droppedOutputTokens` |
904
-
905
- The token rule needs a billed output count, and it does not apply when the response bills
906
- reasoning tokens but streamed no reasoning in any channel: that is hidden or summarized
907
- reasoning, which the characters cannot account for. Text-only comparisons are not made —
908
- a route may bill reasoning inside its text count.
995
+ §provider-completed-admission **A completed exchange is admitted as the provider delivered it.**
996
+ Billed output tokens are accounting, never evidence of missing text: a provider may bill hidden or
997
+ summarized reasoning, bill reasoning inside its text count, or tokenize differently from what it
998
+ streams, so no comparison of token counts with streamed characters voids a response. What the
999
+ provider reports as its finish ({§provider-finish-reason}) decides the attempt's disposition; what
1000
+ the response says is the consumer's to judge ({§emission-admission}).
909
1001
 
910
1002
  §provider-request-rejection An HTTP 4xx rejection not classified as authorization,
911
1003
  quota, capacity, grammar, rate limit, or transient transport failure is
@@ -929,6 +1021,16 @@ completed exchange.
929
1021
  | Capacity-pool overflow | None under the existing routing policy; when other overflow-eligible failures do reach a sibling, the pool concatenates their request accounting. |
930
1022
  | Consumer admission | Persist the evidence as an unaccepted attempt; never parse it into executable work, even when its frame looks complete. |
931
1023
 
1024
+ ### §provider-generation-failed Provider-declared generation error
1025
+
1026
+ A finish the SDK classifies as `error` (Google's `MALFORMED_FUNCTION_CALL`, for one) is a failed
1027
+ attempt, `ProviderError(kind="generation_failed")` at local status 502 with the normalized attempt
1028
+ on `error.attempt` and its accounting on `error.accounting`: content, reasoning, usage, model, the
1029
+ raw finish reason and any raw body stay evidence, never a completed exchange. It is not a transport
1030
+ outage: `retryable: false`, so the consumer's provider recovery does not re-issue it; Core settles
1031
+ it on the provider response contract — the turn is complete, the strike rail rules, and the next
1032
+ turn asks again ({§provider-retryable-truth}).
1033
+
932
1034
  ## §10 Grammar
933
1035
 
934
1036
  GBNF is a local llama-server capability, not a generic provider expectation.
@@ -950,6 +1052,15 @@ the service issues a verdict on it.
950
1052
 
951
1053
  ## §11 Evidence and metadata
952
1054
 
1055
+ <!-- map -->
1056
+ | Tag | Promise |
1057
+ | --- | --- |
1058
+ | {§provider-evidence} | `assistantRaw` is an opaque normalized transport record. |
1059
+ | {§provider-wire-emission} | The emission is retained as the wire carried it, on every response. |
1060
+ | {§provider-usage-refusal} | The provider's bookkeeping is not the exchange. |
1061
+ | {§provider-open-reasoning} | Plurnk requires endpoints with open, verbatim reasoning. |
1062
+ <!-- /map -->
1063
+
953
1064
  §provider-evidence `assistantRaw` is an opaque normalized transport record.
954
1065
  Provider top-level
955
1066
  metadata is forwarded as an open bag without reinterpreting currencies or
@@ -961,19 +1072,16 @@ The latter retains SDK response bodies/chunks and the dispatched request body
961
1072
  under {§provider-dispatched-request}, without requesting extra model output.
962
1073
  Neither changes unconditional accounting or failed-response evidence.
963
1074
 
964
- §provider-wire-emission **The emission is retained as the wire carried it, on every
965
- response.** Beside the normalized `content` and `reasoning`, the transport record keeps
966
- `wire`: the number of raw chunks, the chunks that carried no field at all, every delta or
967
- message field the stream carried with the number of chunks carrying it, tool calls merged
968
- by index with their arguments as streamed, the finish reasons seen, and the verbatim text
969
- of every string field the record does not already hold. Nothing is opt-in and nothing is
970
- reinterpreted: a blank emission reads as thirteen chunks that carried nothing, or as a
971
- tool-call section the model emitted into a channel the protocol does not read, instead of
972
- being guessed at from token counts. Frames outside the recognized OpenAI-compatible
973
- envelope remain verbatim in `wire.unmappedChunks`; the recorder never discards an
974
- unrecognized/native payload or invents another provider parser. This required
975
- evidence is independent of the optional complete `rawBody` dataset capture.
976
- Covered by `aiSdkTransport.test.ts` and core's `Digest.wire-evidence.test.ts`.
1075
+ §provider-wire-emission **The emission is retained as the wire carried it, on every response.** Beside the normalized `content` and `reasoning`, the transport record keeps `wire`. Nothing is opt-in and nothing is reinterpreted: a blank emission reads as thirteen chunks that carried nothing, or as a tool-call section the model emitted into a channel the protocol does not read, instead of being guessed at from token counts. This required evidence is independent of the optional complete `rawBody` dataset capture. Covered by `aiSdkTransport.test.ts` and core's `Digest.wire-evidence.test.ts`.
1076
+
1077
+ | `wire` holds | What |
1078
+ | --- | --- |
1079
+ | Chunks | the number of raw chunks, and the chunks that carried no field at all |
1080
+ | Fields | every delta or message field the stream carried with the number of chunks carrying it |
1081
+ | Tool calls | merged by index with their arguments as streamed |
1082
+ | Finish reasons | those seen |
1083
+ | Text | the verbatim text of every string field the record does not already hold |
1084
+ | `wire.unmappedChunks` | frames outside the recognized OpenAI-compatible envelope, verbatim; the recorder never discards an unrecognized/native payload or invents another provider parser |
977
1085
 
978
1086
  §provider-usage-refusal **The provider's bookkeeping is not the exchange.** Usage
979
1087
  normalization is exact; a refusal never fails or retries the response. The same
@@ -1,8 +1,7 @@
1
- import type { ChatMessage, PromptTokenMeasurement, Provider, ProviderCostNormalizer, ProviderGenerateArgs, ProviderRequestCapacity, ProviderResponse, ProviderUsage, Effort } from "./types.ts";
1
+ import type { ChatMessage, PromptTokenMeasurement, Provider, ProviderCostNormalizer, ProviderGenerateArgs, ProviderRequestCapacity, ProviderResponse, ProviderUsage, Effort, InputModality } from "./types.ts";
2
2
  import type { ProviderCost } from "@plurnk/plurnk-contracts";
3
3
  import type { JSONValue } from "ai";
4
4
  import type { EffortSetting, ReasoningResponseStyle } from "./env.ts";
5
- import type { InputModality } from "./types.ts";
6
5
  import type { LanguageModelSource } from "./aiSdkTransport.ts";
7
6
  import type { ExtensionAttribution, ExtensionAttributionContext } from "@plurnk/plurnk-meta";
8
7
  import type RequestFields from "./RequestFields.ts";
@@ -28,7 +27,6 @@ export type AiSdkProviderConfig = {
28
27
  attributions?: (context: ExtensionAttributionContext) => ExtensionAttribution;
29
28
  fetchTimeoutMs: number;
30
29
  operationTimeoutMs: number;
31
- droppedOutputTokens?: number;
32
30
  headers?: Record<string, string>;
33
31
  fetch?: ProviderFetch;
34
32
  contextWindow?: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"AiSdkProvider.d.ts","sourceRoot":"","sources":["../src/AiSdkProvider.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAmB,sBAAsB,EAAE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