Senparc.Xncf.XncfBuilder 0.41.4

Prefix Reserved
dotnet add package Senparc.Xncf.XncfBuilder --version 0.41.4
                    
NuGet\Install-Package Senparc.Xncf.XncfBuilder -Version 0.41.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Senparc.Xncf.XncfBuilder" Version="0.41.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Senparc.Xncf.XncfBuilder" Version="0.41.4" />
                    
Directory.Packages.props
<PackageReference Include="Senparc.Xncf.XncfBuilder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Senparc.Xncf.XncfBuilder --version 0.41.4
                    
#r "nuget: Senparc.Xncf.XncfBuilder, 0.41.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Senparc.Xncf.XncfBuilder@0.41.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Senparc.Xncf.XncfBuilder&version=0.41.4
                    
Install as a Cake Addin
#tool nuget:?package=Senparc.Xncf.XncfBuilder&version=0.41.4
                    
Install as a Cake Tool

Senparc.Xncf.XncfBuilder

Senparc.Xncf.XncfBuilder is an NCF module and service layer for generating the starter code and metadata of an XNCF module.

Features

  • Generates module files, application-service interfaces, database entities, and migration scaffolding.
  • Reads the XNCF template package and writes multiple generated files with placeholder replacement.
  • Provides database migration and template inspection workflows through NCF function requests.
  • Includes module-inventory request/response events for cross-module discovery.
  • Builds and runs generated modules in an isolated Senparc.Web preview process without restarting the current site.

Installation

<PackageReference Include="Senparc.Xncf.XncfBuilder" Version="0.26.0-preview3" />

For the dotnet new workflow, install the companion template package:

dotnet new install Senparc.Xncf.XncfBuilder.Template
dotnet new xncf -n MyProject --force --UseDatabase true

Key API

  • BuildXncfAppService handles module-generation operations.
  • BuildXncf_BuildRequest, BuildXncf_CreateAppServiceRequest, and BuildXncf_CreateDatabaseEntityRequest describe generation tasks.
  • GenerateAppServiceInterface and DatabaseMigrationsAppService expose focused code-generation workflows.
  • MultiFileCodeGenerator writes template-driven file sets; BuildXncfRequestHelper normalizes generation requests.
  • XncfModulesInventoryRequestHandler and XncfModulesInventoryResponseHandler support module inventory exchange.

Isolated preview

The Builder function UI provides these operations:

  • Start or update an isolated XNCF preview publishes Senparc.Web with the selected generated module and starts it on a loopback port.
  • View XNCF preview status reports the URL, process ID, source fingerprint, module DLL hash, and optional recent output.
  • Stop an isolated XNCF preview terminates the child process and removes its temporary publish directory.

The XncfBuilder module menu also exposes XNCF Preview Monitor. This AdminOnly page polls lightweight session snapshots every two seconds, displays queued and active modules together, and loads the latest output only when a session row is expanded. Task history is stored in XncfBuilderXncfPreviewTask, while child-host lifecycle data is stored in XncfBuilderXncfPreviewHost; only the latest 50 terminal sessions are hydrated into memory. A parent-site restart marks unfinished persisted tasks and hosts as interrupted because an old PID cannot be safely reattached. The two tables require an EF migration, which is intentionally not included in this source change. Before that migration is applied, or when the state database is temporarily unavailable, the parent site and preview workflow continue with in-memory state and display a persistence warning; restart the parent site after applying the migration to enable database persistence.

Generation also has an opt-in Start isolated preview after generation option. Publishing normally uses --no-restore, a versioned directory under the operating-system temporary folder, and serial MSBuild execution. The preview service performs one required restore when the new project or a package reference is newer than its assets file. A newly healthy preview replaces the previous preview for the same module; the current Senparc.Web process is not restarted.

AI-assisted closed loop

The persistent XNCF source workspace is the source of truth. AI tools must not edit the temporary preview publish directory. The intended workflow is:

  1. Create a module with the NuGet template, or select an existing source module.
  2. Read and update files inside that module workspace. A read returns a SHA-256 value; pass it back as expectedSha256 when updating an existing file to prevent overwriting a concurrent change.
  3. Call Start or update an isolated XNCF preview only after the requested writes are complete. The preview service fingerprints the module source, verifies that Senparc.Web.csproj directly references that exact source project, publishes Senparc.Web, verifies the expected module DLL exists, and rejects the result if the source changes during build or startup. A package reference or an old copied DLL is intentionally not accepted as proof that the edited source was built.
  4. Start the new process, pass the HTTP health check, and only then stop and delete the previous healthy preview for that module.
  5. Inspect or test the preview, then repeat from step 2 for the next change.

