§
     ’Þj.:  ã                  ó0  — U d Z ddlmZ ddlmZ i dd“dd“dd	“d
d“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“d d!“d"d#“d$d%“i d&d'“d(d)“d*d+“d,d-“d.d/“d0d1“d2d3“d4d'“d5d6“d7d8“d9d:“d;d<“d=d>“d?d@“dAdB“dCdD“dEdF“¥dGdHi¥ZdIedJ<   dÂdO„ZdPZdQdRdSifdTdUdSd@œfdVdWdXdYd+œfdZd[d\d]d^d_d`dœfdadbdcd\d]d^d_dœfdddedfdgd\d]dhdidjd^d_dkd`dœfdldmdndDœfdPœZ	doedp<   i ddq“d dr“dds“ddt“ddu“d"dv“d$dw“d&dx“d,dy“ddz“dd{“dd|“dGd}“d2d~“d4d“d;d€“d=d�“d‚dƒd„d…d†d‡dˆd‰dŠd‹dŒd�œ¥Z
dŽd�d�d‘d’d“d”d•d–d—d˜d™dšd›dœœZd�Zi džd“dŸd“d d“d¡d“d¢d“d£d“d¤d“d¥d“d¦d“d§d“d¨d“d©d2“dªd2“d«d2“d¬d2“d­d2“d®d=“i d¯d=“d°d“d±d“d²d“d³d“d´d“dµd“d¶d“d·d“d¸d“d¹dG“dºdG“d»d7“d¼d7“d½d4“d¾d4“d¿d;“¥d;d&d&d"d$d$dÀœ¥ZdÁS )Ãaß  Deepy Zero's tool catalog: the only built-in tools and parameters that Deepy Zero's own model sees.

Every built-in assistant tool also serves the MCP toolbox of Deepy Prime and external agents, which see all of them. Deepy Zero is
the lightweight assistant: its whole tool list is part of every prefill and of its context window. A tool or parameter added for
the toolbox therefore stays out of Zero until it is listed here on purpose, and wording written for agents goes to
agent_description, which Zero never reads. Plugin tools registered for Deepy Zero are explicit Zero tools and are not listed.

Zero discovers most of its tools progressively, as Prime does: only ZERO_DIRECT tools are in its prompt, with the short texts of
ZERO_DIRECT_TEXT; the other catalog tools sit behind one `toolbox` tool, which lists them (ZERO_TOOLBOX_SUMMARIES), describes one
on demand (its full schema plus ZERO_TOOLBOX_NOTES) and runs them. Small models (Qwen3.5 4B and 9B) keep the common path direct.
é    )Úannotations)ÚAnyÚadd_to_gallery)ÚpathÚpathsÚappend_text)Ú	file_pathÚtextÚcreate_color_frame)ÚwidthÚheightÚcolorÚboxesÚ	box_colorÚedit)r	   Ú
old_stringÚ
new_stringÚreplace_allÚ
edit_image)Úmedia_idÚpromptr   r   Únum_inference_stepsÚextra_settingsÚextract_audio)r   Ústart_sÚend_sÚ
duration_sÚstart_frameÚ	end_frameÚ
num_framesÚaudio_track_noÚextract_image)r   Úframe_noÚtime_sÚextract_video)r   r   r   r   r   r   r    Ú	gen_image)r   r   r   r   r   Úcustom_fileÚgen_song)ÚlyricsÚmusic_captionÚduration_secondsr   Úlorasr'   Úgen_speech_from_description)r   Úvoice_descriptionr+   r   Úgen_speech_from_sample)r   r   r+   r   Ú	gen_video)r   Úimage_startÚ	image_endr   r   r    r+   Úfpsr   r   r,   r'   Úgen_video_with_refs)r   r1   r2   r   r   r    r+   r3   r   r   r,   r'   Ú
image_refsÚ
video_refsÚgen_video_with_speech)r   r1   Úaudio_media_idr   r   r    r+   r3   r   r   r,   Úget_default_settings)Útool_idÚ	get_loras)r:   ÚnameÚget_media_details)r   Úget_selected_media)Ú
media_typeÚinspect_media)r   Úquestionr#   Úinspect_video)r   r   r   rA   Úmid_res_samplingÚmin_gap_framesÚ	min_gap_sÚ
list_files)r   Úpatternr?   ÚlimitÚcursorÚsummary_onlyÚload_doc_section)Údoc_idÚsectionÚmerge_videos)Ú	media_idsÚtransitionsÚtransition_sÚ
mute_videoÚnotify)ÚmessageÚtitleÚpostprocessing)r   ÚprocessÚ
parametersÚ
query_file)r   Úreplace_audio)Úvideo_idÚaudio_idÚresize_crop)
r   r   r   Ú	crop_leftÚcrop_topÚ
crop_rightÚcrop_bottomÚ	crop_unitÚcrop_anchorÚstretch_to_fitÚresolve_media_reference)Ú	referencer?   Úrg)Ú	argumentsÚ
search_doc)ÚqueryrL   Úside_by_side)rO   ÚlayoutÚlegendsÚtranscribe_media)r   Útimestamp_typer!   zdict[str, tuple[str, ...]]ÚZERO_TOOL_PARAMETERSÚtoolsúdict[str, dict[str, Any]]ÚreturnÚNonec           
     ó(  ‡‡— t                                ¦   «         D ]u\  }Š|| vrt          d|› d�¦  «        ‚| |         d         Šˆfd„‰D ¦   «         }ˆfd„‰                     ¦   «         D ¦   «         }|s|rt          d|› d|› d|› d	�¦  «        ‚Œvd
