mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
feat: Implement slash command functionality in the orchestrator
- Refactored NodePalette to remove unused templates and streamline the UI. - Enhanced PropertyPanel to support slash commands with input fields for command name and arguments. - Introduced TagEditor for inline variable editing and custom template creation. - Updated PromptTemplateNode to display slash command badges and instructions. - Modified flow types to include slashCommand and slashArgs for structured execution. - Adjusted flow executor to construct instructions based on slash command fields.
This commit is contained in:
@@ -107,6 +107,16 @@ export interface PromptTemplateNodeData {
|
||||
*/
|
||||
contextRefs?: string[];
|
||||
|
||||
/**
|
||||
* Selected slash command name for structured execution
|
||||
*/
|
||||
slashCommand?: string;
|
||||
|
||||
/**
|
||||
* Arguments for the slash command
|
||||
*/
|
||||
slashArgs?: string;
|
||||
|
||||
/**
|
||||
* Error handling behavior
|
||||
*/
|
||||
|
||||
@@ -203,8 +203,21 @@ export class NodeRunner {
|
||||
private async runPromptTemplate(node: FlowNode): Promise<NodeResult> {
|
||||
const data = node.data as PromptTemplateNodeData;
|
||||
|
||||
// Interpolate instruction with variables
|
||||
let instruction = interpolate(data.instruction, this.context.variables);
|
||||
// Construct instruction from slash command fields if set, otherwise use raw instruction
|
||||
let instruction: string;
|
||||
if (data.slashCommand) {
|
||||
const args = data.slashArgs
|
||||
? interpolate(data.slashArgs, this.context.variables)
|
||||
: '';
|
||||
instruction = `/${data.slashCommand}${args ? ' ' + args : ''}`;
|
||||
// Append additional instruction if provided
|
||||
if (data.instruction) {
|
||||
const additional = interpolate(data.instruction, this.context.variables);
|
||||
instruction = `${instruction}\n\n${additional}`;
|
||||
}
|
||||
} else {
|
||||
instruction = interpolate(data.instruction, this.context.variables);
|
||||
}
|
||||
|
||||
// Resolve context references
|
||||
if (data.contextRefs && data.contextRefs.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user