@cartanova/qgrid-cli 2.10.0 → 2.10.2

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 (77) hide show
  1. package/README.ko.md +1 -1
  2. package/README.md +1 -1
  3. package/bundle/dist/application/qgrid/conv-routing.js +4 -14
  4. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +10 -5
  5. package/bundle/dist/application/request-log/request-log.model.js +14 -12
  6. package/bundle/dist/application/request-log-step/request-log-step.model.js +7 -11
  7. package/bundle/dist/application/setting/setting.model.js +13 -27
  8. package/bundle/dist/application/token/token.model.js +52 -47
  9. package/bundle/dist/server-error-handler.js +1 -1
  10. package/bundle/dist/sonamu.config.js +3 -15
  11. package/bundle/dist/utils/providers/anthropic/anthropic-constants.js +4 -2
  12. package/bundle/dist/utils/providers/common/model-cost.js +10 -3
  13. package/bundle/src/application/qgrid/conv-routing.test.ts +0 -32
  14. package/bundle/src/application/qgrid/conv-routing.ts +7 -26
  15. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +65 -121
  16. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +12 -6
  17. package/bundle/src/application/qgrid/qgrid.frame.test.ts +10 -24
  18. package/bundle/src/application/request-log/request-log.model.test.ts +37 -2
  19. package/bundle/src/application/request-log/request-log.model.ts +14 -7
  20. package/bundle/src/application/request-log-step/request-log-step.model.ts +3 -15
  21. package/bundle/src/application/setting/setting.constant.test.ts +1 -13
  22. package/bundle/src/application/setting/setting.model.ts +10 -26
  23. package/bundle/src/application/setting/setting.persistence.test.ts +27 -0
  24. package/bundle/src/application/token/token.model.test.ts +86 -19
  25. package/bundle/src/application/token/token.model.ts +59 -44
  26. package/bundle/src/server-error-handler.ts +1 -2
  27. package/bundle/src/sonamu.config.ts +4 -31
  28. package/bundle/src/utils/providers/anthropic/anthropic-constants.test.ts +6 -1
  29. package/bundle/src/utils/providers/anthropic/anthropic-constants.ts +5 -2
  30. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.test.ts +1 -26
  31. package/bundle/src/utils/providers/common/model-cost.test.ts +22 -1
  32. package/bundle/src/utils/providers/common/model-cost.ts +22 -5
  33. package/bundle/src/utils/providers/common/provider-dispatcher.ts +4 -11
  34. package/bundle/web-dist/client/assets/index-DtRTSTes.js +106 -0
  35. package/bundle/web-dist/client/assets/logs-BhVYDEzC.js +1 -0
  36. package/bundle/web-dist/client/assets/monit-BxN4JWqK.js +1 -0
  37. package/bundle/web-dist/client/assets/refresh-cw-NNcU0Cmq.js +1 -0
  38. package/bundle/web-dist/client/assets/{routes-C8Y6olae.js → routes-CBCqRp2o.js} +1 -1
  39. package/bundle/web-dist/client/assets/services.generated-Cbvg2sGQ.js +51 -0
  40. package/bundle/web-dist/client/assets/{settings-CdVqtDQ5.js → settings-hBTEC7Ki.js} +1 -1
  41. package/bundle/web-dist/client/assets/show-BzYft5N4.js +2 -0
  42. package/bundle/web-dist/client/assets/{tokens-CxXtdk9o.js → tokens-PMybtI8X.js} +1 -1
  43. package/bundle/web-dist/client/assets/use-oauth-login-flow-C51_d6-6.js +1 -0
  44. package/bundle/web-dist/client/assets/{use-update-token-mutation-Dkv_HG-C.js → use-update-token-mutation-D-Y8OySK.js} +1 -1
  45. package/bundle/web-dist/client/index.html +2 -2
  46. package/bundle/web-dist/server/assets/{lazyRouteComponent-DyizoQKi.js → lazyRouteComponent-Bj1cPq6x.js} +2 -2
  47. package/bundle/web-dist/server/assets/{logs-DO8zBdBR.js → logs-BSk9lOHe.js} +31 -13
  48. package/bundle/web-dist/server/assets/{monit-COH4MckI.js → monit-D9W4ioUi.js} +5 -24
  49. package/bundle/web-dist/server/assets/{plus-C1D8z9o0.js → plus-CmvbWuDf.js} +1 -1
  50. package/bundle/web-dist/server/assets/{react-dom-PfWvArTX.js → react-dom-BjR1Iaz8.js} +1 -1
  51. package/bundle/web-dist/server/assets/refresh-cw-B8U9BL9-.js +23 -0
  52. package/bundle/web-dist/server/assets/{routes-Btja-741.js → routes-C7lB2Q85.js} +5 -5
  53. package/bundle/web-dist/server/assets/{services.generated-BsKOUSXl.js → services.generated-BM4X3Ecj.js} +102 -6
  54. package/bundle/web-dist/server/assets/{settings-DPcWGvy-.js → settings-BFVuldch.js} +4 -4
  55. package/bundle/web-dist/server/assets/{show-CMXbb3TJ.js → show-Cswh_tqs.js} +10 -9
  56. package/bundle/web-dist/server/assets/{tokens-DAUmTrgO.js → tokens-DiTUwUwr.js} +5 -5
  57. package/bundle/web-dist/server/assets/{use-oauth-login-flow-GsGwqefs.js → use-oauth-login-flow-DYKnG4A2.js} +32 -15
  58. package/bundle/web-dist/server/assets/{use-update-token-mutation-RujWERvj.js → use-update-token-mutation-DqGMopII.js} +1 -1
  59. package/bundle/web-dist/server/entry-server.generated.js +381 -22
  60. package/package.json +1 -1
  61. package/skills/qgrid/references/ai-sdk-provider-contract.md +4 -2
  62. package/skills/qgrid/references/anthropic-claude-code-runtime.md +3 -2
  63. package/skills/qgrid/references/request-log-run-lifecycle.md +2 -0
  64. package/skills/qgrid/references/sonamu-api-web-flow.md +3 -1
  65. package/skills/qgrid/references/token-auth-quota-lifecycle.md +2 -0
  66. package/skills/qgrid/references/verification-and-debugging.md +24 -13
  67. package/bundle/dist/utils/providers/common/token-picker.js +0 -14
  68. package/bundle/src/utils/providers/common/token-picker.ts +0 -18
  69. package/bundle/web-dist/client/assets/index-BfwrIBHs.js +0 -106
  70. package/bundle/web-dist/client/assets/logs-Brit-LqB.js +0 -1
  71. package/bundle/web-dist/client/assets/monit-DrYZkisv.js +0 -1
  72. package/bundle/web-dist/client/assets/services.generated-Bg2XkD-D.js +0 -51
  73. package/bundle/web-dist/client/assets/show-2B2X9MkO.js +0 -2
  74. package/bundle/web-dist/client/assets/use-oauth-login-flow-B9EqnwY9.js +0 -1
  75. /package/bundle/web-dist/client/assets/{plus-CknMNCP5.js → plus-B62CuqT8.js} +0 -0
  76. /package/bundle/web-dist/client/assets/{request-model-eygfdRv7.js → request-model-D4CZPmnG.js} +0 -0
  77. /package/bundle/web-dist/server/assets/{request-model-DXclJfdP.js → request-model-CnCeaNLE.js} +0 -0
