Fix import paths and add error handling in agents documentation#10
Merged
JosunLP merged 6 commits intodevelopmentfrom Jan 24, 2026
Merged
Fix import paths and add error handling in agents documentation#10JosunLP merged 6 commits intodevelopmentfrom
JosunLP merged 6 commits intodevelopmentfrom
Conversation
Security and Playground Fixes: * Replaced direct assignment of HTML via `innerHTML` with safer DOM manipulation in the `logEvent` function within `playground/src/demos/core.ts` to prevent possible HTML injection vulnerabilities. * Updated collection handling in the same file to use the raw DOM element when re-appending items, improving code clarity and safety. Workflow and Versioning: * Added explicit `contents: read` permissions to both `build` and `build-docs` jobs in `.github/workflows/npm-publish.yml` to comply with GitHub Actions best practices. [[1]](diffhunk://#diff-8a5ce8b612395836520d0655143f732d08e747af57f3cfe76b5e283600106240R16-R17) [[2]](diffhunk://#diff-8a5ce8b612395836520d0655143f732d08e747af57f3cfe76b5e283600106240R29-R30) * Bumped package version to `1.1.1` in `package.json` to reflect the new release. * Added a changelog entry for version `1.1.1` noting the HTML handling fix in `CHANGELOG.md`.
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix import path inconsistencies in documentation
Fix import paths and add error handling in agents documentation
Jan 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Agents guide documentation to use consistent module import paths and improves robustness of the agent chat example by adding basic runtime error handling and safer input parsing.
Changes:
- Normalized documentation imports to
@bquery/bquery/{module}for reactive/component examples. - Added try/catch around the agent
fetchcall with HTTP status handling and a UI fallback message. - Replaced a prompt type assertion with a runtime type guard before trimming.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/guide/agents.md | Aligns import paths and hardens the agent chat example with safer input parsing and request/response error handling. |
| .gitignore | Ignores package-lock.json to prevent committing an npm lockfile. |
Comments suppressed due to low confidence (1)
docs/guide/agents.md:140
- In this component example,
props.nameis interpolated intohtmltemplates, buthtmldoes not escape values (it’s just string concatenation). To avoid demonstrating an XSS-prone pattern, usesafeHtml(or escape/sanitizeprops.name) when rendering potentially untrusted prop values intoinnerHTML-backed templates.
import { component, html } from '@bquery/bquery/component';
component('tool-pill', {
props: { name: { type: String, required: true } },
render({ props }) {
Collaborator
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Contributor
Author
Changes applied in bb10eec. Both review comments have been addressed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan: Fix Import Paths and Error Handling in Documentation
All changes have been successfully applied and verified. Documentation builds without errors.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.