@zihin/agent-client 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 +3 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -23,7 +23,8 @@ simples, e oferece **dois estilos** de invocação:
|
|
|
23
23
|
npm install @zihin/agent-client
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Requer Node >=
|
|
26
|
+
Requer Node >= 20.16 (usa `fetch`/`ReadableStream` globais; o `signRequest` do build ESM usa
|
|
27
|
+
`process.getBuiltinModule`, 20.16+). Node 18 saiu de suporte em 04/2025 e deixou de ser testado a partir da 0.8.
|
|
27
28
|
|
|
28
29
|
## Uso — caminho direto
|
|
29
30
|
|
|
@@ -418,7 +419,7 @@ correlacionar com o console.
|
|
|
418
419
|
`delayMs`/`reason`/`status`) e `onError(err)` — chamado quando uma operação falha em definitivo
|
|
419
420
|
(inclusive `aborted`; filtre por `err.kind`). Exceção lançada dentro do hook é engolida e nunca
|
|
420
421
|
mascara o erro original.
|
|
421
|
-
- **`fetch` injetável** — `fetch?` na config; por padrão usa `globalThis.fetch` (Node ≥
|
|
422
|
+
- **`fetch` injetável** — `fetch?` na config; por padrão usa `globalThis.fetch` (Node ≥20.16). Um
|
|
422
423
|
preflight dá erro `config` claro se não houver fetch.
|
|
423
424
|
- **Portável** — sem `Buffer`; `node:crypto` só é carregado se você usar `signRequest`. Roda em Node;
|
|
424
425
|
para edge/serverless, injete `fetch` se necessário. O pacote publica **CJS e ESM** (`exports` map):
|
package/dist/index.d.mts
CHANGED
|
@@ -1091,7 +1091,7 @@ interface SignedRequestHeaders {
|
|
|
1091
1091
|
*
|
|
1092
1092
|
* ⚠️ No build ESM depende de `process.getBuiltinModule` (Node >=20.16); em Node mais antigo via
|
|
1093
1093
|
* `import` lança `ZihinAgentError` com `kind: 'config'`. O build CJS funciona em qualquer Node
|
|
1094
|
-
* >=
|
|
1094
|
+
* suportado (>=20.16). (Todo o resto do núcleo é Web-API puro e roda nos dois.)
|
|
1095
1095
|
*/
|
|
1096
1096
|
declare function signRequest(payload: string, secretKey: string, timestamp?: number): SignedRequestHeaders;
|
|
1097
1097
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1091,7 +1091,7 @@ interface SignedRequestHeaders {
|
|
|
1091
1091
|
*
|
|
1092
1092
|
* ⚠️ No build ESM depende de `process.getBuiltinModule` (Node >=20.16); em Node mais antigo via
|
|
1093
1093
|
* `import` lança `ZihinAgentError` com `kind: 'config'`. O build CJS funciona em qualquer Node
|
|
1094
|
-
* >=
|
|
1094
|
+
* suportado (>=20.16). (Todo o resto do núcleo é Web-API puro e roda nos dois.)
|
|
1095
1095
|
*/
|
|
1096
1096
|
declare function signRequest(payload: string, secretKey: string, timestamp?: number): SignedRequestHeaders;
|
|
1097
1097
|
|
package/dist/index.js
CHANGED
|
@@ -521,7 +521,7 @@ function resolveConfig(config) {
|
|
|
521
521
|
if (typeof (config.fetch ?? globalThis.fetch) !== "function") {
|
|
522
522
|
throw new ZihinAgentError(
|
|
523
523
|
"config",
|
|
524
|
-
"Global fetch is unavailable in this runtime. Use Node >=
|
|
524
|
+
"Global fetch is unavailable in this runtime. Use Node >=20.16 or pass a `fetch` implementation in the client config."
|
|
525
525
|
);
|
|
526
526
|
}
|
|
527
527
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -486,7 +486,7 @@ function resolveConfig(config) {
|
|
|
486
486
|
if (typeof (config.fetch ?? globalThis.fetch) !== "function") {
|
|
487
487
|
throw new ZihinAgentError(
|
|
488
488
|
"config",
|
|
489
|
-
"Global fetch is unavailable in this runtime. Use Node >=
|
|
489
|
+
"Global fetch is unavailable in this runtime. Use Node >=20.16 or pass a `fetch` implementation in the client config."
|
|
490
490
|
);
|
|
491
491
|
}
|
|
492
492
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zihin/agent-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Núcleo de invocação de agentes Zihin.ai — padrão único para n8n, Paperclip e integrações futuras. Stream direto (SSE bufferizado) + triggers assíncronos com callback.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zihin",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=20.16"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"prepublishOnly": "npm run build && npm test"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/node": ">=
|
|
57
|
+
"@types/node": ">=20",
|
|
58
58
|
"tsup": "^8.0.0",
|
|
59
59
|
"typescript": "^5.4.0"
|
|
60
60
|
}
|