Skip to content

Commit

Permalink
updated for VS Code chat participants update
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbion committed Mar 9, 2024
1 parent 6aa197b commit a48c9ee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
33 changes: 22 additions & 11 deletions src/agents/workflow/WorkflowSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,28 @@ export type StepProvide = {
description?: string;
};

export type FollowUp =
| {
title: string;
message: string;
}
| {
title: string;
commandId: string;
args?: any[];
when?: string;
};
export type FollowUp = {
/**
* The message to send to the chat.
*/
prompt: string;

/**
* A title to show the user. The prompt will be shown by default, when this is unspecified.
*/
label?: string;

/**
* By default, the followup goes to the same participant/command. But this property can be set to invoke a different participant.
* Followups can only invoke a participant that was contributed by the same extension.
*/
participant?: string;

/**
* By default, the followup goes to the same participant/command. But this property can be set to invoke a different command.
*/
command?: string;
};

/**
* A Step defines an entry point for a step in the workflow.
Expand Down
3 changes: 2 additions & 1 deletion src/tools/impl/read_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ToolManager } from '../ToolManager';
import { ToolContext } from '../ToolTypes';
import { getAbsolutePathInWorkspace } from '../../utils/fileUtils';
import { fileStorage } from '../../utils/fileStorage';
import path from 'path';

export const TOOL_READ_FILE = 'read_file';
export const TOOL_READ_FILES = 'read_files';
Expand All @@ -17,7 +18,7 @@ const read_file = async (context: ToolContext, filename: string, encoding?: Buff

context.onProgress({
type: 'inlineContentReference',
title: `\nAgent called \`read_file('${filePath}')\`\n`,
title: `read_file('${path.basename(filePath)}')`,
inlineReference: filePath,
});

Expand Down
3 changes: 2 additions & 1 deletion src/tools/impl/write_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ToolManager } from '../ToolManager';
import { ToolContext } from '../ToolTypes';
import { getAbsolutePathInWorkspace } from '../../utils/fileUtils';
import { fileStorage } from '../../utils/fileStorage';
import path from 'path';

export const TOOL_WRITE_FILE = 'write_file';

Expand All @@ -17,7 +18,7 @@ const write_file = async (context: ToolContext, filename: string, contents: stri

context.onProgress({
type: 'inlineContentReference',
title: `\nwrite_file(${filename})\n`,
title: `write_file(${path.basename(filename)})`,
inlineReference: filePath,
});
};
Expand Down

0 comments on commit a48c9ee

Please sign in to comment.