Add Copilot-assisted dashboard editing mode - #697
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| } | ||
|
|
||
| function injectCopilotPrompt(html, endpoint) { | ||
| const prompt = `<form id="dashboard-copilot-prompt" style="display:flex;gap:0.5rem;align-items:center;padding:0.75rem 1rem;border-bottom:1px solid #d0d7de;background:#f6f8fa;font:14px system-ui"> |
There was a problem hiding this comment.
@copilot move this to JavaScript file that gets conditionally loaded and uses the existing rendering infrastructure. DO NOT EVAL
There was a problem hiding this comment.
Moved the UI to a conditionally loaded copilot-prompt.js module using the shared DOM helper and dashboard styles, with no eval, in 8640a91.
| ...(copilotExecutable ? { path: copilotExecutable } : {}), | ||
| }), | ||
| workingDirectory, | ||
| logLevel: "none", |
There was a problem hiding this comment.
Enabled Copilot SDK debug logging and added sanitized session lifecycle logging in 8640a91.
|
|
||
| Apply this request: ${request} | ||
|
|
||
| Find the dashboard source file that defines this view. Follow the skill and the repository's dashboard specification, run the dashboard validator repeatedly until the edited document passes, and save the source file so the local preview reloads. Complete the edit rather than only describing it.`, |
There was a problem hiding this comment.
@copilot provide precise file path to dashboard.json and also how to edit the original locations of the package views
There was a problem hiding this comment.
The session now receives the exact generated dashboard path, the matched editable source path, every original dashboard source path, and explicit built-in/package editing guidance in 8640a91.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot inject copilot prompt module should be injected client side at startup with a query flag that the server provides, not dynamically by the server with the current hash. No string concat to generate HTML ever. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in df7caec: the server now provides a |
|
@copilot do a security deep review, add more logging - specially when things fail, misconfigured. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in 16f973d with cleanup follow-up eee86d2. Copilot sessions now expose only allowlisted dashboard read/validate/save tools, reject all unexpected permissions, require loopback binding, serialize requests, validate saved output, and log sanitized startup, configuration, denial, validation, session, and cleanup failures. Deep security review and CodeQL reported no findings. |
|
@copilot remove yaml dependency, only support JSON format. Always country JSON through parse/stringidy 2 spaces to normalize formatting |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in 88d7fc7. Copilot editing now accepts JSON only, parses and re-serializes dashboard sources with two-space indentation on read/save/post-session verification, rejects malformed JSON, and no longer imports or packages the YAML validator. |
|
@copilot use permissions and access control when launching node to guarantee the web server is not reading files outside the workspace. Apply basic secret regex cleaning before reading files back to the browser. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in 33d3f09, 0757dd7, and c5a1254. The CLI now relaunches Node with filesystem access limited to the workspace, keeps preview files inside that boundary, rejects canonical and symlink path escapes, clears inherited NODE_OPTIONS, and redacts common secret keys/tokens from JSON, HTML, CSS, and JavaScript before browser delivery and WebSocket updates. |
|
@copilot only allow reading .md, .json or web files or images. Refuse other file types. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in ed91790. Browser serving now uses an explicit allowlist for Markdown, JSON, HTML/CSS/JavaScript, and common image formats; unsupported and extensionless files return 404 before content is read. Text secret redaction now also covers Markdown and SVG. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in 3fb6753. The focused EU CRA, Advisory, and Software Development Practices package contracts now include the shared |
The local dashboard preview lacked an agentic editing path. This adds an optional Copilot mode for prompting changes to the active view and reloading validated updates.
Copilot runtime
@github/copilot-sdk.console.log.Browser integration
Editing workflow
/generate-dashboard-ir.Usage