fmt(js): npm run fix on merge (#66983)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
nousbot-eng 2026-07-18 11:12:47 -04:00 committed by GitHub
parent e632769269
commit b1fc653081
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 57 additions and 54 deletions

View file

@ -1,6 +1,5 @@
import { describe, expect, it } from 'vitest'
import type { KnownBillingRefusalCode } from '@hermes/shared/billing'
import { describe, expect, it } from 'vitest'
import type { BillingRefusal } from './api'
import { resolveRefusal } from './errors'

View file

@ -93,7 +93,6 @@ export const resolveRefusal = (refusal: BillingRefusal): BillingRefusalPresentat
message: "This token isn't bound to an org you can manage",
title: 'Org access denied'
}
case 'monthly_cap_exceeded': {
const remaining = refusal.payload?.remainingUsd

View file

@ -1,9 +1,6 @@
import { describe, expect, it } from 'vitest'
import type {
BillingStateResponse,
SubscriptionStateResponse
} from './types'
import type { BillingStateResponse, SubscriptionStateResponse } from './types'
const fullBillingState = {
auto_reload: {

View file

@ -106,6 +106,7 @@ describe('deriveBillingView', () => {
}),
okSubscription(todaySubscriptionState)
)
const autoReload = view.accountRows.find(row => row.id === 'auto_reload')
expect(autoReload?.caption).toContain('Mastercard ••4444')
@ -127,6 +128,7 @@ describe('deriveBillingView', () => {
}),
okSubscription(todaySubscriptionState)
)
const autoReload = view.accountRows.find(row => row.id === 'auto_reload')
expect(autoReload?.caption).toContain('a different card')

View file

@ -1,12 +1,11 @@
import { useQueryClient } from '@tanstack/react-query'
import { useCallback, useRef, useState } from 'react'
import { refusalPolicy } from '@hermes/shared/billing-policy'
import {
driveChargeSettlement,
SETTLEMENT_POLL_CAP_MS,
SETTLEMENT_POLL_INTERVAL_MS
} from '@hermes/shared/charge-settlement'
import { useQueryClient } from '@tanstack/react-query'
import { useCallback, useRef, useState } from 'react'
import type { BillingApi, BillingRefusal } from './api'
import { useBillingApi } from './api'
@ -108,7 +107,6 @@ export async function pollChargeSettlement(
retryFreshKey: true,
title: 'Charge failed'
}
case 'ambiguous': {
if (settlement.status && refusalPolicy(settlement.error).ambiguousMidPoll) {
const refusal = observed.refusal ?? refusalFromStatus(settlement.error, settlement.status)
@ -140,6 +138,7 @@ export async function pollChargeSettlement(
}
case 'cancelled':
case 'timed_out':
return timeoutOutcome(observed.status?.ok ? (observed.status.portal_url ?? opts.portalUrl) : opts.portalUrl)
}

View file

@ -1,3 +1,37 @@
export {
BILLING_REFUSAL_POLICY,
type BillingRecovery,
type BillingRefusalPolicy,
refusalPolicy
} from './billing-policy'
export type {
BillingAutoReload,
BillingCardInfo,
BillingChargeResponse,
BillingChargeStatusResponse,
BillingErrorPayload,
BillingMonthlyCap,
BillingMutationResponse,
BillingRefusalCode,
BillingStateResponse,
ChargeFailureReason,
KnownBillingRefusalCode,
KnownChargeFailureReason,
SubscriptionPreviewResponse,
SubscriptionStateResponse,
SubscriptionTierOption,
SubscriptionUpgradeResponse,
UsageBarData,
UsageModelData
} from './billing-types'
export {
driveChargeSettlement,
SETTLEMENT_MAX_RETRY_AFTER_MS,
SETTLEMENT_POLL_CAP_MS,
SETTLEMENT_POLL_INTERVAL_MS,
type SettlementDeps,
type SettlementOutcome
} from './charge-settlement'
export {
type ConnectionState,
type GatewayClientOptions,
@ -19,37 +53,3 @@ export {
type ResolveGatewayWsUrlDeps,
type WebSocketAuthParam
} from './websocket-url'
export type {
BillingCardInfo,
BillingMonthlyCap,
BillingAutoReload,
BillingRefusalCode,
BillingStateResponse,
BillingErrorPayload,
BillingChargeResponse,
BillingChargeStatusResponse,
BillingMutationResponse,
ChargeFailureReason,
KnownBillingRefusalCode,
KnownChargeFailureReason,
SubscriptionTierOption,
SubscriptionStateResponse,
SubscriptionPreviewResponse,
SubscriptionUpgradeResponse,
UsageBarData,
UsageModelData
} from './billing-types'
export {
BILLING_REFUSAL_POLICY,
type BillingRecovery,
type BillingRefusalPolicy,
refusalPolicy
} from './billing-policy'
export {
driveChargeSettlement,
SETTLEMENT_MAX_RETRY_AFTER_MS,
SETTLEMENT_POLL_CAP_MS,
SETTLEMENT_POLL_INTERVAL_MS,
type SettlementDeps,
type SettlementOutcome
} from './charge-settlement'

View file

@ -1,7 +1,4 @@
import {
driveChargeSettlement,
type SettlementOutcome
} from '@hermes/shared/charge-settlement'
import { driveChargeSettlement, type SettlementOutcome } from '@hermes/shared/charge-settlement'
import type {
BillingChargeResponse,

View file

@ -1,4 +1,5 @@
import type { UsageModelData } from '@hermes/shared/billing'
import type { SessionInfo, SlashCategory, SubagentStatus, Usage } from './types.js'
export interface GatewaySkin {
@ -48,11 +49,20 @@ export interface SlashExecResponse {
// Wire shapes now live in @hermes/shared for reuse by TypeScript clients.
export type {
BillingCardInfo, BillingMonthlyCap, BillingAutoReload, BillingStateResponse,
BillingErrorPayload, BillingChargeResponse, BillingChargeStatusResponse,
BillingMutationResponse, SubscriptionTierOption, SubscriptionStateResponse,
SubscriptionPreviewResponse, SubscriptionUpgradeResponse,
UsageBarData, UsageModelData,
BillingAutoReload,
BillingCardInfo,
BillingChargeResponse,
BillingChargeStatusResponse,
BillingErrorPayload,
BillingMonthlyCap,
BillingMutationResponse,
BillingStateResponse,
SubscriptionPreviewResponse,
SubscriptionStateResponse,
SubscriptionTierOption,
SubscriptionUpgradeResponse,
UsageBarData,
UsageModelData
} from '@hermes/shared/billing'
export type CommandDispatchResponse =