@kindgi/sdk 0.1.4-rc.5 → 0.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kindgi/sdk",
3
- "version": "0.1.4-rc.5",
3
+ "version": "0.1.4",
4
4
  "description": "@kindgi/sdk — the authoring SDK for Kindgi™. Facade over the individual @kindgi/* packages + @kindgi/client. Unifies pack authoring (defineTool / defineCheck / defineAgent / defineFlow) and client callsites (createClient) behind three sub-paths: /define, /client, /types. Re-export facade; zero behavior.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -55,15 +55,15 @@
55
55
  "README.md"
56
56
  ],
57
57
  "dependencies": {
58
- "@kindgi/agents": "0.1.4-rc.5",
59
- "@kindgi/client": "0.1.4-rc.5",
60
- "@kindgi/crypto": "0.1.4-rc.5",
61
- "@kindgi/flow": "0.1.4-rc.5",
62
- "@kindgi/guardrails": "0.1.4-rc.5",
63
- "@kindgi/handler-runtime": "0.1.4-rc.5",
64
- "@kindgi/schema": "0.1.4-rc.5",
65
- "@kindgi/tools": "0.1.4-rc.5",
66
- "@kindgi/types": "0.1.4-rc.5"
58
+ "@kindgi/agents": "0.1.4",
59
+ "@kindgi/client": "0.1.4",
60
+ "@kindgi/crypto": "0.1.4",
61
+ "@kindgi/flow": "0.1.4",
62
+ "@kindgi/guardrails": "0.1.4",
63
+ "@kindgi/handler-runtime": "0.1.4",
64
+ "@kindgi/schema": "0.1.4",
65
+ "@kindgi/tools": "0.1.4",
66
+ "@kindgi/types": "0.1.4"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "zod": "^4.0.0"
@@ -12,7 +12,7 @@ description: >
12
12
  kindgi-authoring-guardrails.
13
13
  type: core
14
14
  library: "@kindgi/sdk"
15
- version: "0.4.3"
15
+ version: "0.4.4"
16
16
  sdk_version: "0.0.0"
17
17
  pack_languages: [node]
18
18
  sources:
@@ -125,10 +125,10 @@ export default defined.value;
125
125
  capability-based selection when the preferred provider is
126
126
  unregistered or filtered out.
127
127
  - **`preferredModel`** — optional soft hint at the model level: set to
128
- a `ModelInfo.name` (e.g. `'gemini-2.5-pro'`), the router prefers
128
+ a `ModelInfo.name` (e.g. `'gemini-3.8-flash'`), the router prefers
129
129
  `(provider, model)` tuples whose model matches. To require a model
130
130
  rather than prefer it, add a hard requirement to the capability:
131
- `capabilities: [{ needs: [{ feature: 'tool-use' }, { models: { allow: ['gemini-2.5-pro'] } }] }]`.
131
+ `capabilities: [{ needs: [{ feature: 'tool-use' }, { models: { allow: ['gemini-3.8-flash'] } }] }]`.
132
132
  - **`conversationPolicy`** — optional. Absent = each turn loads the
133
133
  conversation's full history and no HITL gates apply. `historyLimit`
134
134
  caps how many prior messages are loaded; `hitl` configures approval
@@ -5,8 +5,9 @@ description: >
5
5
  can actually call a real model. Covers four paths — hosted via
6
6
  Anthropic native adapter, Gemini on Vertex AI (Google Application
7
7
  Default Credentials, no API key), hosted via the OpenAI-compat adapter
8
- (works with OpenAI + Groq + Together + Fireworks + OpenRouter +
9
- Ollama + vLLM + any other OpenAI-compatible endpoint), and local
8
+ (works with OpenAI, Groq, self-hosted vLLM and Ollama, and any other
9
+ OpenAI-compatible endpoint, a hosted gateway such as OpenRouter
10
+ included), and local
10
11
  via the in-process ONNX adapter — plus the credential flow (in
11
12
  `kindgi dev` the key lives in the project's env files — `.env`, then
12
13
  `.env.local` — added by hand or with `kindgi secrets set`'s no-echo
@@ -22,7 +23,7 @@ description: >
22
23
  kindgi-getting-started.
23
24
  type: core
24
25
  library: "@kindgi/sdk"
25
- version: "0.9.5"
26
+ version: "0.9.8"
26
27
  sdk_version: "0.0.0"
27
28
  pack_languages: [node, python]
28
29
  sources:
@@ -106,7 +107,11 @@ yours.
106
107
  ## Path A — Hosted, native Anthropic
107
108
 
108
109
  Best fidelity to Anthropic's API (prompt caching, latest models, tool
109
- use, structured output). Requires an `ANTHROPIC_API_KEY`.
110
+ use). Requires an `ANTHROPIC_API_KEY`.
111
+
112
+ A model's `structured-output` feature is a routing label: the model can
113
+ follow a JSON schema natively, but Kindgi's typed outputs use instructions,
114
+ then parse, check against the schema and repair, on every provider.
110
115
 