The generation-time Start isolated preview after generation option is suitable for a template-only smoke test. If AI will continue editing the generated module, leave that option off and start the preview after the AI write phase.

Workspace file access is confined to a uniquely resolved XNCF project under the selected solution. Absolute paths, directory traversal, symbolic-link escapes, directories, NUL-containing content, and text files larger than 4 MB are rejected. Writes use a same-directory temporary file followed by an atomic replacement.

The default XncfPreview environment binds only to 127.0.0.1 and overrides the database/cache selection to local SQLite and local cache. Its database is created inside that preview's publish directory. Set a different environment only when intentionally testing against that environment's configuration.

This first preview mode requires a source workspace with the conventional Senparc.Web/Senparc.Web.csproj and generated <Organization>.Xncf.<Module>/<Organization>.Xncf.<Module>.csproj layout. A runtime-only distribution needs a separately shipped preview host before it can accept generated source modules.

Review generated files before committing them. Generated source can include database and authorization decisions that must be adapted to the host application's domain and security model. The child process is an isolation boundary for lifecycle, assembly loading, database, and cache—not an operating-system security sandbox. Preview startup removes inherited application environment variables except for a small runtime allowlist, but generated code still runs with the account and network permissions of the parent site and may read files available to that account. Untrusted model output therefore requires review or an additional OS/container sandbox before execution.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Senparc.Xncf.XncfBuilder:

Package Downloads
Senparc.Xncf.AgentsManager

Agents 管理模块

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.41.4 35 9/18/2026
0.41.3 43 9/16/2026
0.41.2 47 9/15/2026
0.41.1 118 8/29/2026
0.41.0 145 8/23/2026
0.41.0-preview11 113 8/14/2026
0.40.0-preview10 104 8/12/2026
0.39.1-preview9 110 8/8/2026
0.39.0-preview8 115 8/3/2026
0.38.0-preview7 111 7/31/2026
0.37.1-preview6 105 7/28/2026
0.37.0-preview5 106 7/26/2026
0.36.5-preview4 113 7/15/2026
0.36.4-preview3 111 7/5/2026
0.36.2-preview1 106 7/3/2026
0.36.1-preview1 125 6/17/2026
0.35.9.1-preview 154 5/22/2026
0.35.6-preview.1 120 1/7/2026
0.35.5.4-preview 130 12/28/2025
0.35.2-preview 125 6/16/2026
Loading failed

