Skip to content

Add 3D map UX improvements, XNCF auto-attach for agents, and Create Agent from PromptCode#497

Open
Copilot wants to merge 55 commits intoDeveloper-3DAgentsfrom
copilot/optimize-3d-agent-functions
Open

Add 3D map UX improvements, XNCF auto-attach for agents, and Create Agent from PromptCode#497
Copilot wants to merge 55 commits intoDeveloper-3DAgentsfrom
copilot/optimize-3d-agent-functions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

Addresses three feature requests: 3D map usability enhancements in PromptRange, auto-attach of XNCF plugin functions when creating agents, and a quick-create workflow to spin up an AgentTemplate directly from a PromptCode.

Feature 1: 3D Map UX Improvements (PromptRange)

  • Added toolbar inside the 3D dialog: Reset View, Fit View, Fullscreen, and Keyboard Shortcuts help popover
  • Keyboard navigation: W/A/S/D pan, Q/E depth, R reset, F fit, +/- zoom
  • Auto-fits view on open; node count shown in toolbar
  • Keyboard handler properly cleaned up on dialog close/destroy

Feature 2: Auto-attach XNCF Modules (AgentsManager)

Added an "自动附加所有 XNCF 功能插件" switch to the agent creation form. When enabled, all registered plugin types are merged into functionCallNames, enabling the agent to auto-dispatch to matching XNCF module functions:

// ON: merges all pluginTypes into functionCallNames
const allNames = [...new Set([...currentNames, ...this.pluginTypes])];
// OFF: strips back to manually-added names only
const manualNames = currentNames.filter(name => !this.pluginTypes.includes(name));

Feature 3: Create AgentTemplate from PromptCode (PromptRange + AgentsManager)

Backend:

  • GetListByPromptCode API (AgentsManager) — prefix-matches existing agents for a given code
  • CreateAgentFromPromptCode [FunctionRender] (AgentsManager) — XNCF admin panel entry point with scope selector
  • ViewPromptCodeList [FunctionRender] (PromptRange) — displays the full PromptCode tree with scope-level annotations

Frontend:

  • "创建智能体" button added next to the 导图 button in the prompt selector toolbar; disabled when no tactic is selected
  • Dialog supports three PromptCode scope levels — Range (靶场), Tactic (靶道), Full (完整定位) — with a live preview of the resulting code
  • Checks for existing agents with a matching prefix before creating; shows a $confirm prompt if conflicts are found
Original prompt

1、请你对当前Agents中3D的功能提出一些优化的建议,集中在用户操作的便捷性上面。

2、为Admin中的AI Chat添加一个选项,选中后自动附加XNCF模块(用户同时可以手动选),就像目前自动安装XNCF模块一样。然后就能实现用户随便提问,可以自动触发对应模块的功能。

3、在PromptRange中添加一个functionRender,同时也创建一个按钮,让某个PromptCode可以快速创建一个智能体(如果当前靶道或者靶场已经有智能体,需要给出提示并确认),创建可以选择Agents覆盖范围(Range一级,或者到某个Tactics,或者完整定位,对应的PromptCode输入的前缀不同,或者是完整的Code)

Created from VS Code.


Note

Medium Risk
Adds new agent-creation flows and prefix-based lookups that can create/modify AgentTemplate records and change how functionCallNames is populated. Risk is mainly incorrect plugin auto-attachment/removal or unintended agent creation due to PromptCode prefix matching.

Overview
Enables a PromptRange → AgentsManager workflow to create an agent from a PromptCode with selectable scope (range/tactic/full), including UI warnings/confirm when existing agents share the same PromptCode prefix.

Adds new AgentsManager endpoints to support this flow: GetListByPromptCode (prefix match) and a FunctionRender action CreateAgentFromPromptCode, plus a PromptRange FunctionRender (ViewPromptCodeList) for browsing available PromptCodes.

Improves AgentsManager’s Function Calls UI with an auto-attach all XNCF plugins switch that merges/removes all registered plugin types into/from functionCallNames.

Enhances the PromptRange 3D map dialog usability with a toolbar (reset/fit/fullscreen), keyboard shortcuts, auto-fit on open, render throttling hooks, and proper keyboard handler cleanup on close.

Reviewed by Cursor Bugbot for commit ab89ea3. Bugbot is set up for automated code reviews on this repo. Configure here.

JeffreySu added 30 commits July 27, 2025 07:05
XncfTemplate v0.12.9-preview.7 更新 CO2NET.WebApi、DatabasePlant 等基础库
refactor: Remove unused class and adjust API defaults
update CO2NET reference of Senparc.Ncf.Database.MySql.Backup
update: Senparc.Xncf.XncfBuilder.Template
添加异步支持和更新文档及项目引用
PromptRange [2025-11-06] v0.15.0-preview.1 Support Prompt comparison;…
…larization

