@roomi-fields/grillhouse 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +769 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/bin/grillhouse.mjs +79 -18
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +24 -0
- package/dist/temporal/acte.d.ts +24 -0
- package/dist/temporal/acte.js +139 -0
- package/dist/temporal/acte.js.map +1 -0
- package/dist/temporal/attributs.d.ts +6 -0
- package/dist/temporal/attributs.js +15 -0
- package/dist/temporal/attributs.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +13 -0
- package/dist/temporal/circuit/activites.js +33 -0
- package/dist/temporal/circuit/activites.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +72 -0
- package/dist/temporal/circuit/client.js +247 -0
- package/dist/temporal/circuit/client.js.map +1 -0
- package/dist/temporal/circuit/commande.d.ts +2 -0
- package/dist/temporal/circuit/commande.js +238 -0
- package/dist/temporal/circuit/commande.js.map +1 -0
- package/dist/temporal/circuit/contrat.d.ts +305 -0
- package/dist/temporal/circuit/contrat.js +30 -0
- package/dist/temporal/circuit/contrat.js.map +1 -0
- package/dist/temporal/circuit/deroule.d.ts +3 -0
- package/dist/temporal/circuit/deroule.js +540 -0
- package/dist/temporal/circuit/deroule.js.map +1 -0
- package/dist/temporal/client.d.ts +47 -0
- package/dist/temporal/client.js +69 -0
- package/dist/temporal/client.js.map +1 -0
- package/dist/temporal/commande.d.ts +2 -0
- package/dist/temporal/commande.js +94 -0
- package/dist/temporal/commande.js.map +1 -0
- package/dist/temporal/deroules.d.ts +5 -0
- package/dist/temporal/deroules.js +10 -0
- package/dist/temporal/deroules.js.map +1 -0
- package/dist/temporal/etat.d.ts +33 -0
- package/dist/temporal/etat.js +59 -0
- package/dist/temporal/etat.js.map +1 -0
- package/dist/temporal/file/activites.d.ts +10 -0
- package/dist/temporal/file/activites.js +25 -0
- package/dist/temporal/file/activites.js.map +1 -0
- package/dist/temporal/file/client.d.ts +4 -0
- package/dist/temporal/file/client.js +6 -0
- package/dist/temporal/file/client.js.map +1 -0
- package/dist/temporal/file/contrat.d.ts +158 -0
- package/dist/temporal/file/contrat.js +14 -0
- package/dist/temporal/file/contrat.js.map +1 -0
- package/dist/temporal/file/deroule.d.ts +15 -0
- package/dist/temporal/file/deroule.js +235 -0
- package/dist/temporal/file/deroule.js.map +1 -0
- package/dist/temporal/installation.d.ts +120 -0
- package/dist/temporal/installation.js +386 -0
- package/dist/temporal/installation.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +13 -0
- package/dist/temporal/places/activites.js.map +1 -0
- package/dist/temporal/places/client.d.ts +28 -0
- package/dist/temporal/places/client.js +64 -0
- package/dist/temporal/places/client.js.map +1 -0
- package/dist/temporal/places/contrat.d.ts +106 -0
- package/dist/temporal/places/contrat.js +21 -0
- package/dist/temporal/places/contrat.js.map +1 -0
- package/dist/temporal/places/deroule.d.ts +3 -0
- package/dist/temporal/places/deroule.js +198 -0
- package/dist/temporal/places/deroule.js.map +1 -0
- package/dist/temporal/sonde/activites.d.ts +6 -0
- package/dist/temporal/sonde/activites.js +52 -0
- package/dist/temporal/sonde/activites.js.map +1 -0
- package/dist/temporal/sonde/contrat.d.ts +35 -0
- package/dist/temporal/sonde/contrat.js +10 -0
- package/dist/temporal/sonde/contrat.js.map +1 -0
- package/dist/temporal/sonde/deroule.d.ts +3 -0
- package/dist/temporal/sonde/deroule.js +39 -0
- package/dist/temporal/sonde/deroule.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +7 -0
- package/dist/temporal/tickets/activites.js +81 -0
- package/dist/temporal/tickets/activites.js.map +1 -0
- package/dist/temporal/tickets/client.d.ts +10 -0
- package/dist/temporal/tickets/client.js +31 -0
- package/dist/temporal/tickets/client.js.map +1 -0
- package/dist/temporal/tickets/contrat.d.ts +56 -0
- package/dist/temporal/tickets/contrat.js +13 -0
- package/dist/temporal/tickets/contrat.js.map +1 -0
- package/dist/temporal/tickets/deroule.d.ts +3 -0
- package/dist/temporal/tickets/deroule.js +94 -0
- package/dist/temporal/tickets/deroule.js.map +1 -0
- package/dist/temporal/travailleur.d.ts +2 -0
- package/dist/temporal/travailleur.js +69 -0
- package/dist/temporal/travailleur.js.map +1 -0
- package/docs/ARCHITECTURE.md +646 -87
- package/docs/CADRE.md +27 -0
- package/docs/INTERFACE.md +139 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2255 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +40 -14
- package/scripts/avancement.mjs +155 -26
- package/scripts/bilan.mjs +137 -43
- package/scripts/cadre.mjs +16 -4
- package/scripts/circuit.mjs +993 -4075
- package/scripts/circuits-cles.d.mts +4 -0
- package/scripts/circuits-cles.mjs +21 -0
- package/scripts/circuits-du-serveur.mjs +105 -0
- package/scripts/codes-de-sortie.mjs +9 -0
- package/scripts/commandes-composees.mjs +45 -41
- package/scripts/commandes-du-path.d.mts +7 -0
- package/scripts/commandes-du-path.mjs +25 -0
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +18 -12
- package/scripts/conformite.mjs +56 -28
- package/scripts/copies-finies.mjs +52 -47
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +121 -0
- package/scripts/dernier-vert.mjs +61 -34
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +244 -0
- package/scripts/droits.mjs +51 -16
- package/scripts/effets.mjs +352 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +259 -55
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
- package/scripts/etapes.mjs +5 -2
- package/scripts/faits-du-circuit.mjs +493 -0
- package/scripts/file-des-tickets.d.mts +21 -0
- package/scripts/file-des-tickets.mjs +58 -0
- package/scripts/flux-des-paquets.mjs +201 -0
- package/scripts/gardes-du-cadre.mjs +21 -5
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +544 -434
- package/scripts/integration/integrer.mjs +87 -43
- package/scripts/integration/rejeu.mjs +45 -13
- package/scripts/jointure.d.ts +151 -28
- package/scripts/langages/cargo/commandes.mjs +383 -124
- package/scripts/langages/cargo/composants.mjs +154 -42
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +22 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +218 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +28 -8
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +66 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +50 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
- package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
- package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
- package/scripts/langages/typescript/tests.mjs +40 -15
- package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
- package/scripts/langages/typescript/verdict.mjs +4 -2
- package/scripts/langages/typescript/verifier.mjs +58 -20
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +12 -6
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +25 -3
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +18 -8
- package/scripts/paquet-npm.mjs +157 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +46 -10
- package/scripts/passe-de-la-machine.mjs +71 -0
- package/scripts/places-de-la-machine.mjs +414 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +25 -8
- package/scripts/registre.mjs +9 -4
- package/scripts/regles-des-places.d.mts +36 -0
- package/scripts/regles-des-places.mjs +70 -0
- package/scripts/reponses-du-circuit.d.mts +6 -0
- package/scripts/reponses-du-circuit.mjs +28 -0
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +112 -46
- package/scripts/retirer-les-copies-finies.mjs +25 -0
- package/scripts/sans-reponse.d.mts +4 -0
- package/scripts/sans-reponse.mjs +13 -0
- package/scripts/seances.mjs +936 -0
- package/scripts/services-du-noyau.mjs +27 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +41 -10
- package/scripts/style-a-l-ecriture.mjs +260 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +180 -117
- package/scripts/taches-du-graphe.mjs +348 -0
- package/scripts/ticket-du-circuit.mjs +216 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +1018 -0
- package/scripts/verrou-de-fichier.mjs +8 -4
- package/scripts/verrou-de-machine.mjs +150 -51
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/explorateur/SKILL.md +9 -2
- package/skills/grill/SKILL.md +1 -1
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +17 -18
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +5 -3
- package/skills/testwriter/SKILL.md +49 -31
- package/scripts/demon.mjs +0 -251
- package/scripts/integration/file-attente.mjs +0 -61
- package/scripts/langages/cargo/touches.mjs +0 -93
- package/scripts/langages/typescript/script-des-tests.mjs +0 -6
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
// The installation of the account's Temporal (`grillhouse temporal installer`): the program
|
|
2
|
+
// `temporal` at its pinned version, its archive checked against its pinned sum, laid down under
|
|
3
|
+
// ~/.cache/grillhouse/temporal/<version>/temporal; the units of the account's systemd (the server,
|
|
4
|
+
// the worker of the project, the worker of the machine), each started again by systemd; the
|
|
5
|
+
// worker's unit gets `Environment=TEMPORAL=<the program laid down>`, the package.json untouched.
|
|
6
|
+
//
|
|
7
|
+
// - The pin (EPINGLE) is the version of the program and the SHA-256 of the archive of each
|
|
8
|
+
// platform, as its release publishes them (checksums.txt); an archive whose sum differs is
|
|
9
|
+
// refused before anything is laid down, the expected and the read sums named.
|
|
10
|
+
// - The server is Temporal's development server (`temporal server start-dev`), on the loopback
|
|
11
|
+
// only, its state in a file of the machine (~/.local/share/grillhouse/temporal/temporal.db), the
|
|
12
|
+
// frame's search attributes registered, its web interface on Temporal's port plus 1000. Its
|
|
13
|
+
// namespace `default` keeps a closed workflow 30 days (RETENTION), set at each start of the
|
|
14
|
+
// unit once the server answers (`temporal operator namespace update --retention`), where
|
|
15
|
+
// start-dev gives 24 h: a circuit stopped on a Friday reopens from its state on the Monday.
|
|
16
|
+
// - Each worker runs the frame's worker (dist/temporal/travailleur.js) on its task queue:
|
|
17
|
+
// `grillhouse-projet-<projet>` for the project's, `grillhouse-machine` for the machine's. A
|
|
18
|
+
// project that names its version of the frame (`grillhouse.outil`, scripts/aiguillage.mjs) runs
|
|
19
|
+
// the worker of that published version, installed under the cache of the home
|
|
20
|
+
// (~/.cache/grillhouse/outil/<version>/) when absent, as the circuit's command does; another, its
|
|
21
|
+
// own version (its node_modules/@roomi-fields/grillhouse), else this package.
|
|
22
|
+
// - Every refusal comes before any writing (the archive, an account's tool, a fault of
|
|
23
|
+
// `grillhouse.outils`, a published version without a worker), but the published version
|
|
24
|
+
// itself: it is laid down in its cache before its refusal, which reads it there.
|
|
25
|
+
// - A unit of systemd starts with a bare PATH: each worker's unit names the PATH of the account's
|
|
26
|
+
// tools a circuit runs (node, npm, claude, bd, gh), found in the installer's PATH, and the tools
|
|
27
|
+
// of the project (`grillhouse.outils`), each its variable; a tool of the account not found is
|
|
28
|
+
// refused by its name before anything is written.
|
|
29
|
+
// - Played again on an installation up to date, it changes nothing: the program of the pinned
|
|
30
|
+
// version is not downloaded again, a unit and the package.json are written only when they
|
|
31
|
+
// differ, and systemd is told only of what it has not applied yet (daemon-reload, enable,
|
|
32
|
+
// restart of those units). What systemd applied is kept apart from what is written: the sum of
|
|
33
|
+
// each unit's text once systemctl succeeded (~/.local/state/grillhouse/temporal/
|
|
34
|
+
// unites-appliquees.json), so that a systemctl that failed is played again at the next run.
|
|
35
|
+
// - `poserLeProgramme` lays down the program alone, no unit, no package.json, no systemd: the mode
|
|
36
|
+
// `--programme-seul` of the command, by which the night gets the pinned program as a user does.
|
|
37
|
+
// - The home, the directory of the units and the project are parameters (`lieuxDe`), as systemctl,
|
|
38
|
+
// the download, the published version and the account's tools are: a test installs under a
|
|
39
|
+
// trial home, never in the account's systemd.
|
|
40
|
+
import { spawnSync } from 'node:child_process';
|
|
41
|
+
import { createHash } from 'node:crypto';
|
|
42
|
+
import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync, } from 'node:fs';
|
|
43
|
+
import os from 'node:os';
|
|
44
|
+
import path from 'node:path';
|
|
45
|
+
import { fileURLToPath } from 'node:url';
|
|
46
|
+
import { cacheDesOutils, installer as installerLOutil, versionDeLOutil, } from '../../scripts/aiguillage.mjs';
|
|
47
|
+
import { trouverDansLePath } from '../../scripts/commandes-du-path.mjs';
|
|
48
|
+
import { lireOutils } from '../../scripts/outils-cles.mjs';
|
|
49
|
+
import { ATTRIBUTS_DE_RECHERCHE } from './attributs.js';
|
|
50
|
+
/** The pin: temporal 1.9.1 (Server 1.32.0), its sums from the release's checksums.txt. */
|
|
51
|
+
export const EPINGLE = {
|
|
52
|
+
version: '1.9.1',
|
|
53
|
+
sommes: {
|
|
54
|
+
linux_amd64: '09a0326a51db84d02735e53542b9ebd8c4758daf47482a9ab0abce15844e60d5',
|
|
55
|
+
linux_arm64: '6c57c352d52fc3df34412376fd9ba6f74b7e3ace8e426e6cba8600156d36a145',
|
|
56
|
+
darwin_amd64: '48cdd6c84c56e27ae8e4d9a47052b89289a9c552dee029b49dd312c6fb72873f',
|
|
57
|
+
darwin_arm64: '41e0425378fcb4fb5766340b97435e20fe47bbff2d7bf644ec2d51f7662b7c56',
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
/** The port of the account's server, Temporal's, on the loopback. */
|
|
61
|
+
const PORT_DU_SERVEUR = 7233;
|
|
62
|
+
/** How long the server keeps a closed workflow: 30 days. */
|
|
63
|
+
const RETENTION = '720h';
|
|
64
|
+
/** The account's tools a circuit runs, whose folders each worker's PATH names. */
|
|
65
|
+
const OUTILS_DU_COMPTE = ['node', 'npm', 'claude', 'bd', 'gh'];
|
|
66
|
+
// The folders of the system, after the tools' own.
|
|
67
|
+
const PATH_DU_SYSTEME = ['/usr/local/bin', '/usr/bin', '/bin'];
|
|
68
|
+
/** The unit of the server. */
|
|
69
|
+
export const UNITE_DU_SERVEUR = 'grillhouse-temporal.service';
|
|
70
|
+
/** The unit of the worker of the machine. */
|
|
71
|
+
export const UNITE_DE_LA_MACHINE = 'grillhouse-travailleur-machine.service';
|
|
72
|
+
/** The task queue of the worker of the machine. */
|
|
73
|
+
export const FILE_DE_LA_MACHINE = 'grillhouse-machine';
|
|
74
|
+
/** The platform of Node's <platform> and <arch>; refused by its name when the pin has none. */
|
|
75
|
+
export function plateformeDe(platform = process.platform, arch = process.arch) {
|
|
76
|
+
const os = { linux: 'linux', darwin: 'darwin' }[platform];
|
|
77
|
+
const a = { x64: 'amd64', arm64: 'arm64' }[arch];
|
|
78
|
+
if (!os || !a) {
|
|
79
|
+
throw new Error(`temporal : aucune archive épinglée pour ${platform} ${arch}`);
|
|
80
|
+
}
|
|
81
|
+
return `${os}_${a}`;
|
|
82
|
+
}
|
|
83
|
+
/** The URL of the archive of <version> for <plateforme>, in the project's releases. */
|
|
84
|
+
export const urlDeLArchive = (version, plateforme) => `https://github.com/temporalio/cli/releases/download/v${version}/temporal_cli_${version}_${plateforme}.tar.gz`;
|
|
85
|
+
/** The places, each from the environment when absent: $HOME, its systemd/user, the cwd. */
|
|
86
|
+
export function lieuxDe({ maison, unites, racine } = {}, env = process.env) {
|
|
87
|
+
const m = path.resolve(maison ?? env.HOME ?? os.homedir());
|
|
88
|
+
return {
|
|
89
|
+
maison: m,
|
|
90
|
+
unites: path.resolve(unites ?? path.join(m, '.config/systemd/user')),
|
|
91
|
+
racine: path.resolve(racine ?? process.cwd()),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** The program of <version> and the server's database file, under the home of <lieux>. */
|
|
95
|
+
export function cheminsDe(lieux, version) {
|
|
96
|
+
return {
|
|
97
|
+
programme: path.join(lieux.maison, '.cache/grillhouse/temporal', version, 'temporal'),
|
|
98
|
+
donnees: path.join(lieux.maison, '.local/share/grillhouse/temporal/temporal.db'),
|
|
99
|
+
appliquees: path.join(lieux.maison, '.local/state/grillhouse/temporal/unites-appliquees.json'),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// The name of the project at <racine>, for a unit and a task queue: its package's name, else its
|
|
103
|
+
// directory's, in lower case letters, digits and dashes.
|
|
104
|
+
function nomDuProjet(racine) {
|
|
105
|
+
let nom = path.basename(racine);
|
|
106
|
+
try {
|
|
107
|
+
const n = JSON.parse(readFileSync(path.join(racine, 'package.json'), 'utf8')).name;
|
|
108
|
+
if (typeof n === 'string' && n) {
|
|
109
|
+
nom = n;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// no package.json: the directory's name
|
|
114
|
+
}
|
|
115
|
+
return nom
|
|
116
|
+
.toLowerCase()
|
|
117
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
118
|
+
.replace(/^-+|-+$/g, '');
|
|
119
|
+
}
|
|
120
|
+
/** The unit of the worker of the project at <racine>. */
|
|
121
|
+
export const uniteDuProjet = (racine) => `grillhouse-travailleur-${nomDuProjet(racine)}.service`;
|
|
122
|
+
/** The task queue of the worker of the project at <racine>. */
|
|
123
|
+
export const fileDuProjet = (racine) => `grillhouse-projet-${nomDuProjet(racine)}`;
|
|
124
|
+
/** The three units, in their order: the server, the worker of the project, the machine's. */
|
|
125
|
+
export const unitesDe = (racine) => [
|
|
126
|
+
UNITE_DU_SERVEUR,
|
|
127
|
+
uniteDuProjet(racine),
|
|
128
|
+
UNITE_DE_LA_MACHINE,
|
|
129
|
+
];
|
|
130
|
+
// An argument of ExecStart, quoted as systemd reads it when it holds a space or a quote.
|
|
131
|
+
const arg = (s) => (/[\s"\\]/.test(s) ? `"${s.replace(/["\\]/g, c => `\\${c}`)}"` : s);
|
|
132
|
+
/** The text of each unit of the account, by its file's name. */
|
|
133
|
+
export function textesDesUnites(lieux, { version, node, travailleur, chemin, outils }) {
|
|
134
|
+
const { programme, donnees } = cheminsDe(lieux, version);
|
|
135
|
+
const serveur = [
|
|
136
|
+
programme,
|
|
137
|
+
'server',
|
|
138
|
+
'start-dev',
|
|
139
|
+
'--db-filename',
|
|
140
|
+
donnees,
|
|
141
|
+
'--ip',
|
|
142
|
+
'127.0.0.1',
|
|
143
|
+
'--port',
|
|
144
|
+
String(PORT_DU_SERVEUR),
|
|
145
|
+
'--ui-port',
|
|
146
|
+
String(PORT_DU_SERVEUR + 1000),
|
|
147
|
+
...Object.entries(ATTRIBUTS_DE_RECHERCHE).flatMap(([k, t]) => [
|
|
148
|
+
'--search-attribute',
|
|
149
|
+
`${k}=${t}`,
|
|
150
|
+
]),
|
|
151
|
+
];
|
|
152
|
+
// The retention set once the server answers, tried every second for 60 s; `$$` is systemd's `$`.
|
|
153
|
+
const retenir = [
|
|
154
|
+
'i=0; until',
|
|
155
|
+
`'${programme}' operator namespace update --namespace default --retention ${RETENTION}`,
|
|
156
|
+
`--address 127.0.0.1:${PORT_DU_SERVEUR} >/dev/null;`,
|
|
157
|
+
'do i=$$((i+1)); [ $$i -ge 60 ] && exit 1; sleep 1; done',
|
|
158
|
+
].join(' ');
|
|
159
|
+
const service = (description, lignes, apres = []) => [
|
|
160
|
+
'[Unit]',
|
|
161
|
+
`Description=${description}`,
|
|
162
|
+
...apres,
|
|
163
|
+
'',
|
|
164
|
+
'[Service]',
|
|
165
|
+
...lignes,
|
|
166
|
+
'Restart=always',
|
|
167
|
+
'RestartSec=5',
|
|
168
|
+
'',
|
|
169
|
+
'[Install]',
|
|
170
|
+
'WantedBy=default.target',
|
|
171
|
+
'',
|
|
172
|
+
].join('\n');
|
|
173
|
+
const apres = [`After=${UNITE_DU_SERVEUR}`, `Wants=${UNITE_DU_SERVEUR}`];
|
|
174
|
+
const travailleurSur = (file) => [
|
|
175
|
+
`WorkingDirectory=${arg(lieux.racine)}`,
|
|
176
|
+
`Environment=TEMPORAL_ADDRESS=127.0.0.1:${PORT_DU_SERVEUR}`,
|
|
177
|
+
`Environment=${arg(`PATH=${chemin}`)}`,
|
|
178
|
+
...Object.entries(outils).map(([k, v]) => `Environment=${arg(`${k}=${v}`)}`),
|
|
179
|
+
`ExecStart=${[node, travailleur, '--file', file].map(arg).join(' ')}`,
|
|
180
|
+
];
|
|
181
|
+
return {
|
|
182
|
+
[UNITE_DU_SERVEUR]: service(`Grillhouse : le serveur Temporal du compte (temporal ${version})`, [`ExecStart=${serveur.map(arg).join(' ')}`, `ExecStartPost=/bin/sh -c ${arg(retenir)}`]),
|
|
183
|
+
[uniteDuProjet(lieux.racine)]: service(`Grillhouse : le travailleur du projet ${nomDuProjet(lieux.racine)}`, travailleurSur(fileDuProjet(lieux.racine)), apres),
|
|
184
|
+
[UNITE_DE_LA_MACHINE]: service('Grillhouse : le travailleur de la machine', travailleurSur(FILE_DE_LA_MACHINE), apres),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/** The package that runs: two levels above this module, in src/ as in dist/. */
|
|
188
|
+
const PAQUET = fileURLToPath(new URL('../..', import.meta.url));
|
|
189
|
+
const TRAVAILLEUR = 'dist/temporal/travailleur.js';
|
|
190
|
+
/**
|
|
191
|
+
* The frame's worker of the project at <racine>: that of the published version it names, laid down
|
|
192
|
+
* by <outil> (its folder), refused when that version carries none; else its own version of the
|
|
193
|
+
* frame, else this one.
|
|
194
|
+
*/
|
|
195
|
+
export function travailleurDe(racine, outil) {
|
|
196
|
+
const version = versionDeLOutil(racine);
|
|
197
|
+
if (version !== null) {
|
|
198
|
+
const f = path.join(outil(version), 'node_modules/@roomi-fields/grillhouse', TRAVAILLEUR);
|
|
199
|
+
if (!existsSync(f)) {
|
|
200
|
+
throw new Error(`temporal : @roomi-fields/grillhouse@${version}, la version que nomme grillhouse.outil, ne porte pas de travailleur (${TRAVAILLEUR}).`);
|
|
201
|
+
}
|
|
202
|
+
return f;
|
|
203
|
+
}
|
|
204
|
+
const local = path.join(racine, 'node_modules/@roomi-fields/grillhouse');
|
|
205
|
+
return path.join(existsSync(local) ? realpathSync(local) : PAQUET, TRAVAILLEUR);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* The PATH of each worker's unit: the folder of Node <node>, then those of the account's tools
|
|
209
|
+
* <trouver> finds, then the system's; a tool not found refused by its name.
|
|
210
|
+
*/
|
|
211
|
+
export function cheminDesUnites(node, trouver) {
|
|
212
|
+
const dossiers = [path.dirname(node)];
|
|
213
|
+
for (const nom of OUTILS_DU_COMPTE) {
|
|
214
|
+
const f = trouver(nom);
|
|
215
|
+
if (!f) {
|
|
216
|
+
throw new Error(`temporal : l'outil ${nom} est introuvable dans PATH ; un circuit le lance, et l'unité de son travailleur le nomme.`);
|
|
217
|
+
}
|
|
218
|
+
dossiers.push(path.dirname(f));
|
|
219
|
+
}
|
|
220
|
+
return [...new Set([...dossiers, ...PATH_DU_SYSTEME])].join(':');
|
|
221
|
+
}
|
|
222
|
+
/** The account's systemctl, by the program <programme>. */
|
|
223
|
+
export const systemctlDuCompte = (programme = 'systemctl') => args => {
|
|
224
|
+
const r = spawnSync(programme, ['--user', ...args], { encoding: 'utf8' });
|
|
225
|
+
return { status: r.status, stdout: r.stdout ?? '', stderr: r.stderr ?? r.error?.message ?? '' };
|
|
226
|
+
};
|
|
227
|
+
/** The refusal of an archive whose sum differs from the pinned one. */
|
|
228
|
+
export class SommeRefusee extends Error {
|
|
229
|
+
url;
|
|
230
|
+
attendue;
|
|
231
|
+
lue;
|
|
232
|
+
constructor(url, attendue, lue) {
|
|
233
|
+
super(`temporal : l'archive ${url} est refusée : somme attendue ${attendue}, lue ${lue} ; rien n'est posé.`);
|
|
234
|
+
this.url = url;
|
|
235
|
+
this.attendue = attendue;
|
|
236
|
+
this.lue = lue;
|
|
237
|
+
this.name = 'SommeRefusee';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/** Downloads <url>, its redirections followed. */
|
|
241
|
+
async function telecharger(url) {
|
|
242
|
+
const r = await fetch(url);
|
|
243
|
+
if (!r.ok) {
|
|
244
|
+
throw new Error(`temporal : ${url} répond ${r.status}`);
|
|
245
|
+
}
|
|
246
|
+
return Buffer.from(await r.arrayBuffer());
|
|
247
|
+
}
|
|
248
|
+
// Lays down the program `temporal` of the archive <contenu> as <programme>: extracted under a
|
|
249
|
+
// directory beside its own, then renamed into its own, so that a broken extraction lays nothing.
|
|
250
|
+
function poser(contenu, programme) {
|
|
251
|
+
const dossier = path.dirname(programme);
|
|
252
|
+
const parent = path.dirname(dossier);
|
|
253
|
+
mkdirSync(parent, { recursive: true });
|
|
254
|
+
const tmp = mkdtempSync(path.join(parent, `.${path.basename(dossier)}-`));
|
|
255
|
+
try {
|
|
256
|
+
const archive = path.join(tmp, 'archive.tar.gz');
|
|
257
|
+
writeFileSync(archive, contenu);
|
|
258
|
+
const r = spawnSync('tar', ['-xzf', archive, '-C', tmp, 'temporal'], { encoding: 'utf8' });
|
|
259
|
+
if (r.status !== 0) {
|
|
260
|
+
throw new Error(`temporal : tar refuse l'archive : ${r.stderr ?? r.error?.message}`);
|
|
261
|
+
}
|
|
262
|
+
rmSync(archive);
|
|
263
|
+
chmodSync(path.join(tmp, 'temporal'), 0o755);
|
|
264
|
+
rmSync(dossier, { recursive: true, force: true });
|
|
265
|
+
renameSync(tmp, dossier);
|
|
266
|
+
}
|
|
267
|
+
finally {
|
|
268
|
+
rmSync(tmp, { recursive: true, force: true });
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// systemctl <args>, refused by its output when it fails.
|
|
272
|
+
function systemd(systemctl, args) {
|
|
273
|
+
const r = systemctl(args);
|
|
274
|
+
if (r.status !== 0) {
|
|
275
|
+
throw new Error(`temporal : systemctl --user ${args.join(' ')} échoue (${r.status}) : ${r.stderr.trim()}`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The archive of the program `temporal` of the pin, checked against its pinned sum, nothing laid
|
|
280
|
+
* down: its content, or null when the program lies at the places <lieux> already.
|
|
281
|
+
*/
|
|
282
|
+
async function obtenirLeProgramme({ lieux, epingle = EPINGLE, plateforme = plateformeDe(), obtenir = telecharger, }) {
|
|
283
|
+
const { programme } = cheminsDe(lieux, epingle.version);
|
|
284
|
+
if (existsSync(programme)) {
|
|
285
|
+
return { programme, contenu: null };
|
|
286
|
+
}
|
|
287
|
+
const attendue = epingle.sommes[plateforme];
|
|
288
|
+
if (!attendue) {
|
|
289
|
+
throw new Error(`temporal : aucune somme épinglée pour ${plateforme}`);
|
|
290
|
+
}
|
|
291
|
+
const url = urlDeLArchive(epingle.version, plateforme);
|
|
292
|
+
const contenu = await obtenir(url);
|
|
293
|
+
const lue = createHash('sha256').update(contenu).digest('hex');
|
|
294
|
+
if (lue !== attendue) {
|
|
295
|
+
throw new SommeRefusee(url, attendue, lue);
|
|
296
|
+
}
|
|
297
|
+
return { programme, contenu };
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Lays down the program `temporal` of the pin at the places <lieux>, its archive checked against
|
|
301
|
+
* its pinned sum, unless it lies there already; whether it laid it down.
|
|
302
|
+
*/
|
|
303
|
+
export async function poserLeProgramme(options) {
|
|
304
|
+
const { programme, contenu } = await obtenirLeProgramme(options);
|
|
305
|
+
if (contenu) {
|
|
306
|
+
poser(contenu, programme);
|
|
307
|
+
}
|
|
308
|
+
return { programme, pose: contenu !== null };
|
|
309
|
+
}
|
|
310
|
+
const sommeDe = (texte) => createHash('sha256').update(texte).digest('hex');
|
|
311
|
+
// The sum of each unit's text that systemd applied, from the file <f>; none without it.
|
|
312
|
+
function lireLesAppliquees(f) {
|
|
313
|
+
try {
|
|
314
|
+
return JSON.parse(readFileSync(f, 'utf8'));
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
return {};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/** Installs the account's Temporal at the places <lieux> (see the header). */
|
|
321
|
+
export async function installer({ lieux, systemctl, epingle = EPINGLE, plateforme = plateformeDe(), obtenir = telecharger, node = process.execPath, outil = v => installerLOutil(v, { cache: cacheDesOutils(lieux.maison) }).dossier, travailleur, trouver = nom => trouverDansLePath(nom), }) {
|
|
322
|
+
const { donnees, appliquees: fichierDesAppliquees } = cheminsDe(lieux, epingle.version);
|
|
323
|
+
// Every refusal before any writing: the archive, the account's tools, the project's tools , then the worker of the published version, which lays that
|
|
324
|
+
// version down in its cache first.
|
|
325
|
+
const { programme, contenu } = await obtenirLeProgramme({ lieux, epingle, plateforme, obtenir });
|
|
326
|
+
const chemin = cheminDesUnites(node, trouver);
|
|
327
|
+
const pkg = JSON.parse(readFileSync(path.join(lieux.racine, 'package.json'), 'utf8'));
|
|
328
|
+
// The tools as written, without a TEMPORAL key left in the package.json: the worker's unit takes
|
|
329
|
+
// the program laid down. A faulty value is refused as it is written.
|
|
330
|
+
const brut = pkg.grillhouse?.outils;
|
|
331
|
+
const { outils: lus, fautes } = lireOutils({
|
|
332
|
+
...pkg,
|
|
333
|
+
grillhouse: {
|
|
334
|
+
...pkg.grillhouse,
|
|
335
|
+
outils: brut !== null && typeof brut === 'object' && !Array.isArray(brut)
|
|
336
|
+
? Object.fromEntries(Object.entries(brut).filter(([k]) => k !== 'TEMPORAL'))
|
|
337
|
+
: brut,
|
|
338
|
+
},
|
|
339
|
+
}, { maison: lieux.maison, existe: p => existsSync(p) });
|
|
340
|
+
const outils = { ...lus, TEMPORAL: programme };
|
|
341
|
+
if (fautes.length) {
|
|
342
|
+
throw new Error(`temporal : ${fautes.join(' ; ')}`);
|
|
343
|
+
}
|
|
344
|
+
const leTravailleur = travailleur ?? travailleurDe(lieux.racine, outil);
|
|
345
|
+
const pose = contenu !== null;
|
|
346
|
+
if (contenu) {
|
|
347
|
+
poser(contenu, programme);
|
|
348
|
+
}
|
|
349
|
+
mkdirSync(path.dirname(donnees), { recursive: true });
|
|
350
|
+
const textes = textesDesUnites(lieux, {
|
|
351
|
+
version: epingle.version,
|
|
352
|
+
node,
|
|
353
|
+
travailleur: leTravailleur,
|
|
354
|
+
chemin,
|
|
355
|
+
outils,
|
|
356
|
+
});
|
|
357
|
+
const unites = [];
|
|
358
|
+
for (const [nom, texte] of Object.entries(textes)) {
|
|
359
|
+
const f = path.join(lieux.unites, nom);
|
|
360
|
+
if (existsSync(f) && readFileSync(f, 'utf8') === texte) {
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
mkdirSync(lieux.unites, { recursive: true });
|
|
364
|
+
writeFileSync(f, texte);
|
|
365
|
+
unites.push(nom);
|
|
366
|
+
}
|
|
367
|
+
const deja = lireLesAppliquees(fichierDesAppliquees);
|
|
368
|
+
const enAttente = Object.keys(textes).filter(n => deja[n] !== sommeDe(textes[n]));
|
|
369
|
+
const appliquees = pose ? unitesDe(lieux.racine) : enAttente;
|
|
370
|
+
if (appliquees.length) {
|
|
371
|
+
systemd(systemctl, ['daemon-reload']);
|
|
372
|
+
systemd(systemctl, ['enable', ...unitesDe(lieux.racine)]);
|
|
373
|
+
systemd(systemctl, ['restart', ...appliquees]);
|
|
374
|
+
mkdirSync(path.dirname(fichierDesAppliquees), { recursive: true });
|
|
375
|
+
const sommes = Object.fromEntries(Object.entries(textes).map(([n, t]) => [n, sommeDe(t)]));
|
|
376
|
+
writeFileSync(fichierDesAppliquees, `${JSON.stringify(sommes, null, 2)}\n`);
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
programme,
|
|
380
|
+
pose,
|
|
381
|
+
unites,
|
|
382
|
+
appliquees,
|
|
383
|
+
change: pose || unites.length > 0 || appliquees.length > 0,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
//# sourceMappingURL=installation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../src/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MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,SAAS,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;QACtC,OAAO,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;QAC/C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3F,aAAa,CAAC,oBAAoB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO;QACL,SAAS;QACT,IAAI;QACJ,MAAM;QACN,UAAU;QACV,MAAM,EAAE,IAAI,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Mesure } from './contrat.js';
|
|
2
|
+
/** The machine now. */
|
|
3
|
+
export declare function mesurerLaMachine(): Promise<Mesure>;
|
|
4
|
+
/** For each process, whether it lives and is the one of its start. */
|
|
5
|
+
export declare function processusVivants(processus: {
|
|
6
|
+
pid: number;
|
|
7
|
+
depart: string | null;
|
|
8
|
+
}[]): Promise<boolean[]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The activities of the workflow of the machine: what the machine gives now (its cores, its load,
|
|
2
|
+
// its free memory) and whether the process of each place still lives, both read by
|
|
3
|
+
// scripts/mesure-de-la-machine.mjs.
|
|
4
|
+
import { mesureDeLaMachine, processusVivant } from '../../../scripts/mesure-de-la-machine.mjs';
|
|
5
|
+
/** The machine now. */
|
|
6
|
+
export async function mesurerLaMachine() {
|
|
7
|
+
return Promise.resolve(mesureDeLaMachine());
|
|
8
|
+
}
|
|
9
|
+
/** For each process, whether it lives and is the one of its start. */
|
|
10
|
+
export async function processusVivants(processus) {
|
|
11
|
+
return Promise.resolve(processus.map(p => processusVivant(p)));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=activites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activites.js","sourceRoot":"","sources":["../../../src/temporal/places/activites.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,mFAAmF;AACnF,oCAAoC;AACpC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAG/F,uBAAuB;AACvB,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,SAAmD;IAEnD,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Client } from '@temporalio/client';
|
|
2
|
+
import { type DemandeDePlace, type EntreeDesPlaces, type PlaceDonnee, type VueDesPlaces } from './contrat.js';
|
|
3
|
+
/** Starts the workflow of the machine on <file>, or leaves the one that runs. */
|
|
4
|
+
export declare function demarrerLesPlaces(client: Client, entree: EntreeDesPlaces, { file, id }?: {
|
|
5
|
+
file?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Takes a place of the machine for <demande>: records the request under an id of its own, then
|
|
10
|
+
* reads it every <veilleMs> ms until the place is given. A request withdrawn, or whose process is
|
|
11
|
+
* gone, fails; <signal> aborted withdraws it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function prendreUnePlaceParTemporal(client: Client, demande: Omit<DemandeDePlace, 'id'>, { id, veilleMs, signal, }?: {
|
|
14
|
+
id?: string;
|
|
15
|
+
veilleMs?: number;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}): Promise<PlaceDonnee>;
|
|
18
|
+
/** The next rank of arrival of the machine, drawn at the launch of a circuit, which keeps it. */
|
|
19
|
+
export declare function tirerUnRangParTemporal(client: Client, id?: string): Promise<number>;
|
|
20
|
+
/** Gives the place <place> back, or withdraws the request <place> that waits. */
|
|
21
|
+
export declare function rendreLaPlace(client: Client, place: string, id?: string): Promise<void>;
|
|
22
|
+
/** Names <processus>, the process that now holds the place <place>. */
|
|
23
|
+
export declare function rattacherLaPlace(client: Client, place: string, processus: {
|
|
24
|
+
pid: number;
|
|
25
|
+
depart: string | null;
|
|
26
|
+
}, id?: string): Promise<void>;
|
|
27
|
+
/** The places of the machine as the board shows them: the ceiling, the places, the waits. */
|
|
28
|
+
export declare function lireLesPlaces(client: Client, id?: string): Promise<VueDesPlaces>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// The client of the workflow of the machine (./deroule.ts): it starts the one workflow of the
|
|
2
|
+
// machine if it does not run, takes a place (the update PRENDRE records the request, then the
|
|
3
|
+
// query LA_DEMANDE tells once it is given), gives it back or withdraws the request (the signal
|
|
4
|
+
// RENDRE), names the process that holds it (the signal RATTACHER), and reads the places as the
|
|
5
|
+
// board shows them (the query LES_PLACES), from the server and the worker of the machine.
|
|
6
|
+
import { randomUUID } from 'node:crypto';
|
|
7
|
+
import { setTimeout as dormir } from 'node:timers/promises';
|
|
8
|
+
import { FILE_DE_LA_MACHINE } from '../installation.js';
|
|
9
|
+
import { ID_DES_PLACES, LA_DEMANDE, LES_PLACES, PLACES, PRENDRE, RATTACHER, RENDRE, TIRER_UN_RANG, } from './contrat.js';
|
|
10
|
+
/** Starts the workflow of the machine on <file>, or leaves the one that runs. */
|
|
11
|
+
export async function demarrerLesPlaces(client, entree, { file = FILE_DE_LA_MACHINE, id = ID_DES_PLACES } = {}) {
|
|
12
|
+
await client.workflow.start(PLACES, {
|
|
13
|
+
workflowId: id,
|
|
14
|
+
taskQueue: file,
|
|
15
|
+
args: [entree],
|
|
16
|
+
workflowIdConflictPolicy: 'USE_EXISTING',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Takes a place of the machine for <demande>: records the request under an id of its own, then
|
|
21
|
+
* reads it every <veilleMs> ms until the place is given. A request withdrawn, or whose process is
|
|
22
|
+
* gone, fails; <signal> aborted withdraws it.
|
|
23
|
+
*/
|
|
24
|
+
export async function prendreUnePlaceParTemporal(client, demande, { id = ID_DES_PLACES, veilleMs = 250, signal, } = {}) {
|
|
25
|
+
const h = client.workflow.getHandle(id);
|
|
26
|
+
const place = randomUUID();
|
|
27
|
+
const { rang } = await h.executeUpdate(PRENDRE, {
|
|
28
|
+
args: [{ ...demande, id: place }],
|
|
29
|
+
updateId: place,
|
|
30
|
+
});
|
|
31
|
+
for (;;) {
|
|
32
|
+
if (signal?.aborted) {
|
|
33
|
+
await rendreLaPlace(client, place, id);
|
|
34
|
+
throw signal.reason ?? new Error(`la demande de place ${place} est retirée`);
|
|
35
|
+
}
|
|
36
|
+
const e = await h.query(LA_DEMANDE, place);
|
|
37
|
+
if (e.etat === 'donnee') {
|
|
38
|
+
return { id: place, rang };
|
|
39
|
+
}
|
|
40
|
+
if (e.etat === 'inconnue') {
|
|
41
|
+
throw new Error(`la demande de place ${place} n’est plus : retirée, ou son processus a disparu`);
|
|
42
|
+
}
|
|
43
|
+
await dormir(veilleMs);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** The next rank of arrival of the machine, drawn at the launch of a circuit, which keeps it. */
|
|
47
|
+
export async function tirerUnRangParTemporal(client, id = ID_DES_PLACES) {
|
|
48
|
+
return client.workflow.getHandle(id).executeUpdate(TIRER_UN_RANG);
|
|
49
|
+
}
|
|
50
|
+
/** Gives the place <place> back, or withdraws the request <place> that waits. */
|
|
51
|
+
export async function rendreLaPlace(client, place, id = ID_DES_PLACES) {
|
|
52
|
+
await client.workflow.getHandle(id).signal(RENDRE, place);
|
|
53
|
+
}
|
|
54
|
+
/** Names <processus>, the process that now holds the place <place>. */
|
|
55
|
+
export async function rattacherLaPlace(client, place, processus, id = ID_DES_PLACES) {
|
|
56
|
+
await client.workflow
|
|
57
|
+
.getHandle(id)
|
|
58
|
+
.signal(RATTACHER, { id: place, ...processus });
|
|
59
|
+
}
|
|
60
|
+
/** The places of the machine as the board shows them: the ceiling, the places, the waits. */
|
|
61
|
+
export async function lireLesPlaces(client, id = ID_DES_PLACES) {
|
|
62
|
+
return client.workflow.getHandle(id).query(LES_PLACES);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/temporal/places/client.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8FAA8F;AAC9F,+FAA+F;AAC/F,+FAA+F;AAC/F,0FAA0F;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,aAAa,EACb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 @@
|
|
|
1
|
+
/** The workflow's type. */
|
|
2
|
+
export declare const PLACES = "placesDeLaMachine";
|
|
3
|
+
/** The id of the one workflow of the machine. */
|
|
4
|
+
export declare const ID_DES_PLACES = "grillhouse-places-de-la-machine";
|
|
5
|
+
/** The update that asks for a place: it records the request and returns at once. */
|
|
6
|
+
export declare const PRENDRE = "prendre";
|
|
7
|
+
/** The update that draws the next rank of arrival of the machine, which a circuit keeps. */
|
|
8
|
+
export declare const TIRER_UN_RANG = "tirerUnRang";
|
|
9
|
+
/** The signal that gives a place back, or withdraws a request that waits. */
|
|
10
|
+
export declare const RENDRE = "rendre";
|
|
11
|
+
/** The signal that names the process that holds a place or a request. */
|
|
12
|
+
export declare const RATTACHER = "rattacher";
|
|
13
|
+
/** The query of the places, which the board reads. */
|
|
14
|
+
export declare const LES_PLACES = "lesPlaces";
|
|
15
|
+
/** The query of one request: given, waiting, or unknown (withdrawn, or its process gone). */
|
|
16
|
+
export declare const LA_DEMANDE = "laDemande";
|
|
17
|
+
/** A place taken. */
|
|
18
|
+
interface Prise {
|
|
19
|
+
id: string;
|
|
20
|
+
pid: number;
|
|
21
|
+
/** The start of the process (`departDe`), null when unknown. */
|
|
22
|
+
depart: string | null;
|
|
23
|
+
ticket: string | null;
|
|
24
|
+
rang: number;
|
|
25
|
+
/** The time it was taken, in ms. */
|
|
26
|
+
depuis: number;
|
|
27
|
+
}
|
|
28
|
+
/** A taking that waits, and why. */
|
|
29
|
+
interface Attente {
|
|
30
|
+
id: string;
|
|
31
|
+
pid: number;
|
|
32
|
+
depart: string | null;
|
|
33
|
+
ticket: string | null;
|
|
34
|
+
rang: number;
|
|
35
|
+
raison: string;
|
|
36
|
+
depuis: number;
|
|
37
|
+
}
|
|
38
|
+
/** The state of the places, which the workflow carries across a Continue-As-New. */
|
|
39
|
+
export interface EtatDesPlaces {
|
|
40
|
+
/** The last rank of arrival drawn. */
|
|
41
|
+
rang: number;
|
|
42
|
+
/** The time of the last start, in ms. */
|
|
43
|
+
dernier: number;
|
|
44
|
+
prises: Prise[];
|
|
45
|
+
attentes: Attente[];
|
|
46
|
+
}
|
|
47
|
+
/** What the machine gives at a moment (scripts/regles-des-places.mjs). */
|
|
48
|
+
export interface Mesure {
|
|
49
|
+
coeurs: number;
|
|
50
|
+
charge: number;
|
|
51
|
+
memoireLibre: number;
|
|
52
|
+
}
|
|
53
|
+
/** What the workflow receives. */
|
|
54
|
+
export interface EntreeDesPlaces {
|
|
55
|
+
/** The ceiling of the places (GRILLHOUSE_PLACES of the machine, 3 by default). */
|
|
56
|
+
plafond: number;
|
|
57
|
+
/** The gap between two starts, in ms (GRILLHOUSE_ESPACEMENT_MS). */
|
|
58
|
+
espacementMs: number;
|
|
59
|
+
/** How often a wait and the places taken are judged again, in ms. */
|
|
60
|
+
veilleMs: number;
|
|
61
|
+
/** The length of history past which the workflow continues as new; 2000 by default. */
|
|
62
|
+
limiteDHistoire?: number;
|
|
63
|
+
/** A machine of trial: the measure it always gives, in place of the activity's. */
|
|
64
|
+
mesureFixe?: Mesure;
|
|
65
|
+
/** The state a Continue-As-New carries. */
|
|
66
|
+
etat?: EtatDesPlaces;
|
|
67
|
+
}
|
|
68
|
+
/** A request: its id, the process that holds the place, its ticket, the rank of its circuit. */
|
|
69
|
+
export interface DemandeDePlace {
|
|
70
|
+
/** The id the caller draws; a request sent again under it is the same request. */
|
|
71
|
+
id: string;
|
|
72
|
+
pid: number;
|
|
73
|
+
depart: string | null;
|
|
74
|
+
ticket?: string | null;
|
|
75
|
+
/** The rank of arrival of the circuit; drawn by the workflow, past every rank given, when absent. */
|
|
76
|
+
rang?: number;
|
|
77
|
+
}
|
|
78
|
+
/** The place given. */
|
|
79
|
+
export interface PlaceDonnee {
|
|
80
|
+
id: string;
|
|
81
|
+
rang: number;
|
|
82
|
+
}
|
|
83
|
+
/** What the board reads: the ceiling, the places taken, the waits in their order of arrival. */
|
|
84
|
+
export interface VueDesPlaces {
|
|
85
|
+
plafond: number;
|
|
86
|
+
prises: Prise[];
|
|
87
|
+
attentes: Attente[];
|
|
88
|
+
}
|
|
89
|
+
/** Where a request stands. */
|
|
90
|
+
export type EtatDeLaDemande = {
|
|
91
|
+
etat: 'donnee';
|
|
92
|
+
rang: number;
|
|
93
|
+
} | {
|
|
94
|
+
etat: 'attend';
|
|
95
|
+
rang: number;
|
|
96
|
+
raison: string;
|
|
97
|
+
} | {
|
|
98
|
+
etat: 'inconnue';
|
|
99
|
+
};
|
|
100
|
+
/** The process that now holds the place or the request <id>. */
|
|
101
|
+
export interface Rattachement {
|
|
102
|
+
id: string;
|
|
103
|
+
pid: number;
|
|
104
|
+
depart: string | null;
|
|
105
|
+
}
|
|
106
|
+
export {};
|