+
    lHàj€Q  ã                  óÊ  € R t ^ RIHt ^ RIHt ^RIHtHtHtH	t	 ^RI
HtHtHtHtHt ^RIHt  ! R R]4      t ! R R	]	4      t ! R
 R]4      t ! R R]4      t]! R]]RR7        ! R R]4      t ! R R]	4      t ! R R]4      t ! R R]4      t ! R R]	4      t ! R R]4      t ! R R]4      t ! R R ]4      t]! R!]]R"R7        ! R# R$]	4      t ! R% R&]4      t ! R' R(]4      t  ! R) R*]4      t!]! R+]]!R,R7        ! R- R.]4      t" ! R/ R0]	4      t# ! R1 R2]4      t$]! R3]"]$R4R7        ! R5 R6]4      t% ! R7 R8]4      t&]! R9]%]&R:R7       ]! R;]]&R<R7        ! R= R>]4      t' ! R? R@]4      t(]! RA]'](RBR7        ! RC RD]4      t) ! RE RF]4      t*]! RG])]*RHR7        ! RI RJ]4      t+ ! RK RL]4      t,]! RM]+],RNR7        ! RO RP]4      t- ! RQ RR]4      t.]! RS]-].RTR7        ! RU RV]4      t/]! RW]/].RXR7        ! RY RZ]4      t0 ! R[ R\]4      t1]! R]]0]1R^R7        ! R_ R`]4      t2 ! Ra Rb]4      t3]! Rc]]3RdR7        ! Re Rf]4      t4 ! Rg Rh]4      t5]! Ri]4]5RjR7        ! Rk Rl]4      t6 ! Rm Rn]	4      t7 ! Ro Rp]4      t8]! Rq]6]8RrR7        ! Rs Rt]4      t9 ! Ru Rv]4      t:]! Rw]9]:RxR7        ! Ry Rz]4      t;]! R{]];R|R7        ! R} R~]4      t< ! R R€]4      t=]! R�]<]=R‚R7        ! Rƒ R„]	4      t> ! R… R†]4      t? ! R‡ Rˆ]4      t@]! R‰]?]@RŠR7        ! R‹ RŒ]4      tA ! R� RŽ]4      tB]! R�]A]BR�R7        ! R‘ R’]4      tC ! R“ R”]4      tD]! R•]]DR–R7        ! R— R˜]4      tE ! R™ Rš]4      tF ! R› Rœ]4      tG]! R�]E]GRžR7        ! RŸ R ]4      tH ! R¡ R¢]4      tI ! R£ R¤]4      tJ]! R¥]H]JR¦R7        ! R§ R¨]4      tK ! R© Rª]4      tL ! R« R¬]4      tM]! R­]K]MR®R7       R¯# )°uâ  Contracts: billing / subscription / usage envelopes, delegation controls, handoff, message
reactions, pet generation and ``project.facts`` (handlers in ``tui_gateway/methods_session.py``).

