@jpkme/diff-review 0.1.13 → 0.1.15
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/bin/diff-review.mjs +183 -100
- package/lib/acp-shell.mjs +23 -1
- package/lib/acp-shell.test.mjs +7 -0
- package/lib/prompt.mjs +8 -6
- package/package.json +1 -1
- package/web/build/client/_app/immutable/assets/2.C4whE4xz.css +1 -0
- package/web/build/client/_app/immutable/assets/2.C4whE4xz.css.br +0 -0
- package/web/build/client/_app/immutable/assets/2.C4whE4xz.css.gz +0 -0
- package/web/build/client/_app/immutable/assets/3.Cw1J6YTM.css +1 -0
- package/web/build/client/_app/immutable/assets/3.Cw1J6YTM.css.br +0 -0
- package/web/build/client/_app/immutable/assets/3.Cw1J6YTM.css.gz +0 -0
- package/web/build/client/_app/immutable/assets/storage.TlsiS-AP.css +1 -0
- package/web/build/client/_app/immutable/assets/storage.TlsiS-AP.css.br +0 -0
- package/web/build/client/_app/immutable/assets/storage.TlsiS-AP.css.gz +0 -0
- package/web/build/client/_app/immutable/chunks/{Bu1mm6Oz.js → BpVtXA-T.js} +1 -1
- package/web/build/client/_app/immutable/chunks/BpVtXA-T.js.br +2 -0
- package/web/build/client/_app/immutable/chunks/BpVtXA-T.js.gz +0 -0
- package/web/build/client/_app/immutable/chunks/{BXUWMim4.js → CUhrLa7d.js} +12 -15
- package/web/build/client/_app/immutable/chunks/CUhrLa7d.js.br +0 -0
- package/web/build/client/_app/immutable/chunks/CUhrLa7d.js.gz +0 -0
- package/web/build/client/_app/immutable/chunks/{DPfXzQnm.js → QvO6K-HK.js} +2 -2
- package/web/build/client/_app/immutable/chunks/QvO6K-HK.js.br +0 -0
- package/web/build/client/_app/immutable/chunks/QvO6K-HK.js.gz +0 -0
- package/web/build/client/_app/immutable/entry/{app.CTgiuiU1.js → app.BjJsHui4.js} +2 -2
- package/web/build/client/_app/immutable/entry/app.BjJsHui4.js.br +0 -0
- package/web/build/client/_app/immutable/entry/app.BjJsHui4.js.gz +0 -0
- package/web/build/client/_app/immutable/entry/start.D4unRHC4.js +1 -0
- package/web/build/client/_app/immutable/entry/start.D4unRHC4.js.br +0 -0
- package/web/build/client/_app/immutable/entry/start.D4unRHC4.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/{1.0PQZpSbJ.js → 1.C8JJYlWG.js} +1 -1
- package/web/build/client/_app/immutable/nodes/1.C8JJYlWG.js.br +1 -0
- package/web/build/client/_app/immutable/nodes/1.C8JJYlWG.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/2.CDI0Ipi4.js +10 -0
- package/web/build/client/_app/immutable/nodes/2.CDI0Ipi4.js.br +0 -0
- package/web/build/client/_app/immutable/nodes/2.CDI0Ipi4.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/3.DVC22CDg.js +171 -0
- package/web/build/client/_app/immutable/nodes/3.DVC22CDg.js.br +0 -0
- package/web/build/client/_app/immutable/nodes/3.DVC22CDg.js.gz +0 -0
- package/web/build/client/_app/version.json +1 -1
- package/web/build/client/_app/version.json.br +0 -0
- package/web/build/client/_app/version.json.gz +0 -0
- package/web/build/handler.js +3 -3
- package/web/build/index.js +3 -3
- package/web/build/server/chunks/1-DUj63QTT.js +7 -0
- package/web/build/server/chunks/{1-C2qlInYk.js.map → 1-DUj63QTT.js.map} +1 -1
- package/web/build/server/chunks/2-B4PSKe5P.js +7 -0
- package/web/build/server/chunks/2-B4PSKe5P.js.map +1 -0
- package/web/build/server/chunks/3-C7UD6rei.js +7 -0
- package/web/build/server/chunks/{3-SO3atuWO.js.map → 3-C7UD6rei.js.map} +1 -1
- package/web/build/server/chunks/{_server.ts-CRNhzL2a.js → _server.ts-4RcoUd0l.js} +4 -4
- package/web/build/server/chunks/{_server.ts-CRNhzL2a.js.map → _server.ts-4RcoUd0l.js.map} +1 -1
- package/web/build/server/chunks/{agent-sessions-kcUaLhK5.js → agent-sessions-C_hlZJKN.js} +77 -16
- package/web/build/server/chunks/agent-sessions-C_hlZJKN.js.map +1 -0
- package/web/build/server/chunks/{git-review-CXKcjYgZ.js → git-review-Bh1w0gak.js} +7 -7
- package/web/build/server/chunks/{git-review-CXKcjYgZ.js.map → git-review-Bh1w0gak.js.map} +1 -1
- package/web/build/server/chunks/{handler-_E0NucKN.js → handler-e2lEvjVT.js} +3 -3
- package/web/build/server/chunks/{handler-_E0NucKN.js.map → handler-e2lEvjVT.js.map} +1 -1
- package/web/build/server/chunks/{hooks.server-D7yPODoc.js → hooks.server-Um1Sknmz.js} +3 -3
- package/web/build/server/chunks/{hooks.server-D7yPODoc.js.map → hooks.server-Um1Sknmz.js.map} +1 -1
- package/web/build/server/chunks/{index.js-lMtDM8ZQ.js → index.js-C3-YX8SA.js} +876 -879
- package/web/build/server/chunks/index.js-C3-YX8SA.js.map +1 -0
- package/web/build/server/chunks/{manifest.js-BIm6jot5.js → manifest.js-CmbRPv0j.js} +8 -8
- package/web/build/server/chunks/{manifest.js-BIm6jot5.js.map → manifest.js-CmbRPv0j.js.map} +1 -1
- package/web/build/server/chunks/{remote-1g4ayag-DmqxwUIz.js → remote-1g4ayag-DMiPy1mT.js} +4 -4
- package/web/build/server/chunks/{remote-1g4ayag-DmqxwUIz.js.map → remote-1g4ayag-DMiPy1mT.js.map} +1 -1
- package/web/build/server/chunks/{remote-wh6t6j-DZk0W9Pp.js → remote-wh6t6j-RlIVOUe-.js} +5 -5
- package/web/build/server/chunks/{remote-wh6t6j-DZk0W9Pp.js.map → remote-wh6t6j-RlIVOUe-.js.map} +1 -1
- package/web/build/server/chunks/{validate-BsTKyhsq.js → validate-CAQ31C7k.js} +2 -2
- package/web/build/server/chunks/{validate-BsTKyhsq.js.map → validate-CAQ31C7k.js.map} +1 -1
- package/web/build/client/_app/immutable/assets/2.tqrMRTM0.css +0 -1
- package/web/build/client/_app/immutable/assets/2.tqrMRTM0.css.br +0 -0
- package/web/build/client/_app/immutable/assets/2.tqrMRTM0.css.gz +0 -0
- package/web/build/client/_app/immutable/assets/3.BT54aVKb.css +0 -1
- package/web/build/client/_app/immutable/assets/3.BT54aVKb.css.br +0 -0
- package/web/build/client/_app/immutable/assets/3.BT54aVKb.css.gz +0 -0
- package/web/build/client/_app/immutable/assets/storage.DqYH0w6R.css +0 -1
- package/web/build/client/_app/immutable/assets/storage.DqYH0w6R.css.br +0 -0
- package/web/build/client/_app/immutable/assets/storage.DqYH0w6R.css.gz +0 -0
- package/web/build/client/_app/immutable/chunks/BXUWMim4.js.br +0 -0
- package/web/build/client/_app/immutable/chunks/BXUWMim4.js.gz +0 -0
- package/web/build/client/_app/immutable/chunks/Bu1mm6Oz.js.br +0 -0
- package/web/build/client/_app/immutable/chunks/Bu1mm6Oz.js.gz +0 -0
- package/web/build/client/_app/immutable/chunks/DPfXzQnm.js.br +0 -0
- package/web/build/client/_app/immutable/chunks/DPfXzQnm.js.gz +0 -0
- package/web/build/client/_app/immutable/entry/app.CTgiuiU1.js.br +0 -0
- package/web/build/client/_app/immutable/entry/app.CTgiuiU1.js.gz +0 -0
- package/web/build/client/_app/immutable/entry/start.CFSl0kht.js +0 -1
- package/web/build/client/_app/immutable/entry/start.CFSl0kht.js.br +0 -0
- package/web/build/client/_app/immutable/entry/start.CFSl0kht.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/1.0PQZpSbJ.js.br +0 -2
- package/web/build/client/_app/immutable/nodes/1.0PQZpSbJ.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/2.DQaoQoy4.js +0 -10
- package/web/build/client/_app/immutable/nodes/2.DQaoQoy4.js.br +0 -0
- package/web/build/client/_app/immutable/nodes/2.DQaoQoy4.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/3.AciugOtL.js +0 -171
- package/web/build/client/_app/immutable/nodes/3.AciugOtL.js.br +0 -0
- package/web/build/client/_app/immutable/nodes/3.AciugOtL.js.gz +0 -0
- package/web/build/server/chunks/1-C2qlInYk.js +0 -7
- package/web/build/server/chunks/2-DyE177MK.js +0 -7
- package/web/build/server/chunks/2-DyE177MK.js.map +0 -1
- package/web/build/server/chunks/3-SO3atuWO.js +0 -7
- package/web/build/server/chunks/agent-sessions-kcUaLhK5.js.map +0 -1
- package/web/build/server/chunks/index.js-lMtDM8ZQ.js.map +0 -1
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1792447124523"}
|
|
Binary file
|
|
Binary file
|
package/web/build/handler.js
CHANGED
|
@@ -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-
|
|
6
|
-
import './server/chunks/index.js-
|
|
7
|
-
import './server/chunks/manifest.js-
|
|
5
|
+
export { h as handler } from './server/chunks/handler-e2lEvjVT.js';
|
|
6
|
+
import './server/chunks/index.js-C3-YX8SA.js';
|
|
7
|
+
import './server/chunks/manifest.js-CmbRPv0j.js';
|
|
8
8
|
import './env.js';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'node:crypto';
|
package/web/build/index.js
CHANGED
|
@@ -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-
|
|
4
|
+
import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-e2lEvjVT.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-
|
|
15
|
-
import './server/chunks/manifest.js-
|
|
14
|
+
import './server/chunks/index.js-C3-YX8SA.js';
|
|
15
|
+
import './server/chunks/manifest.js-CmbRPv0j.js';
|
|
16
16
|
import 'node:url';
|
|
17
17
|
|
|
18
18
|
const path = env('SOCKET_PATH', false);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const index = 1;
|
|
2
|
+
const imports = ["_app/immutable/nodes/1.C8JJYlWG.js","_app/immutable/chunks/D8WOD_eS.js","_app/immutable/chunks/lUYXRDtZ.js","_app/immutable/chunks/BpVtXA-T.js","_app/immutable/chunks/QvO6K-HK.js"];
|
|
3
|
+
const stylesheets = [];
|
|
4
|
+
const fonts = [];
|
|
5
|
+
|
|
6
|
+
export { fonts, imports, index, stylesheets };
|
|
7
|
+
//# sourceMappingURL=1-DUj63QTT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1-
|
|
1
|
+
{"version":3,"file":"1-DUj63QTT.js","sources":["../../../.svelte-kit/output/server/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nexport const imports = [\"_app/immutable/nodes/1.C8JJYlWG.js\",\"_app/immutable/chunks/D8WOD_eS.js\",\"_app/immutable/chunks/lUYXRDtZ.js\",\"_app/immutable/chunks/BpVtXA-T.js\",\"_app/immutable/chunks/QvO6K-HK.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.CDI0Ipi4.js","_app/immutable/chunks/D8WOD_eS.js","_app/immutable/chunks/QvO6K-HK.js","_app/immutable/chunks/CUhrLa7d.js","_app/immutable/chunks/lUYXRDtZ.js","_app/immutable/chunks/BZfQ9INH.js","_app/immutable/chunks/BpVtXA-T.js"];
|
|
3
|
+
const stylesheets = ["_app/immutable/assets/storage.TlsiS-AP.css","_app/immutable/assets/2.C4whE4xz.css"];
|
|
4
|
+
const fonts = [];
|
|
5
|
+
|
|
6
|
+
export { fonts, imports, index, stylesheets };
|
|
7
|
+
//# sourceMappingURL=2-B4PSKe5P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2-B4PSKe5P.js","sources":["../../../.svelte-kit/output/server/nodes/2.js"],"sourcesContent":["\n\nexport const index = 2;\nexport const imports = [\"_app/immutable/nodes/2.CDI0Ipi4.js\",\"_app/immutable/chunks/D8WOD_eS.js\",\"_app/immutable/chunks/QvO6K-HK.js\",\"_app/immutable/chunks/CUhrLa7d.js\",\"_app/immutable/chunks/lUYXRDtZ.js\",\"_app/immutable/chunks/BZfQ9INH.js\",\"_app/immutable/chunks/BpVtXA-T.js\"];\nexport const stylesheets = [\"_app/immutable/assets/storage.TlsiS-AP.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.DVC22CDg.js","_app/immutable/chunks/D8WOD_eS.js","_app/immutable/chunks/QvO6K-HK.js","_app/immutable/chunks/CUhrLa7d.js","_app/immutable/chunks/lUYXRDtZ.js","_app/immutable/chunks/BZfQ9INH.js"];
|
|
3
|
+
const stylesheets = ["_app/immutable/assets/storage.TlsiS-AP.css","_app/immutable/assets/3.Cw1J6YTM.css"];
|
|
4
|
+
const fonts = [];
|
|
5
|
+
|
|
6
|
+
export { fonts, imports, index, stylesheets };
|
|
7
|
+
//# sourceMappingURL=3-C7UD6rei.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3-
|
|
1
|
+
{"version":3,"file":"3-C7UD6rei.js","sources":["../../../.svelte-kit/output/server/nodes/3.js"],"sourcesContent":["\n\nexport const index = 3;\nexport const imports = [\"_app/immutable/nodes/3.DVC22CDg.js\",\"_app/immutable/chunks/D8WOD_eS.js\",\"_app/immutable/chunks/QvO6K-HK.js\",\"_app/immutable/chunks/CUhrLa7d.js\",\"_app/immutable/chunks/lUYXRDtZ.js\",\"_app/immutable/chunks/BZfQ9INH.js\"];\nexport const stylesheets = [\"_app/immutable/assets/storage.TlsiS-AP.css\",\"_app/immutable/assets/3.Cw1J6YTM.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 {
|
|
2
|
-
import { e as error } from './index.js-
|
|
3
|
-
import './validate-
|
|
1
|
+
import { s as sessionInfo, i as subscribe } from './agent-sessions-C_hlZJKN.js';
|
|
2
|
+
import { e as error } from './index.js-C3-YX8SA.js';
|
|
3
|
+
import './validate-CAQ31C7k.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-
|
|
62
|
+
//# sourceMappingURL=_server.ts-4RcoUd0l.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
1
|
+
{"version":3,"file":"_server.ts-4RcoUd0l.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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
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
|
|
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,
|
|
@@ -1769,7 +1789,7 @@ var RULES = `- Ids: themes use \`t1\`, \`t2\`, …; findings use \`f1\`, \`f2\`,
|
|
|
1769
1789
|
/** @param {{ hasDiff?: boolean }} [ctx] */
|
|
1770
1790
|
function workflowLocal(base, branch, ctx = {}) {
|
|
1771
1791
|
if (ctx.hasDiff) return `Workflow:
|
|
1772
|
-
1.
|
|
1792
|
+
1. The host already computed the three-dot diff and wrote it to disk (see "Precomputed git context"). Read that file with your file tools. Do not run \`git diff\`, \`git merge-base\`, or rebuild the patch yourself unless that file is missing.
|
|
1773
1793
|
2. Read enough surrounding code (types, callers, tests) to judge behavior, not only the hunk lines.
|
|
1774
1794
|
3. Emit the JSON file. Do not modify the repo.
|
|
1775
1795
|
4. Validate it with the command in the output section. If it prints INVALID, follow "How to continue" and re-run until it prints OK.`;
|
|
@@ -1787,7 +1807,7 @@ function validateCliCommand(filename) {
|
|
|
1787
1807
|
/** Workflow sin paso de validate por CLI (sesiones ACP: valida el server). */
|
|
1788
1808
|
function workflowLocalAcp(ctx = {}) {
|
|
1789
1809
|
if (ctx.hasDiff) return `Workflow:
|
|
1790
|
-
1.
|
|
1810
|
+
1. The host already computed the three-dot diff and wrote it to disk (see "Precomputed git context"). Read that file with your file tools. Do not run \`git diff\`, \`git merge-base\`, or rebuild the patch yourself unless that file is missing.
|
|
1791
1811
|
2. Read enough surrounding code (types, callers, tests) to judge behavior, not only the hunk lines.
|
|
1792
1812
|
3. Write the JSON with your file Write/Edit tool (never shell redirection). Do not modify other repo files. The host validates when your turn ends — do not run the validate CLI.`;
|
|
1793
1813
|
return `Workflow:
|
|
@@ -1828,11 +1848,11 @@ function outputSchemaBlock(meta) {
|
|
|
1828
1848
|
* }} ctx
|
|
1829
1849
|
*/
|
|
1830
1850
|
function formatPrecomputedContext(ctx) {
|
|
1831
|
-
const lines = ["Precomputed git context (do not rediscover):"];
|
|
1851
|
+
const lines = ["Precomputed git context (provided by the host — do not rediscover or recompute):"];
|
|
1832
1852
|
if (ctx.mergeBase) lines.push(`- Merge-base SHA: \`${ctx.mergeBase}\``);
|
|
1833
1853
|
if (ctx.branchSha) lines.push(`- Branch tip SHA: \`${ctx.branchSha}\``);
|
|
1834
1854
|
if (ctx.baseSha) lines.push(`- Base tip SHA: \`${ctx.baseSha}\``);
|
|
1835
|
-
if (ctx.diffRelPath) lines.push(`- Diff file (relative to repo root): \`${ctx.diffRelPath}\` —
|
|
1855
|
+
if (ctx.diffRelPath) lines.push(`- Diff file (relative to repo root): \`${ctx.diffRelPath}\` — Read this file for the full patch. Do not run \`git diff\` / \`git merge-base\` to rebuild it unless the file is missing.`);
|
|
1836
1856
|
const files = Array.isArray(ctx.files) ? ctx.files : [];
|
|
1837
1857
|
if (files.length) {
|
|
1838
1858
|
lines.push(`- Files in the diff (${files.length}):`);
|
|
@@ -2431,10 +2451,15 @@ ${TOOL_RULES}
|
|
|
2431
2451
|
${SERVER_VALIDATES}`;
|
|
2432
2452
|
}
|
|
2433
2453
|
async function checkOutput(entry, since, retriesLeft) {
|
|
2454
|
+
if (entry.cancelled) return;
|
|
2434
2455
|
const path = companionPaths(entry.repo, entry.outputFilename).json;
|
|
2435
2456
|
if (!(existsSync(path) && mtime(path) >= since)) {
|
|
2436
|
-
if (retriesLeft > 0)
|
|
2437
|
-
|
|
2457
|
+
if (retriesLeft > 0) {
|
|
2458
|
+
const again = await followUp(entry, noWriteFollowUpPrompt(entry), entry.rejections.length ? "Seguí: hubo comandos rechazados; escribí el JSON con la tool de archivos." : "Seguí: el JSON no se escribió en este turno.");
|
|
2459
|
+
if (entry.cancelled || again == null) return;
|
|
2460
|
+
return checkOutput(entry, again, retriesLeft - 1);
|
|
2461
|
+
}
|
|
2462
|
+
if (entry.mode === "review" && !entry.cancelled) emit(entry, {
|
|
2438
2463
|
type: "review",
|
|
2439
2464
|
ok: false,
|
|
2440
2465
|
filename: entry.outputFilename,
|
|
@@ -2468,6 +2493,7 @@ async function checkOutput(entry, since, retriesLeft) {
|
|
|
2468
2493
|
});
|
|
2469
2494
|
return;
|
|
2470
2495
|
}
|
|
2496
|
+
if (entry.cancelled) return;
|
|
2471
2497
|
const canRetry = retriesLeft > 0;
|
|
2472
2498
|
emit(entry, {
|
|
2473
2499
|
type: "review",
|
|
@@ -2477,16 +2503,23 @@ async function checkOutput(entry, since, retriesLeft) {
|
|
|
2477
2503
|
final: !canRetry
|
|
2478
2504
|
});
|
|
2479
2505
|
if (!canRetry) return;
|
|
2480
|
-
|
|
2506
|
+
const again = await followUp(entry, invalidJsonFixPrompt(entry, path, result), "Corregí los errores de validación del JSON.");
|
|
2507
|
+
if (entry.cancelled || again == null) return;
|
|
2508
|
+
await checkOutput(entry, again, retriesLeft - 1);
|
|
2481
2509
|
}
|
|
2482
|
-
/**
|
|
2510
|
+
/**
|
|
2511
|
+
* Turno extra que pide el server (corregir el JSON, seguir después de un rechazo).
|
|
2512
|
+
* Devuelve cuándo empezó, o `null` si el usuario canceló (no hay que seguir reintentando).
|
|
2513
|
+
*/
|
|
2483
2514
|
async function followUp(entry, prompt, shown) {
|
|
2515
|
+
if (entry.cancelled) return null;
|
|
2484
2516
|
emit(entry, {
|
|
2485
2517
|
type: "user",
|
|
2486
2518
|
text: shown,
|
|
2487
2519
|
mode: "fix"
|
|
2488
2520
|
});
|
|
2489
2521
|
const acp = await ensureAcp(entry);
|
|
2522
|
+
if (entry.cancelled) return null;
|
|
2490
2523
|
const started = Date.now();
|
|
2491
2524
|
entry.rejections = [];
|
|
2492
2525
|
const { stopReason } = await acp.prompt(prompt);
|
|
@@ -2494,10 +2527,15 @@ async function followUp(entry, prompt, shown) {
|
|
|
2494
2527
|
type: "turn",
|
|
2495
2528
|
stopReason
|
|
2496
2529
|
});
|
|
2530
|
+
if (entry.cancelled || stopReason === "cancelled") {
|
|
2531
|
+
entry.cancelled = true;
|
|
2532
|
+
return null;
|
|
2533
|
+
}
|
|
2497
2534
|
return started;
|
|
2498
2535
|
}
|
|
2499
2536
|
async function runTurn(entry, text, mode, opts) {
|
|
2500
2537
|
if (entry.busy) throw new Error("El agente todavía está trabajando en el pedido anterior.");
|
|
2538
|
+
entry.cancelled = false;
|
|
2501
2539
|
entry.busy = true;
|
|
2502
2540
|
entry.mode = mode;
|
|
2503
2541
|
if (entry.idleTimer) clearTimeout(entry.idleTimer);
|
|
@@ -2509,6 +2547,11 @@ async function runTurn(entry, text, mode, opts) {
|
|
|
2509
2547
|
try {
|
|
2510
2548
|
if (!entry.acp) setStatus(entry, "starting", `Lanzando ${entry.agentLabel}…`);
|
|
2511
2549
|
const acp = await ensureAcp(entry, opts.model);
|
|
2550
|
+
if (entry.cancelled) {
|
|
2551
|
+
entry.busy = false;
|
|
2552
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2553
|
+
return;
|
|
2554
|
+
}
|
|
2512
2555
|
setStatus(entry, "working", "El agente está revisando…");
|
|
2513
2556
|
const since = Date.now();
|
|
2514
2557
|
entry.rejections = [];
|
|
@@ -2517,11 +2560,22 @@ async function runTurn(entry, text, mode, opts) {
|
|
|
2517
2560
|
type: "turn",
|
|
2518
2561
|
stopReason
|
|
2519
2562
|
});
|
|
2520
|
-
if (
|
|
2563
|
+
if (entry.cancelled || stopReason === "cancelled") {
|
|
2564
|
+
entry.cancelled = true;
|
|
2565
|
+
entry.busy = false;
|
|
2566
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2567
|
+
return;
|
|
2568
|
+
}
|
|
2569
|
+
if (mode !== "ask") await checkOutput(entry, since, OUTPUT_AUTO_RETRIES);
|
|
2521
2570
|
entry.busy = false;
|
|
2522
|
-
setStatus(entry, "idle");
|
|
2571
|
+
if (entry.cancelled) setStatus(entry, "idle", "Cancelado.");
|
|
2572
|
+
else setStatus(entry, "idle");
|
|
2523
2573
|
} catch (err) {
|
|
2524
2574
|
entry.busy = false;
|
|
2575
|
+
if (entry.cancelled) {
|
|
2576
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2577
|
+
return;
|
|
2578
|
+
}
|
|
2525
2579
|
const raw = err instanceof Error ? err.message : String(err);
|
|
2526
2580
|
setStatus(entry, "error", authFailureMessage(entry.agentId, entry.agentLabel, raw) || raw);
|
|
2527
2581
|
} finally {
|
|
@@ -2785,12 +2839,19 @@ async function cancelTurn(id) {
|
|
|
2785
2839
|
const entry = sessions.get(id);
|
|
2786
2840
|
if (!entry) return;
|
|
2787
2841
|
entry.cancelled = true;
|
|
2842
|
+
for (const [requestId, pending] of [...entry.pendingPermissions]) {
|
|
2843
|
+
clearTimeout(pending.timer);
|
|
2844
|
+
entry.pendingPermissions.delete(requestId);
|
|
2845
|
+
pending.resolve(false, { quiet: true });
|
|
2846
|
+
}
|
|
2788
2847
|
if (entry.acp && entry.busy) {
|
|
2789
|
-
|
|
2848
|
+
try {
|
|
2849
|
+
await entry.acp.cancel();
|
|
2850
|
+
} catch {}
|
|
2790
2851
|
return;
|
|
2791
2852
|
}
|
|
2792
2853
|
entry.busy = false;
|
|
2793
|
-
setStatus(entry, "
|
|
2854
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2794
2855
|
}
|
|
2795
2856
|
function subscribe(id, listener) {
|
|
2796
2857
|
const entry = sessions.get(id);
|
|
@@ -2815,5 +2876,5 @@ function startPendingAgentRun() {
|
|
|
2815
2876
|
}
|
|
2816
2877
|
}
|
|
2817
2878
|
|
|
2818
|
-
export {
|
|
2819
|
-
//# sourceMappingURL=agent-sessions-
|
|
2879
|
+
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 };
|
|
2880
|
+
//# sourceMappingURL=agent-sessions-C_hlZJKN.js.map
|