@@ -10,6 +10,12 @@ Use this reference to choose tests, smoke scripts, and first debugging targets f
10
10
  - Common error triage
11
11
  - Debugging rules
12
12
 
13
+ ## Keep Tests Lightweight
14
+
15
+ Cover user-visible flows with a small real-provider E2E suite. Keep focused tests for costs, validation, cancellation, transactions, and actual regressions that a successful live request cannot prove. Remove obsolete behavior and duplicate assertions; do not delete distinct contracts just because their tests use mocks or are long. Call counts matter when they detect duplicate generation or logging, not merely an internal implementation choice.
16
+
17
+ Prefer existing checks and fixtures. Do not add a generic harness, blanket coverage target, snapshot suite, or configuration-only test layer. After the relevant checks pass, repeat only for a new edit, failure, or concrete unresolved risk. Keep production fixes separate from test cleanup and never weaken a test to hide a discovered defect.
18
+
13
19
  ## Package Scripts
14
20
 
15
21
  The commands in this section apply only inside the qgrid source repository. In a downstream
@@ -18,13 +24,17 @@ project, use that project's configured task and tool runner.
18
24
  Root:
19
25
 
20
26
  - `mise run check`: qgrid docs consistency, oxlint, and oxfmt check for the repo.
27
+ - `mise run test`: DB-free API tests, SDK tests, and CLI packaging tests. No provider credentials are needed; the OAuth relay test opens a local loopback listener.
21
28
  - `mise run build`: recursive package build.
