generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 473
feat: add mpp-vscode support #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
7c2bef1
feat(mpp-vscode): init vscode extension project structure
phodal 0fd86e4
feat(mpp-vscode): implement core services and IDE integration
phodal 1a1fad2
feat(mpp-vscode): add DevIns language support and status bar
phodal 578308f
feat(mpp-vscode): add React Webview UI for chat interface
phodal 80020cc
refactor(markdown): move MarkdownTextParser to mpp-core
phodal aad2201
feat(mpp-vscode): add Timeline-based Sketch Renderer architecture
phodal 4f887f9
feat(mpp-vscode): integrate ConfigManager for ~/.autodev/config.yaml
phodal 407cb3d
feat(mpp-vscode): add ModelSelector and unified toolbar layout
phodal 2975520
fix(mpp-vscode): fix VSCode API acquisition for webview communication
phodal 98facf2
fix(mpp-vscode): prevent duplicate user message in timeline
phodal d13ce4e
fix(mpp-vscode): address PR #32 review comments
phodal b569934
feat(mpp-vscode): init vscode extension project structure
phodal 876e3a1
feat(mpp-vscode): implement core services and IDE integration
phodal 7d6a9ce
feat(mpp-vscode): add DevIns language support and status bar
phodal 6e78932
feat(mpp-vscode): add React Webview UI for chat interface
phodal e434dfe
refactor(markdown): move MarkdownTextParser to mpp-core
phodal 8d64f56
feat(mpp-vscode): add Timeline-based Sketch Renderer architecture
phodal caca9a3
feat(mpp-vscode): integrate ConfigManager for ~/.autodev/config.yaml
phodal 6b56e8a
feat(mpp-vscode): add ModelSelector and unified toolbar layout
phodal 277e397
fix(mpp-vscode): fix VSCode API acquisition for webview communication
phodal c5bf005
fix(mpp-vscode): prevent duplicate user message in timeline
phodal 2dd0fd8
fix(mpp-vscode): address PR #32 review comments
phodal 27899f3
feat(vscode): integrate mpp-core CompletionManager for auto-completion
phodal 31fb79f
Merge origin/master into feature/mpp-vscode
phodal 40c4593
feat(vscode): Enhanced Chat Input with DevIn Language Support (#34)
phodal 88781b5
feat(mpp-ui): implement file context management with indexed search
phodal 316c277
feat(mpp-core): implement Task Management Tool for CodingAgent (#38)
phodal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/plan/AgentPlan.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| package cc.unitmesh.agent.plan | ||
|
|
||
| import kotlinx.datetime.Clock | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| /** | ||
| * Represents a complete agent plan containing multiple tasks. | ||
| * | ||
| * An AgentPlan is the top-level container for organizing work | ||
| * into tasks and steps, with tracking for creation and update times. | ||
| */ | ||
| @Serializable | ||
| data class AgentPlan( | ||
| /** | ||
| * Unique identifier for this plan | ||
| */ | ||
| val id: String, | ||
|
|
||
| /** | ||
| * Tasks in this plan | ||
| */ | ||
| val tasks: MutableList<PlanTask> = mutableListOf(), | ||
|
|
||
| /** | ||
| * Timestamp when this plan was created (epoch milliseconds) | ||
| */ | ||
| val createdAt: Long = Clock.System.now().toEpochMilliseconds(), | ||
|
|
||
| /** | ||
| * Timestamp when this plan was last updated (epoch milliseconds) | ||
| */ | ||
| var updatedAt: Long = createdAt | ||
| ) { | ||
| /** | ||
| * Overall status of the plan (derived from tasks) | ||
| */ | ||
| val status: TaskStatus | ||
| get() = when { | ||
| tasks.isEmpty() -> TaskStatus.TODO | ||
| tasks.all { it.status == TaskStatus.COMPLETED } -> TaskStatus.COMPLETED | ||
| tasks.any { it.status == TaskStatus.FAILED } -> TaskStatus.FAILED | ||
| tasks.any { it.status == TaskStatus.IN_PROGRESS } -> TaskStatus.IN_PROGRESS | ||
| tasks.any { it.status == TaskStatus.BLOCKED } -> TaskStatus.BLOCKED | ||
| else -> TaskStatus.TODO | ||
| } | ||
|
|
||
| /** | ||
| * Overall progress percentage (0-100) | ||
| */ | ||
| val progressPercent: Int | ||
| get() { | ||
| val totalSteps = tasks.sumOf { it.totalStepCount } | ||
| if (totalSteps == 0) return 0 | ||
| val completedSteps = tasks.sumOf { it.completedStepCount } | ||
| return (completedSteps * 100) / totalSteps | ||
| } | ||
|
|
||
| /** | ||
| * Total number of tasks | ||
| */ | ||
| val taskCount: Int | ||
| get() = tasks.size | ||
|
|
||
| /** | ||
| * Number of completed tasks | ||
| */ | ||
| val completedTaskCount: Int | ||
| get() = tasks.count { it.isCompleted } | ||
|
|
||
| /** | ||
| * Add a task to this plan | ||
| */ | ||
| fun addTask(task: PlanTask) { | ||
| tasks.add(task) | ||
| touch() | ||
| } | ||
|
|
||
| /** | ||
| * Get a task by ID | ||
| */ | ||
| fun getTask(taskId: String): PlanTask? { | ||
| return tasks.find { it.id == taskId } | ||
| } | ||
|
|
||
| /** | ||
| * Update a task's status | ||
| */ | ||
| fun updateTaskStatus(taskId: String, status: TaskStatus) { | ||
| getTask(taskId)?.updateStatus(status) | ||
| touch() | ||
| } | ||
|
|
||
| /** | ||
| * Complete a step within a task | ||
| */ | ||
| fun completeStep(taskId: String, stepId: String) { | ||
| getTask(taskId)?.completeStep(stepId) | ||
| touch() | ||
| } | ||
|
|
||
| /** | ||
| * Update the updatedAt timestamp | ||
| */ | ||
| private fun touch() { | ||
| updatedAt = Clock.System.now().toEpochMilliseconds() | ||
| } | ||
|
|
||
| /** | ||
| * Convert to markdown format | ||
| */ | ||
| fun toMarkdown(): String { | ||
| val sb = StringBuilder() | ||
| tasks.forEachIndexed { index, task -> | ||
| sb.append(task.toMarkdown(index + 1)) | ||
| } | ||
| return sb.toString() | ||
| } | ||
|
|
||
| companion object { | ||
| private var idCounter = 0L | ||
|
|
||
| /** | ||
| * Create a new plan with generated ID | ||
| */ | ||
| fun create(tasks: List<PlanTask> = emptyList()): AgentPlan { | ||
| return AgentPlan( | ||
| id = generateId(), | ||
| tasks = tasks.toMutableList() | ||
| ) | ||
| } | ||
|
|
||
| /** | ||
| * Generate a unique plan ID | ||
| */ | ||
| fun generateId(): String { | ||
| return "plan_${++idCounter}_${Clock.System.now().toEpochMilliseconds()}" | ||
| } | ||
| } | ||
| } | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stricter validation for
taskIndex/stepIndexwould avoid mis-targeting stepsIn
executePlanManagementTool, both indices are derived as:This means a bad value like
"abc"silently becomes0, and missing indices are indistinguishable from an explicit0. For plan operations this could accidentally act on the first task/step instead of failing fast.Consider:
ToolResult.Error("taskIndex must be an integer")), and-1) or nullable field inPlanManagementParamsto represent “no index provided”, if the tool supports actions that don’t require indices.This will make plan actions safer and easier to debug when the LLM or caller sends bad parameters.
Also applies to: 383-392
🤖 Prompt for AI Agents