openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
79 lines (78 loc) • 4.94 kB
JavaScript
import { n as isTypeScriptPackageEntry } from "./package-entrypoints-Do32y0v-.mjs";
import { h as readRuntimeConfig } from "./runtime-snapshot-WbwbY5b7.mjs";
import { l as getPluginValueInstance } from "./plugin-instance-scope-oezVdCr2.mjs";
import { c as capturePluginStateOperationModuleSource } from "./plugin-setup-module-D_W6TtnO.mjs";
import { i as loadBundledPluginPublicSurfaceModuleSyncCore, o as resolveBundledPublicSurfaceLocation } from "./facade-loader-08DBXZOS.mjs";
import "./config-CMA-J084.mjs";
import { i as createPluginStateKeyedStore } from "./plugin-state-store-C2xZ8cMl.mjs";
import { n as createConfiguredProviderLocalServiceAcquirer } from "./provider-local-service-CoQj6xcb.mjs";
import path from "node:path";
//#region src/plugin-sdk/memory-core-bundled-runtime.ts
function loadFacadeModule(e) {
const t = loadBundledPluginPublicSurfaceModuleSyncCore({
dirName: "memory-core",
artifactBasename: e
});
const n = getPluginValueInstance(t);
const r = n ? () => n.run(() => {}) : void 0;
let i;
if (n && r) i = capturePluginStateOperationModuleSource(n, r);
else {
const t = resolveBundledPublicSurfaceLocation({
dirName: "memory-core",
artifactBasename: e
});
const n = resolveBundledPublicSurfaceLocation({
dirName: "memory-core",
artifactBasename: "recall-operation-api.js"
});
const r = t?.origin === "bundled" && n?.origin === "bundled" && path.dirname(t.modulePath) === path.dirname(n.modulePath) && isTypeScriptPackageEntry(t.modulePath) === isTypeScriptPackageEntry(n.modulePath) ? {
...n,
pluginId: "memory-core",
origin: "bundled"
} : void 0;
i = { resolve(e) {
if (e !== "recall-operation-api.js" || !r) throw new Error("Memory recall operation is absent from its selected facade family");
return r;
} };
}
t.configureMemoryCoreDreamingState((e) => createPluginStateKeyedStore("memory-core", e, r, i));
return t;
}
const loadApiFacadeModule = () => loadFacadeModule("api.js");
const loadRuntimeFacadeModule = () => loadFacadeModule("runtime-api.js");
/** Returns the memory-core-owned recovery message for an absent local provider plugin. */
function getMissingLocalMemoryEmbeddingProviderMessage() {
return loadApiFacadeModule().MISSING_LOCAL_MEMORY_EMBEDDING_PROVIDER_MESSAGE;
}
const acquireLocalService = createConfiguredProviderLocalServiceAcquirer(readRuntimeConfig);
/** Create a memory embedding provider with built-in fallback metadata. */
const createEmbeddingProvider = (e) => {
const t = {
...e,
acquireLocalService
};
return loadRuntimeFacadeModule().createEmbeddingProvider(t);
};
/** Remove short-term recall candidates already grounded into durable memory. */
const removeGroundedShortTermCandidates = (...e) => loadRuntimeFacadeModule().removeGroundedShortTermCandidates(...e);
/** Load short-term dreaming stats for doctor/control status. */
const loadShortTermPromotionDreamingStats = (...e) => loadRuntimeFacadeModule().loadShortTermPromotionDreamingStats(...e);
/** Audit dreaming diary and session-corpus artifacts through the bundled runtime facade. */
const auditDreamingArtifacts = (...e) => loadRuntimeFacadeModule().auditDreamingArtifacts(...e);
/** Audit short-term promotion artifacts through the bundled runtime facade. */
const auditShortTermPromotionArtifacts = (...e) => loadRuntimeFacadeModule().auditShortTermPromotionArtifacts(...e);
/** Repair or archive problematic dreaming artifacts through the bundled runtime facade. */
const repairDreamingArtifacts = (...e) => loadRuntimeFacadeModule().repairDreamingArtifacts(...e);
/** Repair short-term promotion artifacts through the bundled runtime facade. */
const repairShortTermPromotionArtifacts = (...e) => loadRuntimeFacadeModule().repairShortTermPromotionArtifacts(...e);
/** Preview grounded REM markdown facts and candidates for selected input files. */
const previewGroundedRemMarkdown = (...e) => loadApiFacadeModule().previewGroundedRemMarkdown(...e);
/** Remove duplicate dreaming diary entries while preserving canonical records. */
const dedupeDreamDiaryEntries = (...e) => loadApiFacadeModule().dedupeDreamDiaryEntries(...e);
/** Write synthetic/backfill dreaming diary entries for harness or migration use. */
const writeBackfillDiaryEntries = (...e) => loadApiFacadeModule().writeBackfillDiaryEntries(...e);
/** Remove dreaming diary entries previously written by the backfill helper. */
const removeBackfillDiaryEntries = (...e) => loadApiFacadeModule().removeBackfillDiaryEntries(...e);
//#endregion
export { getMissingLocalMemoryEmbeddingProviderMessage as a, removeBackfillDiaryEntries as c, repairShortTermPromotionArtifacts as d, writeBackfillDiaryEntries as f, dedupeDreamDiaryEntries as i, removeGroundedShortTermCandidates as l, auditShortTermPromotionArtifacts as n, loadShortTermPromotionDreamingStats as o, createEmbeddingProvider as r, previewGroundedRemMarkdown as s, auditDreamingArtifacts as t, repairDreamingArtifacts as u };