@winning-sales/nexo 0.7.1 → 0.9.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.
@@ -0,0 +1,61 @@
1
+ import { contextAdd, contextConfirm, contextRemove, contextSet, contextShow } from './commands/context-company.js';
2
+ const BLOCK_HELP = 'empresa, icp, persona, proposta_de_valor, posicionamento, oferta ou prova';
3
+ const WRITE_NOTE = 'Só admin, com o escopo context:write, que precisa ser pedido pelo nome no login (nexo login --scopes <os que você usa>,context:write)';
4
+ function addWriteOptions(command, withValue) {
5
+ if (withValue) {
6
+ command.option('--value-json', 'o valor é JSON (objeto, lista, número); sem isso é texto');
7
+ }
8
+ return command
9
+ .option('--change-confirmed', 'confirma que quer mudar um bloco que a empresa já confirmou')
10
+ .option('-y, --yes', 'grava logo depois de mostrar a prévia');
11
+ }
12
+ function addValueCommands(group, context) {
13
+ addWriteOptions(group
14
+ .command('set')
15
+ .description(`Muda um campo, com a prévia de antes e depois e o sim. ${WRITE_NOTE}`)
16
+ .argument('<bloco>', BLOCK_HELP)
17
+ .argument('<campo>', 'caminho do campo, como offerings.0.whatItIs (veja `nexo context show`)')
18
+ .argument('<valor>', 'o texto novo inteiro'), true).action(async (block, field, value, _options, command) => {
19
+ await contextSet(context, block, field, value, command.optsWithGlobals());
20
+ });
21
+ addWriteOptions(group
22
+ .command('add')
23
+ .description(`Soma um item a uma lista, com a prévia e o sim. ${WRITE_NOTE}`)
24
+ .argument('<bloco>', BLOCK_HELP)
25
+ .argument('<lista>', 'caminho da lista, como offerings')
26
+ .argument('<valor>', 'o item: um texto, ou com --value-json o objeto inteiro'), true).action(async (block, field, value, _options, command) => {
27
+ await contextAdd(context, block, field, value, command.optsWithGlobals());
28
+ });
29
+ }
30
+ function addRemoveCommands(group, context) {
31
+ addWriteOptions(group
32
+ .command('remove')
33
+ .description(`Tira um item de uma lista, com a prévia e o sim. ${WRITE_NOTE}`)
34
+ .argument('<bloco>', BLOCK_HELP)
35
+ .argument('<lista>', 'caminho da lista, como offerings')
36
+ .argument('[item]', 'o texto exato do item (para uma posição, use --index)')
37
+ .option('--index <n>', 'a posição do item na lista, a partir de 0, no lugar do texto'), false).action(async (block, field, item, _options, command) => {
38
+ await contextRemove(context, block, field, item, command.optsWithGlobals());
39
+ });
40
+ addWriteOptions(group
41
+ .command('confirm')
42
+ .description(`Confirma o rascunho de um bloco como está, com a prévia e o sim. ${WRITE_NOTE}`)
43
+ .argument('<bloco>', BLOCK_HELP), false).action(async (block, _options, command) => {
44
+ await contextConfirm(context, block, command.optsWithGlobals());
45
+ });
46
+ }
47
+ export function addContextCommands(program, context) {
48
+ const group = program
49
+ .command('context')
50
+ .alias('contexto')
51
+ .description('O contexto da empresa (empresa, ICP, persona, proposta de valor, posicionamento, oferta e prova): ler e editar');
52
+ group
53
+ .command('show', { isDefault: true })
54
+ .description('Lê o contexto, bloco por bloco, com a origem de cada campo (precisa de context:read)')
55
+ .argument('[bloco]', `só um bloco: ${BLOCK_HELP}`)
56
+ .action(async (block, _options, command) => {
57
+ await contextShow(context, block, command.optsWithGlobals());
58
+ });
59
+ addValueCommands(group, context);
60
+ addRemoveCommands(group, context);
61
+ }
@@ -0,0 +1,130 @@
1
+ import { itemsCreate, itemsEdit, itemsList, itemsMove, itemsRemove, itemsResolve, itemsSwitch, themesCreate, themesList, themesRemove, themesRename } from './commands/knowledge.js';
2
+ const TYPE_HELP = 'rule, practice, product_fact, price, proof ou standard';
3
+ function addItemReads(items, context) {
4
+ items
5
+ .command('list')
6
+ .description('Lista os itens, com o tema de cada um')
7
+ .option('--type <tipo>', `só os itens deste tipo (${TYPE_HELP})`)
8
+ .option('--theme <id>', 'só os itens deste tema (a CLI percorre as páginas e filtra)')
9
+ .option('--needs-you', 'só os pendentes')
10
+ .option('--page <n>', 'a página')
11
+ .option('--page-size <n>', 'itens por página (até 100)')
12
+ .action(async (_options, command) => {
13
+ await itemsList(context, command.optsWithGlobals());
14
+ });
15
+ }
16
+ function withRuleOptions(command) {
17
+ return command
18
+ .option('--subject <assunto>', 'campos da regra (type rule): discount, minimum_price, deadline, payment_terms, integration, scope ou implementation')
19
+ .option('--condition <texto>', 'regra: a condição que ativa')
20
+ .option('--limit <texto>', 'regra: o valor do limite')
21
+ .option('--exception <texto>', 'regra: a exceção conhecida')
22
+ .option('--approver <texto>', 'regra: quem aprova a exceção');
23
+ }
24
+ function addItemCreateEdit(items, context) {
25
+ withRuleOptions(items
26
+ .command('create')
27
+ .description('Escreve um item à mão; entra em uso na hora')
28
+ .option('--type <tipo>', TYPE_HELP)
29
+ .option('--text <texto>', 'o texto curto do item')
30
+ .option('--theme <id>', 'o tema do item (sem ele, o tema padrão)')).action(async (_options, command) => {
31
+ await itemsCreate(context, command.optsWithGlobals());
32
+ });
33
+ withRuleOptions(items
34
+ .command('edit')
35
+ .description('Edita um item: texto, tipo, tema ou campos da regra')
36
+ .argument('<item>', 'id do item')
37
+ .option('--text <texto>', 'o texto novo')
38
+ .option('--type <tipo>', `o tipo novo (${TYPE_HELP})`)
39
+ .option('--theme <id>', 'o tema novo (nexo knowledge themes list)')).action(async (itemId, _options, command) => {
40
+ await itemsEdit(context, itemId, command.optsWithGlobals());
41
+ });
42
+ }
43
+ function addItemStates(items, context) {
44
+ for (const on of [true, false]) {
45
+ items
46
+ .command(on ? 'on' : 'off')
47
+ .description(on ? 'Liga um item desligado: volta a ficar em uso' : 'Desliga um item: sai de uso, sem apagar')
48
+ .argument('<item>', 'id do item')
49
+ .action(async (itemId, _options, command) => {
50
+ await itemsSwitch(context, itemId, on, command.optsWithGlobals());
51
+ });
52
+ }
53
+ items
54
+ .command('resolve')
55
+ .description('Resolve uma pendência: choose (este lado do conflito), approve (aprova a prova), use (aceita como está), rewrite, discard')
56
+ .argument('<item>', 'id do item')
57
+ .option('--action <ação>', 'choose, approve, use, rewrite ou discard')
58
+ .option('--text <texto>', 'o texto novo (só com rewrite)')
59
+ .option('-y, --yes', 'descarta sem perguntar (só depois do sim da pessoa)')
60
+ .action(async (itemId, _options, command) => {
61
+ await itemsResolve(context, itemId, command.optsWithGlobals());
62
+ });
63
+ items
64
+ .command('remove')
65
+ .description('Remove um item de vez; para tirar de uso por um tempo, use off')
66
+ .argument('<item>', 'id do item')
67
+ .option('-y, --yes', 'remove sem perguntar (só depois do sim da pessoa)')
68
+ .action(async (itemId, _options, command) => {
69
+ await itemsRemove(context, itemId, command.optsWithGlobals());
70
+ });
71
+ }
72
+ function addItemWrites(items, context) {
73
+ addItemCreateEdit(items, context);
74
+ addItemStates(items, context);
75
+ items
76
+ .command('move')
77
+ .description('Move até 100 itens para um tema; um id que não existe recusa tudo')
78
+ .argument('<item...>', 'ids dos itens')
79
+ .option('--theme <id>', 'o tema de destino')
80
+ .action(async (itemIds, _options, command) => {
81
+ await itemsMove(context, itemIds, command.optsWithGlobals());
82
+ });
83
+ }
84
+ function addThemeCommands(knowledge, context) {
85
+ const themes = knowledge.command('themes').description('Os temas da Base');
86
+ themes
87
+ .command('list')
88
+ .description('Lista os temas, com o que cada um guarda')
89
+ .action(async (_options, command) => {
90
+ await themesList(context, command.optsWithGlobals());
91
+ });
92
+ themes
93
+ .command('create')
94
+ .description('Cria um tema')
95
+ .argument('<nome>', 'o nome do tema')
96
+ .action(async (name, _options, command) => {
97
+ await themesCreate(context, name, command.optsWithGlobals());
98
+ });
99
+ themes
100
+ .command('rename')
101
+ .description('Renomeia um tema')
102
+ .argument('<tema>', 'id do tema')
103
+ .argument('<nome>', 'o nome novo')
104
+ .action(async (themeId, name, _options, command) => {
105
+ await themesRename(context, themeId, name, command.optsWithGlobals());
106
+ });
107
+ themes
108
+ .command('remove')
109
+ .description('Apaga um tema vazio (com conteúdo, a API recusa com 409)')
110
+ .argument('<tema>', 'id do tema')
111
+ .option('-y, --yes', 'apaga sem perguntar (só depois do sim da pessoa)')
112
+ .action(async (themeId, _options, command) => {
113
+ await themesRemove(context, themeId, command.optsWithGlobals());
114
+ });
115
+ }
116
+ function addItemCommands(knowledge, context) {
117
+ const items = knowledge
118
+ .command('items')
119
+ .description('Os itens da Base: lista, cria, edita (texto, tipo, tema) e move de tema');
120
+ addItemReads(items, context);
121
+ addItemWrites(items, context);
122
+ }
123
+ export function addKnowledgeCommands(program, context) {
124
+ const knowledge = program
125
+ .command('knowledge')
126
+ .alias('base')
127
+ .description('A Base de conhecimento: itens e temas. Só admin, com o escopo calibration:write para escrever');
128
+ addItemCommands(knowledge, context);
129
+ addThemeCommands(knowledge, context);
130
+ }
package/dist/program.js CHANGED
@@ -9,7 +9,10 @@ import { addDocumentCommands } from './program-documents.js';
9
9
  import { addArtifactCommands, addDealCommands } from './program-artifacts.js';
