-
-
Notifications
You must be signed in to change notification settings - Fork 388
refactor(mcp): move workflow orchestration to the CLI #142
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
Changes from all commits
ad95856
a7b0d27
6e7fe72
7d602ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,8 @@ | ||
| import type { App } from "@modelcontextprotocol/ext-apps"; | ||
| import type { WorkflowRunSummaryView } from "../workflow-ui.js"; | ||
| import type { ActiveWorkflowSummary } from "../workflow-summary.js"; | ||
|
|
||
| export type ToolName = | ||
| | "open_workspace" | ||
| | "run_workflow" | ||
| | "workflow_status" | ||
| | "show_changes" | ||
| | "apply_patch" | ||
| | "exec_command" | ||
|
|
@@ -36,9 +34,6 @@ export interface ToolResultCard { | |
| detached?: boolean; | ||
| managed?: boolean; | ||
| }; | ||
| status?: string; | ||
| name?: string; | ||
| runId?: string; | ||
| summary?: Record<string, unknown>; | ||
| files?: Array<{ | ||
| path?: string; | ||
|
|
@@ -61,34 +56,12 @@ export interface ToolResultCard { | |
| description?: string; | ||
| path?: string; | ||
| }>; | ||
| activeWorkflows?: WorkflowRunSummaryView[]; | ||
| callSummary?: { | ||
| reused?: number; | ||
| live?: number; | ||
| failed?: number; | ||
| running?: number; | ||
| total?: number; | ||
| }; | ||
| agentProviders?: Array<{ | ||
| name?: string; | ||
| model?: { | ||
| supported?: boolean; | ||
| discovery?: string; | ||
| }; | ||
| effort?: { | ||
| supported?: boolean; | ||
| semantics?: string; | ||
| discovery?: string; | ||
| }; | ||
| }>; | ||
| activeWorkflows?: ActiveWorkflowSummary[]; | ||
| agentProviders?: string[]; | ||
| agents?: Array<{ | ||
| name?: string; | ||
| description?: string; | ||
| provider?: string; | ||
| model?: string; | ||
| effort?: string; | ||
| }>; | ||
|
Comment on lines
+59
to
64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Strict
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| skillDiagnostics?: unknown[]; | ||
| instruction?: string; | ||
| } | ||
|
|
||
|
|
@@ -108,8 +81,6 @@ export interface ToolPayload { | |
| export function isToolName(value: unknown): value is ToolName { | ||
| return ( | ||
| value === "open_workspace" || | ||
| value === "run_workflow" || | ||
| value === "workflow_status" || | ||
| value === "show_changes" || | ||
| value === "apply_patch" || | ||
| value === "exec_command" || | ||
|
|
@@ -152,10 +123,6 @@ export function isReviewTool(tool: ToolName): boolean { | |
| return tool === "show_changes"; | ||
| } | ||
|
|
||
| export function isWorkflowTool(tool: ToolName): boolean { | ||
| return tool === "run_workflow" || tool === "workflow_status"; | ||
| } | ||
|
|
||
| export function isToolResultCard(value: unknown): value is Omit<ToolResultCard, "tool"> { | ||
| return Boolean(value && typeof value === "object"); | ||
| } | ||
|
|
@@ -185,19 +152,15 @@ export function isExpandableCard(card: ToolResultCard): boolean { | |
| return ( | ||
| Number(card.summary?.agentsFiles ?? 0) > 0 || | ||
| Number(card.summary?.skills ?? 0) > 0 || | ||
| Number(card.summary?.skillDiagnostics ?? 0) > 0 || | ||
| Boolean(card.agentsFiles?.length) || | ||
| Boolean(card.availableAgentsFiles?.length) || | ||
| Boolean(card.skills?.length) || | ||
| Boolean(card.activeWorkflows?.length) || | ||
| Boolean(card.agentProviders?.length) || | ||
| Boolean(card.agents?.length) || | ||
| Boolean(card.skillDiagnostics?.length) | ||
| Boolean(card.agents?.length) | ||
| ); | ||
| } | ||
|
|
||
| if (isWorkflowTool(card.tool)) return Boolean(card.runId); | ||
|
|
||
| if (isReviewTool(card.tool)) return Boolean(card.files?.length || card.payload?.patch); | ||
| if (isPatchTool(card.tool)) return Boolean(card.payload?.patch); | ||
|
|
||
|
|
||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Line 73 does not test what it intends to test.
The parsed input at lines 48-64 never contains
skillDiagnostics."skillDiagnostics" in parsedis therefore false no matter what the schema declares. The assertion passes even ifopenWorkspaceOutputSchemareintroduces the field.Assert against the schema shape instead. The file already has a
fields()helper at lines 16-18 that returns the shape keys.💚 Proposed stronger assertion
If you want to keep a parse-level check as well, pass the field in the input and confirm that
z.objectstrips it:Confirm the strip-by-default behavior of
z.objectin zod 4.4.3 before you rely on the second form.📝 Committable suggestion
🤖 Prompt for AI Agents