@parcha/agentrun-jev 0.1.0-beta.58 → 0.1.0-beta.60

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 (2) hide show
  1. package/dist/index.js +5 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -447,7 +447,9 @@ export function createJevRunner(options = {}) {
447
447
  if (hostClient === undefined && (apiKey !== undefined || provider === "openrouter") && (typeof apiKey !== "string" || apiKey.trim().length === 0))
448
448
  throw new Error("no key");
449
449
  client = hostClient ?? new TypeSafeClient({
450
- apiKey, baseURL: options.baseURL ?? (provider === "openrouter" ? OPENROUTER_BASE_URL : undefined), fetch: options.fetch,
450
+ apiKey, baseURL: options.baseURL ?? (provider === "openrouter" ? OPENROUTER_BASE_URL : undefined),
451
+ // A host's fetch is used as given. Without one, a request that carries the key never follows a redirect.
452
+ fetch: options.fetch ?? ((input, init) => fetch(input, { ...init, redirect: "error" })),
451
453
  defaultModel: model, retry: { maxRetries: 0 }, timeout: timeoutMs ?? undefined, logLevel: "off",
452
454
  // Bodies go as they always have: uncompressed JSON, which a host's own fetch, a gateway and OpenRouter all read.
453
455
  compression: false,
@@ -625,6 +627,8 @@ function jevErrorCode(error, timedOut, cancelled) {
625
627
  return "outcome_unknown";
626
628
  if (error.status === 401 || error.status === 403)
627
629
  return "auth";
630
+ if (error.status === 402)
631
+ return "payment_required";
628
632
  if (error.status === 429)
629
633
  return "rate_limited";
630
634
  if (error.status === 400 || error.status === 422)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-jev",
3
- "version": "0.1.0-beta.58",
3
+ "version": "0.1.0-beta.60",
4
4
  "description": "Optional Jev system one decisions for AgentRun workflows",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -27,7 +27,7 @@
27
27
  "test": "node --test test/*.test.mjs"
28
28
  },
29
29
  "dependencies": {
30
- "@parcha/agentrun-dsl": "0.1.0-beta.58",
30
+ "@parcha/agentrun-dsl": "0.1.0-beta.60",
31
31
  "@typesafe-ai/sdk": "0.7.0"
32
32
  },
33
33
  "repository": {