Skip to content

Comments

feat: add expose API for clearweb publishing#7

Open
arthyn wants to merge 1 commit intomainfrom
nimbus/expose-api
Open

feat: add expose API for clearweb publishing#7
arthyn wants to merge 1 commit intomainfrom
nimbus/expose-api

Conversation

@arthyn
Copy link
Member

@arthyn arthyn commented Feb 20, 2026

Adds API functions for the %expose agent which allows publishing Tlon posts to the clearweb.

New Functions

Core Operations

  • listExposedContent() - Get all currently exposed posts
  • checkPostExposed(citePath) - Check if a specific post is exposed
  • exposePost(citePath) - Expose a post publicly
  • hideExposedPost(citePath) - Hide an exposed post
  • setExposeEagerMode(eager) - Toggle eager prefetching mode

Utilities

  • expandCitePath(input) - Expand simplified paths to full cite format
  • getExposedPostUrl(citePath, shipUrl) - Get the public URL for a post
  • formatCite(cite) - Convert cite object to path string
  • citePathToUrlPath(citePath) - Convert cite path to URL path

Usage

import { exposePost, listExposedContent, getExposedPostUrl } from '@tloncorp/api';

// Expose a post (simplified path format)
await exposePost('diary/~zod/blog/170.141.184.507...');

// List all exposed content
const exposed = await listExposedContent();

// Get public URL
const url = getExposedPostUrl('diary/~zod/blog/170.141...', 'https://zod.tlon.network');
// -> 'https://zod.tlon.network/expose/chan/diary/~zod/blog/note/170.141...'

Note

Requires the backend fix in tloncorp/tlon-apps#5507 to work correctly (fixes type mismatch in grab-post).

- listExposedContent(): get all exposed posts
- checkPostExposed(citePath): check if a post is exposed
- exposePost(citePath): expose a post publicly
- hideExposedPost(citePath): hide an exposed post
- setExposeEagerMode(eager): toggle eager prefetching

Utility functions:
- expandCitePath(): expand simplified paths to full cite format
- getExposedPostUrl(): get the public URL for a post
- formatCite(): convert cite object to path string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant