@parcha/agentrun-decisions 0.1.0-beta.59 → 0.1.0-beta.61

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
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.1.0-beta.60 (2026-11-26)
6
+
7
+ - OpenRouter, Anthropic and Parallel now map a 402 (the account is out of credit) to `payment_required`, as Jev does. It was `http`. A workflow decision on an out-of-credit account is now booked at $0, and serve's run cost says $0, where it booked the hold. <!-- changes/decisions-payment-required.md -->
8
+ - dsl: in a map with `onItemFailure: "collect"`, a decision that answers `payment_required` now fails the run, as `auth` does, since every item would get the same 402. Before, a 402 was `http`, so each item failed on its own, booked at its hold, and the map went on.
9
+
5
10
  ## 0.1.0-beta.59 (2026-11-25)
6
11
 
7
12
  - `anthropicProvider()`: a prompted Claude model (Haiku 5.5 by default, through `ANTHROPIC_BASE_URL`) as a `DecisionProvider`, answering noul and choice questions held to a JSON schema, at Anthropic's published price (`ANTHROPIC_PUBLISHED_PRICING`). It is the control arm for the web classifier step in `@parcha/agentrun-web`: `WebConfig.decider` (`deciderFrom(provider, { price })`) sifts each search's results and judges each fetched part in passages before the model reads them, each request held to the run's cap. Without a decider, every answer and receipt is byte-identical to a web with no step. <!-- changes/web-classifier-step.md -->
package/dist/anthropic.js CHANGED
@@ -189,6 +189,8 @@ export function anthropicProvider(options = {}) {
189
189
  const details = { status, attempts: attempt };
190
190
  if (status === 401 || status === 403)
191
191
  throw new DecisionProviderError("auth", `Anthropic refused the key (HTTP ${status}).`, details);
192
+ if (status === 402)
193
+ throw new DecisionProviderError("payment_required", `Anthropic refused the key's account: it is out of credit (HTTP 402).`, details);
192
194
  if (status === 400 || status === 404 || status === 413 || status === 422)
193
195
  throw new DecisionProviderError("invalid_request", `Anthropic refused the request (HTTP ${status}).`, details);
194
196
  if (status === 429)
@@ -312,6 +312,8 @@ export function openrouterProvider(options = {}) {
312
312
  const details = { status, attempts: attempt };
313
313
  if (status === 401 || status === 403)
314
314
  throw new DecisionProviderError("auth", `OpenRouter refused the key (HTTP ${status}).`, details);
315
+ if (status === 402)
316
+ throw new DecisionProviderError("payment_required", `OpenRouter refused the key's account: it is out of credit (HTTP 402).`, details);
315
317
  if (status === 400 || status === 404 || status === 422)
316
318
  throw new DecisionProviderError("invalid_request", `OpenRouter refused the request (HTTP ${status}).`, details);
317
319
  if (status === 429)
package/dist/parallel.js CHANGED
@@ -198,6 +198,8 @@ export function parallelProvider(options = {}) {
198
198
  const details = { status, attempts: attempt, ...(refId !== undefined ? { refId } : {}) };
199
199
  if (status === 401 || status === 403)
200
200
  throw new DecisionProviderError("auth", `Parallel refused the key (HTTP ${status}).`, details);
201
+ if (status === 402)
202
+ throw new DecisionProviderError("payment_required", `Parallel refused the key's account: it is out of credit (HTTP 402).`, details);
201
203
  if (status === 400 || status === 422)
202
204
  throw new DecisionProviderError("invalid_request", `Parallel refused the request (HTTP ${status}).`, details);
203
205
  if (status === 429)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-decisions",
3
- "version": "0.1.0-beta.59",
3
+ "version": "0.1.0-beta.61",
4
4
  "description": "Third-party decision models as DecisionProviders for the AgentRun DSL: Parallel Decisions (typed questions grounded in live web evidence) and OpenRouter's Decisions models (any of them by name), behind the DSL's runJudge seam.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -44,7 +44,7 @@
44
44
  "test": "node --test --test-concurrency=8 'test/*.test.mjs'"
45
45
  },
46
46
  "dependencies": {
47
- "@parcha/agentrun-dsl": "0.1.0-beta.59"
47
+ "@parcha/agentrun-dsl": "0.1.0-beta.61"
48
48
  },
49
49
  "repository": {
50
50
  "type": "git",