trunk-merge/pr-87243/815d15c4-2f63-4013-b873-e3c3cc9bc344 - #91372
Closed
trunk-io[bot] wants to merge 5 commits into
Closed
trunk-merge/pr-87243/815d15c4-2f63-4013-b873-e3c3cc9bc344#91372trunk-io[bot] wants to merge 5 commits into
trunk-io[bot] wants to merge 5 commits into
Conversation
Canvas code can now import the PostHog bridge as a typed, versioned module in both tiers: the cloud builder inlines canvas-sdk.mjs at build time, and the preview sandbox rewrites the import to a blob module. The window.ph global stays, so existing canvases and published artifacts keep working; canvasSdkVersion bumps to 0.2.0 with a supportedSdkVersions list so 0.1.0 sources keep building. Generated-By: PostHog Desktop Task-Id: fafe1078-8f88-48c7-ad19-38c96a30d384
Generated-By: PostHog Desktop Task-Id: 1ffdb6cb-dcc9-44fd-9dfc-f06736efeee8
The preview sandbox already has a mechanism for resolving bare specifiers, so use it instead of a bespoke Babel pass. The sandbox CSP already allows `blob:`, so the SDK module is minted as a blob and registered in the import map. That drops the exported AST mutator, its three visitors, and its three unit tests. Also: - The whitelist's allowed specifiers now come from the platform contract rather than a hand-merged set, removing the SDK special case. - The contract test reads the builder's manifest.json off disk and compares the fields the client actually reads, so vendored-copy drift fails instead of comparing two literals in one file. - The version test is parameterized over admitted and rejected versions, and the `_project` helper builds against the current SDK version instead of pinning 0.1.0, which is what made the legacy-version case look redundant. - `canvas-sdk.d.ts` moves into the skill's references/ directory. Skills are copied standalone into the sandbox, so the repo path it was referenced by did not resolve for the authoring agent it was written for. Its `results` type no longer claims every insight kind returns the trends series shape, matching the schema the host validates against. - The scaffold reference still told agents not to import `ph`, contradicting the guidance added alongside it. - Dropped a dead `supportedSdkVersions` fallback, and trimmed comments that described the replaced mechanism. Generated-By: PostHog Desktop Task-Id: fa274704-6266-4baa-8379-7c4999e2d007
Admission and resolution used to be one list in the preview. Now the import check reads the platform manifest while the import map is still built from FREEFORM_WHITELIST, so admitting a specifier server-side passes validation and then fails to resolve in the iframe. Assert every admitted specifier has a map entry. The preview also serves its own vendored copy of the SDK module, guarded only by a comment. Assert it matches the builder's canvas-sdk.mjs. Generated-By: PostHog Desktop Task-Id: 96b2ec13-6921-4991-be65-afbc04adb63e
Author
trunk-io
Bot
deleted the
trunk-merge/pr-87243/815d15c4-2f63-4013-b873-e3c3cc9bc344
branch
August 30, 2026 12:35
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.
This pull request was created and is being managed by Trunk Merge.
This pull request is based on the master branch at SHA da93d8bbd71e23d49a8372ec43b4a4c7f75c1316.
See more details here.
When CI completes, this pull request will be closed automatically.
Pull Requests Being Tested
This pull request is testing the changes from pull request 87243.