Add copilot-component-minimal template - #256
Draft
Nick Pape (nick-pape) wants to merge 1 commit into
Draft
Conversation
Adds a new "copilot" template category and a minimal Copilot Component template based on the greeting-copilot-component reference implementation. The template scaffolds a hello-world CopilotComponent with Zod-based properties schema, declarative agent manifests, and copilot agent config. Note: the example is not registered in rush.json because @microsoft/sp-copilot-component has not been published yet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
svalenciasan
added a commit
that referenced
this pull request
Aug 6, 2026
## Description Adds a full set of **Copilot Component templates** to the SPFx template system and brings them up to date with the newer reference implementations in `odsp-web`. This builds on and supersedes #256 (which added `copilot-component-minimal`). It is based on that work (the original minimal template commit is included in this branch) and then: - **Aligns the SPFx version** used by the copilot templates to `1.24.0-beta.2` — the newest line that is actually published to public npm for all required `@microsoft/*` packages (the repo's other templates track `1.23.2`, which is not published for `@microsoft/sp-copilot-component`). - **Updates `copilot-component-minimal`** to match the current odsp-web behavior: renders `this.properties.message`, uses the default `zodToJsonSchema` import with a compile-clean `zod` `3.24.1` / `zod-to-json-schema` `3.24.1` pair, fixes `@types/heft-jest` → `@types/jest`, bumps the agent schemas (Teams manifest v1.29, declarative agent v1.8, ai-plugin v2.4), points the serve page at `CopilotWorkbench.aspx`, and adds `tsconfig` `watchOptions` to avoid the copilot-agent build loop. - **Adds `copilot-component-noframework`** (migrated from the odsp "none" template): an HTML/CSS sample that reads host theme/display mode, shows a welcome image, and exposes an expand-to-fullscreen control. Includes `.module.scss` + `sass.json`, localization (`loc/`, `typescript.json` static assets, `config.json` `localizedResources`), and `images.d.ts`. - **Adds `copilot-component-react`** (migrated from the odsp react template): fetches the current user (Microsoft Graph `/me`) and site (SharePoint REST) via brokered SSO, then mounts a Fluent UI v9 React tree with host-context badges and four bridge actions (expand, open link, follow-up message, resize). This effectively migrates the odsp-web Yeoman copilot templates to the spfx repo template system so the odsp version can be deprecated. ### Notes for reviewers - **Conventions:** these follow spfx repo conventions, not odsp's — flat `src/`, `.eslintrc.js` (+ eslint 8), published-version deps via `<%= spfxVersion %>`, the spfx rig, and `_phase:*` scripts. No `.yo-rc.json` / yeoman artifacts. A dependency is added only when the migrated source actually imports it. - **Version allowlist:** `common/config/rush/common-versions.json` allowlists the copilot templates' `1.24.0-beta.2` SPFx packages, `@microsoft/sp-lodash-subset`, and `zod` `3.24.1`, since the copilot line intentionally tracks a newer SPFx than the other templates. - **`copilot-component-minimal` example** is now registered in `rush.json` (previously blocked because `@microsoft/sp-copilot-component` was unpublished; it is now published at `1.24.0-beta.2`). - The react example uses component name `Sample` to avoid colliding with the `import * as React from 'react'` symbol. - `teams/<solution>-agent.zip` is a copilot-agent build artifact and is gitignored (not committed). Relationship to #256: this can supersede it, or #256 can be closed in its favor — whichever the maintainers prefer. ## How was this tested? - `rush build` — all 22 projects build, including the three new copilot examples. - `cd tests/spfx-template-test && heft test --clean` — 22/22 pass (21 template scaffolds + 1 multi-component); snapshots and `examples/` golden copies regenerated from the templates via the CLI in CI mode. - `rush check` — no dependency mismatches. - Working tree is clean after a build (agent-zip artifacts ignored). - Each example was individually built against the published `1.24.0-beta.2` packages to confirm the migrated samples compile (including the Fluent UI v9 / `sp-http` / bridge react sample). ## Type of change - [ ] Bug fix - [x] New feature / enhancement - [x] Template change - [ ] Documentation / CI / governance --------- Co-authored-by: Nick Pape <5674316+nick-pape@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Santiago Valencia Sanchez <svalenciasan@users.noreply.github.com>
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.
Description
Adds a new
copilottemplate category and a minimal Copilot Component template (copilot-component-minimal) based on thegreeting-copilot-componentreference implementation in odsp-web.The template scaffolds a hello-world CopilotComponent with:
BaseCopilotComponentfrom@microsoft/sp-copilot-componentcopilot/manifest.json,declarativeAgent.json,ai-plugin.json)config/copilot-agent.jsonfor SPFx agent registrationNote: The example is not registered in
rush.jsonbecause@microsoft/sp-copilot-componenthas not been published yet —rush updatewould fail trying to resolve it.How was this tested
rush build— full build passesrushx testinapi/spfx-template-api— 357 tests pass (including category validation)rushx testinapps/spfx-cli— 109 tests passrushx testintests/spfx-template-test— 20 tests pass (new template scaffolds and matches example)Type of change
🤖 Generated with Claude Code