@danmoisan/drm-copilot-mcp 1.0.16 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/out/mcp-server.js +1287 -548
  2. package/package.json +5 -4
  3. package/resources/claude-customizations/.claude/agent-memory/epic-orchestrator/MEMORY.md +9 -0
  4. package/resources/claude-customizations/.claude/agent-memory/epic-orchestrator/feedback_commit_push_memory_before_pr.md +17 -0
  5. package/resources/claude-customizations/.claude/agent-memory/orchestrator/MEMORY.md +1 -0
  6. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_commit_push_memory_before_pr.md +16 -0
  7. package/resources/claude-customizations/.claude/agents/legacy-parity-analyst.md +64 -0
  8. package/resources/claude-customizations/.claude/agents/migration-coverage-reviewer.md +64 -0
  9. package/resources/claude-customizations/.claude/agents/requirements-reconciler.md +63 -0
  10. package/resources/claude-customizations/.claude/agents/runtime-characterization-analyst.md +64 -0
  11. package/resources/claude-customizations/.claude/hooks/enforce-discovery-artifact-gate.ps1 +213 -0
  12. package/resources/claude-customizations/.claude/hooks/validate-discovery-artifact-gate.ps1 +237 -0
  13. package/resources/claude-customizations/.claude/hooks/validate-planner-output.ps1 +5 -5
  14. package/resources/claude-customizations/.claude/rules/shell.md +88 -0
  15. package/resources/claude-customizations/.claude/settings.json +8 -0
  16. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/SKILL.md +132 -0
  17. package/resources/claude-customizations/.claude/skills/discovery-behavior-reconciliation/SKILL.md +65 -0
  18. package/resources/claude-customizations/.claude/skills/discovery-coverage-ledger/SKILL.md +66 -0
  19. package/resources/claude-customizations/.claude/skills/discovery-parity-matrix/SKILL.md +63 -0
  20. package/resources/claude-customizations/.claude/skills/discovery-repo-inventory/SKILL.md +80 -0
  21. package/resources/claude-customizations/.claude/skills/discovery-runtime-characterization/SKILL.md +63 -0
  22. package/resources/claude-customizations/.claude/skills/discovery-validate-artifacts/SKILL.md +79 -0
  23. package/resources/claude-customizations/.claude/skills/discovery-workflow/SKILL.md +146 -0
  24. package/resources/claude-customizations/.claude/skills/execute-hard-lock/SKILL.md +1 -1
  25. package/resources/claude-customizations/pack-manifests/core.json +14 -0
  26. package/resources/codex-and-agents-customizations/.agents/skills/execute-hard-lock/SKILL.md +1 -1
  27. package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
  28. package/resources/config/orchestration-routing.json +0 -2
  29. package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +24 -2
  30. package/resources/powershell/PoshQC/PoshQC.psm1 +32 -6
  31. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +13 -0
  32. package/resources/templates/policy_audit/policy-audit.yyyy-MM-ddTHH-mm.md +3 -3
