Repository navigation
refactor(canvas): migrate shared extension infrastructure - #52
Merged
lukasoppermann merged 6 commits intoOct 22, 2026
Merged
Conversation
Convert remote branch lookup to strict TypeScript while retaining its generated JavaScript runtime. Include migrated modules in lint, type checks, and plugin freshness checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d7306a9-9831-4c78-89e7-3c5b581c895e
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1aff284a-77f1-4bcf-8245-e30889a2f392
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The build wrapper needs to preserve readable compiler diagnostics when compilation fails.
2 open issues
What changed in this PR
Continues #51’s TypeScript migration for shared canvas extension infrastructure while preserving committed JavaScript runtimes and the existing plugin entry point.
Changes:
- Adds typed command, storage, state, and repository helpers.
- Builds and formats all emitted runtime modules using Hub’s locked Node types.
- Adds command and state tests and documents the migration boundary.
| File | Description |
|---|---|
hub/script/build-extension-modules.mjs |
Compiles and formats emitted modules. |
hub/package.json |
Uses the new module-build script. |
hub/docs/prototype-canvas.md |
Documents migration and build boundaries. |
.github/extensions/replica-prototype/write-state/index.mts |
Adds typed state writing. |
.github/extensions/replica-prototype/write-state/index.mjs |
Updates generated runtime. |
.github/extensions/replica-prototype/tsconfig.json |
Uses Hub’s Node types. |
.github/extensions/replica-prototype/run-command/index.test.mjs |
Covers command inputs and failures. |
.github/extensions/replica-prototype/run-command/index.mts |
Adds typed command execution. |
.github/extensions/replica-prototype/run-command/index.mjs |
Checks error fields safely. |
.github/extensions/replica-prototype/run-command/index.d.mts |
Removes the temporary declaration. |
.github/extensions/replica-prototype/read-state/index.test.mjs |
Covers persistence and invalid data. |
.github/extensions/replica-prototype/read-state/index.mts |
Returns stored data as unknown. |
.github/extensions/replica-prototype/read-state/index.mjs |
Updates validation and error handling. |
.github/extensions/replica-prototype/read-repository-name/index.mts |
Adds typed repository parsing. |
.github/extensions/replica-prototype/read-repository-name/index.mjs |
Updates generated parsing logic. |
.github/extensions/replica-prototype/read-error-code/index.mts |
Adds checked error-code extraction. |
.github/extensions/replica-prototype/read-error-code/index.mjs |
Adds the generated helper. |
.github/extensions/replica-prototype/read-canvas-repository/index.mts |
Types repository identity resolution. |
.github/extensions/replica-prototype/read-canvas-repository/index.mjs |
Updates generated runtime. |
.github/extensions/replica-prototype/private-store/index.mts |
Types private storage and locking. |
.github/extensions/replica-prototype/private-store/index.mjs |
Uses shared error-code checks. |
.github/extensions/replica-prototype/create-canvas-context/index.mts |
Types canvas context and target resolution. |
.github/extensions/replica-prototype/create-canvas-context/index.mjs |
Regenerates the context runtime. |
Review effort: Max
alliscode
approved these changes
Oct 21, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d7306a9-9831-4c78-89e7-3c5b581c895e
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1aff284a-77f1-4bcf-8245-e30889a2f392
Merge the updated TypeScript foundation and keep the command result contract aligned with child-process errors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1aff284a-77f1-4bcf-8245-e30889a2f392
Base automatically changed from
lukasoppermann-canvas-typescript-foundation
to
main
October 22, 2026 06:06
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1aff284a-77f1-4bcf-8245-e30889a2f392
lukasoppermann
deleted the
lukasoppermann-canvas-typescript-infrastructure
branch
October 22, 2026 06:14
lukasoppermann
added a commit
that referenced
this pull request
Oct 22, 2026
<!-- Use a conventional commit-style title, such as "fix(hub): retain prototype history". --> ## Why <!-- Explain the problem and why this change matters in a short, plain-English paragraph. Link the issue when applicable. --> The canvas extension is moving its authored Node code to strict TypeScript while keeping its installable JavaScript runtime. This is layer 3 of that migration, built on #52, and covers the Hub connection without changing the user flow. ## What changes <!-- Describe what becomes different for a first-time reader. Explain necessary terms. Include accurate Mermaid diagrams when they clarify the proposal, using before/after diagrams when helpful. Add screenshots for meaningful UI changes. --> <!-- Omit validation sections, checklists, and routine test/CI summaries such as "CI is green" or "tests passed". Mention only known verification gaps that affect the change, not disclaimers about drafting the description. --> Adds TypeScript sources for the Hub client, origin validation and selection, private credentials, repository discovery, connection coordination, and learnings hook. External JSON is checked before use, and client responses retain unknown field values for consuming workflows to validate. The client exports reusable connection, request, status, and recall types. Commits generated sibling `.mjs` modules and keeps existing JavaScript imports and the `extension.mjs` entry point. Approval, renewal, request timing, and prompt-data minimization retain their existing flow. Adds focused malformed-data coverage and updates the contributor guide. Publishing, review workflows, local servers, SDK registration, and browser UI remain outside this layer. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d7306a9-9831-4c78-89e7-3c5b581c895e Copilot-Session: 1aff284a-77f1-4bcf-8245-e30889a2f392 Copilot-Session: 2e9f29a3-a43f-469a-a5aa-8318559d915a
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.

Why
Continue the canvas extension's TypeScript migration on top of #51. Shared command, storage, and repository helpers need compiler-checked implementations before the remaining workflows can migrate without relying on declarations for JavaScript behavior.
What changes
Move command execution, private storage, state-file reads and writes, and repository identity and context to strict TypeScript sources. Remove the temporary command declaration and share a checked error-code reader. Parsed storage data remains unknown until its consuming workflow checks the fields it uses; this change does not introduce a new stored-data format.
Keep the generated runnable
.mjsmodules committed, with the same host entry point and no compiler or package installation required for plugin consumers. The module build now formats every compiler-emitted runtime file rather than naming a single module. Reuse Hub's locked Node types and document the migration boundary. Hub clients, publishing and review workflows, servers, browser assets, and SDK registration remain outside this layer.