clawborrator-cli 0.0.42 → 0.0.44

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.
@@ -68714,9 +68714,122 @@ 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 iso = a.isolated ? " [isolated]" : " [composable]";
68733
+ const stats = `${a.queriesAllTime} queries`;
68734
+ const tagln = a.tagline ? ` \u2014 ${a.tagline}` : "";
68735
+ console.log(`${dot} @${a.handle}${tag2}${iso} ${a.name} ${stats}${tagln}`);
68736
+ }
68737
+ });
68738
+ 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)).option("--isolated", "isolated mode: agent CC cannot use cross-session routing tools while answering (default true; safer)").option("--composable", "composable mode: agent CC may use cross-session routing tools (gated against the requester's own access)").action(async (opts) => {
68739
+ const status = opts.published ? "published" : "draft";
68740
+ const body = {
68741
+ sessionId: opts.session,
68742
+ name: opts.name,
68743
+ status
68744
+ };
68745
+ if (opts.tagline) body.tagline = opts.tagline;
68746
+ if (opts.description) body.description = opts.description;
68747
+ if (opts.slug) body.slug = opts.slug;
68748
+ if (typeof opts.budget === "number") body.dailyBudgetQueries = opts.budget;
68749
+ if (typeof opts.concurrency === "number") body.concurrencyCap = opts.concurrency;
68750
+ if (opts.composable) body.isolated = false;
68751
+ else if (opts.isolated) body.isolated = true;
68752
+ const r = await api.post("/api/v1/agents", body);
68753
+ console.log(`\u2713 ${r.restored ? "restored" : "published"} agent: @${r.handle}`);
68754
+ console.log(` name: ${r.name}`);
68755
+ console.log(` status: ${r.status}`);
68756
+ console.log(` mode: ${r.isolated ? "isolated (cross-session routing disabled while answering)" : "composable (CC may route to peers)"}`);
68757
+ console.log(` budget: ${r.dailyBudgetQueries}/day, concurrency ${r.concurrencyCap}`);
68758
+ console.log(` session: ${r.sessionId}`);
68759
+ if (r.status === "draft") {
68760
+ console.log(` next: 'claw agents update --status published @${r.handle}' to make it live`);
68761
+ } else {
68762
+ console.log(` call as: '@${r.handle} <question>' from any session prompt`);
68763
+ }
68764
+ });
68765
+ 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)).option("--isolated", "switch to isolated mode (block cross-session routing while answering)").option("--composable", "switch to composable mode (allow cross-session routing tools)").action(async (handleArg, opts) => {
68766
+ const handle = handleArg.replace(/^@/, "");
68767
+ const agent = await api.get(`/api/v1/agents/by-handle/${encodeURIComponent(handle.split("/")[0])}/${encodeURIComponent(handle.split("/")[1] ?? "")}`);
68768
+ const body = {};
68769
+ if (opts.status) body.status = opts.status;
68770
+ if (opts.name) body.name = opts.name;
68771
+ if (opts.tagline) body.tagline = opts.tagline;
68772
+ if (opts.description) body.description = opts.description;
68773
+ if (typeof opts.budget === "number") body.dailyBudgetQueries = opts.budget;
68774
+ if (typeof opts.concurrency === "number") body.concurrencyCap = opts.concurrency;
68775
+ if (opts.composable) body.isolated = false;
68776
+ else if (opts.isolated) body.isolated = true;
68777
+ if (Object.keys(body).length === 0) {
68778
+ console.error("no fields to update");
68779
+ process.exit(2);
68780
+ }
68781
+ const r = await api.patch(`/api/v1/agents/${agent.id}`, body);
68782
+ console.log(`\u2713 updated @${r.handle}`);
68783
+ console.log(` status: ${r.status}`);
68784
+ console.log(` mode: ${r.isolated ? "isolated" : "composable"}`);
68785
+ console.log(` budget: ${r.dailyBudgetQueries}/day, concurrency ${r.concurrencyCap}`);
68786
+ });
68787
+ var agentsUnpublish = new Command("unpublish").description("soft-delete an agent (drops its handle)").argument("<handle>", "@owner/slug").action(async (handleArg) => {
68788
+ const handle = handleArg.replace(/^@/, "");
68789
+ const [owner, slug] = handle.split("/");
68790
+ if (!owner || !slug) {
68791
+ console.error("expected handle in @owner/slug form");
68792
+ process.exit(2);
68793
+ }
68794
+ const agent = await api.get(`/api/v1/agents/by-handle/${encodeURIComponent(owner)}/${encodeURIComponent(slug)}`);
68795
+ await api.delete(`/api/v1/agents/${agent.id}`);
68796
+ console.log(`\u2713 unpublished @${handle}`);
68797
+ });
68798
+ 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) => {
68799
+ const handle = handleArg.replace(/^@/, "");
68800
+ const [owner, slug] = handle.split("/");
68801
+ if (!owner || !slug) {
68802
+ console.error("expected handle in @owner/slug form");
68803
+ process.exit(2);
68804
+ }
68805
+ const agent = await api.get(`/api/v1/agents/by-handle/${encodeURIComponent(owner)}/${encodeURIComponent(slug)}`);
68806
+ const data = await api.get(`/api/v1/agents/${agent.id}/inbound?days=${opts.days}`);
68807
+ console.log(`@${data.agent.handle} (${data.window.days}-day window)`);
68808
+ 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}`);
68809
+ if (data.topAskers.length) {
68810
+ console.log("");
68811
+ console.log("top askers:");
68812
+ for (const t of data.topAskers) {
68813
+ console.log(` @${t.login.padEnd(20)} ${String(t.count).padStart(4)} queries last: ${t.lastAt}`);
68814
+ }
68815
+ }
68816
+ if (data.recent.length) {
68817
+ console.log("");
68818
+ console.log("recent:");
68819
+ for (const r of data.recent.slice(0, 20)) {
68820
+ const flag = r.ok ? "\u2713" : "\u2717";
68821
+ const lat = r.latencyMs != null ? ` ${r.latencyMs}ms` : "";
68822
+ const why = r.deniedReason ? ` [${r.deniedReason}]` : "";
68823
+ const q = r.question.length > 70 ? r.question.slice(0, 67) + "\u2026" : r.question;
68824
+ console.log(` ${flag} ${r.ts} @${r.askerLogin}${lat}${why} ${q}`);
68825
+ }
68826
+ }
68827
+ });
68828
+ var agentsCmd = new Command("agents").description("public expert agents \u2014 list, publish, update, audit").addCommand(agentsList).addCommand(agentsPublish).addCommand(agentsUpdate).addCommand(agentsUnpublish).addCommand(agentsInbound);
68829
+
68717
68830
  // src/index.ts
68718
68831
  var program2 = new Command();
68719
- program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.42");
68832
+ program2.name("claw").description("clawborrator CLI \u2014 control your Claude Code sessions from the terminal").version("0.0.43");
68720
68833
  program2.addCommand(loginCmd);
68721
68834
  program2.addCommand(logoutCmd);
68722
68835
  program2.addCommand(whoamiCmd);
@@ -68726,6 +68839,7 @@ program2.addCommand(peersCmd);
68726
68839
  program2.addCommand(routeCmd);
68727
68840
  program2.addCommand(probeCmd);
68728
68841
  program2.addCommand(webhookCmd);
68842
+ program2.addCommand(agentsCmd);
68729
68843
  program2.parseAsync(process.argv).catch((err) => {
68730
68844
  console.error(err.message ?? err);
68731
68845
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawborrator-cli",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
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",