@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,94 @@
|
|
|
1
|
+
// The queue of the tickets of a project (grillhouse-4nr.9, decision D9), `tickets:<racine>`, as Zuul
|
|
2
|
+
// and the merge queues start a change once what it depends on has merged: woken every `reveilMs`
|
|
3
|
+
// (60 s) and at the end of each circuit it started, it counts the
|
|
4
|
+
// circuits of the project alive (those the server runs, and those it has just started, which the
|
|
5
|
+
// server's visibility may not show yet), then starts the circuit of each ticket that starts
|
|
6
|
+
// (`ticketsAPartir`, unchanged: open, labelled `circuit`, its dependencies closed, by priority),
|
|
7
|
+
// no more alive at once than the setting of the project (`grillhouse.circuits`, 1 when absent). A
|
|
8
|
+
// circuit waiting for the supervisor's answer is alive: its workflow runs, waiting for the answer,
|
|
9
|
+
// and is never purged. A workflow closes only integrated (its ticket closed in Beads) or stopped
|
|
10
|
+
// on the supervisor's word (`--arreter`, the label `circuit` taken off): Beads, the durable
|
|
11
|
+
// register, keeps it from starting again. The circuits the server holds not integrated
|
|
12
|
+
// (`circuitsNonIntegres`, one call) hold their ticket too, one ended without its issue among them.
|
|
13
|
+
// Each circuit is a child that outlives the queue and that its cancellation does not reach; a
|
|
14
|
+
// ticket whose circuit runs already, visible or not yet, does not start again. A fault (the
|
|
15
|
+
// setting, the package.json, Beads) starts nothing, named in the query. Past its length of
|
|
16
|
+
// history, it continues as new; the end of a circuit started before is then read at the next
|
|
17
|
+
// wake. Deterministic: it imports the workflow API, the contracts and the workflow of a ticket.
|
|
18
|
+
import { WorkflowExecutionAlreadyStartedError } from '@temporalio/common';
|
|
19
|
+
import { allHandlersFinished, ChildWorkflowCancellationType, condition, continueAsNew, defineQuery, defineSignal, ParentClosePolicy, proxyActivities, setHandler, startChild, workflowInfo, } from '@temporalio/workflow';
|
|
20
|
+
import { idDuCircuit } from '../circuit/contrat.js';
|
|
21
|
+
import { circuitDuTicket } from '../circuit/deroule.js';
|
|
22
|
+
import { L_ETAT_DES_TICKETS, SEANCE_DU_SUPERVISEUR, } from './contrat.js';
|
|
23
|
+
const actes = proxyActivities({
|
|
24
|
+
startToCloseTimeout: '5 minutes',
|
|
25
|
+
retry: { initialInterval: '1 second', maximumAttempts: 4 },
|
|
26
|
+
});
|
|
27
|
+
const lEtat = defineQuery(L_ETAT_DES_TICKETS);
|
|
28
|
+
const laSeance = defineSignal(SEANCE_DU_SUPERVISEUR);
|
|
29
|
+
const REVEIL_MS = 60_000;
|
|
30
|
+
const LIMITE_D_HISTOIRE = 10_000;
|
|
31
|
+
/** The queue of the tickets of the project at <racine>. */
|
|
32
|
+
export async function ticketsDuProjet(entree) {
|
|
33
|
+
const { racine } = entree;
|
|
34
|
+
const reveilMs = entree.reveilMs ?? REVEIL_MS;
|
|
35
|
+
let reveil = false;
|
|
36
|
+
let vivants = [];
|
|
37
|
+
let faute = null;
|
|
38
|
+
// The circuits this run started, until their end: the server's visibility may lag behind.
|
|
39
|
+
const lances = new Set();
|
|
40
|
+
setHandler(lEtat, () => ({ vivants, faute }));
|
|
41
|
+
// The supervisor's session the last ticket put in the queue came with, which each circuit
|
|
42
|
+
// started receives; its signal wakes the queue.
|
|
43
|
+
let superviseur = entree.circuit?.superviseur ?? null;
|
|
44
|
+
setHandler(laSeance, s => {
|
|
45
|
+
superviseur = s;
|
|
46
|
+
reveil = true;
|
|
47
|
+
});
|
|
48
|
+
for (;;) {
|
|
49
|
+
const surLeServeur = await actes.circuitsVivants({ racine });
|
|
50
|
+
vivants = [...new Set([...surLeServeur, ...lances])].sort();
|
|
51
|
+
// A ticket whose circuit is not integrated, alive or stopped, does not start.
|
|
52
|
+
const tenus = await actes.circuitsNonIntegres({ racine });
|
|
53
|
+
const r = await actes.ticketsAPartir({
|
|
54
|
+
racine,
|
|
55
|
+
enCours: [...new Set([...vivants, ...tenus])].sort(),
|
|
56
|
+
});
|
|
57
|
+
faute = r.faute;
|
|
58
|
+
const places = r.max === null ? 0 : r.max - vivants.length;
|
|
59
|
+
for (const ticket of r.partir.slice(0, Math.max(0, places))) {
|
|
60
|
+
try {
|
|
61
|
+
const enfant = await startChild(circuitDuTicket, {
|
|
62
|
+
workflowId: idDuCircuit(racine, ticket),
|
|
63
|
+
args: [{ ...entree.circuit, superviseur, racine, ticket }],
|
|
64
|
+
parentClosePolicy: ParentClosePolicy.ABANDON,
|
|
65
|
+
cancellationType: ChildWorkflowCancellationType.ABANDON,
|
|
66
|
+
});
|
|
67
|
+
lances.add(ticket);
|
|
68
|
+
// The end of the circuit wakes the queue.
|
|
69
|
+
const fini = () => {
|
|
70
|
+
lances.delete(ticket);
|
|
71
|
+
reveil = true;
|
|
72
|
+
};
|
|
73
|
+
void enfant.result().then(fini, fini);
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
if (!(e instanceof WorkflowExecutionAlreadyStartedError)) {
|
|
77
|
+
throw e;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
vivants = [...new Set([...vivants, ticket])].sort();
|
|
81
|
+
}
|
|
82
|
+
reveil = false;
|
|
83
|
+
await condition(() => reveil, reveilMs);
|
|
84
|
+
if (workflowInfo().continueAsNewSuggested ||
|
|
85
|
+
workflowInfo().historyLength >= LIMITE_D_HISTOIRE) {
|
|
86
|
+
await condition(allHandlersFinished);
|
|
87
|
+
return continueAsNew({
|
|
88
|
+
...entree,
|
|
89
|
+
circuit: { ...entree.circuit, superviseur },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=deroule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deroule.js","sourceRoot":"","sources":["../../../src/temporal/tickets/deroule.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iGAAiG;AACjG,kEAAkE;AAClE,iGAAiG;AACjG,4FAA4F;AAC5F,iGAAiG;AACjG,kGAAkG;AAClG,mGAAmG;AACnG,iGAAiG;AACjG,4FAA4F;AAC5F,uFAAuF;AACvF,mGAAmG;AACnG,8FAA8F;AAC9F,4FAA4F;AAC5F,2FAA2F;AAC3F,6FAA6F;AAC7F,gGAAgG;AAChG,OAAO,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GAItB,MAAM,cAAc,CAAC;AAEtB,MAAM,KAAK,GAAG,eAAe,CAAsB;IACjD,mBAAmB,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E,IAAI,CAAC,CAAC;YACxC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,CAAC,CAAC,YAAY,oCAAoC,CAAC,EAAE,CAAC;oBACzD,MAAM,CAAC,CAAC;gBACV,CAAC;YACH,CAAC;YACD,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACtD,CAAC;QACD,MAAM,GAAG,KAAK,CAAC;QACf,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACxC,IACE,YAAY,EAAE,CAAC,sBAAsB;YACrC,YAAY,EAAE,CAAC,aAAa,IAAI,iBAAiB,EACjD,CAAC;YACD,MAAM,SAAS,CAAC,mBAAmB,CAAC,CAAC;YACrC,OAAO,aAAa,CAAyB;gBAC3C,GAAG,MAAM;gBACT,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE;aAC5C,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The frame's worker, which the units of the account start (the worker of the project, the worker
|
|
3
|
+
// of the machine, each on its task queue):
|
|
4
|
+
//
|
|
5
|
+
// node dist/temporal/travailleur.js --file <file des tâches>
|
|
6
|
+
//
|
|
7
|
+
// - It connects to the server of TEMPORAL_ADDRESS (the common client library, ./client.ts), bundles
|
|
8
|
+
// the frame's workflows (./deroules.ts: the sonde, the places of the machine, the circuit of a ticket, the queue of a
|
|
9
|
+
// project and the CI of a commit, the queue of the tickets of a project) and serves them
|
|
10
|
+
// with their activities on the task queue <file>. It writes `prêt <file>` on its standard output once it polls.
|
|
11
|
+
// - SIGINT and SIGTERM stop it cleanly, as the SDK's runtime has it: its running activities are
|
|
12
|
+
// cancelled, then it exits 0. Killed, the server gives its work to the next worker of the queue.
|
|
13
|
+
// - Exit 2 for a malformed call, 1 when it cannot serve (the server unreachable).
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
import { Worker } from '@temporalio/worker';
|
|
16
|
+
import { espaceDeNoms, ouvrirLaConnexionDuTravailleur } from './client.js';
|
|
17
|
+
import * as activitesDuCircuit from './circuit/activites.js';
|
|
18
|
+
import * as activitesDeLaFile from './file/activites.js';
|
|
19
|
+
import * as activitesDesPlaces from './places/activites.js';
|
|
20
|
+
import * as activitesDesTickets from './tickets/activites.js';
|
|
21
|
+
import * as activitesDeLaSonde from './sonde/activites.js';
|
|
22
|
+
const DEROULES = fileURLToPath(new URL('./deroules.js', import.meta.url));
|
|
23
|
+
// The task queue that the arguments <args> name (`--file <file>`), or null.
|
|
24
|
+
function fileDesArguments(args) {
|
|
25
|
+
const i = args.indexOf('--file');
|
|
26
|
+
const file = i >= 0 ? args[i + 1] : undefined;
|
|
27
|
+
return file && !file.startsWith('--') && args.length === 2 ? file : null;
|
|
28
|
+
}
|
|
29
|
+
async function principal(args) {
|
|
30
|
+
const file = fileDesArguments(args);
|
|
31
|
+
if (file === null) {
|
|
32
|
+
process.stderr.write('Usage : travailleur.js --file <file des tâches>\n');
|
|
33
|
+
return 2;
|
|
34
|
+
}
|
|
35
|
+
const connection = await ouvrirLaConnexionDuTravailleur();
|
|
36
|
+
try {
|
|
37
|
+
const worker = await Worker.create({
|
|
38
|
+
connection,
|
|
39
|
+
namespace: espaceDeNoms(),
|
|
40
|
+
taskQueue: file,
|
|
41
|
+
workflowsPath: DEROULES,
|
|
42
|
+
activities: {
|
|
43
|
+
...activitesDeLaSonde,
|
|
44
|
+
...activitesDesPlaces,
|
|
45
|
+
...activitesDuCircuit,
|
|
46
|
+
...activitesDeLaFile,
|
|
47
|
+
...activitesDesTickets,
|
|
48
|
+
},
|
|
49
|
+
// A heartbeat reaches the server within the second: the last sign of life of a session
|
|
50
|
+
// survives a worker that dies, and a cancellation reaches its activity at once.
|
|
51
|
+
maxHeartbeatThrottleInterval: '1 second',
|
|
52
|
+
defaultHeartbeatThrottleInterval: '1 second',
|
|
53
|
+
});
|
|
54
|
+
const fin = worker.run();
|
|
55
|
+
process.stdout.write(`prêt ${file}\n`);
|
|
56
|
+
await fin;
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
await connection.close();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
principal(process.argv.slice(2)).then(code => {
|
|
64
|
+
process.exitCode = code;
|
|
65
|
+
}, (e) => {
|
|
66
|
+
process.stderr.write(`travailleur : ${e instanceof Error ? e.message : String(e)}\n`);
|
|
67
|
+
process.exitCode = 1;
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=travailleur.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"travailleur.js","sourceRoot":"","sources":["../../src/temporal/travailleur.ts"],"names":[],"mappings":";AACA,kGAAkG;AAClG,2CAA2C;AAC3C,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,oGAAoG;AACpG,wHAAwH;AACxH,2FAA2F;AAC3F,kHAAkH;AAClH,gGAAgG;AAChG,mGAAmG;AACnG,kFAAkF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,mBAAmB,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAE3D,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,eAAe,EA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