@ghostystudio/cli 0.59.0 → 0.60.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 CHANGED
@@ -31,6 +31,7 @@ ghosty agents set <id> [--name] [--engine] [--model] [--prompt | --prompt-file F
31
31
  ghosty agents set <id> --prompt-base <base-id> --prompt-overlay overlay.json [--dry-run] # prompt = another agent's + edits, kept in sync
32
32
  ghosty agents share|unshare <id> <email> [--role editor|admin] # share without handing it over · agents shares <id> lists them
33
33
  ghosty agents teams ls|on|off|rm <id> [workspace] [--handle x] # which Teams workspaces it answers in, and its @handle there
34
+ ghosty agents archive|restore <id> # archive: stops answering, deleted after 7 days unless restored
34
35
  ghosty agents rm <id> [--from-workspace] [--yes] # --from-workspace: turn it off in Teams first
35
36
  ghosty agents set <id> [--tool wa:tool=off,…] [--bag NAME|none] [--avatar URL|FILE]
36
37
  ghosty agents restart <id>
@@ -109,6 +110,10 @@ Every command has its own help with examples: `ghosty <command> --help` or `ghos
109
110
 
110
111
  Exit codes: `0` ok · `1` API error · `2` usage error · `3` not signed in.
111
112
 
113
+ ### Changes in 0.60.0
114
+
115
+ - `agents archive <id>` / `agents restore <id>`: archive an agent (it stops answering on every channel and leaves the lists; deleted automatically after 7 days) or bring it back as it was. `agents ls --archived` lists archived agents and when they get deleted.
116
+
112
117
  ### Changes in 0.59.0
113
118
 
114
119
  - `spaces archive <workspace>` / `spaces restore <workspace>`: archive a workspace (same as Settings → Archive: it leaves `/app` and `spaces ls`; agents and data stay) or bring it back. Owner or staff; dry run first, archiving asks you to type the slug; logged as `workspace.archive` / `workspace.restore`.
package/dist/index.js CHANGED
@@ -8478,7 +8478,7 @@ async function postLong(path, body, timeoutMs = 9e5) {
8478
8478
  const req = httpsRequest(`${base}${path}`, {
8479
8479
  method: "POST",
8480
8480
  timeout: timeoutMs,
8481
- headers: { authorization: `Bearer ${token}`, "user-agent": `ghosty-cli/${"0.59.0"}`, "content-type": "application/json", "content-length": Buffer.byteLength(data) }
8481
+ headers: { authorization: `Bearer ${token}`, "user-agent": `ghosty-cli/${"0.60.0"}`, "content-type": "application/json", "content-length": Buffer.byteLength(data) }
8482
8482
  }, (res) => {
8483
8483
  let buf = "";
8484
8484
  res.on("data", (c) => buf += c);
@@ -8520,7 +8520,7 @@ async function request(path, opts = {}, retried = false) {
8520
8520
  method: opts.method ?? (opts.body !== void 0 || opts.raw !== void 0 ? "POST" : "GET"),
8521
8521
  headers: {
8522
8522
  authorization: `Bearer ${token}`,
8523
- "user-agent": `ghosty-cli/${"0.59.0"}`,
8523
+ "user-agent": `ghosty-cli/${"0.60.0"}`,
8524
8524
  "accept-language": lang(),
8525
8525
  ...opts.body !== void 0 ? { "content-type": "application/json" } : {},
8526
8526
  ...opts.headers
@@ -9080,6 +9080,11 @@ var need = (v, what, example) => {
9080
9080
  return v;
9081
9081
  };
9082
9082
  async function agentsLs(workspace, f = {}) {
9083
+ if (f.archived) {
9084
+ const r2 = await api("/api/v2/me/agents/archived");
9085
+ if (f.ids) return void process.stdout.write(r2.agents.map((a) => a.id).join("\n") + (r2.agents.length ? "\n" : ""));
9086
+ return out(r2.agents, () => table(r2.agents.map((a) => ({ id: a.id, name: a.name, engine: a.engine, archivedAt: a.archivedAt, purgeAt: a.purgeAt })), ["id", "name", "engine", "archivedAt", "purgeAt"]));
9087
+ }
9083
9088
  if (f.sponsor || f.owner) {
9084
9089
  const q = new URLSearchParams({ ...f.sponsor ? { sponsor: f.sponsor } : {}, ...f.owner ? { owner: f.owner } : {}, ...f.engine ? { engine: f.engine } : {}, ...workspace && !f.all ? { workspace } : {} });
9085
9090
  const s2 = await api(`/api/v2/agents?${q}`);
@@ -9354,6 +9359,15 @@ async function agentsRm(id, v = {}) {
9354
9359
  const r = await api(agentPath(id, from ? "?fromWorkspace=1" : ""), { method: "DELETE" });
9355
9360
  out(r, () => `${lavender("\u2713")} ${t("Deleted", "Borrado")} ${id}.${r?.unbound?.length ? dim(t(` Turned off in Teams: ${r.unbound.join(", ")}.`, ` Desactivado en Teams: ${r.unbound.join(", ")}.`)) : ""}`);
9356
9361
  }
9362
+ async function agentsArchive(id, archive) {
9363
+ id = need(id, "agent id", `ghosty agents ${archive ? "archive" : "restore"} <agent-id>`);
9364
+ const r = await api(agentPath(id, "/archive"), { method: "POST", body: { archive } });
9365
+ const day3 = r.purgeAt ? r.purgeAt.slice(0, 10) : "";
9366
+ out(
9367
+ r,
9368
+ () => !r.changed ? dim(archive ? t(`Already archived (deleted on ${day3}).`, `Ya estaba archivado (se borra el ${day3}).`) : t("It wasn't archived.", "No estaba archivado.")) : archive ? `${lavender("\u2713")} ${t(`Archived ${id}. It no longer answers anywhere; deleted on ${day3} unless you restore it (ghosty agents restore ${id}).`, `Archivado ${id}. Ya no contesta en ning\xFAn canal; se borra el ${day3} si no lo restauras (ghosty agents restore ${id}).`)}` : `${lavender("\u2713")} ${t(`Restored ${id}.`, `Restaurado ${id}.`)}${r.teams.length || r.whatsapp ? dim(t(` Back on: ${[...r.teams.length ? [`Teams (${r.teams.length})`] : [], ...r.whatsapp ? ["WhatsApp"] : []].join(", ")}.`, ` De vuelta: ${[...r.teams.length ? [`Teams (${r.teams.length})`] : [], ...r.whatsapp ? ["WhatsApp"] : []].join(", ")}.`)) : ""}`
9369
+ );
9370
+ }
9357
9371
  async function setAvatar(id, src) {
9358
9372
  if (/^https:\/\//.test(src)) return api(agentPath(id, "/avatar"), { method: "PUT", body: { url: src } });
9359
9373
  const bytes = await readFile3(src).catch(() => {
@@ -10418,7 +10432,7 @@ async function call(path, v, init = {}) {
10418
10432
  "x-ghosty-ts": ts,
10419
10433
  "x-ghosty-sig": sig,
10420
10434
  "content-type": "application/json",
10421
- "user-agent": `ghosty-cli/${"0.59.0"}`
10435
+ "user-agent": `ghosty-cli/${"0.60.0"}`
10422
10436
  },
10423
10437
  body: method === "GET" ? void 0 : raw
10424
10438
  });
@@ -12090,6 +12104,8 @@ var HELPS_ES = {
12090
12104
  ["# Teams workspaces you administer: where it answers, is paused, and with which @handle", "# los equipos de Teams que administras: d\xF3nde contesta, d\xF3nde est\xE1 en pausa y con qu\xE9 @handle"],
12091
12105
  ["# turn it on there (or change its @handle)", "# lo prende ah\xED (o le cambia el @handle)"],
12092
12106
  ["# pause it there; it keeps its @handle", "# lo pausa ah\xED; conserva su @handle"],
12107
+ ["# archive: stops answering everywhere, hidden, deleted after 7 days unless restored", "# archivar: deja de contestar en todos lados, se oculta y se borra a los 7 d\xEDas si no lo restauras"],
12108
+ ["# archived agents and when they get deleted", "# los archivados y cu\xE1ndo se borran"],
12093
12109
  ["# remove it from there; the agent stays", "# lo quita de ah\xED; el agente sigue"],
12094
12110
  ["# web widget: chat bubble on your site, only on those domains", "# widget web: burbuja de chat en tu sitio, s\xF3lo en esos dominios"],
12095
12111
  ["# state + the <script> to paste", "# su estado + el <script> para pegar"]
@@ -12639,6 +12655,8 @@ var HELPS = {
12639
12655
  "ghosty agents embed <agent-id> [--copy '{json}'|none] [--copy-file texts.json] # what it says while it works",
12640
12656
  "ghosty agents embed <agent-id> theme # export the theme as JSON (edit it, apply it back with --style-file)",
12641
12657
  "ghosty agents embed <agent-id> --out src/components/GhostyChat.tsx [--force] # your own React component, token and theme baked in",
12658
+ "ghosty agents archive|restore <agent-id> # archive: stops answering everywhere, hidden, deleted after 7 days unless restored",
12659
+ "ghosty agents ls --archived # archived agents and when they get deleted",
12642
12660
  "ghosty agents rm <agent-id> [--from-workspace] [--yes]"
12643
12661
  ],
12644
12662
  flags: [
@@ -15200,6 +15218,7 @@ async function main() {
15200
15218
  avatar: { type: "string" },
15201
15219
  tool: { type: "string" },
15202
15220
  "from-workspace": { type: "boolean" },
15221
+ archived: { type: "boolean" },
15203
15222
  "quota-hits": { type: "boolean" },
15204
15223
  by: { type: "string" },
15205
15224
  models: { type: "boolean" },
@@ -15249,7 +15268,7 @@ async function main() {
15249
15268
  const tokens = splitTokens(pos, v);
15250
15269
  globals.token = tokens.session;
15251
15270
  globals.profile = v.profile;
15252
- if (v.version) return out({ version: "0.59.0" }, () => "0.59.0");
15271
+ if (v.version) return out({ version: "0.60.0" }, () => "0.60.0");
15253
15272
  for (const n of normalizeArgs(pos, v)) if (!globals.json) info(dim(n));
15254
15273
  const context = (await readConfig()).workspace;
15255
15274
  if (!explicitToken()?.startsWith("gat_")) {
@@ -15298,7 +15317,7 @@ async function main() {
15298
15317
  case "agents":
15299
15318
  if ((sub === "ls" || sub === "list" || !sub) && v.user && v.app !== void 0) return appAgentsOf(v.user, v.app);
15300
15319
  if ((sub === "ls" || sub === "list" || !sub) && v.handle) return agentsByHandle(v.handle, v.workspace ?? context);
15301
- if (sub === "ls" || sub === "list" || !sub) return agentsLs(v.all ? void 0 : v.workspace ?? context, { sponsor: v.sponsor, owner: v.owner, engine: v.engine, ids: v.ids, all: v.all });
15320
+ if (sub === "ls" || sub === "list" || !sub) return agentsLs(v.all ? void 0 : v.workspace ?? context, { sponsor: v.sponsor, owner: v.owner, engine: v.engine, ids: v.ids, all: v.all, archived: v.archived });
15302
15321
  if (sub === "create" || sub === "new") {
15303
15322
  if (v.workspace === "none") delete v.workspace;
15304
15323
  else if (!v.workspace && context) {
@@ -15312,6 +15331,7 @@ async function main() {
15312
15331
  if (sub === "teams") return agentsTeams(a1, a2, pos[4], v);
15313
15332
  if (sub === "set") return agentsSet(a1, v);
15314
15333
  if (sub === "rm" || sub === "delete") return agentsRm(a1, v);
15334
+ if (sub === "archive" || sub === "restore") return agentsArchive(a1, sub === "archive");
15315
15335
  if (sub === "doctor" && v.user) return userDoctor(v.user, a1, v);
15316
15336
  if (sub === "doctor") return agentsDoctor(a1, v);
15317
15337
  if (sub === "docs" || sub === "documents") return agentDocsCmd(a1, a2, pos.slice(4).filter((x) => x !== void 0), v);
@@ -15415,7 +15435,7 @@ async function main() {
15415
15435
  throw unknown(cmd, cmd, COMMANDS, "ghosty --help");
15416
15436
  }
15417
15437
  }
15418
- var notice = updateNotice("0.59.0").catch(() => null);
15438
+ var notice = updateNotice("0.60.0").catch(() => null);
15419
15439
  main().then(
15420
15440
  async () => {
15421
15441
  const n = await notice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghostystudio/cli",
3
- "version": "0.59.0",
3
+ "version": "0.60.0",
4
4
  "description": "Official Ghosty Studio CLI — configure, test and chat with your agents from the terminal. Built for humans and coding agents.",
5
5
  "type": "module",
6
6
  "bin": {