mirror of
https://github.com/github/awesome-copilot.git
synced 2026-05-28 01:21:46 +00:00
fix(copilot-sdk-nodejs): correct assistant message delta event name (#1712)
The accessibility-report recipe and its companion doc used "assistant.message.delta" (dotted), which never matches the SDK event. The canonical name is "assistant.message_delta" (underscore), as documented in instructions/copilot-sdk-nodejs.instructions.md and used by the Python cookbook. Without this fix the streaming branch was dead and no incremental output was printed. (cherry picked from commit e050d7bfc96c55924b0bf534c8b3e57359463ba9) Signed-off-by: syalioune <sy_alioune@yahoo.fr>
This commit is contained in:
@@ -55,7 +55,7 @@ async function main() {
|
||||
let idleResolve: (() => void) | null = null;
|
||||
|
||||
session.on((event) => {
|
||||
if (event.type === "assistant.message.delta") {
|
||||
if (event.type === "assistant.message_delta") {
|
||||
process.stdout.write(event.data.deltaContent ?? "");
|
||||
} else if (event.type === "session.idle") {
|
||||
idleResolve?.();
|
||||
@@ -72,12 +72,12 @@ async function main() {
|
||||
|
||||
const prompt = `
|
||||
Use the Playwright MCP server to analyze the accessibility of this webpage: ${url}
|
||||
|
||||
|
||||
Please:
|
||||
1. Navigate to the URL using playwright-browser_navigate
|
||||
2. Take an accessibility snapshot using playwright-browser_snapshot
|
||||
3. Analyze the snapshot and provide a detailed accessibility report
|
||||
|
||||
|
||||
Format the report EXACTLY like this structure with emoji indicators:
|
||||
|
||||
📊 Accessibility Report: [Page Title] (domain.com)
|
||||
@@ -133,8 +133,8 @@ async function main() {
|
||||
const detectLanguagePrompt = `
|
||||
Analyze the current working directory to detect the primary programming language used in this project.
|
||||
Look for project files like package.json, *.csproj, pom.xml, requirements.txt, go.mod, etc.
|
||||
|
||||
Respond with ONLY the detected language name (e.g., "TypeScript", "JavaScript", "C#", "Python", "Java")
|
||||
|
||||
Respond with ONLY the detected language name (e.g., "TypeScript", "JavaScript", "C#", "Python", "Java")
|
||||
and a brief explanation of why you detected it.
|
||||
If no project is detected, suggest "TypeScript" as the default for Playwright tests.
|
||||
`;
|
||||
@@ -151,7 +151,7 @@ async function main() {
|
||||
|
||||
const testGenerationPrompt = `
|
||||
Based on the accessibility report you just generated for ${url}, create Playwright accessibility tests in ${language}.
|
||||
|
||||
|
||||
The tests should:
|
||||
1. Verify all the accessibility checks from the report
|
||||
2. Test for the issues that were found (to ensure they get fixed)
|
||||
@@ -167,7 +167,7 @@ async function main() {
|
||||
- Touch targets meet minimum size requirements
|
||||
4. Use Playwright's accessibility testing features
|
||||
5. Include helpful comments explaining each test
|
||||
|
||||
|
||||
Output the complete test file that can be saved and run.
|
||||
Use the Playwright MCP server tools if you need to verify any page details.
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user