modelrig 0.11.0 → 0.12.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.
- package/CHANGELOG.md +82 -0
- package/dist/adapters/anthropic.d.ts +4 -4
- package/dist/adapters/anthropic.d.ts.map +1 -1
- package/dist/adapters/anthropic.js +8 -1
- package/dist/adapters/deepseek.d.ts +2 -4
- package/dist/adapters/deepseek.d.ts.map +1 -1
- package/dist/adapters/deepseek.js +9 -5
- package/dist/adapters/gemini.d.ts +4 -1
- package/dist/adapters/gemini.d.ts.map +1 -1
- package/dist/adapters/gemini.js +16 -1
- package/dist/adapters/grok.d.ts +2 -4
- package/dist/adapters/grok.d.ts.map +1 -1
- package/dist/adapters/grok.js +8 -4
- package/dist/adapters/history-mapping.d.ts +126 -0
- package/dist/adapters/history-mapping.d.ts.map +1 -0
- package/dist/adapters/history-mapping.js +230 -0
- package/dist/adapters/openai-compat.d.ts +2 -4
- package/dist/adapters/openai-compat.d.ts.map +1 -1
- package/dist/adapters/openai-compat.js +9 -5
- package/dist/adapters/openai.d.ts +2 -4
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +8 -4
- package/dist/adapters/responses-api.d.ts.map +1 -1
- package/dist/adapters/responses-api.js +9 -4
- package/dist/artifacts/artifact.d.ts.map +1 -1
- package/dist/artifacts/artifact.js +79 -0
- package/dist/artifacts/conversation.d.ts +128 -0
- package/dist/artifacts/conversation.d.ts.map +1 -0
- package/dist/artifacts/conversation.js +172 -0
- package/dist/artifacts/index.d.ts +1 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/media.d.ts +46 -0
- package/dist/artifacts/media.d.ts.map +1 -0
- package/dist/artifacts/media.js +88 -0
- package/dist/artifacts/run-context.d.ts +61 -2
- package/dist/artifacts/run-context.d.ts.map +1 -1
- package/dist/artifacts/run-context.js +183 -12
- package/dist/artifacts/scrub.d.ts +3 -0
- package/dist/artifacts/scrub.d.ts.map +1 -1
- package/dist/bakeoff/engine.d.ts.map +1 -1
- package/dist/bakeoff/engine.js +34 -7
- package/dist/bakeoff/eval-cases.d.ts +5 -0
- package/dist/bakeoff/eval-cases.d.ts.map +1 -1
- package/dist/bakeoff/eval-cases.js +10 -1
- package/dist/bakeoff/replay.d.ts +15 -0
- package/dist/bakeoff/replay.d.ts.map +1 -1
- package/dist/bakeoff/replay.js +19 -1
- package/dist/bakeoff/report.d.ts.map +1 -1
- package/dist/bakeoff/report.js +9 -2
- package/dist/bakeoff/turn-replay.d.ts +93 -0
- package/dist/bakeoff/turn-replay.d.ts.map +1 -0
- package/dist/bakeoff/turn-replay.js +150 -0
- package/dist/bakeoff/types.d.ts +12 -0
- package/dist/bakeoff/types.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +23 -3
- package/dist/doctor-preflight.d.ts.map +1 -1
- package/dist/doctor-preflight.js +6 -1
- package/dist/feedback/grade.d.ts +7 -2
- package/dist/feedback/grade.d.ts.map +1 -1
- package/dist/feedback/grade.js +14 -0
- package/dist/feedback/outcome.d.ts +103 -0
- package/dist/feedback/outcome.d.ts.map +1 -0
- package/dist/feedback/outcome.js +175 -0
- package/dist/gateway/history-bridge.d.ts +32 -0
- package/dist/gateway/history-bridge.d.ts.map +1 -0
- package/dist/gateway/history-bridge.js +64 -0
- package/dist/gateway/serve-client.d.ts.map +1 -1
- package/dist/gateway/serve-client.js +6 -0
- package/dist/index.d.ts +44 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -9
- package/dist/init/init-cli.d.ts.map +1 -1
- package/dist/init/init-cli.js +21 -4
- package/dist/init/observe-cli.js +1 -1
- package/dist/init/observe.d.ts +7 -1
- package/dist/init/observe.d.ts.map +1 -1
- package/dist/init/observe.js +74 -22
- package/dist/init/starter.d.ts +36 -0
- package/dist/init/starter.d.ts.map +1 -0
- package/dist/init/starter.js +85 -0
- package/dist/registry/build.d.ts +4 -0
- package/dist/registry/build.d.ts.map +1 -1
- package/dist/registry/generation-models.d.ts +68 -0
- package/dist/registry/generation-models.d.ts.map +1 -0
- package/dist/registry/generation-models.js +168 -0
- package/dist/registry/model-kind.d.ts +34 -0
- package/dist/registry/model-kind.d.ts.map +1 -0
- package/dist/registry/model-kind.js +40 -0
- package/dist/registry/pricing-shape.d.ts +29 -1
- package/dist/registry/pricing-shape.d.ts.map +1 -1
- package/dist/registry/pricing-shape.js +9 -0
- package/dist/registry/pricing.d.ts +26 -0
- package/dist/registry/pricing.d.ts.map +1 -1
- package/dist/registry/pricing.js +29 -0
- package/dist/registry/rows.d.ts.map +1 -1
- package/dist/registry/rows.js +3 -1
- package/dist/registry/unit-pricing.d.ts +32 -0
- package/dist/registry/unit-pricing.d.ts.map +1 -0
- package/dist/registry/unit-pricing.js +62 -0
- package/dist/routes/input-loader.d.ts +38 -0
- package/dist/routes/input-loader.d.ts.map +1 -0
- package/dist/routes/input-loader.js +80 -0
- package/dist/routes/loader.d.ts.map +1 -1
- package/dist/routes/loader.js +3 -0
- package/dist/routes/resolved-bundle.d.ts +2 -0
- package/dist/routes/resolved-bundle.d.ts.map +1 -1
- package/dist/routes/resolved-bundle.js +3 -0
- package/dist/run/cost.d.ts +28 -0
- package/dist/run/cost.d.ts.map +1 -1
- package/dist/run/cost.js +74 -0
- package/dist/run/dispatch.d.ts +4 -1
- package/dist/run/dispatch.d.ts.map +1 -1
- package/dist/run/dispatch.js +3 -0
- package/dist/run/limits.d.ts +88 -0
- package/dist/run/limits.d.ts.map +1 -0
- package/dist/run/limits.js +155 -0
- package/dist/run/messages.d.ts +199 -0
- package/dist/run/messages.d.ts.map +1 -0
- package/dist/run/messages.js +430 -0
- package/dist/run/raw-finalize.d.ts +5 -2
- package/dist/run/raw-finalize.d.ts.map +1 -1
- package/dist/run/raw-finalize.js +8 -5
- package/dist/run/raw-request.d.ts.map +1 -1
- package/dist/run/raw-request.js +2 -1
- package/dist/run/raw.d.ts +10 -4
- package/dist/run/raw.d.ts.map +1 -1
- package/dist/run/raw.js +11 -3
- package/dist/run/rawonly.d.ts +29 -5
- package/dist/run/rawonly.d.ts.map +1 -1
- package/dist/run/rawonly.js +54 -19
- package/dist/run/record-attempt.d.ts.map +1 -1
- package/dist/run/record-attempt.js +16 -6
- package/dist/run/record-call.d.ts +13 -2
- package/dist/run/record-call.d.ts.map +1 -1
- package/dist/run/record-call.js +50 -7
- package/dist/run/run.d.ts.map +1 -1
- package/dist/run/run.js +12 -8
- package/dist/telemetry/attempt-meta.d.ts +49 -1
- package/dist/telemetry/attempt-meta.d.ts.map +1 -1
- package/dist/telemetry/attempt-meta.js +45 -1
- package/dist/telemetry/exporter.d.ts.map +1 -1
- package/dist/telemetry/exporter.js +2 -1
- package/dist/telemetry/grade-mappers.d.ts +1 -1
- package/dist/telemetry/grade-mappers.d.ts.map +1 -1
- package/dist/telemetry/grade-mappers.js +7 -1
- package/dist/telemetry/grade-task.d.ts +49 -0
- package/dist/telemetry/grade-task.d.ts.map +1 -0
- package/dist/telemetry/grade-task.js +85 -0
- package/dist/telemetry/grades-sql.d.ts +16 -1
- package/dist/telemetry/grades-sql.d.ts.map +1 -1
- package/dist/telemetry/grades-sql.js +64 -4
- package/dist/telemetry/ingest-protocol.d.ts +24 -1
- package/dist/telemetry/ingest-protocol.d.ts.map +1 -1
- package/dist/telemetry/ingest-protocol.js +72 -43
- package/dist/telemetry/otel-content.d.ts +31 -0
- package/dist/telemetry/otel-content.d.ts.map +1 -0
- package/dist/telemetry/otel-content.js +106 -0
- package/dist/telemetry/otel-hierarchy.d.ts +57 -0
- package/dist/telemetry/otel-hierarchy.d.ts.map +1 -0
- package/dist/telemetry/otel-hierarchy.js +155 -0
- package/dist/telemetry/otel-normalize.d.ts +15 -1
- package/dist/telemetry/otel-normalize.d.ts.map +1 -1
- package/dist/telemetry/otel-normalize.js +24 -39
- package/dist/telemetry/sinks.d.ts +4 -1
- package/dist/telemetry/sinks.d.ts.map +1 -1
- package/dist/telemetry/sinks.js +53 -34
- package/dist/telemetry/store-migrations.d.ts.map +1 -1
- package/dist/telemetry/store-migrations.js +8 -0
- package/dist/telemetry/store.d.ts +9 -0
- package/dist/telemetry/store.d.ts.map +1 -1
- package/dist/telemetry/store.js +10 -0
- package/dist/telemetry/uniform-rows.d.ts +43 -0
- package/dist/telemetry/uniform-rows.d.ts.map +1 -0
- package/dist/telemetry/uniform-rows.js +139 -0
- package/dist/types/failures-teaching.d.ts.map +1 -1
- package/dist/types/failures-teaching.js +11 -0
- package/dist/types/failures.d.ts +1 -1
- package/dist/types/failures.d.ts.map +1 -1
- package/dist/types/failures.js +2 -0
- package/dist/types/provider.d.ts +12 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/route.d.ts +13 -0
- package/dist/types/route.d.ts.map +1 -1
- package/dist/types/telemetry.d.ts +14 -1
- package/dist/types/telemetry.d.ts.map +1 -1
- package/docs/agent-skill/SKILL.md +122 -12
- package/docs/how-it-fits.md +4 -4
- package/docs/instrumentation.md +148 -44
- package/docs/llms.txt +143 -13
- package/docs/mcp-oracle.md +15 -4
- package/docs/quickstart.md +129 -16
- package/package.json +4 -2
- package/registry/registry.json +456 -0
- package/templates/creative-approval.json +81 -0
- package/templates/support-conversation.json +82 -0
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,88 @@ in `docs/ModelRig/development-rules.md`; enforced by `release-parity.test.ts`).
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.12.0] — 2026-10-25
|
|
19
|
+
|
|
20
|
+
ARC lane: conversations as runs, delayed outcomes, run limits, the messages
|
|
21
|
+
lane (chat turns and tool loops) with turn replay, generated-media units and
|
|
22
|
+
unit pricing, OTLP-in v1 with framework recipes — plus run failure reasons and
|
|
23
|
+
the ingest fixes. Ships with `modelrig-oracle` 0.4.0 (`record_outcome`,
|
|
24
|
+
`query_conversations`, `query_registry` `kind`).
|
|
25
|
+
|
|
26
|
+
**Upgrade notes.** Outcomes need control-plane migration **00089** on the
|
|
27
|
+
server first (apply 00089 → deploy the server → upgrade the SDK). Direct-mode
|
|
28
|
+
(service-role) sinks must apply control-plane migrations through **00062**
|
|
29
|
+
before upgrading. `RawRunInput.userPrompt` is now optional (see below).
|
|
30
|
+
|
|
31
|
+
**Added**
|
|
32
|
+
|
|
33
|
+
- **Messages lane (ARC-β): chat turns and tool loops, unflattened.** `rig.run(route, { input, messages })` on a route that declares `input: { kind: messages }`, and `runRaw({ ..., messages })` (`userPrompt` optional alongside it), take a `HistoryMessage[]` conversation (user / assistant with `toolCalls` / tool) that every adapter maps to its native shape — Anthropic `tool_use`/`tool_result` blocks, OpenAI `tool_calls`/`role:"tool"` (chat, stream and Responses), Gemini `functionCall`/`functionResponse` contents, and the OpenAI-compatible hosts. The system prompt stays the route template / `systemPrompt`; a `system` message in the history, an orphan tool result or an empty history throws `MessagesInputError` pre-dispatch (`historyProblems` lists the same). Without `messages` every request is byte-identical (pinned by `one-turn-parity.test.ts`). The hosted `/v1/chat/completions` passes a multi-turn transcript through as `messages` on the raw lane and to a messages route on the slug lane; single-turn requests are unchanged. Capture stores the history as JSON (`renderForCapture`); the prefix fingerprint stays stable across a growing conversation (`canonicalizeHistory` is prefix-stable). A messages route cannot declare `mask:`/`screen:` yet, and managed serving fails closed on it. See `docs/messages-lane.md`.
|
|
34
|
+
- **Messages lane — refusals and fallbacks.** A messages route that declares `repair:` (route or variant) is refused at load and at run time (the repair rung cannot see the conversation). Validation now requires the tool results right after an assistant turn with `toolCalls` to answer exactly that turn's calls. Provider rules fail closed before dispatch: Anthropic with tool turns in the history and no declared `tools`, and Gemini 3 models with function calls in the history (no placeholder thought signatures are invented). On `/v1/chat/completions` (raw lane) a tool transcript sent to `anthropic/*` without `tools`, or to `gemini/*`, keeps today's flattening, as does a transcript whose tool results do not pair. In turn replay, a case a candidate cannot take natively is reported as incomparable for that model (`VariantMetrics.incomparable`, "n cases incomparable for <model>: reason") and excluded from its score and regret, never scored as a failure.
|
|
35
|
+
- **Messages lane — incompatible candidates are skipped, not fatal.** `rig.run` now skips a candidate that cannot take the history natively before the ladder (no dispatch, no row) and serves the next compatible one; skips are tagged `history_skipped` on the call's rows, and only an all-incompatible route fails closed (`invariant_violation` listing each reason). Capture records the call's `tools` / `toolChoice` (only when declared) and turn replay re-sends them, so Anthropic tool-loop turns replay as comparable. Tool-call ids are scoped to one turn (`call_0` reused across turns is valid). The Gemini 3 check normalizes `models/` and case.
|
|
36
|
+
- **Turn replay attributes fallback answers.** When a multi-candidate arm's first candidate is skipped for a turn's history and a later one answers, each replay sample records `servedBy` / `historySkipped` (messages routes only), the arm gains `VariantMetrics.servedByFallback` and `armLabel` ("<first> → <fallback> (fallback served n/N)"), and the matrix, headline and reviewer arm meta use that label; the report prints "n cases served by <model> (<skipped model> skipped: <reason>)". Arms with no skip, and every variables route, are unchanged.
|
|
37
|
+
- **Type change: `RawRunInput.userPrompt` is now optional** (`userPrompt?: string`) because `messages` can replace it. Code that reads `input.userPrompt` as a `string` (a custom `runRaw` dependency or wrapper) needs `?? ""` after upgrading.
|
|
38
|
+
- **Turn replay (ARC-β).** A bake-off over a messages route replays each captured turn's history and the candidate answers that final turn only (graded by the route's grader, regret bound unchanged; never a simulated next user turn); eval cases carry the turn (`turnReplayCase`). Runs only where capture is explicitly on, otherwise `TurnReplayRefusedError` (HTTP 422).
|
|
39
|
+
- **Runs carry why they failed.** `run.end("failed", { failureReason })` and `rig.artifacts.run.setFailureReason(reason)` (for `run.scope`) write an identifier reason to `runs.meta.failure_reason` (`RunMetaV1.failure_reason`, sanitized like every envelope field); the hosted `run-outcome@v1` verdict labels a failed run with it instead of a stray step `failure_class`. Additive; a succeeded run ignores the reason.
|
|
40
|
+
- **Conversations as runs (ARC-1).** `rig.conversation(id, { agent, user?, tenant?, limits? })` opens (or re-enters) ONE run for a chat or agent task loop — `pipeline = agent`, `episode_key = id`, `RunMeta.trigger = "conversation"`; `conversation.turn(fn)` records every call inside it as step `turn:<n>.<k>`; `conversation.end()`. Re-entry continues the open run in-process or from the local store. The hosted server closes idle conversations (`conversation-idle-close`, default 30 min) and offers them to auto-grading under `conversation:<agent>`. Console: **Conversations** (list + transcript). Starter guide: `templates/support-conversation.json`.
|
|
41
|
+
- **Outcomes (ARC-3).** `rig.outcome({ key, name, score?, value?, scale?, at?, idempotencyKey? })` and `POST /v1/outcomes` record a delayed business outcome (resolved, booked, CTR) as a `kind: "outcome"` grade (`grader = outcome:<name>`, raw `value`); a conversation key joins lazily, so it may arrive before its run. Outcome agreement on a grader's page is a held-out receipt, never a calibration gate. Needs control-plane migration **00089** — deploy order: apply 00089 → deploy the server → upgrade the SDK. Until the server sees it (lazy re-probe, ~1 min, no restart), `POST /v1/outcomes` answers 503 and outcome rows on `/v1/ingest` are dropped and counted (`outcome_schema_unavailable`) without holding back the rest of the batch. `idempotencyKey` ids are UUIDv5(org, `name:key`), identical on both doors; `rig.grade({ kind: "outcome" })` is refused (use `rig.outcome`). With an idempotency key, the id `rig.outcome` returns is local; the server stores the row under the org-scoped id. Workspace note: a local telemetry SQLite file created by an unpublished pre-fix workspace build of this branch (its grades table at `user_version` 17 without the `idempotency_key` column / transactional rebuild) must be deleted before using this build; published-SDK databases (≤ v16) migrate in place. MCP: `record_outcome`, `query_conversations`.
|
|
42
|
+
- **Run limits (ARC-5).** `run.start({ limits: { maxUsd, maxCalls, maxWallMs, maxRepeatToolCall } })` (also on `rig.conversation`) refuses the next `rig.run` / `rig.runRaw` in-process once a limit is reached, throwing `RunLimitExceeded` (new terminal failure class `limit_exceeded`) and ending the run failed with `failure_reason: limit:<which>`; `rig.recordCall` only accumulates. Repeat-tool detection keeps a hash of the arguments only.
|
|
43
|
+
- **Generated media: units and unit pricing (ARC-4).** `rig.recordCall({ ..., units: { images?, seconds?, characters?, steps? } })` records an image / video / text-to-speech / transcription call on `meta.units` (`AttemptMetaV1.units`, `UNIT_KEYS`; zero DDL). `estimateUnitCostUsd(provider, model, units)` prices one billed unit per model from the registry's declared generation entry (`pricing_v2.modality`, with provenance), else the vendored pricing map's per-mode rate, else `pricingMissing` — never from token rates; token and unit cost add. `ModalityRates` gains `video_per_second`, `characters_per_million` and `provenance`. Registry entries gain an optional `kind` (`llm` | `image_gen` | `video_gen` | `tts` | `stt`) and 12 declared-only generation models, unprobed and never ranked; the oracle's `query_registry` takes `kind`. Media artifacts (`image/*`, `video/*`, `audio/*`) are stored flagged unscreened (`scrub.unscreened = "media"`); `POST /v1/grade` accepts `artifactId`; the console shows approval rate per $ on Costs and a Media approval tab in the Grade queue. Starter guide: `templates/creative-approval.json`.
|
|
44
|
+
- **OTLP-in v1 (ARC-6).** Attested steps keep `parent_span_id` and `operation_class`; a trace with `gen_ai.conversation.id` and `invoke_agent` spans becomes a conversation run (`trigger: conversation`) with generations numbered `turn:<n>.<k>` and tool calls counted per turn. Content extraction exists behind the server gate `MODELRIG_OTLP_CONTENT_EXTRACTION` (OFF; also needs a managed posture) pending ruling M14. Framework recipes: Vercel AI SDK, OpenAI Agents SDK, LangGraph / LangChain JS, Mastra, LiveKit Agents, single-sourced through the new `OTLP_EXPORTER` and `OTLP_TURN` setup blocks.
|
|
45
|
+
|
|
46
|
+
**Fixed**
|
|
47
|
+
|
|
48
|
+
- **ingest: inference rows are written with a uniform key set — a web-search surcharge row (`meta: null`) no longer makes the whole batch 422 (PGRST102).** `stampBatch` gives every `inferences` row the same columns (absent optional fields written as their default: `null`, or `0`/`false`/`{}` for the NOT NULL ones); `steps` / `artifacts` fill an optional column with `null` when any row in the write carries it; `tasks` / `runs` (merge upserts) are split into one write per key set so a `null` never overwrites a stored value. Before this, one such row poisoned the whole bulk insert and the exporter dropped the batch after its self-heal window. Applies to both transports (`stampBatch` is shared; the hosted server picks it up on deploy).
|
|
49
|
+
- **direct mode: apply control-plane migrations through 00062 before upgrading (migrate first).** Because every `inferences` row now carries the full column set, a service-role (direct-mode) sink writes `call_id`, `attempt_seq`, `candidate_index` (00054), `meta` (00056) and `mask` (00062) on every batch; a database missing those columns rejects every batch (`PGRST204`). The hosted server is already current.
|
|
50
|
+
- **Rejected writes log the PostgREST code.** The server logs the table, status and error code (`PGRST102`, `23514`, …) of a rejected control-plane write, with no host, header or row content, and the `/v1/ingest` 422 body adds `reason_code` (the code alone). The SDK carries it as `SinkSendError.reasonCode` and names it on the exporter's `POISON-SKIP` line.
|
|
51
|
+
|
|
52
|
+
## [0.11.1] — 2026-10-21
|
|
53
|
+
|
|
54
|
+
Setup correctness (SURF-1, the 2026-10-20 setup audit). Patch: no new public
|
|
55
|
+
API, no DDL, no new environment variable.
|
|
56
|
+
|
|
57
|
+
**Fixed**
|
|
58
|
+
|
|
59
|
+
- **The `modelrig observe` seam no longer crashes your app on import.** The
|
|
60
|
+
generated `modelrig/observe/record-step.ts` builds its rig with
|
|
61
|
+
`createRig({ ...loadConfigFromEnv(), routesDir: null })`, so importing it in a
|
|
62
|
+
repo with no `./modelrig/routes` cannot throw `RouteConfigError`.
|
|
63
|
+
- **`createRig` with an absent *default* routes directory warns and builds a
|
|
64
|
+
raw-only rig** (`rig.runRaw`, `rig.runRawStream`, `rig.recordCall` work;
|
|
65
|
+
`rig.run` refuses with an `invariant_violation` that names the missing
|
|
66
|
+
directory). "Default" is tracked by where the value came from:
|
|
67
|
+
`loadConfigFromEnv()` filled it in (no `MODELRIG_ROUTES_DIR`, no `routesDir`
|
|
68
|
+
override) and it was left as loaded. A routes directory you set (env, a
|
|
69
|
+
`loadConfigFromEnv({ routesDir })` override, or a hand-built config, even
|
|
70
|
+
`"./modelrig/routes"`) that is missing still throws, as before. Pass
|
|
71
|
+
`routesDir: null` to mean raw-only and silence the warning.
|
|
72
|
+
- **The observe wiring reports cost.** `recordStep(stepKey, { …, call })`
|
|
73
|
+
reports the provider call through `rig.recordCall`, so observed steps carry
|
|
74
|
+
tokens and cost and appear on /inferences; the seam exports `closeRig()`.
|
|
75
|
+
Gemini wiring counts thinking tokens (`thoughtsTokenCount`) as output.
|
|
76
|
+
OBSERVE.md's run wrap passes `environment`, and the dead
|
|
77
|
+
`MODELRIG_ARTIFACT_STEPS` line is gone (the SDK never read it).
|
|
78
|
+
- **`modelrig init` writes the starter route's two files**
|
|
79
|
+
(`schemas/support_summarize.schema.json`, `prompts/support_summarize.system.md`
|
|
80
|
+
under the routes dir, never overwriting yours), so the
|
|
81
|
+
`example.support_summarize` route every on-ramp shows validates as pasted.
|
|
82
|
+
- **`bakeoff --from-eval-cases` runs with no routes directory** (an empty or
|
|
83
|
+
unrehydratable eval set reports honestly; a case that replays still needs the
|
|
84
|
+
task's route bundle for its variants), and is listed in `--help`.
|
|
85
|
+
- **`modelrig doctor` prints the org slug**: `→ org «Your Org» (your-org) ✓`.
|
|
86
|
+
The slug is what `--expect-org` and `createRig({ expectOrg })` compare.
|
|
87
|
+
|
|
88
|
+
**Docs** (modelrig.dev, shipped in the tarball where listed in `files`)
|
|
89
|
+
|
|
90
|
+
- Shared setup blocks for the raw rig, `rig.recordCall`, run grades, bake-offs
|
|
91
|
+
and `--expect-org`, one text on every surface. The TypeScript shared blocks
|
|
92
|
+
and the generated observe seam are compiled strict +
|
|
93
|
+
`exactOptionalPropertyTypes` + `noUncheckedIndexedAccess` against the built
|
|
94
|
+
types in CI; other page snippets are not.
|
|
95
|
+
- A run grade's subject id is `run.runId` (the run's id; the grade shows on
|
|
96
|
+
the run page and on /projects); the old `run_id` examples did not compile. The A/B `arm` example spreads `arm` only when drawn.
|
|
97
|
+
- The modelrig.dev header is a five-link top bar plus a grouped sidebar
|
|
98
|
+
(collapsible on mobile) instead of ~40 flat links.
|
|
99
|
+
|
|
18
100
|
## [0.11.0] — 2026-10-20
|
|
19
101
|
|
|
20
102
|
**`rig.recordCall()` — record a provider call ModelRig did not dispatch**
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { CapabilityFlag, ProviderAdapter } from "../types/provider";
|
|
13
13
|
import type { ClassifiedFailure, ShapingInput } from "./gemini";
|
|
14
14
|
import type { AnthropicWireToolChoice } from "./tool-mapping";
|
|
15
|
+
import type { AnthropicWireMessage } from "./history-mapping";
|
|
15
16
|
export interface AnthropicAdapterConfig {
|
|
16
17
|
readonly apiKey: string;
|
|
17
18
|
}
|
|
@@ -47,10 +48,9 @@ export interface AnthropicShapedParams {
|
|
|
47
48
|
/** Plain string by default; the block-array form carries a `cache_control`
|
|
48
49
|
* breakpoint when the request opts into caching (WS-C). */
|
|
49
50
|
readonly system?: string | readonly AnthropicSystemBlock[];
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}>;
|
|
51
|
+
/** Single-turn: one user message (byte-identical to pre-ARC-β). Messages lane:
|
|
52
|
+
* the mapped history (adapters/history-mapping.ts). */
|
|
53
|
+
readonly messages: readonly AnthropicWireMessage[];
|
|
54
54
|
readonly stream: true;
|
|
55
55
|
readonly tools?: readonly AnthropicTool[];
|
|
56
56
|
readonly tool_choice?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/adapters/anthropic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAIV,cAAc,EACd,eAAe,EAEhB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAK9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AASD;yDACyD;AACzD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAclF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAwB3E;AAED,UAAU,aAAa;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CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB,CAAC;CACnG;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,YAAY,EACjB,MAAM,UAAQ,GACb,qBAAqB,CAwDvB;AAED;iEACiE;AACjE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAC9C,QAAQ,CAAC,cAAc,CAAC,EAAE;QACxB,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;QAC5C,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;KAC7C,CAAC;CACH;AAED,0EAA0E;AAC1E,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,CAAC,EAAE,sBAAsB,GACxB,6BAA6B,CAa/B;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,eAAe,CAyOtF"}
|
|
@@ -22,6 +22,8 @@ exports.normalizeAnthropicInputUsage = normalizeAnthropicInputUsage;
|
|
|
22
22
|
exports.createAnthropicAdapter = createAnthropicAdapter;
|
|
23
23
|
const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
|
|
24
24
|
const tool_mapping_1 = require("./tool-mapping");
|
|
25
|
+
const history_mapping_1 = require("./history-mapping");
|
|
26
|
+
const messages_1 = require("../run/messages");
|
|
25
27
|
const attempt_meta_map_1 = require("./attempt-meta-map");
|
|
26
28
|
const sampling_1 = require("./sampling");
|
|
27
29
|
const DEFAULT_MAX_TOKENS = 32000;
|
|
@@ -127,7 +129,8 @@ function buildAnthropicParams(model, req, strict = false) {
|
|
|
127
129
|
max_tokens: (0, sampling_1.effectiveMaxOutputTokens)(req, DEFAULT_MAX_TOKENS),
|
|
128
130
|
...(0, sampling_1.openAISamplingFields)(req),
|
|
129
131
|
...systemField,
|
|
130
|
-
|
|
132
|
+
// ARC-β: history present ⇒ mapped conversation; absent ⇒ today's single user turn.
|
|
133
|
+
messages: req.history !== undefined ? (0, history_mapping_1.toAnthropicMessages)(req.history, req.userPrompt) : [{ role: "user", content: req.userPrompt }],
|
|
131
134
|
stream: true,
|
|
132
135
|
...toolBlock,
|
|
133
136
|
};
|
|
@@ -175,6 +178,10 @@ function createAnthropicAdapter(config) {
|
|
|
175
178
|
...(usage !== undefined ? { usage } : {}),
|
|
176
179
|
...(attemptMeta !== undefined ? { meta: attemptMeta } : {}),
|
|
177
180
|
});
|
|
181
|
+
// ARC-β ruling M3(b): a history Anthropic would reject fails closed BEFORE dispatch.
|
|
182
|
+
const incompatible = (0, messages_1.historyIncompatibility)("anthropic", model, req.history, req.tools);
|
|
183
|
+
if (incompatible !== null)
|
|
184
|
+
return fail("invariant_violation", incompatible, "declare the tool loop's `tools` on this request");
|
|
178
185
|
const wantJson = req.outputSchema !== null;
|
|
179
186
|
try {
|
|
180
187
|
const client = new sdk_1.default({ apiKey: config.apiKey, timeout: req.timeoutMs });
|
|
@@ -15,15 +15,13 @@
|
|
|
15
15
|
import type { CapabilityFlag, ProviderAdapter } from "../types/provider";
|
|
16
16
|
import type { ClassifiedFailure, ShapingInput } from "./gemini";
|
|
17
17
|
import type { OpenAIWireTool, OpenAIWireToolChoice } from "./tool-mapping";
|
|
18
|
+
import type { OpenAIChatWireMessage } from "./history-mapping";
|
|
18
19
|
export interface DeepSeekAdapterConfig {
|
|
19
20
|
readonly apiKey: string;
|
|
20
21
|
}
|
|
21
22
|
export declare function deepseekSupports(feature: CapabilityFlag, model: string): boolean;
|
|
22
23
|
export declare function classifyDeepSeekFailure(message: string): ClassifiedFailure;
|
|
23
|
-
|
|
24
|
-
readonly role: "system" | "user";
|
|
25
|
-
readonly content: string;
|
|
26
|
-
}
|
|
24
|
+
type ChatMessage = OpenAIChatWireMessage;
|
|
27
25
|
export interface DeepSeekShapedParams {
|
|
28
26
|
readonly model: string;
|
|
29
27
|
readonly max_tokens: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../../src/adapters/deepseek.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAIV,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMhE,OAAO,KAAK,EAAuB,cAAc,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAQhG,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAKD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAMhF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAiB1E;AAED,
|
|
1
|
+
{"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../../src/adapters/deepseek.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAIV,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMhE,OAAO,KAAK,EAAuB,cAAc,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAQhG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t_meta_map_1 = require("./attempt-meta-map");
|
|
28
28
|
const sampling_1 = require("./sampling");
|
|
29
|
+
const history_mapping_1 = require("./history-mapping");
|
|
29
30
|
const DEEPSEEK_BASE_URL = "https://api.deepseek.com";
|
|
30
31
|
const DEFAULT_MAX_TOKENS = 64000; // R1/V3 max — full capacity for long reports (ported)
|
|
31
32
|
function deepseekSupports(feature, model) {
|
|
@@ -71,13 +72,16 @@ function buildDeepSeekParams(model, req) {
|
|
|
71
72
|
// (spec R4), not silently intercepted here.
|
|
72
73
|
const jsonObject = wantJson || req.responseFormat === "json_object";
|
|
73
74
|
let systemPrompt = req.systemPrompt;
|
|
74
|
-
if (wantJson && !req.systemPrompt.includes("JSON") && !
|
|
75
|
+
if (wantJson && !req.systemPrompt.includes("JSON") && !(0, history_mapping_1.userSideMentions)(req, "JSON")) {
|
|
75
76
|
systemPrompt = systemPrompt === "" ? JSON_GUARD : `${systemPrompt}\n\n${JSON_GUARD}`;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
// ARC-β: history present ⇒ mapped conversation; absent ⇒ today's literal (byte-identical).
|
|
79
|
+
const messages = req.history !== undefined
|
|
80
|
+
? (0, history_mapping_1.toOpenAIChatMessages)(systemPrompt, req.history, req.userPrompt, { flattenParts: true })
|
|
81
|
+
: [
|
|
82
|
+
...(systemPrompt !== "" ? [{ role: "system", content: systemPrompt }] : []),
|
|
83
|
+
{ role: "user", content: req.userPrompt },
|
|
84
|
+
];
|
|
81
85
|
return {
|
|
82
86
|
model,
|
|
83
87
|
max_tokens: (0, sampling_1.effectiveMaxOutputTokens)(req, DEFAULT_MAX_TOKENS),
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* Copyright (c) 2023 Berri AI, MIT License — retain this notice if LiteLLM's
|
|
14
14
|
* gemini transformation logic is consulted during the port.
|
|
15
15
|
*/
|
|
16
|
+
import type { GeminiWireContent } from "./history-mapping";
|
|
16
17
|
import type { AdapterRequest, CapabilityFlag, ProviderAdapter, ServiceTier } from "../types/provider";
|
|
17
18
|
import type { FailureClass } from "../types/failures";
|
|
18
19
|
import type { PromptDelivery, ServedTierSource } from "../telemetry/attempt-meta";
|
|
@@ -52,7 +53,9 @@ export type ShapingInput = Omit<AdapterRequest, "candidate">;
|
|
|
52
53
|
export declare function geminiReasoningUnsupported(model: string, req: ShapingInput): ClassifiedFailure | null;
|
|
53
54
|
export interface GeminiShapedRequest {
|
|
54
55
|
readonly model: string;
|
|
55
|
-
|
|
56
|
+
/** Single-turn: the user turn as a string (byte-identical to pre-ARC-β).
|
|
57
|
+
* Messages lane: the mapped `contents` array (adapters/history-mapping.ts). */
|
|
58
|
+
readonly contents: string | readonly GeminiWireContent[];
|
|
56
59
|
readonly config: Record<string, unknown>;
|
|
57
60
|
/** Issue #5 (R1): how the rendered prompt was delivered — stamped on the
|
|
58
61
|
* attempt's `meta.prompt_delivery` so the control plane can prove it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../src/adapters/gemini.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,cAAc,EAGd,cAAc,EACd,eAAe,EACf,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,mBAAmB,CAAC;AAGlE,OAAO,KAAK,EAAiB,cAAc,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKjG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;mCAImC;AACnC,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,MAAM,CAI7D,CAAC;AA0BH,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAG9E;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CA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AC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AACF,KAAK,oBAAoB,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;KAAE,CAAA;CAAE,CAAC;AAEvG;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,oBAAoB,GAAG,SAAS,GAAG,MAAM,CAM9F;AAED;;qEAEqE;AACrE,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAInG;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,oBAAoB,GAAG,SAAS,EAC3C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,QAAQ,EAAE,OAAO,GAChB,MAAM,CAGR;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,eAAe,CAqNhF"}
|
package/dist/adapters/gemini.js
CHANGED
|
@@ -26,6 +26,8 @@ exports.extractGeminiCandidateText = extractGeminiCandidateText;
|
|
|
26
26
|
exports.geminiCandidateHasFunctionCall = geminiCandidateHasFunctionCall;
|
|
27
27
|
exports.resolveGeminiText = resolveGeminiText;
|
|
28
28
|
exports.createGeminiAdapter = createGeminiAdapter;
|
|
29
|
+
const history_mapping_1 = require("./history-mapping");
|
|
30
|
+
const messages_1 = require("../run/messages");
|
|
29
31
|
const genai_1 = require("@google/genai");
|
|
30
32
|
const tool_mapping_1 = require("./tool-mapping");
|
|
31
33
|
const attempt_meta_map_1 = require("./attempt-meta-map");
|
|
@@ -180,7 +182,10 @@ function buildGeminiRequest(model, req) {
|
|
|
180
182
|
let promptDelivery;
|
|
181
183
|
if (usingCache) {
|
|
182
184
|
config.cachedContent = req.cache?.key;
|
|
183
|
-
|
|
185
|
+
// ARC-β: with history, the system prompt folds into the first user turn (same rule).
|
|
186
|
+
contents = req.history !== undefined
|
|
187
|
+
? (0, history_mapping_1.toGeminiContents)(req.history, req.userPrompt, req.systemPrompt)
|
|
188
|
+
: cachedUserTurn(req.systemPrompt, req.userPrompt);
|
|
184
189
|
promptDelivery = "user+cache";
|
|
185
190
|
}
|
|
186
191
|
else {
|
|
@@ -203,6 +208,9 @@ function buildGeminiRequest(model, req) {
|
|
|
203
208
|
if (req.requestedTier === "flex") {
|
|
204
209
|
config.serviceTier = "flex";
|
|
205
210
|
}
|
|
211
|
+
// ARC-β: history present (no cache handle) ⇒ mapped `contents`; system stays systemInstruction.
|
|
212
|
+
if (req.history !== undefined && !usingCache)
|
|
213
|
+
contents = (0, history_mapping_1.toGeminiContents)(req.history, req.userPrompt);
|
|
206
214
|
return { model, contents, config, promptDelivery };
|
|
207
215
|
}
|
|
208
216
|
/** Best-effort served-tier extraction (ported): response.serviceTier, then
|
|
@@ -291,6 +299,13 @@ function createGeminiAdapter(config) {
|
|
|
291
299
|
clearTimeout(timeoutId);
|
|
292
300
|
return fail(reasoningUnsupported.cls, `reasoning control declared on the non-thinking Gemini model "${model}"`, reasoningUnsupported.fixHint);
|
|
293
301
|
}
|
|
302
|
+
// ARC-β ruling M3(b): Gemini 3 + function calls in history fails closed BEFORE dispatch
|
|
303
|
+
// (no placeholder thought signatures are invented).
|
|
304
|
+
const incompatible = (0, messages_1.historyIncompatibility)("gemini", model, req.history, req.tools);
|
|
305
|
+
if (incompatible !== null) {
|
|
306
|
+
clearTimeout(timeoutId);
|
|
307
|
+
return fail("invariant_violation", incompatible, "serve tool-loop turns with a non-Gemini-3 model");
|
|
308
|
+
}
|
|
294
309
|
try {
|
|
295
310
|
const shaped = buildGeminiRequest(model, req);
|
|
296
311
|
const dispatchedAt = Date.now();
|
package/dist/adapters/grok.d.ts
CHANGED
|
@@ -13,15 +13,13 @@
|
|
|
13
13
|
import type { CapabilityFlag, ProviderAdapter } from "../types/provider";
|
|
14
14
|
import type { ClassifiedFailure, ShapingInput } from "./gemini";
|
|
15
15
|
import type { OpenAIWireTool, OpenAIWireToolChoice } from "./tool-mapping";
|
|
16
|
+
import type { OpenAIChatWireMessage } from "./history-mapping";
|
|
16
17
|
export interface GrokAdapterConfig {
|
|
17
18
|
readonly apiKey: string;
|
|
18
19
|
}
|
|
19
20
|
export declare function grokSupports(feature: CapabilityFlag, _model: string): boolean;
|
|
20
21
|
export declare function classifyGrokFailure(message: string): ClassifiedFailure;
|
|
21
|
-
|
|
22
|
-
readonly role: "system" | "user";
|
|
23
|
-
readonly content: string;
|
|
24
|
-
}
|
|
22
|
+
type ChatMessage = OpenAIChatWireMessage;
|
|
25
23
|
export interface GrokShapedParams {
|
|
26
24
|
readonly model: string;
|
|
27
25
|
readonly max_tokens: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grok.d.ts","sourceRoot":"","sources":["../../src/adapters/grok.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAIV,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMhE,OAAO,KAAK,EAAuB,cAAc,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"grok.d.ts","sourceRoot":"","sources":["../../src/adapters/grok.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAIV,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMhE,OAAO,KAAK,EAAuB,cAAc,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAQhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI/D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC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C,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,gBAAgB,CAsDlF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,eAAe,CAqN5E"}
|
package/dist/adapters/grok.js
CHANGED
|
@@ -24,6 +24,7 @@ const tool_mapping_1 = require("./tool-mapping");
|
|
|
24
24
|
const openai_stream_1 = require("./openai-stream");
|
|
25
25
|
const attempt_meta_map_1 = require("./attempt-meta-map");
|
|
26
26
|
const sampling_1 = require("./sampling");
|
|
27
|
+
const history_mapping_1 = require("./history-mapping");
|
|
27
28
|
const raw_support_1 = require("../run/raw-support");
|
|
28
29
|
const responses_api_1 = require("./responses-api");
|
|
29
30
|
const GROK_BASE_URL = "https://api.x.ai/v1";
|
|
@@ -96,10 +97,13 @@ function classifyGrokFailure(message) {
|
|
|
96
97
|
return { cls: "network" };
|
|
97
98
|
}
|
|
98
99
|
function buildGrokParams(model, req) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
// ARC-β: history present ⇒ mapped conversation; absent ⇒ today's literal (byte-identical).
|
|
101
|
+
const messages = req.history !== undefined
|
|
102
|
+
? (0, history_mapping_1.toOpenAIChatMessages)(req.systemPrompt, req.history, req.userPrompt, { flattenParts: false })
|
|
103
|
+
: [
|
|
104
|
+
...(req.systemPrompt !== "" ? [{ role: "system", content: req.systemPrompt }] : []),
|
|
105
|
+
{ role: "user", content: req.userPrompt },
|
|
106
|
+
];
|
|
103
107
|
return {
|
|
104
108
|
model,
|
|
105
109
|
max_tokens: (0, sampling_1.effectiveMaxOutputTokens)(req, DEFAULT_MAX_TOKENS),
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messages lane — provider-neutral history → each provider family's native
|
|
3
|
+
* conversation shape (ARC-β, builder-prompt-02 §1.2). The single place every
|
|
4
|
+
* dialect is translated, so each adapter's diff is one branch:
|
|
5
|
+
* `req.history !== undefined ? <family mapper> : <today's literal>`.
|
|
6
|
+
*
|
|
7
|
+
* SEMANTICS (identical for every family, `AdapterRequest.history`):
|
|
8
|
+
* provider messages = [system(systemPrompt)] + map(history)
|
|
9
|
+
* + (userPrompt !== "" ? [user(userPrompt)] : [])
|
|
10
|
+
* The system prompt keeps its family-native slot (OpenAI `system` message,
|
|
11
|
+
* Anthropic top-level `system`, Gemini `systemInstruction`, Responses `system`
|
|
12
|
+
* input item) exactly as the single-turn path delivers it.
|
|
13
|
+
*
|
|
14
|
+
* Pure functions, no I/O. History is assumed VALID (run/messages.ts validates
|
|
15
|
+
* at every SDK entry): tool results answer a prior call, arguments are JSON.
|
|
16
|
+
*/
|
|
17
|
+
import type { HistoryMessage } from "../run/messages";
|
|
18
|
+
/** True when `word` appears in the user side of a request — the single-turn
|
|
19
|
+
* `userPrompt`, or (messages lane) any history text. The DeepSeek / compat
|
|
20
|
+
* JSON-guard keys on this so a one-turn history is guarded exactly like the
|
|
21
|
+
* legacy `userPrompt` it replaces. */
|
|
22
|
+
export declare function userSideMentions(req: {
|
|
23
|
+
readonly userPrompt: string;
|
|
24
|
+
readonly history?: readonly HistoryMessage[];
|
|
25
|
+
}, word: string): boolean;
|
|
26
|
+
export type OpenAIChatTextPart = {
|
|
27
|
+
readonly type: "text";
|
|
28
|
+
readonly text: string;
|
|
29
|
+
};
|
|
30
|
+
export type OpenAIChatWireMessage = {
|
|
31
|
+
readonly role: "system";
|
|
32
|
+
readonly content: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly role: "user";
|
|
35
|
+
readonly content: string | readonly OpenAIChatTextPart[];
|
|
36
|
+
} | {
|
|
37
|
+
readonly role: "assistant";
|
|
38
|
+
readonly content: string | readonly OpenAIChatTextPart[] | null;
|
|
39
|
+
readonly tool_calls?: ReadonlyArray<{
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly type: "function";
|
|
42
|
+
readonly function: {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly arguments: string;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
} | {
|
|
48
|
+
readonly role: "tool";
|
|
49
|
+
readonly tool_call_id: string;
|
|
50
|
+
readonly content: string;
|
|
51
|
+
};
|
|
52
|
+
export interface OpenAIChatMappingOptions {
|
|
53
|
+
/** Collapse multi-part text content to one string — for hosts whose
|
|
54
|
+
* OpenAI-compatibility does not accept content-part arrays (DeepSeek and the
|
|
55
|
+
* generic compat hosts). Native OpenAI and xAI keep the part array. */
|
|
56
|
+
readonly flattenParts: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** History → OpenAI Chat Completions `messages` (tool_calls / role:"tool"). */
|
|
59
|
+
export declare function toOpenAIChatMessages(systemPrompt: string, history: readonly HistoryMessage[], userPrompt: string, opts: OpenAIChatMappingOptions): OpenAIChatWireMessage[];
|
|
60
|
+
export type ResponsesInputItem = {
|
|
61
|
+
readonly role: "system" | "user" | "assistant";
|
|
62
|
+
readonly content: string;
|
|
63
|
+
} | {
|
|
64
|
+
readonly role: "user";
|
|
65
|
+
readonly content: ReadonlyArray<{
|
|
66
|
+
readonly type: "input_text";
|
|
67
|
+
readonly text: string;
|
|
68
|
+
}>;
|
|
69
|
+
} | {
|
|
70
|
+
readonly type: "function_call";
|
|
71
|
+
readonly call_id: string;
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly arguments: string;
|
|
74
|
+
} | {
|
|
75
|
+
readonly type: "function_call_output";
|
|
76
|
+
readonly call_id: string;
|
|
77
|
+
readonly output: string;
|
|
78
|
+
};
|
|
79
|
+
/** History → Responses API `input` (messages + function_call /
|
|
80
|
+
* function_call_output items). */
|
|
81
|
+
export declare function toResponsesInput(systemPrompt: string, history: readonly HistoryMessage[], userPrompt: string): ResponsesInputItem[];
|
|
82
|
+
export type AnthropicWireBlock = {
|
|
83
|
+
readonly type: "text";
|
|
84
|
+
readonly text: string;
|
|
85
|
+
} | {
|
|
86
|
+
readonly type: "tool_use";
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly input: Record<string, unknown>;
|
|
90
|
+
} | {
|
|
91
|
+
readonly type: "tool_result";
|
|
92
|
+
readonly tool_use_id: string;
|
|
93
|
+
readonly content: string;
|
|
94
|
+
};
|
|
95
|
+
export interface AnthropicWireMessage {
|
|
96
|
+
readonly role: "user" | "assistant";
|
|
97
|
+
readonly content: string | readonly AnthropicWireBlock[];
|
|
98
|
+
}
|
|
99
|
+
/** History → Anthropic Messages `messages` (the system prompt stays the
|
|
100
|
+
* top-level `system`, built by the adapter exactly as today). */
|
|
101
|
+
export declare function toAnthropicMessages(history: readonly HistoryMessage[], userPrompt: string): AnthropicWireMessage[];
|
|
102
|
+
export type GeminiWirePart = {
|
|
103
|
+
readonly text: string;
|
|
104
|
+
} | {
|
|
105
|
+
readonly functionCall: {
|
|
106
|
+
readonly name: string;
|
|
107
|
+
readonly args: Record<string, unknown>;
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
readonly functionResponse: {
|
|
111
|
+
readonly name: string;
|
|
112
|
+
readonly response: Record<string, unknown>;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export interface GeminiWireContent {
|
|
116
|
+
readonly role: "user" | "model";
|
|
117
|
+
readonly parts: readonly GeminiWirePart[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* History → Gemini `contents`. `cachedPrefix` (non-empty) is the system prompt
|
|
121
|
+
* when a `cachedContent` handle forbids `systemInstruction` (issue #5 R1): it is
|
|
122
|
+
* delivered in the user turn exactly like the single-turn `cachedUserTurn` —
|
|
123
|
+
* folded into the first user message's first text part as `prefix\n\ntext`.
|
|
124
|
+
*/
|
|
125
|
+
export declare function toGeminiContents(history: readonly HistoryMessage[], userPrompt: string, cachedPrefix?: string): GeminiWireContent[];
|
|
126
|
+
//# sourceMappingURL=history-mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-mapping.d.ts","sourceRoot":"","sources":["../../src/adapters/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