ghosty-acp 0.0.61 → 0.0.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghosty-acp",
3
- "version": "0.0.61",
3
+ "version": "0.0.63",
4
4
  "description": "Conecta tu editor a un agente ACP remoto. Puente entre entrada/salida estándar y WebSocket, sin dependencias.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -5,7 +5,7 @@ license: MIT
5
5
  compatibility: Needs Node 22+ (for npx @ghostystudio/cli) or curl, and network access to https://www.ghosty.studio
6
6
  metadata:
7
7
  author: ghosty-studio
8
- version: "1.82"
8
+ version: "1.89"
9
9
  ---
10
10
 
11
11
  # Configure a Ghosty Studio agent
@@ -144,7 +144,7 @@ legacy and always `true`.)
144
144
  | "create a workspace" | `ghosty spaces create <slug> --dry-run`, then without `--dry-run` (yours, trial; same rules as the web: confirmed email, plan cap). `--combo` other than teams: staff |
145
145
  | "bring only the ad leads from this number" | `ghosty channels whatsapp history <id> --integration <formmy-id> --dry-run --list --only-ads` → show which, then without `--dry-run` (`--yes`); new numbers: `channels whatsapp link … --ads-only on` |
146
146
  | "this agent answers two numbers, keep their boards separate" | `ghosty channels whatsapp link <id> --integration <formmy-id> --board "<board>" --dry-run` per number (`--board agent` = back to the agent's); `channels whatsapp ls <id>` shows each number's board |
147
- | "why did it fail? / it didn't answer" | `ghosty turns ls <id> --errors --since 24h --json` → failed turns with their `error`; a WhatsApp customer got NO turn at all: `ghosty turns ls <id> --skipped --since 24h --json` → `reason` (manual_mode, records_only, paused, reaction, channel_off, no_quota) |
147
+ | "why did it fail? / it didn't answer" | `ghosty turns ls <id> --errors --since 24h --json` → failed turns with their `error`; a WhatsApp customer got NO turn at all: `ghosty turns ls <id> --skipped --since 24h --json` → `reason` (manual_mode, records_only, paused, reaction, channel_off, no_quota, own_number) |
148
148
  | "what did it answer to that? / audit a reply" | `ghosty turns show <id> [turn-id] --json` → `input` (what came in) and `output` (what it answered), any engine or channel |
149
149
  | "where did it say X? / find the turn where it quoted…" | `ghosty turns grep <id> "text" --since 7d [--role user\|agent] --json` → `matches[]` with `turnId` and `snippet`; then `turns show <id> <turnId>`. Text only, not tools |
150
150
  | "set the quote issuer / VAT / folio prefix" (house `cotizar` tool) | `ghosty agents set <id> --quote iva=0,prefix=SFI,vigencia=15` (empty value clears: `rfc=`); `ghosty agents get <id> --fields cotizacion` to read it. An own skill named `cotizar` already turns the house tool off |
@@ -153,6 +153,7 @@ legacy and always `true`.)
153
153
  | "is it running the new image? / it still behaves old" | `ghosty agents box <id> --check <path-the-new-image-brings> --json` → `stale`; if > 0, `ghosty agents box <id> --recycle`, one turn, check again (ACP: `agents restart`) |
154
154
  | "which PDF templates does it have?" | `ghosty skills templates <id> --json` → `templates[]` with `source` (`agente:<skill>` or `casa`); its own go in `<skill>/pdf-templates/<name>.html` |
155
155
  | "give it this database / what can it write" | `ghosty dbs ls <id>`, `ghosty dbs tables <id> <db>`, `ghosty dbs grant <id> <db> [--external-write t1,t2] [--external-rows t:col+col]` (tables it may write from WhatsApp/Messenger; tables where each customer sees only their own rows, matched by phone column — use it for any customers/orders table) |
