Skip to content

feat: JSON-driven Add Action and Add Knowledge question trees#15714

Open
qfai wants to merge 9 commits intodevfrom
feat/dynamic-treeview-ux
Open

feat: JSON-driven Add Action and Add Knowledge question trees#15714
qfai wants to merge 9 commits intodevfrom
feat/dynamic-treeview-ux

Conversation

@qfai
Copy link
Copy Markdown
Contributor

@qfai qfai commented Apr 15, 2026

Summary

Convert Add Action and Add Knowledge wizard flows from hardcoded TypeScript to JSON-driven loading, matching the pattern used by wizardNode.json for Create New Agent/App.

Motivation

Enable dynamic template publish to update Add Action / Add Knowledge wizard UI without releasing a new extension.

Changes

New files:

  • templates/src/ui/addAction.ts → generates addActionNode.json
  • templates/src/ui/addKnowledge.ts → generates addKnowledgeNode.json
  • scaffold/addActionNodes.ts — composite runtime nodes (API spec + MCP)
  • scaffold/addKnowledgeNodes.ts — composite runtime nodes (web/OneDrive/GC/embedded)

Modified:

  • constructNode.ts — 10 new runtime node references
  • rootNode.ts — getAddActionNode() / getAddKnowledgeNode() loaders
  • generate-metadata.ts — outputs new JSON files
  • index.ts — uses JSON-loaded trees

Verification

Tested with local extension build + DA project (actionda):

  • Add Action: shows "Start with an OpenAPI Description Document" ✅
  • Add Capability: shows all 4 options (Web Search, OneDrive, Copilot connector, Embedded Knowledge) ✅
  • Output log confirms JSON loading: [Dynamic Template] Loaded addActionNode.json from bundled
    workitem

Convert addPluginQuestionNode() and addKnowledgeQuestionNode() from
hardcoded TypeScript to JSON-driven loading, matching the pattern
used by wizardNode.json for Create New Agent/App.

New files:
- templates/src/ui/addAction.ts → addActionNode.json
- templates/src/ui/addKnowledge.ts → addKnowledgeNode.json
- scaffold/addActionNodes.ts — composite runtime nodes (API spec + MCP)
- scaffold/addKnowledgeNodes.ts — composite runtime nodes (web/OneDrive/GC/embedded)

Modified:
- constructNode.ts — 10 new runtime node references
- rootNode.ts — getAddActionNode() / getAddKnowledgeNode() loaders
- generate-metadata.ts — outputs new JSON files
- index.ts — uses JSON-loaded trees instead of hardcoded TS

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
qfai and others added 7 commits April 16, 2026 11:09
- addPlugin()/addKnowledge() now check platform: VSCode → JSON, CLI/VS → original TS
- Remove MCP option from addAction JSON (MCP is intentionally hidden on VSCode)
- Add skipSingleOption to addAction root (auto-skip when only OpenAPI option)

This prevents breaking CLI behavior (MCP option, dynamicOptions, platform checks).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ges)

gen:cli now uses the original TS question tree (not JSON) since
addPlugin()/addKnowledge() without platform falls back to TS path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…in JSON

- Delete addActionNodes.ts and addKnowledgeNodes.ts (unnecessary wrappers)
- Add Action: use existing apiSpecWithSearchNode instead of addActionApiSpecNode
- Add Knowledge: express sub-trees directly in JSON with individual node refs
  (searchTypeNode, webContentNode, gcItemNode, etc.)
- Register individual question functions in constructNode.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ctionType

Changed 'action-type' to 'api-plugin-type' in addActionNode JSON to match
QuestionNames.ActionType constant. Fixed prettier formatting in addKnowledge.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tests 'search by url' and 'append by url' passed OptionItem objects instead
of string IDs for SearchType. Added WebContent input and used .id consistently.
The TS path accidentally skipped the webContentNode due to type mismatch;
the JSON path correctly processes it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.01%. Comparing base (c228b0d) to head (6a34447).
⚠️ Report is 20 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #15714   +/-   ##
=======================================
  Coverage   93.00%   93.01%           
=======================================
  Files         623      623           
  Lines       38541    38582   +41     
  Branches     7122     7142   +20     
=======================================
+ Hits        35845    35886   +41     
  Misses       1957     1957           
  Partials      739      739           
Files with missing lines Coverage Δ
packages/fx-core/src/question/index.ts 97.33% <100.00%> (+0.19%) ⬆️
...ges/fx-core/src/question/scaffold/constructNode.ts 99.00% <100.00%> (+0.47%) ⬆️
...ages/fx-core/src/question/scaffold/vsc/rootNode.ts 88.46% <100.00%> (+2.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant