Repository navigation
feat(host-cloudflare): add a read-only ExecutorUnfurl entrypoint for link previews - #35
Merged
Merged
Conversation
…link previews Internal services that unfurl artifact links need a title and description for any artifact a link names, whoever owns it. Access to the artifact itself is still decided when the link is opened. `ExecutorUnfurl.artifactSummary(id)` is a service-binding-only RPC door with no route and no identity. It validates the id, then reads through a subject-less platform-view executor (tenant reach, writes denied) over the same D1 database and tenant as the other doors. The new `admin.artifactSummary` selects only title, description and updated_at, so no source, bindings, compiled output, preview, owner or subject leaves storage. `openDb` moves to `db/handle.ts` so the door does not load the MCP stack.
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.
Internal services that unfurl artifact links (chat link previews) need a title and description for any artifact a link names, whoever owns it. Whether the person clicking can open the artifact is still decided when they open the link.
Today the only way in is the full internal door. A subject-less read there sees only org-tier rows, so a personal artifact's link gets no preview.
Change
ExecutorUnfurlentrypoint (apps/host-cloudflare/src/worker.ts):WorkerEntrypointreached only through aservicesbinding withentrypoint: "ExecutorUnfurl". It has nofetchand no route, and takes no identity.artifactSummary(id), returns{ title, description, updatedAt } | null.artifactSummaryFor(apps/host-cloudflare/src/unfurl.ts):^art_[a-z0-9]{1,60}$before touching storage.makePlatformExecutor(organizationId): tenant reach, writes denied). That executor uses the same D1 handle and tenant as the other doors, and its layers are db, plugins and host config, with no MCP.ExecutorAdmin.artifactSummary(SDK):findFirstonartifactselecting onlytitle,descriptionandupdated_at. No source, bindings, compiled output, preview, owner or subject leaves storage.openDbmoves todb/handle.tsunchanged, so the door doesn't import the MCP stack.The owner policy and both existing doors are unchanged.
Tests
packages/core/sdk/src/platform-view.test.ts: summaries for an org artifact and for another member's personal artifact;nullfor an unknown id and for another tenant's artifact; andsave/renamerefused through the platform view.apps/host-cloudflare/src/unfurl.test.ts:artifactSummaryForover a sqlite-backed D1 returns a personal artifact, returnsnullfor unknown and other-tenant ids, and returnsnullfor six malformed ids with zero D1 calls.platformViewfails the personal-artifact test;