@winning-sales/nexo 0.7.0 → 0.8.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.
- package/README.md +18 -3
- package/assets/connect/connect-sdk.d.ts +294 -11
- package/assets/connect/manifest.schema.json +598 -9
- package/assets/docs/pages.json +1 -1
- package/assets/skills/nexo-api/SKILL.md +8 -0
- package/assets/skills/nexo-automations/SKILL.md +6 -0
- package/assets/skills/nexo-connect/SKILL.md +15 -4
- package/assets/skills/nexo-dashboards/SKILL.md +2 -0
- package/dist/auth/callback-page.js +51 -0
- package/dist/auth/loopback-server.js +17 -7
- package/dist/commands/agents.js +241 -0
- package/dist/commands/automations.js +32 -17
- package/dist/commands/connect-access.js +64 -23
- package/dist/connect/access.js +81 -7
- package/dist/connect/changes.js +12 -1
- package/dist/connect/runs.js +1 -1
- package/dist/program-agents.js +65 -0
- package/dist/program-connect-access.js +16 -9
- package/dist/program.js +2 -0
- package/dist/tools/tool-manifest.js +13 -1
- package/package.json +1 -1
- package/reference.json +210 -39
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { randomBytes } from 'node:crypto';
|
|
2
1
|
import { clientOf, printJson, printLine, printNotice, sessionOf } from '../context.js';
|
|
3
|
-
import { DEFAULT_PATIENCE, describeMail, describeMailFile, describeOAuth, describeSecret, describeSftpKey, describeWebhook, isMailAddress, isMailFileList, isOAuthAuthorization, isOAuthStatus, isSecretList, isSftpKeyList, isWebhook, pollUntil, timedOut } from '../connect/access.js';
|
|
4
|
-
import { requestLocalChange } from '../connect/changes.js';
|
|
2
|
+
import { DEFAULT_PATIENCE, describeMail, describeMailFile, describeOAuth, describeSecret, describeSftpKey, authSecretNames, describeDelivery, describeWebhook, isMailAddress, isMailFileList, isOAuthAuthorization, isOAuthStatus, isSecretList, isSftpKeyList, isWebhook, isWebhookDeliveryList, pollUntil, timedOut, WEBHOOK_URL_WARNING } from '../connect/access.js';
|
|
3
|
+
import { requestChange, requestLocalChange } from '../connect/changes.js';
|
|
5
4
|
import { usageError } from '../errors.js';
|
|
6
5
|
import { pause } from '../documents/journey-api.js';
|
|
7
6
|
import { NexoApiError } from '../http/problem.js';
|
|
@@ -33,39 +32,81 @@ export async function secretsList(context, dir, options) {
|
|
|
33
32
|
printLine(context, describeSecret(slot));
|
|
34
33
|
}
|
|
35
34
|
}
|
|
35
|
+
/** Os segredos que a autenticação do webhook usa e o Nexo ainda não tem preenchidos; sem a lista, não afirma nada. */
|
|
36
|
+
async function missingSecrets(context, target, webhook) {
|
|
37
|
+
const names = [...new Set([...authSecretNames(webhook.auth), ...authSecretNames(webhook.authInEdit)])];
|
|
38
|
+
if (names.length === 0) {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
const slots = await read(context, target, 'secrets', isSecretList, 'Lista de segredos');
|
|
42
|
+
const filled = new Set(slots.filter((slot) => slot.filled).map((slot) => slot.name));
|
|
43
|
+
return names.filter((name) => !filled.has(name));
|
|
44
|
+
}
|
|
36
45
|
export async function webhookShow(context, dir, options) {
|
|
37
|
-
const
|
|
46
|
+
const target = targetOf(context, dir, options);
|
|
47
|
+
const webhook = await read(context, target, 'webhook', isWebhook, 'Webhook');
|
|
48
|
+
const missing = await missingSecrets(context, target, webhook);
|
|
38
49
|
if (options.json === true) {
|
|
39
|
-
printJson(context, webhook);
|
|
50
|
+
printJson(context, { ...webhook, missingSecrets: missing, urlIsCredential: true });
|
|
40
51
|
return;
|
|
41
52
|
}
|
|
42
|
-
for (const line of describeWebhook(webhook)) {
|
|
53
|
+
for (const line of describeWebhook(webhook, missing)) {
|
|
43
54
|
printLine(context, line);
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
function deliveriesPath(options) {
|
|
58
|
+
const query = new URLSearchParams();
|
|
59
|
+
if (options.before !== undefined) {
|
|
60
|
+
query.set('before', options.before);
|
|
49
61
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
if (options.limit !== undefined) {
|
|
63
|
+
const limit = Number(options.limit);
|
|
64
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
65
|
+
throw usageError('--limit pede um número inteiro de 1 a 100.');
|
|
66
|
+
}
|
|
67
|
+
query.set('limit', String(limit));
|
|
54
68
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
return `webhook/deliveries${query.size === 0 ? '' : `?${query.toString()}`}`;
|
|
70
|
+
}
|
|
71
|
+
export async function webhookDeliveries(context, dir, options) {
|
|
72
|
+
const target = targetOf(context, dir, options);
|
|
73
|
+
const path = deliveriesPath(options);
|
|
74
|
+
const list = await read(context, target, path, isWebhookDeliveryList, 'Lista de entregas');
|
|
60
75
|
if (options.json === true) {
|
|
61
|
-
printJson(context,
|
|
76
|
+
printJson(context, list);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (list.deliveries.length === 0) {
|
|
80
|
+
printLine(context, 'Nenhuma entrega no webhook ainda.');
|
|
62
81
|
return;
|
|
63
82
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
printLine(context, `Segredo: ${secret}`);
|
|
67
|
-
printLine(context, 'Este valor sai só agora e não volta. Leve-o ao outro sistema; ele não dá acesso ao Nexo.');
|
|
83
|
+
for (const delivery of list.deliveries) {
|
|
84
|
+
printLine(context, describeDelivery(delivery));
|
|
68
85
|
}
|
|
86
|
+
if (list.next !== null) {
|
|
87
|
+
printLine(context, `Há mais: use --before ${list.next}.`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Troca o token do endereço: prévia do `/v1`, o sim (ou `--yes`) e só então aplica. O endereço antigo para na hora. */
|
|
91
|
+
export async function webhookRotate(context, dir, options) {
|
|
92
|
+
if (options.confirm !== undefined && options.confirm.trim() === '') {
|
|
93
|
+
throw usageError('--confirm pede o token da prévia; o valor veio vazio. Nada foi trocado.');
|
|
94
|
+
}
|
|
95
|
+
await requestChange(context, sessionOf(context, options), {
|
|
96
|
+
connectorId: connectorIdOf(options, dir),
|
|
97
|
+
path: 'webhook/token',
|
|
98
|
+
command: 'nexo connect webhook rotate',
|
|
99
|
+
summarize: (body) => isWebhook(body)
|
|
100
|
+
? [
|
|
101
|
+
`Novo endereço: ${body.url}`,
|
|
102
|
+
WEBHOOK_URL_WARNING,
|
|
103
|
+
'O endereço anterior parou de valer agora: leve este ao outro sistema.'
|
|
104
|
+
]
|
|
105
|
+
: [],
|
|
106
|
+
confirm: options.confirm,
|
|
107
|
+
yes: options.yes === true,
|
|
108
|
+
json: options.json === true
|
|
109
|
+
});
|
|
69
110
|
}
|
|
70
111
|
export async function oauthShow(context, dir, options) {
|
|
71
112
|
const oauth = await read(context, targetOf(context, dir, options), 'oauth', isOAuthStatus, 'Estado do OAuth');
|
package/dist/connect/access.js
CHANGED
|
@@ -37,7 +37,25 @@ export function isSecretList(value) {
|
|
|
37
37
|
}
|
|
38
38
|
export function isWebhook(value) {
|
|
39
39
|
const fields = fieldsOf(value);
|
|
40
|
-
return fields !== null && typeof fields.url === 'string' &&
|
|
40
|
+
return fields !== null && typeof fields.url === 'string' && isAuthOrNull(fields.auth) && isAuthOrNull(fields.authInEdit);
|
|
41
|
+
}
|
|
42
|
+
function isAuthOrNull(value) {
|
|
43
|
+
if (value === null) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
const fields = fieldsOf(value);
|
|
47
|
+
return fields !== null && typeof fields.type === 'string' && typeof fields.secret === 'string';
|
|
48
|
+
}
|
|
49
|
+
export function isWebhookDeliveryList(value) {
|
|
50
|
+
const fields = fieldsOf(value);
|
|
51
|
+
return (fields !== null &&
|
|
52
|
+
Array.isArray(fields.deliveries) &&
|
|
53
|
+
fields.deliveries.every((item) => isDelivery(item)) &&
|
|
54
|
+
(fields.next === null || typeof fields.next === 'string'));
|
|
55
|
+
}
|
|
56
|
+
function isDelivery(item) {
|
|
57
|
+
const delivery = fieldsOf(item);
|
|
58
|
+
return delivery !== null && typeof delivery.receivedAt === 'string' && typeof delivery.outcome === 'string';
|
|
41
59
|
}
|
|
42
60
|
export function isOAuthStatus(value) {
|
|
43
61
|
const fields = fieldsOf(value);
|
|
@@ -68,12 +86,68 @@ export function isMailFileList(value) {
|
|
|
68
86
|
export function describeSecret(slot) {
|
|
69
87
|
return `${slot.name.padEnd(28)} ${slot.filled ? `preenchido${slot.setAt === null ? '' : ` desde ${slot.setAt}`}` : 'faltando'}`;
|
|
70
88
|
}
|
|
71
|
-
export
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
89
|
+
export const WEBHOOK_URL_WARNING = 'O endereço é a credencial do webhook: quem o tem pode chamá-lo. Não o cole em lugar público nem em chat; só no outro sistema.';
|
|
90
|
+
const OUTCOME_NAMES = {
|
|
91
|
+
ran: 'rodou',
|
|
92
|
+
waiting: 'esperando a vez',
|
|
93
|
+
refused: 'recusada',
|
|
94
|
+
discarded: 'descartada'
|
|
95
|
+
};
|
|
96
|
+
const REASON_NAMES = {
|
|
97
|
+
missing: 'a chamada veio sem a autenticação declarada',
|
|
98
|
+
mismatch: 'a autenticação não confere com o segredo',
|
|
99
|
+
stale: 'a hora da chamada está fora da tolerância',
|
|
100
|
+
secret_missing: 'o segredo da autenticação não está preenchido no Nexo',
|
|
101
|
+
not_published: 'o conector não tem versão publicada',
|
|
102
|
+
no_webhook_trigger: 'a versão publicada não tem gatilho de webhook',
|
|
103
|
+
disabled: 'o conector está desligado',
|
|
104
|
+
paused: 'o conector está pausado',
|
|
105
|
+
unstorable: 'o corpo não pôde ser guardado'
|
|
106
|
+
};
|
|
107
|
+
/** Os nomes dos segredos que a autenticação usa, sem repetir. */
|
|
108
|
+
export function authSecretNames(auth) {
|
|
109
|
+
return auth === null
|
|
110
|
+
? []
|
|
111
|
+
: [...new Set([auth.user, auth.secret].filter((name) => name !== undefined))];
|
|
112
|
+
}
|
|
113
|
+
function describeHmac(auth) {
|
|
114
|
+
const timed = auth.signed === 'timestamp.body';
|
|
115
|
+
const prefix = auth.prefix === undefined || auth.prefix === '' ? '' : ` (com o prefixo ${auth.prefix})`;
|
|
116
|
+
const time = timed
|
|
117
|
+
? `; o cabeçalho ${auth.timestampHeader ?? '?'} leva a hora, em segundos (${String(auth.toleranceSeconds ?? 300)} s de tolerância)`
|
|
118
|
+
: '';
|
|
119
|
+
const algorithm = (auth.algorithm ?? 'sha256').toUpperCase();
|
|
120
|
+
return `assinatura HMAC-${algorithm} (${auth.encoding ?? 'hex'}) ${timed ? 'de "<hora>.<corpo>"' : 'do corpo'} com o segredo ${auth.secret}, no cabeçalho ${auth.header ?? '?'}${prefix}${time}`;
|
|
121
|
+
}
|
|
122
|
+
export function describeAuth(auth) {
|
|
123
|
+
if (auth.type === 'header') {
|
|
124
|
+
return `o cabeçalho ${auth.header ?? '?'} leva o valor do segredo ${auth.secret}`;
|
|
125
|
+
}
|
|
126
|
+
if (auth.type === 'basic') {
|
|
127
|
+
return `HTTP Basic, com o usuário do segredo ${auth.user ?? '?'} e a senha do segredo ${auth.secret}`;
|
|
128
|
+
}
|
|
129
|
+
return describeHmac(auth);
|
|
130
|
+
}
|
|
131
|
+
/** `missing`: os nomes de segredo da autenticação que o Nexo ainda não tem preenchidos. */
|
|
132
|
+
export function describeWebhook(webhook, missing) {
|
|
133
|
+
const lines = [`URL: ${webhook.url} (POST)`, WEBHOOK_URL_WARNING];
|
|
134
|
+
lines.push(webhook.auth === null
|
|
135
|
+
? 'Autenticação publicada: nenhuma `auth` declarada. Com versão publicada e gatilho de webhook, a autenticação é o token do endereço (/webhooks/connect/<token>): o Nexo não exige assinatura, e quem tem o endereço pode chamar. Sem versão publicada ou sem gatilho de webhook, a chamada é descartada e nada roda. Para exigir também um cabeçalho, HTTP Basic ou HMAC, declare `auth` no manifesto e publique.'
|
|
136
|
+
: `Autenticação publicada (a que confere as chamadas agora, além do token do endereço): ${describeAuth(webhook.auth)}.`);
|
|
137
|
+
if (JSON.stringify(webhook.authInEdit) !== JSON.stringify(webhook.auth)) {
|
|
138
|
+
lines.push(webhook.authInEdit === null
|
|
139
|
+
? 'Na versão em edição: nenhuma `auth` declarada; só o token do endereço (vale depois de publicar).'
|
|
140
|
+
: `Na versão em edição (vale depois de publicar): ${describeAuth(webhook.authInEdit)}.`);
|
|
141
|
+
}
|
|
142
|
+
if (missing.length > 0) {
|
|
143
|
+
lines.push(`Falta preencher: ${missing.join(', ')}. Preencha com \`nexo connect secrets set <NOME>\`.`);
|
|
144
|
+
}
|
|
145
|
+
return lines;
|
|
146
|
+
}
|
|
147
|
+
export function describeDelivery(delivery) {
|
|
148
|
+
const reason = delivery.reason === null ? null : (REASON_NAMES[delivery.reason] ?? delivery.reason);
|
|
149
|
+
const run = delivery.runId === null ? '' : ` execução ${delivery.runId}${delivery.runStatus === null ? '' : ` (${delivery.runStatus})`}`;
|
|
150
|
+
return `${delivery.receivedAt} ${(OUTCOME_NAMES[delivery.outcome] ?? delivery.outcome).padEnd(15)} ${delivery.contentType ?? 'sem tipo'}, ${String(delivery.sizeBytes)} bytes${reason === null ? '' : `; motivo: ${reason}`}${run === '' ? '' : `;${run}`}`;
|
|
77
151
|
}
|
|
78
152
|
const APP_NAMES = {
|
|
79
153
|
nexo: 'o app do Nexo',
|
package/dist/connect/changes.js
CHANGED
|
@@ -34,6 +34,17 @@ async function apply(context, session, request, token) {
|
|
|
34
34
|
printLine(context, line);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
/** Com `--json` o stdout é um JSON só em todo caminho: a prévia vai para o stderr. */
|
|
38
|
+
function showPreviewFor(context, preview, json) {
|
|
39
|
+
if (!json) {
|
|
40
|
+
showPreview(context, preview);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
printNotice(context, preview.title);
|
|
44
|
+
for (const change of preview.changes) {
|
|
45
|
+
printNotice(context, ` - ${change}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
37
48
|
export function showPreview(context, preview) {
|
|
38
49
|
printLine(context, preview.title);
|
|
39
50
|
for (const change of preview.changes) {
|
|
@@ -94,7 +105,7 @@ export async function requestChange(context, session, request) {
|
|
|
94
105
|
printJson(context, response.body);
|
|
95
106
|
return;
|
|
96
107
|
}
|
|
97
|
-
|
|
108
|
+
showPreviewFor(context, response.body, request.json);
|
|
98
109
|
await decide(context, session, request, response.body);
|
|
99
110
|
}
|
|
100
111
|
function reportApplied(context, change, response) {
|
package/dist/connect/runs.js
CHANGED
|
@@ -43,7 +43,7 @@ function plannedLines(title, calls) {
|
|
|
43
43
|
];
|
|
44
44
|
}
|
|
45
45
|
function failedSteps(steps) {
|
|
46
|
-
const failed = (steps ?? []).filter((step) => step.errorCode !== null || (step.status ?? 0) >= 400);
|
|
46
|
+
const failed = (steps ?? []).filter((step) => (step.errorCode ?? null) !== null || (step.status ?? 0) >= 400);
|
|
47
47
|
return failed
|
|
48
48
|
.slice(0, 10)
|
|
49
49
|
.map((step) => ` ${step.kind} ${step.target ?? ''} → ${step.errorCode ?? String(step.status)}: ${step.message ?? ''}`.trimEnd());
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { agentsHours, agentsList, agentsSet, agentsShow } from './commands/agents.js';
|
|
2
|
+
import { usageError } from './errors.js';
|
|
3
|
+
function collect(value, previous) {
|
|
4
|
+
return [...(previous ?? []), value];
|
|
5
|
+
}
|
|
6
|
+
function addShowAndSet(agents, context) {
|
|
7
|
+
agents
|
|
8
|
+
.command('show')
|
|
9
|
+
.description('Mostra a configuração de um agente')
|
|
10
|
+
.argument('<agente>', 'sdr ou cs')
|
|
11
|
+
.action(async (role, _options, command) => {
|
|
12
|
+
await agentsShow(context, role, command.optsWithGlobals());
|
|
13
|
+
});
|
|
14
|
+
agents
|
|
15
|
+
.command('set')
|
|
16
|
+
.description('Muda um agente: mostra o que muda e só salva depois do sim (só administrador)')
|
|
17
|
+
.argument('<agente>', 'sdr ou cs')
|
|
18
|
+
.option('--on', 'liga o agente')
|
|
19
|
+
.option('--off', 'desliga o agente')
|
|
20
|
+
.option('--cases <casos>', 'after_hours, stalled_queue e covered_by_knowledge, separados por vírgula; none para nenhum')
|
|
21
|
+
.option('--book-meeting', 'o Agente SDR marca reunião na agenda do vendedor')
|
|
22
|
+
.option('--no-book-meeting', 'o Agente SDR deixa de marcar reunião')
|
|
23
|
+
.option('--meeting-minutes <min>', 'duração da reunião: 30, 45 ou 60')
|
|
24
|
+
.option('--meeting-lead <min>', 'antecedência mínima da reunião: 120, 240 ou 1440')
|
|
25
|
+
.option('--name <nome>', 'nome do agente nas conversas (até 30 caracteres)')
|
|
26
|
+
.option('-y, --yes', 'salva logo depois de mostrar o que muda')
|
|
27
|
+
.action(async (role, _options, command) => {
|
|
28
|
+
refuseBothBookFlags(command);
|
|
29
|
+
await agentsSet(context, role, command.optsWithGlobals());
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function addHours(agents, context) {
|
|
33
|
+
agents
|
|
34
|
+
.command('hours')
|
|
35
|
+
.description('O horário de reunião: sem vendedor, lê e muda o seu; com o id de um vendedor, só lê (cada um muda o próprio). Mudar mostra o que muda e pede o sim')
|
|
36
|
+
.argument('[vendedor]', 'id do vendedor, só para ler')
|
|
37
|
+
.option('--day <dias=faixas>', 'o horário próprio inteiro, como seg-sex=09:00-12:00,14:00-18:00 (repita por dia ou grupo de dias)', collect)
|
|
38
|
+
.option('--company', 'apaga o horário próprio e volta ao da empresa')
|
|
39
|
+
.option('-y, --yes', 'salva logo depois de mostrar o que muda')
|
|
40
|
+
.action(async (seller, _options, command) => {
|
|
41
|
+
await agentsHours(context, seller, command.optsWithGlobals());
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** Commander keeps only the last of --book-meeting and --no-book-meeting, so the contradiction is read from the arguments. */
|
|
45
|
+
function refuseBothBookFlags(command) {
|
|
46
|
+
let root = command;
|
|
47
|
+
while (root.parent !== null) {
|
|
48
|
+
root = root.parent;
|
|
49
|
+
}
|
|
50
|
+
const args = root.rawArgs;
|
|
51
|
+
if (args.includes('--book-meeting') && args.includes('--no-book-meeting')) {
|
|
52
|
+
throw usageError('Escolha --book-meeting ou --no-book-meeting, não os dois.');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export function addAgentCommands(program, context) {
|
|
56
|
+
const agents = program
|
|
57
|
+
.command('agents')
|
|
58
|
+
.alias('agentes')
|
|
59
|
+
.description('Os Agentes de atendimento (SDR e CS): o estado, a configuração e o horário de reunião')
|
|
60
|
+
.action(async (_options, command) => {
|
|
61
|
+
await agentsList(context, command.optsWithGlobals());
|
|
62
|
+
});
|
|
63
|
+
addShowAndSet(agents, context);
|
|
64
|
+
addHours(agents, context);
|
|
65
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emailFiles, emailRenew, emailShow, oauthAuthorize, oauthClientRemove, oauthClientSet, oauthShow, sftpAccept, sftpKeys,
|
|
1
|
+
import { emailFiles, emailRenew, emailShow, oauthAuthorize, oauthClientRemove, oauthClientSet, oauthShow, sftpAccept, sftpKeys, webhookDeliveries, webhookRotate, webhookShow } from './commands/connect-access.js';
|
|
2
2
|
import { hostsApprove, hostsList } from './commands/connect-hosts.js';
|
|
3
3
|
const FOLDER_HELP = 'pasta do conector';
|
|
4
4
|
const CONFIRM_HELP = 'aplica, depois do sim da pessoa';
|
|
@@ -23,21 +23,28 @@ function addHostsCommands(connect, context) {
|
|
|
23
23
|
function addWebhookCommands(connect, context) {
|
|
24
24
|
const webhook = connect
|
|
25
25
|
.command('webhook')
|
|
26
|
-
.description('O webhook do conector: a
|
|
26
|
+
.description('O webhook do conector: o endereço (que é a credencial), a autenticação declarada e os segredos que faltam')
|
|
27
27
|
.argument('[pasta]', FOLDER_HELP, '.')
|
|
28
28
|
.action(async (dir, _options, command) => {
|
|
29
29
|
await webhookShow(context, dir, command.optsWithGlobals());
|
|
30
30
|
});
|
|
31
31
|
webhook
|
|
32
|
-
.command('
|
|
33
|
-
.description('
|
|
34
|
-
.
|
|
35
|
-
.
|
|
32
|
+
.command('deliveries')
|
|
33
|
+
.description('As últimas chamadas que o outro sistema fez ao webhook, da mais nova à mais antiga, com o desfecho e o motivo')
|
|
34
|
+
.argument('[pasta]', FOLDER_HELP, '.')
|
|
35
|
+
.option('--limit <n>', 'quantas entregas por página (1 a 100; padrão 25)')
|
|
36
|
+
.option('--before <id>', 'a próxima página: o id que a página anterior mostrou em "Há mais"')
|
|
37
|
+
.action(async (dir, _options, command) => {
|
|
38
|
+
await webhookDeliveries(context, dir, command.optsWithGlobals());
|
|
39
|
+
});
|
|
40
|
+
webhook
|
|
41
|
+
.command('rotate')
|
|
42
|
+
.description('Troca o token do endereço: mostra o que muda e pede o sim; o endereço antigo para de valer na hora')
|
|
36
43
|
.argument('[pasta]', FOLDER_HELP, '.')
|
|
37
|
-
.option('--
|
|
38
|
-
.option('--
|
|
44
|
+
.option('--confirm <token>', 'aplica com o token da prévia, depois do sim da pessoa')
|
|
45
|
+
.option('-y, --yes', YES_HELP)
|
|
39
46
|
.action(async (dir, _options, command) => {
|
|
40
|
-
await
|
|
47
|
+
await webhookRotate(context, dir, command.optsWithGlobals());
|
|
41
48
|
});
|
|
42
49
|
}
|
|
43
50
|
function addOAuthClientCommands(oauth, context) {
|
package/dist/program.js
CHANGED
|
@@ -10,6 +10,7 @@ import { addArtifactCommands, addDealCommands } from './program-artifacts.js';
|
|
|
10
10
|
import { addTemplateCommands } from './program-templates.js';
|
|
11
11
|
import { addBrainCommands } from './program-brain.js';
|
|
12
12
|
import { addErpCommands } from './program-erp.js';
|
|
13
|
+
import { addAgentCommands } from './program-agents.js';
|
|
13
14
|
import { addDashboardCommands } from './program-dashboards.js';
|
|
14
15
|
import { skillsInstall, skillsList, skillsShow } from './commands/skills.js';
|
|
15
16
|
import { login } from './commands/login.js';
|
|
@@ -193,5 +194,6 @@ export function buildProgram(context) {
|
|
|
193
194
|
addTemplateCommands(program, context);
|
|
194
195
|
addBrainCommands(program, context);
|
|
195
196
|
addErpCommands(program, context);
|
|
197
|
+
addAgentCommands(program, context);
|
|
196
198
|
return program;
|
|
197
199
|
}
|
|
@@ -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' },
|
|
@@ -217,7 +228,8 @@ export const COMMAND_TOOLS = {
|
|
|
217
228
|
'nexo connect hosts approve': { key: ['connector_hosts_approve', 'connector_change_preview', 'connector_change_apply'] },
|
|
218
229
|
'nexo connect secrets list': { key: 'connector_access' },
|
|
219
230
|
'nexo connect webhook': { key: 'connector_access' },
|
|
220
|
-
'nexo connect webhook
|
|
231
|
+
'nexo connect webhook deliveries': { key: 'connector_webhook_deliveries' },
|
|
232
|
+
'nexo connect webhook rotate': { key: ['connector_change_preview', 'connector_change_apply'] },
|
|
221
233
|
'nexo connect oauth': { key: 'connector_access' },
|
|
222
234
|
'nexo connect oauth authorize': { key: 'connector_oauth_authorize' },
|
|
223
235
|
'nexo connect oauth client set': { none: 'O client secret é digitado por uma pessoa e nunca passa por IA/MCP' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@winning-sales/nexo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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",
|