+
    5mjf+                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ]! ]4      P                  4       t]P                  P!                  ^ ]! ]P$                  ^,          R,          4      4       ^ RIt^ RItR R ltR R ltR	 R
 ltRR/R R lltR R lt]R8X  d    ]! ]! ]P8                  R,          4      4      hR# )zHRun a pi turn on an agent-seat while preserving its local session state.)annotationsN)Pathsystrayc                    V ^8  d   QhRRRR/# )   argv	list[str]returnbool )formats   "e/home/user/overdeck-private-tests/workstation-ai-broad2/modules/workstation/bin/pi_remote_dispatch.py__annotate__r      s      I $     c                0   V '       d;   \         ;QJ d    R  V  4       F  '       g   K   RM	  RM! R  V  4       4      '       d   R# RV 9  ;'       dG    RV 9  ;'       d:    \         ;QJ d    R V  4       F  '       g   K   RM	  RM! R V  4       4      '       * # )c              3  *   "   T F	  qR9   x  K  	  R# 5i)--list-modelsN>   -h--help	--versionr   r   .0args   & r   	<genexpr>info_only.<locals>.<genexpr>   s     ]X\QTLLX\s   TFz-pz--session-idc              3  B   "   T F  qP                  R 4      x  K  	  R# 5i)z--session-id=N)
