house-lights 1.2.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/package.json +1 -1
  2. package/skills/cast-list/assets/map.html +80 -33
  3. package/skills/cast-list/examples/agents/bodega-cupons/actions/AbrirChamadoERP.mcs.yml +15 -0
  4. package/skills/cast-list/examples/agents/bodega-cupons/actions/ConsultarCuponsAtivos.mcs.yml +1 -1
  5. package/skills/cast-list/examples/agents/bodega-cupons/actions/EnviarCupomEmail.mcs.yml +1 -1
  6. package/skills/cast-list/examples/agents/bodega-cupons/actions/PromocoesMCP.mcs.yml +1 -1
  7. package/skills/cast-list/examples/agents/bodega-cupons/agent.mcs.yml +12 -0
  8. package/skills/cast-list/examples/agents/bodega-cupons/connectionreferences.mcs.yml +7 -7
  9. package/skills/cast-list/examples/agents/bodega-cupons/topics/ConsultarRegulamentoCupons.topic.mcs.yml +3 -3
  10. package/skills/cast-list/examples/agents/bodega-cupons/topics/Escalate.topic.mcs.yml +1 -1
  11. package/skills/cast-list/examples/agents/bodega-cupons/topics/Fallback.topic.mcs.yml +5 -5
  12. package/skills/cast-list/examples/agents/bodega-cupons/topics/Greeting.topic.mcs.yml +1 -1
  13. package/skills/cast-list/examples/agents/bodega-cupons/topics/OnError.topic.mcs.yml +7 -7
  14. package/skills/cast-list/examples/agents/bodega-cupons/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  15. package/skills/cast-list/examples/agents/bodega-cupons/workflows/AbrirChamadoERP-7d1c2a4e/metadata.yml +3 -0
  16. package/skills/cast-list/examples/agents/bodega-cupons/workflows/AbrirChamadoERP-7d1c2a4e/workflow.json +41 -0
  17. package/skills/cast-list/examples/agents/bodega-devolucoes/actions/AbrirChamadoERP.mcs.yml +15 -0
  18. package/skills/cast-list/examples/agents/bodega-devolucoes/actions/AbrirSolicitacaoDevolucao.mcs.yml +1 -1
  19. package/skills/cast-list/examples/agents/bodega-devolucoes/agent.mcs.yml +13 -0
  20. package/skills/cast-list/examples/agents/bodega-devolucoes/connectionreferences.mcs.yml +2 -2
  21. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/ConsultarPoliticaDevolucoes.topic.mcs.yml +3 -3
  22. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Escalate.topic.mcs.yml +1 -1
  23. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Fallback.topic.mcs.yml +5 -5
  24. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/Greeting.topic.mcs.yml +1 -1
  25. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/OnError.topic.mcs.yml +7 -7
  26. package/skills/cast-list/examples/agents/bodega-devolucoes/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  27. package/skills/cast-list/examples/agents/bodega-devolucoes/workflows/AbrirChamadoERP-7d1c2a4e/metadata.yml +3 -0
  28. package/skills/cast-list/examples/agents/bodega-devolucoes/workflows/AbrirChamadoERP-7d1c2a4e/workflow.json +56 -0
  29. package/skills/cast-list/examples/agents/bodega-frete/actions/EnviarOpcoesFrete.mcs.yml +1 -1
  30. package/skills/cast-list/examples/agents/bodega-frete/agent.mcs.yml +7 -0
  31. package/skills/cast-list/examples/agents/bodega-frete/connectionreferences.mcs.yml +2 -2
  32. package/skills/cast-list/examples/agents/bodega-frete/topics/ConsultarTabelaFrete.topic.mcs.yml +3 -3
  33. package/skills/cast-list/examples/agents/bodega-frete/topics/Desambiguar.topic.mcs.yml +11 -0
  34. package/skills/cast-list/examples/agents/bodega-frete/topics/Fallback.topic.mcs.yml +5 -5
  35. package/skills/cast-list/examples/agents/bodega-frete/topics/Greeting.topic.mcs.yml +1 -1
  36. package/skills/cast-list/examples/agents/bodega-frete/topics/OnError.topic.mcs.yml +7 -7
  37. package/skills/cast-list/examples/agents/bodega-frete/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  38. package/skills/cast-list/examples/agents/bodega-frete/variables/PreferenciaAntiga.mcs.yml +9 -0
  39. package/skills/cast-list/examples/agents/bodega-loja-fisica/actions/EnviarInstrucoesRetirada.mcs.yml +1 -1
  40. package/skills/cast-list/examples/agents/bodega-loja-fisica/agent.mcs.yml +12 -0
  41. package/skills/cast-list/examples/agents/bodega-loja-fisica/connectionreferences.mcs.yml +2 -2
  42. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/AvisoAntigo.topic.mcs.yml +12 -0
  43. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/ConsultarGuiaLojaFisica.topic.mcs.yml +3 -3
  44. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Escalate.topic.mcs.yml +1 -1
  45. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Fallback.topic.mcs.yml +5 -5
  46. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/Greeting.topic.mcs.yml +1 -1
  47. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/OnError.topic.mcs.yml +6 -6
  48. package/skills/cast-list/examples/agents/bodega-loja-fisica/topics/RecebimentoOrquestrador.topic.mcs.yml +1 -1
  49. package/skills/cast-list/examples/agents/bodega-loja-fisica/workflows/ListarLojas-3f2a9c1d/metadata.yml +3 -0
  50. package/skills/cast-list/examples/agents/bodega-loja-fisica/workflows/ListarLojas-3f2a9c1d/workflow.json +56 -0
  51. package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteCupons.mcs.yml +1 -1
  52. package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteFidelidade.mcs.yml +24 -0
  53. package/skills/cast-list/examples/agents/bodega-orquestrador/actions/AgenteFrete.mcs.yml +2 -14
  54. package/skills/cast-list/examples/agents/bodega-orquestrador/agent.mcs.yml +2 -0
  55. package/skills/cast-list/examples/agents/bodega-pedidos/actions/AbrirChamadoERP.mcs.yml +15 -0
  56. package/skills/cast-list/examples/agents/bodega-pedidos/actions/EnviarResumoPedido.mcs.yml +1 -1
  57. package/skills/cast-list/examples/agents/bodega-pedidos/agent.mcs.yml +10 -0
  58. package/skills/cast-list/examples/agents/bodega-pedidos/connectionreferences.mcs.yml +2 -2
  59. package/skills/cast-list/examples/agents/bodega-pedidos/topics/ConsultarPoliticasPedidos Copy.topic.mcs.yml +56 -0
  60. package/skills/cast-list/examples/agents/bodega-pedidos/topics/Escalate.topic.mcs.yml +5 -0
  61. package/skills/cast-list/examples/agents/bodega-pedidos/workflows/AbrirChamadoERP-7d1c2a4e/metadata.yml +3 -0
  62. package/skills/cast-list/examples/agents/bodega-pedidos/workflows/AbrirChamadoERP-7d1c2a4e/workflow.json +56 -0
  63. package/skills/cast-list/examples/profile.cast.yaml +28 -0
  64. package/skills/cast-list/references/format.md +30 -3
  65. package/skills/cast-list/references/keys.md +26 -0
  66. package/skills/cast-list/references/profile.md +35 -0
  67. package/skills/cast-list/scripts/build.mjs +6 -4
  68. package/skills/cast-list/scripts/engine.mjs +128 -124
