@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.
Files changed (263) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +769 -0
  3. package/agents/developpeur.md +0 -1
  4. package/agents/explorateur.md +0 -1
  5. package/agents/questionneur.md +0 -1
  6. package/agents/testwriter.md +0 -1
  7. package/bin/grillhouse.mjs +79 -18
  8. package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
  9. package/cadre/templates/projet/CLAUDE.md +5 -1
  10. package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
  11. package/cadre/templates/projet/package.json +2 -2
  12. package/charte.md +24 -0
  13. package/dist/temporal/acte.d.ts +24 -0
  14. package/dist/temporal/acte.js +139 -0
  15. package/dist/temporal/acte.js.map +1 -0
  16. package/dist/temporal/attributs.d.ts +6 -0
  17. package/dist/temporal/attributs.js +15 -0
  18. package/dist/temporal/attributs.js.map +1 -0
  19. package/dist/temporal/circuit/activites.d.ts +13 -0
  20. package/dist/temporal/circuit/activites.js +33 -0
  21. package/dist/temporal/circuit/activites.js.map +1 -0
  22. package/dist/temporal/circuit/client.d.ts +72 -0
  23. package/dist/temporal/circuit/client.js +247 -0
  24. package/dist/temporal/circuit/client.js.map +1 -0
  25. package/dist/temporal/circuit/commande.d.ts +2 -0
  26. package/dist/temporal/circuit/commande.js +238 -0
  27. package/dist/temporal/circuit/commande.js.map +1 -0
  28. package/dist/temporal/circuit/contrat.d.ts +305 -0
  29. package/dist/temporal/circuit/contrat.js +30 -0
  30. package/dist/temporal/circuit/contrat.js.map +1 -0
  31. package/dist/temporal/circuit/deroule.d.ts +3 -0
  32. package/dist/temporal/circuit/deroule.js +540 -0
  33. package/dist/temporal/circuit/deroule.js.map +1 -0
  34. package/dist/temporal/client.d.ts +47 -0
  35. package/dist/temporal/client.js +69 -0
  36. package/dist/temporal/client.js.map +1 -0
  37. package/dist/temporal/commande.d.ts +2 -0
  38. package/dist/temporal/commande.js +94 -0
  39. package/dist/temporal/commande.js.map +1 -0
  40. package/dist/temporal/deroules.d.ts +5 -0
  41. package/dist/temporal/deroules.js +10 -0
  42. package/dist/temporal/deroules.js.map +1 -0
  43. package/dist/temporal/etat.d.ts +33 -0
  44. package/dist/temporal/etat.js +59 -0
  45. package/dist/temporal/etat.js.map +1 -0
  46. package/dist/temporal/file/activites.d.ts +10 -0
  47. package/dist/temporal/file/activites.js +25 -0
  48. package/dist/temporal/file/activites.js.map +1 -0
  49. package/dist/temporal/file/client.d.ts +4 -0
  50. package/dist/temporal/file/client.js +6 -0
  51. package/dist/temporal/file/client.js.map +1 -0
  52. package/dist/temporal/file/contrat.d.ts +158 -0
  53. package/dist/temporal/file/contrat.js +14 -0
  54. package/dist/temporal/file/contrat.js.map +1 -0
  55. package/dist/temporal/file/deroule.d.ts +15 -0
  56. package/dist/temporal/file/deroule.js +235 -0
  57. package/dist/temporal/file/deroule.js.map +1 -0
  58. package/dist/temporal/installation.d.ts +120 -0
  59. package/dist/temporal/installation.js +386 -0
  60. package/dist/temporal/installation.js.map +1 -0
  61. package/dist/temporal/places/activites.d.ts +8 -0
  62. package/dist/temporal/places/activites.js +13 -0
  63. package/dist/temporal/places/activites.js.map +1 -0
  64. package/dist/temporal/places/client.d.ts +28 -0
  65. package/dist/temporal/places/client.js +64 -0
  66. package/dist/temporal/places/client.js.map +1 -0
  67. package/dist/temporal/places/contrat.d.ts +106 -0
  68. package/dist/temporal/places/contrat.js +21 -0
  69. package/dist/temporal/places/contrat.js.map +1 -0
  70. package/dist/temporal/places/deroule.d.ts +3 -0
  71. package/dist/temporal/places/deroule.js +198 -0
  72. package/dist/temporal/places/deroule.js.map +1 -0
  73. package/dist/temporal/sonde/activites.d.ts +6 -0
  74. package/dist/temporal/sonde/activites.js +52 -0
  75. package/dist/temporal/sonde/activites.js.map +1 -0
  76. package/dist/temporal/sonde/contrat.d.ts +35 -0
  77. package/dist/temporal/sonde/contrat.js +10 -0
  78. package/dist/temporal/sonde/contrat.js.map +1 -0
  79. package/dist/temporal/sonde/deroule.d.ts +3 -0
  80. package/dist/temporal/sonde/deroule.js +39 -0
  81. package/dist/temporal/sonde/deroule.js.map +1 -0
  82. package/dist/temporal/tickets/activites.d.ts +7 -0
  83. package/dist/temporal/tickets/activites.js +81 -0
  84. package/dist/temporal/tickets/activites.js.map +1 -0
  85. package/dist/temporal/tickets/client.d.ts +10 -0
  86. package/dist/temporal/tickets/client.js +31 -0
  87. package/dist/temporal/tickets/client.js.map +1 -0
  88. package/dist/temporal/tickets/contrat.d.ts +56 -0
  89. package/dist/temporal/tickets/contrat.js +13 -0
  90. package/dist/temporal/tickets/contrat.js.map +1 -0
  91. package/dist/temporal/tickets/deroule.d.ts +3 -0
  92. package/dist/temporal/tickets/deroule.js +94 -0
  93. package/dist/temporal/tickets/deroule.js.map +1 -0
  94. package/dist/temporal/travailleur.d.ts +2 -0
  95. package/dist/temporal/travailleur.js +69 -0
  96. package/dist/temporal/travailleur.js.map +1 -0
  97. package/docs/ARCHITECTURE.md +646 -87
  98. package/docs/CADRE.md +27 -0
  99. package/docs/INTERFACE.md +139 -42
  100. package/hooks/crochet.mjs +19 -2
  101. package/hooks/hooks.json +11 -0
  102. package/package.json +16 -4
  103. package/scripts/activites.mjs +2255 -0
  104. package/scripts/aiguillage.d.mts +37 -0
  105. package/scripts/aiguillage.mjs +40 -14
  106. package/scripts/avancement.mjs +155 -26
  107. package/scripts/bilan.mjs +137 -43
  108. package/scripts/cadre.mjs +16 -4
  109. package/scripts/circuit.mjs +993 -4075
  110. package/scripts/circuits-cles.d.mts +4 -0
  111. package/scripts/circuits-cles.mjs +21 -0
  112. package/scripts/circuits-du-serveur.mjs +105 -0
  113. package/scripts/codes-de-sortie.mjs +9 -0
  114. package/scripts/commandes-composees.mjs +45 -41
  115. package/scripts/commandes-du-path.d.mts +7 -0
  116. package/scripts/commandes-du-path.mjs +25 -0
  117. package/scripts/composants-affectes.mjs +64 -21
  118. package/scripts/composition-des-langages.mjs +18 -12
  119. package/scripts/conformite.mjs +56 -28
  120. package/scripts/copies-finies.mjs +52 -47
  121. package/scripts/depart-du-ticket.d.mts +53 -0
  122. package/scripts/depart-du-ticket.mjs +124 -0
  123. package/scripts/dependances-internes.mjs +121 -0
  124. package/scripts/dernier-vert.mjs +61 -34
  125. package/scripts/dette.mjs +32 -11
  126. package/scripts/donnees-cles.mjs +244 -0
  127. package/scripts/droits.mjs +51 -16
  128. package/scripts/effets.mjs +352 -0
  129. package/scripts/empreinte-d-etape.mjs +17 -0
  130. package/scripts/engendres.mjs +15 -5
  131. package/scripts/enveloppe/enveloppe.mjs +259 -55
  132. package/scripts/enveloppe/lancer.sh +14 -18
  133. package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
  134. package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
  135. package/scripts/etapes.mjs +5 -2
  136. package/scripts/faits-du-circuit.mjs +493 -0
  137. package/scripts/file-des-tickets.d.mts +21 -0
  138. package/scripts/file-des-tickets.mjs +58 -0
  139. package/scripts/flux-des-paquets.mjs +201 -0
  140. package/scripts/gardes-du-cadre.mjs +21 -5
  141. package/scripts/init.mjs +11 -4
  142. package/scripts/integration/file.mjs +544 -434
  143. package/scripts/integration/integrer.mjs +87 -43
  144. package/scripts/integration/rejeu.mjs +45 -13
  145. package/scripts/jointure.d.ts +151 -28
  146. package/scripts/langages/cargo/commandes.mjs +383 -124
  147. package/scripts/langages/cargo/composants.mjs +154 -42
  148. package/scripts/langages/cargo/exemples.mjs +12 -21
  149. package/scripts/langages/cargo/index.mjs +22 -8
  150. package/scripts/langages/cargo/sccache.mjs +8 -14
  151. package/scripts/langages/cargo/tests-de-head.mjs +25 -9
  152. package/scripts/langages/python/commandes.mjs +218 -100
  153. package/scripts/langages/python/composants.mjs +53 -21
  154. package/scripts/langages/python/exemples.mjs +6 -16
  155. package/scripts/langages/python/index.mjs +28 -8
  156. package/scripts/langages/python/lot.mjs +1 -36
  157. package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
  158. package/scripts/langages/typescript/composants.mjs +9 -3
  159. package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
  160. package/scripts/langages/typescript/consommateurs.mjs +39 -14
  161. package/scripts/langages/typescript/construire.mjs +6 -163
  162. package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
  163. package/scripts/langages/typescript/exemples.mjs +3 -11
  164. package/scripts/langages/typescript/frontieres.mjs +66 -22
  165. package/scripts/langages/typescript/index-interfaces.mjs +36 -13
  166. package/scripts/langages/typescript/index.mjs +50 -61
  167. package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
  168. package/scripts/langages/typescript/lecteurs.mjs +36 -11
  169. package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
  170. package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
  171. package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
  172. package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
  173. package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
  174. package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
  175. package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
  176. package/scripts/langages/typescript/parcours.mjs +12 -4
  177. package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
  178. package/scripts/langages/typescript/resumes.mjs +9 -3
  179. package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
  180. package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
  181. package/scripts/langages/typescript/tests.mjs +40 -15
  182. package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
  183. package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
  184. package/scripts/langages/typescript/verdict.mjs +4 -2
  185. package/scripts/langages/typescript/verifier.mjs +58 -20
  186. package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
  187. package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
  188. package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
  189. package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
  190. package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
  191. package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
  192. package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
  193. package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
  194. package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
  195. package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
  196. package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
  197. package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
  198. package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
  199. package/scripts/lint-des-scripts.mjs +58 -0
  200. package/scripts/mesure/base-de-passe.mjs +117 -25
  201. package/scripts/mesure/pression.mjs +12 -6
  202. package/scripts/mesure-de-la-machine.d.mts +21 -0
  203. package/scripts/mesure-de-la-machine.mjs +76 -0
  204. package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
  205. package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
  206. package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
  207. package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
  208. package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
  209. package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
  210. package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
  211. package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
  212. package/scripts/migrations.mjs +5 -0
  213. package/scripts/nuit.sh +25 -3
  214. package/scripts/outil.mjs +3 -1
  215. package/scripts/outils-cles.d.mts +24 -0
  216. package/scripts/outils-cles.mjs +18 -8
  217. package/scripts/paquet-npm.mjs +157 -0
  218. package/scripts/paquet.mjs +73 -4
  219. package/scripts/paquets.mjs +46 -10
  220. package/scripts/passe-de-la-machine.mjs +71 -0
  221. package/scripts/places-de-la-machine.mjs +414 -0
  222. package/scripts/places-du-serveur.mjs +170 -0
  223. package/scripts/prefixe-des-tickets.mjs +68 -0
  224. package/scripts/preparation.mjs +25 -8
  225. package/scripts/registre.mjs +9 -4
  226. package/scripts/regles-des-places.d.mts +36 -0
  227. package/scripts/regles-des-places.mjs +70 -0
  228. package/scripts/reponses-du-circuit.d.mts +6 -0
  229. package/scripts/reponses-du-circuit.mjs +28 -0
  230. package/scripts/reprise.mjs +66 -0
  231. package/scripts/resultats.mjs +112 -46
  232. package/scripts/retirer-les-copies-finies.mjs +25 -0
  233. package/scripts/sans-reponse.d.mts +4 -0
  234. package/scripts/sans-reponse.mjs +13 -0
  235. package/scripts/seances.mjs +936 -0
  236. package/scripts/services-du-noyau.mjs +27 -8
  237. package/scripts/session-start.sh +2 -2
  238. package/scripts/sortie.mjs +3 -3
  239. package/scripts/sous-commandes.mjs +41 -10
  240. package/scripts/style-a-l-ecriture.mjs +260 -0
  241. package/scripts/superviseur.mjs +122 -111
  242. package/scripts/tableau.mjs +180 -117
  243. package/scripts/taches-du-graphe.mjs +348 -0
  244. package/scripts/ticket-du-circuit.mjs +216 -0
  245. package/scripts/transitions.d.mts +148 -0
  246. package/scripts/transitions.mjs +1018 -0
  247. package/scripts/verrou-de-fichier.mjs +8 -4
  248. package/scripts/verrou-de-machine.mjs +150 -51
  249. package/scripts/verrous/commande.mjs +50 -17
  250. package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
  251. package/scripts/verrous/verrou.mjs +42 -14
  252. package/skills/explorateur/SKILL.md +9 -2
  253. package/skills/grill/SKILL.md +1 -1
  254. package/skills/mesure/SKILL.md +3 -0
  255. package/skills/pitmaster/SKILL.md +17 -18
  256. package/skills/pitmaster/references/consigne-agent.md +5 -1
  257. package/skills/release/SKILL.md +3 -3
  258. package/skills/relecteur/SKILL.md +5 -3
  259. package/skills/testwriter/SKILL.md +49 -31
  260. package/scripts/demon.mjs +0 -251
  261. package/scripts/integration/file-attente.mjs +0 -61
  262. package/scripts/langages/cargo/touches.mjs +0 -93
  263. package/scripts/langages/typescript/script-des-tests.mjs +0 -6