Refactor/prompt js modularization
…larization

Refactor/prompt js modularization
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ab89ea3. Configure here.

case 'a': this.map3dCamera.position.x -= SPEED; this.map3dControls.target.x -= SPEED; moved = true; break
case 'd': this.map3dCamera.position.x += SPEED; this.map3dControls.target.x += SPEED; moved = true; break
case 'q': this.map3dCamera.position.z += SPEED; moved = true; break
case 'e': this.map3dCamera.position.z -= SPEED; moved = true; break
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q/E keys zoom instead of panning unlike WASD

Medium Severity

The Q/E keys only modify camera.position.z without also updating controls.target.z, making them behave as zoom (changing distance to orbit target) instead of depth panning. This is inconsistent with W/A/S/D, which correctly move both camera and target together for true panning. As a result, Q/E is functionally identical to +/- (zoom), and the help text describing Q/E as "上下平移" (up-down pan) is incorrect.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ab89ea3. Configure here.

return await this.GetStringResponseAsync(async (response, logger) =>
{
var promptItemService = base.GetService<PromptItemService>();
var tree = await promptItemService.GetPromptRangeTreeList(true, true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FilterRangeName property defined but never applied

Low Severity

The PromptRange_ViewPromptCodeRequest class defines a FilterRangeName property (shown to users as a filter input in the FunctionRender form), but ViewPromptCodeList never passes request.FilterRangeName to GetPromptRangeTreeList. That method accepts a promptName parameter for filtering, but it's called without it, so the filter input is silently ignored and all ranges are always returned.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ab89ea3. Configure here.

@JeffreySu
Copy link
Copy Markdown
Contributor

@copilot 我看到现在有9个文件,在IDE中显示了 Checkout 和Apply,这是什么意思?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 4, 2026

@copilot 我看到现在有9个文件,在IDE中显示了 Checkout 和Apply,这是什么意思?

这是您的 IDE(如 VS Code 或 JetBrains)中 GitHub Pull Request 插件的功能:

  • Checkout(检出):将本地代码切换到这个 PR 所在的分支(copilot/optimize-3d-agent-functions),可以在本地运行和测试这些改动
  • Apply(应用):直接将 PR 中的文件变更应用到当前工作区,不切换分支

这两个操作都是只在您本地生效的,不会影响远程仓库。9 个文件就是这个 PR 中修改的所有文件,包括 PromptRange 前端(Prompt.cshtmlprompt.js)、AgentsManager 前后端改动等。这是正常现象。

@JeffreySu
Copy link
Copy Markdown
Contributor

@copilot help me to solve these conflicts.

…emplateAppService, AgentTemplateRequest, PromptRangeAppService, and ViewPromptCodeRequest file location

Co-authored-by: JeffreySu <2281927+JeffreySu@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 4, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 4, 2026

@copilot help me to solve these conflicts.

Resolved. The merge with origin/Developer-3DAgents had 4 conflicting files:

  1. AgentTemplateAppService.cs — took the base branch's version (with delete/batch-delete functionality and refactored GetList) and added our CreateAgentFromPromptCode and GetListByPromptCode methods
  2. AgentTemplateRequest.cs — took the base branch's version and added our AgentTemplate_CreateFromPromptCodeRequest class
  3. PromptRangeAppService.cs — took the base branch's version and added our ViewPromptCodeList method with correct usings
  4. PromptRange_ViewPromptCodeRequest.cs — file location conflict resolved by keeping the file at the new path (Application/DTOs/Request/)

Merge commit: ddf5310

cursoragent and others added 15 commits April 8, 2026 16:32
Co-authored-by: Jeffrey Su <zsu@senparc.com>
Co-authored-by: Jeffrey Su <zsu@senparc.com>
Co-authored-by: Jeffrey Su <zsu@senparc.com>
- Updated Start.cshtml to include filterable and create options for select inputs.
- Normalized JSON parameters in Start.cshtml.cs and ModuleAppService.cs for consistent request handling.
- Introduced normalizeMultiValue method in start.js to handle multi-value inputs and ensure proper array formatting.
- Adjusted logic for setting default selected values in multi-select and dropdowns to improve user experience.
…types

- Updated MyFunctionRequest.cs to replace SelectionList with string and string[] for Operator and Power properties, enhancing clarity and usability.
- Modified BuildXncfAppService.AI.MCP.cs and related service classes to streamline handling of request parameters, removing unnecessary SelectionList usage.
- Adjusted BuildXncfRequest.cs and DatabaseMigrationRequest.cs to utilize direct data types for better performance and readability.
- Enhanced XncfStateRequest.cs and related classes to improve data loading and handling, ensuring consistent use of simplified types.
- Updated simulated site function requests to align with new data structure, ensuring compatibility and ease of use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants