clawborrator-cli 0.0.41 → 0.0.43
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-bundled/claw.cjs +110 -3
- package/package.json +1 -1
package/dist-bundled/claw.cjs
CHANGED
|
@@ -68618,11 +68618,11 @@ function fmtAgo2(iso) {
|
|
|
68618
68618
|
// src/commands/peers.ts
|
|
68619
68619
|
var peersCmd = new Command("peers").description("list your sessions reachable for cross-session routing \u2014 own + shared").action(async () => {
|
|
68620
68620
|
const data = await api.get("/api/v1/peers");
|
|
68621
|
-
if (data.
|
|
68621
|
+
if (data.items.length === 0) {
|
|
68622
68622
|
console.log("no peers (no sessions registered yet)");
|
|
68623
68623
|
return;
|
|
68624
68624
|
}
|
|
68625
|
-
for (const p of data.
|
|
68625
|
+
for (const p of data.items) {
|
|
68626
68626
|
const dot = p.online ? "\u25CF" : "\u25CB";
|
|
68627
68627
|
const where = p.cwd ? ` ${p.cwd}` : "";
|
|
68628
68628
|
const qualifiedName = `@${p.ownerLogin}/${p.routingName.replace(/^@/, "")}`;
|
|
@@ -68714,9 +68714,115 @@ var webhookRm = new Command("rm").alias("delete").description("remove a webhook
|
|
|
68714
68714
|
});
|
|
68715
68715
|
var webhookCmd = new Command("webhook").description("manage webhook subscriptions").addCommand(webhookAdd).addCommand(webhookList).addCommand(webhookTest).addCommand(webhookRm);
|
|
68716
68716
|
|
|
68717
|
+
// src/commands/agents.ts
|
|
68718
|
+
var agentsList = new Command("list").alias("ls").description("list published agents (default) or your own agents (--mine)").option("--mine", "list every agent you own, including drafts").option("--owner <login>", "list a specific creator's published agents").option("--q <text>", "substring match on handle / name / tagline").action(async (opts) => {
|
|
68719
|
+
const params = new URLSearchParams();
|
|
68720
|
+
if (opts.mine) params.set("mine", "true");
|
|
68721
|
+
if (opts.owner) params.set("owner", opts.owner);
|
|
68722
|
+
if (opts.q) params.set("q", opts.q);
|
|
68723
|
+
const qs = params.toString() ? "?" + params.toString() : "";
|
|
68724
|
+
const data = await api.get(`/api/v1/agents${qs}`);
|
|
68725
|
+
if (data.items.length === 0) {
|
|
68726
|
+
console.log("no agents");
|
|
68727
|
+
return;
|
|
68728
|
+
}
|
|
68729
|
+
for (const a of data.items) {
|
|
68730
|
+
const dot = a.online ? "\u25CF" : "\u25CB";
|
|
68731
|
+
const tag2 = a.status === "draft" ? " [draft]" : "";
|
|
68732
|
+
const stats = `${a.queriesAllTime} queries`;
|
|
68733
|
+
const tagln = a.tagline ? ` \u2014 ${a.tagline}` : "";
|
|
68734
|
+
console.log(`${dot} @${a.handle}${tag2} ${a.name} ${stats}${tagln}`);
|
|
68735
|
+
}
|
|
68736
|
+
});
|
|
68737
|
+
var agentsPublish = new Command("publish").description("publish a session as a public agent").requiredOption("--session <id>", "the session UUID to back the agent").requiredOption("--name <name>", 'display name (e.g. "viper-rust-expert")').option("--tagline <text>", "one-line description (160 chars max)").option("--description <text>", "long-form description, markdown allowed (4 KB max)").option("--slug <slug>", "explicit slug (default: derived from session routingName)").option("--draft", "publish as draft (status=draft); use --published to go live immediately").option("--published", "publish as live (status=published)").option("--budget <n>", "daily budget in queries (default 1000, max 100000)", (v) => parseInt(v, 10)).option("--concurrency <n>", "concurrent in-flight queries cap (default 5, max 20)", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
68738
|
+
const status = opts.published ? "published" : "draft";
|
|
68739
|
+
const body = {
|
|
68740
|
+
sessionId: opts.session,
|
|
68741
|
+
name: opts.name,
|
|
68742
|
+
status
|
|
68743
|
+
};
|
|
68744
|
+
if (opts.tagline) body.tagline = opts.tagline;
|
|
68745
|
+
if (opts.description) body.description = opts.description;
|
|
68746
|
+
if (opts.slug) body.slug = opts.slug;
|
|
68747
|
+
if (typeof opts.budget === "number") body.dailyBudgetQueries = opts.budget;
|
|
68748
|
+
if (typeof opts.concurrency === "number") body.concurrencyCap = opts.concurrency;
|
|
68749
|
+
const r = await api.post("/api/v1/agents", body);
|
|
68750
|
+
console.log(`\u2713 ${r.restored ? "restored" : "published"} agent: @${r.handle}`);
|
|
68751
|
+
console.log(` name: ${r.name}`);
|
|
68752
|
+
console.log(` status: ${r.status}`);
|
|
68753
|
+
console.log(` budget: ${r.dailyBudgetQueries}/day, concurrency ${r.concurrencyCap}`);
|
|
68754
|
+
console.log(` session: ${r.sessionId}`);
|
|
68755
|
+
if (r.status === "draft") {
|
|
68756
|
+
console.log(` next: 'claw agents update --status published @${r.handle}' to make it live`);
|
|
68757
|
+
} else {
|
|
68758
|
+
console.log(` call as: '@${r.handle} <question>' from any session prompt`);
|
|
68759
|
+
}
|
|
68760
|
+
});
|
|
68761
|
+
var agentsUpdate = new Command("update").description("update an agent").argument("<handle>", "@owner/slug").option("--status <s>", "draft | published").option("--name <name>").option("--tagline <text>").option("--description <text>").option("--budget <n>", "daily budget in queries", (v) => parseInt(v, 10)).option("--concurrency <n>", "concurrency cap", (v) => parseInt(v, 10)).action(async (handleArg, opts) => {
|
|
68762
|
+
const handle = handleArg.replace(/^@/, "");
|
|
68763
|
+
const agent = await api.get(`/api/v1/agents/by-handle/${encodeURIComponent(handle.split("/")[0])}/${encodeURIComponent(handle.split("/")[1] ?? "")}`);
|
|
68764
|
+
const body = {};
|
|
68765
|
+
if (opts.status) body.status = opts.status;
|
|
68766
|
+
if (opts.name) body.name = opts.name;
|
|
68767
|
+
if (opts.tagline) body.tagline = opts.tagline;
|
|
68768
|
+
if (opts.description) body.description = opts.description;
|
|
68769
|
+
if (typeof opts.budget === "number") body.dailyBudgetQueries = opts.budget;
|
|
68770
|
+
if (typeof opts.concurrency === "number") body.concurrencyCap = opts.concurrency;
|
|
68771
|
+
if (Object.keys(body).length === 0) {
|
|
68772
|
+
console.error("no fields to update");
|
|
68773
|
+
process.exit(2);
|
|
68774
|
+
}
|
|
68775
|
+
const r = await api.patch(`/api/v1/agents/${agent.id}`, body);
|
|
68776
|
+
console.log(`\u2713 updated @${r.handle}`);
|
|
68777
|
+
console.log(` status: ${r.status}`);
|
|
68778
|
+
console.log(` budget: ${r.dailyBudgetQueries}/day, concurrency ${r.concurrencyCap}`);
|
|
68779
|
+
});
|
|
68780
|
+
var agentsUnpublish = new Command("unpublish").description("soft-delete an agent (drops its handle)").argument("<handle>", "@owner/slug").action(async (handleArg) => {
|
|
68781
|
+
const handle = handleArg.replace(/^@/, "");
|
|
68782
|
+
const [owner, slug] = handle.split("/");
|
|
68783
|
+
if (!owner || !slug) {
|
|
68784
|
+
console.error("expected handle in @owner/slug form");
|
|
68785
|
+
process.exit(2);
|
|
68786
|
+
}
|
|
68787
|
+
const agent = await api.get(`/api/v1/agents/by-handle/${encodeURIComponent(owner)}/${encodeURIComponent(slug)}`);
|
|
68788
|
+
await api.delete(`/api/v1/agents/${agent.id}`);
|
|
68789
|
+
console.log(`\u2713 unpublished @${handle}`);
|
|
68790
|
+
});
|
|
68791
|
+
var agentsInbound = new Command("inbound").description("audit view: who has been calling your agent").argument("<handle>", "@owner/slug").option("--days <n>", "1-30 (default 7)", (v) => parseInt(v, 10), 7).action(async (handleArg, opts) => {
|
|
68792
|
+
const handle = handleArg.replace(/^@/, "");
|
|
68793
|
+
const [owner, slug] = handle.split("/");
|
|
68794
|
+
if (!owner || !slug) {
|
|
68795
|
+
console.error("expected handle in @owner/slug form");
|
|
68796
|
+
process.exit(2);
|
|
68797
|
+
}
|
|
68798
|
+
const agent = await api.get(`/api/v1/agents/by-handle/${encodeURIComponent(owner)}/${encodeURIComponent(slug)}`);
|
|
68799
|
+
const data = await api.get(`/api/v1/agents/${agent.id}/inbound?days=${opts.days}`);
|
|
68800
|
+
console.log(`@${data.agent.handle} (${data.window.days}-day window)`);
|
|
68801
|
+
console.log(` total: ${data.summary.total} ok: ${data.summary.ok} denied: ${data.summary.denied} avg-latency: ${data.summary.avgLatencyMs ?? "\u2014"}ms askers: ${data.summary.distinctAskers}`);
|
|
68802
|
+
if (data.topAskers.length) {
|
|
68803
|
+
console.log("");
|
|
68804
|
+
console.log("top askers:");
|
|
68805
|
+
for (const t of data.topAskers) {
|
|
68806
|
+
console.log(` @${t.login.padEnd(20)} ${String(t.count).padStart(4)} queries last: ${t.lastAt}`);
|
|
68807
|
+
}
|
|
68808
|
+
}
|
|
68809
|
+
if (data.recent.length) {
|
|
68810
|
+
console.log("");
|
|
68811
|
+
console.log("recent:");
|
|
68812
|
+
for (const r of data.recent.slice(0, 20)) {
|
|
68813
|
+
const flag = r.ok ? "\u2713" : "\u2717";
|
|
68814
|
+
const lat = r.latencyMs != null ? ` ${r.latencyMs}ms` : "";
|
|
68815
|
+
const why = r.deniedReason ? ` [${r.deniedReason}]` : "";
|
|
68816
|
+
const q = r.question.length > 70 ? r.question.slice(0, 67) + "\u2026" : r.question;
|
|
68817
|
+
console.log(` ${flag} ${r.ts} @${r.askerLogin}${lat}${why} ${q}`);
|
|
68818
|
+
}
|
|
68819
|
+
}
|
|
68820
|
+
});
|
|
68821
|
+
var agentsCmd = new Command("agents").description("public expert agents \u2014 list, publish, update, audit").addCommand(agentsList).addCommand(agentsPublish).addCommand(agentsUpdate).addCommand(agentsUnpublish).addCommand(agentsInbound);
|
|
68822
|
+
|
|
68717
68823
|
// src/index.ts
|
|
68718
68824
|
var program2 = new Command();
|
|
68719
|
-
program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.
|
|
68825
|
+
program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.43");
|
|
68720
68826
|
program2.addCommand(loginCmd);
|
|
68721
68827
|
program2.addCommand(logoutCmd);
|
|
68722
68828
|
program2.addCommand(whoamiCmd);
|
|
@@ -68726,6 +68832,7 @@ program2.addCommand(peersCmd);
|
|
|
68726
68832
|
program2.addCommand(routeCmd);
|
|
68727
68833
|
program2.addCommand(probeCmd);
|
|
68728
68834
|
program2.addCommand(webhookCmd);
|
|
68835
|
+
program2.addCommand(agentsCmd);
|
|
68729
68836
|
program2.parseAsync(process.argv).catch((err) => {
|
|
68730
68837
|
console.error(err.message ?? err);
|
|
68731
68838
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawborrator-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "claw — command-line client for clawborrator hub_v1. Manages PATs, channel tokens, sessions, cross-session routing, and webhooks; ships an inline TUI for live multi-operator session attach.",
|
|
6
6
|
"license": "MIT",
|