hobots 1.3.4 → 1.3.5

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 CHANGED
@@ -120,12 +120,12 @@ try {
120
120
  throw error;
121
121
  }
122
122
 
123
- Hobots.captureMessage('Lote processado com sucesso', 'info');
123
+ Hobots.captureMessage('Lote processado com sucesso', 'success');
124
124
  ```
125
125
 
126
126
  Ambas retornam o `event_id` (ou `undefined` se não inicializado). O hint aceita `level`, `tags`, `extra` e `fingerprint`. Erros **não tratados** são capturados e flushados automaticamente antes do processo sair — desligue com `captureUnhandled: false`.
127
127
 
128
- `Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug'`.
128
+ `Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug' | 'success'`. Use `'success'` para reportar itens concluídos com êxito — contam como eventos, mas **não** viram issue nem disparam alertas.
129
129
 
130
130
  ### Breadcrumbs
131
131
 
package/dist/index.cjs CHANGED
@@ -111,7 +111,7 @@ function parseStacktrace(stack) {
111
111
 
112
112
  // src/utils.ts
113
113
  var SDK_NAME = "hobots";
114
- var SDK_VERSION = true ? "1.3.3" : "0.0.0-dev";
114
+ var SDK_VERSION = true ? "1.3.4" : "0.0.0-dev";
115
115
  function isNode() {
116
116
  return typeof process !== "undefined" && typeof process.versions?.node === "string";
117
117
  }
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ function parseStacktrace(stack) {
58
58
 
59
59
  // src/utils.ts
60
60
  var SDK_NAME = "hobots";
61
- var SDK_VERSION = true ? "1.3.3" : "0.0.0-dev";
61
+ var SDK_VERSION = true ? "1.3.4" : "0.0.0-dev";
62
62
  function isNode() {
63
63
  return typeof process !== "undefined" && typeof process.versions?.node === "string";
64
64
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/protocol.ts"],"sourcesContent":["/**\n * Tipos do protocolo de ingestão do Hobots Monitor (SDK → servidor).\n *\n * Este arquivo é a fonte de verdade do wire format e só pode reexportar tipos:\n * o app valida os payloads com zod e trava o drift via `satisfies z.ZodType<...>`\n * contra estes tipos (importados de `hobots/protocol`).\n */\n\n// Wire format do Manager (agente ↔ servidor) — reexportado aqui para o app\n// consumir tudo de `hobots/protocol`.\nexport type {\n ManagerRunStatus,\n ManagerRunUpdateStatus,\n RunLogLevel,\n RunLogEntry,\n ManagerAgentInfo,\n ManagerPollRequest,\n ManagerRunDescriptor,\n ManagerPollResponse,\n ManagerRunError,\n ManagerRunUpdateRequest,\n ManagerRunUpdateResponse,\n} from './manager/protocol';\n\nexport type Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug';\n\n/** Frames em ordem innermost-first (mesma ordem impressa pelo V8). */\nexport interface StackFrame {\n function?: string;\n filename?: string;\n lineno?: number;\n colno?: number;\n in_app: boolean;\n}\n\nexport interface Breadcrumb {\n /** ISO 8601 */\n timestamp: string;\n type?: string;\n category?: string;\n message?: string;\n level?: Severity;\n data?: Record<string, unknown>;\n}\n\nexport interface ExceptionData {\n type: string;\n value: string;\n stacktrace?: { frames: StackFrame[] };\n}\n\nexport interface EventUser {\n id?: string;\n username?: string;\n email?: string;\n}\n\nexport interface EventPayload {\n /** uuid v4 sem hífens (32 hex), gerado pelo SDK */\n event_id: string;\n /** ISO 8601 */\n timestamp: string;\n level: Severity;\n message?: string;\n exception?: ExceptionData;\n /** Override de agrupamento; quando ausente o servidor calcula pelo stack trace */\n fingerprint?: string[];\n breadcrumbs?: Breadcrumb[];\n tags?: Record<string, string>;\n user?: EventUser;\n contexts?: Record<string, Record<string, unknown>>;\n extra?: Record<string, unknown>;\n release?: string;\n environment?: string;\n}\n\nexport interface SpanData {\n /** 16 hex */\n span_id: string;\n parent_span_id?: string;\n op?: string;\n description?: string;\n status?: string;\n /** ISO 8601 */\n start_timestamp: string;\n /** ISO 8601 (fim do span) */\n timestamp: string;\n data?: Record<string, unknown>;\n}\n\nexport interface TransactionPayload {\n event_id: string;\n name: string;\n op?: string;\n status: string;\n start_timestamp: string;\n timestamp: string;\n spans: SpanData[];\n tags?: Record<string, string>;\n release?: string;\n environment?: string;\n}\n\nexport type CheckInStatus = 'in_progress' | 'ok' | 'error';\n\nexport interface CheckInPayload {\n /** Mesmo id no par in_progress → ok/error para casar início e fim */\n check_in_id: string;\n monitor_slug: string;\n status: CheckInStatus;\n duration_ms?: number;\n /** Expressão cron — permite o servidor criar o monitor automaticamente (upsert) */\n schedule?: string;\n timezone?: string;\n environment?: string;\n release?: string;\n}\n\nexport interface HeartbeatPayload {\n instance_id: string;\n name?: string;\n interval_ms: number;\n /** ISO 8601 */\n timestamp: string;\n metadata?: Record<string, unknown>;\n release?: string;\n}\n\nexport type EnvelopeItem =\n | { type: 'event'; payload: EventPayload }\n | { type: 'transaction'; payload: TransactionPayload }\n | { type: 'check_in'; payload: CheckInPayload }\n | { type: 'heartbeat'; payload: HeartbeatPayload };\n\nexport interface Envelope {\n sdk: { name: string; version: string };\n /** ISO 8601 */\n sent_at: string;\n items: EnvelopeItem[];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/protocol.ts"],"sourcesContent":["/**\n * Tipos do protocolo de ingestão do Hobots Monitor (SDK → servidor).\n *\n * Este arquivo é a fonte de verdade do wire format e só pode reexportar tipos:\n * o app valida os payloads com zod e trava o drift via `satisfies z.ZodType<...>`\n * contra estes tipos (importados de `hobots/protocol`).\n */\n\n// Wire format do Manager (agente ↔ servidor) — reexportado aqui para o app\n// consumir tudo de `hobots/protocol`.\nexport type {\n ManagerRunStatus,\n ManagerRunUpdateStatus,\n RunLogLevel,\n RunLogEntry,\n ManagerAgentInfo,\n ManagerPollRequest,\n ManagerRunDescriptor,\n ManagerPollResponse,\n ManagerRunError,\n ManagerRunUpdateRequest,\n ManagerRunUpdateResponse,\n} from './manager/protocol';\n\nexport type Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug' | 'success';\n\n/** Frames em ordem innermost-first (mesma ordem impressa pelo V8). */\nexport interface StackFrame {\n function?: string;\n filename?: string;\n lineno?: number;\n colno?: number;\n in_app: boolean;\n}\n\nexport interface Breadcrumb {\n /** ISO 8601 */\n timestamp: string;\n type?: string;\n category?: string;\n message?: string;\n level?: Severity;\n data?: Record<string, unknown>;\n}\n\nexport interface ExceptionData {\n type: string;\n value: string;\n stacktrace?: { frames: StackFrame[] };\n}\n\nexport interface EventUser {\n id?: string;\n username?: string;\n email?: string;\n}\n\nexport interface EventPayload {\n /** uuid v4 sem hífens (32 hex), gerado pelo SDK */\n event_id: string;\n /** ISO 8601 */\n timestamp: string;\n level: Severity;\n message?: string;\n exception?: ExceptionData;\n /** Override de agrupamento; quando ausente o servidor calcula pelo stack trace */\n fingerprint?: string[];\n breadcrumbs?: Breadcrumb[];\n tags?: Record<string, string>;\n user?: EventUser;\n contexts?: Record<string, Record<string, unknown>>;\n extra?: Record<string, unknown>;\n release?: string;\n environment?: string;\n}\n\nexport interface SpanData {\n /** 16 hex */\n span_id: string;\n parent_span_id?: string;\n op?: string;\n description?: string;\n status?: string;\n /** ISO 8601 */\n start_timestamp: string;\n /** ISO 8601 (fim do span) */\n timestamp: string;\n data?: Record<string, unknown>;\n}\n\nexport interface TransactionPayload {\n event_id: string;\n name: string;\n op?: string;\n status: string;\n start_timestamp: string;\n timestamp: string;\n spans: SpanData[];\n tags?: Record<string, string>;\n release?: string;\n environment?: string;\n}\n\nexport type CheckInStatus = 'in_progress' | 'ok' | 'error';\n\nexport interface CheckInPayload {\n /** Mesmo id no par in_progress → ok/error para casar início e fim */\n check_in_id: string;\n monitor_slug: string;\n status: CheckInStatus;\n duration_ms?: number;\n /** Expressão cron — permite o servidor criar o monitor automaticamente (upsert) */\n schedule?: string;\n timezone?: string;\n environment?: string;\n release?: string;\n}\n\nexport interface HeartbeatPayload {\n instance_id: string;\n name?: string;\n interval_ms: number;\n /** ISO 8601 */\n timestamp: string;\n metadata?: Record<string, unknown>;\n release?: string;\n}\n\nexport type EnvelopeItem =\n | { type: 'event'; payload: EventPayload }\n | { type: 'transaction'; payload: TransactionPayload }\n | { type: 'check_in'; payload: CheckInPayload }\n | { type: 'heartbeat'; payload: HeartbeatPayload };\n\nexport interface Envelope {\n sdk: { name: string; version: string };\n /** ISO 8601 */\n sent_at: string;\n items: EnvelopeItem[];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -8,7 +8,7 @@ export { ManagerAgentInfo, ManagerPollRequest, ManagerPollResponse, ManagerRunDe
8
8
  * contra estes tipos (importados de `hobots/protocol`).
9
9
  */
10
10
 
11
- type Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
11
+ type Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug' | 'success';
12
12
  /** Frames em ordem innermost-first (mesma ordem impressa pelo V8). */
13
13
  interface StackFrame {
14
14
  function?: string;
@@ -8,7 +8,7 @@ export { ManagerAgentInfo, ManagerPollRequest, ManagerPollResponse, ManagerRunDe
8
8
  * contra estes tipos (importados de `hobots/protocol`).
9
9
  */
10
10
 
11
- type Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
11
+ type Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug' | 'success';
12
12
  /** Frames em ordem innermost-first (mesma ordem impressa pelo V8). */
13
13
  interface StackFrame {
14
14
  function?: string;
@@ -105,7 +105,7 @@ No poll, o agente se identifica com `ManagerAgentInfo` (`hobots/protocol`): o ca
105
105
  | `extra` | `Record<string,unknown>` | dados extras |
106
106
  | `fingerprint` | `string[]` | agrupamento manual |
107
107
 
108
- `Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug'`.
108
+ `Severity = 'fatal' | 'error' | 'warning' | 'info' | 'debug' | 'success'`. O nível `'success'` marca itens concluídos com êxito — contam como eventos, mas não geram issue nem alertas.
109
109
 
110
110
  ### CheckInOptions
111
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hobots",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "SDK JavaScript da Hobots — captura de erros, transactions, check-ins de cron e heartbeats (Monitor) e execução remota de tarefas sob demanda (Manager) para RPAs e integrações. Um único import e um único init().",
5
5
  "type": "module",
6
6
  "sideEffects": false,