@cartanova/qgrid-cli 2.9.1 → 2.9.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.
Files changed (49) hide show
  1. package/bundle/dist/application/qgrid/qgrid.frame.js +4 -3
  2. package/bundle/dist/application/qgrid/token-death.js +6 -22
  3. package/bundle/dist/application/qgrid/token-subscriber.js +2 -1
  4. package/bundle/dist/application/token/token.model.js +22 -17
  5. package/bundle/dist/startup-migrations.js +8 -5
  6. package/bundle/dist/utils/providers/anthropic/claude-session.js +3 -2
  7. package/bundle/dist/utils/providers/common/effort.js +51 -0
  8. package/bundle/dist/utils/providers/common/model-cost.js +29 -14
  9. package/bundle/dist/utils/providers/openai/openai-backend-protocol.js +1 -1
  10. package/bundle/dist/utils/providers/openai/openai-dispatcher.js +5 -3
  11. package/bundle/src/application/qgrid/qgrid.frame.test.ts +20 -0
  12. package/bundle/src/application/qgrid/qgrid.frame.ts +3 -2
  13. package/bundle/src/application/qgrid/token-death.test.ts +11 -10
  14. package/bundle/src/application/qgrid/token-death.ts +9 -21
  15. package/bundle/src/application/qgrid/token-subscriber.test.ts +5 -1
  16. package/bundle/src/application/qgrid/token-subscriber.ts +1 -0
  17. package/bundle/src/application/token/token.model.test.ts +24 -5
  18. package/bundle/src/application/token/token.model.ts +30 -23
  19. package/bundle/src/startup-migrations.test.ts +19 -15
  20. package/bundle/src/startup-migrations.ts +11 -3
  21. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.test.ts +1 -1
  22. package/bundle/src/utils/providers/anthropic/claude-session.test.ts +13 -0
  23. package/bundle/src/utils/providers/anthropic/claude-session.ts +3 -1
  24. package/bundle/src/utils/providers/common/effort.test.ts +61 -0
  25. package/bundle/src/utils/providers/common/effort.ts +53 -0
  26. package/bundle/src/utils/providers/common/model-cost.test.ts +25 -12
  27. package/bundle/src/utils/providers/common/model-cost.ts +43 -14
  28. package/bundle/src/utils/providers/openai/openai-backend-protocol.ts +3 -1
  29. package/bundle/src/utils/providers/openai/openai-dispatcher.test.ts +21 -0
  30. package/bundle/src/utils/providers/openai/openai-dispatcher.ts +5 -4
  31. package/bundle/web-dist/client/assets/{index-DiioTXCk.js → index-fogJvajr.js} +3 -3
  32. package/bundle/web-dist/client/assets/{logs-Cmh7iNUl.js → logs-CsY2cqvt.js} +1 -1
  33. package/bundle/web-dist/client/assets/{monit-BxqRbzYv.js → monit-ChgaLEcD.js} +1 -1
  34. package/bundle/web-dist/client/assets/{routes-DrNdqoD1.js → routes-BvyiTnOZ.js} +2 -2
  35. package/bundle/web-dist/client/assets/{settings-ROuRMHwU.js → settings-ZR2J9rWb.js} +1 -1
  36. package/bundle/web-dist/client/assets/{show-Ct97ts6E.js → show-CjwO4-So.js} +1 -1
  37. package/bundle/web-dist/client/assets/{tokens-Cw2eWi9I.js → tokens-Bx-hG1gm.js} +1 -1
  38. package/bundle/web-dist/client/assets/{use-oauth-login-flow-D4-P9yOJ.js → use-oauth-login-flow-Bqax_icS.js} +1 -1
  39. package/bundle/web-dist/client/index.html +1 -1
  40. package/bundle/web-dist/server/assets/{routes-CxMHXfdH.js → routes-B408iqh1.js} +29 -14
  41. package/bundle/web-dist/server/entry-server.generated.js +3 -2
  42. package/package.json +1 -1
  43. package/skills/qgrid/SKILL.md +1 -0
  44. package/skills/qgrid/references/ai-sdk-provider-contract.md +2 -2
  45. package/skills/qgrid/references/cli-env-and-server-boot.md +1 -0
  46. package/skills/qgrid/references/openai-codex-runtime.md +71 -0
  47. package/skills/qgrid/references/provider-runtime-differences.md +2 -0
  48. package/skills/qgrid/references/sonamu-api-web-flow.md +1 -1
  49. package/skills/qgrid/references/token-auth-quota-lifecycle.md +3 -2
@@ -64,7 +64,7 @@ Tool contract visibility: the detail page renders a Tools panel between Response
64
64
 
65
65
  Chat token targeting: the dashboard chat panel can pin a conversation to one account. It defaults to automatic distribution and lists only active tokens whose provider matches the selected model, sending the choice as `tokenName` so the request lands on exactly that account with no fallback. Changing either the model or the token resets the existing conversation coordinates, because a thread's prompt cache belongs to the account that built it. A selection that disappears — deactivated or deleted — is cleared automatically, but the selection is preserved while the token list is still loading so a slow fetch does not silently reset the user's choice.
66
66
 
