@roilab/crm-cli 0.8.4 → 0.10.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/CHANGELOG.md CHANGED
@@ -8,6 +8,68 @@ Todos los cambios notables se documentan aquí. El formato sigue
8
8
 
9
9
  _Ningún cambio pendiente todavía._
10
10
 
11
+ ## [0.10.0] — 2026-06-05
12
+
13
+ ### Added
14
+
15
+ - **`crm meta brief --task <id>` (o `--url <url> --domain <id>` `[--kw …]`)** —
16
+ dossier en una llamada para optimizar meta title + meta description, usando
17
+ sólo endpoints existentes (sin gastar créditos Ahrefs): Rank Tracker
18
+ (posición, intent, serpFeatures, `rankingUrl`) + queries de GSC de la URL +
19
+ **canibalización** (qué URLs nuestras compiten por la KW) + `hints[]` en
20
+ español. Si no se pasa `--kw`, la deriva de la query con más clics de la URL.
21
+ Es el atajo que ejecuta los pasos 2/4/5 de la skill `optimizar-metas`.
22
+
23
+ ### Changed
24
+
25
+ - `tool-routing` y `SKILL.md` ahora apuntan al playbook **`optimizar-metas`**
26
+ (optimizar/validar meta title + meta description) como **skill de agencia**
27
+ (Convex), que se baja con `crm skill pull optimizar-metas`. No es un bundle
28
+ del paquete.
29
+
30
+ ### Fixed
31
+
32
+ - **`crm skill push` — bootstrap del primer push.** Antes exigía un sidecar del
33
+ mirror local (`crm skill pull`), pero un skill recién creado es un draft que
34
+ `pull` no baja (sólo trae publicados) → huevo-y-gallina. Ahora, si no hay
35
+ sidecar pero existe `SKILL.md` en `.claude/skills/<slug>/`, sintetiza el
36
+ sidecar desde el estado remoto y publica directamente.
37
+ - **`crm skill push` — guard de frontmatter YAML inválido.** Detecta en local
38
+ el patrón `clave: "a", "b"` (lista de escalares sin corchetes — YAML inválido
39
+ que el servidor mapeaba a un 500 opaco) y falla con un `VALIDATION` legible
40
+ antes de enviar nada.
41
+ - **Aviso de actualización congelado.** `refreshCacheInBackground()` reseteaba
42
+ el `checkedAt` del cache de versión a "ahora" *antes* de lanzar el hijo que
43
+ consulta npm. Si ese hijo no completaba (spawn `detached` bloqueado en
44
+ Windows, sandbox cortado), el cache quedaba aparentemente "fresco" para
45
+ siempre y nunca se volvía a comprobar — el usuario dejaba de recibir el aviso
46
+ de versión nueva. Ahora el placeholder solo avanza un campo `attemptedAt`
47
+ nuevo, preservando `checkedAt`, de modo que un intento fallido reintenta en la
48
+ siguiente ejecución (con backoff anti-estampida de 10 min).
49
+
50
+ ## [0.9.0] — 2026-06-04
51
+
52
+ ### Added
53
+
54
+ - **`crm marketplace`** — comparador de precios de backlinks multi-proveedor
55
+ (Fase 35): `compare` (precios por dominio ordenados por ahorro), `domain
56
+ <rootDomain>` (precios de un dominio en todos los proveedores), `providers`
57
+ (estado de sync + credenciales), `import` (alta de listados por `--file`/stdin)
58
+ y `scrape` (encola un scraping bajo demanda).
59
+ - **`crm task attach list|add|remove`** — gestión incremental de adjuntos de
60
+ una tarea, sin reemplazar la lista entera.
61
+ - **`crm comment update --id <commentId>`** — edita el contenido de un
62
+ comentario existente (solo autor o owner/admin).
63
+ - **`--body-file <path>`** en `crm comment create` y `crm comment update` — lee
64
+ el cuerpo desde un fichero como UTF-8. Robusto frente a saltos de línea
65
+ dobles, backticks/fenced code y acentos que el shell rompería al pasarlos por
66
+ `--body`.
67
+
68
+ ### Fixed
69
+
70
+ - `comments.update` ahora devuelve su resultado para que `PATCH /comments/:id`
71
+ deje de responder 500.
72
+
11
73
  ## [0.8.4] — 2026-05-19
