@piecemaker-legal/piecemaker 1.1.1 → 2.0.1

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 (135) hide show
  1. package/dist/assets/{abnfDiagram-VCTEODGH-DEXWh3LH.js → abnfDiagram-VCTEODGH-C2JDmlZx.js} +1 -1
  2. package/dist/assets/{arc-CoTRLXKW.js → arc-XhSg5Mrj.js} +1 -1
  3. package/dist/assets/{architectureDiagram-5GKGNRK7-Cg-jO9oR.js → architectureDiagram-5GKGNRK7-DKREuXxk.js} +1 -1
  4. package/dist/assets/{blockDiagram-I7D4REHJ-ChXwQSIq.js → blockDiagram-I7D4REHJ-CNK0Tp5d.js} +1 -1
  5. package/dist/assets/{c4Diagram-7LVT6UL2-Bw2VGggd.js → c4Diagram-7LVT6UL2-C8fJzWVp.js} +1 -1
  6. package/dist/assets/channel-DO5hoFdU.js +1 -0
  7. package/dist/assets/{chunk-2Q5K7J3B-C1WdqrLP.js → chunk-2Q5K7J3B-DlE8nLJo.js} +1 -1
  8. package/dist/assets/{chunk-5VM5RSS4-BerUZBa1.js → chunk-5VM5RSS4-CSm-2TZ4.js} +1 -1
  9. package/dist/assets/{chunk-F27PBJKO-5W7ax2gB.js → chunk-F27PBJKO-CSgnXT2c.js} +1 -1
  10. package/dist/assets/{chunk-IMKFNOWR-JgDN1h4T.js → chunk-IMKFNOWR-C6bkt6C1.js} +1 -1
  11. package/dist/assets/{chunk-JWPE2WC7-ulNHnEdQ.js → chunk-JWPE2WC7-jUR52MBO.js} +1 -1
  12. package/dist/assets/{chunk-POPQ4Y6H-D4aTDC2T.js → chunk-POPQ4Y6H-D0UAL7O7.js} +1 -1
  13. package/dist/assets/{chunk-SVP7TREG-BA5zX4XF.js → chunk-SVP7TREG-C9dtOEii.js} +1 -1
  14. package/dist/assets/{chunk-TICWLB2K-DhOULVhX.js → chunk-TICWLB2K-BEzWKT39.js} +1 -1
  15. package/dist/assets/{chunk-XXDRQBXY-CkpCgrVg.js → chunk-XXDRQBXY-uD1oklVY.js} +1 -1
  16. package/dist/assets/classDiagram-ZZMXUADV-BsQtwznI.js +1 -0
  17. package/dist/assets/classDiagram-v2-VYDZK3BY-BsQtwznI.js +1 -0
  18. package/dist/assets/{cose-bilkent-JH36ORCC-0xUSfjfV.js → cose-bilkent-JH36ORCC-aGjlSdMe.js} +1 -1
  19. package/dist/assets/{cynefin-OW5HDTMX-BE6fNu2_.js → cynefin-OW5HDTMX-D3G4OYOn.js} +1 -1
  20. package/dist/assets/{cynefinDiagram-5FMLGOSQ-rFMnZ9b3.js → cynefinDiagram-5FMLGOSQ-9swRDUnu.js} +1 -1
  21. package/dist/assets/{dagre-GXQ25YYZ-C1p4ffd7.js → dagre-GXQ25YYZ-lvaAGdqY.js} +1 -1
  22. package/dist/assets/{diagram-S7CK7UJ4-BV_3Xj4O.js → diagram-S7CK7UJ4-BaZ6YIkR.js} +1 -1
  23. package/dist/assets/{diagram-UQ7AKVKN-Bb_Evkrm.js → diagram-UQ7AKVKN-COJ2Gb38.js} +1 -1
  24. package/dist/assets/{diagram-VSXAHHWV-BzgupjxD.js → diagram-VSXAHHWV-CYZEkbzP.js} +1 -1
  25. package/dist/assets/{diagram-VX7I27RA-D1c67z76.js → diagram-VX7I27RA-fFeQJ4ae.js} +1 -1
  26. package/dist/assets/{diagram-Z3DM3KII-DsJAJGKE.js → diagram-Z3DM3KII-B7knszDV.js} +1 -1
  27. package/dist/assets/{ebnfDiagram-PWID7BFC-B1ge_obq.js → ebnfDiagram-PWID7BFC-Dk0l329Y.js} +1 -1
  28. package/dist/assets/{erDiagram-RLTQ6QDP-DrV-tggw.js → erDiagram-RLTQ6QDP-CtpYxui8.js} +1 -1
  29. package/dist/assets/{flowDiagram-HODETNUW-CVzDiSQ3.js → flowDiagram-HODETNUW-aVWueRJD.js} +1 -1
  30. package/dist/assets/{ganttDiagram-EL5Y4UJY-CGRdSN9D.js → ganttDiagram-EL5Y4UJY-DfrX-B7p.js} +1 -1
  31. package/dist/assets/{gitGraphDiagram-WWUBYQGX-CAfvFXzL.js → gitGraphDiagram-WWUBYQGX-BFB1ZPF3.js} +1 -1
  32. package/dist/assets/{index-DaxH81ZJ.js → index-DqRygn9E.js} +170 -169
  33. package/dist/assets/index-Ds4HaAjz.css +1 -0
  34. package/dist/assets/{infoDiagram-27XIBGKW-DTshEkGK.js → infoDiagram-27XIBGKW-CuYkzm43.js} +1 -1
  35. package/dist/assets/{ishikawaDiagram-5VMMS53U-DkbshVxp.js → ishikawaDiagram-5VMMS53U-EMiw8Akh.js} +1 -1
  36. package/dist/assets/{journeyDiagram-3NMN7TZE-v5qE8xpn.js → journeyDiagram-3NMN7TZE-DCoLV1f8.js} +1 -1
  37. package/dist/assets/{kanban-definition-UXKFOSKX-a9CNMFLt.js → kanban-definition-UXKFOSKX-CyA4Yinu.js} +1 -1
  38. package/dist/assets/{layout-DrW4R1TH.js → layout-BlaB0grA.js} +1 -1
  39. package/dist/assets/{linear-Cs3qpXT_.js → linear-DLX3dJDH.js} +1 -1
  40. package/dist/assets/{mermaid.core-C7Ti-Fty.js → mermaid.core-Cy51CT89.js} +6 -6
  41. package/dist/assets/{mindmap-definition-YA3MSWOX-B0VDdIcG.js → mindmap-definition-YA3MSWOX-OBXjfL7I.js} +1 -1
  42. package/dist/assets/{pegDiagram-XKGWAZYB-CV1L7MjP.js → pegDiagram-XKGWAZYB-C_BJjUh1.js} +1 -1
  43. package/dist/assets/{pieDiagram-E7YTZNPT-DSCuzVTV.js → pieDiagram-E7YTZNPT-jIpbr3Fi.js} +1 -1
  44. package/dist/assets/{quadrantDiagram-AXDQQJYC-hzX-9AKo.js → quadrantDiagram-AXDQQJYC-C1A15xI5.js} +1 -1
  45. package/dist/assets/{railroadDiagram-O6MQD6OU-BbmzIqcp.js → railroadDiagram-O6MQD6OU-Rslzn1pI.js} +1 -1
  46. package/dist/assets/{requirementDiagram-BXWQKSXE-CQCRRBSL.js → requirementDiagram-BXWQKSXE-LlfURO5-.js} +1 -1
  47. package/dist/assets/{sankeyDiagram-P5KCCOFB-kiaLcW6X.js → sankeyDiagram-P5KCCOFB-B5BPF4-O.js} +1 -1
  48. package/dist/assets/{sequenceDiagram-WJ2MYXX4-Bgx8ST7Q.js → sequenceDiagram-WJ2MYXX4-orYZe9zX.js} +1 -1
  49. package/dist/assets/{sizeCapture-INFHLROL-BTjJ-ygN.js → sizeCapture-INFHLROL-Co-K5Cfb.js} +1 -1
  50. package/dist/assets/{stateDiagram-D77RDMKH-D48RR1FL.js → stateDiagram-D77RDMKH-COEx1aH2.js} +1 -1
  51. package/dist/assets/{stateDiagram-v2-MP3YSRHH-B-XwSR-z.js → stateDiagram-v2-MP3YSRHH-DaeTZvmy.js} +1 -1
  52. package/dist/assets/{swimlanes-42K2YHIH-BhE-QuEZ.js → swimlanes-42K2YHIH-BHQaDhfZ.js} +1 -1
  53. package/dist/assets/swimlanesDiagram-VR7AAH4N-BHW8q5M5.js +8 -0
  54. package/dist/assets/{timeline-definition-24CTP7MA-Cm7EUWWt.js → timeline-definition-24CTP7MA-COqCRwGX.js} +1 -1
  55. package/dist/assets/{vennDiagram-4TSXK5OY-X-nC9wZ0.js → vennDiagram-4TSXK5OY-nym5XSnr.js} +1 -1
  56. package/dist/assets/{wardleyDiagram-VM6X3IG4-D33YvEQZ.js → wardleyDiagram-VM6X3IG4-DEPPey_W.js} +1 -1
  57. package/dist/assets/{xychartDiagram-S5SC5T6Z-lziwBKsM.js → xychartDiagram-S5SC5T6Z-uSJ404kL.js} +1 -1
  58. package/dist/index.html +2 -2
  59. package/dist/sw.js +1 -1
  60. package/dist-server/server/index.js +3 -1
  61. package/dist-server/server/index.js.map +1 -1
  62. package/dist-server/server/piecemaker/index.js +7 -3
  63. package/dist-server/server/piecemaker/index.js.map +1 -1
  64. package/dist-server/server/piecemaker/knowledge/index.js +13 -6
  65. package/dist-server/server/piecemaker/knowledge/index.js.map +1 -1
  66. package/dist-server/server/piecemaker/knowledge/local-routes.js +55 -0
  67. package/dist-server/server/piecemaker/knowledge/local-routes.js.map +1 -0
  68. package/dist-server/server/piecemaker/knowledge/scan-jobs.js +3 -1
  69. package/dist-server/server/piecemaker/knowledge/scan-jobs.js.map +1 -1
  70. package/dist-server/server/piecemaker/library/index.js +14 -41
  71. package/dist-server/server/piecemaker/library/index.js.map +1 -1
  72. package/dist-server/server/piecemaker/library/store.js +11 -3
  73. package/dist-server/server/piecemaker/library/store.js.map +1 -1
  74. package/dist-server/server/piecemaker/library/workspace-installation.js +26 -3
  75. package/dist-server/server/piecemaker/library/workspace-installation.js.map +1 -1
  76. package/dist-server/server/piecemaker/timesheet/service.js +8 -7
  77. package/dist-server/server/piecemaker/timesheet/service.js.map +1 -1
  78. package/dist-server/server/piecemaker/timesheet/store.js +5 -3
  79. package/dist-server/server/piecemaker/timesheet/store.js.map +1 -1
  80. package/package.json +1 -1
  81. package/product.config.json +2 -0
  82. package/scripts/piecemaker/build-app-icon.py +88 -0
  83. package/scripts/piecemaker/cli/lib/piecemaker-anonymizer.mjs +2 -2
  84. package/scripts/piecemaker/hooks/proxy-guard.mjs +19 -54
  85. package/scripts/release/assert-piecemaker-version.mjs +25 -0
  86. package/server/index.ts +4 -1
  87. package/server/piecemaker/anonymizer/client-config.cjs +45 -162
  88. package/server/piecemaker/anonymizer/hudsucker-fixture.cjs +127 -0
  89. package/server/piecemaker/anonymizer/hudsucker-proxy/Cargo.lock +2396 -0
  90. package/server/piecemaker/anonymizer/hudsucker-proxy/Cargo.toml +14 -0
  91. package/server/piecemaker/anonymizer/hudsucker-proxy/src/main.rs +501 -0
  92. package/server/piecemaker/anonymizer/providers.cjs +14 -135
  93. package/server/piecemaker/anonymizer/rewriter-bridge.cjs +221 -0
  94. package/server/piecemaker/anonymizer/service.cjs +144 -28
  95. package/server/piecemaker/index.ts +8 -3
  96. package/server/piecemaker/knowledge/index.ts +14 -6
  97. package/server/piecemaker/knowledge/local-routes.ts +72 -0
  98. package/server/piecemaker/knowledge/scan-jobs.ts +4 -1
  99. package/server/piecemaker/library/index.ts +14 -34
  100. package/server/piecemaker/library/store.ts +11 -3
  101. package/server/piecemaker/library/workspace-installation.ts +20 -3
  102. package/server/piecemaker/timesheet/service.ts +9 -7
  103. package/server/piecemaker/timesheet/store.ts +5 -3
  104. package/server/piecemaker/vendor/installer/assets/claude-hooks/piecemaker-guard-secrets.mjs +0 -1
  105. package/server/piecemaker/vendor/installer/assets/piecemaker.icns +0 -0
  106. package/server/piecemaker/vendor/installer/assets/piecemaker.ico +0 -0
  107. package/server/piecemaker/vendor/installer/bin/piecemaker.mjs +56 -206
  108. package/server/piecemaker/vendor/installer/lib/commandes.mjs +2 -4
  109. package/server/piecemaker/vendor/installer/lib/conversion-client.mjs +74 -0
  110. package/server/piecemaker/vendor/installer/lib/service.mjs +4 -358
  111. package/server/piecemaker/vendor/installer/lib/state.mjs +0 -6
  112. package/server/piecemaker/vendor/installer/steps/03-python-gliner.mjs +4 -4
  113. package/server/piecemaker/vendor/installer/steps/09-claude-assets.mjs +0 -31
  114. package/server/piecemaker/vendor/piecemaker-plugin/scripts/statusline.mjs +3 -4
  115. package/server/piecemaker/vendor/websocket-server/admin-routes.cjs +1 -49
  116. package/server/piecemaker/vendor/websocket-server/claude-hooks.cjs +14 -12
  117. package/server/piecemaker/vendor/websocket-server/originals-pipeline.cjs +17 -476
  118. package/server/piecemaker/vendor/websocket-server/scripts/convert_and_scan_pipeline.py +2 -2
  119. package/server/piecemaker/vendor/websocket-server/scripts/mineru_improved_1.py +11 -2
  120. package/server/piecemaker/vendor/websocket-server/scripts/presidio-gliner/scanner_worker.py +13 -37
  121. package/server/piecemaker/vendor/websocket-server/scripts/requirements.txt +1 -7
  122. package/server/piecemaker/vendor/websocket-server/scripts/warmup.py +14 -85
  123. package/dist/assets/channel-DdzrPZ6Y.js +0 -1
  124. package/dist/assets/classDiagram-ZZMXUADV-Dim2o8E5.js +0 -1
  125. package/dist/assets/classDiagram-v2-VYDZK3BY-Dim2o8E5.js +0 -1
  126. package/dist/assets/index-D_Dc_nQv.css +0 -1
  127. package/dist/assets/swimlanesDiagram-VR7AAH4N-DR525d5V.js +0 -8
  128. package/server/piecemaker/anonymizer/proxy.cjs +0 -365
  129. package/server/piecemaker/vendor/installer/assets/PieceMakerApp.swift +0 -189
  130. package/server/piecemaker/vendor/installer/lib/desktop-launcher.mjs +0 -305
  131. package/server/piecemaker/vendor/installer/steps/05-certificats.mjs +0 -171
  132. package/server/piecemaker/vendor/installer/steps/14-mxc-sandbox.mjs +0 -271
  133. package/server/piecemaker/vendor/installer/steps/15-pwa-desktop.mjs +0 -64
  134. package/server/piecemaker/vendor/installer/templates/root-CLAUDE.md +0 -56
  135. package/server/piecemaker/vendor/installer/templates/workspace-CLAUDE.md +0 -52
