2026-08-19 20:18:28 +07:00
|
|
|
import { runFullIndex } from "@mcpedia/core";
|
2026-08-19 17:40:14 +07:00
|
|
|
|
2026-08-19 20:18:28 +07:00
|
|
|
// Phase 3: the indexer now goes through `runFullIndex`, the single indexing
|
|
|
|
|
// entry point shared with the BullMQ worker and the git-sync hook. It parses
|
|
|
|
|
// each content file, upserts `documents`, chunks+embeds, and snapshots a
|
|
|
|
|
// revision when the body changed.
|
2026-08-19 17:40:14 +07:00
|
|
|
async function main() {
|
2026-08-19 20:18:28 +07:00
|
|
|
const reason = process.argv[2] && process.argv[2].startsWith("--reason=")
|
|
|
|
|
? process.argv[2].slice("--reason=".length)
|
|
|
|
|
: "index";
|
|
|
|
|
await runFullIndex(reason);
|
2026-08-19 17:40:14 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
main()
|
|
|
|
|
.then(() => process.exit(0))
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.error(err);
|
|
|
|
|
process.exit(1);
|
|
|
|
|
});
|