12
74
 
13
75
  ### Added
package/SKILL.md CHANGED
@@ -146,6 +146,19 @@ Errors **always** appear on stderr with full envelope, bypassing `--jq`. Exit co
146
146
 
147
147
  **Rule of thumb**: if the change is hard to reverse (deleting work, merging branches of logic, sending external messages, big content rewrites), pass `--shadow` even if your default is autonomous. Low-stakes routine updates (status nudges, agent_log comments, tag adjustments) can run autonomously.
148
148
 
149
+ 7. **After every write that returns an id, surface the full dashboard URL to the human.** When you report a `create` or `update` result back in chat, paste the complete `https://crm.roilab.es/dashboard/<entity>/<id>` URL alongside the id so the human can copy-paste it straight into the browser. The CLI envelope returns the id in `data.id` (and `data._id` for tasks). Build the URL with the API root from the active profile (default `https://crm.roilab.es`; check `crm doctor` if unsure).
150
+
151
+ | Entity | URL template |
152
+ |---|---|
153
+ | Task | `https://crm.roilab.es/dashboard/tasks?taskId=<id>` |
154
+ | Backlink | `https://crm.roilab.es/dashboard/backlinks/<id>` |
155
+ | Domain | `https://crm.roilab.es/dashboard/domains/<id>` |
156
+ | Client | `https://crm.roilab.es/dashboard/clients/<id>` |
157
+ | Chat thread | `https://crm.roilab.es/dashboard/chat?t=<threadId>` |
158
+ | Chat message (deep link) | `https://crm.roilab.es/dashboard/chat?m=<messageId>` |
159
+
160
+ **Do NOT confuse this with `[[feedback_task_refs_use_chip_syntax]]`**: inside task descriptions, comments, and chat bodies you still use `#[Title](taskId)` chips, never raw dashboard URLs. The dashboard URL goes only in your chat reply to the human reviewing your work — that is where they need a one-click destination.
161
+
149
162
  ## Mentioning humans + linking tasks
150
163
 
151
164
  Comments and task descriptions are markdown. Two special syntaxes — both
@@ -159,6 +172,40 @@ already wired up to fan out the right side effects when the row lands live:
159
172
  / duplicate-of / follow-up). Updates the target's "Referenced by" panel.
160
173
  No notification fires — purely a graph operation.
161
174
 
175
+ ### Anti-pattern: NEVER reference a task by bare id
176
+
177
+ Whenever you mention another task — in a description, a comment, a
178
+ `## Tareas relacionadas` block, an audit trail, anywhere markdown is
179
+ rendered — use the chip syntax `#[Título](taskId)`. **A bare id in
180
+ backticks is dead text**: no clickable link, no graph edge, no
181
+ "Referenced by" entry, and human readers have to copy-paste it into the
182
+ URL bar to navigate.
183
+
184
+ ```markdown
185
+ ❌ Bad — `m172v5tesszx27fhbfmj7abb45868z64` — "Modificar hreflang en dominio .NET"
186
+ ❌ Bad — https://crm.roilab.es/dashboard/tasks?taskId=m172v5tesszx27fhbfmj7abb45868z64
187
+ ✅ Good — #[Modificar hreflang en dominio .NET](m172v5tesszx27fhbfmj7abb45868z64)
188
+ ```
189
+
190
+ This applies equally to inline mentions and to lists. A `## Tareas
191
+ relacionadas` bullet must lead with the chip, not with the id:
192
+
193
+ ```markdown
194
+ - #[Eliminar hreflang chile de la home y ajustar hreflang es](m1716nym1jej9vevfnmgp6yzhn869vbz) (done 2024-05-30) → quitó `hreflang="es-CL"`…
195
+ ```
196
+
197
+ Special characters in the title (`[`, `]`, parens) must be backslash-escaped
198
+ so the markdown round-trips through the tokenizer:
199
+
200
+ ```markdown
201
+ #[\[GB\] Eliminar hreflangs apuntando hacia growbarato.it](m1767y1wqrz93q3kvqtej350398695fj)
202
+ #[Añadir nuevo schema Carousel \(ItemList\) en categorías](m178j0p99dwmfcwy37c0jr9t3s86819z)
203
+ ```
204
+
205
+ When you don't know the title off the top of your head, **resolve it
206
+ first** — see the next subsection. Don't fall back to a bare id "for now";
207
+ you'll forget to come back.
208
+
162
209
  ### Resolve IDs before composing