Billing routes are FAIL-OPEN: a logged-out / unreachable portal answers an ``ok`` result whose
``error`` carries the typed code (``_serialize_billing_error``) â€” never a JSON-RPC error â€” so the
client always resolves and branches on the envelope. ``BillingEnvelope`` is that shared shape.
)Úannotations)ÚField)Ú	JsonValueÚParamsÚResultÚWireEnum)ÚMessageReactionÚ	OpenModelÚ	PlanUsageÚProfileParamsÚSessionParams)Úmethodc                  ó–   € ] tR t^t$ RtR]R&   RtR]R&   RtR]R&   RtR]R&   Rt	R	]R
&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR# )ÚBillingEnvelopea	  ``tui_gateway/billing_view.py::_serialize_billing_error`` on failure (``ok`` false + typed
``error``); success routes add their own fields. ``payload`` is the raw portal body (error
extras such as ``remainingUsd``, or the NAS success body on pending-change routes).ÚboolÚokNú
str | NoneÚerrorÚmessageÚ
portal_urlzint | float | NoneÚretry_afterzdict[str, JsonValue] | NoneÚpayloadÚactorÚcodeÚrecovery© )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r   r   r   r   r   r   r   r   Ú__static_attributes__r   ó    ÚR/home/ubuntu/.hermes/hermes-agent/tui_gateway/contracts/billing_delegation_pets.pyr   r      sa   ‡ ñ[ð 	ƒHØ€Eˆ:ÓØ€GˆZÓØ!€J�
Ó!Ø&*€KÐ#Ó*Ø+/€GÐ(Ó/Ø€Eˆ:ÓØ€Dˆ*ÓØ€Hˆj×r#   r   c                  ó   € ] tR t^'tRtRtRtR# )ÚUsageBarKindÚplanÚtopupr   N)r   r   r   r   r'   r(   r"   r   r#   r$   r&   r&   '   ó   † Ø€DØ„Er#   r&   c                  ó\   € ] tR t^,t$ RtR]R&   R]R&   R]R&   R]R&   RtR	]R
&   R]R&   RtR# )ÚUsageBarz\``_serialize_usage_bar``: one bar, magnitudes pre-formatted; ``pct_used`` only for ``plan``.r&   ÚkindÚstrÚremaining_displayÚtotal_displayÚspent_displayNú
int | NoneÚpct_usedÚfloatÚfill_fractionr   )r   r   r   r   r    r!   r2   r"   r   r#   r$   r+   r+   ,   s-   ‡ Ùfà
ÓØÓØÓØÓØ€HˆjÓØ×r#   r+   c                  óÀ   € ] tR t^7t$ RtRtR]R&   R]R&   RtR]R&   RtR]R	&   Rt	R]R
&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR# )Ú
UsageModelu¦   ``_serialize_usage_model`` â€” also embedded as ``usage`` in the billing / subscription states,
where the fail-open form is a bare ``{available: false}`` (no ``ok``).Núbool | Noner   r   Ú	availabler   ÚstatusÚ	plan_nameÚ	renews_atÚrenews_displayÚsubscription_remaining_displayÚtopup_remaining_displayÚtotal_spendable_displayÚ	has_topupzUsageBar | NoneÚplan_barÚ	topup_barr   )r   r   r   r   r    r   r!   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   r"   r   r#   r$   r6   r6   7   s€   ‡ ñNð €BˆÓØƒOØ€FˆJÓØ €IˆzÓ Ø €IˆzÓ Ø!%€N�JÓ%Ø15Ð" JÓ5Ø*.Ð˜ZÓ.Ø*.Ð˜ZÓ.Ø!€Iˆ{Ó!Ø $€HˆoÓ$Ø!%€Iˆ×%r#   r6   z
usage.barsz_Two-bar dollar usage view shared by /usage, /topup and /subscription; fail-open to unavailable.)ÚparamsÚresultÚdocc                  óR   € ] tR t^Pt$ R]R&   R]R&   R]R&   RtR]R&   RtR]R&   R	tR# )
ÚBillingCardInfor-   ÚbrandÚlast4ÚmaskedNr   ÚdisplayÚresolved_viar   )r   r   r   r   r!   rK   rL   r"   r   r#   r$   rG   rG   P   s%   ‡ ØƒJØƒJØƒKØ€GˆZÓØ#€L�*×#r#   rG   c                  ó"   € ] tR t^XtRtRtRtRtR# )ÚPaymentMethodKindÚcardÚlinkÚunknownr   N)r   r   r   r   rO   rP   rQ   r"   r   r#   r$   rN   rN   X   s   † Ø€DØ€DØ„Gr#   rN   c                  óz   € ] tR t^^t$ RtR]R&   RtR]R&   RtR]R&   RtR]R&   Rt	R]R	&   Rt
R]R
&   RtR]R&   RtR# )ÚBillingPaymentMethodz§``_serialize_payment_method``: each kind emits only its own fields (a ``card`` never carries
``email``; ``unknown`` carries what the server called it in ``raw_kind``).rN   r,   Nr   rH   rI   ÚwalletÚemailÚraw_kindrL   r   )r   r   r   r   r    r!   rH   rI   rT   rU   rV   rL   r"   r   r#   r$   rS   rS   ^   sL   ‡ ñRð ÓØ€Eˆ:ÓØ€Eˆ:ÓØ€FˆJÓØ€Eˆ:ÓØ€HˆjÓØ#€L�*×#r#   rS   c                  óR   € ] tR t^kt$ RtR]R&   R]R&   RtR]R&   R]R&   R]R	&   R
tR# )ÚBillingMonthlyCapNr   Ú	limit_usdr-   Úlimit_displayÚspent_this_month_usdr0   r   Úis_default_ceilingr   )r   r   r   r   rY   r!   r[   r"   r   r#   r$   rX   rX   k   s)   ‡ Ø €IˆzÓ ØÓØ'+Ð˜*Ó+ØÓØ×r#   rX   c                  ó"   € ] tR t^stRtRtRtRtR# )ÚAutoReloadCardKindÚ	canonicalÚdistinctÚnoner   N)r   r   r   r   r_   r`   ra   r"   r   r#   r$   r^   r^   s   s   † Ø€IØ€HØ„Dr#   r^   c                  óP   € ] tR t^yt$ RtR]R&   RtR]R&   RtR]R&   RtR]R&   R	t	R# )
ÚBillingAutoReloadCardz6Only ``distinct`` carries the payment-method identity.r^   r,   Nr   Úpayment_method_idrH   rI   r   )
r   r   r   r   r    r!   rd   rH   rI   r"   r   r#   r$   rc   rc   y   s*   ‡ Ù@à
ÓØ$(Ð�zÓ(Ø€Eˆ:ÓØ€Eˆ:×r#   rc   c                  ó`   € ] tR t^‚t$ R]R&   RtR]R&   R]R&   RtR]R&   R]R	&   RtR
]R&   RtR# )ÚBillingAutoReloadr   ÚenabledNr   Úthreshold_usdr-   Úthreshold_displayÚreload_to_usdÚreload_to_displayzBillingAutoReloadCard | NonerO   r   )	r   r   r   r   r!   rh   rj   rO   r"   r   r#   r$   rf   rf   ‚   s2   ‡ ØƒMØ $€M�:Ó$ØÓØ $€M�:Ó$ØÓØ)-€DÐ
&×-r#   rf   c                  ó€  € ] tR t^‹t$ RtR]R&   R]R&   RtR]R&   RtR]R	&   RtR]R
&   Rt	R]R&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R &   RtR]R!&   RtR]R"&   RtR]R#&   RtR$]R%&   RtR&]R'&   R(tR# ))ÚBillingStateResultz£``_serialize_billing_state`` (money as strings); the ``except`` fallback emits only
``ok / logged_in / free_tier_account / error``, so everything else is optional.r   r   Ú	logged_inFÚfree_tier_accountNr   Úfree_tier_modelÚorg_nameÚorg_slugÚroler7   Úis_adminÚcan_change_planÚ
can_chargeÚbalance_usdÚbalance_displayÚcli_billing_enabledúlist[str] | NoneÚcharge_presetsÚcharge_presets_displayÚmin_usdÚmax_usdzBillingCardInfo | NonerO   zBillingPaymentMethod | NoneÚpayment_methodzBillingMonthlyCap | NoneÚmonthly_capzBillingAutoReload | NoneÚauto_reloadÚkeep_going_on_creditsr   r   úUsageModel | NoneÚusageúPlanUsage | NoneÚ
plan_usager   )r   r   r   r   r    r!   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   r{   r|   r}   r~   rO   r   r€   r�   r‚   r   r   r„   r†   r"   r   r#   r$   rm   rm   ‹   s  ‡ ñWð 	ƒHØƒOØ#Ð�tÓ#Ø"&€O�ZÓ&Ø€HˆjÓØ€HˆjÓØ€Dˆ*ÓØ €HˆkÓ Ø#'€O�[Ó'Ø"€J�Ó"Ø"€K�Ó"Ø"&€O�ZÓ&Ø'+Ð˜Ó+Ø'+€NÐ$Ó+Ø/3ÐÐ,Ó3Ø€GˆZÓØ€GˆZÓØ#'€DÐ
 Ó'Ø26€NÐ/Ó6Ø,0€KÐ)Ó0Ø,0€KÐ)Ó0ð *.Ð˜;Ó-Ø!€J�
