Skip to content

refactor(canvas): type local runtime and server lifecycle - #56

Merged
lukasoppermann merged 34 commits into
mainfrom
lukasoppermann-canvas-typescript-runtime
Oct 22, 2026
Merged

lukasoppermann merged 34 commits into
mainfrom
lukasoppermann-canvas-typescript-runtime

Conversation

@lukasoppermann

Copy link
Copy Markdown
Contributor

Why

The canvas TypeScript migration needs typed local servers and lifecycle callbacks before its final SDK registration layer can move. This layer builds on #55 without changing how authors connect, preview, start a server, or publish.

What changes

Move the loopback canvas and setup servers, preview proxy, prototype connection storage, development-server lifecycle and discovery, start-page reader, HTML renderer, browser launcher, startup errors, and agent action queue to strict TypeScript. Keep compiled sibling .mjs files and existing import URLs so installed plugins need no compiler or packages. Export contracts from the modules that own them and check unknown JSON, HTTP chunks, and consumed Hub fields before use.

Preserve host, origin, token and size safeguards, exact prototype URLs, action ownership and cancellation, cleanup, and explicit server-start consent. Add coverage showing malformed HTTP action results cannot consume a pending command, and update the contributor guide. Browser assets are unchanged.

SDK registration, asset checking, test helpers and entry shims remain for the final integration layer. End-to-end Copilot-host smoke remains for that layer.

lukasoppermann and others added 5 commits October 21, 2026 14:25
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
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2e9f29a3-a43f-469a-a5aa-8318559d915a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Copilot AI max review requested due to automatic review settings October 21, 2026 13:29
@lukasoppermann
lukasoppermann requested review from a team and nshki as code owners October 21, 2026 13:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The security-sensitive server and process-lifecycle migration needs human confirmation of compilation and runtime behavior.

No open issues 🎉

What changed in this PR

Continues the canvas TypeScript migration after #55, preparing the local runtime for typed SDK registration.

Changes:

  • Types local servers, preview proxy, connection storage, and development-server lifecycle.
  • Keeps generated .mjs modules and existing import URLs for package-free installation.
  • Adds malformed action-result coverage and updates contributor guidance.
File Description
hub/​docs/​prototype-canvas.md Documents typed runtime contracts.
.github/​extensions/​replica-prototype/​startup-error/​index.mts Types startup errors and public status.
.github/​extensions/​replica-prototype/​startup-error/​index.mjs Updates generated startup-error runtime.
.github/​extensions/​replica-prototype/​start-preview-proxy/​index.mts Types proxy requests and lifecycle.
.github/​extensions/​replica-prototype/​start-preview-proxy/​index.mjs Updates generated proxy runtime.
.github/​extensions/​replica-prototype/​start-missing-prototype-server/​index.mts Types server setup and connection flow.
.github/​extensions/​replica-prototype/​start-missing-prototype-server/​index.mjs Updates generated setup-server runtime.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.test.mjs Covers malformed results preserving pending actions.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.mts Types canvas routing and validates consumed data.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.mjs Updates generated canvas-server runtime.
.github/​extensions/​replica-prototype/​render-canvas-html/​index.mts Types renderer bootstrap inputs.
.github/​extensions/​replica-prototype/​render-canvas-html/​index.mjs Refreshes generated HTML-rendering runtime.
.github/​extensions/​replica-prototype/​read-prototype-start-page/​index.mts Types start-page reading and validation.
.github/​extensions/​replica-prototype/​read-prototype-start-page/​index.mjs Updates generated start-page runtime.
.github/​extensions/​replica-prototype/​prototype-connection/​index.mts Types connection storage with unknown JSON reads.
.github/​extensions/​replica-prototype/​prototype-connection/​index.mjs Updates generated connection-storage runtime.
.github/​extensions/​replica-prototype/​open-browser/​index.mts Types browser-launch inputs.
.github/​extensions/​replica-prototype/​open-browser/​index.mjs Refreshes generated browser-launch runtime.
.github/​extensions/​replica-prototype/​discover-prototype-servers/​index.mts Types discovery results and process records.
.github/​extensions/​replica-prototype/​discover-prototype-servers/​index.mjs Updates generated discovery runtime.
.github/​extensions/​replica-prototype/​dev-server/​index.mts Types server leases, startup, and cleanup.
.github/​extensions/​replica-prototype/​dev-server/​index.mjs Updates generated development-server runtime.
.github/​extensions/​replica-prototype/​check-prototype-server/​index.mts Types prototype availability checks.
.github/​extensions/​replica-prototype/​agent-commands/​index.mts Types action delivery, ownership, and cancellation.
.github/​extensions/​replica-prototype/​agent-commands/​index.mjs Updates generated action-queue runtime.