163
210
 
164
211
  Don't hand-roll memberIds or taskIds. Use the resolver helpers; they exit
@@ -294,16 +341,27 @@ storage). Reglas y límites compartidos:
294
341
  - **Cuidado con `task update --file`**: la lista de adjuntos es REEMPLAZO,
295
342
  no merge. Los archivos previos desaparecen. Para vaciar explícitamente, usa
296
343
  `--clear-files`; para conservar los previos hay que pasarlos también.
344
+ - **Para añadir/quitar UN archivo sin tocar el resto** usa `task attach` en vez
345
+ de `task update --file` (que reemplaza toda la lista):
346
+ - `crm task attach list <taskId>` — lista los adjuntos (con su `_id`).
347
+ - `crm task attach add <taskId> --file <ruta...>` — añade sin clobber.
348
+ - `crm task attach remove <taskId> <attachmentId>` — quita uno por id.
349
+ Tope: 50 archivos/tarea. Los clientes pueden adjuntar a tareas que ven.
297
350
 
298
351
  ```bash
299
352
  # Chat
300
353
  crm chat send "$TID" --body "captura del 404" --file ./bug.png
301
354
  crm chat reply <msgId> --thread "$TID" --file ./report.pdf --file ./logs.txt
302
355
 
303
- # Tarea
356
+ # Tarea — en la creación / reemplazo total
304
357
  crm task create --title "Migración H1" --domain dom_xyz --file ./brief.pdf
305
358
  crm task update tsk_abc --file ./new-spec.pdf --clear-files
306
359
 
360
+ # Tarea — gestión incremental de adjuntos (sin reemplazar la lista)
361
+ crm task attach add tsk_abc --file ./extra.pdf --file ./shot.png
362
+ crm task attach list tsk_abc
363
+ crm task attach remove tsk_abc att_xyz
364
+
307
365
  # Comentario
308
366
  crm comment create --task tsk_abc --kind decision \
309
367
  --body "Cerrado: ver diff y screenshots" \
@@ -325,9 +383,11 @@ crm task create \
325
383
  --description "Current H1 buries the value prop; replace with 'Plans that scale with you'." \
326
384
  --idempotency-key 01HY8X...
327
385
 
328
- # Log change events after shipping — no CLI verb yet; hit the REST endpoint
329
- # directly: POST /api/v1/domains/<domainId>/changes (autogenerates an
330
- # idempotency key per call; same envelope contract).
386
+ # Log change events after shipping — SOLO en tareas de Redacción (kind:
387
+ # "content"). Las tareas generales no registran cambios on-page y el backend
388
+ # los rechaza. No hay verbo CLI todavía; hit the REST endpoint directly:
389
+ # POST /api/v1/domains/<domainId>/changes (autogenerates an idempotency key
390
+ # per call; same envelope contract).
331
391
 
332
392
  # Search across everything
333
393
  crm search "meta title" --kind change --domain dom_xyz --limit 5
@@ -370,6 +430,25 @@ crm chat dm --member mem_xyz --title "1:1 review"
370
430
  crm chat mark-read <threadId>
371
431
  ```
372
432
 
433
+ ## Playbooks de tarea incluidos en este paquete
434
+
435
+ Este paquete trae playbooks en `skill-bundles/tools/<name>/SKILL.md` — viajan
436
+ con el CLI, así que sólo quien se baja/actualiza el CLI los tiene. Cuando una
437
+ tarea encaje con uno, **cárgalo y síguelo** (no improvises el método):
438
+
439
+ - **`tool-routing`** — matriz para elegir qué herramienta externa usar.
440
+ - **`task-preflight`** — cómo leer `crm task preflight` antes de crear tareas.
441
+
442
+ Además, la **librería de skills de la agencia** (Convex, no bundled) trae
443
+ playbooks que se bajan a `.claude/skills/` con `crm skill pull <slug>`:
444
+
445
+ - **`optimizar-metas`** — metodología para optimizar/validar **meta title +
446
+ meta description** de una URL: valida la KW en el Rank Tracker (Ahrefs **sin
447
+ gastar créditos**) → analiza GSC de la URL → clasifica la SERP y mira a los
448
+ competidores → **desambigua y caza canibalización** entre URLs propias, y sólo
449
+ entonces redacta. Para una tarea "Optimizar PDP / metas":
450
+ `crm skill pull optimizar-metas` y síguelo.
451
+
373
452
  ## Decision tree for analytics questions
