@jpkme/diff-review 0.1.13 → 0.1.14
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 +72 -53
- 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/storage.C8XGESwn.css +1 -0
- package/web/build/client/_app/immutable/assets/storage.C8XGESwn.css.br +0 -0
- package/web/build/client/_app/immutable/assets/storage.C8XGESwn.css.gz +0 -0
- package/web/build/client/_app/immutable/chunks/C0hrdiUt.js +2 -0
- package/web/build/client/_app/immutable/chunks/C0hrdiUt.js.br +0 -0
- package/web/build/client/_app/immutable/chunks/C0hrdiUt.js.gz +0 -0
- package/web/build/client/_app/immutable/chunks/{BXUWMim4.js → CpeIO6nz.js} +6 -9
- package/web/build/client/_app/immutable/chunks/CpeIO6nz.js.br +0 -0
- package/web/build/client/_app/immutable/chunks/CpeIO6nz.js.gz +0 -0
- package/web/build/client/_app/immutable/chunks/{Bu1mm6Oz.js → FOc6rgIW.js} +1 -1
- package/web/build/client/_app/immutable/chunks/FOc6rgIW.js.br +2 -0
- package/web/build/client/_app/immutable/chunks/FOc6rgIW.js.gz +0 -0
- package/web/build/client/_app/immutable/entry/{app.CTgiuiU1.js → app.DcAtSJ3n.js} +2 -2
- package/web/build/client/_app/immutable/entry/app.DcAtSJ3n.js.br +0 -0
- package/web/build/client/_app/immutable/entry/app.DcAtSJ3n.js.gz +0 -0
- package/web/build/client/_app/immutable/entry/start.CO5l0Zbx.js +1 -0
- package/web/build/client/_app/immutable/entry/start.CO5l0Zbx.js.br +0 -0
- package/web/build/client/_app/immutable/entry/start.CO5l0Zbx.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/{1.0PQZpSbJ.js → 1.E-Hs7ura.js} +1 -1
- package/web/build/client/_app/immutable/nodes/1.E-Hs7ura.js.br +4 -0
- package/web/build/client/_app/immutable/nodes/1.E-Hs7ura.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/2.s1_irV1Q.js +10 -0
- package/web/build/client/_app/immutable/nodes/2.s1_irV1Q.js.br +0 -0
- package/web/build/client/_app/immutable/nodes/2.s1_irV1Q.js.gz +0 -0
- package/web/build/client/_app/immutable/nodes/{3.AciugOtL.js → 3.pgwe-_5b.js} +1 -1
- package/web/build/client/_app/immutable/nodes/3.pgwe-_5b.js.br +0 -0
- package/web/build/client/_app/immutable/nodes/3.pgwe-_5b.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-BFhhV5JB.js +7 -0
- package/web/build/server/chunks/{1-C2qlInYk.js.map → 1-BFhhV5JB.js.map} +1 -1
- package/web/build/server/chunks/2-BZ_MVqj8.js +7 -0
- package/web/build/server/chunks/2-BZ_MVqj8.js.map +1 -0
- package/web/build/server/chunks/3-BV-TIUp1.js +7 -0
- package/web/build/server/chunks/{3-SO3atuWO.js.map → 3-BV-TIUp1.js.map} +1 -1
- package/web/build/server/chunks/{_server.ts-CRNhzL2a.js → _server.ts-CdFoXw36.js} +4 -4
- package/web/build/server/chunks/{_server.ts-CRNhzL2a.js.map → _server.ts-CdFoXw36.js.map} +1 -1
- package/web/build/server/chunks/{agent-sessions-kcUaLhK5.js → agent-sessions-D0WwtWgR.js} +56 -15
- package/web/build/server/chunks/agent-sessions-D0WwtWgR.js.map +1 -0
- package/web/build/server/chunks/{git-review-CXKcjYgZ.js → git-review-CgcBIbvM.js} +7 -7
- package/web/build/server/chunks/{git-review-CXKcjYgZ.js.map → git-review-CgcBIbvM.js.map} +1 -1
- package/web/build/server/chunks/{handler-_E0NucKN.js → handler-DbxjtK9M.js} +3 -3
- package/web/build/server/chunks/{handler-_E0NucKN.js.map → handler-DbxjtK9M.js.map} +1 -1
- package/web/build/server/chunks/{hooks.server-D7yPODoc.js → hooks.server-Dg6gYUqs.js} +3 -3
- package/web/build/server/chunks/{hooks.server-D7yPODoc.js.map → hooks.server-Dg6gYUqs.js.map} +1 -1
- package/web/build/server/chunks/{index.js-lMtDM8ZQ.js → index.js-NNne-njN.js} +876 -879
- package/web/build/server/chunks/index.js-NNne-njN.js.map +1 -0
- package/web/build/server/chunks/{manifest.js-BIm6jot5.js → manifest.js-V8ViI5bl.js} +8 -8
- package/web/build/server/chunks/{manifest.js-BIm6jot5.js.map → manifest.js-V8ViI5bl.js.map} +1 -1
- package/web/build/server/chunks/{remote-1g4ayag-DmqxwUIz.js → remote-1g4ayag-CCsG2QXw.js} +4 -4
- package/web/build/server/chunks/{remote-1g4ayag-DmqxwUIz.js.map → remote-1g4ayag-CCsG2QXw.js.map} +1 -1
- package/web/build/server/chunks/{remote-wh6t6j-DZk0W9Pp.js → remote-wh6t6j-BCvmX37z.js} +5 -5
- package/web/build/server/chunks/{remote-wh6t6j-DZk0W9Pp.js.map → remote-wh6t6j-BCvmX37z.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/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 +0 -2
- 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.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,C as n,D as r,E as i,F as a,G as o,H as s,J as c,K as l,M as u,O as d,P as f,R as p,S as m,T as h,U as g,W as _,X as v,Z as y,a as b,b as x,c as S,ct as C,dt as w,f as T,ft as E,i as D,j as O,k,l as A,lt as j,m as M,nt as N,o as P,ot as F,p as I,pt as L,q as R,rt as z,st as B,ut as V,w as H,x as U,y as W,z as G}from"../chunks/D8WOD_eS.js";import{n as K,x as q}from"../chunks/
|
|
1
|
+
import{$ as e,A as t,C as n,D as r,E as i,F as a,G as o,H as s,J as c,K as l,M as u,O as d,P as f,R as p,S as m,T as h,U as g,W as _,X as v,Z as y,a as b,b as x,c as S,ct as C,dt as w,f as T,ft as E,i as D,j as O,k,l as A,lt as j,m as M,nt as N,o as P,ot as F,p as I,pt as L,q as R,rt as z,st as B,ut as V,w as H,x as U,y as W,z as G}from"../chunks/D8WOD_eS.js";import{n as K,x as q}from"../chunks/C0hrdiUt.js";import{$ as J,A as Y,At as ee,Ct as X,D as te,Dt as ne,E as re,Et as ie,F as Z,H as ae,L as oe,M as se,O as ce,Ot as le,P as ue,R as de,S as fe,St as pe,T as me,Tt as he,V as ge,W as _e,_ as ve,_t as ye,b as be,bt as xe,c as Se,d as Ce,dt as we,et as Te,f as Ee,ft as De,g as Oe,gt as ke,ht as Ae,it as je,k as Me,kt as Ne,l as Pe,lt as Fe,mt as Ie,n as Le,nt as Re,o as ze,ot as Be,p as Ve,pt as He,r as Ue,t as We,tt as Ge,u as Ke,ut as qe,v as Je,vt as Q,w as Ye,wt as Xe,x as Ze,xt as Qe,y as $e,yt as et}from"../chunks/CpeIO6nz.js";import"../chunks/lUYXRDtZ.js";var tt={high:0,med:1,low:2,nit:3};function nt(e){return e.blocking?-1:tt[e.severity]}function rt(e){if(!e.length)return`var(--text-faint)`;let t=e[0];for(let n=1;n<e.length;n++)nt(e[n])<nt(t)&&(t=e[n]);return t.accentColor}var it={blocking:`#c92a2a`,high:`#c92a2a`,med:`#c44d1a`,low:`#8b7d2e`,nit:`#6b7280`},at={feat:`#1f9d55`,fix:`#c92a2a`,refactor:`#7c4dd6`,perf:`#a5720a`,test:`#2f6fe0`,chore:`#5b6472`,docs:`#0f8fa3`,infra:`#c1690f`},ot=40,st=3;function ct(e){return(e.meta.branch||`reporte`).replace(/[^a-z0-9.-]+/gi,`-`)||`reporte`}function $(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function lt(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}function ut(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>=0?e.slice(t+1):e}function dt(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>=0?e.slice(0,t):``}function ft(e){return e.blocking?`BLOQUEANTE`:xe(e.severity).toUpperCase()}function pt(e){return e.blocking?it.blocking:it[e.severity]||it.nit}function mt(e){return[...e.findings].sort((e,t)=>nt(e)-nt(t))}function ht(e){let t={blocking:0,high:0,med:0,low:0,nit:0};for(let n of e.findings)n.blocking?t.blocking+=1:t[n.severity]+=1;return t}function gt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(`es-AR`,{day:`2-digit`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}function _t(e){return(e.kind===`add`?`+`:e.kind===`del`?`-`:` `)+e.text}function vt(e,t){let n=t.block?e.blocks.find(e=>e.id===t.block):void 0,r=n?.file||t.file,i=e.files.find(e=>e.path===r);if(!i?.diff)return null;let a=Ne(i.diff),o=n&&n.start?{side:n.side,start:n.start,end:n.end||n.start}:t.line?{side:`new`,start:t.line,end:t.line}:null;if(!o)return null;let s=a.find(e=>he(e,o));if(!s)return null;let c={side:o.side,start:Math.max(1,o.start-st),end:o.end+st},l=s.lines.filter(e=>le(e,c)?!0:e.kind===`del`&&o.side===`new`&&e.oldNo!=null?e.oldNo>=c.start-2&&e.oldNo<=c.end+2:e.kind===`add`&&o.side===`old`&&e.newNo!=null&&e.newNo>=c.start-2&&e.newNo<=c.end+2);l.length||(l=s.lines);let u=l.length>ot;u&&(l=l.slice(0,ot));let d=l.map(_t).join(`
|
|
2
2
|
`),f=`@@ -${s.oldStart},${s.oldCount} +${s.newStart},${s.newCount} @@${s.header?` `+s.header:``}`;return u?`${f}\n${d}\n…`:`${f}\n${d}`}function yt(e){let t=e.remoteUrl?.trim();if(t)return t;let n=e.repo?.trim()||``;return/^(https?:\/\/|git@|ssh:\/\/)/i.test(n)?n:``}function bt(e){let t=e.branch||`—`;return`${e.base||`develop`} ← ${t}`}function xt(e,t={}){let n=t.mode??`full`,{meta:r,document:i}=e,a=ht(i),o=mt(i),s=[];if(s.push(`# Review · \`${bt(r)}\``),s.push(``),s.push(`> Generado con **diff-review** · ${gt(e.savedAt)}`),yt(r)&&s.push(`> Repo: \`${yt(r)}\``),s.push(``),s.push(`## Resumen`),s.push(``),s.push(`| | |`),s.push(`|---|---|`),s.push(`| Temas | ${i.groups.length} |`),s.push(`| Hallazgos | ${i.findings.length} |`),a.blocking&&s.push(`| Bloqueantes | **${a.blocking}** |`),a.high&&s.push(`| Alta | ${a.high} |`),a.med&&s.push(`| Media | ${a.med} |`),a.low&&s.push(`| Baja | ${a.low} |`),a.nit&&s.push(`| Detalle | ${a.nit} |`),s.push(``),s.push(`## Intención`),s.push(``),s.push(i.intent?.trim()||`_Sin intención._`),s.push(``),i.notes?.length){s.push(`## Notas`),s.push(``);for(let e of i.notes)s.push(`- ${e}`);s.push(``)}if(s.push(`## Temas`),s.push(``),i.groups.forEach((e,t)=>{let n=He(e.title,e.kind);s.push(`### ${pe(e.id,t+1)} · ${ke(e.kind)} — ${n}`),s.push(``),e.intent?.trim()&&(s.push(e.intent.trim()),s.push(``));let r=i.blocks.filter(t=>t.group===e.id);for(let e of r){let t=e.lines||(e.start&&e.end?`L${e.start}-${e.end}`:``),n=ut(e.file);s.push(`- **\`${n}\`**${t?` (${t})`:``}: ${e.what}`),e.why?.trim()&&s.push(` - _${e.why.trim()}_`)}r.length&&s.push(``)}),s.push(`## Hallazgos`),s.push(``),o.length?o.forEach((e,t)=>{let r=ft(e),a=ut(e.file),o=dt(e.file);if(s.push(`### ${Ae(e.id,t+1)} · ${r} · ${Ie(e.kind)}`),s.push(``),e.blocking?s.push(`> [!CAUTION]`):e.severity===`high`&&s.push(`> [!WARNING]`),(e.blocking||e.severity===`high`)&&(s.push(`> ${e.what}`),s.push(``)),s.push(`\`${a}${e.line?`:`+e.line:``}\`${o?` · \`${o}\``:``} · ${e.class}`),s.push(``),e.blocking||e.severity===`high`||(s.push(e.what),s.push(``)),e.fix?.trim()&&(s.push(`**Sugerencia:** ${e.fix.trim()}`),s.push(``)),n===`full`){let t=vt(i,e);t&&(s.push("```diff"),s.push(t),s.push("```"),s.push(``))}}):(s.push(`_Sin hallazgos._`),s.push(``)),i.skipped?.length){s.push(`## Omitidos`),s.push(``);for(let e of i.skipped)s.push(`- \`${e.file}\` (${e.reason})`);s.push(``)}return s.join(`
|
|
3
3
|
`)}function St(e){return`<pre class="diff">${e.split(`
|
|
4
4
|
`).map(e=>e.startsWith(`@@`)?`<div class="diff-hunk">${$(e)}</div>`:e===`…`?`<div class="diff-more">…</div>`:`<div class="diff-line ${e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}"><span class="m">${$(e.charAt(0)||` `)}</span><span class="t">${$(e.slice(1))}</span></div>`).join(``)}</pre>`}function Ct(e,t={}){let n=t.mode??`full`,{meta:r,document:i}=e,a=`Review · ${bt(r)}`,o=ht(i),s=mt(i),c=[o.blocking?`<span class="chip blocking">${Q(o.blocking,`bloqueante`,`bloqueantes`)}</span>`:``,o.high?`<span class="chip high">${Q(o.high,`alta`,`altas`)}</span>`:``,o.med?`<span class="chip med">${Q(o.med,`media`,`medias`)}</span>`:``,o.low?`<span class="chip low">${Q(o.low,`baja`,`bajas`)}</span>`:``,o.nit?`<span class="chip nit">${Q(o.nit,`detalle`,`detalles`)}</span>`:``].filter(Boolean).join(``),l=i.groups.map((e,t)=>{let n=$(He(e.title,e.kind)),r=e.kind in at?e.kind:`chore`,a=i.blocks.filter(t=>t.group===e.id),o=a.map(e=>{let t=e.lines||(e.start&&e.end?`L${e.start}-${e.end}`:``),n=e.why?.trim()?`<div class="why">${$(e.why.trim())}</div>`:``,r=ut(e.file),i=dt(e.file);return`<li>
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1792444085246"}
|
|
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-DbxjtK9M.js';
|
|
6
|
+
import './server/chunks/index.js-NNne-njN.js';
|
|
7
|
+
import './server/chunks/manifest.js-V8ViI5bl.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-DbxjtK9M.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-NNne-njN.js';
|
|
15
|
+
import './server/chunks/manifest.js-V8ViI5bl.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.E-Hs7ura.js","_app/immutable/chunks/D8WOD_eS.js","_app/immutable/chunks/lUYXRDtZ.js","_app/immutable/chunks/FOc6rgIW.js","_app/immutable/chunks/C0hrdiUt.js"];
|
|
3
|
+
const stylesheets = [];
|
|
4
|
+
const fonts = [];
|
|
5
|
+
|
|
6
|
+
export { fonts, imports, index, stylesheets };
|
|
7
|
+
//# sourceMappingURL=1-BFhhV5JB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const index = 2;
|
|
2
|
+
const imports = ["_app/immutable/nodes/2.s1_irV1Q.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","_app/immutable/chunks/FOc6rgIW.js"];
|
|
3
|
+
const stylesheets = ["_app/immutable/assets/storage.C8XGESwn.css","_app/immutable/assets/2.C4whE4xz.css"];
|
|
4
|
+
const fonts = [];
|
|
5
|
+
|
|
6
|
+
export { fonts, imports, index, stylesheets };
|
|
7
|
+
//# sourceMappingURL=2-BZ_MVqj8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2-BZ_MVqj8.js","sources":["../../../.svelte-kit/output/server/nodes/2.js"],"sourcesContent":["\n\nexport const index = 2;\nexport const imports = [\"_app/immutable/nodes/2.s1_irV1Q.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\",\"_app/immutable/chunks/FOc6rgIW.js\"];\nexport const stylesheets = [\"_app/immutable/assets/storage.C8XGESwn.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.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"];
|
|
3
|
+
const stylesheets = ["_app/immutable/assets/storage.C8XGESwn.css","_app/immutable/assets/3.BT54aVKb.css"];
|
|
4
|
+
const fonts = [];
|
|
5
|
+
|
|
6
|
+
export { fonts, imports, index, stylesheets };
|
|
7
|
+
//# sourceMappingURL=3-BV-TIUp1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3-
|
|
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,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-D0WwtWgR.js';
|
|
2
|
+
import { e as error } from './index.js-NNne-njN.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-CdFoXw36.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_server.ts-
|
|
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,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';
|
|
@@ -1769,7 +1769,7 @@ var RULES = `- Ids: themes use \`t1\`, \`t2\`, …; findings use \`f1\`, \`f2\`,
|
|
|
1769
1769
|
/** @param {{ hasDiff?: boolean }} [ctx] */
|
|
1770
1770
|
function workflowLocal(base, branch, ctx = {}) {
|
|
1771
1771
|
if (ctx.hasDiff) return `Workflow:
|
|
1772
|
-
1.
|
|
1772
|
+
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
1773
|
2. Read enough surrounding code (types, callers, tests) to judge behavior, not only the hunk lines.
|
|
1774
1774
|
3. Emit the JSON file. Do not modify the repo.
|
|
1775
1775
|
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 +1787,7 @@ function validateCliCommand(filename) {
|
|
|
1787
1787
|
/** Workflow sin paso de validate por CLI (sesiones ACP: valida el server). */
|
|
1788
1788
|
function workflowLocalAcp(ctx = {}) {
|
|
1789
1789
|
if (ctx.hasDiff) return `Workflow:
|
|
1790
|
-
1.
|
|
1790
|
+
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
1791
|
2. Read enough surrounding code (types, callers, tests) to judge behavior, not only the hunk lines.
|
|
1792
1792
|
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
1793
|
return `Workflow:
|
|
@@ -1828,11 +1828,11 @@ function outputSchemaBlock(meta) {
|
|
|
1828
1828
|
* }} ctx
|
|
1829
1829
|
*/
|
|
1830
1830
|
function formatPrecomputedContext(ctx) {
|
|
1831
|
-
const lines = ["Precomputed git context (do not rediscover):"];
|
|
1831
|
+
const lines = ["Precomputed git context (provided by the host — do not rediscover or recompute):"];
|
|
1832
1832
|
if (ctx.mergeBase) lines.push(`- Merge-base SHA: \`${ctx.mergeBase}\``);
|
|
1833
1833
|
if (ctx.branchSha) lines.push(`- Branch tip SHA: \`${ctx.branchSha}\``);
|
|
1834
1834
|
if (ctx.baseSha) lines.push(`- Base tip SHA: \`${ctx.baseSha}\``);
|
|
1835
|
-
if (ctx.diffRelPath) lines.push(`- Diff file (relative to repo root): \`${ctx.diffRelPath}\` —
|
|
1835
|
+
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
1836
|
const files = Array.isArray(ctx.files) ? ctx.files : [];
|
|
1837
1837
|
if (files.length) {
|
|
1838
1838
|
lines.push(`- Files in the diff (${files.length}):`);
|
|
@@ -2431,10 +2431,15 @@ ${TOOL_RULES}
|
|
|
2431
2431
|
${SERVER_VALIDATES}`;
|
|
2432
2432
|
}
|
|
2433
2433
|
async function checkOutput(entry, since, retriesLeft) {
|
|
2434
|
+
if (entry.cancelled) return;
|
|
2434
2435
|
const path = companionPaths(entry.repo, entry.outputFilename).json;
|
|
2435
2436
|
if (!(existsSync(path) && mtime(path) >= since)) {
|
|
2436
|
-
if (retriesLeft > 0)
|
|
2437
|
-
|
|
2437
|
+
if (retriesLeft > 0) {
|
|
2438
|
+
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.");
|
|
2439
|
+
if (entry.cancelled || again == null) return;
|
|
2440
|
+
return checkOutput(entry, again, retriesLeft - 1);
|
|
2441
|
+
}
|
|
2442
|
+
if (entry.mode === "review" && !entry.cancelled) emit(entry, {
|
|
2438
2443
|
type: "review",
|
|
2439
2444
|
ok: false,
|
|
2440
2445
|
filename: entry.outputFilename,
|
|
@@ -2468,6 +2473,7 @@ async function checkOutput(entry, since, retriesLeft) {
|
|
|
2468
2473
|
});
|
|
2469
2474
|
return;
|
|
2470
2475
|
}
|
|
2476
|
+
if (entry.cancelled) return;
|
|
2471
2477
|
const canRetry = retriesLeft > 0;
|
|
2472
2478
|
emit(entry, {
|
|
2473
2479
|
type: "review",
|
|
@@ -2477,16 +2483,23 @@ async function checkOutput(entry, since, retriesLeft) {
|
|
|
2477
2483
|
final: !canRetry
|
|
2478
2484
|
});
|
|
2479
2485
|
if (!canRetry) return;
|
|
2480
|
-
|
|
2486
|
+
const again = await followUp(entry, invalidJsonFixPrompt(entry, path, result), "Corregí los errores de validación del JSON.");
|
|
2487
|
+
if (entry.cancelled || again == null) return;
|
|
2488
|
+
await checkOutput(entry, again, retriesLeft - 1);
|
|
2481
2489
|
}
|
|
2482
|
-
/**
|
|
2490
|
+
/**
|
|
2491
|
+
* Turno extra que pide el server (corregir el JSON, seguir después de un rechazo).
|
|
2492
|
+
* Devuelve cuándo empezó, o `null` si el usuario canceló (no hay que seguir reintentando).
|
|
2493
|
+
*/
|
|
2483
2494
|
async function followUp(entry, prompt, shown) {
|
|
2495
|
+
if (entry.cancelled) return null;
|
|
2484
2496
|
emit(entry, {
|
|
2485
2497
|
type: "user",
|
|
2486
2498
|
text: shown,
|
|
2487
2499
|
mode: "fix"
|
|
2488
2500
|
});
|
|
2489
2501
|
const acp = await ensureAcp(entry);
|
|
2502
|
+
if (entry.cancelled) return null;
|
|
2490
2503
|
const started = Date.now();
|
|
2491
2504
|
entry.rejections = [];
|
|
2492
2505
|
const { stopReason } = await acp.prompt(prompt);
|
|
@@ -2494,10 +2507,15 @@ async function followUp(entry, prompt, shown) {
|
|
|
2494
2507
|
type: "turn",
|
|
2495
2508
|
stopReason
|
|
2496
2509
|
});
|
|
2510
|
+
if (entry.cancelled || stopReason === "cancelled") {
|
|
2511
|
+
entry.cancelled = true;
|
|
2512
|
+
return null;
|
|
2513
|
+
}
|
|
2497
2514
|
return started;
|
|
2498
2515
|
}
|
|
2499
2516
|
async function runTurn(entry, text, mode, opts) {
|
|
2500
2517
|
if (entry.busy) throw new Error("El agente todavía está trabajando en el pedido anterior.");
|
|
2518
|
+
entry.cancelled = false;
|
|
2501
2519
|
entry.busy = true;
|
|
2502
2520
|
entry.mode = mode;
|
|
2503
2521
|
if (entry.idleTimer) clearTimeout(entry.idleTimer);
|
|
@@ -2509,6 +2527,11 @@ async function runTurn(entry, text, mode, opts) {
|
|
|
2509
2527
|
try {
|
|
2510
2528
|
if (!entry.acp) setStatus(entry, "starting", `Lanzando ${entry.agentLabel}…`);
|
|
2511
2529
|
const acp = await ensureAcp(entry, opts.model);
|
|
2530
|
+
if (entry.cancelled) {
|
|
2531
|
+
entry.busy = false;
|
|
2532
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2533
|
+
return;
|
|
2534
|
+
}
|
|
2512
2535
|
setStatus(entry, "working", "El agente está revisando…");
|
|
2513
2536
|
const since = Date.now();
|
|
2514
2537
|
entry.rejections = [];
|
|
@@ -2517,11 +2540,22 @@ async function runTurn(entry, text, mode, opts) {
|
|
|
2517
2540
|
type: "turn",
|
|
2518
2541
|
stopReason
|
|
2519
2542
|
});
|
|
2520
|
-
if (
|
|
2543
|
+
if (entry.cancelled || stopReason === "cancelled") {
|
|
2544
|
+
entry.cancelled = true;
|
|
2545
|
+
entry.busy = false;
|
|
2546
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2547
|
+
return;
|
|
2548
|
+
}
|
|
2549
|
+
if (mode !== "ask") await checkOutput(entry, since, OUTPUT_AUTO_RETRIES);
|
|
2521
2550
|
entry.busy = false;
|
|
2522
|
-
setStatus(entry, "idle");
|
|
2551
|
+
if (entry.cancelled) setStatus(entry, "idle", "Cancelado.");
|
|
2552
|
+
else setStatus(entry, "idle");
|
|
2523
2553
|
} catch (err) {
|
|
2524
2554
|
entry.busy = false;
|
|
2555
|
+
if (entry.cancelled) {
|
|
2556
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2557
|
+
return;
|
|
2558
|
+
}
|
|
2525
2559
|
const raw = err instanceof Error ? err.message : String(err);
|
|
2526
2560
|
setStatus(entry, "error", authFailureMessage(entry.agentId, entry.agentLabel, raw) || raw);
|
|
2527
2561
|
} finally {
|
|
@@ -2785,12 +2819,19 @@ async function cancelTurn(id) {
|
|
|
2785
2819
|
const entry = sessions.get(id);
|
|
2786
2820
|
if (!entry) return;
|
|
2787
2821
|
entry.cancelled = true;
|
|
2822
|
+
for (const [requestId, pending] of [...entry.pendingPermissions]) {
|
|
2823
|
+
clearTimeout(pending.timer);
|
|
2824
|
+
entry.pendingPermissions.delete(requestId);
|
|
2825
|
+
pending.resolve(false, { quiet: true });
|
|
2826
|
+
}
|
|
2788
2827
|
if (entry.acp && entry.busy) {
|
|
2789
|
-
|
|
2828
|
+
try {
|
|
2829
|
+
await entry.acp.cancel();
|
|
2830
|
+
} catch {}
|
|
2790
2831
|
return;
|
|
2791
2832
|
}
|
|
2792
2833
|
entry.busy = false;
|
|
2793
|
-
setStatus(entry, "
|
|
2834
|
+
setStatus(entry, "idle", "Cancelado.");
|
|
2794
2835
|
}
|
|
2795
2836
|
function subscribe(id, listener) {
|
|
2796
2837
|
const entry = sessions.get(id);
|
|
@@ -2815,5 +2856,5 @@ function startPendingAgentRun() {
|
|
|
2815
2856
|
}
|
|
2816
2857
|
}
|
|
2817
2858
|
|
|
2818
|
-
export {
|
|
2819
|
-
//# sourceMappingURL=agent-sessions-
|
|
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
|