@jdr377/mapapp-agent-connector 0.1.0-pre.13 → 0.1.0-pre.15
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/README.md +8 -8
- package/dist/{chunk-ffcv7x5a.js → chunk-466n50gb.js} +1 -1
- package/dist/{chunk-7txe8897.js → chunk-a2rdf4kd.js} +6 -6
- package/dist/chunk-fp3attdv.js +3 -0
- package/dist/{chunk-kq6zsttw.js → chunk-mb8a3fs5.js} +1 -1
- package/dist/{chunk-d722pj7f.js → chunk-t3cx6wmg.js} +1 -1
- package/dist/chunk-t7bheq4v.js +3 -0
- package/dist/chunk-y7vmpgeg.js +17 -0
- package/dist/participant-mcp-server.js +5 -5
- package/distribution.json +23 -23
- package/package.json +1 -1
- package/dist/chunk-618mghb5.js +0 -17
- package/dist/chunk-jr7dhw6k.js +0 -3
- package/dist/chunk-rk0z9bdp.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{participantErrorDiagnostic,silenceParticipantConsole}from"./chunk-
|
|
3
|
+
import{participantErrorDiagnostic,silenceParticipantConsole}from"./chunk-fp3attdv.js";import{__require}from"./chunk-btwmey1h.js";import{StdioServerTransport}from"@modelcontextprotocol/server/stdio";var invocationUsage=`Tools: mapapp-participant tools --wallet-dir <existing-state> [--tool <name>]
|
|
4
4
|
Call: mapapp-participant call --wallet-dir <existing-state> --tool <name> [--arguments-file <utf8-json-file-or->]
|
|
5
5
|
Omit --arguments-file for {}. Use - to read JSON from stdin. Calls use the same MCP tools; retain original operation IDs after uncertainty.
|
|
6
6
|
`;var usage=`Usage: mapapp-participant --wallet-dir <existing-protected-wallet>
|
|
@@ -10,10 +10,10 @@ Connect: mapapp-participant connect --wallet-dir <new-connector-directory> --dep
|
|
|
10
10
|
First setup/connect/restore: the final destination must not already exist, even empty. Keep the MCP host/client session open until awaited calls finish.
|
|
11
11
|
One local stdio MCP provides discovery, paid/sponsored/social actions and private messaging. No HTTP listener. Delegation belongs to the user and agent; connected wallets enforce their own permissions. Preserve original operation IDs after uncertainty. Read /developers?guide=agent-setup.
|
|
12
12
|
`;function readParticipantSetupCommand(args){if(!["setup","restore","connect"].includes(args[0]??""))return null;const fields={};const allowed=args[0]==="restore"?["--wallet-dir","--deployment","--root-file","--backup-file","--connection-file","--operations-file"]:args[0]==="connect"?["--wallet-dir","--deployment","--wallet-endpoint","--identity-key"]:["--wallet-dir","--deployment"];for(let i=1;i<args.length;i+=2){const key=args[i],value=args[i+1];if(!allowed.includes(key)||fields[key]||!value||value.startsWith("--"))throw new Error("participant_configuration_invalid");fields[key]=value}if(allowed.some((key)=>!fields[key]))throw new Error("participant_configuration_invalid");return{walletDirectory:fields["--wallet-dir"],deployment:fields["--deployment"],...args[0]==="connect"?{walletEndpoint:fields["--wallet-endpoint"],identityKey:fields["--identity-key"]}:{},...args[0]==="restore"?{restore:{rootFile:fields["--root-file"],backupFile:fields["--backup-file"],connectionFile:fields["--connection-file"],operationsFile:fields["--operations-file"]}}:{}}}function readParticipantMcpConfig(args){if(args.length===1&&["--help","-h"].includes(args[0]))return null;let walletDirectory;let connectionFile;const seen=new Set;for(let i=0;i<args.length;i++){const key=args[i];if(seen.has(key))throw new Error("participant_configuration_invalid");seen.add(key);const value=args[++i];if(!value||value.startsWith("--"))throw new Error("participant_configuration_invalid");if(key==="--wallet-dir")walletDirectory=value;else if(key==="--connection-file")connectionFile=value;else throw new Error("participant_configuration_invalid")}if(!walletDirectory)throw new Error("participant_configuration_invalid");return{walletDirectory,...connectionFile?{connectionFile}:{}}}if(import.meta.main){silenceParticipantConsole();let runtime;let participant;let closing;const setupMode=["setup","restore","connect"].includes(process.argv[2]??"");const invocationMode=["tools","call"].includes(process.argv[2]??"");const close=()=>closing??=(async()=>{try{await participant?.close()}finally{await runtime?.close()}})();const closeInvocation=async()=>{try{await close()}catch{process.stderr.write(JSON.stringify({error:participantErrorDiagnostic(null,"participant_close_unavailable")})+`
|
|
13
|
-
`);process.exitCode=1}};try{const args=process.argv.slice(2);const invocation=invocationMode?(await import("./chunk-
|
|
14
|
-
`)}else if(!config)process.stderr.write(usage+invocationUsage);else{const[{openAgentParticipantRuntime},{createMapAppParticipantServer,PARTICIPANT_MCP_MAX_MESSAGE_BYTES}]=await Promise.all([import("./chunk-
|
|
15
|
-
`);process.exit(1)})};process.once("SIGINT",stop);process.once("SIGTERM",stop);if(invocation){try{const outcome=await(await import("./chunk-
|
|
16
|
-
`);process.exitCode="isError"in outcome&&outcome.isError?1:0}finally{await closeInvocation();process.off("SIGINT",stop);process.off("SIGTERM",stop)}}else{process.stdin.once("end",stop);await participant.server.connect(new StdioServerTransport(process.stdin,process.stdout,{maxBufferSize:PARTICIPANT_MCP_MAX_MESSAGE_BYTES}))}}}catch(error){if(invocationMode){process.stdout.write(JSON.stringify((await import("./chunk-
|
|
13
|
+
`);process.exitCode=1}};try{const args=process.argv.slice(2);const invocation=invocationMode?(await import("./chunk-t3cx6wmg.js")).readParticipantInvocation(args):null;const setup=readParticipantSetupCommand(args);const config=setup?null:readParticipantMcpConfig(invocation?.walletArgs??args);if(setup){const{setupParticipantWallet,connectParticipantWallet}=await import("./chunk-t7bheq4v.js");const outcome=setup.walletEndpoint&&setup.identityKey?await connectParticipantWallet({...setup,walletEndpoint:setup.walletEndpoint,identityKey:setup.identityKey}):await setupParticipantWallet(setup);process.stdout.write(JSON.stringify(outcome)+`
|
|
14
|
+
`)}else if(!config)process.stderr.write(usage+invocationUsage);else{const[{openAgentParticipantRuntime},{createMapAppParticipantServer,PARTICIPANT_MCP_MAX_MESSAGE_BYTES}]=await Promise.all([import("./chunk-466n50gb.js"),import("./chunk-a2rdf4kd.js")]);const invocationArgs=invocation?await(await import("./chunk-t3cx6wmg.js")).readInvocationArguments(invocation.argumentsFile,PARTICIPANT_MCP_MAX_MESSAGE_BYTES):undefined;runtime=await openAgentParticipantRuntime(config);participant=createMapAppParticipantServer(runtime);const stop=()=>{close().then(()=>process.exit(invocation?130:0),()=>{process.stderr.write(JSON.stringify({error:participantErrorDiagnostic(null,"participant_close_unavailable")})+`
|
|
15
|
+
`);process.exit(1)})};process.once("SIGINT",stop);process.once("SIGTERM",stop);if(invocation){try{const outcome=await(await import("./chunk-t3cx6wmg.js")).invokeParticipant(participant.server,invocation,invocationArgs);process.stdout.write(JSON.stringify(outcome)+`
|
|
16
|
+
`);process.exitCode="isError"in outcome&&outcome.isError?1:0}finally{await closeInvocation();process.off("SIGINT",stop);process.off("SIGTERM",stop)}}else{process.stdin.once("end",stop);await participant.server.connect(new StdioServerTransport(process.stdin,process.stdout,{maxBufferSize:PARTICIPANT_MCP_MAX_MESSAGE_BYTES}))}}}catch(error){if(invocationMode){process.stdout.write(JSON.stringify((await import("./chunk-t3cx6wmg.js")).invocationFailure(error))+`
|
|
17
17
|
`);await closeInvocation();process.exitCode=1}else{const diagnostic=participantErrorDiagnostic(error,setupMode?"participant_setup_unavailable":"participant_startup_unavailable");if(setupMode){process.stdout.write(JSON.stringify({state:"blocked",reason:diagnostic.code,diagnostic})+`
|
|
18
18
|
`)}process.stderr.write(JSON.stringify({error:diagnostic})+`
|
|
19
19
|
`);await closeInvocation();process.exitCode=1}}}export{readParticipantSetupCommand,readParticipantMcpConfig};
|
package/distribution.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "mapapp-agent-connector-distribution/v1",
|
|
3
3
|
"name": "@jdr377/mapapp-agent-connector",
|
|
4
|
-
"version": "0.1.0-pre.
|
|
4
|
+
"version": "0.1.0-pre.15",
|
|
5
5
|
"runtime": {
|
|
6
6
|
"bun": "1.3.11",
|
|
7
7
|
"requirement": ">=1.3.11 <2.0.0",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"path": "scripts/lib/agentParticipantRuntime.ts",
|
|
42
|
-
"sha256": "
|
|
42
|
+
"sha256": "0f2ff3900379555e4b233736892fcd6d0ef33771422c668bb132c28c8faaae8b"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"path": "scripts/lib/agentParticipantSetup.ts",
|
|
46
|
-
"sha256": "
|
|
46
|
+
"sha256": "8c45bced553b3321e275cf793d3c2c7ae1ffc18d4dcae92fabb8ad69baa5ac0e"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"path": "server/agent/contract.ts",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"path": "server/agent/mcp/diagnostics.ts",
|
|
66
|
-
"sha256": "
|
|
66
|
+
"sha256": "4141556661ed520a9b4783f565a377ae1def85b7b218ceb3aae16f7ff70e7e47"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"path": "server/agent/mcp/invoke.ts",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"path": "server/agent/mcp/participant.ts",
|
|
74
|
-
"sha256": "
|
|
74
|
+
"sha256": "8be16e4c4044e7a8a85fb46157645d12a83ee2d1856c933351e51cf1cc700af5"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"path": "server/agent/mcp/publication.ts",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"path": "server/agent/onboarding.ts",
|
|
82
|
-
"sha256": "
|
|
82
|
+
"sha256": "0928f8840e5db452175208706c5e04072e521a55b5c0e062bb628726847dbbb6"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
"path": "server/agent/parser.ts",
|
|
@@ -131,11 +131,11 @@
|
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
"path": "src/bitcoin/agentIdentity.ts",
|
|
134
|
-
"sha256": "
|
|
134
|
+
"sha256": "b7bdc1962d8d347a8cdd8208d4ba5556133602cccf29846e715d7a97ba281846"
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
"path": "src/bitcoin/agentLocks.ts",
|
|
138
|
-
"sha256": "
|
|
138
|
+
"sha256": "0bbf5a8527f06ca212dbd2f64b8eaea581e29bde33284742354f8d09f611bdfc"
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
"path": "src/bitcoin/agentMedia.ts",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
"path": "src/bitcoin/agentPaidPost.ts",
|
|
150
|
-
"sha256": "
|
|
150
|
+
"sha256": "6e54037d69a4f906c7a477c2b52345696b8ed0ce0397d25b108d1f5595715c02"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
"path": "src/bitcoin/agentParticipantBinding.ts",
|
|
@@ -155,15 +155,15 @@
|
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"path": "src/bitcoin/agentPayment.ts",
|
|
158
|
-
"sha256": "
|
|
158
|
+
"sha256": "04a81690e10228dbac3aa098ba5555d03d310713e31d4de97a9fded61ea5e091"
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
"path": "src/bitcoin/agentSocialAction.ts",
|
|
162
|
-
"sha256": "
|
|
162
|
+
"sha256": "1aeb1da1dcdf22acf6bd3199920996596141a66c3a46d822bc482710f4267620"
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"path": "src/bitcoin/agentSponsoredPost.ts",
|
|
166
|
-
"sha256": "
|
|
166
|
+
"sha256": "2a2e0e6812367e719b3b870919d6f4cbc9d90a8533d7775f2cc35f91f355efd1"
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
"path": "src/bitcoin/agentWalletConnection.ts",
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
181
|
"path": "src/bitcoin/localIntentStore.ts",
|
|
182
|
-
"sha256": "
|
|
182
|
+
"sha256": "5149377dac6ce833caacd5d4276be598efa44096fb45f2b6d8b010672e242b21"
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"path": "src/bitcoin/locks.ts",
|
|
@@ -275,20 +275,20 @@
|
|
|
275
275
|
}
|
|
276
276
|
],
|
|
277
277
|
"files": {
|
|
278
|
-
"README.md": "
|
|
278
|
+
"README.md": "dae6296f8d52fd57cb342d4e006aff2b83d1f26919bf68ce71be9d619e31571a",
|
|
279
279
|
"bun.lock": "70b49fe644812578e2c365f4600fa57b694710f16a8095dc05e4dbc257b3c58a",
|
|
280
|
-
"dist/chunk-
|
|
281
|
-
"dist/chunk-
|
|
280
|
+
"dist/chunk-466n50gb.js": "20cbfa26d822b5027bf9c1ad3691b4c0da282ab63da9a6b39a2114ef576e7518",
|
|
281
|
+
"dist/chunk-a2rdf4kd.js": "7404baf0fdba1cc041525c8e01e7501273fc4982e950df0bd0c2422432646f4a",
|
|
282
282
|
"dist/chunk-btwmey1h.js": "4e3cec1f9adaea9464cd99ea40ea0b7a693d800040e59540856f6c2b8ff013ee",
|
|
283
283
|
"dist/chunk-c74qq5ek.js": "36c949a5d21a3a2ac2c0e7a1020ebc995f1b665194ea43e8e29244eb8e166257",
|
|
284
|
-
"dist/chunk-d722pj7f.js": "336ba703c6c160964f01555607abef971bde2ce2c2c1382f62c68bc319a3fb0e",
|
|
285
284
|
"dist/chunk-e6y2yzbj.js": "4be64909a0536718a794f3d7bd11c4b5af95097ca7295c05cde1394a80027b38",
|
|
286
|
-
"dist/chunk-
|
|
287
|
-
"dist/chunk-
|
|
288
|
-
"dist/chunk-
|
|
289
|
-
"dist/chunk-
|
|
290
|
-
"dist/
|
|
291
|
-
"
|
|
285
|
+
"dist/chunk-fp3attdv.js": "4f6e784c20870d146fe80a92c3eb354b3f60e96a6b6b484a01b75f5b01d8b238",
|
|
286
|
+
"dist/chunk-mb8a3fs5.js": "387a80cf141a2f6039d615f98f4ea452f147d8dcf459e0c1fcded70d4aecc8db",
|
|
287
|
+
"dist/chunk-t3cx6wmg.js": "efab462d17bd4f3fb7d0502c713f99272f74895f590b5e4ff34763ad31e4b77a",
|
|
288
|
+
"dist/chunk-t7bheq4v.js": "c81d36e33f6226d4e158cb78401622af8c842a62a989781889909422e9101173",
|
|
289
|
+
"dist/chunk-y7vmpgeg.js": "fc15ca8f1c149f1adec984d86b83b518664fedc041d04c479d28ec49ea98de08",
|
|
290
|
+
"dist/participant-mcp-server.js": "d9ed5ca93ec516abd3ff759edd55419cc49d2b6a492c9258e59bca22978f7454",
|
|
291
|
+
"package.json": "cb7a1f8dd650aeeedbd72e2e4b2742fc86fd7cb679fe6699f59a4c1df30c3adf"
|
|
292
292
|
},
|
|
293
293
|
"dependencies": {
|
|
294
294
|
"@1sat/actions": "0.0.224",
|
package/package.json
CHANGED