hobots 1.7.0 → 1.7.1
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 +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/docs/README.md +2 -2
- package/docs/api-reference.md +2 -2
- package/docs/concepts.md +2 -2
- package/docs/getting-started.md +2 -2
- package/docs/protocol.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Também funciona em CommonJS: `const Hobots = require('hobots')`.
|
|
|
26
26
|
|
|
27
27
|
## Um SDK, duas capabilities, um `init()`
|
|
28
28
|
|
|
29
|
-
O SDK expõe **duas capabilities** autenticadas pelo **mesmo Client Secret do
|
|
29
|
+
O SDK expõe **duas capabilities** autenticadas pelo **mesmo Client Secret do agente**, configuradas em um único `init()`:
|
|
30
30
|
|
|
31
31
|
| Capability | Como habilita | Para quê | Ciclo de vida |
|
|
32
32
|
| --- | --- | --- | --- |
|
|
@@ -59,13 +59,13 @@ Hobots.start(); // inicia o polling de tasks (segura o processo vivo)
|
|
|
59
59
|
|
|
60
60
|
## O Client Secret
|
|
61
61
|
|
|
62
|
-
Cada
|
|
62
|
+
Cada agente tem **um único Client Secret** — a mesma credencial autentica a telemetria **e** as tasks:
|
|
63
63
|
|
|
64
64
|
```
|
|
65
65
|
hb_<64 hex>
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
A credencial é **secreta** e viaja sempre no header `Authorization: Bearer` — nunca na URL. Copie o Client Secret no app, em **Configurações →
|
|
68
|
+
A credencial é **secreta** e viaja sempre no header `Authorization: Bearer` — nunca na URL. Copie o Client Secret no app, em **Configurações → Agentes** — os snippets de integração já vêm prontos. O SDK fala com a API oficial `https://api2.hobots.app` automaticamente; em desenvolvimento, aponte para outro host com a env `HOBOTS_API_URL` (ex.: `HOBOTS_API_URL=http://localhost:3001`).
|
|
69
69
|
|
|
70
70
|
---
|
|
71
71
|
|
|
@@ -90,7 +90,7 @@ Hobots.init({
|
|
|
90
90
|
|
|
91
91
|
| Opção | Tipo | Default | Descrição |
|
|
92
92
|
| --- | --- | --- | --- |
|
|
93
|
-
| `clientSecret` | `string` | **obrigatório** | o Client Secret do
|
|
93
|
+
| `clientSecret` | `string` | **obrigatório** | o Client Secret do agente (`hb_<64 hex>`), copiado em **Configurações → Agentes** |
|
|
94
94
|
| `environment` | `string` | `'production'` | ambiente lógico |
|
|
95
95
|
| `release` | `string` | — | versão do programa, ex. `robo-nfe@1.4.2` |
|
|
96
96
|
| `instanceId` | `string` | **obrigatório** | identidade única da instância — heartbeat e poll de tasks convergem nela |
|
package/dist/index.cjs
CHANGED
|
@@ -163,7 +163,7 @@ function scrubSecrets(text) {
|
|
|
163
163
|
|
|
164
164
|
// src/utils.ts
|
|
165
165
|
var SDK_NAME = "hobots";
|
|
166
|
-
var SDK_VERSION = true ? "
|
|
166
|
+
var SDK_VERSION = true ? "1.7.0" : "0.0.0-dev";
|
|
167
167
|
function isNode() {
|
|
168
168
|
return typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
169
169
|
}
|
package/dist/index.js
CHANGED
|
@@ -103,7 +103,7 @@ function scrubSecrets(text) {
|
|
|
103
103
|
|
|
104
104
|
// src/utils.ts
|
|
105
105
|
var SDK_NAME = "hobots";
|
|
106
|
-
var SDK_VERSION = true ? "
|
|
106
|
+
var SDK_VERSION = true ? "1.7.0" : "0.0.0-dev";
|
|
107
107
|
function isNode() {
|
|
108
108
|
return typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
109
109
|
}
|
package/docs/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
SDK JavaScript da **Hobots** para instrumentar funcionários digitais (RPAs) e integrações. Cliente HTTP puro, sem dependências de runtime, para Node 18+ (a telemetria também roda no browser para captura de erros).
|
|
4
4
|
|
|
5
|
-
O SDK expõe **duas capabilities** autenticadas pelo **mesmo Client Secret do
|
|
5
|
+
O SDK expõe **duas capabilities** autenticadas pelo **mesmo Client Secret do agente**, configuradas em **um único `init()`** com **um único import** (`import * as Hobots from 'hobots'`):
|
|
6
6
|
|
|
7
7
|
| Capability | Como habilita | Para quê |
|
|
8
8
|
| --- | --- | --- |
|
|
@@ -25,7 +25,7 @@ Se termos como transaction, span, breadcrumb, tag, context, extra, flush e close
|
|
|
25
25
|
```js
|
|
26
26
|
import * as Hobots from 'hobots';
|
|
27
27
|
|
|
28
|
-
// O Client Secret do
|
|
28
|
+
// O Client Secret do agente — copie em Configurações → Agentes no app
|
|
29
29
|
const clientSecret = 'hb_<64 hex>';
|
|
30
30
|
|
|
31
31
|
// Um init só: telemetria sempre ativa; tasks habilita a execução sob demanda.
|
package/docs/api-reference.md
CHANGED
|
@@ -54,7 +54,7 @@ Classes exportadas: `Client`, `Scope`, `Transaction`, `Span`. A resolução da c
|
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
56
|
getClient()?.config; // {
|
|
57
|
-
// key: string; — Client Secret do
|
|
57
|
+
// key: string; — Client Secret do agente (vai no Authorization: Bearer, nunca na URL)
|
|
58
58
|
// baseUrl: string; — DEFAULT_BASE_URL, ou HOBOTS_API_URL em desenvolvimento
|
|
59
59
|
// ingestEndpoint: string; — <baseUrl>/v1/ingest
|
|
60
60
|
// tasksBaseUrl: string; — <baseUrl>/v1/tasks
|
|
@@ -98,7 +98,7 @@ No poll, o agente se identifica com `AgentInfo` (`hobots/protocol`): o campo `in
|
|
|
98
98
|
|
|
99
99
|
| Opção | Tipo | Default | Descrição |
|
|
100
100
|
| --- | --- | --- | --- |
|
|
101
|
-
| `clientSecret` | `string` | — | **obrigatório**; o Client Secret do
|
|
101
|
+
| `clientSecret` | `string` | — | **obrigatório**; o Client Secret do agente (`hb_<64 hex>`), copiado em **Configurações → Agentes** |
|
|
102
102
|
| `environment` | `string` | `'production'` | ambiente lógico |
|
|
103
103
|
| `release` | `string` | — | versão do programa, ex. `robo-nfe@1.4.2` |
|
|
104
104
|
| `instanceId` | `string` | **obrigatório** | identidade única da instância; heartbeat e poll de tasks convergem nela |
|
package/docs/concepts.md
CHANGED
|
@@ -41,8 +41,8 @@ Cada API do SDK alimenta um módulo do app da Hobots (app.hobots.app). O mapa:
|
|
|
41
41
|
|
|
42
42
|
| No SDK | No app |
|
|
43
43
|
| --- | --- |
|
|
44
|
-
| **
|
|
45
|
-
| **
|
|
44
|
+
| **Agente** — o "funcionário digital"; dono do Client Secret (`hb_…`) que autentica tudo | **Configurações → Agentes** (é lá que você copia a credencial) |
|
|
45
|
+
| **Instância** — o par `(project_id, instance_id)`; heartbeat e poll de tasks convergem nele | Módulo **Agentes** (uptime, performance) |
|
|
46
46
|
| **[Evento](#evento)** agrupado em **issue** — `captureException` / `captureMessage` | Módulo **Issues** |
|
|
47
47
|
| **Monitor (cron)** — `withMonitor` / `checkIn` com `schedule` | Módulo **Monitores** |
|
|
48
48
|
| **[Transaction](#transaction) / spans** — `startTransaction` (e [`ctx.tx`](#transaction-de-run-ctxtx) dentro de uma run) | Performance no módulo **Agentes**; nas execuções, a aba de performance da solicitação |
|
package/docs/getting-started.md
CHANGED
|
@@ -23,13 +23,13 @@ Os termos que aparecem nesta página, em uma frase cada. Explicação completa d
|
|
|
23
23
|
|
|
24
24
|
## O Client Secret
|
|
25
25
|
|
|
26
|
-
Cada
|
|
26
|
+
Cada agente tem **um único Client Secret** — a mesma credencial autentica a telemetria **e** as tasks:
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
hb_<64 hex>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
A credencial é **secreta** e viaja sempre no header `Authorization: Bearer` — nunca na URL. Copie o Client Secret no app, em **Configurações →
|
|
32
|
+
A credencial é **secreta** e viaja sempre no header `Authorization: Bearer` — nunca na URL. Copie o Client Secret no app, em **Configurações → Agentes** — os snippets de integração já vêm prontos.
|
|
33
33
|
|
|
34
34
|
O SDK fala com a API oficial `https://api2.hobots.app` automaticamente — não há configuração de host no `init()`. Em desenvolvimento, aponte para outro host com a env `HOBOTS_API_URL`:
|
|
35
35
|
|
package/docs/protocol.md
CHANGED
|
@@ -6,7 +6,7 @@ Os arquivos `src/protocol.ts` e `src/tasks/protocol.ts` são a **fonte de verdad
|
|
|
6
6
|
|
|
7
7
|
## O Client Secret e os endpoints derivados
|
|
8
8
|
|
|
9
|
-
Cada
|
|
9
|
+
Cada agente tem **um único Client Secret**, o mesmo para as duas capabilities:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
hb_<64 hex>
|
|
@@ -44,7 +44,7 @@ Um `transaction` pode carregar `run_id`: é assim que a [transaction de uma run]
|
|
|
44
44
|
|
|
45
45
|
## Tasks — polling e reporte
|
|
46
46
|
|
|
47
|
-
Dois endpoints sob `<baseUrl>/v1/tasks`, ambos com `Authorization: Bearer <clientSecret>` (a credencial única do
|
|
47
|
+
Dois endpoints sob `<baseUrl>/v1/tasks`, ambos com `Authorization: Bearer <clientSecret>` (a credencial única do agente):
|
|
48
48
|
|
|
49
49
|
### `POST /v1/tasks/poll`
|
|
50
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hobots",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "SDK JavaScript da Hobots — telemetria (erros, transactions, check-ins de cron e heartbeats) e execução remota de tarefas sob demanda (tasks) para RPAs e integrações. Um único import e um único init().",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|