S )zlFail at import when an entry names a missing tool or parameter, or leaves out a parameter its tool requires.z'Deepy Zero catalog lists unknown tool 'z'.rX   c                ó   •— g | ]}|‰v¯|‘Œ	S © rw   )Ú.0Ú	parameterÚdeclareds     €úAC:\Users\johnn\OneDrive\Documents\AI\shared\deepy\zero_catalog.pyú
<listcomp>z&check_zero_catalog.<locals>.<listcomp>>   s#   ø€ ÐVÐVÐV ¸IÈXÐ<UÐ<U�9Ð<UÐ<UÐ<Uó    c                óN   •— g | ]!\  }}|                      d d¦  «        ¯|‰v¯|‘Œ"S )ÚrequiredT)Úget)rx   ry   ÚmetarX   s      €r{   r|   z&check_zero_catalog.<locals>.<listcomp>?   sb   ø€ ð  Dð  Dð  D¡ ¨DÈÏÊÐQ[Ð]aÑHbÔHbð  DÐgpð  yCð  hCð  hC�9ð  hCð  hCð  hCr}   zDeepy Zero catalog entry 'z#' does not match the tool: unknown z, required but missing ú.N)rp   ÚitemsÚRuntimeError)rq   r<   ÚunknownÚmissingrz   rX   s       @@r{   Úcheck_zero_catalogr‡   8   s  øø€ å0×6Ò6Ñ8Ô8ð Qð QÑˆˆjØ�uÐÐÝÐQÈÐQÐQÐQÑRÔRÐRØ˜”;˜|Ô,ˆØVÐVÐVÐV¨jÐVÑVÔVˆð Dð  Dð  Dð  D°H·N²NÑ4DÔ4Dð  Dñ  Dô  DˆØð 	Q�gð 	QÝð   P¸Dð   Pð   PÐelð   Pð   Pð  FMð   Pð   Pð   Pñ  Qô  Qð  Qð	QðQð Qr}   )r>   re   r@   r&   r   r0   ri   z•The media selected in the Gallery: only when the user says this, selected or current. For last, latest or previous media use resolve_media_reference.r?   zimage, video, audio, 3d or all.zjThe media_id of the last, latest or previous media, or of one the user describes (not for selected media).z9What the user said, e.g. last, previous, the cat picture.zJLook at an image (or one frame of a video) and answer a question about it.zThe image or video media_id.zWhat to look for.z%Frame of a video (default the first).zCGenerate an image from a prompt with the configured image template.z"Detailed description of the image.z4Width in pixels, only when the user asks for a size.z5Height in pixels, only when the user asks for a size.zSteps, only when the user asks.zOOther template settings by their exact names from toolbox get_default_settings.zEExtra input file, only when get_default_settings reports custom_file.z�Change a still image and get a still image back (add, remove, restyle). Never for a video: to animate a picture use gen_video with image_start.zThe image to edit.z&The edit to make, described precisely.z‰Make a video: from a prompt alone, or animating a picture (image_start = its media_id), optionally ending on another picture (image_end).ziDetailed description of the shot: subject, action, camera, sound or speech when the template makes sound.z"media_id of the first frame image.z!media_id of the last frame image.z%Frame count; prefer duration_seconds.z*Length in seconds when the user gives one.z.Frames per second (15 to 60), only when asked.zlOnly when the user asks for LoRAs: [{"name": a file name returned by toolbox get_loras, "multiplier": 1.0}].z¾Search WanGP's documentation, only to answer a question about how WanGP works (never to carry out a request). The LoRAs installed for a tool are listed by toolbox get_loras, not by the docs.zWords to search for.zMOptional: getting_started, overview, processing, prompts, loras or finetunes.z%dict[str, tuple[str, dict[str, str]]]ÚZERO_DIRECT_TEXTzbVideo keeping the look of reference images (a character, a product) or following reference videos.zITalking or singing video driven by an existing speech or song audio clip.z.Speech audio from text with a described voice.z5Speech audio from text in the voice of a sample clip.z.Song or music from lyrics and a music caption.zMSettings, inputs and extra settings of the template behind a generation tool.z&LoRAs available for a generation tool.zBSize, duration, fps, frame count and audio tracks of a media item.zJAnswer a question about a time range of a video (compares sampled frames).z&Save one frame of a video as an image.zCut a clip from a video.z/Take or cut the audio of a video or audio item.z3Transcript of the speech in an audio or video item.z9Join videos one after another, with optional transitions.zRemove the sound of a video.z"Replace the soundtrack of a video.z!Resize or crop an image or video.z@Put images or videos next to each other in one picture or video.z?Solid colour image of an exact size (black frame, colour card).z^Upscale, refine, interpolate or clean media (call with media_id alone to list the operations).zSend the user a notification.z"Add existing files to the Gallery.z"List authorized folders and files.zMetadata or text of one file.z0Search file names or text in authorized folders.zReplace text in a text file.z0Append text to a text file (created if missing).z*Load one section of WanGP's documentation.)rk   r   rV   rS   r   rF   rY   rg   r   r   rK   zÿFor a subject, character or product that must keep its look, or a motion to follow: image_refs=[media_id] (video_refs when supported). Read get_default_settings once for the template's input guidance. Use gen_video when there are only start or end images.z�Use when a speech or song clip already exists; for a talking video from text only, gen_video can speak the words when its template makes sound.zEFor standalone speech or when a separate speech clip is needed first.z`For standalone speech in the voice of a sample; if the voice is in a video, extract_audio first.zklyrics in sections ([verse], [chorus]) and a music_caption with genre, instruments, vocals, mood and tempo.a  Inspection only: never copy unchanged defaults back into a generation call. A setting the user asks for that is not a direct parameter must appear in extra_settings here, under that exact name; otherwise it is not available: tell the user and do not generate.zzCopy the returned identifiers exactly (with subfolders) and keep the user's multipliers, including ',' and ';' separators.zbFor the selected frame of a selected video, use get_selected_media's current_time_seconds exactly.zrUse time arguments (start_s, end_s, duration_s) or frame arguments (start_frame, end_frame, num_frames), not both.zyTime arguments for audio or video, frame arguments for video; audio_track_no when get_media_details shows several tracks.z0timestamp_type: segment (default), word or none.z–Read get_media_details first. Crop values in pixels or percent; crop_anchor keeps a side or corner; stretch_to_fit only when the user asks to stretch.zŠCall with media_id only to list the operations and their parameters, then with one returned process and parameters. Never guess a process.z'layout and legends only when requested.)r4   r7   r-   r/   r(   r9   r;   r"   r%   r   rn   r]   rV   rk   zõMore tools: run one directly with toolbox(action=..., arguments={...}). Actions with their arguments (* required): {actions}. With an action and no arguments it returns that action's description and rules; with no arguments, one line per action.ÚcutÚ	cut_videoÚtrimÚ
trim_videoÚclipÚ
clip_videoÚ
screenshotÚframeÚ	get_frameÚ
trim_audioÚ	cut_audioÚjoinÚconcatÚconcatenateÚmergeÚcombine_videosÚcropÚresizeÚsongÚmusicÚgenerate_songÚ	gen_musicÚspeechÚttsÚvoiceÚ
gen_speechÚclone_voiceÚ
transcribeÚ
transcriptÚupscaleÚenhanceÚmuteÚremove_audioÚ	add_audio)Ú	set_audioÚdetailsÚmedia_detailsÚsettingsr,   Ú
list_lorasN)rq   rr   rs   rt   )Ú__doc__Ú
__future__r   Útypingr   rp   Ú__annotations__r‡   ÚZERO_DIRECTrˆ   ÚZERO_TOOLBOX_SUMMARIESÚZERO_TOOLBOX_NOTESÚZERO_TOOLBOX_DESCRIPTIONÚZERO_TOOLBOX_SYNONYMSrw   r}   r{   ú<module>r¹      s  ðð
ð 
ð 
ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð ð$4ØÐ'ð$4àÐ(ð$4ð ÐLð$4ð ÐDð	$4ð
 Ðdð$4ð Ðð$4ð Ð7ð$4ð Ðmð$4ð Ðfð$4ð Ðið$4ð "Ð#hð$4ð ÐZð$4ð ð  uð$4ð ð  [ð$4ð ð  wð$4ð  ˜Lð!$4ð" Ð$ð#$4ð $4ð$ ˜ð%$4ð& ˜/ð'$4ð( Ð9ð)$4ð* Ðtð+$4ð, ÐVð-$4ð. Ð-ð/$4ð0 Ð@ð1$4ð2 �-ð3$4ð4 Ð"ð5$4ð6 Ð;ð7$4ð8 �)ð9$4ð: Ð-ð;$4ð< ð  Wð=$4ð> Ð:ð?$4ð@ 	ˆ.ðA$4ðB Ð%ðC$4ðD Ð6ðE$4ð $4ðF ÐHðG$4ð $4Ð ð $ð $ð $ñ $ðN	Qð 	Qð 	Qð 	Qð G€ð sØÐ7ðu9ð :ð !MØPØ7ðO9ð O9ð  :ð cØ2Ø'Ø;ðe=ð e=ð >ð XØ6ØGØIØ@ØkØ^ðZ`ð Z`ð að eØ(Ø:ØGØIØ@Økðgmð gmð nð ^Ø}Ø;Ø8ØGØIØ=ØHØ?Ø@Økð DØ^ð``ð ``ð að TØ'ØaðVcð Vcð dðK(;ð (;Ð ð (ð (ð (ñ (ðVØÐðàÐhðð "Ð#Sðð ÐUð	ð
 Ð@ðð Ðkðð Ð9ðð Ð]ðð Ðaðð Ð=ðð Ð/ðð ÐFðð ÐMðð ÐOðð Ð0ðð  Ð9ð!ð" Ð6ð#ð$ WØ[ØvØ-Ø:Ø6Ø1Ø
<Ø*ØEØDð9ð ð Ð ðB ]ð oØ#jð AØ}ð bð NØyð Jð QØJð lð cØ=ðð Ð ð" SÐ ð	Ø	ˆ?ð	Ø'¨ð	Ø:@À/ð	ØS_Ðapð	Ørxð  {Jð	ð LXð  Zið	à�/ð	à#*¨Oð	à=HÈ/ð	à[gÐixð	ð {Fð  HWð	ð ˆNð	ð % nð	ð 7DÀ^ð	ð V]Ð^lð	ð oð  AOð	ð ˆMð		ð 	ð $ ]ð		ð 5;¸Jð		ð IPÐQ[ð		ð ^mÐnxð		ð {Fð  HRð		ð
 Ð+ð	ð
 .3Ð4Qð	ð
 T[Ð\yð	ð
 |Hð  Jgð	ð Ð+ð	ð .:Ð;Mð	ð P\Ð]oð	ð r{ð  }Mð	ð OXð  Zjð	ð ˆLð	ð )¨,ð	ð 9DÀ_ð	ð 	ð dsð  @Sð  fyØ&°ÈKð	ð 	ð 	Ð Ð Ð r}   