@graphorin/provider 0.6.0 → 0.6.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @graphorin/provider
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#142](https://github.com/o-stepper/graphorin/pull/142) [`436d6ca`](https://github.com/o-stepper/graphorin/commit/436d6ca5ebbd16df094e915682d3915c279a8430) Thanks [@o-stepper](https://github.com/o-stepper)! - Version constants and version-bearing strings now derive from each package's manifest at build time (`VERSION = pkg.version`; writer ids, client/server info, OTLP framework attributes, build-info metrics interpolate it). No behavioral change at the current version: the rendered strings are byte-identical. A release bump no longer edits source; the new `check-version-consistency` gate fails any reintroduced hardcoded framework version.
8
+
9
+ - Updated dependencies [[`826ee59`](https://github.com/o-stepper/graphorin/commit/826ee5933ad38693b0dd2f20a110abfecba7d23d), [`436d6ca`](https://github.com/o-stepper/graphorin/commit/436d6ca5ebbd16df094e915682d3915c279a8430)]:
10
+ - @graphorin/observability@0.6.1
11
+ - @graphorin/core@0.6.1
12
+
3
13
  ## 0.6.0
4
14
 
5
15
  ### Minor Changes
package/README.md CHANGED
@@ -11,11 +11,16 @@ The package owns four moving parts:
11
11
  AI SDK), `ollamaAdapter` (direct Ollama HTTP), `llamaCppServerAdapter`
12
12
  (the upstream `llama-server` binary from llama.cpp), and
13
13
  `openAICompatibleAdapter` (LMStudio / LocalAI / vLLM / Together-style
14
- self-host endpoints).
14
+ self-host endpoints). Prompt caching: when a request carries
15
+ `cachePolicy: { breakpoints: 'auto' }`, the vercel adapter anchors
16
+ Anthropic `cache_control` breakpoints on the stable conversation
17
+ prefix, and cache read / write token legs flow back through
18
+ `Usage.cachedReadTokens` / `cacheWriteTokens`.
15
19
  3. **Middleware** - `composeProviderMiddleware([...])` enforces a
16
20
  canonical order at startup and throws `MiddlewareOrderingError` on
17
21
  violation. Built-ins: `withTracing`, `withRetry`, `withRateLimit`,
18
- `withCostLimit`, `withCostTracking`, `withFallback`, and
22
+ `withCostLimit`, `withCostTracking` (cache-aware: bills cache reads
23
+ and writes at their own rates), `withFallback`, and
19
24
  `withRedaction` (mandatory in production).
20
25
  4. **Token counting** - pluggable `TokenCounter` dispatcher. Default
21
26
  `JsTiktokenCounter` for OpenAI-compatible models; per-vendor native
@@ -101,5 +106,5 @@ recommendations.
101
106
 
102
107
  ## Project metadata
103
108
 
104
- - **Project Graphorin** · v0.6.0 · MIT License · © 2026 Oleksiy Stepurenko
109
+ - **Project Graphorin** · v0.6.1 · MIT License · © 2026 Oleksiy Stepurenko
105
110
  - Repository: <https://github.com/o-stepper/graphorin>
package/dist/index.d.ts CHANGED
@@ -63,8 +63,7 @@ import { LocalProviderTrust, OllamaTrust } from "./trust/index.js";
63
63
  *
64
64
  * @packageDocumentation
65
65
  */
66
- /** Canonical version constant. Mirrors the `package.json` version. */
67
- declare const VERSION = "0.6.0";
66
+ declare const VERSION: string;
68
67
  //#endregion
