@h-ai/cli 1.0.0-beta.6 → 1.0.0-beta.7

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 CHANGED
@@ -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
- Creation always uses the full applicable modules and examples, including AI, vector storage and feedback on servers. Clients retain their dependency boundaries. Installation is larger, and examples need adaptation. `--template`, `--features` and `--examples/--no-examples` have been removed; `create --yes/-y` is now `--defaults`. Old options fail explicitly. `deploy --yes` and existing projects keep their behavior.
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 include the full modules and examples and default to Node SSR. Before static publication, remove server business dependencies and initialization, custom APIs and actions, retaining Core/Kit/UI. There is no lightweight creation option. Existing websites without these dynamic capabilities can use the static build below.
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
- Creating or adding AI also installs reldb and vecdb. Generated startup initializes database → vector store → AI and checks reverse cleanup failures. 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.
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
package/README.ja.md CHANGED
@@ -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
- 新規作成は適用可能な全モジュールとサンプルに統一し、サーバーには AI・ベクトル保存先・feedback も導入します。クライアントの依存境界は維持します。インストール容量は増え、サンプルは実業務に合わせて変更が必要です。`--template`、`--features`、`--examples/--no-examples` は削除し、`create --yes/-y` は `--defaults` に変更しました。旧引数は明示的に拒否します。`deploy --yes` と既存工程の構成は維持します。
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 は全モジュールとサンプルを含み、既定は Node SSR です。静的公開前にサーバー業務依存・初期化・独自 API/actions を工程から除去し、Core/Kit/UI を保持します。軽量作成引数はありません。動的機能のない既存 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
- 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` は既存本番値を保持して不足項目を追加します。既存の起動処理への接続はアプリ側で行います。
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
package/README.md CHANGED
@@ -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
- 新建工程统一采用适用的完整模块和示例,服务端包含 AI、向量库、反馈等依赖;客户端仍按类型隔离服务端模块。安装体积相应增加,示例需按实际业务替换。`--template`、`--features`、`--examples/--no-examples` 已删除,`create --yes/-y` 改为 `--defaults`,旧参数明确报错;`deploy --yes` 保持原义。已有工程的模块选择不受影响。
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 同样包含完整模块和示例,默认 Node SSR。静态发布前须在工程中移除服务端业务依赖及其初始化、API/actions,保留 Core/Kit/UI;没有轻量创建参数。已有不含这些动态能力的 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
- 创建或添加 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` 保留已有生产参数,只补新增字段;随后在现有业务入口接入新增模块。
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