@@ -1,271 +0,0 @@
1
- /**
2
- * Step 14 — mxc OS-level filesystem sandbox (best-effort, optional).
3
- *
4
- * Builds microsoft/mxc (https://github.com/microsoft/mxc) and records the
5
- * executor binary so the task-pane Claude Code session can run under Seatbelt
6
- * (macOS) / ProcessContainer (Windows), with the Python venv and the
7
- * anonymisation mappings denied at the syscall level. This hardens the
8
- * PreToolUse hooks, which parse command text and are bypassable (see
9
- * docs/mxc-sandbox.md).
10
- *
11
- * Deliberately best-effort: mxc needs the
12
- * Rust toolchain, self-declares "not a security boundary currently", and its
13
- * value is defence-in-depth. Any failure falls back cleanly to the hooks and
14
- * never fails the install — the step is `required: false`. The runtime side
15
- * (websocket-server/mxc-sandbox.cjs) simply spawns the bare shell when no binary
16
- * is recorded.
17
- */
18
-
19
- import fs from 'node:fs';
20
- import os from 'node:os';
21
- import path from 'node:path';
22
- import { log, spinner, columns } from '../lib/ui.mjs';
23
- import { confirm } from '../lib/prompt.mjs';
24
- import {
25
- run,
26
- runCapture,
27
- commandExists,
28
- compareVersions,
29
- ensureDir,
30
- HOME_DIR,
31
- IS_WINDOWS,
32
- IS_MAC,
33
- } from '../lib/platform.mjs';
34
- import { updateConfig, writeEnv } from '../lib/state.mjs';
35
-
36
- export const meta = {
37
- id: '14-mxc-sandbox',
38
- label: 'Confinement OS (mxc)',
39
- description: 'Construit microsoft/mxc pour isoler la session Claude Code (venv + mappings) au niveau système',
40
- required: false,
41
- };
42
-
43
- const MXC_TAG = 'v0.7.0';
44
- const MXC_REPO = 'https://github.com/microsoft/mxc';
45
- const MXC_SRC = path.join(HOME_DIR, 'mxc-src');
46
- const MXC_BIN_DIR = path.join(HOME_DIR, 'mxc');
47
- const BIN_NAME = IS_WINDOWS ? 'wxc-exec.exe' : 'mxc-exec-mac';
48
-
49
- function truncate(text) {
50
- const width = Math.max(20, columns() - 6);
51
- const s = String(text).replace(/\s+/g, ' ').trim();
52
- return s.length > width ? `${s.slice(0, width - 1)}…` : s;
53
- }
54
-
55
- /** Prepend ~/.cargo/bin so a freshly installed rustup is visible without a new shell. */
56
- function buildEnv() {
57
- const cargoBin = path.join(os.homedir(), '.cargo', 'bin');
58
- const pathKey = Object.keys(process.env).find((k) => k.toLowerCase() === 'path') || 'PATH';
59
- return {
60
- ...process.env,
61
- [pathKey]: [cargoBin, process.env[pathKey] || ''].filter(Boolean).join(path.delimiter),
62
- };
63
- }
64
-
65
- function cargoVersion(env) {
66
- const res = runCapture('cargo', ['--version'], { env });
67
- if (res.code !== 0) return null;
68
- const m = res.stdout.match(/cargo\s+(\d+\.\d+\.\d+)/);
69
- return m ? m[1] : 'unknown';
70
- }
71
-
72
- /** Recursively find the produced binary under a cargo target/ tree. */
73
- function findBinary(root) {
74
- const stack = [root];
75
- while (stack.length) {
76
- const dir = stack.pop();
77
- let entries = [];
78
- try {
79
- entries = fs.readdirSync(dir, { withFileTypes: true });
80
- } catch {
81
- continue;
82
- }
83
- for (const entry of entries) {
84
- const full = path.join(dir, entry.name);
85
- if (entry.isDirectory()) stack.push(full);
86
- else if (entry.name === BIN_NAME) return full;
87
- }
88
- }
89
- return null;
90
- }
91
-
92
- async function ensureRust(env) {
93
- if (commandExists('cargo', ['--version'])) {
94
- const v = cargoVersion(env);
95
- // rust-toolchain.toml in the repo pins 1.93; rustup auto-fetches it at build
96
- // time, so any rustup-backed cargo is fine. A very old non-rustup cargo will
97
- // fail the build, which we surface as `partial`, not a crash.
98
- log.info(`Rust présent (cargo ${v}).`);
99
- return { ok: true };
100
- }
101
-
102
- log.warn("Rust (cargo) est introuvable — nécessaire pour construire mxc.");
103
- const install = await confirm('Installer la chaîne Rust (rustup) maintenant ?', true);
104
- if (!install) return { ok: false, note: 'Rust non installé — la protection reste assurée par les hooks.' };
105
-
106
- const spin = spinner('Installation de rustup...');
107
- let code;
108
- if (IS_WINDOWS) {
109
- // winget is the least-fragile unattended path on Windows; if absent the
110
- // step degrades to a manual instruction below.
111
- code = await run('winget', ['install', '--id', 'Rustlang.Rustup', '-e', '--silent', '--accept-source-agreements', '--accept-package-agreements'], {
112
- env,
113
- onLine: (line) => spin.update(truncate(line)),
114
- }).catch(() => 1);
115
- } else {
116
- code = await run('sh', ['-c', "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"], {
117
- env,
118
- onLine: (line) => spin.update(truncate(line)),
119
- }).catch(() => 1);
120
- }
121
- if (code !== 0 || !commandExists('cargo', ['--version'])) {
122
- spin.fail('Installation de Rust impossible');
123
- return {
124
- ok: false,
125
- note: IS_WINDOWS
126
- ? 'Installez Rust manuellement (https://rustup.rs) puis relancez cette étape.'
127
- : 'Installez Rust manuellement (https://rustup.rs) puis relancez cette étape.',
128
- };
129
- }
130
- spin.succeed(`Rust installé (cargo ${cargoVersion(env)}).`);
131
- return { ok: true };
132
- }
133
-
134
- async function fetchSource(env) {
135
- if (fs.existsSync(path.join(MXC_SRC, '.git'))) {
136
- const spin = spinner('Mise à jour des sources mxc...');
137
- await run('git', ['-C', MXC_SRC, 'fetch', '--depth', '1', 'origin', 'tag', MXC_TAG], { env, onLine: (l) => spin.update(truncate(l)) }).catch(() => 1);
138
- const code = await run('git', ['-C', MXC_SRC, 'checkout', '-f', MXC_TAG], { env, onLine: (l) => spin.update(truncate(l)) }).catch(() => 1);
139
- if (code === 0) { spin.succeed(`Sources mxc à jour (${MXC_TAG}).`); return { ok: true }; }
140
- spin.fail('Mise à jour des sources mxc impossible'); // fall through to a clean clone
141
- try { fs.rmSync(MXC_SRC, { recursive: true, force: true }); } catch { /* best-effort */ }
142
- }
143
-
144
- ensureDir(path.dirname(MXC_SRC));
145
- const spin = spinner(`Clonage de mxc (${MXC_TAG})...`);
146
- const code = await run('git', ['clone', '--depth', '1', '--branch', MXC_TAG, MXC_REPO, MXC_SRC], {
147
- env,
148
- onLine: (line) => spin.update(truncate(line)),
149
- }).catch(() => 1);
150
- if (code !== 0) {
151
- spin.fail('Clonage de mxc impossible');
152
- return { ok: false, note: 'Clonage du dépôt mxc impossible (réseau ?). Relancez cette étape.' };
153
- }
154
- spin.succeed(`Sources mxc récupérées (${MXC_TAG}).`);
155
- return { ok: true };
156
- }
157
-
158
- async function buildBinary(env) {
159
- const spin = spinner('Construction de mxc (peut prendre plusieurs minutes)...');
160
- let code;
161
- if (IS_WINDOWS) {
162
- code = await run('cmd', ['/c', 'build.bat'], { cwd: MXC_SRC, env, onLine: (l) => spin.update(truncate(l)) }).catch(() => 1);
163
- } else {
164
- // --rust-only : on n'utilise que le binaire natif, pas le SDK Node.
165
- code = await run('bash', ['build-mac.sh', '--rust-only'], { cwd: MXC_SRC, env, onLine: (l) => spin.update(truncate(l)) }).catch(() => 1);
166
- }
167
- if (code !== 0) {
168
- spin.fail('Construction de mxc échouée');
169
- return { ok: false, note: `La construction de mxc a échoué (code ${code}). La protection reste assurée par les hooks.` };
170
- }
171
-
172
- const built = findBinary(path.join(MXC_SRC, 'src', 'target')) || findBinary(MXC_SRC);
173
- if (!built) {
174
- spin.fail('Binaire mxc introuvable après construction');
175
- return { ok: false, note: `Binaire ${BIN_NAME} introuvable après construction. Relancez cette étape.` };
176
- }
177
-
178
- ensureDir(MXC_BIN_DIR);
179
- const dest = path.join(MXC_BIN_DIR, BIN_NAME);
180
- fs.copyFileSync(built, dest);
181
- try { fs.chmodSync(dest, 0o755); } catch { /* Windows ignore les modes POSIX */ }
182
-
183
- // La macOS bundle un proxy sibling (unix-test-proxy) attendu à côté du binaire.
184
- const siblingProxy = path.join(path.dirname(built), 'unix-test-proxy');
185
- if (fs.existsSync(siblingProxy)) {
186
- try { fs.copyFileSync(siblingProxy, path.join(MXC_BIN_DIR, 'unix-test-proxy')); } catch { /* best-effort */ }
187
- }
188
-
189
- spin.succeed(`Binaire mxc prêt : ${dest}`);
190
- return { ok: true, path: dest };
191
- }
192
-
193
- /** Prove the sandbox actually denies a file (macOS/Linux). Windows has no deniedPaths. */
194
- function enforcementProof(mxcPath, env) {
195
- if (IS_WINDOWS) return { supported: false };
196
- const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'mxc-proof-'));
197
- const secret = path.join(dir, 'canary.txt');
198
- const token = 'PIECEMAKER_MXC_CANARY_5R7';
199
- fs.writeFileSync(secret, token, 'utf8');
200
- const cfg = {
201
- version: '0.7.0-alpha',
202
- containment: IS_MAC ? 'seatbelt' : 'process',
203
- process: { commandLine: `/bin/cat ${secret}`, cwd: dir, timeout: 10000 },
204
- filesystem: { deniedPaths: [secret] },
205
- network: { defaultPolicy: 'allow' },
206
- ...(IS_MAC ? { seatbelt: { launchMethod: 'exec' } } : {}),
207
- };
208
- const cfgPath = path.join(dir, 'policy.json');
209
- fs.writeFileSync(cfgPath, JSON.stringify(cfg, null, 2), 'utf8');
210
- const res = runCapture(mxcPath, [cfgPath], { env });
211
- const blocked = !`${res.stdout}\n${res.stderr}`.includes(token);
212
- try { fs.rmSync(dir, { recursive: true, force: true }); } catch { /* best-effort */ }
213
- return { supported: true, blocked };
214
- }
215
-
216
- export async function install(ctx) {
217
- if (!IS_MAC && !IS_WINDOWS) {
218
- return { status: 'skipped', note: 'Plateforme non prise en charge par cette étape (macOS/Windows).' };
219
- }
220
- if (ctx.dryRun) {
221
- log.info(`[simulation] clonage/build de mxc (${MXC_TAG}) dans ${MXC_SRC}`);
222
- log.info(`[simulation] binaire copié vers ${path.join(MXC_BIN_DIR, BIN_NAME)}`);
223
- log.info('[simulation] config.mxcPath + PIECEMAKER_MXC_PATH enregistrés');
224
- return { status: 'skipped', note: 'Mode simulation — aucune modification effectuée.' };
225
- }
226
-
227
- const env = buildEnv();
228
-
229
- if (!commandExists('git', ['--version'])) {
230
- return { status: 'partial', note: 'git introuvable — installez git puis relancez. Protection assurée par les hooks entretemps.' };
231
- }
232
-
233
- const rust = await ensureRust(env);
234
- if (!rust.ok) return { status: 'partial', note: rust.note };
235
-
236
- const src = await fetchSource(env);
237
- if (!src.ok) return { status: 'partial', note: src.note };
238
-
239
- const build = await buildBinary(env);
240
- if (!build.ok) return { status: 'partial', note: build.note };
241
-
242
- updateConfig({ mxcPath: build.path, mxcEnabled: true });
243
- writeEnv({ PIECEMAKER_MXC_PATH: build.path });
244
-
245
- const proof = enforcementProof(build.path, env);
246
- if (proof.supported && !proof.blocked) {
247
- log.warn("Le binaire mxc n'a pas bloqué le fichier témoin — confinement désactivé par sécurité (repli hooks).");
248
- updateConfig({ mxcEnabled: false });
249
- return { status: 'partial', note: 'mxc construit mais le confinement ne bloque pas — désactivé, protection par hooks. Relancez après diagnostic.' };
250
- }
251
-
252
- log.ok('Confinement OS actif : la session Claude Code du volet isole le venv et les mappings.');
253
- log.detail('Défense en profondeur — les hooks restent actifs. Désactivable via PIECEMAKER_MXC_DISABLE=1.');
254
- return { status: proof.supported ? 'done' : 'done', note: proof.supported ? '' : 'Windows : venv + mapping central protégés par omission ; mapping_default reste couvert par les hooks.' };
255
- }
256
-
257
- export async function check(ctx) {
258
- const config = ctx.config || {};
259
- const binPath = process.env.PIECEMAKER_MXC_PATH || config.mxcPath || path.join(MXC_BIN_DIR, BIN_NAME);
260
- if (!binPath || !fs.existsSync(binPath)) {
261
- return { status: 'failed', note: 'Binaire mxc absent — étape optionnelle ; la protection par hooks reste active.' };
262
- }
263
- if (config.mxcEnabled === false) {
264
- return { status: 'partial', note: 'mxc présent mais désactivé (config.mxcEnabled=false).' };
265
- }
266
- const proof = enforcementProof(binPath, buildEnv());
267
- if (proof.supported && !proof.blocked) {
268
- return { status: 'partial', note: 'mxc présent mais ne bloque pas le fichier témoin — relancez après diagnostic.' };
269
- }
270
- return { status: 'done', note: proof.supported ? '' : 'Windows : confinement par liste blanche (mapping_default reste couvert par les hooks).' };
271
- }
@@ -1,64 +0,0 @@
1
- /**
2
- * Étape 15 — application native PieceMaker sur le Bureau.
3
- *
4
- * Compile une app Swift (WKWebView) si swiftc est disponible, sinon un
5
- * lanceur shell qui ouvre le navigateur. Le gestionnaire de protocole
6
- * `piecemaker:` permet à la page hors ligne de relancer le serveur.
7
- */
8
-
9
- import { installDesktopLauncher, desktopLauncherStatus } from '../lib/desktop-launcher.mjs';
10
- import { confirm } from '../lib/prompt.mjs';
11
- import { log } from '../lib/ui.mjs';
12
-
13
- export const meta = {
14
- id: '15-pwa-desktop',
15
- label: 'Application PieceMaker sur le Bureau',
16
- description: `Installe une application native (WKWebView) qui démarre le serveur et affiche l'administration`,
17
- required: false,
18
- };
19
-
20
- function launcherResult(result, action = 'créée') {
21
- const mode = result.native ? 'native (WKWebView)' : 'lanceur navigateur';
22
- if (!result.protocolReady) {
23
- return {
24
- status: 'partial',
25
- note: `Application ${mode} ${action} (${result.shortcut}), mais le protocole piecemaker: n'a pas pu être enregistré${result.protocolError ? ` : ${result.protocolError}` : '.'}`,
26
- };
27
- }
28
- return { status: 'done', note: `Application ${mode} ${action} : ${result.shortcut}` };
29
- }
30
-
31
- /**
32
- * Réinstalle l'application seulement si l'utilisateur l'avait déjà installée.
33
- * `piecemaker update` peut ainsi rejouer l'étape 15 sans créer un raccourci
34
- * qui avait été refusé lors de l'installation initiale.
35
- */
36
- export function refreshInstalledDesktopApplication({
37
- status = desktopLauncherStatus(),
38
- installLauncher = installDesktopLauncher,
39
- } = {}) {
40
- if (!status.shortcutReady && !status.protocolReady) {
41
- return { status: 'skipped', note: 'Application PieceMaker absente du Bureau.' };
42
- }
43
- return launcherResult(installLauncher(), 'mise à jour');
44
- }
45
-
46
- export async function install(ctx) {
47
- if (ctx.dryRun) {
48
- log.info(`[simulation] proposition d'ajouter PieceMaker au Bureau`);
49
- return { status: 'skipped', note: 'Mode simulation — aucune modification effectuée.' };
50
- }
51
-
52
- if (!await confirm(`Installer l'application PieceMaker sur le Bureau ?`, true)) {
53
- return { status: 'skipped', note: 'Application Bureau refusée.' };
54
- }
55
-
56
- return launcherResult(installDesktopLauncher());
57
- }
58
-
59
- export async function check() {
60
- const status = desktopLauncherStatus();
61
- if (status.shortcutReady && status.protocolReady) return { status: 'done', note: status.shortcut };
62
- if (status.shortcutReady) return { status: 'partial', note: 'Application présente, mais protocole piecemaker: absent.' };
63
- return { status: 'partial', note: 'Application PieceMaker absente du Bureau.' };
64
- }
@@ -1,56 +0,0 @@
1
- # Avocat
2
- Tâches juridiques : Analyse de pièces, recherche juridique et rédaction de draft, tenue de la chronologie des dossiers, des délais.
3
-
4
- ## Confidentialité
5
- Aucun accès fichier source, texte pseudonymisés. Pseudonymisation à respecter strictement dans toute réponse.
6
-
7
- ## Restrictions
8
- Ne jamais citer une jurisprudence sans intégrer sa citation exacte.
9
- Ne jamais citer une disposition légale sans confirmer la version en vigueur.
10
- Toujours signaler un délai identifié — l'avocat doit vérifier indépendamment.
11
-
12
- ## Exigences de rédaction
13
- Ne jamais rien rédiger sans lire préalablement le skill redaction.
14
- Ne jamais produire de résultat présenté comme final — chaque document est un brouillon soumis à révision.
15
- Langage professionnel, en français.
16
-
17
- ## Chronologie du dossier
18
-
19
- Pour une demande limitée aux dates, aux acteurs ou à l'ordre des pièces,
20
- appeler **avant toute lecture de pièce** l'outil `chronologie` du serveur MCP
21
- `piecemaker`.
22
-
23
- Il renvoie l'index chronologique pseudonymisé du
24
- dossier courant. Ne commencer à lire les Markdown convertis que pour vérifier ou
25
- compléter les dates signalées comme absentes ou incertaines. Ne jamais commencer
26
- par parcourir l'ensemble du dossier.
27
-
28
- ## Commit de fin de session
29
-
30
- **Obligatoire.** Avant de conclure toute session ayant produit des
31
- modifications (fichiers édités, créés ou supprimés), Claude **doit** :
32
-
33
- 1. Vérifier `git status` : si des changements existent, créer un commit sur
34
- `main` qui :
35
- - Stage les fichiers modifiés pertinents (`git add` ciblé, pas `-A`
36
- aveugle — exclure `.env`, secrets, fichiers générés non versionnés).
37
- - Porte un message au format :
38
-
39
- ```
40
- session: <résumé concis des changements>
41
-
42
- Temps passé : ~<N> min
43
- Co-Authored-By: Claude <model> <noreply@anthropic.com>
44
- ```
45
-
46
- Le temps est estimé depuis le premier message utilisateur jusqu'au commit.
47
- - Ne pousse **pas** vers le remote (sauf demande explicite).
48
-
49
- 2. Vérifier que le hook `SessionEnd` (`.claude/hooks/session-autocommit.mjs`)
50
- est toujours câblé dans `.claude/settings.json`. S'il manque ou est cassé,
51
- le rétablir. Ce hook sert de filet de sécurité : il capture l'état du
52
- working tree sur la branche `sessions/auto` après la session, même si le
53
- commit explicite a été oublié ou refusé.
54
-
55
- Si l'utilisateur demande explicitement de ne pas commiter, respecter — mais
56
- rappeler que des changements restent non commités.
@@ -1,52 +0,0 @@
1
- # Avocat
2
- Tâches juridiques : Analyse de pièces, recherche juridique et rédaction de draft, tenue de la chronologie des dossiers, des délais.
3
-
4
- ## Confidentialité
5
- Aucun accès fichier source, texte pseudonymisés. Pseudonymisation à respecter strictement dans toute réponse.
6
-
7
- ## Restrictions
8
- Ne jamais citer une jurisprudence sans intégrer sa citation exacte.
9
- Ne jamais citer une disposition légale sans confirmer la version en vigueur.
10
- Toujours signaler un délai identifié — l'avocat doit vérifier indépendamment.
11
-
12
- ## Exigences de rédaction
13
- Ne jamais rien rédiger sans lire préalablement le skill redaction.
14
- Ne jamais produire de résultat présenté comme final — chaque document est un brouillon soumis à révision.
15
- Langage professionnel, en français.
16
-
17
- ## Facturation
18
-
19
- Les hooks `Stop` et `TaskCompleted` (`billing-track.mjs`) alimentent
20
- `~/.piecemaker/billing/<AAAA-MM>.jsonl` et les synthèses associées. Suivi
21
- automatique du temps par dossier ; consultable en lecture seule depuis
22
- l'administration.
23
-
24
- ## Chronologie
25
-
26
- ### Règle prioritaire
27
-
28
- Pour toute demande portant sur la chronologie, une date ou les acteurs,
29
- commencer obligatoirement par l'outil `chronologie` du
30
- serveur MCP `piecemaker`. Il renvoie :
31
-
32
- - les pièces déjà triées chronologiquement ;
33
- - leurs dates, natures et juridictions indexées ;
34
- - les corrections structurées apportées par le cabinet ;
35
- - les codes d'entités détectés dans les pièces ;
36
- - les dates manquantes et les métadonnées restant à vérifier.
37
-
38
- Ne pas annoncer « je vais examiner le contenu du dossier » avant cet appel.
39
- Ne lire ensuite que les Markdown convertis nécessaires pour vérifier un point
40
- incertain ou compléter une date absente.
41
-
42
- ## Repères
43
-
44
- | Quoi | Où |
45
- | --- | --- |
46
- | Racine des dossiers | ce répertoire (`workspacePath` de `~/.piecemaker/config.json`) |
47
- | Administration | `https://localhost:43098/admin/` |
48
- | Serveur | `piecemaker start` / `stop` / `restart` / `status` / `logs` |
49
- | Outils de l'assistant | serveur MCP `piecemaker` : `chronologie`, `conversion` |
50
- | Historique des dossiers | `~/.piecemaker/case-history/` |
51
- | Facturation | `~/.piecemaker/billing/` |
52
- | Configuration | `~/.piecemaker/config.json` |