69
68
  export { AnthropicAPICounter, AnthropicAPICounterOptions, ApplyReasoningPolicyInput, BedrockAPICounter, BedrockAPICounterOptions, CANONICAL_MIDDLEWARE_ORDER, CLASSIFIER_RULES, ClassifierRule, CostAccumulator, CostBudgetExceededError, CostTrackingTotals, CreateDefaultCounterOptions, CreateProviderOptions, GoogleAPICounter, GoogleAPICounterOptions, GraphorinProviderError, HeuristicCounter, HeuristicCounterOptions, InferReasoningContractInput, InvalidProviderError, JsTiktokenCounter, JsTiktokenCounterOptions, LlamaCppServerAdapterOptions, LocalProviderClassification, LocalProviderInsecureTransportError, LocalProviderTrust, MIDDLEWARE_KIND, MiddlewareOrderingError, MissingProductionMiddlewareError, OllamaAdapterOptions, OllamaInsecureTransportError, OllamaTrust, OpenAICompatibleAdapterOptions, PERMANENT_LOOPBACK_CLASSIFICATION, ProductionStartupHookOptions, PromptRedactionError, PromptRedactionPolicy, PromptRedactionScanScope, PromptRedactionViolation, ProviderHttpError, ProviderStreamParseError, REASONING_CONTRACT_RULES, REASONING_RETENTION_DEFAULTS, RateLimitExceededError, ReasoningContractRule, ResolveReasoningRetentionInput, SENSITIVITY_DEFAULTS_PER_TRUST, SerializedMessage, VERSION, VercelAdapterOptions, WithCostLimitOptions, WithCostTrackingOptions, WithFallbackOptions, WithRateLimitOptions, WithRetryOptions, WithTracingOptions, __resetGlobalTokenCounter, __resetTiktokenCache, applyReasoningPolicy, assertProductionMiddleware, classifyHttpStatus, classifyLocalProvider, classifyModelTier, composeProviderMiddleware, createCostAccumulator, createDefaultCounter, createProvider, defineProviderMiddleware, foldToolExamples, getGlobalTokenCounter, getMiddlewareKind, inferReasoningContract, llamaCppServerAdapter, ollamaAdapter, openAICompatibleAdapter, providerHasMiddleware, resolveReasoningRetention, serialiseMessageForCount, serializedToString, setGlobalTokenCounter, vercelAdapter, withCostLimit, withCostTracking, withFallback, withRateLimit, withRedaction, withRetry, withTracing };
70
69
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA6Ba,OAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+Ba"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { version } from "./package.js";
1
2
  import { CostBudgetExceededError, GraphorinProviderError, InvalidProviderError, LocalProviderInsecureTransportError, MiddlewareOrderingError, MissingProductionMiddlewareError, OllamaInsecureTransportError, PromptRedactionError, ProviderHttpError, ProviderStreamParseError, RateLimitExceededError, classifyHttpStatus } from "./errors/errors.js";
2
3
  import { applyReasoningPolicy } from "./reasoning/apply-policy.js";
3
4
  import { REASONING_RETENTION_DEFAULTS, resolveReasoningRetention } from "./reasoning/retention.js";
@@ -62,8 +63,8 @@ import "./trust/index.js";
62
63
  *
63
64
  * @packageDocumentation
64
65
  */
65
- /** Canonical version constant. Mirrors the `package.json` version. */
66
- const VERSION = "0.6.0";
66
+ /** Canonical version constant, derived from `package.json` at build time. */
67
+ const VERSION = version;
67
68
 
68
69
  //#endregion
69
70
  export { AnthropicAPICounter, BedrockAPICounter, CANONICAL_MIDDLEWARE_ORDER, CLASSIFIER_RULES, CostBudgetExceededError, GoogleAPICounter, GraphorinProviderError, HeuristicCounter, InvalidProviderError, JsTiktokenCounter, LocalProviderInsecureTransportError, MIDDLEWARE_KIND, MiddlewareOrderingError, MissingProductionMiddlewareError, OllamaInsecureTransportError, PERMANENT_LOOPBACK_CLASSIFICATION, PromptRedactionError, ProviderHttpError, ProviderStreamParseError, REASONING_CONTRACT_RULES, REASONING_RETENTION_DEFAULTS, RateLimitExceededError, SENSITIVITY_DEFAULTS_PER_TRUST, VERSION, __resetGlobalTokenCounter, __resetTiktokenCache, applyReasoningPolicy, assertProductionMiddleware, classifyHttpStatus, classifyLocalProvider, classifyModelTier, composeProviderMiddleware, createCostAccumulator, createDefaultCounter, createProvider, defineProviderMiddleware, foldToolExamples, getGlobalTokenCounter, getMiddlewareKind, inferReasoningContract, llamaCppServerAdapter, ollamaAdapter, openAICompatibleAdapter, providerHasMiddleware, resolveReasoningRetention, serialiseMessageForCount, serializedToString, setGlobalTokenCounter, vercelAdapter, withCostLimit, withCostTracking, withFallback, withRateLimit, withRedaction, withRetry, withTracing };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @graphorin/provider - vendor-neutral LLM provider layer for the\n * Graphorin framework.\n *\n * The package owns:\n *\n * - The `createProvider(...)` factory for wrapping adapter modules in\n * a stable `Provider` shape.\n * - Four adapters out of the box: the Vercel AI SDK adapter for the\n * default cloud path, plus three local-LLM adapters (Ollama HTTP,\n * llama-server HTTP, and a generic OpenAI-compatible adapter for\n * LMStudio / LocalAI / vLLM / Together-style endpoints). All three\n * `baseUrl`-driven adapters share the same {@link LocalProviderTrust}\n * classifier.\n * - The canonical-order middleware composer\n * ({@link composeProviderMiddleware}) and the seven built-in\n * middlewares (`withTracing`, `withRetry`, `withRateLimit`,\n * `withCostLimit`, `withCostTracking`, `withFallback`,\n * `withRedaction`).\n * - The pluggable `TokenCounter` dispatcher (`createDefaultCounter`)\n * plus the per-vendor strategies and a heuristic fallback.\n * - The per-provider model-tier auto-classifier\n * ({@link classifyModelTier}) that maps a `Provider`'s `modelId` to\n * one of `'fast' | 'balanced' | 'smart'`.\n *\n * @packageDocumentation\n */\n\n/** Canonical version constant. Mirrors the `package.json` version. */\nexport const VERSION = '0.6.0';\n\nexport * from './adapters/index.js';\nexport * from './counters/index.js';\nexport * from './errors/index.js';\nexport * from './middleware/index.js';\nexport * from './model-tier/index.js';\nexport * from './provider.js';\nexport * from './reasoning/index.js';\nexport { foldToolExamples } from './tool-examples.js';\nexport * from './trust/index.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,UAAU"}