Ó!Ø€Eˆ:ÓØ#€EÐÓ#à#'€JÐ ×'r#   rm   zbilling.statez`Read-only billing view (no scope); the Nous free tier is answered locally without a portal call.c                  ó   € ] tR t^µtRtRtRtR# )ÚSubscriptionContextÚpersonalÚteamr   N)r   r   r   r   r‰   rŠ   r"   r   r#   r$   rˆ   rˆ   µ   s   † Ø€HØ„Dr#   rˆ   c                  ó®   € ] tR t^ºt$ RtR]R&   RtR]R&   RtR]R&   RtR]R&   Rt	R]R&   Rt
R]R&   RtR]R	&   RtR]R
&   R]R&   RtR]R&   RtR]R&   RtR# )ÚCurrentSubscriptionNr   Útier_idÚ	tier_nameÚmonthly_creditsÚcredits_remainingÚcycle_ends_atÚpending_downgrade_tier_nameÚpending_downgrade_atÚpending_downgrade_displayr   Úcancel_at_period_endÚcancellation_effective_atÚcancellation_effective_displayr   )r   r   r   r   r�   r!   rŽ   r�   r�   r‘   r’   r“   r”   r–   r—   r"   r   r#   r$   rŒ   rŒ   º   sr   ‡ Ø€GˆZÓØ €IˆzÓ Ø"&€O�ZÓ&Ø$(Ð�zÓ(Ø $€M�:Ó$Ø.2Ð Ó2Ø'+Ð˜*Ó+Ø,0Ð˜zÓ0ØÓØ,0Ð˜zÓ0Ø15Ð" J×5r#   rŒ   c                  ób   € ] tR t^Èt$ R]R&   R]R&   R]R&   R]R&   RtR]R	&   R
]R&   R
]R&   RtR# )ÚSubscriptionTierOptionr-   r�   ÚnameÚintÚ
tier_orderÚdollars_per_month_displayNr   r�   r   Ú
is_currentÚ
is_enabledr   )r   r   r   r   r!   r�   r"   r   r#   r$   r™   r™   È   s-   ‡ ØƒLØ
ƒIØƒOØ"Ó"Ø"&€O�ZÓ&ØÓØ×r#   r™   c                  óØ   € ] tR t^Òt$ RtR]R&   R]R&   RtR]R&   RtR]R&   RtR	]R
&   Rt	R	]R&   Rt
R	]R&   RtR]R&   RtR]R&   RtR]R&   RtR	]R&   RtR	]R&   RtR]R&   RtR]R&   RtR# )ÚSubscriptionStateResultz]``_serialize_subscription_state``; the view's fallback emits only ``ok / logged_in / error``.r   r   rn   Nr7   rt   ru   r   rq   Úorg_idrs   zSubscriptionContext | NoneÚcontextzCurrentSubscription | NoneÚcurrentz#list[SubscriptionTierOption] | NoneÚtiersr   r   rƒ   r„   r…   r†   r   )r   r   r   r   r    r!   rt   ru   rq   r¢   rs   r£   r¤   r¥   r   r   r„   r†   r"   r   r#   r$   r¡   r¡   Ò   sŒ   ‡ ÙgàƒHØƒOØ €HˆkÓ Ø#'€O�[Ó'Ø€HˆjÓØ€FˆJÓØ€Dˆ*ÓØ*.€GÐ'Ó.Ø*.€GÐ'Ó.Ø15€EÐ.Ó5Ø!€J�
Ó!Ø€Eˆ:ÓØ#€EÐÓ#Ø#'€JÐ ×'r#   r¡   zsubscription.statezOCurrent plan, tier catalog and usage for the picker; fail-open when logged out.c                  ó&   € ] tR t^ét$ RtR]R&   RtR# )ÚSubscriptionPreviewParamsNr   Úsubscription_type_idr   )r   r   r   r   r¨   r!   r"   r   r#   r$   r§   r§   é   s   ‡ Ø'+Ð˜*×+r#   r§   c                  ó&   € ] tR t^ítRtRtRtRtRtR# )ÚSubscriptionChangeEffectÚ
charge_nowÚ	scheduledÚno_opÚblockedr   N)	r   r   r   r   r«   r¬   r­   r®   r"   r   r#   r$   rª   rª   í   s   † Ø€JØ€IØ€EØ„Gr#   rª   c                  óš   € ] tR t^ôt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R]R&   Rt
R]R	&   RtR]R
&   RtR]R&   RtR]R&   RtR]R&   RtR# )ÚSubscriptionPreviewResultzS``_serialize_subscription_preview`` on success; ``effect`` drives the confirm copy.NzSubscriptionChangeEffect | NoneÚeffectr   ÚreasonÚcurrent_tier_idÚcurrent_tier_nameÚtarget_tier_idÚtarget_tier_nameÚmonthly_credits_deltar1   Úamount_due_now_centsÚeffective_atr   )r   r   r   r   r    r±   r!   r²   r³   r´   rµ   r¶   r·   r¸   r¹   r"   r   r#   r$   r°   r°   ô   sd   ‡ Ù]à.2€FÐ+Ó2Ø€FˆJÓØ"&€O�ZÓ&Ø$(Ð�zÓ(Ø!%€N�JÓ%Ø#'Ð�jÓ'Ø(,Ð˜:Ó,Ø'+Ð˜*Ó+Ø#€L�*×#r#   r°   zsubscription.previewzAChargeless quote of what a plan change would do (billing:manage).c                  ó8   € ] tR tRt$ RtRtR]R&   RtR]R&   R	tR# )
ÚSubscriptionChangeParamsi  z]Either a target tier (downgrade / same-price change) or ``cancel`` (period-end cancellation).Nr   r¨   Fr   Úcancelr   )	r   r   r   r   r    r¨   r!   r¼   r"   r   r#   r$   r»   r»     s   ‡ Ùgà'+Ð˜*Ó+Ø€FˆD×r#   r»   c                  ó   € ] tR tRtRtRtR# )ÚBillingPendingChangeResulti  zV``_billing_pending_change``: ``message`` + the raw NAS body in ``payload`` on success.r   N©r   r   r   r   r    r"   r   r#   r$   r¾   r¾     s   † Ý`r#   r¾   zsubscription.changezFSchedule a downgrade / same-price change or a period-end cancellation.zsubscription.resumezHClear a scheduled downgrade / cancellation (re-enables recurring spend).c                  ó4   € ] tR tRt$ RtR]R&   RtR]R&   RtR# )ÚSubscriptionUpgradeParamsi  Nr   r¨   Úidempotency_keyr   )r   r   r   r   r¨   r!   rÂ   r"   r   r#   r$   rÁ   rÁ     s   ‡ Ø'+Ð˜*Ó+Ø"&€O�Z×&r#   rÁ   c                  ób   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R]R&   Rt
R]R	&   R
tR# )ÚSubscriptionUpgradeResulti  zÇThe money route: ``status`` separates a completed upgrade from an SCA / decline that must
finish in the portal at ``recovery_url``; ``idempotency_key`` is echoed (also on error) so a
retry reuses it.Nr   r9   r¶   Úrecovery_urlr²   rÂ   r   )r   r   r   r   r    r9   r!   r¶   rÅ   r²   rÂ   r"   r   r#   r$   rÄ   rÄ     s<   ‡ ñð €FˆJÓØ#'Ð�jÓ'Ø#€L�*Ó#Ø€FˆJÓØ"&€O�Z×&r#   rÄ   zsubscription.upgradez?Prorate, charge and flip the plan (billing:manage, idempotent).c                  ó4   € ] tR tRt$ RtR]R&   RtR]R&   RtR# )ÚBillingChargeParamsi/  Núfloat | str | NoneÚ
amount_usdr   rÂ   r   )r   r   r   r   rÉ   r!   rÂ   r"   r   r#   r$   rÇ   rÇ   /  s   ‡ Ø%)€JÐ"Ó)Ø"&€O�Z×&r#   rÇ   c                  ó8   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR# )ÚBillingChargeResulti4  uR   ``202 {chargeId}`` â€” money is not confirmed yet; poll ``billing.charge_status``.Nr   Ú	charge_idrÂ   r   )	r   r   r   r   r    rÌ   r!   rÂ   r"   r   r#   r$   rË   rË   4  s   ‡ Ù\à €IˆzÓ Ø"&€O�Z×&r#   rË   zbilling.chargez;Start a one-off top-up charge (billing:manage, idempotent).c                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚBillingChargeStatusParamsi?  Nr   rÌ   r   )r   r   r   r   rÌ   r!   r"   r   r#   r$   rÎ   rÎ   ?  s   ‡ Ø €Iˆz× r#   rÎ   c                  óT   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R]R	&   R
t
R# )ÚBillingChargeStatusResultiC  zTSingle status read (pending | settled | failed); the caller drives the poll cadence.Nr   r9   zstr | float | NonerÉ   Ú
settled_atr²   r   )r   r   r   r   r    r9   r!   rÉ   rÑ   r²   r"   r   r#   r$   rÐ   rÐ   C  s.   ‡ Ù^à€FˆJÓØ%)€JÐ"Ó)Ø!€J�
Ó!Ø€FˆJ×r#   rÐ   zbilling.charge_statuszPoll one charge by id.c                  óB   € ] tR tRt$ RtR]R&   RtR]R&   RtR]R&   R	tR# )
ÚBillingAutoReloadParamsiP  Fr   rg   NrÈ   Ú	thresholdÚtop_up_amountr   )	r   r   r   r   rg   r!   rÔ   rÕ   r"   r   r#   r$   rÓ   rÓ   P  s"   ‡ Ø€GˆTÓØ$(€IÐ!Ó(Ø(,€MÐ%×,r#   rÓ   c                  ó   € ] tR tRtRtRtR# )ÚBillingMutationResultiV  z.A write with no success payload beyond ``ok``.r   Nr¿   r   r#   r$   r×   r×   V  s   † Ý8r#   r×   zbilling.auto_reloadzQEnable/disable auto top-up with its threshold and reload amount (billing:manage).c                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚBillingKeepGoingOnCreditsParamsi^  Fr   rg   r   N)r   r   r   r   rg   r!   r"   r   r#   r$   rÙ   rÙ   ^  s   ‡ Ø€GˆT×r#   rÙ   zbilling.keep_going_on_creditszCWindow plans: turn 'Keep going on credits' on/off (billing:manage).c                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚBillingStepUpParamsif  Nr   Ú
session_idr   )r   r   r   r   rÜ   r!   r"   r   r#   r$   rÛ   rÛ   f  s   ‡ Ø!€J�
×!r#   rÛ   c                  ó*   € ] tR tRt$ RtRtR]R&   RtR# )ÚBillingStepUpResultij  zL``granted`` false when the server downscopes (also on every error envelope).Nr7   Úgrantedr   )r   r   r   r   r    rß   r!   r"   r   r#   r$   rÞ   rÞ   j  s   ‡ ÙVà€Gˆ[×r#   rÞ   zbilling.step_upzYRun the billing:manage device flow; the URL/code arrive via billing.step_up.verification.c                  ó¤   € ] tR tRt$ RtR]R&   RtR]R&   RtR]R	&   RtR]R
&   Rt	R]R&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR# )ÚActiveSubagentiw  u«   One live child from ``tools/delegate_tool_registry.py::list_active_subagents`` (the record
is extended by the child runner â€” ``missed_steer`` etc. â€” so it stays open).r-   Úsubagent_idNr   Ú	parent_idr1   ÚdepthÚgoalÚdelegation_idÚmodelúfloat | NoneÚ
started_atr9   Ú
tool_countÚowner_agent_session_idr   )r   r   r   r   r    r!   rã   rä   rå   ræ   rç   ré   r9   rê   rë   r"   r   r#   r$   rá   rá   w  sk   ‡ ñXð ÓØ €IˆzÓ Ø€Eˆ:ÓØ€Dˆ*ÓØ $€M�:Ó$Ø€Eˆ:ÓØ#€J�Ó#Ø€FˆJÓØ!€J�
Ó!Ø)-Ð˜J×-r#   rá   c                  ó@   € ] tR tRt$ R]R&   R]R&   R]R&   R]R&   R	tR
# )ÚDelegationStatusResulti‡  zlist[ActiveSubagent]Úactiver   Úpausedr›   Úmax_spawn_depthÚmax_concurrent_childrenr   N©r   r   r   r   r!   r"   r   r#   r$   rí   rí   ‡  s   ‡ Ø Ó ØƒLØÓØ × r#   rí   zdelegation.statusz;Running subagent tree plus the spawn pause flag and limits.c                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚDelegationPauseParamsi’  Tr   rï   r   N)r   r   r   r   rï   r!   r"   r   r#   r$   rô   rô   ’  s   ‡ Ø€FˆD×r#   rô   c                  ó"   € ] tR tRt$ R]R&   RtR# )ÚDelegationPauseResulti–  r   rï   r   Nrò   r   r#   r$   rö   rö   –  s   ‡ Ø‡Lr#   rö   zdelegation.pausezXBlock/unblock NEW spawns globally (active children keep running); returns the new state.c                  ó,   € ] tR tRt$ R]R&   R]R&   RtR# )ÚSubagentSteerParamsiž  r-   râ   Útextr   Nrò   r   r#   r$   rø   rø   ž  s   ‡ ØÓØ
‡Ir#   rø   c                  ó   € ] tR tRtRtRtRtR# )ÚSteerStatusi£  ÚqueuedÚrejectedr   N)r   r   r   r   rü   rý   r"   r   r#   r$   rû   rû   £  s   † Ø€FØ„Hr#   rû   c                  ó:   € ] tR tRt$ RtR]R&   R]R&   R]R&   RtR	# )
ÚSubagentSteerResulti¨  z]``queued`` is not ``delivered``: a child past its final tool batch surfaces ``missed_steer``.rû   r9   r-   râ   rù   r   N©r   r   r   r   r    r!   r"   r   r#   r$   rÿ   rÿ   ¨  s   ‡ ÙgàÓØÓØ
‡Ir#   rÿ   zsubagent.steerzFQueue steering text into a live delegated child owned by this session.c                  ó"   € ] tR tRt$ R]R&   RtR# )ÚHandoffRequestParamsi·  r-   Úplatformr   Nrò   r   r#   r$   r  r  ·  s   ‡ Ø‡Mr#   r  c                  ó@   € ] tR tRt$ R]R&   R]R&   R]R&   R]R&   RtR	# )
ÚHandoffRequestResulti»  r   rü   r-   Úsession_keyr  Ú	home_namer   Nrò   r   r#   r$   r  r  »  s   ‡ ØƒLØÓØƒMØ‡Nr#   r  zhandoff.requestzVQueue a handoff to a messaging platform's home channel; the gateway watcher claims it.c                  ó:   € ] tR tRt$ RtR]R&   R]R&   R]R&   RtR# )	ÚHandoffStateResultiÆ  zV``state`` is pending | running | completed | failed, or '' when nothing was requested.r-   Ústater  r   r   Nr   r   r#   r$   r	  r	  Æ  s   ‡ Ù`àƒJØƒMØ‡Jr#   r	  zhandoff.statez&Poll the handoff row for this session.c                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚHandoffFailParamsiÒ  Nr   r   r   )r   r   r   r   r   r!   r"   r   r#   r$   r  r  Ò  ó   ‡ Ø€Eˆ:×r#   r  c                  ó0   € ] tR tRt$ RtR]R&   R]R&   RtR# )	ÚHandoffFailResultiÖ  zW``failed`` false when the watcher already claimed the row; ``state`` is what it is now.r   Úfailedr-   r
  r   Nr   r   r#   r$   r  r  Ö  s   ‡ ÙaàƒLØ‡Jr#   r  zhandoff.failzNFail a not-yet-claimed handoff (client poll timeout); CAS against the watcher.c                  ó   € ] tR tRtRtRtRtR# )ÚReactionAuthoriä  ÚuserÚagentr   N)r   r   r   r   r  r  r"   r   r#   r$   r  r  ä  r)   r#   r  c                  óT   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R	]R
