@jmanuelcorral/openteam 0.1.41 → 0.1.42

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 (35) hide show
  1. package/README.es.md +1 -1
  2. package/README.md +1 -1
  3. package/dist/cli.js +419 -36
  4. package/dist/commands/graph.d.ts +8 -0
  5. package/dist/commands/graph.d.ts.map +1 -1
  6. package/dist/config/schema.d.ts +18 -0
  7. package/dist/config/schema.d.ts.map +1 -1
  8. package/dist/console/assets.d.ts +9 -1
  9. package/dist/console/assets.d.ts.map +1 -1
  10. package/dist/console/opencodeClient.d.ts +6 -0
  11. package/dist/console/opencodeClient.d.ts.map +1 -1
  12. package/dist/console/protocol.d.ts +8 -0
  13. package/dist/console/protocol.d.ts.map +1 -1
  14. package/dist/console/render.d.ts +25 -0
  15. package/dist/console/render.d.ts.map +1 -1
  16. package/dist/index.js +8 -2
  17. package/dist/orchestrator/worktreeAdapter.d.ts +39 -0
  18. package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -0
  19. package/dist/orchestrator/worktreeDispatch.d.ts +84 -0
  20. package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -0
  21. package/dist/orchestrator/worktreeReconciler.d.ts +74 -0
  22. package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -0
  23. package/dist/storage/graph/worktreeRegistry.d.ts +29 -0
  24. package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -0
  25. package/dist/telemetry/graphView.d.ts +75 -0
  26. package/dist/telemetry/graphView.d.ts.map +1 -0
  27. package/dist/web/console.d.ts +6 -0
  28. package/dist/web/console.d.ts.map +1 -1
  29. package/dist/web/graphRoute.d.ts +36 -0
  30. package/dist/web/graphRoute.d.ts.map +1 -0
  31. package/dist/web/server.d.ts +21 -2
  32. package/dist/web/server.d.ts.map +1 -1
  33. package/dist/web/start.d.ts +11 -0
  34. package/dist/web/start.d.ts.map +1 -1
  35. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import type { ConfigSource } from "../config/resolve";
2
2
  import type { GraphMode } from "../config/schema";
3
+ import type { WorktreeReconcileReport } from "../orchestrator/worktreeReconciler";
3
4
  import type { LeaseRecord } from "../storage/graph/workspaceLease";
4
5
  /**
5
6
  * GE-045 — operator commands for the graph runtime as pure dry-run plans.
@@ -62,4 +63,11 @@ export declare function renderGraphStatus(snapshot: GraphHealthSnapshot): string
62
63
  export declare function planGraphRecover(snapshot: GraphHealthSnapshot, options?: GraphRecoverOptions): GraphActionPlan;
63
64
  /** Decide whether cancelling the active run is a safe, idempotent action. */
64
65
  export declare function planGraphCancel(snapshot: GraphHealthSnapshot, options: GraphCancelOptions): GraphActionPlan;
66
+ /**
67
+ * Render the operator-facing view of a worktree reconciliation plan (GE-074).
68
+ * Pure: the caller supplies a settled report from `planWorktreeReconciliation`
69
+ * and this only formats it. A disabled report renders a single no-op line so
70
+ * the operator can see isolation is off without any worktree being touched.
71
+ */
72
+ export declare function renderWorktreeReconciliation(report: WorktreeReconcileReport): string;
65
73
  //# sourceMappingURL=graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/commands/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE;;;;;;;;;;;;;;GAcG;AAEH,oEAAoE;AACpE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAEnE,4EAA4E;AAC5E,MAAM,MAAM,mBAAmB,GAAG;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,qEAAqE;IACrE,QAAQ,CAAC,KAAK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AAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAUF,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAkBvE;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAejB;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,eAAe,CAejB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAoBR"}
@@ -37,6 +37,9 @@ export declare const GraphConfigSchema: z.ZodObject<{
37
37
  active: "active";
38
38
  }>>;
39
39
  killSwitch: z.ZodDefault<z.ZodBoolean>;
40
+ worktrees: z.ZodDefault<z.ZodObject<{
41
+ enabled: z.ZodDefault<z.ZodBoolean>;
42
+ }, z.core.$strip>>;
40
43
  }, z.core.$strip>;
41
44
  export declare const ConsoleHostSchema: z.ZodEnum<{
42
45
  "127.0.0.1": "127.0.0.1";
@@ -57,6 +60,9 @@ export declare const ConsoleConfigSchema: z.ZodDefault<z.ZodObject<{
57
60
  enabled: z.ZodDefault<z.ZodBoolean>;
58
61
  pty: z.ZodOptional<z.ZodBoolean>;
59
62
  }, z.core.$strip>>;
63
+ graphView: z.ZodOptional<z.ZodObject<{
64
+ enabled: z.ZodDefault<z.ZodBoolean>;
65
+ }, z.core.$strip>>;
60
66
  }, z.core.$strip>>;
61
67
  /**
62
68
  * Bloque de configuración de la Console web (nombre canónico `console`).
@@ -270,6 +276,9 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
270
276
  enabled: z.ZodDefault<z.ZodBoolean>;
271
277
  pty: z.ZodOptional<z.ZodBoolean>;
272
278
  }, z.core.$strip>>;
279
+ graphView: z.ZodOptional<z.ZodObject<{
280
+ enabled: z.ZodDefault<z.ZodBoolean>;
281
+ }, z.core.$strip>>;
273
282
  }, z.core.$strip>>;
274
283
  storage: z.ZodDefault<z.ZodObject<{
275
284
  sqliteIndex: z.ZodDefault<z.ZodObject<{
@@ -326,6 +335,9 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
326
335
  active: "active";
327
336
  }>>;
328
337
  killSwitch: z.ZodDefault<z.ZodBoolean>;
338
+ worktrees: z.ZodDefault<z.ZodObject<{
339
+ enabled: z.ZodDefault<z.ZodBoolean>;
340
+ }, z.core.$strip>>;
329
341
  }, z.core.$strip>>;
330
342
  }, z.core.$strip>;
331
343
  /** Esquema público de la config de openteam. */
@@ -404,6 +416,9 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
404
416
  enabled: z.ZodDefault<z.ZodBoolean>;
405
417
  pty: z.ZodOptional<z.ZodBoolean>;
406
418
  }, z.core.$strip>>;
419
+ graphView: z.ZodOptional<z.ZodObject<{
420
+ enabled: z.ZodDefault<z.ZodBoolean>;
421
+ }, z.core.$strip>>;
407
422
  }, z.core.$strip>>;
