Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat: anillo de uso del GLM Coding Plan de z.ai

Đang mở
#94 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, typescript
Lĩnh vực
backend, desktop

Hướng nghiên cứu

Read the existing provider implementations, especially cursor.rs, and follow their registration through mod.rs, config.rs, secrets.rs, and Settings.tsx. Check how provider tests use JSON fixtures and how settings test connections. Done means the GLM Coding Plan quota and reset data appear in usage rings, the plan level is shown, and the API key can be saved and checked; first verify the endpoint and any weekly limit behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Pre-flight checks
  • Busqué en las issues existentes y en el roadmap (#45): sin duplicados ni solapamiento (la «ventana GLM de NaN» en candidatos no priorizados es otro tema).
  • Entiendo que esta propuesta requiere revisión de producto antes de implementarse.
Problem to solve

quorb muestra anillos de Claude, Codex, Gemini, Cursor, Copilot, OpenRouter y NaN, pero no del GLM Coding Plan de z.ai, cada vez más usado con agentes de código vía el endpoint Anthropic-compatible (api.z.ai/api/anthropic). Quien lo tiene no ve en el widget la cuota de 5h ni el resto del consumo.

Proposed solution

Provider zai (Kind::Subscription), mismo patrón de archivo único que el resto:

  • GET https://api.z.ai/api/monitor/usage/quota/limit con Authorization: Bearer <API key de z.ai> (creada en z.ai/manage-apikey).
  • La response trae data.level (plan lite/pro/max) y limits[]:
    • TOKENS_LIMIT — cuota de coding con ventana de 5h: usage/number, percentage, nextResetTime (unix ms) y desglose por modelCode.
    • TIME_LIMIT — cuota mensual de web search/reader.
  • Meter principal (ventana 5h, resets_at) + secundario; nivel de plan en el label del anillo.
  • API key en Windows Credential Manager (secrets::ZAI_API_KEY); sección en Ajustes con comprobar conexión.
  • Piezas: src-tauri/src/providers/zai.rs + registro en mod.rs, config.rs, secrets.rs y Settings.tsx; tests deterministas de parseo con fixture JSON (sin red).

Nota de riesgo: el endpoint no está documentado en docs.z.ai; lo usan tools comunitarias independientes (nharu-0630/zaiusage, chunnylab/agent-usage-widget). Igual que cursor.rs con su dashboard, un cambio upstream degrada a fail(Status::Error) sin romper la app.

Pendiente de verificar con una cuenta real: si el límite semanal del devpack aparece como otro type de limit (en código ajeno solo se ven TOKENS_LIMIT y TIME_LIMIT).

Affected area

Application behavior

Scope and non-goals
  • Scope: GLM Coding Plan (suscripción devpack), cuenta principal y adicionales por API key como el resto de proveedores.
  • Non-goals: z.ai pay-as-you-go sin devpack, leer logs locales de Claude Code, macOS.
Alternatives considered
  • API oficial de usage: no existe hoy en docs.z.ai/api-reference (solo chat/agents/image/audio/video/tools).
  • Estimar créditos con la fórmula del devpack desde logs locales: frágil, duplicaría el parseo de sesión de claude.rs y no refleja el estado real de la cuota.
  • Esperar documentación oficial: sin fecha; el endpoint lleva tiempo estable para las tools comunitarias.
Ngôn ngữ chính
TypeScript
Star
10
Fork
2
Merge trung bình
16 phút
Pull request đã merge (30 ngày)
51

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của egdev6/quorb

Tất cả issue của egdev6/quorb

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.