Repository navigation
feat(hub-zero)!: T5a hub reads chat through native mail threads (CL-8147) - #756
Merged
Merged
Conversation
…ial-binding port types (CL-8147)
Three composition-root files imported PinnedPackageCredentialBindingsFor,
McpCredentialBindingsFor, PinnedToolGrantDeclaration, and ToolGrantsForPins
from @corbits/chat even though every one of those shapes names only native
@intx/types (CredentialBinding, GrantEffect, ToolPackagePin) with nothing
chat-specific in it. Declaring them locally in
pinned-package-credential-bindings.ts, mcp-credential-bindings.ts, and
tool-grants.ts cuts three of the hub's @corbits/chat call sites without
changing behavior — the functions they type are still structurally
assignable to createHubChatPlatform's deps.
Also drops the hub's error-handler test's InferenceResolutionError import:
hubErrorHandler matches by a duck-typed string .name, never instanceof, so
a small local fake with the same {name, guidance, message} shape verifies
the same mapping without needing the real chat-owned class. And rewords
two comments (mail-redelivery.ts, template-block-routes.ts) that named
@corbits/chat only in prose, not in an import.
Part of hub-zero T5a (CL-8147). Remaining @corbits/chat call sites in
apps/hub/src: index.ts's createHubChatPlatform/createChatRoutes mount and
mailbox-persist.ts's resolveWorkbenchIdForAgentFrame/ChatStore/
RoomMessageStore dual-write wiring — both hand off to T5c, since chat's
own workbench_settings/workbench_launch/room-message tables are still the
source of truth for "which workbench does this frame belong to" until
that slice deletes them.
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.
Summary
Slice 1 of 3 of CL-8129 (chat becomes native intx mail threads). Cuts three
of the hub's nine
@corbits/chatcall sites by giving the hub its own copyof the pin-port types, since none of them name anything chat-specific:
apps/hub/src/pinned-package-credential-bindings.ts— declaresPinnedPackageCredentialBindingsForlocally (native@intx/typesCredentialBinding+ToolPackagePinonly).apps/hub/src/mcp-credential-bindings.ts— declaresMcpCredentialBindingsForlocally (nativeCredentialBindingonly).apps/hub/src/tool-grants.ts— declaresPinnedToolGrantDeclaration/ToolGrantsForPinslocally (nativeGrantEffect+ToolPackagePinonly).
apps/hub/src/hub-error-handler.test.ts—hubErrorHandlermatchesInferenceResolutionErrorby a duck-typed string.name, neverinstanceof, so the test now throws a small local fake with the same{name, guidance, message}shape instead of importing the realchat-owned class.
apps/hub/src/mail-redelivery.tsandapps/hub/src/templates/template-block-routes.ts— reworded twocomments that named
@corbits/chatonly in prose, never in an import.All three port types are structurally identical to
@corbits/chat's ownexports, so they remain assignable wherever
createHubChatPlatformisstill wired up in
index.ts.T5c hand-off
rg "@corbits/chat|workbenchBelongsToTenant" apps/hub/srcis not yetempty. Two real dependencies remain, both load-bearing until a later
slice:
apps/hub/src/index.tsmountscreateHubChatPlatform/createChatRoutes/@corbits/chat/mailbox-fanout— this is the chatroute mount itself; removing it breaks the web app today. Its
workbenchBelongsToTenantadapter (line ~2018) closes overchatStore,which is only constructed because the mount needs it.
apps/hub/src/mailbox-persist.tsimportsresolveWorkbenchIdForAgentFrame,ChatStore, andRoomMessageStoretoresolve which workbench an outbound agent frame belongs to before
stamping the
resolveRefsseam ofcreateMailboxPersist(theCL-7445 dual-write). That resolution reads chat's own
workbench_settings/ room-message tables (findWorkbenchIdsByParticipantAddress,findByMailMessageId) — there is no native-only substitute until T5cdeletes those tables and chat becomes a pure mail projection.
Both are exactly the "leave the mount" case called out in this issue's
scope; removing either now would regress a still-live feature, not just
fail a grep.
Test plan
bun run --cwd apps/hub typecheckbun run lint(3 pre-existing unrelated errors inindex.ts,untouched by this PR)
bun run check:structuralbun test apps/hub/src/hub-error-handler.test.ts