Skip to content

feat: attachmentsInForAI ParseOptions flag (spec §9.7) - #1

Merged
owenob1 merged 1 commit into
mainfrom
feat/attachments-forai
Jul 6, 2026
Merged

feat: attachmentsInForAI ParseOptions flag (spec §9.7)#1
owenob1 merged 1 commit into
mainfrom
feat/attachments-forai

Conversation

@owenob1

@owenob1 owenob1 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Implements AECS-SDK-1 §9.6/§9.7 in the reference parser.

What

  • ParseOptions.attachmentsInForAI?: boolean + attachmentsForAIOptions?: AttachmentsForAIOptions.
  • parse() appends attachment extractedText to content.forAI (after onAttachment handlers run).
  • New buildAttachmentContext() + @mvrx/aecs/attachments subpath — the §9.6 aggregation (char caps, include globs, custom wrapper/label, truncation markers).
  • Version 0.1.0 → 0.2.0.

Layering

Self-contained in L1 (@mvrx/aecs) — no @mvrx/mail import. @mvrx/mail/attachments ships its own public attachmentsForAI() per the SDK spec's Appendix A; the two mirror the same §9.6 algorithm across the L1/L2 boundary.

Verification

tsc --noEmit clean · pnpm test 12/12 (9 new) · pnpm build emits dist/attachments.js.

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
owenob1 force-pushed the feat/attachments-forai branch from c5a0234 to d3ec892 Compare July 6, 2026 16:49
@owenob1
owenob1 merged commit 24efcb6 into main Jul 6, 2026
1 check passed
@owenob1
owenob1 deleted the feat/attachments-forai branch July 6, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant