create-metamynd-agent 0.13.0 → 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.
- package/index.mjs +27 -7
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -56,7 +56,9 @@ const GUARD_PKG = '@metamynd/agentsafe-guard';
|
|
|
56
56
|
// non-USD agent's `npm test` needs.
|
|
57
57
|
// 0.16.0 signs an optional top-level `jurisdiction` (MAGP 8.3.12, the v2 message) — the scaffolded non-financial agent
|
|
58
58
|
// passes a request's jurisdiction that way, since the gate no longer reads one from the unsigned context.
|
|
59
|
-
|
|
59
|
+
// 0.17.0 signs the agent's context (envelopeSignature, MAGP 8.3.13) by default; the scaffolded agent gets it with no template
|
|
60
|
+
// change (signContext: false opts out). A daemon-custody agent needs agentsafe-signer >= 0.19.0 for its no-amount requests.
|
|
61
|
+
const GUARD_VERSION = '^0.17.0';
|
|
60
62
|
/** The harness entry point's config load, shared by both harness templates: a fresh clone has no
|
|
61
63
|
* agent.metamynd.json (it is gitignored), so say what to do instead of a bare ENOENT (BR-004). */
|
|
62
64
|
function harnessConfigLoad() {
|
|
@@ -113,7 +115,9 @@ const MCP_GUARD_PKG = '@metamynd/agentsafe-mcp-guard';
|
|
|
113
115
|
// change (the scaffolded gateways don't refund), but the floor must cover the real current version.
|
|
114
116
|
// 0.16.0: verifies a v2 (signed-jurisdiction) request and judges jurisdiction rules on the signed value only. Required:
|
|
115
117
|
// the scaffolded agent now signs jurisdiction, which an older gateway would refuse SIGNATURE_INVALID.
|
|
116
|
-
|
|
118
|
+
// 0.17.0: verifies the agent's context signature (envelopeSignature) before judging its itinerary, and a
|
|
119
|
+
// requireContextSignature option. No template change (the scaffolded agent does not sign its context by default).
|
|
120
|
+
const MCP_GUARD_VERSION = '^0.17.0';
|
|
117
121
|
const GATEWAY_PKG = '@metamynd/agentsafe-http-gateway';
|
|
118
122
|
// 0.2.0 fixes a confused-deputy gap (payload not bound to the signed request) — the CLI must
|
|
119
123
|
// never scaffold a range that could resolve below it.
|
|
@@ -129,7 +133,23 @@ const GATEWAY_PKG = '@metamynd/agentsafe-http-gateway';
|
|
|
129
133
|
// 0.13.0: a configured resolveCredential that refuses now FAILS CLOSED (502 CREDENTIAL_UNAVAILABLE) instead of forwarding
|
|
130
134
|
// without a credential. No template change (the scaffolded gateway does not use the Credential Vault).
|
|
131
135
|
// 0.14.0: depends on agentsafe-mcp-guard ^0.16.0 (verifies a signed-jurisdiction request). No template change.
|
|
132
|
-
|
|
136
|
+
// 0.15.0: depends on agentsafe-mcp-guard ^0.17.0 (context signature verified) and a requireContextSignature option.
|
|
137
|
+
// No template change.
|
|
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
|
+
`;
|
|
133
153
|
const DEFAULT_API = 'https://metamynd.ai/api/v1';
|
|
134
154
|
const DEFAULT_GATEWAY_PORT = 4401; // distinct from --harness's dashboard (4400)
|
|
135
155
|
|
|
@@ -1502,7 +1522,7 @@ server.listen(PORT, () => {
|
|
|
1502
1522
|
console.log('[gateway] listening on :' + PORT + ' -> the only place performAction() runs.');
|
|
1503
1523
|
console.log('[gateway] every request is independently re-verified against this agent\\'s own policy.');
|
|
1504
1524
|
});
|
|
1505
|
-
`;
|
|
1525
|
+
${DRAIN_ON_SHUTDOWN}`;
|
|
1506
1526
|
}
|
|
1507
1527
|
|
|
1508
1528
|
function gatewayEnvExampleNeutral() {
|
|
@@ -1701,7 +1721,7 @@ function exampleReadme(slug, scope, withGateway, gatewayPort, daemonKey = false)
|
|
|
1701
1721
|
const configFileLine = daemonKey
|
|
1702
1722
|
? `- \`agent.metamynd.json\` — your portable guard config (identity, mandate scope \`${scope}\`, issuer keys).
|
|
1703
1723
|
**Holds no secret key.** Signing goes through your already-running agentsafe-signer daemon
|
|
1704
|
-
(\`daemonSocketPath\`) instead — see \`docs/integration/INSTALL-AGENTSAFE-SIGNER.md
|
|
1724
|
+
(\`daemonSocketPath\`) instead — see \`docs/integration/INSTALL-AGENTSAFE-SIGNER.md\`. Context signing (on by default) signs through the daemon too; use agentsafe-signer 0.19.0 or later (an older one refuses this agent's no-amount requests with CONTEXT_SIGNING_UNSUPPORTED).${withGateway ? ' Payload binding is on by default and signs through the daemon too, which needs agentsafe-signer 0.15.0 or later.' : ''}`
|
|
1705
1725
|
: `- \`agent.metamynd.json\` — your portable guard config (identity, mandate scope \`${scope}\`, issuer keys).
|
|
1706
1726
|
**Contains the agent's secret key — never commit it.** It is already in \`.gitignore\`.`;
|
|
1707
1727
|
const gatewaySection = withGateway
|
|
@@ -1912,7 +1932,7 @@ server.listen(PORT, () => {
|
|
|
1912
1932
|
console.log('[gateway] listening on :' + PORT + ' -> the only place bookFlight() runs.');
|
|
1913
1933
|
console.log('[gateway] every request is independently re-verified against this agent\\'s own policy.');
|
|
1914
1934
|
});
|
|
1915
|
-
`;
|
|
1935
|
+
${DRAIN_ON_SHUTDOWN}`;
|
|
1916
1936
|
}
|
|
1917
1937
|
|
|
1918
1938
|
function gatewayPackageJson(slug) {
|
|
@@ -2517,7 +2537,7 @@ server.listen(PORT, () => {
|
|
|
2517
2537
|
console.log('[harness-gateway] listening on :' + PORT + ' — the only place your tools run.');
|
|
2518
2538
|
console.log('[harness-gateway] re-verifying against ../metamynd-rules.json, independently of index.mjs.');
|
|
2519
2539
|
});
|
|
2520
|
-
`;
|
|
2540
|
+
${DRAIN_ON_SHUTDOWN}`;
|
|
2521
2541
|
}
|
|
2522
2542
|
|
|
2523
2543
|
function harnessGatewayPackageJson(slug) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-metamynd-agent",
|
|
3
|
-
"version": "0.13.
|
|
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": {
|