@cartanova/qgrid-cli 2.17.1 → 2.19.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.
Files changed (53) hide show
  1. package/README.ko.md +26 -0
  2. package/README.md +29 -0
  3. package/bundle/dist/_virtual/_rolldown/runtime.js +1 -0
  4. package/bundle/dist/application/qgrid/qgrid.frame.js +32 -44
  5. package/bundle/dist/application/qgrid/qgrid.types.js +5 -4
  6. package/bundle/dist/startup-migrations.js +1 -1
  7. package/bundle/dist/utils/providers/common/model-cost.js +10 -18
  8. package/bundle/dist/utils/providers/common/schema-validation.js +2 -2
  9. package/bundle/dist/utils/providers/grok/grok-types.js +3 -2
  10. package/bundle/dist/utils/providers/grok/grok-voice-client.js +12 -6
  11. package/bundle/dist/utils/providers/openai/openai-dispatcher.js +3 -2
  12. package/bundle/dist/utils/providers/openai/openai-realtime-protocol.js +4 -8
  13. package/bundle/dist/utils/speech-aligner.js +302 -0
  14. package/bundle/dist/utils/speech-alignment.js +2 -102
  15. package/bundle/src/application/qgrid/qgrid.frame.test.ts +56 -17
  16. package/bundle/src/application/qgrid/qgrid.frame.ts +46 -50
  17. package/bundle/src/application/qgrid/qgrid.types.ts +16 -11
  18. package/bundle/src/application/sonamu.generated.http +1 -0
  19. package/bundle/src/utils/providers/common/model-cost.ts +0 -1
  20. package/bundle/src/utils/providers/common/schema-validation.ts +1 -1
  21. package/bundle/src/utils/providers/grok/grok-types.ts +1 -0
  22. package/bundle/src/utils/providers/grok/grok-voice-client.test.ts +7 -4
  23. package/bundle/src/utils/providers/grok/grok-voice-client.ts +14 -1
  24. package/bundle/src/utils/providers/openai/openai-dispatcher.test.ts +18 -0
  25. package/bundle/src/utils/providers/openai/openai-dispatcher.ts +6 -1
  26. package/bundle/src/utils/providers/openai/openai-realtime-protocol.ts +3 -7
  27. package/bundle/src/utils/speech-aligner.test.ts +100 -0
  28. package/bundle/src/utils/speech-aligner.ts +435 -0
  29. package/bundle/src/utils/speech-alignment.test.ts +2 -50
  30. package/bundle/src/utils/speech-alignment.ts +1 -141
  31. package/bundle/web-dist/client/assets/{index-D56cIqxW.js → index-DYYtV8Qx.js} +3 -3
  32. package/bundle/web-dist/client/assets/{logs-pMW62Hvw.js → logs-CbDtQif1.js} +1 -1
  33. package/bundle/web-dist/client/assets/{monit-COC4S7gf.js → monit-DtW8o_yF.js} +1 -1
  34. package/bundle/web-dist/client/assets/{routes-C38qmify.js → routes-Dw227enb.js} +1 -1
  35. package/bundle/web-dist/client/assets/{settings-BWGSVpiQ.js → settings-BXmAToY1.js} +1 -1
  36. package/bundle/web-dist/client/assets/{show-aQTLNz5k.js → show-5qj6wFgp.js} +2 -2
  37. package/bundle/web-dist/client/assets/{tokens-Ha8SwMPG.js → tokens-D8L8AC4v.js} +1 -1
  38. package/bundle/web-dist/client/assets/{use-oauth-login-flow-JoEnKQis.js → use-oauth-login-flow-BcEUkszt.js} +1 -1
  39. package/bundle/web-dist/client/assets/{use-update-token-mutation-cdCVcOY5.js → use-update-token-mutation-Ca0n_WnM.js} +1 -1
  40. package/bundle/web-dist/client/assets/voice-D-c1Eyp3.js +1 -0
  41. package/bundle/web-dist/client/index.html +1 -1
  42. package/bundle/web-dist/server/assets/{show-B_l5dOcT.js → show-CnLDFCtW.js} +2 -5
  43. package/bundle/web-dist/server/assets/{voice-CHoPEIfo.js → voice-BvAl-vTr.js} +32 -8
  44. package/bundle/web-dist/server/entry-server.generated.js +3 -3
  45. package/dist/cli.js +141 -3
  46. package/package.json +1 -1
  47. package/skills/qgrid/references/ai-sdk-provider-contract.md +1 -1
  48. package/skills/qgrid/references/cli-env-and-server-boot.md +1 -0
  49. package/skills/qgrid/references/grok-runtime.md +5 -3
  50. package/skills/qgrid/references/openai-codex-runtime.md +3 -1
  51. package/skills/qgrid/references/request-log-run-lifecycle.md +1 -1
  52. package/skills/qgrid/references/sonamu-api-web-flow.md +2 -2
  53. package/bundle/web-dist/client/assets/voice-COmvUTZO.js +0 -1
package/README.ko.md CHANGED
@@ -100,6 +100,7 @@ CLI는 실행 시 npm의 최신 버전을 확인하고 patch를 포함해 설치
100
100
  | 변수 | 설명 | 기본값 |
101
101
  |------|------|--------|
102
102
  | `NODE_ENV` | Sonamu 실행 프로필. 원격 비프로덕션 배포에는 `staging` 사용 | `production` |
103
+ | `QGRID_ALIGNER_MODEL` | 음성 정렬 모델 경로(아래 참고) | `~/.cache/qgrid/models/mms-300m-fa-int8.onnx`, Docker 이미지는 따로 설정 |
103
104
 
104
105
  ## 사전 요구사항
105
106
 
@@ -108,6 +109,31 @@ CLI는 실행 시 npm의 최신 버전을 확인하고 patch를 포함해 설치
108
109
  - Docker (로컬 PostgreSQL을 컨테이너로 실행할 경우)
109
110
  - [Claude Code](https://www.anthropic.com/claude-code) (Anthropic 모델 사용 시)
110
111
 
112
+ ## 음성 정렬기
113
+
114
+ OpenAI realtime 음성 합성과 전사는 타이밍을 주지 않아서, qgrid가 내장 정렬기로 텍스트를 오디오에 맞춥니다. 음성 합성의
115
+ `withTimestamps`와 전사 결과의 단어 타이밍(`words`)이 여기서 나옵니다. 정렬기는 int8로 양자화한 MMS-FA 모델(Meta,
116
+ CC BY-NC 4.0, 비상업)과 이를 돌리는 `onnxruntime-node`입니다. Docker 이미지에는 둘 다 들어 있습니다. npm이나 pnpm으로 설치했다면 한 번 실행합니다:
117
+
118
+ ```bash
119
+ qgrid --install-aligner
120
+ ```
121
+
122
+ 모델(355 MB)과 `onnxruntime-node` 1.31.1(115 MB, 현재 플랫폼 바이너리만 남김)을 `~/.cache/qgrid`에 받고, 파일마다
123
+ 해시를 확인한 뒤 끝납니다. npm이나 pnpm을 거치지 않아서 qgrid를 어떻게 설치했든 똑같이 동작합니다. 소스 체크아웃을
124
+ `sonamu dev`로 띄울 때는 모델 파일만 있으면 됩니다(`onnxruntime-node`는 api devDependency로 이미 들어 있음):
125
+
126
+ ```bash
127
+ mkdir -p ~/.cache/qgrid/models
128
+ curl -fL -o ~/.cache/qgrid/models/mms-300m-fa-int8.onnx \
129
+ https://github.com/cartanova-ai/qgrid/releases/download/aligner-model-v1/mms-300m-fa-int8.onnx
130
+ ```
131
+
132
+ `QGRID_ALIGNER_MODEL`로 모델 경로를 바꿀 수 있습니다. 정렬기가 없으면 CLI가 시작할 때 경고하고, OpenAI 음성 합성은
133
+ `timestampsError`를, OpenAI 전사는 단어 타이밍 없는 결과를 돌려줍니다(Grok 타이밍은 영향 없음). 정렬에는 클립 길이의 약
134
+ 5%만큼 시간이 더 들고, 빽빽한 음성 기준 약 4분까지 됩니다. 그보다 긴 오디오는 타이밍 없이 돌려줍니다. 모델은 처음 쓸 때
135
+ 올라가고(대기 중 메모리 약 640MB, 1-4분 클립 정렬 중 1.4-1.8GB), 10분 동안 쓰지 않으면 내려갑니다.
136
+
111
137
  ## 동작 방식
112
138
 
113
139
  CLI는 Sonamu 기반 서버를 내장 번들로 포함. 실행 시:
package/README.md CHANGED
@@ -101,6 +101,7 @@ Server behavior variables:
101
101
  | Variable | Description | Default |
102
102
  |------|------|--------|
103
103
  | `NODE_ENV` | Sonamu runtime profile. Set `staging` for a remote non-production deployment | `production` |
104
+ | `QGRID_ALIGNER_MODEL` | Path to the speech aligner model (see below) | `~/.cache/qgrid/models/mms-300m-fa-int8.onnx`; the Docker image sets its own |
104
105
 
105
106
  ## Prerequisites
106
107
 
@@ -109,6 +110,34 @@ Server behavior variables:
109
110
  - Docker (if running PostgreSQL locally as a container)
110
111
  - [Claude Code](https://www.anthropic.com/claude-code) (for Anthropic models)
111
112
 
113
+ ## Speech aligner
114
+
115
+ OpenAI realtime speech and transcription carry no timing, so qgrid force-aligns the text to the audio
116
+ with a built-in aligner: speech `withTimestamps` and transcript word timing (`words`). The aligner is
117
+ the MMS-FA model (Meta, CC BY-NC 4.0, non-commercial) quantized to int8, run by `onnxruntime-node`. The
118
+ Docker image includes both. On an npm or pnpm install, run once:
119
+
120
+ ```bash
121
+ qgrid --install-aligner
122
+ ```
123
+
124
+ It downloads the model (355 MB) and `onnxruntime-node` 1.31.1 (115 MB, keeping only this platform's
125
+ binary) into `~/.cache/qgrid`, checks each file's hash, and exits. It does not use npm or pnpm, so it
126
+ works however qgrid was installed. A source checkout run with `sonamu dev` needs only the model file
127
+ (`onnxruntime-node` is an api devDependency there):
128
+
129
+ ```bash
130
+ mkdir -p ~/.cache/qgrid/models
131
+ curl -fL -o ~/.cache/qgrid/models/mms-300m-fa-int8.onnx \
132
+ https://github.com/cartanova-ai/qgrid/releases/download/aligner-model-v1/mms-300m-fa-int8.onnx
133
+ ```
134
+
135
+ `QGRID_ALIGNER_MODEL` overrides the model path. Without the aligner the CLI warns at startup, OpenAI
136
+ speech returns `timestampsError`, and OpenAI transcripts come without word timing (Grok timing is
137
+ unaffected). Alignment adds about 5% of the clip length to a request and covers about 4 minutes of
138
+ dense speech; longer audio gets no timing. The model loads on first use (about 640 MB of memory at rest,
139
+ 1.4-1.8 GB while aligning 1-4 minute clips) and unloads after 10 idle minutes.
140
+
112
141
  ## How it works
113
142
 
114
143
  The CLI ships the Sonamu-based server as a built-in bundle. On launch:
@@ -1,3 +1,4 @@
1
+ import "node:module";
1
2
  //#region \0rolldown/runtime.js
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;