@parcha/agentrun-decisions 0.1.0-beta.39 → 0.1.0-beta.41
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 +7 -0
- package/dist/openrouter.d.ts +4 -1
- package/dist/openrouter.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## 0.1.0-beta.41 (2026-11-16)
|
|
6
|
+
|
|
7
|
+
- Model requests AgentRun sends to OpenRouter carry OpenRouter's app attribution headers: `HTTP-Referer: https://github.com/Parcha-ai/agentrun`, `X-OpenRouter-Title: AgentRun` and `X-OpenRouter-Categories: cloud-agent,personal-agent`. Usage then counts toward AgentRun's page on OpenRouter (openrouter.ai/apps?url=https://github.com/Parcha-ai/agentrun), including a self-hosted server's usage on its owner's own key. Set `AGENTRUN_OPENROUTER_ATTRIBUTION=off` where AgentRun starts to send none.
|
|
8
|
+
- The headers go only where a request goes to openrouter.ai itself, which covers every harness: the model proxy (claude-agent, codex, opencode, and pi on OpenRouter's Anthropic and OpenAI models), pi's translation route (every other OpenRouter model, the free ones included), and the server's Decisions providers on OpenRouter (OpenRouter's models, and Parallel's through OpenRouter). Anthropic, OpenAI, a ChatGPT plan and a gateway at another URL never get them.
|
|
9
|
+
- The kernel's host entry (`OPENROUTER_APP`, `openRouterApp`, `openRouterAttribution`) is the one place that names the app; the server hands it to the Decisions provider.
|
|
10
|
+
- The Decisions provider's `app` option takes `categories` and sends `title` as `X-OpenRouter-Title` (OpenRouter's current name for `X-Title`).
|
|
11
|
+
|
|
5
12
|
## 0.1.0-beta.32 (2026-11-10)
|
|
6
13
|
|
|
7
14
|
- A node naming `provider: "parallel"` runs with only an OpenRouter key. With `PARALLEL_API_KEY` it uses Parallel's own API, as before; without it, it runs on Parallel's model through OpenRouter (`parallel/decisions-fast`), on the OpenRouter key the server already reads. The same evidence on both routes: its web citations (OpenRouter's `url_citation` annotations), and its cost is what OpenRouter reports. `workflows.decisions.providers` gives parallel's `route` (`"parallel"` or `"openrouter"`); the mark is `decisions/3`. With neither key, the refusal names both. OpenRouter's Decisions provider now reads any model's `url_citation` annotations as evidence (its capability is `citations`), and books a reported cost only above 0: a $0 report, from a model OpenRouter's catalog prices at 0, is an unknown cost, never $0. Upgrading: a client that validated `workflows.decisions` against `decisions/2` refuses the new `route` field.
|
package/dist/openrouter.d.ts
CHANGED
|
@@ -18,10 +18,13 @@ export interface OpenRouterOptions {
|
|
|
18
18
|
* once, through `fetch`, the first time a request carries an image; a model it does not list with image input is refused
|
|
19
19
|
* before sending. A catalog that cannot be read refuses nothing. */
|
|
20
20
|
takesImages?: (model: string) => boolean | Promise<boolean>;
|
|
21
|
-
/** Sent as OpenRouter's app attribution headers (
|
|
21
|
+
/** Sent as OpenRouter's app attribution headers when set (https://openrouter.ai/docs/app-attribution): `url` as
|
|
22
|
+
* HTTP-Referer, `title` as X-OpenRouter-Title, `categories` (at most 2 of OpenRouter's, comma separated) as
|
|
23
|
+
* X-OpenRouter-Categories. AgentRun's server hands it AgentRun's app (agentrun-kernel host/openrouter-attribution.ts). */
|
|
22
24
|
app?: {
|
|
23
25
|
url?: string;
|
|
24
26
|
title?: string;
|
|
27
|
+
categories?: string;
|
|
25
28
|
};
|
|
26
29
|
/** Whether a citation keeps its passage (default true); false keeps none, whatever the model sent. */
|
|
27
30
|
includeExcerpts?: boolean;
|
package/dist/openrouter.js
CHANGED
|
@@ -260,7 +260,7 @@ export function openrouterProvider(options = {}) {
|
|
|
260
260
|
const payload = { state, model, questions: request.questions };
|
|
261
261
|
// Sent and lost: it may have been answered and billed, so it is never sent again, at an unknown cost.
|
|
262
262
|
const lost = (attempts, what, status) => new DecisionProviderError("outcome_unknown", `OpenRouter ${what} after the request was sent; it may have been answered, and is not sent again.`, { attempts, ...(status !== undefined ? { status } : {}), costUsd: null, costBasis: "unknown" });
|
|
263
|
-
const app = { ...(options.app?.url ? { "HTTP-Referer": options.app.url } : {}), ...(options.app?.title ? { "X-Title": options.app.title } : {}) };
|
|
263
|
+
const app = { ...(options.app?.url ? { "HTTP-Referer": options.app.url } : {}), ...(options.app?.title ? { "X-OpenRouter-Title": options.app.title } : {}), ...(options.app?.categories ? { "X-OpenRouter-Categories": options.app.categories } : {}) };
|
|
264
264
|
for (let attempt = 1;; attempt++) {
|
|
265
265
|
// A form body is read as it is sent, so each attempt builds its own.
|
|
266
266
|
const { body, headers } = bodyOf(payload, images);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcha/agentrun-decisions",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.41",
|
|
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.
|
|
47
|
+
"@parcha/agentrun-dsl": "0.1.0-beta.41"
|
|
48
48
|
},
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|