374
453
 
375
454
  1. **Rollups / trends** → `crm domain metrics <id> --start … --end …`. Reads from Tinybird; cheap and fast.
@@ -384,7 +463,7 @@ Prefer 1 over 2 when it answers the question — Tinybird reads don't touch prov
384
463
  - **Scope comments are useful**: if a task has a scoped propertyLink (via `scopeId`), use `crm scope get <id>` to see the fingerprint + filters before assuming the KPI measurement window.
385
464
  - **Provider tokens never reach you**. The CLI forwards `--filters`, `--start`, `--end` through our REST layer; Convex decrypts and calls GSC / GA4 / Bing server-side. If you need a shape our wrappers don't cover, open an endpoint — don't try to exfiltrate tokens.
386
465
  - **Bing daily feed has no per-query/per-page breakdown**. `crm bing query` returns the aggregate with a `meta.note` saying so.
387
- - Web UI paths: `/dashboard/tasks/<id>` for a specific task, `/dashboard/inbox` for your review queue, `/developers` for the endpoint catalog, `/dashboard/settings?tab=api-usage` for the provider-API usage log.
466
+ - Web UI paths: `/dashboard/tasks?taskId=<id>` for a specific task, `/dashboard/inbox` for your review queue, `/developers` for the endpoint catalog, `/dashboard/settings?tab=api-usage` for the provider-API usage log.
388
467
 
389
468
  ## Task participants — assignees vs collaborators
390
469
 
@@ -441,6 +520,35 @@ crm backlink rejection-report --client cli_xyz --since-days 90
441
520
 
442
521
  Reasons are a closed catalog (`spammy_source | wrong_anchor | wrong_target | nofollow_unexpected | dead_on_arrival | duplicate | policy_violation | other`) — server validates and notifies the original creator.
443
522
 
523
+ ### Manual health-status override
524
+
525
+ `status` (active/removed/nofollowed/…) is the automated probe's verdict; it's orthogonal to the verify/reject QA verdict above. When the crawler gets a row wrong, override it (audited):
526
+
527
+ ```bash
528
+ crm backlink set-status <id> --status non_crawlable --note "Enlace dentro de documento Issuu — hotspot JS, no rastreable"
529
+ crm backlink set-status <id> --status active --note "Verificado: <a> dofollow real cargado por JS (SPA); el fetch http no lo veía"
530
+ crm backlink set-status <id> --status manual_override --note "Parqueado: …" # 'manual_override' detiene el cron
531
+ ```
532
+
533
+ The cron now auto-classifies flipbook/document hosts (Issuu, Calameo, Yumpu reader, Scribd) as `non_crawlable` — their link is a per-page JS hotspot, not a crawlable `<a href>`, so it's neither `removed` nor a live followable link. For SPA/UA-403 hosts the health check falls back to a real headless render before declaring a link dead. Use `set-status` only when you've verified the live page yourself and the automation still disagrees.
534
+
535
+ ## Perfiles sociales (`crm social`)
536
+
537
+ Los handles sociales de cada dominio (y los de marca global del cliente) viven en una tabla propia. Léelos antes de redactar contenido social o de proponer diversificación de enlaces — saber qué cuentas existen evita inventar handles.
538
+
539
+ ```bash
540
+ crm social list --domain dom_xyz # perfiles de un sitio
541
+ crm social list --client cli_abc # + handles de marca sin dominio
542
+ crm social create --domain dom_xyz --platform instagram --handle growbarato \
543
+ --url https://instagram.com/growbarato --primary
544
+ crm social create --client cli_abc --platform other --label Crunchbase \
545
+ --url https://www.crunchbase.com/organization/growbarato
546
+ crm social update soc_123 --notes "Cuenta oficial verificada"
547
+ crm social delete soc_123 # archiva (borrado suave, restaurable)
548
+ ```
549
+
550
+ Reglas: indica `--domain` (perfil del sitio) **o** `--client` (handle de marca sin sitio concreto). `platform` es un catálogo cerrado (`instagram | facebook | x | youtube | tiktok | linkedin | pinterest | threads | trustpilot | other`); `other` exige `--label`. El handle se normaliza quitando la `@`. `--internal-notes` queda staff-only (no se muestra al cliente). Scope `social:write` — staff-only.
551
+
444
552
  ## Bulk approve / reject your queue