&   Rt
R# )ÚMessageReactParamsié  z”``row_id`` is ``messages.id``; a not-yet-persisted live message names ``newest_role`` instead.
``emoji`` null clears; the same emoji again retracts.Nr1   Úrow_idr   Únewest_roleÚemojizReactionAuthor | NoneÚauthorr   )r   r   r   r   r    r  r!   r  r  r  r"   r   r#   r$   r  r  é  s2   ‡ ñ=ð €FˆJÓØ"€K�Ó"Ø€Eˆ:ÓØ$(€FÐ!×(r#   r  c                  ó,   € ] tR tRt$ R]R&   R]R&   RtR# )ÚMessageReactResultió  r›   r  zlist[MessageReaction]Ú	reactionsr   Nrò   r   r#   r$   r  r  ó  s   ‡ ØƒKØ$×$r#   r  zmessage.reactzYSet/clear one author's emoji reaction on a message; returns the row's full reaction list.c                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚPetCancelParamsiÿ  Nr   Útokenr   )r   r   r   r   r   r!   r"   r   r#   r$   r  r  ÿ  r  r#   r  c                  ó"   € ] tR tRt$ R]R&   RtR# )ÚPetCancelResulti  r   r   r   Nrò   r   r#   r$   r"  r"    s   ‡ Ø‡Hr#   r"  z
pet.cancelz;Stop an in-flight pet generate/hatch by token (idempotent).c                  ó:   € ] tR tRt$ RtR]R&   R]R&   R]R&   RtR	# )
ÚPetGenProvideri  z>``agent/pet/generate/imagegen.py::list_sprite_providers`` row.r-   rš   Úlabelr   Údefaultr   Nr   r   r#   r$   r$  r$    s   ‡ ÙHà
ƒIØƒJØ‡Mr#   r$  c                  ó,   € ] tR tRt$ R]R&   R]R&   RtR# )ÚPetGenerateStatusResulti  r   r8   zlist[PetGenProvider]Ú	providersr   Nrò   r   r#   r$   r(  r(    s   ‡ ØƒOØ#×#r#   r(  zpet.generate.statusz[Whether pet generation is possible (a reference-capable image backend) and which providers.c                  ób   € ] tR tRt$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R]R	&   Rt
R]R
&   RtR# )ÚPetGenerateParamsi  z_``prompt`` or a ``referenceImage`` data URL is required (the handler answers 4004 without one).Nr   ÚpromptÚreferenceImager1   ÚcountÚstyleÚproviderr   )r   r   r   r   r    r,  r!   r-  r.  r/  r0  r"   r   r#   r$   r+  r+    s7   ‡ Ùià€FˆJÓØ!%€N�JÓ%Ø€Eˆ:ÓØ€Eˆ:ÓØ€Hˆj×r#   r+  c                  ó,   € ] tR tRt$ R]R&   R]R&   RtR# )ÚPetDrafti&  r›   Úindexr-   ÚdataUrir   Nrò   r   r#   r$   r2  r2  &  s   ‡ ØƒJØ‡Lr#   r2  c                  ó6   € ] tR tRt$ R]R&   R]R&   R]R&   RtR	# )
ÚPetGenerateResulti+  r   r   r-   r   zlist[PetDraft]Údraftsr   Nrò   r   r#   r$   r6  r6  +  s   ‡ ØƒHØƒJØ×r#   r6  zpet.generatez^Candidate base looks for a new pet (draft step); drafts also stream via pet.generate.progress.c                  ó€   € ] tR tRt$ R]R&   R]R&   RtR]R&   RtR]R	&   RtR]R
&   RtR]R&   Rt	R]R&   Rt
R]R&   RtR# )ÚPetHatchParamsi5  r-   r   rš   Nr   ÚcancelTokenr1   r3  Údescriptionr,  r/  r0  r   )r   r   r   r   r!   r:  r3  r;  r,  r/  r0  r"   r   r#   r$   r9  r9  5  sH   ‡ ØƒJØ
ƒIØ"€K�Ó"Ø€Eˆ:ÓØ"€K�Ó"Ø€FˆJÓØ€Eˆ:ÓØ€Hˆj×r#   r9  c                  óÎ   € ] tR tRt$ RtR]R&   RtR]R&   RtR]R&   RtR]R&   Rt	R]R&   Rt
R	]R
&   RtR	]R&   RtR	]R&   RtR]R&   RtR]R&   RtR	]R&   RtR]R&   RtR]R&   RtR# )ÚPetSpritePayloadiC  Nr   ÚslugÚdisplayNameÚmimeÚspritesheetBase64ÚspritesheetRevisionr1   ÚframeWÚframeHÚframesPerStatezdict[str, int] | NoneÚframesByStateÚframesByRowÚloopMsrè   Úscalerz   Ú	stateRowsr   )r   r   r   r   r>  r!   r?  r@  rA  rB  rC  rD  rE  rF  rG  rH  rI  rJ  r"   r   r#   r$   r=  r=  C  s‰   ‡ Ø€Dˆ*ÓØ"€K�Ó"Ø€Dˆ*ÓØ$(Ð�zÓ(Ø&*Ð˜Ó*Ø€FˆJÓØ€FˆJÓØ!%€N�JÓ%Ø+/€MÐ(Ó/Ø)-€KÐ&Ó-Ø€FˆJÓØ€Eˆ<ÓØ"&€IÐ×&r#   r=  c                  ó`   € ] tR tRt$ RtR]R&   R]R&   R]R&   ]! ]R7      tR	]R
&   R]R&   Rt	R# )ÚPetHatchResultiS  z]The hatched pet is installed but NOT active (``pet.select`` adopts, ``pet.remove`` discards).r   r   r-   r>  r?  )Údefault_factoryzlist[JsonValue]Úwarningsr=  Úpetr   N)
r   r   r   r   r    r!   r   ÚlistrN  r"   r   r#   r$   rL  rL  S  s*   ‡ ÙgàƒHØ
ƒIØÓÙ %°dÔ ;€HˆoÓ;Ø	×r#   rL  z	pet.hatchzWTurn a base draft into a full spritesheet pet; progress streams via pet.hatch.progress.c                  ó&   € ] tR tRt$ RtR]R&   RtR# )ÚProjectFactsParamsid  Nr   Úcwdr   )r   r   r   r   rS  r!   r"   r   r#   r$   rR  rR  d  s   ‡ Ø€Cˆ×r#   rR  c                  óN   € ] tR tRt$ RtR]R&   R]R&   R]R&   R]R&   R]R	&   R
tR# )ÚProjectFactsih  u`   ``agent/coding_context.py::project_facts_for`` â€” the system prompt's coding-context detection.r-   Úrootz	list[str]Ú	manifestsÚpackageManagersÚverifyCommandsÚcontextFilesr   Nr   r   r#   r$   rU  rU  h  s"   ‡ Ùjà
ƒIØÓØÓØÓØ×r#   rU  c                  ó*   € ] tR tRt$ RtRtR]R&   RtR# )ÚProjectFactsResultir  z>``facts`` null outside a workspace (or when detection failed).NzProjectFacts | NoneÚfactsr   )r   r   r   r   r    r]  r!   r"   r   r#   r$   r\  r\  r  s   ‡ ÙHà!%€EÐ×%r#   r\  zproject.factszGStructured project facts for a cwd so UIs don't re-sniff the workspace.N)Nr    Ú
__future__r   Úpydanticr   Úbaser   r   r   r   Úcommonr   r	   r
   r   r   Úregistryr   r   r&   r+   r6   rG   rN   rS   rX   r^   rc   rf   rm   rˆ   rŒ   r™   r¡   r§   rª   r°   r»   r¾   rÁ   rÄ   rÇ   rË   rÎ   rÐ   rÓ   r×   rÙ   rÛ   rÞ   rá   rí   rô   rö   rø   rû   rÿ   r  r  r	  r  r  r  r  r  r  r"  r$  r(  r+  r2  r6  r9  r=  rL  rR  rU  r\  r   r#   r$   Ú<module>rc     s  ðñõ #å ç 5Ó 5ß WÕ WÝ ô
 �fô  ô&�8ô ô
