@jpkme/diff-review 0.1.14 → 0.1.16

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 (129) hide show
  1. package/bin/diff-review.mjs +141 -77
  2. package/lib/acp-policy.mjs +10 -2
  3. package/lib/acp-policy.test.mjs +27 -0
  4. package/lib/acp-shell.mjs +23 -1
  5. package/lib/acp-shell.test.mjs +7 -0
  6. package/lib/output-name.mjs +7 -0
  7. package/lib/prompt.mjs +3 -2
  8. package/lib/prompt.test.mjs +37 -0
  9. package/lib/review-dir.mjs +14 -1
  10. package/lib/review.mjs +36 -4
  11. package/lib/review.test.mjs +35 -0
  12. package/lib/validate.mjs +10 -0
  13. package/lib/validate.test.mjs +47 -0
  14. package/package.json +1 -1
  15. package/schema.json +16 -1
  16. package/web/build/client/_app/immutable/assets/3.DB-bJJq2.css +1 -0
  17. package/web/build/client/_app/immutable/assets/3.DB-bJJq2.css.br +0 -0
  18. package/web/build/client/_app/immutable/assets/3.DB-bJJq2.css.gz +0 -0
  19. package/web/build/client/_app/immutable/assets/{storage.C8XGESwn.css → storage.BxR6930R.css} +1 -1
  20. package/web/build/client/_app/immutable/assets/storage.BxR6930R.css.br +0 -0
  21. package/web/build/client/_app/immutable/assets/{storage.C8XGESwn.css.gz → storage.BxR6930R.css.gz} +0 -0
  22. package/web/build/client/_app/immutable/chunks/BLMWhW3J.js +1 -0
  23. package/web/build/client/_app/immutable/chunks/BLMWhW3J.js.br +1 -0
  24. package/web/build/client/_app/immutable/chunks/BLMWhW3J.js.gz +0 -0
  25. package/web/build/client/_app/immutable/chunks/{D8WOD_eS.js → CXhIC34H.js} +1 -1
  26. package/web/build/client/_app/immutable/chunks/CXhIC34H.js.br +0 -0
  27. package/web/build/client/_app/immutable/chunks/CXhIC34H.js.gz +0 -0
  28. package/web/build/client/_app/immutable/chunks/{C0hrdiUt.js → DHO7NTh1.js} +2 -2
  29. package/web/build/client/_app/immutable/chunks/DHO7NTh1.js.br +0 -0
  30. package/web/build/client/_app/immutable/chunks/DHO7NTh1.js.gz +0 -0
  31. package/web/build/client/_app/immutable/chunks/DpxY75GB.js +215 -0
  32. package/web/build/client/_app/immutable/chunks/DpxY75GB.js.br +0 -0
  33. package/web/build/client/_app/immutable/chunks/DpxY75GB.js.gz +0 -0
  34. package/web/build/client/_app/immutable/chunks/{FOc6rgIW.js → cYiFfRa3.js} +1 -1
  35. package/web/build/client/_app/immutable/chunks/cYiFfRa3.js.br +1 -0
  36. package/web/build/client/_app/immutable/chunks/cYiFfRa3.js.gz +0 -0
  37. package/web/build/client/_app/immutable/entry/{app.DcAtSJ3n.js → app.CCv57mvp.js} +2 -2
  38. package/web/build/client/_app/immutable/entry/app.CCv57mvp.js.br +0 -0
  39. package/web/build/client/_app/immutable/entry/app.CCv57mvp.js.gz +0 -0
  40. package/web/build/client/_app/immutable/entry/start.B012TSbW.js +1 -0
  41. package/web/build/client/_app/immutable/entry/start.B012TSbW.js.br +1 -0
  42. package/web/build/client/_app/immutable/entry/start.B012TSbW.js.gz +0 -0
  43. package/web/build/client/_app/immutable/nodes/0.slrnBioC.js +1 -0
  44. package/web/build/client/_app/immutable/nodes/0.slrnBioC.js.br +0 -0
  45. package/web/build/client/_app/immutable/nodes/0.slrnBioC.js.gz +0 -0
  46. package/web/build/client/_app/immutable/nodes/1.Bs5JdO4l.js +1 -0
  47. package/web/build/client/_app/immutable/nodes/1.Bs5JdO4l.js.br +0 -0
  48. package/web/build/client/_app/immutable/nodes/1.Bs5JdO4l.js.gz +0 -0
  49. package/web/build/client/_app/immutable/nodes/2.D5ULH3EX.js +10 -0
  50. package/web/build/client/_app/immutable/nodes/2.D5ULH3EX.js.br +0 -0
  51. package/web/build/client/_app/immutable/nodes/2.D5ULH3EX.js.gz +0 -0
  52. package/web/build/client/_app/immutable/nodes/3.hjzQQgyj.js +173 -0
  53. package/web/build/client/_app/immutable/nodes/3.hjzQQgyj.js.br +0 -0
  54. package/web/build/client/_app/immutable/nodes/3.hjzQQgyj.js.gz +0 -0
  55. package/web/build/client/_app/version.json +1 -1
  56. package/web/build/client/_app/version.json.br +0 -0
  57. package/web/build/client/_app/version.json.gz +0 -0
  58. package/web/build/handler.js +3 -3
  59. package/web/build/index.js +3 -3
  60. package/web/build/server/chunks/{0-DUStDOsr.js → 0-D7NSxn1-.js} +2 -2
  61. package/web/build/server/chunks/{0-DUStDOsr.js.map → 0-D7NSxn1-.js.map} +1 -1
  62. package/web/build/server/chunks/1-DboYz8Fw.js +7 -0
  63. package/web/build/server/chunks/{1-BFhhV5JB.js.map → 1-DboYz8Fw.js.map} +1 -1
  64. package/web/build/server/chunks/2-B7LX817Q.js +7 -0
  65. package/web/build/server/chunks/2-B7LX817Q.js.map +1 -0
  66. package/web/build/server/chunks/3-DgJ_LmTL.js +7 -0
  67. package/web/build/server/chunks/{3-BV-TIUp1.js.map → 3-DgJ_LmTL.js.map} +1 -1
  68. package/web/build/server/chunks/{_server.ts-CdFoXw36.js → _server.ts-CP5cRLhW.js} +4 -4
  69. package/web/build/server/chunks/{_server.ts-CdFoXw36.js.map → _server.ts-CP5cRLhW.js.map} +1 -1
  70. package/web/build/server/chunks/{agent-sessions-D0WwtWgR.js → agent-sessions-2XGojSJ_.js} +105 -16
  71. package/web/build/server/chunks/agent-sessions-2XGojSJ_.js.map +1 -0
  72. package/web/build/server/chunks/{git-review-CgcBIbvM.js → git-review-jZ_JJYfv.js} +36 -8
  73. package/web/build/server/chunks/git-review-jZ_JJYfv.js.map +1 -0
  74. package/web/build/server/chunks/{handler-DbxjtK9M.js → handler-B_8yUXji.js} +3 -3
  75. package/web/build/server/chunks/{handler-DbxjtK9M.js.map → handler-B_8yUXji.js.map} +1 -1
  76. package/web/build/server/chunks/{hooks.server-Dg6gYUqs.js → hooks.server-rF_eBCff.js} +3 -3
  77. package/web/build/server/chunks/{hooks.server-Dg6gYUqs.js.map → hooks.server-rF_eBCff.js.map} +1 -1
  78. package/web/build/server/chunks/{index.js-NNne-njN.js → index.js-CGw8_Q7V.js} +884 -881
  79. package/web/build/server/chunks/index.js-CGw8_Q7V.js.map +1 -0
  80. package/web/build/server/chunks/{manifest.js-V8ViI5bl.js → manifest.js-CImZFS6G.js} +9 -9
  81. package/web/build/server/chunks/{manifest.js-V8ViI5bl.js.map → manifest.js-CImZFS6G.js.map} +1 -1
  82. package/web/build/server/chunks/{remote-1g4ayag-CCsG2QXw.js → remote-1g4ayag-BMpjk8UD.js} +4 -4
  83. package/web/build/server/chunks/{remote-1g4ayag-CCsG2QXw.js.map → remote-1g4ayag-BMpjk8UD.js.map} +1 -1
  84. package/web/build/server/chunks/{remote-wh6t6j-BCvmX37z.js → remote-wh6t6j-dYLCg8ks.js} +19 -7
  85. package/web/build/server/chunks/remote-wh6t6j-dYLCg8ks.js.map +1 -0
  86. package/web/build/server/chunks/{validate-CAQ31C7k.js → validate-Da6e71V3.js} +34 -5
  87. package/web/build/server/chunks/validate-Da6e71V3.js.map +1 -0
  88. package/web/build/client/_app/immutable/assets/3.BT54aVKb.css +0 -1
  89. package/web/build/client/_app/immutable/assets/3.BT54aVKb.css.br +0 -0
  90. package/web/build/client/_app/immutable/assets/3.BT54aVKb.css.gz +0 -0
  91. package/web/build/client/_app/immutable/assets/storage.C8XGESwn.css.br +0 -0
  92. package/web/build/client/_app/immutable/chunks/C0hrdiUt.js.br +0 -0
  93. package/web/build/client/_app/immutable/chunks/C0hrdiUt.js.gz +0 -0
  94. package/web/build/client/_app/immutable/chunks/CpeIO6nz.js +0 -210
  95. package/web/build/client/_app/immutable/chunks/CpeIO6nz.js.br +0 -0
  96. package/web/build/client/_app/immutable/chunks/CpeIO6nz.js.gz +0 -0
  97. package/web/build/client/_app/immutable/chunks/D8WOD_eS.js.br +0 -0
  98. package/web/build/client/_app/immutable/chunks/D8WOD_eS.js.gz +0 -0
  99. package/web/build/client/_app/immutable/chunks/FOc6rgIW.js.br +0 -2
  100. package/web/build/client/_app/immutable/chunks/FOc6rgIW.js.gz +0 -0
  101. package/web/build/client/_app/immutable/chunks/lUYXRDtZ.js +0 -1
  102. package/web/build/client/_app/immutable/chunks/lUYXRDtZ.js.br +0 -0
  103. package/web/build/client/_app/immutable/chunks/lUYXRDtZ.js.gz +0 -0
  104. package/web/build/client/_app/immutable/entry/app.DcAtSJ3n.js.br +0 -0
  105. package/web/build/client/_app/immutable/entry/app.DcAtSJ3n.js.gz +0 -0
  106. package/web/build/client/_app/immutable/entry/start.CO5l0Zbx.js +0 -1
  107. package/web/build/client/_app/immutable/entry/start.CO5l0Zbx.js.br +0 -0
  108. package/web/build/client/_app/immutable/entry/start.CO5l0Zbx.js.gz +0 -0
  109. package/web/build/client/_app/immutable/nodes/0.Dj97JW46.js +0 -1
  110. package/web/build/client/_app/immutable/nodes/0.Dj97JW46.js.br +0 -0
  111. package/web/build/client/_app/immutable/nodes/0.Dj97JW46.js.gz +0 -0
  112. package/web/build/client/_app/immutable/nodes/1.E-Hs7ura.js +0 -1
  113. package/web/build/client/_app/immutable/nodes/1.E-Hs7ura.js.br +0 -4
  114. package/web/build/client/_app/immutable/nodes/1.E-Hs7ura.js.gz +0 -0
  115. package/web/build/client/_app/immutable/nodes/2.s1_irV1Q.js +0 -10
  116. package/web/build/client/_app/immutable/nodes/2.s1_irV1Q.js.br +0 -0
  117. package/web/build/client/_app/immutable/nodes/2.s1_irV1Q.js.gz +0 -0
  118. package/web/build/client/_app/immutable/nodes/3.pgwe-_5b.js +0 -171
  119. package/web/build/client/_app/immutable/nodes/3.pgwe-_5b.js.br +0 -0
  120. package/web/build/client/_app/immutable/nodes/3.pgwe-_5b.js.gz +0 -0
  121. package/web/build/server/chunks/1-BFhhV5JB.js +0 -7
  122. package/web/build/server/chunks/2-BZ_MVqj8.js +0 -7
  123. package/web/build/server/chunks/2-BZ_MVqj8.js.map +0 -1
  124. package/web/build/server/chunks/3-BV-TIUp1.js +0 -7
  125. package/web/build/server/chunks/agent-sessions-D0WwtWgR.js.map +0 -1
  126. package/web/build/server/chunks/git-review-CgcBIbvM.js.map +0 -1
  127. package/web/build/server/chunks/index.js-NNne-njN.js.map +0 -1
  128. package/web/build/server/chunks/remote-wh6t6j-BCvmX37z.js.map +0 -1
  129. package/web/build/server/chunks/validate-CAQ31C7k.js.map +0 -1
