@agentgates/cli 0.72.0 → 0.73.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/dist/cli.mjs +83 -5
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -3128,7 +3128,7 @@ var init_constants = __esm({
|
|
|
3128
3128
|
trim = (v) => v ? v.replace(/\/$/, "") : "";
|
|
3129
3129
|
CLI_API_ORIGIN = trim(process.env.BOUNTY_API_ORIGIN) || "https://cli.agentgates.ai";
|
|
3130
3130
|
CREATORS_ORIGIN = trim(process.env.BOUNTY_CREATORS_ORIGIN) || "https://agentgates.ai";
|
|
3131
|
-
CLI_VERSION = "0.
|
|
3131
|
+
CLI_VERSION = "0.73.0";
|
|
3132
3132
|
CLI_USER_AGENT = `agentgates-cli/${CLI_VERSION}`;
|
|
3133
3133
|
AI_DIRECTIVE = "\n[AI: present the above verbatim inside a markdown code block. Do not reformat, summarize, or omit rows.]";
|
|
3134
3134
|
}
|
|
@@ -32689,7 +32689,7 @@ var require_package = __commonJS({
|
|
|
32689
32689
|
"package.json"(exports, module) {
|
|
32690
32690
|
module.exports = {
|
|
32691
32691
|
name: "@agentgates/cli",
|
|
32692
|
-
version: "0.
|
|
32692
|
+
version: "0.73.0",
|
|
32693
32693
|
description: "Wallet operations for AI agents and humans",
|
|
32694
32694
|
keywords: [
|
|
32695
32695
|
"crypto",
|
|
@@ -76405,6 +76405,73 @@ async function sitesList(opts) {
|
|
|
76405
76405
|
fail6(opts, err);
|
|
76406
76406
|
}
|
|
76407
76407
|
}
|
|
76408
|
+
var CHANGE_ID_RE = /^[A-Za-z0-9_-]{22}$/;
|
|
76409
|
+
function cardAad(owner, card2) {
|
|
76410
|
+
return `AGENTGATES-CONVERSATION-v1|turn|${normalizeOwner2(owner)}|${card2.conversationId}|${card2.seq}|assistant|card|`;
|
|
76411
|
+
}
|
|
76412
|
+
async function sitesChange(changeId, opts) {
|
|
76413
|
+
try {
|
|
76414
|
+
if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
|
|
76415
|
+
const { wallet } = await requirePasswordsKey();
|
|
76416
|
+
const out = expectOk(await signedFetch(wallet, "GET", lanePath(`/sites/changes/${changeId}`)), "sites change");
|
|
76417
|
+
const key = await mailKeyFor(wallet).catch(() => null);
|
|
76418
|
+
const latest = [...out.rounds ?? []].reverse().find((r) => r.card) ?? null;
|
|
76419
|
+
let card2 = null;
|
|
76420
|
+
if (key && latest?.card) {
|
|
76421
|
+
try {
|
|
76422
|
+
card2 = JSON.parse(openText(key.dataKey, latest.card.ciphertext, cardAad(wallet.address, latest.card)));
|
|
76423
|
+
} catch {
|
|
76424
|
+
card2 = null;
|
|
76425
|
+
}
|
|
76426
|
+
}
|
|
76427
|
+
const c = out.change;
|
|
76428
|
+
emit10(opts, { ok: true, change: c, rounds: (out.rounds ?? []).map((r) => ({ id: r.id, round: r.round, state: r.state, cardRef: r.cardRef })), card: card2 ? { words: card2.words ?? null } : null }, () => {
|
|
76429
|
+
process.stdout.write(`
|
|
76430
|
+
${import_picocolors18.default.bold(c.id)} ${c.state === "ready" ? import_picocolors18.default.green("ready") : import_picocolors18.default.yellow(c.state)} ${import_picocolors18.default.dim(`round ${c.round}`)}
|
|
76431
|
+
`);
|
|
76432
|
+
if (card2?.words) process.stdout.write(` ${card2.words}
|
|
76433
|
+
`);
|
|
76434
|
+
if (c.state === "ready") process.stdout.write(` ${import_picocolors18.default.dim(`ship it: agentgates sites ship ${c.id}`)}
|
|
76435
|
+
`);
|
|
76436
|
+
process.stdout.write("\n");
|
|
76437
|
+
});
|
|
76438
|
+
} catch (err) {
|
|
76439
|
+
fail6(opts, err);
|
|
76440
|
+
}
|
|
76441
|
+
}
|
|
76442
|
+
async function sitesShip(changeId, opts) {
|
|
76443
|
+
try {
|
|
76444
|
+
if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
|
|
76445
|
+
const { wallet } = await requirePasswordsKey();
|
|
76446
|
+
const read = expectOk(await signedFetch(wallet, "GET", lanePath(`/sites/changes/${changeId}`)), "sites change");
|
|
76447
|
+
const head = read.change?.headSha;
|
|
76448
|
+
if (read.change?.state !== "ready" || !head) throw new Error(`the change is ${read.change?.state ?? "unread"}: only a ready change ships`);
|
|
76449
|
+
const out = expectOk(await signedFetch(wallet, "POST", lanePath(`/sites/changes/${changeId}/ship/${head}`)), "sites ship");
|
|
76450
|
+
emit10(opts, { ok: true, change: out.change }, () => {
|
|
76451
|
+
process.stdout.write(`
|
|
76452
|
+
${import_picocolors18.default.green(out.change.state)} ${import_picocolors18.default.dim(out.change.id)}
|
|
76453
|
+
|
|
76454
|
+
`);
|
|
76455
|
+
});
|
|
76456
|
+
} catch (err) {
|
|
76457
|
+
fail6(opts, err);
|
|
76458
|
+
}
|
|
76459
|
+
}
|
|
76460
|
+
async function sitesSkip(changeId, opts) {
|
|
76461
|
+
try {
|
|
76462
|
+
if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
|
|
76463
|
+
const { wallet } = await requirePasswordsKey();
|
|
76464
|
+
const out = expectOk(await signedFetch(wallet, "POST", lanePath(`/sites/changes/${changeId}/skip`)), "sites skip");
|
|
76465
|
+
emit10(opts, { ok: true, change: out.change }, () => {
|
|
76466
|
+
process.stdout.write(`
|
|
76467
|
+
${import_picocolors18.default.yellow(out.change.state)} ${import_picocolors18.default.dim(out.change.id)}
|
|
76468
|
+
|
|
76469
|
+
`);
|
|
76470
|
+
});
|
|
76471
|
+
} catch (err) {
|
|
76472
|
+
fail6(opts, err);
|
|
76473
|
+
}
|
|
76474
|
+
}
|
|
76408
76475
|
|
|
76409
76476
|
// src/commands/agent.ts
|
|
76410
76477
|
init_lib2();
|
|
@@ -76418,7 +76485,7 @@ import { createHash as createHash6 } from "node:crypto";
|
|
|
76418
76485
|
// src/lib/conversation-seal.ts
|
|
76419
76486
|
var CONVERSATION_SUITE = "AGENTGATES-CONVERSATION-v1";
|
|
76420
76487
|
var JOURNAL_COPY_SUITE = "AGENTGATES-MEMORY-JOURNAL-v1";
|
|
76421
|
-
var CONVERSATION_AUTHORS = ["person", "assistant", "agent", "act"];
|
|
76488
|
+
var CONVERSATION_AUTHORS = ["person", "assistant", "agent", "act", "card"];
|
|
76422
76489
|
var CONVERSATION_CHANNELS = ["site", "telegram", "whatsapp", "mail", "sms", "voice", "mcp"];
|
|
76423
76490
|
function isConversationAuthor(value) {
|
|
76424
76491
|
return typeof value === "string" && CONVERSATION_AUTHORS.includes(value);
|
|
@@ -76431,7 +76498,8 @@ function roleOfAuthor(author) {
|
|
|
76431
76498
|
}
|
|
76432
76499
|
function readConversationOrigin(author, channel) {
|
|
76433
76500
|
if (!isConversationAuthor(author)) return null;
|
|
76434
|
-
if (channel === null || channel === void 0 || channel === "") return author === "act" ? { author, channel: null } : null;
|
|
76501
|
+
if (channel === null || channel === void 0 || channel === "") return author === "act" || author === "card" ? { author, channel: null } : null;
|
|
76502
|
+
if (author === "card") return null;
|
|
76435
76503
|
return isConversationChannel(channel) ? { author, channel } : null;
|
|
76436
76504
|
}
|
|
76437
76505
|
function conversationOwner(address) {
|
|
@@ -82159,9 +82227,19 @@ integrations.command("signup-report <signupId>").description("Report a signup's
|
|
|
82159
82227
|
integrations.command("signup-handoff <signupId> <provider>").description("Hand the connect material back and connect the row: GitHub's install redirect (--code --installation-id), Vercel's (--code --configuration-id), or Neon's key sealed to the box (--sealed <file> with {grantCvm, cvmKeyId}).").option("--code <code>", "the provider's install redirect code").option("--installation-id <id>", "GitHub's installation id").option("--setup-action <action>", "GitHub's setup action (install|request)").option("--configuration-id <id>", "Vercel's configuration id").option("--team-id <id>", "Vercel's team id").option("--redirect-uri <url>", "the address the provider sent the browser back to").option("--sealed <file>", "a file holding {grantCvm, cvmKeyId} (Neon)").option("--grant-cvm <blob>", "the Neon grant sealed to the connections CVM").option("--cvm-key-id <id>", "the CVM key id the grant is sealed under").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (signupId, provider, opts) => {
|
|
82160
82228
|
await integrationsSignupHandoff(signupId, provider, opts);
|
|
82161
82229
|
});
|
|
82162
|
-
program2.command("sites").description("The account's sites
|
|
82230
|
+
var sites = program2.command("sites").description("The account's sites and the changes Agentgates AI makes to them.");
|
|
82231
|
+
sites.command("list", { isDefault: true }).description("The account's sites: one Vercel project each and the GitHub repo behind it; name, repo and address opened here.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (opts) => {
|
|
82163
82232
|
await sitesList(opts);
|
|
82164
82233
|
});
|
|
82234
|
+
sites.command("change <changeId>").description("One change to a site: where it stands, its rounds and its latest card, opened here with the account's data key.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
|
|
82235
|
+
await sitesChange(changeId, opts);
|
|
82236
|
+
});
|
|
82237
|
+
sites.command("ship <changeId>").description("Ship a ready change: the owner's signature over the change and the head its card stands for.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
|
|
82238
|
+
await sitesShip(changeId, opts);
|
|
82239
|
+
});
|
|
82240
|
+
sites.command("skip <changeId>").description("Close a change that has not shipped.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
|
|
82241
|
+
await sitesSkip(changeId, opts);
|
|
82242
|
+
});
|
|
82165
82243
|
var memory = program2.command("memory").description("Sealed folders of markdown your agents read: names and bodies are sealed on this machine to the account's data key; the wire and the server carry ciphertext only.");
|
|
82166
82244
|
memory.command("overview", { isDefault: true }).description("The folders, their counts, and what the plan allows.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (opts) => {
|
|
82167
82245
|
await memoryOverview(opts);
|