@adapt-toolkit/a2adapt 0.2.0
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 +34 -0
- package/dist/hooks/runner.js +25 -0
- package/dist/index.js +21179 -0
- package/dist/mufl_code/actor.mu +24 -0
- package/dist/mufl_code/config.mufl +19 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @adapt-toolkit/a2adapt
|
|
2
|
+
|
|
3
|
+
MCP server for **a2adapt** — a native ADAPT node hosting one packet, exposing secure
|
|
4
|
+
agent-to-agent messaging tools over stdio. Distributed as part of the
|
|
5
|
+
[a2adapt Claude Code plugin](https://github.com/adapt-toolkit/a2adapt).
|
|
6
|
+
|
|
7
|
+
The server **is** the node: on startup it boots a single ADAPT packet (a MUFL
|
|
8
|
+
messenger), restores prior state from the state dir, connects to the broker, and
|
|
9
|
+
exposes six tools — each a thin wrapper over one MUFL user transaction:
|
|
10
|
+
|
|
11
|
+
- `generate_invite` — named invite to share out-of-band
|
|
12
|
+
- `add_contact` — add a contact from an invite blob (TOFU)
|
|
13
|
+
- `list_contacts`
|
|
14
|
+
- `send_message` — end-to-end encrypted
|
|
15
|
+
- `process_incoming_message` — drain + decrypt inbound from the broker
|
|
16
|
+
- `list_incoming_messages`
|
|
17
|
+
|
|
18
|
+
## Configuration
|
|
19
|
+
|
|
20
|
+
| Env var | Default | Meaning |
|
|
21
|
+
|---------|---------|---------|
|
|
22
|
+
| `A2ADAPT_STATE_DIR` | `~/.a2adapt` | Node identity + serialized state. Distinct per node. |
|
|
23
|
+
| `A2ADAPT_BROKER_URL` | `ws://localhost:9000` | The ADAPT broker to connect through. |
|
|
24
|
+
|
|
25
|
+
## Build
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm run build # esbuild → dist/index.js (+ dist/hooks/runner.js)
|
|
29
|
+
npm run typecheck
|
|
30
|
+
npm run dev # run under tsx
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
See the [repo README](https://github.com/adapt-toolkit/a2adapt#readme) for install
|
|
34
|
+
and quickstart.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/hooks/runner.ts
|
|
5
|
+
async function sessionStart() {
|
|
6
|
+
}
|
|
7
|
+
async function userPromptSubmit() {
|
|
8
|
+
}
|
|
9
|
+
async function main() {
|
|
10
|
+
const kind = process.argv[2] ?? "";
|
|
11
|
+
switch (kind) {
|
|
12
|
+
case "session-start":
|
|
13
|
+
await sessionStart();
|
|
14
|
+
break;
|
|
15
|
+
case "user-prompt-submit":
|
|
16
|
+
await userPromptSubmit();
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
main().catch((err) => {
|
|
23
|
+
process.stderr.write(`a2adapt hook: ${err?.stack ?? err}
|
|
24
|
+
`);
|
|
25
|
+
}).finally(() => process.exit(0));
|