156
+ | "undo what the agent wrote / restore the database" | `ghosty dbs checkpoints <id> <db>` (a checkpoint is taken before the first write of each agent turn and before panel deletes), then `ghosty dbs restore <id> <db> <checkpoint-id>`; it takes another checkpoint first, so the restore can be undone too |
156
157
  | "are the catalog photos permanent? / photos stopped showing on WhatsApp" | `ghosty dbs tables <id> <db>` → per photo column permanent · external · empty; external ones: `ghosty dbs rehost <id> <db> --table T --column C` |
157
158
  | "here are the photos the customer sent" (a folder named by SKU) | `ghosty dbs photos put <id> <db> --table catalogo --key-column sku --dir <folder> --dry-run`, show which SKUs have no row, then without `--dry-run` |
158
159
  | "remove these env variables" | `ghosty agents set <id> --unset-env K1,K2` |
@@ -160,7 +161,9 @@ legacy and always `true`.)
160
161
  | "how much did this workspace use / which agent spends most / messages left without balance" | `ghosty usage --workspace <slug> --by agent,day --days 14 --json` → `rows`, `agents` (turns, failed, billable, noQuota); the unanswered ones: `ghosty turns ls --workspace <slug> --quota-hits --json` (owner or staff) |
161
162
  | "how much does this agent cost / API equivalent / spend of /c vs Messenger" | `ghosty usage --agent <id> --by model,day,canal --cost --json` → `rows` (day, model, canal, tokens, `usd` at provider list price) and `totalUsd`; its turns per channel: `ghosty turns ls <id> --canal anon --json` |
162
163
  | "who answers /c without an account / turn native subagents on for X" or "give this agent a bigger box" | staff only: `ghosty settings ls`, `ghosty settings set ANON_NATIVE_AGENT_ID <agent-id>` (`unset` = back to the default), `ghosty settings set NATIVE_SUBAGENT_AGENTS +<agent-id>`; box: `ghosty agents set <id> --box 4096:10` (MB:conversations, recycles its boxes) |
164
+ | "did a Meta campaign pause? / why are no ad leads coming in?" | staff only: `ghosty ads watch` (accounts, active campaigns, token expiry, last ad lead per ads-only number) and `ghosty ads watch run --dry-run` (what it would alert now). Alerts reach staff by themselves every hour |
163
165
  | "give this agent its own token bag / make it one-time" | staff only: `ghosty bags ls <workspace>`, `ghosty bags create <workspace> "<bag>" --tokens 20M [--recurring off]`, `ghosty agents set <id> --bag "<bag>"`; change: `ghosty bags set <workspace> "<bag>" --tokens 30M` |
166
+ | "move this workspace to pro / give it a plan as a courtesy" | staff only: `ghosty spaces plan <workspace> trial|pro|empresarial [--courtesy] [--until YYYY-MM-DD] [--note "…"] --dry-run --json` → `before`/`after` (plan, modelCap, tokensUsed/tokensIncluded, hardCap, paidUntil) and `warnings`; confirm, then `--yes`. Never charges Stripe nor emails the customer |
164
167
  | "renew / extend this workspace" or "rename its slug" | staff only: `ghosty spaces renew <workspace> --until YYYY-MM-DD --dry-run`, confirm, then `--yes`; `ghosty spaces rename <old> <new> --dry-run` first |
165
168
  | "make X the owner of this workspace / hand it over to the client" | staff only: `ghosty spaces transfer <workspace> --to <email> --keep-as admin --copy-keys --dry-run --json` → `keys.missing` (agents without a key stop answering) and `warnings`; confirm with the user, then without `--dry-run` plus `--yes`. Only the owner changes: agents, skills and history stay; documents, databases, boards and numbers its agents use move (`resources`); anything also used outside stays and shows in `warnings`. `--copy-keys` also copies the connectors (MercadoPago, Skydropx…) it lacks |
166
169
  | "assign X (Ghosty staff) to this client" | staff only: `ghosty staff assign <staff-email> <client-email> --reason "…"` (`unassign` to remove, `staff ls`); the assigned person operates the client's agents, documents, databases and boards as themselves, without keys, billing or transfers |