@@ -1 +1 @@
1
- {"version":"1792444085246"}
1
+ {"version":"1792507014372"}
@@ -2,9 +2,9 @@ import './shims.js';
2
2
  import 'node:fs';
3
3
  import 'node:path';
4
4
  import 'node:process';
5
- export { h as handler } from './server/chunks/handler-DbxjtK9M.js';
6
- import './server/chunks/index.js-NNne-njN.js';
7
- import './server/chunks/manifest.js-V8ViI5bl.js';
5
+ export { h as handler } from './server/chunks/handler-B_8yUXji.js';
6
+ import './server/chunks/index.js-CGw8_Q7V.js';
7
+ import './server/chunks/manifest.js-CImZFS6G.js';
8
8
  import './env.js';
9
9
  import 'node:buffer';
10
10
  import 'node:crypto';
@@ -1,7 +1,7 @@
1
1
  import http from 'node:http';
2
2
  import fs__default from 'node:fs';
3
3
  import process from 'node:process';
4
- import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-DbxjtK9M.js';
4
+ import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-B_8yUXji.js';
5
5
  import { env, timeout_env } from './env.js';
6
6
  import { rm } from 'node:fs/promises';
7
7
  import './shims.js';
@@ -11,8 +11,8 @@ import 'node:path';
11
11
  import 'node:timers';
