pullfrog 0.1.105 → 0.1.107
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/cli.mjs +1092 -886
- package/dist/index.js +4563 -4364
- package/dist/internal/index.d.ts +4 -2
- package/dist/internal.js +2287 -73
- package/dist/mcp/server.d.ts +2 -0
- package/dist/models.d.ts +34 -10
- package/dist/modes.d.ts +5 -1
- package/dist/utils/isPullfrog.d.ts +13 -1
- package/dist/utils/openCodeModels.d.ts +9 -0
- package/dist/utils/outstandingThreads.d.ts +2 -0
- package/dist/utils/publishedCatalogs.d.ts +50 -0
- package/dist/utils/runContext.d.ts +10 -1
- package/dist/utils/runContextData.d.ts +1 -1
- package/dist/utils/runErrorRenderer.d.ts +2 -0
- package/dist/utils/setup.d.ts +4 -0
- package/dist/utils/version.d.ts +2 -0
- package/package.json +1 -1
package/dist/mcp/server.d.ts
CHANGED
package/dist/models.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ interface ModelDef {
|
|
|
83
83
|
/** concrete models.dev specifier, e.g. "anthropic/claude-opus-4-6" */
|
|
84
84
|
resolve: string;
|
|
85
85
|
/** full models.dev specifier for the OpenRouter equivalent, e.g. "openrouter/anthropic/claude-opus-4.6" */
|
|
86
|
-
openRouterResolve?: string;
|
|
86
|
+
openRouterResolve?: string | undefined;
|
|
87
87
|
preferred?: boolean;
|
|
88
88
|
envVars?: readonly string[];
|
|
89
89
|
isFree?: boolean;
|
|
@@ -97,11 +97,15 @@ interface ModelDef {
|
|
|
97
97
|
* use as its lens-fanout subagent (e.g. claude-opus → "claude-sonnet"). */
|
|
98
98
|
subagentModel?: string;
|
|
99
99
|
/** effort rungs accepted on the direct route, ascending — see ModelAlias.effort */
|
|
100
|
-
effort?: readonly string[];
|
|
100
|
+
effort?: readonly string[] | undefined;
|
|
101
101
|
/** effort rungs on the OpenRouter route when they differ — see ModelAlias.openRouterEffort */
|
|
102
|
-
openRouterEffort?: readonly string[];
|
|
102
|
+
openRouterEffort?: readonly string[] | undefined;
|
|
103
103
|
/** hide from selectable lists. does NOT affect resolution; for that use `fallback`. */
|
|
104
104
|
hidden?: boolean;
|
|
105
|
+
/** `resolve` and `openRouterResolve` are chosen by hand (a rolling `~…-latest` pointer, a `-pro`
|
|
106
|
+
* id models.dev lacks, a dated or held-back build), so the server never looks them up by
|
|
107
|
+
* models.dev's canonical id. see wiki/model-resolution.md. */
|
|
108
|
+
pinned?: boolean;
|
|
105
109
|
}
|
|
106
110
|
export interface ProviderConfig {
|
|
107
111
|
displayName: string;
|
|
@@ -113,7 +117,8 @@ export interface ProviderConfig {
|
|
|
113
117
|
managedCredentials?: readonly string[];
|
|
114
118
|
models: Record<string, ModelDef>;
|
|
115
119
|
}
|
|
116
|
-
|
|
120
|
+
/** this build's own registry. `providers` starts as this copy and `installProviders` replaces it. */
|
|
121
|
+
export declare const bundledProviders: {
|
|
117
122
|
anthropic: ProviderConfig;
|
|
118
123
|
openai: ProviderConfig;
|
|
119
124
|
google: ProviderConfig;
|
|
@@ -131,7 +136,9 @@ export declare const providers: {
|
|
|
131
136
|
openrouter: ProviderConfig;
|
|
132
137
|
vercel: ProviderConfig;
|
|
133
138
|
};
|
|
134
|
-
|
|
139
|
+
/** the registry every lookup below reads: this file's copy, until `installProviders` swaps in the server's. */
|
|
140
|
+
export declare let providers: Record<string, ProviderConfig>;
|
|
141
|
+
export type ModelProvider = keyof typeof bundledProviders;
|
|
135
142
|
export declare function parseModel(slug: string): {
|
|
136
143
|
provider: string;
|
|
137
144
|
model: string;
|
|
@@ -205,7 +212,7 @@ export declare function resolvePickModel(params: {
|
|
|
205
212
|
proxied: boolean;
|
|
206
213
|
secretNames: string[];
|
|
207
214
|
}): string | undefined;
|
|
208
|
-
export declare
|
|
215
|
+
export declare let modelAliases: ModelAlias[];
|
|
209
216
|
/**
|
|
210
217
|
* `repo.model` sentinels for the two managed auto tiers. stored verbatim in
|
|
211
218
|
* the DB (they pass the `provider/model` shape check) and resolved to a
|
|
@@ -275,7 +282,7 @@ export declare function isAutoRouted(slug: string | null | undefined): boolean;
|
|
|
275
282
|
export declare function isAutoSlug(slug: string | null | undefined): boolean;
|
|
276
283
|
export declare function autoRoutedSlug(provider: string): string;
|
|
277
284
|
/** the providers a BYOK repo can put on Auto — exactly the ones with a ladder */
|
|
278
|
-
export declare
|
|
285
|
+
export declare let ROUTED_PROVIDERS: readonly {
|
|
279
286
|
key: string;
|
|
280
287
|
displayName: string;
|
|
281
288
|
}[];
|
|
@@ -353,9 +360,20 @@ export declare function resolveModelRung(params: {
|
|
|
353
360
|
position: EffortPosition;
|
|
354
361
|
useOpenRouter: boolean;
|
|
355
362
|
}): string | undefined;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
363
|
+
/**
|
|
364
|
+
* OpenRouter target when Router or OSS funding is active and `repo.model` is null.
|
|
365
|
+
* resolved through the efficient tier's fallback chain, so if that tier's backing
|
|
366
|
+
* model is given a `fallback` (e.g. to ride out a temporary outage) the OSS/Router
|
|
367
|
+
* default follows the substitute instead of pinning the unavailable model.
|
|
368
|
+
*/
|
|
369
|
+
export declare let DEFAULT_PROXY_MODEL: string;
|
|
370
|
+
/**
|
|
371
|
+
* what a Pullfrog-funded trial run falls back to. apart from `DEFAULT_PROXY_MODEL` because the
|
|
372
|
+
* trial is capped at `TRIAL_FUNDED_USD_LIMIT` per account, so first-impression quality outranks price.
|
|
373
|
+
* see wiki/trial-model-fallback.md.
|
|
374
|
+
*/
|
|
375
|
+
export declare let TRIAL_PROXY_MODEL: string;
|
|
376
|
+
export declare let TRIAL_PROXY_DISPLAY_NAME: string;
|
|
359
377
|
/** lifetime cap, in USD, on the model usage Pullfrog funds for an account's trial runs. */
|
|
360
378
|
export declare const TRIAL_FUNDED_USD_LIMIT = 10;
|
|
361
379
|
/**
|
|
@@ -395,6 +413,12 @@ export declare const OSS_RECOMMENDED_MODEL: string;
|
|
|
395
413
|
* is a catalog, not copy.
|
|
396
414
|
*/
|
|
397
415
|
export declare function ossFundedModelNames(): string[];
|
|
416
|
+
/**
|
|
417
|
+
* Swaps in the server's copy of `providers`, so a merged registry change reaches runs at deploy
|
|
418
|
+
* rather than at the next release. A copy this build can't derive from (an alias its proxy
|
|
419
|
+
* defaults, ladders or OSS allowlist need is gone) is refused, and the bundled one stays.
|
|
420
|
+
*/
|
|
421
|
+
export declare function installProviders(next: Record<string, ProviderConfig>): void;
|
|
398
422
|
/**
|
|
399
423
|
* whether an OSS repo's stored pick is one the program funds. resolves through
|
|
400
424
|
* the fallback chain first, so `auto/*` sentinels and deprecated slugs are
|
package/dist/modes.d.ts
CHANGED
|
@@ -4,7 +4,11 @@ export interface Mode {
|
|
|
4
4
|
description: string;
|
|
5
5
|
prompt?: string | undefined;
|
|
6
6
|
}
|
|
7
|
-
export declare function computeModes(
|
|
7
|
+
export declare function computeModes(params: {
|
|
8
|
+
agentId: AgentId;
|
|
9
|
+
signedCommits?: boolean;
|
|
10
|
+
botLogin?: string;
|
|
11
|
+
}): Mode[];
|
|
8
12
|
export declare const modes: Mode[];
|
|
9
13
|
/**
|
|
10
14
|
* modes that legitimately never modify the working tree. used by the post-run
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* the App this run operates as, from run-context. set once in `main.ts` before
|
|
3
|
+
* any actor check; a customer-registered App is otherwise invisible to the
|
|
4
|
+
* gates below (auto-merge would not wait on its unresolved threads, and would
|
|
5
|
+
* read its own changes-requested review as a human block).
|
|
6
|
+
*/
|
|
7
|
+
export declare function setBotLogin(login: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* true when a GitHub login belongs to Pullfrog's production or development app,
|
|
10
|
+
* or to the App this run operates as.
|
|
3
11
|
*/
|
|
4
12
|
export declare function isPullfrog(actor: string | null | undefined): boolean;
|
|
13
|
+
/** whether `actor` is `botLogin`: GraphQL drops the `[bot]` suffix REST carries. */
|
|
14
|
+
export declare function isBotLogin(actor: string | null | undefined, botLogin: string): boolean;
|
|
15
|
+
/** the handles a mention of this run's bot can use; a custom App may have been renamed. */
|
|
16
|
+
export declare function mentionHandles(): string[];
|
|
@@ -9,6 +9,15 @@ export declare function openCodeHomeEnv(tmpdir: string): {
|
|
|
9
9
|
XDG_CACHE_HOME: string;
|
|
10
10
|
XDG_STATE_HOME: string;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Downloads opencode's model catalog into the file it reads first (`packages/core/src/models-dev.ts`),
|
|
14
|
+
* before any opencode process starts. With that file missing, opencode serves the snapshot compiled
|
|
15
|
+
* into its binary and swaps in the live catalog only if a background download lands in time, so a
|
|
16
|
+
* model released after the build fails at session start whenever the download loses (#1520).
|
|
17
|
+
*/
|
|
18
|
+
export declare function seedModelsCatalog(tmpdir: string): Promise<void>;
|
|
19
|
+
/** Why `seedModelsCatalog` failed, leaving opencode on its build-time snapshot. */
|
|
20
|
+
export declare function getModelsCatalogFailure(): string | undefined;
|
|
12
21
|
/**
|
|
13
22
|
* Why the last `opencode models` came back empty, in opencode's own words.
|
|
14
23
|
*
|
|
@@ -7,6 +7,8 @@ export type OutstandingThreadsCtx = {
|
|
|
7
7
|
owner: string;
|
|
8
8
|
name: string;
|
|
9
9
|
};
|
|
10
|
+
/** the server's, which knows the owner's own App bot; a run's `isPullfrog` already does. */
|
|
11
|
+
isPullfrog?: (login: string | null | undefined) => boolean;
|
|
10
12
|
};
|
|
11
13
|
/**
|
|
12
14
|
* count unresolved review threads on a PR whose root comment was authored by
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ProviderConfig } from "../models.ts";
|
|
2
|
+
type ReasoningOptions = {
|
|
3
|
+
type: string;
|
|
4
|
+
values?: string[];
|
|
5
|
+
}[] | undefined;
|
|
6
|
+
export type ModelsDevCatalog = Record<string, {
|
|
7
|
+
models: Record<string, {
|
|
8
|
+
canonical_model_id?: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
reasoning_options?: ReasoningOptions;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
13
|
+
export interface PublishedCatalogs {
|
|
14
|
+
/** `https://models.dev/api.json` */
|
|
15
|
+
modelsDev: ModelsDevCatalog;
|
|
16
|
+
/** `https://ai-gateway.vercel.sh/v1/models`, whose ladders outrank models.dev's for `vercel/*` */
|
|
17
|
+
gateway: {
|
|
18
|
+
data: {
|
|
19
|
+
id: string;
|
|
20
|
+
reasoning_options?: ReasoningOptions;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
/** the ids each route's own API lists: Zen, Go, OpenRouter and the Vercel gateway */
|
|
24
|
+
served: Record<RouteProvider, ReadonlySet<string>>;
|
|
25
|
+
}
|
|
26
|
+
/** every catalog `applyPublishedCatalogs` reads, fetched together; rejects when any one fails */
|
|
27
|
+
export declare function fetchPublishedCatalogs(signal: AbortSignal): Promise<PublishedCatalogs>;
|
|
28
|
+
/** the providers that re-host another vendor's models, so their ids can be looked up rather than kept */
|
|
29
|
+
declare const ROUTE_PROVIDERS: readonly ["opencode", "opencode-go", "openrouter", "vercel"];
|
|
30
|
+
type RouteProvider = (typeof ROUTE_PROVIDERS)[number];
|
|
31
|
+
/**
|
|
32
|
+
* models Zen LISTS in `/zen/v1/models` but will not actually serve — the endpoint answers 400
|
|
33
|
+
* `[NOT_FOUND] ... not deployed`, on both Zen tiers. Membership is not availability, so these are
|
|
34
|
+
* subtracted wherever a served list is read. Hand-kept, since only a call to the model can tell: add
|
|
35
|
+
* one when `models-live` catches it, and delete it once the model completes a run again.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ZEN_UNDEPLOYED: readonly string[];
|
|
38
|
+
type Ctx = {
|
|
39
|
+
catalogs: PublishedCatalogs;
|
|
40
|
+
providers: Record<string, ProviderConfig>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The registry as the published catalogs describe it today. A route copy of a vendor model takes
|
|
44
|
+
* the one id its route serves under that model's canonical id, `openRouterResolve` likewise; each
|
|
45
|
+
* route's effort ladder is the one it publishes; and a dead free Zen model falls back to Big
|
|
46
|
+
* Pickle. Whatever the catalogs can't settle unambiguously keeps the value written in
|
|
47
|
+
* `action/models.ts`, as does every `pinned` entry's id. See wiki/model-resolution.md.
|
|
48
|
+
*/
|
|
49
|
+
export declare function applyPublishedCatalogs(params: Ctx): Record<string, ProviderConfig>;
|
|
50
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PushPermission, ShellPermission } from "../external.ts";
|
|
2
|
-
import type { RouterTier } from "../models.ts";
|
|
2
|
+
import type { ProviderConfig, RouterTier } from "../models.ts";
|
|
3
3
|
import type { CommercialRefusal } from "./billingErrors.ts";
|
|
4
4
|
import type { RepoContext } from "./github.ts";
|
|
5
5
|
import type { CredentialAccess } from "./subscriptionCredentials.ts";
|
|
@@ -45,6 +45,8 @@ export interface RepoSettings {
|
|
|
45
45
|
codexAgent: boolean;
|
|
46
46
|
signedCommits: boolean;
|
|
47
47
|
repoIntelligence: boolean;
|
|
48
|
+
botLogin: string;
|
|
49
|
+
botUserId: string;
|
|
48
50
|
progressComments: boolean;
|
|
49
51
|
statusChecks: boolean;
|
|
50
52
|
approvalCheck: boolean;
|
|
@@ -103,6 +105,13 @@ export interface RunContext {
|
|
|
103
105
|
/** the trial account's remaining funded credits, in USD, when it is inside its
|
|
104
106
|
* trial at all. zero or below means the credits are used up. */
|
|
105
107
|
trialCreditsLeftUsd?: number | undefined;
|
|
108
|
+
/** the deployed server's alias registry, which replaces the one bundled into this build. */
|
|
109
|
+
modelRegistry?: ModelRegistry | undefined;
|
|
110
|
+
}
|
|
111
|
+
export interface ModelRegistry {
|
|
112
|
+
providers: Record<string, ProviderConfig>;
|
|
113
|
+
/** the harness CLIs the server's registry was written against. see `getHarnessPins`. */
|
|
114
|
+
harnessPins: Record<string, string>;
|
|
106
115
|
}
|
|
107
116
|
/**
|
|
108
117
|
* fetch run context from Pullfrog API
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Octokit } from "@octokit/rest";
|
|
2
|
-
import type
|
|
2
|
+
import { type RouterTier } from "../models.ts";
|
|
3
3
|
import type { CommercialRefusal } from "./billingErrors.ts";
|
|
4
4
|
import { type OctokitWithPlugins } from "./github.ts";
|
|
5
5
|
import { type AccountPlan, type RepoSettings } from "./runContext.ts";
|
|
@@ -77,6 +77,8 @@ type RenderRunErrorInput = {
|
|
|
77
77
|
credential?: AgentCredential | undefined;
|
|
78
78
|
/** the run was served by the account's free trial credits. */
|
|
79
79
|
trial?: boolean | undefined;
|
|
80
|
+
/** why opencode's live model catalog could not be downloaded, leaving it on its build-time snapshot. */
|
|
81
|
+
modelsCatalogFailure?: string | undefined;
|
|
80
82
|
};
|
|
81
83
|
export declare function renderRunError(input: RenderRunErrorInput): RenderedRunError;
|
|
82
84
|
export {};
|
package/dist/utils/setup.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare function createTempDirectory(): {
|
|
|
14
14
|
path: string;
|
|
15
15
|
[Symbol.dispose]: () => void;
|
|
16
16
|
};
|
|
17
|
+
/** the `post:` hook's half of `createTempDirectory`: removes the directory a cancelled run left. */
|
|
18
|
+
export declare function removeAbandonedTempDirectory(): void;
|
|
17
19
|
/**
|
|
18
20
|
* snapshot-and-delete the GHA runner's known credential leak surfaces inside
|
|
19
21
|
* `$RUNNER_TEMP` before the agent spawns. without this, a shell-capable agent
|
|
@@ -72,6 +74,8 @@ export interface GitContext {
|
|
|
72
74
|
toolState: ToolState;
|
|
73
75
|
shell: ShellPermission;
|
|
74
76
|
postCheckoutScript: string | null;
|
|
77
|
+
botLogin: string;
|
|
78
|
+
botUserId: string;
|
|
75
79
|
}
|
|
76
80
|
export type SetupGitParams = GitContext;
|
|
77
81
|
/** GitContext plus an explicit working-tree directory (primary cwd or a
|
package/dist/utils/version.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import packageJson from "../package.json";
|
|
2
2
|
export declare function getDevDependencyVersion(name: keyof typeof packageJson.devDependencies): string;
|
|
3
|
+
/** the CLIs the harnesses install. a model registry is written against these, so a served one applies only where they match. */
|
|
4
|
+
export declare function getHarnessPins(): Record<string, string>;
|