10
10
  import { addTemplateCommands } from './program-templates.js';
11
11
  import { addBrainCommands } from './program-brain.js';
12
+ import { addKnowledgeCommands } from './program-knowledge.js';
12
13
  import { addErpCommands } from './program-erp.js';
14
+ import { addAgentCommands } from './program-agents.js';
15
+ import { addContextCommands } from './program-context.js';
13
16
  import { addDashboardCommands } from './program-dashboards.js';
14
17
  import { skillsInstall, skillsList, skillsShow } from './commands/skills.js';
15
18
  import { login } from './commands/login.js';
@@ -164,6 +167,11 @@ function addBillingCommands(program, context) {
164
167
  await billingInvoices(context, id, command.optsWithGlobals());
165
168
  });
166
169
  }
170
+ function addCompanyBrainCommands(program, context) {
171
+ addBrainCommands(program, context);
172
+ addKnowledgeCommands(program, context);
173
+ addContextCommands(program, context);
174
+ }
167
175
  export function buildProgram(context) {
168
176
  const program = new Command('nexo')
169
177
  .description('CLI do Nexo: a API, o Connect, os dashboards, os fluxos, os documentos e as análises no terminal')
@@ -191,7 +199,8 @@ export function buildProgram(context) {
191
199
  addDealCommands(program, context);
192
200
  addArtifactCommands(program, context);
193
201
  addTemplateCommands(program, context);
194
- addBrainCommands(program, context);
202
+ addCompanyBrainCommands(program, context);
195
203
  addErpCommands(program, context);
204
+ addAgentCommands(program, context);
196
205
  return program;
197
206
  }
@@ -34,6 +34,9 @@ export const TOOL_KEYS = [
34
34
  'analyses',
35
35
  'analysis_change',
36
36
  'app_guide',
37
+ 'attendance_agent',
38
+ 'attendance_agent_preview',
39
+ 'attendance_agent_save',
37
40
  'automation_apply',
38
41
  'automation_change',
39
42
  'automations',
@@ -72,6 +75,7 @@ export const TOOL_KEYS = [
72
75
  'connectors_list',
73
76
  'connector_version_diff',
74
77
  'connector_version_write',
78
+ 'connector_webhook_deliveries',
75
79
  'connect_sdk',
76
80
  'connect_systems',
77
81
  'contact_change',
@@ -124,6 +128,9 @@ export const TOOL_KEYS = [
124
128
  'knowledge_search',
125
129
  'lead_change',
126
130
  'meeting_change',
131
+ 'meeting_hours',
132
+ 'meeting_hours_preview',
133
+ 'meeting_hours_save',
127
134
  'meeting_prep',
128
135
  'meeting_scorecard_change',
129
136
  'meeting_summary',
@@ -158,6 +165,10 @@ export const COMMAND_TOOLS = {
158
165
  'nexo docs list': { none: 'Documentação embutida na CLI' },
159
166
  'nexo docs search': { none: 'Documentação embutida na CLI' },
160
167
  'nexo docs show': { none: 'Documentação embutida na CLI' },
168
+ 'nexo agents': { key: 'attendance_agent' },
169
+ 'nexo agents show': { key: 'attendance_agent' },
170
+ 'nexo agents set': { key: ['attendance_agent', 'attendance_agent_preview', 'attendance_agent_save'] },
171
+ 'nexo agents hours': { key: ['meeting_hours', 'meeting_hours_preview', 'meeting_hours_save'] },
161
172
  'nexo brain areas': { none: 'Skills do Cérebro pela ideia, em /v1/brain; ainda sem chave de ferramenta no produto' },
162
173
  'nexo brain moments': { none: 'Skills do Cérebro pela ideia, em /v1/brain; ainda sem chave de ferramenta no produto' },
163
174
  'nexo brain list': { none: 'Skills do Cérebro pela ideia, em /v1/brain; ainda sem chave de ferramenta no produto' },
@@ -168,6 +179,18 @@ export const COMMAND_TOOLS = {
168
179
  'nexo brain from-template': { none: 'Skills do Cérebro pela ideia, em /v1/brain; ainda sem chave de ferramenta no produto' },
169
180
  'nexo brain blind-test': { none: 'Skills do Cérebro pela ideia, em /v1/brain; ainda sem chave de ferramenta no produto' },
170
181
  'nexo brain choose': { none: 'Skills do Cérebro pela ideia, em /v1/brain; ainda sem chave de ferramenta no produto' },
182
+ 'nexo knowledge items list': { key: 'settings' },
183
+ 'nexo knowledge items create': { key: 'knowledge_change' },
184
+ 'nexo knowledge items edit': { key: 'knowledge_change' },
185
+ 'nexo knowledge items move': { key: 'knowledge_change' },
186
+ 'nexo knowledge items on': { key: 'knowledge_change' },
187
+ 'nexo knowledge items off': { key: 'knowledge_change' },
188
+ 'nexo knowledge items resolve': { key: 'knowledge_change' },
189
+ 'nexo knowledge items remove': { key: 'knowledge_change' },
190
+ 'nexo knowledge themes list': { key: 'settings' },
191
+ 'nexo knowledge themes create': { key: 'knowledge_change' },
192
+ 'nexo knowledge themes rename': { key: 'knowledge_change' },
193
+ 'nexo knowledge themes remove': { key: 'knowledge_change' },
171
194
  'nexo skills install': {
172
195
  none: 'Entrega as skills (produto no projeto, empresa/área/time na pasta do usuário); não é ferramenta de produto'
173
196
  },
@@ -217,7 +240,8 @@ export const COMMAND_TOOLS = {
217
240
  'nexo connect hosts approve': { key: ['connector_hosts_approve', 'connector_change_preview', 'connector_change_apply'] },
218
241
  'nexo connect secrets list': { key: 'connector_access' },
219
242
  'nexo connect webhook': { key: 'connector_access' },
220
- 'nexo connect webhook secret set': { none: 'O segredo é digitado por uma pessoa (ou gerado na máquina dela) e nunca passa por IA/MCP' },
243
+ 'nexo connect webhook deliveries': { key: 'connector_webhook_deliveries' },
244
+ 'nexo connect webhook rotate': { key: ['connector_change_preview', 'connector_change_apply'] },
221
245
  'nexo connect oauth': { key: 'connector_access' },
222
246
  'nexo connect oauth authorize': { key: 'connector_oauth_authorize' },
223
247
  'nexo connect oauth client set': { none: 'O client secret é digitado por uma pessoa e nunca passa por IA/MCP' },
@@ -251,6 +275,11 @@ export const COMMAND_TOOLS = {
251
275
  'nexo dashboards push': { key: 'dashboard_change' },
252
276
  'nexo dashboards save': { key: 'dashboard_apply' },
253
277
  'nexo billing invoices': { key: 'billing' },
278
+ 'nexo context show': { none: 'Lê o contexto em /v1/company/context; o MCP lê pelo nexo_context e pelo contexto de cada negócio' },
279
+ 'nexo context set': { key: 'configuration_change' },
280
+ 'nexo context add': { key: 'configuration_change' },
281
+ 'nexo context remove': { key: 'configuration_change' },
282
+ 'nexo context confirm': { key: 'configuration_change' },
254
283
  'nexo templates list': { none: 'Modelos de e-mail e WhatsApp em /v1/message-templates; ainda sem chave de ferramenta no produto' },
255
284
  'nexo templates get': { none: 'Modelos de e-mail e WhatsApp em /v1/message-templates; ainda sem chave de ferramenta no produto' },
256
285
  'nexo templates preview': { none: 'Modelos de e-mail e WhatsApp em /v1/message-templates; ainda sem chave de ferramenta no produto' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winning-sales/nexo",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "CLI do Nexo: a API, o Connect, os dashboards, os fluxos, os documentos e as análises no terminal, com a documentação e as skills do produto para a sua IA",
5
5
  "license": "MIT",
6
6
  "type": "module",