67
- Chat model presets: the model `<select>` lists the served subset of `QgridSupportedModel` grouped by provider (`MODEL_PRESET_GROUPS` in `ChatWidget.tsx`), newest first, and defaults to `anthropic/claude-fable-5-1`. Ids that the ChatGPT-subscription Codex route no longer serves (`gpt-5.4` and `gpt-5.4-mini` retired 2026-08-31 with `gpt-5.6-terra` / `gpt-5.6-luna` as replacements; `gpt-5.2` and `gpt-5.3-codex` removed earlier) and the catalog-less `claude-sonnet-4-7` stay in the SDK type but are excluded here. web does not depend on ai-sdk, so a new model must be added in both places.
67
+ Chat model presets: the model `<select>` lists the served subset of `QgridSupportedModel` grouped by provider (`MODEL_PRESET_GROUPS` in `ChatWidget.tsx`), newest first, and defaults to `anthropic/claude-fable-5-1`. Ids that the ChatGPT-subscription Codex route no longer serves (`gpt-5.4` and `gpt-5.4-mini` retired 2026-08-31 with `gpt-5.6-terra` / `gpt-5.6-luna` as replacements; `gpt-5.2` and `gpt-5.3-codex` removed earlier) and the catalog-less `claude-sonnet-4-7` stay in the SDK type but are excluded here. web does not depend on ai-sdk, so a new model must be added in both places. `openai/gpt-6-astra` is included in the OpenAI group; adding it does not change the default model.
68
68
 
69
69
  The monit tab's vitals strip shows per-provider in-flight counts, an in-flight sparkline, token chips with quota gauges (fed by the dispatcher's 60-second rate-limits cache; `resetsAt` arrives as ms epoch), and a 1-hour per-provider request/error/cache-hit stats line polled separately every 30 seconds.
70
70
 
@@ -204,9 +204,10 @@ When a refresh fails in a way that only re-login can fix, qgrid removes the toke
204
204
 
205
205
  - Detection lives at the existing refresh failure points, not a background scanner. OpenAI classifies on the error code (`refresh_token_expired`, `refresh_token_reused`, `refresh_token_invalidated`) regardless of HTTP status; Anthropic treats refresh 400/401 as auth-dead.
206
206
  - Before deactivating, qgrid locks the token row and confirms the full credentials used by the failed attempt still match the stored credentials. A successful concurrent refresh therefore wins without a stale failure killing the rotated login. `QgridFrame.refreshToken` also dedups concurrent refreshes per token.
207
- - Auth death is one conditional `reauth_required=false → true` transaction. Provider-scoped advisory locking serializes the last-active decision, and the update also sets `active=false` when another active token exists. The process whose update affects a row is the only one that sends the Slack death notification, so a shared database produces exactly one alert per event. Manual active toggles never set `reauth_required`, and an expired inactive token cannot be reactivated without completing OAuth.
207
+ - Auth death is one conditional `reauth_required=false → true` transaction. Provider-scoped advisory locking serializes the last-active decision, and the update always sets `active=false`, including for the last active token. The process whose update affects a row is the only one that sends the Slack death notification, so a shared database produces exactly one alert per event. Manual active toggles never set `reauth_required`, and an expired inactive token cannot be reactivated without completing OAuth.
208
208
  - A successful refresh clears a concurrent stale `reauth_required` mark but preserves `active`, so it never overrides an operator's manual inactive choice.
209
- - The provider's last active token is marked `reauth_required=true` but never auto-deactivated. A systemic failure (client_id revocation, OAuth contract change) would otherwise empty the pool; qgrid logs an error, keeps the token, and sends its own urgent Slack alert. The persisted flag gates repeat alerts across every instance.
209
+ - The provider's last active token is also deactivated. Its ordinary `세션 만료` notification is urgent and explains that no usable tokens remain; retaining a confirmed expired login cannot keep the provider usable. The persisted flag gates repeat alerts across instances. Startup and periodic subscriber reconciliation deactivate legacy rows with both `reauth_required=true` and `active=true` before loading the routing pool.
210
+ - The dashboard shows `Session expired` only when `reauth_required=true`, including inactive tokens. Usage errors such as a one-off 401 or a transient refresh failure show `Unavailable`; error-message text is not a second expiry classifier.
210
211
  - The other notification is registration: every completed login sends one alert, whether the account is new or replacing an existing row through the account dedup. Manually toggling a token back to active is not a registration and sends nothing.
211
212
  - Quiet hours suppress non-urgent Slack notifications: weekends, plus 20:00–08:00 on weekdays, in `Asia/Seoul`. All three parts are settings (`slack.quietFromHour`, `slack.quietUntilHour`, `slack.notifyOnWeekends`), defaulting to that window. The hour is computed through `Intl` with an explicit timezone rather than `getHours()` — dev0 runs in UTC, where "20:00" would land at 05:00 Korean time. Expiry alerts repeat, so one dropped in quiet hours returns on the first cycle of the next working window. The last-active-token death alert sets `urgent: true` and ignores quiet hours: it means that provider has no usable login, which cannot wait for the next working day.
212
213
  - `slack.enabled` exists because holidays cannot be expressed as a recurring rule — substitute holidays, one-off national days, and company closures change every year, so an operator turns notifications off directly instead. It gates the same non-urgent path as quiet hours, which keeps the escape hatch for pool-empty alerts identical in both mechanisms.