@foldrun/core 17.1.0 → 17.1.1
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/dist/src/alerts.js +1 -1
- package/dist/src/failure.js +2 -2
- package/dist/src/model-credential.js +1 -1
- package/dist/src/model-env.js +2 -2
- package/dist/src/oauth-capabilities.js +1 -1
- package/dist/src/provider-health.js +2 -2
- package/dist/src/runner.js +4 -4
- package/dist/src/scan.js +1 -1
- package/dist/src/starter.js +2 -2
- package/dist/src/store.d.ts +3 -3
- package/dist/src/store.js +3 -3
- package/package.json +1 -1
- package/src/alerts.ts +1 -1
- package/src/failure.ts +2 -2
- package/src/model-credential.ts +1 -1
- package/src/model-env.ts +2 -2
- package/src/oauth-capabilities.ts +1 -1
- package/src/provider-health.ts +2 -2
- package/src/runner.ts +4 -4
- package/src/scan.ts +1 -1
- package/src/starter.ts +2 -2
- package/src/store.ts +4 -4
package/dist/src/alerts.js
CHANGED
|
@@ -136,7 +136,7 @@ export function evaluateAlerts(cfg, facts, workspace, now) {
|
|
|
136
136
|
key: `runs_per_hour/${flow}`,
|
|
137
137
|
flow,
|
|
138
138
|
headline: `${workspace}: ${flow} started ${n} times in an hour`,
|
|
139
|
-
detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Pause stops it now.`,
|
|
139
|
+
detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Policies → Pause runs stops it now.`,
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
}
|
package/dist/src/failure.js
CHANGED
|
@@ -102,7 +102,7 @@ export function failureFactsOf(step) {
|
|
|
102
102
|
};
|
|
103
103
|
return Object.keys(facts).length ? facts : undefined;
|
|
104
104
|
}
|
|
105
|
-
const UPGRADE = "or a plan that allows more (
|
|
105
|
+
const UPGRADE = "or a plan that allows more (Billing)";
|
|
106
106
|
const SCOPES = {
|
|
107
107
|
"this run's": "run",
|
|
108
108
|
"this workspace's": "workspace",
|
|
@@ -140,7 +140,7 @@ function tooBig(reason) {
|
|
|
140
140
|
const what = kind === "memory" ? "GiB of memory" : pool[2];
|
|
141
141
|
const fix = scope === "run" ? "Ask for less with size: or resources: on the agent, or raise the flow's compute:."
|
|
142
142
|
: scope === "workspace" ? "Ask for less with size: or resources: on the agent, or raise the workspace's compute: (its AGENTS.md)."
|
|
143
|
-
: scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Governance), ${UPGRADE}.`
|
|
143
|
+
: scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Policies → Governance), ${UPGRADE}.`
|
|
144
144
|
: "Ask for less with size: or resources: on the agent: no machine here can hold a step this big.";
|
|
145
145
|
return {
|
|
146
146
|
class: "policy_denied",
|
|
@@ -59,7 +59,7 @@ export function credentialLine(c) {
|
|
|
59
59
|
// ---------------------------------------------------------------- the account's own key
|
|
60
60
|
//
|
|
61
61
|
// An account brings its own model key without writing a provider: block:
|
|
62
|
-
// three secrets in the ACCOUNT vault (set from Settings →
|
|
62
|
+
// three secrets in the ACCOUNT vault (set from Settings → Models, the API's
|
|
63
63
|
// /api/account/model, or `foldrun account model set`). A provider: block at any
|
|
64
64
|
// level still wins; this is what a step falls to when none names one, before
|
|
65
65
|
// the platform's own credential.
|
package/dist/src/model-env.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The model environment for work an ACCOUNT asks for outside a step: an eval's
|
|
2
2
|
// judge, the dashboard's "draft a flow with AI". Resolved the way a step
|
|
3
3
|
// resolves it — the workspace's provider: block, else the account's, else the
|
|
4
|
-
// account's own key from Settings →
|
|
4
|
+
// account's own key from Settings → Models — and only then the platform's own
|
|
5
5
|
// credential, which a hosted platform keeps for its operator's accounts
|
|
6
6
|
// (platform.platformKeyAllowed). Every other account brings an API key;
|
|
7
7
|
// asking for the platform's here is refused, not quietly billed to it.
|
|
@@ -22,7 +22,7 @@ export class ModelKeyError extends Error {
|
|
|
22
22
|
this.status = status;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const NO_MODEL_KEY = "no model key: this account runs on its own API key, and none is set — add one in Settings →
|
|
25
|
+
export const NO_MODEL_KEY = "no model key: this account runs on its own API key, and none is set — add one in Settings → Models " +
|
|
26
26
|
"(or `foldrun account model set <provider> --key …`), or write a provider: block in AGENTS.md";
|
|
27
27
|
/**
|
|
28
28
|
* `platform` is a function: the caller's own way to build the platform's env
|
|
@@ -18,7 +18,7 @@ export const OAUTH_CAPABILITIES = [
|
|
|
18
18
|
// ------------------------------------------------------------ client
|
|
19
19
|
{
|
|
20
20
|
id: "client.authorization-code-pkce", role: "client", title: "Authorization code with PKCE (S256)", spec: "RFC 6749 §4.1, RFC 7636",
|
|
21
|
-
status: "supported", note: "Settings → Connections or `foldrun connect`. PKCE is on for every connection.",
|
|
21
|
+
status: "supported", note: "Settings → Secrets → Connections or `foldrun connect`. PKCE is on for every connection.",
|
|
22
22
|
proof: [platform("tests/oauth-connect.test.ts", "PKCE: on by default"), platform(KC, "authorization code + PKCE S256 + PAR"), cli("tests/cli-connect.test.ts", "connect: PKCE by default")],
|
|
23
23
|
},
|
|
24
24
|
{
|
|
@@ -200,8 +200,8 @@ export function providersInUse(tenant) {
|
|
|
200
200
|
out.push({ spec, workspace, declaredIn, model: cheapestModel(spec) });
|
|
201
201
|
};
|
|
202
202
|
add(frontmatterOf(path.join(accountDir(tenant), "AGENTS.md")).provider, null, "account");
|
|
203
|
-
// The account's own key from Settings →
|
|
204
|
-
add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings →
|
|
203
|
+
// The account's own key from Settings → Models, which needs no block.
|
|
204
|
+
add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings → Models)");
|
|
205
205
|
for (const ws of safeList(() => listWorkspaces(tenant))) {
|
|
206
206
|
const dir = workspaceDir(tenant, ws.name);
|
|
207
207
|
add(frontmatterOf(path.join(dir, "AGENTS.md")).provider, ws.name, ws.name);
|
package/dist/src/runner.js
CHANGED
|
@@ -1209,7 +1209,7 @@ grantsOnly = false) {
|
|
|
1209
1209
|
//
|
|
1210
1210
|
// The URL sits in git; the token is a ${SECRET} resolved server-side. An
|
|
1211
1211
|
// agent's own block wins over the workspace's, like everything else here.
|
|
1212
|
-
// Then the account's own model key (Settings →
|
|
1212
|
+
// Then the account's own model key (Settings → Models), when it set one:
|
|
1213
1213
|
// an account that brings its key need not write a block anywhere.
|
|
1214
1214
|
const fileBlock = front.provider ?? workspaceFrontmatter(agentDir, tenant).provider;
|
|
1215
1215
|
// foldrun's models (3 Nov 2026): an account that chose the platform's key
|
|
@@ -2299,7 +2299,7 @@ mayDefer) {
|
|
|
2299
2299
|
// Chosen, but not to be had now: failed with why, before a sandbox —
|
|
2300
2300
|
// never onto the account's stored key or the operator's.
|
|
2301
2301
|
if (supply.kind === "refused") {
|
|
2302
|
-
push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings →
|
|
2302
|
+
push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings → Models, \`foldrun account model use own\`)`);
|
|
2303
2303
|
step.status = "failed";
|
|
2304
2304
|
save();
|
|
2305
2305
|
return;
|
|
@@ -2326,7 +2326,7 @@ mayDefer) {
|
|
|
2326
2326
|
if (!platform.platformKeyAllowed(tenant)) {
|
|
2327
2327
|
const own = Object.values(providerSecrets).concat(Object.values(providerEnv));
|
|
2328
2328
|
if (primaryOnPlatform) {
|
|
2329
|
-
push("error", `no model key: this account runs on its own API key, and none is set. Add one in Settings →
|
|
2329
|
+
push("error", `no model key: this account runs on its own API key, and none is set. Add one in Settings → Models ` +
|
|
2330
2330
|
`(or \`foldrun account model set <provider> --key …\`), or write a provider: block in AGENTS.md`);
|
|
2331
2331
|
step.status = "failed";
|
|
2332
2332
|
save();
|
|
@@ -2348,7 +2348,7 @@ mayDefer) {
|
|
|
2348
2348
|
if (noCredentialInContainer) {
|
|
2349
2349
|
push("error", "no model credential: this install has none and the account has no key of its own. Set ANTHROPIC_API_KEY " +
|
|
2350
2350
|
"(or CLAUDE_CODE_OAUTH_TOKEN from `claude setup-token`) in the platform's environment — for Docker Compose, " +
|
|
2351
|
-
"self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings →
|
|
2351
|
+
"self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings → Models " +
|
|
2352
2352
|
"(`foldrun account model set <provider> --key …`)");
|
|
2353
2353
|
step.status = "failed";
|
|
2354
2354
|
save();
|
package/dist/src/scan.js
CHANGED
|
@@ -257,7 +257,7 @@ export const SCAN_RULES = [
|
|
|
257
257
|
title: "An effort level the model this account runs on does not have",
|
|
258
258
|
help: "Each model takes its own effort levels: GPT-6 and Claude take all five, Gemini stops at high, Kimi has low, high and max. " +
|
|
259
259
|
"The step still runs, at the nearest level the model has, and the step's log says so. Write the level it has, or choose " +
|
|
260
|
-
"a provider whose model has the one you want (Settings →
|
|
260
|
+
"a provider whose model has the one you want (Settings → Models).",
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
id: "config/output-fitted",
|
package/dist/src/starter.js
CHANGED
|
@@ -40,7 +40,7 @@ foldrun_version: "0.1"
|
|
|
40
40
|
# that declares the same key replaces it *whole* — base_url and token never
|
|
41
41
|
# merge across scopes, so a provider block belongs entirely at one level.
|
|
42
42
|
#
|
|
43
|
-
# Your own model key needs no block: Settings →
|
|
43
|
+
# Your own model key needs no block: Settings → Models, or
|
|
44
44
|
# \`foldrun account model set anthropic --key …\` (an API key, not a login).
|
|
45
45
|
# On foldrun's own platform you can run on foldrun's models instead, billed
|
|
46
46
|
# in credits: \`foldrun account model use foldrun --provider anthropic\`.
|
|
@@ -393,7 +393,7 @@ and \`/api/metrics\` (Prometheus). Outside \`/api\`: \`/a2a/<account>/<ws>/flows
|
|
|
393
393
|
(a published flow's agent card and A2A 1.0 JSON-RPC endpoint — an A2A key only, \`foldrun docs a2a\`).
|
|
394
394
|
|
|
395
395
|
Every call answers — and the CLI sends — \`Foldrun-Version: YYYY-MM-DD\` (dated API
|
|
396
|
-
versions; an account pin in Settings → API), \`X-RateLimit-*\` headers (a \`429\`
|
|
396
|
+
versions; an account pin in Settings → API keys → API), \`X-RateLimit-*\` headers (a \`429\`
|
|
397
397
|
carries \`Retry-After\`), and writes that start work take an \`Idempotency-Key\`
|
|
398
398
|
(a retry with the same key replays the first answer). The whole surface as
|
|
399
399
|
OpenAPI 3.1: \`/api/openapi.json\` (open), or \`foldrun api spec --out openapi.json\`.
|
package/dist/src/store.d.ts
CHANGED
|
@@ -1257,7 +1257,7 @@ export interface StepRecord {
|
|
|
1257
1257
|
* "provider: …" — or "none set" (model-credential.ts). */
|
|
1258
1258
|
credential?: string;
|
|
1259
1259
|
/** Whose key paid for the step's model calls (3 Nov 2026): "own" — the
|
|
1260
|
-
* account's (a provider: block, Settings →
|
|
1260
|
+
* account's (a provider: block, Settings → Models), billed by its
|
|
1261
1261
|
* provider; "operator" — the platform's own credential, billed from the
|
|
1262
1262
|
* step's tokens; "foldrun" — foldrun's models, billed per call by the
|
|
1263
1263
|
* model gateway, never from the step. Absent on older records. */
|
|
@@ -1781,7 +1781,7 @@ export declare function runDisplayStatus(run: Pick<RunRecord, "status" | "stopRe
|
|
|
1781
1781
|
export declare function runCost(run: RunRecord): number;
|
|
1782
1782
|
/** Whether a step's tokens are the platform's to bill: it ran on the
|
|
1783
1783
|
* platform's own model credential, not the account's key ("provider: …" —
|
|
1784
|
-
* a provider: block, or Settings →
|
|
1784
|
+
* a provider: block, or Settings → Models), which the provider bills. The
|
|
1785
1785
|
* meter, the Usage page and the ledger split all ask this one question, so
|
|
1786
1786
|
* what a page shows is what was charged. */
|
|
1787
1787
|
export declare function stepBillsTokens(s: Pick<StepRecord, "credential" | "supply">): boolean;
|
|
@@ -1811,7 +1811,7 @@ export declare function billedTokenCost(s: {
|
|
|
1811
1811
|
*
|
|
1812
1812
|
* Tokens count only for steps that ran on the platform's own model
|
|
1813
1813
|
* credential. A step on the account's own key (`credential` "provider: …" —
|
|
1814
|
-
* a provider: block, or Settings →
|
|
1814
|
+
* a provider: block, or Settings → Models) was paid for at the provider, and
|
|
1815
1815
|
* billing it again here charged a BYOK customer twice. And a carried step's
|
|
1816
1816
|
* tokens were billed where it ran, like its compute.
|
|
1817
1817
|
*/
|
package/dist/src/store.js
CHANGED
|
@@ -2248,7 +2248,7 @@ const ACCOUNT_SEALED = {
|
|
|
2248
2248
|
"oauth-clients.json": "OAuth client credentials — never served to a browser.",
|
|
2249
2249
|
"ledger.jsonl": "the billing ledger — append-only, read it through Usage and Wallet.",
|
|
2250
2250
|
"billing.json": "the account's billing settings — read and change them in Wallet.",
|
|
2251
|
-
"oauth-connections.json": "connected apps and their health — see Settings → Connections.",
|
|
2251
|
+
"oauth-connections.json": "connected apps and their health — see Settings → Secrets → Connections.",
|
|
2252
2252
|
"secret-health.json": "secret usage bookkeeping — see Settings → Secrets.",
|
|
2253
2253
|
};
|
|
2254
2254
|
export function accountFileSealed(rel) {
|
|
@@ -3319,7 +3319,7 @@ export function runCost(run) {
|
|
|
3319
3319
|
}
|
|
3320
3320
|
/** Whether a step's tokens are the platform's to bill: it ran on the
|
|
3321
3321
|
* platform's own model credential, not the account's key ("provider: …" —
|
|
3322
|
-
* a provider: block, or Settings →
|
|
3322
|
+
* a provider: block, or Settings → Models), which the provider bills. The
|
|
3323
3323
|
* meter, the Usage page and the ledger split all ask this one question, so
|
|
3324
3324
|
* what a page shows is what was charged. */
|
|
3325
3325
|
export function stepBillsTokens(s) {
|
|
@@ -3356,7 +3356,7 @@ export function billedTokenCost(s) {
|
|
|
3356
3356
|
*
|
|
3357
3357
|
* Tokens count only for steps that ran on the platform's own model
|
|
3358
3358
|
* credential. A step on the account's own key (`credential` "provider: …" —
|
|
3359
|
-
* a provider: block, or Settings →
|
|
3359
|
+
* a provider: block, or Settings → Models) was paid for at the provider, and
|
|
3360
3360
|
* billing it again here charged a BYOK customer twice. And a carried step's
|
|
3361
3361
|
* tokens were billed where it ran, like its compute.
|
|
3362
3362
|
*/
|
package/package.json
CHANGED
package/src/alerts.ts
CHANGED
|
@@ -167,7 +167,7 @@ export function evaluateAlerts(cfg: AlertConfig, facts: AlertFacts, workspace: s
|
|
|
167
167
|
key: `runs_per_hour/${flow}`,
|
|
168
168
|
flow,
|
|
169
169
|
headline: `${workspace}: ${flow} started ${n} times in an hour`,
|
|
170
|
-
detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Pause stops it now.`,
|
|
170
|
+
detail: `Past the ${cfg.runsPerHour} in alerts: runs_per_hour — a loop, a webhook sender retrying, or a schedule written wrong. Its Triggers page shows what started each; throttle: or debounce: caps it, and Settings → Policies → Pause runs stops it now.`,
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
}
|
package/src/failure.ts
CHANGED
|
@@ -160,7 +160,7 @@ export function failureFactsOf(step: FailedStepLike): FailureFacts | undefined {
|
|
|
160
160
|
return Object.keys(facts).length ? facts : undefined;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
const UPGRADE = "or a plan that allows more (
|
|
163
|
+
const UPGRADE = "or a plan that allows more (Billing)";
|
|
164
164
|
|
|
165
165
|
const SCOPES: Record<string, LimitScope> = {
|
|
166
166
|
"this run's": "run",
|
|
@@ -201,7 +201,7 @@ function tooBig(reason: string): FailureExplained | null {
|
|
|
201
201
|
const fix =
|
|
202
202
|
scope === "run" ? "Ask for less with size: or resources: on the agent, or raise the flow's compute:."
|
|
203
203
|
: scope === "workspace" ? "Ask for less with size: or resources: on the agent, or raise the workspace's compute: (its AGENTS.md)."
|
|
204
|
-
: scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Governance), ${UPGRADE}.`
|
|
204
|
+
: scope === "account" ? `Ask for less with size: or resources: on the agent, raise the account's compute: (Settings → Policies → Governance), ${UPGRADE}.`
|
|
205
205
|
: "Ask for less with size: or resources: on the agent: no machine here can hold a step this big.";
|
|
206
206
|
return {
|
|
207
207
|
class: "policy_denied",
|
package/src/model-credential.ts
CHANGED
|
@@ -74,7 +74,7 @@ export function credentialLine(c: ModelCredential): { type: "info" | "error"; te
|
|
|
74
74
|
// ---------------------------------------------------------------- the account's own key
|
|
75
75
|
//
|
|
76
76
|
// An account brings its own model key without writing a provider: block:
|
|
77
|
-
// three secrets in the ACCOUNT vault (set from Settings →
|
|
77
|
+
// three secrets in the ACCOUNT vault (set from Settings → Models, the API's
|
|
78
78
|
// /api/account/model, or `foldrun account model set`). A provider: block at any
|
|
79
79
|
// level still wins; this is what a step falls to when none names one, before
|
|
80
80
|
// the platform's own credential.
|
package/src/model-env.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The model environment for work an ACCOUNT asks for outside a step: an eval's
|
|
2
2
|
// judge, the dashboard's "draft a flow with AI". Resolved the way a step
|
|
3
3
|
// resolves it — the workspace's provider: block, else the account's, else the
|
|
4
|
-
// account's own key from Settings →
|
|
4
|
+
// account's own key from Settings → Models — and only then the platform's own
|
|
5
5
|
// credential, which a hosted platform keeps for its operator's accounts
|
|
6
6
|
// (platform.platformKeyAllowed). Every other account brings an API key;
|
|
7
7
|
// asking for the platform's here is refused, not quietly billed to it.
|
|
@@ -26,7 +26,7 @@ export class ModelKeyError extends Error {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const NO_MODEL_KEY =
|
|
29
|
-
"no model key: this account runs on its own API key, and none is set — add one in Settings →
|
|
29
|
+
"no model key: this account runs on its own API key, and none is set — add one in Settings → Models " +
|
|
30
30
|
"(or `foldrun account model set <provider> --key …`), or write a provider: block in AGENTS.md";
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -44,7 +44,7 @@ export const OAUTH_CAPABILITIES: OAuthCapability[] = [
|
|
|
44
44
|
// ------------------------------------------------------------ client
|
|
45
45
|
{
|
|
46
46
|
id: "client.authorization-code-pkce", role: "client", title: "Authorization code with PKCE (S256)", spec: "RFC 6749 §4.1, RFC 7636",
|
|
47
|
-
status: "supported", note: "Settings → Connections or `foldrun connect`. PKCE is on for every connection.",
|
|
47
|
+
status: "supported", note: "Settings → Secrets → Connections or `foldrun connect`. PKCE is on for every connection.",
|
|
48
48
|
proof: [platform("tests/oauth-connect.test.ts", "PKCE: on by default"), platform(KC, "authorization code + PKCE S256 + PAR"), cli("tests/cli-connect.test.ts", "connect: PKCE by default")],
|
|
49
49
|
},
|
|
50
50
|
{
|
package/src/provider-health.ts
CHANGED
|
@@ -237,8 +237,8 @@ export function providersInUse(tenant: string): ProviderInUse[] {
|
|
|
237
237
|
};
|
|
238
238
|
|
|
239
239
|
add(frontmatterOf(path.join(accountDir(tenant), "AGENTS.md")).provider, null, "account");
|
|
240
|
-
// The account's own key from Settings →
|
|
241
|
-
add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings →
|
|
240
|
+
// The account's own key from Settings → Models, which needs no block.
|
|
241
|
+
add(accountModelBlock((name) => getSecret(tenant, name)?.value ?? null), null, "account (Settings → Models)");
|
|
242
242
|
for (const ws of safeList(() => listWorkspaces(tenant))) {
|
|
243
243
|
const dir = workspaceDir(tenant, ws.name);
|
|
244
244
|
add(frontmatterOf(path.join(dir, "AGENTS.md")).provider, ws.name, ws.name);
|
package/src/runner.ts
CHANGED
|
@@ -1352,7 +1352,7 @@ export function agentContext(
|
|
|
1352
1352
|
//
|
|
1353
1353
|
// The URL sits in git; the token is a ${SECRET} resolved server-side. An
|
|
1354
1354
|
// agent's own block wins over the workspace's, like everything else here.
|
|
1355
|
-
// Then the account's own model key (Settings →
|
|
1355
|
+
// Then the account's own model key (Settings → Models), when it set one:
|
|
1356
1356
|
// an account that brings its key need not write a block anywhere.
|
|
1357
1357
|
const fileBlock =
|
|
1358
1358
|
(front.provider as Record<string, unknown> | undefined) ?? workspaceFrontmatter(agentDir, tenant).provider;
|
|
@@ -2493,7 +2493,7 @@ async function runStep(
|
|
|
2493
2493
|
// Chosen, but not to be had now: failed with why, before a sandbox —
|
|
2494
2494
|
// never onto the account's stored key or the operator's.
|
|
2495
2495
|
if (supply.kind === "refused") {
|
|
2496
|
-
push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings →
|
|
2496
|
+
push("error", `foldrun's models: ${supply.reason} — or switch this account back to its own key (Settings → Models, \`foldrun account model use own\`)`);
|
|
2497
2497
|
step.status = "failed";
|
|
2498
2498
|
save();
|
|
2499
2499
|
return;
|
|
@@ -2522,7 +2522,7 @@ async function runStep(
|
|
|
2522
2522
|
if (primaryOnPlatform) {
|
|
2523
2523
|
push(
|
|
2524
2524
|
"error",
|
|
2525
|
-
`no model key: this account runs on its own API key, and none is set. Add one in Settings →
|
|
2525
|
+
`no model key: this account runs on its own API key, and none is set. Add one in Settings → Models ` +
|
|
2526
2526
|
`(or \`foldrun account model set <provider> --key …\`), or write a provider: block in AGENTS.md`,
|
|
2527
2527
|
);
|
|
2528
2528
|
step.status = "failed";
|
|
@@ -2547,7 +2547,7 @@ async function runStep(
|
|
|
2547
2547
|
"error",
|
|
2548
2548
|
"no model credential: this install has none and the account has no key of its own. Set ANTHROPIC_API_KEY " +
|
|
2549
2549
|
"(or CLAUDE_CODE_OAUTH_TOKEN from `claude setup-token`) in the platform's environment — for Docker Compose, " +
|
|
2550
|
-
"self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings →
|
|
2550
|
+
"self-hosting/.env, then `docker compose up -d` — or add the account's key in Settings → Models " +
|
|
2551
2551
|
"(`foldrun account model set <provider> --key …`)",
|
|
2552
2552
|
);
|
|
2553
2553
|
step.status = "failed";
|
package/src/scan.ts
CHANGED
|
@@ -340,7 +340,7 @@ export const SCAN_RULES: readonly ScanRule[] = [
|
|
|
340
340
|
help:
|
|
341
341
|
"Each model takes its own effort levels: GPT-6 and Claude take all five, Gemini stops at high, Kimi has low, high and max. " +
|
|
342
342
|
"The step still runs, at the nearest level the model has, and the step's log says so. Write the level it has, or choose " +
|
|
343
|
-
"a provider whose model has the one you want (Settings →
|
|
343
|
+
"a provider whose model has the one you want (Settings → Models).",
|
|
344
344
|
},
|
|
345
345
|
{
|
|
346
346
|
id: "config/output-fitted",
|
package/src/starter.ts
CHANGED
|
@@ -47,7 +47,7 @@ foldrun_version: "0.1"
|
|
|
47
47
|
# that declares the same key replaces it *whole* — base_url and token never
|
|
48
48
|
# merge across scopes, so a provider block belongs entirely at one level.
|
|
49
49
|
#
|
|
50
|
-
# Your own model key needs no block: Settings →
|
|
50
|
+
# Your own model key needs no block: Settings → Models, or
|
|
51
51
|
# \`foldrun account model set anthropic --key …\` (an API key, not a login).
|
|
52
52
|
# On foldrun's own platform you can run on foldrun's models instead, billed
|
|
53
53
|
# in credits: \`foldrun account model use foldrun --provider anthropic\`.
|
|
@@ -409,7 +409,7 @@ and \`/api/metrics\` (Prometheus). Outside \`/api\`: \`/a2a/<account>/<ws>/flows
|
|
|
409
409
|
(a published flow's agent card and A2A 1.0 JSON-RPC endpoint — an A2A key only, \`foldrun docs a2a\`).
|
|
410
410
|
|
|
411
411
|
Every call answers — and the CLI sends — \`Foldrun-Version: YYYY-MM-DD\` (dated API
|
|
412
|
-
versions; an account pin in Settings → API), \`X-RateLimit-*\` headers (a \`429\`
|
|
412
|
+
versions; an account pin in Settings → API keys → API), \`X-RateLimit-*\` headers (a \`429\`
|
|
413
413
|
carries \`Retry-After\`), and writes that start work take an \`Idempotency-Key\`
|
|
414
414
|
(a retry with the same key replays the first answer). The whole surface as
|
|
415
415
|
OpenAPI 3.1: \`/api/openapi.json\` (open), or \`foldrun api spec --out openapi.json\`.
|
package/src/store.ts
CHANGED
|
@@ -2761,7 +2761,7 @@ const ACCOUNT_SEALED: Record<string, string> = {
|
|
|
2761
2761
|
"oauth-clients.json": "OAuth client credentials — never served to a browser.",
|
|
2762
2762
|
"ledger.jsonl": "the billing ledger — append-only, read it through Usage and Wallet.",
|
|
2763
2763
|
"billing.json": "the account's billing settings — read and change them in Wallet.",
|
|
2764
|
-
"oauth-connections.json": "connected apps and their health — see Settings → Connections.",
|
|
2764
|
+
"oauth-connections.json": "connected apps and their health — see Settings → Secrets → Connections.",
|
|
2765
2765
|
"secret-health.json": "secret usage bookkeeping — see Settings → Secrets.",
|
|
2766
2766
|
};
|
|
2767
2767
|
|
|
@@ -3616,7 +3616,7 @@ export interface StepRecord {
|
|
|
3616
3616
|
* "provider: …" — or "none set" (model-credential.ts). */
|
|
3617
3617
|
credential?: string;
|
|
3618
3618
|
/** Whose key paid for the step's model calls (3 Nov 2026): "own" — the
|
|
3619
|
-
* account's (a provider: block, Settings →
|
|
3619
|
+
* account's (a provider: block, Settings → Models), billed by its
|
|
3620
3620
|
* provider; "operator" — the platform's own credential, billed from the
|
|
3621
3621
|
* step's tokens; "foldrun" — foldrun's models, billed per call by the
|
|
3622
3622
|
* model gateway, never from the step. Absent on older records. */
|
|
@@ -4502,7 +4502,7 @@ export function runCost(run: RunRecord): number {
|
|
|
4502
4502
|
|
|
4503
4503
|
/** Whether a step's tokens are the platform's to bill: it ran on the
|
|
4504
4504
|
* platform's own model credential, not the account's key ("provider: …" —
|
|
4505
|
-
* a provider: block, or Settings →
|
|
4505
|
+
* a provider: block, or Settings → Models), which the provider bills. The
|
|
4506
4506
|
* meter, the Usage page and the ledger split all ask this one question, so
|
|
4507
4507
|
* what a page shows is what was charged. */
|
|
4508
4508
|
export function stepBillsTokens(s: Pick<StepRecord, "credential" | "supply">): boolean {
|
|
@@ -4542,7 +4542,7 @@ export function billedTokenCost(s: { credential?: string; supply?: StepSupply; c
|
|
|
4542
4542
|
*
|
|
4543
4543
|
* Tokens count only for steps that ran on the platform's own model
|
|
4544
4544
|
* credential. A step on the account's own key (`credential` "provider: …" —
|
|
4545
|
-
* a provider: block, or Settings →
|
|
4545
|
+
* a provider: block, or Settings → Models) was paid for at the provider, and
|
|
4546
4546
|
* billing it again here charged a BYOK customer twice. And a carried step's
|
|
4547
4547
|
* tokens were billed where it ran, like its compute.
|
|
4548
4548
|
*/
|