111
116
  **Step 1 — set the key:**
112
117
  ```sh
@@ -123,9 +128,18 @@ credential on argv.
123
128
 
124
129
  **Step 2 — register it, from the preset:**
125
130
  ```sh
126
- kindgi providers register --preset=anthropic # Opus 5.5, Sonnet 5.5, Haiku 4.5
127
- kindgi providers register --preset=anthropic --models=claude-haiku-4-5 # just one
131
+ kindgi providers register --preset=anthropic # Opus 5.5, Sonnet 5.5 (default), Haiku 5.5, Haiku 4.5
132
+ kindgi providers register --preset=anthropic --models=claude-sonnet-5-5 # just one
128
133
  ```
134
+ Don't pin `claude-haiku-4-5`: Anthropic retires it on or after 2026-10-15,
135
+ and a turn routed to it then fails; `claude-haiku-5-5` replaces it. Each
136
+ preset names a default model (`metadata.defaultModel`, marked `(default)`
137
+ when it registers), which an agent with no preference gets. A preset
138
+ registered before 0.1.4 has none: unregister it and register it again.
139
+ The Claude 5.5 and GPT-6 models take no `temperature` (`"sampling": false`:
140
+ the call goes without it, with a `sampling-unsupported` warning), and a
141
+ model's `thinking` says how it thinks; thinking counts against
142
+ `maxOutputTokens` and bills as output.
129
143
  The preset carries the models, context windows, output limits and current
130
144
  prices (`kindgi providers presets` lists the presets and when their prices
131
145
  were checked); `--max-output-tokens=<n>` sets another output limit. In a pack it refuses until the key is in the pack's env files —
@@ -139,8 +153,8 @@ needs under `kindgi dev`:
139
153
  ```ts
140
154
  // in kindgi.config.ts
141
155
  providers: [
142
- { preset: 'anthropic', models: ['claude-haiku-4-5'] }, // key ANTHROPIC_API_KEY, from the env files
143
- { preset: 'gemini', project: 'acme-gcp', models: ['gemini-2.5-flash'] },
156
+ { preset: 'anthropic', models: ['claude-sonnet-5-5'] }, // key ANTHROPIC_API_KEY, from the env files
157
+ { preset: 'gemini', project: 'acme-gcp', models: ['gemini-3.8-flash'] },
144
158
  { spec: { /* the provider.json body below */ } },
145
159
  ],
146
160
  ```
@@ -148,7 +162,7 @@ providers: [
148
162
  # in pyproject.toml: one table per provider, same keys
149
163
  [[tool.kindgi.providers]]
150
164
  preset = "anthropic"
151
- models = ["claude-haiku-4-5"]
165
+ models = ["claude-sonnet-5-5"]
152
166
  ```
