refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions

View File

@@ -1,5 +1,5 @@
import type { ChannelDirectoryEntryKind, ChannelId } from "../../channels/plugins/types.js";
import type { MoltbotConfig } from "../../config/config.js";
import type { OpenClawConfig } from "../../config/config.js";
type CacheEntry<T> = {
value: T;
@@ -21,11 +21,11 @@ export function buildDirectoryCacheKey(key: DirectoryCacheKey): string {
export class DirectoryCache<T> {
private readonly cache = new Map<string, CacheEntry<T>>();
private lastConfigRef: MoltbotConfig | null = null;
private lastConfigRef: OpenClawConfig | null = null;
constructor(private readonly ttlMs: number) {}
get(key: string, cfg: MoltbotConfig): T | undefined {
get(key: string, cfg: OpenClawConfig): T | undefined {
this.resetIfConfigChanged(cfg);
const entry = this.cache.get(key);
if (!entry) return undefined;
@@ -36,7 +36,7 @@ export class DirectoryCache<T> {
return entry.value;
}
set(key: string, value: T, cfg: MoltbotConfig): void {
set(key: string, value: T, cfg: OpenClawConfig): void {
this.resetIfConfigChanged(cfg);
this.cache.set(key, { value, fetchedAt: Date.now() });
}
@@ -47,12 +47,12 @@ export class DirectoryCache<T> {
}
}
clear(cfg?: MoltbotConfig): void {
clear(cfg?: OpenClawConfig): void {
this.cache.clear();
if (cfg) this.lastConfigRef = cfg;
}
private resetIfConfigChanged(cfg: MoltbotConfig): void {
private resetIfConfigChanged(cfg: OpenClawConfig): void {
if (this.lastConfigRef && this.lastConfigRef !== cfg) {
this.cache.clear();
}