feat: JSON-driven Add Action and Add Knowledge question trees#15714
Open
feat: JSON-driven Add Action and Add Knowledge question trees#15714
Conversation
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>
- 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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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→ generatesaddActionNode.jsontemplates/src/ui/addKnowledge.ts→ generatesaddKnowledgeNode.jsonscaffold/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 referencesrootNode.ts— getAddActionNode() / getAddKnowledgeNode() loadersgenerate-metadata.ts— outputs new JSON filesindex.ts— uses JSON-loaded treesVerification
Tested with local extension build + DA project (actionda):
[Dynamic Template] Loaded addActionNode.json from bundledworkitem