@@ -8,13 +8,13 @@ beginDialog:
8
8
  priority: -1
9
9
  actions:
10
10
  - kind: ConditionGroup
11
- id: conditionGroup_ntofKN
11
+ id: conditionGroup_RZknOG
12
12
  conditions:
13
- - id: conditionItem_9l9haQ
13
+ - id: conditionItem_ouQR9I
14
14
  condition: =System.FallbackCount < 3
15
15
  actions:
16
16
  - kind: SendActivity
17
- id: sendMessage_luRZkn
17
+ id: sendMessage_HJE10P
18
18
  activity:
19
19
  text:
20
20
  - "Desculpe, não entendi. Pode reformular a sua pergunta?"
@@ -22,11 +22,11 @@ beginDialog:
22
22
 
23
23
  elseActions:
24
24
  - kind: SendActivity
25
- id: sendMessage_sI3CUS
25
+ id: sendMessage_ofKN9l
26
26
  activity:
27
27
  text:
28
28
  - "Estou com dificuldade para entender o seu pedido. Vou te encaminhar para alguém da equipe Bodega Azul."
29
29
 
30
30
  - kind: BeginDialog
31
- id: beginDialog_kw6sI2
31
+ id: beginDialog_9haQlu
32
32
  dialog: cr7b2_bodegaLojaFisica.topic.Escalate
@@ -7,7 +7,7 @@ beginDialog:
7
7
  id: main
8
8
  actions:
9
9
  - kind: SendActivity
10
- id: sendMessage_ygbWUz
10
+ id: sendMessage_6sI2nt
11
11
  activity:
12
12
  text:
13
13
  - "Olá! Eu sou o {System.Bot.Name}. Quer saber sobre a nossa loja física ou retirada de pedidos?"
@@ -8,18 +8,18 @@ beginDialog:
8
8
  id: main
9
9
  actions:
10
10
  - kind: SetVariable
11
- id: setVariable_9IHJE1
11
+ id: setVariable_Uv9BG8
12
12
  variable: init:Topic.CurrentTime
13
13
  value: =Text(Now(), DateTimeFormat.UTC)
14
14
 
15
15
  - kind: ConditionGroup
16
- id: conditionGroup_0PSyKa
16
+ id: conditionGroup_7OYQil
17
17
  conditions:
18
- - id: conditionItem_gbUv9B
18
+ - id: conditionItem_fzDk3T
19
19
  condition: =System.Conversation.InTestMode = true
20
20
  actions:
21
21
  - kind: SendActivity
22
- id: sendMessage_G87OYQ
22
+ id: sendMessage_HlIi9C
23
23
  activity: |-
24
24
  Mensagem de erro: {System.Error.Message}
25
25
  Código do erro: {System.Error.Code}
@@ -28,7 +28,7 @@ beginDialog:
28
28
 
29
29
  elseActions:
30
30
  - kind: SendActivity
