DEUX CHOSES.
1. RÉCONCILIATION. Le trunk accusait 49 commits de retard, 0 d'avance : tout son
delta vivait dans l'arbre de travail, mélange d'améliorations réelles et d'état
périmé. Il est remis sur origin/main, et son état est préservé sur la branche
trunk-snapshot-20260814. Ce qui méritait d'être porté l'est ici :
- test/main.ts : chemin Work/ au lieu de Desktop/ (l'ancien n'existe plus) et
module TIERS activé. L'URL par défaut reste corrigée par la garde d'hôte ;
- ansible README : la commande du playbook recurrentBackup ;
- company.json : siteWeb arcodange.fr et email @arcodange.fr — le trunk était
à jour sur ces deux champs quand main portait encore duckdns et gmail.
NE SONT PAS PORTÉS, délibérément :
- le .gitignore du trunk, qui avait PERDU les règles replay-packs ;
- company.json SAS / 6201Z, périmé — main porte SARL / 6201Z depuis le PR #77 ;
- un console.log de débogage dans forms.ts ;
- createEphemeralAgent + permissions.ts + orchestratorExample.ts : travail
cohérent mais qui DOUBLE le modèle de scopes durables (scopes.ts +
provisionAiUser.ts) effectivement livré. Deux conceptions concurrentes de la
même chose ne se portent pas en silence — arbitrage opérateur.
2. LA NOTE DU MODE VIERGE ÉTAIT FAUSSE. Elle annonçait qu'il manquait un « golden
empty ». Rien ne manquait : la chaîne existe en entier dans test/, et c'est
main.ts qui pilote l'installeur. J'avais proposé de construire ce qui était déjà
là, faute d'avoir regardé — exactement le contrôle inscrit dans AGENTS.md le
matin même. La note décrit désormais la chaîne réelle :
blank --yes -> main.ts -> install.lock -> provisionSandbox.ts
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
89 lines
2.8 KiB
TypeScript
89 lines
2.8 KiB
TypeScript
import "load_dotenv";
|
|
import { chromium } from "playwright";
|
|
import initialSetup from "./scripts/admin/initialSetup.ts";
|
|
import login from "./scripts/login.ts";
|
|
import { assertSandbox } from "./scripts/guard.ts";
|
|
import companySetup, { Company } from "./scripts/admin/companySetup.ts";
|
|
import path from "node:path";
|
|
import displaySetup from "./scripts/admin/displaySetup.ts";
|
|
import moduleSetup from "./scripts/admin/moduleSetup.ts";
|
|
|
|
/*
|
|
Initialisation
|
|
*/
|
|
// GARDE D'HÔTE. main.ts pilote l'ASSISTANT D'INSTALLATION (`/install/`) : c'est
|
|
// le script le plus destructeur du dépôt. Pointé sur la production avec
|
|
// l'environnement ambiant — et `test/.env` porte justement DOLIBARR_ADDRESS sur
|
|
// la PRODUCTION — il relancerait l'installeur sur l'ERP réel.
|
|
// assertSandbox() n'autorise que le bac à sable, sauf double opt-in explicite
|
|
// (ARCO_ALLOW_PRODUCTION + ARCO_PROD_CONFIRM) pour l'installation initiale d'un
|
|
// nouvel environnement, qui reste un geste d'opérateur.
|
|
const dolibarrAddress = assertSandbox();
|
|
const debug = true;
|
|
const DBpassword = Deno.env.get("DOLI_DB_PASSWORD") || "undefined";
|
|
const adminCredentials = {
|
|
username: Deno.env.get("DOLI_ADMIN_LOGIN") || "undefined",
|
|
password: Deno.env.get("DOLI_ADMIN_PASSWORD") || "undefined",
|
|
};
|
|
|
|
const rootFolderPath = Deno.env.get("ROOT_FOLDER") ||
|
|
"/Users/gabrielradureau/Work/Arcodange/erp";
|
|
const imgFolderPath = Deno.env.get("IMG_FOLDER") ||
|
|
path.join(rootFolderPath, "static/img");
|
|
const configFolderPath = Deno.env.get("CONFIG_FOLDER") ||
|
|
path.join(rootFolderPath, "static/config");
|
|
|
|
const browser = await chromium.launch({
|
|
headless: false,
|
|
logger: {
|
|
isEnabled: (_name, _severity) => debug,
|
|
log: (name, severity, message, args) =>
|
|
console.warn(`${severity}| ${name} :: ${message} __ ${args}`),
|
|
},
|
|
});
|
|
const context = await browser.newContext({ locale: "fr-FR" });
|
|
const page = await context.newPage();
|
|
|
|
const globalCtx = {
|
|
dolibarrAddress,
|
|
DBpassword,
|
|
adminCredentials,
|
|
|
|
debug,
|
|
rootFolderPath,
|
|
imgFolderPath,
|
|
configFolderPath,
|
|
|
|
browser,
|
|
page,
|
|
context,
|
|
};
|
|
|
|
// if (!await initialSetup.isUpgradeLocked(globalCtx)) {
|
|
// await initialSetup.doFirstInstall(globalCtx);
|
|
// } else {
|
|
// console.log("Installation et Mises à jours bloquée par fichier .lock.");
|
|
// }
|
|
|
|
// await login.doAdminLogin(globalCtx);
|
|
// console.log(`connected as ${await login.whoAmI(globalCtx)}`);
|
|
|
|
// const company = JSON.parse(
|
|
// await Deno.readTextFile(
|
|
// path.join(globalCtx.configFolderPath, "company.json"),
|
|
// ),
|
|
// ) as Company;
|
|
|
|
// await companySetup.setupCompany(globalCtx, company);
|
|
|
|
try {
|
|
// await displaySetup.setupDisplay(globalCtx);
|
|
await moduleSetup.configureModule(globalCtx, {moduleName: 'TIERS' , enabled: true, onConfiguration: async () => {
|
|
await globalCtx.page.screenshot({path: 'save.png'})
|
|
}});
|
|
} catch (error) {
|
|
console.error(error);
|
|
}
|
|
|
|
// await browser.close();
|