@blockrun/llm 3.26.0 → 3.26.4

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/index.d.cts CHANGED
@@ -3,17 +3,19 @@ import * as _anthropic_ai_sdk from '@anthropic-ai/sdk';
3
3
  /**
4
4
  * Smart Router Types
5
5
  *
6
- * Four classification tiers — REASONING is distinct from COMPLEX because
7
- * reasoning tasks need different models (o3, gemini-pro) than general
8
- * complex tasks (gpt-4o, sonnet-4).
6
+ * Four capability tiers. REASONING is distinct from COMPLEX because proof,
7
+ * derivation and multi-step math reward a different model set than broad
8
+ * complex work; the configured chains in config.ts carry the current picks.
9
9
  *
10
- * Scoring uses weighted float dimensions with sigmoid confidence calibration.
10
+ * Tier scoring uses weighted float dimensions with sigmoid confidence
11
+ * calibration (rules.ts); the portfolio strategy ranks within a tier.
11
12
  */
12
13
  type Tier = "SIMPLE" | "MEDIUM" | "COMPLEX" | "REASONING";
13
14
  type RoutingDecision$1 = {
14
15
  model: string;
15
16
  tier: Tier;
16
17
  confidence: number;
18
+ /** `"llm"` is reserved for a host-side classifier; core strategies emit `"rules"` or `"portfolio"`. */
17
19
  method: "rules" | "llm" | "portfolio";
18
20
  reasoning: string;
19
21
  costEstimate: number;
@@ -1998,6 +2000,17 @@ declare class MusicClient {
1998
2000
  generate(prompt: string, options?: MusicGenerateOptions): Promise<MusicResponse>;
1999
2001
  private requestWithPayment;
2000
2002
  private handlePaymentAndRetry;
2003
+ private finishPaidResponse;
2004
+ /**
2005
+ * Poll a slow track until it completes, sending the SAME payment header each
2006
+ * time: the server binds the payer to the job and settles on the first poll
2007
+ * that sees it completed.
2008
+ *
2009
+ * Network errors and 502/503/504 keep polling. A response lost on the settling
2010
+ * poll would otherwise drop a track that was paid for, and polling again returns
2011
+ * it as already settled, with no second charge.
2012
+ */
2013
+ private pollMusicJob;
2001
2014
  private fetchWithTimeout;
2002
2015
  getWalletAddress(): string;
2003
2016
  getSpending(): Spending;
@@ -3901,7 +3914,8 @@ declare class SolanaLLMClient {
3901
3914
  *
3902
3915
  * The POST is verified, not charged. The job is then polled with a wallet
3903
3916
  * signature (no payment) until it finishes, and ONE payment is signed for
3904
- * the finished video; a failed job is never charged. If the gateway does not
3917
+ * the finished video; a job that fails before completing is not charged. A paid
3918
+ * job can still fail, and its APIError then carries `payment_status`. If the gateway does not
3905
3919
  * accept poll signatures for the job, it is polled with a payment per poll
3906
3920
  * instead, which is likewise only charged on completion.
3907
3921
  *
@@ -4086,7 +4100,8 @@ declare class SolanaLLMClient {
4086
4100
  * cost at POST; this loop only fetches the result and never signs a payment.
4087
4101
  * A batch-billed image job still answers its proof poll with 402: that job
4088
4102
  * falls back to the per-poll payment below.
4089
- * - video: settles on completion, and a failed job is never charged. A
4103
+ * - video: settles on completion. A job that fails before completing is not
4104
+ * charged; one that fails after payment says so in `payment_status`. A
4090
4105
  * finished, unpaid job answers the proof poll with 402 `{status:"completed"}`
4091
4106
  * and a normal x402 challenge; ONE payment is signed from that challenge and
4092
4107
  * the same poll is re-sent with it. The cost is recorded here, on delivery.
package/dist/index.d.ts CHANGED
@@ -3,17 +3,19 @@ import * as _anthropic_ai_sdk from '@anthropic-ai/sdk';
3
3
  /**
4
4
  * Smart Router Types
5
5
  *
6
- * Four classification tiers — REASONING is distinct from COMPLEX because
7
- * reasoning tasks need different models (o3, gemini-pro) than general
8
- * complex tasks (gpt-4o, sonnet-4).
6
+ * Four capability tiers. REASONING is distinct from COMPLEX because proof,
7
+ * derivation and multi-step math reward a different model set than broad
8
+ * complex work; the configured chains in config.ts carry the current picks.
9
9
  *
10
- * Scoring uses weighted float dimensions with sigmoid confidence calibration.
10
+ * Tier scoring uses weighted float dimensions with sigmoid confidence
11
+ * calibration (rules.ts); the portfolio strategy ranks within a tier.
11
12
  */
12
13
  type Tier = "SIMPLE" | "MEDIUM" | "COMPLEX" | "REASONING";
13
14
  type RoutingDecision$1 = {
14
15
  model: string;
15
16
  tier: Tier;
16
17
  confidence: number;
18
+ /** `"llm"` is reserved for a host-side classifier; core strategies emit `"rules"` or `"portfolio"`. */
17
19
  method: "rules" | "llm" | "portfolio";
18
20
  reasoning: string;
19
21
  costEstimate: number;
@@ -1998,6 +2000,17 @@ declare class MusicClient {
1998
2000
  generate(prompt: string, options?: MusicGenerateOptions): Promise<MusicResponse>;
1999
2001
  private requestWithPayment;
2000
2002
  private handlePaymentAndRetry;
2003
+ private finishPaidResponse;
2004
+ /**
2005
+ * Poll a slow track until it completes, sending the SAME payment header each
2006
+ * time: the server binds the payer to the job and settles on the first poll
2007
+ * that sees it completed.
2008
+ *
2009
+ * Network errors and 502/503/504 keep polling. A response lost on the settling
2010
+ * poll would otherwise drop a track that was paid for, and polling again returns
2011
+ * it as already settled, with no second charge.
2012
+ */
2013
+ private pollMusicJob;
2001
2014
  private fetchWithTimeout;
2002
2015
  getWalletAddress(): string;
2003
2016
  getSpending(): Spending;
@@ -3901,7 +3914,8 @@ declare class SolanaLLMClient {
3901
3914
  *
3902
3915
  * The POST is verified, not charged. The job is then polled with a wallet
3903
3916
  * signature (no payment) until it finishes, and ONE payment is signed for
3904
- * the finished video; a failed job is never charged. If the gateway does not
3917
+ * the finished video; a job that fails before completing is not charged. A paid
3918
+ * job can still fail, and its APIError then carries `payment_status`. If the gateway does not
3905
3919
  * accept poll signatures for the job, it is polled with a payment per poll
3906
3920
  * instead, which is likewise only charged on completion.
3907
3921
  *
@@ -4086,7 +4100,8 @@ declare class SolanaLLMClient {
4086
4100
  * cost at POST; this loop only fetches the result and never signs a payment.
4087
4101
  * A batch-billed image job still answers its proof poll with 402: that job
4088
4102
  * falls back to the per-poll payment below.
4089
- * - video: settles on completion, and a failed job is never charged. A
4103
+ * - video: settles on completion. A job that fails before completing is not
4104
+ * charged; one that fails after payment says so in `payment_status`. A
4090
4105
  * finished, unpaid job answers the proof poll with 402 `{status:"completed"}`
4091
4106
  * and a normal x402 challenge; ONE payment is signed from that challenge and
4092
4107
  * the same poll is re-sent with it. The cost is recorded here, on delivery.