openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
29 lines (28 loc) • 1.01 kB
JavaScript
import { t as createSubsystemLogger } from "../../subsystem-BHJiy01V.mjs";
import { i as isAgentBootstrapEvent } from "../../internal-hooks-D6nf-Q3g.mjs";
import { t as loadDeclaredExtraBootstrapFiles } from "../../declared-files-CAvjeaCR.mjs";
//#region src/hooks/bundled/bootstrap-extra-files/handler.ts
const log = createSubsystemLogger("bootstrap-extra-files");
const bootstrapExtraFilesHook = async (e) => {
if (!isAgentBootstrapEvent(e)) return;
const t = e.context;
try {
const { files: e, diagnostics: n } = await loadDeclaredExtraBootstrapFiles({
config: t.cfg,
workspaceDir: t.workspaceDir
});
if (n.length > 0) log.debug("skipped extra bootstrap candidates", {
skipped: n.length,
reasons: n.reduce((e, t) => {
e[t.reason] = (e[t.reason] ?? 0) + 1;
return e;
}, {})
});
if (e.length === 0) return;
t.bootstrapFiles = [...t.bootstrapFiles, ...e];
} catch (e) {
log.warn(`failed: ${String(e)}`);
}
};
//#endregion
export { bootstrapExtraFilesHook as default };