408
423
  storage: z.ZodDefault<z.ZodObject<{
409
424
  sqliteIndex: z.ZodDefault<z.ZodObject<{
@@ -460,6 +475,9 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
460
475
  active: "active";
461
476
  }>>;
462
477
  killSwitch: z.ZodDefault<z.ZodBoolean>;
478
+ worktrees: z.ZodDefault<z.ZodObject<{
479
+ enabled: z.ZodDefault<z.ZodBoolean>;
480
+ }, z.core.$strip>>;
463
481
  }, z.core.$strip>>;
464
482
  }, z.core.$strip>;
465
483
  export type ModelRef = z.infer<typeof ModelRefSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema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;;;;;;;;;iBAA6B,CAAC;AAE/D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,GACrB,oBAAoB,CAEtB"}
@@ -5,5 +5,13 @@
5
5
  * todo el contenido dinámico antes de insertarlo.
6
6
  */
7
7
  export declare const CONSOLE_STYLE = "\n:root{color-scheme:dark;--bg:#0f1115;--panel:#171a21;--fg:#e6e8eb;--muted:#8b929c;--good:#3fb950;--local:#58a6ff;--frontier:#d29922;--line:#262b34}\n*{box-sizing:border-box}\nbody{margin:0;background:var(--bg);color:var(--fg);font:14px/1.5 ui-sans-serif,system-ui,Segoe UI,Roboto,sans-serif}\nheader{padding:16px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}\nheader h1{font-size:18px;margin:0}\nheader .meta{color:var(--muted);font-size:12px}\nmain{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;padding:24px}\n.panel{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px}\n.panel h2{font-size:14px;margin:0 0 12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}\n.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}\n.stat{display:flex;flex-direction:column;gap:2px}\n.stat .k{color:var(--muted);font-size:12px}\n.stat .v{font-size:18px;font-weight:600}\n.good{color:var(--good)}\n.local{color:var(--local)}\n.frontier{color:var(--frontier)}\n.muted{color:var(--muted)}\ntable{width:100%;border-collapse:collapse;font-size:13px}\nth,td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)}\nth{color:var(--muted);font-weight:600}\n.hash{font-family:ui-monospace,Consolas,monospace;color:var(--muted)}\n.progress{height:10px;background:#0b0d11;border-radius:6px;overflow:hidden;border:1px solid var(--line)}\n.progress .bar{height:100%;background:var(--good)}\nul.items,ul.timeline{list-style:none;margin:8px 0 0;padding:0;max-height:320px;overflow:auto}\nul.items li,ul.timeline li{padding:4px 0;border-bottom:1px solid var(--line)}\nul.items li.done{color:var(--muted)}\nul.items .box{font-family:monospace}\n.who{color:var(--local)}\n.tag{color:var(--frontier);font-size:12px}\n.kind{display:inline-block;min-width:66px;color:var(--muted);font-size:12px}\ncode{font-family:ui-monospace,Consolas,monospace;background:#0b0d11;padding:1px 5px;border-radius:4px}\n.mono{font-family:ui-monospace,Consolas,monospace;font-size:12px}\n.tabs{display:flex;gap:6px;padding:12px 24px 0;flex-wrap:wrap;border-bottom:1px solid var(--line)}\n.tabs .tab{background:var(--panel);color:var(--fg);border:1px solid var(--line);border-bottom:none;border-radius:8px 8px 0 0;padding:8px 14px;cursor:pointer;font:inherit;display:flex;align-items:center;gap:6px}\n.tabs .tab.active{background:var(--bg);border-color:var(--local);color:var(--fg)}\n.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:var(--muted)}\n.badge{font-size:11px;padding:1px 8px;border-radius:10px;border:1px solid var(--line);color:var(--muted);vertical-align:middle}\n.status-running{background:var(--good)}\n.badge.status-running{color:var(--good);border-color:var(--good)}\n.status-idle{background:var(--muted)}\n.badge.status-idle{color:var(--muted)}\n.status-waiting-input{background:var(--frontier)}\n.badge.status-waiting-input{color:var(--frontier);border-color:var(--frontier)}\n.status-ended{background:#6e7681}\n.badge.status-ended{color:#6e7681}\n.term .termlog{background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:340px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap}\n.term .tl{padding:1px 0}\n.term .tl.input{color:var(--local)}\n.term .tl.tool{color:var(--frontier)}\n.term .tl.status{color:var(--muted)}\n.term .tl.error{color:#f85149}\n.term .tl.permission{color:var(--frontier);font-weight:600}\n.term form.terminput{display:flex;gap:8px;margin-top:10px}\n.term form.terminput input{flex:1;background:#0b0d11;color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit}\n.term form.terminput button{background:var(--local);color:#04122b;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit;font-weight:600}\n.pty .ptylog{background:#05070a;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:340px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap;color:#c8d1dc}\n.pty form.ptyinput{display:flex;gap:8px;margin-top:10px}\n.pty form.ptyinput input{flex:1;background:#05070a;color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit}\n.pty form.ptyinput button,.pty .pty-start{background:var(--frontier);color:#1a1200;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit;font-weight:600;margin-top:8px}\n.pty .pty-start:disabled{opacity:.5;cursor:default}\n";
