feat: attachmentsInForAI ParseOptions flag (spec §9.7) - #1
Merged
Conversation
Adds optional auto-inclusion of attachment extracted-text into content.forAI, per AECS-SDK-1 §9.6/§9.7: - ParseOptions gains attachmentsInForAI?: boolean and attachmentsForAIOptions?: AttachmentsForAIOptions. - New src/attachments.ts exports buildAttachmentContext(), the §9.6 aggregation (per-attachment + total char caps, include globs, custom wrapper/label, truncation markers). Self-contained — no @mvrx/mail import; L1 stays sovereign. - parse() appends the aggregated attachment context to content.forAI after the onAttachment handlers run (which is what populates each attachment's extractedText). - Exported via the new @mvrx/aecs/attachments subpath. Bumped to 0.2.0. 9 new tests; 12/12 pass; tsc clean. Signed-off-by: owenob1 <me@oweninnes.com>
owenob1
force-pushed
the
feat/attachments-forai
branch
from
July 6, 2026 16:49
c5a0234 to
d3ec892
Compare
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.
Implements AECS-SDK-1 §9.6/§9.7 in the reference parser.
What
ParseOptions.attachmentsInForAI?: boolean+attachmentsForAIOptions?: AttachmentsForAIOptions.parse()appends attachmentextractedTexttocontent.forAI(afteronAttachmenthandlers run).buildAttachmentContext()+@mvrx/aecs/attachmentssubpath — the §9.6 aggregation (char caps,includeglobs, custom wrapper/label, truncation markers).Layering
Self-contained in L1 (
@mvrx/aecs) — no@mvrx/mailimport.@mvrx/mail/attachmentsships its own publicattachmentsForAI()per the SDK spec's Appendix A; the two mirror the same §9.6 algorithm across the L1/L2 boundary.Verification
tsc --noEmitclean ·pnpm test12/12 (9 new) ·pnpm buildemitsdist/attachments.js.