
    Zi                    x    d dl mZ d dlZd dlZd dlZd dlmZ d	dZd
dZddZ	ddZ
edk(  r e e
             y)    )annotationsN)Pathc           
        | j                  dg       }dg}|D ]S  }t        |j                  dd            }t        |j                  dd            }|j                  d| d| d	| d
       U |D ]O  }t        |j                  dd            }|j                  dg       xs g D ]  }|j                  d| d|         Q dj                  |      S )Nstepszgraph TDstep_idunknownaction z  z["z | z"]dependenciesz --> 
)getstrappendjoin)planr   linesstepr   r	   deps          %scripts/render_plan_dashboard_view.pybuild_mermaidr   
   s    HHWb!ELE =dhhy)45TXXh+,r'"WIS;<=  3dhhy)4588NB/52 	3CLL2cU%y12	33 99U    c                    t        j                  | dd      }dt        j                  |       dt        j                  |       dt        j                  |       dS )N   F)indentensure_asciiz<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>a  </title>
  <style>
    :root {
      --bg: #0c1117;
      --panel: #161d26;
      --text: #e6edf3;
      --muted: #9fb0c0;
      --accent: #24c8db;
      --border: #2a3644;
    }
    html, body {
      margin: 0; padding: 0; background: var(--bg); color: var(--text);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    }
    .wrap {
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 12px;
      padding: 12px;
      min-height: 100vh;
      box-sizing: border-box;
    }
    .panel {
      border: 1px solid var(--border);
      border-radius: 10px;
      background: linear-gradient(180deg, #18212b 0%, var(--panel) 100%);
      overflow: auto;
    }
    .hdr {
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      color: var(--muted);
      font-size: 12px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .body {
      padding: 12px;
    }
    pre {
      margin: 0;
      white-space: pre-wrap;
      word-break: break-word;
      color: var(--text);
      font-size: 12px;
      line-height: 1.35;
    }
    .hint {
      margin-top: 8px;
      color: var(--accent);
      font-size: 11px;
    }
    @media (max-width: 960px) {
      .wrap { grid-template-columns: 1fr; }
    }
  </style>
</head>
<body>
  <div class="wrap">
    <section class="panel">
      <div class="hdr">DAG</div>
      <div class="body">
        <pre class="mermaid">z</pre>
        <div class="hint">Rendered with Mermaid (like dashboard DAG view).</div>
      </div>
    </section>
    <section class="panel">
      <div class="hdr">Plan JSON</div>
      <div class="body">
        <pre>z</pre>
      </div>
    </section>
  </div>
  <script type="module">
    import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
    mermaid.initialize({ startOnLoad: true, theme: 'dark' });
  </script>
</body>
</html>
)jsondumpshtmlescape)r   mermaid_graphtitleprettys       r   render_htmlr#      si    ZZQU;F

 ++e
	 >| #kk-89 : kk&!" 
#UT Tr   c                     t        j                  d      } | j                  dd       | j                  dd       | j                  dd	
       | j                         S )Nz,Render dashboard-style DAG + JSON HTML view.)description	plan_jsonzPath to plan JSON file)helpz--outz+Output HTML path (default: alongside input)z--titlezOrchestrator Plan View)default)argparseArgumentParseradd_argument
parse_args)parsers    r   r,   r,   q   s^    $$1_`F
*BC
&ST
	+CDr   c                 n   t               } t        | j                        }t        j                  |j                  d            }t        |      }| j                  rt        | j                        }n|j                  d      }|j                  t        ||| j                        d       t        |       y)Nzutf-8)encodingz.dashboard.htmlr   )r,   r   r&   r   loads	read_textr   outwith_suffix
write_textr#   r!   print)args	plan_pathr   r    out_paths        r   mainr9   y   s    <DT^^$I::i))7);<D!$'Mxx>(():;D-DwW	(Or   __main__)r   dictreturnr   )r   r;   r    r   r!   r   r<   r   )r<   zargparse.Namespace)r<   int)
__future__r   r)   r   r   pathlibr   r   r#   r,   r9   __name__
SystemExit r   r   <module>rC      sF    "    Vr  z
TV
 r   