8
- export declare const CONSOLE_CLIENT_JS = "\n(function(){\n var authTok='';\n try{\n var qp=new URLSearchParams(window.location.search).get('token');\n if(qp){authTok='?token='+encodeURIComponent(qp)}\n }catch(e){/* ignore */}\n function reloadIfChanged(prev){\n fetch('/api/state'+authTok).then(function(r){return r.json()}).then(function(s){\n if(s.generatedAt!==prev){location.reload()}\n }).catch(function(){});\n }\n var current=document.documentElement.getAttribute('data-generated')||'';\n if('EventSource' in window){\n try{\n var es=new EventSource('/events'+authTok);\n es.addEventListener('state',function(){location.reload()});\n es.onerror=function(){/* fallback below */};\n }catch(e){/* ignore */}\n }\n var ms=parseInt(document.documentElement.getAttribute('data-refresh')||'2000',10);\n setInterval(function(){reloadIfChanged(current)},isNaN(ms)?2000:Math.max(250,ms));\n\n function selectTab(name){\n var tabs=document.querySelectorAll('#tabbar .tab');\n for(var i=0;i<tabs.length;i++){tabs[i].classList.toggle('active',tabs[i].getAttribute('data-tab')===name)}\n var views=document.querySelectorAll('main .view');\n var matched=false;\n for(var j=0;j<views.length;j++){\n var show=views[j].getAttribute('data-view')===name;\n views[j].hidden=!show;\n if(show){matched=true;if(name!=='all'){connectTerminal(views[j],name)}}\n }\n if(!matched){return false}\n try{sessionStorage.setItem('openteam.tab',name)}catch(e){}\n return true;\n }\n function connectTerminal(view,id){\n if(view.__wired){return}\n var root=document.documentElement;\n var token=root.getAttribute('data-token');\n if(root.getAttribute('data-terminal')!=='1'||!token){return}\n var log=view.querySelector('.termlog');\n if(!log){return}\n view.__wired=true;\n function append(cls,text){\n var line=document.createElement('div');\n line.className='tl '+cls;line.textContent=text;\n log.appendChild(line);log.scrollTop=log.scrollHeight;\n }\n var q='/console/session/'+encodeURIComponent(id);\n var tk='token='+encodeURIComponent(token);\n if('EventSource' in window){\n try{\n var es=new EventSource(q+'/stream?'+tk);\n es.addEventListener('frame',function(e){try{var f=JSON.parse(e.data);append(f.kind,f.text)}catch(_){}}); \n es.onerror=function(){/* reconecta solo */};\n }catch(_){/* ignore */}\n }\n var form=view.querySelector('form.terminput');\n if(form){\n form.addEventListener('submit',function(e){\n e.preventDefault();\n var inp=form.querySelector('input[name=text]');\n var text=inp.value;\n if(!text){return}\n inp.value='';append('input','\u203A '+text);\n fetch(q+'/input?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({text:text})})\n .then(function(r){if(!r.ok){append('error','\u2716 env\u00EDo rechazado ('+r.status+')')}})\n .catch(function(){append('error','\u2716 no se pudo enviar')});\n });\n }\n connectPty(view,id,q,tk);\n }\n function connectPty(view,id,q,tk){\n var root=document.documentElement;\n if(root.getAttribute('data-pty')!=='1'){return}\n var pane=view.querySelector('.pty');\n if(!pane){return}\n var log=pane.querySelector('.ptylog');\n var startBtn=pane.querySelector('.pty-start');\n var input=pane.querySelector('form.ptyinput');\n function plog(text){\n var d=document.createElement('span');d.textContent=text;\n log.appendChild(d);log.scrollTop=log.scrollHeight;\n }\n if(!startBtn){return}\n startBtn.addEventListener('click',function(){\n startBtn.disabled=true;plog('Abriendo shell\u2026\n');\n fetch(q+'/pty?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:'{}'})\n .then(function(r){return r.ok?r.json():Promise.reject(r.status)})\n .then(function(info){openPtyWs(info.wsUrl)})\n .catch(function(s){plog('\u2716 no se pudo abrir PTY ('+s+')\n');startBtn.disabled=false});\n });\n function openPtyWs(url){\n try{\n var ws=new WebSocket(url);\n ws.binaryType='arraybuffer';\n ws.onmessage=function(e){\n var data=e.data;\n if(data instanceof ArrayBuffer){data=new TextDecoder().decode(new Uint8Array(data))}\n plog(data);\n };\n ws.onclose=function(){plog('\n[shell cerrada]\n');startBtn.disabled=false};\n ws.onerror=function(){plog('\n\u2716 error de WebSocket\n')};\n if(input){\n input.hidden=false;\n input.addEventListener('submit',function(e){\n e.preventDefault();\n var c=input.querySelector('input[name=cmd]');\n if(!c.value){return}\n ws.send(c.value+'\r');c.value='';\n });\n }\n }catch(_){plog('\n\u2716 WebSocket no disponible\n');startBtn.disabled=false}\n }\n }\n var bar=document.getElementById('tabbar');\n if(bar){\n bar.addEventListener('click',function(e){\n var t=e.target;\n while(t&&t!==bar&&!t.getAttribute('data-tab')){t=t.parentNode}\n if(t&&t.getAttribute('data-tab')){selectTab(t.getAttribute('data-tab'))}\n });\n }\n var saved='all';\n try{saved=sessionStorage.getItem('openteam.tab')||'all'}catch(e){}\n if(!selectTab(saved)){selectTab('all')}\n})();\n";
8
+ /**
9
+ * Estilos del render del grafo de agentes (GE-083). Se inyectan en el `<style>`
10
+ * **solo** cuando la vista del grafo está habilitada, de modo que con la vista
11
+ * apagada la Console es byte-idéntica a hoy. Colorean cada nodo por estado y dan
12
+ * formato a las aristas y a los badges reference-only (intento/error/timeout/
13
+ * cancelación/veredicto/linaje/artefacto).
14
+ */
15
+ export declare const GRAPH_STYLE = "\n.graph-wrap{overflow:auto;background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:8px}\nsvg.graph{display:block}\n.gedge{stroke:#3a4250;stroke-width:1.5;marker-end:url(#garrow)}\n.gnode rect{fill:var(--panel);stroke:var(--line);stroke-width:1.5;rx:8}\n.gnode .gname{fill:var(--fg);font:600 12px ui-monospace,Consolas,monospace}\n.gnode .grole{fill:var(--muted);font-size:11px}\n.gnode .gstate{font-size:10px;text-transform:uppercase;letter-spacing:.05em}\n.gnode.state-pending rect{stroke:#6e7681}\n.gnode.state-pending .gstate{fill:#6e7681}\n.gnode.state-ready rect{stroke:var(--local)}\n.gnode.state-ready .gstate{fill:var(--local)}\n.gnode.state-active rect{stroke:var(--frontier)}\n.gnode.state-active .gstate{fill:var(--frontier)}\n.gnode.state-succeeded rect{stroke:var(--good)}\n.gnode.state-succeeded .gstate{fill:var(--good)}\n.gnode.state-failed rect{stroke:#f85149}\n.gnode.state-failed .gstate{fill:#f85149}\n.gnode.state-cancelled rect{stroke:#484f58}\n.gnode.state-cancelled .gstate{fill:#484f58}\n.gbadge{font-size:10px;font-family:ui-monospace,Consolas,monospace}\n.gbadge.badge-retry{fill:var(--frontier)}\n.gbadge.badge-error{fill:#f85149}\n.gbadge.badge-cancelled{fill:#484f58}\n.gbadge.badge-verdict.verdict-approved{fill:var(--good)}\n.gbadge.badge-verdict.verdict-rejected{fill:#f85149}\n.gbadge.badge-verdict.verdict-inconclusive{fill:var(--frontier)}\n.gbadge.badge-lineage{fill:var(--local)}\n.gbadge.badge-artifact{fill:var(--muted)}\n.gnode[data-session]{cursor:pointer}\n.gnode[data-session]:hover rect{stroke-width:2.5}\n.graph-health{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}\n.gchip{font-size:11px;padding:2px 10px;border-radius:10px;border:1px solid var(--line);color:var(--muted)}\n.gchip.on{font-weight:600}\n.gchip.gh-recovery.on,.gchip.gh-unknown.on{color:var(--frontier);border-color:var(--frontier)}\n.gchip.gh-conflict.on,.gchip.gh-kill.on{color:#f85149;border-color:#f85149}\n.graph-drill{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}\n.graph-drill h3{font-size:13px;margin:0 0 8px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}\n.graph-drill .drilllog{background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:280px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap}\n.graph-drill .drilllog .tl{padding:1px 0}\n.graph-drill .drilllog .tl.tool{color:var(--frontier)}\n.graph-drill .drilllog .tl.status{color:var(--muted)}\n.graph-drill .drilllog .tl.permission{color:var(--frontier);font-weight:600}\n.graph-drill .drilllog .tl.error{color:#f85149}\n";
16
+ export declare const CONSOLE_CLIENT_JS = "\n(function(){\n var authTok='';\n try{\n var qp=new URLSearchParams(window.location.search).get('token');\n if(qp){authTok='?token='+encodeURIComponent(qp)}\n }catch(e){/* ignore */}\n function reloadIfChanged(prev){\n fetch('/api/state'+authTok).then(function(r){return r.json()}).then(function(s){\n if(s.generatedAt!==prev){location.reload()}\n }).catch(function(){});\n }\n var current=document.documentElement.getAttribute('data-generated')||'';\n if('EventSource' in window){\n try{\n var es=new EventSource('/events'+authTok);\n es.addEventListener('state',function(){location.reload()});\n es.onerror=function(){/* fallback below */};\n }catch(e){/* ignore */}\n }\n var ms=parseInt(document.documentElement.getAttribute('data-refresh')||'2000',10);\n setInterval(function(){reloadIfChanged(current)},isNaN(ms)?2000:Math.max(250,ms));\n\n function selectTab(name){\n var tabs=document.querySelectorAll('#tabbar .tab');\n for(var i=0;i<tabs.length;i++){tabs[i].classList.toggle('active',tabs[i].getAttribute('data-tab')===name)}\n var views=document.querySelectorAll('main .view');\n var matched=false;\n for(var j=0;j<views.length;j++){\n var show=views[j].getAttribute('data-view')===name;\n views[j].hidden=!show;\n if(show){matched=true;if(name!=='all'){connectTerminal(views[j],name)}}\n }\n if(!matched){return false}\n try{sessionStorage.setItem('openteam.tab',name)}catch(e){}\n return true;\n }\n function connectTerminal(view,id){\n if(view.__wired){return}\n var root=document.documentElement;\n var token=root.getAttribute('data-token');\n if(root.getAttribute('data-terminal')!=='1'||!token){return}\n var log=view.querySelector('.termlog');\n if(!log){return}\n view.__wired=true;\n function append(cls,text){\n var line=document.createElement('div');\n line.className='tl '+cls;line.textContent=text;\n log.appendChild(line);log.scrollTop=log.scrollHeight;\n }\n var q='/console/session/'+encodeURIComponent(id);\n var tk='token='+encodeURIComponent(token);\n if('EventSource' in window){\n try{\n var es=new EventSource(q+'/stream?'+tk);\n es.addEventListener('frame',function(e){try{var f=JSON.parse(e.data);append(f.kind,f.text)}catch(_){}}); \n es.onerror=function(){/* reconecta solo */};\n }catch(_){/* ignore */}\n }\n var form=view.querySelector('form.terminput');\n if(form){\n form.addEventListener('submit',function(e){\n e.preventDefault();\n var inp=form.querySelector('input[name=text]');\n var text=inp.value;\n if(!text){return}\n inp.value='';append('input','\u203A '+text);\n fetch(q+'/input?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({text:text})})\n .then(function(r){if(!r.ok){append('error','\u2716 env\u00EDo rechazado ('+r.status+')')}})\n .catch(function(){append('error','\u2716 no se pudo enviar')});\n });\n }\n connectPty(view,id,q,tk);\n }\n function connectPty(view,id,q,tk){\n var root=document.documentElement;\n if(root.getAttribute('data-pty')!=='1'){return}\n var pane=view.querySelector('.pty');\n if(!pane){return}\n var log=pane.querySelector('.ptylog');\n var startBtn=pane.querySelector('.pty-start');\n var input=pane.querySelector('form.ptyinput');\n function plog(text){\n var d=document.createElement('span');d.textContent=text;\n log.appendChild(d);log.scrollTop=log.scrollHeight;\n }\n if(!startBtn){return}\n startBtn.addEventListener('click',function(){\n startBtn.disabled=true;plog('Abriendo shell\u2026\n');\n fetch(q+'/pty?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:'{}'})\n .then(function(r){return r.ok?r.json():Promise.reject(r.status)})\n .then(function(info){openPtyWs(info.wsUrl)})\n .catch(function(s){plog('\u2716 no se pudo abrir PTY ('+s+')\n');startBtn.disabled=false});\n });\n function openPtyWs(url){\n try{\n var ws=new WebSocket(url);\n ws.binaryType='arraybuffer';\n ws.onmessage=function(e){\n var data=e.data;\n if(data instanceof ArrayBuffer){data=new TextDecoder().decode(new Uint8Array(data))}\n plog(data);\n };\n ws.onclose=function(){plog('\n[shell cerrada]\n');startBtn.disabled=false};\n ws.onerror=function(){plog('\n\u2716 error de WebSocket\n')};\n if(input){\n input.hidden=false;\n input.addEventListener('submit',function(e){\n e.preventDefault();\n var c=input.querySelector('input[name=cmd]');\n if(!c.value){return}\n ws.send(c.value+'\r');c.value='';\n });\n }\n }catch(_){plog('\n\u2716 WebSocket no disponible\n');startBtn.disabled=false}\n }\n }\n function wireGraphDrill(){\n var root=document.documentElement;\n if(root.getAttribute('data-drilldown')!=='1'){return}\n var token=root.getAttribute('data-token');\n if(!token){return}\n var drill=document.querySelector('.graph-drill');\n if(!drill){return}\n var gview=drill.closest('.view');\n if(!gview){return}\n var log=drill.querySelector('.drilllog');\n var title=drill.querySelector('.drill-title');\n if(!log){return}\n var es=null;\n function append(cls,text){\n var line=document.createElement('div');\n line.className='tl '+cls;line.textContent=text;\n log.appendChild(line);log.scrollTop=log.scrollHeight;\n }\n function open(id){\n if(es){try{es.close()}catch(_){}}\n log.textContent='';drill.hidden=false;\n if(title){title.textContent='Conversaci\u00F3n \u00B7 '+id}\n var tk='token='+encodeURIComponent(token);\n var base='/console/session/'+encodeURIComponent(id);\n fetch(base+'/messages?'+tk).then(function(r){return r.ok?r.json():Promise.reject(r.status)})\n .then(function(d){(d&&d.frames||[]).forEach(function(f){append(f.kind,f.text)})})\n .catch(function(s){append('error','\u2716 no se pudo cargar la conversaci\u00F3n ('+s+')')});\n if('EventSource' in window){\n try{\n es=new EventSource(base+'/stream?'+tk);\n es.addEventListener('frame',function(e){try{var f=JSON.parse(e.data);append(f.kind,f.text)}catch(_){}}); \n es.onerror=function(){/* reconecta solo */};\n }catch(_){/* ignore */}\n }\n }\n gview.addEventListener('click',function(e){\n var t=e.target;\n while(t&&t!==gview&&!(t.getAttribute&&t.getAttribute('data-session'))){t=t.parentNode}\n if(t&&t.getAttribute&&t.getAttribute('data-session')){open(t.getAttribute('data-session'))}\n });\n }\n var bar=document.getElementById('tabbar');\n if(bar){\n bar.addEventListener('click',function(e){\n var t=e.target;\n while(t&&t!==bar&&!t.getAttribute('data-tab')){t=t.parentNode}\n if(t&&t.getAttribute('data-tab')){selectTab(t.getAttribute('data-tab'))}\n });\n }\n var saved='all';\n try{saved=sessionStorage.getItem('openteam.tab')||'all'}catch(e){}\n if(!selectTab(saved)){selectTab('all')}\n wireGraphDrill();\n})();\n";
9
17
  //# sourceMappingURL=assets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/console/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,igJA6DzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,iwKAiI7B,CAAC"}
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/console/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,igJA6DzB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,klFA4CvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,kmOA2K7B,CAAC"}
@@ -18,6 +18,12 @@ export type ConsoleClient = {
18
18
  sendPrompt: (sessionID: string, text: string) => Promise<void>;
19
19
  /** Responde a una solicitud de permiso. */
20
20
  respondPermission: (sessionID: string, permissionID: string, response: "once" | "always" | "reject") => Promise<void>;
21
+ /**
22
+ * Lee el histórico de la conversación de una sesión vía `session.messages`
23
+ * (GET **de solo lectura**) para el drill-down del grafo (GE-084). Devuelve
24
+ * frames reference-only; nunca persiste ni registra el contenido.
25
+ */
26
+ listMessages: (sessionID: string) => Promise<SessionFrame[]>;
21
27
  /**
22
28
  * Suscribe a los eventos de la sesión y llama `onFrame` por cada frame legible.
23
29
  * Se detiene cuando `signal` aborta o el stream termina.
@@ -1 +1 @@
1
- {"version":3,"file":"opencodeClient.d.ts","sourceRoot":"","sources":["../../src/console/opencodeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjE;;;;GAIG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,iFAAiF;IACjF,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,2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G,QAAQ,GAAG,QAAQ,KACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;;OAIG;IACH,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7D;;;OAGG;IACH,YAAY,EAAE,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,EACtC,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAgBF,oFAAoF;AACpF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CAK1B;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CA+E1E"}
@@ -31,6 +31,14 @@ export type OpencodeEventLike = {
31
31
  * campo directo como los anidados (`part.sessionID`, `info.sessionID`). Pure.
32
32
  */
33
33
  export declare function eventSessionID(event: OpencodeEventLike): string | undefined;
34
+ /**
35
+ * Traduce la respuesta de `session.messages` (histórico de la conversación) a
36
+ * frames legibles para el drill-down **de solo lectura** (GE-084). Acepta la
37
+ * forma laxa `{ info?, parts? }[]`, descarta entradas de otra sesión y traduce
38
+ * cada `part` con `partToFrame`. Nunca incluye argumentos de tool ni secretos.
39
+ * Determinista y sin I/O: el driver (`console/opencodeClient.ts`) aporta la red.
40
+ */
41
+ export declare function messagesToFrames(raw: unknown, sessionID: string): SessionFrame[];
34
42
  /**
35
43
  * Traduce un evento opencode a un frame de sesión legible, **solo** si pertenece
36
44
  * a `sessionID`. Devuelve `undefined` para eventos irrelevantes o de otra sesión.
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/console/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH,mFAAmF;AACnF,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AC;AAE9D,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAGxE;AAED,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC;AAEZ,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAYF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAU3E;AAoBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,MAAM,GAChB,YAAY,EAAE,CA+BhB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CA6B1B;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEtD"}
@@ -1,6 +1,15 @@
1
+ import type { GraphViewProjectionV1 } from "../telemetry/graphView";
1
2
  import type { ConsoleState } from "./types";
2
3
  /** Escapa texto para HTML. Evita fuga de markup y roturas de `</script>`. Pure. */
3
4
  export declare function escapeHtml(value: string): string;
5
+ /**
6
+ * Renderiza el DAG del grafo de agentes como SVG **determinista** a partir de la
7
+ * proyección reference-only (GE-083). Colorea cada nodo por estado y pinta los
8
+ * badges de intento/error/timeout/cancelación/veredicto/linaje. Escapa todo
9
+ * identificador; **nunca** incluye contenido crudo. Puro: mismas entradas ->
10
+ * misma salida.
11
+ */
12
+ export declare function renderGraphView(projection: GraphViewProjectionV1 | null): string;
4
13
  export type RenderOptions = {
5
14
  /** Fallback de polling en ms (default 2000). */
6
15
  refreshMs?: number;
@@ -10,6 +19,22 @@ export type RenderOptions = {
10
19
  terminalEnabled?: boolean;
11
20
  /** Habilita la vista "Terminal" (PTY real, Fase 5). Opt-in. */
12
21
  ptyEnabled?: boolean;
22
+ /**
23
+ * Habilita la vista "Grafo" (GE-083). Opt-in: cuando se pasa, se añade la
24
+ * pestaña/vista del DAG y sus estilos; sin ella, la salida es byte-idéntica a
25
+ * hoy. `projection` es la vista reference-only del grafo (o `null` si no hay
26
+ * run activo).
27
+ */
28
+ graphView?: {
29
+ readonly projection: GraphViewProjectionV1 | null;
30
+ };
31
+ /**
32
+ * Habilita el drill-down nodo->conversación de solo lectura (GE-084). Solo
33
+ * surte efecto junto a `graphView`: añade el panel de conversación y expone el
34
+ * token/marca `data-drilldown` que usa el cliente. Sin él, la vista del grafo
35
+ * es idéntica a GE-083.
36
+ */
37
+ drilldownEnabled?: boolean;
13
38
  };
14
39
  /**
15
40
  * Renderiza el console como un único HTML autocontenido (CSS + JS inline, sin
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/console/render.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAGV,YAAY,EAIb,MAAM,SAAS,CAAC;AASjB,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAyXD,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAoDR"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/console/render.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAGV,YAAY,EAIb,MAAM,SAAS,CAAC;AASjB,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAyhBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,GAAG,IAAI,GACvC,MAAM,CAwBR;AAmED,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,SAAS,CAAC,EAAE;QACV,QAAQ,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAAC;KACnD,CAAC;IACF;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAyDR"}
package/dist/index.js CHANGED
@@ -339,7 +339,10 @@ var BaselineModeSchema = z.enum(["auto", "pinned"]);
339
339
  var GraphModeSchema = z.enum(["off", "shadow", "active"]);
340
340
  var GraphConfigSchema = z.object({
341
341
  mode: GraphModeSchema.default("off"),
342
- killSwitch: z.boolean().default(false)
342
+ killSwitch: z.boolean().default(false),
343
+ worktrees: z.object({
344
+ enabled: z.boolean().default(false)
345
+ }).default({ enabled: false })
343
346
  });
344
347
  var ConsoleHostSchema = z.enum(["127.0.0.1", "localhost"]);
345
348
  var ConsoleConfigSchema = z.object({
@@ -353,7 +356,10 @@ var ConsoleConfigSchema = z.object({
353
356
  terminal: z.object({
354
357
  enabled: z.boolean().default(true),
355
358
  pty: z.boolean().optional()
356
- }).default({ enabled: true })
359
+ }).default({ enabled: true }),
360
+ graphView: z.object({
361
+ enabled: z.boolean().default(false)
362
+ }).optional()
357
363
  }).default({
358
364
  host: "127.0.0.1",
359
365
  port: 4599,
@@ -0,0 +1,39 @@
1
+ import type { ExecLike } from "../local/foundry-local";
2
+ /** Taxonomía cerrada de errores del adapter de worktrees. */
3
+ export type WorktreeErrorCode = "invalid-run" | "git-failed" | "corrupt-list";
4
+ /** Error tipado de una operación inválida del ciclo de vida del worktree. */
5
+ export declare class WorktreeError extends Error {
6
+ readonly code: WorktreeErrorCode;
7
+ readonly detail: string;
8
+ constructor(code: WorktreeErrorCode, detail: string);
9
+ }
10
+ /** Información observada de un worktree del namespace de openteam. */
11
+ export type WorktreeInfo = {
12
+ readonly runID: string;
13
+ /** Ruta reportada por git (separadores `/`, usable por `node:fs`). */
14
+ readonly path: string;
15
+ readonly head: string | undefined;
16
+ readonly detached: boolean;
17
+ readonly locked: boolean;
18
+ };
19
+ /** Configuración inyectada del adapter. */
20
+ export type WorktreeAdapterConfig = {
21
+ readonly exec: ExecLike;
22
+ /** Working tree principal del repositorio (destino de `git -C`). */
23
+ readonly repoRoot: string;
24
+ /** Directorio raíz del namespace de worktrees por run. */
25
+ readonly worktreesDir: string;
26
+ };
27
+ /** Contrato del ciclo de vida idempotente y crash-safe de worktrees. */
28
+ export interface WorktreeAdapter {
29
+ /** Crea (o adopta) el worktree del run; reconstruye tras crash. */
30
+ create(runID: string): Promise<WorktreeInfo>;
31
+ /** Lista los worktrees del namespace de openteam. */
32
+ list(): Promise<WorktreeInfo[]>;
33
+ /** Elimina el worktree del run (idempotente). */
34
+ remove(runID: string): Promise<void>;
35
+ /** Poda entradas administrativas huérfanas (idempotente). */
36
+ prune(): Promise<void>;
37
+ }
38
+ export declare function createWorktreeAdapter(config: WorktreeAdapterConfig): WorktreeAdapter;
39
+ //# sourceMappingURL=worktreeAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeAdapter.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAqCvD,6DAA6D;AAC7D,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc,CAAC;AAE9E,6EAA6E;AAC7E,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM;CAMpD;AAED,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,qDAAqD;IACrD,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAChC,iDAAiD;IACjD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,6DAA6D;IAC7D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA2ED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,GAC5B,eAAe,CA8IjB"}
@@ -0,0 +1,84 @@
1
+ import type { WorktreeBinding } from "../storage/graph/worktreeRegistry";
2
+ /**
3
+ * Seam de despacho al worktree del run (GE-073, D-W3).
4
+ *
5
+ * Decide, para un efecto del runtime de Graph, el `directory` con el que se crea
6
+ * la sub-sesión hija (`query.directory`) y verifica la correlación del contrato
7
+ * `PluginInput.directory`/`worktree` (GE-005). Es lógica pura y determinista:
8
+ * sin I/O, SDK, reloj ni estado global; el probe de salud del worktree y la
9
+ * consulta al registro (GE-072) los hace el llamante y entrega sus resultados
10
+ * como datos.
11
+ *
12
+ * Invariante de UX-neutralidad: con el aislamiento **desactivado**
13
+ * (`graph.worktrees.enabled` = `false`, el default) el directorio resuelto es
14
+ * exactamente el del workspace actual, de modo que el despacho es idéntico al
15
+ * de hoy. Con el aislamiento activo se exige un worktree sano vinculado al run
16
+ * y se cierra en falso (`WorktreeDispatchError`) si falta la vinculación, el
17
+ * directorio desapareció (`missing`) o está sucio (`unclean`). Ninguna ruta viva
18
+ * llama todavía a este seam; lo consumirá la integración del executor.
19
+ */
20
+ /** Salud observada del worktree de un run (resultado del probe del llamante). */
21
+ export type WorktreeHealth = "ready" | "missing" | "unclean";
22
+ /** Estado del despacho respecto al aislamiento por worktree del run. */
23
+ export type WorktreeDispatchState = {
24
+ readonly kind: "disabled";
25
+ } | {
26
+ readonly kind: "unbound";
27
+ } | {
28
+ readonly kind: "missing";
29
+ readonly worktreePath: string;
30
+ } | {
31
+ readonly kind: "unclean";
32
+ readonly worktreePath: string;
33
+ } | {
34
+ readonly kind: "ready";
35
+ readonly worktreePath: string;
36
+ };
37
+ /** Taxonomía cerrada de fallos al vincular el despacho a un worktree. */
38
+ export type WorktreeDispatchErrorCode = "unbound" | "missing" | "unclean" | "mismatch";
39
+ /** Error tipado de un despacho que no puede vincularse a un worktree sano. */
40
+ export declare class WorktreeDispatchError extends Error {
41
+ readonly code: WorktreeDispatchErrorCode;
42
+ readonly detail: string;
43
+ constructor(code: WorktreeDispatchErrorCode, detail: string);
44
+ }
45
+ /** Directorio efectivo del despacho de un efecto. */
46
+ export type DispatchDirectory = {
47
+ /**
48
+ * Directorio a pasar como `query.directory`. `undefined` = raíz del workspace
49
+ * (comportamiento actual cuando el aislamiento está desactivado).
50
+ */
51
+ readonly directory: string | undefined;
52
+ /** Worktree correlacionado; `undefined` salvo con aislamiento activo. */
53
+ readonly worktree: string | undefined;
54
+ };
55
+ /** Correlación observada del contrato `PluginInput` de una sub-sesión. */
56
+ export type ObservedWorktreeCorrelation = {
57
+ readonly directory: string;
58
+ readonly worktree: string;
59
+ };
60
+ /**
61
+ * Combina el flag de aislamiento, la vinculación del registro (GE-072) y la
62
+ * salud observada del worktree en un estado de despacho. Cierra en falso por
63
+ * defecto: una salud ausente o desconocida se trata como `missing`.
64
+ */
65
+ export declare function worktreeDispatchState(input: {
66
+ readonly enabled: boolean;
67
+ readonly binding: WorktreeBinding | undefined;
68
+ readonly health: WorktreeHealth | undefined;
69
+ }): WorktreeDispatchState;
70
+ /**
71
+ * Resuelve el directorio efectivo del despacho. Con el aislamiento desactivado
72
+ * devuelve el `workspaceDirectory` tal cual (idéntico al comportamiento actual);
73
+ * con un worktree sano devuelve su ruta como `directory` y `worktree`; en
74
+ * cualquier otro estado cierra en falso con `WorktreeDispatchError`.
75
+ */
76
+ export declare function resolveDispatchDirectory(state: WorktreeDispatchState, workspaceDirectory: string | undefined): DispatchDirectory;
77
+ /**
78
+ * Verifica la correlación del contrato `PluginInput` (GE-005): el
79
+ * `directory`/`worktree` observado de la sub-sesión debe coincidir con el
80
+ * worktree leaseado del run. Lanza `WorktreeDispatchError("mismatch")` si
81
+ * alguno difiere; comparación de rutas normalizada por plataforma.
82
+ */
83
+ export declare function assertWorktreeCorrelation(observed: ObservedWorktreeCorrelation, leasedWorktree: string): void;
84
+ //# sourceMappingURL=worktreeDispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeDispatch.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;;GAiBG;AAEH,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7D,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,yEAAyE;AACzE,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,CAAC;AAEf,8EAA8E;AAC9E,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM;CAM5D;AAED,qDAAqD;AACrD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAUF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C,GAAG,qBAAqB,CAgBxB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,qBAAqB,EAC5B,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,iBAAiB,CAanB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,2BAA2B,EACrC,cAAc,EAAE,MAAM,GACrB,IAAI,CAaN"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Reconciliador de worktrees huérfanos tras un crash (GE-074, D-W4).
3
+ *
4
+ * Sigue el mismo contrato dry-run que los comandos de operador (GE-045,
5
+ * `src/commands/graph.ts`): es **lógica pura y determinista** que recibe un
6
+ * snapshot ya observado (worktrees listados por el adapter GE-071, qué runs
7
+ * siguen activos según el registro de runs GE-025, y el estado de merge-back
8
+ * probado por el llamante) y decide, sin ejecutar, qué acción es segura para
9
+ * cada worktree. La ejecución real (`prune`/merge-back) vive en la capa de
10
+ * wiring y sólo cuando el plan la autoriza.
11
+ *
12
+ * Política de reconciliación:
13
+ * - **Run activo** → `retain`: nunca se toca un worktree cuyo run sigue vivo.
14
+ * - **Huérfano limpio y sin commits** → `prune`: eliminación segura y reportada.
15
+ * - **Huérfano limpio con commits** → `merge-back`: explícito e idempotente;
16
+ * nunca descarta en silencio la rama del run. Una segunda pasada, cuando la
17
+ * rama ya está integrada (`alreadyMerged`), planifica `prune` en vez de
18
+ * volver a fusionar.
19
+ * - **Sucio o ambiguo** → `block`: se detiene para una decisión del operador.
20
+ *
21
+ * Invariante de UX-neutralidad (D-W4): con `graph.worktrees.enabled` = `false`
22
+ * (el default) el reconciliador es un **no-op** — devuelve un informe vacío, no
23
+ * planifica ni crea ni poda ningún worktree. Ninguna ruta viva lo llama todavía.
24
+ */
25
+ /** Estado de merge-back observado de un worktree (probe de git del llamante). */
26
+ export type WorktreeMergeState = "clean-empty" | "clean-ahead" | "dirty";
27
+ /** Snapshot observado de un worktree candidato a reconciliar. */
28
+ export type WorktreeObservation = {
29
+ readonly runID: string;
30
+ readonly path: string;
31
+ /** El run sigue activo según el registro de runs (lease vigente). */
32
+ readonly runActive: boolean;
33
+ /** Estado de merge-back observado. */
34
+ readonly mergeState: WorktreeMergeState;
35
+ /**
36
+ * Sólo relevante con `mergeState: "clean-ahead"`: la rama del run ya está
37
+ * integrada en la base, de modo que la reconciliación es idempotente y puede
38
+ * podar en vez de volver a fusionar.
39
+ */
40
+ readonly alreadyMerged?: boolean;
41
+ };
42
+ /** Acción planificada para un worktree, decidida sin ejecutarla. */
43
+ export type WorktreeReconcileAction = "retain" | "prune" | "merge-back" | "block";
44
+ /** Plan de reconciliación de un worktree concreto. */
45
+ export type WorktreeReconcilePlan = {
46
+ readonly runID: string;
47
+ readonly path: string;
48
+ readonly action: WorktreeReconcileAction;
49
+ /** Razón estable y machine-readable de la decisión. */
50
+ readonly reason: string;
51
+ /** `true` cuando la acción preserva invariantes sin override del operador. */
52
+ readonly safe: boolean;
53
+ };
54
+ /** Informe agregado de la reconciliación. */
55
+ export type WorktreeReconcileReport = {
56
+ /** Estado del flag de aislamiento en el momento de reconciliar. */
57
+ readonly enabled: boolean;
58
+ /** Plan por worktree, en el orden observado. */
59
+ readonly plans: readonly WorktreeReconcilePlan[];
60
+ readonly retained: number;
61
+ readonly pruned: number;
62
+ readonly mergeBack: number;
63
+ readonly blocked: number;
64
+ };
65
+ /**
66
+ * Planifica la reconciliación de un conjunto de worktrees observados. Con el
67
+ * aislamiento desactivado devuelve un informe vacío (no-op). Puro: no ejecuta
68
+ * git ni toca I/O.
69
+ */
70
+ export declare function planWorktreeReconciliation(input: {
71
+ readonly enabled: boolean;
72
+ readonly worktrees: readonly WorktreeObservation[];
73
+ }): WorktreeReconcileReport;
74
+ //# sourceMappingURL=worktreeReconciler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeReconciler.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeReconciler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iFAAiF;AACjF,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,aAAa,GAAG,OAAO,CAAC;AAEzE,iEAAiE;AACjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,OAAO,CAAC;AAEZ,sDAAsD;AACtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,uBAAuB,GAAG;IACpC,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAkCF;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACpD,GAAG,uBAAuB,CAwB1B"}
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ declare const bindingSchema: z.ZodObject<{
3
+ runID: z.ZodString;
4
+ worktreePath: z.ZodString;
5
+ }, z.core.$strip>;
6
+ /** Vinculación persistida de un run a su worktree. */
7
+ export type WorktreeBinding = z.infer<typeof bindingSchema>;
8
+ /** Taxonomía cerrada de errores del registro de worktrees. */
9
+ export type WorktreeRegistryErrorCode = "conflict" | "invalid-run" | "invalid-path" | "corrupt";
10
+ /** Error tipado de una operación inválida sobre el registro. */
11
+ export declare class WorktreeRegistryError extends Error {
12
+ readonly code: WorktreeRegistryErrorCode;
13
+ readonly detail: string;
14
+ constructor(code: WorktreeRegistryErrorCode, detail: string);
15
+ }
16
+ /** Contrato del registro durable de vinculaciones run->worktree. */
17
+ export interface WorktreeRegistry {
18
+ /** Vincula `runID` a `worktreePath` de forma durable e idempotente. */
19
+ bind(runID: string, worktreePath: string): Promise<WorktreeBinding>;
20
+ /** Resuelve la ruta del worktree del run, o `undefined` si no está vinculado. */
21
+ resolve(runID: string): Promise<string | undefined>;
22
+ /** Elimina la vinculación del run (idempotente). */
23
+ unbind(runID: string): Promise<void>;
24
+ /** Lista las vinculaciones, ordenadas por `runID`. */
25
+ list(): Promise<WorktreeBinding[]>;
26
+ }
27
+ export declare function createWorktreeRegistry(root: string): WorktreeRegistry;
28
+ export {};
29
+ //# sourceMappingURL=worktreeRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeRegistry.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/worktreeRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,QAAA,MAAM,aAAa;;;iBAGjB,CAAC;AAIH,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5D,8DAA8D;AAC9D,MAAM,MAAM,yBAAyB,GACjC,UAAU,GACV,aAAa,GACb,cAAc,GACd,SAAS,CAAC;AAEd,gEAAgE;AAChE,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM;CAM5D;AAED,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACpE,iFAAiF;IACjF,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpD,oDAAoD;IACpD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,sDAAsD;IACtD,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;CACpC;AAaD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CA8ErE"}
@@ -0,0 +1,75 @@
1
+ import type { ErrorClass, GraphSpecV1 } from "../graph/schema";
2
+ import type { GraphState } from "../graph/types";
3
+ import type { GraphTelemetryRecord } from "./graphProjection";
4
+ /**
5
+ * Proyección **pura y reference-only** de la vista del grafo (GE-081).
6
+ *
7
+ * `buildGraphView` pliega el spec estático (topología), el estado reducido del
8
+ * journal (estado/intentos/artefacto por nodo), la telemetría reference-only
9
+ * (`errorClass`, artefacto) y las métricas de runtime-health en un
10
+ * `GraphViewProjectionV1`. Cada campo mapea a la fuente allow-listed que congela
11
+ * `docs/adr/graph-observability-web.md`; los veredictos de revisor se **derivan**
12
+ * del estado terminal del nodo revisor más su enlace `reviews`, nunca se
13
+ * almacenan como contenido. Puro y determinista: sin reloj, I/O ni random. Un
14
+ * guard final rechaza cualquier campo de contenido crudo.
15
+ */
16
+ /** Estado de nodo en la vista: añade `ready`/`active` sobre el estado reducido. */
17
+ export type GraphViewNodeState = "pending" | "ready" | "active" | "succeeded" | "failed" | "cancelled";
18
+ /** Veredicto derivado de una revisión. */
19
+ export type ReviewVerdict = "approved" | "rejected" | "inconclusive";
20
+ /** Referencia reference-only a un artefacto (sin contenido). */
21
+ export type GraphArtifactRef = {
22
+ readonly uri: string;
23
+ readonly sha256: string;
24
+ readonly bytes: number;
25
+ };
26
+ /** Vista de un nodo del grafo: solo campos allow-listed y reference-only. */
27
+ export type GraphNodeView = {
28
+ readonly nodeID: string;
29
+ readonly role: string;
30
+ readonly state: GraphViewNodeState;
31
+ readonly attempts: number;
32
+ readonly lastErrorClass?: ErrorClass;
33
+ readonly review?: {
34
+ readonly verdict: ReviewVerdict;
35
+ readonly reassigned: boolean;
36
+ };
37
+ readonly revisionOf?: string;
38
+ readonly artifact?: GraphArtifactRef;
39
+ readonly sessionRef?: string;
40
+ };
41
+ /** Arista del DAG (dependencia `from` -> `to`). */
42
+ export type GraphViewEdge = {
43
+ readonly from: string;
44
+ readonly to: string;
45
+ };
46
+ /** Métricas de runtime-health de la vista (GE-052), acotadas y sin contenido. */
47
+ export type GraphViewHealth = {
48
+ readonly recoveryRequired: boolean;
49
+ readonly unknownEffects: number;
50
+ readonly conflicts: number;
51
+ readonly killSwitch: boolean;
52
+ };
53
+ /** Proyección versionada y reference-only de la vista completa del grafo. */
54
+ export type GraphViewProjectionV1 = {
55
+ readonly version: 1;
56
+ readonly runID: string;
57
+ readonly nodes: readonly GraphNodeView[];
58
+ readonly edges: readonly GraphViewEdge[];
59
+ readonly health: GraphViewHealth;
60
+ };
61
+ /** Entradas reference-only del proyector: topología, estado, telemetría, salud. */
62
+ export type GraphViewInput = {
63
+ readonly spec: GraphSpecV1;
64
+ readonly state: GraphState;
65
+ readonly telemetry: readonly GraphTelemetryRecord[];
66
+ readonly health: GraphViewHealth;
67
+ readonly sessions?: Readonly<Record<string, string>>;
68
+ };
69
+ /**
70
+ * Construye la proyección reference-only de la vista del grafo a partir de sus
71
+ * fuentes allow-listed. Determinista: mismas entradas -> misma salida. El guard
72
+ * final asegura que ningún campo transporta contenido crudo.
73
+ */
74
+ export declare function buildGraphView(input: GraphViewInput): GraphViewProjectionV1;
75
+ //# sourceMappingURL=graphView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphView.d.ts","sourceRoot":"","sources":["../../src/telemetry/graphView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAa,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBA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