diff --git a/extensions/tlon/src/monitor/discovery.ts b/extensions/tlon/src/monitor/discovery.ts index 1a19b1cdfc1..885179f98f6 100644 --- a/extensions/tlon/src/monitor/discovery.ts +++ b/extensions/tlon/src/monitor/discovery.ts @@ -2,7 +2,7 @@ import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime"; import type { Foreigns } from "../urbit/foreigns.js"; import { asRecord, formatErrorMessage } from "./utils.js"; -export interface InitData { +interface InitData { channels: string[]; foreigns: Foreigns | null; } diff --git a/extensions/tlon/src/monitor/history.ts b/extensions/tlon/src/monitor/history.ts index 4ca5c451683..331e5464aaf 100644 --- a/extensions/tlon/src/monitor/history.ts +++ b/extensions/tlon/src/monitor/history.ts @@ -20,7 +20,7 @@ function formatUd(id: string | number): string { return chunks.toReversed().join("."); } -export type TlonHistoryEntry = { +type TlonHistoryEntry = { author: string; content: string; timestamp: number; @@ -63,7 +63,7 @@ export function cacheMessage(channelNest: string, message: TlonHistoryEntry) { } } -export async function fetchChannelHistory( +async function fetchChannelHistory( api: { scry: (path: string) => Promise }, channelNest: string, count = 50, diff --git a/extensions/tlon/src/monitor/index.ts b/extensions/tlon/src/monitor/index.ts index c527fd4e1f3..eedf086f5c6 100644 --- a/extensions/tlon/src/monitor/index.ts +++ b/extensions/tlon/src/monitor/index.ts @@ -45,7 +45,7 @@ import { stripBotMention, } from "./utils.js"; -export type MonitorTlonOpts = { +type MonitorTlonOpts = { runtime?: RuntimeEnv; abortSignal?: AbortSignal; accountId?: string | null; diff --git a/extensions/tlon/src/monitor/media.ts b/extensions/tlon/src/monitor/media.ts index 3813187060c..9ac2cde155d 100644 --- a/extensions/tlon/src/monitor/media.ts +++ b/extensions/tlon/src/monitor/media.ts @@ -13,12 +13,12 @@ import { getDefaultSsrFPolicy } from "../urbit/context.js"; const MAX_IMAGES_PER_MESSAGE = 8; const TLON_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 30_000; -export interface ExtractedImage { +interface ExtractedImage { url: string; alt?: string; } -export interface DownloadedMedia { +interface DownloadedMedia { localPath: string; contentType: string; originalUrl: string; diff --git a/extensions/tlon/src/monitor/processed-messages.ts b/extensions/tlon/src/monitor/processed-messages.ts index 8aaf56ebf02..c1e6c62e0a7 100644 --- a/extensions/tlon/src/monitor/processed-messages.ts +++ b/extensions/tlon/src/monitor/processed-messages.ts @@ -1,6 +1,6 @@ import { createDedupeCache } from "../../runtime-api.js"; -export type ProcessedMessageTracker = { +type ProcessedMessageTracker = { claim: (id?: string | null) => { kind: "claimed" } | { kind: "duplicate" }; commit: (id?: string | null) => void; release: (id?: string | null) => void; diff --git a/extensions/tlon/src/monitor/settings-helpers.ts b/extensions/tlon/src/monitor/settings-helpers.ts index 8df6c38e318..520d509766b 100644 --- a/extensions/tlon/src/monitor/settings-helpers.ts +++ b/extensions/tlon/src/monitor/settings-helpers.ts @@ -2,7 +2,7 @@ import type { PendingApproval, TlonSettingsStore } from "../settings.js"; import { normalizeShip } from "../targets.js"; import type { TlonResolvedAccount } from "../types.js"; -export type TlonMonitorSettingsState = { +type TlonMonitorSettingsState = { effectiveDmAllowlist: string[]; effectiveShowModelSig: boolean; effectiveAutoAcceptDmInvites: boolean; diff --git a/extensions/tlon/src/urbit/auth.ts b/extensions/tlon/src/urbit/auth.ts index cb06151d903..7136336f6b9 100644 --- a/extensions/tlon/src/urbit/auth.ts +++ b/extensions/tlon/src/urbit/auth.ts @@ -2,7 +2,7 @@ import type { LookupFn, SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime"; import { UrbitAuthError } from "./errors.js"; import { urbitFetch } from "./fetch.js"; -export type UrbitAuthenticateOptions = { +type UrbitAuthenticateOptions = { ssrfPolicy?: SsrFPolicy; lookupFn?: LookupFn; fetchImpl?: (input: RequestInfo | URL, init?: RequestInit) => Promise; diff --git a/extensions/tlon/src/urbit/base-url.ts b/extensions/tlon/src/urbit/base-url.ts index e24a832f1b3..2dba84322e0 100644 --- a/extensions/tlon/src/urbit/base-url.ts +++ b/extensions/tlon/src/urbit/base-url.ts @@ -1,6 +1,6 @@ import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime"; -export type UrbitBaseUrlValidation = +type UrbitBaseUrlValidation = | { ok: true; baseUrl: string; hostname: string } | { ok: false; error: string }; diff --git a/extensions/tlon/src/urbit/channel-ops.ts b/extensions/tlon/src/urbit/channel-ops.ts index c7d77c6e2ba..b18324c7660 100644 --- a/extensions/tlon/src/urbit/channel-ops.ts +++ b/extensions/tlon/src/urbit/channel-ops.ts @@ -2,7 +2,7 @@ import type { LookupFn, SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime"; import { UrbitHttpError } from "./errors.js"; import { urbitFetch } from "./fetch.js"; -export type UrbitChannelDeps = { +type UrbitChannelDeps = { baseUrl: string; cookie: string; ship: string; @@ -94,7 +94,7 @@ export async function scryUrbitPath( } } -export async function createUrbitChannel( +async function createUrbitChannel( deps: UrbitChannelDeps, params: { body: unknown; auditContext: string }, ): Promise { @@ -109,7 +109,7 @@ export async function createUrbitChannel( } } -export async function wakeUrbitChannel(deps: UrbitChannelDeps): Promise { +async function wakeUrbitChannel(deps: UrbitChannelDeps): Promise { const { response, release } = await putUrbitChannel(deps, { body: [ { diff --git a/extensions/tlon/src/urbit/context.ts b/extensions/tlon/src/urbit/context.ts index 6489024b075..1820f9d961f 100644 --- a/extensions/tlon/src/urbit/context.ts +++ b/extensions/tlon/src/urbit/context.ts @@ -2,13 +2,13 @@ export { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sd import { normalizeUrbitHostname, validateUrbitBaseUrl } from "./base-url.js"; import { UrbitUrlError } from "./errors.js"; -export type UrbitContext = { +type UrbitContext = { baseUrl: string; hostname: string; ship: string; }; -export function resolveShipFromHostname(hostname: string): string { +function resolveShipFromHostname(hostname: string): string { const trimmed = normalizeUrbitHostname(hostname); if (!trimmed) { return ""; @@ -19,7 +19,7 @@ export function resolveShipFromHostname(hostname: string): string { return trimmed; } -export function normalizeUrbitShip(ship: string | undefined, hostname: string): string { +function normalizeUrbitShip(ship: string | undefined, hostname: string): string { const raw = ship?.replace(/^~/, "") ?? resolveShipFromHostname(hostname); return raw.trim(); } diff --git a/extensions/tlon/src/urbit/errors.ts b/extensions/tlon/src/urbit/errors.ts index d39fa7d6c1b..16b30236e1a 100644 --- a/extensions/tlon/src/urbit/errors.ts +++ b/extensions/tlon/src/urbit/errors.ts @@ -1,11 +1,11 @@ -export type UrbitErrorCode = +type UrbitErrorCode = | "invalid_url" | "http_error" | "auth_failed" | "missing_cookie" | "channel_not_open"; -export class UrbitError extends Error { +class UrbitError extends Error { readonly code: UrbitErrorCode; constructor(code: UrbitErrorCode, message: string, options?: { cause?: unknown }) { diff --git a/extensions/tlon/src/urbit/fetch.ts b/extensions/tlon/src/urbit/fetch.ts index 53f707b28ea..5dc4eee401c 100644 --- a/extensions/tlon/src/urbit/fetch.ts +++ b/extensions/tlon/src/urbit/fetch.ts @@ -6,7 +6,7 @@ import { import { validateUrbitBaseUrl } from "./base-url.js"; import { UrbitUrlError } from "./errors.js"; -export type UrbitFetchOptions = { +type UrbitFetchOptions = { baseUrl: string; path: string; init?: RequestInit; diff --git a/extensions/tlon/src/urbit/foreigns.ts b/extensions/tlon/src/urbit/foreigns.ts index c9ce7c5002a..bf77492c460 100644 --- a/extensions/tlon/src/urbit/foreigns.ts +++ b/extensions/tlon/src/urbit/foreigns.ts @@ -3,7 +3,7 @@ * Based on packages/shared/src/urbit/groups.ts from homestead */ -export interface GroupPreviewV7 { +interface GroupPreviewV7 { meta: { title: string; description: string; @@ -17,7 +17,7 @@ export interface GroupPreviewV7 { }; } -export interface ForeignInvite { +interface ForeignInvite { flag: string; // group flag e.g. "~host/group-name" time: number; // timestamp from: string; // ship that sent invite @@ -27,10 +27,10 @@ export interface ForeignInvite { valid: boolean; // tracks if invite has been revoked } -export type Lookup = "preview" | "done" | "error"; -export type Progress = "ask" | "join" | "watch" | "done" | "error"; +type Lookup = "preview" | "done" | "error"; +type Progress = "ask" | "join" | "watch" | "done" | "error"; -export interface Foreign { +interface Foreign { invites: ForeignInvite[]; lookup: Lookup | null; preview: GroupPreviewV7 | null; diff --git a/extensions/tlon/src/urbit/sse-client.ts b/extensions/tlon/src/urbit/sse-client.ts index c102aa4140c..b7388403950 100644 --- a/extensions/tlon/src/urbit/sse-client.ts +++ b/extensions/tlon/src/urbit/sse-client.ts @@ -5,7 +5,7 @@ import { ensureUrbitChannelOpen, pokeUrbitChannel, scryUrbitPath } from "./chann import { getUrbitContext, normalizeUrbitCookie } from "./context.js"; import { urbitFetch } from "./fetch.js"; -export type UrbitSseLogger = { +type UrbitSseLogger = { log?: (message: string) => void; error?: (message: string) => void; }; diff --git a/extensions/tlon/src/urbit/story.ts b/extensions/tlon/src/urbit/story.ts index cebee8dae6b..c56b36a2709 100644 --- a/extensions/tlon/src/urbit/story.ts +++ b/extensions/tlon/src/urbit/story.ts @@ -5,7 +5,7 @@ */ // Inline content types -export type StoryInline = +type StoryInline = | string | { bold: StoryInline[] } | { italics: StoryInline[] } @@ -19,14 +19,14 @@ export type StoryInline = | { tag: string }; // Block content types -export type StoryBlock = +type StoryBlock = | { header: { tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; content: StoryInline[] } } | { code: { code: string; lang: string } } | { image: { src: string; height: number; width: number; alt: string } } | { rule: null } | { listing: StoryListing }; -export type StoryListing = +type StoryListing = | { list: { type: "ordered" | "unordered" | "tasklist"; @@ -37,7 +37,7 @@ export type StoryListing = | { item: StoryInline[] }; // A verse is either a block or inline content -export type StoryVerse = { block: StoryBlock } | { inline: StoryInline[] }; +type StoryVerse = { block: StoryBlock } | { inline: StoryInline[] }; // A story is a list of verses export type Story = StoryVerse[];