@stamn/stamn-plugin 0.1.0-alpha.45 → 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 +16 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4990,7 +4990,7 @@ var StamnClient = class {
|
|
|
4990
4990
|
}
|
|
4991
4991
|
};
|
|
4992
4992
|
|
|
4993
|
-
// node_modules/.pnpm/@stamn+cli@0.1.0-alpha.
|
|
4993
|
+
// node_modules/.pnpm/@stamn+cli@0.1.0-alpha.19/node_modules/@stamn/cli/dist/chunk-LEIZD757.js
|
|
4994
4994
|
import { execSync } from "child_process";
|
|
4995
4995
|
import { mkdirSync, readFileSync, writeFileSync, unlinkSync } from "fs";
|
|
4996
4996
|
import { join } from "path";
|
|
@@ -5106,7 +5106,11 @@ async function handleAgentRegister(opts, adapter) {
|
|
|
5106
5106
|
return;
|
|
5107
5107
|
}
|
|
5108
5108
|
const selected = existingAgents.find((a) => a.id === chosen);
|
|
5109
|
-
|
|
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);
|
|
5110
5114
|
R2.success(`Agent "${selected.name}" (${selected.id}) selected.`);
|
|
5111
5115
|
if (bindTo) R2.info(`Bound to OpenClaw agent "${bindTo}".`);
|
|
5112
5116
|
Gt("Done!");
|
|
@@ -5136,7 +5140,11 @@ async function handleAgentRegister(opts, adapter) {
|
|
|
5136
5140
|
s2.start("Registering agent...");
|
|
5137
5141
|
const participant = await client.participants.create({ name });
|
|
5138
5142
|
s2.stop("Agent registered.");
|
|
5139
|
-
|
|
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);
|
|
5140
5148
|
R2.success(`Agent "${participant.name}" (${participant.id})`);
|
|
5141
5149
|
if (bindTo) R2.info(`Bound to OpenClaw agent "${bindTo}".`);
|
|
5142
5150
|
Gt("Done!");
|
|
@@ -5151,7 +5159,7 @@ function writeResult(adapter, name, agentId, agentName, apiKey, bindTo) {
|
|
|
5151
5159
|
if (bindTo) {
|
|
5152
5160
|
adapter.writeAgentBinding(bindTo, { agentId, apiKey, agentName });
|
|
5153
5161
|
}
|
|
5154
|
-
adapter.writeConfig({ agentId, agentName });
|
|
5162
|
+
adapter.writeConfig({ agentId, agentName, apiKey });
|
|
5155
5163
|
}
|
|
5156
5164
|
async function handleAgentList(_opts, adapter) {
|
|
5157
5165
|
Wt2("Stamn Agents");
|
|
@@ -7103,7 +7111,10 @@ function registerTools(api, pool, config) {
|
|
|
7103
7111
|
if (!ws) return null;
|
|
7104
7112
|
const client = new StamnClient({ apiKey: binding.apiKey });
|
|
7105
7113
|
const tools = allTools(ws, binding.agentId, maxSpendCents, client);
|
|
7106
|
-
|
|
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
|
+
);
|
|
7107
7118
|
});
|
|
7108
7119
|
}
|
|
7109
7120
|
|