create-metamynd-agent 0.13.1 → 0.13.2

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 +18 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -135,7 +135,21 @@ const GATEWAY_PKG = '@metamynd/agentsafe-http-gateway';
135
135
  // 0.14.0: depends on agentsafe-mcp-guard ^0.16.0 (verifies a signed-jurisdiction request). No template change.
136
136
  // 0.15.0: depends on agentsafe-mcp-guard ^0.17.0 (context signature verified) and a requireContextSignature option.
137
137
  // No template change.
138
- const GATEWAY_VERSION = '^0.15.0';
138
+ // 0.16.0: the caller is answered first and the claimed hold is settled after (settleInBackground), retried on a
139
+ // transient failure. Template change: each scaffolded gateway drains settlements on SIGTERM/SIGINT (DRAIN_ON_SHUTDOWN).
140
+ const GATEWAY_VERSION = '^0.16.0';
141
+
142
+ /** Appended to every scaffolded gateway server: give hold settlements still running a bounded moment on shutdown. */
143
+ const DRAIN_ON_SHUTDOWN = `
144
+ // The gateway answers first and settles the hold it claimed after (agentsafe-http-gateway 0.16.0). On shutdown, stop
145
+ // taking requests and let the settlements still running land (up to 5 s); one that does not stays committed to the cap.
146
+ for (const signal of ['SIGTERM', 'SIGINT']) {
147
+ process.once(signal, () => {
148
+ server.close();
149
+ gateway.drainSettlements(5000).then(() => process.exit(0));
150
+ });
151
+ }
152
+ `;
139
153
  const DEFAULT_API = 'https://metamynd.ai/api/v1';
140
154
  const DEFAULT_GATEWAY_PORT = 4401; // distinct from --harness's dashboard (4400)
141
155
 
@@ -1508,7 +1522,7 @@ server.listen(PORT, () => {
1508
1522
  console.log('[gateway] listening on :' + PORT + ' -> the only place performAction() runs.');
1509
1523
  console.log('[gateway] every request is independently re-verified against this agent\\'s own policy.');
1510
1524
  });
1511
- `;
1525
+ ${DRAIN_ON_SHUTDOWN}`;
1512
1526
  }
1513
1527
 
1514
1528
  function gatewayEnvExampleNeutral() {
@@ -1918,7 +1932,7 @@ server.listen(PORT, () => {
1918
1932
  console.log('[gateway] listening on :' + PORT + ' -> the only place bookFlight() runs.');
1919
1933
  console.log('[gateway] every request is independently re-verified against this agent\\'s own policy.');
1920
1934
  });
1921
- `;
1935
+ ${DRAIN_ON_SHUTDOWN}`;
1922
1936
  }
1923
1937
 
1924
1938
  function gatewayPackageJson(slug) {
@@ -2523,7 +2537,7 @@ server.listen(PORT, () => {
2523
2537
  console.log('[harness-gateway] listening on :' + PORT + ' — the only place your tools run.');
2524
2538
  console.log('[harness-gateway] re-verifying against ../metamynd-rules.json, independently of index.mjs.');
2525
2539
  });
2526
- `;
2540
+ ${DRAIN_ON_SHUTDOWN}`;
2527
2541
  }
2528
2542
 
2529
2543
  function harnessGatewayPackageJson(slug) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-metamynd-agent",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
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": {