445
553
 
446
554
  `crm review` supports bulk operations via stdin (NDJSON or `kind:id` tokens, ≤100 per call):
package/SURFACE.txt CHANGED
@@ -51,6 +51,12 @@ CMD crm task assets <id>
51
51
  CMD crm task link-backlink <task-id> <backlink-id> --unlink
52
52
  CMD crm task link-offer <task-id> <offer-id> --unlink
53
53
  CMD crm task complete-with-evidence <task-id> --asset <kind:id> --comment <id>
54
+ # `task attach` — add/remove/list files INDIVIDUALLY (no clobber, unlike
55
+ # `task update --file` which replaces the whole list). `attach remove` takes the
56
+ # attachment id from `attach list`. Máx 10 MB/archivo, máx 50 archivos/tarea.
57
+ CMD crm task attach list <taskId>
58
+ CMD crm task attach add <taskId> --file <path...>
59
+ CMD crm task attach remove <taskId> <attachmentId>
54
60
 
55
61
  CMD crm comment list <taskId>
56
62
  # `--body` opcional si pasas `--file`. `--file <path>` repetible para varios
@@ -87,9 +93,15 @@ CMD crm client profile-set <id> --ceo-name <text> --ceo-role <text> --industry <
87
93
  CMD crm domain list --client <id>
88
94
  CMD crm domain get <id>
89
95
  CMD crm domain metrics <id> --start <date> --end <date>
96
+ CMD crm domain create --name <name> --url <url> --client <id> --favicon <url> --primary-metric <id> --currency <code>
90
97
  CMD crm domain profile <id>
91
98
  CMD crm domain profile-set <id> --positioning <text> --tone-override <text> --audience-override <text> --content-guidelines <text> --brief <md> --internal-notes <md>
92
99
 
100
+ # property — fuente de datos individual (GSC site, GA4 property, Bing site, Ads
101
+ # account, GBP location). Si pasas --account + source ingestible (gsc/ga4/bing)
102
+ # se programa una ingesta inmediata de hasta 16 meses. Owner/admin only.
103
+ CMD crm property create --source-type <gsc|ga4|bing|ads|gbp> --identifier <id> --display-name <name> --client <id> --domain <id> --account <id> --backfill <date> --favicon <url> --currency <code> --website-url <url>
104
+
93
105
  CMD crm backlink list --domain <id> --status <status>
94
106
  CMD crm backlink lost --domain <id> --since <iso>
95
107
  CMD crm backlink list-tasks <backlink-id>
@@ -100,9 +112,20 @@ CMD crm backlink pending --domain <id> --client <id>
100
112
  CMD crm backlink verify <id>
101
113
  CMD crm backlink reject <id> --reason <spammy_source|wrong_anchor|wrong_target|nofollow_unexpected|dead_on_arrival|duplicate|policy_violation|other> --notes <text>
102
114
  CMD crm backlink rejection-report --domain <id> --client <id> --since-days <n>
115
+ # Manual health-status override (audited). 'manual_override' parks the row;
116
+ # 'non_crawlable' for links embedded in Issuu/Calameo/Yumpu/Scribd documents.
117
+ CMD crm backlink set-status <id> --status <pending_check|active|nofollowed|anchor_changed|removed|broken|redirected|deindexed|blocked|non_crawlable|manual_override> --note <text>
103
118
 
104
119
  CMD crm offer list-tasks <offer-id>
105
120
 