ˆvô ô&�ô &ñ$ €|˜M°*Ølõnô$�fô $ô˜ô ô
$˜6ô 
$ô˜ô ô˜ô ô˜Fô ô.˜ô .ô (˜ô  (ñF €˜}Ð5GØmõoô˜(ô ô
6˜&ô 6ô˜Vô ô(˜fô (ñ& Ð MÐ:QØ\õ^ô, ô ,ô˜xô ô$ ô $ñ ÐÐ&?ÐHaØNõPô˜}ô ôa ô añ ÐÐ%=ÐF`ØSõUá Ð ]Ð;UØUõWô' ô 'ô
	' ô 	'ñ ÐÐ&?ÐHaØLõNô'˜-ô 'ô
'˜/ô 'ñ ÐÐ 3Ð<OØHõJô! ô !ô ô ñ ÐÐ'@ÐIbØ#õ%ô-˜mô -ô9˜Oô 9ñ ÐÐ%<ÐEZØ^õ`ô mô ñ Ð&Ð/NÐWlØPõRô"˜-ô "ô ˜/ô  ñ ÐÐ!4Ð=PØfõhô.�Yô .ô !˜Vô !ñ Ð =Ð9OØHõJô˜Mô ô˜Fô ñ ÐÐ"7Ð@UØeõgô˜-ô ô
�(ô ô
˜&ô ñ ÐÐ 3Ð<OØSõUô˜=ô ô˜6ô ñ ÐÐ!5Ð>RØcõeô˜ô ñ €˜}Ð5GØ3õ5ô˜ô ô˜ô ñ €~Ð/Ð8IØ[õ]ô�Xô ô
)˜ô )ô%˜ô %ñ
 €Ð1Ð:LØfõhô�mô ô�fô ñ €|˜O°OØHõJô�Vô ô$˜fô $ñ
 Ð ]Ð;RØhõjô ˜ô  ôˆvô ô
˜ô ñ €~Ð/Ð8IØkõmô �]ô  ô'�vô 'ô �Vô ñ €{˜>°.Ødõfô˜ô ô�6ô ô&˜ô &ñ €Ð1Ð:LØT÷Vr#   