@roomi-fields/grillhouse 0.36.0 → 0.37.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 +16 -0
- package/cadre/templates/projet/.github/workflows/ci.yml +10 -0
- package/cadre/templates/projet/.github/workflows/nuit.yml +5 -0
- package/charte.md +5 -0
- package/dist/temporal/nuits/activites.d.ts +10 -1
- package/dist/temporal/nuits/activites.js +59 -3
- package/dist/temporal/nuits/activites.js.map +1 -1
- package/dist/temporal/nuits/contrat.d.ts +15 -0
- package/dist/temporal/nuits/deroule.js +67 -35
- package/dist/temporal/nuits/deroule.js.map +1 -1
- package/dist/temporal/places/client.d.ts +12 -0
- package/dist/temporal/places/client.js +23 -1
- package/dist/temporal/places/client.js.map +1 -1
- package/dist/temporal/places/contrat.d.ts +35 -0
- package/dist/temporal/places/contrat.js +11 -0
- package/dist/temporal/places/contrat.js.map +1 -1
- package/dist/temporal/places/deroule.js +47 -2
- package/dist/temporal/places/deroule.js.map +1 -1
- package/docs/ARCHITECTURE.md +14 -3
- package/docs/CADRE.md +11 -0
- package/docs/INTERFACE.md +6 -3
- package/package.json +1 -1
- package/scripts/activites.mjs +10 -4
- package/scripts/aiguillage.mjs +1 -0
- package/scripts/binaires.mjs +119 -0
- package/scripts/grillhouse-maj.mjs +3 -60
- package/scripts/langages/cargo/binaires.mjs +1 -1
- package/scripts/langages/cargo/clippy.mjs +1 -1
- package/scripts/langages/cargo/commandes.mjs +1 -1
- package/scripts/langages/cargo/sccache.mjs +1 -1
- package/scripts/langages/python/commandes.mjs +1 -1
- package/scripts/paquet.mjs +2 -7
- package/scripts/places-de-la-machine.mjs +40 -28
- package/scripts/regles-des-places.d.mts +27 -2
- package/scripts/regles-des-places.mjs +66 -5
- package/scripts/sous-commandes.mjs +1 -0
- package/scripts/tableau.mjs +389 -182
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.37.0] - 2026-11-13
|
|
10
|
+
|
|
11
|
+
- **The CI of a project installs the binaries of its languages** (grillhouse-l9xa): SyntHub's CI was red « sccache absent du PATH »: `npm run verifier` of a project of Rust runs sccache, cargo-nextest and cargo-deny, which only `npx grillhouse maj` installed, on the poste. The new subcommand `npx grillhouse binaires` installs alone each binary of the project's languages missing or at another version (`installerBinaires`, now scripts/binaires.mjs, which `maj` and `paquet` also play), and writes no file of the project; the template's CI plays it after `npm ci` in its jobs `gardes` and `tranches`, and the night's workflow in its job of the night tests. The refusals « sccache absent du PATH » and « uv absent du PATH » now name `npx grillhouse binaires`. **Action for projects**: `npx grillhouse maj`, which rewrites the frame's workflows (`.github/workflows/ci.yml`, `nuit.yml`) from the template.
|
|
12
|
+
|
|
13
|
+
- **The first line of the head counts what AGENTS shows** (grillhouse-csv): « ▶ N en cours · N bloqués · N faits » counted Beads' states: « en cours » mixed what runs and what waits (a place, the supervisor), « bloqués » counted the open dependencies, a circuit whose question was deferred went into « reportés », and a ticket closed before its integration counted as done while AGENTS showed it. The first line now reads « ▶ N · ⏸ N · ⛔ N · ✓ N », the signs alone as AGENTS signs its lines, its three counters the ▶, ⏸ and ⛔ of AGENTS (`etatsDAgents`, the one source AGENTS draws, `comptesDAgents`), one line per project on the board of several, which keeps three lines per project. A ticket whose circuit is launched and not integrated, its question deferred or the ticket closed included, is in progress: no longer « reporté », in the queue nor done, and FAITS AUJOURD'HUI lists it once integrated. « bloqués » moves to the line of the queue, which says its three queues under their signs: « ⏭ file : ● N · ✎ N · ⊘ N », ● the tickets ready for the circuit, ✎ the direct queue, ⊘ the tickets blocked by an open ticket. The status line says « ▶ N · ⏸ N · ⛔ N » and « ⏭ ● N · ✎ N · ✓ N », the same counts under the same signs. **Action for projects**: none.
|
|
14
|
+
|
|
15
|
+
- **The charter says how the direct queue is held**: a direct ticket waits open, counted in the head of the board; the supervisor takes the one it works, gives back open the one it leaves, and closes the one whose lot is on main. **Action for projects**: none.
|
|
16
|
+
|
|
17
|
+
- **The status line counts the alerts of every project of the board** (grillhouse-mec): in a session leading several projects, the board showed three red nights of the other projects and the status line none: it read the session's project alone. `ligneEtat` (scripts/tableau.mjs) counts the alerts of the other projects of the board beside the session's, as a multi-root status bar counts the problems of every root; its counters and chantier stay the session's. **Action for projects**: none.
|
|
18
|
+
|
|
19
|
+
- **The proof of the red measures again when the files it measures change** (grillhouse-2vl): under 0.35.0 the proof of grillhouse-nglm set the tests of the plugin aside (grillhouse-1au) and still counted them « not loading »: the last measure, taken under 0.34.x on the same tree, was read again, its key the copy's fingerprint alone. Its key now holds the files it measures (`cleDeLaMesure`, scripts/activites.mjs), as Turborepo's hash holds a task's arguments. **Action for projects**: none.
|
|
20
|
+
|
|
9
21
|
## [0.36.0] - 2026-11-13
|
|
10
22
|
|
|
11
23
|
- **The update gives a project of cargo or Python the scaffold of Turborepo** (grillhouse-x2w): since 0.31.0 the modules cargo and python play their tasks by Turborepo, but only the module typescript's update posed it; osc-bridge and OSD, older than the template's turbo, failed at their first `turbo run` (« npx canceled due to missing packages », then « Missing packageManager », then no `turbo.json`). The modules cargo and python now name `turbo` among their tools (`outils`), their templates declare it with `packageManager`, and each module's update writes `turbo.json` from the template of its form when the project has none, by the one copy of a template of the core (`poserLeGabaritAbsent`, scripts/gabarit-absent.mjs), which the module typescript's uses too. A `turbo.json`, a `packageManager` or a version of turbo the project holds is kept. **Action for projects**: `npx grillhouse maj`, then `npm install`. A crate at the root of the repository is no package of the graph: its tests play once it lives in a folder of its own (`crates/<nom>`), the root a virtual workspace of Cargo.
|
|
@@ -20,12 +32,16 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
20
32
|
|
|
21
33
|
## [0.35.0] - 2026-11-12
|
|
22
34
|
|
|
35
|
+
- **A ticket in progress stays on the board from the launch of its circuit to its end** (grillhouse-rnb): on SyntHub's board (2026-11-12), 7gv left AGENTS for long moments, then came back « when something happened ». Five causes: a reading of the circuits silent past 5 s under load gave an empty list; a project beside the session's dropped the faults of its reading; a running circuit with no known step stood at no step; a closed ticket whose circuit waited (5.2) was filtered out; a reading of Beads at fault gave no ticket, and no alert. The board now keeps the last reading of the circuits and of the tickets that succeeded (`lectureGardee`, `tableau-lu-circuits.json` and `tableau-lu-tickets.json` in the common git directory) and shows it, its age in the alert (« Temporal ne répond pas en 5 s · temporal etat · circuits lus il y a 40 s », « Tickets illisibles : … · tickets lus il y a 40 s »); a neighbour project says its own faults; a running circuit with no known step stands at its stop's step, else at the plan, marked ⏸ « démarre »; every circuit not integrated of a known ticket, closed or not, stands in AGENTS. AGENTS uses three signs alone, by the tone of the state: ▶ the step works (cyan, a ticket led in direct included, which was ✎); ⏸ it waits under the step about to be launched, its reason on its right, grey for the machine (« attend une place », « nuit » while the night holds the machine, « verrou <sorte> », « CI » at 5.2 without the lock, « disque », « démarre »), yellow for someone (« question au superviseur », « question au responsable », « arrêté »); ⛔ stopped on a fault (ended without its issue) or a frozen pass (red). No more ⏳, 🔒 nor ⚠ on a ticket's line; the ⏳ of the passes that wait for the lock stay at the head with the machine. The waits for a place, the lock and the disk take the grey tone everywhere (`TONS`). On the board of several projects, a ticket's id never gives way (« [OB] OB… »): its subject does. **Action for projects**: none.
|
|
36
|
+
|
|
23
37
|
- **A question deferred goes up again at its hour, not an hour later** (grillhouse-sjj): Beads writes `defer_until` at the local wall time of the machine with a « Z » it does not mean (`--defer 17:30` gives `…T17:30:00Z`), and the wait read it as UTC, one hour late in winter, two in summer. `horsAttente` (scripts/superviseur.mjs) now reads it as Beads writes it. **Action for projects**: none.
|
|
24
38
|
|
|
25
39
|
- **The proof of the red puts aside the tests of the frame's plugin** (grillhouse-1au): the proof refused three times the lot of grillhouse-nglm, `mods/grillhouse/tests/*.test.ts*` « not loading (code 2) »: `npm test` refuses a path out of every package, and `claude plugin test` plays the plugin's tests in the guards with no report test by test. As a night test, a test file of the lot out of every package of the language is put aside, named in the report (« joués par les contrôles »), never counted as not loading (`separerLesFichiersDuJour`, `sectionHorsDesPaquets`, scripts/activites.mjs). **Action for projects**: none.
|
|
26
40
|
|
|
27
41
|
- **The board of several projects gives each project its three lines of states** (grillhouse-cw6): the board of SyntHub's three projects showed neither the queue nor « sans go · à valider · reportés » nor « bloqués », which grillhouse-d7y had given one project's board alone. Each project now has the three lines of one project's board, the first under its label, the two others aligned below it, the third in its tone of alert. **Action for projects**: none.
|
|
28
42
|
|
|
43
|
+
- **The nights drain the machine: the stages under way finish, the nights play alone, then the circuits resume** (grillhouse-giw): on 2026-11-12, 34 night tests were killed by their timeout under load while circuits still ran. As `kubectl drain` empties a node before its maintenance, the workflow of the nights now reserves the whole machine from the workflow of the places before its first night (once per run, lifted after the last, or on a failure, a red or 75 code, a cancellation): no place is given to a request that lacks the night's jeton (it waits, the night its reason), the queue of the tickets starts no circuit, a place taken is never interrupted (the grain is the place: a session or pass under way finishes, the next one of a stage waits for the end of the nights), and the passes of the night carry the jeton by `GRILLHOUSE_JETON_DE_LA_NUIT`. The reservation is beaten by the nights and lifted by the places when it goes unbeaten for the places' expiry. The board says « nuit : attend la fin des étapes en cours », then « nuit en cours ». **Action for projects**: none.
|
|
44
|
+
|
|
29
45
|
- **The probe of a port no longer takes a connection to itself for a server** (grillhouse-jye.9): the night of 2026-11-12 saw a closed port « listened » in 420 ms, Linux opening a connection to a free local port from that same port (TCP simultaneous open). The probe (`ecoute`, scripts/places-du-serveur.mjs) counts a connection whose local end is its remote end as no server (`connecteeASoi`), as go-redis does; and its test probes the reserved port 1 for a refusal, since the port it has just closed may be taken already by a test running beside it. **Action for projects**: none.
|
|
30
46
|
|
|
31
47
|
- **The envelope opens the own outputs of the language in every package out of the plan** (grillhouse-44b.10.6.1): `npm run verifier -- --gardes` plays every package, and Turborepo writes its journal in `.turbo/` of each, but the envelope gave that only to the root and the test material, so a package out of the plan (`packages/grillhouse-essais`) stayed read-only: « Read-only file system », then « le résumé de la passe ne se lit pas ». As a sandbox of Bazel opens the declared outputs whatever the package, the launcher now creates the missing own outputs (`.turbo`, `node_modules/.vite`) in each package the plan does not name (`preparerLesSorties`) while the copy is writable, and the plan mounts an empty one of each over it; the rest of the package stays read-only, and an output a link carries out of the copy is left out. **Action for projects**: none.
|
|
@@ -112,6 +112,11 @@ jobs:
|
|
|
112
112
|
- name: Install dependencies
|
|
113
113
|
run: npm ci
|
|
114
114
|
|
|
115
|
+
# The binaries of the project's languages that the verification runs (cargo's sccache,
|
|
116
|
+
# nextest and cargo-deny, python's uv), each at its version; none for TypeScript alone.
|
|
117
|
+
- name: Install the binaries of the languages
|
|
118
|
+
run: npx --no-install grillhouse binaires
|
|
119
|
+
|
|
115
120
|
# Build, guards, typing, formatting and lint: every task of the pass but the tests; the guard
|
|
116
121
|
# tasks wait for the build of every package, which proves the project builds.
|
|
117
122
|
- name: Verification without the tests
|
|
@@ -148,6 +153,11 @@ jobs:
|
|
|
148
153
|
- name: Install dependencies
|
|
149
154
|
run: npm ci
|
|
150
155
|
|
|
156
|
+
# The binaries of the project's languages that the verification runs (cargo's sccache,
|
|
157
|
+
# nextest and cargo-deny, python's uv), each at its version; none for TypeScript alone.
|
|
158
|
+
- name: Install the binaries of the languages
|
|
159
|
+
run: npx --no-install grillhouse binaires
|
|
160
|
+
|
|
151
161
|
# The tests of the tranche, with the builds they depend on. A push is measured against the
|
|
152
162
|
# commit before it; a pull request, a call and the nightly schedule play the complete pass,
|
|
153
163
|
# with no base.
|
|
@@ -55,6 +55,11 @@ jobs:
|
|
|
55
55
|
- name: Install dependencies
|
|
56
56
|
run: npm ci
|
|
57
57
|
|
|
58
|
+
# The binaries of the project's languages that the night tests run (cargo's sccache,
|
|
59
|
+
# nextest and cargo-deny, python's uv), each at its version; none for TypeScript alone.
|
|
60
|
+
- name: Install the binaries of the languages
|
|
61
|
+
run: npx --no-install grillhouse binaires
|
|
62
|
+
|
|
58
63
|
# The builds the night tests start, as the night of the poste has them from its complete pass.
|
|
59
64
|
- name: Build
|
|
60
65
|
run: npx --no-install turbo run build
|
package/charte.md
CHANGED
|
@@ -177,6 +177,11 @@ tickets ignore, même s'il porte aussi `circuit`. Un lot hors du circuit passe
|
|
|
177
177
|
la CI de sa branche avant main, comme un autre. Un changement de comportement du produit va au
|
|
178
178
|
circuit, même pressé. Ainsi la voie d'un ticket se lit à la charte, et non au choix de la séance.
|
|
179
179
|
|
|
180
|
+
**La file directe se tient comme la file des tickets** : un ticket direct attend ouvert, et l'en-tête
|
|
181
|
+
du panneau le compte (« ✎ N en direct ») ; le superviseur prend le seul qu'il travaille, rend
|
|
182
|
+
ouvert celui qu'il quitte, et ferme celui dont le lot est sur main (« intégré : <commit> »), même
|
|
183
|
+
si une nuit doit encore le confirmer. Ainsi le panneau montre seulement ce qui tourne.
|
|
184
|
+
|
|
180
185
|
**Un paquet naît hors du circuit, en quatre temps** (un squelette n'a ni comportement ni test),
|
|
181
186
|
comme les générateurs de Nx et `cargo new --lib` : 1, le grill, le superviseur et le responsable
|
|
182
187
|
(son rôle, sa frontière, ses refus, son interface, son langage) ; 2, l'écriture, le superviseur
|
|
@@ -3,8 +3,17 @@ export declare function choisirLesNuits(): Promise<ChoixDesNuits>;
|
|
|
3
3
|
/** Writes the skip <saut> at <maintenant> in the journal of its night and in the register. */
|
|
4
4
|
export declare function noterLeSautA(saut: Saut, maintenant: Date): void;
|
|
5
5
|
export declare function noterLeSaut(saut: Saut): Promise<void>;
|
|
6
|
-
|
|
6
|
+
/** The environment of the passes of the night: <env> with the jeton of the reservation of the machine. */
|
|
7
|
+
export declare function environnementDeLaNuit(env: Record<string, string | undefined>, jeton: string): Record<string, string | undefined>;
|
|
8
|
+
export declare function reserverLaMachine({ jeton }: {
|
|
9
|
+
jeton: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare function leverLaMachine({ jeton }: {
|
|
12
|
+
jeton: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
export declare function jouerLaNuit({ racine, jeton, }: {
|
|
7
15
|
racine: string;
|
|
16
|
+
jeton: string;
|
|
8
17
|
}): Promise<number>;
|
|
9
18
|
export declare function demanderLesNuitsPlanifiees(): Promise<void>;
|
|
10
19
|
export declare const activitesDesNuits: ActivitesDesNuits;
|
|
@@ -14,13 +14,17 @@ import { appendFileSync, existsSync, mkdirSync, readFileSync } from 'node:fs';
|
|
|
14
14
|
import path from 'node:path';
|
|
15
15
|
import { Context } from '@temporalio/activity';
|
|
16
16
|
import { departDe, signalerGroupe } from '../../../scripts/mesure-de-la-machine.mjs';
|
|
17
|
+
import { espacementDe, VARIABLE_JETON } from '../../../scripts/regles-des-places.mjs';
|
|
17
18
|
import { ecrire, ligneDeNuit, REGISTRE } from '../../../scripts/registre.mjs';
|
|
18
19
|
import { finirLaTentativeMorte } from '../acte.js';
|
|
19
20
|
import { ouvrirLeClient } from '../client.js';
|
|
20
21
|
import { choisir, marqueurDeLaNuit, projetsDuRegistre } from './choix.js';
|
|
22
|
+
import { battreLaReservation, demarrerLesPlaces, leverLaReservation, lireLesPlaces, reserverLaMachineEntiere, } from '../places/client.js';
|
|
21
23
|
import { demanderDesNuits } from './client.js';
|
|
22
24
|
// How often a night in progress sends its heartbeat.
|
|
23
25
|
const BATTEMENT_MS = 30_000;
|
|
26
|
+
// How often the wait of the stages under way reads the phase of the night again.
|
|
27
|
+
const ATTENTE_DES_ETAPES_MS = 5_000;
|
|
24
28
|
// How long a cancelled night's group has after SIGTERM, before SIGKILL.
|
|
25
29
|
const GRACE_MS = 10_000;
|
|
26
30
|
// The date and the time of <d>, in local time, as the night writes them (`date +%Y-%m-%d %H:%M`).
|
|
@@ -55,14 +59,61 @@ export function noterLeSaut(saut) {
|
|
|
55
59
|
noterLeSautA(saut, new Date());
|
|
56
60
|
return Promise.resolve();
|
|
57
61
|
}
|
|
58
|
-
|
|
62
|
+
/** The environment of the passes of the night: <env> with the jeton of the reservation of the machine. */
|
|
63
|
+
export function environnementDeLaNuit(env, jeton) {
|
|
64
|
+
return { ...env, [VARIABLE_JETON]: jeton };
|
|
65
|
+
}
|
|
66
|
+
// Renews the reservation <jeton> of the machine, which the places lift once its beat is PERIME_MS
|
|
67
|
+
// old; a beat that fails is the next one's to renew.
|
|
68
|
+
async function battreLaReservationDe(jeton) {
|
|
69
|
+
const c = ouvrirLeClient();
|
|
70
|
+
try {
|
|
71
|
+
await battreLaReservation(c.client, jeton);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// The next beat renews it.
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
await c.fermer();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export async function reserverLaMachine({ jeton }) {
|
|
81
|
+
const contexte = Context.current();
|
|
82
|
+
const c = ouvrirLeClient();
|
|
83
|
+
try {
|
|
84
|
+
await demarrerLesPlaces(c.client, { espacementMs: espacementDe(process.env), veilleMs: 1_000 });
|
|
85
|
+
await reserverLaMachineEntiere(c.client, { jeton });
|
|
86
|
+
// The stages under way finish: the nights start once no place is held but the night's.
|
|
87
|
+
for (;;) {
|
|
88
|
+
if ((await lireLesPlaces(c.client)).nuit?.phase === 'en cours') {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
contexte.heartbeat();
|
|
92
|
+
await battreLaReservation(c.client, jeton);
|
|
93
|
+
await contexte.sleep(ATTENTE_DES_ETAPES_MS);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
await c.fermer();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export async function leverLaMachine({ jeton }) {
|
|
101
|
+
const c = ouvrirLeClient();
|
|
102
|
+
try {
|
|
103
|
+
await leverLaReservation(c.client, jeton);
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
await c.fermer();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export async function jouerLaNuit({ racine, jeton, }) {
|
|
59
110
|
const contexte = Context.current();
|
|
60
111
|
const avant = contexte.info.heartbeatDetails;
|
|
61
112
|
finirLaTentativeMorte(avant?.processus);
|
|
62
113
|
const enfant = spawn(path.join(racine, 'node_modules/.bin/grillhouse'), ['nuit'], {
|
|
63
114
|
cwd: racine,
|
|
64
115
|
stdio: 'ignore',
|
|
65
|
-
env: process.env,
|
|
116
|
+
env: environnementDeLaNuit(process.env, jeton),
|
|
66
117
|
detached: true,
|
|
67
118
|
});
|
|
68
119
|
const fin = new Promise((ok, ko) => {
|
|
@@ -70,7 +121,10 @@ export async function jouerLaNuit({ racine }) {
|
|
|
70
121
|
enfant.on('close', (code, signal) => ok(code ?? (signal ? 128 : 1)));
|
|
71
122
|
});
|
|
72
123
|
const moi = { pid: enfant.pid, depart: enfant.pid ? departDe(enfant.pid) : null };
|
|
73
|
-
const battre = () =>
|
|
124
|
+
const battre = () => {
|
|
125
|
+
contexte.heartbeat({ processus: moi });
|
|
126
|
+
void battreLaReservationDe(jeton);
|
|
127
|
+
};
|
|
74
128
|
battre();
|
|
75
129
|
const minuteur = setInterval(battre, BATTEMENT_MS);
|
|
76
130
|
let tuer = null;
|
|
@@ -108,6 +162,8 @@ export async function demanderLesNuitsPlanifiees() {
|
|
|
108
162
|
export const activitesDesNuits = {
|
|
109
163
|
choisirLesNuits,
|
|
110
164
|
noterLeSaut,
|
|
165
|
+
reserverLaMachine,
|
|
166
|
+
leverLaMachine,
|
|
111
167
|
jouerLaNuit,
|
|
112
168
|
demanderLesNuitsPlanifiees,
|
|
113
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activites.js","sourceRoot":"","sources":["../../../src/temporal/nuits/activites.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,kGAAkG;AAClG,gGAAgG;AAChG,wDAAwD;AACxD,EAAE;AACF,iGAAiG;AACjG,gGAAgG;AAChG,8FAA8F;AAC9F,gGAAgG;AAChG,iGAAiG;AACjG,iFAAiF;AACjF,OAAO,EAAE,KAAK,EA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|
|
@@ -70,9 +70,11 @@ export interface VueDesNuits {
|
|
|
70
70
|
export interface EntreeDesNuits {
|
|
71
71
|
/** The length of history past which the workflow continues as new; 2000 by default. */
|
|
72
72
|
limiteDHistoire?: number;
|
|
73
|
+
/** The jeton of the reservation of the machine, kept across a Continue-As-New. */
|
|
73
74
|
etat?: {
|
|
74
75
|
attente: string[];
|
|
75
76
|
planifiees: number;
|
|
77
|
+
jeton?: string | null;
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
export interface ActivitesDesNuits {
|
|
@@ -93,7 +95,20 @@ export interface ActivitesDesNuits {
|
|
|
93
95
|
*/
|
|
94
96
|
jouerLaNuit(e: {
|
|
95
97
|
racine: string;
|
|
98
|
+
jeton: string;
|
|
96
99
|
}): Promise<number>;
|
|
100
|
+
/**
|
|
101
|
+
* Reserves the whole machine for the nights under <jeton> (the workflow of the places,
|
|
102
|
+
* ../places/deroule.ts) and returns once the stages under way have finished: no place is taken
|
|
103
|
+
* by anything but the night, and the activity renews the reservation while it waits.
|
|
104
|
+
*/
|
|
105
|
+
reserverLaMachine(e: {
|
|
106
|
+
jeton: string;
|
|
107
|
+
}): Promise<void>;
|
|
108
|
+
/** Lifts the reservation of the machine <jeton>, so that the circuits resume. */
|
|
109
|
+
leverLaMachine(e: {
|
|
110
|
+
jeton: string;
|
|
111
|
+
}): Promise<void>;
|
|
97
112
|
/** The scheduled nights asked of the workflow of the nights, started when none runs. */
|
|
98
113
|
demanderLesNuitsPlanifiees(): Promise<void>;
|
|
99
114
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// - Once the queue is empty and no request waits, the workflow ends; the next request starts it
|
|
15
15
|
// again. Past its length of history it continues as new with its queue.
|
|
16
16
|
// Deterministic: it imports the workflow API and the contract.
|
|
17
|
-
import { allHandlersFinished, condition, continueAsNew, defineQuery, defineSignal, proxyActivities, setHandler, workflowInfo, } from '@temporalio/workflow';
|
|
17
|
+
import { CancellationScope, allHandlersFinished, condition, continueAsNew, defineQuery, defineSignal, proxyActivities, setHandler, uuid4, workflowInfo, } from '@temporalio/workflow';
|
|
18
18
|
import { DEMANDER, L_ETAT_DES_NUITS, } from './contrat.js';
|
|
19
19
|
const actes = proxyActivities({
|
|
20
20
|
startToCloseTimeout: '5 minutes',
|
|
@@ -27,6 +27,12 @@ const { jouerLaNuit } = proxyActivities({
|
|
|
27
27
|
heartbeatTimeout: '5 minutes',
|
|
28
28
|
retry: { maximumAttempts: 2 },
|
|
29
29
|
});
|
|
30
|
+
// The wait of the stages under way is as long as the longest of them; its heartbeat says it lives.
|
|
31
|
+
const { reserverLaMachine } = proxyActivities({
|
|
32
|
+
startToCloseTimeout: '12 hours',
|
|
33
|
+
heartbeatTimeout: '5 minutes',
|
|
34
|
+
retry: { maximumAttempts: 2 },
|
|
35
|
+
});
|
|
30
36
|
const demander = defineSignal(DEMANDER);
|
|
31
37
|
const lEtat = defineQuery(L_ETAT_DES_NUITS);
|
|
32
38
|
const LIMITE_D_HISTOIRE = 2000;
|
|
@@ -55,44 +61,70 @@ export async function nuitsDeLaMachine(entree = {}) {
|
|
|
55
61
|
}
|
|
56
62
|
});
|
|
57
63
|
setHandler(lEtat, () => vue);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
vue.sautes.push(...choix.sautes);
|
|
67
|
-
vue.ecartes.push(...choix.ecartes);
|
|
68
|
-
choix.jouer.forEach(inscrire);
|
|
69
|
-
continue;
|
|
64
|
+
// The reservation of the whole machine (`reserverLaMachine`): made once, before the first night
|
|
65
|
+
// that plays, lifted when the nights are done, whatever ends them (a failure, a cancellation);
|
|
66
|
+
// a Continue-As-New carries it.
|
|
67
|
+
let jeton = entree.etat?.jeton ?? null;
|
|
68
|
+
let suite = false;
|
|
69
|
+
const lever = async () => {
|
|
70
|
+
if (jeton === null) {
|
|
71
|
+
return;
|
|
70
72
|
}
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const j = jeton;
|
|
74
|
+
jeton = null;
|
|
75
|
+
await CancellationScope.nonCancellable(() => actes.leverLaMachine({ jeton: j }));
|
|
76
|
+
};
|
|
77
|
+
const limite = entree.limiteDHistoire ?? LIMITE_D_HISTOIRE;
|
|
78
|
+
try {
|
|
79
|
+
for (;;) {
|
|
80
|
+
if (planifiees > 0) {
|
|
81
|
+
planifiees = 0;
|
|
82
|
+
const choix = await actes.choisirLesNuits();
|
|
83
|
+
for (const saut of choix.sautes) {
|
|
84
|
+
await actes.noterLeSaut(saut);
|
|
85
|
+
}
|
|
86
|
+
vue.sautes.push(...choix.sautes);
|
|
87
|
+
vue.ecartes.push(...choix.ecartes);
|
|
88
|
+
choix.jouer.forEach(inscrire);
|
|
76
89
|
continue;
|
|
77
90
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
const racine = vue.attente.shift();
|
|
92
|
+
if (racine === undefined) {
|
|
93
|
+
// A request that arrives while the handlers finish is read before the end.
|
|
94
|
+
await condition(allHandlersFinished);
|
|
95
|
+
if (planifiees > 0 || vue.attente.length > 0) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
return vue;
|
|
99
|
+
}
|
|
100
|
+
if (jeton === null) {
|
|
101
|
+
// The stages under way finish; the night starts once no place is held.
|
|
102
|
+
jeton = uuid4();
|
|
103
|
+
await reserverLaMachine({ jeton });
|
|
104
|
+
}
|
|
105
|
+
vue.enCours = racine;
|
|
106
|
+
vue.depuis = Date.now();
|
|
107
|
+
try {
|
|
108
|
+
vue.jouees.push({ racine, code: await jouerLaNuit({ racine, jeton }), echec: null });
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
vue.jouees.push({ racine, code: null, echec: e instanceof Error ? e.message : String(e) });
|
|
112
|
+
}
|
|
113
|
+
vue.enCours = null;
|
|
114
|
+
vue.depuis = null;
|
|
115
|
+
if (workflowInfo().continueAsNewSuggested || workflowInfo().historyLength >= limite) {
|
|
116
|
+
await condition(allHandlersFinished);
|
|
117
|
+
suite = true;
|
|
118
|
+
await continueAsNew({
|
|
119
|
+
...entree,
|
|
120
|
+
etat: { attente: vue.attente, planifiees, jeton },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
87
123
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
await
|
|
92
|
-
await continueAsNew({
|
|
93
|
-
...entree,
|
|
94
|
-
etat: { attente: vue.attente, planifiees },
|
|
95
|
-
});
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
if (!suite) {
|
|
127
|
+
await lever();
|
|
96
128
|
}
|
|
97
129
|
}
|
|
98
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deroule.js","sourceRoot":"","sources":["../../../src/temporal/nuits/deroule.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,mGAAmG;AACnG,qFAAqF;AACrF,6FAA6F;AAC7F,8FAA8F;AAC9F,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,wEAAwE;AACxE,wEAAwE;AACxE,qEAAqE;AACrE,kGAAkG;AAClG,iFAAiF;AACjF,gGAAgG;AAChG,0EAA0E;AAC1E,+DAA+D;AAC/D,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,eAAe,EACf,UAAU,EACV,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,QAAQ,EACR,gBAAgB,GAKjB,MAAM,cAAc,CAAC;AAEtB,MAAM,KAAK,GAAG,eAAe,CAAoB;IAC/C,mBAAmB,EAAE,WAAW;IAChC,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,EAAE;CAC3D,C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AAE,CAAC;YACX,MAAM,KAAK,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,KAAK,CAAC,0BAA0B,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -26,6 +26,18 @@ export declare function rattacherLaPlace(client: Client, place: string, processu
|
|
|
26
26
|
}, id?: string): Promise<void>;
|
|
27
27
|
/** The places of the machine as the board shows them: the ceiling, the places, the waits. */
|
|
28
28
|
export declare function lireLesPlaces(client: Client, id?: string): Promise<VueDesPlaces>;
|
|
29
|
+
/**
|
|
30
|
+
* Reserves the whole machine for the night <jeton> (RESERVER_LA_MACHINE): no place is given but to
|
|
31
|
+
* the requests that carry the jeton, no circuit starts, the places taken finish. The update
|
|
32
|
+
* returns at once; the phase is read in `lireLesPlaces`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function reserverLaMachineEntiere(client: Client, { jeton }: {
|
|
35
|
+
jeton: string;
|
|
36
|
+
}, id?: string): Promise<void>;
|
|
37
|
+
/** Renews the reservation <jeton>: its beat, which keeps it from going out of date. */
|
|
38
|
+
export declare function battreLaReservation(client: Client, jeton: string, id?: string): Promise<void>;
|
|
39
|
+
/** Lifts the reservation <jeton>; another jeton lifts nothing. */
|
|
40
|
+
export declare function leverLaReservation(client: Client, jeton: string, id?: string): Promise<void>;
|
|
29
41
|
/**
|
|
30
42
|
* The tickets of the demand <c> that hold a place of a circuit (RESERVER: the candidates the
|
|
31
43
|
* machine lets the project start, or the circuit resumed), in the order of arrival of every
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { randomUUID } from 'node:crypto';
|
|
8
8
|
import { setTimeout as dormir } from 'node:timers/promises';
|
|
9
9
|
import { FILE_DE_LA_MACHINE } from '../installation.js';
|
|
10
|
-
import { ID_DES_PLACES, LA_DEMANDE, LES_PLACES, PLACES, PRENDRE, RATTACHER, RENDRE, RESERVER, TIRER_UN_RANG, } from './contrat.js';
|
|
10
|
+
import { BATTRE_LA_RESERVATION, ID_DES_PLACES, LA_DEMANDE, LES_PLACES, LEVER_LA_RESERVATION, RESERVER_LA_MACHINE, PLACES, PRENDRE, RATTACHER, RENDRE, RESERVER, TIRER_UN_RANG, } from './contrat.js';
|
|
11
11
|
/** Starts the workflow of the machine on <file>, or leaves the one that runs. */
|
|
12
12
|
export async function demarrerLesPlaces(client, entree, { file = FILE_DE_LA_MACHINE, id = ID_DES_PLACES } = {}) {
|
|
13
13
|
await client.workflow.start(PLACES, {
|
|
@@ -62,6 +62,28 @@ export async function rattacherLaPlace(client, place, processus, id = ID_DES_PLA
|
|
|
62
62
|
export async function lireLesPlaces(client, id = ID_DES_PLACES) {
|
|
63
63
|
return client.workflow.getHandle(id).query(LES_PLACES);
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Reserves the whole machine for the night <jeton> (RESERVER_LA_MACHINE): no place is given but to
|
|
67
|
+
* the requests that carry the jeton, no circuit starts, the places taken finish. The update
|
|
68
|
+
* returns at once; the phase is read in `lireLesPlaces`.
|
|
69
|
+
*/
|
|
70
|
+
export async function reserverLaMachineEntiere(client, { jeton }, id = ID_DES_PLACES) {
|
|
71
|
+
await client.workflow
|
|
72
|
+
.getHandle(id)
|
|
73
|
+
.executeUpdate(RESERVER_LA_MACHINE, { args: [jeton] });
|
|
74
|
+
}
|
|
75
|
+
/** Renews the reservation <jeton>: its beat, which keeps it from going out of date. */
|
|
76
|
+
export async function battreLaReservation(client, jeton, id = ID_DES_PLACES) {
|
|
77
|
+
await client.workflow
|
|
78
|
+
.getHandle(id)
|
|
79
|
+
.executeUpdate(BATTRE_LA_RESERVATION, { args: [jeton] });
|
|
80
|
+
}
|
|
81
|
+
/** Lifts the reservation <jeton>; another jeton lifts nothing. */
|
|
82
|
+
export async function leverLaReservation(client, jeton, id = ID_DES_PLACES) {
|
|
83
|
+
await client.workflow
|
|
84
|
+
.getHandle(id)
|
|
85
|
+
.executeUpdate(LEVER_LA_RESERVATION, { args: [jeton] });
|
|
86
|
+
}
|
|
65
87
|
/**
|
|
66
88
|
* The tickets of the demand <c> that hold a place of a circuit (RESERVER: the candidates the
|
|
67
89
|
* machine lets the project start, or the circuit resumed), in the order of arrival of every
|
|
@@ -1 +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,8FAA8F;AAC9F,8FAA8F;AAC9F,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,UAAU,EACV,UAAU,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,MAAM,EACN,QAAQ,EACR,aAAa,GAQd,MAAM,cAAc,CAAC;AAEtB,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAc,EACd,MAAuB,EACvB,EAAE,IAAI,GAAG,kBAAkB,EAAE,EAAE,GAAG,aAAa,KAAqC,EAAE;IAEtF,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE;QAClC,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,wBAAwB,EAAE,cAAc;KACzC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,MAAc,EACd,OAAmC,EACnC,EACE,EAAE,GAAG,aAAa,EAClB,QAAQ,GAAG,GAAG,EACd,MAAM,MACsD,EAAE;IAEhE,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACx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,CAAiB,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAc,EACd,CAAmB,EACnB,EAAE,GAAG,aAAa;IAElB,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACnD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAK,CAAW,CAAC,IAAI,KAAK,uBAAuB,EAAE,CAAC;YAClD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;IACD,OAAO,CAAC,CAAC,aAAa,CAA+B,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -20,9 +20,37 @@ export declare const LA_DEMANDE = "laDemande";
|
|
|
20
20
|
* circuits alive and the tickets it would start, and learns those the machine lets start.
|
|
21
21
|
*/
|
|
22
22
|
export declare const RESERVER = "reserverDesCircuits";
|
|
23
|
+
/**
|
|
24
|
+
* The update by which the nights reserve the whole machine (grillhouse-giw): no place is given but
|
|
25
|
+
* to the requests that carry the jeton of the night, and the places taken finish.
|
|
26
|
+
*/
|
|
27
|
+
export declare const RESERVER_LA_MACHINE = "reserverLaMachine";
|
|
28
|
+
/** The update by which the nights renew their reservation: its beat. */
|
|
29
|
+
export declare const BATTRE_LA_RESERVATION = "battreLaReservation";
|
|
30
|
+
/** The update by which the nights lift their reservation, by its jeton. */
|
|
31
|
+
export declare const LEVER_LA_RESERVATION = "leverLaReservation";
|
|
32
|
+
/** The patch of the reservation of the machine (Temporal's patching). */
|
|
33
|
+
export declare const RESERVATION_DE_LA_NUIT = "reservation-de-la-nuit";
|
|
34
|
+
/** The reservation of the whole machine by the night. */
|
|
35
|
+
interface Reservation {
|
|
36
|
+
jeton: string;
|
|
37
|
+
/** The time it was made, in ms. */
|
|
38
|
+
depuis: number;
|
|
39
|
+
/** The time of its last beat, in ms. */
|
|
40
|
+
battement: number;
|
|
41
|
+
}
|
|
42
|
+
/** The night as the places show it: its reservation and its phase. */
|
|
43
|
+
interface NuitDesPlaces {
|
|
44
|
+
/** `attend` while the places taken finish, `en cours` once none is. */
|
|
45
|
+
phase: 'attend' | 'en cours';
|
|
46
|
+
depuis: number;
|
|
47
|
+
battement: number;
|
|
48
|
+
}
|
|
23
49
|
/** A place taken. */
|
|
24
50
|
interface Prise {
|
|
25
51
|
id: string;
|
|
52
|
+
/** The jeton of the night the request carried, null without. */
|
|
53
|
+
jeton?: string | null;
|
|
26
54
|
pid: number;
|
|
27
55
|
/** The start of the process (`departDe`), null when unknown. */
|
|
28
56
|
depart: string | null;
|
|
@@ -36,6 +64,7 @@ interface Prise {
|
|
|
36
64
|
/** A taking that waits, and why. */
|
|
37
65
|
interface Attente {
|
|
38
66
|
id: string;
|
|
67
|
+
jeton?: string | null;
|
|
39
68
|
pid: number;
|
|
40
69
|
depart: string | null;
|
|
41
70
|
ticket: string | null;
|
|
@@ -76,6 +105,8 @@ export interface EtatDesPlaces {
|
|
|
76
105
|
attentes: Attente[];
|
|
77
106
|
/** The places of the circuits of the machine; absent in a state of before. */
|
|
78
107
|
circuits?: PlaceDeCircuit[];
|
|
108
|
+
/** The reservation of the machine by the night; absent in a state of before, null without. */
|
|
109
|
+
reservation?: Reservation | null;
|
|
79
110
|
}
|
|
80
111
|
/** What the machine gives at a moment (scripts/regles-des-places.mjs). */
|
|
81
112
|
export interface Mesure {
|
|
@@ -110,6 +141,8 @@ export interface DemandeDePlace {
|
|
|
110
141
|
ticket?: string | null;
|
|
111
142
|
/** The root of the main tree of the project that asks. */
|
|
112
143
|
racine?: string | null;
|
|
144
|
+
/** The jeton of the reservation of the night, which the passes of the night carry. */
|
|
145
|
+
jeton?: string | null;
|
|
113
146
|
/** The rank of arrival of the circuit; drawn by the workflow, past every rank given, when absent. */
|
|
114
147
|
rang?: number;
|
|
115
148
|
}
|
|
@@ -129,6 +162,8 @@ export interface VueDesPlaces {
|
|
|
129
162
|
prises: Prise[];
|
|
130
163
|
attentes: Attente[];
|
|
131
164
|
circuits?: PlaceDeCircuit[];
|
|
165
|
+
/** The night when it reserves the machine; absent without. */
|
|
166
|
+
nuit?: NuitDesPlaces | null;
|
|
132
167
|
}
|
|
133
168
|
/** Where a request stands. */
|
|
134
169
|
export type EtatDeLaDemande = {
|
|
@@ -19,4 +19,15 @@ export const LA_DEMANDE = 'laDemande';
|
|
|
19
19
|
* circuits alive and the tickets it would start, and learns those the machine lets start.
|
|
20
20
|
*/
|
|
21
21
|
export const RESERVER = 'reserverDesCircuits';
|
|
22
|
+
/**
|
|
23
|
+
* The update by which the nights reserve the whole machine (grillhouse-giw): no place is given but
|
|
24
|
+
* to the requests that carry the jeton of the night, and the places taken finish.
|
|
25
|
+
*/
|
|
26
|
+
export const RESERVER_LA_MACHINE = 'reserverLaMachine';
|
|
27
|
+
/** The update by which the nights renew their reservation: its beat. */
|
|
28
|
+
export const BATTRE_LA_RESERVATION = 'battreLaReservation';
|
|
29
|
+
/** The update by which the nights lift their reservation, by its jeton. */
|
|
30
|
+
export const LEVER_LA_RESERVATION = 'leverLaReservation';
|
|
31
|
+
/** The patch of the reservation of the machine (Temporal's patching). */
|
|
32
|
+
export const RESERVATION_DE_LA_NUIT = 'reservation-de-la-nuit';
|
|
22
33
|
//# sourceMappingURL=contrat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contrat.js","sourceRoot":"","sources":["../../../src/temporal/places/contrat.ts"],"names":[],"mappings":"AAMA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAC1C,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,iCAAiC,CAAC;AAC/D,oFAAoF;AACpF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAC3C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAC/B,yEAAyE;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;AACtC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;AACtC;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"contrat.js","sourceRoot":"","sources":["../../../src/temporal/places/contrat.ts"],"names":[],"mappings":"AAMA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAC1C,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,iCAAiC,CAAC;AAC/D,oFAAoF;AACpF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAC3C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAC/B,yEAAyE;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,sDAA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