12
12
  import 'node:querystring';
13
13
  import 'node:stream';
14
- import './server/chunks/index.js-NNne-njN.js';
15
- import './server/chunks/manifest.js-V8ViI5bl.js';
14
+ import './server/chunks/index.js-CGw8_Q7V.js';
15
+ import './server/chunks/manifest.js-CImZFS6G.js';
16
16
  import 'node:url';
17
17
 
18
18
  const path = env('SOCKET_PATH', false);
@@ -3,9 +3,9 @@ const universal = {
3
3
  "ssr": false
4
4
  };
5
5
  const universal_id = "src/routes/+layout.ts";
6
- const imports = ["_app/immutable/nodes/0.Dj97JW46.js","_app/immutable/chunks/D8WOD_eS.js","_app/immutable/chunks/lUYXRDtZ.js","_app/immutable/chunks/BZfQ9INH.js"];
6
+ const imports = ["_app/immutable/nodes/0.slrnBioC.js","_app/immutable/chunks/CXhIC34H.js","_app/immutable/chunks/BLMWhW3J.js","_app/immutable/chunks/BZfQ9INH.js"];
7
7
  const stylesheets = ["_app/immutable/assets/0.BKRG1f36.css"];
8
8
  const fonts = [];
9
9
 
10
10
  export { fonts, imports, index, stylesheets, universal, universal_id };
