@theia/ai-ide 1.71.0-next.8 → 1.71.0

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 (212) hide show
  1. package/lib/browser/agent-mode-confirmation-service.d.ts.map +1 -1
  2. package/lib/browser/agent-mode-confirmation-service.js +15 -15
  3. package/lib/browser/agent-mode-confirmation-service.js.map +1 -1
  4. package/lib/browser/ai-configuration/agent-configuration-widget.js +2 -2
  5. package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -1
  6. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +1 -1
  7. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -1
  8. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -1
  9. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +2 -1
  10. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +1 -1
  11. package/lib/browser/ai-configuration/skills-configuration-widget.d.ts.map +1 -1
  12. package/lib/browser/ai-configuration/skills-configuration-widget.js +2 -1
  13. package/lib/browser/ai-configuration/skills-configuration-widget.js.map +1 -1
  14. package/lib/browser/ai-ide-activation-service.d.ts +10 -1
  15. package/lib/browser/ai-ide-activation-service.d.ts.map +1 -1
  16. package/lib/browser/ai-ide-activation-service.js +41 -1
  17. package/lib/browser/ai-ide-activation-service.js.map +1 -1
  18. package/lib/browser/ai-workspace-restriction-contribution.d.ts +7 -0
  19. package/lib/browser/ai-workspace-restriction-contribution.d.ts.map +1 -0
  20. package/lib/browser/ai-workspace-restriction-contribution.js +42 -0
  21. package/lib/browser/ai-workspace-restriction-contribution.js.map +1 -0
  22. package/lib/browser/app-tester-prompt-template.js +1 -1
  23. package/lib/browser/architect-agent.d.ts +1 -0
  24. package/lib/browser/architect-agent.d.ts.map +1 -1
  25. package/lib/browser/architect-agent.js +5 -3
  26. package/lib/browser/architect-agent.js.map +1 -1
  27. package/lib/browser/architect-prompt-template.js +3 -3
  28. package/lib/browser/chat-session-card-action-contribution.js +1 -1
  29. package/lib/browser/chat-session-card-action-contribution.js.map +1 -1
  30. package/lib/browser/chat-sessions-welcome-message-provider.d.ts +1 -0
  31. package/lib/browser/chat-sessions-welcome-message-provider.d.ts.map +1 -1
  32. package/lib/browser/chat-sessions-welcome-message-provider.js +7 -1
  33. package/lib/browser/chat-sessions-welcome-message-provider.js.map +1 -1
  34. package/lib/browser/code-reviewer-agent.d.ts +1 -0
  35. package/lib/browser/code-reviewer-agent.d.ts.map +1 -1
  36. package/lib/browser/code-reviewer-agent.js +1 -0
  37. package/lib/browser/code-reviewer-agent.js.map +1 -1
  38. package/lib/browser/coder-agent.d.ts +4 -0
  39. package/lib/browser/coder-agent.d.ts.map +1 -1
  40. package/lib/browser/coder-agent.js +28 -4
  41. package/lib/browser/coder-agent.js.map +1 -1
  42. package/lib/browser/create-skill-agent.d.ts +1 -0
  43. package/lib/browser/create-skill-agent.d.ts.map +1 -1
  44. package/lib/browser/create-skill-agent.js +1 -0
  45. package/lib/browser/create-skill-agent.js.map +1 -1
  46. package/lib/browser/explore-agent.d.ts +1 -0
  47. package/lib/browser/explore-agent.d.ts.map +1 -1
  48. package/lib/browser/explore-agent.js +1 -0
  49. package/lib/browser/explore-agent.js.map +1 -1
  50. package/lib/browser/file-changeset-functions.d.ts.map +1 -1
  51. package/lib/browser/file-changeset-functions.js +17 -9
  52. package/lib/browser/file-changeset-functions.js.map +1 -1
  53. package/lib/browser/frontend-module.d.ts.map +1 -1
  54. package/lib/browser/frontend-module.js +12 -10
  55. package/lib/browser/frontend-module.js.map +1 -1
  56. package/lib/browser/github-capability-contribution.js +1 -1
  57. package/lib/browser/github-capability-contribution.js.map +1 -1
  58. package/lib/browser/github-prompt-template.js +1 -1
  59. package/lib/browser/ide-chat-welcome-message-provider.d.ts +4 -0
  60. package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -1
  61. package/lib/browser/ide-chat-welcome-message-provider.js +34 -0
  62. package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -1
  63. package/lib/browser/project-info-agent.d.ts +1 -0
  64. package/lib/browser/project-info-agent.d.ts.map +1 -1
  65. package/lib/browser/project-info-agent.js +1 -0
  66. package/lib/browser/project-info-agent.js.map +1 -1
  67. package/lib/browser/{junior-agent.d.ts → review/pr-review-agent.d.ts} +7 -5
  68. package/lib/browser/review/pr-review-agent.d.ts.map +1 -0
  69. package/lib/browser/{junior-agent.js → review/pr-review-agent.js} +17 -15
  70. package/lib/browser/review/pr-review-agent.js.map +1 -0
  71. package/lib/browser/review/pr-review-prompt-template.d.ts +4 -0
  72. package/lib/browser/review/pr-review-prompt-template.d.ts.map +1 -0
  73. package/lib/browser/review/pr-review-prompt-template.js +437 -0
  74. package/lib/browser/review/pr-review-prompt-template.js.map +1 -0
  75. package/lib/browser/template-preference-contribution.d.ts +2 -0
  76. package/lib/browser/template-preference-contribution.d.ts.map +1 -1
  77. package/lib/browser/template-preference-contribution.js +43 -14
  78. package/lib/browser/template-preference-contribution.js.map +1 -1
  79. package/lib/browser/todo-tool-renderer.d.ts +1 -1
  80. package/lib/browser/todo-tool-renderer.d.ts.map +1 -1
  81. package/lib/browser/todo-tool-renderer.js +1 -1
  82. package/lib/browser/todo-tool-renderer.js.map +1 -1
  83. package/lib/browser/todo-tool.d.ts +0 -1
  84. package/lib/browser/todo-tool.d.ts.map +1 -1
  85. package/lib/browser/todo-tool.js +36 -16
  86. package/lib/browser/todo-tool.js.map +1 -1
  87. package/lib/browser/todo-tool.spec.d.ts +2 -0
  88. package/lib/browser/todo-tool.spec.d.ts.map +1 -0
  89. package/lib/browser/todo-tool.spec.js +44 -0
  90. package/lib/browser/todo-tool.spec.js.map +1 -0
  91. package/lib/browser/user-interaction-tool-renderer.d.ts +18 -0
  92. package/lib/browser/user-interaction-tool-renderer.d.ts.map +1 -0
  93. package/lib/browser/user-interaction-tool-renderer.js +330 -0
  94. package/lib/browser/user-interaction-tool-renderer.js.map +1 -0
  95. package/lib/browser/user-interaction-tool.d.ts +47 -0
  96. package/lib/browser/user-interaction-tool.d.ts.map +1 -0
  97. package/lib/browser/user-interaction-tool.js +397 -0
  98. package/lib/browser/user-interaction-tool.js.map +1 -0
  99. package/lib/browser/user-interaction-tool.spec.d.ts +2 -0
  100. package/lib/browser/user-interaction-tool.spec.d.ts.map +1 -0
  101. package/lib/browser/user-interaction-tool.spec.js +336 -0
  102. package/lib/browser/user-interaction-tool.spec.js.map +1 -0
  103. package/lib/browser/workspace-functions.d.ts.map +1 -1
  104. package/lib/browser/workspace-functions.js +9 -2
  105. package/lib/browser/workspace-functions.js.map +1 -1
  106. package/lib/browser/workspace-launch-provider.d.ts.map +1 -1
  107. package/lib/browser/workspace-launch-provider.js +9 -4
  108. package/lib/browser/workspace-launch-provider.js.map +1 -1
  109. package/lib/browser/workspace-launch-provider.spec.js +4 -4
  110. package/lib/browser/workspace-launch-provider.spec.js.map +1 -1
  111. package/lib/browser/workspace-task-provider.d.ts.map +1 -1
  112. package/lib/browser/workspace-task-provider.js +4 -1
  113. package/lib/browser/workspace-task-provider.js.map +1 -1
  114. package/lib/browser/workspace-task-provider.spec.js +90 -1
  115. package/lib/browser/workspace-task-provider.spec.js.map +1 -1
  116. package/lib/common/ai-ide-preferences.d.ts +1 -1
  117. package/lib/common/ai-ide-preferences.d.ts.map +1 -1
  118. package/lib/common/ai-ide-preferences.js +6 -6
  119. package/lib/common/ai-ide-preferences.js.map +1 -1
  120. package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
  121. package/lib/common/coder-replace-prompt-template.js +133 -17
  122. package/lib/common/coder-replace-prompt-template.js.map +1 -1
  123. package/lib/common/command-chat-agents.d.ts +1 -0
  124. package/lib/common/command-chat-agents.d.ts.map +1 -1
  125. package/lib/common/command-chat-agents.js +1 -0
  126. package/lib/common/command-chat-agents.js.map +1 -1
  127. package/lib/common/command-prompt-template.js +1 -1
  128. package/lib/common/orchestrator-chat-agent.d.ts.map +1 -1
  129. package/lib/common/orchestrator-chat-agent.js +2 -2
  130. package/lib/common/orchestrator-chat-agent.js.map +1 -1
  131. package/lib/common/universal-chat-agent.d.ts +1 -0
  132. package/lib/common/universal-chat-agent.d.ts.map +1 -1
  133. package/lib/common/universal-chat-agent.js +1 -0
  134. package/lib/common/universal-chat-agent.js.map +1 -1
  135. package/lib/common/universal-prompt-template.js +1 -1
  136. package/lib/common/user-interaction-tool.d.ts +53 -0
  137. package/lib/common/user-interaction-tool.d.ts.map +1 -0
  138. package/lib/common/user-interaction-tool.js +176 -0
  139. package/lib/common/user-interaction-tool.js.map +1 -0
  140. package/lib/common/user-interaction-tool.spec.d.ts +2 -0
  141. package/lib/common/user-interaction-tool.spec.d.ts.map +1 -0
  142. package/lib/common/user-interaction-tool.spec.js +216 -0
  143. package/lib/common/user-interaction-tool.spec.js.map +1 -0
  144. package/package.json +27 -27
  145. package/src/browser/agent-mode-confirmation-service.ts +19 -18
  146. package/src/browser/ai-configuration/agent-configuration-widget.tsx +2 -2
  147. package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +1 -1
  148. package/src/browser/ai-configuration/prompt-fragments-configuration-widget.tsx +2 -1
  149. package/src/browser/ai-configuration/skills-configuration-widget.tsx +2 -1
  150. package/src/browser/ai-ide-activation-service.ts +43 -3
  151. package/src/browser/ai-workspace-restriction-contribution.ts +39 -0
  152. package/src/browser/app-tester-prompt-template.ts +1 -1
  153. package/src/browser/architect-agent.ts +6 -3
  154. package/src/browser/architect-prompt-template.ts +3 -3
  155. package/src/browser/chat-session-card-action-contribution.ts +1 -1
  156. package/src/browser/chat-sessions-welcome-message-provider.tsx +11 -2
  157. package/src/browser/code-reviewer-agent.ts +1 -0
  158. package/src/browser/coder-agent.ts +31 -4
  159. package/src/browser/create-skill-agent.ts +1 -0
  160. package/src/browser/explore-agent.ts +1 -0
  161. package/src/browser/file-changeset-functions.ts +17 -8
  162. package/src/browser/frontend-module.ts +14 -12
  163. package/src/browser/github-capability-contribution.ts +1 -1
  164. package/src/browser/github-prompt-template.ts +1 -1
  165. package/src/browser/ide-chat-welcome-message-provider.tsx +53 -0
  166. package/src/browser/project-info-agent.ts +1 -1
  167. package/src/browser/{context-reviewer-agent.ts → review/pr-review-agent.ts} +13 -11
  168. package/src/browser/review/pr-review-prompt-template.ts +449 -0
  169. package/src/browser/style/index.css +299 -0
  170. package/src/browser/template-preference-contribution.ts +40 -14
  171. package/src/browser/todo-tool-renderer.tsx +1 -1
  172. package/src/browser/todo-tool.spec.ts +49 -0
  173. package/src/browser/todo-tool.ts +35 -14
  174. package/src/browser/user-interaction-tool-renderer.tsx +531 -0
  175. package/src/browser/user-interaction-tool.spec.ts +396 -0
  176. package/src/browser/user-interaction-tool.ts +423 -0
  177. package/src/browser/workspace-functions.ts +10 -3
  178. package/src/browser/workspace-launch-provider.spec.ts +4 -4
  179. package/src/browser/workspace-launch-provider.ts +10 -6
  180. package/src/browser/workspace-task-provider.spec.ts +119 -1
  181. package/src/browser/workspace-task-provider.ts +4 -1
  182. package/src/common/ai-ide-preferences.ts +7 -7
  183. package/src/common/coder-replace-prompt-template.ts +133 -17
  184. package/src/common/command-chat-agents.ts +1 -0
  185. package/src/common/command-prompt-template.ts +1 -1
  186. package/src/common/orchestrator-chat-agent.ts +2 -2
  187. package/src/common/universal-chat-agent.ts +1 -0
  188. package/src/common/universal-prompt-template.ts +1 -1
  189. package/src/common/user-interaction-tool.spec.ts +241 -0
  190. package/src/common/user-interaction-tool.ts +237 -0
  191. package/lib/browser/context-reviewer-agent.d.ts +0 -17
  192. package/lib/browser/context-reviewer-agent.d.ts.map +0 -1
  193. package/lib/browser/context-reviewer-agent.js +0 -45
  194. package/lib/browser/context-reviewer-agent.js.map +0 -1
  195. package/lib/browser/context-reviewer-prompt-template.d.ts +0 -4
  196. package/lib/browser/context-reviewer-prompt-template.d.ts.map +0 -1
  197. package/lib/browser/context-reviewer-prompt-template.js +0 -160
  198. package/lib/browser/context-reviewer-prompt-template.js.map +0 -1
  199. package/lib/browser/junior-agent.d.ts.map +0 -1
  200. package/lib/browser/junior-agent.js.map +0 -1
  201. package/lib/browser/junior-plan-capability-contribution.d.ts +0 -8
  202. package/lib/browser/junior-plan-capability-contribution.d.ts.map +0 -1
  203. package/lib/browser/junior-plan-capability-contribution.js +0 -131
  204. package/lib/browser/junior-plan-capability-contribution.js.map +0 -1
  205. package/lib/browser/junior-prompt-template.d.ts +0 -4
  206. package/lib/browser/junior-prompt-template.d.ts.map +0 -1
  207. package/lib/browser/junior-prompt-template.js +0 -149
  208. package/lib/browser/junior-prompt-template.js.map +0 -1
  209. package/src/browser/context-reviewer-prompt-template.ts +0 -160
  210. package/src/browser/junior-agent.ts +0 -40
  211. package/src/browser/junior-plan-capability-contribution.ts +0 -129
  212. package/src/browser/junior-prompt-template.ts +0 -149
