@roomi-fields/grillhouse 0.52.0 → 0.53.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 (130) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +48 -0
  3. package/agents/direct.md +1 -1
  4. package/cadre/templates/projet/vitest.config.cjs +45 -0
  5. package/charte/superviseur.md +36 -37
  6. package/charte.md +1 -1
  7. package/dist/temporal/circuit/appel.d.ts +2 -0
  8. package/dist/temporal/circuit/appel.js +24 -2
  9. package/dist/temporal/circuit/appel.js.map +1 -1
  10. package/dist/temporal/circuit/client.d.ts +14 -5
  11. package/dist/temporal/circuit/client.js +41 -9
  12. package/dist/temporal/circuit/client.js.map +1 -1
  13. package/dist/temporal/circuit/commande.js +17 -6
  14. package/dist/temporal/circuit/commande.js.map +1 -1
  15. package/dist/temporal/circuit/contrat.d.ts +9 -0
  16. package/dist/temporal/circuit/contrat.js +6 -0
  17. package/dist/temporal/circuit/contrat.js.map +1 -1
  18. package/dist/temporal/circuit/deroule.js +25 -4
  19. package/dist/temporal/circuit/deroule.js.map +1 -1
  20. package/dist/temporal/client.d.ts +35 -1
  21. package/dist/temporal/client.js +144 -1
  22. package/dist/temporal/client.js.map +1 -1
  23. package/dist/temporal/commande.js +31 -13
  24. package/dist/temporal/commande.js.map +1 -1
  25. package/dist/temporal/etat.d.ts +3 -1
  26. package/dist/temporal/etat.js +31 -17
  27. package/dist/temporal/etat.js.map +1 -1
  28. package/dist/temporal/file/activites.js +1 -1
  29. package/dist/temporal/file/activites.js.map +1 -1
  30. package/dist/temporal/file/contrat.d.ts +4 -5
  31. package/dist/temporal/file/contrat.js +2 -2
  32. package/dist/temporal/file/contrat.js.map +1 -1
  33. package/dist/temporal/file/deroule.js +7 -5
  34. package/dist/temporal/file/deroule.js.map +1 -1
  35. package/dist/temporal/installation.d.ts +103 -53
  36. package/dist/temporal/installation.js +842 -237
  37. package/dist/temporal/installation.js.map +1 -1
  38. package/dist/temporal/nuits/deroule.js +3 -1
  39. package/dist/temporal/nuits/deroule.js.map +1 -1
  40. package/dist/temporal/places/deroule.js +2 -1
  41. package/dist/temporal/places/deroule.js.map +1 -1
  42. package/dist/temporal/sonde/deroule.js +2 -1
  43. package/dist/temporal/sonde/deroule.js.map +1 -1
  44. package/dist/temporal/tickets/deroule.js +4 -3
  45. package/dist/temporal/tickets/deroule.js.map +1 -1
  46. package/dist/temporal/travailleur.d.ts +7 -1
  47. package/dist/temporal/travailleur.js +49 -25
  48. package/dist/temporal/travailleur.js.map +1 -1
  49. package/docs/INTERFACE.md +17 -12
  50. package/docs/architecture/circuit.md +18 -15
  51. package/docs/architecture/entree.md +7 -8
  52. package/docs/architecture/greffon.md +30 -21
  53. package/docs/architecture/installation.md +87 -58
  54. package/docs/architecture/machine.md +1 -1
  55. package/docs/architecture/tests.md +14 -5
  56. package/docs/lexique.md +2 -2
  57. package/hooks/hooks.json +10 -0
  58. package/hooks/register.tsx +19 -25
  59. package/package.json +3 -2
  60. package/scripts/activites.mjs +5 -4
  61. package/scripts/aiguillage.mjs +1 -0
  62. package/scripts/circuit.mjs +254 -42
  63. package/scripts/circuits-du-serveur.mjs +3 -2
  64. package/scripts/circuits-tenus.d.mts +7 -0
  65. package/scripts/circuits-tenus.mjs +17 -0
  66. package/scripts/copie-de-montee.mjs +354 -0
  67. package/scripts/copies-du-depot.d.mts +13 -0
  68. package/scripts/copies-du-depot.mjs +66 -0
  69. package/scripts/copies-finies.mjs +6 -40
  70. package/scripts/crochets.mjs +16 -2
  71. package/scripts/direct.mjs +2 -2
  72. package/scripts/droits.mjs +2 -2
  73. package/scripts/engendres.mjs +5 -3
  74. package/scripts/enveloppe/travail-de-la-copie.mjs +77 -0
  75. package/scripts/etapes.mjs +11 -3
  76. package/scripts/faits-du-circuit.mjs +12 -5
  77. package/scripts/file-des-tickets.d.mts +13 -2
  78. package/scripts/file-des-tickets.mjs +44 -12
  79. package/scripts/greffons.mjs +42 -27
  80. package/scripts/grillhouse-maj.mjs +105 -85
  81. package/scripts/init.mjs +1 -1
  82. package/scripts/integration/file.mjs +5 -2
  83. package/scripts/integration/integrer.mjs +14 -4
  84. package/scripts/jointure.d.ts +16 -0
  85. package/scripts/langages/c/commandes.mjs +17 -7
  86. package/scripts/langages/cargo/commandes.mjs +87 -34
  87. package/scripts/langages/cargo/index.mjs +6 -3
  88. package/scripts/langages/cargo/sccache.mjs +15 -12
  89. package/scripts/langages/python/commandes.mjs +18 -8
  90. package/scripts/langages/python/squelette.mjs +2 -2
  91. package/scripts/langages/typescript/configurations-de-vitest.mjs +118 -0
  92. package/scripts/langages/typescript/index.mjs +2 -0
  93. package/scripts/langages/typescript/migrations/configurations-en-commonjs.mjs +299 -0
  94. package/scripts/langages/typescript/squelette.mjs +20 -17
  95. package/scripts/langages/typescript/tests-de-nuit.mjs +3 -3
  96. package/scripts/langages/typescript/turbo-des-paquets.mjs +24 -37
  97. package/scripts/langages/typescript/vitest-config/base.mjs +1 -1
  98. package/scripts/langages/typescript/vitest-config/bornes.mjs +1 -1
  99. package/scripts/langages/typescript/vitest-config/cibles.mjs +2 -2
  100. package/scripts/langages/typescript/{vitest.nuit.config.mjs → vitest.nuit.config.cjs} +61 -50
  101. package/scripts/mesure/pression.mjs +5 -3
  102. package/scripts/montee.mjs +524 -0
  103. package/scripts/outil.mjs +5 -3
  104. package/scripts/paquet-npm.mjs +22 -0
  105. package/scripts/paquet.mjs +5 -5
  106. package/scripts/pre-compact.mjs +25 -0
  107. package/scripts/reponses-du-circuit.d.mts +17 -2
  108. package/scripts/reponses-du-circuit.mjs +78 -20
  109. package/scripts/resultats.mjs +40 -12
  110. package/scripts/retirer-les-copies-finies.mjs +4 -7
  111. package/scripts/seances.mjs +28 -3
  112. package/scripts/services-du-noyau.mjs +7 -2
  113. package/scripts/session-start.sh +18 -11
  114. package/scripts/sortie.mjs +4 -7
  115. package/scripts/sous-commandes.mjs +1 -0
  116. package/scripts/superviseur.mjs +110 -70
  117. package/scripts/tableau.mjs +127 -108
  118. package/scripts/ticket-du-circuit.mjs +22 -0
  119. package/scripts/transitions.d.mts +6 -9
  120. package/scripts/transitions.mjs +123 -36
  121. package/scripts/verrou-de-fichier.d.mts +11 -0
  122. package/skills/direct/SKILL.md +21 -11
  123. package/skills/explorateur/SKILL.md +6 -1
  124. package/skills/grill/SKILL.md +9 -7
  125. package/skills/grill/references/paquets.md +4 -4
  126. package/skills/pitmaster/SKILL.md +45 -33
  127. package/skills/pitmaster/references/consigne-agent.md +1 -1
  128. package/skills/relecteur/SKILL.md +8 -1
  129. package/skills/testwriter/SKILL.md +1 -1
  130. package/cadre/templates/projet/vitest.config.ts +0 -44