Review effort: Max

lukasoppermann and others added 10 commits October 22, 2026 08:01
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 2e9f29a3-a43f-469a-a5aa-8318559d915a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2e9f29a3-a43f-469a-a5aa-8318559d915a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: 2e9f29a3-a43f-469a-a5aa-8318559d915a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Migrate local servers, preview proxy, connection storage and development-server lifecycle to strict TypeScript while retaining generated JavaScript runtime modules. Keep host capabilities and explicit startup behavior unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 20ca3725-52e8-4e11-9258-99515de7789d
@lukasoppermann
lukasoppermann force-pushed the lukasoppermann-canvas-typescript-runtime branch from 2aaad21 to fdaeb9c Compare October 22, 2026 06:14
lukasoppermann and others added 7 commits October 22, 2026 17:14
…-hub-connection' into lukasoppermann-canvas-typescript-hub-connection
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2e9f29a3-a43f-469a-a5aa-8318559d915a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2e9f29a3-a43f-469a-a5aa-8318559d915a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 20ca3725-52e8-4e11-9258-99515de7789d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 20ca3725-52e8-4e11-9258-99515de7789d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
…as-typescript-collaboration' into lukasoppermann-canvas-typescript-runtime
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 20ca3725-52e8-4e11-9258-99515de7789d
…as-typescript-collaboration' into lukasoppermann-canvas-typescript-runtime
Base automatically changed from lukasoppermann-canvas-typescript-collaboration to main October 22, 2026 17:19
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 20ca3725-52e8-4e11-9258-99515de7789d
@lukasoppermann
lukasoppermann merged commit b6a55a7 into main Oct 22, 2026
40 checks passed
@lukasoppermann
lukasoppermann deleted the lukasoppermann-canvas-typescript-runtime branch October 22, 2026 17:30
lukasoppermann added a commit that referenced this pull request Oct 22, 2026
GitHub retargeted this layer to main after #56 landed. The main tree exactly matches the verified runtime parent; retain the validated integration tree while recording its landed ancestry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3d99a971-b97e-45c6-a109-5fa860c3e63e
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. -->

Finish checking the canvas's authored Node implementation with strict
TypeScript while keeping the installed plugin independent of a compiler
or package installation. This final migration layer includes the runtime
work landed in #56.

## 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 this
description. -->
<!-- For UI changes, prune obsolete and duplicate stories in the
affected catalogues as part of the change. Explain removed UI or
consolidated coverage where needed; see
hub/docs/storybook.md#ui-changes-and-pull-request-evidence. -->

Convert canvas registration, asset checking, the shared test-context
helper and the remaining Pick & polish implementation to authored
TypeScript with committed JavaScript output. This includes note storage,
conversation validation, batch projection, author profiles and
setup-page rendering; shared identity patterns are inherited from the
earlier migration layers. Registration and action declarations use the
real SDK types from an exact, locked Hub development dependency; the
host still supplies the runtime SDK.

Saved connection fields and URLs are checked before restoration, and
explicit URL input still overrides saved state. Pick & polish validates
stored notes and batches, action inputs and remote responses before
using their fields. The guide describes the completed inventory: 65
authored TypeScript modules, two JavaScript entry shims, generated
browser assets and validators, and 55 Node runtime test files that
exercise the distributed output.

Browser assets and installer behavior remain unchanged from the landed
parent. The project provider reload, discovery and invalid-input
rejection were verified in the real host; a final installation and
connected-action smoke check in the separate prototype consumer session
remains pending.

---------

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
Copilot-Session: dbbad477-1ff0-4721-b2a8-01308dc63448
Copilot-Session: 2c5cb6d7-c080-4957-a125-07380321d056
Copilot-Session: 3d99a971-b97e-45c6-a109-5fa860c3e63e
Copilot-Session: 20ca3725-52e8-4e11-9258-99515de7789d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants