29e68a7f87
## Integration status This is now the final landing PR for the reviewed editor/email architecture stack. | Order | Pull request | Scope | Status | | --- | --- | --- | --- | | 0 | #23657 | Advanced text editor capability presets | Merged into `main` | | 1 | **This PR** | Outbound email content compilation | Ready to land into `main` | | 2 | #23783 | Clean editor surface seam | Reviewed and merged into this branch | | 3 | #23790 | Shared editor block catalog | Reviewed and merged through #23783 | | 4 | #23791 | Canonical TipTap document persistence | Reviewed and merged through #23790 | The current branch tree contains the complete stack. Merging this PR lands all four follow-up layers. ## Architecture The stack establishes four reusable boundaries: 1. **Outbound compilation** — campaign, workflow, and one-to-one/tool email share one compiler, sanitizer policy, renderer, and plain-text derivation path. 2. **Editor surface profiles** — the generic editor owns rendering mechanics while each consuming surface declares chrome, extensions, and explicit compatibility readers. 3. **Shared block primitives** — sections, columns, HTML, images, buttons, and related commands live in the neutral advanced-editor catalog; email behavior is supplied by email schemas/rendering, not by relocating reusable blocks into an email editor. 4. **Canonical persistence** — Twenty-owned authoring persists complete, versioned TipTap JSON documents. HTML, Markdown, plain text, and BlockNote are projections or explicitly owned legacy boundaries. ## Compatibility boundaries Compatibility remains only where shipped data requires it: - workflow Send Email: versionless TipTap JSON, HTML, and plain text - inline email: HTML - AI instructions: Markdown - record rich text: BlockNote arrays and older Markdown/plain text Campaign is unshipped, so its editor, stored rows, sendability validation, and send-time compilation require the current canonical schema version. AI chat drafts are canonical-only local state; old or malformed drafts are rejected at hydration, and plain-text preprompts are converted at their entry point. ## Outbound compiler details The shared compiler owns: - strict structured email-document parsing - React-email rendering - one cached DOMPurify/JSDOM policy for structured and legacy HTML - plain-text derivation from sanitized HTML - single-pass structured-document binding resolution across text, variable tags, links, images, buttons, and raw HTML Resolved workflow values remain inert, legacy workflow and one-to-one HTML remain supported, and Campaign HTML/plain text come from the same compiled result. ## Verification - all automated standard/security reviews passed on the three merged upper PRs with no unresolved threads - shared TipTap/email codec tests: 20 passing - editor, AI draft, and workflow compatibility tests: 14 passing - campaign validation and compilation tests: 31 passing - full shared suite during development: 223 suites / 1,738 tests passing - twenty-front, twenty-shared, and twenty-server typechecks - changed-file type-aware lint and formatting checks
59 lines
2.8 KiB
TypeScript
59 lines
2.8 KiB
TypeScript
/*
|
|
* _____ _
|
|
*|_ _|_ _____ _ __ | |_ _ _
|
|
* | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
|
|
* | | \ V V / __/ | | | |_| |_| | Any edits to this will be overridden
|
|
* |_| \_/\_/ \___|_| |_|\__|\__, |
|
|
* |___/
|
|
*/
|
|
|
|
export { AI_SDK_PACKAGE_LABELS } from './constants/ai-sdk-package-labels.const';
|
|
export type { AiSdkPackage } from './constants/ai-sdk-packages.const';
|
|
export { AI_SDK_PACKAGES } from './constants/ai-sdk-packages.const';
|
|
export { ASK_QUESTIONS_TOOL_NAME } from './constants/ask-questions-tool-name.const';
|
|
export type { DataResidency } from './constants/data-residency.const';
|
|
export { DATA_RESIDENCY_KEYS } from './constants/data-residency.const';
|
|
export type { DatabaseCrudOperation } from './constants/database-crud-operation.const';
|
|
export { DATABASE_CRUD_OPERATIONS } from './constants/database-crud-operation.const';
|
|
export type { NativeAiSdkProviderId } from './constants/native-ai-sdk-provider-ids.const';
|
|
export { NATIVE_AI_SDK_PROVIDER_IDS } from './constants/native-ai-sdk-provider-ids.const';
|
|
export { ToolCategory } from './constants/tool-category.const';
|
|
export type {
|
|
AgentResponseFormatType,
|
|
AgentTextResponseFormat,
|
|
AgentJsonResponseFormat,
|
|
AgentResponseFormat,
|
|
} from './types/agent-response-format.type';
|
|
export type {
|
|
AgentResponseFieldType,
|
|
AgentResponseSchema,
|
|
} from './types/agent-response-schema.type';
|
|
export type { AgentChatSubscriptionEvent } from './types/AgentChatSubscriptionEvent';
|
|
export type { AskQuestionAnswer } from './types/AskQuestionAnswer';
|
|
export type { AskQuestionItem } from './types/AskQuestionItem';
|
|
export type { AskQuestionOption } from './types/AskQuestionOption';
|
|
export type { AskQuestionsToolInput } from './types/AskQuestionsToolInput';
|
|
export type { AskQuestionsToolResult } from './types/AskQuestionsToolResult';
|
|
export type { AskQuestionsToolStatus } from './types/AskQuestionsToolStatus';
|
|
export type {
|
|
CodeExecutionFile,
|
|
ExtendedFileUIPart,
|
|
CodeExecutionState,
|
|
CodeExecutionData,
|
|
DataMessagePart,
|
|
} from './types/DataMessagePart';
|
|
export { isExtendedFileUIPart } from './types/DataMessagePart';
|
|
export type {
|
|
AiChatUsageMetadata,
|
|
AiChatModelMetadata,
|
|
ExtendedUIMessage,
|
|
} from './types/ExtendedUIMessage';
|
|
export type { ExtendedUIMessagePart } from './types/ExtendedUIMessagePart';
|
|
export type { ModelConfiguration } from './types/model-configuration.type';
|
|
export type { NavigateAppToolOutput } from './types/NavigateAppToolOutput';
|
|
export { formatRecordReference } from './utils/format-record-reference.util';
|
|
export { inferAiSdkPackage } from './utils/infer-ai-sdk-package.util';
|
|
export { isAiSdkPackage } from './utils/is-ai-sdk-package.util';
|
|
export { isDataResidency } from './utils/is-data-residency.util';
|
|
export { isValidAgentResponseSchemaPropertyKey } from './utils/is-valid-agent-response-schema-property-key.util';
|