@h-ai/cli 1.0.0-beta.6 → 1.0.0-beta.8
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/README.en.md +9 -9
- package/README.ja.md +9 -9
- package/README.md +9 -9
- package/dist/{chunk-4XVCGFBA.js → chunk-MEEFB4BI.js} +552 -11
- package/dist/chunk-MEEFB4BI.js.map +1 -0
- package/dist/{chunk-STWZQ3IP.js → chunk-SGWSVWZ5.js} +588 -11
- package/dist/chunk-SGWSVWZ5.js.map +1 -0
- package/dist/cli-config-templates-SVV3633D.js +5 -0
- package/dist/{cli-config-templates-YGPVNRX5.js.map → cli-config-templates-SVV3633D.js.map} +1 -1
- package/dist/index.js +97 -78
- package/dist/index.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/{src-NXCCU6GO.js → src-IW4CY2IN.js} +3 -3
- package/dist/src-IW4CY2IN.js.map +1 -0
- package/package.json +16 -12
- package/templates/apps/api/apps/{{projectName}}-serv/config/_serv.yml.hbs +1 -1
- package/templates/apps/api/apps/{{projectName}}-serv/src/app.ts.hbs +6 -2
- package/templates/apps/api/apps/{{projectName}}-serv/tests/service.test.ts.hbs +29 -3
- package/templates/apps/fullstack/.gitignore.hbs +7 -2
- package/templates/apps/fullstack/apps/{{projectName}}-app/README.md.hbs +2 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/package.json.hbs +1 -1
- package/templates/apps/fullstack/packages/{{projectName}}-serv/README.md.hbs +2 -2
- package/templates/apps/mobile-app/messages/en-US.json +1 -1
- package/templates/apps/mobile-app/messages/ja-JP.json +1 -1
- package/templates/apps/mobile-app/messages/zh-CN.json +1 -1
- package/templates/apps/mobile-app/src/lib/api.ts.hbs +8 -5
- package/templates/base/.gitignore.hbs +7 -2
- package/templates/base/e2e/app.spec.ts.hbs +9 -4
- package/templates/base/package.json.hbs +7 -2
- package/templates/skills/hai-ai/SKILL.md +6 -2
- package/templates/skills/hai-ai/acp.md +145 -0
- package/templates/skills/hai-ai/guide.md +1 -1
- package/templates/skills/hai-ai/reference.md +1 -1
- package/templates/skills/hai-ai/resources.md +69 -0
- package/templates/skills/hai-api-client/reference.md +2 -0
- package/templates/skills/hai-app-create/development.md +1 -1
- package/templates/skills/hai-app-create/reference.md +1 -1
- package/templates/skills/hai-build/SKILL.md +1 -1
- package/templates/skills/hai-build/reference.md +1 -1
- package/templates/skills/hai-cache/reference.md +6 -2
- package/templates/skills/hai-ci/SKILL.md +2 -0
- package/templates/skills/hai-core/SKILL.md +1 -1
- package/templates/skills/hai-crypto/reference.md +2 -0
- package/templates/skills/hai-payment/reference.md +39 -17
- package/templates/skills/hai-reach/reference.md +15 -7
- package/templates/skills/hai-reldb/reference.md +5 -2
- package/templates/skills/hai-scheduler/reference.md +1 -1
- package/templates/skills/hai-storage/reference.md +8 -2
- package/templates/skills/hai-vecdb/reference.md +7 -2
- package/dist/chunk-4XVCGFBA.js.map +0 -1
- package/dist/chunk-STWZQ3IP.js.map +0 -1
- package/dist/cli-config-templates-YGPVNRX5.js +0 -5
- package/dist/src-NXCCU6GO.js.map +0 -1
package/README.en.md
CHANGED
|
@@ -23,12 +23,12 @@ Use `hai` to create applications, add modules, generate starter code, build and
|
|
|
23
23
|
|
|
24
24
|
Use Node.js matching `engines` (`^22.23.4 || ^24.22.1 || ^26.12.1`) and pnpm 12.11.2. In PowerShell use `pnpm.cmd`.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Inspect the published channels and install latest. Check supported options with `hai create --help`; validate unreleased source features using the local development steps below.
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
29
|
pnpm view @h-ai/cli dist-tags
|
|
30
|
-
pnpm view @h-ai/cli@
|
|
31
|
-
pnpm add -g @h-ai/cli@
|
|
30
|
+
pnpm view @h-ai/cli@latest version
|
|
31
|
+
pnpm add -g @h-ai/cli@latest
|
|
32
32
|
hai --version
|
|
33
33
|
hai --help
|
|
34
34
|
```
|
|
@@ -38,7 +38,7 @@ Generated framework dependencies use the exact CLI version. Installation failure
|
|
|
38
38
|
### Create an application
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
hai create my-app --type fullstack --frontends web
|
|
41
|
+
hai create my-app --type fullstack --frontends web
|
|
42
42
|
cd my-app
|
|
43
43
|
pnpm dev
|
|
44
44
|
```
|
|
@@ -54,13 +54,13 @@ Omit options for interactive choices, or use `--defaults` for defaults. Installa
|
|
|
54
54
|
| `mobile-app` | Svelte + Vite + Capacitor |
|
|
55
55
|
| `fullstack` | Contract, API, shared UI and selected Web/App/Desktop; miniapp is a placeholder |
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Each template installs only the modules it uses: admin/h5 include authentication, OTP/password-reset notifications, database, cache and crypto; website uses Core/Kit/UI; API includes authentication, notifications, uploads and feedback; fullstack retains administration, audit, storage, notifications, scheduling and feedback; mobile-app uses client capabilities only. AI, payment, vecdb and datapipe are not installed by default. Every project retains complete module YAML and `.env.example` references, with unused settings commented out and excluded from public environment defaults. To add a feature, install its dependencies, enable the required configuration and wire initialization, cleanup and business routes. Adding a dependency does not enable features automatically. `--template`, `--features` and `--examples/--no-examples` remain removed; `create --yes/-y` is now `--defaults`. Old options fail explicitly. `deploy --yes` keeps its meaning; existing projects are not automatically trimmed.
|
|
58
58
|
|
|
59
59
|
Standalone `mobile-app` includes frontend crypto and encrypted typed-client transport. For an existing plaintext API, explicitly set `PUBLIC_API_TRANSPORT=off`. `PUBLIC_API_KEY_EXCHANGE_PATH` overrides the public exchange subpath. Handshake failures never fall back, server private keys never enter clients, and cleanup closes transport before client-owned crypto.
|
|
60
60
|
|
|
61
61
|
### Static websites and GitHub Pages
|
|
62
62
|
|
|
63
|
-
New websites
|
|
63
|
+
New websites default to Node SSR and install only Core/Kit/UI, so they can use the static build below directly. Remove any server business dependencies, initialization or custom APIs/actions added later before publishing statically. Commented configuration and environment references do not affect static builds.
|
|
64
64
|
|
|
65
65
|
Website defaults to Node SSR. Set `HAI_BUILD_STATIC=1` and `PUBLIC_BASE_PATH=/docs-site` (replace docs-site with the repository name; segments allow only ASCII letters, digits, _, . and -; no trailing slash, empty for a root site) for `pnpm build` to generate the static build directory. The static flag accepts 0/1 and applies only to compile. PUBLIC_BASE_PATH also supports Docker website builds; native app/desktop targets reject website paths. Static builds reject server-side business modules, custom APIs/actions and pages that were not prerendered, preserve production guards and use no SPA fallback. The default health API is excluded.
|
|
66
66
|
|
|
@@ -88,7 +88,7 @@ Public settings live in `.env` and `.env.<mode>`; SSH settings and credentials g
|
|
|
88
88
|
|
|
89
89
|
### Existing projects and code generation
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
`hai add ai` also installs reldb and vecdb. Integrate startup in database → vector store → AI order, with reverse cleanup and explicit cleanup failure handling. Production profiles select PostgreSQL (or the chosen MySQL), Redis, S3 and Qdrant for enabled modules, using Compose DNS names `db/cache/storage/vecdb`. Inject database/cache passwords, S3 credentials, model keys and protected Qdrant keys privately. Override internal addresses when running outside Compose. Production Reach intentionally rejects an empty provider array until a real `HAI_REACH_PROVIDERS` JSON secret is supplied. `hai add` preserves configured production values, adds missing fields, and requires integration into the existing application entry point.
|
|
92
92
|
|
|
93
93
|
```sh
|
|
94
94
|
hai add storage
|
|
@@ -101,7 +101,7 @@ hai generate model order
|
|
|
101
101
|
hai generate migration add-orders
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
`hai add` resolves module dependencies and fills configuration. `hai init` fills missing configuration and AI files while preserving custom content. `--force` regenerates module configuration; review the diff before using it.
|
|
104
|
+
`hai add` resolves module dependencies and fills configuration. `hai init` fills missing configuration and AI files while preserving custom content. `--force` regenerates module configuration; review the diff before using it. Already listed modules are checked for missing transitive dependencies and workspace catalog entries. Rerun the same command after an earlier failed install; existing versions, comments and configured values are preserved.
|
|
105
105
|
|
|
106
106
|
Pages use SvelteKit file routes. APIs use either SvelteKit routes or the target serv application's shared contract/procedure structure. API/fullstack roots select a unique backend automatically; use `--workspace <package-name-or-relative-path>` when multiple applications apply, or enter the target workspace. Plain Vite page/API combinations are rejected. Serv does not accept `--output`; SvelteKit route output must stay inside `src/routes`; custom `kit.files` layouts are rejected rather than guessed. SvelteKit API targets must already install `@h-ai/kit` and `zod`. Serv updates only existing aggregation points with `@hai-generator` markers; unknown structures require manual integration. Names cannot contain paths. Existing files require `--force`, which never replaces registered business domains. Files are checked as one batch and rolled back on write failure. Migrations only generate up/down functions; inspect data effects before running them.
|
|
107
107
|
|
|
@@ -200,7 +200,7 @@ The [fullstack security configuration guide template](templates/apps/fullstack/d
|
|
|
200
200
|
|
|
201
201
|
### Feedback and offline analysis
|
|
202
202
|
|
|
203
|
-
A new `hai create my-app --type fullstack --frontends web
|
|
203
|
+
A new `hai create my-app --type fullstack --frontends web` includes feedback by default; API projects also include it without additional options. Members and business operators can submit reports. Only `business_operator` sees the review menu and can read, process, reopen or export reports. Database, storage, reach and authentication dependencies are included. Fullstack provides intake, paginated review and server contracts; API projects provide the server contracts. Production uses shared DB and private S3. Notifications independently select `disabled`, `console` or `reach`; `console` defaults to `metadata` only. Select `consoleContent: summary` explicitly for summaries, or configure Reach providers and recipients for actual delivery.
|
|
204
204
|
|
|
205
205
|
Register collectEvidence through feedback.init(config, { collectEvidence }) to await business text or archives. _feedback.yml includes businessCollectionTimeoutMs and webhookUrl/webhookSecret/webhookTimeoutMs. Webhook delivery retries durably and exposes status and administrator retry in details. Keep secrets in private server environment settings; see [feedback examples](../feedback/README.en.md).
|
|
206
206
|
|
package/README.ja.md
CHANGED
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
|
|
24
24
|
Node.js は `engines`(`^22.23.4 || ^24.22.1 || ^26.12.1`)に合わせ、pnpm 12.11.2 を使用します。PowerShell では `pnpm.cmd` を使用してください。
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
公開チャネルを確認して latest をインストールします。`hai create --help` で対応オプションを確認し、未公開機能は下記のローカル開発手順で検証してください。
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
29
|
pnpm view @h-ai/cli dist-tags
|
|
30
|
-
pnpm view @h-ai/cli@
|
|
31
|
-
pnpm add -g @h-ai/cli@
|
|
30
|
+
pnpm view @h-ai/cli@latest version
|
|
31
|
+
pnpm add -g @h-ai/cli@latest
|
|
32
32
|
hai --version
|
|
33
33
|
hai --help
|
|
34
34
|
```
|
|
@@ -38,7 +38,7 @@ hai --help
|
|
|
38
38
|
### アプリの作成
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
hai create my-app --type fullstack --frontends web
|
|
41
|
+
hai create my-app --type fullstack --frontends web
|
|
42
42
|
cd my-app
|
|
43
43
|
pnpm dev
|
|
44
44
|
```
|
|
@@ -54,13 +54,13 @@ pnpm dev
|
|
|
54
54
|
| `mobile-app` | Svelte + Vite + Capacitor |
|
|
55
55
|
| `fullstack` | contract、API、共通 UI、選択した Web/App/Desktop。miniapp は説明のみ |
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
各テンプレートは実際に使うモジュールだけを導入します。admin/h5 は認証・OTP/パスワード再設定の通知・DB・キャッシュ・暗号化、website は Core/Kit/UI、API は認証・通知・アップロード・feedback、fullstack は管理画面の認証・監査・保存・通知・スケジューラー・feedback、mobile-app はクライアント機能を使用します。AI、payment、vecdb、datapipe は既定で導入しません。全工程に完全なモジュール YAML と `.env.example` を残し、未使用項目はコメントにして公開環境の既定値から除外します。後で依存を追加し、必要な設定を有効にして初期化・終了・業務ルートを接続します。依存追加だけでは自動的に有効になりません。`--template`、`--features`、`--examples/--no-examples` は削除済みで、`create --yes/-y` は `--defaults` です。旧引数は明示的に拒否し、`deploy --yes` の意味は維持します。既存工程の依存は自動削除しません。
|
|
58
58
|
|
|
59
59
|
独立した `mobile-app` は frontend crypto と暗号化 typed client transport を含みます。既存の平文 API には `PUBLIC_API_TRANSPORT=off` を明示します。`PUBLIC_API_KEY_EXCHANGE_PATH` は公開鍵交換パスの上書きです。失敗時に平文へ切り替えず、サーバー秘密鍵はクライアントに渡しません。終了時は transport、その後に自身の crypto を解放します。
|
|
60
60
|
|
|
61
61
|
### 静的websiteとGitHub Pages
|
|
62
62
|
|
|
63
|
-
新規 website
|
|
63
|
+
新規 website は既定で Node SSR、依存は Core/Kit/UI のみで、下記の静的構築をそのまま利用できます。後から追加したサーバー業務依存・初期化・独自 API/actions は静的公開前に除去します。コメントの設定と環境変数の参考例は静的構築に影響しません。
|
|
64
64
|
|
|
65
65
|
websiteの既定はNode SSRです。ビルド時に`HAI_BUILD_STATIC=1`と`PUBLIC_BASE_PATH=/docs-site`(docs-siteを実際のリポジトリー名に置換。各区間はASCII英数字・_・.・-のみ、末尾/なし、ルートは空)を指定してpnpm buildを実行すると静的buildを生成します。静的フラグは0/1のみでcompile専用です。PUBLIC_BASE_PATHはDockerのWeb構築にも対応しますが、ネイティブapp/desktopでは指定できません。静的構築はサーバー業務モジュール、独自API/actions、事前描画されないページを拒否し、本番ガードを緩和せずSPAフォールバックも生成しません。既定のhealth APIは含めません。
|
|
66
66
|
|
|
@@ -88,7 +88,7 @@ Docker構築でもPUBLIC_BASE_PATHを明示できます。非ルートではwebB
|
|
|
88
88
|
|
|
89
89
|
### 既存工程とコード生成
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
`hai add ai` は reldb と vecdb も導入します。その後、アプリの入口に DB → ベクトル保存先 → AI の順の初期化と逆順の終了処理を接続し、終了処理の失敗も確認します。本番設定は有効な機能に応じて PostgreSQL(選択済み MySQL は保持)・Redis・S3・Qdrant を選び、Compose の `db/cache/storage/vecdb` を使います。パスワード・S3 認証情報・モデルキー・保護された Qdrant キーは秘密環境から注入し、Compose 外では接続先を上書きしてください。本番 Reach は空 Provider 配列で起動を拒否し、実際の `HAI_REACH_PROVIDERS` JSON の注入が必要です。`hai add` は既存本番値を保持して不足項目を追加します。既存の起動処理への接続はアプリ側で行います。
|
|
92
92
|
|
|
93
93
|
```sh
|
|
94
94
|
hai add storage
|
|
@@ -101,7 +101,7 @@ hai generate model order
|
|
|
101
101
|
hai generate migration add-orders
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
`hai add` は依存を解決して設定を追加します。`hai init` は不足する設定と AI ファイルを補い、独自内容は保持します。`--force` はモジュール設定を再生成するため、差分を確認して使用してください。
|
|
104
|
+
`hai add` は依存を解決して設定を追加します。`hai init` は不足する設定と AI ファイルを補い、独自内容は保持します。`--force` はモジュール設定を再生成するため、差分を確認して使用してください。 既存モジュールも推移的依存と workspace catalog の不足を検査します。旧版でインストールに失敗した場合は同じコマンドを再実行でき、既存の版・コメント・設定値を保持します。
|
|
105
105
|
|
|
106
106
|
page は SvelteKit のファイルルートに対応し、api は対象アプリに応じて SvelteKit または serv の共有 contract/procedure を生成します。API/fullstack のルートでは一意なバックエンドを自動選択します。複数候補は `--workspace <パッケージ名または相対パス>` で指定するか、対象 workspace に移動してください。通常の Vite への page/api 生成は拒否します。serv は `--output` を受け付けず、SvelteKit の出力は `src/routes` 内に限定し、独自の `kit.files` は推測せず拒否します。SvelteKit API には `@h-ai/kit` と `zod` が必要です。serv は `@hai-generator` マーカーのある既存の集約入口だけを更新し、未知の構成には手動統合を要求します。名前にパスは指定できません。既存ファイルは `--force` が必要ですが、登録済み業務領域は置換しません。一括検査後に書き込み、失敗時は今回の変更を戻します。マイグレーションは up/down 関数のみ生成するため、実行前にデータへの影響を確認してください。
|
|
107
107
|
|
|
@@ -202,7 +202,7 @@ fullstack 例はアプリ設定で `admin`、`audit_admin`、`config_admin`、`b
|
|
|
202
202
|
|
|
203
203
|
feedback.init(config, { collectEvidence }) で業務の本文・ZIP を非同期収集できます。_feedback.yml は businessCollectionTimeoutMs と webhookUrl/webhookSecret/webhookTimeoutMs を提供します。Webhook は永続再試行と詳細画面での状態確認・再試行に対応し、秘密はサーバー非公開環境に保存します。[feedback の例](../feedback/README.ja.md) を参照してください。
|
|
204
204
|
|
|
205
|
-
`hai create my-app --type fullstack --frontends web
|
|
205
|
+
`hai create my-app --type fullstack --frontends web` は問題報告を既定で有効にし、API 工程にも追加引数なしで feedback を含めます。一般会員と業務操作員が報告でき、管理メニューの表示と閲覧・処理・再開・エクスポートは `business_operator` に限定します。DB・ストレージ・通知・認証の依存を補い、Fullstack では収集、ページ一覧とサーバー API、API 工程ではサーバー API を生成します。本番では共有 DB と非公開 S3 を使用します。通知は `disabled`、`console`、`reach` を独立に選び、`console` の既定は `metadata` のみです。要約は `consoleContent: summary` を明示し、実送信が必要な場合に Reach 通路と受信者を設定します。
|
|
206
206
|
|
|
207
207
|
`hai feedback summary <bundle.zip>`、`inspect`、`evidence --request-id <ID> --page 1 --page-size 20`、`view` で本番へ接続せず分析できます。表示はloopbackのみで待機し、Ctrl+Cで閉じます。
|
|
208
208
|
|
package/README.md
CHANGED
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
|
|
24
24
|
需要符合项目 `engines` 的 Node.js(`^22.23.4 || ^24.22.1 || ^26.12.1`)与 pnpm 12.11.2。PowerShell 使用 `pnpm.cmd`。
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
先查询已发布渠道,再安装当前 latest。使用 `hai create --help` 核对所安装版本支持的选项;尚未发布的源码能力按下方本地开发步骤验证。
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
29
|
pnpm view @h-ai/cli dist-tags
|
|
30
|
-
pnpm view @h-ai/cli@
|
|
31
|
-
pnpm add -g @h-ai/cli@
|
|
30
|
+
pnpm view @h-ai/cli@latest version
|
|
31
|
+
pnpm add -g @h-ai/cli@latest
|
|
32
32
|
hai --version
|
|
33
33
|
hai --help
|
|
34
34
|
```
|
|
@@ -38,7 +38,7 @@ hai --help
|
|
|
38
38
|
### 创建项目
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
hai create my-app --type fullstack --frontends web
|
|
41
|
+
hai create my-app --type fullstack --frontends web
|
|
42
42
|
cd my-app
|
|
43
43
|
pnpm dev
|
|
44
44
|
```
|
|
@@ -54,13 +54,13 @@ pnpm dev
|
|
|
54
54
|
| `mobile-app` | Svelte + Vite + Capacitor |
|
|
55
55
|
| `fullstack` | contract、API、共享界面与所选 Web/App/Desktop;miniapp 仅预留说明 |
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
每个模板只安装实际使用的模块:admin/h5 包含认证、验证码及找回密码通知,以及数据库、缓存、加密依赖;website 只包含 Core/Kit/UI;API 包含认证、通知、上传和反馈;fullstack 保留管理后台的认证、审计、存储、通知、调度和反馈;mobile-app 只使用客户端能力。AI、payment、vecdb、datapipe 不默认安装。所有项目保留完整模块 YAML 和 `.env.example`,未启用项以注释提供,只有已启用项进入公共环境默认值。后续添加对应依赖、取消所需配置注释,再接入初始化、关闭及业务路由;添加依赖不会自动启用功能。`--template`、`--features`、`--examples/--no-examples` 已删除,`create --yes/-y` 改为 `--defaults`,旧参数明确报错;`deploy --yes` 保持原义。已有工程不会自动裁剪依赖。
|
|
58
58
|
|
|
59
59
|
独立 `mobile-app` 默认包含前端 crypto,并启用 typed client 加密传输。已有明文 API 可显式使用 `PUBLIC_API_TRANSPORT=off`;`PUBLIC_API_KEY_EXCHANGE_PATH` 只覆盖公开协商子路径。握手失败不会降级,服务端私钥不进入客户端。客户端先关闭 transport,再释放自身初始化的 crypto。
|
|
60
60
|
|
|
61
61
|
### 纯静态 website 与 GitHub Pages
|
|
62
62
|
|
|
63
|
-
新建 website
|
|
63
|
+
新建 website 默认 Node SSR,只安装展示站所需的 Core/Kit/UI,可以直接使用下述静态构建。以后接入了服务端业务模块、初始化或 API/actions 时,静态发布前须移除这些动态能力;保留的注释配置和变量示例不影响静态构建。
|
|
64
64
|
|
|
65
65
|
website默认Node SSR。仅构建时设置`HAI_BUILD_STATIC=1`与`PUBLIC_BASE_PATH=/docs-site`(docs-site替换为实际仓库名;各目录段仅ASCII字母、数字、_、.、-,无末尾/,根站留空)后执行`pnpm build`,输出build静态目录。静态标志只接受0/1,且仅用于compile;PUBLIC_BASE_PATH也可用于Docker网站构建,原生app/desktop目标不接受网站目录。静态拒绝服务端业务模块、自定义API/actions和未预渲染页面,不放宽生产守卫,不生成SPA回退;默认健康API不进入静态产物。
|
|
66
66
|
|
|
@@ -88,7 +88,7 @@ Docker构建时同样显式设置PUBLIC_BASE_PATH;非根目录生成格式5制
|
|
|
88
88
|
|
|
89
89
|
### 已有项目与代码生成
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
通过 `hai add ai` 可补齐 reldb 与 vecdb 依赖;随后在应用入口按数据库 → 向量库 → AI 初始化,失败时检查关闭结果并逆序清理。`.env.prod` 按启用模块选择 PostgreSQL(已选 MySQL 则保留)、Redis、S3、Qdrant,默认使用 Compose 的 `db/cache/storage/vecdb` 服务名。数据库/缓存密码、S3 凭据、模型密钥和受保护 Qdrant 的密钥必须由私有环境注入;容器外运行需覆盖这些内部地址。生产 Reach 的空 Provider 数组有意拒绝启动,须私有注入真实 `HAI_REACH_PROVIDERS` JSON。`hai add` 保留已有生产参数,只补新增字段;随后在现有业务入口接入新增模块。
|
|
92
92
|
|
|
93
93
|
```sh
|
|
94
94
|
hai add storage
|
|
@@ -101,7 +101,7 @@ hai generate model order
|
|
|
101
101
|
hai generate migration add-orders
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
`hai add` 解析模块依赖并补充配置。`hai init` 补齐缺失配置和 AI 文件,保留已有自定义内容;`--force` 可重建模块配置,使用前检查差异。
|
|
104
|
+
`hai add` 解析模块依赖并补充配置。`hai init` 补齐缺失配置和 AI 文件,保留已有自定义内容;`--force` 可重建模块配置,使用前检查差异。 已有模块也会检查传递依赖与所属 workspace 的 catalog;旧版安装失败后可重跑同一命令修复,保留已有版本、注释和配置值。
|
|
105
105
|
|
|
106
106
|
page 只支持 SvelteKit 文件路由;api 会按目标应用选择 SvelteKit 文件路由或 serv 的共享 contract/procedure。API/fullstack 根目录可自动选择唯一后端;多应用用 `--workspace <包名或相对路径>`,也可进入目标 workspace。纯 Vite 的 page/api 组合明确拒绝;serv 不接受 `--output`,SvelteKit 路由输出须位于 `src/routes` 内,定制 `kit.files` 时明确拒绝猜测;API 目标须已安装 `@h-ai/kit` 与 `zod`。serv 只改写带 `@hai-generator` 标记的既有聚合入口,未知结构要求手动扩展,不创建平行路由。名称不能包含路径;默认拒绝覆盖,`--force` 只替换生成文件,不覆盖已有业务领域注册。整批预检,写入失败回滚本次修改。迁移只生成 up/down 函数,不自动执行;运行前确认数据影响。
|
|
107
107
|
|
|
@@ -200,7 +200,7 @@ fullstack 的逐项开关、默认值、启用前提与使用影响见[配置化
|
|
|
200
200
|
|
|
201
201
|
### 问题反馈与离线分析
|
|
202
202
|
|
|
203
|
-
使用 `hai create my-app --type fullstack --frontends web
|
|
203
|
+
使用 `hai create my-app --type fullstack --frontends web` 默认启用反馈;API 工程也默认包含反馈,无需额外参数。普通成员及业务操作员可提交反馈,`business_operator` 才显示管理菜单并能查看、处理、撤销和导出;自动补齐数据库、存储、触达与认证依赖。Fullstack 生成收集入口、分页管理页和服务端接口;API 工程生成服务端接口。生产使用共享 DB 和私有 S3;通知独立选择 `disabled`、`console` 或 `reach`,默认 `console` 只输出 `metadata`。需要摘要时显式设 `consoleContent: summary`,需要实际发送时再配置 Reach 通道与收件人。
|
|
204
204
|
|
|
205
205
|
业务扩展在 feedback.init(config, { collectEvidence }) 中 await 文本/ZIP 等材料;_feedback.yml 提供 businessCollectionTimeoutMs、webhookUrl/webhookSecret/webhookTimeoutMs。Webhook 独立持久重试,详情可查看状态并重试;密钥仅放服务端私有环境。见 [feedback 配置与示例](../feedback/README.md)。
|
|
206
206
|
|