121
+ # Social profiles (Phase 44) — store + manage a domain's / client's handles.
122
+ # `--domain` for a site's profile, `--client` for a brand-level handle.
123
+ # platform=other requires `--label`. Staff-only.
124
+ CMD crm social list --domain <id> --client <id> --archived
125
+ CMD crm social create --platform <instagram|facebook|x|youtube|tiktok|linkedin|pinterest|threads|trustpilot|other> --url <url> --domain <id> --client <id> --handle <h> --label <l> --primary --order <n> --notes <t> --internal-notes <t>
126
+ CMD crm social update <id> --platform <p> --url <url> --handle <h> --label <l> --primary --order <n> --notes <t> --internal-notes <t>
127
+ CMD crm social delete <id>
128
+
106
129
  CMD crm change list --domain <id> --url <url> --since <iso>
107
130
 
108
131
  CMD crm scope list --domain <id> --kind <saved|ephemeral>
@@ -220,6 +243,11 @@ CMD crm rank archive [ids...] --stdin --ids-from-file <path>
220
243
  CMD crm rank restore [ids...] --stdin --ids-from-file <path>
221
244
  CMD crm rank delete [ids...] --stdin --ids-from-file <path>
222
245
 
246
+ # Meta title + description — dossier de datos reales (sin créditos Ahrefs).
247
+ # Reúne Rank Tracker + queries GSC de la URL + canibalización en una llamada.
248
+ # Interpreta la salida con la skill de agencia `optimizar-metas`.
249
+ CMD crm meta brief --task <id> --url <url> --domain <id> --kw <keyword> --start <date> --end <date>
250
+
223
251
  # Report schedules — list/get/run/snapshots/approve/reject covered. CRUD
224
252
  # bodies are too rich for flat flags; `create` and `update` take JSON via
225
253
  # --body (inline string | '@file.json' | '-' for stdin).
package/dist/bin/crm.js CHANGED
@@ -22,7 +22,9 @@ import { registerBrief } from "../src/commands/brief.js";
22
22
  import { registerMention } from "../src/commands/mention.js";
23
23
  import { registerTime } from "../src/commands/time.js";
24
24
  import { registerRank } from "../src/commands/rank.js";
25
+ import { registerMeta } from "../src/commands/meta.js";
25
26
  import { registerReport } from "../src/commands/report.js";
27
+ import { registerMarketplace } from "../src/commands/marketplace.js";
26
28
  import { maybeNudgeFromCache, readInstalledVersion, refreshCacheInBackground, } from "../src/utils/version-check.js";
27
29
  const program = new Command();
28
30
  program
@@ -45,7 +47,9 @@ registerIntegrations(program);
45
47
  registerSkill(program);
46
48
  registerTime(program);
47
49
  registerRank(program);
50
+ registerMeta(program);
48
51
  registerReport(program);
52
+ registerMarketplace(program);
49
53
  registerCommands(program);
50
54
  registerDoctor(program);
51
55
  // Nudge basado en cache: instantáneo, sin red. `crm doctor` refresca contra npm.
