pullfrog 0.1.47 → 0.1.49

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.
@@ -0,0 +1,80 @@
1
+ /**
2
+ * reasoning effort, stored as a POSITION rather than a name.
3
+ *
4
+ * a rung name is only meaningful inside the model that published it: `high` is
5
+ * DeepSeek's floor and Opus's midpoint, and a model is free to call its rungs
6
+ * anything at all. so a stored name is untransferable the moment the model
7
+ * changes underneath the setting — which happens without anyone editing it (the
8
+ * org default cascades, the Router clamps by card status, an `auto/*` tier
9
+ * resolves to a concrete model, a `--model=` flag overrides per run, and the
10
+ * models-bump cron can rewrite a ladder under a stored value).
11
+ *
12
+ * a position on [0, 1] has no such problem: 0 is whatever that model calls its
13
+ * cheapest rung and 1 is whatever it calls its most expensive. resolution is a
14
+ * lookup into the model's own published ladder, so the result is always a rung
15
+ * that model actually offers. an invalid effort is unrepresentable rather than
16
+ * merely guarded against.
17
+ *
18
+ * neither harness needs us to know a provider's wire format: claude-code takes
19
+ * `--effort <level>` and opencode takes `--variant <level>`, and each owns the
20
+ * per-model, per-transport translation upstream.
21
+ */
22
+ /** a point on the effort axis. 0 = the model's cheapest rung, 1 = its most expensive. */
23
+ export type EffortPosition = number;
24
+ /**
25
+ * where a repo sits when it has never configured effort.
26
+ *
27
+ * 0.5 is not a round number picked for feel — it is EXACTLY the position `high`
28
+ * occupies on a five-rung ladder (`2/4`), so the default and a user clicking
29
+ * **High** in the console store the same value. It lands on `high` for the
30
+ * Claude and GPT flagships, Kimi K3 and DeepSeek, and `medium` on a three-rung
31
+ * ladder. That keeps the flagships at the level every model already effectively
32
+ * ran at before this setting existed.
33
+ */
34
+ export declare const DEFAULT_EFFORT_POSITION: EffortPosition;
35
+ /**
36
+ * names we accept on user-facing surfaces (`--effort=`, the action input),
37
+ * mapped to fixed points on the axis. these are a typing convenience, NOT an
38
+ * ordering authority — a model's own ladder decides what each point resolves to.
39
+ * a 5-rung ladder lands each of these on its own rung; a shorter one folds them
40
+ * together, which is the correct behaviour rather than a lossy one.
41
+ */
42
+ export declare const EFFORT_ALIASES: Readonly<Record<string, EffortPosition>>;
43
+ export declare function isEffortPosition(value: number): boolean;
44
+ /**
45
+ * parse a user-supplied effort into a position. accepts a name (`high`, `MED`)
46
+ * or a bare number (`0.75`). returns undefined for anything else, so a typo
47
+ * stays visible in the prose instead of silently becoming a level.
48
+ */
49
+ export declare function parseEffortPosition(raw: string): EffortPosition | undefined;
50
+ /**
51
+ * the rungs a model offers a user: its published ladder minus the ones that turn
52
+ * reasoning off. order is the publisher's, already ascending — we never reorder
53
+ * it, because the array IS the scale.
54
+ */
55
+ export declare function offeredRungs(published: readonly string[]): readonly string[];
56
+ /**
57
+ * land a position on a model's ladder. the result is always a rung the model
58
+ * published, or undefined when it publishes none — there is no arithmetic here
59
+ * that can produce a name the model doesn't have.
60
+ *
61
+ * a position between two rungs ALWAYS rounds DOWN, so it never costs more than
62
+ * was asked for. a rung's own position lands back on itself exactly (pinned by
63
+ * the round-trip test over every registry ladder), so rounding down never
64
+ * undershoots a level the user actually picked.
65
+ */
66
+ export declare function resolveRung(params: {
67
+ position: EffortPosition;
68
+ published: readonly string[];
69
+ }): string | undefined;
70
+ /**
71
+ * the position a rung sits at within its own ladder — the inverse of
72
+ * `resolveRung`, used when a user picks a rung in the console. a single-rung
73
+ * ladder has no axis to speak of, so its one rung is the floor.
74
+ */
75
+ export declare function rungPosition(params: {
76
+ rung: string;
77
+ published: readonly string[];
78
+ }): EffortPosition | undefined;
79
+ /** human label for a rung, for models whose names aren't already presentable. */
80
+ export declare function rungLabel(rung: string): string;
@@ -3,6 +3,7 @@
3
3
  * All shared constants, types, and data used by both the Next.js app and the action runtime live here.
4
4
  * Other files in action/ re-export from this file for backward compatibility.
5
5
  */
6
+ import type { EffortPosition } from "./effort.ts";
6
7
  export declare const pullfrogMcpName = "pullfrog";
7
8
  /** @see {@link file://./agents/shared.ts} Agent interface that uses this type */
8
9
  export type AgentId = "claude" | "opencode";
@@ -12,8 +13,10 @@ export type AgentId = "claude" | "opencode";
12
13
  * opencode: pullfrog_select_mode
13
14
  */
14
15
  export declare function formatMcpToolRef(agentId: AgentId, toolName: string): string;
16
+ export type { EffortPosition } from "./effort.ts";
17
+ export { DEFAULT_EFFORT_POSITION, EFFORT_ALIASES, isEffortPosition, offeredRungs, parseEffortPosition, resolveRung, rungLabel, rungPosition, } from "./effort.ts";
15
18
  export type { AutoTier, ModelAlias, ModelProvider, ProviderConfig } from "./models.ts";
16
- export { AUTO_EFFICIENT, AUTO_INTELLIGENT, DEFAULT_PROXY_MODEL, defaultAutoTier, getAutoSelectHintModel, getModelEnvVars, getModelManagedCredentials, getModelProvider, getProviderDisplayName, isAutoTier, isCardGatedModel, modelAliases, parseModel, providers, resolveAutoTier, resolveCliModel, resolveDisplayAlias, resolveModelSlug, resolveOpenRouterModel, } from "./models.ts";
19
+ export { AUTO_EFFICIENT, AUTO_INTELLIGENT, DEFAULT_PROXY_MODEL, defaultAutoTier, getAutoSelectHintModel, getModelEffortLevels, getModelEnvVars, getModelManagedCredentials, getModelProvider, getProviderDisplayName, isAutoTier, isCardGatedModel, modelAliases, parseModel, providers, resolveAutoTier, resolveCliModel, resolveDisplayAlias, resolveModelRung, resolveModelSlug, resolveOpenRouterModel, } from "./models.ts";
17
20
  export type ToolPermission = "disabled" | "enabled";
18
21
  export type ShellPermission = "disabled" | "restricted" | "enabled";
19
22
  export type PushPermission = "disabled" | "restricted" | "enabled";
@@ -226,6 +229,8 @@ export interface WriteablePayload {
226
229
  * baseInstructions flag) keeps the soft-fallback safety net. see modelAccess.ts.
227
230
  */
228
231
  modelExplicit?: boolean | undefined;
232
+ /** reasoning-effort position on [0,1]; 0 is the model's cheapest rung, 1 its priciest */
233
+ effort?: EffortPosition | undefined;
229
234
  /** the user's actual request (body if @pullfrog tagged) */
230
235
  prompt: string;
231
236
  /** github username of the human who triggered this workflow run */