extra-usage-noninteractive.ts 479 B

12345678910111213141516
  1. import { runExtraUsage } from './extra-usage-core.js'
  2. export async function call(): Promise<{ type: 'text'; value: string }> {
  3. const result = await runExtraUsage()
  4. if (result.type === 'message') {
  5. return { type: 'text', value: result.value }
  6. }
  7. return {
  8. type: 'text',
  9. value: result.opened
  10. ? `浏览器已打开以管理额外使用量。如果未打开,请访问:${result.url}`
  11. : `请访问 ${result.url} 以管理额外使用量。`,
  12. }
  13. }