@haneinfo/plugin-host-nest

中文文档
2.2.0发布于 2026/11/16UNLICENSEDTypeScriptCommonJS零依赖近 30 天下载 5036

NestJS host for Haneinfo plugins: composition from a resolved inventory, lifecycle, catalog and diagnostics, plus the host-owned authentication strategy registry and principal context.

原始使用文档

@haneinfo/plugin-host-nest

NestJS host for Haneinfo plugins: composition from a resolved inventory, lifecycle runner, catalog, diagnostics, and host-owned authentication infrastructure.

IAM Configuration & Startup Checks

HaneinfoHostConfig accepts an optional iam field:

import { defineHaneinfoConfig } from '@haneinfo/plugin-host-nest';
import type { IamDeploymentConfig } from '@haneinfo/plugin-api';

const iamDeployment: IamDeploymentConfig = {
  // single source of truth for IAM profile, issuer, and capability assessment
  ...
};

export default defineHaneinfoConfig({
  inventory,
  plugins,
  iam: { deployment: iamDeployment },
  runtime: {
    iam: iamDeployment,
  },
});

Important: Apps must pass the same IamDeploymentConfig object to both iam.deployment (used by the host for fail-closed startup verification) and runtime.iam (consumed by the IAM profile plugin's configSchema).

When iam is omitted, the host performs no IAM startup checks and preserves existing behavior.

Error Codes (PluginContractError)

When iam is configured, the host enforces all checks fail-closed:

Error CodePhaseMeaning
iam-profile-missingprepare() / onApplicationBootstrap()No haneinfo.iam-profile (IAM_PROFILE) provider was resolved in the plugin graph, or the IAM_PROFILE instance could not be resolved from the Nest injector.
iam-profile-duplicateprepare()More than one provider for haneinfo.iam-profile was resolved in the graph (note: two unrelated plugins without replaces are rejected earlier by the resolver as duplicate-capability-provider).
iam-core-capabilities-failedprepare()deployment.capabilities.corePassed is not true; the IAM cannot be enabled without passing core capabilities C1–C12.
iam-admin-mfa-unavailableprepare()deployment.capabilities.adminMfa is false while deployment.mcp.admin.enabled is true.
iam-token-exchange-missingprepare()deployment.capabilities.delegation is true, but no haneinfo.iam-token-exchange (IAM_TOKEN_EXCHANGE) provider was resolved.
iam-profile-id-mismatchonApplicationBootstrap()profile.profileId does not match deployment.profileId.
iam-issuer-mismatchonApplicationBootstrap()profile.issuer does not match deployment.issuer verbatim.
iam-capability-mismatchonApplicationBootstrap()profile.mcpCapabilities differs from deployment.capabilities on any of adminMfa, offlineConnector, delegation, or clientResourceBinding.

版本与发布记录

@haneinfo/plugin-host-nest 共发布 5 个版本,首次发布于 2026/10/02;过去 12 个月发布了 5 个版本。

版本发布日期距今
2.2.0latest2026/11/161 天前
2.1.22026/11/0412 天前
2.1.12026/10/2721 天前
2.1.02026/10/151 个月前
2.0.02026/10/021 个月前

关于 @haneinfo/plugin-host-nest 的常见问题

@haneinfo/plugin-host-nest 是什么?

NestJS host for Haneinfo plugins: composition from a resolved inventory, lifecycle, catalog and diagnostics, plus the host-owned authentication strategy registry and principal context.

如何安装 @haneinfo/plugin-host-nest?

在项目目录运行 npm install @haneinfo/plugin-host-nest,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:rxjs(^7.8.2)、@nestjs/core(^11.0.0 || ^12.0.0)、@nestjs/common(^11.0.0 || ^12.0.0)、@haneinfo/plugin-api(^1.5.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@haneinfo/plugin-host-nest 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@haneinfo/plugin-host-nest 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@haneinfo/plugin-host-nest 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@haneinfo/plugin-host-nest 可以商用吗?

@haneinfo/plugin-host-nest 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@haneinfo/plugin-host-nest 的下载量有多少?

根据 npm 官方下载统计,@haneinfo/plugin-host-nest 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,036 次,日均约 168 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@haneinfo/plugin-host-nest 还在维护吗?

最新版本 2.2.0 发布于 2026/11/16(1 天前);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/10/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。