@cartanova/qgrid-cli 2.11.0 → 2.12.0
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.
- package/bundle/dist/application/qgrid/qgrid-response-format.js +9 -1
- package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +28 -4
- package/bundle/dist/application/qgrid/qgrid.dispatcher.js +7 -4
- package/bundle/dist/application/qgrid/qgrid.frame.js +25 -4
- package/bundle/dist/application/request-log/request-log.model.js +5 -1
- package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +7 -2
- package/bundle/dist/utils/providers/anthropic/claude-session.js +10 -2
- package/bundle/dist/utils/providers/grok/grok-backend-protocol.js +1 -1
- package/bundle/dist/utils/providers/grok/grok-dispatcher.js +43 -12
- package/bundle/dist/utils/providers/grok/grok-types.js +2 -2
- package/bundle/dist/utils/providers/openai/openai-dispatcher.js +9 -3
- package/bundle/src/application/qgrid/qgrid-response-format.ts +9 -0
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +63 -0
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +49 -7
- package/bundle/src/application/qgrid/qgrid.dispatcher.ts +6 -0
- package/bundle/src/application/qgrid/qgrid.frame.test.ts +9 -2
- package/bundle/src/application/qgrid/qgrid.frame.ts +39 -3
- package/bundle/src/application/request-log/request-log.model.ts +11 -0
- package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +2 -0
- package/bundle/src/utils/providers/anthropic/claude-session.ts +15 -1
- package/bundle/src/utils/providers/common/provider-dispatcher.ts +10 -0
- package/bundle/src/utils/providers/grok/grok-backend-protocol.ts +6 -1
- package/bundle/src/utils/providers/grok/grok-dispatcher.test.ts +74 -3
- package/bundle/src/utils/providers/grok/grok-dispatcher.ts +66 -18
- package/bundle/src/utils/providers/grok/grok-quota.test.ts +18 -0
- package/bundle/src/utils/providers/grok/grok-types.ts +2 -1
- package/bundle/src/utils/providers/openai/openai-dispatcher.test.ts +18 -0
- package/bundle/src/utils/providers/openai/openai-dispatcher.ts +10 -2
- package/bundle/web-dist/client/assets/index-CK9LwGNV.js +32 -0
- package/bundle/web-dist/client/assets/logs-DjQcEivP.js +1 -0
- package/bundle/web-dist/client/assets/monit-RTxpU7oZ.js +1 -0
- package/bundle/web-dist/client/assets/plus-DDvVTvQP.js +1 -0
- package/bundle/web-dist/client/assets/refresh-cw-CTQsNddA.js +1 -0
- package/bundle/web-dist/client/assets/request-model-DliRuPcw.js +1 -0
- package/bundle/web-dist/client/assets/routes-DVHoo-YF.js +5 -0
- package/bundle/web-dist/client/assets/{services.generated-CefiDXEv.js → services.generated-B5lc3aIC.js} +1 -1
- package/bundle/web-dist/client/assets/settings-BQUz6UFr.js +1 -0
- package/bundle/web-dist/client/assets/show-CalQG1Ew.js +2 -0
- package/bundle/web-dist/client/assets/tokens-DU4fWXI9.js +1 -0
- package/bundle/web-dist/client/assets/use-oauth-login-flow-BfxYI4Oh.js +1 -0
- package/bundle/web-dist/client/assets/use-update-token-mutation-qKBC2sn7.js +1 -0
- package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +9 -0
- package/bundle/web-dist/client/assets/vendor-tanstack-DRPs09ai.js +1 -0
- package/bundle/web-dist/client/index.html +4 -4
- package/bundle/web-dist/server/assets/{lazyRouteComponent-D8iTIHyn.js → lazyRouteComponent-AKiHfZWp.js} +2 -2
- package/bundle/web-dist/server/assets/logs-B5M5B7pN.js +531 -0
- package/bundle/web-dist/server/assets/{monit-B2hqorPe.js → monit-p6JM8MMl.js} +117 -375
- package/bundle/web-dist/server/assets/plus-I0FfLVgU.js +19 -0
- package/bundle/web-dist/server/assets/{react-dom-BIYQzBqG.js → react-dom-Cv23mm1K.js} +1 -1
- package/bundle/web-dist/server/assets/refresh-cw-DYsnffRC.js +23 -0
- package/bundle/web-dist/server/assets/{request-model-I6OdODSH.js → request-model-Cp6h5EuP.js} +7 -16
- package/bundle/web-dist/server/assets/{routes-B95YlUv2.js → routes-rIXpkI-t.js} +200 -691
- package/bundle/web-dist/server/assets/{services.generated-DQATJ6qf.js → services.generated-CMJ8AHbO.js} +3796 -4012
- package/bundle/web-dist/server/assets/settings-_MoaFGxj.js +461 -0
- package/bundle/web-dist/server/assets/{show-Bxaj3rhH.js → show-Cfm9UeDr.js} +375 -1271
- package/bundle/web-dist/server/assets/tokens-DMSHDg9D.js +560 -0
- package/bundle/web-dist/server/assets/{use-oauth-login-flow-CKDHgc3U.js → use-oauth-login-flow-jkAkT3X6.js} +16 -50
- package/bundle/web-dist/server/assets/{use-update-token-mutation-BEbgOzaa.js → use-update-token-mutation-Sm6kh02m.js} +1 -1
- package/bundle/web-dist/server/entry-server.generated.js +1177 -2657
- package/package.json +1 -1
- package/skills/qgrid/references/ai-sdk-provider-contract.md +1 -1
- package/skills/qgrid/references/cli-env-and-server-boot.md +4 -3
- package/skills/qgrid/references/decision-rationale.md +2 -1
- package/skills/qgrid/references/grok-runtime.md +7 -1
- package/skills/qgrid/references/repo-map.md +2 -0
- package/skills/qgrid/references/request-log-run-lifecycle.md +5 -0
- package/skills/qgrid/references/verification-and-debugging.md +24 -5
- package/bundle/web-dist/client/assets/index-BA7uQ-6c.js +0 -31
- package/bundle/web-dist/client/assets/logs-C47OJGEI.js +0 -1
- package/bundle/web-dist/client/assets/monit-BS9no0dU.js +0 -4
- package/bundle/web-dist/client/assets/plus-sdACTfH0.js +0 -1
- package/bundle/web-dist/client/assets/refresh-cw-CY8o_1cT.js +0 -1
- package/bundle/web-dist/client/assets/request-model-BRtFuZvj.js +0 -1
- package/bundle/web-dist/client/assets/routes-kqgkUxE8.js +0 -5
- package/bundle/web-dist/client/assets/settings-DNDvFGSw.js +0 -1
- package/bundle/web-dist/client/assets/show-u8Np69q3.js +0 -2
- package/bundle/web-dist/client/assets/tokens-QvP410NW.js +0 -1
- package/bundle/web-dist/client/assets/total-cost-MnfKU8IN.js +0 -1
- package/bundle/web-dist/client/assets/use-oauth-login-flow-Bzdh28Ws.js +0 -1
- package/bundle/web-dist/client/assets/use-update-token-mutation-CfJKaxmR.js +0 -1
- package/bundle/web-dist/client/assets/vendor-react-CUFFrVN9.js +0 -244
- package/bundle/web-dist/client/assets/vendor-tanstack-Bf_jag9G.js +0 -1
- package/bundle/web-dist/server/assets/logs-B3OTd9hy.js +0 -825
- package/bundle/web-dist/server/assets/plus-DwG7h9kq.js +0 -28
- package/bundle/web-dist/server/assets/refresh-cw-mMBkwOq0.js +0 -44
- package/bundle/web-dist/server/assets/settings-C3gbGk0m.js +0 -830
- package/bundle/web-dist/server/assets/tokens-CZjH3cB7.js +0 -1038
- package/bundle/web-dist/server/assets/total-cost-fTE9Xy82.js +0 -18
package/package.json
CHANGED
|
@@ -167,7 +167,7 @@ Payload responsibilities:
|
|
|
167
167
|
- Preserve and resend `runContext` for tool-call follow-ups.
|
|
168
168
|
- Let the server infer single-turn completion versus an open tool-call run. Logging-disabled tool calls still use the SDK's local pending-call correlation and continue without a request-log id.
|
|
169
169
|
- Derive/store/resend opaque OpenAI affinity coordinates by `sessionKey`.
|
|
170
|
-
- For `openai/` language models, send user-message image/file parts as image input: the current turn goes in qgrid `input` (text + image data/HTTP URLs) and earlier user turns as history `input_image`. The same JSON-transport size guard applies. Drop assistant image parts, and all image parts for `anthropic/` models (the Claude Code path is text-only), and report each drop as an AI SDK `unsupported` warning (`feature: "image input"`) in `warnings`, not only on the console.
|
|
170
|
+
- For `openai/` and `grok/` language models, send user-message image/file parts as image input: the current turn goes in qgrid `input` (text + image data/HTTP URLs) and earlier user turns as history `input_image`. The same JSON-transport size guard applies. `grok/` keeps only `https:` and `data:` URLs (the backend cannot fetch `http:`) and sniffs bytes sent as `image/*`; other providers use the shared extractor. Drop assistant image parts, and all image parts for `anthropic/` models (the Claude Code path is text-only), and report each drop as an AI SDK `unsupported` warning (`feature: "image input"`) in `warnings`, not only on the console.
|
|
171
171
|
- The separate image provider converts `generateImage` prompt references to qgrid `input` and rejects oversized inline reference images before transport. Callers should compress/resize large reference photos, preferably to WebP/JPEG.
|
|
172
172
|
|
|
173
173
|
Tools and `jsonSchema` can be used together as of qgrid 2.5.4. On OpenAI the
|
|
@@ -47,9 +47,10 @@ Sonamu's native `SONAMU_DB_HOST`, `SONAMU_DB_PORT`, `SONAMU_DB_USER`,
|
|
|
47
47
|
|
|
48
48
|
Do not treat CLI bundle bootstrapping internals as user-facing qgrid configuration.
|
|
49
49
|
The packaged CLI accepts only `staging` and `production`; `development` and `test`
|
|
50
|
-
require the source workspace. Sonamu 0.10.3 also requires `.env` or
|
|
51
|
-
`.env.<NODE_ENV>` to exist at the API root
|
|
52
|
-
|
|
50
|
+
require the source workspace. Sonamu (0.10.3 and later, including 0.11) also requires `.env` or
|
|
51
|
+
`.env.<NODE_ENV>` to exist at the API root, even for `sonamu build`, which reads no values from it.
|
|
52
|
+
Source deployments and CI builds must provide one of those files (an empty file is enough), while
|
|
53
|
+
the npm CLI bundle carries an empty `.env` marker itself.
|
|
53
54
|
|
|
54
55
|
## SDK/client env vars
|
|
55
56
|
|
|
@@ -241,6 +241,7 @@ Key decisions:
|
|
|
241
241
|
- The CLI checks runtime CLIs (`codex`, `claude`) because qgrid delegates provider execution to those local binaries.
|
|
242
242
|
- The dashboard version should follow the CLI package version because the dashboard is shipped by the CLI bundle, not as an independently versioned web product.
|
|
243
243
|
- qgrid skills ship with the CLI package, not a separate skills package. qgrid cannot be used with the AI SDK alone; a local qgrid CLI server is required, so CLI install is the right moment to sync `.agents/skills/qgrid` and `.claude/skills/qgrid` into the consuming project.
|
|
244
|
+
- Sonamu 0.11 (2.11.0) keeps qgrid-side workarounds instead of pinning back: the API build sets `NODE_ENV=production` (SON-567), CI creates an empty `packages/api/.env`, and `.oxlintrc.json` disables `no-unnecessary-type-assertion` for Sonamu's lint temp files (SON-564). Remove each workaround once the matching Sonamu issue ships. Peer ranges that upstream packages have not widened yet are allowed per parent in `pnpm-workspace.yaml` `peerDependencyRules.allowedVersions`, with the reason next to each entry.
|
|
244
245
|
|
|
245
246
|
## Image Generation
|
|
246
247
|
|
|
@@ -258,7 +259,7 @@ Key decisions:
|
|
|
258
259
|
- It is non-stream only. Codex returns completed base64 image payloads, not useful image deltas.
|
|
259
260
|
- Image turns send full input directly and retain no provider conversation state. This prevents base64 payloads from entering reusable state.
|
|
260
261
|
- qgrid performs preflight capability/model gates. Raw `imageGeneration: true` requires an image; `"auto"` allows normal text replies but still rejects attempted image generation without a completed image. Public `generateImage` requires one direct Images output per provider call; AI SDK batches requests for `n` outputs.
|
|
261
|
-
- Raw returned images are inline base64 content parts. The image SDK maps them to AI SDK `image`/`images` and takes references through standard `prompt: { text, images }`, with JSON data URL size guarding and HTTPS reference URL support. The language SDK forwards user-message images to `openai/` models as image input (image→text) and drops other image parts with an AI SDK `unsupported` warning.
|
|
262
|
+
- Raw returned images are inline base64 content parts. The image SDK maps them to AI SDK `image`/`images` and takes references through standard `prompt: { text, images }`, with JSON data URL size guarding and HTTPS reference URL support. The language SDK forwards user-message images to `openai/` and `grok/` models as image input (image→text) and drops other image parts with an AI SDK `unsupported` warning.
|
|
262
263
|
- Raw/server `imageGenerationOptions` supports quality, size, and background. The public image SDK uses flat `QgridImageProviderOptions` and standard top-level `size`. The subscription backend can ignore size and quality hints. Put desired ratios in the prompt, report observed output settings, and never silently resize. Reported image usage is priced at public token rates; without it, use the requested quality/size table with a default-size price for auto/custom hints. Preserve observed settings separately from pricing assumptions. No background-removal fallback is allowed.
|
|
263
264
|
- qgrid does not manage generated or reference images as durable assets through a `generated_images` table or object-storage layer. Current request logs can still contain inline image data URLs for inspection and synthetic `image_generation` tool-call steps; current-turn input images (image→text and image references) live in `request_logs.input_images`; older image-generation logs keep them only in the first synthetic step's `tool_args.inputImages`.
|
|
264
265
|
- Image cost is stored separately in `request_logs.image_cost_usd`; `request_logs.cost_usd` remains the Codex driver model token cost. Image costs use reported image usage at public token rates, or per-image quality/size estimates when usage is absent. Auto/custom sizes fall back to the 1536x1024 price; omitted quality uses medium. Rows and totals display combined costs as dollar amounts without Cost labels, without Known/Estimated labels or pricing disclaimers. Existing stored null costs are not backfilled; `totalCost.unknownImageCostCount` remains for API compatibility.
|
|
@@ -45,6 +45,10 @@ Refresh starts 300 seconds plus stable 0–60 second per-account jitter before e
|
|
|
45
45
|
|
|
46
46
|
`/billing?format=credits` is camelCase: qgrid reads `config.creditUsagePercent`, `config.currentPeriod`, and `config.prepaidBalance.val`. The observed period was seven days anchored at subscription start. Results are cached for 60 seconds; lookup failure fails open (`grok-quota.ts`, `grok-dispatcher.ts`, `docs/diagnosis/2026-10-16-grok-live-probe.md`).
|
|
47
47
|
|
|
48
|
+
The response is protobuf JSON, which omits zero-valued scalars: a period without measurable usage arrives without `creditUsagePercent`, so qgrid reads the missing field as 0%. Observed on a Free account on 2026-10-21, where the field stayed absent even after a small request. The period is fixed (it existed before the token's first request and did not move after one), so token-window keepalive does not apply to Grok; xAI documents one weekly pool and no short rolling window.
|
|
49
|
+
|
|
50
|
+
Dashboard usage (`QgridFrame.usage`) calls the dispatcher's `refreshUsage`, which runs the same prefetch with billing included even when no quota threshold is set, and waits up to 3 seconds for it. Without this, a token that never routed a request since boot reported no usage. The 60-second lookup cache bounds the extra xAI calls.
|
|
51
|
+
|
|
48
52
|
D6 excludes accounts when `/settings.on_demand_enabled` is `true`; `null`, `false`, or absence allows routing. Billing does not carry this field. D7 selects eligible accounts through the shared `SmoothWeightedRoundRobin`, using `tokens.weight`; a valid cache-affinity token remains preferred. `QGRID_GROK_MAX_INFLIGHT_PER_TOKEN` optionally excludes accounts at the cap, while omission leaves Grok uncapped (`grok-quota.ts`, `grok-dispatcher.ts`, `packages/api/src/utils/providers/common/smooth-weighted-round-robin.ts`).
|
|
49
53
|
|
|
50
54
|
## Failure and failover rules
|
|
@@ -74,9 +78,11 @@ Provider `cost_in_usd_ticks` is authoritative, including zero; one tick is `1e-1
|
|
|
74
78
|
|
|
75
79
|
Qgrid exposes image generation/editing, asynchronous video start/status, transcription, and speech through `api.x.ai`. Reference images select `/images/edits`; video uses `/videos/generations` and `/videos/{request_id}`; voice uses multipart `/stt` and JSON `/tts` (`grok-media-client.ts`, `grok-voice-client.ts`, `packages/api/src/application/qgrid/qgrid.frame.ts`).
|
|
76
80
|
|
|
81
|
+
Chat turns also accept `imageGeneration` (the dashboard chat sends `"auto"`): the dispatcher adds the proxy's server-side `{ "type": "image_generation" }` tool, and completed `image_generation_call` items (base64 JPEG, Grok Imagine) become `GenerateResult.images`, so generation and edits of earlier images work inside a conversation. `imageGenerationOptions` (OpenAI quality/size/background) is rejected. The turn's provider-reported cost already includes the image, so the request log stores `image_cost_usd = 0` with `image_cost_method = "included:grok-provider-cost"`. Verified 2026-10-21 through the subscription proxy; the model occasionally answers "I'll do it" without calling the tool (1 of 5 edit attempts).
|
|
82
|
+
|
|
77
83
|
Inline audio, each inline image, and the aggregate inline images in one request are capped at 7 MiB decoded. The server maps Fastify's oversized-body error to HTTP 413 (`packages/api/src/application/qgrid/qgrid.types.ts`, `qgrid.frame.ts`).
|
|
78
84
|
|
|
79
|
-
Video starts return a random 128-bit in-memory job handle. Handles expire after 24 hours, polling stays pinned to the starting token, and `projectName` must match the owner supplied at start. D4 returns the upstream `api.x.ai` video URL unchanged; qgrid does not fetch, proxy, or store the bytes (`qgrid.frame.ts`, `grok-media-client.ts`, `packages/ai-sdk/README.md`).
|
|
85
|
+
Video starts return a random 128-bit in-memory job handle. Handles expire after 24 hours, polling stays pinned to the starting token, and `projectName` must match the owner supplied at start. A started job is already admitted and billed, so `getVideo` polls with `ungated: true`: it checks only credential state (inactive, reauth, refresh failure) and skips the quota-threshold, cooldown, in-flight, on-demand, and ZDR gates that admit new requests. After the upstream poll returns, `videoStatus` re-checks `job.final`, so overlapping polls of a finished job write the request log once and return the same result. D4 returns the upstream `api.x.ai` video URL unchanged; qgrid does not fetch, proxy, or store the bytes (`qgrid.frame.ts`, `grok-media-client.ts`, `packages/ai-sdk/README.md`).
|
|
80
86
|
|
|
81
87
|
**ZDR and video.** xAI refuses `POST /v1/videos/generations` for Zero Data Retention accounts with HTTP 400 `invalid_request`: "Zero Data Retention teams must provide output.upload_url for video generation." The dispatcher therefore keeps a per-token `zdr` state and excludes `zdr === true` tokens from video only; chat, image, STT, and TTS still route. The primary signal is `codingDataRetentionOptOut` on `GET /user?include=subscription`, re-read on the 60 s prefetch with settings; `x-zero-data-retention: true` on a chat-proxy response confirms it, but its absence never clears it. Unknown state, or a failed `/user` read with no prior value, routes (fail open). If a video start still gets the ZDR 400, the token is marked ZDR, video is entitlement-blocked for an hour, and the start fails over under the media rules. With no eligible video token the caller gets `GrokZdrVideoUnavailableError` (HTTP 503) naming the tokens; usage exposes `zdrVideoExcluded`. Both signals were inferred from one account (plan §11). grok-build's remedy, a user-owned S3 presigned `output.upload_url`, is not implemented (`grok-dispatcher.ts`, `grok-quota.ts`).
|
|
82
88
|
|
|
@@ -9,6 +9,8 @@ Use this map to orient qgrid work quickly.
|
|
|
9
9
|
- `packages/web`: dashboard UI. Usually depends on Sonamu-generated API clients and API model shape.
|
|
10
10
|
- `packages/cli`: global `qgrid` command, bundled server boot, dependency checks, DB preflight, and qgrid Codex/Claude Code skill sync. The CLI package ships `skills/qgrid` and its `postinstall` links it into consuming projects.
|
|
11
11
|
- `scripts` and `packages/api/scripts`: smoke tests, debug scripts, runtime probes.
|
|
12
|
+
- `tools/oxlint/anti-slop`: vendored anti-slop oxlint JS plugin, loaded from `.oxlintrc.json` and enforced by `mise run check`. `@oxlint/plugins` must match the installed `oxlint` version.
|
|
13
|
+
- Toolchain: Sonamu 0.11 (CLI in `@sonamu-kit/cli`) and its required TypeScript `7.1.0-dev.20260831.1` in the root, api, cli, and web packages. `packages/ai-sdk` stays on TypeScript 5.9 because tsdown needs the TypeScript JS API to emit its `.d.ts`; `packages/cli` disables dts because it ships only a binary. Web `tsconfig.json` is a references-only solution file pointing at `tsconfig.app.json`, because Sonamu's web typecheck runs each project reference.
|
|
12
14
|
- `docs`: local planning, diagnosis, and solution history. `docs/WORKFLOW.md` is the collaboration convention.
|
|
13
15
|
|
|
14
16
|
## Deprecated/context-only package
|
|
@@ -31,6 +31,8 @@ A tool-result follow-up carries the returned `runContext` and tool results. The
|
|
|
31
31
|
|
|
32
32
|
Errors and client aborts finish the same parent as `error` or `aborted` and roll up usage, cost, fallback count, and cost provenance from every generate step that completed before termination. SSE client closure is authoritative regardless of the provider's abort error text; if a provider result arrives after closure, record its step usage and then leave the parent `aborted` without publishing `done`.
|
|
33
33
|
|
|
34
|
+
While the provider runs, dispatchers report facts as soon as they are known through `GenerateRequest.onProgress`, and `runProgressRecorder` writes them onto the parent only while it is still `running` (`RequestLogModel.recordRunProgress`): `token_name` after token selection (again on failover), `model_name` when the provider names the serving model (Grok `response.created`; Anthropic records the requested model at selection; OpenAI reports its model only at completion), and `ttft_ms` at the first delta of the run's first step. Writes are ordered and best-effort: a failure only logs. Usage, tokens, cost, and duration arrive with the final usage and stay at their defaults until then. The dashboard shows running rows with the requested → serving model and a running badge, and the list and detail pages poll every 3 seconds while a run is in progress.
|
|
35
|
+
|
|
34
36
|
Creating the initial `running` row is a precondition for a logger-enabled provider call. Once the provider has succeeded, however, a failure while appending or finalizing logs is best-effort: report the logging error and preserve the generated text/stream result instead of making logging failure replace a successful model result.
|
|
35
37
|
|
|
36
38
|
Stale cleanup must target old runs that still have unresolved tool-call steps; a long provider request with no pending tool call is not stale merely because its parent row is still running. Cleanup and arriving tool follow-ups share a PostgreSQL transaction advisory lock per request-log id and recheck the unresolved step after acquiring it, so cleanup cannot overwrite an in-flight follow-up across server processes.
|
|
@@ -128,6 +130,9 @@ TTFT is tracked by wrapping the first provider delta:
|
|
|
128
130
|
|
|
129
131
|
- OpenAI: first `response.output_text.delta` from the direct Responses stream.
|
|
130
132
|
- Anthropic: first text or structured partial JSON delta.
|
|
133
|
+
- Grok: first text delta of the chat attempt.
|
|
134
|
+
|
|
135
|
+
The same first-delta value is reported as run progress, so a running row shows TTFT before the response completes; the final value replaces it.
|
|
131
136
|
|
|
132
137
|
If missing, qgrid maps TTFT to `0` in `QueryOutput` and nullable/optional places as appropriate.
|
|
133
138
|
|
|
@@ -23,7 +23,7 @@ project, use that project's configured task and tool runner.
|
|
|
23
23
|
|
|
24
24
|
Root:
|
|
25
25
|
|
|
26
|
-
- `mise run check`: qgrid docs consistency, oxlint, and oxfmt check for the repo.
|
|
26
|
+
- `mise run check`: qgrid docs consistency, oxlint (including the vendored anti-slop rules in `tools/oxlint/anti-slop`, loaded by `.oxlintrc.json`), and oxfmt check for the repo. `mise run format` applies the auto-fixable rules, such as the blank-line spacing rule.
|
|
27
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.
|
|
28
28
|
- `mise run build`: recursive package build.
|
|
29
29
|
- `mise run dev`: parallel package dev servers.
|
|
@@ -35,8 +35,15 @@ API package `qgrid-api`:
|
|
|
35
35
|
- `mise exec -- pnpm --filter qgrid-api test`: both suites, unit first.
|
|
36
36
|
- `mise exec -- pnpm --filter qgrid-api test:watch`: DB-free watch mode; use `test:db --watch` for DB tests.
|
|
37
37
|
- `mise exec -- pnpm --filter qgrid-api test:coverage`: both suites, with separate `coverage/unit` and `coverage/db` reports.
|
|
38
|
-
- `mise exec -- pnpm --filter qgrid-api build`: Sonamu build.
|
|
39
|
-
- `mise exec -- pnpm --filter qgrid-api sonamu`: run Sonamu CLI.
|
|
38
|
+
- `mise exec -- pnpm --filter qgrid-api build`: Sonamu build, run as `NODE_ENV=production sonamu build`. Sonamu 0.11 sets `NODE_ENV=development` when it is unset and the web `vite build` child inherits it, which produced a development-mode dashboard bundle in 2.11.0 (SON-567). Keep the explicit `NODE_ENV` until Sonamu fixes it.
|
|
39
|
+
- `mise exec -- pnpm --filter qgrid-api sonamu`: run Sonamu CLI. Since Sonamu 0.11 the `sonamu` binary comes from the `@sonamu-kit/cli` devDependency, not from `sonamu` itself.
|
|
40
|
+
|
|
41
|
+
Sonamu sync after changing models, types, entities, or i18n:
|
|
42
|
+
|
|
43
|
+
1. Build first (`mise run build` or `sonamu build api`). `sonamu sync` reads models from `dist`, so a stale `dist` silently drops newer `@api` methods from generated services, queries, validators, and `.http` (SON-566).
|
|
44
|
+
2. Run `HOT=yes mise exec -- pnpm --dir packages/api sonamu sync`. `HOT=yes` loads `src/sonamu.config.ts`; without it Sonamu needs `dist/sonamu.config.js`, which a failed build deletes. Add `--force` only when `sonamu.lock` cannot be trusted, for example right after a merge.
|
|
45
|
+
3. `sync --force` always prints the "자동 생성한 파일에 대한 변경이 감지되었습니다" drift warning for generated files, even when nothing drifted (SON-565). Re-run plain `sync`; it should print `All files are synced!`.
|
|
46
|
+
4. Sonamu lints generated code with type-aware autofix in a temp file at the API root, where relative imports do not resolve. That fix strips the required `as unknown as SDReturnType<K>` casts from `sd.generated.ts` (SON-564). The `.oxlintrc.json` override for `**/.sonamu-oxlint-*.ts` turns that rule off; keep it until Sonamu fixes the temp-file location.
|
|
40
47
|
|
|
41
48
|
AI SDK package `@cartanova/qgrid-ai-sdk`:
|
|
42
49
|
|
|
@@ -154,7 +161,19 @@ Other scripts under `scripts/smoke-test-*` and `scripts/debug-*` are ad hoc prob
|
|
|
154
161
|
Generated SSE handlers missing a newly added event field:
|
|
155
162
|
|
|
156
163
|
- Sonamu's service generator reads runtime stream-decorator schemas. A stale API `dist` can keep the old event shape even with `sonamu sync --force`.
|
|
157
|
-
- 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.
|
|
164
|
+
- Run `mise exec -- pnpm --dir packages/api sonamu build api`, then `HOT=yes mise exec -- pnpm --dir packages/api sonamu sync --force`. Check the generated handler type and web typecheck; do not hand-edit generated services.
|
|
165
|
+
|
|
166
|
+
Dashboard throws `Module "" has been externalized for browser compatibility. Cannot access ".custom"` on load:
|
|
167
|
+
|
|
168
|
+
- The web bundle was built in development mode. `qs` → `side-channel` → `object-inspect` reads `require("./util.inspect").custom`; its `browser` field maps that file to `false`, which Vite turns into a throwing proxy outside production. Rebuild with `NODE_ENV=production` (the API `build` script sets it). A correct client bundle has no "externalized for browser compatibility" string.
|
|
169
|
+
|
|
170
|
+
`Missing Sonamu dotenv file`:
|
|
171
|
+
|
|
172
|
+
- Sonamu 0.11 refuses to start, including `sonamu build`, unless `packages/api/.env` or `.env.<NODE_ENV>` exists. The contents may be empty. CI creates an empty `packages/api/.env` before `mise run build`.
|
|
173
|
+
|
|
174
|
+
`sd.generated.ts` fails `tsc` with `Partial<MergedDictionary>[K] & {}` not assignable to `SDReturnType<K>`:
|
|
175
|
+
|
|
176
|
+
- The generated casts were stripped by Sonamu's post-generation lint (SON-564). Confirm the `.oxlintrc.json` override is present and re-run `HOT=yes ... sonamu sync --force`.
|
|
158
177
|
|
|
159
178
|
`NO_OPENAI_WORKERS`:
|
|
160
179
|
|
|
@@ -204,7 +223,7 @@ Generated SSE handlers missing a newly added event field:
|
|
|
204
223
|
|
|
205
224
|
`unsupported` warning with `feature: "image input"`:
|
|
206
225
|
|
|
207
|
-
- The language adapter dropped image parts: all of them on `anthropic/` models, and assistant-message images on any model. User-message images on `openai/` models are sent as image input. Reference-image editing belongs in `generateImage`'s `prompt: { text, images }`.
|
|
226
|
+
- The language adapter dropped image parts: all of them on `anthropic/` models, and assistant-message images on any model. User-message images on `openai/` and `grok/` models are sent as image input; `grok/` also drops `http:` URLs. Reference-image editing belongs in `generateImage`'s `prompt: { text, images }`.
|
|
208
227
|
|
|
209
228
|
`image generation is not supported on the Anthropic route`:
|
|
210
229
|
|