The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Viewing files at commit 1efaca5a5f5eCommit detailsView latest

scripts/generate-social-preview.mjs 48 lines · 2.8 KB · javascript
1
import { Buffer } from 'node:buffer';
2
import path from 'node:path';
3
import process from 'node:process';
4
import { fileURLToPath } from 'node:url';
5
6
import sharp from 'sharp';
7
8
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
const output = path.join(root, 'brand', 'openclasp-social-preview.png');
10
11
const svg = String.raw`<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="640" viewBox="0 0 1280 640">
12
  <defs>
13
    <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
14
      <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#2b2625" stroke-width="1"/>
15
    </pattern>
16
    <linearGradient id="fade" x1="0" y1="0" x2="1" y2="1">
17
      <stop offset="0" stop-color="#171313"/>
18
      <stop offset="1" stop-color="#0c0a0a"/>
19
    </linearGradient>
20
  </defs>
21
  <rect width="1280" height="640" fill="url(#fade)"/>
22
  <rect width="1280" height="640" fill="url(#grid)" opacity="0.55"/>
23
  <rect x="48" y="48" width="1184" height="544" fill="none" stroke="#3a302e"/>
24
  <rect x="48" y="48" width="8" height="112" fill="#f04b2d"/>
25
26
  <g transform="translate(90 82) scale(1.35)" fill="none" stroke="#f04b2d" stroke-width="5" stroke-linecap="round" stroke-linejoin="round">
27
    <path d="M28.2 10.3A22 22 0 0 0 28.2 53.7L38 47.2"/>
28
    <path d="M35.8 53.7A22 22 0 0 0 35.8 10.3L26 16.8"/>
29
  </g>
30
  <text x="190" y="134" fill="#f6f1ee" font-family="Arial, Helvetica, sans-serif" font-size="38" font-weight="700" letter-spacing="-1">openclasp</text>
31
  <text x="92" y="252" fill="#8d807d" font-family="monospace" font-size="20" letter-spacing="2">THE AI TRUST LAYER BETWEEN AGENTS</text>
32
  <text x="88" y="342" fill="#f6f1ee" font-family="Arial, Helvetica, sans-serif" font-size="64" font-weight="700" letter-spacing="-2">Agents can talk.</text>
33
  <text x="88" y="418" fill="#f04b2d" font-family="Arial, Helvetica, sans-serif" font-size="64" font-weight="700" font-style="italic" letter-spacing="-2">Now they can build trust.</text>
34
  <text x="92" y="506" fill="#b9adaa" font-family="monospace" font-size="19" letter-spacing="1">IDENTITY  /  AGREEMENTS  /  SAFEGUARDS  /  OUTCOMES</text>
35
  <text x="92" y="558" fill="#6f6462" font-family="monospace" font-size="17">openclasp.dev</text>
36
37
  <g transform="translate(1050 455)" fill="none" stroke-linecap="round">
38
    <circle cx="0" cy="0" r="42" stroke="#756866" stroke-width="2"/>
39
    <circle cx="104" cy="0" r="42" stroke="#756866" stroke-width="2"/>
40
    <path d="M42 0H62" stroke="#f04b2d" stroke-width="3"/>
41
    <path d="M62 0l-10-8m10 8l-10 8" stroke="#f04b2d" stroke-width="3"/>
42
    <circle cx="0" cy="0" r="8" fill="#f6f1ee" stroke="none"/>
43
    <circle cx="104" cy="0" r="8" fill="#f6f1ee" stroke="none"/>
44
  </g>
45
</svg>`;
46
47
await sharp(Buffer.from(svg)).png({ compressionLevel: 9 }).toFile(output);
48
process.stdout.write(`Wrote ${output}\n`);