pullfrog 0.1.47 → 0.1.48

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,76 @@
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. high on the axis
26
+ * without being the ceiling: `xhigh` on the Claude/GPT flagships, `medium` on a
27
+ * three-rung ladder, `high` on DeepSeek's two — which is what every DeepSeek run
28
+ * got before this setting existed.
29
+ */
30
+ export declare const DEFAULT_EFFORT_POSITION: EffortPosition;
31
+ /**
32
+ * names we accept on user-facing surfaces (`--effort=`, the action input),
33
+ * mapped to fixed points on the axis. these are a typing convenience, NOT an
34
+ * ordering authority — a model's own ladder decides what each point resolves to.
35
+ * a 5-rung ladder lands each of these on its own rung; a shorter one folds them
36
+ * together, which is the correct behaviour rather than a lossy one.
37
+ */
38
+ export declare const EFFORT_ALIASES: Readonly<Record<string, EffortPosition>>;
39
+ export declare function isEffortPosition(value: number): boolean;
40
+ /**
41
+ * parse a user-supplied effort into a position. accepts a name (`high`, `MED`)
42
+ * or a bare number (`0.75`). returns undefined for anything else, so a typo
43
+ * stays visible in the prose instead of silently becoming a level.
44
+ */
45
+ export declare function parseEffortPosition(raw: string): EffortPosition | undefined;
46
+ /**
47
+ * the rungs a model offers a user: its published ladder minus the ones that turn
48
+ * reasoning off. order is the publisher's, already ascending — we never reorder
49
+ * it, because the array IS the scale.
50
+ */
51
+ export declare function offeredRungs(published: readonly string[]): readonly string[];
52
+ /**
53
+ * land a position on a model's ladder. the result is always a rung the model
54
+ * published, or undefined when it publishes none — there is no arithmetic here
55
+ * that can produce a name the model doesn't have.
56
+ *
57
+ * a position between two rungs ALWAYS rounds DOWN, so it never costs more than
58
+ * was asked for. a rung's own position lands back on itself exactly (pinned by
59
+ * the round-trip test over every registry ladder), so rounding down never
60
+ * undershoots a level the user actually picked.
61
+ */
62
+ export declare function resolveRung(params: {
63
+ position: EffortPosition;
64
+ published: readonly string[];
65
+ }): string | undefined;
66
+ /**
67
+ * the position a rung sits at within its own ladder — the inverse of
68
+ * `resolveRung`, used when a user picks a rung in the console. a single-rung
69
+ * ladder has no axis to speak of, so its one rung is the floor.
70
+ */
71
+ export declare function rungPosition(params: {
72
+ rung: string;
73
+ published: readonly string[];
74
+ }): EffortPosition | undefined;
75
+ /** human label for a rung, for models whose names aren't already presentable. */
76
+ 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 */