Tokenizer as a GitHub Copilot desktop canvas extension#2
Open
MSFT-TKENDRICK wants to merge 2 commits into
Open
Tokenizer as a GitHub Copilot desktop canvas extension#2MSFT-TKENDRICK wants to merge 2 commits into
MSFT-TKENDRICK wants to merge 2 commits into
Conversation
Implements the tokenizer as a GitHub Copilot desktop canvas extension,
driven end-to-end by the agentic SDLC orchestrator over
specs/002-tokenizer-canvas.
Canvas (.github/extensions/tokenizer/):
- extension.mjs: SDK canvas wiring - per-instance loopback http.Server,
static asset + /state persistence routes, SSE /events, and
set_text / get_summary actions. Never writes stdout (JSON-RPC safe).
- web/{index.html,styles.css,app.js}: iframe UI (live summary, color +
non-color token categories, sortable 23-model cost table) on app theme
tokens.
- web/{tokenizer.mjs,models.mjs}: 1:1 ESM ports of src/lib/tokenizer.ts
and src/lib/copilotModels.ts, shared by iframe and Node actions.
- Session-scoped persistence keyed by sessionId under $COPILOT_HOME,
outside the repo tree (ADR-002 / MSF-006).
SDLC artifacts (spec 002):
- specs/002-tokenizer-canvas/spec.md (FR-009 clarification resolved).
- docs/sdlc/002-tokenizer-canvas: interview, GROUNDED proof (13/13),
squad manifest, 8 ASSERT evals, 7 BDD features, TDD loop, evidence.
- docs/sdlc/facets/MSF-006..010 + docs/sdlc/adr/ADR-002.
- .github/agents/squad/tokenizer-canvas-*: 7 spec-grounded members.
- tests/sdlc/tokenizer-canvas: TDD tests, Playwright visual spec, static
server. Evidence screenshots committed; regenerable videos/traces/
coverage HTML are gitignored.
Gates: npm test 66/66, typecheck clean, build OK, design:lint 0/0.
Canvas runtime-validated (reload->ready, open, set_text/get_summary,
/state persistence, input-schema + reserved-name guards).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds Live chat mode via the Copilot SDK behind the existing Simulated|Live toggle, makes the canvas render the published React app (web-ui/), fixes extension install/open, and hardens Live warm-up to degrade gracefully. Co-authored-by: Copilot <223556219+Copilot@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.
What & why
Surfaces the repo's tokenizer as a GitHub Copilot desktop canvas extension — a live side-panel that tokenizes text and compares input cost across Copilot models without leaving the app.
Built end-to-end with the agentic SDLC orchestrator from #1 over a dedicated SpecKit spec (
specs/002-tokenizer-canvas/).What is here
Canvas (
.github/extensions/tokenizer/)extension.mjs— Copilot SDK canvas: per-instance loopbackhttp.Server, static +/statepersistence routes, SSE/events, andset_text/get_summaryactions. Never writes stdout (JSON-RPC safe).web/{index.html,styles.css,app.js}— iframe UI on app theme tokens: live summary, color and non-color token categories, sortable 23-model cost table with over-limit flags.web/{tokenizer.mjs,models.mjs}— 1:1 ESM ports ofsrc/lib/tokenizer.ts/copilotModels.ts, shared by the iframe and the Node actions.sessionIdunder$COPILOT_HOME, outside the repo tree (ADR-002 / MSF-006).SDLC artifacts (spec 002)
specs/002-tokenizer-canvas/spec.md(FR-009 clarification resolved).docs/sdlc/002-tokenizer-canvas/— interview, GROUNDED proof (13/13), squad manifest, 8 ASSERT evals, 7 BDD features, TDD loop, evidence (+ screenshots).docs/sdlc/facets/MSF-006..010,docs/sdlc/adr/ADR-002, and 7 grounded squad agents under.github/agents/squad/.tests/sdlc/tokenizer-canvas/— TDD tests + Playwright visual spec + static server.Verification
npm test66/66 |typecheckclean |vite buildOK |design:lint0 errors / 0 warnings.open_canvas-> loopback URL,set_text/get_summaryround-trip,/statepersistence, input-schema + reserved-name guards.Try it
Open the Tokenizer canvas from the Copilot desktop app side panel.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com