feat(cli): add thread message stack - #3046
Open
miguel-heygen wants to merge 6 commits into
Open
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
3 tasks
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
Adds the
thread-message-stackregistry block together with the CLI machinery it needs: a bounded caller-payload validator that materializes the block at install time, an OAuth-only install gate, a resumable install intent that survives the browser round-trip, and a privacy-safe funnel that spans catalog, auth, install, preview, and render.Supersedes the closed mirror attempt in #3035.
Why
Every existing registry block ships fixed content, so
hyperframes addonly ever had to copy files. This block's content comes from the caller, which opens three holes the current add path cannot cover:The block is the vehicle. The install path is the actual change.
How
packages/cli/src/registry/threadMessageStack.tsvalidates the entire payload before touching a file: at most 100 messages,textat most 8192 chars,senderat most 256,siderestricted toincoming/outgoing, andstagger/holdfinite numbers in 0 to 60. Only then does it rewrite the singledata-hf-primitive-dataisland in the block HTML. Validate-then-mutate means a rejected payload can never leave a half-written file behind.threadMessageStackAuthorization.tsrequires a persisted OAuth credential and verifies it against the current-user endpoint. Environment and file API keys deliberately do not satisfy it, and the outcome is a closed set (authorized/api-key-only/cancelled/failed) so callers cannot treat an ambiguous result as success.commands/catalog-resume.tspersists a versioned record (item, artifact, version, funnel and install ids, status) through an atomic temp-file plus rename, with an explicit claim, so an install interrupted by the OAuth round-trip resumes exactly once instead of zero or twice.telemetry/primitive-funnel*.tsowns the lifecycle events. Discovery works fully anonymously, and the funnel context is persisted under.hyperframes/so preview and render stay stitched to the same funnel after the user authenticates.docs/schema/registry-item.json,packages/core/schemas/registry-item.json) gain the upstream artifact and version fields, and the resolver validates the recorded source digest, so an installed copy is traceable to an immutable upstream projection.scripts/generate-catalog-previews.tsandscripts/catalog-preview-temp.tsextended so the block is rendered by the same pipeline as every other catalog entry.Test plan
134 focused tests covering validation, authorization, resume, funnel, and the registry item, including a real installer to Studio preview to producer compile chain that produces a deterministic 8-frame MP4.
Full CLI suite at the reviewed head: 2,498 passed, 2 skipped.
Catalog preview scripts: 2 passed.
npx hyperframes lintandnpx hyperframes checkon the installed temp project: clean, zero runtime errors.CLI and core typechecks, schema sync, changed-file
oxlint/oxfmt, fallow audit, CLI build.CI at this head: 61 successful checks, 1 expected Mintlify skip.
Known and unchanged: aggregate registry lint still reports 38 pre-existing failures across older blocks. The new block passes with 0 warnings.
Unit tests added/updated
Manual testing performed (the end-to-end installer, preview, and render path is exercised in-suite rather than by hand)
Documentation updated (if applicable) - registry-item schemas