ó
    kX¢j  ã                  ó~   • S r SSKJr  SSKJrJr  SSKJrJr  SSK	J
r
  SSKJrJr  SSKJrJr   " S S	5      rSS
 jrg)uP   Solution Architect skill â€” technical design + metadata plan from requirements.é    )Úannotations)ÚListÚOptional)ÚDesignArtifactÚenforce_allowlist)ÚRequirementsArtifact)Ú	LLMClientÚget_llm_client)ÚKnowledgeHitÚKnowledgeServicec                  ó:   • \ rS rSr  S     SS jjrSS jrSrg)	ÚSolutionArchitecté   Nc                ód   • U=(       d
    [        5       U l        U=(       d
    [        5       U l        g )N)r
   Úllmr   Ú	knowledge)Úselfr   r   s      Ú:/var/www/html/gaurav/packages/agents/solution_architect.pyÚ__init__ÚSolutionArchitect.__init__   s#   € ð
 ×*œ.Ó*ˆŒØ"×8Ô&6Ó&8ˆ�ó    c              ƒ  ó‚  #   • UR                    SSR                  UR                  5       3nU R                  R	                  USS9I S h  v•N n[        X5      nU R                  R                  U5      I S h  v•N nUR                  Ul        UR                   (       d  UR                   Ul         [        U5      $  Np ND7f)NÚ é   )Úlimit)
ÚsummaryÚjoinÚacceptance_criteriar   ÚgatherÚbuild_architect_promptr   Údesign_solutionÚjira_keyr   )r   ÚrequirementsÚqueryÚhitsÚpromptÚartifacts         r   ÚdesignÚSolutionArchitect.design   s¡   é € Ø×'Ñ'Ð(¨¨#¯(©(°<×3SÑ3SÓ*TÐ)UÐVˆØ—^‘^×*Ñ*¨5¸Ð*Ð:×:ˆÜ'¨Ó;ˆØŸ™×1Ñ1°&Ó9×9ˆØ(×1Ñ1ˆÔØ××Ø+×3Ñ3ˆHÔÜ  Ó*Ð*ñ ;á9ùs%   ‚AB?Á
B;Á-B?Á8B=Á9AB?Â=B?)r   r   )NN)r   zOptional[LLMClient]r   zOptional[KnowledgeService]ÚreturnÚNone)r#   r   r*   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r(   Ú__static_attributes__© r   r   r   r      s0   † ð $(Ø04ð9à ð9ð .ð9ð 
õ	9÷+r   r   c                ó&  • SR                  S U R                   5       5      =(       d    SnU Vs/ sH  o3R                  S:X  d  M  UPM     nnU Vs/ sH  o3R                  S:X  d  M  UPM     nnSS jnSU R                   SU R                   S	U R
                   S
U SU R                  (       a+  [        S5      R                  S U R                   5       5      OS SU R                  =(       d    S SU" U5       SU" U5       S3$ s  snf s  snf )NÚ
c              3  ó*   #   • U H
  nS U 3v •  M     g7f©ú- Nr1   )Ú.0Úas     r   Ú	<genexpr>Ú)build_architect_prompt.<locals>.<genexpr>"   s   é € ÐFÑ%E �R˜�s•8Ò%Eùó   ‚ú(none)Ú
confluenceÚgitc                óB   • U (       d  gSR                  S U  5       5      $ )Nr<   r3   c              3  óX   #   • U H!  nS UR                    SUR                   3v •  M#     g7f)r6   z: N)ÚtitleÚsnippet)r7   Úhs     r   r9   Ú6build_architect_prompt.<locals>.fmt.<locals>.<genexpr>)   s%   é € ÐA¹b¸˜2˜aŸg™g˜Y b¨¯©¨Õ4ºbùs   ‚(*)r   )Úhss    r   ÚfmtÚ#build_architect_prompt.<locals>.fmt&   s   € ÞØØ�y‰yÑA¹bÓAÓAÐAr   a³  You are the Solution Architect for Agent Nova (Salesforce development automation).
Produce a technical design and metadata plan for allowlisted Salesforce metadata only.
Escalate anything outside the v1 allowlist.

The design is published to Confluence as a Technical Design document with these sections:
1. Overview  2. Scope  3. Data Model  4. Picklist Configuration  5. Page Layout Configuration
6. Validation Rule  7. Processing Behavior  8. Security and Access  9. Deployment Components
10. Testing Strategy  11. Acceptance Criteria Traceability  12. Implementation Summary.

Use a concise feature name as summary (example: "Account Segment Classification"), not a sentence.

Jira key: z

Summary: z
Confidence from analyst: z

Acceptance criteria:
z

Out of scope from analyst:
é
   c              3  ó*   #   • U H
  nS U-   v •  M     g7fr5   r1   )r7   Úxs     r   r9   r:   >   s   é € Ð@Ñ ?˜1ˆd�QŽhÒ ?ùr;   z	

Notes: z

Confluence hits:
z

Repository hits:
aK  

v1 allowlist metadata types: CustomField, ValidationRule, Flow (record-triggered), ApexClass, ApexTrigger, LightningComponentBundle, PermissionSet.
Out of scope: profiles, sharing/OWD redesign, connected apps, destructive deletes, production deploy.

Return a metadata_plan with metadata_type, api_name, action (create|update), object (if applicable), and notes.
For CustomField notes include: data type, field label, picklist values, default value, required-at-definition.
For ValidationRule notes include: purpose, formula (Salesforce formula syntax), error message, error location.
)rE   úList[KnowledgeHit]r*   Ústr)	r   r   Úsourcer"   r   Ú
confidenceÚout_of_scope_itemsÚchrÚnotes)r#   r%   ÚacrC   ÚconfÚreporF   s          r   r    r    !   s#  € Ø	�‰ÑF \×%EÒ%EÓFÓ	F×	RÈ(€BÙÓ8‘t�!Ÿx™x¨<Ñ7�A‘t€DÐ8ÙÓ1‘t�!Ÿx™x¨5Ñ0�A‘t€DÐ1ôBð
ð × Ñ Ð
!ð "
Ø
×
Ñ
Ð	ð  Ø&×1Ñ1Ð2ð 3ð €ð ð EQ×Dc×Dc„€Rƒ‡�Ñ@ × ?Ò ?Ó@Ô@ÐiqÐ rð sà×Ñ×&˜hÐ'ð (ñ €Tƒ€ð ñ €Tƒ€ð ð7#ð #ùò 9ùÚ1s   °D	ÁD	ÁDÁ(DN)r#   r   r%   rK   r*   rL   )Ú__doc__Ú
__future__r   Útypingr   r   Úpackages.artifacts.designr   r   Úpackages.artifacts.requirementsr   Úpackages.integrations.llmr	   r
   Úpackages.knowledge.retrieversr   r   r   r    r1   r   r   Ú<module>r\      s)   ðÙ Vå "ç !ç GÝ @ß ?ß H÷+ñ +õ(-r   