@stamn/stamn-plugin 0.1.0-alpha.44 → 0.1.0-alpha.46

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/index.js CHANGED
@@ -4600,7 +4600,7 @@ ${l}
4600
4600
  }
4601
4601
  } }).prompt();
4602
4602
 
4603
- // node_modules/.pnpm/@stamn+sdk@0.1.0-alpha.6/node_modules/@stamn/sdk/dist/index.js
4603
+ // node_modules/.pnpm/@stamn+sdk@0.1.0-alpha.7/node_modules/@stamn/sdk/dist/index.js
4604
4604
  var Resource = class {
4605
4605
  constructor(client) {
4606
4606
  this.client = client;
@@ -4722,10 +4722,11 @@ var ParticipantsResource = class extends Resource {
4722
4722
  }
4723
4723
  };
4724
4724
  var ApiKeysResource = class extends Resource {
4725
- async create() {
4725
+ async create(options) {
4726
4726
  const res = await this.client.request(
4727
4727
  "POST",
4728
- "/v1/api-keys"
4728
+ "/v1/api-keys",
4729
+ options
4729
4730
  );
4730
4731
  return res.data;
4731
4732
  }
@@ -4989,7 +4990,7 @@ var StamnClient = class {
4989
4990
  }
4990
4991
  };
4991
4992
 
4992
- // node_modules/.pnpm/@stamn+cli@0.1.0-alpha.17/node_modules/@stamn/cli/dist/chunk-PLTDB3B6.js
4993
+ // node_modules/.pnpm/@stamn+cli@0.1.0-alpha.19/node_modules/@stamn/cli/dist/chunk-LEIZD757.js
4993
4994
  import { execSync } from "child_process";
4994
4995
  import { mkdirSync, readFileSync, writeFileSync, unlinkSync } from "fs";
4995
4996
  import { join } from "path";
@@ -5105,7 +5106,11 @@ async function handleAgentRegister(opts, adapter) {
5105
5106
  return;
5106
5107
  }
5107
5108
  const selected = existingAgents.find((a) => a.id === chosen);
5108
- writeResult(adapter, selected.name, selected.id, selected.name, config.apiKey, bindTo);
5109
+ const keySpinner = be();
5110
+ keySpinner.start("Creating agent API key...");
5111
+ const { data: { key: agentKey } } = await client2.request("POST", "/v1/api-keys", { participantId: selected.id });
5112
+ keySpinner.stop("Agent API key created.");
5113
+ writeResult(adapter, selected.name, selected.id, selected.name, agentKey, bindTo);
5109
5114
  R2.success(`Agent "${selected.name}" (${selected.id}) selected.`);
5110
5115
  if (bindTo) R2.info(`Bound to OpenClaw agent "${bindTo}".`);
5111
5116
  Gt("Done!");
@@ -5135,7 +5140,11 @@ async function handleAgentRegister(opts, adapter) {
5135
5140
  s2.start("Registering agent...");
5136
5141
  const participant = await client.participants.create({ name });
5137
5142
  s2.stop("Agent registered.");
5138
- writeResult(adapter, name, participant.id, participant.name, config.apiKey, bindTo);
5143
+ const keySpinner = be();
5144
+ keySpinner.start("Creating agent API key...");
5145
+ const { data: { key: agentKey } } = await client.request("POST", "/v1/api-keys", { participantId: participant.id });
5146
+ keySpinner.stop("Agent API key created.");
5147
+ writeResult(adapter, name, participant.id, participant.name, agentKey, bindTo);
5139
5148
  R2.success(`Agent "${participant.name}" (${participant.id})`);
5140
5149
  if (bindTo) R2.info(`Bound to OpenClaw agent "${bindTo}".`);
5141
5150
  Gt("Done!");
@@ -5150,7 +5159,7 @@ function writeResult(adapter, name, agentId, agentName, apiKey, bindTo) {
5150
5159
  if (bindTo) {
5151
5160
  adapter.writeAgentBinding(bindTo, { agentId, apiKey, agentName });
5152
5161
  }
5153
- adapter.writeConfig({ agentId, agentName });
5162
+ adapter.writeConfig({ agentId, agentName, apiKey });
5154
5163
  }
5155
5164
  async function handleAgentList(_opts, adapter) {
5156
5165
  Wt2("Stamn Agents");
@@ -7102,7 +7111,10 @@ function registerTools(api, pool, config) {
7102
7111
  if (!ws) return null;
7103
7112
  const client = new StamnClient({ apiKey: binding.apiKey });
7104
7113
  const tools = allTools(ws, binding.agentId, maxSpendCents, client);
7105
- return tools.map((tool) => withAuthGuard(tool, ws));
7114
+ const httpOnlyTools = /* @__PURE__ */ new Set(["stamn_create_blog_post"]);
7115
+ return tools.map(
7116
+ (tool) => httpOnlyTools.has(tool.name) ? tool : withAuthGuard(tool, ws)
7117
+ );
7106
7118
  });
7107
7119
  }
7108
7120