refactor: trim tlon helper exports · openclaw/openclaw@8ba84e8
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime";
|
2 | 2 | import type { Foreigns } from "../urbit/foreigns.js"; |
3 | 3 | import { asRecord, formatErrorMessage } from "./utils.js"; |
4 | 4 | |
5 | | -export interface InitData { |
| 5 | +interface InitData { |
6 | 6 | channels: string[]; |
7 | 7 | foreigns: Foreigns | null; |
8 | 8 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,7 @@ function formatUd(id: string | number): string {
|
20 | 20 | return chunks.toReversed().join("."); |
21 | 21 | } |
22 | 22 | |
23 | | -export type TlonHistoryEntry = { |
| 23 | +type TlonHistoryEntry = { |
24 | 24 | author: string; |
25 | 25 | content: string; |
26 | 26 | timestamp: number; |
@@ -63,7 +63,7 @@ export function cacheMessage(channelNest: string, message: TlonHistoryEntry) {
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | | -export async function fetchChannelHistory( |
| 66 | +async function fetchChannelHistory( |
67 | 67 | api: { scry: (path: string) => Promise<unknown> }, |
68 | 68 | channelNest: string, |
69 | 69 | count = 50, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -45,7 +45,7 @@ import {
|
45 | 45 | stripBotMention, |
46 | 46 | } from "./utils.js"; |
47 | 47 | |
48 | | -export type MonitorTlonOpts = { |
| 48 | +type MonitorTlonOpts = { |
49 | 49 | runtime?: RuntimeEnv; |
50 | 50 | abortSignal?: AbortSignal; |
51 | 51 | accountId?: string | null; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,12 +13,12 @@ import { getDefaultSsrFPolicy } from "../urbit/context.js";
|
13 | 13 | const MAX_IMAGES_PER_MESSAGE = 8; |
14 | 14 | const TLON_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 30_000; |
15 | 15 | |
16 | | -export interface ExtractedImage { |
| 16 | +interface ExtractedImage { |
17 | 17 | url: string; |
18 | 18 | alt?: string; |
19 | 19 | } |
20 | 20 | |
21 | | -export interface DownloadedMedia { |
| 21 | +interface DownloadedMedia { |
22 | 22 | localPath: string; |
23 | 23 | contentType: string; |
24 | 24 | originalUrl: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { createDedupeCache } from "../../runtime-api.js"; |
2 | 2 | |
3 | | -export type ProcessedMessageTracker = { |
| 3 | +type ProcessedMessageTracker = { |
4 | 4 | claim: (id?: string | null) => { kind: "claimed" } | { kind: "duplicate" }; |
5 | 5 | commit: (id?: string | null) => void; |
6 | 6 | release: (id?: string | null) => void; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import type { PendingApproval, TlonSettingsStore } from "../settings.js";
|
2 | 2 | import { normalizeShip } from "../targets.js"; |
3 | 3 | import type { TlonResolvedAccount } from "../types.js"; |
4 | 4 | |
5 | | -export type TlonMonitorSettingsState = { |
| 5 | +type TlonMonitorSettingsState = { |
6 | 6 | effectiveDmAllowlist: string[]; |
7 | 7 | effectiveShowModelSig: boolean; |
8 | 8 | effectiveAutoAcceptDmInvites: boolean; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import type { LookupFn, SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
|
2 | 2 | import { UrbitAuthError } from "./errors.js"; |
3 | 3 | import { urbitFetch } from "./fetch.js"; |
4 | 4 | |
5 | | -export type UrbitAuthenticateOptions = { |
| 5 | +type UrbitAuthenticateOptions = { |
6 | 6 | ssrfPolicy?: SsrFPolicy; |
7 | 7 | lookupFn?: LookupFn; |
8 | 8 | fetchImpl?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime"; |
2 | 2 | |
3 | | -export type UrbitBaseUrlValidation = |
| 3 | +type UrbitBaseUrlValidation = |
4 | 4 | | { ok: true; baseUrl: string; hostname: string } |
5 | 5 | | { ok: false; error: string }; |
6 | 6 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import type { LookupFn, SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
|
2 | 2 | import { UrbitHttpError } from "./errors.js"; |
3 | 3 | import { urbitFetch } from "./fetch.js"; |
4 | 4 | |
5 | | -export type UrbitChannelDeps = { |
| 5 | +type UrbitChannelDeps = { |
6 | 6 | baseUrl: string; |
7 | 7 | cookie: string; |
8 | 8 | ship: string; |
@@ -94,7 +94,7 @@ export async function scryUrbitPath(
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | | -export async function createUrbitChannel( |
| 97 | +async function createUrbitChannel( |
98 | 98 | deps: UrbitChannelDeps, |
99 | 99 | params: { body: unknown; auditContext: string }, |
100 | 100 | ): Promise<void> { |
@@ -109,7 +109,7 @@ export async function createUrbitChannel(
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | | -export async function wakeUrbitChannel(deps: UrbitChannelDeps): Promise<void> { |
| 112 | +async function wakeUrbitChannel(deps: UrbitChannelDeps): Promise<void> { |
113 | 113 | const { response, release } = await putUrbitChannel(deps, { |
114 | 114 | body: [ |
115 | 115 | { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,13 +2,13 @@ export { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sd
|
2 | 2 | import { normalizeUrbitHostname, validateUrbitBaseUrl } from "./base-url.js"; |
3 | 3 | import { UrbitUrlError } from "./errors.js"; |
4 | 4 | |
5 | | -export type UrbitContext = { |
| 5 | +type UrbitContext = { |
6 | 6 | baseUrl: string; |
7 | 7 | hostname: string; |
8 | 8 | ship: string; |
9 | 9 | }; |
10 | 10 | |
11 | | -export function resolveShipFromHostname(hostname: string): string { |
| 11 | +function resolveShipFromHostname(hostname: string): string { |
12 | 12 | const trimmed = normalizeUrbitHostname(hostname); |
13 | 13 | if (!trimmed) { |
14 | 14 | return ""; |
@@ -19,7 +19,7 @@ export function resolveShipFromHostname(hostname: string): string {
|
19 | 19 | return trimmed; |
20 | 20 | } |
21 | 21 | |
22 | | -export function normalizeUrbitShip(ship: string | undefined, hostname: string): string { |
| 22 | +function normalizeUrbitShip(ship: string | undefined, hostname: string): string { |
23 | 23 | const raw = ship?.replace(/^~/, "") ?? resolveShipFromHostname(hostname); |
24 | 24 | return raw.trim(); |
25 | 25 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。