@agentmessier/openclaw-agent-messier 0.3.4 → 0.3.5
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/tools.test.ts +4 -2
- package/src/tools.ts +10 -2
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentmessier/openclaw-agent-messier",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Agent Messier multi-venue client for OpenClaw \u2014 play games and work tasks on the AgentNet platform (soccer today; venues discovered from the marketplace registry)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/tools.test.ts
CHANGED
|
@@ -16,10 +16,12 @@ describe("soccer extension join auth", () => {
|
|
|
16
16
|
});
|
|
17
17
|
afterEach(() => vi.unstubAllGlobals());
|
|
18
18
|
|
|
19
|
-
it("apiKeyOf
|
|
19
|
+
it("apiKeyOf comes from config only — never from the environment", () => {
|
|
20
20
|
expect(apiKeyOf(cfg({ apiKey: "from-cfg" }))).toBe("from-cfg");
|
|
21
|
+
// a stray env var must NOT be picked up (config-only; avoids the env+network
|
|
22
|
+
// 'credential harvesting' scanner flag and keeps config the single channel).
|
|
21
23
|
vi.stubEnv("AGENTNET_API_KEY", "from-env");
|
|
22
|
-
expect(apiKeyOf(cfg())).
|
|
24
|
+
expect(apiKeyOf(cfg())).toBeUndefined();
|
|
23
25
|
vi.unstubAllEnvs();
|
|
24
26
|
});
|
|
25
27
|
|
package/src/tools.ts
CHANGED
|
@@ -123,7 +123,11 @@ function idKey(cfg: PluginCfg): string {
|
|
|
123
123
|
|
|
124
124
|
/** AgentNet API key for join-time verification (config, then env fallback). */
|
|
125
125
|
export function apiKeyOf(cfg: PluginCfg): string | undefined {
|
|
126
|
-
|
|
126
|
+
// Config-only — the key comes from the plugin config (openclaw config set
|
|
127
|
+
// plugins.entries.<id>.config.apiKey). We deliberately do NOT read it from the
|
|
128
|
+
// OS environment: an env read + network send in one module trips OpenClaw's
|
|
129
|
+
// "credential harvesting" scanner, and config is the portable channel anyway.
|
|
130
|
+
return cfg.apiKey ?? undefined;
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
/** The agentId the server seats us under. Once the server has verified us and
|
|
@@ -305,9 +309,13 @@ export const err = (msg: string) => ({ content: [{ type: "text" as const, text:
|
|
|
305
309
|
// ── venue-URL resolution (origin → base URL); kept — generate.ts imports it. ──
|
|
306
310
|
const VENUE_DEFAULTS: Record<string, string> = { taskmarket: "http://localhost:3030" };
|
|
307
311
|
export function venueUrl(origin: string, cfg: PluginCfg): string {
|
|
312
|
+
// A registry origin is normally a full URL (used as-is) or "pitch" (the
|
|
313
|
+
// configured serverUrl). Short names fall back to a baked default. No OS
|
|
314
|
+
// environment read here — keeps this network module config-only, so
|
|
315
|
+
// OpenClaw's env+network scanner stays quiet.
|
|
308
316
|
if (origin.startsWith("http://") || origin.startsWith("https://")) return origin;
|
|
309
317
|
if (origin === "pitch") return (cfg.serverUrl ?? "http://localhost:3010").replace(/\/$/, "");
|
|
310
|
-
return
|
|
318
|
+
return VENUE_DEFAULTS[origin] ?? (cfg.serverUrl ?? "http://localhost:3010");
|
|
311
319
|
}
|
|
312
320
|
|
|
313
321
|
// ── Member / account tools — soccer cosmetic + ownership, NOT lifecycle, so
|