create-metamynd-agent 0.14.43 → 0.14.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.
Files changed (2) hide show
  1. package/index.mjs +11 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -105,7 +105,7 @@ function harnessConfigLoad() {
105
105
  // Say so, with the way forward, instead of letting readFileSync throw a bare ENOENT.
106
106
  let config;
107
107
  try {
108
- config = JSON.parse(readFileSync('./agent.metamynd.json', 'utf8'));
108
+ config = JSON.parse(readFileSync('./agent.metamynd.json', 'utf8').replace(/^\\uFEFF/, '')); // a UTF-8 BOM is not JSON
109
109
  } catch (e) {
110
110
  console.error(e && e.code === 'ENOENT'
111
111
  ? ['No ./agent.metamynd.json. It holds the local key for this agent and is gitignored, so a fresh clone never has it.',
@@ -186,7 +186,8 @@ const MCP_GUARD_PKG = '@metamynd/agentsafe-mcp-guard';
186
186
  // (NF-RISK-SELF). Required: a gateway on an older guard would read an operation rule's atom as unknown and let it run.
187
187
  // 0.29.0: a claim the issuer refuses is logged in one line and its block carries the issuer's detail (FW6-1).
188
188
  // 0.30.0: same CURRENCY_NOT_ALLOWED code in a gateway's local judgement as at the gate (M2).
189
- const MCP_GUARD_VERSION = '^0.30.0';
189
+ // 0.31.0: ships TypeScript declarations (agentsafe-mcp-guard.d.mts).
190
+ const MCP_GUARD_VERSION = '^0.31.0';
190
191
  /** A DID as it may appear inside a generated string literal (the gateway's allowedAgents pin): no quote, backslash or space. */
191
192
  const SAFE_DID = /^did:[a-z0-9]+:[A-Za-z0-9._:%-]+$/;
192
193
  const GATEWAY_PKG = '@metamynd/agentsafe-http-gateway';
@@ -226,7 +227,10 @@ const GATEWAY_PKG = '@metamynd/agentsafe-http-gateway';
226
227
  // 0.29.0: a request signed for another action than the route's is refused GATEWAY_ACTION_MISMATCH, not SIGNATURE_INVALID (M2);
227
228
  // depends on agentsafe-mcp-guard ^0.30.0.
228
229
  // 0.30.0: `agentsafe-gateway service-id` / `accept-challenge` / `serve`, SERVICE_IDENTITY_FILE and AGENTSAFE_UPSTREAM_CREDENTIAL (M4).
229
- const GATEWAY_VERSION = '^0.30.0';
230
+ // 0.31.0: ships TypeScript declarations (gateway, route-match, service-identity); depends on agentsafe-mcp-guard ^0.31.0.
231
+ // 0.32.0: `reportOutcomes` defaults to true. The hosted templates already set it; the --harness gateway (no issuer, no
232
+ // network) now sets `reportOutcomes: false`, so it does not log NO_ISSUER on its first refusal.
233
+ const GATEWAY_VERSION = '^0.32.0';
230
234
 
231
235
  /** Appended to every scaffolded gateway server: give hold settlements still running a bounded moment on shutdown. */
232
236
  const DRAIN_ON_SHUTDOWN = `
@@ -449,7 +453,8 @@ function onCliError(e) {
449
453
  // directly instead — `rules` is ignored when `molecules` is present.
450
454
  function loadConfigFile(path) {
451
455
  let raw;
452
- try { raw = readFileSync(resolve(path), 'utf8'); }
456
+ // A UTF-8 BOM (Notepad and other Windows tools add one on save) is not JSON whitespace — strip it before parsing.
457
+ try { raw = readFileSync(resolve(path), 'utf8').replace(/^\uFEFF/, ''); }
453
458
  catch (e) { fail(`Could not read config file ${path} (${e.message})`); }
454
459
  let json;
455
460
  try { json = JSON.parse(raw); }
@@ -3055,6 +3060,8 @@ const gateway = createHttpGateway({
3055
3060
  // body that is not exactly that one — the values of every allowed field, not only amount and merchant. A request that
3056
3061
  // bound no payload is refused (PAYLOAD_BINDING_REQUIRED) instead of run unbound.
3057
3062
  requirePayloadBinding: true,
3063
+ // No issuer to report to: --harness never touches the network (the gateway reports by default since 0.32.0).
3064
+ reportOutcomes: false,
3058
3065
  // Reached ONLY after the guard allowed the request AND the body was bound to what was signed.
3059
3066
  forward: async (req) => {
3060
3067
  const route = matchRoute(ROUTES, req.method, req.path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-metamynd-agent",
3
- "version": "0.14.43",
3
+ "version": "0.14.46",
4
4
  "description": "Scaffold a MetaMynd/AgentSafe-governed AI agent in one command — logs in, provisions the agent (identity + mandate + SOP + Standards) in a single call, writes agent.metamynd.json plus a runnable agent + separate tool-gateway process that closes direct-call, confused-deputy, replay, and cumulative-spend bypasses. --harness scaffolds a free, local, zero-network governance harness instead.",
5
5
  "type": "module",
6
6
  "bin": {