@@ -0,0 +1,69 @@
1
+ // The common client library of the frame's Temporal: the one module that opens the Temporal
2
+ // client and the worker's connection, which the workers, `grillhouse temporal etat` and every
3
+ // client of the frame read. The address and the namespace come from Temporal's own variables
4
+ // (TEMPORAL_ADDRESS, TEMPORAL_NAMESPACE), as the `temporal` program and the SDKs read them, the
5
+ // account's server on the loopback by default. The client it opens is lazy: opening it opens no
6
+ // network, its first call does.
7
+ import { Client, Connection } from '@temporalio/client';
8
+ import { defaultPayloadConverter } from '@temporalio/common';
9
+ import { NativeConnection } from '@temporalio/worker';
10
+ import { ATTRIBUT_ETAPE, ATTRIBUT_TICKET } from './attributs.js';
11
+ export { ATTRIBUTS_DE_RECHERCHE } from './attributs.js';
12
+ /** The account's server: the loopback, Temporal's port. */
13
+ export const ADRESSE_PAR_DEFAUT = '127.0.0.1:7233';
14
+ /** The address of the server: TEMPORAL_ADDRESS, or the account's server. */
15
+ export const adresseDuServeur = (env = process.env) => env.TEMPORAL_ADDRESS || ADRESSE_PAR_DEFAUT;
16
+ /** The namespace: TEMPORAL_NAMESPACE, or `default`. */
17
+ export const espaceDeNoms = (env = process.env) => env.TEMPORAL_NAMESPACE || 'default';
18
+ /**
19
+ * The page of the workflow <id> on the web UI of the server at <adresse>, in the namespace
20
+ * <espace>: the UI listens on the server's port plus 1000, as `temporal server start-dev` sets it
21
+ * by default and the installer writes it (`--ui-port`).
22
+ */
23
+ export function lienDuTableauWeb(adresse, espace, id) {
24
+ const deux = adresse.lastIndexOf(':');
25
+ const hote = adresse.slice(0, deux);
26
+ const port = Number(adresse.slice(deux + 1)) + 1000;
27
+ return `http://${hote}:${port}/namespaces/${encodeURIComponent(espace)}/workflows/${encodeURIComponent(id)}`;
28
+ }
29
+ /** Opens the Temporal client of the server <adresse>, lazily: no network until its first call. */
30
+ export function ouvrirLeClient({ adresse, espace } = {}) {
31
+ const a = adresse ?? adresseDuServeur();
32
+ const connection = Connection.lazy({ address: a });
33
+ const client = new Client({ connection, namespace: espace ?? espaceDeNoms() });
34
+ return { client, adresse: a, fermer: () => connection.close() };
35
+ }
36
+ /** Opens the connection of a worker to the server <adresse>; it connects at once. */
37
+ export function ouvrirLaConnexionDuTravailleur({ adresse, } = {}) {
38
+ return NativeConnection.connect({ address: adresse ?? adresseDuServeur() });
39
+ }
40
+ /** How long `serveurJoignable` waits for the server by default. */
41
+ export const DELAI_JOIGNABLE_MS = 2000;
42
+ /** Whether the server <adresse> answers within <delaiMs> ms. */
43
+ export async function serveurJoignable(adresse = adresseDuServeur(), delaiMs = DELAI_JOIGNABLE_MS) {
44
+ let connection;
45
+ try {
46
+ connection = await Connection.connect({ address: adresse, connectTimeout: delaiMs });
47
+ await connection.withDeadline(Date.now() + delaiMs, () => connection.workflowService.getSystemInfo({}));
48
+ return true;
49
+ }
50
+ catch {
51
+ return false;
52
+ }
53
+ finally {
54
+ await connection?.close();
55
+ }
56
+ }
57
+ /** Reads the workflow <id> from the server: its status, memo, search attributes, sign of life. */
58
+ export async function lireLeDeroule(client, id) {
59
+ const d = await client.workflow.getHandle(id).describe();
60
+ const vie = d.raw.pendingActivities?.[0]?.heartbeatDetails?.payloads?.[0];
61
+ return {
62
+ statut: d.status.name,
63
+ memo: d.memo,
64
+ ticket: d.typedSearchAttributes.get(ATTRIBUT_TICKET),
65
+ etape: d.typedSearchAttributes.get(ATTRIBUT_ETAPE),
66
+ signeDeVie: vie ? defaultPayloadConverter.fromPayload(vie) : undefined,
67
+ };
68
+ }
69
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/temporal/client.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,8FAA8F;AAC9F,6FAA6F;AAC7F,g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G;AAClG,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,EAAU;IAC5D,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IACzD,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1E,OAAO;QACL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;QACrB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,MAAM,EAAE,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,eAAe,CAAC;QACpD,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC;QAClD,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,uBAAuB,CAAC,WAAW,CAAa,GAAc,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env node
2
+ // The subcommand `grillhouse temporal`, the account's Temporal:
3
+ //
4
+ // grillhouse temporal installer [--archive <fichier>] [lieux] lays down the program and the units
5
+ // grillhouse temporal installer --programme-seul [--archive <fichier>] [--maison <dossier>]
6
+ // lays down the program alone
7
+ // grillhouse temporal etat [lieux] says whether each service runs
8
+ //
9
+ // lieux : [--maison <dossier>] [--unites <dossier>] [--racine <dossier>] [--systemctl <programme>]
10
+ //
11
+ // - `installer` lays down the program `temporal` at its pinned version, its archive downloaded
12
+ // from its release (or read from <fichier>) and checked against its pinned sum, writes the units
13
+ // of the account and tells systemd (./installation.ts); the worker's unit takes TEMPORAL from the
14
+ // program laid down, the package.json is not written. An archive refused, or systemd failing: its line on the error
15
+ // stream, exit 1. Systemd failing, the units stay written and not applied: the next run applies
16
+ // them.
17
+ // - `installer --programme-seul` lays down the program alone, checked as above, and writes its
18
+ // path, one line, on the standard output: no unit, no package.json, no systemctl. The night gets the
19
+ // pinned program so (`TEMPORAL=$(npx grillhouse temporal installer --programme-seul)`).
20
+ // - `etat` writes the state of each service on the standard output (./etat.ts); exit 0 when
21
+ // installed, 1 when not.
22
+ // - The places: the home ($HOME), the directory of the units (<home>/.config/systemd/user), the
23
+ // project (the working directory), and the program systemctl (`systemctl`), each an option, so
24
+ // that a test plays under a trial home and never in the account's systemd.
25
+ // - A malformed call writes the usage on the error stream, exit 2.
26
+ import { readFileSync } from 'node:fs';
27
+ import { etat, texteDeLEtat } from './etat.js';
28
+ import { installer, lieuxDe, poserLeProgramme, systemctlDuCompte } from './installation.js';
29
+ const USAGE = 'Usage : grillhouse temporal <installer|etat> [--programme-seul] [--archive <fichier>] ' +
30
+ '[--maison <dossier>] [--unites <dossier>] [--racine <dossier>] [--systemctl <programme>]\n';
31
+ const OPTIONS = new Set(['--archive', '--maison', '--unites', '--racine', '--systemctl']);
32
+ // The action and the options of <args>, or null for a malformed call.
33
+ function lire(args) {
34
+ const [action, ...reste] = args;
35
+ if (action !== 'installer' && action !== 'etat') {
36
+ return null;
37
+ }
38
+ const options = {};
39
+ const seul = reste.indexOf('--programme-seul');
40
+ if (seul >= 0) {
41
+ if (action !== 'installer') {
42
+ return null;
43
+ }
44
+ reste.splice(seul, 1);
45
+ }
46
+ for (let i = 0; i < reste.length; i += 2) {
47
+ const [o, v] = [reste[i], reste[i + 1]];
48
+ if (!OPTIONS.has(o) || v === undefined || (o === '--archive' && action !== 'installer')) {
49
+ return null;
50
+ }
51
+ options[o.slice(2)] = v;
52
+ }
53
+ return { action, options, programmeSeul: seul >= 0 };
54
+ }
55
+ async function principal(args) {
56
+ const appel = lire(args);
57
+ if (appel === null) {
58
+ process.stderr.write(USAGE);
59
+ return 2;
60
+ }
61
+ const { action, options: o, programmeSeul } = appel;
62
+ const lieux = lieuxDe({ maison: o.maison, unites: o.unites, racine: o.racine });
63
+ const archive = o.archive;
64
+ const obtenir = archive ? { obtenir: () => Promise.resolve(readFileSync(archive)) } : {};
65
+ if (programmeSeul) {
66
+ if (o.unites || o.racine || o.systemctl) {
67
+ process.stderr.write(USAGE);
68
+ return 2;
69
+ }
70
+ const { programme } = await poserLeProgramme({ lieux, ...obtenir });
71
+ process.stdout.write(`${programme}\n`);
72
+ return 0;
73
+ }
74
+ const systemctl = systemctlDuCompte(o.systemctl);
75
+ if (action === 'etat') {
76
+ const e = await etat({ lieux, systemctl });
77
+ process.stdout.write(texteDeLEtat(e));
78
+ return e.installe ? 0 : 1;
79
+ }
80
+ const r = await installer({ lieux, systemctl, ...obtenir });
81
+ process.stdout.write(r.change
82
+ ? `temporal : ${r.pose ? 'programme posé' : 'programme à jour'} (${r.programme}) ; ` +
83
+ `unités écrites : ${r.unites.join(', ') || 'aucune'} ; ` +
84
+ `appliquées : ${r.appliquees.join(', ') || 'aucune'}.\n`
85
+ : 'temporal : l’installation est à jour, rien ne change.\n');
86
+ return 0;
87
+ }
88
+ principal(process.argv.slice(2)).then(code => {
89
+ process.exitCode = code;
90
+ }, (e) => {
91
+ process.stderr.write(`${e instanceof Error ? e.message : String(e)}\n`);
92
+ process.exitCode = 1;
93
+ });
94
+ //# sourceMappingURL=commande.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commande.js","sourceRoot":"","sources":["../../src/temporal/commande.ts"],"names":[],"mappings":";AACA,gEAAgE;AAChE,EAAE;AACF,sGAAsG;AACtG,8FAA8F;AAC9F,+FAA+F;AAC/F,mGAAmG;AACnG,EAAE;AACF,qGAAqG;AACrG,EAAE;AACF,+FAA+F;AAC/F,mGAAmG;AACnG,oGAAoG;AACpG,sHAAsH;AACtH,kGAAkG;AAClG,UAAU;AACV,+FAA+F;AAC/F,uGAAuG;AACvG,0FAA0F;AAC1F,4FAA4F;AAC5F,2BAA2B;AAC3B,gGAAgG;AAChG,iGAAiG;AACjG,6E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AAC,EACD,CAAC,CAAU,EAAE,EAAE;IACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { sonde } from './sonde/deroule.js';
2
+ export { placesDeLaMachine } from './places/deroule.js';
3
+ export { circuitDuTicket } from './circuit/deroule.js';
4
+ export { ciDuCommit, fileDuProjet } from './file/deroule.js';
5
+ export { ticketsDuProjet } from './tickets/deroule.js';
@@ -0,0 +1,10 @@
1
+ // The workflows of the frame, which the worker bundles (./travailleur.ts, `workflowsPath`): the
2
+ // sonde (grillhouse-4nr.2), the places of the machine (grillhouse-4nr.7), the circuit of a ticket
3
+ // (grillhouse-4nr.6), the queue of a project and the CI of a commit (grillhouse-4nr.8), the queue of
4
+ // the tickets of a project (grillhouse-4nr.9).
5
+ export { sonde } from './sonde/deroule.js';
6
+ export { placesDeLaMachine } from './places/deroule.js';
7
+ export { circuitDuTicket } from './circuit/deroule.js';
8
+ export { ciDuCommit, fileDuProjet } from './file/deroule.js';
9
+ export { ticketsDuProjet } from './tickets/deroule.js';
10
+ //# sourceMappingURL=deroules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deroules.js","sourceRoot":"","sources":["../../src/temporal/deroules.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,kGAAkG;AAClG,qGAAqG;AACrG,+CAA+C;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type Epingle, type Lieux, type Systemctl } from './installation.js';
2
+ /** A service of the account and whether it runs. */
3
+ interface EtatDuService {
4
+ role: 'serveur' | 'travailleur du projet' | 'travailleur de la machine';
5
+ unite: string;
6
+ actif: boolean;
7
+ }
8
+ /** The state of the account's Temporal. */
9
+ export interface Etat {
10
+ installe: boolean;
11
+ /** The program or the units missing, by their paths. */
12
+ manques: string[];
13
+ programme: {
14
+ chemin: string;
15
+ version: string | null;
16
+ };
17
+ services: EtatDuService[];
18
+ /** Whether the server answers; null without an installation. */
19
+ joignable: boolean | null;
20
+ }
21
+ /** What the state receives; each reading but the places and systemctl has its default. */
22
+ export interface OptionsDeLEtat {
23
+ lieux: Lieux;
24
+ systemctl: Systemctl;
25
+ epingle?: Epingle;
26
+ versionDe?: (programme: string) => string | null;
27
+ joindre?: () => Promise<boolean>;
28
+ }
29
+ /** The state of the account's Temporal at the places <lieux>. */
30
+ export declare function etat({ lieux, systemctl, epingle, versionDe, joindre, }: OptionsDeLEtat): Promise<Etat>;
31
+ /** The state <e> in a few lines, for the standard output. */
32
+ export declare function texteDeLEtat(e: Etat): string;
33
+ export {};
@@ -0,0 +1,59 @@
1
+ // The state of the account's Temporal (`grillhouse temporal etat`): for the server, the worker of
2
+ // the project and the worker of the machine, whether each runs (`systemctl --user is-active`), the
3
+ // version of the program laid down (`temporal --version`), and whether the server answers (the
4
+ // common client library, ./client.ts). Without an installation (the program of the pinned version
5
+ // or a unit missing), it says what is missing, and the command fails.
6
+ import { spawnSync } from 'node:child_process';
7
+ import { existsSync } from 'node:fs';
8
+ import path from 'node:path';
9
+ import { sansReponseEn } from '../../scripts/sans-reponse.mjs';
10
+ import { DELAI_JOIGNABLE_MS, serveurJoignable } from './client.js';
11
+ import { cheminsDe, EPINGLE, unitesDe, } from './installation.js';
12
+ /** The version that the program <programme> says (`temporal version <v> (…)`), or null. */
13
+ function versionDuProgramme(programme) {
14
+ const r = spawnSync(programme, ['--version'], { encoding: 'utf8' });
15
+ return /temporal version (\S+)/.exec(r.stdout ?? '')?.[1] ?? null;
16
+ }
17
+ const ROLES = [
18
+ 'serveur',
19
+ 'travailleur du projet',
20
+ 'travailleur de la machine',
21
+ ];
22
+ /** The state of the account's Temporal at the places <lieux>. */
23
+ export async function etat({ lieux, systemctl, epingle = EPINGLE, versionDe = versionDuProgramme, joindre = () => serveurJoignable(), }) {
24
+ const { programme } = cheminsDe(lieux, epingle.version);
25
+ const unites = unitesDe(lieux.racine);
26
+ const manques = [programme, ...unites.map(u => path.join(lieux.unites, u))].filter(f => !existsSync(f));
27
+ const installe = manques.length === 0;
28
+ return {
29
+ installe,
30
+ manques,
31
+ programme: { chemin: programme, version: existsSync(programme) ? versionDe(programme) : null },
32
+ services: unites.map((unite, i) => ({
33
+ role: ROLES[i],
34
+ unite,
35
+ actif: systemctl(['is-active', unite]).stdout.trim() === 'active',
36
+ })),
37
+ joignable: installe ? await joindre() : null,
38
+ };
39
+ }
40
+ /** The state <e> in a few lines, for the standard output. */
41
+ export function texteDeLEtat(e) {
42
+ const lignes = e.installe
43
+ ? [
44
+ `Temporal est installé : temporal ${e.programme.version ?? '(version illisible)'}, ${e.programme.chemin}`,
45
+ ]
46
+ : [
47
+ 'Temporal n’est pas installé : `npx grillhouse temporal installer` le pose. Il manque :',
48
+ ...e.manques.map(m => ` ${m}`),
49
+ ];
50
+ for (const s of e.services) {
51
+ lignes.push(`${s.role} (${s.unite}) : ${s.actif ? 'tourne' : 'arrêté'}`);
52
+ }
53
+ if (e.joignable !== null) {
54
+ // The server read by `serveurJoignable`, within its delay: the text of every reader.
55
+ lignes.push(e.joignable ? 'le serveur répond' : sansReponseEn(DELAI_JOIGNABLE_MS));
56
+ }
57
+ return `${lignes.join('\n')}\n`;
58
+ }
59
+ //# sourceMappingURL=etat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"etat.js","sourceRoot":"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AAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QACzB,qFAAqF;QACrF,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAClC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ActivitesDeLaFile } from './contrat.js';
2
+ type Entree<K extends keyof ActivitesDeLaFile> = Parameters<ActivitesDeLaFile[K]>[0];
3
+ type Sortie<K extends keyof ActivitesDeLaFile> = Awaited<ReturnType<ActivitesDeLaFile[K]>>;
4
+ export declare function situerLeLot(e: Entree<'situerLeLot'>): Promise<Sortie<'situerLeLot'>>;
5
+ export declare function avancerMain(e: Entree<'avancerMain'>): Promise<Sortie<'avancerMain'>>;
6
+ export declare function fermerLEntree(e: Entree<'fermerLEntree'>): Promise<Sortie<'fermerLEntree'>>;
7
+ export declare function lireLaCI(e: Entree<'lireLaCI'>): Promise<Sortie<'lireLaCI'>>;
8
+ export declare function conclureLaCI(e: Entree<'conclureLaCI'>): Promise<Sortie<'conclureLaCI'>>;
9
+ export declare function jouerUnEffetDeLaFile(e: Entree<'jouerUnEffetDeLaFile'>): Promise<void>;
10
+ export {};
@@ -0,0 +1,25 @@
1
+ // The activities of the queue of a project and of the CI of a commit (./deroule.ts): each plays one
2
+ // act of the queue (scripts/faits-du-circuit.mjs over scripts/integration/file.mjs) in a process
3
+ // of its own (../acte.ts), so that a replay of `npm run verifier` leaves the worker serving; the
4
+ // acts that write give back their effects, which the workflow plays one by one
5
+ // (`jouerUnEffetDeLaFile`).
6
+ import { jouer } from '../acte.js';
7
+ export async function situerLeLot(e) {
8
+ return jouer('situer', e, e.racine);
9
+ }
10
+ export async function avancerMain(e) {
11
+ return jouer('avancer', e, e.racine);
12
+ }
13
+ export async function fermerLEntree(e) {
14
+ return jouer('fermer', e, e.racine);
15
+ }
16
+ export async function lireLaCI(e) {
17
+ return jouer('ci', e, e.racine);
18
+ }
19
+ export async function conclureLaCI(e) {
20
+ return jouer('conclure', e, e.racine);
21
+ }
22
+ export async function jouerUnEffetDeLaFile(e) {
23
+ await jouer('effet-de-la-file', e, e.racine);
24
+ }
25
+ //# sourceMappingURL=activites.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activites.js","sourceRoot":"","sources":["../../../src/temporal/file/activites.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,iGAAiG;AACjG,iGAAiG;AACjG,+EAA+E;AAC/E,4BAA4B;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAMnC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,CAAwB;IACxD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,CAAwB;IACxD,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,CAA0B;IAC5D,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,CAAqB;IAClD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,CAAyB;IAC1D,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,CAAiC;IAC1E,MAAM,KAAK,CAAC,kBAAkB,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Client } from '@temporalio/client';
2
+ import { type VueDeLaFile } from './contrat.js';
3
+ /** The queue of the project at <racine>: the entry under way and those that wait. */
4
+ export declare function lireLaFile(client: Client, racine: string): Promise<VueDeLaFile>;
@@ -0,0 +1,6 @@
1
+ import { idDeLaFile, L_ETAT_DE_LA_FILE } from './contrat.js';
2
+ /** The queue of the project at <racine>: the entry under way and those that wait. */
3
+ export async function lireLaFile(client, racine) {
4
+ return client.workflow.getHandle(idDeLaFile(racine)).query(L_ETAT_DE_LA_FILE);
5
+ }
6
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/temporal/file/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAoB,MAAM,cAAc,CAAC;AAE/E,qFAAqF;AACrF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAc,EAAE,MAAc;IAC7D,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAc,iBAAiB,CAAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,158 @@
1
+ /** The id of the one queue of the repository at <racine>. */
2
+ export declare const idDeLaFile: (racine: string) => string;
3
+ /** The signal that puts a ticket's branch in the queue. */
4
+ export declare const ENTRER = "entrer";
5
+ /** The signal by which the queue gives the circuit of a ticket the issue of its entry. */
6
+ export declare const ISSUE_DE_LA_FILE = "issueDeLaFile";
7
+ /** The query of the queue: the entry under way and those that wait. */
8
+ export declare const L_ETAT_DE_LA_FILE = "etatDeLaFile";
9
+ /** The bounds of the reading of the CI, in ms: its search (2 min), its wait (30 min), its step (10 s). */
10
+ export interface DelaisDeLaCI {
11
+ rechercheMs?: number;
12
+ attenteMs?: number;
13
+ pasMs?: number;
14
+ }
15
+ /** An entry of the queue: the ticket, its branch, the workflow of its circuit that awaits it. */
16
+ export interface EntreeDeLaFile {
17
+ ticket: string;
18
+ branche: string;
19
+ deroule: string;
20
+ }
21
+ /** What the queue receives; `suite` the entries a Continue-As-New carries. */
22
+ export interface EntreeDeLaFileDuProjet {
23
+ racine: string;
24
+ ci?: DelaisDeLaCI;
25
+ suite?: {
26
+ attente: EntreeDeLaFile[];
27
+ };
28
+ }
29
+ /** The queue as its query gives it. */
30
+ export interface VueDeLaFile {
31
+ enCours: string | null;
32
+ attente: string[];
33
+ }
34
+ /**
35
+ * The issue of an entry, the fact `file` of the circuit (scripts/transitions.mjs); `echec`, an act
36
+ * of the queue that failed, on which the circuit stops (« inattendu »).
37
+ */
38
+ export interface IssueDeLaFile {
39
+ etat: 'ferme' | 'en-file' | 'rouvert' | 'echec';
40
+ raison: string;
41
+ }
42
+ /** One reading of the CI of a commit. */
43
+ export type LectureDeLaCI = {
44
+ etat: 'sans-ci';
45
+ } | {
46
+ etat: 'cherche';
47
+ } | {
48
+ etat: 'en-cours';
49
+ passage: string;
50
+ } | {
51
+ etat: 'finie';
52
+ passage: string;
53
+ conclusion: string | null;
54
+ } | {
55
+ etat: 'non-lue';
56
+ raison: string;
57
+ };
58
+ /** The verdict of the CI of a commit, its run, the reason of a CI not read. */
59
+ export interface VerdictDeLaCI {
60
+ verdict: 'verte' | 'rouge' | 'sans-ci' | 'non-lue';
61
+ passage: string | null;
62
+ raison: string | null;
63
+ }
64
+ /** What the CI of a commit receives. */
65
+ export interface EntreeDeLaCI {
66
+ racine: string;
67
+ ticket: string;
68
+ sha: string;
69
+ /** The branch the commit was pushed to, whose workflows run. */
70
+ branche: string;
71
+ ci?: DelaisDeLaCI;
72
+ }
73
+ /** Where the lot of a ticket stands. */
74
+ interface Lot {
75
+ /** The status of the ticket in Beads, and its reason of closure. */
76
+ statut: string | null;
77
+ raison: string | null;
78
+ /** Whether its branch `agent/<ticket>` holds a lot ahead of main, which enters by the queue. */
79
+ aEntrer: boolean;
80
+ /** The commit of main that delivers the ticket, null without one. */
81
+ commit: string | null;
82
+ /** The branch main is pushed to (`grillhouse.poussee.commit`), null on a fault of the key. */
83
+ branche: string | null;
84
+ /**
85
+ * Whether the commit is on that branch of origin: « non » for a lot on the local main alone,
86
+ * « inconnu » when origin does not answer, its reason in `raisonOrigin`.
87
+ */
88
+ surOrigin: 'oui' | 'non' | 'inconnu';
89
+ raisonOrigin: string | null;
90
+ }
91
+ /** An effect an act of the queue gives back (scripts/effets.mjs): a comment at a ticket. */
92
+ export type EffetDeLaFile = {
93
+ genre: string;
94
+ } & Record<string, unknown>;
95
+ /** What an act of the queue that writes gives back besides its outcome: its effects, in order. */
96
+ interface Rendus {
97
+ effets: EffetDeLaFile[];
98
+ }
99
+ export interface ActivitesDeLaFile {
100
+ /** Where the lot of <ticket> stands: closed, on main with its ticket open, or to enter. */
101
+ situerLeLot(e: {
102
+ racine: string;
103
+ ticket: string;
104
+ }): Promise<Lot>;
105
+ /**
106
+ * Main moved onto the branch (scripts/integration/file.mjs `avancerMain`), the ticket told of a
107
+ * branch out of the queue or kept: `{ entre }`, or the issue for the circuit.
108
+ */
109
+ avancerMain(e: {
110
+ racine: string;
111
+ ticket: string;
112
+ branche: string;
113
+ }): Promise<({
114
+ entre: {
115
+ commit: string;
116
+ };
117
+ } | {
118
+ issue: IssueDeLaFile;
119
+ }) & Rendus>;
120
+ /**
121
+ * The ticket closed, its branch deleted, main pushed (`fermerLEntree`): the branch pushed to, or
122
+ * null and why, in one line.
123
+ */
124
+ fermerLEntree(e: {
125
+ racine: string;
126
+ ticket: string;
127
+ branche: string;
128
+ commit: string;
129
+ }): Promise<{
130
+ poussee: string | null;
131
+ raison?: string | null;
132
+ } & Rendus>;
133
+ /** One reading of the CI of <sha>, the run <passage> found before (`lireUneFoisLaCI`). */
134
+ lireLaCI(e: {
135
+ racine: string;
136
+ ticket: string;
137
+ sha: string;
138
+ branche: string;
139
+ passage: string | null;
140
+ }): Promise<LectureDeLaCI>;
141
+ /** The CI of <sha> concluded at the ticket (`conclureLaCI`): the issue for the circuit. */
142
+ conclureLaCI(e: {
143
+ racine: string;
144
+ ticket: string;
145
+ sha: string;
146
+ branche: string;
147
+ relue: boolean;
148
+ } & VerdictDeLaCI): Promise<IssueDeLaFile & Rendus>;
149
+ /**
150
+ * One effect <effet> an act of the queue gave back, written under the key of this activity (its
151
+ * workflow, its run, its activity id, which the workflow sets): one that is not written fails.
152
+ */
153
+ jouerUnEffetDeLaFile(e: {
154
+ racine: string;
155
+ effet: EffetDeLaFile;
156
+ }): Promise<void>;
157
+ }
158
+ export {};
@@ -0,0 +1,14 @@
1
+ // The contract of the queue of integration of a project and of the CI of a commit
2
+ // (grillhouse-4nr.8): the id of the queue (the types of both are the names of their functions,
3
+ // ./deroule.ts), its signals and its query by their names, what they receive and give back, and
4
+ // the activities they call (./activites.ts, each an act of scripts/faits-du-circuit.mjs over
5
+ // scripts/integration/file.mjs). The workflows, their activities and their clients share it.
6
+ /** The id of the one queue of the repository at <racine>. */
7
+ export const idDeLaFile = (racine) => `file:${racine}`;
8
+ /** The signal that puts a ticket's branch in the queue. */
9
+ export const ENTRER = 'entrer';
10
+ /** The signal by which the queue gives the circuit of a ticket the issue of its entry. */
11
+ export const ISSUE_DE_LA_FILE = 'issueDeLaFile';
12
+ /** The query of the queue: the entry under way and those that wait. */
13
+ export const L_ETAT_DE_LA_FILE = 'etatDeLaFile';
14
+ //# sourceMappingURL=contrat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contrat.js","sourceRoot":"","sources":["../../../src/temporal/file/contrat.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+FAA+F;AAC/F,gGAAgG;AAChG,6FAA6F;AAC7F,6FAA6F;AAE7F,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,QAAQ,MAAM,EAAE,CAAC;AAC/D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAC/B,0FAA0F;AAC1F,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAChD,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type EntreeDeLaCI, type EntreeDeLaFile, type EntreeDeLaFileDuProjet, type IssueDeLaFile, type VerdictDeLaCI } from './contrat.js';
2
+ export declare const issueDeLaFile: import("@temporalio/workflow").SignalDefinition<[IssueDeLaFile], string>;
3
+ /** The CI of a commit, read to its conclusion: its verdict, its run, the reason of a CI not read. */
4
+ export declare function ciDuCommit(e: EntreeDeLaCI): Promise<VerdictDeLaCI>;
5
+ export declare function lireEtConclureLaCI(e: EntreeDeLaCI & {
6
+ relue: boolean;
7
+ }, id: string): Promise<IssueDeLaFile>;
8
+ /**
9
+ * The entry <e> sent to the queue of the project <projet> from the workflow of its circuit; the
10
+ * queue started first when none runs, as a child that outlives its parent and that its
11
+ * cancellation does not reach, so that the queue of a project is one whoever starts it.
12
+ */
13
+ export declare function entrerDansLaFile(projet: EntreeDeLaFileDuProjet, e: EntreeDeLaFile): Promise<void>;
14
+ /** The queue of the project at <racine>: one entry at a time, its CI concluded before the next. */
15
+ export declare function fileDuProjet(entree: EntreeDeLaFileDuProjet): Promise<void>;