{"_rev":"4-c8f8d1f9e2344e882478a07e46774e54","time":{"created":"2026-04-03T01:57:46.276Z","modified":"2026-04-03T01:57:46.750Z","0.0.2":"2026-03-19T10:43:44.184Z","0.0.3":"2026-04-03T01:57:46.533Z"},"_id":"@agentxin-ai/plugin-hana","name":"@agentxin-ai/plugin-hana","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.3":{"name":"@agentxin-ai/plugin-hana","version":"0.0.3","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"@agentxin-plugins-starter/source":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"dependencies":{"@sap/hana-client":"^2.26.25","tslib":"^2.3.0"},"peerDependencies":{"@nestjs/common":"^11.1.6","@agentxin-ai/plugin-sdk":"^3.6.2","chalk":"4.1.2","lodash-es":"4.17.21","zod":"3.25.67"},"_id":"@agentxin-ai/plugin-hana@0.0.3","description":"`@agentxin-ai/plugin-hana` equips the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack with first-class SAP HANA connectivity so ChatBI agents and data modeling pipelines can query, explore, and ingest enterprise datasets without","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-lmgcMSDRmSqeOOWoqlyITL3JFT+ctLuf5qnlsO/gKkIW/rqpnGE/wUWDaY+us70I2rvZsKyTWz/pHkufoGENrw==","shasum":"c7b647846efb62dd258559fcf7fb8cdc3de855ab","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-hana/-/plugin-hana-0.0.3.tgz","fileCount":17,"unpackedSize":31706,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHuh9wxh8YeoRDNB8VBaX6eOzwI/5ahe/mpg4XOM+zseAiEAgXak0fverTQaPUROPCDbefaKtNjYlpDqc6iYyqkOyCE="}]},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"directories":{},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-hana_0.0.3_1775181466381_0.12875935763315516"},"_hasShrinkwrap":false}},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"description":"`@agentxin-ai/plugin-hana` equips the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack with first-class SAP HANA connectivity so ChatBI agents and data modeling pipelines can query, explore, and ingest enterprise datasets without","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"readme":"# AgentXin Plugin: SAP HANA Data Source\n\n`@agentxin-ai/plugin-hana` equips the [AgentXin AI](https://github.com/agentxin-ai/agentxin) data analysis stack with first-class SAP HANA connectivity so ChatBI agents and data modeling pipelines can query, explore, and ingest enterprise datasets without bespoke integration code.\n\n## Key Features\n\n- Provides a NestJS `HANAPlugin` that registers a global `hana` data-source strategy for every AgentXin runtime.\n- Wraps `@sap/hana-client` inside a reusable adapter that manages pooling, prepared statements, and SAP-specific JDBC metadata.\n- Discovers catalogs, tables, column metadata, and comments directly from `SYS` views to bootstrap semantic models for ChatBI.\n- Supports managed ingestion flows (create/drop tables, batch inserts, schema creation) to hydrate analytical sandboxes inside HANA.\n- Emits JDBC URLs, lifecycle hooks, and structured logging so downstream workers and observability stacks stay aligned.\n\n## Installation\n\n```bash\npnpm add @agentxin-ai/plugin-hana\n# or\nnpm install @agentxin-ai/plugin-hana\n```\n\n> **Note**: This package expects the host service to provide `@agentxin-ai/plugin-sdk`, `@nestjs/common@^11`, `chalk@4`, `lodash-es@4.17.21`, and `zod@3.25.67` as peer dependencies.\n\n## Quick Start\n\n1. **Register the Plugin**  \n   Point the `PLUGINS` environment variable (or equivalent hook) to the package before starting AgentXin:\n\n   ```sh\n   PLUGINS=@agentxin-ai/plugin-hana\n   ```\n\n   During registration the plugin returns the global NestJS module `HANAPlugin`.\n\n2. **Collect SAP HANA Credentials**  \n   Gather the tenant database (a.k.a. SYSTEMDB database name), host, port (default `30015` / `443` for TLS), technical user, password, and an optional default schema.\n\n3. **Configure within AgentXin**  \n   Create a data source entry in the AgentXin console or via API:\n\n   ```json\n   {\n     \"type\": \"hana\",\n     \"options\": {\n       \"host\": \"hana.prod.internal\",\n       \"port\": 30015,\n       \"username\": \"CHATBI_APP\",\n       \"password\": \"******\",\n       \"database\": \"HXE\",\n       \"catalog\": \"SALES\",\n       \"encoding\": \"UTF-8\"\n     }\n   }\n   ```\n\n   Once saved, ChatBI agents can issue SQL, build modeling snapshots, or materialize facts on SAP HANA with role-based isolation.\n\n## Connection & Schema Options\n\n| Field      | Type    | Description                                             | Required | Default |\n| ---------- | ------- | ------------------------------------------------------- | -------- | ------- |\n| `host`     | string  | SAP HANA host or load balancer.                         | Yes      | —       |\n| `port`     | number  | SQL port.                                               | Yes      | —       |\n| `username` | string  | Technical user used by AgentXin services.                  | Yes      | —       |\n| `password` | string  | Password/secret for the user (stored as a secret).      | Yes      | —       |\n| `database` | string  | Tenant or database name resolved by the HANA client.    | Yes      | —       |\n| `catalog`  | string  | Default schema used when none is provided at runtime.   | No       | —       |\n| `encoding` | string  | Optional client encoding override.                      | No       | —       |\n\nAll fields map directly to the adapter’s configuration schema and can be templated per workspace or environment.\n\n## Modeling & Ingestion Utilities\n\n- `getCatalogs()` pulls live schemas from `SYS.SCHEMAS`, ensuring AgentXin’s metadata service stays in sync with SAP governance.\n- `getSchema(schema?, table?)` returns table-level comments, column labels, normalized data types, and nullability for modeling accelerators.\n- `createCatalog()` mirrors schema provisioning flows (`CREATE SCHEMA … OWNED BY`) when self-service modeling needs a scratch space.\n- `import()` builds column tables, performs batch inserts through prepared statements, and respects merge semantics (`append`, `truncate/replace`).\n- `jdbcUrl()` emits SAP-compliant JDBC strings (`jdbc:sap://host:port/?databaseName=...`) so downstream schedulers or BI tools can reuse credentials securely.\n- `ping()` and `runQuery()` enable health checks plus lightweight SQL execution for orchestrated ChatBI prompts.\n\nThese helpers let AgentXin orchestrate data modeling jobs, semantic extractions, and conversational analytics on top of SAP HANA with minimal glue.\n\n## Development & Testing\n\n```bash\nnpm install\nnpx nx build @agentxin-ai/plugin-hana\nnpx nx test @agentxin-ai/plugin-hana\n```\n\nBuild artifacts are emitted to `packages/hana/dist`. Validate changes against a staging HANA instance (or SAP HANA Cloud trial) before publishing.\n\n## License\n\nThis project follows the [AGPL-3.0 License](../../../LICENSE) located at the repository root.\n","readmeFilename":"README.md"}