v0.1.0 创世
v0.8.127 使用 .NET Core 命令行创建模板,取代原有的 T4 模板
v0.13.3 添加 Oracle 数据库 Migration 支持
v0.13.4.1 添加 Oracle 数据库迁移代码
v0.13.6 更新 XncfBuilder,适配 .NET 7.0 CLI
v0.13.9 数据库 migration 命令中的路径添加引号,防止路径中出现空格
v0.13.10 XNCF Builder 自动记录上次填写的内容,并且首次自动探索 .sln 文件
V0.14.0 移除对 netstandard2.1 的编译,保留 netcoreapp3.1;net6.0
v0.15.0 集成 Senparc.Xncf.PromptRange 项目,使用 AI 自动生成项目
v0.16.0 优化 AI 生成过程,添加对 EntityClass、EntityDtoClass、SenparcEntities 的独立生成过程
v0.16.2.1024 升级至 1024 特别版,支持 2023.10.24 特别版 Senparc.Xncf.PromptRange
v0.17.0 优化 Add-Migration,支持自动选择 XNCF 项目
v0.17.1 优化 Add-Migration,支持自动扫描 *SenparcEntities.cs 文件
v0.18.0 优化 Add-Migration,可自动更新 Register.cs 版本号
v0.19.0 优化项目引用
v0.20.0 更新项目引用,支持 .NET 8.0
v0.21.0 集成 Senparc.Xncf.AIKernel,可以选择已配置的 AI 模型生成代码
v0.24.0 聚焦支持 .NET 8.0,XNCF 取消旧版本支持
v0.24.1 升级新版本 Senparc.AI(Senparc.Xncf.AIKernel)
[2024-08-06] v0.28.6.0-preview1 update Senparc.AI.Kernel
[2024-08-13] v0.29.0-preview1 优化 ServiceBase,提供 Mapping<T>(entity) 快捷方法;为 DynamicData 添加根据 Entity 类型自动创建表结构的功能
[2024-08-31] v0.30.0-preview1 PromptRange 支持 Markdown 输出格式展示
[2024-09-03] v0.30.1-preview1 PromptRange 结果提供“复制”功能
[2024-09-03] v0.30.2-preview1 PromptRange 结果提供“复制”功能
[2024-09-04] v0.30.3-preview1 PromptRange 完善结果显示样式,添加“复制”功能
[2024-09-07] v0.30.4-preview1 XncfBuilder 更新默认 Prompt
[2024-09-07] v0.30.4.1-preview1 更新 PromptRange 中代码自动生成的 Prompt
[2024-09-07] v0.30.4.2-preview1 PromptRange 优化输出格式
[2024-09-07] v0.30.4.3-preview1 PromptRange 修复自动初始化 Prompt 调用过程中的一个 bug
[2024-09-07] v0.30.4.4-preview1 更新 XNCF AI 代码生成逻辑
[2024-09-07] v0.30.5-preview1 更新 Senparc.AI 基础库,并在 XncfBuilder 使用 AI 生成代码时,优先使用已选中的模型。
[2024-09-07] v0.30.5.1-preview1 优化 XncfBuilder AI 代码生成过程中的 AI 模型选用
[2024-09-08] v0.30.5.2-preview1 优化 XncfBuilder AI 代码生成过程的模型选用
[2024-09-10] v0.30.6-preview1 升级缓存基础库
[2024-10-09] v0.30.8-preview1 升级基础库
[2024-10-16] v0.30.9-preview1 添加 Service 对 PagedList 对象快速 Mapping 到 DTO 对象的方法
[2024-11-04] v0.31.0-preview1 重构 PromptRange 界面;大幅提升树状 Prompt 检索性能(约20倍)
[2024-11-08] v0.31.1-preview1 升级 Senparc.AI
[2024-11-15] v0.32.0-preview1 使用新版本 AutoGen,升级 AgentsManager;解决 AgentsManager 中状态获取的异常
[2024-11-21] v0.33.2-preview1 更新 CO2NET 及缓存基础库
[2024-11-28] v0.33.3-preview1 update CO2NET, use new SenparcSetting with UseLowerCaseApiName property
[2024-12-27] v0.33.4-preview1 Add exception log for UseXncfModules() auto progress
[2025-01-09] v0.34.0-preview1 reconstruction XncfBuilder for generate XNCF
[2025-01-25] v0.34.3-preview1 Update Agents functions, support for function calling
[2025-01-28] v0.34.4-preview1 update Senparc.AI
[2025-02-06] v0.34.5-preview1 update NeuCharAI model update
[2025-04-29] v0.34.7-preview1 Update CO2NET and AIKernel
[2025-05-18] v0.34.8-preview1 Update Installation
[2025-05-20] v0.35.0-preview.1 Update AI powered XNCF Builder
[2025-05-21] v0.35.0-preview.2 Fix XNCF Builder Function display problem
[2025-05-22] v0.35.0-preview.3 XNCF Builder improve CMD command progress
[2025-05-22] v0.35.0-preview.3.1 XNCF Builder improve AI code generation
[2025-06-26] v0.35.2-preview.9 Finish new AI code generation template
[2025-06-27] v0.35.3-preview.9 Add dynamic XNCF Template dynamic generator
[2025-06-28] v0.35.3-preview.10 Add dynamic XNCF Template dynamic generator, support for dotnet CLI and Visual Studio together
[2025-11-01] update basic libraries, including Senparc.AI
[2026-01-07] v0.35.6-preview.1 Add NcfSourcePackage project path to DatabaseMigrationRequest loading method
[2026-04-24] Simplify FunctionRender request parameters and keep SelectionList UI metadata compatibility
[2026-07-02] v0.36.2-preview1 升级 Senparc.AI.AgentKernel 并完成兼容性适配,增强 MCP 工具接入与调用链路兼容能力
1、升级 Senparc.AI.AgentKernel 并完成兼容性适配
2、增强 MCP 工具接入与调用链路兼容能力
3、优化 DatabaseMigrationsAppService,清洗命令输出中的 ANSI 转义字符
4、调整 DatabaseMigrationRequest 与迁移执行流程,提高数据库迁移调用稳定性
[2026-07-05] v0.36.3-preview2 重构系统配置初始化与更新流程并统一模型处理,补充配置与工程实现细节
1、重构系统配置初始化与更新流程并统一模型处理
2、补充配置与工程实现细节
[2026-07-05] v0.36.4-preview3 重构系统配置初始化与更新流程并统一模型处理,补充配置与工程实现细节
1、重构系统配置初始化与更新流程并统一模型处理
2、补充配置与工程实现细节
[2026-07-07] v0.36.5-preview4 Dependency updates from upstream modules
1、Dependency update from Senparc.Xncf.AIKernel to 0.13.5-preview4
2、Dependency update from Senparc.Xncf.PromptRange to 0.16.5-preview4
3、升级 Senparc.AI 至 0.27.3、Senparc.AI.AgentKernel 至 0.1.10
[2026-07-17] v0.37.0-preview5 增强 XNCF 构建、数据库迁移与 AI 生成流程的本地化支持
1、接入统一资源本地化机制,支持模块功能文案按当前文化动态显示
2、更新 FunctionRender 与请求模型文案的资源化解析
3、统一模块注册信息、菜单名称与功能描述的本地化输出
4、补充并统一多语言资源键及资源文件
5、同步 AIKernel 模型 API 版本适配,并完善生成模板的多语言页面
6、构建命令改为直接调用进程 API,不再依赖 cmd.exe
7、改善构建输出捕获并开放测试所需的内部访问
[2026-07-29] v0.37.1-preview6 默认关闭未受保护的 Builder MCP 路由
1、保持 Builder MCP 工具关闭,避免在缺少管理员授权策略时发布未认证接口
[2026-07-31] v0.38.0-preview7 扩展 XNCF 生成模板的多语言能力
1、生成的数据库示例页自动加载模块本地化脚本
2、升级 Senparc.AI 组件版本以适配 CO2NET 4.2.0
[2026-08-04] v0.39.0-preview8 新增 XNCF 隔离预览持久化与跨数据库迁移支持
1、新增预览 Host、任务、状态存储与监控页面,完善会话生命周期处理
2、为预览实体补齐六类数据库迁移、模型快照与设计时配置
3、规范迁移文件和快照布局并修复跨平台命名空间定位
4、增强工作区文件服务及预览生成应用服务
5、移除废弃的 ReplacePlaceholders 与 CreateNewSenparcEntitiesFile 工具,统一模板生成和数据库迁移流程
6、仅在未使用已检入生成代码时加载模板 AdditionalFiles,避免 Release/CI 重复处理 Razor 模板
[2026-08-08] v0.39.1-preview9 Dependency updates from upstream projects
1、Dependency update from Senparc.Ncf.DatabasePlant to 0.21.6-preview6
2、Dependency update from Senparc.Ncf.XncfBase to 0.24.1-preview6
3、Dependency update from Senparc.Xncf.XncfBuilder.Abstractions to 0.1.3-preview4
4、Dependency update from Senparc.Xncf.AIKernel to 0.15.2-preview9
5、Dependency update from Senparc.Xncf.MCP to 0.4.4-preview7
6、Dependency update from Senparc.Xncf.PromptRange to 0.19.1-preview9
7、Dependency update from Senparc.Xncf.XncfModuleManager to 0.15.4-preview6
[2026-08-13] v0.40.0-preview10 增强 XncfBuilder 预览状态持久化与后台初始化
1、新增预览状态持久化服务和托管初始化流程
2、提升 Agent 模板预览在重启及并发场景下的稳定性
[2026-08-15] v0.41.0 增强隔离开发任务与 Sandbox 预览流程
1、新增 XncfDevelopmentJob 创建、状态存储、后台服务和管理监控页面
2、接入可选 Sandbox 预览契约,限制源码快照和人工合入边界,未配置预览能力时安全失败
3、完善工作区文件服务、数据库迁移与模板生成流程
4、Dependency update from Senparc.Xncf.AIKernel to 0.15.4
5、Dependency update from Senparc.Xncf.MCP to 0.5.1
6、Dependency update from Senparc.Xncf.Sandbox.Abstractions to 0.2.0
7、统一数据库配置路径并完善开发任务、预览服务和工作区文件管理的兼容处理
[2026-08-29] v0.41.1 Dependency updates from Senparc.Ncf.DatabasePlant to 0.21.10; Dependency update from Senparc.Ncf.XncfBase to 0.26.1
1、Dependency update from Senparc.Ncf.DatabasePlant to 0.21.10
2、Dependency update from Senparc.Ncf.XncfBase to 0.26.1
[2026-09-15] v0.41.2 适配共享 AI 依赖与 Harness 版本
1、同步 AgentKernel 及 Microsoft Agents AI Harness 依赖
2、保持 XNCF Builder 生成流程与 AI 辅助能力兼容
[2026-09-16] v0.41.3 Dependency updates from Senparc.Ncf.XncfBase.Tests to 0.0.14; Senparc.IntegrationSample to 0.0.13; Senparc.Xncf.AIAgentsHub.Tests to 0.0.13; Senparc.Xncf.AgentsManager to 0.17.2; Senparc.Web to 0.39.1; Senparc.Xncf.Installer to 0.5.7
[2026-09-17] v0.41.4 适配共享 AgentKernel 预览依赖版本
1、同步 Senparc.AI.AgentKernel 至 0.1.14-preview5
2、保持 XNCF Builder 生成流程与 AI 辅助能力兼容