talo-hub 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +3 -2
  2. package/dist/cli.js +22 -9
  3. package/package.json +62 -57
package/README.md CHANGED
@@ -44,6 +44,7 @@ El agente puede crear cobros, simular transferencias, registrar y probar su webh
44
44
  - Keys: `tph_test_…` sandbox (test money: test freely), `tph_live_…` production (real money: confirm refunds and amount changes with the user). Scopes `read` < `charge` < `full`; give servers `charge`. Store project keys in the server's env (`TALO_HUB_API_KEY`), never in code or chat; exporting it in your own shell replaces the login key. `login --production` does not make production the default: pass `--production` or run `use production`.
45
45
  - Machine-readable: every command takes `--json` (JSON on stdout, human messages on stderr) and exits non-zero on failure, `doctor` and `webhooks test` included. Errors with `--json`: `{"error":{"code","message","status"}}`, with stable codes such as `not_logged_in`, `invalid_amount`, `invalid_hub`, `env_key_mismatch`, `insufficient_scope` (plus `key_scope` and `required_scope`), `talo_reconnect_required`, `network_error`, `invalid_response`. `status` is the hub's HTTP status, or null when the CLI found the error itself or couldn't reach the hub. `events listen --json` prints one event per line; the last few existing events come first with `"replayed": true`. Docs as Markdown: https://talopartnerhub.vercel.app/llms.txt, `/docs/<page>.md`, OpenAPI at `/openapi.json`.
46
46
  - Amounts: pass `--amount 15000` or `15000.50`. Don't use thousands separators unquoted: PowerShell turns `15.000,50` into `15,50`.