22
29
  - `mise run dev`: parallel package dev servers.
23
30
 
24
31
  API package `qgrid-api`:
25
32
 
26
- - `mise exec -- pnpm --filter qgrid-api test`: Vitest run.
27
- - `mise exec -- pnpm --filter qgrid-api test:watch`: standalone watch mode.
33
+ - `mise exec -- pnpm --filter qgrid-api test:unit`: DB-free tests with per-file isolation. Add a test path to select a file.
34
+ - `mise exec -- pnpm --filter qgrid-api test:db`: model/transaction suites requiring a prepared local PostgreSQL test template. Missing DB is a failure, not a skip.
35
+ - `mise exec -- pnpm --filter qgrid-api test`: both suites, unit first.
36
+ - `mise exec -- pnpm --filter qgrid-api test:watch`: DB-free watch mode; use `test:db --watch` for DB tests.
37
+ - `mise exec -- pnpm --filter qgrid-api test:coverage`: both suites, with separate `coverage/unit` and `coverage/db` reports.
28
38
  - `mise exec -- pnpm --filter qgrid-api build`: Sonamu build.
29
39
  - `mise exec -- pnpm --filter qgrid-api sonamu`: run Sonamu CLI.
30
40
 
@@ -83,7 +93,11 @@ Run focused Vitest files from the owning package when possible, then broaden if
83
93
 
84
94
  ## Smoke Scripts
85
95
 
86
- Smoke scripts assume a running qgrid server and real registered tokens. They can consume subscription quota; do not run them casually.
96
+ Real-provider E2E requires a prepared isolated qgrid server, a registered token, and explicit opt-in. It consumes subscription quota; do not run it against production as part of routine checks. Never report mocked tests as live-provider verification.
97
+
98
+ The default entry point is `packages/ai-sdk/e2e/e2e.ts` (`mise exec -- pnpm --dir packages/ai-sdk e2e`). It checks text, streaming, and tool-plus-structured output, and follows each returned `requestLogId` to the persisted parent and steps. Set `QGRID_REAL_PROVIDER_ACCEPTANCE=1`, `QGRID_URL`, and `QGRID_MODEL` explicitly. A comma-separated model list explicitly selects multiple provider runs. Each run uses a unique project label; no production logs are deleted. Exact prose, token counts, costs, and timing are not acceptance criteria.
99
+
100
+ CI runs the DB-free tests plus existing package and empty-DB boot checks. Live E2E remains an explicit command; unavailable credentials or infrastructure mean unverified, not passed.
87
101
 
88
102
  OpenAI direct qgrid API:
89
103
 
@@ -109,16 +123,8 @@ AI SDK structured output:
109
123
  AI SDK tools plus structured output:
110
124
 
111
125
  - `packages/ai-sdk/e2e/tools-structured-output.ts`
112
- - This is the public-path release acceptance matrix: `qgrid()` HTTP/SSE,
113
- `generateText`/`streamText`, OpenAI/Anthropic, direct final answers, and one
114
- client-tool result followed by `Output.object`.
115
- - It consumes real provider quota and requires the explicit
116
- `QGRID_REAL_PROVIDER_ACCEPTANCE=1` opt-in.
117
- - Uses `QGRID_URL`, `QGRID_ACCEPTANCE_OPENAI_MODEL`, and
118
- `QGRID_ACCEPTANCE_ANTHROPIC_MODEL`. OpenAI direct-final coverage defaults to
119
- 10 generate plus 10 stream attempts and can be changed with
120
- `QGRID_ACCEPTANCE_OPENAI_DIRECT_REPEATS_PER_MODE`. Request logs use the stable
121
- project name `qgrid-ai-sdk-tools-output-acceptance`.
126
+ - Focused regression probe for direct structured answers while tools are available, including OpenAI tuple output, streamed JSON, and streaming tool follow-up. The non-streaming tool execution happy path lives in the default E2E suite.
127
+ - Uses the same explicit opt-in, server, and model selection as default E2E. Runs once per mode by default; set `QGRID_ACCEPTANCE_REPEATS` only for an intentional repeated probe.
122
128
 
