Pages pour les IA : MCP disponible dans ia.md, ia.html, llms.txt, robots.txt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
809b7d6db1
commit
e39b23731a
@@ -27,7 +27,7 @@ test("accueil : questions, ingestion d'un programme existant, formats, lien, MCP
|
||||
assert.match(brief, /sets: entier de 1 à 12/);
|
||||
assert.match(brief, /sessionMinutes: durée visée/);
|
||||
assert.ok(brief.includes("https://ia-fit.sans.pub/#import-json=%7B%22program%22%3A"));
|
||||
assert.match(brief, /## Connecteur MCP \(bientôt\)[\s\S]*https:\/\/ia-fit\.sans\.pub\/mcp/);
|
||||
assert.match(brief, /## Connecteur MCP \(disponible\)[\s\S]*https:\/\/ia-fit\.sans\.pub\/mcp[\s\S]*ChatGPT[\s\S]*get_overview/);
|
||||
// l'exemple du texte se relit tel quel
|
||||
const example = /```json\n(.*)\n```/.exec(brief)?.[1];
|
||||
assert.deepEqual(JSON.parse(example ?? "null"), EXAMPLE_PAYLOAD);
|
||||
@@ -40,10 +40,6 @@ test("un lien écrit comme le demande le texte devient une proposition", async (
|
||||
assert.deepEqual(/** @type {any} */ (e.data).profile, EXAMPLE_PAYLOAD.profile);
|
||||
});
|
||||
|
||||
test("app/ia.md est à jour (sinon : node scripts/build-prompt.js)", () => {
|
||||
const published = fs.readFileSync(new URL("../../app/ia.md", import.meta.url), "utf8");
|
||||
assert.equal(published, buildOnboardingBrief({ baseUrl }));
|
||||
});
|
||||
|
||||
test("évolution : profil, mode, assiduité, historique condensé, programme", () => {
|
||||
const raw = JSON.parse(fs.readFileSync(new URL("../fixtures/atelier-etat.json", import.meta.url), "utf8"));
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import { buildAiPages, markdownToHtml } from "../../scripts/ai-pages.js";
|
||||
|
||||
test("les pages pour les IA sont à jour (sinon : node scripts/build-prompt.js)", () => {
|
||||
for (const [name, content] of Object.entries(buildAiPages()))
|
||||
assert.equal(fs.readFileSync(new URL(`../../app/${name}`, import.meta.url), "utf8"), content, name);
|
||||
});
|
||||
|
||||
test("llms.txt présente les instructions et le serveur MCP", () => {
|
||||
const llms = buildAiPages()["llms.txt"];
|
||||
assert.match(llms, /^# IA-Fit\n\n> /);
|
||||
assert.match(llms, /https:\/\/ia-fit\.sans\.pub\/ia\.md/);
|
||||
assert.match(llms, /https:\/\/ia-fit\.sans\.pub\/mcp/);
|
||||
});
|
||||
|
||||
test("ia.html reprend le prompt, échappé, sans script ni style en ligne", () => {
|
||||
const html = buildAiPages()["ia.html"];
|
||||
assert.match(html, /<h2>Connecteur MCP \(disponible\)<\/h2>/);
|
||||
assert.doesNotMatch(html, /<script|style=|<style/);
|
||||
assert.equal(markdownToHtml("`<b>` & **x**"), "<p><code><b></code> & <strong>x</strong></p>");
|
||||
});
|
||||
Reference in New Issue
Block a user