@@ -1 +1 @@
1
- {"version":3,"file":"crm.js","sourceRoot":"","sources":["../../bin/crm.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,M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E,CAAC;AACtB,8EAA8E;AAC9E,0EAA0E;AAC1E,+BAA+B;AAC/B,wBAAwB,EAAE,CAAC;AAE3B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
- /** `crm comment` — list + create comments on a task. */
1
+ /** `crm comment` — list + create + update comments on a task. */
2
+ import { readFileSync } from "node:fs";
2
3
  import { run } from "../transport/run.js";
3
4
  import { EXIT } from "../types.js";
4
5
  import { uploadGenericFiles } from "../lib/fileUpload.js";
@@ -23,14 +24,28 @@ export function registerComment(program) {
23
24
  .description("Añade un comentario (acepta adjuntos con --file). Los agentes usan kind=agent_log por defecto.")
24
25
  .requiredOption("--task <id>", "id de tarea")
25
26
  .option("--body <text>", "cuerpo del comentario (markdown + @menciones + #refs-de-tarea) — opcional si se adjunta --file")
27
+ .option("--body-file <path>", "lee el cuerpo desde un fichero — úsalo cuando el body lleve backticks/fenced code blocks o acentos que el shell rompería (se lee como UTF-8)")
26
28
  .option("--kind <kind>", "note | agent_log | decision (los agentes usan agent_log por defecto)")
27
29
  .option("--file <path...>", "ruta a un archivo a adjuntar — repite la bandera para varios (máx 10 MB cada uno; aviso a partir de 2 MB)")
28
30
  .action(async (opts, cmd) => {
29
31
  const flags = readFlags(cmd);
30
32
  const files = opts.file ?? [];
31
- const body = opts.body ?? "";
33
+ let body = opts.body ?? "";
34
+ if (opts.bodyFile) {
35
+ if (opts.body !== undefined) {
36
+ process.stderr.write("[USO] No combines --body y --body-file — elige uno.\n");
37
+ process.exit(EXIT.USAGE);
38
+ }
39
+ try {
40
+ body = readFileSync(opts.bodyFile, "utf8");
41
+ }
42
+ catch (err) {
43
+ process.stderr.write(`[USO] No se pudo leer --body-file ${opts.bodyFile}: ${err.message}\n`);
44
+ process.exit(EXIT.USAGE);
45
+ }
46
+ }
32
47
  if (body.trim().length === 0 && files.length === 0) {
33
- process.stderr.write("[USO] Especifica --body, --file, o ambos.\n");
48
+ process.stderr.write("[USO] Especifica --body, --body-file, --file, o una combinación.\n");
34
49
  process.exit(EXIT.USAGE);
35
50
  }
36
51
  const attachments = await uploadGenericFiles(files, flags.profile);
@@ -53,5 +68,45 @@ export function registerComment(program) {
53
68
  asAgent: flags.asAgent,
54
69
  });
55
70
  });
71
+ comment
72
+ .command("update")
73
+ .description("Edita el contenido de un comentario existente. Solo el autor o owner/admin pueden editar.")
74
+ .requiredOption("--id <commentId>", "id del comentario a editar")
75
+ .option("--body <text>", "nuevo cuerpo (markdown + @menciones + #refs-de-tarea). Alternativa a --body-file.")
76
+ .option("--body-file <path>", "lee el nuevo cuerpo desde un fichero — úsalo cuando el body lleve backticks/fenced code blocks que el shell rompería")
77
+ .action(async (opts, cmd) => {
78
+ const flags = readFlags(cmd);
79
+ let body = opts.body ?? "";
80
+ if (opts.bodyFile) {
81
+ if (opts.body !== undefined) {
82
+ process.stderr.write("[USO] No combines --body y --body-file — elige uno.\n");
83
+ process.exit(EXIT.USAGE);
84
+ }
85
+ try {
86
+ body = readFileSync(opts.bodyFile, "utf8");
87
+ }
88
+ catch (err) {
89
+ process.stderr.write(`[USO] No se pudo leer --body-file ${opts.bodyFile}: ${err.message}\n`);
90
+ process.exit(EXIT.USAGE);
91
+ }
92
+ }
93
+ if (body.trim().length === 0) {
94
+ process.stderr.write("[USO] Cuerpo vacío. Pasa --body o --body-file con contenido.\n");
95
+ process.exit(EXIT.USAGE);
96
+ }
97
+ await run({
98
+ method: "PATCH",
99
+ path: `/comments/${encodeURIComponent(opts.id)}`,
100
+ request: {
101
+ body: { content: body },
102
+ idempotencyKey: flags.idempotencyKey,
103
+ },
104
+ output: outputFromFlags(flags),
105
+ profile: flags.profile,
106
+ waitForApproval: flags.waitForApproval,
107
+ waitTimeoutMs: parseDurationMs(flags.timeout),
108
+ asAgent: flags.asAgent,
109
+ });
110
+ });
56
111
  }
57
112
  //# sourceMappingURL=comment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../src/commands/comment.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAGxD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3E,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAE/E,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,oCAAoC,CAAC;SACjD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;SACnC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,KAAK,EAAE,GAAY,EAAE,EAAE;QACpD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,GAAG,CAAC;YACR,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,UAAU,kBAAkB,CAAC,MAAM,CAAC,WAAW;YACrD,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC;YAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,gGAAgG,CAAC;SAC7G,cA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