startswithr   s   & r   r   r      s      G37C''4s   )any)r   s   &r   	info_onlyr      s    33]X\]333]X\]]]t  d :  33 G37G333 G37G D @ r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   optionstrr	   
str | Noner   )r   s   "r   r   r      s!      y # * r   c                    \        V 4       Fl  w  r#W18X  d)   V^,           \        V 4      8  d   W^,           ,          u # VP                  VR,           4      '       g   KS  VP                  R^4      ^,          u # 	  R# )   =N)	enumeratelenr   split)r   r    indexr   s   &&  r   option_valuer*      s`    o
=UQYT2	?">>&3,''99S!$Q''	 &
 r   c               (    V ^8  d   QhRRRRRRRR/# )r   r   r   r    r!   valuer	   r   )r   s   "r   r   r   &   s(     	 	 	C 	 		 	r   c                    \        V 4      p\        V4       F\  w  rEWQ8X  d'   V^,           \        V4      8  d   W#V^,           &   Vu # VP                  VR,           4      '       g   KQ  V RV 2W4&   Vu # 	  V# )r$   r%   )listr&   r'   r   )r   r    r,   resultr)   r   s   &&&   r   replace_optionr0   &   sr    $ZF'
=UQYV4 %519M>>&3,''%haw/FMM ( Mr   reasonc               4    V ^8  d   QhRRRRRRRRR	RR
RRR/# )r   moder!   	exit_codeintstartedfloathostr"   	workspacer1   r	   Noner   )r   s   "r   r   r   2   sI     B B3 B3 B Bj B'B1;BGKBr   c                <    \         P                  ! R R WW#WER7       R# )pi)r8   r9   r1   N)containmentappend_recordr3   r4   r6   r8   r9   r1   s   $$$$$$r   r>   r>   2   s    dD$7(1Br   c                    V ^8  d   QhRRRR/# )r   r   r   r	   r5   r   )r   s   "r   r   r   8   s     \. \.y \.S \.r   c                  a"a#a$a% \        V 4      '       d   \        P                  ! R R .V O4       \        V R4      pV'       g,   \	        R\
        P                  R7       \        P                  # \        V4      P                  4       P                  4       pVP                  RRR7       \        P                  ! 4       pRpRo#Ro$Ro"Ro%R V"V#V$V%3R	 llp\        P                  ! \        P                   V4      p\        P                  ! \        P"                  V4      p \        P$                  ! 4       p\        P&                  ! V\        P(                  3R
7      p	\        P*                  ! V	4      w  p
o"pV
P-                  R4      ;'       g
    S"R,          p\        P.                  ! \        P0                  ! 4       4      p\        P2                  ! V4      p\        P4                  ! W4      p\        P6                  ! V4      p\8        P:                  ! . \        P<                  ! S"4      OR\>        P@                  ! W.4       R2NRR\        PB                  R7      pVPD                  '       dC   \        PF                  ! V RVP                  PI                  4        2\        P                  4      h\        PJ                  ! S"W.RR7      pV'       d+   \        PF                  ! V RV 2\        P                  4      h\        PL                  ! V4      p\8        P:                  ! \        PN                  ! S"W4      VR\        PP                  R7      p\8        P:                  ! \        PR                  ! S"WVRJR7      RR\        PP                  R7      pVPD                  '       g   VPD                  '       dc   VPD                  '       d   VP                  MVP                  PI                  4       p\        PF                  ! V RV 2\        P                  4      hVPT                  PI                  4       PW                  4       R&,          PY                  R4      pVeE   \        PZ                  ! S"WV RV 2V4      pV'       d   \	        RV 2\
        P                  R7       V RV 2p\]        V RV4      pV R\        P^                   R\`        Pb                  ! 4       Pd                   R2o%V R2pV R2pRPg                  \>        Ph                  ! \k        \        S%4      Pl                  4      4      \>        Ph                  ! V RV 24      \>        Ph                  ! S%4      \>        P@                  ! V4      \>        Ph                  ! V4      \>        Ph                  ! V4      R7      pR\>        Ph                  ! V4       2p\8        Pn                  ! . \        P<                  ! S"4      OVN4      o#S#Pq                  4       p\8        P:                  ! . \        P<                  ! S"4      OR\>        Ph                  ! S%4       2NR\        PB                  R 7       \        PJ                  ! S"W.RR7      p\        Pr                  ! VS"W. VRJVR!7      Pu                  4       p V'       g	   V '       d   T;'       g    T p\	        RV 2\
        P                  R7       \w        R"\        P                  VVV RV 2VR#7       \        P                  Ve   VPy                  4        \        P                  ! \        P                   V4       \        P                  ! \        P"                  V4       # \w        R"TY;V RV 2S$'       d   R$MRR#7       TVe   VPy                  4        \        P                  ! \        P                   V4       \        P                  ! \        P"                  V4       #   \        PF                   d   p!Te   TPy                  4        \	        RT! 2\
        P                  R7       \w        R$T!Pz                  TRR\k        T!4      R#7       T!Pz                  u Rp!?!Te   TPy                  4        \        P                  ! \        P                   T4       \        P                  ! \        P"                  T4       # Rp!?!i\|        \8        P~                  \        3 d   p!Te   TPy                  4        R%T! 2p\	        RT 2\
        P                  R7       \w        R$\        P                  TRRTR#7       \        P                  u Rp!?!Te   TPy                  4        \        P                  ! \        P                   T4       \        P                  ! \        P"                  T4       # Rp!?!ii ; i  Te   TPy                  4        \        P                  ! \        P                   T4       \        P                  ! \        P"                  T4       i ; i)'r<   z--session-dirz2pi-remote: agent invocation requires --session-dir)fileT)parentsexist_okNFc               $    V ^8  d   QhRRRRRR/# )r   signumr5   _frameobjectr	   r:   r   )r   s   "r   r   main.<locals>.__annotate__O   s!     & &S && &T &r   c                L  < R oSe   Se    \         P                  ! . \        P                  ! S4      OR\        P
                  ! S4       R2NR R \        P                  R7      P                  P                  4       pVP                  4       '       dF   \         P                  ! . \        P                  ! S4      ORV  RV R2N\        P                  R7       Se(   SP                  4       f   SP                  V 4       R# R# R#   \        \         P                  3 d     LJi ; i)TNzcat z 2>/dev/nullcapture_outputtexttimeoutzkill - )rN   )
subprocessrunremote_dispatchssh_argvshlexquotePROBE_TIMEOUT_SECstdoutstripisdigitOSErrorSubprocessErrorpollsend_signal)rF   rG   
remote_pidaccesschildinterruptedpidfiles   && r   stopmain.<locals>.stopO   s   '"5'^^bo..v6b$u{{7?S>TT`8ab#'dO<]<] &  %%''NNg/226:gfVHAj\Ye<fg / A A !5f% "6 Z778 s   BD AD D#"D#)rolesnamer8   z	mkdir -p z && printf '%s\n' "$HOME"rK   z: could not prepare mirror: )pullz: )inputrL   rN   )exclude_gitz: mirror push failed: /zpi-remote: z/pi-remote/z.pidz/.claude/binz/.local/binzmkdir -p {piddir} && cd {cwd} && echo $$ > {pidfile} && export PATH={guard_bin}:{agent_bin}:$PATH && export AGENT_BUILD_SCOPE_ACTIVE=1 && ( {guard_bin}/install-git-guard-real >/dev/null 2>&1 || true ) && exec pi-agent {args})piddircwdrb   args	guard_bin	agent_binzbash -c zrm -f )rL   rN   )ri   mirror_filesremoter?   abortedzremote dispatch failed: )Ar   osexecvpr*   printsysstderrrR   EXIT_MIRRORr   
expanduserresolvemkdirtime	monotonicsignalSIGTERMSIGINTload_registrycandidate_hosts	SEAT_ROLEselect_hostget	repo_rootrl   remote_rel_dirextra_rel_dirgit_mirror_filesrP   rQ   rS   rT   joinrV   
returncodeOffloadUnavailablerX   sync_extra_dir
git_mirrorpush_tracked_argvSYNC_TIMEOUT_SEC	push_argvrW   
splitlinesrstripprepare_remote_gitr0   REMOTE_ROOTuuiduuid4hexr   rU   r!   parentPopenwaitSession	pull_backr>   releasecoderZ   r[   
IndexError)&r   session_valuesession_dirr6   claimrc   old_termold_intregistryhostsr8   	host_namerootrel_dir	state_relrp   madepushr   trackedpusheddetail	node_homewarningremote_sessionremote_argsrn   ro   command
remote_cmdr   
pull_state	pull_treeexcr_   r`   ra   rb   s&   &                                 @@@@r   mainr   8   s   
		$& 7MBT***}%002::<KdT2nnGE,0EKFG& && }}V^^T2HmmFMM40Gp."002//AZAZ@\]-99%@feHHV$66v	((4!006#11$D	&77=~~{o&&v.{)EJJG[<\;]]y0z{dO4U4U
 ???!44	{B^_c_j_j_p_p_r^s5t  wF  wR  wR  S  S--fkSXY!44	{"TF5K_MhMhii$//5
..!B!B64!Yam04o>^>^` 9 9&$]gos]s t  FJ  QU(7(H(HJ!2!2!2(/(:(:(:gnnTTVF!44	{BXY_X`5acrc~c~KK%%'224R8??D	!%88	yk7),DjG G9-CJJ?%;a	{3$T?NKKq!<!< =[IYIYHZZ^_& !k.	 k-	# &;;s4=#7#789yk7)45KK(uzz+/Fkk),kk),  
 	   G 456
  !P?#;#;F#C!PZ!PQzz|Po&&v.P&W9M8N0OP)J)J	
 %33FKY]^
#++vtbjPT>T%
 )+ 	 ,,9FKx(szz:x?3N3NX_(yk7)4LU[]"..& MMOfnnh/fmmW-+ 	8tW#,+Qwi 8k_c	e  MMOfnnh/fmmW-% -- MMOC5!

39'PT`dmpqtmuvxx MMOfnnh/fmmW- Z//< +MMO+C51F8$3::690K0KU\4	@***MMOfnnh/fmmW-+ MMOfnnh/fmmW-s~   J_ 2_ K_  _ )A_  _ f&0A!b5f&f) f) 5!f&f&A%f!=f&>f) f) !f&&f) )A h	__main__:r$   NN)__doc__
__future__r   rt   rT   r   rP   rw   r}   r   pathlibr   __file__r{   HEREpathinsertr!   rC   rR   r=   r   r*   r0   r>   r   __name__
SystemExitr   r   r   r   <module>r      s    N " 	    
   H~ 3t||A23 4  	B>BB\.~ z
T#((2,'
(( r   