@@ -0,0 +1,437 @@
1
+ "use strict";
2
+ /* eslint-disable max-len */
3
+ // *****************************************************************************
4
+ // Copyright (C) 2026 EclipseSource GmbH.
5
+ //
6
+ // This program and the accompanying materials are made available under the
7
+ // terms of the Eclipse Public License v. 2.0 which is available at
8
+ // http://www.eclipse.org/legal/epl-2.0.
9
+ //
10
+ // This Source Code may also be made available under the following Secondary
11
+ // Licenses when the conditions for such availability set forth in the Eclipse
12
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
13
+ // with the GNU Classpath Exception which is available at
14
+ // https://www.gnu.org/software/classpath/license.html.
15
+ //
16
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
17
+ // *****************************************************************************
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.prReviewSystemPrompt = exports.PR_REVIEW_SYSTEM_PROMPT_ID = void 0;
20
+ const shell_execution_server_1 = require("@theia/ai-terminal/lib/common/shell-execution-server");
21
+ const context_variables_1 = require("../../common/context-variables");
22
+ const workspace_functions_1 = require("../../common/workspace-functions");
23
+ const task_context_function_ids_1 = require("../../common/task-context-function-ids");
24
+ const user_interaction_tool_1 = require("../../common/user-interaction-tool");
25
+ const github_chat_agent_1 = require("../github-chat-agent");
26
+ const explore_agent_1 = require("../explore-agent");
27
+ const ai_core_1 = require("@theia/ai-core");
28
+ exports.PR_REVIEW_SYSTEM_PROMPT_ID = 'pr-review-system';
29
+ exports.prReviewSystemPrompt = {
30
+ id: exports.PR_REVIEW_SYSTEM_PROMPT_ID,
31
+ template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
32
+ Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
33
+ https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
34
+
35
+ # Identity
36
+
37
+ You are a **PR Review Agent** embedded in Theia IDE. You orchestrate a full pull request review workflow: fetching PR information from GitHub, exploring the codebase, performing structured code review, interactively walking the user through findings with diff viewers, and optionally creating a pending review on GitHub.
38
+
39
+ # Tools
40
+
41
+ ## Agent Delegation
42
+ - ~{${ai_core_1.AGENT_DELEGATION_FUNCTION_ID}} — delegate tasks to other agents (GitHub agent: '${github_chat_agent_1.GitHubChatAgentId}', Explore agent: '${explore_agent_1.ExploreAgentId}')
43
+
44
+ ## Task Execution
45
+ - ~{${workspace_functions_1.LIST_TASKS_FUNCTION_ID}} - List all available tasks, these include npm scripts
46
+ - ~{${workspace_functions_1.RUN_TASK_FUNCTION_ID}} - Run a task. Use this for example to build, run tests or linting
47
+
48
+ ## Shell Execution
49
+ - ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} — run shell commands. Only use this one when there is no other specialized tool for your use case or in case the tools fail (like ~{${workspace_functions_1.RUN_TASK_FUNCTION_ID}})
50
+
51
+ ## Code Analysis
52
+ - ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}} — read file contents
53
+ - ~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}} — check for lint/type errors
54
+ - ~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}} — search for patterns in the codebase
55
+
56
+ ## Task Context Management
57
+ - ~{${task_context_function_ids_1.CREATE_TASK_CONTEXT_FUNCTION_ID}} — create the review plan
58
+ - ~{${task_context_function_ids_1.GET_TASK_CONTEXT_FUNCTION_ID}} — read the review plan
59
+ - ~{${task_context_function_ids_1.EDIT_TASK_CONTEXT_FUNCTION_ID}} — update the review plan (targeted replacement of specific sections)
60
+ - ~{${task_context_function_ids_1.LIST_TASK_CONTEXTS_FUNCTION_ID}} — list all review plans for the current session
61
+ - ~{${task_context_function_ids_1.REWRITE_TASK_CONTEXT_FUNCTION_ID}} — rewrite the review plan entirely (use as fallback when edits fail)
62
+
63
+ ## User Interaction
64
+ - ~{${user_interaction_tool_1.USER_INTERACTION_FUNCTION_ID}} — present findings to the user. See the tool description for behavior and return shape; this prompt only describes the PR-review specifics on top of it.
65
+
66
+ # Critical Rules
67
+
68
+ ## Delegation is Mandatory
69
+
70
+ **You MUST use ~{${ai_core_1.AGENT_DELEGATION_FUNCTION_ID}} for ALL GitHub interactions and codebase exploration.**
71
+
72
+ - **ALL GitHub operations** (fetching PR info, reading issues, submitting reviews) MUST be delegated to the GitHub agent ('${github_chat_agent_1.GitHubChatAgentId}'). Do NOT call GitHub MCP tools (mcp_github_*) directly — always delegate to the GitHub agent and let it handle the MCP tools.
73
+ - **ALL codebase exploration** (understanding architecture, finding related files, discovering patterns) MUST be delegated to the Explore agent ('${explore_agent_1.ExploreAgentId}'). The Explore agent has the right tools and context for thorough exploration.
74
+
75
+ You may use ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}, ~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}}, and ~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}} directly only in Phase 4 when performing the detailed code review of specific changed files.
76
+
77
+ ## Review Plan Must Be Updated Incrementally
78
+
79
+ The review plan (task context) is the user's live view into your progress. Create it early and update it at the end of every phase:
80
+ - **Phase 1 ends** → Create the review plan with PR Information and Changed Files filled in
81
+ - **Phase 2 ends** → Update with build status
82
+ - **Phase 3 ends** → Update with Exploration Findings
83
+ - **Phase 4 ends** → Update with Overview and Changes & Findings
84
+ - **Phase 5 steps** → Update status markers as the user responds
85
+
86
+ Never batch all updates to the end. The user should see the plan evolve in real-time.
87
+
88
+ ## Review Comment Style
89
+
90
+ These rules apply to **inline comment text written into the GitHub review** (Phase 6). They do **not** apply to the user walkthrough messages — there you may use emojis (🔴 / 🟡 / 🔵 / 💡) for criticality and substantiate claims with the link/diff mechanic of ~{${user_interaction_tool_1.USER_INTERACTION_FUNCTION_ID}}.
91
+
92
+ - Write like a human maintainer, not an AI. Short, direct, slightly informal.
93
+ - **Never** use em dashes. Use commas, periods, or parentheses instead.
94
+ - **Never** use filler phrases like "it is worth noting", "note that", "it should be noted", "consider", or "I would suggest". State directly what is wrong or what should change.
95
+ - **Substantiate claims about existing code with a permalink.** If you say "there is already a utility for this" or "this conflicts with the pattern in module X", you MUST link to the relevant code on the PR's target branch. Unsubstantiated claims are worse than no comment.
96
+ - Keep comments to **1-3 sentences**. If you need more, split the comment or rethink its scope.
97
+ - **No emojis** in review comments.
98
+ - **Permalink format:** \`https://github.com/<owner>/<repo>/blob/<merge-base-sha>/<path>#L<start>-L<end>\` using the merge-base SHA recorded in Phase 2a (do not substitute any other commit hash).
99
+ - **Line numbers must come from the target branch**, not the PR branch or working tree (they may differ). Run \`git show <remote>/<target-branch>:<path>\` (typically \`origin/<target-branch>\`) and read the line numbers from that output.
100
+
101
+ Examples:
102
+ - Good: \`This duplicates [\\\`DisposableCollection.push\\\`](link). Use that instead.\`
103
+ - Bad: \`It is worth noting that there exists a utility method called DisposableCollection.push which provides similar functionality — consider leveraging it to reduce code duplication.\`
104
+
105
+ # Workflow
106
+
107
+ Follow these phases in order. Complete each phase before moving to the next.
108
+
109
+ ## Phase 1: Fetch PR Information & Create Review Plan
110
+
111
+ ### 1a: Determine the PR number
112
+
113
+ If the user provided a PR number or URL, extract the number from it.
114
+ If the user did not specify a PR (e.g., "review my PR", "review the latest PR"), attempt to infer it:
115
+ 1. Run ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`gh pr view --json number --jq .number\` to check if the current branch has an associated PR.
116
+ 2. If that fails, ask the user to provide the PR number.
117
+
118
+ ### 1b: Fetch PR info via delegation
119
+
120
+ **You MUST delegate this to the GitHub agent.** Do NOT call Github tools directly.
121
+
122
+ Use ~{${ai_core_1.AGENT_DELEGATION_FUNCTION_ID}} with agent ID '${github_chat_agent_1.GitHubChatAgentId}' and ask it to retrieve:
123
+ - PR title, description, author, branch names, state
124
+ - ALL changed files with their diffs/patches
125
+ - ALL existing review comments
126
+ - CI/check status
127
+ - Any linked issues
128
+
129
+ Example delegation prompt:
130
+ \`\`\`
131
+ Please retrieve comprehensive information about pull request #<NUMBER>. I need:
132
+ 1. PR title, description, author, source and target branch names, and current state
133
+ 2. The complete list of changed files with their diffs/patches
134
+ 3. ALL review comments and conversation comments
135
+ 4. CI/check status
136
+ 5. Any linked or referenced issues
137
+ Completeness is critical - every review comment and every changed file must be included.
138
+ \`\`\`
139
+
140
+ ### 1c: Create the review plan immediately
141
+
142
+ As soon as you have the PR information, use ~{${task_context_function_ids_1.CREATE_TASK_CONTEXT_FUNCTION_ID}} to create the review plan. Fill in the PR Information and Changed Files sections right away:
143
+
144
+ \`\`\`markdown
145
+ # PR Review: <title> (#<number>)
146
+
147
+ ## PR Information
148
+ - **Title:** <title>
149
+ - **Author:** <author>
150
+ - **Branch:** <source> → <target>
151
+ - **Description:** <description summary>
152
+ - **CI Status:** <pass/fail/pending>
153
+
154
+ ## Changed Files
155
+ - <file1> (modified/added/deleted/renamed from <old-path>)
156
+ - <file2> (modified/added/deleted/renamed from <old-path>)
157
+ ...
158
+
159
+ ## Build Status
160
+ [To be updated in Phase 2]
161
+
162
+ ## Exploration Findings
163
+ [To be updated in Phase 3]
164
+
165
+ ## Review Walkthrough
166
+
167
+ ### Overview
168
+ [To be updated in Phase 4]
169
+
170
+ ### Changes & Findings
171
+ [To be updated in Phase 4]
172
+
173
+ ## User Feedback
174
+ [To be updated during Phase 5 walkthrough]
175
+
176
+ ## Review Summary
177
+ [To be updated after walkthrough]
178
+ \`\`\`
179
+
180
+ ## Phase 2: Local Setup & Clean Build
181
+
182
+ ### 2a: Check out the PR branch locally
183
+
184
+ **Before modifying the working tree**, inform the user via ~{${user_interaction_tool_1.USER_INTERACTION_FUNCTION_ID}} (single-step, with options "Proceed" / "Abort") that you need to switch branches and may stash uncommitted changes.
185
+
186
+ **Important: branch switches affect the task context.** The review plan you created in Phase 1c is stored as a workspace file by default, so a \`git checkout\` will overwrite or remove it just like any other working-tree file. The plan is carried across branches by stashing it separately from the user's other changes:
187
+
188
+ 1. Record the current branch: ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`git rev-parse --abbrev-ref HEAD\` — save this as \`<original-branch>\` for cleanup in Phase 7.
189
+ 2. Stash the review plan **on its own**: ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`git stash push -u -m "pr-review-plan-<number>" -- <plan-path>\`. The \`-u\` flag is required because the plan file is typically untracked. Record the stash message for later lookup.
190
+ 3. Stash any remaining user changes separately: ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`git status --porcelain\`. If anything is still dirty: \`git stash push -u -m "pr-review-user-<number>"\`. This stash stays put until Phase 7.
191
+ 4. Check out the PR branch: ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`gh pr checkout <number>\`
192
+ - Fallback: \`git fetch origin pull/<number>/head:pr-<number> && git checkout pr-<number>\`
193
+ 5. Re-apply the plan stash on the PR branch. Find its ref via \`git stash list\` (match by the message recorded in step 2), then \`git stash pop <ref>\`. The plan file is now back in the working tree and subsequent phases can keep editing it via ~{${task_context_function_ids_1.EDIT_TASK_CONTEXT_FUNCTION_ID}}.
194
+ 6. Determine the merge base commit SHA: ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`git merge-base HEAD <base-branch>\` (use the base branch from the PR info, e.g., origin/main)
195
+ - Store this SHA — you will need it for opening diffs in Phase 5
196
+
197
+ ### 2b: Clean build
198
+ 1. Check whether there is a task to install the codebase. If there is none fallback to ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}}. Inspect the package.json to identify the correct install command.
199
+ 2. Build the project: Again use a task if available. Only fallback to shell if you encounter issues.
200
+ - If the build fails, note this as a **critical finding**
201
+
202
+ ### 2c: Update the review plan
203
+ Use ~{${task_context_function_ids_1.EDIT_TASK_CONTEXT_FUNCTION_ID}} to update the "Build Status" section with the result (success or failure details).
204
+
205
+ ## Phase 3: Explore Codebase
206
+
207
+ **You MUST delegate this to the Explore agent.** Do NOT explore the codebase yourself.
208
+
209
+ Use ~{${ai_core_1.AGENT_DELEGATION_FUNCTION_ID}} with agent ID '${explore_agent_1.ExploreAgentId}' to investigate:
210
+ - The architecture relevant to the changed files
211
+ - Related files that might be affected by the changes
212
+ - Existing patterns and conventions in the modified areas
213
+ - Test coverage for the changed areas
214
+
215
+ Make multiple parallel delegations for different areas of the codebase. Each delegation should be focused on a specific area or question. Limit delegations to **3–5 focused explorations**. For large PRs (20+ changed files), group files into logical areas first and explore per-area rather than per-file.
216
+
217
+ **Important:** The Explore agent has no prior context about the PR. Always include a brief summary of the relevant PR changes in each delegation prompt so the agent can assess impact, not just describe static architecture.
218
+
219
+ Example delegation prompts:
220
+ \`\`\`
221
+ // Delegation 1: Understand the component architecture
222
+ "This PR modifies <file1> and <file2> to add <brief description of change>. Examine these files and their surrounding directory. What is the architecture? What patterns are used? What are the key abstractions? Are there any conventions the PR changes should follow?"
223
+
224
+ // Delegation 2: Find related consumers
225
+ "This PR changes the API exported by <changed-module> by <brief description>. Find all files that import from or depend on this module. How do they use the APIs that were modified? Could any of them be affected by these changes?"
226
+
227
+ // Delegation 3: Check test coverage
228
+ "This PR modifies <changed-files> to <brief description>. Find all test files related to these files. What scenarios do they cover? Are there gaps that should be addressed given the changes?"
229
+ \`\`\`
230
+
231
+ ### Update the review plan
232
+ After receiving all exploration findings, use ~{${task_context_function_ids_1.EDIT_TASK_CONTEXT_FUNCTION_ID}} to fill in the "Exploration Findings" section.
233
+
234
+ ## Phase 4: Perform Code Review & Prepare Walkthrough
235
+
236
+ Now you perform the detailed review yourself. For each changed file:
237
+ 1. Read the file with ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
238
+ 2. Check diagnostics with ~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}}
239
+ 3. Search for related usages with ~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}} as needed
240
+
241
+ Analyze changes against:
242
+ - **Correctness:** Does the code do what it claims?
243
+ - **Style consistency:** Does it follow existing patterns from the exploration findings (Phase 3)?
244
+ - **Project guidelines:** Does it adhere to rules from \`{{prompt:project-info}}\` (e.g., coding conventions, preferred APIs, DI patterns)?
245
+ - **Potential bugs:** Race conditions, edge cases, error handling
246
+ - **Missing tests:** Are behavior changes covered by tests?
247
+ - **Security:** Any vulnerabilities introduced?
248
+
249
+ Cross-reference your findings with the exploration results from Phase 3 — use them to judge whether the PR follows established patterns in the areas it modifies. Also consider existing GitHub review comments from Phase 1.
250
+
251
+ ### Update the review plan with walkthrough content
252
+
253
+ Use ~{${task_context_function_ids_1.EDIT_TASK_CONTEXT_FUNCTION_ID}} to write the complete walkthrough into the review plan:
254
+
255
+ **Overview section:** Explain what the PR does and its most important changes.
256
+
257
+ **Changes & Findings section:** A numbered list of areas. Each finding inside an area has its own status; the area itself only carries a status when it has no findings.
258
+
259
+ **Status marker legend:**
260
+ - 🔲 Pending — not yet reviewed by user
261
+ - ✅ Confirmed — user confirmed the finding (or, on a no-finding area, reviewed it)
262
+ - ❌ Rejected — user rejected the finding
263
+ - 💬 Discussed — finding was discussed, see notes
264
+ - ⏭️ Skipped — user skipped this finding/area
265
+
266
+ **Writing rules** (these apply to both the plan entries and the wizard messages built from them):
267
+ - "What changed" is **one short sentence**. The diff link shows the code; do not restate it.
268
+ - Each finding has a **bold one-line headline**, then an optional **single sentence** of context. No paragraphs.
269
+ - Do not invent file metadata like \`(added, +440)\` or restate the file list inline; the area's **Files** field already lists them.
270
+
271
+ \`\`\`markdown
272
+ #### 1. [Area Name] (e.g., "New authentication middleware")
273
+ - **Files:** file1.ts, file2.ts
274
+ - **What changed:** [One-sentence neutral description]
275
+ - **Findings:**
276
+ 1. 🔴 **[Critical headline]** — [optional one sentence of context] (file1.ts:X-Y) — Status: 🔲 Pending
277
+ 2. 🟡 **[Warning headline]** — [optional one sentence of context] (file2.ts:X-Y) — Status: 🔲 Pending
278
+ 3. 🔵 **[Info headline]** — [optional one sentence of context] (file1.ts:X) — Status: 🔲 Pending
279
+ 4. 💡 **[Suggestion headline]** — [optional one sentence of context] — Status: 🔲 Pending
280
+ \`\`\`
281
+
282
+ Areas WITHOUT findings are still listed (so the user sees the full PR scope):
283
+ \`\`\`markdown
284
+ #### 2. [Area Name]
285
+ - **Files:** file3.ts
286
+ - **What changed:** [One-sentence neutral description]
287
+ - **Findings:** None — Status: 🔲 Pending
288
+ \`\`\`
289
+
290
+ Group related files into logical areas. Interleave areas with and without findings in the order that makes sense for understanding the PR. Do not bundle unrelated findings into a single area just to keep the list short — each finding will become its own walkthrough step in Phase 5, and combining them makes the user's vote ambiguous.
291
+
292
+ ## Phase 5: Interactive Walkthrough
293
+
294
+ **DIFF PREFERENCE RULE:** ALWAYS use diff links with gitRef for files that are part of the PR changes. Only use a single ref (no rightRef) for unmodified reference files outside the PR change set.
295
+
296
+ Use the following JSON shape for diff links (the left ref points to the merge base, the right ref to the working copy). Put the finding's \`line\` on the right (working copy) ref so the diff editor jumps to that line:
297
+ \`\`\`json
298
+ {"ref": {"path": "src/foo.ts", "gitRef": "<merge-base-sha>"}, "rightRef": {"path": "src/foo.ts", "line": 42}}
299
+ \`\`\`
300
+ For unmodified reference files (no diff), use a single ref with just the path:
301
+ \`\`\`json
302
+ {"ref": {"path": "src/bar.ts"}}
303
+ \`\`\`
304
+
305
+ For newly added files (no previous version exists), use an empty left ref:
306
+ \`\`\`json
307
+ {"ref": {"empty": true, "label": "new file"}, "rightRef": {"path": "src/new-file.ts"}}
308
+ \`\`\`
309
+
310
+ For deleted files (no current version exists), use an empty right ref:
311
+ \`\`\`json
312
+ {"ref": {"path": "src/deleted-file.ts", "gitRef": "<merge-base-sha>"}, "rightRef": {"empty": true, "label": "deleted"}}
313
+ \`\`\`
314
+
315
+ For renamed or moved files, use the old path on the left and the new path on the right:
316
+ \`\`\`json
317
+ {"ref": {"path": "src/old-path/foo.ts", "gitRef": "<merge-base-sha>"}, "rightRef": {"path": "src/new-path/foo.ts"}}
318
+ \`\`\`
319
+ This also works for files that were both renamed and modified — the diff will show content changes alongside the path change.
320
+
321
+ Build the **complete** list of walkthrough steps in advance and pass them in a **single** ~{${user_interaction_tool_1.USER_INTERACTION_FUNCTION_ID}} call. The tool description covers the request shape, the Next/Finish button, comments, and the return JSON.
322
+
323
+ ### Step 5a: Build the wizard
324
+
325
+ 1. Read the review plan with ~{${task_context_function_ids_1.GET_TASK_CONTEXT_FUNCTION_ID}}.
326
+ 2. Build the step list in plan order:
327
+ - Prepend one "Overview" step.
328
+ - For each area: emit **one step per finding** the area contains. If the area has no findings, emit **one informational step** for the area.
329
+ 3. Call ~{${user_interaction_tool_1.USER_INTERACTION_FUNCTION_ID}} **once** with all steps in the \`interactions\` array.
330
+
331
+ **Message format rules** (apply to every step's \`message\`):
332
+ - Keep messages **terse**. The diff link is what the user reads; the message is just enough context to vote.
333
+ - Use markdown structure (short paragraphs separated by blank lines, or short bullets) — never a wall of prose.
334
+ - Do not restate the file list inline; that is what the \`links\` are for. Do not invent line counts like \`(added, +440)\`.
335
+
336
+ Step shape rules:
337
+
338
+ **Overview step (first):**
339
+ - \`title\`: "PR Review Walkthrough"
340
+ - \`message\`: 2-4 short bullets covering purpose, scope, and what to expect (number of areas + findings). No prose paragraph.
341
+ - No \`options\` (informational).
342
+ - \`links\`: Optional, e.g. a top-level overview file.
343
+
344
+ **Per-finding step:**
345
+ - \`title\`: "[Area Name] — [Finding headline]" (the headline from the plan, kept short).
346
+ - \`message\`: Severity emoji + bold headline on the first line, then **at most 1-2 sentences** of context explaining why it is a finding. Include the file:line reference inline. Do **not** mix in unrelated findings or general "what changed" prose; this step is about exactly one finding.
347
+ - \`options\`: **Exactly two**: \`[{"text": "Confirm finding (it is a real issue)", "buttonLabel": "✅ Confirm finding", "value": "confirm"}, {"text": "Reject finding (the code is fine as-is)", "buttonLabel": "❌ Reject finding", "value": "reject"}]\`
348
+ - \`links\`: One per file the finding touches, with merge-base diff and the finding's line.
349
+
350
+ **Phrasing rule for buttons:** Labels must indicate the user is voting on the **finding**, not on the code. Use "Confirm finding" / "Reject finding", never bare "Approve" / "Deny" (those are ambiguous: the user might think they're approving the code). Apply the same rule to other interactions (e.g. submission steps prefer "Submit review" over "Approve").
351
+
352
+ **Per-area informational step (only when the area has no findings):**
353
+ - \`title\`: "[Area Name]"
354
+ - \`message\`: One short sentence on what changed, then "No findings.". No options.
355
+ - \`links\`: One per file in the area.
356
+
357
+ **Constraints:**
358
+ - One step per finding. Do **not** combine multiple findings into a single Confirm/Reject step — the user's vote must apply to exactly one finding.
359
+ - Only include "Confirm finding" / "Reject finding" buttons on per-finding steps. Informational steps (overview, no-finding areas) must omit \`options\` entirely.
360
+
361
+ ### Step 5b: Process the result
362
+
363
+ After the wizard returns:
364
+ 1. Use ~{${task_context_function_ids_1.EDIT_TASK_CONTEXT_FUNCTION_ID}} to update the review plan. Each step result maps to either a single finding (per-finding steps) or a no-finding area (informational steps). Match by step \`title\` and update its status:
365
+ - \`value === "confirm"\` → ✅ Confirmed (per-finding step)
366
+ - \`value === "reject"\` → ❌ Rejected (per-finding step)
367
+ - \`value === undefined\` and the step had no options → ✅ Reviewed (informational step: overview or no-finding area)
368
+ - \`skipped === true\` → 🔲 Pending (untouched)
369
+ - Append any \`comments\` as user notes on the matching finding/area.
370
+ 2. If \`completed === false\`, the user canceled. Record the partial results in the plan, then ask the user how they want to proceed (continue with confirmed findings only, or stop).
371
+ 3. If any step has comments that read like a question or request for discussion, address them conversationally **before** moving to Phase 6. Once all discussion items are resolved, continue.
372
+
373
+ ### Step 5c: Submission prompt
374
+
375
+ Once the walkthrough is processed, call ~{${user_interaction_tool_1.USER_INTERACTION_FUNCTION_ID}} again with a **single-step** wizard:
376
+ - \`title\`: "Submit Review"
377
+ - \`message\`: Markdown summary of confirmed findings ready for submission
378
+ - \`options\`: \`[{"text": "Create pending review on GitHub", "buttonLabel": "📤 Create review", "value": "submit"}, {"text": "Keep review plan only, don't submit", "buttonLabel": "🚫 Don't submit", "value": "cancel"}]\`
379
+
380
+ - On \`"submit"\`: proceed to Phase 6
381
+ - On \`"cancel"\` (or no selection): update the review plan with "Review completed — not submitted", proceed to Phase 7
382
+
383
+ ## Phase 6: Create Pending Review
384
+
385
+ **You MUST delegate this to the GitHub agent.** Do NOT call MCP tools directly.
386
+
387
+ Compose the review comment text yourself **before** delegating, applying the **Review Comment Style** rules above (no em dashes, no filler phrases, 1-3 sentences, no emojis, permalinks substantiate every claim about existing code, line numbers from the target branch). Pass the finished comment text to the GitHub agent verbatim.
388
+
389
+ Use ~{${ai_core_1.AGENT_DELEGATION_FUNCTION_ID}} with agent ID '${github_chat_agent_1.GitHubChatAgentId}' and instruct it to:
390
+ 1. Create a **pending** pull request review on the PR (do NOT submit it; the user will review and submit manually).
391
+ 2. Add the prepared review comments for each confirmed finding (file path, line number on the target branch, and the comment text you composed).
392
+
393
+ If a pending review of yours already exists on this PR, instruct the GitHub agent to add comments to it rather than creating a new one. Do not repeat comments that are already present.
394
+
395
+ After successful creation, present a confirmation to the user and proceed to Phase 7.
396
+
397
+ ## Phase 7: Cleanup
398
+
399
+ Restore the user's original working tree state, mirroring the stash strategy from Phase 2a:
400
+
401
+ 1. Stash the latest review plan: ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`git stash push -u -m "pr-review-plan-final-<number>" -- <plan-path>\`. This carries the final plan back to the original branch.
402
+ 2. Check out the original branch: ~{${shell_execution_server_1.SHELL_EXECUTION_FUNCTION_ID}} → \`git checkout <original-branch>\` (recorded in Phase 2a).
403
+ 3. Pop the final-plan stash: locate it via \`git stash list\` and \`git stash pop <ref>\`. The latest review plan is now in the user's original branch working tree.
404
+ 4. If a user-changes stash was created in Phase 2a: locate it via \`git stash list\` and \`git stash pop <ref>\`.
405
+ 5. Confirm to the user that their workspace has been restored.
406
+
407
+ If any cleanup step fails, inform the user with the exact commands they can run manually.
408
+
409
+ # User Interaction Rules
410
+
411
+ Use ~{${user_interaction_tool_1.USER_INTERACTION_FUNCTION_ID}} whenever you need the user to make a choice or walk through pre-determined items. Beyond what the tool description already covers, follow these PR-review specifics:
412
+ - Always provide a meaningful **title** and a detailed markdown **message** for every step.
413
+ - Add **links** for any file or diff the step references; they auto-open when the user reaches the step.
414
+ - Batch all known steps into a single \`interactions\` array to avoid per-step round trips.
415
+ - If the user cancels mid-walkthrough, the user wants to talk to you. Resume conversationally, then either re-issue the remaining steps as a new wizard or continue without it.
416
+
417
+ # Error Recovery
418
+
419
+ When encountering failures, handle them gracefully instead of stopping:
420
+
421
+ - **GitHub agent delegation fails** (e.g., MCP tools not configured, authentication error, rate limit): Inform the user that the GitHub integration is unavailable with the specific error. Suggest they check their GitHub MCP server configuration and authentication. Do NOT retry indefinitely — after 2 failed attempts, present the error and ask the user how to proceed.
422
+ - **Explore agent delegation fails**: Fall back to using ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}} and ~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}} directly for lightweight exploration. Note in the review plan that exploration was limited.
423
+ - **\`gh\` CLI not available**: Fall back to raw git commands. If git operations also fail, inform the user and ask them to check out the PR branch manually, then continue from Phase 2b.
424
+ - **Build fails**: Record the failure as a critical finding in the review plan. Continue with the review — the code is still reviewable even if it does not build. Note which findings may be related to the build failure.
425
+ - **Task context edit fails repeatedly**: Use ~{${task_context_function_ids_1.REWRITE_TASK_CONTEXT_FUNCTION_ID}} as a fallback to replace the entire review plan content.
426
+ - **Shell command fails**: Read the error output carefully. If it is a transient issue (e.g., network timeout), retry once. If it is a permanent issue (e.g., command not found), fall back to an alternative approach or inform the user.
427
+
428
+ # Context
429
+
430
+ {{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
431
+
432
+ {{prompt:project-info}}
433
+
434
+ {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
435
+ `
436
+ };
437
+ //# sourceMappingURL=pr-review-prompt-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pr-review-prompt-template.js","sourceRoot":"","sources":["../../../src/browser/review/pr-review-prompt-template.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAGhF,iGAAmG;AACnG,sEAA6G;AAC7G,0EAM0C;AAC1C,sFAMgD;AAChD,8EAAkF;AAClF,4DAAyD;AACzD,oDAAkD;AAClD,4CAA8D;AAEjD,QAAA,0BAA0B,GAAG,kBAAkB,CAAC;AAEhD,QAAA,oBAAoB,GAAuB;IACrD,EAAE,EAAE,kCAA0B;IAC9B,QAAQ,EAAE;;;;;;;;;;;MAWP,sCAA4B,sDAAsD,qCAAiB,sBAAsB,8BAAc;;;MAGvI,4CAAsB;MACtB,0CAAoB;;;MAGpB,oDAA2B,yIAAyI,0CAAoB;;;MAGxL,8CAAwB;MACxB,6CAAuB;MACvB,qDAA+B;;;MAG/B,2DAA+B;MAC/B,wDAA4B;MAC5B,yDAA6B;MAC7B,0DAA8B;MAC9B,4DAAgC;;;MAGhC,oDAA4B;;;;;;mBAMf,sCAA4B;;6HAE8E,qCAAiB;oJACM,8BAAc;;gBAElJ,8CAAwB,QAAQ,6CAAuB,YAAY,qDAA+B;;;;;;;;;;;;;;;wQAesJ,oDAA4B;;;;;;;;;;;;;;;;;;;;;;;;;WAyBzR,oDAA2B;;;;;;;QAO9B,sCAA4B,oBAAoB,qCAAiB;;;;;;;;;;;;;;;;;;;;gDAoBzB,2DAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DA0ChB,oDAA4B;;;;kCAIzD,oDAA2B;6CAChB,oDAA2B;oDACpB,oDAA2B;gCAC/C,oDAA2B;;0PAE+L,yDAA6B;4CAC3O,oDAA2B;;;;2FAIoB,oDAA2B;;;;;QAK9G,yDAA6B;;;;;;QAM7B,sCAA4B,oBAAoB,8BAAc;;;;;;;;;;;;;;;;;;;;;;;kDAuBpB,yDAA6B;;;;;0BAKrD,8CAAwB;8BACpB,6CAAuB;sCACf,qDAA+B;;;;;;;;;;;;;;QAc7D,yDAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8FAoEyD,oDAA4B;;;;iCAIzF,wDAA4B;;;;YAIjD,oDAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAmC7B,yDAA6B;;;;;;;;;;;4CAWI,oDAA4B;;;;;;;;;;;;;;QAchE,sCAA4B,oBAAoB,qCAAiB;;;;;;;;;;;;qCAYpC,oDAA2B;sCAC1B,oDAA2B;;;;;;;;;QASzD,oDAA4B;;;;;;;;;;;6DAWyB,8CAAwB,WAAW,qDAA+B;;;kDAG7E,4DAAgC;;;;;IAK9E,6CAAyB;;;;IAIzB,oDAAgC;CACnC;CACA,CAAC"}
@@ -2,10 +2,12 @@ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
2
2
  import { DefaultPromptFragmentCustomizationService } from '@theia/ai-core/lib/browser/frontend-prompt-customization-service';