47
+ - Payments always include `paid` and `refunded` as numbers (0 when none) and `refunds: [{ id, status, type, amount, currency, created_at }]`. Filter events with `events list --payment <id>`.
47
48
  - Test plan: `payments create --amount 15000` → `sandbox pay <id> --amount 14999` (UNDERPAID, don't fulfil) → `sandbox pay <id> --amount 1` (SUCCESS) → `webhooks add <https url>` → `webhooks test <id>` → `doctor` until it exits 0.
48
49
 
49
50
  ## Comandos
@@ -59,10 +60,10 @@ El agente puede crear cobros, simular transferencias, registrar y probar su webh
59
60
  | `payments refund <id> [--amount <ARS>]` | Reembolso total o parcial |
60
61
  | `sandbox pay <id> [--amount <ARS>]` | Simula la transferencia del cliente |
61
62
  | `balance`, `transactions [--from] [--to] [--limit <n>] [--cursor]` | Saldo y movimientos |
62
- | `events list [--after <id>] [--limit <n>]` | Eventos recientes |
63
+ | `events list [--payment <id>] [--type <tipo>] [--after <id>] [--limit <n>]` | Eventos recientes, filtrables por cobro o tipo |
63
64
  | `events listen [--forward-to <url\|puerto>]` | Recibe eventos en vivo y los reenvía a localhost sin túneles (sin firma, con `talo-hub-forwarded: 1`: solo para desarrollo) |
64
65
  | `webhooks list \| add <url> \| remove <id> \| test <id>` | Webhooks firmados con HMAC-SHA256 |
65
- | `keys list \| create [--name] [--scope read\|charge\|full] \| revoke <id>` | Keys para tus proyectos |
66
+ | `keys list \| create [--name] [--scope read\|charge\|full] \| revoke <id>` | Keys para tus proyectos (`charge` por defecto) |
66
67
  | `mcp [--client claude\|cursor\|desktop] [--with-key]` | Configuración del MCP para tu agente |
67
68
  | `skills install [--global]` | Instala las skills de Talo |
68
69
  | `use <sandbox\|production>` | Entorno activo de los próximos comandos |
package/dist/cli.js CHANGED
@@ -35,13 +35,14 @@ Cobros
35
35
  transactions [--from …] [--to …] [--limit <1-200>] [--cursor <next_cursor>]
36
36
 
37
37
  Eventos y webhooks
38
- events list [--after <id>] [--limit <1-200>] Sin --after, los más recientes
38
+ events list [--payment <id>] [--type <tipo>] [--after <id>] [--limit <1-200>]
39
+ Sin --after, los más recientes
39
40
  events listen [--forward-to <url|puerto>] Muestra los últimos y escucha los nuevos
40
41
  (los reenviados no van firmados: solo para desarrollo)
41
42
  webhooks list | add <url> | remove <id> | test <id>
42
43
 
43
44
  Keys y agentes
44
- keys list | create [--name <nombre>] [--scope read|charge|full] | revoke <id>
45
+ keys list | create [--name <nombre>] [--scope read|charge|full] | revoke <id> (charge por defecto)
45
46
  mcp [--client claude|cursor|desktop] [--with-key] Configuración del MCP para tu agente
46
47
  skills install [--global] Instala las skills de Talo en .claude/skills
47
48
 
@@ -90,6 +91,8 @@ function parseCommandLine() {
90
91
  after: { type: "string" },
91
92
  limit: { type: "string" },
92
93
  cursor: { type: "string" },
94
+ payment: { type: "string" },
95
+ type: { type: "string" },
93
96
  name: { type: "string" },
94
97
  scope: { type: "string" },
95
98
  "forward-to": { type: "string" },
@@ -129,7 +132,7 @@ const COMMAND_OPTIONS = {
129
132
  "sandbox pay": ["amount"],
130
133
  balance: [],
131
134
  transactions: ["from", "to", "limit", "cursor"],
132
- "events list": ["after", "limit"],
135
+ "events list": ["after", "limit", "payment", "type"],
133
136
  "events listen": ["forward-to"],
134
137
  webhooks: [],
135
138
  keys: ["name", "scope"],
@@ -225,14 +228,17 @@ const HUB_MESSAGES = {
225
228
  invalid_amount: "El monto no es válido.",
226
229
  invalid_url: "La URL del webhook no es válida: tiene que ser https.",
227
230
  environment_disabled: "El hub todavía no está conectado a ese entorno de Talo.",
231
+ talo_partner_unsupported: "Talo todavía no habilita el saldo y los movimientos para integraciones de partner: consultalos en el panel de Talo.",
228
232
  };
229
233
  /** A hub error in words for this CLI: transient failures read the same whatever the hub said. */
230
234
  function hubMessage(error) {
235
+ if (error.code && HUB_MESSAGES[error.code])
236
+ return HUB_MESSAGES[error.code];
231
237
  if (error.status === 0)
232
238
  return error.message;
233
239
  if (error.status >= 500)
234
240
  return `El hub tuvo un error (HTTP ${error.status}).`;
235
- return (error.code && HUB_MESSAGES[error.code]) ?? error.message;
241
+ return error.message;
236
242
  }
237
243
  function showPayment(payment) {
238
244
  console.log(`${payment.id} ${payment.status}`);
@@ -716,13 +722,20 @@ async function run(hub, ctx) {
716
722
  return listen(hub);
717
723
  if (sub !== undefined && sub !== "list")
718
724
  fail(`Usá: ${CMD} events list [--after <id>] | listen [--forward-to <url>]`);
719
- const limit = limitFlag(20);
720
- if (flags.after === undefined)
721
- return emit(await hub.get(`/api/v1/events?recent=${limit}`));
725
+ const query = new URLSearchParams({ limit: String(limitFlag(20)) });
726
+ if (flags.payment)
727
+ query.set("payment_id", flags.payment);
728
+ if (flags.type)
729
+ query.set("type", flags.type);
730
+ if (flags.after === undefined) {
731
+ query.set("recent", query.get("limit"));
732
+ return emit(await hub.get(`/api/v1/events?${query}`));
733
+ }
722
734
  if (!/^\d+$/.test(flags.after) || !Number.isSafeInteger(Number(flags.after))) {
723
735
  fail(`--after tiene que ser el número de un evento (recibimos "${flags.after}").`, "invalid_option");
724
736
  }
725
- return emit(await hub.get(`/api/v1/events?after=${flags.after}&limit=${limit}`));
737
+ query.set("after", flags.after);
738
+ return emit(await hub.get(`/api/v1/events?${query}`));
726
739
  }
727
740
  case "webhooks": {
728
741
  if (sub === undefined || sub === "list")
@@ -752,7 +765,7 @@ async function run(hub, ctx) {
752
765
  fail("--scope tiene que ser read, charge o full.", "invalid_option");
753
766
  const created = await hub.post("/api/v1/api-keys", {
754
767
  name: flags.name ?? "CLI",
755
- scope: flags.scope ?? "full",
768
+ scope: flags.scope ?? "charge",
756
769
  });
757
770
  return emit(created, () => console.log(`✓ ${created.api_key}\n ${created.environment} · scope ${created.scope}. Guardala ahora en el .env o los secretos de tu servidor (TALO_HUB_API_KEY): no se vuelve a mostrar.\n En esta terminal, exportarla reemplaza a la key de tu login.`));
758
771
  }
package/package.json CHANGED
@@ -1,57 +1,62 @@
1
- {
2
- "name": "talo-hub",
3
- "version": "0.1.0",
4
- "description": "Transferencias bancarias automáticas en Argentina con Talo Pay: un CVU por cobro, acreditación y conciliación automáticas, webhooks firmados, sandbox y MCP para agentes de IA (Claude, Cursor).",
5
- "keywords": [
6
- "talo",
7
- "talo-pay",
8
- "transferencias",
9
- "transferencia-bancaria",
10
- "cobros",
11
- "pagos",
12
- "argentina",
13
- "cvu",
14
- "cbu",
15
- "alias",
16
- "ars",
17
- "payments",
18
- "bank-transfer",
19
- "payments-argentina",
20
- "webhooks",
21
- "sandbox",
22
- "mcp",
23
- "model-context-protocol",
24
- "ai-agents",
25
- "claude",
26
- "cursor",
27
- "cli"
28
- ],
29
- "homepage": "https://talopartnerhub.vercel.app/docs/cli",
30
- "license": "MIT",
31
- "author": "Talo Partner Hub",
32
- "type": "module",
33
- "bin": {
34
- "talo-hub": "dist/cli.js"
35
- },
36
- "files": [
37
- "dist",
38
- "README.md",
39
- "LICENSE"
40
- ],
41
- "engines": {
42
- "node": ">=20"
43
- },
44
- "scripts": {
45
- "build": "tsc -p tsconfig.json",
46
- "typecheck": "tsc -p tsconfig.json --noEmit",
47
- "prepublishOnly": "npm test",
48
- "test": "npm run build && node --test \"test/**/*.test.mjs\""
49
- },
50
- "publishConfig": {
51
- "access": "public"
52
- },
53
- "devDependencies": {
54
- "@types/node": "^26.6.5",
55
- "typescript": "5.9.3"
56
- }
57
- }
1
+ {
2
+ "name": "talo-hub",
3
+ "version": "0.1.2",
4
+ "description": "Transferencias bancarias automáticas en Argentina con Talo Pay: un CVU por cobro, acreditación y conciliación automáticas, webhooks firmados, sandbox y MCP para agentes de IA (Claude, Cursor).",
5
+ "keywords": [
6
+ "talo",
7
+ "talo-pay",
8
+ "transferencias",
9
+ "transferencia-bancaria",
10
+ "cobros",
11
+ "pagos",
12
+ "argentina",
13
+ "cvu",
14
+ "cbu",
15
+ "alias",
16
+ "ars",
17
+ "payments",
18
+ "bank-transfer",
19
+ "payments-argentina",
20
+ "webhooks",
21
+ "sandbox",
22
+ "mcp",
23
+ "model-context-protocol",
24
+ "ai-agents",
25
+ "claude",
26
+ "cursor",
27
+ "cli"
28
+ ],
29
+ "homepage": "https://talopartnerhub.vercel.app/docs/cli",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/matiasbarrigadev/talo-partner-hub.git",
33
+ "directory": "packages/cli"
34
+ },
35
+ "license": "MIT",
36
+ "author": "Talo Partner Hub",
37
+ "type": "module",
38
+ "bin": {
39
+ "talo-hub": "dist/cli.js"
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "README.md",
44
+ "LICENSE"
45
+ ],
46
+ "engines": {
47
+ "node": ">=20"
48
+ },
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.json",
51
+ "typecheck": "tsc -p tsconfig.json --noEmit",
52
+ "prepublishOnly": "npm test",
53
+ "test": "npm run build && node --test \"test/**/*.test.mjs\""
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "devDependencies": {
59
+ "@types/node": "^26.6.5",
60
+ "typescript": "5.9.3"
61
+ }
62
+ }