mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-21 16:18:55 +00:00
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:
parent
e632769269
commit
b1fc653081
8 changed files with 57 additions and 54 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue