コンテンツにスキップ

パッケージ分離と移行

正本 担当
universal-storage ファイル・オブジェクト保管
data-access レコードCRUD・DBプロバイダー
ai-core アクション・提案・Generative UI・チャット・出力解析
task-graph 共通型・グラフ計算・インメモリ実装
data-engine スキーマ/DDL・汎用処理・PostgresグラフDB/HTTP・スキーマ連携
react-ai ai-coreを使うReact UI・フック
business-jp 日本向け帳票・既存EDIチェック・祝日・地域初期値

AI・グラフは任意の連携サブパスから正本を再利用します。

日本向けAPIは初回公開前に移動しました。法務解析、日本語PDFプリセット、請求書Excel、 日本向けEDIのチェック/生成/ラベル、日付・税率・CSVの日本向け初期値はbusiness-jpからimportします。 engineの/legal-document、日本向けPDFプリセット/法務変換、請求書Excelテンプレートは削除しました。 optional peerで逆依存を隠す構成にはせず、engine → business-jpの依存はありません。

汎用EDIは通貨とdocument contextを必須にし、請求額計算はdefaultTaxRateとroundTaxを必須にします。 汎用日付のlocaleは明示しなければホストに従い、日本の祝日はbusiness-jpだけが読み込みます。 CSVのDateはdateLocale/dateOptions/dateFormatterで書式を指定し、汎用PDFのフォント名はsans-serifです。 これらは初回公開前の意図したAPI変更です。private app-core/react-toolsの既存パスと 日本向け初期値はbusiness-jpを参照するファサードで維持します。

storage/data-access/ai-core/task-graphは独立して先に公開できます。react-aiはai-coreの後、 engineは基盤の後、business-jpはengineの後です。依存が実在してから本番registryのlockを作成します。 公開npmは@alneas/*、privateのGitHub Packagesは@dataarthub/*です。通常の正確なnpmバージョンとscope別のregistryを使い、本番の固定tarball URL・公開依存のoverride行列は不要です。GitHubリポジトリはdataarthub配下を維持します。 ローカルtarballは作業版の検証で、本番registry URLの検証とは異なります。 統合docsは同じPublicモノレポのチェックアウトから直接生成します。

@alneas/data-engineだけを導入しても、ai-core・task-graph・data-access・ universal-storage・business-jpは入りません。ルート、スキーマ/DDL、CSV・文字コード、 日付、汎用PDF/Excel、金額計算、EDI、カレンダーはこれらを未導入でも使えます。 AJV・Zodなどの汎用ライブラリは通常依存として残します。

入口 利用側で明示的に導入するもの
ルート、/schema/*、/csv、/encoding、/date-utils、/pdf、/excel、/finance、/edi、/google-calendar、/notifications/messages、/notifications/slack、/notifications/google-chat 他のALNEASパッケージは不要
/integrations/ai @alneas/ai-core@0.1.0
/integrations/task-graph(計算・Postgres DB/HTTP) @alneas/task-graph@0.1.0
/integrations/supabase data-accessと互換性のある@supabase/supabase-js
/editor・/notifications @alneas/universal-storage@0.1.0
/content(入口全体と型定義) data-accessとuniversal-storage

任意peer依存なので、連携入口のimport・型解決には必要なpeerを明示的に導入してください。 任意とは、未導入で連携機能が動くという意味ではありません。 browser用storageはuniversal-storageの対応入口を選びます。engine開発時は全peerを 開発依存として入れますが、配布先へ通常依存としては入りません。 AI・グラフの再エクスポートは正本の関数・クラスを共有します。汎用スキーマ検証はengineが AJVを直接使い、ai-coreの検証器を読み込みません。両者の振る舞いは整合性テストで確認し、 関数そのものの同一性は前提にしません。

ターミナルウィンドウ
npm install @alneas/data-engine @alneas/ai-core
import { createAjvValidator } from '@alneas/data-engine';
import { ActionRegistry } from '@alneas/data-engine/integrations/ai';
// グラフ連携はtask-graphを別途導入してから利用します。
// import { PostgresGraphAdapter } from '@alneas/data-engine/integrations/task-graph';

初回公開前のAPI整理として、ルートのAI・storage・レコードAPIとcontent/editor/notifications 名前空間を上表の専用入口へ移しました。/data-accessのグラフ・エージェントAPIは /integrations/task-graph、提案APIは@alneas/ai-core/proposalから利用します。 engine /pdfのresolveSealLabel・印影SVG/data URL生成は @alneas/business-jp/pdf/stamp(/pdfからもexport)へ移しました。 engineから日本向けpackageを任意peerとして読み込む互換入口は作りません。 private app-core/react-toolsの既存名・パスは互換ファサードで維持します。

test:consumerはnpmでengine単独、任意peerを1つずつ追加した環境、全連携環境を 実tarballで検証します。不要なpackageが存在しないこと、Node/BunのESM/CJS実行、 skipLibCheckなしの厳密なNodeNext型解決、基本ルートのbrowser bundleも確認します。 日本向け単独consumerではengine/スキーマ依存がないこと、連携consumerでは明示したengine/business-jpだけであることを確認します。

汎用通知アダプターはconstructor第2引数にNotificationMessagesを受け取り、既定は英語ラベル・通貨記号なしです。承認カードのボタン名も指定できます。日本語の支払・在庫通知と円表示はbusiness-jp /notificationsのjapaneseNotificationMessagesへ移しました。汎用の設定型・初期値入口/notifications/messagesには他のALNEAS packageは不要です。

各クラスは/notifications/slack・/notifications/line・/notifications/google-chatで公開します。createNotificationService(database, organizationId, messages)の第3引数にも表示設定を渡せます。LINE入口は署名検証にuniversal-storageが必要で、Slack/Google Chatの個別入口には他のALNEAS packageは不要です。

AI, record and storage pass-through entries were removed before initial publication. Import @alneas/ai-core/*, @alneas/data-access/* and @alneas/universal-storage directly. React developers may use @alneas/react-ai/{action,proposal,generative-ui,ai-chat} for hooks and the corresponding ai-core contracts together. Oracle Enterprise接続adapter、Oracle固有のRLS/graph、DB drift/audit、自律graph agentは private premium APIです。従来のimportはPrivate互換facadeでのみ維持します。

汎用的なスキーマからのSQL生成はdata-engineのPublic APIに含まれます。

Public entry 公開するhelperと範囲
/schema/compiler generateRLSFromJSONSchema と generateRLSFromJSONSchemaMultiple は x-rls からPostgreSQL RLS SQLを生成します。generateMigrationFromJSONSchema は既定でこのSQLを含めます(includeRLS: true)。除外する場合は false を指定します。
/schema/json-extensions(/schema からも利用可能) generateJsonExtensionSql は仮想/生成列と検証制約のSQLを生成し、oracle dialectも含みます。buildJsonMergeExpression もOracle SQL式に対応します。

これらのhelperはSQL文字列を返します。Oracleへの接続、policyの適用、PrivateのOracle Enterprise runtimeは提供しません。適用前に対象DBのversion・schema・認可要件に照らして 生成SQLを確認してください。Oracle向けSQLの出力だけで実Oracle環境の動作確認済みとは扱いません。 Generic Postgres introspection uses /schema/server or /schema/introspection and its optional pg peer. It defaults to the public schema; pass schemaName explicitly for a different namespace. GitMarkdownAdapter uses /content/git-markdown on Node. File records use /integrations/files with data-access and universal-storage peers; Supabase schema composition uses /integrations/supabase with data-access and its SDK. The engine root still resolves without these optional peers.