31
- id: sendMessage_ilfzDk
31
+ id: sendMessage_dN6hXK
32
32
  activity:
33
33
  text:
34
34
  - |-
@@ -40,4 +40,4 @@ beginDialog:
40
40
  - Ocorreu um erro, por favor tente novamente.
41
41
 
42
42
  - kind: CancelAllDialogs
43
- id: cancelAllDialogs_3THlIi
43
+ id: cancelAllDialogs_zVC7En
@@ -8,7 +8,7 @@ beginDialog:
8
8
  id: main
9
9
  actions:
10
10
  - kind: SetVariable
11
- id: setVariable_9CdN6h
11
+ id: setVariable_qfPOHb
12
12
  variable: Global.CategoriaSolicitacao
13
13
  value: =System.Activity.Value.CategoriaSolicitacao
14
14
 
@@ -0,0 +1,3 @@
1
+ displayName: Listar lojas
2
+ workflowId: 3f2a9c1d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
3
+ jsonFileName: workflow.json
@@ -0,0 +1,56 @@
1
+ {
2
+ "properties": {
3
+ "displayName": "Listar lojas",
4
+ "connectionReferences": {},
5
+ "definition": {
6
+ "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
7
+ "contentVersion": "1.0.0.0",
8
+ "triggers": {
9
+ "manual": {
10
+ "type": "Request",
11
+ "kind": "Skills",
12
+ "inputs": {
13
+ "schema": {
14
+ "type": "object",
15
+ "properties": {
16
+ "resumo": {
17
+ "type": "string"
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+ },
24
+ "actions": {
25
+ "Listar": {
26
+ "type": "OpenApiConnection",
27
+ "inputs": {
28
+ "host": {
29
+ "apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
30
+ "connectionName": "shared_commondataserviceforapps",
31
+ "operationId": "ListRecords"
32
+ },
33
+ "parameters": {
34
+ "entityName": "lojas"
35
+ }
36
+ }
37
+ },
38
+ "Responder": {
39
+ "type": "Response",
40
+ "kind": "Skills",
41
+ "runAfter": {
42
+ "Listar": [
43
+ "Succeeded"
44
+ ]
45
+ },
46
+ "inputs": {
47
+ "statusCode": 200,
48
+ "body": {
49
+ "resultado": "@outputs('Resultado')"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
@@ -8,7 +8,7 @@ inputs:
8
8
  value: =Global.CategoriaSolicitacao
9
9
 
10
10
  modelDisplayName: Bodega Azul - Cupons
11
- modelDescription: "Agente especialista em cupons e promoções: validação de códigos, regras de uso e campanhas vigentes. Use quando a categoria for Cupons."
11
+ modelDescription: "Cupons."
12
12
  action:
13
13
  kind: InvokeConnectedAgentTaskAction
14
14
  inputType:
@@ -0,0 +1,24 @@
1
+ mcs.metadata:
2
+ componentName: Agente Fidelidade
3
+ description: Agente conectado Bodega Azul - Fidelidade.
4
+ kind: TaskDialog
5
+ inputs:
6
+ - kind: ManualTaskInput
7
+ propertyName: CategoriaSolicitacao
8
+ value: =Global.CategoriaSolicitacao
9
+
10
+ modelDisplayName: Bodega Azul - Fidelidade
11
+ modelDescription: "Agente especialista no programa de fidelidade: pontos, níveis e resgates. Use quando a categoria for Fidelidade."
12
+ action:
13
+ kind: InvokeConnectedAgentTaskAction
14
+ inputType:
15
+ properties:
16
+ CategoriaSolicitacao:
17
+ displayName: CategoriaSolicitacao
18
+ description: Categoria da solicitação definida pelo orquestrador.
19
+ isRequired: true
20
+ type: String
21
+
22
+ botSchemaName: cr7b2_bodegaFidelidade
23
+ historyType:
24
+ kind: ConversationHistory
@@ -2,23 +2,11 @@ mcs.metadata:
2
2
  componentName: Agente Frete
3
3
  description: Agente conectado Bodega Azul - Frete.
4
4
  kind: TaskDialog
5
- inputs:
6
- - kind: ManualTaskInput
7
- propertyName: CategoriaSolicitacao
8
- value: =Global.CategoriaSolicitacao
9
-
10
5
  modelDisplayName: Bodega Azul - Frete
11
6
  modelDescription: "Agente especialista em frete e entregas: modalidades, prazos por região e frete grátis. Use quando a categoria for Frete."
12
7
  action:
13
8
  kind: InvokeConnectedAgentTaskAction
14
- inputType:
15
- properties:
16
- CategoriaSolicitacao:
17
- displayName: CategoriaSolicitacao
18
- description: Categoria da solicitação definida pelo orquestrador.
19
- isRequired: true
20
- type: String
21
-
9
+ inputType: {}
22
10
  botSchemaName: cr7b2_bodegaFrete
23
11
  historyType:
24
- kind: ConversationHistory
12
+ kind: NoHistory
@@ -20,6 +20,8 @@ instructions: |
20
20
  Regras:
21
21
  - Responda sempre em português do Brasil, de forma cordial e objetiva
22
22
  - Se o cliente pedir para falar com uma pessoa, use o tópico de escalonamento
23
+
24
+ Não use emojis.
23
25
  conversationStarters:
24
26
  - title: "Meu pedido"
25
27
  text: "Onde está o meu pedido?"
@@ -0,0 +1,15 @@
1
+ mcs.metadata:
2
+ componentName: Abrir chamado no ERP
3
+ description: Abre um chamado no ERP da Bodega Azul pelo fluxo da solução.
4
+ kind: TaskDialog
5
+ inputs:
6
+ - kind: AutomaticTaskInput
7
+ propertyName: resumo
8
+ description: Resumo do pedido do cliente, em uma frase.
9
+ shouldPromptUser: false
10
+
11
+ modelDisplayName: Abrir chamado no ERP
12
+ modelDescription: Abre um chamado no ERP quando o cliente pede uma ação que a loja precisa executar (troca, cancelamento, reembolso).
13
+ action:
14
+ kind: InvokeFlowTaskAction
15
+ flowId: 7d1c2a4e-3b5f-4c6d-8e9f-0a1b2c3d4e5f
@@ -25,7 +25,7 @@ modelDisplayName: Enviar resumo do pedido por e-mail
25
25
  modelDescription: "Envia ao cliente, pelo Outlook, um e-mail com o resumo do atendimento sobre o pedido. Use somente quando o cliente pedir o resumo por e-mail."
26
26
  action:
27
27
  kind: InvokeConnectorTaskAction
28
- connectionReference: cr7b2_bodegaPedidos.shared_office365.shared-office365-1fd81bee-61e1-4016-a98e-c7e0977d7f43
28
+ connectionReference: cr7b2_bodegaPedidos.shared_office365.shared-office365-d1f6a460-51c5-47c6-9010-aec0018a7a95
29
29
  connectionProperties:
30
30
  mode: Maker
31
31
 
@@ -14,6 +14,16 @@ instructions: |
14
14
  - Responda sempre em português do Brasil, de forma curta e cordial
15
15
  - Nunca invente números de pedido, valores ou prazos
16
16
  - Se a dúvida for sobre devolução, frete, cupom ou loja física, diga que é outro especialista que cuida disso
17
+
18
+ Links:
19
+ - Formate links assim: [título](url), nunca a URL crua.
20
+ - Um link de ação vai no topo; o link da base de ajuda vai no fim.
21
+ - Nunca escreva as palavras «clique aqui».
22
+ - No máximo 3 links por resposta.
23
+
24
+ Responda em no máximo 3 bullets.
25
+
26
+ Não use emojis.
17
27
  conversationStarters:
18
28
  - title: "Status do pedido"
19
29
  text: "Como acompanho o meu pedido?"
@@ -1,6 +1,6 @@
1
1
  kind: ConnectionReferencesSourceFile
2
2
  connectionReferences:
3
- - id: eea3db2a-a0a9-4d63-b0d6-612861c4c67c
4
- connectionReferenceLogicalName: cr7b2_bodegaPedidos.shared_office365.shared-office365-1fd81bee-61e1-4016-a98e-c7e0977d7f43
3
+ - id: 940ab1fc-5949-4001-8ef4-63459ea972ff
4
+ connectionReferenceLogicalName: cr7b2_bodegaPedidos.shared_office365.shared-office365-d1f6a460-51c5-47c6-9010-aec0018a7a95
5
5
  connectorId: /providers/Microsoft.PowerApps/apis/shared_office365
6
6
  displayName: Office 365 Outlook
@@ -0,0 +1,56 @@
1
+ mcs.metadata:
2
+ componentName: Consultar Políticas de Pedidos Copy
3
+ description: "Responde dúvidas sobre pedidos com base nas políticas publicadas no SharePoint."
4
+ kind: AdaptiveDialog
5
+ inputs:
6
+ - kind: AutomaticTaskInput
7
+ propertyName: PerguntaCliente
8
+ description: "A pergunta do cliente sobre pedidos, status, cancelamento ou pagamento."
9
+ shouldPromptUser: true
10
+
11
+ modelDescription: "Responde perguntas sobre status de pedido, prazos de processamento, cancelamento antes do envio e formas de pagamento da Bodega Azul."
12
+ beginDialog:
13
+ kind: OnRecognizedIntent
14
+ id: main
15
+ intent: {}
16
+ actions:
17
+ - kind: CreateSearchQuery
18
+ id: createSearchQuery_LQyhy8
19
+ userInput: =Topic.PerguntaCliente
20
+ result: Topic.SearchQuery
21
+
22
+ - kind: SearchAndSummarizeContent
23
+ id: searchContent_O7ySob
24
+ autoSend: false
25
+ variable: Topic.SearchResult
26
+ userInput: =Topic.SearchQuery.SearchQuery
27
+ fileSearchDataSource:
28
+ searchFilesMode:
29
+ kind: DoNotSearchFiles
30
+
31
+ knowledgeSources:
32
+ kind: SearchSpecificKnowledgeSources
33
+ knowledgeSources:
34
+ - cr7b2_bodegaPedidos.knowledge.PoliticasPedidos
35
+
36
+ applyModelKnowledgeSetting: false
37
+ responseCaptureType: FullResponse
38
+
39
+ - kind: SetVariable
40
+ id: setVariable_f4lXT8
41
+ variable: Topic.Resposta
42
+ value: =Topic.SearchResult.Text.Content
43
+
44
+ inputType:
45
+ properties:
46
+ PerguntaCliente:
47
+ displayName: PerguntaCliente
48
+ description: "A pergunta do cliente sobre pedidos, status, cancelamento ou pagamento."
49
+ type: String
50
+
51
+ outputType:
52
+ properties:
53
+ Resposta:
54
+ displayName: Resposta
55
+ description: Resposta fundamentada na base de conhecimento do agente.
56
+ type: String
@@ -18,3 +18,8 @@ beginDialog:
18
18
  - kind: SendActivity
19
19
  id: sendMessage_X7qDFG
20
20
  activity: "A transferência para um atendente ainda não está disponível neste canal. Fale com a nossa equipe pelo e-mail pedidos@bodegaazul.example, de segunda a sábado, das 9h às 18h."
21
+
22
+ - kind: SendActivity
23
+ id: sendMessage_kDOncS
24
+ disabled: true
25
+ activity: "Aguarde, estamos transferindo você para um atendente."
@@ -0,0 +1,3 @@
1
+ displayName: Abrir chamado no ERP
2
+ workflowId: 7d1c2a4e-3b5f-4c6d-8e9f-0a1b2c3d4e5f
3
+ jsonFileName: workflow.json
@@ -0,0 +1,56 @@
1
+ {
2
+ "properties": {
3
+ "displayName": "Abrir chamado no ERP",
4
+ "connectionReferences": {},
5
+ "definition": {
6
+ "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
7
+ "contentVersion": "1.0.0.0",
8
+ "triggers": {
9
+ "manual": {
10
+ "type": "Request",
11
+ "kind": "Skills",
12
+ "inputs": {
13
+ "schema": {
14
+ "type": "object",
15
+ "properties": {
16
+ "resumo": {
17
+ "type": "string"
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+ },
24
+ "actions": {
25
+ "Abrir_chamado": {
26
+ "type": "Scope",
27
+ "actions": {
28
+ "Chamar_ERP": {
29
+ "type": "Http",
30
+ "inputs": {
31
+ "method": "POST",
32
+ "uri": "https://erp.bodega-azul.example/chamados",
33
+ "body": "@triggerBody()"
34
+ }
35
+ }
36
+ }
37
+ },
38
+ "Responder": {
39
+ "type": "Response",
40
+ "kind": "Skills",
41
+ "runAfter": {
42
+ "Abrir_chamado": [
43
+ "Succeeded"
44
+ ]
45
+ },
46
+ "inputs": {
47
+ "statusCode": 200,
48
+ "body": {
49
+ "resultado": "@outputs('Resultado')"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
@@ -9,6 +9,34 @@ min_agents: 3 # …with at least 3 agents in that role
9
9
  rules:
10
10
  - { id: escala, role: specialist, has: "trigger:OnEscalate", says: "Todo especialista escala para humano" }
11
11
  - { id: kpi, role: specialist, has: "declared:kpi", says: "Todo especialista tem KPI" }
12
+ # what the text says against how the agent is set up
13
+ - { id: knowledge-only, when: "text:knowledge-only", not: "setting:model-knowledge=on",
14
+ says: "Quem pede só o conhecimento tem o conhecimento geral desligado" }
15
+
16
+ # what to look for in the text (JavaScript regular expressions; case does not matter)
17
+ markers:
18
+ - { id: size, name: Tamanho da resposta, in: instructions,
19
+ pattern: '(no máximo|at most|up to)\s*(\d+)\s*(bullets?|frases?|sentences?)', value: "$2 $3" }
20
+ - { id: no-emoji, name: Sem emojis, pattern: '(sem|não use|no)\s+emojis?' }
21
+ - { id: knowledge-only, name: Só o conhecimento, pattern: '(somente|apenas|only)[^.]{0,40}(conhecimento|knowledge)' }
22
+
23
+ # the block the team pastes in every specialist
24
+ blocks:
25
+ - id: links
26
+ name: Formatação de links
27
+ text: |
28
+ Links:
29
+ - Formate links assim: [título](url), nunca a URL crua.
30
+ - Um link de ação vai no topo; o link da base de ajuda vai no fim.
31
+ - Nunca escreva as palavras «clique aqui».
32
+ - No máximo 3 links por resposta.
33
+
34
+ # the kinds of specialist: one may be of two types; patterns are also found within each type
35
+ types:
36
+ - { id: transaction, name: transação, when: { any: ["flow:*"] } }
37
+ - { id: guidance, name: orientação, when: { all: ["text:link-domain:*", "node:SearchAndSummarizeContent"] } }
38
+ - { id: triage, name: triagem, when: { any: ["trigger:OnSelectIntent"] } }
39
+
12
40
  focus_areas:
13
41
  - { id: confiabilidade, name: Confiabilidade, facts: ["trigger:OnError", "node:LogCustomTelemetryEvent", "ms:rai-error-handling"] }
14
42
  ignore: ["trigger:OnConversationStart"]
@@ -11,7 +11,12 @@ format: cast-list/cast-v1
11
11
  name: Customer service agents
12
12
  agents: # the roles of the last run (an agent the profile does not name keeps its role here)
13
13
  - { id: main-orchestrator, role: orchestrator }
14
- - { id: returns, role: specialist }
14
+ - { id: returns, role: specialist, types: [ transaction ] } # types a person gives win over the profile's
15
+ blocks: # the blocks of text of the last run, so a block keeps its id across small edits
16
+ - id: links
17
+ text: |
18
+ Links:
19
+ - Format links as [title](url), never the bare URL.
15
20
  declared: # what a document or a person says — always with its source
16
21
  - { agent: returns, key: kpi, value: "time to answer < 2 min", source: "backlog, epic 12" }
17
22
  - { agent: shipping, key: "trigger:OnEscalate", value: "yes", source: "handoff, section 4" }
@@ -19,11 +24,13 @@ decisions: # what the team decided about a pattern
19
24
  - { key: "trigger:OnEscalate", status: accepted, scope: platform, why: "Nobody is left without a person" }
20
25
  ```
21
26
 
27
+ - **blocks** and the roles are written by the run; **types** are written only by a person (the ones the profile works
28
+ out are not kept, so a change in the profile still holds).
22
29
  - **declared**: `key` is either something only people know (`kpi`, `owner`, any word: it becomes `declared:<key>`) or a
23
30
  fact key (`trigger:OnEscalate`, `references/keys.md`) when a document claims the agent does it. `value` `no` / `não` /
24
31
  `false` claims it does **not**. A claim never changes what the YAML shows: when they disagree, it is a conflict.
25
- - **decisions**: `status` is `accepted` or `rejected`; `scope` is `platform` (every agent), `specialist` or
26
- `orchestrator`; `why` says it. An accepted pattern is checked on every agent of its scope on the next run — even when
32
+ - **decisions**: `status` is `accepted` or `rejected`; `scope` is `platform` (every agent), `specialist`,
33
+ `orchestrator` or `type:<id>` (the specialists of a type — «tipo:<name>» in the workbook); `why` says it. An accepted pattern is checked on every agent of its scope on the next run — even when
27
34
  its share would no longer make it a pattern. A rejected one is shown and nobody is off it.
28
35
 
29
36
  ## The workbook back
@@ -48,3 +55,23 @@ A line deleted or a decision cleared is a change too.
48
55
  "facts": { "trigger:OnUnknownIntent": [ { "file": "topics/Fallback.topic.mcs.yml", "line": 7 } ] },
49
56
  "children": [], "unknown": [] } ] }
50
57
  ```
58
+
59
+ An orchestrator's agent also has `contract` — a line per connected-agent action: `calls` (the schema name it calls),
60
+ `name` (the action's name for it), `history` (it passes the conversation history), `inputs`, `description` (the
61
+ routing description), `file` and `line` — and every agent has `flows`: `id` (the `workflowId`), `name`, `folder`,
62
+ `uses` (`http:<host>`, `connector:<api>`, `operation:<api>/<op>`, `child-flow`), `returns`, `called` and `file`.
63
+
64
+ ## The facts of the contract, the flows and what nobody uses
65
+
66
+ | Key | On which agent | From |
67
+ |---|---|---|
68
+ | `called-with:history` | the one called | the orchestrator's action has `historyType: ConversationHistory` |
69
+ | `called-with:input:<name>` | the one called | each input the orchestrator's action passes |
70
+ | `routing:described` | the one called | the action has a `modelDescription` |
71
+ | `flow-uses:http:<host>`, `flow-uses:connector:<api>`, `flow-uses:operation:<api>/<op>`, `flow-uses:child-flow` | the one whose node calls the flow | the actions of `workflow.json`, at any depth |
72
+ | `flow-returns` | the same | the flow has a `Response` action |
73
+ | `orphan:topic:<name>`, `orphan:action:<name>`, `orphan:variable:<name>`, `orphan:flow:<name>` | the one that has it | nothing can reach it (see SKILL.md, step 2) |
74
+ | `disabled:node:<kind>`, `disabled:<topic\|action\|variable\|knowledge>:<name>` | the one that has it | `disabled: true` on a node; `state` or `status: Inactive` on a component |
75
+
76
+ The contract's facts cite the orchestrator's file (`<orchestrator>/actions/X.mcs.yml`). `orphan:` and `disabled:` are
77
+ never a pattern nor a solo, and what an unused flow calls is not a fact.
@@ -30,6 +30,11 @@ Every fact cast-list finds is a key. The keys below have a name; any other key k
30
30
 
31
31
  | Key | Name | Nome |
32
32
  |---|---|---|
33
+ | `flow-returns` | The flow returns an answer | O fluxo devolve uma resposta |
34
+ | `flow-uses:child-flow` | The flow calls another flow | O fluxo chama outro fluxo |
35
+ | `flow-uses:http:<value>` | Flow calls <value> | Fluxo chama <valor> |
36
+ | `flow-uses:connector:<value>` | Flow uses the connector <value> | Fluxo usa o conector <valor> |
37
+ | `flow-uses:operation:<value>` | Flow uses the operation <value> | Fluxo usa a operação <valor> |
33
38
  | `connector:<value>` | Connector <value> | Conector <valor> |
34
39
  | `operation:<value>` | Operation <value> | Operação <valor> |
35
40
  | `connref:<value>` | Connection reference <value> | Referência de conexão <valor> |
@@ -41,6 +46,10 @@ Every fact cast-list finds is a key. The keys below have a name; any other key k
41
46
  | Key | Name | Nome |
42
47
  |---|---|---|
43
48
  | `trigger:OnKnowledgeRequested` | Before searching knowledge | Antes de buscar no conhecimento |
49
+ | `setting:semantic-search=on` | Semantic search on | Busca semântica ligada |
50
+ | `setting:semantic-search=off` | Semantic search off | Busca semântica desligada |
51
+ | `setting:web-browsing=on` | Web browsing on | Navegação na web ligada |
52
+ | `setting:web-browsing=off` | Web browsing off | Navegação na web desligada |
44
53
  | `node:SearchAndSummarizeContent` | Generative answers from knowledge | Respostas generativas sobre o conhecimento |
45
54
  | `node:SearchKnowledgeSources` | Searches the knowledge sources | Busca nas fontes de conhecimento |
46
55
  | `yaml-only:triggerCondition` | Search condition only in YAML (the editor may erase it) | Condição de busca só no YAML (a tela pode apagar) |
@@ -54,6 +63,9 @@ Every fact cast-list finds is a key. The keys below have a name; any other key k
54
63
  | `trigger:OnRedirect` | Takes a call from the orchestrator | Recebe chamada do orquestrador |
55
64
  | `trigger:OnToolSelected` | Child chosen as a tool | Filho escolhido como ferramenta |
56
65
  | `setting:connectable` | Can be called by an orchestrator | Pode ser chamado por um orquestrador |
66
+ | `called-with:history` | Receives the conversation history | Recebe o histórico da conversa |
67
+ | `routing:described` | Has a routing description | Tem descrição de roteamento |
68
+ | `called-with:input:<value>` | Receives <value> from the orchestrator <value> | Recebe <valor> do orquestrador <valor> |
57
69
  | `calls:<value>` | Calls <value> | Chama <valor> |
58
70
  | `child:<value>` | Child <value> | Filho <valor> |
59
71
  | `var-in:<value>` | Receives from the orchestrator <value> | Recebe do orquestrador <valor> |
@@ -63,13 +75,27 @@ Every fact cast-list finds is a key. The keys below have a name; any other key k
63
75
 
64
76
  | Key | Name | Nome |
65
77
  |---|---|---|
78
+ | `setting:model-knowledge=on` | The model's general knowledge on | Conhecimento geral do modelo ligado |
79
+ | `setting:model-knowledge=off` | The model's general knowledge off | Conhecimento geral do modelo desligado |
66
80
  | `instructions:present` | Has instructions | Tem instruções |
67
81
  | `node:LogCustomTelemetryEvent` | Logs telemetry | Registra telemetria |
68
82
  | `node:CSATQuestion` | Asks for satisfaction (CSAT) | Pergunta a satisfação (CSAT) |
83
+ | `orphan:topic:<value>` | Topic nobody calls <value> | Tópico que ninguém chama <valor> |
84
+ | `orphan:action:<value>` | Tool nobody can choose <value> | Ferramenta que ninguém escolhe <valor> |
85
+ | `orphan:variable:<value>` | Variable nobody uses <value> | Variável que ninguém usa <valor> |
86
+ | `orphan:flow:<value>` | Flow nobody calls <value> | Fluxo que ninguém chama <valor> |
87
+ | `disabled:node:<value>` | Switched-off node <value> | Nó desligado <valor> |
88
+ | `disabled:<value>` | Switched off <value> | Desligado <valor> |
69
89
  | `node:<value>` | Node <value> | Nó <valor> |
70
90
  | `model:<value>` | Model <value> | Modelo <valor> |
71
91
  | `auth:<value>` | Sign-in <value> | Login <valor> |
72
92
 
93
+ ## F. Text — F. Texto
94
+
95
+ | Key | Name | Nome |
96
+ |---|---|---|
97
+ | `text:<value>` | Text: <value> | Texto: <valor> |
98
+
73
99
  ## Microsoft patterns — Padrões Microsoft
74
100
 
75
101
  | Key | Name | Nome |
@@ -29,4 +29,39 @@ microsoft_patterns: on # off leaves the ms: facts out
29
29
  | `focus_areas` | none | Each a filter of the matrix. |
30
30
  | `ignore` | none | Keys that say nothing for this team. |
31
31
 
32
+ ## What to look for in the text, and the types
33
+
34
+ ```yaml
35
+ rules:
36
+ # a condition and a «not»: the text says one thing, the setup another
37
+ - { id: knowledge-only, when: "text:knowledge-only", not: "setting:model-knowledge=on",
38
+ says: "Who asks for the knowledge alone has the model's general knowledge off" }
39
+ markers: # JavaScript regular expressions; case does not matter
40
+ - { id: size, name: Answer size, in: instructions,
41
+ pattern: '(at most|up to|no máximo)\s*(\d+)\s*(bullets?|sentences?|frases?)', value: "$2 $3" }
42
+ - { id: no-emoji, name: No emojis, pattern: '(no|never use|sem)\s+emojis?' }
43
+ - { id: knowledge-only, name: Knowledge only, pattern: '(only|somente)[^.]{0,40}(knowledge|conhecimento)' }
44
+ blocks: # the text the team pastes in every agent of a role
45
+ - id: links
46
+ name: Link formatting
47
+ role: specialist # the default
48
+ text: |
49
+ Links:
50
+ - Format links as [title](url), never the bare URL.
51
+ types: # a specialist gets every type whose «when» its facts match
52
+ - { id: transaction, name: transaction, when: { any: ["flow:*"] } }
53
+ - { id: guidance, name: guidance, when: { all: ["text:link-domain:*", "node:SearchAndSummarizeContent"], none: ["flow:*"] }, min_agents: 2 }
54
+ ```
55
+
56
+ | Field | What it does |
57
+ |---|---|
58
+ | `rules[].when` / `has` / `not` | A rule is for the agents (of its `role`, or all) that have every key of `when`; it is broken when one lacks `has`, or has `not`. A key may end in `*`. A broken `not` rule is said as a contradiction. |
59
+ | `markers` | `in`: `instructions` (the default), `descriptions` (what topics and actions tell the model) or `all`. With no `value`: a fact `text:<id>`. With a `value` (`$1`…`$9` from the regex): `text:<id>=<value>` — agents of a role that set it in different ways are told («unify?»), and one that sets it twice («which one holds?»). Two are built in: `text:link-domain:<host>` for each link in the instructions, `text:email`. In YAML, write a regex in single quotes. |
60
+ | `blocks` | The official text. The family of blocks like it (half of it, at least) takes its id and name; every agent of `role` without it, or with a variation, is off it — with or without a majority. With no `blocks`, the blocks two agents or more share are still found, named by their first words. |
61
+ | `types` | `when` with `all`, `any` (one of), `none`. A specialist may be of two types; the cast file's `types` for an agent win. Patterns are found within each type with its `min_agents` (2 unless said), scope `type:<id>`; a pattern of a type never blames who is not of it. A type with fewer agents is told, and compared in nothing. |
62
+
63
+ A key in `when`, `has`, `not` or a type must start like a real kind of key (`references/keys.md`): a typo is
64
+ `✗ profile:line`, as is a regex that does not compile, an unknown `in`, a type with no `when`, or a rule with
65
+ nothing to check.
66
+
32
67
  The keys are the same in any language; only the screen words change with `--lang`.
@@ -82,11 +82,11 @@ const profile = option('--profile') ? read(resolve(option('--profile')), readPro
82
82
  const out = resolve(option('--out') ?? dirname(folder))
83
83
  const castFile = join(out, `${id}.cast.yaml`)
84
84
  const castText = existsSync(castFile) ? readFileSync(castFile, 'utf8') : undefined
85
- const cast = castText !== undefined ? read(castFile, readCast).cast : { ...(profile.name ? { name: profile.name } : {}), agents: [], declared: [], decisions: [] }
85
+ const cast = castText !== undefined ? read(castFile, readCast).cast : { ...(profile.name ? { name: profile.name } : {}), agents: [], blocks: [], declared: [], decisions: [] }
86
86
 
87
87
  // ---- the way back: an edited workbook as the changes it proposes ----
88
88
  if (argv.includes('--from')) {
89
- const edited = fromSheets(cast, readXlsx(readFileSync(resolve(option('--from')))))
89
+ const edited = fromSheets(cast, readXlsx(readFileSync(resolve(option('--from')))), Object.fromEntries(profile.types.map((t) => [t.id, t.name])))
90
90
  if (edited.problems.length) {
91
91
  for (const p of edited.problems) console.error(`✗ ${basename(option('--from'))}: ${p}`)
92
92
  process.exit(1)
@@ -145,8 +145,10 @@ const all = argv.includes('--all')
145
145
  const want = { html: all || argv.includes('--html'), xlsx: all || argv.includes('--xlsx'), lesson: all || argv.includes('--lesson') }
146
146
  if (!want.xlsx && !want.lesson) want.html = true
147
147
  mkdirSync(out, { recursive: true })
148
- // the cast file keeps this run's roles, under what people wrote in it
149
- const kept = { ...cast, agents: result.agents.map((a) => ({ id: a.id, role: a.role })) }
148
+ // the cast file keeps this run's roles and blocks of text (so a block keeps its id across small edits), under what
149
+ // people wrote in it; the types a person gave an agent stay, the ones the profile works out are not written
150
+ const givenTypes = Object.fromEntries(cast.agents.filter((a) => a.types?.length).map((a) => [a.id, a.types]))
151
+ const kept = { ...cast, agents: result.agents.map((a) => ({ id: a.id, role: a.role, ...(givenTypes[a.id] ? { types: givenTypes[a.id] } : {}) })), blocks: result.blocks.map((b) => ({ id: b.id, text: b.text })) }
150
152
  const castYaml = writeCast(kept, castText)
151
153
  writeFileSync(castFile, castYaml)
152
154
  console.log(`✓ cast ${castFile}`)