1
+ {"version":3,"file":"index.js","names":["VERSION: string","pkg.version"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @graphorin/provider - vendor-neutral LLM provider layer for the\n * Graphorin framework.\n *\n * The package owns:\n *\n * - The `createProvider(...)` factory for wrapping adapter modules in\n * a stable `Provider` shape.\n * - Four adapters out of the box: the Vercel AI SDK adapter for the\n * default cloud path, plus three local-LLM adapters (Ollama HTTP,\n * llama-server HTTP, and a generic OpenAI-compatible adapter for\n * LMStudio / LocalAI / vLLM / Together-style endpoints). All three\n * `baseUrl`-driven adapters share the same {@link LocalProviderTrust}\n * classifier.\n * - The canonical-order middleware composer\n * ({@link composeProviderMiddleware}) and the seven built-in\n * middlewares (`withTracing`, `withRetry`, `withRateLimit`,\n * `withCostLimit`, `withCostTracking`, `withFallback`,\n * `withRedaction`).\n * - The pluggable `TokenCounter` dispatcher (`createDefaultCounter`)\n * plus the per-vendor strategies and a heuristic fallback.\n * - The per-provider model-tier auto-classifier\n * ({@link classifyModelTier}) that maps a `Provider`'s `modelId` to\n * one of `'fast' | 'balanced' | 'smart'`.\n *\n * @packageDocumentation\n */\n\n/** Canonical version constant, derived from `package.json` at build time. */\nimport pkg from '../package.json' with { type: 'json' };\n\nexport const VERSION: string = pkg.version;\n\nexport * from './adapters/index.js';\nexport * from './counters/index.js';\nexport * from './errors/index.js';\nexport * from './middleware/index.js';\nexport * from './model-tier/index.js';\nexport * from './provider.js';\nexport * from './reasoning/index.js';\nexport { foldToolExamples } from './tool-examples.js';\nexport * from './trust/index.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAaA,UAAkBC"}
@@ -0,0 +1,6 @@
1
+ //#region package.json
2
+ var version = "0.6.1";
3
+
4
+ //#endregion
5
+ export { version };
6
+ //# sourceMappingURL=package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@graphorin/provider\",\n \"version\": \"0.6.1\",\n \"description\": \"Vendor-neutral LLM provider layer for the Graphorin framework. Ships the canonical Provider interface, the Vercel AI SDK adapter (default cloud path), three local-LLM adapters (direct Ollama HTTP, llama-server HTTP, and a generic OpenAI-compatible adapter for LMStudio / LocalAI / vLLM / Together-style endpoints), the shared LocalProviderTrust classifier (loopback / private / public-tls / public-cleartext), the canonical-order middleware composer (withTracing / withRetry / withRateLimit / withCostLimit / withCostTracking / withFallback / withRedaction), the pluggable TokenCounter dispatcher (js-tiktoken default plus per-vendor native counters and a heuristic fallback), the per-provider model-tier auto-classifier (fast / balanced / smart), and the production startup hook that fails fast when withRedaction is missing.\",\n \"license\": \"MIT\",\n \"author\": \"Oleksiy Stepurenko\",\n \"homepage\": \"https://github.com/o-stepper/graphorin/tree/main/packages/provider\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/o-stepper/graphorin.git\",\n \"directory\": \"packages/provider\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/o-stepper/graphorin/issues\"\n },\n \"keywords\": [\n \"graphorin\",\n \"ai\",\n \"agents\",\n \"framework\",\n \"provider\",\n \"llm\",\n \"vercel-ai-sdk\",\n \"ollama\",\n \"llama-cpp\",\n \"openai-compatible\",\n \"middleware\",\n \"retry\",\n \"fallback\",\n \"rate-limit\",\n \"cost-limit\",\n \"redaction\",\n \"token-counter\",\n \"tiktoken\",\n \"local-first\"\n ],\n \"type\": \"module\",\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./adapters/vercel\": {\n \"types\": \"./dist/adapters/vercel.d.ts\",\n \"import\": \"./dist/adapters/vercel.js\"\n },\n \"./adapters/ollama\": {\n \"types\": \"./dist/adapters/ollama.d.ts\",\n \"import\": \"./dist/adapters/ollama.js\"\n },\n \"./adapters/llamacpp-server\": {\n \"types\": \"./dist/adapters/llamacpp-server.d.ts\",\n \"import\": \"./dist/adapters/llamacpp-server.js\"\n },\n \"./adapters/openai-compatible\": {\n \"types\": \"./dist/adapters/openai-compatible.d.ts\",\n \"import\": \"./dist/adapters/openai-compatible.js\"\n },\n \"./middleware\": {\n \"types\": \"./dist/middleware/index.d.ts\",\n \"import\": \"./dist/middleware/index.js\"\n },\n \"./counters\": {\n \"types\": \"./dist/counters/index.d.ts\",\n \"import\": \"./dist/counters/index.js\"\n },\n \"./trust\": {\n \"types\": \"./dist/trust/index.d.ts\",\n \"import\": \"./dist/trust/index.js\"\n },\n \"./model-tier\": {\n \"types\": \"./dist/model-tier/index.d.ts\",\n \"import\": \"./dist/model-tier/index.js\"\n },\n \"./reasoning\": {\n \"types\": \"./dist/reasoning/index.d.ts\",\n \"import\": \"./dist/reasoning/index.js\"\n },\n \"./errors\": {\n \"types\": \"./dist/errors/index.d.ts\",\n \"import\": \"./dist/errors/index.js\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"build\": \"tsdown\",\n \"typecheck\": \"tsc --noEmit && tsc -p tsconfig.tests.json\",\n \"test\": \"vitest run\",\n \"lint\": \"biome check .\",\n \"clean\": \"rimraf dist .turbo *.tsbuildinfo\"\n },\n \"dependencies\": {\n \"@graphorin/core\": \"workspace:*\",\n \"@graphorin/observability\": \"workspace:*\"\n },\n \"peerDependencies\": {\n \"ai\": \"^7.0.0-beta.76\",\n \"js-tiktoken\": \"^1.0.0\"\n },\n \"peerDependenciesMeta\": {\n \"ai\": {\n \"optional\": true\n },\n \"js-tiktoken\": {\n \"optional\": true\n }\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"provenance\": true\n },\n \"devDependencies\": {\n \"@graphorin/pricing\": \"workspace:*\",\n \"ai\": \"^7.0.15\",\n \"fast-check\": \"^3.23.0\",\n \"js-tiktoken\": \"^1.0.21\"\n }\n}\n"],"mappings":";cAEa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphorin/provider",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Vendor-neutral LLM provider layer for the Graphorin framework. Ships the canonical Provider interface, the Vercel AI SDK adapter (default cloud path), three local-LLM adapters (direct Ollama HTTP, llama-server HTTP, and a generic OpenAI-compatible adapter for LMStudio / LocalAI / vLLM / Together-style endpoints), the shared LocalProviderTrust classifier (loopback / private / public-tls / public-cleartext), the canonical-order middleware composer (withTracing / withRetry / withRateLimit / withCostLimit / withCostTracking / withFallback / withRedaction), the pluggable TokenCounter dispatcher (js-tiktoken default plus per-vendor native counters and a heuristic fallback), the per-provider model-tier auto-classifier (fast / balanced / smart), and the production startup hook that fails fast when withRedaction is missing.",
5
5
  "license": "MIT",
6
6
  "author": "Oleksiy Stepurenko",
@@ -95,8 +95,8 @@
95
95
  "LICENSE"
96
96
  ],
97
97
  "dependencies": {
98
- "@graphorin/core": "0.6.0",
99
- "@graphorin/observability": "0.6.0"
98
+ "@graphorin/core": "0.6.1",
99
+ "@graphorin/observability": "0.6.1"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "ai": "^7.0.0-beta.76",
@@ -118,7 +118,7 @@
118
118
  "ai": "^7.0.15",
119
119
  "fast-check": "^3.23.0",
120
120
  "js-tiktoken": "^1.0.21",
121
- "@graphorin/pricing": "0.6.0"
121
+ "@graphorin/pricing": "0.6.1"
122
122
  },
123
123
  "scripts": {
124
124
  "build": "tsdown",