11
- //# sourceMappingURL=0-DUStDOsr.js.map
11
+ //# sourceMappingURL=0-D7NSxn1-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"0-DUStDOsr.js","sources":["../../../.svelte-kit/output/server/nodes/0.js"],"sourcesContent":["\n\nexport const index = 0;\nexport const universal = {\n \"ssr\": false\n};\nexport const universal_id = \"src/routes/+layout.ts\";\nexport const imports = [\"_app/immutable/nodes/0.Dj97JW46.js\",\"_app/immutable/chunks/D8WOD_eS.js\",\"_app/immutable/chunks/lUYXRDtZ.js\",\"_app/immutable/chunks/BZfQ9INH.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.BKRG1f36.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACT,MAAC,SAAS,GAAG;AACzB,EAAE,KAAK,EAAE;AACT;AACY,MAAC,YAAY,GAAG;AAChB,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAC5J,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG;;"}
1
+ {"version":3,"file":"0-D7NSxn1-.js","sources":["../../../.svelte-kit/output/server/nodes/0.js"],"sourcesContent":["\n\nexport const index = 0;\nexport const universal = {\n \"ssr\": false\n};\nexport const universal_id = \"src/routes/+layout.ts\";\nexport const imports = [\"_app/immutable/nodes/0.slrnBioC.js\",\"_app/immutable/chunks/CXhIC34H.js\",\"_app/immutable/chunks/BLMWhW3J.js\",\"_app/immutable/chunks/BZfQ9INH.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.BKRG1f36.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACT,MAAC,SAAS,GAAG;AACzB,EAAE,KAAK,EAAE;AACT;AACY,MAAC,YAAY,GAAG;AAChB,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAC5J,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG;;"}
@@ -0,0 +1,7 @@
1
+ const index = 1;
2
+ const imports = ["_app/immutable/nodes/1.Bs5JdO4l.js","_app/immutable/chunks/CXhIC34H.js","_app/immutable/chunks/BLMWhW3J.js","_app/immutable/chunks/cYiFfRa3.js","_app/immutable/chunks/DHO7NTh1.js"];
3
+ const stylesheets = [];
4
+ const fonts = [];
5
+
6
+ export { fonts, imports, index, stylesheets };
7
+ //# sourceMappingURL=1-DboYz8Fw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"1-BFhhV5JB.js","sources":["../../../.svelte-kit/output/server/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nexport const imports = [\"_app/immutable/nodes/1.E-Hs7ura.js\",\"_app/immutable/chunks/D8WOD_eS.js\",\"_app/immutable/chunks/lUYXRDtZ.js\",\"_app/immutable/chunks/FOc6rgIW.js\",\"_app/immutable/chunks/C0hrdiUt.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACT,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChM,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;"}
1
+ {"version":3,"file":"1-DboYz8Fw.js","sources":["../../../.svelte-kit/output/server/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nexport const imports = [\"_app/immutable/nodes/1.Bs5JdO4l.js\",\"_app/immutable/chunks/CXhIC34H.js\",\"_app/immutable/chunks/BLMWhW3J.js\",\"_app/immutable/chunks/cYiFfRa3.js\",\"_app/immutable/chunks/DHO7NTh1.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACT,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChM,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;"}
@@ -0,0 +1,7 @@
1
+ const index = 2;
2
+ const imports = ["_app/immutable/nodes/2.D5ULH3EX.js","_app/immutable/chunks/CXhIC34H.js","_app/immutable/chunks/DHO7NTh1.js","_app/immutable/chunks/DpxY75GB.js","_app/immutable/chunks/BLMWhW3J.js","_app/immutable/chunks/BZfQ9INH.js","_app/immutable/chunks/cYiFfRa3.js"];
3
+ const stylesheets = ["_app/immutable/assets/storage.BxR6930R.css","_app/immutable/assets/2.C4whE4xz.css"];
4
+ const fonts = [];
5
+
6
+ export { fonts, imports, index, stylesheets };
7
+ //# sourceMappingURL=2-B7LX817Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2-B7LX817Q.js","sources":["../../../.svelte-kit/output/server/nodes/2.js"],"sourcesContent":["\n\nexport const index = 2;\nexport const imports = [\"_app/immutable/nodes/2.D5ULH3EX.js\",\"_app/immutable/chunks/CXhIC34H.js\",\"_app/immutable/chunks/DHO7NTh1.js\",\"_app/immutable/chunks/DpxY75GB.js\",\"_app/immutable/chunks/BLMWhW3J.js\",\"_app/immutable/chunks/BZfQ9INH.js\",\"_app/immutable/chunks/cYiFfRa3.js\"];\nexport const stylesheets = [\"_app/immutable/assets/storage.BxR6930R.css\",\"_app/immutable/assets/2.C4whE4xz.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACT,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACxQ,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,sCAAsC;AACnG,MAAC,KAAK,GAAG;;"}
@@ -0,0 +1,7 @@
1
+ const index = 3;
2
+ const imports = ["_app/immutable/nodes/3.hjzQQgyj.js","_app/immutable/chunks/CXhIC34H.js","_app/immutable/chunks/DHO7NTh1.js","_app/immutable/chunks/DpxY75GB.js","_app/immutable/chunks/BLMWhW3J.js","_app/immutable/chunks/BZfQ9INH.js"];
3
+ const stylesheets = ["_app/immutable/assets/storage.BxR6930R.css","_app/immutable/assets/3.DB-bJJq2.css"];
4
+ const fonts = [];
5
+
6
+ export { fonts, imports, index, stylesheets };
7
+ //# sourceMappingURL=3-DgJ_LmTL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"3-BV-TIUp1.js","sources":["../../../.svelte-kit/output/server/nodes/3.js"],"sourcesContent":["\n\nexport const index = 3;\nexport const imports = [\"_app/immutable/nodes/3.pgwe-_5b.js\",\"_app/immutable/chunks/D8WOD_eS.js\",\"_app/immutable/chunks/C0hrdiUt.js\",\"_app/immutable/chunks/CpeIO6nz.js\",\"_app/immutable/chunks/lUYXRDtZ.js\",\"_app/immutable/chunks/BZfQ9INH.js\"];\nexport const stylesheets = [\"_app/immutable/assets/storage.C8XGESwn.css\",\"_app/immutable/assets/3.BT54aVKb.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACT,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACpO,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,sCAAsC;AACnG,MAAC,KAAK,GAAG;;"}
1
+ {"version":3,"file":"3-DgJ_LmTL.js","sources":["../../../.svelte-kit/output/server/nodes/3.js"],"sourcesContent":["\n\nexport const index = 3;\nexport const imports = [\"_app/immutable/nodes/3.hjzQQgyj.js\",\"_app/immutable/chunks/CXhIC34H.js\",\"_app/immutable/chunks/DHO7NTh1.js\",\"_app/immutable/chunks/DpxY75GB.js\",\"_app/immutable/chunks/BLMWhW3J.js\",\"_app/immutable/chunks/BZfQ9INH.js\"];\nexport const stylesheets = [\"_app/immutable/assets/storage.BxR6930R.css\",\"_app/immutable/assets/3.DB-bJJq2.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACT,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACpO,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,sCAAsC;AACnG,MAAC,KAAK,GAAG;;"}
@@ -1,6 +1,6 @@
1
- import { s as sessionInfo, i as subscribe } from './agent-sessions-D0WwtWgR.js';
2
- import { e as error } from './index.js-NNne-njN.js';
3
- import './validate-CAQ31C7k.js';
1
+ import { s as sessionInfo, j as subscribe } from './agent-sessions-2XGojSJ_.js';
2
+ import { e as error } from './index.js-CGw8_Q7V.js';
3
+ import './validate-Da6e71V3.js';
4
4
  import 'node:fs';
5
5
  import 'node:child_process';
6
6
  import 'node:path';
@@ -59,4 +59,4 @@ var GET = ({ params, request }) => {
59
59
  };
60
60
 
61
61
  export { GET };
62
- //# sourceMappingURL=_server.ts-CdFoXw36.js.map
62
+ //# sourceMappingURL=_server.ts-CP5cRLhW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_server.ts-CdFoXw36.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/agent/_id_/events/_server.ts.js"],"sourcesContent":["import { l as sessionInfo, p as subscribe } from \"../../../../../../chunks/agent-sessions.js\";\nimport { error } from \"@sveltejs/kit\";\n//#region src/routes/api/agent/[id]/events/+server.ts\n/** Eventos de una sesión con el agente (SSE). Al conectar manda `reset` y todo lo acumulado; después, lo nuevo. */\nvar GET = ({ params, request }) => {\n\tif (!sessionInfo(params.id)) error(404, \"La sesión del agente ya no existe.\");\n\tlet unsubscribe = null;\n\tlet ping = null;\n\tconst encoder = new TextEncoder();\n\tconst cleanup = () => {\n\t\tunsubscribe?.();\n\t\tunsubscribe = null;\n\t\tif (ping) clearInterval(ping);\n\t\tping = null;\n\t};\n\tconst stream = new ReadableStream({\n\t\tstart(controller) {\n\t\t\tconst send = (data) => {\n\t\t\t\ttry {\n\t\t\t\t\tcontroller.enqueue(encoder.encode(`data: ${JSON.stringify(data)}\\n\\n`));\n\t\t\t\t} catch {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t};\n\t\t\tunsubscribe = subscribe(params.id, send);\n\t\t\tif (!unsubscribe) {\n\t\t\t\tcontroller.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tping = setInterval(() => {\n\t\t\t\ttry {\n\t\t\t\t\tcontroller.enqueue(encoder.encode(\": ping\\n\\n\"));\n\t\t\t\t} catch {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}, 2e4);\n\t\t\trequest.signal.addEventListener(\"abort\", () => {\n\t\t\t\tcleanup();\n\t\t\t\ttry {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t} catch {}\n\t\t\t});\n\t\t},\n\t\tcancel: cleanup\n\t});\n\treturn new Response(stream, { headers: {\n\t\t\"content-type\": \"text/event-stream\",\n\t\t\"cache-control\": \"no-cache\",\n\t\tconnection: \"keep-alive\"\n\t} });\n};\n//#endregion\nexport { GET };\n"],"names":[],"mappings":";;;;;;;;;;AAEA;AACA;AACG,IAAC,GAAG,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK;AACnC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,oCAAoC,CAAC;AAC9E,CAAC,IAAI,WAAW,GAAG,IAAI;AACvB,CAAC,IAAI,IAAI,GAAG,IAAI;AAChB,CAAC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE;AAClC,CAAC,MAAM,OAAO,GAAG,MAAM;AACvB,EAAE,WAAW,IAAI;AACjB,EAAE,WAAW,GAAG,IAAI;AACpB,EAAE,IAAI,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;AAC/B,EAAE,IAAI,GAAG,IAAI;AACb,CAAC,CAAC;AACF,CAAC,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC;AACnC,EAAE,KAAK,CAAC,UAAU,EAAE;AACpB,GAAG,MAAM,IAAI,GAAG,CAAC,IAAI,KAAK;AAC1B,IAAI,IAAI;AACR,KAAK,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,IAAI,CAAC,CAAC,MAAM;AACZ,KAAK,OAAO,EAAE;AACd,IAAI;AACJ,GAAG,CAAC;AACJ,GAAG,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;AAC3C,GAAG,IAAI,CAAC,WAAW,EAAE;AACrB,IAAI,UAAU,CAAC,KAAK,EAAE;AACtB,IAAI;AACJ,GAAG;AACH,GAAG,IAAI,GAAG,WAAW,CAAC,MAAM;AAC5B,IAAI,IAAI;AACR,KAAK,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrD,IAAI,CAAC,CAAC,MAAM;AACZ,KAAK,OAAO,EAAE;AACd,IAAI;AACJ,GAAG,CAAC,EAAE,GAAG,CAAC;AACV,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM;AAClD,IAAI,OAAO,EAAE;AACb,IAAI,IAAI;AACR,KAAK,UAAU,CAAC,KAAK,EAAE;AACvB,IAAI,CAAC,CAAC,MAAM,CAAC;AACb,GAAG,CAAC,CAAC;AACL,EAAE,CAAC;AACH,EAAE,MAAM,EAAE;AACV,EAAE,CAAC;AACH,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE;AACxC,EAAE,cAAc,EAAE,mBAAmB;AACrC,EAAE,eAAe,EAAE,UAAU;AAC7B,EAAE,UAAU,EAAE;AACd,EAAE,EAAE,CAAC;AACL;;"}
1
+ {"version":3,"file":"_server.ts-CP5cRLhW.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/agent/_id_/events/_server.ts.js"],"sourcesContent":["import { m as subscribe, u as sessionInfo } from \"../../../../../../chunks/agent-sessions.js\";\nimport { error } from \"@sveltejs/kit\";\n//#region src/routes/api/agent/[id]/events/+server.ts\n/** Eventos de una sesión con el agente (SSE). Al conectar manda `reset` y todo lo acumulado; después, lo nuevo. */\nvar GET = ({ params, request }) => {\n\tif (!sessionInfo(params.id)) error(404, \"La sesión del agente ya no existe.\");\n\tlet unsubscribe = null;\n\tlet ping = null;\n\tconst encoder = new TextEncoder();\n\tconst cleanup = () => {\n\t\tunsubscribe?.();\n\t\tunsubscribe = null;\n\t\tif (ping) clearInterval(ping);\n\t\tping = null;\n\t};\n\tconst stream = new ReadableStream({\n\t\tstart(controller) {\n\t\t\tconst send = (data) => {\n\t\t\t\ttry {\n\t\t\t\t\tcontroller.enqueue(encoder.encode(`data: ${JSON.stringify(data)}\\n\\n`));\n\t\t\t\t} catch {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t};\n\t\t\tunsubscribe = subscribe(params.id, send);\n\t\t\tif (!unsubscribe) {\n\t\t\t\tcontroller.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tping = setInterval(() => {\n\t\t\t\ttry {\n\t\t\t\t\tcontroller.enqueue(encoder.encode(\": ping\\n\\n\"));\n\t\t\t\t} catch {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}, 2e4);\n\t\t\trequest.signal.addEventListener(\"abort\", () => {\n\t\t\t\tcleanup();\n\t\t\t\ttry {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t} catch {}\n\t\t\t});\n\t\t},\n\t\tcancel: cleanup\n\t});\n\treturn new Response(stream, { headers: {\n\t\t\"content-type\": \"text/event-stream\",\n\t\t\"cache-control\": \"no-cache\",\n\t\tconnection: \"keep-alive\"\n\t} });\n};\n//#endregion\nexport { GET };\n"],"names":[],"mappings":";;;;;;;;;;AAEA;AACA;AACG,IAAC,GAAG,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK;AACnC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,oCAAoC,CAAC;AAC9E,CAAC,IAAI,WAAW,GAAG,IAAI;AACvB,CAAC,IAAI,IAAI,GAAG,IAAI;AAChB,CAAC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE;AAClC,CAAC,MAAM,OAAO,GAAG,MAAM;AACvB,EAAE,WAAW,IAAI;AACjB,EAAE,WAAW,GAAG,IAAI;AACpB,EAAE,IAAI,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;AAC/B,EAAE,IAAI,GAAG,IAAI;AACb,CAAC,CAAC;AACF,CAAC,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC;AACnC,EAAE,KAAK,CAAC,UAAU,EAAE;AACpB,GAAG,MAAM,IAAI,GAAG,CAAC,IAAI,KAAK;AAC1B,IAAI,IAAI;AACR,KAAK,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,IAAI,CAAC,CAAC,MAAM;AACZ,KAAK,OAAO,EAAE;AACd,IAAI;AACJ,GAAG,CAAC;AACJ,GAAG,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;AAC3C,GAAG,IAAI,CAAC,WAAW,EAAE;AACrB,IAAI,UAAU,CAAC,KAAK,EAAE;AACtB,IAAI;AACJ,GAAG;AACH,GAAG,IAAI,GAAG,WAAW,CAAC,MAAM;AAC5B,IAAI,IAAI;AACR,KAAK,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrD,IAAI,CAAC,CAAC,MAAM;AACZ,KAAK,OAAO,EAAE;AACd,IAAI;AACJ,GAAG,CAAC,EAAE,GAAG,CAAC;AACV,GAAG,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM;AAClD,IAAI,OAAO,EAAE;AACb,IAAI,IAAI;AACR,KAAK,UAAU,CAAC,KAAK,EAAE;AACvB,IAAI,CAAC,CAAC,MAAM,CAAC;AACb,GAAG,CAAC,CAAC;AACL,EAAE,CAAC;AACH,EAAE,MAAM,EAAE;AACV,EAAE,CAAC;AACH,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE;AACxC,EAAE,cAAc,EAAE,mBAAmB;AACrC,EAAE,eAAe,EAAE,UAAU;AAC7B,EAAE,UAAU,EAAE;AACd,EAAE,EAAE,CAAC;AACL;;"}
@@ -1,4 +1,4 @@
1
- import { o as getRemoteUrl, e as ensureReviewDir, w as writeDiffCache, p as readDiffCache, q as extractBranchDiff, u as loadReviewConfig, v as outputRelPath, m as makeOutputFilename, O as OUTPUT_DIR, x as writeSessionRef, c as companionPaths, d as decodePayload, t as tryResolveGitRoot, f as loadBranchDiff, y as validateAgainst, z as reviewIssues, R as REVIEW_SCHEMA, A as globMatch, C as writeDiffText } from './validate-CAQ31C7k.js';
1
+ import { p as getRemoteUrl, e as ensureReviewDir, w as writeDiffCache, q as readDiffCache, u as extractBranchDiff, v as loadReviewConfig, x as outputRelPath, m as makeOutputFilename, O as OUTPUT_DIR, y as writeSessionRef, c as companionPaths, d as decodePayload, t as tryResolveGitRoot, f as loadBranchDiff, z as validateAgainst, A as reviewIssues, R as REVIEW_SCHEMA, C as globMatch, D as writeDiffText, E as writeHandoffChat } from './validate-Da6e71V3.js';
2
2
  import { existsSync, readFileSync, statSync, accessSync, constants, readdirSync, mkdirSync, writeFileSync, copyFileSync, rmSync, realpathSync } from 'node:fs';
3
3
  import { spawn } from 'node:child_process';
4
4
  import { homedir, tmpdir } from 'node:os';
@@ -382,6 +382,9 @@ function spawnCommand(file, args, options) {
382
382
  *
383
383
  * El comando se tokeniza respetando comillas (un `grep "a\|b"` no es un pipe). Se aceptan `|`, `&&`, `||`, `;` y
384
384
  * descartar salida a /dev/null; cualquier otra redirección, `$(…)`, backticks o `&` lo rechazan.
385
+ *
386
+ * En PowerShell, `(Get-Content f).Count` llega como `(Get-Content` + `f).Count`: se quitan paréntesis de
387
+ * agrupación y el `.Miembro` colgado al path/flag antes de evaluar la allowlist.
385
388
  */
386
389
  /** @typedef {{ ok: true } | { ok: false, reason: string }} ShellCheck */
387
390
  /** Subcomandos de git que solo leen. */
@@ -783,6 +786,21 @@ function checkReviewDirMkdir(argv, ctx) {
783
786
  return null;
784
787
  }
785
788
  /**
789
+ * Quita agrupación PowerShell pegada al token: `(Get-Content` → `Get-Content`,
790
+ * `file.diff).Count` → `file.diff`, `-Line).Lines` → `-Line`.
791
+ * @param {string} token
792
+ */
793
+ function stripPsGrouping(token) {
794
+ let t = String(token ?? "");
795
+ t = t.replace(/^\(+/, "");
796
+ t = t.replace(/\)+(?:\.[A-Za-z_][\w]*(?:\(\)?)?)*$/, "");
797
+ return t;
798
+ }
799
+ /** @param {string[]} argv */
800
+ function normalizePsArgv(argv) {
801
+ return argv.map(stripPsGrouping).filter((w) => w.length > 0);
802
+ }
803
+ /**
786
804
  * @param {string} command
787
805
  * @param {{ repo?: string, platform?: NodeJS.Platform }} [opts]
788
806
  * @returns {ShellCheck}
@@ -798,7 +816,9 @@ function checkShell(command, { repo, platform = process.platform } = {}) {
798
816
  repo: repo || process.cwd(),
799
817
  platform
800
818
  };
801
- for (const pipeline of parsed.pipelines) for (const argv of pipeline) {
819
+ for (const pipeline of parsed.pipelines) for (const rawArgv of pipeline) {
820
+ const argv = normalizePsArgv(rawArgv);
821
+ if (!argv.length) continue;
802
822
  const name = argv[0].toLowerCase();
803
823
  if (argv[0].includes("=")) return {
804
824
  ok: false,
@@ -836,8 +856,9 @@ function checkShell(command, { repo, platform = process.platform } = {}) {
836
856
  * habilitó en su agente.
837
857
  */
838
858
  /**
839
- * @typedef {"review" | "ask" | "edit"} PolicyMode
840
- * review = generar el JSON; ask = preguntas (no puede escribir nada); edit = modificar el JSON.
859
+ * @typedef {"review" | "ask" | "edit" | "fix"} PolicyMode
860
+ * review = generar el JSON; ask = preguntas (no puede escribir nada); edit = modificar el JSON;
861
+ * fix = editar código dentro del repo (no solo el JSON).
841
862
  * @typedef {{ repo: string, outputFilename: string, mode: PolicyMode }} PolicyContext
842
863
  * @typedef {{
843
864
  * kind?: string | null,
@@ -1001,6 +1022,16 @@ function decidePermission(toolCall, { repo, outputFilename, mode }) {
1001
1022
  allow: false,
1002
1023
  reason: `${kind === "delete" ? "borrado" : "edición"} sin path`
1003
1024
  };
1025
+ if (mode === "fix") {
1026
+ const outside = paths.find((p) => !isInside(p, repo));
1027
+ return outside ? {
1028
+ allow: false,
1029
+ reason: `path fuera del repo: ${outside}`
1030
+ } : {
1031
+ allow: true,
1032
+ reason: "escritura en el repo"
1033
+ };
1034
+ }
1004
1035
  const target = resolve(repo, outputRelPath(outputFilename));
1005
1036
  const outside = paths.find((p) => !samePath(canonicalPath(p), canonicalPath(target)));
1006
1037
  return outside ? {
@@ -1765,7 +1796,8 @@ var RULES = `- Ids: themes use \`t1\`, \`t2\`, …; findings use \`f1\`, \`f2\`,
1765
1796
  - "blocking": true ONLY if the branch should not merge as-is. Use only with class "risk".
1766
1797
  - When several read-only lookups are independent (files, searches), batch them in the same turn if your tools allow parallel calls.
1767
1798
  - Write human-readable strings (intent, title, what, why, fix, notes) in Spanish. Keep enums/ids/paths/JSON keys exactly as in the schema.
1768
- - Length is a soft target, not a check: aim for title ≤72 characters and what/why/fix ≤120 characters. Prefer clarity over shortening. Longer text is still valid. Do not rewrite the file only to shorten it.`;
1799
+ - Length is a soft target, not a check: aim for title ≤72 characters and what/why/fix ≤120 characters. Prefer clarity over shortening. Longer text is still valid. Do not rewrite the file only to shorten it.
1800
+ - If the output JSON already exists and findings have \`resolution\` ({ kind: ignored|fix|corrected, detail?: string }), preserve those fields on rewrite (coverage / edit / regenerate). Keep existing finding ids when possible; do not drop or reshuffle resolutions.`;
1769
1801
  /** @param {{ hasDiff?: boolean }} [ctx] */
1770
1802
  function workflowLocal(base, branch, ctx = {}) {
1771
1803
  if (ctx.hasDiff) return `Workflow:
@@ -1916,7 +1948,7 @@ ${outputSchemaBlock(meta)}
1916
1948
 
1917
1949
  Include "meta" with the source/repo/branch/base above (and origin "remoteUrl" when local). "agent" and "model" are required: set "agent" to the product you are (Claude Code, Cursor, Codex, Copilot, Gemini, …) and "model" to the exact model id you are running. Do not leave placeholders or omit them; validation fails without both. "generatedAt" is optional (ISO-8601 now).
1918
1950
 
1919
- Do NOT include diffs or a "files" array. The tool loads the companion \`.diff\` (or computes with git if missing) when opening the report. Do not invent hunks or paste patches into the JSON.
1951
+ Do NOT include diffs or a "files" array. The tool loads the companion \`.diff\` (or computes with git if missing) when opening the report. Do not invent hunks or paste patches into the JSON. If you are rewriting an existing review JSON, copy through any per-finding \`resolution\` already present.
1920
1952
 
1921
1953
  ${validateSection}`;
1922
1954
  }
@@ -2125,15 +2157,25 @@ function materializeSeed(entry) {
2125
2157
  });
2126
2158
  } catch {}
2127
2159
  }
