o
    Y}aj                     @  s  d Z ddlmZ ddlZddlZddlmZ ee j	d Z
ejdee
 ejdZedur;eeds;ejd= ddlmZ dd	lmZ dd
lmZ ddlmZmZ edddddddddddd	edddddddddddddd	fZd#d d!Zed"kree dS )$zASeed reference single-app and multi-app Agent Profile v1 records.    )annotationsN)Path   platform__path__)select)get_control_plane_session)AgentProfileContract)AgentProfileTenantabn_assistantzABN Assistantz1.0.0z5Read-only assistant limited to Australian ABN lookup.)business.au.abn.lookupneveralways)readwrite_irreversibleia  )		agent_keynameversioninstructions_versiondescriptionallowed_capabilitiesconfirmation_policy	max_stepsmonthly_token_limitoperations_assistantzOperations AssistantzOMulti-app operations profile that grows as subscribed tools become agent-ready.)r   zinvoice.document.extractzinvoice.supplier.readzaroflo.task.searchzaroflo.invoice.createpolicy)r   	calculatewrite_reversibler      i returnintc               	   C  sF  t D ]} |  }|rtdd| qt s}|tdd u r$tdt D ]X} |tt	
t	jdkt	j| jk }|d u rLt	d| jd}|| | j|_| j|_| j|_| j|_d|_t| j|_t| j|_t| j|_| j| jd|_ dd	i|_!q&|"  W d    n1 sw   Y  t#t$%d
dd t D d dS )NzInvalid profile: z; 
absolutemsz Tenant absolutems does not exist)	tenant_idr   active)r   r   seedagent_profile_v1okc                 S  s   g | ]}|j qS  )r   ).0itemr(   r(   )scripts/seed_absolutems_agent_profiles.py
<listcomp>Z   s    zmain.<locals>.<listcomp>)statusprofilesr   )&PROFILESvalidate
SystemExitjoinr   getr   executer   r
   wherer#   r   scalar_one_or_noneaddr   display_namer   r   profile_versionr   r-   listr   allowed_capabilities_jsonallowed_rolesallowed_roles_jsondictr   confirmation_policy_jsonr   r   limits_jsonmetadata_jsoncommitprintjsondumps)profileerrorssessionrecordr(   r(   r+   main<   sD   


rJ   __main__)r    r!   )__doc__
__future__r   rD   syspathlibr   __file__resolveparentsBASE_DIRpathinsertstrmodulesr3   loaded_platformhasattr
sqlalchemyr   config.control_planer   platform.agents.profilesr	   platform.tenants.modelsr
   r   r/   rJ   __name__r1   r(   r(   r(   r+   <module>   sZ   
%"
