pilothub 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -0
- package/README.md +36 -129
- package/dist/browserAuth.d.ts +20 -0
- package/dist/browserAuth.js +156 -0
- package/dist/browserAuth.js.map +1 -0
- package/dist/browserAuth.test.d.ts +1 -0
- package/dist/browserAuth.test.js +83 -0
- package/dist/browserAuth.test.js.map +1 -0
- package/dist/cli/buildInfo.d.ts +3 -0
- package/dist/cli/buildInfo.js +103 -0
- package/dist/cli/buildInfo.js.map +1 -0
- package/dist/cli/commands/auth.d.ts +9 -0
- package/dist/cli/commands/auth.js +75 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/delete.d.ts +11 -0
- package/dist/cli/commands/delete.js +67 -0
- package/dist/cli/commands/delete.js.map +1 -0
- package/dist/cli/commands/delete.test.d.ts +1 -0
- package/dist/cli/commands/delete.test.js +52 -0
- package/dist/cli/commands/delete.test.js.map +1 -0
- package/dist/cli/commands/publish.d.ts +9 -0
- package/dist/cli/commands/publish.js +87 -0
- package/dist/cli/commands/publish.js.map +1 -0
- package/dist/cli/commands/publish.test.d.ts +1 -0
- package/dist/cli/commands/publish.test.js +104 -0
- package/dist/cli/commands/publish.test.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +23 -0
- package/dist/cli/commands/skills.js +298 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/skills.test.d.ts +1 -0
- package/dist/cli/commands/skills.test.js +156 -0
- package/dist/cli/commands/skills.test.js.map +1 -0
- package/dist/cli/commands/star.d.ts +8 -0
- package/dist/cli/commands/star.js +38 -0
- package/dist/cli/commands/star.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +3 -0
- package/dist/cli/commands/sync.js +160 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/sync.test.d.ts +1 -0
- package/dist/cli/commands/sync.test.js +277 -0
- package/dist/cli/commands/sync.test.js.map +1 -0
- package/dist/cli/commands/syncHelpers.d.ts +76 -0
- package/dist/cli/commands/syncHelpers.js +349 -0
- package/dist/cli/commands/syncHelpers.js.map +1 -0
- package/dist/cli/commands/syncHelpers.test.d.ts +1 -0
- package/dist/cli/commands/syncHelpers.test.js +22 -0
- package/dist/cli/commands/syncHelpers.test.js.map +1 -0
- package/dist/cli/commands/syncTypes.d.ts +24 -0
- package/dist/cli/commands/syncTypes.js +2 -0
- package/dist/cli/commands/syncTypes.js.map +1 -0
- package/dist/cli/commands/unstar.d.ts +8 -0
- package/dist/cli/commands/unstar.js +38 -0
- package/dist/cli/commands/unstar.js.map +1 -0
- package/dist/cli/helpStyle.d.ts +13 -0
- package/dist/cli/helpStyle.js +38 -0
- package/dist/cli/helpStyle.js.map +1 -0
- package/dist/cli/pilotbotConfig.d.ts +6 -0
- package/dist/cli/pilotbotConfig.js +110 -0
- package/dist/cli/pilotbotConfig.js.map +1 -0
- package/dist/cli/pilotbotConfig.test.d.ts +1 -0
- package/dist/cli/pilotbotConfig.test.js +133 -0
- package/dist/cli/pilotbotConfig.test.js.map +1 -0
- package/dist/cli/registry.d.ts +7 -0
- package/dist/cli/registry.js +42 -0
- package/dist/cli/registry.js.map +1 -0
- package/dist/cli/registry.test.d.ts +1 -0
- package/dist/cli/registry.test.js +48 -0
- package/dist/cli/registry.test.js.map +1 -0
- package/dist/cli/scanSkills.d.ts +7 -0
- package/dist/cli/scanSkills.js +75 -0
- package/dist/cli/scanSkills.js.map +1 -0
- package/dist/cli/scanSkills.test.d.ts +1 -0
- package/dist/cli/scanSkills.test.js +60 -0
- package/dist/cli/scanSkills.test.js.map +1 -0
- package/dist/cli/slug.d.ts +2 -0
- package/dist/cli/slug.js +16 -0
- package/dist/cli/slug.js.map +1 -0
- package/dist/cli/types.d.ts +15 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/ui.d.ts +7 -0
- package/dist/cli/ui.js +72 -0
- package/dist/cli/ui.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +268 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +38 -0
- package/dist/config.js.map +1 -0
- package/dist/discovery.d.ts +5 -0
- package/dist/discovery.js +21 -0
- package/dist/discovery.js.map +1 -0
- package/dist/discovery.test.d.ts +1 -0
- package/dist/discovery.test.js +46 -0
- package/dist/discovery.test.js.map +1 -0
- package/dist/http.d.ts +32 -0
- package/dist/http.js +261 -0
- package/dist/http.js.map +1 -0
- package/dist/http.test.d.ts +1 -0
- package/dist/http.test.js +135 -0
- package/dist/http.test.js.map +1 -0
- package/dist/schema/ark.js.map +1 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/routes.js.map +1 -0
- package/{packages/schema/dist → dist/schema}/schemas.d.ts +0 -39
- package/{packages/schema/dist → dist/schema}/schemas.js +0 -22
- package/dist/schema/schemas.js.map +1 -0
- package/dist/schema/textFiles.js.map +1 -0
- package/dist/schema/textFiles.test.d.ts +1 -0
- package/dist/schema/textFiles.test.js +20 -0
- package/dist/schema/textFiles.test.js.map +1 -0
- package/dist/skills.d.ts +43 -0
- package/dist/skills.js +163 -0
- package/dist/skills.js.map +1 -0
- package/dist/skills.test.d.ts +1 -0
- package/dist/skills.test.js +144 -0
- package/dist/skills.test.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +27 -70
- package/.env.local.example +0 -19
- package/.github/workflows/ci.yml +0 -40
- package/.oxlintrc.json +0 -3
- package/AGENTS.md +0 -45
- package/CHANGELOG.md +0 -138
- package/DEPRECATIONS.md +0 -7
- package/biome.json +0 -41
- package/convex/_generated/api.d.ts +0 -153
- package/convex/_generated/api.js +0 -23
- package/convex/_generated/dataModel.d.ts +0 -60
- package/convex/_generated/server.d.ts +0 -143
- package/convex/_generated/server.js +0 -93
- package/convex/auth.config.ts +0 -8
- package/convex/auth.ts +0 -19
- package/convex/comments.ts +0 -88
- package/convex/crons.ts +0 -34
- package/convex/devSeed.ts +0 -459
- package/convex/devSeedExtra.ts +0 -541
- package/convex/downloads.ts +0 -78
- package/convex/githubBackups.ts +0 -170
- package/convex/githubBackupsNode.ts +0 -183
- package/convex/githubImport.ts +0 -317
- package/convex/githubSoulBackups.ts +0 -170
- package/convex/githubSoulBackupsNode.ts +0 -186
- package/convex/http.ts +0 -194
- package/convex/httpApi.handlers.test.ts +0 -488
- package/convex/httpApi.test.ts +0 -70
- package/convex/httpApi.ts +0 -305
- package/convex/httpApiV1.handlers.test.ts +0 -584
- package/convex/httpApiV1.ts +0 -1172
- package/convex/leaderboards.ts +0 -39
- package/convex/lib/access.ts +0 -36
- package/convex/lib/apiTokenAuth.ts +0 -36
- package/convex/lib/badges.ts +0 -50
- package/convex/lib/changelog.test.ts +0 -34
- package/convex/lib/changelog.ts +0 -278
- package/convex/lib/embeddings.ts +0 -38
- package/convex/lib/githubBackup.ts +0 -443
- package/convex/lib/githubImport.test.ts +0 -247
- package/convex/lib/githubImport.ts +0 -425
- package/convex/lib/githubSoulBackup.ts +0 -443
- package/convex/lib/leaderboards.ts +0 -103
- package/convex/lib/moderation.ts +0 -42
- package/convex/lib/public.ts +0 -89
- package/convex/lib/searchText.test.ts +0 -46
- package/convex/lib/searchText.ts +0 -27
- package/convex/lib/skillBackfill.test.ts +0 -34
- package/convex/lib/skillBackfill.ts +0 -67
- package/convex/lib/skillPublish.test.ts +0 -28
- package/convex/lib/skillPublish.ts +0 -284
- package/convex/lib/skillStats.ts +0 -80
- package/convex/lib/skills.test.ts +0 -197
- package/convex/lib/skills.ts +0 -273
- package/convex/lib/soulChangelog.ts +0 -273
- package/convex/lib/soulPublish.ts +0 -236
- package/convex/lib/tokens.test.ts +0 -33
- package/convex/lib/tokens.ts +0 -51
- package/convex/lib/webhooks.test.ts +0 -91
- package/convex/lib/webhooks.ts +0 -112
- package/convex/maintenance.test.ts +0 -270
- package/convex/maintenance.ts +0 -840
- package/convex/rateLimits.ts +0 -50
- package/convex/schema.ts +0 -472
- package/convex/search.test.ts +0 -12
- package/convex/search.ts +0 -254
- package/convex/seed.test.ts +0 -37
- package/convex/seed.ts +0 -254
- package/convex/seedSouls.ts +0 -111
- package/convex/skillStatEvents.ts +0 -568
- package/convex/skills.ts +0 -1606
- package/convex/soulComments.ts +0 -88
- package/convex/soulDownloads.ts +0 -14
- package/convex/soulStars.ts +0 -71
- package/convex/souls.ts +0 -570
- package/convex/stars.ts +0 -108
- package/convex/statsMaintenance.ts +0 -205
- package/convex/telemetry.ts +0 -434
- package/convex/tokens.ts +0 -88
- package/convex/tsconfig.json +0 -7
- package/convex/uploads.ts +0 -20
- package/convex/users.ts +0 -122
- package/convex/webhooks.ts +0 -50
- package/convex.json +0 -3
- package/docs/README.md +0 -32
- package/docs/api.md +0 -51
- package/docs/architecture.md +0 -61
- package/docs/auth.md +0 -54
- package/docs/cli.md +0 -117
- package/docs/deploy.md +0 -78
- package/docs/diffing.md +0 -84
- package/docs/github-import.md +0 -171
- package/docs/http-api.md +0 -187
- package/docs/manual-testing.md +0 -64
- package/docs/mintlify.md +0 -43
- package/docs/quickstart.md +0 -120
- package/docs/skill-format.md +0 -58
- package/docs/soul-format.md +0 -37
- package/docs/spec.md +0 -177
- package/docs/telemetry.md +0 -91
- package/docs/troubleshooting.md +0 -49
- package/docs/webhook.md +0 -51
- package/e2e/menu-smoke.pw.test.ts +0 -49
- package/e2e/pilothub.e2e.test.ts +0 -494
- package/e2e/search-exact.pw.test.ts +0 -97
- package/packages/pilothub/LICENSE +0 -22
- package/packages/pilothub/README.md +0 -57
- package/packages/pilothub/package.json +0 -41
- package/packages/pilothub/src/browserAuth.test.ts +0 -96
- package/packages/pilothub/src/browserAuth.ts +0 -174
- package/packages/pilothub/src/cli/buildInfo.ts +0 -94
- package/packages/pilothub/src/cli/commands/auth.ts +0 -97
- package/packages/pilothub/src/cli/commands/delete.test.ts +0 -73
- package/packages/pilothub/src/cli/commands/delete.ts +0 -83
- package/packages/pilothub/src/cli/commands/publish.test.ts +0 -122
- package/packages/pilothub/src/cli/commands/publish.ts +0 -108
- package/packages/pilothub/src/cli/commands/skills.test.ts +0 -191
- package/packages/pilothub/src/cli/commands/skills.ts +0 -380
- package/packages/pilothub/src/cli/commands/star.ts +0 -46
- package/packages/pilothub/src/cli/commands/sync.test.ts +0 -310
- package/packages/pilothub/src/cli/commands/sync.ts +0 -200
- package/packages/pilothub/src/cli/commands/syncHelpers.test.ts +0 -26
- package/packages/pilothub/src/cli/commands/syncHelpers.ts +0 -427
- package/packages/pilothub/src/cli/commands/syncTypes.ts +0 -27
- package/packages/pilothub/src/cli/commands/unstar.ts +0 -48
- package/packages/pilothub/src/cli/helpStyle.ts +0 -45
- package/packages/pilothub/src/cli/pilotbotConfig.test.ts +0 -159
- package/packages/pilothub/src/cli/pilotbotConfig.ts +0 -147
- package/packages/pilothub/src/cli/registry.test.ts +0 -63
- package/packages/pilothub/src/cli/registry.ts +0 -43
- package/packages/pilothub/src/cli/scanSkills.test.ts +0 -64
- package/packages/pilothub/src/cli/scanSkills.ts +0 -84
- package/packages/pilothub/src/cli/slug.ts +0 -16
- package/packages/pilothub/src/cli/types.ts +0 -12
- package/packages/pilothub/src/cli/ui.ts +0 -75
- package/packages/pilothub/src/cli.ts +0 -311
- package/packages/pilothub/src/config.ts +0 -36
- package/packages/pilothub/src/discovery.test.ts +0 -75
- package/packages/pilothub/src/discovery.ts +0 -19
- package/packages/pilothub/src/http.test.ts +0 -156
- package/packages/pilothub/src/http.ts +0 -301
- package/packages/pilothub/src/schema/ark.ts +0 -29
- package/packages/pilothub/src/schema/index.ts +0 -5
- package/packages/pilothub/src/schema/routes.ts +0 -22
- package/packages/pilothub/src/schema/schemas.ts +0 -260
- package/packages/pilothub/src/schema/textFiles.test.ts +0 -23
- package/packages/pilothub/src/schema/textFiles.ts +0 -66
- package/packages/pilothub/src/skills.test.ts +0 -191
- package/packages/pilothub/src/skills.ts +0 -172
- package/packages/pilothub/src/types.ts +0 -10
- package/packages/pilothub/tsconfig.json +0 -14
- package/packages/schema/README.md +0 -3
- package/packages/schema/dist/ark.js.map +0 -1
- package/packages/schema/dist/index.js.map +0 -1
- package/packages/schema/dist/routes.js.map +0 -1
- package/packages/schema/dist/schemas.js.map +0 -1
- package/packages/schema/dist/textFiles.js.map +0 -1
- package/packages/schema/package.json +0 -26
- package/packages/schema/src/ark.ts +0 -29
- package/packages/schema/src/index.ts +0 -5
- package/packages/schema/src/routes.ts +0 -22
- package/packages/schema/src/schemas.test.ts +0 -123
- package/packages/schema/src/schemas.ts +0 -287
- package/packages/schema/src/textFiles.test.ts +0 -23
- package/packages/schema/src/textFiles.ts +0 -66
- package/packages/schema/tsconfig.json +0 -15
- package/pilothub +0 -46
- package/playwright.config.ts +0 -33
- package/public/.well-known/pilothub.json +0 -6
- package/public/api/v1/openapi.json +0 -379
- package/public/favicon.ico +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/og.png +0 -0
- package/public/og.svg +0 -98
- package/public/pilot-logo.png +0 -0
- package/public/pilot-mark.png +0 -0
- package/public/robots.txt +0 -3
- package/public/tanstack-circle-logo.png +0 -0
- package/public/tanstack-word-logo-white.svg +0 -1
- package/scripts/check-peer-deps.ts +0 -56
- package/scripts/docs-list.ts +0 -148
- package/scripts/run-playwright-local.sh +0 -14
- package/server/og/fetchSkillOgMeta.ts +0 -27
- package/server/og/fetchSoulOgMeta.ts +0 -27
- package/server/og/ogAssets.ts +0 -80
- package/server/og/skillOgSvg.test.ts +0 -59
- package/server/og/skillOgSvg.ts +0 -258
- package/server/og/soulOgSvg.ts +0 -209
- package/server/routes/og/skill.png.ts +0 -103
- package/server/routes/og/soul.png.ts +0 -111
- package/src/__tests__/skill-detail-page.test.tsx +0 -86
- package/src/__tests__/skills-index.test.tsx +0 -145
- package/src/__tests__/upload.route.test.tsx +0 -228
- package/src/components/AppProviders.tsx +0 -19
- package/src/components/ClientOnly.tsx +0 -18
- package/src/components/Footer.tsx +0 -29
- package/src/components/Header.tsx +0 -295
- package/src/components/InstallSwitcher.tsx +0 -53
- package/src/components/SkillCard.tsx +0 -36
- package/src/components/SkillDetailPage.tsx +0 -817
- package/src/components/SkillDiffCard.tsx +0 -485
- package/src/components/SoulCard.tsx +0 -19
- package/src/components/SoulDetailPage.tsx +0 -263
- package/src/components/UserBootstrap.tsx +0 -18
- package/src/components/ui/dropdown-menu.tsx +0 -67
- package/src/components/ui/toggle-group.tsx +0 -35
- package/src/convex/client.ts +0 -3
- package/src/lib/badges.ts +0 -29
- package/src/lib/diffing.test.ts +0 -163
- package/src/lib/diffing.ts +0 -106
- package/src/lib/gravatar.test.ts +0 -9
- package/src/lib/gravatar.ts +0 -158
- package/src/lib/og.test.ts +0 -142
- package/src/lib/og.ts +0 -156
- package/src/lib/publicUser.ts +0 -39
- package/src/lib/roles.ts +0 -19
- package/src/lib/site.test.ts +0 -130
- package/src/lib/site.ts +0 -84
- package/src/lib/theme-transition.test.ts +0 -134
- package/src/lib/theme-transition.ts +0 -134
- package/src/lib/theme.test.tsx +0 -88
- package/src/lib/theme.ts +0 -43
- package/src/lib/uploadFiles.jsdom.test.ts +0 -33
- package/src/lib/uploadFiles.test.ts +0 -123
- package/src/lib/uploadFiles.ts +0 -245
- package/src/lib/uploadUtils.test.ts +0 -78
- package/src/lib/uploadUtils.ts +0 -93
- package/src/lib/useAuthStatus.ts +0 -12
- package/src/lib/utils.test.ts +0 -9
- package/src/lib/utils.ts +0 -6
- package/src/logo.svg +0 -12
- package/src/routeTree.gen.ts +0 -345
- package/src/router.tsx +0 -17
- package/src/routes/$owner/$slug.tsx +0 -55
- package/src/routes/__root.tsx +0 -136
- package/src/routes/admin.tsx +0 -11
- package/src/routes/cli/auth.tsx +0 -168
- package/src/routes/dashboard.tsx +0 -97
- package/src/routes/import.tsx +0 -415
- package/src/routes/index.tsx +0 -252
- package/src/routes/management.tsx +0 -529
- package/src/routes/settings.tsx +0 -203
- package/src/routes/skills/index.tsx +0 -422
- package/src/routes/souls/$slug.tsx +0 -55
- package/src/routes/souls/index.tsx +0 -243
- package/src/routes/stars.tsx +0 -68
- package/src/routes/u/$handle.tsx +0 -307
- package/src/routes/upload/utils.ts +0 -81
- package/src/routes/upload.tsx +0 -499
- package/src/styles.css +0 -2718
- package/tsconfig.json +0 -24
- package/tsconfig.oxlint.json +0 -16
- package/vercel.json +0 -8
- package/vite.config.ts +0 -48
- package/vitest.config.ts +0 -47
- package/vitest.e2e.config.ts +0 -11
- package/vitest.setup.ts +0 -1
- /package/{packages/pilothub/bin → bin}/pilothub.js +0 -0
- /package/{packages/schema/dist → dist/schema}/ark.d.ts +0 -0
- /package/{packages/schema/dist → dist/schema}/ark.js +0 -0
- /package/{packages/schema/dist → dist/schema}/index.d.ts +0 -0
- /package/{packages/schema/dist → dist/schema}/index.js +0 -0
- /package/{packages/schema/dist → dist/schema}/routes.d.ts +0 -0
- /package/{packages/schema/dist → dist/schema}/routes.js +0 -0
- /package/{packages/schema/dist → dist/schema}/textFiles.d.ts +0 -0
- /package/{packages/schema/dist → dist/schema}/textFiles.js +0 -0
package/scripts/docs-list.ts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
4
|
-
import { dirname, join, relative } from 'node:path'
|
|
5
|
-
import { fileURLToPath } from 'node:url'
|
|
6
|
-
|
|
7
|
-
const DOCS_DIR = resolveDocsDir()
|
|
8
|
-
|
|
9
|
-
const EXCLUDED_DIRS = new Set(['archive', 'research'])
|
|
10
|
-
|
|
11
|
-
function resolveDocsDir() {
|
|
12
|
-
const env = process.env.DOCS_DIR?.trim()
|
|
13
|
-
if (env) return env
|
|
14
|
-
|
|
15
|
-
const fromCwd = join(process.cwd(), 'docs')
|
|
16
|
-
if (existsSync(fromCwd)) return fromCwd
|
|
17
|
-
|
|
18
|
-
const docsListFile = fileURLToPath(import.meta.url)
|
|
19
|
-
const docsListDir = dirname(docsListFile)
|
|
20
|
-
return join(docsListDir, '..', 'docs')
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function compactStrings(values: unknown[]): string[] {
|
|
24
|
-
const result: string[] = []
|
|
25
|
-
for (const value of values) {
|
|
26
|
-
if (value === null || value === undefined) continue
|
|
27
|
-
const normalized = String(value).trim()
|
|
28
|
-
if (normalized.length > 0) result.push(normalized)
|
|
29
|
-
}
|
|
30
|
-
return result
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function walkMarkdownFiles(dir: string, base: string = dir): string[] {
|
|
34
|
-
const entries = readdirSync(dir, { withFileTypes: true })
|
|
35
|
-
const files: string[] = []
|
|
36
|
-
for (const entry of entries) {
|
|
37
|
-
if (entry.name.startsWith('.')) continue
|
|
38
|
-
const fullPath = join(dir, entry.name)
|
|
39
|
-
if (entry.isDirectory()) {
|
|
40
|
-
if (EXCLUDED_DIRS.has(entry.name)) continue
|
|
41
|
-
files.push(...walkMarkdownFiles(fullPath, base))
|
|
42
|
-
continue
|
|
43
|
-
}
|
|
44
|
-
if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
45
|
-
files.push(relative(base, fullPath))
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return files.sort((a, b) => a.localeCompare(b))
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function extractMetadata(fullPath: string): {
|
|
52
|
-
summary: string | null
|
|
53
|
-
readWhen: string[]
|
|
54
|
-
error?: string
|
|
55
|
-
} {
|
|
56
|
-
const content = readFileSync(fullPath, 'utf8')
|
|
57
|
-
|
|
58
|
-
if (!content.startsWith('---')) {
|
|
59
|
-
return { summary: null, readWhen: [], error: 'missing front matter' }
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const endIndex = content.indexOf('\n---', 3)
|
|
63
|
-
if (endIndex === -1) {
|
|
64
|
-
return { summary: null, readWhen: [], error: 'unterminated front matter' }
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const frontMatter = content.slice(3, endIndex).trim()
|
|
68
|
-
const lines = frontMatter.split('\n')
|
|
69
|
-
|
|
70
|
-
let summaryLine: string | null = null
|
|
71
|
-
const readWhen: string[] = []
|
|
72
|
-
let collectingField: 'read_when' | null = null
|
|
73
|
-
|
|
74
|
-
for (const rawLine of lines) {
|
|
75
|
-
const line = rawLine.trim()
|
|
76
|
-
|
|
77
|
-
if (line.startsWith('summary:')) {
|
|
78
|
-
summaryLine = line
|
|
79
|
-
collectingField = null
|
|
80
|
-
continue
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (line.startsWith('read_when:')) {
|
|
84
|
-
collectingField = 'read_when'
|
|
85
|
-
const inline = line.slice('read_when:'.length).trim()
|
|
86
|
-
if (inline.startsWith('[') && inline.endsWith(']')) {
|
|
87
|
-
try {
|
|
88
|
-
const parsed = JSON.parse(inline.replace(/'/g, '"')) as unknown
|
|
89
|
-
if (Array.isArray(parsed)) {
|
|
90
|
-
readWhen.push(...compactStrings(parsed))
|
|
91
|
-
}
|
|
92
|
-
} catch {
|
|
93
|
-
// ignore malformed inline arrays
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
continue
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (collectingField === 'read_when') {
|
|
100
|
-
if (line.startsWith('- ')) {
|
|
101
|
-
const hint = line.slice(2).trim()
|
|
102
|
-
if (hint) readWhen.push(hint)
|
|
103
|
-
} else if (line === '') {
|
|
104
|
-
// ignore
|
|
105
|
-
} else {
|
|
106
|
-
collectingField = null
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (!summaryLine) {
|
|
112
|
-
return { summary: null, readWhen, error: 'summary key missing' }
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const summaryValue = summaryLine.slice('summary:'.length).trim()
|
|
116
|
-
const normalized = summaryValue
|
|
117
|
-
.replace(/^['"]|['"]$/g, '')
|
|
118
|
-
.replace(/\s+/g, ' ')
|
|
119
|
-
.trim()
|
|
120
|
-
|
|
121
|
-
if (!normalized) {
|
|
122
|
-
return { summary: null, readWhen, error: 'summary is empty' }
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return { summary: normalized, readWhen }
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
console.log('Listing all markdown files in docs folder:')
|
|
129
|
-
|
|
130
|
-
const markdownFiles = walkMarkdownFiles(DOCS_DIR)
|
|
131
|
-
|
|
132
|
-
for (const relativePath of markdownFiles) {
|
|
133
|
-
const fullPath = join(DOCS_DIR, relativePath)
|
|
134
|
-
const { summary, readWhen, error } = extractMetadata(fullPath)
|
|
135
|
-
if (summary) {
|
|
136
|
-
console.log(`${relativePath} - ${summary}`)
|
|
137
|
-
if (readWhen.length > 0) {
|
|
138
|
-
console.log(` Read when: ${readWhen.join('; ')}`)
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
141
|
-
const reason = error ? ` - [${error}]` : ''
|
|
142
|
-
console.log(`${relativePath}${reason}`)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
console.log(
|
|
147
|
-
'\nReminder: keep docs up to date as behavior changes. When your task matches any "Read when" hint above, read that doc before coding, and suggest new coverage when it is missing.',
|
|
148
|
-
)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
PORT="${PLAYWRIGHT_PORT:-4173}"
|
|
5
|
-
|
|
6
|
-
if [[ -n "${PLAYWRIGHT_BASE_URL:-}" ]]; then
|
|
7
|
-
echo "Running against $PLAYWRIGHT_BASE_URL"
|
|
8
|
-
bun run test:pw
|
|
9
|
-
exit 0
|
|
10
|
-
fi
|
|
11
|
-
|
|
12
|
-
echo "Running against local preview server on http://127.0.0.1:$PORT"
|
|
13
|
-
bun run build
|
|
14
|
-
PLAYWRIGHT_PORT="$PORT" bun run test:pw
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type SkillOgMeta = {
|
|
2
|
-
displayName: string | null
|
|
3
|
-
summary: string | null
|
|
4
|
-
owner: string | null
|
|
5
|
-
version: string | null
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export async function fetchSkillOgMeta(slug: string, apiBase: string): Promise<SkillOgMeta | null> {
|
|
9
|
-
try {
|
|
10
|
-
const url = new URL(`/api/v1/skills/${encodeURIComponent(slug)}`, apiBase)
|
|
11
|
-
const response = await fetch(url.toString(), { headers: { Accept: 'application/json' } })
|
|
12
|
-
if (!response.ok) return null
|
|
13
|
-
const payload = (await response.json()) as {
|
|
14
|
-
skill?: { displayName?: string; summary?: string | null } | null
|
|
15
|
-
owner?: { handle?: string | null } | null
|
|
16
|
-
latestVersion?: { version?: string | null } | null
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
displayName: payload.skill?.displayName ?? null,
|
|
20
|
-
summary: payload.skill?.summary ?? null,
|
|
21
|
-
owner: payload.owner?.handle ?? null,
|
|
22
|
-
version: payload.latestVersion?.version ?? null,
|
|
23
|
-
}
|
|
24
|
-
} catch {
|
|
25
|
-
return null
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type SoulOgMeta = {
|
|
2
|
-
displayName: string | null
|
|
3
|
-
summary: string | null
|
|
4
|
-
owner: string | null
|
|
5
|
-
version: string | null
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export async function fetchSoulOgMeta(slug: string, apiBase: string): Promise<SoulOgMeta | null> {
|
|
9
|
-
try {
|
|
10
|
-
const url = new URL(`/api/v1/souls/${encodeURIComponent(slug)}`, apiBase)
|
|
11
|
-
const response = await fetch(url.toString(), { headers: { Accept: 'application/json' } })
|
|
12
|
-
if (!response.ok) return null
|
|
13
|
-
const payload = (await response.json()) as {
|
|
14
|
-
soul?: { displayName?: string; summary?: string | null } | null
|
|
15
|
-
owner?: { handle?: string | null } | null
|
|
16
|
-
latestVersion?: { version?: string | null } | null
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
displayName: payload.soul?.displayName ?? null,
|
|
20
|
-
summary: payload.soul?.summary ?? null,
|
|
21
|
-
owner: payload.owner?.handle ?? null,
|
|
22
|
-
version: payload.latestVersion?.version ?? null,
|
|
23
|
-
}
|
|
24
|
-
} catch {
|
|
25
|
-
return null
|
|
26
|
-
}
|
|
27
|
-
}
|
package/server/og/ogAssets.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises'
|
|
2
|
-
import { pathToFileURL } from 'node:url'
|
|
3
|
-
|
|
4
|
-
export const FONT_SANS = 'Bricolage Grotesque'
|
|
5
|
-
export const FONT_MONO = 'IBM Plex Mono'
|
|
6
|
-
|
|
7
|
-
type GlobalNitroMain = {
|
|
8
|
-
__nitro_main__?: unknown
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let markDataUrlPromise: Promise<string> | null = null
|
|
12
|
-
let resvgWasmPromise: Promise<Uint8Array> | null = null
|
|
13
|
-
let fontBuffersPromise: Promise<Uint8Array[]> | null = null
|
|
14
|
-
|
|
15
|
-
function getServerRootUrl() {
|
|
16
|
-
const nitroMain = (globalThis as unknown as GlobalNitroMain).__nitro_main__
|
|
17
|
-
if (typeof nitroMain === 'string') {
|
|
18
|
-
try {
|
|
19
|
-
return new URL('./', nitroMain)
|
|
20
|
-
} catch {
|
|
21
|
-
// fall through
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return pathToFileURL(`${process.cwd()}/`)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function getServerUrl(pathname: string) {
|
|
28
|
-
return new URL(pathname.replace(/^\//, ''), getServerRootUrl())
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export async function getMarkDataUrl() {
|
|
32
|
-
if (!markDataUrlPromise) {
|
|
33
|
-
markDataUrlPromise = (async () => {
|
|
34
|
-
const candidates = [getServerUrl('pilot-mark.png'), getServerUrl('public/pilot-mark.png')]
|
|
35
|
-
let lastError: unknown = null
|
|
36
|
-
for (const url of candidates) {
|
|
37
|
-
try {
|
|
38
|
-
const buffer = await readFile(url)
|
|
39
|
-
return `data:image/png;base64,${buffer.toString('base64')}`
|
|
40
|
-
} catch (error) {
|
|
41
|
-
lastError = error
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
throw lastError
|
|
45
|
-
})()
|
|
46
|
-
}
|
|
47
|
-
return markDataUrlPromise
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export async function getResvgWasm() {
|
|
51
|
-
if (!resvgWasmPromise) {
|
|
52
|
-
resvgWasmPromise = readFile(getServerUrl('node_modules/@resvg/resvg-wasm/index_bg.wasm')).then(
|
|
53
|
-
(buffer) => new Uint8Array(buffer),
|
|
54
|
-
)
|
|
55
|
-
}
|
|
56
|
-
return resvgWasmPromise
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export async function getFontBuffers() {
|
|
60
|
-
if (!fontBuffersPromise) {
|
|
61
|
-
fontBuffersPromise = Promise.all([
|
|
62
|
-
readFile(
|
|
63
|
-
getServerUrl(
|
|
64
|
-
'node_modules/@fontsource/bricolage-grotesque/files/bricolage-grotesque-latin-800-normal.woff2',
|
|
65
|
-
),
|
|
66
|
-
),
|
|
67
|
-
readFile(
|
|
68
|
-
getServerUrl(
|
|
69
|
-
'node_modules/@fontsource/bricolage-grotesque/files/bricolage-grotesque-latin-500-normal.woff2',
|
|
70
|
-
),
|
|
71
|
-
),
|
|
72
|
-
readFile(
|
|
73
|
-
getServerUrl(
|
|
74
|
-
'node_modules/@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-500-normal.woff2',
|
|
75
|
-
),
|
|
76
|
-
),
|
|
77
|
-
]).then((buffers) => buffers.map((buffer) => new Uint8Array(buffer)))
|
|
78
|
-
}
|
|
79
|
-
return fontBuffersPromise
|
|
80
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { buildSkillOgSvg } from './skillOgSvg'
|
|
3
|
-
|
|
4
|
-
describe('skill OG SVG', () => {
|
|
5
|
-
it('includes title, description, and labels', () => {
|
|
6
|
-
const svg = buildSkillOgSvg({
|
|
7
|
-
markDataUrl: 'data:image/png;base64,AAA=',
|
|
8
|
-
title: 'Discord Doctor',
|
|
9
|
-
description: 'Quick diagnosis and repair for Discord bot.',
|
|
10
|
-
ownerLabel: '@jhillock',
|
|
11
|
-
versionLabel: 'v1.2.3',
|
|
12
|
-
footer: 'pilothub.com/jhillock/discord-doctor',
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
expect(svg).toContain('Discord Doctor')
|
|
16
|
-
expect(svg).toContain('Quick diagnosis and repair')
|
|
17
|
-
expect(svg).toContain('@jhillock')
|
|
18
|
-
expect(svg).toContain('v1.2.3')
|
|
19
|
-
expect(svg).toContain('pilothub.com/jhillock/discord-doctor')
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('wraps long titles to avoid clipping', () => {
|
|
23
|
-
const svg = buildSkillOgSvg({
|
|
24
|
-
markDataUrl: 'data:image/png;base64,AAA=',
|
|
25
|
-
title: 'Excalidraw Flowchart',
|
|
26
|
-
description: 'Create Excalidraw flowcharts from descriptions.',
|
|
27
|
-
ownerLabel: '@swiftlysisngh',
|
|
28
|
-
versionLabel: 'v1.0.2',
|
|
29
|
-
footer: 'pilothub.com/swiftlysisngh/excalidraw-flowchart',
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const titleBlock = svg.match(/<text[^>]*font-weight="800"[\s\S]*?<\/text>/)?.[0] ?? ''
|
|
33
|
-
const titleTspans = titleBlock.match(/<tspan /g) ?? []
|
|
34
|
-
expect(titleTspans.length).toBe(2)
|
|
35
|
-
expect(svg).toContain('Excalidraw')
|
|
36
|
-
expect(svg).toContain('Flowchart')
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
it('clips and wraps long descriptions', () => {
|
|
40
|
-
const longWord = 'a'.repeat(200)
|
|
41
|
-
const svg = buildSkillOgSvg({
|
|
42
|
-
markDataUrl: 'data:image/png;base64,AAA=',
|
|
43
|
-
title: 'Gurkerlcli',
|
|
44
|
-
description: `Prefix ${longWord} suffix`,
|
|
45
|
-
ownerLabel: '@pasogott',
|
|
46
|
-
versionLabel: 'v0.1.0',
|
|
47
|
-
footer: 'pilothub.com/pasogott/gurkerlcli',
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
expect(svg).toContain('<clipPath id="cardClip">')
|
|
51
|
-
expect(svg).toContain('clip-path="url(#cardClip)"')
|
|
52
|
-
expect(svg).not.toContain(longWord)
|
|
53
|
-
expect(svg).toContain('…')
|
|
54
|
-
|
|
55
|
-
const descBlock = svg.match(/<text[^>]*font-size="26"[\s\S]*?<\/text>/)?.[0] ?? ''
|
|
56
|
-
const descTspans = descBlock.match(/<tspan /g) ?? []
|
|
57
|
-
expect(descTspans.length).toBeLessThanOrEqual(3)
|
|
58
|
-
})
|
|
59
|
-
})
|
package/server/og/skillOgSvg.ts
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import { FONT_MONO, FONT_SANS } from './ogAssets'
|
|
2
|
-
|
|
3
|
-
export type SkillOgSvgParams = {
|
|
4
|
-
markDataUrl: string
|
|
5
|
-
title: string
|
|
6
|
-
description: string
|
|
7
|
-
ownerLabel: string
|
|
8
|
-
versionLabel: string
|
|
9
|
-
footer: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function escapeXml(value: string) {
|
|
13
|
-
return value
|
|
14
|
-
.replace(/&/g, '&')
|
|
15
|
-
.replace(/</g, '<')
|
|
16
|
-
.replace(/>/g, '>')
|
|
17
|
-
.replace(/"/g, '"')
|
|
18
|
-
.replace(/'/g, ''')
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function glyphWidthFactor(char: string) {
|
|
22
|
-
if (char === ' ') return 0.28
|
|
23
|
-
if (char === '…') return 0.62
|
|
24
|
-
if (/[ilI.,:;|!'"`]/.test(char)) return 0.28
|
|
25
|
-
if (/[mwMW@%&]/.test(char)) return 0.9
|
|
26
|
-
if (/[A-Z]/.test(char)) return 0.68
|
|
27
|
-
if (/[0-9]/.test(char)) return 0.6
|
|
28
|
-
return 0.56
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function estimateTextWidth(value: string, fontSize: number) {
|
|
32
|
-
let width = 0
|
|
33
|
-
for (const char of value) width += glyphWidthFactor(char) * fontSize
|
|
34
|
-
return width
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function truncateToWidth(value: string, maxWidth: number, fontSize: number) {
|
|
38
|
-
const trimmed = value.trim()
|
|
39
|
-
if (!trimmed) return ''
|
|
40
|
-
if (estimateTextWidth(trimmed, fontSize) <= maxWidth) return trimmed
|
|
41
|
-
|
|
42
|
-
const ellipsis = '…'
|
|
43
|
-
const ellipsisWidth = estimateTextWidth(ellipsis, fontSize)
|
|
44
|
-
let out = ''
|
|
45
|
-
for (const char of trimmed) {
|
|
46
|
-
const next = out + char
|
|
47
|
-
if (estimateTextWidth(next, fontSize) + ellipsisWidth > maxWidth) break
|
|
48
|
-
out = next
|
|
49
|
-
}
|
|
50
|
-
return `${out.replace(/\s+$/g, '').replace(/[.。,;:!?]+$/g, '')}${ellipsis}`
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function wrapText(value: string, maxWidth: number, fontSize: number, maxLines: number) {
|
|
54
|
-
const words = value.trim().split(/\s+/).filter(Boolean)
|
|
55
|
-
const lines: string[] = []
|
|
56
|
-
let current = ''
|
|
57
|
-
|
|
58
|
-
function pushLine(line: string) {
|
|
59
|
-
if (!line) return
|
|
60
|
-
lines.push(line)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function splitLongWord(word: string) {
|
|
64
|
-
if (estimateTextWidth(word, fontSize) <= maxWidth) return [word]
|
|
65
|
-
const parts: string[] = []
|
|
66
|
-
let remaining = word
|
|
67
|
-
while (remaining && estimateTextWidth(remaining, fontSize) > maxWidth) {
|
|
68
|
-
let chunk = ''
|
|
69
|
-
for (const char of remaining) {
|
|
70
|
-
const next = chunk + char
|
|
71
|
-
if (estimateTextWidth(`${next}…`, fontSize) > maxWidth) break
|
|
72
|
-
chunk = next
|
|
73
|
-
}
|
|
74
|
-
if (!chunk) break
|
|
75
|
-
parts.push(`${chunk}…`)
|
|
76
|
-
remaining = remaining.slice(chunk.length)
|
|
77
|
-
}
|
|
78
|
-
if (remaining) parts.push(remaining)
|
|
79
|
-
return parts
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
for (const word of words) {
|
|
83
|
-
if (estimateTextWidth(word, fontSize) > maxWidth) {
|
|
84
|
-
if (current) {
|
|
85
|
-
pushLine(current)
|
|
86
|
-
current = ''
|
|
87
|
-
if (lines.length >= maxLines - 1) break
|
|
88
|
-
}
|
|
89
|
-
const parts = splitLongWord(word)
|
|
90
|
-
for (const part of parts) {
|
|
91
|
-
pushLine(part)
|
|
92
|
-
if (lines.length >= maxLines) break
|
|
93
|
-
}
|
|
94
|
-
current = ''
|
|
95
|
-
if (lines.length >= maxLines - 1) break
|
|
96
|
-
continue
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const next = current ? `${current} ${word}` : word
|
|
100
|
-
if (estimateTextWidth(next, fontSize) <= maxWidth) {
|
|
101
|
-
current = next
|
|
102
|
-
continue
|
|
103
|
-
}
|
|
104
|
-
pushLine(current)
|
|
105
|
-
current = word
|
|
106
|
-
if (lines.length >= maxLines - 1) break
|
|
107
|
-
}
|
|
108
|
-
if (lines.length < maxLines && current) pushLine(current)
|
|
109
|
-
if (lines.length > maxLines) lines.length = maxLines
|
|
110
|
-
|
|
111
|
-
const usedWords = lines.join(' ').split(/\s+/).filter(Boolean).length
|
|
112
|
-
if (usedWords < words.length) {
|
|
113
|
-
lines[lines.length - 1] = truncateToWidth(lines.at(-1) ?? '', maxWidth, fontSize)
|
|
114
|
-
}
|
|
115
|
-
return lines
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function buildSkillOgSvg(params: SkillOgSvgParams) {
|
|
119
|
-
const rawTitle = params.title.trim() || 'PilotHub Skill'
|
|
120
|
-
const rawDescription = params.description.trim() || 'Published on PilotHub.'
|
|
121
|
-
|
|
122
|
-
const cardX = 72
|
|
123
|
-
const cardY = 96
|
|
124
|
-
const cardW = 640
|
|
125
|
-
const cardH = 456
|
|
126
|
-
const cardR = 34
|
|
127
|
-
|
|
128
|
-
const contentX = 114
|
|
129
|
-
const contentRightPadding = 28
|
|
130
|
-
const contentMaxWidth = cardX + cardW - contentX - contentRightPadding
|
|
131
|
-
|
|
132
|
-
const titleMaxLines = 2
|
|
133
|
-
const descMaxLines = 3
|
|
134
|
-
|
|
135
|
-
const titleProbeLines = wrapText(rawTitle, contentMaxWidth, 80, titleMaxLines)
|
|
136
|
-
const titleFontSize = titleProbeLines.length > 1 ? 72 : 80
|
|
137
|
-
const titleLines = wrapText(rawTitle, contentMaxWidth, titleFontSize, titleMaxLines)
|
|
138
|
-
|
|
139
|
-
const descLines = wrapText(rawDescription, contentMaxWidth, 26, descMaxLines)
|
|
140
|
-
const titleY = titleLines.length > 1 ? 258 : 280
|
|
141
|
-
const titleLineHeight = 84
|
|
142
|
-
|
|
143
|
-
const descY = titleLines.length > 1 ? 395 : 380
|
|
144
|
-
const descLineHeight = 34
|
|
145
|
-
|
|
146
|
-
const pillText = `${params.ownerLabel} • ${params.versionLabel}`
|
|
147
|
-
const underlineY = cardY + cardH - 80
|
|
148
|
-
const footerY = cardY + cardH - 18
|
|
149
|
-
|
|
150
|
-
const titleTspans = titleLines
|
|
151
|
-
.map((line, index) => {
|
|
152
|
-
const dy = index === 0 ? 0 : titleLineHeight
|
|
153
|
-
return `<tspan x="114" dy="${dy}">${escapeXml(line)}</tspan>`
|
|
154
|
-
})
|
|
155
|
-
.join('')
|
|
156
|
-
|
|
157
|
-
const descTspans = descLines
|
|
158
|
-
.map((line, index) => {
|
|
159
|
-
const dy = index === 0 ? 0 : descLineHeight
|
|
160
|
-
return `<tspan x="114" dy="${dy}">${escapeXml(line)}</tspan>`
|
|
161
|
-
})
|
|
162
|
-
.join('')
|
|
163
|
-
|
|
164
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
165
|
-
<svg width="1200" height="630" viewBox="0 0 1200 630" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
166
|
-
<defs>
|
|
167
|
-
<linearGradient id="bg" x1="0" y1="0" x2="1200" y2="630" gradientUnits="userSpaceOnUse">
|
|
168
|
-
<stop stop-color="#14110F"/>
|
|
169
|
-
<stop offset="0.55" stop-color="#1A1512"/>
|
|
170
|
-
<stop offset="1" stop-color="#14110F"/>
|
|
171
|
-
</linearGradient>
|
|
172
|
-
|
|
173
|
-
<radialGradient id="glowOrange" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(260 60) rotate(120) scale(520 420)">
|
|
174
|
-
<stop stop-color="#E86A47" stop-opacity="0.55"/>
|
|
175
|
-
<stop offset="1" stop-color="#E86A47" stop-opacity="0"/>
|
|
176
|
-
</radialGradient>
|
|
177
|
-
|
|
178
|
-
<radialGradient id="glowSea" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(1050 120) rotate(140) scale(520 420)">
|
|
179
|
-
<stop stop-color="#4AD8B7" stop-opacity="0.35"/>
|
|
180
|
-
<stop offset="1" stop-color="#4AD8B7" stop-opacity="0"/>
|
|
181
|
-
</radialGradient>
|
|
182
|
-
|
|
183
|
-
<filter id="softBlur" x="-40%" y="-40%" width="180%" height="180%">
|
|
184
|
-
<feGaussianBlur stdDeviation="24"/>
|
|
185
|
-
</filter>
|
|
186
|
-
|
|
187
|
-
<filter id="cardShadow" x="-20%" y="-20%" width="140%" height="140%">
|
|
188
|
-
<feDropShadow dx="0" dy="18" stdDeviation="26" flood-color="#000000" flood-opacity="0.6"/>
|
|
189
|
-
</filter>
|
|
190
|
-
|
|
191
|
-
<linearGradient id="pill" x1="0" y1="0" x2="520" y2="0" gradientUnits="userSpaceOnUse">
|
|
192
|
-
<stop stop-color="#E86A47" stop-opacity="0.22"/>
|
|
193
|
-
<stop offset="1" stop-color="#E86A47" stop-opacity="0.08"/>
|
|
194
|
-
</linearGradient>
|
|
195
|
-
|
|
196
|
-
<linearGradient id="stroke" x1="0" y1="0" x2="0" y2="1">
|
|
197
|
-
<stop stop-color="#FFFFFF" stop-opacity="0.16"/>
|
|
198
|
-
<stop offset="1" stop-color="#FFFFFF" stop-opacity="0.06"/>
|
|
199
|
-
</linearGradient>
|
|
200
|
-
|
|
201
|
-
<clipPath id="cardClip">
|
|
202
|
-
<rect x="${cardX}" y="${cardY}" width="${cardW}" height="${cardH}" rx="${cardR}"/>
|
|
203
|
-
</clipPath>
|
|
204
|
-
</defs>
|
|
205
|
-
|
|
206
|
-
<rect width="1200" height="630" fill="url(#bg)"/>
|
|
207
|
-
<circle cx="260" cy="60" r="520" fill="url(#glowOrange)" filter="url(#softBlur)"/>
|
|
208
|
-
<circle cx="1050" cy="120" r="520" fill="url(#glowSea)" filter="url(#softBlur)"/>
|
|
209
|
-
|
|
210
|
-
<g opacity="0.08">
|
|
211
|
-
<path d="M0 84 C160 120 340 40 520 86 C700 132 820 210 1200 160" stroke="#FFFFFF" stroke-opacity="0.10" stroke-width="2"/>
|
|
212
|
-
<path d="M0 188 C220 240 360 160 560 204 C760 248 900 330 1200 300" stroke="#FFFFFF" stroke-opacity="0.08" stroke-width="2"/>
|
|
213
|
-
<path d="M0 440 C240 380 420 520 620 470 C820 420 960 500 1200 460" stroke="#FFFFFF" stroke-opacity="0.06" stroke-width="2"/>
|
|
214
|
-
</g>
|
|
215
|
-
|
|
216
|
-
<g opacity="0.22" filter="url(#softBlur)">
|
|
217
|
-
<image href="${params.markDataUrl}" x="740" y="70" width="560" height="560" preserveAspectRatio="xMidYMid meet"/>
|
|
218
|
-
</g>
|
|
219
|
-
|
|
220
|
-
<g filter="url(#cardShadow)">
|
|
221
|
-
<rect x="${cardX}" y="${cardY}" width="${cardW}" height="${cardH}" rx="${cardR}" fill="#201B18" fill-opacity="0.92" stroke="url(#stroke)"/>
|
|
222
|
-
</g>
|
|
223
|
-
|
|
224
|
-
<g clip-path="url(#cardClip)">
|
|
225
|
-
<image href="${params.markDataUrl}" x="108" y="134" width="46" height="46" preserveAspectRatio="xMidYMid meet"/>
|
|
226
|
-
|
|
227
|
-
<g>
|
|
228
|
-
<rect x="166" y="136" width="520" height="42" rx="21" fill="url(#pill)" stroke="#E86A47" stroke-opacity="0.28"/>
|
|
229
|
-
<text x="186" y="163"
|
|
230
|
-
fill="#F6EFE4"
|
|
231
|
-
font-size="18"
|
|
232
|
-
font-weight="600"
|
|
233
|
-
font-family="${FONT_SANS}, sans-serif"
|
|
234
|
-
opacity="0.92">${escapeXml(pillText)}</text>
|
|
235
|
-
</g>
|
|
236
|
-
|
|
237
|
-
<text x="114" y="${titleY}"
|
|
238
|
-
fill="#F6EFE4"
|
|
239
|
-
font-size="${titleFontSize}"
|
|
240
|
-
font-weight="800"
|
|
241
|
-
font-family="${FONT_SANS}, sans-serif">${titleTspans}</text>
|
|
242
|
-
|
|
243
|
-
<text x="114" y="${descY}"
|
|
244
|
-
fill="#C6B8A8"
|
|
245
|
-
font-size="26"
|
|
246
|
-
font-weight="500"
|
|
247
|
-
font-family="${FONT_SANS}, sans-serif">${descTspans}</text>
|
|
248
|
-
|
|
249
|
-
<rect x="114" y="${underlineY}" width="110" height="6" rx="3" fill="#E86A47"/>
|
|
250
|
-
<text x="114" y="${footerY}"
|
|
251
|
-
fill="#F6EFE4"
|
|
252
|
-
font-size="20"
|
|
253
|
-
font-weight="500"
|
|
254
|
-
opacity="0.90"
|
|
255
|
-
font-family="${FONT_MONO}, monospace">${escapeXml(params.footer)}</text>
|
|
256
|
-
</g>
|
|
257
|
-
</svg>`
|
|
258
|
-
}
|