@@ -171,6 +174,9 @@ legacy and always `true`.)
171
174
  | "are images being metered / how much do images cost on Free" | staff only: `ghosty usage --images --plan free --since 7d [--by user]` — charges vs images agents delivered (far more deliveries than charges = the meter isn't reporting) and stored cost vs the table |
172
175
  | "did the push reach them / did the announcement go out" | staff only: `ghosty push log --user <email> --since 2d` (announcements show as `novedad`); `ghosty novedades ls` shows delivered/rejected per announcement |
173
176
  | "my site is paused / will pause", "keep my page online", "pin my site", "reactivate my page" | `ghosty sites ls` (state: pinned, paused, pauses on…), then `ghosty sites pin <slug>` — «Sitios fijos»: $49 USD/yr or $5 USD/mo ($990 / $99 MXN), includes up to 3 sites; never pauses, no banner. With a free slot it pins at once; otherwise it prints a card-payment link to hand over as is; `needs_pack` = all slots used: ask, then `--add-pack`. `--interval month`, `--currency mxn`. `ghosty sites unpin <slug>` frees a slot; `ghosty sites pins [--cancel]` |
177
+ | "put my domain on my app", "use reservas.midominio.com", "custom domain" | `ghosty sites domain add <slug> <domain>` prints the DNS record (CNAME to `<slug>.ghosty.page` for a subdomain, A to the printed IP for the root); hand it over in one line. After they add it: `ghosty sites domain verify <slug> <domain>` (DNS can take minutes to a couple of hours; Cloudflare proxy off). Verified = the app answers at `https://<domain>`, HTTPS issued on the first visit. Apps with a backend only. `ghosty sites domain ls <slug>`, `rm <slug> <domain>` |
178
+ | "I have a coupon", "redeem HACK2026", "create a coupon for the event" (staff) | `ghosty coupons redeem <CODE>` (one per account; adds balance and may lend a plan until a date). Or the link `https://www.ghosty.studio/canjear?codigo=<CODE>`. Staff: `ghosty coupons create <CODE> --credit 50 [--plan pro --until ISO] [--max N]` is born a draft; `ghosty coupons set <CODE> --on` turns it on; `ghosty coupons ls` |
179
+ | "sign in with Google in my app", "login with Google" | No Google console: the app copies `https://www.ghosty.studio/apps/auth/ghosty-login.mjs` (no deps), sends the button to `loginUrl({ returnTo, state })` and on the callback calls `verifyLogin(id_token)` → `{ sub, email, name, picture }`. `returnTo` must be `<slug>.ghosty.page` or a verified custom domain. Docs: /docs/apps |
174
180
  | "publish this demo / landing as a Ghosty site", "change its URL / slug" | staff only: `ghosty sites publish <file.html|folder> --title T [--slug S]` (house site on EasyBits: no owner, no expiry, no banner); update it with `--site <slug>` (without it a NEW site is created); `ghosty sites slug <slug> <new-slug>`; `ghosty sites ls --house`. Exit 1 with `slug_unsupported` = EasyBits does not accept a slug yet: say so, don't retry |
175
181
  | "turn this tool off for customers / in WhatsApp" | `ghosty agents get <id> --fields tools --json` → `tools.canales` (what really runs per channel), then `ghosty agents set <id> --tool wa:<tool>=off` (no channel = everywhere). Team tools (identity, notes, full board, the owner's personal accounts) never run for customers and `=on` can't open them; a whole connector per channel: agent page → Connectors |
176
182
  | "put this face / avatar on the agent" | `ghosty agents set <id> --avatar <https-url or local png/jpg/webp>` → updates every Teams where it's active |
@@ -208,6 +214,8 @@ legacy and always `true`.)
208
214
  | "why did this run take so long?", "what did run N cost?", "where did @build spend its time?" | `ghosty factory runs show <n> --timing --workspace <slug> --json` (each role's turns with minutes, model, USD; clock split working / waiting for a person / other; commands ≥ 60 s). Long commands without output usually mean a hung test or a missing service in the work box |
209
215
  | "why did run N fail / get stuck?", "what should we change so it doesn't happen again?" | `ghosty factory runs why <n> --workspace <slug> --json` (category — `approved_unmet_criterion` first when a plan criterion like "in the preview" was approved without evidence, see `acceptance[]` —, impact, critical step with evidence, typed actions: role_rules → `.ghosty/factory.md`, repo_setup, skill, prompt; `--refresh` redoes it). Stuck patterns per step are in `runs show <n> --timing` |
210
216
  | "how is the factory doing?", "cost per merged PR", "merge rate" | `ghosty factory runs stats --since 30d [--repo owner/repo] --workspace <slug> --json` |
217
+ | "connect this repo to the factory", "create a factory room", "set up the factory for <repo>" | `ghosty factory rooms connect owner/repo --room <name> --create --workspace <slug> --json` (checks the GitHub App sees it; returns `readiness` = what's missing); `ghosty factory rooms ls --workspace <slug>`; `rooms disconnect … --yes` |
218
+ | "hand this to the factory", "let the factory build it", "delegate this PR", "send it to @plan" | `ghosty factory run "<goal, why, how we know it's done>" --repo owner/repo --wait --workspace <slug> --json` → it returns at `plan_review` with `next` (the commands). Show the user the plan (`runs show <n> --full`) and ask before `runs approve <n> --plan-version N --yes`; then `runs watch <n>` until `pr_review` and ask before `runs merge <n> --yes`. `runs changes <n> --note "…"` sends it back; `runs card <n>` brings the live card down. More in the `ghosty-factory` skill |
211
219
  | "list / show / rename a factory run", "who is @build?" | `ghosty factory runs ls --workspace <slug> [--room R]` (with time and cost), `ghosty factory runs show <n> --workspace <slug> [--full]`, `ghosty factory runs rename <n> "Title" --workspace <slug> --dry-run` then `--yes`; `ghosty agents ls --handle build [--workspace <slug>]` |
212
220
  | "clean up the board / archive test cards" | `ghosty cards archive <id> --integration X \| --column X \| --before 30d --dry-run` first, then with `--yes` after the user confirms (reversible) |
213
221
  | "which conversations does it have?" | `ghosty conversations ls <id> --json`; read one with `ghosty conversations show <id> <conv-id> --json` (`messages[]` with `role`, `text`); continue one with `ghosty chat <id> "…" --conversation <conv-id>` |
@@ -237,7 +245,7 @@ Read `references/api.md` for exact request/response shapes before calling.
237
245
  - **Restart is not free**: it cuts a turn in progress. Batch changes, restart once at the end.
238
246
  - Files go to the agent's working directory; tell the user the agent can `ls` them. Max 10 MB each.
239
247
  - Never print the token back to the user or into logs.
240
- - **Destructive commands need `--yes`** when you run them (no terminal): `agents rm`, `files rm`, `skills rm`, `credentials rm`, `board archive`, `dbs import` over existing rows, `channels whatsapp enable`, `channels wa groups enable`, `channels whatsapp link|unlink|history`, `channels wa import`, `agents unshare`, `boards move-cards`, `spaces members rm`, `cards reply`, `cards pending --reply`, `factory runs rename`. Confirm with the user BEFORE adding it; prefer `--dry-run` first where it exists.
248
+ - **Destructive commands need `--yes`** when you run them (no terminal): `agents rm`, `files rm`, `skills rm`, `credentials rm`, `board archive`, `dbs import` over existing rows, `channels whatsapp enable`, `channels wa groups enable`, `channels whatsapp link|unlink|history`, `channels wa import`, `agents unshare`, `boards move-cards`, `spaces members rm`, `cards reply`, `cards pending --reply`, `factory runs rename`, `factory runs approve|changes|merge`. Confirm with the user BEFORE adding it; prefer `--dry-run` first where it exists.
241
249
 
242
250
  ## Verify
243
251
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: ghosty-factory
3
- description: Prepare and maintain a GitHub repo for the Ghosty Software Factory (@plan, @build, @check agents working from Ghosty Teams) — AGENTS.md, the docs/agents/ knowledge base, .ghosty/factory.md (which agent and model plays each role) and small, reviewable PRs. Use when the user mentions Ghosty Factory, Software Factory, @plan/@build/@check, .ghosty/factory.md, docs/agents or wants their repo "ready for agents".
3
+ description: Prepare and maintain a GitHub repo for the Ghosty Software Factory (@plan, @build, @check agents working from Ghosty Teams) — AGENTS.md, the docs/agents/ knowledge base, .ghosty/factory.md (which agent and model plays each role) and small, reviewable PRs. Use when the user mentions Ghosty Factory, Software Factory, @plan/@build/@check, .ghosty/factory.md, docs/agents or wants their repo "ready for agents". Also use it to DELEGATE work from your terminal to the factory with `ghosty factory run` ("hand this to the factory", "let @build do it", "open a factory run").
4
4
  license: MIT
5
5
  compatibility: Any git repository hosted on GitHub. Network access to https://www.ghosty.studio for the docs.
6
6
  metadata:
7
7
  author: ghosty-studio
8
- version: "1.0"
8
+ version: "1.2"
9
9
  ---
10
10
 
11
11
  # Get a repo ready for the Ghosty Software Factory
@@ -92,6 +92,34 @@ Conventions of this repo that @plan, @build and @check must know:
92
92
  migrations, dependencies, public API or `.github/`. Split big work.
93
93
  - **`CODEOWNERS`** covering `.github/`, so a person reviews CI changes.
94
94
 
95
+ ## 5. Delegate from your terminal
96
+
97
+ You (Claude Code, Codex…) can hand work to the factory and keep going with the user. It runs in
98
+ the repo's Teams room with the same plan, approvals and card as if the user typed it there.
99
+
100
+ **Delegate** long, self-contained work with a clear "done": a feature behind a flag, a refactor
101
+ with tests, a migration with a checklist, a bug with a reproduction. **Keep it** when it needs
102
+ back-and-forth with the user, it's a few lines, or you're still figuring out what to build.
103
+
104
+ 0. If no room has the repo yet (`ghosty factory rooms ls --workspace <slug>`), connect it:
105
+ `ghosty factory rooms connect owner/repo --room <name> --create --workspace <slug>`. If it says
106
+ the GitHub App doesn't see the repo, give the user the link it prints. It also reports what the
107
+ repo is missing to be "ready for agents" (sections 1–4 above fix most of it).
108
+ 1. Write the request like a ticket: the goal, why, how we'll know it's done (a check a person can
109
+ run), and the files or docs to read first. One request = one PR.
110
+ 2. `ghosty factory run "<request>" --repo owner/repo --wait --workspace <slug> --json`. It returns
111
+ at `plan_review` with `next` (the exact commands). If the repo is in several rooms, add `--room`.
112
+ 3. Show the user the plan (`ghosty factory runs show <n> --full`) and **ask before signing**:
113
+ `ghosty factory runs approve <n> --plan-version <N> --yes`. To send it back:
114
+ `ghosty factory runs changes <n> --note "…" --yes`.
115
+ 4. `ghosty factory runs watch <n> --json` until `pr_review` (or `escalated`: show the points and
116
+ let the user choose `approve` = another loop, or `changes` = replan).
117
+ 5. Show the PR and **ask before merging**: `ghosty factory runs merge <n> --yes`. If CI is still
118
+ running it queues and goes in when it passes.
119
+
120
+ Exit code 1 from `--wait`/`watch` only means the timeout ran out; run `watch` again. The user can
121
+ always follow along in the room; `ghosty factory runs card <n>` brings the live card down.
122
+
95
123
  ## Verify
96
124
 
97
125
  - Every command in `AGENTS.md` runs.