Repository Public Research preview
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : LLM API toolkits8 * File : scholarly/build-skill.mjs9 * Module : scholarly10 * Repository : https://git.spboucher.ai/llm-api-toolkits11 * Created : 2026-11-1012 * Last Modified : 2026-11-1013 *14 * Author : Simon-Pierre Boucher15 * Position : Professor of Finance16 * Institution : Université du Québec en Outaouais (UQO)17 * Organization : SP Boucher18 * Website : https://spboucher.ai19 * Git : https://git.spboucher.ai20 *21 * Preferred Contact: dev@spboucher.ai22 * Development : dev@spboucher.ai23 * Support : support@spboucher.ai24 * Security/Admin : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142// Copies the dependency-free engine from the MCP package into the skill, so both run the same code.43// Importing this file only exposes the file list; the copy happens when it is run directly.44import { copyFileSync, mkdirSync, realpathSync } from "node:fs";45import { fileURLToPath } from "node:url";46export const ENGINE_FILES = ["http.mjs", "normalize.mjs", "sources.mjs", "bibtex.mjs", "match.mjs", "format.mjs", "index.mjs"];47const isMain = (() => { try { return !!process.argv[1] && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url)); } catch { return false; } })();48if (isMain) {49 const src = new URL("./mcp/", import.meta.url), dst = new URL("./skill/citation-verification/", import.meta.url);50 mkdirSync(new URL("scripts/lib/", dst), { recursive: true });51 for (const f of ENGINE_FILES) copyFileSync(new URL(`lib/${f}`, src), new URL(`scripts/lib/${f}`, dst));52 copyFileSync(new URL("../anthropic/mcp/LICENSE", import.meta.url), new URL("LICENSE", dst));53 copyFileSync(new URL("../anthropic/mcp/LICENSE", import.meta.url), new URL("LICENSE", src));54 console.log(`skill engine synced: ${ENGINE_FILES.length} files`);55}56