Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions -scripts/render-mermaid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
#
# Re-renders all .mmd Mermaid sources to .svg in the on-premises images folder.
#
# Usage (from repo root):
# ./-scripts/render-mermaid.sh
#
# Requirements:
# Node.js (npx downloads @mermaid-js/mermaid-cli automatically)
#
set -euo pipefail

DIAGRAM_DIR="modules/ROOT/images/tinymceai-on-premises"
CONFIG_FILE=$(mktemp)

cat > "$CONFIG_FILE" << 'JSON'
{
"htmlLabels": false,
"flowchart": { "htmlLabels": false, "useMaxWidth": true },
"sequence": { "useMaxWidth": true },
"theme": "default"
}
JSON

trap 'rm -f "$CONFIG_FILE"' EXIT

count=0
for mmd in "$DIAGRAM_DIR"/*.mmd; do
[ -f "$mmd" ] || continue
svg="${mmd%.mmd}.svg"
name=$(basename "$mmd")
printf " Rendering %s\n" "$name"
npx -y @mermaid-js/mermaid-cli -i "$mmd" -o "$svg" \
-c "$CONFIG_FILE" --backgroundColor white 2>/dev/null

# Mermaid outputs width="100%" which has no intrinsic size in <img> tags.
# Replace with the actual pixel width from the viewBox so browsers can
# calculate the correct aspect ratio when the page scales the image.
vb_width=$(grep -o 'viewBox="[^"]*"' "$svg" | head -1 | awk -F'[ "]' '{print $4}')
if [ -n "$vb_width" ]; then
vb_int=$(printf "%.0f" "$vb_width")
perl -i -pe "s/width=\"100%\"/width=\"${vb_int}\"/" "$svg"
fi

count=$((count + 1))
done

printf "\nRendered %d diagrams in %s\n" "$count" "$DIAGRAM_DIR"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flowchart LR
Editor[TinyMCE editor] <-->|chat / quick actions| AI[AI Service]
AI -->|MCP tools/call| MCP[MCP Server<br>knowledge-hub]
MCP -->|read| KB[Confluence ·<br>Notion ·<br>GitBook ·<br>internal wiki]
Comment on lines +3 to +4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AI -->|MCP tools/call| MCP[MCP Server<br>knowledge-hub]
MCP -->|read| KB[Confluence ·<br>Notion ·<br>GitBook ·<br>internal wiki]
AI <-->|MCP tools/call| MCP[MCP Server<br>knowledge-hub]
MCP <-->|read| KB[Confluence ·<br>Notion ·<br>GitBook ·<br>internal wiki]

?

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
flowchart LR
subgraph Tenants[Your SaaS customers]
CA[Customer A users]
CB[Customer B users]
CC[Customer C users]
end
subgraph AISvc[Single AI service deployment]
EA[Environment A<br>access keys A<br>isolated conversations]
EB[Environment B<br>access keys B<br>isolated conversations]
EC[Environment C<br>access keys C<br>isolated conversations]
end
CA --> EA --> OpenAI[OpenAI]
CB --> EB --> Anthropic[Anthropic]
CC --> EC --> Azure[Azure OpenAI]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flowchart LR
Lawyer[TinyMCE editor<br>used by lawyer] <--> AI[AI Service]
AI -->|tools/call| MCP1[MCP: contract-db]
AI -->|tools/call| MCP2[MCP: compliance-checker]
AI -->|tools/call| MCP3[MCP: precedent-search]
MCP1 --> ContractDB[(Contract clause<br>repository)]
MCP2 --> ComplianceRules[(Regulatory<br>rule sets)]
MCP3 --> PrecedentIdx[(Precedent<br>search index)]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
flowchart TB
Browser["Browser<br>TinyMCE editor + tinymceai plugin"]
TokenEP["Your token endpoint<br>signs HS256 JWTs"]
Browser -->|"fetch JWT"| TokenEP
Browser -->|"HTTPS + Bearer JWT"| LB

subgraph App["Application layer (stateless, N replicas)"]
LB["Reverse proxy / Load balancer<br>nginx · ALB · K8s Ingress<br>TLS termination · SSE pass-through"]
AIN["ai-service replica N"]
AI2["ai-service replica 2"]
AI1["ai-service replica 1"]
LB --> AIN
LB --> AI2
LB --> AI1
end

subgraph Data["Shared data layer"]
DB[("SQL database<br>MySQL 8.0+ / PostgreSQL 13+")]
Cache[("Redis 3.2.6+")]
Storage[("File storage<br>S3 · Azure Blob · filesystem")]
end

AI1 --> Data

AI1 -->|"HTTPS"| LLM["LLM provider<br>OpenAI · Anthropic · Google ·<br>Azure · Bedrock · Vertex ·<br>self-hosted"]

AI1 -.->|"telemetry"| Obs["OpenTelemetry · Langfuse"]
AI1 -.->|"tool calls"| MCP["MCP servers"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading