mirror of
https://github.com/Heretek-AI/openclaw.git
synced 2026-07-21 02:25:21 -04:00
a9ae1a6778
Matrix Protocol: - docker-compose.matrix.yml: Dendrite homeserver + PostgreSQL + Nginx TLS - src/channels/plugins/matrix-channel.ts: OpenClaw plugin implementation - docs/matrix-triad-setup.md: Setup guide with auth scheme (@tm1-4:triad.local) MCP Server Integration: - docs/mcp-triad-integration.md: SearXNG, Playwright, GitHub MCP configs - docs/mcp-curiosity-mapping.md: Gap-to-capability mapping Node Sync Architecture: - src/services/node-sync-service.ts: WebSocket peer sync + presence detection - src/services/node-sync-service.test.ts: Unit tests - docs/node-sync-architecture.md: Architecture docs Triad Resilience: - scripts/triad-corruption-check.mjs: SQLite + log + config + git integrity - docs/triad-resilience.md: Recovery procedures - .secure/deployment-logs/README.md: Schema v2 - skills/triad-heartbeat/SKILL.md: Corruption check integration NPM Publish Workflow: - scripts/npm-publish.mjs: version, changelog, validate, publish, rollback - .github/workflows/npm-publish.yml: GitHub Actions with provenance - docs/npm-publish-guide.md: Complete documentation All deliverables tested in Docker before production.
61 lines
1.7 KiB
TypeScript
Executable File
61 lines
1.7 KiB
TypeScript
Executable File
#!/usr/bin/env tsx
|
|
/**
|
|
* Copy HOOK.md files from src/hooks/bundled to dist/bundled
|
|
*/
|
|
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const projectRoot = path.resolve(__dirname, "..");
|
|
const verbose = process.env.OPENCLAW_BUILD_VERBOSE === "1";
|
|
|
|
const srcBundled = path.join(projectRoot, "src", "hooks", "bundled");
|
|
const distBundled = path.join(projectRoot, "dist", "bundled");
|
|
|
|
function copyHookMetadata() {
|
|
if (!fs.existsSync(srcBundled)) {
|
|
console.warn("[copy-hook-metadata] Source directory not found:", srcBundled);
|
|
return;
|
|
}
|
|
|
|
if (!fs.existsSync(distBundled)) {
|
|
fs.mkdirSync(distBundled, { recursive: true });
|
|
}
|
|
|
|
const entries = fs.readdirSync(srcBundled, { withFileTypes: true });
|
|
let copiedCount = 0;
|
|
|
|
for (const entry of entries) {
|
|
if (!entry.isDirectory()) {
|
|
continue;
|
|
}
|
|
|
|
const hookName = entry.name;
|
|
const srcHookDir = path.join(srcBundled, hookName);
|
|
const distHookDir = path.join(distBundled, hookName);
|
|
const srcHookMd = path.join(srcHookDir, "HOOK.md");
|
|
const distHookMd = path.join(distHookDir, "HOOK.md");
|
|
|
|
if (!fs.existsSync(srcHookMd)) {
|
|
console.warn(`[copy-hook-metadata] No HOOK.md found for ${hookName}`);
|
|
continue;
|
|
}
|
|
|
|
if (!fs.existsSync(distHookDir)) {
|
|
fs.mkdirSync(distHookDir, { recursive: true });
|
|
}
|
|
|
|
fs.copyFileSync(srcHookMd, distHookMd);
|
|
copiedCount += 1;
|
|
if (verbose) {
|
|
console.log(`[copy-hook-metadata] Copied ${hookName}/HOOK.md`);
|
|
}
|
|
}
|
|
|
|
console.log(`[copy-hook-metadata] Copied ${copiedCount} hook metadata files.`);
|
|
}
|
|
|
|
copyHookMetadata();
|