@cartanova/qgrid-cli 2.5.1 → 2.5.3

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 (30) hide show
  1. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +6 -2
  2. package/bundle/dist/application/qgrid/qgrid.frame.js +56 -24
  3. package/bundle/dist/application/qgrid/qgrid.types.js +5 -3
  4. package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +2 -2
  5. package/bundle/dist/utils/providers/anthropic/claude-session.js +9 -3
  6. package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +6 -4
  7. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +21 -1
  8. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +5 -3
  9. package/bundle/src/application/qgrid/qgrid.frame.test.ts +49 -0
  10. package/bundle/src/application/qgrid/qgrid.frame.ts +79 -26
  11. package/bundle/src/application/qgrid/qgrid.types.ts +4 -1
  12. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.test.ts +12 -0
  13. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +1 -1
  14. package/bundle/src/utils/providers/anthropic/claude-session.test.ts +19 -0
  15. package/bundle/src/utils/providers/anthropic/claude-session.ts +24 -2
  16. package/bundle/src/utils/providers/anthropic/stream-json-adapter.test.ts +66 -0
  17. package/bundle/src/utils/providers/anthropic/stream-json-adapter.ts +12 -3
  18. package/bundle/src/utils/providers/common/provider-dispatcher.ts +2 -0
  19. package/bundle/web-dist/client/assets/{index-X4A9Xo_5.js → index-DXdGBfB8.js} +3 -3
  20. package/bundle/web-dist/client/assets/{logs-BK0afqFW.js → logs-D_j1yxC4.js} +1 -1
  21. package/bundle/web-dist/client/assets/{monit-D-lgl5dR.js → monit-CIToyoxW.js} +1 -1
  22. package/bundle/web-dist/client/assets/{routes-CyRdgbvG.js → routes-Dd21A-wi.js} +1 -1
  23. package/bundle/web-dist/client/assets/{show-DpxKqqVU.js → show-DfePWRbc.js} +1 -1
  24. package/bundle/web-dist/client/assets/{tokens-9eO1FvFK.js → tokens-B4MV2fdk.js} +1 -1
  25. package/bundle/web-dist/client/index.html +1 -1
  26. package/bundle/web-dist/server/entry-server.generated.js +1 -1
  27. package/package.json +1 -1
  28. package/skills/qgrid/references/ai-sdk-provider-contract.md +8 -0
  29. package/skills/qgrid/references/anthropic-claude-code-runtime.md +36 -3
  30. package/skills/qgrid/references/decision-rationale.md +2 -0
@@ -30,6 +30,7 @@ Key decisions:
30
30
  - qgrid's AI SDK provider follows the AI SDK `LanguageModelV3` contract. Generic usage belongs to AI SDK docs; qgrid-specific docs should focus on qgrid routing, logging, cache/session behavior, and `providerOptions.qgrid`.
31
31
  - qgrid-specific options live under `providerOptions.qgrid`, not under provider-specific namespaces such as `providerOptions.openai`. Consumers should not need to branch on Codex versus Claude internals.
32
32
  - AI SDK exposes the outer `providerOptions` as a generic JSON record. `QgridProviderOptions` intentionally types the nested `providerOptions.qgrid` value, and examples should apply `satisfies` there to restore qgrid-specific inference without replacing AI SDK's outer contract.
33
+ - AI SDK's standard `timeout` owns the client-side total budget and reaches custom providers only as an `AbortSignal`. `providerOptions.qgrid.timeoutMs` separately owns the Anthropic server-side Claude process timer; keeping the two explicit avoids pretending the original AI SDK timeout number is available inside qgrid.
33
34
  - `projectName` is provider config/payload camelCase. `project_name` is the Sonamu/database request-log column. Prefer `QGRID_PROJECT_NAME` as the project-wide default so request logs and metrics remain filterable at volume.
34
35
  - `fallbackModels` may exist as a typed future option, but it is not a server wire contract until the server implements fallback routing. Do not forward it as behavior just because the type exists.
35
36
  - Fable 5 refusal fallback is an upstream Claude Code safety path to Opus 4.8, not qgrid's reserved `fallbackModels` feature or Claude Code's overload-only `--fallback-model` flag. qgrid observes and reports the actual route and provider cost; it must not retry again.
@@ -98,6 +99,7 @@ Key decisions:
98
99
  - Claude Code `stream-json` drops structural assistant role replay in the outbound API payload. qgrid flattens prior history into text because structural role replay through the CLI is not reliable.
99
100
  - Claude Code `--json-schema` is not constrained native tool calling. It creates a `StructuredOutput` tool and validates after model generation. Keep schemas strict and fail on non-success subtypes or retry exhaustion.
100
101
  - `MAX_STRUCTURED_OUTPUT_RETRIES=1` means one attempt. Do not set it to 0 expecting "no retry but one attempt"; that can mean no useful attempt.
102
+ - The retry pin is scoped to **streaming** structured calls only. SON-495 fixed retries to 1 because a retry inside a stream doubles wall-clock time — a latency argument that does not hold for non-streaming `generate`. Applying the pin to both paths made every non-streaming structured call fail on its first rejected attempt, and since Claude complies with structured output less reliably than OpenAI, that produced a 39.6% `error_max_structured_output_retries` rate for `deti_production` on Opus 4.8 (dev0, 2026-07). Non-streaming now uses Claude Code's default retry budget; `includePartialMessages` is the streaming discriminator.
101
103
  - 1M context support is measured per model and is a mitigation, not a guarantee. It reduces compaction/hang frequency for huge prompts, but does not make every structured prompt reliable.
102
104
  - Spawn env must be whitelisted. Never pass inherited `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `ANTHROPIC_BASE_URL` unless intentionally building an API-key/proxy path.
103
105
  - `--setting-sources project` is required for shared-service isolation. User/local Claude settings can load hooks or memory and leak context across requests.