123
129
  Image generation:
124
130
 
@@ -135,6 +141,11 @@ Other scripts under `scripts/smoke-test-*` and `scripts/debug-*` are ad hoc prob
135
141
 
136
142
  ## Common Error Triage
137
143
 
144
+ Generated SSE handlers missing a newly added event field:
145
+
146
+ - Sonamu's service generator reads runtime stream-decorator schemas. A stale API `dist` can keep the old event shape even with `sonamu sync --force`.
147
+ - Run `mise exec -- pnpm --dir packages/api sonamu build api`, then `mise exec -- pnpm --dir packages/api sonamu sync --force`. Check the generated handler type and web typecheck; do not hand-edit generated services.
148
+
138
149
  `NO_OPENAI_WORKERS`:
139
150
 
140
151
  - The request path returns this only when there is no active OpenAI token candidate; there is no queue and no busy state.
@@ -1,14 +0,0 @@
1
- //#region src/utils/providers/common/token-picker.ts
2
- var RoundRobinPicker = class {
3
- cursor = 0;
4
- pick(tokens) {
5
- if (tokens.length === 0) return null;
6
- const picked = tokens[this.cursor % tokens.length];
7
- this.cursor++;
8
- return picked;
9
- }
10
- };
11
- //#endregion
12
- export { RoundRobinPicker };
13
-
14
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4tcGlja2VyLmpzIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlscy9wcm92aWRlcnMvY29tbW9uL3Rva2VuLXBpY2tlci50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRva2VuUGlja2VyIOKAlCDthqDtgbAg7ISg7YOdIOyVjOqzoOumrOymmCDsnbjthLDtjpjsnbTsiqQgKyBSb3VuZFJvYmluUGlja2VyIOq1rO2YhC5cbiAqL1xuXG5leHBvcnQgaW50ZXJmYWNlIFRva2VuUGlja2VyPFQgZXh0ZW5kcyB7IGlkOiBudW1iZXIgfT4ge1xuICBwaWNrKHRva2VuczogVFtdKTogVCB8IG51bGw7XG59XG5cbmV4cG9ydCBjbGFzcyBSb3VuZFJvYmluUGlja2VyPFQgZXh0ZW5kcyB7IGlkOiBudW1iZXIgfT4gaW1wbGVtZW50cyBUb2tlblBpY2tlcjxUPiB7XG4gIHByaXZhdGUgY3Vyc29yID0gMDtcblxuICBwaWNrKHRva2VuczogVFtdKTogVCB8IG51bGwge1xuICAgIGlmICh0b2tlbnMubGVuZ3RoID09PSAwKSByZXR1cm4gbnVsbDtcbiAgICBjb25zdCBwaWNrZWQgPSB0b2tlbnNbdGhpcy5jdXJzb3IgJSB0b2tlbnMubGVuZ3RoXSE7XG4gICAgdGhpcy5jdXJzb3IrKztcbiAgICByZXR1cm4gcGlja2VkO1xuICB9XG59XG4iXSwibWFwcGluZ3MiOiI7QUFRQSxJQUFhLG1CQUFiLE1BQWtGO0NBQ2hGLFNBQWlCO0NBRWpCLEtBQUssUUFBdUI7RUFDMUIsSUFBSSxPQUFPLFdBQVcsR0FBRyxPQUFPO0VBQ2hDLE1BQU0sU0FBUyxPQUFPLEtBQUssU0FBUyxPQUFPO0VBQzNDLEtBQUs7RUFDTCxPQUFPO0NBQ1Q7QUFDRiJ9
@@ -1,18 +0,0 @@
1
- /**
2
- * TokenPicker — 토큰 선택 알고리즘 인터페이스 + RoundRobinPicker 구현.
3
- */
4
-
5
- export interface TokenPicker<T extends { id: number }> {
6
- pick(tokens: T[]): T | null;
7
- }
8
-
9
- export class RoundRobinPicker<T extends { id: number }> implements TokenPicker<T> {
10
- private cursor = 0;
11
-
12
- pick(tokens: T[]): T | null {
13
- if (tokens.length === 0) return null;
14
- const picked = tokens[this.cursor % tokens.length]!;
15
- this.cursor++;
16
- return picked;
17
- }
18
- }