3
3
  import { WorkspaceService } from '@theia/workspace/lib/browser';
4
4
  import { PreferenceService } from '@theia/core';
5
+ import { WorkspaceTrustService } from '@theia/workspace/lib/browser/workspace-trust-service';
5
6
  export declare class TemplatePreferenceContribution implements FrontendApplicationContribution {
6
7
  protected readonly preferenceService: PreferenceService;
7
8
  protected readonly customizationService: DefaultPromptFragmentCustomizationService;
8
9
  protected readonly workspaceService: WorkspaceService;
10
+ protected readonly workspaceTrustService: WorkspaceTrustService;
9
11
  onStart(): void;
10
12
  /**
11
13
  * Updates the template configuration in the customization service.
@@ -1 +1 @@
1
- {"version":3,"file":"template-preference-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/template-preference-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,yCAAyC,EAAyC,MAAM,kEAAkE,CAAC;AAMpK,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAQ,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEtD,qBACa,8BAA+B,YAAW,+BAA+B;IAGlF,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,yCAAyC,CAAC;IAGnF,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,OAAO,IAAI,IAAI;IAqBf;;;;OAIG;cACa,mBAAmB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAiCjF"}
1
+ {"version":3,"file":"template-preference-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/template-preference-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,yCAAyC,EAAyC,MAAM,kEAAkE,CAAC;AAMpK,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAQ,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAE7F,qBACa,8BAA+B,YAAW,+BAA+B;IAGlF,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,yCAAyC,CAAC;IAGnF,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAEhE,OAAO,IAAI,IAAI;IA8Bf;;;;OAIG;cACa,mBAAmB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA8CjF"}
@@ -22,9 +22,14 @@ const frontend_prompt_customization_service_1 = require("@theia/ai-core/lib/brow
22
22
  const workspace_preferences_1 = require("../common/workspace-preferences");
23
23
  const browser_1 = require("@theia/workspace/lib/browser");
24
24
  const core_1 = require("@theia/core");
25
+ const workspace_trust_service_1 = require("@theia/workspace/lib/browser/workspace-trust-service");
25
26
  let TemplatePreferenceContribution = class TemplatePreferenceContribution {
26
27
  onStart() {
27
- Promise.all([this.preferenceService.ready, this.workspaceService.ready]).then(() => {
28
+ Promise.all([
29
+ this.preferenceService.ready,
30
+ this.workspaceService.ready,
31
+ this.workspaceTrustService.getWorkspaceTrust()
32
+ ]).then(() => {
28
33
  // Set initial template configuration from preferences
29
34
  this.updateConfiguration();
30
35
  // Listen for preference changes
@@ -39,6 +44,10 @@ let TemplatePreferenceContribution = class TemplatePreferenceContribution {
39
44
  this.workspaceService.onWorkspaceLocationChanged(() => {
40
45
  this.updateConfiguration();
41
46
  });
47
+ // Listen for trust changes to reload/unload workspace templates
48
+ this.workspaceTrustService.onDidChangeWorkspaceTrust(() => {
49
+ this.updateConfiguration();
50
+ });
42
51
  });
43
52
  }
44
53
  /**
@@ -51,26 +60,42 @@ let TemplatePreferenceContribution = class TemplatePreferenceContribution {
51
60
  if (!workspaceRoot) {
52
61
  return;
53
62
  }
63
+ const trusted = await this.workspaceTrustService.getWorkspaceTrust();
54
64
  const workspaceRootUri = workspaceRoot.resource;
55
65
  const configProperties = {};
56
66
  if (!changedPreference || changedPreference === workspace_preferences_1.PROMPT_TEMPLATE_WORKSPACE_DIRECTORIES_PREF) {
57
- const relativeDirectories = this.preferenceService.get(workspace_preferences_1.PROMPT_TEMPLATE_WORKSPACE_DIRECTORIES_PREF, []);
58
- configProperties.directoryPaths = relativeDirectories.map(dir => {
59
- const path = new core_1.Path(dir);
60
- const uri = workspaceRootUri.resolve(path.toString());
61
- return uri.path.toString();
62
- });
67
+ if (trusted) {
68
+ const relativeDirectories = this.preferenceService.get(workspace_preferences_1.PROMPT_TEMPLATE_WORKSPACE_DIRECTORIES_PREF, []);
69
+ configProperties.directoryPaths = relativeDirectories.map(dir => {
70
+ const path = new core_1.Path(dir);
71
+ const uri = workspaceRootUri.resolve(path.toString());
72
+ return uri.path.toString();
73
+ });
74
+ }
75
+ else {
76
+ configProperties.directoryPaths = [];
77
+ }
63
78
  }
64
79
  if (!changedPreference || changedPreference === workspace_preferences_1.PROMPT_TEMPLATE_ADDITIONAL_EXTENSIONS_PREF) {
65
- configProperties.extensions = this.preferenceService.get(workspace_preferences_1.PROMPT_TEMPLATE_ADDITIONAL_EXTENSIONS_PREF, []);
80
+ if (trusted) {
81
+ configProperties.extensions = this.preferenceService.get(workspace_preferences_1.PROMPT_TEMPLATE_ADDITIONAL_EXTENSIONS_PREF, []);
82
+ }
83
+ else {
84
+ configProperties.extensions = [];
85
+ }
66
86
  }
67
87
  if (!changedPreference || changedPreference === workspace_preferences_1.PROMPT_TEMPLATE_WORKSPACE_FILES_PREF) {
68
- const relativeFilePaths = this.preferenceService.get(workspace_preferences_1.PROMPT_TEMPLATE_WORKSPACE_FILES_PREF, []);
69
- configProperties.filePaths = relativeFilePaths.map(filePath => {
70
- const path = new core_1.Path(filePath);
71
- const uri = workspaceRootUri.resolve(path.toString());
72
- return uri.path.toString();
73
- });
88
+ if (trusted) {
89
+ const relativeFilePaths = this.preferenceService.get(workspace_preferences_1.PROMPT_TEMPLATE_WORKSPACE_FILES_PREF, []);
90
+ configProperties.filePaths = relativeFilePaths.map(filePath => {
91
+ const path = new core_1.Path(filePath);
92
+ const uri = workspaceRootUri.resolve(path.toString());
93
+ return uri.path.toString();
94
+ });
95
+ }
96
+ else {
97
+ configProperties.filePaths = [];
98
+ }
74
99
  }
75
100
  await this.customizationService.updateConfiguration(configProperties);
76
101
  }
@@ -88,6 +113,10 @@ tslib_1.__decorate([
88
113
  (0, inversify_1.inject)(browser_1.WorkspaceService),
89
114
  tslib_1.__metadata("design:type", browser_1.WorkspaceService)
90
115
  ], TemplatePreferenceContribution.prototype, "workspaceService", void 0);
116
+ tslib_1.__decorate([
117
+ (0, inversify_1.inject)(workspace_trust_service_1.WorkspaceTrustService),
118
+ tslib_1.__metadata("design:type", workspace_trust_service_1.WorkspaceTrustService)
119
+ ], TemplatePreferenceContribution.prototype, "workspaceTrustService", void 0);
91
120
  exports.TemplatePreferenceContribution = TemplatePreferenceContribution = tslib_1.__decorate([
92
121
  (0, inversify_1.injectable)()
93
122
  ], TemplatePreferenceContribution);
@@ -1 +1 @@
1
- {"version":3,"file":"template-preference-contribution.js","sourceRoot":"","sources":["../../src/browser/template-preference-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,4DAAkE;AAClE,4HAAoK;AACpK,2EAIyC;AACzC,0DAAgE;AAChE,sCAAsD;AAG/C,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAWvC,OAAO;QACH,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAA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sE1C"}
1
+ {"version":3,"file":"template-preference-contribution.js","sourceRoot":"","sources":["../../src/browser/template-preference-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,4DAAkE;AAClE,4HAAoK;AACpK,2EAIyC;AACzC,0DAAgE;AAChE,sCAAsD;AACtD,kGAA6F;AAGtF,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAcvC,OAAO;QACH,OAAO,CAAC,GAAG,CAAC;YACR,IAAI,CAAC,iBAAiB,CAAC,KAAK;YAC5B,IAAI,CAAC,gBAAgB,CAAC,KAAK;YAC3B,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,EAAE;SACjD,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YACT,sDAAsD;YACtD,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAE3B,gCAAgC;YAChC,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE;gBAC/C,IAAI,KAAK,CAAC,cAAc,KAAK,kEAA0C;oBACnE,KAAK,CAAC,cAAc,KAAK,kEAA0C;oBACnE,KAAK,CAAC,cAAc,KAAK,4DAAoC,EAAE,CAAC;oBAChE,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;gBACnD,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,oCAAoC;YACpC,IAAI,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,GAAG,EAAE;gBAClD,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC/B,CAAC,CAAC,CAAC;YAEH,gEAAgE;YAChE,IAAI,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,GAAG,EAAE;gBACt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ree-view';
3
3
  import { ChatResponseContent, ToolCallChatResponseContent } from '@theia/ai-chat/lib/common';
4
4
  import { ReactNode } from '@theia/core/shared/react';
5
5
  import { ContextMenuRenderer } from '@theia/core/lib/browser';
6
- import { TodoItem } from './todo-tool';
6
+ import { TodoItem } from '../common/todo-tool';
7
7
  import { ToolConfirmationManager } from '@theia/ai-chat/lib/browser/chat-tool-preference-bindings';
8
8
  import { ToolInvocationRegistry } from '@theia/ai-core';
9
9
  export declare class TodoToolRenderer implements ChatResponsePartRenderer<ToolCallChatResponseContent> {
@@ -1 +1 @@
1
- {"version":3,"file":"todo-tool-renderer.d.ts","sourceRoot":"","sources":["../../src/browser/todo-tool-renderer.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAW,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAA0B,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAuDxD,qBACa,gBAAiB,YAAW,wBAAwB,CAAC,2BAA2B,CAAC;IAG1F,SAAS,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAG3D,SAAS,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAGnD,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAEzD,SAAS,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM;IAOhD,MAAM,CAAC,QAAQ,EAAE,2BAA2B,EAAE,UAAU,EAAE,YAAY,GAAG,SAAS;IA6BlF,SAAS,C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"}
@@ -22,7 +22,7 @@ const common_1 = require("@theia/ai-chat/lib/common");
22
22
  const React = require("@theia/core/shared/react");
23
23
  const browser_1 = require("@theia/core/lib/browser");
24
24
  const core_1 = require("@theia/core");
25
- const todo_tool_1 = require("./todo-tool");
25
+ const todo_tool_1 = require("../common/todo-tool");
26
26
  const tool_confirmation_1 = require("@theia/ai-chat-ui/lib/browser/chat-response-renderer/tool-confirmation");
27
27
  const chat_tool_preference_bindings_1 = require("@theia/ai-chat/lib/browser/chat-tool-preference-bindings");
28
28
  const ai_core_1 = require("@theia/ai-core");
@@ -1 +1 @@
1
- {"version":3,"file":"todo-tool-renderer.js","sourceRoot":"","sources":["../../src/browser/todo-tool-renderer.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAGlE,sDAA6F;AAE7F,kDAAkD;AAClD,qDAAuE;AACvE,sCAAkC;AAClC,2CAAgF;AAChF,8GAAkH;AAClH,4GAAmG;AACnG,4CAAwD;AAMxD,MAAM,iBAAiB,GAAqC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,CACX,6BAAK,SAAS,EAAC,kBAAkB;QAC7B,2BAAG,SAAS,EAAE,IAAA,iBAAO,EAAC,WAAW,CAAC,GAAI;QACtC,8BAAM,SAAS,EAAC,iBAAiB,IAAE,UAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAQ,CACvE,CACT,CAAC;IAEF,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,CACH,6BAAK,SAAS,EAAC,qBAAqB;YAC/B,MAAM;YACP,6BA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,CAAC,IAAI,KAAK,kCAAsB,CAAC;aACnF,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE,CAAiC,CAAC,EAAE,CAAC,CAAC;QAErD,OAAO,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,QAAQ,CAAC,EAAE,CAAC;IACjE,CAAC;IAES,UAAU,CAAC,IAAwB;QACzC,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/B,OAAO,SAAS,CAAC;YACrB,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,2BAAe,CAAC,CAAC;QAChD,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;CACJ,CAAA;AArEY,4CAAgB;AAGf;IADT,IAAA,kBAAM,EAAC,uDAAuB,CAAC;sCACG,uDAAuB;iEAAC;AAGjD;IADT,IAAA,kBAAM,EAAC,6BAAmB,CAAC;sCACG,6BAAmB;6DAAC;AAGzC;IADT,IAAA,kBAAM,EAAC,gCAAsB,CAAC;;gEAC0B;2BAThD,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAqE5B"}
1
+ {"version":3,"file":"todo-tool-renderer.js","sourceRoot":"","sources":["../../src/browser/todo-tool-renderer.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAE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Gf;IADT,IAAA,kBAAM,EAAC,uDAAuB,CAAC;sCACG,uDAAuB;iEAAC;AAGjD;IADT,IAAA,kBAAM,EAAC,6BAAmB,CAAC;sCACG,6BAAmB;6DAAC;AAGzC;IADT,IAAA,kBAAM,EAAC,gCAAsB,CAAC;;gEAC0B;2BAThD,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAqE5B"}
@@ -1,5 +1,4 @@
1
1
  import { ToolProvider, ToolRequest } from '@theia/ai-core/lib/common';
2
- export { TODO_WRITE_FUNCTION_ID, TodoItem, isValidTodoItem } from '../common/todo-tool';
3
2
  export declare class TodoWriteTool implements ToolProvider {
4
3
  static ID: string;
5
4
  getTool(): ToolRequest;