package/out/mcp-server.js CHANGED
@@ -3771,6 +3771,7 @@ var require_fast_uri = __commonJS({
3771
3771
  return uriTokens.join("");
3772
3772
  }
3773
3773
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3774
+ var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
3774
3775
  function getParseError(parsed, matches) {
3775
3776
  if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
3776
3777
  return 'URI path must start with "/" when authority is present.';
@@ -3800,6 +3801,11 @@ var require_fast_uri = __commonJS({
3800
3801
  uri = "//" + uri;
3801
3802
  }
3802
3803
  }
3804
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
3805
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
3806
+ parsed.error = "URI authority must not contain a literal backslash.";
3807
+ malformedAuthorityOrPort = true;
3808
+ }
3803
3809
  const matches = uri.match(URI_PARSE);
3804
3810
  if (matches) {
3805
3811
  parsed.scheme = matches[1];
@@ -3843,7 +3849,7 @@ var require_fast_uri = __commonJS({
3843
3849
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
3844
3850
  if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
3845
3851
  try {
3846
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
3852
+ parsed.host = new URL("http://" + parsed.host).hostname;
3847
3853
  } catch (e) {
3848
3854
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
3849
3855
  }
@@ -15500,8 +15506,43 @@ function findExecutableOnPath(executable) {
15500
15506
  }
15501
15507
  return void 0;
15502
15508
  }
15503
- function detectRuntime(runtimeKind) {
15504
- void runtimeKind;
15509
+ function buildVenvInterpreterCandidate(workspaceRoot) {
15510
+ const normalizedRoot = workspaceRoot.replace(/\\/g, "/").replace(/\/+$/, "");
15511
+ const relativeInterpreter = process.platform === "win32" ? ".venv/Scripts/python.exe" : ".venv/bin/python";
15512
+ return `${normalizedRoot}/${relativeInterpreter}`;
15513
+ }
15514
+ function detectPythonRuntime(workspaceRoot) {
15515
+ if (workspaceRoot !== void 0 && workspaceRoot.trim().length > 0) {
15516
+ const venvInterpreter = buildVenvInterpreterCandidate(workspaceRoot);
15517
+ if (fs.existsSync(venvInterpreter)) {
15518
+ return {
15519
+ executable: venvInterpreter,
15520
+ argsPrefix: []
15521
+ };
15522
+ }
15523
+ }
15524
+ const resolvedPy = findExecutableOnPath("py");
15525
+ if (resolvedPy !== void 0) {
15526
+ return {
15527
+ executable: resolvedPy,
15528
+ argsPrefix: []
15529
+ };
15530
+ }
15531
+ const resolvedPython = findExecutableOnPath("python");
15532
+ if (resolvedPython !== void 0) {
15533
+ return {
15534
+ executable: resolvedPython,
15535
+ argsPrefix: []
15536
+ };
15537
+ }
15538
+ throw new Error(
15539
+ "Python runtime not found. Expected a workspace '.venv' interpreter or 'py' or 'python' on PATH."
15540
+ );
15541
+ }
15542
+ function detectRuntime(runtimeKind, workspaceRoot) {
15543
+ if (runtimeKind === "python") {
15544
+ return detectPythonRuntime(workspaceRoot);
15545
+ }
15505
15546
  if (executableExists("pwsh")) {
15506
15547
  return {
15507
15548
  executable: "pwsh",
@@ -15687,7 +15728,7 @@ function getStderrExcerpt(error2) {
15687
15728
  // ../../extensions/drm-copilot/src/mcp-push-down-schema-properties.ts
15688
15729
  var workspaceRootProperty = {
15689
15730
  type: "string",
15690
- description: "Target workspace root. Defaults to process.cwd() when omitted."
15731
+ description: "Required absolute path to the root of the target checkout or worktree. The MCP server cannot infer the calling agent's checkout, so this value must be supplied explicitly."
15691
15732
  };
15692
15733
  var codexPacksProperty = {
15693
15734
  type: "array",
@@ -15827,8 +15868,13 @@ function validateRequiredIssueNumber(issueNumber, fieldName) {
15827
15868
  }
15828
15869
  return normalizedIssueNumber;
15829
15870
  }
15830
- function normalizeWorkspaceRoot(value, fallbackWorkspaceRoot = process.cwd()) {
15871
+ function normalizeWorkspaceRoot(value, fallbackWorkspaceRoot) {
15831
15872
  if (value === void 0) {
15873
+ if (fallbackWorkspaceRoot === void 0) {
15874
+ throw new Error(
15875
+ "workspace_root is required. The MCP server cannot infer the calling agent's checkout; pass the absolute worktree root explicitly."
15876
+ );
15877
+ }
15832
15878
  return fallbackWorkspaceRoot;
15833
15879
  }
15834
15880
  return normalizeRequiredText(value, "workspace_root");
@@ -15842,458 +15888,6 @@ function normalizeWorkspaceDestinationPath(value, workspaceRoot, fieldName) {
15842
15888
  return resolvedPath.replace(/\\/g, "/");
15843
15889
  }
15844
15890
 
15845
- // ../../extensions/drm-copilot/src/mcp-repo-automation-tool-definitions.ts
15846
- var REPO_AUTOMATION_TOOL_DEFINITIONS = [
15847
- {
15848
- name: "collect_commit_context",
15849
- description: "Collect commit context artifacts from the target workspace using bundled extension resources.",
15850
- inputSchema: {
15851
- type: "object",
15852
- properties: {
15853
- workspace_root: workspaceRootProperty
15854
- },
15855
- additionalProperties: false
15856
- }
15857
- },
15858
- {
15859
- name: "collect_pr_context",
15860
- description: "Collect PR context artifacts for an explicit base branch using bundled extension resources.",
15861
- inputSchema: {
15862
- type: "object",
15863
- properties: {
15864
- workspace_root: workspaceRootProperty,
15865
- base: {
15866
- type: "string",
15867
- description: "Explicit base branch or ref used for PR context collection."
15868
- }
15869
- },
15870
- required: ["base"],
15871
- additionalProperties: false
15872
- }
15873
- },
15874
- {
15875
- name: "run_codex_native_converter",
15876
- description: "Run the bundled Codex-native converter in review or apply mode using the extension resources.",
15877
- inputSchema: {
15878
- type: "object",
15879
- properties: {
15880
- workspace_root: workspaceRootProperty,
15881
- mode: {
15882
- type: "string",
15883
- description: "Converter mode to execute."
15884
- },
15885
- source_ecosystem: {
15886
- type: "string",
15887
- description: "Supported source ecosystem for the conversion run."
15888
- },
15889
- source_root: {
15890
- type: "string",
15891
- description: "Workspace-relative or absolute source runtime root."
15892
- },
15893
- selected_paths: {
15894
- type: "array",
15895
- description: "Optional workspace-relative or absolute source paths beneath source_root.",
15896
- items: {
15897
- type: "string"
15898
- }
15899
- },
15900
- destination_root: {
15901
- type: "string",
15902
- description: "Workspace-relative or absolute destination root required for apply mode."
15903
- },
15904
- artifact_root: {
15905
- type: "string",
15906
- description: "Optional workspace-relative or absolute artifact output root."
15907
- },
15908
- enable_repo_prompts: {
15909
- type: "boolean",
15910
- description: "When true, allow repository-convention .codex/prompts outputs."
15911
- }
15912
- },
15913
- required: ["mode", "source_ecosystem", "source_root"],
15914
- additionalProperties: false
15915
- }
15916
- },
15917
- {
15918
- name: "push_down_copilot_customizations",
15919
- description: "Copy the bundled Copilot customization payload into the target workspace.",
15920
- inputSchema: {
15921
- type: "object",
15922
- properties: {
15923
- workspace_root: workspaceRootProperty,
15924
- ...copilotPushDownSelectionProperties
15925
- },
15926
- additionalProperties: false
15927
- }
15928
- },
15929
- {
15930
- name: "push_down_codex_and_agents_customizations",
15931
- description: "Copy the bundled Codex and agents customization payload into the target workspace.",
15932
- inputSchema: {
15933
- type: "object",
15934
- properties: {
15935
- workspace_root: workspaceRootProperty,
15936
- ...codexPushDownSelectionProperties
15937
- },
15938
- additionalProperties: false
15939
- }
15940
- },
15941
- {
15942
- name: "push_down_claude_customizations",
15943
- description: "Copy the bundled Claude Code customization payload into the target workspace.",
15944
- inputSchema: {
15945
- type: "object",
15946
- properties: {
15947
- workspace_root: workspaceRootProperty,
15948
- ...claudePushDownSelectionProperties
15949
- },
15950
- additionalProperties: false
15951
- }
15952
- },
15953
- {
15954
- name: "new_potential_bug_entry",
15955
- description: "Create a new potential bug entry in the target workspace from bundled templates.",
15956
- inputSchema: {
15957
- type: "object",
15958
- properties: {
15959
- workspace_root: workspaceRootProperty,
15960
- short_name: {
15961
- type: "string",
15962
- description: "Kebab-case short name for the potential bug entry."
15963
- }
15964
- },
15965
- required: ["short_name"],
15966
- additionalProperties: false
15967
- }
15968
- },
15969
- {
15970
- name: "new_potential_entry",
15971
- description: "Create a new potential entry in the target workspace from bundled templates.",
15972
- inputSchema: {
15973
- type: "object",
15974
- properties: {
15975
- workspace_root: workspaceRootProperty,
15976
- short_name: {
15977
- type: "string",
15978
- description: "Kebab-case short name for the potential entry."
15979
- }
15980
- },
15981
- required: ["short_name"],
15982
- additionalProperties: false
15983
- }
15984
- },
15985
- {
15986
- name: "link_parent_child",
15987
- description: "Link a child GitHub issue to a parent GitHub issue in the target workspace using the bundled PowerShell workflow.",
15988
- inputSchema: {
15989
- type: "object",
15990
- properties: {
15991
- workspace_root: workspaceRootProperty,
15992
- parent_issue_number: {
15993
- type: "string",
15994
- description: "Numeric issue number of the parent issue."
15995
- },
15996
- child_issue_number: {
15997
- type: "string",
15998
- description: "Numeric issue number of the child issue."
15999
- }
16000
- },
16001
- required: ["parent_issue_number", "child_issue_number"],
16002
- additionalProperties: false
16003
- }
16004
- },
16005
- {
16006
- name: "potential_to_issue",
16007
- description: "Promote a potential entry into an issue-oriented feature workflow in the target workspace.",
16008
- inputSchema: {
16009
- type: "object",
16010
- properties: {
16011
- workspace_root: workspaceRootProperty,
16012
- potential_path: {
16013
- type: "string",
16014
- description: "Absolute or workspace-relative path to the potential Markdown file."
16015
- },
16016
- promotion_type: {
16017
- type: "string",
16018
- enum: ["epic", "feature", "refactor", "bug"],
16019
- description: "Promotion type to generate."
16020
- },
16021
- work_mode: {
16022
- type: "string",
16023
- enum: ["minor-audit", "full-feature", "full-bug", "full"],
16024
- description: "Work mode marker applied to the resulting issue workflow."
16025
- }
16026
- },
16027
- required: ["potential_path", "promotion_type", "work_mode"],
16028
- additionalProperties: false
16029
- }
16030
- },
16031
- {
16032
- name: "new_active_feature_folder",
16033
- description: "Create a new active feature folder in the target workspace from bundled templates.",
16034
- inputSchema: {
16035
- type: "object",
16036
- properties: {
16037
- workspace_root: workspaceRootProperty,
16038
- feature_name: {
16039
- type: "string",
16040
- description: "Feature folder name using kebab-case or underscore-case letters and numbers."
16041
- },
16042
- type: {
16043
- type: "string",
16044
- enum: ["epic", "feature", "refactor", "bug"],
16045
- description: "Feature folder type to create."
16046
- },
16047
- issue_number: {
16048
- type: "string",
16049
- description: "Optional numeric issue number associated with the feature folder."
16050
- },
16051
- work_mode: {
16052
- type: "string",
16053
- enum: ["minor-audit", "full-feature", "full-bug", "full"],
16054
- description: "Work mode marker applied to the feature folder."
16055
- }
16056
- },
16057
- required: ["feature_name", "type", "work_mode"],
16058
- additionalProperties: false
16059
- }
16060
- },
16061
- {
16062
- name: "run_poshqc_format",
16063
- description: "Run bundled PoshQC formatting against the target workspace using bundled extension resources.",
16064
- inputSchema: {
16065
- type: "object",
16066
- properties: {
16067
- workspace_root: workspaceRootProperty,
16068
- scan_folders: {
16069
- type: "array",
16070
- items: {
16071
- type: "string"
16072
- },
16073
- description: "Optional workspace-relative or workspace-contained folders to scan."
16074
- }
16075
- },
16076
- additionalProperties: false
16077
- }
16078
- },
16079
- {
16080
- name: "run_poshqc_analyze",
16081
- description: "Run bundled PoshQC analysis against the target workspace using bundled extension resources.",
16082
- inputSchema: {
16083
- type: "object",
16084
- properties: {
16085
- workspace_root: workspaceRootProperty,
16086
- scan_folders: {
16087
- type: "array",
16088
- items: {
16089
- type: "string"
16090
- },
16091
- description: "Optional workspace-relative or workspace-contained folders to scan."
16092
- }
16093
- },
16094
- additionalProperties: false
16095
- }
16096
- },
16097
- {
16098
- name: "run_poshqc_test",
16099
- description: "Run bundled PoshQC Pester checks against the target workspace using bundled extension resources. When scan_folders is omitted, the scan set is resolved from config/poshqc-scan.json (test.scanFolders); an explicit scan_folders argument overrides the configuration.",
16100
- inputSchema: {
16101
- type: "object",
16102
- properties: {
16103
- workspace_root: workspaceRootProperty,
16104
- scan_folders: {
16105
- type: "array",
16106
- items: {
16107
- type: "string"
16108
- },
16109
- description: "Optional workspace-relative or workspace-contained folders to scan."
16110
- }
16111
- },
16112
- additionalProperties: false
16113
- }
16114
- },
16115
- {
16116
- name: "run_poshqc_analyze_autofix",
16117
- description: "Apply bundled PoshQC analyzer autofixes, then rerun analysis against the target workspace using bundled extension resources.",
16118
- inputSchema: {
16119
- type: "object",
16120
- properties: {
16121
- workspace_root: workspaceRootProperty,
16122
- scan_folders: {
16123
- type: "array",
16124
- items: {
16125
- type: "string"
16126
- },
16127
- description: "Optional workspace-relative or workspace-contained folders to scan."
16128
- }
16129
- },
16130
- additionalProperties: false
16131
- }
16132
- },
16133
- {
16134
- name: "run_poshqc_suite",
16135
- description: "Run the bundled PoshQC suite against the target workspace using bundled extension resources.",
16136
- inputSchema: {
16137
- type: "object",
16138
- properties: {
16139
- workspace_root: workspaceRootProperty,
16140
- scan_folders: {
16141
- type: "array",
16142
- items: {
16143
- type: "string"
16144
- },
16145
- description: "Optional workspace-relative or workspace-contained folders to scan."
16146
- }
16147
- },
16148
- additionalProperties: false
16149
- }
16150
- },
16151
- {
16152
- name: "resolve_policy_audit_template_asset",
16153
- description: "Resolve a bundled policy-audit template asset from the published extension package, optionally copying it into the target workspace.",
16154
- inputSchema: {
16155
- type: "object",
16156
- properties: {
16157
- workspace_root: workspaceRootProperty,
16158
- asset: {
16159
- type: "string",
16160
- enum: [...POLICY_AUDIT_TEMPLATE_ASSET_SELECTORS],
16161
- description: "Bundled policy-audit asset selector: 'template' for policy-audit.yyyy-MM-ddTHH-mm.md, 'code-review-template' for code-review.yyyy-MM-ddTHH-mm.md, 'feature-audit-template' for feature-audit.yyyy-MM-ddTHH-mm.md, or 'agents' for AGENTS.md."
16162
- },
16163
- target_path: {
16164
- type: "string",
16165
- description: "Optional workspace-relative or absolute destination path for a copied asset."
16166
- }
16167
- },
16168
- required: ["asset"],
16169
- additionalProperties: false
16170
- }
16171
- },
16172
- {
16173
- name: "resolve_execute_hard_lock_prompt",
16174
- description: "Resolve the execute hard-lock prompt for a target plan path using bundled extension resources.",
16175
- inputSchema: {
16176
- type: "object",
16177
- properties: {
16178
- workspace_root: workspaceRootProperty,
16179
- target: {
16180
- type: "string",
16181
- description: "Target Markdown plan path to resolve."
16182
- }
16183
- },
16184
- required: ["target"],
16185
- additionalProperties: false
16186
- }
16187
- },
16188
- {
16189
- name: "resolve_atomic_plan_prompt",
16190
- description: "Resolve the atomic-plan prompt for a target plan path using bundled extension resources.",
16191
- inputSchema: {
16192
- type: "object",
16193
- properties: {
16194
- workspace_root: workspaceRootProperty,
16195
- target: {
16196
- type: "string",
16197
- description: "Target Markdown plan path to resolve."
16198
- }
16199
- },
16200
- required: ["target"],
16201
- additionalProperties: false
16202
- }
16203
- },
16204
- {
16205
- name: "validate_orchestration_artifacts",
16206
- description: "Validate an orchestration artifact, including epic planner, kickoff, and execution checkpoints, against its structural schema.",
16207
- inputSchema: {
16208
- type: "object",
16209
- properties: {
16210
- workspace_root: workspaceRootProperty,
16211
- artifact_type: {
16212
- type: "string",
16213
- enum: [
16214
- "plan",
16215
- "policy-audit",
16216
- "code-review",
16217
- "feature-audit",
16218
- "orchestrator-state",
16219
- "epic-orchestrator-state",
16220
- "epic-planner-state",
16221
- "epic-kickoff"
16222
- ],
16223
- description: "The type of orchestration artifact to validate."
16224
- },
16225
- artifact_path: {
16226
- type: "string",
16227
- description: "Workspace-relative or absolute path to the artifact file."
16228
- },
16229
- require_complete: {
16230
- type: "boolean",
16231
- description: "When true and artifact_type is 'orchestrator-state' or 'epic-orchestrator-state', require all phases to be complete."
16232
- },
16233
- require_model_routing: {
16234
- type: "boolean",
16235
- description: "When true and artifact_type is 'orchestrator-state', require a model_routing_receipts entry per delegated agent once a delegation is recorded. The TypeScript side performs the existence check only; the Python validator is authoritative for full per-receipt correctness."
16236
- },
16237
- require_codex_model_routing: {
16238
- type: "boolean",
16239
- description: "When true for an orchestrator checkpoint, require canonical Codex deployment receipts for delegated agents."
16240
- },
16241
- require_codex_topology: {
16242
- type: "boolean",
16243
- description: "When true for an orchestrator checkpoint, require canonical Codex topology receipts for delegated agents and epic roots."
16244
- },
16245
- require_ready_for_execution: {
16246
- type: "boolean",
16247
- description: "When true and artifact_type is 'epic-planner-state', require every child to be prepared and preflight-cleared."
16248
- }
16249
- },
16250
- required: ["artifact_type", "artifact_path"],
16251
- additionalProperties: false
16252
- }
16253
- },
16254
- {
16255
- name: "render_subagent_tree",
16256
- description: "Render the subagent call tree for a root session id. The session id is a transcript filename stem; the transcript is resolved under the user-global Claude projects directory, searching the encoded workspace directory plus its '-wt-' worktree siblings (case-insensitive) and returning the first match deterministically.",
16257
- inputSchema: {
16258
- type: "object",
16259
- properties: {
16260
- workspace_root: workspaceRootProperty,
16261
- session_id: {
16262
- type: "string",
16263
- description: "Root session identifier (transcript filename stem under ~/.claude/projects/<encoded-workspace>/, e.g. a UUIDv4)."
16264
- }
16265
- },
16266
- required: ["session_id"],
16267
- additionalProperties: false
16268
- }
16269
- }
16270
- ];
16271
-
16272
- // ../../extensions/drm-copilot/src/repo-automation-tool-names.ts
16273
- var REPO_AUTOMATION_TOOLS = [
16274
- "collect_commit_context",
16275
- "collect_pr_context",
16276
- "run_codex_native_converter",
16277
- "push_down_copilot_customizations",
16278
- "push_down_codex_and_agents_customizations",
16279
- "push_down_claude_customizations",
16280
- "new_potential_bug_entry",
16281
- "new_potential_entry",
16282
- "link_parent_child",
16283
- "potential_to_issue",
16284
- "new_active_feature_folder",
16285
- "run_poshqc_format",
16286
- "run_poshqc_analyze",
16287
- "run_poshqc_test",
16288
- "run_poshqc_analyze_autofix",
16289
- "run_poshqc_suite",
16290
- "resolve_policy_audit_template_asset",
16291
- "resolve_execute_hard_lock_prompt",
16292
- "resolve_atomic_plan_prompt",
16293
- "validate_orchestration_artifacts",
16294
- "render_subagent_tree"
16295
- ];
16296
-
16297
15891
  // ../../extensions/drm-copilot/src/mcp-tool-inputs-push-down.ts
16298
15892
  function resolvePacksField(rawValue) {
16299
15893
  if (rawValue === void 0) {
@@ -16359,6 +15953,32 @@ function resolvePushDownCodexAndAgentsCustomizationsToolInput(rawInput, fallback
16359
15953
  };
16360
15954
  }
16361
15955
 
15956
+ // ../../extensions/drm-copilot/src/mcp-tool-inputs-potential-to-issue.ts
15957
+ function resolvePotentialToIssueToolInput(rawInput, fallbackWorkspaceRoot) {
15958
+ const args = asToolArgumentObject(rawInput);
15959
+ const workspaceRoot = normalizeWorkspaceRoot(
15960
+ args["workspace_root"],
15961
+ fallbackWorkspaceRoot
15962
+ );
15963
+ const potentialPath = normalizeWorkspaceDestinationPath(
15964
+ normalizeRequiredText(args["potential_path"], "potential_path"),
15965
+ workspaceRoot,
15966
+ "potential_path"
15967
+ );
15968
+ return {
15969
+ workspaceRoot,
15970
+ potentialPath,
15971
+ promotionType: validatePromotionType(
15972
+ normalizeRequiredText(args["promotion_type"], "promotion_type"),
15973
+ "promotion_type"
15974
+ ),
15975
+ workMode: validateWorkMode(
15976
+ normalizeRequiredText(args["work_mode"], "work_mode"),
15977
+ "work_mode"
15978
+ )
15979
+ };
15980
+ }
15981
+
16362
15982
  // ../../extensions/drm-copilot/src/mcp-tool-inputs.ts
16363
15983
  function asToolArgumentObject(rawInput) {
16364
15984
  if (rawInput === void 0) {
@@ -16529,24 +16149,6 @@ function resolveLinkParentChildToolInput(rawInput, fallbackWorkspaceRoot) {
16529
16149
  )
16530
16150
  };
16531
16151
  }
16532
- function resolvePotentialToIssueToolInput(rawInput, fallbackWorkspaceRoot) {
16533
- const args = asToolArgumentObject(rawInput);
16534
- return {
16535
- workspaceRoot: normalizeWorkspaceRoot(
16536
- args["workspace_root"],
16537
- fallbackWorkspaceRoot
16538
- ),
16539
- potentialPath: normalizeRequiredText(
16540
- args["potential_path"],
16541
- "potential_path"
16542
- ),
16543
- promotionType: resolvePromotionTypeField(
16544
- args["promotion_type"],
16545
- "promotion_type"
16546
- ),
16547
- workMode: resolveWorkModeField(args["work_mode"], "work_mode")
16548
- };
16549
- }
16550
16152
  function resolveNewActiveFeatureFolderToolInput(rawInput, fallbackWorkspaceRoot) {
16551
16153
  const args = asToolArgumentObject(rawInput);
16552
16154
  const issueNumber = validateIssueNumber(
@@ -16606,72 +16208,868 @@ function resolvePolicyAuditTemplateAssetToolInput(rawInput, fallbackWorkspaceRoo
16606
16208
  "target_path"
16607
16209
  )
16608
16210
  }
16609
- };
16610
- }
16611
- function resolveRunPoshQCSuiteToolInput(rawInput, fallbackWorkspaceRoot) {
16612
- const args = asToolArgumentObject(rawInput);
16613
- const scanFolders = args["scan_folders"];
16614
- if (scanFolders === void 0) {
16615
- return {
16616
- workspaceRoot: normalizeWorkspaceRoot(
16617
- args["workspace_root"],
16618
- fallbackWorkspaceRoot
16619
- )
16620
- };
16621
- }
16622
- if (!Array.isArray(scanFolders)) {
16623
- throw new Error("Field 'scan_folders' must be an array when provided.");
16624
- }
16625
- return {
16626
- workspaceRoot: normalizeWorkspaceRoot(
16627
- args["workspace_root"],
16628
- fallbackWorkspaceRoot
16629
- ),
16630
- scanFolders: scanFolders.map(
16631
- (folder, index) => normalizeRequiredText(folder, `scan_folders[${index}]`)
16632
- )
16633
- };
16634
- }
16635
- var VALID_ARTIFACT_TYPES = /* @__PURE__ */ new Set([
16636
- "plan",
16637
- "policy-audit",
16638
- "code-review",
16639
- "feature-audit",
16640
- "orchestrator-state",
16641
- "epic-orchestrator-state",
16642
- "epic-planner-state",
16643
- "epic-kickoff"
16644
- ]);
16645
- function resolveValidateOrchestrationArtifactsToolInput(rawInput, fallbackWorkspaceRoot) {
16646
- const args = asToolArgumentObject(rawInput);
16647
- const artifactType = normalizeRequiredText(
16648
- args["artifact_type"],
16649
- "artifact_type"
16650
- );
16651
- if (!VALID_ARTIFACT_TYPES.has(artifactType)) {
16652
- throw new Error(
16653
- `Field 'artifact_type' must be one of: ${[...VALID_ARTIFACT_TYPES].join(", ")}. Got '${artifactType}'.`
16654
- );
16655
- }
16656
- const requireComplete = args["require_complete"];
16657
- const requireModelRouting = args["require_model_routing"];
16658
- const requireCodexModelRouting = args["require_codex_model_routing"];
16659
- const requireCodexTopology = args["require_codex_topology"];
16660
- const requireReadyForExecution = args["require_ready_for_execution"];
16661
- return {
16662
- workspaceRoot: normalizeWorkspaceRoot(
16663
- args["workspace_root"],
16664
- fallbackWorkspaceRoot
16665
- ),
16666
- artifactType,
16667
- artifactPath: normalizeRequiredText(args["artifact_path"], "artifact_path"),
16668
- ...requireComplete === true ? { requireComplete: true } : {},
16669
- ...requireModelRouting === true ? { requireModelRouting: true } : {},
16670
- ...requireCodexModelRouting === true ? { requireCodexModelRouting: true } : {},
16671
- ...requireCodexTopology === true ? { requireCodexTopology: true } : {},
16672
- ...requireReadyForExecution === true ? { requireReadyForExecution: true } : {}
16673
- };
16674
- }
16211
+ };
16212
+ }
16213
+ function resolveRunPoshQCSuiteToolInput(rawInput, fallbackWorkspaceRoot) {
16214
+ const args = asToolArgumentObject(rawInput);
16215
+ const scanFolders = args["scan_folders"];
16216
+ if (scanFolders === void 0) {
16217
+ return {
16218
+ workspaceRoot: normalizeWorkspaceRoot(
16219
+ args["workspace_root"],
16220
+ fallbackWorkspaceRoot
16221
+ )
16222
+ };
16223
+ }
16224
+ if (!Array.isArray(scanFolders)) {
16225
+ throw new Error("Field 'scan_folders' must be an array when provided.");
16226
+ }
16227
+ return {
16228
+ workspaceRoot: normalizeWorkspaceRoot(
16229
+ args["workspace_root"],
16230
+ fallbackWorkspaceRoot
16231
+ ),
16232
+ scanFolders: scanFolders.map(
16233
+ (folder, index) => normalizeRequiredText(folder, `scan_folders[${index}]`)
16234
+ )
16235
+ };
16236
+ }
16237
+ var VALID_ARTIFACT_TYPES = /* @__PURE__ */ new Set([
16238
+ "plan",
16239
+ "policy-audit",
16240
+ "code-review",
16241
+ "feature-audit",
16242
+ "orchestrator-state",
16243
+ "epic-orchestrator-state",
16244
+ "epic-planner-state",
16245
+ "epic-kickoff"
16246
+ ]);
16247
+ function resolveValidateOrchestrationArtifactsToolInput(rawInput, fallbackWorkspaceRoot) {
16248
+ const args = asToolArgumentObject(rawInput);
16249
+ const artifactType = normalizeRequiredText(
16250
+ args["artifact_type"],
16251
+ "artifact_type"
16252
+ );
16253
+ if (!VALID_ARTIFACT_TYPES.has(artifactType)) {
16254
+ throw new Error(
16255
+ `Field 'artifact_type' must be one of: ${[...VALID_ARTIFACT_TYPES].join(", ")}. Got '${artifactType}'.`
16256
+ );
16257
+ }
16258
+ const requireComplete = args["require_complete"];
16259
+ const requireModelRouting = args["require_model_routing"];
16260
+ const requireCodexModelRouting = args["require_codex_model_routing"];
16261
+ const requireCodexTopology = args["require_codex_topology"];
16262
+ const requireReadyForExecution = args["require_ready_for_execution"];
16263
+ return {
16264
+ workspaceRoot: normalizeWorkspaceRoot(
16265
+ args["workspace_root"],
16266
+ fallbackWorkspaceRoot
16267
+ ),
16268
+ artifactType,
16269
+ artifactPath: normalizeRequiredText(args["artifact_path"], "artifact_path"),
16270
+ ...requireComplete === true ? { requireComplete: true } : {},
16271
+ ...requireModelRouting === true ? { requireModelRouting: true } : {},
16272
+ ...requireCodexModelRouting === true ? { requireCodexModelRouting: true } : {},
16273
+ ...requireCodexTopology === true ? { requireCodexTopology: true } : {},
16274
+ ...requireReadyForExecution === true ? { requireReadyForExecution: true } : {}
16275
+ };
16276
+ }
16277
+
16278
+ // ../../extensions/drm-copilot/src/mcp-tool-inputs-discovery.ts
16279
+ var DISCOVERY_ARTIFACT_TYPES = [
16280
+ "profile",
16281
+ "feature-contract",
16282
+ "coverage-ledger",
16283
+ "runtime-scenario",
16284
+ "parity-matrix",
16285
+ "unspecified-behavior",
16286
+ "product-decision",
16287
+ "evidence-reference",
16288
+ "all"
16289
+ ];
16290
+ var DISCOVERY_REPORT_TYPES = [
16291
+ "coverage",
16292
+ "parity",
16293
+ "completion"
16294
+ ];
16295
+ function normalizeOptionalBoolean(value, fieldName) {
16296
+ if (value === void 0) {
16297
+ return void 0;
16298
+ }
16299
+ if (typeof value !== "boolean") {
16300
+ throw new Error(`Field '${fieldName}' must be a boolean when provided.`);
16301
+ }
16302
+ return value;
16303
+ }
16304
+ function resolveValidateDiscoveryArtifactsToolInput(rawInput, fallbackWorkspaceRoot) {
16305
+ const args = asToolArgumentObject(rawInput);
16306
+ const artifactType = validateChoice(
16307
+ normalizeRequiredText(args["artifact_type"], "artifact_type"),
16308
+ "artifact_type",
16309
+ DISCOVERY_ARTIFACT_TYPES
16310
+ );
16311
+ return {
16312
+ workspaceRoot: normalizeWorkspaceRoot(
16313
+ args["workspace_root"],
16314
+ fallbackWorkspaceRoot
16315
+ ),
16316
+ artifactType,
16317
+ artifactPath: normalizeRequiredText(args["artifact_path"], "artifact_path")
16318
+ };
16319
+ }
16320
+ function resolveRunDiscoveryInitToolInput(rawInput, fallbackWorkspaceRoot) {
16321
+ const args = asToolArgumentObject(rawInput);
16322
+ const templateRoot = normalizeOptionalText(
16323
+ args["template_root"],
16324
+ "template_root"
16325
+ );
16326
+ const force = normalizeOptionalBoolean(args["force"], "force");
16327
+ return {
16328
+ workspaceRoot: normalizeWorkspaceRoot(
16329
+ args["workspace_root"],
16330
+ fallbackWorkspaceRoot
16331
+ ),
16332
+ targetDir: normalizeRequiredText(args["target_dir"], "target_dir"),
16333
+ ...templateRoot === void 0 ? {} : { templateRoot },
16334
+ ...force === void 0 ? {} : { force }
16335
+ };
16336
+ }
16337
+ function resolveDiscoveryAnalyzerToolInput(rawInput, fallbackWorkspaceRoot) {
16338
+ const args = asToolArgumentObject(rawInput);
16339
+ const profilePath = normalizeOptionalText(
16340
+ args["profile_path"],
16341
+ "profile_path"
16342
+ );
16343
+ const outputDir = normalizeOptionalText(args["output_dir"], "output_dir");
16344
+ return {
16345
+ workspaceRoot: normalizeWorkspaceRoot(
16346
+ args["workspace_root"],
16347
+ fallbackWorkspaceRoot
16348
+ ),
16349
+ ...profilePath === void 0 ? {} : { profilePath },
16350
+ ...outputDir === void 0 ? {} : { outputDir }
16351
+ };
16352
+ }
16353
+ function resolveRunDiscoveryRepoInventoryToolInput(rawInput, fallbackWorkspaceRoot) {
16354
+ return resolveDiscoveryAnalyzerToolInput(rawInput, fallbackWorkspaceRoot);
16355
+ }
16356
+ function resolveRunDiscoveryDotnetAnalyzerToolInput(rawInput, fallbackWorkspaceRoot) {
16357
+ return resolveDiscoveryAnalyzerToolInput(rawInput, fallbackWorkspaceRoot);
16358
+ }
16359
+ function resolveRunDiscoveryVstoAnalyzerToolInput(rawInput, fallbackWorkspaceRoot) {
16360
+ return resolveDiscoveryAnalyzerToolInput(rawInput, fallbackWorkspaceRoot);
16361
+ }
16362
+ function resolveRunDiscoveryScenarioGenerationToolInput(rawInput, fallbackWorkspaceRoot) {
16363
+ const args = asToolArgumentObject(rawInput);
16364
+ const outputPath = normalizeOptionalText(args["output_path"], "output_path");
16365
+ const check = normalizeOptionalBoolean(args["check"], "check");
16366
+ return {
16367
+ workspaceRoot: normalizeWorkspaceRoot(
16368
+ args["workspace_root"],
16369
+ fallbackWorkspaceRoot
16370
+ ),
16371
+ featureContract: normalizeRequiredText(
16372
+ args["feature_contract"],
16373
+ "feature_contract"
16374
+ ),
16375
+ parityMatrix: normalizeRequiredText(args["parity_matrix"], "parity_matrix"),
16376
+ runtimeCharacterization: normalizeRequiredText(
16377
+ args["runtime_characterization"],
16378
+ "runtime_characterization"
16379
+ ),
16380
+ ...outputPath === void 0 ? {} : { outputPath },
16381
+ ...check === void 0 ? {} : { check }
16382
+ };
16383
+ }
16384
+ function resolveRunDiscoveryReportToolInput(rawInput, fallbackWorkspaceRoot) {
16385
+ const args = asToolArgumentObject(rawInput);
16386
+ const reportType = validateChoice(
16387
+ normalizeRequiredText(args["report_type"], "report_type"),
16388
+ "report_type",
16389
+ DISCOVERY_REPORT_TYPES
16390
+ );
16391
+ const outputPath = normalizeOptionalText(args["output_path"], "output_path");
16392
+ const workspaceRoot = normalizeWorkspaceRoot(
16393
+ args["workspace_root"],
16394
+ fallbackWorkspaceRoot
16395
+ );
16396
+ if (reportType === "completion") {
16397
+ return {
16398
+ workspaceRoot,
16399
+ reportType,
16400
+ coverageInput: normalizeRequiredText(
16401
+ args["coverage_input"],
16402
+ "coverage_input"
16403
+ ),
16404
+ parityInput: normalizeRequiredText(args["parity_input"], "parity_input"),
16405
+ ...outputPath === void 0 ? {} : { outputPath }
16406
+ };
16407
+ }
16408
+ return {
16409
+ workspaceRoot,
16410
+ reportType,
16411
+ inputPath: normalizeRequiredText(args["input_path"], "input_path"),
16412
+ ...outputPath === void 0 ? {} : { outputPath }
16413
+ };
16414
+ }
16415
+
16416
+ // ../../extensions/drm-copilot/src/mcp-discovery-tool-definitions.ts
16417
+ var DISCOVERY_TOOL_DEFINITIONS = [
16418
+ {
16419
+ name: "validate_discovery_artifacts",
16420
+ description: "Validate a discovery artifact against its declared schema by invoking the workspace discovery CLI. The artifact_type selects the per-kind validator entry.",
16421
+ inputSchema: {
16422
+ type: "object",
16423
+ properties: {
16424
+ workspace_root: workspaceRootProperty,
16425
+ artifact_type: {
16426
+ type: "string",
16427
+ enum: [...DISCOVERY_ARTIFACT_TYPES],
16428
+ description: "Discovery artifact kind to validate; 'all' validates every kind under the supplied path."
16429
+ },
16430
+ artifact_path: {
16431
+ type: "string",
16432
+ description: "Workspace-relative or absolute path to the artifact (or directory for 'all')."
16433
+ }
16434
+ },
16435
+ required: ["workspace_root", "artifact_type", "artifact_path"],
16436
+ additionalProperties: false
16437
+ }
16438
+ },
16439
+ {
16440
+ name: "run_discovery_init",
16441
+ description: "Scaffold a discovery workspace by invoking the workspace discovery init CLI at the target directory.",
16442
+ inputSchema: {
16443
+ type: "object",
16444
+ properties: {
16445
+ workspace_root: workspaceRootProperty,
16446
+ target_dir: {
16447
+ type: "string",
16448
+ description: "Workspace-relative or absolute directory to scaffold the discovery workspace into."
16449
+ },
16450
+ template_root: {
16451
+ type: "string",
16452
+ description: "Optional template root overriding the CLI default."
16453
+ },
16454
+ force: {
16455
+ type: "boolean",
16456
+ description: "When true, overwrite existing scaffold files."
16457
+ }
16458
+ },
16459
+ required: ["workspace_root", "target_dir"],
16460
+ additionalProperties: false
16461
+ }
16462
+ },
16463
+ {
16464
+ name: "run_discovery_repo_inventory",
16465
+ description: "Run the repository inventory analyzer via the workspace discovery CLI, returning the written artifact paths.",
16466
+ inputSchema: {
16467
+ type: "object",
16468
+ properties: {
16469
+ workspace_root: workspaceRootProperty,
16470
+ profile_path: {
16471
+ type: "string",
16472
+ description: "Optional domain-profile path; the CLI default filename applies when omitted."
16473
+ },
16474
+ output_dir: {
16475
+ type: "string",
16476
+ description: "Optional output directory for the analysis artifacts."
16477
+ }
16478
+ },
16479
+ required: ["workspace_root"],
16480
+ additionalProperties: false
16481
+ }
16482
+ },
16483
+ {
16484
+ name: "run_discovery_dotnet_analyzer",
16485
+ description: "Run the .NET stack analyzer via the workspace discovery CLI, returning the written artifact paths.",
16486
+ inputSchema: {
16487
+ type: "object",
16488
+ properties: {
16489
+ workspace_root: workspaceRootProperty,
16490
+ profile_path: {
16491
+ type: "string",
16492
+ description: "Optional domain-profile path; the CLI default filename applies when omitted."
16493
+ },
16494
+ output_dir: {
16495
+ type: "string",
16496
+ description: "Optional output directory for the analysis artifacts."
16497
+ }
16498
+ },
16499
+ required: ["workspace_root"],
16500
+ additionalProperties: false
16501
+ }
16502
+ },
16503
+ {
16504
+ name: "run_discovery_vsto_analyzer",
16505
+ description: "Run the VSTO stack analyzer via the workspace discovery CLI, returning the written artifact paths.",
16506
+ inputSchema: {
16507
+ type: "object",
16508
+ properties: {
16509
+ workspace_root: workspaceRootProperty,
16510
+ profile_path: {
16511
+ type: "string",
16512
+ description: "Optional domain-profile path; the CLI default filename applies when omitted."
16513
+ },
16514
+ output_dir: {
16515
+ type: "string",
16516
+ description: "Optional output directory for the analysis artifacts."
16517
+ }
16518
+ },
16519
+ required: ["workspace_root"],
16520
+ additionalProperties: false
16521
+ }
16522
+ },
16523
+ {
16524
+ name: "run_discovery_scenario_generation",
16525
+ description: "Generate acceptance scenarios via the workspace discovery CLI from a feature contract, parity matrix, and runtime characterization.",
16526
+ inputSchema: {
16527
+ type: "object",
16528
+ properties: {
16529
+ workspace_root: workspaceRootProperty,
16530
+ feature_contract: {
16531
+ type: "string",
16532
+ description: "Workspace-relative or absolute feature-contract path."
16533
+ },
16534
+ parity_matrix: {
16535
+ type: "string",
16536
+ description: "Workspace-relative or absolute parity-matrix path."
16537
+ },
16538
+ runtime_characterization: {
16539
+ type: "string",
16540
+ description: "Workspace-relative or absolute runtime-characterization path."
16541
+ },
16542
+ output_path: {
16543
+ type: "string",
16544
+ description: "Optional output path; when supplied the written artifact path is returned."
16545
+ },
16546
+ check: {
16547
+ type: "boolean",
16548
+ description: "When true, run in check mode without writing generated scenarios."
16549
+ }
16550
+ },
16551
+ required: [
16552
+ "workspace_root",
16553
+ "feature_contract",
16554
+ "parity_matrix",
16555
+ "runtime_characterization"
16556
+ ],
16557
+ additionalProperties: false
16558
+ }
16559
+ },
16560
+ {
16561
+ name: "run_discovery_report",
16562
+ description: "Generate a discovery report via the workspace discovery CLI. report_type selects the report: 'coverage' and 'parity' require input_path; 'completion' requires both coverage_input and parity_input. The per-report_type required inputs are enforced by the tool before any invocation.",
16563
+ inputSchema: {
16564
+ type: "object",
16565
+ properties: {
16566
+ workspace_root: workspaceRootProperty,
16567
+ report_type: {
16568
+ type: "string",
16569
+ enum: [...DISCOVERY_REPORT_TYPES],
16570
+ description: "Report kind: 'coverage'/'parity' (single input) or 'completion' (coverage + parity inputs)."
16571
+ },
16572
+ input_path: {
16573
+ type: "string",
16574
+ description: "Required for 'coverage'/'parity': the ledger or matrix input path."
16575
+ },
16576
+ coverage_input: {
16577
+ type: "string",
16578
+ description: "Required for 'completion': the coverage-ledger input path."
16579
+ },
16580
+ parity_input: {
16581
+ type: "string",
16582
+ description: "Required for 'completion': the parity-matrix input path."
16583
+ },
16584
+ output_path: {
16585
+ type: "string",
16586
+ description: "Optional output path for the generated report."
16587
+ }
16588
+ },
16589
+ required: ["workspace_root", "report_type"],
16590
+ additionalProperties: false
16591
+ }
16592
+ }
16593
+ ];
16594
+
16595
+ // ../../extensions/drm-copilot/src/mcp-repo-automation-tool-definitions-poshqc.ts
16596
+ var POSHQC_TOOL_DEFINITIONS = [
16597
+ {
16598
+ name: "run_poshqc_format",
16599
+ description: "Run bundled PoshQC formatting against the target workspace using bundled extension resources.",
16600
+ inputSchema: {
16601
+ type: "object",
16602
+ properties: {
16603
+ workspace_root: workspaceRootProperty,
16604
+ scan_folders: {
16605
+ type: "array",
16606
+ items: {
16607
+ type: "string"
16608
+ },
16609
+ description: "Optional workspace-relative or workspace-contained folders to scan."
16610
+ }
16611
+ },
16612
+ required: ["workspace_root"],
16613
+ additionalProperties: false
16614
+ }
16615
+ },
16616
+ {
16617
+ name: "run_poshqc_analyze",
16618
+ description: "Run bundled PoshQC analysis against the target workspace using bundled extension resources.",
16619
+ inputSchema: {
16620
+ type: "object",
16621
+ properties: {
16622
+ workspace_root: workspaceRootProperty,
16623
+ scan_folders: {
16624
+ type: "array",
16625
+ items: {
16626
+ type: "string"
16627
+ },
16628
+ description: "Optional workspace-relative or workspace-contained folders to scan."
16629
+ }
16630
+ },
16631
+ required: ["workspace_root"],
16632
+ additionalProperties: false
16633
+ }
16634
+ },
16635
+ {
16636
+ name: "run_poshqc_test",
16637
+ description: "Run bundled PoshQC Pester checks against the target workspace using bundled extension resources. When scan_folders is omitted, the scan set is resolved from config/poshqc-scan.json (test.scanFolders); an explicit scan_folders argument overrides the configuration.",
16638
+ inputSchema: {
16639
+ type: "object",
16640
+ properties: {
16641
+ workspace_root: workspaceRootProperty,
16642
+ scan_folders: {
16643
+ type: "array",
16644
+ items: {
16645
+ type: "string"
16646
+ },
16647
+ description: "Optional workspace-relative or workspace-contained folders to scan."
16648
+ }
16649
+ },
16650
+ required: ["workspace_root"],
16651
+ additionalProperties: false
16652
+ }
16653
+ },
16654
+ {
16655
+ name: "run_poshqc_analyze_autofix",
16656
+ description: "Apply bundled PoshQC analyzer autofixes, then rerun analysis against the target workspace using bundled extension resources.",
16657
+ inputSchema: {
16658
+ type: "object",
16659
+ properties: {
16660
+ workspace_root: workspaceRootProperty,
16661
+ scan_folders: {
16662
+ type: "array",
16663
+ items: {
16664
+ type: "string"
16665
+ },
16666
+ description: "Optional workspace-relative or workspace-contained folders to scan."
16667
+ }
16668
+ },
16669
+ required: ["workspace_root"],
16670
+ additionalProperties: false
16671
+ }
16672
+ },
16673
+ {
16674
+ name: "run_poshqc_suite",
16675
+ description: "Run the bundled PoshQC suite against the target workspace using bundled extension resources.",
16676
+ inputSchema: {
16677
+ type: "object",
16678
+ properties: {
16679
+ workspace_root: workspaceRootProperty,
16680
+ scan_folders: {
16681
+ type: "array",
16682
+ items: {
16683
+ type: "string"
16684
+ },
16685
+ description: "Optional workspace-relative or workspace-contained folders to scan."
16686
+ }
16687
+ },
16688
+ required: ["workspace_root"],
16689
+ additionalProperties: false
16690
+ }
16691
+ }
16692
+ ];
16693
+
16694
+ // ../../extensions/drm-copilot/src/mcp-repo-automation-tool-definitions.ts
16695
+ var REPO_AUTOMATION_TOOL_DEFINITIONS = [
16696
+ {
16697
+ name: "collect_commit_context",
16698
+ description: "Collect commit context artifacts from the target workspace using bundled extension resources.",
16699
+ inputSchema: {
16700
+ type: "object",
16701
+ properties: {
16702
+ workspace_root: workspaceRootProperty
16703
+ },
16704
+ required: ["workspace_root"],
16705
+ additionalProperties: false
16706
+ }
16707
+ },
16708
+ {
16709
+ name: "collect_pr_context",
16710
+ description: "Collect PR context artifacts for an explicit base branch using bundled extension resources.",
16711
+ inputSchema: {
16712
+ type: "object",
16713
+ properties: {
16714
+ workspace_root: workspaceRootProperty,
16715
+ base: {
16716
+ type: "string",
16717
+ description: "Explicit base branch or ref used for PR context collection."
16718
+ }
16719
+ },
16720
+ required: ["workspace_root", "base"],
16721
+ additionalProperties: false
16722
+ }
16723
+ },
16724
+ {
16725
+ name: "run_codex_native_converter",
16726
+ description: "Run the bundled Codex-native converter in review or apply mode using the extension resources.",
16727
+ inputSchema: {
16728
+ type: "object",
16729
+ properties: {
16730
+ workspace_root: workspaceRootProperty,
16731
+ mode: {
16732
+ type: "string",
16733
+ description: "Converter mode to execute."
16734
+ },
16735
+ source_ecosystem: {
16736
+ type: "string",
16737
+ description: "Supported source ecosystem for the conversion run."
16738
+ },
16739
+ source_root: {
16740
+ type: "string",
16741
+ description: "Workspace-relative or absolute source runtime root."
16742
+ },
16743
+ selected_paths: {
16744
+ type: "array",
16745
+ description: "Optional workspace-relative or absolute source paths beneath source_root.",
16746
+ items: {
16747
+ type: "string"
16748
+ }
16749
+ },
16750
+ destination_root: {
16751
+ type: "string",
16752
+ description: "Workspace-relative or absolute destination root required for apply mode."
16753
+ },
16754
+ artifact_root: {
16755
+ type: "string",
16756
+ description: "Optional workspace-relative or absolute artifact output root."
16757
+ },
16758
+ enable_repo_prompts: {
16759
+ type: "boolean",
16760
+ description: "When true, allow repository-convention .codex/prompts outputs."
16761
+ }
16762
+ },
16763
+ required: ["workspace_root", "mode", "source_ecosystem", "source_root"],
16764
+ additionalProperties: false
16765
+ }
16766
+ },
16767
+ {
16768
+ name: "push_down_copilot_customizations",
16769
+ description: "Copy the bundled Copilot customization payload into the target workspace.",
16770
+ inputSchema: {
16771
+ type: "object",
16772
+ properties: {
16773
+ workspace_root: workspaceRootProperty,
16774
+ ...copilotPushDownSelectionProperties
16775
+ },
16776
+ required: ["workspace_root"],
16777
+ additionalProperties: false
16778
+ }
16779
+ },
16780
+ {
16781
+ name: "push_down_codex_and_agents_customizations",
16782
+ description: "Copy the bundled Codex and agents customization payload into the target workspace.",
16783
+ inputSchema: {
16784
+ type: "object",
16785
+ properties: {
16786
+ workspace_root: workspaceRootProperty,
16787
+ ...codexPushDownSelectionProperties
16788
+ },
16789
+ required: ["workspace_root"],
16790
+ additionalProperties: false
16791
+ }
16792
+ },
16793
+ {
16794
+ name: "push_down_claude_customizations",
16795
+ description: "Copy the bundled Claude Code customization payload into the target workspace.",
16796
+ inputSchema: {
16797
+ type: "object",
16798
+ properties: {
16799
+ workspace_root: workspaceRootProperty,
16800
+ ...claudePushDownSelectionProperties
16801
+ },
16802
+ required: ["workspace_root"],
16803
+ additionalProperties: false
16804
+ }
16805
+ },
16806
+ {
16807
+ name: "new_potential_bug_entry",
16808
+ description: "Create a new potential bug entry in the target workspace from bundled templates.",
16809
+ inputSchema: {
16810
+ type: "object",
16811
+ properties: {
16812
+ workspace_root: workspaceRootProperty,
16813
+ short_name: {
16814
+ type: "string",
16815
+ description: "Kebab-case short name for the potential bug entry."
16816
+ }
16817
+ },
16818
+ required: ["workspace_root", "short_name"],
16819
+ additionalProperties: false
16820
+ }
16821
+ },
16822
+ {
16823
+ name: "new_potential_entry",
16824
+ description: "Create a new potential entry in the target workspace from bundled templates.",
16825
+ inputSchema: {
16826
+ type: "object",
16827
+ properties: {
16828
+ workspace_root: workspaceRootProperty,
16829
+ short_name: {
16830
+ type: "string",
16831
+ description: "Kebab-case short name for the potential entry."
16832
+ }
16833
+ },
16834
+ required: ["workspace_root", "short_name"],
16835
+ additionalProperties: false
16836
+ }
16837
+ },
16838
+ {
16839
+ name: "link_parent_child",
16840
+ description: "Link a child GitHub issue to a parent GitHub issue in the target workspace using the bundled PowerShell workflow.",
16841
+ inputSchema: {
16842
+ type: "object",
16843
+ properties: {
16844
+ workspace_root: workspaceRootProperty,
16845
+ parent_issue_number: {
16846
+ type: "string",
16847
+ description: "Numeric issue number of the parent issue."
16848
+ },
16849
+ child_issue_number: {
16850
+ type: "string",
16851
+ description: "Numeric issue number of the child issue."
16852
+ }
16853
+ },
16854
+ required: ["workspace_root", "parent_issue_number", "child_issue_number"],
16855
+ additionalProperties: false
16856
+ }
16857
+ },
16858
+ {
16859
+ name: "potential_to_issue",
16860
+ description: "Promote a potential entry into an issue-oriented feature workflow in the target workspace.",
16861
+ inputSchema: {
16862
+ type: "object",
16863
+ properties: {
16864
+ workspace_root: workspaceRootProperty,
16865
+ potential_path: {
16866
+ type: "string",
16867
+ description: "Absolute or workspace-relative path to the potential Markdown file."
16868
+ },
16869
+ promotion_type: {
16870
+ type: "string",
16871
+ enum: ["epic", "feature", "refactor", "bug"],
16872
+ description: "Promotion type to generate."
16873
+ },
16874
+ work_mode: {
16875
+ type: "string",
16876
+ enum: ["minor-audit", "full-feature", "full-bug", "full"],
16877
+ description: "Work mode marker applied to the resulting issue workflow."
16878
+ }
16879
+ },
16880
+ required: [
16881
+ "workspace_root",
16882
+ "potential_path",
16883
+ "promotion_type",
16884
+ "work_mode"
16885
+ ],
16886
+ additionalProperties: false
16887
+ }
16888
+ },
16889
+ {
16890
+ name: "new_active_feature_folder",
16891
+ description: "Create a new active feature folder in the target workspace from bundled templates.",
16892
+ inputSchema: {
16893
+ type: "object",
16894
+ properties: {
16895
+ workspace_root: workspaceRootProperty,
16896
+ feature_name: {
16897
+ type: "string",
16898
+ description: "Feature folder name using kebab-case or underscore-case letters and numbers."
16899
+ },
16900
+ type: {
16901
+ type: "string",
16902
+ enum: ["epic", "feature", "refactor", "bug"],
16903
+ description: "Feature folder type to create."
16904
+ },
16905
+ issue_number: {
16906
+ type: "string",
16907
+ description: "Optional numeric issue number associated with the feature folder."
16908
+ },
16909
+ work_mode: {
16910
+ type: "string",
16911
+ enum: ["minor-audit", "full-feature", "full-bug", "full"],
16912
+ description: "Work mode marker applied to the feature folder."
16913
+ }
16914
+ },
16915
+ required: ["workspace_root", "feature_name", "type", "work_mode"],
16916
+ additionalProperties: false
16917
+ }
16918
+ },
16919
+ ...POSHQC_TOOL_DEFINITIONS,
16920
+ {
16921
+ name: "resolve_policy_audit_template_asset",
16922
+ description: "Resolve a bundled policy-audit template asset from the published extension package, optionally copying it into the target workspace.",
16923
+ inputSchema: {
16924
+ type: "object",
16925
+ properties: {
16926
+ workspace_root: workspaceRootProperty,
16927
+ asset: {
16928
+ type: "string",
16929
+ enum: [...POLICY_AUDIT_TEMPLATE_ASSET_SELECTORS],
16930
+ description: "Bundled policy-audit asset selector: 'template' for policy-audit.yyyy-MM-ddTHH-mm.md, 'code-review-template' for code-review.yyyy-MM-ddTHH-mm.md, 'feature-audit-template' for feature-audit.yyyy-MM-ddTHH-mm.md, or 'agents' for AGENTS.md."
16931
+ },
16932
+ target_path: {
16933
+ type: "string",
16934
+ description: "Optional workspace-relative or absolute destination path for a copied asset."
16935
+ }
16936
+ },
16937
+ required: ["workspace_root", "asset"],
16938
+ additionalProperties: false
16939
+ }
16940
+ },
16941
+ {
16942
+ name: "resolve_execute_hard_lock_prompt",
16943
+ description: "Resolve the execute hard-lock prompt for a target plan path using bundled extension resources.",
16944
+ inputSchema: {
16945
+ type: "object",
16946
+ properties: {
16947
+ workspace_root: workspaceRootProperty,
16948
+ target: {
16949
+ type: "string",
16950
+ description: "Target Markdown plan path to resolve."
16951
+ }
16952
+ },
16953
+ required: ["workspace_root", "target"],
16954
+ additionalProperties: false
16955
+ }
16956
+ },
16957
+ {
16958
+ name: "resolve_atomic_plan_prompt",
16959
+ description: "Resolve the atomic-plan prompt for a target plan path using bundled extension resources.",
16960
+ inputSchema: {
16961
+ type: "object",
16962
+ properties: {
16963
+ workspace_root: workspaceRootProperty,
16964
+ target: {
16965
+ type: "string",
16966
+ description: "Target Markdown plan path to resolve."
16967
+ }
16968
+ },
16969
+ required: ["workspace_root", "target"],
16970
+ additionalProperties: false
16971
+ }
16972
+ },
16973
+ {
16974
+ name: "validate_orchestration_artifacts",
16975
+ description: "Validate an orchestration artifact, including epic planner, kickoff, and execution checkpoints, against its structural schema.",
16976
+ inputSchema: {
16977
+ type: "object",
16978
+ properties: {
16979
+ workspace_root: workspaceRootProperty,
16980
+ artifact_type: {
16981
+ type: "string",
16982
+ enum: [
16983
+ "plan",
16984
+ "policy-audit",
16985
+ "code-review",
16986
+ "feature-audit",
16987
+ "orchestrator-state",
16988
+ "epic-orchestrator-state",
16989
+ "epic-planner-state",
16990
+ "epic-kickoff"
16991
+ ],
16992
+ description: "The type of orchestration artifact to validate."
16993
+ },
16994
+ artifact_path: {
16995
+ type: "string",
16996
+ description: "Workspace-relative or absolute path to the artifact file."
16997
+ },
16998
+ require_complete: {
16999
+ type: "boolean",
17000
+ description: "When true and artifact_type is 'orchestrator-state' or 'epic-orchestrator-state', require all phases to be complete."
17001
+ },
17002
+ require_model_routing: {
17003
+ type: "boolean",
17004
+ description: "When true and artifact_type is 'orchestrator-state', require a model_routing_receipts entry per delegated agent once a delegation is recorded. The TypeScript side performs the existence check only; the Python validator is authoritative for full per-receipt correctness."
17005
+ },
17006
+ require_codex_model_routing: {
17007
+ type: "boolean",
17008
+ description: "When true for an orchestrator checkpoint, require canonical Codex deployment receipts for delegated agents."
17009
+ },
17010
+ require_codex_topology: {
17011
+ type: "boolean",
17012
+ description: "When true for an orchestrator checkpoint, require canonical Codex topology receipts for delegated agents and epic roots."
17013
+ },
17014
+ require_ready_for_execution: {
17015
+ type: "boolean",
17016
+ description: "When true and artifact_type is 'epic-planner-state', require every child to be prepared and preflight-cleared."
17017
+ }
17018
+ },
17019
+ required: ["workspace_root", "artifact_type", "artifact_path"],
17020
+ additionalProperties: false
17021
+ }
17022
+ },
17023
+ {
17024
+ name: "render_subagent_tree",
17025
+ description: "Render the subagent call tree for a root session id. The session id is a transcript filename stem; the transcript is resolved under the user-global Claude projects directory, searching the encoded workspace directory plus its '-wt-' worktree siblings (case-insensitive) and returning the first match deterministically.",
17026
+ inputSchema: {
17027
+ type: "object",
17028
+ properties: {
17029
+ workspace_root: workspaceRootProperty,
17030
+ session_id: {
17031
+ type: "string",
17032
+ description: "Root session identifier (transcript filename stem under ~/.claude/projects/<encoded-workspace>/, e.g. a UUIDv4)."
17033
+ }
17034
+ },
17035
+ required: ["workspace_root", "session_id"],
17036
+ additionalProperties: false
17037
+ }
17038
+ },
17039
+ ...DISCOVERY_TOOL_DEFINITIONS
17040
+ ];
17041
+
17042
+ // ../../extensions/drm-copilot/src/repo-automation-tool-names.ts
17043
+ var REPO_AUTOMATION_TOOLS = [
17044
+ "collect_commit_context",
17045
+ "collect_pr_context",
17046
+ "run_codex_native_converter",
17047
+ "push_down_copilot_customizations",
17048
+ "push_down_codex_and_agents_customizations",
17049
+ "push_down_claude_customizations",
17050
+ "new_potential_bug_entry",
17051
+ "new_potential_entry",
17052
+ "link_parent_child",
17053
+ "potential_to_issue",
17054
+ "new_active_feature_folder",
17055
+ "run_poshqc_format",
17056
+ "run_poshqc_analyze",
17057
+ "run_poshqc_test",
17058
+ "run_poshqc_analyze_autofix",
17059
+ "run_poshqc_suite",
17060
+ "resolve_policy_audit_template_asset",
17061
+ "resolve_execute_hard_lock_prompt",
17062
+ "resolve_atomic_plan_prompt",
17063
+ "validate_orchestration_artifacts",
17064
+ "render_subagent_tree",
17065
+ "validate_discovery_artifacts",
17066
+ "run_discovery_init",
17067
+ "run_discovery_repo_inventory",
17068
+ "run_discovery_dotnet_analyzer",
17069
+ "run_discovery_vsto_analyzer",
17070
+ "run_discovery_scenario_generation",
17071
+ "run_discovery_report"
17072
+ ];
16675
17073
 
16676
17074
  // ../../extensions/drm-copilot/src/mcp-handlers/collect-context-handlers.ts
16677
17075
  async function handleCollectCommitContext(rawInput, service) {
@@ -16754,6 +17152,36 @@ async function handleResolveExecuteHardLockPrompt(rawInput, service) {
16754
17152
  });
16755
17153
  }
16756
17154
 
17155
+ // ../../extensions/drm-copilot/src/mcp-handlers/discovery-handlers.ts
17156
+ async function handleValidateDiscoveryArtifacts(rawInput, service) {
17157
+ const input = resolveValidateDiscoveryArtifactsToolInput(rawInput);
17158
+ return service.validateDiscoveryArtifacts(input);
17159
+ }
17160
+ async function handleRunDiscoveryInit(rawInput, service) {
17161
+ const input = resolveRunDiscoveryInitToolInput(rawInput);
17162
+ return service.runDiscoveryInit(input);
17163
+ }
17164
+ async function handleRunDiscoveryRepoInventory(rawInput, service) {
17165
+ const input = resolveRunDiscoveryRepoInventoryToolInput(rawInput);
17166
+ return service.runDiscoveryRepoInventory(input);
17167
+ }
17168
+ async function handleRunDiscoveryDotnetAnalyzer(rawInput, service) {
17169
+ const input = resolveRunDiscoveryDotnetAnalyzerToolInput(rawInput);
17170
+ return service.runDiscoveryDotnetAnalyzer(input);
17171
+ }
17172
+ async function handleRunDiscoveryVstoAnalyzer(rawInput, service) {
17173
+ const input = resolveRunDiscoveryVstoAnalyzerToolInput(rawInput);
17174
+ return service.runDiscoveryVstoAnalyzer(input);
17175
+ }
17176
+ async function handleRunDiscoveryScenarioGeneration(rawInput, service) {
17177
+ const input = resolveRunDiscoveryScenarioGenerationToolInput(rawInput);
17178
+ return service.runDiscoveryScenarioGeneration(input);
17179
+ }
17180
+ async function handleRunDiscoveryReport(rawInput, service) {
17181
+ const input = resolveRunDiscoveryReportToolInput(rawInput);
17182
+ return service.runDiscoveryReport(input);
17183
+ }
17184
+
16757
17185
  // ../../extensions/drm-copilot/src/mcp-tool-inputs-subagent-tree.ts
16758
17186
  function resolveRenderSubagentTreeToolInput(rawInput, fallbackWorkspaceRoot) {
16759
17187
  const args = asToolArgumentObject(rawInput);
@@ -16911,6 +17339,39 @@ async function dispatchRepoAutomationTool(toolName, rawInput, service) {
16911
17339
  await handleRenderSubagentTree(rawInput, service)
16912
17340
  );
16913
17341
  }
17342
+ case "validate_discovery_artifacts": {
17343
+ return toMcpToolResult(
17344
+ await handleValidateDiscoveryArtifacts(rawInput, service)
17345
+ );
17346
+ }
17347
+ case "run_discovery_init": {
17348
+ return toMcpToolResult(await handleRunDiscoveryInit(rawInput, service));
17349
+ }
17350
+ case "run_discovery_repo_inventory": {
17351
+ return toMcpToolResult(
17352
+ await handleRunDiscoveryRepoInventory(rawInput, service)
17353
+ );
17354
+ }
17355
+ case "run_discovery_dotnet_analyzer": {
17356
+ return toMcpToolResult(
17357
+ await handleRunDiscoveryDotnetAnalyzer(rawInput, service)
17358
+ );
17359
+ }
17360
+ case "run_discovery_vsto_analyzer": {
17361
+ return toMcpToolResult(
17362
+ await handleRunDiscoveryVstoAnalyzer(rawInput, service)
17363
+ );
17364
+ }
17365
+ case "run_discovery_scenario_generation": {
17366
+ return toMcpToolResult(
17367
+ await handleRunDiscoveryScenarioGeneration(rawInput, service)
17368
+ );
17369
+ }
17370
+ case "run_discovery_report": {
17371
+ return toMcpToolResult(
17372
+ await handleRunDiscoveryReport(rawInput, service)
17373
+ );
17374
+ }
16914
17375
  }
16915
17376
  } catch (error2) {
16916
17377
  return toFailureToolResult(toolName, workspaceRoot, error2);
@@ -29174,6 +29635,13 @@ function posixBasename(pathStr) {
29174
29635
  return lastSlash === -1 ? normalized : normalized.slice(lastSlash + 1);
29175
29636
  }
29176
29637
  function buildIssueBody(content, selectedMode, promotionType, relativePath2) {
29638
+ if (promotionType === "bug") {
29639
+ const bugSections = {};
29640
+ for (const heading of BUG_SECTION_HEADINGS) {
29641
+ bugSections[heading] = getSection(content, heading) || PLACEHOLDER;
29642
+ }
29643
+ return buildBugBody(selectedMode, bugSections, relativePath2);
29644
+ }
29177
29645
  if (selectedMode === "minor-audit") {
29178
29646
  const problem2 = getSection(content, "Problem / Why") || PLACEHOLDER;
29179
29647
  const implementationIntent = getSection(content, "Proposed Behavior") || PLACEHOLDER;
@@ -29195,13 +29663,6 @@ function buildIssueBody(content, selectedMode, promotionType, relativePath2) {
29195
29663
  relativePath2
29196
29664
  );
29197
29665
  }
29198
- if (promotionType === "bug") {
29199
- const bugSections = {};
29200
- for (const heading of BUG_SECTION_HEADINGS) {
29201
- bugSections[heading] = getSection(content, heading) || PLACEHOLDER;
29202
- }
29203
- return buildBugBody(selectedMode, bugSections, relativePath2);
29204
- }
29205
29666
  const problem = getSection(content, "Problem / Why") || PLACEHOLDER;
29206
29667
  const behavior = getSection(content, "Proposed Behavior") || PLACEHOLDER;
29207
29668
  const criteria = getSection(content, "Acceptance Criteria (early draft)") || PLACEHOLDER;
@@ -30800,6 +31261,263 @@ function renderSubagentTreeServiceCall(input, env = process.env) {
30800
31261
  };
30801
31262
  }
30802
31263
 
31264
+ // ../../extensions/drm-copilot/src/repo-automation-execute-discovery.ts
31265
+ var VALIDATE_DISCOVERY_ARTIFACTS_MODULE = "scripts.dev_tools.validate_discovery_artifacts";
31266
+ var VALIDATE_ENTRY_FUNCTION_BY_ARTIFACT_TYPE = {
31267
+ profile: "main_profile",
31268
+ "feature-contract": "main_feature_contract",
31269
+ "coverage-ledger": "main_coverage_ledger",
31270
+ "runtime-scenario": "main_runtime_scenario",
31271
+ "parity-matrix": "main_parity_matrix",
31272
+ "unspecified-behavior": "main_unspecified_behavior",
31273
+ "product-decision": "main_product_decision",
31274
+ "evidence-reference": "main_evidence_reference",
31275
+ all: "main"
31276
+ };
31277
+ var DISCOVERY_INIT_ENTRY = {
31278
+ module: "scripts.dev_tools.discovery.init_cli",
31279
+ functionName: "main"
31280
+ };
31281
+ var DISCOVERY_REPO_INVENTORY_ENTRY = {
31282
+ module: "scripts.dev_tools.discovery.analyzer.cli",
31283
+ functionName: "main"
31284
+ };
31285
+ var DISCOVERY_STACK_ANALYZER_MODULE = "scripts.dev_tools.discovery.analyzer.stack_cli";
31286
+ var DISCOVERY_DOTNET_ANALYZER_FUNCTION = "main_dotnet";
31287
+ var DISCOVERY_VSTO_ANALYZER_FUNCTION = "main_vsto";
31288
+ var DISCOVERY_SCENARIO_GENERATION_ENTRY = {
31289
+ module: "scripts.dev_tools.generate_acceptance_scenarios",
31290
+ functionName: "main"
31291
+ };
31292
+ var DISCOVERY_REPORT_ENTRY_BY_REPORT_TYPE = {
31293
+ coverage: {
31294
+ module: "scripts.dev_tools.discovery.coverage_report",
31295
+ functionName: "main"
31296
+ },
31297
+ parity: {
31298
+ module: "scripts.dev_tools.discovery.parity_report",
31299
+ functionName: "main"
31300
+ },
31301
+ completion: {
31302
+ module: "scripts.dev_tools.discovery.completion_report",
31303
+ functionName: "main"
31304
+ }
31305
+ };
31306
+ function parseWrittenPathsJson(stdout) {
31307
+ const trimmed = stdout.trim();
31308
+ if (trimmed.length === 0) {
31309
+ return void 0;
31310
+ }
31311
+ let parsed;
31312
+ try {
31313
+ parsed = JSON.parse(trimmed);
31314
+ } catch {
31315
+ return void 0;
31316
+ }
31317
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
31318
+ return void 0;
31319
+ }
31320
+ const writtenPaths = parsed["written_paths"];
31321
+ if (!Array.isArray(writtenPaths)) {
31322
+ return void 0;
31323
+ }
31324
+ const paths = writtenPaths.filter(
31325
+ (candidate) => typeof candidate === "string"
31326
+ );
31327
+ return paths.length > 0 ? paths : void 0;
31328
+ }
31329
+ function parseOkWrotePath(stdout) {
31330
+ const match = /^ok:\s*wrote\s+(.+?)\s*$/im.exec(stdout);
31331
+ if (match === null) {
31332
+ return void 0;
31333
+ }
31334
+ const path11 = match[1]?.trim();
31335
+ return path11 !== void 0 && path11.length > 0 ? [path11] : void 0;
31336
+ }
31337
+ function parseDiscoveryArtifacts(mode, stdout) {
31338
+ if (mode === "written_paths_json") {
31339
+ return parseWrittenPathsJson(stdout);
31340
+ }
31341
+ if (mode === "ok_wrote") {
31342
+ return parseOkWrotePath(stdout);
31343
+ }
31344
+ return void 0;
31345
+ }
31346
+ async function executeDiscoveryServiceCall(output, request) {
31347
+ output.appendLine(`[${request.invocationId}] runtime probe start`);
31348
+ let runtime;
31349
+ try {
31350
+ runtime = detectRuntime("python", request.workspaceRoot);
31351
+ } catch (error2) {
31352
+ output.appendLine(`[${request.invocationId}] runtime probe failure`);
31353
+ throw error2;
31354
+ }
31355
+ output.appendLine(
31356
+ `[${request.invocationId}] runtime probe success: ${runtime.executable}`
31357
+ );
31358
+ const entryCode = `import sys; from ${request.module} import ${request.functionName}; sys.exit(${request.functionName}())`;
31359
+ const args = [...runtime.argsPrefix, "-c", entryCode, ...request.cliArgs];
31360
+ output.appendLine(
31361
+ `[${request.invocationId}] command start: ${runtime.executable} -c <${request.module}:${request.functionName}>`
31362
+ );
31363
+ let processResult;
31364
+ try {
31365
+ processResult = await runCommandWithOutput(
31366
+ output,
31367
+ runtime.executable,
31368
+ args,
31369
+ request.workspaceRoot
31370
+ );
31371
+ } catch (error2) {
31372
+ output.appendLine(`[${request.invocationId}] command failure`);
31373
+ throw error2;
31374
+ }
31375
+ output.appendLine(`[${request.invocationId}] command success`);
31376
+ const artifacts = parseDiscoveryArtifacts(
31377
+ request.artifactParse,
31378
+ processResult.stdout
31379
+ );
31380
+ return {
31381
+ tool: request.tool,
31382
+ workspaceRoot: request.workspaceRoot,
31383
+ summary: request.summary,
31384
+ ...artifacts === void 0 ? {} : { artifacts }
31385
+ };
31386
+ }
31387
+ function resolveInvocationId(input, fallback) {
31388
+ return input.invocationId ?? fallback;
31389
+ }
31390
+ function buildAnalyzerCliArgs(input) {
31391
+ return [
31392
+ ...input.profilePath === void 0 ? [] : [input.profilePath],
31393
+ ...input.outputDir === void 0 ? [] : ["--output-dir", input.outputDir],
31394
+ "--json"
31395
+ ];
31396
+ }
31397
+ async function runValidateDiscoveryArtifacts(output, input) {
31398
+ const functionName = VALIDATE_ENTRY_FUNCTION_BY_ARTIFACT_TYPE[input.artifactType];
31399
+ if (functionName === void 0) {
31400
+ throw new Error(
31401
+ `Unsupported discovery artifact_type '${input.artifactType}'.`
31402
+ );
31403
+ }
31404
+ return executeDiscoveryServiceCall(output, {
31405
+ tool: "validate_discovery_artifacts",
31406
+ module: VALIDATE_DISCOVERY_ARTIFACTS_MODULE,
31407
+ functionName,
31408
+ cliArgs: [input.artifactPath],
31409
+ workspaceRoot: input.workspaceRoot,
31410
+ invocationId: resolveInvocationId(input, "validate_discovery_artifacts"),
31411
+ summary: `Validated discovery artifact '${input.artifactPath}' as artifact type '${input.artifactType}'.`,
31412
+ artifactParse: "none"
31413
+ });
31414
+ }
31415
+ async function runDiscoveryInit(output, input) {
31416
+ const cliArgs = [
31417
+ input.targetDir,
31418
+ ...input.templateRoot === void 0 ? [] : ["--template-root", input.templateRoot],
31419
+ ...input.force === true ? ["--force"] : []
31420
+ ];
31421
+ return executeDiscoveryServiceCall(output, {
31422
+ tool: "run_discovery_init",
31423
+ module: DISCOVERY_INIT_ENTRY.module,
31424
+ functionName: DISCOVERY_INIT_ENTRY.functionName,
31425
+ cliArgs,
31426
+ workspaceRoot: input.workspaceRoot,
31427
+ invocationId: resolveInvocationId(input, "run_discovery_init"),
31428
+ summary: `Initialized the discovery workspace at '${input.targetDir}'.`,
31429
+ artifactParse: "none"
31430
+ });
31431
+ }
31432
+ async function runDiscoveryRepoInventory(output, input) {
31433
+ return executeDiscoveryServiceCall(output, {
31434
+ tool: "run_discovery_repo_inventory",
31435
+ module: DISCOVERY_REPO_INVENTORY_ENTRY.module,
31436
+ functionName: DISCOVERY_REPO_INVENTORY_ENTRY.functionName,
31437
+ cliArgs: buildAnalyzerCliArgs(input),
31438
+ workspaceRoot: input.workspaceRoot,
31439
+ invocationId: resolveInvocationId(input, "run_discovery_repo_inventory"),
31440
+ summary: "Generated the repository inventory discovery analysis.",
31441
+ artifactParse: "written_paths_json"
31442
+ });
31443
+ }
31444
+ async function runDiscoveryDotnetAnalyzer(output, input) {
31445
+ return executeDiscoveryServiceCall(output, {
31446
+ tool: "run_discovery_dotnet_analyzer",
31447
+ module: DISCOVERY_STACK_ANALYZER_MODULE,
31448
+ functionName: DISCOVERY_DOTNET_ANALYZER_FUNCTION,
31449
+ cliArgs: buildAnalyzerCliArgs(input),
31450
+ workspaceRoot: input.workspaceRoot,
31451
+ invocationId: resolveInvocationId(input, "run_discovery_dotnet_analyzer"),
31452
+ summary: "Generated the .NET stack discovery analysis.",
31453
+ artifactParse: "written_paths_json"
31454
+ });
31455
+ }
31456
+ async function runDiscoveryVstoAnalyzer(output, input) {
31457
+ return executeDiscoveryServiceCall(output, {
31458
+ tool: "run_discovery_vsto_analyzer",
31459
+ module: DISCOVERY_STACK_ANALYZER_MODULE,
31460
+ functionName: DISCOVERY_VSTO_ANALYZER_FUNCTION,
31461
+ cliArgs: buildAnalyzerCliArgs(input),
31462
+ workspaceRoot: input.workspaceRoot,
31463
+ invocationId: resolveInvocationId(input, "run_discovery_vsto_analyzer"),
31464
+ summary: "Generated the VSTO stack discovery analysis.",
31465
+ artifactParse: "written_paths_json"
31466
+ });
31467
+ }
31468
+ async function runDiscoveryScenarioGeneration(output, input) {
31469
+ const cliArgs = [
31470
+ "--feature-contract",
31471
+ input.featureContract,
31472
+ "--parity-matrix",
31473
+ input.parityMatrix,
31474
+ "--runtime-characterization",
31475
+ input.runtimeCharacterization,
31476
+ ...input.outputPath === void 0 ? [] : ["--output", input.outputPath],
31477
+ ...input.check === true ? ["--check"] : []
31478
+ ];
31479
+ return executeDiscoveryServiceCall(output, {
31480
+ tool: "run_discovery_scenario_generation",
31481
+ module: DISCOVERY_SCENARIO_GENERATION_ENTRY.module,
31482
+ functionName: DISCOVERY_SCENARIO_GENERATION_ENTRY.functionName,
31483
+ cliArgs,
31484
+ workspaceRoot: input.workspaceRoot,
31485
+ invocationId: resolveInvocationId(
31486
+ input,
31487
+ "run_discovery_scenario_generation"
31488
+ ),
31489
+ summary: "Generated discovery acceptance scenarios.",
31490
+ artifactParse: "ok_wrote"
31491
+ });
31492
+ }
31493
+ async function runDiscoveryReport(output, input) {
31494
+ const entry = DISCOVERY_REPORT_ENTRY_BY_REPORT_TYPE[input.reportType];
31495
+ if (entry === void 0) {
31496
+ throw new Error(`Unsupported discovery report_type '${input.reportType}'.`);
31497
+ }
31498
+ const cliArgs = input.reportType === "completion" ? [
31499
+ "--coverage-input",
31500
+ input.coverageInput ?? "",
31501
+ "--parity-input",
31502
+ input.parityInput ?? "",
31503
+ ...input.outputPath === void 0 ? [] : ["--output", input.outputPath]
31504
+ ] : [
31505
+ "--input",
31506
+ input.inputPath ?? "",
31507
+ ...input.outputPath === void 0 ? [] : ["--output", input.outputPath]
31508
+ ];
31509
+ return executeDiscoveryServiceCall(output, {
31510
+ tool: "run_discovery_report",
31511
+ module: entry.module,
31512
+ functionName: entry.functionName,
31513
+ cliArgs,
31514
+ workspaceRoot: input.workspaceRoot,
31515
+ invocationId: resolveInvocationId(input, "run_discovery_report"),
31516
+ summary: `Generated the '${input.reportType}' discovery report.`,
31517
+ artifactParse: "none"
31518
+ });
31519
+ }
31520
+
30803
31521
  // ../../extensions/drm-copilot/src/repo-automation-service.ts
30804
31522
  var DefaultRepoAutomationService = class {
30805
31523
  extensionRoot;
@@ -30979,6 +31697,27 @@ var DefaultRepoAutomationService = class {
30979
31697
  fileSystem: this.fileSystem
30980
31698
  });
30981
31699
  }
31700
+ async validateDiscoveryArtifacts(input) {
31701
+ return runValidateDiscoveryArtifacts(this.output, input);
31702
+ }
31703
+ async runDiscoveryInit(input) {
31704
+ return runDiscoveryInit(this.output, input);
31705
+ }
31706
+ async runDiscoveryRepoInventory(input) {
31707
+ return runDiscoveryRepoInventory(this.output, input);
31708
+ }
31709
+ async runDiscoveryDotnetAnalyzer(input) {
31710
+ return runDiscoveryDotnetAnalyzer(this.output, input);
31711
+ }
31712
+ async runDiscoveryVstoAnalyzer(input) {
31713
+ return runDiscoveryVstoAnalyzer(this.output, input);
31714
+ }
31715
+ async runDiscoveryScenarioGeneration(input) {
31716
+ return runDiscoveryScenarioGeneration(this.output, input);
31717
+ }
31718
+ async runDiscoveryReport(input) {
31719
+ return runDiscoveryReport(this.output, input);
31720
+ }
30982
31721
  async executeScript(options) {
30983
31722
  return executeScriptServiceCall(this.output, this.extensionRoot, options);
30984
31723
  }