package/hooks/hooks.json CHANGED
@@ -13,6 +13,16 @@
13
13
  ]
14
14
  }
15
15
  ],
16
+ "PreCompact": [
17
+ {
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/crochet.mjs\" pre-compact"
22
+ }
23
+ ]
24
+ }
25
+ ],
16
26
  "UserPromptSubmit": [
17
27
  {
18
28
  "hooks": [
@@ -498,12 +498,10 @@ let relevee = false
498
498
  const tours = new Set<string>()
499
499
  // The messages submitted and not yet read: their text, and the time they were put in the queue.
500
500
  const soumis: { texte: string; envoyeA: number }[] = []
501
- // What the renewal reads of the session: the time of its last Stop with no task in flight and of
502
- // the last message of the owner (0 without one), and whether a compaction of the main conversation
503
- // is still to tell.
501
+ // What the renewal reads of the session: the time of its last Stop with no task in flight, since
502
+ // the last turn and compaction, and of the last message of the owner (0 without one).
504
503
  let arretA = 0
505
504
  let messageA = 0
506
- let compaction = false
507
505
  const DU_RESPONSABLE = new Set(['composer', 'bridge'])
508
506
 
509
507
  // A turn started at <lueA> with <texte>: the questions of each message it contains are read, those
@@ -534,23 +532,16 @@ export async function pousserLesQuestions($: EngineInterface): Promise<void> {
534
532
  }
535
533
  }
536
534
 
537
- // One reading of the questions: its message submitted to the session. A compaction not yet told
538
- // goes with it, and stays to tell when the reading gave nothing for a fault.
535
+ // One reading of the questions: its message submitted to the session.
539
536
  async function relever($: EngineInterface): Promise<void> {
540
- const apresCompaction = compaction
541
- compaction = false
542
537
  try {
543
- const r = await $.process.run(
544
- [GRILLHOUSE, 'superviseur', '--relever', cwd, ...(apresCompaction ? ['--compaction'] : [])],
545
- { cwd, timeoutMs: 60_000 },
546
- )
538
+ const r = await $.process.run([GRILLHOUSE, 'superviseur', '--relever', cwd], { cwd, timeoutMs: 60_000 })
547
539
  // A reading at fault can still give a message: that of the projects of the group it read.
548
540
  if (r.exitCode !== 0) {
549
541
  const faute = (r.stderr || '').trim().slice(0, 300)
550
542
  if (faute) await update($, etat, s => ({ ...s, erreur: faute }))
551
543
  }
552
544
  const texte = (r.stdout || '').trim()
553
- if (apresCompaction && r.exitCode !== 0 && !texte) compaction = true
554
545
  if (texte) {
555
546
  // The questions of this message are sent: kept with the time they were put in it, until a
556
547
  // turn starts with its text (`marquerLesLues`).
@@ -560,17 +551,17 @@ async function relever($: EngineInterface): Promise<void> {
560
551
  }
561
552
  } catch {
562
553
  // a reading that fails is taken again at the next period
563
- if (apresCompaction) compaction = true
564
554
  }
565
555
  }
566
556
 
567
557
  // The renewal of the session of supervision (greffon.md, §5.1), as a worker is recycled between
568
558
  // two requests. The frame's command judges (`grillhouse superviseur --renouveler`): it is told the
569
559
  // time of the last Stop of the session that left no task in flight (`arretA`) and of the last
570
- // message of the owner (`messageA`), and gives the message of resumption when the milestone is due.
571
- // The mod then runs /clear and submits it, unless a turn runs, a draft stands in the prompt box, a
572
- // message of questions is not read, or a Stop or a message of the owner came since the command was
573
- // asked. A /clear refused is tried again at a later period.
560
+ // message of the owner (`messageA`), and gives a line when the session is to be compacted, its
561
+ // message of resumption empty or not. The mod then compacts it, the PreCompact hook giving the
562
+ // instructions of the summary, and submits the message, unless a turn runs, a draft stands in the
563
+ // prompt box, a message of questions is not read, or a Stop or a message of the owner came since
564
+ // the command was asked. A compaction refused is tried again at a later period.
574
565
  async function renouveler($: EngineInterface): Promise<void> {
575
566
  if (tours.size) return
576
567
  const dits = { arretA, messageA }
@@ -579,13 +570,15 @@ async function renouveler($: EngineInterface): Promise<void> {
579
570
  [GRILLHOUSE, 'superviseur', '--renouveler', cwd, String(dits.arretA), String(dits.messageA)],
580
571
  { cwd, timeoutMs: 60_000 },
581
572
  )
582
- const reprise = (r.stdout || '').trim()
583
- if (r.exitCode !== 0 || !reprise) return
573
+ const ligne = (r.stdout || '').trim()
574
+ if (r.exitCode !== 0 || !ligne) return
575
+ const { reprise } = JSON.parse(ligne) as { reprise: string }
584
576
  if ((await $.prompt.read()).text !== '') return
585
577
  if (tours.size || soumis.length || arretA !== dits.arretA || messageA !== dits.messageA) return
586
- await $.command.run({ command: 'clear' })
578
+ if ('skip' in (await $.session.compact())) return
579
+ // The mod's own compaction: its `session.compact` hook does not hear it.
587
580
  arretA = 0
588
- void $.prompt.submit({ text: reprise })
581
+ if (reprise) void $.prompt.submit({ text: reprise })
589
582
  } catch {
590
583
  // a renewal refused is tried again at the next period
591
584
  }
@@ -596,7 +589,6 @@ async function renouveler($: EngineInterface): Promise<void> {
596
589
  async function reprendreApresClear($: EngineInterface): Promise<void> {
597
590
  arretA = 0
598
591
  messageA = 0
599
- compaction = false
600
592
  tours.clear()
601
593
  soumis.length = 0
602
594
  if (!eligible) return
@@ -652,6 +644,7 @@ export const register: Register = on => {
652
644
  on('turn.start', async ($, e, next) => {
653
645
  const r = await next(e)
654
646
  tours.add(e.turnId)
647
+ arretA = 0
655
648
  await marquerLesLues($, e.text, Date.now())
656
649
  return r
657
650
  })
@@ -670,10 +663,11 @@ export const register: Register = on => {
670
663
  return next(e)
671
664
  })
672
665
 
673
- // A compaction installed in the main conversation: neither a subagent's, nor one computed ahead.
666
+ // A compaction installed in the main conversation, neither a subagent's nor one computed ahead,
667
+ // forgets the quiet Stop.
674
668
  on('session.compact', async (_$, e, next) => {
675
669
  const r = await next(e)
676
- if (!e.agentId && e.trigger !== 'precompute' && !('skip' in r)) compaction = true
670
+ if (!e.agentId && e.trigger !== 'precompute' && !('skip' in r)) arretA = 0
677
671
  return r
678
672
  })
679
673
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -152,7 +152,8 @@
152
152
  "@roomi-fields/grillhouse-matiere": "*",
153
153
  "dependency-cruiser": "18.4.0",
154
154
  "jsonc-parser": "3.3.1",
155
- "smol-toml": "1.9.1"
155
+ "smol-toml": "1.9.1",
156
+ "vite": "^5.4.21"
156
157
  },
157
158
  "grillhouse": {
158
159
  "lit": [
@@ -77,6 +77,7 @@ import {
77
77
  composantsLisibles,
78
78
  entete,
79
79
  fichesDe,
80
+ fichesDepuisLaBascule,
80
81
  fin,
81
82
  geste,
82
83
  inscrire,
@@ -155,7 +156,7 @@ const decouvertesDuTicket = ctx =>
155
156
  // The circuit's reports since the reviewer's last sheet: those of its proofs and checks (the final
156
157
  // pass among them), as it wrote them at the ticket.
157
158
  function rapportsDuCircuit(ctx) {
158
- const tous = lesFiches(ctx);
159
+ const tous = fichesDepuisLaBascule(ctx);
159
160
  const depuis = tous.findLastIndex(e => e.role === 'relecteur') + 1;
160
161
  return tous
161
162
  .slice(depuis)
@@ -258,7 +259,7 @@ export async function relire(
258
259
  ) {
259
260
  const { tests, code } = fichiersDuLot(ctx);
260
261
  const rapports = rapportsDuCircuit(ctx);
261
- const precedents = fichesDe(ctx, 'relecteur').length;
262
+ const precedents = fichesDepuisLaBascule(ctx).filter(e => e.role === 'relecteur').length;
262
263
  const { avant, depuis, lot } = leLotGarde(ctx);
263
264
  let lus = { tests, code };
264
265
  // The findings still open go to every review, bounded or whole.
@@ -415,7 +416,7 @@ export function texteDesElements(liste, bornee = null) {
415
416
  // arbre, base, fichiers } }`), or null before any, without a copy, or when the lot or its base is
416
417
  // not kept (the repository no longer holds one of them).
417
418
  export function relectureDAvant(ctx) {
418
- const e = lesFiches(ctx).findLast(x => x.role === 'relecteur');
419
+ const e = fichesDepuisLaBascule(ctx).findLast(x => x.role === 'relecteur');
419
420
  if (!e?.lot?.commit || !e.lot.base || !existsSync(ctx.copie)) {
420
421
  return null;
421
422
  }
@@ -1402,7 +1403,7 @@ export function messageDuLot({ entete, description, fiches, references = [] }) {
1402
1403
  }
1403
1404
 
1404
1405
  // The files the copy changes against its HEAD: [{ fichier, supprime }], relative to the copy.
1405
- function changements(ctx) {
1406
+ export function changements(ctx) {
1406
1407
  const r = spawnSync(
1407
1408
  'git',
1408
1409
  ['-C', ctx.copie, 'status', '--porcelain', '-z', '--untracked-files=all'],
@@ -75,6 +75,7 @@ export const REDIRIGEES = new Set([
75
75
  'messages-non-lus',
76
76
  'newday',
77
77
  'nuit',
78
+ 'pre-compact',
78
79
  'registre',
79
80
  'resultats',
80
81
  'retirer-copie',