2160
+ /** Escribe (pisa) el companion `.chat.md` de handoff si hay markdown pendiente. */
2161
+ function materializeHandoffChat(entry) {
2162
+ const text = entry.handoffChatMarkdown;
2163
+ if (text == null) return;
2164
+ try {
2165
+ writeHandoffChat(entry.repo, entry.outputFilename, text);
2166
+ } catch {}
2167
+ entry.handoffChatMarkdown = null;
2168
+ }
2128
2169
  /** Prefijo del primer mensaje cuando la sesión ACP es nueva. */
2129
- function contextPreamble(entry) {
2170
+ function contextPreamble(entry, handoffNote) {
2130
2171
  materializeSeed(entry);
2172
+ materializeHandoffChat(entry);
2131
2173
  const paths = companionPaths(entry.repo, entry.outputFilename);
2132
2174
  const jsonRel = outputRelPath(entry.outputFilename);
2133
2175
  const diffRel = `${outputRelPath(entry.outputFilename).replace(/\.json$/i, "")}.diff`;
2134
2176
  const hasJson = existsSync(paths.json);
2135
2177
  const hasDiff = existsSync(paths.diff);
2136
- return [
2178
+ const lines = [
2137
2179
  "Context for this chat (new agent session — read these files before answering):",
2138
2180
  `- Repo: ${entry.repo}`,
2139
2181
  `- Branch under review: ${entry.branch}`,
@@ -2141,8 +2183,14 @@ function contextPreamble(entry) {
2141
2183
  hasJson ? `- Review JSON (relative to repo root): \`${jsonRel}\` — read this file.` : `- Review JSON: not available on disk (no seed/payload was provided). Say so if you need it.`,
2142
2184
  hasDiff ? `- Diff (relative to repo root): \`${diffRel}\` — read this file.` : `- Diff file: not available on disk (no seed/diff and git cache failed). Say so if you need it.`,
2143
2185
  "",
2144
- "User message:"
2145
- ].join("\n");
2186
+ "The user question or fix request is the priority. The review JSON is reference context — do not re-litigate or re-review findings unless the user asks.",
2187
+ "",
2188
+ "Findings may include optional `resolution` ({ kind: ignored|fix|corrected, detail?: string }) written by the UI. Preserve those fields when editing the JSON. Corrected findings and their detail are prior work — use them as context; do not undo them unless the user asks."
2189
+ ];
2190
+ const note = String(handoffNote || "").trim();
2191
+ if (note) lines.push("", note);
2192
+ lines.push("", "User message:");
2193
+ return lines.join("\n");
2146
2194
  }
2147
2195
  function permissionReasonLabel(allow, scope, deniedReason) {
2148
2196
  if (!allow) return deniedReason;
@@ -2408,7 +2456,7 @@ function checkEntryReport(entry) {
2408
2456
  function invalidJsonFixPrompt(entry, path, result) {
2409
2457
  return `${formatCheckReport(path, validateCliCommand(entry.outputFilename), result)}
2410
2458
 
2411
- Critical: do NOT only bump meta.generatedAt or rewrite notes. Edit \`${outputRelPath(entry.outputFilename).replace(/\\/g, "/")}\` so every problem above is fixed (add blocks or skipped for each missing path). Do not claim success until coverage is complete.
2459
+ Critical: fix ONLY the listed schema/validation errors above. Do NOT regenerate or reshuffle findings unnecessarily. Preserve existing finding ids and any \`resolution\` fields when possible. Do NOT only bump meta.generatedAt or rewrite notes. Edit \`${outputRelPath(entry.outputFilename).replace(/\\/g, "/")}\` so every problem above is fixed (add blocks or skipped for each missing path). Do not claim success until coverage is complete.
2412
2460
 
2413
2461
  ${TOOL_RULES}
2414
2462
 
@@ -2546,7 +2594,7 @@ async function runTurn(entry, text, mode, opts) {
2546
2594
  setStatus(entry, "idle", "Cancelado.");
2547
2595
  return;
2548
2596
  }
2549
- if (mode !== "ask") await checkOutput(entry, since, OUTPUT_AUTO_RETRIES);
2597
+ if (mode !== "ask" && mode !== "fix") await checkOutput(entry, since, OUTPUT_AUTO_RETRIES);
2550
2598
  entry.busy = false;
2551
2599
  if (entry.cancelled) setStatus(entry, "idle", "Cancelado.");
2552
2600
  else setStatus(entry, "idle");
@@ -2588,6 +2636,8 @@ function newEntry(agent, fields) {
2588
2636
  rejections: [],
2589
2637
  needsContext: false,
2590
2638
  seed: null,
2639
+ handoffNote: null,
2640
+ handoffChatMarkdown: null,
2591
2641
  diffPaths: null,
2592
2642
  pendingPermissions: /* @__PURE__ */ new Map(),
2593
2643
  sessionAllowDenied: false,
@@ -2677,9 +2727,13 @@ async function continueReviewAfterDiff(entry, input) {
2677
2727
  */
2678
2728
  async function openChat(input) {
2679
2729
  const sessionId = String(input.sessionId || "").trim();
2730
+ const handoffNote = String(input.handoffNote || "").trim() || null;
2731
+ const handoffChat = input.handoffChatMarkdown != null ? String(input.handoffChatMarkdown) : null;
2680
2732
  if (sessionId) {
2681
2733
  for (const entry of sessions.values()) if (entry.acpSessionId === sessionId && entry.repo === input.repo) {
2682
2734
  if (input.seed) entry.seed = input.seed;
2735
+ if (handoffNote) entry.handoffNote = handoffNote;
2736
+ if (handoffChat != null) entry.handoffChatMarkdown = handoffChat;
2683
2737
  return info(entry);
2684
2738
  }
2685
2739
  }
@@ -2689,6 +2743,8 @@ async function openChat(input) {
2689
2743
  acpSessionId: sessionId
2690
2744
  });
2691
2745
  if (input.seed) entry.seed = input.seed;
2746
+ if (handoffNote) entry.handoffNote = handoffNote;
2747
+ if (handoffChat != null) entry.handoffChatMarkdown = handoffChat;
2692
2748
  if (!sessionId) entry.needsContext = true;
2693
2749
  try {
2694
2750
  if (!entry.acp) setStatus(entry, "starting", `Lanzando ${entry.agentLabel}…`);
@@ -2706,13 +2762,17 @@ function sendMessage(id, text, mode, opts) {
2706
2762
  const body = text.trim();
2707
2763
  if (!body) throw new Error("El mensaje está vacío.");
2708
2764
  if (entry.busy) throw new Error("El agente todavía está trabajando en el pedido anterior.");
2765
+ const sendHandoff = String(opts?.handoffNote || "").trim();
2766
+ if (sendHandoff) entry.handoffNote = sendHandoff;
2767
+ if (opts?.handoffChatMarkdown != null) entry.handoffChatMarkdown = String(opts.handoffChatMarkdown);
2709
2768
  let agentText = body;
2710
2769
  if (entry.needsContext) {
2711
- agentText = `${contextPreamble(entry)}\n${body}`;
2770
+ agentText = `${contextPreamble(entry, entry.handoffNote)}\n${body}`;
2712
2771
  entry.needsContext = false;
2772
+ entry.handoffNote = null;
2713
2773
  entry.seed = null;
2714
2774
  }
2715
- runTurn(entry, mode === "edit" ? `${agentText}\n\nApply this by editing ${entry.outputFilename} in place (keep everything else as is). Reply briefly in Spanish with what you changed.\n\n${SERVER_VALIDATES}` : `${agentText}\n\nAnswer in Spanish. This is a question about the review: do not modify any file.`, mode, {
2775
+ runTurn(entry, mode === "edit" ? `${agentText}\n\nApply this by editing ${entry.outputFilename} in place (keep everything else as is; preserve finding ids and any \`resolution\` fields). Reply briefly in Spanish with what you changed.\n\n${SERVER_VALIDATES}` : mode === "fix" ? `${agentText}\n\nApply ONLY the listed code fixes by editing files inside this repo. Do not rewrite the review JSON. Touch nothing else. Reply briefly in Spanish with a short per-finding detail suitable for resolution.detail.` : `${agentText}\n\nAnswer in Spanish. This is a question about the review: do not modify any file.`, mode, {
2716
2776
  shown: body,
2717
2777
  model: String(opts?.model || "").trim() || void 0
2718
2778
  });
@@ -2833,6 +2893,35 @@ async function cancelTurn(id) {
2833
2893
  entry.busy = false;
2834
2894
  setStatus(entry, "idle", "Cancelado.");
2835
2895
  }
2896
+ /**
2897
+ * Cierra la sesión de chat: ACP, Map y permisos pendientes.
2898
+ * La UI lo usa al cambiar de agente (el reporte / triage se mantienen).
2899
+ */
2900
+ async function closeChat(id) {
2901
+ const entry = sessions.get(String(id || ""));
2902
+ if (!entry) return;
2903
+ entry.cancelled = true;
2904
+ for (const [requestId, pending] of [...entry.pendingPermissions]) {
2905
+ clearTimeout(pending.timer);
2906
+ entry.pendingPermissions.delete(requestId);
2907
+ try {
2908
+ pending.resolve(false, { quiet: true });
2909
+ } catch {}
2910
+ }
2911
+ if (entry.idleTimer) {
2912
+ clearTimeout(entry.idleTimer);
2913
+ entry.idleTimer = null;
2914
+ }
2915
+ try {
2916
+ if (entry.acp && entry.busy) try {
2917
+ await entry.acp.cancel();
2918
+ } catch {}
2919
+ entry.acp?.close();
2920
+ } catch {}
2921
+ entry.acp = null;
2922
+ entry.listeners.clear();
2923
+ sessions.delete(entry.id);
2924
+ }
2836
2925
  function subscribe(id, listener) {
2837
2926
  const entry = sessions.get(id);
2838
2927
  if (!entry) return null;
@@ -2856,5 +2945,5 @@ function startPendingAgentRun() {
2856
2945
  }
2857
2946
  }
2858
2947
 
2859
- export { agentModels as a, startReview as b, sendMessage as c, setPermissionTrust as d, cancelTurn as e, retryReview as f, openAgentLogin as g, loginCommand as h, subscribe as i, startPendingAgentRun as j, listAcpAgents as l, openChat as o, respondPermission as r, sessionInfo as s };
2860
- //# sourceMappingURL=agent-sessions-D0WwtWgR.js.map
2948
+ export { agentModels as a, startReview as b, sendMessage as c, setPermissionTrust as d, cancelTurn as e, closeChat as f, retryReview as g, openAgentLogin as h, loginCommand as i, subscribe as j, startPendingAgentRun as k, listAcpAgents as l, openChat as o, respondPermission as r, sessionInfo as s };
2949
+ //# sourceMappingURL=agent-sessions-2XGojSJ_.js.map