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.
@@ -23,6 +23,7 @@ export interface LearningsHeading {
23
23
  }
24
24
  export interface RepoSettings {
25
25
  model: string | null;
26
+ effort: number | null;
26
27
  modes: Mode[];
27
28
  setupScript: string | null;
28
29
  postCheckoutScript: string | null;
@@ -44,11 +45,20 @@ export interface RepoSettings {
44
45
  xrepoLearningsHeadings: LearningsHeading[];
45
46
  }
46
47
  /**
47
- * Account-level billing plan. Orthogonal to repo-level OSS status. Mirrors
48
- * the server's `AccountPlan` in `utils/billing.ts`. `"none"` = free tier,
49
- * `"payg"` = card on file / pay-as-you-go.
48
+ * Account-level card signal. Orthogonal to repo-level OSS and Pro status.
49
+ * Mirrors the server's legacy-named `AccountPlan` in `utils/billing.ts`.
50
+ * `"none"` = no card; `"payg"` = card on file.
50
51
  */
51
52
  export type AccountPlan = "none" | "payg";
53
+ /**
54
+ * The org commercial gate's refusal (billing model v2). Set when run-context
55
+ * returns 402 for a `paused`/`unpaid` org — the backstop for manual re-runs and
56
+ * self-configured triggers that never hit reserveRun. main.ts stops before
57
+ * installing the agent or loading account secrets and writes actionable copy.
58
+ * A forked action can bypass this response, so proxy-token enforces the same
59
+ * verdict before issuing a Pullfrog Router key.
60
+ */
61
+ export type CommercialRefusal = "commercial" | "subscription_unpaid";
52
62
  export interface RunContext {
53
63
  settings: RepoSettings;
54
64
  apiToken: string;
@@ -56,6 +66,7 @@ export interface RunContext {
56
66
  plan: AccountPlan;
57
67
  proxyModel?: string | undefined;
58
68
  dbSecrets?: Record<string, string> | undefined;
69
+ commercialRefused?: CommercialRefusal | undefined;
59
70
  /**
60
71
  * the server tried and failed to materialize Pullfrog-stored secrets (or we
61
72
  * never got a usable response at all). distinct from an absent `dbSecrets`,
@@ -1,6 +1,6 @@
1
1
  import type { Octokit } from "@octokit/rest";
2
2
  import { type OctokitWithPlugins } from "./github.ts";
3
- import { type AccountPlan, type RepoSettings } from "./runContext.ts";
3
+ import { type AccountPlan, type CommercialRefusal, type RepoSettings } from "./runContext.ts";
4
4
  export interface RunContextData {
5
5
  repo: {
6
6
  owner: string;
@@ -13,6 +13,7 @@ export interface RunContextData {
13
13
  plan: AccountPlan;
14
14
  proxyModel?: string | undefined;
15
15
  dbSecrets?: Record<string, string> | undefined;
16
+ commercialRefused?: CommercialRefusal | undefined;
16
17
  /** stored secrets couldn't be materialized for this run — not the same as
17
18
  * the user having none. see `RunContext.secretsUnavailable`. */
18
19
  secretsUnavailable?: boolean | undefined;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * reasoning effort for a run: a stored POSITION landed on the ladder of the
3
+ * model that actually runs. shared by both harnesses and the startup log so
4
+ * they can't disagree — the log must never claim a level the agent didn't send.
5
+ * see wiki/effort.md.
6
+ */
7
+ import { type EffortPosition } from "../effort.ts";
8
+ import { type ModelAlias } from "../models.ts";
9
+ import type { ResolvedPayload } from "./payload.ts";
10
+ export interface RunEffort {
11
+ /** the position this run resolves at — the stored one, or the default. */
12
+ position: EffortPosition;
13
+ /** false when nothing was configured and `position` is the default. */
14
+ configured: boolean;
15
+ /**
16
+ * the rung the harness sends — always one the model published. undefined when
17
+ * the model publishes no rungs or we can't place it at all; either way the
18
+ * flag is omitted.
19
+ */
20
+ rung: string | undefined;
21
+ /** the catalog alias the ladder came from, if we recognized one. */
22
+ alias: ModelAlias | undefined;
23
+ }
24
+ export declare function resolveRunEffort(ctx: {
25
+ payload: ResolvedPayload;
26
+ resolvedModel?: string | undefined;
27
+ }): RunEffort;
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Startup log formatting for the resolver pipeline. Computes the
3
- * "model / agent / push / shell / timeout" block that main.ts prints
3
+ * "model / effort / agent / push / shell / timeout" block that main.ts prints
4
4
  * after resolving the agent + model + payload.
5
5
  */
6
6
  import type { ResolvedPayload } from "./payload.ts";
7
7
  /**
8
- * Emit the startup block ("» model / agent / push / shell / timeout") after
9
- * the agent and model are resolved. Single side-effect; no return.
8
+ * Emit the startup block ("» model / effort / agent / push / shell / timeout")
9
+ * after the agent and model are resolved. Single side-effect; no return.
10
10
  */
11
11
  export declare function logRunStartup(ctx: {
12
12
  payload: ResolvedPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pullfrog",
3
- "version": "0.1.47",
3
+ "version": "0.1.49",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pullfrog": "dist/cli.mjs",
File without changes