153
167
  - A preset entry takes `models`, `project`, `secret` (the key's name, in place
154
168
  of the preset's) and `maxOutputTokens`, spelled the same in `pyproject.toml`;
@@ -167,7 +181,7 @@ models = ["claude-haiku-4-5"]
167
181
  providers with `kindgi providers register`.
168
182
 
169
183
  **Step 2 (by hand) — write `provider.json`** at the pack root. One connection,
170
- three models — matches how the Anthropic SDK actually works (the API
184
+ two models — matches how the Anthropic SDK actually works (the API
171
185
  key is per-vendor; the model is per-call):
172
186
  ```json
173
187
  {
@@ -194,16 +208,6 @@ key is per-vendor; the model is per-call):
194
208
  "completionUsdPer1kTokens": 0.01
195
209
  },
196
210
  "description": "Balanced performance/cost."
197
- },
198
- {
199
- "name": "claude-haiku-4-5",
200
- "contextWindow": 200000,
201
- "features": ["tool-use"],
202
- "cost": {
203
- "promptUsdPer1kTokens": 0.001,
204
- "completionUsdPer1kTokens": 0.005
205
- },
206
- "description": "Fastest and cheapest — routing, classification, simple calls."
207
211
  }
208
212
  ],
209
213
  "description": "Anthropic Claude via native adapter."
@@ -261,9 +265,9 @@ Works with **any** OpenAI-compatible endpoint. Same adapter, different
261
265
  | Groq | `https://api.groq.com/openai/v1` |
262
266
  | Together | `https://api.together.xyz/v1` |
263
267
  | Fireworks | `https://api.fireworks.ai/inference/v1` |
264
- | OpenRouter | `https://openrouter.ai/api/v1` |
265
268
  | DeepSeek | `https://api.deepseek.com/v1` |
266
269
  | LiteLLM proxy | `http://localhost:4000/v1` |
270
+ | OpenRouter (a hosted gateway) | `https://openrouter.ai/api/v1` |
267
271
 
268
272
  The connection carries the `baseURL` (in `adapter_config`);
269
273
  each endpoint is a separate provider row because each has its own API
@@ -485,24 +489,16 @@ outside Google Cloud: put a service-account key (its JSON) in a secret
485
489
  "region": "global",
486
490
  "models": [
487
491
  {
488
- "name": "gemini-2.5-pro",
492
+ "name": "gemini-3.8-flash",
489
493
  "contextWindow": 1048576,
490
- "features": ["tool-use"],
494
+ "features": ["tool-use", "structured-output", "long-context"],
491
495
  "maxOutputTokens": 65536,
492
- "cost": {
493
- "promptUsdPer1kTokens": 0.00125,
494
- "completionUsdPer1kTokens": 0.01,
495
- "longContext": {
496
- "thresholdTokens": 200000,
497
- "promptUsdPer1kTokens": 0.0025,
498
- "completionUsdPer1kTokens": 0.015
499
- }
500
- }
496
+ "cost": { "promptUsdPer1kTokens": 0.00075, "completionUsdPer1kTokens": 0.00375 }
501
497
  },
502
498
  {
503
- "name": "gemini-2.5-flash",
499
+ "name": "gemini-3.5-flash-lite",
504
500
  "contextWindow": 1048576,
505
- "features": ["tool-use"],
501
+ "features": ["tool-use", "structured-output", "long-context"],
506
502
  "maxOutputTokens": 65536,
507
503
  "cost": { "promptUsdPer1kTokens": 0.0003, "completionUsdPer1kTokens": 0.0025 }
508
504
  }
@@ -517,11 +513,17 @@ outside Google Cloud: put a service-account key (its JSON) in a secret
517
513
  - `metadata.region` is the Vertex location: `global`, or a region such as
518
514
  `us-central1` or `northamerica-northeast1` when data must stay in one
519
515
  place. `unspecified` means `global`. Different locations are different
520
- provider rows.
516
+ provider rows. Check that the location serves the model: Gemini 3.8 Flash
517
+ isn't served from `us-central1`.
518
+ - Don't register `gemini-2.5-pro` or `gemini-2.5-flash`: Vertex AI retires
519
+ both on 2026-10-20.
521
520
  - Rates are per 1K tokens, from Google's published pricing; check them
522
- before relying on budgets. Thinking tokens bill as output.
523
- `longContext` switches the whole call to the higher rates past the
524
- threshold; `cachedPromptMultiplier` (default 0.25) prices cached
521
+ before relying on budgets. Thinking tokens bill as output, and Gemini 3.8
522
+ Flash thinks by default. `gemini-3.8-flash`'s rates above are Google's
523
+ launch price, through 2026-12-31 ($0.0015 / $0.0075 from 2027-01-01).
524
+ `longContext` (`{ thresholdTokens, promptUsdPer1kTokens,
525
+ completionUsdPer1kTokens }` in a model's `cost`) switches the whole call
526
+ to the higher rates past the threshold; `cachedPromptMultiplier` (default 0.25) prices cached
525
527
  prompt tokens.
526
528
 
527
529
  **Step 3 — register and check:**
@@ -553,8 +555,10 @@ tenant policy), then sorts survivors in this order:
553
555
  declares `prefer: [{feature: 'thinking', weight: 3}, ...]`, tuples
554
556
  with matching model features (or provider attributes) get higher
555
557
  scores. Sorted by summed score, descending.
556
- 3. **Deterministic lexical tiebreak.** When scores tie, tuples sort by
557
- `(providerId, modelName)` alphabetically — replay-safe and stable.
558
+ 3. **Deterministic tiebreak.** When scores tie, tuples sort by provider
559
+ id, then the provider's `defaultModel` before its other models, then
560
+ model name — replay-safe and stable. A provider without a
561
+ `defaultModel` falls back to its first model by name.
558
562
 
559
563
  **Practical rule:** preferences are soft — they rank, they don't
560
564
  exclude. To guarantee which model runs, make it a hard requirement in
@@ -15,7 +15,7 @@ description: >
15
15
  model by kindgi-authoring-providers.
16
16
  type: core
17
17
  library: "kindgi (Python)"
18
- version: "0.1.3"
18
+ version: "0.1.4"
19
19
  sdk_version: "0.0.0"
20
20
  pack_languages: [python]
21
21
  sources:
@@ -132,9 +132,9 @@ brief_writer = Agent(
132
132
  instructions.
133
133
  - **`preferred_provider`** / **`preferred_model`** — soft hints: the
134
134
  router prefers that provider id (e.g. `"anthropic"`) and/or model name
135
- (e.g. `"claude-haiku-4-5"`) when they satisfy the capabilities. To
135
+ (e.g. `"claude-sonnet-5-5"`) when they satisfy the capabilities. To
136
136
  *require* a model, put it in the capability:
137
- `{"needs": [{"feature": "tool-use"}, {"models": {"allow": ["claude-haiku-4-5"]}}]}`.
137
+ `{"needs": [{"feature": "tool-use"}, {"models": {"allow": ["claude-sonnet-5-5"]}}]}`.
138
138
  - **`conversation_policy`** — `{"historyLimit": n}` caps the prior
139
139
  messages loaded; `hitl` configures approval gates. Absent = the full
140
140
  history, no gates. A tenant's `hitl` policy can tighten the gates