Skip to content
Merged
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ After a storyline is created, inform the user they can customize it directly in

- **Story URL**: `https://plotlink.xyz/story/{storylineId}`
- The **Edit Story** button appears in the preview panel for published genesis files
- Editable fields: cover image (WebP/JPEG, max 500KB, recommended 600x900px), genre, language, NSFW flag
- Editable fields: cover image (WebP/JPEG, max 1MB, recommended 600x900px), genre, language, NSFW flag
- Uploading a cover image significantly improves the story's visibility on PlotLink
- All edits are signed with the OWS wallet and sent to PlotLink automatically

Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ The OWS passphrase is stored in plaintext in `~/.plotlink-ows/.env` as `OWS_PASS
| `/api/publish/preflight` | GET | Check wallet balance, Filebase config |
| `/api/publish/file` | POST | Publish story on-chain (SSE stream of progress events) |
| `/api/publish/retry-index` | POST | Retry indexing for a published file |
| `/api/publish/upload-cover` | POST | Upload cover image — FormData `file` field, **WebP or JPEG only**, max 500KB → returns `{ cid }` |
| `/api/publish/upload-plot-image` | POST | Upload plot illustration — FormData `file` field, **WebP or JPEG only**, max 500KB → returns `{ cid, url }` |
| `/api/publish/upload-cover` | POST | Upload cover image — FormData `file` field, **WebP or JPEG only**, max 1MB → returns `{ cid }` |
| `/api/publish/upload-plot-image` | POST | Upload plot illustration — FormData `file` field, **WebP or JPEG only**, max 1MB → returns `{ cid, url }` |
| `/api/publish/update-storyline` | POST | Update storyline metadata (coverCid, genre, language, isNsfw) |

**Publish flow:** Upload to IPFS → estimate gas → sign with OWS wallet → broadcast → confirm → index on plotlink.xyz (8s delay + 10 retries × 30s). Genesis files call `createStoryline`, plot files (`plot-*.md`) call `chainPlot`. Content limit: 10K chars.
Expand Down
4 changes: 2 additions & 2 deletions app/lib/generate-claude-md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ For login, the passphrase is hashed with HMAC-SHA256 and compared against the st
| \`/api/publish/preflight\` | GET | Check wallet balance, Filebase config |
| \`/api/publish/file\` | POST | Publish story on-chain (SSE stream of progress events) |
| \`/api/publish/retry-index\` | POST | Retry indexing for a published file |
| \`/api/publish/upload-cover\` | POST | Upload cover image — FormData \`file\` field, **WebP or JPEG only**, max 500KB → returns \`{ cid }\` |
| \`/api/publish/upload-plot-image\` | POST | Upload plot illustration — FormData \`file\` field, **WebP or JPEG only**, max 500KB → returns \`{ cid, url }\` |
| \`/api/publish/upload-cover\` | POST | Upload cover image — FormData \`file\` field, **WebP or JPEG only**, max 1MB → returns \`{ cid }\` |
| \`/api/publish/upload-plot-image\` | POST | Upload plot illustration — FormData \`file\` field, **WebP or JPEG only**, max 1MB → returns \`{ cid, url }\` |
| \`/api/publish/update-storyline\` | POST | Update storyline metadata (coverCid, genre, language, isNsfw) |

**Publish flow:** Upload to IPFS → estimate gas → sign with OWS wallet → broadcast → confirm → index on plotlink.xyz (8s delay + 10 retries × 30s). Genesis files call \`createStoryline\`, plot files (\`plot-*.md\`) call \`chainPlot\`. Content limit: 10K chars.
Expand Down
12 changes: 6 additions & 6 deletions app/routes/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ publish.post("/upload-cover", async (c) => {
return c.json({ error: "No image file provided" }, 400);
}

// Validate file size (500KB max)
if (file.size > 500 * 1024) {
return c.json({ error: "Image exceeds 500KB limit" }, 400);
// Validate file size (1MB max)
if (file.size > 1024 * 1024) {
return c.json({ error: "Image exceeds 1MB limit" }, 400);
}

// Validate file type — only WebP and JPEG accepted by the plotlink server
Expand Down Expand Up @@ -247,9 +247,9 @@ publish.post("/upload-plot-image", async (c) => {
return c.json({ error: "No image file provided" }, 400);
}

// Validate file size (500KB max)
if (file.size > 500 * 1024) {
return c.json({ error: "Image exceeds 500KB limit" }, 400);
// Validate file size (1MB max)
if (file.size > 1024 * 1024) {
return c.json({ error: "Image exceeds 1MB limit" }, 400);
}

// Validate file type — only WebP and JPEG accepted by the plotlink server
Expand Down
12 changes: 6 additions & 6 deletions app/web/components/PreviewPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export function PreviewPanel({ storyName, fileName, authFetch, onPublish, publis
const handleCoverSelect = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
if (file.size > 500 * 1024) {
setEditError("Image exceeds 500KB limit");
if (file.size > 1024 * 1024) {
setEditError("Image exceeds 1MB limit");
return;
}
if (!file.type.startsWith("image/")) {
Expand All @@ -202,8 +202,8 @@ export function PreviewPanel({ storyName, fileName, authFetch, onPublish, publis

// Handle illustration image upload from File object
const uploadIllustration = useCallback(async (file: File) => {
if (file.size > 500 * 1024) {
setIllustrationError("Image exceeds 500KB limit");
if (file.size > 1024 * 1024) {
setIllustrationError("Image exceeds 1MB limit");
return;
}
const allowedTypes = ["image/webp", "image/jpeg"];
Expand Down Expand Up @@ -653,7 +653,7 @@ export function PreviewPanel({ storyName, fileName, authFetch, onPublish, publis
onChange={handleCoverSelect}
className="text-xs"
/>
<span className="text-xs text-muted">WebP/JPEG, max 500KB, 600x900px recommended</span>
<span className="text-xs text-muted">WebP/JPEG, max 1MB, 600x900px recommended</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -740,7 +740,7 @@ export function PreviewPanel({ storyName, fileName, authFetch, onPublish, publis
<span className="text-xs text-muted">
{illustrationUploading ? "Uploading..." : "Drop image here or click to browse"}
</span>
<span className="text-xs text-muted">WebP/JPEG, max 500KB</span>
<span className="text-xs text-muted">WebP/JPEG, max 1MB</span>
</div>
{illustrationError && (
<span className="text-error text-xs">{illustrationError}</span>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading